Note-Lightning-Portal

LaTeX Document Templates - Comprehensive Guide

This guide provides detailed instructions for using the LaTeX templates in this repository.

📌 Source: These templates are sourced from MIStatlE/math-to-ml-. Special thanks to the original authors!

Table of Contents

Getting Started

Prerequisites

  1. TeX Distribution: Install a TeX distribution that includes XeLaTeX or LuaLaTeX:
  2. Fonts:
    • For Chinese templates: Noto Serif CJK SC or FandolSong
    • For English templates: Times New Roman

First Steps

  1. Copy the desired template to your working directory
  2. Open the .tex file in your preferred editor
  3. Modify the title, author, and content
  4. Compile using XeLaTeX or LuaLaTeX

Template Descriptions

article-cn.tex (Chinese Article)

A clean Chinese article template optimized for academic papers and research notes.

Features:

Best for: Chinese academic papers, research reports, course notes

article-en.tex (English Lecture Notes)

Traditional lecture notes format inspired by academic course materials.

Features:

Best for: Course lecture notes, tutorials, academic handouts

article-modern.tex (Modern Article)

A visually appealing modern template with sidebar design elements.

Features:

Best for: Technical blog posts, series articles, modern academic notes

article-enhanced.tex (Enhanced Article)

Enhanced version with beautiful colored theorem environments.

Features:

Best for: Mathematics papers, proof-heavy documents, advanced lecture notes

book.tex (Book Template)

Complete book template with frontmatter, mainmatter, and backmatter.

Features:

Best for: Textbooks, comprehensive guides, thesis documents

Customization

Colors

All templates use a consistent color palette that you can customize:

\definecolor{brand}{HTML}{1A9D8F}      % Primary teal
\definecolor{brandD}{HTML}{2A7F6F}     % Dark teal
\definecolor{keybg}{HTML}{E8F4F1}      % Light teal background
\definecolor{keydark}{HTML}{2F5E58}    % Dark teal for text
\definecolor{accent}{HTML}{FF6B6B}     % Accent red
\definecolor{accentD}{HTML}{D94F4F}    % Dark accent red

Page Layout

Modify page dimensions in the geometry package:

\geometry{paperwidth=7.5in, paperheight=10in, margin=0.7in}

For standard A4:

\geometry{a4paper, margin=1in}

Fonts

Change the main font:

\setmainfont{Your Font Name}
\setCJKmainfont{Your CJK Font}  % For Chinese

Headers and Footers

Customize using fancyhdr:

\fancyhead[L]{Left Header}
\fancyhead[R]{Right Header}
\fancyfoot[C]{\thepage}

Theorem Environments

Basic Usage

\begin{theorem}[Optional Title]
Your theorem statement here.
\end{theorem}

\begin{lemma}
A supporting lemma.
\end{lemma}

\begin{definition}[Key Concept]
Your definition here.
\end{definition}

Proof Environment

\begin{proof}
Your proof steps here.
\end{proof}

% Custom proof title (Chinese)
\begin{proof}[证明]
证明步骤...
\end{proof}

Colored Boxes

Key Idea Box

\begin{KeyBox}
Main insight or key concept to remember.
\end{KeyBox}

Takeaway Box

\begin{Takeaway}
Summary of important points.
\end{Takeaway}

Example Box

\begin{Example}
A worked example demonstrating the concept.
\end{Example}
\begin{SideBar}
\textbf{Context:} Background information or reading notes.
\end{SideBar}

Semantic Highlights (article-enhanced.tex)

\KeyIdea{Important concept}    % Light teal background
\Term{Technical term}          % Deep blue bold text
\Emph{Emphasized text}         % Red bold text
\Confuse{Unclear part}         % Red background highlight
\Info{Additional information}  % Blue informational text

Compilation

Command Line

# Single compilation
xelatex document.tex

# With bibliography
xelatex document.tex
biber document
xelatex document.tex
xelatex document.tex

VS Code + LaTeX Workshop

Add to your settings.json:

{
  "latex-workshop.latex.tools": [
    {
      "name": "xelatex",
      "command": "xelatex",
      "args": [
        "-synctex=1",
        "-interaction=nonstopmode",
        "-file-line-error",
        "%DOC%"
      ]
    }
  ],
  "latex-workshop.latex.recipes": [
    {
      "name": "xelatex",
      "tools": ["xelatex"]
    }
  ]
}

Overleaf

  1. Upload the template files
  2. Set the compiler to XeLaTeX in project settings
  3. Compile as usual

Troubleshooting

Font Not Found

Error: Font "Noto Serif CJK SC" not found

Solution: Install the font or use the fallback:

\setCJKmainfont{FandolSong}

Chinese Characters Not Displaying

Solution: Ensure you’re using XeLaTeX or LuaLaTeX, not pdfLaTeX.

Package Conflicts

Error: Option clash for package xxx

Solution: Load conflicting packages before \documentclass or remove duplicate loads.

tcolorbox Errors

Solution: Make sure you have tcolorbox with the most library:

\usepackage[most]{tcolorbox}

Undefined Control Sequence

Solution: Check for missing packages or typos in command names.


Credits

These LaTeX templates are sourced from:

We extend our gratitude to the original authors for creating and sharing these beautiful templates.


For additional help, please open an issue on the GitHub repository.