includesvg, absurdly large image margin











up vote
0
down vote

favorite












I am trying to include an SVG image into my document which had always (kind of) seemed to work when using includesvg. But now I have an image that I created from a postscript file, modified in Inkscape (saved as plain svg), which is not centered at all when included using:



begin{figure}                                                                   
centering
includesvg{resources/svg/an-image}
end{figure}


When I run everything through pdflatex, the left border of the image is positioned in the center of the page, most of the right part is cut off and if I add a caption it is placed way below the images lower border. It looks as if the image had a very large empty margin (which it definitely does not have in the SVG file).



Unfortunately the image itself is confidential so I cannot share it here.
What might be the cause of this? Might there be a workaround using another command than includesvg (that one has caused me unnecessary trouble before)?










share|improve this question




















  • 1




    Can you copy the .svg file, replace everything confidential with one large rectangle and if this also produces the error, share the svg file for us to test?
    – samcarter
    Jun 21 at 15:00










  • if you work with Inkscape, yo just save a copy in pdf format and import it using graphicx package like in this post
    – J Leon V.
    Jun 21 at 15:00








  • 1




    After some inspection I believe the problem probably lies with inkscape, the apparent image size after including the image with includesvg approximately matches the pagesize in Inkscape before resizing to the actual content's dimensions. I will just do as suggested and use another file format for now.
    – Peter
    Jun 21 at 15:44










  • I believe there is little advantage in exporting a modified postscript as .svg as opposed to, say, PDF if you only want to include it in a .tex document.
    – moewe
    Jun 21 at 15:49















up vote
0
down vote

favorite












I am trying to include an SVG image into my document which had always (kind of) seemed to work when using includesvg. But now I have an image that I created from a postscript file, modified in Inkscape (saved as plain svg), which is not centered at all when included using:



begin{figure}                                                                   
centering
includesvg{resources/svg/an-image}
end{figure}


When I run everything through pdflatex, the left border of the image is positioned in the center of the page, most of the right part is cut off and if I add a caption it is placed way below the images lower border. It looks as if the image had a very large empty margin (which it definitely does not have in the SVG file).



Unfortunately the image itself is confidential so I cannot share it here.
What might be the cause of this? Might there be a workaround using another command than includesvg (that one has caused me unnecessary trouble before)?










share|improve this question




















  • 1




    Can you copy the .svg file, replace everything confidential with one large rectangle and if this also produces the error, share the svg file for us to test?
    – samcarter
    Jun 21 at 15:00










  • if you work with Inkscape, yo just save a copy in pdf format and import it using graphicx package like in this post
    – J Leon V.
    Jun 21 at 15:00








  • 1




    After some inspection I believe the problem probably lies with inkscape, the apparent image size after including the image with includesvg approximately matches the pagesize in Inkscape before resizing to the actual content's dimensions. I will just do as suggested and use another file format for now.
    – Peter
    Jun 21 at 15:44










  • I believe there is little advantage in exporting a modified postscript as .svg as opposed to, say, PDF if you only want to include it in a .tex document.
    – moewe
    Jun 21 at 15:49













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am trying to include an SVG image into my document which had always (kind of) seemed to work when using includesvg. But now I have an image that I created from a postscript file, modified in Inkscape (saved as plain svg), which is not centered at all when included using:



begin{figure}                                                                   
centering
includesvg{resources/svg/an-image}
end{figure}


When I run everything through pdflatex, the left border of the image is positioned in the center of the page, most of the right part is cut off and if I add a caption it is placed way below the images lower border. It looks as if the image had a very large empty margin (which it definitely does not have in the SVG file).



Unfortunately the image itself is confidential so I cannot share it here.
What might be the cause of this? Might there be a workaround using another command than includesvg (that one has caused me unnecessary trouble before)?










share|improve this question















I am trying to include an SVG image into my document which had always (kind of) seemed to work when using includesvg. But now I have an image that I created from a postscript file, modified in Inkscape (saved as plain svg), which is not centered at all when included using:



begin{figure}                                                                   
centering
includesvg{resources/svg/an-image}
end{figure}


When I run everything through pdflatex, the left border of the image is positioned in the center of the page, most of the right part is cut off and if I add a caption it is placed way below the images lower border. It looks as if the image had a very large empty margin (which it definitely does not have in the SVG file).



Unfortunately the image itself is confidential so I cannot share it here.
What might be the cause of this? Might there be a workaround using another command than includesvg (that one has caused me unnecessary trouble before)?







pdftex svg






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 21 at 15:31









nox

3,367421




3,367421










asked Jun 21 at 14:52









Peter

1273




1273








  • 1




    Can you copy the .svg file, replace everything confidential with one large rectangle and if this also produces the error, share the svg file for us to test?
    – samcarter
    Jun 21 at 15:00










  • if you work with Inkscape, yo just save a copy in pdf format and import it using graphicx package like in this post
    – J Leon V.
    Jun 21 at 15:00








  • 1




    After some inspection I believe the problem probably lies with inkscape, the apparent image size after including the image with includesvg approximately matches the pagesize in Inkscape before resizing to the actual content's dimensions. I will just do as suggested and use another file format for now.
    – Peter
    Jun 21 at 15:44










  • I believe there is little advantage in exporting a modified postscript as .svg as opposed to, say, PDF if you only want to include it in a .tex document.
    – moewe
    Jun 21 at 15:49














  • 1




    Can you copy the .svg file, replace everything confidential with one large rectangle and if this also produces the error, share the svg file for us to test?
    – samcarter
    Jun 21 at 15:00










  • if you work with Inkscape, yo just save a copy in pdf format and import it using graphicx package like in this post
    – J Leon V.
    Jun 21 at 15:00








  • 1




    After some inspection I believe the problem probably lies with inkscape, the apparent image size after including the image with includesvg approximately matches the pagesize in Inkscape before resizing to the actual content's dimensions. I will just do as suggested and use another file format for now.
    – Peter
    Jun 21 at 15:44










  • I believe there is little advantage in exporting a modified postscript as .svg as opposed to, say, PDF if you only want to include it in a .tex document.
    – moewe
    Jun 21 at 15:49








1




1




Can you copy the .svg file, replace everything confidential with one large rectangle and if this also produces the error, share the svg file for us to test?
– samcarter
Jun 21 at 15:00




Can you copy the .svg file, replace everything confidential with one large rectangle and if this also produces the error, share the svg file for us to test?
– samcarter
Jun 21 at 15:00












if you work with Inkscape, yo just save a copy in pdf format and import it using graphicx package like in this post
– J Leon V.
Jun 21 at 15:00






if you work with Inkscape, yo just save a copy in pdf format and import it using graphicx package like in this post
– J Leon V.
Jun 21 at 15:00






1




1




After some inspection I believe the problem probably lies with inkscape, the apparent image size after including the image with includesvg approximately matches the pagesize in Inkscape before resizing to the actual content's dimensions. I will just do as suggested and use another file format for now.
– Peter
Jun 21 at 15:44




After some inspection I believe the problem probably lies with inkscape, the apparent image size after including the image with includesvg approximately matches the pagesize in Inkscape before resizing to the actual content's dimensions. I will just do as suggested and use another file format for now.
– Peter
Jun 21 at 15:44












I believe there is little advantage in exporting a modified postscript as .svg as opposed to, say, PDF if you only want to include it in a .tex document.
– moewe
Jun 21 at 15:49




I believe there is little advantage in exporting a modified postscript as .svg as opposed to, say, PDF if you only want to include it in a .tex document.
– moewe
Jun 21 at 15:49










1 Answer
1






active

oldest

votes

















up vote
0
down vote













You may have invisible objects that extend outside of the SVG's viewBox (inksacpe's page). Have a look at the inkscapearea option. Possible values are





  • drawing/nocrop (default) : adjust SVG viewbox to fit all elements.


  • page/nocrop : respect SVG viewBox.






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%2f437404%2fincludesvg-absurdly-large-image-margin%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
    0
    down vote













    You may have invisible objects that extend outside of the SVG's viewBox (inksacpe's page). Have a look at the inkscapearea option. Possible values are





    • drawing/nocrop (default) : adjust SVG viewbox to fit all elements.


    • page/nocrop : respect SVG viewBox.






    share|improve this answer

























      up vote
      0
      down vote













      You may have invisible objects that extend outside of the SVG's viewBox (inksacpe's page). Have a look at the inkscapearea option. Possible values are





      • drawing/nocrop (default) : adjust SVG viewbox to fit all elements.


      • page/nocrop : respect SVG viewBox.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        You may have invisible objects that extend outside of the SVG's viewBox (inksacpe's page). Have a look at the inkscapearea option. Possible values are





        • drawing/nocrop (default) : adjust SVG viewbox to fit all elements.


        • page/nocrop : respect SVG viewBox.






        share|improve this answer












        You may have invisible objects that extend outside of the SVG's viewBox (inksacpe's page). Have a look at the inkscapearea option. Possible values are





        • drawing/nocrop (default) : adjust SVG viewbox to fit all elements.


        • page/nocrop : respect SVG viewBox.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 22 at 7:59









        NicolaF_

        212




        212






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f437404%2fincludesvg-absurdly-large-image-margin%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

            How to change which sound is reproduced for terminal bell?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Can I use Tabulator js library in my java Spring + Thymeleaf project?