code

라텍스 다중 줄 바꿈

codestyles 2021. 1. 9. 09:55
반응형

라텍스 다중 줄 바꿈


LaTeX를 사용하여 수업 용 프로그래밍 숙제를 입력합니다. 이 작업을 수행해야합니다.

my line of text blah blah blah

new line of text with blank line between 

나는 이중 슬래시를 사용하여 줄을 끊을 수 있다는 것을 알고 있지만 LaTeX는 첫 번째 줄 바꿈 (더 많은 것에 대해 불평) 만 취하고 새 줄을 시작하면 다음과 같이 생성됩니다.

my line of text blah blah blah  
new line of text with blank line between 

텍스트 줄 사이에 공백을두기 위해 추가 줄 바꿈을 어떻게 얻을 수 있습니까?


단락 사이에 더 많은 공간을 원하십니까? 그런 다음 매개 변수를 변경할 수 있습니다 \parskip.

예를 들어

\setlength{\parskip}{10pt plus 1pt minus 1pt}

즉, 단락 사이의 간격은 일반적으로 10pt이지만 최대 1pt까지 늘리거나 줄일 수 있습니다. 즉, 더 나은 페이지 레이아웃을 얻기 위해 LaTeX에 최대 1pt까지 변경할 수있는 기능을 제공합니다. 더하기 및 빼기 부분을 제거하여 항상 지정된 길이로 만들 수 있습니다.

소스 코드를 표시하려는 경우 listings패키지를 사용해 보거나 verbatim. 의사 코드를 조판하려는 경우 algorithm패키지를 사용해보십시오 .


줄 바꿈은 세로 길이 인 대괄호로 묶인 선택적 인수를 허용합니다.

line 1
\\[4in]
line 2

글꼴 크기와 관련하여 확장 성을 높이려면 \\[3\baselineskip], 또는 등의 다른 길이를 사용할 수 있습니다 \\[3ex].


약간의 수직 공간 삽입

blah blah blah \\
\vspace{1cm}

글꼴에 맞게 크기를 조정하려면 단위로 ex(소문자 "x"의 높이)를 사용하고 사용 가능한 줄 간격과 관련된 미리 정의 된 다양한 길이 가 있습니다. 특히 관심이있을 수 있습니다 baselineskip.


프로그램의 경우 verbatim또는 alltt환경을 사용하는 것이 더 낫지 만 LaTeX가 방해하지 않는 빈 줄을 원한다면

my line of text blah blah blah\\
\mbox{ }\\  %% space followed by newline
new line of text with blank line between 

하지만 verbatim최선의 선택이 될 수있다, 당신은 또한 명령을 시도 할 수 있습니다 \smallskip, \medskip또는 무엇을 추측 \bigskip.

페이지 에서 인용 :

이 명령은 단락 나누기 후에 만 ​​사용할 수 있습니다 (완전히 빈 줄 하나 또는 \ par 명령으로 만들어 짐). 이러한 명령은 각각 약 3pt, 6pt 및 12pt 높이의 유연한 공간 또는 고무 공간을 출력하지만 이러한 명령은 나머지 페이지의 요구 사항에 따라 자동으로 약간 압축되거나 확장됩니다.


간격 환경을 제공 하는 setspace 패키지를 사용할 수 있습니다 . 예 :

\documentclass{article}
\usepackage{setspace}
\begin{document}
\doublespace
my line of text blah blah blah

new line of text with blank line between
\end{document}

또는 verbatim환경을 사용 하여 코드 레이아웃을 정확하게 제어하십시오.


I find that when I include a blank line in my source after the \\ then I also get a blank line in my output. Example:

It's time to recognize the income tax as another horrible policy mistake like banning beer, and to return to the tax policies that were correct in the Constitution in the first place.  Our future depends on it.
\\

Wherefore the 16th Amendment must forthwith be repealed.

However you are correct that LaTeX only lets you do this once. For a more general solution allowing you to make as many blank lines as you want, use \null to make empty paragraphs. Example:

It's time to recognize the income tax as another horrible policy mistake like banning beer, and to return to the tax policies that were correct in the Constitution in the first place.  Our future depends on it.

\null

\null

\null

Wherefore the 16th Amendment must forthwith be repealed.

\\\\

This works on pdfLatex. It creates 2 new lines for you.


Maybe try inserting lines with only a space?

\ \\
\ \\

ReferenceURL : https://stackoverflow.com/questions/2195908/latex-multiple-linebreaks

반응형