Hot answers tagged

4

A simple solution is to gobble math with \pdfstringdefDisableCommands: \documentclass{article} \usepackage{hyperref} \makeatletter \pdfstringdefDisableCommands{\let\(\fake@math} \newcommand\fake@math{}% just for safety \def\fake@math#1\){[math]} \makeatother \begin{document} \section{\(I\) cast warnings but I wish I wouldnt} ...


4

Do not use package titlesec together with a KOMA-Script class. It is possible to get the same format of the chapter heading using KOMA-Script commands. \renewcommand\chapterformat{% \thechapter\hspace*{20pt}\textcolor{gray75}{|}\hspace*{20pt}% } \addtokomafont{chapter}{\Huge\rmfamily} Additional remarks: Use the new syntax for option ...


4

Define \UnitLabel with an argument: \documentclass{article} \usepackage{lipsum} \usepackage{xparse} \newcounter{Unit} \NewDocumentCommand{\UnitLabel}{m}{% \makebox[4.5em][l]{Unit #1}% } \NewDocumentCommand{\Unit}{ m }{% \refstepcounter{Unit}% \section*{\UnitLabel{\Roman{Unit}}#1} \addcontentsline{toc}{section}{\UnitLabel{\Roman{Unit}}#1}% } ...


3

Use \DeclareExpandableDocumentCommand -- this does not allow an optional argument at the end of the argument list, but this is no issue here! The \NewDocumentCommand version isn't expandable, see e.g. \show\UnitLabel: \UnitLabel=\protected macro: ->\makebox [4.5em][l]{Unit \Roman {Unit}}. l.25 \show\UnitLabel i.e. \UnitLabel is protected. The xparse ...


3

Here's a way if para means \section etc. (In this case, \thesection does not need to be changed). The (aa) numbering can be obtained by \alphalph and increasing the subparagraph number by 26 only virtually. I've provided a enumitem way in case a list is actually meant. In case of the \section - version -- I don't recommend this numbering/labelling style ...


2

You can change the alignment of all section levels redefining \raggedsection. Default is \raggedright. But if you want to center the section titles do not set an indentf for it. \documentclass{scrbook} \renewcommand*\raggedsection{\centering} \RedeclareSectionCommand[ font=\fontsize{15}{10}\selectfont ]{section} \usepackage{blindtext} \begin{document} ...


2

Here is a solution (I used erewhon, a clone and extension of Adobe Utopia). \documentclass{book} \usepackage[utf8]{inputenc} \usepackage{geometry} \usepackage[explicit]{titlesec} \usepackage{array, graphicx} \usepackage[tracking=true]{microtype} \usepackage{fourier, erewhon} \usepackage{lipsum}% just to generate text for the example ...


1

It's wrong to use center to begin with. In the following example I used the PDF for another answer; in the second page I added the same heading, in order to see that they're typeset in the same way. \documentclass[12pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[brazilian]{babel} ...


1

Here are two ways -- with mdframed and tcolorbox -- the numbers are bold, as well as the title by default (in book) \documentclass{book} \usepackage[x11names]{xcolor} \usepackage{mdframed} \usepackage[most]{tcolorbox} \setcounter{secnumdepth}{3} \begin{document} \chapter{Foo} \section{Foo} \subsection{Foo} \begin{mdframed}[backgroundcolor=lightgray] ...


1

Something like this? \documentclass[11pt,a4paper]{article} \usepackage[margin=1in]{geometry} \usepackage[english]{babel} \usepackage{amsmath, amssymb} %package for math's formulas \usepackage{footnote} %package to set footnotes \usepackage{fix-cm} %package to fix size of fonts \usepackage[dvipsnames]{xcolor} \usepackage{titlesec} ...


1

Using \renewcommand{\thesection}{\arabic{section}} is similar to \makeatletter \renewcommand{\thesection}{\@arabic\c@section} \makeatother so use the former. Sectional numbering is defined recursively by default, meaning that if its removed from \section, it'll be removed from \subsection, \subsubsection, ... However, the chapter number may show ...



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