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 have made the following small command to insert visible section breaks in a manuscript:

\makeatletter
\newcommand{\subsectionbreak}{
    \vspace{1\baselineskip}
    \centerline{\char"E030}
    \vspace{1\baselineskip}
    \@afterindentfalse\@afterheading
}
\makeatother

But I would also like to make the first three words of the following paragraph automatically rendered in small-caps without having to manually add an explicit command (such as \testsc{first three words}) to do so.

I've read the responses to the question First few words of a chapter/section in small-caps?, and the highest rated response suggests configuring a manual command such as:

\def\scwords #1 #2 #3 {\textsc{#1} \textsc{#2} \textsc{#3} }
...
\scwords Lorem ipsum delorem fugit however this goes

How might I go about adding the function of the latter command into the former so that \subsectionbreak causes the first three words of the following paragraph to render in small-caps?

share|improve this question

1 Answer 1

You can simply say

\makeatletter
\newcommand{\subsectionbreak}{\par %%% <- important addition
  \vspace{1\baselineskip}
  \centerline{\char"E030}
  \vspace{1\baselineskip}
  \@afterindentfalse\@afterheading
  \scwords
}
\makeatother

where \scwords is the proposed one; then write

\subsectionbreak
Lorem ipsum dolor sit amet ...

However I don't think this is the better way to do it: I'd surely prefer

\makeatletter
\newcommand{\subsectionbreak}[1]{\par %%% <- important addition
  \vspace{1\baselineskip}
  \centerline{\char"E030}
  \vspace{1\baselineskip}
  \@afterindentfalse\@afterheading
  \textsc{#1 }\ignorespaces
}
\makeatother

and then

\subsectionbreak{Lorem ipsum dolor} sit amet ...
share|improve this answer
1  
I tend to agree with you. Sometimes too much automation is too much :) –  tohecz Oct 23 '12 at 8:13

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.