This is my personal LaTeX document class. It's made to fit my document writing workflow.
- Based on the
memoirdocument class. - Sane defaults.
- Custom macros to make life easier.
- Custom title styles
- Thoroughly configurable through document class options.
- The
docstyleoption unifies customarticle- andbook-like styles under the same codebase, switchable in an instant, while the individualdocstyle*options allow fine-tuning each aspect independently to create a hybrid that fits the document at hand.
- The
- Reproducible builds.
- A recent TeX Live/MiKTeX/etc. instalation that includes LaTeX 3 features and packages, like
expl3. - LuaLaTeX (never tested any other TeX engine).
I have this many specific options because I always wanted a way to quickly control everything that the options implement.
| option | default | description |
|---|---|---|
fontsize |
12 |
font size |
papersize |
a4 |
paper size |
language |
english |
document language(s) (last language in the list is the main language) |
imagesupport |
false |
load packages, custom macros and customizations for images |
mathsupport |
false |
load packages, custom macros and customizations for math |
tablesupport |
false |
load packages, custom macros and customizations for tables |
urlsupport |
false |
load packages, custom macros and customizations for URLs |
docstyle |
article |
general document style [ article | book ] |
docstyleChapterClearpage |
false |
whether to put chapter on a new page |
docstyleChapterStyle |
article |
chapter heading style [see memman.pdf sec. B.1] |
docstylePageLayout |
oneside |
page layout [ oneside | twoside ] |
docstyleSectioningOpen |
any |
on which side should document divisions open [ any | left | right ] |
docstyleTitleStyle |
default |
style of \maketitle [ default | eseuribacromana | scientificpaper | uniproject ] |
docstyleToCClearpageBefore |
false |
whether to put ToC on a new page |
docstyleToCClearpageAfter |
false |
whether to put content after the ToC on a new page |
As previously mentioned, the document class provides some quality-of-life custom macros:
\insertimg{file}[includegraphics options]<caption>Inserts a centered image into the document inside a figure environment, placed near the point where the command is invoked in the text.
- documentclass option
imagesupport = true, orgraphicxpackage loaded manually.
file(mandatory) -- path to an image file, gets passed to\includegraphics.includegraphics options(optional) -- options to change the geometry of the image (ex.:width=.8\textwidth,height=6cm,angle=90), gets passed to\includegraphics's optional argument.caption(optional) -- caption of the image, gets passed to\caption.
\insertimg{image}[width=.8\textwidth]<An image>\inserttbl{columnspec}<caption>{table body}Inserts a centered table into the document, placed near the point where the command is invoked in the text.
- documentclass option
tablesupport = true.
columnspec(mandatory) -- tabular column spec (ex.:lll,l|l|l,|l|S|S|), gets passed to the first argument of thetabularenvironment.caption(optional) -- caption of the image, gets passed to\caption.table body(mandatory) -- the rows and columns of the table, gets put inside atabularenvironment.
\inserttbl{|S|S|S|}<A table>
{
\hline
\textbf{column 1} & \textbf{column 2} & \textbf{column 3} \\\hline
\hline
53307 & 24284 & -30021 \\\hline
34428 & 70108 & 23217 \\\hline
50563 & -69993 & 43382 \\\hline
}\inserturl{full-url}Inserts a shortened, readable URL (it strips scheme://, leading www. and trailing slash). The link is clickable in the PDF.
- documentclass option
urlsupport = true.
full-url(mandatory) -- a full URL, gets passed to\href.
\inserturl{https://www.github.com/Andy3153/my_style.cls/} %will show up in the document as `github.com/Andy3153/my_style.cls`I implemented custom title styles through the document class option docstyleTitleStyle. These completely replace the \maketitle command with different titles.
| title style | parameters | description |
|---|---|---|
default |
\title, \author, \date |
the default title style from the memoir document class |
eseuribacromana |
\title, \author, \projecturl |
the title style I made for "Eseuri pentru bacalaureatul la Limba și Literatura Română", adapted a little |
scientificpaper |
\title, \author, \moreinfo, \projecturl |
the title style I made for "Phone Controlled Car" |
uniproject |
\title, \moreinfo |
the title style I made for use in university project documents |
I created a template that is included in the repository. It documents all the options provided by the document class and contains the basic structure I use for all my documents.
Here's a list of documents I have written and published that use this document class:
| repo | view | download |
|---|
This document is the reason I went and made this repository, it's my first ever serious document I wrote with LaTeX. It uses a very early version of the code in this repo, prior to me turning it into a memoir-based document class, it was a package to use over the basic article and book document classes.
| repo | view | download |
|---|
This document is what pushed me to go do the work to rewrite everything from a package to a full-on document class. Also a good showcase of the scientificpaper titlestyle.
As this is a personal project, it comes with things that might make zero sense to an outsider:
- Potential errors are being handled on a best-effort basis.
- All math is made to look like display math (
\everymath{\displaystyle}and\RenewDocumentCommand\frac{}{\displaystyle\stdfrac}). - The multiplication symbol
\timesis disabled (\let\times\empty). - The epsilon symbol
\epsilonis overridden by\varepsilon(\let\epsilon\varepsilon)
This repository is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.