跨两个页面的浮动环境

跨两个页面的浮动环境

在我的 Latex 项目中,我定义了一个新的环境以便能够引用枚举。

\DeclareFloatingEnvironment[placement={!ht},name=Liste]{mylist}

唯一的问题是,当将枚举放入这个新环境中时,它不会像以前一样分成两页吗?现在它必须跳到下一页才能在一页上显示整个列表?

\documentclass{article}
\usepackage[norsk]{babel} 
\usepackage{tabularx}
\usepackage{apacite}
\usepackage{hyperref}
\usepackage{enumerate}
\usepackage[normalem]{ulem}
\usepackage{color}
\usepackage{newfloat}
\DeclareFloatingEnvironment[placement={!ht},name=Liste]{mylist}


\begin{document}
poqkweokqw pqok qpok opqkopkop qk opqk opqk poqk opqk opqk qpok qopk qopk qopk qkemwme kwem kkm kwmekmwkemqkmelq mql lqm lqm klqmeklwmqkle mqkl mq qmqm mq mqm qmrkrk kq pqjpij iqjiepjqoiwej iojm kqokqo kqk koqk oqko kqoekqeij imqk mqklenqoineoqn ion poqkweokqw pqok qpok opqkopkop qk opqk opqk poqk opqk opqk qpok qopk qopk qopk qkemwme kwem kkm kwmekmwkemqkmelq mql lqm lqm klqmeklwmqkle mqkl mq qmqm mq mqm qmrkrk kq pqjpij iqjiepjqoiwej iojm kqokqo kqk koqk oqko kqoekqeij imqk mqklenqoineoqn ionpoqkweokqw pqok qpok opqkopkop qk opqk opqk poqk opqk opqk qpok qopk qopk qopk qkemwme kwem kkm kwmekmwkemqkmelq mql lqm lqm klqmeklwmqkle mqkl mq qmqm mq mqm qmrkrk kq pqjpij iqjiepjqoiwej iojm kqokqo kqk koqk oqko kqoekqeij imqk mqklenqoineoqn ionpoqkweokqw pqok qpok opqkopkop qk opqk opqk poqk opqk opqk qpok qopk qopk qopk qkemwme kwem kkm kwmekmwkemqkmelq mql lqm lqm klqmeklwmqkle mqkl mq qmqm mq mqm qmrkrk kq pqjpij iqjiepjqoiwej iojm kqokqo kqk koqk oqko kqoekqeij imqk mqklenqoineoqn ion

\begin{mylist}
\begin{enumerate}
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list


\item many items in my list\item many items in my list\item many items in my list
\item many items in my list
\item many items in my list


\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list

\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\end{enumerate}
\end{mylist}

\end{document}

答案1

您无需将某个东西变成浮点数来使其可引用。

\documentclass{article}


\newcounter{mylist}
\makeatletter
\newenvironment{mylist}{\def\@captype{mylist}}{}
\def\ext@mylist{myl}
\def\fnum@mylist{List\nobreakspace\themylist}
\makeatother
\begin{document}
poqkweokqw pqok qpok opqkopkop qk opqk opqk poqk opqk opqk qpok qopk qopk qopk qkemwme kwem kkm kwmekmwkemqkmelq mql lqm lqm klqmeklwmqkle mqkl mq qmqm mq mqm qmrkrk kq pqjpij iqjiepjqoiwej iojm kqokqo kqk koqk oqko kqoekqeij imqk mqklenqoineoqn ion poqkweokqw pqok qpok opqkopkop qk opqk opqk poqk opqk opqk qpok qopk qopk qopk qkemwme kwem kkm kwmekmwkemqkmelq mql lqm lqm klqmeklwmqkle mqkl mq qmqm mq mqm qmrkrk kq pqjpij iqjiepjqoiwej iojm kqokqo kqk koqk oqko kqoekqeij imqk mqklenqoineoqn ionpoqkweokqw pqok qpok opqkopkop qk opqk opqk poqk opqk opqk qpok qopk qopk qopk qkemwme kwem kkm kwmekmwkemqkmelq mql lqm lqm klqmeklwmqkle mqkl mq qmqm mq mqm qmrkrk kq pqjpij iqjiepjqoiwej iojm kqokqo kqk koqk oqko kqoekqeij imqk mqklenqoineoqn ionpoqkweokqw pqok qpok opqkopkop qk opqk opqk poqk opqk opqk qpok qopk qopk qopk qkemwme kwem kkm kwmekmwkemqkmelq mql lqm lqm klqmeklwmqkle mqkl mq qmqm mq mqm qmrkrk kq pqjpij iqjiepjqoiwej iojm kqokqo kqk koqk oqko kqoekqeij imqk mqklenqoineoqn ion

See list \ref{zzz}:


\begin{mylist}
\caption{This is a list}\label{zzz}
\begin{enumerate}
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list


\item many items in my list\item many items in my list\item many items in my list
\item many items in my list
\item many items in my list


\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list

\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\end{enumerate}
\end{mylist}

\end{document}

答案2

另一种方式,使用capt-of包。这允许您根据具体情况使用浮动环境或非浮动方式(此处显示),但在任何一种情况下都保留相同的字幕功能。

\documentclass{article}

\usepackage{capt-of}
\usepackage{newfloat}
\DeclareFloatingEnvironment[placement={!ht},name=Liste]{mylist}


\begin{document}
poqkweokqw pqok qpok opqkopkop qk opqk opqk poqk opqk opqk qpok qopk qopk qopk qkemwme kwem kkm kwmekmwkemqkmelq mql lqm lqm klqmeklwmqkle mqkl mq qmqm mq mqm qmrkrk kq pqjpij iqjiepjqoiwej iojm kqokqo kqk koqk oqko kqoekqeij imqk mqklenqoineoqn ion poqkweokqw pqok qpok opqkopkop qk opqk opqk poqk opqk opqk qpok qopk qopk qopk qkemwme kwem kkm kwmekmwkemqkmelq mql lqm lqm klqmeklwmqkle mqkl mq qmqm mq mqm qmrkrk kq pqjpij iqjiepjqoiwej iojm kqokqo kqk koqk oqko kqoekqeij imqk mqklenqoineoqn ionpoqkweokqw pqok qpok opqkopkop qk opqk opqk poqk opqk opqk qpok qopk qopk qopk qkemwme kwem kkm kwmekmwkemqkmelq mql lqm lqm klqmeklwmqkle mqkl mq qmqm mq mqm qmrkrk kq pqjpij iqjiepjqoiwej iojm kqokqo kqk koqk oqko kqoekqeij imqk mqklenqoineoqn ionpoqkweokqw pqok qpok opqkopkop qk opqk opqk poqk opqk opqk qpok qopk qopk qopk qkemwme kwem kkm kwmekmwkemqkmelq mql lqm lqm klqmeklwmqkle mqkl mq qmqm mq mqm qmrkrk kq pqjpij iqjiepjqoiwej iojm kqokqo kqk koqk oqko kqoekqeij imqk mqklenqoineoqn ion

\captionof{mylist}{The caption.}
\begin{enumerate}
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list


\item many items in my list\item many items in my list\item many items in my list
\item many items in my list
\item many items in my list


\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list

\item many items in my list
\item many items in my list
\item many items in my list
\item many items in my list
\end{enumerate}
\end{document}

相关内容