How to force KOMA-Script use headers/footers as standard classes?


It is known that KOMA-Script has more flexibility than standard classes. One example is the ability to use any font size (e.g., 11.5pt). One problem appears though, which is headers and footers placing. In the standard classes, page numbers, e.g., in the bottom are placed wisely but in KOMA it is too close to the paper edge.

The question is how to force KOMA use the same distance for footers, headers, rules and margins as standard classes. Here is a MWE:

documentclass[12pt,a4paper]{article}
usepackage[margin=2cm]{geometry}
begin{document}
A test document
end{document}

which outputs the footer correctly:

enter image description here

Whereas using KOMA-Script:

documentclass[12pt,a4paper]{scrartcl}
usepackage[margin=2cm]{geometry}
begin{document}
A test document
end{document}

outputs this (undesired) behavior:

enter image description here

Any idea? Thank you.

EDIT:

The strange behavior in headers also can be shown by this example:

documentclass[12pt,a4paper,headsepline,twoside=false]{scrbook}
usepackage[left=3.50cm, right=2.50cm, top=2.5cm, bottom=2.5cm]{geometry}
usepackage{pagegrid}
begin{document}

mainmatter
chapter{Test Chapter}
noindent 
Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines.

newpage     
noindent 
Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. 

end{document}

Problems in the header are shown in the following image:

enter image description here

fromphone, fromemail and fromurl


I am using koma-script scrlttr2 to write a letter.

documentclass[12pt,foldmarks=true,foldmarks=blmtP,
fromalign=right,fromrule=aftername,
fromphone,fromemail,fromurl,subject=centered, parskip=full, 
version=last]{scrlttr2}

On the fromalign, I have fromphone, fromemail, and fromurl. In front of the fromurl value, text ‘url’ is printed. So, I have two questions:

  1. How can I replace ‘url’ text in front of fromurl value with ‘Website’?
  2. frommobilephone is giving me error message, is frommobilephone
    not valid?

scrlttr2 – how to add the fromrule into custom-made firsthead?


Starting point should be this simple minimum example with the fromrule below the senders name and the senders personal data aligned to the right hand side:

documentclass{scrlttr2}

KOMAoptions { fromalign=right,
               fromrule=aftername }

usepackage[english, ngerman]{babel}

begin{document}

    setkomavar{fromname}    {John Doe (sender)}
    setkomavar{fromaddress} {25th Doe's Avenue \ 54321 Springfield}

begin{letter}  { Maria Lae\
                  2th Coast Road\
                  12345 Milltown }

        opening{Dear Maria,}

            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
            nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
            erat, sed diam voluptua.

        closing{Sincerely yours}

end{letter}

end{document}

Unfortunately, both the fromrule and the set alignment disappear by use of a custom-made firsthead despite of performed activation by setting fromrule=aftername and fromalign=right in the preamble.

The only way to preserve fromrule and alignment is to remove the custom-made firsthead out of the source code.

How can I add the fromrule into a custom firsthead, for example inside this self made exemplary firsthead-code like the following:

setkomavar{firsthead} {%
             {usekomafont{fromname}strutignorespacesusekomavar{fromname}} \
             {usekomafont{fromaddress}strutignorespacesusekomavar{fromaddress}}
            }

Of course, I also could easily add an ordinary line by inserting…

rule{textwidth}{.5pt}

… at the final desired position (below the senders name) …

setkomavar{firsthead} {%
             {usekomafont{fromname}strutignorespacesusekomavar{fromname}} \
             rule{textwidth}{.5pt}
             {usekomafont{fromaddress}strutignorespacesusekomavar{fromaddress}}
            }

… , but ordinary lines use completely different spaces and distances to the text than the fromrule. That’s the reason why I want to continue to to use the fromrule instead of an ordinary one…

Do you have any ideas? Thank you very much for your help!

Latex Error: Something's wrong–perhaps a missing item for labeling environment


begin{labeling}
                    item[ Frequency range: SI{200}{megahertz} to SI{1000}  {megahertz} in steps of SI{1}{megahertz}]
                  item[ Stirrer positions: 36 ]
                  item[ Cable length: SI{1}{metre}]
                  item[ Termination resistors: SI{50}{ohm} at the beginning and end]             
end{labeling}

What is wrong in my code? How to use the labeling environment?

How to avoid upper-case letters in the header?


I’ve used two indexes:

documentclass[a4paper,fontsize=11pt,headsepline,parskip=half-,index=totoc,BCOR=5mm,DIV=15]{scrreprt}
usepackage{imakeidx}
makeindex[name=stichwortA,title=Stichwort-VerzeichnisA,options=-s ./main]
makeindex[name=stichwortB,title=Stichwort-VerzeichnisB,columns=4,options=-s ./main]
begin{document}
printindex[stichwortA]

Unfortunately in the heading it’s written STICHWORT-VERZEICHNISA with upper-case letters.

Can I change the definition in the preamble to get normal case letters as Stichwort-VerzeichnisA?

Why do I get a warning about computer modern even though I'm using lmodern?


I would like to use KOMA script with a fontsize of 13pt (see very much related question here: Koma Script and real 13pt). Consider the following document:

documentclass[fontsize=13pt,DIV=12]{scrartcl}

usepackage{lmodern}
usepackage[T1]{fontenc}

begin{document}
test
end{document}

I get the following warnings:

Class scrartcl Warning: Using fallback calculation to setup font sizes
(scrartcl)              for basic size `13pt' on input line 1564.

LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <13> not available
(Font)              size <12> substituted on input line 1564.

LaTeX Font Warning: Font shape `T1/cmr/m/n' in size <13> not available
(Font)              size <12> substituted on input line 100.

While I absolutely understand the first warning (I’m okay with calculated font sizes) I don’t see why LaTeX is complaining about missing font shapes in the computer modern font (I understand cmr stands for computer modern roman?).

I can get rid of the font shape warnings by using RequirePackage{fix-cm} before the documentclass, but that seems strange to me (I want to use lmodern, not computer modern).

I guess that it is save to ignore the warnings (the PDF does not include cm), but I would still like to understand what’s going on. I tried to defer the change in fontsize until after lmodern has been loaded, but it did not help.

[ Related question in german with an answer by Markus Kohm, suggesting to use lmodern: http://www.komascript.de/node/1137 ]

Scrbook headings style


I am trying to simplify the heading styles of the scrbook-class for use in my thesis, but am unable to find a way to stop the headings from being underlined and chapters being marked by their numbers. Here is the class-specification I am using:

documentclass[
12pt,
a4paper,
oneside,
headinclude,
footinclude,
headnosepline,
BCOR5mm,
]{scrbook}

Below is an example of the current output. What I essentially want to achieve is get rid of the line underneath the chapter title, and the number to the right.

Scrbook Example

Any thoughts on doing this would be greatly appreciated.

Added MWE:

main.tex

documentclass[
12pt,
a4paper,
oneside,
headinclude,
footinclude,
headnosepline,
BCOR5mm,
]{scrbook}
input{structure.tex}
hyphenation{Fortran hy-phen-ation}

begin{document}

makeatletter
begin{titlepage}
pagenumbering{gobble}
thispagestyle{empty}
title{Title}
author{Author}
date{Spring theyear}
end{titlepage}
makeatother

newpagepagestyle{scrheadings}pagenumbering{Roman}
chapter*{Contents}singlespacing
tableofcontents
onehalfspacing
pagestyle{plain}
newpagechapter{Introduction} label{part:Introduction}
end{document}

structure.tex

usepackage[parts,beramono,eulermath,pdfspacing,dottedtoc]{classicthesis}
usepackage[english]{babel}
usepackage[round, longnamesfirst]{natbib}
setcitestyle{aysep={}}
bibliographystyle{plainnat}
setcitestyle{notesep={: }}

setlength{parindent}{0em}
setlength{parskip}{1em}
renewcommand{baselinestretch}{1.3}
usepackage{titlesec}
titlespacingsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
titlespacingsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
titlespacingsubsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
titlespacing*{paragraph} {0pt}{3.25ex plus 1ex minus .2ex}{1em}
titlespacing*{subparagraph} {parindent}{3.25ex plus 1ex minus .2ex}{1em}

usepackage{geometry}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{tikz}
usetikzlibrary{arrows}
usepackage{grffile}
usepackage{pgfplots}
usepackage{gnuplottex}%[miktex]%[shell]
usepackage{pgfplotstable}
pgfplotstableset{col sep = comma}
pgfplotsset{width=textwidth,compat=1.9}
usetikzlibrary{pgfplots.groupplots}
usepackage{filecontents}
graphicspath{{Figures/}}
usepackage{enumitem}
usepackage{subfig}
usepackage{amsmath,amssymb,amsthm}
makeatletter
defthmhead@plain#1#2#3{%
  thmname{#1}thmnumber{@ifnotempty{#1}{ }@upn{#2}}%
  thmnote{: {thethm@notefont#3}}}
letthmheadthmhead@plain
makeatother
usepackage{varioref}
usepackage{times}
usepackage{chngpage}
usepackage{tabulary}
usepackage{rotating}
usepackage{tabularx}
usepackage{placeins}
usepackage{float}
usepackage{floatpag}
usepackage{booktabs}
usepackage{multirow}
usepackage{caption}
usepackage{setspace}
usepackage[flushleft]{threeparttable}
usepackage[normalem]{ulem}
newcommand{msout}[1]{text{sout{ensuremath{#1}}}}
usepackage{chronology}
usepackage{easy-todo}
input{PgfplotNan.tex}
usepackage{titletoc}
makeatletter
renewcommandtableofcontents{%
    @starttoc{toc}%
}
makeatother
usepackage{setspace}
setcounter{secnumdepth}{2}
setcounter{tocdepth}{2}

usepackage{amsfonts}
usepackage{datagloss}
selectcolormodel{gray}

newenvironment{blockquote}{%
  par%
  em
  medskip
  leftskip=4emrightskip=2em%
  noindentignorespaces}{%
  parmedskip}

makeatletter
pgfplotsset{
    every axis x label/.append style={
        alias=current axis xlabel
    },
    legend pos/outer south/.style={
        /pgfplots/legend style={
            at={%
                (%
                @ifundefined{pgf@sh@ns@current axis xlabel}%
                {xticklabel cs:0.5}%
                {current axis xlabel.south}%
                )%
            },
            anchor=north
        }
    }
}
makeatother

newlengthfigureheight
newlengthfigurewidth

pgfplotscreateplotcyclelist{black-white-mark}{%
    solid, every mark/.append style={solid, fill=gray}, mark=*\%
    dotted, every mark/.append style={solid, fill=gray}, mark=square*\%
    densely dotted, every mark/.append style={solid, fill=gray}, mark=otimes*\%
    loosely dotted, every mark/.append style={solid, fill=gray}, mark=triangle*\%
    dashed, every mark/.append style={solid, fill=gray},mark=diamond*\%
    loosely dashed, every mark/.append style={solid, fill=gray},mark=*\%
    densely dashed, every mark/.append style={solid, fill=gray},mark=square*\%
    dashdotted, every mark/.append style={solid, fill=gray},mark=otimes*\%
    dasdotdotted, every mark/.append style={solid},mark=star\%
    densely dashdotted,every mark/.append style={solid, fill=gray},mark=diamond*\%
}
pgfplotscreateplotcyclelist{black-white-nomark}{%
    solid\%
    dotted\%
    densely dotted\%
    loosely dotted\%
    dashed\%
    loosely dashed\%
    densely dashed\%
    dashdotted\%
    dasdotdotted\%
    densely dashdotted\%
}
newcommand{chartstyle}{
    /pgf/number format/.cd,
    use comma,
    1000 sep={},
    ymajorgrids=true,
    grid style=dashed,
    % legend style={at={(0,0)}, anchor=north east, align=left}, % Lower left corner
    legend pos=outer south, % Below
    % legend pos=north east, % Top right corner
    cycle list name=black-white-nomark,
}
newcommand{nochartstyle}{
    /pgf/number format/.cd,
    use comma,
    1000 sep={},
    ymajorgrids=false,
    grid style=dashed,
    % legend style={at={(0,0)}, anchor=north east, align=left}, % Lower left corner
    legend pos=outer south, % Below
    % legend pos=north east, % Top right corner
    cycle list name=black-white-nomark,
    xlabel={},
    xticklabels={,,}
    ylabel={},
    yticklabels={,,},
    axis y line*=left,
    scaled y ticks = false
}

theoremstyle{definition}
newtheorem{definition}{Definition}

theoremstyle{plain}
newtheorem{theorem}{Theorem}

theoremstyle{remark}
newtheorem*{remark}{Remark}

theoremstyle{plain}
newtheorem{hyp}{Hypothesis} 
newtheorem{subhyp}{Hypothesis}[hyp]

hypersetup{
colorlinks=true, breaklinks=true, bookmarks=true,bookmarksnumbered,
urlcolor=black, linkcolor=black, citecolor=black,
pdftitle={},
pdfauthor={textcopyright},
pdfsubject={},
pdfkeywords={},
pdfcreator={pdfLaTeX},
pdfproducer={LaTeX with hyperref and ClassicThesis}
}

How to change the size of the right/main column in the koma-moderncvclassic?


I am using the koma-moderncvclassic package to re-create my CV. How can I manipulate the size of the right side column using so the column width matches the page layout respectively the width of the header? Here my MWS:

documentclass[%
parskip=half,%
fontsize=11pt,%
a4paper,%
pagesize,%
headinclude,footinclude,%
headings=normal,%
]{scrreprt}

newcommand*{firstname}{Max}
newcommand*{familyname}{Muster}
newcommand*{addressstreet}{Muster Allee 111}
newcommand*{addresscity}{11111 Musterstadt}
newcommand*{address}[2]{addressstreet{#1}addresscity{#2}}
newcommand*{mobile}{+49 1234567}
newcommand*{email}{mustermann@muster.de}

%left column width (default value: 2,79cm)
newlengthmyhintscolumnwidth%
setlengthmyhintscolumnwidth{.21textwidth}

usepackage[myblue]{koma-moderncvclassic} 

usepackage{geometry}
geometry{left=2cm,right=2cm,top=2cm,bottom=2cm} 

usepackage{scrpage2}
pagestyle{scrheadings}
clearscrheadfoot
ohead{footnotesize firstname~familyname\ addressstreet,~addresscity \emailsymbol~email~phonesymbol~mobile}
setheadsepline{0.3pt} 

begin{document}

section{Work experience}
cventry{01/2015 - 04/2015}{degree/jobtitle}{institution/employer}{localization}{optional: grade/...}{optional: comment/job description}
cventry{01/2015 - 04/2015}{degree/jobtitle}{institution/employer}{localization}{optional: grade/...}{optional: comment/job description}

section{Education}
cventry{01/2015 - 04/2015}{degree/jobtitle}{institution/employer}{localization}{optional: grade/...}{optional: comment/job description}
cventry{01/2015 - 04/2015}{degree/jobtitle}{institution/employer}{localization}{optional: grade/...}{optional: comment/job description}

section{IT Skills}
cvline{Very good}{MS Office (Excel, Word, PowerPoint, Outlook), OpenOffice. MS Office (Excel, Word, PowerPoint, Outlook), OpenOffice.}
cvline{Good}{MS SharePoint, MS Project, MS Office (Excel, Word, PowerPoint, Outlook) MS Office (Excel, Word, PowerPoint, Outlook)}

end{document}

Uppercase chapter with KOMA-script


It has already been mentioned that it could be tricky to get uppercase letters in chapter for scrbook. However, the solution in Using MakeUppercase in @startsection works for scrreprt.

The solution used in tudscr adds a custom command to make the text uppercase, but then chapter has to be redefined.

makeatletter
    newcommand*mymakeuppercase[1]{%
        ifdin{begingroupMakeTextUppercase{#1}endgroup}{#1}%
    }
makeatother

Any other alternative, that would be applicable to all koma scripts?

MWE:

documentclass[chapterprefix=on]{scrbook}

% Fix MakeUppercase
usepackage{makerobust}
makeatletter
MakeRobustCommand@hangfrom
newcommand*{ModMakeUppercase}{%
    MakeRobustCommand@svsec
    MakeUppercase
}
makeatother

addtokomafont{part}{MakeUppercase}
addtokomafont{chapter}{MakeUppercase} % <- doesn't work
addtokomafont{section}{ModMakeUppercase}
addtokomafont{subsection}{ModMakeUppercase}


begin{document}
tableofcontents
end{document}

Adjusting spacing around section/subsection titles with koma-script


With the KOMA-script scrreprt class the vertical spacing before and after chapter titles can be adjusted the following way:

renewcommand*{chapterheadstartvskip}{vspace*{0cm}}
renewcommand*{chapterheadendvskip}{vspace*{70.9pt}}

However, I can’t find a way to do the same with section, subsection (and, possibly, subsubsection) titles. I know there is the titlesec package with the command

titlespacing*{section}{0pt}{28.35pt}{0pt}

but using KOMA-Script with titlesec gives me the warning “Usage of package `titlesec’ together with a KOMA-Script class is not recommended”. Is there some other way to adjust the vertical spacing around section headings that is compatible with the KOMA-Script classes?

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