"

53 LaTeX support – Erin Fields

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

Date: October 4th, 2023

Issue: Sometimes her LaTeX works, sometimes it doesn’t

She’s using “$$ __ $$“, which doesn’t show up in PDFs

  • Warn her about that

Solution:

Hi Erin,

It seems like you have uncovered a strange Pressbooks bug, so thank you for that!

I’ve done some testing and it seems like the LaTeX in the first chapter works because of the one equation ( \Delta E\:=E_{Fe+3/Fe+2}\:-\:Eh_{Cu+2}\:\:\:_{CuS/Cu2S}\:=\:0.68\:-\:0.46\:=\:0/22\:V)) that uses the “*** QuickLaTeX cannot compile formula:

*** Error message:
Error: Nothing to show, formula is empty
” shortcodes instead of the “$$ $$” delimiters. When I replace the shortcodes with the delimiters, none of the LaTeX in the Leaching and Process Chemistry chapter works. And if I add the shortcodes to one equation in the Agitation chapter, all of the LaTeX in that chapter works. So it seems like Pressbooks needs at least one set of “*** QuickLaTeX cannot compile formula:

*** Error message:
Error: Nothing to show, formula is empty
” shortcodes in the chapter in order for the LaTeX to work.

I’m not sure why this is the case, and I will look into it further, but the method to fix the issue is to have at least one equation that uses the “*** QuickLaTeX cannot compile formula:

*** Error message:
Error: Nothing to show, formula is empty
” shortcodes in each chapter.

Note: any LaTeX expressions using the “$$ $$” delimiters do not render in the PDF and so we do recommend using the “*** QuickLaTeX cannot compile formula:

*** Error message:
Error: Nothing to show, formula is empty
” shortcodes in general.

 

All LaTeX in Chapter 1:

$$ CuO_{s}+H_{2}O_{l} = Cu^{+2}_{aq} + 2OH^{-}_{aq}\:\:\:\:\:\:\:\:\:\:K_{sp}+2.2\times 10^{-21} \tag{1} $$
$$ 2OH^{-}\:_{aq} + 2H^{+}\:_{aq} = 2H_{2}O_{1}\:\:\:\:\:\:\:\:\:\:\:\:\:K=(1/K_{w})^{2}=1\times 10^{28} \tag{2} $$
$$ CuO_{s} + 2H^{+}\:_{aq} = Cu^{+2}\:_{aq} + H_{2}O_{l}\:\:\:\:\:\:\:\:\:K_{l} = K_{sp}/K_{w}^{2} = 2.2\times 10^{7} \tag{3} $$


$$ K= \frac{[Cu^{+2}]}{[H^{+}]^{2}} \tag{4} $$
$$ log[Cu^{+2}]=logK_{l}-2pH \tag{5} $$

$$ CuS_{s}=Cu^{+2}\:_{aq} + S^{2-}\:_{aq}\:\:\:\:\:\:\:\:\:\:K_{sp} = 8 \times 10^{-37} \tag{6} $$
$$ CuS_{s} + 2H^{+}\:_{aq} =Cu^{+2}\:_{aq} + H_{2}S_{g}\:\:\:\:\:\:\:\:\:\:K_{l}=1.1 \times 10^{-15} \tag{7} $$
$$ CuS_{s}+\:2O_{2}\:_{g} = Cu^{+2}\:_{aq} + SO_{4}^{2-}\:_{aq}\:\:\:\:\:\:\:\:\:\:K_{l}^{‘} = 4 \times 10^{109}\:(!) \tag{8} $$

$$ Fe^{+3}\:_{aq}\:+\: e^{-} = Fe^{+2}\:_{aq}\:\:\:\:\:\:\:\:\:\:E^{\circ} = 0.77\:V; \sim0.68 V in\:aq. \:H_{2}SO_{4} \tag{9} $$


$$ CuS_{s}+ 2Fe^{+3}\:_{aq} = Cu^{+2}\:_{aq} + 2Fe^{+2}\:_{aq} + S_{s} \tag{10} $$

$$ 2Fe^{+2}\:_{aq}+1/20_{2}\:_{g}+2H^{+}\:_{aq}=2Fe^{+3}\:_{ag}+H_{2}O_{l} \tag{11} $$

(By thiobacillus ferrooxidans)

$$ S_{s}\;+\:3/20_{2g}\:+\:H_{2}O_{l}\:=\:H_{2}SO_{4}\:_{aq} \tag{12} $$


$$ Cu_{2}S_ {s}\:+\:2Fe^{+3}\:_{aq}\: =\: Cu^{+2}\:_{aq}\:+\: 2Fe^{+2}\;_{aq}\:+\: CuS_{s} \tag{13} $$


$$ E\:=\:E^{\circ}\:-\:\frac{2.303RT}{F}log\frac{a_{Fe+2}}{a_{Fe+3}} \tag{14} $$


$$ pH\:=\:pK_{a}\:+\:log\frac{a_{A-}}{a_{HA}} \tag{15} $$


 \Delta E\:=E_{Fe+3/Fe+2}\:-\:Eh_{Cu+2}\:\:\:_{CuS/Cu2S}\:=\:0.68\:-\:0.46\:=\:0/22\:V)


$$ Au^{+}\:_{aq}\:+\:e^{-}\:=\:Au_{s}\:\:\:\:\:\:\:\:\:\:E^{\circ}\:=\:1.69\:V \tag{16} $$

$$ Au^{+3}\:_{aq}\:+\:3e^{-}\:=\:Au\:_{s}\:\:\:\:\:\:\:\:\:\:E^{\circ}\:=\:1.41\:V \tag{17} $$


$$ O_{2\:g}\:+\:4H^{+}\:_{aq}\:+\:4e^{-}\:=\:2H_{2}O\:_{l}\:\:\:\:\:\:\:\:\:\:E^{\circ}\:=\:1.23\:V \tag{18} $$


$$2Au_{s}\:+\:4CN^{-}\:_{aq}\:+\:O_{2}\:_{g}\:+\:2H_{2}O\:_{l}\:=\:2[Au(CN)_{2}]^{-}\:+\:H_{2}O_{2}\:_{aq}\:+\:2OH^{-}\:_{aq} \tag{19} $$


$$ HCN_{aq}\:=\:H^{+}\:_{aq}\:+\:CN^{-}\:_{aq}\:\:\:\:\:\:\:\:\:\:K_{a}\:=\:5.25\:\times\:10^{-10};\:pK_{a}\:=\:9.28 \tag{20} $$


$$ HCN_{aq}\:=\:HCN_{g}\:\:\:\:\:\:\:\:\:\:K\:=\:0.1 \tag{21} $$


In basic solution:

$$ Al(OH)_{3}\:_{s}\:+\:OH^{-}\:=\:[Al(OH)_{4}]^{-}\:_{aq} \tag{22} $$

$$ Al(O)OH\:_{s}\:+\:H_{2}O_{l}\:+\:OH^{-}\:_{aq}\:=\:[Al(OH)_{4}]^{-}\:_{aq}\tag{23} $$

$$ 0.5\text{Al}_2O_{3s} + 1.5\text{H}_{2\text{O}_l} + \text{OH}^-{}_{\text{aq}} = [\text{Al}(\text{OH}_4)]^-{}_{\text{aq}}\tag{24} $$

In acid solution:

$$ Al(OH)_{3}\:_{s}\:+\:3H^{+}\:_{aq}\:=\:Al^{+3}\:_{aq}\:+3H_{2}O\:_{l}\tag{25} $$

$$ Al(O)OH\:_{s}\:+\:3H^{+}\:_{aq}\:=\:Al^{+3}\:_{aq}\:+\:2H_{2}O\:_{l}\tag{26} $$

$$ 0.5Al_{2}O_{3}\:_{s}\:+\:3H^{+}\:_{aq}\:=\:Al^{+3}\:_{aq}\:+\:1.5H_{2}O\:_{l}\tag{27} $$


$$ 2Al(OH)_{3}\:_{s}\:=Al_{2}O\:_{3}\:_{s}+3H_{2}0\;_{g}\;\;\;\;\;\Delta H^{\circ}=186\text{ kJ/mol} \tag{28} $$


$$ 2\:[Al(H_{2}0)_{6}]Cl_{3}\:=\:Al_{2}O_{3s}\:+\:6HCl_{g}\:+\:9H_{2}O_{g}\;\;\;\;\;\Delta H^{\circ}=959\text{ kJ/mol} \tag{29} $$

LaTeX in Chapter 2

$$ = 1.44\%\: CuFeS_{2} \tag{1} $$

LaTeX in Agitation chapter

$$ P = N p \rho N^3D^5 (Watts)\tag{1} $$

$$\begin{equation}\rho = fluid \:density  (kg/m^3)\end{equation}$$

$$ kg \:m^{-3} \times \:sec^{-3} \times \:m^5 = kg \:m \:sec^{-2} m\:sec^{-1} = N\: m \:sec^{-1} = J \:sec^1 = Watt\tag{4} $$

$${equation}Np=\frac{P}{N^3D^5\rho}\tag{4} $$

$$P \propto\rho N^3D^5 \tag{4} $$

Testing new delimiters:

Shortcode syntax:
e^{i \pi} + 1 = 0

Dollar sign syntax:
$latex e^{i \pi} + 1 = 0$

Double dollar sign syntax:
$$ e^{i \pi} + 1 = 0$$

Equation doesn’t fully render for Erin:

*** QuickLaTeX cannot compile formula:
\frac{\text{5000gCu}}{\text{t ore}} \times \frac{\text{1 molCu}}{\text{63.546gCu}}\times \frac{\text{1molCuFeS2}}{\text{1molCu}}\times \frac{\text{185.513gCuFeS_2}}{\text{molCuFeS_2}} = \frac{\text{14,439gCuFeS_2}}{\text{t ore}}

*** Error message:
Missing $ inserted.
leading text: ...{\text{185.513gCuFeS_2}}{\text{molCuFeS_2}}
Extra }, or forgotten $.
leading text: ...{\text{185.513gCuFeS_2}}{\text{molCuFeS_2}}
Extra }, or forgotten $.
leading text: ...{\text{185.513gCuFeS_2}}{\text{molCuFeS_2}}
Extra }, or forgotten $.
leading text: ...{\text{185.513gCuFeS_2}}{\text{molCuFeS_2}}
Missing $ inserted.
leading text: ...{\text{185.513gCuFeS_2}}{\text{molCuFeS_2}}
Extra }, or forgotten $.
leading text: ...{\text{185.513gCuFeS_2}}{\text{molCuFeS_2}}
Extra }, or forgotten $.
leading text: ...{\text{185.513gCuFeS_2}}{\text{molCuFeS_2}}
Extra }, or forgotten $.
leading text: ...{\text{185.513gCuFeS_2}}{\text{molCuFeS_2}}
Missing $ inserted.
leading text: ...{\text{185.513gCuFeS_2}}{\text{molCuFeS_2}}

\frac{\text{1 molCu}}{\text{63.546gCu}}

\frac{\text{5000gCu}}{\text{t ore}} x \frac{\text{1 molCu}}{\text{63.546gCu}} x \frac{\text{1molCuFeS2}}{\text{1molCu}} x \frac{\text{185.513gCuFeS_2}}{\text{molCuFeS_2}} = \frac{\text{14,439gCuFeS_2}}{\text{t ore}}

Fixed it by toggling the background colour on and off in her book.

Trying to make all equations not so big in PDF

Here is some text and here is LaTeX that isn’t changed: Fe^{+3}/Fe^{+2}. Here is trailing text

Here is some text and here is LaTeX that I want “normalsize”: \normalsize Fe^{+3}/Fe^{+2}. Here is trailing text.

Here is some text and here is LaTeX that I want “small”: \small Fe^{+3}/Fe^{+2}. Here is trailing text.

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