Tag Info

Hot answers tagged

5

To have the chapter heading to appear on a page of its own, add a \clearpage in the last optional argument for \titleformat. To have the heading vertically centered, add \vfill before and after the title is typeset: \documentclass[11pt]{report} \usepackage[T1]{fontenc} \usepackage{titlesec} \usepackage{calc} \usepackage{lmodern} \usepackage{lipsum} ...


5

One of the most useful aspects of using LaTeX and friends is that you can separate content from form; if you specify \hfil...\hfil for every unnumbered section, what happens if you change your mind later on? As an alternative, you can use (for example) the titlesec package; the \titleformat command has syntax: % from the titlesec package %\titleformat{ ...


4

Since you are using the IEEEtran document class with no special options, you need to redefine the family of commands with a dis suffix, since in that case the class has \else% not compsoc \def\thesectiondis{\thesection.} % I. \def\thesubsectiondis{\Alph{subsection}.} % B. \def\thesubsubsectiondis{\arabic{subsubsection})} % ...


4

That would take a lot of work. It would be easier to use a two macro approach. I usually do this independently of \chapter using \chapterprecis. If you wanted it directly into the chapter style it might be better to use an approach like \setchapterdesc{....} \chapter{....} and then let the chapter style use the macro that the imaginary macro ...


4

The spacing you are getting is due to the way you have specified the fontsize: the \fontsize arguments are the actual fontsize and the leading which is (roughly) the height of a line. (See What exactly is leading? for extensive discussion.) You've made this 36 pt in your sectioning commands, which means each line is approximately 3 times the character ...


4

Since you are using a \section* for it, there are no complications for the table of contents. \documentclass{book} \begin{document} \tableofcontents \chapter{Overview} \section*{\hfil Introduction\hfil} \section{Model} \section{Discussion} \noindent\hrulefill \end{document} To address both a possible criticism of non-generality as well as ...


4

Another solution using the ebgaramond font and its lettrine initials. I've tried to make the code as generic as possible, but some parameters (used in raisebox mainly) may depend on the font. I also tried to make the result as close as possible to the O.P.'s picture, plus some colour. The formatting of part titles is made with titlesec. Added: I managed to ...


4

One option would be to use the epigraph package for the epigraph and the titlesec package to easily customize the part heading format. A little example (notice that \epigraphhead has to be used before \part): \documentclass{book} \usepackage{epigraph} \usepackage{titlesec} \makeatletter \titleformat{\part}[display] {\Huge\scshape\filright} ...


3

It's because the declaration \arrayrulecolor{…} is global. Simply replace this fragment of your code: \newenvironment{myBox}[1] {\par\medskip\noindent\arrayrulewidth=1.5pt\arrayrulecolor{myBlue}% \hfill\tabularx{0.95\textwidth}{!{\color{myBlue}\vrule width 1.5pt} X @{}} \multicolumn{1}{@{}l} ...


3

The problem is a space that somehow sneaks in the definition of \sectionmark: \documentclass[11pt,oneside,article]{memoir} \usepackage{lipsum} % Begin Section format \newcommand{\marginbox}[1]{% \parbox[t][0pt]{10em}{% \upshape\sffamily\raggedright\mbox{}#1}% } \newcommand{\marginhead}[1]{% ...


3

This is above all due to the bad syntax in: \titleformat{\section}[block]{\Large\normalfont\bfseries}{#1}{.5em}{} You've put #1 at the place reserved for formatting the label. A correct syntax would be, e.g.: \titleformat{\section}[block]{\Large\normalfont\bfseries}{\arabic{section}.}{.5em}{#1}


3

Using titlesec: \documentclass{article} \usepackage{titlesec} \titleformat{\paragraph} {\normalfont\normalsize\bfseries}{\theparagraph}{1em}{} \titlespacing*{\paragraph} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex} \begin{document} \section{A test section} text \subsection{A test subsection} text \subsubsection{A test subsubsection} text ...


2

You can easily format as you wish with titlesec. Here is an example: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{microtype} \usepackage{fourier} \usepackage{cabin} \usepackage[x11names]{xcolor} % \usepackage[explicit]{titlesec} ...


2

It work as you want it if one removes the \noindent and \leavevmode (inserted by tcolorbox) from \@parboxrestore. But as I don't understand why tcolorbox tries so hard to switch to horizontal mode at the start of the box I don't know if this has unwanted side-effects: \documentclass[]{article} \usepackage[many]{tcolorbox} \tcbuselibrary{breakable} ...


2

\renewcommand*{\othersectionlevelsformat}[3]{\textcolor{DeepSkyBlue2}{#3}\autodot\enskip} A little explanation: As you said in your question, \othersectionlevelsformat is given 3 arguments, so, when you (re)define it, it needs to have 3 arguments, hence the [3]. And the definition only uses the third argument (where the counter is given) so you only need ...


1

The short answer appears to be: don't do it with pdflatex. Thanks to Bernard, cfr, and Sigur and I was able to find a solution which I can share. You can import and use named fonts using the fontspec package. This package does not work with pdflatex. I had to switch to xelatex. Initial tests showed that xelatex would compile my existing document with ...



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