Skip to content

dajhutchinson/LaTeX-Package

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaTeX-Package

Personal LaTeX stylesheet which I am using to make my academic notes.

Install

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.

usepackage

The package name is called DomH and requires amsmath,environ,bbm & fancyhdr.

\usepackage{amsmath,environ,fancyhdr,bbm}
\usepackage[section]{DomH}
\headertitle{My Notes}

Options

There are two (mutually exclusive) options:

  1. section - Counters reset at the start of every section.
  2. subsection - Counters reset at the start of every subsection.

Commands

There is a single package-altering command:

  1. \headertitle{__title__} - Defines the string which goes in the centre of the header of each page.

Shortcodes

I have defined some commands which act as shortcodes

Command Result Shortcode for
\prob \mathbb{P}
\Q \mathbb{Q}
\expect \mathbb{E}
\var \text{Var}
\cov \text{Cov}
\corr \text{Corr}
\M \mathcal{M}
\F \mathcal{F}
\iid \overset{\text{iid}}{\sim}
\reals \mathbb{R}
\nats \mathbb{N}
\ints \mathbb{Z}
\I \mathcal{I}
\X \pmb{X}
\proved $\hfill\square$
\indexed $\mathbbm{1}$
\argmin $\text{argmin}$
\argmax $\text{argmax}$

reference prepares a reference section (on a new page) and sets the page numbering to roman numerals.

Environments

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}.

Toggling Environments

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)

Labelling & Referencing

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__}.

Snippets

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.

About

Personal LaTeX stylesheet

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages