I am writing up a short MathJax introduction and ran into a strange problem. I want to make a table where the first column is the symbol and the second column is the LaTeX code for it. Here's the code
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Without minimal working example I can tell you only, that \text usually is a command from amsmath to print text (with the current text font attributes) inside math. So it makes absolutely no sense to put math code like \cdot or \times inside \text. Maybe you want to show the verbatim code. In this case, you should use, e.g., \verb|\cdot|. See a LaTeX introduction for more information about \verb and the amsldoc for more information about \text.
Note also: MathJax is not LaTeX. So questions about MathJax would be mostly off-topic.
MjK wrote:Without minimal working example I can tell you only, that \text usually is a command from amsmath to print text (with the current text font attributes) inside math. So it makes absolutely no sense to put math code like \cdot or \times inside \text. Maybe you want to show the verbatim code. In this case, you should use, e.g., \verb|\cdot|. See a LaTeX introduction for more information about \verb and the amsldoc for more information about \text.
Note also: MathJax is not LaTeX. So questions about MathJax would be mostly off-topic.
I'm sorry, maybe I wasn't clear enough. I'm writing a MathJax tutorial in LyX. I'm not writing it in MathJax.
I would love to provide a working example. But I can't figure out how to make one!
I looked at the amsmath package. (Thank you, by the way, I hadn't thought to include that in what is, essentially, a text document.) It's recommending \textrm{ \cdot }. But it does the same thing in LyX.
From the Preview panel on this site it appears that the system is expecting the \cdot should be inside math tags, which is why it won't render. If you like:
Once again: It is not absolutely not clear, what you want. As already told: If you want to show the result of, e.g., \times using \textrm would not make sense, because \textrm does not influence math mode and \times requires math mode. But if you want to show the code, you need \verb, e.g.
See a LaTeX introduction for more information about text mode vs. math mode, \textrm vs. \mathrm, and about verbatim material.
And please always explain exactly the expected printing. Always ask yourself: What does someone need to solve my problem, if he or she cannot see into my brain?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p