Me gustaría descartar el author
campo de una entrada biblatex en un \cite
comando específico (como si no tuviera ningún autor), pero aún así aparece en la biliografía.
Necesito esto porque las figuras son mis trabajos originales y repetir mi nombre en las citas mismas es incómodo. Así que básicamente:
\begin{figure}[!hbt]
\centering
\includegraphics[width=300px]{image.jpg}
\caption{\cite[]{the-biblatex-entry}} % *shouldn't* produce my name, only title, date, etc...
\end{figure}
\printbibliography % *should* produce my name, along with title, date, etc...
Estoy de acuerdo con usar algún otro comando que no sea \cite
. Realmente me gustaría tener un \citenoauthor
comando si supiera cómo hacerlo.
EDITAR: aquí hay un MWE
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{example.bib}
@book{somebook,
title = {Book's title},
author = {Author, Some},
location = {The City},
publisher = {Publisher},
date = {2005},
}
\end{filecontents}
\usepackage[style=verbose,backend=bibtex]{biblatex} %backend tells biblatex what you will be using to process the bibliography file
\bibliography{example}
\begin{document}
\cite{somebook} % I'd like this to not include the author, only the other fields
\printbibliography % All the fields, please
\end{document}
Respuesta1
El \caption
problema se puede solucionar con un uso sensato de \protect
o puede definir su propio comando "robusto" con etoolbox
's \newrobustcmd
( biblatex
requiere y carga etoolbox
de forma predeterminada). Eso es:
\caption{%
\AtNextCitekey{\protect\clearname{author}}%
\cite{somebook}}
o:
\newrobustcmd{\hlcite}[1]{%
\AtNextCitekey{\clearname{author}}%
\cite{#1}}
Ejemplo completo:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{example.bib}
@book{somebook,
title = {Book's title},
author = {Author, Some},
location = {The City},
publisher = {Publisher},
date = {2005},
}
\end{filecontents}
\usepackage[style=verbose,backend=bibtex]{biblatex}
%\bibliography{example}% <-- deprecated
\addbibresource{example.bib}
\usepackage{caption}
\newrobustcmd{\hlcite}[1]{%
\AtNextCitekey{\clearname{author}}%
\cite{#1}}
\begin{document}
\begin{figure}
\rule{3cm}{3cm}
\caption{%
\AtNextCitekey{\protect\clearname{author}}%
\cite{somebook}}
\end{figure}
\begin{figure}
\rule{3cm}{3cm}
\caption{\hlcite{somebook}}
\end{figure}
\printbibliography
\end{document}