Anzeige:
Ergebnis 1 bis 4 von 4

Thema: Einzug nach Überschrift

  1. #1
    Registrierter Benutzer
    Registriert seit
    18.02.2005
    Beiträge
    62

    Einzug nach Überschrift

    Hallo,

    Ich habe folgenden Quellcode :

    %------------Preamble-------------------------------------------------------------
    \documentclass[a4paper,10pt]{book}
    \usepackage{supertabular}
    \usepackage{ifthen}

    %defining the style of a heading
    \newcommand{\headingone}{\bf \Large}
    \newcommand{\headingtwo}{\bf \large}
    \newcommand{\headingthree}{\bf \normalsize}

    %variables for the headings in the table
    \newtoks\firstheading
    \newtoks\secondheading
    \newtoks\thirdheading

    %command to make a heading and to set the variables above
    %gets the name of the heading
    \newcommand{\SETheading}[2]{
    \ifthenelse{1=#1}{ \global\firstheading={#2}
    \headingone \the\firstheading\\
    \tablehead{\headingone \the\firstheading\\}
    }{}
    \ifthenelse{2=#1}{
    \global\secondheading={#2}
    \headingtwo\the\secondheading\\
    \tablehead{\headingone\the\firstheading\\
    \headingtwo\the\secondheading\\}
    }{}
    \ifthenelse{3=#1}{
    \global\thirdheading={#2}
    & \headingthree\the\thirdheading\\
    \tablehead{\headingone\the\firstheading\\
    \headingtwo\the\secondheading
    & \headingthree\the\thirdheading\\}
    }{}
    }

    \newcommand{\ENDheading}[1]{
    \ifthenelse{1=#1}{\tablehead{}
    }{}
    \ifthenelse{2=#1}{\tablehead{\headingone\the\first heading\\ }
    }{}
    \ifthenelse{3=#1}{\tablehead{\headingone \the\firstheading\\
    \headingtwo \the\secondheading \\ }
    }{}
    }
    %---------------------------------------------------------------------------
    \begin{document}

    \begin{supertabular}{|l|l|}
    \SETheading{1}{EDV-Erfahrung}
    \SETheading{2}{Betriebssysteme}
    \SETheading{3}{Unix-Derivate}
    \ENDheading{2}
    Hallo1\\
    Hallo2\\
    Hallo3\\
    Hallo4\\
    Hallo5\\
    Hallo6\\

    Hallo7\\
    Hallo8\\
    \end{supertabular}
    \end{document}

    ++++++++++++++++++++++++++++++++++++++++++++++++++ ++

    SETheading{Nummer}{Titel} liefert eine Überschrift der Größe "Nummer".
    Das ist auch gut so.
    Was mich stört ist daß nach jeder Überschrift der Nachfolgende Text nach innen eingezogen wird, obwohl nicht gewollt.

    Was mache ich nur falsch ?

  2. #2
    Registrierter Benutzer Avatar von blubb
    Registriert seit
    12.08.2004
    Beiträge
    862
    Zumindest in deinem Beispiel hast du den Tipp aus http://www.mrunix.de/forums/showthread.php?t=30331 nicht befolgt.

    Und wenn du dann noch unnötige Leerzeichen rausnimmst dann passt es schonmal.

    Korregierte Beispeil:

    \documentclass[a4paper,10pt]{book}
    \usepackage{supertabular}
    \usepackage{ifthen}

    %defining the style of a heading
    \newcommand{\headingone}{\bf \Large}
    \newcommand{\headingtwo}{\bf \large}
    \newcommand{\headingthree}{\bf \normalsize}

    %variables for the headings in the table
    \newtoks\firstheading
    \newtoks\secondheading
    \newtoks\thirdheading

    %command to make a heading and to set the variables above
    %gets the name of the heading
    \newcommand{\SETheading}[2]{%
    \ifthenelse{1=#1}{ \global\firstheading={#2}%
    \headingone \the\firstheading\\%
    \tablehead{\headingone \the\firstheading\\}%
    }{}%
    \ifthenelse{2=#1}{%
    \global\secondheading={#2}%
    \headingtwo\the\secondheading\\%
    \tablehead{\headingone\the\firstheading\\%
    \headingtwo\the\secondheading\\}%
    }{}%
    \ifthenelse{3=#1}{%
    \global\thirdheading={#2}%
    & \headingthree\the\thirdheading\\%
    \tablehead{\headingone\the\firstheading\\%
    \headingtwo\the\secondheading%
    & \headingthree\the\thirdheading\\}}{}}%

    \newcommand{\ENDheading}[1]{%
    \ifthenelse{1=#1}{\tablehead{}%
    }{}%
    \ifthenelse{2=#1}{\tablehead{\headingone\the\first heading\\}%
    }{}%
    \ifthenelse{3=#1}{\tablehead{\headingone \the\firstheading\\%
    \headingtwo \the\secondheading \\}%
    }{}}
    %---------------------------------------------------------------------------
    \begin{document}

    \begin{supertabular}{|l|l|}
    \SETheading{1}{EDV-Erfahrung}%
    \SETheading{2}{Betriebssysteme}%
    \SETheading{3}{Unix-Derivate}%
    \ENDheading{2}%
    Hallo1\\
    Hallo2\\
    Hallo3\\
    Hallo4\\
    Hallo5\\
    Hallo6\\

    Hallo7\\
    Hallo8\\
    \end{supertabular}
    \end{document}
    Wer Dokus lesen kann ist im Vorteil :D
    Das Forum hat eine Suchfunktion.
    FAQ: http://www.dante.de/faq/de-tex-faq/html/de-tex-faq.html
    Minimalbeispiel:http://www-users.rwth-aachen.de/Chri...mmer/mini.html

  3. #3
    Registrierter Benutzer
    Registriert seit
    18.02.2005
    Beiträge
    62
    das hats gebracht. Jetzt ist alles schön untereinander.

    es dankt

    Hermann

  4. #4
    Registrierter Benutzer
    Registriert seit
    18.02.2005
    Beiträge
    62
    für alle die nach mir das gleiche Problem haben:

    mit das meine ich Blubb's Lösung mit:

    % in der Befehlsdefinition und
    % nach dem Befehlsaufruf !!

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •