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.
tikz-pgf
New contributor
add a comment |
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.
tikz-pgf
New contributor
1
Welcome to TeX.SE. Please add a MWE showing what you have tried and where you are stuck at.
– nidhin
yesterday
add a comment |
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.
tikz-pgf
New contributor
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.
tikz-pgf
tikz-pgf
New contributor
New contributor
New contributor
asked yesterday
JTHG
133
133
New contributor
New contributor
1
Welcome to TeX.SE. Please add a MWE showing what you have tried and where you are stuck at.
– nidhin
yesterday
add a comment |
1
Welcome to TeX.SE. Please add a MWE showing what you have tried and where you are stuck at.
– nidhin
yesterday
1
1
Welcome to TeX.SE. Please add a MWE showing what you have tried and where you are stuck at.
– nidhin
yesterday
Welcome to TeX.SE. Please add a MWE showing what you have tried and where you are stuck at.
– nidhin
yesterday
add a comment |
3 Answers
3
active
oldest
votes
up vote
5
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:
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.
add a comment |
up vote
2
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}
add a comment |
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}
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
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:
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.
add a comment |
up vote
5
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:
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.
add a comment |
up vote
5
down vote
accepted
up vote
5
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:
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.
Here is an option using eso-pic
to place the sidebar, top bar and text using positioning relative to the text block:
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.
answered yesterday
Werner
431k599501628
431k599501628
add a comment |
add a comment |
up vote
2
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}
add a comment |
up vote
2
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}
add a comment |
up vote
2
down vote
up vote
2
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}
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}
answered yesterday
marmot
77.7k487166
77.7k487166
add a comment |
add a comment |
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}
add a comment |
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}
add a comment |
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}
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}
answered yesterday
nidhin
1,700921
1,700921
add a comment |
add a comment |
JTHG is a new contributor. Be nice, and check out our Code of Conduct.
JTHG is a new contributor. Be nice, and check out our Code of Conduct.
JTHG is a new contributor. Be nice, and check out our Code of Conduct.
JTHG is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
Welcome to TeX.SE. Please add a MWE showing what you have tried and where you are stuck at.
– nidhin
yesterday