3

pdflatex compiles the following code

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{eurosym}
\usepackage{array}
\usepackage{booktabs}
%\usepackage{breakurl}
\usepackage[ngerman]{babel}
\usepackage[paper=a4paper,vmargin=3cm,hmargin=2cm]{geometry}
\usepackage{tabu}
%\usepackage[colorlinks=true, pdfborder={0 0 0}, 
        %linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref}
\usepackage{parnotes}
\renewcommand{\parnotevskip}{0.5ex}
\renewcommand{\parnoteintercmd}{\\}
\setlength\parindent{0em}
\setlength\parskip{1.5ex}

\begin{document}
\begin{table}
\centering
    \begin{tabu}{@{}X[c]X[c]X[c]X[c]X[2.5c]X[c]}
    \toprule[2pt]
    \bfseries Hersteller &
    \bfseries Pro"-dukt"-be"-zeich"-nung &
    \bfseries Akku"-mu"-lator"-typ &
    \bfseries Preis/\euro &
    \bfseries Lebensdauer in Ladezyklen bezogen auf Entladung von 4,5Ah &
    \bfseries Cents/ Ladezyklus
    \\ \midrule
    %http://www.reichelt.de/Blei-Vlies-Akkus-12V-Kung-Long/WP-5-12/3/index.html?;ACTION=3;LA=2;ARTICLE=130548;GROUPID=4232;artnr=WP+5-12
    Kung Long & WP 5-12 & Blei-Vlies-Akku & 17,90\parnote{eins}  & 200 & 8,95 \\
    %http://www.pollin.de/shop/dt/NjI5ODI3OTk-/Stromversorgung/Akkus/Blei_Akkus/LiFePO4_Akku_VISION_LFP124_5T_12_V_5_Ah.html
    Vision & LFP124.5T & LiFePO4-Akku & 93,50\parnote{zwei} & 2000 & 4,68 \\
    %http://www.reichelt.de/Blei-Vlies-Akkus-12V-zyklisch/LC-CA-1215P1/3/index.html?;ACTION=3;LA=3;ARTICLE=77912;GROUPID=4235
    Panasonic & LC-CA 1215P1 & Blei-Vlies-Akku & 39,95\parnote{drei} & 1400 & 2,85\\
    \bottomrule[2pt]
    \end{tabu}
    \raggedright
    \parnotes
    \caption{dies ist ein Text}
\end{table}

\end{document}

to

compiled version


Of course i want parnotes to start the enumeration from 1 and stop it if it reaches 3.

Unfortunately it seems, that the content inside the tabu environment is processed three times and i don't find a way how to achieve the intended result. Since i have several table environments of this kind in my document i don't want to give up the automatic enumeration provided by parnotes.

Maybe anyone can give me a tip or show me a workaround that yields the desired output!?

3

both tabularx and I think tabu allow you to use the normal \footnote command to make table notes and protect that command from being executed multiple times. So not using \parnotes is a realistic option.

If you want to use \parnotes then there are a couple of bugs to fix and then you need to add some connection to the table trials.

% Counter for parnote marks left by \parnote
\global\newcount\c@PN@t
% Counter for parnote marks *within* parnotes
\global\newcount\c@PN@n

\global before `\newcount doesn't do anything useful, but this isn't a full emulation of the latex counter declaration, if this is replaced by

% Counter for parnote marks left by \parnote
\newcounter{PN@t}
% Counter for parnote marks *within* parnotes
\newcounter{PN@n}

The table macros with "know" about these counters and reset them while doing trial settings of the table.

that is enough to avoid the counter increasing beyond 3 however you then need to add some code to tell the table macros not to save the text during trial runs. For tabularx this works

\long\def\parnote{%
\relax\ifx\@footnotetext\TX@trial@ftn\else
    \ifx\protect\@typeset@protect
        \expandafter\expandafter\expandafter\PN@parnote@real
    \else
        \expandafter\expandafter\expandafter\@gobble
    \fi
\fi
}

I had a quick look at the tabu internals but didn't immediately spot what the corresponding test would be.

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{eurosym}
\usepackage{tabularx}
\usepackage{booktabs}
%\usepackage{breakurl}
\usepackage[ngerman]{babel}
\usepackage[paper=a4paper,vmargin=3cm,hmargin=2cm]{geometry}

%\usepackage[colorlinks=true, pdfborder={0 0 0}, 
        %linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref}
\usepackage{parnotes}
\renewcommand{\parnotevskip}{0.5ex}
\renewcommand{\parnoteintercmd}{\\}
\setlength\parindent{0em}
\setlength\parskip{1.5ex}

\begin{document}
\begin{table}
\centering
    \begin{tabularx}\textwidth{@{}
*4{>{\centering\arraybackslash\hsize=.7\hsize}X}
>{\centering\arraybackslash\hsize=2.5\hsize}X
>{\centering\arraybackslash\hsize=.7\hsize}X}
    \toprule[2pt]
    \bfseries Hersteller &
    \bfseries Pro"-dukt"-be"-zeich"-nung &
    \bfseries Akku"-mu"-lator"-typ &
    \bfseries Preis/\euro &
    \bfseries Lebensdauer in Ladezyklen bezogen auf Entladung von 4,5Ah &
    \bfseries Cents/ Ladezyklus
    \\ \midrule
    %http://www.reichelt.de/Blei-Vlies-Akkus-12V-Kung-Long/WP-5-12/3/index.html?;ACTION=3;LA=2;ARTICLE=130548;GROUPID=4232;artnr=WP+5-12
    Kung Long & WP 5-12 & Blei-Vlies-Akku & 17,90\parnote{eins}  & 200 & 8,95 \\
    %http://www.pollin.de/shop/dt/NjI5ODI3OTk-/Stromversorgung/Akkus/Blei_Akkus/LiFePO4_Akku_VISION_LFP124_5T_12_V_5_Ah.html
    Vision & LFP124.5T & LiFePO4-Akku & 93,50\parnote{zwei} & 2000 & 4,68 \\
    %http://www.reichelt.de/Blei-Vlies-Akkus-12V-zyklisch/LC-CA-1215P1/3/index.html?;ACTION=3;LA=3;ARTICLE=77912;GROUPID=4235
    Panasonic & LC-CA 1215P1 & Blei-Vlies-Akku & 39,95\parnote{drei} & 1400 & 2,85\\
    \bottomrule[2pt]
    \end{tabularx}
    \raggedright
    \parnotes
    \caption{dies ist ein Text}
\end{table}

\end{document}
  • Thanks a lot for the effort you put in your detailed answer! This solved my problem... – user1146332 Jun 3 '13 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.