summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-09-28 22:52:32 +0000
committerKarl Berry <karl@freefriends.org>2012-09-28 22:52:32 +0000
commit27fd84b5bfffb6b59d3110e9f68902d62a454ce7 (patch)
treeed172813c073c0e579842e9a92025cb751e322cf
parentd85661d3d3b7510a86424cadb9c6cb71a0210cc1 (diff)
biblatex.4ht fixes, r91 from tex4ht
git-svn-id: svn://tug.org/texlive/trunk@27847 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/tex/generic/tex4ht/biblatex.4ht224
1 files changed, 185 insertions, 39 deletions
diff --git a/Master/texmf-dist/tex/generic/tex4ht/biblatex.4ht b/Master/texmf-dist/tex/generic/tex4ht/biblatex.4ht
index 03a01aa1064..fea5d51a9c7 100644
--- a/Master/texmf-dist/tex/generic/tex4ht/biblatex.4ht
+++ b/Master/texmf-dist/tex/generic/tex4ht/biblatex.4ht
@@ -1,7 +1,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% biblatex.4ht 2011-09-18-16:07 %
+% biblatex.4ht 2012-09-28-15:51 %
% Copyright (C) 2007--2009 Eitan M. Gurari %
-% 2009--2011 TeX Users Group %
+% 2009--2012 TeX Users Group %
% %
% This work may be distributed and/or modified under the %
% conditions of the LaTeX Project Public License, either %
@@ -25,7 +25,7 @@
% tex4ht@tug.org %
% http://www.tug.org/tex4ht %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\immediate\write-1{version 2011-09-18-16:07}
+\immediate\write-1{version 2012-09-28-15:51}
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
@@ -42,8 +42,8 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
- \ifx \blx@startbib\:UnDef
- \pend:def\blx@shorthands{%
+ \ifx\blx@startbib\:UnDef
+ \pend:def\blx@shorthands{%
\pend:def\blx@bibinit{%
\HAssign\shorthands:cnt=0
\NewConfigure{printfield-shorthand}{2}%
@@ -54,8 +54,103 @@
}
{\d:printshorthands}%
\append:def\endtheshorthands{\b:printshorthands}%
- \csname a:@shorthands\endcsname
-}}
+ \csname a:@shorthands\endcsname}
+}
+\ifx\b:printshorthands\Undef\let\endtheshorthands\@empty\fi
+\def\a:entryhead{CVR}
+\def\a:entryhead:full{CV Radhakrishnan}
+\ifx\bib@macro@entryhead:name\UnDef
+ \let\bib@macro@entryhead:name\@empty\fi
+\ifx\bib@macro@entryhead:full\UnDef
+ \let\bib@macro@entryhead:full\@empty\fi
+ \gdef\BibFileName[#1]#2{\expandafter\xdef\csname
+ BibFileName#1\endcsname{#2}}
+\newcount\sv:sec:cnt
+\def\bibSecConfigure{%
+ \let\save:section\section
+ \global\sv:sec:cnt=\c@secnumdepth
+ \def\section{\@ifstar
+ {\c@secnumdepth=0\relax\save:section}%
+ {\c@secnumdepth=\sv:sec:cnt\save:section}}%
+}
+\gHAssign\bibN=0
+ \:CheckOption{ooffice}\if:Option
+ \def\bibConfigure{\ConfigureList{thebibliography}%
+ {\IgnorePar\EndP \gHAdvance\bib:N by 1
+ \HCode{<text:bibliography text:name="bib-\bib:N" >
+ <text:bibliography-source>\Hnewline
+ <text:index-title-template>}
+ \NoFonts\ref:name\EndNoFonts
+ \HCode{</text:index-title-template>\Hnewline
+%
+ <text:bibliography-entry-template\Hnewline
+ text:bibliography-type="custom1"
+ text:style-name="Bibliography11">\Hnewline
+%
+ <text:index-entry-bibliography
+ text:bibliography-data-field="identifier"/>\Hnewline
+%
+ <text:index-entry-span>: </text:index-entry-span>\Hnewline
+ <text:index-entry-bibliography
+ text:bibliography-data-field="author" />\Hnewline
+ <text:index-entry-span>, </text:index-entry-span>\Hnewline
+%
+ <text:index-entry-bibliography
+ text:bibliography-data-field="title" />\Hnewline
+ <text:index-entry-span>, </text:index-entry-span>\Hnewline
+%
+ <text:index-entry-bibliography
+ text:bibliography-data-field="year" />\Hnewline
+ </text:bibliography-entry-template>\Hnewline\Hnewline
+ </text:bibliography-source>\Hnewline
+ <text:index-body>\Hnewline}%
+ \let\en:bib=\empty
+ }%
+ {\en:bib\HCode{</text:index-body></text:bibliography>}}
+ {\en:bib\gdef\en:bib{\HCode{</text:p>\Hnewline}}%
+ \HCode{<text:p text:style-name="p-bibitem">}%
+ \gHAdvance\bibN by 1
+ \HCode{<text:reference-mark
+ text:name="X0-\csname BIB-\bibN\endcsname">%
+ </text:reference-mark>}%
+ }%
+ {}{}
+ }
+
+ \else
+ \def\bibConfigure{%
+ \ConfigureList{thebibliography}
+ {\ifvmode \IgnorePar \fi \EndP \EndP
+ \HCode {<dl class="thebibliography">}%
+%
+% This is for linking citations with biblist items which
+% are in a different file when output is split into different
+% chunks. [CVR 2012-09-27]
+%
+%
+% <biblatex-2.2>
+%
+ \immediate\write\@auxout{%
+ \string\BibFileName[\therefsection]{\FileName}}%
+%
+% </biblatex-2.2>
+%
+ \PushMacro \end:itm \global \let \end:itm =\empty}%
+ {\ifvmode \IgnorePar \fi \EndP
+ \PopMacro \end:itm \global \let \end:itm \end:itm \EndP
+ \HCode {</dd></dl>}\ShowPar}%
+ {\ifvmode \IgnorePar \fi \EndP \gHAdvance \bibN by 1
+ \end:itm \global \def \end:itm {\EndP \Tg </dd>}%
+ \HCode {<dt id="X\therefsection-\abx@field@entrykey"
+ class="thebibliography">}\bgroup \bf}%
+ {\ifvmode \IgnorePar \fi \EndP
+ \egroup
+ \HCode {</dt><dd\Hnewline id="bib-\bibN"
+ class="thebibliography">}%
+ \par \ShowPar}%
+ }
+
+ \fi
\NewConfigure{printshorthands}{4}
\NewConfigure{@shorthands}[1]{\concat:config\a:@shorthands{#1}}
\let\a:@shorthands\empty
@@ -64,19 +159,34 @@
\blx@warning@noline {Page references have changed.\MessageBreak
Rerun to get references right}\@tempswatrue \blx@reruntrue \fi
\@nameuse {blx@rerun}}
-\pend:def\blx@bibliography{%
+\pend:def\blx@bibliography{\bibSecConfigure%
\pend:def\blx@bibinit{%
- \ConfigureList{thebibliography}%
- {\a:thebibliography}%
- {\b:thebibliography}%
- {\c:thebibliography}%
- {\d:thebibliography}%
+ \bibConfigure
\csname onthebibliography:list\endcsname
}%
-% \pend:def\endthebibliography{%
-% \if@newlist \global\@newlistfalse \fi
-% }%
}
+\let\en:bib\@empty
+\newcounter{bib}
+\protected\def\blx@bbl@entry#1#2#3{%
+ \begingroup
+ \def\texht@bibkey{#1}
+ \edef\abx@field@entrykey{\detokenize{#1}}%
+ \global\advance\c@bib 1
+ \immediate\write\@auxout{\string\expandafter\string\gdef
+ \string\csname\space BIB-\thebib\string\endcsname
+ {\expandafter\strip@prefix\meaning\texht@bibkey}}%
+ \Tag{)QX\therefsection-#1}{\thebib}%
+ \blx@setoptions@type{#2}%
+ \blx@bbl@options{#3}%
+ \blx@setoptions@entry
+ \edef\blx@bbl@data{blx@data@\the\c@refsection @\abx@field@entrykey}%
+ \csuse\blx@bbl@data
+ \cslet\blx@bbl@data\@empty
+ \blx@bbl@addfield{entrykey}{\abx@field@entrykey}%
+ \blx@bbl@addfield{entrytype}{#2}%
+ \blx@imc@iffieldundef{options}
+ {}
+ {\blx@bbl@fieldedef{options}{\expandonce\abx@field@options}}}
\protected\def\blx@finentry{%
\unspace
\a:finentry
@@ -154,6 +264,10 @@
\global\let\biblatex:style\def
\fi
}
+
+\def\biblatex:style{}
+\Configure{biblatex-style}{}{}
+
\pend:def\at:docend{%
\ifx \UnDef\biblatex:style
\:warning{\string\Configure{biblatex-style}{\blx@cbxfile}{...}
@@ -165,15 +279,20 @@
\blx:item[#1]%
\ifhmode \spacefactor\blx@sf@par\fi
}
+\let\blx@resetpuncthook\@empty
+\let\blx@csq@ifkernmark\@empty
\newskip\blx@unitmark
\blx@unitmark=10pt plus 1pt minus 1pt
\let\abx@aux@page\@gobbletwo
+\let\abx@aux@fnpage\@gobbletwo
+\let\abx@aux@refsection\@gobbletwo
+\def\blx@aux@number#1#2#3#4{}
+\def\abx@aux@number#1#2#3#4{}
\AtEndDocument{%
\def\abx@aux@page#1#2{\blx@addpagesum{#1}{#2}}%
- \def\abx@aux@fnpage#1#2{\blx@addpagesum{#1}{#2}}}
-%
-\let\blx@resetpuncthook\@empty
-\let\blx@csq@ifkernmark\@empty
+ \def\abx@aux@fnpage#1#2{\blx@addpagesum{#1}{#2}}
+}
+
\def\blx@begunit{%
\toggletrue{blx@tempa}%
\iftoggle{blx@insert}%
@@ -206,8 +325,9 @@
\blx@csq@ifkernmark
{}%
{\penalty\@M
- \hskip-\blx@unitmark\relax
- \hskip\blx@unitmark\relax}%
+ \hskip-\blx@unitmark\relax
+ \hskip\blx@unitmark\relax
+ }%
\begingroup
\Configure{blx@unit}{}{}%
}
@@ -219,53 +339,79 @@
\unskip\unskip\unpenalty
\global\togglefalse{blx@lastins}%
\else
- \global\toggletrue{blx@insert}%
- \global\toggletrue{blx@lastins}%
- \fi
+ \global\toggletrue{blx@insert}%
+ \global\toggletrue{blx@lastins}%
+ \fi
}
\NewConfigure{blx@unit}{2}
\else
-
\fi
+
+
\NewConfigure{thebibliography}{4}
\append:def\blx@bibinit{\a:bibinit}%
\NewConfigure{bibinit}{1}%
\let\blx@anchors\@empty
\let\bib@field@entrykey\@empty
+
\protected\def\blx@anchor{%
\xifinlist{X\the\c@refsection -%@
-\bib@field@entrykey}{\blx@anchors}%
+ \bib@field@entrykey}{\blx@anchors}%
{}%
{\listxadd\blx@anchors{X\the\c@refsection -%@
-\bib@field@entrykey}%
+ \bib@field@entrykey}%
\hyper:natanchorstart{X\the\c@refsection -%@
-\bib@field@entrykey}%
+ \bib@field@entrykey}%
\hyper:natanchorend}}
+
\protected\def\blx@bibhyperref{%
\@ifnextchar[%]
{\blx@bibhyperref@i}%
{\blx@bibhyperref@i[\bib@field@entrykey]}}%
+
\long\def\blx@bibhyperref@i[#1]#2{%
\hyper:natlinkstart{X\the\c@refsection -%@
-#1}%
- #2\hyper:natlinkend}%
+ #1}%
+ #2\hyper:natlinkend}%
+
\protected\long\def\blx@bibhyperlink#1#2{%
- \hyper:natlinkstart{X\the\c@refsection --%:
-#1}%
- #2\hyper:natlinkend}%
+ \hyper:natlinkstart{X\the\c@refsection -%:
+ #1}%
+ #2\hyper:natlinkend}%
+
\protected\long\def\blx@bibhypertarget#1#2{%
\@bsphack
- \hyper:natanchorstart{X\the\c@refsection --%:
-#1}%
+ \hyper:natanchorstart{X\the\c@refsection -%:
+ #1}%
\@esphack
- #2\hyper:natanchorend}%
+ #2\hyper:natanchorend}%
+
\let\blx@ifhyperref\@firstoftwo
-\def\hyper:natanchorstart#1{\Link{}{#1}\EndLink}
+
+%\def\hyper:natanchorstart#1{\Link{}{#1}\EndLink}%
+%\def\hyper:natlinkstart#1{\Link{#1}{}}%
+
+\def\hyper:natanchorstart#1{%
+ \expandafter\ifx\csname QXpage.\thepage\endcsname\relax%
+ \Tag{)Qpage.\thepage}{\file:id}%
+ \HCode{<a id="page.\thepage"></a>}%
+ \expandafter\xdef\csname QXpage.\thepage\endcsname{0}%
+ \fi
+ \Link[\csname BibFileName\therefsection\endcsname]{}{#1}\EndLink}
\def\hyper:natanchorend{}
-\def\hyper:natlinkstart#1{\Link{#1}{}}
+\def\hyper:natlinkstart#1{%
+ \expandafter\ifx\csname QXpage.\thepage\endcsname\relax%
+ \Tag{)Qpage.\thepage}{\file:id}%
+ \HCode{<a id="page.\thepage"></a>}%
+ \expandafter\xdef\csname QXpage.\thepage\endcsname{0}%
+ \fi
+ \Link[\csname BibFileName\therefsection\endcsname]{#1}{}}
\def\hyper:natlinkend{\EndLink}
+\def\writeCiteLink#1{\immediate\write\@mainaux{%
+ \string\@namedef{#1.\thepage}{\FileName}}}
+\let\blx@addpagesum\@gobbletwo
\let\:temp\do
\def\do#1{%