TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

What are the proper latex inputs for typesetting the bare d'Alembertian operator, and the d'Alembertian operator with either a tilde or a hat or a bar on top in a document prepared using classicthesis documentclass? I understand that the package eulervm is used in classicthesis.

share|improve this question

marked as duplicate by Jesse, Heiko Oberdiek, egreg, Ruben, moewe Aug 19 '15 at 11:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
And how exactly does that operator look like? Can you provide a link or an image showing the operator? – Gonzalo Medina May 7 '14 at 12:24
    
See here for more inspiration: tex.stackexchange.com/a/20513 – LaRiFaRi May 7 '14 at 13:46
up vote 4 down vote accepted

First of all lets have a look on the possibilities we are having. The MWE needs LuaLaTeX for the \mdlgwhtsquare command, but I will propose solutions for pdfLaTeX and LuaLaTeX later on.

% arara: lualatex

\documentclass{book}
\usepackage{classicthesis}
\usepackage{mathtools, amssymb} % !!! Carefull, incompatibility found here, please see below
\usepackage{unicode-math} % !!! Carefull, incompatibility found here, please see below
\newcommand{\test}[1]{#1 \tilde{#1} \widehat{#1} \hat{#1} \bar{#1} \overbar{#1} \overline{#1}\nabla \Delta}
\begin{document}
Latin Modern Math:
\begin{itemize}
\item $\test{\Box}$ \verb+\Box+ % !!! Carefull, incompatibility found here, please see below
\item $\test{\square}$ \verb+\square+ % !!! Carefull, incompatibility found here, please see below
\item $\test{\mdlgwhtsquare}$ \verb+\mdlgwhtsquare+ 
\end{itemize}
%%%%%%
\setmathfont{Asana-math.otf}

Asana Math:
\begin{itemize}
\item $\test{\Box}$ \verb+\Box+ 
\item $\test{\square}$ \verb+\square+ 
\item $\test{\mdlgwhtsquare}$ \verb+\mdlgwhtsquare+ 
\end{itemize}
%%%%%%
\setmathfont{Xits-math.otf}

XITS Math
\begin{itemize}
\item $\test{\Box}$ \verb+\Box+ 
\item $\test{\square}$ \verb+\square+ 
\item $\test{\mdlgwhtsquare}$ \verb+\mdlgwhtsquare+ 
\end{itemize}    
\end{document}

enter image description here enter image description here

The last version, taken from unicode-math results in a good kerning for all solutions. So using LuaLaTeX you could do this:

% arara: lualatex

\documentclass{book}
\usepackage{classicthesis}
\usepackage{unicode-math}
\usepackage{xifthen}
\newcommand{\dalembert}[1][]{\ifthenelse{\isempty{#1}}{\mdlgwhtsquare}{#1\mdlgwhtsquare}}
\begin{document}
$\dalembert \dalembert[\tilde] \dalembert[\hat] \dalembert[\bar]$
\end{document}

which yields the following image for Latin Modern Math:

enter image description here

For pdfLaTeX it can just be achieved like this (I just found out, that the kerning issue above was not a problem with pdfLaTeX. You can read here that unicode-math and amssymb are not compatible):

% arara: pdflatex

\documentclass{book}
\usepackage{classicthesis}
\usepackage{amssymb}
\usepackage{xifthen}
\newcommand{\dalembert}[1][]{\ifthenelse{\isempty{#1}}{\Box}{#1\Box}}

\begin{document}
$\dalembert \dalembert[\tilde] \dalembert[\hat] \dalembert[\bar]$
\end{document}

Which yields:

enter image description here

share|improve this answer

The most common notation seems to be a square. So I suggest to declare it as a math operator, to ensure proper spacing in formulae. I don't know if eulervm has a Box command. You can find it in latexsym, amsfonts, amssymb,mathabx, wasysymb, &c.

\documentclass[12pt,a5paper]{article}

\usepackage[utf8]{inputenc}
\usepackage{amssymb}

\usepackage{esdiff}
\usepackage{mathtools}
\DeclareMathOperator{\dalembert}{\Box}

\begin{document}

\begin{align*}
  \dalembert (f)  & = \frac{1}{c² } \diffp[2]{f}{t} -  \diffp[2]{f}{x} -  \diffp[2]{f}{y}  -  \diffp[2]{f}{z} \\
\widehat\dalembert²(f) &  =  \dots
  \end{align*}

\end{document}

enter image description here

share|improve this answer
    
you seem to have entered this answer twice. you should delete one of them (after checking to see if one is correct and one isn't, of course). – barbara beeton May 7 '14 at 13:29
    
@barbara beeton: Oh yes, thanks! I modified my answer, due to a typo, and thought it was only modified, not answered twice. – Bernard May 7 '14 at 13:42

Since the D'Alembert Operator is just a box I don't think the eulervm package should modify it at all. Without a MWE I can not test it in context, but I'm pretty sure that these

$\Box = \partial^{\mu}\partial_{\mu}$
$\hat{\Box}$
$\tilde{\Box}$

work as expected.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.