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've found that writing "Sáenz":

S\'{a}enz
S\'aenz
S{\'a}enz
S{\'{a}}enz

Produces the same output.

It gets even trickier when you have two accents in a row, such as in "comunicação" (portuguese):

comunica\c{c}\~{a}o
comunica\c{c}\~ao

(and perhaps some other combinations (?))

What is the correct syntax, and why?

share|improve this question
2  
Why bother? Use a UTF8 encoded source file and enter all accents directly. See How to type special/accented characters in LaTeX. –  Alan Munn Apr 16 '13 at 16:47
2  
if you must stick with the original accent codes, it's better to avoid braces, as those suppress kerning between letters in a word. in particular, if an accent code is a single non-alpha character, it isn't necessary at all to use braces to keep the pieces distinct; this form is unambiguous to tex. –  barbara beeton Apr 16 '13 at 16:55
3  
The exception to the rules put forward by Alan Munn and Barbara Beeton arises if you use BibTeX. For BibTeX (but not biblatex/biber), it's best to use the third form you provide, i.e., S{\'a}enz. That way, the author's surname will be sorted as if it were written as "Saenz", i.e., without an accent. Conversely, Sáenz will be sorted by BibTeX after Szabo -- probably not what you want, right? See How to write “ä” and other umlauts and accented letters in bibliography? for more on this. –  Mico Apr 16 '13 at 17:11
2  
    
Thank you all guys, I'm really not having any problems as of now (I'm actually on Alan Munn's side on this: why bother if there is utf8 encoding), I just got curious because I use BibTeX and I had some issues with accents before. I just wanted to set the record straight. @Mico has a very strong argument for S{\'a}enz though, but so does Barbara Beeton for avoiding the braces... –  Mario S. E. Apr 16 '13 at 21:10

2 Answers 2

up vote 4 down vote accepted

Taking into consideration what was stated by Alan Munn, as long as there is utf8 encoding in your text, you can just write the words normally and just forget about the accents. e.g:

\documentclass{report}
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}

\begin{document}
Sáenz e Comunicação
\end{document}

However, as stated by Barbara Beeton, IF you MUST stick with the explicit syntax, then avoid the {} braces, since those suppress kerning between letters in a word, i.e.:

\documentclass{report}
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}

\begin{document}
S\'aenz e Comunica\c{c}\~ao
\end{document}

Furthermore, Mico pointed out a really important issue when using Bibtex (but not biblatex/biber): it's best to use: S{\'a}enz. That way, the author's surname will be sorted as if it were written as "Saenz", i.e., without an accent. Conversely, Sáenz will be sorted by BibTeX after Szabo

share|improve this answer

Yes, you have to bother, BibTeX is completely incapable of UTF-8 (whoever says otherwise, is sadly mistaken. The various "BibTeX replacements" are more pain to set up than they are worth, and in my experience plain don't work). The most reliable source to date has been this (extra)official BibTeX documentation.

In the body of the text, use UTF-8. It looks much nicer, the friendly language teacher next door can also correct your worst mistakes that way.

For BibTeX, in your .bib files use {\'o} and so on, even if told \'o "works the same" (it doesn't!). BibTeX considers {\somefunkymacro L} to be an L (to be handled as such for sorting purposes) with some fancy \somefunkymacro accent (the braces are critical here). This makes some nice tricks possible, i.e., define a \noopsort macro to be able to give an entry like:

@Book{lHopital96:_analy_infin_petit_lignes_courb,
  author =       {{\noopsort{Hopital}}de l'H{\^o}pital,
                  Guillaume Marquis},
  title =        {Analyse des Infiniment Petits
                  pour l'Intelligence des Lignes Courbes},
  publisher =    {Paris},
  year =         1696
}

This sorts like Hopital, without mangling the good marquis' name in the bibliography.

share|improve this answer
1  
I'm not sure what you mean by "BiBTeX replacements", but biblatex/biber is part of TeX Live/MikTeX and can handle UTF8 .bib files with correct sorting without much fuss (at least for all Latin script languages). Whether or not this is an appropriate route for any particular person depends on a lot of other factors, but I wouldn't characterize biblatex/biber as "not working". –  Alan Munn Apr 16 '13 at 18:12
2  
Isn't it about time for everyone to use BibLaTeX and biber (especially those with little or no investment in BibTeX)? –  Brent.Longborough Apr 16 '13 at 18:28
    
BibLaTeX is BibTeX for all intents and purposes here. I do have extensive experience (some 30 years now) coaxing random pieces of software into working (on our Suns I built gcc, X and TeX from scratch as there was no other way to get them), biber was my biggest failure to date. It is just an abandoned half-finished prototype, not a product. –  vonbrand Apr 16 '13 at 18:34
    
Your use of the \noopsort macro, while certainly nifty in its own rights, is a serious distraction from the main point -- viz., how best to enter an "accented" letter -- that the OP raises and you aim to answer. Please consider providing a simpler example. –  Mico Apr 16 '13 at 21:03
1  
@vonbrand Just a slight correction, biblatex is in no way a replacement for bibtex, since the former is a LaTeX package, and the latter is a program for sorting and formatting bibliographies. I'm sorry to hear you've had difficulties with biber. Perhaps this was some time ago. There are many of us who use it routinely without any problems, and it is far from abandoned (in fact one of the developers PLK is active on the site). –  Alan Munn Apr 22 '13 at 18:52

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.