The package
microtype
is meant to make small improvements to the final look of a LaTeX document. According to an answer to Should I load microtype with pdflatex? and a comment beneath the answer, one should (almost) always load microtype, and do so via\makeatletter\usepackage{microtype}\g@addto@macro\@verbatim{\microtypesetup{activate=false}}\makeatother%
also:
enumitem
Without microtype, here is the output. Notice how "(2D)" and "(3D)" are nicely aligned:
With microtype, output is altered. Notice that "(2D)" and "(3D)" are not aligned. The "(3D)" part is too far left:
Granted, this is not a big effect but still annoying. I do not think this is an intended effect of microtype but I am not sure... More importantly:
Q: Can I fix it AND still keep microtype?
(Fix it = "(2D)" and "(3D)" are aligned again; of course, should be done automatically and globally for other similar situations as well)
MWE (to enable microtype, uncomment the corresponding line in code):
\documentclass{book}
\usepackage{enumitem}
%\makeatletter\usepackage{microtype}\g@addto@macro\@verbatim{\microtypesetup{activate=false}}\makeatother% %uncomment to see the left-shift
\begin{document}
\begin{enumerate}
\item (2D) Some test here.
(3D) This is too far to the left wrt to (2D) (!very slightly!) with microtype.
\item Some other text here.
\end{enumerate}
\end{document}
I am running
pdflatex
3.141592653-2.6-1.40.22 (MikTeX 21.3), and every package in my local distrubution was updated on 28/04/2021. Output is identical (in terms of misalignment) on Overleaf with default settings.
microtype
v3.0 will now automatically patch some environments to add protrusion (see chapter 9 of the doc).