For various reasons, I'm stuck with (dvi)latex and inputencoding latin1. I still want to enter unicode codepoints (I have the hex/decimal numbers ready).

I have seen https://tex.stackexchange.com/a/32514/24158 but this does not seem to work for me:


I just get some ! Bad character code (324)..

2 Answers 2


\symbol{324} can only take values in the 8-bit range and refers directly to the underlying font not going through latex's encoding mechanisms.

Any symbol for which there is support in \usepackage[utf8]{inputenc} will have a mapping from the Unicode number to a TeX definition in the utf8 files in the base distribution, or you can directly code something. so Unicode 324 is LATIN SMALL LETTER N WITH ACUTE so you can use \'{n} which corresponds to this line in utf8enc.dfu in the base latex distribution


decimal 324 being hex 144

If you don't want to look up the definitions in the file, you can load the file with a local definition that removes the utf8 decoding part:

  \expandafter\def\csname ut-#1\endcsname{#2}}
\def\UseUnicodeCharacter#1{\csname ut-#1\endcsname}





enter image description here

  • The interesting question is: Can I use the tables in the base distribution? Like how can I use that \DeclareUnicodeCharacter{0144}{\@tabacckludge'n} and have something like a \InsertUnicode{0144} which goes through those tables and finally does the \@tabacckludge'n? Using \'{n} is an option for individual characters, but I would prefer to be able to enter unicode codepoints, because those are in my sources.
    – Elrond
    Apr 15, 2013 at 15:44
  • @Elrond see updated code Apr 15, 2013 at 15:56

Input the relevant file, for instance t1enc.dfu for the characters obtainable in the T1 encoding. Just assign a suitable definition to \DeclareUnicodeCharacter.

    \expandafter\gdef\csname uni\number"##1\endcsname
\newcommand\unisymbol[1]{\csname uni\number#1\endcsname}


\unisymbol{324} \unisymbol{"0144} \unisymbol{"0428}

This will print

ń ń Ш

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .