Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latex equation tags displaying smaller than expected in export formats #23

Open
mcgratay opened this issue Dec 13, 2019 · 1 comment
Open
Labels
bug Something isn't working export formats related to export formats produced by Pressbooks third party related to third party tools, services, integrations or plugins

Comments

@mcgratay
Copy link

Description
It's possible to use commands within latex shortcodes to add a number tag to an equation. This displays well in webbook:
Screen Shot 2019-12-13 at 12 22 12 PM

But shrinks the equation size in ebook and PDF file exports:
Screen Shot 2019-12-13 at 12 23 24 PM

Changing the font in MathJax settings had no effect on the diminished size of the equations. Note that equations do display larger than this in exports when tags are not added to the equation:

Screen Shot 2019-12-13 at 12 25 01 PM

The only alternative known at this time is increasing the equation manually with size commands (ex: /huge)

Example: https://cloneformathjax.textopress.com/

Steps to Reproduce

  1. Make sure QuickLaTeX is deactivated in your test book
  2. Edit a chapter in visual editor mode to include a tagged equations (ex: [latex]\tag{2.1}R\:=\frac{E}{I}[/latex])
  3. Add another untagged equation for comparision (ex: [latex]a^2=c[/latex])
  4. Save the chapter and export to all supported formats

Expected Behavior: Equations display at optimal size in all supported formats

Actual Behavior: Equations display smaller than normal in export formats when tags are added

@mcgratay mcgratay added bug Something isn't working third party related to third party tools, services, integrations or plugins export formats related to export formats produced by Pressbooks labels Dec 13, 2019
@tw77
Copy link

tw77 commented Mar 29, 2022

The question of equation size in webbook vs. PDF came up recently for an author at CUNY, though the other way around: equations were shrunk in the webbook. The resizing method we found for the webbook (to match what was in the PDF) was different from the use of LaTeX size commands mentioned here and more granular though still not an ideal solution: resizing equations with styled <p> tags.

The author was using \begin{equation}…\end{equation} to encode display equations (equations centred on their own line) and it was working for the webbook but not the PDF. After switching to supported [latex] delimiters wrapped in centre-aligned <p> tags, these equations were centred on their own line on PDF exports, but this had the effect of shrinking them in the webbook. This was countered by including font size in the <p> tag as well, in this case: <p style="text-align: center; font-size: 113%;">[latex]...[/latex]</p>

113% was the size that worked for Asimov but this would need to vary depending on the theme in use. Even with this approach, the resizing is only approximate since the real sizing of display equations in MathJax happens dynamically. (At this time we aren't able to access this contextual sizing for display equations using our supported delimiters. \begin{equation}…\end{equation} properly renders display equations for Web, but isn't recognized in PDF exports, while [latex]...[/latex] doesn't allow for display equations as far as we know.)

The advantage of using styled <p> tags over size commands here was that it allowed for a bit more control over the resulting size (since there are only 10 standard type size commands supported by LaTeX), but this approach only works for altering size within webbooks.

Ticket for internal reference: https://pressbooks.zendesk.com/agent/tickets/9045

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working export formats related to export formats produced by Pressbooks third party related to third party tools, services, integrations or plugins
Projects
None yet
Development

No branches or pull requests

2 participants