tex

Python: Unable to Render Tex in Matplotlib

人盡茶涼 提交于 2019-12-28 02:05:26
问题 I recently upgraded my laptop to Snow Leopard, updated TeX to Version 3.1415926 (TeX Live 2011/MacPorts 2011_5), and installed Python 2.7.3. After all these installs, I ran macport selfupdate and macport upgrade outdated. However, now when I try to use TeX in matplotlib, I receive the following: LaTeX was not able to process the following string:'lp' Here is the full report generated by LaTeX: This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011/MacPorts 2011_5) restricted \write18

How to get matplotlib and latex work together?

╄→尐↘猪︶ㄣ 提交于 2019-12-23 12:35:55
问题 I have the following problem and I am totally new to matplotlib and python: To produce high qualitiy plots for my thesis I want to use matplotlib and I want to use the latex commands for the axes etc. When I try the following example (from http://matplotlib.org/users/usetex.html#usetex-tutorial): import numpy as np import matplotlib.pyplot as plt # Example data t = np.arange(0.0, 1.0 + 0.01, 0.01) s = np.cos(4 * np.pi * t) + 2 plt.rc('text', usetex=True) plt.rc('font', family='serif') plt

Uniform spacing with Matplotlib and TeX

∥☆過路亽.° 提交于 2019-12-23 12:26:11
问题 I am drawing up some graphs for a math class, and I can't get the spacing for peacewise definitions quite right in the plot legend. I am currently using \, for a single space in TeX, but run into a situation where one is slightly farther up than other maybe due to how much the equations to the left take up. Here is my code import matplotlib.pyplot as plt import numpy as np import math as math # 0-1 x = np.linspace(0, 1) y = np.power(x, 2) plt.plot(x, y, label=r"$t^2 \,\,\,\,\,\, 0 \leq t \leq

pandoc skip latex environment

痴心易碎 提交于 2019-12-23 11:56:42
问题 I'm writing mainly in LaTeX, but some co-authors prefer MS Word. To facilitate their work a bit, I would like to convert the .tex file (or the .pdf ) to a .docx . The formatting does not need to be perfect, but all of the text, equations, figures etc should be perfectly readable. I'm currently thinking to take the .tex document, replace all the essential stuff and then let Pandoc do it's magic. For this I would preferably implement my additions as a Pandoc filter. E.g., my tikz pictures would

Change `"` quotation marks to latex style

非 Y 不嫁゛ 提交于 2019-12-23 03:45:13
问题 I'm editing a book in LaTeX and its quotation marks syntax is different from the simple " characters. So I want to convert "quoted text here" to ``quoted text here'' . I have 50 text files with lots of quotations inside. I tried to write a regular expression to substitute the first " with `` and the second " with '' , but I failed. I searched on internet and asked some friends, but I had no success at all. The closest thing I got to replace the first quotation mark is s/"[a-z]/``/g but this

how to add tex to octave graph

泪湿孤枕 提交于 2019-12-22 14:59:22
问题 I have a bar graph, and I am using text() to display fractions above each of the bars. For example: text(1, 20, "300/400") displays the string "300/400" at position (1,20). I would now like to prettify the fractions so that "300" appears over the "400": 300 --- 400 Is there a way to do this, eg with tex or latex? I tried each of these, but the interpreter is not getting called: text(1, 20, '\frac{300}{400}'); text(1, 20, '\frac{300}{400}', 'interpreter', 'tex'); text(1, 20, '\frac{300}{400}',

Extract only body text from arXiv articles formatted as .tex

ぐ巨炮叔叔 提交于 2019-12-22 09:22:03
问题 My dataset is composed of arXiv astrophysics articles as .tex files, and I need to extract only text from the article body, not from any other part of the article (e.g. tables, figures, abstract, title, footnotes, acknowledgements, citations, etc.). I've been trying with Python3 and tex2py, but I'm struggling with getting a clean corpus, because the files differ in labeling & the text is broken up between labels. I have attached a SSCCE, a couple sample Latex files and their pdfs, and the

Add tex distribution to PATH for R studio

荒凉一梦 提交于 2019-12-22 08:42:04
问题 I have recently begun using knitr with Rstudio. I ran into the "No tex installation detected. Please install TeX before compiling." error in both my Ubuntu and windows OS's. After some research I was able to amend the issue in Ubuntu by adding the directory of my tex installation to PATH . I did this by including the following line in Renviron.site PATH=/usr/local/texlive/2013/bin:${PATH} However, the issue remains for my windows installation. I was unable to find the Renviron.site file, so I

Add tex distribution to PATH for R studio

五迷三道 提交于 2019-12-22 08:40:06
问题 I have recently begun using knitr with Rstudio. I ran into the "No tex installation detected. Please install TeX before compiling." error in both my Ubuntu and windows OS's. After some research I was able to amend the issue in Ubuntu by adding the directory of my tex installation to PATH . I did this by including the following line in Renviron.site PATH=/usr/local/texlive/2013/bin:${PATH} However, the issue remains for my windows installation. I was unable to find the Renviron.site file, so I

How to insert an image into Anki notes in latex format?

馋奶兔 提交于 2019-12-21 22:15:49
问题 I am trying to create an Anki deck with, for example, a word on the front. Then I add the word with definitions on the back with a picture as well. But I am having trouble including graphics when there are already two fields (front text and back text). Here is an example note: \begin{note} \begin{field} \textbf{\large ruminate} \end{field} \begin{field} \textbf{\large ruminate} \begin{description} \item[verb] \hfill \\ chew the cuds \item[verb] \hfill \\ reflect deeply on a subject \end