包含元数据标题的目录

包含元数据标题的目录

我目前正在使用模板创建包含多篇文章的日志。我的问题是我无法在目录中包含文章标题,只能包含章节。让我向您展示这个问题:

\documentclass[twoside]{article}
% ------
% Fonts and typesetting settings
\usepackage[sc]{mathpazo}
\usepackage[T1]{fontenc}
\linespread{1.05} % Palatino needs more space between lines
\usepackage{microtype}

% ------
% Page layout
\usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt]{geometry}
\usepackage[font=it]{caption}
\usepackage{paralist}
\usepackage{multicol}

% ------
% Lettrines
\usepackage{lettrine}

%-----------
%Paquete Español
%-----------
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage[latin1]{inputenc}

% ------
% Abstract
\usepackage{abstract}
\renewcommand{\abstractnamefont}{\normalfont\bfseries}
\renewcommand{\abstracttextfont}{\normalfont\small\itshape}

% ------
% Titling (section/subsection)
\usepackage{titlesec}
\renewcommand\thesection{\Roman{section}}
\titleformat{\section}[block]{\large\scshape\centering}{\thesection.}{1em}{}

% ------
% Header/footer
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyhead[C]{E-Zine Miura 42  $\bullet$ Noviembre 2014 $\bullet$ Vol. I, Nº. 1}
\fancyfoot[RO,LE]{\thepage}

% ------ 这是我想要包含在目录中的标题

   % ------
   % Maketitle metadata <===> This
   \title{\vspace{-15mm}% 
        \fontsize{24pt}{10pt}\selectfont
        \textbf{The Hitchhiker's Guide to the Galaxy }
    }   
    \author{%
    \large
    \textsc{42}\thanks{Template by \href{http://www.howtotex.com}{UNIVERSE}} \\[2mm]
        \normalsize 42 \\
        \normalsize \href{mailto:[email protected]}{42.com (
        \vspace{-5mm}
        }
        \date{}

%%%%%%%%%%%%%%%%%%%%%%%%
%%% ---------------
%%% BEGIN DOCUMENT
%%% ---------------

\begin{document}

\pagestyle{plain}
\tableofcontents
\clearpage

\maketitle
\thispagestyle{fancy}

\begin{abstract}
\noindent La Guía del autoestopista galáctico o Guía del viajero intergaláctico        

El título del libro fue inspirado en una Guía verdadera que Adams vio, la cual era 
\end{abstract}

\begin{multicols}{2}
\lettrine[nindent=0em,lines=3]{A} rthur Dent podría calificarse en todo           sentido como una persona normal. Un sujeto que vive en un pacífico pueblito a las afueras de Londres.

\section{Personajes: Ejemplo de sección}
Maecenas sed ultricies felis. Sed imperdiet dictum arcu a egestas. 
\begin{compactitem}
\item Arthur Dent, el protagonista de esta historia, es un hombre normal que     

\section{Otro ejemplo}

\end{multicols}

\end{document} 

如您所见,主标题(银河系漫游指南) 没有出现在目录中。

在此处输入图片描述

提前致谢。

答案1

您可以通过在命令旁边写下此行来手动添加条目\maketitle

\addcontentsline{toc}{section}{\LARGE The Hitchhiker's Guide to the Galaxy}

这句话的字面意思是:

在索引中添加一行TableOfContents,使用与 相同的样式section
并包含\LARGE The Hitchhiker's...

无论如何,请注意该命令\maketitle只能在 中工作一次article。要写日记,我认为你应该使用专用的documentclass而不是article。我认为周围有很多。

相关内容