程序包 tracklang 错误:方言‘iso’未预定义

程序包 tracklang 错误:方言‘iso’未预定义

我添加了该包,datetime2以便我可以按照 ISO 标准写出今天的时间。

\usepackage[iso]{datetime2}

我收到一个错误,说 iso 未预定义。

datetime2.sty
159
Package tracklang Error: Dialect `iso' is not predefined.

See the tracklang package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.159 \disable@keys
                   {datetime2.sty}{calc}

我还可以补充一点,我刚开始使用.tex,所以我不知道自己在做什么,只是复制我在互联网上找到的内容。

完整的代码如下,我唯一做的更改是那些中间带有注释的更改。其余的是一个给我的模板。

\documentclass[a4paper,oneside]{bth}

\usepackage{amsmath}
\usepackage{mathenv}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{textcomp}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{pifont}
\usepackage{changepage}
\usepackage{listings}
\usepackage{url}
\usepackage{xspace}
\usepackage{xtab}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage[iso]{datetime2}
\DeclareGraphicsExtensions{.pdf}

\newtheorem{lem}{\textsc{Lemma}}[chapter]
\newtheorem{thm}{\textsc{Theorem}}[chapter]
\newtheorem{prop}{\textsc{Proposition}}[chapter]
\newtheorem{post}{Postulate}[chapter]
\newtheorem{corr}{\textsc{Corollary}}[chapter]
\newtheorem{defs}{\textsc{Definition}}[chapter]
\newtheorem{cons}{\textsc{Constraint}}[chapter]
\newtheorem{ex}{\textbf{Example}}[chapter]
\newtheorem{qu}{\textbf{Question}}[chapter]

\begin{document}

\pagestyle{plain}
\pagenumbering{roman}

% Front matter

{\pagestyle{empty}

\noindent%   
{\small
\begin{tabular}{p{0.75\textwidth} p{0.25\textwidth}}

\textit{}&\multirow{3}{*}{\bthcsnotextlogo{3cm}}\\
\\
\end{tabular}

}

\begin{center}

\par\vspace {7.5cm}

{\Huge\textbf{Analyze network trafic}}                                      %Titel

\par\vspace {0.5cm}

{\Large\textbf{Network data trafic analyze for different chat clients}}                             %Subtitel

\par\vspace {0.5cm}

{\Large\today}                                              %Date

\par\vspace {3cm}

{\Large\textbf{Olof Haglund}}                                       %NAMN

\end{center}

\noindent%

\setcounter{page}{1}

% ABSTRACT

\abstract
\begin{changemargin}{+1cm}{+1cm}
\noindent
[This summarizes the outcome of the result of the lab and the conclusions you have drawn. The summary should be   short and easy to read.]      %Abstract

\end{changemargin}


\tableofcontents 

\cleardoublepage
\pagestyle{headings}
\pagenumbering{arabic}

\chapter{Introduction}
[Explain clearly what are you doing in this lab and make sure do not discus the result here.] \\

\chapter{Work Description }
[This lab I measured/analyzed/... 
 It should contain description of the method, equipment, software, rel. ++.
Syftet med undersökningen är att få svar på ett antal olika frågor] \\


\chapter{Results}
[Presented result from Lab which will contain graph, figure,….] \\
% for adding figure used this command and change the figure name
%figure should be in the same folder as your tex file
\begin{figure}[h]
\centering
\includegraphics[width=0.9\textwidth]{1.png}
\caption{sample figure}
\end{figure}

\chapter{Analysis and Discussion}
[In this chapter present the outcome and analysis the result based on observation. You can explain your outcome in this chapter as well.] \\

\chapter{Conclusions}
[Conclude observation and outcome from this lab. It is summary of work you done.] \\

\chapter*{References}

\chapter*{Appendix}

\end{document}

BTH 文献类

% Template - BTH degree project: Master of Science in computer science | software engineering [for engineers]
%
% Version 1.0 (2013-12-25)
%
% Authors of earlier versions of parts of this file: Hannes Tribus, Martin Stokhof, Marco Vervoort, Maarten de Rijke
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{bth}[2013/12/25 BTH Master Thesis Style]
\newcommand{\@mult}{1.2}
\newcommand{\@typesizeopt}{12pt}
\DeclareOption{10pt}{%
   \renewcommand{\@mult}{1}
   \renewcommand{\@typesizeopt}{10pt}
}
\DeclareOption{11pt}{%
   \renewcommand{\@mult}{1.1}
   \renewcommand{\@typesizeopt}{11pt}
}
\DeclareOption{12pt}{%
   \renewcommand{\@mult}{1.2}
   \renewcommand{\@typesizeopt}{12pt}
}
\DeclareOption{openbib}{%  To provide backwards compatibility with versions
   \AtEndOfPackage{%       of the book class that do not use @openbib@code
      \renewcommand\@openbib@code{%
         \addtolength{\leftmargin}{\bibindent}
         \setlength{\itemindent}{-\bibindent}
         \setlength{\listparindent}{\itemindent}
         \setlength{\parsep}{\z@}
      }
      \renewcommand\newblock{\par}
   }
   \PassOptionsToClass{\CurrentOption}{book}
}
\newcommand{\@papersizeopt}{a4paper}
\DeclareOption{a4paper}{\renewcommand{\@papersizeopt}{a4paper}}
\DeclareOption{a5paper}{\renewcommand{\@papersizeopt}{a5paper}}
\DeclareOption{b5paper}{\renewcommand{\@papersizeopt}{b5paper}}
\DeclareOption{letterpaper}{\renewcommand{\@papersizeopt}{letterpaper}}
\DeclareOption{legalpaper}{\renewcommand{\@papersizeopt}{legalpaper}}
\DeclareOption{executivepaper}{\renewcommand{\@papersizeopt}{executivepaper}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptions
\LoadClass[\@papersizeopt,\@typesizeopt]{book}
\RequirePackage{graphicx}
%
%       To provide backwards compatibility with versions of the book class that 
%       do not define \@openbib@code, \newblock, \paperwidth or \paperheight:
%
\providecommand{\@openbib@code}{}
\providecommand{\newblock}{\hskip .11em\@plus.33em\@minus.07em}
\providecommand{\paperwidth}{\pagewidth}
\providecommand{\paperheight}{\pageheight}
%
%   New values for some lengths, proportional to fontsize
%
\newcommand{\setmlength}[3]{\setlength{#1}{#3}\setlength{#1}{#2#1}}
\setmlength{\textheight}{\@mult}{0.613\paperheight}%18.2cm for a4paper
\setmlength{\textwidth}{\@mult}{0.576\paperwidth}%12.1cm for a4paper
\setmlength{\headheight}{\@mult}{12pt}
\setmlength{\headsep}{\@mult}{18pt}
\setmlength{\topskip}{\@mult}{10pt}
\setmlength{\footskip}{\@mult}{25pt}

\setlength{\topmargin}{0.5\paperheight}
\addtolength{\topmargin}{-0.5\textheight}
\addtolength{\topmargin}{-0.5\headheight}
\addtolength{\topmargin}{-0.5\headsep}
\addtolength{\topmargin}{-0.5\footskip}
\addtolength{\topmargin}{-1in}
\setlength{\oddsidemargin}{0.5\paperwidth}
\addtolength{\oddsidemargin}{-0.5\textwidth}
\addtolength{\oddsidemargin}{-1in}
\setlength{\evensidemargin}{\oddsidemargin}
%
%   Chapterheads: chapternr, horizontal line, chaptertitle
%       Vertical spaces are proportional to fontsize
%       Note that, as opposed to in book.cls, here the definition
%       of \@makechapterhead does _not_ end with a \nobreak command
%       but with a \mbox{}, since we'd rather not have the chapter
%       head move to the next page even if that would result in 
%       the chapter head being the _only_ thing on the page. 
%
\newlength{\@spacebeforechapterhead}
\setmlength{\@spacebeforechapterhead}{\@mult}{15pt}
\newlength{\@spaceinchapterhead}
\setmlength{\@spaceinchapterhead}{\@mult}{3.5pt}
\newlength{\@spaceafterchapterhead}
\setmlength{\@spaceafterchapterhead}{\@mult}{80pt}

\renewcommand{\@makechapterhead}[1]{{%
   \vspace*{\@spacebeforechapterhead}%
   \parindent 0pt \Large\bfseries
   \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
         \@chapapp\enspace\thechapter
      \fi
   \fi
   \interlinepenalty\@M
   \vspace*{\@spaceinchapterhead}%
   \hrule
   \vspace*{\@spaceinchapterhead}%
   {\hfill \LARGE \bfseries #1}%
   \mbox{}\par
   \mbox{}\par
   \mbox{}\par
   \mbox{}\par
%   \mbox{}\par
%   \mbox{}\par
%   \vspace*{\@spaceafterchapterhead}\vspace{\stretch{0.01}\par\mbox{}\par
}}

\renewcommand{\@makeschapterhead}[1]{{%
   \vspace*{\@spacebeforechapterhead}%
   \parindent 0pt \Large\bfseries
   \phantom{\@chapapp}%
   \interlinepenalty\@M
   \vspace*{\@spaceinchapterhead}%
   \hrule
   \vspace*{\@spaceinchapterhead}%
   {\hfill \LARGE \bfseries #1}%
   \mbox{}\par
   \mbox{}\par
   \mbox{}\par
%   \mbox{}\par
%   \mbox{}\par
%   \mbox{}\par
% Note: the above works better when there is little text on the first
% page of the chapter
%   \vspace*{\@spaceafterchapterhead}\vspace{\stretch{0.01}}\par\mbox{}\par
}}
%
%   No pagenumber or headers on skipped pages with cleardoublepage
%
\renewcommand{\cleardoublepage}{%
   \clearpage\if@twoside \ifodd\c@page\else
   \hbox{}\thispagestyle{empty}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi
}
%
%   Theorems: {\bf number.} {\sc type.} {\rm description} \it contents
%
\def\@begintheorem#1#2{%
   \itshape
   \trivlist% changing this in '\begin{trivlist}' yields an error
   \item[\hspace{\labelsep}{\upshape\bfseries #2.}\ {\scshape #1.}]%
}

\renewcommand{\@opargbegintheorem}[3]{%
   \itshape
   \trivlist% changing this in `\begin{trivlist}' yields an error
  \item[\hspace{\labelsep}{\upshape\bfseries #2.}\ {\scshape #1\ ({#3}).}]%
}
%
%   Chapters, sections and other environments are redefined here to no 
%       longer cause uppercased headings. Headings are italized instead of 
%       slanted. The bibliography and index appear in the table of contents.
%
\if@twoside
   \renewcommand{\ps@headings}{%
      \let\@oddfoot\@empty\let\@evenfoot\@empty
      \def\@evenhead{\thepage\hfil\slshape\leftmark}%
      \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
      \let\@mkboth\markboth
      \def\chaptermark##1{\markboth{%
         \ifnum \c@secnumdepth >\m@ne
            \if@mainmatter \@chapapp\ \thechapter. \ \fi
         \fi
         ##1}{}}%
      \def\sectionmark##1{\markright{%
         \ifnum \c@secnumdepth >\z@ \thesection. \ \fi
         ##1}}%
   }
\else
   \renewcommand{\ps@headings}{%
      \let\@oddfoot\@empty
      \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
      \let\@mkboth\markboth
      \def\chaptermark##1{\markright{%
         \ifnum \c@secnumdepth >\m@ne
            \if@mainmatter \@chapapp\ \thechapter. \ \fi
         \fi
         ##1}}
   }
\fi

\renewcommand{\ps@myheadings}{%
   \let\@oddfoot\@empty\let\@evenfoot\@empty
   \def\@evenhead{\thepage\hfil\slshape\leftmark}%
   \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
   \let\@mkboth\@gobbletwo
   \let\chaptermark\@gobble
   \let\sectionmark\@gobble
}
\renewcommand{\tableofcontents}{%
   \if@twocolumn
      \@restonecoltrue\onecolumn
   \else
      \@restonecolfalse
   \fi
   \chapter*{\contentsname
        \@mkboth{\contentsname}{\contentsname}}%    Headings not uppercased
   \@starttoc{toc}%
   \if@restonecol\twocolumn\fi
}

\renewcommand{\listoffigures}{%
   \if@twocolumn
      \@restonecoltrue\onecolumn
   \else
      \@restonecolfalse
   \fi
   \chapter*{\listfigurename
      \@mkboth{\listfigurename}{\listfigurename}}%  Headings not uppercased
   \@starttoc{lof}%
   \if@restonecol\twocolumn\fi
}

\renewcommand{\listoftables}{%
   \if@twocolumn
      \@restonecoltrue\onecolumn
   \else
      \@restonecolfalse
   \fi
   \chapter*{\listtablename
      \@mkboth{\listtablename}{\listtablename}}%    Headings not uppercased
   \@starttoc{lot}%
   \if@restonecol\twocolumn\fi
}

\renewenvironment{thebibliography}[1]{%
   \chapter*{References
      \@mkboth{References}{References}}%            Headings not uppercased
   \addcontentsline{toc}{chapter}{References}%    Add to table-of-contents
   \list{\@biblabel{\arabic{enumiv}}}{%
      \settowidth\labelwidth{\@biblabel{#1}}%
      \leftmargin\labelwidth
      \advance\leftmargin\labelsep
      \@openbib@code
      \usecounter{enumiv}%
      \let\p@enumiv\@empty
      \renewcommand{\theenumiv}{\arabic{enumiv}}%
   }%
   \sloppy\clubpenalty4000\widowpenalty4000%
   \sfcode`\.=\@m
}{%
   \def\@noitemerr{%
      \@latex@warning{Empty `thebibliography' environment}%
   }%
   \endlist
}

\renewenvironment{theindex}{%
   \cleardoublepage%                               Start on a right-hand page
   \if@twocolumn
      \@restonecolfalse
   \else
      \@restonecoltrue
   \fi
   \columnseprule \z@
   \columnsep 35\p@
   \twocolumn[\phantom{\Large\bf\chaptername}%
              \@makeschapterhead{\indexname}]%
   \@mkboth{\indexname}{\indexname}%           Headings not uppercased
   \addcontentsline{toc}{chapter}{Index}%      Add to table-of-contents
   \thispagestyle{plain}\parindent\z@
   \parskip\z@ \@plus .3\p@\relax
   \let\item\@idxitem
}{%
   \if@restonecol\onecolumn\else\clearpage\fi
}
%
%   Define new end-matter environments
%
\newenvironment{thesymbols}{%
   \cleardoublepage%                             Start on a right-hand page
   \if@twocolumn
      \@restonecolfalse
   \else
      \@restonecoltrue
   \fi
   \columnseprule \z@
   \columnsep 35\p@
   \twocolumn[\phantom{\Large\bf\chaptername}%
              \@makeschapterhead{List of symbols}]%
   \@mkboth{List of symbols}{List of symbols}%   Headings not uppercased
   \addcontentsline{toc}{chapter}{List of Symbols}% Add to table-of-contents
   \thispagestyle{plain}\parindent\z@
   \parskip\z@ \@plus .3\p@\relax
   \let\item\@idxitem
}{%
   \if@restonecol\onecolumn\else\clearpage\fi
}

\newcommand{\acknowledgments}{%
   \chapter*{Acknowledgments}%
   \addcontentsline{toc}{chapter}{Acknowledgments}%
   \markboth{Acknowledgments}{Acknowledgments}%
}

\newcommand{\listOfDefinitions}{%
   \chapter*{Glossary}%
   \addcontentsline{toc}{chapter}{Glossary}%
   \markboth{Glossary}{Glossary}%
}

\newcommand{\riassunto}{%
   \chapter*{Riassunto}
   \addcontentsline{toc}{chapter}{Riassunto}
   \markboth{Riassunto}{Riassunto}
}

\newcommand{\zusammenfassung}{%
   \chapter*{Zusammenfassung}
   \addcontentsline{toc}{chapter}{Zusammenfassung}
   \markboth{Zusammenfassung}{Zusammenfassung}
}

\newcommand{\abstract}{%
   \chapter*{Abstract}%
   \addcontentsline{toc}{chapter}{Abstract}%
   \markboth{Abstract}{Abstract}%
}

\newcommand{\curriculum}{%
   \chapter*{Curriculum Vitae and Publications}
   \addcontentsline{toc}{chapter}{Curriculum Vitae and Publications}
  \markboth{Curriculum Vitae}{Curriculum Vitae and Publications}
}

\newenvironment{noindentdescription}%
  {\begin{list}{}{\setlength{\labelwidth}{0pt}
   \setlength{\leftmargin}{\labelwidth}
   \setlength{\itemsep}{-\itemsep}
   \renewcommand{\makelabel}{\descriptionlabel}}}%
  {\end{list}}


% Environment to temporarly change the pagewidth

\newenvironment{changemargin}[2]{%
  \begin{list}{}{%
    \setlength{\topsep}{0pt}%
    \setlength{\leftmargin}{#1}%
    \setlength{\rightmargin}{#2}%
    \setlength{\listparindent}{\parindent}%
    \setlength{\itemindent}{\parindent}%
    \setlength{\parsep}{\parskip}%
  }%
  \item[]}{\end{list}}

% Description environment where the item described is typeset in
% italics.

\newenvironment{descriptionItalicA}
{
  \begin{description}[font=\itshape,labelindent=0mm,leftmargin=*,topsep=0mm]
}
{
  \end{description}
}

% Description environment with the description on the next line.

\newenvironment{descriptionB}
{
  \begin{description}[style=nextline,leftmargin=17mm,topsep=0mm,noitemsep]
}
{
  \end{description}
}

% Useful description list that indents based on the length of a
% parameter, presumably the longest label.

\newenvironment{VarDescription}[1]%
  {\begin{list}{}{\renewcommand{\makelabel}[1]{\textbf{##1:}\hfil}%
    \settowidth{\labelwidth}{\textbf{#1:}}%
    \setlength{\leftmargin}{\labelwidth}\addtolength{\leftmargin}{\labelsep}}}%
  {\end{list}}

% Same without itemseparation

\newenvironment{VarDescriptionNoSep}[1]%
  {\begin{list}{}{\renewcommand{\makelabel}[1]{\textbf{##1:}\hfil}%
    \settowidth{\labelwidth}{\textbf{#1:}}%
    \setlength{\itemsep}{-\itemsep}%
    \setlength{\leftmargin}{\labelwidth}\addtolength{\leftmargin}{\labelsep}}}%
  {\end{list}}

%
%   Italized theorem-like environments
%
\newtheorem{theorem}{Theorem}[section]
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
%
%   Non-italized theorem-like environments:
%
\newtheorem{@definition}[theorem]{Definition}
\newenvironment{definition}{\begin{@definition}\upshape}{\end{@definition}}
\newtheorem{@remark}[theorem]{Remark}
\newenvironment{remark}{\begin{@remark}\upshape}{\end{@remark}}
\newtheorem{@example}[theorem]{Example}
\newenvironment{example}{\begin{@example}\upshape}{\end{@example}}
\newtheorem{@convention}[theorem]{Convention}
\newenvironment{convention}{\begin{@convention}\upshape}{\end{@convention}}
\newtheorem{@fact}[theorem]{Fact}
\newenvironment{fact}{\begin{@fact}\upshape}{\end{@fact}}
\newtheorem{@question}[theorem]{Question}
\newenvironment{question}{\begin{@question}\upshape}{\end{@question}}
%
%   Symbols for AmsTex and bth
%
\newcommand{\bthcslogo}[1]{%
   \includegraphics[width=#1]{bth}%
}
\newcommand{\bthcsnotextlogo}[1]{%
   \includegraphics[width=#1]{bthnotext}%
}

\newcommand{\bthlogo}[1]{%
   \includegraphics[width=#1]{bth}%
}

\endinput

答案1

没有iso选项datetime2,但iso可以设置样式\DTMsetstyle{iso}(例如)

\documentclass[a4paper,oneside]{book}

\usepackage{datetime2}


\DTMsetstyle{iso}

\begin{document}



\begin{center}

\today
\end{center}


\end{document}

相关内容