Arlolra has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/308906

Change subject: Add `\FloatBarrier`s after articles
......................................................................

Add `\FloatBarrier`s after articles

 * For a book like enwiki/User:DennisDaniels/Books/Medical_Laboratory_Basics
   the user is setting their own chapters so the page doesn't have a
   chance to clear for a long while.

 * There's a large picture on https://en.wikipedia.org/wiki/Pipette
   https://en.wikipedia.org/wiki/Pipette#/media/File:Vollpipetten.jpg
   that wants to take up an entire column and so never gets a chance to
   be inserted and all kinds of figures pile up behind it (58, where the
   max latex allows is 52) and we eventually crash with,
   "! LaTeX Error: Too many unprocessed floats."

 * Flushing floats after articles seems like a safe way to prevent this,
   although maybe handling of large images like that should be improved.

 * Also note that the bundler -c flag doesn't generate a metabook.json
   with the chapters the user inserted, so debugging this took a bit of
   time to find out why it didn't crash for me locally.

Change-Id: I54cc82cefdabf0656d456d485288a329f29b10c3
---
M lib/index.js
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer
 refs/changes/06/308906/1

diff --git a/lib/index.js b/lib/index.js
index 5eacdb8..0fddb63 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -90,7 +90,7 @@
        '',
        '\\documentclass[10pt,twocolumn,twoside,fleqn]{article}',
        '\\pagestyle{headings}',
-       '\\usepackage{fontspec, xunicode, polyglossia, graphicx, xltxtra}',
+       '\\usepackage{fontspec, xunicode, polyglossia, graphicx, xltxtra, 
placeins}',
        '\\usepackage{amsmath,amsthm,amstext,amssymb}',
        // Allow list nesting deeper than 4
        // See: 
http://stackoverflow.com/questions/1935952/maximum-nesting-level-of-lists-in-latex
@@ -1931,6 +1931,7 @@
                        visitor.visit(document.body);
                        visitor.usedLanguages.forEach(function(l) { 
usedLanguages.add(l); });
                        format.paragraphBreak();
+                       format._writeRaw('\\FloatBarrier\n');
                        return format.flush().then(function() {
                                return P.call(format.stream.end, format.stream, 
'');
                        });

-- 
To view, visit https://gerrit.wikimedia.org/r/308906
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I54cc82cefdabf0656d456d485288a329f29b10c3
Gerrit-PatchSet: 1
Gerrit-Project: 
mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer
Gerrit-Branch: master
Gerrit-Owner: Arlolra <abrea...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to