I would like to add a space before a section heading.
I have tried:
\hspace[*]{5pt}\setkomafont{section}{\fontsize{45}{40}\selectfont
\fontspec{Mathilde}}
unsuccessfully. I realise that Latex usually discards white space at the start of a line e.g. a section heading.
I would appreciate any pointers how I may achieve a space before a section heading of 0.5 inches.
\documentclass[11pt,english,british,twoside,openany]{scrbook}
\usepackage{mystyle}
\begin{document}
\title{\mytitle}
\author{}
\date{}
\frontmatter
\maketitle
\begin{titlepage}
\begin{flushright}
{\huge \mytitle}
\par\end{flushright}{\huge \par}
\end{titlepage}
\begin{titlepage}
\noindent\includegraphics[width=4in,height=2in]{../img/titr_ben_sig}
\vspace*{0.5in}
\begin{flushright}
\Huge{Tears in the Rain}
\par\end{flushright}{\Huge \par}
\clearpage
\thispagestyle{empty}
\begin{center}
\emph{Copyright}
\end{center}
\begin{center}
\textcopyright{ 2014 Ben Francis All rights reserved.}
\end{center}
\vspace*{0.5in}
\begin{center}
\begin{minipage}[t]{0.5\paperwidth}
\end{minipage}
\end{center}
\vspace*{0.5in}
\begin{center}
ISBN:
\end{center}
\vspace*{0.2in}
\begin{center}
A CIP Record for this book is available from the British
Library.
\end{center}
\vspace*{0.1in}
\begin{center}
Typeset in \LaTeXe
\end{center}
\end{titlepage}
\pagenumbering{gobble}% Remove page numbers (and reset to 1)
\tableofcontents
\input{matter.tex}
\end{document}[/MWE]
My style file is:
[MWE]
\ProvidesPackage{mystyle}
\usepackage{lettrine}
%\usepackage{blindtext}
\usepackage[automark,headsepline,footsepline=.25pt]{scrlayer-scrpage}
\usepackage{microtype}
\usepackage{ragged2e}
\usepackage{graphicx}
\graphicspath{ {../img/} }
\usepackage{wrapfig}
\usepackage[british]{babel}
\pagestyle{scrheadings}
\addtokomafont{pageheadfoot}{\slshape}
\addtokomafont{pagehead}{\normalsize}
\addtokomafont{pagefoot}{\normalsize}
\addtokomafont{disposition}{\rmfamily}% rm for chapter headings
%\addtokomafont{trajon pro}{\rmfamily}
%\ohead{\pagemark} %Page Number
%\ihead{\mytitle} %Book Title
\chead{\textbf {Ben Francis}}
\ofoot{} %Author Name
\ifoot{} % Chapter Number
\lehead{\textbf \pagemark}
%\cehead{Ben Francis}
\rohead{\textbf \pagemark}
\cohead{\textbf {\mytitle}}
\setkomafont{section}{\textit}{\normalsize}
\renewcommand\thepart{\Alph{part}}
\usepackage{fontspec}
\linespread{1.05}
\parindent=0.25in
\parskip=2pt
%removes overrun on outside margin
\usepackage{hyphenat}
\tolerance=1000
\hyphenpenalty=1000
\setmainfont{Linux Libertine O} %clear font, typographers quote marks
\renewcommand*{\partpagestyle}{empty}
\usepackage{geometry}
\geometry{paperwidth=5.06in,paperheight=7.81in,
verbose,
tmargin=0.75in,
bmargin=0.75in,
inner=0.75in,
outer=0.5in,
headheight=0.1in,
headsep=0.15in,
footskip=0.45in,
twoside}
\newcommand{\mytitle}{Tears in the Rain}
\newcommand{\emptx}[1]{\textit{#1}}
%Add space above chapter titles
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\normalsize}
\titlespacing*{\chapter}{0pt}{25pt}{1pt}%Second number changes space
%amount
\hspace[*]{5pt}\setkomafont{section}{\fontsize{45}{40}\selectfont
\fontspec{Mathilde}}
\setkomafont{subsection}{\small}
\setkomafont{subsubsection}{\small}
\setkomafont{paragraph}{\normalsize}
\setkomafont{subparagraph}{\normalsize}
\fontsize
. But what about\renewcommand*{\sectionformat}{\hspace*{0.5in}\thesection\autodot\enskip}
? (Note that I don't often use the KOMA classes, even though I always tell myself I should.) – jon Sep 23 '15 at 22:01\hspace[*]{5pt}
is not correct, and should not be used in the preamble. The command\fontsize
has the numbers in the wrong order. The code you have provided includes no\section
command that I can see. Most of the code you have provided is completely irrelvant to the problem of getting the\section
s properly spaced for your layout. "No luck - nothing changes" is unfortunately not very helpful: we need to see a complete example to understand better. – jon Sep 26 '15 at 4:00