左侧为章节部分,右侧为章节标题

左侧为章节部分,右侧为章节标题

在报告文档中,我如何才能实现这样的目标?

在此处输入图片描述

页面左侧为章节,右侧为章节标题

\documentclass{report}
\usepackage{graphicx}
\usepackage{ragged2e} 
\usepackage{sectsty}
\usepackage{tabularx}
\usepackage{caption}
\usepackage[table,dvipsname]{xcolor}% http://ctan.org/pkg/xcolor
\usepackage[flushleft]{threeparttable}
\usepackage{titlesec}
\usepackage{minitoc} 
\usepackage{titlecaps}

%%%%%%%% FOR TESTING %%%%%%%%%%%%%
\usepackage[english]{babel}
\usepackage{blindtext}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Initializing Minitoc
\dominitoc[n]
\nomtcpagenumbers

\titleformat{\chapter}[display]{}{\normalfont\Large\scshape\titlecap{\chaptertitlename}\enspace\scalebox{1.8}{\thechapter}\filright} {8ex}{\Huge\bfseries\sffamily\filleft}[{\titlerule[1pt]}] 

\titlespacing*{\chapter}{0pt}{30pt}{20pt}

\begin{document}

    \tableofcontents


    \chapter{A}
    \label{Chap.A}

    \minitoc 

    \section{A.1}
    \label{A:sec:1}

    Wubba lubba dub dub.

    \section{A.2}
    \label{A:sec:2}
    \blindtext

    \newpage

    \chapter{B}
    \label{Chap.B}

    \minitoc 

    \section{B.1}
    \label{B:sec:1}
    \Blindtext

    \section{B.2}
    \label{B:sec:2}
    \blindtext

\end{document}

答案1

\documentclass{report}
\usepackage{graphicx}
\usepackage{ragged2e} 
\usepackage{sectsty}
\usepackage{tabularx}
\usepackage{caption}
\usepackage[table,dvipsname]{xcolor}% http://ctan.org/pkg/xcolor
\usepackage[flushleft]{threeparttable}
\usepackage{titlesec}
\usepackage{minitoc} 
\usepackage{titlecaps}

%%%%%%%% FOR TESTING %%%%%%%%%%%%%
\usepackage[english]{babel}
\usepackage{blindtext}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Initializing Minitoc
\dominitoc[n]
\nomtcpagenumbers

\titleformat{\chapter}[display]{}{\normalfont\Large\scshape\bfseries\underline{\titlecap{\chaptertitlename}\enspace\scalebox{1.8}{\thechapter}\filright}} {8ex}{\Huge\bfseries\sffamily\filleft}

\titlespacing*{\chapter}{0pt}{30pt}{20pt}

\begin{document}

    \tableofcontents


    \chapter{A}
    \label{Chap.A}

    \minitoc 

    \section{A.1}
    \label{A:sec:1}

    Wubba lubba dub dub.

    \section{A.2}
    \label{A:sec:2}
    \blindtext

    \newpage

    \chapter{B}
    \label{Chap.B}

    \minitoc 

    \section{B.1}
    \label{B:sec:1}
    \Blindtext

    \section{B.2}
    \label{B:sec:2}
    \blindtext

\end{document}
  • 删除[{\titlerule[1pt]}]将删除该行
  • 只需添加其他命令\underline\bfseries使您的文本变为粗体或带下划线。

在此处输入图片描述

相关内容