Tag Info

New answers tagged

1

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


0

the ams document classes behave this way by default -- the optional argument is used only for the running head, and the long form is used in the toc. because adjustments such as line breaks must sometimes be applied to the long form, the ams classes provide an "in-title" modification mechanism to allow different changes to apply to the header itself vs. ...


3

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 chapter titles is made with titlesec. ...


3

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


9

\documentclass[a4paper]{book} \usepackage[T1]{fontenc} \usepackage{libertine} \usepackage[table]{xcolor} \makeatletter %\renewcommand\thepart{\arabic{part}} \def\@part[#1]#2{% \ifnum \c@secnumdepth >-2\relax \refstepcounter{part}% \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% \else \addcontentsline{toc}{part}{#1}% \fi ...


2

Three different options; which one to use will depend on your actual document and your needs: Make the redefinition after \tableofcontents: \documentclass[12pt,a4paper]{article} \usepackage[a4paper,margin=1in,bindingoffset=0.2in,centering,headheight=0.3in,heightrounded]{geometry} \usepackage{tikz} \usepackage{titlesec} \usepackage[english]{babel} ...


10

We can exploit the fact that the final argument of \@startsection in the definition of \section can contain a one parameter macro which will receive the section title (with the number) as argument. \documentclass{article} \makeatletter \renewcommand\section{% \@startsection{section}{1} {\z@}% {-3.5ex \@plus -1ex \@minus -.2ex}% {2.3ex ...


4

Another simple but not perfect solution. \documentclass[preview,border=12pt,12pt]{standalone} \def\Section#1{\section*{\tabular{@{}c@{}}\hline #1\\\hline \endtabular}} \begin{document} \Section{PSTricks is fun!} Bla bla bla \end{document}


1

In scrbook/scrreport, the skip before/at the end of a chapter is given by \renewcommand*{\chapterheadstartvskip}{% \vspace*{2.3\baselineskip}% }% \renewcommand*{\chapterheadendvskip}{% \vspace{1.725\baselineskip \@plus .115\baselineskip \@minus .192\baselineskip}% }% Adjust them to your liking. In terms of \sections, the KOMA-script bundle still ...


3

\centering is a switch that causes everything inside the group following it to be centred. Remove it since you don't need it in this context - it is the cause of the alignment problem in your section title. Moving the list environment to the right could be done using enumitem's leftmargin or wide key-value. \documentclass[12pt]{article} ...


3

It's actually quite easy (although I don't like it). The amsart class uses the standard \@startsection command, so it's just copying the relevant code from amsart.cls and adding \large where necessary. Oh, and \Large is really too much. I changed also \specialsection and \contentsnamefont for uniformity. \documentclass{amsart} \usepackage{blindtext} ...


2

Obviously, amsart has no support for \section[]{}, so it is not really necessary to define that, but for later uses perhaps;-) It is not a good idea to add something like `\section{\Large My sophisticated Title}, since this leads to a large text entry on the TOC, which looks awkward. In my opinion, both section title and the number should be scaled if ...


2

If you do not need a table of contents you can delete the lines for the toc redefinition. However a solution with a special macro like \Ssection} maybe a better choice, then \ţableofcontents hasn't to be redefined: \documentclass[12pt, a4paper]{article}% \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{xcolor} ...


3

There's a numberless key (to be used with name) that does the job: \documentclass[12pt, a4paper]{article}% \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[x11names]{xcolor} \usepackage[explicit]{titlesec}% \titleformat{\section} {\ttfamily\Large\bfseries\color{red}} {\thesection} {1em} {#1} ...


3

Copy what subequations does, with some modifications for hyperref: \documentclass{article} \usepackage{amsmath} \usepackage{listings} \usepackage[colorlinks]{hyperref} \makeatletter \newcounter{parentlstlisting}% Counter for ``parent equation''. \newenvironment{sublstlisting}{% \refstepcounter{lstlisting}% ...


1

% arara: pdflatex \documentclass[12pt,twoside,headsepline]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[ngerman]{babel} \usepackage{scrpage2} \automark[subsection]{section} \pagestyle{scrheadings} \usepackage{blindtext} % jsut fot this example \begin{document} \blinddocument \end{document}


0

complete fix including subsubsection: \renewcommand\subsection{\@startsection{subsection}{2}% \z@{.35\linespacing\@plus.7\linespacing}{.25\linespacing}% % {\normalfont\itshape}} {\normalfont}} \renewcommand\subsubsection{\@startsection{subsubsection}{3}% \z@{.35\linespacing\@plus.7\linespacing}{.25\linespacing}% {\normalfont}}


1

In UNTdissertation.sty you have: %%% This redefines the \subsection command so that it's flush left and %%% italicized. \renewcommand\subsection{\@startsection{subsection}{2}% \z@{.35\linespacing\@plus.7\linespacing}{.25\linespacing}% {\normalfont\itshape}} Hence it is not a bug, it is a feature. If your really dislike it (and like the mentioned ...


0

Thanks Andrew, that helped a lot! My final solution, for reference is (no section numbering, \g as environment shorthand): \documentclass[10pt,a4paper]{article} \usepackage{amsfonts} \usepackage[fleqn]{amsmath}%fleqn for align left \let\ul=\underline \newenvironment{Gather}[1]{\subsection*{\underline{#1}}% \minipage{\textwidth}\csname ...


3

You could try something like the following: \documentclass[10pt,a4paper]{article} \usepackage{amsfonts} \usepackage[fleqn]{amsmath}%fleqn for align left \let\ul=\underline \newenvironment{Gather}[1]{\subsection{\underline{#1}}% \minipage{\textwidth}\csname gather*\endcsname} {\csname endgather*\endcsname \endminipage} \begin{document} ...


2

Alternativly you can use the tocstyle package from the KOMA-Script bundle: \documentclass{article} \usepackage[tocflat]{tocstyle} \usetocstyle{standard} \begin{document} \tableofcontents \section{section A} \subsection{subsection A} \subsection{subsection B} \end{document} \documentclass[12pt]{scrartcl} \usepackage{booktabs} \usepackage{multirow} ...


4

Using the tocloft package you can easily achieve what you want using \cftsetindents: \documentclass{article} \usepackage{tocloft} \cftsetindents{section}{0em}{2.3em} \cftsetindents{subsection}{0em}{2.3em} \begin{document} \tableofcontents \section{section A} \subsection{subsection A} \subsection{subsection B} \end{document}


6

The package documentation is your friend. \documentclass{article} \usepackage{secdot} \sectiondot{subsection} \begin{document} \section{A section} \subsection{A subsection} \end{document}


6

\paragraph is numbered or not just as \section is. In article section is heading level 1 and paragraph is heading level 4. Headings are numbered down to secnumdepthwhich has an initial value of 3. If you use \setcounter{secnumdepth}{4} paragraph level headings will be numbered, conversely if you use \setcounter{secnumdepth}{0} the sections won't be ...


1

I would like to sum up the two solution provided by Mass and Christian Hupfer. The mathematics (and also the \boldsymbol macro) can be in headings, like \section, protected by command \texorpdfstring{} which should enclose the math. Christian contributed with a command \phantomsection which should be before \printglossary command and helps to make the ...


4

Here's a solution, where \@seccntformat is hijacked to add an endnote marker. The endnote text is provided as a trailing optional argument to \Section. \documentclass{article} \usepackage{xparse,endnotes} \NewDocumentCommand{\Section}{somo}{% \gdef\thissectionnote{}% reinitialize \IfValueT{#4}{\gdef\thissectionnote{#4}}% set up the endnote ...


1

Inspired by Werner's answer, I have the following answer which directly uses \marks command in etex, for resolving the conflict between header sections and background sections. \documentclass[12pt]{book} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \fancyhead[LE,RO]{\thepage} \fancyhead[RE]{Book Name} \fancyhead[LO]{\leftmark} ...


4

The problem here deals with the output routine and the fact that it doesn't coincide with the gathered text at the point of page shipout (it's asynchronous). One is typically grabbing information too late, since TeX has already gather text that will form part of the following page (stepping counters and such as it's gobbling the input stream). One way around ...


3

It's possible (but not at all clear) that you mean the PDF bookmarks/outline rather than the table of contents within the page, hyperref has an option to control that depth. \documentclass{report} \listfiles \setcounter{tocdepth}{5} \setcounter{secnumdepth}{5} \usepackage[bookmarksdepth=5]{hyperref} \begin{document} \tableofcontents ...


1

Thanks for the MWE. I'm not entirely sure what an "out line" is. Do you mean a table of contents? If so then you need to change the tocdepth and insert \tableofcontents: \documentclass{report} \listfiles \setcounter{tocdepth}{5} \setcounter{secnumdepth}{5} \begin{document} \tableofcontents \chapter{sectioning} \section{titles} \subsection{subtitles} ...


0

If you use the index package option, it will define the \newterm command where you can just do \newterm{heading1}, but this will put all the terms in the new index glossary instead of the main (default) glossary. So you could either use this option and just change the glossary title or define a command like \newterm that uses the main glossary instead of the ...


2

Besides defining the sectional unit, you also need to define how the entry will be typeset in the ToC; this can be achieved using \newlistentry and \cftsetindents (this is the memoir's way of doing it). A complete example (adjust the settings according to your needs): \documentclass{memoir} \usepackage{titlesec} \setcounter{secnumdepth}{6} ...


0

You can try to add something like \setcounter{minitocdepth}{3} (and change the "3" as desired) in your preamble.


2

For each mark there are three variables set by TeX: \botmark, \firstmark and \topmark. While \leftmark uses \botmark (the last set mark on the current page) \rightmark uses \firstmark (the first set mark on the current page). But you want to use the \topmark which is the last mark of the previous page. Based on the definition of \rightmark in latex.ltx ...


2

Maybe you can redefine your chapters and sections? \documentclass{book} \usepackage{lipsum} \newcommand\mychapter[1]{\chapter*{#1}% \addcontentsline{toc}{chapter}{\protect\numberline{}#1}% \def\rightmark{#1}} \newcommand\mysection[1]{\section*{#1}% \addcontentsline{toc}{section}{\protect\numberline{}#1}% \def\leftmark{#1}} \begin{document} ...


9

Redefine \thesection, \thesubsection and \thesubsubsection (the representation for the counters): \documentclass{article} \renewcommand\thesection{\arabic{section}--} \renewcommand\thesubsection{\thesection\arabic{subsection}--} \renewcommand\thesubsubsection{\thesubsection\arabic{subsubsection}--} \begin{document} \section{Test section} \subsection{Test ...


3

I do not know whether this is what is requested, but it is quite easy to add a non-existing section (or anything) to the TOC and use a section number in front of it. User cmhughes already pointed to \addcontentsline Please change the title and the corresponding section number. \documentclass{scrartcl} \usepackage{pdfpages} \begin{document} ...


5

You can unset all acronyms before the table of contents and reset them all afterwards: \documentclass{amsbook} \usepackage[acronym,nonumberlist]{glossaries} \newacronym{MOSFET}{MOSFET}{metal-oxide semiconductor field-effect transistor} \makeglossaries \begin{document} \glsunsetall \tableofcontents \glsresetall \chapter{\Gls{MOSFET}} \printglossaries ...


1

This is a quick and dirty solution, but I do not recommend it really (;-)) Use the command \printthis[false]{% before the portions of code you do not want to end up in the .pdf file and add } after the end of that portions. It hides the content as if would be a comment. \documentclass{book} \usepackage{blindtext} \usepackage{etoolbox} ...


2

One of the most used way to do that is to split your main file in several files, and to include them with the include command. \documentclass{article} % Preamble \begin{document} \include{chap1} \include{chap2} \include{chap3} \include{chap4} \end{document} chap1.tex, …, chap4.tex being tex files containing only the content of those chapter (no preamble ...


1

\documentclass{article} \begin{document} If only parindent is positive: \def\zhiva#1{\noindent\textbf{#1}\par} \zhiva{Title1} My paragraph. \zhiva{Title1} My paragraph. \end{document} I can see, that in a dual answer there is an opposite vision of indenting and non-indenting.


2

This, or some variant, may solve your problem. It's not clear what you want when the text wraps to a new line. \documentclass{article} \usepackage{lipsum} \setlength{\parindent}{0cm} \newcommand{\mytitle}[1]{% \addvspace{0.2cm}% perhaps, as Barbara Beeton suggests \textbf{#1} \par \hspace{0.5cm} } \begin{document} \mytitle{Title} \lipsum[15] ...


0

You should use \@startsection unless there is good reason not to, as that incorporates code to handle consecutive headings and to dea lwith headings that are more than one line, or followed by a blank line, neither if which are handled by this code \vskip-\lastskip% %Insert some glue to separate heading; here's a good place to break the page \vskip ...


3

A possible solution using native commands of memoir: \documentclass[oneside,spanish,10pt, letterpaper]{memoir} \usepackage[applemac]{inputenc} \usepackage{tikz} \usepackage{anysize} \marginsize{3cm}{2cm}{2cm}{2cm} \usepackage[siunitx,european,americanresistors]{circuitikz} \definecolor{logo}{HTML}{6C17A1} \definecolor{logo2}{HTML}{FFFF10} \usepackage{color} ...


1

The titlesec package with explicit option lets you have simple formatting commands; e.g.: \titleformat*\subsubsection}[hang]{\large\bfseries\boldmath}{0.5em}{\thesubsubsection.}{#1} where: the "optional" argument is the shape of the section; hang is LaTeX default. next argument is general formatting to be applied to both label and title text. 3rd ...


1

I think using \normalfont or \textnormal inside the \subsubsection header can serve your purpose. \subsubsection{\textnormal{I am same as the paragraph font}} I am the paragraph. or, \subsubsection{\normalfont I am same as the paragraph font} I am the paragraph.


1

Tis is just an example of how can you do that (it's not clean, not really checked if it works in other different cases, and has no “proper interface” for you, but just to give you an idea). \documentclass{scrartcl} \makeatletter \let\svsection\section \def\section{\ifnum\c@section=6 \expandafter\sectionseven \fi\svsection} ...


2

If you define a short title for your section or chapter, the classicthesis format takes this as your header text as well. With the command \sectionmark{} (and similarly \chaptermark{}) you are able to define a custom header version of your title. In this case, you are forced to use it in order to restore the original title writing. % arara: pdflatex % ...


3

Your syntax is wrong; here is a more correct one. The arguments to \titleformat needn't be specified in this format, but this I find it more readable to keep each one in a separate line. \documentclass{book} \usepackage{lmodern} \usepackage{titlesec} \titleformat{\section} {\centering\normalfont\fontsize{16}{19}\selectfont} {\thesection} {1em} {} ...


0

Maybe not a perfect solution, but works in LyX in AMSART document type. \usepackage{titlesec} \titleformat{\section}{\Huge\bfseries}{\thesection}{1em}{} \titleformat{\section}{\Huge\bfseries}{Kapitel \thesection.}{-110pt}{\newline} \usepackage{titletoc} \titlecontents{section} [3.8em] % ie, 1.5em (chapter) + 2.3em {} {\contentslabel{2.3em}} ...



Top 50 recent answers are included