Fügen Sie in Latex hängende Einzüge in die Liste der Abbildungseinträge ein

Fügen Sie in Latex hängende Einzüge in die Liste der Abbildungseinträge ein

Ich schreibe meine Abschlussarbeit. Allerdings habe ich ein Problem beim Formatieren der Abbildungsliste. Ich wollte wissen, wie ich den Bildunterschriften hängende Einzüge hinzufügen kann, damit sie an der ersten Zeile ausgerichtet sind. Ich verwende die Thesis-Klasse, die standardmäßig die Wörter „Abbildung“ und „Tabelle“ nicht vor die Abbildungsnummer schreibt.

Erste Ausgabe ohne Tocloft

Daher habe ich tocloftdas Paket verwendet, um die Wörter Abbildung und Tabelle vor Abbildung und Tabellennummer hinzuzufügen. Dadurch wird die erste Zeile verschoben, die zweite Zeile bleibt jedoch dort, wo sie war.

Verwenden des Tocloft-Pakets.

Gibt es eine Möglichkeit, die erste und zweite Zeile so auszurichten, dass das Wort „Figure“ erhalten bleibt? Ich habe einen Teil des von mir verwendeten Codes bereitgestellt. Ich habe jedoch alle von mir verwendeten Pakete eingeschlossen.

\documentclass[12pt, a4paper, oneside, openright]{Thesis} % Paper size, default font size and one-sided paper
\usepackage{subfigure}
\usepackage[subfigure]{tocloft}
\usepackage{notoccite}
\usepackage{wrapfig}
\usepackage{lscape}
\usepackage{rotating}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{amsmath, nccmath}
\usepackage{comment}
\usepackage{afterpage}
\usepackage{multirow}
\usepackage{notoccite}
\usepackage{enumitem}
\usepackage{multicol}
\usepackage{times}
\usepackage{cleveref}
\usepackage{wasysym}
\usepackage{rotating}
\usepackage[square, numbers]{natbib}


\hypersetup{urlcolor=black, colorlinks=true} % Colors hyperlinks in blue - change to black if annoyingv`    
\title{\ttitle} % Defines the thesis title 
\setlength{\parindent}{20pt}


\setlength\cftbeforefigskip{8pt}    % To add line spacing between entries in LOF
\setlength\cftbeforechapskip{8pt}   % To add line spacing between entries in LOC
\setlength\cftbeforetabskip{8pt}    % To add line spacing between entries in LOT

\begin{document}
\makeatletter
\renewcommand*{\NAT@nmfmt}[1]{\textsc{#1}}
\makeatother

\frontmatter 

\fancyhead{} % Clears all page headers and footers
\rhead{\thepage} % Sets the right side header to show the page number
\lhead{} % Clears the left side page header

\pagestyle{fancy} % Finally, use the "fancy" page style to implement the FancyHdr headers

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % New command to make the lines in the title page

% PDF meta-data
\hypersetup{pdftitle={\ttitle}}
\hypersetup{pdfsubject=\subjectname}
\hypersetup{pdfauthor=\authornames}
\hypersetup{pdfkeywords=\keywordnames}


\pagestyle{plain}

\acknowledgements{Some Random texts}
\newpage
\addtotoc{Abstract} % Add the "Abstract" page entry to the Contents
\abstract{Some random Texts for Abstract}
\newpage 

\pagestyle{fancy} % The page style headers have been "empty" all this time, now use the "fancy" headers as defined before to bring them back
\addtotoc{Contents}
\lhead{\emph{Contents}} % Set the left side page header to "Contents"
\tableofcontents % Write out the Table of Contents
\newpage
\addtotoc{List of Figures}
\lhead{\emph{List of Figures}} % Set the left side page header to "List of Figures"

%Fragment of code for Writing "Figure" in front of Figure number
{
  \let\oldnumberline\numberline%
  \renewcommand{\numberline}{\figurename~\oldnumberline}%
\listoffigures % Write out the List of Figures
}
\newpage

\addtotoc{List of Tables}
\lhead{\emph{List of Tables}} % Set the left side page header to "List of Tables"
%Fragment of code for Writing "Figure" in front of Figure number
{
  \let\oldnumberline\numberline%
  \renewcommand{\numberline}{\tablename~\oldnumberline}%
\listoftables % Write out the List of Tables
}

\mainmatter % Begin numeric (1,2,3...) page numbering

\pagestyle{fancy} % Return the page headers back to the "fancy" style

% Include the chapters of the thesis as separate files from the Chapters folder
% Uncomment the lines as you write the chapters

\input{Chapters/Chapter1}
\input{Chapters/Chapter2}
\input{Chapters/Chapter3}
\input{Chapters/Chapter4}
\input{Chapters/Chapter5}

\clearpage % Start a new page
\appendix % Cue to tell LaTeX that the following 'chapters' are Appendices

% Include the appendices of the thesis as separate files from the Appendices folder
% Uncomment the lines as you write the Appendices

\input{Appendices/AppendixA}

\backmatter

\label{References}

\lhead{\emph{References}} % Change the page header to say "Bibliography"
\renewcommand\bibname{References}
\bibliographystyle{unsrt} % Use the "custom" BibTeX style for formatting the Bibliography

\bibliography{references} % The references (bibliography) information are stored in the file named "Bibliography.bib"

\newpage
\include{LOP}
\newpage
\end{document}

Wo mache ich den Fehler???

Antwort1

So definieren Sie neu \numberline:

\let\oldnumberline\numberline%
\renewcommand{\numberline}{\figurename~\oldnumberline}

Make cftfignumwidthberücksichtigt die Breite des Wortes nicht \figurename~. Weil es außerhalb des Befehls steht \numberline. Sie sollten es nicht \numberlineso neu definieren. Stattdessen tocloftstellt das Paket die Befehle bereit \cftfigpresnumund \cftfigaftersnumfügt zusätzlichen Inhalt vor und nach der Nummer ein.

Hier ist ein Beispiel, wie Sie diese Befehle verwenden, um Ihr Ziel zu erreichen:

\documentclass{book}
\usepackage{graphicx}
\usepackage{tocloft}

\setlength\cftbeforefigskip{8pt}
\settowidth{\cftfignumwidth}{Figure~1.100~}% set the \cftfignumwidth to certain length of text in case you have a huge numbered figure, e.g., Figure~1.100~
\renewcommand{\cftfigpresnum}{Figure~}% add the word figure and a space before the number
\renewcommand{\cftfigaftersnum}{~} % add a space after the number

\begin{document}
\listoffigures
\chapter{One}
\begin{figure}
    \centering
    \includegraphics{example-image}
    \caption{A very very very very very very very very very very very very very very very very very very very very very very long Caption}
\end{figure}
\setcounter{figure}{10}
\begin{figure}
    \centering
    \includegraphics{example-image}
    \caption{A very very very very very very very very very very very very very very very very very very very very very very long Caption}
\end{figure}
\setcounter{figure}{100}
\begin{figure}
    \centering
    \includegraphics{example-image}
    \caption{A very very very very very very very very very very very very long Caption}
\end{figure}
\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen