Moved a few macros

This commit is contained in:
Mark 2023-10-26 08:14:55 -07:00
parent 044e7aa0a3
commit c9d2e8672c
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
4 changed files with 95 additions and 81 deletions

View File

@ -7,54 +7,6 @@
\usepackage{../../resources/macros} \usepackage{../../resources/macros}
\usepackage{mdframed} \usepackage{mdframed}
\usepackage{pgf}
% Ruble symbol with tweaks
\DeclareRobustCommand*{\Rub}{%
\begingroup
\dimendef\H=0 %
\settoheight\H{P}%
\begin{pgfpicture}%
\pgfsetlinewidth{.1\H}%
\pgfsetrectcap
\pgfsetmiterjoin
\pgfmoveto{\pgfpoint{0pt}{0.07\H}}% Move to bottom of main line
\pgflineto{\pgfpoint{0pt}{.90\H}}% P main line
\pgflineto{\pgfpoint{.3\H}{.90\H}}% P top line
\pgfpatharc{90}{-90}{.21\H}% P circle
\pgflineto{\pgfpoint{-.08\H}{.48\H}}% P bottom line
\pgfmoveto{\pgfpoint{-.08\H}{.31\H}}% Bonus line move
\pgflineto{\pgfpoint{.34\H}{.31\H}}% Bonus line draw
\pgfusepath{stroke}%
\pgfmoveto{\pgfpoint{-.23\H}{0pt}}% Before space
\pgfmoveto{\pgfpoint{0.55\H}{0pt}}% After space
\end{pgfpicture}%
\endgroup
}
% Ruble symbol, per official Kremlin specification
%
%\DeclareRobustCommand*{\Rub}{%
% \begingroup
% \dimendef\H=0 %
% \settoheight\H{P}%
% \begin{pgfpicture}%
% \pgfsetlinewidth{.1\H}%
% \pgfsetrectcap
% \pgfsetmiterjoin
% \pgfmoveto{\pgfpoint{0pt}{0.05\H}}%
% \pgflineto{\pgfpoint{0pt}{.95\H}}%
% \pgflineto{\pgfpoint{.35\H}{.95\H}}%
% \pgfpatharc{90}{-90}{.225\H}%
% \pgflineto{\pgfpoint{-.05\H}{.5\H}}%
% \pgfmoveto{\pgfpoint{-.05\H}{.34\H}}%
% \pgflineto{\pgfpoint{.38\H}{.34\H}}%
% \pgfusepath{stroke}%
% \pgfmoveto{\pgfpoint{-.175\H}{0pt}}%
% \pgfmoveto{\pgfpoint{.7\H}{0pt}}%
% \end{pgfpicture}%
% \endgroup
%}
\newmdenv[ \newmdenv[
topline=false, topline=false,

View File

@ -15,7 +15,10 @@
\uptitlel{Advanced 2} \uptitlel{Advanced 2}
\uptitler{Fall 2023} \uptitler{Fall 2023}
\title{Random Walks and Resistance} \title{Random Walks and Resistance}
\subtitle{Prepared by \githref{Mark} on \today{} \\ Based on a handout by Aaron Anderson} \subtitle{
Prepared by \githref{Mark} on \today{} \\
Based on a handout by Aaron Anderson
}
\begin{document} \begin{document}

View File

@ -9,41 +9,11 @@
\usepackage{chessfss} \usepackage{chessfss}
\usepackage{chessboard} \usepackage{chessboard}
\usepackage{xcolor} \usepackage{anyfontsize} % Silences some chess warnings
\usepackage{anyfontsize}
\usepackage{afterpage} \usepackage{afterpage}
\usepackage[hang]{footmisc} \usepackage[hang]{footmisc}
\def\stars#1#2{%
\def\oncolor{\color{purple}}%
\def\offcolor{\color{black!40!white}}%
%
\count255=1%
\count254=#2%
\advance\count254 by -1%
\ifnum #1 > 0
% The $$ are required around \bigstar.
% the special \odot chess piece breaks
% star sizing if they are ommited.
\loop
{\oncolor $\bigstar$}%
\ifnum\count255 < #1
\advance\count255 by 1
\repeat%
\else%
{\oncolor $\bigstar$}%
\fi%
%
\ifnum \count255 < #2%
\loop
{\offcolor $\bigstar$}%
\ifnum\count255 < \count254
\advance\count255 by 1
\repeat%
\fi%
}
\def\difficulty#1#2{ \def\difficulty#1#2{
\textbf{Difficulty:} \stars{#1}{#2} \par \textbf{Difficulty:} \stars{#1}{#2} \par
\vspace{1mm} \vspace{1mm}

View File

@ -2,4 +2,93 @@
\ProvidesPackage{macros}[2023/10/16 ORMC Macros] \ProvidesPackage{macros}[2023/10/16 ORMC Macros]
\RequirePackage{hyperref} \RequirePackage{hyperref}
\RequirePackage{pgf}
\RequirePackage{xcolor}
% Link to this repo, used in titles
\newcommand{\githref}[1]{\href{https://git.betalupi.com/Mark/ormc-handouts}{#1}} \newcommand{\githref}[1]{\href{https://git.betalupi.com/Mark/ormc-handouts}{#1}}
% A row of stars, for showing difficulty
% first arg: filled stars
% second arg: total stars
\def\stars#1#2{%
\def\oncolor{\color{purple}}%
\def\offcolor{\color{black!40!white}}%
%
\count255=1%
\count254=#2%
\advance\count254 by -1%
\ifnum #1 > 0
% The $$ are required around \bigstar.
% the special \odot chess piece breaks
% star sizing if they are ommited.
\loop
{\oncolor $\bigstar$}%
\ifnum\count255 < #1
\advance\count255 by 1
\repeat%
\else%
{\oncolor $\bigstar$}%
\fi%
%
\ifnum \count255 < #2%
\loop
{\offcolor $\bigstar$}%
\ifnum\count255 < \count254
\advance\count255 by 1
\repeat%
\fi%
}
% Ruble symbol with tweaks
\DeclareRobustCommand*{\Rub}{%
\begingroup
\dimendef\H=0 %
\settoheight\H{P}%
\begin{pgfpicture}%
\pgfsetlinewidth{.1\H}%
\pgfsetrectcap
\pgfsetmiterjoin
\pgfmoveto{\pgfpoint{0pt}{0.07\H}}% Move to bottom of main line
\pgflineto{\pgfpoint{0pt}{.90\H}}% P main line
\pgflineto{\pgfpoint{.3\H}{.90\H}}% P top line
\pgfpatharc{90}{-90}{.21\H}% P circle
\pgflineto{\pgfpoint{-.08\H}{.48\H}}% P bottom line
\pgfmoveto{\pgfpoint{-.08\H}{.31\H}}% Bonus line move
\pgflineto{\pgfpoint{.34\H}{.31\H}}% Bonus line draw
\pgfusepath{stroke}%
\pgfmoveto{\pgfpoint{-.23\H}{0pt}}% Before space
\pgfmoveto{\pgfpoint{0.55\H}{0pt}}% After space
\end{pgfpicture}%
\endgroup
}
% Ruble symbol, per official Kremlin specification
%
%\DeclareRobustCommand*{\Rub}{%
% \begingroup
% \dimendef\H=0 %
% \settoheight\H{P}%
% \begin{pgfpicture}%
% \pgfsetlinewidth{.1\H}%
% \pgfsetrectcap
% \pgfsetmiterjoin
% \pgfmoveto{\pgfpoint{0pt}{0.05\H}}%
% \pgflineto{\pgfpoint{0pt}{.95\H}}%
% \pgflineto{\pgfpoint{.35\H}{.95\H}}%
% \pgfpatharc{90}{-90}{.225\H}%
% \pgflineto{\pgfpoint{-.05\H}{.5\H}}%
% \pgfmoveto{\pgfpoint{-.05\H}{.34\H}}%
% \pgflineto{\pgfpoint{.38\H}{.34\H}}%
% \pgfusepath{stroke}%
% \pgfmoveto{\pgfpoint{-.175\H}{0pt}}%
% \pgfmoveto{\pgfpoint{.7\H}{0pt}}%
% \end{pgfpicture}%
% \endgroup
%}