8

The ucs package (formerly aliased to unicode), provides support for Unicode as a input format, as I understand it.

Under what circumstances should I be using that package, and unicode symbols?

to my knowledge there has been methods for getting most (all?) symbols and accent into TeX since long before Unicode was devised.

Am I better of using the TeX facilities for that when possible, and unicode when not?

Should I actually be using ucs all the time?

  • 1
    Perhaps you should read this question. I've always heard it is best to avoid this package, so I always did without ever exploring why. And now I often use LuaTeX as the engine, which uses UTF-8 by default. – jon Sep 14 '14 at 03:41
  • 1
    In the past a use case was when Greek input was needed; but in the most recent TeX distributions the problem has been solved and ucs is not needed any more for Greek and, by the way, support of Greek with \usepackage[utf8]{inputenc} is better than it used to be with \usepackage[utf8x]{inputenc}. – egreg Sep 14 '14 at 13:16

1 Answers1

9

In the past a use case for ucs was when Greek input was needed; since TeX Live 2013 the situation has changed and full support for Greek input (monotonic and polytonic) is available with

\usepackage[utf8]{inputenc}

provided the greek or polutonikogreek is passed to babel.

Note that the package ucs and the utf8x options to inputenc are not compatible with biblatex and, while the ucs package has a new maintainer, it doesn't seem to be under active development (and it has several shortcomings, like the infamous \PrerenderUnicode).

In case some Unicode character is not available for rendering, you can always define a substitute for it with

\DeclareUnicodeCharacter{XXXX}{<code>}

where U+XXXX is the Unicode code point; alternatively,

\usepackage{newunicodechar}
\newunicodechar{<character>}{<code>}

does the same, not requiring to hunt through the code points.

egreg
  • 1,121,712
  • What is <code> in your example? Could you please give a concrete example, perhaps with the or or or `` UTF-8 characters appearing literally in some generated UTF-8 LaTeX file. Thanks – Basile Starynkevitch Jul 05 '19 at 13:37
  • @BasileStarynkevitch <code> stands for any legal LaTeX code; it can contain Unicode characters, provided they have been given a similar definition at call time. Usually it's something like \DeclareUnicodeCharacter{2122}{\texttrademark}, so when LaTeX finds it substitutes \texttrademark. – egreg Jul 05 '19 at 13:40
  • You have confused me even more... – Basile Starynkevitch Jul 05 '19 at 13:40
  • How could I use \texttt{↳} with that character literally appearing in the *.tex source file ? – Basile Starynkevitch Jul 05 '19 at 13:46
  • @BasileStarynkevitch You find a font which has the glyph, or build it with picture mode and add \DeclareUnicodeCharacter{21B3}{<the code that produces the symbol>} – egreg Jul 05 '19 at 13:54