latex

Table layouts for use with Pandoc

落花浮王杯 提交于 2019-12-07 12:30:23
问题 I'm trying to create a document generation workflow (professional documents). The goal is to write as much as possible in Markdown. The resulting document should be PDF, while still being able to export to .docx if necessary. I've settled on Pandoc, for which I'll create a Latex template and use a YAML document to hold the document metadata. So far so good. However, from time to time I need to use tables, ranging from very simple ones to more complex layouts with e.g. column spanning.

forloop and table in LaTeX

♀尐吖头ヾ 提交于 2019-12-07 12:21:03
问题 Here is the LaTeX code for my table: \begin{table}{| c || c | c | c || c | c | c | } \caption{Examples of the concepts. \label{tab:conceptsimgs}}\\ \hline \backslashbox{Concept}{Class} &\multicolumn{3}{|c||}{Negative Class} & \multicolumn{3}{|c|}{Positive Class} \\ \hline \forloop{themenumber}{1}{\value{themenumber} < 4}{ %\hline \arabic{themenumber} \forloop{classnumber}{0}{\value{classnumber} < 2}{ \forloop{imagenumber}{1}{\value{imagenumber} < 4}{ & 0 } } \\ \hline } \end{table} Something

R code in LaTeX in YAML before_body include

流过昼夜 提交于 2019-12-07 12:08:55
问题 I have a LaTeX section that I put at the top of my knitr generated PDF document. I achieved this by using the YAML options output: pdf_document: includes: before_body: file.tex file.tex contains code like this \textsf{Reporting: `r 2+2`} but this doesn't work. Is there another way that I can get this value? Passing in a parameter is fine if that's possible. Thanks! 回答1: You have to knit file.tex . I suggest you rename file.tex , e.g., to file.Rnw , and in your main R Markdown document: ```{r,

I'm trying to use a LaTex string for an axis label in MATLAB and get a number for no apparent reason

巧了我就是萌 提交于 2019-12-07 12:03:38
问题 I'm trying to use a LaTex string to insert a fraction for the y-axis label, and I get a number (in standard font and ylabel position) as well as what I expected (the fraction I'm trying to insert). This has changed for me when I've edited the code, but stopped once I tried investigating this (it's 353.191 as I type, in case it helps). The number is not there if I don't try to add a label to the y-axis, or add a label without LaTex. There is no error message. Code in question: ylabel(text(

Emacs insert centered comment block

痴心易碎 提交于 2019-12-07 11:00:52
问题 I would like to create a macro for emacs that will insert a latex comment block with some centerd text like: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Comment 1 %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Comment 2 Commenttext 3 %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Is this possible in emacs-lisp ? 回答1: Emacs comes with the command comment-box for this purpose. It produces centered comment

Associate .Rnw with vim latex suite

送分小仙女□ 提交于 2019-12-07 10:56:02
问题 This I am sure is really basic stuff. I am just beginning using gvim and latex-suite. However I would like latex-suite to load when I edit a sweavefile with.Rnw extension. my .vimrc looks like this " These settings are needed for latex-suite filetype indent on filetype plugin on filetype on let g:tex_flavor='latex' set grepprg=grep\ -nH\ $* "let g:Tex_Folding=0 "I don't like folding. set iskeyword+=: and I guess there is some option I can set here that makes vim treat Rnw as .tex? 回答1: Put a

File Level Tracking In Git (Files from multiple branches in same directory)

情到浓时终转凉″ 提交于 2019-12-07 10:43:40
问题 Is there any script that lets one remember branch/commit seperatly for files in some directory so that one can simultaneously work on file1 on branch1 and file2 on branch2 in the same directory and have them commit appropriately. If not I'll implement it myself. My plan is to have hidden checkout directories for various branches/repos and populating the apparent checkout with links to these files so that commits simply committed their respective hidden branches but advice would be appreciated

How to save and edit the content of a kable print?

落爺英雄遲暮 提交于 2019-12-07 10:39:16
问题 This is a follow-up to how to export a dataframe to latex with some minimal formatting? Consider this working example ```{r table, results='asis'} library(knitr) library(kableExtra) library(magrittr) dataframe <- data.frame(mytext1 = c('HELLO', 'WORLD'), mytext2 = c('HELLO', 'AGAIN'), value1 = c(1,2), value2 = c(1,2)) piper <- dataframe %>% kable(format = 'latex', booktabs = TRUE) %>% add_header_above(header = c("Text" = 2, "Values" = 2)) ``` which gives \begin{tabular}{llrr} \toprule

If-Else Statement in knitr/Sweave using R variable as conditional (Part 2)

∥☆過路亽.° 提交于 2019-12-07 09:39:34
问题 I am extending a question I posted here: If-Else Statement in knitr/Sweave using R variable as conditional I would like to use an if-else syntax in LaTeX so that, depending on the value of an R variable (say x), one of two LaTeX text paragraphs are output. If x>0, then the LaTeX paragraph has a figure and a table. However, if x<0, then the LaTeX paragraph has just a figure (and no table). I have a MWE that works and is based on the checked answer at the previous post: \documentclass[12pt

Equations in doxygen

倖福魔咒の 提交于 2019-12-07 09:31:48
问题 I am including amsmath in my doxygen and I wrote: \f{equation}{ x=2 \f} but the result in the doxygen is \begin{equation} x=2 \end{equation} rather than the equation x=2 Does anyone know what going wrong? 回答1: You are doing it correctly, I do that and it works. The page briefly shows \begin{equation} x=2 \end{equation} and then the correct equation appears. Double check that you have USE_MATHJAX = YES in your config file. The default is NO See: USE_MATHJAX in the Doxygen reference. If not set