gpt4 book ai didi

markdown - 使用 pandoc 右对齐 markdown 行的一部分

转载 作者:行者123 更新时间:2023-12-04 03:01:23 26 4
gpt4 key购买 nike

我想正确证明下面简历中的日期。显示了我失败的尝试。

我在下面显示的内容可以转换,但日期不合理。

我用过 how do we right align part of a line in r markdown?这适用于 pdf,但 MS Word 似乎没有正确对齐文本。

长期目标:我使用 Markdown 和 pandoc。我想使用 Markdown 创建一份简历。我希望能够将其导出为 docx 和 pdf。我的编辑器是 emacs,我使用 Markdown 模式并安装了 pandoc。我使用 C-c/O 将文件设置为 docx,使用 C-c/r 运行 Pandoc。我愿意拥有一个样式文件。

---
Font:Tahoma
---

# Summary
Ten years experience solving problems

# Experience

## First Job, Newark, NJ <span align="right"> (5/2014-Present) </span>
### Programmer
* Solved analysis problems using data automation.

## Second Job, Newark, NJ \hfill (01/01/04/2014)
### Data Analyst
* Debugged Programs.

最佳答案

这很可能是不可能的。

一、原Markdown rules状态:

HTML is a publishing format; Markdown is a writing format. Thus, Markdown’s formatting syntax only addresses issues that can be conveyed in plain text.



在这种情况下,诸如左对齐文本之类的事情超出了 Markdown 的范围。当然,正确的方法是使用原始 HTML,正如您所尝试的那样。但这就是您在使用 Pandoc 时遇到的问题。

Pandoc的 documentation状态(强调):

Because pandoc’s intermediate representation of a document is less expressive than many of the formats it converts between, one should not expect perfect conversions between every format and every other. Pandoc attempts to preserve the structural elements of a document, but not formatting details such as margin size. And some document elements, such as complex tables, may not fit into pandoc’s simple document model. While conversions from pandoc’s Markdown to all formats aspire to be perfect, conversions from formats more expressive than pandoc’s Markdown can be expected to be lossy.



由于左对齐文本不是您可以在普通 Markdown 中执行的操作,因此在转换为其他格式时您可能会丢失这种内容。它在转换为 HTML 时起作用的原因是原始 HTML 只是未经更改地传递。标准 Markdown 行为它甚至不解析 HTML。由于输出是 HTML,因此可以正常工作。但是,当使用 Pandoc 从 Markdown 转换为非 HTML 格式时,原始 HTML 中的“格式详细信息”丢失了。

有时,您可以成功地从 HTML 文档转换为另一种格式并取得更大的成功,但是 Markdown 之外支持的功能受到严重限制。我不时看到人们甚至尝试创建他们想要的 Word 文档,然后使用 Pandoc 将其转换为 HTML 以查看 Pandoc 生成的内容。即便如此,在大多数情况下,格式也会丢失,因为它无法在普通 Markdown 中传达。

关于markdown - 使用 pandoc 右对齐 markdown 行的一部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48873629/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com