無論我給 catdvi 輸入什麼,它都會給出相同的錯誤:「不以序言開頭」。
為了簡潔起見,我不會在這裡發布整個項目,而是貼上一個範例:
\documentclass[a4paper,12pt]{article}
\begin{document}
This is the first paragraph of a typical document. It is
produced in a `12~point' size. A \emph{point} is a unit
of length used by printers. One point is approximately
$1/72$~inch. In a `12~point' font the height of the
parentheses is 12~points (i.e. about $1/6$~inch) and the
letter~`m' is about 12 points long.
This is the second paragraph of the document. There are
also `10 point' and `11 point' styles available in LaTeX.
The required size is specified in the `documentstyle'
command. If no such size is specified then the 10~point
size is assumed.
\end{document}
有人知道發生了什麼事嗎?
編輯:哦,抱歉。我認為 catdvi 是 LaTeX 中的標準。我在維基頁面上找到了它:https://en.m.wikibooks.org/wiki/LaTeX/Export_To_Other_Formats在“轉換為純文字”下。
答案1
catdvi
dvi
與名稱中的大多數命令列實用程式一樣,它對DVI 檔案而不是 TeX 檔案進行操作。因此,如果您想使用catdvi
(或dvi2tty
) 從 TeX 文件中提取文本,您首先必須使用latex
(不是 pdflatex
) 產生 DVI 檔案。然後您可以對生成的 DVI 檔案運行catdvi
(或) 將其轉換為純文字。dvi2tty
還有其他實用程序,例如detex
從 TeX 檔案中提取文字。但結果將不同於catdvi
or dvi2tty
。
順便說一句:還有一些程式可以將 PDF 轉換為純文本,例如pandoc
或pdftotext
。