Text FormattingDont indent first paragraph in another language than english

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
User avatar
pablox
Posts: 3
Joined: Mon May 17, 2010 4:30 am

Dont indent first paragraph in another language than english

Post by pablox »

It is supposed that the normal behavior of LaTeX (at least in articles classes) is don't indent the first paragraph after each section.

The thing is that if I set the \documentclass in spanish like this:

Code: Select all

\documentclass[twocolumn,spanish]{article}
The behavior changes to indent even the following paragraph after each section. I already check that is enough to changed it to english (or delete it) to get the "normal" and (my) desired behavior.

I can't leave it on english the whole time because I lose the spell check feature with LyX. And I can keep changing each time, but I think there must be an easier and/or cleaner way.

Hope someone can helps :)
Last edited by pablox on Mon May 17, 2010 10:15 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Dont indent first paragraph in another language than english

Post by gmedina »

pablox wrote:It is supposed that the normal behavior of LaTeX (at least in articles classes) is don't indent the first paragraph after each section...
Apparently things are different in LyX; in standard LaTeX, spanish is not a class option and instead of

Code: Select all

\documentclass[spanish]{article}
you must use

Code: Select all

\documentclass{article}
\usepackage[spanish]{babel}
Anyway, this, in fact, will now indent the first paragraph after a sectional unit (as it is customary in Spanish). If you want to suppress this feature, use the es-noindentfirst option for babel as the following example suggests:

Code: Select all

\documentclass[twocolumn]{article}
\usepackage[spanish,es-noindentfirst]{babel}
\begin{document}
\section{Test section one}
text text text text\par
text text text text\par
text text text text
\section{Test section two}
text text text text\par
text text text text\par
text text text text
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
pablox
Posts: 3
Joined: Mon May 17, 2010 4:30 am

Dont indent first paragraph in another language than english

Post by pablox »

gmedina wrote:
pablox wrote:It is supposed that the normal behavior of LaTeX (at least in articles classes) is don't indent the first paragraph after each section...
Apparently things are different in LyX; in standard LaTeX, spanish is not a class option and instead of

Code: Select all

\documentclass[spanish]{article}
you must use

Code: Select all

\documentclass{article}
\usepackage[spanish]{babel}
I checked the source again and discovered that there are three commands after the preamble that you can configure, but before the beginning of the document:

Code: Select all

\makeatother

\usepackage{babel}
\addto\shorthandsspanish{\spanishdeactivate{~<>}}

\begin{document}
Anyway, this, in fact, will now indent the first paragraph after a sectional unit (as it is customary in Spanish). If you want to suppress this feature, use the es-noindentfirst option for babel as the following example suggests:

Code: Select all

\documentclass[twocolumn]{article}
\usepackage[spanish,es-noindentfirst]{babel}
\begin{document}
\section{Test section one}
text text text text\par
text text text text\par
text text text text
\section{Test section two}
text text text text\par
text text text text\par
text text text text
\end{document}
I can't (or I don't know how) configure those lines inside LyX, so I just added the line you suggested on the preamble, having a result like this:

Code: Select all

\usepackage[spanish,es-noindentfirst]{babel}

\makeatother

\usepackage{babel}

\addto\shorthandsspanish{\spanishdeactivate{~<>}}

\begin{document}
Looks ugly to have that line repeated, but thanks!. It worked as expected :). Should I change the subject to solved or something like that?
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Dont indent first paragraph in another language than english

Post by gmedina »

pablox wrote:...Looks ugly to have that line repeated, but thanks!. It worked as expected :). Should I change the subject to solved or something like that?
You're welcome. You can edit your first post in this thread and add the green checkmark to indicate that the problem has been solved.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
pablox
Posts: 3
Joined: Mon May 17, 2010 4:30 am

Dont indent first paragraph in another language than english

Post by pablox »

gmedina wrote:
pablox wrote:...Looks ugly to have that line repeated, but thanks!. It worked as expected :). Should I change the subject to solved or something like that?
You're welcome. You can edit your first post in this thread and add the green checkmark to indicate that the problem has been solved.
Por cierto, no deja de ser gracioso que resolvimos el problema en inglés y veo que eres de colombia XD.

Gracias de nuevo :)

(título cambiado)
Post Reply