【工具】LaTeX(2)入門_字體_符號_章節

1.入門,字體和符號

重點關注頭部信息的寫法,如文檔類、環境等

入門
符號1
符號2
符號3
%筆記
%一個latex只能有一個document環境,即\begin{環境}
%空行為換行
%處理中文要求文檔為UTF-8格式
%ctex宏包說明>texdoc ctex
%簡單教程>texdoc lshort-zh
%texstudio ctrl+T注釋,ctrl+U取消注釋


%導言區(全局設置)
\documentclass{article}
%\documentclass{ctexart}
%\documentclass[10pt]{article}
%article,book,report,letter|ctexart
%10pt是參數,表示normal字體大小
\usepackage{ctex}%中文支持
\newcommand\degree{^\circ}%自定義命令,用于支持下面的\degree命令
\title{文件基本結構}
\author{ZJB}
\date{\today}

%正文區
\begin{document}
    %使標題信息生效
    \maketitle
    %普通文本
    Hello world!
    
    你好,\LaTeX!
    
    %行內公式
    inline formula, $f(x)=3x^2+x-1$,$g(x)=\frac{1}{2}x$ and so on.
    
    %塊公式
    block formula,$$\tanh(z)=\frac{e^z-e^{-z}}{e^z+e^{-z}}$$.
    
    %帶編號公式
    %degree自定義命令
    \begin{equation}
    AB^2=BC^2+AC^2,\angle C=90\degree
    \end{equation}
    
    %字體部分,大括號可以約束范圍
    %字體族設置(羅馬字體、無襯線字體、打字機字體)
    \textrm{Roman Family}
    \textsf{Sans Serif Family}
    \texttt{Typewriter Family}
    
    {\rmfamily Roman Family}
    {\sffamily Sans Serif Family}
    \ttfamily Typewriter Family
    
    The next paragraph is Typewriter Family too.
    \rmfamily%不限制范圍影響后續文本
    
    %字體形狀(直立、斜體、偽斜體、小型大寫)
    \textup{Upright Shape} \textit{Italic Shape} \textsl{Slanted Shape} \textsc{Small Caps Shape}
    
    {\upshape Upright Shape} {\itshape Italic Shape} {\slshape Slanted Shape} {\scshape Small Caps Shape}
    
    %字體設置(粗細、寬度)
    \textmd{Medium Series}
    \textbf{Boldface Series}
    
    {\mdseries Medium Series}
    {\bfseries Boldface Series}
    
    %中文字體,需要ctex宏包
    {\songti 宋體} \quad {\heiti 黑體} \quad {\fangsong 仿宋} \quad {\kaishu 楷書}
    
    中文\textbf{粗體}和\textit{斜體}
    
    %字體大小
    {\tiny          Hello}
    {\scriptsize    Hello}
    {\footnotesize  Hello}
    {\small         Hello}
    {\normalsize    Hello}
    {\large         Hello}
    {\LARGE         Hello}
    {\huge          Hello}
    {\Huge          Hello}
    
    %中文字大小
    調整前
    \zihao{4}
    調整后
    \zihao{5}
    調整回
    
    \newpage
    %特殊字符
    \section{空白符號}
    Multiple spaces is same as              one;
    
    中文內的空                          格不顯示;
    
    中英混排時chinese and english之間自動插入空格;
    
    
    
    多個空行等同于一個;
    
    自動縮進,不能用空格代替;
    
    手動空格用下列語句:
    
    %參考字符
    一二三四五六七
    
    %1em
    啊\quad 啊quad
    
    %2em
    啊\qquad 啊qquad
    
    %1/6em
    啊\thinspace 啊\,啊thinspace
    
    %0.5em
    啊\enspace 啊enspace
    
    %空格
    啊\ \ 啊\ 空格*2
    
    %手動設置
    啊\kern 1em 啊kern
    
    啊\hskip 1em 啊hskip
    
    啊\hskip 2em 啊hskip
    
    %占位寬度
    啊\hphantom{xyz} 啊hphantom
    
    %彈性長度
    啊\hfill 啊hfill
    \section{控制符}
    \# \$ \% \{ \} \~{} \_{} \^{} \textbackslash \&
    \section{排版符號}
    \S \P \dag \ddag \copyright \pounds
    \section{\TeX 標志符號}
    \TeX{} \LaTeX{} \LaTeXe{}
    \section{引號}
    ` ' `` ''
    \section{連字符}
    - -- ---
    \section{非英文字符}
    \oe \OE \ae \AE \aa \AA \o \O \l \L \ss \SS !` ?`
    \section{重音符號(o為例)}
    \`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}

2.文章基本結構

重點關注段落格式的全局設置,了解分章節等

文章結構
%文章結構

%導言區(全局設置)
%\documentclass{article}
\documentclass{ctexart}

%\usepackage{ctex}%中文支持
\newcommand\degree{^\circ}%自定義命令,用于支持下面的\degree命令
\title{文件基本結構}
\author{ZJB}
\date{\today}

%===全局格式設置===
\ctexset{
    section={
        format+=\zihao{-4} \heiti \raggedright,
        name={,、},
        beforeskip=1ex plus 0.2ex minus .2ex,
        afterskip=1ex plus 0.2ex minus .2ex,
        aftername=\hspace{0pt},
        number=\chinese{section}
    }
}

%正文區
\begin{document}
    %使標題信息生效
    \maketitle
    %目錄
    %\tableofcontents
    %文章提綱
    \section{背景}
    LaTeX(LATEX,音譯“拉泰赫”)是一種基于ΤΕΧ的排版系統,由美國計算機學家萊斯利·蘭伯特在20世紀80年代初期開發,\\*****{$\backslash\backslash$}換行*****利用這種格式,即使使用者沒有排版和程序設計的知識也可以充分發揮由TeX所提供的強大功能,能在幾天,甚至幾小時內生成很多具有書籍質量的印刷品。
    
    *****空行分段*****對于生成復雜表格和數學公式,這一點表現得尤為突出。\par *****{$\backslash$}par分段*****因此它非常適用于生成高印刷質量的科技和數學類文檔。這個系統同樣適用于生成從簡單的信件到完整書籍的所有其他種類的文檔。
    
    \section{方法}
    \subsection{方法一}
    \subsubsection{條件一}
    \section{結果}
    \subsection{數據}
    \subsection{圖表}
    \section{結論}
    \section{引文}
\end{document}
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。