diff options
author | Karl Berry <karl@freefriends.org> | 2009-05-28 23:56:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-05-28 23:56:03 +0000 |
commit | e767448d0591f5dbb0cd485e4b014becdcbd1ba4 (patch) | |
tree | 83bec5bd1ee117130f3e9dcee985dcd42f5145d9 /Build/source/utils/asymptote/base/plain_strings.asy | |
parent | 20751a51df382b884807d8b9ef1ff7f7cc7739a5 (diff) |
asymptote 1.74
git-svn-id: svn://tug.org/texlive/trunk@13514 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/base/plain_strings.asy')
-rw-r--r-- | Build/source/utils/asymptote/base/plain_strings.asy | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/Build/source/utils/asymptote/base/plain_strings.asy b/Build/source/utils/asymptote/base/plain_strings.asy index 2df4743171f..801e63e83cf 100644 --- a/Build/source/utils/asymptote/base/plain_strings.asy +++ b/Build/source/utils/asymptote/base/plain_strings.asy @@ -136,29 +136,38 @@ string math(string s) return s != "" ? "$"+s+"$" : s; } +private void notimplemented(string text) +{ + abort(text+" is not implemented for the '"+settings.tex+"' TeX engine"); +} + string graphic(string name, string options="") { - if(options != "") options="["+options+"]"; - return "\includegraphics"+options+"{"+name+"}"; + if(latex()) { + if(options != "") options="["+options+"]"; + return "\includegraphics"+options+"{"+name+"}"; + } + if(settings.tex != "context") + notimplemented("graphic"); + return "\externalfigure["+name+"]["+options+"]"; } string minipage(string s, real width=100bp) { if(latex()) return "\begin{minipage}{"+(string) (width*pt)+"pt}"+s+"\end{minipage}"; - write("warning: minipage requires -tex latex or -tex pdflatex"); - return ""; + if(settings.tex != "context") + notimplemented("minipage"); + return "\startframedtext[none][frame=off,width="+(string) (width*pt)+ + "pt]"+s+"\stopframedtext"; } void usepackage(string s, string options="") { - if(latex()) { - string usepackage="\usepackage"; - if(options != "") usepackage += "["+options+"]"; - texpreamble(usepackage+"{"+s+"}"); - return; - } - write("warning: usepackage requires -tex latex or -tex pdflatex"); + if(!latex()) notimplemented("usepackage"); + string usepackage="\usepackage"; + if(options != "") usepackage += "["+options+"]"; + texpreamble(usepackage+"{"+s+"}"); } void pause(string w="Hit enter to continue") |