你试一下这样行不行吧。
用 texpad 打开文件,点击菜单栏的 file,选 reopen with encoding,在弹出的子菜单中选择 GBK。如果这时文件显示正常,就说明猜对了,源文件是 GBK 编码,如果不是就得继续在 reopen with encoding 里找别的编码,直到正常。
正常后,另存为,在 encoding(编码)选项中选择 UTF-8。
这个做法的前提是本身文件没有被破坏,否则在 reopen with encoding 那步,无论如何都正常不起来。
你试一下这样行不行吧。
用 texpad 打开文件,点击菜单栏的 file,选 reopen with encoding,在弹出的子菜单中选择 GBK。如果这时文件显示正常,就说明猜对了,源文件是 GBK 编码,如果不是就得继续在 reopen with encoding 里找别的编码,直到正常。
正常后,另存为,在 encoding(编码)选项中选择 UTF-8。
这个做法的前提是本身文件没有被破坏,否则在 reopen with encoding 那步,无论如何都正常不起来。
如果图片的大小不合适,LaTeX 默认就把浮动体放在另外一页,这个是浮动体自动的算法,用户最好不用管位置,做好交叉引用就行了。
\documentclass{article}
\usepackage{ctex,graphicx} % 我不鼓励这么用, 我的习惯是多写几个 \usepackage
\title{关于近20年的中国GDP数据的描述性统计(2003-2022)}
\author{第二组 乔鑫凯 李梦琪 郭建程}
\date{2月22日}
\begin{document}
\maketitle
箱线图又称为盒须图、盒式图或箱形图,是一种用作显示数据分散情况资料的统计图,因形状如箱子而得名。
下方给出了一个用来反映2003年至2022年中国GDP数据总量分布情况的箱线图,
\begin{figure} % 为了用 \caption 必须用浮动体, figure 是一类浮动体
\centering % 保证了图片居中
\includegraphics{example-image} % 我没有你的图片,换了一张图做展示, 图片的大小我没有调整
\caption{箱线图}
\end{figure}
\end{document}
\documentclass{article}
\usepackage{ctex}
\usepackage[top=2.5cm,bottom=2.5cm,left=2.5cm,right=2.5cm]{geometry}
\usepackage{graphicx}
\usepackage[labelformat=simple]{subcaption} % Modify
\renewcommand{\thesubfigure}{(\alph{subfigure})} % Add
\usepackage[hidelinks]{hyperref}
\usepackage{cleveref}
\crefformat{subfigure}{#2图~#1#3}
\begin{document}
\begin{figure}[htbp]
\centering
\begin{subcaptionblock}[b]{0.48\textwidth} % Modify
\centering
\includegraphics[width=\textwidth]{example-image-a}
\subcaption{子图 A}
\label{fig:subfig1}
\end{subcaptionblock} % Modify
\hfill
\begin{subcaptionblock}[b]{0.48\textwidth} % Modify
\centering
\includegraphics[width=\textwidth]{example-image-b}
\subcaption{子图 B}
\label{fig:subfig2}
\end{subcaptionblock} % Modify
\begin{subcaptionblock}[b]{0.48\textwidth} % Modify
\centering
\includegraphics[width=\textwidth]{example-image-c}
\subcaption{子图 C}
\label{fig:subfig3}
\end{subcaptionblock} % Modify
\hfill
\begin{subcaptionblock}[b]{0.48\textwidth} % Modify
\centering
\includegraphics[width=\textwidth]{example-image-a}
\subcaption{子图 A}
\label{fig:subfig4}
\end{subcaptionblock} % Modify
\caption{总图}
\label{fig:main}
\end{figure}
如\cref{fig:subfig2} 所示。
\end{document}
先来看这样的例子:
\documentclass{article}
\usepackage[fontset=none]{ctex}
\usepackage{xcolor}
\definecolor{mygreen}{RGB}{0,166,82}
\usepackage[papersize={10.5cm,14.85cm},scale=0.8,showframe]{geometry}
\setCJKmainfont[BoldFont=SimHei,ItalicFont=KaiTi,BoldItalicFont=FangSong]{SimSun}
\usepackage{zhnumber}
\usepackage{tcolorbox}
\newcounter{dytcb}
\tcbuselibrary{breakable}
\tcbuselibrary{skins}
\newenvironment{dytcb}[2][]%
{%
\begin{tcolorbox}[
enhanced,
frame empty,
interior empty,
coltitle=white,
fonttitle=\bfseries,
colbacktitle=mygreen,
rounded corners,
borderline={0.25mm}{0mm}{mygreen},
breakable,
top=4mm,
before skip=3.5mm,
attach boxed title to top left={yshift=-3mm,xshift=5mm},
boxed title style={boxrule=0pt,sharp corners=all},
title={第\stepcounter{dytcb}\zhdig{dytcb}}单元,
#1
]
#2
}{\end{tcolorbox}}
\begin{document}
\begin{dytcb}{H}
Hello, \LaTeX !
\end{dytcb}
Hello, \LaTeX !
\end{document}
我不是很懂 tcolorbox
,通过这例子,我大概猜一下,你的例子里的 H
其实被 dytcb
当成是第1个参数了。
\documentclass{article}
\usepackage{amsmath}
\usepackage{cases}
\usepackage{bm}
\begin{document}
\begin{numcases}{a=}
\dot{\bm{\lambda}} (t) &$= -\frac{\partial H}{\partial \bm{x}}$, \label{2-2-4} \\
\frac{\partial H}{\partial \bm{u}} &$= 0$, \label{2-2-5} \\
\dot{\bm{x}} &$= \bm{f} (t,\bm{x}, \bm{u})$, \notag
\end{numcases}
\end{document}
我使用如下命令编译出现了目录:
latexmk -pdfxe whu-beamer2015.tex
我用的操作系统是 Windows,但这不影响上述命令的使用,按理说 Ubuntu 上完整安装 texlive 也一样可以用。
截图失效就不放了。
这需要更改 nxuthesis.cls
文件。
比如说你想改“图2.1”的“2.1”字号,就需要找到 nxuthesis.cls
文件中关于 \thefigure
的定义,在第1707行
\renewcommand\thefigure{%
\xiaowu
\ifnum\c@chapter>\z@
\thechapter
\nxu@figure@number@separator
\fi
\@arabic\c@figure
}
这里的\xiaowu
前面有定义,见600行
\nxu@def@fontsize{xiaowu}{9bp}
如果你想改变“2.1”变大,将 \xiaowu
改为 \wuhao
即可。
其他内容以此类推。
我尝试了一下这样的代码:
\documentclass{ctexart}
\usepackage{tcolorbox}
\usepackage{wrapstuff}
\begin{document}
简单说一下勾股定理.
\begin{wrapstuff}[r]
\includegraphics[width=0.45\linewidth]{example-image.pdf}
\end{wrapstuff}
我们定义直角三角形的两条直角边为 $a$, $b$ 而斜边为 $c$,
那么有
\[ a^2 + b^2 = c^2. \]
如果设 $a=3$, $b=4$, 那么容易求出 $c=5$.
\begin{tcolorbox}[width=0.45\linewidth]
古代有``勾三股四弦五''的说法.
\end{tcolorbox}
\end{document}
做得极端点
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{table}
\centering
\begin{tabular}{lp{0.4\linewidth}}
\hline\hline
\multicolumn{1}{c}{\textbf{Notations}} & \textbf{Definition} \\ \hline
$ W_{0} $ & A matrix whose i,j elements are the length of the historical path from i to j, and no is 0 \\
$ W $ & A matrix whose i,j elements are the weight of the historical path from i to j, and no is 0 \\
$ I_{0}$ & A matrix whose i,j elements are from $W_{n}$, changing the no-zero element to 1 \\
$ f(W,n) $ & A function of $W$, details can be seen later \\
$ \mathbf{e_{i}}$ & Represents a column vector with only the i-th element being 1 \\
$ \operatorname{tr}{e_{i}} $ & A converted column of $e_{i}$ \\
$n_{0}(i,j) $ & Representing the number of edges passed by the corresponding historical path that $W_{0,i,j}$ presenting \\ \hline\hline
\end{tabular}
\caption{Notations Table}
\end{table}
\end{document}
zhfs
真的存在于你的电脑里吗?正常来讲,能够使用的字体应该都在 fc-list
的结果里,这个命令你可以先查查怎么用。
很早以前我见过这样的答案,但是我现在忘了在哪看到的了。
\documentclass{ctexart}
\usepackage{xeCJKfntef}
\usepackage{xcolor}
\usepackage{tagging}
\usetag{ans}% 注释掉该行语句不显示答案
\newcommand{\answer}[1]{\iftagged{ans}{\CJKunderline{#1}}{{\CJKunderline[textformat=\color{white}]{#1}}}}
\begin{document}
圆是\answer{到定点的距离等于定长的点的集合}.
圆是\answer{到定点的距离等于定长的点的集合}.
圆是\answer{到定点的距离等于定长的点的集合}.
圆是\answer{到定点的距离等于定长的点的集合}.
\end{document}
这么提问是希望我们对着图片再打一遍代码吗 :)
align
和它的不带标号的版本 align*
可以排列多列对齐的公式,列与列之间用 &
分隔,而且在 &
左右的公式分别按照右对齐、左对齐的方式排列,所以很多人在用多个 &
时就从观感上容易产生很大的间距,相信这点你已经知道。在使用时,&
一般会放 =
的前面:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
x &= t & x &= \cos t & x &= t^2 \\
y &= 2t & y &= \sin(t+1) & y &= e^t
\end{align*}
\end{document}
当然有时也可以放在二元运算符前面,只不过这时我通常会这么用(lshort-zh-cn
中也有类似的用法)
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
(a+b)^2 ={}& a^2 + b^2\\
& + 2ab
\end{align*}
\end{document}
alignat
及不带标号的 alignat*
则不在列与列之间产生间距,但可以手工增加间距。alignat
环境有一个参数,表示每行要对齐的公式个数,每两列一组,如下面把列间距设定为一个 \quad
的距离
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{2}
x &= \sin t & \quad & t \ge 0 \\
y &= \cos t & & t < 0
\end{alignat*}
\end{document}
看第2行第3列我没用 \quad
,但是间距依然保留下来,这是因为上一行的 \quad
位置必须在每一行都有所体现。它的这种特性就非常适合排版线性方程组
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{6}
& x_1 & & + x_2 & & +x_3 & &+ x_4 & &+ x_5 & &=1 \\
& x_1 & & & & +x_3 & & & & + x_5 & &=2 \\
& & & \mathbin{\phantom{+}}x_2 & & & & +x_4 & & & &=3
\end{alignat*}
\end{document}
关于 \mathbin
,可以参考 tex.stackexchange.com 的解释。\phantom
则是产生一个幻影。
可以考虑使用 wrpstuff
包处理图文混排,然后 tasks
包做题目的排版
问 texpad中文乱码