Additional Symbols Tikzmark and Braces
up vote
3
down vote
favorite
I am wondering if it is possible to add the extra symbols in this example given the way I have written the code. I have provided a minimal example and another image with the additional symbols of + and times.
documentclass{article}
usepackage{tikz,mathtools}
usetikzlibrary{tikzmark}
usetikzlibrary{decorations.pathreplacing}
%%% Derivative Macro
newcommand{der}[2]{dfrac{d#1}{d#2}}
%%% Derivative Prime Notation
newcommand{pder}[2]{#1^{prime}(#2)}
begin{document}
begin{align*}
der{}{x} [tikzmarknode{A}{(}2x^{5}+x-1tikzmarknode{B}{)}tikzmarknode{C}
{(}3x-2tikzmarknode{D}{)}]&=tikzmarknode{E}{(}2x^{5}+x-1tikzmarknode{F}
{)}tikzmarknode[red]{G}{(}textcolor{red}{3}tikzmarknode[red]{H}
{)}+tikzmarknode{I}{(}3x-2tikzmarknode{J}{)}tikzmarknode[red]{K}
{(}textcolor{red}{10x^{4}+1}tikzmarknode[red]{L}{)}
end{align*}
begin{tikzpicture}[overlay, remember picture]
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]A.north) -- node[midway, above=3pt] {$f(x)$}
([yshift=5pt]B.north);
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]C.north) -- node[midway, above=3pt] {$g(x)$}
([yshift=5pt]D.north);
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]E.north) -- node[midway, above=3pt] {$f(x)$}
([yshift=5pt]F.north);
draw [decoration={brace},decorate,thick,red]
([yshift=5pt]G.north) -- node[midway, above=3pt] {$pder{g}{x}$}
([yshift=5pt]H.north);
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]I.north) -- node[midway, above=3pt] {$g(x)$}
([yshift=5pt]J.north);
draw [decoration={brace},decorate,thick,red]
([yshift=5pt]K.north) -- node[midway, above=3pt] {$pder{f}{x}$}
([yshift=5pt]L.north);
end{tikzpicture}
end{document}
This outputs:
With the above braces I am trying add some additional operations: + and cdot
g'(x) is a little smaller in the code example but if I can add the symbols and I can also add space to compensate later. Is it possible???
tikzmark
add a comment |
up vote
3
down vote
favorite
I am wondering if it is possible to add the extra symbols in this example given the way I have written the code. I have provided a minimal example and another image with the additional symbols of + and times.
documentclass{article}
usepackage{tikz,mathtools}
usetikzlibrary{tikzmark}
usetikzlibrary{decorations.pathreplacing}
%%% Derivative Macro
newcommand{der}[2]{dfrac{d#1}{d#2}}
%%% Derivative Prime Notation
newcommand{pder}[2]{#1^{prime}(#2)}
begin{document}
begin{align*}
der{}{x} [tikzmarknode{A}{(}2x^{5}+x-1tikzmarknode{B}{)}tikzmarknode{C}
{(}3x-2tikzmarknode{D}{)}]&=tikzmarknode{E}{(}2x^{5}+x-1tikzmarknode{F}
{)}tikzmarknode[red]{G}{(}textcolor{red}{3}tikzmarknode[red]{H}
{)}+tikzmarknode{I}{(}3x-2tikzmarknode{J}{)}tikzmarknode[red]{K}
{(}textcolor{red}{10x^{4}+1}tikzmarknode[red]{L}{)}
end{align*}
begin{tikzpicture}[overlay, remember picture]
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]A.north) -- node[midway, above=3pt] {$f(x)$}
([yshift=5pt]B.north);
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]C.north) -- node[midway, above=3pt] {$g(x)$}
([yshift=5pt]D.north);
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]E.north) -- node[midway, above=3pt] {$f(x)$}
([yshift=5pt]F.north);
draw [decoration={brace},decorate,thick,red]
([yshift=5pt]G.north) -- node[midway, above=3pt] {$pder{g}{x}$}
([yshift=5pt]H.north);
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]I.north) -- node[midway, above=3pt] {$g(x)$}
([yshift=5pt]J.north);
draw [decoration={brace},decorate,thick,red]
([yshift=5pt]K.north) -- node[midway, above=3pt] {$pder{f}{x}$}
([yshift=5pt]L.north);
end{tikzpicture}
end{document}
This outputs:
With the above braces I am trying add some additional operations: + and cdot
g'(x) is a little smaller in the code example but if I can add the symbols and I can also add space to compensate later. Is it possible???
tikzmark
Do you really need a hammersledge like tikz for this?
– Bernard
3 hours ago
1
@Bernhard, it is the way I have been trained but I am interested in a "way" out if possible?
– MathScholar
3 hours ago
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I am wondering if it is possible to add the extra symbols in this example given the way I have written the code. I have provided a minimal example and another image with the additional symbols of + and times.
documentclass{article}
usepackage{tikz,mathtools}
usetikzlibrary{tikzmark}
usetikzlibrary{decorations.pathreplacing}
%%% Derivative Macro
newcommand{der}[2]{dfrac{d#1}{d#2}}
%%% Derivative Prime Notation
newcommand{pder}[2]{#1^{prime}(#2)}
begin{document}
begin{align*}
der{}{x} [tikzmarknode{A}{(}2x^{5}+x-1tikzmarknode{B}{)}tikzmarknode{C}
{(}3x-2tikzmarknode{D}{)}]&=tikzmarknode{E}{(}2x^{5}+x-1tikzmarknode{F}
{)}tikzmarknode[red]{G}{(}textcolor{red}{3}tikzmarknode[red]{H}
{)}+tikzmarknode{I}{(}3x-2tikzmarknode{J}{)}tikzmarknode[red]{K}
{(}textcolor{red}{10x^{4}+1}tikzmarknode[red]{L}{)}
end{align*}
begin{tikzpicture}[overlay, remember picture]
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]A.north) -- node[midway, above=3pt] {$f(x)$}
([yshift=5pt]B.north);
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]C.north) -- node[midway, above=3pt] {$g(x)$}
([yshift=5pt]D.north);
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]E.north) -- node[midway, above=3pt] {$f(x)$}
([yshift=5pt]F.north);
draw [decoration={brace},decorate,thick,red]
([yshift=5pt]G.north) -- node[midway, above=3pt] {$pder{g}{x}$}
([yshift=5pt]H.north);
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]I.north) -- node[midway, above=3pt] {$g(x)$}
([yshift=5pt]J.north);
draw [decoration={brace},decorate,thick,red]
([yshift=5pt]K.north) -- node[midway, above=3pt] {$pder{f}{x}$}
([yshift=5pt]L.north);
end{tikzpicture}
end{document}
This outputs:
With the above braces I am trying add some additional operations: + and cdot
g'(x) is a little smaller in the code example but if I can add the symbols and I can also add space to compensate later. Is it possible???
tikzmark
I am wondering if it is possible to add the extra symbols in this example given the way I have written the code. I have provided a minimal example and another image with the additional symbols of + and times.
documentclass{article}
usepackage{tikz,mathtools}
usetikzlibrary{tikzmark}
usetikzlibrary{decorations.pathreplacing}
%%% Derivative Macro
newcommand{der}[2]{dfrac{d#1}{d#2}}
%%% Derivative Prime Notation
newcommand{pder}[2]{#1^{prime}(#2)}
begin{document}
begin{align*}
der{}{x} [tikzmarknode{A}{(}2x^{5}+x-1tikzmarknode{B}{)}tikzmarknode{C}
{(}3x-2tikzmarknode{D}{)}]&=tikzmarknode{E}{(}2x^{5}+x-1tikzmarknode{F}
{)}tikzmarknode[red]{G}{(}textcolor{red}{3}tikzmarknode[red]{H}
{)}+tikzmarknode{I}{(}3x-2tikzmarknode{J}{)}tikzmarknode[red]{K}
{(}textcolor{red}{10x^{4}+1}tikzmarknode[red]{L}{)}
end{align*}
begin{tikzpicture}[overlay, remember picture]
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]A.north) -- node[midway, above=3pt] {$f(x)$}
([yshift=5pt]B.north);
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]C.north) -- node[midway, above=3pt] {$g(x)$}
([yshift=5pt]D.north);
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]E.north) -- node[midway, above=3pt] {$f(x)$}
([yshift=5pt]F.north);
draw [decoration={brace},decorate,thick,red]
([yshift=5pt]G.north) -- node[midway, above=3pt] {$pder{g}{x}$}
([yshift=5pt]H.north);
draw [decoration={brace},decorate,thick,blue]
([yshift=5pt]I.north) -- node[midway, above=3pt] {$g(x)$}
([yshift=5pt]J.north);
draw [decoration={brace},decorate,thick,red]
([yshift=5pt]K.north) -- node[midway, above=3pt] {$pder{f}{x}$}
([yshift=5pt]L.north);
end{tikzpicture}
end{document}
This outputs:
With the above braces I am trying add some additional operations: + and cdot
g'(x) is a little smaller in the code example but if I can add the symbols and I can also add space to compensate later. Is it possible???
tikzmark
tikzmark
asked 4 hours ago
MathScholar
5218
5218
Do you really need a hammersledge like tikz for this?
– Bernard
3 hours ago
1
@Bernhard, it is the way I have been trained but I am interested in a "way" out if possible?
– MathScholar
3 hours ago
add a comment |
Do you really need a hammersledge like tikz for this?
– Bernard
3 hours ago
1
@Bernhard, it is the way I have been trained but I am interested in a "way" out if possible?
– MathScholar
3 hours ago
Do you really need a hammersledge like tikz for this?
– Bernard
3 hours ago
Do you really need a hammersledge like tikz for this?
– Bernard
3 hours ago
1
1
@Bernhard, it is the way I have been trained but I am interested in a "way" out if possible?
– MathScholar
3 hours ago
@Bernhard, it is the way I have been trained but I am interested in a "way" out if possible?
– MathScholar
3 hours ago
add a comment |
3 Answers
3
active
oldest
votes
up vote
2
down vote
accepted
I would actually like to argue that it is more ergonomic to define a style that just inserts the brace path with the node on top, and not to have so many scattered tikzmarknode
s. This answer comes with an overbrace
style, that can be used as
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
where A
is the node you want to overbrace, {$f(x)$}
is the node on top and f1
its name. Then it is also much easier to insert the additional signs.
documentclass{article}
usepackage{tikz,mathtools}
usetikzlibrary{tikzmark}
usetikzlibrary{decorations.pathreplacing,calc}
%%% Derivative Macro
newcommand{der}[2]{dfrac{mathrm{d}#1}{mathrm{d}#2}}
%%% Derivative Prime Notation
newcommand{pder}[2]{#1^{prime}(#2)}
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt]#1.north east) }
}}
begin{document}
begin{align*}
der{}{x} [tikzmarknode{A}{(2x^{5}+x-1)}
tikzmarknode{B}{vphantom{x^{5}}(3x-2)}]
&=tikzmarknode{C}{(2x^{5}+x-1)}
tikzmarknode[red]{D}{vphantom{x^{5}}(3H)}
+tikzmarknode{E}{vphantom{x^{5}}(3x-2)}
tikzmarknode[red]{F}{(10x^{4}+1)}
end{align*}
begin{tikzpicture}[overlay, remember picture]
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
draw[blue,thick,overbrace={B with {$g(x)$} called g1}];
draw[blue,thick,overbrace={C with {$f(x)$} called f2}];
draw[red,thick,overbrace={D with {$pder{g}{x}$} called dg1}];
draw[blue,thick,overbrace={E with {$g(x)$} called g2}];
draw[red,thick,overbrace={F with {$pder{f}{x}$} called df1}];
path ($(A.east)!0.5!(B.west)$) coordinate (auxAB)
($(C.east)!0.5!(D.west)$) coordinate (auxCD)
($(D.east)!0.5!(E.west)$) coordinate (auxDE)
($(E.east)!0.5!(F.west)$) coordinate (auxEF);
path (auxAB|-f1) node[blue]{$cdot$}
([xshift=-3pt]auxCD|-f1) node[blue]{$cdot$} %manual correction
(auxDE|-f1) node[blue]{$+$}
(auxEF|-f1) node[blue]{$cdot$};
end{tikzpicture}
end{document}
If you want to layout of the braces, you only need to adjust the style. For instance, if you want gaps between them, you could do
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt,xshift=1pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt,xshift=-1pt]#1.north east) }
}}
which yields
Note also that I put the signs on top of the signs of the underlying equation. If you want them in the middle, this will be even easier.
documentclass{article}
usepackage{tikz,mathtools}
usetikzlibrary{tikzmark}
usetikzlibrary{decorations.pathreplacing}
%%% Derivative Macro
newcommand{der}[2]{dfrac{mathrm{d}#1}{mathrm{d}#2}}
%%% Derivative Prime Notation
newcommand{pder}[2]{#1^{prime}(#2)}
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt,xshift=1pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt,xshift=-1pt]#1.north east) }
}}
begin{document}
begin{align*}
der{}{x} [tikzmarknode{A}{(2x^{5}+x-1)}
tikzmarknode{B}{vphantom{x^{5}}(3x-2)}]
&=tikzmarknode{C}{(2x^{5}+x-1)}
tikzmarknode[red]{D}{vphantom{x^{5}}(3)}
+tikzmarknode{E}{vphantom{x^{5}}(3x-2)}
tikzmarknode[red]{F}{(10x^{4}+1)}
end{align*}
begin{tikzpicture}[overlay, remember picture]
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
draw[blue,thick,overbrace={B with {$g(x)$} called g1}];
draw[blue,thick,overbrace={C with {$f(x)$} called f2}];
draw[red,thick,overbrace={D with {$pder{g}{x}$} called dg1}];
draw[blue,thick,overbrace={E with {$g(x)$} called g2}];
draw[red,thick,overbrace={F with {$pder{f}{x}$} called df1}];
path[blue] (f1) -- (g1) node[midway] {$cdot$}
(f2) -- (dg1) node[midway] {$cdot$}
(dg1) -- (g2) node[midway] {$+$}
(g2) -- (df1) node[midway] {$cdot$};
end{tikzpicture}
end{document}
I guess it is ! I think you did not want the "H" in the post. I would also space the braces so they do not touch each other. I like the style technique which is making me look like a real rookie! :)
– MathScholar
3 hours ago
@MathScholar Sorry about the H. It is gone in the last option (which I was writing when I saw your comment.) The lower two options have gaps.
– marmot
3 hours ago
thank you for this. I will have to play around with this and make things fit for the example in the code. I did not think it was possible! You proved me wrong
– MathScholar
3 hours ago
add a comment |
up vote
1
down vote
Despite being a very powerful tool, tikz can be too costly for some tasks. Here I use overbrace
and a small hack to add the operators while occupying 0pt
width using a makebox[0pt]{..}
macro. Also, as @LoopSpace suggested, we can make the braces at the same height by adding vphantom{x^5}
to parentheses without that term.
documentclass{article}
usepackage{amsmath}
begin{document}
newcommand{hide}[2]{makebox[0pt][l]{$hspace{#1pt}#2$}}
[
frac{d}{dx}[overbrace{(2x^5+x-1)}^{f(x)hide{20}{cdot}} overbrace{(vphantom{x^5}3x-2)}^{g(x)}]
= overbrace{(2x^5+x-1)}^{f(x)hide{15}{cdot}} overbrace{(vphantom{x^5}3)}^{g'(x)hide{2}{+}}
+ overbrace{(vphantom{x^5}3x-2)}^{g(x)hide{10}{cdot}} overbrace{(10x^4+1)}^{f'(x)}
]
end{document}
1
Loath as I am to discourage use oftikzmark
, I think it is really useful to see what can be achieved with simpler stuff. I do think it could do with thevphantom{x^5}
as in marmot's answer to get the braces level.
– Loop Space
3 hours ago
Sure, that improves the look of the equation, I added this, thanks.
– AboAmmar
3 hours ago
add a comment |
up vote
0
down vote
For fun, another simple solution with the overbrace
command and pstricks
:
documentclass{article}
usepackage{mathtools, esdiff}
usepackage{pst-node}
begin{document}
begin{align*}
diff{}{x}bigl[(textcolor{red}{overbrace{strutcolor{black}2x^{5}+x-1}^{Rnode{f}{textstyle f(x)}} textcolor{black}{ )(}overbrace{strutcolor{black}3x-2}^{Rnode{g}{textstyle g(x)}}})bigr] &= (textcolor{blue}{overbrace{color{black}2x^{5}+x-1}^{Rnode{bluef}{textstyle f(x})}})textcolor{red}{overbrace{strut(3)}^{Rnode{dg}{textstyle g'(x)}} }+ (textcolor{blue}{overbrace{strutcolor{black}3x-2}^{Rnode{blueg}{textstyle g(x)}}} )textcolor{red}{(overbrace{10x^{4}+1}^{Rnode{df}{textstyle f'(x )}})}%
%% Additional symbols
psset{linestyle=none}
ncline{f}{g}ncput{boldsymbolcdot}
ncline{bluef}{dg}ncput{boldsymbolcdot}
ncline{blueg}{df}ncput{boldsymbolcdot}
ncline{blueg}{dg}ncput{ + }
end{align*}
end{document}
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
I would actually like to argue that it is more ergonomic to define a style that just inserts the brace path with the node on top, and not to have so many scattered tikzmarknode
s. This answer comes with an overbrace
style, that can be used as
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
where A
is the node you want to overbrace, {$f(x)$}
is the node on top and f1
its name. Then it is also much easier to insert the additional signs.
documentclass{article}
usepackage{tikz,mathtools}
usetikzlibrary{tikzmark}
usetikzlibrary{decorations.pathreplacing,calc}
%%% Derivative Macro
newcommand{der}[2]{dfrac{mathrm{d}#1}{mathrm{d}#2}}
%%% Derivative Prime Notation
newcommand{pder}[2]{#1^{prime}(#2)}
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt]#1.north east) }
}}
begin{document}
begin{align*}
der{}{x} [tikzmarknode{A}{(2x^{5}+x-1)}
tikzmarknode{B}{vphantom{x^{5}}(3x-2)}]
&=tikzmarknode{C}{(2x^{5}+x-1)}
tikzmarknode[red]{D}{vphantom{x^{5}}(3H)}
+tikzmarknode{E}{vphantom{x^{5}}(3x-2)}
tikzmarknode[red]{F}{(10x^{4}+1)}
end{align*}
begin{tikzpicture}[overlay, remember picture]
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
draw[blue,thick,overbrace={B with {$g(x)$} called g1}];
draw[blue,thick,overbrace={C with {$f(x)$} called f2}];
draw[red,thick,overbrace={D with {$pder{g}{x}$} called dg1}];
draw[blue,thick,overbrace={E with {$g(x)$} called g2}];
draw[red,thick,overbrace={F with {$pder{f}{x}$} called df1}];
path ($(A.east)!0.5!(B.west)$) coordinate (auxAB)
($(C.east)!0.5!(D.west)$) coordinate (auxCD)
($(D.east)!0.5!(E.west)$) coordinate (auxDE)
($(E.east)!0.5!(F.west)$) coordinate (auxEF);
path (auxAB|-f1) node[blue]{$cdot$}
([xshift=-3pt]auxCD|-f1) node[blue]{$cdot$} %manual correction
(auxDE|-f1) node[blue]{$+$}
(auxEF|-f1) node[blue]{$cdot$};
end{tikzpicture}
end{document}
If you want to layout of the braces, you only need to adjust the style. For instance, if you want gaps between them, you could do
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt,xshift=1pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt,xshift=-1pt]#1.north east) }
}}
which yields
Note also that I put the signs on top of the signs of the underlying equation. If you want them in the middle, this will be even easier.
documentclass{article}
usepackage{tikz,mathtools}
usetikzlibrary{tikzmark}
usetikzlibrary{decorations.pathreplacing}
%%% Derivative Macro
newcommand{der}[2]{dfrac{mathrm{d}#1}{mathrm{d}#2}}
%%% Derivative Prime Notation
newcommand{pder}[2]{#1^{prime}(#2)}
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt,xshift=1pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt,xshift=-1pt]#1.north east) }
}}
begin{document}
begin{align*}
der{}{x} [tikzmarknode{A}{(2x^{5}+x-1)}
tikzmarknode{B}{vphantom{x^{5}}(3x-2)}]
&=tikzmarknode{C}{(2x^{5}+x-1)}
tikzmarknode[red]{D}{vphantom{x^{5}}(3)}
+tikzmarknode{E}{vphantom{x^{5}}(3x-2)}
tikzmarknode[red]{F}{(10x^{4}+1)}
end{align*}
begin{tikzpicture}[overlay, remember picture]
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
draw[blue,thick,overbrace={B with {$g(x)$} called g1}];
draw[blue,thick,overbrace={C with {$f(x)$} called f2}];
draw[red,thick,overbrace={D with {$pder{g}{x}$} called dg1}];
draw[blue,thick,overbrace={E with {$g(x)$} called g2}];
draw[red,thick,overbrace={F with {$pder{f}{x}$} called df1}];
path[blue] (f1) -- (g1) node[midway] {$cdot$}
(f2) -- (dg1) node[midway] {$cdot$}
(dg1) -- (g2) node[midway] {$+$}
(g2) -- (df1) node[midway] {$cdot$};
end{tikzpicture}
end{document}
I guess it is ! I think you did not want the "H" in the post. I would also space the braces so they do not touch each other. I like the style technique which is making me look like a real rookie! :)
– MathScholar
3 hours ago
@MathScholar Sorry about the H. It is gone in the last option (which I was writing when I saw your comment.) The lower two options have gaps.
– marmot
3 hours ago
thank you for this. I will have to play around with this and make things fit for the example in the code. I did not think it was possible! You proved me wrong
– MathScholar
3 hours ago
add a comment |
up vote
2
down vote
accepted
I would actually like to argue that it is more ergonomic to define a style that just inserts the brace path with the node on top, and not to have so many scattered tikzmarknode
s. This answer comes with an overbrace
style, that can be used as
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
where A
is the node you want to overbrace, {$f(x)$}
is the node on top and f1
its name. Then it is also much easier to insert the additional signs.
documentclass{article}
usepackage{tikz,mathtools}
usetikzlibrary{tikzmark}
usetikzlibrary{decorations.pathreplacing,calc}
%%% Derivative Macro
newcommand{der}[2]{dfrac{mathrm{d}#1}{mathrm{d}#2}}
%%% Derivative Prime Notation
newcommand{pder}[2]{#1^{prime}(#2)}
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt]#1.north east) }
}}
begin{document}
begin{align*}
der{}{x} [tikzmarknode{A}{(2x^{5}+x-1)}
tikzmarknode{B}{vphantom{x^{5}}(3x-2)}]
&=tikzmarknode{C}{(2x^{5}+x-1)}
tikzmarknode[red]{D}{vphantom{x^{5}}(3H)}
+tikzmarknode{E}{vphantom{x^{5}}(3x-2)}
tikzmarknode[red]{F}{(10x^{4}+1)}
end{align*}
begin{tikzpicture}[overlay, remember picture]
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
draw[blue,thick,overbrace={B with {$g(x)$} called g1}];
draw[blue,thick,overbrace={C with {$f(x)$} called f2}];
draw[red,thick,overbrace={D with {$pder{g}{x}$} called dg1}];
draw[blue,thick,overbrace={E with {$g(x)$} called g2}];
draw[red,thick,overbrace={F with {$pder{f}{x}$} called df1}];
path ($(A.east)!0.5!(B.west)$) coordinate (auxAB)
($(C.east)!0.5!(D.west)$) coordinate (auxCD)
($(D.east)!0.5!(E.west)$) coordinate (auxDE)
($(E.east)!0.5!(F.west)$) coordinate (auxEF);
path (auxAB|-f1) node[blue]{$cdot$}
([xshift=-3pt]auxCD|-f1) node[blue]{$cdot$} %manual correction
(auxDE|-f1) node[blue]{$+$}
(auxEF|-f1) node[blue]{$cdot$};
end{tikzpicture}
end{document}
If you want to layout of the braces, you only need to adjust the style. For instance, if you want gaps between them, you could do
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt,xshift=1pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt,xshift=-1pt]#1.north east) }
}}
which yields
Note also that I put the signs on top of the signs of the underlying equation. If you want them in the middle, this will be even easier.
documentclass{article}
usepackage{tikz,mathtools}
usetikzlibrary{tikzmark}
usetikzlibrary{decorations.pathreplacing}
%%% Derivative Macro
newcommand{der}[2]{dfrac{mathrm{d}#1}{mathrm{d}#2}}
%%% Derivative Prime Notation
newcommand{pder}[2]{#1^{prime}(#2)}
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt,xshift=1pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt,xshift=-1pt]#1.north east) }
}}
begin{document}
begin{align*}
der{}{x} [tikzmarknode{A}{(2x^{5}+x-1)}
tikzmarknode{B}{vphantom{x^{5}}(3x-2)}]
&=tikzmarknode{C}{(2x^{5}+x-1)}
tikzmarknode[red]{D}{vphantom{x^{5}}(3)}
+tikzmarknode{E}{vphantom{x^{5}}(3x-2)}
tikzmarknode[red]{F}{(10x^{4}+1)}
end{align*}
begin{tikzpicture}[overlay, remember picture]
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
draw[blue,thick,overbrace={B with {$g(x)$} called g1}];
draw[blue,thick,overbrace={C with {$f(x)$} called f2}];
draw[red,thick,overbrace={D with {$pder{g}{x}$} called dg1}];
draw[blue,thick,overbrace={E with {$g(x)$} called g2}];
draw[red,thick,overbrace={F with {$pder{f}{x}$} called df1}];
path[blue] (f1) -- (g1) node[midway] {$cdot$}
(f2) -- (dg1) node[midway] {$cdot$}
(dg1) -- (g2) node[midway] {$+$}
(g2) -- (df1) node[midway] {$cdot$};
end{tikzpicture}
end{document}
I guess it is ! I think you did not want the "H" in the post. I would also space the braces so they do not touch each other. I like the style technique which is making me look like a real rookie! :)
– MathScholar
3 hours ago
@MathScholar Sorry about the H. It is gone in the last option (which I was writing when I saw your comment.) The lower two options have gaps.
– marmot
3 hours ago
thank you for this. I will have to play around with this and make things fit for the example in the code. I did not think it was possible! You proved me wrong
– MathScholar
3 hours ago
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
I would actually like to argue that it is more ergonomic to define a style that just inserts the brace path with the node on top, and not to have so many scattered tikzmarknode
s. This answer comes with an overbrace
style, that can be used as
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
where A
is the node you want to overbrace, {$f(x)$}
is the node on top and f1
its name. Then it is also much easier to insert the additional signs.
documentclass{article}
usepackage{tikz,mathtools}
usetikzlibrary{tikzmark}
usetikzlibrary{decorations.pathreplacing,calc}
%%% Derivative Macro
newcommand{der}[2]{dfrac{mathrm{d}#1}{mathrm{d}#2}}
%%% Derivative Prime Notation
newcommand{pder}[2]{#1^{prime}(#2)}
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt]#1.north east) }
}}
begin{document}
begin{align*}
der{}{x} [tikzmarknode{A}{(2x^{5}+x-1)}
tikzmarknode{B}{vphantom{x^{5}}(3x-2)}]
&=tikzmarknode{C}{(2x^{5}+x-1)}
tikzmarknode[red]{D}{vphantom{x^{5}}(3H)}
+tikzmarknode{E}{vphantom{x^{5}}(3x-2)}
tikzmarknode[red]{F}{(10x^{4}+1)}
end{align*}
begin{tikzpicture}[overlay, remember picture]
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
draw[blue,thick,overbrace={B with {$g(x)$} called g1}];
draw[blue,thick,overbrace={C with {$f(x)$} called f2}];
draw[red,thick,overbrace={D with {$pder{g}{x}$} called dg1}];
draw[blue,thick,overbrace={E with {$g(x)$} called g2}];
draw[red,thick,overbrace={F with {$pder{f}{x}$} called df1}];
path ($(A.east)!0.5!(B.west)$) coordinate (auxAB)
($(C.east)!0.5!(D.west)$) coordinate (auxCD)
($(D.east)!0.5!(E.west)$) coordinate (auxDE)
($(E.east)!0.5!(F.west)$) coordinate (auxEF);
path (auxAB|-f1) node[blue]{$cdot$}
([xshift=-3pt]auxCD|-f1) node[blue]{$cdot$} %manual correction
(auxDE|-f1) node[blue]{$+$}
(auxEF|-f1) node[blue]{$cdot$};
end{tikzpicture}
end{document}
If you want to layout of the braces, you only need to adjust the style. For instance, if you want gaps between them, you could do
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt,xshift=1pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt,xshift=-1pt]#1.north east) }
}}
which yields
Note also that I put the signs on top of the signs of the underlying equation. If you want them in the middle, this will be even easier.
documentclass{article}
usepackage{tikz,mathtools}
usetikzlibrary{tikzmark}
usetikzlibrary{decorations.pathreplacing}
%%% Derivative Macro
newcommand{der}[2]{dfrac{mathrm{d}#1}{mathrm{d}#2}}
%%% Derivative Prime Notation
newcommand{pder}[2]{#1^{prime}(#2)}
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt,xshift=1pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt,xshift=-1pt]#1.north east) }
}}
begin{document}
begin{align*}
der{}{x} [tikzmarknode{A}{(2x^{5}+x-1)}
tikzmarknode{B}{vphantom{x^{5}}(3x-2)}]
&=tikzmarknode{C}{(2x^{5}+x-1)}
tikzmarknode[red]{D}{vphantom{x^{5}}(3)}
+tikzmarknode{E}{vphantom{x^{5}}(3x-2)}
tikzmarknode[red]{F}{(10x^{4}+1)}
end{align*}
begin{tikzpicture}[overlay, remember picture]
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
draw[blue,thick,overbrace={B with {$g(x)$} called g1}];
draw[blue,thick,overbrace={C with {$f(x)$} called f2}];
draw[red,thick,overbrace={D with {$pder{g}{x}$} called dg1}];
draw[blue,thick,overbrace={E with {$g(x)$} called g2}];
draw[red,thick,overbrace={F with {$pder{f}{x}$} called df1}];
path[blue] (f1) -- (g1) node[midway] {$cdot$}
(f2) -- (dg1) node[midway] {$cdot$}
(dg1) -- (g2) node[midway] {$+$}
(g2) -- (df1) node[midway] {$cdot$};
end{tikzpicture}
end{document}
I would actually like to argue that it is more ergonomic to define a style that just inserts the brace path with the node on top, and not to have so many scattered tikzmarknode
s. This answer comes with an overbrace
style, that can be used as
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
where A
is the node you want to overbrace, {$f(x)$}
is the node on top and f1
its name. Then it is also much easier to insert the additional signs.
documentclass{article}
usepackage{tikz,mathtools}
usetikzlibrary{tikzmark}
usetikzlibrary{decorations.pathreplacing,calc}
%%% Derivative Macro
newcommand{der}[2]{dfrac{mathrm{d}#1}{mathrm{d}#2}}
%%% Derivative Prime Notation
newcommand{pder}[2]{#1^{prime}(#2)}
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt]#1.north east) }
}}
begin{document}
begin{align*}
der{}{x} [tikzmarknode{A}{(2x^{5}+x-1)}
tikzmarknode{B}{vphantom{x^{5}}(3x-2)}]
&=tikzmarknode{C}{(2x^{5}+x-1)}
tikzmarknode[red]{D}{vphantom{x^{5}}(3H)}
+tikzmarknode{E}{vphantom{x^{5}}(3x-2)}
tikzmarknode[red]{F}{(10x^{4}+1)}
end{align*}
begin{tikzpicture}[overlay, remember picture]
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
draw[blue,thick,overbrace={B with {$g(x)$} called g1}];
draw[blue,thick,overbrace={C with {$f(x)$} called f2}];
draw[red,thick,overbrace={D with {$pder{g}{x}$} called dg1}];
draw[blue,thick,overbrace={E with {$g(x)$} called g2}];
draw[red,thick,overbrace={F with {$pder{f}{x}$} called df1}];
path ($(A.east)!0.5!(B.west)$) coordinate (auxAB)
($(C.east)!0.5!(D.west)$) coordinate (auxCD)
($(D.east)!0.5!(E.west)$) coordinate (auxDE)
($(E.east)!0.5!(F.west)$) coordinate (auxEF);
path (auxAB|-f1) node[blue]{$cdot$}
([xshift=-3pt]auxCD|-f1) node[blue]{$cdot$} %manual correction
(auxDE|-f1) node[blue]{$+$}
(auxEF|-f1) node[blue]{$cdot$};
end{tikzpicture}
end{document}
If you want to layout of the braces, you only need to adjust the style. For instance, if you want gaps between them, you could do
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt,xshift=1pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt,xshift=-1pt]#1.north east) }
}}
which yields
Note also that I put the signs on top of the signs of the underlying equation. If you want them in the middle, this will be even easier.
documentclass{article}
usepackage{tikz,mathtools}
usetikzlibrary{tikzmark}
usetikzlibrary{decorations.pathreplacing}
%%% Derivative Macro
newcommand{der}[2]{dfrac{mathrm{d}#1}{mathrm{d}#2}}
%%% Derivative Prime Notation
newcommand{pder}[2]{#1^{prime}(#2)}
tikzset{overbrace/.style args={#1 with #2 called #3}{
insert path={[decoration={brace},decorate] ([yshift=5pt,xshift=1pt]#1.north west)
-- node[midway, above=3pt] (#3) {#2}
([yshift=5pt,xshift=-1pt]#1.north east) }
}}
begin{document}
begin{align*}
der{}{x} [tikzmarknode{A}{(2x^{5}+x-1)}
tikzmarknode{B}{vphantom{x^{5}}(3x-2)}]
&=tikzmarknode{C}{(2x^{5}+x-1)}
tikzmarknode[red]{D}{vphantom{x^{5}}(3)}
+tikzmarknode{E}{vphantom{x^{5}}(3x-2)}
tikzmarknode[red]{F}{(10x^{4}+1)}
end{align*}
begin{tikzpicture}[overlay, remember picture]
draw[blue,thick,overbrace={A with {$f(x)$} called f1}];
draw[blue,thick,overbrace={B with {$g(x)$} called g1}];
draw[blue,thick,overbrace={C with {$f(x)$} called f2}];
draw[red,thick,overbrace={D with {$pder{g}{x}$} called dg1}];
draw[blue,thick,overbrace={E with {$g(x)$} called g2}];
draw[red,thick,overbrace={F with {$pder{f}{x}$} called df1}];
path[blue] (f1) -- (g1) node[midway] {$cdot$}
(f2) -- (dg1) node[midway] {$cdot$}
(dg1) -- (g2) node[midway] {$+$}
(g2) -- (df1) node[midway] {$cdot$};
end{tikzpicture}
end{document}
edited 3 hours ago
answered 3 hours ago
marmot
80.9k491173
80.9k491173
I guess it is ! I think you did not want the "H" in the post. I would also space the braces so they do not touch each other. I like the style technique which is making me look like a real rookie! :)
– MathScholar
3 hours ago
@MathScholar Sorry about the H. It is gone in the last option (which I was writing when I saw your comment.) The lower two options have gaps.
– marmot
3 hours ago
thank you for this. I will have to play around with this and make things fit for the example in the code. I did not think it was possible! You proved me wrong
– MathScholar
3 hours ago
add a comment |
I guess it is ! I think you did not want the "H" in the post. I would also space the braces so they do not touch each other. I like the style technique which is making me look like a real rookie! :)
– MathScholar
3 hours ago
@MathScholar Sorry about the H. It is gone in the last option (which I was writing when I saw your comment.) The lower two options have gaps.
– marmot
3 hours ago
thank you for this. I will have to play around with this and make things fit for the example in the code. I did not think it was possible! You proved me wrong
– MathScholar
3 hours ago
I guess it is ! I think you did not want the "H" in the post. I would also space the braces so they do not touch each other. I like the style technique which is making me look like a real rookie! :)
– MathScholar
3 hours ago
I guess it is ! I think you did not want the "H" in the post. I would also space the braces so they do not touch each other. I like the style technique which is making me look like a real rookie! :)
– MathScholar
3 hours ago
@MathScholar Sorry about the H. It is gone in the last option (which I was writing when I saw your comment.) The lower two options have gaps.
– marmot
3 hours ago
@MathScholar Sorry about the H. It is gone in the last option (which I was writing when I saw your comment.) The lower two options have gaps.
– marmot
3 hours ago
thank you for this. I will have to play around with this and make things fit for the example in the code. I did not think it was possible! You proved me wrong
– MathScholar
3 hours ago
thank you for this. I will have to play around with this and make things fit for the example in the code. I did not think it was possible! You proved me wrong
– MathScholar
3 hours ago
add a comment |
up vote
1
down vote
Despite being a very powerful tool, tikz can be too costly for some tasks. Here I use overbrace
and a small hack to add the operators while occupying 0pt
width using a makebox[0pt]{..}
macro. Also, as @LoopSpace suggested, we can make the braces at the same height by adding vphantom{x^5}
to parentheses without that term.
documentclass{article}
usepackage{amsmath}
begin{document}
newcommand{hide}[2]{makebox[0pt][l]{$hspace{#1pt}#2$}}
[
frac{d}{dx}[overbrace{(2x^5+x-1)}^{f(x)hide{20}{cdot}} overbrace{(vphantom{x^5}3x-2)}^{g(x)}]
= overbrace{(2x^5+x-1)}^{f(x)hide{15}{cdot}} overbrace{(vphantom{x^5}3)}^{g'(x)hide{2}{+}}
+ overbrace{(vphantom{x^5}3x-2)}^{g(x)hide{10}{cdot}} overbrace{(10x^4+1)}^{f'(x)}
]
end{document}
1
Loath as I am to discourage use oftikzmark
, I think it is really useful to see what can be achieved with simpler stuff. I do think it could do with thevphantom{x^5}
as in marmot's answer to get the braces level.
– Loop Space
3 hours ago
Sure, that improves the look of the equation, I added this, thanks.
– AboAmmar
3 hours ago
add a comment |
up vote
1
down vote
Despite being a very powerful tool, tikz can be too costly for some tasks. Here I use overbrace
and a small hack to add the operators while occupying 0pt
width using a makebox[0pt]{..}
macro. Also, as @LoopSpace suggested, we can make the braces at the same height by adding vphantom{x^5}
to parentheses without that term.
documentclass{article}
usepackage{amsmath}
begin{document}
newcommand{hide}[2]{makebox[0pt][l]{$hspace{#1pt}#2$}}
[
frac{d}{dx}[overbrace{(2x^5+x-1)}^{f(x)hide{20}{cdot}} overbrace{(vphantom{x^5}3x-2)}^{g(x)}]
= overbrace{(2x^5+x-1)}^{f(x)hide{15}{cdot}} overbrace{(vphantom{x^5}3)}^{g'(x)hide{2}{+}}
+ overbrace{(vphantom{x^5}3x-2)}^{g(x)hide{10}{cdot}} overbrace{(10x^4+1)}^{f'(x)}
]
end{document}
1
Loath as I am to discourage use oftikzmark
, I think it is really useful to see what can be achieved with simpler stuff. I do think it could do with thevphantom{x^5}
as in marmot's answer to get the braces level.
– Loop Space
3 hours ago
Sure, that improves the look of the equation, I added this, thanks.
– AboAmmar
3 hours ago
add a comment |
up vote
1
down vote
up vote
1
down vote
Despite being a very powerful tool, tikz can be too costly for some tasks. Here I use overbrace
and a small hack to add the operators while occupying 0pt
width using a makebox[0pt]{..}
macro. Also, as @LoopSpace suggested, we can make the braces at the same height by adding vphantom{x^5}
to parentheses without that term.
documentclass{article}
usepackage{amsmath}
begin{document}
newcommand{hide}[2]{makebox[0pt][l]{$hspace{#1pt}#2$}}
[
frac{d}{dx}[overbrace{(2x^5+x-1)}^{f(x)hide{20}{cdot}} overbrace{(vphantom{x^5}3x-2)}^{g(x)}]
= overbrace{(2x^5+x-1)}^{f(x)hide{15}{cdot}} overbrace{(vphantom{x^5}3)}^{g'(x)hide{2}{+}}
+ overbrace{(vphantom{x^5}3x-2)}^{g(x)hide{10}{cdot}} overbrace{(10x^4+1)}^{f'(x)}
]
end{document}
Despite being a very powerful tool, tikz can be too costly for some tasks. Here I use overbrace
and a small hack to add the operators while occupying 0pt
width using a makebox[0pt]{..}
macro. Also, as @LoopSpace suggested, we can make the braces at the same height by adding vphantom{x^5}
to parentheses without that term.
documentclass{article}
usepackage{amsmath}
begin{document}
newcommand{hide}[2]{makebox[0pt][l]{$hspace{#1pt}#2$}}
[
frac{d}{dx}[overbrace{(2x^5+x-1)}^{f(x)hide{20}{cdot}} overbrace{(vphantom{x^5}3x-2)}^{g(x)}]
= overbrace{(2x^5+x-1)}^{f(x)hide{15}{cdot}} overbrace{(vphantom{x^5}3)}^{g'(x)hide{2}{+}}
+ overbrace{(vphantom{x^5}3x-2)}^{g(x)hide{10}{cdot}} overbrace{(10x^4+1)}^{f'(x)}
]
end{document}
edited 3 hours ago
answered 3 hours ago
AboAmmar
31.7k22781
31.7k22781
1
Loath as I am to discourage use oftikzmark
, I think it is really useful to see what can be achieved with simpler stuff. I do think it could do with thevphantom{x^5}
as in marmot's answer to get the braces level.
– Loop Space
3 hours ago
Sure, that improves the look of the equation, I added this, thanks.
– AboAmmar
3 hours ago
add a comment |
1
Loath as I am to discourage use oftikzmark
, I think it is really useful to see what can be achieved with simpler stuff. I do think it could do with thevphantom{x^5}
as in marmot's answer to get the braces level.
– Loop Space
3 hours ago
Sure, that improves the look of the equation, I added this, thanks.
– AboAmmar
3 hours ago
1
1
Loath as I am to discourage use of
tikzmark
, I think it is really useful to see what can be achieved with simpler stuff. I do think it could do with the vphantom{x^5}
as in marmot's answer to get the braces level.– Loop Space
3 hours ago
Loath as I am to discourage use of
tikzmark
, I think it is really useful to see what can be achieved with simpler stuff. I do think it could do with the vphantom{x^5}
as in marmot's answer to get the braces level.– Loop Space
3 hours ago
Sure, that improves the look of the equation, I added this, thanks.
– AboAmmar
3 hours ago
Sure, that improves the look of the equation, I added this, thanks.
– AboAmmar
3 hours ago
add a comment |
up vote
0
down vote
For fun, another simple solution with the overbrace
command and pstricks
:
documentclass{article}
usepackage{mathtools, esdiff}
usepackage{pst-node}
begin{document}
begin{align*}
diff{}{x}bigl[(textcolor{red}{overbrace{strutcolor{black}2x^{5}+x-1}^{Rnode{f}{textstyle f(x)}} textcolor{black}{ )(}overbrace{strutcolor{black}3x-2}^{Rnode{g}{textstyle g(x)}}})bigr] &= (textcolor{blue}{overbrace{color{black}2x^{5}+x-1}^{Rnode{bluef}{textstyle f(x})}})textcolor{red}{overbrace{strut(3)}^{Rnode{dg}{textstyle g'(x)}} }+ (textcolor{blue}{overbrace{strutcolor{black}3x-2}^{Rnode{blueg}{textstyle g(x)}}} )textcolor{red}{(overbrace{10x^{4}+1}^{Rnode{df}{textstyle f'(x )}})}%
%% Additional symbols
psset{linestyle=none}
ncline{f}{g}ncput{boldsymbolcdot}
ncline{bluef}{dg}ncput{boldsymbolcdot}
ncline{blueg}{df}ncput{boldsymbolcdot}
ncline{blueg}{dg}ncput{ + }
end{align*}
end{document}
add a comment |
up vote
0
down vote
For fun, another simple solution with the overbrace
command and pstricks
:
documentclass{article}
usepackage{mathtools, esdiff}
usepackage{pst-node}
begin{document}
begin{align*}
diff{}{x}bigl[(textcolor{red}{overbrace{strutcolor{black}2x^{5}+x-1}^{Rnode{f}{textstyle f(x)}} textcolor{black}{ )(}overbrace{strutcolor{black}3x-2}^{Rnode{g}{textstyle g(x)}}})bigr] &= (textcolor{blue}{overbrace{color{black}2x^{5}+x-1}^{Rnode{bluef}{textstyle f(x})}})textcolor{red}{overbrace{strut(3)}^{Rnode{dg}{textstyle g'(x)}} }+ (textcolor{blue}{overbrace{strutcolor{black}3x-2}^{Rnode{blueg}{textstyle g(x)}}} )textcolor{red}{(overbrace{10x^{4}+1}^{Rnode{df}{textstyle f'(x )}})}%
%% Additional symbols
psset{linestyle=none}
ncline{f}{g}ncput{boldsymbolcdot}
ncline{bluef}{dg}ncput{boldsymbolcdot}
ncline{blueg}{df}ncput{boldsymbolcdot}
ncline{blueg}{dg}ncput{ + }
end{align*}
end{document}
add a comment |
up vote
0
down vote
up vote
0
down vote
For fun, another simple solution with the overbrace
command and pstricks
:
documentclass{article}
usepackage{mathtools, esdiff}
usepackage{pst-node}
begin{document}
begin{align*}
diff{}{x}bigl[(textcolor{red}{overbrace{strutcolor{black}2x^{5}+x-1}^{Rnode{f}{textstyle f(x)}} textcolor{black}{ )(}overbrace{strutcolor{black}3x-2}^{Rnode{g}{textstyle g(x)}}})bigr] &= (textcolor{blue}{overbrace{color{black}2x^{5}+x-1}^{Rnode{bluef}{textstyle f(x})}})textcolor{red}{overbrace{strut(3)}^{Rnode{dg}{textstyle g'(x)}} }+ (textcolor{blue}{overbrace{strutcolor{black}3x-2}^{Rnode{blueg}{textstyle g(x)}}} )textcolor{red}{(overbrace{10x^{4}+1}^{Rnode{df}{textstyle f'(x )}})}%
%% Additional symbols
psset{linestyle=none}
ncline{f}{g}ncput{boldsymbolcdot}
ncline{bluef}{dg}ncput{boldsymbolcdot}
ncline{blueg}{df}ncput{boldsymbolcdot}
ncline{blueg}{dg}ncput{ + }
end{align*}
end{document}
For fun, another simple solution with the overbrace
command and pstricks
:
documentclass{article}
usepackage{mathtools, esdiff}
usepackage{pst-node}
begin{document}
begin{align*}
diff{}{x}bigl[(textcolor{red}{overbrace{strutcolor{black}2x^{5}+x-1}^{Rnode{f}{textstyle f(x)}} textcolor{black}{ )(}overbrace{strutcolor{black}3x-2}^{Rnode{g}{textstyle g(x)}}})bigr] &= (textcolor{blue}{overbrace{color{black}2x^{5}+x-1}^{Rnode{bluef}{textstyle f(x})}})textcolor{red}{overbrace{strut(3)}^{Rnode{dg}{textstyle g'(x)}} }+ (textcolor{blue}{overbrace{strutcolor{black}3x-2}^{Rnode{blueg}{textstyle g(x)}}} )textcolor{red}{(overbrace{10x^{4}+1}^{Rnode{df}{textstyle f'(x )}})}%
%% Additional symbols
psset{linestyle=none}
ncline{f}{g}ncput{boldsymbolcdot}
ncline{bluef}{dg}ncput{boldsymbolcdot}
ncline{blueg}{df}ncput{boldsymbolcdot}
ncline{blueg}{dg}ncput{ + }
end{align*}
end{document}
answered 2 hours ago
Bernard
163k769192
163k769192
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463423%2fadditional-symbols-tikzmark-and-braces%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you really need a hammersledge like tikz for this?
– Bernard
3 hours ago
1
@Bernhard, it is the way I have been trained but I am interested in a "way" out if possible?
– MathScholar
3 hours ago