Fractions and Equivalent Fractions
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
How can I turn the yellow shaded area into an opaque shaded 1 to demonstrate the idea of an equivalent fraction?
documentclassarticle
usepackagetikz,amsmath,xcolor
begindocument
[ begintikzpicture
node at (0,0) $dfraca cdot cb cdot c=colorblueunderbracecolorblackdfracab cdot colorboxyellow$dfracc
c$colorblack=dfracab$};
draw[->,blue] (.2,-.5)--(.2,-.7)--(1.2,-.7)--(1.2,-.3);
node at (.2,-.7) [below right] scriptsize $colorbluetextSince dfracab cdot 1 =dfracab$;
endtikzpicture ]
enddocument
To look like this :
And eventually being able to look like this:
tikz-pgf backgrounds
add a comment |Â
up vote
3
down vote
favorite
How can I turn the yellow shaded area into an opaque shaded 1 to demonstrate the idea of an equivalent fraction?
documentclassarticle
usepackagetikz,amsmath,xcolor
begindocument
[ begintikzpicture
node at (0,0) $dfraca cdot cb cdot c=colorblueunderbracecolorblackdfracab cdot colorboxyellow$dfracc
c$colorblack=dfracab$};
draw[->,blue] (.2,-.5)--(.2,-.7)--(1.2,-.7)--(1.2,-.3);
node at (.2,-.7) [below right] scriptsize $colorbluetextSince dfracab cdot 1 =dfracab$;
endtikzpicture ]
enddocument
To look like this :
And eventually being able to look like this:
tikz-pgf backgrounds
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
How can I turn the yellow shaded area into an opaque shaded 1 to demonstrate the idea of an equivalent fraction?
documentclassarticle
usepackagetikz,amsmath,xcolor
begindocument
[ begintikzpicture
node at (0,0) $dfraca cdot cb cdot c=colorblueunderbracecolorblackdfracab cdot colorboxyellow$dfracc
c$colorblack=dfracab$};
draw[->,blue] (.2,-.5)--(.2,-.7)--(1.2,-.7)--(1.2,-.3);
node at (.2,-.7) [below right] scriptsize $colorbluetextSince dfracab cdot 1 =dfracab$;
endtikzpicture ]
enddocument
To look like this :
And eventually being able to look like this:
tikz-pgf backgrounds
How can I turn the yellow shaded area into an opaque shaded 1 to demonstrate the idea of an equivalent fraction?
documentclassarticle
usepackagetikz,amsmath,xcolor
begindocument
[ begintikzpicture
node at (0,0) $dfraca cdot cb cdot c=colorblueunderbracecolorblackdfracab cdot colorboxyellow$dfracc
c$colorblack=dfracab$};
draw[->,blue] (.2,-.5)--(.2,-.7)--(1.2,-.7)--(1.2,-.3);
node at (.2,-.7) [below right] scriptsize $colorbluetextSince dfracab cdot 1 =dfracab$;
endtikzpicture ]
enddocument
To look like this :
And eventually being able to look like this:
tikz-pgf backgrounds
tikz-pgf backgrounds
edited 32 mins ago
asked 3 hours ago
MathScholar
1195
1195
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
With stackengine
.
documentclassarticle
usepackagetikz,amsmath,xcolor,stackengine
begindocument
[ begintikzpicture
node at (0,0) $dfraca cdot cb cdot c=colorblue%
underbracecolorblackdfracab cdot
stackengine0ptmakebox[0pt]raisebox-10ptscalebox10[8]%
colorblue!20sffamilytiny 1$dfraccc$OcFFL%
colorblack=dfracab$;
draw[->,blue] (.2,-.5)--(.2,-.7)--(1.2,-.7)--(1.2,-.3);
node at (.2,-.7) [below right] scriptsize $colorblue%
textSince dfracab cdot 1 =dfracab$;
endtikzpicture ]
enddocument
I guess if you could get rid of the feet on that 1 we have a perfect match. Thanks for your post I am using yours and Marmot's tikzmarknode. Never heard of stackengine
â MathScholar
1 hour ago
@MathScholar I tried to find an appropriate font for the "1", but was not immediately successful. Once the font is done, just put thefontfamily...selectfont
into that argument ofstackengine
.
â Steven B. Segletes
1 hour ago
@MathScholar ctan.org/pkg/stackengine, ctan.org/pkg/tabstackengine
â Steven B. Segletes
1 hour ago
Another concern I have is the "fatness" of '1' for example if c is 100/100 then the 1 is not fat enough. Looks like it is not an easy question. Thank you Steven
â MathScholar
1 hour ago
@MathScholar Thescalebox10[8]...
gives a horizontal scale of 10 and a vertical scale of 8, so some games can be played. However, with enough digits, like 100/100, even that has its limits.
â Steven B. Segletes
55 mins ago
add a comment |Â
up vote
1
down vote
I was confused by the various versions of the question. This made my answer look very complicated. However, this is because the answer (which I kept below) would clip the formula against the contour of 1
or whatever. Now that I see that the accepted answer does not have any of these features, I also provide a stripped down version, which has the big advantage (IMHO) that you do not have to adjust tons of dimensions.
documentclassarticle
usepackagetikz,amsmath,pifont
usetikzlibrarybackgrounds
newcommandPlaceCharOverSomething[3][xscale=11,yscale=5]%
tikz[baseline=(X.base)]
node[opacity=0] (tmpX)#3;
beginscope[on background layer]
clip (tmpX.south west) rectangle (tmpX.north east);
node[overlay,outer sep=0pt,text=blue!,opacity=0.3,#1]
bfseriessffamily #2;
endscope
node [inner sep=0pt](X)#3;%
begindocument
[
dfraca cdot cb cdot c=
textcolorblueunderbracetextcolorblackdfracab cdot
PlaceCharOverSomethingding192$dfraccc$
_tikz[remember picture]coordinate(b);
=tikz[remember picture,baseline=(Y.base)]node (Y) $dfracab$;
]
tikz[remember picture,overlay]draw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
-
enddocument
Now comes a proposal based on this answer and that answer, which allows you to clip a formula against a shape. You may play with xscale
, yscale
etc. If you make the fraction a node, all tikz options are available. BTW, do not use color
, use textcolor
instead. And very soon there will be an upgrade of the tikzmark library available, which will simplify such things quite a bit.
documentclassarticle
usepackagetikz,amsmath,pifont
usetikzlibraryfadings,backgrounds
usepackagecontour
newcommandPlaceCharOverSomething[3][xscale=11,yscale=5]%
renewcommand*sfdefaultugq
begintikzfadingfrompicture[name=temp]
node[transparent!0,#1]
contourblackbfseriessffamilytextcolorwhite#2;
endtikzfadingfrompicture%
tikz[baseline=(X.base)]
node[opacity=0] (tmpX)#3;
beginscope[on background layer]
clip (tmpX.south west) rectangle (tmpX.north east);
node[overlay,outer sep=0pt,text=blue!,opacity=0.3,#1]
bfseriessffamily #2;
endscope
path[path fading=temp,fit fading=false,overlay,inner sep=0pt] node (X)#3;
path (X.west) -- (X.east);
path (X.north) -- (X.south);%
begindocument
[
dfraca cdot cb cdot c=
textcolorblueunderbracetextcolorblackdfracab cdot
PlaceCharOverSomethingding192$dfraccc$
_tikz[remember picture]coordinate(b);
=tikz[remember picture,baseline=(Y.base)]node (Y) $dfracab$;
]
tikz[remember picture,overlay]draw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
-
enddocument
Note that, because I am using TikZ, there are certain things that come for free.
- I do not have manually adjust any dimensions. In particular, the fraction sits precisely where it would sit without this brimborium. However, if you want, you can make the node wider, e.g. by replacing
path (X.west) -- (X.east);
bypath ([xshift=-1pt]X.west) -- (X.east[xshift=1pt]);
. I consider the fact that I do not have to finetune the dimensions a big advantage. - Similarly, the arrow is fully fixed by the elements of the formula. All the dimensions of
draw[->,blue] (.2,-.5)--(.2,-.7)--(1.2,-.7)--(1.2,-.3);
get redundant, the only thing I specify indraw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
is an
-|(Y);yshift
which makes the arrow start a bit higher up (I actually merely added this to show you how to adjust these things if you really want to) and-0.2
which just says that the arrow needs to go down by0.2cm
before connecting to the fraction on the right. If you add something before the fraction on the right, the arrow will auto-adjust. - This path fading is extremely powerful since it allows you to cut things off that run out of the character. Although not needed here, this is something that may me used in future applications of these tricks.
- Needless to say that, if you decide that the fraction
c/c
should also come with a certain opaqueness or color, this would only require a simple switch.
I have been using tikzmarknode more frequently now. How can I make that area( node ) you posted a 1 instead of an opaque yellow rectangle. What you posted is much cleaner for sure. This is the heart of my question.
â MathScholar
2 hours ago
@MathScholar I do not understand your question. If you want a 1 instead of an opaque rectangle with a fraction in it, replacetikz[baseline=(X.base)]node[fill=yellow,opacity=0.5](X)$dfraccc$;
by1
. And yes,tikzmarknode
will make this easier. Note, however, the opaque stuff does not really get referenced later here, so for this thingy you do not need atikzmarknode
, but for the other two thingiestikzmark
andtikzmarknode
will be more elegant.
â marmot
2 hours ago
How can I make that opaque area have the shape of a 1, the number one, while leaving the $dfraccc$ as is ? I am not sure how to post an image in the comment section.
â MathScholar
2 hours ago
I added an image of what I am trying to replicate. Thanks for your efforts
â MathScholar
2 hours ago
I noticed that the character 1 is pushing out the product while compiling your solution.
â MathScholar
1 hour ago
 |Â
show 2 more comments
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
With stackengine
.
documentclassarticle
usepackagetikz,amsmath,xcolor,stackengine
begindocument
[ begintikzpicture
node at (0,0) $dfraca cdot cb cdot c=colorblue%
underbracecolorblackdfracab cdot
stackengine0ptmakebox[0pt]raisebox-10ptscalebox10[8]%
colorblue!20sffamilytiny 1$dfraccc$OcFFL%
colorblack=dfracab$;
draw[->,blue] (.2,-.5)--(.2,-.7)--(1.2,-.7)--(1.2,-.3);
node at (.2,-.7) [below right] scriptsize $colorblue%
textSince dfracab cdot 1 =dfracab$;
endtikzpicture ]
enddocument
I guess if you could get rid of the feet on that 1 we have a perfect match. Thanks for your post I am using yours and Marmot's tikzmarknode. Never heard of stackengine
â MathScholar
1 hour ago
@MathScholar I tried to find an appropriate font for the "1", but was not immediately successful. Once the font is done, just put thefontfamily...selectfont
into that argument ofstackengine
.
â Steven B. Segletes
1 hour ago
@MathScholar ctan.org/pkg/stackengine, ctan.org/pkg/tabstackengine
â Steven B. Segletes
1 hour ago
Another concern I have is the "fatness" of '1' for example if c is 100/100 then the 1 is not fat enough. Looks like it is not an easy question. Thank you Steven
â MathScholar
1 hour ago
@MathScholar Thescalebox10[8]...
gives a horizontal scale of 10 and a vertical scale of 8, so some games can be played. However, with enough digits, like 100/100, even that has its limits.
â Steven B. Segletes
55 mins ago
add a comment |Â
up vote
2
down vote
accepted
With stackengine
.
documentclassarticle
usepackagetikz,amsmath,xcolor,stackengine
begindocument
[ begintikzpicture
node at (0,0) $dfraca cdot cb cdot c=colorblue%
underbracecolorblackdfracab cdot
stackengine0ptmakebox[0pt]raisebox-10ptscalebox10[8]%
colorblue!20sffamilytiny 1$dfraccc$OcFFL%
colorblack=dfracab$;
draw[->,blue] (.2,-.5)--(.2,-.7)--(1.2,-.7)--(1.2,-.3);
node at (.2,-.7) [below right] scriptsize $colorblue%
textSince dfracab cdot 1 =dfracab$;
endtikzpicture ]
enddocument
I guess if you could get rid of the feet on that 1 we have a perfect match. Thanks for your post I am using yours and Marmot's tikzmarknode. Never heard of stackengine
â MathScholar
1 hour ago
@MathScholar I tried to find an appropriate font for the "1", but was not immediately successful. Once the font is done, just put thefontfamily...selectfont
into that argument ofstackengine
.
â Steven B. Segletes
1 hour ago
@MathScholar ctan.org/pkg/stackengine, ctan.org/pkg/tabstackengine
â Steven B. Segletes
1 hour ago
Another concern I have is the "fatness" of '1' for example if c is 100/100 then the 1 is not fat enough. Looks like it is not an easy question. Thank you Steven
â MathScholar
1 hour ago
@MathScholar Thescalebox10[8]...
gives a horizontal scale of 10 and a vertical scale of 8, so some games can be played. However, with enough digits, like 100/100, even that has its limits.
â Steven B. Segletes
55 mins ago
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
With stackengine
.
documentclassarticle
usepackagetikz,amsmath,xcolor,stackengine
begindocument
[ begintikzpicture
node at (0,0) $dfraca cdot cb cdot c=colorblue%
underbracecolorblackdfracab cdot
stackengine0ptmakebox[0pt]raisebox-10ptscalebox10[8]%
colorblue!20sffamilytiny 1$dfraccc$OcFFL%
colorblack=dfracab$;
draw[->,blue] (.2,-.5)--(.2,-.7)--(1.2,-.7)--(1.2,-.3);
node at (.2,-.7) [below right] scriptsize $colorblue%
textSince dfracab cdot 1 =dfracab$;
endtikzpicture ]
enddocument
With stackengine
.
documentclassarticle
usepackagetikz,amsmath,xcolor,stackengine
begindocument
[ begintikzpicture
node at (0,0) $dfraca cdot cb cdot c=colorblue%
underbracecolorblackdfracab cdot
stackengine0ptmakebox[0pt]raisebox-10ptscalebox10[8]%
colorblue!20sffamilytiny 1$dfraccc$OcFFL%
colorblack=dfracab$;
draw[->,blue] (.2,-.5)--(.2,-.7)--(1.2,-.7)--(1.2,-.3);
node at (.2,-.7) [below right] scriptsize $colorblue%
textSince dfracab cdot 1 =dfracab$;
endtikzpicture ]
enddocument
answered 2 hours ago
Steven B. Segletes
148k9186390
148k9186390
I guess if you could get rid of the feet on that 1 we have a perfect match. Thanks for your post I am using yours and Marmot's tikzmarknode. Never heard of stackengine
â MathScholar
1 hour ago
@MathScholar I tried to find an appropriate font for the "1", but was not immediately successful. Once the font is done, just put thefontfamily...selectfont
into that argument ofstackengine
.
â Steven B. Segletes
1 hour ago
@MathScholar ctan.org/pkg/stackengine, ctan.org/pkg/tabstackengine
â Steven B. Segletes
1 hour ago
Another concern I have is the "fatness" of '1' for example if c is 100/100 then the 1 is not fat enough. Looks like it is not an easy question. Thank you Steven
â MathScholar
1 hour ago
@MathScholar Thescalebox10[8]...
gives a horizontal scale of 10 and a vertical scale of 8, so some games can be played. However, with enough digits, like 100/100, even that has its limits.
â Steven B. Segletes
55 mins ago
add a comment |Â
I guess if you could get rid of the feet on that 1 we have a perfect match. Thanks for your post I am using yours and Marmot's tikzmarknode. Never heard of stackengine
â MathScholar
1 hour ago
@MathScholar I tried to find an appropriate font for the "1", but was not immediately successful. Once the font is done, just put thefontfamily...selectfont
into that argument ofstackengine
.
â Steven B. Segletes
1 hour ago
@MathScholar ctan.org/pkg/stackengine, ctan.org/pkg/tabstackengine
â Steven B. Segletes
1 hour ago
Another concern I have is the "fatness" of '1' for example if c is 100/100 then the 1 is not fat enough. Looks like it is not an easy question. Thank you Steven
â MathScholar
1 hour ago
@MathScholar Thescalebox10[8]...
gives a horizontal scale of 10 and a vertical scale of 8, so some games can be played. However, with enough digits, like 100/100, even that has its limits.
â Steven B. Segletes
55 mins ago
I guess if you could get rid of the feet on that 1 we have a perfect match. Thanks for your post I am using yours and Marmot's tikzmarknode. Never heard of stackengine
â MathScholar
1 hour ago
I guess if you could get rid of the feet on that 1 we have a perfect match. Thanks for your post I am using yours and Marmot's tikzmarknode. Never heard of stackengine
â MathScholar
1 hour ago
@MathScholar I tried to find an appropriate font for the "1", but was not immediately successful. Once the font is done, just put the
fontfamily...selectfont
into that argument of stackengine
.â Steven B. Segletes
1 hour ago
@MathScholar I tried to find an appropriate font for the "1", but was not immediately successful. Once the font is done, just put the
fontfamily...selectfont
into that argument of stackengine
.â Steven B. Segletes
1 hour ago
@MathScholar ctan.org/pkg/stackengine, ctan.org/pkg/tabstackengine
â Steven B. Segletes
1 hour ago
@MathScholar ctan.org/pkg/stackengine, ctan.org/pkg/tabstackengine
â Steven B. Segletes
1 hour ago
Another concern I have is the "fatness" of '1' for example if c is 100/100 then the 1 is not fat enough. Looks like it is not an easy question. Thank you Steven
â MathScholar
1 hour ago
Another concern I have is the "fatness" of '1' for example if c is 100/100 then the 1 is not fat enough. Looks like it is not an easy question. Thank you Steven
â MathScholar
1 hour ago
@MathScholar The
scalebox10[8]...
gives a horizontal scale of 10 and a vertical scale of 8, so some games can be played. However, with enough digits, like 100/100, even that has its limits.â Steven B. Segletes
55 mins ago
@MathScholar The
scalebox10[8]...
gives a horizontal scale of 10 and a vertical scale of 8, so some games can be played. However, with enough digits, like 100/100, even that has its limits.â Steven B. Segletes
55 mins ago
add a comment |Â
up vote
1
down vote
I was confused by the various versions of the question. This made my answer look very complicated. However, this is because the answer (which I kept below) would clip the formula against the contour of 1
or whatever. Now that I see that the accepted answer does not have any of these features, I also provide a stripped down version, which has the big advantage (IMHO) that you do not have to adjust tons of dimensions.
documentclassarticle
usepackagetikz,amsmath,pifont
usetikzlibrarybackgrounds
newcommandPlaceCharOverSomething[3][xscale=11,yscale=5]%
tikz[baseline=(X.base)]
node[opacity=0] (tmpX)#3;
beginscope[on background layer]
clip (tmpX.south west) rectangle (tmpX.north east);
node[overlay,outer sep=0pt,text=blue!,opacity=0.3,#1]
bfseriessffamily #2;
endscope
node [inner sep=0pt](X)#3;%
begindocument
[
dfraca cdot cb cdot c=
textcolorblueunderbracetextcolorblackdfracab cdot
PlaceCharOverSomethingding192$dfraccc$
_tikz[remember picture]coordinate(b);
=tikz[remember picture,baseline=(Y.base)]node (Y) $dfracab$;
]
tikz[remember picture,overlay]draw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
-
enddocument
Now comes a proposal based on this answer and that answer, which allows you to clip a formula against a shape. You may play with xscale
, yscale
etc. If you make the fraction a node, all tikz options are available. BTW, do not use color
, use textcolor
instead. And very soon there will be an upgrade of the tikzmark library available, which will simplify such things quite a bit.
documentclassarticle
usepackagetikz,amsmath,pifont
usetikzlibraryfadings,backgrounds
usepackagecontour
newcommandPlaceCharOverSomething[3][xscale=11,yscale=5]%
renewcommand*sfdefaultugq
begintikzfadingfrompicture[name=temp]
node[transparent!0,#1]
contourblackbfseriessffamilytextcolorwhite#2;
endtikzfadingfrompicture%
tikz[baseline=(X.base)]
node[opacity=0] (tmpX)#3;
beginscope[on background layer]
clip (tmpX.south west) rectangle (tmpX.north east);
node[overlay,outer sep=0pt,text=blue!,opacity=0.3,#1]
bfseriessffamily #2;
endscope
path[path fading=temp,fit fading=false,overlay,inner sep=0pt] node (X)#3;
path (X.west) -- (X.east);
path (X.north) -- (X.south);%
begindocument
[
dfraca cdot cb cdot c=
textcolorblueunderbracetextcolorblackdfracab cdot
PlaceCharOverSomethingding192$dfraccc$
_tikz[remember picture]coordinate(b);
=tikz[remember picture,baseline=(Y.base)]node (Y) $dfracab$;
]
tikz[remember picture,overlay]draw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
-
enddocument
Note that, because I am using TikZ, there are certain things that come for free.
- I do not have manually adjust any dimensions. In particular, the fraction sits precisely where it would sit without this brimborium. However, if you want, you can make the node wider, e.g. by replacing
path (X.west) -- (X.east);
bypath ([xshift=-1pt]X.west) -- (X.east[xshift=1pt]);
. I consider the fact that I do not have to finetune the dimensions a big advantage. - Similarly, the arrow is fully fixed by the elements of the formula. All the dimensions of
draw[->,blue] (.2,-.5)--(.2,-.7)--(1.2,-.7)--(1.2,-.3);
get redundant, the only thing I specify indraw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
is an
-|(Y);yshift
which makes the arrow start a bit higher up (I actually merely added this to show you how to adjust these things if you really want to) and-0.2
which just says that the arrow needs to go down by0.2cm
before connecting to the fraction on the right. If you add something before the fraction on the right, the arrow will auto-adjust. - This path fading is extremely powerful since it allows you to cut things off that run out of the character. Although not needed here, this is something that may me used in future applications of these tricks.
- Needless to say that, if you decide that the fraction
c/c
should also come with a certain opaqueness or color, this would only require a simple switch.
I have been using tikzmarknode more frequently now. How can I make that area( node ) you posted a 1 instead of an opaque yellow rectangle. What you posted is much cleaner for sure. This is the heart of my question.
â MathScholar
2 hours ago
@MathScholar I do not understand your question. If you want a 1 instead of an opaque rectangle with a fraction in it, replacetikz[baseline=(X.base)]node[fill=yellow,opacity=0.5](X)$dfraccc$;
by1
. And yes,tikzmarknode
will make this easier. Note, however, the opaque stuff does not really get referenced later here, so for this thingy you do not need atikzmarknode
, but for the other two thingiestikzmark
andtikzmarknode
will be more elegant.
â marmot
2 hours ago
How can I make that opaque area have the shape of a 1, the number one, while leaving the $dfraccc$ as is ? I am not sure how to post an image in the comment section.
â MathScholar
2 hours ago
I added an image of what I am trying to replicate. Thanks for your efforts
â MathScholar
2 hours ago
I noticed that the character 1 is pushing out the product while compiling your solution.
â MathScholar
1 hour ago
 |Â
show 2 more comments
up vote
1
down vote
I was confused by the various versions of the question. This made my answer look very complicated. However, this is because the answer (which I kept below) would clip the formula against the contour of 1
or whatever. Now that I see that the accepted answer does not have any of these features, I also provide a stripped down version, which has the big advantage (IMHO) that you do not have to adjust tons of dimensions.
documentclassarticle
usepackagetikz,amsmath,pifont
usetikzlibrarybackgrounds
newcommandPlaceCharOverSomething[3][xscale=11,yscale=5]%
tikz[baseline=(X.base)]
node[opacity=0] (tmpX)#3;
beginscope[on background layer]
clip (tmpX.south west) rectangle (tmpX.north east);
node[overlay,outer sep=0pt,text=blue!,opacity=0.3,#1]
bfseriessffamily #2;
endscope
node [inner sep=0pt](X)#3;%
begindocument
[
dfraca cdot cb cdot c=
textcolorblueunderbracetextcolorblackdfracab cdot
PlaceCharOverSomethingding192$dfraccc$
_tikz[remember picture]coordinate(b);
=tikz[remember picture,baseline=(Y.base)]node (Y) $dfracab$;
]
tikz[remember picture,overlay]draw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
-
enddocument
Now comes a proposal based on this answer and that answer, which allows you to clip a formula against a shape. You may play with xscale
, yscale
etc. If you make the fraction a node, all tikz options are available. BTW, do not use color
, use textcolor
instead. And very soon there will be an upgrade of the tikzmark library available, which will simplify such things quite a bit.
documentclassarticle
usepackagetikz,amsmath,pifont
usetikzlibraryfadings,backgrounds
usepackagecontour
newcommandPlaceCharOverSomething[3][xscale=11,yscale=5]%
renewcommand*sfdefaultugq
begintikzfadingfrompicture[name=temp]
node[transparent!0,#1]
contourblackbfseriessffamilytextcolorwhite#2;
endtikzfadingfrompicture%
tikz[baseline=(X.base)]
node[opacity=0] (tmpX)#3;
beginscope[on background layer]
clip (tmpX.south west) rectangle (tmpX.north east);
node[overlay,outer sep=0pt,text=blue!,opacity=0.3,#1]
bfseriessffamily #2;
endscope
path[path fading=temp,fit fading=false,overlay,inner sep=0pt] node (X)#3;
path (X.west) -- (X.east);
path (X.north) -- (X.south);%
begindocument
[
dfraca cdot cb cdot c=
textcolorblueunderbracetextcolorblackdfracab cdot
PlaceCharOverSomethingding192$dfraccc$
_tikz[remember picture]coordinate(b);
=tikz[remember picture,baseline=(Y.base)]node (Y) $dfracab$;
]
tikz[remember picture,overlay]draw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
-
enddocument
Note that, because I am using TikZ, there are certain things that come for free.
- I do not have manually adjust any dimensions. In particular, the fraction sits precisely where it would sit without this brimborium. However, if you want, you can make the node wider, e.g. by replacing
path (X.west) -- (X.east);
bypath ([xshift=-1pt]X.west) -- (X.east[xshift=1pt]);
. I consider the fact that I do not have to finetune the dimensions a big advantage. - Similarly, the arrow is fully fixed by the elements of the formula. All the dimensions of
draw[->,blue] (.2,-.5)--(.2,-.7)--(1.2,-.7)--(1.2,-.3);
get redundant, the only thing I specify indraw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
is an
-|(Y);yshift
which makes the arrow start a bit higher up (I actually merely added this to show you how to adjust these things if you really want to) and-0.2
which just says that the arrow needs to go down by0.2cm
before connecting to the fraction on the right. If you add something before the fraction on the right, the arrow will auto-adjust. - This path fading is extremely powerful since it allows you to cut things off that run out of the character. Although not needed here, this is something that may me used in future applications of these tricks.
- Needless to say that, if you decide that the fraction
c/c
should also come with a certain opaqueness or color, this would only require a simple switch.
I have been using tikzmarknode more frequently now. How can I make that area( node ) you posted a 1 instead of an opaque yellow rectangle. What you posted is much cleaner for sure. This is the heart of my question.
â MathScholar
2 hours ago
@MathScholar I do not understand your question. If you want a 1 instead of an opaque rectangle with a fraction in it, replacetikz[baseline=(X.base)]node[fill=yellow,opacity=0.5](X)$dfraccc$;
by1
. And yes,tikzmarknode
will make this easier. Note, however, the opaque stuff does not really get referenced later here, so for this thingy you do not need atikzmarknode
, but for the other two thingiestikzmark
andtikzmarknode
will be more elegant.
â marmot
2 hours ago
How can I make that opaque area have the shape of a 1, the number one, while leaving the $dfraccc$ as is ? I am not sure how to post an image in the comment section.
â MathScholar
2 hours ago
I added an image of what I am trying to replicate. Thanks for your efforts
â MathScholar
2 hours ago
I noticed that the character 1 is pushing out the product while compiling your solution.
â MathScholar
1 hour ago
 |Â
show 2 more comments
up vote
1
down vote
up vote
1
down vote
I was confused by the various versions of the question. This made my answer look very complicated. However, this is because the answer (which I kept below) would clip the formula against the contour of 1
or whatever. Now that I see that the accepted answer does not have any of these features, I also provide a stripped down version, which has the big advantage (IMHO) that you do not have to adjust tons of dimensions.
documentclassarticle
usepackagetikz,amsmath,pifont
usetikzlibrarybackgrounds
newcommandPlaceCharOverSomething[3][xscale=11,yscale=5]%
tikz[baseline=(X.base)]
node[opacity=0] (tmpX)#3;
beginscope[on background layer]
clip (tmpX.south west) rectangle (tmpX.north east);
node[overlay,outer sep=0pt,text=blue!,opacity=0.3,#1]
bfseriessffamily #2;
endscope
node [inner sep=0pt](X)#3;%
begindocument
[
dfraca cdot cb cdot c=
textcolorblueunderbracetextcolorblackdfracab cdot
PlaceCharOverSomethingding192$dfraccc$
_tikz[remember picture]coordinate(b);
=tikz[remember picture,baseline=(Y.base)]node (Y) $dfracab$;
]
tikz[remember picture,overlay]draw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
-
enddocument
Now comes a proposal based on this answer and that answer, which allows you to clip a formula against a shape. You may play with xscale
, yscale
etc. If you make the fraction a node, all tikz options are available. BTW, do not use color
, use textcolor
instead. And very soon there will be an upgrade of the tikzmark library available, which will simplify such things quite a bit.
documentclassarticle
usepackagetikz,amsmath,pifont
usetikzlibraryfadings,backgrounds
usepackagecontour
newcommandPlaceCharOverSomething[3][xscale=11,yscale=5]%
renewcommand*sfdefaultugq
begintikzfadingfrompicture[name=temp]
node[transparent!0,#1]
contourblackbfseriessffamilytextcolorwhite#2;
endtikzfadingfrompicture%
tikz[baseline=(X.base)]
node[opacity=0] (tmpX)#3;
beginscope[on background layer]
clip (tmpX.south west) rectangle (tmpX.north east);
node[overlay,outer sep=0pt,text=blue!,opacity=0.3,#1]
bfseriessffamily #2;
endscope
path[path fading=temp,fit fading=false,overlay,inner sep=0pt] node (X)#3;
path (X.west) -- (X.east);
path (X.north) -- (X.south);%
begindocument
[
dfraca cdot cb cdot c=
textcolorblueunderbracetextcolorblackdfracab cdot
PlaceCharOverSomethingding192$dfraccc$
_tikz[remember picture]coordinate(b);
=tikz[remember picture,baseline=(Y.base)]node (Y) $dfracab$;
]
tikz[remember picture,overlay]draw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
-
enddocument
Note that, because I am using TikZ, there are certain things that come for free.
- I do not have manually adjust any dimensions. In particular, the fraction sits precisely where it would sit without this brimborium. However, if you want, you can make the node wider, e.g. by replacing
path (X.west) -- (X.east);
bypath ([xshift=-1pt]X.west) -- (X.east[xshift=1pt]);
. I consider the fact that I do not have to finetune the dimensions a big advantage. - Similarly, the arrow is fully fixed by the elements of the formula. All the dimensions of
draw[->,blue] (.2,-.5)--(.2,-.7)--(1.2,-.7)--(1.2,-.3);
get redundant, the only thing I specify indraw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
is an
-|(Y);yshift
which makes the arrow start a bit higher up (I actually merely added this to show you how to adjust these things if you really want to) and-0.2
which just says that the arrow needs to go down by0.2cm
before connecting to the fraction on the right. If you add something before the fraction on the right, the arrow will auto-adjust. - This path fading is extremely powerful since it allows you to cut things off that run out of the character. Although not needed here, this is something that may me used in future applications of these tricks.
- Needless to say that, if you decide that the fraction
c/c
should also come with a certain opaqueness or color, this would only require a simple switch.
I was confused by the various versions of the question. This made my answer look very complicated. However, this is because the answer (which I kept below) would clip the formula against the contour of 1
or whatever. Now that I see that the accepted answer does not have any of these features, I also provide a stripped down version, which has the big advantage (IMHO) that you do not have to adjust tons of dimensions.
documentclassarticle
usepackagetikz,amsmath,pifont
usetikzlibrarybackgrounds
newcommandPlaceCharOverSomething[3][xscale=11,yscale=5]%
tikz[baseline=(X.base)]
node[opacity=0] (tmpX)#3;
beginscope[on background layer]
clip (tmpX.south west) rectangle (tmpX.north east);
node[overlay,outer sep=0pt,text=blue!,opacity=0.3,#1]
bfseriessffamily #2;
endscope
node [inner sep=0pt](X)#3;%
begindocument
[
dfraca cdot cb cdot c=
textcolorblueunderbracetextcolorblackdfracab cdot
PlaceCharOverSomethingding192$dfraccc$
_tikz[remember picture]coordinate(b);
=tikz[remember picture,baseline=(Y.base)]node (Y) $dfracab$;
]
tikz[remember picture,overlay]draw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
-
enddocument
Now comes a proposal based on this answer and that answer, which allows you to clip a formula against a shape. You may play with xscale
, yscale
etc. If you make the fraction a node, all tikz options are available. BTW, do not use color
, use textcolor
instead. And very soon there will be an upgrade of the tikzmark library available, which will simplify such things quite a bit.
documentclassarticle
usepackagetikz,amsmath,pifont
usetikzlibraryfadings,backgrounds
usepackagecontour
newcommandPlaceCharOverSomething[3][xscale=11,yscale=5]%
renewcommand*sfdefaultugq
begintikzfadingfrompicture[name=temp]
node[transparent!0,#1]
contourblackbfseriessffamilytextcolorwhite#2;
endtikzfadingfrompicture%
tikz[baseline=(X.base)]
node[opacity=0] (tmpX)#3;
beginscope[on background layer]
clip (tmpX.south west) rectangle (tmpX.north east);
node[overlay,outer sep=0pt,text=blue!,opacity=0.3,#1]
bfseriessffamily #2;
endscope
path[path fading=temp,fit fading=false,overlay,inner sep=0pt] node (X)#3;
path (X.west) -- (X.east);
path (X.north) -- (X.south);%
begindocument
[
dfraca cdot cb cdot c=
textcolorblueunderbracetextcolorblackdfracab cdot
PlaceCharOverSomethingding192$dfraccc$
_tikz[remember picture]coordinate(b);
=tikz[remember picture,baseline=(Y.base)]node (Y) $dfracab$;
]
tikz[remember picture,overlay]draw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
-
enddocument
Note that, because I am using TikZ, there are certain things that come for free.
- I do not have manually adjust any dimensions. In particular, the fraction sits precisely where it would sit without this brimborium. However, if you want, you can make the node wider, e.g. by replacing
path (X.west) -- (X.east);
bypath ([xshift=-1pt]X.west) -- (X.east[xshift=1pt]);
. I consider the fact that I do not have to finetune the dimensions a big advantage. - Similarly, the arrow is fully fixed by the elements of the formula. All the dimensions of
draw[->,blue] (.2,-.5)--(.2,-.7)--(1.2,-.7)--(1.2,-.3);
get redundant, the only thing I specify indraw[->,blue] ([yshift=1mm]b)--++(0,-0.2)
is an
-|(Y);yshift
which makes the arrow start a bit higher up (I actually merely added this to show you how to adjust these things if you really want to) and-0.2
which just says that the arrow needs to go down by0.2cm
before connecting to the fraction on the right. If you add something before the fraction on the right, the arrow will auto-adjust. - This path fading is extremely powerful since it allows you to cut things off that run out of the character. Although not needed here, this is something that may me used in future applications of these tricks.
- Needless to say that, if you decide that the fraction
c/c
should also come with a certain opaqueness or color, this would only require a simple switch.
edited 3 mins ago
answered 2 hours ago
marmot
61.8k466134
61.8k466134
I have been using tikzmarknode more frequently now. How can I make that area( node ) you posted a 1 instead of an opaque yellow rectangle. What you posted is much cleaner for sure. This is the heart of my question.
â MathScholar
2 hours ago
@MathScholar I do not understand your question. If you want a 1 instead of an opaque rectangle with a fraction in it, replacetikz[baseline=(X.base)]node[fill=yellow,opacity=0.5](X)$dfraccc$;
by1
. And yes,tikzmarknode
will make this easier. Note, however, the opaque stuff does not really get referenced later here, so for this thingy you do not need atikzmarknode
, but for the other two thingiestikzmark
andtikzmarknode
will be more elegant.
â marmot
2 hours ago
How can I make that opaque area have the shape of a 1, the number one, while leaving the $dfraccc$ as is ? I am not sure how to post an image in the comment section.
â MathScholar
2 hours ago
I added an image of what I am trying to replicate. Thanks for your efforts
â MathScholar
2 hours ago
I noticed that the character 1 is pushing out the product while compiling your solution.
â MathScholar
1 hour ago
 |Â
show 2 more comments
I have been using tikzmarknode more frequently now. How can I make that area( node ) you posted a 1 instead of an opaque yellow rectangle. What you posted is much cleaner for sure. This is the heart of my question.
â MathScholar
2 hours ago
@MathScholar I do not understand your question. If you want a 1 instead of an opaque rectangle with a fraction in it, replacetikz[baseline=(X.base)]node[fill=yellow,opacity=0.5](X)$dfraccc$;
by1
. And yes,tikzmarknode
will make this easier. Note, however, the opaque stuff does not really get referenced later here, so for this thingy you do not need atikzmarknode
, but for the other two thingiestikzmark
andtikzmarknode
will be more elegant.
â marmot
2 hours ago
How can I make that opaque area have the shape of a 1, the number one, while leaving the $dfraccc$ as is ? I am not sure how to post an image in the comment section.
â MathScholar
2 hours ago
I added an image of what I am trying to replicate. Thanks for your efforts
â MathScholar
2 hours ago
I noticed that the character 1 is pushing out the product while compiling your solution.
â MathScholar
1 hour ago
I have been using tikzmarknode more frequently now. How can I make that area( node ) you posted a 1 instead of an opaque yellow rectangle. What you posted is much cleaner for sure. This is the heart of my question.
â MathScholar
2 hours ago
I have been using tikzmarknode more frequently now. How can I make that area( node ) you posted a 1 instead of an opaque yellow rectangle. What you posted is much cleaner for sure. This is the heart of my question.
â MathScholar
2 hours ago
@MathScholar I do not understand your question. If you want a 1 instead of an opaque rectangle with a fraction in it, replace
tikz[baseline=(X.base)]node[fill=yellow,opacity=0.5](X)$dfraccc$;
by 1
. And yes, tikzmarknode
will make this easier. Note, however, the opaque stuff does not really get referenced later here, so for this thingy you do not need a tikzmarknode
, but for the other two thingies tikzmark
and tikzmarknode
will be more elegant.â marmot
2 hours ago
@MathScholar I do not understand your question. If you want a 1 instead of an opaque rectangle with a fraction in it, replace
tikz[baseline=(X.base)]node[fill=yellow,opacity=0.5](X)$dfraccc$;
by 1
. And yes, tikzmarknode
will make this easier. Note, however, the opaque stuff does not really get referenced later here, so for this thingy you do not need a tikzmarknode
, but for the other two thingies tikzmark
and tikzmarknode
will be more elegant.â marmot
2 hours ago
How can I make that opaque area have the shape of a 1, the number one, while leaving the $dfraccc$ as is ? I am not sure how to post an image in the comment section.
â MathScholar
2 hours ago
How can I make that opaque area have the shape of a 1, the number one, while leaving the $dfraccc$ as is ? I am not sure how to post an image in the comment section.
â MathScholar
2 hours ago
I added an image of what I am trying to replicate. Thanks for your efforts
â MathScholar
2 hours ago
I added an image of what I am trying to replicate. Thanks for your efforts
â MathScholar
2 hours ago
I noticed that the character 1 is pushing out the product while compiling your solution.
â MathScholar
1 hour ago
I noticed that the character 1 is pushing out the product while compiling your solution.
â MathScholar
1 hour ago
 |Â
show 2 more comments
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%2f453385%2ffractions-and-equivalent-fractions%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