我为此浪费了好几个小时……如何根据第一个基线(或某个 mm 的偏移)对齐一系列 tcolorbox。每个文档大约有 60 个这样的 tcolorbox,15 个文档……我需要修复!或者用其他方法获得相同的视觉效果
我拥有的:
\usepackage[most]{tcolorbox}
\tcbset{sharp corners, frame hidden, boxrule=0mm, colframe=white, box align=top}
稍后在文档中
\begin{enumerate}
\item \begin{tcolorbox}{(Proof 1.1) For $a$ and $b$, two elements of a Field $F$, using only the axioms for a field, proofs:}\end{tcolorbox}
\begin{itemize}
\item \openq $\forall a \in F$, $0a = 0$ \closeq
...
一定有办法……
答案1
我建议使用这个 hack,方法如下enumitem
:
\documentclass[11pt, a4paper]{article}
\usepackage[utf8]{inputenc} %Character set
\usepackage{enumitem}
\usepackage[most]{tcolorbox}
\tcbset{sharp corners, frame hidden, boxrule=0mm, colframe=white, box align=top}
\newcommand{\openq}{\begin{tcolorbox}}
\newcommand{\closeq}{\end{tcolorbox}}
\makeatletter
\def\tcbboxsep{\kvtcb@boxsep}
\def\tcbtopsep{\kvtcb@topsep}
\makeatother
\begin{document}
\begin{enumerate}[nosep]
\item \leavevmode\vspace*{-\dimexpr2\baselineskip + \tcbboxsep + \tcbtopsep}
\begin{tcolorbox}{(Proof 1.1) For $a$ and $b$, two elements of a Field $F$, using only the axioms for a field, proofs:}\end{tcolorbox}
\begin{itemize}[nosep, wide=0pt, leftmargin=*]
\item \leavevmode\vspace*{-\dimexpr2\baselineskip + \tcbboxsep +\tcbtopsep}
\openq $\forall a \in F$, $0\,a = 0$ \closeq
\end{itemize}
\end{enumerate}
\end{document}