Has anyone run across a compatibility issue between the fontspec package and asymptote?

In the MWE below, commenting out the \usepackage{fontspec} allows for proper compilation and embedding of the 3D asymptote manipulative.

Without commenting out the fontspec package, I receive errors like

"Latex Error: ./untitled-1.tex:1 LaTeX Error: Can be used only in preamble.

 Latex Error: ./untitled-1.tex:9 Undefined control sequence."

and while the manipulative is embedded in the output, there's the word everypage embedded as well.

%\setmainfont[ItalicFont={Calibri Italic}]{Cambria}
\section{Basic Definitions}
We start with the real numbers 
    import solids;
    import three;
    import graph3;
    material Gray=material(heavygray+opacity(0.75),emissivepen=heavygray,ambientpen=heavygray);
    material Blue=material(blue+opacity(0.75),emissivepen=blue);
    surface y=shift((-.5,0,0))*unitplane;
    surface r=shift((0,3,1))*unitsphere;
  • 2
    This appears to be a problem with XeLaTeX+asymptote; I get the same error without the fontspec package. – Will Robertson Aug 5 '14 at 2:20
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – cfr Aug 5 '14 at 2:56
  • Will, do you have any idea what the issue is between XeLaTeX and the asymptote package? Will it occur with LUaLaTeX? – Tim Aug 10 '14 at 6:25

Your Answer

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

Browse other questions tagged or ask your own question.