# Is there a LaTeX equivalent symbol to Unicode 'SYMBOL FOR NULL' [duplicate]

I'm looking for a LaTeX symbol that has the letters 'NUL' in a single character width. It's a pretty representation for what's often entered as \0 in C-derived programming languages as the string termination character. In Unicode, this is represented as code point U+2400.

To be clear, I'm not looking for:

• \varnothing
• \emptyset
• and definitely not \phi!

I should also be clear that I'm looking for a representation of a control character, to print or display it rather than have it perform its intended function as a control character.

As a strongly related side question, assume I know the code point of a Unicode glyph. Is there a way to determine what the glyph's equivalent is in LaTeX? I'm relatively new to LaTeX typesetting, so I haven't yet found such a reference.

## marked as duplicate by user13907, Stefan Pinnow, Mico, darthbith, SeamusApr 15 '16 at 11:45

• – jon Apr 15 '16 at 4:58
• – Peter Grill Apr 15 '16 at 9:12
• I'm sure there's another more recent duplicate as well, but I can't find it. – Chris H Apr 15 '16 at 10:29

If you are on pdflatex, you can use the ascii package:

\documentclass{article}
\usepackage{ascii}

\begin{document}

Is this it? \NUL

\end{document}


You can also input the symbol directly as Unicode, so the code can be portable to XeLaTeX or LuaLaTeX.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{ascii}
\usepackage{newunicodechar}

\newunicodechar{␀}{\NUL}

\begin{document}

Is this it? ␀

\end{document}


With XeLaTeX or LuaLaTeX and fontspec, find a font with the character and then do like

\documentclass{article}
\usepackage{fontspec}
\usepackage{newunicodechar}

\newfontface{\ASCIICONTROLS}{FreeMono} % <--- or another font
\newunicodechar{␀}{{\ASCIICONTROLS ␀}}

\begin{document}

Is this it? ␀

\end{document}


If a TeX engine is used with Unicode/OpenType font support, then it is just a matter to find a font that contains the Unicode code point U+2400, e.g.:

% lualatex or xelatex
\documentclass{article}
\usepackage{fontspec}
\begin{document}
\def\test#1{#1:&\fontspec{#1}\symbol{"2400}\\}
\begin{tabular}{l@{ }l}
\test{FreeMono}
\test{FreeSans}
\test{FreeSerif}
\test{Quivira}% http://www.quivira-font.com/
\end{tabular}
\end{document}


If you wanted it to conform to the current font, both in size and style, you could build your own:

\documentclass[a2]{article}
\usepackage{stackengine,scalerel}
\newcommand\NUL{\scalerel*{$\Shortstack[l]{N \phantom{N}U \phantom{NU}L}$}{X}}
\begin{document}
\LARGE
This is \NUL

\normalsize
This is \NUL

\itshape
This is \NUL

\upshape\ttfamily
This is \NUL

\end{document}


If one wanted the symbol always in bold, for clarity, then

\newcommand\NUL{\scalerel*{$\bfseries\Shortstack[l]{N \phantom{N}U \phantom{NU}L}$}{X}}


would remedy that: