Figures - ESTS-Variants/varianTeX GitHub Wiki

Formatting Figures

Straightforward cases

To add figures to essays, we follow the standard procedure of using the \begin{figure} environment, as explained in the Overleaf documentation. A simple example of an image in one of our essays can be found in Italia 2024:

\begin{figure}[H]
    \centering
    \frame{\includegraphics[width=\textwidth]{media/italia1.png}}    
    \caption{First page of the manuscript of \emph{Eros e Priapo} (\emph{Eros
and Priapus}), original version (Archivio Liberati in Villafranca di
Verona), c. 65.}
    \label{fig:italia1}
\end{figure}

Notes

Positioning

Here, [H] tells the compiler where to position the image. h stands for 'here, approximately', and when used as a capital (H) it means 'here, exactly' (LaTeX's internal layouting sensibilities be damned). Other options are t for the 'top' of the page, b for the 'bottom', and p puts the image on a separate 'page'.

Image uploading

For this to work, the LaTeX project obviously needs to include the image. As the example shows, we collect all images in a folder called media. If the image doesn't load, be sure to check the path, and the extension! Some contributions include combinations of .jpeg, .jpg, and/or .png images.

Caption

As the example shows, we add the \caption{} below the loaded image file (\includegraphics{}), this makes sure the caption also appears below the image in the compiled PDF.

Copyright statement

By default, the CC-BY license we publish our essays under only pertains to the published text, not to the images reproduced in them. This is because the copyright of images usually doesn't belong to the authors, and are instead reproduced with permission of (third-party) copyright owners. This means that they have their own copyright licenses attached to them. That is why, in the HTML version, we need to add a copyright statement to each of the images; without it, their default license is 'All rights reserved'. We should probably look into doing something similar with the PDF version.

Label

As the example shows, the \label{} should come below the \caption{}. Doing so can fix some issues in some cases. We have a convention where we start labels with the type of item we're labelling (here, a 'figure', so fig:, and then either use the author's name and a number, or a quick description of the image.

Frame

As the example shows, we usually add a frame (1px solid black) around images. To automatically \frame{} all images in a .tex file:

  • Find: \\includegraphics(.*)
  • Replace: \\frame{\includegraphics$1}

References to and from images

In the text, when using parenthetical references, abbreviate ‘Figure’ to ‘Fig.’ (as here in Italia 2024):

(Fig. \ref{fig:italia3})

When mentioning a figure in text, write the word in full (as here in Italia 2024):

The example in Figure \ref{fig:italia9a}, c. 223r, (``insegnamento'' [teaching] / ``trattamento'' [treatment]), is an example of an \emph{adiaphora} variant.

Footnotes inside figures or tables

Since figures and tables are special environments inside your document environment, they are notoriously difficult to add footnotes to. We found that the most elegant solution to this issue, is to separate the footnote text from the footnote marker (placing the latter outside of the table or figure environment), and to temporarily switch to symbols as footnote markers -- to make sure you don't interfere with the numbering of all the regular footnotes. In practice, applied to a table, this solution looks as follows:

\renewcommand*{\thefootnote}{\fnsymbol{footnote}}

\begin{table}[h!]
\begin{tabular}{c|c|c}

1a & 1b & 1c\footnotemark[1] \\
\midrule
2a & 2b & 2c\footnotemark[2] \\
  
\end{tabular}
\end{table}

\footnotetext[1]{a footnote to cell 1c}
\footnotetext[2]{a footnote to cell 2c}
\renewcommand*{\thefootnote}{\arabic{footnote}} 

Here, the first \renewcommand{} switches the footnote mark to symbols, the second one reverts it back to numbers.

Visualizing complex tabular translations from figures

\begin{quote}
\begin{center}

\begin{tabular}{p{.45\textwidth} p{.25\textwidth}}
	original up-left  & original up-right \\ 
	original low-left & \\
\end{tabular}    
\end{center}

\begin{center}
\begin{equation*}
	\left[\begin{tabular}{p{.45\textwidth} p{.25\textwidth}}
   		\text{translation up-left} & \text{translation up-right} \\
    	\text{translation low-left} \\
	\end{tabular}\right]
\end{equation*}

\end{center}
\begin{flushright}
(Fig. \ref{fig:identifier})
\end{flushright}
\end{quote}
    \frame{\includegraphics[width=\textwidth]{media/defenu2.png}}
    \begin{center}
    \begin{tabular}{p{.80\textwidth}}
        \hspace{4.5em} \textsubscript{alma} \\
        E \sout{ha} minha é aquella luz que não mais haverá \\
        \hspace{13em} nos candelabros\ldots{} \\
    \end{tabular}
    \end{center}
    
    \begin{center}
    \begin{equation*}
	\left[\begin{tabular}{p{.80\textwidth}}
   		\text{\hspace{4em}\textsubscript{my soul}} \\
        \text{And \sout{mine} is the light that will never be again} \\
        \text{\hspace{12em}in the candelabrums\ldots{}} \\
	\end{tabular}\right]
    \end{equation*}
    \end{center}

\subfigure[Line 39]{
    \centering\small
    \hspace{\textwidth}
    \label{fig:defenu2a}
}