# Writing in the same line as the section title

I needed to add some text after some of my section title and it certainly needs to be in the same line, and not to be in ToC or bookmarks.

Therefore i decided to create my own subsection-type-thingy with an option to write text after the title, and that text wouldn't be added to ToC and bookmarks.

Is there any clean way to do that? (by redefining subsection which i cannot find a nice tuorial on, or some other way?)

my thingy: (i removed all font things and so on as they aren't the clue)

\def\MySubSection#1#2{\pagebreak[3]\noindent\thesection{.}\arabic{@MyCounter} #1 #2\addcontentsline{toc}{subsection}{\protect\numberline{\thesection.\arabic{@MyCounter}}#1}\\}

-

The sectioning macros have an optional argument to specify a short version for the ToC which is also used for the PDF bookmarks. You can then add your text in the normal argument after the title. To change the size and font to normal use \normalsize and \normalfont:

\section[Short Title for ToC]{Long title {\normalsize\normalfont some more text}}


Result:

Same counts for \subsection, \subsubsection, ... (and also \caption).

-
Doesn't this then cause issues with manual line breaking and such? If some more text would run off to the next line (or worse, hyphenate), then this solution would become unmanageable. –  Sean Allred Aug 12 at 12:57
That is, I don't think this would achieve the effect that OP is going for. At the end of the \section command, the same vertical space would be inserted at the end (and some document classes make this more or less drastic). Consider: i.stack.imgur.com/IcsDk.png –  Sean Allred Aug 12 at 15:57