\documentclass[openany, 10pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[MeX]{polski}
\usepackage{titleps}
\usepackage{lipsum}
\usepackage{tocloft}
\renewcommand\cftchapaftersnum{.}% adds dot after chapter title in ToC
\renewcommand\cftchapdotsep{\cftdotsep}% adds leader dots from chapter titles to page numbers
\frenchspacing
\usepackage{pstcol}
\makeatletter
\def\LigneVerticale{\vrule height 5cm depth 2cm\hspace{0.1cm}\relax}
\def\LignesVerticales{
\let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV}
\def\GrosCarreAvecUnChiffre#1{%
\rlap{\vrule height 0.8cm width 1cm depth 0.2cm}%
\rlap{\hbox to 1cm{\hss\mbox{\white #1}\hss}}%
\vrule height 0pt width 1cm depth 0pt}
\def\@makechapterhead#1{\hbox{%
\Huge
\LignesVerticales
\hspace{-0.5cm}%
\GrosCarreAvecUnChiffre{\thechapter.}% the final dot adds a dor after the chapter number in the document
\hspace{0.2cm}\hbox{#1}%
\renewcommand\numberline[1]{#1.\hskip0.7em}
}\par\vskip 2cm}
\def\@makeschapterhead#1{\hbox{%
\Huge
\LignesVerticales
%\hspace{0.5cm}%
\hbox{#1}%
}\par\vskip 2cm}
\begin{document}
\chapter{Much too long chapter title with linebreak}
\lipsum[1-10]
\end{document}
안녕하세요,
내 문제는 장이 페이지의 텍스트에 맞지 않는다는 것입니다. 나는 다음과 같은 많은 것을 시도했습니다.
\보호하다
가능하다면 장 제목(ToC, 장, 헤더)에서 줄 바꿈을 만드는 방법(강제)은 무엇입니까?
페이지 크기에 맞게 장 제목을 만드는 방법은 무엇입니까?
답변1
의 정의에서 제목이 조판될 을 적절한 길이의 로 바꾸십시오 \@makechapterhead
.\@makeschapterhead
\hbox
\parbox
\documentclass[openany, 10pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[MeX]{polski}
\usepackage{titleps}
\usepackage{lipsum}
\usepackage{tocloft}
\renewcommand\cftchapaftersnum{.}% adds dot after chapter title in ToC
\renewcommand\cftchapdotsep{\cftdotsep}% adds leader dots from chapter titles to page numbers
\frenchspacing
\usepackage{pstcol}
\makeatletter
\def\LigneVerticale{\vrule height 5cm depth 2cm\hspace{0.1cm}\relax}
\def\LignesVerticales{
\let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV}
\def\GrosCarreAvecUnChiffre#1{%
\rlap{\vrule height 0.8cm width 1cm depth 0.2cm}%
\rlap{\hbox to 1cm{\hss\mbox{\white #1}\hss}}%
\vrule height 0pt width 1cm depth 0pt}
\def\@makechapterhead#1{\hbox{%
\Huge
\LignesVerticales
\hspace{-0.5cm}%
\GrosCarreAvecUnChiffre{\thechapter.}% the final dot adds a dor after the chapter number in the document
\hspace{0.2cm}\parbox[t]{\dimexpr\linewidth-2.2cm\relax}{\raggedright#1}%
\renewcommand\numberline[1]{#1.\hskip0.7em}
}\par\vskip 2cm}
\def\@makeschapterhead#1{\hbox{%
\Huge
\LignesVerticales
%\hspace{0.5cm}%
\parbox[t]{\dimexpr\linewidth-1.6cm\relax}{\raggedright#1}%
}\par\vskip 2cm}
\begin{document}
\chapter[A test chapter]{A Test Numbered Chapter with a Really Really Long Title}
\lipsum[1-10]
\end{document}