Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions core/latex/utilities.tex
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,19 @@
\unskip{\tiny\dotfill}
}

% The \makebox is exactly \linewidth wide whatever it holds. graphicx's scaling is not
% exact, so `width=\linewidth` can come out a hundredth of a point wider than the line,
% too little for an overfull warning but enough that the picture no longer fits beside
% `center`'s empty \item label: TeX breaks after the label, and an empty centred line --
% a whole \baselineskip -- opens above the drawing. `29/amusement-speed` lost 5 mm to it.
\NewDocumentCommand{\insertPicture}{O{} m}{%
\begin{center}
\IfFileExists{\activeDirectory/#2}{%
\includegraphics[#1]{\activeDirectory/#2}%
}{%
\includegraphics[#1]{example-image}%
\makebox[\linewidth]{%
\IfFileExists{\activeDirectory/#2}{%
\includegraphics[#1]{\activeDirectory/#2}%
}{%
\includegraphics[#1]{example-image}%
}%
}%
\end{center}
}
Expand Down
Loading