Old style “caution” boxesNicer wavy line with TikZReplace the zigzag decoration by wave decoration in tcolorboxTabular border styleTikZ draw-Putting old calendar style date in left marginUsing a pgfplots-style legend in a plain-old tikzpictureArranging connected boxesFormatting answer boxesRounded boxes around textFlowchart of Nested BoxesOverlay multiple boxes in tikzReplicating a fancy bordered text style in LaTeX
Is any device installed on airplane to measure wind speed relative to the ground, and its direction?
Do Chain Devils' Animated Chains restrain creatures on a grapple?
Collect results of a map operation in a Map using Collectors.toMap or groupingBy
Modify real part and leaves imaginary part unchanged
An employee has low self-confidence, and is performing poorly. How can I help?
Should I withdraw my paper because the editor is delaying the report?
How effective are nunchaku as a choking weapon?
Why can I ping 10.0.0.0/8 addresses from a 192.168.1.0/24 subnet?
D&D Monsters and Copyright
How to temporarily replace Latin characters with Greek
Why is the intercept changing in a logistic regression when all predictors are standardized?
What powers an aircraft prior to the APU being switched on?
70's/80's story about a high ranking prisoner of war on a prison planet
How to not lose focus after each disruption in flow
A Society Built Around Theft?
How to discipline overeager engineer
Why do English transliterations of Arabic names have so many Qs in them?
Is there a way to make a Minor key sound "less dark"?
How long should a test wait to assume that the result remains fixed
My first random password generator
one-liner vs script
Consecutive numbers that are Manhattan distance 3 apart
Can you decide not to sneak into a room after seeing your roll?
Why did a young George Washington sign a document admitting to assassinating a French military officer?
Old style “caution” boxes
Nicer wavy line with TikZReplace the zigzag decoration by wave decoration in tcolorboxTabular border styleTikZ draw-Putting old calendar style date in left marginUsing a pgfplots-style legend in a plain-old tikzpictureArranging connected boxesFormatting answer boxesRounded boxes around textFlowchart of Nested BoxesOverlay multiple boxes in tikzReplicating a fancy bordered text style in LaTeX
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
Technical manuals from the 1960s and 1970s sometimes had eye-catching CAUTION boxes surrounded by wavy or curly lines.
My best attempt at re-creating this is not ideal as I can't get the snake to line up on all corners:
begintikzpicture
draw[very thick,decorate,
decoration=snake,segment length=9.5pt]
(0,0) rectangle (140pt,40pt)
node[pos=0.5] textbfCAUTION;
endtikzpicture
I would also be willing to use any other package which can produce fancy boxes with borders.
tikz-pgf border
add a comment
|
Technical manuals from the 1960s and 1970s sometimes had eye-catching CAUTION boxes surrounded by wavy or curly lines.
My best attempt at re-creating this is not ideal as I can't get the snake to line up on all corners:
begintikzpicture
draw[very thick,decorate,
decoration=snake,segment length=9.5pt]
(0,0) rectangle (140pt,40pt)
node[pos=0.5] textbfCAUTION;
endtikzpicture
I would also be willing to use any other package which can produce fancy boxes with borders.
tikz-pgf border
add a comment
|
Technical manuals from the 1960s and 1970s sometimes had eye-catching CAUTION boxes surrounded by wavy or curly lines.
My best attempt at re-creating this is not ideal as I can't get the snake to line up on all corners:
begintikzpicture
draw[very thick,decorate,
decoration=snake,segment length=9.5pt]
(0,0) rectangle (140pt,40pt)
node[pos=0.5] textbfCAUTION;
endtikzpicture
I would also be willing to use any other package which can produce fancy boxes with borders.
tikz-pgf border
Technical manuals from the 1960s and 1970s sometimes had eye-catching CAUTION boxes surrounded by wavy or curly lines.
My best attempt at re-creating this is not ideal as I can't get the snake to line up on all corners:
begintikzpicture
draw[very thick,decorate,
decoration=snake,segment length=9.5pt]
(0,0) rectangle (140pt,40pt)
node[pos=0.5] textbfCAUTION;
endtikzpicture
I would also be willing to use any other package which can produce fancy boxes with borders.
tikz-pgf border
tikz-pgf border
edited Apr 18 at 6:00
Peter Mortensen
5683 silver badges7 bronze badges
5683 silver badges7 bronze badges
asked Apr 17 at 23:27
MassMass
3401 silver badge9 bronze badges
3401 silver badge9 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
I would employ Jake's complete sines here to modify your proposal to something that can also be used in a tcolorbox
documentclass[a4paper,12pt]article
usepackage[many]tcolorbox
usetikzlibrarydecorations
begindocument
pgfdeclaredecorationcomplete sinesinitial
stateinitial[
width=+0pt,
next state=sine,
persistent precomputation=pgfmathsetmacromatchinglength
pgfdecoratedinputsegmentlength / int(pgfdecoratedinputsegmentlength/pgfdecorationsegmentlength)
setlengthpgfdecorationsegmentlengthmatchinglength pt
]
statesine[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
statefinal
tikzsetoldfashioned sines/.style=very thick,line cap=rect,% <- thanks to quark67!
decorate,decoration=complete sines,segment length=#1,path has corners,
oldfashioned sines/.default=9.5pt
newtcolorboxCaution%
width=140pt,height=40pt,
colback=white,halign=flush center,valign=center,
enhanced,% jigsaw, breakable, % allow page breaks
frame hidden, % hide the default frame
overlay=%
draw[oldfashioned sines]
(frame.south west) rectangle (frame.north east);
draw[oldfashioned sines]
([xshift=1pt,yshift=0.4pt]frame.south west) rectangle ([xshift=1pt,yshift=0.4pt]frame.north east);
,
% paragraph skips obeyed within tcolorbox
parbox=false,
beginCaution
textbfCaution
endCaution
begintikzpicture
draw[oldfashioned sines]
(0,0) rectangle (140pt,40pt)
node[pos=0.5] textbfCAUTION;
endtikzpicture
begintikzpicture
draw[oldfashioned sines]
(0,0) rectangle (140pt,40pt)
node[pos=0.5] textbfCAUTION;
draw[oldfashioned sines]
(1pt,0.4pt) rectangle (141pt,40.4pt) ;
endtikzpicture
enddocument
I'd like to thank quark67 for the great suggestion to add line cap=rect
.
ADDENDUM: An attempt to address your request. It comes with a "new" decoration symmetric sines
that differ from Jake's complete sines in that the number of oscillations is half-integer. Therefore the result is symmetric under reflections about an axis that runs through the middle of the path.
documentclass[a4paper,12pt]article
usepackage[many]tcolorbox
usetikzlibrarydecorations
begindocument
pgfdeclaredecorationsymmetric sinesinitial
stateinitial[
width=+0pt,
next state=sine,
persistent precomputation=
pgfmathsetmacromatchinglength
pgfdecoratedinputsegmentlength /
(int(pgfdecoratedinputsegmentlength/pgfdecorationsegmentlength)+0.5)
setlengthpgfdecorationsegmentlengthmatchinglength pt
]
statesine[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
statefinal[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
tikzsetoldfashioned sines/.style=very thick,line cap=rect,% <- thanks to quark67!
decorate,decoration=symmetric sines,segment length=#1,path has corners,
oldfashioned sines/.default=9.5pt
defLstAnchors"south west","south east","north east","north west"
newtcolorboxCaution%
width=140pt,height=40pt,
colback=white,halign=flush center,valign=center,
enhanced,% jigsaw, breakable, % allow page breaks
frame hidden, % hide the default frame
overlay=%
foreach XX [count=YY,remember=XX as LastXX (initially north west)]
in south west,south east,north east,north west
ifoddYY
draw[oldfashioned sines] (frame.LastXX) -- (frame.XX);
draw[oldfashioned sines] ([xshift=1pt,yshift=0.4pt]frame.LastXX) -- ([xshift=1pt,yshift=0.4pt]frame.XX);
else
draw[oldfashioned sines] (frame.XX) -- (frame.LastXX);
draw[oldfashioned sines] ([xshift=1pt,yshift=0.4pt]frame.XX) -- ([xshift=1pt,yshift=0.4pt]frame.LastXX);
fi
,
% paragraph skips obeyed within tcolorbox
parbox=false,
beginCaution
textbfCAUTION
endCaution
enddocument
The question is what you want to achieve. Do you want to have such boxes in the text? If so, I will be happy to turn this into atcolorbox
.
– user121799
Apr 18 at 2:57
1
For a slightly better end of the decoration on the bottom left corner (when you magnified the picture), addline cap=rect
in the options ofdraw
.
– quark67
Apr 18 at 2:58
@quark67 That's an excellent suggestion, thanks!
– user121799
Apr 18 at 3:01
Looks very nice. Indeed I am interested in headers, not inline with text. Is it possible to have the ends line up symmetrically (like in the first picture of the question) instead of in a counter-clockwise fashion?
– Mass
Apr 22 at 18:29
@Mass I am not sure I understand your request but I added something which I thought may be what you want. If not, please try to explain it in more detail.
– user121799
Apr 22 at 21:14
|
show 2 more comments
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/4.0/"u003ecc by-sa 4.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
);
);
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%2f485387%2fold-style-caution-boxes%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
I would employ Jake's complete sines here to modify your proposal to something that can also be used in a tcolorbox
documentclass[a4paper,12pt]article
usepackage[many]tcolorbox
usetikzlibrarydecorations
begindocument
pgfdeclaredecorationcomplete sinesinitial
stateinitial[
width=+0pt,
next state=sine,
persistent precomputation=pgfmathsetmacromatchinglength
pgfdecoratedinputsegmentlength / int(pgfdecoratedinputsegmentlength/pgfdecorationsegmentlength)
setlengthpgfdecorationsegmentlengthmatchinglength pt
]
statesine[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
statefinal
tikzsetoldfashioned sines/.style=very thick,line cap=rect,% <- thanks to quark67!
decorate,decoration=complete sines,segment length=#1,path has corners,
oldfashioned sines/.default=9.5pt
newtcolorboxCaution%
width=140pt,height=40pt,
colback=white,halign=flush center,valign=center,
enhanced,% jigsaw, breakable, % allow page breaks
frame hidden, % hide the default frame
overlay=%
draw[oldfashioned sines]
(frame.south west) rectangle (frame.north east);
draw[oldfashioned sines]
([xshift=1pt,yshift=0.4pt]frame.south west) rectangle ([xshift=1pt,yshift=0.4pt]frame.north east);
,
% paragraph skips obeyed within tcolorbox
parbox=false,
beginCaution
textbfCaution
endCaution
begintikzpicture
draw[oldfashioned sines]
(0,0) rectangle (140pt,40pt)
node[pos=0.5] textbfCAUTION;
endtikzpicture
begintikzpicture
draw[oldfashioned sines]
(0,0) rectangle (140pt,40pt)
node[pos=0.5] textbfCAUTION;
draw[oldfashioned sines]
(1pt,0.4pt) rectangle (141pt,40.4pt) ;
endtikzpicture
enddocument
I'd like to thank quark67 for the great suggestion to add line cap=rect
.
ADDENDUM: An attempt to address your request. It comes with a "new" decoration symmetric sines
that differ from Jake's complete sines in that the number of oscillations is half-integer. Therefore the result is symmetric under reflections about an axis that runs through the middle of the path.
documentclass[a4paper,12pt]article
usepackage[many]tcolorbox
usetikzlibrarydecorations
begindocument
pgfdeclaredecorationsymmetric sinesinitial
stateinitial[
width=+0pt,
next state=sine,
persistent precomputation=
pgfmathsetmacromatchinglength
pgfdecoratedinputsegmentlength /
(int(pgfdecoratedinputsegmentlength/pgfdecorationsegmentlength)+0.5)
setlengthpgfdecorationsegmentlengthmatchinglength pt
]
statesine[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
statefinal[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
tikzsetoldfashioned sines/.style=very thick,line cap=rect,% <- thanks to quark67!
decorate,decoration=symmetric sines,segment length=#1,path has corners,
oldfashioned sines/.default=9.5pt
defLstAnchors"south west","south east","north east","north west"
newtcolorboxCaution%
width=140pt,height=40pt,
colback=white,halign=flush center,valign=center,
enhanced,% jigsaw, breakable, % allow page breaks
frame hidden, % hide the default frame
overlay=%
foreach XX [count=YY,remember=XX as LastXX (initially north west)]
in south west,south east,north east,north west
ifoddYY
draw[oldfashioned sines] (frame.LastXX) -- (frame.XX);
draw[oldfashioned sines] ([xshift=1pt,yshift=0.4pt]frame.LastXX) -- ([xshift=1pt,yshift=0.4pt]frame.XX);
else
draw[oldfashioned sines] (frame.XX) -- (frame.LastXX);
draw[oldfashioned sines] ([xshift=1pt,yshift=0.4pt]frame.XX) -- ([xshift=1pt,yshift=0.4pt]frame.LastXX);
fi
,
% paragraph skips obeyed within tcolorbox
parbox=false,
beginCaution
textbfCAUTION
endCaution
enddocument
The question is what you want to achieve. Do you want to have such boxes in the text? If so, I will be happy to turn this into atcolorbox
.
– user121799
Apr 18 at 2:57
1
For a slightly better end of the decoration on the bottom left corner (when you magnified the picture), addline cap=rect
in the options ofdraw
.
– quark67
Apr 18 at 2:58
@quark67 That's an excellent suggestion, thanks!
– user121799
Apr 18 at 3:01
Looks very nice. Indeed I am interested in headers, not inline with text. Is it possible to have the ends line up symmetrically (like in the first picture of the question) instead of in a counter-clockwise fashion?
– Mass
Apr 22 at 18:29
@Mass I am not sure I understand your request but I added something which I thought may be what you want. If not, please try to explain it in more detail.
– user121799
Apr 22 at 21:14
|
show 2 more comments
I would employ Jake's complete sines here to modify your proposal to something that can also be used in a tcolorbox
documentclass[a4paper,12pt]article
usepackage[many]tcolorbox
usetikzlibrarydecorations
begindocument
pgfdeclaredecorationcomplete sinesinitial
stateinitial[
width=+0pt,
next state=sine,
persistent precomputation=pgfmathsetmacromatchinglength
pgfdecoratedinputsegmentlength / int(pgfdecoratedinputsegmentlength/pgfdecorationsegmentlength)
setlengthpgfdecorationsegmentlengthmatchinglength pt
]
statesine[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
statefinal
tikzsetoldfashioned sines/.style=very thick,line cap=rect,% <- thanks to quark67!
decorate,decoration=complete sines,segment length=#1,path has corners,
oldfashioned sines/.default=9.5pt
newtcolorboxCaution%
width=140pt,height=40pt,
colback=white,halign=flush center,valign=center,
enhanced,% jigsaw, breakable, % allow page breaks
frame hidden, % hide the default frame
overlay=%
draw[oldfashioned sines]
(frame.south west) rectangle (frame.north east);
draw[oldfashioned sines]
([xshift=1pt,yshift=0.4pt]frame.south west) rectangle ([xshift=1pt,yshift=0.4pt]frame.north east);
,
% paragraph skips obeyed within tcolorbox
parbox=false,
beginCaution
textbfCaution
endCaution
begintikzpicture
draw[oldfashioned sines]
(0,0) rectangle (140pt,40pt)
node[pos=0.5] textbfCAUTION;
endtikzpicture
begintikzpicture
draw[oldfashioned sines]
(0,0) rectangle (140pt,40pt)
node[pos=0.5] textbfCAUTION;
draw[oldfashioned sines]
(1pt,0.4pt) rectangle (141pt,40.4pt) ;
endtikzpicture
enddocument
I'd like to thank quark67 for the great suggestion to add line cap=rect
.
ADDENDUM: An attempt to address your request. It comes with a "new" decoration symmetric sines
that differ from Jake's complete sines in that the number of oscillations is half-integer. Therefore the result is symmetric under reflections about an axis that runs through the middle of the path.
documentclass[a4paper,12pt]article
usepackage[many]tcolorbox
usetikzlibrarydecorations
begindocument
pgfdeclaredecorationsymmetric sinesinitial
stateinitial[
width=+0pt,
next state=sine,
persistent precomputation=
pgfmathsetmacromatchinglength
pgfdecoratedinputsegmentlength /
(int(pgfdecoratedinputsegmentlength/pgfdecorationsegmentlength)+0.5)
setlengthpgfdecorationsegmentlengthmatchinglength pt
]
statesine[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
statefinal[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
tikzsetoldfashioned sines/.style=very thick,line cap=rect,% <- thanks to quark67!
decorate,decoration=symmetric sines,segment length=#1,path has corners,
oldfashioned sines/.default=9.5pt
defLstAnchors"south west","south east","north east","north west"
newtcolorboxCaution%
width=140pt,height=40pt,
colback=white,halign=flush center,valign=center,
enhanced,% jigsaw, breakable, % allow page breaks
frame hidden, % hide the default frame
overlay=%
foreach XX [count=YY,remember=XX as LastXX (initially north west)]
in south west,south east,north east,north west
ifoddYY
draw[oldfashioned sines] (frame.LastXX) -- (frame.XX);
draw[oldfashioned sines] ([xshift=1pt,yshift=0.4pt]frame.LastXX) -- ([xshift=1pt,yshift=0.4pt]frame.XX);
else
draw[oldfashioned sines] (frame.XX) -- (frame.LastXX);
draw[oldfashioned sines] ([xshift=1pt,yshift=0.4pt]frame.XX) -- ([xshift=1pt,yshift=0.4pt]frame.LastXX);
fi
,
% paragraph skips obeyed within tcolorbox
parbox=false,
beginCaution
textbfCAUTION
endCaution
enddocument
The question is what you want to achieve. Do you want to have such boxes in the text? If so, I will be happy to turn this into atcolorbox
.
– user121799
Apr 18 at 2:57
1
For a slightly better end of the decoration on the bottom left corner (when you magnified the picture), addline cap=rect
in the options ofdraw
.
– quark67
Apr 18 at 2:58
@quark67 That's an excellent suggestion, thanks!
– user121799
Apr 18 at 3:01
Looks very nice. Indeed I am interested in headers, not inline with text. Is it possible to have the ends line up symmetrically (like in the first picture of the question) instead of in a counter-clockwise fashion?
– Mass
Apr 22 at 18:29
@Mass I am not sure I understand your request but I added something which I thought may be what you want. If not, please try to explain it in more detail.
– user121799
Apr 22 at 21:14
|
show 2 more comments
I would employ Jake's complete sines here to modify your proposal to something that can also be used in a tcolorbox
documentclass[a4paper,12pt]article
usepackage[many]tcolorbox
usetikzlibrarydecorations
begindocument
pgfdeclaredecorationcomplete sinesinitial
stateinitial[
width=+0pt,
next state=sine,
persistent precomputation=pgfmathsetmacromatchinglength
pgfdecoratedinputsegmentlength / int(pgfdecoratedinputsegmentlength/pgfdecorationsegmentlength)
setlengthpgfdecorationsegmentlengthmatchinglength pt
]
statesine[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
statefinal
tikzsetoldfashioned sines/.style=very thick,line cap=rect,% <- thanks to quark67!
decorate,decoration=complete sines,segment length=#1,path has corners,
oldfashioned sines/.default=9.5pt
newtcolorboxCaution%
width=140pt,height=40pt,
colback=white,halign=flush center,valign=center,
enhanced,% jigsaw, breakable, % allow page breaks
frame hidden, % hide the default frame
overlay=%
draw[oldfashioned sines]
(frame.south west) rectangle (frame.north east);
draw[oldfashioned sines]
([xshift=1pt,yshift=0.4pt]frame.south west) rectangle ([xshift=1pt,yshift=0.4pt]frame.north east);
,
% paragraph skips obeyed within tcolorbox
parbox=false,
beginCaution
textbfCaution
endCaution
begintikzpicture
draw[oldfashioned sines]
(0,0) rectangle (140pt,40pt)
node[pos=0.5] textbfCAUTION;
endtikzpicture
begintikzpicture
draw[oldfashioned sines]
(0,0) rectangle (140pt,40pt)
node[pos=0.5] textbfCAUTION;
draw[oldfashioned sines]
(1pt,0.4pt) rectangle (141pt,40.4pt) ;
endtikzpicture
enddocument
I'd like to thank quark67 for the great suggestion to add line cap=rect
.
ADDENDUM: An attempt to address your request. It comes with a "new" decoration symmetric sines
that differ from Jake's complete sines in that the number of oscillations is half-integer. Therefore the result is symmetric under reflections about an axis that runs through the middle of the path.
documentclass[a4paper,12pt]article
usepackage[many]tcolorbox
usetikzlibrarydecorations
begindocument
pgfdeclaredecorationsymmetric sinesinitial
stateinitial[
width=+0pt,
next state=sine,
persistent precomputation=
pgfmathsetmacromatchinglength
pgfdecoratedinputsegmentlength /
(int(pgfdecoratedinputsegmentlength/pgfdecorationsegmentlength)+0.5)
setlengthpgfdecorationsegmentlengthmatchinglength pt
]
statesine[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
statefinal[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
tikzsetoldfashioned sines/.style=very thick,line cap=rect,% <- thanks to quark67!
decorate,decoration=symmetric sines,segment length=#1,path has corners,
oldfashioned sines/.default=9.5pt
defLstAnchors"south west","south east","north east","north west"
newtcolorboxCaution%
width=140pt,height=40pt,
colback=white,halign=flush center,valign=center,
enhanced,% jigsaw, breakable, % allow page breaks
frame hidden, % hide the default frame
overlay=%
foreach XX [count=YY,remember=XX as LastXX (initially north west)]
in south west,south east,north east,north west
ifoddYY
draw[oldfashioned sines] (frame.LastXX) -- (frame.XX);
draw[oldfashioned sines] ([xshift=1pt,yshift=0.4pt]frame.LastXX) -- ([xshift=1pt,yshift=0.4pt]frame.XX);
else
draw[oldfashioned sines] (frame.XX) -- (frame.LastXX);
draw[oldfashioned sines] ([xshift=1pt,yshift=0.4pt]frame.XX) -- ([xshift=1pt,yshift=0.4pt]frame.LastXX);
fi
,
% paragraph skips obeyed within tcolorbox
parbox=false,
beginCaution
textbfCAUTION
endCaution
enddocument
I would employ Jake's complete sines here to modify your proposal to something that can also be used in a tcolorbox
documentclass[a4paper,12pt]article
usepackage[many]tcolorbox
usetikzlibrarydecorations
begindocument
pgfdeclaredecorationcomplete sinesinitial
stateinitial[
width=+0pt,
next state=sine,
persistent precomputation=pgfmathsetmacromatchinglength
pgfdecoratedinputsegmentlength / int(pgfdecoratedinputsegmentlength/pgfdecorationsegmentlength)
setlengthpgfdecorationsegmentlengthmatchinglength pt
]
statesine[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
statefinal
tikzsetoldfashioned sines/.style=very thick,line cap=rect,% <- thanks to quark67!
decorate,decoration=complete sines,segment length=#1,path has corners,
oldfashioned sines/.default=9.5pt
newtcolorboxCaution%
width=140pt,height=40pt,
colback=white,halign=flush center,valign=center,
enhanced,% jigsaw, breakable, % allow page breaks
frame hidden, % hide the default frame
overlay=%
draw[oldfashioned sines]
(frame.south west) rectangle (frame.north east);
draw[oldfashioned sines]
([xshift=1pt,yshift=0.4pt]frame.south west) rectangle ([xshift=1pt,yshift=0.4pt]frame.north east);
,
% paragraph skips obeyed within tcolorbox
parbox=false,
beginCaution
textbfCaution
endCaution
begintikzpicture
draw[oldfashioned sines]
(0,0) rectangle (140pt,40pt)
node[pos=0.5] textbfCAUTION;
endtikzpicture
begintikzpicture
draw[oldfashioned sines]
(0,0) rectangle (140pt,40pt)
node[pos=0.5] textbfCAUTION;
draw[oldfashioned sines]
(1pt,0.4pt) rectangle (141pt,40.4pt) ;
endtikzpicture
enddocument
I'd like to thank quark67 for the great suggestion to add line cap=rect
.
ADDENDUM: An attempt to address your request. It comes with a "new" decoration symmetric sines
that differ from Jake's complete sines in that the number of oscillations is half-integer. Therefore the result is symmetric under reflections about an axis that runs through the middle of the path.
documentclass[a4paper,12pt]article
usepackage[many]tcolorbox
usetikzlibrarydecorations
begindocument
pgfdeclaredecorationsymmetric sinesinitial
stateinitial[
width=+0pt,
next state=sine,
persistent precomputation=
pgfmathsetmacromatchinglength
pgfdecoratedinputsegmentlength /
(int(pgfdecoratedinputsegmentlength/pgfdecorationsegmentlength)+0.5)
setlengthpgfdecorationsegmentlengthmatchinglength pt
]
statesine[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
statefinal[width=pgfdecorationsegmentlength]
pgfpathsinepgfpoint0.25pgfdecorationsegmentlength0.5pgfdecorationsegmentamplitude
pgfpathcosinepgfpoint0.25pgfdecorationsegmentlength-0.5pgfdecorationsegmentamplitude
tikzsetoldfashioned sines/.style=very thick,line cap=rect,% <- thanks to quark67!
decorate,decoration=symmetric sines,segment length=#1,path has corners,
oldfashioned sines/.default=9.5pt
defLstAnchors"south west","south east","north east","north west"
newtcolorboxCaution%
width=140pt,height=40pt,
colback=white,halign=flush center,valign=center,
enhanced,% jigsaw, breakable, % allow page breaks
frame hidden, % hide the default frame
overlay=%
foreach XX [count=YY,remember=XX as LastXX (initially north west)]
in south west,south east,north east,north west
ifoddYY
draw[oldfashioned sines] (frame.LastXX) -- (frame.XX);
draw[oldfashioned sines] ([xshift=1pt,yshift=0.4pt]frame.LastXX) -- ([xshift=1pt,yshift=0.4pt]frame.XX);
else
draw[oldfashioned sines] (frame.XX) -- (frame.LastXX);
draw[oldfashioned sines] ([xshift=1pt,yshift=0.4pt]frame.XX) -- ([xshift=1pt,yshift=0.4pt]frame.LastXX);
fi
,
% paragraph skips obeyed within tcolorbox
parbox=false,
beginCaution
textbfCAUTION
endCaution
enddocument
edited Apr 23 at 16:10
answered Apr 17 at 23:47
user121799
The question is what you want to achieve. Do you want to have such boxes in the text? If so, I will be happy to turn this into atcolorbox
.
– user121799
Apr 18 at 2:57
1
For a slightly better end of the decoration on the bottom left corner (when you magnified the picture), addline cap=rect
in the options ofdraw
.
– quark67
Apr 18 at 2:58
@quark67 That's an excellent suggestion, thanks!
– user121799
Apr 18 at 3:01
Looks very nice. Indeed I am interested in headers, not inline with text. Is it possible to have the ends line up symmetrically (like in the first picture of the question) instead of in a counter-clockwise fashion?
– Mass
Apr 22 at 18:29
@Mass I am not sure I understand your request but I added something which I thought may be what you want. If not, please try to explain it in more detail.
– user121799
Apr 22 at 21:14
|
show 2 more comments
The question is what you want to achieve. Do you want to have such boxes in the text? If so, I will be happy to turn this into atcolorbox
.
– user121799
Apr 18 at 2:57
1
For a slightly better end of the decoration on the bottom left corner (when you magnified the picture), addline cap=rect
in the options ofdraw
.
– quark67
Apr 18 at 2:58
@quark67 That's an excellent suggestion, thanks!
– user121799
Apr 18 at 3:01
Looks very nice. Indeed I am interested in headers, not inline with text. Is it possible to have the ends line up symmetrically (like in the first picture of the question) instead of in a counter-clockwise fashion?
– Mass
Apr 22 at 18:29
@Mass I am not sure I understand your request but I added something which I thought may be what you want. If not, please try to explain it in more detail.
– user121799
Apr 22 at 21:14
The question is what you want to achieve. Do you want to have such boxes in the text? If so, I will be happy to turn this into a
tcolorbox
.– user121799
Apr 18 at 2:57
The question is what you want to achieve. Do you want to have such boxes in the text? If so, I will be happy to turn this into a
tcolorbox
.– user121799
Apr 18 at 2:57
1
1
For a slightly better end of the decoration on the bottom left corner (when you magnified the picture), add
line cap=rect
in the options of draw
.– quark67
Apr 18 at 2:58
For a slightly better end of the decoration on the bottom left corner (when you magnified the picture), add
line cap=rect
in the options of draw
.– quark67
Apr 18 at 2:58
@quark67 That's an excellent suggestion, thanks!
– user121799
Apr 18 at 3:01
@quark67 That's an excellent suggestion, thanks!
– user121799
Apr 18 at 3:01
Looks very nice. Indeed I am interested in headers, not inline with text. Is it possible to have the ends line up symmetrically (like in the first picture of the question) instead of in a counter-clockwise fashion?
– Mass
Apr 22 at 18:29
Looks very nice. Indeed I am interested in headers, not inline with text. Is it possible to have the ends line up symmetrically (like in the first picture of the question) instead of in a counter-clockwise fashion?
– Mass
Apr 22 at 18:29
@Mass I am not sure I understand your request but I added something which I thought may be what you want. If not, please try to explain it in more detail.
– user121799
Apr 22 at 21:14
@Mass I am not sure I understand your request but I added something which I thought may be what you want. If not, please try to explain it in more detail.
– user121799
Apr 22 at 21:14
|
show 2 more comments
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.
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%2f485387%2fold-style-caution-boxes%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