I'm doing my PhD thesis, I'm new on LaTeX and I'm struggling with my tables. As seen here: https://i.stack.imgur.com/LL6sH.jpg my table spans two pages, but in the second page it doesnt align properly.
I already used tabularx, longtable and \setlength\LTleft{-1cm} but nothing seems to help, also read other Q&A about it, and the problem persists. I need my tables to span multiple pages, the table must be centered and the caption start at the left. The table is wide, but I need it to shrink it into a portrait layout.
I have the next code which gives me a table spanning two pages, but in the second one, the table doesn't align properly, it moved about certain pixels towards the right:
\documentclass[a4paper,12pt,times,numbered,print,index]{Classes/PhDThesisPSnPDF}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PREAMBLE: Contains packages and user-defined commands and settings
\usepackage{booktabs}
\usepackage{ltablex}
\usepackage{dcolumn,tabularx,booktabs}
\usepackage{longtable}
\usepackage{pdflscape}
\usepackage{adjustbox} %para ajustar las tablas
\usepackage{ltablex}
\usepackage{textcomp}
\usepackage{siunitx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% APPENDICES
\begin{appendices} % Using appendices environment for more functunality
\include{Appendix2/appendix2}
\end{appendices}
%%%%%%%%%%%%%%%%%%%%
%appendix2.tex file
\subsection{CSH table for peptide xxxx in xxxx mM DPC}
\label{table:CSH-xxxxx-DPC}
\setlength\LTleft{-1cm}
\begin{tabularx}{\linewidth}{lllll lllll lll}
\caption{chemical shifts (ppm from DSS) for peptide ----}\\
\endfirsthead
\endhead
\toprule
\multicolumn{2}{l}{\textbf{Residue}} &
\textbf{HN} &
\textbf{ H\textalpha }&
\textbf{H\textbeta} &
\textbf{H\textgamma } &
\textbf{H\textdelta } &
\textbf{H\textepsilon } &
\textbf{H\textzeta } &
\textbf{C\textalpha }
\\[6pt]
\midrule
Arg & 845 & 7.37 & 7.37 & 7.37 , 7.37 & 7.37 , 7.37 & 7.37 , 7.37 & 7.37 7.37 & 6.70 , 6.57 & 56.76 \\
\bottomrule
\end{longtable}
\clearpage
Thank you
tabularx
since you have noX
column? Also, did you compile twice?longtable
buttabularx
. if you like to have it over two (or more) pages, you need to loadltablex
package. to help you, we need to see complete small document with related packages in preamble no just code snippet.