Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

As part of another issue, the following has come up. Create an Interpretaion:

Interpretation[Subscript[a, b], a[b]]

Select and copy the $a_b$ output from the notebook. If you paste it into a text file, you get: a[b], which is correct as the Inputform, and what we want.

However, if you select it and choose Copy as Latex, you get: \text{$\$$CellContext$\grave{ }$a}(\text{$\$$CellContext$\grave{ }$b}) in a text file.

I would like to be able to copy this and get the latex as $a_b$, or $a[b]$ as a worst case. Are there any tricks that could help here? (I don't think this has anything to do with subscripts)

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I have a way around it which works under Linux and Mathematica 9.0.1 and uses ToString like this

Mathematica graphics

share|improve this answer
    
Perfect. Confirmed on Mathematica 8 on windows, will verify on 9 on windows next week. I actually prefer the command to copy/paste. Code on the motivating example is also being updated. –  jlperla Aug 23 '13 at 4:14
    
One caveat, in my version at least, is that when you select the string in the output, you should choose "Copy as Plain Text" as otherwise it copies as a string with escape characters, etc. –  jlperla Aug 23 '13 at 4:31
    
@jlperla Yes, you have to do that because ToString makes already the LaTeX transformation. –  halirutan Aug 23 '13 at 9:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.