Tag Info

New answers tagged

0

You can use CellEventActions by adding it to the Stylesheet or hard-coding it for each cell. Here is a cell that changes when clicked. DynamicModule[{bgd = LightRed}, CellPrint[ TextCell["Click within this cell", "Output", Background -> Dynamic[bgd], CellEventActions -> {"MouseClicked" :> (bgd = LightGreen)} ...


0

Fraction in KeyEventTranslations.tr modified for Version 10.2: in /usr/local/Wolfram/Mathematica/10.2/SystemFiles/FrontEnd/TextResources/X/KeyEventTranslation.tr Line: Item[KeyEvent["/", Modifiers -> {Control}], "Fraction"], modified as follows: Zeile: Item[KeyEvent["/", Modifiers -> {Control,Shift}], "Fraction"],


3

In case this is helpful to anyone stumbling upon this thread this as I did, here is simpler code to select all cells from the end of a notebook to the current evaluation cell. endAtID = First @ EvaluationCell[]; SelectionMove[EvaluationNotebook[], After, Notebook]; SelectionMove[EvaluationNotebook[], Previous, Cell]; While[ SelectedCells[][[1, 1]] =!= ...


2

The text is stored (upon releasing the mouse button) in the variable val with this code: EventHandler[ InputField[], {"MouseUp" :> (val = CurrentValue["SelectionData"])}, PassEventsDown -> True ] It should work in other contexts as well besides InputField, as I noted in my comment it is not clear from your question what the context is.


2

The following copies the selected text to the clipboard DynamicModule[{}, EventHandler[Dynamic@InputField[x], {"MouseUp" :> FrontEndExecute[FrontEndToken[FrontEnd`SelectedNotebook[], "Copy"]]}, PassEventsDown -> True]]


0

This problem has occurred since version 9 on one of my two computers, but only when I disabled the external monitor and used the laptop's LCD. Normally I extend the desktop across the external monitor (1920x1200, main display having the Windows taskbar) and the laptop LCD (1920x1080). In the dual-monitor configuration there is no problem. Today I installed ...


6

One way, based on the self-delete example in the documentation for Button: Button["Start", SelectionMove[ButtonNotebook[], All, GeneratedCell]; NotebookDelete[ButtonNotebook[]]; Print[Plot[x^3, {x, -1, 1}]]]


4

Can't be done. This can be verified by converting the input form expression into standard form. Start with Integrate[1/(x^2 + y^2 + z^2)^(5/2), {x, 0, b}, {y, 0, l}, GenerateConditions -> False] Select the expression and click on Standard Form in the Convert To sub-menu of the Cell menu. (That choice will be checked as if it were active, but ...


0

The following code is usable and does the trick, except it does not permit constraining entry points to specific values, for example even numbers on the horizontal axis (like years for example). Still, it does everything else, and also permits very flexible adjustment of the size and shape of the input space, so I think it is worth sharing. Instructions ...


0

This bug has been fixed as of version 10.0.2. See also these other questions: (58799), (60408), (72750) and (90054).


1

As indicated in the comments, this bug has been fixed as of version 10.0.2. See also these other questions: (58799), (86891), (72750) and (90054).


7

There is a special cell attribute called CellID. I would suggest using this instead of cell tags to avoid the problem that you mentioned with cell tags being inherited. Here's an example of how Select can be used to retrieve a cell with a specific cell ID: nb = CreateWindow[]; cells = <| "name" -> RandomInteger[10^6], "status" -> ...


9

The only solution I have found is to delete the contents of the directory given by: FileNameJoin[{$UserBaseDirectory, "Paclets"}] More specifically it appears to be sufficient to delete a single file: FileNameJoin[{$UserBaseDirectory, "Paclets", "Configuration", "pacletSiteData_10.pmd2"}] To prevent Mathematica freezing on the next start-up I need to ...


4

Mathematica does not support any kind of comment-to-line-end specaial character(s). You will have to resign yourself to living with that. It does support a very useful and easy to apply block un/commenting feature. I am running on OS X, so the keyboard shortcut for the context (mouse-right-click) menu's Un/Comment command is Cmnd+/. I use that do any kind ...


4

This is very efficient for large Notebooks: NotebookPut[Notebook[{}], EvaluationNotebook[]]; (simple replacement of the evaluation notebook with blank notebook). I have tested this method with a Notebook of size 976 Mb containing 36031 Cells and it was cleared out in no time, while the NotebookDelete[Cells[]] method seems to take forever for this ...


5

This will delete everything in the evaluation Notebook: NotebookDelete[Cells[]] This will generate a Palette Button that deletes everything is the selected Notebook: CreatePalette @ Button["Clear Notebook", NotebookDelete @ Cells @ InputNotebook[]] As noted in the comments it is probably just as fast, if not faster, to simply Select All and Clear ...


2

If you mean screen, then ctrl + A to select all cells and then hit del. If you mean memory, then ClearAll["Global`*"] if it does not help, restart...


1

I did not attempt to implement everything you show but only what is needed for the two final examples. I initially seemed to have a problem with precedence but now it is working? I am not certain of what change made the difference, if any, but I'll post what I have now in case it is special in some way. I added these lines at the top of ...


7

Is this what you are after? SetOptions[ EvaluationNotebook[], CellEpilog :> ( SelectionMove[EvaluationNotebook[], All, EvaluationCell]; SelectionMove[EvaluationNotebook[], After, CellContents]; ) ]


0

This simple code generates a CDF which one has to open from within the desired Mathematica or CDF Player version. Then clicking the checkbox will change the corresponding init.m file in the $PreferencesDirectory/FrontEnd folder. CDFDeploy["ChangeInsufficentVersionWarning.cdf", #, Method -> "Standalone", "Target" -> "Player"] &@ ...



Top 50 recent answers are included