Skip to content

Instantly share code, notes, and snippets.

@hidaruma

hidaruma/word.dtx

Last active May 15, 2017
Embed
What would you like to do?
New word class draft.
% \iffalse-meta comment
%% File: word.dtx
%
% \fi
%\CheckSum{0}
%\iffalse
%\changes{v1.0}{2017/05/15}{First Release}
%\fi
%
%\iffalse
%<*driver>
\ProvidesFile{word.dtx}
%</driver>
%\fi
\ProvidesClass{word}[2017/05/14 WORD Standard LaTeX class]
\LoadClassWithOptions{bxjsarticle}
%\iffalse
%<*driver>
\documentclass{jltxdoc}
\def\fileversion{1.0}
\def\filedate{2017/05/15}
\def\filename{word.dtx}
\title{word.dtx}
\author{hidaruma<hidaruma@outlook.jp>}
\date{\filedate}
\begin{document}
\maketitle
\tableofcontents
\newpage
\DocInput{\filename}
\end{document}
%\</driver>
%\fi
\makeatletter
\@twosidetrue
\makeatother
\RequirePackage{fancyhdr}
\RequirePackage{txfonts}
\newif\if@evenstart \@evenstartfalse
\newif\if@draft \@draftfalse
\newif\if@pagenumber \@pagenumberfalse
\newif\if@lualatex \@lualatexfalse
\DeclareOption{evenstart}{\@evenstarttrue}
\DeclareOption{draft}{%
\setlength\overfullrule{5pt}
\@drafttrue
\@pagenumbertrue
}
\DeclareOption{lualatex}{%
\setmainjfont{HiraMinProN W3}
\setsansjfont{HiraKakuProN W6}
}
\ProcessOptions\relax
\fancyhead{}
\if@pagenumber
\if@evenstart
\fancyhead[RE]{\@subtitle\thepage}
\fancyhead[LO]{\thepage\@subtitle}
\else
\fancyhead[RO]{\@subtitle\thepage}
\fancyhead[LE]{\thepage\@subtitle}
\fi
\else
\if@evenstart
\fancyhead[RE]{\@subtitle}
\fancyhead[LO]{\@subtitle}
\else
\fancyhead[RO]{\@subtitle}
\fancyhead[LE]{\@subtitle}
\fi
\fi
\def\subtitle#1{\gdef\@subtitle{#1}}
\let\@subtitle\@empty
\renewenvironment{titlepage}
{%
\thispagestyle{fancy}%
}
\renewcommand{\rmdefault}{ptm}
\renewcommand{\sfdefault}{ptm}
\newcommand{\@authormark}{文 編集部}
\renewcommand{\maketitle}{\begin{titlepage}%
\begin{center}%
{\LARGE \gt{\@title} \par}%
\vskip 3em
\end{center}%
\begin{flushright}%%
{\normalsize \@authormark\hskip\Cwd\@author}%
\end{flushright}%
\end{titlepage}%
\global\let\@title\@empty
\global\let\@author\@empty
\global\let\title\relax
\global\let\author\relax
}
\pagestyle{fancy}
\input docstrip
\generate{\file{word.cls}{\from{word.dtx}{article}}}
\endbatchfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment