代码

代码

所以我不确定是否要更新我的旧问题:平衡两列表格

或者创建一个新的。所以我决定选择后者,因为这次尝试与上一次完全不同。和之前一样,我试图粗略地重新创建这个图像

在此处输入图片描述

通过这次尝试,我尝试使用包tcolorbox第一次,因此有一些问题。我目前最好的尝试是这样的

在此处输入图片描述

  • 总体策略好吗?我从另一个答案中复制了如何均匀分布两列。
  • 我仍然不知道如何正确移除内部填充和边距。我尝试过 size=small,但仍然需要进行一些简单的设置才能left=-1.5mm,right=-1.5mm,bottom=-1.5mm,top=-0.5mm移除内部填充
  • 同样,我无法水平对齐方程式,不得不到处使用一堆 hfil。我尝试设置,sidebyside align=center但这没有影响。
  • 桌面有圆角,但桌面没有圆角。有什么办法可以解决这个问题吗?
  • 我尝试使用相同的高度使图像中的三个标题相同,adjusted title但没有成功。有什么想法吗?
  • 堆叠无间距的盒子的想法将不胜感激。现在我想我必须猜测(或查找规则宽度,将设置为bottomrule0然后从中减去规则宽度top=
  • 可以使用栅格和 2 列来实现两列布局吗?我试过了,但无法让它工作,我认为使用 会更容易\tcblower

代码

\documentclass[border=2mm]{standalone}
\usepackage{tikz,mathtools}
\usepackage[skins,raster,many]{tcolorbox}

\usepackage{lipsum}

\newlength{\mylen}

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

\def\equOne{\hfil$a(b + c) = ab + c$\hfil}
\def\equTwo{\hfil$a(b - c) = ab - c$\hfil}
\def\equThree{\hfil$\Bigl(\cfrac{a}{b}\Bigr) = \cfrac{ad+bc}{bd}$\hfil}
\def\equFour{\hfil$\cfrac{(ab+ac)}{a} = b + c$\hfil}
\def\equFive{\hfil$a \neq 0$\hfil}
\def\equSix{\hfil$\Bigl(\cfrac{a}{b}\Bigr)-\Bigl(\cfrac{c}{d}\Bigr)=\cfrac{ad-bc}{bd} $\hfil}
\def\equSeven{\hfil$\cfrac{(a-b)}{(c-d)}=\cfrac{(b-a)}{(d-c)}$\hfil}
\def\equEight{\hfil$\cfrac{a}{(b/c)} = \cfrac{ac}{b}$\hfil}
\def\equNine{\hfil$\cfrac{(a+b)}{c} = \cfrac{a}{c} + \cfrac{b}{c}$\hfil}
\def\equTen{\hfil $\cfrac{\big(\cfrac{a}{b}\bigl)}{c} = \cfrac{a}{bc}$\hfil}
\def\equEleven{\hfil$a\Bigl(\cfrac{b}{c}\Bigr)=\cfrac{ab}{c}$\hfil}
\def\equTwelve{\hfil$\Bigl(\cfrac{a}{b}\Bigr)\biggl/\Bigl(\cfrac{c}{d}\Bigr)\biggr. = \cfrac{ad}{bc}$\hfil}

\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)$, and $(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}\noindent
  \begin{tcolorbox}[width=18cm,
    fonttitle=\Large \bfseries, title=Algebraic Rules, center title,
    colframe=algebra,
    size=small,boxrule=0.5mm,
    left=-1.5mm,right=-1.5mm,bottom=-1.5mm,top=-0.5mm
]
  \begin{tcbitemize}[raster equal height=rows,
                     raster every box/.style={fonttitle=\bfseries,
                                              colframe=algebra,valign=center,
                                              sharp corners},
                     ]
  \tcbitem[adjusted title={Commutative, Associative and Distributive Laws}]
  %
    \commutative
    
    \tcbline
    
    \distributive
    
    \tcbline
    
    \associative
    %
    \tcbsubtitle[before skip=0.5\baselineskip]{Order of Arithmetic Operations Rules}
    \BODMAS
    %
  \tcbitem[blankest, space to=\myspace,
           code={\setlength{\mylen}{\dimexpr \myspace/5}}]
  \begin{tcbitemize}[
    raster columns=1, raster row skip=0pt,
    raster every box/.append style={add to natural height=\mylen}]
    \tcbitem[sidebyside,center title,adjusted title={Algebraic Operations Rules},bottomrule=0cm]
        \equOne\newline\noindent\equTwo
        \tcblower
        \equThree
    \tcbitem[sidebyside,bottomrule=0cm,sidebyside align=center]
        \equFour\newline\equFive 
        \tcblower
        \equSix
    \tcbitem[sidebyside,bottomrule=0cm,sidebyside align=center]
        \equSeven
        \tcblower
        \equEight
    \tcbitem[sidebyside,bottomrule=0cm,sidebyside align=center]
        \equNine
        \tcblower
         \equTen
    \tcbitem[sidebyside,sidebyside align=center]
        \equEleven 
        \tcblower
        \equTwelve 
  \end{tcbitemize}
\end{tcbitemize}
\end{tcolorbox}
\end{document}

相关内容