0

Could someone please help me to spawn the triangle in next document to all three rows ? All my tries with \multirow fails.

\documentclass{article}

\usepackage[utf8]{inputenc} % accents
\usepackage{verbatim} % \comment
\usepackage{amsmath,amssymb}
\usepackage{bm} % bold math
\usepackage{multirow,tabularx}
\usepackage{array}   % \newcolumntype 
\newcolumntype{x}[1]{ >{} m{#1} <{} }
\newcolumntype{X}[1]{ >{\[} m{#1} <{\]} }
%\newcolumntype{A}{>{$\begin{aligned}}c{\end{aligned}$}}
\usepackage{tikz}
\usetikzlibrary{angles,quotes}

\tikzstyle{ciangle}=[
    every pic quotes/.append style={text=cyan},
    draw=cyan,
    angle radius=1cm,
  ]
\tikzstyle{sqangle}=[
    every pic quotes/.append style={text=cyan},
    draw=cyan,
    angle radius=1cm,
  ]

\newcommand{\DrawTriangle}[4]{% 
\begin{tikzpicture}  
  \coordinate (A) at (-1.5,-1);
  \coordinate (C) at (1.5,-1);
  \coordinate (B) at (1.5,1);
  \draw (C) -- node[right] {#1} (B) -- node[above] {#3} (A) -- node[below] {#2} (C);
  \pic [ciangle, "#4"] {angle=C--A--B};
%  \pic [ciangle, "#5"] {angle=A--B--C};
  \draw [sqangle](C) rectangle ++(-0.5,0.5);
\end{tikzpicture}
}

\begin{document}


\begin{tabular}{x{3cm} X{1cm}}
\DrawTriangle{$a$}{$b$}{$c$}{$\alpha$} & \textit{sen}(\alpha)=\frac{a}{c} \\
& \textit{cos}(\alpha)=\frac{b}{c} \\
& \textit{tan}(\alpha)=\frac{a}{b}=\frac{\textit{sin}(\alpha)}{\textit{cos}(\alpha)} \\
\end{tabular} 

\end{document}

enter image description here

Another example is:

\documentclass{article}

\usepackage[utf8]{inputenc} % accents
\usepackage{verbatim} % \comment
\usepackage{amsmath,amssymb}
\usepackage{bm} % bold math
\usepackage{array}   % \newcolumntype 
\newcolumntype{x}[1]{ >{} m{#1} <{} }
\newcolumntype{X}[1]{ >{\[} m{#1} <{\]} }
\usepackage{tikz}
\usetikzlibrary{angles,quotes}

\tikzstyle{ciangle}=[
    every pic quotes/.append style={text=cyan},
    draw=cyan,
    angle radius=0.75cm,
  ]
\tikzstyle{sqangle}=[
    every pic quotes/.append style={text=cyan},
    draw=cyan,
  ]

\newcommand{\DrawTriangle}[4]{% 
\begin{tikzpicture}[scale=0.5]
  \coordinate (A) at (-1.5,-1);
  \coordinate (C) at (1.5,-1);
  \coordinate (B) at (1.5,1);
  \draw [sqangle](C) rectangle ++(-0.5,0.5);
  \draw (C) -- node[right] {#1} (B) -- node[above] {#3} (A) -- node[below] {#2} (C);
  \pic [ciangle, "#4"] {angle=C--A--B};
%  \pic [ciangle, "#5"] {angle=A--B--C};
\end{tikzpicture}
}

\begin{document}

\begin{tabular}{|x{4cm}|x{2cm}|x{3cm}|}
\hline 
Conocemos la longitud de dos lados, buscamos la longitud del tercer lado. & \DrawTriangle{$a$}{$b$}{$c?$}{}{} & Teorema Pitagoras \newline $ c^2=a^2+b^2 $ \\
 & \DrawTriangle{$a?$}{$b$}{$c$}{} &  \\ 
 & \DrawTriangle{$a$}{$b?$}{$c$}{} &  \\
\hline 
\end{tabular} 

\end{document}

enter image description here

1

enter image description here

\documentclass{article}

\usepackage[utf8]{inputenc} % accents
\usepackage{verbatim} % \comment
\usepackage{amsmath,amssymb}
\usepackage{bm} % bold math
\usepackage{array}   % \newcolumntype 
\newcolumntype{x}[1]{ >{} m{#1} <{} }
%\newcolumntype{A}{>{$\begin{aligned}}c{\end{aligned}$}}
\usepackage{tikz}
\usetikzlibrary{angles,quotes}

\tikzstyle{ciangle}=[
    every pic quotes/.append style={text=cyan},
    draw=cyan,
    angle radius=1cm,
  ]
\tikzstyle{sqangle}=[
    every pic quotes/.append style={text=cyan},
    draw=cyan,
    angle radius=1cm,
  ]

\newcommand{\DrawTriangle}[4]{% 
\begin{tikzpicture}  
  \coordinate (A) at (-1.5,-1);
  \coordinate (C) at (1.5,-1);
  \coordinate (B) at (1.5,1);
  \draw (C) -- node[right] {#1} (B) -- node[above] {#3} (A) -- node[below] {#2} (C);
  \pic [ciangle, "#4"] {angle=C--A--B};
%  \pic [ciangle, "#5"] {angle=A--B--C};
  \draw [sqangle](C) rectangle ++(-0.5,0.5);
\end{tikzpicture}
}

\begin{document}


\begin{tabular}{x{3cm} x{2cm}}
\DrawTriangle{$a$}{$b$}{$c$}{$\alpha$} &
$\textit{sen}(\alpha)=\frac{a}{c}$% why \textit?

$\textit{cos}(\alpha)=\frac{b}{c}$

$\textit{tan}(\alpha)=\frac{a}{b}=\frac{\textit{sin}(\alpha)}{\textit{cos}(\alpha)} $
\end{tabular} 

\end{document}

The second column needs to be wider to show the tan line without wrapping, I made it 2cm instead of 1cm but I don't know how much space you have in your real document so I didn't go wider.

You were not using tabularx but had loaded the package note that if you load tabularx but define your own X column type tabularx will not work without making some internal re-definitions.

  • Thanks for your answer. If I understand it, you are grouping all mathematic expressions on a single cell. I think I need a solution based on rowspan. I've edited the original question with a second example. – pasaba por aqui Feb 24 '18 at 13:24
  • @pasabaporaqui the second example is no different again I would just use a single row table, with a paragraph of text in columns 1 and 3 and the diagrams in columns 2. – David Carlisle Feb 24 '18 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.