GeneralProblems with \footnote in \caption (in table or figure env)

LaTeX specific issues not fitting into one of the other forums of this category.
jimisola
Posts: 22
Joined: Sat Feb 02, 2008 2:54 am

Problems with \footnote in \caption (in table or figure env)

Post by jimisola »

Hi!

I've read several post in the forum regarding footnotes but none that seem to solve my problem.

I want to a \footnote in a table-tabulary caption, but only the marker (e.g. "1" shows). The marker links to the first page of my document.
So, I added \footnotetext{abcd} immediately after the table and it worked somewhat:

1. the footnote text appears, but it sometimes appear on the wrong page
2. I get a bunch of errors/warnings

Regards,
Jimisola
Attachments
test-latex.tex
minimal working example
(3.37 KiB) Downloaded 1399 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
jimisola
Posts: 22
Joined: Sat Feb 02, 2008 2:54 am

Problems with \footnote in \caption (in table or figure env)

Post by jimisola »

I found a couple of pages providing solutions to this problem (I haven't verified the solution yet though):
  • http://www.tex.ac.uk/cgi-bin/texfaq2html?label=ftncapt
  • http://radio.wihome.net/wiki/?article=LaTeX:tablefootnotes
  • http://www.tex.ac.uk/cgi-bin/texfaq2html?label=footintab
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Problems with \footnote in \caption (in table or figure env)

Post by Stefan Kottwitz »

Hi jimisola,

the threeparttable package should be a good solution.

Stefan
jimisola
Posts: 22
Joined: Sat Feb 02, 2008 2:54 am

Problems with \footnote in \caption (in table or figure env)

Post by jimisola »

Stefan_K wrote: the threeparttable package should be a good solution.
Stefan
I saw that being mentioned in other places, but I'm already using tabulary and I need to use that. Can I use threeparttable together with tabulary?

At the moment I used footnotemark and footnotetext but the footnotes are on the wrong places.

While I have your attention, I also have a problem with figures, table and boxedminipage floating around in the wrong order.
I've added \usepackage{float} and used [!h]

\noindent\begin{boxedminipage}[!h]{\textwidth}
\begin{table}[!h]
\begin{figure}[!h]

but they still show in the wrong order. What else can I do?
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Problems with \footnote in \caption (in table or figure env)

Post by Juanjo »

I've had a look at the file you attach in your first post. Several coments are in order:
  • It is not a minimal working example. Obviously it is not minimal (most of the code can be dropped) and it is not working: since you include a \footnote command in \caption, you need to \protect it to be able to compile without errors (i.e. you should add \protect just before \footnote). Of course, \footnote does not work, but that's a different problem.
  • Since you use the h descriptor for the table environment, you do not really want your table to float. It seems that you'd like to place it in a specific point of the document. So why not consider the table as a "non-float"? If this is feasible, the nonfloat package may be of help. Please, look at the following example, inspired in your problem, the comments in one of the pages of the TeX Faq you mention later and an example in the manual of nonfloat.

    Code: Select all

    Code, edit and compile here:
    \documentclass{article}
    \usepackage{nonfloat}
    \begin{document}
    \listoftables
    \section{First example}
    The footnote for the caption goes below the table.\\[\intextsep]
    \begin{minipage}{\textwidth}
    \centering
    \begin{tabular}{|c|}
    \hline Tabular stuff here \\ \hline
    \end{tabular}
    \tabcaption[Text of the caption (first example)]{Text of the caption
    (first example)\footnote{Text of the footnote (first example)}}
    \end{minipage}
    \\[\intextsep]
    \section{Second example}
    The footnote for the caption goes at the bottom.\\[\intextsep]
    \begin{minipage}{\textwidth}
    \centering
    \begin{tabular}{|c|}
    \hline Tabular stuff here \\ \hline
    \end{tabular}
    \tabcaption[Text of the caption (second example)]{Text of the caption (second example)\footnotemark}
    \end{minipage}
    \\[\intextsep]
    \footnotetext{Text of the footnote (second example)}
    \end{document}
    הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  • Off topic: article class for writing a thesis?
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Problems with \footnote in \caption (in table or figure env)

Post by sommerfee »

Juanjo wrote:\usepackage{nonfloat}
I do not recommended the usage of the nonfloat package. Beside the fact that its documentation tells wrong things (floats placed with [H] are not limited to have captions beneath the float, how should they, [H] is a placement parameter and therefore has nothing to do with the contents of the float), it changes the float placement parameters (\textfraction etc., and also \@fptop etc.) and has no option to suppress that. Furthermore it defines a command called \topcaption which conflicts with \topcaption offered by the supertabular package.

I recommend the usage of the capt-of package instead, it simply defines \captionof, if that is all you need, this is the perfect package for you.
Last edited by sommerfee on Thu Mar 20, 2008 2:14 pm, edited 1 time in total.
jimisola
Posts: 22
Joined: Sat Feb 02, 2008 2:54 am

Problems with \footnote in \caption (in table or figure env)

Post by jimisola »

Hi Juanjo!

Thank you for replying.
Juanjo wrote:I've had a look at the file you attach in your first post. Several coments are in order:
  • It is not a minimal working example. Obviously it is not minimal (most of the code can be dropped) and it is not working: since you include a \footnote command in \caption, you need to \protect it to be able to compile without errors (i.e. you should add \protect just before \footnote). Of course, \footnote does not work, but that's a different problem.
  • Since you use the h descriptor for the table environment, you do not really want your table to float. It seems that you'd like to place it in a specific point of the document. So why not consider the table as a "non-float"? If this is feasible, the nonfloat package may be of help. Please, look at the following example, inspired in your problem, the comments in one of the pages of the TeX Faq you mention later and an example in the manual of nonfloat.
Sorry, about the lack of a proper MWE. I included usepackage declarations etc because I was not sure whether the affected something else. And to have it working with my "usepackage" declarations did not make much sense. About it not work, missed out on that.

Anyway, I'd read up on footnotes and captions in the FAQ before I saw your post and managed to get it right. Well, almost they show and they have the right numbering but the footnotetext is not always (seldom to be honest) on the same page as the footnotemark.

I was not aware of the nonfloat package. I've only used LaTeX twice before (for another thesis and software documentation) and I'm fully aware that I'm not aware of all useful packages yet.

I tried out the nonfloat page and it did the works (thank you!). So, I think I'll stick with that from now instead of the non-promisable [!h] or [!H] options.

However, I had two issues:
  • "\\[\intextsep]": It seems as if \\[\intextsep] cannot be on a line of its own because I get an error. But, in the nonfloat-en.pdf it's on a line alone.
  • the problem with footnotetext showing up on the wrong packages persist even with nonfloat and I've followed your example as far as I can see.
Juanjo wrote:
  • Off topic: article class for writing a thesis?
[/list]
What do you suggest then - report?
Have used article with my previous thesis (160 pages) and it worked out fine.
I read up on the difference between the two and except for report allowing the use of chapters I did not find much difference.
But, if there is any other reason to change then I'm all ears.

Regards,
Jimisola
jimisola
Posts: 22
Joined: Sat Feb 02, 2008 2:54 am

Problems with \footnote in \caption (in table or figure env)

Post by jimisola »

sommerfee wrote:
Juanjo wrote:\usepackage{nonfloat}
I do not recommended the usage of the nonfloat package. Beside the fact that its documentation tells wrong things (floats placed with [H] are not limited to have captions beneath the float, how should they, [H] is a placement parameter and therefore has nothing to do with the contents of the float), it changes the float placement parameters (\textfraction etc., and also \@fptop etc.) and has no option to suppress that. Furthermore it defines a command called \topcaption which conflicts with \topcaption coming from the supertabular package.

I recommend the usage of the capt-of package instead, it simply defines \captionof, if that is all you need, this is the perfect package for you.
Thank you for the feedback. I'll had a look at capt-of and I have to be honest, I don't know if \captionof is all I need.
If I understood it right, it lets me leave out \begin{figure|table} which are floats.

To sum it up my current problems are:

1) figures and tables are out of order (I need them in a specific order)
2) some of my captions has footnote/footnotemark in them
3) these footnotetext are not shown on the page where the footnotemark is

What I currently use are table, figure and boxedminipage (note the use of footnote[mark|text]):

Code: Select all

Code, edit and compile here:
\begin{table}[]
\centering
\begin{tabulary}{\textwidth}{|C|L|}
...
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Code: Select all

Code, edit and compile here:
\begin{figure}[]
\rule{\textwidth}{0.005in}
\centering
\resizebox{11cm}{!}{\includegraphics{tem-modell}}
\caption{Schematisk översikt av TEM-modellen}
\label{figure_bakgrund_tem_modell}
\rule{\textwidth}{0.005in}
\end{figure}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Code: Select all

Code, edit and compile here:
\noindent\begin{boxedminipage}[]{\textwidth}
\begin{center}
\textbf{Definition av Undesired aircraft state}
\end{center}
Undesirable aircraft state är definerat som en position, hastighet, attityd, tillstånd eller konfiguration av ett flygplan som:\footnotemark
\begin{itemize}
\item härstammar från fel av flygplansbesättning, \textcolor{red}{agerande/handlade} eller icke-handlande
\item klar minskar säkerhetsmarginaler
\end{itemize}
\end{boxedminipage}
\footnotetext{\cite{defensive-flying,FAA-losa-ac,ICAO-9803}}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Regards,
Jimisola
balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: Problems with \footnote in \caption (in table or figure env)

Post by balf »

Did you think of looking at the ctable package? This is another package that handles footnotes in a table or figure environment (and many other things). It doesn't seem to cooperate with tabulary, but it does with tabularx. So maybe with some redefinitions in your preamble...

Regards,
B.A.
jimisola
Posts: 22
Joined: Sat Feb 02, 2008 2:54 am

Problems with \footnote in \caption (in table or figure env)

Post by jimisola »

balf wrote:Did you think of looking at the ctable package? This is another package that handles footnotes in a table or figure environment (and many other things). It doesn't seem to cooperate with tabulary, but it does with tabularx. So maybe with some redefinitions in your preamble...
No, I haven't looked at ctable and I doubt I'll be able to use it. I seem to recall that I needed to use tabulary for my needs (see this thread http://www.latex-community.org/viewtopic.php?f=5&t=910).

A typical table of mine looks as follows. I fought hard to get the alignment, width and spacing that it has.
Do you think that I can get the table to look the exact same in tabularx?

Code: Select all

Code, edit and compile here:
\begin{table}[]
\centering
\begin{tabulary}{\textwidth}{|C|L|}
\hline
\rowcolor[gray]{.75}
\vphantom{\rule{0pt}{10pt}}typer av undesirable aircraft states & \vphantom{\rule{0pt}{10pt}}Exempel \\[5pt]
\hline
flygplanshantering & vertikal, laterala eller hastighets-deviationer\newline
onödiga väderpenetreringar\newline
unstable approaches\newline
långa, flytande, bestämda eller icke-centrumlinje-landingar\\\hline
marknavigering & runway/taxiway-intrång\newline
fel taxiway, ramp, gate eller hold spot\newline
taxning över hastighetsbegränsning\\\hline
felaktig flygplanskonfiguration & automation, motor, roder, system eller mass-balans \textcolor{red}{events}\\\hline
\end{tabulary}
\caption[Typer av undesirable aircraft states samt exempel]%
{Typer av undesirable aircraft states samt exempel\footnotemark}
\label{table_bakgrund_tem_uas_exempel}
\end{table}
\footnotetext{\cite{defensive-flying}}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Regards,
Jimisola

Off topic:

I love LaTeX, but I have to say that all these different packages, ways to do things and different opinions on how to do it does not help.
Quite frankly, I'm certain that it would have gone faster to write this report in Word/OpenOffice despite their obvious cons.
Still, I like the output etc that LaTeX gives me and I hope that all the trouble I'm going through now will be a one-time thing.

EDIT: I had a look at ctable and I doubt it works for me 1) it does not support tabulary and 2) the footnotes are placed at the bottom of the table/figure not at the bottom of the page. I can already have that done today in a simplier manner.

People please feel free to come up with suggestions on how to solve this. As for now, I have to stop trying to fix this now - I need to focus on the actual writing of my thesis.
Post Reply