2

Is there a way to have ctable automatically label the footnotes: a, b, c, etc... (or some other formatting)?

\ctable[
] {rl} {
    \tnote{first footnote}
    \tnote{second footnote}
}{
    \FL Configuration & Error
    \ML Full\tmark & 0.0
    \ML Partial\tmark & 0.0
    \LL
}

The above code marks them all as footnote a. Obviously I could specify each individually (\tnote[a]{}, \tnote[b]{}), but where's the fun in that?

4

The automation is currently not part of ctable, since numbering is done using an optional argument to both \tnote[<num>] and \tmark[<num>].

Based on your (very) minimal example, the following should suffice:

enter image description here

\documentclass{article}
\usepackage{ctable}% http://ctan.org/pkg/ctable
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\newcounter{ctabfnote}\newcounter{ctabfmark}
\renewcommand{\thectabfnote}{\alph{ctabfnote}}
\renewcommand{\thectabfmark}{\alph{ctabfmark}}
\pretocmd{\ctable}% <cmd>
  {\setcounter{ctabfnote}{0}%
   \setcounter{ctabfmark}{0}}% <prepend>
  {}{}% <success><failure>
\makeatletter
\renewcommand{\tnote}[1]{%
  \stepcounter{ctabfnote}%
   \ifx\@ctblnotespar\@ctbltrue%
     \@ctbltextsuperscript{\normalfont\textit{\thectabfnote}}\,#1
   \else%
     \hbox{\@ctbltextsuperscript{\normalfont\textit{\thectabfnote}}}&#1\NN
   \fi
}
\renewcommand{\tmark}{%
  \stepcounter{ctabfmark}%
   \hbox{\textsuperscript{\normalfont\textit{\thectabfmark}}}}
\makeatother
\begin{document}
\ctable[
] {rl} {
    \tnote{first footnote}
    \tnote{second footnote}
}{
    \FL Configuration & Error
    \ML Full\tmark & 0.0
    \ML Partial\tmark & 0.0
    \LL
}

\end{document}

Two new counters are introduced, one for each of \tnote and \tmark. I've also modified the input to \tnote and \tmark to drop the optional argument, since they're not needed anymore. Counter are reset at the start of \ctable (via a patch thanks to etoolbox).

  • This is really awesome! For my (and others') future reference, you can change the counter (to numbers, symbols, etc...) by changing: \alph{ctabfnote} to \roman, \fnsymbol, etc... – Felix Sep 24 '12 at 14:05

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.