Tag Info

Hot answers tagged

8

Document classes The standard classes report and book and the KOMA-Script classes scrreprt and scrbook do not store the chapter title in macros. Class memoir uses three internal macros for the chapter title and its variations for the table of contents and the header lines: \chapter[title in table of contents][title in header line]{title in body} Then ...


7

Here's a solution using some more appropriate low level commands - but it's a bit fiddly, so titlesec might be a better way to do it. \documentclass{report} \usepackage[T1]{fontenc} \usepackage{cmbright} \makeatletter \def\@makechapterhead#1{\bgroup \moveright-1in\vbox to 0pt{\hbox{}\vskip4pt\fontsize{86}{68}\selectfont\thechapter\par\vss}% ...


5

A preliminary version, without \section parts. It will fail most probably, if the chapter title will contain macros instead of unexpandable material. \documentclass{book} \usepackage{xcolor} \definecolor{Monvert}{RGB}{229,36,36} \definecolorseries{MONVERT}{rgb}{last}{Monvert}{black} \resetcolorseries[50]{MONVERT} \usepackage{xpatch} ...


4

The 'offending' code is a \llap in the \@makechapterhead macro, within the \if@thesisfancy branch, causing the left indentation into the margin. This can be removed by applying a patch at the relevant place. Edit This does not work if the chapter title is longer than the textwidth (minus the width of the chapter number figure) (so far) ...


4

use references \chapter{Some title} \label{chap:some} then later \ref{chap:some} -> chapter number \pageref{chap:some} -> page number for the start of this chapter \titleref{chap:some} -> the title of the chapter \titleref is build into memoir


3

The following is just an example that gives the general idea. It contains a patch of the \chapter command that is suitable for the standard book class; for other document classes, the patch could (and in general will) be different. Of course, etoolbox's \patchcmd could be used instead. \documentclass[a4paper]{book} \usepackage[T1]{fontenc} ...


3

What about \documentclass{scrreprt} \usepackage[T1]{fontenc} \usepackage[italian]{babel} \usepackage{classicthesis,arsclassica} \newcommand*{\Chapter}[2]{% \chapter[#1: \textit{#2}]{#1}% \begingroup \raggedright\Large\itshape #2\par \endgroup \nobreak\vspace{\glueexpr \bigskipamount*3 \relax}% % Adjust this factor as needed ...


3

You didn't give the documentclass you are using. So I will let loose my guess that it is book. Here the default space above is defined by \vspace*{50\p@}. This can be patched as in this code: \documentclass{book} \usepackage{blindtext,showframe} %% just for demo \usepackage{xpatch} \makeatletter ...


2

This is just an add to christian Hupfer's answer, in case, there is long title of chapter (but i think it is bad idea: long text in uppercase) \documentclass[12pt,tocnosub,fancy,offcenter]{uiucecethesis09} \usepackage{geometry} \geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in} \usepackage{blindtext} \usepackage{xpatch} \makeatletter ...


2

The solution is to use \textbar for the “pipe” in text mode (| is good in math mode). You seem to be using a very old template and I don't think you should be loading the IL2 package. The test \ifx\pdfoutput\undefined is a clear sign of this; note that on current TeX distributions (less than five year old or so), the test will always return false.


2

With book or report class, using titlesec package, here is an example: \documentclass{book} \usepackage{titlesec} \titleformat{\chapter}[block] {\normalfont\Huge\bfseries\filcenter} {\thechapter.} {10pt} {\Huge} \titleformat{name=\chapter,numberless}[block] {\normalfont\Huge\bfseries\filcenter} {} {0pt} {\Huge} \titlespacing*{\chapter} {0pt}{20pt}{20pt} ...


2

Since KOMA-Script Version 3.17 (current version on CTAN) you can use \RedeclareSectionCommand[...]{chapter} to change the skips before, after and inside the chapterheading. \documentclass[12pt,letterpaper,oneside,chapterprefix=on]{scrbook}[2015/04/23] %Margins \usepackage[letterpaper,left=1.5in,top=1in,right=1in,bottom=1in]{geometry} %Type ...


2

Use the \addcontentsline command. \addcontentsline{<file line>}{<entry>}{<text>} The file line is toc, lof, or lot. The entry is what level (chapter, section, etc). And text is what you want the entry to say. For you, it would be \addcontentsline{toc}{chapter}{chapter title}


2

Just copy the lines relating to \chapter from amsbook %\documentclass[openany,11pt]{amsbook} \documentclass[11pt]{amsart} \makeatletter \def\chaptermark#1{}%whatever \let\chapterrunhead\partrunhead \def\chapter{% \if@openright\cleardoublepage\else\clearpage\fi \thispagestyle{plain}\global\@topnum\z@ \@afterindenttrue \secdef\@chapter\@schapter} ...


2

I'd change the parts of amsbook.cls that are not of your liking. Adding just the infrastructure for chapters requires much more lines of code than those added by David Carlisle, because also the table of contents and the other listings should be taken into account. \documentclass{amsbook} \usepackage{etoolbox} \makeatletter \numberwithin{section}{chapter} ...


2

To center the entire chapter heading construction, just replace \raggedright (the current/typical alignment style of the headings) with \centering: \documentclass{report} \usepackage{lipsum}% Just for this example \makeatletter \def\@makechapterhead#1{% %%%%\vspace*{50\p@}% %%% removed! {\parindent \z@ \centering \normalfont \ifnum ...


2

There you are. \documentclass{report} \usepackage{tikz, blindtext,showframe} %% blindtext,showframe just for demo \usepackage{titlesec} \newcommand*{\chapnumfont}{\normalfont\sffamily\huge\bfseries} \newcommand*{\chaptitlefont}{\normalfont\sffamily\Huge\bfseries} \newcommand{\mybox}{% \begin{tikzpicture} \draw[fill,color=black] (0,0) rectangle ...


2

You want to set the specific parameters of memoir: \documentclass{memoir} \usepackage{tikz, blindtext,showframe} \makechapterstyle{box}{% \setlength{\beforechapskip}{0pt}% was 50pt \setlength{\midchapskip}{20pt}% \setlength{\afterchapskip}{20pt}% was 40pt \renewcommand*{\printchaptername}{}% ...


2

Use titlesec \documentclass{book} \usepackage{titlesec} \titleformat{\chapter}[display] {\normalfont\huge\bfseries}{}{0pt}{\Huge} \titlespacing*{\chapter} {0pt}{20pt}{40pt} \begin{document} \tableofcontents \chapter{Some chapter} \end{document}


2

This should work for most cases: Edit Meanwhile there is a MWE by the OP. Probably, the OP forgot to compile twice. \documentclass{report} \renewcommand{\thesection}{\arabic{section}} \begin{document} \tableofcontents \section{First} \label{firstsection} \subsection{First section} \label{firstsubsection} \end{document}


2

I guess you want the number to be as high as two lines of text; here's a possibility independent of the font size (I used \Huge). The number is in the margin. Note that showframe and lipsum are not necessary; the former is used just to show the boundaries of the various parts of the page. \documentclass{report} \usepackage[T1]{fontenc} ...


1

Since standalone class doesn't define things like chapters, you will have to do your own formatting. \documentclass[border=.25in,multi={minipage}]{standalone} \usepackage{lipsum} \setlength{\textwidth}{5in}% constant width document \newcounter{chapter} \newcommand{\chapter}[1]{% Chapter title \refstepcounter{chapter}% \centerline{\large\textbf{Chapter ...


1

\renewcomand\thechapter{3.\arabic{chapter}} \setcounter{chapter}{5} in the preamble should make the first \chapter 3.6


1

Principally it's possible to set the counters of chapter andsection` accordingly, but it will look a little bit strange. Since the section counter is reset each time the chapter counter is increased, the setting of section counter must be done after \chapter is called. \documentclass{report} \usepackage{blindtext} \setcounter{chapter}{2} ...


1

Class with chapters If the class contains chapters and the "3" in "3.6" means the chapter number: \documentclass{report} \setcounter{chapter}{3} \setcounter{section}{5} \begin{document} \tableofcontents \section{First section} \subsection{First subsection} \subsubsection{First subsubsection} \section{Second section} \section{Third section} \section{Forth ...


1

There is a bunch of ways of adding \chapter* like titles to the ToC. I changed the \@makeschapterhead{} command for automatic entries to the ToC. The \\ has to be protected, but in my opinion, it should not used at all in a chapter title. \documentclass[14pt,a4paper,twoside,spanish,openany]{book} \usepackage[spanish,activeacute]{babel} ...


1

Use the titlesec package. This code looks mor or less like your picture: \documentclass[12pt, a4paper]{book}% http://ctan.org/pkg/amsproc \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fourier} \usepackage{microtype} \usepackage{lipsum} \usepackage[explicit, indentafter]{titlesec}% \titleformat{\chapter}[display] ...


1

Here is my standard 'minimal' book frame for quick answers to TeX.SX! It can be used as a MWE for quick addition of content. \documentclass{book} %\usepackage[demo]{graphicx} %\usepackage{imakeidx} %\usepackage[backend=biber]{biblatex} %\usepackage{hyperref} \begin{document} \tableofcontents %\listoffigures %\listoftables \part{The First Part} ...


1

You're basically forgetting to issue \pagestyle{fancy}. However, also the order of your packages is wrong. Here's a fixed version. \documentclass[twoside,12pt,openright,a4paper]{book} \usepackage{titlesec} \usepackage[titles]{tocloft} \usepackage{fancyhdr} \usepackage{chngcntr} \usepackage{lipsum} \usepackage[linktoc=all,hyperindex]{hyperref} ...


1

I managed to find the answer. The class i am using is \documentclass{abntex2} which is based on the \documentclass{memoir} class the fix for the chapter space was to combine the metric \beforechapskip with the redefinition of the command \chapterheadstart that somehow got lost inside the abntex2 package. ...



Only top voted, non community-wiki answers of a minimum length are eligible