这可能是一个愚蠢的问题,但我正在尝试使用这个模板
% documentclass options:
% ngerman is needed for hyphenation if the thesis contains parts written in German
% BCOR is binding correction
% if you'd rather have a one sided thesis, add `onside' to the documentclass
\documentclass[11pt, a4paper, BCOR=10mm, english, ngerman]{scrbook}
% include all packages and define commands in setup.tex
\input{setup}
\begin{document}
\pagestyle{empty} % no header and no page number
% disable hyper links to remove warning "destination with same identifier"
% this means within this section nothing can be referenced with a hyperlink
% \hypersetup{pageanchor=false}
\include{chapters/0_0-titlepage}
\pagestyle{plain} % remove chapter name from top, page number at the bottom
\frontmatter % roman page numbers
\include{chapters/0_1-declaration}
\include{chapters/0_2-abstract}
\tableofcontents
\listoffigures
\listoftables
\listofalgorithms
\hypersetup{pageanchor=true} % re-enable hyperlinking
\mainmatter % Arabic page numbers
\include{chapters/1-introduction}
\include{chapters/2-relatedwork}
\include{chapters/3-background}
\include{chapters/4-approach}
\include{chapters/5-experiments}
\include{chapters/6-conclusions}
\include{chapters/7-acknowledgments}
% bibliography is not in the table of contents per default, add it manually
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{ieeetr}
\bibliography{bib/topic1,bib/topic2}
\newpage
\thispagestyle{empty}
\mbox{}
\end{document}
我一直收到一个错误,询问setup.tex文件在哪里,现在当我查找它时,我发现另一个tex
文件setup.tex
名为
%------------------------------------------------------------------------------
% package includes
%------------------------------------------------------------------------------
% font encoding is set up for pdflatex, for other environments see
% http://tex.stackexchange.com/questions/44694/fontenc-vs-inputenc
\usepackage[T1]{fontenc} % 8-bit fonts, improves handling of hyphenations
\usepackage[utf8x]{inputenc}
% provides `old' commands for table of contents. Eases the ability to switch
% between book and scrbook
\usepackage{scrhack}
% ------------------- layout, default -------------------
% adjust the style of float's captions, separated from text to improve readabilty
\usepackage[labelfont=bf, labelsep=colon, format=hang, textfont=singlespacing]{caption}
\usepackage{chngcntr} % continuous numbering of figures/tables over chapters
\counterwithout{equation}{chapter}
\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}
% Uncomment the following line if you switch from scrbook to book
% and comment the setkomafont line
%\usepackage{titlesec} % remove "Chapter" from the chapter title
%\titleformat{\chapter}[hang]{\bfseries\huge}{\thechapter}{2pc}{\huge}
\setkomafont{chapter}{\normalfont\bfseries\huge}
\usepackage{setspace} % Line spacing
\onehalfspacing
% \doublespacing % uncomment for double spacing, e.g. for annotations in correction
% ------------------- functional, default-------------------
\usepackage[dvipsnames]{xcolor} % more colors
\usepackage{array} % custom format per column in table - needed on the title page
\usepackage{graphicx} % include graphics
\usepackage{subfig} % divide figure, e.g. 1(a), 1(b)...
\usepackage{amsmath} % |
\usepackage{amsthm} % | math, bmatrix etc
\usepackage{amsfonts} % |
\usepackage{calc} % calculate within LaTeX
\usepackage[unicode=true,bookmarks=true,bookmarksnumbered=true,
bookmarksopen=true,bookmarksopenlevel=1,breaklinks=false,
pdfborder={0 0 0},backref=false,colorlinks=false]{hyperref}
%==========================================
% You might not need the following packages, I only included them as they
% are needed for the example floats
% ------------------- functional, custom -------------------
\usepackage{algorithm,algpseudocode}
\usepackage{bm} % bold greek variables (boldmath)
\usepackage{tikz}
\usetikzlibrary{positioning} % use: above left of, etc
% Improves general appearance of the text
\usepackage[protrusion=true,expansion=true, kerning]{microtype}
%------------------------------------------------------------------------------
% (re)new commands / settings
%------------------------------------------------------------------------------
% ----------------- referencing ----------------
\newcommand{\secref}[1]{Section~\ref{#1}}
\newcommand{\chapref}[1]{Chapter~\ref{#1}}
\renewcommand{\eqref}[1]{Equation~(\ref{#1})}
\newcommand{\figref}[1]{Figure~\ref{#1}}
\newcommand{\tabref}[1]{Table~\ref{#1}}
% ------------------- colors -------------------
\definecolor{darkgreen}{rgb}{0.0, 0.5, 0.0}
% Colors of the Albert Ludwigs University as in
% https://www.zuv.uni-freiburg.de/service/cd/cd-manual/farbwelt
\definecolor{UniBlue}{RGB}{0, 74, 153}
\definecolor{UniRed}{RGB}{193, 0, 42}
\definecolor{UniGrey}{RGB}{154, 155, 156}
% ------------------- layout -------------------
% prevents floating objects from being placed ahead of their section
\let\mySection\section\renewcommand{\section}{\suppressfloats[t]\mySection}
\let\mySubSection\subsection\renewcommand{\subsection}{\suppressfloats[t]\mySubSection}
% ------------------- marker commands -------------------
% ToDo command
\newcommand{\todo}[1]{\textbf{\textcolor{red}{(TODO: #1)}}}
\newcommand{\extend}[1]{\textbf{\textcolor{darkgreen}{(EXTEND: #1)}}}
% Lighter color to note down quick drafts
\newcommand{\draft}[1]{\textbf{\textcolor{NavyBlue}{(DRAFT: #1)}}}
% ------------------- math formatting commands -------------------
% define vectors to be bold instead of using an arrow
\renewcommand{\vec}[1]{\mathbf{#1}}
\newcommand{\mat}[1]{\mathbf{#1}}
% tag equation with name
\newcommand{\eqname}[1]{\tag*{#1}}
% ------------------- pdf settings -------------------
% ADAPT THIS
\hypersetup{pdftitle={The great title!},
pdfauthor={FirstName LastName},
pdfsubject={Undergraduate thesis at the Albert Ludwig University of Freiburg},
pdfkeywords={deep learning, awesome algorithm, undergraduate thesis},
pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false}
%==========================================
% You might not need the following commands, I only included them as they
% are needed for the example floats
% ------------------- Tikz styles -------------------
\tikzset{>=latex} % arrow style
% ------------------- algorithm ---------------------
% Command to align comments in algorithm
\newcommand{\alignedComment}[1]{\Comment{\parbox[t]{.35\linewidth}{#1}}}
% define a foreach command in algorithms
\algnewcommand\algorithmicforeach{\textbf{foreach}}
\algdef{S}[FOR]{ForEach}[1]{\algorithmicforeach\ #1\ \algorithmicdo}
但说实话,我真的不知道这是什么意思。我只想让这个模板运行,但我不知道如何
答案1
main.tex
1- 将模板代码保存在位于特定目录中的文件中,例如,
2- 将辅助代码片段保存在setup.tex
同一目录中的文件中,
3- 呼叫pdflatex
。