[texhax] paragraph indent start-over
Paul Isambert
zappathustra at free.fr
Sun Feb 28 11:52:52 CET 2010
Of course it doesn't work, I should have known better. A simple solution:
\newcommand{\intro}[1]{
{\small #1\par}
\everypar={{\setbox0=\lastbox}\everypar{}}
}
(No need for a \newtoks.) Just note that paragraphs immediately
following a section title normally can't break after their first line,
i.e. if there is no room on the page to accomodate the title plus two
lines of text, then everything goes to the top of the next page. This
property is transferred to your small text here... but in your case it
won't work, unless you add \par immediately after #1, before the closing
brace (as I have done above). And if you really don't want a break in
the small text itself, then:
\newcommand{\intro}[1]{
{\interlinepenalty=10000
\small #1\par}
\everypar={{\setbox0=\lastbox}\everypar{}}
}
And you could even keep the property of avoiding orphans in the first
paragraph, but I've the impression that's not what you were asking (I'm
talking about it anyway because missing an indentation is not the only
characteristics of paragraphs after headings).
Paul
Eric Abrahamsen a écrit :
>
> On Feb 28, 2010, at 2:23 AM, Paul Isambert wrote:
>
>> Create a new token list with
>>
>> \newtoks\EveryPar
>>
>> and add \EveryPar=\everypar at the beginning of your snippet command
>> and \everypar=\EveryPar at the end.
>>
>
> Thanks Paul,
>
> This doesn't seem to be working though, here's the simplest failing
> example, these commands placed just before the start of the document:
>
> \newtoks\EveryPar
>
> \newcommand{\intro}[1]{
> \EveryPar=\everypar
> {\small #1}
> \everypar=\EveryPar}
>
> No error, but the first paragraph of proper text is still indented.
> I've tried putting the intro snippet inside an \hbox, and that works,
> but it won't wrap the text for longer snippets…
>
> Thanks,
> Eric
>
>> Paul
>>
>> Eric Abrahamsen a écrit :
>>> I've made a custom command for inserting a small snippet of
>>> introductory text after each section's headline. I don't want this
>>> snippet to "steal" the normal \noindent behavior of the first
>>> paragraph of proper text after the snippet, ie I want LaTeX to view
>>> that first paragraph of proper text as the actual first paragraph,
>>> and not indent it.
>>>
>>> Is there any way that I can either define my introductory snippet so
>>> that it's not seen as a real paragraph, or somehow put a \noindent
>>> into the end of the command so it applies to the following
>>> paragraph, or otherwise reset some internal counter so that the
>>> paragraph following is seen as the first?
>>>
>>> Thanks!
>>> Eric
>>> _______________________________________________
>>> TeX FAQ: http://www.tex.ac.uk/faq
>>> Mailing list archives: http://tug.org/pipermail/texhax/
>>> More links: http://tug.org/begin.html
>>>
>>> Automated subscription management:
>>> http://tug.org/mailman/listinfo/texhax
>>> Human mailing list managers: postmaster at tug.org
>>
>> _______________________________________________
>> TeX FAQ: http://www.tex.ac.uk/faq
>> Mailing list archives: http://tug.org/pipermail/texhax/
>> More links: http://tug.org/begin.html
>>
>> Automated subscription management:
>> http://tug.org/mailman/listinfo/texhax
>> Human mailing list managers: postmaster at tug.org
>
More information about the texhax
mailing list