줄 바꿈 없이 TeX에서 여러 줄을 작성하는 방법은 무엇입니까?

줄 바꿈 없이 TeX에서 여러 줄을 작성하는 방법은 무엇입니까?

줄 바꿈 없이 TeX/LaTeX에서 여러 줄을 작성하는 방법은 무엇입니까? 줄은 서로 수직으로 겹쳐져서는 안 됩니다. 그러나 결과는 타자기로 줄을 입력한 다음 캐리지를 다시 오른쪽으로 이동하고 줄 바꿈 없이 다음 줄을 입력할 때 얻는 결과와 유사해야 합니다. 두 번째 줄의 문자가 첫 번째 줄의 문자를 덮어씁니다. 와 같이 얻은 것 주위에 프레임을 배치할 수 있어야 \fbox프레임이 가장 높은 문자의 상단과 가장 깊은 문자의 하단에서 에 의해 수직으로 분리됩니다 \fboxsep.

답변1

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

간단히 \baselineskip0pt로 설정할 수 있습니다

\documentclass{article}

\begin{document}

\begin{center}
  \fbox{\parbox{\dimexpr\textwidth-2\fboxrule-2\fboxsep} {%
      \lineskiplimit=-\maxdimen\baselineskip=0pt\relax
      How to write several lines in
      TeX/LaTeX without line feed? The lines should not lie vertically
      on top of each other, but the result should be similar to what
      you get when you type a line with your typewriter and then move
      carriage back to the right and then type the next line without a
      line feed, so that the letters of the second line overwrite the
      letters of the first line. You should be able to put a frame
      around what you get—like a \texttt{\string\fbox}, so that the
      frame is vertically separated both at the top from the highest
      character and at the bottom from the deepest character by
      \texttt{\string\fboxsep}.}}
\end{center}

\end{document}

답변2

나는 tabular같은 셀 주위에 프레임을 사용하여 내부에 별도의 줄을 설정했습니다. 줄을 덮어쓰는 것은 음수 줄 바꿈을 사용하여 수행됩니다 \\[-\normalbaselineskip].

1

\documentclass{article}

\begin{document}

\begin{tabular}{| l |}
  \hline
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. \\
  Vestibulum sit amet velit vel elit tincidunt placerat. \\
  Mauris sit amet magna venenatis, malesuada magna eget, venenatis ex. \\
  \hline
\end{tabular}

\bigskip

\begin{tabular}{| l |}
  \hline
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. \\[-\normalbaselineskip]
  Vestibulum sit amet velit vel elit tincidunt placerat. \\[-\normalbaselineskip]
  Mauris sit amet magna venenatis, malesuada magna eget, venenatis ex. \\
  \hline
\end{tabular}

\end{document}

관련 정보