我已经使用下面的代码创建了新的浮点数,它运行良好。
\newfloat{map}{tbp}{lomap}
\floatname{map}{Map}
\newfloat{photo}{htbp}{lop}
\floatname{photo}{Photo}
我需要旋转这些 folats(sidewaysphoto),所以我使用了下面的代码,但只有浮动在旋转,而标题没有显示。请参阅下面的代码
\documentclass[twocolumn]{article}
\usepackage[demo]{graphicx}
\usepackage{float}
\usepackage{rotating}
\newcommand{\lipsum}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. In malesuada consequat mollis. Duis viverra vestibulum quam id vehicula. Donec vel tellus a orci adipiscing euismod. Suspendisse lacinia metus lorem. Vivamus pellentesque, lacus quis blandit tincidunt, elit nunc ullamcorper enim, ut laoreet metus risus sed neque. Sed ac nibh ante, pellentesque vehicula sem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel libero leo. Donec aliquam placerat arcu, et ultrices leo semper et. Curabitur dignissim, eros vitae dignissim porta, velit arcu vehicula tortor, vel blandit sapien magna in risus.}%
\newfloat{map}{tbp}{lomap}
\floatname{map}{Map}
%\DeclareDelayedFloat{map}{Maps}
\newfloat{photo}{htbp}{lop}
\floatname{photo}{Photo}
%\DeclareDelayedFloat{photo}{Photo}
\newfloat{scheme}{htbp}{scheme}
\floatname{scheme}{scheme}
\makeatletter
\def\sidewaysphoto{\@rotfloat{photo}}
\let\endsidewaysphoto\end@rotfloat
\newenvironment{sidewaysphoto*}
{\@rotdblfloat{photo}}
{\end@rotdblfloat}
\makeatother
\begin{document}
\lipsum
\begin{sidewaysphoto}
\centering
\includegraphics{myPhoto}
\caption{xxxxxxxMy Photo 1}
\end{sidewaysphoto}
\lipsum
\begin{photo}
\centering
\includegraphics{myPhoto}
\caption{My Photo 2}
\end{photo}
\lipsum
\begin{figure}
\centering
\includegraphics{myFigure}
\caption{My Figure}
\end{figure}
\lipsum
\begin{map}
\centering
\includegraphics{myMap}
\caption{My Map}
\end{map}
\lipsum
\end{document}
答案1
看起来 float 包\caption
被它自己的版本替换了。
这将恢复默认设置\caption
并使用“每列一个图形”的侧向图形方法。
\documentclass[twocolumn]{article}
\usepackage[demo]{graphicx}
\let\normalcaption=\caption
\usepackage{float}
\let\caption=\normalcaption
\usepackage{environ}
%\usepackage{rotating}
\newcommand{\lipsum}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. In malesuada consequat mollis. Duis viverra vestibulum quam id vehicula. Donec vel tellus a orci adipiscing euismod. Suspendisse lacinia metus lorem. Vivamus pellentesque, lacus quis blandit tincidunt, elit nunc ullamcorper enim, ut laoreet metus risus sed neque. Sed ac nibh ante, pellentesque vehicula sem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel libero leo. Donec aliquam placerat arcu, et ultrices leo semper et. Curabitur dignissim, eros vitae dignissim porta, velit arcu vehicula tortor, vel blandit sapien magna in risus.}%
\newfloat{map}{tbp}{lomap}
\floatname{map}{Map}
%\DeclareDelayedFloat{map}{Maps}
\newfloat{photo}{htbp}{lop}
\floatname{photo}{Photo}
%\DeclareDelayedFloat{photo}{Photo}
\newfloat{scheme}{htbp}{scheme}
\floatname{scheme}{scheme}
\newcommand{\nullcaption}[2][]{}% eat caption and arguments
\NewEnviron{sidewaysphoto}[1][htbp]%
{\sbox0{\let\caption=\nullcaption \BODY}% measure image sans caption
\begin{photo}[#1]
\rotatebox{90}{\begin{minipage}[c][\columnwidth][c]{\wd0}
\BODY
\end{minipage}}%
\end{photo}}%
\NewEnviron{sidewaysphoto*}[1][tp]%
{\sbox0{\let\caption=\nullcaption \BODY}% measure image sans caption
\begin{photo*}[#1]
\rotatebox{90}{\begin{minipage}[c][\textwidth][c]{\wd0}
\BODY
\end{minipage}}%
\end{photo*}}%
\makeatother
\begin{document}
\lipsum
\begin{sidewaysphoto}
\centering
\includegraphics{myPhoto}
\caption{xxxxxxxMy Photo 1}
\end{sidewaysphoto}
\lipsum
\begin{photo}
\centering
\includegraphics{myPhoto}
\caption{My Photo 2}
\end{photo}
\lipsum
\begin{figure}
\centering
\includegraphics{myFigure}
\caption{My Figure}
\end{figure}
\lipsum
\begin{map}
\centering
\includegraphics{myMap}
\caption{My Map}
\end{map}
\lipsum
\end{document}
这样就允许每列有多个侧向浮动。
\documentclass[twocolumn]{article}
\usepackage[demo]{graphicx}
\let\normalcaption=\caption
\usepackage{float}
\let\caption=\normalcaption
\usepackage{environ}
%\usepackage{rotating}
\newcommand{\lipsum}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. In malesuada consequat mollis. Duis viverra vestibulum quam id vehicula. Donec vel tellus a orci adipiscing euismod. Suspendisse lacinia metus lorem. Vivamus pellentesque, lacus quis blandit tincidunt, elit nunc ullamcorper enim, ut laoreet metus risus sed neque. Sed ac nibh ante, pellentesque vehicula sem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel libero leo. Donec aliquam placerat arcu, et ultrices leo semper et. Curabitur dignissim, eros vitae dignissim porta, velit arcu vehicula tortor, vel blandit sapien magna in risus.}%
\newfloat{map}{tbp}{lomap}
\floatname{map}{Map}
%\DeclareDelayedFloat{map}{Maps}
\newfloat{photo}{htbp}{lop}
\floatname{photo}{Photo}
%\DeclareDelayedFloat{photo}{Photo}
\newfloat{scheme}{htbp}{scheme}
\floatname{scheme}{scheme}
\newcommand{\nullcaption}[2][]{\par}% eat caption and arguments
\NewEnviron{sidewaysphoto}[1][htbp]%
{\sbox0{\let\caption=\nullcaption \BODY}% measure image sans caption
\begin{photo}[#1]
\rotatebox{90}{\begin{minipage}[c][\columnwidth][c]{\wd0}
\BODY
\end{minipage}}%
\end{photo}}%
\NewEnviron{sidewaysphoto*}[1][tp]%
{\sbox0{\let\caption=\nullcaption \BODY}% measure image sans caption
\begin{photo*}[#1]
\rotatebox{90}{\begin{minipage}[c][\textwidth][c]{\wd0}
\BODY
\end{minipage}}%
\end{photo*}}%
\makeatother
\begin{document}
\lipsum
\begin{sidewaysphoto}
\centering
\includegraphics{myPhoto}
\caption{xxxxxxxMy Photo 1}
\end{sidewaysphoto}
\lipsum
\begin{photo}
\centering
\includegraphics{myPhoto}
\caption{My Photo 2}
\end{photo}
\lipsum
\begin{figure}
\centering
\includegraphics{myFigure}
\caption{My Figure}
\end{figure}
\lipsum
\begin{map}
\centering
\includegraphics{myMap}
\caption{My Map}
\end{map}
\lipsum
\end{document}