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.

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
1  
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
add comment

1 Answer

up vote 12 down vote accepted
\catcode`\<=1
\catcode`\>=2

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

\documentclass{article}
\usepackage{amssymb,amsmath}
\begin{document}


\input{file-with-anglebrackets}


\end{document}
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
1  
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
1  
@UweZiegenhagen, I'm adding some note to the answer, too long for comment –  David Carlisle Mar 5 '12 at 19:38
3  
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
show 2 more comments

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.