5

I have the following sequence of lines:

something is\hfill not required.\\
something is\hfill not required.\\
something is\hfill not required.\\
something is\hfill not required.

In case microtype is enabled the last line turns out wrong.

enter image description here

The problem seems similar to this one or this one. However the provided solutions do not work for my case. Do you have another solution?

Of course I could just use a tabular environment or similar, but these really wouldn't be handy in this case. How could I just disable microtype for this paragraph?


MWE

\documentclass{article}

\usepackage[final]{microtype}

\begin{document}

\begingroup
\microtypesetup{disable} % does not work
\microtypesetup{activate=false,protrusion=false} % does not work
\noindent 
something is\hfill not required.\\
something is\hfill not required.\\
something is\hfill not required.\\
something is\hfill not required.
\endgroup

\end{document}
  • 2
    Try it with an explicit \par at the end: ... not required. \par \endgroup. – Arash Esbati Mar 10 '16 at 16:44
  • That works, note that it requires either \microtypesetup{protrusion=false} or \microtypesetup{activate=false}. \microtypesetup{disable} does still not work. Maybe you want to make that an answer, with an explanation? – thewaywewalk Mar 10 '16 at 16:50
  • 1
    The microtype documentation allows to disable microtype for a paragraph by simply clicking on a button (this is compatible only with recent viewers). I thought looking at the source would be of some help, but I just can't understand them. Maybe someone else? – Clément Mar 10 '16 at 17:40
6

The protrusion extension applies to the entire paragraph. In your MWE, you terminate the paragraph after the \endgroup where \microtypesetup{protrusion=false} is restored again. Terminate the paragraph within the group:

\documentclass{article}

\usepackage[showframe]{geometry}
\usepackage[final]{microtype}

\begin{document}

\begingroup
\microtypesetup{activate=false}
\noindent 
something is\hfill not required.\\
something is\hfill not required.\\
something is\hfill not required.\\
something is\hfill not required.\par
\endgroup

\bigskip

\begingroup
\microtypesetup{activate=false}
\noindent
something is\hfill not required.\\
something is\hfill not required.\\
something is\hfill not required.\\
something is\hfill not required.

\endgroup
\end{document}

enter image description here

\microtypesetup{disable} seems to be an undocumented feature, I haven't tried it.

| improve this answer | |

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.