![Floatrow 包在图形环境中受到影响](https://linux22.com/image/306405/Floatrow%20%E5%8C%85%E5%9C%A8%E5%9B%BE%E5%BD%A2%E7%8E%AF%E5%A2%83%E4%B8%AD%E5%8F%97%E5%88%B0%E5%BD%B1%E5%93%8D.png)
我正在使用 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}
输出: