Encircle a formula with arrow pointing from the circle
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
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.
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.
tikz-styles circles
add a comment |Â
up vote
4
down vote
favorite
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.
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.
tikz-styles circles
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 withdocumentclass...
and ending withenddocument
.
â 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 abaseline
-TikZ picture.
â current_user
14 hours ago
1
Judging from the various comments I think that what you need is thetikznode
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
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
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.
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.
tikz-styles circles
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.
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.
tikz-styles circles
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 withdocumentclass...
and ending withenddocument
.
â 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 abaseline
-TikZ picture.
â current_user
14 hours ago
1
Judging from the various comments I think that what you need is thetikznode
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
add a comment |Â
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 withdocumentclass...
and ending withenddocument
.
â 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 abaseline
-TikZ picture.
â current_user
14 hours ago
1
Judging from the various comments I think that what you need is thetikznode
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
add a comment |Â
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.
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?.
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
I apologise for ambiguity, the downpointing arrow simply shows the output of command. Regardless, the question is answered :)
â Alvin Lepik
14 hours ago
add a comment |Â
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:
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:
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
add a comment |Â
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.
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?.
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
I apologise for ambiguity, the downpointing arrow simply shows the output of command. Regardless, the question is answered :)
â Alvin Lepik
14 hours ago
add a comment |Â
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.
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?.
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
I apologise for ambiguity, the downpointing arrow simply shows the output of command. Regardless, the question is answered :)
â Alvin Lepik
14 hours ago
add a comment |Â
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.
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?.
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
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.
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?.
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
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
add a comment |Â
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
add a comment |Â
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:
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:
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
add a comment |Â
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:
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:
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
add a comment |Â
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:
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:
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:
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:
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
add a comment |Â
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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f444678%2fencircle-a-formula-with-arrow-pointing-from-the-circle%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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 withenddocument
.â 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