1

I am able to get the image to wrap around the text I want it to (Problem 15) but then the spacing gets carried onto the next set of text (Problem 18) and I don't want it to do that. How can I remove that large space of text from Problem 18?

\documentclass[11pt]{article}
\usepackage[english]{babel}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\usepackage{wrapfig}
\begin{document}
\begin{wrapfigure}[10]{R}{0.25\textwidth} 
    \centering
    \includegraphics[width=0.32\textwidth]{15.png}
\end{wrapfigure}
\section*{Problem 15}
An airplane is flying at a height of $h=900$ft. while watching a target that is $70$ft tall ($H=70$ft.), as shown in the figure. The best view of the target is when $\theta$ is maximum. Write a MATLAB program, that determines the distance $x$ at which $\theta$ is maximum. Define a vector $x$ with elements ranging from $5-$ to $1500$ with spacing of $0.5$. Use this vector to calculate the corresponding values of $\theta$. Then use MATLAB's built-in function $max$ to find the value of $x$ that corresponds to the largest value of $\theta$.\\
\\
\section*{Problem 18}
The intrinsic electrical conductivity of $\sigma$ of a semiconductor can be approximated by:
$$
    \sigma = e^{C-\frac{E_g}{2kT}}
$$
Where $\sigma$ is measured in $(\Omega -m)^{-1}$, $E_g$ is the band gap energy, $k$ is Boltzmann's constant $(8.62\times 10^{-5} ev/K)$, and $T$ is temperature in kelvins. For Germanium, $C=13.83$ and $E_g=0.67ev$. Write a program in a script file that calculates the intrinsic electrical conductivity for Germanium for various temperatures. The Values of the temperature should be read from and xls spreadsheet suing the $xlsread$ command. The output should be presented as a table where the first column is the temperature and the second column is the intrinsic electrical conductivity. Use the following values for temperate: $400, 435, 475, 500, 520,$ and $545 K$.  
\end{document}

enter image description here

Priscilla96
  • 59
  • 1
  • 3
  • Please provide code which we can compile to reproduce the problem you want help with. Make a minimal document demonstrating the issue, copy and paste the code into your question, highlight it and click the '{}` button or ctrl+k to format. – cfr Feb 26 '18 at 03:48
  • 2
    Never use \\ to end a line outside special environments, such as tabular. You are not ending any paragraphs here, and this is certainly not going to help with wrapfig, even if fixing it doesn't solve the problem. Do not use $$ for display maths in LaTeX: use \[ and \] instead. – cfr Feb 26 '18 at 03:52
  • But I seem to remember you can't use wrapfig near section macros. – cfr Feb 26 '18 at 03:52
  • 1
    I changed the $$ to [ and ] as you suggested. That didn't seem to help with the spacing though. – Priscilla96 Feb 26 '18 at 03:59
  • 1
    First, you specified 10 lines of space, which is way too much. If you leave that optional value off, it will use the actual size of the image instead. More useful is the undocumented macro \WFclear which will stop the indentation immediately. – John Kormylo Feb 26 '18 at 04:04
  • You really ought not end lines with \\. And I did not say changing the $$ would fix this spacing problem. It will just fix other spacing problems. @JohnKormylo Do you want to answer now we have code? – cfr Feb 26 '18 at 05:09

1 Answers1

1

You will note that the overhang is also computed automatically. Due to the section* and \intertext, \WFclear is still needed.

You might also look at the \wrapspacer macro I developed for this question.

\documentclass[11pt]{article}
\usepackage[english]{babel}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\usepackage{wrapfig}
\begin{document}

\begin{wrapfigure}{R}{0.25\textwidth}
    \centering
    \includegraphics[width=0.32\textwidth]{example-image}
\end{wrapfigure}
\section*{Problem 15}
An airplane is flying at a height of $h=900$ft. while watching a target that is $70$ft tall ($H=70$ft.), as shown in the figure. The best view of the target is when $\theta$ is maximum. Write a MATLAB program, that determines the distance $x$ at which $\theta$ is maximum. Define a vector $x$ with elements ranging from $5-$ to $1500$ with spacing of $0.5$. Use this vector to calculate the corresponding values of $\theta$. Then use MATLAB's built-in function $max$ to find the value of $x$ that corresponds to the largest value of $\theta$.\WFclear

\section*{Problem 18}
The intrinsic electrical conductivity of $\sigma$ of a semiconductor can be approximated by:
\[
    \sigma = e^{C-\frac{E_g}{2kT}}
\]
Where $\sigma$ is measured in $(\Omega -m)^{-1}$, $E_g$ is the band gap energy, $k$ is Boltzmann's constant $(8.62\times 10^{-5} ev/K)$, and $T$ is temperature in kelvins. For Germanium, $C=13.83$ and $E_g=0.67ev$. Write a program in a script file that calculates the intrinsic electrical conductivity for Germanium for various temperatures. The Values of the temperature should be read from and xls spreadsheet suing the $xlsread$ command. The output should be presented as a table where the first column is the temperature and the second column is the intrinsic electrical conductivity. Use the following values for temperate: $400, 435, 475, 500, 520,$ and $545 K$.  
\end{document}
John Kormylo
  • 79,712
  • 3
  • 50
  • 120