Ignore:
Timestamp:
07/02/2009 06:21:32 PM (14 months ago)
Author:
dstn
Message:

still wrestling with stupid paragraph numbering

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/documents/theses/dstn/numberparagraphs.sty

    r12308 r12309  
    5757\usepackage{ifthen} 
    5858 
     59%\renewcommand{\section}[2]{\ifthenelse{\equal{#1}{*}}% 
     60%  {\mysectionstar{#2}}% 
     61%  {\mysection{#1}}% 
     62%} 
     63 
     64\renewenvironment{figure}{% 
     65  \nonumberparagraphs% 
     66  \@float{figure}}{% 
     67  \numberparagraphs% 
     68  \end@float} 
     69 
     70 
     71%%% section 
     72 
    5973\let\mypkg@@section\section 
    6074 
    61 \renewcommand{\section}[2]{\ifthenelse{\equal{#1}{*}}% 
    62   {\mysectionstar{*}{#2}}% 
    63   {\mysection{#1}}% 
     75\renewcommand{\section}{\@ifstar 
     76  \mysectionstar% 
     77  \mysection% 
    6478} 
    6579 
    66 \newcommand{\mysectionstar}[2]{% 
     80\newcommand{\mysectionstar}[1]{% 
    6781  \ifdonumberparagraphs% 
    6882  \nonumberparagraphs% 
    69   \mypkg@@section*{#2}% 
     83  \mypkg@@section*{#1}% 
    7084  \numberparagraphs% 
    7185  \else% 
    72   \mypkg@@section*{#2}% 
     86  \mypkg@@section*{#1}% 
    7387  \fi} 
    7488 
     
    8296  \fi} 
    8397 
     98%%% subsection 
     99 
     100\let\mypkg@@subsection\subsection 
     101 
     102\renewcommand{\subsection}{\@ifstar 
     103  \mysubsectionstar% 
     104  \mysubsection% 
     105} 
     106 
     107\newcommand{\mysubsectionstar}[1]{% 
     108  \ifdonumberparagraphs% 
     109  \nonumberparagraphs% 
     110  \mypkg@@subsection*{#1}% 
     111  \numberparagraphs% 
     112  \else% 
     113  \mypkg@@subsection*{#1}% 
     114  \fi} 
     115 
     116\newcommand{\mysubsection}[1]{% 
     117  \ifdonumberparagraphs% 
     118  \nonumberparagraphs% 
     119  \mypkg@@subsection{#1}% 
     120  \numberparagraphs% 
     121  \else% 
     122  \mypkg@@subsection{#1}% 
     123  \fi} 
    84124 
    85125 
    86126 
     127%%% chapter, chapter* 
     128 
    87129\let\mypkg@@chapter\chapter 
    88 \renewcommand{\chapter}[1]{\ifdonumberparagraphs% 
     130 
     131%\renewcommand{\chapter}[2]{\ifthenelse{\equal{#1}{*}}% 
     132%  {\mychapterstar{#2}}% 
     133%  {\mychapter{#1}}% 
     134%} 
     135 
     136%\renewcommand\chapter{\@dblarg\@mychapter} 
     137%\newcommand\@mychapter{% 
     138%  \@ifstar% 
     139%  \mychapterstar% 
     140%  \mychapter% 
     141%} 
     142 
     143\renewcommand{\chapter}{\@ifstar 
     144  \@dblarg\@mychapterstar% 
     145  \@dblarg\@mychapternostar% 
     146} 
     147 
     148%\def\@ifstar#1{\@ifnextchar *{\@firstoftwo{#1}}} 
     149 
     150%\long\def\@dblarg#1{\kernel@ifnextchar[{#1}{\@xdblarg{#1}}} 
     151%\long\def\@xdblarg#1#2{#1[{#2}]{#2}} 
     152 
     153 
     154%\renewcommand{\chapter}{\@dblarg\@mychapterx} 
     155%\newcommand{\@mychapterx}{\@ifstar 
     156%  \mychapterstar% 
     157%  \@mychapter% 
     158%} 
     159 
     160 
     161\comment{ 
     162\newcommand{\mychapterstar}[1]{% 
     163  \ifdonumberparagraphs% 
     164  \nonumberparagraphs% 
     165  \mypkg@@chapter*{#1}% 
     166  \numberparagraphs% 
     167  \else% 
     168  \mypkg@@chapter*{#1}% 
     169  \fi} 
     170 
     171\newcommand{\mychapter}[1]{% 
     172  \ifdonumberparagraphs% 
    89173  \nonumberparagraphs% 
    90174  \mypkg@@chapter{#1}% 
     
    93177  \mypkg@@chapter{#1}% 
    94178  \fi} 
     179} 
     180 
     181\def\@mychapterstar[#1]#2{% 
     182  \ifdonumberparagraphs% 
     183  \nonumberparagraphs% 
     184  \mypkg@@chapter*[#1]{#2}% 
     185  \numberparagraphs% 
     186  \else% 
     187  \mypkg@@chapter*[#1]{#2}% 
     188  \fi} 
     189 
     190\def\@mychapternostar[#1]#2{% 
     191  \ifdonumberparagraphs% 
     192  \nonumberparagraphs% 
     193  \mypkg@@chapter[#1]{#2}% 
     194  \numberparagraphs% 
     195  \else% 
     196  \mypkg@@chapter[#1]{#2}% 
     197  \fi} 
Note: See TracChangeset for help on using the changeset viewer.