Open mcgratay opened 4 years ago
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
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](https://user-images.githubusercontent.com/39064028/70819031-32f4cc00-1da3-11ea-93ac-63732c62f120.png)
But shrinks the equation size in ebook and PDF file exports:![Screen Shot 2019-12-13 at 12 23 24 PM](https://user-images.githubusercontent.com/39064028/70819101-5d468980-1da3-11ea-83a3-52096dea7fe3.png)
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:
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
[latex]\tag{2.1}R\:=\frac{E}{I}[/latex]
)[latex]a^2=c[/latex]
)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