0

How can I use the tweaked version of biblatex-chicago (to conform with the style of the journal Isis) presented by @moewe here while using certain personal macros in the page field in \cite commands?

In particular, the journal Isis requires "p./pp." before page ranges. When citing page ranges, I often add line numbers, paragraph numbers, and note references. For example, if I am citing note 3 on page 42, I would write \cite[42 \note 3]{...}, with the following desired output (for a short book citation):

Author, Title, p. 42 n. 3

To complicate matters more, I sometimes refer to the page on which an endnote is printed (to save the reader some time), e.g., \cite[42 \note 3 printed on \pa 250]{...}:

Author, Title, p. 42 n. 3 printed on p. 250

The personal macros that I frequently use in the page field are:

\newcommand{\Line}[1]{\mbox{\textsubscript{#1}}}
\newcommand{\Lines}[2]{\mbox{\textsubscript{#1-#2}}}
\newcommand{\Linebot}[1]{\mbox{\textsubscript{⌂#1}}} % line number, counting from bottom
\newcommand{\Linesbot}[2]{\mbox{\textsubscript{⌂#1-⌂#2}}} % line range both counting from bottom
\newcommand{\Linestopbot}[2]{\mbox{\textsubscript{#1-⌂#2}}} % line range first from top, second from bottom
\newcommand\note{n.\unspace~}   % note
\newcommand\notes{nn.\@ }       % notes
\newcommand\para{¶}         % paragraph
\newcommand\paras{¶}%{¶¶}   % paragraphs
\newcommand\Para{¶}         % Paragraph
\newcommand\Paras{¶}%{¶¶}   % Paragraphs
\newcommand\pa{p.\unspace~}     % page
\newcommand\pp{pp.\@\xspace}    % pages

(See also the MWE below.)

The desired output I seek it to keep the prefixed "p./pp." even when those macros are used, but NOT when my page citation does not in fact include a page number, for example, when I cite a note without the page number \cite[\note 3]{...}:

Author, Title, n. 3

(or similarly when I cite a section [\S 4] or paragraph [\para 7] alone).

Is this possible? I have tried to fiddle with \PagesCheckSetup, \NumCheckSetup, and \DeclareNumChars, but clearly I don't understand exactly how they work.

MWE

\documentclass{article}

\usepackage{xspace}

\usepackage[notes]{biblatex-chicago}

% My macros
\xspaceaddexceptions{\ccc \Line \Lines \Linebot \Linesbot \Linestopbot}
\newcommand{\Line}[1]{\mbox{\textsubscript{#1}}}
\newcommand{\Lines}[2]{\mbox{\textsubscript{#1-#2}}}
\newcommand{\Linebot}[1]{\mbox{\textsubscript{⌂#1}}} % line number, counting from bottom
\newcommand{\Linesbot}[2]{\mbox{\textsubscript{⌂#1-⌂#2}}} % line range both counting from bottom
\newcommand{\Linestopbot}[2]{\mbox{\textsubscript{#1-⌂#2}}} % line range first from top, second from bottom
\newcommand\note{n.\unspace~}   % note
\newcommand\notes{nn.\@ }       % notes
\newcommand\para{¶}         % paragraph
\newcommand\paras{¶}%{¶¶}   % paragraphs
\newcommand\Para{¶}         % Paragraph
\newcommand\Paras{¶}%{¶¶}   % Paragraphs
\newcommand\pa{p.\unspace~}     % page
\newcommand\pp{pp.\@\xspace}    % pages

% moewe's earlier solution
\DeclareFieldFormat{jourvol}{\mkbibitalic{#1}}
\DeclareFieldFormat{journum}{\mkbibparens{#1}}%

\renewbibmacro*{cjournal+issue+year+pages}{%
  \ifentrytype{periodical}%
  {\usebibmacro{cperiodical+ser+vol+num}}%
  {\usebibmacro{cjournal+ser+vol+num}}}

\renewbibmacro*{cjournal+ser+vol+num}{%
  \usebibmacro{journal+sub}%
  \setunit*{\addspace}%
  \printlist[periodplace]{location}%
  \setunit*{\addspace}%
  \iffieldundef{series}%
    {}%
    {\newcunit%
      \printfield[jourser]{series}%
      \newcunit}%\setunit*{\addspace}?
  \newcunit
  \iffieldundef{issue}%
    {\usebibmacro{number+or+month}}%
    {\printfield{issue}%
     \setunit{\addspace}%
     \usebibmacro{cmsyear}}%
  \newcunit
  \printfield[jourvol]{volume}%
  \printfield[journum]{number}%
  \setunit{\postvolpunct}}% Moved eid for 17th ed.

\DefineBibliographyStrings{english}{
  thiscite = {on},
}

\AtEveryCitekey{\savefield{postnote}{\cbxsavepostnote}\clearfield{postnote}}

\DeclareFieldFormat{pages}{%
  \ifboolexpr{%
    togl {cms@comprange}%
    and
    test {\ifpages{#1}}%
  }%
  {\mkpageprefix[bookpagination][\mkcomprange]{#1}}%
  {\mkpageprefix[bookpagination][\mknormrange]{#1}}}
\DeclareFieldFormat[article,periodical]{pages}{%
  \ifboolexpr{%
    togl {cms@comprange}%
    and
    test {\ifpages{#1}}%
  }%
  {\mkcomprange{#1}}%
  {\mknormrange{#1}}}

\DeclareFieldFormat{postnote}{%
  \ifboolexpr{%
    togl {cms@comprange}%
    and
    test {\ifpages{#1}}%
  }%
  {\mkpageprefix[pagination][\mkcomprange]{#1}}%
  {\mkpageprefix[pagination][\mknormrange]{#1}}}

\renewbibmacro*{postnote}{%
  \restorefield{postnote}{\cbxsavepostnote}%
  \iffieldundef{postnote}
    {}
    {\setunit{\addcomma\space}%
     \iftoggle{cms@fullnote}
       {\iffieldundef{pages}
          {}
          {\iffieldpages{postnote}
             {\bibstring{thiscite}%
              \setunit{\addspace}}
             {}}}
       {}%
     \printfield{postnote}}}
     
% MY ADDITION IN AN ATTEMPT TO KEEP PAGE REFS
%\PagesCheckSetup{\def\Line{}\def\Lines{}\def\pa{}\def\pp{}}
%\NumCheckSetup{\def\Line{}\def\Lines{}\def\pa{}\def\pp{}}
%\DeclareNumChars{}     


\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{westfahl:space}.
\mancite

\cite[32]{westfahl:space}.
\mancite

\cite[32\Lines{3}{9}]{westfahl:space}.
\mancite

\cite[32 \note 3]{westfahl:space}.

\end{document}

Current output:

enter image description here

Desired output is for the last three lines to be:

Westfahl, “The True Frontier,” p. 32.
Westfahl, “The True Frontier,” p. 32_{3-9}.
Westfahl, “The True Frontier,” p. 32 n. 3.

Where _{...} stands for subscript.

7
  • Please forgive the fact that my example cites a page (p. 32) that does not exist in westfahl:space! Mar 25, 2021 at 12:13
  • 1
    why don't you simply input \cite[\pno~32 \note 3]{westfahl:space}.? Mar 25, 2021 at 12:24
  • 1
    If you don't use the \cites command on other occasions then you can solve with \cites(\note 3)[32]{westfahl:space} e \cites(\Lines{3}{9})[32]{westfahl:space}. You will need to modyfy \note and \multipostnotedelim: \newcommand\note{\addspace n. \ unspace~} \DeclareDelimFormat{multipostnotedelim}{}
    – Ivan
    Mar 25, 2021 at 14:33
  • @UlrikeFischer: I haven't been using \pno in my cite commands because usually I use a different citation style (Chicago style) that omits "p./pp." before most page references. But the journal Isis requires "p./pp.", so I was hoping to have them automatically added, even when I use \Lines or \note or my other personal macros. This would make it easier to switch between this style and Chicago (my hope is that it will also help others in the future in a similar situation). Mar 26, 2021 at 11:35
  • 2
    I think you are overdoing. While it is probably possible to extend the tests to cover all your various cases: you are spending hours to make the system more complicated and at the end you won't remember if this case is covered or not. It is like with xspace tex.stackexchange.com/a/86620/2388. I would simply define a command \isispno to be \pno~ and then you can either later redefine or remove it by search and replace. Mar 26, 2021 at 12:01

1 Answer 1

1

I think I agree with Ulrike's comments under the question: This is probably overdoing it.

You can hide your commands by giving the correct definitions in \NumCheckSetup

\NumCheckSetup{%
  \def\Line#1{}%
  \def\Lines#1#2{}%
  \def\pa{}%
  \def\pp{}%
  \def\Linebot#1{}%
  \def\Linesbot#1#2{}%
  \def\Linestopbot#1#2{}%
}

A command taking arguments should swallow its arguments for the test. We have to use \NumCheckSetup because with your postnote format the field is piped through several different \ifpages, \ifnumerals, \ifnumeral tests and all of them need to come out as true.

But this works only if the commands you are hiding always appear together with a normal page number. The hidden commands are ignored and then the normal page number is the thing that takes over.

biblatex's current implementation of page formatting, number checking etc. cannot distinguish the cases

\cite[32 \note 3]{westfahl:space}

and

\cite[\note 3]{westfahl:space}

either both get a "p.", because the \note is effectively ignored or neither get a "p." because the \note makes this a non-numeric postnote.

I think as soon as your are dealing with more complex postnotes that are not just a single page or a simple page range, you have to take over the complete formatting yourself. biblatex can only do so much for you. Define a consistent and usable set of commands for that job and use those.

3
  • and @UlrikeFischer: I take your point, perhaps this is excessive. In any case, thank you for this answer, which should work for all cases other than with \note; for those cases I will use @UlrikeFischer's \isispno solution. Mar 27, 2021 at 8:44
  • @AlexRoberts Make sure that your system is fully up to date. Adding the code shown in the first code block to your MWE does not produce any errors for me (just checked again).
    – moewe
    May 24, 2021 at 14:25
  • Sorry, I realized I posted this comment on the wrong page; I meant to post it here, which I have now done. Does that also cause no problems on your system? May 24, 2021 at 14:27

You must log in to answer this question.

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