我使用此代码使章节标题位于单页中而不显示页码
\assignpagestyle{\chapter}{empty}
\titleformat{\chapter}[display]{\thispagestyle{empty}\sffamily\bfseries\Huge\centering}{\thechapter}{1em}{\textls[40]}[\clearpage]
\titleformat{\chapter}
[display]
{\centering\Huge\bfseries}
{\chaptername\ \thechapter}
{12pt}
{\Large}
[\clearpage]{}
但当实施应用于所有时,我只应用于章节。问题应用于参考文献并将其暴露在一页上。
我怎样才能在将代码应用到参考列表之前完成它
例如
\documentclass[12pt,twoside]{report}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{lipsum} % dummy text
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[RO,LE]{\small\leftmark }
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{ {images/} }
\usepackage{titlesec}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\assignpagestyle{\chapter}{empty}
\titleformat{\chapter}[display]{\thispagestyle{empty}\sffamily\bfseries\Huge\centering}{\thechapter}{1em}{\textls[40]}[\clearpage]
\titleformat{\chapter}
[display]
{\centering\Huge\bfseries}
{\chaptername\ \thechapter}
{12pt}
{\Large}
[\clearpage]{}
\begin{document}
simple example
\chapter{ch1}
\chapter{ch2}
% RESULTS
%\input{include/Results}
% CONCLUSION
%\input{include/Conclusion}
% REFERENCES / BIBLIOGRAPHY
\cleardoublepage
\addcontentsline{toc}{chapter}{Bibliography}
%\input{include/backmatter/References}
% APPENDICES
\cleardoublepage
\appendix
\setcounter{page}{1}
\pagenumbering{Roman} % Capitalized roman numbering starting from I (one)
%\input{include/backmatter/Appendix_1}
\end{document}
该代码仅适用于章节标题
答案1
您还可以使用numberless
键对未编号的章节设置不同的格式:
\titleformat{name=\chapter,numberless}[block]
{\filcenter\Large\bfseries}
{}
{0pt}
{}
注意此命令可以在文档正文中使用。
答案2
我用过\begin{titlepage}
\end{titlepage}
并成功了
\documentclass[12pt,twoside]{report}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{lipsum} % dummy text
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[RO,LE]{\small\leftmark }
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{ {images/} }
\usepackage{titlesec}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
simple example
\begin{titlepage}
\assignpagestyle{\chapter}{empty}
\titleformat{\chapter}[display]{\thispagestyle{empty}\sffamily\bfseries\Huge\centering}{\thechapter}{1em}{\textls[40]}[\clearpage]
\titleformat{\chapter}
[display]
{\centering\Huge\bfseries}
{\chaptername\ \thechapter}
{12pt}
{\Large}
[\clearpage]{}
\chapter{ch1}
\chapter{ch2}
\end{titlepage}
% RESULTS
%\input{include/Results}
% CONCLUSION
%\input{include/Conclusion}
% REFERENCES / BIBLIOGRAPHY
\cleardoublepage
\addcontentsline{toc}{chapter}{Bibliography}
%\input{include/backmatter/References}
% APPENDICES
\cleardoublepage
\appendix
\setcounter{page}{1}
\pagenumbering{Roman} % Capitalized roman numbering starting from I (one)
%\input{include/backmatter/Appendix_1}
\end{document}