Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How would I write the following in LaTeX:

_Abstract_  
XXXX This is the  
XXXX abstract.

_Keywords_  
XXXX keyword1, keyword1  

In the above the letter X stands for space.

share|improve this question
add comment

migrated from stackoverflow.com Nov 25 '11 at 7:59

This question came from our site for professional and enthusiast programmers.

4 Answers

up vote 12 down vote accepted

Using the adjustwidth environment from the changepage package it is possible to push the left/right margins of the text in by any given amount. The environment has the following syntax:

\begin{adjustwidth}{<leftskip>}{<rightskip>}
  ...
\end{adjustwidth}

where it pushes the left margin in by <leftskip> and the right margin in by <rightskip>. To make the indentation align between the Abstract and Keywords, use the same <leftskip> length in \hspace{<leftskip>}.

Here is a minimal working example:

enter image description here

\documentclass{article}
\usepackage{changepage}% http://ctan.org/pkg/changepage
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\section*{Abstract}
\begin{adjustwidth}{1cm}{1cm}
  \lipsum[1-2]
\end{adjustwidth}
\section*{Keywords}
\hspace{1cm} keyword1, keyword2

\section{Introduction}
\lipsum[3-5]
\end{document}

The Abstract and Keyword titles were typeset as \section*, although this can be changed. For example, the article document class provides an abstract environment which typesets a heading and indents the abstract (like the adjustwidth environment) \leftmargin from the left and right. As such, you could use \hspace{\leftmargin} to have the Keywords indent the same distance. For completeness, in order to obtain the same formatting then, you could use

% <other content and document preamble>
\begin{abstract}
  % <your abstract goes here>
\end{abstract}
\textbf{Keywords} \par
\hspace{\leftmargin} keyword1, keyword2, ...
% <article content>

Finally, lipsum was merely used for dummy text.

share|improve this answer
add comment

For the KOMA classes there is the addmargin environment which is similar to adjustwidth. It has the syntax

\begin{addmargin}[<left indentation>]{<indentation>}
 contents
\end{addmargin}

By only supplying the mandatory argument, the same indentation will occur on both left and right side, while the optional argument will overwrite that for the left side.

There is also a starred version of the environment, for twosided layouts, where the optional argument sets the inner indent.

\documentclass{scrartcl}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{addmargin}[2cm]{0cm}
\lipsum[2]
\end{addmargin}
\begin{addmargin}{2cm}
\lipsum[3]
\end{addmargin}
\lipsum[4]
\end{document}

demo

share|improve this answer
add comment

Try \phantom{XXXX} which will leave the same space as XXXX would have occupied. There are also \hphantom{XXXX} and \vphantom{XXXX} to leave only horizonal or vertical space taking zero space in the other dimension.

share|improve this answer
add comment

Ideally you can find a document class that supports abstract.

Or you could try \hspace{5cm} or \hskip{5cm}, I forget.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.