latex

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

左心房为你撑大大i 提交于 2019-12-06 07:34:05
问题 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

Visualzing SLA Performance

时间秒杀一切 提交于 2019-12-06 07:24:13
问题 I author a report for our senior leadership each month - it shows I.T. performance. Things such as Incident resolution, system availability and so forth. I have been poking around for ways to visualize some of the data I have and found a beautiful representation, which is as follows: I love this layout. All of my reporting is in RMarkdown with some mixed LaTex. I have been contemplating how to replicate something like this in Rmarkdown or maybe even just use raw LaTex embedded in my markdown

Add markers and hyperlinks for citations in pandoc

筅森魡賤 提交于 2019-12-06 07:04:32
I put references in a yaml metadata-header: references: - id: fenner2012a title: One-click science marketing author: - family: Fenner given: Martin ... (described here: http://johnmacfarlane.net/pandoc/README.html#extension-citations ) and I can cite this reference with See [@fenner2012a]... . This will create an output in the pdf like this: See ("One-click science marketing")... with no hyperlink on the reference. Instead of the title I want to have auto-incremented number: See [1] with [1] beeing a hyperlink to the source. How can I achieve this? 来源: https://stackoverflow.com/questions

Match LaTeX reserved characters with regex

坚强是说给别人听的谎言 提交于 2019-12-06 06:29:11
问题 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

Why does \\\\ not break lines in this R markdown example?

丶灬走出姿态 提交于 2019-12-06 06:27:57
The file ./vignettes/foo.Rmd in an R package contains: --- title: Foo author: Marius Hofert vignette: > %\VignetteEngine{knitr::rmarkdown} %\VignetteIndexEntry{Foo} --- \[ \begin{align} X_t &= \mu_t + \sigma_t Z_t\\ \mu_t &= \mu + \sum_{k=1}^{p_1} \phi_k (X_{t-k}-\mu) + \sum_{k=1}^{q_1} \theta_k (X_{t-k}-\mu_{t-k})\sigma_t^2\\ &= \alpha_0 + \sum_{k=1}^{p_2} \alpha_k (X_{t-k}-\mu_{t-k})^2 + \sum_{k=1}^{q_2} \beta_k \sigma_{t-k}^2. \end{align} \] However, this is the output: So the line breaks (via \\ ) seem to be ignored. Why? In my R version it crashed when I tried to include amsmath . Somehow

Making the draft document option in LaTeX have extra text appear in LaTeX

巧了我就是萌 提交于 2019-12-06 06:20:08
问题 Is there a way to get some text to appear only when the [draft] option is active. For example, when the draft option is active, I want some text to appear between my title and abstract: "draft: do not cite without permission" or some such. 回答1: Usually this is done with \usepackage{ifdraft} \ifdraft{stern warning}{} Where to put the \ifdraft depends on how you've created the layout of your title page. 来源: https://stackoverflow.com/questions/2487252/making-the-draft-document-option-in-latex

LaTeX: Unnumbered section in header of document

妖精的绣舞 提交于 2019-12-06 06:14:37
问题 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? 回答1: Use \chapter*{Preface\markboth{Preface}{}} for your unnumbered section. (You should replace chapter with whatever you are

emacs AUCTeX macros fontification

守給你的承諾、 提交于 2019-12-06 06:06:15
问题 I recently started using the excellent package xargs that provides \newcommandx . It shares a syntax similar to the default \newcommand . I would like font-lock to reflect this. I did (custom-set-variables '(font-latex-user-keyword-classes (quote (("cx" ("newcommandx" "*|{\\[[{") (:family "font-lock-type-face") command))))) But this fontifies just the command name itself, not its body ( \newcommand fontifies the body with 'font-lock-function-name-face , which in my case is bold). I want

How do I create a new Beamer environment with a verbatim environment?

狂风中的少年 提交于 2019-12-06 06:00:27
I'm creating a Beamer presentation that has a lot of example LaTeX in it, which has to go in a verbatim environment. I'm getting tired of typing \begin{example} \begin{verbatim} Verbatim Text \end{verbatim} \end{example} I wish to create a new command or environment that will shorthand this for me. I also need this for blocks and theorems, since I'm using those frequently as well. But if I can figure it out for examples, it should be easy to translate to another example. I can't create a new environment or command using just \begin{verbatim}, since it cuts off the rest of the command. So I