| %% | |
| %% This is file `breakurl.sty', | |
| %% generated with the docstrip utility. | |
| %% | |
| %% The original source files were: | |
| %% | |
| %% breakurl.dtx (with options: `package') | |
| %% | |
| %% This is a generated file. | |
| %% | |
| %% Copyright (C) 2005 by Vilar Camara Neto. | |
| %% | |
| %% This file may be distributed and/or modified under the | |
| %% conditions of the LaTeX Project Public License, either | |
| %% version 1.2 of this license or (at your option) any later | |
| %% version. The latest version of this license is in: | |
| %% | |
| %% http://www.latex-project.org/lppl.txt | |
| %% | |
| %% and version 1.2 or later is part of all distributions of | |
| %% LaTeX version 1999/12/01 or later. | |
| %% | |
| %% Currently this work has the LPPL maintenance status "maintained". | |
| %% | |
| %% The Current Maintainer of this work is Vilar Camara Neto. | |
| %% | |
| %% This work consists of the files breakurl.dtx and | |
| %% breakurl.ins and the derived file breakurl.sty. | |
| %% | |
| \NeedsTeXFormat{LaTeX2e}[1999/12/01] | |
| \ProvidesPackage{breakurl} | |
| [2009/01/24 v1.30 Breakable hyperref URLs] | |
| \RequirePackage{xkeyval} | |
| \RequirePackage{ifpdf} | |
| \ifpdf | |
| % Dummy package options | |
| \DeclareOptionX{preserveurlmacro}{} | |
| \DeclareOptionX{hyphenbreaks}{} | |
| \DeclareOptionX{vertfit}{} | |
| \ProcessOptionsX\relax | |
| \PackageWarning{breakurl}{% | |
| You are using breakurl while processing via pdflatex.\MessageBreak | |
| \string\burl\space will be just a synonym of \string\url.\MessageBreak} | |
| \DeclareRobustCommand{\burl}{\url} | |
| \DeclareRobustCommand*{\burlalt}{\hyper@normalise\burl@alt} | |
| \def\burl@alt#1#2{\hyper@linkurl{\Hurl{#1}}{#2}} | |
| \expandafter\endinput | |
| \fi | |
| \@ifpackageloaded{hyperref}{}{% | |
| \PackageError{breakurl}{The breakurl depends on hyperref package}% | |
| {I can't do anything. Please type X <return>, edit the source file% | |
| \MessageBreak | |
| and add \string\usepackage\string{hyperref\string} before | |
| \string\usepackage\string{breakurl\string}.} | |
| \endinput | |
| } | |
| \newif\if@preserveurlmacro\@preserveurlmacrofalse | |
| \newif\if@burl@fitstrut\@burl@fitstrutfalse | |
| \newif\if@burl@fitglobal\@burl@fitglobalfalse | |
| \newtoks\burl@toks | |
| \let\burl@charlistbefore\empty | |
| \let\burl@charlistafter\empty | |
| \def\burl@addtocharlistbefore{\g@addto@macro\burl@charlistbefore} | |
| \def\burl@addtocharlistafter{\g@addto@macro\burl@charlistafter} | |
| \bgroup | |
| \catcode`\&=12\relax | |
| \hyper@normalise\burl@addtocharlistbefore{%} | |
| \hyper@normalise\burl@addtocharlistafter{:/.?#&_,;!} | |
| \egroup | |
| \def\burl@growmif#1#2{% | |
| \g@addto@macro\burl@mif{\def\burl@ttt{#1}\ifx\burl@ttt\@nextchar#2\else}% | |
| } | |
| \def\burl@growmfi{% | |
| \g@addto@macro\burl@mfi{\fi}% | |
| } | |
| \def\burl@defifstructure{% | |
| \let\burl@mif\empty | |
| \let\burl@mfi\empty | |
| \expandafter\@tfor\expandafter\@nextchar\expandafter:\expandafter=% | |
| \burl@charlistbefore\do{% | |
| \expandafter\burl@growmif\@nextchar\@burl@breakbeforetrue | |
| \burl@growmfi | |
| }% | |
| \expandafter\@tfor\expandafter\@nextchar\expandafter:\expandafter=% | |
| \burl@charlistafter\do{% | |
| \expandafter\burl@growmif\@nextchar\@burl@breakaftertrue | |
| \burl@growmfi | |
| }% | |
| } | |
| \AtEndOfPackage{\burl@defifstructure} | |
| \def\burl@setvertfit#1{% | |
| \lowercase{\def\burl@temp{#1}}% | |
| \def\burl@opt{local}\ifx\burl@temp\burl@opt | |
| \@burl@fitstrutfalse\@burl@fitglobalfalse | |
| \else\def\burl@opt{strut}\ifx\burl@temp\burl@opt | |
| \@burl@fitstruttrue\@burl@fitglobalfalse | |
| \else\def\burl@opt{global}\ifx\burl@temp\burl@opt | |
| \@burl@fitstrutfalse\@burl@fitglobaltrue | |
| \else | |
| \PackageWarning{breakurl}{Unrecognized vertfit option `\burl@temp'.% | |
| \MessageBreak | |
| Adopting default `local'} | |
| \@burl@fitstrutfalse\@burl@fitglobalfalse | |
| \fi\fi\fi | |
| } | |
| \DeclareOptionX{preserveurlmacro}{\@preserveurlmacrotrue} | |
| \DeclareOptionX{hyphenbreaks}{% | |
| \bgroup | |
| \catcode`\&=12\relax | |
| \hyper@normalise\burl@addtocharlistafter{-}% | |
| \egroup | |
| } | |
| \DeclareOptionX{vertfit}[local]{\burl@setvertfit{#1}} | |
| \ProcessOptionsX\relax | |
| \def\burl@hyper@linkurl#1#2{% | |
| \begingroup | |
| \hyper@chars | |
| \burl@condpdflink{#1}% | |
| \endgroup | |
| } | |
| \def\burl@condpdflink#1{% | |
| \literalps@out{ | |
| /burl@bordercolor {\@urlbordercolor} def | |
| /burl@border {\@pdfborder} def | |
| }% | |
| \if@burl@fitstrut | |
| \sbox\pdf@box{#1\strut}% | |
| \else\if@burl@fitglobal | |
| \sbox\pdf@box{\burl@url}% | |
| \else | |
| \sbox\pdf@box{#1}% | |
| \fi\fi | |
| \dimen@\ht\pdf@box\dimen@ii\dp\pdf@box | |
| \sbox\pdf@box{#1}% | |
| \ifdim\dimen@ii=\z@ | |
| \literalps@out{BU.SS}% | |
| \else | |
| \lower\dimen@ii\hbox{\literalps@out{BU.SS}}% | |
| \fi | |
| \ifHy@breaklinks\unhbox\else\box\fi\pdf@box | |
| \ifdim\dimen@=\z@ | |
| \literalps@out{BU.SE}% | |
| \else | |
| \raise\dimen@\hbox{\literalps@out{BU.SE}}% | |
| \fi | |
| \pdf@addtoksx{H.B}% | |
| } | |
| \DeclareRobustCommand*{\burl}{% | |
| \leavevmode | |
| \begingroup | |
| \let\hyper@linkurl=\burl@hyper@linkurl | |
| \catcode`\&=12\relax | |
| \hyper@normalise\burl@ | |
| } | |
| \DeclareRobustCommand*{\burlalt}{% | |
| \begingroup | |
| \let\hyper@linkurl=\burl@hyper@linkurl | |
| \catcode`\&=12\relax | |
| \hyper@normalise\burl@alt | |
| } | |
| \newif\if@burl@breakbefore | |
| \newif\if@burl@breakafter | |
| \newif\if@burl@prevbreakafter | |
| \bgroup | |
| \catcode`\&=12\relax | |
| \gdef\burl@#1{% | |
| \def\burl@url{#1}% | |
| \def\burl@urltext{#1}% | |
| \burl@doit | |
| } | |
| \gdef\burl@alt#1{% | |
| \def\burl@url{#1}% | |
| \hyper@normalise\burl@@alt | |
| } | |
| \gdef\burl@@alt#1{% | |
| \def\burl@urltext{#1}% | |
| \burl@doit | |
| } | |
| \gdef\burl@doit{% | |
| \burl@toks{}% | |
| \let\burl@UrlRight\UrlRight | |
| \let\UrlRight\empty | |
| \@burl@prevbreakafterfalse | |
| \@ifundefined{@urlcolor}{\Hy@colorlink\@linkcolor}{\Hy@colorlink\@urlcolor}% | |
| \expandafter\@tfor\expandafter\@nextchar\expandafter:\expandafter=% | |
| \burl@urltext\do{% | |
| \if@burl@breakafter\@burl@prevbreakaftertrue | |
| \else\@burl@prevbreakafterfalse\fi | |
| \@burl@breakbeforefalse | |
| \@burl@breakafterfalse | |
| \expandafter\burl@mif\burl@mfi | |
| \if@burl@breakbefore | |
| % Breakable if the current char is in the `can break before' list | |
| \burl@flush\linebreak[0]% | |
| \else | |
| \if@burl@prevbreakafter | |
| \if@burl@breakafter\else | |
| % Breakable if the current char is not in any of the `can break' | |
| % lists, but the previous is in the `can break after' list. | |
| % This mechanism accounts for sequences of `break after' characters, | |
| % where a break is allowed only after the last one | |
| \burl@flush\linebreak[0]% | |
| \fi | |
| \fi | |
| \fi | |
| \expandafter\expandafter\expandafter\burl@toks | |
| \expandafter\expandafter\expandafter{% | |
| \expandafter\the\expandafter\burl@toks\@nextchar}% | |
| }% | |
| \let\UrlRight\burl@UrlRight | |
| \burl@flush | |
| \literalps@out{BU.E}% | |
| \Hy@endcolorlink | |
| \endgroup | |
| } | |
| \egroup | |
| \def\the@burl@toks{\the\burl@toks} | |
| \def\burl@flush{% | |
| \expandafter\def\expandafter\burl@toks@def\expandafter{\the\burl@toks}% | |
| \literalps@out{/BU.L (\burl@url) def}% | |
| \hyper@linkurl{\expandafter\Hurl\expandafter{\burl@toks@def}}{\burl@url}% | |
| \global\burl@toks{}% | |
| \let\UrlLeft\empty | |
| }% | |
| \if@preserveurlmacro\else\let\url\burl\let\urlalt\burlalt\fi | |
| \AtBeginDvi{% | |
| \headerps@out{% | |
| /burl@stx null def | |
| /BU.S { | |
| /burl@stx null def | |
| } def | |
| /BU.SS { | |
| currentpoint | |
| /burl@lly exch def | |
| /burl@llx exch def | |
| burl@stx null ne {burl@endx burl@llx ne {BU.FL BU.S} if} if | |
| burl@stx null eq { | |
| burl@llx dup /burl@stx exch def /burl@endx exch def | |
| burl@lly dup /burl@boty exch def /burl@topy exch def | |
| } if | |
| burl@lly burl@boty gt {/burl@boty burl@lly def} if | |
| } def | |
| /BU.SE { | |
| currentpoint | |
| /burl@ury exch def | |
| dup /burl@urx exch def /burl@endx exch def | |
| burl@ury burl@topy lt {/burl@topy burl@ury def} if | |
| } def | |
| /BU.E { | |
| BU.FL | |
| } def | |
| /BU.FL { | |
| burl@stx null ne {BU.DF} if | |
| } def | |
| /BU.DF { | |
| BU.BB | |
| [ /H /I /Border [burl@border] /Color [burl@bordercolor] | |
| /Action << /Subtype /URI /URI BU.L >> /Subtype /Link BU.B /ANN pdfmark | |
| /burl@stx null def | |
| } def | |
| /BU.BB { | |
| burl@stx HyperBorder sub /burl@stx exch def | |
| burl@endx HyperBorder add /burl@endx exch def | |
| burl@boty HyperBorder add /burl@boty exch def | |
| burl@topy HyperBorder sub /burl@topy exch def | |
| } def | |
| /BU.B { | |
| /Rect[burl@stx burl@boty burl@endx burl@topy] | |
| } def | |
| /eop where { | |
| begin | |
| /@ldeopburl /eop load def | |
| /eop { SDict begin BU.FL end @ldeopburl } def | |
| end | |
| } { | |
| /eop { SDict begin BU.FL end } def | |
| } ifelse | |
| }% | |
| } | |
| \endinput | |
| %% | |
| %% End of file `breakurl.sty'. |