Instead of using the accent and ligature commands described above, you can use the inputenc package and enter the character directly, but you must ensure you match the encoding with that used by your text editor. For example, this book uses UTF8 encoding so I have loaded the inputenc package in the preamble with the utf8 option:
Returning to an earlier example, I can directly enter the Unicode character (U+0153) for the lower case œ ligature:
Note that if you are collaborating on a document and you want to use this approach, you must ensure that all your co-authors use the same input encoding. For example, suppose you decide to use ISO Latin 1 encoding (latin1 option):
but your co-author is using a UTF-8 editor and types:
where ï is the Unicode character U+00EF. UTF-8 characters use one to four 8-bit bytes whereas ISO Latin 1 uses an 8-bit single-byte character set. So the U+00EF binary sequence is interpreted by ISO Latin 1 encoding as two characters: Ã (0xC3) and ¯ (0xAF). Therefore the resulting PDF file will end up containing the rather odd looking:
(If you are using TeXWorks, you can set your preferred encoding using Edit→Preferences and select the “Editor” tab where there is an “Encoding” setting. Make sure this setting matches the inputenc option you use in your document.)
Exercise 4: Using Special Characters
Start a new file in TeXworks, and see if you can write the source code to create the output below. (Ignore any hyphenation that may appear below, LaTeX does that automatically where necessary, see §2.14. Hyphenation. Likewise, ignore where the line breaks occur, except for the paragraph break.) Choose whether you want to use the inputenc package or if you want to use commands such as
\c, but in either case you need to be careful of the special characters.
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).
Last modified: 2017-02-06.
The free resources on this site are funded by book sales, not by adverts. If you would like to help keep this site free of annoying third-party ads, please consider buying a book.