2

My publisher has a list of ~50 words that need to be lowercase in titles of books and articles, the remaining words need to be capitalized. We are using BiBTeX, not biber, for performance reasons.

Here is the invocation:

\usepackage[backend=bibtex,language=american,style=authoryear]{biblatex}```
% Patch biblatex:
\urlstyle{sf}
\DeclareFieldFormat{url}{\url{#1}}

Right now, the only way I can think to honor the publisher's list is to have a python program that does post-processing on the .bbl file. Which I can certainly do, but it would be nice if there were a better way.

If I do need to do post-processing on the .bbl file, is there a way to get latexmk to run my python program after running bibtex? From the docs, it seems that I might be able to set $bibtex = 'python bibwrap.py' where bibwrap.py would run bibtex and then run my post-processing script. Would that be the way to do it?

vy32
  • 4,780
  • Especially the answer by Steven B. Segletes, the other two answers don't do what you want. – Marijn Jun 17 '21 at 21:09
  • Thanks for pointing me at those answers. They would be great, except we are not using .bst files, we are using biblatex with the authoryear option. So I'll need to research this more. Thanks though. – vy32 Jun 17 '21 at 21:44

1 Answers1

0

For BibLaTeX + BibTeX you can use DeclareFieldFormat to define a title case format and then call that format for titles using \renewbibmacro*{title}. This procedure is described in Expand arguments to DeclareFieldFormat to replace words in biblatex field.

Combining that with Implementation of "Title Case" in Bibtex:

\documentclass{article}
\begin{filecontents*}{changecase.bib}
@misc{casecheck,
   title = {a title that shows the use of titlecap},
   author = {John Doe},
   year = {2021}
}
\end{filecontents*}
\usepackage[backend=bibtex,language=american,style=authoryear]{biblatex}
\usepackage{titlecaps}
\Addlcwords{the of into}

\DeclareFieldFormat{captitle}{\titlecap{#1}} \renewbibmacro*{title}{% \ifboolexpr{ test {\iffieldundef{title}} and test {\iffieldundef{subtitle}} } {} {\printtext[title]{% \printfield[captitle]{title}% \setunit{\subtitlepunct}% \printfield[captitle]{subtitle}}% \newunit}% \printfield{titleaddon}}

\addbibresource{changecase.bib} \begin{document} Change case for \cite{casecheck} \printbibliography \end{document}

enter image description here

Marijn
  • 37,699