Floatrow 包在图形环境中受到影响

Floatrow 包在图形环境中受到影响

我正在使用 floatrow 包创建盒子环境。如果我在 tex 文件中声明 floatrow 包,则正常图形框架会受到影响。

平均能量损失

\documentclass[twocolumn]{article}

\usepackage{graphics}
\usepackage{graphicx}
\usepackage{floatrow}%%%%%%%
\usepackage{lipsum}
\makeatother
\DeclareNewFloatType{Box}{%
  placement=htbp,%
  name=BOX,%
}%

\floatsetup[Box]{%
  style=BOXED,%
  capposition=top,%
  justification=justified}%



\newenvironment{BOX}[2][htbp]{%
\begin{Box}[#1]%
    \ifx\relax#2\relax\else\caption{\textbf{#2}\vspace*{-6.5pt}}\fi%
}{\end{Box}}%

\newenvironment{BOX*}[2][htbp]{%
  \begin{Box*}[#1]%
    \ifx\relax#2\relax\else\caption{\textbf{#2}\vspace*{-6.5pt}}\fi%
}{\end{Box*}}

\newcommand{\processfigure}[2]{\centering\fbox{\parbox{82mm}{\rightskip12pt\centering#1\vspace*{-3.5pt}\par\rightskip12pt%
\caption{#2}}}}%

\makeatletter

\begin{document}


\lipsum[1-5]

\begin{BOX}[!t]{The polymers were dissolved in dimethylsulfoxide (DMSO)}
The polymers were dissolved in dimethylsulfoxide (DMSO) at  The ratio polymer/DMSO was about 1:10 (mg/mL). After evaporation to around 1/3 of the original volume, the solution was spread on a glass plate, using a doctor-blade type equipment, and then put in the oven for the casting treatment at 120 for 24\,h. After the casting, membranes were stored at ambient humidity and peeled off (called in the following ``first treatment'').
\end{BOX}

\lipsum[6-10]


\begin{figure*}[!t]
\processfigure{Figure Placed here\vspace*{12pt}}
{\textbf{\boldmath Cross-link reaction for SPEEK (color code: gray C, yellow S, red O)}.\label{fig:1}}
\end{figure*}

\lipsum[11-15]

\end{document}

在声明 floatrow 包之前,图形环境输出显示如下:

在此处输入图片描述

声明 floatrow 包后图形环境输出如下所示:

在此处输入图片描述

使用 flotrow 包定义的 box 环境如下所示

在此处输入图片描述

我不知道如果我使用 floatrow 包,什么原因会影响图形环境。请提供建议。

答案1

您已经在使用该floatrow包,它允许您figure简单地声明boxed

\floatsetup[figure]{style=BOXED,captionskip=25pt}

captionskip由于您想在标题前留出一些空格,所以我添加了。

然后,不要使用

\begin{figure*}[!t]
\processfigure{Figure Placed here\vspace*{12pt}}
{\textbf{\boldmath Cross-link reaction for SPEEK (color code: gray C, yellow S, red O)}.\label{fig:1}}
\end{figure*}

使用自定义命令\processfigure在 周围构建一个框,只需按以下方式figure使用:\ffigbox

\begin{figure*}[!t]
\ffigbox[82mm]
{Figure Placed here}
{\caption{\textbf{\boldmath Cross-link reaction for SPEEK (color code: gray C, yellow S, red O)}}\label{fig:1}}
\end{figure*}

平均能量损失

\documentclass[twocolumn]{article}

\usepackage{graphicx}
\usepackage{floatrow}%%%%%%%
\usepackage{lipsum}

\DeclareNewFloatType{Box}{%
  placement=htbp,%
  name=BOX,%
}%

\floatsetup[Box]{%
  style=BOXED,%
  capposition=top,%
  justification=justified}%



\newenvironment{BOX}[2][htbp]{%
\begin{Box}[#1]%
    \ifx\relax#2\relax\else\caption{\textbf{#2}\vspace*{-6.5pt}}\fi%
}{\end{Box}}%

\newenvironment{BOX*}[2][htbp]{%
  \begin{Box*}[#1]%
    \ifx\relax#2\relax\else\caption{\textbf{#2}\vspace*{-6.5pt}}\fi%
}{\end{Box*}}


\floatsetup[figure]{style=BOXED,captionskip=25pt}

\begin{document}


\lipsum[1-5]

\begin{BOX}[!t]{The polymers were dissolved in dimethylsulfoxide (DMSO)}
The polymers were dissolved in dimethylsulfoxide (DMSO) at  The ratio polymer/DMSO was about 1:10 (mg/mL). After evaporation to around 1/3 of the original volume, the solution was spread on a glass plate, using a doctor-blade type equipment, and then put in the oven for the casting treatment at 120 for 24\,h. After the casting, membranes were stored at ambient humidity and peeled off (called in the following ``first treatment'').
\end{BOX}

\lipsum[6-10]

\begin{figure*}[!t]
\ffigbox[82mm]
{Figure Placed here}
{\caption{\textbf{\boldmath Cross-link reaction for SPEEK (color code: gray C, yellow S, red O)}}\label{fig:1}}
\end{figure*}

\lipsum[11-15]

\end{document} 

输出:

在此处输入图片描述

相关内容