列出報價單

列出報價單

我有一個用例,我需要在末尾列出新聞類型文章中使用的所有內聯引用以及歸屬。就像是:

開始範例 文字文字文字「這是一個引用,」person1 說。根據 person2 的說法,文本文本文本“這是另一個”。 …

報價清單:

「這是一條引言」 人員 1、職務、組織

「這是另一個」Person2、頭銜、組織

範例結束

我對 Latex 很陌生,不清楚最好的方法。根據我在網路上找到的範例,我在嘗試讓 tocloft 使用 csquote 命令 (\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}

與目錄、交叉引用等一樣,這需要兩次運行才能確保文件是最新的。我假設您希望根據文件中的使用順序列出引號。為了簡單起見,我使用了\enquote而不是\textquote,但您可以根據需要調整它。

產生的文檔如下所示:

文件影像

相關內容