summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/gmdoc/gmdocc.cls
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-03-06 01:07:57 +0000
committerKarl Berry <karl@freefriends.org>2010-03-06 01:07:57 +0000
commit89642d23f7bfe9d9b2fbebbc446f7c957da993af (patch)
tree6ea7b858e6b2016751032ea94cd43c3c5e4c8a05 /Master/texmf-dist/tex/latex/gmdoc/gmdocc.cls
parentf276a23ea2fc902e50521314bd7378a95c9e4de9 (diff)
gmdoc 0.991 (5mar10)
git-svn-id: svn://tug.org/texlive/trunk@17338 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/gmdoc/gmdocc.cls')
-rw-r--r--Master/texmf-dist/tex/latex/gmdoc/gmdocc.cls269
1 files changed, 199 insertions, 70 deletions
diff --git a/Master/texmf-dist/tex/latex/gmdoc/gmdocc.cls b/Master/texmf-dist/tex/latex/gmdoc/gmdocc.cls
index 2cfd7c8d979..ff4015c5963 100644
--- a/Master/texmf-dist/tex/latex/gmdoc/gmdocc.cls
+++ b/Master/texmf-dist/tex/latex/gmdoc/gmdocc.cls
@@ -9,12 +9,12 @@
%% Written by Natror (Grzegorz Murzynowski),
%% natror at o2 dot pl
%%
-%% \copyright\,2006, 2007 by Natror (Grzegorz Murzynowski).
+%% ©\,2006–2010 by Natror (Grzegorz Murzynowski).
%%
%% This program is subject to the \LaTeX\ Project Public License.
%% See ^^A
%% \url{http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html} ^^A
-%% for the details of that license.
+%% for the details of that license.\rrthis
%%
%% LPPL status: "author-maintained".\par
%%
@@ -37,11 +37,18 @@
% \chschange{v0.79}{2008/8/9}{271}
% \chschange{v0.80}{2008/8/30}{276}
% \chschange{v0.80}{2008/10/8}{275}
-%
+% \toCTAN{2008/11/22 v0.81}
+% \chschange{v0.82}{2008/12/2}{320}
+% \chschange{v0.82}{2008/12/10}{303}
+% \chschange{v0.82}{2008/12/14}{316}
+% [\cmd\verbatimspecials, hyphenation in verbatims etc.]
+% \chschange{v0.83}{2010/3/2}{332}
+% [abandoning \pk{gmeometric} since \pk{geometry} v.5.2 provides
+% \cmd\newgeometry]
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{gmdocc}
- [2008/10/08 v0.81 a class for gmdoc driver files (GM)]
+ [2010/03/02 v0.84 a class for gmdoc driver files (GM)]
%
% \division{Intro}
@@ -113,7 +120,7 @@
%
% Moreover, if you like MW's classes (as I~do) and need |\chapter|
% (for multiple files' input e.g.), you may declare another \pk{mwcls}
-% with the option homonimic with the class'es name: \TextUsage*{mwrep}
+% with the option homonymic with the class's name: \TextUsage*{mwrep}
% for \pk{mwrep} and \TextUsage*{mwbk} for \pk{mwbk}. For the symmetry
% there's also \TextUsage*{mwart} option (equivalent to the default
% setting).
@@ -129,6 +136,37 @@
% declarations. For use of them check the driver of this documentation
% where the \TeX\ Gyre Pagella font is specified as the default Roman.
%
+% \stanza There are also some options for mono and sans fonts, see the
+% changes history for details.
+%
+% The \TextUsage*{minion} option sets Adobe Minion Pro as the main
+% font, the \TextUsage*{pagella} sets \TeX\ Gyre Pagella as the main
+% font.
+%
+% The \TextUsage*{cronos} option sets Adobe Cronos Pro as the
+% sans serif font, the \TextUsage*{trebuchet} option sets \ac{MS}
+% Trebuchet as sans serif.
+%
+% The \TextUsage*{cursor} (working only
+% with \XeTeX\ \& \pk{fontspec}) option sets \TeX\ Gyre Cursor as the
+% typewriter font. It emboldens it to the optical weight of
+% Computer/Latin Modern Mono in the code (|embolden=2.5|) and leaves
+% light (|embolden=1|) for verbatims in the narrative. Moreover, this
+% option also prepares a~condensed version (|extend=0.87|) for
+% verbatims in the marginpars.
+%
+% Note that with no option for the monospaced font the default (with
+% \XeTeX) will be Latin Modern Mono and then Latin Modern Mono Light
+% Condensed is set for verbatims in marginpars (if available).
+%
+% \stanza
+% This class sets
+% \TextUsage\verbatimspecials{\noverbatimspecials|⁄«»[¿]|} if the
+% engine is \XeTeX, see the
+% \pk{gmverb} documentation to learn about this declaration. Remember
+% that |\verbatimspecials| whatever would they be, have no effect on
+% the code layer.
+%
% \stanza
% The \TextUsage\EOFMark\ in this class typesets like this (of
% course, you can redefine it as you wish):\par\EOFMark
@@ -175,7 +213,7 @@
\gm@DOX{article}{\gmcc@class{article}}% you can also
% \emph{choose} \pk{article}.
% A~meta-remark: When I~tried to do the most natural thing, to
-% |\ExecuteOptionsX| inside such declared option, an error occured:
+% |\ExecuteOptionsX| inside such declared option, an error occurred:
% 'undefined control sequence \inverb|\XKV@resa -> \@nil|'.
@@ -193,28 +231,29 @@
\gm@DOX{noindex}{%
\PassOptionsToPackage{noindex}{gmdoc}}% This
-% option turns the writing outto \file{.idx} file off.
+% option turns the writing out to \file{.idx} file off.
\newif\if@gmccnochanges
\gm@DOX{nochanges}{\@gmccnochangestrue}% This option turns the
-% writing outto \file{.glo} file off.
-
-
-\gm@DOX{gmeometric}{}% The \pk{gmeometric} package
-% causes the |\geometry| macro provided by \pk{geometry} package
-% is not restricted to the preamble.
+% writing out to \file{.glo} file off.
+
+
+% ^^A \gm@DOX{gmeometric}{}% The \pk{gmeometric} package
+% ^^A % causes the |\geometry| macro provided by \pk{geometry} package
+% ^^A % is not restricted to the preamble.
+% ^^A %
+% ^^A % Since version 0.99g of \pk{gmdoc} the bundle goes \XeTeX\ and that
+% ^^A % means \pk{geometry} should be loaded with |dvipdfm| option and the
+% ^^A % |\pdfoutput| counter has to be declared and that's what
+% ^^A % \pk{gmeometric} does by default if with \XeTeX. And \pk{gmeometric}
+% ^^A % has passed enough practical test. Therefore the |gmeometric| option
+% ^^A % becomes obsolete and the package is loaded always instead of
+% ^^A % original \pk{geometry}.
%
-% Since version 0.99g of \pk{gmdoc} the bundle goes \XeTeX\ and that
-% means \pk{geometry} should be loaded with |dvipdfm| option and the
-% |\pdfoutput| counter has to be declared and that's what
-% \pk{gmeometric} does by default if with \XeTeX. And \pk{gmeometric}
-% has passed enough practical test. Therefore the |gmeometric| option
-% becomes obsolete and the package is loaded always instead of
-% original \pk{geometry}.
-%
-% \stanza As already mentioned, since version
+% ^^A~As already mentioned,
+% Since version
% 0.99g the \pk{gmdoc} bundle goes \XeTeX. That means that if \XeTeX\
% is detected, we may load the \pk{fontspec} package and the other two
% of basic three \XeTeX-related, and then we |\fontspec| the fonts.
@@ -225,36 +264,90 @@
\gm@DOX{sysfonts}{\gmcc@oldfontsfalse}
-% Now we define a~key-val option that sets the version of marginpar
-% typewriter font definition (relevant only with the |sysfonts|
-% option). 0 for OpenType \acro{LMTT LC} visible for the system (not on my
-% computer), 1 for \acro{LMTT LC} specially on my computer, any else number to avoid an
-% error if you don't have OpenType \acro{LMTT LC} installed (and leave the
-% default \pk{gmdoc}'s definition of |\marginpartt|; all the versions
-% allow the user to define marginpar typewriter \himher self).
-\gm@DOX{mptt}[17]{\def\mpttversion{#1}}% the default value (17) works if
-% the user puts the |mptt| option with no value. In that case leaving
-% the default \pk{gmdoc}'s definition of marginpar typewriter and
-% letting the user to redefine it \himher self seemed to me most natural.
-
+%^^A % Now we define a~key-val option that sets the version of marginpar
+%^^A % typewriter font definition (relevant only with the |sysfonts|
+%^^A % option). 0 for OpenType \acro{LMTT LC} visible for the system (not on my
+%^^A % computer), 1 for \acro{LMTT LC} specially on my computer, any else number to avoid an
+%^^A % error if you don't have OpenType \acro{LMTT LC} installed (and leave the
+%^^A % default \pk{gmdoc}'s definition of |\marginpartt|; all the versions
+%^^A % allow the user to define marginpar typewriter \himher self).
+\gm@DOX{mptt}[17]{\relax}% now a~no-op, left only for backwards
+% compatibility. It was an option for setting the marginpar
+% typewriter font.
+%^^A % ^^A~\def\mpttversion{#1}
+%^^A % the default value (17) works if
+%^^A % the user puts the |mptt| option with no value. In that case leaving
+%^^A % the default \pk{gmdoc}'s definition of marginpar typewriter and
+%^^A % letting the user to redefine it \himher self seemed to me most natural.
+
+
+\def\gmcc@tout#1{\typeout{^^J@@@@ gmdocc class: #1^^J}}
\def\gmcc@setfont#1{%
\gmcc@oldfontsfalse% note that if we are not in \XeTeX, this switch
% will be turned true in line \ref{ofstrue}
- \AtBeginDocument{%
- \@ifXeTeX{%
- \defaultfontfeatures{Numbers={OldStyle,Proportional}}%
- \setmainfont[Mapping=tex-text]{#1}%
- \setsansfont[Mapping=tex-text, Scale=MatchLowercase]{Latin Modern Sans}%
- \setmonofont[Scale=MatchLowercase]{Latin Modern Mono}%
- \let\sl\it \let\textsl\textit
- }{}}%
-}
+ \AtEndOfClass{%
+ \ifdefined\zf@init\afterfi{%
+ \gmcc@tout{Main font set to #1}%
+ \def\gmcc@dff{Numbers={OldStyle, Proportional}}
+ \@xa\setmainfont\@xa[\gmcc@dff, Mapping=tex-text]{#1}%
+ % ^^A \setsansfont[Mapping=tex-text]{Latin Modern Sans}%
+ % ^^A \gmcc@tout{Sans serif font set to Latin Modern Sans}%
+ % ^^A \setmonofont{Latin Modern Mono}%
+ % \chgs{2008/12/01 v0.82 I~commented out setting of Latin Modern
+ % fonts for sans serif and monospaced: \XeTeX\discret/\pk{fontspec}
+ % does that by default.}
+ % ^^A \def\sl{\it} \def{\textsl}\textit% we cover original \incs{sl}
+ % ^^A % and \incs{textsl} with \incs{def} to allow consistent font
+ % ^^A % change later.
+ \@xa\defaultfontfeatures\@xa{\gmcc@dff, Scale=MatchLowercase}%\
+ % when put before \incs{setmainfont},
+ \gmath
+ \def\LineNumFont{% \chgs{2008/11/30 v0.82 added}
+ \normalfont\scriptsize\addfontfeature{Numbers=Monospaced}}%
+ }%
+ \else\afterfi{\gmcc@tout{I~can set main font to #1 only in
+ XeTeX/fontspec}}%
+ \fi
+ }}
\gm@DOX{minion}{\gmcc@setfont{Minion Pro}}
-\gm@DOX{pagella}{\gmcc@setfont{TeX Gyre Pagella}%
- \def\gmcc@PAGELLA{1}%
+\gm@DOX{pagella}{\gmcc@setfont{TeX Gyre Pagella}
+ % ^^A \def\gmcc@PAGELLA{1}% caused an error
}
+\gm@DOX{cronos}{% \chgs{2008/12/01 v0.82 added, for Iwona sans font}
+ \AtEndOfClass{\setsansfont[Mapping=tex-text]{Cronos Pro}}}
+\gm@DOX{trebuchet}{% \chgs{2008/12/03 v0.82 added, for Trebuchet
+ % \ac{MS} sans font}
+ \AtEndOfClass{\setsansfont[Mapping=tex-text]{Trebuchet MS}}}
+\gm@DOX{myriad}{% \chgs{2008/12/03 v0.82 added, for Myriad Web Pro
+ % sans font}
+ \AtEndOfClass{\setsansfont[Mapping=text-text]{Myriad Web Pro}}}
+\gm@DOX{lsu}{% \chgs{2008/12/03 v0.82 added, for Lucida Sans Unicode
+ % sans font}
+ \AtEndOfClass{\setsansfont[Mapping=tex-text]{Lucida Sans Unicode}}}
+
+\gm@DOX{cursor}{% \chgs{2008/12/01 v0.82 added, for \TeX\ Gyre Cursor
+ % mono font, which I~embolden a~little and shrink
+ % horizontally a~little}
+ % \chgs{2008/12/12 v0.82 subtly distinguished weights of
+ % the \TeX\ Gyre Cyursor typewriter font in the code
+ % and in verbatims in the commentary}
+ \AtEndOfClass{%
+ \setmonofont[FakeBold=2.5, BoldFeatures={FakeBold=0},
+ FakeStretch=0.87, Ligatures=NoCommon
+ ]{TeX Gyre Cursor}%
+ \def\marginpartt{\tt\addfontfeature{FakeBold=2,
+ FakeStretch=0.609}%
+ \color{black}}% to provide proper color when marginpar occurs
+ % between lines that break a~coloured text.
+ \def\narrativett{\ttfamily\addfontfeature{FakeBold=1}}%
+ \let\UrlFont\narrativett
+ }% of |\AtEndOfClass|.
+}% of the |cursor| option.
+
+
+
\gm@DOX{fontspec}{\PassOptionsToPackage{#1}{fontspec}}
@@ -264,17 +357,22 @@
\gm@EOX{class=mwart}% \label{EOXmwart}We set the default basic class to
% be \pk{mwart}.
-\gm@EOX{mptt=0}% We default to set the marginpar typewriter font to
-% OpenType \acro{LMTT LC}.
+%^^A \gm@EOX{mptt=0}% We default to set the marginpar typewriter font to
+%^^A % OpenType \acro{LMTT LC}.
+
+\PassOptionsToPackage{countalllines}{gmdoc}% \chgs[countalllines]{2008/11/30
+% v0.82 \pk{gmdoc} option here executed by % default}
% \HideDefining\DeclareOptionX
\DeclareOptionX*{\PassOptionsToPackage{\CurrentOption}{gmdoc}}
\ProcessOptionsX[gmcc]<>
+%^^A \nameshow{\@currname.\@currext-h@@k}
+
% \newif\ifSecondClass^^A~to assure \TeX knows ifSecondClass
-% ^^A switch and therefore it counts the fis properly.
+% ^^A switch and therefore it counts the |\fi|s properly.
% \iffalse It's for cooperation with my another class. (Feature under
% construction.)
\XKV@ifundefined{ifSecondClass}{%
@@ -290,26 +388,30 @@
% announced, we do the ontological test to any \pk{mwcls}.
\fi
\ifgmcc@mwcls
- \XKV@ifundefined{XeTeXdefaultencoding}{}{%
- \XeTeXdefaultencoding "cp1250"}% \pk{mwcls} are encoding-sensitive
- % because MW uses Polish diacritics in the commentaries.
+%^^A \XKV@ifundefined{XeTeXdefaultencoding}{}{%
+%^^A \XeTeXdefaultencoding "cp1250"}% \pk{mwcls} are encoding-sensitive
+%^^A % because MW uses Polish diacritics in the commentaries.
\LoadClass[fleqn, oneside, noindentfirst, 11pt, withmarginpar,
sfheadings]{\gmcc@CLASS}%
- \XKV@ifundefined{XeTeXdefaultencoding}{}{%
- \XeTeXdefaultencoding "utf-8"}%
+%^^A \XKV@ifundefined{XeTeXdefaultencoding}{}{%
+%^^A \XeTeXdefaultencoding "utf-8"}%
\else
\LoadClass[fleqn, 11pt]{article}% Otherwise the standard \pk{article} is
% loaded.
\fi
% \skiplines
\fi
-% of ifSecondClass'es \cs{else} (a~feature under construction).\endskiplines
+% of |\ifSecondClass|'es \cs{else} (a~feature under construction).\endskiplines
-\RequirePackage{gmutils}[2008/10/08]% we load it early to provide \incs{@ifXeTeX}.
+\RequirePackage{gmutils}[2008/10/08]% we load it early to provide
+% \incs{@ifXeTeX}, but after loading the base class since this package
+% redefines some environments.
+
\ifgmcc@mwcls\afterfi\ParanoidPostsec\fi
+
\@ifXeTeX{}{\gmcc@oldfontstrue}
% \label{ofstrue}
@@ -329,8 +431,8 @@
% font encoding.
\RequirePackage[T1]{fontenc}%
}{}%
-% A~couple of diacritics I~met while \pk{gmdocing} these files and The
-% Source etc. Somewhy the accents didn't want to work at my \XeTeX\
+% A~couple of diacritics I~met while \pk{gmdoc}ing{} these files and The
+% Source etc. Some why the accents didn't want to work at my \XeTeX\
% settings so below I~define them for \XeTeX\ as respective chars.
\def\agrave {\`a}%
\def\cacute {\'c}%
@@ -363,13 +465,15 @@
\fi
% Now we set the page layout.
-\RequirePackage{gmeometric}
-\def\gmdoccMargins{%
- \geometry{top=77pt, height=687pt, % =53 lines but the |lines| option
- % seems not to work 2007/11/15 with \TeX\ Live 2007 and \XeTeX\
- % 0.996-patch1
+\RequirePackage{geometry}
+\def\gmdoccMargins@params{{top=77pt, height=687pt, % =53 lines but the
+ % |lines| option seems not to work 2007/11/15 with \TeX\ Live 2007
+ % and \XeTeX 0.996-patch1
left=4cm, right=2.2cm}}
-\gmdoccMargins
+\def\gmdoccMargins{%
+ \@xa \newgeometry\gmdoccMargins@params}
+
+\@xa\geometry\gmdoccMargins@params
\if@debug% For debugging we load also the \pk{trace} package that was
@@ -393,9 +497,9 @@
\def\marginpartt{\fontspec{LMTypewriter10 LightCondensed}}%
\fi
-\ifnum1=0\csname gmcc@PAGELLA\endcsname\relax
- \RequirePackage{pxfonts,tgpagella,qpxmath}%
-\fi
+%^^A \ifnum1=0\csname gmcc@PAGELLA\endcsname\relax
+%^^A \RequirePackage{pxfonts,tgpagella,qpxmath}%
+%^^A \fi
\raggedbottom
@@ -416,9 +520,9 @@
% boldface and sans serif.
\if@gmccnochanges\let\RecordChanges\relax\fi% If the |nochanges|
-% option is on, we discard writing outto the \file{.glo} file.
+% option is on, we discard writing out to the \file{.glo} file.
-\RecordChanges% We turn the writing the |\changes| outto the
+\RecordChanges% We turn the writing the |\changes| out to the
% \file{.glo} file if not the above.
% \CodeUsgIndex\dekclubs \CodeUsgIndex\smartunder
@@ -428,7 +532,7 @@
% shortverbs}
\edverbs% to redefine |\[| so that it puts a~shortverb in a~|\hbox|.
\smartunder% and we declare the |_| char to behave as usual in the
-% math mode and outside math to be just an uderscore.
+% math mode and outside math to be just an underscore.
\exhyphenpenalty\hyphenpenalty% 'cause \pk{mwcls} set it |=10000| due
% to Polish customs.
@@ -441,6 +545,27 @@
\DoNotIndex{\@nx \@xa %^^A\count \dimen \box \setbox \copy
}
+\provide\ac{\acro}
+% \chgs{2008/11/30 v0.82 added}
+
+\def\+{\-\hskip\z@\penalty\@M} % a~discretionary hyphen that allows
+% further hyphenation
+
+\Xedekfracc
+
+
+\let\mch\metachar
+
+\ATfootnotes
+\AtBegInput{\ATfootnotes}
+
+
+\UrlFix
+
+\GMverbatimspecials
+
+\let\texcode@hook\makestarlow
+
\endinput
% \changes{v0.677}{06/9/23}{Added checkings if \pk{mwart.cls} and
% \pk{lmodern.sty} are available and more standard behaviour if they
@@ -461,10 +586,14 @@
% \changes{v0.78}{2007/11/19}{Added the \env{pagella} option not to
% use Adobe Minion Pro that is not freely licensed}
%
+%
% \Finale
% (For my GNU Emacs:)
%%% Local Variables:
%%% mode: doctex
-%%% TeX-master: "../../../../LaTeX/TeXGuru/gmdoc/gmdocDoc"
+%%% mode: flyspell
+%%% ispell-local-dictionary: "british"
%%% End:
+
+% LocalWords: lowstar