Initial package
Signed-off-by: herengui <herengui@uniontech.com>
This commit is contained in:
parent
f0fb715d82
commit
8a52eccf31
12
asymptote-2.08-info-path-fix.patch
Normal file
12
asymptote-2.08-info-path-fix.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -up asymptote-2.08/doc/asymptote.texi.BAD asymptote-2.08/doc/asymptote.texi
|
||||
--- asymptote-2.08/doc/asymptote.texi.BAD 2011-03-08 11:42:17.349734001 -0500
|
||||
+++ asymptote-2.08/doc/asymptote.texi 2011-03-08 11:42:21.462734066 -0500
|
||||
@@ -21,7 +21,7 @@ file LICENSE in the top-level source dir
|
||||
|
||||
@dircategory Languages
|
||||
@direntry
|
||||
-* asymptote: (asymptote/asymptote). Vector graphics language.
|
||||
+* asymptote: (asymptote). Vector graphics language.
|
||||
@end direntry
|
||||
|
||||
@titlepage
|
||||
20
asymptote-2.43-libtirpc.patch
Normal file
20
asymptote-2.43-libtirpc.patch
Normal file
@ -0,0 +1,20 @@
|
||||
diff -up asymptote-2.45/configure.ac.libtirpc asymptote-2.45/configure.ac
|
||||
--- asymptote-2.45/configure.ac.libtirpc 2018-07-24 13:10:39.495098939 -0400
|
||||
+++ asymptote-2.45/configure.ac 2018-07-24 13:13:03.640110265 -0400
|
||||
@@ -282,6 +282,16 @@ AC_CHECK_HEADERS([fenv.h stddef.h libint
|
||||
AC_CHECK_HEADERS(fpu_control.h)
|
||||
AC_CHECK_FUNCS([feenableexcept])
|
||||
|
||||
+PKG_PROG_PKG_CONFIG([0.9.0])
|
||||
+AS_IF(
|
||||
+ [test "$enable_tirpc" != "no"],
|
||||
+ [PKG_CHECK_MODULES([TIRPC], [libtirpc >= 0.2.4],
|
||||
+ [LIBS="${LIBS} ${TIRPC_LIBS}"
|
||||
+ CPPFLAGS="${CPPFLAGS} ${TIRPC_CFLAGS}"
|
||||
+ AC_DEFINE([HAVE_LIBTIRPC], [1],
|
||||
+ [Define to 1 if you have and wish to use libtirpc.])],
|
||||
+ [AS_IF([test "$enable_tirpc" != "no"], [AC_MSG_ERROR([libtirpc not found.])],
|
||||
+ [LIBTIRPC=""])])])
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "xstream.h"])],
|
||||
[AC_SEARCH_LIBS([xdrstdio_create],[nsl tirpc])
|
||||
24
asymptote-2.52-const-memrchr.patch
Normal file
24
asymptote-2.52-const-memrchr.patch
Normal file
@ -0,0 +1,24 @@
|
||||
diff -up asymptote-2.52/prc/PRCdouble.cc.const-memrchr asymptote-2.52/prc/PRCdouble.cc
|
||||
--- asymptote-2.52/prc/PRCdouble.cc.const-memrchr 2019-08-14 11:17:29.996063195 -0400
|
||||
+++ asymptote-2.52/prc/PRCdouble.cc 2019-08-14 11:18:02.232408054 -0400
|
||||
@@ -24,7 +24,7 @@ int stCOFDOECompare(const void* pcofdoe1
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#ifndef HAVE_MEMRCHR
|
||||
-void *memrchr(const void *buf,int c,size_t count)
|
||||
+const void *memrchr(const void *buf,int c,size_t count)
|
||||
{
|
||||
unsigned char
|
||||
*pcBuffer=(unsigned char *)buf,
|
||||
diff -up asymptote-2.52/prc/PRCdouble.h.const-memrchr asymptote-2.52/prc/PRCdouble.h
|
||||
--- asymptote-2.52/prc/PRCdouble.h.const-memrchr 2019-08-09 04:24:30.000000000 -0400
|
||||
+++ asymptote-2.52/prc/PRCdouble.h 2019-08-10 07:28:58.363622539 -0400
|
||||
@@ -133,7 +133,7 @@ int stCOFDOECompare(const void*,const vo
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#ifndef HAVE_MEMRCHR
|
||||
-void *memrchr(const void *,int,size_t);
|
||||
+const void *memrchr(const void *,int,size_t);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
21
asymptote-2.63-freeglut.patch
Normal file
21
asymptote-2.63-freeglut.patch
Normal file
@ -0,0 +1,21 @@
|
||||
diff -up asymptote-2.63/glrender.h.freeglut asymptote-2.63/glrender.h
|
||||
--- asymptote-2.63/glrender.h.freeglut 2020-03-03 11:21:56.192722722 -0500
|
||||
+++ asymptote-2.63/glrender.h 2020-03-03 11:22:18.496273099 -0500
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <OpenGL/gl.h>
|
||||
|
||||
#ifdef HAVE_LIBGLUT
|
||||
-#include <GLUT/glut.h>
|
||||
+#include <GLUT/freeglut.h>
|
||||
#ifndef GLUT_3_2_CORE_PROFILE
|
||||
#undef HAVE_GL
|
||||
#endif
|
||||
@@ -58,7 +58,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBGLUT
|
||||
-#include <GL/glut.h>
|
||||
+#include <GL/freeglut.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBOSMESA
|
||||
16
asymptote-2.67-settings.patch
Normal file
16
asymptote-2.67-settings.patch
Normal file
@ -0,0 +1,16 @@
|
||||
diff -up asymptote-2.67/settings.cc.settings asymptote-2.67/settings.cc
|
||||
--- asymptote-2.67/settings.cc.settings 2020-08-06 11:49:53.902137481 -0400
|
||||
+++ asymptote-2.67/settings.cc 2020-08-06 11:51:55.500637009 -0400
|
||||
@@ -100,9 +100,9 @@ string defaultPSViewer="open";
|
||||
string defaultPDFViewer="open";
|
||||
string defaultHTMLViewer="open";
|
||||
#else
|
||||
-string defaultPSViewer="gv";
|
||||
-string defaultPDFViewer="acroread";
|
||||
-string defaultHTMLViewer="google-chrome";
|
||||
+string defaultPSViewer="evince";
|
||||
+string defaultPDFViewer="evince";
|
||||
+string defaultHTMLViewer="xdg-open";
|
||||
#endif
|
||||
string defaultGhostscript="gs";
|
||||
string defaultGhostscriptLibrary="";
|
||||
10
asymptote-2.70-remove-old-setpdfwrite.patch
Normal file
10
asymptote-2.70-remove-old-setpdfwrite.patch
Normal file
@ -0,0 +1,10 @@
|
||||
diff -urNB asymptote-2.70-orig/patches/dvipdf asymptote-2.70/patches/dvipdf
|
||||
--- asymptote-2.70-orig/patches/dvipdf 2021-06-16 09:46:49.248321403 +0200
|
||||
+++ asymptote-2.70/patches/dvipdf 2021-06-16 10:22:29.276677871 +0200
|
||||
@@ -50,5 +50,5 @@
|
||||
|
||||
# We have to include the options twice because -I only takes effect if it
|
||||
# appears before other options.
|
||||
-exec dvips $DVIPSOPTIONS -q -f "$infile" | $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sstdout=%stderr -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite -
|
||||
+exec dvips $DVIPSOPTIONS -q -f "$infile" | $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sstdout=%stderr -sOutputFile="$outfile" $OPTIONS -c 3000000 setvmthreshold -
|
||||
|
||||
BIN
asymptote-2.70.src.tgz
Normal file
BIN
asymptote-2.70.src.tgz
Normal file
Binary file not shown.
144
asymptote.spec
Normal file
144
asymptote.spec
Normal file
@ -0,0 +1,144 @@
|
||||
%{!?_texmf: %global _texmf %(eval "echo `kpsewhich -expand-var '$TEXMFMAIN'`")}
|
||||
|
||||
%global optflags %{optflags} -DGLM_ENABLE_EXPERIMENTAL
|
||||
|
||||
Name: asymptote
|
||||
Version: 2.70
|
||||
Release: 1
|
||||
Summary: Descriptive vector graphics language
|
||||
License: LGPLv3+
|
||||
URL: http://asymptote.sourceforge.net/
|
||||
Source0: http://download.sourceforge.net/sourceforge/asymptote/asymptote-%{version}.src.tgz
|
||||
Source1: asy.gif
|
||||
Source2: xasy.desktop
|
||||
Source3: asymptote.sty.204
|
||||
Patch0: asymptote-2.67-settings.patch
|
||||
# This doesn't need to go upstream. We put the info file in the topdir, not a subdir, so we need this fix.
|
||||
Patch3: asymptote-2.08-info-path-fix.patch
|
||||
# Use libtirpc if found
|
||||
Patch4: asymptote-2.43-libtirpc.patch
|
||||
# memrchr value does not match hardcoded one in /usr/include/string.h
|
||||
# only conflicts on s390x
|
||||
Patch5: asymptote-2.52-const-memrchr.patch
|
||||
Patch6: asymptote-2.63-freeglut.patch
|
||||
# removes .setpdfwrite from ghostscript call in dvipdf (#1968328)
|
||||
Patch7: asymptote-2.70-remove-old-setpdfwrite.patch
|
||||
|
||||
BuildRequires: gcc-c++, ncurses-devel, readline-devel, fftw-devel >= 3.0, gc-devel >= 6.8
|
||||
BuildRequires: gsl-devel, tex(latex), tex(epsf.tex), tex(cm-super-t1.enc), tex(parskip.sty)
|
||||
BuildRequires: ghostscript, texinfo-tex, ImageMagick, desktop-file-utils, freeglut-devel
|
||||
BuildRequires: zlib-devel, libtool, mesa-libOSMesa-devel, emacs, libtirpc-devel
|
||||
BuildRequires: ghostscript-tools-dvipdf, glm-devel, make
|
||||
Requires: emacs-filesystem >= %{_emacs_version}
|
||||
# Cleanup
|
||||
Provides: emacs-%{name} = %{version}-%{release}
|
||||
Obsoletes: emacs-%{name} <= 2.35
|
||||
Provides: emacs-%{name}-el = %{version}-%{release}
|
||||
Obsoletes: emacs-%{name}-el <= 2.35
|
||||
|
||||
Requires: tex(latex), python3-qt5, python3-speg, python3-cson, python3-tkinter, python3-imaging-tk, python3-numpy
|
||||
Recommends: evince, xdg-utils
|
||||
|
||||
# for /usr/bin/texhash
|
||||
Requires(post): texlive-kpathsea-bin, tex-kpathsea
|
||||
Requires(postun): texlive-kpathsea-bin, tex-kpathsea
|
||||
|
||||
%define texpkgdir %{_texmf}/tex/latex/%{name}
|
||||
|
||||
%description
|
||||
Asymptote is a powerful descriptive vector graphics language for technical
|
||||
drawings, inspired by MetaPost but with an improved C++-like syntax.
|
||||
Asymptote provides for figures the same high-quality level of typesetting
|
||||
that LaTeX does for scientific text.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1 -b .settings
|
||||
%patch3 -p1 -b .path-fix
|
||||
%patch4 -p1 -b .libtirpc
|
||||
%patch5 -p1 -b .const-memrchr
|
||||
%patch6 -p1 -b .glut
|
||||
%patch7 -p1
|
||||
%{__sed} -i 's/\r//' doc/CAD1.asy
|
||||
|
||||
# convert to UTF-8
|
||||
iconv -f iso-8859-1 -t utf-8 -o examples/interpolate1.asy{.utf8,}
|
||||
mv examples/interpolate1.asy{.utf8,}
|
||||
autoreconf -i
|
||||
|
||||
%build
|
||||
%configure --enable-gc=system \
|
||||
--with-docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}/} \
|
||||
--with-latex=%{_texmf}/tex/latex \
|
||||
--with-context=%{_texmf}/tex/context/
|
||||
make %{?_smp_mflags}
|
||||
cd doc/
|
||||
make all
|
||||
|
||||
%install
|
||||
%make_install
|
||||
|
||||
install -p -m 644 BUGS ChangeLog LICENSE README ReleaseNotes TODO \
|
||||
%{buildroot}%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
|
||||
|
||||
# Emacs files
|
||||
mkdir -p %{buildroot}%{_emacs_sitestartdir}
|
||||
mkdir -p %{buildroot}%{_emacs_sitelispdir}/%{name}
|
||||
cp -a %{buildroot}%{_datadir}/%{name}/*.el %{buildroot}%{_emacs_sitelispdir}/%{name}
|
||||
mv %{buildroot}%{_emacs_sitelispdir}/%{name}/asy-init.el %{buildroot}%{_emacs_sitestartdir}
|
||||
for i in %{buildroot}%{_emacs_sitelispdir}/%{name}/*.el; do
|
||||
%{_emacs_bytecompile} $i
|
||||
done
|
||||
|
||||
# Vim syntax file(s)
|
||||
install -dm 755 %{buildroot}%{_datadir}/vim/vimfiles/syntax
|
||||
pushd %{buildroot}%{_datadir}/vim/vimfiles/syntax
|
||||
ln -s ../../../%{name}/asy.vim .
|
||||
popd
|
||||
install -dm 755 %{buildroot}%{_datadir}/vim/vimfiles/ftdetect
|
||||
pushd %{buildroot}%{_datadir}/vim/vimfiles/ftdetect
|
||||
ln -s ../../../%{name}/asy_filetype.vim .
|
||||
popd
|
||||
|
||||
# Move info file
|
||||
mv %{buildroot}%{_infodir}/asymptote/asymptote.info %{buildroot}%{_infodir}/asymptote.info
|
||||
|
||||
# copy icon to pixmaps dir
|
||||
mkdir -p %{buildroot}%{_datadir}/pixmaps/
|
||||
cp %{SOURCE1} %{buildroot}%{_datadir}/pixmaps/
|
||||
|
||||
mkdir -p %{buildroot}%{_datadir}/applications
|
||||
desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE2}
|
||||
|
||||
# Clean up symlink
|
||||
rm -rf %{buildroot}%{_bindir}/xasy
|
||||
cd %{buildroot}%{_bindir}
|
||||
ln -s ../share/%{name}/GUI/xasy.py xasy
|
||||
|
||||
%post
|
||||
texhash >/dev/null 2>&1 || :
|
||||
|
||||
%postun
|
||||
texhash >/dev/null 2>&1 || :
|
||||
|
||||
%files
|
||||
%doc %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}/}
|
||||
%{_bindir}/*
|
||||
%{_datadir}/%{name}/
|
||||
%{texpkgdir}/
|
||||
%{_texmf}/tex/context/
|
||||
%{_mandir}/man1/*.1*
|
||||
%{_infodir}/*.info*
|
||||
%{_datadir}/vim/vimfiles/syntax/asy.vim
|
||||
%{_datadir}/vim/vimfiles/ftdetect/asy_filetype.vim
|
||||
%{_datadir}/emacs*
|
||||
%{_datadir}/pixmaps/asy.gif
|
||||
%{_datadir}/applications/*.desktop
|
||||
%{_emacs_sitestartdir}/*.el
|
||||
%{_emacs_sitelispdir}/%{name}/*.elc
|
||||
%dir %{_emacs_sitelispdir}/%{name}
|
||||
%{_emacs_sitelispdir}/%{name}/*.el
|
||||
|
||||
%changelog
|
||||
* Fri Aug 26 2022 herengui <herengui@uniontech.com> - 2.70-1
|
||||
- Initial package
|
||||
313
asymptote.sty.204
Normal file
313
asymptote.sty.204
Normal file
@ -0,0 +1,313 @@
|
||||
%%% Asymptote style file for LaTeX
|
||||
%%% Contributed by Tom Prince 14 May 2003
|
||||
%%% Modified by John Bowman
|
||||
%%% Adapted from comment.sty (Under GPL v2+)
|
||||
|
||||
\ProvidesPackage{asymptote}[2010/08/19 v1.19 Asymptote style file for LaTeX]
|
||||
\RequirePackage{keyval}
|
||||
\RequirePackage{ifthen}
|
||||
\newif\ifASYdefaultinline
|
||||
\newif\ifASYdefaultattach
|
||||
\DeclareOption{inline}{\ASYdefaultinlinetrue}
|
||||
\DeclareOption{attach}{\ASYdefaultattachtrue}
|
||||
\ProcessOptions*
|
||||
|
||||
\def\asydir{}
|
||||
\def\ASYprefix{}
|
||||
|
||||
\def\unquoteJobname#1"#2"#3\relax{\def\rawJobname{#1}%
|
||||
\ifx\rawJobname\empty\def\rawJobname{#2}\fi}
|
||||
\expandafter\unquoteJobname\jobname""\relax
|
||||
% Work around jobname bug in MiKTeX 2.5 and 2.6:
|
||||
% Turn stars in file names (resulting from spaces, etc.) into minus signs
|
||||
\def\fixstar#1*#2\relax{\def\argtwo{#2}\ifx\argtwo\empty\gdef\Jobname{#1}\else
|
||||
\fixstar#1-#2\relax\fi}
|
||||
\expandafter\fixstar\rawJobname*\relax
|
||||
|
||||
\RequirePackage{color,graphicx}
|
||||
|
||||
\def\makeinnocent#1{\catcode`#1=12 }
|
||||
\def\csarg#1#2{\expandafter#1\csname#2\endcsname}
|
||||
\newwrite\AsyStream
|
||||
\newwrite\AsyPreStream
|
||||
\newread\AsyTestStream
|
||||
|
||||
\def\AsyInput#1{\openin\AsyTestStream=#1
|
||||
\ifeof\AsyTestStream
|
||||
\else
|
||||
\input #1
|
||||
\fi
|
||||
\closein\AsyTestStream%
|
||||
}
|
||||
|
||||
\AsyInput{\jobname.pre}
|
||||
|
||||
\immediate\openout\AsyPreStream=\jobname.pre
|
||||
|
||||
\newif\ifASYinline
|
||||
\newif\ifASYattach
|
||||
\newif\ifASYPDF
|
||||
|
||||
\ifx\pdfoutput\undefined
|
||||
\else
|
||||
\ifcase\pdfoutput
|
||||
\else
|
||||
\ASYPDFtrue
|
||||
\fi
|
||||
\fi
|
||||
\ifx\XeTeXversion\undefined
|
||||
\else
|
||||
\ASYPDFtrue
|
||||
\fi
|
||||
|
||||
\newbox\ASYbox
|
||||
\newcounter{asy}
|
||||
|
||||
\def\ProcessAsymptote#1% start it all off
|
||||
{\begingroup
|
||||
\def\CurrentAsymptote{#1}%
|
||||
\let\do\makeinnocent \dospecials
|
||||
\makeinnocent\^^L% and whatever other special cases
|
||||
\endlinechar`\^^M \catcode`\^^M=12 \xAsymptote}
|
||||
{\catcode`\^^M=12 \endlinechar=-1 %
|
||||
\gdef\xAsymptote{%
|
||||
\expandafter\ProcessAsymptoteLine}
|
||||
\gdef\ProcessAsymptoteLine#1^^M{\def\test{#1}
|
||||
\csarg\ifx{End\CurrentAsymptote Test}\test
|
||||
\edef\next{\noexpand\EndOfAsymptote{\CurrentAsymptote}}%
|
||||
\else \ThisAsymptote{#1}\let\next\ProcessAsymptoteLine
|
||||
\fi \next}
|
||||
}
|
||||
|
||||
\def\ASYstringmeaning#1{\expandafter\ASYgobblearrow\meaning#1}
|
||||
\def\ASYstringcsnoescape#1{\expandafter\ASYgobbleescape\string#1}
|
||||
{\escapechar-1
|
||||
\expandafter\expandafter\expandafter\gdef
|
||||
\expandafter\expandafter\expandafter\ASYgobblearrow
|
||||
\expandafter\string\csname macro:->\endcsname{}
|
||||
}
|
||||
\def\ASYgobbleescape#1{\ifnum`\\=`#1 \else #1\fi}
|
||||
|
||||
\def\WriteAsyLine#1{\def\ASYtmp{#1}%
|
||||
\immediate\write\AsyStream{\ASYstringmeaning\ASYtmp}}
|
||||
|
||||
\def\gedefappend#1#2{%
|
||||
\toks@ = \expandafter{#1}%
|
||||
\global\edef#1{\the\toks@ #2}%
|
||||
}%
|
||||
\def\globalASYdefs{}
|
||||
\def\WriteGlobalAsyLine#1{\def\ASYtmp{#1^^J}%
|
||||
\gedefappend\globalASYdefs{\ASYstringmeaning\ASYtmp}}
|
||||
|
||||
\def\EndOfAsymptote#1{\endgroup\end{#1}%
|
||||
\csname After#1Asymptote\endcsname}
|
||||
\def\AsymptoteEndDef#1{{\escapechar=-1\relax
|
||||
\csarg\xdef{End#1Test}{\string\\end\string\{#1\string\}}%
|
||||
}}
|
||||
|
||||
\def\AfterasyAsymptote{%
|
||||
\ifx\ASYwidth\empty
|
||||
\ifx\ASYheight\empty
|
||||
\else
|
||||
\immediate\write\AsyStream{size(0,\ASYheight);}%
|
||||
\fi
|
||||
\else
|
||||
\ifx\ASYheight\empty
|
||||
\immediate\write\AsyStream{size(\ASYwidth,0);}%
|
||||
\else
|
||||
\immediate\write\AsyStream{size(\ASYwidth,\ASYheight);}%
|
||||
\fi
|
||||
\fi
|
||||
\ifASYattach
|
||||
\def\ASYdefaultviewportwidth{0}%
|
||||
\else
|
||||
\def\ASYdefaultviewportwidth{\the\linewidth}%
|
||||
\fi
|
||||
\ifx\ASYviewportwidth\empty
|
||||
\ifx\ASYviewportheight\empty
|
||||
\else
|
||||
\immediate\write\AsyStream{viewportsize=(0,\ASYviewportheight);}%
|
||||
\fi
|
||||
\else
|
||||
\ifx\ASYviewportheight\empty
|
||||
\immediate\write\AsyStream{viewportsize=(\ASYviewportwidth,0);}%
|
||||
\else
|
||||
\immediate\write%
|
||||
\AsyStream{viewportsize=(\ASYviewportwidth,\ASYviewportheight);}%
|
||||
\fi
|
||||
\fi
|
||||
\gdef\ASYwidth{}%
|
||||
\gdef\ASYheight{}%
|
||||
\gdef\ASYviewportwidth{\ASYdefaultviewportwidth}%
|
||||
\gdef\ASYviewportheight{}%
|
||||
\immediate\closeout\AsyStream
|
||||
\ifASYinline
|
||||
\openin\AsyTestStream=\AsyFile.tex
|
||||
\else
|
||||
\ifASYPDF
|
||||
\openin\AsyTestStream=\AsyFile.pdf
|
||||
\else
|
||||
\openin\AsyTestStream=\AsyFile.eps
|
||||
\fi
|
||||
\fi
|
||||
\ifeof\AsyTestStream
|
||||
\ifASYinline
|
||||
\PackageWarning{asymptote}{file `\AsyFile.tex' not found}%
|
||||
\closein\AsyTestStream%
|
||||
\else
|
||||
\closein\AsyTestStream%
|
||||
\openin\AsyTestStream=\AsyFile.tex
|
||||
\ifeof\AsyTestStream
|
||||
\ifASYPDF
|
||||
\PackageWarning{asymptote}{file `\AsyFile.pdf' not found}%
|
||||
\else
|
||||
\PackageWarning{asymptote}{file `\AsyFile.eps' not found}%
|
||||
\fi
|
||||
\else
|
||||
\catcode`:=12
|
||||
\input \AsyFile.tex%
|
||||
\fi
|
||||
\closein\AsyTestStream%
|
||||
\fi
|
||||
\else
|
||||
\closein\AsyTestStream%
|
||||
\ifASYinline
|
||||
\catcode`:=12
|
||||
\input \AsyFile.tex%
|
||||
\else
|
||||
\ifASYattach
|
||||
\ifASYPDF
|
||||
\openin\AsyTestStream=\AsyFile+0.pdf
|
||||
\fi
|
||||
\ifeof\AsyTestStream
|
||||
\setbox\ASYbox=\hbox{\includegraphics[hiresbb]{\AsyFile}}%
|
||||
\else
|
||||
\setbox\ASYbox=\hbox{\includegraphics[hiresbb]{\AsyFile+0}}%
|
||||
\fi
|
||||
\textattachfile{\AsyFile.pdf}{\phantom{\copy\ASYbox}}%
|
||||
\vskip-\ht\ASYbox%
|
||||
\indent%
|
||||
\box\ASYbox%
|
||||
\closein\AsyTestStream%
|
||||
\else
|
||||
\includegraphics[hiresbb]{\AsyFile}%
|
||||
\fi
|
||||
\fi
|
||||
\fi
|
||||
\relax%
|
||||
\endgroup}
|
||||
\gdef\ASYwidth{}%
|
||||
\define@key{ASYkeys}{width}{%
|
||||
\gdef\ASYwidth{#1}%
|
||||
}
|
||||
\gdef\ASYheight{}%
|
||||
\define@key{ASYkeys}{height}{%
|
||||
\gdef\ASYheight{#1}%
|
||||
}
|
||||
\gdef\ASYviewportwidth{\ASYdefaultviewportwidth}%
|
||||
\define@key{ASYkeys}{viewportwidth}{%
|
||||
\gdef\ASYviewportwidth{#1}%
|
||||
}
|
||||
\gdef\ASYviewportheight{}%
|
||||
\define@key{ASYkeys}{viewportheight}{%
|
||||
\gdef\ASYviewportheight{#1}%
|
||||
}
|
||||
\define@key{ASYkeys}{attach}[true]{%
|
||||
\ifthenelse{\equal{#1}{true}}{\global\ASYattachtrue}{\global\ASYattachfalse}%
|
||||
}
|
||||
\define@key{ASYkeys}{inline}[true]{%
|
||||
\ifthenelse{\equal{#1}{true}}{\global\ASYinlinetrue}{\global\ASYinlinefalse}%
|
||||
}
|
||||
\newcommand\asy[1][]{%
|
||||
\begingroup
|
||||
\let\par\empty
|
||||
\stepcounter{asy}%
|
||||
\global\let\ifASYinline\ifASYdefaultinline
|
||||
\global\let\ifASYattach\ifASYdefaultattach
|
||||
\setkeys{ASYkeys}{#1}%
|
||||
\ifASYattach
|
||||
\global\ASYinlinefalse
|
||||
\fi
|
||||
\ifx\asydir\empty
|
||||
\else
|
||||
\gdef\ASYprefix{\asydir/}
|
||||
\fi
|
||||
\immediate\write\AsyPreStream{\@backslashchar%
|
||||
AsyInput{\ASYprefix\@backslashchar jobname-\the\c@asy.pre}}
|
||||
\immediate\openout\AsyStream=\ASYprefix\jobname-\the\c@asy.asy
|
||||
\gdef\AsyFile{\ASYprefix\Jobname-\the\c@asy}%
|
||||
\immediate\write\AsyStream{if(!settings.multipleView)}%
|
||||
\immediate\write\AsyStream{ settings.batchView=false;}%
|
||||
\ifx\XeTeXversion\undefined
|
||||
\ifASYPDF
|
||||
\immediate\write\AsyStream{settings.tex="pdflatex";}%
|
||||
\fi
|
||||
\else
|
||||
\immediate\write\AsyStream{settings.tex="xelatex";}%
|
||||
\ASYPDFtrue
|
||||
\fi
|
||||
\ifASYinline
|
||||
\immediate\write\AsyStream{settings.inlinetex=true;}%
|
||||
\immediate\write\AsyStream{deletepreamble();}%
|
||||
\fi
|
||||
\immediate\write\AsyStream{defaultfilename="\Jobname-\the\c@asy";}%
|
||||
\immediate\write\AsyStream{if(settings.render < 0) settings.render=4;}%
|
||||
\ifASYattach
|
||||
\immediate\write\AsyStream{settings.inlineimage=false;}%
|
||||
\immediate\write\AsyStream{settings.embed=false;}%
|
||||
\immediate\write\AsyStream{settings.outformat="pdf";}%
|
||||
\immediate\write\AsyStream{settings.toolbar=true;}%
|
||||
\else
|
||||
\immediate\write\AsyStream{settings.inlineimage=true;}%
|
||||
\immediate\write\AsyStream{settings.embed=true;}%
|
||||
\immediate\write\AsyStream{settings.outformat="";}%
|
||||
\immediate\write\AsyStream{settings.toolbar=false;}%
|
||||
\immediate\write\AsyStream{viewportmargin=(2,2);}%
|
||||
\fi
|
||||
\immediate\write\AsyStream{\globalASYdefs}%
|
||||
\let\ThisAsymptote\WriteAsyLine%
|
||||
\ProcessAsymptote{asy}%
|
||||
}
|
||||
\AsymptoteEndDef{asy}
|
||||
\def\asydef{%
|
||||
\let\ThisAsymptote\WriteGlobalAsyLine%
|
||||
\ProcessAsymptote{asydef}}
|
||||
\AsymptoteEndDef{asydef}
|
||||
\def\AfterasydefAsymptote{}
|
||||
|
||||
\AtEndDocument{\immediate\closeout\AsyPreStream}
|
||||
|
||||
\newcommand{\ASYanimategraphics}[5][]{%
|
||||
\openin\AsyTestStream=_#3.pdf
|
||||
\ifeof\AsyTestStream%
|
||||
\else%
|
||||
\animategraphics[{#1}]{#2}{_#3}{#4}{#5}%
|
||||
\fi%
|
||||
}
|
||||
|
||||
% Work around bug in dvips.def: allow spaces in file names.
|
||||
\def\Ginclude@eps#1{%
|
||||
\message{<#1>}%
|
||||
\bgroup
|
||||
\def\@tempa{!}%
|
||||
\dimen@\Gin@req@width
|
||||
\dimen@ii.1bp%
|
||||
\divide\dimen@\dimen@ii
|
||||
\@tempdima\Gin@req@height
|
||||
\divide\@tempdima\dimen@ii
|
||||
\special{PSfile=#1\space
|
||||
llx=\Gin@llx\space
|
||||
lly=\Gin@lly\space
|
||||
urx=\Gin@urx\space
|
||||
ury=\Gin@ury\space
|
||||
\ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
|
||||
\ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
|
||||
\ifGin@clip clip\fi}%
|
||||
\egroup}
|
||||
|
||||
\def\Asymptote{{\tt Asymptote}}
|
||||
|
||||
%%% Local Variables:
|
||||
%%% mode: latex
|
||||
%%% TeX-master: "shared"
|
||||
%%% End:
|
||||
12
xasy.desktop
Normal file
12
xasy.desktop
Normal file
@ -0,0 +1,12 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Exec=xasy
|
||||
Icon=/usr/share/pixmaps/asy.gif
|
||||
Terminal=false
|
||||
Name=Asymptote
|
||||
GenericName=xasy
|
||||
Comment=GUI tool for using Asymptote vector graphics
|
||||
Type=Application
|
||||
Categories=Application;Graphics;
|
||||
StartupNotify=true
|
||||
X-Desktop-File-Install-Version=0.10
|
||||
Loading…
x
Reference in New Issue
Block a user