代码

代码

我正在尝试使用 LaTeX 重新创建下表

在此处输入图片描述

这是我目前所拥有的

在此处输入图片描述

我最大的问题是平衡两列的高度(相同高度),就像我试图重现的图片中所做的那样。此外,我还有一个问题,周围的框不太合适,并且表格没有完全向左对齐。

任何帮助解决这些问题的帮助都将不胜感激

代码

\documentclass[border=5mm]{standalone}
\usepackage[table]{xcolor}
\usepackage{tikz}
\usepackage[bf]{caption}
\usepackage{adjustbox,array,mathtools}

\colorlet{bodmas}{red}
\definecolor{algebra}{HTML}{4f81bd}

\newcommand{\headerstyle}{\cellcolor{algebra} \color{white} \bfseries}

\newcolumntype{P}[1]{>{\centering\arraybackslash}m{#1}}

\newcommand{\commutative}{%
\textbf{Commutative} property:
The order of elements does \textbf{not}
make any difference in the outcome. \newline
This is only true for \textbf{multiplication and addition}.
}
%
\newcommand{\distributive}{
\textbf{Distributive} property: The process of distributing a number
on the outside of the parentheses to each number on the inside; $a(b + c) = ab + ac$
}
%
\newcommand{\associative}{%
\textbf{Associative}: Grouping does \textbf{not} make any difference:
$(a+b) + c = a + (b + c)$, \newline $(ab)c = a(bc)$
}

\newcommand{\BODMAS}{
\textbf{Order of operations \textcolor{red}{BODMAS}}
\begin{enumerate}
    \item Work within parentheses (), \textcolor{bodmas}{b}rackets [], and braces \{ \}
    from innermost and work outward.
    \item Simplify exponents/p\textcolor{bodmas}{o}wer and roots working from left 
    to right $\rightarrow$.
    \item Do \textcolor{bodmas}{d}ivision and \textcolor{bodmas}{m}ultiplication, whichever comes first
    left to right $\rightarrow$
    \item Do \textcolor{bodmas}{a}ddition and \textcolor{bodmas}{s}ubtraction, whichever comes first left to right 
    $\rightarrow$.
    \item Rounding off.
\end{enumerate}
}

\begin{document}


\begin{tikzpicture}
%
\def\equOne{$a(b + c) = ab + c$}
\def\equTwo{$a(b - c) = ab - c$}
\def\equThree{$\Bigl(\cfrac{a}{b}\Bigr) = \cfrac{ad+bc}{bd}$}
\def\equFour{$\cfrac{(ab+ac)}{a} = b + c$}
\def\equFive{$a \neq 0$}
\def\equSix{$\Bigl(\cfrac{a}{b}\Bigr)-\Bigl(\cfrac{c}{d}\Bigr)=\cfrac{ad-bc}{bd} $}
\def\equSeven{$\cfrac{(a-b)}{(c-d)}=\cfrac{(b-a)}{(d-c)}$}
\def\equEight{$\cfrac{a}{(b/c)} = \cfrac{ac}{b}$}
\def\equNine{$\cfrac{(a+b)}{c} = \cfrac{a}{c} + \cfrac{b}{c}$}
\def\equTen{$\cfrac{\big(\cfrac{a}{b}\bigl)}{c} = \cfrac{a}{bc}$}
\def\equEleven{$a\Bigl(\cfrac{b}{c}\Bigr)=\cfrac{ab}{c}$}
\def\equTwelve{$\Bigl(\cfrac{a}{b}\Bigr)\biggl/\Bigl(\cfrac{c}{d}\Bigr)\biggr. = \cfrac{ad}{bc}$}
%
\node (table) [inner sep=0pt] {%
\renewcommand{\arraystretch}{1.5}%
    \begin{tabular}{c || c}%
    \multicolumn{2}{c}{\headerstyle Algebraic Rules} \\ \arrayrulecolor{white} \hline \arrayrulecolor{algebra}%
    \begin{minipage}{.7\textwidth}%
        \begin{tabular}{p{\textwidth}}
        \multicolumn{1}{c}{\headerstyle Commutative, Associative and Distributive Laws} \\ \hline
        \commutative \\ \hline
        \distributive \\ \hline
        \associative  \\ \hline
        \multicolumn{1}{c}{\headerstyle Order of Arithmetic Operations Rules} \\ \hline
        \BODMAS%
        \end{tabular}%
    \end{minipage} &%
    \begin{minipage}{0.7\textwidth}%
        \begin{tabular}{ P{0.5\textwidth} | P{0.5\textwidth}}%
         \multicolumn{2}{c}{\headerstyle Algebraic Operations Rules} \\ \hline
           \equOne\newline\noindent\equTwo & \equThree \\ \cline{1-2}
           \equFour\newline\equFive & \equSix \\\cline{1-2}
           \equSeven \newline Multiply top and bottom by $-1$ & \equEight \\\cline{1-2}
                                    \equNine & \equTen \\\cline{1-2}
                                    \equEleven & \equTwelve \\ \cline{1-2}
        \end{tabular}
    \end{minipage}
    \end{tabular}
};
\draw [thick,color=algebra!50!black,rounded corners=.5em] (table.north west) rectangle (table.south east);
\end{tikzpicture}
\end{document}

答案1

仍需要进行一些进一步的改进,但以下内容可以作为起点:

在此处输入图片描述

\documentclass[border=5mm]{standalone}
\usepackage[table]{xcolor}
\usepackage{tikz}
\usepackage[bf]{caption}
\usepackage{adjustbox,array,mathtools}

\colorlet{bodmas}{red}
\definecolor{algebra}{HTML}{4f81bd}

\newcommand{\headerstyle}{\cellcolor{algebra} \color{white} \bfseries}

\newcolumntype{P}[1]{>{\centering\arraybackslash}m{#1}}

\newcommand{\commutative}{%
\textbf{Commutative} property:
The order of elements does \textbf{not}
make any difference in the outcome. \newline
This is only true for \textbf{multiplication and addition}.
}
%
\newcommand{\distributive}{
\textbf{Distributive} property: The process of distributing a number
on the outside of the parentheses to each number on the inside; $a(b + c) = ab + ac$
}
%
\newcommand{\associative}{%
\textbf{Associative}: Grouping does \textbf{not} make any difference:
$(a+b) + c = a + (b + c)$, \newline $(ab)c = a(bc)$
}

\newcommand{\BODMAS}{
\textbf{Order of operations \textcolor{red}{BODMAS}}
\begin{enumerate}
    \item Work within parentheses (), \textcolor{bodmas}{b}rackets [], and braces \{ \}
    from innermost and work outward.
    \item Simplify exponents/p\textcolor{bodmas}{o}wer and roots working from left 
    to right $\rightarrow$.
    \item Do \textcolor{bodmas}{d}ivision and \textcolor{bodmas}{m}ultiplication, whichever comes first
    left to right $\rightarrow$
    \item Do \textcolor{bodmas}{a}ddition and \textcolor{bodmas}{s}ubtraction, whichever comes first left to right 
    $\rightarrow$.
    \item Rounding off.
\end{enumerate}
}

\usepackage{calc}
\usepackage[column=0]{cellspace}
\setlength{\cellspacetoplimit}{12pt}
\setlength{\cellspacebottomlimit}{12pt}
\addparagraphcolumntypes{P}
\begin{document}


\begin{tikzpicture}
%
\def\equOne{$a(b + c) = ab + c$}
\def\equTwo{$a(b - c) = ab - c$}
\def\equThree{$\Bigl(\cfrac{a}{b}\Bigr) = \cfrac{ad+bc}{bd}$}
\def\equFour{$\cfrac{(ab+ac)}{a} = b + c$}
\def\equFive{$a \neq 0$}
\def\equSix{$\Bigl(\cfrac{a}{b}\Bigr)-\Bigl(\cfrac{c}{d}\Bigr)=\cfrac{ad-bc}{bd} $}
\def\equSeven{$\cfrac{(a-b)}{(c-d)}=\cfrac{(b-a)}{(d-c)}$}
\def\equEight{$\cfrac{a}{(b/c)} = \cfrac{ac}{b}$}
\def\equNine{$\cfrac{(a+b)}{c} = \cfrac{a}{c} + \cfrac{b}{c}$}
\def\equTen{$\cfrac{\big(\cfrac{a}{b}\bigl)}{c} = \cfrac{a}{bc}$}
\def\equEleven{$a\Bigl(\cfrac{b}{c}\Bigr)=\cfrac{ab}{c}$}
\def\equTwelve{$\Bigl(\cfrac{a}{b}\Bigr)\biggl/\Bigl(\cfrac{c}{d}\Bigr)\biggr. = \cfrac{ad}{bc}$}
%
\node (table) [inner sep=0pt] {%
\renewcommand{\arraystretch}{1.5}%
    \begin{tabular}{@{}c@{} || @{}c@{}}%
    \multicolumn{2}{c}{\headerstyle Algebraic Rules} \\ \arrayrulecolor{white} \hline \arrayrulecolor{algebra}%
    \begin{minipage}[t]{.8\textwidth}%
        \begin{tabular}[t]{p{\textwidth-2\tabcolsep}}
        \multicolumn{1}{c}{\headerstyle Commutative, Associative and Distributive Laws} \\ \hline
        \commutative \\ \hline
        \distributive \\ \hline
        \associative  \\ \hline
        \multicolumn{1}{c}{\headerstyle Order of Arithmetic Operations Rules} \\ \hline
        \BODMAS%
        \end{tabular}%
    \end{minipage} &%
    \begin{minipage}[t]{0.45\textwidth}%
        \begin{tabular}[t]{ 0{P{0.5\textwidth-2\tabcolsep}} | P{0.5\textwidth-2\tabcolsep}}%
         \multicolumn{2}{c}{\headerstyle Algebraic Operations Rules} \\ \hline
           \equOne\newline\noindent\equTwo & \equThree \\ \cline{1-2}
           \equFour\newline\equFive & \equSix \\\cline{1-2}
           \equSeven \newline Multiply top and bottom by $-1$ & \equEight \\\cline{1-2}
                                    \equNine & \equTen \\\cline{1-2}
                                    \equEleven & \equTwelve \\ 
        \end{tabular}
    \end{minipage}
    \end{tabular}
};
\draw [thick,color=algebra!50!black,rounded corners=.5em] (table.north west) rectangle (table.south east);
\end{tikzpicture}
\end{document}

相关内容