TikZ: Alligning two Tikz pictures and align parentheses to nodes
I tried to draw two graphs with Tikz. How can I align them vertically to each other? I want the knots to form the center, such that all six nodes align vertically. Furthermore I want to align the curly brackets using the nodes. But that does not work either. I want the parentheses to start at the beginning of the first node and end at the end of the last node. How can I do that?
This is what I get:
This is what I would like to have:
This code produces the picture above:
documentclass[a4paper]{article}
usepackage{tikz}
begin{document}
usetikzlibrary{chains, positioning, decorations.pathreplacing}
defilsize{3}
defnodesize{6mm}
tikzset{>=latex}
begin{figure}[h]
centering
begin{tikzpicture}[shorten >=0pt, ->, draw=black!100]
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
node[input node] (In-name) at (0.0cm,-y cm) {$w_{y}$};
% Labels %
draw[-, decoration={brace,raise=0pt, amplitude=3mm}, decorate, xshift=10mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,right=3mm] {$g(v)$};
draw[-, decoration={brace, raise=0pt, amplitude=3mm, mirror}, decorate, xshift=10mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,left=3mm] {$v$};
end{tikzpicture}
begin{tikzpicture}[shorten >=0pt, ->, draw=black!100]
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
node[input node] (In-name) at (0.0cm,-y cm) {$u_{y}$};
% Labels %
draw[-, decoration={brace,raise=0pt, amplitude=3mm}, decorate, xshift=0mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,right=3mm] {$g(v)$};
%(Out-1) -- (Out-3) node[black,midway,xshift] {$f(x)$};
draw[-, decoration={brace, raise=0pt, amplitude=3mm, mirror}, decorate, xshift=0mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,left=3mm] {$mathcal{K}=U*V*W$};
end{tikzpicture}
end{figure}
end{document}
tikz-pgf tikz-node
|
show 1 more comment
I tried to draw two graphs with Tikz. How can I align them vertically to each other? I want the knots to form the center, such that all six nodes align vertically. Furthermore I want to align the curly brackets using the nodes. But that does not work either. I want the parentheses to start at the beginning of the first node and end at the end of the last node. How can I do that?
This is what I get:
This is what I would like to have:
This code produces the picture above:
documentclass[a4paper]{article}
usepackage{tikz}
begin{document}
usetikzlibrary{chains, positioning, decorations.pathreplacing}
defilsize{3}
defnodesize{6mm}
tikzset{>=latex}
begin{figure}[h]
centering
begin{tikzpicture}[shorten >=0pt, ->, draw=black!100]
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
node[input node] (In-name) at (0.0cm,-y cm) {$w_{y}$};
% Labels %
draw[-, decoration={brace,raise=0pt, amplitude=3mm}, decorate, xshift=10mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,right=3mm] {$g(v)$};
draw[-, decoration={brace, raise=0pt, amplitude=3mm, mirror}, decorate, xshift=10mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,left=3mm] {$v$};
end{tikzpicture}
begin{tikzpicture}[shorten >=0pt, ->, draw=black!100]
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
node[input node] (In-name) at (0.0cm,-y cm) {$u_{y}$};
% Labels %
draw[-, decoration={brace,raise=0pt, amplitude=3mm}, decorate, xshift=0mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,right=3mm] {$g(v)$};
%(Out-1) -- (Out-3) node[black,midway,xshift] {$f(x)$};
draw[-, decoration={brace, raise=0pt, amplitude=3mm, mirror}, decorate, xshift=0mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,left=3mm] {$mathcal{K}=U*V*W$};
end{tikzpicture}
end{figure}
end{document}
tikz-pgf tikz-node
why you not merge both images in onetikzpicture
?
– Zarko
Dec 14 at 9:13
Could you perhaps add a sketch that illustrates what you want?
– marmot
Dec 14 at 9:25
@Zarko I tried that, but it made things worse. I am not an expert.
– Samuel
Dec 14 at 9:28
@marmot I added a sketch.
– Samuel
Dec 14 at 9:35
@Zarko I added a sketch to show how I want to align the curly brackets using the nodes.
– Samuel
Dec 14 at 9:41
|
show 1 more comment
I tried to draw two graphs with Tikz. How can I align them vertically to each other? I want the knots to form the center, such that all six nodes align vertically. Furthermore I want to align the curly brackets using the nodes. But that does not work either. I want the parentheses to start at the beginning of the first node and end at the end of the last node. How can I do that?
This is what I get:
This is what I would like to have:
This code produces the picture above:
documentclass[a4paper]{article}
usepackage{tikz}
begin{document}
usetikzlibrary{chains, positioning, decorations.pathreplacing}
defilsize{3}
defnodesize{6mm}
tikzset{>=latex}
begin{figure}[h]
centering
begin{tikzpicture}[shorten >=0pt, ->, draw=black!100]
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
node[input node] (In-name) at (0.0cm,-y cm) {$w_{y}$};
% Labels %
draw[-, decoration={brace,raise=0pt, amplitude=3mm}, decorate, xshift=10mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,right=3mm] {$g(v)$};
draw[-, decoration={brace, raise=0pt, amplitude=3mm, mirror}, decorate, xshift=10mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,left=3mm] {$v$};
end{tikzpicture}
begin{tikzpicture}[shorten >=0pt, ->, draw=black!100]
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
node[input node] (In-name) at (0.0cm,-y cm) {$u_{y}$};
% Labels %
draw[-, decoration={brace,raise=0pt, amplitude=3mm}, decorate, xshift=0mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,right=3mm] {$g(v)$};
%(Out-1) -- (Out-3) node[black,midway,xshift] {$f(x)$};
draw[-, decoration={brace, raise=0pt, amplitude=3mm, mirror}, decorate, xshift=0mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,left=3mm] {$mathcal{K}=U*V*W$};
end{tikzpicture}
end{figure}
end{document}
tikz-pgf tikz-node
I tried to draw two graphs with Tikz. How can I align them vertically to each other? I want the knots to form the center, such that all six nodes align vertically. Furthermore I want to align the curly brackets using the nodes. But that does not work either. I want the parentheses to start at the beginning of the first node and end at the end of the last node. How can I do that?
This is what I get:
This is what I would like to have:
This code produces the picture above:
documentclass[a4paper]{article}
usepackage{tikz}
begin{document}
usetikzlibrary{chains, positioning, decorations.pathreplacing}
defilsize{3}
defnodesize{6mm}
tikzset{>=latex}
begin{figure}[h]
centering
begin{tikzpicture}[shorten >=0pt, ->, draw=black!100]
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
node[input node] (In-name) at (0.0cm,-y cm) {$w_{y}$};
% Labels %
draw[-, decoration={brace,raise=0pt, amplitude=3mm}, decorate, xshift=10mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,right=3mm] {$g(v)$};
draw[-, decoration={brace, raise=0pt, amplitude=3mm, mirror}, decorate, xshift=10mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,left=3mm] {$v$};
end{tikzpicture}
begin{tikzpicture}[shorten >=0pt, ->, draw=black!100]
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
node[input node] (In-name) at (0.0cm,-y cm) {$u_{y}$};
% Labels %
draw[-, decoration={brace,raise=0pt, amplitude=3mm}, decorate, xshift=0mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,right=3mm] {$g(v)$};
%(Out-1) -- (Out-3) node[black,midway,xshift] {$f(x)$};
draw[-, decoration={brace, raise=0pt, amplitude=3mm, mirror}, decorate, xshift=0mm, yshift=0mm]
(In-1) -- (In-3) node[black,midway,left=3mm] {$mathcal{K}=U*V*W$};
end{tikzpicture}
end{figure}
end{document}
tikz-pgf tikz-node
tikz-pgf tikz-node
edited Dec 14 at 9:34
asked Dec 14 at 9:06
Samuel
388111
388111
why you not merge both images in onetikzpicture
?
– Zarko
Dec 14 at 9:13
Could you perhaps add a sketch that illustrates what you want?
– marmot
Dec 14 at 9:25
@Zarko I tried that, but it made things worse. I am not an expert.
– Samuel
Dec 14 at 9:28
@marmot I added a sketch.
– Samuel
Dec 14 at 9:35
@Zarko I added a sketch to show how I want to align the curly brackets using the nodes.
– Samuel
Dec 14 at 9:41
|
show 1 more comment
why you not merge both images in onetikzpicture
?
– Zarko
Dec 14 at 9:13
Could you perhaps add a sketch that illustrates what you want?
– marmot
Dec 14 at 9:25
@Zarko I tried that, but it made things worse. I am not an expert.
– Samuel
Dec 14 at 9:28
@marmot I added a sketch.
– Samuel
Dec 14 at 9:35
@Zarko I added a sketch to show how I want to align the curly brackets using the nodes.
– Samuel
Dec 14 at 9:41
why you not merge both images in one
tikzpicture
?– Zarko
Dec 14 at 9:13
why you not merge both images in one
tikzpicture
?– Zarko
Dec 14 at 9:13
Could you perhaps add a sketch that illustrates what you want?
– marmot
Dec 14 at 9:25
Could you perhaps add a sketch that illustrates what you want?
– marmot
Dec 14 at 9:25
@Zarko I tried that, but it made things worse. I am not an expert.
– Samuel
Dec 14 at 9:28
@Zarko I tried that, but it made things worse. I am not an expert.
– Samuel
Dec 14 at 9:28
@marmot I added a sketch.
– Samuel
Dec 14 at 9:35
@marmot I added a sketch.
– Samuel
Dec 14 at 9:35
@Zarko I added a sketch to show how I want to align the curly brackets using the nodes.
– Samuel
Dec 14 at 9:41
@Zarko I added a sketch to show how I want to align the curly brackets using the nodes.
– Samuel
Dec 14 at 9:41
|
show 1 more comment
5 Answers
5
active
oldest
votes
as i mentioned, merging bot tikzpicture
s in one enable better controlling their elements positions:
edit:
position of braces are corrected acoording to new explanation in question
documentclass[a4paper]{article}
usepackage{tikz}
usetikzlibrary{decorations.pathreplacing} % tikz library should be here, in preamble
begin{document}
begin{figure}[htb]
centering
defilsize{3}
defnodesize{6mm}
begin{tikzpicture}[
B/.style = {% common "universal" style for all braces
decoration={brace, amplitude=3mm,#1},% #1 is for mirroring, when necessary
decorate},
B/.default = , % default braces are not mirrored
circ/.style = {% style name, which is not used by tikz
circle, draw, minimum size=nodesize, inner sep=0pt},
]
% Nodes
foreach name / y in {1,...,ilsize}
node[circ] (In-name) at (0,-y) {$w_{y}$};
% Labels
draw[B]
(In-1.north -| In-1.east) -- node[right=3mm] {$g(v)$} (In-3.south -| In-3.east);
draw[B=mirror]
(In-1.north -| In-1.west) -- node[left=3mm] {$v$} (In-3.south -| In-3.west) ;
begin{scope}[yshift=-31mm]
% Nodes
foreach name / y in {1,...,ilsize}
node[circ] (In-name) at (0,-y) {$w_{y}$};
% Labels %
draw[B] % draw brace
(In-1.north -| In-1.east) -- node[right=3mm] {$g(v)$} (In-3.south -| In-3.east);
draw[B=mirror] % draw mirrored brace
(In-1.north -| In-1.west) -- node[left=3mm] {$mathcal{K}=U*V*W$} (In-3.south -| In-3.west) ;
end{scope}
end{tikzpicture}
end{figure}
end{document}
in above mwe are:
- used recent syntax for defining nodes and other elements style (
tikzstyle
is obsolete, you should usetizset
or as is used in mwe as options oftikzpicture
) - libraries should be loaded in document preamble
- never use names as
node
, which is already used as one of key element of thetikz
- it is sensible to define the common style for braces
result is:
Are your four remarks already considered in your example? Since I'm not an expert, I find it hard to see that for myself.
– Samuel
Dec 14 at 17:39
@Samuel, yes. i have considered. compare your mwe and mine. you will observe difference. anyway, i will add comments to my code, which will emphasize those remarks (asap).
– Zarko
Dec 14 at 17:45
add a comment |
You can draw this scheme with two matrix of math nodes
delimited by braces and two labels for left and right text:
documentclass[tikz,border=2mm]{standalone}
usetikzlibrary{positioning, matrix}
begin{document}
begin{tikzpicture}[%
ball/.style={circle, minimum size=6mm, inner sep=0pt, draw},
vector/.style={%
matrix of math nodes, inner sep=0pt,
row sep=2pt, nodes={ball, anchor=center},
left delimiter={, right delimiter =}}
]
matrix[vector,
label={[label distance=3mm]left:{$v$}},
label={[label distance=3mm]right:{$g(v)$}}] (v1)
{w_1\w_2\w_3\};
matrix[vector,
label={[label distance=3mm]left:{$mathcal{K}=U*V*W$}},
label={[label distance=3mm]right:{$g(v)$}}, below=3mm of v1] (v2)
{u_1\u_2\u_3\};
end{tikzpicture}
end{document}
add a comment |
Thanks for adding a sketch. I take that you want to draw the braces with TikZ methods. Other than that, what you have looks like an equation, where you can use align
to aliggn stuff. I left it in a figure environment.
documentclass[a4paper]{article}
usepackage{tikz}
usepackage{amsmath}
usetikzlibrary{positioning, decorations.pathreplacing}
tikzset{pics/.cd,
multidot/.style n args={2}{code={
foreach X in {1,...,#1}
{
node[circle,draw,minimum size=nodesize] (aux-X) at (0,{(#1/2+1/2-X)*9mm}){$#2_{X}$};}
draw[thick,decorate,decoration={brace,raise=5pt,amplitude=3mm}] (aux-1.north east) -- (aux-#1.south
east);
draw[thick,decorate,decoration={brace,raise=5pt,amplitude=3mm}] (aux-#1.south west) -- (aux-1.north
west);
}}}
begin{document}
defnodesize{7mm}
begin{figure}[h]
begin{align*}
v&,vcenter{hbox{tikz{pic{multidot={3}{w}}}}},g(v)\
mathcal{K}=U*V*W&,vcenter{hbox{tikz{pic{multidot={3}{u}}}}},g(v)
end{align*}
end{figure}
end{document}
add a comment |
Edit: Some corrections after the clarification of the OP.
documentclass{article}
usepackage{tikz}
usetikzlibrary{chains, positioning, decorations.pathreplacing}
defilsize{3}
defnodesize{6mm}
tikzset{>=latex}
begin{document}
begin{figure}[h]
centering
begin{tikzpicture}[shorten >=0pt, ->, draw=black!100]
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
node[input node] (In-name) at (0.0cm,-y cm) {$w_{y}$};
% Labels %
draw[-, decoration={brace,raise=6pt,amplitude=3mm}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,right=3mm, xshift=5] {$g(v)$};
draw[-, decoration={brace,raise=6pt,amplitude=3mm, mirror}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,left=3mm, xshift=-5] {$v$};
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
pgfmathparse{y+3}
node[input node] (In-name) at (0.0cm,-pgfmathresult cm) {$u_{y}$};
% Labels %
draw[-, decoration={brace,raise=6pt,amplitude=3mm}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,right=3mm, xshift=5] {$g(v)$};
draw[-, decoration={brace, raise=6pt, amplitude=3mm, mirror}, decorate, xshift=0mm, yshift=0mm]
(In-1.north) -- (In-3.south) node[black,midway,left=3mm, xshift=-5] {$mathcal{K}=U*V*W$};
end{tikzpicture}
end{figure}
end{document}
Much better! I added a sketch that shows what I meant with aligned brackets. Maybe you can add that too?
– Samuel
Dec 14 at 9:37
@Samuel you already got better answers, but nevertheless I wanted to correct the code to suit the given task.
– Sito
Dec 14 at 11:43
add a comment |
I couldn't resist doing it in two lines of code:
documentclass[a4paper]{article}
usepackage{tikz,amsmath}
begin{document}
newcommand{wcir}[1]{tikz{node[draw,circle,minimum size=6mm,inner sep=0]{$#1$};}}
begin{align*}
v &begin{Bmatrix}wcir{w_1}\wcir{w_2}\wcir{w_3}end{Bmatrix} g(v) \
mathcal{K} = U*V*W &begin{Bmatrix}wcir{w_1}\wcir{w_2}\wcir{w_3}end{Bmatrix} g(v)
end{align*}
end{document}
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2f464809%2ftikz-alligning-two-tikz-pictures-and-align-parentheses-to-nodes%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
as i mentioned, merging bot tikzpicture
s in one enable better controlling their elements positions:
edit:
position of braces are corrected acoording to new explanation in question
documentclass[a4paper]{article}
usepackage{tikz}
usetikzlibrary{decorations.pathreplacing} % tikz library should be here, in preamble
begin{document}
begin{figure}[htb]
centering
defilsize{3}
defnodesize{6mm}
begin{tikzpicture}[
B/.style = {% common "universal" style for all braces
decoration={brace, amplitude=3mm,#1},% #1 is for mirroring, when necessary
decorate},
B/.default = , % default braces are not mirrored
circ/.style = {% style name, which is not used by tikz
circle, draw, minimum size=nodesize, inner sep=0pt},
]
% Nodes
foreach name / y in {1,...,ilsize}
node[circ] (In-name) at (0,-y) {$w_{y}$};
% Labels
draw[B]
(In-1.north -| In-1.east) -- node[right=3mm] {$g(v)$} (In-3.south -| In-3.east);
draw[B=mirror]
(In-1.north -| In-1.west) -- node[left=3mm] {$v$} (In-3.south -| In-3.west) ;
begin{scope}[yshift=-31mm]
% Nodes
foreach name / y in {1,...,ilsize}
node[circ] (In-name) at (0,-y) {$w_{y}$};
% Labels %
draw[B] % draw brace
(In-1.north -| In-1.east) -- node[right=3mm] {$g(v)$} (In-3.south -| In-3.east);
draw[B=mirror] % draw mirrored brace
(In-1.north -| In-1.west) -- node[left=3mm] {$mathcal{K}=U*V*W$} (In-3.south -| In-3.west) ;
end{scope}
end{tikzpicture}
end{figure}
end{document}
in above mwe are:
- used recent syntax for defining nodes and other elements style (
tikzstyle
is obsolete, you should usetizset
or as is used in mwe as options oftikzpicture
) - libraries should be loaded in document preamble
- never use names as
node
, which is already used as one of key element of thetikz
- it is sensible to define the common style for braces
result is:
Are your four remarks already considered in your example? Since I'm not an expert, I find it hard to see that for myself.
– Samuel
Dec 14 at 17:39
@Samuel, yes. i have considered. compare your mwe and mine. you will observe difference. anyway, i will add comments to my code, which will emphasize those remarks (asap).
– Zarko
Dec 14 at 17:45
add a comment |
as i mentioned, merging bot tikzpicture
s in one enable better controlling their elements positions:
edit:
position of braces are corrected acoording to new explanation in question
documentclass[a4paper]{article}
usepackage{tikz}
usetikzlibrary{decorations.pathreplacing} % tikz library should be here, in preamble
begin{document}
begin{figure}[htb]
centering
defilsize{3}
defnodesize{6mm}
begin{tikzpicture}[
B/.style = {% common "universal" style for all braces
decoration={brace, amplitude=3mm,#1},% #1 is for mirroring, when necessary
decorate},
B/.default = , % default braces are not mirrored
circ/.style = {% style name, which is not used by tikz
circle, draw, minimum size=nodesize, inner sep=0pt},
]
% Nodes
foreach name / y in {1,...,ilsize}
node[circ] (In-name) at (0,-y) {$w_{y}$};
% Labels
draw[B]
(In-1.north -| In-1.east) -- node[right=3mm] {$g(v)$} (In-3.south -| In-3.east);
draw[B=mirror]
(In-1.north -| In-1.west) -- node[left=3mm] {$v$} (In-3.south -| In-3.west) ;
begin{scope}[yshift=-31mm]
% Nodes
foreach name / y in {1,...,ilsize}
node[circ] (In-name) at (0,-y) {$w_{y}$};
% Labels %
draw[B] % draw brace
(In-1.north -| In-1.east) -- node[right=3mm] {$g(v)$} (In-3.south -| In-3.east);
draw[B=mirror] % draw mirrored brace
(In-1.north -| In-1.west) -- node[left=3mm] {$mathcal{K}=U*V*W$} (In-3.south -| In-3.west) ;
end{scope}
end{tikzpicture}
end{figure}
end{document}
in above mwe are:
- used recent syntax for defining nodes and other elements style (
tikzstyle
is obsolete, you should usetizset
or as is used in mwe as options oftikzpicture
) - libraries should be loaded in document preamble
- never use names as
node
, which is already used as one of key element of thetikz
- it is sensible to define the common style for braces
result is:
Are your four remarks already considered in your example? Since I'm not an expert, I find it hard to see that for myself.
– Samuel
Dec 14 at 17:39
@Samuel, yes. i have considered. compare your mwe and mine. you will observe difference. anyway, i will add comments to my code, which will emphasize those remarks (asap).
– Zarko
Dec 14 at 17:45
add a comment |
as i mentioned, merging bot tikzpicture
s in one enable better controlling their elements positions:
edit:
position of braces are corrected acoording to new explanation in question
documentclass[a4paper]{article}
usepackage{tikz}
usetikzlibrary{decorations.pathreplacing} % tikz library should be here, in preamble
begin{document}
begin{figure}[htb]
centering
defilsize{3}
defnodesize{6mm}
begin{tikzpicture}[
B/.style = {% common "universal" style for all braces
decoration={brace, amplitude=3mm,#1},% #1 is for mirroring, when necessary
decorate},
B/.default = , % default braces are not mirrored
circ/.style = {% style name, which is not used by tikz
circle, draw, minimum size=nodesize, inner sep=0pt},
]
% Nodes
foreach name / y in {1,...,ilsize}
node[circ] (In-name) at (0,-y) {$w_{y}$};
% Labels
draw[B]
(In-1.north -| In-1.east) -- node[right=3mm] {$g(v)$} (In-3.south -| In-3.east);
draw[B=mirror]
(In-1.north -| In-1.west) -- node[left=3mm] {$v$} (In-3.south -| In-3.west) ;
begin{scope}[yshift=-31mm]
% Nodes
foreach name / y in {1,...,ilsize}
node[circ] (In-name) at (0,-y) {$w_{y}$};
% Labels %
draw[B] % draw brace
(In-1.north -| In-1.east) -- node[right=3mm] {$g(v)$} (In-3.south -| In-3.east);
draw[B=mirror] % draw mirrored brace
(In-1.north -| In-1.west) -- node[left=3mm] {$mathcal{K}=U*V*W$} (In-3.south -| In-3.west) ;
end{scope}
end{tikzpicture}
end{figure}
end{document}
in above mwe are:
- used recent syntax for defining nodes and other elements style (
tikzstyle
is obsolete, you should usetizset
or as is used in mwe as options oftikzpicture
) - libraries should be loaded in document preamble
- never use names as
node
, which is already used as one of key element of thetikz
- it is sensible to define the common style for braces
result is:
as i mentioned, merging bot tikzpicture
s in one enable better controlling their elements positions:
edit:
position of braces are corrected acoording to new explanation in question
documentclass[a4paper]{article}
usepackage{tikz}
usetikzlibrary{decorations.pathreplacing} % tikz library should be here, in preamble
begin{document}
begin{figure}[htb]
centering
defilsize{3}
defnodesize{6mm}
begin{tikzpicture}[
B/.style = {% common "universal" style for all braces
decoration={brace, amplitude=3mm,#1},% #1 is for mirroring, when necessary
decorate},
B/.default = , % default braces are not mirrored
circ/.style = {% style name, which is not used by tikz
circle, draw, minimum size=nodesize, inner sep=0pt},
]
% Nodes
foreach name / y in {1,...,ilsize}
node[circ] (In-name) at (0,-y) {$w_{y}$};
% Labels
draw[B]
(In-1.north -| In-1.east) -- node[right=3mm] {$g(v)$} (In-3.south -| In-3.east);
draw[B=mirror]
(In-1.north -| In-1.west) -- node[left=3mm] {$v$} (In-3.south -| In-3.west) ;
begin{scope}[yshift=-31mm]
% Nodes
foreach name / y in {1,...,ilsize}
node[circ] (In-name) at (0,-y) {$w_{y}$};
% Labels %
draw[B] % draw brace
(In-1.north -| In-1.east) -- node[right=3mm] {$g(v)$} (In-3.south -| In-3.east);
draw[B=mirror] % draw mirrored brace
(In-1.north -| In-1.west) -- node[left=3mm] {$mathcal{K}=U*V*W$} (In-3.south -| In-3.west) ;
end{scope}
end{tikzpicture}
end{figure}
end{document}
in above mwe are:
- used recent syntax for defining nodes and other elements style (
tikzstyle
is obsolete, you should usetizset
or as is used in mwe as options oftikzpicture
) - libraries should be loaded in document preamble
- never use names as
node
, which is already used as one of key element of thetikz
- it is sensible to define the common style for braces
result is:
edited Dec 14 at 17:48
answered Dec 14 at 9:33
Zarko
120k865156
120k865156
Are your four remarks already considered in your example? Since I'm not an expert, I find it hard to see that for myself.
– Samuel
Dec 14 at 17:39
@Samuel, yes. i have considered. compare your mwe and mine. you will observe difference. anyway, i will add comments to my code, which will emphasize those remarks (asap).
– Zarko
Dec 14 at 17:45
add a comment |
Are your four remarks already considered in your example? Since I'm not an expert, I find it hard to see that for myself.
– Samuel
Dec 14 at 17:39
@Samuel, yes. i have considered. compare your mwe and mine. you will observe difference. anyway, i will add comments to my code, which will emphasize those remarks (asap).
– Zarko
Dec 14 at 17:45
Are your four remarks already considered in your example? Since I'm not an expert, I find it hard to see that for myself.
– Samuel
Dec 14 at 17:39
Are your four remarks already considered in your example? Since I'm not an expert, I find it hard to see that for myself.
– Samuel
Dec 14 at 17:39
@Samuel, yes. i have considered. compare your mwe and mine. you will observe difference. anyway, i will add comments to my code, which will emphasize those remarks (asap).
– Zarko
Dec 14 at 17:45
@Samuel, yes. i have considered. compare your mwe and mine. you will observe difference. anyway, i will add comments to my code, which will emphasize those remarks (asap).
– Zarko
Dec 14 at 17:45
add a comment |
You can draw this scheme with two matrix of math nodes
delimited by braces and two labels for left and right text:
documentclass[tikz,border=2mm]{standalone}
usetikzlibrary{positioning, matrix}
begin{document}
begin{tikzpicture}[%
ball/.style={circle, minimum size=6mm, inner sep=0pt, draw},
vector/.style={%
matrix of math nodes, inner sep=0pt,
row sep=2pt, nodes={ball, anchor=center},
left delimiter={, right delimiter =}}
]
matrix[vector,
label={[label distance=3mm]left:{$v$}},
label={[label distance=3mm]right:{$g(v)$}}] (v1)
{w_1\w_2\w_3\};
matrix[vector,
label={[label distance=3mm]left:{$mathcal{K}=U*V*W$}},
label={[label distance=3mm]right:{$g(v)$}}, below=3mm of v1] (v2)
{u_1\u_2\u_3\};
end{tikzpicture}
end{document}
add a comment |
You can draw this scheme with two matrix of math nodes
delimited by braces and two labels for left and right text:
documentclass[tikz,border=2mm]{standalone}
usetikzlibrary{positioning, matrix}
begin{document}
begin{tikzpicture}[%
ball/.style={circle, minimum size=6mm, inner sep=0pt, draw},
vector/.style={%
matrix of math nodes, inner sep=0pt,
row sep=2pt, nodes={ball, anchor=center},
left delimiter={, right delimiter =}}
]
matrix[vector,
label={[label distance=3mm]left:{$v$}},
label={[label distance=3mm]right:{$g(v)$}}] (v1)
{w_1\w_2\w_3\};
matrix[vector,
label={[label distance=3mm]left:{$mathcal{K}=U*V*W$}},
label={[label distance=3mm]right:{$g(v)$}}, below=3mm of v1] (v2)
{u_1\u_2\u_3\};
end{tikzpicture}
end{document}
add a comment |
You can draw this scheme with two matrix of math nodes
delimited by braces and two labels for left and right text:
documentclass[tikz,border=2mm]{standalone}
usetikzlibrary{positioning, matrix}
begin{document}
begin{tikzpicture}[%
ball/.style={circle, minimum size=6mm, inner sep=0pt, draw},
vector/.style={%
matrix of math nodes, inner sep=0pt,
row sep=2pt, nodes={ball, anchor=center},
left delimiter={, right delimiter =}}
]
matrix[vector,
label={[label distance=3mm]left:{$v$}},
label={[label distance=3mm]right:{$g(v)$}}] (v1)
{w_1\w_2\w_3\};
matrix[vector,
label={[label distance=3mm]left:{$mathcal{K}=U*V*W$}},
label={[label distance=3mm]right:{$g(v)$}}, below=3mm of v1] (v2)
{u_1\u_2\u_3\};
end{tikzpicture}
end{document}
You can draw this scheme with two matrix of math nodes
delimited by braces and two labels for left and right text:
documentclass[tikz,border=2mm]{standalone}
usetikzlibrary{positioning, matrix}
begin{document}
begin{tikzpicture}[%
ball/.style={circle, minimum size=6mm, inner sep=0pt, draw},
vector/.style={%
matrix of math nodes, inner sep=0pt,
row sep=2pt, nodes={ball, anchor=center},
left delimiter={, right delimiter =}}
]
matrix[vector,
label={[label distance=3mm]left:{$v$}},
label={[label distance=3mm]right:{$g(v)$}}] (v1)
{w_1\w_2\w_3\};
matrix[vector,
label={[label distance=3mm]left:{$mathcal{K}=U*V*W$}},
label={[label distance=3mm]right:{$g(v)$}}, below=3mm of v1] (v2)
{u_1\u_2\u_3\};
end{tikzpicture}
end{document}
answered Dec 14 at 10:53
Ignasi
91.5k4165303
91.5k4165303
add a comment |
add a comment |
Thanks for adding a sketch. I take that you want to draw the braces with TikZ methods. Other than that, what you have looks like an equation, where you can use align
to aliggn stuff. I left it in a figure environment.
documentclass[a4paper]{article}
usepackage{tikz}
usepackage{amsmath}
usetikzlibrary{positioning, decorations.pathreplacing}
tikzset{pics/.cd,
multidot/.style n args={2}{code={
foreach X in {1,...,#1}
{
node[circle,draw,minimum size=nodesize] (aux-X) at (0,{(#1/2+1/2-X)*9mm}){$#2_{X}$};}
draw[thick,decorate,decoration={brace,raise=5pt,amplitude=3mm}] (aux-1.north east) -- (aux-#1.south
east);
draw[thick,decorate,decoration={brace,raise=5pt,amplitude=3mm}] (aux-#1.south west) -- (aux-1.north
west);
}}}
begin{document}
defnodesize{7mm}
begin{figure}[h]
begin{align*}
v&,vcenter{hbox{tikz{pic{multidot={3}{w}}}}},g(v)\
mathcal{K}=U*V*W&,vcenter{hbox{tikz{pic{multidot={3}{u}}}}},g(v)
end{align*}
end{figure}
end{document}
add a comment |
Thanks for adding a sketch. I take that you want to draw the braces with TikZ methods. Other than that, what you have looks like an equation, where you can use align
to aliggn stuff. I left it in a figure environment.
documentclass[a4paper]{article}
usepackage{tikz}
usepackage{amsmath}
usetikzlibrary{positioning, decorations.pathreplacing}
tikzset{pics/.cd,
multidot/.style n args={2}{code={
foreach X in {1,...,#1}
{
node[circle,draw,minimum size=nodesize] (aux-X) at (0,{(#1/2+1/2-X)*9mm}){$#2_{X}$};}
draw[thick,decorate,decoration={brace,raise=5pt,amplitude=3mm}] (aux-1.north east) -- (aux-#1.south
east);
draw[thick,decorate,decoration={brace,raise=5pt,amplitude=3mm}] (aux-#1.south west) -- (aux-1.north
west);
}}}
begin{document}
defnodesize{7mm}
begin{figure}[h]
begin{align*}
v&,vcenter{hbox{tikz{pic{multidot={3}{w}}}}},g(v)\
mathcal{K}=U*V*W&,vcenter{hbox{tikz{pic{multidot={3}{u}}}}},g(v)
end{align*}
end{figure}
end{document}
add a comment |
Thanks for adding a sketch. I take that you want to draw the braces with TikZ methods. Other than that, what you have looks like an equation, where you can use align
to aliggn stuff. I left it in a figure environment.
documentclass[a4paper]{article}
usepackage{tikz}
usepackage{amsmath}
usetikzlibrary{positioning, decorations.pathreplacing}
tikzset{pics/.cd,
multidot/.style n args={2}{code={
foreach X in {1,...,#1}
{
node[circle,draw,minimum size=nodesize] (aux-X) at (0,{(#1/2+1/2-X)*9mm}){$#2_{X}$};}
draw[thick,decorate,decoration={brace,raise=5pt,amplitude=3mm}] (aux-1.north east) -- (aux-#1.south
east);
draw[thick,decorate,decoration={brace,raise=5pt,amplitude=3mm}] (aux-#1.south west) -- (aux-1.north
west);
}}}
begin{document}
defnodesize{7mm}
begin{figure}[h]
begin{align*}
v&,vcenter{hbox{tikz{pic{multidot={3}{w}}}}},g(v)\
mathcal{K}=U*V*W&,vcenter{hbox{tikz{pic{multidot={3}{u}}}}},g(v)
end{align*}
end{figure}
end{document}
Thanks for adding a sketch. I take that you want to draw the braces with TikZ methods. Other than that, what you have looks like an equation, where you can use align
to aliggn stuff. I left it in a figure environment.
documentclass[a4paper]{article}
usepackage{tikz}
usepackage{amsmath}
usetikzlibrary{positioning, decorations.pathreplacing}
tikzset{pics/.cd,
multidot/.style n args={2}{code={
foreach X in {1,...,#1}
{
node[circle,draw,minimum size=nodesize] (aux-X) at (0,{(#1/2+1/2-X)*9mm}){$#2_{X}$};}
draw[thick,decorate,decoration={brace,raise=5pt,amplitude=3mm}] (aux-1.north east) -- (aux-#1.south
east);
draw[thick,decorate,decoration={brace,raise=5pt,amplitude=3mm}] (aux-#1.south west) -- (aux-1.north
west);
}}}
begin{document}
defnodesize{7mm}
begin{figure}[h]
begin{align*}
v&,vcenter{hbox{tikz{pic{multidot={3}{w}}}}},g(v)\
mathcal{K}=U*V*W&,vcenter{hbox{tikz{pic{multidot={3}{u}}}}},g(v)
end{align*}
end{figure}
end{document}
answered Dec 14 at 10:04
marmot
85.9k499183
85.9k499183
add a comment |
add a comment |
Edit: Some corrections after the clarification of the OP.
documentclass{article}
usepackage{tikz}
usetikzlibrary{chains, positioning, decorations.pathreplacing}
defilsize{3}
defnodesize{6mm}
tikzset{>=latex}
begin{document}
begin{figure}[h]
centering
begin{tikzpicture}[shorten >=0pt, ->, draw=black!100]
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
node[input node] (In-name) at (0.0cm,-y cm) {$w_{y}$};
% Labels %
draw[-, decoration={brace,raise=6pt,amplitude=3mm}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,right=3mm, xshift=5] {$g(v)$};
draw[-, decoration={brace,raise=6pt,amplitude=3mm, mirror}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,left=3mm, xshift=-5] {$v$};
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
pgfmathparse{y+3}
node[input node] (In-name) at (0.0cm,-pgfmathresult cm) {$u_{y}$};
% Labels %
draw[-, decoration={brace,raise=6pt,amplitude=3mm}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,right=3mm, xshift=5] {$g(v)$};
draw[-, decoration={brace, raise=6pt, amplitude=3mm, mirror}, decorate, xshift=0mm, yshift=0mm]
(In-1.north) -- (In-3.south) node[black,midway,left=3mm, xshift=-5] {$mathcal{K}=U*V*W$};
end{tikzpicture}
end{figure}
end{document}
Much better! I added a sketch that shows what I meant with aligned brackets. Maybe you can add that too?
– Samuel
Dec 14 at 9:37
@Samuel you already got better answers, but nevertheless I wanted to correct the code to suit the given task.
– Sito
Dec 14 at 11:43
add a comment |
Edit: Some corrections after the clarification of the OP.
documentclass{article}
usepackage{tikz}
usetikzlibrary{chains, positioning, decorations.pathreplacing}
defilsize{3}
defnodesize{6mm}
tikzset{>=latex}
begin{document}
begin{figure}[h]
centering
begin{tikzpicture}[shorten >=0pt, ->, draw=black!100]
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
node[input node] (In-name) at (0.0cm,-y cm) {$w_{y}$};
% Labels %
draw[-, decoration={brace,raise=6pt,amplitude=3mm}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,right=3mm, xshift=5] {$g(v)$};
draw[-, decoration={brace,raise=6pt,amplitude=3mm, mirror}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,left=3mm, xshift=-5] {$v$};
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
pgfmathparse{y+3}
node[input node] (In-name) at (0.0cm,-pgfmathresult cm) {$u_{y}$};
% Labels %
draw[-, decoration={brace,raise=6pt,amplitude=3mm}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,right=3mm, xshift=5] {$g(v)$};
draw[-, decoration={brace, raise=6pt, amplitude=3mm, mirror}, decorate, xshift=0mm, yshift=0mm]
(In-1.north) -- (In-3.south) node[black,midway,left=3mm, xshift=-5] {$mathcal{K}=U*V*W$};
end{tikzpicture}
end{figure}
end{document}
Much better! I added a sketch that shows what I meant with aligned brackets. Maybe you can add that too?
– Samuel
Dec 14 at 9:37
@Samuel you already got better answers, but nevertheless I wanted to correct the code to suit the given task.
– Sito
Dec 14 at 11:43
add a comment |
Edit: Some corrections after the clarification of the OP.
documentclass{article}
usepackage{tikz}
usetikzlibrary{chains, positioning, decorations.pathreplacing}
defilsize{3}
defnodesize{6mm}
tikzset{>=latex}
begin{document}
begin{figure}[h]
centering
begin{tikzpicture}[shorten >=0pt, ->, draw=black!100]
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
node[input node] (In-name) at (0.0cm,-y cm) {$w_{y}$};
% Labels %
draw[-, decoration={brace,raise=6pt,amplitude=3mm}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,right=3mm, xshift=5] {$g(v)$};
draw[-, decoration={brace,raise=6pt,amplitude=3mm, mirror}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,left=3mm, xshift=-5] {$v$};
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
pgfmathparse{y+3}
node[input node] (In-name) at (0.0cm,-pgfmathresult cm) {$u_{y}$};
% Labels %
draw[-, decoration={brace,raise=6pt,amplitude=3mm}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,right=3mm, xshift=5] {$g(v)$};
draw[-, decoration={brace, raise=6pt, amplitude=3mm, mirror}, decorate, xshift=0mm, yshift=0mm]
(In-1.north) -- (In-3.south) node[black,midway,left=3mm, xshift=-5] {$mathcal{K}=U*V*W$};
end{tikzpicture}
end{figure}
end{document}
Edit: Some corrections after the clarification of the OP.
documentclass{article}
usepackage{tikz}
usetikzlibrary{chains, positioning, decorations.pathreplacing}
defilsize{3}
defnodesize{6mm}
tikzset{>=latex}
begin{document}
begin{figure}[h]
centering
begin{tikzpicture}[shorten >=0pt, ->, draw=black!100]
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
node[input node] (In-name) at (0.0cm,-y cm) {$w_{y}$};
% Labels %
draw[-, decoration={brace,raise=6pt,amplitude=3mm}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,right=3mm, xshift=5] {$g(v)$};
draw[-, decoration={brace,raise=6pt,amplitude=3mm, mirror}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,left=3mm, xshift=-5] {$v$};
tikzstyle{every pin edge}=[<-,shorten <=1pt]
tikzstyle{node}=[circle, draw, fill=black!100, minimum size=nodesize,inner sep=0pt]
tikzstyle{input node}=[node, fill=black!0]
% Nodes
foreach name / y in {1,...,ilsize}
pgfmathparse{y+3}
node[input node] (In-name) at (0.0cm,-pgfmathresult cm) {$u_{y}$};
% Labels %
draw[-, decoration={brace,raise=6pt,amplitude=3mm}, decorate]
(In-1.north) -- (In-3.south) node[black,midway,right=3mm, xshift=5] {$g(v)$};
draw[-, decoration={brace, raise=6pt, amplitude=3mm, mirror}, decorate, xshift=0mm, yshift=0mm]
(In-1.north) -- (In-3.south) node[black,midway,left=3mm, xshift=-5] {$mathcal{K}=U*V*W$};
end{tikzpicture}
end{figure}
end{document}
edited Dec 14 at 11:43
answered Dec 14 at 9:33
Sito
32728
32728
Much better! I added a sketch that shows what I meant with aligned brackets. Maybe you can add that too?
– Samuel
Dec 14 at 9:37
@Samuel you already got better answers, but nevertheless I wanted to correct the code to suit the given task.
– Sito
Dec 14 at 11:43
add a comment |
Much better! I added a sketch that shows what I meant with aligned brackets. Maybe you can add that too?
– Samuel
Dec 14 at 9:37
@Samuel you already got better answers, but nevertheless I wanted to correct the code to suit the given task.
– Sito
Dec 14 at 11:43
Much better! I added a sketch that shows what I meant with aligned brackets. Maybe you can add that too?
– Samuel
Dec 14 at 9:37
Much better! I added a sketch that shows what I meant with aligned brackets. Maybe you can add that too?
– Samuel
Dec 14 at 9:37
@Samuel you already got better answers, but nevertheless I wanted to correct the code to suit the given task.
– Sito
Dec 14 at 11:43
@Samuel you already got better answers, but nevertheless I wanted to correct the code to suit the given task.
– Sito
Dec 14 at 11:43
add a comment |
I couldn't resist doing it in two lines of code:
documentclass[a4paper]{article}
usepackage{tikz,amsmath}
begin{document}
newcommand{wcir}[1]{tikz{node[draw,circle,minimum size=6mm,inner sep=0]{$#1$};}}
begin{align*}
v &begin{Bmatrix}wcir{w_1}\wcir{w_2}\wcir{w_3}end{Bmatrix} g(v) \
mathcal{K} = U*V*W &begin{Bmatrix}wcir{w_1}\wcir{w_2}\wcir{w_3}end{Bmatrix} g(v)
end{align*}
end{document}
add a comment |
I couldn't resist doing it in two lines of code:
documentclass[a4paper]{article}
usepackage{tikz,amsmath}
begin{document}
newcommand{wcir}[1]{tikz{node[draw,circle,minimum size=6mm,inner sep=0]{$#1$};}}
begin{align*}
v &begin{Bmatrix}wcir{w_1}\wcir{w_2}\wcir{w_3}end{Bmatrix} g(v) \
mathcal{K} = U*V*W &begin{Bmatrix}wcir{w_1}\wcir{w_2}\wcir{w_3}end{Bmatrix} g(v)
end{align*}
end{document}
add a comment |
I couldn't resist doing it in two lines of code:
documentclass[a4paper]{article}
usepackage{tikz,amsmath}
begin{document}
newcommand{wcir}[1]{tikz{node[draw,circle,minimum size=6mm,inner sep=0]{$#1$};}}
begin{align*}
v &begin{Bmatrix}wcir{w_1}\wcir{w_2}\wcir{w_3}end{Bmatrix} g(v) \
mathcal{K} = U*V*W &begin{Bmatrix}wcir{w_1}\wcir{w_2}\wcir{w_3}end{Bmatrix} g(v)
end{align*}
end{document}
I couldn't resist doing it in two lines of code:
documentclass[a4paper]{article}
usepackage{tikz,amsmath}
begin{document}
newcommand{wcir}[1]{tikz{node[draw,circle,minimum size=6mm,inner sep=0]{$#1$};}}
begin{align*}
v &begin{Bmatrix}wcir{w_1}\wcir{w_2}\wcir{w_3}end{Bmatrix} g(v) \
mathcal{K} = U*V*W &begin{Bmatrix}wcir{w_1}\wcir{w_2}\wcir{w_3}end{Bmatrix} g(v)
end{align*}
end{document}
edited Dec 15 at 3:00
answered Dec 15 at 2:48
AboAmmar
32.7k22882
32.7k22882
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%2f464809%2ftikz-alligning-two-tikz-pictures-and-align-parentheses-to-nodes%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
why you not merge both images in one
tikzpicture
?– Zarko
Dec 14 at 9:13
Could you perhaps add a sketch that illustrates what you want?
– marmot
Dec 14 at 9:25
@Zarko I tried that, but it made things worse. I am not an expert.
– Samuel
Dec 14 at 9:28
@marmot I added a sketch.
– Samuel
Dec 14 at 9:35
@Zarko I added a sketch to show how I want to align the curly brackets using the nodes.
– Samuel
Dec 14 at 9:41