-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.tex
112 lines (91 loc) · 6.16 KB
/
example.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
\documentclass{article}
% Options for moveproofs, which control where and how proofs are displayed.
\usepackage[
location=appendix,
appendixsectionname={Our Proofs},
prependtoappendix=false,
manual=false,
]{moveproofs}
\renewcommand{\MPAppendixSectionName}{Proofs of the Theorems, Lemmas, and Propositions stated in the paper}
\renewcommand*{\appendixprelim}{\clearpage\footnotesize}
\usepackage{listings}
% moveproofs will define a proof environment if you don't have one,
% but you have to define your own theorem, corollary, etc. environments.
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\title{\vspace{-2.75cm}The \texttt{moveproofs} Package}
\author{Daniel Haas}
\begin{document}
\maketitle
\section{Package Overview}
Welcome to the \texttt{moveproofs} package, which will let you write your proofs inline with your document, then automatically move them to the appendix.
To use the package:
\begin{enumerate}
\item Write down and label theorems:
\begin{lstlisting}[language=TeX, moretexcs={begin, label}]
\begin{theorem}\label{my_theorem}
The world is flat.
\end{theorem}
\end{lstlisting}
\item Prove your theorems using the \texttt{\textbackslash makeproof} command:
\begin{lstlisting}[language=TeX, moretexcs={begin, label, makeproof}]
\makeproof{my_theorem}{
My worldview does not permit a round Earth.
Therefore, the world is flat.
}{Proof title}
\end{lstlisting}
\item Include the \texttt{moveproofs} package (\texttt{\textbackslash usepackage\{moveproofs\}}) and alter its options to choose how proofs are displayed:
\begin{itemize}
\item \texttt{location = [inline | appendix]}. Controls whether proofs are displayed inline (where you wrote the \texttt{\textbackslash makeproof} command) or in the appendix of the document. This option is required.
\item \texttt{appendixsectionname = NAME}. Customizes the name of the appendix section in which proofs are displayed (`Proofs' by default).
\item \texttt{prependtoappendix = [true | false]}. Controls whether proofs are inserted before existing appendix sections or after them (false by default: proofs are inserted at the end of the appendix).
\item \texttt{manual = [true | false]}. If this option is set to \texttt{true} and \texttt{location = appendix}, proofs will not automatically be inserted in the appendix. Rather, you can control where proofs are inserted with two commands:
\begin{itemize}
\item \texttt{\textbackslash appendixproofsection\{Section Name\}}: creates a section in the appendix that appears only if \texttt{location = appendix}.
\item \texttt{\textbackslash appendixproof\{theorem\_label\}}: Inserts the proof you wrote inside \texttt{\textbackslash makeproof\{theorem\_label\}} (again, only if \texttt{location = appendix}).
\end{itemize}
\end{itemize}
\item Use the \texttt{\textbackslash appendixproofnotice[MESSAGE]} command to notify readers that proofs will appear in the appendix. Default text (or the replacement text given in the optional \texttt{MESSAGE} argument) will appear only if \texttt{location = appendix}.
\item If you don't want to autowrap each call to \texttt{\textbackslash makeproof} in a proof environment (for example, because you want to state a helper lemma before proving the theorem), use \texttt{\textbackslash makeproof*} and \texttt{\textbackslash appendixproof*} instead of \texttt{\textbackslash makeproof} and \texttt{\textbackslash appendixproof}. Remember, this means you are responsible for inserting \texttt{\textbackslash begin\{proof\}} and \texttt{\textbackslash end\{proof\}} commands.
\end{enumerate}
\section{Demonstration}
The remainder of this document demonstrates the functionality of the \texttt{moveproofs} package.
Feel free to modify the source to see how the options affect the document's appearance.
First, we use the \texttt{\textbackslash appendixproofnotice} command to notify readers that proofs will appear in the appendix. If \texttt{location = appendix}, the notification will appear in bold in the following sentence of this paragraph (boldface is for emphasis, not provided by the command). \textbf{\appendixproofnotice[Proofs are all in the appendix.]}
Now, let's prove some theorems! The \texttt{location} package option controls whether the proofs appear inline or in the appendix.
Also, you can use the callback \texttt{\textbackslash appendixprelim} to call before the appendix will start.
% Theorem one.
\begin{theorem}\label{theorem_one}
For any $\delta \in (0, 1)$, with probability $1 - \delta$, proofs are useful.
\end{theorem}
\makeproof{theorem_one}{
Proofs are great! Therefore, we have our result.
}{This is the proof of Theorem \ref{theorem_one}}
\noindent We can also use the moveproofs package to prove statements that aren't theorems.
Note the reference to the corollary when this proof is moved to the appendix (thanks to the \texttt{cleveref} package).
% Corollary two. Demonstrates the use of \makeproof*
\begin{corollary}\label{corollary_two}
For any $\delta \in (0, 1)$, with probability $1 - \delta$, corollaries are useful.
\end{corollary}
\makeproof*{corollary_two}{
Introduction before the actual proof. First, we prove the following lemma:
\begin{lemma}\label{lemma_three}
Corollaries apply theorems.
\end{lemma}
\begin{proof}
Corollaries follow theorems, and make claims based on them.
\end{proof}
Now we are ready to prove our main result: Corollary~\ref{corollary_two}.
\vspace{0.4cm}
\begin{proof}
By lemma~\ref{lemma_three}, Corollaries apply theorems, and demonstrate new knowledge. Therefore, we have our result.
\end{proof}
}{Proof of corollary}
% Appendix
\appendix
\section{Existing Appendix}
The \texttt{moveproofs} package won't alter existing appendix material.
Toggle the \texttt{prependtoappendix} option to choose whether proofs are placed before or after the existing appendix.
Alternatively, set \texttt{manual = true} to turn off automatic proof insertion into the appendix and use the \texttt{\textbackslash appendixproofsection\{Section Name\}} and \texttt{\textbackslash appendixproof\{theorem\_label\}} commands to manually specify where the proofs should go.
\end{document}