我在配置论文时遇到了一些问题。我使用了一些.cls
来自网络的文件模板,尝试自己配置,但失败了。
因此问题列表如下:
- 两个标题页的页面布局不一样。
- 我需要在目录后配置页眉和页脚(添加虚线)。尝试使用
fancyhdr
但失败了。通过使用包{tocloft}解决了
有.cls
和 的代码.tex
。(已编辑)
下次更新:在对页面布局进行操作后,我得出结论,问题是由于\tableofcontents
。Fancyhdr 仅在之前有效\tableofcontents
。对页面布局进行操作不会对包含内容的页面产生影响。已解决
下次更新:仍有 1 个问题。我发现内部\newenvironment
和外部布局之间存在一些冲突。这就是问题所在。我尝试制作\newenvironment
标题页,但存在一些冲突\textheight
。在目录之前,我有 4 页。第 2 页和第 3 页包含\textheight
来自\newenvironment
,第 1 页和第 4 页包含\textheight
一般文本.... 有什么想法吗?
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{minimovka}[2000/07/21 v1.0 final disser class]
\LoadClass[a4paper]{report}
\RequirePackage{ifthen}
\renewcommand{\normalsize}{\fontsize{12}{18}\selectfont}
\setlength{\topmargin}{-0.62in}
\setlength{\oddsidemargin}{0.38in}
\setlength{\evensidemargin}{0.38in}
\setlength{\headheight}{0.4in}
\setlength{\headsep}{0.2in}
\setlength{\footskip}{0.4in}
\setlength{\textwidth}{5.98in} \setlength{\textheight}{9.37in}
\setlength{\parindent}{0.4in}
\newcommand{\affiliation}[2]{\newcommand{\@affiliation}
{\fontsize{16}{19}\begin{center}\bf #1\\ \bf #2\end{center}}}
%\newcommand{\UDK}[1]{\newcommand{\@UDK}{UDK #1}}
%\newcommand{\CODESPEC}[2]{\newcommand{\@CODESPEC}{#1\,-\,#2}}
\newcommand{\Distitle}[1]{\newcommand{\@Distitle}
{\fontsize{14}{14}\begin{center}\bf #1 \end{center}}}
\newcommand{\Subdistitle}[1]{\newcommand{\@Subdistitle}
{\fontsize{12}{12}\begin{center} #1 \end{center}}}
%{\fontsize{14}{28}\begin{center}\bf #1\end{center}}}
\newcommand{\Year}[1]{\newcommand{\@Year}
{\fontsize{12}{12} \bf #1}}
\newcommand{\Disauthor}[1]{\newcommand{\@Disauthor}
{\fontsize{12}{12} \bf #1}}
\newcommand{\Studprogram}[1]{\newcommand{\@Studprogram}
{ #1}}
\newcommand{\Studspec}[1]{\newcommand{\@Studspec}
{ #1}}
\newcommand{\Chair}[1]{\newcommand{\@Chair}
{ #1}}
\newcommand{\Supervisor}[1]{\newcommand{\@Supervisor}
{ #1}}
\newcommand{\Consulter}[1]{\newcommand{\@Consulter}
{ #1}}
\newcommand{\City}[1]{\newcommand{\@City}
{\fontsize{12}{12} \bf #1}}
\newenvironment{front}
{\pagestyle{fancy}\fancyhf{}
\renewcommand{\headrulewidth}{0.0pt}
\renewcommand{\footrulewidth}{0.0pt}
\setlength{\topmargin}{-0.61in}
\setlength\evensidemargin{-0.61in}
\setlength\oddsidemargin{-0.21in}
\setlength{\textheight}{9.88in}
\setlength{\textwidth}{6.8in}
\setlength{\headheight}{0.4in}
\setlength{\headsep}{0.2in}
\setlength{\topskip}{0.0in}
\setlength{\footskip}{0.4in}
\setlength{\parskip}{0.0in}
}
\renewcommand{\maketitle}
{%
\begin{front}
%\normalsize
\@affiliation
\vspace{2in}
\@Distitle
\vspace{1in}
\@Subdistitle
\vfill
\begin{flushleft}
\@Year\\ \@Disauthor
\end{flushleft}
%second page
\newpage
\@affiliation
\vspace{1.5in}
\@Distitle
\vspace{1in}
{\bf \@Subdistitle}
\vspace{1in}
{\fontsize {11}{17}
\begin{flushleft}
\begin{tabular}{l l}
Studied program: & \@Studprogram\\
Studied specialization: & \@Studspec\\
Chair: & \@Chair\\
Scientific supervisor: & \@Supervisor\\
Consulter: & \@Consulter\\
\end{tabular}
\end{flushleft}
}
\vfill
\begin{flushleft}
\@City, \@Year\\ \@Disauthor
\end{flushleft}
\pagebreak
\end{front}
}
主tex
文件如下:
\documentclass[english]{minimovka}%[draft]
%packages
\usepackage[english]{babel}
\selectlanguage{english}
\usepackage[dvips]{graphicx}
\usepackage{fancyhdr}
\usepackage[compact]{titlesec}
\usepackage{titletoc}
\usepackage{tocloft}
\renewcommand{\chaptertitlename}{} %rename chapter name. actually erase the word Chapter from it
\renewcommand{\contentsname}{Contents}
\titleformat{\chapter} %configuring font size and position of chapters IN the text
{\fontsize{16}{16}\bfseries}{\thechapter.}{0pt}{}
\titleformat{\section} %configuring font size and position of sections IN the text
{\fontsize{14}{14}\bfseries}{\thesection.}{0pt}{}
\setlength\beforetitleunit{0pt}%margin before title in the text
\setlength\aftertitleunit{12pt}%margin after title in the text
\titlespacing{\chapter}{0pt}{0pt}{*2}
\titlespacing{\section}{0pt}{24pt}{*2}
\titlecontents{chapter}
[0pt]
{}%
{\contentsmargin{10pt}%
\bfseries
{\contentsmargin{0pt}\normalsize\thecontentslabel\enspace}%
\normalsize}
{\bfseries\contentsmargin{0pt}%
\large}
{\dotfill\thecontentspage}
\titlecontents{section}
[10pt]
{}%
{\contentsmargin{10pt}%
{\contentsmargin{0pt}\normalsize\thecontentslabel\enspace}%
\normalsize}
{\contentsmargin{0pt}%
\large}
{\dotfill\thecontentspage}
\begin{document}
%title page
\affiliation{My University}{My faculty}
\Distitle{Title}
\Subdistitle{Writing work to the PhD thesis}
\Year{2013}
\Disauthor{My name}
\Studprogram{My program}
\Studspec{4.1.3. Name of program}
\Chair{My chair}
\Supervisor{My supervisor}
\Consulter{My Consulter}
\City{My city}
%
\maketitle
\input{acknowl}
\newpage
\input{abstract}
\newpage
\tableofcontents
\addcontentsline{toc}{chapter}{Table of contents}
\cfoot{\thepage}
\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}
dfdf
\chapter{Literature review}
sesdsd
\chapter{Data}
asdsad
\section{Data 1}
sdfsdfsdgf
\chapter*{Conclusions}
\addcontentsline{toc}{chapter}{Conclusions}
sdsd
sgfsadgfs
\end{document}
答案1
好的。问题已经解决了。
第一个问题是俄语。通过将默认语言设置为英语并删除 .aux、.toc、.lof.、lot、.blg 等文件来解决
第二个问题是页码(我需要从第 6 页开始页码并在页眉和页脚添加虚线)。使用
package{fancyhdr}
和“package{ifthen}”解决了。第三个问题与 ToX 本身的配置有关。通过使用
package{tocloft}
第四个问题是两个标题页和正文的页面布局。通过使用
package{geometry}
以下是问题 2 的代码:
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\rfoot{}
\lfoot{}
\lhead{}
\rhead{}
\chead{}
\def\mypage{\ifthenelse{\value{page}<6}{}{\thepage}
}
\def\myrule{\ifthenelse{\value{page}<6}{}{\dotfill}
} \cfoot{\mypage}
\renewcommand{\headrule}{\myrule}
\renewcommand{\footrule}{\myrule}
问题3代码:
\usepackage{tocloft}
\renewcommand\cfttoctitlefont{\fontsize{16}{16}\selectfont\bfseries}
\renewcommand\cftloftitlefont{\fontsize{16}{16}\selectfont\bfseries}
\tocloftpagestyle{fancy}
\setlength\cftbeforetoctitleskip{0pt}
\setlength\cftaftertoctitleskip{16pt}
\setlength\cftbeforeloftitleskip{0pt}
\setlength\cftafterloftitleskip{16pt}
问题4的代码:
\usepackage[a4paper]{geometry}
\geometry{width = 6in, height = 6in, left = 1.29in, top = 0.99in}
\newenvironment{front}
{%---title page layouts
\newgeometry{width = 6.5in, height = 10in, left = 0.79in, top = 0.79in}
}
{\newgeometry{width = 6in, height = 6in, left = 1.29in, top = 0.99in}}
\newcommand{\makesecondtitle}
{
\begin{front}Title pages stuff...
\end{front}
}
注意:所有这些代码都实现在.cls文件中