3

I am fairly new to latex and are struggeling to find any solutions to this following problem:

I have a horizontal table, which is filled with observations from other studies. I want to reference the observations in the different columns by using footnotes, which will be listed in a minipage enviornment just below the table. But my problem is that the footnotes are being listed vertically, I want them to be listed horizontally (maby 3 referenes in length) so they fill out the space on the mini page.The simplified image of my table shows this problem enter image description here

Here is the code:

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{mathabx}
\usepackage{graphicx}
\usepackage{siunitx}
\usepackage{pdflscape}
\usepackage{longtable, booktabs}
\usepackage{pbox}
\usepackage{array}
\usepackage[usestackEOL]{stackengine}

\begin{document}

\begin{landscape}

\renewcommand{\arraystretch}{0.5} % determind line spacing in table
\renewcommand{\footnotesize}{\tiny}% fontsize of footnotes
%\shortstack{text//text} command forces line break in a cell
\begin{minipage}{200mm}% minipage for footnotes

\begin{tabular}{>{\scriptsize}c >{\scriptsize}c >{\scriptsize}c >{\scriptsize}c >{\scriptsize}c >{\scriptsize}c >{\scriptsize}c >{\scriptsize}c }

\shortstack{Column\\1} &
\shortstack{Column\\2} &
\shortstack{Column \\ 3} & 
\shortstack{Column\\ 4}  &
\shortstack{Column \\ 5} & 
\shortstack{Column \\ 6} &
\shortstack{Column\\7} & 
\shortstack{Column\\8} 
 \\ 
            \hline
\shortstack{Event 1\\ (Jan 2009) \footnote{some text 1} \footnote{some text 2}}  & \shortstack{temperate} & present & & \shortstack{at friction \\ intersection}& & &  \\       
            \hline
\shortstack{Event 2 \\ (1991-1997) \footnote{some text 3}} &  & \shortstack{not observed \\ (summer 2004) \footnote{some teaxt 4}} & & \small{-}\\
            \hline
\shortstack{Event 3 \\ (1930s), (early 1970),\\ (2003-2005) \footnote{some text 5}\footnote{some text 6}} & temperate & \shortstack{not present,\\(July 2011) \footnote{some text 7}} & & \small{-} & & &  \\
            \hline
\shortstack{Event 4\\ (early 1980s) \\ (2013-2015) \footnote{some text 8}} & \small{-} & \small{-} & 150m (1990-2010) & not detected  \\
            \hline
\shortstack{Event 5 \footnote{some text 9}\\(valley glacier)} & temperate & \small{-}  \\
            \hline
\end{tabular}
\end{minipage}
\end{landscape}

\end{document}
1
  • You might be interested in the threeparttable package.
    – leandriis
    Sep 12, 2019 at 12:21

1 Answer 1

1

I'd suggest the following layout that uses booktabs for the fex horizontal lines, tabularx for automatic linebreaks in table cells and a table that is automatically as wide as the linewidth. For the "footnotes" I have used the threeparttable environment with the para option and the \tnote command. With this, you table can easily fit into the page without the need to decrease the font to \scriptsize and without decreasing the \arraystretch.

enter image description here

\documentclass{article}

\usepackage[utf8]{inputenc}
%\usepackage{mathabx}
\usepackage{graphicx}
%\usepackage{siunitx}
\usepackage{pdflscape}
%\usepackage{longtable}
\usepackage{booktabs}
%\usepackage{pbox}
\usepackage{array}
\usepackage[usestackEOL]{stackengine}

\usepackage[para]{threeparttable}
\usepackage{tabularx}
\usepackage{amsmath}
\begin{document}

\begin{landscape}

%\renewcommand{\arraystretch}{0.5} % determind line spacing in table
%\renewcommand{\footnotesize}{\tiny}% fontsize of footnotes
%\shortstack{text//text} command forces line break in a cell
%\begin{minipage}{200mm}% minipage for footnotes
\begin{threeparttable}
\begin{tabularx}{\linewidth}{*{8}{>{\centering\arraybackslash}X}}
\toprule
Column 1 &
Column 2&
Column  3 & 
Column 4  &
Column  5 & 
Column  6 &
Column 7 & 
Column 8 
 \\ 
            \midrule
Event 1 \newline (Jan 2009)\tnote{a}\tnote{b}  & temperate & present & & at friction  intersection & & &  \\  \addlinespace
Event 2  (1991-1997)\tnote{c} &  & not observed  (summer 2004) \tnote{d} & & -- \\
            \addlinespace
Event 3  (1930s), (early 1970), (2003-2005)\tnote{e}\tnote{f} & temperate & not present, (July 2011)\tnote{g} & & -- & & &  \\
         \addlinespace
Event 4 (early 1980s) (2013-2015)\tnote{h} & -- & -- & 150m (1990-2010) & not detected  \\
            \addlinespace
Event 5\tnote{i} (valley glacier) & temperate & --  \\
            \bottomrule
\end{tabularx}
%\end{minipage}
\begin{tablenotes}
\item[a] some text 1
\ite**m[b] some text 2
\item[c] some text 3
\item[d] some text 4
\item[e] some text 5
\item[f] some text 6
\item[g] some text 7
\item[h] some text 8
\item[i] some text 9
\end{tablenotes}
\end{threeparttable}
\end{landscape}
\end{document}

You must log in to answer this question.

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