
Quero escrever algum texto entre o título e o conteúdo do índice. (também entre título e conteúdo da bibliografia).
Tentei redefinir o título com o texto, mas espero que haja uma solução melhor, porque isso é muito feio.
Obrigado.
Responder1
Dada a natureza diferente de bibliography
e index
dividi minha resposta em duas partes:
Texto entre o título e o conteúdo da bibliografia.
Esta solução é baseada emcorreçãoo thebibliography
meio ambiente (usando o pacoteetoolbox
e seu comando \patchcmd
) para adicionar Some text
antes do conteúdo.
Eu crio um comando \bibpreface{Text before bibliography}
para isso.
Aqui está um exemplo de código (incluindo o .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}
Parte do resultado (cortado)
Esta abordagem também funciona article
ereport
Aulas.
EDITAR
Se você escrever sua bibliografiamanualmenteentão só com isso
\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}
você obterá o resultado desejado.
Texto entre o título e o conteúdo do índice.
Usando a mesma ideia que defino o comando \indexpreamble{Text}
, este escreve seutextoem toda a página (lembre-se que index
está escrito em twocolumn
)
Você só precisa adicionar este códigoantesda \makeindex
instrução nopreâmbulo do documento
\usepackage{etoolbox} %If it doesn't loaded
\newlength{\oldparindent}
\setlength{\oldparindent}{\parindent}
\newcommand{\indexpreamble}[1]{\patchcmd{\theindex}{]}{\setlength{\parindent}{\oldparindent}%
\noindent#1\par\indexspace]}{}{}}
e use \indexpreamble{...}
logo antes de \printindex
(ou \begin{theindex}
).
Responder2
Por que não usar biblatex
? É rico em recursos e não é tão complicado. Sei que este não é o pacote escolhido, mas aqui vai uma sugestão:
O prenote
-field é feito para atender apenas ao seu propósito (se bem entendi):
\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}
Me dá:
Com \printbibliography[prenote={bib-intro}]
você defina qual pré-nota deseja usar e com \defbibnote{bib-intro}{<text>}
você defina o texto que deseja acrescentar. Veja a página 73 dodocumentação biblatex.
Observe que usei o artigo documentclass em vez do livro apenas para fins ilustrativos (é mais fácil capturar o clipe de tela com tudo em uma página).
Não tenho certeza de como você deseja usar o índice e qual pacote, mas eu recomendaria o imakeidx
.
Ao incluir
\usepackage{imakeidx}
\makeindex
Como preâmbulo e [indexing = true]
como opção do biblatex, seus dados bibliográficos são indexados. Eu adicionei esta configuração ao meu exemplo acima e isso me dá este índice: