0

I am getting desperate. I am writing a tufte-book class document with the symmetric option and all figures and tables on even pages are centered as if they were on an odd page. The caption is always shown right to the image.

I tried using the \forceversofloat command in the figure or table environments, but it does not work: there is no change floats are invariably set in the wrong position.

This is my code:

\documentclass[a4paper,symmetric,openany,nobib]{tufte-book}
\usepackage[utf8]{inputenc}

\usepackage{geometry, sectsty, graphicx, array, changepage, marginfix, multirow, pgf-pie, amsmath, mathabx, xfrac, upgreek}
\usepackage{lipsum}

\geometry{top=22mm,bottom=18mm,right=27mm,left=20mm,marginparwidth=15mm,marginparsep=4mm}
\setlength{\headheight}{5.0pt}

\begin{document}
\chapter{One}
\lipsum[1]

Here is a floating element on an odd page, and all is fine.

\begin{table}[!htb]
    \centering
    \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
        \hline
        A&B&C&D&F&G&H&I&J&K&L&M&N&O&P&Q\\ \hline
        1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16\\ \hline
    \end{tabular}
\end{table}

\lipsum[1]

\newpage
\lipsum[1]

And here is a floating element on an even page, which is treated as if it were on an odd one.

\begin{table}[!htb]
    \forceversofloat\centering
    \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
        \hline
        A&B&C&D&F&G&H&I&J&K&L&M&N&O&P&Q\\ \hline
        1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16\\ \hline
    \end{tabular}
\end{table}

\lipsum[1]

\end{document}

And this is what I get: odd page even page

2
  • Welcome to TeX.SE! Well, without seeing any code it is only guessing what happens on your computer. Please show us a short compilable TeX code resulting in your issue!
    – Mensch
    Commented Mar 15 at 9:33
  • I added the code and two images, I hope it is more clear now :)
    – Djbat
    Commented Mar 15 at 10:37

1 Answer 1

0

The tufte class defines a floating environment spanning the text area and the side margin area, for placing captions in the margin space.

It will generate the table or figure and its caption. In your example the caption is missing, which causes the misalignment.

You can improve the result by adding a caption or, if not necessary, using a centered tabular form.

(1) Adding a caption

H

Hx

% !TeX TS-program = pdflatex

\documentclass[a4paper,
symmetric,
openany,
nobib]{tufte-book}
\usepackage[utf8]{inputenc}

\usepackage{%
%%  geometry, loaded by the class <<<<<
     sectsty, graphicx, array, changepage, marginfix, multirow, pgf-pie, amsmath, mathabx, xfrac, upgreek}
\usepackage{lipsum}

\geometry{% 
top=22mm,
bottom=18mm,
right=27mm,
left=20mm,  
marginparwidth=15mm,
marginparsep=4mm,
showframe=true, % optional added to show margins <<<<<<<<<<<
}

\begin{document}

\chapter{One}
\lipsum[1]

Here is a floating element on an odd page, and all is fine.

\begin{table}[!htb]
\centering
    \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
        \hline
        A&B&C&D&F&G&H&I&J&K&L&M&N&O&P&Q\\ \hline
        1&2&3&4&5&6&7&8&1&2&3&4&5&6&7&8\\ \hline
    \end{tabular}
\caption{Odd page} % added <<<<<<<<<<<<<<
\end{table}

\lipsum[1]

\newpage
\lipsum[1]

And here is a floating element on an even page, which is treated as if it were on an odd one.


\begin{table}[!htb]
%       \forceversofloat % Not needed <<<<<<<<<<<<<
\centering
    \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
        \hline
        A&B&C&D&F&G&H&I&J&K&L&M&N&O&P&Q\\ \hline
        1&2&3&4&5&6&7&8&1&2&3&4&5&6&7&8\\ \hline
    \end{tabular}
\caption{Even page}  % added <<<<<<<<<<<<<<
\end{table}

\lipsum[1]  

\end{document}

(2) Centered tabular

J

% !TeX TS-program = pdflatex

\documentclass[a4paper,
symmetric,
openany,
nobib]{tufte-book}
\usepackage[utf8]{inputenc}

\usepackage{%
%%  geometry, loaded by the class <<<<<
     sectsty, graphicx, array, changepage, marginfix, multirow, pgf-pie, amsmath, mathabx, xfrac, upgreek}
\usepackage{lipsum}

\geometry{% 
top=22mm,
bottom=18mm,
right=27mm,
left=20mm,  
marginparwidth=15mm,
marginparsep=4mm,
showframe=true, % optional added to show margins <<<<<<<<<<<
}

\begin{document}

\chapter{One}
\lipsum[1]

Here is a non-floating element on an odd page, and all is fine.

\begin{center}
    \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
        \hline
        A&B&C&D&F&G&H&I&J&K&L&M&N&O&P&Q\\ \hline
        1&2&3&4&5&6&7&8&1&2&3&4&5&6&7&8\\ \hline
    \end{tabular}
\end{center}

\lipsum[1]

\newpage
\lipsum[1]

And here is a non-floating element on an even page, which is treated as if it were on an odd one.

\begin{center}
    \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
        \hline
        A&B&C&D&F&G&H&I&J&K&L&M&N&O&P&Q\\ \hline
        1&2&3&4&5&6&7&8&1&2&3&4&5&6&7&8\\ \hline
    \end{tabular}
\end{center}

\lipsum[1]  

\end{document
2
  • 1
    Thank you so much! Using an empty caption works perfectly and I am fine with that. I am using the caption package with the labelformat=empty option, and I added \caption{\mbox{}} to every float. I also tried with the center environment, but nothing changes, and I don't know why. Anyway I don't really care now, thanks!
    – Djbat
    Commented Mar 17 at 13:11
  • Thank you for your feedback! Commented Mar 18 at 13:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .