\DeclareOption 不适用于我的 MikTex

问题描述

我为我的乳胶文档编写了一个 cls 文件,它在我的 texlive 安装中就像一个魅力。但是在我尝试 MiKTex 的新 Labtop 上,它忽略了声明。

我只会在这里发布 cls 的开头,否则会有点多。

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{merlinsTemplate}[2020/08/29 My custom story class]


\newif\ifgerman\germanfalse %Deutsch,sonst English
\newif\ifaV\aVfalse %a5,sonst a4
\newif\ifbg\bgfalse %mit Hintergrund,sonst ohne
\newif\ifoneside\onesidefalse % einseitig
\newif\ifnoParindent\noParindentfalse
\newif\iflua\luafalse   %a5,sonst a4
\newif\ifarticle\articlefalse   %typ article instead of book

\DeclareOption{german}{\germantrue}
\DeclareOption{a5}{\aVtrue}
\DeclareOption{background}{\bgtrue}
\DeclareOption{oneside}{\onesidetrue}
\DeclareOption{noParindent}{\noParindenttrue}
\DeclareOption{lua}{\luatrue}
\DeclareOption{article}{\articletrue}

\ProcessOptions


\ifarticle
    \LoadClass{article}
\else
    \ifoneside
        \LoadClass[oneside]{book}
    \else
        \LoadClass{book}
    \fi
\fi


\ifgerman
    \RequirePackage[ngerman]{babel}
\else
    \RequirePackage[english]{babel}
\fi


\RequirePackage[table,dvipsnames]{xcolor}
%multicols trennlinie
    \newcommand{\Cmctc}{gray!10}
%titlesec
    \newcommand{\Ctscc}{violet} % \chapter
    \newcommand{\Ctssc}{blue}   % \section
    \newcommand{\Ctsssc}{cyan}  % \subsection
    \newcommand{\Ctssssc}{teal} % \subsubsection
    \newcommand{\Ctspc}{purple} % \paragraph
%etoolbox : headrule:Tikz
    \newcommand{\Cshlco}{\Ctscc}
    \newcommand{\Cshlct}{black}
%fancyhdr chaptermark
    \newcommand{\Ccmc}{\Ctscc}


\RequirePackage{geometry}
    \ifaV
        \geometry{a5paper,left=12mm,right=12mm,top=1.5cm,bottom=2cm}
    \else
        \geometry{a4paper,left=25mm,right=25mm,top=2cm,bottom=2cm}
    \fi


\RequirePackage{titlesec}%to format headings
\ifarticle
    \titleformat{\section}
    {\scshape\huge\color{\Ctssc}}
    {\LARGE\thesection}{.5em}{}[\titlerule]
    
    \titleformat{\subsection}
    {\Large\scshape\color{\Ctsssc}}
    {\large\thesubsection}{.25em}{}[\titlerule]
    
    \titleformat{\subsubsection}
    {\Large\scshape\color{\Ctssssc}}
    {\tiny\thesubsubsection}{.25em}{}
    
    \titleformat{\paragraph}[runin]
    {\normalfont\scshape\color{\Ctspc}}
    {\theparagraph}{0em}{}
\else
    \titleformat{\chapter}[display]
        {\scshape\Huge\color{\Ctscc}}
        {\filleft\large\chaptertitlename~\thechapter}
        {0ex}
        {\titlerule\vspace{0.75ex}\filright}
        [\vspace{0.5ex}\titlerule]
    
    \titleformat{\section}
        {\centering\scshape\huge\color{\Ctssc}}
        {\scriptsize\thesection}{.5em}{}[\titlerule]
    
    \titleformat{\subsection}
        {\centering\large\scshape\color{\Ctsssc}}
        {\scriptsize\thesubsection}{.25em}{}[\titlerule]
    
    \titleformat{\subsubsection}
        {\Large\scshape\color{\Ctssssc}}
        {\tiny\thesubsubsection}{.25em}{}
    
    \titleformat{\paragraph}[runin]
        {\normalfont\scshape\color{\Ctspc}}
        {\theparagraph}{0em}{}
\fi


\RequirePackage{tikz}



\RequirePackage{fancyhdr}
    \pagestyle{fancy}
\ifarticle
    \renewcommand{\sectionmark}[1]{\markboth{\textcolor{\Ccmc}{#1}}{}}
\else
    \renewcommand{\chaptermark}[1]{\markboth{\textcolor{\Ccmc}{#1}}{}}
\fi


\RequirePackage{etoolbox}
    \renewcommand{\headrule}{
        \begin{tikzpicture}%
            \ifnumodd{\value{page}}
            {\shade[left color=\Cshlco,right color=\Cshlct,dashed] (0,0) rectangle (\headwidth,0.01);}
            {\shade[left color=\Cshlct,right color=\Cshlco,0.01);}
        \end{tikzpicture}}



\RequirePackage{amsfonts}
\RequirePackage{amssymb}

\RequirePackage{array,ragged2e}
    \renewcommand{\arraystretch}{1.4}  %tabellen
\RequirePackage{boldline}

\RequirePackage{catchfilebetweentags}
\usepackage{enumitem} %to change enumerate schichten

\RequirePackage{fontawesome}
\iflua
    \usepackage{fontspec}   % with lua
\fi 
\RequirePackage{fourier}
%\RequirePackage{graphics}
\RequirePackage{graphicx}
\RequirePackage{hyperref}   % Verlinkung des toc

\RequirePackage[utf8]{inputenc} % Umlaute für Deutsch direkt verwenden
\RequirePackage{lineno}
\RequirePackage{lipsum} % automatischer FillerText
\RequirePackage{longtable}
\RequirePackage{makecell}
\RequirePackage{marvosym}   % brief sonderzeichen
\RequirePackage{multicol}   % muli-columns 
    \setlength{\columnseprule}{1pt}
    \def\columnseprulecolor{\color{\Cmctc}}
\RequirePackage{multirow} % Tables
\RequirePackage{pdfpages}

\RequirePackage{pifont} 

\RequirePackage{subcaption}
\usepackage{tabularx}
    \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} % linksbündig mit Breitenangabe
    \newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % zentriert mit Breitenangabe
    \newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} % rechtsbündig mit Breitenangabe
\RequirePackage[most]{tcolorbox}
    \tcbuselibrary{skins,xparse}
    \tcbuselibrary{breakable}
\RequirePackage{textcomp}
\RequirePackage{ulem}
\RequirePackage{wasysym}

\ifnoParindent
    \setlength{\parindent}{0em} %Einrücken unterdrücken von paragraph
    \renewcommand{\Ctscc}{red}
\else
    \renewcommand{\Ctscc}{blue}
\fi

\newdimen\R %für special marker
%\R=4pt

我打电话给班级:

\documentclass[german]{merlinsTemplate}

\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}

\begin{document}

\chapter{ITS - Linux: Debian\\{\normalsize Mr. Lüthen}}

\begin{itemize}
    \item[22.12.20] \textit{Ferien}
    \item[29.12.20] \textit{Ferien}
    \item[05.01.21] \textit{Ferien}
    \item[12.01.21] 
\end{itemize}

\section{Installation of Debian{\tiny   18.08.2020,25.08.2020,01.09.2020}}
\subsection{Aufgabe}
    Ladida

\subsubsection{Installation eines Debian-Systems}

Für Ausbildungszwecke ist auf den privaten Laptops das Linux-Betriebssystem ...
\end{document}

在我的带有 texlive Content 的计算机上,它应该转换为 Inhaltsverzeichnis,但在我的 MiKTex 上它仍然是 Content

MiKTex Labtop 上的日志是:在评论中,因为它对身体来说太长了...

有人知道缺少什么吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)