From 12a9c88c506d20248c694bab2edf0ad4c13c0e02 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 26 Jul 2012 22:41:42 +0000 Subject: poetrytex (26jul12) git-svn-id: svn://tug.org/texlive/trunk@27174 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/poetrytex/Makefile | 12 +- .../source/latex/poetrytex/poetrytex.dtx | 174 ++++++++++++++------- 2 files changed, 124 insertions(+), 62 deletions(-) (limited to 'Master/texmf-dist/source/latex/poetrytex') diff --git a/Master/texmf-dist/source/latex/poetrytex/Makefile b/Master/texmf-dist/source/latex/poetrytex/Makefile index 57b2ebeabf6..9731417220c 100644 --- a/Master/texmf-dist/source/latex/poetrytex/Makefile +++ b/Master/texmf-dist/source/latex/poetrytex/Makefile @@ -36,7 +36,7 @@ REDIRECT = > /dev/null # Files grouped by generation mode COMPILED = $(DOC) UNPACKED = poetrytex.sty -SOURCE = $(DTX) Makefile README.md +SOURCE = $(DTX) Makefile README GENERATED = $(COMPILED) $(UNPACKED) CTAN_FILES = $(SOURCE) $(COMPILED) @@ -44,7 +44,7 @@ CTAN_FILES = $(SOURCE) $(COMPILED) UNPACKED_DOC = RUNFILES = $(filter-out $(UNPACKED_DOC), $(UNPACKED)) -DOCFILES = $(COMPILED) README.md $(UNPACKED_DOC) +DOCFILES = $(COMPILED) README $(UNPACKED_DOC) SRCFILES = $(DTX) Makefile ALL_FILES = $(RUNFILES) $(DOCFILES) $(SRCFILES) @@ -98,7 +98,11 @@ $(UNPACKED): $(DTX) $(CTAN_ZIP): $(CTAN_FILES) $(TDS_ZIP) @echo "Making $@ for CTAN upload." @$(RM) -- $@ - @zip -9 $@ $^ >/dev/null + @mkdir -p $(NAME)/ + @cp $^ $(NAME)/ + @rm $(NAME)/*.zip + @zip -9 $@ $(NAME)/* $(NAME).tds.zip >/dev/null + @rm -rf $(NAME)/ define run-install @mkdir -p $(RUNDIR) && cp $(RUNFILES) $(RUNDIR) @@ -148,7 +152,7 @@ manifest: @for f in $(GENERATED); do echo $$f; done clean: - @$(RM) -- *.log *.aux *.toc *.idx *.ind *.ilg *.glo *.gls *.example *.out *.synctex* *.tmp poetrytex-style.sty *.ins poetrytex*.pdf poetrytex*.dvi + @$(RM) -- *.log *.aux *.toc *.idx *.ind *.ilg *.glo *.gls *.example *.out *.synctex* *.tmp poetrytex-style.sty *.ins poetrytex*.pdf poetrytex*.dvi README *.lot @$(RM) -- $(GENERATED) $(ZIPS) @$(RM) -- $(builddir)/* diff --git a/Master/texmf-dist/source/latex/poetrytex/poetrytex.dtx b/Master/texmf-dist/source/latex/poetrytex/poetrytex.dtx index 68b8d4262aa..4f3b4e9a722 100644 --- a/Master/texmf-dist/source/latex/poetrytex/poetrytex.dtx +++ b/Master/texmf-dist/source/latex/poetrytex/poetrytex.dtx @@ -78,7 +78,7 @@ % \name{Sam Whited}\\ % \texttt{sam@samwhited.com} % } -% \date{\today\\v1.0\githead\gitdirty\gituncommitted} +% \date{\today\\v1.1\githead\gitdirty\gituncommitted} % % \maketitle % \maketoc @@ -155,7 +155,7 @@ % which includes the current git commit short-hash in the version number: % % \begin{Verbatim} -% xelatex --shell-escape poetrytex.dtx +% pdflatex --shell-escape poetrytex.dtx % \end{Verbatim} % % It should be noted that this option is extremely unsafe, and you should only @@ -185,15 +185,25 @@ % % We'll start with the title page: % +% \begin{macro}{\pttitle} +% \begin{macro}{\ptsubtitle} +% \begin{macro}{\ptauthor} +% \begin{macro}{\ptdate} +% These properties will affect the appearance of \code{\textbackslash% +% maketitle}: % \begin{macrocode} \newcommand*{\pttitle}{Title} \newcommand*{\ptsubtitle}{Subtitle} \newcommand*{\ptauthor}{Author} \newcommand*{\ptdate}{\today} % \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} % -% Since we define the properties above as commands, you can change the -% appearance of your document by redefining them in your preamble like so: +% Since we define them as commands, you can change the appearance of your +% title page by redefining them in your preamble like so: % % \begin{Verbatim} % \renewcommand*{\pttitle}{My Title} @@ -213,61 +223,85 @@ % date we use the \code{\textbackslash pt} equivalents so that we can refer to % them again later, or redefine them throughout the document---in anthologies % with works by multiple authors, for instance. -% \begin{macrocode} -\newcommand*{\@ptpoemlabeltext}{poetrytexpoem:} -% \end{macrocode} +% \begin{macro}{\@ptpoemlabeltext} % Each time you create a poem in your document we automatically assign it a % special label that can be used to link to it later. This label is prefixed % with \code{\textbackslash @ptpoemlabeltext} to prevent it from conflicting % with user defined labels, or labels defined in other packages. +% \begin{macrocode} +\newcommand*{\@ptpoemlabeltext}{poetrytexpoem:} +% \end{macrocode} +% \end{macro} % % Chances are you'll never need to touch this. % +% \begin{macro}{poemnum} +% \begin{macro}{absolutepoemnum} +% The \code{poemnum} and \code{absolutepoemnum} counters will be incremented +% every time we include a poem in our document and can be used later to number +% the poems. The \code{absolutepoemnum} counter will never be reset by \pkg{% +% poetrytex} while \code{poemnum} may sometimes be reset to 0 (at the beginning +% of a new \code{poemgroup} for instance). % \begin{macrocode} \newcounter{poemnum} \newcounter{absolutepoemnum} % \end{macrocode} -% The \code{poemnum} and \code{absolutepoemnum} counters will be incremented -% every time we include a poem in our document and can be used later to number -% the poems. +% \end{macro} +% \end{macro} % % \subsection{Dedication} % % After your title page you might want to add a dedication page. % +% \begin{macro}{\ptdedication} % \begin{macro}{\makededication} +% \changes{1.1}{2012/07/21}{Added optional `environment' argument} % As with the \code{\textbackslash pttitle} and author commands you can simply % redefine \code{\textbackslash ptdedication} to change the dedication text. +% +% To create a dedication page, the \code{\textbackslash makededication} command +% can be called. By default, this command aligns everything to the right, +% however, by adding an optional argument you can specify any environment to +% wrap the dedication in. % \begin{macrocode} -\newcommand*{\ptdedication}{} -\newcommand*{\makededication}[0]{% +\newcommand*{\ptdedication}{Renew \textsf{\textbackslash ptdedication}} +\newcommand*{\makededication}[1][flushright]{% \thispagestyle{empty} \vspace*{\fill} - \begin{flushright} + \begin{#1} \emph{\ptdedication} - \end{flushright} + \end{#1} \vspace*{\fill} } % \end{macrocode} % \end{macro} +% \end{macro} % % \subsection{Tables and links} % % Next we setup the table of contents and list of poems: +% +% \begin{macro}{\toptitle} +% \begin{macro}{\topentrytype} +% The value of \code{\textbackslash toptitle} will be rendered atop the Table of +% Poems, and \code{\textbackslash topentrytype} will set the default entry type +% for poems in the TOP. % \begin{macrocode} -\setcounter{secnumdepth}{-1} -\setcounter{tocdepth}{2} \newcommand*{\toptitle}{List of Poems} -\renewcommand*{\listtablename}{\toptitle} \newcommand*{\topentrytype}{subsection} % \end{macrocode} +% \end{macro} +% \end{macro} % -% First, we set the \code{secnumdepth} and \code{tocdepth} counters to disable +% We then set the \code{secnumdepth} and \code{tocdepth} counters to disable % chapter, section, and subsection numbering, and to limit the maximum depth of -% entries in the TOC. We then choose a default value for \code{\textbackslash% -% toptitle} which will be rendered atop the Table of Poems, and set the default -% entry type for poems to `subsection.' As with the previous options, these can -% all be redefined to suit your needs. +% entries in the TOC. +% +% \begin{macrocode} +\setcounter{secnumdepth}{-1} +\setcounter{tocdepth}{2} +\renewcommand*{\listtablename}{\toptitle} +% \end{macrocode} % % \begin{macro}{\maketoc} % \begin{macro}{\maketop} @@ -277,7 +311,8 @@ % \textbackslash tableofcontents} and \code{\textbackslash listoftables}, we % provide alternatives that add a bit of formatting and clear the page. By % default the TOP creates a listing in the TOC---Using the star modifier -% prevents this. +% prevents this. An example table of poems can be found at the end of this +% document. % \begin{macrocode} \newcommand*{\maketoc}{% \tableofcontents @@ -286,11 +321,6 @@ \thispagestyle{empty} } \newcommand*{\maketop}{\@ifstar{\@ptmaketopStar}{\@ptmaketopNoStar}} -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \begin{macrocode} \newcommand*{\@ptmaketopStar}{% \listoftables \pagestyle{plain} @@ -305,6 +335,10 @@ \clearpage } % \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% % \begin{macro}{\numbertop} % Placing this command in your document preamble will cause the table of poems % to be numbered. @@ -321,6 +355,7 @@ % % \section{The \code{poem} environment} % +% \begin{environment}{poem} % Inserting a poem or other writing into your anthology is accomplished by % wrapping it in the \code{poem} environment. This environment takes in two % arguments, the title and subtitle (or author, date, etc.) of the poem. @@ -406,6 +441,7 @@ \fi } % \end{macrocode} +% \end{environment} % % \section{Formatting} % @@ -444,7 +480,6 @@ % \end{macro} % \end{macro} % Using \code{\textbackslash numberpoems} results in: -% \clearpage % \begin{Example} % \begin{Verbatim} % \numberpoems @@ -474,26 +509,29 @@ % % \subsection{Spacing and indentation} % -% The \code{stanzaparskip} length is used to change the \code{parskip} within a -% poem environment. +% \begin{macro}{\stanzaparskip} +% This length is used to change the \code{parskip} within a poem environment. % \begin{macrocode} \newlength{\stanzaparskip} \setlength{\stanzaparskip}{0.7em} % \end{macrocode} +% \end{macro} % % \begin{macro}{\clearpageafterpoem} -% This macro causes the page to be cleared after every poem environment. +% \code{clearpageafterpoem} causes the page to be cleared after every poem +% environment. % \begin{macrocode} \newcommand*{\clearpageafterpoem}{\newcommand*{\@ptclearpageafterpoem}{}} % \end{macrocode} % \end{macro} % +% \begin{macro}{\ptgap} % \begin{macro}{\ptind} % \begin{macro}{\ptind*} -% The \code{\textbackslash ptgap} macro and \code{\textbackslash ptind} command -% are two of those places where \pkg{poetrytex} strays a bit into the realm of -% poetry typesetting. They overlap with the \pkg{verse} package's\code{% -% \textbackslash vgap} and \code{\textbackslash vin} commands, and insert +% The \code{\textbackslash ptgap} length and \code{\textbackslash ptind} +% command are two of those places where \pkg{poetrytex} strays a bit into the +% realm of poetry typesetting. They overlap with the \pkg{verse} package's +% \code{\textbackslash vgap} and \code{\textbackslash vin} commands, and insert % indentation at at the beginning of a line. This is useful for typesetting % poems consistently when the \pkg{verse} package is not loaded. Redefine % \code{\textbackslash ptgap} to change the length that \code{\textbackslash% @@ -514,6 +552,7 @@ % \end{macrocode} % \end{macro} % \end{macro} +% \end{macro} % % Using it works something like this: % \clearpage @@ -555,16 +594,21 @@ % % \subsection{Stylization} % +% \begin{macro}{\poemtitleformat} % By redefining \code{\textbackslash poemtitleformat} we can change how the poem % title is rendered. % \begin{macrocode} \newcommand*{\poemtitleformat}{\normalfont\bfseries\large\centering} % \end{macrocode} +% \end{macro} % % % If you want a stylistic marker between two poems, or between sections % or stanzas within a poem, the following commands are your friend. % +% \begin{macro}{\ptspacergap} +% \begin{macro}{\ptspacerchar} +% \begin{macro}{\ptspacernum} % The \code{ptspacergap} length is the indentation of the spacer, and\code{% % \textbackslash ptspacerchar} is the actual character that will be printed % \code{\textbackslash ptspacernum} times. @@ -574,6 +618,9 @@ \newcommand*{\ptspacerchar}{\S} \newcommand*{\ptspacernum}{3} % \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} % % \begin{macro}{\ptspacer} % \changes{1.0}{2012/07/17}{Repeat \code{\textbackslash ptspacernum} times} @@ -659,14 +706,14 @@ % matter for instance). % % \begin{macro}{\linktopoem} -% We can link to poems easily enough by providing \code{linktopoem} with the -% number of the poem and the text for the link. If only one argument is given -% it is used as both the link destination and text. +% \changes{1.1}{2012/07/24}{Fix spacing and multiple use issues} +% We can \emph{\linktopoem[1]{link}} \emph{\linktopoem[2]{to}}% +% \emph{\linktopoem[3]{poems}} easily enough by providing \code{linktopoem} with +% the text for the link and, optionally, the number of the poem to link to. If +% only one argument is given it is used as both the link destination and text. % \begin{macrocode} -\newcommand*{\linktopoem}[2][false]{% - \newcommand*{\@ptfirstarg}{#1} - \newcommand*{\@ptfalse}{false} - \ifx \@ptfirstarg \@ptfalse +\newcommand*{\linktopoem}[2][ptnull]{% + \ifx{#1}{ptnull} \hyperref[\@ptpoemlabeltext#2]{#2}\relax \else \hyperref[\@ptpoemlabeltext#1]{#2}\relax @@ -674,13 +721,16 @@ } % \end{macrocode} % \end{macro} +% +% \begin{macro}{\ptgroup} % \begin{macro}{\poemgroup} % \begin{macro}{\poemgroup*} -% Dividing poems up into groups can be accomplished with the \code{poemgroup} -% command. The command creates a title-page for the group at the current -% location and adds entries to the TOP and TOC unless the starred version of the -% command is used. The \code{\textbackslash ptgroup} command will always contain -% a reference to the current group in case you need to refer to it later. +% Dividing poems up into groups can be accomplished with the \code{% +% \textbackslash poemgroup} command. The command creates a title-page for the +% group at the current location and adds entries to the TOP and TOC unless the +% starred version of the command is used. The \code{\textbackslash ptgroup} +% command will always contain a reference to the current group in case you need +% to refer to it later. % \begin{macrocode} \newcommand*{\ptgroup}{} \newcommand*{\poemgroup}{% @@ -726,27 +776,34 @@ % \end{macrocode} % \end{macro} % \end{macro} +% \end{macro} % % \section{The \code{annotation} environment} % -% Annotations allow you to insert text into your document that maintains some -% of the page formatting of the \code{poem} environment without the text itself -% actually being formatted like verse. It uses \code{\textbackslash% -% poetryheadings}, clears the page twice, and adds itself to the TOC (but not -% the TOP). The page is also cleared again after the annotation. +% \begin{environment}{annotation} +% \changes{1.1}{2012/07/20}{Added optional `environment' argument} +% Annotations allow you to insert prose that relates to a specific poem into +% your document. It uses \code{\textbackslash poetryheadings}, clears the page +% twice, and adds itself to the TOC (but not the TOP). The page is also cleared +% again after the annotation. % +% Like the \code{poetry} environment, an optional first argument can be used to +% specify the environment in which the annotation will be wrapped. This defaults +% to \code{flushleft}. % \begin{macrocode} -\newenvironment{annotation}[1]{% +\newenvironment{annotation}[2][flushleft]{% + \newcommand*{\@ptwrapenvironment}{#1} \cleardoublepage \poetryheadings - \begin{flushleft} - \subsection{#1} + \begin{\@ptwrapenvironment} + \subsection{#2} }{% - \end{flushleft} + \end{\@ptwrapenvironment} \clearpage } % \end{macrocode} +% \end{environment} % % \begin{macrocode} % @@ -764,7 +821,8 @@ % \makeatother % \clearpage % \PrintChanges -% +% \changes{1.1}{2012/07/19}{Added an example table of poems} +% \maketop % \Finale % % \iffalse -- cgit v1.2.3