title indent

43 views
Skip to first unread message

r

unread,
Jul 20, 2009, 4:04:40 PM7/20/09
to LaTeX Users Group
\documentclass[12pt,a4paper,twoside]{article}
\usepackage{titling}
\usepackage[top=1.5cm,right=1.2cm,bottom=1.5cm,left=1.5cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[latin1,utf8]{inputenc}
\begin{document}
\makeatletter
\renewcommand{\maketitle}{
\begin{flushleft}
{\setlength{\parindent}{1cm}\Large\@title}
\bigskip
{\setlength{\parindent}{1cm}\normalsize\@author\par}
\medskip
{\setlength{\parindent}{1cm}\normalsize\@date\par}
\end{flushleft}
}
\makeatother
\author{name1*, name2\\
\textit{address}
\footnotesize*corresponding author: telephone, e-mail\\
\setlength{\parindent}{1cm}Key words: Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
}
\date{~}
\title{\setlength{\parindent}{3cm}this is the title\\}
\maketitle

The title is not in line with the other text. Also the key words text
appears wider than the margins specified in the geometry package. Any
help?

la...@conference.jabber.org

Peter Flynn

unread,
Jul 20, 2009, 6:42:31 PM7/20/09
to latexus...@googlegroups.com
On Mon, Jul 20, 2009 at 9:04 PM, r <inp...@gmail.com> wrote:
The title is not in line with the other text. Also the key words text
appears wider than the margins specified in the geometry package. Any
help?

It would be easier if we knew what you were actually trying to do. It's not at all obvious from your code.

You invoke the titling package but then you do not use any of its features.
\flushleft means what it says: flush-left (\parindent is not meaningful here).
Don't put your \[re]newcommands in the document body: put them in the Preamble (before \begin[document}).


\documentclass[12pt,a4paper,twoside]{article}
\usepackage{titling}
\usepackage[top=1.5cm,right=1.2cm,bottom=1.5cm,left=1.5cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[latin1,utf8]{inputenc}
\pretitle{\raggedright\setlength{\parindent}{1cm}\Large}
\posttitle{\par\bigskip}
\preauthor{\raggedright\setlength{\parindent}{1cm}\normalsize}
\postauthor{\par\medskip}
\predate{\raggedright\setlength{\parindent}{1cm}\normalsize}
\postdate{\par}
\begin{document}

\author{name1*, name2\\
        \textit{address}\footnotesize*corresponding author: telephone, e-mail\\
        Key words: Lorem ipsum dolor sit amet, consectetur adipisicing
        elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
       }
\date{~}
\title{this is the title}
\maketitle
 stuff
\end{document}

Very strange format, to use a \parindent in titling, though :-)

///Peter

r

unread,
Jul 21, 2009, 5:51:24 AM7/21/09
to LaTeX Users Group


On Jul 20, 11:42 pm, Peter Flynn <anglebrac...@gmail.com> wrote:
> On Mon, Jul 20, 2009 at 9:04 PM, r <inp...@gmail.com> wrote:
> > The title is not in line with the other text. Also the key words text
> > appears wider than the margins specified in the geometry package. Any
> > help?
>
> It would be easier if we knew what you were actually trying to do. It's not
> at all obvious from your code.
>

I want all text to be aligned within the dimensions set in the
geometry package options.

> You invoke the titling package but then you do not use any of its features.
> \flushleft means what it says: flush-left (\parindent is not meaningful
> here).

Flush left does work, but the text is not aligned to the margin
setting of 15 mm; seems to be aligned 5 mm.

> Don't put your \[re]newcommands in the document body: put them in the
> Preamble (before \begin[document}).
>

Done as you instructed. Text position of both the title and key-words
paragraph remain unchanged in wrong position; the latter does not
adhere to margin settings.


> \predate{\raggedright\setlength{\parindent}{1cm}\normalsize}
> \postdate{\par}
> \begin{document}
> \author{name1*, name2\\
>         \textit{address}\footnotesize*corresponding author: telephone,
> e-mail\\
>         Key words: Lorem ipsum dolor sit amet, consectetur adipisicing
>         elit, sed do eiusmod tempor incididunt ut labore et dolore magna
> aliqua.
>        }
> \date{~}
> \title{this is the title}
> \maketitle
>  stuff
> \end{document}
>
> Very strange format, to use a \parindent in titling, though :-)
>
I tried parindent at various lengths, even 0 cm but no change occurred
in text position.

jon

unread,
Jul 21, 2009, 2:59:40 PM7/21/09
to LaTeX Users Group
your example is very confusing. (what, e.g., is all that stuff you're
trying to squeeze into \author{}..?)

however, if you take peter's example and switch all your \parindent
commands to 0cm (just to see the difference), you'll see that the
second line of your keywords was flush with the left margin as you set
it up in the geometry package. the \parindents were moving things in
from that left margin, not that the keywords were over-shooting your
left margin (as specified by the geometry package).

if you want to do something trickier than that, take a look at the
titling package documentation.

cheers,
jon.

r

unread,
Jul 21, 2009, 3:40:29 PM7/21/09
to LaTeX Users Group


jon wrote:
> >         \author{name1*, name2\\
> your example is very confusing. (what, e.g., is all that stuff you're
> trying to squeeze into \author{}..?)
>

Simple: author 1*, author 2, etc. on one line, justified left, 15 mm
from page edge.

> however, if you take peter's example and switch all your \parindent
> commands to 0cm (just to see the difference), you'll see that the
> second line of your keywords was flush with the left margin as you set
> it up in the geometry package. the \parindents were moving things in
> from that left margin, not that the keywords were over-shooting your
> left margin (as specified by the geometry package).
>

The key-words paragraph is aligned with the abstract at 15 mm, but the
text continues beyond the right margin setting with the second line in
line with the author!

Output obtained so far:

title text

author text

key-words: Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua.

abstract text abstract text Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est
laborum.

figure caption

The key-words paragraph needs to be aligned with the author text, the
word 'incididunt' should have appeared on the second line.

Output required below:

title text

author text

key-words: Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.

abstract text Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui
officia deserunt mollit anim id est laborum.

figure caption

jon

unread,
Jul 21, 2009, 4:49:04 PM7/21/09
to LaTeX Users Group
you don't actually describe what you are doing though, so it is hard
to know what is going on with your document. if you are using the
abstract environment (\begin{abstract}...\end{abstract}), then it will
print the contents of the abstract in a way similar to a quote
environment --- i.e., indented from the regular body-text margins. if
you don't want that to happen, then you must either renew the abstract
environment or not use it. (you can mimic its effect without the
indented lines by using \bigskip, \vspace{<value>}, and \noindent
commands.

the first line of new paragraphs are indented automatically. if you
want to suppress indentation, then you need to use \noindent.
(there's a package for controlling indents, too, but i can't remember
what it is.) note, of course, that your \parskip commands have no
effect outside of your \maketitle redefinition.

if you are still having trouble, then post a complete minimal(!)
example that demonstrates the problem(s).

cheers,
jon.

r

unread,
Jul 22, 2009, 4:47:55 AM7/22/09
to LaTeX Users Group
Thanks for this advice. I removed the abstract environment and
obtained what I wanted with the following:

\documentclass[12pt,a4paper,twoside]{article}
\usepackage[format=hang]{caption}
\usepackage[top=1.5cm,right=1.2cm,bottom=1.5cm,left=1.5cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[latin1,utf8]{inputenc}
\usepackage{graphicx}
\begin{document}
\preauthor{\begin{flushleft}}
\author{author 1*, author 2\\
\textit{address 1\\
address 2\\~\\}
\footnotesize*corresponding author: telephone, e-mail\\~\\
Key words: Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
}
\postauthor{\end{flushleft}}
\predate{\begin{flushleft}}
\date{~}
\postdate{\end{flushleft}}
\pretitle{\begin{flushleft}\Large}
\title{Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed
do eiusmod tempor incididunt ut labore et dolore magna aliqua.}
\posttitle{\end{flushleft}}
\maketitle
\vspace{1 cm}
\noindent Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
\begin{figure}
\label{}
\begin{center}

\end{center}
\caption{Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.}
\end{figure}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
\end{document}

The final adjustments I would like to make are to change the space
between the title and the top edge of the page (should be 15 mm as set
in the geometry package but the dvi view shows a top margin much
larger. Also the space between the key-word paragraph and the main
body text seems large; vspace did change the appearance.
Reply all
Reply to author
Forward
0 new messages