5

I'm using biblatex + Biber for the bibliography of my thesis, but my main reference database is EndNote. I have over 1400 entries, so I'm not changing it! It's not a major problem, as I can export from EndNote to a .bib file in the appropriate format.

I've managed to sort out such things as Unicode characters and Greek letters, but there are still a few things which need tweaking (for example superscripts and subscripts in journal article titles). There are relatively few of these, so what I'd like to do is use a custom field in EndNote (let's call it latextitle) to put a version of the journal article title with LaTeX tweaks (e.g. \textsuperscript, \textsubscript). So finally I arrive at my question: Is there any way I can get biblatex to substitute the latextitle field for the title field if the latextitle field is not blank?

I appreciate this is rather a 'local' question, so I'm fully prepared to be slapped down!

  • 1
    That should actually be a straightforward sourcemapping job with Biber. Somewhere along the lines of \DeclareSourcemap{ \maps[datatype=bibtex]{ \map[overwrite]{ \step[fieldsource=latextitle, final] \step[fieldset=title, origfieldval] } } } (modulo line breaks, of course) if the memory serves right. – moewe Oct 9 '14 at 16:49
  • That works beautifully @moewe! You also correctly spotted that I meant 'title' when I said 'journaltitle' – I've now amended that in the original post. If you want to formalise your answer I can formally accept it. – Mark Birtwistle Oct 10 '14 at 8:07
  • Glad it works, to be honest, I just assumed you meant title and did not even properly realise you had written journaltitle in your post. But, of course, I'd like to think it was my precognitive abilities leading me the right way ;-) – moewe Oct 10 '14 at 15:03
4

Obviously, it would be best to have a properly formatted .bib file, i.e. one that biblatex and Biber can actually process without choking. But in some cases that's not really possible (or even desirable).

Using Biber it is very easy to modify a source file on the fly.

In your case, where you propose to have a latextitle field for consumption for LaTeX/biblatex and the "normal" title field, one can use the following straightforward mapping

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map[overwrite]{
      \step[fieldsource=latextitle, final]
      \step[fieldset=title, origfieldval]
    }
  }
}

It maps an existing latextitle to title overwriting the latter, and does nothing if latextitle does not exist.

MWE

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{filecontents}
\usepackage[backend=biber]{biblatex}

\begin{filecontents*}{\jobname.bib}
@article{test,
  author = {Arnold Uthor},
  title  = {Uhh. LaTeX won't like \this},
  latextitle = {But we're fine here},
  journal = {Journal of Confusing TeX},
  date    = {2014-10-10},
}
\end{filecontents*}

\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map[overwrite]{
      \step[fieldsource=latextitle, final]
      \step[fieldset=title, origfieldval]
    }
  }
}

\nocite{test,wilde} 

\begin{document}
\printbibliography 
\end{document}

enter image description here

  • Thanks again @moewe. It really is a very elegant solution for what I need. Once the latextitle fields in EndNote are populated (and I will do this as I add citations to the database in future, if appropriate), it's a matter of seconds to export my entire database of 1400+ entries direct to (and to overwite) my .bib file. The tricky bit was to get EndNote to export the data in a .bib format! – Mark Birtwistle Oct 10 '14 at 20:18

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.