Questions related to the Mathematica front-end (graphical user interface).

learn more… | top users | synonyms

30
votes
2answers
1k views

Is it possible to change the colors of the highlighted code in the Mathematica frontend?

With Format -> Edit Stylesheet... it is possible to adjust text-properties, text-colors, formatting of equations, etc of a notebook and to use this style-definitions again by installing it as ...
25
votes
2answers
950 views

Automating Esc [[ Esc formatting?

Is it possible to program the Front End to automatically format double square brackets without having to type Esc[[Esc each time? It's awful to have to type Esc ...
22
votes
1answer
933 views

Customizing syntax highlighting for private cell styles

Is there any way to set up a cell style with a particular syntax highlighting? For example, I'd like to have a CProgram cell to write in blue the C special words. I have done it by setting ...
28
votes
3answers
2k views

Antialiasing in 3D

Is it possible? Is it platform specific? Does it rely on the graphics hardware? Why does the antialiasing slider under Preferences > Appearance > Graphics do nothing? I remember seeing some ...
15
votes
3answers
366 views

How can I get the unchanged Box form of an arbitrary expression?

One may observe that MakeBoxes does not give the actual Box form of various expressions: MakeBoxes[{1*^4, 000123, a*b c}] ...
11
votes
3answers
359 views

Why do buttons with ChoiceDialog freeze the front end?

Pressing the button below will freeze my front end. An unpainted white dialog box comes up, then it completely freezes, and I need to forcibly kill the front end. CPU usage stays at zero during ...
25
votes
5answers
864 views

What is the complete list of valid Front End Tokens?

What is the complete list of valid Front End Tokens? Preferably, by version number.
25
votes
3answers
710 views

How do I add new menuitems to menus?

What are some complete examples of what one would include in a FrontEnd init.m that would make use of FrontEnd`AddMenuCommands ...
30
votes
6answers
1k views

How to visualize/edit a big matrix as a table?

Is it possible to visualize/edit a big matrix as a table ? I often end up exporting/copying big tables to Excel for seeing them, but I would prefer to stay in Mathematica and have a similar view as in ...
19
votes
1answer
727 views

Programmatically move the cursor to a desired location on the screen

Is it possible to set/move the mouse pointer's location directly from Mathematica without using external tools like Run["xdotool mousemove x y"]?
11
votes
4answers
518 views

How to automate a FrontEnd return?

I use some custom shortcut keys in KeyEventTranslations.tr. One is for the Delete All Output function: ...
17
votes
4answers
462 views

How can I make an InputField with a proper newline/carriage return?

The return key does not work as expected in an InputField, how can I overcome this?
111
votes
2answers
4k views

Implementing efficient multiple undo

At the time this question was asked, version 10 was not out yet. The Front End of Mathematica 10 does have multiple undo, see the answer by John Fultz. The Mathematica Front End's built-in Undo ...
48
votes
2answers
1k views

Syntax highlighting for your own functions

Mathematica has a useful feature that for functions and special constructs getting passed local variables (for example Minimize or ...
20
votes
1answer
310 views

How can I easily eliminate the dependency of a stylesheet on a non-built-in stylesheet?

As per discussion here: User A has a notebook that uses custom definitions from styles.nb. Now user A passes the notebook to user B. The styles do not show up for B because B does not have styles.nb. ...
11
votes
2answers
2k views

How to change the style definitions for Default.nb?

I have looked over other questions related to style definitions, and looked through the Mathematica 8 documentation, but I do not know why I am having so much difficulty setting the default font in my ...
8
votes
2answers
243 views

How to automate generation of image files?

I need to generate a large number of figures as PNG files, and I'm trying to decide whether Mathematica would be the quickest way to do this. All the figures have the same basic structure, and I'm ...
25
votes
2answers
1k views

Saving a notebook as PDF, preserving syntax highlighting

Currently, one may save notebooks as PDFs from the menu by Save As... and then selecting PDF (on a Mac, I imagine it is similar on other OSs). However, the ...
16
votes
2answers
807 views

How can I change the keyboard shortcut for switching the active window?

The default keyboard shortcut (on Windows at least) for switching focus to the next window is Ctrl+F6, and for switching to the previous windows it's Shift+Ctrl+F6. How can I change this to Ctrl+Tab ...
9
votes
2answers
527 views

How can one define an infix operator with an arbitrary unicode character?

You can setup "UsefulFunction[a, b]" to use custom infix notation "a [LeftRightArrow] b" as follows: ...
16
votes
1answer
425 views

Best way to add KeyEvents and faster Quit

Many users have asked how to add KeyEvents to speed/improve keyboard input. This is just a random example. The technique is always the same. It requires that you ...
13
votes
2answers
499 views

How to replace the style of the inline cell in a StyleSheet

I would like to change a StyleSheet in such a way that any text that is typed into the inline cell (the one created by Ctrl+9) is shown in a different font (e.g. the font of my choice). At present I ...
10
votes
3answers
468 views

How to anchor a Pane's scroll position to the bottom?

Suppose I have a Pane containing some dynamic text, for example that is being updated by a logging function. ...
30
votes
4answers
655 views

Usage of \[InvisibleApplication] and other related invisible characters

From the front end, \[InvisibleApplication] can be entered as Esc @ Esc, and is an invisible operator for @!. By an unfortunate ...
15
votes
2answers
282 views

MathKernel doesn't return all Messages

In Mathematica I run this command: Plot[Sin[x], {x, 1, 15}, GridLines -> error] It generates a Plot with this error message: A GridLines specification ...
46
votes
2answers
1k views

Is it possible to improve Mathematica's auto-completion feature?

In this answer Brett Champion describes how one can intercept and modify the suggestions used for auto-completion. Question: Is it possible to modify the suggestion for the automatic auto-completion ...
25
votes
3answers
663 views

Is there a convenient way to copy/paste text-interspersed SE code snippets into Mathematica?

Is there a way to copy and paste code snippets from SE to Mathematica if these snippets are interspersed with text? Like e.g. in Morphing Graphics, color and location in both the question and answer, ...
28
votes
2answers
623 views

What is the most effective way to setup a Notebook with transparent background but solid contents?

I know there is a Notebook option WindowOpacity can be used to adjust the opacity of a whole notebook. But what I want is keeping the text and graphics and so on ...
13
votes
2answers
406 views

Defining symbol shortcuts in the Front End

I was wondering (because I could not find any documentation on this) if it is possible to do shorthand abbreviations for domains or could one define them? E.g. In[1]:= Element[p,Complexes] ...
23
votes
1answer
506 views

How do I find all the possible events that work with EventHandler?

The EventHandler documentation, More Information section, lists 5 mouse events: ...
15
votes
2answers
2k views

Fontsize is too small

I have this annoyance for a long time now: every Text cell uses the default font size, though it appears too small on my screen. See comparison of same text, same font (Times New Roman), same fontsize ...
15
votes
3answers
602 views

How to convert between various ItemSize/ImageSize units?

How can one convert between the implicit units used by Grid (ems and line height for horizontal and vertical dimensions) and printers points (in ...
12
votes
1answer
520 views

Customize front end to add notifications when evaluation finishes?

Is it possible to add some customization code to the front end, so that when all cells have finished evaluating, some user code can be run? Background: I'm currently running some Mathematica programs ...
10
votes
3answers
421 views

How to select all initialization cells?

Is there an easy way to select all initialization cells (and only those) in a Mathematica notebook?
17
votes
1answer
1k views

Why are some function names red?

I need to evaluate Needs["GraphUtilities`"] before I can use functions such as GraphPath[]. When I do so, some functions get ...
7
votes
1answer
283 views

How make AddMenuCommands work in an init.m

I want to add some items to the Mathematica 8.0.4 Help menu (under Mac OS X). In [$UserBaseDirectory]/Autoload/FrontEnd/init.m I have the following cell: ...
18
votes
2answers
629 views

Is it possible to Print expressions in reverse order?

Let's say I'm debugging a program step by step and want to Print some expressions (using ShowIt, for example). Is there a way to output the result of ...
11
votes
2answers
359 views

Copying Greek text from notebooks as unicode [duplicate]

Possible Duplicate: How to “Copy as Unicode” from a Notebook? How can I copy Greek text from notebooks as proper Unicode that can be pasted into other applications? If I type ...
52
votes
4answers
3k views

Using the Mathematica front-end efficiently for editing notebooks

Background: I have used Vim for 15+ years. There is a certain "one"-ness with the editor one achieves. Emacs users also experience this. Notepad users do not. My current interaction with the ...
26
votes
1answer
727 views

Open two copies of the same notebook

Is there a way to open one notebook in two (or more) different windows? This can be helpful when working with a long notebook and one wants to edit one part of it while looking at a different part. ...
36
votes
3answers
780 views

How can I set up a versioning system within a notebook?

Since the Frontend crashes a lot, for important work it would be nice to have the notebook automatically branch and save itself every so many minutes. For instance, commands like ...
22
votes
2answers
707 views

What are the most common (usual) ways to make palettes with non-trivial functionality?

What are the best (most robust and most convenient) ways to create palettes that can be installed permanently (using Palettes -> Install Palette...) and are safe ...
17
votes
1answer
443 views

Saving my code before cell evaluations: Insurance against front end hanging

I guess my programming working style is not unique. I develop programs one cell at a time, and when I have some confidence about what I did, I put all my mess together refining the code, building up ...
23
votes
1answer
524 views

Do you really want to quit the kernel? Yes!

When I have entered some bad code and hit shift+enter before thinking about the perils of finite RAM my computer obviously starts suffering. I have found two options that usually lets me recover ...
20
votes
2answers
478 views

Programmatically copy code so that all output is commented out

UPDATE: The final palette has a new home here! Please test and provide feedback (usability, suggestions, bugs) A note to the readers and voters: This is intended for community use, so please test the ...
14
votes
4answers
1k views

Is there a shortcut to select all cells above the current cursor position?

Is there a command / menu entry / keyboard shortcut to evaluate all cells above / up to the current cursor position? I have the feeling I am missing something elementary here... Addendum: In fact, it ...
28
votes
2answers
787 views

How can I set an image to be the Notebook's background?

Is it possible to set a notebook's background to a nonscrolling image?
20
votes
2answers
736 views

How do I extract the contents of a selected cell as plain text?

My aim is to extract the contents of an Input cells as plain text. Ideally I would like to be able to select one or more Input cells and press a button which would then extract the text from these ...
17
votes
3answers
456 views

Memory Leak in Frontend - anyone know a workaround?

When using Rasterize on a Graphics expression composed of many differently coloured Graphics objects memory is allocated in the frontend which is then not released or reused when a similar graphic ...
12
votes
2answers
3k views

Delete the current notebook cell using the keyboard

Is there another way than pressing Ctrl+. until the whole cell is selected and then pressing Del? If this is not built in, can I create some sort of a global macro to do this and bind it to a ...