I would like to set up my LaTeX (XeTeX) document in such a way so that I could type a hyphen (-, the one on the keyboard) and it would get replaced with an en-dash (–, the "longer" dash) in the resulting document.
For example, for a LaTeX source:
Lietuvos intelektualai - prieš liberaliąją demokratiją? % "Usual" dash typed
I would like to get the en-dash ("long" dash) in the rendering:
Lietuvos intelektualai – prieš liberaliąją demokratiją?
and not the usual hyphen ("short" dash):
Lietuvos intelektualai - prieš liberaliąją demokratiją?
I'm aware that this could be achieved by typing two hyphens (--) instead of a single hyphen (-), but is there a better way to do that?
(Due to the nature of documents I typeset and the requirements of the language I use, I'm required to type an en-dash 98% of all times and might need the "usual" hyphen just occasionally).
~--from now on. – Andrey Vihrov Feb 16 '12 at 16:13--or a real en-dash). – Ulrike Fischer Feb 16 '12 at 16:15\textendash. You can simply write\catcode`-=13\def-{\textendash}and then use-as if it were an endash. – Roelof Spijker Feb 16 '12 at 16:33--is much to type and easier to see in the source. – Ulrike Fischer Feb 16 '12 at 16:35--is effectively semantic markup, which is good too. – Alan Munn Feb 16 '12 at 17:18