将 lof 的索引从 1 更改为图 1

将 lof 的索引从 1 更改为图 1

所以我想将lof中的索引从1改为图1:

\documentclass{scrreprt}

\usepackage{float}
\usepackage{chngcntr}
\counterwithout{figure}{chapter}

\usepackage{graphicx}

\begin{document}
    \begin{figure}
        \centering
        \includegraphics[height=0.3\textheight]{example-image}
        \caption[Example Caption]{Example Caption}
        \label{fig:Example}
    \end{figure}

    \listoffigures

\end{document}

答案1

添加选项listof=entryprefix并重新定义\listoflofentryname

\documentclass[
  listof=entryprefix
]{scrreprt}

%\usepackage{float}% do you need this package?
\usepackage{chngcntr}
\counterwithout{figure}{chapter}
\renewcommand*\listoflofentryname{Fig.}

\usepackage{graphicx}

\begin{document}
    \begin{figure}
        \centering
        \includegraphics[height=0.3\textheight]{example-image}
        \caption[Example Caption]{Example Caption}
        \label{fig:Example}
    \end{figure}

    \listoffigures
\end{document}

结果:

在此处输入图片描述

或者使用 KOMA-Script 类和包babel

\documentclass[
  listof=entryprefix,
  english
]{scrreprt}
\usepackage{babel}

%\usepackage{float}% do you need this package?
\usepackage{chngcntr}
\counterwithout{figure}{chapter}
\newcaptionname{english}{\listoflofentryname}{Fig.}

\usepackage{graphicx}

\begin{document}
    \begin{figure}
        \centering
        \includegraphics[height=0.3\textheight]{example-image}
        \caption[Example Caption]{Example Caption}
        \label{fig:Example}
    \end{figure}

    \listoffigures
\end{document}

相关内容