Adjustbox margin












2














I want to display a vertical line in the middle of my document.
For creating the line I use tikz and for adjusting a margin I use adjustbox.



documentclass[a4paper,12pt]{article}

usepackage{tikz}
usetikzlibrary{positioning}
usepackage[utf8]{inputenc}
usepackage[ngerman]{babel}

usepackage{noto-sans}
renewcommand{familydefault}{sfdefault}

usepackage{geometry}
geometry{
a4paper,
lmargin=0mm,
rmargin=0mm,
tmargin=0mm,
bmargin=0mm,
}

usepackage{showframe}

usepackage{adjustbox}


setlength{parindent}{0cm}
begin{document}
thispagestyle{empty}
begin{tikzpicture}[remember picture,overlay]

adjustbox{margin*=0cm 1cm 1cm 0cm}{
fill[black] (current page.north) rectangle ([xshift=0.1cm]current page.south);
}

end{tikzpicture}
end{document}


Unfortunately, the margin is either applied to the bottom OR to the top. But not both.



Regards Andi










share|improve this question
























  • Does the margin mean that the line starts one cm below the top and ends one cm above the bottom? If so, just do draw[line width=1mm] ([yshift=-1cm]current page.north) -- ([yshift=1cm]current page.south);.
    – marmot
    May 27 at 20:33










  • @marmot Thank you very much! Thats exactly what I wanted.
    – AndiLeni
    May 27 at 20:49










  • Also, adding adjustbox inside a tikzpicture does not work as indented. You need to apply it around it.
    – Martin Scharrer
    49 mins ago












  • @marmot: Please post your comment as an answer, so that AndiLeni can accept it to conclude the question.
    – Martin Scharrer
    48 mins ago












  • @MartinScharrer Done, thanks for pinging me.
    – marmot
    26 mins ago
















2














I want to display a vertical line in the middle of my document.
For creating the line I use tikz and for adjusting a margin I use adjustbox.



documentclass[a4paper,12pt]{article}

usepackage{tikz}
usetikzlibrary{positioning}
usepackage[utf8]{inputenc}
usepackage[ngerman]{babel}

usepackage{noto-sans}
renewcommand{familydefault}{sfdefault}

usepackage{geometry}
geometry{
a4paper,
lmargin=0mm,
rmargin=0mm,
tmargin=0mm,
bmargin=0mm,
}

usepackage{showframe}

usepackage{adjustbox}


setlength{parindent}{0cm}
begin{document}
thispagestyle{empty}
begin{tikzpicture}[remember picture,overlay]

adjustbox{margin*=0cm 1cm 1cm 0cm}{
fill[black] (current page.north) rectangle ([xshift=0.1cm]current page.south);
}

end{tikzpicture}
end{document}


Unfortunately, the margin is either applied to the bottom OR to the top. But not both.



Regards Andi










share|improve this question
























  • Does the margin mean that the line starts one cm below the top and ends one cm above the bottom? If so, just do draw[line width=1mm] ([yshift=-1cm]current page.north) -- ([yshift=1cm]current page.south);.
    – marmot
    May 27 at 20:33










  • @marmot Thank you very much! Thats exactly what I wanted.
    – AndiLeni
    May 27 at 20:49










  • Also, adding adjustbox inside a tikzpicture does not work as indented. You need to apply it around it.
    – Martin Scharrer
    49 mins ago












  • @marmot: Please post your comment as an answer, so that AndiLeni can accept it to conclude the question.
    – Martin Scharrer
    48 mins ago












  • @MartinScharrer Done, thanks for pinging me.
    – marmot
    26 mins ago














2












2








2







I want to display a vertical line in the middle of my document.
For creating the line I use tikz and for adjusting a margin I use adjustbox.



documentclass[a4paper,12pt]{article}

usepackage{tikz}
usetikzlibrary{positioning}
usepackage[utf8]{inputenc}
usepackage[ngerman]{babel}

usepackage{noto-sans}
renewcommand{familydefault}{sfdefault}

usepackage{geometry}
geometry{
a4paper,
lmargin=0mm,
rmargin=0mm,
tmargin=0mm,
bmargin=0mm,
}

usepackage{showframe}

usepackage{adjustbox}


setlength{parindent}{0cm}
begin{document}
thispagestyle{empty}
begin{tikzpicture}[remember picture,overlay]

adjustbox{margin*=0cm 1cm 1cm 0cm}{
fill[black] (current page.north) rectangle ([xshift=0.1cm]current page.south);
}

end{tikzpicture}
end{document}


Unfortunately, the margin is either applied to the bottom OR to the top. But not both.



Regards Andi










share|improve this question















I want to display a vertical line in the middle of my document.
For creating the line I use tikz and for adjusting a margin I use adjustbox.



documentclass[a4paper,12pt]{article}

usepackage{tikz}
usetikzlibrary{positioning}
usepackage[utf8]{inputenc}
usepackage[ngerman]{babel}

usepackage{noto-sans}
renewcommand{familydefault}{sfdefault}

usepackage{geometry}
geometry{
a4paper,
lmargin=0mm,
rmargin=0mm,
tmargin=0mm,
bmargin=0mm,
}

usepackage{showframe}

usepackage{adjustbox}


setlength{parindent}{0cm}
begin{document}
thispagestyle{empty}
begin{tikzpicture}[remember picture,overlay]

adjustbox{margin*=0cm 1cm 1cm 0cm}{
fill[black] (current page.north) rectangle ([xshift=0.1cm]current page.south);
}

end{tikzpicture}
end{document}


Unfortunately, the margin is either applied to the bottom OR to the top. But not both.



Regards Andi







tikz-pgf adjustbox






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 27 at 18:49

























asked May 27 at 18:30









AndiLeni

403




403












  • Does the margin mean that the line starts one cm below the top and ends one cm above the bottom? If so, just do draw[line width=1mm] ([yshift=-1cm]current page.north) -- ([yshift=1cm]current page.south);.
    – marmot
    May 27 at 20:33










  • @marmot Thank you very much! Thats exactly what I wanted.
    – AndiLeni
    May 27 at 20:49










  • Also, adding adjustbox inside a tikzpicture does not work as indented. You need to apply it around it.
    – Martin Scharrer
    49 mins ago












  • @marmot: Please post your comment as an answer, so that AndiLeni can accept it to conclude the question.
    – Martin Scharrer
    48 mins ago












  • @MartinScharrer Done, thanks for pinging me.
    – marmot
    26 mins ago


















  • Does the margin mean that the line starts one cm below the top and ends one cm above the bottom? If so, just do draw[line width=1mm] ([yshift=-1cm]current page.north) -- ([yshift=1cm]current page.south);.
    – marmot
    May 27 at 20:33










  • @marmot Thank you very much! Thats exactly what I wanted.
    – AndiLeni
    May 27 at 20:49










  • Also, adding adjustbox inside a tikzpicture does not work as indented. You need to apply it around it.
    – Martin Scharrer
    49 mins ago












  • @marmot: Please post your comment as an answer, so that AndiLeni can accept it to conclude the question.
    – Martin Scharrer
    48 mins ago












  • @MartinScharrer Done, thanks for pinging me.
    – marmot
    26 mins ago
















Does the margin mean that the line starts one cm below the top and ends one cm above the bottom? If so, just do draw[line width=1mm] ([yshift=-1cm]current page.north) -- ([yshift=1cm]current page.south);.
– marmot
May 27 at 20:33




Does the margin mean that the line starts one cm below the top and ends one cm above the bottom? If so, just do draw[line width=1mm] ([yshift=-1cm]current page.north) -- ([yshift=1cm]current page.south);.
– marmot
May 27 at 20:33












@marmot Thank you very much! Thats exactly what I wanted.
– AndiLeni
May 27 at 20:49




@marmot Thank you very much! Thats exactly what I wanted.
– AndiLeni
May 27 at 20:49












Also, adding adjustbox inside a tikzpicture does not work as indented. You need to apply it around it.
– Martin Scharrer
49 mins ago






Also, adding adjustbox inside a tikzpicture does not work as indented. You need to apply it around it.
– Martin Scharrer
49 mins ago














@marmot: Please post your comment as an answer, so that AndiLeni can accept it to conclude the question.
– Martin Scharrer
48 mins ago






@marmot: Please post your comment as an answer, so that AndiLeni can accept it to conclude the question.
– Martin Scharrer
48 mins ago














@MartinScharrer Done, thanks for pinging me.
– marmot
26 mins ago




@MartinScharrer Done, thanks for pinging me.
– marmot
26 mins ago










2 Answers
2






active

oldest

votes


















1














I think this task is easier with eso-pic:



documentclass[a4paper,12pt]{article}

usepackage{eso-pic}

AddToShipoutPicture{
thicklines
setlengthunitlength{1mm}
AtPageCenter{line(0,1){138.5}}
AtPageCenter{line(0,-1){138.5}}
}

pagestyle{empty}
begin{document}
null
end{document}


enter image description here



Note: magic number 138.5mm is half of A4 paper height (297mm) minus 1cm for top and bottom margins.






share|improve this answer































    1














    From my above comment.



    documentclass[a4paper,12pt]{article}

    usepackage{tikz}
    usepackage[utf8]{inputenc}
    usepackage[ngerman]{babel}

    usepackage{noto-sans}
    renewcommand{familydefault}{sfdefault}

    usepackage{geometry}
    geometry{
    a4paper,
    lmargin=0mm,
    rmargin=0mm,
    tmargin=0mm,
    bmargin=0mm,
    }

    usepackage{showframe}


    setlength{parindent}{0cm}
    begin{document}
    thispagestyle{empty}
    begin{tikzpicture}[remember picture,overlay]
    draw[line width=1mm] ([yshift=-1cm]current page.north) -- ([yshift=1cm]current page.south);
    end{tikzpicture}
    end{document}


    enter image description here






    share|improve this answer





















    • Please add the comment text into your answer (maybe modified a little), so that the answer is selfcontaining.
      – Martin Scharrer
      21 mins ago











    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',
    autoActivateHeartbeat: false,
    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%2f433670%2fadjustbox-margin%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    I think this task is easier with eso-pic:



    documentclass[a4paper,12pt]{article}

    usepackage{eso-pic}

    AddToShipoutPicture{
    thicklines
    setlengthunitlength{1mm}
    AtPageCenter{line(0,1){138.5}}
    AtPageCenter{line(0,-1){138.5}}
    }

    pagestyle{empty}
    begin{document}
    null
    end{document}


    enter image description here



    Note: magic number 138.5mm is half of A4 paper height (297mm) minus 1cm for top and bottom margins.






    share|improve this answer




























      1














      I think this task is easier with eso-pic:



      documentclass[a4paper,12pt]{article}

      usepackage{eso-pic}

      AddToShipoutPicture{
      thicklines
      setlengthunitlength{1mm}
      AtPageCenter{line(0,1){138.5}}
      AtPageCenter{line(0,-1){138.5}}
      }

      pagestyle{empty}
      begin{document}
      null
      end{document}


      enter image description here



      Note: magic number 138.5mm is half of A4 paper height (297mm) minus 1cm for top and bottom margins.






      share|improve this answer


























        1












        1








        1






        I think this task is easier with eso-pic:



        documentclass[a4paper,12pt]{article}

        usepackage{eso-pic}

        AddToShipoutPicture{
        thicklines
        setlengthunitlength{1mm}
        AtPageCenter{line(0,1){138.5}}
        AtPageCenter{line(0,-1){138.5}}
        }

        pagestyle{empty}
        begin{document}
        null
        end{document}


        enter image description here



        Note: magic number 138.5mm is half of A4 paper height (297mm) minus 1cm for top and bottom margins.






        share|improve this answer














        I think this task is easier with eso-pic:



        documentclass[a4paper,12pt]{article}

        usepackage{eso-pic}

        AddToShipoutPicture{
        thicklines
        setlengthunitlength{1mm}
        AtPageCenter{line(0,1){138.5}}
        AtPageCenter{line(0,-1){138.5}}
        }

        pagestyle{empty}
        begin{document}
        null
        end{document}


        enter image description here



        Note: magic number 138.5mm is half of A4 paper height (297mm) minus 1cm for top and bottom margins.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 28 at 6:08

























        answered May 27 at 20:50









        Ignasi

        91.6k4165303




        91.6k4165303























            1














            From my above comment.



            documentclass[a4paper,12pt]{article}

            usepackage{tikz}
            usepackage[utf8]{inputenc}
            usepackage[ngerman]{babel}

            usepackage{noto-sans}
            renewcommand{familydefault}{sfdefault}

            usepackage{geometry}
            geometry{
            a4paper,
            lmargin=0mm,
            rmargin=0mm,
            tmargin=0mm,
            bmargin=0mm,
            }

            usepackage{showframe}


            setlength{parindent}{0cm}
            begin{document}
            thispagestyle{empty}
            begin{tikzpicture}[remember picture,overlay]
            draw[line width=1mm] ([yshift=-1cm]current page.north) -- ([yshift=1cm]current page.south);
            end{tikzpicture}
            end{document}


            enter image description here






            share|improve this answer





















            • Please add the comment text into your answer (maybe modified a little), so that the answer is selfcontaining.
              – Martin Scharrer
              21 mins ago
















            1














            From my above comment.



            documentclass[a4paper,12pt]{article}

            usepackage{tikz}
            usepackage[utf8]{inputenc}
            usepackage[ngerman]{babel}

            usepackage{noto-sans}
            renewcommand{familydefault}{sfdefault}

            usepackage{geometry}
            geometry{
            a4paper,
            lmargin=0mm,
            rmargin=0mm,
            tmargin=0mm,
            bmargin=0mm,
            }

            usepackage{showframe}


            setlength{parindent}{0cm}
            begin{document}
            thispagestyle{empty}
            begin{tikzpicture}[remember picture,overlay]
            draw[line width=1mm] ([yshift=-1cm]current page.north) -- ([yshift=1cm]current page.south);
            end{tikzpicture}
            end{document}


            enter image description here






            share|improve this answer





















            • Please add the comment text into your answer (maybe modified a little), so that the answer is selfcontaining.
              – Martin Scharrer
              21 mins ago














            1












            1








            1






            From my above comment.



            documentclass[a4paper,12pt]{article}

            usepackage{tikz}
            usepackage[utf8]{inputenc}
            usepackage[ngerman]{babel}

            usepackage{noto-sans}
            renewcommand{familydefault}{sfdefault}

            usepackage{geometry}
            geometry{
            a4paper,
            lmargin=0mm,
            rmargin=0mm,
            tmargin=0mm,
            bmargin=0mm,
            }

            usepackage{showframe}


            setlength{parindent}{0cm}
            begin{document}
            thispagestyle{empty}
            begin{tikzpicture}[remember picture,overlay]
            draw[line width=1mm] ([yshift=-1cm]current page.north) -- ([yshift=1cm]current page.south);
            end{tikzpicture}
            end{document}


            enter image description here






            share|improve this answer












            From my above comment.



            documentclass[a4paper,12pt]{article}

            usepackage{tikz}
            usepackage[utf8]{inputenc}
            usepackage[ngerman]{babel}

            usepackage{noto-sans}
            renewcommand{familydefault}{sfdefault}

            usepackage{geometry}
            geometry{
            a4paper,
            lmargin=0mm,
            rmargin=0mm,
            tmargin=0mm,
            bmargin=0mm,
            }

            usepackage{showframe}


            setlength{parindent}{0cm}
            begin{document}
            thispagestyle{empty}
            begin{tikzpicture}[remember picture,overlay]
            draw[line width=1mm] ([yshift=-1cm]current page.north) -- ([yshift=1cm]current page.south);
            end{tikzpicture}
            end{document}


            enter image description here







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 26 mins ago









            marmot

            86.7k499185




            86.7k499185












            • Please add the comment text into your answer (maybe modified a little), so that the answer is selfcontaining.
              – Martin Scharrer
              21 mins ago


















            • Please add the comment text into your answer (maybe modified a little), so that the answer is selfcontaining.
              – Martin Scharrer
              21 mins ago
















            Please add the comment text into your answer (maybe modified a little), so that the answer is selfcontaining.
            – Martin Scharrer
            21 mins ago




            Please add the comment text into your answer (maybe modified a little), so that the answer is selfcontaining.
            – Martin Scharrer
            21 mins ago


















            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%2f433670%2fadjustbox-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

            Accessing regular linux commands in Huawei's Dopra Linux

            Can't connect RFCOMM socket: Host is down

            Kernel panic - not syncing: Fatal Exception in Interrupt