diff options
author | Karl Berry <karl@freefriends.org> | 2014-03-23 22:12:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-03-23 22:12:25 +0000 |
commit | 43f0cab68a9ea1b2cc9385df46487eb6f4cba012 (patch) | |
tree | b166042c22748d2090d128a93cd018421d3e54e4 /Master/texmf-dist/tex/latex | |
parent | 9abfc4f95bed4bf19e6ceb6bd34d9dc7e752f34d (diff) |
prerex (23mar14)
git-svn-id: svn://tug.org/texlive/trunk@33264 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/prerex/prerex.sty | 57 |
1 files changed, 41 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/latex/prerex/prerex.sty b/Master/texmf-dist/tex/latex/prerex/prerex.sty index 429c8171ecd..fe101470637 100644 --- a/Master/texmf-dist/tex/latex/prerex/prerex.sty +++ b/Master/texmf-dist/tex/latex/prerex/prerex.sty @@ -13,7 +13,7 @@ %% This work has the LPPL maintenance status "author-maintained". %% \NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesPackage{prerex}[2014/03/02 v6.4.1 LaTeX style for prerequisite charts, pgf version] +\ProvidesPackage{prerex}[2014/03/22 v6.5.0 LaTeX style for prerequisite charts, pgf version] % % Changelog is at the end of the file. % @@ -45,10 +45,12 @@ % \newlength{\unit} - +\newlength{\ppt} +\setlength{\ppt}{0.0138888888in} % one Postscript point = (1/72) in. \setlength{\unit}{5.7816pt} % 10 pixels per unit at 125dpi; 1pt = (1/72.27) in. \newcommand{\PixelsPerUnit}{10} \newcommand{\dpi}{125} +\newcommand{\ppi}{72} \RequirePackage{relsize} \RequirePackage{calc} @@ -69,7 +71,7 @@ \newcommand{\DefaultCurvature}{20} % where the argument should be in the range 0-100; 0 means no curvature. -\newcommand{\CourseURL}[3]{file:#3.html} +\newcommand{\CourseURL}[3]{#3.html} % where the arguments supplied at the call are the x and y coordinates % and the course code. @@ -79,7 +81,7 @@ \newcommand{\boldwidth}{1.0pt} \newcommand{\dottedwidth}{0.8pt} \newcommand{\dashedwidth}{0.5pt} -\newcommand{\smallersize}{\relsize{-2}} +\newcommand{\smallersize}{\relsize{-3}} \newcommand{\baselineAdj}{-0.5ex} \newcounter{@myangle} @@ -103,8 +105,11 @@ \fi \newcounter{chart} % in case there is more than one chart in the document -\newcounter{xNW}\newcounter{yNW} % coordinates of NW corner of a node -\newcounter{xSE}\newcounter{ySE} % coordinates of SE corner of a node +\newcounter{xNW}\newcounter{yNW} +\newcounter{xSE}\newcounter{ySE} +\newcounter{xSW}\newcounter{ySW} +\newcounter{xL}\newcounter{yL} +\newcounter{XSE}\newcounter{YSE} \def\@unitmult{\unit * 5} % used for the grid and as the minimum height of half-course boxes @@ -128,6 +133,16 @@ \addtocounter{ySE}{0 - (#2 + #5) * \PixelsPerUnit } % subtract # of pixels from origin to node (+#5) \immediate\write\@imapfile{<area shape=rect coords="\thexNW,\theyNW,\thexSE,\theySE" href="\CourseURL{#1}{#2}{#3}" target="new" alt="#3">}% + + \immediate\write\@linkfile{<a xlink:href="\CourseURL{#1}{#2}{#3}" target="course"> <rect fill-opacity="0.0" opacity="0.0"} + \setcounter{xSW}{1*\ratio{\zposx{gridOrigin_\thechart}sp}{\ppt}} % # points from left edge to origin + \addtocounter{xSW}{(#1-#4)*\ratio{\unit}{\ppt}} % add # points from origin to node (-#4 chart units) + \setcounter{ySW}{1*\ratio{\paperheight}{\ppt}} + \addtocounter{ySW}{0-1*\ratio{\zposy{gridOrigin_\thechart}sp}{\ppt}} + \addtocounter{ySW}{0-(#2+#5)*\ratio{\unit}{\ppt}} + \setcounter{xL}{2*(#4)*\ratio{\unit}{\ppt}} + \setcounter{yL}{2*(#5)*\ratio{\unit}{\ppt}} + \immediate\write\@linkfile{x="\thexSW" y="\theySW" width="\thexL" height="\theyL"/></a>} \fi } @@ -611,13 +626,16 @@ \ifpdf \newwrite\@imapfile % image-map data - \newwrite\@scriptfile % shell script to generate image file + \newwrite\@scriptfile % shell script to crop PNG image + \newwrite\@linkfile % link data for SVG \ifnum\value{chart}=0 \immediate\openout\@imapfile=\jobname.map \immediate\write\@imapfile{<map name="\jobname">} + \immediate\openout\@linkfile=\jobname.dat \else \immediate\openout\@imapfile=\jobname_\thechart.map \immediate\write\@imapfile{<map name="\jobname_\thechart">} + \immediate\openout\@linkfile=\jobname_\thechart.dat \fi \fi @@ -656,21 +674,23 @@ \end{tikzpicture} \ifpdf \write\@imapfile{</map>} + \write\@linkfile{</svg>} \closeout\@imapfile + \closeout\@linkfile \zsavepos{EndOfChart_\thechart} % determine cropping coordinates \ifdim\paperwidth<\paperheight % portrait mode - \setcounter{xSE}{\dpi * \ratio{\zposx{EndOfChart_\thechart}sp}{1in}}% - \setcounter{ySE}{ \dpi * \ratio{\paperheight}{1in}} - \addtocounter{ySE}{0 - \dpi * \ratio{\zposy{EndOfChart_\thechart}sp}{1in}} - \addtocounter{ySE}{0 + 2 * \PixelsPerUnit } % bottom margin + \setcounter{XSE}{\dpi * \ratio{\zposx{EndOfChart_\thechart}sp}{1in}}% + \setcounter{YSE}{ \dpi * \ratio{\paperheight}{1in}} + \addtocounter{YSE}{0 - \dpi * \ratio{\zposy{EndOfChart_\thechart}sp}{1in}} + \addtocounter{YSE}{0 + 2 * \PixelsPerUnit } % bottom margin \else % landscape mode - \setcounter{xSE}{ \dpi * \ratio{\paperwidth}{1in}} - \addtocounter{xSE}{0 - \dpi * \ratio{\zposx{EndOfChart_\thechart}sp}{1in}}% + \setcounter{XSE}{ \dpi * \ratio{\paperwidth}{1in}} + \addtocounter{XSE}{0 - \dpi * \ratio{\zposx{EndOfChart_\thechart}sp}{1in}}% \addtocounter{xSE}{0 + 2 * \PixelsPerUnit } % bottom margin - \setcounter{ySE}{ \dpi * \ratio{\paperheight}{1in}} - \addtocounter{ySE}{ 0 - \dpi * \ratio{\zposy{EndOfChart_\thechart}sp}{1in}} + \setcounter{YSE}{ \dpi * \ratio{\paperheight}{1in}} + \addtocounter{YSE}{ 0 - \dpi * \ratio{\zposy{EndOfChart_\thechart}sp}{1in}} \fi \edef\HasH{\expandafter\@gobble\string\#} \ifnum\value{chart}=0 @@ -678,7 +698,7 @@ \immediate\openout\@scriptfile=\jobname.sh \immediate\write\@scriptfile{\HasH!/bin/sh} % defer remaining output till cropping coordinates are available - \write\@scriptfile{mogrify -crop \thexSE x\theySE +0+0 \jobname.png} + \write\@scriptfile{mogrify -crop \theXSE x\theYSE +0+0 \jobname.png} \write\@scriptfile{exit 0} \closeout\@scriptfile \fi % more than one chart? unlikely a cropping script would be usable @@ -688,6 +708,11 @@ % % Changelog: % +% Version 6.5.0 +% +% pdflatex processing now generates an auxiliary file \jobname.dat of link data +% for use with a SVG image +% % Version 6.4.1 % % Set length=4pt for arrow tips in tikzpicture options. |