我对书签有些问题。在 PDF 中我有以下内容:
问题是:第一部分“Stato dell'Arte”包含其章节,第二部分“Progettazione”和第三部分包含在第二部分中。现在,我希望第一、第二、第三部分处于同一级别,并且每个部分都包含其章节。我该如何实现这一点?
更新1:我发现问题是当我打开一个时\section{...}
,没有它们它就可以工作
这是我当前的代码:
\documentclass[a4paper, 12pt, italian]{report}
\makeatletter\@addtoreset{chapter}{part}\makeatother%
\usepackage{ctable}
\usepackage{float}
\usepackage{url}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{longtable}
\usepackage{amsmath}
\usepackage[italian]{babel}
\usepackage{longtable}
%\usepackage[pagebackref]{hyperref}
\usepackage[final,backref,breaklinks,pagebackref,colorlinks]{hyperref}
%HYPERREF per uso con con pdf (con bookmark)
\usepackage{parskip}
\usepackage[raggedright]{titlesec}
\usepackage{blindtext}
\usepackage{verbatim}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\titleformat{\chapter}[hang]{\bfseries\huge}{\thechapter.}{2pc}{}
\titlelabel{\thetitle.\quad} % For consistency in all headings
\setcounter{tocdepth}{2}
\begin{document}
\begin{titlepage}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\center
\textsc{\LARGE Università degli studi di Salerno}\\[1cm]
\includegraphics[width=3.5cm]{img/logo_vett.eps} \\[1cm]
\textsc{\large DIPARTIMENTO DI INFORMATICA}\\[0.5cm]
\textsc{\large Progetto di Sicurezza Dei Dati}\\[0.5cm]
%\textsc{\Large MyUnimol}\\[0.5cm]
\HRule \\[0.4cm]
{ \large \bfseries MVS-CLOUD: Una infrastruttura Cloud Storage multi vista per la protezione di dati da coercitori}\\[0.4cm]
\HRule \\[1.5cm]
\begin{minipage}{0.4\textwidth}
\begin{flushleft} \large
\emph{Candidato:}\\
XXX\\
\end{flushleft}
\end{minipage}
~
\begin{minipage}{0.5\textwidth}
\begin{flushright} \large
\emph{Relatore:} \\
Prof. XXX\\
\end{flushright}
\end{minipage}\\[2.5cm]
{Anno accademico 2015/2016}\\
\vfill
\end{titlepage}
\setcounter{tocdepth}{1}
\chapter*{Abstract}
CIAO
\tableofcontents
\listoffigures
%\listoftables
\chapter{Introduzione}
CIAO
\part{Stato dell'Arte}
\chapter{Cloud}
\section{CIAO} %comment this section to see what I want.
\chapter{Problemi}
CIAO%\input{Problemi.tex}
\part{Progettazione MVS-Cloud}
\chapter{Problemi}
CIAO%\input{IngegneriaSoftware.tex}
\part{Inside D-Cloud}
\chapter{Proof of Concept}
CIAO%\input{SoluzioneFinale.tex}
\chapter{Conclusioni}
CIAO%\input{Conclusioni.tex}
\begin{thebibliography}{ssssss}
\addcontentsline{toc}{chapter}{Bibliografia}% inserisce nell'indice la bibliografia
\bibitem{} ``The NIST Definition of Cloud Computing''
\url {http://csrc.nist.gov/publications/nistpubs/800-145/SP800-145.pdf}
\end{thebibliography}
\end{document}
答案1
按部分重新设置章节编号会造成混淆hyperref
,并且会使链接锚定,并且书签的级别也会错误。
\theHchapter
这可以通过重新定义钩子来改变\AtBeginDocument
。
\documentclass[a4paper, 12pt, italian]{report}
\makeatletter
\@addtoreset{chapter}{part}
\makeatother%
\usepackage{ctable}
\usepackage{float}
\usepackage{url}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{longtable}
\usepackage{amsmath}
\usepackage[italian]{babel}
\usepackage{longtable}
\usepackage[nottoc,notlof,notlot]{tocbibind}
\usepackage[raggedright]{titlesec}
\usepackage{blindtext}
\usepackage{verbatim}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\titleformat{\chapter}[hang]{\bfseries\huge}{\thechapter.}{2pc}{}
\titlelabel{\thetitle.\quad} % For consistency in all headings
\setcounter{tocdepth}{2}
\usepackage[final,backref,breaklinks,pagebackref,colorlinks,bookmarksopen,bookmarksopenlevel=3]{hyperref}
\usepackage{parskip}
%HYPERREF per uso con con pdf (con bookmark)
\AtBeginDocument{%
\renewcommand{\theHchapter}{chapter.\thepart.\thechapter}
}
\begin{document}
\begin{titlepage}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\center
\textsc{\LARGE Università degli studi di Salerno}\\[1cm]
\textsc{\large DIPARTIMENTO DI INFORMATICA}\\[0.5cm]
\textsc{\large Progetto di Sicurezza Dei Dati}\\[0.5cm]
%\textsc{\Large MyUnimol}\\[0.5cm]
\HRule \\[0.4cm]
{ \large \bfseries MVS-CLOUD: Una infrastruttura Cloud Storage multi vista per la protezione di dati da coercitori}\\[0.4cm]
\HRule \\[1.5cm]
\begin{minipage}{0.4\textwidth}
\begin{flushleft} \large
\emph{Candidato:}\\
XXX\\
\end{flushleft}
\end{minipage}
~
\begin{minipage}{0.5\textwidth}
\begin{flushright} \large
\emph{Relatore:} \\
Prof. XXX\\
\end{flushright}
\end{minipage}\\[2.5cm]
{Anno accademico 2015/2016}\\
\vfill
\end{titlepage}
\setcounter{tocdepth}{1}
\chapter*{Abstract}
ABSTRACT
\tableofcontents
\listoffigures
% \listoftables
%\chapter{Introduzione}
%\input{Introduzione.tex}
\part{Stato dell'Arte}
\chapter{Cloud}
\section{Foo}
%\input{Statodellarte.tex}
\chapter{Problemi}
%\input{Problemi.tex}
\part{Progettazione MVS-Cloud}
\chapter{Problemi}
%\input{IngegneriaSoftware.tex}
\part{Inside D-Cloud}
\chapter{Proof of Concept}
%\input{SoluzioneFinale.tex}
\chapter{Conclusioni}
%\input{Conclusioni.tex}
% This is only needed if the bibliography should appear in the bookmarks like a part!
\makeatletter
\renewcommand{\toclevel@chapter}{-1}%
\makeatother
\begin{thebibliography}{ssssss}
%\addcontentsline{toc}{chapter}{Bibliografia}% inserisce nell'indice la bibliografia
\bibitem{} ``The NIST Definition of Cloud Computing''
\url {http://csrc.nist.gov/publications/nistpubs/800-145/SP800-145.pdf}
\end{thebibliography}
\end{document}