General ⇒ An author and a title on chapter page
Re: An author and a title on chapter page
Can you show us a picture of what you're trying to achieve, or do your best to create one?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Re: An author and a title on chapter page
I just want to have full control over the title of chapter. Just like you have in WYSIWYG programs, for example.
Now, I really don't know what effect I want to get. I want to try some different arrangements and choose one. I need to get something like that:
(space from the top of the page)
title (font size about 18 pt)
author (font size about 12 pt)
city name (font size about... )
(some space, for example 36 pt)
main text
I hope this primitive presentation is a little clear.
An author and a title on chapter page
Code: Select all
\documentclass[12pt]{book}
\usepackage[T1]{fontenc}
\usepackage{titlesec}
\newcommand{\chapterauthor}{}
\newcommand{\chaptercity}{}
\titleformat{\chapter}% command to format the chapter titles
[hang]% shape/type of title
{\LARGE\bfseries}% formatting commands applied to both label and title
{\makebox[0.5in][l]{\thechapter}}% chapter number; here set inside an invisible box with a constant width
{0em}% separation between number and chapter title; we've already covered this with the box
{}% additional formatting command for title itself not applied to number
[% everything inside [...] below comes after the title
\normalsize\normalfont% reset font formatting
\vspace{0.5\baselineskip}% add a half-space of vertical space before author
\hspace*{0.5in}% indent author name width of chapter number box
\large% make text that follows large
\thispagestyle{empty}% suppress page numbers
\textit{\chapterauthor}% insert chapter author name in large italic font
\\% linebreak
\hspace*{0.5in}% again indent width of chapter number box
\chaptercity% insert city
]% end of what comes after title
\titlespacing*{\chapter}% spacing commands for chapter titles; the star unindents first line afterwards
{0em}% spacing to left of chapter title
{0ex}% vertical space before title
{3\baselineskip}% vertical spacing after title; here set to 3 lines
% The lipsum package is not part of my suggestion;
% it is just used to generate dummy text
\usepackage{lipsum}
\begin{document}
\tableofcontents
\renewcommand{\chapterauthor}{Joe Schmoe}
\renewcommand{\chaptercity}{Paris}
\chapter{Introduction}
\lipsum[21-30]% dummy text
\renewcommand{\chapterauthor}{Jane Doe}
\renewcommand{\chaptercity}{Melbourne}
\chapter{The First Contribution}
\lipsum[1-10]
\renewcommand{\chapterauthor}{Severus Snape}
\renewcommand{\chaptercity}{London}
\chapter{Another Great Contribution}
\lipsum[41-50]
\renewcommand{\chapterauthor}{Frank Lloyd Wright}
\renewcommand{\chaptercity}{Chicago}
\chapter{The Last One}
\lipsum[31-40]
\end{document}
Re: An author and a title on chapter page
I'd like to use confproc, but this fat manual terrified me.
You mentioned about the table of content. Do I have to format it by using package like tocloft or so? Or maybe \tableofcontent would be enough?
By the way, I didn't know I can use "Lorem ipsum" in LaTeX just by using one command.

Thanks!
krz
PS. And thanks for comments. I've just read them and it's very useful for me.
An author and a title on chapter page
Code: Select all
\usepackage{titlesec}
\titleformat{\chapter}{\normalfont\Large\scshape}{\thechapter}{1em}{}
Code: Select all
\chapter*{Title \\ \normalfont\normalsize\textit{--- Author ---}}
\addcontentsline{toc}{chapter}{\normalfont\scshape{Title} \\ \normalfont\textit{Author}}
Thanks for help!