latex自定义图片命名前缀以及设定表格名称范围与大小

本文介绍了一种使用LaTeX进行图形配置的方法,包括如何设置图形标题的样式、大小及位置,并通过具体示例展示了如何利用parbox命令来优化图形布局。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

自定义前缀

\NeedsTeXFormat{LaTeX2e}[2007/10/19]
\ProvidesClass{cpbtex}[2014/11/12 v1.0 LaTeX Template for Chinese Physics B]

\LoadClass[a4paper]{article}[2007/10/19]

\RequirePackage{amsmath,amsfonts,amssymb,bm,CJK,ccmap}
\RequirePackage{graphics,epstopdf,ifpdf}
\RequirePackage{mathrsfs,textcomp,multicol}
\RequirePackage{indentfirst,fancyhdr,upgreek}
\RequirePackage[columnwise]{lineno}
\RequirePackage[compress,nospace]{cite}
\RequirePackage[bookmarksnumbered=true,bookmarksopen=true,colorlinks=true,pdfborder=001,
            urlcolor=blue,linkcolor=blue,anchorcolor=blue,citecolor=blue]{hyperref}
            
\newcommand{\ucite}[1]{$^{\text{\!\cite{#1}}}$} % reference citation
%================================== page setting =================================================%
\renewcommand{\baselinestretch}{1.5}    % set the line spacing
\renewcommand{\thesection}{\arabic{section}.\hspace{-.4cm}}
\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}.\hspace{-.4cm}}
\renewcommand{\thesubsubsection}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}.\hspace{-.3cm}}
\footskip=45pt  \headsep=4truemm \topmargin=-0.5cm \oddsidemargin=0pt \evensidemargin=0pt
\textwidth=170truemm   % set page width
\textheight=250truemm  % set page height
\parindent=19pt        % set page indent
\def\thefootnote{}  %% remove the footnote number label

\RequirePackage[labelsep=space]{caption}
\renewcommand{\thefigure}{\footnotesize{\bf \arabic{figure}.}}
\renewcommand{\figurename}{\footnotesize{\bf Fig.}}

\endinput
%%
%% End of file `article.cls'.

主要起是以下三行代码起作用

\RequirePackage[labelsep=space]{caption}
\renewcommand{\thefigure}{\footnotesize{\bf \arabic{figure}.}}
\renewcommand{\figurename}{\footnotesize{\bf Fig.}}

设定名称大小与展示范围

\begin{figure}
	\centering
	\includegraphics{e2.eps}\\[5pt]
	\parbox[c]{15.0cm}{\caption{ (color online) % figure caption
			The transition of trajectories of spiral tip by changing the
			frequency of a local periodic forcing. The amplitude of the local
			forcing is $A=0.35$. Corresponding orbits are shown. (a) $\omega
			_{\rm af} = 0.955\omega _0$, an epicycloids-like orbit with inward
			petals; (b) $\omega _{\rm bf} = 0.9768\omega _0 $, a straight line;
			(c) $\omega _{\rm cf} = 0.992\omega _0 $, a hypocycloid-like orbit
			with outward petals.}  \label{figure2}}
	
\end{figure}

如上,可以用parbox命令设置,此时注意label要放到parbox里面去。

### 如何在 LaTeX自定义表格的字体大小LaTeX 中调整表格中的字体大小可以通过设置局部字体命令来实现。具体来说,在 `tabular` 或其他表格环境中嵌套一组 `{}` 并在其内部应用 `\small`, `\footnotesize`, `\scriptsize` 等字体大小控制命令即可[^1]。 以下是具体的代码示例: ```latex \documentclass{article} \usepackage{array} % 支持更灵活的列格式设定 \begin{document} % 正常字体大小表格作为对比 \begin{table}[h] \centering \caption{正常字体大小表格} \begin{tabular}{|c|c|} \hline 列1 & 列2 \\ \hline 数据A & 数据B \\ 数据C & 数据D \\ \hline \end{tabular} \end{table} % 调整字体大小后的表格 \begin{table}[h] \centering {\small % 设置整个表格为较小字体 \caption{小号字体的表格} \begin{tabular}{|c|c|} \hline 列1 & 列2 \\ \hline 数据A & 数据B \\ 数据C & 数据D \\ \hline \end{tabular}} \end{table} % 更小字体的例子 \begin{table}[h] \centering {\scriptsize % 使用脚注级别的字体大小 \caption{非常小的字体表格} \begin{tabular}{|c|c|} \hline 列1 & 列2 \\ \hline 数据A & 数据B \\ 数据C & 数据D \\ \hline \end{tabular}} \end{table} \end{document} ``` 上述代码展示了三种不同字体大小表格效果:默认字体大小、`\small` 和 `\scriptsize` 的情况。通过这种方式,可以在不改变全局文档字体的情况下单独调整表格内的文字尺寸[^3]。 此外,如果需要进一步微调字体大小,还可以使用 `relsize` 宏包提供的 `\relscale{}{}` 命令或者手动指定特定的长度单位(如 pt, mm)来进行精确调节[^2]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

三只佩奇不结义

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值