1
vote
0answers
37 views

newcommand, section

I just received a new task in LaTex with a predefined structure and predefined commands. There was also the command \mysection. I think it shouldn't show the text of the section in the document, but ...
3
votes
1answer
80 views

How can I redefine the chapter command to display additional text below the title?

I'm relatively inexperienced with Latex. I'm using the Memoir class and I've been trying to develop a custom chapter style based on Danie Els' BlueBox style (the source for this is given on page 46 of ...
2
votes
2answers
101 views

redefine starred command \section*

with \usepackage[explicit]{titlesec} I have defined \section like \titleformat{\section} {\ttfamily\Large\bfseries\color{red}} {\thesection} {1em} {#1} i want to redefine the starred ...
2
votes
1answer
51 views

Unwanted vertical space/glue between consecutive custom \section macro calls

I am using XeTeX. I need to redefine the \section and \subsection commands in order to use some macros which don't behave well with the titlesec and/or sectsty packages. I found some code to do ...
4
votes
1answer
70 views

How to make a section without margin with the command “\exersize” like this:

‎ \documentclass[12pt‎ , ‎a4paper]{report}‎ \usepackage[framemethod=TikZ]{mdframed} \usepackage{xcolor}‎ \usepackage{titlesec}‎‎ ...
3
votes
1answer
39 views

\ifmmode check in section caption

To assure the correct usage of newcommands which only shall be used in mathmode, I have introduced a mathcommand, which checks mathmode by \ifmmode. Now I want to use such a mathcommand in a section ...
5
votes
1answer
92 views

Macro for promoting sections to chapters

I have a document where I would like to "promote" all sections to chapters, all subsections to sections, etc. That should affect not only the table of contents, but the documents as a whole. For ...
14
votes
3answers
214 views

How to define a new command based on \section with its optional argument?

I've defined a new command called \mysec like the below: ‎‎‎‎‎‎ \documentclass{article} \newcommand{\mysec}[1]{\section{#1}} \begin{document} \mysec[Foo foo]{Bla bla bla} \end{document} But in the ...
11
votes
3answers
461 views

Insert newpage before section but prevent pagebreak after part

Maybe some of you can already guess what I'm trying to achieve; I want to redefine some commands with the following result: every \section should start on a new page except for sections which are ...
9
votes
1answer
96 views

How to create a section heading sensitive macro or environment?

I have a \comments macro that inserts three centered asterisks (* * *) and changes font size and color. A corresponding \nocomments macro adds another break with centered asterisks and restores ...
4
votes
2answers
167 views

TeX capacity exceeded in Table of Contents due to macro

I'm working on a macro that when given Hello will make a chapter named hello, and number it like this: 1 - Hello, with the 1 - inside the margins. I also want it to automatically label the chapter by ...
9
votes
3answers
217 views

How to customize enumeration to implement Brazilian law texts?

This is a standard model of a Brazilian contract: http://www.consultta.com/modelos_contratos/modelos_contrato/0215.htm It more or less follow the way Brazilian laws are written: as you can see, the ...
4
votes
2answers
127 views

Variable color for section titles

The following def takes first three letters as an argument: \newcounter{colorCounter} \def\@sectioncolor#1#2#3{% {% \color{% \ifcase\value{colorCounter}% blue\or% red\or% ...
6
votes
2answers
193 views

Mark a place “to be done” with todonotes

I'm trying to create a \tbd (To Be Done) macro to add a todonote on a chapter/section/subsection/etc easily with the following properties. to have a useful list of todos with a simple macro call: ...
8
votes
4answers
190 views

How can I reference the current (sub)section number?

I want to create a macro that dynamically returns the current chapter, section, subsection (etc.) I'm in. I've created a macro called \getCurrentSectionNumber that does this, but it lacks the ability ...
4
votes
1answer
111 views

\AtBeginSection in other document classes like article or book

I understand that there is \AtBeginSection in beamer class which allows us to execute a set of commands at the start of each section. As we find in beamer guide, \AtBeginSection[⟨special star ...
0
votes
0answers
35 views

Retrieve current subsection and subsubsection name without label [duplicate]

How do I retrieve the current subsection and subsubsection and paragarph name without using \label. The reason is that then I would have to \label everything and I want a more automated solution. ...
3
votes
1answer
162 views

Create a custom heading in scrreprt (normal fontsize, boldface)

I finally managed to make an account here, but I have asked 2 questions before without making an account :) Ok my next question is the following: I am using the class scrreprt and the usual commands ...
2
votes
1answer
147 views

Alias for chapter with newcommand

I want some files to compile with two different templates, one that has the hierarchy like chapter > section > subsection and the other as section > subsection > subsubsection. For that, I tried to ...
3
votes
1answer
73 views

Why does my new subsectioning heading not gobble the subsection title?

I hope I'm not missing anything obvious. Instead of trying to elaborate on my title, let me illustrate with an MWE: \documentclass[twocolumn]{article} \makeatletter \setcounter{secnumdepth}{4} ...
2
votes
1answer
3k views

Format section's title with \renewcommand

I have tried to make my sections appear as "Section I : My section's title" or "Section I My section's title" with the \renewcommand\thesection... command but in the table of contents the word ...
4
votes
1answer
181 views

Repeating section with identical structure and different content

I would like to repeat identical subsection format with different contents. For example \documentclass{article} \usepackage{graphicx} \begin{document} \section{Intro} \subsection{A-text} ...
7
votes
1answer
67 views

I need an hrule, but not when at the top of the page

I have a multi-page document that has many small sections split with \hrule lines. Occasionally a section will end immediately before a page break, and so the next section will begin right at the top ...
10
votes
1answer
137 views

Is it possible to embed section titles within subsections?

I would like to to do the following \section{Animals} \subsection{Mammals} \subsection{Birds} and have it result in 1 Animals 1.2 Animals>Mammals 1.3 Animals>Birds I have tried to do this ...
3
votes
1answer
47 views

Issue wrapping a titlesec titleformat in a newcommand

I have a long document where I change the style of subsection headings in different parts of the document. I'm using titlesec with the explict option as it is necessary for the way I'm formatting ...
11
votes
2answers
462 views

What does \secdef do?

The definition of the chapter command in KOMA-class scrbook is: \newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi \thispagestyle{\chapterpagestyle}% \global\@topnum\z@ ...
3
votes
2answers
138 views

Section command with default spaces between title and rule

Ho can I make a section command that have the same spaces between the \titlerule and the title of the original \section command? The overall look must be equal to the original \section command. So, Is ...
2
votes
2answers
223 views

Renewdefine section with additional argument

My goal is to redefine the command \section with a new argument for labeling: \section[Title in TOC]{Title}{label} \documentclass{article} \let\oldsection\section ...
2
votes
1answer
185 views

Use headings in letters / vertical space

I need to use headings in a letter, more precisely in documentclass dinbrief. Knowing that LaTeX does not support section or subsection commands in this document class I use the following workaround: ...
5
votes
1answer
1k views

force section and subsection to capital letters

hi Im trying to renew the section cmd to make all sections in capitals. i have tried stuff like \newcommand{\tmpsection}[1]{} \let\tmpsection=\section ...
7
votes
1answer
251 views

Using structural commands in \newcommand - structure messed up?

Is it right that usage of structural commands like \chapter, \section, \subsection and the like inside of \newcommand screws up the document's structure? I've got a \section*{...} inside a \newcommand ...
3
votes
2answers
218 views

ignoring chapter easily

When working on a book I'd like to "ignore"(not compile) all chapters but the current one. I know there are methods to use like include and such BUT I do not want to use external files or some complex ...
5
votes
1answer
86 views

Problem setting lengths in an environment (spilling outside of the environment)

I am having with spacing between paragraphs in my document, and I think I have been able to trace back to a custom environment I have defined. \makeatletter \def\remarkname{Remark} ...
1
vote
1answer
197 views

How to modify the typesetting of nomencl header?

The nomencl package typesets the header of the nomenclature list as a \section* in the article document class. How can I change it to \subsection*?
2
votes
1answer
341 views

chapter headings

I'm using document class report and I have decided for chapter headings to use one of the predefined style of Vincent Zoonekynd's with some modification. I would prefer to have \chapter and \chapter* ...
9
votes
1answer
279 views

Macros for hiding empty sections do not work properly

In an attempt to make it possible to outline much of my document by adding new parts to it, but without making parts that I have not written anything on show up in the compiled document, I have ...
15
votes
1answer
566 views

Macro that knows it is at the end of a section?

In Is it a bad idea to use \begin{section} ... \end{section} in LaTeX?, Jan Hlavacek says: Of course it is typically possible to recognize an end of a section, but there is actually a number of ...
4
votes
1answer
537 views

textbf+UpperCase title

I would like to make a section title UpperCase+textbf, however, while trying to define it like this \makeatletter \renewcommand{\section}{ \@startsection {section}{1}{0mm} ...
4
votes
2answers
2k views

Error with \newcommand and \section

I'm trying to typeset an article. In the preamble, I defined these two things: \newcommand{\leftexp}[2]{{\vphantom{#2}}^{#1}{#2}} \newcommand{\hr}{\leftexp{*}{\mathbb{R}}} However, when I try to ...
3
votes
1answer
263 views

Inserting a \bigskip between section and subsection using a macro?

I'm trying to conform to the IoP guidelines, which from the IoP latex files they provide do not seem to follow the IoP guidelines. Several colleagues of mine have altered the files so they do fit the ...
9
votes
1answer
525 views

Hiding section titles when the section is empty

I have created a macro like this: \newcommand{\showsection}[2]{ \ifstrequal{#2}{}{}{\section{#1} #2} } It should be used like this in the document: \showsection{Books}{ Do you know any ...
14
votes
1answer
5k views

How do you insert an inline verbatim?

I'm trying to add an inline verbatim into a \paragraph? Was wondering how do you do that?
1
vote
4answers
121 views

Add a possibility for zero optional inputs to own command

Some very nice people here helped me write the code snippet below. And the code works great it prints out the correct subtext, and have a optional argument by typing * ...
4
votes
1answer
541 views

Current section title macro using titlesec

I have a macro that contains the title for the current section, however when using the titlesec package, it no longer works for \section and \subsection. I know titlesec redefines the functions I'm ...
3
votes
2answers
336 views

Sections with optional counting arguments

I am back for more... =) I am actually trying to fix my own problems, and i feel i learn so much here. Thank you so much for helpin someone as clueless as me ^^ I am attempting to make a text, with a ...
7
votes
3answers
291 views

Own Section command working numbered and unnumbered

I use the following command to have section headings with subtitles \newcommand{\Section}[2]{\section[#1]{#1\\\small »#2«}} But now I only can have numbered sections because the * doesn't work for ...
1
vote
1answer
572 views

Modify chapter command (and KOMA-script addchap)

Is there something like etoolbox's \appto, that also works for \chapter and \addchap? edit: I intend to use it to re-enable page numbering (which may or may not be disabled using ...
2
votes
1answer
466 views

Macro after heading shall not allow page break.

In a previous question I needed a solution for the following problem: I had defined a command for inserting special custom notes in my document with the fixme package and if those notes followed a ...
1
vote
1answer
343 views

renew section command with tabular sections

I want to renew the section command so each section will follow by a fully two columns tabular. it seems that it should be like: \renewcommand{\section}[1] { \hfill\newline {#1}:\newline ...
8
votes
2answers
754 views

“TeX capacity exceeded” because of a couple of raiseboxes in a \section?

In a package, I have the following command defined: \newcommand\fkm{ \ensuremath{\mathrm{ \raisebox{-0.1ex}{\rotatebox{22}{f}}\! \raisebox{0.2ex}{\rotatebox{-15} {k}}\! ...