diff --git a/.dockerignore b/.dockerignore index 4827b056d1d..90a5b6874e4 100644 --- a/.dockerignore +++ b/.dockerignore @@ -23,4 +23,6 @@ yarn.lock # IDEA *.iml *.ipr -*.iws \ No newline at end of file +*.iws + +*.tex \ No newline at end of file diff --git a/.gitignore b/.gitignore index cd05af32993..b9fd40e346e 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,6 @@ yarn.lock # IDEA *.iml *.ipr -*.iws \ No newline at end of file +*.iws + +\demo \ No newline at end of file diff --git a/docs/latex.md b/docs/latex.md index 69be6387f99..e42cff0e771 100644 --- a/docs/latex.md +++ b/docs/latex.md @@ -72,7 +72,7 @@ Supported Functions ``KaTeX:\\\`{a}`` \\`{a} | `KaTeX:\={a}` `\={a}` | `KaTeX:\"{a}` `\"{a}` | `KaTeX:\v{a}` `\v{a}` | `KaTeX:\^{a}` `\^{a}` | `KaTeX:\u{a}` `\u{a}` | -`KaTeX:\r{a}` `\r{a}` | +`KaTeX:\r{a}` `\r{a}` ### Delimiter Sizing @@ -156,6 +156,7 @@ Supported Functions `KaTex:\sout{abc}` | `\sout{abc}` | `KaTex:\boxed{\pi=\frac c d}` | `\boxed{\pi=\frac c d}` `KaTex:\$a_{\angl n}` _MD语法冲突_ | `$a_{\angl n}` | `KaTex:a_\angln` | `a_\angln` `KaTex:\phase{-78^\circ}` | `\phase{-78^\circ}` +`KaTex:\overset{a}{B}` | `\overset{a}{B}` | `KaTex:\underset{a}{B}` | `\underset{a}{B}` \tag{hi} x+y^{2x} @@ -202,6 +203,7 @@ Supported Functions | `KaTex:f'` | `f'` | `KaTex:\underline{abc}` | `\underline{abc}` | `KaTex:\overleftarrow{abc}` | `\overleftarrow{abc}` | | `KaTex:\sqrt{abc}` | `\sqrt{abc}` | `KaTex:\widehat{abc}` | `\widehat{abc}` | `KaTex:\overbrace{abc}` | `\overbrace{abc}` | | `KaTex:\sqrt[n]{abc}` | `\sqrt[n]{abc}` | `KaTex:\widetilde{abc}` | `\widetilde{abc}` | `KaTex:\underbrace{abc}` | `\underbrace{abc}` | +|`KaTex:\frac{d^n y}{d x^n}`| `\frac{d^n y}{d x^n}` | `KaTex:\int_{b}^{a} \,dx` | `\int_{b}^{a} \,dx` | `KaTex:\lim_{x \to \infty}` | `\lim_{x \to \infty}` | ### 分隔符 Delimiters @@ -891,6 +893,7 @@ x = \begin{cases} `KaTex:\LARGE AB` | `\LARGE AB` | `KaTex:\LARGE AB` | `\LARGE AB` | `KaTex:\footnotesize AB` | \footnotesize AB `KaTex:\Large AB` | `\Large AB` | `KaTex:\Large AB` | `\Large AB` | `KaTex:\scriptsize AB` | \scriptsize AB `KaTex:\large AB` | `\large AB` | `KaTex:\large AB` | `\large AB` | `KaTex:\tiny AB` | \tiny AB +`KaTex:\mathcal{AB}` | `\mathcal{AB}` | `KaTex:\mathak{AB}` | `\mathak{AB}` | `KaTex:\mathbb{AB}` | `\mathbb{AB}` | `KaTex:\mathsf{AB}` | `\mathsf{AB}` ### Style 样式 @@ -900,7 +903,165 @@ x = \begin{cases} `KaTex:\displaystyle\sum_{i=1}^n` | \displaystyle\sum_{i=1}^n | `KaTex:\textstyle\sum_{i=1}^n` | \textstyle\sum_{i=1}^n `KaTex:\scriptstyle x` | \scriptstyle x | `KaTex:\scriptscriptstyle x` | \scriptscriptstyle x `KaTex:\lim\limits_x` | \lim\limits_x | `KaTex:\lim\nolimits_x` | \lim\nolimits_x -`KaTex:\verb!x^2!` | \verb!x^2! +`KaTex:\verb!x^2!` | \verb!x^2! | `KaTeX:\mathbf{a}` `\textbf{a}` | +`KaTeX:\mathit{a}` `\textit{a}` | `KaTeX:\textup{a}` `\textup{a}` | `KaTeX:\textsl{a}` `\textsl{a}` | `KaTeX:\textsc{a}` `\textsc{a}` | `KaTeX:\underline{a}` `\underline{a}` + +列表,图片,表格表示 +--- + +### 列表 + +```latex +| - First item | +| - Second item | +\begin{enumerate} + \item First item + \item Second item +\end{enumerate} + +| 1. First item | +| 2. Second item | +\begin{itemize} + \item First item + \item Second item +\end{itemize} + +|First item | +|Second item | +\begin{description} + \item First item + \item Second item +\end{description} +``` + +### 图片 + +```latex +% 展示单张图像 +\usepackage{graphicx} +\begin{figure}[htbp] + \centering + \includegraphics[width=0.8\textwidth]{path/to/your/image.jpg} + \caption{Caption for the single figure.} + \label{fig:singlefig} +\end{figure} + +% 展示多张图像 +\usepackage{graphicx} +\usepackage{subcaption} +\begin{figure}[htbp] + \centering + \begin{subfigure}[b]{0.45\textwidth} + \centering + \includegraphics[width=\textwidth]{path/to/your/image1.jpg} + \caption{First subfigure} + \label{fig:sub1} + \end{subfigure} + \hfill % 在子图之间添加水平间距 + \begin{subfigure}[b]{0.45\textwidth} + \centering + \includegraphics[width=\textwidth]{path/to/your/image2.jpg} + \caption{Second subfigure} + \label{fig:sub2} + \end{subfigure} + \caption{Caption for the entire figure} + \label{fig:mainfig} +\end{figure} +``` + +### 表格 + +```latex +\begin{table}[hbpt] % 使用 longtable 包创建可以跨页的表格 + \centering % 居中表格 + \caption{Example Table} + \label{tab:example} + \begin{tabular}{|c|l|r|} % 对齐列:居中、居左、居右 + \hline % 插入一条水平线 + \textbf{Column 1} & \textbf{Column 2} & \textbf{Column 3} \\ \hline + Data 1 & Data 2 & Data 3 \\ % 数据 + Data 4 & Data 5 & Data 6 \\ \hline + \end{tabular} +\end{table} +``` + +LaTex排版 +---- + +### 调整页边距和页面类型 + +```latex +\usepackage[left=3cm, right=3cm, top=2cm, bottom=2cm]{geometry} or \geometry{left=3cm, right=3cm, top=2cm, bottom=2cm} + +\usepackage[a4paper]{geometry} % 另有a5paper, b5paper, letterpaper等格式 +``` + +### 页面分割和布局 + +```latex +\quad | 添加空格 +\qquad | 双空格 +\vspace{} | 增加纵向间距 +\hspace{} | 增加横向间距 +\newpage | 开始新的一页 +\clearpage | 清除当前页,并处理所有未处理的浮动体 +\vfill | 在当前页面的剩余空间中插入垂直空白 +``` + +### 页面页眉和页脚 + +```latex +\usepackage{fancyhdr} +\pagestyle{fancy} + +\fancyhf{} | 清除所有页眉和页脚字段 +\fancyhead[L]{Left header} | 左页眉 +\fancyhead[C]{Center header} | 中页眉 +\fancyhead[R]{Right header} | 右页眉 +\fancyfoot[L]{Left footer} | 左页脚 +\fancyfoot[C]{\thepage} | 页脚中央的页码 +\fancyfoot[R]{Right footer} | 右页脚 +``` + +其他 +---- + +### bib文献管理 + +```latex +\cite{example} | 在文本中引用 + +\bibliographystyle{plain} | 设定引用格式 +\bibliography{references} | 假设.bib文件名为 'references.bib' +``` + +### URL + +```latex +\usepackage{hyperref} | 加载 hyperref 包以增强 PDF 文档的交互性,如添加超链接和书签 + +\href{URL}{text} | 创建一个指向 URL 的超链接 +\url{URL} | 显示 URL 并作为链接 +``` + +### 颜色和盒子 + +```latex +\usepackage{color} | 使用 color 包来给文本添加颜色 + +\color{color} | 设置文本颜色 +\fbox{content} | 在内容周围创建一个边框 +``` + +### 多栏布局 + +```latex +\usepackage{multicol} | 使用 multicol 包创建多栏文本 + +\begin{multicols}{num} ... \end{multicols} | 开始一个多栏环境,其中 num 指定列数 +\onecolumn | 文档从当前位置开始变为单列格式 +\twocolumn | 文档从当前位置开始变为双列格式 +``` 另见 ----