16

I want to know if is there a possibility/method/package, by which I can uniquely label all footnote positions in book.tex. And another file, footnote.tex, containing the footnotes and matching labels, which can be used for inserting footnotes?

Example:

blah blah blah\footnotemark{id1} blah blah\footnotemark{id2} in chap1.tex; \footnotetext{id1}{blah blah},\footnotetext{id2}{blah blah blah} in chap1foot.tex. When chap1.tex is ran I need \footnotetext{id1}{blah blah} to appear with footnote counter starting from 1 in each page.

4
  • Welcome to TeX.SX! Do you want the footnote texts to be in another file? Can you clarify your question?
    – egreg
    Oct 12, 2012 at 19:43
  • Yes I need footnote text in another file, But appear as normal footnotes in output i.e. each page footnote counter starts from 1. Oct 12, 2012 at 20:14
  • The main risk of this approach is losing the correspondence between the footnotes; it very hard to maintain if you need to add a footnote between two others.
    – egreg
    Oct 12, 2012 at 20:44
  • The syntax is \footnotemark[<num>] since <num> is assigned to a counter. Please elaborate on the following: Are you creating the file chap1.tex and chap1foot.tex separately, or do you want this to be automated? Do you want the footnotes to appear on the actual pages that you have the accompanying \footnotemark?
    – Werner
    Oct 13, 2012 at 1:42

1 Answer 1

19

I believe what you're looking for is the sepfootnotes package. Here is an example of its basic usage:

% to keep this example self-contained
% the file that contains the footnotes:
\RequirePackage{filecontents}
\begin{filecontents}{\jobname-notes.tex}
\Anotecontent{id1}{\label{id1}This is the footnote with id1.}
\Anotecontent{id2}{\label{id2}This is the footnote with id2.}
\Anotecontent{id3}{This is the footnote with id3.}
\end{filecontents}

\documentclass{scrartcl}
\usepackage{sepfootnotes}
% this defines new footnotes and the commands
%   \Anotecontent{<id>}{<text>}
%   \Anote{<id>}
% and a few more:
\newfootnotes{A}

% input the footnote definitions:
\input{\jobname-notes}

% just for this example:
\textheight=80pt

\begin{document}

A text\Anote{id1} with some footnotes\Anote{id2} to demonstrate how
`sepfootnotes' works.\footnotemark[\ref{id1}] In order to make
this\Anote{id3} a bit longer here's another\footnotemark[\ref{id2}]
sentence.

\end{document}

enter image description here

3
  • I have appreciated your response. What is the difference between using or not using \label{idN}?
    – A. Cedano
    Feb 4, 2021 at 13:00
  • 1
    @A.Cedano the same as always: with a label the footnote can be referenced as I showed in the example
    – cgnieder
    Feb 4, 2021 at 17:06
  • Ok. Thanks. I just implemented it and it works great.
    – A. Cedano
    Feb 4, 2021 at 17:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .