0

everyone.

I'm having trouble with the position of a wrapfigure environment. And it's weird because I've managed to accomplish it in the previous page. I'll explain myself.

Here's the code (I've let out everything irrelevant to the problem):

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\numberwithin{equation}{section}
\usepackage{upgreek}
\usepackage{graphicx}
\usepackage{endnotes}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{mathrsfs}
\usepackage[toc]{blindtext}
\usepackage{tocbibind}
\usepackage{enumerate}
\usepackage{float}
\usepackage{multirow}
\usepackage{multicol}
\usepackage[usenames]{color}
\usepackage[hidelinks]{hyperref}
\usepackage[dvipsnames]{xcolor}
\usepackage[spanish, es-tabla]{babel}
\usepackage{flushend}
\usepackage{booktabs}
%\usepackage{underscore}
\usepackage{wrapfig}

\graphicspath{ {./img/} }

\author{\textit{Samuel G. Guerrero Camarero}}

\title{\textbf{Práctica 10. Determinación de la banda prohibida del germanio.}}


\topmargin=-3cm
\oddsidemargin=-0.55cm
\textwidth=18cm
\textheight=25cm
\topmargin=-2cm

\begin{document}
\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{montaje.png}
\caption{Montaje del experimento.}
\label{fig:montaje}
\end{figure}

\section{Resultados y discusión}
\begin{wraptable}{r}{0.3\linewidth}
\centering
\begin{tabular}{|c|c|c|}
\hline
\textbf{T (ºC)} & \textbf{V(V)} & \textbf{$\Delta$V(V)} \\ \hline
35              & 2.676         & 0.004          \\ \hline
49              & 1.553         & 0.004          \\ \hline
57              & 1.138         & 0.004          \\ \hline
59              & 1.084         & 0.004          \\ \hline
67              & 0.7909        & 0.0007         \\ \hline
73              & 0.6701        & 0.0006         \\ \hline
78              & 0.6701        & 0.0006         \\ \hline
83              & 0.4680        & 0.0005         \\ \hline
90              & 0.3749        & 0.0005         \\ \hline
100             & 0.2716        & 0.0004         \\ \hline
98              & 0.2891        & 0.0004         \\ \hline
94              & 0.3187        & 0.0006         \\ \hline
89              & 0.3808        & 0.0005         \\ \hline
83              & 0.4458        & 0.0006         \\ \hline
78              & 0.5539        & 0.0006         \\ \hline
73              & 0.6408        & 0.0006         \\ \hline
67              & 0.8076        & 0.0007         \\ \hline
63              & 0.9587        & 0.0008         \\ \hline
55              & 1.280         & 0.003          \\ \hline
51              & 1.468         & 0.004          \\ \hline
47              & 1.666         & 0.004          \\ \hline
44              & 1.974         & 0.004          \\ \hline
40              & 2.274         & 0.004          \\ \hline
36              & 2.654         & 0.004          \\ \hline
32              & 3.108         & 0.005          \\ \hline
29              & 3.577         & 0.005          \\ \hline
25              & 4.089         & 0.005          \\ \hline
\end{tabular}
\caption{Datos recogidos.}
\label{tab:TempvsV}
\end{wraptable}
Los datos obtenido son los de la tabla \ref{tab:TempvsV}. El error calculado es el que se indica en el manual del multímetro \cite{MANUALMULTIM}, que es 0.05\% del valor leído más 3 dígitos.
\begin{wrapfigure}{l}{\linewidth}
\centering
\includegraphics[scale=0.55]{RvsT.png}
\caption{}
\label{fig:RvsT}
\end{wrapfigure}
 Haciendo uso de la ley de Ohm, (\ref{eq:Ohm}), y sabiendo que la corriente se ha mantenido en todo momento en $(6 \pm 1)$ mA, podemos transformar el voltaje en resistencia. Y representándola en función de la temperatura (pasada a Kelvin), obtenemos la figura \ref{fig:RvsT}, cuyos valores pueden verse en la tabla \ref{tab:TvsR}.\\
 



Usando los valores dados para las constantes de las ecuaciones (\ref{eq:movilidades1}) y (\ref{eq:movilidades2}), podemos sacar el valor del cociente que aparece en la ecuación (\ref{eq:LN1R}),  $C_h/C_e=21.87555$. Con esto, y viendo que la temperatura en nuestro experimento se mantiene dentro del intervalo [290,380] K, la variación en este intervalo del 
\clearpage

segundo término del miembro de la derecha de la ecuación (\ref{eq:LN1R}), es decir, del término
\begin{equation}
ln\left(T^{-0.16}+\frac{C_h}{C_e}T^{-0.83}\right),
\label{eq:termLN}
\end{equation}
es 
\begin{equation}
ln\left(380^{-0.16}+\frac{C_h}{C_e}380^{-0.83}\right)-ln\left(290^{-0.16}+\frac{C_h}{C_e}290^{-0.83}\right) \simeq -0.099255
\label{eq:varLN}
\end{equation}

\begin{wraptable}{l}{0.25\linewidth}
\begin{tabular}{|c|c|c|}
\hline
\textbf{T (K)} & \textbf{R($\Omega$)} & \textbf{$\Delta$R($\Omega$)} \\ \hline
306            & 446.0           & 0.9              \\ \hline
320            & 258.8           & 0.7              \\ \hline
328            & 189.7           & 0.6              \\ \hline
330            & 180.7           & 0.6              \\ \hline
338            & 131.8           & 0.2              \\ \hline
344            & 111.7           & 0.2              \\ \hline
349            & 111.7           & 0.2              \\ \hline
354            & 78.00           & 0.12             \\ \hline
361            & 62.48           & 0.10             \\ \hline
371            & 45.27           & 0.09             \\ \hline
369            & 48.18           & 0.09             \\ \hline
365            & 53.12           & 0.09             \\ \hline
360            & 63.46           & 0.10             \\ \hline
354            & 74.30           & 0.11             \\ \hline
349            & 92.32           & 0.13             \\ \hline
344            & 106.80          & 0.15             \\ \hline
338            & 134.60          & 0.18             \\ \hline
334            & 159.7           & 0.2              \\ \hline
326            & 213.3           & 0.6              \\ \hline
322            & 244.7           & 0.7              \\ \hline
318            & 277.7           & 0.7              \\ \hline
315            & 329.0           & 0.7              \\ \hline
311            & 379.0           & 0.8              \\ \hline
307            & 442.0           & 0.8              \\ \hline
303            & 518.0           & 0.9              \\ \hline
300            & 596.17          & 0.99             \\ \hline
296            & 681.5           & 1.1              \\ \hline
\end{tabular}
\caption{}
\label{tab:TvsR}
\end{wraptable}

En cambio, si comparamos la variación de $ln\left(\frac1R\right)$ para los dos valores de $R$ extremos recogidos en la tabla \ref{tab:TvsR}, estos son, (681.5 $\pm$ 1.1) y (45.27 $\pm$ 0.09) $\Omega$ (para 296 y 371 K, respectivamente), tenemos que 
\begin{equation}
ln\left(\frac1{45.27}\right)-ln\left(\frac1{681.5}\right) \simeq 2.712.
\end{equation}
Que es una variación de dos órdenes de magnitud menor que (\ref{eq:varLN}). Por tanto podemos despreciar su contribución y considerar el término (\ref{eq:termLN}) constante dentro del intervalo de temperatura en el que estamos. Dicho esto, la ecuación (\ref{eq:LN1R}) será del tipo
\begin{equation}
ln\left(\frac1{R}\right)= B - \frac{E_g(0)}{2k_BT}.
\end{equation}
Y por tanto, si representáramos $ln(1/R)$ en función de $1/T$ deberíamos obtener una dependencia prácticamente lineal.\\

\begin{wrapfigure}{r}{2cm}
\includegraphics[scale=0.55]{ln1RconAJUSTE.png}
\caption{}
\end{wrapfigure}

\clearpage

\end{document}

My problem is that I want the second wraptable and wrapfigure to be on the same page, but the wrapfigure doesn't seem to respond to the position parameter (the 'r' or 'l') and it keeps showing like this:

Wrapfig over table

covering half of the table. In the previous page you can see that I have something similar showing

Previous page

I want the problematic one like this but inversed (the table o the left and the image on the right) and I don't know what I'm doing wrong.

Thank you in advance.

1
  • You can't start another wrapfigure OR wrapteable until the first is done, at least not and get them to work correctly. Nov 5, 2020 at 5:13

1 Answer 1

0

The other (less fragile but more difficult) way to do this is to use minipages and saveboxes. In this case, the breaks came between paragraphs. If you need to break a paragraph at the end of a minipage, you can use \parfillskip=0pt. Note that determining the optional argument for wrapfigure is also largely trial and error.

Note that tabular places the first baseline at the \hline, not the text. Also, minipages set \parindent=0pt.

Using a center environment for figures serves four functions. You can't use a figure environment inside a minipage (not in outer par mode). It isolates the \captionof from the rest of the minipage. It provides a space above and below; not quite the right space (\intextsep), but close enough. And of course, it centers the figure.

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\numberwithin{equation}{section}
\usepackage{upgreek}
\usepackage{graphicx}
\usepackage{endnotes}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{mathrsfs}
\usepackage[toc]{blindtext}
\usepackage{tocbibind}
\usepackage{enumerate}
\usepackage{float}
\usepackage{multirow}
\usepackage{multicol}
\usepackage[usenames]{color}
\usepackage[hidelinks]{hyperref}
\usepackage[dvipsnames]{xcolor}
\usepackage[spanish, es-tabla]{babel}
\usepackage{flushend}
\usepackage{booktabs}
%\usepackage{underscore}
\usepackage{wrapfig}

\newsavebox{\tempbox}

\graphicspath{ {./img/} }

\author{\textit{Samuel G. Guerrero Camarero}}

\title{\textbf{Práctica 10. Determinación de la banda prohibida del germanio.}}


\topmargin=-3cm
\oddsidemargin=-0.55cm
\textwidth=18cm
\textheight=25cm
\topmargin=-2cm

\begin{document}
\begin{figure}[h]% friends don't let friends use [H]
\centering
\includegraphics[scale=0.5]{example-image-a}
\caption{Montaje del experimento.}
\label{fig:montaje}
\end{figure}

\section{Resultados y discusión}
\savebox{\tempbox}{% measure width, do NOT include caption
\begin{tabular}[t]{|c|c|c|}
\hline
\textbf{T (ºC)} & \textbf{V(V)} & \textbf{$\Delta$V(V)} \\ \hline
35              & 2.676         & 0.004          \\ \hline
49              & 1.553         & 0.004          \\ \hline
57              & 1.138         & 0.004          \\ \hline
59              & 1.084         & 0.004          \\ \hline
67              & 0.7909        & 0.0007         \\ \hline
73              & 0.6701        & 0.0006         \\ \hline
78              & 0.6701        & 0.0006         \\ \hline
83              & 0.4680        & 0.0005         \\ \hline
90              & 0.3749        & 0.0005         \\ \hline
100             & 0.2716        & 0.0004         \\ \hline
98              & 0.2891        & 0.0004         \\ \hline
94              & 0.3187        & 0.0006         \\ \hline
89              & 0.3808        & 0.0005         \\ \hline
83              & 0.4458        & 0.0006         \\ \hline
78              & 0.5539        & 0.0006         \\ \hline
73              & 0.6408        & 0.0006         \\ \hline
67              & 0.8076        & 0.0007         \\ \hline
63              & 0.9587        & 0.0008         \\ \hline
55              & 1.280         & 0.003          \\ \hline
51              & 1.468         & 0.004          \\ \hline
47              & 1.666         & 0.004          \\ \hline
44              & 1.974         & 0.004          \\ \hline
40              & 2.274         & 0.004          \\ \hline
36              & 2.654         & 0.004          \\ \hline
32              & 3.108         & 0.005          \\ \hline
29              & 3.577         & 0.005          \\ \hline
25              & 4.089         & 0.005          \\ \hline
\end{tabular}}% end of savebox

\noindent\begin{minipage}[t]{\dimexpr \textwidth-\columnsep-\wd\tempbox}
\setlength{\parindent}{15pt}

Los datos obtenido son los de la tabla \ref{tab:TempvsV}. El error calculado es el que se indica en el manual del multímetro \cite{MANUALMULTIM}, que es 0.05\% del valor leído más 3 dígitos.


\begin{center}
\includegraphics[scale=0.55]{example-image-b}
\captionof{figure}{}
\label{fig:RvsT}
\end{center}

 Haciendo uso de la ley de Ohm, (\ref{eq:Ohm}), y sabiendo que la corriente se ha mantenido en todo momento en $(6 \pm 1)$ mA, podemos transformar el voltaje en resistencia. Y representándola en función de la temperatura (pasada a Kelvin), obtenemos la figura \ref{fig:RvsT}, cuyos valores pueden verse en la tabla \ref{tab:TvsR}.

Usando los valores dados para las constantes de las ecuaciones (\ref{eq:movilidades1}) y (\ref{eq:movilidades2}), podemos sacar el valor del cociente que aparece en la ecuación (\ref{eq:LN1R}),  $C_h/C_e=21.87555$. Con esto, y viendo que la temperatura en nuestro experimento se mantiene dentro del intervalo [290,380] K, la variación en este intervalo del 
segundo término del miembro de la derecha de la ecuación (\ref{eq:LN1R}), es decir, del término
\begin{equation}
ln\left(T^{-0.16}+\frac{C_h}{C_e}T^{-0.83}\right),
\label{eq:termLN}
\end{equation}
es 
\begin{equation}
ln\left(380^{-0.16}+\frac{C_h}{C_e}380^{-0.83}\right)-ln\left(290^{-0.16}+\frac{C_h}{C_e}290^{-0.83}\right) \simeq -0.099255
\label{eq:varLN}
\end{equation}
\hrule height0pt % prevent minipage from absorbing space below equation
\end{minipage}\hfill\begin{minipage}[t]{\wd\tempbox}
% wrapfig usually adds \vskip\intextsep at the top and bottom
\usebox\tempbox
\captionof{table}{Datos recogidos.}
\label{tab:TempvsV}
\end{minipage}

\savebox{\tempbox}{%
\begin{tabular}[t]{|c|c|c|}
\hline
\textbf{T (K)} & \textbf{R($\Omega$)} & \textbf{$\Delta$R($\Omega$)} \\ \hline
306            & 446.0           & 0.9              \\ \hline
320            & 258.8           & 0.7              \\ \hline
328            & 189.7           & 0.6              \\ \hline
330            & 180.7           & 0.6              \\ \hline
338            & 131.8           & 0.2              \\ \hline
344            & 111.7           & 0.2              \\ \hline
349            & 111.7           & 0.2              \\ \hline
354            & 78.00           & 0.12             \\ \hline
361            & 62.48           & 0.10             \\ \hline
371            & 45.27           & 0.09             \\ \hline
369            & 48.18           & 0.09             \\ \hline
365            & 53.12           & 0.09             \\ \hline
360            & 63.46           & 0.10             \\ \hline
354            & 74.30           & 0.11             \\ \hline
349            & 92.32           & 0.13             \\ \hline
344            & 106.80          & 0.15             \\ \hline
338            & 134.60          & 0.18             \\ \hline
334            & 159.7           & 0.2              \\ \hline
326            & 213.3           & 0.6              \\ \hline
322            & 244.7           & 0.7              \\ \hline
318            & 277.7           & 0.7              \\ \hline
315            & 329.0           & 0.7              \\ \hline
311            & 379.0           & 0.8              \\ \hline
307            & 442.0           & 0.8              \\ \hline
303            & 518.0           & 0.9              \\ \hline
300            & 596.17          & 0.99             \\ \hline
296            & 681.5           & 1.1              \\ \hline
\end{tabular}\strut}% end of savebox

En cambio, si comparamos la variación de $ln\left(\frac1R\right)$ para los dos valores de $R$ extremos recogidos en la tabla \ref{tab:TvsR}, estos son, (681.5 $\pm$ 1.1) y (45.27 $\pm$ 0.09) $\Omega$ (para 296 y 371 K, respectivamente), tenemos que 
\begin{equation}
ln\left(\frac1{45.27}\right)-ln\left(\frac1{681.5}\right) \simeq 2.712.
\end{equation}
Que es una variación de dos órdenes de magnitud menor que (\ref{eq:varLN}). Por tanto podemos despreciar su contribución y considerar el término (\ref{eq:termLN}) constante dentro del intervalo de temperatura en el que estamos. Dicho esto, la ecuación (\ref{eq:LN1R}) será del tipo
\begin{equation}
ln\left(\frac1{R}\right)= B - \frac{E_g(0)}{2k_BT}.
\end{equation}

\noindent\begin{minipage}[t]{\wd\tempbox}
\usebox\tempbox
\captionof{table}{}
\label{tab:TvsR}
\end{minipage}\hfill\begin{minipage}[t]{\dimexpr \textwidth-\columnsep-\wd\tempbox}
\setlength{\parindent}{15pt}% overkill

\noindent
Y por tanto, si representáramos $ln(1/R)$ en función de $1/T$ deberíamos obtener una dependencia prácticamente lineal.

\noindent\begin{center}
\includegraphics[scale=0.55]{example-image-c}
\captionof{figure}{}
\end{center}
\end{minipage}

\end{document}
2
  • Wow. It works beautifully. Now it's my turn to understand how it all works hahaha Thank you very much! Nov 5, 2020 at 10:54
  • You can also use paracol instead of minipages. It is basically the same process, except that you CAN put figures inside paracol and it doesn't change \parindent. See tex.stackexchange.com/questions/509450/… for example. Nov 6, 2020 at 16:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .