字体大小和字体样式

字体大小和字体样式

我想为第 1 章及其名称设置不同的字体大小。这意味着第 1 章的字体大小假设为 17,其名称的简介大小假设为 25。我无法做到这一点

\newcommand{\chaptersize}{\fontsize{25}{12}\selectfont}

以下是一些代码

\documentclass[a4paper,12pt,twoside,openright]{report}
%\usepackage[dvips]{color}
%\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage{setspace}
\usepackage[top=2.5cm,bottom=2.5cm,left=3.5cm,right=2.5cm,includefoot,asymmetric]{geometry}
\usepackage[centertags]{amsmath}
%\usepackage{amsfonts}
\usepackage{amssymb}
%\usepackage{amsthm}
%\usepackage{newlfont}
%\usepackage{epsf}
\usepackage{algorithmic}
\usepackage{algorithm}
\usepackage{xthesis}
\usepackage{xtocinc} %Include Table of Contents as the first entry in TOC
%
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage[section,subsection,subsubsection]{extraplaceins}
\usepackage{longtable}
%\usepackage{url}
\usepackage{verbatim}
\usepackage[parfill]{parskip}
\usepackage{fancyhdr}
\pagestyle{fancy} \lhead{} \chead{} \rhead{} \lfoot{}
\cfoot{\thepage} \rfoot{}
%\usepackage[utf8]{inputenc}
\usepackage[backend=biber,authordate]{biblatex-chicago}
\makeatletter
\AtEveryBibitem{%
  \global\undef\bbx@lasthash%
  \clearfield{extrayear}}
\makeatother
 \addbibresource{Xbib.bib}
\DeclareFieldFormat[article]{title}{\mkbibquote{#1}} % make article titles in quotes
\DeclareFieldFormat[thesis]{title}{\mkbibemph{#1}} % make theses italics
  \newenvironment{changemargin}[1]{
  \begin{list}{}{
    \setlength{\voffset}{#1}
  }
  \item[]}{\end{list}}
\makeatother

%\newcommand{\red}[1] {\textcolor{red}{#1}}
%\newcommand{\blue}[1] {\textcolor{blue}{#1}}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{claim}{claim}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{exmp}{Example}[section]
\newtheorem{cor}{Corollary}[section]
\newtheorem{fact}{Fact}[section]
\newtheorem{prop}{Property}[section]
\newtheorem{assume}{Assumption}[section]
\newtheorem{definition}{Definition}[section]
\newtheorem{invariant}{Invariant}[section]
\newtheorem{con}{Conjecture}[section]
\newtheorem{open}{Problem}[section]
\newcommand{\chaptersize}{\fontsize{25}{12}\selectfont}

\def\insert{\mbox{\rm insert}}
\def\rotate{\mbox{\rm rotate}}
\def\op{\mbox{\rm op}}
\def\Proof{\noindent {\bf Proof.\ \ }}
\def\Remark{{\bf Remark.\ \ }}\def\ex{{\rm ex}}

\def\qed{\ifhmode
\unskip\nobreak\hfill\vrule height5pt width4pt depth2pt\medskip\fi
\ifmmode\eqno{\vrule height5pt width4pt depth2pt}\fi}
\def\qed{\ifhmode\unskip\nobreak\fi\quad\ifmmode\Box\else$\Box$\fi}



%\hoffset=.2in
%\voffset=-.02in
%\textwidth=390pt


\begin{document}
\singlespacing
%\thispagestyle{empty}

%\setlength{\textheight}{297mm}
%\setlength{\oddsidemargin}{-6mm}
%\setlength{\textwidth}{210mm}
%\setlength{\oddsidemargin}{35mm}
%\setlength{\evensidemargin}{35mm}
%\setlength{\topmargin}{25mm}
%\setlength{\footskip}{25mm}
%\listoftables
%\listoffigures
\phd
\title{ }


%\{Thesis Document}
\dedicate{ }

\author{ }

%\superviser{}

{
\typeout{:?000000000} % Don't bother with over/under-full boxes
\beforepreface
\typeout{:?111111111} % Process All Errors from Here on
}
% ------------------------------------------------------------------------
%\include{Abs}
%\include{Ack}

%\tableofcontents
% ------------------------------------------------------------------------
%\listoftables
% ------------------------------------------------------------------------
%\listoffigures
% ------------------------------------------------------------------------
{\typeout{Publications}
\include{Pub}
}
{\typeout{Nomenclature}
\include{NOM}
}
% ------------------------------------------------------------------------
\afterpreface
%\def\baselinestretch{1}
\printbibliography
\end{document}

这就是完整的代码

答案1

内部的重新定义\@makechapterhead

\documentclass[a4paper,12pt,twoside,openright]{report}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}%% Instead of times which is obsolete
\makeatletter
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \fontsize{17}{18}\fontseries{b}\selectfont
         Chapter~\thechapter\quad%%%%  Or \par instead of \quad
    \fi
    \fontsize{25}{26}\fontseries{b}\selectfont#1\par\nobreak%%%
    \vskip 40\p@
  }}
\makeatother

\begin{document}
\chapter{foo}
\section{bar}
baz
\end{document}

在此处输入图片描述

相关内容