3

The aim is to footnote something without a number. The idea was something like

\newcommand\blfootnote[1]{\begingroup\renewcommand\thefootnote{}\footnote{#1}\addtocounter{footnote}{-1}}

Given this code at the bottom I have two problems:

  1. The footnote with \blfootnote has no number but hyperref put some red box without content. This I don't want.

  2. The footnotes with \footnote have no numbers anymore.

    \documentclass{scrartcl}
    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    \usepackage[ngerman]{babel}
    \newcommand\blfootnote[1]{\begingroup\renewcommand\thefootnote{}\footnote{#1}\addtocounter{footnote}{-1}}
    \usepackage[ngerman]{varioref}
    \usepackage{hyperref}
    \usepackage[ngerman]{cleveref}
    \begin{document}
    \blfootnote{should be without number and is without number}
    \footnote{should be with number but is without number}
    \end{document}
    

How can this be fixed?

  • You say \begingroup, but you forgot the corresponding \endgroup! ;-) See Werner’s answer, anyway. – GuM Aug 25 '16 at 21:05
3

For \footnotes without a number, just use \footnotetext with a minor adjustment of the printing of the footnote number:

enter image description here

\documentclass{article}

\usepackage[paperheight=20\baselineskip]{geometry}% Just for this example

\newcommand{\blfootnote}[1]{{\renewcommand{\thefootnote}{\roman{footnote}}\footnotetext[0]{#1}}}

\usepackage{hyperref}

\begin{document}

\blfootnote{should be without number and is without number}
\footnote{should be with number}

\end{document}

\footnotetext[<num>]{<fn>} sets the footnote <fn> with the number <num>. If no number is specified, it uses the current footnote number. The definition of \blfootnote resets the numbering scheme to \alph and forces the footnote number to 0. And since \alph of the number 0 results in a blank entry, not footnote number is printed.

The change inside \blfootnote of \thefootnote is localized so \thefootnote reverts back to the original definition after the macro call.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy