How to make boxes like these?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite
2












I'd like to have custom commands for making boxes that look like the Wolfram|Alpha entities in Mathematica notebooks:



LinguisticAssistantfrance
EntityFrancecountry


enter image description hereenter image description here



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​


enter image description here



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.










share|improve this question























  • 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














up vote
3
down vote

favorite
2












I'd like to have custom commands for making boxes that look like the Wolfram|Alpha entities in Mathematica notebooks:



LinguisticAssistantfrance
EntityFrancecountry


enter image description hereenter image description here



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​


enter image description here



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.










share|improve this question























  • 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












up vote
3
down vote

favorite
2









up vote
3
down vote

favorite
2






2





I'd like to have custom commands for making boxes that look like the Wolfram|Alpha entities in Mathematica notebooks:



LinguisticAssistantfrance
EntityFrancecountry


enter image description hereenter image description here



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​


enter image description here



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.










share|improve this question















I'd like to have custom commands for making boxes that look like the Wolfram|Alpha entities in Mathematica notebooks:



LinguisticAssistantfrance
EntityFrancecountry


enter image description hereenter image description here



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​


enter image description here



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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
















  • 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










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"



enter image description here



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"



enter image description here



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.



enter image description here



Just repurpose the code above for the equal sign as follows:



newsaveboxaeequalsign
beginlrboxaeequalsign
includegraphics[width=2em]image/no_you_cant
endlrbox





share|improve this answer






















  • 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


















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


enter image description here



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.).



enter image description here



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





share|improve this answer






















  • 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










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f454653%2fhow-to-make-boxes-like-these%23new-answer', 'question_page');

);

Post as a guest






























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"



enter image description here



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"



enter image description here



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.



enter image description here



Just repurpose the code above for the equal sign as follows:



newsaveboxaeequalsign
beginlrboxaeequalsign
includegraphics[width=2em]image/no_you_cant
endlrbox





share|improve this answer






















  • 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















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"



enter image description here



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"



enter image description here



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.



enter image description here



Just repurpose the code above for the equal sign as follows:



newsaveboxaeequalsign
beginlrboxaeequalsign
includegraphics[width=2em]image/no_you_cant
endlrbox





share|improve this answer






















  • 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













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"



enter image description here



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"



enter image description here



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.



enter image description here



Just repurpose the code above for the equal sign as follows:



newsaveboxaeequalsign
beginlrboxaeequalsign
includegraphics[width=2em]image/no_you_cant
endlrbox





share|improve this answer














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"



enter image description here



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"



enter image description here



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.



enter image description here



Just repurpose the code above for the equal sign as follows:



newsaveboxaeequalsign
beginlrboxaeequalsign
includegraphics[width=2em]image/no_you_cant
endlrbox






share|improve this answer














share|improve this answer



share|improve this answer








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

















  • 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











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


enter image description here



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.).



enter image description here



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





share|improve this answer






















  • 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














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


enter image description here



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.).



enter image description here



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





share|improve this answer






















  • 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












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


enter image description here



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.).



enter image description here



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





share|improve this answer














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


enter image description here



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.).



enter image description here



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






share|improve this answer














share|improve this answer



share|improve this answer








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
















  • 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

















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

Installing NextGIS Connect into QGIS 3?

One-line joke