latex - 在目录中,如何显示 chapter* section*和 subsection*

如果我使用chapter*,那么LaTeX从目录中删除这个章节,此外,标题(fancy)不随chapter*更改。

总体结构为:


maketitle %% A custom one
frontmatter
tableofcontents
listoftables
listoffigures

chapter*{Abstract}
chapter*{Introduction} %% This"chapter" presents the whole thesis

mainmatter

%% Here the real chapters are written

appendix
%% Appendixes here

%% bibliography

如何使chapter*section*subsection*显示在ToC中并修改标题?

这是我的完整前言:


usepackage[sort&compress,round,semicolon]{natbib}
usepackage{babel}
usepackage{setspace}
%% inputenc so we can write in spanish
usepackage[utf8]{inputenc}

usepackage{fixltx2e} % LaTeX patches, textsubscript
usepackage{cmap} % fix search and cut-and-paste in PDF
usepackage{ifthen}
%% usepackage{float} % float configuration
%% floatplacement{figure}{TH} % place figures here definitely

%% fontenc so we can use TrueType fonts
usepackage[T1]{fontenc}
usepackage{lmodern}
usepackage{garamond}
usepackage{graphicx}
usepackage{titlesec}

usepackage[table]{xcolor}
%% Custom colors
definecolor{blue}{rgb}{0.2,0.2,0.95}
definecolor{green}{rgb}{0.2,0.95,0.2}
definecolor{red}{rgb}{0.95,0.2,0.2}
definecolor{cyan}{rgb}{0,0,0.95}
definecolor{ligthred}{rgb}{1, 0, 0}
definecolor{black}{rgb}{0, 0, 0}

definecolor{shade}{HTML}{D4D7FE} %light blue shade

% Margins
usepackage[left=0.9in,top=1in,right=0.7in,bottom=1in]{geometry}


usepackage[pdftex, colorlinks=true, citecolor=ligthred,
 urlcolor=blue]{hyperref}

widowpenalty9000
clubpenalty7000

usepackage{titlesec}
newcommand{bigrule}{titlerule[0.5mm]}

renewcommand{rmdefault}{bch} 

titleformat{chapter}[display]
{bfseriesHuge}
{garamond
% DESCOMENTAR PARA SUBIR LOS CAPITULOS
vspace{-1.125in} titlerule filleft
Largechaptertitlename Largethechapter}{0mm}
{filleft}[vspace{0.5mm} bigrule]

letcite=citep

usepackage{fancyhdr}
pagestyle{fancy}
fancyhf{} %% Clears all headers

% admonition (specially marked topic)
providecommand{DUadmonition}[2][class-arg]{%
 % try DUadmonition#1{#2}:
 ifcsname DUadmonition#1endcsname%
 csname DUadmonition#1endcsname{#2}%
 else
 begin{center}
 fbox{parbox{0.9textwidth}{#2}}
 end{center}
 fi
}

% title for topics, admonitions and sidebar
providecommand*{DUtitle}[2][class-arg]{%
 % call DUtitle#1{#2} if it exists:
 ifcsname DUtitle#1endcsname%
 csname DUtitle#1endcsname{#2}%
 else
 smallskipnoindenttextbf{#2}smallskip%
 fi
}

% error admonition title
providecommand*{DUtitleerror}[1]{DUtitle{color{red}#1}}

% fieldlist environment
ifthenelse{isundefined{DUfieldlist}}{
 newenvironment{DUfieldlist}%
 {quotedescription}
 {enddescriptionendquote}
}{}

% legend
ifthenelse{isundefined{DUlegend}}{
 newenvironment{DUlegend}{small}{}
}{}

%%% Fallback definitions for Docutils-specific commands
% numeric or symbol footnotes with hyperlinks
providecommand*{DUfootnotemark}[3]{%
 hyperlink{#2}{textsuperscript{#3}}raisebox{1em}{label{#1}}%
}

providecommand{DUfootnotetext}[4]{%
 begingroup%
 renewcommand{thefootnote}{%
 protecthyperlink{#2}{#3}}%
 protectraisebox{1em}{protectlabel{#1}}%
 footnotetext{#4}%
 endgroup%
}

usepackage{booktabs}
usepackage{multirow}
usepackage{longtable}
newlength{DUtablewidth} % internal use in tables


usepackage{tikz}
usepackage{bbding}

usetikzlibrary{arrows,fit}
usepackage{amsmath,bm,times}
newcommand{mx}[1]{mathbf{bm{#1}}} % Matrix command
newcommand{vc}[1]{mathbf{bm{#1}}} % Vector command

时间:

我不认为有专门的命令。 但你可以用


 addcontentsline{toc}{chapter}{#1}

将它添加到目录中,


newcommandchap[1]{%
 chapter*{#1}%
 addcontentsline{toc}{chapter}{#1}}

查看回忆录类。

我认为anonchap或者fncychap包可能是你的菜。

setcounter{secnumdepth}{-1}

如果你希望将可链接的ToC与我的解决方案一起使用,则Hyperref也可以正常工作,确保编译它两次以便让它在ToC和inline上工作。

我使用Qt版本485的TeXstudio 2.6.2 (SVN 4110M ),在Windows 764位上的Qt 4.8.5 R编译,

...