更改编号样式(章节和章节)

更改编号样式(章节和章节)

我想更改章节号的样式。特别是我想使用经典论文的样式。我该怎么做?

\documentclass[twoside,10pt,b5paper]{book}

\raggedbottom

\usepackage[dvips=false,pdftex=false,vtex=false]{geometry}
\usepackage{changepage}

\usepackage[a4,center]{crop}
\usepackage[toc,page]{appendix}
\geometry{%
   includeheadfoot,
   margin=1.8cm,
   bmargin=1.4cm
}

\usepackage{soul}

\usepackage{pgfkeys}

\usepackage{tikz,tikz-cd}

\usepackage{enumitem}

\usetikzlibrary{calc}

\usepackage{textcomp, gensymb}

\usepackage{amsthm,amssymb,amsfonts,mathrsfs}

\usepackage[T1]{fontenc}

\usepackage[utf8]{inputenc}

\usepackage[english,italian]{babel}

\usepackage[babel]{csquotes}

\usepackage[backend=biber,style=alphabetic,sorting=ynt]{biblatex}

\addbibresource{FrontBackmatter/Bibliography.bib}

\definecolor{indigo(dye)}{rgb}{0.0, 0.25, 0.42}
\usepackage[colorlinks = true,
        linkcolor = indigo(dye),
        filecolor=black,
        urlcolor  = black!40!cyan,
        citecolor = indigo(dye),
        anchorcolor = red!60!black]{hyperref}
\hypersetup{linktocpage}
\usepackage{tcolorbox}

\usepackage[pagestyles, clearempty,explicit]{titlesec}

\usepackage{fancyhdr}

\usepackage{anyfontsize}

\usepackage{palatino,eulervm}

\usepackage[protrusion=true,expansion]{microtype}

\usepackage{eqparbox}

\usepackage[titles]{tocloft}
\usepackage[nottoc,numbib]{tocbibind} %per il TOC

\usepackage{graphicx}
\def\chk#1{#1^{\smash{\scalebox{.7}[1.4]{\rotatebox{90} 
{\guilsinglleft}}}}}

\usepackage[nodisplayskipstretch]{setspace}

\makeatletter               
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
                \thispagestyle{empty}%
                \global\@topnum\z@
                \@afterindentfalse
                \secdef\@chapter\@schapter}
\makeatother

\titleformat{\section}[display]{\fontsize{10.8}{0} \bfseries}{}{0pt} 
{\colorbox{black!15!white}{\parbox{\dimexpr\textwidth-2\fboxsep\relax} 
{\textcolor{black}{\thesection\quad#1}}}}[]
\titlespacing*{\section}{-0.8cm}{0.4cm}{0.2cm}[0pt]

\newtcbox{\mybox}{colback=red!5!white,colframe=red!75!black}


\pagestyle{fancy}
\fancyhf{}
\fancyhead[RE]{\small \leftmark}
\fancyhead[RO]{\thepage}
\fancyhead[LE]{\thepage}
\fancyhead[LO]{\small \rightmark}
\renewcommand{\headrulewidth}{0.5pt}


\begin{document}
\chapter{A chapter}
\section{A section}
\end{document}

我希望这些数字和图片中的一样。在此处输入图片描述

答案1

你想要的就是这样的东西吗?我不得不改用palatinonewpx它使用 TeX-Gyre Pagella(Palatino 克隆)在文本中使用旧式数字,并使用 格式化 \ chapter titlesec

\documentclass[twoside,10pt,b5paper, svgnames]{book}

\raggedbottom

\usepackage[dvips=false,pdftex=false,vtex=false]{geometry}
%\usepackage{changepage}

\geometry{%
   includeheadfoot,
   margin=1.8cm,
   bmargin=1.4cm
}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,italian]{babel}
\usepackage[babel]{csquotes}

\usepackage{tcolorbox}

\usepackage[pagestyles, clearempty,explicit]{titlesec}

\usepackage{fancyhdr}

\usepackage{eulervm}
\usepackage[osf]{newpxtext}
\usepackage{newpxmath}

\usepackage[protrusion=true, expansion]{microtype}

\usepackage[nodisplayskipstretch]{setspace}

\titleformat{\chapter}[display]{\bfseries\filright}{\huge\chaptername\enspace{\color{Gainsboro}\scalebox{2.5}{\thechapter}}}{4ex}{\Huge #1}

\titleformat{\section}[display]{\fontsize{10.8}{0} \bfseries}{}{0pt}
{\colorbox{black!15!white}{\parbox{\dimexpr\textwidth-2\fboxsep\relax}
{\textcolor{black}{\thesection\quad#1}}}}[]
\titlespacing*{\section}{-0.8cm}{0.4cm}{0.2cm}[0pt]

\newtcbox{\mybox}{colback=red!5!white,colframe=red!75!black}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[RE]{\small \leftmark}
\fancyhead[RO]{\thepage}
\fancyhead[LE]{\thepage}
\fancyhead[LO]{\small \rightmark}
\renewcommand{\headrulewidth}{0.5pt}

\usepackage{lipsum}

\begin{document}
\setcounter{chapter}{2}

\chapter{A chapter}

\section{A section}
\lipsum

\end{document} 

在此处输入图片描述

相关内容