
클래스를 사용하여 논문을 조판하고 있는데 book
장 제목은 한 칸 간격으로, 본문은 두 칸 간격으로 작성해야 합니다.
\singlespacing
장 정의의 텍스트 앞에 삽입하면 ! Missing control sequence inserted. <inserted text> \inaccessible
컴파일 시 오류가 발생하고 목차의 장 번호와 이름 사이에 가짜 줄바꿈이 삽입됩니다.
다음은 최소한의 작업 예입니다.
\documentclass[12pt,oneside]{book}
\usepackage{lipsum} % included only to generate example text
\usepackage{setspace} % set double vs single spacing
\begin{document}
\clearpage
\doublespacing
\chapter{I need singlespace titles, doublespace text.}
\section{Section headers should also be single-spaced, but I could adjust titles to fit on one line}
\lipsum[4] % generate some filler text
\end{document}
이것은 다음의 중복이 아닙니다.이 질문, 해당 질문에 대한 답변에는 \section
명령에 대한 특정 해킹이나 클래스 와 함께 사용하려고 할 때 titlesec
오류를 발생시키는 패키지가 포함되어 있습니다 .! Package titlesec Error: Not allowed in 'easy' settings.
book
sectsty
편집: 다른 곳에서 서식을 방해하고 솔루션을 doublespacing
사용하는 것과 다르게 상호 작용하기 때문에 내 요구 사항에 적합하지 않은 것으로 나타났습니다 titlesec
. 예를 들어,
\documentclass[12pt,oneside]{book}
\usepackage{lipsum}
\setcounter{secnumdepth}{3}
\usepackage{sectsty}
\usepackage{setspace} % set double vs single spacing
\allsectionsfont{\singlespacing}
\begin{document}
\doublespacing
\chapter{Singlespace titles, doublespace text.}
\section{Section headers should \\also be single-spaced}
\subsubsection{The \texttt{sectsty} package interacts with \texttt{doublespacing}, adds too much space below this header}
\paragraph{The \texttt{sectsty} package causes this paragraph to be indented}
\lipsum[4]
\end{document}
답변1
setspace
( 패키지를 로드한 후) 문서의 서문에 다음 지침을 추가할 수 있습니다 .
\usepackage{sectsty}
\allsectionsfont{\singlespacing}
전체 MWE(최소 작업 예):
\documentclass[12pt,oneside]{book}
\usepackage{lipsum} % for filler text
\usepackage{setspace}
\doublespacing
\usepackage{sectsty}
\allsectionsfont{\singlespacing}
\begin{document}
\chapter{I need singlespace titles, doublespace text.}
\section{Section headers should also be single-spaced, but I could adjust titles to fit on one line}
\lipsum[4] % filler text
\end{document}
답변2
관련 질문패키지를 사용하는 섹션 제목에 대한 솔루션이 있습니다 titlesec
. 그러나 이 답변을 복사하여 장 제목에 대해 순진하게 수정하면 오류가 발생합니다 ! Package titlesec Error: Not allowed in 'easy' settings
. 오류가 발생하는 이유는titlesec 패키지는 섹션과 챕터에서 약간 다르게 작동합니다.. 패키지 를 사용하는 단일 공백 장 및 섹션 헤더에 대한 주문 titlesec
은 다음과 같습니다.
\usepackage{titlesec}
\titleformat{\chapter}[display]{\normalfont\huge\bfseries\singlespacing}{\chaptertitlename\ \thechapter}{40pt}{\huge}
\titleformat{\section}{\singlespacing\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\singlespacing\normalfont\large\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}{\singlespacing\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{}