我想自定义我的伊西(目录)。这里是当前示例 .pdf 输出文件,包含我的目录的完整列表。
我想要定制的是:
省略
. . . . . . . . . . .
仅有的在ABSTRAK, ABSTRACT, DAFTAR ISI, DAFTAR TABEL, DAFTAR GAMBAR, DAFTAR ALGORITME, DAFTAR LAMPIRAN, BAB 1 PENDAHULUAN, BAB 2 LANDASAN TEORI, BAB 3 METODOLOGI PENELITIAN, BAB 4 IMPLEMENTASI DAN PENGUJIAN, BAB 5 KESIMPULAN DAN SARAN
。对于这些部分,实际上不是一个
BAB
,但是LAMPIRAN
(巴布= 章节,兰皮兰= 英文附录):
我想将文本更改BAB
为LAMPIRAN
。
我认为我必须在.sty
文件和我的index
文件中进行一些更改。但不幸的是,我还没有找到要更改的内容。以下是代码:
if_ithb.sty
,这是我的大学用来生成论文报告的样式文件。
% Mengatur bahasa latex
\usepackage[indonesian]{babel}
\usepackage[utf8]{inputenc}
% Untuk pengaturan spacing
\usepackage{setspace}
\onehalfspacing
% Untuk mengatur level section
\setcounter{secnumdepth}{6}
% Digunakan untuk memasukan gambar ke laporan.
\usepackage{graphicx}
% Untuk mengatur spacing antara paragraf
\usepackage{parskip}
% Membuat indent
\usepackage{indentfirst}
\setlength\parindent{1.5cm}
% Untuk mengkustomisasi margin
\usepackage{scrextend}
% Untuk mengatur header dan footer
\usepackage{fancyhdr}
% Membuat seluruh tulisan menjadi Times New Roman.
\usepackage{pslatex}
% Merubah numbering chapter dan section untuk judul setiap bab menggunakan romawi dan judul anak bab menggunakan arabic
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}\hspace{0,3cm}}
\renewcommand{\thesubsection}{\arabic{chapter}.\arabic{section}.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\arabic{chapter}.\arabic{section}.\arabic{subsection}.\arabic{subsubsection}\hspace{-0,35cm}}
% Merubah huruf kapital pada judul daftar isi, daftar gambar, dan daftar table
\usepackage{tocloft}
\renewcommand{\cfttoctitlefont}{\hfil\large\bfseries\MakeUppercase}
\renewcommand{\cftloftitlefont}{\hfil\large\bfseries\MakeUppercase}
\renewcommand{\cftlottitlefont}{\hfil\large\bfseries\MakeUppercase}
\renewcommand\cftchappresnum{BAB }
\renewcommand\cftchapaftersnum{}
\newlength\mylen
\settowidth\mylen{\bfseries BAB 1 :\ } % if more than 9 chapters, use "Chapter 10"
\cftsetindents{chap}{0pt}{\mylen}
% Mengatur font section
\usepackage{sectsty}
\sectionfont{\fontsize{12}{14}\selectfont}
\subsectionfont{\fontsize{12}{14}\selectfont}
\subsubsectionfont{\fontsize{12}{14}\selectfont}
% Untuk merupakan format penulisan BAB
\usepackage{titlesec}
\titleformat{\chapter}
{\doublespacing\fontsize{14pt}{16pt}\bfseries}
{\MakeUppercase{\chaptertitlename\ \thechapter}\filcenter} {0.15cm}{\centering\uppercase}
\titlespacing*{\chapter}{0pt}{-1cm}{20pt}
% Mengatur spacing section
\titlespacing*{\section}
{0pt}{0pt}{-0.05cm}
\titlespacing*{\subsection}
{0pt}{0pt}{-0.05cm}
\titlespacing*{\subsubsection}
{0pt}{0pt}{-0.05cm}
% Digunakan untuk mengatur caption dalam dokumen.
\usepackage[font=footnotesize,format=plain,labelfont=bf,up,textfont=up]{caption}
% Untuk menghapus titik dua (colon)
\captionsetup[figure]{labelsep=space}
\captionsetup[table]{labelsep=space}
% Mengatur nomor caption gambar
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
% Mengatur nomor caption table
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
% Mengatur Hyphenation pada latex
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000
% Untuk mengatur setting indent
\setlength\parindent{1.30cm}
% Untuk memasukkan table
\usepackage{tabularx}
% Untuk mengatur width
\usepackage{changepage}
% Menggatur setting halaman
\usepackage{geometry}
\geometry{
left=4cm, % <-- you want to adjust this
top=3cm,
right=3cm,
bottom=3cm,
}
% Teks testing
\usepackage{blindtext}
\usepackage{lipsum}
% Untuk mengatur subscript supscript
\usepackage{fixltx2e}
% Untuk mengatur wrap picture
\usepackage{wrapfig}
% Untuk notasi matematika
\usepackage{amsmath}
\usepackage{stmaryrd}
\usepackage{mathtools}
% untuk mengatur label nomor pada rumus
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}}
% Untuk mengatur spacing daftar gambar
\newcommand*{\noaddvspace}{\renewcommand*{\addvspace}[1]{}}
\addtocontents{lof}{\protect\noaddvspace}
%untuk mengatur package include table in excel
% \usepackage{pgfplotstable}
% untuk mengatur landscape page
\usepackage{rotating}
index.tex
,这是我的文档的主页。
% Tipe dokumen adalah report dengan satu kolom.
% Mengatur setting halaman
\documentclass[12pt, a4paper, onecolumn, oneside, final]{report}
\makeatother
\usepackage{array}
\setlength\extrarowheight{4pt}
\usepackage{tabto}
\newenvironment{tabs}[1]
{\TabPositions{#1}}
\usepackage{longtable}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
% Hyperlink untuk section, link, citation
\usepackage{hyperref}
\urlstyle{same}
\hypersetup{
colorlinks=true,
linkcolor=blue,
citecolor=green,
filecolor=magenta,
urlcolor=blue
}
% Load konfigurasi LaTeX untuk tipe laporan thesis ITHB
\usepackage{if_ithb}
% Konfigurasi package lainnya
\usepackage[chapter,Algoritme,ruled]{algorithm}
\usepackage{algpseudocode}
\usepackage[most]{tcolorbox}
\usepackage{adjustbox}
\usepackage{algcompatible}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage{bigstrut}
\usepackage{caption}
\usepackage{colortbl}
\usepackage{enumitem}
\usepackage{etoolbox}
\usepackage{float}
\usepackage[T1]{fontenc}
\usepackage{gensymb}
\usepackage{graphicx}
\usepackage{inconsolata}
\usepackage{listings}
\usepackage{makecell}
\usepackage{mathtools}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{musicography}
\usepackage{pdflscape}
\usepackage{pifont}
\usepackage{ragged2e}
\usepackage{rotating}
\usepackage{subcaption}
\usepackage{seqsplit}
\usepackage{tabu}
\usepackage{textcomp}
\usepackage{tikz}
\usepackage{tocloft}
\usepackage{xcolor}
% Untuk break algorithm biar ga offside
\makeatletter
\newenvironment{breakablealgorithm}
{% \begin{breakablealgorithm}
\begin{center}
\refstepcounter{algorithm}% New algorithm
\hrule height.8pt depth0pt \kern2pt% \@fs@pre for \@fs@ruled
\renewcommand{\caption}[2][\relax]{% Make a new \caption
{\raggedright\textbf{\fname@algorithm~\thealgorithm} ##2\par}%
\ifx\relax##1\relax % #1 is \relax
\addcontentsline{loa}{algorithm}{\protect\numberline{\thealgorithm}##2}%
\else % #1 is not \relax
\addcontentsline{loa}{algorithm}{\protect\numberline{\thealgorithm}##1}%
\fi
\kern2pt\hrule\kern2pt
}
}{% \end{breakablealgorithm}
\kern2pt\hrule\relax% \@fs@post for \@fs@ruled
\end{center}
}
\makeatother
% Daftar Lampiran
\newcommand\listappendixname{DAFTAR LAMPIRAN}
\newcommand\appcaption[1]{%
\addcontentsline{app}{chapter}{#1}}
\makeatletter
\newcommand\listofappendices{%
\chapter*{\listappendixname}\@starttoc{app}}
\makeatother
% Daftar Pseudocode - Algoritme
\makeatletter
\def
\BState{\State\hskip-\ALG@thistlm}
\renewcommand{\ALG@name}{ALGORITME}
\renewcommand{\listalgorithmname}{DAFTAR \uppercase{\ALG@name}}
\makeatother
\renewcommand{\thealgorithm}{\arabic{chapter}.\arabic{algorithm}}
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}}
\captionsetup[algorithm]{singlelinecheck=off}
\tcbset{colback=white!10!white,colframe=black!50!black, highlight math style= {enhanced,colframe=black,colback=black!10!white,boxsep=0pt}}
% Daftar pemenggalan suku kata dan istilah dalam LaTeX
\include{hype.indonesia}
% Variabel baru untuk menyimpan nomor halaman
\newcounter{originalpagenumber}%
\renewcommand\cftchapdotsep{\cftdotsep}%
% Daftar isi, supaya subsubsection terindeks juga
\setcounter{tocdepth}{4}
% Set custom font family
\lstset{
basicstyle=\fontfamily{zi4}\selectfont,
}
\renewcommand*{\ttdefault}{cmtt}
\setcellgapes{5pt}
% Awal bagian penulisan laporan
\begin{document}
% Sampul Laporan
\include{sampul_luar}
% Sampul Laporan - dalam
\include{sampul_dalam}
% Daftar isi, gambar, dan tabel
% Gunakan penomeran Romawi (i, ii, iii, ...) setelah bagian ini.
% \captionsetup{justification=centering}
% \newcolumntype{P}[1]{>{\RaggedRight\arraybackslash}p{#1}}
% \makeatletter
\newcounter{savepage}
\pagenumbering{roman}
% Halaman Penyataan Orisinalitas
% \include{halaman_pernyataan_orisinalitas}
% Halaman Pengesahan
% \include{halaman_pengesahan}
% Halaman Publikasi
%\include{halaman_publikasi}
% Lembar Abstrak
\phantomsection \addcontentsline{toc}{chapter}{ABSTRAK}
\include{abstrak}
% Lembar Abstract
\phantomsection \addcontentsline{toc}{chapter}{ABSTRACT}
\include{abstract}
% Kata Pengantar
% \phantomsection \addcontentsline{toc}{chapter}{KATA PENGANTAR}
%\include{kata_pengantar}
\vspace*{-2.5cm}
\phantomsection \addcontentsline{toc}{chapter}{DAFTAR ISI}
\tableofcontents
\clearpage
\vspace*{-2.5cm}
\phantomsection \addcontentsline{toc}{chapter}{DAFTAR TABEL}
\listoftables
\clearpage
\vspace*{-2.5cm}
\phantomsection \addcontentsline{toc}{chapter}{DAFTAR GAMBAR}
\listoffigures
\clearpage
{
\let
\oldnumberline
\numberline
\renewcommand{\numberline}{Pseudocode~\oldnumberline}
}
\addcontentsline{toc}{chapter}{DAFTAR ALGORITME}
\renewcommand{\listalgorithmname}{DAFTAR ALGORITME}
\lhead{\emph{DAFTAR ALGORITME}}
{
\let
\oldnumberline
\numberline
\renewcommand{\numberline}{Algoritme~\oldnumberline}
\listofalgorithms
}
% \clearpage
\vspace*{-2.5cm}
\phantomsection \addcontentsline{toc}{chapter}{DAFTAR LAMPIRAN}
\listofappendices
\clearpage
\setcounter{savepage}{\arabic{page}}
\makeatletter
\def\MyPagenumbering#1{%
\global\c@page \@ne \gdef\thepage{\arabic{chapter}-\csname @#1\endcsname
\c@page}}
\makeatother
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{%
\markboth{BAB \thechapter \ #1}{}}
\fancyhf{}
% Gunakan penomeran Arab (1, 2, 3, ...) setelah bagian ini.
\MyPagenumbering{arabic}
% Untuk mengatur posisi pagenumber
%\pagestyle{plain}
\setlength\LTleft{0pt} % default: \fill
\setlength\LTright{0pt} % default: \fill
\lhead{\leftmark}
\renewcommand{\headrulewidth}{1pt}
\fancypagestyle{plain}{%
\renewcommand{\headrulewidth}{0pt}%
\fancyhf{}%
\fancyfoot[R]{\arabic{chapter}-1}%
}
\onehalfspacing
\rfoot{\arabic{chapter}-\arabic{page}}
\setcounter{page}{1}
\include{bab1}
\setcounter{page}{1}
\include{bab2}
\setcounter{page}{1}
\include{bab3}
\setcounter{page}{1}
\include{bab4}
\setcounter{page}{1}
\include{bab5}
\pagenumbering{roman}
\setcounter{page}{\thesavepage}
\fancypagestyle{plain}{%
\renewcommand{\headrulewidth}{0pt}%
\fancyhf{}%
\fancyfoot[c]{\thepage}%
}
\rfoot{\thepage}
% Daftar Pustaka
\renewcommand{\bibname}{DAFTAR REFERENSI}
\setcounter{page}{1}
\phantomsection \addcontentsline{toc}{chapter}{DAFTAR REFERENSI}
\include{pustaka}
\cftsetindents{chap}{0pt}{\mylen}
% Lampiran
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{
\markboth{LAMPIRAN \thechapter \ #1}{}}
\pagenumbering{arabic}
\setcounter{page}{1}
\setcounter{table}{0}
\renewcommand{\thepage}{A-\arabic{page}}
\renewcommand{\thetable}{\Alph{chapter}-\arabic{table}}
\renewcommand{\thepage}{\Alph{chapter}-\arabic{page}}
\renewcommand\cftchappresnum{LAMPIRAN }
\begin{appendix}
\include{lampiran}
\rfoot{\Alph{chapter}-\arabic{page}}
\end{appendix}
\end{document}
我应该修改什么才能达到我想要的效果?
答案1
要从目录页中删除点,请将以下命令添加到序言中:
\renewcommand{\cftdot}{}
更新:
要从 ToC 中的特定条目中删除点,您可以尝试以下技巧:
\addtocontents{toc}{\def\protect\cftdotsep{10000}}
这会写入\def\@dotsep{10000}
ToC 文件,从那时起点就消失了。
稍后再出现问题
\addtocontents{toc}{\def\protect\cftdotsep{4.5}}
- 更改文本
BAB
以将LAMPIRAN
以下内容添加到序言中:
\setlength{\cftchapnumwidth}{7em}
\let\oldappendix\appendix
\renewcommand{\appendix}{%
\oldappendix
\addtocontents{toc}
{\protect\renewcommand{\protect\cftchappresnum}{LAMPIRAN }}
}
上述修正后的更新index.tex
内容如下:
% Tipe dokumen adalah report dengan satu kolom.
% Mengatur setting halaman
\documentclass[12pt, a4paper, onecolumn, oneside, final]{report}
\makeatother
\usepackage{array}
\setlength\extrarowheight{4pt}
\usepackage{tabto}
\newenvironment{tabs}[1]
{\TabPositions{#1}}
\usepackage{longtable}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
% Hyperlink untuk section, link, citation
\usepackage{hyperref}
\urlstyle{same}
\hypersetup{
colorlinks=true,
linkcolor=blue,
citecolor=green,
filecolor=magenta,
urlcolor=blue
}
% Load konfigurasi LaTeX untuk tipe laporan thesis ITHB
\usepackage{if_ithb}
%---- code for appendix---------
\setlength{\cftchapnumwidth}{7em}% Just for this example
\let\oldappendix\appendix
\renewcommand{\appendix}{%
\oldappendix
\addtocontents{toc}
{\protect\renewcommand{\protect\cftchappresnum}{LAMPIRAN }}
}
%------------
% Untuk break algorithm biar ga offside
\makeatletter
\newenvironment{breakablealgorithm}
{% \begin{breakablealgorithm}
\begin{center}
\refstepcounter{algorithm}% New algorithm
\hrule height.8pt depth0pt \kern2pt% \@fs@pre for \@fs@ruled
\renewcommand{\caption}[2][\relax]{% Make a new \caption
{\raggedright\textbf{\fname@algorithm~\thealgorithm} ##2\par}%
\ifx\relax##1\relax % #1 is \relax
\addcontentsline{loa}{algorithm}{\protect\numberline{\thealgorithm}##2}%
\else % #1 is not \relax
\addcontentsline{loa}{algorithm}{\protect\numberline{\thealgorithm}##1}%
\fi
\kern2pt\hrule\kern2pt
}
}{% \end{breakablealgorithm}
\kern2pt\hrule\relax% \@fs@post for \@fs@ruled
\end{center}
}
\makeatother
% Daftar Lampiran
\newcommand\listappendixname{DAFTAR LAMPIRAN}
\newcommand\appcaption[1]{%
\addcontentsline{app}{chapter}{#1}}
\makeatletter
\newcommand\listofappendices{%
\chapter*{\listappendixname}\@starttoc{app}}
\makeatother
% Daftar Pseudocode - Algoritme
\makeatletter
\def
\BState{\State\hskip-\ALG@thistlm}
\renewcommand{\ALG@name}{ALGORITME}
\renewcommand{\listalgorithmname}{DAFTAR \uppercase{\ALG@name}}
\makeatother
\renewcommand{\thealgorithm}{\arabic{chapter}.\arabic{algorithm}}
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}}
\captionsetup[algorithm]{singlelinecheck=off}
\tcbset{colback=white!10!white,colframe=black!50!black, highlight math style= {enhanced,colframe=black,colback=black!10!white,boxsep=0pt}}
% Daftar pemenggalan suku kata dan istilah dalam LaTeX
\include{hype.indonesia}
% Variabel baru untuk menyimpan nomor halaman
\newcounter{originalpagenumber}%
\renewcommand\cftchapdotsep{\cftdotsep}%
% Daftar isi, supaya subsubsection terindeks juga
\setcounter{tocdepth}{4}
% Set custom font family
\lstset{
basicstyle=\fontfamily{zi4}\selectfont,
}
\renewcommand*{\ttdefault}{cmtt}
\setcellgapes{5pt}
% Awal bagian penulisan laporan
\begin{document}
% Sampul Laporan
\include{sampul_luar}
% Sampul Laporan - dalam
\include{sampul_dalam}
% Daftar isi, gambar, dan tabel
% Gunakan penomeran Romawi (i, ii, iii, ...) setelah bagian ini.
% \captionsetup{justification=centering}
% \newcolumntype{P}[1]{>{\RaggedRight\arraybackslash}p{#1}}
% \makeatletter
\newcounter{savepage}
\pagenumbering{roman}
% Halaman Penyataan Orisinalitas
% \include{halaman_pernyataan_orisinalitas}
% Halaman Pengesahan
% \include{halaman_pengesahan}
% Halaman Publikasi
%\include{halaman_publikasi}
%
\addtocontents{toc}{\def\protect\cftdotsep{10000}}
%
% Lembar Abstrak
\phantomsection \addcontentsline{toc}{chapter}{ABSTRAK}
\include{abstrak}
% Lembar Abstract
\phantomsection \addcontentsline{toc}{chapter}{ABSTRACT}
\include{abstract}
% Kata Pengantar
% \phantomsection \addcontentsline{toc}{chapter}{KATA PENGANTAR}
%\include{kata_pengantar}
\vspace*{-2.5cm}
\phantomsection \addcontentsline{toc}{chapter}{DAFTAR ISI}
\tableofcontents
\clearpage
\vspace*{-2.5cm}
\phantomsection \addcontentsline{toc}{chapter}{DAFTAR TABEL}
\listoftables
\clearpage
\vspace*{-2.5cm}
\phantomsection \addcontentsline{toc}{chapter}{DAFTAR GAMBAR}
\listoffigures
\clearpage
{
\let
\oldnumberline
\numberline
\renewcommand{\numberline}{Pseudocode~\oldnumberline}
}
\addcontentsline{toc}{chapter}{DAFTAR ALGORITME}
\renewcommand{\listalgorithmname}{DAFTAR ALGORITME}
\lhead{\emph{DAFTAR ALGORITME}}
{
\let
\oldnumberline
\numberline
\renewcommand{\numberline}{Algoritme~\oldnumberline}
\listofalgorithms
}
\vspace*{-2.5cm}
\phantomsection \addcontentsline{toc}{chapter}{DAFTAR LAMPIRAN}
\listofappendices
%---------------
\addtocontents{toc}{\def\protect\cftdotsep{4.5}}
%--------------------------
\clearpage
\setcounter{savepage}{\arabic{page}}
\makeatletter
\def\MyPagenumbering#1{%
\global\c@page \@ne \gdef\thepage{\arabic{chapter}-\csname @#1\endcsname
\c@page}}
\makeatother
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{%
\markboth{BAB \thechapter \ #1}{}}
\fancyhf{}
% Gunakan penomeran Arab (1, 2, 3, ...) setelah bagian ini.
\MyPagenumbering{arabic}
% Untuk mengatur posisi pagenumber
%\pagestyle{plain}
\setlength\LTleft{0pt} % default: \fill
\setlength\LTright{0pt} % default: \fill
\lhead{\leftmark}
\renewcommand{\headrulewidth}{1pt}
\fancypagestyle{plain}{%
\renewcommand{\headrulewidth}{0pt}%
\fancyhf{}%
\fancyfoot[R]{\arabic{chapter}-1}%
}
\onehalfspacing
\rfoot{\arabic{chapter}-\arabic{page}}
\setcounter{page}{1}
\include{bab1}
\setcounter{page}{1}
\include{bab2}
\setcounter{page}{1}
\include{bab3}
\setcounter{page}{1}
\include{bab4}
\setcounter{page}{1}
\include{bab5}
\pagenumbering{roman}
\setcounter{page}{\thesavepage}
\fancypagestyle{plain}{%
\renewcommand{\headrulewidth}{0pt}%
\fancyhf{}%
\fancyfoot[c]{\thepage}%
}
\rfoot{\thepage}
% Daftar Pustaka
\renewcommand{\bibname}{DAFTAR REFERENSI}
\setcounter{page}{1}
\phantomsection \addcontentsline{toc}{chapter}{DAFTAR REFERENSI}
\include{pustaka}
\cftsetindents{chap}{0pt}{\mylen}
% \clearpage
% Lampiran
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{
\markboth{LAMPIRAN \thechapter \ #1}{}}
\pagenumbering{arabic}
\setcounter{page}{1}
\setcounter{table}{0}
\renewcommand{\thepage}{A-\arabic{page}}
\renewcommand{\thetable}{\Alph{chapter}-\arabic{table}}
\renewcommand{\thepage}{\Alph{chapter}-\arabic{page}}
\renewcommand\cftchappresnum{LAMPIRAN }
\begin{appendix}
% \renewcommand{\chaptername}{LAMPIRAN}
%-----------
\include{lampiran}
%---------------------------
\rfoot{\Alph{chapter}-\arabic{page}}
\end{appendix}
\end{document}
示例附录文件的内容lampiran.tex
如下:
\appendix
\chapter{Nomor Not MIDI, Nama Not}
\chapter{Hasil Pengukian Arsitektur}