TeX - LaTeX Asked on July 23, 2021
I want to break before the equation to ensure it doesn’t end up on two lines:
Words words words words words words words words words words words words words words
words words words words words words words words $equation = equation$.
However, I don’t want the resulting "right-indent" on the second line:
How do I make the line stretch?
You want to use =nolinebreak
.
documentclass{article}
usepackage{indentfirst}
begin{document}
subsubsection*{Bad, with texttt{string}}
Words words words words words words words words words words words words words words
words words words words words words words words $equation = equation$.
subsubsection*{Slightly better, with texttt{stringlinebreak}}
Words words words words words words words words words words words words words words
words words words words words words words words linebreak $equation = equation$.
subsubsection*{Even better, with texttt{stringnolinebreak}}
Words words words words words words words words words words words words words words
words words words words words words words words $equation =nolinebreak equation$.
subsubsection*{Even better, with texttt{stringnolinebreak}}
begin{sloppypar}
Words words words words words words words words words words words words words words
words words words words words words words words $equation =nolinebreak equation$.
end{sloppypar}
end{document}
You might object that =nolinebreak
doesn't achieve the result. Actually it does! You may sometimes get an overfull line and in this case you can exercise your judgment in order to fix the typesetting:
=
, orsloppypar
as a last resort as in the fourth example.Can you see a difference between the second and fourth examples? Not in this case, actually, but changing the class might show one.
This is the output with amsart
, for instance.
Can you spot the difference now?
I'm not saying you must use sloppypar
. It should be the last resort; rewording is usually the best strategy and chances are that no action is required if the equation is not too wide and the paragraph is long enough.
Correct answer by egreg on July 23, 2021
If you really want that then use linebreak
not
Answered by David Carlisle on July 23, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP