수평선, 번호 매기기, 색상 등이 있는 장 섹션 = 논문 템플릿의 악몽

수평선, 번호 매기기, 색상 등이 있는 장 섹션 = 논문 템플릿의 악몽

나는 매우 끔찍한 석사 논문 템플릿과 싸우고 있습니다. 일부 smart _ss는 수동 수정 없이는 MS Word에서 수행할 수 없는 일부 기능을 설계했기 때문에 해킹하기 위해 LaTeX에서 작동하도록 만들려고 합니다.

다음은 몇 가지 거래 중단 사항입니다. 논문 템플릿 미리보기

장 형식 - Times New Roman, 14pt, 빨간색(장 번호 포함), 대문자로 시작, 짝수 페이지는 오른쪽에 줄, 홀수 페이지는 왼쪽 줄에 장 번호 표시.

섹션 형식 - Times New Roman, 12pt, 짝수 페이지는 오른쪽에 줄이 있고 홀수 페이지는 왼쪽 줄이 있으며 섹션 번호가 표시됩니다.

하위 섹션과 동일합니다.

머리글과 바닥글에는 홀수/짝수 페이지에 대해 페이지 번호가 다른 컬러 라인이 있습니다.

나는 과거에 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} 

여기에 이미지 설명을 입력하세요

관련 정보