Latexpackages in STACK

Latexpackages in STACK

by Selina Dirnböck -
Number of replies: 2

Hello! 

I want to add the symbol for all real numbers (see below) in my Questiontext in STACK. I have not found an option for this symbol in core latex. Is there a way to include this symbol/different latex packages into STACK? 

Thank you very much in advance! 
Average of ratings: -
In reply to Selina Dirnböck

Re: Latexpackages in STACK

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers
The chain of events is (normally) as follows

1. STACK generates part of a HTML page into which you can embed LaTeX equations.  You can generate equations in two ways: (a) write them yourself (!) or (b) use Maxima within your question, which generate LaTeX when the page is displayed.

2. The HTML is then embedded into a moodle page, and mathematics in LaTeX is displayed on a student's browser using a LaTeX filter such as MathJax.

So, the answer to your question is in two parts!

a. The symbol you want is LaTeX "blackboard bold" and you can typeset it as \( \mathbb{R} \)
b. If you would like a variable in Maxima to be displayed in this way you can define texput(R, "\\mathbb{R}"); in the question variables and then any occurance of the maxima variable R will be displayed in blackboard bold. E.g. {@R@}. This includes any use by a student in the input (newer versions of STACK).

Support for blackboard bold is, I think, in core MathJax. At least, it works on all my machines without (consciously) having to add extra packages.  I'm not a MathJax expert if this does not work on your setup, sorry.

It is possible you will need to load other packages into MathJax  MathJax is a separate project, and has a lot of options!  It might be necessary to load alternative packages.

For example, I'd like to be able to use LaTeX's "cancel" command, but that needs a non-standard MathJax package to be loaded.

I would really appreciate comments from experienced users on this proposal:
https://github.com/maths/moodle-qtype_stack/issues/934

The proposal shows how you could add packages to your Moodle config, but this need Moodle admin rights of course.

I hope this helps,
Chris

In reply to Christopher Sangwin

Re: Latexpackages in STACK

by Selina Dirnböck -
Thank you very much for your patient and detailed answer! I was using \mathds{R}, which didn't work so I (wrongly) assumed no packages would work. So thank you for clearing that up.

Selina