Closed mccarthy-m-g closed 4 years ago
This commit solves this issue. For anyone curious: I chose to use different renderers for HTML and PDF outputs, and will be using inline R code to reference symbols. For example: `r f`
will display a flat symbol using unicode in the HTML version and the musicography package in the LaTeX version.
The only downside to this approach is that:
source()
the _musicSymbols.R
file containing the music symbol R objects at the start of any chapter I wish to use them in. This appears to be a limitation of the knitr::is_html_output()
and knitr::is_latex_output()
functions, as their documentation says they only work in .Rmd files. Calling _musicSymbols.R
in _bookdown.yml
with before_chapter_script:
does not work.font-display: swap;
to change this behaviour though).
Displaying sharps, flats, and other music symbols in-text is an important feature for this book. Although I could write sharps with # and flats with b, this is less accurate and attractive than using the ♯ and ♭ music symbols. So far I have found two options for rendering these music symbols in bookdown:
Both methods support some of the symbols I need, however, I've encountered problems implementing them (see below). Any help or alternate suggestions would be appreciated.
Mathjax problems
$\flat$3
does not work in the body of my document, it renders like$$3
.$\flat 3$
).$\sf 3$
, however this doesn't support boldface.Unicode problems
Using different renderers for different outputs
I could use different renderers for HTML and PDF if the best solutions are HTML or PDF specific. If I have to go this route there is the musicography package for LaTex I could use (assuming it can be installed in my GitHub actions build; I'd have to figure that out).