"

55 LaTeX Support – Villy Christensen 2

Book: https://pressbooks.bccampus.ca/ewemodel

Date: January 9th, 2023

Issue:

  • Label equations (QuickLaTeX) using ?? is on the left, with the equation aligned left in PDF. Want equation centred and with label on right, aligned to right margin

Afflicted chapters:

References:

ref: 50

Results notes:

Solution:

Hi Villy,

Apologies for the long wait. It’s been busy around here and I also wanted to give you a thorough answer.

Unfortunately, it doesn’t look like there is a way to fix the alignment of the equations or equation number in the exports using QuickLaTeX. I was looking into trying to force it using CSS but wasn’t able to find a solution.

In regards to the linking, it appears that, for your purposes, there are pros and cons to using either QuickLaTeX (the plugin that you activated) or Mathjax (the default when not using QuickLaTeX on Pressbooks). So I wanted to give you a thorough rundown of the capabilities of both so you can make an informed decision of what would work best for you. The following is the result of my testing and research:

When using QuickLaTeX:

  • Any math equations in EPUB and PDF are not centred, even if manually centred, but are in web book.
    • Caveat: Equations are centred using “

      (1)   \begin{equation*} … \end{equation*}

      ” or using “Align Centre” button in Visual Editor to centre it. If neither of these are used, the equations will not be centred in web book.

  • \label{} and ?? work links work in EPUB and web book but not PDF.
    • Do not use “...” shortcodes around ??
  • You must use “

    (2)   \begin{equation*} ... \end{equation*}

    ” for \label{} and ?? to work.

  • You must use “

    (x)   \begin{equation*} ... \end{equation*}

    ” for \tag{} to work.

  • Without a \tag{}, the equation number will default to the number of equations on page (when using “

    (3)   \begin{equation*} ... \end{equation*}

    “).

When using Mathjax:

  • Any math equations in EPUB, PDF and web book are centred.
  • \tag{} works and is set on right side in EPUB, PDF and web book.
  • \label{} does not work in any format using Mathjax.
  • ?? works in web book with \tag{} if using “

    (x)   \begin{equation*} ...  \end{equation*}

    ” but not in EPUB or PDF.

    • Do not use “...” shortcodes around ??.
    • In the EPUB and PDF exports, it simply shows the code.
  • You can get a similar functionality using anchors and links rather than \label{} and ??
  • You use \tag{} without “

    (4)   \begin{equation*} ... \end{equation*}

    ” and it will still number the equation.

  • Without a \tag{}, it will not number equations (with or without using “

    (5)   \begin{equation*} ... \end{equation*}

    “).

Please let me know if you have need me to clarify anything or have any other questions. Again, apologies for taking so. Long to get back to you.

Cheers,

License

Icon for the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License

Harper Book Title Copyright © by hfriedman is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, except where otherwise noted.

Share This Book