1

I am working with the philosophy-verbose style and modifying it quite successfully to accomplish my humanitarian needs. One thing that I can't achieve is to change the position of the postnote in the footnote reference. It is last in the reference now:

CTAN. The Comprehensive TeX Archive Network, 2006, http://www.ctan.org (visited on 10/01/2006), p. 22.

I need it to be before URL, DOI and other links in all types of references (articles, online, books etc.):

CTAN. The Comprehensive TeX Archive Network, 2006, p. 22, http://www.ctan.org (visited on 10/01/2006).

How can this be done?

I even commented out all lines of the @article driver in philosophy-verbose.bbx, but the postnote is still there in the output. So I can't insert the postnote where I want because it appears two times in the footnote. Maybe I should modify .cbx file? Modifications of .bbx files are more or less understandable for me, but .cbx ones are mystery.

MWE

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[english]{babel}
\usepackage[style=philosophy-verbose,backref=true]{biblatex}
\usepackage[colorlinks]{hyperref}
\usepackage{xpatch}

\addbibresource{biblatex-examples.bib}

\begin{document}
\null\vfill\noindent
Filler text.\footcite[22]{ctan}
\printbibliography
\end{document}
2
  • Do you also want the page number before the ISBN? Do you want it before or after the pagetotal field? – moewe Mar 7 '20 at 16:54
  • I removed both fields from the output, but they can be useful in some situations, so let's say page number before ISBN but after pagetotal. – Maras Mar 7 '20 at 18:15
1

You can use \global\clearfield{postnote} to get rid of the postnote for good once you have printed it.

First we define a bibmacro bib:postnote that prints the postnote and gets rid of it immediately afterwards, so it is not printed twice.

The second, longer part of the code below then just adds the new bib:postnote macro to all bibdrivers/bibmacros involved. I used xpatch for that and tried to cut some corners by using loops, but if you are already extensively modifiyng the bibliography drivers, you could manually add \usebibmacro{bib:postnote} in the right place.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[english]{babel}
\usepackage[style=philosophy-verbose, backref=true]{biblatex}
\usepackage[colorlinks]{hyperref}

% only print the postnote if
% * we are in a citation (clear; this is needed because we will modify the bibdrivers)
% * we are at the last citation (that's where the postnote belongs)
% * the postnote field is a page range (if you don't like that, remove the
%   'and test {\iffieldpages{postnote}}').
\newbibmacro*{bib:postnote}{%
  \ifboolexpr{
        test {\ifcitation}
    and test {\ifnumequal{\value{citecount}}{\value{citetotal}}}
    and test {\iffieldpages{postnote}}}
    {\usebibmacro{cite:postnote}%
     \global\clearfield{postnote}}
    {}}


% patch the bib drivers
% I'll use some helper macros, so will make @ a letter
\makeatletter
\newcommand*{\marasblx@errpatch@bibdriver}[1]{%
  \PackageError{mod-biblatex-philosophy}
    {Failed to patch bibdriver for '@#1'}
    {}}
\newcommand*{\marasblx@errpatch@bibmacro}[1]{%
  \PackageError{mod-biblatex-philosophy}
    {Failed to patch bibmacro '#1'}
    {}}

\usepackage{xpatch}
\xpatchbibdriver{article}
  {\usebibmacro{note+pages}}
  {\usebibmacro{note+pages}%
   \usebibmacro{bib:postnote}}
  {}{\errpatchbibdriver{article}}

\newcommand*{\marasblx@patch@bibdrivers@chapandpages}[1]{%
  \xpatchbibdriver{#1}
    {\usebibmacro{chapter+pages}}
    {\usebibmacro{chapter+pages}%
     \usebibmacro{bib:postnote}}
    {}{\marasblx@errpatch@bibdriver{#1}}}
\forcsvlist{\marasblx@patch@bibdrivers@chapandpages}{%
  book,booklet,collection,manual,proceedings,report,thesis,jurisdiction}

\newcommand*{\marasblx@patch@bibmacro@chapandpages}[1]{%
  \xpatchbibmacro{#1}
    {\usebibmacro{chapter+pages}}
    {\usebibmacro{chapter+pages}%
     \usebibmacro{bib:postnote}}
    {}{\marasblx@errpatch@bibmacro{#1}}}
\forcsvlist{\marasblx@patch@bibmacro@chapandpages}{%
  inbook:full,incollection:full,inproceedings:full}

\xpatchbibdriver{misc}
  {\usebibmacro{organization+location+date}}
  {\usebibmacro{organization+location+date}%
   \usebibmacro{bib:postnote}}
  {}{\marasblx@errpatch@bibdriver{misc}}

\newcommand*{\marasblx@patch@bibdrivers@date}[1]{%
  \xpatchbibdriver{#1}
    {\usebibmacro{date}}
    {\usebibmacro{date}%
     \usebibmacro{bib:postnote}}
    {}{\marasblx@errpatch@bibdriver{#1}}}
\forcsvlist{\marasblx@patch@bibdrivers@date}{%
  online,patent}

\xpatchbibdriver{periodical}
  {\printfield{note}}
  {\printfield{note}%
   \usebibmacro{bib:postnote}}
  {}{\marasblx@errpatch@bibdriver{periodical}}

\xpatchbibdriver{unpublished}
  {\usebibmacro{location+date}}
  {\usebibmacro{location+date}%
   \usebibmacro{bib:postnote}}
  {}{\marasblx@errpatch@bibdriver{unpublished}}
\makeatother

\addbibresource{biblatex-examples.bib}

\begin{document}
\null\vfill\noindent
Filler text.\footcite[22]{ctan}
Filler text.\footcite[380]{sigfridsson}
Filler text.\footcite[23]{ctan}
Filler text.\footcite[381]{sigfridsson}
Filler text.\footcite{pines}
\printbibliography
\end{document}

CTAN. The Comprehensive TeX Archive Network, 2006, p. 22, http://www.ctan.org (visited on 10/01/2006).

1
  • Wow, create such difficult code is not for my skills and knowledge. You are awesome, @moewe! Thank you very much! Your bibmacro is working perfectly. I inserted it in the bibliography drivers, because your patch code threw errors about not being able to patch the drivers – I modified style files too much, I think. – Maras Mar 8 '20 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.