更改属性输出包检查,R

更改属性输出包检查,R,r,latex,r-exams,R,Latex,R Exams,我需要用R和Latex的考试包写问题,有编号,没有标题,如下所示: 我不需要“问题”这样的标题: 最后一个图像是使用以下代码编写的,来自: R中的代码是: \documentclass{article} \begin{document} \SweaveOpts{concordance=TRUE} <<echo=FALSE, results=hide>>= library("exams") #exams2html("swisscapital.Rnw") exams

我需要用R和Latex的考试包写问题,有编号,没有标题,如下所示:

我不需要“问题”这样的标题:

最后一个图像是使用以下代码编写的,来自:

R中的代码是:

\documentclass{article}

\begin{document}
\SweaveOpts{concordance=TRUE}

<<echo=FALSE, results=hide>>=
library("exams")
#exams2html("swisscapital.Rnw")
exams2pdf("swisscapital.Rnw")
@

\begin{question}[""]
What is the seat of the federal
authorities in Switzerland
(i.e., the de facto capital)?

\begin{answerlist}
  \item Basel
  \item Bern
  \item Geneva
  \item Lausanne
  \item Zurich
  \item St.~Gallen
  \item Vaduz
\end{answerlist}
\end{question}

\begin{solution}
There is no de jure capital but
the de facto capital and seat of
the federal authorities is Bern.

\begin{answerlist}
  \item False.
  \item True.
  \item False.
  \item False.
  \item False.
  \item False.
  \item False.
\end{answerlist}
\end{solution}

\exname{Swiss Capital}
\extype{schoice}
\exsolution{0100000}
\exshuffle{5}

\end{document}
\documentclass{article}
\开始{document}
\SweaveOpts{concordance=TRUE}
=
图书馆(“考试”)
#exams2html(“swisscapital.Rnw”)
exams2pdf(“swisscapital.Rnw”)
@
\开始{问题}[“”]
联邦政府所在地是哪里
瑞士当局
(即实际资本)?
\开始{应答列表}
\巴塞尔项目
\伯尔尼项目
\日内瓦项目
\洛桑商品
\苏黎世商品
\圣加仑物品
\瓦杜兹项目
\结束{应答列表}
\完{问题}
\开始{解决方案}
法律上没有资本,但
事实上的首都和所在地
联邦当局是伯尔尼。
\开始{应答列表}
\项目错误。
\项目为真。
\项目错误。
\项目错误。
\项目错误。
\项目错误。
\项目错误。
\结束{应答列表}
\结束{解决方案}
\exname{瑞士首都}
\extype{schoice}
\exsolution{0100000}
\exshuffle{5}
\结束{document}
有可能写带编号和无标题的问题,怎么写


谢谢。

将每个问题定义为一个单独的
.Rnw
文件,然后使用一个模板(您可以稍后自定义),您将得到列出的问题。当每个问题的分数不同时,我认为您可以在每个问题的开头插入这些信息(在
.Rnw
文件中)。对于简单的情况,请运行R脚本:

library("exams")

## exam with a simple vector of exercises in R/LaTeX (.Rnw) format
myexam2 <- c("swisscapital.Rnw","switzerland.Rnw")

## generate the PDF version of a exam with template exam.tex
exams2pdf(myexam2, template = "exam.tex")
库(“考试”)
##使用R/LaTeX(.Rnw)格式的简单练习向量进行考试
myexam2使用
exams2pdf()
您可以使用自己的
模板
文件自定义考试的外观。有关详细信息,请参见@Robert的答案

此外,您可能有兴趣使用
exams2nops()
,它提供了一种标准格式,主要用于单选和多选练习,可以自动扫描和评估。这还允许使用一些在您的情况下可能有用的自定义选项。有关更多详细信息,请参见。为了快速印象,考虑以下例子:

exams2nops("switzerland.Rnw",
  language = "es", points = 0.5, showpoints = TRUE,
  intro = "Responder las siguientes preguntas.")

谢谢。我将回顾解决方案。感谢您的解释,@Robert,我在第一次
考试中添加了一些进一步的指针,解释了LaTeX模板的结构。