TransWikia.com

Remove space from footcite before [prenote]

TeX - LaTeX Asked by user225861 on January 7, 2021

I am using this LATEX Template from GitHub and a have a small problem:
https://github.com/andygrunwald/FOM-LaTeX-Template

If I don’t have an [prenote] entry for a footnote quote, a space is inserted in the footnote. I would like to remove this space. Unfortunately I do not know how?

Here my latex code:

% Optionen für Biblatex
ExecuteBibliographyOptions{%
giveninits=false,
isbn=true,
url=true,
doi=false,
eprint=false,
maxbibnames=7, % Alle Autoren (kein et al.)
maxcitenames=2, % et al. ab dem 3. Autor
backref=false, % Rückverweise auf Zitatseiten
bibencoding=utf8, % wenn .bib in utf8, sonst ascii
bibwarn=true, % Warnung bei fehlerhafter bib-Datei
firstinits=true,
skipbib=false
}%

% et al. an Stelle von u.a.
DefineBibliographyStrings{ngerman}{
   andothers = {{et,aladddot}},
}

% Klammern um das Jahr in der Fußnote
renewbibmacro*{cite:labelyear+extrayear}{% 
  iffieldundef{labelyear} 
    {} 
    {printtext[bibhyperref]{% 
       mkbibparens{% 
         printfield{labelyear}% 
         printfield{extrayear}}}}}

DeclareNameFormat{last-first}{%
  iffirstinits
    {usebibmacro{name:family-given}
        {namepartfamily}
        {namepartgiveni}
        {namepartprefix}
        {namepartsuffix}
    }
    {usebibmacro{name:family-given}
        {namepartfamily}
        {namepartgiven}
        {namepartprefix}
        {namepartsuffix}
    }%
  usebibmacro{name:andothers}}

% Alternative Notation der Fußnoten
% Zeigt sowohl den Nachnamen als auch den Vornamen an
% Beispiel: fullfootcite[Vgl. ][Seite 5]{Tanenbaum.2003}
DeclareCiteCommand{fullfootcite}[mkbibfootnote]
  {usebibmacro{prenote}}
  {usebibmacro{citeindex}%
    printnames[sortname][1-1]{author}%
    addspace (printfield{year})}
  {addsemicolonspace}
  {usebibmacro{postnote}}
  
% TEST
DeclareCiteCommand{footcite}[mkbibfootnote]
  {usebibmacro{prenote}}
  {usebibmacro{citeindex}%
    printnames[sortname][1-1]{author}%
    addspace (printfield{year})}
  {addsemicolonspace}
  {usebibmacro{postnote}}

%Autoren (Nachname, Vorname)
DeclareNameAlias{default}{family-given}
DeclareNameAlias{sortname}{last-first}

%Reihenfolge von publisher, year, address verändern
% Achtung, bisher nur für den Typ @book definiert

%% Definiert @Book Eintrag
DeclareBibliographyDriver{book}{%
  printnames{author}%
  %space
  (printfield{year})%
  setunit*{:space}%  
  printfield{title}%
  setunit*{,space}%
  printfield{edition}%
  setunit*{,space}%
  printlist{location}%
  setunit*{space}%
  printlist{publisher}%
  setunit*{space}%
  printfield{year}%
%  setunit*{,space}% 
%  printfield{isbn}%
  finentry}

%% Definiert @Online Eintrag
DeclareBibliographyDriver{online}{%
  printnames{author}%
  setunit*{(}%
  printfield{year}%
  setunit*{):space}%
  printfield{title}%
  setunit*{space}%
  printfield{url}%
  setunit*{,space Aufruf am:space}%
  printfield{urlday}%
  setunit*{.}%
  printfield{urlmonth}%
  setunit*{.}%
  printfield{urlyear}%
  finentry}
  
%% Definiert @misc Eintrag --> Literaturverwaltung mit Citavi
DeclareBibliographyDriver{misc}{%
  printnames{author}%
  setunit*{space(}%
 printfield{year}%
  setunit*{):space}%
  printfield{title}%
  setunit*{space}%
  printfield{url}%
  setunit*{,space Aufruf am:space}%
  printfield{urlday}%
  setunit*{.}%
  printfield{urlmonth}%
  setunit*{.}%
  printfield{urlyear}%
  finentry}

%% Definiert @Article Eintrag
DeclareBibliographyDriver{article}{%
  printnames{author}%
  setunit*{space (}%
  printfield{year}%  
  setunit*{):space}%
  printfield{title}%
  setunit*{space in:space}%
  usebibmacro{journal}%
  setunit*{,space}%
  printfield{year}%
  setunit*{,space}%
  printfield{volume}%
  setunit*{. Jg ,space Nr. }%
  printfield{number}%
  setunit*{,space}%
  printfield{pages}%  
  finentry}  

%% Definiert @InProceedings Eintrag
DeclareBibliographyDriver{inproceedings}{%
    printnames{author}%
    setunit*{,space (}%
    printfield{year}newunit{)}%
    newunitnewblockpunct
    printfield{title}%
    setunit*{space}%  
    usebibmacro{booktitle}%
    setunit*{,space}%
    printfield{isbn}%
    setunit*{,space}% 
    printfield{doi}%
    finentry}
    
%% Definiert Gesetzestext
DeclareBibliographyDriver{gesetz}{%
  printnames{author}%
  setunit*{space(}%
 printfield{year}%
  setunit*{):space}%
  printfield{title}%
  setunit*{space}%
  printfield{url}%
  setunit*{,space Aufruf am:space}%
  printfield{urlday}%
  setunit*{.}%
  printfield{urlmonth}%
  setunit*{.}%
  printfield{urlyear}%
  finentry}

%Doppelpunkt nach dem letzten Autor
renewcommand*{labelnamepunct}{addcolonaddspace }

%Komma an Stelle des Punktes
renewcommand*{newunitpunct}{addcommaspace}

%Autoren durch Semikolon trennen
newcommand*{bibmultinamedelim}{addsemicolonspace}%
newcommand*{bibfinalnamedelim}{addsemicolonspace}%
AtBeginBibliography{%
  letmultinamedelimbibmultinamedelim
  letfinalnamedelimbibfinalnamedelim
}

%Titel nicht kursiv anzeigen
DeclareFieldFormat{title}{#1isdot}

Here is an example quote:

~footcite[Vgl. ][S. 1-9]{Nakamoto.2009}
~footcite[][S. 1-9]{Nakamoto.2009}

Result:

enter image description here

Any idea? Thank you very much.

One Answer

There are two sources of spurious spaces in your example.

  1. The definition DeclareNameFormat{last-first} creates a spurious space. But the definition is basically the same as in biblatex.def, so you can just remove the whole block

    DeclareNameFormat{last-first}{%
      iffirstinits
        {usebibmacro{name:family-given}
            {namepartfamily}
            {namepartgiveni}
            {namepartprefix}
            {namepartsuffix}
        }
        {usebibmacro{name:family-given}
            {namepartfamily}
            {namepartgiven}
            {namepartprefix}
            {namepartsuffix}
        }%
      usebibmacro{name:andothers}}
    
  2. There is a space after Vgl. in footcite[Vgl. ][S. 1-9]{Nakamoto.2009}. It should just read

     footcite[Vgl.][1-9]{Nakamoto.2009}
    

    (You also don't need the explicit S.. A page prefix will be added automatically depending on the currently selected language.)

Correct answer by moewe on January 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP