I'm trying to add a square to my latex document. I'm trying to do this using the $ \square $
command. However in my latex document I get the error:
Missing } inserted
If I type $ \square{} $
, there's no error, but it looks like the output of $()^2$
.
Does anyone know how to solve this?
Here's my Preamble:
\documentclass[a4paper,12pt,numbers=noenddot]{scrreprt}
\usepackage[applemac]{}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}
\usepackage[dvips]{graphics}
\usepackage[dvips]{graphicx}
\usepackage{color}
\usepackage{longtable}
\usepackage{supertabular}
\usepackage{lscape}
\usepackage{afterpage}
\usepackage{setspace}
\usepackage{calc}
\usepackage{verbatim}
\usepackage{latexsym}
\usepackage{float,rotating}
\usepackage[justification=raggedright,singlelinecheck=false]{caption}
\usepackage{placeins}
\usepackage[ngerman]{babel}
\usepackage{bibgerm}
\usepackage{textcomp}
\usepackage{epsfig}
\usepackage{floatfig}
\usepackage{wrapfig}
\usepackage{psfrag}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{wasysym}
\usepackage[amssymb,thinspace]{SIunits}
\usepackage{enumerate}
\usepackage[version=3]{mhchem}
\usepackage{remreset}
\usepackage{stmaryrd}
\usepackage{dcolumn}
\usepackage{multirow}
\usepackage{footnpag}
\usepackage{booktabs}
\usepackage[numbers,sort]{natbib}
\usepackage{listings}
\usepackage{hyph}
\usepackage{boxit}
\begin{document}
$\square$
\end{document}
Best Answer
The following minimal example replicates the behaviour:
Here's what you see in the
.log
when you compile the above document:From the
SIunits
documentation about theamssymb
package option:The redefinition changes
\square
from a symbol intowhich represents the square - x2 - of a number.
If you still want to use
\square
fromamssymb
,SIunits
provides thesquaren
package option, that allows you to use\squaren
instead of\square
forsiunits
' squaring. That is,\square
still retains its original definition of a square underamssymb
.The suggestion moving forward would be to use the more modern
siunitx
package which provides backwards compatibility withSIunits
.siunitx
is under development while development ofSIunits
has stalled since 2007 (in lieu ofsiunitx
).