latex

How can I make an R plot use the Latin Modern font family when saved as a PDF?

做~自己de王妃 提交于 2021-02-16 15:14:51
问题 If I type par(family='CM Roman') then I can get a plot to display with the Computer Modern font. However, when I try to save it as a PDF, it comes up as a blank document, unlike if I take out that line. How can I get it to save correctly as a PDF? Also, how can I use Latin Modern instead of Computer Modern? 回答1: This is how I did it in Windows: Install the extrafont package. Install Latin Modern fonts, e.g. from http://www.fontsquirrel.com/fonts/latin-modern-roman. Watch out, you need to

Formatted latex regression tables with multiple models from broom output?

冷暖自知 提交于 2021-02-16 07:01:33
问题 I have several models such as the example below for which I have estimates, standard errors, p-values, r2 etc. as data.frames in tidy format, but I don't have the original model objects (analysis was run on a different machine). require(broom) model <- lm(mpg ~ hp + cyl, mtcars) tidy_model <- tidy(model) glance_model <- glance(model) # tidy_model # # A tibble: 3 x 5 # term estimate std.error statistic p.value # <chr> <dbl> <dbl> <dbl> <dbl> # 1 (Intercept) 36.9 2.19 16.8 1.62e-16 # 2 hp -0

Adaboost 算法的原理与推导

社会主义新天地 提交于 2021-02-15 00:04:32
Adaboost 算法的原理与推导 0 引言 一直想写Adaboost来着,但迟迟未能动笔。其算法思想虽然简单:听取多人意见,最后综合决策,但一般书上对其算法的流程描述实在是过于晦涩。昨日11月1日下午,在我组织的 机器学习班 第8次课上讲决策树与Adaboost,其中,Adaboost讲得酣畅淋漓,讲完后,我知道,可以写本篇博客了。 无心啰嗦,本文结合机器学习班决策树与Adaboost 的 PPT ,跟邹讲Adaboost指数损失函数推导的 PPT (第85~第98页)、以及李航的《统计学习方法》等参考资料写就,可以定义为一篇课程笔记、读书笔记或学习心得,有何问题或意见,欢迎于本文评论下随时不吝指出,thanks。 1 Adaboost的原理 1.1 Adaboost是什么 AdaBoost,是英文"Adaptive Boosting"(自适应增强)的缩写,由Yoav Freund和Robert Schapire在1995年提出。它的自适应在于:前一个基本分类器分错的样本会得到加强,加权后的全体样本再次被用来训练下一个基本分类器。同时,在每一轮中加入一个新的弱分类器,直到达到某个预定的足够小的错误率或达到预先指定的最大迭代次数。 具体说来,整个Adaboost 迭代算法就3步: 初始化训练数据的权值分布。如果有N个样本,则每一个训练样本最开始时都被赋予相同的权值:1/N。

markdown-it-vue 一个 Markdown 的 Vue 组件库

杀马特。学长 韩版系。学妹 提交于 2021-02-13 18:20:48
项目地址: https://github.com/ravenq/markdown-it-vue Markdonw Vue 组件库. markdown-it-vue 是一个丰富的 markdown Vue 组件,markdown-it-vue 使用 markdown-it 作为 Markdown 数据解析引擎,整合多种 markdown-it 插件,并内置了一些自己的功能性插件,支持 GFM TOC、GFM style、emoji等通用特性,还支持 mermaid charts、Echarts、flowchart.js 等多种图表,支持 AsciiMath、Latex 等数学公式渲染,支持 errro | warning | info 个性化提示。 在线示例 http://www.aqcoder.com/markdown 安装 npm install markdown-it-vue 特性 Official markdown syntax. GFM TOC GFM style emoji mermaid charts Echarts Flowcharts.js Subscript/Superscript AsciiMath info | error | warning message tip 使用的插件 markdown-it markdown-it-emoji markdown-it

Jupyter Notebook小技巧

雨燕双飞 提交于 2021-02-12 05:41:09
多行输出 在Notebook的中开头cell中添加以下代码可以实现多行输出: from IPython .core .interactiveshell import InteractiveShell InteractiveShell .ast_node_interactivity = 'all' #默认为'last' 例如: 如果需要一劳永逸的在每个文件中自动实现这个功能,可以在macOS的/Users/your_user_name/.ipython/profile_default/或者windows的C:\Users\your_profile.ipython\profile_default文件夹下创建ipython_config.py文件。(mac下你可以在终端进入这个目录touch ipython_config.py来创建)。 然后打开ipython_config.py文件,添加以下两行: c = get_config ( ) c . InteractiveShell .ast_node_interactivity = "all" 保存,重启Notebook后生效。 更多设置点这里看官方说明 感谢 离宫2 提示这个技巧。 module 'numpy' has no attribute ' version ' import pandas as pd 就报这个错误,原因未知

Render LaTeX tables in HTML using rmarkwown

佐手、 提交于 2021-02-11 06:08:52
问题 I am trying to render the following table in a RMD file: \begin{table}[] \centering \caption{My caption} \label{my-label} \begin{tabular}{|l|} \hline \\ \hline \end{tabular} \end{table} So far no success. Is there any fundamental reason why rmarkdown cannot compile LaTeX enviroments (other than equations) to HTML? 回答1: In a markdown document, the expected input markup language is (r)markdown. You should not expect pandoc to automatically recognize arbitrarily mixed markup languages. LaTeX

Render LaTeX tables in HTML using rmarkwown

感情迁移 提交于 2021-02-11 06:08:44
问题 I am trying to render the following table in a RMD file: \begin{table}[] \centering \caption{My caption} \label{my-label} \begin{tabular}{|l|} \hline \\ \hline \end{tabular} \end{table} So far no success. Is there any fundamental reason why rmarkdown cannot compile LaTeX enviroments (other than equations) to HTML? 回答1: In a markdown document, the expected input markup language is (r)markdown. You should not expect pandoc to automatically recognize arbitrarily mixed markup languages. LaTeX

Render LaTeX tables in HTML using rmarkwown

余生长醉 提交于 2021-02-11 06:06:58
问题 I am trying to render the following table in a RMD file: \begin{table}[] \centering \caption{My caption} \label{my-label} \begin{tabular}{|l|} \hline \\ \hline \end{tabular} \end{table} So far no success. Is there any fundamental reason why rmarkdown cannot compile LaTeX enviroments (other than equations) to HTML? 回答1: In a markdown document, the expected input markup language is (r)markdown. You should not expect pandoc to automatically recognize arbitrarily mixed markup languages. LaTeX

Render LaTeX tables in HTML using rmarkwown

谁说我不能喝 提交于 2021-02-11 06:06:45
问题 I am trying to render the following table in a RMD file: \begin{table}[] \centering \caption{My caption} \label{my-label} \begin{tabular}{|l|} \hline \\ \hline \end{tabular} \end{table} So far no success. Is there any fundamental reason why rmarkdown cannot compile LaTeX enviroments (other than equations) to HTML? 回答1: In a markdown document, the expected input markup language is (r)markdown. You should not expect pandoc to automatically recognize arbitrarily mixed markup languages. LaTeX

ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory

你离开我真会死。 提交于 2021-02-10 23:16:14
问题 This problem ties in with the many discussions about the Xerces dependency hell, but I can't seem to solve it. I'm trying to export LaTeX code to PDF in Java. My code is part of an OSGI bundle for Cytoscape 3.4 and is managed and built with Maven. The LaTeX library is jlatexmath (1.0.6) and to write to SVG and PDF I want to try the apache fop (0.95) libs. Fop is depending on a whole range of batik libraries, which in turn depend on xml-apis (1.3.04). With xml-apis included, I get this error: