![更改章节标题页上的章节编号和“章节”字样的位置](https://linux22.com/image/452471/%E6%9B%B4%E6%94%B9%E7%AB%A0%E8%8A%82%E6%A0%87%E9%A2%98%E9%A1%B5%E4%B8%8A%E7%9A%84%E7%AB%A0%E8%8A%82%E7%BC%96%E5%8F%B7%E5%92%8C%E2%80%9C%E7%AB%A0%E8%8A%82%E2%80%9D%E5%AD%97%E6%A0%B7%E7%9A%84%E4%BD%8D%E7%BD%AE.png)
我正在用 Latex 写论文,想创建一个漂亮的章节标题页。我想将章节号和单词 chapter 放在右侧,稍微与我在底部插入的图像重叠。此外,我想增加章节号和单词 chapter 的大小。我希望章节标题保持原样。此外,我希望将虚拟文本放置在章节标题下方。我尝试了很多次,但似乎无法弄清楚这是如何工作的。
请参阅下面的我的 MWE。如能得到任何帮助,我将不胜感激!
梅威瑟:
\documentclass[a4paper, twoside, 12pt, final]{report}
\usepackage[utf8]{inputenc}
% custom section headers
\RequirePackage{titlesec}
\usepackage{tikz}
\usepackage{lipsum}
% I added this
\RequirePackage{color}
\definecolor{RoyalRed}{RGB}{157,16, 45}
\titleformat{\chapter}[display]
{ \normalsize \LARGE \color{black}} {\tikz[remember picture,overlay] \node[opacity=0.9,inner sep=0pt,anchor=south] at (current page.south){\includegraphics[width=\paperwidth,height=10cm]{blue.jpg}};
\flushright \large \color{RoyalRed} \MakeUppercase { \chaptertitlename}%
\rlap{ \resizebox{!}{1.5cm}{\thechapter}}
}
{10pt}{\bfseries\huge}
\titlespacing*{\chapter}{0pt}{-70pt}{180pt}
\begin{document}
\chapter{Introduction}
\lipsum[2]
\end{document}
答案1
尝试此代码。(我知道该图位于页面顶部。)
使用 更改单词 chapter 和章节号的字体大小。使用和\fontsize{<size>}{<skip>}
修改它们的位置xshift
yshift
也 \titlespacing*{\chapter}{<space left>}{<space above>}{<space below>}
适用于章节标题。
\documentclass[a4paper, twoside, 12pt, final]{report}
\usepackage[utf8]{inputenc}
% custom section headers
\RequirePackage{titlesec}
\usepackage{tikz}
\usetikzlibrary{positioning} % added <<<<<<<<<<<<<
\usepackage{anyfontsize} % added to change fonts with pdflatex <<<<<<<<<<<<<
\usepackage{lipsum}
\RequirePackage{xcolor}
\definecolor{RoyalRed}{RGB}{157,16, 45}
\newcommand{\ChapLabel}{\fontsize{36pt}{44pt}\selectfont \color{RoyalRed} \MakeUppercase{\chaptertitlename}}% set the word Chapter
\newcommand{\ChapNum}{\fontsize{120pt}{144pt}\selectfont \color{RoyalRed} \thechapter}% set the chapter number
\newcommand{\MakeChap}{\ChapLabel\enspace\ChapNum}
\titleformat{\chapter}[display]
{ \normalsize \LARGE \color{black}} {%
\begin{tikzpicture}[remember picture,overlay]
\node(blue)[opacity=0.9,inner sep=0pt,anchor=north] at (current page.north){\includegraphics[width=\paperwidth,height=10cm]{blue.jpg}};
\node [below= of blue.south east, anchor=base east, xshift=-\marginparsep, yshift=-1ex] {\MakeChap};
\end{tikzpicture}}
{10pt}{\bfseries\huge}
\titlespacing*{\chapter}{0pt}{170pt}{20pt} % changed <<<<<<<<<<<<<<
\begin{document}
\chapter{Introduction}
\lipsum[2-8]
\end{document}
更新回答后续问题后。(底部有图片和字幕。)
用于\Schapter{<chapter title>}{<subtitle>}
添加字幕。
% !TeX TS-program = pdflatex
\documentclass[a4paper, twoside, 12pt, final]{report}
\usepackage[utf8]{inputenc}
% custom section headers
\RequirePackage{titlesec}
\usepackage{tikz}
\usetikzlibrary{positioning} % added <<<<<<<<<<<<<
\usepackage{anyfontsize} % added for change fonts with pdflatex <<<<<<<<<<<<<
\usepackage{fancyhdr} % added <<<<<<<<<<<<<
\fancypagestyle{plain}{% style plain >>> empty for chapter page
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\usepackage{lipsum}
\RequirePackage{xcolor}
\definecolor{RoyalRed}{RGB}{157,16, 45}
\newcommand{\ChapLabel}{\fontsize{30pt}{36pt}\selectfont \color{RoyalRed}\sffamily \MakeUppercase{\chaptertitlename}}% set the word Chapter
\newcommand{\ChapNum}{\fontsize{120pt}{144pt}\selectfont \color{RoyalRed}\sffamily \thechapter}% set the chapter number
\newcommand{\MakeChap}{\vspace*{10cm}\ChapLabel\enspace\ChapNum}
\titleformat{\chapter}[display]
{ \normalsize \LARGE \color{black}} {%
\enlargethispage{-7cm}
\begin{figure}[b]%
\begin{tikzpicture}[remember picture,overlay]
\node(blue)[opacity=0.9,inner sep=0pt,anchor=south] at (current page.south){\includegraphics[width=\paperwidth,height=10cm]{blue.jpg}};
\node (chap) [above= of blue.north east, anchor=south east, xshift=-\marginparsep-\marginparwidth-30pt, yshift=-4ex] {\ChapLabel};
\node [right= of chap.south east, anchor=base west, xshift= -\marginparwidth+12ex, yshift=-6ex] {\ChapNum};
\end{tikzpicture}
\end{figure}}
{10pt}{\bfseries\huge}
\titlespacing*{\chapter}{0pt}{-30pt}{20pt} % changed <<<<<<<<<<<<<<
\newcommand{\Schapter}[2]{\chapter[#1]{#1\\[1ex] \parbox{0.7\linewidth}{\large#2}}}% add subtitles <<<<<<<<<<<<<<<
\begin{document}
\Schapter{Introduction}{Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus}
\lipsum[2-8]
\end{document}
答案2
据我了解,这就是你想要的:
\documentclass[a4paper, twoside, 12pt, final]{report}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage{xcolor}
\definecolor{RoyalRed}{RGB}{157,16, 45}
\makeatletter
\def\@chapter[#1]#2{
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi\clearpage}
\def\@makechapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@}
{\normalfont\normalsize\lipsum[2]}
\tikz[remember picture,overlay]{\node[opacity=0.9,inner sep=0pt,anchor=south] at (current page.south){\includegraphics[width=\paperwidth,height=10cm]{blue.jpg}};}\par%
{\ifnum \c@secnumdepth >\m@ne
\vskip 4.2cm\flushright\Huge\color{RoyalRed} \MakeUppercase{\@chapapp}\space%
\rlap{\scalebox{5}{\thechapter}}
\par\nobreak
\fi}
}
\makeatother
\begin{document}
\chapter{Introduction}
\lipsum[1]
\end{document}