Personal LaTeX stylesheet which I am using to make my academic notes.
If you are using MiKTex navigate to C:\Program Files\MiKTeX 2.9\tex\latex
; create a folder called domh
and copy *.sty
files into that folder.
Now the package can be used anywhere on your computer.
The package name is called DomH
and requires amsmath
,environ
,bbm
& fancyhdr
.
\usepackage{amsmath,environ,fancyhdr,bbm}
\usepackage[section]{DomH}
\headertitle{My Notes}
There are two (mutually exclusive) options:
section
- Counters reset at the start of every section.subsection
- Counters reset at the start of every subsection.
There is a single package-altering command:
\headertitle{__title__}
- Defines the string which goes in the centre of the header of each page.
I have defined some commands which act as shortcodes
reference
prepares a reference section (on a new page) and sets the page numbering to roman numerals.
Several environments are defined. Each is identical in structure but have different counters are text.\
definition
example
proof
proposition
remark
theorem
question
Takes the question name as a parameter\begin{question}{6b)}\end{question}
.answer
Takes the question name as a parameter\begin{answer}{6b)}\end{answer}
.
All environments have their own associated boolean which toggles whether they appear in the final document or not.
Use \<environ>sfalse
to hide occurrences of an environment, and \<environ>strue
to show occurrences. (e.g. \definitionsfalse
)
All environments can be labelled using \label{__env_name__}
and then the number of that environment can be retrieved using \ref{__env_name__}
.
For a full reference (e.g. Definition 1.7) you need to state the environment type yourself (e.g. Definition) and retrieve the section number separately (e.g. \ref{__sec_name__}
). So a full reference will look like Definition \ref{__sec_name__}.\ref{__env_name__}
.
Here is some code for the snippets.cson
to make creating my custom environments much quicker.
'.text.tex.latex':
'definition':
'prefix': 'definition'
'body':'\\\\begin{definition}{$1}\n\t$2\n\\\\end{definition}'
'proposition':
'prefix': 'proposition'
'body':'\\\\begin{proposition}{$1}\n\t$2\n\\\\end{proposition}'
'remark':
'prefix': 'remark'
'body':'\\\\begin{remark}{$1}\n\t$2\n\\\\end{remark}'
'theorem':
'prefix': 'theorem'
'body':'\\\\begin{theorem}{$1}\n\t$2\n\\\\end{theorem}'
'example':
'prefix': 'example'
'body':'\\\\begin{example}{$1}\n\t$2\n\\\\end{example}'
'proof':
'prefix': 'proof'
'body':'\\\\begin{proof}{$1}\n\t$2\n\\\\end{proof}'
'answer':
'prefix': 'answer'
'body':'\\\\begin{answer}{$1}\n\t$2\n\\\\end{answer}'
'question':
'prefix': 'question'
'body':'\\\\begin{question}{$1}\n\t$2\n\\\\end{question}'
'partialderivative':
'prefix': 'partialderivative'
'body':'\\\\frac{\\\\partial $1}{\\\\partial $2}$3'
'texttt':
'prefix': 'tt'
'body':'\\\\texttt{$1} $2'
'qanda':
'prefix': 'qanda'
'body':'\\\\begin{question}{$1}\n\t${2:TODO}\n\\\\end{question}\n\n\\\\begin{answer}{$1}\n\t${3:TODO}\n\\\\end{answer}$4'
'array':
'prefix': 'array'
'body':'\\\\[\\\\begin{array}{${1:rcl}}\n\t$2\n\\\\end{array}\\\\]$3'
To use these snippets type the environment name then press tab (e.g. definition
+ tab
). This will generate the environment code and place the cursor in the name location.