将两个组并排放置

将两个组并排放置

我如何才能将两个组环境并排放置?\hfill和都\quad不起作用。

\documentclass{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}

\definecolor{lightgray}{HTML}{EFEFEF}

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

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

\begin{document}

\begingroup\setlength{\fboxsep}{6pt}
\colorbox{white}{%
\begin{myitemize}{POTENZE}
  \item $a^{1} = a$
  \item $a^{0} = 1$
  \item $a^{n} \cdot a^{m} = a^{n+m}$
  \item $\dfrac{a^{n}}{a^{m}} = a^{n-m}$
  \item $a^{-n} = \dfrac{1}{a^{n}}$
  \item ${(a^{n})}^{m} = a^{n \cdot m}$
  \item $a^{n} \cdot b^{n} = \left(a \cdot b\right)^{n}$
  \item $\dfrac{a^{n}}{b^{n}} = \left(\dfrac{a}{b}\right)^{n},\; b \neq 0$
  \item $a^{\tfrac{m}{n}} = \sqrt[n]{a^{m}}$
\end{myitemize}
}\endgroup

\begingroup\setlength{\fboxsep}{6pt}
\colorbox{white}{%
\begin{myitemize}{LOGARITMI}
  \item $a^{\log_a b} = b$
  \item $\log_{a} bc = \log_{a} b + \log_{a} c$
  \item $\log_{a} \dfrac{b}{c} = \log_{a} b - \log_{a} c$
  \item $\dfrac{a^{n}}{a^{m}} = a^{n-m}$
  \item $c\log_{a} b = \log_{a} b^{c}$
  \item $\log_{a} b = \dfrac{1}{\log_{b} a}$
\end{myitemize}
}\endgroup

\end{document}

答案1

tcbraster带有和盒子的解决方案tcolorbox

\documentclass{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[most]{tcolorbox}
\usepackage{etoolbox}
\usepackage{enumitem}
\usepackage{hyperref}

\definecolor{lightgray}{HTML}{EFEFEF}

\newtcolorbox{powlogbox}[1][]{%
  enhanced jigsaw,
  sharp corners,
  colback=white,
  nobeforeafter,
  #1
}


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

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

\begin{document}


\begin{tcbraster}[raster columns=2, raster equal height]
\begin{powlogbox}
\begin{myitemize}{POTENZE}
  \item $a^{1} = a$
  \item $a^{0} = 1$
  \item $a^{n} \cdot a^{m} = a^{n+m}$
  \item $\dfrac{a^{n}}{a^{m}} = a^{n-m}$
  \item $a^{-n} = \dfrac{1}{a^{n}}$
  \item ${(a^{n})}^{m} = a^{n \cdot m}$
  \item $a^{n} \cdot b^{n} = \left(a \cdot b\right)^{n}$
  \item $\dfrac{a^{n}}{b^{n}} = \left(\dfrac{a}{b}\right)^{n},\; b \neq 0$
  \item $a^{\tfrac{m}{n}} = \sqrt[n]{a^{m}}$
\end{myitemize}

\end{powlogbox}
\begin{powlogbox}
\begin{myitemize}{LOGARITMI}
  \item $a^{\log_a b} = b$
  \item $\log_{a} bc = \log_{a} b + \log_{a} c$
  \item $\log_{a} \dfrac{b}{c} = \log_{a} b - \log_{a} c$
  \item $\dfrac{a^{n}}{a^{m}} = a^{n-m}$
  \item $c\log_{a} b = \log_{a} b^{c}$
  \item $\log_{a} b = \dfrac{1}{\log_{b} a}$
\end{myitemize}
\end{powlogbox}
\end{tcbraster}
\end{document}

在此处输入图片描述

相关内容