Latex產生的帶有多行文字的pdf在每行後面加上換行符

Latex產生的帶有多行文字的pdf在每行後面加上換行符

我在\itemof{itemize}或 in中有多行文字{section}並建立文件的 pdf。當我從 pdf 複製文字時,每行末尾都有一個換行符。我正在創建一個將由人工智慧工具讀取的文檔,分割句子會弄亂它。

我如何配置它不添加那些不必要的換行符?

例如,如果我從以下程式碼生成的pdf中複製文本,則之間有一個換行符character inthe middle

\begin{itemize}
    \item This is some text that spans multiple lines. I need the pdf to not have a newline 
    character in the middle of the sentence in the copied text
    \item Some more text.
\end{itemize}

在此輸入影像描述

答案1

嗯,這是其中一件事已標記的 PDF 項目是關於。如果你在目前的 TeXsystem 中使用 lualatex 編譯它(它最好地處理實空間字元)

\DocumentMetadata{testphase=phase-III}
\documentclass{article}

\begin{document}
\begin{itemize}
    \item This is some text that spans multiple lines. I need the pdf to not have a newline 
    character in the middle of the sentence in the copied text
    \item Some more text.
\end{itemize}
\end{document}

然後複製並貼上將給出


This is some text that spans multiple lines. I need the pdf to not have a newline character in the middle of the sentence in the copied text
Some more text.

但一般來說,您不應該過於信任 PDF 中的複製和貼上。該格式不包含簡單的文本,這意味著每個讀者都必須進行一些啟發。

相關內容