latex学习
第一段代码
\documentclass{article} \usepackage{ctex} \begin{document} \section{文字} 特可爱模板 \section{数学} \[ a^2=b^2+c^2 \] \end{document}
第二段代码
\documentclass[UTF8]{ctexart}
\title{杂谈勾股定理}
\author{张三}
\date{\today}
\bibliographystyle{plain}
\begin{document}
\maketitle
\tableofcontents
\section{勾股定理在古代}
\section{勾股定理的近代形式}
\bibliography{math}
\end{document}
第三段代码
\documentclass[UTF8]{ctexart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{titlesec}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{subfig}
\usepackage{hyperref}
\usepackage{fancyhdr}
\usepackage{pdfpages}
\usepackage{hyperref}
\usepackage{geometry}
\usepackage{CJK}
\title{杂谈勾股定理}
\author{张三}
\date{\today}
\bibliographystyle{plain}
\begin{document}
\maketitle
\tableofcontents
\section{勾股定理在古代}
\section{勾股定理的近代形式}
\bibliography{math}
\end{document}
《latex入门》第一章
\documentclass[UTF8]{ctexart} %导言区开始 \usepackage{graphicx} \usepackage{float} \usepackage{amsmath} \usepackage{geometry} %\usepackage[format=hang,font=small,textfont=it]{caption} %\geometry{a6paper,centering,scale=0.8} \newtheorem{thm}{定理}%声明 \title{\heiti 杂谈勾股定理} \author{\kaishu 张三} \date{\today} \bibliographystyle{plain} %导言区结束 \begin{document} \maketitle \begin{abstract} 这是一篇关于勾股定理的小短文 \end{abstract} \tableofcontents \section{勾股定理在古代} \section{勾股定理的近代形式} \bibliography{math} ......见于欧几里得\footnote{欧几里得,约公元前330--275年。}《几何原本》的..... ......的整数成为\emph{勾股数} ......答周公问: \begin{quote} 勾广三,股修四,径隅五。 \end{quote} 又载陈子(约公元前7--6世纪)答荣方问: \begin{quote} \zihao{-5}\kaishu 若求邪至日者,以日下为沟,日高为股,勾股各自乘,并而开方除之,得邪至日。 \end{quote} 都较古希腊更早。...... \begin{thm}[勾股定理] 直角三角形斜边的平方等于两腰的平方和。 可以用符号语言表述为...... \end{thm} \begin{equation} a(b+c)=ab+ac \end{equation} $\angle ACB =\pi /2$ \begin{equation} AB^2=BC^2+AC^2 \end{equation} $2^{10}=1024$ $90^\circ$ $A_{5}$ \begin{tabular}{|rrr|} \hline 直角边$a$&直角边$b$ &斜边$c$ \\ \hline 3 & 4 & 5\\ 5 & 12 & 13\\ \hline \end{tabular} \begin{table}[H]%usepackage{float},不浮动 \begin{tabular}{|rrr|} \hline 直角边$a$&直角边$b$ &斜边$c$ \\ \hline 3 & 4 & 5\\ 5 & 12 & 13\\ \hline \end{tabular} \qquad ($a^2+b^2=c^2$) \end{table} \begin{equation}\label{eq:gougu} AB^2=BC^2+AC^2 \end{equation} 满足式\eqref{eq:gougu}的整数称为\emph{勾股数} café \quad Gödel \quad Antonín Dvořák χα ``\,`A' or `B?'\,'' he asked. She $\dots$ she got it. \begin{enumerate} \item 中文 \item English \item Francais \end{enumerate} \begin{quote} 学而时习之,不亦说乎? 有朋自远方来,不亦乐乎? \end{quote} \begin{quote} 学而时习之,不亦说乎? 有朋自远方来,不亦乐乎? \end{quote} \begin{itemize} \item 中文 \item English \item Francais \end{itemize} \begin{description} \item[中文] 中国的语言文字 \item[English] The language of England \item[Francais] La lanue de France \end{description} \end{document}
第4段
\documentclass[UTF8]{ctexart} \usepackage{amsmath} \usepackage{mathdots} \usepackage{mathtools} \usepackage{breqn} \usepackage{amsfonts} \begin{document} \[ A= \begin{pmatrix} a_{11} & a_{22} & a_{13} \\ 0 & a_{22} & a_{23} \\ 0 & 0 & a_{33} \end{pmatrix} \] \[ A=\begin{bmatrix} a_{11} & \dots & a_{1n} \\ & \ddots & \vdots \\ 0 & 0 & a_{nn} \end{bmatrix}_{n\times n} \] 复数$z=(x,y)$也可用矩阵\( ( \begin{smallmatrix} x & -y\\ y &x \end{smallmatrix} ) \)来表示 \[ \sum_{\substack{0<i<n \\0<j<i}} A_{ij} \] \[ \bordermatrix{ & 1 & 2 & 3 \cr 1 & A & B & C \cr 2 & D & E & F \cr} \] $e^{\pi i}+1=0$ \[ \mathcal{F}(x) =\sum_{k=0}^\infty \oint_0^1 f_k(x,t) \,\mathrm{d}t \] \[ \int f(x) \,\mathrm{d} x \] \newcommand\diff{\,\mathrm{d}} \[ \iint\limits_{0<x,y,z<1} f(x,y,z) \diff x \diff y \diff z\] $\cos 2x = \cos(x+x) = \cos^2x -\sin^2x$ \newcommand\defeq{\stackrel{\text{d}}{=}} %stackrel产生堆叠的效果 $f(x) \defeq ax^2+bx+c$ \[ A \xleftarrow{0<x<1} B \xrightarrow[x \leq 0]{x \geq 1} C \] \\ $x=y \implies x+a=y+a$ \\ $x=y \impliedby x+a=y+a$ \\ $x=y \iff x \le y \And x \ge y$ \[ a \mathbin{\heartsuit} b = b \mathbin{\heartsuit} a \] \newcommand\varnotin{% %这里为什么要加%呢?需要查阅一下,应该是间隔的问题 \mathrel{\overline{\in}}} $\forall x$,$\forall S$,$x\varnotin S$ \newcommand*\abs[1]{\lvert#1\rvert} $\abs{x+y} \le \abs{x} +\abs{y}$ \[ \partial_x \partial_y \left[ \frac12 \left( x^2+y^2 \right)^2 +xy \right] \] \[ \left. \int_0^x f(t,\lambda) \,\mathrm{d}t \right |_{x=1},\qquad \lambda \in \left[\frac12,\infty \right). \] \[ \Pr \left( X>\frac12 \middle| Y=0 \right) = \left. \int_0^1 p(t)\,\mathrm{d}t \middle/ (N^2+1) \right. \] \[ \biggl( \sum_{i=1}^n A_i \biggr) \cdot \biggl( \sum_{i=1}^n B_i \biggr) >0 \] $1+ \Bigl( 2-\bigl(3 \times (4 \div 5) \bigr) \Bigr)$ \[ P= \biggl< \frac12 \biggr>,\qquad M=\left< \begin{matrix} a&b \\ c & d\\ \end{matrix} \right> \] $a:b=ac:bc$ \[ \Pr(x\colon g(x)>5) = 0.25, \qquad g\colon x \mapsto x^2 \] \[ (1,\dots,n) \qquad 1+\dots+n \qquad a=\dots=z \] \begin{align} &(a+b)(a^2-ab+b^2) \notag \\ ={} & a^3-a^2b+ab^2+a^2b-ab^2 +b^2 \notag \\ ={} & a^3 +b^3 \end{align} \begin{flalign} x &= t &x &=2 \\ y &= 2t & y &=4 \end{flalign} \begin{alignat}{2} x&=\sin t&\quad &\text{水平方向} \\ y&=\cos t& &\text{垂直方向} \end{alignat} \begin{align*}{2} x^2+2x&=-1 \intertext{移项得} x^2+2x+1&=0 \end{align*} 设$G$是一个带有运算$*$的集合,则$G$是\emph{群},当且仅当: \begin{subequations}\label{eq:group} \begin{alignat}{2} \forall a,b,c &\in G, &\qquad (a*b)*c &=a*(b*c);\label{subeq:assoc} \\ \exists e, \forall a &\in G, & 3*a &= a;\\ \forall a ,\exists b &\in G, & b*a&=e. \end{alignat} \end{subequations} 式~\eqref{eq:group} 的三个条件中,\eqref{subeq:assoc}~又称为结合律 \begin{multline} a+b+c \\ +d+e+f\\ +g+h+i\\ +j+k+l \end{multline} \begin{equation} \begin{split} \cos 2x &= \cos^2x-\sin^2x\\ &=2\cos^2x-1 \end{split} \end{equation} \begin{dmath} \frac12(\sin(x+y) +\sin(x-y)) =\frac12(\sin x\cos y+\cos x \sin y)+\frac12(\sin x\cos y-\cos x\sin y)=\sin x \cos y) \end{dmath} \begin{equation} D(x)=\begin{cases} 1,& \text{if } x \in \mathbb{Q};\\ 0,& \text{if } x \in \mathbb{R} \setminus \mathbb{Q}. \end{cases} \end{equation} \[ \left\lvert x-\frac12 \right\rvert =\begin{dcases} x-\frac12,& x \geq \frac12;\\ \frac12-x,& x<\frac12. \end{dcases} \] \end{document}