图片相关问题
图片遮挡段前文字的半截
注:没有找到完全的解决方法。
由于用的是双栏格式,有些文章写的将\begin{figure}改成\begin{figure*}并不正确,这会导致图片是单栏显示。目前的临时解决办法是\vspace增加段前间距如下:
\begin{figure}
\centering
\vspace{0.5cm}%增大一点间距
\subfigure[]{
\begin{minipage}
\includegraphics[width=1\textwidth]{图1}\
\end{minipage}
}\hspace{-2mm}%这里也可以相应增加或减少图间距
\subfigure[]{
\begin{minipage}
\includegraphics[width=1\textwidth]{图1}\\
\end{minipage}
}
\end{figure}
在pdf中插入生成动图
- 若只有gif没有图片可以利用gif拆分软件:imagemagick 使用其中的convert.exe
- 图片大小可以自定义;
- autoplay:增加自动播放功能;建议加上;
- loop:每秒播放多少张图(相当于帧数):后面的3就是每秒3张,注意不是时间;
- controls:增加控制按钮(包括暂停、前进、后退等);建议加上;
- 后面三个括号表示制作连续动画的图片为文件夹folder中的name1-name11.
\usepackage{graphicx}
\usepackage{animate} %必须在graphicx包后面
\begin{figure}
\centering
\animategraphics[width=9cm, height = 9cm, autoplay, loop, controls]{3}{./folder/name}{1}{11}
\caption{名称}
\label{cite label}
\end{figure}
子图
插入子图的时候把subfigure改成subfloat,忘了前者不好用的原因,但后者更方便一些。
\usepackage{stfloats} %所需包
\usepackage{float}
\begin{figure}
\centering
\subfloat[]{\includegraphics[width=0.25\textwidth,trim = {20 0 20 10}]{fig1} ,\label{fdc0}}
\subfloat[]{\includegraphics[width=0.25\textwidth,trim = {20 0 20 10}]{fig2} ,\label{fdr0}}\\
\vspace{-3mm}
\subfloat[]{\includegraphics[width=0.25\textwidth,trim = {20 0 20 10}]{fig3} ,\label{fdc2}}
\subfloat[]{\includegraphics[width=0.25\textwidth,trim = {20 0 20 10}]{fig4} ,\label{fdr2}}
\caption{}
\label{}
\end{figure}
eps编译
提交论文的时候需要eps格式的文件,但我一直是用PPT画图,保存的图片都是png文件格式,所以我先用PNG转EPS - 免费在线将PNG文件转换成EPS (cdkm.com)将png批量转成eps。但是在latex中会编译报错,比如!!Error: Input filename '*.eps' not allowed in restricted mode. Error: File `*-eps-converted-to.pdf' not found: using draft setting.就是eps生成不了对应的pdf,试过添加\usepackage{epsfig,epstopdf}、用latex代替pdfLatex编译、或者添加如下代码但都没用
\usepackage[pdftex]{graphicx}
\DeclareGraphicsExtensions{.pdf,.jpeg,.png}
\usepackage{epstopdf}
最后所以参考TeXLive2023 pdflatex编译eps图像,出现错误的问题直接改了TeXstudio配置文件,方便快捷。
公式相关问题
公式快捷键
以前在行内插入公式的时候是挨个加入$$的, 现在可以选中公式ctrl+shift+M就可以了。
ctrl+B加粗公式=\textbf,和\mathbf一样加粗的时候会失去斜体效果,但两个的粗体效果不一样且\textbf不能对希腊字母加粗。保存斜体的加粗方式可以试试\boldmath(需要amsmath包)。
对希腊字母加粗 \boldsymbol(需要amsmath包)
公式换行
换行除了在需要回车的地方加入\\和需要对其的地方加入&后,一定要加入aligned块,否则报错。
\begin{equation}
\begin{aligned}
\label{equ}
h = &A \\
&\cdot B.
\end{aligned}
\end{equation}
公式跨栏
现在大多数期刊都是双栏,有些公式比较长的话可能需要跨栏写。利用strip的方法如下:
\usepackage{cuted} % 要加包
\begin{strip}
\begin{equation}
equation
\end{equation}
\end{strip}
公式会出现按照写作顺序显示,往上或往下的内容也以此作为分界线分开。如果需要将其写在文章的最后,则是:
\begin{figure*}[hb] % 置顶是ht,置底为hb
\hrulefill %那条分界线
\begin{equation}
equation
\end{equation}
\end{figure*}
但我实际上是想放在当前页的底部。之后又找到一个方法是放在下页底,等我把本页底的方法找到再说。(latex好笨)
格式
文章中的超链接有方框,可以在最前面加上
\hypersetup{hidelinks}