How to troubleshoot unwanted white spaces smartly?











up vote
4
down vote

favorite












Why is there a white space on the left side?



documentclass{standalone}
usepackage{asymptote}
begin{document}
noindent
begin{asy}
size(10cm,10cm);
draw((0,0)--(100,100));
draw((0,100)--(100,0));
dot((50,50));
end{asy}
end{document}


enter image description here










share|improve this question
























  • @chishimotoji: You must contact the package author to remove the white spaces.
    – Artificial Stupidity
    1 hour ago










  • @ArtificialStupidity I filed a bug report to one of the maintainers.
    – egreg
    1 hour ago










  • @egreg: Thank you very much!
    – Artificial Stupidity
    1 hour ago















up vote
4
down vote

favorite












Why is there a white space on the left side?



documentclass{standalone}
usepackage{asymptote}
begin{document}
noindent
begin{asy}
size(10cm,10cm);
draw((0,0)--(100,100));
draw((0,100)--(100,0));
dot((50,50));
end{asy}
end{document}


enter image description here










share|improve this question
























  • @chishimotoji: You must contact the package author to remove the white spaces.
    – Artificial Stupidity
    1 hour ago










  • @ArtificialStupidity I filed a bug report to one of the maintainers.
    – egreg
    1 hour ago










  • @egreg: Thank you very much!
    – Artificial Stupidity
    1 hour ago













up vote
4
down vote

favorite









up vote
4
down vote

favorite











Why is there a white space on the left side?



documentclass{standalone}
usepackage{asymptote}
begin{document}
noindent
begin{asy}
size(10cm,10cm);
draw((0,0)--(100,100));
draw((0,100)--(100,0));
dot((50,50));
end{asy}
end{document}


enter image description here










share|improve this question















Why is there a white space on the left side?



documentclass{standalone}
usepackage{asymptote}
begin{document}
noindent
begin{asy}
size(10cm,10cm);
draw((0,0)--(100,100));
draw((0,100)--(100,0));
dot((50,50));
end{asy}
end{document}


enter image description here







asymptote






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago

























asked 2 hours ago









Artificial Stupidity

5,11011039




5,11011039












  • @chishimotoji: You must contact the package author to remove the white spaces.
    – Artificial Stupidity
    1 hour ago










  • @ArtificialStupidity I filed a bug report to one of the maintainers.
    – egreg
    1 hour ago










  • @egreg: Thank you very much!
    – Artificial Stupidity
    1 hour ago


















  • @chishimotoji: You must contact the package author to remove the white spaces.
    – Artificial Stupidity
    1 hour ago










  • @ArtificialStupidity I filed a bug report to one of the maintainers.
    – egreg
    1 hour ago










  • @egreg: Thank you very much!
    – Artificial Stupidity
    1 hour ago
















@chishimotoji: You must contact the package author to remove the white spaces.
– Artificial Stupidity
1 hour ago




@chishimotoji: You must contact the package author to remove the white spaces.
– Artificial Stupidity
1 hour ago












@ArtificialStupidity I filed a bug report to one of the maintainers.
– egreg
1 hour ago




@ArtificialStupidity I filed a bug report to one of the maintainers.
– egreg
1 hour ago












@egreg: Thank you very much!
– Artificial Stupidity
1 hour ago




@egreg: Thank you very much!
– Artificial Stupidity
1 hour ago










1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










Three unprotected end-of-lines in asymptote.sty (marked with %<---).



documentclass{standalone}
usepackage{asymptote}
makeatletter
defasy@init{%<---
defASYlatexdir{}%<---
ifxasylatexdiremptyelse
defASYlatexdir{asylatexdir/}%
fi
ifxasydiremptyelse
defASYasydir{asydir/}%
fi
defASYprefix{ASYlatexdirASYasydir}%
}
renewcommandasy[1]{%
stepcounter{asy}%
setkeys{ASYkeys}{#1}%
ifASYattach
ASYinlinefalse
fi
asy@init
immediatewriteAsyPreStream{%
noexpandInputIfFileExists{%
ASYprefixnoexpandjobname-thec@asy.pre}{}{}%
}%<---
asy@write@graphic@header
letThisAsymptoteWriteAsyLine
ProcessAsymptote{asy}%
}
makeatother

begin{document}

begin{asy}
size(10cm,10cm);
draw((0,0)--(100,100));
draw((0,100)--(100,0));
dot((50,50));
end{asy}

end{document}


Note that noindent is not necessary.



How to find them? I removed noindent that does nothing with standalone, replacing it with



tracingcommands=1 tracingmacros=1


I compiled with pdflatex, ran asy and compiled again. The .log file is the searched for {blank space}:



asy@init -> def ASYlatexdir {} ifx asylatexdir empty else def ASYlatex
dir {asylatexdir /}fi ifx asydir empty else def ASYasydir {asydir /}f
i def ASYprefix {ASYlatexdir ASYasydir }
{blank space }
{def}
{blank space }
{def}
{immediate}

ASYprefix ->ASYlatexdir ASYasydir

ASYlatexdir ->

ASYasydir ->
{blank space }

asy@write@graphic@header ->immediate openout AsyStream =ASYasydir jobname


It is apparent that asy@init is responsible and indeed its definition is



defasy@init{
defASYlatexdir{}
ifxasylatexdiremptyelse
defASYlatexdir{asylatexdir/}%
fi
ifxasydiremptyelse
defASYasydir{asydir/}%
fi
defASYprefix{ASYlatexdirASYasydir}%
}


showing two missing % protections.



Redefine the command and retry. Darn! There's still a blank space!



ASYasydir ->
{blank space }

asy@write@graphic@header ->immediate openout AsyStream =ASYasydir jobname


Look for asy@write@graphic@header in asymptote.sty: we find it in the definition of asy:



newcommandasy[1]{%
stepcounter{asy}%
setkeys{ASYkeys}{#1}%
ifASYattach
ASYinlinefalse
fi
asy@init
immediatewriteAsyPreStream{%
noexpandInputIfFileExists{%
ASYprefixnoexpandjobname-thec@asy.pre}{}{}%
}
asy@write@graphic@header
letThisAsymptoteWriteAsyLine
ProcessAsymptote{asy}%
}


Fix it and check again. Hurray! No spaces!






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f466170%2fhow-to-troubleshoot-unwanted-white-spaces-smartly%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote



    accepted










    Three unprotected end-of-lines in asymptote.sty (marked with %<---).



    documentclass{standalone}
    usepackage{asymptote}
    makeatletter
    defasy@init{%<---
    defASYlatexdir{}%<---
    ifxasylatexdiremptyelse
    defASYlatexdir{asylatexdir/}%
    fi
    ifxasydiremptyelse
    defASYasydir{asydir/}%
    fi
    defASYprefix{ASYlatexdirASYasydir}%
    }
    renewcommandasy[1]{%
    stepcounter{asy}%
    setkeys{ASYkeys}{#1}%
    ifASYattach
    ASYinlinefalse
    fi
    asy@init
    immediatewriteAsyPreStream{%
    noexpandInputIfFileExists{%
    ASYprefixnoexpandjobname-thec@asy.pre}{}{}%
    }%<---
    asy@write@graphic@header
    letThisAsymptoteWriteAsyLine
    ProcessAsymptote{asy}%
    }
    makeatother

    begin{document}

    begin{asy}
    size(10cm,10cm);
    draw((0,0)--(100,100));
    draw((0,100)--(100,0));
    dot((50,50));
    end{asy}

    end{document}


    Note that noindent is not necessary.



    How to find them? I removed noindent that does nothing with standalone, replacing it with



    tracingcommands=1 tracingmacros=1


    I compiled with pdflatex, ran asy and compiled again. The .log file is the searched for {blank space}:



    asy@init -> def ASYlatexdir {} ifx asylatexdir empty else def ASYlatex
    dir {asylatexdir /}fi ifx asydir empty else def ASYasydir {asydir /}f
    i def ASYprefix {ASYlatexdir ASYasydir }
    {blank space }
    {def}
    {blank space }
    {def}
    {immediate}

    ASYprefix ->ASYlatexdir ASYasydir

    ASYlatexdir ->

    ASYasydir ->
    {blank space }

    asy@write@graphic@header ->immediate openout AsyStream =ASYasydir jobname


    It is apparent that asy@init is responsible and indeed its definition is



    defasy@init{
    defASYlatexdir{}
    ifxasylatexdiremptyelse
    defASYlatexdir{asylatexdir/}%
    fi
    ifxasydiremptyelse
    defASYasydir{asydir/}%
    fi
    defASYprefix{ASYlatexdirASYasydir}%
    }


    showing two missing % protections.



    Redefine the command and retry. Darn! There's still a blank space!



    ASYasydir ->
    {blank space }

    asy@write@graphic@header ->immediate openout AsyStream =ASYasydir jobname


    Look for asy@write@graphic@header in asymptote.sty: we find it in the definition of asy:



    newcommandasy[1]{%
    stepcounter{asy}%
    setkeys{ASYkeys}{#1}%
    ifASYattach
    ASYinlinefalse
    fi
    asy@init
    immediatewriteAsyPreStream{%
    noexpandInputIfFileExists{%
    ASYprefixnoexpandjobname-thec@asy.pre}{}{}%
    }
    asy@write@graphic@header
    letThisAsymptoteWriteAsyLine
    ProcessAsymptote{asy}%
    }


    Fix it and check again. Hurray! No spaces!






    share|improve this answer



























      up vote
      3
      down vote



      accepted










      Three unprotected end-of-lines in asymptote.sty (marked with %<---).



      documentclass{standalone}
      usepackage{asymptote}
      makeatletter
      defasy@init{%<---
      defASYlatexdir{}%<---
      ifxasylatexdiremptyelse
      defASYlatexdir{asylatexdir/}%
      fi
      ifxasydiremptyelse
      defASYasydir{asydir/}%
      fi
      defASYprefix{ASYlatexdirASYasydir}%
      }
      renewcommandasy[1]{%
      stepcounter{asy}%
      setkeys{ASYkeys}{#1}%
      ifASYattach
      ASYinlinefalse
      fi
      asy@init
      immediatewriteAsyPreStream{%
      noexpandInputIfFileExists{%
      ASYprefixnoexpandjobname-thec@asy.pre}{}{}%
      }%<---
      asy@write@graphic@header
      letThisAsymptoteWriteAsyLine
      ProcessAsymptote{asy}%
      }
      makeatother

      begin{document}

      begin{asy}
      size(10cm,10cm);
      draw((0,0)--(100,100));
      draw((0,100)--(100,0));
      dot((50,50));
      end{asy}

      end{document}


      Note that noindent is not necessary.



      How to find them? I removed noindent that does nothing with standalone, replacing it with



      tracingcommands=1 tracingmacros=1


      I compiled with pdflatex, ran asy and compiled again. The .log file is the searched for {blank space}:



      asy@init -> def ASYlatexdir {} ifx asylatexdir empty else def ASYlatex
      dir {asylatexdir /}fi ifx asydir empty else def ASYasydir {asydir /}f
      i def ASYprefix {ASYlatexdir ASYasydir }
      {blank space }
      {def}
      {blank space }
      {def}
      {immediate}

      ASYprefix ->ASYlatexdir ASYasydir

      ASYlatexdir ->

      ASYasydir ->
      {blank space }

      asy@write@graphic@header ->immediate openout AsyStream =ASYasydir jobname


      It is apparent that asy@init is responsible and indeed its definition is



      defasy@init{
      defASYlatexdir{}
      ifxasylatexdiremptyelse
      defASYlatexdir{asylatexdir/}%
      fi
      ifxasydiremptyelse
      defASYasydir{asydir/}%
      fi
      defASYprefix{ASYlatexdirASYasydir}%
      }


      showing two missing % protections.



      Redefine the command and retry. Darn! There's still a blank space!



      ASYasydir ->
      {blank space }

      asy@write@graphic@header ->immediate openout AsyStream =ASYasydir jobname


      Look for asy@write@graphic@header in asymptote.sty: we find it in the definition of asy:



      newcommandasy[1]{%
      stepcounter{asy}%
      setkeys{ASYkeys}{#1}%
      ifASYattach
      ASYinlinefalse
      fi
      asy@init
      immediatewriteAsyPreStream{%
      noexpandInputIfFileExists{%
      ASYprefixnoexpandjobname-thec@asy.pre}{}{}%
      }
      asy@write@graphic@header
      letThisAsymptoteWriteAsyLine
      ProcessAsymptote{asy}%
      }


      Fix it and check again. Hurray! No spaces!






      share|improve this answer

























        up vote
        3
        down vote



        accepted







        up vote
        3
        down vote



        accepted






        Three unprotected end-of-lines in asymptote.sty (marked with %<---).



        documentclass{standalone}
        usepackage{asymptote}
        makeatletter
        defasy@init{%<---
        defASYlatexdir{}%<---
        ifxasylatexdiremptyelse
        defASYlatexdir{asylatexdir/}%
        fi
        ifxasydiremptyelse
        defASYasydir{asydir/}%
        fi
        defASYprefix{ASYlatexdirASYasydir}%
        }
        renewcommandasy[1]{%
        stepcounter{asy}%
        setkeys{ASYkeys}{#1}%
        ifASYattach
        ASYinlinefalse
        fi
        asy@init
        immediatewriteAsyPreStream{%
        noexpandInputIfFileExists{%
        ASYprefixnoexpandjobname-thec@asy.pre}{}{}%
        }%<---
        asy@write@graphic@header
        letThisAsymptoteWriteAsyLine
        ProcessAsymptote{asy}%
        }
        makeatother

        begin{document}

        begin{asy}
        size(10cm,10cm);
        draw((0,0)--(100,100));
        draw((0,100)--(100,0));
        dot((50,50));
        end{asy}

        end{document}


        Note that noindent is not necessary.



        How to find them? I removed noindent that does nothing with standalone, replacing it with



        tracingcommands=1 tracingmacros=1


        I compiled with pdflatex, ran asy and compiled again. The .log file is the searched for {blank space}:



        asy@init -> def ASYlatexdir {} ifx asylatexdir empty else def ASYlatex
        dir {asylatexdir /}fi ifx asydir empty else def ASYasydir {asydir /}f
        i def ASYprefix {ASYlatexdir ASYasydir }
        {blank space }
        {def}
        {blank space }
        {def}
        {immediate}

        ASYprefix ->ASYlatexdir ASYasydir

        ASYlatexdir ->

        ASYasydir ->
        {blank space }

        asy@write@graphic@header ->immediate openout AsyStream =ASYasydir jobname


        It is apparent that asy@init is responsible and indeed its definition is



        defasy@init{
        defASYlatexdir{}
        ifxasylatexdiremptyelse
        defASYlatexdir{asylatexdir/}%
        fi
        ifxasydiremptyelse
        defASYasydir{asydir/}%
        fi
        defASYprefix{ASYlatexdirASYasydir}%
        }


        showing two missing % protections.



        Redefine the command and retry. Darn! There's still a blank space!



        ASYasydir ->
        {blank space }

        asy@write@graphic@header ->immediate openout AsyStream =ASYasydir jobname


        Look for asy@write@graphic@header in asymptote.sty: we find it in the definition of asy:



        newcommandasy[1]{%
        stepcounter{asy}%
        setkeys{ASYkeys}{#1}%
        ifASYattach
        ASYinlinefalse
        fi
        asy@init
        immediatewriteAsyPreStream{%
        noexpandInputIfFileExists{%
        ASYprefixnoexpandjobname-thec@asy.pre}{}{}%
        }
        asy@write@graphic@header
        letThisAsymptoteWriteAsyLine
        ProcessAsymptote{asy}%
        }


        Fix it and check again. Hurray! No spaces!






        share|improve this answer














        Three unprotected end-of-lines in asymptote.sty (marked with %<---).



        documentclass{standalone}
        usepackage{asymptote}
        makeatletter
        defasy@init{%<---
        defASYlatexdir{}%<---
        ifxasylatexdiremptyelse
        defASYlatexdir{asylatexdir/}%
        fi
        ifxasydiremptyelse
        defASYasydir{asydir/}%
        fi
        defASYprefix{ASYlatexdirASYasydir}%
        }
        renewcommandasy[1]{%
        stepcounter{asy}%
        setkeys{ASYkeys}{#1}%
        ifASYattach
        ASYinlinefalse
        fi
        asy@init
        immediatewriteAsyPreStream{%
        noexpandInputIfFileExists{%
        ASYprefixnoexpandjobname-thec@asy.pre}{}{}%
        }%<---
        asy@write@graphic@header
        letThisAsymptoteWriteAsyLine
        ProcessAsymptote{asy}%
        }
        makeatother

        begin{document}

        begin{asy}
        size(10cm,10cm);
        draw((0,0)--(100,100));
        draw((0,100)--(100,0));
        dot((50,50));
        end{asy}

        end{document}


        Note that noindent is not necessary.



        How to find them? I removed noindent that does nothing with standalone, replacing it with



        tracingcommands=1 tracingmacros=1


        I compiled with pdflatex, ran asy and compiled again. The .log file is the searched for {blank space}:



        asy@init -> def ASYlatexdir {} ifx asylatexdir empty else def ASYlatex
        dir {asylatexdir /}fi ifx asydir empty else def ASYasydir {asydir /}f
        i def ASYprefix {ASYlatexdir ASYasydir }
        {blank space }
        {def}
        {blank space }
        {def}
        {immediate}

        ASYprefix ->ASYlatexdir ASYasydir

        ASYlatexdir ->

        ASYasydir ->
        {blank space }

        asy@write@graphic@header ->immediate openout AsyStream =ASYasydir jobname


        It is apparent that asy@init is responsible and indeed its definition is



        defasy@init{
        defASYlatexdir{}
        ifxasylatexdiremptyelse
        defASYlatexdir{asylatexdir/}%
        fi
        ifxasydiremptyelse
        defASYasydir{asydir/}%
        fi
        defASYprefix{ASYlatexdirASYasydir}%
        }


        showing two missing % protections.



        Redefine the command and retry. Darn! There's still a blank space!



        ASYasydir ->
        {blank space }

        asy@write@graphic@header ->immediate openout AsyStream =ASYasydir jobname


        Look for asy@write@graphic@header in asymptote.sty: we find it in the definition of asy:



        newcommandasy[1]{%
        stepcounter{asy}%
        setkeys{ASYkeys}{#1}%
        ifASYattach
        ASYinlinefalse
        fi
        asy@init
        immediatewriteAsyPreStream{%
        noexpandInputIfFileExists{%
        ASYprefixnoexpandjobname-thec@asy.pre}{}{}%
        }
        asy@write@graphic@header
        letThisAsymptoteWriteAsyLine
        ProcessAsymptote{asy}%
        }


        Fix it and check again. Hurray! No spaces!







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 1 hour ago

























        answered 1 hour ago









        egreg

        705k8618763155




        705k8618763155






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f466170%2fhow-to-troubleshoot-unwanted-white-spaces-smartly%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Quarter-circle Tiles

            build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

            Mont Emei