Text Formattingfncychap and footnotes

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
bafl
Posts: 4
Joined: Mon Jan 11, 2010 11:53 am

fncychap and footnotes

Post by bafl »

At the moment i am working on my thesis. I would like to use the fncychap pacckage. In my chapter title i have a reference to a footnote
\chapter{title\footnote{text}}

When i dont use the fncychap package the footnote will be visible at the bottom of the page. When i do use the package the footnote will not appear.

Does anybody know how to solve this problem or know an other way to refer to a footnote text of a kind? Btw: the footnote gives information about where i published most data in the chapter.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

fncychap and footnotes

Post by gmedina »

Hi,

you should protect the \footnote command. Additionally, you could use the optional argument of the \chapter command to prevent the footnote from appearing in the Table of Contents. Take a look at the following example code:

Code: Select all

\documentclass{book}
\usepackage[Lenny]{fncychap}

\begin{document}
\tableofcontents

\chapter[Test chapter]{Test chapter\protect\footnote{Test footnote.}}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
bafl
Posts: 4
Joined: Mon Jan 11, 2010 11:53 am

Re: fncychap and footnotes

Post by bafl »

thanks for the quick reply. I tried this one out and the number is shown in the title, but the footnote is not visible. I found this about the protect command:

Latex complains when you put citations in table captions (and when you put footnotes in arguments of \section commands). Fix this by putting a \protect command in front:

\caption{Data taken from \protect \citeauthor{Efron79t}
\protect \shortcite{Efron79t}}

In general, any fragile command that appears in a moving argument must be preceded by a \protect command. See Help with Latex for more information.

So this should work. I will try more and if i find the solution i will post it in this forum. Hope you can help me out any further?
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

fncychap and footnotes

Post by gmedina »

bafl wrote:... I tried this one out and the number is shown in the title, but the footnote is not visible...
Hmmm... Can you please post a minimal working example showing this undesired behaviour? My previous code works OK, so I'm a little curious about why my suggestion isn't working for you.

Anyway, try using the footmisc package with the stable option:

Code: Select all

\documentclass{book}
\usepackage[Lenny]{fncychap}
\usepackage[stable]{footmisc}

\begin{document}
\tableofcontents

\chapter{Test chapter\footnote{Test footnote.}}

\end{document}
Note that now you don't need to explicitly protect \footnote neither to use the optional argument for \chapter.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
bafl
Posts: 4
Joined: Mon Jan 11, 2010 11:53 am

fncychap and footnotes

Post by bafl »

Thank you for your reply. I added footmisc but still it doesn't work. I think it conflicts with some other usepackage. Hereby an example file of the total setup. Hope you can help me.

Maybe it has something to do with
  • \usepackage{fancyhdr,lastpage}
    \usepackage{remreset}

Code: Select all

\documentclass[a4paper,titlepage]{book} 

%---------------------------------------------The different packages you want to use
%---------------------------------------------are given here
%---------------------------------------------You need to keep the fancyhdr and lastpage
%---------------------------------------------for this lay-out!!!

\usepackage{fullpage}
\usepackage{times} %om het font Times te gebruiken
\usepackage{amsmath} %om formules te kunnen schrijven
\usepackage{graphicx} %om figuren te kunnen invoegen
\usepackage{multicol} %meerdere kolommen in het artikel
\usepackage{subfigure}%meerdere figuren naast elkaar
\usepackage{fancyhdr,lastpage} %footers and headers, total number of pages
\usepackage{multirow}
\usepackage[stable]{footmisc}
\usepackage{eurosym} %\EUR{10} \euro generates the symbol. 
\usepackage[english]{babel} %ook voor hyphenation in english
\usepackage{minitoc} % adds mini TOC per chapter
\usepackage{datetime}
%\usepackage{makeidx}
%\makeindex
% ----- om te voorkomen dat de footnotes resetten bij ieder begin van een chapter ----
\usepackage{remreset} 
\makeatletter
\@removefromreset{footnote}{chapter}
\makeatother 
% ------------------------------------------------------------------------------------
\renewcommand{\thefootnote}{\roman{footnote}} % renew footnote numberering to i, ii, iii, iv, ...

\usepackage[Bjornstrup]{fncychap} %fancy chapter headings, google: fncychap pas op footnotes in chapter titels werken niet!
%\usepackage[colorlinks]{hyperref} % maakt links aan in PDF's van ref's en cite's 
\newdateformat{yyyymmdd}{\THEYEAR\twodigit{\THEMONTH}\twodigit{\THEDAY}}


\newcommand{\DOLLAR}[1]{\$\hspace{0.6mm}#1} %defines a new function \DOLLAR{0.10} where the distance between dollar sign and number is 0.6mm (like the EUR sign)


\numberwithin{equation}{section}


%---------------------------------------------This generates the different headers and footers
%---------------------------------------------Please put the TU_P2_black.jpg in the right dir!!

\pagestyle{fancy}

\fancyhf{} % clear all header and footer fields
\voffset = -50pt
\headheight = 60pt
\headsep = 15pt



\fancypagestyle{plain}{ %removes header and footnote first page
	\lhead{}
	\chead{}
	\rhead{}
	\lfoot{}
	\cfoot{}
	\rfoot{Page \thepage~of \pageref{LastPage}}
}

\rhead{\includegraphics [scale=0.7]{TU_P2_black.jpg}}
\lhead{Date: \usdate\today \newline Page \thepage~of~\pageref{LastPage}}
\renewcommand\headrulewidth{0pt} % Removes funny header line

\cfoot{} 

%---------------------------------------------wat vogelen met de opmaak

\setlength{\parskip}{0.25cm plus0.1cm minus0.2cm}% de afstand tussen paragrafen.

%---------------------------------------------This generates the first page

\begin{document}
\chapter{test\footnote{test footnote}}
\end{document}
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

fncychap and footnotes

Post by gmedina »

Hi. The problem comes from the use of the Bjornstrup option for the fncychap package, as can be seen in the following minimal example:

Code: Select all

\documentclass{book}
\usepackage[stable]{footmisc}
\usepackage[Bjornstrup]{fncychap}

\begin{document}

\chapter{test\footnote{this footnote won't appear in the final document}}

\end{document}
However, if you use, for example, Lenny as the option for fncychap, the problem disappears, as can be seen in the following example:

Code: Select all

\documentclass{book}
\usepackage[stable]{footmisc}
\usepackage[Lenny]{fncychap}

\begin{document}

\chapter{test\footnote{this footnote will appear in the final document}}

\end{document}
At this point, I have two possible solutions:

1) Instead of the standard \footnote command, use \footnotemark and \footnotetext, as the following code suggests:

Code: Select all

\documentclass{book}
\usepackage[Bjornstrup]{fncychap}
\usepackage[stable]{footmisc}

\begin{document}

\chapter{test\footnotemark[1]}
\footnotetext[1]{test footnote text}

\stepcounter{footnote}% required to avoid duplication of the counter
test text\footnote{A standard footnote}

\end{document}
2) Don't use the fncychap package; in its stead use the titlesec package to imitate the Bjornstrup style.

Of course, the first solution is the quickest (it requires no additional coding and it's already illustrated in my example.)
1,1,2,3,5,8,13,21,34,55,89,144,233,...
bafl
Posts: 4
Joined: Mon Jan 11, 2010 11:53 am

Re: fncychap and footnotes

Post by bafl »

thank you very much for your reply. I will try the first one out. Strange it only happens with Bjornstrup,...
Post Reply