latex

xelatex fails unless I re-set PATH to what it already is

China☆狼群 提交于 2019-12-25 01:15:09
问题 I have this PHP script: echo '--- getenv: ' . getenv('PATH') . "\n"; echo '--- echo PATH: ' . shell_exec('echo $PATH') . "\n"; echo '--- xelatex: ' . shell_exec('xelatex 2>&1') . "\n"; putenv('PATH='.trim(shell_exec('echo $PATH'))); echo '--- getenv: ' . getenv('PATH') . "\n"; echo '--- echo PATH: ' . shell_exec('echo $PATH') . "\n"; echo '--- xelatex: ' . shell_exec('xelatex 2>&1') . "\n"; Run from a php-fpm process (with clear_env = yes), it produces the following output: --- getenv: ---

how to export a dataframe to latex with some minimal formatting?

别来无恙 提交于 2019-12-24 19:23:31
问题 Consider this simple example library(dplyr) dataframe <- data_frame(mytext1 = c('HELLO', 'WORLD'), mytext2 = c('HELLO', 'AGAIN'), value1 = c(1,2), value2 = c(1,2)) # A tibble: 2 x 4 mytext1 mytext2 value1 value2 <chr> <chr> <dbl> <dbl> 1 HELLO HELLO 1 1 2 WORLD AGAIN 2 2 I would like to export this dataframe to a latex table, but with some little (but important) tweaks. In particular, I would like, in the latex output, to add a supercolumn that separates the text variables and another that

How to convert LaTeX to PDF/PNG by PHP

孤人 提交于 2019-12-24 18:06:22
问题 I have LaTeX code inside PHP (not as .tex file); for example received by $_POST. How can I save the rendered LaTeX as a PNG or PDF file on my server? EDIT: I know that PHP normally does not do this. I will run a shell command within PHP. Thus, I need something to do so in Linux terminal. 回答1: you could exec() pdfTex to generate a PDF URL: http://www.tug.org/applications/pdftex/ Run command pdftex file.tex after you saved your tex-code from $_POST to a file using file_put_contents() - make

Can´t save matplotlib figure to .eps in Windows while using text.usetex : True

自闭症网瘾萝莉.ら 提交于 2019-12-24 17:27:47
问题 When I run the following code: http://dpaste.com/0210P09 everything works fine on my Linux distro. However, in Windows7 (64bit) I cannot successfully save it in eps or svg . This is the error that I get: Traceback (most recent call last): File "<ipython-input-1-b8da411d11b0>", line 1, in <module> runfile('C:/Users/12151056/Documents/Python Scripts/MyPython/1Tplot_2.py', wdir='C:/Users/12151056/Documents/Python Scripts/MyPython') File "C:\Users\12151056\AppData\Local\Continuum\Anaconda3\lib

Latex verbatim: show characters using a fallback font?

你。 提交于 2019-12-24 16:42:47
问题 I use a specific monofont for verbatim blocks. In one of my verbatim block, some characters are not included in the font. As suggested in this post, one can use either a different font, or use pmboxdraw package to render the un-supported characters. But it seems that it does not work for me. The following is a MWE, in which the black circle (i.e., 1st character of the second line) can not be drawn correctly. My intention is that to use the monofont I used for the verbatim block, and use

Presenting Zelig Logistic Regression in Knitr with Stargazer or Other Package

这一生的挚爱 提交于 2019-12-24 16:26:37
问题 Stargazer appears to take most Zelig model objects except logistic regression: m1 <- zelig(voted ~ . - weight_full - by, weights = mydata$weight_full, data=mydata, model="logit", cite = FALSE) I receive the following warning from the above code: # Error in envRefInferField(x, what, getClass(class(x)), selfEnv) # ‘result’ is not a valid field or method name for reference class “Zelig-logit” Anyone have any alternatives for presenting such a model in a regression output table using Knitr to

Disable tex interpreter in matplotlib

时光毁灭记忆、已成空白 提交于 2019-12-24 16:22:46
问题 I would like to produce plots using matplotlib (through anaconda-spider installed on os x yosemite) and put labels on it not interpreted by tex. Here is the sample code: # -*- coding: utf-8 -*- import matplotlib.pyplot as pp my_rc_param = {'text.usetex': False} pp.figure() pp.rcParams.update(my_rc_param) pp.plot(range(10)) pp.xlabel('$x$') I would like to see exactly the string $x$ as x label. In turn, I get the math-mode latex x. I have also tried, unsuccessfully, to put the following

Tips for debugging latex errors in Doxygen

故事扮演 提交于 2019-12-24 15:25:12
问题 Right now I get an error message saying: No file _formulas.aux. ... ! Missing $ inserted. ... I've tried looking for and single @f$ tags in the code, but I have not been successful in locating the culprit thus far. How can I go about solving this specific issue? In addition, what are some general tips for debugging latex errors in doxygen? Are there any log files somewhere? 回答1: I use both Doxygen and LaTeX. When compiling formulas, Doxygen will take the contents of your LaTeX equations,

part of square root latex equation dissappears in pdf rendering from RStudio's rmarkdown

可紊 提交于 2019-12-24 12:22:24
问题 When I use this code to make a square root in my pdf document (rendered by rmarkdown): --- title: "Test" author: "test test" geometry: margin=1in output: pdf_document: keep_tex: yes latex_engine: xelatex number_sections: yes toc: yes toc_depth: 3 html_document: css: tables.css number_sections: yes theme: cerulean toc: yes toc_depth: 3 header-includes: - \usepackage[dutch]{babel} - \usepackage{fancyhdr} - \pagestyle{fancy} - \fancyfoot[LE,RO]{this is a fancy foot} - \usepackage{dcolumn} -

Why does python become unresponsive when I use LaTeX to render text?

為{幸葍}努か 提交于 2019-12-24 11:17:06
问题 I'm currently using python 2.7.11 running my code in command prompt . I am using matplotlib to create 3D figures for my LaTeX document. However when I try to use LaTeX to render my text for the images I receive a windows error message telling me python.exe has stopped working and I must close the program. Why is this happening and how can I fix it? I'm not tec savvy, so simple answers would be appreciated. Thank you in advance. Code The minimum code for this error is: from mpl_toolkits