7

It seems like there is simply no way to have Latex include any generic Unicode characters you'd like in a PDF, and the solutions to this question are too complicated.

Is there any simple way to include upside-down Unicode text such as ˙ʎɐpoʇ ʎddɐɥ ɯɐ I ?

EDIT Compiling with XeLatex seems to work fine for that particular example, but later in the document I am hit with

! Package inputenc Error: Unicode char \u8:ñosd not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.173 ...d on reading \emph{Cien años de soledad}
                                                   and ...

I don't know how I was able to put that ñ there without issues before...

EDIT Turns out CJKutf8 was the culprit package that introduced inputenc

2
  • or.. just turn your head upside down
    – user68908
    Dec 12, 2014 at 17:59
  • You can't use inputenc with LuaLaTeX or XeLaTeX. Dec 12, 2014 at 20:04

2 Answers 2

17

You can input any Unicode characters directly and compile them to PDF simply by using LuaLaTeX or XeLaTeX to compile (e.g., lualatex file in the terminal). You can also rotate text using the rotating package. With the turn environment you can rotate text to any desired degree (see texdoc rotating).

The source must be encoded UTF-8, you must compile with LuaLaTeX or XeLaTeX, and you must use fontspec or an appropriate package to select a font that includes the Unicode characters you need.

% compile with LuaLaTeX or XeLaTeX
\documentclass{article}
\usepackage{libertine}
\usepackage{rotating}

\newcommand{\unicodetext}{Greek μετανοεῖτε, accents \emph{esdrújulos}, pictograms ☹}

\begin{document}

This is UTF-8 encoded text with Unicode characters input directly:

\unicodetext

\begin{turn}{180}
\unicodetext
\end{turn}

\bigskip
This is text input upside-down:
˙ʎɐpoʇ ʎddɐɥ ɯɐ I ?

\end{document}

enter image description here

7
  • Hm thanks, that text in particular works fine, but then later in the document I am hit with Package inputenc Error: Unicode char \u8:ñosd not set up for use with LaTeX. when I try to put l.173 ...d on reading \emph{Cien años de soledad} and.... Any ideas? Dec 12, 2014 at 19:32
  • If it matters any, I am using TeXworks on Windows Dec 12, 2014 at 19:36
  • @wrongusername If you compile with the LuaLaTeX or XeLaTeX engines, you should not get this error. I don't know Windows or TeXworks, but you should be able to adjust which engine you use to compile in the application's settings. It may be instructive to compile it from the command line lualatex file to make sure there is no error with your installation. Dec 12, 2014 at 20:03
  • Ah thanks, turns out I was using a package that automatically includes it! Dec 13, 2014 at 3:36
  • For ॐ it is not working. I am getting a box with x mark in it as the output. Jun 4, 2023 at 17:06
17

If you use a unicode based tex such as xelatex or luatex it works naturally:

enter image description here

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Arial}
\begin{document}
˙ʎɐpoʇ ʎddɐɥ ɯɐ I ?
\end{document}
7
  • 3
    david -- you are evil. Dec 12, 2014 at 13:32
  • @barbarabeeton hey It was the OP's text! Dec 12, 2014 at 13:37
  • 3
    but you cheated and used "p" instead of "d", and vice versa. "o" is symmetrical. and "I" gave you away -- it should have an ascender, not a descender. Dec 12, 2014 at 13:43
  • 2
    @barbarabeeton I didn't do anything: I cut and pasted the text from the question Dec 12, 2014 at 13:44
  • Can somebody be so kind and explain, how the OP fabricated this line: ˙ʎɐpoʇ ʎddɐɥ ɯɐ I I notice, there is a trick, because the "I" has a descender. But what is the trick? It works without backticks as well: ˙ʎɐpoʇ ʎddɐɥ ɯɐ I
    – Keks Dose
    Dec 12, 2014 at 20:53

You must log in to answer this question.

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