2

My publisher recommends that my text is not split by floats. More precisely, a sentence should end before the float and a new sentence should start after the float. The float is allowed to be moved into another paragraph and even split paragraphs, but only after a full stop (question mark, exclamation mark).

Take this MWE:

\documentclass{article}
\usepackage{lipsum}
\usepackage{graphicx}

\begin{document} \raggedbottom

\lipsum[1-2] \begin{figure}[htb] \centering \includegraphics[width=0.8\textwidth]{example-image-a} \caption{Hello World 42} \end{figure} \lipsum[4-5]

\end{document}

You should see that one sentences is split by this figure:

Morbi vel justo vitae lacus

[Figure]

tincidunt ultrices. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

What I want is (for every float):

Morbi vel justo vitae lacus tincidunt ultrices.

[Figure]

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Maybe related:

How to forbid LaTex from placing floats in the middle of sentences?

How to protect text from being split by a float?

Edit according to Mico's answer:

What I forget to mention is, that the option "raggedbottom" is permitted/desired. I am not sure if this effects the answer. If I change the MWE to

\documentclass{article}
\usepackage{lipsum}
\usepackage{graphicx}

\begin{document} \raggedbottom \lipsum[1-5]

\begin{figure}[tb] \centering \includegraphics[width=0.8\textwidth]{example-image-a} \caption{Hello World 42} \end{figure}

\lipsum[6-10]

\end{document}

The float appears on top of one page, but still breaks a sentence. If I understand the comments to the answer correctly, I am requesting something which is not achievable, am I not?

The publisher showed my some examples where no sentences are split by figures, even if they appear on top or on bottom of a page. If I really want this, I would have to to insert paragraph breaks manually? If so, I might think about not fulfilling this recommendation.

  • 2
    This doesn't happen if you place the float surrounded by blank spaces in your code... something that should be common practice when thinking that the floats are considered to be separate from the regular, flowing text. The only place it will happen is around page breaks really. – Werner Jan 15 '21 at 20:53
  • Welcome to TeX.SE. – Mico Jan 15 '21 at 21:26
  • 1
    The stipulation that a float may split a paragraph only after a sentence-ending punctuation mark -- "full stop", aka "period", but presumably exclamation (!) and question (?) marks as well, right? -- seems slightly unusual, to put it politely. I'd rephrase and strengthen it to require that within-page paragraphs must not be split by a float. That way, the publisher's stipulation will be satisfied automatically. – Mico Jan 15 '21 at 21:36
  • 3
    @Werner if a float is paced top or bottom of a page there is essentially no way t stop it being mid-sentence. – David Carlisle Jan 15 '21 at 22:19
  • Are you sure that you understood the publisher's request correctly as it doesn't really make sense as written? Floats are vertical display constructs, so saying they should only appear between paragraphs is a reasonable request but only achievable in latex by using [H] and manually positioning them. Saying they appear between sentences does not really make sense, sentences can start and end mid line. You can't add a float at that point without making it look like end of paragraph potentially changing the meaning. An author could do that, but not a typesetter. – David Carlisle Jan 16 '21 at 09:30
  • Maybe I got you now. "You can't add a float at that point without making it look like end of paragraph" - I think this is what I (the publisher) want. It is okay if it looks like the end of paragraph. This would be a valid solution... No, wait: "using [H] and manually positioning". I want to avoid the manual positioning. – Dragoner Jan 16 '21 at 09:57
  • 2
    there is definitely no way to do that automatically in latex. if you use the float package and use [H] then the floating is disabled completely and you get full manual control. So you can insert the figures at whatever point you want but still you need to break the paragraph to insert them. – David Carlisle Jan 16 '21 at 10:01

1 Answers1

2

I think you have two main, not mutually exclusive options:

  • Don't use the h placement specifier. I.e., in your example code, change [htb] to [tb] (or [tbp]).

  • As @Werner has already suggested in a comment, make sure to surround the figure and table options by all-blank lines, which will generate implicit paragraph breaks.

The following code implements both ideas:

\documentclass{article}
\usepackage{lipsum,graphicx}

\begin{document} \lipsum[1-2]

\begin{figure}[tb] \centering \includegraphics[width=0.8\textwidth]{example-image-a} \caption{Hello World 42} \end{figure}

\lipsum[4-5] \end{document}

Mico
  • 506,678
  • 1
    I do not think this achieves the stated aim of stopping a float being inserted mid-paragraph (which is not really implementable in latex) – David Carlisle Jan 15 '21 at 22:20
  • 1
    @DavidCarlisle - I interpreted the OP's requirements as permitting floats to be placed at the very top of bottom of a page even if doing so generates a paragraph break. Of course, my interpretation may be wrong. – Mico Jan 15 '21 at 22:23
  • 2
    Yes perhaps. I re-read question, hopefully the OP means that as otherwise there is no answer:-) – David Carlisle Jan 15 '21 at 22:26
  • Updated the question. @DavidCarlisle I Think I might be asking something unachievable. Could you confirm or deny? – Dragoner Jan 16 '21 at 08:52
  • @Dragoner - I think you'd be entirely in your rights to ignore the publisher's "recommendation". Aside: Neither \raggedbottom nor \flushbottom play a role here. – Mico Jan 16 '21 at 08:57
  • 1
    The answer does not achieve the unachievable but brings me most closely to it. – Dragoner Jan 16 '21 at 09:03
  • @Dragoner I left a note under the question – David Carlisle Jan 16 '21 at 09:31