rmarkdown:定义文本框和框中文本的对齐方式

rmarkdown: define text boxes and alignment of text in boxes

我正在使用 R 和 rmarkdown 打印正式信件。

我想将发件人和收件人的地址格式设置为如下图所示

但是在 rmarkdown 中我只做到了以下几点

---
title: "Untitled"
output: pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

\
This is where the reciepient goes  \hfill This is where the sender goes \
Address 1 \hfill Person \
Address 2 \hfill Department \
Address 3 \hfill Address 1 \
Address 3 \hfill Address 2 \
\
\raggedleft Address 3 \
Address 4 \
Address 5 \
Address 6 \
Telephone \
Fax \
Email \

这导致

但这不是我需要的原因。我希望两个盒子都左对齐。显然 /hfill 不是正确的用法。如何定义这两个框、它们的位置、其中的文本以及文本的对齐方式?

我正在编织PDF。

试试这个解决方案:

---
title: "Untitled"
output: pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```       
\begin{tabular}[t]{@{}l}
This is where the reciepient goes \ 
Address 1 \
Address 2 \
Address 3 \
Address 3 \
\end{tabular}
\hfill
\begin{tabular}[t]{@{}l}
This is where the sender goes \  
Person \
Department \ 
Address 1 \ 
Address 2 \  
Address 3 \  
Address 4 \  
Address 5 \  
Address 6 \ 
Telephone \  
Fax \  
Email \
\end{tabular}