I need to write a boxed text as like as:
Currently, I am using
\documentclass{book}
\usepackage{framed}
\begin{document}
\begin{framed}
\section{Box 15...}
...
\end{framed}
\end{document}
Please advise.
I need to write a boxed text as like as:
Currently, I am using
\documentclass{book}
\usepackage{framed}
\begin{document}
\begin{framed}
\section{Box 15...}
...
\end{framed}
\end{document}
Please advise.
Another solution with tcolorbox package.
\documentclass{article}
\usepackage{lipsum}
\usepackage[most]{tcolorbox}
\usepackage{lmodern}
\newtcolorbox[auto counter]{mybox}[2][]{%
breakable,
enhanced,
sharp corners,
colback=white,
fonttitle=\bfseries,
title=Box~\thetcbcounter:\ #2,
enlarge bottom at break by=5mm,
enlarge top at break by=5mm,
overlay first={%
\draw[black, line width=0.5mm](frame.south west)--(frame.south east);
\node[anchor=north east] at (frame.south east) {continued on next page};
},
overlay middle={%
\draw[black, line width=0.5mm](frame.south west)--(frame.south east);
\draw[black, line width=0.5mm](frame.north west)--(frame.north east);
\node[anchor=north east] at (frame.south east) {continued on next page};
\node[anchor=south west] at (frame.north west) {continued from next page};
},
overlay last={%
\draw[black, line width=0.5mm](frame.north west)--(frame.north east);
\node[anchor=south west] at (frame.north west) {continued from next page};},
#1
}
\begin{document}
\lipsum[1-2]
\begin{mybox}{Combined off-springs size theories}
\lipsum[3-16]
\end{mybox}
\end{document}
Based on egregs answer to "Breakable vboxes" I coded the following environment. It collects its vertical input and then breaks it using plainTeX's internal breaking mechanism (\vsplit) and places both part in an \fbox. This will not work for large material which break across three pages, but this feature could be added.
\documentclass{article}
\usepackage{blindtext}% just for example text
\newbox\totalbox
\newbox\partialbox
\newdimen\partialboxdim
\newenvironment{continueframe}{%
\advance\linewidth-2\fboxsep
\advance\linewidth-2\fboxrule
\hsize=\linewidth
\partialboxdim=\dimexpr\pagegoal-\pagetotal-\pageshrink-6pt-\baselineskip\relax
\setbox\totalbox=\vbox\bgroup\begingroup
}{%
\endgraf\endgroup\egroup
\setbox\partialbox=\vsplit\totalbox to\partialboxdim
\par\smallskip
\hbox{\fbox{\vbox{\unvbox\partialbox}}}\nopagebreak
\par\smallskip\mbox{}\hfill\textbf{Continued on next page}\par\pagebreak%
\hbox{\fbox{\vbox{\noindent\textbf{Contuined from last page}\par\smallskip\unvbox\totalbox}}}%
\par\medskip
}
\begin{document}
\blindtext
\blindtext
\blindtext
\begin{continueframe}
\blindtext
\blindtext
\blindtext
\end{continueframe}
\blindtext
\blindtext
\blindtext
\end{document}
tcolorbox or similar. As long as it works for you it is fine, however.
– Martin Scharrer
Jan 22 '19 at 15:15
This may be of some help to you.
The continue package prints "continuation" marks on pages of multipage documents. The marks can be defined as you wish and started and stopped at any point. To read the manual > texdoc continue.
mdframedpackage. Do you need the "continued" markers or can you do without them? – Martin Scharrer Jan 16 '19 at 14:02