Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I add an author subtitle under a chapter title? [closed]

Tags:

latex

Had trouble knowing what exactly to Google, so I'll ask here.

I'm typesetting a series of annotations to papers. Each chapter will be on a paper, so I'd like to put the paper authors right under the chapter names (the paper titles).

I can think of a hacky way of doing this, but I figured I'd ask the fine folks over at SO first for something more elegant / contribute to the knowledge base.

like image 857
HamiltonUlmer Avatar asked Dec 18 '22 05:12

HamiltonUlmer


1 Answers

You can use the substr package in addition of titlesec (with explicit option) for create a semantic way of putting authors in titles.

Then, you can write your chapter on this way:

\chapter{About random things on Internet, and another
procrastination issues. Alice Marigold}

In this case the title and the author are separated for a ". " (You can use another separator if you use periods in one of your titles). Then you can modify the \chapter format with titlesec. With the explicit option you can access directly to the title content with #1. Then you can separate the title and the author with the commands \BeforeSubString and \BehindSubString of the substr package, respectively. They have two arguments: the separator token (in this case is ". ") and the string (the title. author).

For a simple example:

\titleformat{\chapter}[hang]{}{%
   \Huge \thechapter.
}{1cm}{%
   \LARGE \scshape \BeforeSubString{. }{#1}\\
   {\Large \itshape ---\BehindSubString{. }{#1}---}%
}

The result is similar to this.

You can make very different forms of place titles and authors, including putting it on the left. This is a example I used in a LaTeX demonstration, with the calc package:

\titleformat{\chapter}[hang]{}{%
   \Huge \thechapter.
}{1cm}{%
   \LARGE \scshape \BeforeSubString{. }{#1}\\
   \makebox[\textwidth - (1cm + \widthof{\Huge \thechapter.})][r]{\Large \itshape \BehindSubString{. }{#1}}%
}

About the table of contents, you can ignore it putting the title without the author in the \chapter optional argument, or modify it with titletoc.

And there are infinite possibilities of writing multi-information titles with these two packages...

PD: Sorry, but for some reason I can't put the CTAN links to the packages.

like image 139
lartkma Avatar answered May 22 '23 07:05

lartkma