The neoschool Class

2025/07/20 — v1.0.4 — Razik Ikhlef

cls File: neoschool.cls

Documentation in PDF format: neoschool-en.pdf

LaTeX Source: neoschool-en.tex

The neoschool class provides secondary school teachers with a comprehensive set of tools to create their educational documents (assessments, course materials, exercise sheets with solutions, etc.). To meet various needs, it offers eight predefined color themes, diverse class options for layout and typography, specialized environments, dedicated commands, and different preformatted header styles for each type of document. It integrates dozens of commonly used LaTeX packages (see list below), which significantly reduces the preamble and avoids compatibility issues as much as possible. It’s multilingual, supporting French, English, and German.

Examples

Contents

Loaded Packages

The following packages are automatically loaded by the neoschool class:

adforn, adjustbox, algpseudocode, amssymb, babel, bookmark, calc, changespace, cuted, environ, fancyvrb, fontawesome5, forest, iftex, ifthen, kvoptions, lastpage, marginnote, microtype, mismath (which loads mathtools), multicol, needspace, pdftexcmds, pgffor, pgfplots, qrcode, scrlayer-scrpage, silence, siunitx, tabularray, tasks, tcolorbox (with the most option loading listings and minted packages), textcase, tikz, tikzpagenodes, tikzsymbols, ulem (with normalem option), xcolor (with table, svgnames, dvipsnames, and x11names options), xhfill, xkeyval, xsim (with use-files and clear-aux options), xstring.

Compilation in pdflatex loads fonttenc (with T1 option), inputenc (with utf8 option), newpxtext, and newpxmath. Compilation in lualatex makes available fontspec, luacas, lua-ul, luacolor packages and applies TeX Gyre PagellaX and TeX Gyre Heros fonts in addition to newpxmath.

The graphics option loads graphicx and wrapfig, the draft option loads blindtext and lipsum, and the mathastext option loads the mathastext package.

The math option loads annotate-equations, bm, cancel, mathrsfs, nncomma, numprint, tdsfrmath (with suite and taupe options), tkz-euclide, witharrows, and xlop.

The notes option enables colored and framed notes in the left and right margins alternately and loads the todonotes package.

The apmep option, which allows direct compilation of examination papers from the association of the same name, defines a set of mathematical commands and loads esvect, fourier-ons, numprint (with np option), pstricks (and many packages from the pstricks ecosystem), tabularx, and textcomp.

The mathics option enables computer algebra via mathics (free version of mathematica) and loads asymptote and latexalpha2 packages.

Configuration Options

Language

Global Appearance

Predefined Themes

The theme = theme-name option sets the document’s color theme. Available themes are: cyprus, kassio, frost, spring, arbutus, duo, navy, royal. Most of them are inspired by the ef-themes for Emacs by Protesilaos Stavrou.

Color Modes

Custom Colors

Display Options

Abstract Customization

The abstracttitle option allows customization of the abstract environment title:

\documentclass[abstracttitle=Summary]{neoschool}

% In the document
\begin{abstract}
    Abstract content...
\end{abstract}

Typography

Layout

Margins and Spacing

Output Options

Headers and Footers

Document Styles

Title Styles

Exam Styles

\documentclass[exam]{neoschool}

\neoheader{
    type = Test,
    school = Poincarré High School,
    level = Senior Year,
    duration = 2h,
    calculator = true  % or false or exam
}

Assessment Styles

\documentclass[eval]{neoschool}

\neoheader{
    type = Quiz,
    school = Alan Turing Middle School,
    level = 8th Grade
}

Bubble Styles

Other Title Styles

Header Configuration

The document header can be configured with the \neoheader command:

\neoheader{
    type = {Document Type},
    school = {School Name},
    academy = {Academy Name},
    level = {Grade Level},
    duration = {Duration},
    calculator = {true/false/exam},
    leftcontent = {\faIcon{...}},
    rightcontent = {\faIcon{...}},
}

Title Formatting Options

Global Styles

\documentclass[headstyle=rmfamily]{neoschool}
\documentclass[
  headstyle=sffamily,
  headweight=mdseries
]{neoschool}
\documentclass[
  headstyle=sffamily,
  headshape=upshape
]{neoschool}

Main Title Style

\documentclass[
    titlestyle=sffamily,
    titleweight=bfseries,
    titleshape=upshape,
    titlealign=left
]{neoschool}

Section Style

\documentclass[
    sectionnumstyle=circle,
    sectiontextstyle=upper,
    sectionstyle=highlighted,
    sectionalign=left
]{neoschool}

Header/Footer Style

\documentclass[headfootstyle=sffamily]{neoschool}

Complete Configuration Example

\documentclass[
    % Global style
    headstyle=sffamily,
    headweight=bfseries,
    headshape=scshape,
    
    % Main title
    titlestyle=sffamily,
    titleweight=bfseries,
    titleshape=upshape,
    titlealign=center,
    
    % Sections
    sectionnumstyle=circle,
    sectiontextstyle=upper,
    sectionstyle=highlighted,
    sectionalign=left,
    
    % Headers/footers
    headfootstyle=sffamily
]{neoschool}

Content Layout

Absolute Object Positioning

The \positionobject command allows precise placement of elements on the page:

\positionobject{x-shift}{y-shift}{scale}{content}

\begin{itemize}
\item \texttt{x-shift}: Horizontal offset from top-left corner.
\item \texttt{y-shift}: Vertical offset from top-left corner.
\item \texttt{scale}: Scale factor for content.
\item \texttt{content}: Element to position (image, text, etc.).
\end{itemize}

% Example: Image in top-right corner
\positionobject{15cm}{1cm}{0.5}{\includegraphics{logo.png}}

% Example: Special footer text
\positionobject{2cm}{25cm}{1}{Special footer note}

Two-Column Layout

The *** command divides content horizontally:

% Example with custom values
\splitcontent[0.6][0.05]{
    This part takes up 60%
    of total width
}{
    This part takes up 35%
    (5% space between)
}

% Example with default values (50% / 50%)
\splitcontent{
    First column
}{
    Second column
}

Side-by-Side Environments

The sidebyside environment creates two-column boxes with consistent styling:

\begin{sidebyside}[options]
    % Left content
    \tcblower
    % Right content
\end{sidebyside}

Options are those of tcolorbox.

\begin{sidebyside}[
    title=Comparison,
    colback=exampleColor!5,
    colbacklower=exampleColor!10
]
    First version
    \tcblower
    Improved version
\end{sidebyside}

Text and Image Combination

The *** command combines text and image:

% Star (*) reverses image position (right by default)

% Image on right (30% width)
\textwithimage{0.3}{0.95}{
    This text describes the adjacent image...
}{images/figure.png}

% Image on left (40% width)
\textwithimage*{0.4}{0.9}{
    Description to the right of the image...
}{images/schema.png}

QR Codes and Content

The *** command integrates a QR code with associated content:

% Star (*) places QR code on right (left by default)

% QR code on left (2cm default)
\withqrcode{https://example.com}{
    Scan for more information
}

% 3cm QR code on right
\withqrcode*[3cm]{https://exercises.com}{
    Access online exercises
}

Grids and Papers

Custom Grids

\grid[blue]{10cm}{5cm}  % Blue grid 10 x 5 cm
\customgrid[red][4mm][4mm]{12cm}{8cm}  % Red grid, 4mm mesh
\frenchgrid{15cm}{10cm}  % French-style notebook grid

Full Pages

\notebook  % Activates lined notebook style
\nbminorgrid  % Activates fine grid
\nbmajorgrid  % Activates Seyes grid

Simple Boxes

The neobox environment provides a quick way to create simple boxes. It comes in two variants: neobox with frame and neobox* without visible frame:

% Standard box
\begin{neobox}[colframe=blue,colback=blue!5]
    Text in a box...
\end{neobox}

% Frameless box with colored background
\begin{neobox*}[colback=gray!10]
    Text on gray background...
\end{neobox*}

Exercises

Exercises and Assessments

Exercise Configuration

The exercise environment accepts the following options:

\begin{exercise}[
    points=4,
    level=2,
    subtitle=Derivatives,
    icon=\faPencil,
    topic=Analysis,
    subject=Mathematics,
    ID=der01,
    template=elegant-box
]
    Calculate the derivative of the function $f$ defined on $]0 ; +\infty[$
    by $f(x)=x^2\ln(x)$.
\end{exercise}

The \texttt{solution} environment must immediately follow its corresponding \texttt{exercise} environment. Exercise solutions are not displayed by default.

\begin{solution}
    We use the product rule...
\end{solution}

% To reference the exercise elsewhere:
As seen in exercise~\exercisenumber{der01}.

Global Options

Exercise Templates

The class offers numerous predefined styles for exercises:

To set a template for the entire document, use the \xsimsetup command in the preamble:

\xsimsetup{
    exercise/template = elegant-box,    % exercise template
    solution/template = sol-box         % solution template
}

Multiple Choice Questions

\begin{exercise}[points=2,ID=mcq01]
    What is the derivative of $e^x$?
    \begin{choices}
        \choice $x e^x$
        \choice[\correct] $e^x$
        \choice $e^{x-1}$
        \choice $\ln(x)$
    \end{choices}
\end{exercise}
\begin{exercise}[points=3,ID=mcq02]
    Which of these numbers are prime?
    \begin{checkboxes}
        \checkbox[\correct*] 2
        \checkbox[\correct*] 3
        \checkbox 4
        \checkbox[\correct*] 5
    \end{checkboxes}
\end{exercise}

Math Environments

Theorem Styles

The following styles are available for all theorem-type environments: amslikethm (minimalist style), boxedthm, classicthm, classythm, elegantthm, shadedthm, slantedthm, soberthm.

Common options:

Numbering Options

Mathematical Environments

\begin{theorem}[title=Pythagorean Theorem,label=pyth]
    In a right triangle, the square of the
    hypotenuse equals the sum of squares
    of the other two sides.
\end{theorem}

% Referencing:
According to theorem~\ref{thm:pyth}
\begin{lemma}[title=Preparatory Lemma,label=prep]
    Lemma content...
\end{lemma}

% Referencing:
According to lemma~\ref{lem:prep}
\begin{corollary}[
    title=Pythagorean Converse,
    label=pythrecip
]
    If $a^2 + b^2 = c^2$, then the triangle is
    right-angled at $A$.
\end{corollary}

% Referencing:
According to corollary~\ref{cor:pythrecip}

Computer Code

The neoschool class offers two options for code handling.

Listings Option

Available Code Styles

Custom Code Boxes

The class defines the code environment with the following structure:

\begin{code}[options]{language}[title][box-style]
    source code...
\end{code}

Box styles: box-minimal, box-fancy, box-classic, box-elegant, box-diagonal, box-bevel, box-corner, box-rounded, box-downhill, box-bottomtitle, box-bottomtitlef.

\begin{code}[numbers=left]{python}[Function Example][box-fancy]
def hello(name):
    print(f"Hello, {name}!")
\end{code}

Preconfigured Languages and Styles

Additional Commands

\codeinline[python]{print("Hello")}
\codeinput[options]{language}{file.py}[title][box-style]

Minted Option

When the minted option is activated, code environments use Pygments for syntax highlighting. The code environment is also available with the minted option, using the same syntax:

\usemintedstyle{tango}
\begin{code}[linenos,highlightlines={2,3}]{python}[Function][box-fancy]
def greet(name):
    message = f"Hello, {name}!"
    print(message)
    return message
\end{code}

Notes and Annotations

Margin Notes

Notes can be placed in the margin with different options:

\tdnote{Important point to remember}
\tdnote[backgroundcolor=blue!5]{Note with light blue background}
\boxnote[thm1]{This theorem is important}
\begin{theorem}
    \tdmark[thm1]  % Reference point for note (same label)
    Theorem content...
\end{theorem}

Available note options:

Admonitions

Admonition environments highlight important information. Each type has its default color and icon.

\begin{note}[Important Note][\faInfo]
    Points to remember...
\end{note}
\begin{info}[Further Reading]
    Additional information...
\end{info}
\begin{warning}[Caution!][\faExclamationTriangle]
    Critical points to remember...
\end{warning}
\begin{important}[Key Point]
    Fundamental concept...
\end{important}
\begin{tip}[Calculation Tip][\faLightbulb]
    A faster method...
\end{tip}
\begin{reminder}[Memorize]
    Essential formulas...
\end{reminder}
\begin{summary}[In Brief]
    Main chapter points...
\end{summary}
\begin{toolbox}[Required Tools]
  \begin{itemize}
    \item Calculator
    \item Ruler
    \item Compass
  \end{itemize}
\end{toolbox}

All admonitions accept three optional parameters: - An optional title - A custom icon - Customization options (colors, borders)

Grading and Correction

Grading Tools

\gradingstrip

% Banner with specified total
\gradingstrip[20]

The totalpoints option sets the default total points.

\documentclass[totalpoints=20]{neoschool}
\mrk[Well done!]{1}     % Right margin with comment
\mrk*{1}                # Left margin

% Multiple points
\mrks{3}                % 3 points right margin
\mrks*[Scale]{3}        % 3 points left margin with text

Answer Areas

\answerfield{3}

% Area 80% width, 5 lines
\answerfield[0.8\linewidth]{5}
\answerframe{3}

% Frame 80% width, 5 lines
\answerframe[0.8\linewidth]{5}
\vardots

% 5cm dotted line
\vardots[5cm]

Markers and Symbols

\begin{itemize}
    \unchecked Goal 1 to complete
    \done      Goal 2 completed
    \wontfix   Goal 3 abandoned
\end{itemize}

Skills and Assessment

\competencies{
    Calculate derivatives\\
    Study variations\\
    Solve equations
}

The table automatically displays: - 4 mastery levels with emojis - Checkboxes for assessment

Math Commands and Special Tools

Math Commands

Highlighting and Coloring

$\mhl{x^2}$

% Custom highlighting
$\mhl[blue!20]{f'(x)}$

% In multi-line equations
\begin{align*}
    f(x) &= x^2 + \mhl{2x} + 1 \\
    f'(x) &= 2x + \mhl{2}
\end{align*}
$\mc{f(x)}$

% Custom color
$\mc[red]{g(x)}$

% In equation
\[ \mc{f'(x)} = \lim_{h \to 0} \mc[blue]{\frac{f(x+h)-f(x)}{h}} \]

APMEP Support

When the apmep option is activated, the following commands become available:

\vect{u}         % Vector u with arrow
\vectt{AB}       % Vector AB with spacing
\Oij             % Frame (O; i,j)
\Oijk            % Frame (O; i,j,k)
\Ouv             % Frame (O; u,v)
\euro            % Euro symbol
\cg              % Left bracket
\cd              % Right bracket
\pg              % Greater than or equal
\pp              % Less than or equal
\barre{x}        % Overlined x
\ds              % \displaystyle

Special Tools

Trees and Graphs

\begin{neotree}
A
    [B
        [D]
        [E]
    ]
    [C
        [F]
        [G]
    ]
\end{neotree}

% With edge weights
\begin{neotree}
A
    [B, w=\frac{1}{3}
        [D]
        [E]
    ]
    [C, w=\frac{2}{3}]
\end{neotree}
\neograph{
    A -- {B, C, D, F},
    B -- {C, D, F},
    C -> ["3"] D,
    D -- [bend left=10] {E},
    E -- [bend left=10] {D},
    E -- [bend left=10] {F},
    F -- [bend left=10] {E},
    A -- [loop] A
}

Math Grid

The mathgrid environment allows arranging equations in a grid:

\begin{mathgrid}{3}
    \neoline
    \neocol{
        T &= 7xx+9x\\
          &= (7+9)x \\
          &= 16x
    }
    \neocol{
        U &= 8x^{2}-5x^{2}+x^{2}\\
          &= (8-5+1)x^{2} \\
          &= 4x^{2}
    }
    \neocol{
        V &= 5a^{2}-6a\\
          &= a(5a-6)
    }
    \neoline
    \neocol[2]{
        W &= 5a^{2}-6a+3+7a^{2}+a-6\\
          &= (5+7)a^{2}+(-6+1)a+(3-6)\\
          &= 12a^{2}-5a-3
    }
    \neocol{
        A &= 2x + 3x\\
          &= 5x
    }
\end{mathgrid}