latex图表标题样式设置 |
您所在的位置:网站首页 › 设置图标标题怎么设置 › latex图表标题样式设置 |
设置图标标题样式需要导入\caption和\subcaption 包,可以改变caption和label的字体、编码样式、对齐方式、格式等 插入子图代码如下 \begin{figure} \centering \begin{subfigure}[t]{1in} \centering \includegraphics[width=1in]{placeholder} \caption{Caption 1}\label{fig:1a} \end{subfigure} \quad \begin{subfigure}[t]{1in} \centering \includegraphics[width=1in]{placeholder} \caption{Caption 2}\label{fig:1b} \end{subfigure} \caption{Main figure caption}\label{fig:1} \end{figure} 插入子表代码类似 \begin{table} \centering \begin{subtable}[t]{2in} \centering \begin{tabular}{|l|l|l|} \hline 100 & 200 & 300\\ \hline 400 & 500 & 600\\ \hline \end{tabular} \caption{Caption 1}\label{table:1a} \end{subtable} \quad \begin{subtable}[t]{2in} \centering \begin{tabular}{|l|l|l|} \hline 100 & 200 & 300\\ \hline 400 & 500 & 600\\ \hline \end{tabular} \caption{Caption 2}\label{table:1b} \end{subtable} \caption{Main table caption}\label{table:1} \end{table}可以用\columnwidth代替\width 设置caption的编号样式 % change the style of the caption numbering. \renewcommand{\thetable}{\alph{table}} \renewcommand{\thefigure}{\Alph{table}} \renewcommand{\thesubtable}{\Roman{subtable}} \renewcommand{\thesubfigure}{\arabic{subfigure}} Counter styleCodeExampleArabic numerals\arabic{counter}1, 2Lower case letters\alph{counter}a, bUpper case letters\Alph{counter}A, BLower case Romannumerals \roman{counter}i, iiUpper case Romannumerals \Roman{counter}I, II将其中的counter用table或者subtable代替就得到了想要的编号样式 示例: \renewcommand{\thefigure}{\Roman{figure}} \renewcommand{\thesubfigure}{\arabic{subfigure}} \begin{figure} \centering \begin{subfigure}[t]{1in} \centering \includegraphics[width=1in]{placeholder} \caption{Arabic numerals}\label{fig:1a} \end{subfigure} \quad \begin{subfigure}[t]{1in} \centering \includegraphics[width=1in]{placeholder} \caption{Arabic numerals}\label{fig:1b} \end{subfigure} \caption{Capital Roman numerals}\label{fig:1} \end{figure}类似,代码如下 % This applies if you have chapters \renewcommand{\thefigure}{\thechapter.\Alph{figure}} % set caption label style to 1.A \renewcommand{\thesubfigure}{\arabic{subfigure}} \begin{figure} \centering \begin{subfigure}[t]{1in} \centering \includegraphics[width=1in]{placeholder} \caption{Arabic numerals}\label{fig:1a} \end{subfigure} \quad \begin{subfigure}[t]{1in} \centering \includegraphics[width=1in]{placeholder} \caption{Arabic numerals}\label{fig:1b} \end{subfigure} \caption{Chapter number dot figure letter}\label{fig:1} \end{figure}导入宏包的时候可以直接设置全局样式,即所有的caption样式都变化,示例如下: % options apply to all captions \usepackage[OPTIONS]{caption} % applies to all subfigure and subtable captions \usepackage[OPTIONS]{subcaption} % will apply to all captions \usepackage[labelfont=it,textfont={bf,it}]{caption} % will apply to all subcaptions \usepackage[labelfont=bf,textfont=normalfont,singlelinecheck=off,justification=raggedright]{subcaption}也可以使用\captionsetup设置标题样式,这样后面所有的标题样式都是根据\captionsetup重新设置的,示例代码如下: \captionsetup[FLOAT_TYPE]{OPTIONS}FLOAT_TYPE可以是table、subtable、figure、subfigure等,下面的代码展示了label font、text font的设置以及子标题的对齐方式的设置: % for figures: caption label is italic, the caption text is bold / italic \captionsetup[figure]{labelfont=it,textfont={bf,it}} % for subfigures: caption label is bold, the caption text normal. % justification is raggedright (i.e. left aligned) % singlelinecheck=off means that the justification setting is used even when the caption is only a single line long. % if singlelinecheck=on, then caption is always centered when the caption is only one line. \captionsetup[subfigure]{labelfont=bf,textfont=normalfont,singlelinecheck=off,justification=raggedright} \begin{figure} \centering \begin{subfigure}[t]{1in} \centering \includegraphics[width=1in]{placeholder} \caption{Caption}\label{fig:1a} \end{subfigure} \quad \begin{subfigure}[t]{1in} \centering \includegraphics[width=1in]{placeholder} \caption{Caption}\label{fig:1b} \end{subfigure} \caption{Main figure caption.}\label{fig:1} \end{figure}运行效果如下 其他尺寸参见http://blog.csdn.net/wkd22775/article/details/51784770 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |