latex

How to insert an image into Anki notes in latex format?

你说的曾经没有我的故事 提交于 2019-12-04 15:28:57
I am trying to create an Anki deck with, for example, a word on the front. Then I add the word with definitions on the back with a picture as well. But I am having trouble including graphics when there are already two fields (front text and back text). Here is an example note: \begin{note} \begin{field} \textbf{\large ruminate} \end{field} \begin{field} \textbf{\large ruminate} \begin{description} \item[verb] \hfill \\ chew the cuds \item[verb] \hfill \\ reflect deeply on a subject \end{description} \end{field} \end{note} This note works just dandy, but when I try to include a graphic (as

positions of page numbers, position of chapter headings, chapters AND Table of Contents, References

不打扰是莪最后的温柔 提交于 2019-12-04 14:53:56
I am writing my PhD thesis (120+ pages) in latex, the deadline is approaching and I am struggling with layout problems. I am using the documentstyle book. I am posting both problems in this one thread because I am not sure if the solution might be related to both problems or not. Problems are: 1.) The page numbers are mostly located on the top-right of each page (this is correct and where I want them to be). However, only on the first page of chapters and on the first page of what I call "special chapters", the page number is located bottom-centered. With "special chapters" I mean: List of

R data.frame with stacked specified titles for latex output with xtable

耗尽温柔 提交于 2019-12-04 14:31:13
问题 > w<-data.frame(c(0,0,1,1.3,2.1), c(0,0.6,0.9,1.6091,1.6299), c(258,141,206.4,125.8,140.5), c(162,162.7,162.4,162,162)) > colnames(w) <- c('Worst Cum', 'Best Cum', 'Worst Points', 'Best Points' ) Wrong (the code) Worst Cum Best Cum Worst Points Best Points 1 0.0 0.0000 258.0 162.0 2 0.0 0.6000 141.0 162.7 3 1.0 0.9000 206.4 162.4 4 1.3 1.6091 125.8 162.0 5 2.1 1.6299 140.5 162.0 Goal: how? CUM Points Worst Best Worst Best 1 0.0 0.0000 258.0 162.0 2 0.0 0.6000 141.0 162.7 3 1.0 0.9000 206.4

Stem-and-Leaf from R into LaTeX

假如想象 提交于 2019-12-04 14:23:24
High school statistics teacher here, so sorry for the simple question (or maybe not so simple). I'm running R to create a stem-and-leaf plot. I'm trying to turn a stem-and-leaf output from stem() into LaTeX. Here is what I've got so far: y<- c(50, 26, 31, 57, 19, 24, 22, 23, 38, 13, 50, 13, 34, 23, 30, 49, 13, 15, 51) stem(y) I've tried to use xtables (because it works for my simple two-way tables) as such: print(xtable(stem(y)), type="latex", latex.environments=c("center"), tabular.environment = "tabular", NA.string = "") and I get this error: Error in UseMethod("xtable") : no applicable

latex: dollar $ sign within lstlising

倖福魔咒の 提交于 2019-12-04 14:23:12
I am trying to put some asm code into a latex document, onfurtunatly pdflatex treats the $ signs within my document as math env (which I do not want). On the other side I'd still like to use that fancy linebreak arrow (which uses math env to display it). \lstset{ texcl=false, mathescape=false, .., prebreak = \raisebox{0ex}[0ex][0ex]{ensuremath{\hookleftarrow}} } example snap: CTRL_WD_12 equ $303400 CTRL_WD_34 equ $220000 CTRL_WD_56 equ $000000 CTRL_WD_78 equ $000000 thanks for any help. You have a missing backslash. Try: prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}} It was

Using LaTeX Beamer to display code

岁酱吖の 提交于 2019-12-04 14:11:16
问题 I'm using the following LaTeX code in a Beamer presentation: \begin{frame} \begin{figure} \centering \tiny \lstset{language=python} \lstinputlisting{code/get_extent.py} \end{figure} \end{frame} Is it possible to select specific lines from my get_extent.py file rather than displaying it all? 回答1: This has nothing to do with beamer ; it's about a listings feature. Its excellent manual has more. For example: \lstinputlisting[firstline=2,lastline=5]{code/get_extent.py} 来源: https://stackoverflow

Convert HTML and inline Mathjax math to LaTeX with pandoc ruby

女生的网名这么多〃 提交于 2019-12-04 13:24:36
I'm building a Rails app and I'm looking for a way to convert database entries with html and inline MathJax math (TeX) to LaTeX for pdf creation. I found similar questions like mine: Convert html mathjax to markdown with pandoc How to convert HTML with mathjax into latex using pandoc? and I see two options here: Create a Haskell executable which leaves stuff like \(y=f(x)\) alone when converting html to LaTeX Write a ruby method which does the following things: Take the string and split it into an array with a regex ( string.split(regex) ) loop through the created array and if content matches

LaTeX: Unnumbered section in header of document

China☆狼群 提交于 2019-12-04 12:59:41
I have a document where I want to place an unnumbered section in my header. I use the fancyhdr package, and for a numbered section, I would had done something like this: \lhead{\leftmark} But this don't work with unnumbered sections. I'm solving math-problems in my document, so I don't want part-sections and numbered sections Anyone, who knows, how this is done? Use \chapter*{Preface\markboth{Preface}{}} for your unnumbered section. (You should replace chapter with whatever you are actually using.) You can even try \newcommand{\mysection}[1]{\section*{{#1}\protect\markboth{#1}{}}} but be

Match LaTeX reserved characters with regex

别等时光非礼了梦想. 提交于 2019-12-04 12:39:26
I have an HTML to LaTeX parser tailored to what it's supposed to do (convert snippets of HTML into snippets of LaTeX), but there is a little issue with filling in variables. The issue is that variables should be allowed to contain the LaTeX reserved characters (namely # $ % ^ & _ { } ~ \ ). These need to be escaped so that they won't kill our LaTeX renderer. The program that handles the conversion and everything is written in Python, so I tried to find a nice solution. My first idea was to simply do a .replace() , but replace doesn't allow you to match only if the first is not a \ . My second

How can I insert an image from internet to the pdf file produced by R bookdown in a smart way?

a 夏天 提交于 2019-12-04 12:13:32
As far as I know, inserting an image from internet to LaTeX is not possible. You have to download the image first, and then include it locally. With R bookdown, I do it like this: download.file('https://bookdown.org/yihui/bookdown/images/cover.jpg','cover.jpg', mode = 'wb') knitr::include_graphics('cover.jpg') It works very well for both the gitbook and pdf outputs. But I do not think it is smart. It is necessary for pdf to download the file first, but unnecessary for gitbook output. The image can be included directly to the gitbook output via: knitr::include_graphics('https://bookdown.org