Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Citations with accent and umlaut commands do not expand properly #5

Open
ftilmann opened this issue Feb 27, 2017 · 2 comments
Open

Comments

@ftilmann
Copy link

ftilmann commented Feb 27, 2017

When author names in an author-year citation style contain accent or umlaut commands (e.g. \",\') and or braces, they are not expanded properly, leading to errors in the resulting latex file. The following MWE illustrates the problem.

mwe_accentcite.tex:

\documentclass{article}
\usepackage{natbib}

\bibliographystyle{plainnat}
\begin{document}
Breaking citations:

\citep{fontaine2013imaging}

\citep{ligorria1999iterative}

\citep{reiss2016seismic}

\bibliography{biblio}
\end{document}

biblio.bib:

@Article{fontaine2013imaging,
  Title                    = {Imaging crustal structure variation across southeastern {Australia}},
  Author                   = {Fontaine, Fabrice R and Tkal{\v{c}}i{\'c}, Hrvoje and Kennett, Brian LN},
  Journal                  = {Tectonophysics},
  Year                     = {2013},
  Pages                    = {112--125},
  Volume                   = {582},

  Publisher                = {Elsevier}
}

@Article{ligorria1999iterative,
  Title                    = {Iterative deconvolution and receiver-function estimation},
  Author                   = {Ligorr{\'\i}a, Juan Pablo and Ammon, Charles J},
  Journal                  = {Bulletin of the seismological Society of America},
  Year                     = {1999},
  Number                   = {5},
  Pages                    = {1395--1400},
  Volume                   = {89},

  Publisher                = {Seismological Society of America}
}

@Article{reiss2016seismic,
  Title                    = {Seismic anisotropy of the lithosphere and asthenosphere beneath southern {Madagascar} from teleseimic shear-wave splitting analysis and waveform modeling},
  Author                   = {Reiss, M. and R\"umpker, G. and Tilmann, F. and Yuan, X. and Giese, J. and Rindraharisaona, E. J.},
  Journal                  = {accepted by J. Geophys. Res.},
  Year                     = {2016}
}

Run the following sequence (using latexdiffcite 1.0.6):

latex mwe_accentcite
bibtex mwe_accentcite
latexdiffcite file mwe_accentcite mwe_accentcite
latex diff.tex

The last latex command does not run through (of course, it is non-sensical to compare mwe_accentcite to itself, but it is enough to demonstrate the issue).

The reason is obvious from inspection of the expansion that latexdiffcite has done:

[\ldiffentity{\textit{Fontaine and Tkal\vc}, \ldiffentity{2013}}]
[\ldiffentity{\textit{Ligorr\'\ia and Ammon}, \ldiffentity{1999}}]
[\ldiffentity{\textit{Reiss and R\}, \ldiffentity{2016}}]

i.e braces should be preserved, and processing should not stop when encountering \".

@cmeeren
Copy link
Collaborator

cmeeren commented Feb 28, 2017

Thanks for a great bug report, I'll try to have a look at it soon-ish.

@cmeeren
Copy link
Collaborator

cmeeren commented Mar 3, 2017

I've had a look at this now, and unfortunately it's a limitation of the way I have parsed the bib files (using regex). Allowing arbitrary braces inside names is not at all practical the way the bib files are parsed, and would also break a few other tests (since then surnames like {Foo} and Foo would register as two separate names).

I simply can't and won't put in the time required to delve into this and fix this. I of course welcome any pull requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants