tex

matplotlib - write TeX on Qt form

主宰稳场 提交于 2019-11-28 23:45:40
问题 I'd like to add some TeX text to my Qt form, like label - just text, no graph, no lines, no borders, just TeX. I thought something like this: render TeX to bitmap and then place that bitmap on form, e.g. into QLabel. Or even better - use some backend, add it to form and use something tex_label.print_tex(<tex code>) . Seems matplotplot has TeX parsers, but I can't figure out how to use them... Thanks. 回答1: As a variant: from matplotlib.figure import Figure from matplotlib.backends.backend

Trouble using Vim's syn-include and syn-region to embed syntax highlighting

ε祈祈猫儿з 提交于 2019-11-28 21:31:59
问题 I am trying to get Vim to syntax highlight any file that ends with extension .Rtex in the following way: All top level text is highlighted as TeX Exception: any text enclosed in \begin{python}...\end{python} is highlighted as Python I am able to achieve each of these criteria individually, but unable to achieve both simultaneously. I think that somehow the TeX highlighting overrides my Python-highlighted regions, or prevents them from taking effect, and I am stuck trying to figure out how.

How to Remove Footers of LaTeX Beamer Templates?

十年热恋 提交于 2019-11-28 20:58:42
问题 I am using the "beamerthemesplit" template of the Beamer LaTeX package. This templates includes the author's name and the title of the presentation in the footer of all pages. Is anyone aware of any way to suppress this footer? 回答1: I got rid of the default footer, and inserted page numbers instead using the following commands. %gets rid of bottom navigation bars \setbeamertemplate{footline}[page number]{} %gets rid of navigation symbols \setbeamertemplate{navigation symbols}{} 回答2: I do not

Disabling underscore-to-subscript in Emacs Org-Mode export

老子叫甜甜 提交于 2019-11-28 15:57:20
When I export to PDF via org-mode (C-c C-e d), any words with underscores end up being partially converted to subscript. How can I prevent this from happening? I found this article on the subject: Disabling Underscore subscript in Emacs Tex Mode However, I either wasn't able to figure out the correct elisp or it simply didn't work. Note, I don't want to change any global font options. I only want this fix to apply to tex/latex/org-mode. I also found this post, though it didn't work either: disable subscript superscript raise/lower? You can disable super/subscripting within an org file by

How to create a timeline with LaTeX?

巧了我就是萌 提交于 2019-11-28 15:12:24
In history-books you often have timeline, where events and periods are marked on a line in the correct relative distance to each other. How is it possible to create something similar in LaTeX? Zoe Gagnon The tikz package seems to have what you want. \documentclass{article} \usepackage{tikz} \usetikzlibrary{snakes} \begin{document} \begin{tikzpicture}[snake=zigzag, line before snake = 5mm, line after snake = 5mm] % draw horizontal line \draw (0,0) -- (2,0); \draw[snake] (2,0) -- (4,0); \draw (4,0) -- (5,0); \draw[snake] (5,0) -- (7,0); % draw vertical lines \foreach \x in {0,1,2,4,5,7} \draw (

Align TeX equations in matplotlib

旧城冷巷雨未停 提交于 2019-11-28 08:54:29
问题 I have the following lines to annotate TeX on my matplotlib plot: import matplotlib.pyplot as plt from matplotlib import rc rc('text', usetex=True) rc('font', family='serif') r = 1 v = 2 i = 3 notes = r"\noindent$R_L = {0}\\ V_2 = {1}\\ I_2 = {2}$".format(r, v, i) plt.annotate(notes, xy=(5,5), xytext=(7,7)) plt.show() How do I make the equals signs align to each other? I experimented with several methods like \begin{align} , & -placement, but I don't quite get it right. 回答1: Use eqnarray . A

How can I format a float using matplotlib's LaTeX formatter?

荒凉一梦 提交于 2019-11-28 08:05:24
问题 I have a number in my python script that I want to use as part of the title of a plot in matplotlib. Is there a function that converts a float to a formatted TeX string? Basically, str(myFloat) returns 3.5e+20 but I want $3.5 \times 10^{20}$ or at least for matplotlib to format the float like the second string would be formatted. I'm also stuck using python 2.4, so code that runs in old versions is especially appreciated. 回答1: You can do something like: ax.set_title( "${0} \\times 10^{{{1}}}$

Disabling underscore-to-subscript in Emacs Org-Mode export

强颜欢笑 提交于 2019-11-27 19:49:56
问题 When I export to PDF via org-mode (C-c C-e d), any words with underscores end up being partially converted to subscript. How can I prevent this from happening? I found this article on the subject: Disabling Underscore subscript in Emacs Tex Mode However, I either wasn't able to figure out the correct elisp or it simply didn't work. Note, I don't want to change any global font options. I only want this fix to apply to tex/latex/org-mode. I also found this post, though it didn't work either:

How to create a timeline with LaTeX?

家住魔仙堡 提交于 2019-11-27 09:04:53
问题 In history-books you often have timeline, where events and periods are marked on a line in the correct relative distance to each other. How is it possible to create something similar in LaTeX? 回答1: The tikz package seems to have what you want. \documentclass{article} \usepackage{tikz} \usetikzlibrary{snakes} \begin{document} \begin{tikzpicture}[snake=zigzag, line before snake = 5mm, line after snake = 5mm] % draw horizontal line \draw (0,0) -- (2,0); \draw[snake] (2,0) -- (4,0); \draw (4,0) -

use format with tex fraction expression in matplotlib python

一曲冷凌霜 提交于 2019-11-27 05:41:34
I use matplotlib. I need to get xlabels like: [1/8,2/8,3/8,4/8..14/8]. I want to make it in a loop. Therefore, for better view I use TEX in Python. For rendering the fraction expression in the loop I use .format method. But it doesn't work properly. There is some conflict between using of {} in TEX and .format method. I tried to use double {} but it as well doesn't work. import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) xax = ax.xaxis # get x axis labels = ['0'] for i in range(0, 14): labels.append(r'$\frac{}{8}$'.format(i)) # when trying to insert i an error occurs