latex

R - stargazer add reference categories

╄→尐↘猪︶ㄣ 提交于 2019-12-12 18:31:45
问题 I was wondering if someone came with a solution to show up the reference categories of categorical variables using stargazer ? library(stargazer) Let us imagine that gear and carb are categorical variables mtcars$gear = factor(mtcars$gear) mtcars$carb = factor(mtcars$carb) I run an ols with lm1 = lm(disp ~ gear + carb, mtcars) and stargaze the results. stargazer(lm1, single.row = TRUE, omit.table.layout = "sn") I get However, I find myself always going back to the tex file to custom the

是程序员,就用python导出pdf

血红的双手。 提交于 2019-12-12 18:24:03
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 这两天一直在做课件,我个人一直不太喜欢PPT这个东西……能不用就不用,我个人特别崇尚极简风。 谁让我们是程序员呢,所以就爱上了Jupyter写课件,讲道理markdown也是个非常不错的写书格式啊。 安装Jupyter其实非常简单,你会python就应该会用jupyter,起码简单的 pip install jupyter, jupyter notebook 要会对伐~ 好那接下来就是使用jupyter了,启动jupyter后,使用浏览器访问相应IP:Port就可以使用了。没错,jupyter就是这么一个可以用网站来写python的地方。 但是发讲义给同学们看,ipynb格式的文件肯定不方便啊,别人还没上课呢,哪知道那么多?再者PDF传阅起来也随时随地能打开啊。所以我就想转换成PDF。 但是打开文件,点击下载,发现出现了Error 然后照着这个Error,就去谷歌了,发现说的最多的就是要装一个latex环境,mac下完整的安装包要将近3个G!我就为了一个PDF还不需要这么大一个包吧?所以寻思其他方法。 虽然jupyter对PDF支持的不是那么的友善,但是对于html是非常棒的,只不过html是一个html嘛(这不是废话)……不过我可以利用html转换到pdf上啊。 后来了解到python有一个包叫 pdfkit

Include label attribute into xtable header

别来无恙 提交于 2019-12-12 18:19:37
问题 Reproducible example: I have a data frame which has labelled variables using the sjmisc package, which works nicely together with dplyr since v0.4.2. library(dplyr) library(sjmisc) library(ggplot2) data("diamonds") df= tbl_df(diamonds) %>% select(cut, carat, price) %>% set_label(c("", "Kt", "EUR")) %>% slice(1:10) As str(df) shows it properly contains for two columns the labels: Classes ‘tbl_df’, ‘tbl’ and 'data.frame': 10 obs. of 3 variables: $ cut : Ord.factor w/ 5 levels "Fair"<"Good"<..:

Latex Table Syntax

时光毁灭记忆、已成空白 提交于 2019-12-12 18:15:55
问题 \begin{center} \begin{table}[h!] \centering \begin{tabular}{|l|l|l|l|} \hline Name of the Dataset File & Number of Cases & Number of Records & Primary Key \\ \hline Detail Interaction & 147,004 & 2400 & Interaction ID \\ \hline Detail Incident & \\ \hline Detail Change & \\ \hline Detail Activity & \\ \hline \end{tabular} \caption{Dataset description of the four datasets provided by Rabobank Group ICT.} \end{table} \end{center} The table doesnt fit to the page. Can someone help me in making

R :How to get a proper latex regression table from a dataframe?

℡╲_俬逩灬. 提交于 2019-12-12 17:50:00
问题 Consider the following example inds <- c('var1','','var2','') model1 <- c(10.2,0.00,0.02,0.3) model2 <- c(11.2,0.01,0.02,0.023) df = df=data.frame(inds,model1,model2) df inds model1 model2 var1 10.20 11.200 0.00 0.010 var2 0.02 0.020 0.30 0.023 Here you have the output of a custom regression model with coefficients and P-values (I actually can show any other statistics if I need to, say, the standard errors of the coefficients). There are two variables, var1 and var2 . For instance, in model1

How to add copyright notice to sphinx-generated latex documentation?

牧云@^-^@ 提交于 2019-12-12 17:31:33
问题 I have set the copyright configuration value and it correctly appears in the HTML output. However, it does not appear at all in the LaTeX output, and I can't find any option for LaTeX output that will make it appear. How can I automatically include the copyright notice in the LaTeX output, using sphinx? Of course, I could manually add it or write a small script to add it, but I expect it should be possible within the sphinx framework. Apparently, there is a request for improvement to make

Sans-serif Font for Axes Tick-labels with Latex

别说谁变了你拦得住时间么 提交于 2019-12-12 16:23:31
问题 I'm trying to use Latex with matplotlib for the first time. It seems that when using Latex matplotlib uses a serif font for the axes labels. I tried explicitly setting the font-family to 'sans-serif' using rc('font',family='sans-serif') but this had no effect, I'm assuming this is because the axes-labels are inside a math-environment. Is there a way to set the 'rc' so that matplotlib will use a sans-serif font for the axes labels? Thanks! 回答1: Sans-serif math fonts can be used in LaTeX with

Need simple regex for LaTeX

 ̄綄美尐妖づ 提交于 2019-12-12 14:38:31
问题 In my LaTeX files, I have literally thousands of occurrences of the following construct: $\displaystyle{...math goes here...}$ I'd like to replace these with \mymath{...math goes here...} Note that the $'s disappear, but the curly braces remain---if not for the trailing $, this would be a basic find-and-replace. If only I knew any regex, I'm sure it would handle this with no problem. What's the regex I need to make this happen? Many thanks in advance. Edit: Some issues and questions have

Does pybtex support accent/special characters in .bib file?

前提是你 提交于 2019-12-12 13:53:32
问题 from pybtex.database.input import bibtex parser = bibtex.Parser() bibdata = parser.parse_file("sample.bib") The above code snippet works really well in parsing a .bib file but it seems not to support accent characters, like {\"u} or \"{u} (From LaTeX). Just like to confirm if pybtex support that or not. For example, according to LaTeX/Special Characters and How to write “ä” and other umlauts and accented letters in bibliography?, \"{o} should convert to ö , and so does {\"o} . 回答1: Update :

Vim: How to reformat a set of lines into a single line (if the line is a single sentence)?

跟風遠走 提交于 2019-12-12 13:10:03
问题 Not a dup of In Vim, what is the simplest way to join all lines in a file into a single line?, as I specifically mean to use the gq reformatting functionality. I used to write latex in vim using 80 character textwidth . However, I've now switched to an infinite textwidth , so my lines go on forever. Vim's reformatting (gqap for example), combines a few lines into a paragraph, wrapping them at 80 characters. I'd like it to instead combine them into a single line. ie Without a \clang{goto}