I was inspired by the following LaTeX document:
http://www.people.fas.harvard.edu/~djmorin/chap11.pdf
(written by Prof. David Morin from Harvard university)
I would like to produce a similar example environment, as seen in page 11 for a single example (a thick grey line before and after the example text, and also the "Example (…)" and "Solution" titles in each example.)
Also, as in page 15 a thin grey line is separating two consecutive examples.
Any idea how to create an environment with these macros? I might change it a bit but I would like to be able to produce it.
EDIT:
Is it possible to include the \begin{block} in the example and the \end{block} in the solution, so that I don't need to explicitly write it, but only
\begin{example}[Rear clock ahead]
\lipsum[1]
\end{example}
\begin{solution}
\lipsum[2]
\end{solution}
\begin{example}[Example 2]
\lipsum[1]
\end{example}
\begin{solution}
\lipsum[2]
\end{solution}
And finally, I would rather have a blank line between the "example" and "solution", and also have \blockline have an equal vertical distance from its top and bottom texts. I am just not sure where to put these commands in your definitions.
Thanks.
Best Answer
Here a simple solution with rule:
EDIT
Here a solution with
mdframed
EDIT 2
Here a solution with
mdframed
in combination withetoolbox
. Of course you can use the solution without usingmdframed
.