新答案

新答案

这是我使用 wysiwyg 工具制作的文档,我想要一个 latex 代码来做类似的事情。字体必须是 sans,大小可以小一点,设置 \renewcommand{\familydefault}{\sfdefault} 时的默认值就可以了。 在此处输入图片描述

答案1

新答案

以下是重新实现,使用相同的输入语法,但完全可分页(利用包paracol)。输出如下所示(除了我已将更多细节的缩进从线宽的一半更改为线宽的 40%,从而为它们提供更多空间)。

\documentclass[]{article}

\usepackage{soul}
\usepackage{paracol}
\usepackage{siunitx}
\newcommand\dollar[1]{\$\num[detect-all]{#1}}

\newcommand\details[1]
  {%
    \par
    \begingroup
      % change .4 to your liking for the indent of the more details
      \advance\leftskip.4\linewidth
      \itshape#1\par
    \endgroup
  }
\newenvironment{itemdetails}[1]
  {%
    \begingroup
    \sffamily
    \begin{paracol}{2}
      \noindent
      \ul{item description}
      \begin{flushleft}#1\end{flushleft}%
      \switchcolumn
      \noindent
      \ul{rates and delivery details}
      \begin{itemize}%
  }
  {%
      \end{itemize}%
    \end{paracol}%
    \endgroup
  }

\begin{document}
\vspace*{.7\textheight}
\begin{itemdetails}
  {set of 4 luxurious hand crafted white wood chairs and table for living room}
  \item
    items arrived on
    \details{1\textsuperscript{st}, January 2021}
  \item
    cost per item
    \details{\dollar{1100}}
  \item
    discount
    \details
      {%
        \dollar{3000} if 3 items taken at once, and delivery free of
        charge\par
        \dollar{5900} same as above for 6 items
      }
  \item
    payment should be made directly online
  \item
    date of delivery of first batch
    \details{8\textsuperscript{th}, May 2021}
\end{itemdetails}
\end{document}

旧答案

警告:这不是可分页的。

以下是一个示例实现,应该与您的图像接近。请注意,下划线不是印刷最佳实践,并且 LaTeX 对下划线文本的支持非常有限(如果您使用 LuaLaTeX 和包,情况会变得更好lua-ul)。

以下soul为下划线的用途,适用于各大引擎。

\documentclass[]{article}

\usepackage[T1]{fontenc}
\usepackage{soul}
\usepackage{siunitx}
\newcommand\dollar[1]{\$\num[detect-all]{#1}}

\newcommand\details[1]
  {%
    \\\null\hfill
    \parbox[t]{.5\linewidth}{\parskip=\itemsep\raggedright\itshape#1}%
  }
\newenvironment{itemdetails}[1]
  {%
    \par
    \noindent
    \begingroup
    \sffamily
    \begin{minipage}[t]{.4\linewidth}
      \ul{item description}
      \begin{flushleft}#1\end{flushleft}%
    \end{minipage}\hfil
    \begin{minipage}[t]{.55\linewidth}
      \ul{rates and delivery details}
      \begin{itemize}%
  }
  {%
      \end{itemize}%
    \end{minipage}%
    \endgroup
    \par
  }

\begin{document}
\begin{itemdetails}
  {set of 4 luxurious hand crafted white wood chairs and table for living room}
  \item
    items arrived on
    \details{1\textsuperscript{st}, January 2021}
  \item
    cost per item
    \details{\dollar{1100}}
  \item
    discount
    \details
      {%
        \dollar{3000} if 3 items taken at once, and delivery free of
        charge\par
        \dollar{5900} same as above for 6 items
      }
  \item
    payment should be made directly online
  \item
    date of delivery of first batch
    \details{8\textsuperscript{th}, May 2021}
\end{itemdetails}
\end{document}

在此处输入图片描述

相关内容