I'm looking for a way to use the left and right narrow angle symbols (〈 〉, Unicode #3008, #3009) so that they are not changed when copy and pasted from a PDF.

These symbols are used e.g. by the doc package for \meta{...} and other formatting macros to indicate the content of an argument, e.g.: \command[〈options〉]{〈filename〉} would be written with |\command|\oarg{options}\marg{filename}. This package uses the \langle and \rangle math symbols. The problem with this is that if this code is copied from the generated PDF the symbols are changed to h and i, e.g.:\command[hoptionsi]{hfilenamei}.

Detexify now pointed me to \textlangle and \textrangle from the textcomp package. These angles are copied to ASCII angles < and >, respectively, which is much better already, but I like to have the correct narrow angles instead.

How can I insert this angles so that the can be copied correctly from the PDF? I tried to use [utf8]{inputenc} and insert them as Unicode symbols in VIM manually (CTRL+V u 3008 or 3009, respectively) but got an error that this symbols are not setup for this use. I need this for my ydoc class/package, an alternative to doc and ltxdoc and would like to avoid hassle with fonts and encoding as much as possible. This should work for PDFLaTeX and not just for XeLaTeX or LuaLaTeX.




the two symbols may be associated to U+27E8 MATHEMATICAL LEFT ANGLE BRACKET and U+27E9 MATHEMATICAL RIGHT ANGLE BRACKET. If you want to input them directly, here it is how it can be done:

\newunicodechar{〈}{$\langle$} % U+27E8
\newunicodechar{〉}{$\rangle$} % U+27E9


Another choice might be

\newunicodechar{〈}{\textlangle} % U+2329
\newunicodechar{〉}{\textrangle} % U+232A

You can use directly \DeclareUnicodeCharacter, of course, with


instead of \newunicodechar.

This should allow to copy and paste the symbol from the PDF viewer, but it seems that the code of the copied character is viewer dependent, when \textlangle and \textrangle are used. :(

Thanks to Martin Scharrer for having suggested improvements to the answer.

  • I was about to ask about the spaces around the angle brackets, but then I realized that those glyphs have a generous amount of space built in, at least with the fonts I am viewing this in. – Harald Hanche-Olsen May 13 '11 at 11:24
  • You might have mentioned that the newunicodechar package can be found on CTAN. It is not in TeX Live 2010, and so the vast majority (?) of readers probably won't have it in their installations. – Harald Hanche-Olsen May 13 '11 at 11:28
  • the newunicodechar package is in my tl2010 (updated yesterday) – wasteofspace May 13 '11 at 11:56
  • @Harald: The first version of the package was uploaded to CTAN on February 18, and has been in TeX Live since one or two days later. The space indeed depends on the font the system decides to use for showing the symbol. – egreg May 13 '11 at 12:16
  • I get the correct angles in the PDF, but copy and pasting under Ubuntu from Adobe Reader results in normal ASCII angles < >, exactly like with textcomp alone. If I use pdftotext I get Unicode angles. – Martin Scharrer May 13 '11 at 12:40

You can use glyphtounicode. Differently to cmap it will work with virtual fonts too.



< >


If you compile with pdflatex you can copy the brackets e.g. to notepad. This will work fine, but in an ascii editor (e.g. winedt) the result is not correct.

Edit. I just remembered: Another possibility is accsupp. It work with pdftex, luatex + xetex:



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.