handouts/Problems/all.tex

104 lines
1.8 KiB
TeX
Raw Normal View History

2023-05-17 13:00:54 -07:00
\documentclass[
solutions,
nowarning
]{../resources/ormc_handout}
2023-05-17 14:14:37 -07:00
\def\stars#1{
\count255=1
\ifnum #1 > 0
\loop
{\color{cyan!50!gray} \bigstar}%
\ifnum\count255 < #1
\advance\count255 by 1
\repeat
\else%
{\color{cyan!50!gray} \bigstar}%
\fi%
%
\ifnum \count255 < 5
\loop
{\color{gray} \bigstar}%
\ifnum\count255 < 4
\advance\count255 by 1
\repeat
\fi
}
2023-05-17 13:00:54 -07:00
\NewDocumentCommand{\p}{ m m }{
2023-05-17 14:14:37 -07:00
\begin{minipage}{\textwidth}
\textbf{#1 #2:} \par
2023-05-17 13:00:54 -07:00
2023-05-17 14:14:37 -07:00
\ifdifficulty{#1}{#2}{{\color{gray}Difficulty:} \stars{\getdifficulty{#1}{#2}}}
2023-05-17 13:00:54 -07:00
2023-05-17 14:14:37 -07:00
\vspace{2mm}
2023-05-17 13:00:54 -07:00
2023-05-17 14:14:37 -07:00
\getproblem{#1}{#2}
2023-05-17 13:00:54 -07:00
2023-05-17 14:14:37 -07:00
\ifsolution{#1}{#2}{}[
\ifanswer{#1}{#2}{%
\vspace{2mm}%
{\color{red}\textbf{Solution:}} \getanswer{#1}{#2}
}
]
\end{minipage}
2023-05-17 13:00:54 -07:00
\ifsolution{#1}{#2}{
\begin{solution}
\getsolution{#1}{#2}
\end{solution}
2023-05-17 14:14:37 -07:00
}
\penalty-500
2023-05-17 13:00:54 -07:00
2023-05-17 14:14:37 -07:00
\vspace{15mm}
2023-05-17 13:00:54 -07:00
\vfill
}
2023-05-17 14:14:37 -07:00
\newcommand{\postproblem}[2]{
\ifcsname#1:all\endcsname
\expandafter\edef\csname#1:all\endcsname{\csname#1:all\endcsname \p{#1}{#2}}
\else
\expandafter\gdef\csname#1:all\endcsname{\p{#1}{#2}}
\fi
}
\usepackage{problemlib}
\input{problems/numbertheory}
\input{problems/algebra}
\input{problems/combinatorics}
\input{problems/pidgeonhole}
\input{problems/misc}
2023-05-17 13:00:54 -07:00
%\makeatletter
%\newcommand{\shoppinglist}[1]{Shopping list: #1\checknextarg}
%\newcommand{\checknextarg}{\@ifnextchar\bgroup{\gobblenextarg}{ and that's all!}}
%\newcommand{\gobblenextarg}[1]{ and also #1\@ifnextchar\bgroup%{\gobblenextarg}{ and that's all!}}
%\makeatother
\newcommand{\q}[1]{
\section{#1}
\csname#1:all\endcsname
\pagebreak
}
\begin{document}
\maketitle
{Mark's Problem Library}
{
This document lists all problems in this library. \\
2023-05-17 14:14:37 -07:00
Use it to find problems or debug the source.
2023-05-17 13:00:54 -07:00
}
\q{Algebra}
\q{Combinatorics}
\q{NumberTheory}
\q{Pidgeonhole}
2023-05-17 14:14:37 -07:00
\q{Misc}
2023-05-17 13:00:54 -07:00
\end{document}