
我很快就會開始寫我的碩士論文。我喜歡在其中有一個序言。我使用basic-miktex-2.9.5105
和 作為 TeXmaker 編輯器——安裝在 Windows 機器上。
另外:我可以找到像 MikTeX (或其版本)這樣包含所有當前 LaTeX 包的發行版或捆綁包嗎?
答案1
通常我建議從頭開始建立每個文檔,因為每一個文件有其自身的要求。不過,再看一次你的問題,我覺得確實有些事情幾乎每一個論文需要做的事情。所以這是論文的「最小工作序言」:
\documentclass{report} % or even: book | or the koma classes: scrreprt, scrbook
% or for a small thesis 'article' or the corresponding 'scrartcl'
\usepackage{microtype}
\usepackage[<encoding>]{fontenc} % probabilly: T1
\usepackage[<encoding>]{inputenc} % probabilly: utf8
%\usepackage{palatino} % just as a matter of taste
\usepackage[<your language(s)>]{babel}
\usepackage{geometry} % and then \geometry{<settings>}
\usepackage{csquotes} % probabilly with the option: autostyle=true
\usepackage{ellipsis}
\usepackage{natbib} % or biblatex
\usepackage{graphicx}
%\graphicspath{ {images/} } % or whatever your "images"-directory is
\usepackage{todonotes} % or fixme
\usepackage{fancyhdr}
\usepackage{emptypage}
\usepackage{hyperref}
...
%declaration environment
\usepackage{titling}
\makeatletter
\newif\if@decltotoc
\newcommand\declarationname{Declaration of Authorship}
\newcommand\ltx@sectionings{chapter,section,subsection,subsubsection,subparagraph}
\newcommand\decl@rationsect{chapter}
\ifdefined\chapter\else\renewcommand\decl@rationsect{section}\fi
\newenvironment{declaration}[2][\decl@rationsect]{%
\edef\@tempa{\decl@rationsect}%
\edef\reserved@a{#1}%
\gdef\theplace{#2}%
\@decltotocfalse
\@ifundefined{#1}{\@latex@warning{#1 not defined}}{%
\@tempswafalse%
\@for\sec:=\ltx@sectionings\do{\ifx\sec\reserved@a\@tempswatrue\fi}%
\if@tempswa\let\@tempa\reserved@a\else
\@latex@warning{#1 is not a sectioning command, so I overrode it}\fi}
\csname\@tempa\endcsname*{\declarationname}
\if@decltotoc\addcontentsline{toc}{\@tempa}{\declarationname}\fi
}{%
\par\vskip6em\par\noindent\theauthor\hfill\theplace,\space\thedate\par
\global\let\declaration\gobble@env
\global\let\enddeclaration\relax
\global\expandafter\let\csname enddeclaration*\endcsname\relax
}
\expandafter\def\csname declaration*\endcsname{\let\@decltotocfalse\@decltotoctrue\declaration}
\expandafter\let\csname enddeclaration*\endcsname\enddeclaration
\def\gobble@env{\@ifnextchar[{\@gobble@env}{\@gobble@env[]}}
\def\@gobble@env[#1]{\@bsphack\@@gobble@env}
\def\@@gobble@env#1\end{\@esphack\end}
\makeatother
程式碼的最後一部分將declaration
環境定義為作者身份聲明,這主要是(幾乎)每篇論文的組成部分。它的使用非常簡單:
\begin{declaration}{City}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{declaration}
如果它應該出現在目錄中,您可以說\begin{declaration*}{City}...\end{declaration*}
。
評論
- 對於更大的論文,您很可能需要一個支援的文檔類
\chapter
分段中的 s 的文檔類別。不管怎樣,這裡還有一些類別要考慮。為此,您可能想查看CTAN 類別概述。 - 有一些包實際上在任何地方都是預設的(假設是 pdfLaTeX):
microtype
包括 pdfTeXs 微型排版擴展,inputenc
和fontenc
控制編碼;如果您使用 XeLaTeX 或 LuaLaTeX 這些軟體包將無法使用 babel
確保正確完成與語言相關的任務- 每所大學都對頁面提出(很可能是荒謬的)要求
geometry
- 您很可能需要引用:
csquotes
;並作為補充ellipsis
\dots
,它修正了在文字模式下經常出現的錯誤空白 - 您肯定需要以定制的樣式引用:
natbib
,biblatex
, ETC。 - 如果您有外部人物:
graphicx
- 在編寫大型專案時儲存待辦事項非常方便——這些事項必須在最終版本中排除,因此
todonotes
;通常人們喜歡使用替代方案fixme
包,因為它克服了todonotes
包在筆記放置方面的邊界 - 通常您希望有可點擊的交叉引用:
hyperref
;請注意,您必須加載hyperref
(幾乎)作為最後一個套件加載,以確保您的文件正確編譯。這裡您可以找到有關此主題的全面討論 - 例如您必須在;geometry
之後加載hyperref
可以說,上述序言在技術上是錯誤的;只是由於列表中的“等級制度”,它的位置較高 - 最後兩個或多或少是可選的:
fancyhdr
是設定頁首和頁尾的標準工具emptypage
如果您希望空頁實際上是空的,則可以包括在內 - 除了該
todonotes
包之外,您可能還想使用comment
包作為偽版本控制系統 - 根據您的主題或如果您需要在 LaTeX 中產生繪圖和圖表,您可能還需要
附錄
值得注意的是,該memoir
文件用了一整章(21.“論文設計範例”,第357-375頁)來解釋如何設計論文風格。可能有一些關於人們可能想要納入自己的序言中的附加功能的線索。然而,還應該說的是,本手冊著重於從包/類設計者的角度出發的論文風格。