Coloured box on top and left side of text











up vote
2
down vote

favorite












How can i create a document where each page consist of a text-box containing the page's content, with a colored box on its top and left side and the same heading (text 1) on each side, like shown in the picture below which was created in publisher?



I have already looked into coloring the marginpar with tikz, but i am unable to get the desired result.



Desired result










share|improve this question


















  • 1




    Welcome to TeX.SE. Please add a MWE showing what you have tried and where you are stuck at.
    – nidhin
    Nov 23 at 20:32















up vote
2
down vote

favorite












How can i create a document where each page consist of a text-box containing the page's content, with a colored box on its top and left side and the same heading (text 1) on each side, like shown in the picture below which was created in publisher?



I have already looked into coloring the marginpar with tikz, but i am unable to get the desired result.



Desired result










share|improve this question


















  • 1




    Welcome to TeX.SE. Please add a MWE showing what you have tried and where you are stuck at.
    – nidhin
    Nov 23 at 20:32













up vote
2
down vote

favorite









up vote
2
down vote

favorite











How can i create a document where each page consist of a text-box containing the page's content, with a colored box on its top and left side and the same heading (text 1) on each side, like shown in the picture below which was created in publisher?



I have already looked into coloring the marginpar with tikz, but i am unable to get the desired result.



Desired result










share|improve this question













How can i create a document where each page consist of a text-box containing the page's content, with a colored box on its top and left side and the same heading (text 1) on each side, like shown in the picture below which was created in publisher?



I have already looked into coloring the marginpar with tikz, but i am unable to get the desired result.



Desired result







tikz-pgf






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 23 at 20:20









JTHG

133




133








  • 1




    Welcome to TeX.SE. Please add a MWE showing what you have tried and where you are stuck at.
    – nidhin
    Nov 23 at 20:32














  • 1




    Welcome to TeX.SE. Please add a MWE showing what you have tried and where you are stuck at.
    – nidhin
    Nov 23 at 20:32








1




1




Welcome to TeX.SE. Please add a MWE showing what you have tried and where you are stuck at.
– nidhin
Nov 23 at 20:32




Welcome to TeX.SE. Please add a MWE showing what you have tried and where you are stuck at.
– nidhin
Nov 23 at 20:32










3 Answers
3






active

oldest

votes

















up vote
7
down vote



accepted










Here is an option using eso-pic to place the sidebar, top bar and text using positioning relative to the text block:



enter image description here



documentclass{article}

usepackage{xcolor,eso-pic}
usepackage{lipsum}

definecolor{sidebarcolour}{RGB}{248,203,173}
definecolor{toprulecolour}{RGB}{192,0,0}

pagestyle{empty}

AddToShipoutPictureFG{%
AtTextLowerLeft{%
% Side bar
makebox[0pt][r]{%
textcolor{sidebarcolour}{rule[-5baselineskip]{marginparwidth}{dimexprtextheight+5baselineskip}}%
hspace{10pt}%
}%
}%
AtTextUpperLeft{%
% Top bar
hspace{-dimexprmarginparwidth+10pt}%
textcolor{toprulecolour}{rule{dimexprmarginparwidth+textwidth+20pt}{2baselineskip}}%
}%
AtTextUpperLeft{%
% Top text
makebox[textwidth]{raisebox{3baselineskip}{Large Text}}%
}%
}

begin{document}

sloppy % Just for this example
lipsum[1-50]

end{document}


Lengths and other positioning can be changed as needed.






share|improve this answer




























    up vote
    3
    down vote













    Welcome to TeX.SE! Here is a possible way. I am not claiming that this is the most elegant way.



    documentclass{article}
    usepackage{tikzpagenodes,eso-pic}
    newcommand{PageTitle}[1]{xdefmyPageTitle{#1}}
    AddToShipoutPictureBG{%
    begin{tikzpicture}[overlay,remember picture]
    fill[orange!70] (current page.south west) rectangle
    ([xshift=-2mm,yshift=1mm]current page text area.north west);
    fill[red] ([yshift=1mm]current page text area.north -| current page.west)
    rectangle ([yshift=11mm]current page text area.north -| current page.east);
    node[anchor=south] at ([yshift=11mm]current page text area.north) {myPageTitle};
    end{tikzpicture}}
    usepackage{lipsum}
    begin{document}
    PageTitle{Some text}
    lipsum[1-6]
    PageTitle{Some other text}
    lipsum[7-8]
    end{document}


    enter image description here



    enter image description here






    share|improve this answer




























      up vote
      1
      down vote













      Using tcolorbox:



      documentclass{article}
      usepackage[margin=1in]{geometry}
      usepackage{tikz,tcolorbox}
      tcbuselibrary{skins,breakable}
      usepackage{lipsum}
      begin{document}
      begin{tcolorbox}[sharp corners,boxrule=0mm,colback=white,colframe=red!70!black,title={strut},
      titlerule=6mm,left=0pt,right=0pt,top=0pt,]
      begin{tcolorbox}[enhanced,breakable,sharp corners,
      boxrule=0mm,right=0pt,
      leftrule=3cm,grow to left by=1mm,
      interior style={fill=white},
      frame style={fill=red, fill opacity=0.15},
      title style={fill=red, fill opacity=0.9},
      ]
      lipsum[1-5]
      end{tcolorbox}
      end{tcolorbox}

      end{document}


      enter image description here






      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%2f461474%2fcoloured-box-on-top-and-left-side-of-text%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        7
        down vote



        accepted










        Here is an option using eso-pic to place the sidebar, top bar and text using positioning relative to the text block:



        enter image description here



        documentclass{article}

        usepackage{xcolor,eso-pic}
        usepackage{lipsum}

        definecolor{sidebarcolour}{RGB}{248,203,173}
        definecolor{toprulecolour}{RGB}{192,0,0}

        pagestyle{empty}

        AddToShipoutPictureFG{%
        AtTextLowerLeft{%
        % Side bar
        makebox[0pt][r]{%
        textcolor{sidebarcolour}{rule[-5baselineskip]{marginparwidth}{dimexprtextheight+5baselineskip}}%
        hspace{10pt}%
        }%
        }%
        AtTextUpperLeft{%
        % Top bar
        hspace{-dimexprmarginparwidth+10pt}%
        textcolor{toprulecolour}{rule{dimexprmarginparwidth+textwidth+20pt}{2baselineskip}}%
        }%
        AtTextUpperLeft{%
        % Top text
        makebox[textwidth]{raisebox{3baselineskip}{Large Text}}%
        }%
        }

        begin{document}

        sloppy % Just for this example
        lipsum[1-50]

        end{document}


        Lengths and other positioning can be changed as needed.






        share|improve this answer

























          up vote
          7
          down vote



          accepted










          Here is an option using eso-pic to place the sidebar, top bar and text using positioning relative to the text block:



          enter image description here



          documentclass{article}

          usepackage{xcolor,eso-pic}
          usepackage{lipsum}

          definecolor{sidebarcolour}{RGB}{248,203,173}
          definecolor{toprulecolour}{RGB}{192,0,0}

          pagestyle{empty}

          AddToShipoutPictureFG{%
          AtTextLowerLeft{%
          % Side bar
          makebox[0pt][r]{%
          textcolor{sidebarcolour}{rule[-5baselineskip]{marginparwidth}{dimexprtextheight+5baselineskip}}%
          hspace{10pt}%
          }%
          }%
          AtTextUpperLeft{%
          % Top bar
          hspace{-dimexprmarginparwidth+10pt}%
          textcolor{toprulecolour}{rule{dimexprmarginparwidth+textwidth+20pt}{2baselineskip}}%
          }%
          AtTextUpperLeft{%
          % Top text
          makebox[textwidth]{raisebox{3baselineskip}{Large Text}}%
          }%
          }

          begin{document}

          sloppy % Just for this example
          lipsum[1-50]

          end{document}


          Lengths and other positioning can be changed as needed.






          share|improve this answer























            up vote
            7
            down vote



            accepted







            up vote
            7
            down vote



            accepted






            Here is an option using eso-pic to place the sidebar, top bar and text using positioning relative to the text block:



            enter image description here



            documentclass{article}

            usepackage{xcolor,eso-pic}
            usepackage{lipsum}

            definecolor{sidebarcolour}{RGB}{248,203,173}
            definecolor{toprulecolour}{RGB}{192,0,0}

            pagestyle{empty}

            AddToShipoutPictureFG{%
            AtTextLowerLeft{%
            % Side bar
            makebox[0pt][r]{%
            textcolor{sidebarcolour}{rule[-5baselineskip]{marginparwidth}{dimexprtextheight+5baselineskip}}%
            hspace{10pt}%
            }%
            }%
            AtTextUpperLeft{%
            % Top bar
            hspace{-dimexprmarginparwidth+10pt}%
            textcolor{toprulecolour}{rule{dimexprmarginparwidth+textwidth+20pt}{2baselineskip}}%
            }%
            AtTextUpperLeft{%
            % Top text
            makebox[textwidth]{raisebox{3baselineskip}{Large Text}}%
            }%
            }

            begin{document}

            sloppy % Just for this example
            lipsum[1-50]

            end{document}


            Lengths and other positioning can be changed as needed.






            share|improve this answer












            Here is an option using eso-pic to place the sidebar, top bar and text using positioning relative to the text block:



            enter image description here



            documentclass{article}

            usepackage{xcolor,eso-pic}
            usepackage{lipsum}

            definecolor{sidebarcolour}{RGB}{248,203,173}
            definecolor{toprulecolour}{RGB}{192,0,0}

            pagestyle{empty}

            AddToShipoutPictureFG{%
            AtTextLowerLeft{%
            % Side bar
            makebox[0pt][r]{%
            textcolor{sidebarcolour}{rule[-5baselineskip]{marginparwidth}{dimexprtextheight+5baselineskip}}%
            hspace{10pt}%
            }%
            }%
            AtTextUpperLeft{%
            % Top bar
            hspace{-dimexprmarginparwidth+10pt}%
            textcolor{toprulecolour}{rule{dimexprmarginparwidth+textwidth+20pt}{2baselineskip}}%
            }%
            AtTextUpperLeft{%
            % Top text
            makebox[textwidth]{raisebox{3baselineskip}{Large Text}}%
            }%
            }

            begin{document}

            sloppy % Just for this example
            lipsum[1-50]

            end{document}


            Lengths and other positioning can be changed as needed.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 23 at 21:27









            Werner

            433k609531634




            433k609531634






















                up vote
                3
                down vote













                Welcome to TeX.SE! Here is a possible way. I am not claiming that this is the most elegant way.



                documentclass{article}
                usepackage{tikzpagenodes,eso-pic}
                newcommand{PageTitle}[1]{xdefmyPageTitle{#1}}
                AddToShipoutPictureBG{%
                begin{tikzpicture}[overlay,remember picture]
                fill[orange!70] (current page.south west) rectangle
                ([xshift=-2mm,yshift=1mm]current page text area.north west);
                fill[red] ([yshift=1mm]current page text area.north -| current page.west)
                rectangle ([yshift=11mm]current page text area.north -| current page.east);
                node[anchor=south] at ([yshift=11mm]current page text area.north) {myPageTitle};
                end{tikzpicture}}
                usepackage{lipsum}
                begin{document}
                PageTitle{Some text}
                lipsum[1-6]
                PageTitle{Some other text}
                lipsum[7-8]
                end{document}


                enter image description here



                enter image description here






                share|improve this answer

























                  up vote
                  3
                  down vote













                  Welcome to TeX.SE! Here is a possible way. I am not claiming that this is the most elegant way.



                  documentclass{article}
                  usepackage{tikzpagenodes,eso-pic}
                  newcommand{PageTitle}[1]{xdefmyPageTitle{#1}}
                  AddToShipoutPictureBG{%
                  begin{tikzpicture}[overlay,remember picture]
                  fill[orange!70] (current page.south west) rectangle
                  ([xshift=-2mm,yshift=1mm]current page text area.north west);
                  fill[red] ([yshift=1mm]current page text area.north -| current page.west)
                  rectangle ([yshift=11mm]current page text area.north -| current page.east);
                  node[anchor=south] at ([yshift=11mm]current page text area.north) {myPageTitle};
                  end{tikzpicture}}
                  usepackage{lipsum}
                  begin{document}
                  PageTitle{Some text}
                  lipsum[1-6]
                  PageTitle{Some other text}
                  lipsum[7-8]
                  end{document}


                  enter image description here



                  enter image description here






                  share|improve this answer























                    up vote
                    3
                    down vote










                    up vote
                    3
                    down vote









                    Welcome to TeX.SE! Here is a possible way. I am not claiming that this is the most elegant way.



                    documentclass{article}
                    usepackage{tikzpagenodes,eso-pic}
                    newcommand{PageTitle}[1]{xdefmyPageTitle{#1}}
                    AddToShipoutPictureBG{%
                    begin{tikzpicture}[overlay,remember picture]
                    fill[orange!70] (current page.south west) rectangle
                    ([xshift=-2mm,yshift=1mm]current page text area.north west);
                    fill[red] ([yshift=1mm]current page text area.north -| current page.west)
                    rectangle ([yshift=11mm]current page text area.north -| current page.east);
                    node[anchor=south] at ([yshift=11mm]current page text area.north) {myPageTitle};
                    end{tikzpicture}}
                    usepackage{lipsum}
                    begin{document}
                    PageTitle{Some text}
                    lipsum[1-6]
                    PageTitle{Some other text}
                    lipsum[7-8]
                    end{document}


                    enter image description here



                    enter image description here






                    share|improve this answer












                    Welcome to TeX.SE! Here is a possible way. I am not claiming that this is the most elegant way.



                    documentclass{article}
                    usepackage{tikzpagenodes,eso-pic}
                    newcommand{PageTitle}[1]{xdefmyPageTitle{#1}}
                    AddToShipoutPictureBG{%
                    begin{tikzpicture}[overlay,remember picture]
                    fill[orange!70] (current page.south west) rectangle
                    ([xshift=-2mm,yshift=1mm]current page text area.north west);
                    fill[red] ([yshift=1mm]current page text area.north -| current page.west)
                    rectangle ([yshift=11mm]current page text area.north -| current page.east);
                    node[anchor=south] at ([yshift=11mm]current page text area.north) {myPageTitle};
                    end{tikzpicture}}
                    usepackage{lipsum}
                    begin{document}
                    PageTitle{Some text}
                    lipsum[1-6]
                    PageTitle{Some other text}
                    lipsum[7-8]
                    end{document}


                    enter image description here



                    enter image description here







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 23 at 20:35









                    marmot

                    79.9k490170




                    79.9k490170






















                        up vote
                        1
                        down vote













                        Using tcolorbox:



                        documentclass{article}
                        usepackage[margin=1in]{geometry}
                        usepackage{tikz,tcolorbox}
                        tcbuselibrary{skins,breakable}
                        usepackage{lipsum}
                        begin{document}
                        begin{tcolorbox}[sharp corners,boxrule=0mm,colback=white,colframe=red!70!black,title={strut},
                        titlerule=6mm,left=0pt,right=0pt,top=0pt,]
                        begin{tcolorbox}[enhanced,breakable,sharp corners,
                        boxrule=0mm,right=0pt,
                        leftrule=3cm,grow to left by=1mm,
                        interior style={fill=white},
                        frame style={fill=red, fill opacity=0.15},
                        title style={fill=red, fill opacity=0.9},
                        ]
                        lipsum[1-5]
                        end{tcolorbox}
                        end{tcolorbox}

                        end{document}


                        enter image description here






                        share|improve this answer

























                          up vote
                          1
                          down vote













                          Using tcolorbox:



                          documentclass{article}
                          usepackage[margin=1in]{geometry}
                          usepackage{tikz,tcolorbox}
                          tcbuselibrary{skins,breakable}
                          usepackage{lipsum}
                          begin{document}
                          begin{tcolorbox}[sharp corners,boxrule=0mm,colback=white,colframe=red!70!black,title={strut},
                          titlerule=6mm,left=0pt,right=0pt,top=0pt,]
                          begin{tcolorbox}[enhanced,breakable,sharp corners,
                          boxrule=0mm,right=0pt,
                          leftrule=3cm,grow to left by=1mm,
                          interior style={fill=white},
                          frame style={fill=red, fill opacity=0.15},
                          title style={fill=red, fill opacity=0.9},
                          ]
                          lipsum[1-5]
                          end{tcolorbox}
                          end{tcolorbox}

                          end{document}


                          enter image description here






                          share|improve this answer























                            up vote
                            1
                            down vote










                            up vote
                            1
                            down vote









                            Using tcolorbox:



                            documentclass{article}
                            usepackage[margin=1in]{geometry}
                            usepackage{tikz,tcolorbox}
                            tcbuselibrary{skins,breakable}
                            usepackage{lipsum}
                            begin{document}
                            begin{tcolorbox}[sharp corners,boxrule=0mm,colback=white,colframe=red!70!black,title={strut},
                            titlerule=6mm,left=0pt,right=0pt,top=0pt,]
                            begin{tcolorbox}[enhanced,breakable,sharp corners,
                            boxrule=0mm,right=0pt,
                            leftrule=3cm,grow to left by=1mm,
                            interior style={fill=white},
                            frame style={fill=red, fill opacity=0.15},
                            title style={fill=red, fill opacity=0.9},
                            ]
                            lipsum[1-5]
                            end{tcolorbox}
                            end{tcolorbox}

                            end{document}


                            enter image description here






                            share|improve this answer












                            Using tcolorbox:



                            documentclass{article}
                            usepackage[margin=1in]{geometry}
                            usepackage{tikz,tcolorbox}
                            tcbuselibrary{skins,breakable}
                            usepackage{lipsum}
                            begin{document}
                            begin{tcolorbox}[sharp corners,boxrule=0mm,colback=white,colframe=red!70!black,title={strut},
                            titlerule=6mm,left=0pt,right=0pt,top=0pt,]
                            begin{tcolorbox}[enhanced,breakable,sharp corners,
                            boxrule=0mm,right=0pt,
                            leftrule=3cm,grow to left by=1mm,
                            interior style={fill=white},
                            frame style={fill=red, fill opacity=0.15},
                            title style={fill=red, fill opacity=0.9},
                            ]
                            lipsum[1-5]
                            end{tcolorbox}
                            end{tcolorbox}

                            end{document}


                            enter image description here







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 23 at 22:38









                            nidhin

                            1,927922




                            1,927922






























                                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%2f461474%2fcoloured-box-on-top-and-left-side-of-text%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

                                Сан-Квентин

                                Алькесар

                                Josef Freinademetz