Often that one might encounter the situation where certain accent symbols are need to be input in a LaTex file, such as the "é", "à", "œ" in French, and "ß", "ü", "ä" in German.
A direct, however tedious and complex way is to use the LaTex embedded command mechanism. Different commands (a backslash together with other strings) represent different symbols. For instance, "\'{}" stands for a grave accent, "\`{}" for a acute accent, "\^{}" for a circumflex... detailed mapping could be found at Latex/Accent Wikibooks. This method is easy to comprehend and apply, also seems natural for those who are familiar with the LaTex command style. However, if you are dealing with a document completely in another language, where there are a large number of accent symbols, it will become far more tiring to assign each symbol a correspond command. Further more, one disadvantage of this method is that when copying the text in the generated PDF file, the accent symbol will not be displayed as verbatim characters, which causes immense inconvenience when you want to post-process your file (e.g., Google Translate).
There exists other ways to handle multi-language LaTex of course. One usual one is to add some language package and then typeset with XeLaTex. This is quite helpful for non-latin languages such as Chinese and Japanese.
But if your document is restricted within the domain of Latin languages, one very simple way is to set the input encoding to UTF8, and the font encoding to T1, which supports some extended font sets. Just put the two lines in the preamble,
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
then you can directly input almost all Latin symbols, including those accent ones. Finally, just by conducting the normal LaTex compilation, all symbols will appear as how they should look like. You might find the UTF8 symbols look a bit different from the one generated with the LaTex command. In my opinion, which style is preferred is really a personal taste, the important thing is that they can be displayed correctly.
没有评论:
发表评论