![如何在将此代码应用到参考列表之前结束此代码?](https://linux22.com/image/356260/%E5%A6%82%E4%BD%95%E5%9C%A8%E5%B0%86%E6%AD%A4%E4%BB%A3%E7%A0%81%E5%BA%94%E7%94%A8%E5%88%B0%E5%8F%82%E8%80%83%E5%88%97%E8%A1%A8%E4%B9%8B%E5%89%8D%E7%BB%93%E6%9D%9F%E6%AD%A4%E4%BB%A3%E7%A0%81%EF%BC%9F.png)
我使用此代码使章节标题位于单页中而不显示页码
\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}