bbucior / drposter

Generate Academic Posters in R Markdown and CSS, inspired by 'reveal.js'
GNU General Public License v3.0
75 stars 21 forks source link

Problem with MathJaX #5

Open datawookie opened 6 years ago

datawookie commented 6 years ago

Hi!

I'm busy preparing my first poster using drposter and really enjoying it. So much easier than the other tools I have used. I'm having some issues with formatting maths though: fractions get compressed onto a single line (rather than there being a numerator, line and denominator, they are all rendered on top of each other).

Markdown for a minimal example below.

I see that there is already a patch for a MathJaX spacing issue (96c981f206d4954b2276da64308137fff33ac8bf) and if I copy lines 61-68 from page.css into my custom CSS file then this resolves the issue. Maybe it would be an idea to apply that chunk of CSS by default?

Best regards, Andrew.

---
title: "Broken Equations"
output: drposter::drposter_poster
---

## Introduction

$$
p(\theta|y, X) = \frac{p(y|X, \theta) p(\theta)}{p(y)} \propto p(y|\theta) p(\theta)
$$
datawookie commented 6 years ago

Hi,

I noted that drposter.css actually includes page.css and the reason that I was not picking that up was that I had an (old) version of the drposter_files in my local directory.

I deleted that local copy of drposter_files but then it seemed that there was no link at all to these CSS files. So I had to create a symlink to the drposter_files folder in my local R library. I was wondering if maybe I am missing something? Is there not a way to link directly to the CSS files in the R library?

Thanks, Andrew.

bbucior commented 6 years ago

Hi Andrew, if you run the drposter::drposter_update() command in your project directory, it should re-copy the drposter_files/ from the installed version of the R package into your local directory (make a backup of your project beforehand, just in case).

I wasn't sure the most intuitive way to set up this workflow or write the documentation in the README--I'd appreciate if you have any suggestions for improvement. Maybe the renderer should automatically restore drposter_files/ if the directory is missing? Or test that it's up to date with the installed package? The reason I had it cache the CSS instead of directly using the package is so that old posters don't unexpectedly break/change if you update your R package.

lenarddome commented 5 years ago

I had the same problem and I can confirm that using drposter_update() fixes the issue.

A very brief step by step instruction/tutorial might be useful though.