1

How can I get the startpoints for my sections (see top part of MWE) as one inline text, similar to what can be done with the bottom part of my MWE? I need the sections since my title marks etc work off them. Have a look at the part where the word "CATALAN" is in the example.

\documentclass{article}
\usepackage{titlesec, marginnote}

% turns sections into arabic numbers
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\arabic{subsection}}

% sections and subsections formatting
% package = titlesec
\titleformat{\section}{}{\lettrine{\thesection}}{0em}{}[\vskip-1\baselineskip]
\titleformat{\subsection}[leftmargin]{\small\bfseries}{\thesubsection}{1em}{}
\titlespacing{\section}{\howwide}{-1pt}{0pt}
\titlespacing{\subsection}{0pt}{0pt}{1em}

\begin{document}

\subsection{}Babel and hyphenation patterns for english, dumylang, nohyphenation, german-x-2011-07-01, ngerman-x-2011-07-01, afrikaans, ancientgreek, ibycus, arabic, armenian, basque, bulgarian,
\subsection{}CATALAN, pinyin, coptic, croatian, czech, danish, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnish, french, galician, german, ngerman, swissgerman, monogreek, greek, hungarian, icelandic

\reversemarginpar

\marginnote{{\bf 1}}Babel and hyphenation patterns for english, dumylang, nohyphenation, german-x-2011-07-01, ngerman-x-2011-07-01, afrikaans, ancientgreek, ibycus, arabic, armenian, basque, bulgarian,
\marginnote{{\bf 2}}CATALAN, pinyin, coptic, croatian, czech, danish, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnish, french, galician, german, ngerman, swissgerman, monogreek, greek, hungarian, icelandic

\end{document}

MWE

McGafter
  • 2,266

2 Answers2

3

Do you men something like this?

\documentclass{article}
\makeatletter
\renewcommand\section{%
  \@startsection{section}{1}{-1.5em}%
                            {1ex \@plus1ex \@minus.2ex}%
                            {0em}%
                            {\normalfont\normalsize\bfseries}}
\makeatother
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\arabic{subsection}}

\begin{document}

\section{}Babel and hyphenation patterns for english, dumylang, nohyphenation, german-x-2011-07-01, ngerman-x-2011-07-01, afrikaans, ancientgreek, ibycus, arabic, armenian, basque, bulgarian,
\section{}CATALAN, pinyin, coptic, croatian, czech, danish, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnish, french, galician, german, ngerman, swissgerman, monogreek, greek, hungarian, icelandic

\end{document}

enter image description here

  • Thanks for the answer, but looking at your example, I want the CATALAN to follow straight after the bulgarian. The number 2 should then be displayed before the line reading "menian, basque, bulgarian, CATALAN..." – McGafter Jan 12 '12 at 05:59
1

If your lines don't have excessive depth, this can work:

\documentclass{article}
\newcommand{\marginsec}[1]{%
  \refstepcounter{marginsec}%
  \mbox{\strut#1}\vadjust{\vbox to 0pt{
    \sbox0{\bfseries\themarginsec\quad}
    \kern-\ht0
    \kern-\dp\strutbox
    \llap{\box0 }
    \vfill
    }
  }%
}
\newcounter{marginsec}

\begin{document}
\marginsec{Babel} and hyphenation patterns for english, dumylang, nohyphenation,
german-x-2011-07-01, ngerman-x-2011-07-01, afrikaans, ancientgreek, ibycus, arabic,
armenian, basque, bulgarian,
\marginsec{CATALAN}, pinyin, coptic, croatian, czech, danish, dutch, ukenglish,
usenglishmax, esperanto, estonian, ethiopic, farsi, finnish, french, galician, german,
ngerman, swissgerman, monogreek, greek, hungarian, icelandic
\end{document}
egreg
  • 1,121,712
  • You've hit the nail on the head on the look of it, but will the sections still work as normal for links in the TOC and bookmarks as well as the titlesec titlemarks? I'll try and implement this solution anyway to see for myself. – McGafter Jan 12 '12 at 06:08
  • I think I got it all working. Changing \refstepcounter{marginsec} to \refstepcounter{subsection} and \sbox0{\bfseries\themarginsec\quad} to \sbox0{\bfseries\thesubsection\quad} and also deleting \newcounter{marginsec}. The titlemarks picks it up well enough. – McGafter Jan 12 '12 at 08:39