Encircle a formula with arrow pointing from the circle

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











up vote
4
down vote

favorite
1












Is there perhaps a package that already does something like this?



In THIS topic encircling a formula is given, but I don't understand the syntax to modify the 'circle' to have an arrow point outward from somewhere.



The end goal is to have something like this.



image



I tried to use the example given in the linked topic as a base



documentclassarticle

usepackagetikz

makeatletter
newcommand*encircled[1]relaxifmmodemathpalette@encircled@math#1else@encircled#1fi
newcommand*@encircled@math[2]@encircled$m@th#1#2$
newcommand*@encircled[1]%
tikz[baseline,anchor=base]node[draw,circle,outer sep=0pt,inner sep=.2ex] #1;
makeatother

begindocument not important at the moment
enddocument


There are a lot of embellishments that have something to do with preserving proper formating or some such. The core of the problem is to modify the node[...] bit which results in a circle with an arrow pointing out from it, but I feel that's a dead-end.







share|improve this question





















  • Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with documentclass... and ending with enddocument.
    – albert
    15 hours ago










  • @Alvin_Lepik: Do you want the whole picture in TikZ or just the circled part – I'm confused, since I think I didn't understood your question … I thought you want a command which produces a circles node from which is pointing an arrow out and that all as a baseline-TikZ picture.
    – current_user
    14 hours ago







  • 1




    Judging from the various comments I think that what you need is the tikznode approach where the positioning is done by TeX implicitly; see the second modified example in my answer.
    – gernot
    13 hours ago










  • @gernot very elegant indeed, I appreciate also the links you added. I accepted your answer, instead as I feel it is more complete, not to take anything away from current_user.
    – Alvin Lepik
    12 hours ago














up vote
4
down vote

favorite
1












Is there perhaps a package that already does something like this?



In THIS topic encircling a formula is given, but I don't understand the syntax to modify the 'circle' to have an arrow point outward from somewhere.



The end goal is to have something like this.



image



I tried to use the example given in the linked topic as a base



documentclassarticle

usepackagetikz

makeatletter
newcommand*encircled[1]relaxifmmodemathpalette@encircled@math#1else@encircled#1fi
newcommand*@encircled@math[2]@encircled$m@th#1#2$
newcommand*@encircled[1]%
tikz[baseline,anchor=base]node[draw,circle,outer sep=0pt,inner sep=.2ex] #1;
makeatother

begindocument not important at the moment
enddocument


There are a lot of embellishments that have something to do with preserving proper formating or some such. The core of the problem is to modify the node[...] bit which results in a circle with an arrow pointing out from it, but I feel that's a dead-end.







share|improve this question





















  • Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with documentclass... and ending with enddocument.
    – albert
    15 hours ago










  • @Alvin_Lepik: Do you want the whole picture in TikZ or just the circled part – I'm confused, since I think I didn't understood your question … I thought you want a command which produces a circles node from which is pointing an arrow out and that all as a baseline-TikZ picture.
    – current_user
    14 hours ago







  • 1




    Judging from the various comments I think that what you need is the tikznode approach where the positioning is done by TeX implicitly; see the second modified example in my answer.
    – gernot
    13 hours ago










  • @gernot very elegant indeed, I appreciate also the links you added. I accepted your answer, instead as I feel it is more complete, not to take anything away from current_user.
    – Alvin Lepik
    12 hours ago












up vote
4
down vote

favorite
1









up vote
4
down vote

favorite
1






1





Is there perhaps a package that already does something like this?



In THIS topic encircling a formula is given, but I don't understand the syntax to modify the 'circle' to have an arrow point outward from somewhere.



The end goal is to have something like this.



image



I tried to use the example given in the linked topic as a base



documentclassarticle

usepackagetikz

makeatletter
newcommand*encircled[1]relaxifmmodemathpalette@encircled@math#1else@encircled#1fi
newcommand*@encircled@math[2]@encircled$m@th#1#2$
newcommand*@encircled[1]%
tikz[baseline,anchor=base]node[draw,circle,outer sep=0pt,inner sep=.2ex] #1;
makeatother

begindocument not important at the moment
enddocument


There are a lot of embellishments that have something to do with preserving proper formating or some such. The core of the problem is to modify the node[...] bit which results in a circle with an arrow pointing out from it, but I feel that's a dead-end.







share|improve this question













Is there perhaps a package that already does something like this?



In THIS topic encircling a formula is given, but I don't understand the syntax to modify the 'circle' to have an arrow point outward from somewhere.



The end goal is to have something like this.



image



I tried to use the example given in the linked topic as a base



documentclassarticle

usepackagetikz

makeatletter
newcommand*encircled[1]relaxifmmodemathpalette@encircled@math#1else@encircled#1fi
newcommand*@encircled@math[2]@encircled$m@th#1#2$
newcommand*@encircled[1]%
tikz[baseline,anchor=base]node[draw,circle,outer sep=0pt,inner sep=.2ex] #1;
makeatother

begindocument not important at the moment
enddocument


There are a lot of embellishments that have something to do with preserving proper formating or some such. The core of the problem is to modify the node[...] bit which results in a circle with an arrow pointing out from it, but I feel that's a dead-end.









share|improve this question












share|improve this question




share|improve this question








edited 15 hours ago
























asked 16 hours ago









Alvin Lepik

1505




1505











  • Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with documentclass... and ending with enddocument.
    – albert
    15 hours ago










  • @Alvin_Lepik: Do you want the whole picture in TikZ or just the circled part – I'm confused, since I think I didn't understood your question … I thought you want a command which produces a circles node from which is pointing an arrow out and that all as a baseline-TikZ picture.
    – current_user
    14 hours ago







  • 1




    Judging from the various comments I think that what you need is the tikznode approach where the positioning is done by TeX implicitly; see the second modified example in my answer.
    – gernot
    13 hours ago










  • @gernot very elegant indeed, I appreciate also the links you added. I accepted your answer, instead as I feel it is more complete, not to take anything away from current_user.
    – Alvin Lepik
    12 hours ago
















  • Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with documentclass... and ending with enddocument.
    – albert
    15 hours ago










  • @Alvin_Lepik: Do you want the whole picture in TikZ or just the circled part – I'm confused, since I think I didn't understood your question … I thought you want a command which produces a circles node from which is pointing an arrow out and that all as a baseline-TikZ picture.
    – current_user
    14 hours ago







  • 1




    Judging from the various comments I think that what you need is the tikznode approach where the positioning is done by TeX implicitly; see the second modified example in my answer.
    – gernot
    13 hours ago










  • @gernot very elegant indeed, I appreciate also the links you added. I accepted your answer, instead as I feel it is more complete, not to take anything away from current_user.
    – Alvin Lepik
    12 hours ago















Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with documentclass... and ending with enddocument.
– albert
15 hours ago




Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with documentclass... and ending with enddocument.
– albert
15 hours ago












@Alvin_Lepik: Do you want the whole picture in TikZ or just the circled part – I'm confused, since I think I didn't understood your question … I thought you want a command which produces a circles node from which is pointing an arrow out and that all as a baseline-TikZ picture.
– current_user
14 hours ago





@Alvin_Lepik: Do you want the whole picture in TikZ or just the circled part – I'm confused, since I think I didn't understood your question … I thought you want a command which produces a circles node from which is pointing an arrow out and that all as a baseline-TikZ picture.
– current_user
14 hours ago





1




1




Judging from the various comments I think that what you need is the tikznode approach where the positioning is done by TeX implicitly; see the second modified example in my answer.
– gernot
13 hours ago




Judging from the various comments I think that what you need is the tikznode approach where the positioning is done by TeX implicitly; see the second modified example in my answer.
– gernot
13 hours ago












@gernot very elegant indeed, I appreciate also the links you added. I accepted your answer, instead as I feel it is more complete, not to take anything away from current_user.
– Alvin Lepik
12 hours ago




@gernot very elegant indeed, I appreciate also the links you added. I accepted your answer, instead as I feel it is more complete, not to take anything away from current_user.
– Alvin Lepik
12 hours ago










2 Answers
2






active

oldest

votes

















up vote
7
down vote



accepted










The best approach depends on whether your sketch is meant as a single image---in this case use a single tikzpicture environment---or whether the items appear mixed with text on a page---in this case use the tikznode command from this post. Here are examples for both situations. Note that you have to run LaTeX twice on the second example.



Everything in a single picture: The position of the elements can be specified explicitly relative to each other.



enter image description here



documentclass[border=1pt]standalone
usepackagetikz
usetikzlibrarypositioning
begindocument
begintikzpicture
node[circle,draw](fx)$f(x)$;
node(a)[below right=of fx]$a$;
draw[->] (fx) -- (a);
endtikzpicture
enddocument


Graphical elements as part of text: The position of the elements is defined implicitly by the typesetting engine that positions the elements.
For examples of the use of tikznode see e.g. Breaking numbers Simple addition, How to add arrow in equations and matrix? or how can you point the head of an arrow from tikzpicture to an equation in LaTex?.



enter image description here



documentclassarticle
usepackagetikz
newcommandtikznode[3]%
tikz[remember picture,baseline=(#2.base)]
node[minimum size=0pt,inner sep=0pt,#1](#2)#3;%

begindocument
[ fracg(x)tikznode[circle,draw]fx$f(x)$
=fracg(x)tikznodea$a$
]
begintikzpicture[remember picture,overlay]
draw[->] (fx) edge[bend right] (a);
endtikzpicture
enddocument





share|improve this answer























  • I apologise for ambiguity, the downpointing arrow simply shows the output of command. Regardless, the question is answered :)
    – Alvin Lepik
    14 hours ago


















up vote
4
down vote













Maybe something like this?



documentclassarticle
usepackagetikz,blindtext
newcommandmycircle[2]begintikzpicture[remember picture]
node[draw,circle] (#2) $#1$;
draw[->] (#2) --+ (1,-1) node[below right] $#2$;
endtikzpicture

begindocument
blindtextpar
mycirclef(x)apar
blindtext
enddocument


Here is the output:



Screenshot



EDIT: The denominator isn't overlapped:



MWE:



documentclassarticle
usepackagetikz,blindtext
newcommandmycircle[2]begintikzpicture[remember picture]
node[draw,circle] (#2) $#1$;
draw[->] (#2.south east) --+ (1,-1) node[below right] $#2$;
endtikzpicture

begindocument
blindtextpar
mycirclef(x)apar
[
fracf(x)mycircleg(x)a
]
blindtextpar
enddocument


Output:



Screenshot






share|improve this answer























  • you're right, overlapping was due to a box environment in which I was using the circling.
    – Alvin Lepik
    13 hours ago











  • @Alvin_Lepkik: Ahh, now I gotcha.
    – current_user
    13 hours 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%2f444678%2fencircle-a-formula-with-arrow-pointing-from-the-circle%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
7
down vote



accepted










The best approach depends on whether your sketch is meant as a single image---in this case use a single tikzpicture environment---or whether the items appear mixed with text on a page---in this case use the tikznode command from this post. Here are examples for both situations. Note that you have to run LaTeX twice on the second example.



Everything in a single picture: The position of the elements can be specified explicitly relative to each other.



enter image description here



documentclass[border=1pt]standalone
usepackagetikz
usetikzlibrarypositioning
begindocument
begintikzpicture
node[circle,draw](fx)$f(x)$;
node(a)[below right=of fx]$a$;
draw[->] (fx) -- (a);
endtikzpicture
enddocument


Graphical elements as part of text: The position of the elements is defined implicitly by the typesetting engine that positions the elements.
For examples of the use of tikznode see e.g. Breaking numbers Simple addition, How to add arrow in equations and matrix? or how can you point the head of an arrow from tikzpicture to an equation in LaTex?.



enter image description here



documentclassarticle
usepackagetikz
newcommandtikznode[3]%
tikz[remember picture,baseline=(#2.base)]
node[minimum size=0pt,inner sep=0pt,#1](#2)#3;%

begindocument
[ fracg(x)tikznode[circle,draw]fx$f(x)$
=fracg(x)tikznodea$a$
]
begintikzpicture[remember picture,overlay]
draw[->] (fx) edge[bend right] (a);
endtikzpicture
enddocument





share|improve this answer























  • I apologise for ambiguity, the downpointing arrow simply shows the output of command. Regardless, the question is answered :)
    – Alvin Lepik
    14 hours ago















up vote
7
down vote



accepted










The best approach depends on whether your sketch is meant as a single image---in this case use a single tikzpicture environment---or whether the items appear mixed with text on a page---in this case use the tikznode command from this post. Here are examples for both situations. Note that you have to run LaTeX twice on the second example.



Everything in a single picture: The position of the elements can be specified explicitly relative to each other.



enter image description here



documentclass[border=1pt]standalone
usepackagetikz
usetikzlibrarypositioning
begindocument
begintikzpicture
node[circle,draw](fx)$f(x)$;
node(a)[below right=of fx]$a$;
draw[->] (fx) -- (a);
endtikzpicture
enddocument


Graphical elements as part of text: The position of the elements is defined implicitly by the typesetting engine that positions the elements.
For examples of the use of tikznode see e.g. Breaking numbers Simple addition, How to add arrow in equations and matrix? or how can you point the head of an arrow from tikzpicture to an equation in LaTex?.



enter image description here



documentclassarticle
usepackagetikz
newcommandtikznode[3]%
tikz[remember picture,baseline=(#2.base)]
node[minimum size=0pt,inner sep=0pt,#1](#2)#3;%

begindocument
[ fracg(x)tikznode[circle,draw]fx$f(x)$
=fracg(x)tikznodea$a$
]
begintikzpicture[remember picture,overlay]
draw[->] (fx) edge[bend right] (a);
endtikzpicture
enddocument





share|improve this answer























  • I apologise for ambiguity, the downpointing arrow simply shows the output of command. Regardless, the question is answered :)
    – Alvin Lepik
    14 hours ago













up vote
7
down vote



accepted







up vote
7
down vote



accepted






The best approach depends on whether your sketch is meant as a single image---in this case use a single tikzpicture environment---or whether the items appear mixed with text on a page---in this case use the tikznode command from this post. Here are examples for both situations. Note that you have to run LaTeX twice on the second example.



Everything in a single picture: The position of the elements can be specified explicitly relative to each other.



enter image description here



documentclass[border=1pt]standalone
usepackagetikz
usetikzlibrarypositioning
begindocument
begintikzpicture
node[circle,draw](fx)$f(x)$;
node(a)[below right=of fx]$a$;
draw[->] (fx) -- (a);
endtikzpicture
enddocument


Graphical elements as part of text: The position of the elements is defined implicitly by the typesetting engine that positions the elements.
For examples of the use of tikznode see e.g. Breaking numbers Simple addition, How to add arrow in equations and matrix? or how can you point the head of an arrow from tikzpicture to an equation in LaTex?.



enter image description here



documentclassarticle
usepackagetikz
newcommandtikznode[3]%
tikz[remember picture,baseline=(#2.base)]
node[minimum size=0pt,inner sep=0pt,#1](#2)#3;%

begindocument
[ fracg(x)tikznode[circle,draw]fx$f(x)$
=fracg(x)tikznodea$a$
]
begintikzpicture[remember picture,overlay]
draw[->] (fx) edge[bend right] (a);
endtikzpicture
enddocument





share|improve this answer















The best approach depends on whether your sketch is meant as a single image---in this case use a single tikzpicture environment---or whether the items appear mixed with text on a page---in this case use the tikznode command from this post. Here are examples for both situations. Note that you have to run LaTeX twice on the second example.



Everything in a single picture: The position of the elements can be specified explicitly relative to each other.



enter image description here



documentclass[border=1pt]standalone
usepackagetikz
usetikzlibrarypositioning
begindocument
begintikzpicture
node[circle,draw](fx)$f(x)$;
node(a)[below right=of fx]$a$;
draw[->] (fx) -- (a);
endtikzpicture
enddocument


Graphical elements as part of text: The position of the elements is defined implicitly by the typesetting engine that positions the elements.
For examples of the use of tikznode see e.g. Breaking numbers Simple addition, How to add arrow in equations and matrix? or how can you point the head of an arrow from tikzpicture to an equation in LaTex?.



enter image description here



documentclassarticle
usepackagetikz
newcommandtikznode[3]%
tikz[remember picture,baseline=(#2.base)]
node[minimum size=0pt,inner sep=0pt,#1](#2)#3;%

begindocument
[ fracg(x)tikznode[circle,draw]fx$f(x)$
=fracg(x)tikznodea$a$
]
begintikzpicture[remember picture,overlay]
draw[->] (fx) edge[bend right] (a);
endtikzpicture
enddocument






share|improve this answer















share|improve this answer



share|improve this answer








edited 13 hours ago


























answered 14 hours ago









gernot

25.6k22858




25.6k22858











  • I apologise for ambiguity, the downpointing arrow simply shows the output of command. Regardless, the question is answered :)
    – Alvin Lepik
    14 hours ago

















  • I apologise for ambiguity, the downpointing arrow simply shows the output of command. Regardless, the question is answered :)
    – Alvin Lepik
    14 hours ago
















I apologise for ambiguity, the downpointing arrow simply shows the output of command. Regardless, the question is answered :)
– Alvin Lepik
14 hours ago





I apologise for ambiguity, the downpointing arrow simply shows the output of command. Regardless, the question is answered :)
– Alvin Lepik
14 hours ago











up vote
4
down vote













Maybe something like this?



documentclassarticle
usepackagetikz,blindtext
newcommandmycircle[2]begintikzpicture[remember picture]
node[draw,circle] (#2) $#1$;
draw[->] (#2) --+ (1,-1) node[below right] $#2$;
endtikzpicture

begindocument
blindtextpar
mycirclef(x)apar
blindtext
enddocument


Here is the output:



Screenshot



EDIT: The denominator isn't overlapped:



MWE:



documentclassarticle
usepackagetikz,blindtext
newcommandmycircle[2]begintikzpicture[remember picture]
node[draw,circle] (#2) $#1$;
draw[->] (#2.south east) --+ (1,-1) node[below right] $#2$;
endtikzpicture

begindocument
blindtextpar
mycirclef(x)apar
[
fracf(x)mycircleg(x)a
]
blindtextpar
enddocument


Output:



Screenshot






share|improve this answer























  • you're right, overlapping was due to a box environment in which I was using the circling.
    – Alvin Lepik
    13 hours ago











  • @Alvin_Lepkik: Ahh, now I gotcha.
    – current_user
    13 hours ago














up vote
4
down vote













Maybe something like this?



documentclassarticle
usepackagetikz,blindtext
newcommandmycircle[2]begintikzpicture[remember picture]
node[draw,circle] (#2) $#1$;
draw[->] (#2) --+ (1,-1) node[below right] $#2$;
endtikzpicture

begindocument
blindtextpar
mycirclef(x)apar
blindtext
enddocument


Here is the output:



Screenshot



EDIT: The denominator isn't overlapped:



MWE:



documentclassarticle
usepackagetikz,blindtext
newcommandmycircle[2]begintikzpicture[remember picture]
node[draw,circle] (#2) $#1$;
draw[->] (#2.south east) --+ (1,-1) node[below right] $#2$;
endtikzpicture

begindocument
blindtextpar
mycirclef(x)apar
[
fracf(x)mycircleg(x)a
]
blindtextpar
enddocument


Output:



Screenshot






share|improve this answer























  • you're right, overlapping was due to a box environment in which I was using the circling.
    – Alvin Lepik
    13 hours ago











  • @Alvin_Lepkik: Ahh, now I gotcha.
    – current_user
    13 hours ago












up vote
4
down vote










up vote
4
down vote









Maybe something like this?



documentclassarticle
usepackagetikz,blindtext
newcommandmycircle[2]begintikzpicture[remember picture]
node[draw,circle] (#2) $#1$;
draw[->] (#2) --+ (1,-1) node[below right] $#2$;
endtikzpicture

begindocument
blindtextpar
mycirclef(x)apar
blindtext
enddocument


Here is the output:



Screenshot



EDIT: The denominator isn't overlapped:



MWE:



documentclassarticle
usepackagetikz,blindtext
newcommandmycircle[2]begintikzpicture[remember picture]
node[draw,circle] (#2) $#1$;
draw[->] (#2.south east) --+ (1,-1) node[below right] $#2$;
endtikzpicture

begindocument
blindtextpar
mycirclef(x)apar
[
fracf(x)mycircleg(x)a
]
blindtextpar
enddocument


Output:



Screenshot






share|improve this answer















Maybe something like this?



documentclassarticle
usepackagetikz,blindtext
newcommandmycircle[2]begintikzpicture[remember picture]
node[draw,circle] (#2) $#1$;
draw[->] (#2) --+ (1,-1) node[below right] $#2$;
endtikzpicture

begindocument
blindtextpar
mycirclef(x)apar
blindtext
enddocument


Here is the output:



Screenshot



EDIT: The denominator isn't overlapped:



MWE:



documentclassarticle
usepackagetikz,blindtext
newcommandmycircle[2]begintikzpicture[remember picture]
node[draw,circle] (#2) $#1$;
draw[->] (#2.south east) --+ (1,-1) node[below right] $#2$;
endtikzpicture

begindocument
blindtextpar
mycirclef(x)apar
[
fracf(x)mycircleg(x)a
]
blindtextpar
enddocument


Output:



Screenshot







share|improve this answer















share|improve this answer



share|improve this answer








edited 13 hours ago


























answered 14 hours ago









current_user

87315




87315











  • you're right, overlapping was due to a box environment in which I was using the circling.
    – Alvin Lepik
    13 hours ago











  • @Alvin_Lepkik: Ahh, now I gotcha.
    – current_user
    13 hours ago
















  • you're right, overlapping was due to a box environment in which I was using the circling.
    – Alvin Lepik
    13 hours ago











  • @Alvin_Lepkik: Ahh, now I gotcha.
    – current_user
    13 hours ago















you're right, overlapping was due to a box environment in which I was using the circling.
– Alvin Lepik
13 hours ago





you're right, overlapping was due to a box environment in which I was using the circling.
– Alvin Lepik
13 hours ago













@Alvin_Lepkik: Ahh, now I gotcha.
– current_user
13 hours ago




@Alvin_Lepkik: Ahh, now I gotcha.
– current_user
13 hours 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%2f444678%2fencircle-a-formula-with-arrow-pointing-from-the-circle%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What is the equation of a 3D cone with generalised tilt?

Color the edges and diagonals of a regular polygon

Relationship between determinant of matrix and determinant of adjoint?