diff options
author | Karl Berry <karl@freefriends.org> | 2011-04-22 23:36:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-04-22 23:36:31 +0000 |
commit | cd62c624e149e4c29e0e7aa29c016ae8b45cf086 (patch) | |
tree | 1279b8e45d65cd3fd93975997a8d3db844722b28 /Master/texmf-dist/source/latex/oberdiek/bookmark.dtx | |
parent | 2be6eaeb8090315538ca23046d0fbc8ffce6acdd (diff) |
oberdiek (22apr11)
git-svn-id: svn://tug.org/texlive/trunk@22162 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/bookmark.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/bookmark.dtx | 184 |
1 files changed, 164 insertions, 20 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/bookmark.dtx b/Master/texmf-dist/source/latex/oberdiek/bookmark.dtx index 3679163b57e..e4603494c7e 100644 --- a/Master/texmf-dist/source/latex/oberdiek/bookmark.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/bookmark.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % % File: bookmark.dtx -% Version: 2011/04/13 v1.20 +% Version: 2011/04/21 v1.21 % % Copyright (C) 2007-2011 by % Heiko Oberdiek <heiko.oberdiek at googlemail.com> @@ -84,7 +84,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: bookmark 2011/04/13 v1.20 PDF bookmarks (HO)} +\Msg{* Package: bookmark 2011/04/21 v1.21 PDF bookmarks (HO)} \Msg{************************************************************************} \keepsilent @@ -96,7 +96,7 @@ This is a generated file. Project: bookmark -Version: 2011/04/13 v1.20 +Version: 2011/04/21 v1.21 Copyright (C) 2007-2011 by Heiko Oberdiek <heiko.oberdiek at googlemail.com> @@ -166,7 +166,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bookmark.drv}% - [2011/04/13 v1.20 PDF bookmarks (HO)]% + [2011/04/21 v1.21 PDF bookmarks (HO)]% \documentclass{ltxdoc} \usepackage{holtxdoc}[2011/02/04] \begin{document} @@ -175,7 +175,7 @@ and the derived files %</driver> % \fi % -% \CheckSum{2225} +% \CheckSum{2323} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -196,7 +196,7 @@ and the derived files % \GetFileInfo{bookmark.drv} % % \title{The \xpackage{bookmark} package} -% \date{2011/04/13 v1.20} +% \date{2011/04/21 v1.21} % \author{Heiko Oberdiek\\\xemail{heiko.oberdiek at googlemail.com}} % % \maketitle @@ -224,7 +224,8 @@ and the derived files % \item More actions than simple GoTo actions are possible. % \end{itemize} % -% In the same way as \xpackage{hyperref} the bookmarks are generated +% In the same way as \xpackage{hyperref} \cite{hyperref} +% the bookmarks are generated % in the order of the bookmark generating macros (\cs{bookmark}). % A level number is used to define the tree structure of the bookmarks. % The restrictions are less strict: @@ -391,6 +392,30 @@ and the derived files % \end{tabular} % \end{quote} % +% \paragraph{Missing actions.} +% If the action is missing package \xpackage{bookmark} throws +% an error message. Depending on the driver (\xoption{pdftex}, +% \xoption{dvips} and friends) the package detects it quite late +% at the end of the document. Since version 2011/04/21 v1.21 +% the package tries printing the line number and file name +% of the corresponding occurence of \cs{bookmark}. +% However, \hologo{TeX} does provide the line number, but +% unhappily the file name is a secret. The package supports +% some ways to get the file name: +% \begin{itemize} +% \item If \hologo{LuaTeX} (indenpendently from DVI or PDF modus) +% is running, then its |status.filename| is used automatically. +% \item Package \cs{currfile} \cite{currfile} redefines \hologo{LaTeX} +% internals to keep track of the file name. If the package +% is loaded, then its \cs{currfilepath} is detected and used +% automatically by package \xpackage{bookmark}. +% \item The file name can be set manually by option \xoption{scrfile} +% in \cs{bookmarksetup} or \cs{bookmark}. But be careful, +% manual setting disables the previous ways for file name +% detection. And a wrong or missed file name setting might +% get you a wrong source location in the error message. +% \end{itemize} +% % \subsubsection{Level options} % % The order of the bookmark entries are defined by the @@ -631,7 +656,7 @@ and the derived files open, openlevel=2, atend -]{bookmark}[2011/04/13] +]{bookmark}[2011/04/21] \bookmarksetup{color=blue} @@ -734,7 +759,7 @@ and the derived files %<*package> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{bookmark}% - [2011/04/13 v1.20 PDF bookmarks (HO)]% + [2011/04/21 v1.21 PDF bookmarks (HO)]% % \end{macrocode} % % \subsubsection{Requirements} @@ -813,14 +838,15 @@ and the derived files \RequirePackage{ifpdf}[2009/04/10] \RequirePackage{ifxetex} \RequirePackage{ifvtex}[2008/11/04] +\RequirePackage{ifluatex}[2010/03/01] \RequirePackage{pdftexcmds}[2010/11/04] \RequirePackage{hyperref}[2010/06/18] \RequirePackage{auxhook}[2007/04/06] \RequirePackage{kvsetkeys}[2010/03/01] \RequirePackage{kvoptions}[2009/08/13] \RequirePackage{hycolor}[2008/09/08] -\RequirePackage{bitset} -\RequirePackage{ltxcmds}[2010/04/08] +\RequirePackage{bitset}[2011/01/30] +\RequirePackage{ltxcmds}[2011/04/14] % \end{macrocode} % % \subsubsection{Package options} @@ -846,6 +872,8 @@ and the derived files page,% rawaction,% rellevel,% + srcfile,% + srcline,% startatroot,% uri,% view,% @@ -1561,6 +1589,13 @@ and the derived files % \end{macrocode} % \end{macro} % +% \subsubsection{Options for source file location} +% +% \begin{macrocode} +\DeclareStringOption{srcline} +\DeclareStringOption{srcfile} +% \end{macrocode} +% % \subsubsection{Hook support} % % \begin{macro}{\BKM@hook} @@ -1845,7 +1880,7 @@ and the derived files %<*dvipdfm> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-dvipdfm.def}% - [2011/04/13 v1.20 bookmark driver for dvipdfm (HO)]% + [2011/04/21 v1.21 bookmark driver for dvipdfm (HO)]% % \end{macrocode} % % \begin{macro}{\BKM@id} @@ -2020,7 +2055,7 @@ and the derived files %<*vtex> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-vtex.def}% - [2011/04/13 v1.20 bookmark driver for VTeX (HO)]% + [2011/04/21 v1.21 bookmark driver for VTeX (HO)]% % \end{macrocode} % % \begin{macrocode} @@ -2351,7 +2386,7 @@ and the derived files %<*pdftex> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-pdftex.def}% - [2011/04/13 v1.20 bookmark driver for pdfTeX (HO)]% + [2011/04/21 v1.21 bookmark driver for pdfTeX (HO)]% % \end{macrocode} % % \begin{macro}{\BKM@DO@entry} @@ -2360,6 +2395,10 @@ and the derived files \begingroup \kvsetkeys{BKM@DO}{#1}% \def\BKM@DO@title{#2}% + \ifx\BKM@DO@srcfile\@empty + \else + \BKM@UnescapeHex\BKM@DO@srcfile + \fi \BKM@UnescapeHex\BKM@DO@title \expandafter\expandafter\expandafter\BKM@getx \csname BKM@\BKM@DO@id\endcsname\@empty\@empty @@ -2383,7 +2422,9 @@ and the derived files \ifx\BKM@DO@rawaction\@empty \ifx\BKM@DO@uri\@empty \ifx\BKM@DO@page\@empty - \PackageError{bookmark}{Missing action}\@ehc + \PackageError{bookmark}{% + Missing action\BKM@SourceLocation + }\@ehc \edef\BKM@action{goto page1{/Fit}}% \else \ifx\BKM@DO@view\@empty @@ -2461,11 +2502,38 @@ and the derived files } % \end{macrocode} % \end{macro} -% % \begin{macrocode} %</pdftex> % \end{macrocode} % +% \begin{macrocode} +%<*pdftex|pdfmark> +% \end{macrocode} +% \begin{macro}{\BKM@SourceLocation} +% \begin{macrocode} +\def\BKM@SourceLocation{% + \ifx\BKM@DO@srcfile\@empty + \ifx\BKM@DO@srcline\@empty + \else + .\MessageBreak + Source: line \BKM@DO@srcline + \fi + \else + \ifx\BKM@DO@srcline\@empty + .\MessageBreak + Source: file `\BKM@DO@srcfile'% + \else + .\MessageBreak + Source: file `\BKM@DO@srcfile', line \BKM@DO@srcline + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +%</pdftex|pdfmark> +% \end{macrocode} +% % \subsection{Drivers with pdfmark specials} % % \subsubsection{Driver dvips} @@ -2474,7 +2542,7 @@ and the derived files %<*dvips> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-dvips.def}% - [2011/04/13 v1.20 bookmark driver for dvips (HO)]% + [2011/04/21 v1.21 bookmark driver for dvips (HO)]% % \end{macrocode} % \begin{macro}{\BKM@PSHeaderFile} % \begin{macrocode} @@ -2493,7 +2561,7 @@ and the derived files %<*dvipsone> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-dvipsone.def}% - [2011/04/13 v1.20 bookmark driver for dvipsone (HO)]% + [2011/04/21 v1.21 bookmark driver for dvipsone (HO)]% % \end{macrocode} % \begin{macro}{\BKM@PSHeaderFile} % \begin{macrocode} @@ -2512,7 +2580,7 @@ and the derived files %<*textures> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bkm-textures.def}% - [2011/04/13 v1.20 bookmark driver for textures (HO)]% + [2011/04/21 v1.21 bookmark driver for textures (HO)]% % \end{macrocode} % \begin{macro}{\BKM@PSHeaderFile} % \begin{macrocode} @@ -2584,6 +2652,10 @@ and the derived files \def\BKM@DO@entry#1#2{% \begingroup \kvsetkeys{BKM@DO}{#1}% + \ifx\BKM@DO@srcfile\@empty + \else + \BKM@UnescapeHex\BKM@DO@srcfile + \fi \def\BKM@DO@title{#2}% \BKM@UnescapeHex\BKM@DO@title \expandafter\expandafter\expandafter\BKM@getx @@ -2604,7 +2676,9 @@ and the derived files \ifx\BKM@DO@rawaction\@empty \ifx\BKM@DO@uri\@empty \ifx\BKM@DO@page\@empty - \PackageError{bookmark}{Missing action}\@ehc + \PackageError{bookmark}{% + Missing action\BKM@SourceLocation + }\@ehc \edef\BKM@action{% /Action/GoTo% /Page 1% @@ -2741,8 +2815,13 @@ and the derived files \newcommand*{\bookmark}[2][]{% \if@filesw \begingroup + \BKM@InitSourceLocation \def\bookmark@text{#2}% \BKM@setup{#1}% + \ifx\BKM@srcfile\@empty + \else + \BKM@EscapeHex\BKM@srcfile + \fi \edef\BKM@prev{\the\BKM@id}% \global\advance\BKM@id\@ne \BKM@swtrue @@ -2799,6 +2878,8 @@ and the derived files \ifnum\BKM@FLAGS>\z@ ,flags=\BKM@FLAGS \fi + \BKM@auxentry{srcline}% + \BKM@auxentry{srcfile}% }{\BKM@title}% }% \endgroup @@ -2826,6 +2907,46 @@ and the derived files % \end{macrocode} % \end{macro} % +% \begin{macro}{\BKM@InitSourceLocation} +% \begin{macrocode} +\def\BKM@InitSourceLocation{% + \edef\BKM@srcline{\the\inputlineno}% + \BKM@LuaTeX@InitFile + \ifx\BKM@srcfile\@empty + \ltx@IfUndefined{currfilepath}{}{% + \edef\BKM@srcfile{\currfilepath}% + }% + \fi +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\BKM@LuaTeX@InitFile} +% \begin{macrocode} +\ifluatex + \ifnum\luatexversion>36 % + \def\BKM@LuaTeX@InitFile{% + \begingroup + \ltx@LocToksA={}% + \edef\x{\endgroup + \def\noexpand\BKM@srcfile{% + \the\expandafter\ltx@LocToksA + \directlua{% + if status and status.filename then % + tex.settoks('ltx@LocToksA', status.filename)% + end% + }% + }% + }\x + }% + \else + \let\BKM@LuaTeX@InitFile\relax + \fi +\else + \let\BKM@LuaTeX@InitFile\relax +\fi +% \end{macrocode} +% \end{macro} +% % \subsubsection{Read auxiliary data} % % \begin{macrocode} @@ -2841,6 +2962,8 @@ and the derived files \DeclareStringOption{page} \DeclareStringOption{view} \DeclareStringOption{rawaction} +\DeclareStringOption{srcline} +\DeclareStringOption{srcfile} % \end{macrocode} % % \begin{macrocode} @@ -3125,6 +3248,22 @@ and the derived files %\end{verbatim} % \end{quote} % +% \begin{thebibliography}{9} +% +% \bibitem{hyperref} +% Sebastian Rahtz, Heiko Oberdiek: +% \textit{The \xpackage{hyperref} package}; +% 2011/04/17 v6.82g; +% \CTAN{macros/latex/contrib/hyperref/} +% +% \bibitem{currfile} +% Martin Scharrer: +% \textit{The \xpackage{currfile} package}; +% 2011/01/09 v0.4. +% \CTAN{macros/latex/contrib/currfile/} +% +% \end{thebibliography} +% % \begin{History} % \begin{Version}{2007/02/19 v0.1} % \item @@ -3295,6 +3434,11 @@ and the derived files % \item % Bug fix: \cs{BKM@SetDepth} renamed to \cs{BKM@SetDepthOrLevel}. % \end{Version} +% \begin{Version}{2011/04/21 v1.21} +% \item +% Some support for file name and line number in error messages +% at end of document (pdfTeX and pdfmark based drivers). +% \end{Version} % \end{History} % % \PrintIndex |