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.
Rusi
  • 353
  • 2
    As for (2) look up \theormestyle in the manual for amsthm – daleif Apr 17 '22 at 11:57
  • 1
    Unrelated: please use the siunitx package to format units – daleif Apr 17 '22 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 https://tex.stackexchange.com/a/8353/119, so you might just as well read that answer instead..) – Willie Wong Apr 18 '22 at 02:09

2 Answers2

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.

egreg
  • 1,121,712
  • 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] – Rusi Apr 17 '22 at 15:51
  • @Rusi Not a noob here. ;-) – egreg Apr 17 '22 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? – Rusi Apr 17 '22 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] – Rusi Apr 18 '22 at 03: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}

Rusi
  • 353