New answers tagged

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} ...


2

Assuming you're using either the report or book document class, or a document class that's built on one of these classes, insert the following instructions in the preamble of your document to have the part-level header be placed close to the top edge of the text block: \usepackage{etoolbox} \patchcmd{\part}{\vfil}{}{}{} To have the part-level header be ...


0

Apparently the h2020proposal uses the same font size for chapter and section headings ('weird') To get numbered subsections, the secnumdepth counter has to be set to 2 (since subsection is the 2nd level below chapter). To remove the chapter number in front of the section number, use \renewcommand{\thesection}{\arabic{section}} -- this leaves ...


0

If all you are concerned about is that the font for subsections is too large for your liking then change the definition of the subsection font. You can find the (sub)subsection code via texdoc article. In your preamble do \makeatletter \renewcommand{\subsection}{...} % changing the font specification \makeatother and then use \subsection{...} instead of ...


0

IEEEconf is based on article class and does not touch the \section commands otherwise than by using titlesec and setting the fonts to be bold: \RequirePackage{titlesec} \titleformat{\section}{\ieee@times@xii@bold}{\thesection.}{0.5em}% {}\relax \titlespacing{\section}{0pt}{12pt}{12pt} \titleformat{\subsection}{\ieee@times@xi@bold}{\thesubsection.}% ...


1

This is the solution I found using Christian Hupfer's suggestion in one of his comments. \documentclass[10pt]{article} \usepackage{amsmath, amsthm, amssymb, amsfonts} \usepackage[width=5.5in, height=8in]{geometry} \theoremstyle{definition} \newtheorem{solution}{Solution} \begin{document} \section{Exact Solutions of the Navier-Stokes Equations} Intro. ...


1

Here's an example that 'automatically' redefines the subsubsection header number format and numbering and restores it with the next \section. I also used \cleveref so refer to the subsubsection as a Solution and not as a subsubsection. \documentclass[10pt]{article} \usepackage{amsmath, amsthm, amssymb, amsfonts} \usepackage{fancyhdr, graphicx} ...


0

There are two different ways of suppressing subsubsection numbers: Use \subsubsection*. This suppresses numbering completely and also supresses the addition of this subsubsection to the table of contents. \setcounter{secnumdepth}{2} (you only need this command once, best in the preamble of the document). This supresses the the printing of the numbers for ...


1

Here's an enumitem way instead of \paragraph. The paragraphlisti counter is reset by each subsubsection step (if such levels are used at all) David Carlisle's comment about \renewcommand{\theparagraph}{\arabic{paragraph}} is of course the easiest way! \documentclass{article} \usepackage{chngcntr} \usepackage{enumitem} ...


1

In the article class the hierarchy of levels is \section -> \subsection -> \subsubsection -> \paragraph. Paragraphs don't get numbers. In the book class the hierarchy of levels is \chapter -> \section -> \subsection -> \subsubsection -> \paragraph If you want to use custom numbering for paragraphs, call their values and edit their ...


2

You can formate the stared chapters with \titleformat{name=\chapter,numberless}[display]{...}{...}. Of course you will have to change the following example, as \thechapter does not make sense for starred chapters. \documentclass[a4paper, 11pt]{report} \usepackage{xcolor} \definecolor{dtured}{RGB}{153,0,0} \definecolor{dtugray}{RGB}{153,153,153} ...


0

In KOMA-Script it is now possible to use a keyval list as optional argument for \section etc. to set the ToC entry and page head differently. First one must activate this by using headings = optiontoheadandtoc|optiontohead|optiontotoc as class option: optiontoheadandtoc: same as default behavior, i.e. the optional argument is used for ToC and head mark, ...


2

I recently ran into a similar issue where my section title was being split across two lines, but only one or two words were ending up on the second line. I wanted to manually insert a line break so that I could balance it better. I ended up using non-breaking spaces to force the line break to happen earlier instead: \section{this is a very long title I ...


1

Page 4 of the manual of the titlesec manual, description of the \titlespacing command: <after-sep> is the separation between title and text—vertical with hang, block, and display, and horizontal with runin, drop, wrap and ...margin. By making the value negative, you may define an effective space of less than \parskip. So just do that: ...


0

Is this, what is wanted? A numbered chapter heading for bibliography? Then use \usepackage[numbib]{tocbibind}. \documentclass[oneside, openright]{uva-inf-bachelor-thesis} \usepackage{graphicx} \usepackage{url} \usepackage{lipsum} \usepackage[numbib]{tocbibind} \usepackage{etoolbox} ...


3

If it is just for the formatting in the text, this is enough (it will also hit subsection and subsubsection \setsecnumformat{\csname the#1\endcsname.\quad} The default is the same (without the dot)


2

As I stated in a comment, you can use the starred version of \vspace{...}, that is: \vspace*{5mm} \section{Section 1} Some text \subsection{Section 1.1} A similar question (and thus answer) is asked here: difference between \vspace and \vspace* for negative arguments This also answers your follow up question.


0

Using \vspace*{5mm} instead of \vspace{5mm} solves the problem. The star is essential.


0

I would really recommend to use the default pagestyle plain for chapter pages. Nevertheless here is a suggestion defining an additional mark. \documentclass[twoside, openright]{report} \usepackage{lipsum} \usepackage{fancyhdr} \usepackage{lmodern} \usepackage{chngcntr}% defines \counterwithout \usepackage{xpatch} \usepackage{scrextend}% defines \ifstr ...


1

Erh, one can just do this via \setsecnumformat{\llap{% \makebox[\chapindent][l]{% \csname the#1\endcsname\hfill% }% }} instead of issuing \hangsecnum, which by default is the same as \setsecnumformat{\llap{\csname the#1\endcsname\quad}}} @Ruben Does this still fail at your end? I should be using the same memoir version, but is using ...


2

Here is a possibility, though it is very dirtily hacked: \documentclass{memoir} \usepackage[usehighlevels]{alnumsec} \alnumsectionlevels{1}{section,subsection,subsubsection,paragraph} \alnumsecstyle{aaaa} \surroundarabic[{.}][]{}{} \otherseparators{1} \alnumsecstyle{aaaa} \usepackage{marginnote} \reversemarginpar \usepackage{xpatch} ...


3

You can just save the original section command before placeins alters it: \documentclass{book} \let\origsection\section \usepackage[section,above,below]{placeins} \usepackage{graphicx} \begin{document} \show\section \chapter{Only chapter} This very short introduction leaves most of the page empty... % ---- HERE, A PAGE BREAK OCCURS ---- ...


3

You can use the float package with the placement specifier [H] to force the table into the position you want: \documentclass[]{article} \usepackage{float} \begin{document} \subsection{AAA} This data was taken from RStudio's fclust packedge. \begin{table}[H] \centering \caption{Butterfly data - 3 clusters} \begin{tabular}{ccccccccccc} ...


4

The following macro definition is in article.cls: \newcommand\paragraph{\@startsection{paragraph}{4}{\z@}% {3.25ex \@plus1ex \@minus.2ex}% {-1em}% {\normalfont\normalsize\bfseries}} The \@startsection macro takes six arguments; the fourth specifies ...


3

It is the \paragraph heading. You can use titlesec and its \titlespacing to remove it: \documentclass{article} \usepackage{lipsum} \usepackage{titlesec} \titlespacing{\paragraph}{0pt}{0pt}{1em} % | | | % indent --+ | | % skip before --+ | % sep between heading and text --+ ...


1

I'd simply use a macro \exercise. There you can also internally step a counter for referencing. The numbers are put in the margin as requested. \documentclass{article} \newcounter{exercise} \setcounter{exercise}{0} \newcounter{subexercise} \setcounter{subexercise}{-1} \renewcommand\thesubexercise{\arabic{exercise}\alph{subexercise}}% ...


2

You do want to shift the left margin and to typeset the section title in the margin. \documentclass[a4paper]{article} \usepackage[showframe]{geometry} \usepackage{titlesec} \usepackage{lipsum} \geometry{left=6cm,right=3cm} % 3cm for the sections \titleformat{\section}[leftmargin] {\normalfont\bfseries\filright} {\thesection} {1em} {} ...


1

Here I start with the code given in the question cited by the OP. I don't know the actual numbers are precise, but a \leftskip can be used to compensate for the leftmargin value. I show in this MWE a transition back to the original sectioning system, which must be accompanied by a cancellation of the \leftskip. \documentclass{article} ...


1

From the link you sent, the person was asking why \section{\itshape My title} worked but \section{\textit{My title}} didn't. So Basically, doing the first method will solve the problem.


2

I am not sure if LaTeX / KOMA-Script (>=3.15) means that you can use the up to date version 3.19a too. If that is possible you can redefine \sectionlinesformat to insert a \strut at the end of all section headings. \documentclass[twoside]{scrartcl}[2015/10/3] \makeatletter \renewcommand{\sectionlinesformat}[4]{% \@hangfrom{\hskip ...


1

The reason can be found in the log file: Class scrbook Info: Deactivating the titlesec workaround, (scrbook) because package is newer than expected on input line 4. There was an update of package titlesec. If you really want to use the new version together with a KOMA-Script class you have to install the prerelease of version KOMA-Script ...


1

I'm not sure why you'd want to underline the titles. But it's your document. \documentclass{article} \usepackage{sectsty} \subsubsectionfont{\normalfont\underline} \setcounter{secnumdepth}{2} \begin{document} \section{section example} \subsection{subsection example} \subsubsection{subsubsection example} \end{document}


2

So, thanks to the help of @John Kormylo I was able to solve my problem with: \renewcommand{\subsubsection}{\par\bigskip\underline} Which outputs:


1

I've given the log file a closer look and found the following hint: Class scrbook Warning: Usage of package `titlesec' together (scrbook) with a KOMA-Script class is not recommended. (scrbook) I'd suggest to use the package only (scrbook) if you really need it, because it breaks several (scrbook) ...


0

The question could be solved by switching from twoside to oneside option, which shifts the 'indentation' -- i.e. the margins, such that recto and verso pages look alike according to the horizontal margins \documentclass[12pt, a4paper, oneside, titlepage]{article} \title{ Theory on Brontosaurs %Bla \\ %Bla\\ %Bla } \author{Miss Ann Elk \and Arthur ...


1

Regarding labels for equation and sections, I am able to mostly solve the issue by adapting the answer found at Using custom \locallabels command with custom \eqref command. Minor work is still required for inter-chapter cross-referencing, but as stated in the question, that seldom occurs in this case. However, this does not fix the citation issue, which is ...


3

The first equation uses the “short” skips, because the paragraph before it is empty. You have to make it artificially longer and to back up by a baseline skip plus the above display skip. \documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[margin=1.0in]{geometry} \usepackage{microtype} ...


2

I added this after \section: \mbox{}\vspace{-\dimexpr\baselineskip+\topskip}. See ADDENDUM for possible general fix: \documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[margin=1.0in]{geometry} \usepackage{microtype} \usepackage[fleqn]{mathtools} \setlength\mathindent{0pt} \begin{document} ...


2

The problem is that after the section values occur again and the current chapter value is still 1 (in this document version here). This confuses hyperref, since it uses again section. as prefix for the anchors. Changing \theHsection to apply another prefix, say appendixsection. cures the problem. \documentclass[paper=letter, fontsize=11pt, ...


0

In the amsbook style, subsections are realized inline. You can introduce a line break by adding \mbox{} (that is, an empty text) and starting a new paragraph afterwards. \documentclass{amsbook} \setcounter{secnumdepth}{1} % subsections are not numbered \begin{document} \chapter{First} \section{Section} Some text to show what happens Some text to show ...


0

you simply change in to \@seccntformat e.g., \def\@seccntformat#1{\colorbox{grayten}{\csname the#1\endcsname\quad}}


1

As I understand, you want something like this: \documentclass[a4paper]{article} \usepackage{lipsum} % Dimensions \textwidth=13cm \oddsidemargin=4cm \evensidemargin=\oddsidemargin \topmargin=-1cm \textheight=25cm \makeatletter \def\section#1{\vspace{1cm plus 5mm minus 3mm}\goodbreak\par\noindent% \hspace{-4cm}\parbox{17cm}{\Large\bf #1}% ...



Top 50 recent answers are included