4

For my work i need a custom cite command, which creates a footnote with a custom style. For that i use the \DeclareCiteCommand command:

\DeclareCiteCommand{\xfootcite}[\mkbibfootnote][\unspace]
 {\usebibmacro{citeindex}
\setunit{\labelnamepunct}
\printtext{Vgl}
\printnames{author}
\printfield{prenote}
\printfield{year}
{\usebibmacro{postnote}}
}

The footnote itself works, however there is a [ at the beginning of the footnote, which looks like this:

enter image description here

The [ appears when i use [\unspace], however if i remove it, there is an empty row with only a dot in it between the footnotes:

enter image description here

Is there a way to have the footnote without the [ and no empty rows? I'm not working with LaTeX for a long time, so i could not figure it out myself and didn't find any questions like that

3
  • Welcome to TeX - LaTeX! Mar 9, 2020 at 8:42
  • Try wrapping the \unspace within {} instead of [] (cf. page 176 of the BibLaTeX manual for version 3.14). Please provide a minimal working example, so that suggestions like this can be easily tested.
    – frougon
    Mar 9, 2020 at 9:04
  • using {} instead of [] result in the empty rows with dots like in the Question
    – BastianLo
    Mar 9, 2020 at 9:11

1 Answer 1

5

Perhaps you are looking for something like the following

Sample output

\documentclass{article}

\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}

\DeclareCiteCommand{\xfootcite}[\mkbibfootnote]{%
\usebibmacro{citeindex}%
\iffieldundef{prenote}{\printtext{Vgl}\adddot\addspace}%
{\printfield{prenote}\setunit{\prenotedelim}}}%
{\printnames{author}\addspace
\printfield{year}}%
{\multicitedelim}%
{\usebibmacro{postnote}}

\begin{document}

\xfootcite{westfahl:space}

\xfootcite{angenendt,westfahl:space}

\xfootcite[See][]{westfahl:space}

\end{document}

\DeclareCiteCommand takes five mandatory arguments and only one optional one. Your syntax with [\unspace] looks like a second optional argument, but was being read as the first three mandatory arguments [, \unspace and ]. The spaces in your output were being added by end of line characters, which you need to comment out with % at appropriate places.

I have tried to guess how you might want to use the prenote.

3
  • It works thank you so much :) i was really frustrated because it didn't work for me. but your solution works exactly how i wanted it to be.
    – BastianLo
    Mar 9, 2020 at 10:11
  • I can vote you :-)..It is very ugly that a nice answer have a 0 score.
    – Sebastiano
    Mar 9, 2020 at 11:07
  • now i can vote too. i just didn't have enough rep to upvote until now
    – BastianLo
    Mar 9, 2020 at 11:57

You must log in to answer this question.

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