diff options
author | Karl Berry <karl@freefriends.org> | 2008-09-08 00:03:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-09-08 00:03:25 +0000 |
commit | d247e879c954761e3e8ca4ebfd5aba404d9c985f (patch) | |
tree | a5a742da6ae2f9a633cf642958e28c62a19388b4 /Master/texmf-dist/tex | |
parent | 11debc9eaa698bd999e63943e09eff84d52dcd28 (diff) |
catechis update (2sep08)
git-svn-id: svn://tug.org/texlive/trunk@10460 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/catechis/catechis.sty | 116 |
1 files changed, 57 insertions, 59 deletions
diff --git a/Master/texmf-dist/tex/latex/catechis/catechis.sty b/Master/texmf-dist/tex/latex/catechis/catechis.sty index cc94a2957e1..d9c2b5842ec 100644 --- a/Master/texmf-dist/tex/latex/catechis/catechis.sty +++ b/Master/texmf-dist/tex/latex/catechis/catechis.sty @@ -19,10 +19,11 @@ % % This work has the LPPL maintenance status 'maintained'. % -% The Current Maintainer of this work is Donald P. Goodman. +% The Current Maintainer of this work is Donald P. Goodman +% (dgoodmaniii@gmail.com). % -% This work consists of the files catechis.ins, catechis.sty, and -% test.tex, along with README. +% This work consists of the files catechis.ins and +% catechis.sty, along with the README. % \fi % % \maketitle @@ -40,8 +41,8 @@ % \section{Introduction} % % There is no package which provides appropriate commands for writing -% catechism questions and explanations. One-off hacks are, of course, quite -% easy to produce: +% catechism questions and explanations. One-off hacks are, of course, +% quite easy to produce: % \begin{quote} % |\begin{enumerate}| \\ % |\item \textbf{Who made us?} \\ God made us.| \\ @@ -65,8 +66,17 @@ % The |catechis| package was designed to provide just these such commands, % with significant further additions useful for catechism writing, as well. % -% This document was produced in accordance with the \LaTeX\ \textsc{docstrip} -% utility. +% This document was produced in accordance with the \LaTeX\ +% \textsc{docstrip} utility. +% +% This is version 1.1 of |catechis|; the only change is some +% cleaning up of the |enumerate|s, mostly just hard-wiring +% everything so that it actually works. While this comes at +% the cost of flexibility, it gains\ldots well, actually +% working, so I considered this a good deal. Hopefully I'll +% be able to add some flexibility on this score in the +% future; until then, you can still use the default +% |enumerate|s but calling them outside of a |\catques|. % % Any questions, comments, and improvements can be sent to the package author, % Donald Goodman, at dgoodmaniii at gmail dot com. @@ -241,29 +251,6 @@ % might (for hours) I couldn't get it to work without it, so\ldots there % we are. % -% \DescribeMacro{\listmarg} -% Still, there is one length which by necessity is customizable: -% |\listmarg|. This governs the left margin of the first level of the -% |enumerate|. Right now it's set as the difference between the value -% of |\defquesparindent| and the default indentation of the first level -% of |enumerate|. That is, |\leftmargini| (the indentation of the first -% level of a list) is defined as: -% \begin{quote} -% |\setlength\leftmargin{\the\defquesparindent+\the\listmarg}| -% \end{quote} -% So if you change the value of |\defquesparindent|, you've changed -% the indentation of the lists. To repair this, you can either redefine -% |\@listi| entirely, or just |\leftmargini| individually, or you can -% simply alter the value of |\listmarg|. I recommend the latter; as -% it's more removed from internals, you're unable to accidentally -% hose the indentation on your non-catechism |enumerate|s. -% -% So, if you want to alter the value of |\defquesparindent| and want -% that of |\listmarg| to match, try just running it and seeing how it -% works. Then redefine |\listmarg| as you think is necessary. It's -% that simple. Okay, so it's not simple; but it's much better than it -% was previously, I can tell you. -% % That essentially completes the discussion of the basic command of the % |catechis| package. Now we may discuss some of its more advanced features. % @@ -399,6 +386,12 @@ % \item There's also one in \textit{Officium Parvum}.\label{testlabel} % \catcomment{This one could use some work. But it still isn't % terrible.} +% \begin{enumerate} +% \item And now for a few more items\ldots +% \begin{enumerate} +% \item Just to see what they look like. +% \end{enumerate} +% \end{enumerate} % \end{enumerate} % \item It's a part of my plan to make a complete Catholic % desktop (though what that plan is, exactly, is still somewhat @@ -445,6 +438,14 @@ % surprised and having to work quite hard to figure out some unexpected % results.} % } +% \catques{Do the enumerates line up properly even when +% there are two digits in the question number?}{ +% \begin{enumerate} +% \item Do the enumerates still have proper margins with +% multiple-digit question numbers? +% \item Why, yes. Yes, they do. +% \end{enumerate} +% } % % \section{Implementation} % \label{sect:code} @@ -503,8 +504,6 @@ \newlength\quesparindent % Customizable question parindent \newlength\ansparindent % Customizable answer parindent \setlength\ansparindent{0em} % Initialize to zero -\newlength\listindent\newlength\listmarg -\newlength\perwidth\settowidth\perwidth{.}% % \end{macrocode} % % Now we delcare the counter for the questions. Obvious enough. @@ -519,6 +518,25 @@ % \begin{macrocode} \newcommand\catques[2]{% \refstepcounter{quesnum}% +\begingroup\par\setlength\parskip{\the\questionskip plus 2pt minus 2pt}% +\settowidth\defquesparindent{% This sucks; but for some reason the +% indentation eats closing spaces, so... +\quesnumweight{\quesnumstyle{\thequesnum. }}}% +\ifthenelse{\quesindentstyle=\hangindent}{% +\setlength\parindent{0pt}}{\hangafter=1}% +\setlength\quesindentstyle{\the\defquesparindent-\the\quesparindent}% +\quesnumweight{\quesnumstyle{\thequesnum\@.}} % +\questionweight{\questionstyle{#1}}\hfill\par\endgroup% +\begingroup\par\setlength\parskip{\the\answerskip}% +\ifthenelse{% +\ansindentstyle=\hangindent}{% +\setlength\parindent{0pt}}{\hangafter=1}% +\setlength\ansindentstyle{\the\ansparindent}% +\settowidth\defanswerindent{% +\quesnumweight{\quesnumstyle{\thequesnum. }}}% +\setlength\leftskip{\the\defanswerindent-\the\answerindent}% +\setlength\rightskip{\the\rtanswerindent}% +\answeight{\ansstyle{#2}}\hfill\par\endgroup% \renewcommand\theenumi{\alph{enumi}}% \labelformat{enumi}{\thequesnum(\theenumi)}% \renewcommand\theenumii{\arabic{enumii}}% @@ -528,11 +546,10 @@ \renewcommand\theenumiv{\Alph{enumiv}}% \labelformat{enumiv}{\thequesnum(\theenumi)(\theenumii)(\theenumiii)% (\theenumiv)}% -\setlength\leftmarginiii{2em}% -\setlength\leftmarginiv{2em}% +\settowidth\leftmarginiii{2em}% +\settowidth\leftmarginiv{2em}% \renewcommand\@listi{% -\setlength\listmarg{\the\labelsep+\the\labelwidth + \the\perwidth} -\setlength\leftmargin{\the\defquesparindent + \the\listmarg}% +\settowidth\leftmargin{\the\defquesparindent. }% \setlength\parsep{0em}% \setlength\itemsep{0em plus 2pt minus 2pt}% \setlength\topsep{0em} @@ -540,7 +557,7 @@ \setlength\parskip{0em} }% end redef of \@listi \renewcommand\@listii{% -\setlength\leftmargin{0em+\the\labelwidth}% +\settowidth\leftmargin{(\theenumi) }% \setlength\parsep{0em}% \setlength\itemsep{0em plus 2pt minus 2pt}% \setlength\topsep{0em} @@ -548,7 +565,7 @@ \setlength\parskip{0em} }% end redef of \@listii \renewcommand\@listiii{% -\setlength\leftmargin{0em+\the\labelwidth}% +\settowidth\leftmargin{\theenumii. }% \setlength\parsep{0em}% \setlength\itemsep{0em plus 2pt minus 2pt}% \setlength\topsep{0em} @@ -556,37 +573,18 @@ \setlength\parskip{0em} }% end redef of \@listiii \renewcommand\@listiv{% -\setlength\leftmargin{0em+\the\labelwidth}% +\settowidth\leftmargin{\theenumiii. }% \setlength\parsep{0em}% \setlength\itemsep{0em plus 2pt minus 2pt}% \setlength\topsep{0em} \setlength\partopsep{0em} \setlength\parskip{0em} }% end redef of \@listiv -\begingroup\par\setlength\parskip{\the\questionskip plus 2pt minus 2pt}% -\settowidth\defquesparindent{% This sucks; but for some reason the -% indentation eats closing spaces, so... -\quesnumweight{\quesnumstyle{\thequesnum. }}}% -\ifthenelse{\quesindentstyle=\hangindent}{% -\setlength\parindent{0pt}}{\hangafter=1}% -\setlength\quesindentstyle{\the\defquesparindent-\the\quesparindent}% -\quesnumweight{\quesnumstyle{\thequesnum\@.}} % -\questionweight{\questionstyle{#1}}\hfill\par\endgroup% -\begingroup\par\setlength\parskip{\the\answerskip}% -\ifthenelse{% -\ansindentstyle=\hangindent}{% -\setlength\parindent{0pt}}{\hangafter=1}% -\setlength\ansindentstyle{\the\ansparindent}% -\settowidth\defanswerindent{% -\quesnumweight{\quesnumstyle{\thequesnum. }}}% -\setlength\leftskip{\the\defanswerindent-\the\answerindent}% -\setlength\rightskip{\the\rtanswerindent}% -\answeight{\ansstyle{#2}}\hfill\par\endgroup% }% % \end{macrocode} % My, wasn't that messy? Now, on to the |\catcomment| command. % Now we define the |\catcomment| command. It's pretty simple, -% actually, thanks to lacking the identation issues that |\cateques| was +% actually, thanks to lacking the identation issues that |\catques| was % so plagued by. % \begin{macrocode} \newcommand\catcomment[1]{% |