Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Keys are labeled as author:year in my BibTeX file. For example, @article{John:2000, author={John}, year={2000}, ...}. This scheme works well with pdftex, biblatex and mk4ht oolatex.

But if in addition babel is loaded with the french option, then mk4ht oolatex cannot find any BibTeX key.

In the example below it looks for John:{}2000 instead of John:2000:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french, american]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=verbose]{biblatex}
\bibliography{sample.bib}

\usepackage{filecontents}
\begin{filecontents}{sample.bib}
@article{John:2000,
author={John},
title={Title},
journal={Journal},
year={2000}}
\end{filecontents}

\begin{document}
La première phrase \autocite [100] {John:2000}.
\end{document}

By running:

$ latex foo
$ biber foo
$ mk4ht oolatex foo

I get this warning:

LaTeX Warning: Citation 'John:{}2000' on page 1 undefined on input line 19.

My question is: whose bug is this: tex4ht or babel? Any ideas as to how to avoid it without changing my BibTeX keys?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

This is because french babel makes colon active, it inserts space before the colon. You can switch of this behaviour with command \shorthandoff{:} placed at the beginning of the document. Of course, it will suppress automatic inserting of spaces before colon in the whole document.

share|improve this answer
    
Thanks! This workaround is enough for my present purposes. I'm aware typesetting in French requires some space before colons and semicolons, but I still don't get it why this behavior isn't suppressed when looking for keys. Well, BibTeX keys are not to be typeset at all. –  nicolai.rostov Jan 3 '13 at 10:17
add comment

Given the fact, that this compiles for all latex commands I can throw at it, but not for mk4ht I assume it's tex4ht. Still Babel isn't the nicest of packages and I particularly dislike this way of activating punctuation, cf https://github.com/fc7/polyglossia/issues/21 for a similar recent issue. The fault is usually with the compiler, since it should work in principle but it still provokes errors more often than necessary in my eyes.

share|improve this answer
    
Yeah, I think I will file a bug report against it. I wish I could help the oolatex branch of tex4ht developers somehow. –  nicolai.rostov Jan 3 '13 at 10:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.