LaTeX学习笔记
1 使用TeXStudio实现LaTeX文档的编写
`\documentclass{article}`
`\usepackage{ctex}`
`\begin{document}
`你好,LaTeXe.`
`\end{document}`
2 LaTex 源文件的基本结构与中文处理方法
`% 导言区`
`\documentclass{article}%book,report, letter`
`\usepackage{ctex}%中文显示 ctex宏包有什么作用呢?cmd->texdoc ctex可以打开ctex宏包手册,查看ctex使用方法 。若上面用ctexart,ctexbook,ctexrep,此条命令可注释掉。查看帮助文件:cmd->texdoc lshort-zh`
`\newcommand\degree{^circ}%定义degree命令`
`\title{\heiti 杂谈勾股定理}%指定字体是黑体`
`\author{\kaishu WuKong Sun}`
`\date{\today}`
`% 正文区`
`\begin{document}`
`\maketitle`
`Hello,world!`
``
%here is my big formula
Let $f(x)$ be defined by the formula
$$f(x) = 3x^2 + x - 1$$ %$行内公式;$$公式另起一行
which is a polynomial of degree 2.
勾股定理可以用现代语言表述如下:
直角三角形斜边的平方等于两腰的平方和。
可以用符号语言表述为:设指教三角形$ABC$,其中$\angle C=90\degree$,则有:
\begin{equation}%产生带编号的行间公式
AB^2 = BC^2 + AC^2
\end{equation}
`\end{document}`
3 LaTex字体字号设置
%导言区
\documentclass[12pt]{article}
\usepackage{ctex}
%LaTex思想:格式与内容分离
%定义myfont命令(方便修改)
\newcommand{\myfont}{\textit{\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}
{\sffamily sfasfdasfdasfasdfargegrergasdfasddddddddddddddddddhbjk!}
{\ttfamily asdfasdgfagergwefasdfag
wef}
%字体系列设置(粗细、宽度)
\textmd{Medium Series} \textbf{Boldface Serise}
{\mdseries Medium Series} {\bfseries Boldface Series}
%字体形状(直立、斜体、伪斜体、小型大写)
\textup{Upright Shape} \textit{Italic Shape}
\textsl{Slanted Shape} \textsc{Small Caps Shape}
{\upshape Upright Shape} {\itshape Italic Shape} {\slshape Slanted Shape} {\scshape Small Cap Shape}
%中文字体
{\songti 宋体} \quad {\heiti 黑体} \quad {\fangsong 仿宋} \quad {\kaishu 楷书}%\quad 代表当前字体下两个汉字的空白距离
中文字体的\textbf{粗体}与\textit{斜体}%中文粗体用黑体表示,斜体用楷书表示
%字体大小 与导言区documentclass[10pt]{article}有关10pt~12pt
{\tiny Hello}\\
{\scriptsize Hello}\\
{\footnotesize Hello}\\
{\small Hello}\\
{\normalsize Hello}\\
{\large Hello}\\
{\Large Hello}\\
{\LARGE Hello}\\
{\huge Hello}\\
{\Huge Hello}\\
% 中文字号设置命令
\zihao{-0} 你好 %小初号
\zihao{5} 你好 %五号
%使用导言区定义的字体
\myfont
\end{document}
- cmd->texdoc ctex
- cmd->texdoc lshort-zh