我正在使用Pandoc集成Scrivener与Zotero。我用Scrivener编写,添加Zotero引文键,编译一个.txt文件,然后使用Pandoc将.txt文件转换为一个Word文件,其中引用键有效地转换为我喜欢的引用风格(在本例中为APA)。按照这网页上的说明,我还设置了“标记2”,以显示我在Scrivener中使用标记的输出。
问题来了:换行。如果我用Scrivener写字:
I want a newline after this.
This should be a newline.然后标记2显示:
I want a newline after this. This should be a newline.于是我在Scrivener上写道:
I want a newline after this.<br>
This should be a newline.标记2:
I want a newline after this.
This should be a newline.太棒了!现在,我将编译成一个.txt文件,并得到:
I want a newline after this.<br>
This should be a newline.好的,现在是使用Pandoc的时候了。
我在终端中键入以下命令:
pandoc -s -S --normalize --bibliography
~/Dropbox/_Research/Master_Thesis/Master.bib --csl
~/Dropbox/_Research/apa.csl
-f markdown -t docx -o trial.docx /Users/S/Desktop/test_st.txt我得到了我的.docx文件(当我用完整的文档完成这个操作时,我的所有引用都在那里,所以这是可行的!),然后我读到:
I want a newline after this. This should be a newline.注意,.txt文件中存在的newline命令已经消失,但我仍然没有得到换行符。
发布于 2018-01-18 21:06:06
这样做的原因是,传统的在标记中写入硬行的方法是在行尾加上两个空格。
I want a newline after this.␠␠
This should be a newline.<br>元素被解释为原始HTML,也就是说,它将以任何支持HTML的格式呈现,比如Markdown或HTML本身。然而,Docx不支持原始的<br>,因此简单地删除了。
所以,要么使用上面解释的传统Markdown语法(这是丑陋的IMHO),要么使用pandoc特性,它允许以反斜杠结尾行添加硬行,“转义”换行符:
I want a newline after this.\
This should be a newline.https://stackoverflow.com/questions/48329455
复制相似问题