2

I am trying to create a simple environment that consists two parts:

  1. bold text followed by a rightarrow
  2. (multiple) lines of text with indentation, below the bold text

What I have so far:

\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}

This produces the following:

example

What is currently the problem is:

  • the conditions should be below the piece of bold text
  • the second subfigure falls of the page.
1
  • 1
    It would be nice if you listed the packages you're using. Also, how exactly are things not working with subfig? Could you post code in which it doesn't work as you expect?
    – A.Ellett
    May 2, 2015 at 19:10

1 Answer 1

2

If you want to avoid the list environment, you could just make one environment for your structure build around a minipage. The problem with this is that it will not break across pages. But since you mentioned subfig I'm assuming that this environment isn't something that is intended to span multiple pages.

\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}
1
  • Thank you! I've updated my example to a MWE. When I put the environment within a subfig, the second part is no longer below the bold text. Is there any way how I can fix this?
    – eider
    May 3, 2015 at 9:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .