ToC, LoF 및 LoT에 하이퍼링크를 추가하고 싶지만 Hyperref 사용 시 오류가 발생했습니다.

ToC, LoF 및 LoT에 하이퍼링크를 추가하고 싶지만 Hyperref 사용 시 오류가 발생했습니다.

ToC, LoF 및 LoT의 장, 섹션, 하위 섹션을 클릭 가능하게 만들고 싶습니다. 중복 가능성이 있는 내용을 몇 개 읽었지만 만족스럽지 않고 내 질문에 답변하지 않습니다. 그들은 그것을 수행하는 방법에 대해 언급하지 않고 있으며 내가 추가하기만 하면 오류가 발생합니다 \usepackage{hyperref}. 그런데 오류 메시지는 다음과 같습니다.

정의되지 않은 제어 순서 \목차

정의되지 않은 제어 순서 \목차

정의되지 않은 제어 순서 \목차

오래된 toc 파일이 감지되었으나 사용되지 않았습니다. LaTeX를 다시 실행해 보세요.

그리고 저는 그림과 표 목록을 클릭하면 그림과 표로 연결되기를 원합니다. 지금까지는 그것에 대해 찾을 수 없습니다.

그것이 어떻게 가능한지 모르겠습니다. cz 저는 내 ToC에서 많은 사용자 정의를 사용합니다.

어쨌든 여기 내 MWE가 있습니다. 내 문서가 일부 부분으로 분리되어 있고 여기에 모두 포함할 수 없기 때문에 컴파일할 수 없습니다. 시간을 낭비해서 죄송합니다. 하지만 저를 도와주실 수 있기를 바랍니다. 감사해요.

편집하다 : 로그 파일에는 \MakeUppercase UnsupportedInPdfStrings가 나와 있습니다.

\documentclass[a4paper,12pt,oneside,openany]{book}
\usepackage{pgf, tikz}
\usepackage[a4paper, inner=4cm, outer=3cm, top=4cm, bottom=3cm]{geometry}
\usepackage{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{setspace}
\usepackage[titles]{tocloft}
\usepackage{tocbibind}
\usepackage{indentfirst}
\usepackage{blindtext}
\usepackage{tocloft}
\usepackage{etoolbox}
\usepackage[none]{hyphenat}
\sloppy
\usepackage{times}
\usepackage{enumitem}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage[utf8]{inputenc}
\usepackage{array}
\usepackage[column=O]{cellspace}
\usepackage{caption}
\usepackage{afterpage}
\usepackage{mathtools}
\usepackage{subcaption}
\usepackage{wrapfig}
\usepackage{cancel}
\usepackage{longtable}
\usepackage[indonesian]{babel}
\usepackage{lipsum}
\usepackage{pdflscape}
\usepackage{makecell} 
\usepackage{ragged2e}
\usepackage{natbib}
%\usepackage[]{hyperref}
%
%\hypersetup{
%   linktoc=all
%}

\newlist{ColEnum}{enumerate}{1}
\setlist[ColEnum,1]{label = \arabic*), left = 0pt, nosep, 
    before= {\begin{minipage}[t]{\hsize}\RaggedRight},
        after = {\end{minipage}}}

\DeclareMathOperator{\Res}{Res}
\numberwithin{equation}{section}

\setlength{\cellspacetoplimit}{5pt}
\setlength{\cellspacebottomlimit}{4pt}
\setlength\bibhang{25pt}

\theoremstyle{plain}
\newtheorem{thm}{Teorema}[section]
\newtheorem{cl}{Corollary}[section]
\newtheorem{lm}{Lemma}[section]

\theoremstyle{definition}
\newtheorem{defn}{Definisi}[section]
\newtheorem{exmp}{Contoh}
\renewcommand{\proofname}{\rm\bf{Bukti}}

\renewcommand\tablename{Tabel}
\renewcommand\figurename{Gambar}


\patchcmd{\section}{\bfseries}{\bfseries\boldmath}{}{}
\patchcmd{\tableofcontents}{\contentsname}{\MakeUppercase\contentsname}{}{}
\patchcmd{\listoffigures}{\listfigurename}{\MakeUppercase\listfigurename}{}{}
\patchcmd{\listoftables}{\listtablename}{\MakeUppercase\listtablename}{}{}
\setlength{\cftbeforesecskip}{10pt}
\setlength{\cftbeforesubsecskip}{10pt}

\fancyhf{}
\cfoot{\thepage}
\linespread{1.5}
\pagestyle{plain}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftdotsep}{1}
\renewcommand\cftchapdotsep{\cftdotsep}
\renewcommand{\cftchapfont}{\bfseries}
\renewcommand{\cftsecfont}{\bfseries}
\renewcommand{\cftchappagefont}{}
\titleformat{\chapter}[block]
    {\normalfont\bfseries\centering}
    {}{0pt}{}
\titleformat{\section}
    {\normalfont\bfseries}
    {\thesection}{1em}{}
\titleformat{\subsection}
    {\normalfont\bfseries}
    {\thesubsection}{1em}{}
\titlespacing*{\chapter}{0pt}{0pt}{20pt}
\titlespacing*{\section}{0pt}{0pt}{0pt}
\titlespacing*{\subsection}{0pt}{0pt}{0pt}

\renewcommand{\contentsname}{DAFTAR ISI}
\renewcommand{\listtablename}{DAFTAR TABEL}
\renewcommand{\listfigurename}{DAFTAR GAMBAR}
\newcommand\dd{\mathop{}\!\mathrm{d}}

%\addtocontents{toc}{\protect\null\protect\hfill{Halaman}\protect\par}
\setlength\parindent{1.25cm} 

\addtocontents{toc}{~\hfill{Halaman}\par}
%\addtocontents{toc}{\protect\afterpage{~\hfill{Halaman}\par\medskip}}
\addtocontents{lot}{~\hfill{Halaman}\par}
\addtocontents{lof}{~\hfill{Halaman}\par}

\makeatletter
\def\ttl@mkchap@i#1#2#3#4#5#6#7{%
    \ttl@assign\@tempskipa#3\relax\beforetitleunit
    \vspace{\@tempskipa}%<<<<<< REMOVE THE * AFTER \vspace
    \global\@afterindenttrue
    \ifcase#5 \global\@afterindentfalse\fi
    \ttl@assign\@tempskipb#4\relax\aftertitleunit
    \ttl@topmode{\@tempskipb}{%
        \ttl@select{#6}{#1}{#2}{#7}}%
    \ttl@finmarks  % Outside the box!
    \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}}
\makeatother

\begin{document}

\clearpage
\thispagestyle{empty}
\include{cover1}
\frontmatter %

\pagestyle{fancy}   
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\bibname}{DAFTAR PUSTAKA}

\include{cover2}
\begin{spacing}{0.1}
    \tableofcontents
    
\end{spacing}
\begin{spacing}{1.5}
    \listoffigures
    \listoftables
\end{spacing}

\mainmatter 
\pagestyle{fancyplain}
\fancyhf{}
\fancyhead[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\include{bab1}
\include{bab2}
\include{bab3}

\backmatter
\bibliography{dafpus}
\bibliographystyle{unejstyle}
\nocite{*}
\include{lampiran}


\end{document}

답변1

\texorpdfstring나를 위해 작동합니다. 내 항목을 수정하면 됩니다.\patchcmd

그래서 그것은 다음과 같습니다:

\patchcmd{\tableofcontents}{\contentsname}{\texorpdfstring{\MakeUppercase\contentsname}{\contentsname}}{}{}
\patchcmd{\listoffigures}{\listfigurename}{\texorpdfstring{\MakeUppercase\listfigurename}{\listfigurename}}{}{}
\patchcmd{\listoftables}{\listtablename}{\texorpdfstring{\MakeUppercase\listtablename}{\listtablename}}{}{}

관련 정보