diff options
author | Karl Berry <karl@freefriends.org> | 2013-07-26 23:10:33 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-07-26 23:10:33 +0000 |
commit | 70387bf1fd37feeb2be25de8b7b23d129b360c86 (patch) | |
tree | 8d24ad5bbfc136bef48a12b642ec98ad2d3250c3 /Master | |
parent | 5470931e429649f810d4d93a735a213ac6b59221 (diff) |
skrapport (26jul13)
git-svn-id: svn://tug.org/texlive/trunk@31289 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/skrapport/README | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/skrapport/skrapport.pdf | bin | 175165 -> 220398 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/skrapport/skrapport.tex | 204 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/skrapport/skrapport.cls | 163 |
4 files changed, 238 insertions, 131 deletions
diff --git a/Master/texmf-dist/doc/latex/skrapport/README b/Master/texmf-dist/doc/latex/skrapport/README index 92f3c99ab0d..14face239ad 100644 --- a/Master/texmf-dist/doc/latex/skrapport/README +++ b/Master/texmf-dist/doc/latex/skrapport/README @@ -26,7 +26,7 @@ %% * skrapport-size11pt.clo %% * skrapport-size12pt.clo -This is version 0.12a of the skrapport document class, intended for simple +This is version 0.12b of the skrapport document class, intended for simple reports submitted by the author at Chalmers University of Technology. The following files are enclosed. diff --git a/Master/texmf-dist/doc/latex/skrapport/skrapport.pdf b/Master/texmf-dist/doc/latex/skrapport/skrapport.pdf Binary files differindex bb78e6b57b2..8a5a3d7fc6d 100644 --- a/Master/texmf-dist/doc/latex/skrapport/skrapport.pdf +++ b/Master/texmf-dist/doc/latex/skrapport/skrapport.pdf diff --git a/Master/texmf-dist/source/latex/skrapport/skrapport.tex b/Master/texmf-dist/source/latex/skrapport/skrapport.tex index 0db7af4c976..96f760f7460 100644 --- a/Master/texmf-dist/source/latex/skrapport/skrapport.tex +++ b/Master/texmf-dist/source/latex/skrapport/skrapport.tex @@ -90,7 +90,7 @@ % This is where the documentation begins \begin{document} % Change & version info - \version{0.12a} + \version{0.12b} \changes{0.01}{Initial version} \changes{0.03}{Removed \cs{rd} and \cs{id}} \changes{0.04}{Added \pkg{microtype} package} @@ -111,6 +111,7 @@ \changes{0.12}{Deprecated several macros, moved to \LaTeX3. Use of TOC depth above 3 is now unsupported} \changes{0.12a}{The \pkg{fontspec} package is now only loaded when using the \texttt{word} or \texttt{none} font stacks on \hologo{LuaLaTeX} or \hologo{XeLaTeX}. The \texttt{word} font stack is now the default font stack on \hologo{XeLaTeX}} + \changes{0.12b}{Minor and major bugfixes to \cs{maketitle}, \opt{ptsize}, \opt{twocolumn} and others} % Metadata \package[ctan=skrapport,vcs=https://github.com/urdh/skrapport]{skrapport} @@ -252,10 +253,10 @@ Font stack & Serif font & Math font & Sans serif font & Monospace font \\ \midrule \texttt{kpfonts} & Kp-Fonts & Kp-Fonts & Kp-Fonts & Kp-Fonts \\ - \texttt{lmodern} & Latin Modern & Latin Modern & Latin Modern & Inconsolata \\ - \texttt{palatino} & \TeX\ Gyre & PX & Arev & Inconsolata \\ - \texttt{minion} & Minion Pro & Minion Pro & Myriad Pro & Inconsolata \\ - \texttt{skdoc} & PT Serif & --- & Open Sans & Inconsolata \\ + \texttt{lmodern} & Latin Modern & Latin Modern & Latin Modern & Source Code Pro \\ + \texttt{palatino} & \TeX\ Gyre & PX & Arev & Source Code Pro \\ + \texttt{minion} & Minion Pro & Minion Pro & Myriad Pro & Source Code Pro \\ + \texttt{skdoc} & PT Serif & --- & Open Sans & Source Code Pro \\ \texttt{word} & Cambria & Cambria Math & Calibri & Consolas \\ \bottomrule \end{tabular} @@ -272,8 +273,8 @@ or \pkg{polyglossia} with either of these languages. Additionally, the class may load the \pkg{skmath} package if desirable. - \Option{math}\WithValues{true, false}\AndDefault{true} - When \texttt{true}, the \pkg{skmath} package is loaded, providing + \Option{nomath}\WithValues{true, false}\AndDefault{false} + When \texttt{false}, the \pkg{skmath} package is loaded, providing improvements to the math functionality of \pkg{amsmath} and friends. \Option{lang}\WithValues{en, sv}\AndDefault{sv} @@ -334,7 +335,7 @@ relevant to describe. It simply sets the title of the document, as displayed by \cs{maketitle}. - \DescribeMacro\maketitle[hide={date,email},nopdfinfo] + \DescribeMacro\maketitle[hide=\{date,regarding,email\},nopdfinfo] As in \pkg{article}, the \cs{maketitle} macro typesets the information provided by \cs{title}, \cs{author} and friends to form a stylish front page. When combined with \env{abstract}, @@ -343,7 +344,8 @@ The optional argument is a key-value list with two valid entries, \opt*{hide} and \opt*{nopdfinfo}. The \opt*{hide} entry accepts a - comma-separated list in which the values \opt*{date} and \opt*{email} + comma-separated list in which the values \opt*{date}, + \opt*{regarding} and \opt*{email} are interpreted as instructions to hide the corresponding entry from the front page. The \opt*{nopdfinfo} key disables the generation of PDF information by \pkg{hyperref}. @@ -593,7 +595,7 @@ \begin{MacroCode}{class} \RequirePackage{expl3,l3keys2e,xparse,xstring,etoolbox} \ProvidesExplClass{skrapport}% - {2013/06/24}{0.12a}{stylish report document class} + {2013/07/24}{0.12b}{stylish report document class} \end{MacroCode} \subsection{Messages} @@ -631,8 +633,8 @@ \msg_new:nnnn{skrapport}{color-patch-failed}{Could~not~patch~macro~\token_to_str:N#1!} {The~macro~\token_to_str:N#1~could~not~be~patched!~Color~theme~ support~may~be~incomplete.} -\msg_new:nnnn{skrapport}{license-not-printed}{Detected~\token_to_str:N\license~but~no~`titlepage'!} - {The~text~provided~by~\token_to_str:N\license~is~only~printed~when~ +\msg_new:nnnn{skrapport}{license-not-printed}{Detected~\token_to_str:N\license\ but~no~`titlepage'!} + {The~text~provided~by~\token_to_str:N\license\ is~only~printed~when~ the~`titlepage'~environment~is~used,~but~it~seems~to~be~missing.} \msg_new:nnnn{skrapport}{font-requires-xetex}{The~`font=#1'~option~requires~XeTeX~or~luaTeX!} {Please~choose~another~font~setup~or~compile~the~document~with~ @@ -640,6 +642,8 @@ \msg_new:nnnn{skrapport}{tocdepth-too-deep}{TOC~depth~is~too~deep!} {The~current~tocdepth,~#1,~is~not~supported.~Please~redefine~the~ \token_to_str:N#2~macro~to~enable~support.} +\msg_new:nnnn{skrapport}{caption-in-figcenter}{Cannot~use~\token_to_str:N\caption\ here!} + {The~\token_to_str:N\caption\ macro~can't~be~used~inside~figcenter~environments!~Please~move~the~caption~to~the~enclosing~float~environment.} \end{MacroCode} This message should probably not be used at all. Except in development versions straight off Github, of course. @@ -733,9 +737,9 @@ \end{MacroCode} \begin{macro*}{\c__skrapport_ptsize_token} \begin{MacroCode}{class} - {10pt}{\token_new:Nn\c__skrapport_ptsize_token{0}} - {11pt}{\token_new:Nn\c__skrapport_ptsize_token{1}} - {12pt}{\token_new:Nn\c__skrapport_ptsize_token{2}} + {10pt}{\int_const:Nn\c__skrapport_ptsize_int{0}} + {11pt}{\int_const:Nn\c__skrapport_ptsize_int{1}} + {12pt}{\int_const:Nn\c__skrapport_ptsize_int{2}} \end{MacroCode} \end{macro*} \begin{MacroCode}{class} @@ -763,28 +767,45 @@ \cs_new:Nn\__skrapport_setup_twocolumn:{ \RequirePackage{etoolbox} \AtBeginDocument{ - \KOMAoptions{twocolumn=true} + \KOMAoptions{twocolumn=false,DIV=12} } \end{MacroCode} We include the \pkg{grid} package in two-column mode, because it looks way better that way. \begin{MacroCode}{class} - \int_set:Nn\l_tmpa_int{1\c__skrapport_ptsize_token} - \int_set:Nn\l_tmpb_int{1.2*\l_tmpa_int} + \int_set:Nn\l_tmpa_int{10+\c__skrapport_ptsize_int} + \int_set:Nn\l_tmpb_int{12*\l_tmpa_int/10} \RequirePackage[fontsize=\l_tmpa_int pt, baseline=\l_tmpb_int pt, lines=\g__skrapport_grid_lines_int]{grid} \end{MacroCode} - Now, we patch commands. First up is \env{abstract}. + Now, we patch commands. First up is \env{abstract}. Save the old + one in case we need it (we do). \begin{MacroCode}{class} + \cs_set_eq:Nc\__skrapport_onecol_abstract:{environment~abstract~code} + \cs_set_eq:Nc\__skrapport_end_onecol_abstract:{environment~abstract~end~aux~} + \pretocmd{\__skrapport_onecol_abstract:}{\null}{}{} \RenewDocumentEnvironment{abstract}{}{\section*{\abstractname}}{} \end{MacroCode} - Then \env{document} (kind of, at least) and \cs{maketitle}. + Then \env{document} (kind of, at least) and \cs{maketitle}. Again, + save the old \cs{maketitle}. \begin{MacroCode}{class} \AfterEndPreamble{\begin{multicols}{2}} \AtEndDocument{\end{multicols}} - \pretocmd{\maketitle}{\end{multicols}}{}{} - \apptocmd{\maketitle}{\begin{multicols}{2}}{}{} + \cs_set_eq:NN\__skrapport_onecol_maketitle:\maketitle + \pretocmd{\maketitle}{\begin{onecol}}{}{} + \apptocmd{\maketitle}{\end{onecol}}{}{} +\end{MacroCode} + Next up is \env{titlepage}. This is where we need the saved + \env{abstract} and \cs{maketitle}. +\begin{MacroCode}{class} + \BeforeBeginEnvironment{titlepage}{ + \begin{onecol} + \cs_set_eq:cN{environment~abstract~code}\__skrapport_onecol_abstract: + \cs_set_eq:cN{environment~abstract~end~aux~}\__skrapport_end_onecol_abstract: + \cs_set_eq:NN\maketitle\__skrapport_onecol_maketitle: + } + \AfterEndEnvironment{titlepage}{\end{onecol}} \end{MacroCode} Always typeset \env{equation} and friends outside the grid: \begin{MacroCode}{class} @@ -813,74 +834,100 @@ \BeforeBeginEnvironment{alignat*}{\begin{gridenv}} \AfterEndEnvironment{alignat*}{\end{gridenv}} \end{MacroCode} + Since \pkg{grid} just overrides whatever sectioning macros we + define normally, we have to fix them up to make the public API + conform with the one-column mode. This is only necessary for + the \enquote{major} sectioning macros, not \cs*{paragraph} and + \cs*{subparagraph}. +\begin{MacroCode}{class} + \cs_set_eq:NN\__skrapport_saved_section:w\section + \RenewDocumentCommand\section{som}{ + \IfBooleanTF{##1} + {\__skrapport_saved_section:w*{##3}} + {\IfNoValueTF{##2} + {\__skrapport_saved_section:w{##3}} + {\__skrapport_saved_section:w[##2]{##3}} + } + } + \cs_set_eq:NN\__skrapport_saved_subsection:w\subsection + \RenewDocumentCommand\subsection{som}{ + \IfBooleanTF{##1} + {\__skrapport_saved_subsection:w*{##3}} + {\IfNoValueTF{##2} + {\__skrapport_saved_subsection:w{##3}} + {\__skrapport_saved_subsection:w[##2]{##3}} + } + } + \cs_set_eq:NN\__skrapport_saved_subsubsection:w\subsubsection + \RenewDocumentCommand\subsubsection{som}{ + \IfBooleanTF{##1} + {\__skrapport_saved_subsubsection:w*{##3}} + {\IfNoValueTF{##2} + {\__skrapport_saved_subsubsection:w{##3}} + {\__skrapport_saved_subsubsection:w[##2]{##3}} + } + } +\end{MacroCode} The \env{figure} environment is patched\ldots \begin{MacroCode}{class} - \cs_set_eq:Nc\__skrapport_old_figurest:{figure*} - \cs_set_eq:Nc\__skrapport_old_endfigurest:{endfigure*} + \cs_new:Npn\__skrapport_xdblfloat:nn##1##2{\@xdblfloat{##1}[##2]} + \cs_generate_variant:Nn\__skrapport_xdblfloat:nn{nx} \RenewDocumentEnvironment{figure}{o}{ \begin{gridenv} \vspace{\intextsep} \begin{minipage}{\linewidth} - \cs_set:Nn\@captype{figure} + \cs_set:Npn\@captype{figure} + \centering }{ \end{minipage} \vspace{\intextsep} \end{gridenv} } \RenewDocumentEnvironment{figure*}{o}{ - \begin{onecol} - \__skrapport_old_figurest: + \__skrapport_xdblfloat:nx{figure} + {\IfNoValueTF{##1}{tp}{##1}} + \dim_set_eq:NN\hsize\textwidth + \dim_set_eq:NN\linewidth\textwidth + \centering }{ - \__skrapport_old_endfigurest: - \end{onecol} + \end@dblfloat } \end{MacroCode} \ldots as is \env{table}. \begin{MacroCode}{class} - \cs_set_eq:Nc\__skrapport_old_tablest:{table*} - \cs_set_eq:Nc\__skrapport_old_endtablest:{endtable*} \RenewDocumentEnvironment{table}{o}{% \begin{gridenv} \vspace{\intextsep} \begin{minipage}{\linewidth} - \cs_set:Nn\@captype{table} + \cs_set:Npn\@captype{table} \cs_set_eq:NN\__skrapport_old_caption:\caption \RenewDocumentCommand{\caption}{om}{% \skip_set_eq:NN\l_tmpa_skip\abovecaptionskip \skip_set_eq:NN\abovecaptionskip\belowcaptionskip \skip_set_eq:NN\belowcaptionskip\l_tmpa_skip \vspace{\abovecaptionskip} - \__skrapport_old_caption:[##1]{##2} + \__skrapport_old_caption:[####1]{####2} \vspace{\belowcaptionskip} } + \centering }{ \end{minipage} \vspace{\intextsep} \end{gridenv} } - \cs_set_eq:NN\__skrapport_old_tablest:\__skrapport_old_old_tablest: - \cs_set:Nn\__skrapport_old_tablest:{ - \__skrapport_old_old_tablest: - \cs_set_eq:NN\__skrapport_old_caption:\caption - \RenewDocumentCommand{\caption}{om}{% - \skip_set_eq:NN\l_tmpa_skip\abovecaptionskip - \skip_set_eq:NN\abovecaptionskip\belowcaptionskip - \skip_set_eq:NN\belowcaptionskip\l_tmpa_skip - \vspace{\abovecaptionskip} - \__skrapport_old_caption:[##1]{##2} - \vspace{\belowcaptionskip} - } - } \RenewDocumentEnvironment{table*}{o}{ - \begin{onecol} - \__skrapport_old_tablest: + \__skrapport_xdblfloat:nx{table} + {\IfNoValueTF{##1}{tp}{##1}} + \dim_set_eq:NN\hsize\textwidth + \dim_set_eq:NN\linewidth\textwidth + \centering }{ - \__skrapport_old_endtablest: - \end{onecol} + \end@dblfloat } \end{MacroCode} \begin{environment}{onecol} \changes{0.10}{Fixed, now not completely broken} + \changes{0.12b}{Reverted to \cs{newenvironment}, because \pkg{xparse} breaks the trickery} Finally, we define an environment \env{onecol} that typesets arbitrary material in a single column. This is a bit tricky to do, and probably cargo-cult as well. We define the start of the @@ -896,20 +943,20 @@ \env{onecol} at the start of the next \env{multicols}. Voilá, no wierd group errors! \begin{MacroCode}{class} - \DeclareDocumentEnvironment{onecol}{ + \newenvironment{onecol}{ \end{onecol} \end{multicols} \group_begin: - \cs_set:Nn\endonecol{ + \cs_set:Npn\endonecol{ \group_end: \begin{multicols}{2} \cs_set_eq:NN\__skrapport_old_onecol:\onecol - \cs_set:Nn\onecol{ + \cs_set:Npn\onecol{ \cs_set_eq:NN\onecol\__skrapport_old_onecol: } \begin{onecol} } - \cs_set:Nn\onecol{} + \cs_set:Npn\onecol{} \begin{onecol} }{} \end{MacroCode} @@ -1192,12 +1239,12 @@ packages by definition, and \texttt{kpfonts} already loads them internally \footcite[p.~1]{kpfonts}. They are always useful. - We also load \pkg{inconsolata} as our monospace font. + We also load \pkg{sourcecodepro} as our monospace font. But we don't load it when using the \texttt{none} font stack. \begin{MacroCode}{class} \str_if_eq:nnF{#1}{kpfonts}{ \str_if_eq:nnF{#1}{word}{ - \RequirePackage[scaled=1.03]{inconsolata} + \RequirePackage{sourcecodepro} } \AtEndOfClass{ \RequirePackage{amsmath} @@ -2130,7 +2177,8 @@ hide .clist_set:N = \l__skrapport_maketitle_hide_clist, hide .value_required:, nopdfinfo .bool_set_inverse:N = \l__skrapport_maketitle_pdfinfo_bool, - nopdfinfo .default:n = true + nopdfinfo .default:n = true, + nopdfinfo .initial:n = false } \end{MacroCode} \begin{macro*}{\__skrapport_smallprint_style:} @@ -2147,8 +2195,6 @@ \begin{MacroCode}{class} \DeclareDocumentCommand\maketitle{o}{ \clist_clear:N\l__skrapport_maketitle_hide_clist - \bool_new:N\l__skrapport_maketitle_pdfinfo_bool - \bool_set_true:N\l__skrapport_maketitle_pdfinfo_bool \IfNoValueF{#1}{\keys_set:nn{skrapport/maketitle}{#1}} \bool_if:NT\l__skrapport_maketitle_pdfinfo_bool{ \exp_args:NNx\cs_if_exist_use:NT\hypersetup{{ @@ -2195,12 +2241,20 @@ \hbox:n{} \begin{flushleft} \vspace{-\headsep} - \clist_if_in:NnF\l__skrapport_maketitle_hide_clist{date}{ + \clist_if_in:NnF\l__skrapport_maketitle_hide_clist{regarding}{ \small\__skrapport_smallprint_style: \tl_use:N\g__skrapport_regarding_tl - \tl_if_empty:NF\g__skrapport_regarding_tl{,~} - \tl_use:N\g__skrapport_date_tl\par + \clist_if_in:NnF\l__skrapport_maketitle_hide_clist{date}{ + \tl_if_empty:NF\g__skrapport_regarding_tl{,~} + } + } + \clist_if_in:NnF\l__skrapport_maketitle_hide_clist{date}{ + \tl_use:N\g__skrapport_date_tl } + \clist_if_in:NnTF\l__skrapport_maketitle_hide_clist{regarding}{ + \clist_if_in:NnTF\l__skrapport_maketitle_hide_clist{date} + {}{\par} + }{\par} \vspace{1.5cm} { \Huge\__skrapport_title_style: @@ -2909,43 +2963,43 @@ \begin{macro}{\rm} \changes{0.12}{Deprecated command} \begin{MacroCode}{class} -\DeclareDocumentCommand\rm{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\rm}{\textrm}} +\DeclareDocumentCommand\rm{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\rm}{\textrm}} \end{MacroCode} \end{macro} \begin{macro}{\sf} \changes{0.12}{Deprecated command} \begin{MacroCode}{class} -\DeclareDocumentCommand\sf{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\sf}{\textsf}} +\DeclareDocumentCommand\sf{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\sf}{\textsf}} \end{MacroCode} \end{macro} \begin{macro}{\tt} \changes{0.12}{Deprecated command} \begin{MacroCode}{class} -\DeclareDocumentCommand\tt{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\tt}{\texttt}} +\DeclareDocumentCommand\tt{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\tt}{\texttt}} \end{MacroCode} \end{macro} \begin{macro}{\bf} \changes{0.12}{Deprecated command} \begin{MacroCode}{class} -\DeclareDocumentCommand\bf{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\bf}{\textbf}} +\DeclareDocumentCommand\bf{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\bf}{\textbf}} \end{MacroCode} \end{macro} \begin{macro}{\it} \changes{0.12}{Deprecated command} \begin{MacroCode}{class} -\DeclareDocumentCommand\it{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\it}{\textit}} +\DeclareDocumentCommand\it{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\it}{\textit}} \end{MacroCode} \end{macro} \begin{macro}{\sl} \changes{0.12}{Deprecated command} \begin{MacroCode}{class} -\DeclareDocumentCommand\sl{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\sl}{\textsl}} +\DeclareDocumentCommand\sl{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\sl}{\textsl}} \end{MacroCode} \end{macro} \begin{macro}{\sc} \changes{0.12}{Deprecated command} \begin{MacroCode}{class} -\DeclareDocumentCommand\sc{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\sc}{\textsc}} +\DeclareDocumentCommand\sc{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\sc}{\textsc}} \end{MacroCode} \end{macro} @@ -2956,7 +3010,7 @@ \begin{macro*}{\em} \changes{0.12}{Deprecated command} \begin{MacroCode}{class} -\DeclareDocumentCommand\em{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\em}{\emph}} +\DeclareDocumentCommand\em{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\em}{\emph}} \end{MacroCode} \end{macro*} \begin{macro*}{\__skrapport_emphstyle:} @@ -3102,6 +3156,8 @@ \begin{environment}{figcenter} \begin{MacroCode}{class} \DeclareDocumentEnvironment{figcenter}{}{ + \cs_set_eq:NN\l__tmpa_cs\caption + \cs_set:Npn\caption{\msg_error:nn{skrapport}{caption-in-figcenter}} \coffin_clear:N\l_tmpa_coffin \hcoffin_set:Nw\l_tmpa_coffin }{ @@ -3109,6 +3165,8 @@ \dim_set:Nn\l_tmpa_dim{(\textwidth - \coffin_wd:N\l_tmpa_coffin)/2} \skip_horizontal:n{-\l_tmpa_dim} \coffin_typeset:Nnnnn\l_tmpa_coffin{H}{l}{0pt}{0pt} + \cs_set_eq:NN\caption\l__tmpa_cs + \cs_undefine:N\l__tmpa_cs } \end{MacroCode} \end{environment} @@ -3412,10 +3470,14 @@ \end{macro} \begin{macro}{\comment} \changes{0.10}{Added macro for comments} + \changes{0.12b}{No longer uses \cs{colorbox} if no color package is loaded} \begin{MacroCode}{class} \DeclareDocumentCommand\comment{sm}{ \IfBooleanTF{#1} - {\colorbox{red!50}{\__skrapport_comment:n{#2}}} + { + \cs_if_exist_use:NT\colorbox{{red!50}} + {\__skrapport_comment:n{#2}} + } {\marginpar{\__skrapport_comment:n{#2}}} } \end{MacroCode} diff --git a/Master/texmf-dist/tex/latex/skrapport/skrapport.cls b/Master/texmf-dist/tex/latex/skrapport/skrapport.cls index e67a17fdb2d..fcbdcea0594 100644 --- a/Master/texmf-dist/tex/latex/skrapport/skrapport.cls +++ b/Master/texmf-dist/tex/latex/skrapport/skrapport.cls @@ -29,7 +29,7 @@ \RequirePackage{expl3,l3keys2e,xparse,xstring,etoolbox} \ProvidesExplClass{skrapport}% - {2013/06/24}{0.12a}{stylish report document class} + {2013/07/24}{0.12b}{stylish report document class} \msg_new:nnnn{skrapport}{option-deprecated}{Option~`#1'~deprecated!} {Please~use~`#2'~instead.} \msg_new:nnnn{skrapport}{option-no-effect}{Option~`#1'~deprecated!} @@ -62,8 +62,8 @@ \msg_new:nnnn{skrapport}{color-patch-failed}{Could~not~patch~macro~\token_to_str:N#1!} {The~macro~\token_to_str:N#1~could~not~be~patched!~Color~theme~ support~may~be~incomplete.} -\msg_new:nnnn{skrapport}{license-not-printed}{Detected~\token_to_str:N\license~but~no~`titlepage'!} - {The~text~provided~by~\token_to_str:N\license~is~only~printed~when~ +\msg_new:nnnn{skrapport}{license-not-printed}{Detected~\token_to_str:N\license\ but~no~`titlepage'!} + {The~text~provided~by~\token_to_str:N\license\ is~only~printed~when~ the~`titlepage'~environment~is~used,~but~it~seems~to~be~missing.} \msg_new:nnnn{skrapport}{font-requires-xetex}{The~`font=#1'~option~requires~XeTeX~or~luaTeX!} {Please~choose~another~font~setup~or~compile~the~document~with~ @@ -71,6 +71,8 @@ \msg_new:nnnn{skrapport}{tocdepth-too-deep}{TOC~depth~is~too~deep!} {The~current~tocdepth,~#1,~is~not~supported.~Please~redefine~the~ \token_to_str:N#2~macro~to~enable~support.} +\msg_new:nnnn{skrapport}{caption-in-figcenter}{Cannot~use~\token_to_str:N\caption\ here!} + {The~\token_to_str:N\caption\ macro~can't~be~used~inside~figcenter~environments!~Please~move~the~caption~to~the~enclosing~float~environment.} \msg_new:nnn{skrapport}{not-implemented} {Unimplemented~macro~\token_to_str:N#1!} \bool_new:N\g__skrapport_draft_bool @@ -95,9 +97,9 @@ } \cs_new:Npn\__skrapport_setup_ptsize:n#1{ \str_case:nnn{#1}{ - {10pt}{\token_new:Nn\c__skrapport_ptsize_token{0}} - {11pt}{\token_new:Nn\c__skrapport_ptsize_token{1}} - {12pt}{\token_new:Nn\c__skrapport_ptsize_token{2}} + {10pt}{\int_const:Nn\c__skrapport_ptsize_int{0}} + {11pt}{\int_const:Nn\c__skrapport_ptsize_int{1}} + {12pt}{\int_const:Nn\c__skrapport_ptsize_int{2}} }{ \msg_critical:nnn{skrapport}{invalid-point-size}{#1} } @@ -106,18 +108,29 @@ \cs_new:Nn\__skrapport_setup_twocolumn:{ \RequirePackage{etoolbox} \AtBeginDocument{ - \KOMAoptions{twocolumn=true} + \KOMAoptions{twocolumn=false,DIV=12} } - \int_set:Nn\l_tmpa_int{1\c__skrapport_ptsize_token} - \int_set:Nn\l_tmpb_int{1.2*\l_tmpa_int} + \int_set:Nn\l_tmpa_int{10+\c__skrapport_ptsize_int} + \int_set:Nn\l_tmpb_int{12*\l_tmpa_int/10} \RequirePackage[fontsize=\l_tmpa_int pt, baseline=\l_tmpb_int pt, lines=\g__skrapport_grid_lines_int]{grid} + \cs_set_eq:Nc\__skrapport_onecol_abstract:{environment~abstract~code} + \cs_set_eq:Nc\__skrapport_end_onecol_abstract:{environment~abstract~end~aux~} + \pretocmd{\__skrapport_onecol_abstract:}{\null}{}{} \RenewDocumentEnvironment{abstract}{}{\section*{\abstractname}}{} \AfterEndPreamble{\begin{multicols}{2}} \AtEndDocument{\end{multicols}} - \pretocmd{\maketitle}{\end{multicols}}{}{} - \apptocmd{\maketitle}{\begin{multicols}{2}}{}{} + \cs_set_eq:NN\__skrapport_onecol_maketitle:\maketitle + \pretocmd{\maketitle}{\begin{onecol}}{}{} + \apptocmd{\maketitle}{\end{onecol}}{}{} + \BeforeBeginEnvironment{titlepage}{ + \begin{onecol} + \cs_set_eq:cN{environment~abstract~code}\__skrapport_onecol_abstract: + \cs_set_eq:cN{environment~abstract~end~aux~}\__skrapport_end_onecol_abstract: + \cs_set_eq:NN\maketitle\__skrapport_onecol_maketitle: + } + \AfterEndEnvironment{titlepage}{\end{onecol}} \BeforeBeginEnvironment{equation}{\begin{gridenv}} \AfterEndEnvironment{equation}{\end{gridenv}} \BeforeBeginEnvironment{equation*}{\begin{gridenv}} @@ -142,80 +155,98 @@ \AfterEndEnvironment{alignat}{\end{gridenv}} \BeforeBeginEnvironment{alignat*}{\begin{gridenv}} \AfterEndEnvironment{alignat*}{\end{gridenv}} - \cs_set_eq:Nc\__skrapport_old_figurest:{figure*} - \cs_set_eq:Nc\__skrapport_old_endfigurest:{endfigure*} + \cs_set_eq:NN\__skrapport_saved_section:w\section + \RenewDocumentCommand\section{som}{ + \IfBooleanTF{##1} + {\__skrapport_saved_section:w*{##3}} + {\IfNoValueTF{##2} + {\__skrapport_saved_section:w{##3}} + {\__skrapport_saved_section:w[##2]{##3}} + } + } + \cs_set_eq:NN\__skrapport_saved_subsection:w\subsection + \RenewDocumentCommand\subsection{som}{ + \IfBooleanTF{##1} + {\__skrapport_saved_subsection:w*{##3}} + {\IfNoValueTF{##2} + {\__skrapport_saved_subsection:w{##3}} + {\__skrapport_saved_subsection:w[##2]{##3}} + } + } + \cs_set_eq:NN\__skrapport_saved_subsubsection:w\subsubsection + \RenewDocumentCommand\subsubsection{som}{ + \IfBooleanTF{##1} + {\__skrapport_saved_subsubsection:w*{##3}} + {\IfNoValueTF{##2} + {\__skrapport_saved_subsubsection:w{##3}} + {\__skrapport_saved_subsubsection:w[##2]{##3}} + } + } + \cs_new:Npn\__skrapport_xdblfloat:nn##1##2{\@xdblfloat{##1}[##2]} + \cs_generate_variant:Nn\__skrapport_xdblfloat:nn{nx} \RenewDocumentEnvironment{figure}{o}{ \begin{gridenv} \vspace{\intextsep} \begin{minipage}{\linewidth} - \cs_set:Nn\@captype{figure} + \cs_set:Npn\@captype{figure} + \centering }{ \end{minipage} \vspace{\intextsep} \end{gridenv} } \RenewDocumentEnvironment{figure*}{o}{ - \begin{onecol} - \__skrapport_old_figurest: + \__skrapport_xdblfloat:nx{figure} + {\IfNoValueTF{##1}{tp}{##1}} + \dim_set_eq:NN\hsize\textwidth + \dim_set_eq:NN\linewidth\textwidth + \centering }{ - \__skrapport_old_endfigurest: - \end{onecol} + \end@dblfloat } - \cs_set_eq:Nc\__skrapport_old_tablest:{table*} - \cs_set_eq:Nc\__skrapport_old_endtablest:{endtable*} \RenewDocumentEnvironment{table}{o}{% \begin{gridenv} \vspace{\intextsep} \begin{minipage}{\linewidth} - \cs_set:Nn\@captype{table} + \cs_set:Npn\@captype{table} \cs_set_eq:NN\__skrapport_old_caption:\caption \RenewDocumentCommand{\caption}{om}{% \skip_set_eq:NN\l_tmpa_skip\abovecaptionskip \skip_set_eq:NN\abovecaptionskip\belowcaptionskip \skip_set_eq:NN\belowcaptionskip\l_tmpa_skip \vspace{\abovecaptionskip} - \__skrapport_old_caption:[##1]{##2} + \__skrapport_old_caption:[####1]{####2} \vspace{\belowcaptionskip} } + \centering }{ \end{minipage} \vspace{\intextsep} \end{gridenv} } - \cs_set_eq:NN\__skrapport_old_tablest:\__skrapport_old_old_tablest: - \cs_set:Nn\__skrapport_old_tablest:{ - \__skrapport_old_old_tablest: - \cs_set_eq:NN\__skrapport_old_caption:\caption - \RenewDocumentCommand{\caption}{om}{% - \skip_set_eq:NN\l_tmpa_skip\abovecaptionskip - \skip_set_eq:NN\abovecaptionskip\belowcaptionskip - \skip_set_eq:NN\belowcaptionskip\l_tmpa_skip - \vspace{\abovecaptionskip} - \__skrapport_old_caption:[##1]{##2} - \vspace{\belowcaptionskip} - } - } \RenewDocumentEnvironment{table*}{o}{ - \begin{onecol} - \__skrapport_old_tablest: + \__skrapport_xdblfloat:nx{table} + {\IfNoValueTF{##1}{tp}{##1}} + \dim_set_eq:NN\hsize\textwidth + \dim_set_eq:NN\linewidth\textwidth + \centering }{ - \__skrapport_old_endtablest: - \end{onecol} + \end@dblfloat } - \DeclareDocumentEnvironment{onecol}{ + \newenvironment{onecol}{ \end{onecol} \end{multicols} \group_begin: - \cs_set:Nn\endonecol{ + \cs_set:Npn\endonecol{ \group_end: \begin{multicols}{2} \cs_set_eq:NN\__skrapport_old_onecol:\onecol - \cs_set:Nn\onecol{ + \cs_set:Npn\onecol{ \cs_set_eq:NN\onecol\__skrapport_old_onecol: } \begin{onecol} } - \cs_set:Nn\onecol{} + \cs_set:Npn\onecol{} \begin{onecol} }{} } @@ -346,7 +377,7 @@ \str_if_eq:nnF{#1}{none}{ \str_if_eq:nnF{#1}{kpfonts}{ \str_if_eq:nnF{#1}{word}{ - \RequirePackage[scaled=1.03]{inconsolata} + \RequirePackage{sourcecodepro} } \AtEndOfClass{ \RequirePackage{amsmath} @@ -783,15 +814,14 @@ hide .clist_set:N = \l__skrapport_maketitle_hide_clist, hide .value_required:, nopdfinfo .bool_set_inverse:N = \l__skrapport_maketitle_pdfinfo_bool, - nopdfinfo .default:n = true + nopdfinfo .default:n = true, + nopdfinfo .initial:n = false } \cs_new_protected:Nn\__skrapport_smallprint_style:{} \cs_new_protected:Nn\__skrapport_abstract_style: {\__skrapport_title_style:} \DeclareDocumentCommand\maketitle{o}{ \clist_clear:N\l__skrapport_maketitle_hide_clist - \bool_new:N\l__skrapport_maketitle_pdfinfo_bool - \bool_set_true:N\l__skrapport_maketitle_pdfinfo_bool \IfNoValueF{#1}{\keys_set:nn{skrapport/maketitle}{#1}} \bool_if:NT\l__skrapport_maketitle_pdfinfo_bool{ \exp_args:NNx\cs_if_exist_use:NT\hypersetup{{ @@ -834,12 +864,20 @@ \hbox:n{} \begin{flushleft} \vspace{-\headsep} - \clist_if_in:NnF\l__skrapport_maketitle_hide_clist{date}{ + \clist_if_in:NnF\l__skrapport_maketitle_hide_clist{regarding}{ \small\__skrapport_smallprint_style: \tl_use:N\g__skrapport_regarding_tl - \tl_if_empty:NF\g__skrapport_regarding_tl{,~} - \tl_use:N\g__skrapport_date_tl\par + \clist_if_in:NnF\l__skrapport_maketitle_hide_clist{date}{ + \tl_if_empty:NF\g__skrapport_regarding_tl{,~} + } + } + \clist_if_in:NnF\l__skrapport_maketitle_hide_clist{date}{ + \tl_use:N\g__skrapport_date_tl } + \clist_if_in:NnTF\l__skrapport_maketitle_hide_clist{regarding}{ + \clist_if_in:NnTF\l__skrapport_maketitle_hide_clist{date} + {}{\par} + }{\par} \vspace{1.5cm} { \Huge\__skrapport_title_style: @@ -1139,14 +1177,14 @@ \setcounter{subsection}{0} \cs_gset:Npn\thesection{\Alph{section}} } -\DeclareDocumentCommand\rm{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\rm}{\textrm}} -\DeclareDocumentCommand\sf{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\sf}{\textsf}} -\DeclareDocumentCommand\tt{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\tt}{\texttt}} -\DeclareDocumentCommand\bf{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\bf}{\textbf}} -\DeclareDocumentCommand\it{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\it}{\textit}} -\DeclareDocumentCommand\sl{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\sl}{\textsl}} -\DeclareDocumentCommand\sc{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\sc}{\textsc}} -\DeclareDocumentCommand\em{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\em}{\emph}} +\DeclareDocumentCommand\rm{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\rm}{\textrm}} +\DeclareDocumentCommand\sf{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\sf}{\textsf}} +\DeclareDocumentCommand\tt{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\tt}{\texttt}} +\DeclareDocumentCommand\bf{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\bf}{\textbf}} +\DeclareDocumentCommand\it{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\it}{\textit}} +\DeclareDocumentCommand\sl{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\sl}{\textsl}} +\DeclareDocumentCommand\sc{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\sc}{\textsc}} +\DeclareDocumentCommand\em{}{\msg_error:nnnn{skrapport}{old-font-deprecated}{\em}{\emph}} \cs_new:Nn\__skrapport_emphstyle:{ \itshape \dim_compare:nF{\fontdimen\c_one\font>\c_zero_dim}{\bfseries} @@ -1216,6 +1254,8 @@ \end@float } \DeclareDocumentEnvironment{figcenter}{}{ + \cs_set_eq:NN\l__tmpa_cs\caption + \cs_set:Npn\caption{\msg_error:nn{skrapport}{caption-in-figcenter}} \coffin_clear:N\l_tmpa_coffin \hcoffin_set:Nw\l_tmpa_coffin }{ @@ -1223,6 +1263,8 @@ \dim_set:Nn\l_tmpa_dim{(\textwidth - \coffin_wd:N\l_tmpa_coffin)/2} \skip_horizontal:n{-\l_tmpa_dim} \coffin_typeset:Nnnnn\l_tmpa_coffin{H}{l}{0pt}{0pt} + \cs_set_eq:NN\caption\l__tmpa_cs + \cs_undefine:N\l__tmpa_cs } \PassOptionsToPackage{font=small,labelfont+=bf,textfont+=it}{caption} \cs_new_protected:Nn\__skrapport_caption_name_style:{\small\bfseries} @@ -1388,7 +1430,10 @@ } \DeclareDocumentCommand\comment{sm}{ \IfBooleanTF{#1} - {\colorbox{red!50}{\__skrapport_comment:n{#2}}} + { + \cs_if_exist_use:NT\colorbox{{red!50}} + {\__skrapport_comment:n{#2}} + } {\marginpar{\__skrapport_comment:n{#2}}} } \ProvideDocumentCommand\com{sm} |