%%
%% Der LaTeX-Begleiter, zweite Auflage (September 2005)
%%
%% Beispiel 4-4-13 von Seite 240.
%%
%% Copyright (C) 2005 Frank Mittelbach, Michel Goossens,
%%    Johannes Braams, David Carlisle, and Chris Rowley
%%
%% Uebersetzung: Copyright (C) 2005 Claudia Krysztofiak,
%%    Rebecca Stiels und Frank Mittelbach
%%
%% It may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%%
%% See http://www.latex-project.org/lppl.txt for details.
%%

\documentclass{lb2exa}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{89.66322pt}
\setlength\textheight{8\baselineskip}
% für die Buchbeispiele wird der vertikale Abstand verringert
\addtolength\headsep{-12pt} % für das Buch verkürzt
\addtolength\footskip{-12pt} % für das Buch verkürzt
\raggedright % da diese Beispiele so kurz sind

% Babel hat einen Fehler den wir hier korrigieren müssen, solange er
% nicht in der Babel-Distribution verbessert ist (was bald der Fall
% sein sollte):

\makeatletter
\def\markboth #1#2{%
  \toks@ {\noexpand\protect \noexpand\bbl@restore@actives #1}%
  \toks 8{\noexpand\protect \noexpand\bbl@restore@actives #2}%
  \edef \bbl@tempa {\noexpand \org@markboth
      {\noexpand \foreignlanguage {\languagename }{\the \toks@ }}%
      {\noexpand \foreignlanguage {\languagename }{\the \toks 8}}}%
  \bbl@tempa
}
\def\markright #1{%
   \toks@ {\noexpand\protect \noexpand\bbl@restore@actives #1}%
   \edef \bbl@tempa {\noexpand \org@markright
       {\noexpand \foreignlanguage {\languagename }{\the \toks@ }}}%
   \bbl@tempa
}
\makeatother


\StartShownPreambleCommands
\usepackage{ifthen,fancyhdr,extramarks}
\pagestyle{fancy} \fancyhf{}
\newcommand\combinemarks{\ifthenelse
  {\equal{\firstrightmark}%
         {\lastrightmark}}%
  {\firstrightmark}% gleiche Werte
  {\firstrightmark---\lastrightmark}}
\chead{\combinemarks} \cfoot{\thepage}
\newcommand\idxitem[1]{\par\vspace{8pt}%
              \textbf{#1}\markright{#1}%
              \quad\ignorespaces}
\StopShownPreambleCommands
\begin{document}
\idxitem{Fahne} Formatierter Text,
  nicht in Seiten aufgeteilt.
\idxitem{Kolumne} Textspalte.
\idxitem{Marke} Steht in der Fahne,
 um mit der OR zu kommunizieren.
\idxitem{OR} Output-Routine.
\end{document}
