Custom Mathematica Shortcut: Copy as LateX

  • Context: Mathematica 
  • Thread starter Thread starter aimforclarity
  • Start date Start date
  • Tags Tags
    Latex Mathematica
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 3K views
aimforclarity
Messages
31
Reaction score
0
This can be very useful, so I thought i'd share.
If you edit the

Code:
> Wolfram Research\Mathematica\8.0\SystemFiles\FrontEnd\TextResources\Windows\MenuSetup.tr
file you can make Strl+Shift+C copy not plain but in LateX format. Very useful. Look for the line in the file that says "&LaTeX" and the one that says "Plain &Text". The & sign gives the underscore letter in the menu. Then replace them with the following:
Code:
    		MenuItem["Plain &Text", FrontEnd`CopySpecial["PlainText"]],
			MenuItem["&LaTeX",
				KernelExecute[ToExpression["FrontEnd`CopyAsTeX[]"]], MenuKey["C", Modifiers->{"Control", "Shift"}],
				MenuEvaluator -> Automatic],

Restart Matematica and you are done.

The question i would have is if anyone knows what *MenuEvaluator* does, or if you know how to do this modification from a notebook in mathematica rather than modifying the config file.
 
Physics news on Phys.org
The MenuEvaluator is a special Mathematica feature that lets you define a function or expression to evaluate when a menu item is selected. It's essentially like a callback that can be used for custom menus or menu items. You can use it to create custom behavior when a menu item is selected, such as executing a certain command or performing a calculation. To modify the config from within a Mathematica notebook, you can use the FrontEndExecute command to edit the file. For more information on this command, please see the following documentation page: https://reference.wolfram.com/language/ref/FrontEndExecute.html