# Tag Info

## Hot answers tagged sectioning

9

Rather than complicate your macros forever I'd just edit the file. if your sec.tex file is \section{My Title} ..... \section{With Title Case} ... Then after a command such as sed -ie "s/\\\\section{$$.$$$$[^{}]*$$}/\\\\section{\\1\\L\\2}/" sec.tex then it will be \section{My title} ..... \section{With title case} ... I used sed on the ...

5

You Shouldn't Be Writing Like This. If you really want, then be prepared to have problems with these macros. ;-) \documentclass{article} \usepackage{etoolbox} \makeatletter \patchcmd\@sect{#8}{\MakeFirstUppercase{#8}}{}{} \newcommand{\MakeFirstUppercase}[1]{% \@MakeFirstUppercase#1\@MakeFirstUppercase } \def\@MakeFirstUppercase#1#2\@MakeFirstUppercase{% ...

4

amsart.cls has \def\paragraph{\@startsection{paragraph}{4}% \z@\z@{-\fontdimen2\font}% \normalfont} so if you put \makeatletter \def\paragraph{\@startsection{paragraph}{4}% \z@\z@{-\fontdimen2\font}% {\normalfont\bfseries}} \makeatother in your preamble, it will use bold for paragraph heads.

3

The problem is similar to the one in Latex Confused with Word in heading You solve it by doing \DeclareRobustCommand{\ABCD}{\mathbf{ABCD}} so LaTeX won't see ABCD and try to lowercase it. However, you should think whether the style you're using is compatible with having math in titles. It isn't, in my opinion.

3

You shouldn't call setspace with memoir (but it's innocuous, as the class doesn't load it to begin with). If you really want such a big interline space, then it should be the same in titles, in my opinion, but it's possible to do how you'd like. \documentclass[9pt,draft,twoside,openright,showtrims]{memoir} \usepackage{amsmath,amssymb,amsfonts} ...

3

Here's one option using some boxes and the explicit option for titlesec (adjust the settings according to your needs): The code: \documentclass{book} \usepackage[explicit]{titlesec} \usepackage{lmodern} \usepackage{graphicx} \usepackage{xcolor,lipsum,mdframed} \definecolor{sectcolor}{cmyk}{0,1,.75,.39} \definecolor{sectbgcolor}{RGB}{0,106,168} ...

2

Instead of overloading the standard \section command (which can be done, but I don't consider a good idea), I propose you to use a new command \Ssection for sections with subtitle (for sections with no subtitle, you can still use the standard \section command): \documentclass{book} \usepackage[explicit]{titlesec} \usepackage{lmodern} \usepackage{graphicx} ...

2

\documentclass{memoir} \usepackage{etoolbox} \makeatletter \gdef\currentsection{??} \gdef\currentsubsection{??} \newcommand{\setcurrentdivisions}[2]{% \ifstrequal{#1}{section}{\xdef\currentsection{#2}\gdef\currentsubsection{??}}{}% \ifstrequal{#1}{subsection}{\xdef\currentsubsection{#2}}{}% } ...

2

This could be a possible solution, by providing a \enhancedpart command, having an 3rd argument containing the bookmark title. Since hyperref automatically adds the bookmarks via \addcontentsline, this has to be kicked out. The bookmark package provides some features, but the destination key has to be set then. This is automatically done using a ...

2

The end of the ToC clears the page (two pages for two-sided). So the \addcontentsline is being executed when TeX is already on page 7. To avoid this, you can add the contents line first, manually clearing the pages to ensure that the ToC does not need to start a new page: \documentclass{book} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} ...

2

By using the display shape provided by titlesec you can set the vertical spacing between the number and title without having to redefine everything. Also, you can get un-numbered \subsection and \subsubsection by using the starred variant (see MWE). This will also hide them from tableofcontents. \documentclass{article} \usepackage{titlesec} ...

2

In my opinion you're abusing \paragraph. I'd prefer defining a command: \makeatletter \newcommand{\proofstep}[1]{% \par% ensure starting on a new paragraph \addvspace{\medskipamount}% some vertical space \textit{#1\@addpunct{.}}\enspace\ignorespaces } \makeatother Example. \documentclass[10pt,a4paper]{amsart} \newtheorem{theorem}{Theorem}[section] ...

1

Or use xpatch. \documentclass{amsart} \usepackage{lipsum} \usepackage{xpatch} \xpatchcmd{\paragraph}{\normalfont}{{\normalfont\bfseries}}{}{} \begin{document} \paragraph{Some paragraph} \lipsum[1] \end{document}

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