# biber eating \langle and \rangle commands

I have some entries in my reference list that contain \langle and \rangle signs in their title like the one in the following MWE:

\begin{filecontents}{\jobname.bib}
@BOOK{test,
author = {A. Uthor},
title = {A title with some $\langle \Psi \rangle$ stuff},
year = {2014},
publisher = {A Company}
}
\end{filecontents}

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

\begin{document}
\nocite{*}
\printbibliography
\end{document}


If I process this MWE with pdflatex and biber the \langles and \rangles are missing in the output and the pdflatex log file says

Package inputenc Error: Unicode char \u8:⟨ not set up for use with LaTeX.

and

Package inputenc Error: Unicode char \u8:⟩ not set up for use with LaTeX.

I already have tried the tricks from Revtex - using math in footnote without any success. When looking into the .bbl file generated by biber it turns out, that the title field looks as follows:

\field{title}{A title with some $⟨\Psi ⟩$ stuff}


So obviously biber itself is already replacing the \langle and \rangle commands with ⟨ and ⟩ respectively but those are then incompatible with inputenc.

According to the biblatex manual I could set the safeinputenc package option which instructs biber to try to convert all utf8 encoded stuff into ASCII. This works for the issue described above but it will also cause me new pain with other entries as some of the conversions that biber tries are leading to wrong results.

So is there some third way that I don't see or am I maybe experiencing a bug in biber as its conversion to ⟨ and ⟩ is wrong?

-

It seems that Biber tries to be smarter than LaTeX. ;-) Perhaps there's a BibLaTeX/Biber way, but a workaround is easy to find. We just define the characters inputenc doesn't know.

\begin{filecontents}{\jobname.bib}
@BOOK{test,
author = {A. Uthor},
title = {A title with some $\langle \Psi \rangle$ stuff},
year = {2014},
publisher = {A Company},
}
\end{filecontents}

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{newunicodechar}
\newunicodechar{⟨}{\langle}
\newunicodechar{⟩}{\rangle}

\usepackage[backend=biber]{biblatex}

\begin{document}
\nocite{*}
\printbibliography
\end{document}


-

I am not sure if this works for everything - it did however work for the cases I used and the above. From the biber help page:

--decodecharsset=[recode set name]
The set of characters included in the conversion routine when
decoding LaTeX macros into UTF-8 (which happens when
--bblencoding|-E is set to UTF-8). Set to "full" to try harder with
a much larger set or "base" to use a smaller basic set. Default is
"base". You may want to try "full" if you have less common UTF-8
characters in your data source. The recode sets are defined in the
reencoding data file which can be customised. See the --recodedata
option and the PDF manual.


I however do not know and undersatnd why this worked in this case, but if you run

biber --decodecharsset=full <main[.bcf]>


\field{labeltitle}{A title with some $⟨\Psi ⟩$ stuff}
\field{title}{A title with some $⟨\Psi ⟩$ stuff}


to main.bbl it will write the desired

\field{labeltitle}{A title with some $\langle \Psi \rangle$ stuff}
\field{title}{A title with some $\langle \Psi \rangle$ stuff}
`

and hence latex will not complain about not knowing chars. This might be more useful if there are a couple of unknown characters in your database.

-