Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use \clearpage for newpage option to respect floats #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions homework.cls
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
\renewcommand{\question}[0]{%
% Emit \newpage if option `newpage` is present
\ifthenelse{\equal{\@opnewpage}{1}}{%
\newpage
\clearpage
}{}

% Wrap in minipage so that we don't get a line break enywhere in between
Expand All @@ -90,7 +90,7 @@
\WithSuffix\renewcommand\question*[1]{%
% Emit \newpage if option `newpage` is present
\ifthenelse{\equal{\@opnewpage}{1}}{%
\newpage%
\clearpage%
}{}%
% Wrap in minipage so that we don't get a line break enywhere in between
\begin{minipage}{\linewidth}%
Expand All @@ -109,14 +109,14 @@
% ----- Question Parts --------------------------------------------------------

\newenvironment{alphaparts}[0]{%
\begin{enumerate}[label=\textbf{(\alph*)}]%
\begin{enumerate}[label=\textbf{(\alph{partCounter})}]%
}{\end{enumerate}}

\newenvironment{arabicparts}[0]{%
\begin{enumerate}[label=\textbf{\arabic{questionCounter}.\arabic*})]%
\begin{enumerate}[label=\textbf{\arabic{questionCounter}.\arabic{partCounter}})]%
}{\end{enumerate}}

\newcommand{\questionpart}[0]{\item}
\newcommand{\questionpart}[0]{\stepcounter{partCounter}\item}

% ----- Induction Environment -------------------------------------------------

Expand Down
Binary file modified homework.pdf
Binary file not shown.
39 changes: 27 additions & 12 deletions homework.tex
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,39 @@
\question
Use the arabicparts environment to include the questionCounter number in the list.
\begin{arabicparts}
\item Use \LaTeX
\item ???
\item Profit!
\questionpart Use \LaTeX
\questionpart ???
\questionpart Profit!
\end{arabicparts}

\lipsum[7]

\question
Use the alphaparts environment to for letters instead of numbers.
Use the alphaparts environment for letters instead of numbers.
\begin{alphaparts}
\item
\questionpart
Use \LaTeX

\lipsum[8]
\item ???
\item Profit!
\questionpart ???
\questionpart Profit!
\end{alphaparts}

\question
Question part numbers are auto-incremented within the same question, so if you have some question parts...

\begin{alphaparts}
\questionpart
Use \LaTeX
\questionpart ???
\end{alphaparts}

Followed by some additional text, followed by some more question parts:

\begin{alphaparts}
\questionpart Profit!
\end{alphaparts}

All parts will be continuously numbered.

\question
Question numbers continue to auto-increment, regardless of question type.

Expand All @@ -93,14 +108,14 @@
\question
You can still do things like nesting lists inside of these environments.
\begin{alphaparts}
\item Use \LaTeX
\questionpart Use \LaTeX
\begin{enumerate}
\item Open terminal
\item Open vim
\item Write LaTeX
\end{enumerate}
\item ???
\item Profit!
\questionpart ???
\questionpart Profit!
\end{alphaparts}

\lipsum[9]
Expand Down