Missing \begin and \end{figure} in compile

Hello all

I’m not sure if this is a beginner problem, but I’ve been trying to compile a scrivener project, using the latex memoir book template and I have a recurring problem with some images.
Whenever I want to place an image in the text, I use the method described in the example files and I wrap the image and caption in the “figure” paragraph style and add the “caption” character style to the caption (and a “label” character style after that).
The issue is that some of the images output with the correct code, a \begin{figure} and an \end{figure} but others don’t get either the \begin or \end{figure}, so I end up having to place them by hand in TeXShop afterwards…
I have quadruple checked and the paragraph styles are also added to the ones that have that issue and I haven’t figured out what are the differences in scrivener between the ones that result in correct latex code and the ones that don’t…
Have anyone had this issue before?
Help would be greatly appreciated :slight_smile:

Peter

In have seen that. I am not enough of a LaTeX guru to know the cause but I fiddle with the Scrivener source by removing all styles including Caption char style in the paragraph holding the figure and then reapply. I also check to make sure there are empty paragraphs above and below the figure paragraph. I also check that there is a new line after the figure to hold the caption as that keeps both caption and figure in the same paragraph. those steps seem to fix these flaws caused between chair and keyboard.

What I would do is give us a little sample of two figures (use snapshots if you don’t want to reveal them in public), one that works and one that does not work. That would be the most efficient way to figure out why there is a difference between them.

  1. Use File ▸ Save As... to create a throw-away copy of the project in a temp location like Downloads.
  2. Strip out everything from the binder except for one or two documents that demonstrate the working and failing cases. Strip out any text not necessary for the test.
  3. Empty the trash. At this point test to make sure that the problem still occurs.
  4. Use File ▸ Back Up ▸ Back Up To... to create a zip compressed copy, and drag that into the response field here to upload it.

If you prefer, you can also send it to me in a private message (click my avatar and then the big Message button).