1

I need to refer the same footnote in different lines. I am using scrbook class. I read Reference different places to the same footnote and tried in following way:

First time referencing\footnote{\label{footnote}text}.

Second time referencing\footref{footnote}.

But it gives the following output. Would anyone please suggest for the second time referencing how to display only the number instead of "footnote no."? Thank you.

enter image description here

Update: Minimal working example

\documentclass{scrbook}\begin{document}
\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
\newlength{\abc}
\settowidth{\abc}{\space}
\AtBeginDocument{%
\addto\extrasenglish{
 \renewcommand{\equationautorefname}{\hspace{-\abc}}
 \renewcommand{\sectionautorefname}{sec.\negthinspace}
 \renewcommand{\subsectionautorefname}{sec.\negthinspace}
 \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}
 \renewcommand{\figureautorefname}{Fig.\negthinspace}
 \renewcommand{\tableautorefname}{Tab.\negthinspace}
}
}

\usepackage[figure]{hypcap}

First time referencing\footnote{\label{footnote}text}.

Second time referencing\footref{footnote}.

\end{document}

1118716
  • 57
  • If all I do is wrap your code in \documentclass{scrbook}\begin{document} and \end{document} I do not get that result. There must be some other code or package in your document you haven't shown that is responsible. Please post a minimal working example showing the problem. – frabjous Apr 14 '22 at 02:29
  • @frabjous, this is a book template and actually there are lots of packages included in the preamble. I even could not understand which package is responsible for that. Thanks for your comment. – 1118716 Apr 14 '22 at 02:47
  • Welcome to tex.se! In addition to frabjous's link, see here for some LyX-specific info: https://wiki.lyx.org/FAQ/MinimalExample – scottkosty Apr 14 '22 at 03:25
  • I updated the question. – 1118716 Apr 14 '22 at 10:33

2 Answers2

1

Have you though about simply using \label in the first time that the footnote appears and \ref to make reference for the footnote?

\documentclass{scrbook}
\begin{document}
This is the text and reference to footnote.\footnote{\label{fn}Text of footnote.}

Need to make reference again here to the same text of a previous footnote.\textsuperscript{\ref{fn}}

\end{document}

enter image description here

Andre
  • 969
  • 1
    Don't misuse maths mode. \textsuperscript{} is designed for superscript text. But, in any case, there are specialised commands for this situation and it is a bad idea to mark your document up based on appearances. What if you decide you need end notes rather than footnotes, for example? – cfr Oct 08 '23 at 03:24
  • 1
    @cfr Good point. I changed the answer with the use of \textsuperscript{}. You are right about being a solution that might not work permanently. But it is a simple solution that can be helpful in certain cases – Andre Oct 08 '23 at 15:41
0

It seems that scrbook has its own idea about \footref. Use your own definition like

% footrefprob.tex  SE 640730

\documentclass{scrbook}

\renewcommand{\footref}[1]{\textsuperscript{\ref{#1}}}

\begin{document}

First time referencing\footnote{\label{footnote}text}.

Second time referencing\footref{footnote}.

\end{document}

Your MWE, below, had several problems. Did you actually compile it?

\documentclass{scrbook}\begin{document} \AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}} \newlength{\abc} \settowidth{\abc}{\space} \AtBeginDocument{% \addto\extrasenglish{ \renewcommand{\equationautorefname}{\hspace{-\abc}} \renewcommand{\sectionautorefname}{sec.\negthinspace} \renewcommand{\subsectionautorefname}{sec.\negthinspace} \renewcommand{\subsubsectionautorefname}{sec.\negthinspace} \renewcommand{\figureautorefname}{Fig.\negthinspace} \renewcommand{\tableautorefname}{Tab.\negthinspace} } }

\usepackage[figure]{hypcap}

First time referencing\footnote{\label{footnote}text}.

Second time referencing\footref{footnote}.

\end{document}

enter image description here

The memoir class (a superset of book and report) has a \footref macro that does what you want, which is what I would have thought was the general desire.

Peter Wilson
  • 28,066
  • Yes, I compiled it. It shows several errors. I added \renewcommand{\footref}[1]{\textsuperscript{\ref{#1}}} in the preamble, but that does not resolve the problem. This is the book template that my teacher gave. I cannot delete any existing code. I can only add if required. – 1118716 Apr 15 '22 at 04:23
  • @user268373 Did my MWE work for you? If it did then you have problems with your template (whatever a template is). You say you cannot delete any existing code but you can always redefine it (\renewcommand... in general or \renewcommand{\acommand}{} to effectively nullify (delete) it.) – Peter Wilson Apr 15 '22 at 18:03
  • it works if I create a new file. With my template, it does not work. Looks like there is some problems with my template. – 1118716 Apr 16 '22 at 01:18