LaTeX 源代码中的错误

LaTeX 源代码中的错误

当我尝试编译我的 tex 文件时,我不断收到此错误。

这是我的 tex 文件:

\documentclass[paper=a4, fontsize=11pt]{scrartcl} % A4 paper and 11pt font size
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{fourier} % Use the Adobe Utopia font for the document - comment this line to return to the LaTeX default
\usepackage[english]{babel} % English language/hyphenation
\usepackage{amsmath,amsfonts,amsthm} % Math packages

\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template

\usepackage{sectsty} % Allows customizing section commands
\allsectionsfont{\centering \normalfont\scshape} % Make all sections centered, the default font and small caps

\usepackage{fancyhdr} % Custom headers and footers
\pagestyle{fancyplain} % Makes all pages in the document conform to the custom headers and footers
\fancyhead{} % No page header - if you want one, create it in the same way as the footers below
\fancyfoot[L]{} % Empty left footer
\fancyfoot[C]{} % Empty center footer
\fancyfoot[R]{\thepage} % Page numbering for right footer
\renewcommand{\headrulewidth}{0pt} % Remove header underlines
\renewcommand{\footrulewidth}{0pt} % Remove footer underlines
\setlength{\headheight}{13.6pt} % Customize the height of the header

\numberwithin{equation}{section} % Number equations within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)

\setlength\parindent{0pt} % Removes all indentation from paragraphs - comment this line for an assignment with lots of text

%----------------------------------------------------------------------------------------
%   TITLE SECTION
%----------------------------------------------------------------------------------------

\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height

\title{ 
\normalfont \normalsize 
\textsc{NSIT, Division of Computer Engineering} \\ [25pt] % Your university, school and/or department name(s)
\horrule{0.5pt} \\[0.4cm] % Thin top horizontal rule
\huge Project Synopsis \\ % The assignment title
\horrule{2pt} \\[0.5cm] % Thick bottom horizontal rule
}

\author{
        \horrule{0.5pt} \\[0.4cm]
        Ashish Kothari (240/CO/12)\\
        Ayush Gupta (248/CO/12)\\
        Chandan Kar (252/CO/12)\\
        \horrule{0.5pt} \\[0.4cm]} % Your name
\date{\normalsize\today} % Today's date or a custom date

\begin{document}

\maketitle % Print the title

%----------------------------------------------------------------------------------------
%   PROBLEM 1
%----------------------------------------------------------------------------------------

\section{Fast \& light console-based Music Player}

The project aims to build a fast, light, and high-quality music player that is console-based with a simple and easy-to-use GUI written on shell scripts made for Linux systems. The music player is being designed to be able to decode most modern audio file formats. 

%------------------------------------------------

\subsection{Utility Requirements}

The utility requires very little computing power to function and is very efficient with CPU usage. For Linux OS, the utility has about 3\% to 4\% CPU usage on playing a high quality VBR MP3 on a Pentium 366MHz machine.\\

Requirements are listed as below:
\begin{itemize}
    \item mpg123 - an MPEG player and decoder library
    \item A Linux OS distribution
    \item Atleast 100MHz of computing power 
\end{itemize}


%------------------------------------------------

\subsection{Innovativeness \& Usefulness}

The music player is being developed with the goal of optimising CPU utilisation, while having an easy-to-use GUI to play high quality music.\\

Some proposed features of the utility are:
\begin{itemize} \itemsep 1pt

    \item Support for various audio sub-systems 
    \item Simple but powerful control modes for frontend GUI
    \item Support for playback through URL
    \item Support for music playback from Cloud storage 
    \item Many audio data settings: resampling, choose channel, mono.
    \item Support for Relative Volume Adjustment / Replay Gain 

\end{itemize}

%------------------------------------------------

\subsection {Current status of development}
\begin{itemize} \itemsep -2pt

    \item Basic functionality of the music player  has been achieved. 
    \item Frontend user interface is under development and is being developed using Zenity/ncurses library.
    \item Integration of proposed features into the GUI user interface of the utility has been started.

\end{itemize}

%------------------------------------------------

% \paragraph{Heading on level 4 (paragraph)}

% \lipsum[6] % Dummy text

% %----------------------------------------------------------------------------------------
% % PROBLEM 2
% %----------------------------------------------------------------------------------------

% \section{Lists}

% %------------------------------------------------

% \subsection{Example of list (3*itemize)}
% \begin{itemize}
%   \item First item in a list 
%       \begin{itemize}
%       \item First item in a list 
%           \begin{itemize}
%           \item First item in a list 
%           \item Second item in a list 
%           \end{itemize}
%       \item Second item in a list 
%       \end{itemize}
%   \item Second item in a list 
% \end{itemize}

% %------------------------------------------------

% \subsection{Example of list (enumerate)}
% \begin{enumerate}
% \item First item in a list 
% \item Second item in a list 
% \item Third item in a list
% \end{enumerate}

%----------------------------------------------------------------------------------------
\end{document}   

错误:

There were errors in your LaTeX source

/usr/share/texlive/texmf-dist/tex/latex/koma-script/typearea.sty:90: LaTeX Error: Command \@BCOR already defined. [...fter\@@BCOR\CurrentOption BCORBCOR\@@BCOR}]

/usr/share/texlive/texmf-dist/tex/latex/koma-script/typearea.sty:91: LaTeX Error: Command \@@BCOR already defined. [\newcommand*{\@@BCOR}{}]

/usr/share/texlive/texmf-dist/tex/latex/koma-script/typearea.sty:99: LaTeX Error: Command \@DIV already defined. [...andafter\@@DIV\CurrentOption DIVDIV\@@DIV}]

/usr/share/texlive/texmf-dist/tex/latex/koma-script/typearea.sty:100: LaTeX Error: Command \@@DIV already defined. [\newcommand*{\@@DIV}{}]

/usr/share/texlive/texmf-dist/tex/latex/koma-script/typearea.sty:196: LaTeX Error: Command \x@paper already defined. [}]

/usr/share/texlive/texmf-dist/tex/latex/koma-script/typearea.sty:197: LaTeX Error: Command \x@@paper already defined. [\newcommand*{\x@@paper}{}]

There were also warnings.

[no file]: LaTeX Warning: Unused global option(s):    [fontsize=11pt].
(Log parsing issues. Disregard unless something else is wrong.)

[Done!]

另外,我最近在 Ubuntu 12.04 上使用 backports ppa 安装了 TeXLive

答案1

可能您有一个过时的 KOMA-Script 包,这就是您收到这些错误的原因。

除此之外,尽量避免fancyhdr与 KOMA 类一起使用,因为不推荐这样做。

scrlayer-scrpage您可以使用专门设计用于此类的包。

因此,你可以替换

\usepackage{fancyhdr} % Custom headers and footers
\pagestyle{fancyplain} % Makes all pages in the document conform to the custom headers and footers
\fancyhead{} % No page header - if you want one, create it in the same way as the footers below
\fancyfoot[L]{} % Empty left footer
\fancyfoot[C]{} % Empty center footer
\fancyfoot[R]{\thepage} % Page numbering for right footer
\renewcommand{\headrulewidth}{0pt} % Remove header underlines
\renewcommand{\footrulewidth}{0pt} % Remove footer underlines

只需

\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\ofoot[\pagemark]{\pagemark}
\pagestyle{scrheadings}

如果你有旧版本的 KOMA-Script,请替换

\usepackage{scrlayer-scrpage}
\clearpairofpagestyles

\usepackage{scrpage2}
\clearscrheadfoot

平均能量损失

\documentclass[paper=a4, fontsize=11pt]{scrartcl} % A4 paper and 11pt font size
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{fourier} % Use the Adobe Utopia font for the document - comment this line to return to the LaTeX default
\usepackage[english]{babel} % English language/hyphenation
\usepackage{amsmath,amsfonts,amsthm} % Math packages

\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template

\usepackage{sectsty} % Allows customizing section commands
\allsectionsfont{\centering \normalfont\scshape} % Make all sections centered, the default font and small caps

\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\ofoot[\pagemark]{\pagemark}
\pagestyle{scrheadings}

\setlength{\headheight}{13.6pt} % Customize the height of the header

\numberwithin{equation}{section} % Number equations within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)

\setlength\parindent{0pt} % Removes all indentation from paragraphs - comment this line for an assignment with lots of text

%----------------------------------------------------------------------------------------
%   TITLE SECTION
%----------------------------------------------------------------------------------------

\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height

\title{
\normalfont \normalsize
\textsc{NSIT, Division of Computer Engineering} \\ [25pt] % Your university, school and/or department name(s)
\horrule{0.5pt} \\[0.4cm] % Thin top horizontal rule
\huge Project Synopsis \\ % The assignment title
\horrule{2pt} \\[0.5cm] % Thick bottom horizontal rule
}

\author{
        \horrule{0.5pt} \\[0.4cm]
        Ashish Kothari (240/CO/12)\\
        Ayush Gupta (248/CO/12)\\
        Chandan Kar (252/CO/12)\\
        \horrule{0.5pt} \\[0.4cm]} % Your name
\date{\normalsize\today} % Today's date or a custom date

\begin{document}

\maketitle % Print the title

%----------------------------------------------------------------------------------------
%   PROBLEM 1
%----------------------------------------------------------------------------------------

\section{Fast \& light console-based Music Player}

The project aims to build a fast, light, and high-quality music player that is console-based with a simple and easy-to-use GUI written on shell scripts made for Linux systems. The music player is being designed to be able to decode most modern audio file formats.

%------------------------------------------------

\subsection{Utility Requirements}

The utility requires very little computing power to function and is very efficient with CPU usage. For Linux OS, the utility has about 3\% to 4\% CPU usage on playing a high quality VBR MP3 on a Pentium 366MHz machine.\\

Requirements are listed as below:
\begin{itemize}
    \item mpg123 - an MPEG player and decoder library
    \item A Linux OS distribution
    \item Atleast 100MHz of computing power
\end{itemize}


%------------------------------------------------

\subsection{Innovativeness \& Usefulness}

The music player is being developed with the goal of optimising CPU utilisation, while having an easy-to-use GUI to play high quality music.\\

Some proposed features of the utility are:
\begin{itemize} \itemsep 1pt

    \item Support for various audio sub-systems
    \item Simple but powerful control modes for frontend GUI
    \item Support for playback through URL
    \item Support for music playback from Cloud storage
    \item Many audio data settings: resampling, choose channel, mono.
    \item Support for Relative Volume Adjustment / Replay Gain

\end{itemize}

%------------------------------------------------

\subsection {Current status of development}
\begin{itemize} \itemsep -2pt

    \item Basic functionality of the music player  has been achieved.
    \item Frontend user interface is under development and is being developed using Zenity/ncurses library.
    \item Integration of proposed features into the GUI user interface of the utility has been started.

\end{itemize}

%------------------------------------------------

% \paragraph{Heading on level 4 (paragraph)}

% \lipsum[6] % Dummy text

% %----------------------------------------------------------------------------------------
% % PROBLEM 2
% %----------------------------------------------------------------------------------------

% \section{Lists}

% %------------------------------------------------

% \subsection{Example of list (3*itemize)}
% \begin{itemize}
%   \item First item in a list
%       \begin{itemize}
%       \item First item in a list
%           \begin{itemize}
%           \item First item in a list
%           \item Second item in a list
%           \end{itemize}
%       \item Second item in a list
%       \end{itemize}
%   \item Second item in a list
% \end{itemize}

% %------------------------------------------------

% \subsection{Example of list (enumerate)}
% \begin{enumerate}
% \item First item in a list
% \item Second item in a list
% \item Third item in a list
% \end{enumerate}

%----------------------------------------------------------------------------------------
\end{document} 

在此处输入图片描述

答案2

我刚刚查看了您的代码,它似乎在 TexMaker 中编译得很完美。这是我使用您的代码得到的输出,没有任何变化:

在此处输入图片描述

在此处输入图片描述

这是你所期望的吗?我尝试将你的代码粘贴到写入Latex网站进行实时预览,效果也很好。尝试撰写新论文链接,删除模板代码并添加您自己的代码即可亲自查看。

相关内容