Skip to main content
deleted 4 characters in body
Source Link

I have defined a command that uses the minipage environment to format an "example" question within my document.

\newcounter{Example} \newcommand{\example}[3]{ % \refstepcounter{Example} \fbox{% \begin{minipage}{\textwidth} \subsubsection{Example \theExample:\textsf{\ #1}} {\leftskip 1em \rightskip 1em #2 } \vskip 0.5em \colorbox{lightergray}{ % \begin{minipage}[c]{0.98\textwidth} #3 \end{minipage} % } %end subsubsection{Example} \end{minipage} } % } 

(This code creates a command \example{<title>}{<question>}{<answer>}).

To produce this:

Current output of above code

However I need this to be able to split across multiple page breaks. At the moment the following is produced at a page break:

Undesired page splitting

This is not desirable. I know this is because of the minipage environment. Is there a way that I can produce this same output whilst allowing page breaks? (Ideally I would like no border at the bottom of the first page and no top border on the new page.)

I am compiling with TeX4ht so require either common packages or standard LaTeX/TeX.

I understand a type of list environment may be useful here but I'm unsure how to apply this to this specific case.

I have defined a command that uses the minipage environment to format an "example" question within my document.

\newcounter{Example} \newcommand{\example}[3]{ % \refstepcounter{Example} \fbox{% \begin{minipage}{\textwidth} \subsubsection{Example \theExample:\textsf{\ #1}} {\leftskip 1em \rightskip 1em #2 } \vskip 0.5em \colorbox{lightergray}{ % \begin{minipage}[c]{0.98\textwidth} #3 \end{minipage} % } %end subsubsection{Example} \end{minipage} } % } 

(This code creates a command \example{<title>}{<question>}{<answer>}).

To produce this:

Current output of above code

However I need this to be able to split across multiple page breaks. At the moment the following is produced at a page break:

Undesired page splitting

This is not desirable. I know this is because of the minipage environment. Is there a way that I can produce this same output whilst allowing page breaks? (Ideally I would like no border at the bottom of the first page and no top border on the new page.)

I am compiling with TeX4ht so require either common packages or standard LaTeX/TeX.

I understand a type of list environment may be useful here but I'm unsure how to apply this to this specific case.

I have defined a command that uses the minipage environment to format an "example" question within my document.

\newcounter{Example} \newcommand{\example}[3]{% \refstepcounter{Example} \fbox{% \begin{minipage}{\textwidth} \subsubsection{Example \theExample:\textsf{\ #1}} {\leftskip 1em \rightskip 1em #2 } \vskip 0.5em \colorbox{lightergray}{% \begin{minipage}[c]{0.98\textwidth} #3 \end{minipage}% } %end subsubsection{Example} \end{minipage} }% } 

(This code creates a command \example{<title>}{<question>}{<answer>}).

To produce this:

Current output of above code

However I need this to be able to split across multiple page breaks. At the moment the following is produced at a page break:

Undesired page splitting

This is not desirable. I know this is because of the minipage environment. Is there a way that I can produce this same output whilst allowing page breaks? (Ideally I would like no border at the bottom of the first page and no top border on the new page.)

I am compiling with TeX4ht so require either common packages or standard LaTeX/TeX.

I understand a type of list environment may be useful here but I'm unsure how to apply this to this specific case.

Added `TeX4ht` requirements.
Source Link

I have defined a command that uses the minipage environment to format an "example" question within my document.

\newcounter{Example} \newcommand{\example}[3]{ % \refstepcounter{Example} \fbox{% \begin{minipage}{\textwidth} \subsubsection{Example \theExample:\textsf{\ #1}} {\leftskip 1em \rightskip 1em #2 } \vskip 0.5em \colorbox{lightergray}{ % \begin{minipage}[c]{0.98\textwidth} #3 \end{minipage} % } %end subsubsection{Example} \end{minipage} } % } 

(This code creates a command \example{<title>}{<question>}{<answer>}).

To produce this:

Current output of above code

However I need this to be able to split across multiple page breaks. At the moment the following is produced at a page break:

Undesired page splitting

This is not desirable. I know this is because of the minipage environment. Is there a way that I can produce this same output whilst allowing page breaks? (Ideally I would like no border at the bottom of the first page and no top border on the new page.)

I am compiling with TeX4ht so require either common packages or standard LaTeX/TeX.

I understand a type of list environment may be useful here but I'm unsure how to apply this to this specific case.

I have defined a command that uses the minipage environment to format an "example" question within my document.

\newcounter{Example} \newcommand{\example}[3]{ % \refstepcounter{Example} \fbox{% \begin{minipage}{\textwidth} \subsubsection{Example \theExample:\textsf{\ #1}} {\leftskip 1em \rightskip 1em #2 } \vskip 0.5em \colorbox{lightergray}{ % \begin{minipage}[c]{0.98\textwidth} #3 \end{minipage} % } %end subsubsection{Example} \end{minipage} } % } 

(This code creates a command \example{<title>}{<question>}{<answer>}).

To produce this:

Current output of above code

However I need this to be able to split across multiple page breaks. At the moment the following is produced at a page break:

Undesired page splitting

This is not desirable. I know this is because of the minipage environment. Is there a way that I can produce this same output whilst allowing page breaks? (Ideally I would like no border at the bottom of the first page and no top border on the new page.)

I understand a type of list environment may be useful here but I'm unsure how to apply this to this specific case.

I have defined a command that uses the minipage environment to format an "example" question within my document.

\newcounter{Example} \newcommand{\example}[3]{ % \refstepcounter{Example} \fbox{% \begin{minipage}{\textwidth} \subsubsection{Example \theExample:\textsf{\ #1}} {\leftskip 1em \rightskip 1em #2 } \vskip 0.5em \colorbox{lightergray}{ % \begin{minipage}[c]{0.98\textwidth} #3 \end{minipage} % } %end subsubsection{Example} \end{minipage} } % } 

(This code creates a command \example{<title>}{<question>}{<answer>}).

To produce this:

Current output of above code

However I need this to be able to split across multiple page breaks. At the moment the following is produced at a page break:

Undesired page splitting

This is not desirable. I know this is because of the minipage environment. Is there a way that I can produce this same output whilst allowing page breaks? (Ideally I would like no border at the bottom of the first page and no top border on the new page.)

I am compiling with TeX4ht so require either common packages or standard LaTeX/TeX.

I understand a type of list environment may be useful here but I'm unsure how to apply this to this specific case.

Source Link

Minipages across page breaks

I have defined a command that uses the minipage environment to format an "example" question within my document.

\newcounter{Example} \newcommand{\example}[3]{ % \refstepcounter{Example} \fbox{% \begin{minipage}{\textwidth} \subsubsection{Example \theExample:\textsf{\ #1}} {\leftskip 1em \rightskip 1em #2 } \vskip 0.5em \colorbox{lightergray}{ % \begin{minipage}[c]{0.98\textwidth} #3 \end{minipage} % } %end subsubsection{Example} \end{minipage} } % } 

(This code creates a command \example{<title>}{<question>}{<answer>}).

To produce this:

Current output of above code

However I need this to be able to split across multiple page breaks. At the moment the following is produced at a page break:

Undesired page splitting

This is not desirable. I know this is because of the minipage environment. Is there a way that I can produce this same output whilst allowing page breaks? (Ideally I would like no border at the bottom of the first page and no top border on the new page.)

I understand a type of list environment may be useful here but I'm unsure how to apply this to this specific case.