FAQ Database Discussion Community

## Converting Tex string in Tex number

string,numbers,latex,tex

## 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...

## texvc does not render latex math in Mediawiki

latex,mediawiki,mediawiki-extensions
I have the Math extension installed in my MediaWiki 1.19. After I updated Ubuntu Server from 12.04 to 14.04 something seems to have messed it up and it has stopped working. Basically I get the following error when I try to display anything between the $and$ tags: Failed...

## improper matrix print out latex

matrix,printing,latex

vim,latex

## 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...

## How to install the IOP (Institute of Physics) Latex document class for Texlive and the Lyx Document Processor (Answer Provided)

latex,document,physics,lyx,latex-environment
Background I originally asked a question on Stackoverflow, asking how I add the IOP document class to the list of available document classes in Lyx. (I will try to remove or merge that out dated quesiton.) I now understand that this is a 2-stage process. Stage 1 is to install...

## 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...

## Convert Mathematica equations into R code

r,latex,wolfram-mathematica,mathml
Is there an easy way to convert Mathematica equations into R code? I have several equations that consist of dozens of terms with subscripts, superscripts, and greek letters. For example, here's a small part of one equation in Latex format: m_2_2= 48 b_1 c_2^2 d_1 \rho ^4+48 b_2 c_1^2 d_2...

## 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}...

## 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...

## 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...

## 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...

## Generate TeX/LaTeX file and compile both in Python

python,latex,tex,pdflatex
I am preparing a data processing code and the results from these are to be fed to a TeX/LaTeX file and the file is to be compiled by Python (i.e. Python should send the command to compile the TeX/LaTeX file) At present I plan to generate a text file (with...

formatting,latex

## Add beamer frame options in knitr/rmarkdown

r,latex,knitr,rmarkdown,beamer
I'm trying to add frame numbers to my Beamer presentation written in rmarkdown. However, I would like to suppress the numbers on the title page using the \begin{frame}[plain] option (from the second answer here: http://tex.stackexchange.com/questions/82794/removing-page-number-from-title-frame-without-changing-the-theme). However, when compiling from rmarkdown to tex, the \titlepage already creates a frame environment, so...

## Double headings in latex

latex
I have a problem with latex. I want to create a heading with a special name and aumomatic numbering of the chapters. I use the \chapter{Introduction} command to create the chapter named Introduction. In the Content it is listed as "1 Introduction" which is right. In the text I get...

## (datatool in LaTeX)DTLforeach: Can't assign XXX there is no keys in XXX?

latex
i am a beginner for LaTeX, and currently trying to create tables from text files(just for some reason the data was generated from an other program and written in a .txt file) And here is one of the text file:(just integrated it into latex) \begin{filecontents*}{d11.csv} Zeit/s AMES\_13 AMES\_14 AMES\_15 AMES\_16...

## 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],...

## Preserve line breaks in title using pandoc

latex,markdown,pandoc
Consider the following title block in pandoc-flavored Markdown: % Higgelty Pigglety Pop! or There Must Be More to Life % Maurice Sendak Here, line breaks are part of the title. It is possible to reformat the title in order to insert it into regular text flow, e.g. "Higgelty Pigglety Pop!...

## 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...

## 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} %...

## 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...

## 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}

## 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...

## 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...

## 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...

## How to Create AIC Model Selection Table in R in LaTex format?

r,table,model,latex,lm
Folks, Looking to create an AIC selection table for a publication in LaTex format, but I can not seem to get the form I want. I have googled this to death and was VERY surprised I couldn't find an answer. I've found answers to much more obscure questions in R....

latex,mathquill

## kable() in knit pdf appears oversized

r,table,pdf,latex,knitr
I am using the kable() function to output a table in a Rmd knit pdf document. I am however experiencing an issue with it. When I knit pdf, the table that it's outputting is oversized by width and ends-up being cropped. Please see below a mock code to run in...