reStructuredText是否以某种方式支持其引用中的页码?到目前为止,我在示例中只看过[Test10]_
这样的普通标签,但不是[Test10 p. 20]_
。
我认为这对科学论文非常重要。你不想强迫读者检查一个来源阅读整本书以找到你所指的内容。或者甚至是整篇论文。所以在我看来应该支持它,但到目前为止我找不到它。
答案 0 :(得分:1)
这正是我所寻找的: - )
您可以尝试这样的事情:
calcMSE = function(model,modelLabel,dataSet,trainIdx,newX=NULL)
{
# The predict method for glmnet will need to be called differently from the
# other predict methods.
if ("glmnet" %in% class(model)) {
predVals = predict(model,newX,type="response")
} else {
predVals = predict(model,data)
}
MSE = list(
name = modelLabel,
train = mean((predVals[trainIdx] - data$y[trainIdx])^2),
test = mean((predVals[-trainIdx] - data$y[-trainIdx])^2)
)
return(MSE)
}
modelMSEs = data.frame(Model = rep(NA,8),Train.MSE = rep(NA,8),Test.MSE = rep(NA,8))
modelMSEs[1,] = calcMSE(modelA1,"A1",Data,trainIdx)
modelMSEs[2,] = calcMSE(modelA2,"A2",Data,trainIdx)
modelMSEs[3,] = calcMSE(modelB1,"B1",Data,trainIdx)
modelMSEs[4,] = calcMSE(modelB2,"B2",Data,trainIdx)
modelMSEs[5,] = calcMSE(modelC1,"C1",Data,trainIdx)
modelMSEs[6,] = calcMSE(modelC2,"C2",Data,trainIdx)
print(modelMSEs)
它也适用于指令.. footer:: page ###Page###
见:
答案 1 :(得分:0)
我最终为rst
编写了自己的解析器和转换器,将引用和内部链接转换为raw-latex
引用和优化引用。您可以在我的GitHub repos中找到该代码。我现在对rst的构建过程如下所示: