Portfolio: BibTeX, references and finished report.

parent eacd472b
...@@ -3,5 +3,9 @@ ...@@ -3,5 +3,9 @@
*.out *.out
*.toc *.toc
*.pdf *.pdf
*.bbl
*.bib
*.blg
*.dvi
foo.tex foo.tex
graph.tex graph.tex
...@@ -10,7 +10,10 @@ clean: ...@@ -10,7 +10,10 @@ clean:
rm -v *.out *.aux *.toc foo.tex graph.tex report.pdf rm -v *.out *.aux *.toc foo.tex graph.tex report.pdf
compile: compile:
pdflatex -interaction=nonstopmode report.tex latex report
bibtex report
latex report
pdflatex report.tex
rm -vf *.log rm -vf *.log
graph: graph.tex graph: graph.tex
......
# Example bibtex file used in report.tex
@book{lamport94,
author = "Leslie Lamport",
title = "LaTeX: A Document Preparation System, 2nd edition",
year = "1994",
publisher = "Addison Wesley",
address = "Reading, Massachusetts"
}
...@@ -20,6 +20,26 @@ ...@@ -20,6 +20,26 @@
\newfloat{program}{thp}{lop} \newfloat{program}{thp}{lop}
\floatname{program}{Program} \floatname{program}{Program}
% Theorems, lemmas and definitions
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newenvironment{proof}[1][Proof]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\newenvironment{definition}[1][Definition]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\newenvironment{example}[1][Example]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\newenvironment{remark}[1][Remark]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\newcommand{\qed}{\nobreak \ifvmode \relax \else
\ifdim\lastskip<1.5em \hskip-\lastskip
\hskip1.5em plus0em minus0.5em \fi \nobreak
\vrule height0.75em width0.5em depth0.25em\fi}
% }}} % }}}
\title{\LaTeX{} report assignment} \title{\LaTeX{} report assignment}
...@@ -103,12 +123,14 @@ to study Computer Science: ...@@ -103,12 +123,14 @@ to study Computer Science:
expect to get paid or get adulation by the public, but because it is fun to expect to get paid or get adulation by the public, but because it is fun to
program.'' $-$ Linus Torvalds} \end{quote} program.'' $-$ Linus Torvalds} \end{quote}
% }}}
% quotation
% reference to existing article. % reference to existing article.
% BibTex % BibTex
This sentence will demonstrate references to other articles or books: Use
\LaTeX{}, it will make writing less time consuming. \cite{lamport94}.
% }}}
% }}} % }}}
\section{Pseudo code} % {{{ \section{Pseudo code} % {{{
...@@ -242,14 +264,38 @@ And it is possible to break the equation into smaller, numbered parts. ...@@ -242,14 +264,38 @@ And it is possible to break the equation into smaller, numbered parts.
\subsection{Mathematical Theorem} % {{{ \subsection{Mathematical Theorem} % {{{
\label{sub:Mathematical Theorem} \label{sub:Mathematical Theorem}
The following definition, lemma and proof are copied from
\url{http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/Theorems.html}.
\begin{definition}
Let $H$ be a subgroup of a group~$G$. A \emph{left coset} of $H$ in $G$ is a
subset of $G$ that is of the form $xH$, where $x \in G$ and $xH = \{ xh : h \in
H \}$. Similarly a \emph{right coset} of $H$ in $G$ is a subset of $G$ that is
of the form $Hx$, where $Hx = \{ hx : h \in H \}$
\end{definition}
Note that a subgroup~$H$ of a group $G$ is itself a left coset of $H$ in $G$.
\begin{lemma}
\label{LeftCosetsDisjoint}
Let $H$ be a subgroup of a group $G$, and let $x$ and $y$ be elements of $G$.
Suppose that $xH \cap yH$ is non-empty. Then $xH = yH$.
\end{lemma}
\begin{proof}
Let $z$ be some element of $xH \cap yH$. Then $z = xa$ for some $a \in H$, and
$z = yb$ for some $b \in H$. If $h$ is any element of $H$ then $ah \in H$ and
$a^{-1}h \in H$, since $H$ is a subgroup of $G$. But $zh = x(ah)$ and $xh =
z(a^{-1}h)$ for all $h \in H$. Therefore $zH \subset xH$ and $xH \subset zH$,
and thus $xH = zH$. Similarly $yH = zH$, and thus $xH = yH$, as required.\qed
\end{proof}
% }}} % }}}
% }}} % }}}
\begin{appendices} \begin{appendices}
\pagebreak
\section{Example appendix} % {{{ \section{Example appendix} % {{{
\label{sec:Example} \label{sec:Example}
...@@ -261,5 +307,8 @@ but without any additional information :-). ...@@ -261,5 +307,8 @@ but without any additional information :-).
\end{appendices} \end{appendices}
\bibliographystyle{plain}
\bibliography{report}
\end{document} \end{document}
% vim: foldmethod=marker: % vim: foldmethod=marker:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment