1

I'm trying to use \newtheorem.

Here's my small sty file mystyle.sty

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\newtheorem{action}{$\checkmark$ Action}
\newtheorem{law}{$\bigodot$ Law}
\newtheorem{fact}{$\boxdot$ Fact}
\newtheorem{warn}{$\warning$ Caveat}

Here's the tex file:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amssymb}
%\usepackage{arevmath}
\usepackage{mystyle}
\begin{document}
\section{Head}
\begin{law}
The world is round
\end{law}
\begin{fact}
\(g =99.8 m/s^2\)
\end{fact}
\begin{action}
Teach co-recursion before recursion
\end{action}
\begin{warn}
 Beware
\end{warn}
\end{document}

This is with package arevmath with arevmath

This is without arevmath without arevmath

So now the questions:

  1. I want the warning symbol which is in arevmath but the general look of without arevmath is better. How to manage both?
  2. The content is coming in italic. But the examples I find for using newtheorem it comes normal roman. Is something else wrong?? eg...
  3. I picked up the eg from an inline source that uses \makeatletter. I'm not at all sure how to use it except for some vague directive: use in .tex not in .sty.
3
  • 2
    As for (2) look up \theormestyle in the manual for amsthm
    – daleif
    Commented Apr 17, 2022 at 11:57
  • 1
    Unrelated: please use the siunitx package to format units
    – daleif
    Commented Apr 17, 2022 at 12:33
  • \makeatletter is not used in your MWE, and is irrelevant to questions (1) and (2). You may desire to ask question (3) separately. (But if you do so, almost certainly it will be closed as a duplicate of tex.stackexchange.com/a/8353/119, so you might just as well read that answer instead..) Commented Apr 18, 2022 at 2:09

2 Answers 2

1

You want to use just the symbols provided by arevmath, not to change all math symbols to use it.

Actually, arevmath uses ams-mdbch and we see, in ams-mdbch.sty,

\xdef\checkmark{\noexpand\mathhexbox{\hexnumber@\symmathdesignA}D8}
\DeclareMathSymbol{\boxdot}{\mathbin}{mathdesignA}{"80}

The definition of \bigodot is the standard one, albeit using a different font. The command \warning is found in arevsymbols.tex and we see

\DeclareMathSymbol{\warning}{\mathalpha}{extraup}{125} % uni26A0

OK, the file ams-mdbch.sty has

\DeclareSymbolFont{mathdesignA}{MDA}{mdbch}{b}{n}
\SetSymbolFont{largesymbols} {normal}{OMX}{mdbch}{m}{n}

and in arevmath.sty we see

\DeclareSymbolFont{extraup}{U}{zavm}{m}{n}

Quite a chase! But we have all the ingredients. The only problem is \bigodot, but it can be solved.

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amssymb}
%\usepackage{arevmath}

\DeclareFontEncoding{MDA}{}{}
\DeclareFontSubstitution{MDA}{cmr}{m}{n}

\newcommand{\arevcheckmark}{{\usefont{MDA}{mdbch}{b}{n}\symbol{"D8}}}
\newcommand{\arevbigodot}{%
  $\vcenter{\hbox{\usefont{OMX}{mdbch}{m}{n}\symbol{"4A}}}$%
}
\newcommand{\arevboxdot}{{\usefont{MDA}{mdbch}{b}{n}\symbol{"80}}}
\newcommand{\arevwarning}{{\usefont{U}{zavm}{m}{n}\symbol{125}}}

\newtheorem{action}{\arevcheckmark\ Action}
\newtheorem{law}{\arevbigodot\ Law}
\newtheorem{fact}{\arevboxdot\ Fact}
\newtheorem{warn}{\arevwarning\ Caveat}

\begin{document}

\section{Head}

\begin{law}
The world is round
\end{law}

\begin{fact}
\(g =99.8 m/s^2\)
\end{fact}

\begin{action}
Teach co-recursion before recursion
\end{action}

\begin{warn}
Beware
\end{warn}

\end{document}

enter image description here

I left the wrong typesetting of the units in 9.8 m/s2, fix it.

4
  • Vow ! Thats a detailed answer. I'll need a while to chase after your chase 😂. To figure out what all youve done there. [Latex noob here]
    – Rushi
    Commented Apr 17, 2022 at 15:51
  • @Rusi Not a noob here. ;-)
    – egreg
    Commented Apr 17, 2022 at 15:59
  • Ok I got something working. I find the (nonarev) \boxdot better than the arev one. But that works only inside math mode. So is it fine that some of these symbols are in in math some not?
    – Rushi
    Commented Apr 17, 2022 at 16:08
  • My current version is put up. Thanks for the help. [I'm not completely satisfied with the (relative) sizes but this will fly for now]
    – Rushi
    Commented Apr 18, 2022 at 3:07
0

My current version thanks to egreg's help.
[Yeah the units are not proper. But that was a red herring for me anyway to produce some mwe; not something I currently need in my actual example]

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
%\usepackage{arevmath}

\DeclareFontEncoding{MDA}{}{}
\DeclareFontSubstitution{MDA}{cmr}{m}{n}

\newcommand{\arevcheckmark}{{\usefont{MDA}{mdbch}{b}{n}\symbol{"D8}}}
%% \newcommand{\arevbigodot}{%
%%   $\vcenter{\hbox{\usefont{OMX}{mdbch}{m}{n}\symbol{"4A}}}$%
%% }

\newcommand{\arevboxdot}{{\usefont{MDA}{mdbch}{b}{n}\symbol{"80}}}
\newcommand{\arevwarning}{{\usefont{U}{zavm}{m}{n}\symbol{125}}}

\theoremstyle{definition}
\newtheorem{action}{\arevcheckmark\ Action}
\newtheorem{law}{\(\odot\)\ Law}
\newtheorem{fact}{\(\boxdot\)\ Fact}
\newtheorem{warn}{\arevwarning\ Caveat}

\begin{document}

\section{Head}

\begin{law}
The world is round
\end{law}

\begin{fact}
\(g =99.8 m/s^2\)
\end{fact}

\begin{action}
Teach co-recursion before recursion
\end{action}

\begin{warn}
Beware
\end{warn}
\end{document}

You must log in to answer this question.

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