New answers tagged

2

Not sure if I am misunderstanding the question, but there is no problem with redefining the format of section headings within the body of the document. Here I do it with \section, but you can do the same for chapters, parts etc. The headings after the redefinition will take the new format (until you redefine again). I am just using tcolorbox as an example ...


0

If one of the "standard" document classes -- article, report, and book -- or a document class that's based on one of the standard classes is in use, a straightforward solution consists in loading the sectsty package and issuing the instruction \allsectionsfont{\singlespacing} in the preamble. An MWE (minimum working example): \documentclass{article} ...


2

A related question has a solution for section headings using the titlesec package. However, if this answer is copied and naïvely modified for chapter headings, it will result in a ! Package titlesec Error: Not allowed in 'easy' settings error. The error arises because the titlesec package works a little differently with chapters than it does sections. An ...


3

You could add the following instructions to the document's preamble (after loading the setspace package): \usepackage{sectsty} \allsectionsfont{\singlespacing} A full MWE (minimum working example): \documentclass[12pt,oneside]{book} \usepackage{lipsum} % for filler text \usepackage{setspace} \doublespacing \usepackage{sectsty} ...


2

Issuing \color{white} inside a group doesn't really do anything. I'd suggest defining a section rule colour (say) secrulecolor which you can adjust to suit your needs: \documentclass{scrartcl} \usepackage{titlesec} \usepackage{xcolor} \definecolor{myblue}{RGB}{0,25,102} % Title format \colorlet{secrulecolor}{black}% Default rule colour ...


4

You have the color macro improperly grouped. That is, you close the group (with a right brace }) immediately after changing the color, rather than after painting the \rule. \documentclass[a4paper, 10 pt, oneside, final]{scrartcl} \usepackage[left=4.6cm, right=0.75cm, top=0.5cm, bottom=0.5cm]{geometry} \usepackage{soul} \usepackage{scrpage2} ...


1

Here's a solution that uses the [h!] position specifier to direct LaTeX to make the figure environment non-floating. Of course, this method won't work if there's not enough space remaining in the column to actually insert the two side-by-side images and their captions. Instead of absolute widths for the minipages and images, I'd use relative widths, e.g., ...


4

A common misunderstanding is that figures or tables have to be placed in an environment of the same name to let them float away. They can be placed in situ (given enough space is available), just dropping the figure or table environment. If a caption is needed (the \label command in the MWE is useless without \caption, then \captionof by the caption package ...


2

This is largely what I said in the comments. I left a few things "in" but commented out along with meta-comments of my own trying to explain why. I hope all's clear. (If not, let me know.) \documentclass[12pt,a4paper,twoside]{report} \usepackage[top=2.54cm, bottom=2.54cm, left=2.54cm, right=2.54cm]{geometry} \usepackage{sectsty} % section font size ...


1

You can change the value of the counter tocdepth mid-document, writing it to the ToC at the appropriate spot. This allows you to vary what shows and what doesn't show. \documentclass{report} \begin{document} \tableofcontents \chapter{This chapter is listed in the contents page} \section{So are all its sections} \subsection{--- and subsections!} ...


2

Since \chapter uses \thispagestyle{plain}, the \fancypagestyle{plain} redefinition must disable the \fancyhead[RO,LE]{...} from fancy style, i.e. say \fancyhead{} in \fancypagestyle{plain}{...}. \documentclass{book} \usepackage{fancyhdr} \pagestyle{fancy} \renewcommand{\sectionmark}[1]{\markboth{#1}{}} % set the \leftmark \fancyhf{} \fancyhead{} ...


0

Calling secdot documenation sparse is understatement. In fact, there's no clue from the package documentation. Perhaps looking into the package itself might help... ... but tocloft usage is easier, for the quick work - around: tocloft grants access to the slot after the section number, this is called \cftsecaftersnum (after section number) for the section ...


0

The question started from being akin to Wikipedia and ended up as a duplicate. As you can see, process of colouring the heading and setting it to uppercase is pretty much manual. Is there a command that I can use to automate it? Also, I would like a '.' (dot) after the number. The question # 1 (coloured section) has been answered by @Arne ...


1

Since you use titleps, replace loading it with the option pagestyles of titlesec, and use its ‘easy’ interface. You won't even have to use the optional argument of \section: \documentclass{book} \usepackage{lipsum}% just to generate text for the example \usepackage[pagestyles]{titlesec} \newpagestyle{main}[\small]{ % define header ...


2

You should avoid setting the font of a sectional units within the argument. Not only does that force you to also supply an optional argument to circumvent these font settings to make it's way into the ToC, you run the risk that you're not being consistent in your formatting. While there are many options available for setting the sectional unit font, here's ...


0

Because of how apa6 works, Gonzalo Medina's answer is not quite enough on its own (at least when running in man mode -- I haven't checked the other output formats). You will end up with "1 Abstract", "2 {paper title}", "3 Introduction", and any subsections in appendices will have confusing numbers attached. For numbering just the sections within the main ...


4

I created the following 10-page lipsum: \documentclass{article} \usepackage{lipsum} \pagestyle{empty} \begin{document} \sloppy \vspace*{5cm} \begin{center} \bfseries This is \verb|lipsum[1-50]| \end{center} \lipsum[1-50] \end{document} This is how I would include it in the way you may be after (which avoids a page-break: \documentclass{article} ...


2

If all long section, subsection etc. titles should appear in the bookmarks, perhaps the easiest way is to shift the \toclevel@... to something far beyond the real levels, say add 1000, add the normal contentsline and use and explicit \pdfbookmark[...]{...}{...}. \documentclass{article} \usepackage{xpatch} \makeatletter \xpatchcmd{\@sect}{% ...


1

I changed my answer, to this code: \documentclass{article} \usepackage{ipsum} \linespread{1.35} \usepackage{titlesec} \usepackage{xcolor}% For colored things \usepackage{fontspec}% Font specification \titleformat{\section}% {\normalfont\Large\color{blue}}% format applied to label+text ...


6

Here is an example without package titlesec. \documentclass{scrbook}[2015/10/03] \usepackage[T1]{fontenc} \usepackage{xcolor} \usepackage{charter} \definecolor{mybluei}{RGB}{28,138,207} \definecolor{myblueii}{RGB}{131,197,231} \addtokomafont{disposition}{\usefont{T1}{qhv}{b}{n}\selectfont\color{myblueii}} ...


2

Does this meet your conditions? \documentclass[ 11pt, pagesize=auto, version=last, chapterprefix=true ]{scrbook} \usepackage[T1]{fontenc} \usepackage[explicit]{titlesec} \usepackage{xcolor} \usepackage{charter} \definecolor{mybluei}{RGB}{28,138,207} \definecolor{myblueii}{RGB}{131,197,231} ...


3

like this : \documentclass[a4paper, oneside, final]{scrartcl} % Paper options using the scrartcl class \usepackage{titlesec} % Allows creating custom \section's\usepackage{url} \titleformat{\section}{\large\scshape\raggedright}{}{0em}{}[\rule{.75\linewidth}{1pt}] % Section formatting \begin{document} \section{Section} \end{document}


3

This is the definition of \chapter from report.cls \newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi \thispagestyle{plain}% \global\@topnum\z@ \@afterindentfalse \secdef\@chapter\@schapter} \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne ...


6

I would use the datetime2 package to format the dates and then define a \datesec macro which takes two arguments, one, an ISO date, and the second the section title. [Update: I've redefined the \datesec command using the xparse package so that we can preserve the optional argument that the \section command uses for different TOC headings. This way \datesec ...


1

Instead of transparent you can also use TiKZ opacity. Following complete example shows how to use it supposing that every image will show a different opacity. \documentclass{beamer} %\usepackage{default} \usepackage{graphicx} \usetheme[hideothersubsections]{Goettingen} \definecolor{fondtitre}{rgb}{0.83,0.03,0.03} % dark red \setbeamertemplate{background ...


1

First of, since memoir has its own build in pagestyle system there is no reason to use fancyhdr with memoir. Second the chapter language does not have anything to do with fancyhdr or \@chapapp for that matter. The word current word for chapter is stored in \chaptername. \@chapapp is a special macro that returns \chaptername whenever appendix is not ...


2

As was suggested to you in the comments, load the titlesec package. Then add the following commands: \titleformat{\chapter}{\normalfont\bfseries\Large}{\thechapter.\quad}{0pt}{} \titlespacing{\chapter}{0pt}{-50pt}{40pt} The second one is what you're looking for. The values are respectively: left space space before (above) space after (below) So you ...


0

LaTeX IDEs (I use AUC-TeX with xemacs) allow you to e.g. process just the file being edited, or even just a range in it. Check the documentation, or ask around for suggestions for your platform.


2

The contents in your lstlisting environment need to be put within a frame environment. MWE \documentclass{beamer} \mode<presentation> { \usetheme{CambridgeUS} \setbeamercovered{transparent} } \usepackage{listings} \lstset{frame=tb, language=Java, aboveskip=3mm, belowskip=3mm, showstringspaces=false, columns=flexible, ...


2

A solution with titlesec: add to your preamble \titlelabel{\thetitle.\quad}


1

Normally you can redefine the section command using \renewcommand. \renewcommand\thesection{\arabic{section}.} will put the dot directly after the section number. This however messes up the next lower level of sectioning. \subsection{test} would produce the following: 1..1 Test Therefor you have also have to redefine the lower levels as show in the ...


2

Here's a slightly less hacky way. I've created a conditional using etoolbox to align subsections with sections if they immediately follow a section but not otherwise. The only real hack here is that if you have a section which is not immediately followed by a subsection, you need to explicitly add a \nosubsection command after it. Since you're not ...


1

A quick and dirty solution: \documentclass[a4paper,12pt]{book} \begin{document} \renewcommand{\thechapter}{\Roman{chapter}} \renewcommand{\thesection}{\arabic{chapter}.\arabic{section}} \renewcommand{\thesubsection}{\arabic{chapter}.\arabic{section}.\arabic{subsection}} \tableofcontents \newpage \chapter{My chapter}\label{ch:one} \section{My ...


1

You could probably make things as complex as you want, but from a simplicity perspective, it seems sufficient to let \grouping{<something>} act in a very similar way to what a ToC-entry for \chapter*{<something>} would: \documentclass{book} % \grouping{<something>} acts similar to a ToC entry for \chapter*{<something>} ...


2

Here's a solution with extra indentation and grouping: Use \groupthings[some vertical spacing]{Foo} to write a chapter like group header to the ToC. This automatically shifts the fake chapter heading and the section entries by a specified amount (tocloft is used here for simplify this.) After a new real chapter starts, the old indentations must be ...


2

Edit: After searching for similar question on SE, I found number of them, from which I learned: package res is not compatible with geometry content of resume should be enclosed by \begin{resume} and \end{resume} parameter margin push sections in margin with \renewcommand\sectionfont{...} you can globally define font prperties for section Considering ...


1

The main problem here is that the O.P. does not use the \appendix command at all and confuses chapter and section throughout the whole document. Now redefinition of \thesection as {Appendix \Alph{section}} will lead to a very wide section number -- too wide for the ToC number region -- it leaks into the dotted section line, that is why a dot . appears ...


3

Either one uses \refstepcounter{section} directly each time or \fakesection command that does \refstepcounter{section} or redefines \section to do effectively nothing apart from \refstepcounter{section}. In my point of view, it's better to redefine \section to provide the possibility of using the same code later on when section titles and toc entries are ...



Top 50 recent answers are included