admin管理员组文章数量:1403443
I would like to define tcolorboxes including a user specified blank space (purpose: having a question/answer box for students to fill) that can be broken. For example, here is what I would like to have :
----------------- % Begin of tcolorbox
Some preliminary text \lipsum[1]
%%% exactly X cm blank vertical space below (may it be broken or not) %%%
----------------- % End of tcolorbox
The difficulty comes when the breakable tcolorbox gets broken: I've tried to use \vspace{}
after \tcbbreak
or tcblower
, specify an explicit height
to the tcolorbox's parameters (that fails because of the breakable
option), use height fixed for
... but no option seems valid for having exactly the desired height.
Either specifying the blank space height of the total tcolorbox height would be fine.
Does anyone would have an idea on how to achieve this?
MRE:
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\begin{document}
\newtcolorbox{box_test}{enhanced,breakable,title={Title}}
\lipsum[1-3]
\begin{box_test}
\lipsum[1]
\vspace{10cm}
Exactly 10cm empty space above wanted across page break.
\end{box_test}
\begin{box_test}
\lipsum[1]
\vspace{10cm}
Exactly 10cm empty space above obtained without page break.
\end{box_test}
\end{document}
I would like to define tcolorboxes including a user specified blank space (purpose: having a question/answer box for students to fill) that can be broken. For example, here is what I would like to have :
----------------- % Begin of tcolorbox
Some preliminary text \lipsum[1]
%%% exactly X cm blank vertical space below (may it be broken or not) %%%
----------------- % End of tcolorbox
The difficulty comes when the breakable tcolorbox gets broken: I've tried to use \vspace{}
after \tcbbreak
or tcblower
, specify an explicit height
to the tcolorbox's parameters (that fails because of the breakable
option), use height fixed for
... but no option seems valid for having exactly the desired height.
Either specifying the blank space height of the total tcolorbox height would be fine.
Does anyone would have an idea on how to achieve this?
MRE:
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\begin{document}
\newtcolorbox{box_test}{enhanced,breakable,title={Title}}
\lipsum[1-3]
\begin{box_test}
\lipsum[1]
\vspace{10cm}
Exactly 10cm empty space above wanted across page break.
\end{box_test}
\begin{box_test}
\lipsum[1]
\vspace{10cm}
Exactly 10cm empty space above obtained without page break.
\end{box_test}
\end{document}
Share
Improve this question
edited Mar 20 at 14:39
Mathieu Coquerelle
asked Mar 20 at 11:05
Mathieu CoquerelleMathieu Coquerelle
1015 bronze badges
1
- Did you check this tex.stackexchange/questions/194427/… – Naveed Ahmed Commented Mar 20 at 11:17
1 Answer
Reset to default 0You could add empty lines instead of just one fixed space (adjust the number of lines to whatever gives you the desired amount of space):
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\begin{document}
\newtcolorbox{box_test}{enhanced,breakable,title={Title}}
\lipsum[1-3]
\begin{box_test}
\lipsum[1]
\foreach \macro in {1,...,20}{\mbox{}\par}
Exactly 10cm empty space above wanted across page break.
\end{box_test}
\begin{box_test}
\lipsum[1]
\foreach \macro in {1,...,20}{\mbox{}\par}
Exactly 10cm empty space above obtained without page break.
\end{box_test}
\end{document}
本文标签: latexHow can I specify a vertical spacing within a breakable tcolorboxStack Overflow
版权声明:本文标题:latex - How can I specify a vertical spacing within a breakable tcolorbox? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744414474a2605121.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论