1

The following code works with texlive 2021 but no longer with texlive 2022.

    % !TeX program = lualatex
    \documentclass{article}
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \usepackage[inline]{asymptote}
    \begin{document}

    Alors?

    \begin{asydef}
        texpreamble("\usepackage[math-style=french,bold-style=ISO]{fourier-otf}");
        texpreamble("\setmainfont[Scale=0.72]{Verdana}");
        settings.tex="lualatex";
        \end{asydef}
    \begin{center}
        \begin{asy}
    import three;
    unitsize(1cm);
    //draw('en 2D : $A$ et A',(0,0)--(10,0));
    draw('en 3D : $B$ et B',(0,0,0)--(10,0,0));
            \end{asy}
        \end{center}
    \end{document}

No problem in 2D, but in 3D, no longer generates the pdf properly, the draw inthe pdf and the text only on _ps with asy -f pdf essai-1.asy

MODIFIED after the comment. Système d’exploitation 64 bits, processeur x64 Windows 10 Famille

enter image description here

The code asy generated

    if(!settings.multipleView) settings.batchView=false;
    settings.tex="pdflatex";
    settings.inlinetex=true;
    deletepreamble();
    defaultfilename="essai-1";
    if(settings.render < 0) settings.render=4;
    settings.outformat="";
    settings.inlineimage=true;
    settings.embed=true;
    settings.toolbar=false;
    viewportmargin=(2,2);

    texpreamble("\usepackage[math-style=french,bold-style=ISO]{fourier-otf}");
    texpreamble("\setmainfont[Scale=0.72]{Verdana}");
    settings.tex="lualatex";

    import three;
    unitsize(1cm);
    //draw('en 2D : $A$ et A',(0,0)--(10,0));
    draw('en 3D : $B$ et B',(0,0,0)--(10,0,0));

The files genrated

enter image description here

The file essai-1__.ps enter image description here

The file essai-1_0.pdf enter image description here

1

2 Answers 2

1

I downloaded TeXLive 2022.

/usr/local/texlive/2022/bin/x86_64-linux/asy -f pdf

works fine, where test.asy contains the lines

import three;
unitsize(1cm);
draw('en 3D : $B$ et B',(0,0,0)--(10,0,0));

Please check that your version of asy was compiled with 3D support, using asy --version. The x86_64-linux version returns

Asymptote version 2.79 [(C) 2004 Andy Hammerlindl, John C. Bowman, Tom Prince]

ENABLED OPTIONS:
V3D      3D vector graphics output
WebGL    3D HTML rendering
OpenGL   3D OpenGL rendering
SSBO     GLSL shader storage buffer objects
XDR      External Data Representation (portable binary file format for V3D)
Readline Interactive history and editing
GC       Boehm garbage collector
threads  Render OpenGL in separate thread

DISABLED OPTIONS:
GSL      GNU Scientific Library (special functions)
FFTW3    Fast Fourier transforms
CURL     URL support
LSP      Language Server Protocol
Sigsegv  Distinguish stack overflows from segmentation faults
3
  • Thanks a lot for your help. I modified the EDIT to show the version of asymptote used. I work on windows 10. I think it's on the side of lualatex, because it's the same version of asymptote. I don't see what I forgot to do after installation.
    – pascal974
    May 8, 2022 at 13:06
  • It works fine without change of font
    – pascal974
    May 8, 2022 at 13:10
  • @John Bowman: your simple test.asy works, but if you add a first line like "settings.tex=xelatex" (or "settings.tex=lualatex") it doesn't work any more :(
    – Sergio
    Jun 3, 2022 at 12:57
1

Perhaps I should not open a new question. Should I?

Let's look at the test.asy file by John Bowman. If I add a first line:

settings.tex="latex";
import three;
unitsize(1cm);
draw('en 3D : $B$ et B',(0,0,0)--(10,0,0));

then asy -kf pdf test.asy works (test.pdf contains line and text) and test_.tex is

\documentclass[12pt]{article}
\newbox\ASYbox
\newdimen\ASYdimen
\def\ASYprefix{}
\long\def\ASYbase#1#2{\leavevmode\setbox\ASYbox=\hbox{#1}%\ASYdimen=\ht\ASYbox%
\setbox\ASYbox=\hbox{#2}\lower\ASYdimen\box\ASYbox}
\pagestyle{empty}
\textheight=2048pt
\textwidth=2048pt
\begin{document}
\makeatletter%
\let\ASYencoding\f@encoding%
\let\ASYfamily\f@family%
\let\ASYseries\f@series%
\let\ASYshape\f@shape%
\makeatother%
\fontsize{12.000000}{14.400000}\selectfont%
\usefont{\ASYencoding}{\ASYfamily}{\ASYseries}{\ASYshape}%
\special{ps:
/ASYx {( ) print ASYX sub 12 string cvs print} bind def
/ASYy {( ) print ASYY sub 12 string cvs print} bind def
/ASY1 true def
/show {ASY1 {/ASYX currentpoint pop def /ASYY currentpoint exch pop def /ASY1 false def} if currentpoint newpath moveto false charpath {(M) print ASYy ASYx} {(L) print ASYy ASYx} {(C) print ASYy ASYx ASYy ASYx ASYy ASYx} {(c) print} pathforall} bind def /V {ASY1 {/ASYX currentpoint pop def /ASYY currentpoint exch pop def ASY1 false def} if Ry neg Rx 4 copy 4 2 roll 2 copy 6 2 roll 2 copy (M) print ASYy ASYx (L) print ASYy add ASYx (L) print add ASYy add ASYx (L) print add ASYy ASYx (c) print} bind def}
en 3D : $B$ et B\ %
\end{document}

The same if I replace "latex" with "pdflatex".

If I replace "latex" with "xelatex",

settings.tex="xelatex";

then asy -kf pdf test.asy does not work (only line, no text) and text_.tex is

\documentclass[12pt]{article}
\newbox\ASYbox
\newdimen\ASYdimen
\def\ASYprefix{}
\long\def\ASYbase#1#2{\leavevmode\setbox\ASYbox=\hbox{#1}%\ASYdimen=\ht\ASYbox%
\setbox\ASYbox=\hbox{#2}\lower\ASYdimen\box\ASYbox}
\pagestyle{empty}
\textheight=2048pt
\textwidth=2048pt
\begin{document}
\makeatletter%
\let\ASYencoding\f@encoding%
\let\ASYfamily\f@family%
\let\ASYseries\f@series%
\let\ASYshape\f@shape%
\makeatother%
\fontsize{12.000000}{14.400000}\selectfont%
\usefont{\ASYencoding}{\ASYfamily}{\ASYseries}{\ASYshape}%
en 3D : $B$ et B\ %
\end{document}

I suppose that we have a problem...

PS: Manjaro Linux, Asymptote 2.79, texlive 2022.

1
  • Thank you for your help, the problem is now clearly identified.
    – pascal974
    Jun 4, 2022 at 6:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .