[XeTeX] Bidipoem and pagenote packages
Heba Soliman
heba.soliman at afec.org
Mon Oct 3 12:50:09 CEST 2011
\pagenote comes from pagenote package, here is the content of the package,
traditionalpoem with empty lines really has no problem but also pagenote
with empty lines has no problem except when added in traditionalpoem
environment. I will appreciate any help.
Thanks
%%
%% This is file `pagenote.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pagenote.dtx (with options: `usc')
%%
%% -----------------------------------------------------------------
%% Author: Peter Wilson (The Herries Press)
%% Maintainer: Will Robertson (will dot robertson at latex-project dot
org)
%% Copyright 2004 Peter R. Wilson
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any
%% later version: <http://www.latex-project.org/lppl.txt>
%%
%% This work has the LPPL maintenance status "maintained".
%% The Current Maintainer of this work is Will Robertson.
%%
%% This work consists of the files listed in the README file.
%% -----------------------------------------------------------------
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pagenote}[2009/09/03 v1.1a page/end notes]
\@ifclassloaded{memoir}{}{\RequirePackage{ifmtarg}}
\newif\ifpnhaschapter
\@ifundefined{chapter}{\pnhaschapterfalse}{\pnhaschaptertrue}
\providecommand{\f at rtoc}{}
\newif\ifpnpageopt
\pnpageoptfalse
\newif\ifpncontopt
\pncontoptfalse
\DeclareOption{page}{\pnpageopttrue}
\DeclareOption{continuous}{\pncontopttrue}
\ProcessOptions
\ifpncontopt
\newcounter{pagenote}
\else
\ifpnhaschapter
\newcounter{pagenote}[chapter]
\else
\newcounter{pagenote}[section]
\fi
\fi
\renewcommand{\thepagenote}{\arabic{pagenote}}
\setcounter{pagenote}{0}
\newcounter{pnotesavechap}
\setcounter{pnotesavechap}{-1000}
\newif\ifmakingpagenotes
\makingpagenotesfalse
\newcommand*{\makepagenote}{%
\newwrite\@notefile
\immediate\openout\@notefile=\jobname.ent
\makingpagenotestrue
\def\pagenote{\@bsphack\begingroup
\@sanitize
\@wrpnote}%
\typeout{Writing note file \jobname.ent}%
\let\makepagenote\@empty}
\newcommand{\immediate at protected@write}[3]{%
\begingroup
#2%
\let\protect\@unexpandable at protect
\edef\reserved at a{\immediate\write#1{#3}}%
\reserved at a
\endgroup
\if at nobreak\ifvmode\nobreak\fi\fi}
\ifpnpageopt
\let\@pnwrite\protected at write
\else
\let\@pnwrite\immediate at protected@write
\fi
\newcommand{\@wrpnote}[2][]{%
\refstepcounter{pagenote}%
\notenumintext{\thepagenote}%
\ifpnhaschapter
\ifnum\value{pnotesavechap}=\value{chapter}\else
\setcounter{pnotesavechap}{\value{chapter}}%
\addtonotes{\pagenotesubhead{\thechapter}{\f at rtoc}}%
\fi
\else
\ifnum\value{pnotesavechap}=\value{section}\else
\setcounter{pnotesavechap}{\value{section}}%
\addtonotes{\pagenotesubhead{\thesection}{}}%
\fi
\fi
\@pnwrite\@notefile{}
{\string\noteentry{\thepagenote}{#1}{#2}{\thepage}}%
\endgroup
\@esphack}
\def\pagenote{\@bsphack\begingroup \@sanitize\@pagenote}
\newcommand{\@pagenote}[2][]{\endgroup\@esphack}
\newcommand{\addtonotes}[1]{%
\ifmakingpagenotes
\IfFileExists{\jobname.ent}{\@pnwrite\@notefile{}{#1}}{\pnofilewarn}%
\fi}
\newcommand{\notenumintext}[1]{%
\textsuperscript{#1}}
\newcommand{\notenuminnotes}[1]{%
{\normalfont #1.} }
\newcommand{\noteentry}[4]{%
\prenoteinnotes
\noteidinnotes{#1}{#2}\pageinnotes{#4}\noteinnotes{#3}%
\postnoteinnotes}
\newcommand{\textinnotes}[1]{%
[#1] }
\newcommand{\noteidinnotes}[2]{%
\@ifmtarg{#2}{%
\notenuminnotes{#1}}{\textinnotes{#2}}}
\providecommand*{\pagename}{page}
\newcommand{\pageinnotes}[1]{%
\ifpnpageopt (\pagename\ #1) \fi}
\newcommand{\noteinnotes}[1]{#1}
\newcommand{\prenoteinnotes}{\par\noindent}
\newcommand{\postnoteinnotes}{\par}
\providecommand*{\notesname}{Notes}
\ifpnhaschapter
\newcommand*{\notedivision}{\chapter{\notesname}}
\else
\newcommand*{\notedivision}{\section{\notesname}}
\fi
\newcommand*{\printnotes}{\@ifstar{\@sprintnotes}{\@printnotes}}
\newcommand*{\pnofilewarn}{%
\PackageWarning{pagenote}{There is no .ent file}}
\newcommand*{\@sprintnotes}{%
\ifmakingpagenotes
\notedivision
\IfFileExists{\jobname.ent}{%
\immediate\closeout\@notefile
\input{\jobname.ent}%
\immediate\openout\@notefile=\jobname.ent%
}{%
\pnofilewarn
}%
\fi}
\newcommand*{\@printnotes}{%
\ifmakingpagenotes
\notedivision
\IfFileExists{\jobname.ent}{%
\immediate\closeout\@notefile
\input{\jobname.ent}%
}{%
\pnofilewarn
}
\fi}
\providecommand*{\chaptername}{Chapter}
\providecommand*{\sectionname}{Section}
\ifpnhaschapter
\DeclareRobustCommand{\pagenotesubhead}[2]{%
\subsection*{\chaptername\ #1 #2}}
\else
\DeclareRobustCommand{\pagenotesubhead}[2]{%
\subsection*{\sectionname\ #1}}
\fi
\endinput
%%
%% End of file `pagenote.sty'.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20111003/891bc0a5/attachment.html>
More information about the XeTeX
mailing list