-
Notifications
You must be signed in to change notification settings - Fork 11
NotesPackage2
After second year I had created NotesPackage but it was a mess.
It was not well thought out, there was no explanation of why any package/command was included, and I didn't like the way certain things were implemented.
I decided it would be best to start again and created NotesPackage2.sty
which can be found here.
At the same time I started using TeXstudio to write my LaTeX and this has auto-completion.
You just need to provide a .cwl
file, which I did here.
This is accurate as of 05/01/2021.
- amsmath (lots of maths symbols)
- amsthm (theorem environments, see here for details)
- amssymb (more maths symbols)
- tikz (drawing)
- graphicx (importing images)
- mathtools (even more maths symbols)
- enumitem (more control over lists, specifically which symbols to use as numbering/bullet points)
- physics (maths symbols specific to physics)
- tensor (all the indices, up, down, before, and after the symbol)
- siunitx (units with proper spacing)
- centernot (put a slash through it)
- bm (bold, but not upright, used for vectors)
- csquotes (provides the environment
displayquote
) - caption (specifically used to automatically centre captions)
- fancyhdr (used to set up the header and footer, see here for details)
- tocloft (used to set up table of contents)
- titlesec (used for titles)
- parskip (used to remove the indent that happens at the start of a paragraph and instead add in some vertical space between paragraphs)
- geometry (specifically used to set margins to 1in by default)
- placeins (specifically used to force all figures to appear before the next section)
- tocbibind (places the bibliography in the table of contents)
- dsfont (provides double struck fonts, similar to black board bold but also works for numbers, used for the identity matrix)
- mathrsfs (provides the script font, used to write fancy curly letters, even more than the caligraphic font)
- hyperref (creates hyperlinks in appropriate places)
- glossaries (allows for creation of glossaries, specifically for a list of acronyms)
More details can be found on the individual workings of each of these packages from CTAN
-
\notespackage
prints the version that is being used. -
\define{arg}
makesarg
bold - I follow a convention of making a word bold when it is being defined in the text. -
\mathdefine{arg}
same as above but for use in a maths environment.
-
\vv{arg}
makesarg
bold, but not upright, my preferred way to denote a vector. Change this to change all vectors, for example\renewcommand{\vv}[1]{\vec{#1}}
will change all vectors to have arrows and not be bold. -
\vh{arg}
makesarg
a vector with a hat = I follow a convention of making unit vectors the same as the vector but with a hat. -
\ve{arg}
makes a unit vector e with a subscriptarg
, for example the Cartesian unit vector in the x-direction is\ve{x}
, or the spherical unit vector in the phi-direction is\ve{\phi}
. -
\vi
,\vj
, and\vk
unit vectors i, j, and k respectively, used for Cartesian unit vectors in three dimensions.
-
\trans
superscript T for transpose -
\hermit
superscript dagger for Hermitian conjugate -
\ident
the identity matrix, by default a double struck 1, change this to change it everywhere, for example\renewcommand{\ident}{I}
will make all identity matrices capital I. -
\diag
shorthand for diagonal matrices, for example the three-dimensional identity matrix is\diag(1, 1, 1)
, or the Minkowski metric with the (+---) sign convention is\diag(1, -1, -1, -1)
-
\preindex{index}{symbol}
useindex
as an index on the left ofsymbol
.
-
\A
the quantifier 'for all', which looks like an upside down A. -
\E
the quantifier 'there exists', which looks like a backwards E.
-
\numset{arg}
makearg
black board bold. Change this to change all number sets, for example\renewcommand{\numset}{\mathbf}
will make all number sets bold. -
\naturals
symbol for the natural numbers (default black board bold N) -
\integers
symbol for the integers (default black board bold Z) -
\rationals
symbol for the rational numbers (default black board bold Q) -
\reals
symbol for the real numbers (default black board bold R) -
\complex
symbol for the complex numbers (default black board bold C) -
\quaternions
symbol for the quaternions (default black board bold H) -
\bb{arg}
shorthand for\mathbb{arg}
(probably not good practice to use this)
-
\lagrangian
caligraphic L for the Lagrangian -
\lagrangianDensity
script L for the Lagrangian density -
\hamiltonian
caligraphic H for the Hamiltonian
-
\inlinedv{y}{x}
literally dy/dx, inline with a forward slash as written here. -
\inlinepdv{y}{x}
see above but a partial derivative. -
\pdvconst{y}{x}{z}
a partial derivative ofy
with respect tox
surrounded by brackets with a subscriptz
to showz
is held constant. -
\pdvsec{y}{x}{z}
the second partial derivative ofy
with respect tox
and thenz
. -
\dvat{y}{x}{z}
the derivative ofy
with respect tox
evaluated atz
. -
\pdvat{y}{x}{z}
see above but a partial derivative. -
\pdvsecat{y}{x}{z}{w}
the second partial derivative ofy
with respect tox
and thenz
evaluated atw
.
Of these commands \inlinedv
, \inlinepdv
, \pdvconst
, \dvat
, and \pdvat
have an optional argument for the order of the derivative.
For example, \dvat[2]{y}{x}
will print inline the second derivative of y
with respect to x
.
-
\grad
defaults to\nabla
, can be changed, for example\renewcommand{\grad}{\vec{\nabla}}
will cause all vector calculus operators to have an arrow above them. -
\div
equivalent to\grad\cdot
. -
\curl
equivalent to\grad\times
. -
\laplacian
equivalent to\nabla^2
(will not gain an arrow if\grad
is changed to add an arrow as the Laplacian is a scalar operator)
-
\expected{arg}
placesarg
between left and right angle brackets. By default they do not resisze witharg
, if this is the desired behaviour do\renewcommand{\expected}{\expectedResize}
, to turn this off do `\renewcommand{\expected}{\expectedNoResize}' -
\expectedResize{arg}
and\expectedNoResize{arg}
placearg
between left and right angle brackets with and without resizing respectively. -
\operator{arg}
equivalent to\hat{arg}
The amsthm package adds new environments, the ones that are set up in this package are
- theorem
- lemma
- corollary
- definition
The first three are of the theorem style where the word Theorem/Lemma/Corollary is printed in bold, along with the number if the non-stared version is used, and then the body of the theorem is in italics. Definition is of the definition style where the word Definition is printed in bold, along with the number if the non=stared version is used, and then the body of the theorem is normal. By default the numbering is of the form x.y where x is the section number and y is the number of theorems in the section so far. These environments all have an optional argument to add a name to the theorem/lemma etc. if there is one, for example
\begin{theorem}[Pythagoras theorem]
The sum of the squares of the two shorter sides of a right angle triangle is equal to the square of the hypotenuse.
\end{theorem}
when used for the first time in section 1 will look approximately like
Theorem 1.1 (Pythagoras theorem) The sum of the squares of the two shorter sides of a right angle triangle is equal to the square of the hypotenuse.
and
\begin{definition}[Group]
A group is a set along with a binary operation such that
\begin{itemize}
\item The set is closed under the binary operation
\item The operation is associative
\item The set contains an identity
\item Every element in the set has an inverse in the set
\end{itemize}
\end{definition}
will look like
Definition 1.1 (Group) A group is a set along with a binary operation such that
- The set is closed under the binary operation
- The operation is associative
- The set contains an identity
- Every element in the set has an inverse in the set
The page style is based on the fancy
style of the fancyhdr
package.
This adds rules along the top of the page.
On the left of the header the default is my name, 'Willoughby Seago', and on the right the default is the current section number and title.
At the base in the center the default is 'Page x' where 'x' is the current page number.
These can all be changed with \lhead
, \chead
, \rhead
to reset the left, centre, and right headers, and similarly \lfoot
, \cfoot
, and \rfoot
, for the left, centre, and right footers.