문서의 나머지 부분과 목차의 줄 간격을 다르게 설정하는 방법은 무엇입니까?

문서의 나머지 부분과 목차의 줄 간격을 다르게 설정하는 방법은 무엇입니까?

저는 대학에서 마지막 논문을 쓰고 있는데 이중선 스프레드와 Times New Roman을 사용해야 합니다. 서문에 설정하면 \linespread{1.6}목차에 \section큰 공백이 생기는 것을 제외하고는 모든 것이 괜찮습니다. 태그 기록이 발생한 후 선 스프레드를 설정하면 \tableofcontents선 스프레드가 정상적으로 유지됩니다.

TOC에서만 일반 선 스프레드를 유지할 가능성이 있습니까?

답변1

패키지 에서 제공하는 기능을 사용할 수 있습니다 setspace.

\documentclass{article}
\usepackage{setspace}

\doublespacing

\begin{document}

\begingroup
\singlespacing
\tableofcontents
\endgroup

\section{Section One}
\section{Section Two}
\section{Section Three}
\section{Section Four}
\section{Section Five}

\end{document}

또는

\documentclass{article}
\usepackage{setspace}

\begin{document}

\tableofcontents

\doublespacing

\section{Section One}
\section{Section Two}
\section{Section Three}
\section{Section Four}
\section{Section Five}

\end{document}

답변2

패키지 를 이용하시면 됩니다 setspace. \usepackage{setspace}서문과 \doublespacing목차 뒤에 다음 을 추가하기만 하면 됩니다 .

\documentclass{article}
\usepackage{setspace}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\doublespacing
\section{one}
\lipsum[1-4]
\section{two}
\lipsum[5-8]
\section{three}
\lipsum[9-12]
\end{document}

서로 다른 간격의 TOC

관련 정보