Я хотел бы удалить author
поле записи библатекса в определенной \cite
команде (как будто у нее вообще нет автора), но при этом оставить ее в библиографии.
Мне это нужно, потому что рисунки — мои оригинальные работы, а повторять мое имя в самих цитатах неловко. Так что в основном:
\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...
Я согласен использовать любую другую команду, кроме \cite
. Я бы очень хотел иметь \citenoauthor
команду, если бы только знал, как ее написать.
EDIT: вот 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}
решение1
Проблему \caption
можно решить с помощью разумного использования \protect
или вы можете определить свою собственную «надежную» команду с помощью etoolbox
's \newrobustcmd
( biblatex
require и loads etoolbox
по умолчанию). То есть:
\caption{%
\AtNextCitekey{\protect\clearname{author}}%
\cite{somebook}}
или:
\newrobustcmd{\hlcite}[1]{%
\AtNextCitekey{\clearname{author}}%
\cite{#1}}
Полный пример:
\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}