简单的格式问题,2 个干扰环境

简单的格式问题,2 个干扰环境

我使用弗兰肯斯坦对话环境以及mdframed环境来突出对话中有趣的部分。我希望这两个环境不会互相干扰。理想情况下,我只希望在环境siderules处于活动状态时在右侧有一条线。

这是mdframed环境布局。

\newmdenv[
  topline=false,
  bottomline=false,
  leftline=false,
  skipabove=1pt,
  skipbelow=1pt,
]{siderules}

这是 .tex 格式的纯文本

\speak{Subject E}
Well you know, we do some stuff with our employees. You know, some typical ... We offer free lunches. We have some retreats sometimes. You know, free candy, things like that. But you know, when you're a start-up, you're so busy and you don't ... I mean, you cannot do much more than that, really.

\speak{Moritz}
Sure, I understand. So you also did not look like, for example, for this Indian company, did you check if they look at work hours or at work conditions or something? Or if they give free lunch?
\begin{siderules}
\speak{Subject E}
No, no, no. Never. We never looked what our partners did or not. If anything, some of our customers wanted us to ... I mean, it's borderline corruption, almost, that they wanted us to pay them up front a large sum to get their business. And then they would deduct our prize from that. But they wanted it up front.

\speak{Moritz}
So how did you deal with this stuff?

\speak{Subject E}
We tried to negotiate as much as possible the price down.
\end{siderules}

这是输出的图像。我希望它看起来更漂亮。为什么缺少双点? 在此处输入图片描述

答案1

对于环境周围的框架,您可以使用该\surroundwithmdframed命令。这会用框架包围具有指定名称的所有环境。要仅包围某些部分,您可以定义具有不同名称的第二个对话命令。

另一个问题是mdframed设置leftmargin,它用于dialogue悬挂缩进。要重新创建缩进,您可以\speak通过定义一个包含缩进和原始说话命令的新命令来取消缩进行的第一行,这虽然不是很干净,但它可以按预期工作。

梅威瑟:

\documentclass{article}
\usepackage{dialogue}
\usepackage{mdframed}

\surroundwithmdframed\[
  topline=false,
  bottomline=false,
  leftline=false,
  skipabove=1pt,
  skipbelow=1pt,
  innerleftmargin=0pt,
  innerrightmargin=0pt,
\]{mddialogue}
\newenvironment{mddialogue}{\begin{dialogue}}{%
    \end{dialogue}\ignorespacesafterend
}
\newcommand{\mdspeak}[1]{\speak{\hspace{-20pt}#1}}

\begin{document}
\begin{dialogue}
\speak{Subject E}
Well you know, we do some stuff with our employees. You know, some typical ... We offer free lunches. We have some retreats sometimes. You know, free candy, things like that. But you know, when you're a start-up, you're so busy and you don't ... I mean, you cannot do much more than that, really.

\speak{Moritz}
Sure, I understand. So you also did not look like, for example, for this Indian company, did you check if they look at work hours or at work conditions or something? Or if they give free lunch?
\end{dialogue}
\begin{mddialogue}
\mdspeak{Subject E}
No, no, no. Never. We never looked what our partners did or not. If anything, some of our customers wanted us to ... I mean, it's borderline corruption, almost, that they wanted us to pay them up front a large sum to get their business. And then they would deduct our prize from that. But they wanted it up front.

\mdspeak{Moritz}
So how did you deal with this stuff?

\mdspeak{Subject E}
We tried to negotiate as much as possible the price down.
\end{mddialogue}
\end{document}

结果:

在此处输入图片描述

相关内容