1

I'm interested in the tilde symbol used for math accents. In the source2e it is defined as follows:

471 \DeclareMathAccent{\tilde}{\mathalpha}{operators}{"7E}

I want to mess around with the symbol alone. For example rotate, translate, scale, etc. (n.b. the symbol is not the same symbol as \sim). Besides doing something funky like using \raisebox on an empty tilde to get the symbol to render on the baseline, is there a way to call on the symbol alone?

I have tried creating a custom "\mytilde"

\DeclareMathSymbol {\mytilde} {\mathalpha} {operators} {"7E}

but the symbol is still floating above the baseline. Any advice is appreciated.

If my suspicions are correct, then the symbol may be constructed to have the "floating" behavior, and that I may have to resort to the funky method.

  • The fact that $\tilde. \tilde x$ both place the \tilde no lower than $\mytilde$ tells you that the space is built into the glyph itself. Funk: \newcommand\bltilde{\setbox0=\hbox{\raisebox{-1.3ex}{$\mytilde$}}\dp0=0pt\relax\box0} – Steven B. Segletes Aug 26 at 10:39
  • @StevenB.Segletes I consider your comment an answer to my question. I also really appreciate the \newcommand you proposed. – Alberto Takase Aug 26 at 10:50
  • I have edited my answer to automatically work in the smaller math styles. – Steven B. Segletes Aug 26 at 10:55
3

Yes, the space under the tilde is built into the underlying glyph, so some funk is required. Here, by not only applying a \raisebox, but by putting the result in a box, I can truncate the underhanging space that would otherwise be left over from the \raisebox.

\documentclass{article}
%\DeclareMathAccent{\tilde}{\mathalpha}{operators}{"7E}
\DeclareMathSymbol {\mytilde} {\mathalpha} {operators} {"7E}
\newcommand\bltilde{\setbox0=\hbox{\raisebox{-1.3ex}{$\mytilde$}}\dp0=0pt\relax\box0}
\begin{document}
\fboxsep=-\fboxrule
\fbox{\bltilde} x\bltilde
\end{document}

enter image description here

If it is needed to operate in the smaller math styles:

\documentclass{article}
\usepackage{scalerel}
%\DeclareMathAccent{\tilde}{\mathalpha}{operators}{"7E}
\DeclareMathSymbol {\mytilde} {\mathalpha} {operators} {"7E}
\newcommand\bltilde{\ThisStyle{\setbox0=\hbox{\raisebox{-1.3\LMex}{%
  $\SavedStyle\mytilde$}}\dp0=0pt\relax\box0}}
\begin{document}
\fboxrule=.1pt
\fboxsep=-\fboxrule
\fbox{\bltilde} x\bltilde

$x\bltilde \scriptstyle x\bltilde \scriptscriptstyle x\bltilde$
\end{document}

enter image description here

  • 1
    I will take the time to digest the technique employed here. I only know about \mathpalette to take the environment into account. Your answer truly expanded my understanding! – Alberto Takase Aug 26 at 10:59
  • @AlbertoTakase \ThisStyle{...\SavedStyle...} is my way of importing the current math style into places where it would otherwise be lost (e.g., inside boxes). Think of it as a compact syntax for \mathchoice. See tex.stackexchange.com/questions/43978/proper-use-of-mathchoice/… – Steven B. Segletes Aug 26 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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