跟着耿楠教授的视频教程 《latex中文教程》 学了一遍,并根据视频把课堂内容实际操作了一下,把实现的有关 TeX 文档记录整理到本文。

文章目录

  • 1 TeX 文件记录
    • 1.1 LaTeX 环境的安装与配置
    • 1.2 LaTeX 源文件结构
    • 1.3 LaTeX 中的中文处理办法
    • 1.4 LaTeX 的字体字号设置
    • 1.5 LaTeX 文档的基本结构
    • 1.6 LaTeX 中的特殊字符
    • 1.7 LaTeX 中的插图
    • 1.8 LaTeX 中的表格
    • 1.9 LaTeX 中的浮动体
    • 1.10 LaTeX 数学公式初步
    • 1.11 LaTeX 数学公式的矩阵
    • 1.12 LaTeX 数学公式的多行公式
    • 1.13 LaTeX 中的参考文献 BibTex
    • 1.14 LaTeX 中的参考文献 BibLaTex
    • 1.15 LaTeX 中的自定义命令和环境
  • 2 《LaTeX 中文教程》随堂练习源文件

1 TeX 文件记录

1.1 LaTeX 环境的安装与配置

% test.tex\documentclass{article}\usepackage{ctex}\begin{document}
你好, \LaTeX 。
\end{document}
% test_texstudio.tex\documentclass{article}\usepackage{ctex}\begin{document}你好, \LaTeXe 。
\end{document}

1.2 LaTeX 源文件结构

% latex_basic.tex% 导言区
\documentclass{article}
\title{My First Document}
\author{Shaofeng Gu}
\date{\today}% 正文区
\begin{document}\maketitleHello World!% here is my big formulaLet $f(x)$ be defined by the formula $$f(x)=3x^2+x-1$$ which is a polynomial of degree 2.
\end{document}

1.3 LaTeX 中的中文处理办法

% latex_zh.tex% 导言区
\documentclass{ctexbook}%\usepackage{ctex}\newcommand\degree{^\circ}\title{\heiti 杂谈勾股定理}
\author{\kaishu 张三}
\date{\today}% 正文区
\begin{document}\maketitle勾股定理可以用现代语言描述如下:直角三角形斜边的平方等于直角边的平方和。可以用符号语言表述为:设直角三角形 $ABC$,其中 $\angle C=90\degree$,则有:\begin{equation}AB^2 = BC^2 + AC^2.\end{equation}% here is my big formulaLet $f(x)$ be defined by the formula $$f(x)=3x^2+x-1$$ which is a polynomial of degree 2.
\end{document}

1.4 LaTeX 的字体字号设置

% latex_textFormat.tex% 导言区
\documentclass[10pt]{article}\usepackage{ctex}\newcommand{\myfont}{\textbf{\textsf{Fancy Text}}}% 正文区
\begin{document}% 字体族设置(罗马字体、无衬底字体、打字机字体)\textrm{Roman Family} \textsf{Sans Serif Family} \texttt{Typewriter Family}{\rmfamily Roman Family} {\sffamily Sans Serif Family} {\ttfamily Typewriter Family}\ttfamily who you are? you find ! who you are? you find ! who you are? you find ! who you are? you find !Are you?% 字体系列设置\textmd{Medium Series} \textbf{Boldface Series}{\mdseries Medium Series} {\bfseries Boldface Series}% 字体形状\textup{Upright Shape} \textit{Italic Shape} \textsl{Slanted Shape} \textsc{Small Caps Shape}%中文字体{\fangsong 仿宋} \quad {\kaishu 楷书} \quad {\songti 宋体} {\heiti 黑体}{\fangsong Fangsong}\rmfamily {\fangsong Fangsong}中文字体的\textbf{粗体}与\textit{斜体}% 字体大小的设置{\tiny          Hello}\\{\scriptsize    Hello}\\{\footnotesize  Hello}\\{\small         Hello}\\{\normalsize    Hello}\\{\large         Hello}\\{\Large         Hello}\\{\LARGE         Hello}\\{\huge          Hello}\\{\Huge          Hello}\\% 中文字号设置命令\zihao{-0} 你好% 自定义命令\myfont
\end{document}

1.5 LaTeX 文档的基本结构

% latex_docStruct.tex% 导言区
\documentclass[10pt]{ctexbook}%\usepackage{ctex}% 正文区
\begin{document}\tableofcontents\chapter{绪论}\section{引言}虽然场面依旧不好看,虽然全场也仅有2次射门,但在拼搏之后,精神没垮,意志还在,最终结果尚可。中国队1:1战平已经从12强赛中出现的沙特队。本场比赛,沙特队虽然已经出现,但并没有直接放水,只是相对踢得比较松弛,技术优势还是力压中国队一头。这也是中国队的场面不看好的原因所在。541或者532的阵型以防守为主。力保后防不失是李霄鹏的重点。\chapter{实验结果及分析}\section{实验方法}\section{实验结果}\subsection{数据}\subsection{图表}\subsubsection{实验条件}\subsubsection{实验过程}\chapter{结论及致谢}\section{结论}\section{致谢}\end{document}

1.6 LaTeX 中的特殊字符

% latex_specialChar.tex% 导言区
\documentclass{article}\usepackage{ctex}
\usepackage{xltxtra}
\usepackage{texnames}
\usepackage{mflogo}% 正文区
\begin{document}\section{空白符号}你多大How old     are you?% 1em(当前字体中M的宽度)a\quad b% 2ema\qquad b% 1/6ema\,b% 0.5ema\enspace b% 空格a\ b% 硬空格a~b% 1pc=12pt=4.218mma\kern 1pc ba\kern -2em ba\hskip 1em ba\hspace{35pt} b% 占位宽度axyzabcba\hphantom{abcxyz}b% 弹性长度a\hfill b\section{\LaTeX 控制符}\# \$ \% \{ \} \~{} \_{} \textbackslash\section{排版符号}\S \P \dag \ddag \copyright \pounds\section{\TeX 标志符号}% 基本符号\TeX{} \LaTeX{} \LaTeXe{}\XeLaTeX{}\section{引号}``你好''\section{连字符}a-b a--b a---b\section{非英文字符}\oe \OE \ae \AE \aa \AA \o \b \l \L \SS \ss !` ?`\section{重音符号}\`o \'o \^o \''o \~o \=o \.o \u{o} \v{o} \H{o} \r{o} \t{o} \b{o}
\c{o} \d{o}\end{document}

1.7 LaTeX 中的插图

% latex_graphics.tex% 导言区
\documentclass{ctexart}\usepackage{graphicx}
\graphicspath{{pics/}}% 正文区
\begin{document}\LaTeX{}中的插图:\includegraphics[height=5cm,angle=-45]{ping}\end{document}

1.8 LaTeX 中的表格

% latex_table.tex% 导言区
\documentclass{ctexart}%\usepackage{ctex}% 正文区
\begin{document}\begin{tabular}{| c | c | c | p{1.5cm} |}\hline 姓名 & 语文 & 数学 & 备注 \\\hline 张三 & 86 & 90 & 优秀 \\\hline李思思 & 75 & 52 & 补考另行通知 \\\hline\end{tabular}\end{document}

1.9 LaTeX 中的浮动体

% latex_float.tex% 导言区
\documentclass{ctexart}%\usepackage{ctex}\usepackage{graphicx}
\graphicspath{{pics/}}% 正文区
\begin{document}\LaTeX{}中\TeX 系统的吉祥物--- 小狮子见图\ref{fig-lion}。\begin{figure}[htbp]\centering\includegraphics[scale=0.3]{lion}\caption{\TeX 系统的吉祥物--- 小狮子}\label{fig-lion}\end{figure}\LaTeX{}中的成绩单见表\ref{tab-score}。\begin{table}[htbp]\centering\caption{成绩单}\label{tab-score}\begin{tabular}{| c | c | c | p{2cm} |}\hline 姓名 & 语文 & 数学 & 备注 \\\hline 张三 & 86 & 90 & 优秀 \\\hline李思思 & 75 & 52 & 补考另行通知 \\\hline\end{tabular}\end{table}\end{document}

1.10 LaTeX 数学公式初步

% latex_mathBasics.tex% 导言区
\documentclass{article}\usepackage{ctex}
\usepackage{amsmath}% 正文区
\begin{document}\section{简介}\LaTeX{}将排版内容分为文本模式和数学模式\section{行内公式}\subsection{美元符号}交换律是 $a+b=b+a$,如 $1+2=2+1=3$。\subsection{小括号}交换律是 \(a+b=b+a\),如 \(1+2=2+1=3\)。\subsection{math环境}交换律是 \begin{math}a+b=b+a\end{math},如 \begin{math}1+2=2+1=3\end{math}。\section{上下标}\subsection{上标}$3x^{20}-x + 2 = 0$$3x^{3x^{20}-x + 2}-x + 2 = 0$\subsection{下标}$a_0, a_1, a_2$$a_0, a_1, ..., a_{100}$\section{希腊字母}$\alpha$$\pi$$\Pi$\section{数学函数}$\sin^2 x + \cos^2 x = 1$$\sqrt[3]{2}$\section{分式}大约是原体积的$\frac{3}{4}$。$\frac{x}{x^2 + x + 1}$$\frac{\sqrt{x-1}}{\sqrt{x+1}}$$\frac{1}{1 + \frac{1}{x}}$$\sqrt{\frac{x}{x^2 + x + 1}}$\section{行间公式}\subsection{美元符号}交换律是$$a+b=b+a$$如$$1+2=2+1=3$$\subsection{中括号}交换律是\[a+b=b+a\]如\[1+2=2+1=3\]\subsection{displaymath}交换律是\begin{displaymath}a+b=b+a\end{displaymath}如\begin{displaymath}1+2=2+1=3\end{displaymath}\subsection{自动编号公式equation环境}交换律见式\ref{eq:commutative}:\begin{equation}a+b=b+a \label{eq:commutative}\end{equation}\subsection{不编号公式equation*环境}交换律见式\ref{eq:commutative2}:\begin{equation*}a+b=b+a \label{eq:commutative2}\end{equation*}\end{document}

1.11 LaTeX 数学公式的矩阵

% latex_matrix.tex% 导言区
\documentclass{ctexart}%\usepackage{ctex}
\usepackage{amsmath}% 正文区
\begin{document}\[\begin{matrix}0 & 1 \\1 & 0\end{matrix} \qquad\begin{pmatrix}0 & 1 \\1 & 0\end{pmatrix} \qquad\begin{bmatrix}0 & 1 \\1 & 0\end{bmatrix} \qquad\begin{Bmatrix}0 & 1 \\1 & 0\end{Bmatrix} \qquad\begin{vmatrix}0 & 1 \\1 & 0\end{vmatrix} \qquad\begin{Vmatrix}0 & 1 \\1 & 0\end{Vmatrix} \qquad\]% 可以使用上下标\[A = \begin{pmatrix}a_{11}^2 & a_{12}^2 & a_{13}^2 \\0 & a_{22} & a_{23} \\0 & 0 & a_{33}\end{pmatrix}\]% 常用省略号:\dots,\vdots,\ddots\[A = \begin{bmatrix}a_{11}^2 & \dots & a_{1n}^2 \\& \ddots & \vdots \\0 & & a_{nn}\end{bmatrix}_{n \times n}\]
\end{document}

1.12 LaTeX 数学公式的多行公式

% latex_multiMath.tex% 导言区\documentclass{ctexart}%\usepackage{ctex}
\usepackage{amsmath}
\usepackage{amssymb}% 正文区
\begin{document}\begin{gather}a + b = b + a   \notag \\ab = ba\end{gather}\begin{gather*}3 + 5 = 5 = 3 = 8 \\3 \times 5 = 5 \times 3 = 15\end{gather*}\begin{gather}3 + 5 = 5 = 3 = 8 \notag \\3 \times 5 = 5 \times 3 = 15  \\5 - 3 = 2\end{gather}\begin{align}a + b &= b + a  \\ab &= ba\end{align}\begin{align*}a + b &= b + a  \\ab &= ba\end{align*}\begin{align}a + b = b + a&  \\ab = ba&\end{align}\begin{equation}\begin{split}a + b &= b + a  \\ab &= ba\end{split}\end{equation}\begin{equation}D(x) = \begin{cases}1, & \text{如果} x \in \mathbb{Q}; \\0, & \text{如果} x \in \mathbb{R} \setminus \mathbb{Q}.\end{cases}\end{equation}\end{document}

1.13 LaTeX 中的参考文献 BibTex

% latex_reference.tex\documentclass{ctexart}%\usepackage{ctex}\bibliographystyle{alpha}\begin{document}这是另一个参考文献的引用:\cite{mittelbach2004}这是另一个参考文献的引用:\cite{_latex_2015}\nocite{*}\bibliography{test1,cnzi}\end{document}

1.14 LaTeX 中的参考文献 BibLaTex

(略过)

1.15 LaTeX 中的自定义命令和环境

% latex_newCommand.tex\documentclass{ctexart}\newcommand\PRC{People's Republic of \emph{China}}\newcommand\loves[2]{#1 喜欢 #2}\newcommand\hatedby[3][喜欢]{#2 #1 #3}\begin{document}\PRC\loves{小猫}{鱼}\hatedby[最爱]{小猫}{鱼}
\end{document}

2 《LaTeX 中文教程》随堂练习源文件

《LaTeX 中文教程》随堂练习源文件下载:随堂练习资料 (提取码:lfse)
在线写作平台: Overleaf,Online LaTeX Editor

耿楠《LaTeX 中文教程》随堂学习记录相关推荐

  1. stm32f103c8t6c语言教程,STM32f103C8T6入门学习记录.doc

    STM32f103C8T6入门学习记录 STM32 自 学 笔 记 作者:忙碌的小姚 新浪微博:@忙碌的小姚 新浪博客: /mlxiaoyao222 目录 STM32 自 学 笔 记1 第一章3 我与 ...

  2. Unity 3D官方教程——Adventure Game学习记录

    1.Interactable System: 1.Picture Interactable:Player走到SecurityRoom墙前的那张画 2.Fish Interactable鱼档前的交互 3 ...

  3. 【MySQL】黑马教程MySQL数据库 | 学习记录笔记

    MySQL概述 MySQL介绍 MySQL是一种关系型数据库(RDBMS),就是建立在关系模型基础上,由多张相互连接的二维表组成的数据库.像Excel表.特点:使用表存储数据,格式统一,便于维护:使用 ...

  4. eeglab中文教程系列 汇总

    eeglab中文教程系列 eeglab简介 教程目录 本教程为脑机学习者Rose发表于公众号:脑机接口社区 .QQ交流群:903290195 eeglab简介 eeglab是一个交互式的matlab工 ...

  5. LaTeX安装教程(TeX Live+TeXstudio)

    一.安装TeX Live 步骤: TeX Live下载地址 download from a nearby CTAN mirror texlivexxxx.iso,如texlive2020.iso 用D ...

  6. LaTeX中文学习教程 笔记

    视频地址: LaTeX中文学习教程(用于论文或稿件排版,15集全) 用LaTeX写期刊论文的详细教程 一.基本结构 % 导言区 \documentclass{article}%book,article ...

  7. 2019b官方手册中文版_数据科学|「最全」实至名归,NumPy 官方早有中文教程,结合深度学习,还有防脱发指南...

    文章须知 文章作者:机器之心 责任编辑:书生 审核编辑:阿春 微信编辑:玖蓁 本文转载自公众号 机器之心 (ID:almosthuman2014) 原文链接:「最全」实至名归,NumPy 官方早有中文 ...

  8. 撒花!《神经网络与深度学习》中文教程正式开源!全书 pdf、ppt 和代码一同放出...

    点击上方"AI有道",选择"置顶"公众号 重磅干货,第一时间送达 红色石头之前在某乎上回答"机器学习该怎么入门"这个问题的时候,曾经给入门学 ...

  9. OpenGL学习之VS2017+glfw+glew/glad/freeglut的基本配置与中文教程汇总

    找了很多资料,就先马一下.教程都是原版英文的中文翻译教程,都有完整的代码. 基本配置方法(在VS2017上搭建glfw+glew或者glfw+glad) 1. OpenGL+VS2017 环境配置(亲 ...

  10. Latex系列教程 汇总

    作为一个尝试用Latex写论文的菜鸡,零零散散花了一周的时间学习了Latex的一些基本操作,算是入门了吧QAQ,留着以后多写多练吧. 自己本来是想边看视频边写笔记的,但看到网上已经有前辈做得非常好了, ...

最新文章

  1. r语言删除csv中na行_r语言,csv数据,提取特定行
  2. 简易排水简车的制作 TurnipBit 系列教程
  3. easypoi 如何合并相同的列,如何在Java中的POI中使用XWPFTable合并单元格(或应用colspan)?...
  4. CRM Fiori Simulation pipeline应用点了bubble控件的实现
  5. [RabbitMQ]常用命令
  6. Berttransformer
  7. wps表格数字和名字分开_WPS表格怎么把一串数字用句号分?
  8. CENTOS7.8忘记ROOT密码,重置密码步骤
  9. WPF后台自定义文字带背景的选择状态按钮
  10. 【爱有失落时】风与渊
  11. Ubuntu 18安装谷歌浏览器
  12. 如何用iMazing备份恢复贪婪洞窟
  13. 打log的方式检查程序里面的问题 及示例代码 详解
  14. 拓端tecdat|使用Python中的ImageAI进行对象检测
  15. 南京南站新建的,地铁换乘这么麻烦?
  16. maven 配置远程仓库服务器密码
  17. survival cutoff值
  18. Android11.0 默认开启WLAN热点设置默认热点名称和密码
  19. 水深6到9米有鱼吗_红黄尾鲴鱼钓法大全(附配方)
  20. 计算机不断自动重启,电脑不断自动重启怎么办?

热门文章

  1. matlab crg格式,MatLab和FlightGear环境的配置及样例
  2. 永久删除暴风影音服务项,去除 stormliv.exe 进程
  3. 怎样把RStudio字体调大
  4. 今日复习的linux命令
  5. 有没有测试直播源的软件,直播源检测验证管理工具(电脑直播源检测助手)V1.2 最新版...
  6. 冒险岛079实现按地图编号自由传送的功能
  7. 自动接听电话的另一种思路(只需要root权限)
  8. 身份证OCR识别SDK
  9. VARCHART XGantt 甘特图如何创建和修改数据记录
  10. 计算机组成原理(白中英) 第八章 课后题答案