New answers tagged

1

The doubling is caused by a \@dblarg call somewhere in the definition of the sectioning commands. You can force the command to use the starred version to avoid the doubling: \newcounter{h} \def\thepage{\relax} \def\h{\hstar*} \newcommand{\hstar}{\@startsection{h}{0}{0cm}{0cm}{0cm}{\scshape}} However, you will likely encounter many more problems when trying ...


1

You only showed a scrambled form of the error message. Your log file will show ! Undefined control sequence. <write> ...ct \numberline {1}Some title}{\thepage }\protected@file@percent } l.9 \end{document} Adding \newcommand\thepage{\arabic{page}} to your class file makes it work without error, or ...


1

Without any packages and the standard book class you can achieve this as follows. \documentclass{book} \makeatletter \def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@} \def\@makechapterhead#1{% %\vspace*{50\p@}% \vspace*{10\p@}% {\parindent \z@ \centering \reset@font \thickhrulefill\quad \scshape \@chapapp{} \...


1

First of all, check if your school has a template (hopefully in LaTeX!) for theses. If not, make sure that you respect (as far as reasonable/really required, see below) their standard format. If I had to create my own style, I'd start with the (very customizable) memoir class (standard, available with major TeX distributions, comes with extensive and ...


6

Here is an example of what can be done with titlesec (and xrfill + xcolor): \documentclass{book} \usepackage[svgnames]{xcolor} \usepackage{titlesec} \usepackage{xhfill} \colorlet{rulecolor}{Gainsboro!40!Lavender} \usepackage{lipsum} \titleformat{\chapter}[display] {\filcenter}{\mbox{}\xrfill[0.4ex]{3pt}[rulecolor]\textsc{\large\enspace\chaptername \...


2

I guess you want something as follows: \documentclass{amsbook} \usepackage{fmtcount} \renewcommand{\thesection}{Unit \padzeroes[2]{\decimal{chapter}}-\padzeroes[2]{\decimal{section}}} \renewcommand{\thesubsection}{\decimal{chapter}.\decimal{section}.\decimal{subsection}} \begin{document} \chapter{Some Chapter} \section{Some Section} \subsection{Some ...


2

You should use \markright for the section, not \markboth. \documentclass[12pt,twoside]{report} \usepackage[a4paper,width=150mm,top=25mm,bottom=25mm]{geometry} \usepackage{fancyhdr} \pagestyle{fancy} %Remove Chapter in front of chapter-name \renewcommand{\chaptermark}[1]{\markboth{#1}{}} %Tried to de-capitalize section-name \renewcommand{\sectionmark}[1]{\...


4

In this code you have the Times New Roman (\fontfamily{ptm}) for the names of the \chapter, \section and \subsection and the rest of the text with Computer modern (CM). If, one day, you desires changed the font family of the chapter, section and subsection, you choose your preferite fontcode and put it into the brackets of \fontfamily{...}. one of this font ...


1

I've spent a couple of days looking at this, after coming across the gamebook package. Initially, it didn't quite suit my purposes - it generates section references correctly, but doesn't support shuffling the sections. A quick search revealed mentions of the latex randomlist package, but this seemed geared towards itemized lists. After a bit of work, I ...


2

I suppose you want something like this: \AtBeginSubsection[] { \begin{frame}<beamer> \frametitle{Outline} \tableofcontents[ currentsection, sectionstyle=show/hide, subsectionstyle=show/shaded/hide, ] \end{frame} } The result will be this: Containing exclusively the current section and shaded it's subsections... PS: Better than hiding the ...


2

You have to enable the chapter prefix using either option chapterprefix=true or headings=chapterprefix. Do not use package sectsty with a KOMA-Script class. Additionally I have replaced package fancyhdr by scrlayer-scrpage which is part of the KOMA-Script bundle. \documentclass[twoside, open=right, fontsize=13pt, DIV=calc,% to avoid a warning ...


0

Take a look at memoir, it handles a staggering assortment of chapter styles, and you can tweak them, or build your own. Take a peek at Madsen's "Various chapter styles for the memoir class" for examples (with full code).


3

Here's a solution built around your example, made with titlesec. It also uses the microtype package to add space between the letters of "CHAPTER". \documentclass[a4paper,12pt,twoside]{book} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} % If you write in French \usepackage{lipsum} \usepackage{times} \usepackage{xcolor} \...


1

When you are using your own section name it may lose count. This is one option: \section*{Your section name} \addcontentsline{toc}{section}{Your section name}\stepcounter{section} Just add a counter afterwards.


1

I don't have much experience with latex code. I read discussions, manuals and here in this forum there are excellent discussions. I'll list the solutions that I have found and that seem to me to be similar to your question. You will need to study the code and adapt it to your needs.. Once done ask a question in the forum with your code to solve the problems ...


1

Basically, you want to right align the subsection numbers within a small space. If this causes problems in the TOC etc., try \hbox to 1em{\hfill...} or use \protect. \documentclass{article} \renewcommand{\thesubsubsection}{\makebox[1em][r]{\alph{subsubsection})}} \begin{document} \section{Dolor Sit Amet} \subsubsection{Lorem Ipsum} \subsubsection{Lorem ...


0

I wrote a script for this when stapling papers together into my dissertation, err I mean writing my dissertation. The sed strategy would not work easily in my case since I was using cleveref to reference multiple labels in the same command, e.g. \Cref{sec:experiments,sec:results}. Example usage: python add_ref_suffix.py --suffix chp1 --files *.tex Effect: ...


4

In your cleanup of \@startsection, this conditional: \if@nobreak \everypar{}% \else \addpenalty\@secpenalty\addvspace\@tempskipa \fi evaluates to true, thus \everypar{}. In your code you used the false branch, thus the difference. But I invite you to reconsider your approach. Stripping down \@startsection and its subordinates will, for ...


0

Welcome to TeX.SE! The error message: ! Undefined control sequence. \rSection #1-> \sectionskip \MakeUppercase {\bf #1} \sectionlineskip \hrule ... l.32 \begin{rSection}{Education} says that when expanding things from line 32 of the file being processed, TeX found \sectionskip from the expansion of macro \rSection, which itself comes from the expansion ...


1

Here's an implementation of a book section level made with titlesec, using the \titlecass command to define the new level. The books are added to the table of contents with titletoc, and at the beginning of a new book, the part and chapter counters are reset. The formatting of a book title is defined with \titleformat and \titlespacing, and the formatting ...


2

First, amsart only supports tocdepth up to 3, because it only defines the variables \r@tocindentX for −1 ≤ X ≤ 3. Even then, this looks like a bug in amsart, when you set tocdepth to 3. The class defines: \def\l@subsubsection{\@tocline{3}{0pt}{1pc}{7pc}{}} and then also does: \let\l@paragraph\l@subsubsection The first ...


1

The command \chaptername from the titlesec package can be used for that. As an example, the third chapter is produced with the following code. \documentclass{book} \usepackage{titlesec} \renewcommand{\chaptername}{Story} \begin{document} \chapter{} \chapter{} \chapter{Case Study} \end{document}


1

LaTeX commands are case sensitive, so try \LaTeX instead


1

I'd define a special command for this and use standard functions for resetting the subsubsection counter when \subdivision is issued. \documentclass{article} \usepackage{graphicx} \usepackage[colorlinks=true, linkcolor=blue]{hyperref} \newcounter{subdivision} \counterwithin*{subsubsection}{subdivision} \renewcommand{\thesubsubsection}{\arabic{...


1

You can use option hypertexnames=false for package hyperref: \documentclass{article} \usepackage{graphicx} \usepackage[colorlinks=true, linkcolor=blue ,hypertexnames=false% <- added ]{hyperref} \begin{document} \tableofcontents \subsection*{Subsection A} \addcontentsline{toc}{subsection}{Subsection A} \setcounter{subsubsection}{0} \subsubsection{...


1

All you need is \phantomsection from hyperref. \documentclass{article} \usepackage[pdftex]{graphicx} \usepackage[colorlinks=true, linkcolor=blue]{hyperref} \begin{document} \tableofcontents \phantomsection \subsection*{Subsection A} \addcontentsline{toc}{subsection}{Subsection A} \setcounter{subsubsection}{0} \subsubsection{subsubsection a} ...


2

My comment was wrong, \texorpdfstring is not relevant here (beside helping to avoid a warning). The title is passed for the \nameref through \GetTitleString and so you will have to add the line break to the list of commands to disable. Be aware that this means that the title has to be expanded and that fragile material might break. \documentclass[oneside,...


0

After: reducing your example to the minimum (I'm keeping lmodern because it doesn't have the same metrics as Computer Modern); replacing all \begin{figure}[h] with \begin{figure}[ht] (the LaTeX output told you it was already working in this way anyway); removing the useless \makebox[\textwidth][c]{...} calls (your \includegraphics[width=1\textwidth]{...} ...


3

Ok, if your class doesn't alter amsart too much, you can easily create what you want by redefining \sectionname. If the space between § and the number isn't wanted use \renewcommand*\sectionname{§\ignorespaces} instead. \documentclass[]{amsart} \usepackage{duckuments} \renewcommand*\sectionname{§} \begin{document} \tableofcontents \duckument \end{...


Top 50 recent answers are included