fmarotta / kaobook

A LaTeX class for books, reports or theses based on https://github.com/kenohori/thesis and https://github.com/Tufte-LaTeX/tufte-latex.
https://github.com/fmarotta/kaobook
LaTeX Project Public License v1.3c
862 stars 186 forks source link

Wide tables are not showing #123

Closed glher closed 3 years ago

glher commented 3 years ago

Prerequisites

Description

When compiling the example/documentation, everything works great (and looks awesome), but the wide figures and tables are not showing.

Minimal Working Example

[You can use the following document to help you create a minimal working example.]

\documentclass{kaobook}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{kaobiblio}
\usepackage{kaotheorems}
\usepackage{kaorefs}

\begin{document}

\title{Bug Report}
\author{Author}
\date{\today}

\frontmatter

\KOMAoptions{twoside=semi}
\maketitle
\KOMAoptions{twoside=false}

\mainmatter
\setchapterstyle{kao}

\chapter{First Chapter}
\blindtext

With the environments \Environment{figure*} and \Environment{table*} you 
can insert figures which span the whole page width. For example, here 
are a wide figure and a wide table.

\begin{figure*}[H]
    \includegraphics{seaside}
    \caption[A wide seaside]{A wide seaside, and a wide caption.
        Credits: By Bushra Feroz, CC BY-SA 4.0, \url{https://commons.wikimedia.org/w/index.php?curid=68724647}}
\end{figure*}

\begin{table*}[H]
    \caption{A wide table with invented data about three people living in the UK. Note that wide figures and tables are centered and their caption also extends into the margin.}
    \begin{tabular}{p{2.0cm} p{2.0cm} p{2.0cm} p{2.0cm} p{2.0cm} p{2.0cm} p{1.5cm}}
        \toprule
        Name    & Surname   & Job       & Salary           & Age   & Height    & Country \\
        \midrule
        Alice   & Red       & Writer    & 4.000 \pounds    & 34    & 167 cm     & England \\
        Bob     & White     & Bartender & 2.000 \pounds    & 24    & 180 cm     & Scotland \\
        Drake   & Green     & Scientist & 4.000 \pounds    & 26    & 175 cm     & Wales \\
        \bottomrule
    \end{tabular}
\end{table*}

\end{document}

Expected behavior: I'm expecting to see the wide table and figure appear

Actual behavior: I tried compiling multiple times (6 to be precise) but this did nothing

Screen Shot 2021-03-31 at 6 48 21 PM

Additional Information

I am using the latest TeXMaker on Mac OS, with the latest MacTeX version.

glher commented 3 years ago

By changing the \begin{table}[H] to \begin{table}[ht], everything seems to work. Not super sure what happens when H is used, I looked to see if it didn't set the tables and figure elsewhere but couldn't find them, so I'd assume my LateX does something to it to make it not appear potentially

bartkummel commented 3 years ago

I can confirm the problem and the fix. I'm using tectonic on macOS.

fmarotta commented 3 years ago

Thanks, I've added this to the documentation. I'm also not sure about what happens, but I think there may be some incompatiblities between floatrow and sidenotes since sidenotes redefines the figure* and table* environments. I'd suggest to use h! instead of H if you want the float placement to be stricter than ht.