课堂笔记 LaTeX 模板
免费的课堂笔记 LaTeX 模板,用彩色框标出定义、定理、例题和注记,自动编号,让一门课的结构一目了然。

LaTeX 源码
% !TEX program = xelatex
% 课堂笔记模板:用彩色框呈现定义、定理、例题和注记,含证明、一幅 TikZ 图和页眉(需用 XeLaTeX 编译,
% 第一行的魔法注释已设置)。模板中填入了一个简短示例(特征值与特征向量),方便你了解每种框的样式。请把示例换成你自己的笔记。
\documentclass[a4paper,11pt]{ctexart}
\usepackage[a4paper,margin=2.5cm]{geometry}
\usepackage{microtype}
\usepackage{amsmath,amssymb,mathtools}
\usepackage{amsthm}
\usepackage{enumitem}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage[most]{tcolorbox}
\usepackage[hidelinks]{hyperref}
% ---- 课程信息:请按需修改 ----
\newcommand{\coursename}{线性代数}
\newcommand{\notestitle}{特征值与特征向量}
\newcommand{\notesauthor}{你的姓名}
\newcommand{\notesdate}{2026 年秋季学期}
\title{\notestitle}
\author{\coursename \\ \notesauthor}
\date{\notesdate}
% 页眉与页脚
\pagestyle{fancy}
\fancyhf{}
\lhead{\coursename}
\rhead{\notestitle}
\cfoot{\thepage}
\setlength{\headheight}{14pt}
% 数集与常用算符的简写
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\DeclareMathOperator{\id}{Id}
% 按章节编号的框:定义、定理、例题和注记
\newtcbtheorem[number within=section]{definition}{定义}{colback=blue!5,colframe=blue!60!black,fonttitle=\bfseries}{def}
\newtcbtheorem[number within=section]{theorem}{定理}{colback=red!4,colframe=red!60!black,fonttitle=\bfseries}{thm}
\newtcbtheorem[number within=section]{example}{例题}{colback=green!4,colframe=green!45!black,fonttitle=\bfseries}{ex}
\newtcolorbox{remark}{colback=yellow!10,colframe=orange!70!black,title=注记,fonttitle=\bfseries}
\begin{document}
\maketitle
\thispagestyle{fancy}
\tableofcontents
\section{定义}
\begin{definition}{特征值与特征向量}{eigen}
设 $A$ 为 $n\times n$ 矩阵。若存在非零向量 $v\in\C^n$(称为\emph{特征向量}),使得
\begin{equation}
Av = \lambda v ,
\end{equation}
则称标量 $\lambda\in\C$ 为 $A$ 的\emph{特征值}。
\end{definition}
从几何上看,$A$ 只会拉伸(或翻转)特征向量,而不改变它的方向。
图~\ref{fig:eigen} 以下面例题~\ref{ex:matrix} 中的矩阵为例说明了这一点。
\begin{figure}[htbp]
\centering
\begin{tikzpicture}[scale=1.1, >=stealth]
\draw[->, gray] (-2.4,0) -- (3.4,0) node[right] {$x$};
\draw[->, gray] (0,-2.4) -- (0,3.4) node[above] {$y$};
\draw[->, thick, blue!70!black] (0,0) -- (1,1) node[below right] {$v_1$};
\draw[->, thick, blue!70!black, dashed] (0,0) -- (3,3) node[above left] {$Av_1=3v_1$};
\draw[->, thick, red!70!black] (0,0) -- (1,-1) node[below left] {$v_2$};
\draw[->, thick, red!70!black, dashed] (0,0) -- (1,-1);
\node[red!70!black, right] at (1.1,-1.2) {$Av_2=v_2$};
\end{tikzpicture}
\caption{矩阵 $A$ 将 $v_1=(1,1)$ 拉伸为原来的 $3$ 倍,而 $v_2=(1,-1)$ 保持不变。}
\label{fig:eigen}
\end{figure}
\section{主要结果}
\begin{theorem}{特征多项式}{charpoly}
标量 $\lambda$ 是 $A$ 的特征值,当且仅当 $\det(A-\lambda \id)=0$。
\end{theorem}
\begin{proof}
$Av=\lambda v$ 且 $v\neq 0$ 等价于 $(A-\lambda \id)v=0$ 有非零解。这恰好发生在
$A-\lambda \id$ 不可逆时,也就是它的行列式为零时。
\end{proof}
\begin{remark}
多项式 $p(\lambda)=\det(A-\lambda\id)$ 的次数为 $n$,因此 $A$ 至多有 $n$ 个不同的特征值。
在 $\C$ 上,计重数后它恰好有 $n$ 个特征值。
\end{remark}
\section{例题}
\begin{example}{一个对称矩阵}{matrix}
求下列矩阵的特征值与特征向量:
\[
A = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}.
\]
特征多项式为
\[
\det(A-\lambda\id) = (2-\lambda)^2 - 1 = (\lambda-1)(\lambda-3),
\]
所以特征值为 $\lambda_1=3$ 和 $\lambda_2=1$。解方程 $(A-\lambda_i\id)v=0$,
得到特征向量
\[
v_1 = \begin{pmatrix} 1 \\ 1 \end{pmatrix}, \qquad v_2 = \begin{pmatrix} 1 \\ -1 \end{pmatrix}.
\]
\end{example}
\begin{enumerate}[label=(\alph*)]
\item $A$ 的迹等于 $\lambda_1+\lambda_2=4$,行列式等于 $\lambda_1\lambda_2=3$。
\item 这两个特征向量正交:对于实对称矩阵,属于不同特征值的特征向量总是正交的。
\end{enumerate}
\end{document}