\documentclass{article}
\usepackage{tikz}
\usepackage{caption}
\usepackage{tocloft}
\begin{document}
{
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\figurename~\oldnumberline}%
\listoffigures%
}
{%
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\tablename~\oldnumberline}%
\listoftables%
}
\begin{table}[h]
\centering
\setlength{\tabcolsep}{20pt}
\caption{just a table}
\begin{tabular}{cc}
u & m
\end{tabular}
\end{table}
\begin{figure}[h]\centering
\begin{tikzpicture}
\draw [<->,thick] (-0.6,-1)to(-0.6,-2) ;
\end{tikzpicture}
\caption{An arrow}
\end{figure}
\end{document}
我有一些不错的 LOF 和 LOT,但必须像下面这样用冒号更改它
图1.1 --->图 1.1:
表 1.1 --->表1.1:
我希望有人能帮助我。
答案1
您正在加载包tocloft
,因此您可以使用它在 LOF 和 LOT 中获取所需的前缀:
\documentclass{article}
\usepackage{tikz}
\usepackage{caption}
\usepackage{tocloft}
\renewcommand\cftfigpresnum{\bfseries\figurename~}
\renewcommand\cftfigaftersnum{:}
\setlength\cftfignumwidth{5.5em}
\renewcommand\cfttabpresnum{\bfseries\tablename~}
\renewcommand\cfttabaftersnum{:}
\setlength\cfttabnumwidth{5em}
\begin{document}
\listoffigures
\listoftables
\begin{table}[h]
\centering
\setlength{\tabcolsep}{20pt}
\caption{just a table}
\begin{tabular}{cc}
u & m
\end{tabular}
\end{table}
\begin{figure}[h]\centering
\begin{tikzpicture}
\draw [<->,thick] (-0.6,-1)to(-0.6,-2) ;
\end{tikzpicture}
\caption{An arrow}
\end{figure}
\end{document}
结果: