2

I did

\floatstyle{boxed}
\restylefloat{figure}

so all of my figures are with frames. This works well, but there is a place I do not want frame, how can I change it locally?

Ginger
  • 1,427

1 Answers1

1

Once you create a figure, it is set in a box that can move around. However, once set, it stays as is. So, you can temporarily change the style by localizing a change and restyling:

enter image description here

\documentclass{article}
\usepackage{float,graphicx}% http://ctan.org/pkg/{float,graphicx}
\floatstyle{boxed}
\restylefloat{figure}
\begin{document}
\begin{figure}
  \includegraphics[width=\linewidth,height=3\baselineskip]{example-image-a}%
  \caption{This is figure one}
\end{figure}
{\floatstyle{plain}
\restylefloat{figure}
\begin{figure}
  \includegraphics[width=\linewidth,height=3\baselineskip]{example-image-b}%
  \caption{This is figure two}
\end{figure}
}
\begin{figure}
  \includegraphics[width=\linewidth,height=3\baselineskip]{example-image-c}%
  \caption{This is figure three}
\end{figure}

\end{document}

It's best though, for the sake of consistency, to wrap this in your own environment, which also localizes the effect:

\newenvironment{noboxfigure}[1][ht]
  {\floatstyle{plain}\restylefloat{figure}%
   \begin{figure}[#1]
  }{\end{figure}}
Werner
  • 603,163