Make a ribbon box with text in it
up vote
0
down vote
favorite
I'm pretty novice in LaTeX and use overleaf to write.
Is there any way that I could do this kind of box with a arbitrary text in it that is not linked to any title or chapter - just a black box with plain text in it?
I've tried to modify this code in the answer, but I only seem to break it...
How to make a chapter heading like this
rules box
add a comment |
up vote
0
down vote
favorite
I'm pretty novice in LaTeX and use overleaf to write.
Is there any way that I could do this kind of box with a arbitrary text in it that is not linked to any title or chapter - just a black box with plain text in it?
I've tried to modify this code in the answer, but I only seem to break it...
How to make a chapter heading like this
rules box
rule[-15pt]{2cm}{1.5cm}llap{color{white} III } Gets me closer, but can't really get it to appear at the very end of the side of the page
– Myggan
Dec 6 at 10:12
hspace{13.9cm}raggedleftrule[-15pt]{3cm}{1.5cm}llap{Hugecolor{white} III } This seems to work, but seems like an ugly solution?
– Myggan
Dec 6 at 10:24
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm pretty novice in LaTeX and use overleaf to write.
Is there any way that I could do this kind of box with a arbitrary text in it that is not linked to any title or chapter - just a black box with plain text in it?
I've tried to modify this code in the answer, but I only seem to break it...
How to make a chapter heading like this
rules box
I'm pretty novice in LaTeX and use overleaf to write.
Is there any way that I could do this kind of box with a arbitrary text in it that is not linked to any title or chapter - just a black box with plain text in it?
I've tried to modify this code in the answer, but I only seem to break it...
How to make a chapter heading like this
rules box
rules box
asked Dec 5 at 14:01
Myggan
31
31
rule[-15pt]{2cm}{1.5cm}llap{color{white} III } Gets me closer, but can't really get it to appear at the very end of the side of the page
– Myggan
Dec 6 at 10:12
hspace{13.9cm}raggedleftrule[-15pt]{3cm}{1.5cm}llap{Hugecolor{white} III } This seems to work, but seems like an ugly solution?
– Myggan
Dec 6 at 10:24
add a comment |
rule[-15pt]{2cm}{1.5cm}llap{color{white} III } Gets me closer, but can't really get it to appear at the very end of the side of the page
– Myggan
Dec 6 at 10:12
hspace{13.9cm}raggedleftrule[-15pt]{3cm}{1.5cm}llap{Hugecolor{white} III } This seems to work, but seems like an ugly solution?
– Myggan
Dec 6 at 10:24
rule[-15pt]{2cm}{1.5cm}llap{color{white} III } Gets me closer, but can't really get it to appear at the very end of the side of the page
– Myggan
Dec 6 at 10:12
rule[-15pt]{2cm}{1.5cm}llap{color{white} III } Gets me closer, but can't really get it to appear at the very end of the side of the page
– Myggan
Dec 6 at 10:12
hspace{13.9cm}raggedleftrule[-15pt]{3cm}{1.5cm}llap{Hugecolor{white} III } This seems to work, but seems like an ugly solution?
– Myggan
Dec 6 at 10:24
hspace{13.9cm}raggedleftrule[-15pt]{3cm}{1.5cm}llap{Hugecolor{white} III } This seems to work, but seems like an ugly solution?
– Myggan
Dec 6 at 10:24
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
As you didn't specify your exact requirements, here's a simple ribbon version that puts a black box with white text to the left or right side of the paragraph text.
You can use ribbonsep
to specify the horizontal space between the text and the ribbon. A ribbon should always be used at the begin of a new paragraph, as it uses noindent
to get its placement right. That also means that you need to use indent
explicitly if the following paragraph text should be indented. Note that the code hasn't been tested much, so there are several chances for optimization/extensions here.
documentclass{article}
usepackage{lipsum}
usepackage{xcolor}
newlengthribbonsep
ribbonsep=12pt
newcommandribbonleft{%
noindent
llap{%
smash{vtop{%
kern-baselineskip
hbox{colorbox{black}{makebox[dimexpr 1in+hoffset+oddsidemargin-ribbonsep][r]{%
Hugetextcolor{white}{bfseries NOTE}%
rule[-5pt]{0pt}{baselineskip}%
}}}%
}}%
hspace*{ribbonsep}%
}%
}
newcommandribbonright{%
noindent
rlap{%
hspace*{dimexprtextwidth+ribbonsep}%
smash{vtop{%
kern-baselineskip
hbox{colorbox{black}{makebox[dimexpr 1in+hoffset+oddsidemargin-ribbonsep][l]{%
Hugetextcolor{white}{bfseries NOTE}%
rule[-5pt]{0pt}{baselineskip}%
}}}%
}}%
}%
}
begin{document}
lipsum[1]
ribbonleftindent
lipsum[2]
ribbonrightindent
lipsum[3]
end{document}
Thanks a lot! This seems to do the trick!
– Myggan
yesterday
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
As you didn't specify your exact requirements, here's a simple ribbon version that puts a black box with white text to the left or right side of the paragraph text.
You can use ribbonsep
to specify the horizontal space between the text and the ribbon. A ribbon should always be used at the begin of a new paragraph, as it uses noindent
to get its placement right. That also means that you need to use indent
explicitly if the following paragraph text should be indented. Note that the code hasn't been tested much, so there are several chances for optimization/extensions here.
documentclass{article}
usepackage{lipsum}
usepackage{xcolor}
newlengthribbonsep
ribbonsep=12pt
newcommandribbonleft{%
noindent
llap{%
smash{vtop{%
kern-baselineskip
hbox{colorbox{black}{makebox[dimexpr 1in+hoffset+oddsidemargin-ribbonsep][r]{%
Hugetextcolor{white}{bfseries NOTE}%
rule[-5pt]{0pt}{baselineskip}%
}}}%
}}%
hspace*{ribbonsep}%
}%
}
newcommandribbonright{%
noindent
rlap{%
hspace*{dimexprtextwidth+ribbonsep}%
smash{vtop{%
kern-baselineskip
hbox{colorbox{black}{makebox[dimexpr 1in+hoffset+oddsidemargin-ribbonsep][l]{%
Hugetextcolor{white}{bfseries NOTE}%
rule[-5pt]{0pt}{baselineskip}%
}}}%
}}%
}%
}
begin{document}
lipsum[1]
ribbonleftindent
lipsum[2]
ribbonrightindent
lipsum[3]
end{document}
Thanks a lot! This seems to do the trick!
– Myggan
yesterday
add a comment |
up vote
0
down vote
accepted
As you didn't specify your exact requirements, here's a simple ribbon version that puts a black box with white text to the left or right side of the paragraph text.
You can use ribbonsep
to specify the horizontal space between the text and the ribbon. A ribbon should always be used at the begin of a new paragraph, as it uses noindent
to get its placement right. That also means that you need to use indent
explicitly if the following paragraph text should be indented. Note that the code hasn't been tested much, so there are several chances for optimization/extensions here.
documentclass{article}
usepackage{lipsum}
usepackage{xcolor}
newlengthribbonsep
ribbonsep=12pt
newcommandribbonleft{%
noindent
llap{%
smash{vtop{%
kern-baselineskip
hbox{colorbox{black}{makebox[dimexpr 1in+hoffset+oddsidemargin-ribbonsep][r]{%
Hugetextcolor{white}{bfseries NOTE}%
rule[-5pt]{0pt}{baselineskip}%
}}}%
}}%
hspace*{ribbonsep}%
}%
}
newcommandribbonright{%
noindent
rlap{%
hspace*{dimexprtextwidth+ribbonsep}%
smash{vtop{%
kern-baselineskip
hbox{colorbox{black}{makebox[dimexpr 1in+hoffset+oddsidemargin-ribbonsep][l]{%
Hugetextcolor{white}{bfseries NOTE}%
rule[-5pt]{0pt}{baselineskip}%
}}}%
}}%
}%
}
begin{document}
lipsum[1]
ribbonleftindent
lipsum[2]
ribbonrightindent
lipsum[3]
end{document}
Thanks a lot! This seems to do the trick!
– Myggan
yesterday
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
As you didn't specify your exact requirements, here's a simple ribbon version that puts a black box with white text to the left or right side of the paragraph text.
You can use ribbonsep
to specify the horizontal space between the text and the ribbon. A ribbon should always be used at the begin of a new paragraph, as it uses noindent
to get its placement right. That also means that you need to use indent
explicitly if the following paragraph text should be indented. Note that the code hasn't been tested much, so there are several chances for optimization/extensions here.
documentclass{article}
usepackage{lipsum}
usepackage{xcolor}
newlengthribbonsep
ribbonsep=12pt
newcommandribbonleft{%
noindent
llap{%
smash{vtop{%
kern-baselineskip
hbox{colorbox{black}{makebox[dimexpr 1in+hoffset+oddsidemargin-ribbonsep][r]{%
Hugetextcolor{white}{bfseries NOTE}%
rule[-5pt]{0pt}{baselineskip}%
}}}%
}}%
hspace*{ribbonsep}%
}%
}
newcommandribbonright{%
noindent
rlap{%
hspace*{dimexprtextwidth+ribbonsep}%
smash{vtop{%
kern-baselineskip
hbox{colorbox{black}{makebox[dimexpr 1in+hoffset+oddsidemargin-ribbonsep][l]{%
Hugetextcolor{white}{bfseries NOTE}%
rule[-5pt]{0pt}{baselineskip}%
}}}%
}}%
}%
}
begin{document}
lipsum[1]
ribbonleftindent
lipsum[2]
ribbonrightindent
lipsum[3]
end{document}
As you didn't specify your exact requirements, here's a simple ribbon version that puts a black box with white text to the left or right side of the paragraph text.
You can use ribbonsep
to specify the horizontal space between the text and the ribbon. A ribbon should always be used at the begin of a new paragraph, as it uses noindent
to get its placement right. That also means that you need to use indent
explicitly if the following paragraph text should be indented. Note that the code hasn't been tested much, so there are several chances for optimization/extensions here.
documentclass{article}
usepackage{lipsum}
usepackage{xcolor}
newlengthribbonsep
ribbonsep=12pt
newcommandribbonleft{%
noindent
llap{%
smash{vtop{%
kern-baselineskip
hbox{colorbox{black}{makebox[dimexpr 1in+hoffset+oddsidemargin-ribbonsep][r]{%
Hugetextcolor{white}{bfseries NOTE}%
rule[-5pt]{0pt}{baselineskip}%
}}}%
}}%
hspace*{ribbonsep}%
}%
}
newcommandribbonright{%
noindent
rlap{%
hspace*{dimexprtextwidth+ribbonsep}%
smash{vtop{%
kern-baselineskip
hbox{colorbox{black}{makebox[dimexpr 1in+hoffset+oddsidemargin-ribbonsep][l]{%
Hugetextcolor{white}{bfseries NOTE}%
rule[-5pt]{0pt}{baselineskip}%
}}}%
}}%
}%
}
begin{document}
lipsum[1]
ribbonleftindent
lipsum[2]
ribbonrightindent
lipsum[3]
end{document}
answered yesterday
siracusa
4,81511228
4,81511228
Thanks a lot! This seems to do the trick!
– Myggan
yesterday
add a comment |
Thanks a lot! This seems to do the trick!
– Myggan
yesterday
Thanks a lot! This seems to do the trick!
– Myggan
yesterday
Thanks a lot! This seems to do the trick!
– Myggan
yesterday
add a comment |
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.
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%2f463326%2fmake-a-ribbon-box-with-text-in-it%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
rule[-15pt]{2cm}{1.5cm}llap{color{white} III } Gets me closer, but can't really get it to appear at the very end of the side of the page
– Myggan
Dec 6 at 10:12
hspace{13.9cm}raggedleftrule[-15pt]{3cm}{1.5cm}llap{Hugecolor{white} III } This seems to work, but seems like an ugly solution?
– Myggan
Dec 6 at 10:24