ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
how can I make chapter headings in LaTeX become centered, without changing anything else? I have tried a number of things, but they have either not worked, or radically changed the look of the heading, or both.
how can I make chapter headings in LaTeX become centered, without changing anything else? I have tried a number of things, but they have either not worked, or radically changed the look of the heading, or both.
you might put this in the preamble (before \begin{document})
\addcontentsline{toc}{chapter}{WEEKDAY EVENING PRAYERS.}
\chapter*{WEEKDAY EVENING PRAYERS.}
In the Name of the Father, and of the Son, and of the Holy Spirit. Amen.
more text
quite a bit of text, including several more chapters as above
\appendix
\chapter{ON THE SIGN OF THE PRECIOUS AND LIFE-GIVING CROSS.}
\documentclass[12pt,letterpaper,twoside]{book}
\newcommand{\cchapter}[1]{\chapter[#1]{\centering #1}}
\newcommand{\scchapter}[1]{%
\csname chapter*[#1]\endcsname{\csname centering #1\endcsname}}
\begin{document}
\tableofcontents
\addcontentsline{toc}{chapter}{WEEKDAY EVENING PRAYERS.}
\scchapter{WEEKDAY EVENING PRAYERS.}
In the Name of the Father, and of the Son, and of the Holy Spirit. Amen.
more text
quite a bit of text, including several more chapters as above
\appendix
\cchapter{ON THE SIGN OF THE PRECIOUS AND LIFE-GIVING CROSS.}
Thanks for the help Stephan. Only one more question, and that is how do I get the headings [chapter, section, etc] numbered in the toc, & yet unnumbered in the body of the text?
Thanks a lot for your patience & help,
-The Doctor
how do I get the headings [chapter, section, etc] numbered in the toc, & yet unnumbered in the body of the text?
That seems to be inconsistent for me. Further, numbering supports browsing/finding sections, to follow the order of sections. While it's easy to read a toc and to have an overview of the order there, it's harder to find the way inside a document, that's why I think numbering is even more important in the document than in the toc. Or, to go further, do you show page numbers for chapters and sections in the toc, but don't use any page number in the document itself...? Numbering is not just counting in order to show how much has been done. I'm just thinking.
Such numbering is not a direct supported style (that tells something about if it's common), but of course you can achieve that. Use \chapter* and \section* in the document and use there also \addcontentsline (or \addtocontents) to produce a numbered toc entry. Use a counter, define your own counter or use standard chapter/section counters.
Another way would be to redefine internal macros like \@startsection, \@makechapterhead etc. but first be sure that you really want to use this style.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.