如何使用 latex 构建这样的样式页面

如何使用 latex 构建这样的样式页面

我需要写一个这样的命令参考,有谁知道如何建立一个像图片那样的页面?

H

答案1

这是我的建议:使用paracol包实现具有同步列的双列布局,使用booktabstabularx包实现文本宽度宽表,使用enumitem包实现自定义description环境,并使用自定义命令实现左列的小标题。

在此处输入图片描述

\documentclass{article}
%%%%% Smaller margins, no parindent and a small vertical white space between paragraphs %%%%%
\usepackage{geometry}
\usepackage{parskip}

%%%%% For a two column layout with synchronized columns, left column takes up 25% of the horizontal space %%%%%
\usepackage{paracol}
\columnratio{0.25}

%%%%% For tables as wide as the textwidth and horizontal lnes with a decent spacing %%%%%
\usepackage{booktabs}
\usepackage{tabularx}
%%%%% For the small "headers" in the left column %%%%%
\newcommand{\myheader}[1]{\bigskip%
                          \begin{leftcolumn*}%
                            \begin{tabularx}{\linewidth}{@{}X@{}}%
                              \toprule%
                              \textbf{#1}%
                            \end{tabularx}%
                          \end{leftcolumn*}%
                          \switchcolumn}

%%%%% For the customized description environment %%%%%
\usepackage{enumitem}
\setlist[description]{leftmargin=0.5cm,labelindent=0.5cm}

%%%%% For the dummy text. Do not use in real document %%%%%
\usepackage{lipsum}

\begin{document}
\begin{paracol}{2}[\section*{alias}]
  \begin{rightcolumn}
    \lipsum[4]
    \begin{description}\itshape
      \item[word] Here is the description text
      \item[other word] Here is the other description
    \end{description}
  \end{rightcolumn}

  \myheader{Syntax Description}
    \begin{tabularx}{\linewidth}{@{}>{\itshape}lX@{}}
      \toprule
      text & longer description text that can also use up more than one line\\
      \midrule
      more text & another description\\
      \midrule
      third text & last description in this table\\
      \bottomrule
    \end{tabularx}

  \myheader{Defaults}
    \lipsum[4]


\end{paracol}
\end{document}

相关内容