latex

Modifying revtex4 for title, author name and abstract

天涯浪子 提交于 2019-12-11 17:50:24
问题 I am wondering how to modify revtex4 similar to mnras document class. In two column revtex4 the name of author , title and the abstract are placed in center. I would like to do this: title to be started from the left (not center) author name and affiliations to be started from the left (not center) abstract to be started from the right with customizing its width. Is it possible in revtex4 ? now I have \title{Observational model and test test test} \author{Yong Ma\footnote{yong.macos@gmail.com

Annotate a plot made with ggplot2 with an equation using latex2exp::TeX

大兔子大兔子 提交于 2019-12-11 17:32:14
问题 My goal is to annotate a plot made with ggplot2 by placing an equation in white space within the plot using the package latex2exp For example, given the equation: eqn <- "$\\textbf{Volume}(ml) = 0.035 \\cdot \\textbf{CSA}(mm^2) + 0.127 \\cdot \\textbf{age}(months) - 7.8$" Running the following code in R 3.5: library(ggplot2) library(latex2exp) ggplot(mpg, aes(x = displ, y = hwy)) + geom_point() + annotate("text", x = 4, y = 40, label=TeX(eqn), hjust=0, size = 5) My example code fails with the

LaTeX is not able to process the string in python

浪尽此生 提交于 2019-12-11 16:34:05
问题 Trying to graph a weibull distribution in python3 using the code available at (http://www.astroml.org/book_figures/chapter3/fig_weibull_distribution.html) # Author: Jake VanderPlas # License: BSD # The figure produced by this code is published in the textbook # "Statistics, Data Mining, and Machine Learning in Astronomy" (2013) # For more information, see http://astroML.github.com # To report a bug or issue, use the following forum: # https://groups.google.com/forum/#!forum/astroml-general

Invalid characters in generated latex sources

帅比萌擦擦* 提交于 2019-12-11 15:13:27
问题 I'm running doxygen (1.5.8) on a C# project off of Visual Studio 2008 on a Windows machine running XP. While generating the latex code, some illegal sequences are included. It always involves the following sequence: "" (a latin-I with a dieresis, something like the binary shift operator, and a Spanish open-question-mark). I've seen it happen in the context "using {\bf System}", but maybe there are others. The generated latex file reads \begin{CompactItemize} \item using {\bf System}

Latex command substitution using regexp in python

房东的猫 提交于 2019-12-11 15:06:23
问题 I wrote a very ugly script in order to parse some rows of latex in python and doing string substitution. I'm here because I'm want to write something to be proud of, and learn :P More specifically, I'd like to change: \ket{(.*)} into |(.*)\rangle \bra{(.*)} into \langle(*)| To this end, I wrote a very very ugly script. The intended use is to do a thing like this: cat file.tex | python script.py > new_file.tex So what I did is the following. It's working, but is not nice at all and I'm

Error saving matplotlib figures to pdf: 'str' object has no attribute 'decode'

纵然是瞬间 提交于 2019-12-11 13:29:43
问题 I have the following script to generate a figure with matplotlib: # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import numpy as np import math from matplotlib import rc rc('font',**{'family':'serif'}) rc('text', usetex=True) rc('text.latex',unicode=True) rc('text.latex',preamble=r'\usepackage[utf8]{inputenc}') rc('text.latex',preamble=r'\usepackage[russian]{babel}') def figsize(wcm,hcm): plt.figure(figsize=(wcm/2.54,hcm/2.54)) figsize(13,9) x = np.linspace(0,2*math.pi,100) y = np

Building Latex/Tex arguments in lua

安稳与你 提交于 2019-12-11 13:16:20
问题 I use lua to make some complex job to prepare arguments for macros in Tex/LaTex. Part I Here is a stupid minimal example : \newcommand{\test}{\luaexec{tex.print("11,12")}}% aim to create 11,12 \def\compare#1,#2.{\ifthenelse{#1<#2}{less}{more}} \string\compare11,12. : \compare11,12.\\ %answer is less \string\test : \test\\ % answer is 11,12 \string\compare : \compare\test. % generate an error The last line creates an error. Obviously, Tex did not detect the "," included in \test. How can I do

MathJax left align on render

爷,独闯天下 提交于 2019-12-11 12:52:41
问题 How do I left-align all MathJax equation "on-render" . When you set displayAlign: "left" , the equations would first be centered, then after 0.5s, they move to the left. So basically, it flashes to the left, which is visually unpleasant. Is there a way to make it appear on the left on render? This is the code I have now. <script type="text/x-mathjax-config"> MathJax.Hub.Config({ config: ["MMLorHTML.js"], jax: ["input/TeX","input/MathML","input/AsciiMath","output/HTML-CSS","output/NativeMML",

Viewing LaTeX Output in Emacs

假如想象 提交于 2019-12-11 12:49:57
问题 I am trying to view the output of a LaTeX file in Emacs. I am following this guide: http://www.r-bloggers.com/using-doc-view-with-auto-revert-to-view-latex-pdf-output-in-emacs/ I have done everything they said, but when I run C-c C-c and open the pdf in the other Emacs window, I get nonsense. Preferably, I want the pdf to immediately show in the other window when I run C-c C-c --I do a lot of live texing, and I need to periodically view the output. Please note that I am running Emacs from the

hmisc::latex tables open in external xdvik window instead of being inserted into the pdf output document

纵饮孤独 提交于 2019-12-11 12:46:46
问题 Since our update to R2.15.1, the tables in my lyx documents that result from calls to the latex function (package Hmisc) open in an external xdvik-window instead of being inserted in the pdf-document that I am compiling. On the contrary, the tables produced with xtable and the graphs produced with ggplot do appear where they belong in the document. The chunk header for the latex call is <<Specs,tidy=F,results='asis',eval=F>>= and the chunk is then referred to multiple times with e.g. <