# Questions tagged [latex]

4148 questions

1

1.6k

Views

### Right margin in table cells aligned to the right in Latex

I have the following table in Latex Created with this code: \begin{table}[h] \caption{aaaa} \label{tab:treatments} \centering \scalebox{0.8}{ \begin{tabular}{l c c c} \toprule \tabhead{Por 1} & \tabhead{Por 3} & \tabhead{Quantificazione log-dim} & \tabhead{cintin\'a} \\ \midrule A & M & 99.3\%& 5....
Mauro Gentile

2

35

Views

### How can I have LaTeX print citations inside of parentheses?

I have a problem with reference style in LaTeX. I use: \usepackage[backend=bibtex,style=authoryear]{biblatex} % But when I look at the references, the text is not inside parentheses. For example: ,reviewed in Roy et al. 2010 should be ,reviewed in (Roy et al. 2010)
user2806363

1

46

Views

### Change size of figure in MATLAB to use them in LaTeX

I have generated several plots in MATLAB and I haven't set the ( width or height) to any of them. I save them as pdf to place them in LaTeX but each figure appear with different size. I can change each figure size in LaTeX but I wonder if there is an easy way in MATLAB to get same size for all figur...

2

9.5k

Views

### Horizontal and vertical alignment int tabular cell

Most indications I've seen so far seem to indicate that m is used to center cell contents vertically, but it's not working for me. Here's what I have \begin{table}[htb] \centering \sffamily \begin{tabularx}{1.0\textwidth}{ m{3cm} p{5.5cm} p{5.5cm} } \hline & \textbf{Helpful} & \textbf{Harmful} \hfi...
André Fratelli

0

5

Views

### Message “you must have pygmentize installed to use this package” while Pygments is already installed

I'm try to use the minted package in latex to display code in latex document. From Texstudio, I get an error message 'you must have pygmentize installed to use this package'. However, if I type pip3 install pygments I get Requirement already satisfied: pygments in /usr/local/lib/python3.7/site-packa...
ecjb

1

849

Views

### rmarkdown & kable/kableextra: Printing % symbol in Table when using escape = F

I want to create a table in a pdf-document using rmarkdwon and kable. In the header there has to be a linebreak, so to do so i need to set escape = F. The table itself contains percent-values as strings including the % symbol (for example: '13%'). I found here https://tex.stackexchange.com/questi...
TinglTanglBob

2

143

Views

### Tabulate a combined matrix of coefficients / t-statistics and export in LaTeX

I have many regressions (one per year, over fifteen years) for four outcome variables. I have created two 15x4 matrices: one with the coefficients and one with the t-statistics. I am stuck now that I want to tabulate them in the classic way, each row having the coefficients for each model and under...
Fabio I.

3

133

Views

### Difficult workflow writing Latex book full of Python code

I'm writing a book on coding in python using Latex. I plan on having a lot of text with python code interspersed throughout, along with its output. What's really giving me trouble is when I need to go back and edit my python code, it's a huge pain to get it back nicely into my latest document. I've...

1

143

Views

### plot with ggplot in for-loop doesn´t compile to PDF

I created a report using knitR (.Rnw) to compile it as a PDF. As I would like to plot the same figure for every single questions I created a plot in a for-loop. Unfortunately I get a warning in the PDF and don´t realy get what causes the error... Here is the chunk where I believe the problem starts...
klamsi

1

275

Views

### How to write Jinja2 template for Jupyter nbconvert to show markdown and suppress output number?

I am trying to write a Jinja2 template to convert my Jupyter notebook to a PDF via LaTex using nbconvert. My current attempt does not show Markdown cells or image captions and also shows the following output above all of my matplotlib graphs: out[1]: I would like to display markdown cells and capti...
seanysull

0

94

Views

### How to convert latex/MathML expression into English language

I am looking for an API preferably in JAVA which can convert a MathML/ Latex expression into the English language. WIRIS is one option but I am looking for an open source implementation. Input MathML expression MathML -input:'14 Latex expression \frac14 Expected output: - 1 fourth
sandy

0

53

Views

### constants for LaTeX

I am working on a C# port of LaTeX, based on iosMath. One thing I can't figure out is where they get their constants from, that they use for spacing, italic corrections, etc. I'm hoping an iosMath author is on here and can help out? For example, see this plist file. All those constants had to come f...
William Jockusch

1

95

Views

### Define a function to latex italicize (or boldface) a word selection in Emacs

I use Emacs' org-mode to take notes in class, which I then export in latex. I found org-mode's default markers for bold and italic (* and / respectively) quite useful, but I had to stop using them to avoid confusing the org exporter. I would like to have a function to italicize a word selection. In...

0

180

Views

### complete authors details not showing up at title page in BMC latex templet

I am using BMC latex template. I use two author details in the template. However, the BMC template only shows up the details of correspondence. I want to show up Name, emails, addresses of both authors at the title page. Please help how to solve this issue.
Waseem Khan

0

168

Views

### Ampersand (&) breaks \ifdefined

I am working on a document that is used in a lecture each semester. The contents basically stay the same, but only a subset of the content is used each semester. Defines are used to set which parts should be compiled and which not. In one part of the document a list of the options is compiled in a t...
Merlin Denker

1

213

Views

### \imagegraphics doesn't interpret \ escape in filename

I'm trying to insert a background image with the beamer package using the following: \usebackgroundtemplate{% \includegraphics[width=\paperwidth,keepaspectratio]{/path/to_file/background.png}% } The problem I'm having is that my background file path has an underscore in it, as I put in the example a...
Eponymous

0

1.2k

Views

### Moving legend outside pgfplot and reformat x axis labels in tikz

I've made a schematic plot in tikz with the below code. \begin{tikzpicture} \pgfplotsset{ticks=none} \begin{axis}[ xlabel=$Treatment$, ylabel=$Level of donation$] \addplot[smooth,mark=*,blue] plot coordinates { (1,1) (2,1) (3,1) }; \addlegendentry{Pure Altruism} \addplot[smooth,color=red,mark=x] plo...
spar31415

1

110

Views

### Using python to process a LaTeX file and create random questions

I am using python to pre-process a LaTeX file before running it through the LaTeX compiler. I have a python script which reads a .def file. The .def file contains some python code at the top which helps to initialize problems with randomization. Below the python code I have LaTeX code for the proble...
gnat79

0

60

Views

### Latextools can't find added PATH when starting sublime from unity launcher

I have Ubuntu 16.04, sublime text 3 and sublime package latextools on my computer for Latex editing. I installed Latexlive and added the bin path to system PATH. When I started sublime with subl from the terminal and compile a .tex file with Ctrl+b using latextools, the compilation worked fine. But...
Zhang Yu

1

357

Views

### RMarkdown pdf document chunk output exceeds page margins

While I am knitting a document as a PDF using RMarkdown some code chunk outputs exceeds the page margins as seen on the pic. Any ideas to fix this?
Emre Toros

1

352

Views

I followed this manual in order to visualize my QISKit v0.4.8 quantum circuit by means of the latex_drawer() function (in newer versions of QISKit the function is circuit_drawer()). However, I got the following error when running the code: ! LaTeX Error: File `qcircuit.sty' not found. Is qcircuit.st...
Alexander Pozdneev

0

82

Views

### Latex listings package: How to define comments not by delimiters but by their position

I am using the listings package for LaTex to include GAMS-Code in my LaTex-file. The package does not support GAMS as a language. So I have to define the language like descriped in this article. In GAMS, after declaring a symbol there is place for an explanatory text. I want to make the listings pac...
Niclas von Caprivi

0

275

Views

### How to force position of figure with PyLaTeX ?

I'm using PyLaTeX to generate automatically a report file. This report is to be filled with matplotlib plots and I want them to be placed exactly where the code says so. Usually in Latex, I would use the [h] suffix or even [H], but here, no matter what I put in the position, it doesn't work (I mean...
Mounsif Mehdi

0

129

Views

### R Markdown: fancyhdr can't set head rule to 0 even after redefining the \headrulewidth command

I'm trying to make a quick thesis document/template, but the documents are not allowed to have a header line, just the page numbers. I can change what exists inside the header and footers (e.g. adding a page number at the top right hand of the page), but the rule won't go away. I tried multiple var...

0

212

Views

### Generate R package manual in .tex or .pdf - cut off lines

I created my first R package using roxygen2. I generated the manual with a .pdf extension using the code pack
shazz

1

92

Views

### pgfplots with gnuplot: Unexpected behaviour: Why?

While I used pgfplots with gnuplot successfully several times, I cannot find the cause of the following problem: I'm trying to plot the graph of a function which you can see here: f(x)=(36/25) + (336*x)/125 - (6*x^2)/5 + (24*x^3)/125 - (x^4)/100. When I plot the function with programs like GeoGebr...
Sigmar2030

1

167

Views

### bookdown chapter heading not correct

I am using the bookdown to write a book. I've defined the documentclass as book. Everything seems to be working correctly - the Table of Contents, List of Tables and List of Figures along with an Appendix, Bibliography and Index. However, in my index.Rmd file I lead off with a Preface section that i...
Melinda Higgins

1

77

Views

### How to format enumerated lists from latex to docx

I have several hundred Word documents to generate from latex sources, TEX to DOCX. Pandoc works just fine with one little glitch -- enumerated lists in LaTeX are rendered with Roman numerals in the DOCX output files. I can't seem to find any documentation that addresses this issue, and Word document...
ccc31807

0

282

Views

### jupyter notebook with unicode characters PDF converting problems

I was making a math class note with some unicode characters (Simplified Chinese, in my case) in it. And when I was trying to convert it into PDF file, it popped out 500 error. The error message reads: ... ************************************************* ('E:\Program Files (x86)\MiKTeX 2.9\tex\latex...
Pats Chen

0

634

Views

### Use vim shortcuts in TeXstudio

I'm using TeXstudio to edit my *.tex files. Is there any way to add vim shortcuts to TeXstudio?
HosseinBeheshti

0

88

Views

### Vim Latex Suite can't find latex command using Pathogen

Background I was having dual boot issues with Windows 10 and Ubuntu 17.10, which eventually resulted in a boot loop and since I need Ubuntu 16.04.3 for an Operating Systems class I decided to load up an ISO into one of my USBs with Rufus, reformat my Windows partitions from GPT to NTFS to get around...
jfh

0

264

Views

Stefan Musch

1

132

Views

### Windows Python Matplotlib Latex Flashing CMD windows

I've recently reinstalled python, Latex (via TexWorks), and Matplot Lib. (all on windows 10) and every time I plot a graph that uses Latex in some text, I get a huge number of console windows flashing open. This seems a like a bug, as even this code: import matplotlib.pyplot as plt plt.rc('text', us...
Ben Norman

1

41

Views

### Django: output textfile to be proceeded

i have a small django application that i use to manage my patients data ( i am a doctor with an intermediate level in python/django) I used LaTeX to output my reports via a view function like that def consultation_pdf(request, pk2, pk1): entry = Consultation.objects.get(pk=pk2) source = Patient.obje...

1

586

Views

### LaTeX remove subsection from TOC

I use the following code in LaTeX to set the level of contents in the table of contents: \setcounter{secnumdepth}{2}\newcommand{\restoretoc}\addtocontents{toc} {\protect\vspace*{2.5em}{\setcounter{tocdepth}{1}{\setcounter{secnumdepth}{2}}} The ouput is the following: The counter disappears but subsu...
Suraya Masrom

0

115

Views

### (R, xtable package) sanitize.text.function is not working

I want to include a data table from R in a LaTeX file. I am using xtableand the problem is that the function sanitize.text.function is not working properly. MWE: > a print.xtable(xtable(a), type = 'latex', sanitize.text.function = function(x){x}, file = '../R_out/prova.tex') \begin{table}[ht] \cent...
oibaFox

0

102

Views

### removing the date from a PDF-Latex output through IPython Notebook conversion

How can I remove the date from a PDF-Latex output through IPython Notebook conversion? I have tried removing so many packages in the Latex document but the date doesn't seem to be removed
Yousra

0

268

Views

### R-markdown latex font encoding failing

Edit: Problem solved. It turns out I had some missing packages, and rmarkdown doesn't give a very good error message for this. If anyone else has this problem, you have to use the 'keep_tex' option in the yaml. You can then see in the tex file all of the required tex packages. I'm on Windows 7. I ha...
nickasaurous