Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shifted pdf output #286

Closed
asmwarrior opened this issue Dec 28, 2021 · 14 comments
Closed

Shifted pdf output #286

asmwarrior opened this issue Dec 28, 2021 · 14 comments

Comments

@asmwarrior
Copy link

Hi, I just try to run a simple code below:

import geometry;

size(10cm);

// currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-0.25,.75));
// show(currentcoordsys);

/* View the definition of triangle triangleabc(real,real,real,real,point) */
triangle t=triangleabc(3,4,5);
/* View the definition of void show(picture,Label,Label,Label,Label,Label,Label,triangle,pen,filltype) */
show(La="3", Lb="4", Lc="5",t);

Which is the first simple code in the page:
https://web.archive.org/web/20180420081349/http://www.piprime.fr/developpement/triangle_asy/?posts_per_page=-1

And I got the shifted result, see below image

2021-12-28 20 59 43

I'm using the latest 2.73 version of Asymptote under Windows 64bit, and the latest gs Ghostscript AGPL Release

Any ideas which cause this error?

Thanks.

@asmwarrior
Copy link
Author

OK, I try to run the code in the asymptote online editor: http://asymptote.ualberta.ca/

It looks like the online editor works OK.

So, is it possible this is a Windows OS only bug?

@lemniscati
Copy link
Contributor

It might be useful to invoke asymptote with -keep option, and we/you might see what happens through intermediate files.

-k,-keep               Keep intermediate files [false]

@johncbowman
Copy link
Member

johncbowman commented Dec 28, 2021

I am closing this issue as I can't reproduce it on 64 bit Windows 10 with Asymptote 2.73, TeXLive 2021, and gs 9.55.0.
Maybe you are using MikTeX or some other older TeX installation? It looks like the kind of problem caused by spurious spaces in some TeX package.

@asmwarrior
Copy link
Author

I am closing this issue as I can't reproduce it on 64 bit Windows 10 with Asymptote 2.73, TeXLive 2021, and gs 9.55.0. Maybe you are using MikTeX or some other older TeX installation? It looks like the kind of problem caused by spurious spaces in some TeX package.

I am using TexLive 2021, Asymptote 2.73, gs 9.55.0 under Windows 7 64bit.

So, this is a bug from my side.

@asmwarrior
Copy link
Author

It might be useful to invoke asymptote with -keep option, and we/you might see what happens through intermediate files.

-k,-keep               Keep intermediate files [false]

Thanks, I will check those files and report here.

@asmwarrior
Copy link
Author

Hi, I have just add the --keep option, and here is the result files.

There are so many files, so I add them to the zip file as attachment, can you have a look, thanks.

texput.aux
texput.log
trianglexyz.asy
trianglexyz.pdf
trianglexyz_.aux
trianglexyz_.dvi
trianglexyz_.eps
trianglexyz_.log
trianglexyz_.ps
trianglexyz_.tex
trianglexyz_0.eps

The trianglexyz.asy is the input file, all other files are generated by Asymptote.

Thanks
trianglexyz_draw.zip
.

@johncbowman
Copy link
Member

In order to get those output files, you must have specified other command line options or have other settings in your config.asy file, which we need to know about.

Please post your config.asy file and also the standard output and pdf file generated by

asy -vvv -k -f pdf -config "" trianglexyz.asy

@johncbowman
Copy link
Member

I wonder if the difference to do with A4 vs. letter paper size in the TeXLive settings.

@asmwarrior
Copy link
Author

In order to get those output files, you must have specified other command line options or have other settings in your config.asy file, which we need to know about.

Please post your config.asy file and also the standard output and pdf file generated by

asy -vvv -k -f pdf -config "" trianglexyz.asy

Hi, I have already upload the zip file, which contains all the generated files, see this comment:

#286 (comment)

The trianglexyz_draw.zip contains all the files.

@asmwarrior
Copy link
Author

asmwarrior commented Dec 29, 2021

Here is my config.asy file

    import settings;
    outformat="pdf";
    offline=true;
    papertype="a4";
    dvisvgm="E:\texlive\2021\bin\win32\dvisvgm.exe";
    gs = "C:\Program Files\gs\gs9.55.0\bin\gswin64c.exe";
    psviewer="D:\Program Files\Artifex Software\gsview6.0\bin\gsview.exe";
    htmlviewer="E:\download\FirefoxPortable\FirefoxPortable.exe";
    pdfviewer = "E:\download\office\SumatraPDF\SumatraPDF.exe";
    texpath = "E:\texlive\2021\bin\win32";
    dvips="E:\texlive\2021\bin\win32\dvips";
    //glOptions="-indirect";
    prc=false;
    //dir="";
    interactiveView=false;
    batchView=false;
    maxtile=(512,512);
    render=-4;

@johncbowman
Copy link
Member

Please try the following test:
Remove the line
papertype="a4";
from your config.asy. Everything should be fine now. So we've tracked down the problem. Always remember to post your config.asy settings when reporting bugs.

@johncbowman johncbowman reopened this Dec 29, 2021
@johncbowman
Copy link
Member

Alternatively, you can specify -config "" on the command line to override your config file settings, as specified above.

@asmwarrior
Copy link
Author

Please try the following test: Remove the line papertype="a4"; from your config.asy. Everything should be fine now. So we've tracked down the problem. Always remember to post your config.asy settings when reporting bugs.

Great!
I just comment out the line from config.asy

    //papertype="a4";

Then, I got the correct result.

Thanks.

@johncbowman johncbowman changed the title geometry module get shifted output pdf Shifted pdf output Dec 29, 2021
@asmwarrior
Copy link
Author

asmwarrior commented Dec 29, 2021

Always remember to post your config.asy settings when reporting bugs.

OK, I will. Basically, we can have an option to "Skip" the config.asy.

In this command:

asy -vvv -k -f pdf -config "" trianglexyz.asy

Do you meant that the empty double quote string "" means we just skip the config.asy file in system folder(In my system: C:\Users\myusername\.asy), and use an empty config file? In this way, the default config setting is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants