2

Here is a capture of part of "Table of Contents" of my article.

enter image description here

Between section 32 and Appendix A (On Page 68), I manually added unnumbered sections called "Summary" "Further Reading" and "Acknowledgment" by typing

\begin{center}
{\Large\bf Summary}
\end{center}

\begin{center}
    {\Large\bf Further Reading}
\end{center}

\begin{center}
{\Large\bf Acknowledgment}
\end{center}

However, I also want to add these unnumbered sections to the Table of Contents between Section 32 and Appendix A. I am afraid if I type \section*{Summary}instead of \begin{center}{\Large\bf Summary}\end{center} the word "Summary" would not appear in the middle of the line. Nor does it seem that \section*{Summary} would make the Section "Summary" appear in the Table of Contents. What should I do?

2

Like this?

\documentclass{article}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\section{Whatever}
\lipsum[1-5]
\section*{Summary}
\addcontentsline{toc}{section}{Summary}
\lipsum[6-10]
\end{document}

enter image description here enter image description here


Don't use \begin{center} {\Large\bf Acknowledgment} \end{center} and \bf!!! I recommend something like this:

\documentclass{article}
\usepackage{lipsum}
\usepackage{titlesec}
\titleformat{\section}{\Large\bfseries}{\thesection}{2ex}{\centering}
\begin{document}
\tableofcontents
\section{Whatever}
\lipsum[1-5]
\section*{Summary}
\addcontentsline{toc}{section}{Summary}
\lipsum[6-10]
\end{document}

enter image description here enter image description here


In case you don't want to center numbered sections, I recommend defining a macro. However, this way lacks consistency, so it is not good.

\documentclass{article}
\usepackage{lipsum}
\newcommand\yoursection[1]{%
    \addcontentsline{toc}{section}{#1}
    \begin{center}
        \Large\bfseries#1
    \end{center}
}
\begin{document}
\tableofcontents
\section{Whatever}
\lipsum[1-5]
\yoursection{Summary}
\lipsum[6-10]
\end{document}

enter image description here enter image description here

1

You may also use the excellent KOMA-script bundle, and utilise the addsec-command, which gives you an unnumbered section, which behaves like all other sections. (You have similar commands for other sectioning commands addpart, addchap).

\documentclass{scrartcl}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\section{Whatever}
\lipsum[1-5]
\addsec{Summary}
\lipsum[6-10]
\end{document}

Demo of addsec

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.