
Há muito tempo que enfrento esse problema com projetores e colunas, por que as duas colunas não estão alinhadas?
\documentclass{beamer}
\usepackage{xcolor}
\definecolor{lava}{rgb}{0.81, 0.06, 0.13}
\definecolor{myblue}{rgb}{0.0, 0.30, 0.60}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{frame}{xxxxx}
\underline{\textbf{Example}}
\begin{itemize}
\item[$\rightarrow$] Let's consider two systems of linear equations that correspond to the same coefficient matrix $\mathbf{A}$
\end{itemize}
\begin{columns}[T,onlytextwidth]
\begin{column}{.5\textwidth}
\begin{center}
\begin{tikzpicture}[>=stealth,thick,baseline]
\tikzstyle{column 8}=[myblue]
\matrix [matrix of math nodes,ampersand replacement=\&](A){
\& 3 x_1 \&+\& 5x_2 \& -\&4x_3 \& =\& 7\\
-\& 3 x_1 \& -\&2x_2 \& +\&4x_3 \& =\& -1\\
\& 6 x_1 \& +\&x_2 \& -\&8x_3 \& = \& -4\\
};
\end{tikzpicture}
\end{center}
\end{column}
\begin{column}{.5\textwidth}
\begin{tikzpicture}[>=stealth,thick,baseline]
\tikzstyle{column 5}=[myblue]
\matrix [matrix of math nodes,ampersand replacement=\&](A){
\& 3 x_1 \&+\& 5x_2 \& -\&4x_3 \& =\& 7\\
-\& 3 x_1 \& -\&2x_2 \& +\&4x_3 \& =\& -1\\
\& 6 x_1 \& +\&x_2 \& -\&8x_3 \& = \& -4\\
};
\end{tikzpicture}
\end{column}
\end{columns}
\end{frame}
\end{document}
Responder1
Eu removi o center
-environment na primeira coluna. Agora as duas colunas estão perfeitamente alinhadas.
\documentclass{beamer}
\usepackage{xcolor}
\definecolor{lava}{rgb}{0.81, 0.06, 0.13}
\definecolor{myblue}{rgb}{0.0, 0.30, 0.60}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{frame}{xxxxx}
\underline{\textbf{Example}}
\begin{itemize}
\item[$\rightarrow$] Let's consider two systems of linear equations that correspond to the same coefficient matrix $\mathbf{A}$
\end{itemize}
\begin{columns}[T,onlytextwidth]
\begin{column}{.5\textwidth}
\begin{tikzpicture}[>=stealth,thick,baseline]
\tikzstyle{column 8}=[myblue]
\matrix [matrix of math nodes,ampersand replacement=\&](A){
\& 3 x_1 \&+\& 5x_2 \& -\&4x_3 \& =\& 7\\
-\& 3 x_1 \& -\&2x_2 \& +\&4x_3 \& =\& -1\\
\& 6 x_1 \& +\&x_2 \& -\&8x_3 \& = \& -4\\
};
\end{tikzpicture}
\end{column}
\begin{column}{.5\textwidth}
\begin{tikzpicture}[>=stealth,thick,baseline]
\tikzstyle{column 5}=[myblue]
\matrix [matrix of math nodes,ampersand replacement=\&](A){
\& 3 x_1 \&+\& 5x_2 \& -\&4x_3 \& = \& 7\\
-\& 3 x_1 \& -\&2x_2 \& +\&4x_3 \& = \& -1\\
\& 6 x_1 \& +\&x_2 \& -\&8x_3 \& = \& -4\\
};
\end{tikzpicture}
\end{column}
\end{columns}
\end{frame}
\end{document}
Responder2
- Em ambas as colunas você precisa inserir
\begin{center}
...\end{center}
ou melhor substituí-las pelo\centering
comando como é feito no MWE abaixo. - Fora do assunto:
- você pode mesclar
tikz
opções em comum\tikzset
para ambas as matrizes beamer
carregarxtabular
para que você não precise carregá-lo novamente- no MWE abaixo também há espaço reduzido entre os elementos das matrizes (por
inner xsep=1pt
)
- você pode mesclar
\documentclass{beamer}
\definecolor{lava}{rgb}{0.81, 0.06, 0.13}
\definecolor{myblue}{rgb}{0.0, 0.30, 0.60}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{frame}{xxxxx}
\underline{\textbf{Example}}
\begin{itemize}
\item[$\rightarrow$] Let's consider two systems of linear equations that correspond to the same coefficient matrix $\mathbf{A}$
\end{itemize}
\begin{columns}[T,onlytextwidth]
\tikzset{M/.style={ >=stealth,thick,baseline,
matrix of math nodes,
inner xsep=1pt,
column 8/.append style =myblue,
ampersand replacement=\&}
}
\begin{column}{.49\textwidth}
\centering
\begin{tikzpicture}[]
\matrix (A) [M]
{
\& 3 x_1 \&+\& 5x_2 \&-\& 4x_3 \&=\& 7\\
-\& 3 x_1 \&-\& 2x_2 \&+\& 4x_3 \&=\& -1\\
\& 6 x_1 \&+\& x_2 \&-\& 8x_3 \&=\& -4\\
};
\end{tikzpicture}
\end{column}
\begin{column}{.49\textwidth}
\centering
\begin{tikzpicture}
\matrix (B) [M]
{
\& 3 x_1 \&+\& 5x_2 \&-\& 4x_3 \&=\& 7\\
-\& 3 x_1 \&-\& 2x_2 \&+\& 4x_3 \&=\& -1\\
\& 6 x_1 \&+\& x_2 \&-\& 8x_3 \&=\& -4\\
};
\end{tikzpicture}
\end{column}
\end{columns}
\end{frame}
\end{document}
Adicionado:
Você pode simplificar seu código de matriz da seguinte maneira:
\documentclass{beamer}
\usepackage{fontspec}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{frame}[fragile]
\frametitle{Writing matrices in \texttt{beamer} }
\underline{\textbf{Example}}
\begin{itemize}
\item[$\rightarrow$] Let's consider two systems of linear equations that correspond to the same coefficient matrix $\mathbf{A}$.
\end{itemize}
\begin{columns}[T,onlytextwidth]
\tikzset{M/.style = {>=stealth,thick,baseline,
matrix of math nodes,
nodes={inner xsep=1pt, anchor=east},
column 4/.append style=blue,
}
}
\begin{column}{.49\textwidth}
\centering
\begin{tikzpicture}
\matrix (A) [M]
{
3 x_1 + & 5x_2 - & 4x_3 = & 7\\
- 3 x_1 - & 2x_2 + & 4x_3 = & -1\\
6 x_1 + & x_2 - & 8x_3 = & -4\\
};
\end{tikzpicture}
\end{column}
\begin{column}{.49\textwidth}
\centering
\begin{tikzpicture}
\centering
\matrix (B) [M]
{
3 x_1 + & 5x_2 - & 4x_3 = & 7\\
- 3 x_1 - & 2x_2 + & 4x_3 = & -1\\
6 x_1 + & x_2 - & 8x_3 = & -4\\
};
\end{tikzpicture}
\end{column}
\end{columns}
\end{frame}
\end{document}
Compilá-lo com XeLaTeX dá o seguinte resultado: