For my personal documentation, I have been using latex for a long time but as usual, I encounter difficulties with tables.
I mainly adopted supertabular because I can easily adapt the management of multiple columns or rows as well as colorization even if the table exceeds the height of a page.
This time, I found myself with a problem that I was unable to correct, namely the fact that the content of a column (multirow) is found after the bottom of the table when changing pages.
I think I'm probably making a mistake somewhere, but I can't figure out where. Below you will find what I am trying to do and where the following errors appear:
- the text in the left column is located below the table;
- the text is not aligned to the left in the 2nd column despite the
\raggedrightcommand for this column;
I think these are probably errors on my part but I have just spent 48 hours with tex.stackexchange.com in particular but without finding anything conclusive.
Do you have a clue to give me?
(I read the documentation "https://tug.ctan.org/macros/latex/contrib/supertabular/supertabular.pdf" but I don't understand where to use the options indicated pageshow and debugshow).
(I can send the resulting pdf of the compilation. I use TexStudio with Debian GNU/Linux 11 (bullseye) )
Here is an extract of my code :
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[width=21.00cm, height=29.70cm, left=2.00cm, right=2.00cm, top=2.00cm, bottom=2.00cm]{geometry}
\usepackage{geometry}
\usepackage[demo]{graphicx}
\setlength{\oddsidemargin}{0pt}
\setlength{\headsep}{0pt}
\setlength{\textheight}{740pt}
\setlength{\textwidth}{460pt}
\setlength{\marginparsep}{0pt}
\setlength{\marginparwidth}{0pt}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{xcolor,colortbl}
\usepackage{supertabular}
\usepackage[margin=10pt,font=small,textfont=it,labelformat=simple]{caption}
\captionsetup{labelformat=empty, justification=centering}
\begin{document}
\subsection*{Espèces}
Il existe encore de nombreuses divergences quand il s'agit de rentrer dans le détail des nomenclatures et notamment dans le classement des genres au sein des familles. Le tableau 2 ci-après présente la sous-classe Octocorallia donne un aperçu non exhaustif des genres concernés.
\newenvironment{changemargin}[2]{%
\begin{list}{}{%
\setlength{\topsep}{0pt}%
\setlength{\leftmargin}{#1}%
\setlength{\rightmargin}{#2}%
\setlength{\listparindent}{\parindent}%
\setlength{\itemindent}{\parindent}%
\setlength{\parsep}{\parskip}%
}%
\item[]}{\end{list}}
\begin{changemargin}{-1.5cm}{0.5cm}
\begin{center}
\renewcommand{\arraystretch}{1.5}
\tablefirsthead{%
\hline
\multicolumn{1}{|c}{Ordre} &
\multicolumn{1}{|c}{Sous-ordre} &
\multicolumn{1}{|c}{Famille} &
\multicolumn{1}{|c}{Spécimen} &
\multicolumn{1}{|l|}{Genre} \
\hline
}
\tablehead{%
\hline
% \multicolumn{5}{l}{\small \textsl{$\dots$ suite du tableau}}\
\multicolumn{1}{|c}{Ordre} &
\multicolumn{1}{|c}{Sous-ordre} &
\multicolumn{1}{|c}{Famille} &
\multicolumn{1}{|c}{Spécimen} &
\multicolumn{1}{|l|}{Genre} \
\hline
}
\tabletail{%
\hline
\multicolumn{5}{r}{\small\textsl{Suite page suivante$\dots$}} \
}
\tablelasttail{\hline}
\bottomcaption{Classement des genres appartenant à la sous-classe Octocorallia \\selon WoRMS (07/2014)}
%\begin{table}[H]
\definecolor{vertf}{RGB}{000,255,000}
\definecolor{vertc}{RGB}{139,255,139}
\definecolor{grisf}{RGB}{209,209,209}
\definecolor{grisc}{RGB}{229,229,229}
\definecolor{rosef}{RGB}{255,191,191}
\definecolor{rosec}{RGB}{255,218,218}
\begin{supertabular}{|
>{\raggedright\arraybackslash}m{0.15\linewidth}|
>{\raggedright\arraybackslash}m{0.15\linewidth}|
>{\raggedright\arraybackslash}m{0.15\linewidth}|
>{ \arraybackslash}m{0.20\linewidth}|
>{\raggedright\arraybackslash}m{0.30\linewidth}|
}
\hline
\multirow{19}{=}{
\cellcolor{rosec} Alcyona-cea (Alcyonaires) } &
\multirow{5}{=}{
\cellcolor{vertc} Alcyoniina (Alcyoninés) } &
\cellcolor{grisc} Alcyonidae (Alcyonidés) &
\cellcolor{grisc} \includegraphics[width=\linewidth] {sarcophyton-2.jpg} &
\cellcolor{grisc}
\vspace{0.5em}
Acrophytum, Alcyonium, Aldersladum, Anthomastus, Bellonella, Cladiella, Dampia, Dimorphophyton, Discophyton, Drifa, Elbeenus, Eleutherobia, Heteropolypus Inflatocalyx, Klyxum, Lampophyton, Lanthanocephalus, Litophyton, Lobophytum, Lobularia, Lohowia, Malacacanthus, Minabea, Notodysiferus, Paraminabea, Parerythropodium, Protodendron, Pseudoanthomastus, Rhytisma, \textbf{Sarcophyton}, Sinularia, Skamnarium, Sphaeralcyon, Thrombophyton, Verseveldtia \
\cline{3-5}
\cellcolor{rosec} &
\cellcolor{vertc} &
\cellcolor{grisf} Nephtheidae\newline(Nephteidés) &
\cellcolor{grisf}
\vspace{0.5em}
\includegraphics[width=\linewidth] {umbellulifera.jpg} &
\cellcolor{grisf}
\vspace{0.5em}
\hbox{Umbellulifera (specimen),} Capnella, Chondronephthya, Chromonephthea, Coronephthya, Dendronephthya, Gersemi, Lemnalia, Leptophyton, Neospongodes, Nephthea, Pacifiphyton, Paralemnalia, Pseudodrifa, Scleronephthya, Stereonephthya \
\cline{3-5}
\cellcolor{rosec} &
\cellcolor{vertc} &
\cellcolor{grisc} Nidaliidae\newline(Nidaliidés) &
\cellcolor{grisc}
\vspace{0.5em}
\includegraphics[width=\linewidth] {chironephthya.jpg} &
\cellcolor{grisc} \hbox{Chironephthya (specimen),} Agaricoides, Nephthyigorgia, Nidalia, Nidaliopsis, Orlikia, Pieterfaurea, Siphonogorgia \
\cline{3-5}
\cellcolor{rosec} &
\cellcolor{vertc} &
\cellcolor{grisf} Paralcyoniidae (Paralcyoniidés) &
\cellcolor{grisf}
\vspace{0.5em}
\includegraphics[width=\linewidth] {maasella.jpg} &
\cellcolor{grisf} Maasella (specimen) \
\cline{3-5}
\cellcolor{rosec} &
\cellcolor{vertc} &
\cellcolor{grisc} Xeniidae (Xéniidés) &
\cellcolor{grisc}
\vspace{0.5em}
\includegraphics[width=\linewidth] {xenia.jpg} &
\cellcolor{grisc} \hbox{Xenia (specimen),} Anthelia, Asterospicularia, Cespitularia, Funginus, Efflatounaria, Heteroxenia, Sympodium, Sansibia \
\hline
\multirow{3}{=}{
\cellcolor{rosec} Pennatulacea (Pennatules) } &
\cellcolor{vertc} Sessiliflorae &
\cellcolor{grisc} Umbellulidae, Vertillidae, Protoptilidae $\dots$ &
\cellcolor{grisc}
\vspace{0.5em}
\includegraphics[width=\linewidth] {cavernularia.jpg} &
\cellcolor{grisc} Umbellula, \hbox{Cavernularia (specimen),} Cavernulina, Veretillum, Distichoptilum, Protoptilum $\dots$ \
\cline{2-5}
\cellcolor{rosec} &
\cellcolor{vertf} Subsessili-florae &
\cellcolor{grisf} Halipteridae Pennatulidae Virgulariidae &
\cellcolor{grisf}
\vspace{0.5em}
\includegraphics[width=\linewidth] {virgularia.jpg} &
\cellcolor{grisf} Halipteris, Crassophyllum, Pennatulata $\dots$ Acanthoptilum, \hbox{Virgularia (Specimen)} \
\hline
\end{supertabular}
\end{center}
\end{changemargin}
Retour des marges à la normale. Il existe encore de nombreuses divergences quand il s'agit de rentrer dans le détail des nomenclatures et notamment dans le classement des genres au sein des familles.
\end{document}

\leavemode(should it be\leavevmode?) command and not available image files etc.. At the same time, much of your code does not seem to be relevant to the question you're asking here. Please limit the example to only the code required for your issue to appear. You can have a look at this guide for how to prune your code for this purpose. – cabohah Mar 06 '24 at 14:37I just modified the code to simplify it. I also removed the livevmode commands which ultimately turned out to be useless in my case. (Wich has removed my issue with cells color)
– PhLinuX Mar 06 '24 at 18:04\multirowin a supertabular is somehow tricky. You may need to move the text manually to the next page or repeat it manually at the next page. IMHO the best package for colorful tabulars with vertical and horizontal lines and several pages would betabularray. – cabohah Mar 06 '24 at 19:12\multirowand page breaks is already object of some other questions, e.g., https://tex.stackexchange.com/q/324535/277964 or https://tex.stackexchange.com/q/52334/277964. It seems, if you want the page break inside the\multirow, there isn't an automatic solution. BTW: The not closed\hbox{…is still there and usually you should use LaTeX's\mboxinstead of low level TeX's\hbox. – cabohah Mar 07 '24 at 07:43I just edit my post, removed missed comments and give the code modified regarding the use of hbox.
I was not able to install the tabularray package because I use Debian 11 with Latex2 or it seems unfortunately this package is only intended for Latex3.
– PhLinuX Mar 08 '24 at 08:42tabularrayis quite new and maybe the TeX Live of Debian 11 is too old. I do always use vanilla TeX Live. – cabohah Mar 08 '24 at 08:54