Preventing letters with descenders (g, q, y...) from affecting line spacing

The problem isn't so much the descender in the text as the fact that the height of the image forces \lineskip glue spacing. LaTeX doesn't have that good a way to avoid that but you can do this

\documentclass{article}
\usepackage{graphicx}

\showoutput
\begin{document}

glah


\mbox{}\\
\includegraphics[width=4cm]{example-image}

\end{document}

so that you get \baselineskip spacing between the text and the empty \mbox (which therefore adjusts to the depth of the text) and get a fixed \lineskip spacing in all cases before the image. If the empty box line is more space than you want use \\[-\baselineskip] or whatever instead of \\ after the \mbox{}


Remove the previous depth before adding the vertical space.

\documentclass{article}
\usepackage{graphicx}

\newcommand{\fixedvspace}[1]{%
  \par\kern-\prevdepth\vspace{#1}%
}

\begin{document}

\begin{minipage}[t]{4cm}
\hrule

blah
\fixedvspace{0.2\baselineskip}
\includegraphics[width=4cm]{example-image}

\end{minipage}%
\begin{minipage}[t]{4cm}
\hrule

glah
\fixedvspace{0.2\baselineskip}
\includegraphics[width=4cm]{example-image}

\end{minipage}

\end{document}

The `\hrule here is just to anchor the minipage to have the reference point at the very top.

There may be simpler workarounds in your specific setting that seems quite specialized. The trick could be hidden in the syntax you use for laying out the card game.

enter image description here

Tags:

Spacing