Customize circled numbersGood way to make textcircled numbers?Circled inline numbers and lettersHow to encircle letters (a-z) with different circle and text colours without tikz?Rotate a node but not its content: the case of the ellipse decorationIncrease the thickness of node border in TikZHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionRelative transparency in TikZ?Drawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themtorn paper problem compile

Can a wire having a 610-670 THz (frequency of blue light) AC frequency supply, generate blue light?

Singlequote and backslash

Modern approach to radio buttons

What does War Machine's "Canopy! Canopy!" line mean in "Avengers: Endgame"?

Is having a hidden directory under /etc safe?

How to read a field in the variant template?

How to write crossed north east and south east arrows?

The deliberate use of misleading terminology

Are there regional foods in Westeros?

Can you use a concentration spell while using Mantle of Majesty?

Change TeXForm of ArcTan

What are the problems in teaching guitar via Skype?

Why does the UK have more political parties than the US?

Accidentally cashed a check twice

What if you don't bring your credit card or debit for incidentals?

'chmod' would set file permission to 000 no matter what permission I try to set

Beginner's snake game using PyGame

How can a single Member of the House block a Congressional bill?

Self-Preservation: How to DM NPCs that Love Living?

What caused the tendency for conservatives to not support climate change regulations?

What is the difference between nullifying your vote and not going to vote at all?

Why were the Night's Watch required to be celibate?

Infinitely many hats

If Sweden was to magically float away, at what altitude would it be visible from the southern hemisphere?



Customize circled numbers


Good way to make textcircled numbers?Circled inline numbers and lettersHow to encircle letters (a-z) with different circle and text colours without tikz?Rotate a node but not its content: the case of the ellipse decorationIncrease the thickness of node border in TikZHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionRelative transparency in TikZ?Drawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themtorn paper problem compile













4















Below is one solution (by @Stefan) for circled numbers with the help of tikz. What can I do to make it such that I can in-place customize its draw color, fill color, text color, etc.?



documentclass[tikz,border=7pt]standalone
newcommand*circled[1]tikz[baseline=(char.base)]
node[shape=circle,draw,inner sep=2pt] (char) #1;

begindocument
circled1
enddocument


enter image description here










share|improve this question






















  • Not tikz, but here's an answer using the picture environment for the same question: tex.stackexchange.com/a/460946/87678

    – David Purton
    Mar 24 at 10:10















4















Below is one solution (by @Stefan) for circled numbers with the help of tikz. What can I do to make it such that I can in-place customize its draw color, fill color, text color, etc.?



documentclass[tikz,border=7pt]standalone
newcommand*circled[1]tikz[baseline=(char.base)]
node[shape=circle,draw,inner sep=2pt] (char) #1;

begindocument
circled1
enddocument


enter image description here










share|improve this question






















  • Not tikz, but here's an answer using the picture environment for the same question: tex.stackexchange.com/a/460946/87678

    – David Purton
    Mar 24 at 10:10













4












4








4








Below is one solution (by @Stefan) for circled numbers with the help of tikz. What can I do to make it such that I can in-place customize its draw color, fill color, text color, etc.?



documentclass[tikz,border=7pt]standalone
newcommand*circled[1]tikz[baseline=(char.base)]
node[shape=circle,draw,inner sep=2pt] (char) #1;

begindocument
circled1
enddocument


enter image description here










share|improve this question














Below is one solution (by @Stefan) for circled numbers with the help of tikz. What can I do to make it such that I can in-place customize its draw color, fill color, text color, etc.?



documentclass[tikz,border=7pt]standalone
newcommand*circled[1]tikz[baseline=(char.base)]
node[shape=circle,draw,inner sep=2pt] (char) #1;

begindocument
circled1
enddocument


enter image description here







tikz-pgf






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 24 at 8:50









blackenedblackened

1,745815




1,745815












  • Not tikz, but here's an answer using the picture environment for the same question: tex.stackexchange.com/a/460946/87678

    – David Purton
    Mar 24 at 10:10

















  • Not tikz, but here's an answer using the picture environment for the same question: tex.stackexchange.com/a/460946/87678

    – David Purton
    Mar 24 at 10:10
















Not tikz, but here's an answer using the picture environment for the same question: tex.stackexchange.com/a/460946/87678

– David Purton
Mar 24 at 10:10





Not tikz, but here's an answer using the picture environment for the same question: tex.stackexchange.com/a/460946/87678

– David Purton
Mar 24 at 10:10










5 Answers
5






active

oldest

votes


















4














I would recommend using tikzmark here because this amazing library detects which mode (text vs. math mode, if math mode, which) you are in, so you won't have to care about this. And I would like to argue that one should specify the line width in relative units such that it scales with the font size. Of course, you have all the possibilities to color stuff and so on. (The best part is that you can connect the nodes in paths and so on.)



documentclassarticle
usepackagetikz
usetikzlibrarytikzmark
tikzsetmycircled/.style=circle,draw,inner sep=0.1em,line width=0.04em
begindocument
abc tikzmarknode[mycircled,draw=red]t1d
Huge tikzmarknode[mycircled,draw=blue,text=purple]t1D
[
intlimits_tikzmarknode[mycircled,red]a1a^tikzmarknode[mycircled,blue]b1b
f(x),mathrmdx=F(tikzmarknode[mycircled,red]a2a)-
F(tikzmarknode[mycircled,blue]b2b)
]
begintikzpicture[overlay,remember picture]
draw[latex-latex,red] (a1) to[bend right] (a2);
draw[latex-latex,blue] (b1) to[bend left] (b2);
endtikzpicture
enddocument


enter image description here






share|improve this answer

























  • The TikZ Wizard at work!

    – user36296
    Mar 24 at 13:01











  • @marmot Why can't I compile your code?

    – blackened
    Mar 24 at 13:31






  • 2





    @blackened Probably because you have not the most recent version of tikzmark. tikzmarknode was added last June or so. You may have to update your TeX installation.

    – marmot
    Mar 24 at 13:32


















7














Edit after @marmot's (kind :P) comment (thanks):



This answer REALLY takes some care about a somehow constant size for all letters but not when line width is increased/decreased, because I had to set this parameter as extra or make some hacks in the way that it will be provided to my macro and I am not really sure if the OP need to change the line width (I just gave it initally as an idea about improving the appearance.)



documentclassarticle
usepackagetikz
usetikzlibrarycalc
makeatletter
newlengthmylength
xdefCircleFactor1.1
setlengthmylengthdimexprf@size pt
newsaveboxmybox

newcommand*circled[2][draw=blue]saveboxmyboxvboxvphantomWL1/#1setlengthmylengthdimexprCircleFactordimexprhtmybox+dpmyboxrelaxrelaxtikzsetmystyle/.style=circle,#1,minimum height=mylength
tikz[baseline=(char.base)]
node[mystyle] (char) #2;
makeatother
begindocument
This answer takes care of the current font size in a way that circledi and circledW will appear the same size here and in the next paragpaph with a verb|tiny| (or whatever font).

noindent Demonstration:\
circledicircledicircledWcircledW\
circledWcircledWcircledicircledi

tiny This answer takes care of the current font size in a way that circledi and circledW will appear the same size here and in the this with a verb|tiny| (or whatever font).

noindent Demonstration:\
noindentcircledicircledicircledWcircledW\
circledWcircledWcircledicircledi

normalsize Also you can give a parameter inside an optional argument of the command and have different appearance:

circled[text=blue,fill=red,draw=black]Wcircled[fill=yellow,draw=red,text=blue]W

enddocument


enter image description here



This is the old answer that DOESN'T REALY take care for the size according to my answer here.



You will select the style and could add your preferred style inside the optional argument of the definition of the command (I just placed the draw=blue option)



documentclassarticle
usepackagetikz
usetikzlibrarycalc
makeatletter
defmfontsizef@size
newcommand*circled[2][draw=blue]tikzsetmystyle/.style=circle,#1,minimum height=mfontsize*1.4tikz[baseline=(char.base)]

node[mystyle] (char) vphantomWAH1g#2;
makeatother

begindocument
This is circleda circled[text=blue,fill=orange,draw=red, line width=0.3mm]1 balloon.

enddocument


enter image description here






share|improve this answer

























  • Takes care of the size. Really? Try begindocument noindentcircledi noindentcircledw enddocument

    – marmot
    Mar 24 at 12:51











  • @marmot: Possibly it was a lie... :P. If it was for "real" your example would not fail. (Thanks... kidding because this "Really?" heard funny to me. Edited).

    – koleygr
    Mar 24 at 13:39



















6














You can add more parameters to the command.



MWE:



documentclass[tikz,border=7pt]standalone
newcommand*circled[4]tikz[baseline=(char.base)]
node[shape=circle, fill=#2, draw=#3, text=#4, inner sep=2pt] (char) #1;

begindocument
circled1redgreenblue
enddocument


Result:



enter image description here



You can also specify default values for the colors using NewDocumentCommand from the xparse package:



documentclass[tikz,border=7pt]standalone
usepackagexparse
NewDocumentCommandcircleddefaults
Oblack
Oyellow
Oorange
m

tikz[baseline=(char.base)]
node[shape=circle, fill=#1, draw=#2, text=#3, inner sep=2pt] (char) #4;

newcommand*circled[4]tikz[baseline=(char.base)]
node[shape=circle, fill=#2, draw=#3, text=#4, inner sep=2pt] (char) #1;

begindocument
circled1redgreenblue

circleddefaults[blue,brown]2 % two colors specified, third default

circleddefaults3 % all defaults
enddocument


enter image description here






share|improve this answer
































    6














    Here is a "double" customization that defines :



    • an optional parameter of circled that can be any style applied to the node,

    • an optional every number style that, if defined, is applied to all circled numbers.

    documentclass[border=7pt]standalone
    usepackagetikz
    newcommand*circled[2][]tikz[baseline=(char.base)]
    node[shape=circle,draw,inner sep=2pt,#1,every number/.try] (char) #2;
    tikzstyleevery number=[draw=red] % I like to use tikzstyle ;)
    begindocument
    circled1circled[fill=yellow]2
    enddocument


    enter image description here






    share|improve this answer






























      3














      Here there is a minimal proposal hoping to have understood your request.



      enter image description here



      documentclass[tikz,border=7pt]standalone
      newcommand*circled[1]tikz[baseline=(char.base)]
      node[shape=circle, fill= red, draw=yellow, inner sep=2pt] (char) #1;

      begindocument
      circled1
      enddocument





      share|improve this answer




















      • 1





        I need to be able to change the style when I use it.

        – blackened
        Mar 24 at 9:15











      • In my humble opinion, it is necessary to change the excellent macro according to your needs with a new command. It depends on what you need. Have you looked at TikZ's manual?

        – Sebastiano
        Mar 24 at 9:17











      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/3.0/"u003ecc by-sa 3.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
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f481168%2fcustomize-circled-numbers%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      5 Answers
      5






      active

      oldest

      votes








      5 Answers
      5






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      4














      I would recommend using tikzmark here because this amazing library detects which mode (text vs. math mode, if math mode, which) you are in, so you won't have to care about this. And I would like to argue that one should specify the line width in relative units such that it scales with the font size. Of course, you have all the possibilities to color stuff and so on. (The best part is that you can connect the nodes in paths and so on.)



      documentclassarticle
      usepackagetikz
      usetikzlibrarytikzmark
      tikzsetmycircled/.style=circle,draw,inner sep=0.1em,line width=0.04em
      begindocument
      abc tikzmarknode[mycircled,draw=red]t1d
      Huge tikzmarknode[mycircled,draw=blue,text=purple]t1D
      [
      intlimits_tikzmarknode[mycircled,red]a1a^tikzmarknode[mycircled,blue]b1b
      f(x),mathrmdx=F(tikzmarknode[mycircled,red]a2a)-
      F(tikzmarknode[mycircled,blue]b2b)
      ]
      begintikzpicture[overlay,remember picture]
      draw[latex-latex,red] (a1) to[bend right] (a2);
      draw[latex-latex,blue] (b1) to[bend left] (b2);
      endtikzpicture
      enddocument


      enter image description here






      share|improve this answer

























      • The TikZ Wizard at work!

        – user36296
        Mar 24 at 13:01











      • @marmot Why can't I compile your code?

        – blackened
        Mar 24 at 13:31






      • 2





        @blackened Probably because you have not the most recent version of tikzmark. tikzmarknode was added last June or so. You may have to update your TeX installation.

        – marmot
        Mar 24 at 13:32















      4














      I would recommend using tikzmark here because this amazing library detects which mode (text vs. math mode, if math mode, which) you are in, so you won't have to care about this. And I would like to argue that one should specify the line width in relative units such that it scales with the font size. Of course, you have all the possibilities to color stuff and so on. (The best part is that you can connect the nodes in paths and so on.)



      documentclassarticle
      usepackagetikz
      usetikzlibrarytikzmark
      tikzsetmycircled/.style=circle,draw,inner sep=0.1em,line width=0.04em
      begindocument
      abc tikzmarknode[mycircled,draw=red]t1d
      Huge tikzmarknode[mycircled,draw=blue,text=purple]t1D
      [
      intlimits_tikzmarknode[mycircled,red]a1a^tikzmarknode[mycircled,blue]b1b
      f(x),mathrmdx=F(tikzmarknode[mycircled,red]a2a)-
      F(tikzmarknode[mycircled,blue]b2b)
      ]
      begintikzpicture[overlay,remember picture]
      draw[latex-latex,red] (a1) to[bend right] (a2);
      draw[latex-latex,blue] (b1) to[bend left] (b2);
      endtikzpicture
      enddocument


      enter image description here






      share|improve this answer

























      • The TikZ Wizard at work!

        – user36296
        Mar 24 at 13:01











      • @marmot Why can't I compile your code?

        – blackened
        Mar 24 at 13:31






      • 2





        @blackened Probably because you have not the most recent version of tikzmark. tikzmarknode was added last June or so. You may have to update your TeX installation.

        – marmot
        Mar 24 at 13:32













      4












      4








      4







      I would recommend using tikzmark here because this amazing library detects which mode (text vs. math mode, if math mode, which) you are in, so you won't have to care about this. And I would like to argue that one should specify the line width in relative units such that it scales with the font size. Of course, you have all the possibilities to color stuff and so on. (The best part is that you can connect the nodes in paths and so on.)



      documentclassarticle
      usepackagetikz
      usetikzlibrarytikzmark
      tikzsetmycircled/.style=circle,draw,inner sep=0.1em,line width=0.04em
      begindocument
      abc tikzmarknode[mycircled,draw=red]t1d
      Huge tikzmarknode[mycircled,draw=blue,text=purple]t1D
      [
      intlimits_tikzmarknode[mycircled,red]a1a^tikzmarknode[mycircled,blue]b1b
      f(x),mathrmdx=F(tikzmarknode[mycircled,red]a2a)-
      F(tikzmarknode[mycircled,blue]b2b)
      ]
      begintikzpicture[overlay,remember picture]
      draw[latex-latex,red] (a1) to[bend right] (a2);
      draw[latex-latex,blue] (b1) to[bend left] (b2);
      endtikzpicture
      enddocument


      enter image description here






      share|improve this answer















      I would recommend using tikzmark here because this amazing library detects which mode (text vs. math mode, if math mode, which) you are in, so you won't have to care about this. And I would like to argue that one should specify the line width in relative units such that it scales with the font size. Of course, you have all the possibilities to color stuff and so on. (The best part is that you can connect the nodes in paths and so on.)



      documentclassarticle
      usepackagetikz
      usetikzlibrarytikzmark
      tikzsetmycircled/.style=circle,draw,inner sep=0.1em,line width=0.04em
      begindocument
      abc tikzmarknode[mycircled,draw=red]t1d
      Huge tikzmarknode[mycircled,draw=blue,text=purple]t1D
      [
      intlimits_tikzmarknode[mycircled,red]a1a^tikzmarknode[mycircled,blue]b1b
      f(x),mathrmdx=F(tikzmarknode[mycircled,red]a2a)-
      F(tikzmarknode[mycircled,blue]b2b)
      ]
      begintikzpicture[overlay,remember picture]
      draw[latex-latex,red] (a1) to[bend right] (a2);
      draw[latex-latex,blue] (b1) to[bend left] (b2);
      endtikzpicture
      enddocument


      enter image description here







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Mar 24 at 13:05

























      answered Mar 24 at 13:00









      marmotmarmot

      131k6166315




      131k6166315












      • The TikZ Wizard at work!

        – user36296
        Mar 24 at 13:01











      • @marmot Why can't I compile your code?

        – blackened
        Mar 24 at 13:31






      • 2





        @blackened Probably because you have not the most recent version of tikzmark. tikzmarknode was added last June or so. You may have to update your TeX installation.

        – marmot
        Mar 24 at 13:32

















      • The TikZ Wizard at work!

        – user36296
        Mar 24 at 13:01











      • @marmot Why can't I compile your code?

        – blackened
        Mar 24 at 13:31






      • 2





        @blackened Probably because you have not the most recent version of tikzmark. tikzmarknode was added last June or so. You may have to update your TeX installation.

        – marmot
        Mar 24 at 13:32
















      The TikZ Wizard at work!

      – user36296
      Mar 24 at 13:01





      The TikZ Wizard at work!

      – user36296
      Mar 24 at 13:01













      @marmot Why can't I compile your code?

      – blackened
      Mar 24 at 13:31





      @marmot Why can't I compile your code?

      – blackened
      Mar 24 at 13:31




      2




      2





      @blackened Probably because you have not the most recent version of tikzmark. tikzmarknode was added last June or so. You may have to update your TeX installation.

      – marmot
      Mar 24 at 13:32





      @blackened Probably because you have not the most recent version of tikzmark. tikzmarknode was added last June or so. You may have to update your TeX installation.

      – marmot
      Mar 24 at 13:32











      7














      Edit after @marmot's (kind :P) comment (thanks):



      This answer REALLY takes some care about a somehow constant size for all letters but not when line width is increased/decreased, because I had to set this parameter as extra or make some hacks in the way that it will be provided to my macro and I am not really sure if the OP need to change the line width (I just gave it initally as an idea about improving the appearance.)



      documentclassarticle
      usepackagetikz
      usetikzlibrarycalc
      makeatletter
      newlengthmylength
      xdefCircleFactor1.1
      setlengthmylengthdimexprf@size pt
      newsaveboxmybox

      newcommand*circled[2][draw=blue]saveboxmyboxvboxvphantomWL1/#1setlengthmylengthdimexprCircleFactordimexprhtmybox+dpmyboxrelaxrelaxtikzsetmystyle/.style=circle,#1,minimum height=mylength
      tikz[baseline=(char.base)]
      node[mystyle] (char) #2;
      makeatother
      begindocument
      This answer takes care of the current font size in a way that circledi and circledW will appear the same size here and in the next paragpaph with a verb|tiny| (or whatever font).

      noindent Demonstration:\
      circledicircledicircledWcircledW\
      circledWcircledWcircledicircledi

      tiny This answer takes care of the current font size in a way that circledi and circledW will appear the same size here and in the this with a verb|tiny| (or whatever font).

      noindent Demonstration:\
      noindentcircledicircledicircledWcircledW\
      circledWcircledWcircledicircledi

      normalsize Also you can give a parameter inside an optional argument of the command and have different appearance:

      circled[text=blue,fill=red,draw=black]Wcircled[fill=yellow,draw=red,text=blue]W

      enddocument


      enter image description here



      This is the old answer that DOESN'T REALY take care for the size according to my answer here.



      You will select the style and could add your preferred style inside the optional argument of the definition of the command (I just placed the draw=blue option)



      documentclassarticle
      usepackagetikz
      usetikzlibrarycalc
      makeatletter
      defmfontsizef@size
      newcommand*circled[2][draw=blue]tikzsetmystyle/.style=circle,#1,minimum height=mfontsize*1.4tikz[baseline=(char.base)]

      node[mystyle] (char) vphantomWAH1g#2;
      makeatother

      begindocument
      This is circleda circled[text=blue,fill=orange,draw=red, line width=0.3mm]1 balloon.

      enddocument


      enter image description here






      share|improve this answer

























      • Takes care of the size. Really? Try begindocument noindentcircledi noindentcircledw enddocument

        – marmot
        Mar 24 at 12:51











      • @marmot: Possibly it was a lie... :P. If it was for "real" your example would not fail. (Thanks... kidding because this "Really?" heard funny to me. Edited).

        – koleygr
        Mar 24 at 13:39
















      7














      Edit after @marmot's (kind :P) comment (thanks):



      This answer REALLY takes some care about a somehow constant size for all letters but not when line width is increased/decreased, because I had to set this parameter as extra or make some hacks in the way that it will be provided to my macro and I am not really sure if the OP need to change the line width (I just gave it initally as an idea about improving the appearance.)



      documentclassarticle
      usepackagetikz
      usetikzlibrarycalc
      makeatletter
      newlengthmylength
      xdefCircleFactor1.1
      setlengthmylengthdimexprf@size pt
      newsaveboxmybox

      newcommand*circled[2][draw=blue]saveboxmyboxvboxvphantomWL1/#1setlengthmylengthdimexprCircleFactordimexprhtmybox+dpmyboxrelaxrelaxtikzsetmystyle/.style=circle,#1,minimum height=mylength
      tikz[baseline=(char.base)]
      node[mystyle] (char) #2;
      makeatother
      begindocument
      This answer takes care of the current font size in a way that circledi and circledW will appear the same size here and in the next paragpaph with a verb|tiny| (or whatever font).

      noindent Demonstration:\
      circledicircledicircledWcircledW\
      circledWcircledWcircledicircledi

      tiny This answer takes care of the current font size in a way that circledi and circledW will appear the same size here and in the this with a verb|tiny| (or whatever font).

      noindent Demonstration:\
      noindentcircledicircledicircledWcircledW\
      circledWcircledWcircledicircledi

      normalsize Also you can give a parameter inside an optional argument of the command and have different appearance:

      circled[text=blue,fill=red,draw=black]Wcircled[fill=yellow,draw=red,text=blue]W

      enddocument


      enter image description here



      This is the old answer that DOESN'T REALY take care for the size according to my answer here.



      You will select the style and could add your preferred style inside the optional argument of the definition of the command (I just placed the draw=blue option)



      documentclassarticle
      usepackagetikz
      usetikzlibrarycalc
      makeatletter
      defmfontsizef@size
      newcommand*circled[2][draw=blue]tikzsetmystyle/.style=circle,#1,minimum height=mfontsize*1.4tikz[baseline=(char.base)]

      node[mystyle] (char) vphantomWAH1g#2;
      makeatother

      begindocument
      This is circleda circled[text=blue,fill=orange,draw=red, line width=0.3mm]1 balloon.

      enddocument


      enter image description here






      share|improve this answer

























      • Takes care of the size. Really? Try begindocument noindentcircledi noindentcircledw enddocument

        – marmot
        Mar 24 at 12:51











      • @marmot: Possibly it was a lie... :P. If it was for "real" your example would not fail. (Thanks... kidding because this "Really?" heard funny to me. Edited).

        – koleygr
        Mar 24 at 13:39














      7












      7








      7







      Edit after @marmot's (kind :P) comment (thanks):



      This answer REALLY takes some care about a somehow constant size for all letters but not when line width is increased/decreased, because I had to set this parameter as extra or make some hacks in the way that it will be provided to my macro and I am not really sure if the OP need to change the line width (I just gave it initally as an idea about improving the appearance.)



      documentclassarticle
      usepackagetikz
      usetikzlibrarycalc
      makeatletter
      newlengthmylength
      xdefCircleFactor1.1
      setlengthmylengthdimexprf@size pt
      newsaveboxmybox

      newcommand*circled[2][draw=blue]saveboxmyboxvboxvphantomWL1/#1setlengthmylengthdimexprCircleFactordimexprhtmybox+dpmyboxrelaxrelaxtikzsetmystyle/.style=circle,#1,minimum height=mylength
      tikz[baseline=(char.base)]
      node[mystyle] (char) #2;
      makeatother
      begindocument
      This answer takes care of the current font size in a way that circledi and circledW will appear the same size here and in the next paragpaph with a verb|tiny| (or whatever font).

      noindent Demonstration:\
      circledicircledicircledWcircledW\
      circledWcircledWcircledicircledi

      tiny This answer takes care of the current font size in a way that circledi and circledW will appear the same size here and in the this with a verb|tiny| (or whatever font).

      noindent Demonstration:\
      noindentcircledicircledicircledWcircledW\
      circledWcircledWcircledicircledi

      normalsize Also you can give a parameter inside an optional argument of the command and have different appearance:

      circled[text=blue,fill=red,draw=black]Wcircled[fill=yellow,draw=red,text=blue]W

      enddocument


      enter image description here



      This is the old answer that DOESN'T REALY take care for the size according to my answer here.



      You will select the style and could add your preferred style inside the optional argument of the definition of the command (I just placed the draw=blue option)



      documentclassarticle
      usepackagetikz
      usetikzlibrarycalc
      makeatletter
      defmfontsizef@size
      newcommand*circled[2][draw=blue]tikzsetmystyle/.style=circle,#1,minimum height=mfontsize*1.4tikz[baseline=(char.base)]

      node[mystyle] (char) vphantomWAH1g#2;
      makeatother

      begindocument
      This is circleda circled[text=blue,fill=orange,draw=red, line width=0.3mm]1 balloon.

      enddocument


      enter image description here






      share|improve this answer















      Edit after @marmot's (kind :P) comment (thanks):



      This answer REALLY takes some care about a somehow constant size for all letters but not when line width is increased/decreased, because I had to set this parameter as extra or make some hacks in the way that it will be provided to my macro and I am not really sure if the OP need to change the line width (I just gave it initally as an idea about improving the appearance.)



      documentclassarticle
      usepackagetikz
      usetikzlibrarycalc
      makeatletter
      newlengthmylength
      xdefCircleFactor1.1
      setlengthmylengthdimexprf@size pt
      newsaveboxmybox

      newcommand*circled[2][draw=blue]saveboxmyboxvboxvphantomWL1/#1setlengthmylengthdimexprCircleFactordimexprhtmybox+dpmyboxrelaxrelaxtikzsetmystyle/.style=circle,#1,minimum height=mylength
      tikz[baseline=(char.base)]
      node[mystyle] (char) #2;
      makeatother
      begindocument
      This answer takes care of the current font size in a way that circledi and circledW will appear the same size here and in the next paragpaph with a verb|tiny| (or whatever font).

      noindent Demonstration:\
      circledicircledicircledWcircledW\
      circledWcircledWcircledicircledi

      tiny This answer takes care of the current font size in a way that circledi and circledW will appear the same size here and in the this with a verb|tiny| (or whatever font).

      noindent Demonstration:\
      noindentcircledicircledicircledWcircledW\
      circledWcircledWcircledicircledi

      normalsize Also you can give a parameter inside an optional argument of the command and have different appearance:

      circled[text=blue,fill=red,draw=black]Wcircled[fill=yellow,draw=red,text=blue]W

      enddocument


      enter image description here



      This is the old answer that DOESN'T REALY take care for the size according to my answer here.



      You will select the style and could add your preferred style inside the optional argument of the definition of the command (I just placed the draw=blue option)



      documentclassarticle
      usepackagetikz
      usetikzlibrarycalc
      makeatletter
      defmfontsizef@size
      newcommand*circled[2][draw=blue]tikzsetmystyle/.style=circle,#1,minimum height=mfontsize*1.4tikz[baseline=(char.base)]

      node[mystyle] (char) vphantomWAH1g#2;
      makeatother

      begindocument
      This is circleda circled[text=blue,fill=orange,draw=red, line width=0.3mm]1 balloon.

      enddocument


      enter image description here







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Mar 24 at 14:21

























      answered Mar 24 at 9:32









      koleygrkoleygr

      13.4k11040




      13.4k11040












      • Takes care of the size. Really? Try begindocument noindentcircledi noindentcircledw enddocument

        – marmot
        Mar 24 at 12:51











      • @marmot: Possibly it was a lie... :P. If it was for "real" your example would not fail. (Thanks... kidding because this "Really?" heard funny to me. Edited).

        – koleygr
        Mar 24 at 13:39


















      • Takes care of the size. Really? Try begindocument noindentcircledi noindentcircledw enddocument

        – marmot
        Mar 24 at 12:51











      • @marmot: Possibly it was a lie... :P. If it was for "real" your example would not fail. (Thanks... kidding because this "Really?" heard funny to me. Edited).

        – koleygr
        Mar 24 at 13:39

















      Takes care of the size. Really? Try begindocument noindentcircledi noindentcircledw enddocument

      – marmot
      Mar 24 at 12:51





      Takes care of the size. Really? Try begindocument noindentcircledi noindentcircledw enddocument

      – marmot
      Mar 24 at 12:51













      @marmot: Possibly it was a lie... :P. If it was for "real" your example would not fail. (Thanks... kidding because this "Really?" heard funny to me. Edited).

      – koleygr
      Mar 24 at 13:39






      @marmot: Possibly it was a lie... :P. If it was for "real" your example would not fail. (Thanks... kidding because this "Really?" heard funny to me. Edited).

      – koleygr
      Mar 24 at 13:39












      6














      You can add more parameters to the command.



      MWE:



      documentclass[tikz,border=7pt]standalone
      newcommand*circled[4]tikz[baseline=(char.base)]
      node[shape=circle, fill=#2, draw=#3, text=#4, inner sep=2pt] (char) #1;

      begindocument
      circled1redgreenblue
      enddocument


      Result:



      enter image description here



      You can also specify default values for the colors using NewDocumentCommand from the xparse package:



      documentclass[tikz,border=7pt]standalone
      usepackagexparse
      NewDocumentCommandcircleddefaults
      Oblack
      Oyellow
      Oorange
      m

      tikz[baseline=(char.base)]
      node[shape=circle, fill=#1, draw=#2, text=#3, inner sep=2pt] (char) #4;

      newcommand*circled[4]tikz[baseline=(char.base)]
      node[shape=circle, fill=#2, draw=#3, text=#4, inner sep=2pt] (char) #1;

      begindocument
      circled1redgreenblue

      circleddefaults[blue,brown]2 % two colors specified, third default

      circleddefaults3 % all defaults
      enddocument


      enter image description here






      share|improve this answer





























        6














        You can add more parameters to the command.



        MWE:



        documentclass[tikz,border=7pt]standalone
        newcommand*circled[4]tikz[baseline=(char.base)]
        node[shape=circle, fill=#2, draw=#3, text=#4, inner sep=2pt] (char) #1;

        begindocument
        circled1redgreenblue
        enddocument


        Result:



        enter image description here



        You can also specify default values for the colors using NewDocumentCommand from the xparse package:



        documentclass[tikz,border=7pt]standalone
        usepackagexparse
        NewDocumentCommandcircleddefaults
        Oblack
        Oyellow
        Oorange
        m

        tikz[baseline=(char.base)]
        node[shape=circle, fill=#1, draw=#2, text=#3, inner sep=2pt] (char) #4;

        newcommand*circled[4]tikz[baseline=(char.base)]
        node[shape=circle, fill=#2, draw=#3, text=#4, inner sep=2pt] (char) #1;

        begindocument
        circled1redgreenblue

        circleddefaults[blue,brown]2 % two colors specified, third default

        circleddefaults3 % all defaults
        enddocument


        enter image description here






        share|improve this answer



























          6












          6








          6







          You can add more parameters to the command.



          MWE:



          documentclass[tikz,border=7pt]standalone
          newcommand*circled[4]tikz[baseline=(char.base)]
          node[shape=circle, fill=#2, draw=#3, text=#4, inner sep=2pt] (char) #1;

          begindocument
          circled1redgreenblue
          enddocument


          Result:



          enter image description here



          You can also specify default values for the colors using NewDocumentCommand from the xparse package:



          documentclass[tikz,border=7pt]standalone
          usepackagexparse
          NewDocumentCommandcircleddefaults
          Oblack
          Oyellow
          Oorange
          m

          tikz[baseline=(char.base)]
          node[shape=circle, fill=#1, draw=#2, text=#3, inner sep=2pt] (char) #4;

          newcommand*circled[4]tikz[baseline=(char.base)]
          node[shape=circle, fill=#2, draw=#3, text=#4, inner sep=2pt] (char) #1;

          begindocument
          circled1redgreenblue

          circleddefaults[blue,brown]2 % two colors specified, third default

          circleddefaults3 % all defaults
          enddocument


          enter image description here






          share|improve this answer















          You can add more parameters to the command.



          MWE:



          documentclass[tikz,border=7pt]standalone
          newcommand*circled[4]tikz[baseline=(char.base)]
          node[shape=circle, fill=#2, draw=#3, text=#4, inner sep=2pt] (char) #1;

          begindocument
          circled1redgreenblue
          enddocument


          Result:



          enter image description here



          You can also specify default values for the colors using NewDocumentCommand from the xparse package:



          documentclass[tikz,border=7pt]standalone
          usepackagexparse
          NewDocumentCommandcircleddefaults
          Oblack
          Oyellow
          Oorange
          m

          tikz[baseline=(char.base)]
          node[shape=circle, fill=#1, draw=#2, text=#3, inner sep=2pt] (char) #4;

          newcommand*circled[4]tikz[baseline=(char.base)]
          node[shape=circle, fill=#2, draw=#3, text=#4, inner sep=2pt] (char) #1;

          begindocument
          circled1redgreenblue

          circleddefaults[blue,brown]2 % two colors specified, third default

          circleddefaults3 % all defaults
          enddocument


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 24 at 9:33

























          answered Mar 24 at 9:25









          MarijnMarijn

          9,439639




          9,439639





















              6














              Here is a "double" customization that defines :



              • an optional parameter of circled that can be any style applied to the node,

              • an optional every number style that, if defined, is applied to all circled numbers.

              documentclass[border=7pt]standalone
              usepackagetikz
              newcommand*circled[2][]tikz[baseline=(char.base)]
              node[shape=circle,draw,inner sep=2pt,#1,every number/.try] (char) #2;
              tikzstyleevery number=[draw=red] % I like to use tikzstyle ;)
              begindocument
              circled1circled[fill=yellow]2
              enddocument


              enter image description here






              share|improve this answer



























                6














                Here is a "double" customization that defines :



                • an optional parameter of circled that can be any style applied to the node,

                • an optional every number style that, if defined, is applied to all circled numbers.

                documentclass[border=7pt]standalone
                usepackagetikz
                newcommand*circled[2][]tikz[baseline=(char.base)]
                node[shape=circle,draw,inner sep=2pt,#1,every number/.try] (char) #2;
                tikzstyleevery number=[draw=red] % I like to use tikzstyle ;)
                begindocument
                circled1circled[fill=yellow]2
                enddocument


                enter image description here






                share|improve this answer

























                  6












                  6








                  6







                  Here is a "double" customization that defines :



                  • an optional parameter of circled that can be any style applied to the node,

                  • an optional every number style that, if defined, is applied to all circled numbers.

                  documentclass[border=7pt]standalone
                  usepackagetikz
                  newcommand*circled[2][]tikz[baseline=(char.base)]
                  node[shape=circle,draw,inner sep=2pt,#1,every number/.try] (char) #2;
                  tikzstyleevery number=[draw=red] % I like to use tikzstyle ;)
                  begindocument
                  circled1circled[fill=yellow]2
                  enddocument


                  enter image description here






                  share|improve this answer













                  Here is a "double" customization that defines :



                  • an optional parameter of circled that can be any style applied to the node,

                  • an optional every number style that, if defined, is applied to all circled numbers.

                  documentclass[border=7pt]standalone
                  usepackagetikz
                  newcommand*circled[2][]tikz[baseline=(char.base)]
                  node[shape=circle,draw,inner sep=2pt,#1,every number/.try] (char) #2;
                  tikzstyleevery number=[draw=red] % I like to use tikzstyle ;)
                  begindocument
                  circled1circled[fill=yellow]2
                  enddocument


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 24 at 10:22









                  KpymKpym

                  18k24192




                  18k24192





















                      3














                      Here there is a minimal proposal hoping to have understood your request.



                      enter image description here



                      documentclass[tikz,border=7pt]standalone
                      newcommand*circled[1]tikz[baseline=(char.base)]
                      node[shape=circle, fill= red, draw=yellow, inner sep=2pt] (char) #1;

                      begindocument
                      circled1
                      enddocument





                      share|improve this answer




















                      • 1





                        I need to be able to change the style when I use it.

                        – blackened
                        Mar 24 at 9:15











                      • In my humble opinion, it is necessary to change the excellent macro according to your needs with a new command. It depends on what you need. Have you looked at TikZ's manual?

                        – Sebastiano
                        Mar 24 at 9:17















                      3














                      Here there is a minimal proposal hoping to have understood your request.



                      enter image description here



                      documentclass[tikz,border=7pt]standalone
                      newcommand*circled[1]tikz[baseline=(char.base)]
                      node[shape=circle, fill= red, draw=yellow, inner sep=2pt] (char) #1;

                      begindocument
                      circled1
                      enddocument





                      share|improve this answer




















                      • 1





                        I need to be able to change the style when I use it.

                        – blackened
                        Mar 24 at 9:15











                      • In my humble opinion, it is necessary to change the excellent macro according to your needs with a new command. It depends on what you need. Have you looked at TikZ's manual?

                        – Sebastiano
                        Mar 24 at 9:17













                      3












                      3








                      3







                      Here there is a minimal proposal hoping to have understood your request.



                      enter image description here



                      documentclass[tikz,border=7pt]standalone
                      newcommand*circled[1]tikz[baseline=(char.base)]
                      node[shape=circle, fill= red, draw=yellow, inner sep=2pt] (char) #1;

                      begindocument
                      circled1
                      enddocument





                      share|improve this answer















                      Here there is a minimal proposal hoping to have understood your request.



                      enter image description here



                      documentclass[tikz,border=7pt]standalone
                      newcommand*circled[1]tikz[baseline=(char.base)]
                      node[shape=circle, fill= red, draw=yellow, inner sep=2pt] (char) #1;

                      begindocument
                      circled1
                      enddocument






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Mar 24 at 12:32

























                      answered Mar 24 at 9:11









                      SebastianoSebastiano

                      12.6k42570




                      12.6k42570







                      • 1





                        I need to be able to change the style when I use it.

                        – blackened
                        Mar 24 at 9:15











                      • In my humble opinion, it is necessary to change the excellent macro according to your needs with a new command. It depends on what you need. Have you looked at TikZ's manual?

                        – Sebastiano
                        Mar 24 at 9:17












                      • 1





                        I need to be able to change the style when I use it.

                        – blackened
                        Mar 24 at 9:15











                      • In my humble opinion, it is necessary to change the excellent macro according to your needs with a new command. It depends on what you need. Have you looked at TikZ's manual?

                        – Sebastiano
                        Mar 24 at 9:17







                      1




                      1





                      I need to be able to change the style when I use it.

                      – blackened
                      Mar 24 at 9:15





                      I need to be able to change the style when I use it.

                      – blackened
                      Mar 24 at 9:15













                      In my humble opinion, it is necessary to change the excellent macro according to your needs with a new command. It depends on what you need. Have you looked at TikZ's manual?

                      – Sebastiano
                      Mar 24 at 9:17





                      In my humble opinion, it is necessary to change the excellent macro according to your needs with a new command. It depends on what you need. Have you looked at TikZ's manual?

                      – Sebastiano
                      Mar 24 at 9:17

















                      draft saved

                      draft discarded
















































                      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.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f481168%2fcustomize-circled-numbers%23new-answer', 'question_page');

                      );

                      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







                      Popular posts from this blog

                      SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                      용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                      155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해