Tag Info

Hot answers tagged

7

This is fixed in the next release of LaTeX (the above was generated with the pre-release code), but meanwhile you can use the code in the reply to the latex bug report at http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=amslatex/4393 \makeatletter \def\@stpelt#1{\global\csname c@#1\endcsname \m@ne\stepcounter{#1}} \makeatother


6

Here I've defined two new commands, \runinsec and \aftersec, the former to be used instead of section when you want sections like this and the latter to insert the information in the same line of the section title. MWE: \documentclass{article} \usepackage[hidelinks]{hyperref} \makeatletter \newcommand\runinsec{\@startsection {section}{1}{\z@}% ...


6

Short answer c for current, o for other. The macros are used for the default values for the style of the sectional unit entries in beamer ToCs. Not so short answer beamer allows to apply some effects to the entries in ToCs. Entries can appear as they usually do in a standard class in a regular way (this is called the show style) or thay can appear in a ...


5

Use the optional argument of titleformat meant for after code: \titleformat{\subsubsection}[runin]{\normalfont\bfseries}{\thesubsubsection.}{3pt}{}[:] %%<--- this one Code: \documentclass{article} \usepackage{titlesec} \titleformat{\subsubsection}[runin]{\normalfont\bfseries}{\thesubsubsection.}{3pt}{}[:] \begin{document} \section{Section one} ...


4

The memoir class already provides the mechanism for this: \documentclass{memoir} \newtheorem{theorem}{Theorem}[section] \counterwithin*{theorem}{chapter} \begin{document} \chapter{One} \section{A} \begin{theorem} OneA \end{theorem} \chapter{Two} \begin{theorem} Two \end{theorem} \section{B} \begin{theorem} TwoB \end{theorem} \end{document} The command ...


4

If Palatino is required for the whole document, you're already loading mathpazo to have Palatino in both text and math mode. MWE: \documentclass[11pt,titlepage]{article} \usepackage{mathpazo} \usepackage{sectsty} \subsectionfont{\Large\underline} \sectionfont{\LARGE} \usepackage{lipsum} % just for the example \begin{document} \section{A section} ...


4

You can use the package cleveref for this. The command \namecref{sec:catsdogs} does exactly what you want. Anyway you might want to try \cref{sec:catsdogs} instead of \namecref{sec:catsdogs} \ref{sec:catsdogs}, which does it automatically. MWE \documentclass[oneside]{article} \usepackage{cleveref} \begin{document} \section{About Cats and ...


3

egreg's code does not need \chapter here using article instead of report just don't use level 0: \documentclass[a4paper]{article} \makeatletter \newcommand\level[1]{% \ifcase#1\relax\expandafter\chapter\or \expandafter\section\or \expandafter\subsection\or \expandafter\subsubsection\else \def\next{\@level{#1}}\expandafter\next \fi} ...


3

You can change the way subsubsections are shown in the ToCs by setting the subsubsectionstyle key; for example: subsubsectionstyle={show/show/show/show} The first part gives the style for the current subsubsection; the second one, for other subsubsections in current subsection, the third specification controls the appearance of subsubsections in other ...


3

You can load the etoolbox package and reset the theorem counter at the beginning of each chapter. \usepackage{etoolbox} \pretocmd{\chapter}{\setcounter{theorem}{0}}{}{} MWE \documentclass{memoir} \newtheorem{theorem}{Theorem}[section] \usepackage{etoolbox} \pretocmd{\chapter}{\setcounter{theorem}{0}}{}{} \begin{document} \chapter{One} \section{A} ...


2

You can reset numbers at chapter boundaries too by using the internal \@addtoreset command as \makeatletter\@addtoreset{theorem}{chapter}\makeatother after you have declared your theorems. \documentclass{memoir} \newtheorem{theorem}{Theorem}[section] \makeatletter\@addtoreset{theorem}{chapter}\makeatother \begin{document} \chapter{One} \section{A} ...


2

Since you are using a KOMA class, use KOMA's facilities for configuring things. Details are in the manual. headings=small gets small headings throughout. chapterprefix=false banishes 'Chapter'. appendixprefix=true overrides this for the appendices only. \chapterformat is redefined to add horizontal, rather than vertical space - this takes care of the ...


1

it appears you can only put one item into the header at a time via the \rightmark \leftmark. That is true, but not the whole truth. You can work round it by concatenating several data items into a mark, and then selecting the appropriate item when you print the header. Since parts and chapters are unlikely to be less than 2 pages long, you can ...


1

The other answer only works for some of the predefined shapes (for example, runin as in the question), but will fail in some cases (display, or block, see example at the bottom). The proper way to do these kind of additions (see the titlesec documentation, Section 4.4. Putting a Dot after the Section Title, page 12) is to define a command with a mandatory ...



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