0

I'm using \emph to denominate diagrams in my text, and, since they are referenced as almost like mathematical variables, I would like to keep them visually tight. However, LaTeX seems to go in the opposite direction and try really hard to put the maximum amount of justification space around my emphasized text, which looks even worse, since it is slanted text.

I'm thinking that the best solution would be to isolate text inside \emph from the process of justification, but I don't know if it would generate other problems, or if it would look even worse. Does anyone have any ideas?

Here is an example, note the amount of space between the words "Dia." and "1" right next to the diagrams:

Bad justification spacing

Here's the code which generated that thing of beauty, even though I don't think it is very relevant for this specific problem — I'm using babel in Portuguese and sidecap here —:

\begin{SCfigure}[][h!]
    \begin{subfigure}[t]{.29\textwidth}
        \includegraphics[width=1\textwidth]{2 - Problema 4 - Dia 1}
        \caption*{\emph{Dia. 1. Correto}}
    \end{subfigure}
    \hfill
    \begin{subfigure}[t]{.29\textwidth}
        \includegraphics[width=1\textwidth]{2 - Problema 4 - Dia 2}
        \caption*{\emph{Dia. 2. Errado}}
    \end{subfigure}
    \hfill
    \caption*{\textbf{Resposta ao Problema 4}\\\\Preto 1 no \emph{Dia. 1} captura duas pedras.\\\\Se Preto joga 1 no \emph{Dia. 2}, Branco pode resgatar suas pedras estendendo em 2.}
\end{SCfigure}

\pagebreak

\begin{itemize} \item[\textbf{Resposta ao Problema 5}] Preto 1 no \emph{Dia. 1} captura duas pedras.

  Se Preto estende para 1 no \emph{Dia. 2}, Branco pode resgatar suas pedras conectando em 2.

\item[\textbf{Resposta ao Problema 6}] Preto 1 no \emph{Dia. 1} captura as duas pedras marcadas.

  Se Preto estende para 1 no \emph{Dia. 2}, Branco pode resgatar suas duas pedras capturando as duas pedras pretas com 2.

\item[\textbf{Resposta ao Problema 7}] Preto 1 no \emph{Dia. 1} captura duas pedras.

  Se Preto faz atari com 1 em \emph{Dia. 2}, Branco pode resgatar suas pedras e capturar duas do Preto com 2.

\end{itemize}

psygo
  • 438
  • 1
    Since the period in Dia. 1 is not an end-of-sentence period, rather an abbreviation (of Diagrama?), use Dia.\@ 1 instead: that will make the space after the period the same width as other inter-word spaces – Phelype Oleinik Sep 23 '21 at 01:35
  • :O Nicely spotted. What's the name of this technique/entity \@? But besides that, do you know if there's a way of locking the spacing inside Dia. 1 to a minimum and have the rest be justified? – psygo Sep 23 '21 at 01:38
  • 1
    Related: https://stackoverflow.com/questions/2024338 – Dr. Manuel Kuehner Sep 23 '21 at 01:46
  • 2
    Even better: https://tex.stackexchange.com/questions/2229 – Dr. Manuel Kuehner Sep 23 '21 at 01:47
  • 1
    Now that you mention it, I don't think I know the name (if there is one)... Maybe “spacefactor correction” or just backslash-at? Regarding your second question, yes, you can replace the space by something like \hspace{<some amount>}, which won't stretch. Something like \DeclareRobustCommand{\fixedwidthspace}{\leavevmode\nobreak\hspace{\fontdimen2\font}} (\fontdimen2\font is the natural width of a space). – Phelype Oleinik Sep 23 '21 at 01:48
  • 2
    Since "Dia. 1" is really a logical unit, I'd try inserting a tilde, "Dia.~1" to indicate an unbreakable space of ordinary "word space" width. That would re-break the line, and I'm not sure how the rest of the caption would look. But with the really narrow width available here, I'd also go for \raggedright. (This is a subjective decision.) – barbara beeton Sep 23 '21 at 02:11

0 Answers0