# Tag Info

## Hot answers tagged macros

20


11


6

The environment form of \parbox is minipage: \newenvironment{CV} {\begin{minipage}{0.2\textwidth}\raggedright} {\end{minipage}} Note that you don't want a flushleft environment inside the minipage, because it adds vertical space fore and aft; with \raggedright this doesn't happen. Now you can call \begin{CV} Text \end{CV}

5

The error message of LaTeX is wrong, it should read: ! LaTeX Error: File `../common/{preambleCommon}.tex' not found. The the error is clear: the curly braces. They are not removed as argument braces, because \commonDir does not take an argument in \input{\commonDir{preambleCommon}}. Corrected: \newcommand*{\commonDir}{../common/}% \input{\commonDir ...

5

Ian Thompson's code is good, but you could add the check whether you can define a new length in the first place; calling, say, \deflen{textwidth}{6pt} would issue an error message at \newlength, but it would set \textwidth nonetheless. Since you are in a style file you don't need \makeatletter for @ commands, so you can do \newcommand{\deflen}[2]{% ...

4

One option using titlesec; the command \standardchapter produces a "normal" heading; \combinedchapter produces a heading in each the numbering has the form <number>.-- <number>+#1, where #1 is the integer in the mandatory argument: \documentclass{book} \usepackage{titlesec} \newcommand\standardchapter{% \titleformat{\chapter}[block] ...

3


2

The tcolorbox package provides a macro called \newtcolorbox to define custom environments; see section 2 in the manual (top of p12, in the current version). Under the assumption that you just want to change the colour, not the tints/shades, you could define a new environment that accepts three arguments (the first of which is optional): additional ...

1

The following example defines \chapterA with a range as chapter number. Also chapters inside the appendix are supported. Because of the longer numbers, the table of contents is adjusted accordingly. \documentclass{scrreprt} \let\savedthechapter\thechapter \let\orgchapter\chapter \renewcommand*{\chapter}{% \let\thechapter\savedthechapter \orgchapter } ...

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