
ジャーナリズム系の記事で使用されているすべてのインライン引用を、出典とともに最後にリストする必要があるユースケースがあります。次のようになります。
例の開始 テキスト テキスト テキスト 「これは引用文です」と person1 は言いました。 テキスト テキスト テキスト 「そしてこれは別の引用文です」と person2 は言います。...
引用リスト:
「これは引用です」人物1、役職、組織
「そしてこれは別の」人2、役職、組織
例終了
私は Latex の初心者で、最適なアプローチがよくわかりません。オンラインで見つけた例に基づいて、tocloft を csquote コマンドの 1 つ (\textquote) で動作させようとしましたが、すぐに失敗してしまいました。これは実行可能なアプローチでしょうか、それとももっと健全な他の推奨アプローチがあるでしょうか?
前もって感謝します
答え1
この問題には、引用と同様のスタイルでアプローチしたほうがよいと思います。まず、引用のセットを定義し (ファイル内の引用のセットを定義するのと同じように.bib
)、次にドキュメント内で必要なものを使用します。
以下は、glossaries
パッケージ。引用符は、この例が提供するカスタム\newquote
コマンドを使用して定義されます。例をシンプルにするために、引用符をプリアンブルに配置しましたが、引用符の数が多い場合は、別の.tex
ファイル ( などquotes.tex
) に配置し、 を使用してそのファイルを読み込む方が簡単です\loadglsentries{quotes}
。
\documentclass{article}
\usepackage{csquotes}
\usepackage{glossaries}
\makenoidxglossaries
% \newquote[options]{label}{name}{quote}{title}{organisation}
\newcommand*{\newquote}[6][]{%
\newglossaryentry{#2}{name={#3},description={#4},%
user1={#5},user2={#6},#1}%
}
% \usequote{label}{said}
\newcommand*{\usequote}[2]{\enquote{\glsdesc{#1},} #2 \glstext{#1}}
% Convert the first letter of the quote to upper case:
\newcommand*{\Usequote}[2]{\enquote{\Glsdesc{#1},} #2 \glstext{#1}}
\newglossarystyle{quotes}{%
\setglossarystyle{index}%
\renewcommand*{\glossentry}[2]{%
\item\glsentryitem{##1}\glstarget{##1}{\enquote{\Glossentrydesc{##1}}}
\glossentryname{##1}, \glsentryuseri{##1}, \glsentryuserii{##1}%
}%
}
\newcommand*{\printquotes}[1][]{%
\printnoidxglossary[sort=use,nogroupskip,style=quotes,%
title={List of Quotes},#1]%
}
\newquote{smith1}{John Smith}{this is a quote}{President}{Smith \& co}
\newquote{doe1}{Jane Doe}{and this is another}{Galactic Ruler}{The Empire}
\newquote{smith2}{John Smith}{we retract our earlier statement}{President}{Smith \& co}
\begin{document}
Text text text \usequote{smith1}{said}.
Text text text \usequote{doe1}{according to}.
\Usequote{smith2}{said}.
\printquotes
\end{document}
目次や相互参照などと同様に、文書が最新であることを確認するには、これを 2 回実行する必要があります。引用は文書内での使用順にリストする必要があると想定しています。簡潔にするために\enquote
ではなくを使用しました\textquote
が、必要に応じて変更することができます。
結果のドキュメントは次のようになります。