3

I have tried to create a newcommand to shift the calligraphic M \mathcal{M} some points to the left with several things along these lines:

\newcommand{\smathcal}[1]{\hspace{-5pt}\mathcal}

However, all I try either delivers an error or does not do what I expect. Could anybody please help me get the right command to achieve what I need?

See a MWE:

\documentclass[a4paper]{scrartcl}
\newcommand{\smathcal}[1]{\hspace*{-5pt}\mathcal}
\begin{document}
$\smathcal{M}$
\end{document}

Thank you all in advance very much for your time

6
  • 1
    Try using \hspace*{} instead of \hspace{}. While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. May 21, 2018 at 23:29
  • Thank you very much for your comment. I already added a MWE (see my original answer). I also tried the solution you suggested, which unfortunately did not work.
    – EoDmnFOr3q
    May 21, 2018 at 23:35
  • 1
    I have it in my head that one should use \kern for this sort of thing, but I don't actually remember why.
    – zwol
    May 22, 2018 at 4:54
  • 1
    Why -5pt? You probably are doing some specific logo or something similar and you want it to adapt to the surrounding conditions, so a relative unit such as em or mu should be used.
    – egreg
    May 22, 2018 at 9:15
  • 1
    not explicitly explained in the answer, but syntax of command is corected ... when you use [1] to indicate an argument, you have to either have #1 in the expansion, or expect that the next token read after the command will vanish from the output. May 22, 2018 at 21:29

1 Answer 1

3

Using \hspace*{} instead of \hspace{}, which is ignored at the start of a line, does the trick:

enter image description here

Notes:

  • I added the \usepackage{showframe} so that one can see the effect.

  • You were also missing the #1 in the \newcommand.

Code:

\documentclass[a4paper]{scrartcl}
\usepackage{showframe}

\newcommand{\smathcal}[1]{\hspace*{-5pt}\mathcal{#1}}
\begin{document}
\noindent
$\mathcal{M}$

\noindent
$\smathcal{M}$

\end{document}

You must log in to answer this question.

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