LaTeX forum ⇒ 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)

Postby jimisola » Mon Mar 17, 2008 2:10 pm

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 278 times

Link:
BBcode:
HTML:
Hide post links
Show post links

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

Postby jimisola » Thu Mar 20, 2008 12:44 am

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

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7801
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Thu Mar 20, 2008 1:14 am

Hi jimisola,

the threeparttable package should be a good solution.

Stefan

Link:
BBcode:
HTML:
Hide post links
Show post links

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

Postby jimisola » Thu Mar 20, 2008 1:37 am

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?

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Juanjo
Posts: 656
Joined: Sat Jan 27, 2007 12:46 am

Postby Juanjo » Thu Mar 20, 2008 2:13 am

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.
    1. \documentclass{article}
    2. \usepackage{nonfloat}
    3. \begin{document}
    4.  
    5. \listoftables
    6.  
    7. \section{First example}
    8.  
    9. The footnote for the caption goes below the table.\\[\intextsep]
    10.  
    11. \begin{minipage}{\textwidth}
    12. \centering
    13. \begin{tabular}{|c|}
    14. \hline Tabular stuff here \\ \hline
    15. \end{tabular}
    16. \tabcaption[Text of the caption (first example)]{Text of the caption
    17. (first example)\footnote{Text of the footnote (first example)}}
    18. \end{minipage}
    19. \\[\intextsep]
    20.  
    21. \section{Second example}
    22.  
    23. The footnote for the caption goes at the bottom.\\[\intextsep]
    24. \begin{minipage}{\textwidth}
    25. \centering
    26. \begin{tabular}{|c|}
    27. \hline Tabular stuff here \\ \hline
    28. \end{tabular}
    29. \tabcaption[Text of the caption (second example)]{Text of the caption (second example)\footnotemark}
    30. \end{minipage}
    31. \\[\intextsep]
    32. \footnotetext{Text of the footnote (second example)}
    33.  
    34. \end{document}

  • Off topic: article class for writing a thesis?

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
sommerfee
Posts: 495
Joined: Mon Apr 09, 2007 4:20 pm
Contact:

Postby sommerfee » Thu Mar 20, 2008 12:05 pm

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.

Link:
BBcode:
HTML:
Hide post links
Show post links

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

Postby jimisola » Thu Mar 20, 2008 1:53 pm

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?


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

Link:
BBcode:
HTML:
Hide post links
Show post links

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

Postby jimisola » Thu Mar 20, 2008 2:16 pm

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]):

  1. \begin{table}[]
  2. \centering
  3. \begin{tabulary}{\textwidth}{|C|L|}
  4. ...

  1. \begin{figure}[]
  2. \rule{\textwidth}{0.005in}
  3. \centering
  4. \resizebox{11cm}{!}{\includegraphics{tem-modell}}
  5. \caption{Schematisk översikt av TEM-modellen}
  6. \label{figure_bakgrund_tem_modell}
  7. \rule{\textwidth}{0.005in}
  8. \end{figure}


  1. \noindent\begin{boxedminipage}[]{\textwidth}
  2. \begin{center}
  3. \textbf{Definition av Undesired aircraft state}
  4. \end{center}
  5.  
  6. Undesirable aircraft state är definerat som en position, hastighet, attityd, tillstånd eller konfiguration av ett flygplan som:\footnotemark
  7. \begin{itemize}
  8. \item härstammar från fel av flygplansbesättning, \textcolor{red}{agerande/handlade} eller icke-handlande
  9. \item klar minskar säkerhetsmarginaler
  10. \end{itemize}
  11. \end{boxedminipage}
  12. \footnotetext{\cite{defensive-flying,FAA-losa-ac,ICAO-9803}}



Regards,
Jimisola

Link:
BBcode:
HTML:
Hide post links
Show post links

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

Postby balf » Thu Mar 20, 2008 2:40 pm

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.

Link:
BBcode:
HTML:
Hide post links
Show post links

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

Postby jimisola » Thu Mar 20, 2008 3:00 pm

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?

  1. \begin{table}[]
  2. \centering
  3. \begin{tabulary}{\textwidth}{|C|L|}
  4. \hline
  5. \rowcolor[gray]{.75}
  6. \vphantom{\rule{0pt}{10pt}}typer av undesirable aircraft states & \vphantom{\rule{0pt}{10pt}}Exempel \\[5pt]
  7. \hline
  8. flygplanshantering & vertikal, laterala eller hastighets-deviationer\newline
  9. onödiga väderpenetreringar\newline
  10. unstable approaches\newline
  11. långa, flytande, bestämda eller icke-centrumlinje-landingar\\\hline
  12. marknavigering & runway/taxiway-intrång\newline
  13. fel taxiway, ramp, gate eller hold spot\newline
  14. taxning över hastighetsbegränsning\\\hline
  15. felaktig flygplanskonfiguration & automation, motor, roder, system eller mass-balans \textcolor{red}{events}\\\hline
  16. \end{tabulary}
  17. \caption[Typer av undesirable aircraft states samt exempel]%
  18. {Typer av undesirable aircraft states samt exempel\footnotemark}
  19. \label{table_bakgrund_tem_uas_exempel}
  20. \end{table}
  21. \footnotetext{\cite{defensive-flying}}


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.

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “General”

Who is online

Users browsing this forum: No registered users and 5 guests