1.LaTeX 设置图片caption左对齐
\captionsetup{justification=raggedright,singlelinecheck=false} % 图片标题左对齐
这个作为宏包,或者放在图里都可以。
我觉得放图里效果更好。
2. LaTeX中引用参考文献、章节、图表,并跳转
\usepackage[colorlinks,linkcolor=blue,anchorcolor=blue,citecolor=blue]{hyperref} % 跳转
3.图的标题默认显示方式为Figure 1:,现在需要把它变为Fig. 1.的样子
\captionsetup[figure]{name={Fig.},labelsep=period}
4.只有一张图,图上有abcd,而不是引入四张图。怎么引用小标题的标签去跳转?
如果你只有一张图,并且在图中标记了 "(a)", "(b)", "(c)", "(d)",而不是通过子图环境放置了子图,那么你可以使用 \phantomsubcaption
来创建不可见的子标题,并使用标签来进行引用。
如下:
\documentclass{article}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}[!htb]
\centering
\includegraphics[width=0.6\linewidth]{example-image}
\caption{示例图}
\label{fig:example}
\phantomsubcaption\label{subfig:a}
\phantomsubcaption\label{subfig:b}
\phantomsubcaption\label{subfig:c}
\phantomsubcaption\label{subfig:d}
\end{figure}
\end{document}
5.要在LaTeX中使用subfig
包创建子图,并且为每个子图添加标签(a)
, (b)
, (c)
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}[!t]
\centering
\subcaptionbox{\label{subfig:1}a}{\includegraphics[width=3.15in]{fig1}}
\hfill
\subcaptionbox{\label{subfig:2}b}{\includegraphics[width=3.15in]{fig2}}
\caption{picture.}
\label{fig}
\end{figure}
\end{document}
6.设置子图标题居中
\captionsetup[subfigure]{justification=centering}
用于设置子标题居中,
\captionsetup{justification=raggedright,singlelinecheck=false}
用于设置大标题靠左。
7.跳转时,中括号是黑色,而参考文献标号是蓝色。怎么修改中括号颜色?
要将引用中的方括号也改为蓝色,你可以使用 \textcolor{blue}{}
命令将方括号着色。
例如:\textcolor{blue}{\cite{1}}
8.引用参考文献中的公式,
例如:引用参考文献2中的公式2,4
\textcolor{blue}{[\hyperref[1]{2, eq.(2)(4)}]}
展示的结果是:[2,eq.(2)(4)], 所有都是标蓝的
9.表格“TABLE 1” 单独一行,标题 “xxxx” 另起一行并居中,如何实现?
\begin{document}前加入\captionsetup[table]{labelformat=simple, labelsep=newline, textfont=sc}。
其中labelsep=newline:保证TABLE 1单独一行,题xxxx另起一行。
textfont=sc:保证大写。
10.更改图片标题字体,并且一并更改“Fig. 1.”字体
\captionsetup{font={footnotesize}}
如果采用此方法,
则会出现如下:Fig 字体与图片标题尺寸不一样大