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
! Undefined control sequence.
l.1 \documentclass

I also tried




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 ^^@
! 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...)


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.

  • Can you add a MWE so that we can help you? Your post is not specific enough and does not give insight on the context where it went wrong. Give us a simple example of a failed experiment (that, to your knowledge, should have worked). We will try to focus on that first and find a way.
    – Martigan
    Commented Dec 7, 2011 at 14:25
  • 3
    The error is obviosly caused by running xetex instead of xelatex; but something other is needed, for example loading fontspec. However it's definitely wrong using inputenc with XeLaTeX.
    – egreg
    Commented Dec 7, 2011 at 14:28
  • Even with inputenc only a subset of unicode is understood (from what I understand). So it might be that the symbol isn't understood. And even if it is, how many fonts will have that symbol? You might be better off inserting it as a little picture?
    – Seamus
    Commented Dec 7, 2011 at 14:31
  • I have edited to try an respond to comments. Commented Dec 7, 2011 at 15:49
  • An explanation of minimal working example (MWE) is given at the linked page.
    – Stephen
    Commented Dec 7, 2011 at 18:54

2 Answers 2


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):

\anchor ⚓ 

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:

{\fontspec{DejaVu Sans Condensed} ^^^^2693 \char"2693 ⚓}
  • 2
    And you don't need to hunt for the code of ⚓: \usepackage{newunicodechar} will allow to say \newunicodechar{⚓}{\anchor} instead of using \DeclareUnicodeCharacter in the pdflatex version.
    – egreg
    Commented Dec 7, 2011 at 15:34
  • YAY! that works, thanks! Bit big though maybe... Commented Dec 7, 2011 at 15:50
  • Nothing a bit of \tiny couldn't sort out! Thanks again! Commented Dec 7, 2011 at 15:55

As others mentioned, you need to run "xelatex" and not "xetex" otherwise nothing will work (xelatex has all the macros you need like \documentclass). Secondly, inputenc is only for PDFTeX and can't be used with XeTeX - you need fontspec instead. Thirdly, try the GNU "unifont" font - it's the only free font I know which has a huge amount (30k+) of Unicode characters in it. It certainly has that character. Available in TTF format so fontspec can probably load it.


You must log in to answer this question.

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