文本溢出和对齐问题TColorbox

文本溢出和对齐问题TColorbox

我正在尝试弄清楚如何增加列宽,以便我的文本可以容纳,并且第 2 列中的方程式可以正确间隔(见图)。任何帮助都非常感谢。

\documentclass{article}
\usepackage[margins=.75]{geometry}
\usepackage{graphicx} % Required for inserting images
\usepackage[many]{tcolorbox}
\usepackage{enumitem}
\newcommand\df[5]{\(\displaystyle\int_{#1}^{#2}#3\, d#4=#5\)}
\newcommand\ex[1]{\textbf{Example #1:}}
\newcommand\indef[2]{\(\displaystyle\int{#1}\d{#2}=\)}      
\newcommand\f{\(f\left(x\right)\)}

\begin{document}

\section{Introduction}
%----------------------PROPERTIES OF DEFINITE INTEGRALS----------------------

\section*{{Properties of Definite Integrals}

The following properties of the definite integral are a big part of calculus. \\

\begin{tcbitemize}[raster rows=2,raster height=22cm,raster every box/.style={colframe=red!50!black,colback=yellow!10!white}]
    \tcbitem[blankest]
        \begin{tcbitemize}[raster columns=1,raster rows=2,raster height=\tcbtextheight]
            
   \tcbitem \textbf{\underline{Additive Property for Integrals}} \\
            
            If \(f\) is integrable on the three closed intervals determined by \(a,b,\) and \(c\), then \\
            
            \begin{center}
                \df{a}{b}{f(x)}{x}{}\(\displaystyle\int_{a}^{c}f(x)\, dx+\int_{c}^{d}f(x)\, dx\)
            \end{center}
            
            \tcbitem \textbf{\underline{Definition of Two Special Definite Integrals}} \\
                
                \begin{enumerate}[itemsep={.25in}]
                    \item If \(f\) is defined at \(x=a\), then, \df{a}{a}{f(x)}{x}{0}
                    \item If \(f\) is integrable on \([a,b]\), then, 
                        \begin{description}
                            \item \df{b}{a}{f(x)}{x}{}\(-\displaystyle\int_{a}^{b}f(x)\, dx\)
                        \end{description}
                \end{enumerate}
        \end{tcbitemize}
            
        \tcbitem If \(f\) and \(g\) are integrable on \([a,b]\) and \(k\) is constant, then the function of \(k\cdot f\) and \(f\pm g\) are integrable on the interval \([a,b]\). \\
        
        \textbf{\underline{Constant Multiple Property for Integrals}}\\
            \begin{description}
                \item[1.] \df{a}{b}{kf(x)}{x}{}\(k\)\df{a}{b}{f(x)}{x}{}\\
            \end{description}
        \textbf{\underline{Additive Property for Integrals}}\\
            
            \begin{description}
            \item[2.] \df{a}{b}{\big[f(x)\pm g(x)\big]}{x}{}\df{a}{b}{f(x)}{x}{}\(\pm\)\df{a}{b}{g(x)}{x}{} 
            \end{description}
                                   
    \end{tcbitemize}

\结束{文档}

在此处输入图片描述

答案1

乳胶的第一条规则:您不能忽略错误消息!

  • 几何包没有margins选项,它被调用margin并且需要长度,而不仅仅是数字。

  • 另一个语法错误是\section*{{Properties of Definite Integrals}

  • 此外,您不应该\\在普通文本中滥用换行符。

避免 tcolorboxes 溢出的两种可能解决方案:

  1. 而不是\underline使用允许在下划线文本中换行的包之一,例如包lua-ul

% !TeX TS-program = lualatex

\documentclass{article}
\usepackage{geometry}
\usepackage{graphicx} % Required for inserting images
\usepackage[many]{tcolorbox}
\usepackage{enumitem}
\newcommand\df[5]{\(\displaystyle\int_{#1}^{#2}#3\, d#4=#5\)}
\newcommand\ex[1]{\textbf{Example #1:}}
\newcommand\indef[2]{\(\displaystyle\int{#1}\d{#2}=\)}      
\newcommand\f{\(f\left(x\right)\)}
\usepackage{lua-ul}

\begin{document}

\section{Introduction}
%----------------------PROPERTIES OF DEFINITE INTEGRALS----------------------

\section*{Properties of Definite Integrals}

The following properties of the definite integral are a big part of calculus. 

\begin{tcbitemize}[raster rows=2,raster height=22cm,raster every box/.style={colframe=red!50!black,colback=yellow!10!white}]
    \tcbitem[blankest]
        \begin{tcbitemize}[raster columns=1,raster rows=2,raster height=\tcbtextheight]
            
   \tcbitem \textbf{\underLine{Additive Property for Integrals}} 
            
            If \(f\) is integrable on the three closed intervals determined by \(a,b,\) and \(c\), then 
            
            \begin{center}
                \df{a}{b}{f(x)}{x}{}\(\displaystyle\int_{a}^{c}f(x)\, dx+\int_{c}^{d}f(x)\, dx\)
            \end{center}
            
            \tcbitem \textbf{\underLine{Definition of Two Special Definite Integrals}} 
                
                \begin{enumerate}[itemsep={.25in}]
                    \item If \(f\) is defined at \(x=a\), then, \df{a}{a}{f(x)}{x}{0}
                    \item If \(f\) is integrable on \([a,b]\), then, 
                        \begin{description}
                            \item \df{b}{a}{f(x)}{x}{}\(-\displaystyle\int_{a}^{b}f(x)\, dx\)
                        \end{description}
                \end{enumerate}
        \end{tcbitemize}
            
        \tcbitem If \(f\) and \(g\) are integrable on \([a,b]\) and \(k\) is constant, then the function of \(k\cdot f\) and \(f\pm g\) are integrable on the interval \([a,b]\). 
        
        \textbf{\underLine{Constant Multiple Property for Integrals}}\\
            \begin{description}
                \item[1.] \df{a}{b}{kf(x)}{x}{}\(k\)\df{a}{b}{f(x)}{x}{}
            \end{description}
        \textbf{\underline{Additive Property for Integrals}}
            
            \begin{description}
            \item[2.] \df{a}{b}{\big[f(x)\pm g(x)\big]}{x}{}\df{a}{b}{f(x)}{x}{}\(\pm\)\df{a}{b}{g(x)}{x}{} 
            \end{description}
                                   
    \end{tcbitemize}
    
    \end{document}

在此处输入图片描述


  1. 边距较小时:
% !TeX TS-program = lualatex

\documentclass{article}
\usepackage[margin=0.75in]{geometry}
\usepackage{graphicx} % Required for inserting images
\usepackage[many]{tcolorbox}
\usepackage{enumitem}
\newcommand\df[5]{\(\displaystyle\int_{#1}^{#2}#3\, d#4=#5\)}
\newcommand\ex[1]{\textbf{Example #1:}}
\newcommand\indef[2]{\(\displaystyle\int{#1}\d{#2}=\)}      
\newcommand\f{\(f\left(x\right)\)}
\usepackage{lua-ul}

\begin{document}

\section{Introduction}
%----------------------PROPERTIES OF DEFINITE INTEGRALS----------------------

\section*{Properties of Definite Integrals}

The following properties of the definite integral are a big part of calculus. 

\begin{tcbitemize}[raster rows=2,raster height=22cm,raster every box/.style={colframe=red!50!black,colback=yellow!10!white}]
    \tcbitem[blankest]
        \begin{tcbitemize}[raster columns=1,raster rows=2,raster height=\tcbtextheight]
            
   \tcbitem \textbf{\underLine{Additive Property for Integrals}} 
            
            If \(f\) is integrable on the three closed intervals determined by \(a,b,\) and \(c\), then 
            
            \begin{center}
                \df{a}{b}{f(x)}{x}{}\(\displaystyle\int_{a}^{c}f(x)\, dx+\int_{c}^{d}f(x)\, dx\)
            \end{center}
            
            \tcbitem \textbf{\underLine{Definition of Two Special Definite Integrals}} 
                
                \begin{enumerate}[itemsep={.25in}]
                    \item If \(f\) is defined at \(x=a\), then, \df{a}{a}{f(x)}{x}{0}
                    \item If \(f\) is integrable on \([a,b]\), then, 
                        \begin{description}
                            \item \df{b}{a}{f(x)}{x}{}\(-\displaystyle\int_{a}^{b}f(x)\, dx\)
                        \end{description}
                \end{enumerate}
        \end{tcbitemize}
            
        \tcbitem If \(f\) and \(g\) are integrable on \([a,b]\) and \(k\) is constant, then the function of \(k\cdot f\) and \(f\pm g\) are integrable on the interval \([a,b]\). 
        
        \textbf{\underLine{Constant Multiple Property for Integrals}}\\
            \begin{description}
                \item[1.] \df{a}{b}{kf(x)}{x}{}\(k\)\df{a}{b}{f(x)}{x}{}
            \end{description}
        \textbf{\underline{Additive Property for Integrals}}
            
            \begin{description}
            \item[2.] \df{a}{b}{\big[f(x)\pm g(x)\big]}{x}{}\df{a}{b}{f(x)}{x}{}\(\pm\)\df{a}{b}{g(x)}{x}{} 
            \end{description}
                                   
    \end{tcbitemize}
    
    \end{document}

在此处输入图片描述

相关内容