2

Is it possible create a tcbitemize like this, but with two columns? If yes, how?

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[
  a4paper,
  margin=15mm,
  bindingoffset=2mm,
  heightrounded,
]{geometry}

\usepackage{amsmath}
\usepackage{microtype}
\usepackage{xcolor}
\usepackage{varwidth}
\usepackage{etoolbox}
\usepackage{enumitem}
\usepackage{hyperref}
\usepackage{tikz}
\usepackage[most]{tcolorbox}

\tcbuselibrary{listings,theorems}
\tcbuselibrary{raster}

\newtoggle{odditem}
\def\myitem{\iftoggle{odditem}%
{\color{black}\togglefalse{odditem}}%
{\color{blue}\toggletrue{odditem}}%
\olditem}

\newenvironment{myitemize}[1]{%
  \begin{itemize}[leftmargin=*]%
  \toggletrue{odditem}%
  \let\olditem\item%
  \let\item\myitem}{
  \end{itemize}
  }

\DeclareMathOperator{\eul}{e}
\newcommand{\abs}[1]{|#1|}
\newcommand{\dint}[1]{\displaystyle \int #1 \;dx}
\newcommand{\fd}[1]{\dfrac{d}{dx} #1}
\definecolor{lime}{HTML}{32CD32}

\begin{document}

\begin{tcbitemize}[raster columns=1,raster equal height,
colframe=red!83!black,colback=lime!5!white,fonttitle=\bfseries]
\tcbitem[squeezed title={DERIVATE}]
\begin{myitemize}{}
  \item $\fd{a} = 0$
  \item $\fd{x} = 1$
  \item $\fd{ax^{n}} = anx^{n-1}$
  \item $\fd{\eul^{x}} = \eul^{x}$
  \item $\fd{\ln (x)} = \dfrac{1}{x}$
  \item $\fd{\sin (x)} = \cos (x)$
  \item $\fd{\cos (x)} = -\sin (x)$
  \item $\fd{\tan (x)} = \dfrac{1}{\cos^{2} (x)}$
  \item $\fd{\cot (x)} = -\dfrac{1}{\sin^{2} (x)}$
  \item $\fd{\sec (x)} = \sec (x) \cdot \tan (x)$
  \item $\fd{\csc (x)} = -\csc (x) \cdot \cot (x)$
  \item $\fd{f[g(x)]} = f'(x)[g(x)] \cdot g'(x) $
  \item $\fd{f(x)\cdot g(x)} = f'(x) \cdot g(x) + f(x) \cdot g'(x)$
  \item $\fd{\left[\dfrac{f(x)}{g(x)}\right]} = \dfrac{f'(x) \cdot g(x) - f(x) \cdot g'(x)}{[g(x)]^{2}}$
  \item $\fd \arctan (x) = \dfrac{1}{1 + x^{2}}$
\end{myitemize}
\end{tcbitemize}
\end{document}
Cragfelt
  • 4,005
user3204810
  • 1,415

1 Answers1

2

You can make a Side by side tcolorbox. Quoting documentation on page 116:

A side by side box is a special tcolorbox where the upper and lower part of the box are set side by side. All boxes of this kind are unbreakable

Since there is no numbering in itemize, one can brake the myitemize environment and start it again in the lower part.

enter image description here

\begin{tcbitemize}[%
    raster columns=1,
    raster equal height,
    colframe=red!83!black,
    colback=lime!5!white,
    fonttitle=\bfseries,
    sidebyside]
\tcbitem[squeezed title={DERIVATE},sidebyside align=top]
\begin{myitemize}{}
  \item $\fd{a} = 0$
  \item $\fd{x} = 1$
  \item $\fd{ax^{n}} = anx^{n-1}$
  \item $\fd{\eul^{x}} = \eul^{x}$
  \item $\fd{\ln (x)} = \dfrac{1}{x}$
  \item $\fd{\sin (x)} = \cos (x)$
  \item $\fd{\cos (x)} = -\sin (x)$
  \item $\fd{\tan (x)} = \dfrac{1}{\cos^{2} (x)}$
\end{myitemize}
\tcblower
\begin{myitemize}{}
  \item $\fd{\cot (x)} = -\dfrac{1}{\sin^{2} (x)}$
  \item $\fd{\sec (x)} = \sec (x) \cdot \tan (x)$
  \item $\fd{\csc (x)} = -\csc (x) \cdot \cot (x)$
  \item $\fd{f[g(x)]} = f'(x)[g(x)] \cdot g'(x) $
  \item $\fd{f(x)\cdot g(x)} = f'(x) \cdot g(x) + f(x) \cdot g'(x)$
  \item $\fd{\left[\dfrac{f(x)}{g(x)}\right]} = \dfrac{f'(x) \cdot g(x) - f(x) \cdot g'(x)}{[g(x)]^{2}}$
  \item $\fd \arctan (x) = \dfrac{1}{1 + x^{2}}$
\end{myitemize}
\end{tcbitemize}

UPDATE

Alternatively, if you do not want the separating dashed line, you need to add the keys

colbacklower=lime!5!white,
bicolor,

in the tcolorbox configuration. So you will have

enter image description here

Off-topic

A good practice in math symbol formatting is to define non-italic math operators in math-mode. There are some possible ways to achieve that, according to answer in How can I define (user defined) functions in math mode?, so I redefined d the math operator for differentiation with the line in preamble

\newcommand{\di}{\mathop{}\!\mathrm{d}}

(which was suggested by @egreg in a comment in my question), and making some changes in your custom command for differential derivative notation

\newcommand{\fd}[1]{\dfrac{\di}{\di x} #1}

the list of derivatives will look like this

enter image description here

Cragfelt
  • 4,005