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.

In the article class, it seems that using the abstract environment has an effect to the rest of the document. More precisely, it seems that it redefines the \linewidth, which equals \textwidth without abstract, is smaller with the abstract. My feeling is that \linewidth is redefined for the abstract environment, but the value is not reseted at the end of the abstract.

Here is a minimal example:

\documentclass{article}
\begin{document}
\abstract{This is an abstract. This is an abstract.}\bigskip

This is text. This is text. This is text. This is text. This is text. This is text.\\ 
\rule{\textwidth}{3em}
\rule{\linewidth}{3em}
\end{document}

The output is not the same if you comment the \abstract line or not.

Do you have the same problem as I do when you compile (if not, I will upload some PDF files to show)? Is this a (known) bug in LaTeX2e? How can we circumvent the problem?

Note: I compile with the pdflatex command, and I use pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).

share|improve this question
    
What if I want to intentionally keep the linewidth the same for the rest of the document, but use correct syntax, i.e. \begin{abstract} This is an abstract. This is an abstract. \end{abstract}? Is there a way of knowing the linewidth used in the abstract? -> See here! –  Jonas Mar 16 '13 at 12:20
add comment

1 Answer

up vote 11 down vote accepted

abstract is an environment and should be used as such. And \linewidth is smaller than \textwidth within abstract because abstract (without article's titlepage class option) is based on the quotation environment which adds left-hand and right-hand indentation.

\documentclass{article}

\begin{document}

\begin{abstract}
This is an abstract. This is an abstract.
\end{abstract}

\bigskip

This is text. This is text. This is text. This is text. This is text. This is text.\\ 
\rule{\textwidth}{3em}
\rule{\linewidth}{3em}

\end{document}
share|improve this answer
    
Usually I use the environment, I do not know why this time I did not! Thanks for your answer. –  Bruno Aug 16 '11 at 11:30
3  
@Bruno: There is only the environment, but all environments are implemented using internal macros with the same name and an end macro which starts with 'end', i.e. \abstract and \endabstract. Therefore your original code still compiled without warning or error, but lead to a wrong result. –  Martin Scharrer Aug 16 '11 at 11:58
2  
The worst part is that theoretically, I know all of what you remind me... I should have think about it a bit longer. Yet, if my question and lockstep's answer can help some other people, it was not a waste of time! –  Bruno Aug 16 '11 at 16:16
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.