我正在使用 LyX。
该代码\end{nolinenumbers}
不适用于目录。
谁能帮忙?
% Quellcode vorschauen
%% LyX 2.0.8.1 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,ngerman]{extarticle}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=3cm,rmargin=3cm}
\usepackage{color}
\usepackage{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{setspace}
\onehalfspacing
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=true,pdfborder={0 0 0},backref=false,colorlinks=true]
{hyperref}
\makeatletter
\@ifundefined{date}{}{\date{}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{etoolbox}\usepackage{lineno}% http://ctan.org/pkg/{etoolbox,lineno}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\setlength{\linenumbersep}{10pt}
\renewcommand{\linenumberfont}{\normalfont\tiny\sffamily\color{gray}}
% \patchcmd{}{}{}{}{}
\patchcmd{\@startsection}{\@ifstar}{\nolinenumbers\@ifstar}{}{}
\patchcmd{\@xsect}{\ignorespaces}{\linenumbers\ignorespaces}{}{}
\linenumbers
\usepackage{xcolor}\usepackage{lscape}
\usepackage{tocstyle}\usepackage{enumitem}\usepackage{mathabx}\usepackage{color}\usepackage{soulutf8}\usepackage{microtype}
\renewcommand{\labelenumi}{\arabic{enumi}.}
\renewcommand{\labelenumii}{\labelenumi\arabic{enumii}.}
\renewcommand{\labelenumiii}{\labelenumii\arabic{enumiii}}
\renewcommand{\labelenumiv}{\alph{enumiv})}
\newtocstyle[KOMAlike][leaders]{chapterwithdot}{
\settocfeature{pagenumberbox}{\makebox[1em][r]}% Platz für Seitenzahl
\settocfeature[-1]{leaders}{\hfill}% keine Punkte bei part
\settocfeature[-1]{pagenumberbox}{\phantom}% keine Seitenzahl bei part
}
\usetocstyle{chapterwithdot}
\renewcommand{\arraystretch}{0.9}
\makeatother
\begin{document}
\newpage{}\begin{nolinenumbers} \tableofcontents{}\end{nolinenumbers}
\clearpage\pagenumbering{arabic}
\setcounter{page}{6}\newpage{}
\section{weijfwoijfewfe}
\subsection{wefijwoijfeoiwfe}
\begin{quote}
\begin{singlespace}
\noindent joiwjeoiwjfoiwjfe\end{singlespace}
\end{quote}
\subsection{wfejwojfeowijfowf}
woiujfeoiwjfeoiwjfeoiwfe
\end{document}