自动为多样化内容的小页面环境分配宽度

自动为多样化内容的小页面环境分配宽度

我想将这些不同的内容(即封闭在itemize环境中的列表、非常长的文本(未封闭在arrayalign环境中)和一张小图片)放在minipage下面具有特定要求的多个环境中,但到目前为止我还没有找到令人满意的解决方案。这是我的要求。

  • 环境minipage已计算宽度,因此我无需手动调整线宽参数\begin{minipage}{...}。我真的很喜欢其他创建表格的软件包中的自动宽度调整,tabular但现在将我的所有内容放入“表格”环境中是完全不可能的。
  • 环境中的任何内容都minipage不会超出页边距,所以如果我有长垂直换行的文本,只要环境中每个内容的宽度相同,那就没问题。

让我详细阐述一下其他帖子中的一些想法,我仍然不知道如何在我的编辑器(TeXStudio)中结合它们。

  • 我想知道浮动宽度的计算可以重新用于调整minipage封闭内容的宽度,但我不知道如何做到这一点。

  • GuM 就此提供的解决方案关联按照规定示例完全正常工作,但在我像这样更改内容后,输出中断。这是我打算更改的 MWE。

You can use multiple \texttt{minipage} environments for side-by-side
descriptions (some more text to show where the right margin is):

\begin{center}
        \begin{minipage}{.25\linewidth}
            \vspace{-\baselineskip}
            This is detailed description of the equation.  Note how the two
            equations are both centered with respect to what is mentioned here.
            Such code could be so useful to give comments for tutorials and the
            like.
        \end{minipage}%
    \quad
        \sbox{0}{%
            This is detailed description of the equation.  Note how the two
            equations are both centered with respect to what is mentioned here.
            Such code could be so useful to give comments for tutorials and the
            like.
            \end{array}$%
        }%
        \usebox{0}%
    \quad
        \begin{minipage}{\dimexpr .75\linewidth-2em-\wd0 \relax}
            This is detailed description of the equation.  Note how the two
            equations are both centered with respect to what is mentioned here.
            Such code could be so useful to give comments for tutorials and the
            like.
        \end{minipage}%
    \end{center}

尝试的更改可能看起来是不必要的(并且无法产生三栏换行的长文本),但我认为这些不同的 minipage 环境对于某些内容很有用,并且想知道是否存在一些针对这些更改的解决方法或调整。此外,MWE 指出了这一点,You can use multiple \texttt{minipage} environments for side-by-side descriptions (some more text to show where the right margin is)但我找不到其中任何多个长文本的示例\texttt{minipage} environment,至少在提供的解决方案中没有。

下面是一些概括我想要的内容的草图:

left                                                              right
margin                                                            margin
<----->                                                           <----->

        List     Very long text description    |----------------|
        1.       that wrapped automatically    | (small picture |
        2.       in this small minipage        |      there)    |
        3.       environment.                  |----------------|

        <---->   <------------------------->   <---------------->
         auto              auto                       auto

(each content in minipage environment and each content has auto width adjustment)

以下是我的文档的完整 MWE。我想将内容放在\begin{document}

\documentclass[11pt]{article}

\usepackage[a4paper,margin=3cm]{geometry}
\usepackage{parskip,verbatim,amsmath,amssymb,microtype,palatino}
\usepackage{hyperref,nameref,setspace}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx,xcolor}
\usepackage{booktabs}
\usepackage{multirow,multicol,float,placeins,pdflscape,longtable,supertabular,makecell,array,tabularx,marginnote,titlesec,enumitem,fontawesome}

\definecolor{violet}{rgb}{0.5, 0.0, 1.0}
\definecolor{orange}{rgb}{1.0, 0.5, 0.0}
\definecolor{snow}{rgb}{0.83, 0.83, 0.83}
\hypersetup{
    colorlinks=true,
    citecolor=orange,
    filecolor=violet,
    linkcolor=violet,
    urlcolor=violet
}

\pagestyle{plain}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}

% Frame
\newcommand{\snowframe}[1]{\par\noindent\colorbox{snow}
    {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{#1}}}

\newcommand{\note}[1]{\mbox{} \footnotesize \marginnote{#1}}
\renewcommand*{\raggedrightmarginnote}{\flushright}
\setlength{\marginparsep}{0pt}

\titleformat{\section}[leftmargin]
{\rmfamily\mdseries\scshape\normalsize\filleft}
{\thesection}{.5em}{}

\titlespacing{\section}
{8pc}{1.5ex plus .1ex minus .2ex}{1pc}

\begin{document}

    \section*{\textcolor{orange}{Summary}}

    \textbf{Heading}
    
    \textit{Description}
    
    \begin{itemize}[nolistsep,nosep]
        \item First item.
        \item Second item.
        \item Third item.
    \end{itemize}
    
    Basel
    
    \vspace{0.2 cm}
\end{document}

这个想法在宏观上能实现吗?

相关内容