diff --git a/docs.tex b/docs.tex index cd7a0a28821b8839e6fd1f0d2151c5c4d392a669..499f5a70517180c1aebc70d1700734608acdcb1b 100644 --- a/docs.tex +++ b/docs.tex @@ -107,10 +107,17 @@ You can add things for these people to say with a \verb"\begin{speechtext}" comm Then we have \verb"\begin{exampletext}" for example: \begin{exampletext} - You can use the \verb"\boxtext" environment for general boxes. - Typically, they get used to assault players with massive amounts of introductory text. + This example text might show game examples, or the history of a location. + + It has an optional argument if you want to replace the line at the start. + \end{exampletext} +\begin{boxtext} + And of course\ldots BOXTEXT! + +\end{boxtext} + \subsection{Magic} \subsubsection{Magical Items} diff --git a/layout.sty b/layout.sty index 2cb6bd2793c478703f4dd0f9ab17aec28e571845..07f9ba5a0763e3df5580d15c003d3d7a2b65de52 100644 --- a/layout.sty +++ b/layout.sty @@ -36,6 +36,7 @@ \raggedcolumns \RequirePackage{graphicx} \RequirePackage{etoolbox} +\RequirePackage{xparse} \RequirePackage{titlesec,titletoc} \RequirePackage{fancyhdr} \RequirePackage{needspace} @@ -828,18 +829,18 @@ Roll & Result \\ {\end{tabular}} -\newenvironment{exampletext}[1][\needspace{2em}\vspace{.3cm}\rule{.9\linewidth}{0.2pt}\vspace{.3em}]{ - \iftoggle{verbose}{ - #1 - \it - }{} -}{% - \iftoggle{verbose}{% +\NewDocumentEnvironment{exampletext}% + { O{\needspace{2em}\vspace{.3cm}\rule{.9\linewidth}{0.2pt}\vspace{.3em}} +b }% + {\iftoggle{verbose}{#1 - \rule{.9\linewidth}{0.2pt}% + #2}{}} + { + \iftoggle{verbose}{ - }{}% -} + \rule{.9\linewidth}{0.2pt} + + }{}% + } \newcommand\sideBySide[2]{ \end{multicols}