0

I have a tikzpicture and minipage environment below, and I would like there to be a slight indent in the sub-categories a, b, c, etc. For example below: a. Sub-second \\ and a. again sub. How can I do this?

\documentclass{article}
\usepackage[landscape]{geometry}
\usepackage{url}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage{esint}
\usepackage{amsfonts}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usepackage{amsmath,amssymb}

\usepackage{colortbl}
\usepackage{xcolor}
\usepackage{mathtools}
\usepackage{amsmath,amssymb}
\usepackage{enumitem}
\makeatletter

\newcommand*\bigcdot{\mathpalette\bigcdot@{.5}}
\newcommand*\bigcdot@[2]{\mathbin{\vcenter{\hbox{\scalebox{#2}{$\m@th#1\bullet$}}}}}
\makeatother

\title{130 Cheat Sheet}
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}

\advance\topmargin-.8in
\advance\textheight3in
\advance\textwidth3in
\advance\oddsidemargin-1.5in
\advance\evensidemargin-1.5in
\parindent0pt
\parskip2pt
\newcommand{\hr}{\centerline{\rule{3.5in}{1pt}}}
%\colorbox[HTML]{e4e4e4}{\makebox[\textwidth-2\fboxsep][l]{texto}
\begin{document}

\begin{center}{\huge{\textbf{Title}}}\\
\end{center}
\begin{multicols*}{3}

\tikzstyle{mybox} = [draw=black, fill=white, very thick,
    rectangle, rounded corners, inner sep=10pt, inner ysep=10pt]
\tikzstyle{fancytitle} =[fill=black, text=white, font=\bfseries]

%------------ ODE Content ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \begin{minipage}{0.5\textwidth}
    \small{
        \begin{tabular}{lp{6cm} l}
        \textit{Title1} &  \begin{minipage}{0.5\textwidth}
        1. $B$ \\    
        2. Second  \\
        a. Sub-second \\
    3. Third \\
        \end{minipage} \\ \hline
    \textit{Titl2} &\begin{minipage}{0.5\textwidth}
        1. here
        a. again sub
        \end{minipage} \\ \hline
    \end{tabular}}
    \end{minipage}
};
%------------ ODE Header ---------------------
\node[fancytitle, right=10pt] at (box.north west) {ODE};
\end{tikzpicture}

\end{multicols*}
3

1 Answer 1

3

Aside from using tcolorbox, it would be preferable to use enumerate rather than hard-coding item labels. Maybe something like this?

\documentclass{article}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{enumitem}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\newlist{blist}{enumerate}{2}
\setlist[blist,1]{label=\arabic*.,wide,leftmargin=1em}
\setlist[blist,2]{label=\alph*.,leftmargin=1em}
\setlist[blist]{nosep}
\newcolumntype{P}{>{\begin{minipage}[t]{\linewidth}\arraybackslash}X<{\end{minipage}}}
\begin{document}

\begin{tcolorbox}
  [%
    enhanced,
    width=.5\textwidth,
    title=ODE,  
    colframe=black,
    colback=white,
    boxrule=1.2pt,
    boxsep=10pt,
    toptitle=0pt,
    bottomtitle=0pt,
    fonttitle=\bfseries,
    attach boxed title to top text left,
    halign title=left,
    colbacktitle=black,
  ]
  \small
  \begin{tabularx}\linewidth{lP}
    \textit{Title1} &  \begin{blist}
      \item $B$ 
      \item Second  
      \begin{blist}
        \item Sub-second 
      \end{blist}
      \item Third 
        \end{blist} \\ \midrule
    \textit{Titl2} &\begin{blist}
      \item here
      \begin{blist}
        \item again sub
      \end{blist}
    \end{blist} \\ \midrule
  \end{tabularx}
\end{tcolorbox}

\end{document}

Poor-quality image of output:

enumerated lists in tabular in tcolorbox

I do wonder if you really need this many layers of formatting i.e. sub-lists within lists within tabulars within boxes! However, only you (and your readers) can know the answer to that question.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .