LaTeX forum ⇒ Page LayoutFootnote in figure caption

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Re: Footnote in figure caption

Postby Johannes_B » Mon Mar 02, 2015 5:53 pm

My example above should produce the word table, you can verify by clicking on »Open in writelatex« (which is now known as Overleaf).

You can change the size of the tablefootnotes by using any font switch you find in introductory books. In the example below i used Large and made it red, just to emphasize what changes.
  1. \documentclass[11pt, a4paper, oneside, onecolumn, openany]{book}
  2. \usepackage{etoolbox}
  3. \usepackage{parskip}
  4. \usepackage{showframe}
  5. \usepackage{mwe}
  6. \usepackage{threeparttable}
  7. \AtBeginEnvironment{tablenotes}{\Large\color{red}}%Make the
  8. %tablenotes red and Large. Or \footnotesize ;-)
  9. \newcommand{\species}[1]{\textit{#1}}%Helper command, keep it
  10. %flexible
  11. \begin{document}
  12.  
  13. \chapter{Test Chapter}
  14. \label{chap:testB}
  15. Computational models are mathematical models of systems such as
  16. are found in biology, physics, weather systems etc. Such models
  17. can be used to predict the behaviour of these systems in an
  18. effort to develop interventions which help to control our
  19. environment. By predicting weather systems we can safeguard
  20. ourselves against extreme weather conditions or plan our crops to
  21. avoid failures. In physics, models serve the purpose of
  22. discovering the origins of the universe and predicting what the
  23. future might hold for us. In biology, computational models serve
  24. to provide a better understanding of the way our bodies work as
  25. part of our effort to fight disease and prolong
  26. life\footnote{stuff}.
  27.  
  28. \blindtext[2]
  29. \begin{figure}[t]
  30. \centering
  31. \begin{threeparttable}
  32. \begin{tabular}{c}
  33. \includegraphics[width=.9\linewidth]{example-image-b}
  34. \end{tabular}
  35. \caption{From left to right: \species{Caenorhabditis
  36. elegans}\tnote{a}, \species{Drosophila melanogaster}\tnote{b},
  37. \species{Saccharomyces cerevisiae}, \species{Danio rerio}.}
  38. \label{fig:model_organismsB}
  39. \begin{tablenotes}
  40. \item [a] A footnote
  41. \item [b] Another footnote
  42. \end{tablenotes}
  43. \end{threeparttable}
  44. \end{figure}
  45. \end{document}



Concerning the other boxed stuff. Can you make a minimal working example, so i can see what is going on? The code defines new floating environments for programs and directory listings. Do you need this stuff, or is it rubbish from an old template?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

jannetta
Posts: 46
Joined: Mon Dec 22, 2008 12:59 pm

Postby jannetta » Sun May 31, 2015 3:28 pm

I followed the instruction of Johannes_B to get footnotes below an image and to change the resultant "Table" in the caption to "Figure". However, I just noticed that the rewnewcommand also resets the counter. So in stead of Figure 3.4, the figure became Figure 3.1 again. How can I correct this?

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun May 31, 2015 3:32 pm

Hi Jannetta,

as far as i can see, there is no renewcommand in my last example, and there is no need at all to redefine anything. Can you show a minimal example of what is going on in your code?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

jannetta
Posts: 46
Joined: Mon Dec 22, 2008 12:59 pm

Postby jannetta » Sun May 31, 2015 6:45 pm

Actually, I see the renewcommand was a comment by ghuczek. When I used the threeparttable that you suggested, (Johannes_B) the figure was considered a table by LaTeX and I wanted it to be a figure. The suggestion to use the renewcommand worked but then I noticed that it also reset the figure counter back to to in stead of continuing on from the previous figure.

The code is below:

  1. \renewcommand{\tablename}{Figure}
  2. \begin{figure}[H]
  3. \centering
  4. \begin{threeparttable}
  5. \begin{tabular}{c}
  6. \includegraphics[width=.9\linewidth]{graphics/ident_neurons.png}
  7. \end{tabular}
  8. \caption{The red arrow points to features typical of the specific neurons\tnote{a}.}
  9. \label{fig:ident_neurons}
  10. \begin{tablenotes}
  11. \item [a] \footnotesize From the Nadim, Golowasch, Bucher STG website at \url{http://stg.rutgers.edu/resources/Cancer_Guide.pdf}
  12.  
  13. \end{tablenotes}
  14. \end{threeparttable}
  15. \end{figure}

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun May 31, 2015 9:14 pm

What do you see exactly copying my example? It should be the same as when clicking on Open in WriteLaTeX.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

jannetta
Posts: 46
Joined: Mon Dec 22, 2008 12:59 pm

Postby jannetta » Sun May 31, 2015 9:49 pm

He is my MWE. I get "Table" in the caption, not "Figure", like in yours. I guess some other package must be messing it up but I have no idea how to find it.


  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %
  3. % Welcome to Overleaf --- just edit your LaTeX on the left,
  4. % and we'll compile it for you on the right. If you give
  5. % someone the link to this page, they can edit at the same
  6. % time. See the help menu above for more info. Enjoy!
  7. %
  8. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. \documentclass[11pt, a4paper, oneside, onecolumn, openany]{book} % Current
  10. \setlength{\parskip}{\medskipamount} \setlength{\parindent}{0em}
  11. \usepackage{ae,aecompl,amsbsy,amssymb,eurosym, graphicx, mathptmx, setspace}
  12. \usepackage{epsfig, multicol, multirow, paralist}
  13. \usepackage{a4wide}
  14. \usepackage{acro}
  15. \usepackage{helvet}
  16. \usepackage{fancyref}
  17. \usepackage[skip=2pt,font=scriptsize]{caption}
  18. \captionsetup{justification=justified}
  19. \usepackage{subfigure}
  20. \usepackage{url}
  21. \usepackage{etoolbox}
  22. \usepackage{threeparttable}
  23. \usepackage{parskip}
  24. \usepackage{mwe}
  25. \usepackage{blindtext}
  26. \usepackage{makeidx}
  27. \usepackage[pdftex]{hyperref}
  28. \usepackage{todonotes}
  29. \usepackage{float}
  30. \usepackage{sidecap}
  31. \usepackage{fixltx2e}
  32. \usepackage{listings}
  33. \usepackage{color}
  34. \usepackage{mathtools}
  35.  
  36. \definecolor{mygreen}{rgb}{0,0.6,0}
  37. \definecolor{mygray}{rgb}{0.5,0.5,0.5}
  38. \definecolor{mymauve}{rgb}{0.58,0,0.82}
  39.  
  40. \floatstyle{boxed}
  41. \floatstyle{ruled}
  42. \floatname{figure}{Figure}
  43.  
  44. \hypersetup{
  45. unicode=false, % non-Latin characters in Acrobat’s bookmarks
  46. pdftoolbar=true, % show Acrobat’s toolbar?
  47. pdfmenubar=true, % show Acrobat’s menu?
  48. pdffitwindow=true, % page fit to window when opened
  49. pdftitle={Analysis and Modelling of the PY Complex in the Pyloric Circuit of the Crab Stomatogastric Ganglion}, % title
  50. pdfauthor={Jannetta S. Steyn}, % author
  51. pdfsubject={Subject}, % subject of the document
  52. pdfnewwindow=true, % links in new window
  53. pdfkeywords={keywords}, % list of keywords
  54. colorlinks=true, % false: boxed links; true: colored links
  55. linkcolor=cyan, % color of internal links
  56. linkcolor=blue,
  57. citecolor=red, % color of links to bibliography
  58. filecolor=green, % color of file links
  59. urlcolor=blue % color of external links
  60. }
  61.  
  62.  
  63.  
  64. \setstretch{1.5}
  65. \setlength{\oddsidemargin}{1.7cm}
  66. \setlength{\evensidemargin}{-0.8cm}
  67. \setlength{\topmargin}{-0.8cm}
  68. \setlength{\textwidth}{15.4cm}
  69. \setlength{\textheight}{24cm}
  70.  
  71. \makeindex
  72. %\makeglossaries
  73.  
  74. \newcommand{\species}[1]{\textit{#1}}
  75. \AtBeginEnvironment{tablenotes}{\Large\color{red}}
  76. %\loadglsentries{glossary}
  77. \include{abbrevs2}
  78. \begin{document}
  79.  
  80. \begin{figure}[t]
  81. \centering
  82. \begin{threeparttable}
  83. \begin{tabular}{c}
  84. \includegraphics[width=.9\linewidth]{example-image-b}
  85. \end{tabular}
  86. \caption{From left to right: \species{Caenorhabditis
  87. elegans}\tnote{a}, \species{Drosophila melanogaster}\tnote{b},
  88. \species{Saccharomyces cerevisiae}\tnote{c}, \species{Danio rerio}\tnote{d}.}
  89. \label{fig:model_organismsB}
  90. \begin{tablenotes}
  91. \item [a] \footnotesize\species{Caenorhabditis elegans} by Bob Goldstein, UNC Chapel Hill is licensed under CC BY-SA 3.0, \url{http://bio.unc.edu/people/faculty/goldstein/}
  92. \item [b] \footnotesize\species{Drosophila Melanogaster} by Andr\'{e} Karwath is licensed under CC BY-SA 2.5, \url{http://upload.wikimedia.org/wikipedia/commons/4/4c/Drosophila_melanogaster_-_side_\%28aka\%29.jpg}
  93. \item [c] \footnotesize\species{Saccharomyces cerevisiae} cells by Masur in Public Domain, \url{https://upload.wikimedia.org/wikipedia/commons/d/d9/S_cerevisiae_under_DIC_microscopy.jpg}
  94. \item [d] \footnotesize\species{Danio Rerio} by Pogrebnoj-Alexandroff is licenced under CC BY-SA 3.0, \url{https://upload.wikimedia.org/wikipedia/commons/9/91/Danio_rerio_lab_left.JPG}
  95. \end{tablenotes}
  96. \end{threeparttable}
  97. \end{figure}
  98.  
  99.  
  100. \end{document}

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun May 31, 2015 10:13 pm

It is the caption-package that somehow detects the tabular. My solution is more of a dirty hack than a clean workaround. But here we go, i made some further comments in the code.
  1. \documentclass[11pt, a4paper, oneside, onecolumn, openany]{book} % Current
  2. \setlength{\parskip}{\medskipamount} \setlength{\parindent}{0em}
  3. %\usepackage{ae,aecompl,%very very very obsolete
  4. %amsbsy,amssymb,eurosym, graphicx, mathptmx, setspace}
  5. %\usepackage{epsfig,%Same here, obsolete
  6. %multicol, multirow, paralist}
  7. %\usepackage{a4wide}%obsolete as well
  8. %\usepackage{acro}
  9. %\usepackage{helvet}
  10. %\usepackage{fancyref}
  11. \usepackage[skip=2pt,font=scriptsize]{caption}
  12. %\captionsetup{justification=justified}
  13. %\usepackage{subfigure}%obsolete
  14. \usepackage{etoolbox}
  15. \usepackage{threeparttable}
  16. %\usepackage{parskip}%You have set the parskip by hand in line two, now it is overridden
  17. \usepackage{mwe}
  18. %\usepackage{makeidx}
  19. %\usepackage{todonotes}
  20. %%\usepackage{float}
  21. %\usepackage{sidecap}
  22. %\usepackage{fixltx2e}
  23. %\usepackage{listings}
  24. \usepackage{xcolor}%changed to xcolor
  25. %\usepackage{mathtools}
  26. %
  27. %\definecolor{mygreen}{rgb}{0,0.6,0}
  28. %\definecolor{mygray}{rgb}{0.5,0.5,0.5}
  29. %\definecolor{mymauve}{rgb}{0.58,0,0.82}
  30. %
  31. %\floatstyle{boxed}
  32. %\floatstyle{ruled}
  33. %\floatname{figure}{Figure}
  34. \usepackage{hyperref}%Better leave out the optional argument here
  35.  
  36. %\hypersetup{
  37. % unicode=false, % non-Latin characters in Acrobat’s bookmarks
  38. % pdftoolbar=true, % show Acrobat’s toolbar?
  39. % pdfmenubar=true, % show Acrobat’s menu?
  40. % pdffitwindow=true, % page fit to window when opened
  41. % pdftitle={Analysis and Modelling of the PY Complex in the Pyloric Circuit of the Crab Stomatogastric Ganglion}, % title
  42. % pdfauthor={Jannetta S. Steyn}, % author
  43. % pdfsubject={Subject}, % subject of the document
  44. % pdfnewwindow=true, % links in new window
  45. % pdfkeywords={keywords}, % list of keywords
  46. % colorlinks=true, % false: boxed links; true: colored links
  47. % linkcolor=cyan, % color of internal links
  48. % linkcolor=blue,
  49. % citecolor=red, % color of links to bibliography
  50. % filecolor=green, % color of file links
  51. % urlcolor=blue % color of external links
  52. %}
  53. %
  54.  
  55.  
  56. %\setstretch{1.5}
  57. %\setlength{\oddsidemargin}{1.7cm}
  58. %\setlength{\evensidemargin}{-0.8cm}
  59. %\setlength{\topmargin}{-0.8cm}
  60. %\setlength{\textwidth}{15.4cm}
  61. %\setlength{\textheight}{24cm}
  62. %I would set the stuff using package geometry
  63.  
  64. %\makeindex
  65. %\makeglossaries
  66.  
  67. \newcommand{\species}[1]{\textit{#1}}
  68. \AtBeginEnvironment{tablenotes}{\footnotesize\color{red}}
  69. %\loadglsentries{glossary}
  70. %\include{abbrevs2}
  71. \begin{document}
  72.  
  73. \begin{figure}[t]
  74. \centering
  75. \begin{threeparttable}
  76. \begin{tabular}{c}
  77. \includegraphics[width=.9\linewidth]{example-image-b}
  78. \end{tabular}
  79. \makeatletter\def\@captype{figure}\makeatother
  80. \caption{From left to right: \species{Caenorhabditis
  81. elegans}\tnote{a}, \species{Drosophila melanogaster}\tnote{b},
  82. \species{Saccharomyces cerevisiae}\tnote{c}, \species{Danio rerio}\tnote{d}.}
  83. \label{fig:model_organismsB}
  84. \begin{tablenotes}
  85. \item [a] \species{Caenorhabditis elegans} by Bob Goldstein, UNC Chapel Hill is licensed under CC BY-SA 3.0, \url{http://bio.unc.edu/people/faculty/goldstein/}
  86. \item [b] \species{Drosophila Melanogaster} by Andr\'{e} Karwath is licensed under CC BY-SA 2.5, \url{http://upload.wikimedia.org/wikipedia/commons/4/4c/Drosophila_melanogaster_-_side_\%28aka\%29.jpg}
  87. \item [c] \species{Saccharomyces cerevisiae} cells by Masur in Public Domain, \url{https://upload.wikimedia.org/wikipedia/commons/d/d9/S_cerevisiae_under_DIC_microscopy.jpg}
  88. \item [d] \species{Danio Rerio} by Pogrebnoj-Alexandroff is licenced under CC BY-SA 3.0, \url{https://upload.wikimedia.org/wikipedia/commons/9/91/Danio_rerio_lab_left.JPG}
  89. \end{tablenotes}
  90. \end{threeparttable}
  91. \end{figure}




EDIT: Threeparttable is a quirky little package.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

jannetta
Posts: 46
Joined: Mon Dec 22, 2008 12:59 pm

Postby jannetta » Mon Jun 01, 2015 1:45 am

I think it is working now. I commented out as in your example and then had to put a few things back such as acro and listings, some defined colours etc. It still wouldn't work but then I commented out the line "\usepackage[skip=2pt,font=scriptsize]{caption}". Now it seems to work. I'll have to check properly later on, but now I have to get to bed :-)

Many thanks for your help.

tquest
Posts: 1
Joined: Thu May 16, 2019 9:24 pm

Postby tquest » Thu May 16, 2019 10:04 pm

Simple resolution is here:
https://tex.stackexchange.com/questions/21813/footnote-in-math-mode

David Carlisle solution is brilliantly simple: the key is a footnote counter.
I have two footnotemarks in one caption to the figure. Unfortunately one is within extra math mode $$, but that's okay.
Caution: This can't be the first counter marker! See code...

CODE:
\documentclass{article}

\begin{document}

\begin{eqnarray} % I have here figure &
foo && foo \footnotemark\\
foo && foo \footnotemark
\end{eqnarray}

\addtocounter{footnote}{-1}
\footnotetext{something}
\stepcounter{footnote}
\footnotetext{something else}

\end{document}

In Preamble i have
  1. \usepackage{footmisc}
but I don't know if it's that important.

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri May 17, 2019 6:50 am

Welcome to the LaTeX community.

Please note that you are referring to lockstep's answer. And as egreg noted in his answer, eqnarray is obsolete for years.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “Page Layout”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest