How to make boxes like these?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I'd like to have custom commands for making boxes that look like the Wolfram|Alpha entities in Mathematica notebooks:
LinguisticAssistantfrance
EntityFrancecountry
I've done the work of finding the colors, and defined them in my code. The fonts are as follows:
- LinguisticAssistant: (the first box with the orange equals sign) uses Ariel
- Entity: this uses bold and then smaller all-caps Helvitica.
This what I have so far:
documentclassarticle
usepackagepstricks
usepackagexcolor
definecolorlightyellowRGB255, 250, 236
definecolortextdarkRGB100, 52, 20
definecolorborderorangeRGB253, 129, 36
definecolorlightgrayRGB214, 214, 214
definecolorcountrygrayRGB153, 153, 153
begindocument
beginpspicture(5,5)
pssetfillstyle=solid, framearc=.4, linecolor=borderorange, linewidth=.8pt
psframebox[fillcolor=lightyellow]textcolortextdarkFrance textcolorcountrygrayCOUNTRY
hspace1cm
pssetfillstyle=solid, framearc=.2, linecolor=lightgray, linewidth=.4pt
psframebox[fillcolor=white]textcolorblackfrance
endpspicture
enddocumentâÂÂ
But I still don't know how to:
- make the little equal sign
- scale/format the text to look just like the images
I'm looking at the package tcolorbox
now, not sure if it is easier or better than pstricks.
Update:
I made the equal sign icon as a little pdf.
formatting boxes tcolorbox tikz-styles
add a comment |Â
up vote
3
down vote
favorite
I'd like to have custom commands for making boxes that look like the Wolfram|Alpha entities in Mathematica notebooks:
LinguisticAssistantfrance
EntityFrancecountry
I've done the work of finding the colors, and defined them in my code. The fonts are as follows:
- LinguisticAssistant: (the first box with the orange equals sign) uses Ariel
- Entity: this uses bold and then smaller all-caps Helvitica.
This what I have so far:
documentclassarticle
usepackagepstricks
usepackagexcolor
definecolorlightyellowRGB255, 250, 236
definecolortextdarkRGB100, 52, 20
definecolorborderorangeRGB253, 129, 36
definecolorlightgrayRGB214, 214, 214
definecolorcountrygrayRGB153, 153, 153
begindocument
beginpspicture(5,5)
pssetfillstyle=solid, framearc=.4, linecolor=borderorange, linewidth=.8pt
psframebox[fillcolor=lightyellow]textcolortextdarkFrance textcolorcountrygrayCOUNTRY
hspace1cm
pssetfillstyle=solid, framearc=.2, linecolor=lightgray, linewidth=.4pt
psframebox[fillcolor=white]textcolorblackfrance
endpspicture
enddocumentâÂÂ
But I still don't know how to:
- make the little equal sign
- scale/format the text to look just like the images
I'm looking at the package tcolorbox
now, not sure if it is easier or better than pstricks.
Update:
I made the equal sign icon as a little pdf.
formatting boxes tcolorbox tikz-styles
Show us what you've already tried. We're happy to help you if you're not fully able to implement what you want. We're here to help you, but not to do your work for you.
â A.Ellett
2 hours ago
tcolorbox is definitely a good option. The manual details which keys are needed, so please post a minimal compilable code example of where you are stuck.
â TeXnician
1 hour ago
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I'd like to have custom commands for making boxes that look like the Wolfram|Alpha entities in Mathematica notebooks:
LinguisticAssistantfrance
EntityFrancecountry
I've done the work of finding the colors, and defined them in my code. The fonts are as follows:
- LinguisticAssistant: (the first box with the orange equals sign) uses Ariel
- Entity: this uses bold and then smaller all-caps Helvitica.
This what I have so far:
documentclassarticle
usepackagepstricks
usepackagexcolor
definecolorlightyellowRGB255, 250, 236
definecolortextdarkRGB100, 52, 20
definecolorborderorangeRGB253, 129, 36
definecolorlightgrayRGB214, 214, 214
definecolorcountrygrayRGB153, 153, 153
begindocument
beginpspicture(5,5)
pssetfillstyle=solid, framearc=.4, linecolor=borderorange, linewidth=.8pt
psframebox[fillcolor=lightyellow]textcolortextdarkFrance textcolorcountrygrayCOUNTRY
hspace1cm
pssetfillstyle=solid, framearc=.2, linecolor=lightgray, linewidth=.4pt
psframebox[fillcolor=white]textcolorblackfrance
endpspicture
enddocumentâÂÂ
But I still don't know how to:
- make the little equal sign
- scale/format the text to look just like the images
I'm looking at the package tcolorbox
now, not sure if it is easier or better than pstricks.
Update:
I made the equal sign icon as a little pdf.
formatting boxes tcolorbox tikz-styles
I'd like to have custom commands for making boxes that look like the Wolfram|Alpha entities in Mathematica notebooks:
LinguisticAssistantfrance
EntityFrancecountry
I've done the work of finding the colors, and defined them in my code. The fonts are as follows:
- LinguisticAssistant: (the first box with the orange equals sign) uses Ariel
- Entity: this uses bold and then smaller all-caps Helvitica.
This what I have so far:
documentclassarticle
usepackagepstricks
usepackagexcolor
definecolorlightyellowRGB255, 250, 236
definecolortextdarkRGB100, 52, 20
definecolorborderorangeRGB253, 129, 36
definecolorlightgrayRGB214, 214, 214
definecolorcountrygrayRGB153, 153, 153
begindocument
beginpspicture(5,5)
pssetfillstyle=solid, framearc=.4, linecolor=borderorange, linewidth=.8pt
psframebox[fillcolor=lightyellow]textcolortextdarkFrance textcolorcountrygrayCOUNTRY
hspace1cm
pssetfillstyle=solid, framearc=.2, linecolor=lightgray, linewidth=.4pt
psframebox[fillcolor=white]textcolorblackfrance
endpspicture
enddocumentâÂÂ
But I still don't know how to:
- make the little equal sign
- scale/format the text to look just like the images
I'm looking at the package tcolorbox
now, not sure if it is easier or better than pstricks.
Update:
I made the equal sign icon as a little pdf.
formatting boxes tcolorbox tikz-styles
formatting boxes tcolorbox tikz-styles
edited 18 mins ago
asked 2 hours ago
M.R.
1436
1436
Show us what you've already tried. We're happy to help you if you're not fully able to implement what you want. We're here to help you, but not to do your work for you.
â A.Ellett
2 hours ago
tcolorbox is definitely a good option. The manual details which keys are needed, so please post a minimal compilable code example of where you are stuck.
â TeXnician
1 hour ago
add a comment |Â
Show us what you've already tried. We're happy to help you if you're not fully able to implement what you want. We're here to help you, but not to do your work for you.
â A.Ellett
2 hours ago
tcolorbox is definitely a good option. The manual details which keys are needed, so please post a minimal compilable code example of where you are stuck.
â TeXnician
1 hour ago
Show us what you've already tried. We're happy to help you if you're not fully able to implement what you want. We're here to help you, but not to do your work for you.
â A.Ellett
2 hours ago
Show us what you've already tried. We're happy to help you if you're not fully able to implement what you want. We're here to help you, but not to do your work for you.
â A.Ellett
2 hours ago
tcolorbox is definitely a good option. The manual details which keys are needed, so please post a minimal compilable code example of where you are stuck.
â TeXnician
1 hour ago
tcolorbox is definitely a good option. The manual details which keys are needed, so please post a minimal compilable code example of where you are stuck.
â TeXnician
1 hour ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
It's been a while since I've used pstricks
, so I'll leave that for someone else to address. Also, I'm not fluent in using tcolorbox
. So, that too I'll leave for someone else. But, I will show how you can do this from TikZ
This answer is broken into four parts:
- How to draw the
France COUNTRY
box. This is the most straight-forward. - How to draw the
Equal france
box. I use a few more subtle tricks here. - Customizing your own colors using RGB specifications.
- Using your own image file to create an
Equal france
box like result
Box for "France COUNTRY"
documentclass[tikz,border=6pt]standalone
usepackagetikz
usetikzlibrarycalc
usetikzlibraryarrows.meta
usetikzlibraryintersections
newcommandmakegray[1]colorgray#1
begindocument
begintikzpicture
node[rounded corners,
draw=orange,
fill=orange!25,text=black,font=sffamily]
France makegrayCOUNTRY;
endtikzpicture
enddocument
Box for "Equal france"
documentclass[tikz,border=6pt]standalone
usepackagetikz
usetikzlibrarycalc
usetikzlibraryfit
usetikzlibraryarrows.meta
usetikzlibraryintersections
newcommandmakegray[1]colorgray#1
newsaveboxaeequalsign
beginlrboxaeequalsign
begintikzpicture[x=(4pt,0),
y=(0,4pt)]
fill[orange] (0,0) rectangle (5,3);
draw[white,line width=2pt] (1,1) -- ++ (3,0);
draw[white,line width=2pt] (1,2) -- ++ (3,0);
endtikzpicture
endlrbox
begindocument
begintikzpicture
node[inner sep=0pt] (AEEQUAL) useboxaeequalsign;
node[anchor=west,
font=sffamilybfseries] (FRANCE) at (AEEQUAL.east) france;
node[fit=(AEEQUAL) (FRANCE),inner ysep=5pt,inner xsep=0pt] (COMBINED) ;
draw[rounded corners=4pt]
(AEEQUAL.north) |- (COMBINED.north east)
-- (COMBINED.south east) -| (AEEQUAL.south);
endtikzpicture
enddocument
Colors:
If you don't like my colors, you can define your own, much like you did with pstricks
using the definecolor
macro provided with xcolor
(which is automatically loaded with TikZ).
definecolor<color name>rgb<decimal>,<decimal>,<decimal>
Here is an implementation for this in TikZ:
defaegrabvalues#1,#2,#3;%%
pgfmathsetmacroaeR#1/255%%
pgfmathsetmacroaeG#2/255%%
pgfmathsetmacroaeB#3/255
tikzsetdefine color/.code 2 args=%%
aegrabvalues#2;
definecolor#1rgbaeR,aeG,aeB
Then you can write
begintikzpicture
[
define color=borderorange253,129,36,
define color=lightyellow255,250,236,
]
node[rounded corners,
draw=borderorange,
fill=lightyellow,text=black,font=sffamilybfseries]
France makegrayCOUNTRY;
endtikzpicture
Including image files:
If you have an image file you would already like to include, that's straight-forward.
Just repurpose the code above for the equal sign as follows:
newsaveboxaeequalsign
beginlrboxaeequalsign
includegraphics[width=2em]image/no_you_cant
endlrbox
Thanks for your response, but I'm trying to get the exact pixel-for-pixel look - i.e. color/fonts - see in my question where I added them.
â M.R.
46 mins ago
@M.R.: You can, of course, just use the fonts you specify. The basic principle in the box designs remain the same. Do you know how to add fonts?
â Werner
41 mins ago
No but I added the equals icon in a link - if you can try adding that?
â M.R.
17 mins ago
@M.R. updated per your most recent request. Everything else in terms of pixel-for-pixel, that's up to you. I don't necessarily have access to the same fonts as you, for example.
â A.Ellett
6 mins ago
add a comment |Â
up vote
1
down vote
A solution using pstricks
:
documentclassarticle
usepackagepstricks
usepackagexcolor
definecolorlightyellowRGB255, 250, 236
definecolortextdarkRGB100, 52, 20
definecolorborderorangeRGB253, 129, 36
definecolorlightgrayRGB214, 214, 214
definecolorcountrygrayRGB153, 153, 153
begindocument
beginpspicture(5,5)
pssetfillstyle=solid, framearc=.4, linecolor=borderorange, linewidth=.8pt
rput[l](0,0)psframebox[fillcolor=lightyellow]textcolortextdarktextsftextbfFrance textcolorcountrygrayfootnotesizetextsfCOUNTRY
pssetfillstyle=solid, framearc=.2, linecolor=lightgray, linewidth=.4pt
rput[l](0.15,1)psframebox[fillcolor=white]textcolorblacktextsfphantomxfrance
rput[l](0,1)psframebox[fillcolor=orange,framesep=2pt]tinytextcolorwhite=
endpspicture
enddocument
The positioning is done using rput
with coordinates, which allows to place a box with an = on top of the box with france
. This text has been shifted a bit to the right using a phantom letter (which is not printed but the space it would occupy if it was 'real' is taken into account). The box with the = sign has a bit smaller margin (2pt
) to look more like the original picture. The font is sans serif, using textsf
(in combination with boldface textbf
for the second France). The text COUNTRY
is made smaller with footnotesize
to simulate small caps.
However, this kind of drawing may be easier with TikZ, see also the other answer.
UPDATE using Helvetica (usepackagehelvet
) and some tweaks to the equal sign (box more square using smaller framesep
and a vertical phantom |
, rounded corners, equal sign slightly raised, bit less space before 'france' with phantom.
).
documentclassarticle
usepackagepstricks
usepackagexcolor
usepackagehelvet
definecolorlightyellowRGB255, 250, 236
definecolortextdarkRGB100, 52, 20
definecolorborderorangeRGB253, 129, 36
definecolorlightgrayRGB214, 214, 214
definecolorcountrygrayRGB153, 153, 153
begindocument
beginpspicture(5,5)
pssetfillstyle=solid, framearc=.4, linecolor=borderorange, linewidth=.8pt
rput[l](0,0)psframebox[fillcolor=lightyellow]textcolortextdarktextsftextbfFrance textcolorcountrygrayfootnotesizetextsfCOUNTRY
pssetfillstyle=solid, framearc=.2, linecolor=lightgray, linewidth=.4pt
rput[l](0.15,1)psframebox[fillcolor=white]textcolorblacktextsfphantom.france
pssetframearc=.5
rput[l](0,1)psframebox[fillcolor=orange,framesep=1pt]vphantomtinytextcolorwhiteraisebox1.2pt=
endpspicture
enddocument
This is almost exactly it! See my updated question where I added the exact fonts - can you tweak the equal sign to make it look more like the one I added?
â M.R.
45 mins ago
@M.R. is this any better?
â Marijn
19 mins ago
Great! one last thing - I added the equals icon in a link - can you add that?
â M.R.
17 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
It's been a while since I've used pstricks
, so I'll leave that for someone else to address. Also, I'm not fluent in using tcolorbox
. So, that too I'll leave for someone else. But, I will show how you can do this from TikZ
This answer is broken into four parts:
- How to draw the
France COUNTRY
box. This is the most straight-forward. - How to draw the
Equal france
box. I use a few more subtle tricks here. - Customizing your own colors using RGB specifications.
- Using your own image file to create an
Equal france
box like result
Box for "France COUNTRY"
documentclass[tikz,border=6pt]standalone
usepackagetikz
usetikzlibrarycalc
usetikzlibraryarrows.meta
usetikzlibraryintersections
newcommandmakegray[1]colorgray#1
begindocument
begintikzpicture
node[rounded corners,
draw=orange,
fill=orange!25,text=black,font=sffamily]
France makegrayCOUNTRY;
endtikzpicture
enddocument
Box for "Equal france"
documentclass[tikz,border=6pt]standalone
usepackagetikz
usetikzlibrarycalc
usetikzlibraryfit
usetikzlibraryarrows.meta
usetikzlibraryintersections
newcommandmakegray[1]colorgray#1
newsaveboxaeequalsign
beginlrboxaeequalsign
begintikzpicture[x=(4pt,0),
y=(0,4pt)]
fill[orange] (0,0) rectangle (5,3);
draw[white,line width=2pt] (1,1) -- ++ (3,0);
draw[white,line width=2pt] (1,2) -- ++ (3,0);
endtikzpicture
endlrbox
begindocument
begintikzpicture
node[inner sep=0pt] (AEEQUAL) useboxaeequalsign;
node[anchor=west,
font=sffamilybfseries] (FRANCE) at (AEEQUAL.east) france;
node[fit=(AEEQUAL) (FRANCE),inner ysep=5pt,inner xsep=0pt] (COMBINED) ;
draw[rounded corners=4pt]
(AEEQUAL.north) |- (COMBINED.north east)
-- (COMBINED.south east) -| (AEEQUAL.south);
endtikzpicture
enddocument
Colors:
If you don't like my colors, you can define your own, much like you did with pstricks
using the definecolor
macro provided with xcolor
(which is automatically loaded with TikZ).
definecolor<color name>rgb<decimal>,<decimal>,<decimal>
Here is an implementation for this in TikZ:
defaegrabvalues#1,#2,#3;%%
pgfmathsetmacroaeR#1/255%%
pgfmathsetmacroaeG#2/255%%
pgfmathsetmacroaeB#3/255
tikzsetdefine color/.code 2 args=%%
aegrabvalues#2;
definecolor#1rgbaeR,aeG,aeB
Then you can write
begintikzpicture
[
define color=borderorange253,129,36,
define color=lightyellow255,250,236,
]
node[rounded corners,
draw=borderorange,
fill=lightyellow,text=black,font=sffamilybfseries]
France makegrayCOUNTRY;
endtikzpicture
Including image files:
If you have an image file you would already like to include, that's straight-forward.
Just repurpose the code above for the equal sign as follows:
newsaveboxaeequalsign
beginlrboxaeequalsign
includegraphics[width=2em]image/no_you_cant
endlrbox
Thanks for your response, but I'm trying to get the exact pixel-for-pixel look - i.e. color/fonts - see in my question where I added them.
â M.R.
46 mins ago
@M.R.: You can, of course, just use the fonts you specify. The basic principle in the box designs remain the same. Do you know how to add fonts?
â Werner
41 mins ago
No but I added the equals icon in a link - if you can try adding that?
â M.R.
17 mins ago
@M.R. updated per your most recent request. Everything else in terms of pixel-for-pixel, that's up to you. I don't necessarily have access to the same fonts as you, for example.
â A.Ellett
6 mins ago
add a comment |Â
up vote
2
down vote
It's been a while since I've used pstricks
, so I'll leave that for someone else to address. Also, I'm not fluent in using tcolorbox
. So, that too I'll leave for someone else. But, I will show how you can do this from TikZ
This answer is broken into four parts:
- How to draw the
France COUNTRY
box. This is the most straight-forward. - How to draw the
Equal france
box. I use a few more subtle tricks here. - Customizing your own colors using RGB specifications.
- Using your own image file to create an
Equal france
box like result
Box for "France COUNTRY"
documentclass[tikz,border=6pt]standalone
usepackagetikz
usetikzlibrarycalc
usetikzlibraryarrows.meta
usetikzlibraryintersections
newcommandmakegray[1]colorgray#1
begindocument
begintikzpicture
node[rounded corners,
draw=orange,
fill=orange!25,text=black,font=sffamily]
France makegrayCOUNTRY;
endtikzpicture
enddocument
Box for "Equal france"
documentclass[tikz,border=6pt]standalone
usepackagetikz
usetikzlibrarycalc
usetikzlibraryfit
usetikzlibraryarrows.meta
usetikzlibraryintersections
newcommandmakegray[1]colorgray#1
newsaveboxaeequalsign
beginlrboxaeequalsign
begintikzpicture[x=(4pt,0),
y=(0,4pt)]
fill[orange] (0,0) rectangle (5,3);
draw[white,line width=2pt] (1,1) -- ++ (3,0);
draw[white,line width=2pt] (1,2) -- ++ (3,0);
endtikzpicture
endlrbox
begindocument
begintikzpicture
node[inner sep=0pt] (AEEQUAL) useboxaeequalsign;
node[anchor=west,
font=sffamilybfseries] (FRANCE) at (AEEQUAL.east) france;
node[fit=(AEEQUAL) (FRANCE),inner ysep=5pt,inner xsep=0pt] (COMBINED) ;
draw[rounded corners=4pt]
(AEEQUAL.north) |- (COMBINED.north east)
-- (COMBINED.south east) -| (AEEQUAL.south);
endtikzpicture
enddocument
Colors:
If you don't like my colors, you can define your own, much like you did with pstricks
using the definecolor
macro provided with xcolor
(which is automatically loaded with TikZ).
definecolor<color name>rgb<decimal>,<decimal>,<decimal>
Here is an implementation for this in TikZ:
defaegrabvalues#1,#2,#3;%%
pgfmathsetmacroaeR#1/255%%
pgfmathsetmacroaeG#2/255%%
pgfmathsetmacroaeB#3/255
tikzsetdefine color/.code 2 args=%%
aegrabvalues#2;
definecolor#1rgbaeR,aeG,aeB
Then you can write
begintikzpicture
[
define color=borderorange253,129,36,
define color=lightyellow255,250,236,
]
node[rounded corners,
draw=borderorange,
fill=lightyellow,text=black,font=sffamilybfseries]
France makegrayCOUNTRY;
endtikzpicture
Including image files:
If you have an image file you would already like to include, that's straight-forward.
Just repurpose the code above for the equal sign as follows:
newsaveboxaeequalsign
beginlrboxaeequalsign
includegraphics[width=2em]image/no_you_cant
endlrbox
Thanks for your response, but I'm trying to get the exact pixel-for-pixel look - i.e. color/fonts - see in my question where I added them.
â M.R.
46 mins ago
@M.R.: You can, of course, just use the fonts you specify. The basic principle in the box designs remain the same. Do you know how to add fonts?
â Werner
41 mins ago
No but I added the equals icon in a link - if you can try adding that?
â M.R.
17 mins ago
@M.R. updated per your most recent request. Everything else in terms of pixel-for-pixel, that's up to you. I don't necessarily have access to the same fonts as you, for example.
â A.Ellett
6 mins ago
add a comment |Â
up vote
2
down vote
up vote
2
down vote
It's been a while since I've used pstricks
, so I'll leave that for someone else to address. Also, I'm not fluent in using tcolorbox
. So, that too I'll leave for someone else. But, I will show how you can do this from TikZ
This answer is broken into four parts:
- How to draw the
France COUNTRY
box. This is the most straight-forward. - How to draw the
Equal france
box. I use a few more subtle tricks here. - Customizing your own colors using RGB specifications.
- Using your own image file to create an
Equal france
box like result
Box for "France COUNTRY"
documentclass[tikz,border=6pt]standalone
usepackagetikz
usetikzlibrarycalc
usetikzlibraryarrows.meta
usetikzlibraryintersections
newcommandmakegray[1]colorgray#1
begindocument
begintikzpicture
node[rounded corners,
draw=orange,
fill=orange!25,text=black,font=sffamily]
France makegrayCOUNTRY;
endtikzpicture
enddocument
Box for "Equal france"
documentclass[tikz,border=6pt]standalone
usepackagetikz
usetikzlibrarycalc
usetikzlibraryfit
usetikzlibraryarrows.meta
usetikzlibraryintersections
newcommandmakegray[1]colorgray#1
newsaveboxaeequalsign
beginlrboxaeequalsign
begintikzpicture[x=(4pt,0),
y=(0,4pt)]
fill[orange] (0,0) rectangle (5,3);
draw[white,line width=2pt] (1,1) -- ++ (3,0);
draw[white,line width=2pt] (1,2) -- ++ (3,0);
endtikzpicture
endlrbox
begindocument
begintikzpicture
node[inner sep=0pt] (AEEQUAL) useboxaeequalsign;
node[anchor=west,
font=sffamilybfseries] (FRANCE) at (AEEQUAL.east) france;
node[fit=(AEEQUAL) (FRANCE),inner ysep=5pt,inner xsep=0pt] (COMBINED) ;
draw[rounded corners=4pt]
(AEEQUAL.north) |- (COMBINED.north east)
-- (COMBINED.south east) -| (AEEQUAL.south);
endtikzpicture
enddocument
Colors:
If you don't like my colors, you can define your own, much like you did with pstricks
using the definecolor
macro provided with xcolor
(which is automatically loaded with TikZ).
definecolor<color name>rgb<decimal>,<decimal>,<decimal>
Here is an implementation for this in TikZ:
defaegrabvalues#1,#2,#3;%%
pgfmathsetmacroaeR#1/255%%
pgfmathsetmacroaeG#2/255%%
pgfmathsetmacroaeB#3/255
tikzsetdefine color/.code 2 args=%%
aegrabvalues#2;
definecolor#1rgbaeR,aeG,aeB
Then you can write
begintikzpicture
[
define color=borderorange253,129,36,
define color=lightyellow255,250,236,
]
node[rounded corners,
draw=borderorange,
fill=lightyellow,text=black,font=sffamilybfseries]
France makegrayCOUNTRY;
endtikzpicture
Including image files:
If you have an image file you would already like to include, that's straight-forward.
Just repurpose the code above for the equal sign as follows:
newsaveboxaeequalsign
beginlrboxaeequalsign
includegraphics[width=2em]image/no_you_cant
endlrbox
It's been a while since I've used pstricks
, so I'll leave that for someone else to address. Also, I'm not fluent in using tcolorbox
. So, that too I'll leave for someone else. But, I will show how you can do this from TikZ
This answer is broken into four parts:
- How to draw the
France COUNTRY
box. This is the most straight-forward. - How to draw the
Equal france
box. I use a few more subtle tricks here. - Customizing your own colors using RGB specifications.
- Using your own image file to create an
Equal france
box like result
Box for "France COUNTRY"
documentclass[tikz,border=6pt]standalone
usepackagetikz
usetikzlibrarycalc
usetikzlibraryarrows.meta
usetikzlibraryintersections
newcommandmakegray[1]colorgray#1
begindocument
begintikzpicture
node[rounded corners,
draw=orange,
fill=orange!25,text=black,font=sffamily]
France makegrayCOUNTRY;
endtikzpicture
enddocument
Box for "Equal france"
documentclass[tikz,border=6pt]standalone
usepackagetikz
usetikzlibrarycalc
usetikzlibraryfit
usetikzlibraryarrows.meta
usetikzlibraryintersections
newcommandmakegray[1]colorgray#1
newsaveboxaeequalsign
beginlrboxaeequalsign
begintikzpicture[x=(4pt,0),
y=(0,4pt)]
fill[orange] (0,0) rectangle (5,3);
draw[white,line width=2pt] (1,1) -- ++ (3,0);
draw[white,line width=2pt] (1,2) -- ++ (3,0);
endtikzpicture
endlrbox
begindocument
begintikzpicture
node[inner sep=0pt] (AEEQUAL) useboxaeequalsign;
node[anchor=west,
font=sffamilybfseries] (FRANCE) at (AEEQUAL.east) france;
node[fit=(AEEQUAL) (FRANCE),inner ysep=5pt,inner xsep=0pt] (COMBINED) ;
draw[rounded corners=4pt]
(AEEQUAL.north) |- (COMBINED.north east)
-- (COMBINED.south east) -| (AEEQUAL.south);
endtikzpicture
enddocument
Colors:
If you don't like my colors, you can define your own, much like you did with pstricks
using the definecolor
macro provided with xcolor
(which is automatically loaded with TikZ).
definecolor<color name>rgb<decimal>,<decimal>,<decimal>
Here is an implementation for this in TikZ:
defaegrabvalues#1,#2,#3;%%
pgfmathsetmacroaeR#1/255%%
pgfmathsetmacroaeG#2/255%%
pgfmathsetmacroaeB#3/255
tikzsetdefine color/.code 2 args=%%
aegrabvalues#2;
definecolor#1rgbaeR,aeG,aeB
Then you can write
begintikzpicture
[
define color=borderorange253,129,36,
define color=lightyellow255,250,236,
]
node[rounded corners,
draw=borderorange,
fill=lightyellow,text=black,font=sffamilybfseries]
France makegrayCOUNTRY;
endtikzpicture
Including image files:
If you have an image file you would already like to include, that's straight-forward.
Just repurpose the code above for the equal sign as follows:
newsaveboxaeequalsign
beginlrboxaeequalsign
includegraphics[width=2em]image/no_you_cant
endlrbox
edited 10 mins ago
answered 1 hour ago
A.Ellett
35.3k1063163
35.3k1063163
Thanks for your response, but I'm trying to get the exact pixel-for-pixel look - i.e. color/fonts - see in my question where I added them.
â M.R.
46 mins ago
@M.R.: You can, of course, just use the fonts you specify. The basic principle in the box designs remain the same. Do you know how to add fonts?
â Werner
41 mins ago
No but I added the equals icon in a link - if you can try adding that?
â M.R.
17 mins ago
@M.R. updated per your most recent request. Everything else in terms of pixel-for-pixel, that's up to you. I don't necessarily have access to the same fonts as you, for example.
â A.Ellett
6 mins ago
add a comment |Â
Thanks for your response, but I'm trying to get the exact pixel-for-pixel look - i.e. color/fonts - see in my question where I added them.
â M.R.
46 mins ago
@M.R.: You can, of course, just use the fonts you specify. The basic principle in the box designs remain the same. Do you know how to add fonts?
â Werner
41 mins ago
No but I added the equals icon in a link - if you can try adding that?
â M.R.
17 mins ago
@M.R. updated per your most recent request. Everything else in terms of pixel-for-pixel, that's up to you. I don't necessarily have access to the same fonts as you, for example.
â A.Ellett
6 mins ago
Thanks for your response, but I'm trying to get the exact pixel-for-pixel look - i.e. color/fonts - see in my question where I added them.
â M.R.
46 mins ago
Thanks for your response, but I'm trying to get the exact pixel-for-pixel look - i.e. color/fonts - see in my question where I added them.
â M.R.
46 mins ago
@M.R.: You can, of course, just use the fonts you specify. The basic principle in the box designs remain the same. Do you know how to add fonts?
â Werner
41 mins ago
@M.R.: You can, of course, just use the fonts you specify. The basic principle in the box designs remain the same. Do you know how to add fonts?
â Werner
41 mins ago
No but I added the equals icon in a link - if you can try adding that?
â M.R.
17 mins ago
No but I added the equals icon in a link - if you can try adding that?
â M.R.
17 mins ago
@M.R. updated per your most recent request. Everything else in terms of pixel-for-pixel, that's up to you. I don't necessarily have access to the same fonts as you, for example.
â A.Ellett
6 mins ago
@M.R. updated per your most recent request. Everything else in terms of pixel-for-pixel, that's up to you. I don't necessarily have access to the same fonts as you, for example.
â A.Ellett
6 mins ago
add a comment |Â
up vote
1
down vote
A solution using pstricks
:
documentclassarticle
usepackagepstricks
usepackagexcolor
definecolorlightyellowRGB255, 250, 236
definecolortextdarkRGB100, 52, 20
definecolorborderorangeRGB253, 129, 36
definecolorlightgrayRGB214, 214, 214
definecolorcountrygrayRGB153, 153, 153
begindocument
beginpspicture(5,5)
pssetfillstyle=solid, framearc=.4, linecolor=borderorange, linewidth=.8pt
rput[l](0,0)psframebox[fillcolor=lightyellow]textcolortextdarktextsftextbfFrance textcolorcountrygrayfootnotesizetextsfCOUNTRY
pssetfillstyle=solid, framearc=.2, linecolor=lightgray, linewidth=.4pt
rput[l](0.15,1)psframebox[fillcolor=white]textcolorblacktextsfphantomxfrance
rput[l](0,1)psframebox[fillcolor=orange,framesep=2pt]tinytextcolorwhite=
endpspicture
enddocument
The positioning is done using rput
with coordinates, which allows to place a box with an = on top of the box with france
. This text has been shifted a bit to the right using a phantom letter (which is not printed but the space it would occupy if it was 'real' is taken into account). The box with the = sign has a bit smaller margin (2pt
) to look more like the original picture. The font is sans serif, using textsf
(in combination with boldface textbf
for the second France). The text COUNTRY
is made smaller with footnotesize
to simulate small caps.
However, this kind of drawing may be easier with TikZ, see also the other answer.
UPDATE using Helvetica (usepackagehelvet
) and some tweaks to the equal sign (box more square using smaller framesep
and a vertical phantom |
, rounded corners, equal sign slightly raised, bit less space before 'france' with phantom.
).
documentclassarticle
usepackagepstricks
usepackagexcolor
usepackagehelvet
definecolorlightyellowRGB255, 250, 236
definecolortextdarkRGB100, 52, 20
definecolorborderorangeRGB253, 129, 36
definecolorlightgrayRGB214, 214, 214
definecolorcountrygrayRGB153, 153, 153
begindocument
beginpspicture(5,5)
pssetfillstyle=solid, framearc=.4, linecolor=borderorange, linewidth=.8pt
rput[l](0,0)psframebox[fillcolor=lightyellow]textcolortextdarktextsftextbfFrance textcolorcountrygrayfootnotesizetextsfCOUNTRY
pssetfillstyle=solid, framearc=.2, linecolor=lightgray, linewidth=.4pt
rput[l](0.15,1)psframebox[fillcolor=white]textcolorblacktextsfphantom.france
pssetframearc=.5
rput[l](0,1)psframebox[fillcolor=orange,framesep=1pt]vphantomtinytextcolorwhiteraisebox1.2pt=
endpspicture
enddocument
This is almost exactly it! See my updated question where I added the exact fonts - can you tweak the equal sign to make it look more like the one I added?
â M.R.
45 mins ago
@M.R. is this any better?
â Marijn
19 mins ago
Great! one last thing - I added the equals icon in a link - can you add that?
â M.R.
17 mins ago
add a comment |Â
up vote
1
down vote
A solution using pstricks
:
documentclassarticle
usepackagepstricks
usepackagexcolor
definecolorlightyellowRGB255, 250, 236
definecolortextdarkRGB100, 52, 20
definecolorborderorangeRGB253, 129, 36
definecolorlightgrayRGB214, 214, 214
definecolorcountrygrayRGB153, 153, 153
begindocument
beginpspicture(5,5)
pssetfillstyle=solid, framearc=.4, linecolor=borderorange, linewidth=.8pt
rput[l](0,0)psframebox[fillcolor=lightyellow]textcolortextdarktextsftextbfFrance textcolorcountrygrayfootnotesizetextsfCOUNTRY
pssetfillstyle=solid, framearc=.2, linecolor=lightgray, linewidth=.4pt
rput[l](0.15,1)psframebox[fillcolor=white]textcolorblacktextsfphantomxfrance
rput[l](0,1)psframebox[fillcolor=orange,framesep=2pt]tinytextcolorwhite=
endpspicture
enddocument
The positioning is done using rput
with coordinates, which allows to place a box with an = on top of the box with france
. This text has been shifted a bit to the right using a phantom letter (which is not printed but the space it would occupy if it was 'real' is taken into account). The box with the = sign has a bit smaller margin (2pt
) to look more like the original picture. The font is sans serif, using textsf
(in combination with boldface textbf
for the second France). The text COUNTRY
is made smaller with footnotesize
to simulate small caps.
However, this kind of drawing may be easier with TikZ, see also the other answer.
UPDATE using Helvetica (usepackagehelvet
) and some tweaks to the equal sign (box more square using smaller framesep
and a vertical phantom |
, rounded corners, equal sign slightly raised, bit less space before 'france' with phantom.
).
documentclassarticle
usepackagepstricks
usepackagexcolor
usepackagehelvet
definecolorlightyellowRGB255, 250, 236
definecolortextdarkRGB100, 52, 20
definecolorborderorangeRGB253, 129, 36
definecolorlightgrayRGB214, 214, 214
definecolorcountrygrayRGB153, 153, 153
begindocument
beginpspicture(5,5)
pssetfillstyle=solid, framearc=.4, linecolor=borderorange, linewidth=.8pt
rput[l](0,0)psframebox[fillcolor=lightyellow]textcolortextdarktextsftextbfFrance textcolorcountrygrayfootnotesizetextsfCOUNTRY
pssetfillstyle=solid, framearc=.2, linecolor=lightgray, linewidth=.4pt
rput[l](0.15,1)psframebox[fillcolor=white]textcolorblacktextsfphantom.france
pssetframearc=.5
rput[l](0,1)psframebox[fillcolor=orange,framesep=1pt]vphantomtinytextcolorwhiteraisebox1.2pt=
endpspicture
enddocument
This is almost exactly it! See my updated question where I added the exact fonts - can you tweak the equal sign to make it look more like the one I added?
â M.R.
45 mins ago
@M.R. is this any better?
â Marijn
19 mins ago
Great! one last thing - I added the equals icon in a link - can you add that?
â M.R.
17 mins ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
A solution using pstricks
:
documentclassarticle
usepackagepstricks
usepackagexcolor
definecolorlightyellowRGB255, 250, 236
definecolortextdarkRGB100, 52, 20
definecolorborderorangeRGB253, 129, 36
definecolorlightgrayRGB214, 214, 214
definecolorcountrygrayRGB153, 153, 153
begindocument
beginpspicture(5,5)
pssetfillstyle=solid, framearc=.4, linecolor=borderorange, linewidth=.8pt
rput[l](0,0)psframebox[fillcolor=lightyellow]textcolortextdarktextsftextbfFrance textcolorcountrygrayfootnotesizetextsfCOUNTRY
pssetfillstyle=solid, framearc=.2, linecolor=lightgray, linewidth=.4pt
rput[l](0.15,1)psframebox[fillcolor=white]textcolorblacktextsfphantomxfrance
rput[l](0,1)psframebox[fillcolor=orange,framesep=2pt]tinytextcolorwhite=
endpspicture
enddocument
The positioning is done using rput
with coordinates, which allows to place a box with an = on top of the box with france
. This text has been shifted a bit to the right using a phantom letter (which is not printed but the space it would occupy if it was 'real' is taken into account). The box with the = sign has a bit smaller margin (2pt
) to look more like the original picture. The font is sans serif, using textsf
(in combination with boldface textbf
for the second France). The text COUNTRY
is made smaller with footnotesize
to simulate small caps.
However, this kind of drawing may be easier with TikZ, see also the other answer.
UPDATE using Helvetica (usepackagehelvet
) and some tweaks to the equal sign (box more square using smaller framesep
and a vertical phantom |
, rounded corners, equal sign slightly raised, bit less space before 'france' with phantom.
).
documentclassarticle
usepackagepstricks
usepackagexcolor
usepackagehelvet
definecolorlightyellowRGB255, 250, 236
definecolortextdarkRGB100, 52, 20
definecolorborderorangeRGB253, 129, 36
definecolorlightgrayRGB214, 214, 214
definecolorcountrygrayRGB153, 153, 153
begindocument
beginpspicture(5,5)
pssetfillstyle=solid, framearc=.4, linecolor=borderorange, linewidth=.8pt
rput[l](0,0)psframebox[fillcolor=lightyellow]textcolortextdarktextsftextbfFrance textcolorcountrygrayfootnotesizetextsfCOUNTRY
pssetfillstyle=solid, framearc=.2, linecolor=lightgray, linewidth=.4pt
rput[l](0.15,1)psframebox[fillcolor=white]textcolorblacktextsfphantom.france
pssetframearc=.5
rput[l](0,1)psframebox[fillcolor=orange,framesep=1pt]vphantomtinytextcolorwhiteraisebox1.2pt=
endpspicture
enddocument
A solution using pstricks
:
documentclassarticle
usepackagepstricks
usepackagexcolor
definecolorlightyellowRGB255, 250, 236
definecolortextdarkRGB100, 52, 20
definecolorborderorangeRGB253, 129, 36
definecolorlightgrayRGB214, 214, 214
definecolorcountrygrayRGB153, 153, 153
begindocument
beginpspicture(5,5)
pssetfillstyle=solid, framearc=.4, linecolor=borderorange, linewidth=.8pt
rput[l](0,0)psframebox[fillcolor=lightyellow]textcolortextdarktextsftextbfFrance textcolorcountrygrayfootnotesizetextsfCOUNTRY
pssetfillstyle=solid, framearc=.2, linecolor=lightgray, linewidth=.4pt
rput[l](0.15,1)psframebox[fillcolor=white]textcolorblacktextsfphantomxfrance
rput[l](0,1)psframebox[fillcolor=orange,framesep=2pt]tinytextcolorwhite=
endpspicture
enddocument
The positioning is done using rput
with coordinates, which allows to place a box with an = on top of the box with france
. This text has been shifted a bit to the right using a phantom letter (which is not printed but the space it would occupy if it was 'real' is taken into account). The box with the = sign has a bit smaller margin (2pt
) to look more like the original picture. The font is sans serif, using textsf
(in combination with boldface textbf
for the second France). The text COUNTRY
is made smaller with footnotesize
to simulate small caps.
However, this kind of drawing may be easier with TikZ, see also the other answer.
UPDATE using Helvetica (usepackagehelvet
) and some tweaks to the equal sign (box more square using smaller framesep
and a vertical phantom |
, rounded corners, equal sign slightly raised, bit less space before 'france' with phantom.
).
documentclassarticle
usepackagepstricks
usepackagexcolor
usepackagehelvet
definecolorlightyellowRGB255, 250, 236
definecolortextdarkRGB100, 52, 20
definecolorborderorangeRGB253, 129, 36
definecolorlightgrayRGB214, 214, 214
definecolorcountrygrayRGB153, 153, 153
begindocument
beginpspicture(5,5)
pssetfillstyle=solid, framearc=.4, linecolor=borderorange, linewidth=.8pt
rput[l](0,0)psframebox[fillcolor=lightyellow]textcolortextdarktextsftextbfFrance textcolorcountrygrayfootnotesizetextsfCOUNTRY
pssetfillstyle=solid, framearc=.2, linecolor=lightgray, linewidth=.4pt
rput[l](0.15,1)psframebox[fillcolor=white]textcolorblacktextsfphantom.france
pssetframearc=.5
rput[l](0,1)psframebox[fillcolor=orange,framesep=1pt]vphantomtinytextcolorwhiteraisebox1.2pt=
endpspicture
enddocument
edited 23 mins ago
answered 50 mins ago
Marijn
6,996634
6,996634
This is almost exactly it! See my updated question where I added the exact fonts - can you tweak the equal sign to make it look more like the one I added?
â M.R.
45 mins ago
@M.R. is this any better?
â Marijn
19 mins ago
Great! one last thing - I added the equals icon in a link - can you add that?
â M.R.
17 mins ago
add a comment |Â
This is almost exactly it! See my updated question where I added the exact fonts - can you tweak the equal sign to make it look more like the one I added?
â M.R.
45 mins ago
@M.R. is this any better?
â Marijn
19 mins ago
Great! one last thing - I added the equals icon in a link - can you add that?
â M.R.
17 mins ago
This is almost exactly it! See my updated question where I added the exact fonts - can you tweak the equal sign to make it look more like the one I added?
â M.R.
45 mins ago
This is almost exactly it! See my updated question where I added the exact fonts - can you tweak the equal sign to make it look more like the one I added?
â M.R.
45 mins ago
@M.R. is this any better?
â Marijn
19 mins ago
@M.R. is this any better?
â Marijn
19 mins ago
Great! one last thing - I added the equals icon in a link - can you add that?
â M.R.
17 mins ago
Great! one last thing - I added the equals icon in a link - can you add that?
â M.R.
17 mins ago
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f454653%2fhow-to-make-boxes-like-these%23new-answer', 'question_page');
);
Post as a guest
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
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
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
Show us what you've already tried. We're happy to help you if you're not fully able to implement what you want. We're here to help you, but not to do your work for you.
â A.Ellett
2 hours ago
tcolorbox is definitely a good option. The manual details which keys are needed, so please post a minimal compilable code example of where you are stuck.
â TeXnician
1 hour ago