水平インデント付きのカスタム環境

水平インデント付きのカスタム環境

私は 2 つの部分で構成されるシンプルな環境を作成しようとしています。

  1. 太字のテキストの後に右矢印
  2. 太字テキストの下にインデントされた(複数)行のテキスト

これまでに私が持っているもの:

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{subfig}

\newenvironment{myeventeq}[1]
  {\textbf{#1} $\Rightarrow$\vspace{1ex}\par
   \hspace*{2em}%%
   \begin{minipage}{\dimexpr\columnwidth-2em}}
  {\end{minipage}}

\begin{document}

\begin{figure}    
  \subfloat[piece1]{  
    \begin{myeventeq}{piece of bold text}
      condition 1 to be satisfied\\
      condition 2 to be satisfied
    \end{myeventeq}
  }
  \subfloat[piece2]{
    \begin{myeventeq}{piece of bold text}
      condition 1 to be satisfied\\
      condition 2 to be satisfied
    \end{myeventeq}  
  }
  \caption{dual caption}
\end{figure}

\end{document}

これにより、次のものが生成されます。

例

現在問題となっているのは次の通りです:

  • 条件は太字のテキストの下に記述する必要があります
  • 2 番目のサブ図はページから外れます。

答え1

環境を避けたい場合はlist、 を中心に構築された構造に対して 1 つの環境を作成するだけで済みますminipage。これの問題は、ページをまたいで分割されないことです。ただし、おっしゃるとおり、subfigこの環境は複数のページにまたがることを意図したものではないと想定しています。

\documentclass{article}
\usepackage{amsmath,amssymb}

\newenvironment{myeventeq}[1]
  {\textbf{#1} $\Rightarrow$\vspace{1ex}\par
   \hspace*{2em}%%
   \begin{minipage}{\dimexpr\columnwidth-2em}}
  {\end{minipage}}

\begin{document}

Hello

\begin{myeventeq}{piece of bold text}
  condition 1 to be satisfied\\
  condition 2 to be satisfied
\end{myeventeq}

\end{document}

関連情報