# Wrapfig alignment argument is not being obeyed [closed]

So I've been working on a how-to guide and most of the images seem to be aligning correctly withing the \wrapfigure{} sections, until I reach this section:

\documentclass{article}
\usepackage{graphicx}
\usepackage{wrapfig}
\title{Using Wordpress}
\author{Faris Chebib}
\begin{document}
\maketitle
…
Multimedia refers to images, audio, or videos and can be added to any of your
posts. Simply select the type of media you wish to add by selecting the
appropriate icon immediately above the content-entry box (below the title
input field; see fig~\ref{fig:post_media1}).

\begin{wrapfigure}{r}{0.5\textwidth}
\centering
\caption{Adding an image (or other multimedia) begins by selecting the
\label{fig:post_media1}
\end{wrapfigure}

Once the image upload icon is selected, a media menu will appear (see
(see fig~\ref{fig:select_image_fb})
or use a previously uploaded image in your post. Other kinds of multimedia
(such as audio and video) are also available in this menu. To use a
previously uploaded image, click on the \textit{Media Library} tab and select

\begin{wrapfigure}{l}{0.5\textwidth}
\centering
\caption{To upload new media, select the \textit{select files}
fig~\ref{fig:select_image_fb}).}
\label{fig:post_media2}
\end{wrapfigure}

When your image has been selected and has successfully uploaded, you will
need to make some last adjustments with respect to how the image (or other
media) is layed into'' the post. Once you make these selections, remember
to click on the \textit{Insert into Post} button (see
fig~\ref{fig:insert_image}).

% THIS FIGURE SHOULD ALIGN RIGHT, BUT STAYS LEFT (Same for all {r} following)
\begin{wrapfigure}{r}{0.5\textwidth}
\centering
\includegraphics[width=0.48\textwidth]{select_image_fb.png}
\caption{Selecting an image from your local filesystem.}
\label{fig:select_image_fb}
\end{wrapfigure}

Once the image is inserted into the page (see
fig~\ref{fig:successful_insert}) you can continue editing the post as usual.
To adjust any image properties, or to remove the image, simply click on the
image and click on the appropriate button appearing on the image (the left
button accesses image editing functions while the right button deletes the
media).

\begin{wrapfigure}{l}{0.5\textwidth}
\centering
\includegraphics[width=0.48\textwidth]{media_library.png}
\caption{To select from previously uploaded images, click on the
\textit{Media Library Tab} and select the image you want to use.}
\label{fig:media_library}
\end{wrapfigure}

To add more multimedia, simply click on the appropriate media icon again and

\begin{wrapfigure}{r}{0.5\textwidth}
\centering
\includegraphics[width=0.48\textwidth]{insert_image.png}
adjustments to the style of the media as it is presented onto the post.}
\label{fig:insert_image}
\end{wrapfigure}

page. This is the text that one can click on in order to open another web
site. To add a link, simply highlight the text you would like to turn into a
selected, be sure to add the full \textit{URL} (Uniform resource locater;
\textit{eg:} \texttt{http://example.com}). This will turn the selected text
into a link to the \textit{URL} you specified.

\begin{wrapfigure}{l}{0.5\textwidth}
\centering
\includegraphics[width=0.48\textwidth]{successful_insert.png}
\caption{A successfully inserted image in a Blog Post.}
\label{fig:successful_insert}
\end{wrapfigure}

To format your text, simply select the text you would like to format by
clicking on the text and dragging the cursor until the selection matches the
text you would like to select. Once that text is selected, click on the font
format you would like to apply (on the top of the content box). For example,
you may click the \textbf{B} icon in order to make the font bold,
\textbf{like this} or you may select the \textit{I} icon in order to make
italicized text, \textit{like this}.

\subsection*{Publishing}
Finally, the publish box on the upper-right of the entry allows you to set
the date when the entry will be published. Alternately, if the entry is not
ready for public viewing, you may set the status to \textit{draft} and change
the visibility. You may also use the \textit{preview} button to produce a
sample preview of the page you are about to publish. It is always good
practice to create a preview of the entry before publishing a public version.

When you want to add content which isn't time-sensitive, such as an
\textit{About} page or a location information page, you will want to add a
select \textit{Pages}$>$\textit{Add New}. Once selected, you will be

\begin{wrapfigure}{r}{0.5\textwidth}
\centering
page which never expires.}
\end{wrapfigure}

When adding a static, you may also want to add some multimedia. The method of
adding media is the exact same as the method described above. Remember, the
only difference between adding a Blog Post and a Static Page is that the
static page is \textit{not} time-sensitive.

Events are similar to blog posts, but in addition to being time-sensitive,
also include a location entry stating where the event will take place. It is
important to list the location when adding an event, even if the location is
a virtual space (such as an Internet chatroom or webpage). To add an event,

Ok, so I think I figured out what's causing the problem. It seems that there was an issue following the \ref command with \begin{wrapfigure} and the alginment environment was being carried over. I simply moved a sentence after the end of that parenthetical statement and things seems to be dandy. – Octaflop Nov 19 '11 at 1:13