TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am exporting photo metadata from a software which seems to be unable to export curly braces correctly. Is there any way to tell LaTeX to treat < as {, and > as }, to keep me from having to go through the file manually? In the back of my head I have cat-codes in mind but never used them so far.

share|improve this question
it might be easier to write a script which fixes the data formatting, and not have to redefine things in LaTeX, but that's not what you asked. – Joe Mar 6 '12 at 6:42
up vote 12 down vote accepted

does what you ask although you might find some parts of LaTeX are not expecting to find < and > redefined like that.

Constructs such as \ifnum\tempdim<5pt fail if < is not < but you don't normally find those mid document so switch catcodes after begin{document} perhaps by making your application write out just the main body of the document without the preamble and then have a document with normal syntax that looks like



share|improve this answer
Does this leave math-related operators untouched? – Werner Mar 5 '12 at 19:25
@Werner well you can do $\left\langle \frac<1><2> \right\rangle$ but not $\left< \frac<1><2> \right>$ if that's what you mean – David Carlisle Mar 5 '12 at 19:33
This is partly what I meant, but good to know. I was referring to x > y which I guess has to be replaced with x \gt y. – Werner Mar 5 '12 at 19:35
@UweZiegenhagen, I'm adding some note to the answer, too long for comment – David Carlisle Mar 5 '12 at 19:38
I helped myself by just exporting CSV and using datatool. I contacted the author of the Lightroom plugin, it would be great to have it export LaTeX directly. – Uwe Ziegenhagen Mar 5 '12 at 20:41

Your Answer


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.