
Eu gostaria de compor um catálogo de todas as minhas entradas do BibTeX.
Eu tenho usado
&
em muitosbibkey
comoAuthor&Editor:2000
.Mas não posso
\catcode38=12
globalmente.
Minha pergunta é: como posso escrever isso bibkey
tanto no título de uma seção quanto no índice, e também citá-lo?
Isto é o que eu quero alcançar:
Com:
\newcommand\entry[1]{%
\catcode38=12\relax
\section{#1}
\fullcite{#1}}
\entry{Author&Editor:2000}
Mas eu entendo:
! Misplaced alignment tab character &.
Por exemplo:
\documentclass{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{foo.bib}
\usepackage{filecontents}
\begin{filecontents}{foo.bib}
@book{Author&Editor:2000, author={Author}, editor={Editor}, title={Title 0}, year={2000}}
@book{Author&Editor:2001, author={Author}, editor={Editor}, title={Title 1}, year={2001}}
@book{Author&Editor:2002, author={Author}, editor={Editor}, title={Title 2}, year={2002}}
\end{filecontents}
\newcommand\entry[1]{%
\catcode38=12\relax
\section{#1}
\fullcite{#1}}
\begin{document}
\tableofcontents
\entry{Author&Editor:2000}
\entry{Author&Editor:2001}
\entry{Author&Editor:2002}
\end{document}
Responder1
Não há necessidade de alterar os códigos de categoria; só precisamos de uma versão robusta do \detokenize
.
\documentclass{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{foo.bib}
\usepackage{filecontents}
\begin{filecontents}{foo.bib}
@book{Author&Editor:2000, author={Author}, editor={Editor}, title={Title 0}, year={2000}}
@book{Author&Editor:2001, author={Author}, editor={Editor}, title={Title 1}, year={2001}}
@book{Author&Editor:2002, author={Author}, editor={Editor}, title={Title 2}, year={2002}}
\end{filecontents}
\newcommand\entry[1]{%
\section{\keep{#1}}%
\fullcite{#1}}
%%% \newrobustcmd is from etoolbox, loaded by biblatex
\newrobustcmd{\keep}[1]{\detokenize{#1}}
\begin{document}
\tableofcontents
\entry{Author&Editor:2000}
\entry{Author&Editor:2001}
\entry{Author&Editor:2002}
\end{document}
Observe que você deve adicionar a extensão em\addbibresource{foo.bib}
Responder2
Alterar os códigos de gato no meio do documento é uma péssima ideia, pois quebrará as coisas, mas se você for fazer isso, precisará acertar o momento.
\documentclass{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{foo}
\usepackage{filecontents}
\begin{filecontents}{foo.bib}
@book{Author&Editor:2000, author={Author}, editor={Editor}, title={Title 0}, year={2000}}
@book{Author&Editor:2001, author={Author}, editor={Editor}, title={Title 1}, year={2001}}
@book{Author&Editor:2002, author={Author}, editor={Editor}, title={Title 2}, year={2002}}
\end{filecontents}
\newcommand\entry{\bgroup\catcode`\&=12 \xentry}
\newcommand\xentry[1]{\egroup
\section{#1}%
\fullcite{#1}}
\begin{document}
{\catcode`\&=12 \tableofcontents}
\entry{Author&Editor:2000}
\entry{Author&Editor:2001}
\entry{Author&Editor:2002}
\end{document}
Responder3
como posso digitar tal bibkey
Tenho certeza que você não pode fazer isso, pois &
sempre será interpretado como Caractere de Alinhamentoantesvocê pode mudar isso.
Mas você pode usar \&
. Veja também seu exemplo corrigido (e agora funcionando):
\documentclass{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{foo}
\usepackage{filecontents}
\begin{filecontents}{foo.bib}
@book{Author\&Editor:2000, author={Author}, editor={Editor}, title={Title 0}, year={2000}}
@book{Author\&Editor:2001, author={Author}, editor={Editor}, title={Title 1}, year={2001}}
@book{Author\&Editor:2002, author={Author}, editor={Editor}, title={Title 2}, year={2002}}
\end{filecontents}
\newcommand\entry[1]{%
\catcode38=12\relax
\section{#1}
\fullcite{#1}}
\begin{document}
\tableofcontents
\entry{Author\&Editor:2000}
\entry{Author\&Editor:2001}
\entry{Author\&Editor:2002}
\end{document}
Atenciosamente, Nick