9

I need to write something like \slashed{\mathcal{\mathring{S}}}. I tried to write it in several orders, but none of them gave me the wanted result. I found out that I have to write \slashed{\mathcal{S}} to get correct result, but I wasn't successful in adding \mathring to it. I use package "slashed" for \slashed{S}. Thank you.

\documentclass[12pt, a4paper]{article}
\usepackage{slashed}

\begin{document}
$\slashed{\mathcal{S}}$
%$\slashed{\mathring{\mathcal{S}}}$
$\mathring{\slashed{\mathcal{S}}}$
\end{document}

The second order doesn't work, I get 3 errors on it, that suggest that I have forgotten to type } or so, but I think it is just a consequence of some other error, maybe wrong order. Sorry, I am not very experienced in understanding errors like this.

2
  • You should do \mathring{\mathcal{S}} in any case. The reverse is wrong and if it works is just by chance.
    – egreg
    Feb 2 '15 at 21:11
  • OK, thank you. You are right, \mathcal{\mathring{S}} doesn't work, the result is just S with some strange lines at it.
    – Suzie
    Feb 2 '15 at 21:18
6

If you want the appearance to be exactly like \slashed, you can use the following hack that actually prints the character twice on top of itself: once with the ring, and once with the slash.

\documentclass{article}    
\usepackage{slashed,mathtools}

\newcommand{\slashedring}[1]{\slashed{#1}\mathllap{\mathring{#1}}}

\begin{document}

$\slashed{\mathcal{S}} \slashedring{\mathcal{S}} \mathring{\mathcal{S}}$

\end{document}

Screenshot of the example

2
  • This works very nicely, the only thing I don't like about it is that my \slashedring{S} looks thick compared to the other \slashed{S} and \mathring{S}. That might be confusing since it is supposed to be four-vector and only normal (three-) vectors are usually written as bold.
    – Suzie
    Mar 3 '15 at 15:36
  • I think it's only when viewed on screen (at small scale), it should look good when printed. Mar 3 '15 at 21:23
5

\slashed really only works with single glyphs, may be you could use the cancel package for your purposes:

Sample output

\documentclass{article}

\usepackage{slashed,cancel}

\begin{document}

\(  \mathcal S + \slashed{\mathcal S} + \cancel{\mathcal S} \)

\( \mathring{\mathcal S} + \mathring{\slashed{\mathcal S}} +
\cancel{\mathring{\mathcal S}} + \cancel{\mathring{\mathcal S}\mkern1mu} \)

\end{document}
5
  • Thank you for the answer. If there's no other way, I will have to use that package. But that would be very unpleasant, since the slashes of \slashed and \cancel have different slopes, and I used in my whole document the "slashed" version...
    – Suzie
    Feb 2 '15 at 20:59
  • 1
    what happens with \slashed{\mathring{\mathcal S}} or isn't that arrangement possible? Feb 2 '15 at 21:09
  • @barbarabeeton: Please, see the edited question or try to run the code. Thank you.
    – Suzie
    Feb 2 '15 at 21:27
  • thanks for edit. i'm stuck away from a tex system because of snow, so i can't check at the moment. Feb 2 '15 at 21:37
  • 1
    @Suzie If you go for this solution you can always remove the "slashed" package and add \newcommand{\slashed}[1]{\cancel{#1}} to make everything look the same without having to switch everywhere :) Feb 3 '15 at 0:03
4

This doesn't work good (but neither slashed does) for all calligraphic letters, but for the S it seems good:

\documentclass[12pt, a4paper]{article}
\usepackage{slashed}

\newcommand{\slashedring}[1]{{%
  \ooalign{%
    $\mathring{\mathcal{#1}}$\cr
    \hidewidth\raisebox{.2ex}{/}\hidewidth\cr
  }%
}}

\begin{document}
$\slashed{\mathcal{S}}$
$\slashedring{S}\slashedring{R}$
\end{document}

enter image description here

If needed also in subscripts/superscripts, the simplest thing is to do

\usepackage{amsmath}
\newcommand{\slashedring}[1]{\text{%
  \ooalign{%
    $\mathring{\mathcal{#1}}$\cr
    \hidewidth\raisebox{.2ex}{/}\hidewidth\cr
  }%
}}
2
  • This doesn't work in script or scriptscript sizes.
    – wipet
    Feb 3 '15 at 7:47
  • @wipet It's very easy to add it, if needed.
    – egreg
    Feb 3 '15 at 7:51
1

Here is \slashring[h-offset]{letter} using stacks. It is set up to work in all mathstyles, though the horizontal offset should be specified in a unit that scales with the local mathstyle such as \LMpt or \LMex provided by the scalerel package. The -2.3\LMpt in the definition specifies the vertical offset of the \mathring and can be altered to suit.

\documentclass[12pt, a4paper]{article}
\usepackage{scalerel,stackengine}
\newcommand\slashring[2][.4\LMex]{\ThisStyle{\ensurestackMath{%
  \stackinset{c}{#1}{t}{-2.3\LMpt}{\SavedStyle\mathring{}}{%
    \stackinset{c}{}{c}{}{\SavedStyle/}{\SavedStyle\mathcal{#2}}}}}}
\begin{document}
$\slashring{S} \slashring[0pt]{P}\slashring[2.5\LMpt]{J}$\par
$\scriptstyle\slashring{S} \slashring[0pt]{P}\slashring[2.5\LMpt]{J}$\par
$\scriptscriptstyle\slashring{S} \slashring[0pt]{P}\slashring[2.5\LMpt]{J}$
\end{document}

enter image description here

If one wanted to avoid having to type in the customized horizontal offset for each letter, the "kerns" could be pretabulated:

\documentclass[12pt, a4paper]{article}
\usepackage{scalerel,stackengine}
\newcommand\SlashRing[2]{\ThisStyle{\ensurestackMath{%
  \stackinset{c}{#1}{t}{-2.3\LMpt}{\SavedStyle\mathring{}}{%
    \stackinset{c}{}{c}{}{\SavedStyle/}{\SavedStyle\mathcal{#2}}}}}}
\newcommand\slashring[1]{%
  \def\HorizontalOffset{.4\LMex}%
  \ifx P#1\def\Horizontaloffset{0pt}\else
  \ifx J#1\def\Horizontaloffset{2.5\LMpt}\else
  \fi\fi%
  \SlashRing{\HorizontalOffset}{#1}%
}
\begin{document}
                  $\slashring{S} \slashring{P} \slashring{J}$\par
      $\scriptstyle\slashring{S} \slashring{P} \slashring{J}$\par
$\scriptscriptstyle\slashring{S} \slashring{P} \slashring{J}$
\end{document}
0

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.