I'm using book (AMS) to transcribe a book, and would like to make a few modifications to get the style of output I'm aiming for. I've had some success already, I (hopefully) now just need to tweak things to get it right.
First, for reference, here's my current preamble:
Code: Select all
\usepackage{fancybox}
\usepackage{color,calc}
\definecolor{shade}{gray}{0.9}
\usepackage[pdfborder={0 0 0}]{hyperref}
\usepackage{multirow}
\renewcommand \thechapter {\@Roman\c@chapter}
\renewcommand \thesection {\@arabic\c@section}
\renewcommand \qedsymbol {$\blacksquare$}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhead{}
\fancyhead[RO,LE]{\bfseries\thepage}
\fancyhead[RE]{\bfseries{\thechapter\ \leftmark}}
\fancyhead[LO]{\bfseries{\thechapter.\rightmark}}
\fancyfoot{}
\renewcommand\section{\@startsection{section}{1}%
\z@{.7\linespacing\@plus\linespacing}{.5\linespacing}%
{\normalfont\Large\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}%
\z@{.7\linespacing\@plus\linespacing}{.3\linespacing}%
{\normalfont\bfseries}}
\newtheoremstyle{thaum}{12pt}{18pt}{}{}{\bfseries}{}{\newline}{\thmname{#1}\thmnumber{ #2:}\thmnote{ \bfseries{#3}}}
\theoremstyle{thaum}
\newtheorem{thaum}{Theorem}[section]
\renewenvironment{thm}[1][]%
{
%\setlength{\fboxsep}{-\fboxrule}
\footnotesize\normalfont\ttfamily\raggedright
\setlength{\rightmargin}{\leftmargin}
\setlength{\itemsep}{-12pt}
\setlength{\parsep}{20pt}
\begin{lrbox}{\@tempboxa}%
\begin{minipage}{\linewidth-2\fboxsep}
\begin{thaum}
}%
{
\end{thaum}
\end{minipage}%
\end{lrbox}%
\fcolorbox{black}{white}{\usebox{\@tempboxa}}\newline\newline
}%
\newtheorem{lemming}{Lemma}[section]
\renewenvironment{lem}[1][]%
{
%\setlength{\fboxsep}{-\fboxrule}
\footnotesize\normalfont\ttfamily\raggedright
\setlength{\rightmargin}{\leftmargin}
\setlength{\itemsep}{-12pt}
\setlength{\parsep}{20pt}
\begin{lrbox}{\@tempboxa}%
\begin{minipage}{\linewidth-2\fboxsep}
\begin{lemming}
}%
{
\end{lemming}
\end{minipage}%
\end{lrbox}%
\fcolorbox{black}{white}{\usebox{\@tempboxa}}\newline\newline
}%
\newtheorem*{lemmings}{Lemma}
\renewenvironment{lem*}[1][]%
{
%\setlength{\fboxsep}{-\fboxrule}
\footnotesize\normalfont\ttfamily\raggedright
\setlength{\rightmargin}{\leftmargin}
\setlength{\itemsep}{-12pt}
\setlength{\parsep}{20pt}
\begin{lrbox}{\@tempboxa}%
\begin{minipage}{\linewidth-2\fboxsep}
\begin{lemmings}
}%
{
\end{lemmings}
\end{minipage}%
\end{lrbox}%
\fcolorbox{black}{white}{\usebox{\@tempboxa}}\newline\newline
}%
\newtheorem{exam}{Example}[section]
\renewenvironment{example}{\begin{exam}}{\end{exam}}
\newtheoremstyle{algae}{12pt}{18pt}{}{}{\bfseries}{}{\newline}{\thmname{#1}\thmnumber{ #2:}\thmnote{ \bfseries{#3}}}
\theoremstyle{algae}
\newtheorem{algae}{Algorithm}[section]
\renewenvironment{algorithm}[1][]%
{
%\setlength{\fboxsep}{-\fboxrule}
\footnotesize\normalfont\ttfamily\raggedright
\setlength{\rightmargin}{\leftmargin}
\setlength{\itemsep}{-12pt}
\setlength{\parsep}{20pt}
\begin{lrbox}{\@tempboxa}%
\begin{minipage}{\linewidth-2\fboxsep}
\begin{algae}
}%
{
\end{algae}
\end{minipage}%
\end{lrbox}%
\fcolorbox{white}{shade}{\usebox{\@tempboxa}}\newline\newline
}%
\newtheoremstyle{algaes}{12pt}{18pt}{}{}{}{}{0pt}{}
\theoremstyle{algaes}
\newtheorem*{algaes}{ }
\renewenvironment{algorithm*}[1][]%
{
%\setlength{\fboxsep}{-\fboxrule}
\footnotesize\normalfont\ttfamily\raggedright
\setlength{\rightmargin}{\leftmargin}
\setlength{\itemsep}{-12pt}
\setlength{\parsep}{20pt}
\begin{lrbox}{\@tempboxa}%
\begin{minipage}{\linewidth-2\fboxsep}
\begin{algaes}
}%
{
\end{algaes}
\end{minipage}%
\end{lrbox}%
\fcolorbox{white}{shade}{\usebox{\@tempboxa}}\newline\newline
}%
- I'm looking to enclose the Theorem and Lemma environments with a black-outlined box, and the Algorithm environments with a grey-shaded box. To this end, I've appropriated some code from http://wiki.lyx.org/FAQ/ShadedBox. However, the current implementation puts this box immediately below the preceding text, with no gap. I'd like to have minimum gap that could be extended by LaTeX (currently some pages are becoming ridiculous; display equations have a quarter-page gap above and below because it's the only place it can find to put a gap). Also, the Algorithm environment will sometimes not take a new line at all, and start at the end of the previous line, spanning across the edge of the page on the right-hand side. Obviously this is unacceptable.
- To avoid having the chapter number in the section headings (and in the header), I've redefined sectionmark. Unfortunately, this has also fouled up all my cross-references to sections and subsections, so that the chapter number doesn't appear there either (which is obviously misleading). Is there any way I can have my cake and eat it too?
- I'd like to have my ToC include chapters, sections and subsections, and to have each level indented more than the previous. Currently, sections and subsections are indented equal amounts. How do I go about indenting subsections more than sections?
- I'm using \nocite{*} and a BibTeX database to create my bibliography; no citations are called in the text, so I don't have any need for numbering there - can I turn it off?
- I'd like my Example environment, like the Proof environment, to end with a \qed. Currently I've entered these manually, but on the rare occasion when an Example ends with a display equation, the \qedsymbol gets placed a quad after the end of the equation. This clashes with other exampls on the same page, where it is placed at the right margin. I've tried using \qedhere and \qed in various combinations, but the \qedsymbol refuses to match up. Is there any way to force this? If not, is there any way to redefine Example to be in effect a second version of the Proof environment, with numbering and style as I already have in my preamble, so that \qedhere will work?
- Is it possible to make the table of contents appear as an entry in the table of contents?
- Is there any way to create a copyright page (rear-of-the-title-page), as I believe KOMA-Script does?
Ed