0

I want to wrap a figure so that it is on the right side of the paragraph but when I try to compile it, I get these errors:

enter image description here

This is my code for that part:

\documentclass[12pt]{extarticle}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{circuitikz}
\usepackage[margin=0.5in]{geometry}
\usepackage{multicol}
\usepackage{subcaption}
\usepackage{hyperref}
\usepackage{wrapfig} 
\begin{document}
\subsection{Wheatstone Bridge}
    \begin{wrapfigure}{r}{0.5\textwidth}
        \includegraphics[width=0.5\linewidth]{Images/Wheatstonebridge.png}
    \end{wrapfigure}
A wheatstone bridge is used to \textbf{measure an unknown resistance} value to a high degree of accuracy. It uses 4 resistors set up in a diamond fashion (shown below) and a voltmeter. In the schematic below, R$_x$ is the unknown resistance, R$_1$ and R$_3$ are fixed resistance values (generally the same, but they don't have to be the same, also generally $>$1\% tolerance, but again, not always) and R$_2$ is a variable resistor (potentiometer, this is not always the case, see below). By \textbf{adjusting R$_2$ until the voltmeter reads 0 volts}, you know that the \textbf{ratio between the $\frac{R_1}{R_2}$ and $\frac{R_3}{R_x}$ is equal}.\\
Without changing $R_2$:
\begin{align*}
    V_G=\left(\frac{R_x}{R_3+R_x}-\frac{R_2}{R_1+R_2}\right)
\end{align*}
\end{document}

I have tried changing the \textwidth and \linewidth, but it still doesn't work.

This is what I have so far: enter image description here What do these errors mean and how do I get it to wrap the figure properly?

  • 3
    Please provide a complete minimum working example, something that others can compile. – JPi Jul 17 '19 at 2:56
  • 1
    Using standard article document class it works fine (without any error, any warnings, any bad boxes). For further help we need MWE (Minimal Working Example), a complete small document beginning with \documentclass{...} and ending with \end{document}, which reproduce your problem – Zarko Jul 17 '19 at 3:58
  • please provide an example that demonstrates the problem, The message says that you are using wrapfigure in some enviornment but you have not shown enough example to see the context – David Carlisle Jul 17 '19 at 7:07
  • 1
    but note they are not errors, they are warnings. – David Carlisle Jul 17 '19 at 7:08
1

As I said in my comment, I can't reproduce your warnings. With the following MWE, where i made three small changes:

  • add siunitx to write \SI{>1}{\%} instead of the $>$1\% (not relevant to your problem)
  • move \usepackage{hyperref} to the end of preamble (also not relevant to your problem)
  • instead of \\ on the end of the (i suppose) first paragraph, i insert empty line (\\ is not intended for such purposes. If you not like to have intended paragraphs, add to the your document preamble \setlength\parindent{0pt})

With this small changes I obtain the following result for one column document:

enter image description here

(one warnings related to use circuitikz, no bad boxes)

and for two column document:

enter image description here

(one warnings related to use circuitikz, one bad boxes related to adjusting of words unknown resistance in paragraph using hyphenation)

MWE used in my test:

\documentclass[12pt, 
               twocolumn,   %delete,if your article has only one column
               demo]{extarticle}
%\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{circuitikz}
\usepackage[margin=0.5in]{geometry}
%\usepackage{multicol}   % why you need it?
\usepackage{subcaption}
\usepackage{wrapfig}
\usepackage{siunitx}    % new

\usepackage{lipsum}     % for dummy text
\usepackage{hyperref}   % had to be last in preamble
%\setlength\parindent{0pt}

\begin{document}
\subsection{Wheatstone Bridge}
\lipsum[66]

    \begin{wrapfigure}[8]{r}{0.5\linewidth}
    \vspace{-\baselineskip}
        \includegraphics[width=\linewidth]{Images/Wheatstonebridge.png}
    \end{wrapfigure}
A wheatstone bridge is used to \textbf{measure an unknown resistance} value to a high degree of accuracy. It uses 4 resistors set up in a diamond fashion (shown below) and a voltmeter. In the schematic below, R$_x$ is the unknown resistance, R$_1$ and R$_3$ are fixed resistance values (generally the same, but they don't have to be the same, also generally \SI{>1}{\%} tolerance, but again, not always) and R$_2$ is a variable resistor (potentiometer, this is not always the case, see below). By \textbf{adjusting R$_2$ until the voltmeter reads 0 volts}, you know that the \textbf{ratio between the $\frac{R_1}{R_2}$ and $\frac{R_3}{R_x}$ is equal}.

Without changing $R_2$:
\begin{align*}
    V_G=\left(\frac{R_x}{R_3+R_x}-\frac{R_2}{R_1+R_2}\right)
\end{align*}
\lipsum[1-2]
\end{document}

Conclusion, your MWE (as is in your question) work fine, without any errors, warnings or bad boxes. As mentioned @David Carlisle in his comment, if you receive warnings, you not need to worry, they are only warnings, not errors.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.