0

I use \usepackage[para]{threeparttable} as suggested here (https://tex.stackexchange.com/a/160113/231568) to try to display table footnotes in one line. The size of the footnotes is controlled with \appto\TPTnoteSettings{\footnotesize}. But the footnotes are not really displayed in one line as you can see in the following picture. There is e.g. still space after [a] and [c]. enter image description here

To display the notes in one line, I additionally tryed the command [flushleft].

% Preview source code

%% LyX 2.3.6 created this file. For more info, see http://www.lyx.org/. %% Do not edit unless you really know what you are doing. \documentclass[12pt,english]{article} \renewcommand{\familydefault}{\sfdefault} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \usepackage{geometry} \geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=3cm,rmargin=2.5cm} \setlength{\parskip}{\medskipamount} \setlength{\parindent}{0pt} \usepackage{array} \usepackage{setspace} \onehalfspacing

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands. %% Because html converters don't know tabularnewline \providecommand{\tabularnewline}{\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. \usepackage[para,flushleft]{threeparttable} % threeparttable: to support table footnote, but this does not work correctly, looks ugly and footnotes are not displayed with fontsize footnotesize \usepackage{booktabs} % booktabs: to support centering of table \usepackage{etoolbox} % to support footnotesize within table \appto\TPTnoteSettings{\footnotesize} % footnote font size within table \def\tnote#1{\protect\TPToverlap{\textsuperscript{[\TPTtagStyle{#1}]}}} % brackets in table footnotes

\makeatother

\usepackage{babel} \begin{document}

\section{Section one}

\begin{table}[h] \caption{Lorem ipsum.\label{tab:Lorem-ipsum.}}

\centering \begin{threeparttable}

\begin{tabular}{>{\centering}m{1.2cm}>{\centering}m{3.5cm}>{\centering}m{2.5cm}>{\centering}m{2.5cm}>{\centering}m{2cm}} \hline \noalign{\vskip0.1cm} \textbf{\footnotesize{}a\tnote{a}} & \textbf{\footnotesize{}b} & \textbf{\footnotesize{}c} & \textbf{\footnotesize{}d\tnote{b}} & \textbf{\footnotesize{}g}\tabularnewline[0.1cm] \hline \noalign{\vskip\doublerulesep} \noalign{\vskip0.2cm} \textbf{\footnotesize{}1\tnote{c}} & & & & {\footnotesize{}1\tnote{d}}{\footnotesize\par}

{\footnotesize{}2\tnote{d}}\tabularnewline[\doublerulesep] \noalign{\vskip\doublerulesep} \noalign{\vskip\doublerulesep} \textbf{\footnotesize{}2\tnote{e}} & & & & {\footnotesize{}1\tnote{d}}{\footnotesize\par}

{\footnotesize{}2\tnote{d}}\tabularnewline[\doublerulesep] \noalign{\vskip\doublerulesep} \noalign{\vskip\doublerulesep} \textbf{\footnotesize{}3\tnote{f}} & & & & {\footnotesize{}1\tnote{d}}\tabularnewline[\doublerulesep] \noalign{\vskip\doublerulesep} \noalign{\vskip\doublerulesep} \textbf{\footnotesize{}4\tnote{e}} & & & & \tabularnewline[\doublerulesep] \noalign{\vskip\doublerulesep} \noalign{\vskip\doublerulesep} \textbf{\footnotesize{}5} & & & & \tabularnewline[\doublerulesep] \noalign{\vskip\doublerulesep} \noalign{\vskip\doublerulesep} \textbf{\footnotesize{}6\tnote{g}} & & & & {\footnotesize{}1\tnote{h}}\tabularnewline[\doublerulesep] \noalign{\vskip\doublerulesep} \noalign{\vskip\doublerulesep} \textbf{\footnotesize{}7\tnote{i}} & & & & {\footnotesize{}1\tnote{h}}\tabularnewline[\doublerulesep] \hline \noalign{\vskip\doublerulesep} \end{tabular}

\begin{tablenotes} \item [a] Lorem 0.00 mmol sit amet, consetetur 0.00 mmol sed diam nonumy. \item [b] Lorem ipsum dolor sit. \item [c] Lorem 00 mol% sit amet, consetetur 00 h elitr. \item [d] Lorem ipsum dolor sit amet. \item [e] Lorem ipsum 00 mol% sit amet, consetetur 00 h elitr. \item [f] Lorem dolor dolor sit amet. \item [g] Lorem ipsum 00 mol% sit amet, consetetur sadipscing elitr. \item [h] Lorem ipsum dolor. \item [i] Lorem ipsum 00 mol% sit amet, consetetur lorem ipsum dolor 000h sadipscing elitr. \end{tablenotes} \end{threeparttable} \end{table}

\end{document}

With this the notes are displayed better in one line, but the notes have standard text size and not footnote size anymore.

enter image description here

How can I correct this? Footnotes clean alligned in one line, with footnote size?

wewa
  • 179

1 Answers1

1

I think now they are close enough.

x2

Add this code to your preamble and remove the flushleft from the package options.

\makeatletter
\renewcommand{\TPT@doparanotes}{\par
    \prevdepth\z@ \TPT@hsize
    \TPTnoteSettings
    \parindent\z@ \pretolerance 8
    \linepenalty 200
    \renewcommand\item[1][]{\relax\ifhmode \begingroup
        \unskip
        \advance\hsize 10em % \hsize is scratch register, based on real hsize
        \penalty -45 \hskip\z@\@plus\hsize \penalty-19
        \hskip .15\hsize \penalty 9999 \hskip-.15\hsize
        \hskip .01\hsize\@plus-\hsize\@minus.01\hsize 
        \hskip -0.5em\@plus .3em   %% changed from 1em to -0.5em
        \endgroup\fi
        \tnote{##1}\,\ignorespaces}%
    \let\TPToverlap\relax
    \def\endtablenotes{\par}%
}
\makeatother

Even more compact. Although still five lines.

x3

\makeatletter
\renewcommand{\TPT@doparanotes}{\par
    \prevdepth\z@ \TPT@hsize
    \TPTnoteSettings
    \parindent\z@ \pretolerance 8
    \linepenalty 200
    \renewcommand\item[1][]{\relax\ifhmode \begingroup
        \unskip
        \advance\hsize 10em % \hsize is scratch register, based on real hsize
        \penalty -45 \hskip\z@\@plus\hsize \penalty-19
        \hskip .15\hsize \penalty 9999 \hskip-.15\hsize
        \hskip .008\hsize\@plus-\hsize\@minus.01\hsize %% changed 
        \hskip -0.2em\@plus .1em %% changed 
        \endgroup\fi
        \tnote{##1}\,\ignorespaces}%
    \let\TPToverlap\relax
    \def\endtablenotes{\par}%
}
\makeatother
Simon Dispa
  • 39,141