FAQ Database Discussion Community

## printing inline latex equations from variable in R, trouble with \beta

r,latex,rmarkdown
I'd like to store a string of inline latex math in an r object, then output this string so that when rmarkdown is knitted, a latex equation is output in pdf. I have an error when I include "\beta" in the string. Here's the example: --- title: "Untitled" author: "Tedward"...

## How do I convert markdown equations to pdf using pandoc

pdf,latex,markdown,pandoc
I have a markdown document with lots of equations (mathjax I think) which renders fine with the application Marked 2. When I try to convert it to pdf with pandoc to create the bibliography, I get an error. For example, with \\[ \mu_{s,h,d,y} = \left\{ \begin{array}{1 1} \omega_{s,h,d,y} + \delta_{s}(t_{s,h,d-1,y}...

## Extract average model from MuMIn for latex output

r,latex,stargazer,texreg
I'm trying to extract two different averaged models from MuMIn for output to latex via texreg or stargazer. I'd like to have one table where I can compare two species' response to different sets of abiotic variables, that looks the same as one created from two model objects using glmtable...

## how to re-order polynomial term factors from sage output

format,latex,sage
I have x,y, dx, dy= var("x, y, dx, dy"); def iD(f): return diff(f, x)*dx + diff(f,y)*dy; iD(x^3*y^5) returns 5*dy*x^3*y^4 + 3*dx*x^2*y^5 is there a way to have it return the differentials always at the end as in 5*x^3*y^4*dy + 3*x^2*y^5*dx thank you...

## Problems cross referencing in LaTex with knitr and xtable

r,latex,knitr,xtable,cross-reference
I am currently working with R Studio to produce PDF documents with R/knitr in LaTex. Within these documents I want to present part of my results in tables that I want to refer to in the text. I produce these tables using the xtable package within R and it is...

## latex equation display in vim

vim,latex
I recently use the vim to write the latex source. But I got a very strange problem. When I open a old .tex file with vim, the equation will not show as usual. For example, when I type $K$, it just display K unless I move cursor to the line...

## could not start the command pdflatex - synctex=1 -interaction=nonstopmode %.tex error

latex,pdflatex,texmaker
I'm very new to LaTeX and its distributions so this might be a very newbie question. I was following this tutorial and I'm not being able to compile the document. The code so far is very simple i don't think there are any typos and also I did not find...

## Creating template on vim-latex suite (Ubuntu)

templates,ubuntu,vim,latex
I have asked a same question on tex stack overflow, but I had no responses for two days, so I will post it here instead (it is more of a technical problem than tex problem). I will delete the question on tex overflow in two hours. http://tex.stackexchange.com/questions/230881/creating-templates-on-vim-latex-suit-template Here are the...

## Error in applying a for loop to an xtable in knitr

r,latex,knitr,xtable
I'm preparing a pdf using knitr that contains a table produced using xtable. I'm adding a bold typeface to certain cells in the table so I've written the following function: bold <- function(x, matrix){ x[] <- lapply(x, as.character) for (i in 1:ncol(x)) { yes <- matrix[,i] x[yes,i] <- paste('\\textbf{', x[yes,i],...

## RStudio internal PDF viewer

latex,rstudio
Over RStudio documentation, it mentions an internal PDF viewer (using PDF.js): https://support.rstudio.com/hc/en-us/articles/200552066-PDF-Preview-and-SyncTeX I have no such option. Only "Evince" or "No Preview". Using Ubuntu / RStudio 0.98.1102. How do I activate the internal viewer?...

## LaTeX Equations Not Rendered on Webpage

r,latex,markdown,knitr
When I go to a webpage, such as this page of examples, none of the LaTeX code is being rendered in any of the browsers I try. However, on the same computer, if I create a simple R Markdown file in RStudio and I click Knit HTML, the preview in...

## Typesetting Math using MathJax for IPython Notebook Web page

html,latex,ipython-notebook,mathjax
I chose to learn to write mathematical expressions in IPython Notebook and sat to explore learning resources. I found this official link. I reproduced the whole tutorial on my IPython NoteBook locally and then published it on my website. I also explained the whole struggle I went into while trying...

## How to avoid the “too deeply nested” error when creating PDFs with Sphinx?

python,documentation,pdf-generation,latex,python-sphinx
I have a fairly complex project with a fairly large documentation. Converting the normal user guide to PDF with Sphinx via make latexpdf works quite well. However, if I also want to include the library reference with all function, class, and module documentations, the command fails with: ! LaTeX Error:...

## Latex: too much space after first line in table in beamer class

image,table,latex,tabular,beamer
I'm working in Latex beamer class and have a table environment in there. For some reason the space between the 1st and the 2nd line is huge and I have no idea where that comes from. Here's my code: \documentclass{beamer} \usepackage{beamerthemeshadow} \usepackage{longtable} \usepackage[ngerman, english]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \setbeamertemplate{caption}{\insertcaption} \setbeamertemplate{caption label separator}{}...

## split an equation with multicols on

compiler-errors,latex,equation,multicol
I would like to split my large equation in two column. But my file fails to compile when I try to use \{amsmath} and then split, multline, etc... The error says: Package amsmath Error: \begin{multline} allowed only in paragraph mode. \begin{multline} Does someone knows how to split a large equation...

## How can I use values and charts in a knitr / LaTeX document before R has calculated them?

r,latex,knitr
A knitr document contains sections of R and LaTeX. My boss wants to read the summary (in LaTeX), but doesn't want to read the R. However the R should be available in an appendix, so the code can be checked if needs be (see below). How to I make values...

## How do I alias command mathbb?

latex
I would like to alias \mathbb as simply \bb. How do I define this new command? I know how to alias mathsymbols such as: \def\AND{\wedge} But I am not so sure about math commands that take parameters....

## vertical line between latex minipages

latex,markup
right now I have a latex section that looks like \begin{minipage}{0.35\textwidth} %left column ... \end{minipage} \hfill \begin{minipage}{0.55\textwidth} %right column ... \end{minipage} This makes a nice looking two column layout, but I would like to add a vertical bar between the two minipages (where I currently have \hfill). What is the...

## Knitr preamble error results in “pandoc document conversion failed with error 43”

r,latex,knitr,rmarkdown,tex
Rstudio Version 0.99.441; Windows 7 enterprise; knitr 1.10.5; MiKTex 0.4.5 r.1280 (2.9 64-bit) I have a an error on my office computer when trying to knit PDF's in Rstudio, there are no problems knitting to HTML or word. The problem may be related to updates because knitting used to work...

## How to Parse LaTex file

python,regex,parsing,python-3.x,latex
I just finished to write the summary for calculus in Latex. The main problem now is that the files contains many things I don't really need now. The .tex files contains many definitions and theorems that i need to study by heart. The definitions have their own definition in the...

## How to search and replace from the last match of a until b?

regex,vim,latex
I have a latex file in which I want to get rid of the last \\ before a \end{quoting}. The section of the file I'm working on looks similar to this: \myverse{some text \\ some more text \\}% % \myverse{again some text \\ this is my last line \\}% \footnote{possibly...

## How do I add a note or text in addition to the caption to a knitr figure for latex output?

r,latex,knitr
I am using knitr to write my thesis and compiling it as a latex document. I have successfully included figures with the appropriately labeled caption; however, in addition to the caption I would like to include additional lines of text directly below the caption and associated with the figure. For...

latex,xelatex
I'm trying to compile this document (Plasmati Graduate CV) I got with xelatex and it complains about not finding q.sty. For all the other missing files I could just Google or search in the Synaptic Package Manager but I guess with the short filename it's hard to find. Anybody know...

## What does this required empty parameter mean, when defining something?

latex
\newenvironment{nameOfEnvironment}[1][]% Can someone explain the empty bracket?...

## Converting Tex string in Tex number

string,numbers,latex,tex

## Greek symbols in labels for bar chart in MATLAB

matlab,latex,bar-chart,matlab-figure
I would like to use greek symbols in the ylabels for my barh() chart. I tried the following but it didn't really work: tplot = barh(mdata, 'BarWidth', 0.3); set(gca,'xgrid','on') lbl = {'$\hat{\sigma}_1$', '$\hat{\sigma}_2$', '$\hat{\sigma}_3$'}; box off set(gca,'yticklabel',lbl) h=findobj(gca,'type','text'); set(h,'Interpreter','latex') I also tried: set(gca,'TicklLabelInterpreter', 'tex') When I do get(gca), the property...

## Error: missing \begin{document} in LaTeX [closed]

latex
I have error in my LaTeX document, when run my file, have a error ! LaTeX Error: Missing \begin{document}. and this tag \begin{document} exists in my code \documentclass[12pt‎, ‎a4paper]{article}‎ \usepackage{graphicx} % inserting images \usepackage[top=3cm,right=3cm,bottom=2.5cm,left=2.5cm]{geometry} \usepackage[colorlinks,linkcolor=blue,citecolor=red]{hyperref} \usepackage{multirow} \usepackage{subfig} \usepackage{algorithm} \usepackage{algorithmic} %\usepackage[utf8]{inputenc} %\usepackage{color, pdfcolmk} %\usepackage{sweave} %...

## Matlab - How to generate LaTeX out of a transfer function?

matlab,latex
I have a transfer function as: TF = 0.00995 z^7 - 0.02786 z^6 + 0.03611 z^5 - 0.0293 z^4 + 0.01565 z^3 - 0.005669 z^2 + 0.001274 z - 0.0001554 ---------------------------------------------------------------------------------------------------------- z^8 - 2.4 z^7 + 3.16 z^6 - 2.664 z^5 + 1.585 z^4 - 0.666 z^3 + 0.1975 z^2...

## I want to use figures as [item] in latex

latex,tex
In latex, I can use itemize and \item as follows. \begin{itemize} \item ... \end{itemize} I also can write as follows. \begin{itemize} \item[(any strings)] ... \end{itemize} However I can't write as follows. \begin{itemize} \item[\includegraphics{imagename}] ... \end{itemize} I want to use figures as \item of itemize in latex. Any ideas?...

## Concatenation of Matlab strings

matlab,latex,string-concatenation
I want to make a Matlab function that takes two matrices A and B (of the same size) and combines them in a certain way to give an output that can be used in Latex - table. I want the first row of the output matrix to consist of the...

## How can I output this table with indexes in latex?

latex
How can I outputthis table exactly like that in LaTeX? I'm using the latest versions of WindEdt and LaTeX. Thank you....

## PDF page number clashes with LaTeX page number when included

r,pdf,latex
Another day, another question! I have created a documentation of an R package using R CMD Rd2pdf workdir/. The documentation is done in roxygen2 comments. I now wanted to include this pdf into my LaTeX script, which I have managed as follows: \usepackage{pdfpages} \includepdf[pages=-,pagecommand={\thispagestyle{plain}}]{docu.pdf} which means that I included all...

## adding author emails and affiliation on 2nd second line not as a footnote [closed]

latex
Latex code that i have executed, insert emails as a footnote which i want to insert under the author name or on the same line with affiliation. i have insert an image of the required format as well. \documentclass[a4,12pt,twosided,reqno]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{authblk} \title{More than one Author with different Affiliations} \author[1]{Sadique...

## Add sections to beamer presentation using rmarkdown and knitr

r,latex,markdown,knitr,rmarkdown
I am trying to add section slides to a beamer presentation written in rmarkdown using the latex command \section{}. However, it gets inserted between a \begin{frame} & \end{frame} automatically during the conversion, which causes the compilation to fail. Is there any way to stop this happening so that the section...

## How to use Phonetic Symbols in LaTex

latex
How to use inverted A character(Phonetic Symbol) in an equation in LaTex? Do I have to use any specific package for it? I used \textinvsca, but it says "undefined control sequence"

## ValueError in matplotlib when using \: LaTeX horizontal spacing

python,matplotlib,latex
See MWE below: import matplotlib.pyplot as plt import matplotlib.offsetbox as offsetbox fig = plt.figure() ax = fig.add_subplot(111) text1 = r'$a\,=\,{}\pm{}$'.format(0.01, 0.002) # Works. text2 = r'$a\;=\,{}\pm{}$'.format(0.01, 0.002) # Works. text3 = r'$a\:=\,{}\pm{}$'.format(0.01, 0.002) # Does not work. text = text3 ob = offsetbox.AnchoredText(text, pad=1, loc=6, prop=dict(size=13)) ob.patch.set(alpha=0.85) ax.add_artist(ob) plt.show() While...

## Subscript and superscript alignment using only HTML markup

html,latex,html4
The following picture can be easily produced using a latex rendering software: In particular superscript and subscript parts are one over the other. Is it possibile getting the same result using only HTML 4 syntax by some clever use of <sup> and <sub> tags, without use of CSS or MathML?...

## statsmodels summary to latex

python,latex,statsmodels
I'm a newbie to latex and I want to import a statsmodels(python-package) summary to my report in latex. I found that it's possible to transform a summary into a latex tabular with the following method: latex_as_tabular. Until now everything is working. Now I have to store the tabular, but I...

latex,mathquill

## Can I make git merge always conflict on file changes?

git,version-control,latex,git-merge
I am hoping I have a simple question for you, but I can't find an answer anywhere (I have been searching for 2 days, maybe I am dumb?). I am trying to develop a git workflow to collaboratively edit LaTeX files with my PhD adviser. The problem we face is...

## In Emacs: how to reference latex equation in text by its number .dvi?

emacs,latex,equation
Suppose, I use Emacs to write a function in latex: $$\label{eq:myeq} x=2y$$ that gives me x = 2y (1) in a resulting .dvi. And suppose I have dozens of such equations. Here is the problem: if I have to reference this equation but don't remember its name I...

## improper matrix print out latex

matrix,printing,latex

## how to use cleveref package to get Fig. in latex

latex
When I use the cleveref package in latex, if I use \cref{fig1}, I got fig. 1 and if I use \Cref{fig1} I got Figure 1. But what I really want is Fig. 1. How can I do that?

## pyreport LaTeX formulae not working

python,ubuntu,latex,pyreport
I'm trying to create a HTML report using pyreport and it works up to the single point, that the LaTeX formulae are not generated. Here is the input file I use for testing: #$This is \LaTeX :$c = 2\cdot(a+b)\$ Than I run pyreport -l -t html --verbose file.py,...

## Using Vim + latex-suite + knitr

r,vim,latex,knitr
(summary at the bottom) I have set up Vim and R using the Vim-R-plugin and it works flawless. I also use the Latex-suite in Vim and can create, compile and view .tex files without any problem. For knitr, I used to use Rstudio but I would really like to stay...

## Using sympy's latex() function without calculating the input

math,python-3.x,latex,sympy
I want to get latex output from a sympy expression without calculating the expression. For instance if I do latex((2+3)/7) the output would be 5/7 (with latex), but what I am after is for it to just output (2+3)/7 with latex. Like this: \frac{2+3}{7}

## How to count Tabular

latex,pdflatex
for some reason i need to make many tables with latex, and non of them should have caption nor labels, but they need to be numbered like Subsection.tableNo. I have tried to use \begin{tabular}{ccc} ...& ... & No.: \arabic{subsection}.\arabic{table}\\\hline ..... \end{tabular} however, because i'm using only tabular environment, the table...

## I can't find the format file pdflatex.fmt'!

php,latex,fedora,pdflatex,php-5.2
I want to run pdflatex from php on user request. Running from terminal works fine [php file.php] and creates pdf file. But when I try to run from browser by sending request to php, It gives this error "I can't find the format file `pdflatex.fmt'!" I am working with php5.2.6,...

## Arrange lua/lualatex data in a Latex/tex tabular

lua,latex,tex,tabular
I have data in lua, accessible to a LaTeX/TeX document (it is an array). I try to show this data in a LaTeX tabular form. I tried several ways to do this but all failed :( . Here is an example : \begin{tabular}{|c|c|c|}\hline A&B&C\\ \hline 2010 & 2,78 &\\ \hline...

## Change LaTeX when button is pressed

javascript,html,latex
I am trying to create a program that generates random functions then shows them in LaTeX but I can't figure out how to edit LaTeX when a button is pressed. This code works: <html> <head> <script type="text/javascript" src="http://latex.codecogs.com/latexit.js"></script> </head> <body> <div lang="latex" id='Latexdiv'></div> <script> document.getElementById('Latexdiv').innerHTML = 'sin(x)'; </script> </body> </html>...

## os.path.getsize Invalid syntax error

python,latex
First thing first, code is list below, import sys import os import latexmake import mysql.connector conn = mysql.connector.connect(user='root',password='oilwell',host='localhost',database='sqlpush1') with conn: mycursor = conn.cursor() mycursor=execute("SELECT DATE,oil,gas,oilprice,gasprice,totrev FROM results WHERE DATE BETWEEN '2011-01-01' AND '2027-12-01'") rows = mycursor.fetchall() a.write("\\documentclass{standalone}\\usepackage{booktabs}\n\n\\usepackage{siunitx}\r \n\ \r\n\\begin{document}\r\n\\begin{tabular}{ccS[table-format...