Hot answers tagged

28

The main downside is that it masks the problem and makes it less likely that you apply a better fix. If you are processing thousands of pages and don't want to hand correct that's a good thing, but if you are just doing a single book or thesis or something, it's better to see them and adjust by hand. If the last line of a paragraph is just one or two words, ...


20

Three aspects here, one on design, one on macro programming, one policy. At the design level, it's well-known that the standard classes are somewhat esoteric without modification. However, there are many (probably millions) of documents out there which rely on the standard designs or on altering them in a predictable way. Any changes to the core styling ...


17

I am the author of the memoir class. I had used the standard classes for my documents, usually with some added packages or preamble code to get the look I wanted, often writing new packages for that purpose. I eventually decided to produce the memoir class, based on the book/report classes with options for article class type output and including those ...


16

titlesec does not support KOMA-Script classes. So do not combine them. To change the layout of the chapter, section etc. titles you can use KOMA-Script options and \RedeclareSectionCommand & Co and you can redefine \partlineswithprefixformat, \chapterlineswithprefixformat, \chapterlinesformat, \sectionlinesformat and \sectioncatchphraseformat. Until ...


15

Add the following lines to your preamble: \makeatletter \g@addto@macro\appendix{% \renewcommand*{\chapterformat}{% {\chapapp\nobreakspace\thechapter\autodot\enskip}% } \renewcommand*{\chaptermarkformat}{% {\chapapp\nobreakspace\thechapter\autodot\enskip}% } \let\oldaddcontentsline\addcontentsline \newcommand\hackedaddcontentsline[3]{\...


11

\chaptermark sets \markboth and then you can use \leftmark for the chapter in the header. Similarly, \sectionmark sets \markright. So \rightmark can be used for the section entry in the header. \documentclass{scrbook} \usepackage[ top=25mm, bottom=30mm, inner=20mm, outer=70mm, marginparsep=7mm, marginparwidth=45mm, ]{geometry} \usepackage{tikz}% ...


11

Add the following definition for sections and alike \renewcommand*\othersectionlevelsformat[3]{% \llap{#3\autodot\enskip}% } and change the definition of \chapterformat to \renewcommand*{\chapterformat}{% {\fontsize{20}{30}\scshape\chapappifchapterprefix{}}% \fontsize{120}{30}\selectfont\rlap{\thechapter\autodot}% } MWE: \documentclass[ fontsize=...


10

Thinking about it, I guess, it would not be worth the trouble. Thousands of packages rely on a certain feature of the LaTeX core and now somebody changes something. How in the world can you avoid breaking some peoples documents or other peoples packages? And then, all the angry users »this kind of document compiled for years!1!« There is a striking xkcd ...


9

scrbook defines a macro \ifnumbered that isn't a TeX if which is not necessarily wrong but it is a bit dangerous and here mcode pushes you over a cliff. You can restore scrbook s definition: \documentclass{scrbook} \let\zz\ifnumbered \usepackage{mcode} \let\ifnumbered\zz \begin{document} %\tracingall \chapter{matlab code} \end{document}


9

onepage is not a valid KOMA option. If you want to switch to one-sided mode within a double-sided document when using KOMA classes you have to use twoside=false (being twoside a "simple switch" you can use no or off as well, instead of false), i.e. issue the command \KOMAoptions{twoside=false} just before your appendix.


9

Update redefining \chapterlinesformat Since KOMA-Script version 3.19 the command \chapterlinesformat can be redefined to change the layout of chapter titles that have no prefix line. Now it is possible to set a different entry for the page headings or to use the starred versions of the chapter title command. Chapter titles with more than one line are ...


9

For the first problem, you can set \setlength{\nomlabelwidth}{1.5cm} in the preamble (adjust to the needed value), or follow the method suggested for how to set label width to widest element using nomencl? (a bit more complicated). For the second problem, the manual of nomencl suggests \setlength{\nomitemsep}{-\parsep} (also in the document preamble).


9

Do not use package tocloft (mentioned in your own answer) together with a KOMA-Script class. There is an KOMA-Script option to fill the space between the chapter title and the pagenumber in TOC with dots: \KOMAoptions{toc=chapterentrydotfill} If the page numbers for the chapter headings should not be bold use \addtokomafont{chapterentrypagenumber}{\...


9

The MWE in the question already contains a redefinition of \thechapter. This can be customized further by replacing the part counter \thepart with a new macro that contains the required abbreviation. To set this using an optional argument to \part the old definition of \part can be stored in another macro such as \oldpart, and then \part can be redefined to ...


8

Your problem can be solved with “widetext.sty”. This package mimicing the mechanism with the same name from RevTeX4 was written by Anjishnu Sarkar. Alas, the original home went away. Luckily, we can get a copy from a svn site of Einstein Toolkit, because they have used it for a document (direct link): https://svn.einsteintoolkit.org/documents/...


8

Update Here is a new Suggestion for KOMA-Script version 3.19 or newer. There are two new commands: \chapterlinesformat and chapterlineswithprefixformat. They can be redefined to insert the lines. With chapterprefix=true you can use \newcommand\titlerule[1][1pt]{\rule{\textwidth}{#1}} \renewcommand\chapterlineswithprefixformat[3]{% \ifstr{#2}{}{}{\...


8

Here is a solution using etoc package \documentclass{scrbook} \usepackage{etoc} \begin{document} \etocdepthtag.toc{mtchapter} \etocsettagdepth{mtchapter}{subsection} \etocsettagdepth{mtappendix}{none} \tableofcontents‎‎ \chapter{First chapter} text text text \section{A section} text text text \subsection{A subsection} text text text \appendix \...


8

Class scrbook is designed to have a titlepage, then a new page is started with headings and text or table of contents etc. Usually a book starts on page 1 (the title page) or page I (roman number, often not printed for title page). Most books start a new chapter on the right (odd) page and class scrbook reflects this behaviour. The binding correction is ...


7

I don't know how this can be done in LyX, but those are options to be passed to the document class. MWE: \documentclass[headings=openany,headings=big]{scrbook} \begin{document} \chapter{First chapter} \chapter{The Big Vacation} \end{document} Output: BTW: if you want to reduce the size of headings titles you have to use headings=normal and not ...


7

Here is a suggestion without titlesec. Note, that the code needs KOMA-Script version 3.15 or newer. \documentclass[a4paper,chapterprefix]{scrbook} \usepackage[english]{babel} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{xcolor} \colorlet{chaptercolor}{blue!80!black} \setkomafont{chapter}{\normalfont\color{chaptercolor}\Huge} \...


7

Second Update: If the chapter and section titles etc. should be aligned to the indented text you can use: \documentclass[ paper=a4, %chapterprefix ]{scrbook}[2015/10/03] \newcommand\secnumwidth{1.5cm} \makeatletter \renewcommand\chapterlinesformat[3]{% \IfArgIsEmpty{#2} {#3} {\@hangfrom{\hspace{-\secnumwidth}\makebox[\secnumwidth][l]{#2}}{#3}...


7

You can use a trick I learnt some time ago: using the layout feature of geometry \documentclass{scrbook} \usepackage{geometry} \usepackage{kantlipsum} \geometry{ a4paper, layoutsize={20cm,27.9cm},% cut 1cm from the width layoutoffset={1cm,0cm},% put it in the offset inner=1cm, outer=2cm, showframe, } \renewcommand{\chapterformat}{% \hspace*{-...


7

You placed your notes between paragraphs where LaTeX was still in vmode. If you want to align the notes with the next paragraph, you should place it IN the next paragraph. You can use things like \leavevmode, \noindent, \null or \strut to place them at the very start of the next paragraph. \documentclass[a4paper, twoside, titlepage, fontsize = 9pt, ...


7

\clearpairofpagestyles removes the predefined content of both pagestyle scrheadings and plain.scrheadings. There are also the commands \clearmainofpairofpagestyles and \clearplainofpairofpagestyles to clean scrheadings and plain.scrheadings respectively. Note that with package scrlayer-scrplain pagestlye headings is an alias for scrheadings and plain is an ...


7

I propose this solution with the insbox plain TeX macro package and the captionof{figure} command: \documentclass[11pt,oneside, captions=centeredbeside]{scrbook}% \usepackage{showframe} \renewcommand{\ShowFrameLinethickness}{0.3pt} \usepackage{blindtext} \usepackage[export]{adjustbox} \usepackage{wrapfig} \input{insbox} \makeatletter \@InsertBoxMargin=3mm \...


7

spanish redefines the tilde ~ to be an accent. But the class uses it all over the place in the standard meaning of a space, and this clashes. You can tell babel-spanish to leave the tilde alone: \documentclass[booklanguage={spanish,es-notilde}]{langscibook} \author{John Doe} \title{The test} \begin{document} \maketitle \frontmatter \tableofcontents \...


6

As explained in section 3.12 of the KoMaScript manual, chapter starting pages use the \chapterstyle page style and the default meaning of \chapterstyle is plain. Just renew the meaning: \documentclass[10pt,twoside,a4paper]{scrbook} \usepackage[utf8]{inputenc} \usepackage[ left=1cm, right=1cm, top=1cm, bottom=1cm, includeheadfoot ]{geometry} \...


6

For the main toc Please read carefully again the linked answer and the KOMA-Script documentation1): By default in scrbook (and scrreprt) the toc is set in onecolumn modus. Only, when you want to have it in two columns, you need \unsettoc{toc}{onecolumn}. So, leaving it out is the solution here … For the minitoc Use \setchapterpreamble2). Note, you must ...


6

If you have an individual section that causes problems, you could issue \clearpage before that section. Otherwise one could try something like the plain TeX \filbreak macro. The following will push the section heading to the next page if there is less than 3cm left, and makes the previous page essentially raggedbottom, closing up so that there is at most ...


6

Well, the documentation of koma-script helped me to find a solution after all: \documentclass{scrbook} \renewcommand{\partheadmidvskip}{\enskip} \renewcommand{\partformat}{\thepart\autodot} \setkomafont{partnumber}{\usekomafont{part}} \begin{document} \part{This Is Part One} \end{document} However, since I am not a very experienced user of LaTeX I don'...


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