summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/asyfig/asyalign.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-06-24 16:44:01 +0000
committerKarl Berry <karl@freefriends.org>2009-06-24 16:44:01 +0000
commitc68f9012130bdc604769e59229abefc28ac1cf04 (patch)
treed94971f342c4ea8f9cbdcf4486ec1673bde87a16 /Master/texmf-dist/tex/latex/asyfig/asyalign.sty
parent4873be2e9722a5d9a95aa8edb9859d735853ab27 (diff)
new latex package asyfig (23jun09)
git-svn-id: svn://tug.org/texlive/trunk@13944 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/asyfig/asyalign.sty')
-rw-r--r--Master/texmf-dist/tex/latex/asyfig/asyalign.sty55
1 files changed, 55 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/asyfig/asyalign.sty b/Master/texmf-dist/tex/latex/asyfig/asyalign.sty
new file mode 100644
index 00000000000..1bc05a30f7d
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/asyfig/asyalign.sty
@@ -0,0 +1,55 @@
+%% LaTeX2e file `asyalign.sty'
+%% generated by the `filecontents' environment
+%% from source `asyfig' on 2009/06/24.
+%%
+\ProvidesPackage{asyalign}
+
+% This package provides code for placing Asymptote labels inline in \LaTeX\ documents. It is adapted from code that is usually included within Aymptote's \<filename>|_.pre| file, which provides a \LaTeX\ preamble for |asy| processing; this preamble is skipped with the \pkg{asyfig} package since all figures inherit the preamble from that of the main document.
+
+\RequirePackage{ifpdf}
+
+\newbox\ASYbox
+\newdimen\ASYdimen
+
+\def\ASYbase#1#2{%
+ \setbox\ASYbox=\hbox{#1}%
+ \ASYdimen=\ht\ASYbox
+ \setbox\ASYbox=\hbox{#2}%
+ \lower\ASYdimen\box\ASYbox}
+
+\ifpdf
+ \def\ASYalign(#1,#2)(#3,#4)#5#6{%
+ \leavevmode
+ \setbox\ASYbox=\hbox{#6}%
+ \setbox\ASYbox\hbox{%
+ \kern#3\wd\ASYbox
+ \raise#4\dimexpr\ht\ASYbox+\dp\ASYbox\relax\box\ASYbox}%
+ \put(#1,#2){%
+ \special{pdf:q #5 0 0 cm}%
+ \wd\ASYbox\z@\dp\ASYbox\z@\ht\ASYbox\z@
+ \box\ASYbox
+ \special{pdf:Q}%
+ }}
+ \let\ASYraw\@firstofone
+
+\else
+ \def\ASYalign(#1,#2)(#3,#4)#5#6{%
+ \leavevmode
+ \setbox\ASYbox=\hbox{#6}%
+ \setbox\ASYbox\hbox{%
+ \kern#3\wd\ASYbox
+ \raise#4\dimexpr\ht\ASYbox+\dp\ASYbox\relax\box\ASYbox}%
+ \put(#1,#2){%
+ \special{%
+ ps:gsave currentpoint currentpoint translate
+ [#5 0 0] concat neg exch neg exch translate}%
+ \box\ASYbox
+ \special{ps:currentpoint grestore moveto}%
+ }}
+ \def\ASYraw#1{%
+ currentpoint currentpoint translate matrix currentmatrix
+ 100 12 div -100 12 div scale
+ #1
+ setmatrix neg exch neg exch translate}
+\fi
+