iopjournal.cls 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. %
  2. % This is file `iopjournal.cls'
  3. %
  4. % This file is distributed in the hope that it will be useful,
  5. % but WITHOUT ANY WARRANTY; without even the implied warranty of
  6. % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  7. %
  8. % IOP Publishing Ltd
  9. %
  10. % email: customerservices@ioppublishing.org
  11. %
  12. % Copyright 2025 IOP Publishing Ltd.
  13. %
  14. % This work may be distributed and/or modified under the
  15. % conditions of the LaTeX Project Public License, either version 1.3c
  16. % of this license or (at your option) any later version.
  17. % The latest version of this license is in
  18. % http://www.latex-project.org/lppl.txt
  19. % and version 1.3c or later is part of all distributions of LaTeX
  20. % version 2005/12/01 or later.
  21. %
  22. % This work has the LPPL maintenance status `maintained'.
  23. %
  24. % The Current Maintainer of this work is IOP Publishing Ltd.
  25. %
  26. \NeedsTeXFormat{LaTeX2e}
  27. \ProvidesClass{iopjournal}[2024/01/31 IOP Publishing journal article LaTeX template]
  28. %Packages that the class file relies on
  29. \RequirePackage{fancyhdr}
  30. \RequirePackage{xcolor}
  31. \RequirePackage{graphicx}
  32. %Options for the class file
  33. \newif\if@anonymous
  34. \@anonymousfalse
  35. \DeclareOption{anonymous}{\@anonymoustrue}
  36. %\DeclareOption{...}{...}
  37. %Pass any undefined options on to the article class
  38. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
  39. %Execute the options
  40. \ProcessOptions\relax
  41. %Load the article class as the basis for the formatting
  42. \LoadClass[a4paper]{article}
  43. \RequirePackage[colorlinks=true, allcolors=blue]{hyperref}
  44. %Define the text area
  45. \setlength\voffset{-25mm}
  46. %\setlength\hoffset{-10mm}
  47. %\setlength\topmargin{10mm}
  48. \setlength\headsep{10mm}
  49. \setlength\footskip{12mm}
  50. \setlength\marginparwidth{25mm}
  51. \setlength\marginparsep{2mm}
  52. \setlength\textwidth{153mm}
  53. \setlength\textheight{255mm}
  54. %General text options, will apply unless commands specify otherwise
  55. \raggedright
  56. \setlength\parindent{15pt}
  57. %Headers and footers
  58. \pagestyle{fancy}
  59. \fancyhfoffset[L]{27mm}
  60. \fancyhead[L]{{\small \sf IOP Publishing}\hspace{5mm} {\it Journal} {\bf vv} (yyyy) aaaaaa}
  61. \fancyhead[C]{}
  62. \fancyhead[R]{Author {\it et al}\ }
  63. \fancyfoot[LR]{}
  64. \fancyfoot[C]{\thepage}
  65. \renewcommand{\headrulewidth}{0.5pt}
  66. \renewcommand{\footrulewidth}{0.5pt}
  67. \renewcommand{\headrule}{\color{gray}\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi
  68. \hrule\@height\headrulewidth\@width\headwidth
  69. \vskip-\headrulewidth}
  70. \renewcommand{\footrule}{{\color{gray}\if@fancyplain\let\footrulewidth\plainfootrulewidth\fi
  71. \vskip-\footruleskip\vskip-\footrulewidth
  72. \hrule\@width\headwidth\@height\footrulewidth\vskip\footruleskip}}
  73. %Article title, type and left-column content
  74. \newcommand{\articletype}[1]{{\vspace*{-8mm}\noindent \Large \sf Journal Name}
  75. \vspace*{8mm} \noindent\reversemarginpar
  76. \marginpar{\vspace{-3mm} {\color{gray}\hrule} \ \\ Crossmark\\ {\color{gray}\hrule} \ \\ \tiny {\sf RECEIVED} {\small \\ dd Month yyyy}\\ \\ {\sf REVISED} {\small \\ dd Month yyyy}}{\scriptsize \sf{\bfseries \MakeUppercase{#1}}}}
  77. \renewcommand{\title}[1]{{\exhyphenpenalty=10000\hyphenpenalty=10000
  78. \fontsize{18}{21}\selectfont\noindent\raggedright
  79. \textsf{#1}\par}\suppressfloats[t]}
  80. \renewcommand{\author}[1]{{\vspace{5mm}%
  81. \fontsize{10}{12}
  82. \raggedright \if@anonymous Author list removed for anonymity \else #1 \fi
  83. \vspace{3mm}}}
  84. \newcommand{\affil}[1]{{\fontsize{8}{10}\selectfont
  85. \raggedright \if@anonymous \phantom{#1} \else #1 \fi}
  86. }
  87. \newcommand{\email}[1]{\vspace*{12pt}{\fontsize{8}{10}\selectfont
  88. \raggedright {\bfseries E-mail:} \if@anonymous \phantom{#1} \else #1 \fi}
  89. \vspace{3mm} }
  90. \newcommand{\keywords}[1]{{\fontsize{8}{10}\selectfont
  91. \raggedright {\bfseries Keywords:} #1}
  92. }
  93. \renewenvironment{abstract}{%
  94. \vspace{16pt plus3pt minus3pt}
  95. {\color{gray}\hrule} \ \\
  96. \noindent \fontsize{11}{12}\selectfont {\bfseries Abstract}\\
  97. \rm\ignorespaces \raggedright}{\vspace{3mm} {\color{gray}\hrule}}
  98. % Section titles
  99. \renewcommand\section{\@startsection {section}{1}{\z@}%
  100. {-3.25ex\@plus -1ex \@minus -.2ex}%
  101. {1sp}%
  102. {\reset@font\normalsize\bfseries\raggedright}}
  103. \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
  104. {-3.25ex\@plus -1ex \@minus -.2ex}%
  105. {1sp}%
  106. {\reset@font\normalsize\itshape\raggedright}}
  107. \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
  108. {-3.25ex\@plus -1ex \@minus -.2ex}%
  109. {-1em \@plus .2em}%
  110. {\reset@font\normalsize\itshape}}
  111. % New command for acknowledgments to enable automatic removal when anonymous option is used
  112. \newcommand{\ack}[1]{
  113. \section*{Acknowledgments}
  114. \if@anonymous Removed for anonymity \else #1 \fi}
  115. \newcommand{\funding}[1]{
  116. \section*{Funding}
  117. \if@anonymous Removed for anonymity \else #1 \fi}
  118. \newcommand{\data}[1]{
  119. \section*{Data availability}
  120. \if@anonymous Removed for anonymity \else #1 \fi}
  121. \newcommand{\roles}[1]{
  122. \section*{Author contributions}
  123. \if@anonymous Removed for anonymity \else #1 \fi}
  124. \newcommand{\suppdata}[1]{
  125. \section*{Supplementary data}
  126. #1}
  127. %Figure captions
  128. \renewcommand{\@makecaption}[2]{\vskip\abovecaptionskip
  129. \sbox\@tempboxa{\fontsize{8}{10}\selectfont {\bfseries #1.} #2}%
  130. \ifdim \wd\@tempboxa >\hsize
  131. \raggedright \fontsize{8}{10}\selectfont {\bfseries #1.} #2\par
  132. \else
  133. \global \@minipagefalse
  134. \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  135. \fi
  136. \vskip\belowcaptionskip}
  137. %Table font style
  138. \let\oldtabular\tabular
  139. \renewcommand{\tabular}{\fontsize{8}{10}\selectfont \oldtabular}
  140. %ORCID
  141. \newcommand{\orcid}[1]{\href{https://orcid.org/#1}{\includegraphics[width=8pt]{orcid}}}
  142. \endinput