TransWikia.com

Unable to left align title and author name using titling package in an existing template

TeX - LaTeX Asked on April 14, 2021

I am using an existing template that uses "titling". By default, the title is center aligned. I wanted to left align the title so that I may write my name in the same line. I know that there are so many questions on aligning (I am extremely new to latex), but the problem is trying them gives me one error or the other.

I just want to get it working using the existing template I have.

This is what I want to make it work on –

documentclass[12pt]{article}
% usepackage[utf8]{inputenc}
usepackage[margin=0.75in]{geometry}
usepackage{titling}
setlength{droptitle}{-0.75in}
pagenumbering{gobble}
title{Letter of Motivation vspace{-0.6in}}
author{Your Name}%vspace{-0.25in}
date{vspace{-0.7in}} %0.5 was default

begin{document}

maketitle
noindent
Lorem Ipsum hello world blah blah...

Now the author name and title overlap.

What I want is that the title is left aligned and after some space the author name appears (writing author name as part of title is fine too).

One Answer

The titling package offers pretitle, posttitle, preauthor, postauthor, predate, and postdate with the help of which you can configure the output of the maketitle command.

enter image description here

documentclass[12pt]{article}
usepackage[margin=0.75in]{geometry}
usepackage{titling}

setlength{droptitle}{-0.75in}
pagenumbering{gobble}

title{Letter of Motivation}
author{Your Name}
date{}

pretitle{noindentLARGE}
posttitle{}
preauthor{hspace{3cm}large} % adjust distance between title and author to your needs (currently 3cm)
%preauthor{hfilllarge} % uncomment for left aligned title and right aligned author
postauthor{par vskip 0.2em}
predate{}
postdate{}

begin{document}

maketitle
noindent
Lorem Ipsum hello world blah blah...


end{document}

Correct answer by leandriis on April 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP