(My first post - please let me know if/how I can improve my questions in the future!) (Modified to include a complete example file)

The code in question is automatically generated via a script. There are about a dozen other identical code snippets (only the file names change). Three of the twelve code segments demonstrate an unexpected additional indentation at the end of the section.

\documentclass[11pt, oneside,american]{book}
\usepackage[margin=1in]{geometry}                               % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}                                  % ... or a4paper or a5paper or ...
        loadfiles=true % this forces load of external annotations - based on naming convention
\DeclareFieldAlias{bibhyperref}{noformat}% Avoid nested links
\setlist{nosep} %tighten up lists

\section{The Contributors}
\textsf{Washington, DC, USA}
\par \setlength{\columnsep}{0pt}
\begin{wrapfigure}{l}{0.25\textwidth} \centering \includegraphics[width=0.18\textwidth]{bios/iglazer.jpg}
\textsf{ \input{random.txt} }
\item \cite{Clippinger2007}
\item \cite{Richer2017}

Odd indentation

  • 2
    wrapfigure doesn't have that much documentation but the one thing it does document is that it doesn't work near lists... It's usually possible to do something but it would be much easier to answer if you provided a complete small document that showed the problem, not a fragment. (you can use example-image as the image as it is available for such tests. – David Carlisle Mar 8 '19 at 16:06
  • Thanks for the feedback (and the welcome!) Hopefully the revised post is better (but please tell me if I can improve it). – Heather Flanagan Mar 8 '19 at 16:23
  • All you need to do is add a % immediately after \setlength{\columnsep}{0pt}. Wrapfigure needs to start in vmode, either between paragraphs or at the end of a line. Almost every time you end a line with } you add an extra space, taking you out of vmode. – John Kormylo Mar 8 '19 at 18:08
  • Tried that (made sure there were no spaces between 0pt} and %). Did that for every line that had a space after a command as well, just on general principles. No change to the output. – Heather Flanagan Mar 8 '19 at 18:17

The simplest is to not have a float. Here is a possibility with the plain text macro package insbox, which defines \InsertBoxL and \InsertBoxR commands, with two mandatory arguments: the number of lines at the beginning of a paragraph which will remain untouched, and the box to be inserted. Also a final optional argument: the number of supplementary lines which should be shortened, in case the calculations of TeX would be wrong.


\@InsertBoxMargin = 10pt


\subsection*{Ian~Glazer} \textsf{Washington, DC, USA} \smallskip

\sffamily \lipsum[2-10]

    \item \cite{Clippinger2007}
    \item \cite{Richer2017}


enter image description here

| improve this answer | |
  • Hmm. Can't quite get that to work. (and can't figure out how to better format the comments so this is readable - grr) /usr/local/texlive/2018basic/texmf-dist/tex/generic/oberdiek/se-ascii-print.def)) Runaway argument? {\includegraphics [width=0.18\textwidth ]{bios/iglazer.jpg}[-1] \sffamily \ETC. ! File ended while scanning use of \InsertBoxL. <inserted text> \par <*> anbib-test.tex – Heather Flanagan Mar 8 '19 at 17:08
  • Can you compile my code? (add the [demo]option to graphicx, as I suppose you don't have my image) – Bernard Mar 8 '19 at 17:22
  • Yes. When I substitute a new image in the \InsertBoxL, is when I get the error. No other changes made. My line: \InsertBoxL{0}{\includegraphics[width=0.18\textwidth]{bios/iglazer.jpg}[-1] – Heather Flanagan Mar 8 '19 at 17:34
  • AhHA! Found it! Missing a closing curly bracket! Score!!! – Heather Flanagan Mar 8 '19 at 18:08
  • All but one of the entries now format correctly and all entries are automatically generating. The one that is not generating properly in my production file seems identical to the others but shows a mostly blank page then text and image partially overlapped. The code for that entry works when extracted into a test file. I need a drink. – Heather Flanagan Mar 8 '19 at 18:54

The package lettrine is mainly designed for dropped capitals, but it also allow put a left wrapped image at the start of a paragraph, with a very simple code. Moreover, \lettrine have several options that allow a fine-tuning of the image position.

Unfortunately for this case, it is designed for a single paragraph, with no indentation of the first line,. But for the fist problem is easy make a \fakepar and for the second the \lettrine options are enough, as show the example:


\usepackage{lipsum} % only for dummy text


\subsection*{Robert Conway}
Shangri-La, Lost Horizons, Kunlun Mountains\par\bigskip


| 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.