latex

How to automatically use git diff --word-diff option for *.tex files but not others?

五迷三道 提交于 2019-12-06 05:54:40
问题 Is there a way to use --word-diff for LaTeX files (*.tex) and keep the standard line difference for other file types? What I want to achieve is to use git diff command and let git show the word difference on *.tex files automatically without a need to write git diff --word-diff each time. At the same time I want git to show the standard line difference for other file types. Is that possible? 回答1: See the Generating diff text section of the gitattributes documentation. However, to

Executing Curl with PHP

被刻印的时光 ゝ 提交于 2019-12-06 05:21:01
问题 I'm trying to use Docverter to convert LaTeX/markdown files to PDF but am having trouble using PHP to do CURL to access Docverter via their API. I'm know I'm not a total idiot b/c i can get this to work adapting the shell script in this Docverter example and running from command line (Mac OSX). Using PHP's exec() : $url=$_SERVER["DOCUMENT_ROOT"]; $file='/markdown.md'; $output= $url.'/markdown_to_pdf.pdf'; $command="curl --form from=markdown \ --form to=pdf \ --form input_files[]=@".$url.$file

header on each page of big table of xtable?

女生的网名这么多〃 提交于 2019-12-06 05:03:59
问题 How do you put on a big table of xtable the table header on each page?, So that is easier to read the table the table between pages. I use the following in Sweave: test.big<- xtable(test,label="table",caption='test') align(test.big) <- "|c|c|c|c|l|c|c|c|" print(test.big,tabular.environment='longtable',include.colnames = TRUE,floating=FALSE) Thanks for your answers 回答1: The longtable (LaTeX) package specification can be found at that URL. The section of code in the examples whose output

Using sed in bash script to replace LaTeX aliases

青春壹個敷衍的年華 提交于 2019-12-06 04:44:32
问题 I am relatively new to bash scripting and have no experience with LaTeX. I've been asked to develop a script which will replace convenience shortcuts in LaTeX documents with their more cumbersome long-form equivalents. My approach thus far has been to isolate both the shortcut and the long-form in separate variables and then try to replace them in the text by using sed. I've attached short example files below. As it is currently the script takes 2 arguments, a file expr from which it

Display Math Formula in javaFX

梦想与她 提交于 2019-12-06 04:35:33
问题 I want to know how to display math formula in a label for exemple in JavaFX. Like this picture : I want the .jar of a library and a small example in JavaFX. I already found some libraries but they are only for Swing/AWT. I tried some of them, but they don't work for me. Displaying fancy equations with Java 回答1: Since JLaTeXMath is using the Graphics2D API for rendering, you can use FXGraphics2D to draw the output to a JavaFX Canvas . For sample code, please refer to my answer to another

Adding background color of notes to Sphinx-generated PDF files?

試著忘記壹切 提交于 2019-12-06 04:30:43
问题 I am able to generate notes using the Sphinx directive .. notes:: . However, the notes in html file have a background color while those from the generated PDF don’t. How can I add color to Sphinx-generated PDF files? 回答1: You can add something like this in your conf.py file (see the doc for the options for the LaTeX output): latex_custom = r''' \definecolor{Admonition}{RGB}{221,233,239} \makeatletter \newenvironment{admonitionbox}{ \begin{lrbox}{\@tempboxa}\begin{minipage}{\columnwidth} }{

Ipython notebook align Latex equations in Ipython.Display module

隐身守侯 提交于 2019-12-06 04:17:56
I am using ipython notebook to write latex equations with the following modules from IPython.display import display, Math, Latex a simple example code might look like: display(Math('a = \\frac{1}{2}')) display(Math('b = \\frac{1}{3}')) display(Math('c = \\frac{1}{4}')) Which would output: a = 1/2 b = 1/3 c = 1/4 in a pretty print format. Is there a way that I can somehow align this in columns like: a = 1/2 b = 1/3 c = 1/4 ? I know that the markup allows HTML usage, but this markup is entered into the input for a code-based cell. Any help/advice is greatly appreciated!! I'm not sure how

How do I print superscripts in a table using xtable and sweave?

為{幸葍}努か 提交于 2019-12-06 04:15:58
问题 So my problem statement is as follows : I have defined a data frame in my Sweave document (.Rnw extension) using the following code: <<label=table2_1,echo=FALSE>>= table2_1_rows <- c('Students with compulsory Evaluations', 'Teachers with compulsory evaluations1', 'Teachers without Evaluation2', 'Students without compulsory evaluations3' ) table2_1_data <- c(1,2,3,4) table2_1final <- data.frame(table2_1_rows,table2_1_data) @ <<label=tab1,echo=FALSE,results=tex>>= print(xtable(table2_1final

How can I omit interactions using stargazer or xtable?

五迷三道 提交于 2019-12-06 04:03:23
问题 Is it possible to omit interactions in stargazer using the omit option? Normally I would write the variable name into the omit=c('varname') but in the case of an interaction I do not know what to write. Any hints on that? How do you solve this problem in other packages like xtable ? \documentclass{article} \begin{document} %Load dataset and run regression << lm, echo=FALSE >>= load('dataset.RData') library(stargazer) lm1 <- lm(y~ x + factor(v)*z ,data=dataset) @ << table_texstyle, echo=FALSE,

Matlab Fonts Not Rendering Correctly on Print or Export

瘦欲@ 提交于 2019-12-06 03:54:25
问题 I'm trying to make a matlab figure that nicely fits into a LaTeX Document. A known problem is that the XTickLabel and YTickLabels do not render using the LaTeX interpreter, causing bad looking plots. (Note: I realize there are some fixes out there that involve replacing the tex labels with text objects (i.e. format_tics), however these solutions are non-trivial when plotting multiple figures, and come with problems of their own that require a lot of tweaking for each individual figure.) I