Converting exact margin requirements to areaset command


How do I find out what areaset command to use for a specific margin requirement, e.g., left=2.5cm, right=2.5cm, top=2.5cm and bottom=3cm?

scrheadings and longtable not working together


I need pretty urgent help (thesis hits the printer in two days!) getting scrheadings and longtable working together.

The problem is if I have scrheadings enabled, the longtable tables will not align properly, regardless of how many times I rerun pdflatex on it. The longtable documentation does not mention anything about incompatibility with KOMA-Script or scrheadings. However, KOMA-Script documentation does make note of that longtable captions can be iffy, and has a special “origlongtable” option, but this did not work for me, and the captions are not my problem to begin with, as it looks fine to me.

Doing a search I found that I’m not the first to stumble into it (I think), but no coherent question (and thus no answer) was offered by previous reporter:
scrheadings-and-longtable-alignment-problems, and longtable-column-problem-column-alignment-changes. Also, this mailing list, alas, in German: scrheadings-und-grosze-tabellen.

I have spent many hours hunting the cause for this, and I have desperately tried to make a MWE, but things are not easy since I don’t understand TeX code. I could not figure out how to make it not depend on classicthesis.sty, so I had to include that as well, but in a version that I cut out a lot of (to me unintelligible) TeX-code.

I note the following:

  • If I comment out the pagestyle{scrheadings} the longtable will align just fine. Same goes for the ToC: include{contents}, it seems. So what on earth is going on here?

My current plan is to compile two versions of my thesis, one to get the TOC and one for the correctly aligned longtables, and then splice the PDFs together. Desperate solution for a poor desperate PhD-student. If the above is not solvable, could one issue some command before and after the longtable to make scrheadings stop messing up my tables?

RequirePackage{fix-cm}
documentclass[headinclude,9pt]{scrreprt}

usepackage[T1]{fontenc}
usepackage[utf8x]{inputenc}
usepackage[american,swedish]{babel}

usepackage{longtable}

usepackage{classicthesis}

begin{document}

% Commenting out one or both of the below 2 lines will make longtable work again.
pagestyle{scrheadings}
include{contents}

scriptsize
begin{longtable}[l]{rrrrrrrr}
$1$       & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$ \
hline
endhead
$5.314$   & $1.022$   & $6.962$   & $4.835$   & $9.946$   & $9.707$   & $9.971$   & $9.964$    \
$7.175$   & $9.866$   & $4.687$   & $9.776$   & $8.412$   & $7.882$   & $7.139$   & $1.155$    \
$1.96$    & $5.353$   & $1$       & $5.004$   & $4.883$   & $9.988$   & $2.672$   & $1.112$    \
$8.874$   & $2.278$   & $2.459$   & $1.371$   & $2.25$    & $1.821$   & $1.04$    & $1$        \
$1.528$   & $5.917$   & $1$       & $9.246$   & $1.73$    & $1.005$   & $9.33$    & $8.058$    \
$3.014$   & $4.365$   & $6.927$   & $9.413$   & $7.008$   & $9.914$   & $2.72$    & $9.866$    \
$5.673$   & $3.747$   & $11.45$   & $1.182$   & $3.794$   & $3.458$   & $1.028$   & $1.24$     \
$1.395$   & $2.384$   & $2.638$   & $5.219$   & $3.087$   & $2.826$   & $4.889$   & $3.528$    \
$8.556$   & $4.747$   & $1.171$   & $7.636$   & $9.789$   & $3.979$   & $0.01852$ & $9.399$    \
$3.422$   & $16.3$    & $5.842$   & $94.55$   & $0.1007$  & $0.1002$  & $0.1057$  & $0.1001$   \
$0.1532$  & $0.1$     & $0.1$     & $0.1183$  & $0.1001$  & $0.1001$  & $0.1002$  & $0.1001$   \
$25.77$   & $0.4728$  & $96.91$   & $275.3$   & $41.25$   & $31.46$   & $1.286$   & $176.2$    \
$12.27$   & $35.94$   & $23.2$    & $231.6$   & $2.785$   & $0.4538$  & $13.76$   & $12.07$    \
$1.753$   & $2.225$   & $1.867$   & $1.574$   & $1.401$   & $1.785$   & $0.3183$  & $1.026$    \
$30.75$   & $0.5885$  & $153.7$   & $363.5$   & $47.7$    & $39.29$   & $2.544$   & $396.5$    \
$9.981$   & $21.8$    & $11.88$   & $81.95$   & $3.601$   & $0.01082$ & $26.78$   & $11.29$    \
$1.941$   & $2.086$   & $1.59$    & $1.066$   & $1.232$   & $2.428$   & $1.6$     & $1.102$    \
$4.987$   & $6.033$   & $3.409$   & $3.455$   & $4.937$   & $10.59$   & $15.17$   & $1.303$    \
$44.99$   & $1.053$   & $142.6$   & $443.7$   & $58.63$   & $35.93$   & $4.415$   & $326.5$    \
$3.904$   & $12.66$   & $8.865$   & $0.1209$  & $1.807$   & $0.3359$  & $94.19$   & $17.22$    \
$5.344$   & $6.743$   & $18.56$   & $4.354$   & $5.036$   & $10.07$   & $6.786$   & $11.3$     \
$9.74$    & $0.1519$  & $52.48$   & $82.46$   & $13.34$   & $8.783$   & $0.9119$  & $84.15$    \
$2.25$    & $5.199$   & $41.75$   & $0.3816$  & $1.775$   & $0.8467$  & $61.33$   & $14.62$    \
$41.94$   & $1.205$   & $291.2$   & $493.8$   & $63.51$   & $22.02$   & $3.123$   & $385.8$    \
$15.93$   & $16.24$   & $26.48$   & $12.24$   & $12.13$   & $11.21$   & $7.592$   & $29.8$     \
$0.109$   & $0.1465$  & $0.1458$  & $0.4281$  & $0.6299$  & $0.01341$ & $0.2518$  & $12.3$     \
$3.336$   & $5.127$   & $3.068$   & $2.549$   & $1.704$   & $13.25$   & $2.484$   & $4.045$    \
$56.5$    & $1.971$   & $182.5$   & $150.7$   & $33.31$   & $93.73$   & $6.552$   & $725.3$    \
$3.28$    & $7.1$     & $4.992$   & $4.912$   & $2.576$   & $4.767$   & $4.378$   & $3.856$    \
$4.315$   & $16.33$   & $10.8$    & $54.31$   & $4.513$   & $0.106$   & $18.25$   & $0.101$    \
$41.19$   & $1.027$   & $156.9$   & $365.3$   & $43.43$   & $39$      & $2.794$   & $368.7$    \
$4.774$   & $5.466$   & $4.54$    & $3.558$   & $4.259$   & $6.963$   & $3.439$   & $4.691$    \
$1.34$    & $6.864$   & $4.343$   & $1.108$   & $2.083$   & $0.4267$  & $17.04$   & $7.185$    \
$5.91$    & $8.392$   & $8.667$   & $4.178$   & $3.885$   & $11.58$   & $4.722$   & $7.319$    \
$0.2745$  & $0.1423$  & $0.1$     & $1.732$   & $0.7494$  & $0.1001$  & $0.1002$  & $0.1$      \
$1.411$   & $2.714$   & $6.728$   & $0.5166$  & $0.5525$  & $3.9$     & $0.2139$  & $0.1194$   \
$0.03975$ & $0.01041$ & $0.2149$  & $0.1999$  & $1.944$   & $0.3978$  & $2.477$   & $2.029$    \
$6.967$   & $4.775$   & $1.069$   & $7.782$   & $10.91$   & $3.516$   & $0.1142$  & $0.04042$  \
$0.7146$  & $0.9026$  & $0.03532$ & $0.5893$  & $0.06372$ & $0.1207$  & $0.1105$  & $0.8943$   \
$2.874$   & $0.05704$ & $1.302$   & $0.1891$  & $1.021$   & $1.025$   & $9.955$   & $6.847$    \
$0.06041$ & $0.02929$ & $0.2607$  & $0.1446$  & $0.03939$ & $0.02616$ & $9.917$   & $0.02871$  \
$0.08923$ & $0.49$    & $0.5084$  & $2.492$   & $8.706$   & $1.344$   & $0.02061$ & $0.01041$  \
$9.958$   & $0.554$   & $0.01093$ & $0.5246$  & $0.1416$  & $0.04229$ & $0.1703$  & $0.08021$  \
$3.887$   & $0.05062$ & $0.3151$  & $0.1267$  & $0.1986$  & $0.6058$  & $0.9035$  & $0.3665$   \
$1.422$   & $1.051$   & $0.2785$  & $1.016$   & $2.263$   & $1.208$   & $1.681$   & $5.28$     \
$1.856$   & $0.3341$  & $0.3861$  & $0.6126$  & $2.295$   & $1.034$   & $9.883$   & $2.965$    \
$0.06021$ & $0.409$   & $0.1273$  & $0.4442$  & $0.4195$  & $0.09476$ & $0.3549$  & $0.04486$  \
$0.02732$ & $2.021$   & $0.01001$ & $0.01015$ & $0.02322$ & $0.07358$ & $7.587$   & $2.726$    \
$0.2654$  & $0.03313$ & $4.774$   & $48.57$   & $1.886$   & $6.904$   & $0.01097$ & $3.993$    \
$0.2687$  & $0.1$     & $0.1848$  & $5.627$   & $0.1$     & $0.187$   & $0.6628$  & $1.854$    \
$0.2899$  & $0.3853$  & $0.2802$  & $0.4432$  & $0.353$   & $0.2547$  & $0.2058$  & $0.4459$   \
$0.08977$ & $0.2525$  & $0.03518$ & $0.08095$ & $1.744$   & $0.0169$  & $0.09316$ & $0.2516$   \
$0.2518$  & $1.103$   & $1.484$   & $0.6334$  & $3.107$   & $6.618$   & $0.5109$  & $0.1847$   \
$0.112$   & $0.5891$  & $0.6062$  & $1.099$   & $2.985$   & $1.76$    & $0.2073$  & $0.9535$   \
$3.772$   & $0.2317$  & $13.31$   & $0.1221$  & $0.2228$  & $0.3602$  & $0.6104$  & $3.268$    \
$28.34$   & $0.1472$  & $1.198$   & $3.449$   & $0.1286$  & $0.5261$  & $0.1402$  & $2.619$    \
$2.543$   & $0.8543$  & $1.947$   & $0.9492$  & $0.1006$  & $1.171$   & $3.011$   & $3.302$    \
$0.6127$  & $0.996$   & $0.7966$  & $0.6529$  & $0.4437$  & $0.6407$  & $0.5032$  & $0.7201$   \
$0.6154$  & $0.5889$  & $0.472$   & $0.6059$  & $0.5981$  & $0.5305$  & $0.3759$  & $0.4505$   \
$0.4322$  & $0.3761$  & $0.4737$  & $0.5013$  & $0.5489$  & $0.5424$  & $0.4513$  & $0.5409$   \
$1.869$   & $2.3$     & $0.5026$  & $0.9276$  & $0.8059$  & $0.6966$  & $0.5001$  & $0.961$    \
$0.451$   & $0.0133$  & $0.1935$  & $0.05858$ & $2.764$   & $0.03575$ & $0.01039$ & $0.01$     \
$1.277$   & $0.6487$  & $0.6006$  & $0.6056$  & $0.6031$  & $0.7777$  & $0.7167$  & $0.6031$   \
$0.1$     & $5.437$   & $3.417$   & $5.527$   & $2.369$   & $2.336$   & $4.77$    & $0.5255$   \
$0.1886$  & $0.1225$  & $0.3288$  & $0.2881$  & $0.07189$ & $0.1356$  & $0.01001$ & $0.03257$  \
$0.01001$ & $0.01001$ & $0.01$    & $0.01087$ & $0.2276$  & $0.01072$ & $3.854$   & $0.2368$   \
$0.7611$  & $0.6771$  & $0.6066$  & $0.7547$  & $1.042$   & $1.191$   & $0.5066$  & $0.8838$   \
$2.57$    & $1.988$   & $2.987$   & $2.085$   & $1.146$   & $2.72$    & $1.726$   & $1.597$    \
$0.6654$  & $0.376$   & $0.6748$  & $0.2103$  & $0.3006$  & $0.6107$  & $0.2658$  & $0.2214$   \
$0.5015$  & $4.916$   & $0.5044$  & $3.482$   & $0.5081$  & $0.5002$  & $0.6408$  & $0.5017$   \
$0.1791$  & $0.09303$ & $0.1774$  & $0.2039$  & $0.241$   & $0.2177$  & $0.2261$  & $0.1897$   \
$0.5383$  & $0.5828$  & $0.4082$  & $0.6494$  & $2.579$   & $2.917$   & $1.366$   & $0.2781$   \
$0.07499$ & $0.04744$ & $0.108$   & $0.1645$  & $0.1993$  & $0.1999$  & $0.07084$ & $0.1023$   \
$4.505$   & $2.426$   & $1.549$   & $2.13$    & $2.219$   & $1.41$    & $1.211$   & $1.192$    \
$0.3007$  & $0.3012$  & $0.3003$  & $0.3006$  & $0.3002$  & $2.409$   & $0.3835$  & $0.4269$   \
$0.08544$ & $0.1764$  & $0.09547$ & $0.1197$  & $0.0651$  & $0.03943$ & $0.08041$ & $0.07392$  \
$1.5$     & $2.848$   & $4.21$    & $1.874$   & $2.577$   & $5.882$   & $1.152$   & $7.667$    \
$0.6526$  & $0.4176$  & $0.2553$  & $0.4625$  & $0.08625$ & $0.3877$  & $0.1015$  & $0.0686$   \
$1.032$   & $1.57$    & $0.7937$  & $0.8424$  & $1.04$    & $0.3001$  & $0.7549$  & $0.6028$   \
$0.0382$  & $0.02757$ & $0.02349$ & $0.4466$  & $7.57$    & $8.143$   & $9.986$   & $1.737$    \
$0.01001$ & $0.01$    & $0.01$    & $0.05984$ & $0.168$   & $0.01032$ & $0.01$    & $0.03227$  \
$4.949$   & $5.491$   & $3.84$    & $5.204$   & $7.242$   & $1.795$   & $9.875$   & $3.856$    \
$9.998$   & $5.681$   & $6.275$   & $8.609$   & $6.993$   & $3.588$   & $9.996$   & $5.083$    \
$0.1561$  & $0.1115$  & $0.2087$  & $0.8513$  & $0.2252$  & $0.1086$  & $0.1061$  & $0.1566$   \
$0.9413$  & $0.9188$  & $1.184$   & $6.928$   & $6.751$   & $1.56$    & $0.7253$  & $5.421$    \
$0.506$   & $0.5711$  & $0.5108$  & $0.5072$  & $0.502$   & $9.773$   & $0.5003$  & $0.5017$   \
$0.01001$ & $0.9391$  & $0.03945$ & $0.01014$ & $0.6989$  & $2.776$   & $0.03128$ & $0.01007$  \
$1.774$   & $7.975$   & $0.07585$ & $25.38$   & $9.964$   & $44.21$   & $0.2389$  & $0.1916$   \
$0.2001$  & $0.216$   & $0.2012$  & $0.2854$  & $0.2021$  & $1.619$   & $0.202$   & $0.447$    \
$0.9229$  & $0.3759$  & $0.2279$  & $0.456$   & $0.1023$  & $0.09626$ & $0.3508$  & $0.3184$   \
$1.139$   & $0.5214$  & $0.03266$ & $0.05359$ & $0.07754$ & $0.06792$ & $0.02179$ & $0.001505$ \
$0.6769$  & $0.3577$  & $0.4285$  & $1.443$   & $4.363$   & $0.3769$  & $0.4726$  & $0.4493$   \
$0.8039$  & $0.7944$  & $9.998$   & $1.633$   & $5.051$   & $0.8805$  & $6.154$   & $8.512$    \
$5.273$   & $0.7541$  & $0.9665$  & $0.8438$  & $0.7331$  & $0.5034$  & $0.7004$  & $2.599$    \
$0.2466$  & $0.1293$  & $0.1668$  & $0.1838$  & $0.2269$  & $0.1458$  & $0.2496$  & $0.2389$   \
$1.912$   & $1.78$    & $0.6623$  & $0.684$   & $3.208$   & $0.4549$  & $1.356$   & $1.939$    \
$0.1211$  & $0.4024$  & $0.1647$  & $0.2261$  & $0.1254$  & $0.3022$  & $0.1949$  & $0.1181$   \
$1.011$   & $1.461$   & $3.951$   & $14.66$   & $5.237$   & $29.92$   & $11.17$   & $29.93$    \
$1.003$   & $1.111$   & $1.004$   & $1.213$   & $4.415$   & $4.268$   & $4.768$   & $1.017$    \
$1.061$   & $2.13$    & $1.187$   & $1.622$   & $8.092$   & $1.104$   & $1.66$    & $3.725$    \
$10.18$   & $25.2$    & $5.827$   & $23.91$   & $3.122$   & $19.15$   & $3.93$    & $5.9$      \
$0.2607$  & $0.1217$  & $0.5518$  & $0.3$     & $0.9744$  & $1.543$   & $1.358$   & $0.5445$   \
$0.4659$  & $0.2873$  & $0.312$   & $1.13$    & $1.225$   & $1.666$   & $9.682$   & $2.453$    \
caption{textbf{Foo bar}
}
end{longtable}
end{document}

The TOC that I include

% Table of Contents
manualmark
markboth{spacedlowsmallcaps{contentsname}{spacedlowsmallcaps{contentsname}}
tableofcontents

With the classicthesis.sty:

% ********************************************************************
% classicthesis.sty
%
% Copyright (C) 2008 André Miede http://www.miede.de
%
% If you like the style then I would appreciate a postcard. My address
% can be found in the file ClassicThesis.pdf. A collection of the
% postcards I received so far is available online at
% http://postcards.miede.de
%
% ********************************************************************
NeedsTeXFormat{LaTeX2e}
ProvidesPackage{classicthesis}[2008/10/01 v2.5 Typographic Style for a classic-looking thesis]
RequirePackage{ifthen}
    newboolean{@listsseparated} % toggles the vertical space between lof/lot entries of different chapters
    newboolean{@nochapters} % disable all chapter-specific commands
    newboolean{@parts} % use part division for the text
    newboolean{@minionpro} % setup for minion pro font
    newboolean{@minionprospacing} % use minion pro's textssc for letter spacing
    newboolean{@pdfspacing} % use pdftex for letterspacing (via microtype)

RequirePackage{mparhack} % get marginpar right
RequirePackage[smaller]{acronym} % nice macros for handling all acronyms in the thesis

% ********************************************************************
% Options
% ********************************************************************
DeclareOption{listsseparated}{setboolean{@listsseparated}{true}}
DeclareOption{parts}{setboolean{@parts}{true}}
DeclareOption{minionpro}{setboolean{@minionpro}{true}}
DeclareOption{minionprospacing}{setboolean{@minionprospacing}{true}}
ProcessOptionsrelax

% ********************************************************************
% Fancy Stuff
% ********************************************************************
RequirePackage{booktabs} % for better rules in tables
RequirePackage{textcase} % for MakeTextUppercase

ifthenelse{boolean{@minionprospacing}}%
    {%
        PackageInfo{classicthesis}{Using MinionPro's textssc for character spacing.}%
        DeclareRobustCommand{spacedallcaps}[1]{textssc{MakeTextUppercase{#1}}}%
        DeclareRobustCommand{spacedlowsmallcaps}[1]{textssc{MakeTextLowercase{#1}}}%
    }{%
        ifthenelse{boolean{@pdfspacing}}%
        {%
            PackageInfo{classicthesis}{Using pdftex/microtype for character spacing.%
                                        Make sure your pdftex is version 1.40 or higher.}%
            microtypesetup{expansion=false}%
            DeclareRobustCommand{spacedallcaps}[1]{textls[160]{MakeTextUppercase{#1}}}%
            DeclareRobustCommand{spacedlowsmallcaps}[1]{textls[80]{scshapeMakeTextLowercase{#1}}}%
            DeclareRobustCommand{spaced}[1]{textls[120]{#1}}%
        }{%
            RequirePackage{soul} % for letterspacing
                sodefallcapsspacing{upshape}{0.15em}{0.65em}{0.6em}%
                sodeflowsmallcapsspacing{scshape}{0.075em}{0.5em}{0.6em}%
                sodefspacedspacing{}{0.075em}{0.5em}{0.6em}%
                DeclareRobustCommand{spacedallcaps}[1]{MakeTextUppercase{allcapsspacing{#1}}}%
                DeclareRobustCommand{spacedlowsmallcaps}[1]{MakeTextLowercase{textsc{lowsmallcapsspacing{#1}}}}%
                DeclareRobustCommand{spaced}[1]{spacedspacing{#1}}%
        }%
    }

% ********************************************************************
% headlines
% ********************************************************************
RequirePackage[automark]{scrpage2} % provides headers and footers (KOMA Script)
    clearscrheadings
    setheadsepline{0pt}
    ifthenelse{boolean{@nochapters}}%
        {relax}%
        {
          renewcommand{chaptermark}[1]{%
            ifthenelse{value{paper}>0}%
            {markleft{textit{Paper Roman{paper}}}}%: #1}}}
            {markleft{textit{#1}}}
          }%
        }
        %renewcommand{sectionmark}[1]{markright{spacedlowsmallcaps{#1}}}
        renewcommand{sectionmark}[1]{markright{textit{#1}}}
        lehead{mbox{llap{thepagekern2em}}leftmarkhfil}
        %lehead{thepage}
        %cehead{leftmark}
        rohead{mbox{hfil{rightmark}rlap{kern2emthepage}}}
        %rohead{thepage}
        %cohead{rightmark}
        renewcommand{headfont}{rmsmall}
        %DeclareRobustCommand{fixBothHeadlines}[1]{} % <--- ToDo
        % hack to get the content headlines right (thanks, Lorenzo!)
        deftoc@heading{%
          ifthenelse{boolean{@nochapters}}%
                     {section*{contentsname}}%nochapters
                     {chapter*{contentsname}}%chapters
                     @mkboth{textit{contentsname}}{textit{contentsname}}}

And Makefile:

all: test.tex contents.tex classicthesis.sty
    latexmk -pdf -pdflatex="pdflatex -interactive=nonstopmode -file-line-error" $<

clean:
    latexmk -c

.PHONY: all clean test

Help me Obi-Wan Kenobi, your my only hope!

PS. From my .log file I appear to have:

  • longtable 2004/02/01 v4.11
  • scrreprt 2012/07/29 v3.11b KOMA
    (and an older now cut down version of classicthesis.sty)

Package scrextend warning when changing the font size


I am using the command

usepackage[fontsize=8pt]{scrextend}

to change the font size and I am constantly get the warning

“Package scrextend Warning: Using fallback calculation to setup font sizes for basic size `8pt’…”

If I remove the fontsize option then the warning disappears.

What is that supposed to mean and how do I fix it?

MWE

documentclass{article}

usepackage[fontsize=8pt]{scrextend}

begin{document}

Text

end{document}

TeX Distribution

This is XeTeX, Version 3.14159265-2.6-0.99991 (TeX Live 2014) (preloaded format=xelatex 2014.10.28)

File List

article.cls    2014/09/29 v1.4h Standard LaTeX document class

size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)

scrextend.sty    2015/02/07 v3.16 KOMA-Script package (extend other classes with features of KOMA-Script classes)

scrkbase.sty    2015/02/07 v3.16 KOMA-Script package (KOMA-Script-dependent basics and keyval usage)

scrbase.sty    2015/02/07 v3.16 KOMA-Script package (KOMA-Script-independent basics and keyval usage)

keyval.sty    2014/10/28 v1.15 key=value parser (DPC)

scrlfile.sty    2015/02/07 v3.16 KOMA-Script package (loading files)

How to get the subsection and subsubsection automatically in the header using scrheadings?


How to get the subsection and subsubsection automatically in the header using scrheadings?

Complete Mwe:

documentclass[
paper=128mm:96mm,
fontsize=12pt,
pagesize,
parskip=half-,
]{scrartcl}
usepackage[ % Page margins settings
includeheadfoot,
top=3.5mm,
bottom=3.5mm,
left=5.5mm,
right=5.5mm,
headsep=6.5mm,
footskip=8.5mm
]{geometry}


usepackage[automark]{scrpage2} 
pagestyle{scrheadings} 
clearscrheadfoot
usepackage{tikz,lipsum}
usepackage{xcolor} 

definecolor{mygreen}{RGB}{44,85,17}

ihead{rightmark}
begin{document}
section{This should appear in the header untill it reaches a subsection}
lipsum[1]
clearpage
subsection{Once the subsectin is reached this only should appear in the header}
lipsum[3]
end{document}

In the place of ‘rightmark’, I want some comments which gives subsections in the header.

What I want?

In the header whatever the section or subsection or subsubsection appears that only should appear in the header not the section or chapter name which I introduce long back.

Small caps/small letters for TOC page numbering


I use both Arabic (1, 2, …) and Roman page numbering (I, II, …) in my document. However the normal Roman figures look too dominant in the table of contents (e.g. XXVIII). The lower-case Roman numbers don’t look good to me either (xxviii).

I would like to achieve the following:

  • The Roman page numbering at the bottom of each page should be of standard-size capital letters.
  • The Arabic page numbering at the bottom of each page should be of standard-sized numbers.
  • The Roman page numbering in the table of contents should be of either standard-size small caps or of smaller capital letters. (They should not run as wide as regularly)
  • The Arabic page numbering in the table of contents should be of standard-sized numbers.

The following is a MWE which shows what I have now.

documentclass{scrartcl}
begin{document}
    pagenumbering{Roman}
    setcounter{page}{27}
    tableofcontents
    newpage
    section{Section}
    newpage
    pagenumbering{arabic}
    section{Section}
end{document}

As you see, I use KOMA-Script. I’m open to using features from tocstyle, since I already use this package (see KOMA-Script: Wrong alignment of roman numbers).


NB: This question at first asked by mistake for a solution using tocloft. This is why there are some answers using that.

Signatures side by side


It’s been a while since I last used Latex, so please bear with me.
As the title reads, I’d like to have two signature side by side (50% each) at the bottom of a medical report. This is what I currently have (apparently with slightly changed author names):

flushleft
newlengthjm
settowidth{jm}{Luke Skywalker}
begin{tabular}{p{jm}}hline
centeringfootnotesize (Luke Skywalker)
end{tabular}

vspace{10 mm}

The force is strong in my family
vspace{5 mm}

flushleft
newlengthmb
settowidth{mb}{Darth Vader}
begin{tabular}{p{mb}}hline
centeringfootnotesize (Darth Vader)
end{tabular}

And it looks like this in scrartcl:
enter image description here

How can Luke stand right next to his father (Luke left, both with underlines) ?

Customizing chapter and section style (scrbook)


I have found a very cool custom style for chapter and section headings (It is from Customizing Chapter style in scrbook):

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}

newcommandChapterFont{usefont{T1}{qhv}{b}{n}selectfonthuge}
newcommandSectionFont{usefont{T1}{qhv}{b}{n}selectfont}

titleformat{chapter}[display]
  {normalfontChapterFonthugecolor{myblueii}}
  {}
  {0pt}
  {parbox[b]{70pt}{mbox{}}%
    parbox[b]{50pt}{colorbox{mybluei}{%
      parbox[b][60pt][t]{45pt}{centering%
        color{white}%
        {itshapermfamilysmallchaptertitlename}%
        vfill{fontsize{50}{120}selectfontthechapter}%
        }%
      }%
    }hspace{15pt}%
    parbox[b]{dimexprtextwidth-150pt}{%
      raggedrightscshape#1vskip6pt%
    }%
  }

titleformat{name=chapter,numberless}[display]
  {normalfontChapterFonthugecolor{myblueii}}
  {}
  {0pt}
  {parbox[b]{70pt}{mbox{}}%
    hspace{15pt}%
    parbox[b]{dimexprtextwidth-150pt}{%
      raggedrightscshape#1vskip6pt%
    }%
  }

titleformat{section}
  {normalfontsmallsffamilySectionFontcolor{myblueii}}
  {colorbox{mybluei}{%
    parbox[c][16pt][c]{40pt}{%
      centeringtextcolor{white}{SectionFontLargermfamilythesection}%
      }%
    }%
  }
  {1em}
  {#1}
  [vspace{-1.2baselineskip}%
    color{myblueii}hspace*{dimexpr40pt+2fboxseprelax}%
    rule{dimexprtextwidth-40pt-2fboxseprelax}{1pt}%
  ]

begin{document}

chapter{Preliminaries}
section{Test section}

end{document}

I have two problems with it.

First, I want the chapter heading a bit bigger and the name of the section heading should also be bigger. How can this be done?

Second, I want the chapter heading to be not indented, i.e it should be left centered.

Edit: I have now tried out the approach by esdd for not breaking the KOMA-class and I have now several problems:

  1. In the list of contents the chapter titles are in blue but the section titles are in black. Is it possible to have also the chapter titles in black?

  2. Is it possible to make the line a bit lower as in the example of Benjaming? For me this lower line looks better. Please see the image below.

  3. Benjamin also made subsubsection title without a numbering (because otherwise it is too much styling). Please also see the image below. Is this also possible?

enter image description here

Edit 2: Now everything is almost perfect except the line below the title. In your example it looks great but if I use it in my document the line appears lower. I tried different things but I can’t find the solution. Do you see where the problem is? I also don’t know if my template is perfect or if there are other mistakes. Please see below the example.

main.tex

documentclass[a4paper,twoside,12pt,chapterprefix=false]{scrbook}

usepackage{amsmath,amssymb,amsthm}
usepackage[footnotesize,sl,SL,hang,tight]{subfigure}
usepackage{longtable}
usepackage[font={small,sl},hang,labelfont=bf]{caption}
usepackage{booktabs}

ifpdfoutput{%
    usepackage[pdftex]{graphicx}
    usepackage[]{pdfpages}
}{%
    usepackage{graphicx}
}
usepackage{rotating}

usepackage{scrlayer-scrpage}
KOMAoptions{headinclude}

% **** Defining chapter style start ****

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}selectfontcolor{myblueii}}

addtokomafont{chapter}{fontsize{30pt}{30pt}selectfont}
newkomafont{chapternumber}{fontsize{50}{120}selectfontcolor{white}}
newkomafont{chaptername}{itshapermfamilysmallcolor{white}}
addtokomafont{chapterentry}{normalcolor}% entrys in tableofcontents not blue

addtokomafont{section}{fontsize{14pt}{14pt}selectfont}
newkomafont{sectionnumber}{fontsize{18pt}{18pt}selectfontrmfamilycolor{white}}

addtokomafont{subsection}{fontsize{12pt}{12pt}selectfont}
newkomafont{subsectionnumber}{fontsize{16pt}{16pt}selectfontrmfamilycolor{white}}

setcounter{secnumdepth}{subsectionnumdepth}% subsubsection and lower unnumbered

renewcommandchapterformat{%
  raisebox{-6pt}{colorbox{mybluei}{%
      parbox[b][60pt]{45pt}{centering%
        {usekomafont{chaptername}{chaptername}}%
        vfill{usekomafont{chapternumber}{thechapterautodot}}%
        vspace{6pt}%
      }}}enskip}

renewcommandsectionformat{%
  setlengthfboxsep{5pt}%
  colorbox{mybluei}{%
      parbox{40pt}{centeringusekomafont{sectionnumber}{thesectionautodot}}}%
    quad%
  }

renewcommandsubsectionformat{%
  setlengthfboxsep{5pt}%
  colorbox{mybluei}{%
    parbox{60pt}{centeringusekomafont{subsectionnumber}{thesubsectionautodot}}}%
quad%
}

makeatletter
renewcommandsectionlinesformat[4]{%
  @hangfrom{hspace*{#2}#3}{#4}%
  ifstr{#1}{section}{%
    parnobreak%
    ifstr{#3}{}{%
      rule[dpstrutbox]{textwidth}{1pt}}{%
      hspace*{50pt}rule[dpstrutbox]{dimexprtextwidth-50pt}{1pt}}%
  }{}%
  ifstr{#1}{subsection}{%
    parnobreak%
    ifstr{#3}{}{%
      rule[dpstrutbox]{textwidth}{1pt}}{%
      hspace*{70pt}rule[dpstrutbox]{dimexprtextwidth-70pt}{1pt}}%
  }{}%
}
makeatother

% **** Defining chapter style end ****

% Define an own layer page style for the title page
DeclareNewLayer[
  background,
  head,
  addvoffset=headsep,
  height=1.5cm,
  addheight=dpstrutbox,
  contents={%
    includegraphics[height=1.5cm]{figures/ETH_logo.pdf}%
    hfill%
    includegraphics[height=1.4cm]{figures/CGL_logo.pdf}%
  }
  ]{titlepage.head}
DeclareNewPageStyleByLayers{titlepage}{titlepage.head}

usepackage{times}
usepackage{helvet}
usepackage[T1]{fontenc}

ifpdfoutput{%
    usepackage[pdftex,
        bookmarks,
        bookmarksopen=true,
        bookmarksnumbered=true,
        pdfauthor={Rafael Wampfler},
        pdftitle={Engagement Detector: Modelling engagement dynamics in virtual environments},
        pdfsubject={The report of the master thesis about the modelling engagement dynamics in virtual environments.},
        pdfkeywords={machine learning, engagement dynamics, classification, virtual environments, calcularis, learning, minecraft},
        colorlinks=false,
        linkcolor=black,
        citecolor=black,
        filecolor=black,
        urlcolor=black,
        anchorcolor=black,
        menucolor=black,
        breaklinks=true,
        pageanchor=true,
        plainpages=false,
        linkbordercolor=red,
        citebordercolor=red,
        urlbordercolor=red,
        pdfpagelabels=true]{hyperref}
}{}

ifpdfoutput{%
    pdfcompresslevel=9
    pdfoutput=1
    DeclareGraphicsExtensions{.pdf,.png}
}{}

bibliographystyle{alpha}

topmargin -0.5in
textheight 9.3in
textwidth 6.3in
oddsidemargin 0.18in
evensidemargin -0.22in
parskip 0.1in
parindent 0in

renewcommand{arraystretch}{1.5}
renewcommand{baselinestretch}{1}

begin{document}

%% Define leading chapter pages
%
input{studchapter}
newpagestyle{mychapterpagestyle}{{protectmychpstyleintl}{protectmychpstyleintl}}{}
newpagestyle{myappendixpagestyle}{{protectmychpstyleintl}{protectmychpstyleintl}}{}
%%

hypersetup{pageanchor=false}

hypersetup{pageanchor=true}
pagenumbering{roman}
setcounter{page}{1}

%include{abstract}

%include{acknowledgment}

tableofcontents
cleardoublepage

addcontentsline{toc}{chapter}{List of Figures}
listoffigures
cleardoublepage

addcontentsline{toc}{chapter}{List of Tables}
listoftables
cleardoublepage

pagenumbering{arabic}
renewcommand*{chapterpagestyle}{mychapterpagestyle}
renewcommand*{chapterformat}{} % show chapter titles only (no numbers)

% ---- MAIN PART ----

  chapter{Chapter Title}
  section{Section Title}
  blindtext
  addsec{Unnumbered Section Title}
  blindtext
  subsection{Subsection Title}
  blindtext
  subsubsection{Subsubsection Title}
  blindtext
  blinddocument

% ---- END MAIN PART ----

appendix
clearpage
renewcommand*{chapterpagestyle}{myappendixpagestyle}

%include{appendix}

clearpage
renewcommand*{chapterpagestyle}{empty}

addcontentsline{toc}{chapter}{Bibliography}
bibliography{references}

end{document}

studchapter.tex

renewcommand*{chapterheadstartvskip}{vspace*{215pt}}

defmychpstyleintl{%
{noindentsetlength{tabcolsep}{0pt}setlength{arrayrulewidth}{2pt}%
begin{tabular}{c}
\[100pt]
begin{tabular}{lr}
begin{tabular}{p{0.6linewidth}}
\
end{tabular}
&
begin{tabular}{p{0.4linewidth}}
rightline{{%
sffamily%
fontseries{bx}%
fontshape{n}%
fontsize{100}{120}%choose baselineskip to be 1.2 times font size
selectfont
thechapter}}
end{tabular}
end{tabular}\[300pt]
end{tabular}
}}

enter image description here

Vertical spacing in KOMA-script


How can I change vertical spacing (and indents) of paragraph, list and list item elements in KOMA-script article class? Is there some canonical way to do this?

i need

I’ve tried to use titlesec package, but it doesn’t change paragraph vertical space.

How to avoid a text body-addressee clash on scrlttr2 letter when multiple addressees are listed?


In trying to use the scrlttr2 package, with a letter address to lots of multiple parties, there is clash/crash between the body of the letter, and those to whom the letter is addressed. In other words the body of the letter, including the subject is printed on top of the last two of the four addresses.

This ends up looking very ugly: Example.pdf

How do I fix this so that I can still use the scrlttr2 letter class to compose my letter?

Help with this would be mucho appreciated.

documentclass[ 
fontsize=11pt, paper=a4, parskip=half, enlargefirstpage=on, % More space                        on first page 
fromalign=right, % PLacement of name in letter head 
fromphone=on, % Turn on phone number of sender 
fromrule=aftername, % Rule after sender name in letter head 
addrfield=on, % Address field for envelope with window 
backaddress=off, % Sender address in this window 
subject=beforeopening, % Placement of subject 
locfield=narrow, % Additional field for sender 
foldmarks=off, % Print foldmarks
]{scrlttr2} 
usepackage[T1]{fontenc} 
usepackage[utf8]{inputenc} 
usepackage[english]{babel}
usepackage{bookman} 
usepackage{lipsum} 
setkomafont{fromname}{sffamily } 
setkomafont{fromaddress}{sffamily}%% statt small 
setkomafont{pagenumber}{sffamily} 
setkomafont{subject}{bfseries} 
setkomafont{backaddress}{mdseries} 
LoadLetterOption{DIN} 
setkomavar{fromname}{LAW OFFICE OF CHEET M. LIKELY} 
setkomavar{fromaddress}{10723 Brooke Avenue, Suite 245\Forest Hills, New York  11375} 
setkomavar{fromphone}{555.878.6202} 
setkomavar{fromemail}{from.name@mail.com}         setkomavar{backaddressseparator}             {enspacetextperiodcenteredenspace} 
setkomavar{signature}{Bill U. Lotts,     Esq.} 
setkomavar{place}{} 
setkomavar{date}{today} 
setkomavar{enclseparator}{: } 

begin{letter}{HIGHSTUFF BRYNYARD, ESQ.
BYRNYARD LAW OFFICES, PLLC.
4 WEST GATE\
FURMANVILLE, NY 11735 vskip.2in JOSEPH M. DSGRIBLE, ESQ.\
DSGRIBLE DSGRIBLE & DSGRIBLE\
555 STUFFIT AVE \
HARDHEART CITY, NY 11530\
(555) 222-2800 vskip.2in  JOSEPH F. PYZKOFF, ESQ.\
PYZKOFF, PYZKOFF & PYZKOFF\
500 BYLE COUNTY BLVD. \
MOSTRUBLE, NY 11735\
(555) 249-6600 vskip.2in  JAMES A. POOKA, JR.\
3320 103RD STREET\
NUTSO, NY 11361\
(555) 418-3392}
setkomavar{subject}{Re:} 
opening{Dear Sir or Madam:} 
lipsum[2] 
closing{Very truly yours,} 
encl{Papers}
end{letter} 
end{document}

scrlayer-scrpage pagestyle on interleaf pages


I want to change the pagestyle of the interleaf pages. My current example:

documentclass{scrbook}
usepackage[headsepline=1pt]{scrlayer-scrpage}
ohead{pagemark} 
ihead{headmark} 
chead{} 
ofoot{}ifoot{}cfoot{}
usepackage{blindtext}

begin{document}
    Blinddocument
    clearpage
    blindtext
    cleardoublepage
    Blinddocument
end{document}

Page 18 is an interleaf page and its pagestyle is empty. I’d like to change the pagestyle to scrheadings so that I have the same header like on the other pages. I’m pretty sure that I saw an option some time ago but now I can’t find anything in the documentation.

Question and Answer is proudly powered by WordPress.
Theme "The Fundamentals of Graphic Design" by Arjuna
Icons by FamFamFam