在R标记(PDF)中创建可填充的彩色文本框
我正在尝试创建一个标记,其中伴随绘图和表格的文本位于深蓝色框中,如下图所示: 我试过看,但我根本无法复制这个盒子,当然也无法复制彩色版本。有没有人对如何在降价中做到这一点有好的想法在R标记(PDF)中创建可填充的彩色文本框,r,pdf,r-markdown,R,Pdf,R Markdown,我正在尝试创建一个标记,其中伴随绘图和表格的文本位于深蓝色框中,如下图所示: 我试过看,但我根本无法复制这个盒子,当然也无法复制彩色版本。有没有人对如何在降价中做到这一点有好的想法 --- title: "Untitled" author: "Test" date: "22/6/2018" output: pdf_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## R Mark
---
title: "Untitled"
author: "Test"
date: "22/6/2018"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
summary(cars)
```
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
\begin{Form}
\TextField[width = 10cm, height = 10cm]{This is the textbox.}
I would like a dark blue textbox with white writing
\end{Form}
\TextField命令采用一些可选参数来定义颜色和默认文本:
---
output:
pdf_document:
keep_tex: yes
---
\begin{Form}
\TextField[width = 10cm,%
height = 3cm,%
multiline=true,%
bordercolor = 0 0 0.5,%
backgroundcolor = 0 0 0.5,%
color = 1 1 1,%
value = {%
This is the textbox.
I would like a dark blue textbox with white writing
}%
]{}
\end{Form}
这将产生:
可以编辑\text字段以包含多行文本,但我无法使用多行设置值。使用\string\n c.f.对我不起作用。不过,这可能取决于PDF查看器。我正在使用Evence。但是我无法让颜色正常工作-我只能使用黑色/白色。你知道我在哪里可以找到更多关于这个的信息吗?@Nordsted有趣。您使用哪种PDF查看器?我使用Adobe,但不管PDF查看器如何,都会有相同的结果,这难道不是一个技巧吗?我认为PDF的整个想法是,无论使用何种软件,结果都是一样的。@Nordsted我认为并非所有PDF查看器都支持某些东西。然而,我很惊讶AcrobatReader不支持这一点。你觉得建造乳胶基mcve舒服吗?我想这方面的专家已经在tex.stackexchange.com上了。我将尝试在那里发布一个问题。我希望我不会被屠杀——正如你从我的问题中所看到的,我根本不是乳胶专家