6

I am attempting to display three figures, side by side in a table. I've placed the table inside the figure* environment to make the table the full width of the page, however the corresponding caption then overlaps the table. I can hackishly fix this by appending an empty row to the bottom of the table and making it sufficiently large, but I was wondering if there is a more elegant solution.

Here is a model working example

\documentclass[nohyper,nofonts]{tufte-handout}
\usepackage{pgfplots}
\usepackage{lipsum}
\newcommand{\emptyfig}{\begin{tikzpicture}%
    \begin{axis}[width=\textwidth/3,height=\textwidth/3]%
            %\addplot[black] coordinates { (0,0) (1,1) };
    \end{axis}%
\end{tikzpicture}}
\begin{document}
\begin{figure*}
    \begin{tabular}{ccc}
            \emptyfig & \emptyfig & \emptyfig \\
            Hi & Hi & Hi
    \end{tabular}
    \caption{This is an overlapping caption}
\end{figure*}
\end{document}

and the corresponding output. Model working example output

5

You can wrap your tabular environment in a command that makes a box, such as makebox:

    \makebox[\textwidth]{%
        \begin{tabular}{ccc}
            \emptyfig & \emptyfig & \emptyfig \\
            Hi        & Hi        & Hi
        \end{tabular}%
    }

screenshot

% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass[nohyper,nofonts]{tufte-handout}
\usepackage{graphicx}
\usepackage{lipsum}
\newcommand{\emptyfig}{\includegraphics[width=.3\textwidth]{example-image-a}}
\begin{document}
\begin{figure*}
    \makebox[\textwidth]{%
        \begin{tabular}{ccc}
            \emptyfig & \emptyfig & \emptyfig \\
            Hi        & Hi        & Hi
        \end{tabular}%
    }
    \caption{This is an overlapping caption}
\end{figure*}
\end{document}
  • Is this issue a "feature" of tufte-handout? – jotagah Apr 25 '14 at 0:40
  • @jotagah no, I believe it's because of the use of a tabular – cmhughes Apr 25 '14 at 15:35
2

For what it's worth, there are other solutions:

Option 1

Simply add \vspace*{desired space} before the caption:

\documentclass[nohyper,nofonts]{tufte-handout}
\usepackage{pgfplots}
\usepackage{lipsum}
\newcommand{\emptyfig}{\begin{tikzpicture}%
    \begin{axis}[width=\textwidth/3,height=\textwidth/3]%
            %\addplot[black] coordinates { (0,0) (1,1) };
    \end{axis}%
\end{tikzpicture}}
\begin{document}
\begin{figure*}
    \begin{tabular}{ccc}
            \emptyfig & \emptyfig & \emptyfig \\
            Hi & Hi & Hi
    \end{tabular}
    \vspace*{1cm}
    \caption{This is an overlapping caption}
\end{figure*}
\end{document}

Option 2

Use optional parameter for the \caption command:

\documentclass[nohyper,nofonts]{tufte-handout}
\usepackage{pgfplots}
\usepackage{lipsum}
\newcommand{\emptyfig}{\begin{tikzpicture}%
    \begin{axis}[width=\textwidth/3,height=\textwidth/3]%
            %\addplot[black] coordinates { (0,0) (1,1) };
    \end{axis}%
\end{tikzpicture}}
\begin{document}
\begin{figure*}
    \begin{tabular}{ccc}
            \emptyfig & \emptyfig & \emptyfig \\
            Hi & Hi & Hi
    \end{tabular}
    \caption[][6mm]{This is an overlapping caption}
\end{figure*}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.