
我想在我的LaTeX 程式碼中包含某種形式的指示,表明某些單字是關鍵字,或者一個短語是一個引用,或者另一個短語是一個範例,等等。指示列表?
答案1
儘管 LaTeX 首次將語意與版式分開,但像這樣的內建語意巨集並不多。有時您會在序言中定義自己的命令,例如
\newcommand\movie[1]{\textit{#1}}
用於以斜體書寫電影標題(特別是當您稍後可能會改變如何渲染此類元素的想法時)。或者您使用套件來處理特殊類型的元素。
也許您所說的關鍵字類型(在引入時以特殊方式表示)是像這樣的包的工作glossaries
。也許你所說的例子就像語言學中的編號例子?有幾個包可以執行這些操作。我認為您不會找到該列表,最好詢問特定需求。
答案2
使用\begin{quote}
和\end{quote}
進行報價。
對於關鍵字,請使用index
套件。用於^[aut]{yourkeyword}
識別關鍵字。將範例的序言新增到您的文件中:
\documentclass{article}
\usepackage{index}
\newindex{aut}{adx}{and}{Name Index}
\newindex{not}{ndx}{nnd}{List of Notation}
\shortindexingon
\proofmodetrue
\def\aindex{\index*[aut]}
\begin{document}
Lorem ^[aut]{ipsum} dolor sit amet, consectetur adipiscing elit.
^[aut]{consectetur} adipiscing elit. Aliquam vitae orci ante. Maecenas ^[aut]{viverra}.
interdum molestie dapibus tincidunt, dignissim sit amet risus. ^[aut]{Quisque}.
\end{document}
這列印:
關鍵字將出現在右側空白處。