1

When I write text in frac, it looks bad no space... bad font. How can I change it

\documentclass{article}
\begin{document}
$ \frac{Lorem Ipsum}{abc dfe}$
\end{document}

enter image description here

2
  • 9
    In math mode, letters are spaced like a product of variables. Ifyou really want text, load amsmath and use frac{\text{Lorem Ipsum}}{\text{abc def}}. – Bernard Aug 2 '20 at 22:05
  • 6
    it is unrelated to \frac spaces are ignored in math mode try $abc def$ – David Carlisle Aug 2 '20 at 22:06
1

You could make the space character active in math mode to insert a thick muskip in its place. For this you will have to modify the definition of \obeyspaces (which I should probably propose to the LaTeX core) to make the expansion of the obeyed space overrideable. Then you just have to append \obeyspaces to \everymath and \everydisplay and you are all set to produce the most horrible-looking documents.

\documentclass{article}

\makeatletter
\def\obeyedspace{\space}
\def\@obeyedspace{\obeyedspace}
{\obeyspaces\global\let \@obeyedspace}
\makeatother

\renewcommand\obeyedspace{\;}
\everydisplay={\obeyspaces}
\everymath={\obeyspaces}

\begin{document}

$\frac{Lorem Ipsum}{abc dfe}$

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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