TransWikia.com

Package PGF Math Error: Unknown function `L' (in '-L* 1.9 * 1'). }

TeX - LaTeX Asked by user205772 on April 29, 2021

I am using this code

begin{equation} 
G=begin{matrix}
&  
begin{tikzpicture}
defxs{1} %shift in x direction
defys{0.5} %shift in y direction
defnm{2} % number of 2d matrices in the 3d matrix
foreach x [count = xi] in {L,1}
{
    matrix [matrix of math nodes,left delimiter={[},right delimiter={]},fill=white,ampersand replacement=&] %see explanation
    (mmx)%give the matrix a name
    at(-x * 1.9 * xs, -x * 1.7 * ys) %shift the matrix
    {
        node {g_x}; & node {cdots};&node {g_x};
        node {vdots}; & node {ddots};&node {vdots};
        node { g_x}; & node {cdots};&node {g_x};
    }; 
}
draw [dotted,gray](mm1.north west) -- (mmL.north west);
hspace*{2mm}draw [dotted,gray](mm1.north east) -- (mmL.north east);
hspace*{-2mm}draw [dotted,gray](mm1.south east) -- (mmL.south east);
end{tikzpicture}
end{matrix},
end{equation}

I am getting this error, would you please help me to fix it

One Answer

This fixes the error and a few other things. However, I'd consider the underlying code not really optimal, so on the long run you may want to rewrite it from scratch. Here I am only doing minimal damage.

documentclass{article}
usepackage{tikz}
usetikzlibrary{matrix}
begin{document}
begin{equation} label{3dmatrix}
G^{3D}_{Mtimes Ktimes L}=
begin{tikzpicture}[baseline={(C.base)}]
 defxs{1} %shift in x direction
 defys{0.5} %shift in y direction
 defnm{2} % number of 2d matrices in the 3d matrix
 foreach x [count = xi] in {1,...,nm}
 {
     matrix [matrix of math nodes,left delimiter={[},right delimiter={]},
     fill=white,fill opacity=0.7,text opacity=1,ampersand replacement=&] 
     (mmx)%give the matrix a name
     at(-x * 1.9 * xs, -x * 1.7 * ys) %shift the matrix
     {
         node {g_{1}^{1^{x}}}; & node {cdots};&node {g_{K}^{1^{x}}};
         node {vdots}; & node (c-x) {ddots};&node {vdots};
         node { g_{ 1}^{M^{x}}}; & node {cdots};&node {g_{K}^{M^{x}}};
     }; 
 }
 draw [dotted,gray](mm1.north west) -- (mmnm.north west);
 draw [dotted,gray](mm1.north east) -- (mmnm.north east);
 draw [dotted,gray](mm1.south east) -- (mmnm.south east);
 path (c-1) -- (c-nm) node[midway](C){phantom{C}};
end{tikzpicture}
;,
end{equation}
end{document}

enter image description here

Answered by user194703 on April 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP