SkillAgentSearch skills...

LiX

Compose papers, dissertations, textbooks, novels, newspapers etc. quicker using abstractions to the standard LaTeX document classes - or create your own classes easily.

Install / Use

/learn @NicklasVraa/LiX

README

LiX <!-- omit in toc -->

Check out LiX templates on Overleaf. Replace lix.sty in your overleaf project with the latest one from here to apply updates. The same goes for document classes.

Lix is a meta-package which bundles other LaTeX packages and commands. To use these bundles, simply specify them when importing the LiX package, either in your own document-class, or directly in your main document when using a predefined class. The goal of this package is to speed up writing your documents, but also to simplify the process of defining your own class. Separation of layout and content is made much easier.

LiX aims to be for LaTeX, what LaTeX is for TeX.

Disclaimer: This project breaks conventions and practices, which are considered to be "standard" by the LaTeX community. If you want to learn "pure" LaTeX, this is not the project for you. However, for those of you that want to get stuff done as painlessly as possible: Please enjoy.

Shortcuts: Examples | Syntax | Installation | Scripts | Plans

Motivation:
While LaTeX is the indisputable king for typesetting publishable documents, it does have a steep learning curve and is very syntax-heavy. To ease the burden of typesetting and bring the author's focus back on their content, the syntax should be as light as possible. Defining your own look-and-feel is even more inaccessible, if one is not familiar with basic programming - hence this humble project, which attempts to address these issues.

<details><summary><b>Code Example</b></summary> Say, we want to setup a book with the US letter size and a very specific margin, It should have both front and back cover art with a title, a subtitle, multiple authors, etc, which should be added to the pdf-metadata. We would also like a page containing formal information, such as licensing and an ISBN-code and maybe a barcode. We want to be able to include centered, scaled figures and syntax-highlighted code blocks, both captioned. We would also like the document to be in Danish, following specific hyphenation rules, etc.

All that can be achieved by this:

\documentclass{thesis} % Or any of the other document classes.

% Document configuration.
\lang      {english}
\size      {a4}
\cover     {path/to/front.pdf}{path/to/back.pdf}
\margins   {22mm}{20mm}{21mm}{40mm}
\title     {A Cool Title}
\subtitle  {And a Cool Subtitle}
\authors   {Nicklas Vraa}{Another Guy}{And Another}
\date      {01/01/2023}
\isbn      {123456789}
\license   {CC}{nc}{3.0}{My Company}
\edition   {3}{2023}
\watermark {DRAFT}{black!10}
\shield    {copyrighted}
% ...

\begin{document}
% ... No need for \maketitle or anything else.

\toc % Include table-of-contents

\h{Introduction} % Level-1 heading.
% ...

\hh{Motivation} % Level-2 heading.
% ...

    % Simple code-snippet inclusion.
    \code{my_snippet}{python}{
    import numpy as np
    % ...
    }{This code does this and that...}

% ...

    % One-line figure import that supports jpg, png, svg, pdf, etc.
    \fig{ny_figure}{0.8}{path/to/image.png}{This figures explains how...}

% ...

\end{document}

Imagine the LaTeX code, you would have to write to achieve the same - even when using appropriate packages. The layout of each element should be customized by defining a custom class that builds on top of one of the standard classes. Examples are shown later.

</details> <details><summary><b>Advantages and Disadvantages</b></summary>

Advantages:

  • The source code of a document becomes as easy to read and understand as Markdown and is drastically shorter.
  • The style of a document is completely separated from its content, and keeping a consistent style is simpler.
  • Configuring your document is simpler, because you don't interface directly with individual packages, which may employ different syntax.
  • Creating your own class, which implements a custom look-and-feel, is much easier.

Disadvantages:

  • If one wants to change their document into a class that has not been defined using this package, there may be difficulties when compiling. To address this, I've recreated the IEEEtran class, as a reference for how to reimplement an existing look using LiX.
  • You do not have the extreme fine-grained control over your custom class, as you would with pure LaTeX.
  • The command names are not as descriptive as standard LaTeX. Minimal impact on source-code readability was prioritized.
</details>

1. Class Examples <a name="examples"></a>

Using this package, I've defined some custom classes, which are ready for use, as well as classes which mimic popular formats. Look at the source code for each class to see how easily they were defined. It's very simple to convert to another class, as they all share the exact same syntax. Download the pdf's to see the actual quality. | | | | | | | | ----- | - | - | - | - | - | | Paper (tex|pdf) packs as much information as possible, while adhering to the standards of academic research papers. | p1 | p2 | | Novel (tex|pdf) is meant for fiction with the intent to print. This class supplies cover-, title- and metadata pages, etc. | p1 | p2 | p4 | p5 | p7 | | Textbook (tex|pdf) is intended for typesetting a large amount of academic content to be printed in book form. | p1 | p2 | p4 | p5 | p7 | | Novella (tex|pdf) is meant for short-stories with the intent to print. | p1 | p2 | p4 | | News (tex|pdf) is designed as a classic newspaper akin to the The New York Times. | p1 | p2 | | IEEE (tex|pdf) implements the IEEE journal and transactions template, but using LiX. | p1 | p2 | | Contract (tex|pdf) is a simple template for a formal contract between an arbitrary number of parties. | p1 | | Poem (tex|pdf) is a poem template that features a softer font and can optionally be decorated. | p1 |

Also check out:

  • Thesis (tex|pdf), which is a mix between the paper and textbook classes, meant for longer academic works.

It is also possible to use the standard classes, like article, report and book, but still benefits from simplified syntax. Simply import the package and specify the stdclass option, along with any bundles, e.g.:

\documentclass{article}
\usepackage[stdclass, ...]{lix}

2. LiX Syntax <a name="syntax"></a>

This is an overview of the commands, which are available when specifying a certain bundle (in alphabetical order). To those unfamiliar with LaTeX, a command is always prefixed with a backslash \, mandatory input is enclosed in {} and optional input is enclosed in []. Whitespace between a command and its input does not matter. Comments are always prefixed with a percentage symbol %. In-class commands are not supposed to be used in the main .tex document, but rather in your .cls file.

<details><summary><b>Algorithms</b></summary>

Insert algorithms into your document. Simply type your algorithm in plain text and mix in math typesetting whenever you require, between $-signs. No need for any escaped \keywords.

...
    \algo{label}{
    % Your algorithm.
    % $some+math$
    }{caption}
...

Algorithms will be subtly highlighted. A label is mandatory, but caption is optional. Indent the block four spaces, as these will be gobbled (removed) in the resulting pdf. This is for better readability in the source file. I recommend indenting all algorithms, tables, figures, etc., to better distinguish them from regular text.

</details> <details><summary><b>Basics</b></summary>

A collection of essential commands and aliases.

  • \abstract{summary of findings}
    Alias: \blurb{...} (for books).
  • \add{path/to/file.tex/pdf}{pages}
    Inserts the tex-code from the given file, exactly like \input{}, but also handles pdf files, which are inserted as pages. The pages parameter is optional, only applies to pdfs, and can be a range, e.g. 2-4, individual pages, e.g. 1,3,7, and any combination of the two, i.e. 1-3,5,8-10.
  • anchor{position}{...}
    Aligns its content either left, right
View on GitHub
GitHub Stars280
CategoryEducation
Updated3d ago
Forks20

Languages

TeX

Security Score

100/100

Audited on Mar 30, 2026

No findings