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.

I'm writing a document in English which includes an abstract in Spanish. In Spanish the first paragraph of a chapter should be indented, while in English shouldn't.

If I use indentfirst package, all first paragraphs in the document would be indented.

How can I indent a first paragraph only once, i.e., without affecting other first paragraphs in the document?

EDIT: I only want to indent the first line of paragraphs. \indent doesn't do the job, maybe because it's overridden to not indent first paragraphs.

share|improve this question
1  
Why not use \indent? –  fefe Apr 23 '12 at 12:04
    
I think because he wants the whole paragraph to be indeted, not the first line only. –  Ray Apr 23 '12 at 12:16
    
I want to indent only the first line. \indent doesn't work, I suppose because it's overriden to not indent the first paragraph. –  Jose Apr 23 '12 at 12:33
    
@Jose In this case you should really edit your question accordingly since it says "How can I indent a first paragraph only once". –  Ray Apr 23 '12 at 12:40
add comment

3 Answers

up vote 8 down vote accepted

\indent does not work as the code LaTeX inserts to remove the indentation after a section heading really does remove the indentation box, even if added explicitly.

Try

\section{hhh}
\hspace*{\parindent}aa bb ccaa 
share|improve this answer
    
Brilliant, thanks a lot –  Jose Apr 23 '12 at 14:54
add comment

Add to the code executed when entering Spanish what's done by indentfirst; we do also the converse, when exiting Spanish.

\documentclass{article}
\usepackage[spanish,english]{babel}
\makeatletter
\let\original@afterindentfalse\@afterindentfalse
\addto{\extrasspanish}{\let\@afterindentfalse\@afterindenttrue}
\addto{\noextrasspanish}{\let\@afterindentfalse\original@afterindentfalse}
\makeatother
\usepackage{lipsum}
\begin{document}
\begin{otherlanguage}{spanish}
\section{\abstractname}
\lipsum[2]
\end{otherlanguage}

\lipsum[3]
\end{document}
share|improve this answer
    
yes +1 for me as no one else had, and this is of course the right way to do it if you have lots of spanish and english sections. If it's just a single abstract though, I thought the hspace was simpler even if it does pollute the document markup a bit. –  David Carlisle Apr 23 '12 at 15:30
    
@DavidCarlisle Of course: one single indent does not require a complicated solution. I'd be even more drastic: if the base language is English, follow the conventions of English. –  egreg Apr 23 '12 at 16:35
add comment

You could set up a new environment if you would like to indent a full paragraph.

\newenvironment{myindentpar}[1]
 {\begin{list}{}
         {\setlength{\leftmargin}{#1}}
         \item[]
 }
 {\end{list}}

Then you could call this environment by

\begin{myindentpar}{3cm}
text text text...
\end{myindentpar}

In case you just want to indent a single line I would suggest the \indent command.

Source

share|improve this answer
    
Thanks for the answer, but yes, I want to indent only the first line. \indent doesn't do the job, maybe because it's overriden to not indent the first paragraph? –  Jose Apr 23 '12 at 12:35
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.