2

MWE:

\documentclass{article}
\usepackage{microtype}
\renewenvironment{quote}
{\list{}{\leftmargin0.5cm \rightmargin0cm}
\item\relax\fontsize{9.8pt}{11.4pt}\selectfont}
{\endlist}
\begin{document}
\begin{quote}
    When \\
When
\end{quote}
\end{document}

This leads to unjustified lines/letters:

enter image description here

The problem does not appear if I add \par and move the \fontsize command, but this also slightly affects vertical spaces:

\renewenvironment{quote}{\par
\fontsize{9.8pt}{11.4pt}\selectfont
\list{}{\leftmargin0.5cm\rightmargin0cm}
\item\relax}
{\endlist}

My question is related to much older ones, see here or here or here, and apparently there have been fixes introduced (I use TeX Live 2021) but I'm still not able to figure out a solution. How is the correct way to change the quote environment as I intend to?

1
  • 1
    this is fixed in microtype v3.0e, which won't be confused by the font selection commands anymore.
    – Robert
    Commented Jul 31, 2022 at 2:18

1 Answer 1

3

You are adding the space (after the } at the start of the environment) it is not being ignored as you have mis-placed the font change, also for microtype, I think you need \leftprotrusion so that the start of the text is adjusted like the text afer a line break.

enter image description here

\documentclass{article}
\usepackage{microtype}
\renewenvironment{quote}
{\list{}{\leftmargin0.5cm \rightmargin0cm}%
\item\relax\fontsize{9.8pt}{11.4pt}\selectfont\leftprotrusion\ignorespaces}
{\endlist}


\begin{document}

AAAA BBB CCC
AAAA BBB CCC
AAAA BBB CCC
AAAA BBB CCC
AAAA BBB CCC
AAAA BBB CCC
AAAA BBB CCC
AAAA BBB CCC
AAAA BBB CCC
AAAA BBB CCC
\begin{quote}
    When \\
When
\end{quote}
\end{document}

or simpler as noted in comments

\fontsize{9.8pt}{11.4pt}\selectfont\item\relax}

so that microtype can handle the protusion of the characer after \itemwihout being confused by the font change in between.

11
  • When I redefine quote as you suggest, the problem you helped me solve yesterday reappears and the preceding paragraph is squeezed. Is there still a way to redefine it without \par?
    – johnny7
    Commented Mar 30, 2022 at 20:33
  • @johnny7 sorry yes, fixed that, actually if you put microtype back you get a slight shift in the secod line, but not the first but I think that's a different issue Commented Mar 30, 2022 at 21:30
  • Unfortunately, adding \ignorespaces to the definition remains without effect for me.
    – johnny7
    Commented Mar 30, 2022 at 21:36
  • run the code as posted here and you should get the output shown,. Commented Mar 30, 2022 at 21:42
  • 1
    @johnny7 ah try putting the font change just before \item then ending with \item\relax Commented Mar 30, 2022 at 22:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .