Wednesday, March 21, 2012

The symbol @ in LaTex or just thinking way too complicated

When I recently wrote a report in LaTex I struggled to get the letter @ into that report.
My thought was, that @ has to be some kind of special symbol in LaTex, because everything that's not a letter or number is a special symbol for starting e.g. some formatting (what is actually wrong, but you'll find out later).
So, my first try was to escape the @ with a backslash. And, after saving, my TeXlipse showed me an error (Missing $ inserted. \@).
Ok, no problem, I have to escape the backslash for escaping the @ with another backslash. Actually, that worked so far.
So, I went on writing. After a while I took a look into the PDF and saw, that the titles with the @ (the title started with it) had a line feed and was not, where it was supposed to be. Now Google had to solve my problem. Unfortunately Google couldn't solve my problem. The only halfway helpful result was a blog in which the author suggested to write the @ in math-mode, like $@$.
That worked for the title and the @ in the text. But, because of the math-mode, the @ wasn't as pretty as it should be.
That was the point when I got a little bit upset about LaTex. In general I like it, but that was really bugging me. Also, because it seemed to be such a small problem.

After even more wild combinations in Google and some time, I found the solution.
.
.
.
Simply write the @ and everything is fine. No escaping, no special command (like \texttrademark) and no import of some symbol packages.
Sometimes the solution is sooooo simple ;)

0 comments:

Post a Comment

 

Copyright @ 2013 Wrong tracks of a developer.

Designed by Templateiy