帶有水平線、編號和顏色等的章節部分 = 論文模板噩夢

帶有水平線、編號和顏色等的章節部分 = 論文模板噩夢

我正在與一個非常可怕的碩士論文範本作鬥爭。一些聰明的 _ss 設計了一些功能,如果沒有手動修正,MS Word 中無法完成,所以我試著讓它在 LaTeX 中工作來破解它。

以下是一些破壞交易的因素: 論文模板預覽

章節格式 - Times New Roman,14pt,紅色(含章節編號),大寫,偶數頁右側有線條,奇數頁左側有線條並有章節編號。

章節格式 - Times New Roman,12 磅,偶數頁右側有線條,奇數頁左側有線條,並有章節編號。

與小節相同。

標題和頁腳有彩色線,奇數/偶數頁的頁碼不同。

我過去曾使用過 LaTeX,並且擁有相當不錯的 LaTeX 知識,但這完全超出了我的技能範圍。有人可以幫我定義那些破壞交易的人嗎?

答案1

這是切片指令佈局的一種方式titlesec

\documentclass[a4paper]{report}% http://ctan.org/pkg/amsproc
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[x11names,]{xcolor}
\usepackage{fourier}
\usepackage{microtype}
\SetTracking[no ligatures={f}]{encoding=*}{80}
\usepackage[strict]{changepage}%
 \usepackage{lipsum}

\usepackage[explicit]{titlesec}%

\titleformat{\chapter}[hang]
{\bfseries\fontsize{14pt}{14pt}\selectfont\color{IndianRed3}\lsstyle}
{\checkoddpage\ifoddpage\llap{\makebox[\dimexpr\marginparsep+\marginparwidth\relax][l]{\rule[-1.25ex]{\marginparwidth}{0.5ex}\llap{\thechapter}}}\else\thechapter\enspace \fi}
{0pt}
{\MakeUppercase{#1}\checkoddpage\ifoddpage\else\hfill\rlap{\makebox[\dimexpr\textwidth + \marginparsep][l]{\hspace{\marginparsep}\rlap{\rule[-1.25ex]{\marginparwidth}{0.5ex}}\thechapter}}\fi}%\titlerule[1.5pt]
\titlespacing*{\chapter}{0pt}{2ex}{1ex}
%
\titleformat{\section}
{\bfseries\large}
{\checkoddpage\ifoddpage\llap{\makebox[\dimexpr\marginparsep+\marginparwidth\relax][l]{\rule[-1.25ex]{\marginparwidth}{0.5ex}\llap{\thesection}}}\else\thesection\enspace \fi}
{0pt}
{#1\checkoddpage\ifoddpage\else\hfill\rlap{\makebox[\dimexpr\textwidth + \marginparsep][l]{\hspace{\marginparsep}\rlap{\smash{\rule[-1.25ex]{\marginparwidth}{0.5ex}}}\thesection}}\fi}%\titlerule[1.5pt]
\titlespacing*{\section}{0pt}{1ex}{0.5ex}

\titleformat{\subsection}
{\bfseries}
{\checkoddpage\ifoddpage\llap{\makebox[\dimexpr\marginparsep+\marginparwidth\relax][l]{\rule[-1.25ex]{\marginparwidth}{0.5ex}\llap{\thesubsection}}}\else\thesubsection\enspace \fi}
{0pt}
{#1\checkoddpage\ifoddpage\else\hfill\rlap{\makebox[\dimexpr\textwidth + \marginparsep][l]{\hspace{\marginparsep}\rlap{\smash{\rule[-1.25ex]{\marginparwidth}{0.5ex}}}\thesubsection}}\fi} \titlespacing*{\subsection}{0pt}{1ex}{0.5ex}

\begin{document}

\chapter{Introduction}

\lipsum[1]

\section{Motivation}
\lipsum[2]

\subsection{A First Motivation}

\lipsum[3]
\newpage

\chapter{Introduction}

\lipsum[1]

\section{Motivation}
\lipsum[2]

\subsection{A First Motivation}

\lipsum[3]

\end{document} 

在此輸入影像描述

相關內容