LaTeX での番号付きおよび文字付き引用

LaTeX での番号付きおよび文字付き引用

以前から、Wikipedia には非常に優れた引用システムがあり、同じ参照が使用されている複数のインスタンスは、たとえば1テキスト内では として示され、参考文献セクションからは 、 などのようにバックリンクされ1aます1b

LaTeX でこれと同じ機能を提供するパッケージがあるかどうか知りたいです。biblatex と natbib しか見つけられませんでしたが、どちらにもそのような引用スキームはありません。

モックアップ:

Lorem ipsum dolor sit amet、consectetur adipiscing elit、sed do eiusmod tempor incididunt ut labore[1] et dolore magna aliqua。少なくとも、私たちは、自分の仕事と家庭を犠牲にしてまで、自分の利益のために働くつもりです。すでに痛み[2]が起こっており、その痛みは、無罪放免される[1]状態にあると非難されている。例外は、予期せぬ欲望が起こり、職務遂行中に労働を強いられたという過失によるものである[1]。

[1 a,b,c] ロレム・イプサム・ドロール・シット・アメット

[2] コンセクテトゥール・アディピスシング・エリート、セッド・ド・エ​​イウスモッド・テンポ

1はすべて同じ行にリンクしていますが、その行から、各1文字ずつリンクされています。または、参考文献と引用スタイルを参照することもできます。この記事

このバックボーンに基づいてこの機能の MWE を取得するのを手伝ってください:

\documentclass{article}
\usepackage{filecontents}

\begin{filecontents}{jobname.bib}
@book{ref1,
title = {Book's title},
author = {Author, Some},
location = {The City},
publisher = {Publisher},
date = {2005},
}
@book{ref2,
title = {Book's title},
author = {A. U. Thor},
location = {The City},
publisher = {Publisher},
date = {2005},
}
\end{filecontents}

\usepackage[style=ieee,backend=bibtex]{biblatex}
\bibliography{jobname}

\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit\cite{ref1}, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat\cite{ref2}. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui\cite{ref1} officia deserunt mollit anim id est laborum.
\printbibliography
\end{document}

答え1

BibLateXの使用

\AtEveryCiteKeyアンカーを挿入し、各引用コマンドでバックリファレンスを保存するために使用できます。その後、BibLateX の書式設定機能を使用して、参考文献のエントリのどこかにバックリファレンスのリストを追加できます。

\documentclass{article}
\usepackage{filecontents}

\begin{filecontents}{jobname.bib}
@book{ref1,
title = {Book's title},
author = {Author, Some},
location = {The City},
publisher = {Publisher},
date = {2005},
}
@book{ref2,
title = {Book's title},
author = {A. U. Thor},
location = {The City},
publisher = {Publisher},
date = {2005},
}
\end{filecontents}

\usepackage[style=ieee,backend=bibtex]{biblatex}
\bibliography{jobname}

\usepackage[colorlinks]{hyperref} % If needed

\makeatletter
\newcounter{backref@bref}
\AtEveryCitekey{% Appends a target for hyperlink, and setups backref
    \stepcounter{backref@bref}%
        \ifhyperref{%
            \Hy@raisedlink{\hypertarget{bref.\thebackref@bref}{}}%
        }{}%
        \listcsxadd{bref@\abx@field@entrykey}{bref.\thebackref@bref}%
}
\AfterEndPreamble{% Needs to wait until hyperref is loaded
\DeclareFieldFormat{labelnumberwidth}{%
    \printtext[brackets]{#1% Label number
    \setcounter{backref@bref}{0}%
    \renewcommand*{\do}[1]{
        \stepcounter{backref@bref}%
        \ifhyperref{\hyperlink{##1}{\alph{backref@bref}}}%
        {\alph{backref@bref}}%
    }%
    \dolistcsloop{bref@\abx@field@entrykey}% List of back refs
    }%
}}
\makeatother

\begin{document}
Lorem ipsum sit amet, consectetur adipiscing elit\cite{ref1}, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat\cite{ref2}. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui\cite{ref1} officia deserunt mollit anim id est laborum.
\printbibliography
\end{document}

レンダリング

BibTeXとhyperref/の使用backref

hyperrefオプション付きのパッケージを使用してこれを行う方法は次のとおりです。カウンターを増分することでbackref、バック参照を単純に出力します。a,b,...

\makeatletter
\newcounter{backref@bref} %Define new counter
\long\def\hyper@letters@backref#1#2#3{ %Defines new backref printer
    \stepcounter{backref@bref}%
    \hyperlink{#3}{\alph{backref@bref}}% Shows backref@bref as a letter
}
\let\backrefxxx\hyper@letters@backref %Selects printer
\renewcommand{\backref}[1]{%
    \setcounter{backref@bref}{0} %Reset the counter at each ref
    [#1\ ]%
}
\makeatother

Wikipedia のように、参照ラベル内に backref を配置するには、 にフックする必要があると思います\bibitem

また、このパッケージは、番号付けbackrefよりも優れた、バックリファレンスのセクション番号またはページ番号を印刷するように設計されていることに注意してください。a,b..特に文書を印刷する予定がある場合。

関連情報