# Custom Wraptable Environment [duplicate]

This question already has an answer here:

Let's say I have something like this

text text text

\begin{mywraptable}{r}{6cm}
my beautiful table
\end{mywraptable}

text text text


And now I define the following custom environment:

\newenvironment{mywraptable}[3]{%
\begin{wraptable}{#1}{#2}
\caption{#3}
}{%
\end{wraptable}
}


Why does the following not properly "wrap" with the surrounding text?

text text text

\begin{mywraptable}{r}{6cm}{hello}
my beautiful table
\end{mywraptable}

text text text

-

## marked as duplicate by Werner, Kurt, Thorsten, lockstep, Peter GrillMar 24 '13 at 16:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

## 1 Answer

I discovered this question was a duplicate of Defining a custom wrapfig environemnt and was able to solve the issue by replacing \begin{wraptable} with \wraptable and \end{wraptable} with \endwraptable.

-