Quarto:如何右对齐 PDF *和* HTML 中的文本

问题描述 投票:0回答:1

我正在尝试让 Quarto 在以 PDF 和 HTML 格式呈现时右对齐某些文本。但我只能让它做其中之一,而不是两者兼而有之。下面是一个最小的示例,其中包含源代码以及 PDF 和 HTML 输出的屏幕截图。您可以看到源代码成功地使用 LaTeX \begin{flushright}

 进行 PDF 输出,并成功使用 
::: {style="text-align: right"}
 进行 HTML 输出,但是两者不能很好地结合在一起。还有其他办法吗?

--- title: "How to right justify both html and pdf" --- Here is some intitial text in usual left-justified format. ::: {style="text-align: right"} Attempt 1. This text should be right justified. ::: \begin{flushright} Attempt 2. This text should be right justified. \end{flushright} ::: {style="text-align: right"} \begin{flushright} Attempt 3. This text should be right justified. \end{flushright} ::: \begin{flushright} ::: {style="text-align: right"} Attempt 4. This text should be right justified. ::: \end{flushright} Here is some *more* text in usual left-justified format.


HTML 输出。 请注意,仅出现了尝试 1(正确),但其他尝试根本不出现:


PDF 输出。注意尝试 1 不起作用:

html pdf quarto text-align right-justified
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.