Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I put code inside a math environment in LyX. For example, I want to insert a matrix, that is created via the "\tikzpicture" command, like in the first answer from here. But if I just copy the code from there and paste it into math mode, it turns to text - I don't seems to be able to insert evil red code in math mode. I can only type (which is tiring) some of the code hand, but can't insert text like "\" this automatically is converted from evil red code to a text backslash.

Is there any solution for this ? I would really like to have LyX display to me the matrices on the left and right, from the post of the link above, and have only the middle in evil red code.

(Of course I could just put everything in evil red code, including the math stuff, but then the left and right matrices would also be in code, which would be a pity).

share|improve this question
1  
write the complete code with ERT – Herbert Jun 20 '12 at 10:50
1  
I really hate that LyX refers to code as "Evil". It may be jokey, but it's alienating LyX users from the power of TeX. – Seamus Jun 20 '12 at 12:04
@Herbert Yes, as I said, in the last paragraph, that would be an option...but an ugly one. – user10324 Jul 14 '12 at 14:10
To everybody else who reads this (so far unanswered) question: A negative answer is also a solution (at least then I could stop looking for one!) – user10324 Jul 14 '12 at 14:11

1 Answer

[Something of an extended comment]

Lyx can handle a variety of math mode items, but where it cannot handle them you have to insert raw LaTeX code ('ERT'). Other than extending the Lyx binary, there is not much that can be done here. (Even then, there will still be limits to what Lyx can handle.)

share|improve this answer

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.