latex

Indenting disturbed when adding superscript to rowname of a grouped row using kable in latex

房东的猫 提交于 2021-02-10 15:05:11
问题 How do I add superscript to name of a particular row of a table created using kable in latex environment (this link gives solution for markdown). I tried following: at2=cbind(1:5,6:10,11:15) rownames(at2)=c("one", "two", "three", "four$^1$", "five") kable(at2,format = "latex",booktabs=T) But this isn't working. For image of result click this EDIT: The first problem is solved with escape = FALSE but now a new problem related to indentation has come up. I am using group_rows which automatically

Plotly + Julia + Latex

六眼飞鱼酱① 提交于 2021-02-10 05:09:27
问题 I would like to use latex with the Plotly backend. Look in this example: Even the x-axis and y-axis log scales are not formatted properly! Do you know how to do that? Best, v. using Plots, LaTeXStrings plotlyjs() x = 10 .^ LinRange(-5,5,10) plot(x, 1 ./ x, yaxis=:log, xaxis=:log, m = 2, xlabel="x", label="1/x",ylabel="f(x)") plot!(x, 10 ./ x, m=2,label="10/x") plot!(x, 1 ./ (x.^2), m=2, label=L"f(x)=$1/x^2$") savefig("./test.png") 回答1: Seems to work with the gr() backend, so I expect

Format a LaTeX math string in Python 3

亡梦爱人 提交于 2021-02-08 17:12:15
问题 I see it is possible to use the format method on a LaTeX string in python by using a double curly bracket as shown here. For instance: In[1]: 'f_{{{0}}}'.format('in') Out[1]: 'f_{in}' But how can I use the format method in a math LaTeX string? (particularly for subscripts) For example, with: In[2]: r'$f_{in,{{0}}}$'.format('a') I would expect: Out[2]: '$f_{in,a}$' But I get a ValueError: unexpected '{' in field name 回答1: The correct statement for In[2] should be: r'$f_{{in,{0}}}$'.format('a')

Format a LaTeX math string in Python 3

无人久伴 提交于 2021-02-08 17:10:20
问题 I see it is possible to use the format method on a LaTeX string in python by using a double curly bracket as shown here. For instance: In[1]: 'f_{{{0}}}'.format('in') Out[1]: 'f_{in}' But how can I use the format method in a math LaTeX string? (particularly for subscripts) For example, with: In[2]: r'$f_{in,{{0}}}$'.format('a') I would expect: Out[2]: '$f_{in,a}$' But I get a ValueError: unexpected '{' in field name 回答1: The correct statement for In[2] should be: r'$f_{{in,{0}}}$'.format('a')

Format a LaTeX math string in Python 3

妖精的绣舞 提交于 2021-02-08 17:00:53
问题 I see it is possible to use the format method on a LaTeX string in python by using a double curly bracket as shown here. For instance: In[1]: 'f_{{{0}}}'.format('in') Out[1]: 'f_{in}' But how can I use the format method in a math LaTeX string? (particularly for subscripts) For example, with: In[2]: r'$f_{in,{{0}}}$'.format('a') I would expect: Out[2]: '$f_{in,a}$' But I get a ValueError: unexpected '{' in field name 回答1: The correct statement for In[2] should be: r'$f_{{in,{0}}}$'.format('a')

Add two commands to the add.to.row arguments in xtable

别等时光非礼了梦想. 提交于 2021-02-08 16:56:56
问题 I have used the two answers below to add colors to alternating rows in xtable or to add a footer to a long table, but I need to figure out how to do both. (1) How to only show table caption once in "list of table" for a table split onto multiple pages and (2) R, knitr, xtable, alternating row colors Is there a way to use both at the same time? 回答1: From the answers you listed it seems you used LaTeX as output. You can combine two or more add.to.row command by assigning a position to each

Add two commands to the add.to.row arguments in xtable

╄→尐↘猪︶ㄣ 提交于 2021-02-08 16:56:10
问题 I have used the two answers below to add colors to alternating rows in xtable or to add a footer to a long table, but I need to figure out how to do both. (1) How to only show table caption once in "list of table" for a table split onto multiple pages and (2) R, knitr, xtable, alternating row colors Is there a way to use both at the same time? 回答1: From the answers you listed it seems you used LaTeX as output. You can combine two or more add.to.row command by assigning a position to each

Preventing a multiplication expression evaluating in Sympy

我是研究僧i 提交于 2021-02-08 15:07:51
问题 I am generating an expression with two fractions, and want to pretty print as a whole expression with LaTeX, to then put on a worksheet. E.g. in the form: (5/7) * (3/4). However, when I do the following: fract1 = sympy.sympify(Fraction(5,7)) fract2 = sympy.sympify(Fraction(3,4)) expression = sympy.Mul(fract1,fract2,evaluate=False) It returns 5*3/(7*4) Clearly it is combining the fraction but not actually evaluating, but I want to be able to produce it in a format suitable as a question for a

Latex \phantom not creating whitespace in matplotlib

我们两清 提交于 2021-02-08 10:44:20
问题 Friends, I have 71 ticks that I need to put on a plot (it's the sequence of a protein) and so the ticks need to be staggered, and some are highlighted with asterisks: ________________________________ P o A i I A o g e u n e f e t r l t x s s L n S q e c O L t e s * * * ** * * * I'm using matplotlib.rc('text', usetex=True) so that I can move the asterisks up (they appear too far down on the axis unless I decrease their \vspace ) The problem is that the staggering doesn't work, any attempts to

Displaying mathematical formulas in markdown without external CDN?

北慕城南 提交于 2021-02-08 09:56:56
问题 Background We are merging documentation written in LaTeX and MS Word towards markdown (for the well-known advantages). We have a static intranet site creating mkdocs . My predecessors decided for MathJax , but this stopped working at the moment MathJax CDN was shut down, but the customer only realized that with some delay. In the meantime, the intranet is now totally disconnected from the outside world by our customer (whose formulas should stay behind the fence). Using a different MathJax