什么是计算机科学的NP完成?(What is an NP-complete in computer science?)
什么是NP完整的问题? 为什么在计算机科学中这么重要?
What is an NP-complete problem? Why is it such an important topic in computer science?
原文:https://stackoverflow.com/questions/210829
更新时间:2022-02-24 21:02
最满意答案
left
环境似乎搞乱了参考。 我试过了% latex table generated in R 3.2.0 by xtable 1.7-4 package % Tue Jun 02 09:53:12 2015 \begin{table}[ht] \caption{Test table} \label{tab:Test} \begin{left} \begin{tabular}{rr} \hline Test & a \\ \hline 1 & 4 \\ 2 & 5 \\ 3 & 6 \\ \hline \end{tabular} \end{left} \end{table}
它会产生一个正确的参考。
The
left
environment seems to be messing up the referencing. I tried% latex table generated in R 3.2.0 by xtable 1.7-4 package % Tue Jun 02 09:53:12 2015 \begin{table}[ht] \caption{Test table} \label{tab:Test} \begin{left} \begin{tabular}{rr} \hline Test & a \\ \hline 1 & 4 \\ 2 & 5 \\ 3 & 6 \\ \hline \end{tabular} \end{left} \end{table}
and it produces a correct reference.
相关问答
更多-
是的,使用选项escape=FALSE : kable(dat, booktabs = TRUE, caption = "My table", escape = FALSE) Yes, use the option escape=FALSE: kable(dat, booktabs = TRUE, caption = "My table", escape = FALSE)
-
left环境似乎搞乱了参考。 我试过了 % latex table generated in R 3.2.0 by xtable 1.7-4 package % Tue Jun 02 09:53:12 2015 \begin{table}[ht] \caption{Test table} \label{tab:Test} \begin{left} \begin{tabular}{rr} \hline Test & a \\ \hline 1 & 4 \\ 2 & 5 \\ ...
-
乳胶交叉参考(LaTeX cross referencing)[2022-03-12]
\S导致美元符号被输出。 在\ref之前简单地删除它,你应该得到你想要的输出。 The \S causes the dollar sign to be output. Simply remove that before the \ref and you should get your desired output. -
你很亲密 问题在于你的bold()函数。 尝试: 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], '}', sep = "") } return(x) } 并将sanitize.text添加到print.xtable()调用 ...
-
这是一个带有htmlTable的基本表的htmlTable : --- title: "Untitled" author: "Author" date: "2/5/2017" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE) ``` ```{r} library(htmlTable) ``` ```{r, results="asis"} tab = cbind.data.f ...
-
我显然有偏见...但是pixiedust *允许你使用相同的命令集在latex或html中创建表格(尽管乳胶输出比html略有限制)。 --- title: "Bug List" output: html_document: null pdf_document: null header-includes: - \usepackage[dvipsnames,table]{xcolor} - \usepackage{longtable} - \usepackage{arydshln} - \usepac ...
-
我在这个意义上更新了我的答案,你不再需要dcolumn了。 在使用R的正则表达式功能和添加原始LaTeX命令(如{\hskip 0.5em}之间有一点混合。 问题是,您可以在(据我所知)任何LaTeX环境中添加这些原语,以便格式化您的段落等。 因此,使用apply我们重新格式化表格单元格的内容 ,具体取决于括号中的数字是1还是2位数,然后添加适当的水平间距。 通过在print.xtable使用sanitize.text.function = identity ,我们确保在data.frame处理xtable ...
-
cat和print.xtable函数都有一个'append'参数: wrapLatex <- function(dat,fil, ...) { cat(c("\\documentclass{article}\n", "\\pagestyle{empty}\n", "\\begin{document}\n"), file=fil) print(dat, file=fil, append=TRUE, ...) cat("\\end{docu ...
-
knitr如何使用xtable在latex table中获得指数/脚注(knitr how to get exponent/footnotes in latex table using xtable)[2022-07-06]
请参阅?print.xtable并查看清理选项。 使用你原来的LaTeX包含方法然后这样的东西应该工作... <>= require(xtable) tbl <- xtable(df0) print(tbl, type="latex", sanitize.text.function=function(x){x}) @ See ?print.xtable and check out the sanitize options. Use your orig ... -
问题是表中每行的结尾是一个\\ ,它有一个可选参数来指定在下一行之前\\[1in]多少空间,例如\\[1in] 。 在\\和[之间允许有空格,所以在这种情况下,它试图将[2,5)作为该参数读取。 一个简单的解决方法是首先更改因子的标签以包含一些非打印空白字符,但是,如果这样做,默认情况下, print.xtable将“清理”它以便它实际上打印,所以你' d需要通过传递新的消毒功能来关闭它; identity不会解决这个问题。 levels(x.freq$Var1) <- paste0("{}", level ...