如何在 R/考试中使用 LaTeX 包? [英] How to use a LaTeX package with R/exams?

查看:66
本文介绍了如何在 R/考试中使用 LaTeX 包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 exams2moodle() 创建考试测验.我想使用一些需要 LaTeX 包 amssymb 的数学符号.我应该如何进行?

I am using exams2moodle() to create exam quizzes. I would like to use some math symbols which require the LaTeX package amssymb. How should I proceed?

推荐答案

TL;DR: amssymb MathJax 支持 LaTeX 符号,它是标准 Moodle 安装中的默认渲染器.因此,当使用 exams2moodle(..., converter = "pandoc-mathjax") 这是默认的 sinc R/exams 2.3.3(2019 年 7 月发布)时,这些符号应该是开箱即用的.

TL;DR: amssymb LaTeX symbols are supported by MathJax which is the default renderer in a standard Moodle installation. So these symbols should work out of the box when using exams2moodle(..., converter = "pandoc-mathjax") which is the default sinc R/exams 2.3.3 (released in July 2019).

细节:正如@Hack-R 的回答已经指出的那样,有多种方法可以在基于 HTML 的练习中包含用 LaTeX 编写的数学符号.此博客文章中给出了概述:http://www.R-exams.org/教程/数学/

Details: As already pointed out by the answer of @Hack-R, there are various ways of including mathematical notation written in LaTeX in HTML-based exercises. An overview is given in this blog post: http://www.R-exams.org/tutorials/math/

需要注意的是,在这种情况下,LaTeX 代码实际上并不是由 LaTeX 本身处理的.它可以转换为 MathML(使用 pandocttm)或通过 MathJax JavaScript 库在浏览器中呈现.在任何情况下,它都取决于可以成功显示 LaTeX 命令的转换器/渲染器.它们都支持基本的 LaTeX 命令以及来自某些包的一些额外命令.支持哪些包中的哪些附加命令取决于转换器/渲染器.无论如何,这些功能不能被样式文件扩展!

It is important to note that in this case the LaTeX code is not actually processed by LaTeX itself. It can either be converted to MathML (using pandoc or ttm) or rendered in the browser by the MathJax JavaScript library. In any case it depends on the converter/renderer which LaTeX commands can be successfully displayed. All of them support basic LaTeX commands plus some extra commands from certain packages. Which additional commands from which packages are supported depends on the converter/renderer. In any case, the capabilities can not be extended by style files!

在标准的 Moodle 安装中,启用了 MathJax,它支持 AMS LaTeX 包(因为 MathJax 是由 AMS 开发的/为 AMS 开发的!).所以最好的策略是简单地将 LaTeX 保留在 Moodle 的 HTML 中.这可以通过 exams2moodle(..., converter = "pandoc-mathjax") 来完成,它实际上是自 2019 年 7 月发布的 R/exams 2.3.3 以来的默认 converter. 在以前的 R/exams 版本中,默认值是 converter = "ttm",它支持所有 amssymb 符号.

In a standard Moodle installation MathJax is enabled which suports the AMS LaTeX package (because MathJax was developed by/for the AMS!). So the best strategy is to simply keep the LaTeX in the HTML for Moodle. This can be done with exams2moodle(..., converter = "pandoc-mathjax") which is actually the default converter since R/exams 2.3.3 released in July 2019. In previous versions of R/exams, the default was converter = "ttm" which did not support all the amssymb symbols.

这篇关于如何在 R/考试中使用 LaTeX 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆