그림 목록의 공간을 변경하는 방법은 무엇입니까?

그림 목록의 공간을 변경하는 방법은 무엇입니까?

이것은 내 코드입니다.

    \documentclass[12pt,twoside]{scrbook}
\usepackage{titlesec}
\usepackage{scrextend}
\usepackage[font=footnotesize,format=plain,up,textfont=up]{caption}
\captionsetup[figure]{labelsep=space}
\usepackage{tocbasic}
\usepackage{titletoc}%
%listoffigures
\renewcommand{\listfigurename}{DAFTAR GAMBAR}
\makeatletter
\renewcommand\listoffigures{%
  \null\hfill\textbf{\normalsize\listfigurename}\hfill\null\par
  \@mkboth{\MakeUppercase\listfigurename}{\MakeUppercase\listfigurename}%
  \vspace{20pt}

    \@starttoc{lof}%
}
\titlecontents{figure}
  [2.5cm]
  {}
  {\makebox[0pt][r]{%
      \makebox[2.4cm][l]{Gambar~\thecontentslabel}%
    }%
  }
  {\hspace{-1.7cm}}
  {\titlerule*[6pt]{.}\contentspage}

\begin{document}
{%
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\figurename~\oldnumberline}%
\listoffigures%
}
\chapter{kkk}
\begin{figure}
\caption{This is the first}
\end{figure}
\chapter{LLLLLLLLLLLL}
\begin{figure}
\caption{This is the Second}
\end{figure}
\begin{figure}
\caption{I want to make the space in list of figure is 18pt.}
\end{figure}
\begin{figure}
\caption{For example, I want the space \textbf{Gambar 1.1} to \textbf{Gambar 2.1} is same with space \textbf{Gambar 2.1} to \textbf{Gambar 2.2}}
\end{figure}
\begin{figure}
\caption{That's mean, that space for each \textbf{Gambar} is same}
\end{figure}
\chapter{LLLLLLLLLLLL}
\begin{figure}
\caption{But, for case \textbf{Gambar 2.3} and this part, I want to make the space only 12pt. Because \textbf{Gambar 2.3} have 2 line in one caption}
\end{figure}
\end{document}

답변1

KOMA-Script 클래스와 함께 titlesec및 를 사용하지 마십시오 . titletoc이러한 클래스는 패키지를 tocbasic자동으로 로드합니다. 따라서 패키지를 사용하여 tocbasicTOC 및 LOF 및 LOT와 같은 목록의 레이아웃을 변경할 수 있습니다.

\documentclass[
  12pt,
  %twoside,% default
  listof=entryprefix,
  listof=nochaptergap,
  indonesian
]{scrbook}
\usepackage{babel}
%\usepackage{scrextend}% not needed for this example

\addtokomafont{caption}{\footnotesize}
\renewcommand{\captionformat}{\ }
\setcapindent{0pt}

\BeforeTOCHead[lof]{%
  \renewcommand*\raggedchapter{\centering}%
  \addtokomafont{chapter}{\normalsize\rmfamily}%
  \renewcommand\chapterlinesformat[3]{\MakeUppercase{#3}}%
  \RedeclareSectionCommand[beforeskip=\baselineskip,afterindent=false,afterskip=20pt]{chapter}%
}

\DeclareTOCStyleEntry[
  beforeskip=18pt
]{default}{figure}
\makeatletter\renewcommand\@dotsep{2.5}\makeatother

\begin{document}
\listoffigures
\chapter{kkk}
\begin{figure}
\caption{This is the first}
\end{figure}
\chapter{LLLLLLLLLLLL}
\begin{figure}
\caption{This is the Second}
\end{figure}
\begin{figure}
\caption{I want to make the space in list of figure is 18pt.}
\end{figure}
\begin{figure}
\caption{For example, I want the space \textbf{Gambar 1.1} to \textbf{Gambar 2.1} is same with space \textbf{Gambar 2.1} to \textbf{Gambar 2.2}}
\end{figure}
\begin{figure}
\caption{That's mean, that space for each \textbf{Gambar} is same}
\end{figure}
\chapter{LLLLLLLLLLLL}
\begin{figure}
\caption{But, for case \textbf{Gambar 2.3} and this part, I want to make the space only 12pt. Because \textbf{Gambar 2.3} have 2 line in one caption}
\end{figure}
\end{document}

결과:

여기에 이미지 설명을 입력하세요


질문과 MWE를 활용한 제안표준 클래스book(OP의 코멘트 때문에):

\documentclass[12pt]{book}
\usepackage{titlesec}
\usepackage[font=footnotesize,format=plain,up,textfont=up]{caption}
\captionsetup[figure]{labelsep=space}
\usepackage{titletoc}%
\renewcommand{\listfigurename}{DAFTAR GAMBAR}
\makeatletter
\renewcommand\listoffigures{{%
  \let\oldnumberline\numberline%
  \renewcommand{\numberline}{\figurename~\oldnumberline}%
  \null\hfill\textbf{\normalsize\listfigurename}\hfill\null\par
  \@mkboth{\MakeUppercase\listfigurename}{\MakeUppercase\listfigurename}%
  \vspace{20pt}

    \@starttoc{lof}%
}}
\titlecontents{figure}
  [2.5cm]
  {\addvspace{18pt}}
  {\makebox[0pt][r]{%
      \makebox[2.4cm][l]{Gambar~\thecontentslabel}%
    }%
  }
  {\hspace{-1.7cm}}
  {\titlerule*[6pt]{.}\contentspage}

% from https://tex.stackexchange.com/a/275577:
\usepackage{xpatch}
\makeatletter
\xpatchcmd{\@chapter}{%
  \addtocontents{lof}{\protect\addvspace{10\p@}}%
  \addtocontents{lot}{\protect\addvspace{10\p@}}%
}{}{}{}
\makeatother

\begin{document}
\listoffigures
\chapter{kkk}
\begin{figure}
\caption{This is the first}
\end{figure}
\chapter{LLLLLLLLLLLL}
\begin{figure}
\caption{This is the Second}
\end{figure}
\begin{figure}
\caption{I want to make the space in list of figure is 18pt.}
\end{figure}
\begin{figure}
\caption{For example, I want the space \textbf{Gambar 1.1} to \textbf{Gambar 2.1} is same with space \textbf{Gambar 2.1} to \textbf{Gambar 2.2}}
\end{figure}
\begin{figure}
\caption{That's mean, that space for each \textbf{Gambar} is same}
\end{figure}
\chapter{LLLLLLLLLLLL}
\begin{figure}
\caption{But, for case \textbf{Gambar 2.3} and this part, I want to make the space only 12pt. Because \textbf{Gambar 2.3} have 2 line in one caption}
\end{figure}
\end{document}

관련 정보