2

I've been trying to install the [Olympiad package][1] for asymptote on my Mac to use in TexShop, but I have no idea where to install it. I've tried to move the olympiad.asy file into the Library\TexShop\Engines\Asymptote Folder, but that didn't compile. I've also tried moving it into one of numerous \usr\local\share\doc\asymptote folder, but that doesn't work either. Could someone help me out? The only thing not compiling is my attempt to import olympiad;.

This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./Poles&Polars.tex
LaTeX2e <2014/05/01>
Babel <3.9k> and hyphenation patterns for 78 languages loaded.
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/size11.clo))
(/Users/SaiyanSparta/Library/texmf/tex/latex/Tyler/tyler.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/local/texlive/2014/texmf-dist/tex/latex/amscls/amsthm.sty)
(/usr/local/texlive/2014/texmf-dist/tex/latex/asymptote/asymptote.sty
(./Poles&Polars.pre)
(/usr/local/texlive/2014/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/local/texlive/2014/texmf-dist/tex/latex/graphics/color.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/latexconfig/color.cfg)
(/usr/local/texlive/2014/texmf-dist/tex/latex/pdftex-def/pdftex.def
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)))
(/usr/local/texlive/2014/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2014/texmf-dist/tex/latex/latexconfig/graphics.cfg)))
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/local/texlive/2014/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/catchfile.sty
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/etexcmds.sty
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/ifluatex.sty))))

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.4 i
     mport olympiad;
? 
(/usr/local/texlive/2014/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)
(/usr/local/texlive/2014/texmf-dist/tex/latex/mh/mathtools.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/tools/calc.sty)
(/usr/local/texlive/2014/texmf-dist/tex/latex/mh/mhsetup.sty))
(/usr/local/texlive/2014/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/ifvtex.sty)))
(./Poles&Polars.aux)
(/usr/local/texlive/2014/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty)
(/usr/local/texlive/2014/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/oberdiek/grfext.sty
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty))
(/usr/local/texlive/2014/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty))
(/usr/local/texlive/2014/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex

Package Fancyhdr Warning: \headheight is too small (12.0pt): 
 Make it at least 13.59999pt.
 We now make it that large for the rest of the document.
 This may cause the page layout to be inconsistent, however.

[1{/usr/local/texlive/2014/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/umsb.fd)
<"Poles&Polars-1".pdf, id=7, 199.1691pt x 80.1123pt>
<use "Poles&Polars-1".pdf>
<"Poles&Polars-2".pdf, id=8, 211.50919pt x 133.28194pt>
<use "Poles&Polars-2".pdf> [2 <./Poles&Polars-1.pdf>]

Package Fancyhdr Warning: \headheight is too small (12.0pt): 
 Make it at least 13.59999pt.
 We now make it that large for the rest of the document.
 This may cause the page layout to be inconsistent, however.

[3 <./Poles&Polars-2.pdf>] (./Poles&Polars.aux) )</usr/local/texlive/2014/texmf
-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr/local/texlive/2014/texmf-
dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/local/texlive/2014/texmf-d
ist/fonts/type1/public/amsfonts/cm/cmbxti10.pfb></usr/local/texlive/2014/texmf-
dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr/local/texlive/2014/texmf-d
ist/fonts/type1/public/amsfonts/cm/cmmi12.pfb></usr/local/texlive/2014/texmf-di
st/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/local/texlive/2014/texmf-dist
/fonts/type1/public/amsfonts/cm/cmr12.pfb></usr/local/texlive/2014/texmf-dist/f
onts/type1/public/amsfonts/cm/cmr17.pfb></usr/local/texlive/2014/texmf-dist/fon
ts/type1/public/amsfonts/cm/cmr7.pfb></usr/local/texlive/2014/texmf-dist/fonts/
type1/public/amsfonts/cm/cmr8.pfb></usr/local/texlive/2014/texmf-dist/fonts/typ
e1/public/amsfonts/cm/cmsy10.pfb></usr/local/texlive/2014/texmf-dist/fonts/type
1/public/amsfonts/cm/cmsy8.pfb>
Output written on Poles&Polars.pdf (3 pages, 125754 bytes).
SyncTeX written on Poles&Polars.synctex.gz.
Transcript written on Poles&Polars.log.
Processing Poles&Polars-1
Wrote Poles&Polars-1.pdf
Processing Poles&Polars-2
Wrote Poles&Polars-2.pdf
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./Poles&Polars.tex
LaTeX2e <2014/05/01>
Babel <3.9k> and hyphenation patterns for 78 languages loaded.
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/size11.clo))
(/Users/SaiyanSparta/Library/texmf/tex/latex/Tyler/tyler.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/local/texlive/2014/texmf-dist/tex/latex/amscls/amsthm.sty)
(/usr/local/texlive/2014/texmf-dist/tex/latex/asymptote/asymptote.sty
(./Poles&Polars.pre)
(/usr/local/texlive/2014/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/local/texlive/2014/texmf-dist/tex/latex/graphics/color.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/latexconfig/color.cfg)
(/usr/local/texlive/2014/texmf-dist/tex/latex/pdftex-def/pdftex.def
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)))
(/usr/local/texlive/2014/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2014/texmf-dist/tex/latex/latexconfig/graphics.cfg)))
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/local/texlive/2014/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/catchfile.sty
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/etexcmds.sty
(/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/ifluatex.sty))))

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

    l.4 i
     mport olympiad;
? 

  [1]: http://www.artofproblemsolving.com/community/c68h165767%22olympiad%20package%22
2
  • Have you tried creating (if necessary) the directory ~/.asy and installing it there? Additional note: A directory path containing /doc is probably for documentation. Oct 8, 2015 at 15:24
  • Thank you very much! I realize that ~/.asy is a hidden file, so I unhid them and threw olympiad.asy and cse5.asy in there. It also finally compiled after I realized that import olympiad; is run inside asy environment, not in my package. :P
    – Tyler Zhu
    Oct 10, 2015 at 22:46

1 Answer 1

3

Short answer: Packages can be installed in the hidden directory ~/.asy. Check if this directory already exists using ls -a ~ at the terminal (the -a flag says to include hidden directories). Create the directory if it does not exist.

Longer answer: in principle, anywhere in the following list (quoted from Search paths in the manual) ought to work:

  • The current directory;
  • A list of one or more directories specified by the configuration variable dir or environment variable ASYMPTOTE_DIR (separated by : under UNIX and ; under MSDOS);
  • The directory specified by the environment variable ASYMPTOTE_HOME; if this variable is not set, the directory .asy in the user’s home directory (%USERPROFILE%\.asy under MSDOS) is used;
  • The Asymptote system directory (by default, /usr/local/share/asymptote under UNIX and C:\Program Files\Asymptote under MSDOS).

I don't recommend messing with the Asymptote system directory, since finding the right place is usually harder than one might expect. The simplest thing to do is just to put the package in the "current directory" (typically the same directory as whatever Asymptote file you want to compile). For a broader installation that will work across directories, the ~/.asy directory is often a good choice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.