# What does % mean in MathJax?

I have noticed that, if I type \$100%\times x\$, I get $$100%\times x$$ and not $$100\%\times x$$.

Does % mean to ignore the following text or something like that?

I didn't find an explanation for the action of % in the MathJax Tutorial.

• Note that as with the dollar sign and certain other symbols that have special meaning in MathJax or $\LaTeX$, the literal symbol is most easily produced by "escaping" it, that is prefixing it with a backslash. $\%$ appears as $\%$. Aug 9 '19 at 21:36
• Sidenote: % is used for comments on MATLAB as well Jul 17 '20 at 9:51

A % in this context will denote a comment. Similar to HTTP which marks comments using <!-- a comment can go here --> or several programming languages which use slashes such as //a comment can go here or /*a very long comment spanning several lines can go here*/, the percent sign can be used in LaTeX and related typesetting languages such as MathJax to denote that what follows on the same line should not be rendered or executed. Comments can be helpful to help organize or explain certain code to yourself or others who come behind to read the source.

See this related question from tex.stackexchange.com.

Note that what follows on the same line is what is ignored up until an actual newline character, even in the event that you include \\ which would otherwise be interpreted as beginning a new line.

For example

$$a%b c d \\ e f g h i j\\k l m$$

will render as $$a%b c d \\ e f g h i j\\k l m$$

• Thank you (+1). I understand the concept; I just didn't realize that % is the character to denote a comment Aug 7 '19 at 13:32
• I don't understand why they allow it here.
– user645636
Aug 7 '19 at 17:26
• @RoddyMacPhee MathJax is used by more than just stackexchange. Are you saying you would rather have a custom version of MathJax that disables that feature, making code harder to maintain, rather than just use the same version of MathJax that everywhere else uses for the sake of disabling a single feature? Aug 7 '19 at 17:29
• I just don't see much use to the comments except swearing on a site based system.
– user645636
Aug 7 '19 at 17:31
• @RoddyMacPhee Why did you delete your post? Aug 7 '19 at 18:42
• I left my last math forum due to being edited to reframe my wording. if they didn't like it I could be downvoted. question asker took it upon themselves to edit my answer. They are a frequent editor of my posts. My only reason for being on this site, at all, come down to social pressure not to give up on math.
– user645636
Aug 7 '19 at 19:08
• @RoddyMacPhee that may be deserving of its own meta post, but my opinion is that an edit can (and should) be suggested whenever it actively improves the readability (e.g. formatting, typesetting, grammar,...) while not causing harm or conflicting with the original author's intent. Such an edit should not be taken as an insult and should be taken graciously by the author. If the author disagrees with the edit, they may choose to roll it back as they see fit. Aug 7 '19 at 19:12