[Tex/LaTex] Difference between \square{} and \square

math-modesymbols

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:

\documentclass{article} 

\usepackage[amssymb]{SIunits}

\begin{document}

$\square$

\end{document}

Here's what you see in the .log when you compile the above document:

Option `amssymb' provided! 
Command \square redefined by SIunits package!

From the SIunits documentation about the amssymb package option:

This option redefines the amssymb command \square to get the desired SIunits definition of the command. Note: When using this option, the amssymb command \square can not be used.

The redefinition changes \square from a symbol into

\renewcommand{\square}[1]{\power{#1}{2}}

which represents the square - x2 - of a number.


If you still want to use \square from amssymb, SIunits provides the squaren package option, that allows you to use \squaren instead of \square for siunits' squaring. That is, \square still retains its original definition of a square under amssymb.

The suggestion moving forward would be to use the more modern siunitx package which provides backwards compatibility with SIunits. siunitx is under development while development of SIunits has stalled since 2007 (in lieu of siunitx).

Related Question