1

I would like to add a period after an entry introduced by \cite. I'm using biblatex.

So far I only found ways of changing the ending of \autocite using \bibfootnotewrapper. Is there a similar wrapper one can control for \cite?

Example:

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

%compiled with "latexmk -xelatex"

\documentclass{article}
\usepackage[notes, natbib,doi=false,isbn=false,url=false,omitxrefdate=false, backend=bibtex, clearlang=true]{biblatex-chicago}  
\bibliography{lib.bib}
\begin{document}
\footnote{\cite{goossens93}. Something something} 
\autocite{goossens93}
\end{document}

Where lib.bib would be:

@book{goossens93,
author = "Frank Mittelbach and Michel Goossens  and Johannes Braams and David Carlisle  and Chris Rowley",
title = "The {LaTeX} Companion",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"}
Troy
  • 13,741
igm2103
  • 105
  • 2
    Welcome! Please provide a minimal working example we can work with. Also, this may possibly clarify your question which isn't really one I understand at this point. Why would you want it always followed by a full stop? What if it is not the end of a sentence? What happens if it is a question rather than a statement? – cfr Mar 19 '17 at 20:49
  • 1
    If nothing else, you need to (1) explain what biblatex citation style you use and (2) provide a bit more of an explanation of why you need this -- how are you using the command which leads to this requirement. – Paul Stanley Mar 19 '17 at 20:53
  • I'm using biblatex-chicago. \autocite does its job for most of the things I need, but sometimes I need to explain something in my footnotes, and add a citation. In these cases I would like the citation to automatically end in a period. I agree that changing the whole behavior of \cite might not be a good idea. I have tried creating a new command \newcommand{\citep}[1]{\cite{#1}\addperiod} but this puts my citation in parentheses. – igm2103 Mar 19 '17 at 21:32
  • \autocite{....} ends in a period, while \footnote{\autocite{....}} doesn't. What do you think is the best solution? – igm2103 Mar 19 '17 at 21:39
  • I can't get your example to compile at all. Once I run bibtex, that's it. Any attempt to compile ends in error. Please edit to correct your code. – cfr Mar 19 '17 at 22:47
  • I compiled the code with latexmk -xelatex but I don't know if that matters. – igm2103 Mar 19 '17 at 23:05
  • 1
    I remember (vaguely) the author of biblatex-chicago writing in the documentation that getting final periods in automatically was tricky and that he removed the implementation because it would too often wrongly add a period when one was not called for. – jon Mar 19 '17 at 23:16
  • I can't get the code to compile with backend=bibtex at all. Does it work for @jon? I tried pdfLaTeX and XeLaTeX. – cfr Mar 19 '17 at 23:18
  • @cfr -- hmm, you're right. I'm getting an error about \cms@choose/global being undefined. (I don't normally use the notes style or BibTeX, so this is new to me.) (The error is common across engines.) – jon Mar 19 '17 at 23:24
  • I can only compile it with XeLaTex not with pdfLaTex – igm2103 Mar 19 '17 at 23:25
  • For my earlier comment, see page 67 of the docs (for version 1.0rc1 (beta)). – jon Mar 19 '17 at 23:25
  • @jon Me, too. I don't use biblatex-chicago any longer and I never used notes. However, I always used bibtex with it. (This is why I stopped using it - I could no longer typeset author-year with it, lacking Biber at the time.) @ igm2103 I get the same error as jon with both engines. – cfr Mar 19 '17 at 23:31
  • Are you sure that *exactly the code you posted compiles* for you after running bibtex? That is, not your original document, but this one? – cfr Mar 19 '17 at 23:33
  • @jon, thank you for the reference that explains the weird behavior of citations in footnotes. @cfr Yes, the code I have in the example compiles without errors when I use latexmk -xelatex – igm2103 Mar 19 '17 at 23:37
  • So it sounds like there's a version thing going on. Can you check what version of biblatex-chicago you are using? For me, \listfiles prints biblatex-chicago.sty 2016/06/01 v 3.4 in the .log. – jon Mar 19 '17 at 23:43
  • Package: biblatex-chicago 2014/08/15 v 2.9a biblatex style – igm2103 Mar 19 '17 at 23:48
  • 1
    Well, it looks (in my version of biblatex-chicago.sty) like the way \cms@choose is used has grown in complexity since then. Until this error is fixed (for newer versions) I can't help you with your problem. In my opinion, however, \footnote{\cite{goossens93}. Something something} is the right input syntax, and I don't think it is worth the trouble to get the period automatically (mainly because I think the resulting code will be like a rickety Rube Goldberg machine that is liable to break at any minute). – jon Mar 20 '17 at 00:54
  • However, I should add that, as you probably concluded yourself, you may not want to update biblatex and biblatex-chicago until you are sure that the current error is fixed. (If, that is, you need the notes Chicago style.) – jon Mar 20 '17 at 00:59

2 Answers2

1

I agree with those who have commented above. I don't see what you gain from a special command by not just adding the period manually.

But you could abuse \autocites in this way :)

I make a new delimiter:

\newcommand*{\multipostnotedelim}{\addperiod\space}

Then fiddle with the multipostnote format so it capitalises automatically:

\DeclareFieldFormat{multipostnote}{\ifcapital{\MakeCapital{#1}}{#1}}

Then patch the the multipostnote macro to use our new \multipostnotedelim:

\usepackage{xpatch}
\xpatchbibmacro{multipostnote}
  {\postnotedelim}{\multipostnotedelim}{}{}

And you then you can do this:

Filler text \autocites(something something)[12]{goossens93}.

Giving you this output:

enter image description here

David Purton
  • 25,884
  • how would I apply this solution to a bibliography entry in biblatex? I have an online entry in my .bib file and the last field is the urldate. Unfortunately, latex does not place a period after the urldate. This causes the following back reference not to be capitalized. I posted my MWE here: https://tex.stackexchange.com/questions/657138/tufte-latex-vertical-adjustment-of-biblatex-citations-in-captions/657466#657466 – Steven Sep 17 '22 at 04:32
  • I created a paired down modifiable MWE on overleaf: https://www.overleaf.com/6514453265gbtcvtrmpjnw – Steven Sep 18 '22 at 05:32
1

You can define a \punctcite command that is a copy of \cite, but with a wrapper around it that adds a full stop after the citation.

\newcommand{\bibpunctwrapper}[1]{%
  \bibsentence#1\addperiod}
\DeclareCiteCommand{\punctcite}[\bibpunctwrapper]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}

Here \bibpunctwrapper is a copy of \bibfootnoterwapper (I used a new command in order to be able to use the two independently). And \punctcite is just a copy of chicago-notes' \cite with just the optional argument [\bibpunctwrapper] added.

Use it as

\footnote{\punctcite{companion} Something something} 

to obtain

Michel Goossens, Frank Mittelbach, and Alexander Samarin, The LaTeX Companion, 1st ed. (Reading, Mass.: Addison-Wesley, 1994). Something something

in the footnote

moewe
  • 175,683
  • how would I apply this solution or perhaps the one above it to a bibliography entry in biblatex? I have an online entry in my .bib file and the last field is the urldate. Unfortunately, latex does not place a period after the urldate. This causes the following back reference not to be capitalized. I posted my MWE here: https://tex.stackexchange.com/questions/657138/tufte-latex-vertical-adjustment-of-biblatex-citations-in-captions/657466#657466 – Steven Sep 17 '22 at 04:31
  • I created a paired down modifiable MWE on overleaf: https://www.overleaf.com/6514453265gbtcvtrmpjnw – Steven Sep 18 '22 at 05:31