Possible Duplicate:
babel shorthand "| doesn’t work in macros
I would like to define a new command for guillemets marks. I know how to obtain them in LaTeX and those I would like to use are produced by this code:
"<lorem ipsum dolor sit amet">
with italian option for the babel package (my complete code will follow below).
I tried to define my new command as
\newcommand{\guille}[1]{"<#1">}
but it doesn't work and it simply produces the same as
\textquotedbl\textless ... \textquotedbl\textgreater
Now, if I define
\newcommand{\newtextemdash}{---}
LaTeX correctly replaces --- with an em-dash. Why this replacement does not occur with "< and ">?
Finally, where can I find the rule such that --- must be replaced by \textemdash? And the one for "< and for ">?
\documentclass{minimal}
\usepackage[italian]{babel} % this activates "<...">
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\newcommand{\guille}[1]{"<#1">} % this does not work
\newcommand{\newtextemdash}{---} % this works
\begin{document}
Lorem ipsum dolor \newtextemdash{} sit amet \newtextemdash{} consectetuer adipiscing elit.
\guille{Lorem ipsum dolor si amet}
I would like to have this: "<Lorem ipsum dolor sit amet">
\end{document}


<<testo>>works if the T1 encoding is in force. – egreg Feb 01 '13 at 20:36"shorthands arebabelspecific, whereas---comes from (La)TeX itself. As for its definition, there’s the unanswered question What are the TeX definitions for the hyphen and dashes -, --, and ---?, which points to How does TeX's mechanism for sorting out quotation marks work?, where a apparently parallel case for quotation marks is explained. – doncherry Feb 02 '13 at 04:34babel,t1enc.defand others without understandig how to fix my problem. However, all the answers pointed out are useful for solving my doubts, thanks! – Onner Irotsab Feb 02 '13 at 10:13\AtBeginDocumen{}, but I didn't succeed in reading your answer completely. Please, could you post it again? I've fixed my code for obtaining my purpose, anyway I'm interested in your solution. Of course, if it is not a problem! Thank you! – Onner Irotsab Feb 02 '13 at 13:50\AtBeginDocumentsolution does not work here. I suggest to use either the macro version (\guillemot…) or the ligature version (<<and>>). If you get different outputs from those two or withcsquotes, I suggest you ask another question with a MWE that shows your choice of font. The MWE on this question is not a good one because it uses theT1font encoding but not an appropriate font (i.e.lmodernfor example). – Qrrbrbirlbel Feb 02 '13 at 14:28fontencpackage withT1option for Computer Modern according to The LaTeX Font Catalogue website regard to Computer Modern fonts. Anyway, all the ingorance in range of fonts and encodings it is my responsibility. Thanks! – Onner Irotsab Feb 02 '13 at 16:19@<username>to respond to a specific user so that they get notified (as I did now myself). If I compile your MWE I get rasterized letters. Thelmodernfont is much better, especially if you need diacritics in words that should be able to be hyphenated. – Qrrbrbirlbel Feb 02 '13 at 23:12