
索引タイトルとコンテンツの間にテキストを書きたいです。(また、参考文献のタイトルとコンテンツの間にも)
タイトルをテキストで再定義しようとしましたが、これはあまりにも醜いので、もっと良い解決策があることを願っています。
ありがとう。
答え1
bibliography
との異なる性質を考慮して、index
私は回答を 2 つの部分に分けました。
書誌のタイトルと内容の間のテキスト。
このソリューションは、パッチ環境thebibliography
(パッケージを使用してetoolbox
およびそのコマンド\patchcmd
)を使用して、Some text
コンテンツの前に追加します。
そのためのコマンドを作成します\bibpreface{Text before bibliography}
。
ここにコードの例(.bib
usingを含むfilecontents
)
\documentclass{book}
%---------------------------------
% Database .bib file
\begin{filecontents}{mydatabib.bib}
@book{goossens93,
author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",
title = "The Latex Companion",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
@book{lamport94,
author = "Leslie Lamport",
title = "Latex: A Document Preparation System",
year = "1994",
edition = "Second",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
@misc{patashnik88,
author = "Oren Patashnik",
title = "{B}ib{T}e{X}ing. Documentation for General {B}ib{T}e{X} users",
year = "1988",
howpublished = "Electronic document accompanying BibTeX
distribution"
}
\end{filecontents}
%-----------------------------------------
\usepackage{etoolbox}
\newcommand{\bibpreface}[1]{\patchcmd{\thebibliography}{\list}{#1\list}{}{}}
\begin{document}
In \cite{goossens93} we can find information very useful about \LaTeX\ and in \cite{patashnik88} there is important information about \textsc{Bib}\TeX.
\nocite{*}
\bibpreface{Text before of bibliography, and some warnings to take in account when you read the books.}
\bibliographystyle{plain}
\bibliography{mydatabib}
\end{document}
結果の一部(切り取られています)
このアプローチはarticle
、report
クラス。
編集
参考文献を書く場合手動でこれだけあれば
\documentclass{book}
\usepackage{etoolbox}
\newcommand{\bibpreface}[1]{\patchcmd{\thebibliography}{\list}{#1\list}{}{}}
\begin{document}
In \cite{goossens93} we can find information very useful about \LaTeX\ and in \cite{patashnik88} there is important information about \textsc{Bib}\TeX.
\nocite{*}
\bibpreface{Text before of bibliography, and some warnings to take in account when you read the books.
This allows change of lines.}
\begin{thebibliography}{1}
\bibitem{goossens93}
Michel Goossens, Frank Mittlebach, and Alexander Samarin.
\newblock {\em The Latex Companion}.
\newblock Addison-Wesley, Reading, Massachusetts, 1993.
\bibitem{lamport94}
Leslie Lamport.
\newblock {\em Latex: A Document Preparation System}.
\newblock Addison-Wesley, Reading, Massachusetts, second edition, 1994.
\bibitem{patashnik88}
Oren Patashnik.
\newblock {B}ib{T}e{X}ing. documentation for general {B}ib{T}e{X} users.
\newblock Electronic document accompanying BibTeX distribution, 1988.
\end{thebibliography}
\end{document}
希望通りの結果が得られます。
インデックスのタイトルとコンテンツの間のテキスト。
同じアイデアを使用してコマンドを定義すると\indexpreamble{Text}
、これは彼の文章ページ全体にわたって(index
で書かれていることに注意してくださいtwocolumn
)
このコードを追加するだけで前に\makeindex
の指示の文書の前文
\usepackage{etoolbox} %If it doesn't loaded
\newlength{\oldparindent}
\setlength{\oldparindent}{\parindent}
\newcommand{\indexpreamble}[1]{\patchcmd{\theindex}{]}{\setlength{\parindent}{\oldparindent}%
\noindent#1\par\indexspace]}{}{}}
の\indexpreamble{...}
直前に使用します。\printindex
\begin{theindex}
答え2
をなぜ使用しないのですかbiblatex
? 機能が豊富で、それほど複雑ではありません。これはあなたが選択したパッケージではないことは承知していますが、ここに提案があります:
-フィールドprenote
は、まさにあなたの目的に合わせて作られています(私が正しく理解していれば)。
\documentclass{article}
\usepackage{filecontents}
% suggested bibliography package
\usepackage[indexing = true]{biblatex}
\addbibresource{mydatabib.bib}
\defbibnote{bib-intro}{This is where you put your bibliography prenote.}
% suggested index package
\usepackage{imakeidx}
\makeindex
\begin{filecontents}{mydatabib.bib}
@book{goossens93,
author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",
title = "The Latex Companion",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
@misc{patashnik88,
author = "Oren Patashnik",
title = "{B}ib{T}e{X}ing. Documentation for General {B}ib{T}e{X} users",
year = "1988",
howpublished = "Electronic document accompanying BibTeX
distribution"
}
\end{filecontents}
\begin{document}
In \cite{goossens93} we can find information very useful about \LaTeX\ and in \cite{patashnik88} there is important information about \textsc{Bib}\TeX.
% Printing the bibliography
\printbibliography[prenote={bib-intro}]
% Printing the index with a prenote
\indexprologue{%
Index prenote goes here. Lets make it a bit longer just for illustrating the presentation of it.
}
\printindex
\end{document}
以下が得られます:
で\printbibliography[prenote={bib-intro}]
どのプレノートを使用するか定義し、 で\defbibnote{bib-intro}{<text>}
先頭に追加するテキストを定義します。biblatex ドキュメント。
説明のためだけに book ではなく article ドキュメントクラスを使用していることに注意してください (すべてを 1 ページに収めたスクリーン クリップを取得する方が簡単です)。
インデックスをどのように使用したいか、またどのパッケージを使用するかはよくわかりませんが、 をお勧めしますimakeidx
。
含めることで
\usepackage{imakeidx}
\makeindex
あなたの前文と[indexing = true]
biblatex オプションとして、あなたの書誌データがインデックス化されます。私はこの設定を上記の例に追加し、次のインデックスを作成しました: