将简单的 groff 编码文件转换为选项卡式且对齐的 .txt 文件

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

我有一个用一些 groff 风格编码的文本文件,我可以将其转换为 .pdf,但我想将其转换为 .txt 或 .md 文件(我不介意两者中的哪一个,但没有后记),只要它不是 .pdf,就保留 groff 选项卡式和异化样式。

.pl 11.15i
.TL
Main Title

.PP
.I
References

.in 2.6
.ti -1.1
I. MAIN outlined point including the following points A. and 1.
.ft R
.in 4.1
.ti -1.35
A. Next outlined point included in the above point I.
.in 5.2
.ti -1.1
1. Next outline point included in the above Point A.

为了将其转换为.pdf,我使用了这个,如果尝试一下,效果会非常好:

groff -ms myfile.txt -Tpdf > myfile.pdf

但是我找不到一种方法来制作 .txt 或 .md 来保留 groff 给出的异化风格。

我尝试过这个:

pandoc myfile.txt -o output.txt
pandoc myfile.txt -o output.md

但没有成功。

pandoc groff
1个回答
0
投票

Pandoc 可以保留文档结构,但不能保留布局。这里的显式缩进被视为布局,因此 pandoc 不会将行识别为列表。为了让 pandoc 按预期翻译此内容,应使用 ms 列表

© www.soinside.com 2019 - 2024. All rights reserved.