-
Notifications
You must be signed in to change notification settings - Fork 0
/
newproof-doc.tex
115 lines (95 loc) · 2.67 KB
/
newproof-doc.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
113
\documentclass[pagesize=auto, parskip=half, fontsize=12pt, DIV=9]{scrartcl}
\usepackage{fixltx2e}
\usepackage{etex}
\usepackage{xspace}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[svgnames]{xcolor}
\usepackage{latexsym}
\usepackage{listings}
\usepackage{microtype}
\usepackage{hyperref}
\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}}
\newcommand*{\pkg}[1]{\textsf{#1}}
\newcommand*{\cs}[1]{\texttt{\textbackslash#1}}
\makeatletter
\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}}
\makeatother
\newcommand*{\env}[1]{\texttt{#1}}
\addtokomafont{title}{\rmfamily}
\lstset{%
language=[LaTeX]TeX,%
columns=flexible,%
upquote=true,%
numbers=left,%
basicstyle=\ttfamily,%
keywordstyle=\color{Navy},%
commentstyle=\color{DimGray},%
stringstyle=\color{SeaGreen},%
numberstyle=\scriptsize\color{SlateGray}%
}
\title{The \pkg{newproof} package}
\author{Mike Piff\thanks{\mail{[email protected]}}}
\date{}
\begin{document}
\maketitle
\renewcommand*{\labelenumi}{\texttt{\#\theenumi}}
This package defines a \cmd{\newproof} command similar to \cmd{\newtheorem}.
Its arguments are
%
\begin{enumerate}
\item Name of proof environment, eg, \env{proof}.
\item Starting text, eg, \emph{Proof}.
\item Finishing text, eg, $\Box$ flushed right.
\end{enumerate}
The package goes on to define a \env{proof} environment with exactly the
above setup, but other unnumbered environments can be set up in the
same way.
The created environments take one optional argument, which, if present,
goes in brackets after \verb|#2|. Eg,
%
\begin{lstlisting}
\begin{proof}
A proof.
\end{proof}
\begin{proof}[B. L. User]
A named proof.
\end{proof}
\begin{proof}[of Theorem \ref{thm}]
Yet another.
\end{proof}
\end{lstlisting}
Command \cmd{\qed} is set up to flush \cmd{\qedtext} right; \cmd{\qedtext} defaults
to a square, but can be re-defined as ``QED'' or whatever.
\end{document}
%
%
%
% This file is placed in the public domain. No provision is made for
% support of the use of the facilities herein.
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{newproof}
\newcommand{\newproof}[3]{
\newenvironment{#1}[1][]%
{%
\begin{trivlist}%
\item[\hspace{\labelsep}\textnormal{\textbf{#2%
\def\op@@@arg{##1}%
\ifx\op@@@arg\empty
\else~(##1)\fi
}}]%
}%
{%
#3
\end{trivlist}%
}%
}
\newproof{proof}{Proof}{\qed}
\def\qed{{\ifhmode\unskip\nobreak\hfil\penalty50 \hskip1em \else\nobreak\fi
\mbox{}\nobreak\hfil\qedtext%
\parfillskip=0pt \finalhyphendemerits=0 \par}}
\def\qedtext{\ensuremath{\square}}
\RequirePackage{amsfonts}
\DeclareMathSymbol{\square} {\mathord}{AMSa}{"03}