Text FormattingReformatting the Title

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
numberlab
Posts: 5
Joined: Wed May 25, 2011 10:38 am

Reformatting the Title

Post by numberlab »

Hello,

I would like to reformat the title to have it leftaligned ("flushleft") or rightaligned ("flushright"). In addition I would like to draw a line immediately above and below the title.

The same goes for author data (well, maybe without the line things ;) ).

Does anyone have any idea how to do this in a simple manner? Any tips are highly appreciated!

/Daniel

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Reformatting the Title

Post by frabjous »

Take a look at the titling package; if you need specific advice, ask again, but it's probably best if you try it yourself first so you can provide a minimal working example if things aren't working right.
numberlab
Posts: 5
Joined: Wed May 25, 2011 10:38 am

Reformatting the Title

Post by numberlab »

Thanks for your answer and sorry for the delay in responding.

I have now installed the titling package. However, I have a problem: the title works fine as I want it, but the author information (i.e., my name and affiliation) doesn't show.

My preamble and testfile is as follows:

Code: Select all

\documentclass[twoside,10pt]{amsart}
\usepackage{titling}
\usepackage{mathptmx}       
\usepackage{helvet}         
\usepackage{courier}        
\usepackage{type1cm}
\begin{document}
\pretitle{\begin{flushleft}\huge\sffamily} 
\posttitle{\par\end{flushleft}\vskip 0.5em}
\preauthor{\begin{flushleft}\large}
\postauthor{\par\end{flushleft}\vskip 0.5em}
\title{blabla} 
\author{Daniel Larsson}
\maketitle
\end{document}
What's happening?

Also, are there any templates out there? I couldn't find any on CTAN.
Last edited by localghost on Sun Jul 03, 2011 2:36 pm, edited 2 times in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Reformatting the Title

Post by localghost »

Now and then you should listen to the compiler and look at what it tells you in the log file. It complaints by a warning about a missing author, although there is one given. It seems that the titling package is not compatible with the »amsart« class. If you don't really need to use this class, choose another one and load the packages of AMS-LaTeX subsequently.

By the way, the type1cm package is obsolete [1]. Replace it with fix-cm. For suitable Type 1 font encoding use the fontenc package with the according »T1« option.

[1] View topic: Obsolete packages and document classes — Avoid usage!

Best regards and welcome to the board
Thorsten
numberlab
Posts: 5
Joined: Wed May 25, 2011 10:38 am

Re: Reformatting the Title

Post by numberlab »

Thank you Thorsten! Now it works!

Ok, I didn't now about the obsolete-ness of amsart. However, I'm not sure I like the way the article-class make the file look; I really like the way amsart made the files look. But maybe I'll get used to it. Or maybe I'll customaize to the best of my abilities.

Once again: Thanks!

/Daniel
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Reformatting the Title

Post by localghost »

numberlab wrote:[…] Ok, I didn't now about the obsolete-ness of amsart. […]
Heads up! I didn't say that this class is obsolete. But as in this case it can cause trouble in conjunction with some packages. The AMS did things a little bit different in their classes compared to the standard classes.
numberlab wrote:[…] However, I'm not sure I like the way the article-class make the file look; I really like the way amsart made the files look. But maybe I'll get used to it. Or maybe I'll customaize to the best of my abilities. […]
If you like the look of that class, it can be mimicked by packages like titlesec. This package could do the page style as well as the appearance of headings. It will take a while to work out an example. I'll report back.
numberlab
Posts: 5
Joined: Wed May 25, 2011 10:38 am

Re: Reformatting the Title

Post by numberlab »

This titlesec looks promising. The only downside is that it's one more thing to lose yourself in :)

Thanks for taking the time to do a working example. It would be much appreciated I can tell you! ;)
numberlab
Posts: 5
Joined: Wed May 25, 2011 10:38 am

Re: Reformatting the Title

Post by numberlab »

Oh, by the way, on a similar note. Does anyone have some example file or template for how to use the abstract-package (incidently by the same authors as the titling-package). Personally, I think that both the titling and abstract should come with some (easy!) examples/templates on how to use them, for us non-hi-tech LaTeX-users ;)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Reformatting the Title

Post by localghost »

I was able to work out an example that mimics quite good the look of the »amsart« class.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[headsep=14pt]{geometry}
\usepackage[pagestyles]{titlesec}
\usepackage[dotinlabels]{titletoc}
\usepackage{blindtext}

\titlecontents{section}[2em]{}{\contentslabel{2em}}{\hspace*{-2em}}{\hfill\contentspage}
\titlecontents{subsection}[3em]{}{\contentslabel{3em}}{\hspace*{-3em}}{\hfill\contentspage}
%\titlecontents{subsubsection}[3em]{}{\contentslabel{3em}}{\hspace*{-3em}}{\hfill\contentspage}

\titleformat{\section}{\normalfont\scshape\filcenter}{\thesection.}{1ex minus .1ex}{\large}
\titlespacing{\section}{0pt}{*10}{*1}
\titleformat{\subsection}[runin]{\normalfont}{\thesubsection.}{.5ex minus .1ex}{\bfseries}[.]
\titleformat{\subsubsection}[runin]{\normalfont}{\thesubsubsection.}{.5ex minus .1ex}{\itshape}[.]
\titleformat{\paragraph}[runin]{\normalfont}{\paragraphtitle}{0pt}{\normalfont}[.]
\titlespacing{\paragraph}{0pt}{0pt}{*1}


\newpagestyle{main}[\scriptsize]{%
  \sethead[\thepage][][]{}{}{\thepage}
}
\pagestyle{main}
\setcounter{tocdepth}{2}

\title{The Title}
\author{The Author}

\begin{document}
  \tableofcontents

  \Blinddocument
\end{document}
This comes quite close to what the »amsart« class produces as output. It differs in some small details which to find out is left to the interested reader.
numberlab wrote:Oh, by the way, on a similar note. Does anyone have some example file or template for how to use the abstract-package (incidently by the same authors as the titling-package). […]
This goes beyond the scope of this topic. I suggest to open a new thread with a specific question.
Post Reply