Fonts & Character Setsdifference between inputenc and fontenc

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
Cottonshirt
Posts: 9
Joined: Thu Nov 10, 2016 11:04 pm

difference between inputenc and fontenc

Post by Cottonshirt »

good morning,

I have for some time been trying to figure out how to get a specific diacritic into my Latex documents.

the one I want is this: ð
which I normally type using Alt-0240

I already use a large number of other diacritics on a regular basis, such as ö, and ä, ü, ú, Å, etc.

today I came across a big list of such special symbols and characters that says that this one particular character is "Not available in the OT1 font encoding. Use the fontenc package to select an alternate font encoding, such as T1."

the character can then be produced using \dh

up to now pretty much every LaTex document I have produced has \usepackage[utf8]{inputenc} in the preamble. what I can't figure out is whether I have \usepackage[T1]{fontenc} as well as or instead of.

and the particular part of this that confuses me is that I have always assumed that inputenc was an abbreviation of "input encoding" which would mean that fontenc is an abbreviation of "font encoding" and in my rather limited understanding of how Latex actually gets characters onto my screen, font encoding and input encoding are different things.

so that if I change from using inputenc to fontenc, do I have to do anything to get the font that I was previously using (by default) which I like and would prefer to continue to use even though I have no idea what it is, or how to find out.

if someone could please clarify any of this that would be very much appreciated.

many thanks,

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

difference between inputenc and fontenc

Post by rais »

Good morning,

in short: inputenc tells LaTeX, which encoding was used by your text editor to create the input (the .tex file), fontenc tells LaTeX which encoding to use for the output.
For more details click on the link to the according documentation or call, e.g.,
texdoc fontenc
on your machine.
BTW: utf8 has become the standard encoding for LaTeX files, so \usepackage[utf8]{iputenc} can be omitted, if your TeX installation is recent enough (not older than 4 years).

KR
Rainer
Cottonshirt
Posts: 9
Joined: Thu Nov 10, 2016 11:04 pm

difference between inputenc and fontenc

Post by Cottonshirt »

thank you
Post Reply