[Tex/LaTex] Insert unicode symbol

symbolsunicode

I need to insert a ⚓ into my latex document. (More info about the symbol can be found here)
I have tried to use some other answers here but I have not been successful, including the question Entering Unicode characters in LaTeX, but I couldn't get anything to work. I installed texlive-xetex (Should say I am using ubuntu 10.04) but that didn't like the custom document class I am using.

This is XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009/Debian)
entering extended mode
(./design.tex
! Undefined control sequence.
l.1 \documentclass
              {project}

I also tried

\usepackage[utf8]{inputenc}

and

\usepackage[utf8x]{inputenc}

but they just bombed out without an error (however they were ok for the The vorticity $ω$ is defined as $ω = ∇ × u$. text.

So anything else I can try?


Edit:
Ok so using the right command helped… (I'm relativly new to latex and never heard of xetex before!)
Martigan: I don't know what a MWE is… 🙁

So I have commented out inputenc and it runs / compiles / what ever the proper word is when I run xelatex design.tex but the ⚓ doesn't show up.

I have also just discovered that with \usepackage[utf8x]{inputenc} and using PDFLaTeX, although kile says pdflatex finished with exit code 1 , it does generate a pdf, but instead of the ⚓ it shows [U+2693]. So maybe a font issue???

Finally: I downloaded the font PLK suggested, and after extracting and renaming to unifont I can get xelatex design.tex to find the font, but it says

! Text line contains an invalid character.
l.1 ^^@
   ^^A^^@^^@^^@
! Text line contains an invalid character.
l.1 ^^@^^A
      ^^@^^@^^@
! Text line contains an invalid character.
l.1 ^^@^^A^^@
         ^^@^^@
! Text line contains an invalid character.
l.1 ^^@^^A^^@^^@
            ^^@
! Text line contains an invalid character.
l.1 ^^@^^A^^@^^@^^@

! Unable to read an entire line---bufsize=200000.

I have this in my 'preamble' (very possibly I am doing this wrong…)

\usepackage{fontspec}
\fontspec{unifont.ttf}

I tried to read the documentation on CTAN but found it a bit hard to understand…

Here is (an extract) of my doc at the moment (forgot to past the \end{document} )

Thanks for the suggestions so far.

Best Answer

You should separate input and output. If you want to print a symbol you at first need a font which contains it. If you want to use normal latex (it will work with xelatex too) you can e.g. use the dingbat font to get an anchor. If you want to use the symbol in the input you must declare it (I'm not sure if the ⚓ copy& paste correctly):

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\DeclareUnicodeCharacter{2693}{\anchor}
\usepackage{dingbat}
\begin{document}
\anchor ⚓ 
\end{document}

With xetex you can use e.g. dejavu sans (if you get the wrong glyph:make sure that you have only version of dejavu sans). Here too you can use commands/other notation if you don't want to use the symbol in the input:

\documentclass[12pt]{article}
\usepackage{fontspec}
\begin{document}
{\fontspec{DejaVu Sans Condensed} ^^^^2693 \char"2693 ⚓}
\end{document}