Script KOMA: indente o título do capítulo e coloque itálico
Sep 17 2020
Em resumo, eu quero
- a palavra "Capítulo" e o número do capítulo devem estar em duas linhas consecutivas (alcançado)
- a palavra "Capítulo" e o número do capítulo a ser indentado (alcançado)
- a palavra "Capítulo" e o número do capítulo em estilos diferentes (alcançado)
- o título do capítulo deve ser indentado
- o título do capítulo deve estar em itálico
Eu alcancei 1, 2 e 3, mas não consigo descobrir como obter 4 e 5
MWE:
\documentclass[chapterprefix=true]{scrreprt}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage{xcolor}
\usepackage{lipsum}
%%%--chapter no. underneath the word "chapter" and in different styles
\renewcommand*{\chapterformat}{%
\hskip 2cm \mychaptername{\chaptername}\\*\vskip 0.5\baselineskip
\hskip 2cm \mychapternumber{\thechapter}%
}
\newcommand{\mychaptername}[1]{%
\usekomafont{chapter}%
{\color{black}\bfseries\fontsize{20}{20}\selectfont#1}%
}%
\newcommand{\mychapternumber}[1]{%
\usekomafont{chapter}%
{\color{blue}\bfseries\fontsize{40}{40}\selectfont#1}%
}%
%%%--chapter title indented and in italics
\renewcommand*{\chapterlinesformat}[3]{%
\hskip 2cm \mychaptertitle{#3}%
#2%
}
\newcommand{\mychaptertitle}[1]{%
\usekomafont{chapter}%
{\itshape#1}%
}
\begin{document}
\chapter{General Introduction}
\lipsum[1]
\end{document}
Respostas
1 esdd Sep 16 2020 at 23:47
Você define a opção chapterprefix, então você tem que redefinir \chapterlineswithprefixformat:
\documentclass[chapterprefix=true]{scrreprt}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage{xcolor}
\usepackage{lipsum}% only for dummy text
\addtokomafont{chapter}{\itshape}
\addtokomafont{chapterprefix}{\upshape}
\newkomafont{chapternumber}{\usekomafont{chapterprefix}\color{blue}\fontsize{40}{40}\selectfont}
\newlength{\chapterindent}
\setlength{\chapterindent}{2cm}
\renewcommand*{\chapterformat}{%
\IfUsePrefixLine
{%
\hskip\chapterindent\chapapp\\*\vskip 0.5\baselineskip
\hskip\chapterindent {\usekomafont{chapternumber}\thechapter}%
}{%
\thechapter\autodot\enskip
}%
}
\makeatletter
\renewcommand*{\chapterlineswithprefixformat}[3]{%
#2%
\@hangfrom{\hskip \chapterindent}{#3}%
}
\makeatother
\begin{document}
\tableofcontents
\chapter{General Introduction}
\lipsum[1]
\chapter{Long chapter title which fills more than one line}
\lipsum[2]
\end{document}
O que significa um erro “Não é possível encontrar o símbolo” ou “Não é possível resolver o símbolo”?
George Harrison ficou chateado por suas letras de 'Hurdy Gurdy Man' de Donovan não terem sido usadas