Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am calling pdfLaTeX with text entered in a web form. I would like to replace important chars not supported by LaTeX with the right LaTeX command.

How can I get a list of chars supported by LaTeX so that I can program replacements for chars which I think are important? The method should include the usepackage commands I am about to have in my document because e.g. the \usepackage[utf8]{inputenc} command is extending the list of supported chars.

I am using the TeX Live distribution, provided by the package manager of Ubuntu.

share|improve this question
    
@Stephan: A lot of chars are not directly enabled if you load inputenc e.g. the euro, but for everyone you could add a suitable definition. –  Ulrike Fischer Mar 28 '12 at 10:46
    
@UlrikeFischer Oh, wow. I didn't know that. Strange. Thanks for clarifying. I'll delete my comment. –  Stephan Lehmke Mar 28 '12 at 10:52

2 Answers 2

up vote 5 down vote accepted

With the utf8 option, inputenc loads (if existent) a configuration file called <enc>def.dfu for every output encoding declared in the document; for example, with

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

the loaded configuration file will be t1enc.dfu. It's really irrelevant whether fontenc is called before or after inputenc, but I prefer to have this "cleaner" order.

If the fontenc package is not loaded, very few Unicode points are activated, as results clearly from ot1enc.dfu.

However the list of supported Unicode characters can be extended either by declarations such as

\DeclareUnicodeCharacter{201D}{\textquotedblright}

where the hexadecimal code is given together with a suitable definition for the character, or by the similar

\usepackage{newunicodechar}
\newunicodechar{”}{\textquotedblright}

which has the advantage that one doesn't need to hunt through the code tables to find the correct number.

A rather rough way to show what a .dfu file contains is to run LaTeX on the following file

\documentclass{article}
\usepackage[T2A,TS1,T1]{fontenc}
\usepackage[utf8]{inputenc}
\parindent=0pt
\newcommand{\showdfu}[1]{%
  \section{Encoding #1}
  \begingroup\makeatletter
  \renewcommand\DeclareUnicodeCharacter[2]{%
    \par Code point: \texttt{##1}, Meaning: \texttt{\detokenize{##2}}, character: {\fontencoding{#1}\selectfont##2}}%
  \nonstopmode\lowercase{\input{#1enc.dfu}}
  \endgroup
}

\begin{document}

\showdfu{T1}
\showdfu{T2A}
\showdfu{TS1}

\end{document}

The encodings should be loaded beforehand, as shown in the example.

share|improve this answer
    
So with output encoding T1 and input encoding utf8 the resulting supported input characters will be the ASCII chars plus the Unicode chars defined in t1enc.dfu? –  Pascal Rosin Mar 29 '12 at 11:53
    
@PascalRosin Yes, that's basically what you get. A list of the characters and their "LaTeX Internal Character Representation" is available in the LaTeX companion. –  egreg Mar 29 '12 at 11:55
    
wow, that example in the last update is very helpful. Thank you! –  Pascal Rosin Mar 29 '12 at 12:19

Hava a look at The Comprehensive Latex Symbol List (164 pages) were you'll find nearly every symbol you want to set in LaTeX.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.