4

I am currently working with the isov2 document class. I have been successful in changing the font of the entire document to Times New Roman. However, I would like for the title, table of contents (the actual words 'Contents'), and all clauses to be in a different font. I think the font is Arial, as seen in the image below.

I have also noticed that a period is being added to all clauses (clause, sclause and ssclause). I would like for a period to ONLY be added to the clause. I am unsure exactly how to edit my current code to adjust that as well. My code follows the image below. Thank you.

Desired Font

\documentclass[draft,wd,letterpaper]{isov2}
\let\ifpdf\relax 

% Overall font to Times New Roman
\usepackage{fontspec}
\setmainfont{Times New Roman}

% Add a period (.) after the clause numbering (in the actual document, NOT toc)
\makeatletter
\def\@seccntformat#1{\csname the#1\endcsname.\quad}
\makeatother

\standard{ISO/IEEE 11073-10201}
\yearofedition{2013}
\languageofedition{(E)}
\setcounter{tocdepth}{3}     % ToC includes ssclauses and above

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\title{Title of Document}{}{}

\tableofcontents

\clause{Clause} This is the first clause
\sclause{SClause} This is a subclause (sclause)
\ssclause{SSClause} This is a sub-subclause (ssclause)
\clause{Clause} This is the second clause
\end{document}
5

The font used for the clause titles is defined in \Cfont, \SCfont and \SSCfont; the standard definition is found in iso11.clo and it's sufficient to redefine them by adding \sffamily.

The period for \clause only can be obtained with a slick trick:

\makeatletter
\def\@seccntformat#1{%
  \csname the#1\endcsname\csname dot#1\endcsname\quad
}
\newcommand{\dotclause}{.}
\makeatother

We define only \dotclause, so when \sclause or \ssclause is used, the \csname...\endcsname construct will just do \relax.

\documentclass[draft,wd,letterpaper]{isov2}

% Overall font to Times New Roman
\usepackage{fontspec}
\setmainfont{Times New Roman}
\setsansfont{TeX Gyre Heros} % or Arial?

\renewcommand{\Cfont}{\sffamily\Large\bfseries}
\renewcommand{\SCfont}{\sffamily\large\bfseries}
\renewcommand{\SSCfont}{\sffamily\normalsize\bfseries}


% Add a period (.) after the clause numbering (in the actual document, NOT toc)
\makeatletter
\def\@seccntformat#1{%
  \csname the#1\endcsname\csname dot#1\endcsname\quad
}
\newcommand{\dotclause}{.}
\makeatother

\standard{ISO/IEEE 11073-10201}
\yearofedition{2013}
\languageofedition{(E)}
\setcounter{tocdepth}{3}     % ToC includes ssclauses and above

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\title{Title of Document}{}{}

\tableofcontents

\clause{Clause} This is the first clause
\sclause{SClause} This is a subclause (sclause)
\ssclause{SSClause} This is a sub-subclause (ssclause)
\clause{Clause} This is the second clause
\end{document}

enter image description here

3
  • (+1) Slick, indeed. But I would like to understand... So \dotsclause etc. get treated as \relax rather than triggering complaints about undefined commands? Is that a feature of \csname... \endcsname? – cfr Aug 7 '14 at 23:15
  • @cfr Yes; if the control sequence resulting from \csname...\endcsname is not yet defined, it is (locally) defined as equivalent to \relax and used as such. – egreg Aug 8 '14 at 8:47
  • Thanks. That was my guess but guesses are often wrong when they are mine ;). – cfr Aug 8 '14 at 18:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.