Skip to content

Instantly share code, notes, and snippets.

@nicola-gigante
Created March 12, 2018 05:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicola-gigante/f6abd7cc63935ce560818330a4bb8cb2 to your computer and use it in GitHub Desktop.
Save nicola-gigante/f6abd7cc63935ce560818330a4bb8cb2 to your computer and use it in GitHub Desktop.
Life-saving LaTeX trick for typography paranoids like me...
\documentclass{article}
\usepackage{microtype}
\newcommand\fitpar{\looseness=-1}
\begin{document}
This is a long paragraph on multiple lines, really a lot of useless lines, with
lots of useless characters and lots of useless punctuation, which could fit
better into four lines. This trick works at its best on long paragraphs because
there's more room to play with spaces and glues so we can avoid having this ugly
extra word.
\bigskip
This is a long paragraph on multiple lines, really a lot of useless lines, with
lots of useless characters and lots of useless punctuation, which could fit
better into four lines. This trick works at its best on long paragraphs because
there's more room to play with spaces and glues so we can avoid having this ugly
extra word.\fitpar
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment