Currently, I'm representing second and fourth order tensor with this (taken from someone, and i don't really get how it works):

    % tensor 2:
    %tensor 4:
    \newcommand{\tenq}[1]{\tend{\tend #1}\vphantom{#1}}

Which looks like this: tensors

I very much don't like the result: boldface is strange, with scales badly, there is too much spacing for the fourth order tensor... I found the untertilde package, with looks more robust for second order, but i cannot see how to make 4th order from it. I also found this topic, bold widetilde, which doe not adress symbol stacking for 4th order.

Is there a simple elegant way to do? My main concern here is consistant boldface for the tilde and the letter, and proper vertical spacing of the 4th order.


  • Can you clarify what you want: everything bold, nothing bold,...? \oalign is a plain TeX command for building minature tables, used for stacking symbols. \crcr indicates a newline. \hidewdith...\hidewidth disguises the width of the intervening material. Feb 22, 2015 at 15:48

3 Answers 3


Here I use stacks to recursively place \sim under the argument, based on the value of the optional argument. In the definition, the [1pt] is the under-gap from the argument and the [0pt] is the vertical separation between \sim characters in a multi-stack. These values can be altered to suit (including being made negative).

I have not used any bold font for the tensor itself, though it could be added, if desired, to the definition, or at time of invocation.

The specification of \def\useanchorwidth{T} says to ignore the width of the \sim underset in setting the horizontal spacing. The only time that could be an issue is if you, for example, used adjacent invocations on narrow arguments, e.g., \tenq[2]{i}\tenq[3]{j}. While the \useanchorwidth line could be removed, in which case \tenq with narrow arguments would always take up at least the width of a \scriptscriptstyle\sim, my first step would instead be to manually add \, space on those very rare occasions when needed.



enter image description here


If you like the first one, you can use the same definition for \tenq but using \approx instead of \sim.

Also use \bm from the same package instead of \boldmath.




% tensor 2:
%tensor 4:




enter image description here

  • I'd put \m@th into the $...$ to remove any non-zero \mathsurround. Feb 22, 2015 at 20:10
  • thanks for this answer! Yours and Steven's are very much ok, but I'll accept Steven's for consistancy of the tilde notation and modularity.
    – Napseis
    Feb 23, 2015 at 9:04

Just for fun.


% creates a tilde which slightly overlaps what's above and below, centered in a space  \fillwidth wide
\newcommand{\flatsim}{\hbox to \fillwidth{\hfil\raisebox{0pt}[.05ex][.05ex]{$\scriptscriptstyle\bm{\sim}$}\hfil}}



triple tilde

You must log in to answer this question.

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