5

What is this? I'm just trying to write '

Entry:

Enter image description here

Output:

Enter image description here

My code:

\documentclass[a4paper]{article}
\usepackage[margin=1.5cm]{geometry}
\usepackage{helvet}
\renewcommand\familydefault{\sfdefault}
\usepackage{mathastext}
\usepackage[most]{tcolorbox}
\usepackage{pgfplots,relsize}
\usepgfplotslibrary{fillbetween}

\def\h {1.3ex} % cup and cap height \def\w {1.2ex} % cup and cap width \def\lw{0.12ex} % cup and cap line width \def\sp{0.7269ex} % space before and after \newcommand{\mysymbol}[1] { \hspace{\sp} \tikz[line width=\lw,line cap=round,rotate=#1,baseline=-0.4ex] {\draw (-0.5\w,0.5\h) -- (-0.5\w,0.5\w-0.5\h) arc (-180:0:0.5\w) -- (0.5\w,0.5\h);} \hspace{\sp} } \newcommand{\mycup}{\mysymbol{0}} \newcommand{\mycap}{\mysymbol{180}} \newcommand{\mysub}{\mysymbol{270}} \newcommand{\mysup}{\mysymbol{-360}}

\begin{document}

    \begin{align*}
    p' \wedge q
    \end{align*}

\end{document}

cufcuf
  • 594
  • 4
    Can you give a bit of context, i.e., the code of the document that shows this behavior? It is definitely not normal, \documentclass{article} \begin{document} $\wedge(q' \wedge r)$ \end{document} compiles without problems. – Marijn Sep 19 '21 at 18:56
  • 2
    Please show the couple of lines of code -- preferably the code itself, not a screen shot of code -- that precede the one you've chosen to show. – Mico Sep 19 '21 at 18:56
  • I edited the code – cufcuf Sep 19 '21 at 19:12
  • It seems like the issue is with \def\sp{0.7269ex} and \usepackage{mathastext}, commenting either of these out fixes it. Also changing \sp to some other name, such as \spp fixes it. – Willoughby Sep 19 '21 at 19:22
  • Thank you @Willoughby I did the last thing you said and problem is solved. – cufcuf Sep 19 '21 at 19:30
  • 6
    Don't ever redefine \sp -- or, for that matter, \sb -- unless you want to come to grief. (Hint: \sp and \sp are short for superscript and subscript.) – Mico Sep 19 '21 at 19:34
  • 7
    Basically the problem is using \def (which is not LaTeX) - using \newcommandwould have triggered a redefinition error. It's a good habit to use it especially for short macro names, where clashes are more probable. – Rmano Sep 19 '21 at 20:25
  • 3
    You've already received an answer, but here's a good tip* for troubleshooting: look at what is bring printed and compare it with your preamble definitions. "0.7269ex" is a slightly random thing to be bring printed. You should then check your definitions---which, as others have said, should use \newcommand not \def---to see if this appears anywhere. This method doesn't find the culprit every time, and it certainly doesn't give the full answer given below, but it can help diagnose the issue. [*I feel that it's a good tip; it works well for me, at least!] – Sam OT Sep 20 '21 at 08:25
  • To add to Mico's comment, don't use one or two letter macro names. They're generally already being used. – Teepeemm Sep 20 '21 at 13:58

1 Answers1

8

The problem is occurs with the package mathastext and your definition of \sp. It seems like mathastext uses \sp in its definition of ':

\def\mst@active@math@prime{\sp\bgroup\mskip\mst@prime@muskip\prim@s}

(taken from here, page 55, line 215). You can fix the problem by calling the macro something else.

Willoughby
  • 3,649