
Мне нужно сослаться на ту же сноску в разных строках. Я использую scrbook
класс. Я читаюСсылка на одну и ту же сноску в разных местахи попробовали следующим образом:
Впервые ссылаюсь \footnote{\label{footnote}text}
.
Второй раз ссылаюсь \footref{footnote}
.
Но он выдает следующий вывод. Кто-нибудь может предложить во второй раз ссылку, как отображать только номер вместо "сноски №."? Спасибо.
Обновление: Минимальный рабочий пример
\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}
решение1
Вы когда-нибудь задумывались о том, чтобы просто использовать \label
сноску в первый раз, когда она появляется, и \ref
сделать ссылку на нее?
\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}
решение2
Кажется, что scrbook
у него есть собственное представление о \footref
. Используйте свое собственное определение, например
% 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}
Класс memoir
(надмножество book
и report
) имеет \footref
макрос, который делает то, что вам нужно, что, как я и думал, является общим желанием.