# Tag Info

## New answers tagged sectioning

2

As Harish Kumar says in the comment, egreg's solution works here, as well. It suffices to turn to true the "colorkeywords" conditional inside your commands: \titleformat{\section}[hang]{\colorkeywordstrue\color{blue}\huge\bfseries}{\thesection}{1em}{} \titleformat{\subsection}[hang]{\colorkeywordstrue\color{blue}\bfseries}{\thesubsection}{1em}{} ...

4

Each \chapter sets the page style to opening. A patch using etoolbox to change this to plain fixes it: \documentclass[a4paper,onecolumn,oneside,11pt,wide,floatssmall]{mwrep} \usepackage{lipsum,geometry,etoolbox} \makeatletter \patchcmd{\mw@sectionxx}{opening}{plain}{}{} \makeatother \pagestyle{uheadings} \begin{document} \chapter{A chapter} \lipsum[1-10] ...

7

Add the following lines \makeatletter \def\ps@uheadings{% \let\@mkboth\markboth \let\ps@normal\hf@uheadings \let\ps@opening\hf@plain \let\ps@closing\hf@uheadings \let\ps@blank\hf@empty \ps@normal \def\chaptermark##1{% \markright{% \ifHeadingNumbered \thechapter.\enspace \fi ##1}}} ...

5

Hook in the commands that produce the section titles, the easiest way is with sectsty: \documentclass{article} \usepackage{sectsty} \usepackage{xcolor} \allsectionsfont{\colorkeywordstrue} \newif\ifcolorkeywords \DeclareRobustCommand{\keyword}[1]{% \textbf{\ifcolorkeywords\color{red}\fi #1}% } \begin{document} \section{Product \keyword{rabunza}} You ...

4


4

You could redefine \raggedsection, \raggedchapter and \othersectionlevelsformat: \let\raggedsection\centering \let\raggedchapter\raggedright \renewcommand\othersectionlevelsformat[3]{% \ifstr{#1}{section}{Section~#3:\enskip}{% \ifstr{#1}{subsection}{Subsection~#3:\enskip}{% #3\autodot\enskip}}} To centr the section and subsection titles ...

1


0

With a big part of guesswork and very little imagination i came up with this. Since there weren't really any specs in the question, the following example is kept simple and in no way fancy. \documentclass{article} \usepackage{blindtext} \newcommand{\appendixsection}[1]{\clearpage\vspace*{.3\textwidth}\begingroup\Huge\bfseries% \refstepcounter{section}% ...

1

Ok, I think I located the problem: I had some special characters in jabref and in the CSV file. I was loading a .bib file with some Chinese non utf-8 characters and in the CSV I was using 'ó' in the headers. After removing them, the problems were solved. This combination worked for me: SIGCHI template \usepackage[utf8]{inputenc} \usepackage{csvsimple} ...

0

I usually resolve this with the enumerate package. I always use this package anyway to control how items are enumerated by allowing you to specify e.g. \begin{enumerate}[(1)] to have parentheses the numbers etc.. In preamble use \usepackage{enumerate} Then: \section{This is section 1} \begin{enumerate}[\thesection .1] \item This is item 1.1 \item This is ...

0

From line 867 to 897 of amsbook.cls class is where the \partname, \thepart and \part are defined. Correspond to the problem that the number is not needed for Trunk, we can redefine the \thepart to be empty. And to the problem that the next part must number from one, we just reset the counter part to 0. \documentclass{amsbook} \begin{document} ...

3


2

The package free solution, just using another document class ;-) \documentclass[a4paper,emulatestandardclasses]{scrbook} \usepackage{lipsum} \RedeclareSectionCommands[% beforeskip=-1.5cm,% afterskip=1.5cm% ]{section,subsection,subsubsection} \begin{document} \chapter{A Chapter} \lipsum[2] \section{Foo} \lipsum[2] \subsection{Bar} \lipsum[2] ...

10

You write [...] would you do it in a different, maybe better, way? [...] better might mean by defining an environment (e.g. a list) with a parameter for the code and items which generate the correct sequence of headings. Make your life easier Strive for automation, consistency, and maintainability. (Note that those desiderata are all a bit intertwined ...

7

I think that using the sectsty package is simpler. Just add the following lines to your preamble \usepackage{sectsty} \renewcommand{\thechapter}{\Roman{chapter}} \chapterfont{\centering\MakeUppercase} MWE \documentclass[12pt]{book} \pagestyle{plain} \usepackage{amssymb,latexsym} \usepackage{amsmath} \usepackage{amsthm} \usepackage{sectsty} ...

3

Here is a crude way of implementing your requirement. It uses etoolbox to patch the macros responsible for creating the chapter headings. There are two macros, one for \chapter and one for \chapter*. In each of these macros, an adjustment is made to the chapter title (argument #1) as well as the horizontal alignment - changing from \raggedright to ...

2


3

A solution can be to redefine \cleardoublepage to be \clearpage locally to those chapters when you don't want that behavior. So just write {\let\cleardoublepage\clearpage% \input{Chapters/Abstract} \input{Chapters/Abstrakt} \input{Chapters/Acknowledgements} \tableofcontents \listoftables \listoffigures } and you should obtain what you want.

1

It is certainly an error in the tccv class redefining \section so that it doesn't honor a * after it. You solve the issue by defining \bib@heading to do nothing. \documentclass{tccv} \makeatletter \renewcommand{\bib@heading}{} \makeatother \begin{document} \section{Publications} \nocite{Knuth:ct-a} \bibliographystyle{plain} \bibliography{texbook1} ...

5

This does not solve the deficiencies of the class file, but: \documentclass[bibliography=totocnumbered]{tccv} \begin{document} \nocite{companion} \section{Publications} \bibliographystyle{plain} \bibliography{biblatex-examples} \end{document} Use the proper documented interface to get a numbered (i.e. non starred) bibliography. Or to make it completely ...

4

Yes, thebibliography does issue \section* under the tccv document class. In fact, tccv redefines \section to suit its own needs without taking into account that \section could be used in a starred form: % Overrides the \section command to capitalize every % word for cosmetic purposes and draws a rule under it. \let\old@section\section ...

2


4

Yes. Redefine \section to always issue \cleardoublepage: \let\oldsection\section% Store \section in \oldsection \renewcommand{\section}{\cleardoublepage\oldsection}% Prepend new \section with \cleardoublepage The above assumes you're using a twoside document class option and/or openright.

6

The revtex4 class adds a prefix to the cross-references to subsections since it uses \def\p@subsection{\thesection\,} so, in addition to \def\thesubsection{\thesection.\Alph{subsection}} you will also need \def\p@subsection{} to suppress the prefix: \documentclass{revtex4} \makeatletter \def\thesubsection{\thesection.\Alph{subsection}} ...

3

You can simply load the package etoolbox and patch the definitions of \section and \subsection to have \raggedright instead of \centering. MWE: \documentclass[prb]{revtex4-1} \usepackage{etoolbox} \patchcmd{\section} {\centering} {\raggedright} {} {} \patchcmd{\subsection} {\centering} {\raggedright} {} {} \begin{document} \section{Long ...

4

\frontmatter is a switch-type command that applies to everything after it. It doesn't take an argument. So in your code, the entire document is being treated as "front matter". At the beginning of the document, "switch" to \frontmatter, then after the front matter, "switch" to \mainmatter, which takes care of the page numbering on its own. A few other ...

7

I'd go with a key-value syntax: \documentclass[openany]{book} \usepackage{titlesec} \usepackage{xparse} \titleformat{\section} {\normalfont\Large\sffamily\printcurrentsurtitle} {\thesection} {1em} {} \ExplSyntaxOn \keys_define:nn { crowell/section } { surtitle .tl_set:N = \l_crowell_section_surtitle_tl, toc .tl_set:N = ...

15

You can try this code. Use \sectionsurtitle{....} before the sections where you want the surtitle. Note that you can used a starred version \sectionsurtitle* for unnumbered sections. \documentclass{scrartcl} \usepackage{lipsum} \usepackage{suffix} \newcommand\sectionsurtitle[1]{\surtitletoc{#1}\printsectionsurtitle{#1}} ...

4

Why don't you use a KOMA class which provides the command \addsec which produces an unnumbered section, but it is inserted in the ToC and you have headings for that? Example: \documentclass{scrartcl} \usepackage[automark]{scrlayer-scrpage} \usepackage{lipsum} \pagestyle{headings} \begin{document} \tableofcontents \section{test} \lipsum[1-20] ...

1

[Edited to take comments by @daleif and @Johannes_B into account.] Here is how section 9 of the fancyhdr manual ends. [Note: To get the manual under Linux or OS X, do texdoc fancyhdr in a terminal.] As a final remark you should also note that the * forms of the \chapter etc. commands do not call the mark commands. So if you want your preface to set ...

4

One possible solution is to simply use the default head mechanism. Define a new head scene that has the right properties: \definehead[scene][section] \define\PlaceLocation {\doifsomething{\structureuservariable{location}} {\structureuservariable{location}\blank[line]}} \setuphead [scene] [ placehead=empty, number=no, ...

2

The tocbibind package provides the means automatically to include index and bibliography in the ToC. The command \addchap is only needed when not using the KOMA classes (and is ignored, when KOMA is loaded) Here is the content of myref.bib @Book{Knuth:90, author = {Knuth, Donald E.}, title = {The {\TeX}book}, year = ...

3

This is easy with the package titlesec. Load it as \usepackage[pagestyles]{titlesec} instead of loading fancyhdr. Then, to have your section without printed numbers, define \titleformat{\section}{\normalfont\Large\bfseries}{}{0em}{} and to have the headers like you want, \newpagestyle{fancy}{ \setheadrule{0.4pt} ...

3


5

You have to use the marginleft option. So, for your paragraph definition something like, \titleformat{\paragraph}[leftmargin]{\normalfont\normalsize\bfseries\filleft}{\theparagraph}{15pt}{} and \titlespacing*{\paragraph}{65pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex} MWE: \documentclass[11pt,a4paper,english]{article} \usepackage[T1]{fontenc} ...

0

The C.D.P. Bundle, of which the letteracdp document class is just one of the components (albeit the main one), also provides the articoletteracdp document class, that allows you to use some of the sectioning commands, namely \section and \paragraph. Here is a minimal example: \documentclass [twoside,boldsubject,italicsignature,shortindent] ...

8

It would almost certainly be better to generate \section{The beginning of everything} but otherwise remove the \samepage and add penalties before and after. {\vspace{0pt plus 3\baselineskip}% \pagebreak[1]% \vspace{2\baselineskip plus -3\baselineskip}% \centering Chapter 1\\*% \Large The beginning of everything% \nopagebreak \vspace*{\baselineskip}% ...

4

potential bug reports in systems should probably be raised with the maintainers rather than here but anyway you can do the following workaround. \documentclass[12pt,notitlepage]{report} \usepackage{amsmath} \usepackage{titlesec} \newcommand\zz{$\left( a \right)$} \begin{document} \section*{\protect\zz} \end{document} Hard to think of any case when ...

1

The option hideothersubsections works for sidebar themes and can be used both with the theme specification, as in: \usetheme[hideothersubsections]{Hannover} or as a global option, as in: \documentclass[hideothersubsections]{beamer} In both cases it hides the subsections of the non active sections from the sidebar.

Top 50 recent answers are included