[Tex/LaTex] Using the # symbol in equations

math-modesymbols

I want to use the # symbol in Latex equations.
I already tried \#, but it is not working: When the # symbol appears in an equation, then the rest becomes a $ sign instead of #.

Here is my code:

({12#-3-4\div 5#3\%})

Best Answer

In LaTeX # $ % & ~ _ ^ \ { } are treated as reserved characters. If we need to print these characters, we must add backslash before them. This works for

\#
\$
\%
\&
\_
\{
\}

(not for ^, ~ and \).

For instance, % (percent symbol) is used to comment any content in a document or in a template. To print percent symbol we should type \%

For your problem the solution is to type \#.

Related Question