Page 1 sur 1

pas de sortie svg

Posté : lun. 18 févr. 2019, 23:15
par psiloi
Bonjour !

Je suis venu à asymptote afin de pouvoir faire des schémas explicatifs sans avoir à tout recommencer en cas de changement esthétiques sur les composants de bases des schémas. J'ai pas mal avancé, j'ai de quoi traduire en asymptote ce que j'avais fait à la main comme schémas auè format svg avec inkscape.

Sauf que sous asymptote, je n'obtiens que des fichiers pdf ! Pas de svs :-(

Voici pourtant le début d'un fichier .asy pour un schéma :

Code : Tout sélectionner

import settings;
settings.outformat="svg";
outformat="svg";
settings.dvisvgm = "/usr/bin/dvisvgm";
import bases_test;
size(0, 60);
et en ligne de commande un truc comme :

Code : Tout sélectionner

asy -vvv -f svg bases_ex
voici d'ailleurs un exemple de sortie avec ce haut niveau d'informations :

Code : Tout sélectionner

Using configuration directory /home/jnpr/.asy
Using history /home/jnpr/.asy/history
Welcome to Asymptote version 2.47
cd /home/jnpr/workspace/blood-and-blades-v0.8.0/schemas/src/conventions
Processing bases_ex
Loading plain from /usr/share/asymptote/plain.asy
Including plain_constants from /usr/share/asymptote/plain_constants.asy
Loading version from /usr/share/asymptote/version.asy
Including plain_strings from /usr/share/asymptote/plain_strings.asy
Including plain_pens from /usr/share/asymptote/plain_pens.asy
Including plain_paths from /usr/share/asymptote/plain_paths.asy
Including plain_filldraw from /usr/share/asymptote/plain_filldraw.asy
Including plain_margins from /usr/share/asymptote/plain_margins.asy
Including plain_picture from /usr/share/asymptote/plain_picture.asy
Loading plain_scaling from /usr/share/asymptote/plain_scaling.asy
Loading simplex from /usr/share/asymptote/simplex.asy
Loading plain_bounds from /usr/share/asymptote/plain_bounds.asy
Including plain_scaling from /usr/share/asymptote/plain_scaling.asy
Including plain_prethree from /usr/share/asymptote/plain_prethree.asy
Including plain_Label from /usr/share/asymptote/plain_Label.asy
Including plain_shipout from /usr/share/asymptote/plain_shipout.asy
Including plain_arcs from /usr/share/asymptote/plain_arcs.asy
Including plain_boxes from /usr/share/asymptote/plain_boxes.asy
Including plain_markers from /usr/share/asymptote/plain_markers.asy
Including plain_arrows from /usr/share/asymptote/plain_arrows.asy
Including plain_debugger from /usr/share/asymptote/plain_debugger.asy
Loading bases_ex from bases_ex.asy
Loading bases_test from bases_test.asy
Loading bases from bases.asy
Loading geometry from /usr/share/asymptote/geometry.asy
Loading math from /usr/share/asymptote/math.asy
Loading markers from /usr/share/asymptote/markers.asy
Loading roundedpath from /usr/share/asymptote/roundedpath.asy
latex \scrollmode
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2018-12-01>


*
\documentclass[12pt]{article}
\usepackage{ifluatex}\ifluatex
\ifx\pdfpagewidth\undefined\let\pdfpagewidth\paperwidth\fi
\ifx\pdfpageheight\undefined\let\pdfpageheight\paperheight\fi\else
\let\paperwidthsave\paperwidth\let\paperwidth\undefined
\usepackage{graphicx}
\let\paperwidth\paperwidthsave\fi
\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}
\usepackage{graphicx}
\begin{document}
\makeatletter%
\let\ASYencoding\f@encoding%
\let\ASYfamily\f@family%
\let\ASYseries\f@series%
\let\ASYshape\f@shape%
\makeatother%
\fontsize{5.01875}{6.0225}\selectfont

(Please type a command or say `\end')
*\usefont{\ASYencoding}{\ASYfamily}{\ASYseries}{\ASYshape}%


*(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo))
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
*
*
*
*
*(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/dvips.def)))
*
*
*
*
*
*
*No file texput.aux.

*
*
*
*
*
*
*
*(Please type a command or say `\end')
*\setbox\ASYbox=\hbox{A}


*(Please type a command or say `\end')
*\immediate\write16{>dim(\the\wd\ASYbox)dim}

*(Please type a command or say `\end')
*>dim(4.90286pt)dim

*\immediate\write16{>dim(\the\ht\ASYbox)dim}
>dim(3.3988pt)dim

*\immediate\write16{>dim(\the\dp\ASYbox)dim}
>dim(0.0pt)dim

*\fontsize{7.42775}{8.9133}\selectfont


LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <7.42775> not available
(Font)              size <7> substituted on input line 0.


*(Please type a command or say `\end')
*\usefont{\ASYencoding}{\ASYfamily}{\ASYseries}{\ASYshape}%


*(Please type a command or say `\end')
*\setbox\ASYbox=\hbox{Ps}


*(Please type a command or say `\end')
*\immediate\write16{>dim(\the\wd\ASYbox)dim}
>dim(8.54309pt)dim

*\immediate\write16{>dim(\the\ht\ASYbox)dim}
>dim(4.78334pt)dim

*\immediate\write16{>dim(\the\dp\ASYbox)dim}
>dim(0.0pt)dim

*\fontsize{5.01875}{6.0225}\selectfont


*(Please type a command or say `\end')
*\usefont{\ASYencoding}{\ASYfamily}{\ASYseries}{\ASYshape}%


*(Please type a command or say `\end')
*\setbox\ASYbox=\hbox{A}


*(Please type a command or say `\end')
*\immediate\write16{>dim(\the\wd\ASYbox)dim}
>dim(4.90286pt)dim

*\immediate\write16{>dim(\the\ht\ASYbox)dim}
>dim(3.3988pt)dim

*\immediate\write16{>dim(\the\dp\ASYbox)dim}
>dim(0.0pt)dim

*\fontsize{7.42775}{8.9133}\selectfont


*(Please type a command or say `\end')
*\setbox\ASYbox=\hbox{Ps}


*(Please type a command or say `\end')
*\immediate\write16{>dim(\the\wd\ASYbox)dim}
>dim(8.54309pt)dim

*\immediate\write16{>dim(\the\ht\ASYbox)dim}
>dim(4.78334pt)dim

*\immediate\write16{>dim(\the\dp\ASYbox)dim}
>dim(0.0pt)dim

*\fontsize{5.01875}{6.0225}\selectfont


*(Please type a command or say `\end')
*\usefont{\ASYencoding}{\ASYfamily}{\ASYseries}{\ASYshape}%


*(Please type a command or say `\end')
*\setbox\ASYbox=\hbox{A}


*(Please type a command or say `\end')
*\immediate\write16{>dim(\the\wd\ASYbox)dim}
>dim(4.90286pt)dim

*\immediate\write16{>dim(\the\ht\ASYbox)dim}
>dim(3.3988pt)dim

*\immediate\write16{>dim(\the\dp\ASYbox)dim}
>dim(0.0pt)dim

*\fontsize{7.42775}{8.9133}\selectfont


*(Please type a command or say `\end')
*\setbox\ASYbox=\hbox{Ps}


*(Please type a command or say `\end')
*\immediate\write16{>dim(\the\wd\ASYbox)dim}
>dim(8.54309pt)dim

*\immediate\write16{>dim(\the\ht\ASYbox)dim}
>dim(4.78334pt)dim

*\immediate\write16{>dim(\the\dp\ASYbox)dim}
>dim(0.0pt)dim

*latex \nonstopmode\input bases_ex_.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2018-12-01>

(./bases_ex_.tex (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo))
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/dvips.def)))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/dvipsnam.def))
No file bases_ex_.aux.
<bases_ex_0.eps>

LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <7.42775> not available
(Font)              size <7> substituted on input line 73.

[1] (./bases_ex_.aux)

LaTeX Font Warning: Size substitutions with differences
(Font)              up to 0.42775pt have occurred.

 )
Output written on bases_ex_.dvi (1 page, 508 bytes).
Transcript written on bases_ex_.log.
dvips -R -Pdownload35 -D600 -O-128.4bp,645.7bp -E -obases_ex_.ps bases_ex_.dvi
This is dvips(k) 5.998 Copyright 2018 Radical Eye Software (www.radicaleye.com)
' TeX output 2019.02.12:2325' -> bases_ex_.ps
</usr/share/texlive/texmf-dist/dvips/base/tex.pro>
</usr/share/texlive/texmf-dist/dvips/base/texps.pro>
</usr/share/texlive/texmf-dist/dvips/base/special.pro>
</usr/share/texlive/texmf-dist/dvips/base/color.pro>. 
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb>
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr5.pfb>[1
<./bases_ex_0.eps>] 
%%BoundingBox: 0 0 41 21
%%HiResBoundingBox: 0 0 40.5 20.5
gs -q -dNOPAUSE -dBATCH -P -dSAFER -sDEVICE=pdfwrite -dEPSCrop -dSubsetFonts=true -dEmbedAllFonts=true -dMaxSubsetPct=100 -dPDFSETTINGS=/prepress -dCompatibilityLevel=1.4 -dAutoRotatePages=/None -g612x792 -dDEVICEWIDTHPOINTS=40.5 -dDEVICEHEIGHTPOINTS=20.5 -sOutputFile=bases_ex.pdf bases_ex_.eps
Wrote bases_ex.pdf
J'ai essayé pdf2svg : ça me donne un svg avec un gros blob de texte en base64... qui est en fait une immage bitmap au format png ! -> ça ne va pas du tout !
quant à dvisvgm, il commence le travail mais arrête de raduise très vite (sans message d'erreur) -> inexploitable.

Alors si quelq'un ici pouvait m'aider... parce que les moteurs de recherche ne m'ont pas permi d'aller plus loin que ça.

Re: pas de sortie svg

Posté : dim. 10 mars 2019, 23:12
par OG
Bonsoir

Je viens d'essayer sur un exemple simple. J'obtiens un fichier svg.
Au niveau configuration, asymptote svn, linux 64bits, dvisvgm 2.3.5

Sur un exemple simple (pas de import, pas de config svg dans l'entête, juste un petit carré), quel est le résultat ?

En faisant un `-k` qui garde tous les fichiers, il est toujours possible d'essayer dvisvgm indépendamment d'Asymptote sur le fichier dvi.

O.G.

Re: pas de sortie svg

Posté : dim. 10 mars 2019, 23:34
par GM
Bonsoir,
c'est la réponse d'Olivier (qui m'a été signalée par l'envoi d'un mail) qui vient de me faire réaliser qu'il y avait une demande depuis le 18/02.
Je ne sais pas pourquoi je n'en ai pas eu pour le message initial.
Désolé.

Re: pas de sortie svg

Posté : lun. 11 mars 2019, 00:26
par GM
Je n'ai pas de réponse pour le problème sous linux mais j'ai testé sous windows.

Pour ceux qui, sous Windows, liront le sujet et voudront tester la création d'un svg, j'indique que j'en ai créé un dans les conditions suivantes :

Dans /asy/config.asy :

Code : Tout sélectionner

import settings;
gs="C:\Program Files\gs\gs9.21\bin\gswin64c.exe";
psviewer="C:\Program Files\Ghostgum\gsview\gsview64.exe";
pdfviewer="C:\Program Files\SumatraPDF\SumatraPDF.exe";
//dvips="C:\Program Files\MiKTeX 2.9\miktex\bin\x64\dvips.exe";

dvisvgm="C:\Users\gm\Downloads\dvisvgm-2.6.3-win64\dvisvgm.exe";
A la suite du message d'erreur

Code : Tout sélectionner

ERROR: MiKTeX.Session could not be initialized
j'ai trouvé cette aide : https://sourceforge.net/p/miktex/bugs/2376/
et donc, suivant le conseil donné, j'ai ouvert une console en mode admin et j'ai passé la commande suivante :

Code : Tout sélectionner

Z:\Asymptote\test_SVG>mpm --register-components --verbose

Warning: Option --admin should be specified when running this program with administrator privileges
Operating on the private (per-user) MiKTeX setup
configuring fontconfig\config\fonts.conf
registering C:\Users\marri\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\MiKTeX209-core.dll
registering C:\Users\marri\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\MiKTeX209-core-PS.dll
registering C:\Users\marri\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\MiKTeX209-packagemanager.dll
registering C:\Users\marri\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\MiKTeX209-packagemanager-PS.dll
J'ai pu alors compiler l'exemple simple suivant :
2019-03-11_002856.jpg
2019-03-11_002856.jpg (84.12 Kio) Vu 18042 fois