pressbooks / pressbooks

Open publishing. Open web. Open source.
https://pressbooks.org/
GNU General Public License v3.0
420 stars 133 forks source link

Basic setting changes don't take effect in print PDF format until after several exports #1865

Open mcgratay opened 4 years ago

mcgratay commented 4 years ago

Prerequisites

Description

Equations can be displayed in webbook and export formats using a service called QuickLaTeX. QuickLaTeX allows you to customize several settings, including position, size, text color, and background color.

Changes to these basic settings will display in the webbook immediately after they are saved. These settings will not automatically display in print PDF format, however. The first several rounds of exports after the settings are changed will not reflect the user's customizations. As an example, here is the QuickLaTeX settings page after display has been customized: Screen Shot 2019-11-28 at 2 11 45 PM

Here's the resulting webbook immediately after: Screen Shot 2019-11-28 at 2 12 06 PM

And here's a shot of this same section in the PDF from an export created after the settings were saved:

Screen Shot 2019-11-28 at 2 12 48 PM

Generally, the next 2 to 3 exports will display the LaTeX with no changes. Then, you'll have an export that will take a particularly long time to complete but will eventually fail and display the following error: Screen Shot 2019-11-28 at 2 21 18 PM

However, the logs will not show any error report for the book. Eventually, the print PDF will display the setting changes. In this example it took ~7 exports.

Does not seem to affect any format but print PDF.

Example: https://latexsettingstest.textopress.com/

Steps to Reproduce

  1. Go to the Plugins page to enable QuickLaTeX in your test book if it isn't already enabled
  2. Create a new chapter in the book with a few LaTeX equations wrapped in [latex] shortcodes
  3. Go to Settings > QuickLaTeX > Basic Settings and change some of the LaTeX display settings, then save
  4. Export to print PDF and view
  5. Repeat export until the LaTeX settings changes are reflected in the PDF file

Expected behavior: Saved setting changes take effect immediately in all supported book formats

Actual behavior: Saved setting changes for QuickLaTeX do not immediately appear in print PDF exports and sometimes cause unidentifiable validation errors

beckej13820 commented 4 years ago

In my experience with QuickLaTeX, I have had to go to every single page first to make exports work. My understanding was that QuickLaTeX generates all of its files on page load, and then caches them. So if I was doing an export with QuickLaTeX, I needed to quickly scroll through every chapter first, then do the export.

Is it possible this is related?