LaTeX tutorial -basic function

這次要來介紹 LaTeX 最基礎的排版功能,包含設定字體大小、字體樣式(粗體、斜體字、底線)、文件結構等

Start Using LaTeX

所有的程式碼都是可以在 VScode 上執行 (因為我用 VScode)

LaTeX 大致上的排版會長這樣

\documentclass[12pt]{article} 
\usepackage{}
\usepackage{}
\begin{document}
You can type here.
\end{document}
  • [] 中可以選擇字體大小紙張大小,例如 [10pt, letterpaper]
  • {}中可以選擇文件類別,例如 {article}{report}、或專門製作履歷的 {moderncv}
  • \usepackage{} 是用來載入套件,之後會說到
  • 文章開始與結束需打 \begin{document}\end{document}

以下為輸出範例

附上 overleaf 的更詳細解說

Settings of words

\textbf 是粗體, \underline是底線, \textit\emph都是斜體字

\textbf{bold text}\\ 
\underline{you can type text with an underline}\\
\textit{it's for italicized text}, \emph{have the same effect}
  • 使用 \\\newline來換行

我們可以用 {}來製造雙層的效果

\textbf{\textit{italicized bold text}}

以下為輸出範例

Document Structure

由大到小分別是

\part{part}
\chapter{chapter}
\section{section}
\subsection{subsection}
\subsubsection{subsubsection}
\paragraph{paragraph}
\subparagraph{subparagraph}
  • 特別注意, \chapter 僅適用於 report 或 book 樣式的文件。
  • 以 section 為例,可以選擇使用 \section{}\section*{}* 的用途是為章節加入數字,可以看以下範例

今天先介紹到這篇,下一篇的主題為 lists in LaTeX,用 LaTeX 做條列式筆記

--

--