(하이퍼참조) pdf 양식 TextField에 줄 바꿈을 추가하는 방법은 무엇입니까?

(하이퍼참조) pdf 양식 TextField에 줄 바꿈을 추가하는 방법은 무엇입니까?

다음 장난감 피드백 양식을 고려하십시오.

\documentclass{article}
\usepackage{hyperref}
  \renewcommand*{\DefaultHeightofTextMultiline}{20\baselineskip}

\begin{document}
  \centering
  \begin{Form}
    \TextField[multiline,width=\textwidth,
    value={%
      You should write your feedback in a readable way, for example using bullet points:
      * Insert at least 1 positive comment (mandatory)
      * Insert at least 1 critical comment or question (mandatory)
      \newline
      Use multiple paragraphs.
      \newline
      Some examples of concrete, actionable feedback:
      * The first figure does not have a caption; please add it.
      * The derivation of Equation (7) became unclear around Equation (5). I think this is because you did not make the substitution of x explicit and feel doing so would make the argument clearer.%
  },
  name=mytextfield]{}%
  \end{Form}
\end{document}

이것을 pdflatex로 컴파일하면 다음 경고가 표시됩니다(각각 하나씩 두 번).\newline ).

Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref)                removing `\newline' on input line 20.

Hyperref를 통해 생성되고 채워지는 대부분의 PDF 필드에 대해 줄 바꿈을 사용하는 것은 의미가 없으며 아마도 지원되지 않는다는 점에서 이는 놀라운 일이 아닙니다. 그러나 양식을 편집하고 결과 파일을 저장함으로써(내 경우에는 Okular를 사용하여)~할 수 있다줄바꿈을 추가하세요. 다음을 사용하여 양식에서 데이터를 가져올 때PyPDF2PdfFileReader.getFields방법을 사용하면 다음과 같은 결과를 얻습니다.

'You should write your feedback in a readable way, for example using bullet points:\n* Insert at least 1 positive comment (mandatory)\n* Insert at least 1 critical comment or question (mandatory)\n\nUse multiple paragraphs.\n\nSome examples of concrete, actionable feedback:\n* The first figure does not have a caption; please add it.\n* The derivation of Equation (7) became unclear around Equation (5). I think this is because you did not make the substitution of x explicit and feel doing so would make the argument clearer.'

개행 문자에 주목하세요 \n. 그래서 가능할 것 같습니다. LaTeX 파일에 개행 문자를 추가하고 싶습니다. 이것이 가능한가? 어떻게 해야 하나요?

\n순진하게 리터럴을 as 추가하려고 시도했지만 \textbackslash{n}실패했습니다.

'You should write your feedback in a readable way, for example using bullet points:\\n * Insert at least 1 positive comment (mandatory)\\n * Insert at least 1 critical comment or question (mandatory)\\n \\n Use multiple paragraphs.\\n \\n Some examples of concrete, actionable feedback:\\n * The first figure does not have a caption; please add it.\\n * The derivation of Equation (7) became unclear around Equation (5). I think this is because you did not make the substitution of x explicit and feel doing so would make the argument clearer.'

답변1

업데이트\textCR: 실제로는 or 를 사용하는 것이 더 좋습니다 \textLF. 인코딩이 변경되어도 작동합니다.

\string\n나를 위해 일합니다 :

\documentclass{article}
\usepackage{hyperref}
  \renewcommand*{\DefaultHeightofTextMultiline}{20\baselineskip}

\begin{document}
  \centering
  \begin{Form}
    \TextField[multiline,width=\textwidth,
    value={%
      You should write your feedback in a readable way, for example using bullet points:\string\n
      * Insert at least 1 positive comment (mandatory)\string\n
      * Insert at least 1 critical comment or question (mandatory)\string\n
      Use multiple paragraphs.
      \string\n
      Some examples of concrete, actionable feedback:\string\n
      * The first figure does not have a caption; please add it.\string\n
      * The derivation of Equation (7) became unclear around Equation (5). I think this is because you did not make the substitution of x explicit and feel doing so would make the argument clearer.\string\n%
  },
  name=mytextfield]{}%
  \end{Form}
\end{document}

여기에 이미지 설명을 입력하세요

관련 정보