1

I use the includeall=false option in biblatex-chicago. While this suppresses items I don't want to show up in my footnotes, it also has the effect of suppressing url's when I do want them to show up. In the case of the MWE below what I would like to be able to do is leave the global option on so url won't show for book1 citation but be able to show url for Nazzal2005 citation both in the footnote and bibliography.

\documentclass[12pt,a4paper]{memoir}
\usepackage[utf8]{inputenc}
\usepackage{lipsum} % just for dummy text
\usepackage[notes, backend=biber, includeall=false,]{biblatex-chicago} %Sets Bibliography style.
\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@book{book1,
address = {Anytown},
booktitle = {Example book},
pages = {5},
title = {{Any book you want}},
url = {http://www.amazon.com},
year = {2000}
}
@article{EPost11/12/1915,
Entrysubtype = {magazine},
address = {Wellington},
journal = {Evening Post},
keywords = {primary},
day = {11},
month = dec,
pages = {5},
title = {{Exiled Samoans}},
year = {1915}
}
@misc{Nazzal2005,
author = {Nazzal, Mary},
number = {April},
title = {{Nauru : An Environment Destroyed and International Law}},
url = {http://www.lawanddevelopment.org/articles/nauru.html},
urldate = {2014-03-18},
year = {2005}
}

\end{filecontents*}

\addbibresource{\jobname} % if you’re using biblatex
\begin{document}

\lipsum[1]\autocite{Nazzal2005}

\lipsum[1]\autocite{EPost11/12/1915}

\lipsum[1]\autocite{book1}

\printbibliography
\end{document}
1

You could do something like

\newbibmacro*{bib+doi+url}{% 16th ed.
  \iffieldundef{urlyear}%
    {}%
    {\printurldate}% Date fix
  \iffieldundef{addendum}% Punctuation fixes in 0.9.9c
    { \newunit\newblock}%
    {\newcunit\newblock}%
  \iftoggle{cms@doionly}%
    {\iffieldundef{doi}%
       {}%
       {\printfield{doi}%
        \setunit*{\addperiod\addspace}\newblock%
        \clearfield{url}}}%
    {\ifboolexpr{%
        togl {cms@doi}%
        and
        not test {\iffieldundef{doi}}%
     }%
       {\printfield{doi}%
        \setunit*{\addperiod\addspace}\newblock}%
       {}}%
  \ifboolexpr{%
    togl {cms@eprint}%
    and
    not test {\iffieldundef{eprint}}%
  }%
    {\usebibmacro{eprint}%
     \setunit*{\addperiod\addspace}\newblock}%
    {}%
  \ifboolexpr{%
    (togl {cms@url} or test {\ifentrytype{misc}})
    and
    not test {\iffieldundef{url}}%
  }%
    {\printfield{url}}%
    {}}%

\newbibmacro*{cite+doi+url}{% 16th ed.
  \iffieldundef{urlyear}%
    {}%
    {\printurldate}% Date fix
  \newcunit\newblock
  \iftoggle{cms@doionly}%
    {\iffieldundef{doi}%
       {}%
       {\printfield{doi}%
        \clearfield{url}}}%
    {\ifboolexpr{%
      togl {cms@doi}%
      and
      not test {\iffieldundef{doi}}%
     }%
       {\printfield{doi}}%
       {}}%
  \newcunit\newblock
  \ifboolexpr{%
    togl {cms@eprint}%
    and
    not test {\iffieldundef{eprint}}%
  }%
    {\usebibmacro{eprint}}%
    {}%
  \newcunit\newblock
  \ifboolexpr{%
    (togl {cms@url} or test {\ifentrytype{misc}})
    and
    not test {\iffieldundef{url}}%
  }%
    {\printfield{url}}%
    {}}%

Which effectively makes @misc entries ignore the cms@url toggle which is set to false by includeall=false. You can add any other types you like, for example @online to always have their URL printed by replacing (togl {cms@url} or test {\ifentrytype{misc}}) with

(togl {cms@url} or test {\ifentrytype{misc}} or test {\ifentrytype{online}})

Alternatively, we can go for includeall=true instead and delete the URL where you don't want it.

\AtEveryBibitem{\ifentrytype{misc}{}{\clearfield{url}}}
\AtEveryCitekey{\ifentrytype{misc}{}{\clearfield{url}}}

If you want this for more types, go with

\AtEveryBibitem{%
  \ifboolexpr{test {\ifentrytype{misc}} or test {\ifentrytype{online}}}
    {}
    {\clearfield{url}}}
\AtEveryCitekey{%
  \ifboolexpr{test {\ifentrytype{misc}} or test {\ifentrytype{online}}}
    {}
    {\clearfield{url}}}

to specify where you want to keep the URL, or with

\AtEveryBibitem{%
  \ifboolexpr{test {\ifentrytype{article}} or test {\ifentrytype{book}}}
    {\clearfield{url}}
    {}}
\AtEveryCitekey{%
  \ifboolexpr{test {\ifentrytype{article}} or test {\ifentrytype{book}}}
    {\clearfield{url}}
    {}}

to specify where to delete the URL.

  • In the last solutions for mulitple types what does the \ifboolexpr mean and does the text "test" and "or test" do anything? – gman Feb 12 '17 at 16:45
  • 1
    @gman \ifboolxepr is an etoolbox command that allows to combine several \if... expressions into one. The \if... commands then need to be wrapped in braces and must be prefixed by test for etoolbox to treat them correctly. See pp. 23-27 of the etoolbox documentation. – moewe Feb 12 '17 at 16:48

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.