3

I've tried googling this for ages, but I can't find anyone else with this problem. As you can see in the included image, the text wrapping around the image gets a weird spacing, much wider than the normal text further down. Whats wrong and how do I fix it? I've included the code, a very standard wrapfigure, showing no compiling errors in Sharelatex.

Thanks in advance!

EDIT: I've updated it with my very messy uspackage list (I have no idea what I'm doing)

EDIT 2: I've updated with a text that gives me the same error, HOWEVER, I only get the error if in image is large enough so that the image text extends into the second block of text.

EDIT 3: SOLVED! -Don't use \newline after a paragraph, kids. Not even once.

\documentclass[english,11pt]{article}
\usepackage[LGR,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{float}
\usepackage{fancybox}
\usepackage{calc}
\usepackage{graphicx}
\usepackage{fullpage}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{romannum}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{url}
\setlength{\parindent}{0cm}
\usepackage{graphicx,wrapfig,lipsum}
\usepackage{siunitx}
\DeclareSIUnit{\sqrtm}{\ensuremath{\sqrt{\text{\meter}}}}
\DeclareSIUnit{\sqrtmm}{\ensuremath{\sqrt{\text{\milli\meter}}}}
\sisetup{group-separator = {\,}}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\DeclareRobustCommand{\greektext}{%
  \fontencoding{LGR}\selectfont\def\encodingdefault{LGR}}
\DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}}
\DeclareFontEncoding{LGR}{}{}
\DeclareTextSymbol{\~}{LGR}{126}
%% A simple dot to overcome graphicx limitations
\newcommand{\lyxdot}{.}
\makeatother
\usepackage{babel}
\begin{document}

\subsection{Bonding mechanism}

\begin{wrapfigure}{r}{6cm}
\begin{center}
\includegraphics[width=6cm]{b150.jpg}
\caption{EDS maps of the BSA, SBA, and SAB -200 samples, in descending order. Images are taken of the steel fracture surface at 1000X, with residual aluminum indicated by the red color. }
\label{fig:tripple}
\end{center}
\end{wrapfigure}

The fracture surfaces seen in Figure \ref{fig:tripple} shows two different surface structures. While the fracture surfaces of the BSA samples have been largely governed by the formation of intermetallic phases, the SBA and SAB samples both show a different mechanism of bonding. Large amounts of aluminum are left on the steel substrates, mainly located in bands stretching in a transverse direction acrossrved in these images, suggests that they were bonded to the steel surface with a bond exceeding the tensile strength of the aluminum. The fact that more aluminum is found on the SAB fracture surface than on the SBA fracture surface also fits well with the improvements in bond strength that were observed for the SAB sample. 
\newline

During the CRB process, the work hardened surface and oxide layers of the metals are expected to have fractured, and virgin material extruded through the crac However, due to the large difference in hardness between the two metals, it is likely that the steel surface merely cracked, and virgin aluminum was extruded into the fractured steel surface s is especially true for the SBA samples, which w pieces of the fractured work hardened steel surface layer. As aluminum is extruded into the cracks between these fragments, localized bonding occurs, as described by the film theorce opposing virgin metal surfaces come into contact, additional pressure cases the actual metallic bond to f Areas of mechanical interlocking were also found to be present at the bonded regions of all samples, and this may be an additional strengthening mechanism of the bond. 
\newline
\end{document}

screenshot

12
  • 1
    Welcome to TeX SX! Without a full compilable code it's hard to say whatever. Could you post one? Just in case: what happens if you load ragged2e and add the directive \RaggedRight?
    – Bernard
    Commented May 28, 2017 at 19:57
  • 1
    the problem is the text outside the wrapfig, which you do not show in your example so it is hard to guess what is wrong. Commented May 28, 2017 at 20:02
  • I've added the rest of the text now Commented May 28, 2017 at 20:09
  • 1
    are you sure that the bad baseline space is connected to wrapfig at all? It looks far more like a mis-placed \small at the end of the paragraph. Commented May 28, 2017 at 21:00
  • 1
    Don't use \newline to end a paragraph!!
    – cfr
    Commented May 28, 2017 at 21:05

1 Answer 1

1

enter image description here

Instead to use newline at the end of paragraph define \parskip for example as \setlength{\parskip}{\baselineskip}:

\documentclass[english,11pt]{article}
\usepackage[LGR,T1]{fontenc}
\usepackage[utf8]{inputenc}
%\usepackage{microtype} % <-- gives better text formatting

\usepackage{float}
\usepackage{fancybox}
\usepackage{calc}
\usepackage{fullpage}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{romannum}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{url}
\setlength{\parindent}{0cm}
\setlength{\parskip}{\baselineskip}% define vertical space between paragraphs
\usepackage{wrapfig,lipsum}
\usepackage[demo]{graphicx}
\usepackage{siunitx}
\DeclareSIUnit{\sqrtm}{\ensuremath{\sqrt{\text{\meter}}}}
\DeclareSIUnit{\sqrtmm}{\ensuremath{\sqrt{\text{\milli\meter}}}}
\sisetup{group-separator = {\,}}
%\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\DeclareRobustCommand{\greektext}{%
  \fontencoding{LGR}\selectfont\def\encodingdefault{LGR}}
\DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}}
\DeclareFontEncoding{LGR}{}{}
\DeclareTextSymbol{\~}{LGR}{126}
%% A simple dot to overcome graphicx limitations
\newcommand{\lyxdot}{.}
%\makeatother
\usepackage{babel}

\begin{document}

\subsection{Bonding mechanism}

\begin{wrapfigure}{r}{6cm}
\begin{center}
\includegraphics[width=\linewidth,height=3cm]{b150.jpg}
\includegraphics[width=\linewidth,height=3cm]{b150.jpg}
\caption{EDS maps of the BSA, SBA, and SAB -200 samples, in descending order. Images are taken of the steel fracture surface at 1000X, with residual aluminum indicated by the red color. }
\label{fig:tripple}
\end{center}
\end{wrapfigure}

The fracture surfaces seen in Figure \ref{fig:tripple} shows two different surface structures. While the fracture surfaces of the BSA samples have been largely governed by the formation of intermetallic phases, the SBA and SAB samples both show a different mechanism of bonding. Large amounts of aluminum are left on the steel substrates, mainly located in bands stretching in a transverse direction acrossrved in these images, suggests that they were bonded to the steel surface with a bond exceeding the tensile strength of the aluminum. The fact that more aluminum is found on the SAB fracture surface than on the SBA fracture surface also fits well with the improvements in bond strength that were observed for the SAB sample.

During the CRB process, the work hardened surface and oxide layers of the metals are expected to have fractured, and virgin material extruded through the crac However, due to the large difference in hardness between the two metals, it is likely that the steel surface merely cracked, and virgin aluminum was extruded into the fractured steel surface s is especially true for the SBA samples, which w pieces of the fractured work hardened steel surface layer. As aluminum is extruded into the cracks between these fragments, localized bonding occurs, as described by the film theorce opposing virgin metal surfaces come into contact, additional pressure cases the actual metallic bond to f Areas of mechanical interlocking were also found to be present at the bonded regions of all samples, and this may be an additional strengthening mechanism of the bond.
\end{document}
0

You must log in to answer this question.

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