0

I have a problem. I would like to have an indirect quote with a prefix flag. Is it possible to design a new \cite command that outputs the source as follows [vgl. 1]. As you can see, the vgl. is added. This is what I always want when I write \citewp for example. Is there such a possibility?

What I have


Let's cite! The Einstein's journal paper [1] (~\cite) are physics related items. 

What I want

Let's cite! The Einstein's journal paper [vgl. 1] (~\citewp) are physics related items.
\documentclass{article}
\usepackage[utf8]{inputenc}
\RequirePackage{filecontents}
\begin{filecontents*}{\bibliography.bib}
@article{einstein,
  author  = {Albert Einstein},
  title   = {{Zur Elektrodynamik bewegter Körper}. ({German}) 
             [{On} the electrodynamics of moving bodies]},
  journal = {Annalen der Physik},
  volume  = {322},
  number  = {10},
  pages   = {891--921},
  year    = {1905},
  DOI     = {http://dx.doi.org/10.1002/andp.19053221004},
}
@online{ApoG,
  Address = {03.08.2013},
  Edition = {15.10.1980},
  Publisher = {juris GmbH},
  Title = {ApoG - Gesetz {\"u}ber das Apothekenwesen},
  Url = {www.juris.de/purl/gesetze/_ges/ApoG},
  Year = {1980},
}
\end{filecontents*}
\usepackage[ngerman]{babel}
\usepackage[%
backend=bibtex      % biber or bibtex
%,style=authoryear    % Alphabeticalsch
,style=numeric-comp  % numerical-compressed
,sorting=none        % no sorting
,sortcites=true      % some other example options ...
,block=none
,indexing=false
,citereset=none
,isbn=true
,url=true
,doi=true            % prints doi
,natbib=true         % if you need natbib functions
]{biblatex}
\DefineBibliographyStrings{ngerman}{%
    urlseen = {aufgerufen am}
}
\addbibresource{bibliography.bib}  % better than \bibliography

\begin{document}
Let's cite! The Einstein's journal paper ~\cite{einstein} are physics related items. 

\printbibliography[title=Literaturverzeichnis]

\end{document}
4
  • Not related to your question, but there is no reason to write paper ~\cite{einstein}. paper~\cite{einstein} is enough. (Though I'm normally lazy and just write paper \cite{einstein}, which might be problematic-ish for numeric citations, where line breaks before the citation would be undesirable, but probably not that bad for author-year citations, which are naturally longer.)
    – moewe
    May 13, 2022 at 7:08
  • You may also want to think about using Biber instead of BibTeX. biblatex's advanced features are only fully supported with Biber. BibTeX should only be used as a fallback solution if there is absolutely no way to get Biber running. Most people can easily switch to Biber with backend=biber, and a small modification of their compiler settings (tex.stackexchange.com/q/154751/35864).
    – moewe
    May 13, 2022 at 7:13
  • Also not related to your main issue, but DOI = {http://dx.doi.org/10.1002/andp.19053221004}, is wrong. The doi field should contain only the DOI and not the link-part (http://dx.doi.org/ or the newer https://doi.org). So this should be doi = {10.1002/andp.19053221004},.
    – moewe
    May 13, 2022 at 7:16
  • Most biblatex options you are setting are already the default with your style, so you could make your life a bit easier if you dropped, for example sortcites=true, block=none, indexing=false, citereset=none,.
    – moewe
    May 13, 2022 at 7:17

2 Answers 2

2

biblatex's cite commands have up to two optional arguments

\autocite{<keys>}
\autocite[<post>]{<keys>}
\autocite[<pre>][<post>]{<keys>}

If only one optional argument is given, it is interpreted as the <postnote> argument. If two optional arguments are given, the first is the <prenote>, the second the <postnote>.

You can give a <prenote> without a <postnote> if you leave the <postnote> empty

\autocite[<pre>][]{<keys>}
  • The <postnote> is normally displayed after the citation label and traditionally contains page ranges.
  • The <prenote> is displayed before the citation label and often contains specifiers like "cf."/"vgl.".

So can just go with

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[
  backend=bibtex,
  style=numeric-comp,
  sorting=none,
]{biblatex}


\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite[vgl.][]{sigfridsson}

Ipsum \autocite[vgl.][380]{sigfridsson}

\printbibliography[title=Literaturverzeichnis]
\end{document}

Lorem [vgl. 1]
Ipsum [vgl. 1, S. 380]

I would just stick to using the <prenote> argument, but if you insist on defining a new command, you can try the following, which will "inject" a <prenote> equal to "vgl." into your \cite.

You can then use \autocitewp without argument and will get "vgl.". You can still both a <prenote> argument (which will just override the "vgl.") and a normal <postnote>.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[
  backend=bibtex,
  style=numeric-comp,
  sorting=none,
]{biblatex}

\makeatletter
\newrobustcmd*{\autocitewp}{%
  \AtNextCite{\def\abx@field@prenote{vgl.}}%
  \autocite}
\makeatother

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocitewp{sigfridsson}

ipsum \autocitewp[380]{sigfridsson}

dolor \autocitewp[cf.][381]{sigfridsson}

\printbibliography[title=Literaturverzeichnis]
\end{document}

Lorem [vgl. 1]
ipsum [vgl. 1, S. 380]
dolor [cf. 1, S. 381]

1

You can define a new command like this: \newcommand{\citewp}[1]{\cite[vgl.][]{#1}}:

\documentclass{article}
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{einstein,
  author  = {Albert Einstein},
  title   = {{Zur Elektrodynamik bewegter Körper}. ({German}) 
             [{On} the electrodynamics of moving bodies]},
  journal = {Annalen der Physik},
  volume  = {322},
  number  = {10},
  pages   = {891--921},
  year    = {1905},
  DOI     = {http://dx.doi.org/10.1002/andp.19053221004},
}
@online{ApoG,
  Address = {03.08.2013},
  Edition = {15.10.1980},
  Publisher = {juris GmbH},
  Title = {ApoG - Gesetz {\"u}ber das Apothekenwesen},
  Url = {www.juris.de/purl/gesetze/_ges/ApoG},
  Year = {1980},
}
\end{filecontents*}
\usepackage[ngerman]{babel}
\usepackage[%
backend=bibtex      % biber or bibtex
%,style=authoryear    % Alphabeticalsch
,style=numeric-comp  % numerical-compressed
,sorting=none        % no sorting
,sortcites=true      % some other example options ...
,block=none
,indexing=false
,citereset=none
,isbn=true
,url=true
,doi=true            % prints doi
,natbib=true         % if you need natbib functions
]{biblatex}
\DefineBibliographyStrings{ngerman}{%
    urlseen = {aufgerufen am}
}
\addbibresource{\jobname.bib}  % better than \bibliography
\newcommand{\citewp}[1]{\cite[vgl.][]{#1}}

\begin{document}

Let's cite! The Einstein's journal paper ~\citewp{einstein} are physics related items.
\printbibliography[title=Literaturverzeichnis]

\end{document}

enter image description here

4
  • Thank you for your answer. I appreciate it very much. I have already found that you can write it with the square brackets, so ~\cite[vgl.][]. But isn't there a way to do it automatically, that I just write e.g. ~\citewp{einstein} and it adds the vgl. itself?
    – Test
    May 13, 2022 at 7:02
  • Sure, you can define a new command: \newcommand{\citewp}[1]{\cite[vgl.][]{#1}}
    – DG'
    May 13, 2022 at 7:07
  • With \newcommand{\citewp}[2][]{\cite[vgl.][#1]{#2}} we could define a \citewp that supports an optional <postnote> argument: \citewp[<pre>]{<key>}/\citewp{<key>}.
    – moewe
    May 13, 2022 at 7:36
  • @moewe – Even better :)
    – DG'
    May 13, 2022 at 7:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .