1

We suppose to have this minimal compilable code:

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\usepackage{accents}
\usepackage{bm}

\begin{document}
$\accentset{\overset{\overset{\sim}{\square}}{c}}{\bm{\mathrm{x}}}(t)$
\end{document}

enter image description here

Inside the first curly bracket \overset{\overset{\sim}{\square}}{c} of the command \accentset I can put a castle of symbols.

Why this package give me several errors when I use \tilde or \dot?

What characters should be deleted?

MWE that it does not compile:

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\usepackage{accents}
\usepackage{bm}

\begin{document}
$\accentset{\overset{\overset{\tilde}{\dot}}{\sim}}{\bm{\mathrm{x}}}(t)$
\end{document}

The file .log it is very long.

4
  • 2
    I'd say the short answer is that \tilde and \dot are not symbols, but macros which take an argument. That's doomed.
    – campa
    Jun 3, 2021 at 20:07
  • @campa Very kind campa. I didn't know about this. Hence these fake symbols not can never be used or is there a shortcut or a trick?
    – Sebastiano
    Jun 3, 2021 at 20:10
  • 1
    As \tilde and \dot are already accents, I think the syntax should be $ \tilde{\dot{\accentset{\sim}{\mathbf{x}}}} $ (as I don't see any difference between \bm{\mathrm{…}} and \mathbf{…}, I replaced it with latter.
    – Bernard
    Jun 3, 2021 at 20:18
  • @Bernard Very kind Bernard yes, you're right. I have seen that the manual that it is equal to your comment. +1.
    – Sebastiano
    Jun 3, 2021 at 20:20

2 Answers 2

3

It isn't clear what the intention of \overset is here. There are two accent mechanisms involved, commands that are defined as accents, that take an argument, like \tilde. Then commands constructed with \accentset that can be used with a symbol to fake an accent taking the symbol and placing it over the base. So to stack \tilde, dot and \sim you just need

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\usepackage{accents}
\usepackage{bm}

\begin{document}
$\tilde{\dot{\accentset{\sim}{\bm{\mathrm{x}}}}}(t)$
\end{document}

Although \bm{\mathrm{x}} could more easily (and efficiently) be written as \mathbf{x}

2
  • Great David. Of course for the \mathbf{x}. I am lazy at this period with my mind :-((((. Hence always the \tilde must be to external? I.e. I must to start to \tilde{.....} to have not the mistakes?
    – Sebastiano
    Jun 3, 2021 at 22:12
  • 1
    @Sebastiano I don't understand your question, you only need to start with tilde if that is the top accent. they just get stacked in the order you give Jun 3, 2021 at 22:14
2

You can overcome the compilation errors by using the \mathchars associated with \tilde and \dot.

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\usepackage{accents}
\usepackage{bm}
\begin{document}
$\accentset{\overset{\overset{\mathchar"307E}{\mathchar"05F}}{\sim}}{\bm{\mathrm{x}}}(t)$
\end{document}

enter image description here

However, given the poor spacing and sizing, one might consider a stack alternative:

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\usepackage[usestackEOL]{stackengine}
\stackMath
\usepackage{bm}
\begin{document}
$\setstackgap{S}{-5pt}
\stackon[-1pt]{\bm{\mathrm{x}}}
  {\Shortstack{\mathchar"307E\\\mathchar"05F\\\scriptscriptstyle\sim}}(t)$
\end{document}

enter image description here

1
  • Welcome to the new answer. My best regards and thankkkkkkkkkk youuuuu.
    – Sebastiano
    Jun 4, 2021 at 12:01

You must log in to answer this question.

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