TeX - LaTeX Asked on May 15, 2021
I have a strange vertical skip in a tikz
matrix node
within the first column I can not figure out how to eliminate:
MWE
documentclass{article}
usepackage{tikz}
usetikzlibrary{matrix}
begin{document}
begin{tikzpicture}[xshift=1.75cm,yshift=3pt,
table/.style={
matrix of nodes, row sep=-pgflinewidth, column sep=-pgflinewidth,
nodes={rectangle,align=left,draw=black,font=scriptsize,
minimum height=1.5em,
text depth=0.5ex,
text height=2ex},
nodes in empty cells,
column 1/.style={text width=0.46textwidth},
column 2/.style={text width=0.05textwidth},
column 3/.style={text width=0.05textwidth},
column 4/.style={text width=0.30textwidth},
column 5/.style={text width=0.05textwidth},
column 6/.style={text width=0.05textwidth}
}]
node[matrix,table,anchor=north west] (first) at (0.5,4)
{
Endogenes Konstrukt & $ R^2 $ & $ Q^2 $ & Exogene(s) Konstrukt(e) & $f^2$ & $VIF$
(KB) & 0,34 & 0,30 & (GA) & 0,53 & -
};
end{tikzpicture}
end{document}
Any help is highly appreciated!
Just avoid CR between lines in your matrix. Or at least, use %
for it not to be taken care.
documentclass{article}
usepackage{tikz}
usetikzlibrary{matrix}
begin{document}
begin{tikzpicture}[xshift=1.75cm,yshift=3pt,
table/.style={
matrix of nodes, row sep=-pgflinewidth, column sep=-pgflinewidth,
nodes={rectangle,align=left,draw=black,font=scriptsize,
minimum height=1.5em,
text depth=0.5ex,
text height=2ex},
nodes in empty cells,
column 1/.style={text width=0.46textwidth},
column 2/.style={text width=0.05textwidth},
column 3/.style={text width=0.05textwidth},
column 4/.style={text width=0.30textwidth},
column 5/.style={text width=0.05textwidth},
column 6/.style={text width=0.05textwidth}
}]
node[matrix,table,anchor=north west] (first) at (0.5,4)
{
Endogenes Konstrukt & $ R^2 $ & $ Q^2 $ & Exogene(s) Konstrukt(e) & $f^2$ & $VIF$
(KB) & 0,34 & 0,30 & (GA) & 0,53 & -
};
end{tikzpicture}
end{document}
Correct answer by SebGlav on May 15, 2021
I would modified your MWE as follows:
documentclass{article}
usepackage{tikz}
usetikzlibrary{matrix}
%---------------- show page layout. don't use in a real document!
usepackage{showframe}
renewcommandShowFrameLinethickness{0.15pt}
renewcommand*ShowFrameColor{color{red}}
%---------------------------------------------------------------%
begin{document}
noindentbegin{tikzpicture}[
table/.style={
matrix of nodes,
nodes={minimum height=1.5em, text depth=0.5ex, text width=0.05textwidth,
inner xsep=0.005textwidth, outer sep=0pt, anchor=center,
draw, font=scriptsize, align=left},
nodes in empty cells,
inner sep=0pt, outer sep=0pt,
column sep=-pgflinewidth,
row sep=-pgflinewidth,
column 1/.style={nodes={text width=0.44textwidth}},
column 4/.style={nodes={text width=0.30textwidth}},
}]
matrix[table] (first)
{
Endogenes Konstrukt & $R^2$ & $Q^2$ & Exogene(s) Konstrukt(e) & $f^2$ & $VIF$
(KB) & 0,34 & 0,30 & (GA) & 0,53 & --
};
end{tikzpicture}
end{document}
Observe differences in:
Red lines in above image are added that matrix position in page is simpler to see.
Answered by Zarko on May 15, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP