From 38ed54c08f578d2d409e5970c13322dcc7644315 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 20 Aug 2022 03:01:01 +0000 Subject: CTAN sync 202208200300 --- macros/latex/contrib/hereapplies/ChangeLog.md | 10 + macros/latex/contrib/hereapplies/README.md | 68 +-- .../contrib/hereapplies/hereapplies-example.pdf | Bin 50857 -> 49896 bytes .../contrib/hereapplies/hereapplies-example.tex | 18 +- macros/latex/contrib/hereapplies/hereapplies.sty | 168 ++++---- .../hereapplies/lyx-module/hereapplies-example.lyx | 75 +--- .../hereapplies/lyx-module/hereapplies.module | 4 +- macros/latex/contrib/hereapplies/package.json | 2 +- macros/latex/contrib/msu-thesis/README.md | 20 +- .../latex/contrib/msu-thesis/docs/msu-thesis.tex | 468 ++++++++++++++++++++ macros/latex/contrib/msu-thesis/msu-thesis.cls | 112 ++--- macros/latex/contrib/msu-thesis/msu-thesis.pdf | Bin 253032 -> 107301 bytes macros/latex/contrib/msu-thesis/msu-thesis.tex | 477 --------------------- .../msu-thesis/samples/MSU-thesis-testfile.pdf | Bin 160096 -> 160095 bytes .../msu-thesis/samples/MSU-thesis-testfile.tex | 1 + 15 files changed, 683 insertions(+), 740 deletions(-) create mode 100644 macros/latex/contrib/msu-thesis/docs/msu-thesis.tex delete mode 100644 macros/latex/contrib/msu-thesis/msu-thesis.tex (limited to 'macros/latex') diff --git a/macros/latex/contrib/hereapplies/ChangeLog.md b/macros/latex/contrib/hereapplies/ChangeLog.md index 7f1fda1e25..6843095f9b 100644 --- a/macros/latex/contrib/hereapplies/ChangeLog.md +++ b/macros/latex/contrib/hereapplies/ChangeLog.md @@ -2,6 +2,16 @@ Change Log ========== +## 0.5.0 (2022-08-19) + +Changes: + +* A macro expansion bug has been fixed +* The `\hereapplies` macro now supports a comma-separated list of identifiers +* Documentation +* Examples + + ## 0.4.0 (2022-08-16) Changes: diff --git a/macros/latex/contrib/hereapplies/README.md b/macros/latex/contrib/hereapplies/README.md index 2ef03857e6..17ed9033cb 100644 --- a/macros/latex/contrib/hereapplies/README.md +++ b/macros/latex/contrib/hereapplies/README.md @@ -22,15 +22,17 @@ the last one, by design, are missing in **Here Applies**. Instead, the package offers only two macros: `\hereapplies` and `\whereapplies` (plus their “starred” versions `\hereapplies*` and `\whereapplies*`). In both -cases a “concept name” is passed as argument – and this can be any string -invented in the moment, as long as it contains only letters. - -Every time `\hereapplies` is invoked again on an identical string, the document -is made aware that the same concept from previous invocations is occurring at -that point. And so, every time the `\whereapplies` macro is invoked on that -same string, all the occurrences of that concept within the entire document -will be printed in the form of a linkable page number list (e.g. “pp. 1, 5, -8–9, 14–20…”). +cases a “concept identifier” is passed as argument – and this can be any string +invented in the moment, as long as it contains only letters (`\hereapplies` +additionally supports more than one identifier in the form of a comma-separated +list). + +Every time `\hereapplies` is invoked again on identical identifiers, the +document is made aware that the same concepts from previous invocations are +occurring in that point. And so, every time the `\whereapplies` macro is +invoked on a known identifier, all the occurrences of the latter within the +entire document will be printed in the form of a linkable page list (e.g. “pp. +1, 5, 8–9, 14–20…”). As `\hereapplies` is designed to be invoked in the middle of a chapter or a section, and that location must be made linkable, the `\phantomsection` macro @@ -38,7 +40,7 @@ is invoked by default before a label is added. To avoid calling `\phantomsection`, the “starred” macro `\hereapplies*` is available. Finally, like `\whereapplies` resembles a pluralizable version of `\pageref`, -its “starred” version `\whereapplies*` resembles a pluralizable version of +its “starred” version `\whereapplies*` will resemble a pluralizable version of `\pageref*`. If you use LyX, the package ships a LyX module as well (please check the @@ -63,17 +65,11 @@ The following LaTeX manuscript \maketitle -This is concept one. To find this concept applied, please see -\whereapplies{conceptOne}. - -This is concept two. To find this concept applied, please see -\whereapplies{conceptTwo}.\newpage - -\hereapplies{conceptOne}This is page \thepage. As you can see, ``concept -one'' applies here.\newpage +This is concept one. To find this concept applied, please +see \whereapplies{conceptOne}. -\hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept -two'' applies here.\newpage +This is concept two. To find this concept applied, please +see \whereapplies{conceptTwo}.\newpage \hereapplies{conceptOne}This is page \thepage. As you can see, ``concept one'' applies here.\newpage @@ -81,8 +77,8 @@ one'' applies here.\newpage \hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept two'' applies here.\newpage -\hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept -two'' applies here.\newpage +\hereapplies{conceptOne,conceptTwo}This is page \thepage. As you +can see, both ``concept one'' and ``concept two'' apply here.\newpage \hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept two'' applies here.\newpage @@ -100,32 +96,36 @@ will generate [this document][1]. A minimal tutorial ------------------ -### Macro `\hereapplies[Label]{ConceptName}` +### Macro `\hereapplies[label]{identifiers}` -The `\hereapplies` macro notifies the document that a particular concept -applies to a particular point and adds a label to it. +The `\hereapplies` macro notifies the document that one or more concepts apply +to a particular point and adds a label to it. If the optional argument is passed the label created will be named accordingly, otherwise an opaque name will be assigned to it. This argument may contain only -what is legal in both `\label` and `\pageref`. +what is legal for `\pageref`. -The `ConceptName` argument may contain only Latin letters and the “at” sign -(`@`). This string remains confined within the internal scope of the package -and does not create conflicts with possible macros or labels of the same name. +The `identifiers` argument must be a comma-separated list of identifiers. Each +of these may contain only Latin letters and the "at" sign (`@`). These strings +remain confined within the internal scope of the package and do not create +conflicts with possible macros or labels of the same names. -The “starred” version of this macro (`\hereapplies*`) does not invoke the +The “starred” version of this macro (`\hereapplies*`) will not invoke the `\phantomsection` directive. -### Macro `\whereapplies{ConceptName}` +### Macro `\whereapplies{identifier}` -The `\whereapplies` macro prints all the occurrences of a concept, in the form -“p. …” or “pp. …” (with page range support). +The `\whereapplies` macro prints all the occurrences of an identifier, in the +form “p. …” or “pp. …” (with page range support). -The `ConceptName` argument may contain only Latin letters and the “at” sign +The `identifier` argument may contain only Latin letters and the "at" sign (`@`). This string remains confined within the internal scope of the package and does not create conflicts with possible macros or labels of the same name. +If the same `identifier` is not passed to `\hereapplies` at least once +throughout the document, `\whereapplies` will print “**??**”. + The “starred” version of this macro (`\whereapplies*`) will use `\pageref*` instead of `\pageref` for generating the page list. diff --git a/macros/latex/contrib/hereapplies/hereapplies-example.pdf b/macros/latex/contrib/hereapplies/hereapplies-example.pdf index a6406da256..de4ecf6812 100644 Binary files a/macros/latex/contrib/hereapplies/hereapplies-example.pdf and b/macros/latex/contrib/hereapplies/hereapplies-example.pdf differ diff --git a/macros/latex/contrib/hereapplies/hereapplies-example.tex b/macros/latex/contrib/hereapplies/hereapplies-example.tex index ef76ef5ce0..f302236ff1 100644 --- a/macros/latex/contrib/hereapplies/hereapplies-example.tex +++ b/macros/latex/contrib/hereapplies/hereapplies-example.tex @@ -10,11 +10,11 @@ \maketitle -This is concept one. To find this concept applied, please see -\whereapplies{conceptOne}. +This is concept one. To find this concept applied, please +see \whereapplies{conceptOne}. -This is concept two. To find this concept applied, please see -\whereapplies{conceptTwo}.\newpage +This is concept two. To find this concept applied, please +see \whereapplies{conceptTwo}.\newpage \hereapplies{conceptOne}This is page \thepage. As you can see, ``concept one'' applies here.\newpage @@ -22,14 +22,8 @@ one'' applies here.\newpage \hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept two'' applies here.\newpage -\hereapplies{conceptOne}This is page \thepage. As you can see, ``concept -one'' applies here.\newpage - -\hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept -two'' applies here.\newpage - -\hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept -two'' applies here.\newpage +\hereapplies{conceptOne,conceptTwo}This is page \thepage. As you +can see, both ``concept one'' and ``concept two'' apply here.\newpage \hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept two'' applies here.\newpage diff --git a/macros/latex/contrib/hereapplies/hereapplies.sty b/macros/latex/contrib/hereapplies/hereapplies.sty index c83693fb4a..3ac0462fef 100644 --- a/macros/latex/contrib/hereapplies/hereapplies.sty +++ b/macros/latex/contrib/hereapplies/hereapplies.sty @@ -7,7 +7,7 @@ % % https://github.com/madmurphy/hereapplies.sty % -% Version 0.4.0 +% Version 0.5.0 % % Copyright (C) 2022 madmurphy % @@ -40,11 +40,11 @@ % % \maketitle % -% This is concept one. To find this concept applied, please see -% \whereapplies{conceptOne}. +% This is concept one. To find this concept applied, please +% see \whereapplies{conceptOne}. % -% This is concept two. To find this concept applied, please see -% \whereapplies{conceptTwo}.\newpage +% This is concept two. To find this concept applied, please +% see \whereapplies{conceptTwo}.\newpage % % \hereapplies{conceptOne}This is page \thepage. As you can see, ``concept % one'' applies here.\newpage @@ -52,14 +52,8 @@ % \hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept % two'' applies here.\newpage % -% \hereapplies{conceptOne}This is page \thepage. As you can see, ``concept -% one'' applies here.\newpage -% -% \hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept -% two'' applies here.\newpage -% -% \hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept -% two'' applies here.\newpage +% \hereapplies{conceptOne,conceptTwo}This is page \thepage. As you +% can see, both ``concept one'' and ``concept two'' apply here.\newpage % % \hereapplies{conceptTwo}This is page \thepage. As you can see, ``concept % two'' applies here.\newpage @@ -81,47 +75,43 @@ % =================== % % -% Assign a unique number to each concept -\newcounter{@ha@concept@counter} -% Assign a unique number to each unnamed occurrence of a concept +% Assign a unique number to each identifier +\newcounter{@ha@identifier@counter} +% Assign a unique number to each unnamed occurrence of an identifier \newcounter{@ha@unlabeled@counter} % % -% Macro `\@ha@makeoccurrencelist{HyperrefMacro}{LabelList}` +% Macro `\@ha@makeoccurrencelist{hypermacro}{labels}` % ***************************************************************************** % % Generate the list of page numbers with page range support % -% This macro is for internal purposes only. When invoked, it scans the list of -% labels provided (`LabelList`) and checks which labels refer to duplicate page -% numbers and which page numbers can be grouped together. -% -% The `HyperrefMacro` argument is the macro from the `hyperref` package that -% will process the label name. This should be either `T@pageref` -- equivalent -% to `\pageref` -- or `@pagerefstar` -- equivalent to `\pageref*`. +% This macro is for internal purposes only. When invoked, it scans the +% comma-separated list of labels provided (`labels`) and checks which labels +% refer to duplicate page numbers and which page numbers can be grouped +% together. % -% The `ConceptName` argument may contain only Latin letters and the "at" sign -% (`@`). This string remains confined within the internal scope of the package -% and does not create conflicts with possible macros or labels of the same -% name. +% The `hypermacro` argument is the macro from the `hyperref` package that will +% process the label name. This should be either `T@pageref` -- equivalent to +% `\pageref` -- or `@pagerefstar` -- equivalent to `\pageref*`. % -% The `LabelList` must be a comma-separated list of labels. +% The `labels` must be a comma-separated list of labels. % \newcommand{\@ha@makeoccurrencelist}[2]{% % Reset the current page number \def\@ha@tmp@@currp{-1}% % Reset the current range offset \def\@ha@tmp@@prangeoffs{-1}% - % Iterate through the `LabelList` argument + % Iterate through the `labels` argument \@for\@ha@tmp@@thislabel:=#2\do{% % Store the page number associated with this label \edef\@ha@tmp@@nextp{\getpagerefnumber{\@ha@tmp@@thislabel}}% % Check that we are not on the same page as in the last iteration \unless\ifnum\@ha@tmp@@currp=\@ha@tmp@@nextp% % This is not the same page as in the last iteration - % Is this the first page in which this concept appears? + % Is this the first page in which this identifier appears? \unless\ifnum\@ha@tmp@@currp=-1% - % This is not the first page in which this concept appears + % This is not the first page in which this identifier appears % Does this page follow immediately the previous label's page? \ifnum\numexpr\@ha@tmp@@currp+1=\@ha@tmp@@nextp% % This page follows immediately the previous label's page @@ -175,35 +165,36 @@ } % % -% Macro `\@ha@newconcept{ConceptName}` +% Macro `\@ha@newidentifier{identifier}` % ***************************************************************************** % -% Initialize a new concept +% Initialize a new identifier % % This macro is for internal purposes only. When invoked, it sets up the helper -% macros, counters and auxiliary files needed for keeping track of a concept. -% If the concept was already initialized the macro will be no op. +% macros, counters and auxiliary files needed for keeping track of an +% identifier. If the identifier was already initialized the macro will be no +% op. % -% The `ConceptName` argument may contain only Latin letters and the "at" sign +% The `identifier` argument may contain only Latin letters and the "at" sign % (`@`). This string remains confined within the internal scope of the package % and does not create conflicts with possible macros or labels of the same % name. % -\newcommand{\@ha@newconcept}[1]{% - % Was this concept already initialized? - \expandafter\ifx\csname @ha@prop@@count@#1\endcsname\relax% - % The concept was never initialized +\newcommand{\@ha@newidentifier}[1]{% + % Was this identifier already initialized? + \unless\ifcsname @ha@prop@@count@#1\endcsname% + % The identifier was never initialized % Set the output to "??" - it will be updated by the .haN file \expandafter\gdef\csname @ha@prop@@uoutput@#1\endcsname{\textbf{??}}% % Set the starred output to "??" - it will be updated by the .haN file \expandafter\gdef\csname @ha@prop@@soutput@#1\endcsname{\textbf{??}}% % Use "p." for the preamble when there is only one occurrence \expandafter\gdef\csname @ha@prop@@preamble@#1\endcsname{p.~}% - % Increase the counter of concepts - \stepcounter{@ha@concept@counter}% - % Store the current value of the counter of concepts + % Increase the counter of identifiers + \stepcounter{@ha@identifier@counter}% + % Store the current value of the counter of identifiers \expandafter\xdef\csname - @ha@prop@@count@#1\endcsname{\the@ha@concept@counter}% + @ha@prop@@count@#1\endcsname{\the@ha@identifier@counter}% % Initialize the .haN file % Previous versions had this line, which created unwanted whitespaces: %\@starttoc{ha\csname @ha@prop@@count@#1\endcsname}% @@ -212,7 +203,7 @@ % Store all the occurrences when the document reaches the end \AtEndDocument{% % Make sure that there are occurrences - \expandafter\ifcsname @ha@prop@@labels@#1\endcsname% + \ifcsname @ha@prop@@labels@#1\endcsname% % There are occurrences % Set the .haN file as output \addtocontents{ha\csname @ha@prop@@count@#1\endcsname}{% @@ -241,31 +232,32 @@ } % % -% Macro: `\@ha@getpropat{PropertyName}{ConceptName}` +% Macro: `\@ha@getpropat{field}{identifier}` % ***************************************************************************** % -% Get the value of a concept's property +% Get the value of an identifier's property % % This macro is for internal purposes (but nothing forbids invoking it -% directly). If a concept was never initialized the macro will initialize it. +% directly). If the identifier was never initialized the macro will initialize +% it. % -% Possible values for the `PropertyName` argument are: `count`, `labels`, -% `preamble`, `soutput`, `uoutput`. +% Possible values for the `field` argument are: `count`, `labels`, `preamble`, +% `soutput`, `uoutput`. % -% The `ConceptName` argument may contain only Latin letters and the "at" sign +% The `identifier` argument may contain only Latin letters and the "at" sign % (`@`). This string remains confined within the internal scope of the package % and does not create conflicts with possible macros or labels of the same % name. % \newcommand{\@ha@getpropat}[2]{% - % Make sure that the concept is initialized - \@ha@newconcept{#2}% - % Print the concept's property + % Make sure that the identifier is initialized + \@ha@newidentifier{#2}% + % Print the identifier's property \csname @ha@prop@@#1@#2\endcsname% } % % -% Macro: `\starred@labeled@hereapplies{Label}{ConceptName}` +% Macro: `\starred@labeled@hereapplies{label}{identifiers}` % ***************************************************************************** % % Equivalent to `\hereapplies*`, but the two arguments are both mandatory @@ -274,23 +266,30 @@ % directly). See the documentation of `\hereapplies` for more information. % \newcommand{\starred@labeled@hereapplies}[2]{% - % Make sure that the concept has been initialized - \@ha@newconcept{#2}% % Assign a label to this occurrence \label{#1}% - \expandafter\ifcsname @ha@prop@@labels@#2\endcsname% - % This is *not* the first occurrence - \expandafter\g@addto@macro\csname @ha@prop@@labels@#2\endcsname{,#1}% - % Use "pp." for the preamble when there are multiple occurrences - \expandafter\gdef\csname @ha@prop@@preamble@#2\endcsname{pp.~}% - \else% - % This is the first occurrence - \expandafter\gdef\csname @ha@prop@@labels@#2\endcsname{#1}% - \fi% + % Iterate through the comma-separated list `identifiers` + \@for\@ha@tmp@@id:=#2\do{% + % Make sure that the identifier is initialized + {\edef\tmp{\noexpand\@ha@newidentifier{\@ha@tmp@@id}}\tmp}% + % Is this the first time this identifier is mentioned? + \ifcsname @ha@prop@@labels@\@ha@tmp@@id\endcsname% + % This is *not* the first time + \expandafter\g@addto@macro\csname + @ha@prop@@labels@\@ha@tmp@@id\endcsname{,#1}% + % Use "pp." for the preamble when there are multiple occurrences + \expandafter\gdef\csname + @ha@prop@@preamble@\@ha@tmp@@id\endcsname{pp.~}% + \else% + % This is the first time + \expandafter\gdef\csname + @ha@prop@@labels@\@ha@tmp@@id\endcsname{#1}% + \fi% + }% } % % -% Macro: `\starred@hereapplies[Label]{ConceptName}` +% Macro: `\starred@hereapplies[label]{identifiers}` % ***************************************************************************** % % Equivalent to `\hereapplies*` @@ -306,7 +305,7 @@ \stepcounter{@ha@unlabeled@counter}% % Call `\starred@hereapplies` with an opaque label {\edef\tmp{\noexpand\starred@labeled@hereapplies{% - ha:#2-unnamed\the@ha@unlabeled@counter}{#2}% + hereapplies:unnamed\the@ha@unlabeled@counter}{#2}% }\tmp}% \else% % The macro has been called with two arguments @@ -320,20 +319,20 @@ % =================== % % -% Macro: `\hereapplies[Label]{ConceptName}` +% Macro: `\hereapplies[label]{identifiers}` % ***************************************************************************** % -% Notify the document that a particular concept applies and create a label for -% it +% Notify the document that one or more identifiers apply to a particular point +% and add a label to it % % If the optional argument is passed the label created will be named % accordingly, otherwise an opaque name will be assigned to it. This argument -% may contain only what is legal in both `\label` and `\pageref`. +% may contain only what is legal for `\pageref`. % -% The `ConceptName` argument may contain only Latin letters and the "at" sign -% (`@`). This string remains confined within the internal scope of the package -% and does not create conflicts with possible macros or labels of the same -% name. +% The `identifiers` argument must be a comma-separated list of identifiers. +% Each of these may contain only Latin letters and the "at" sign (`@`). These +% strings remain confined within the internal scope of the package and do not +% create conflicts with possible macros or labels of the same names. % % The starred version of this macro (`\hereapplies*`) does not invoke the % `\phantomsection` directive. @@ -344,16 +343,19 @@ } % % -% Macro: `\whereapplies{ConceptName}` +% Macro: `\whereapplies{identifier}` % ***************************************************************************** % -% Print all the occurrences of a concept in the form "p. ..." or "pp. ..." +% Print all the occurrences of an identifier in the form "p. ..." or "pp. ..." % with page range support % -% The `ConceptName` argument may contain only Latin letters and the "at" sign -% (`@`). This string remains confined within the internal scope of the package -% and does not create conflicts with possible macros or labels of the same -% name. +% The `identifier` argument may contain only Latin letters and the "at" +% sign (`@`). This string remains confined within the internal scope of the +% package and does not create conflicts with possible macros or labels of the +% same name. +% +% If the same `identifier` is not passed to `\hereapplies` at least once +% throughout the document, `\whereapplies` will print "??". % % The starred version of this macro (`\whereapplies*`) will use `\pageref*` % instead of `\pageref` for generating the page list. diff --git a/macros/latex/contrib/hereapplies/lyx-module/hereapplies-example.lyx b/macros/latex/contrib/hereapplies/lyx-module/hereapplies-example.lyx index 8f77964e19..e6f5f6f07b 100644 --- a/macros/latex/contrib/hereapplies/lyx-module/hereapplies-example.lyx +++ b/macros/latex/contrib/hereapplies/lyx-module/hereapplies-example.lyx @@ -219,7 +219,7 @@ concept two status open \begin_layout Plain Layout -conceptOne +conceptOne,conceptTwo \end_layout \end_inset @@ -238,7 +238,7 @@ thepage \end_inset . - As you can see, + As you can see, both \begin_inset Quotes eld \end_inset @@ -246,38 +246,7 @@ concept one \begin_inset Quotes erd \end_inset - applies here. -\begin_inset Newpage newpage -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset Flex Here applies -status open - -\begin_layout Plain Layout -conceptTwo -\end_layout - -\end_inset - -This is page -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -thepage -\end_layout - -\end_inset - -. - As you can see, + and \begin_inset Quotes eld \end_inset @@ -285,46 +254,10 @@ concept two \begin_inset Quotes erd \end_inset - applies here. -\begin_inset Newpage newpage -\end_inset - - + apply here. \end_layout \begin_layout Standard -\begin_inset Flex Here applies -status open - -\begin_layout Plain Layout -conceptTwo -\end_layout - -\end_inset - -This is page -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -thepage -\end_layout - -\end_inset - -. - As you can see, -\begin_inset Quotes eld -\end_inset - -concept two -\begin_inset Quotes erd -\end_inset - - applies here. \begin_inset Newpage newpage \end_inset diff --git a/macros/latex/contrib/hereapplies/lyx-module/hereapplies.module b/macros/latex/contrib/hereapplies/lyx-module/hereapplies.module index 27438dde66..4873af0a0d 100644 --- a/macros/latex/contrib/hereapplies/lyx-module/hereapplies.module +++ b/macros/latex/contrib/hereapplies/lyx-module/hereapplies.module @@ -39,7 +39,7 @@ InsetLayout Flex:Here_applies EndFont LabelString "Label" MenuString "Instance label" - Tooltip "A string that will become the label of the instance (which can be referenced with \ref, \pageref, etc.)" + Tooltip "A string that will become the label for this point of the document (which can be referenced with \ref, \pageref, etc.)" Mandatory 0 EndArgument End @@ -72,7 +72,7 @@ InsetLayout Flex:Here_applies* EndFont LabelString "Label" MenuString "Instance label" - Tooltip "A string that will become the label of the instance (which can be referenced with \ref, \pageref, etc.)" + Tooltip "A string that will become the label for this point of the document (which can be referenced with \ref, \pageref, etc.)" Mandatory 0 EndArgument End diff --git a/macros/latex/contrib/hereapplies/package.json b/macros/latex/contrib/hereapplies/package.json index 74dd5ed4a9..ce6edcbd99 100644 --- a/macros/latex/contrib/hereapplies/package.json +++ b/macros/latex/contrib/hereapplies/package.json @@ -1,6 +1,6 @@ { "name": "hereapplies.sty", - "version": "0.4.0", + "version": "0.5.0", "description": "A LaTeX package for cross-linking concepts to their applications", "homepage": "https://madmurphy.github.io/hereapplies.sty", "author": "madmurphy", diff --git a/macros/latex/contrib/msu-thesis/README.md b/macros/latex/contrib/msu-thesis/README.md index c49830bee6..27fea365c8 100644 --- a/macros/latex/contrib/msu-thesis/README.md +++ b/macros/latex/contrib/msu-thesis/README.md @@ -1,4 +1,4 @@ -# MSU Thesis Class Version 3.5 2022/08/15 +# MSU Thesis Class Version 3.5b 2022/08/19 Copyright 2011-2022 by Alan Munn @@ -9,13 +9,17 @@ Submission of Master's Theses and Dissertations (March 2020). The class is based on the `memoir` document class, and therefore inherits all of the functionality of that class. +## Documentation + +Please [read the documentation!](https://amunn.github.io/msu-thesis/) + ## Installation: The `msu-thesis` class is part of both TeXLive and MikTeX, so you should either already have it or should be able to install it with your package manager. If you wish to install it locally, follow the directions below: -Put `msu-thesis.cls` into +Put `msu-thesis.cls` into `/tex/latex/msu-thesis` @@ -38,19 +42,23 @@ The Current Maintainer of this package is Alan Munn. This package consists of the following source file: - `msu-thesis.cls` - + Documentation files: - - `msu-thesis.tex` + - `msu-thesis.tex` - `msu-thesis.pdf` -A template file: +A template file: - `MSU-thesis-template.tex` - + A test file and a test bibliography: `MSU-thesis-testfile.tex` `MSU-thesis-testfile.bib` +## Problems Use at your own risk! Report bugs/problems/questions to [amunn@msu.edu](mailto:amunn@msu.edu) or use the [GitHub repository bug tracker](https://github.com/amunn/msu-thesis/issues). +## Usage survey + +If you are using the class, please take a moment to fill out my [anonymous usage survey](https://forms.gle/bm2AUzthFxW2naK36). Thanks! You should be signed into your MSU Google account to access the form, but the form itself is anonymous. diff --git a/macros/latex/contrib/msu-thesis/docs/msu-thesis.tex b/macros/latex/contrib/msu-thesis/docs/msu-thesis.tex new file mode 100644 index 0000000000..2822bed850 --- /dev/null +++ b/macros/latex/contrib/msu-thesis/docs/msu-thesis.tex @@ -0,0 +1,468 @@ +% !TEX TS-program = lualatexmk + +\documentclass[11pt]{article} + +\def\msuversion{3.5b} +\def\msudate{2022/08/19} +\title{\textbf{Using the MSU Thesis Class}} +\author{\textbf{Alan Munn}\\Department of Linguistics, Languages, and Cultures\\Michigan State University\\\texttt{\href{mailto:amunn@msu.edu}{amunn@msu.edu}}} +\date{Version \msuversion\\\msudate} +\usepackage{fontspec} +\usepackage[lmargin=.75in,rmargin=.75in,tmargin=1in,bmargin=1in]{geometry} +\usepackage{titling} +\usepackage{array, booktabs, multicol, fancyhdr, xspace,tabularx} +\usepackage{enumitem} +\usepackage{fancyvrb,listings,url} +\usepackage[sf,small]{titlesec} +\usepackage[section]{placeins} +\usepackage[colorlinks=true]{hyperref} +\setmonofont{Inconsolatazi4} + + + +\DefineShortVerb{\|} +\newcommand*\bs{\textbackslash} + +\lstset{% + basicstyle=\ttfamily\small, + commentstyle=\itshape\ttfamily\small, + showspaces=false, + showstringspaces=false, + breaklines=true, + breakautoindent=true, + frame=single + captionpos=t + language=TeX +} + +\newcommand*{\pkg}[1]{\texttt{#1}} +\newlist{scheme}{itemize}{2} +\setlist[scheme]{label={}} +\setdescription{font={\normalfont}} +\setlength{\droptitle}{-1in} + +\lhead{} +\chead{} +\rhead{} +\lfoot{\emph{}} +\cfoot{\thepage} +\rfoot{} +\renewcommand{\headrulewidth}{0pt} +\renewcommand{\footrulewidth}{0pt} +\pagestyle{fancy} + + +\begin{document} +\maketitle +\thispagestyle{empty} +\renewcommand{\abstractname}{\sffamily Abstract} + +\abstract{\noindent\begin{quote} This is a class file for MSU theses and dissertations. It is based on the \pkg{memoir}\ class, and therefore supports all of the functionality of that class. It should generate a document which meets all the basic formatting requirements laid out by the \href{https://grad.msu.edu/etd/formatting-guide}{Formatting Guide For Submission of Master’s Theses and Doctoral Dissertations}\ (March 2020) produced by the Graduate School, including requirements for margins, titlepage, page numbering, section titles, sub- and superscript sizes etc.\end{quote}} +\section{Introduction} +Formatting a dissertation according to a University's thesis requirements is not always a simple task in \LaTeX, especially since the requirements are generally aimed at MSWord users. Furthermore, most of the work of formatting a document is supposed to be done by the document class itself, and not by the individual user. Fortunately, Michigan State University's thesis requirements are for the most part sane, and fairly straightforward. The present class file is designed to further make the process easier for \LaTeX\ users, by doing all the heavy lifting for you, so that you can focus on the content and not the formatting. +\section{Background} +The MSU Thesis Class is based on the \pkg{memoir}\ document class. The \pkg{memoir}\ class is an extensive class that incorporates the functionality of many other packages into it. The class is extensively documented, and the documentation (\pkg{memman.pdf}) should be available with any \TeX\ distribution. I strongly recommend that you familiarize yourself with \pkg{memoir}\ as you use the present class. +\section{Class Options} +In addition to any options passed to the \pkg{memoir}\ class (e.g. |oldfontcommands|; see Section \ref{sec:fonts}, font size), the \pkg{msu-thesis}\ class takes six options: one to specify the type of degree, (see Table~\ref{degrees}), one to enable landscape page numbering, two to enable per-chapter bibliographies and appendices, two to make small adjustments to Table of Contents. If no degree option is specified, a Ph.D. dissertation is assumed. +\begin{table}[htpb] +\centering +\begin{tabularx}{.8\textwidth}{>{\ttfamily}lX} +\toprule +\multicolumn{1}{c}{Option name} & \multicolumn{1}{l}{Description}\\ +\midrule +{[PhD]} & Doctor of Philosophy (default)\\ +{[DEd]} & Doctor of Education\\ +{[DMA]} & Doctor of Musical Arts\\ +{[DNP]} & Doctor of Nursing Practice\\ +{[MA]} & Master of Arts\\ +{[MS]} & Master of Science\\ +{[MAT]} & Master of Arts for Teachers \\ +{[MBA]} & Master of Business Administration \\ +{[MFA]} & Master of Fine Arts \\ +{[MIPS]} & Master of International Planning Studies \\ +{[MHRL]} & Master of Human Resources and Labor Relations \\ +{[MMus]} & Master of Music \\ +%{[MSN]} & Master of Science in Nursing \\ +{[MPH]} & Master of Public Health\\ +{[MPP]} & Master of Public Policy \\ +{[MSW]} & Master of Social Work \\ +{[MURP]} & Master in Urban and Regional Planning \\ +\bottomrule +\end{tabularx} +\caption{Package degree options}\label{degrees} +\end{table} +\subsection{The \pkg{[lscape]}~option} +The Formatting Guide requires that any lansdscape pages be numbered in landscape mode (i.e. along the long edge of the page) rather than in portrait mode, and rotated in the final PDF. The |[lscape]| option enables this. The option loads both the \pkg{pdflscape}\ package and \pkg{tikz}, and is implemented as a class option so that you are not required to load those packages if they are not needed. +\subsection{The \pkg{[chapterbib]}~option} +This option enables per-chapter bibliographies. Each chapter must have its own bibliography. If you are using \pkg{natbib}\ for bibliographies, per-chapter bibliographies can be implemented using the \pkg{chapterbib}\ package. Please read its documentation carefully, as it requires each chapter to be a separate file. A newer alternative which I highly recommend is to use \pkg{biblatex}\ for your bibliography, which makes per-chapter bibliographies very simple. If you have per-chapter bibliographies you cannot have a global bibliography. +\subsection{The \pkg{[chapterapp]}~option} +This option enables per-chapter appendices. Any appendix must be associated with its own chapter. If you have per-chapter appendices you cannot have any global appendices. +\subsection{The contents options} +\subsubsection{Bold vs. plain contents} +In 2013 I received reports that the thesis office now requires all elements in the Table of Contents to have the same formatting as they are in the main document, which means that all section, subsection, and subsubsection headings need to be bold. Since this looks very ugly, I have created two options to turn it off, the |[plaintoc]| option (which makes all ToC entries plain) and |[mixedtoc]| option (which makes Chapters bold and other elements plain). I suspect that the thesis office checkers don't notice this all the time so if you want to have a prettier table of contents and are willing to have that format be corrected, you can use these options to turn off the MSWord inspired ugliness of an entirely bold Table of Contents. I've made |[plaintoc]| the default. If you are forced by the thesis office to have an entirely bold ToC, use the |[boldtoc]| option. + +\subsubsection{Per-chapter bibliography contents format} +I also have received inconsistent formatting requirements for per-chapter bibliographies. Some students have been told that they should appear in the Table of Contents formatted like sections, while others have been told they should be formatted like chapters, but without the leading space. The latter option is most consistent with how per-chapter appendices are formatted in the Table of Contents, and is therefore the default. If you are told that the per-chapter bibliographies should be formatted like sections, then use the |[bibassection]| class option. You should avoid using this option unless forced to use it. +\subsection{Font size options}\label{fontsize} +As of v2.9, the class now supports |10pt|, |11pt| and |12pt| font sizes. The default is |12pt|. If you are using a small font like Times New Roman or equivalent, you should stick to the default. If you are using a larger font like Computer Modern, |11pt| is probably fine. Use |10pt| at your own peril, as I suspect the Thesis Office will not accept it! + +\section{User commands} +In addition to all the user functionality defined by \pkg{memoir}, the \pkg{msu-thesis}\ class defines seven new titling commands, and two “appeasement” commands, i.e., commands to tweak the formatting to appease the the thesis office’s inconsistency. +\begin{table}[htpb] +\centering +\begin{tabularx}{.8\textwidth}{>{\ttfamily}lX} +\toprule +{\bs maketitlepage} & Makes the main title page for the thesis.\\ +{\bs fieldofstudy\{\}} & Takes one argument corresponding to your field of study.\\ +{\bs dedication\{\}} & Takes one argument (should be short), your dedication.\\ +{\{publicabstract\}} & Environment for the public abstract (unnumbered, uncounted).\\ +{\bs makecopyrightpage} & Creates the copyright page (use \texttt{\bs makecopyrightpage*} to align the text on the left.)\\ +{\bs makededicationpage} & Creates the dedication page.\\ +{\bs makebibliographypage} & Creates the bibliography cover page.\\ +\bottomrule +\end{tabularx} +\caption{Class titling commands} +\end{table} + +\begin{table}[htpb] +\centering +\begin{tabularx}{.8\textwidth}{>{\ttfamily}lX} +\toprule +{\bs msucaptiondelim} & Delimiter for floating elements (see section \ref{captiondelim}).\\ +{\bs setabstractnamespace} & Changes spacing after the name in the abstract (see section \ref{abstractspacing}).\\ +\bottomrule +\end{tabularx} +\caption{Appeasement commands} +\end{table} + +\section{Using the class} +\subsection{Logical parts of the document} + +Most book-length documents are divided into three main kinds of parts: the front matter, the main matter, and the back matter. In \pkg{memoir}\ (and therefore \pkg{msu-thesis}) these sections are preceded by the commands |\frontmatter|, |\mainmatter|, and |\backmatter|. These commands tell the class when to change the page numbering, for example, front matter pages use lower case roman numerals, but main matter pages use arabic numerals. + +The basic outline of a dissertation or thesis document is shown in Table~\ref{structure}: (your thesis may not have all of these parts, but if it does, they should be in this order.) You can find an annotated copy of the basic structure in the \href{https://ctan.org/tex-archive/macros/latex/contrib/msu-thesis/samples}{\pkg{samples}}\ folder of the \pkg{msu-thesis}\ documentation. + +\begin{table}[ht] +\begin{scheme} +\item |\begin{document}| +\item |\frontmatter| +\begin{scheme} + \item Titlepage + \item Public Abstract + \item Abstract + \item Copyright Page + \item Dedication + \item Acknowledgements + \item Preface + \item Table of Contents + \item List of Tables + \item List of Figures + \item List of Abbreviations/Symbols +\end{scheme} +\item |\mainmatter| +\begin{scheme} + \item Chapter 1 + \item Chapter 2 + \item \ldots + \item Chapter $n$ + \item{Appendices} +\end{scheme} +\item |\backmatter| +\begin{scheme} + \item{Bibliography} +\end{scheme} +\item |\end{document}| +\end{scheme} +\caption{Basic structure of a thesis or dissertation}\label{structure} +\end{table} +\subsection{What does the class file do?} +The class itself sets up the margins, page numbering, and formatting of all of the required pieces. It doesn't put everything in the right order, so you are responsible for that. The best way to do this is to use the included sample \LaTeX\ file as a basic template for your thesis. +\subsection{Line Spacing} +The \pkg{memoir}\ class provides commands for single and double spacing (|\SingleSpacing| and |\DoubleSpacing|) most of your thesis will be double spaced, but certain parts (such as the table of contents, lists of figures/tales, bibliography) may be single spaced. This duplicates the functionality of the \pkg{setspace}\ package, which therefore should not be used. For bibliography spacing issues, see also Section \ref{bibspacing}. + +\subsection{Font changing commands}\label{sec:fonts} +\sloppy The \pkg{memoir}\ class enforces the so-called ``new'' font changing commands (although they have now been in use for many years.) This means that it does not allow you to use the commands |\bf|, |\it|, |\rm|, etc. Unfortunately there are some old packages that still use these commands, and there is also some outdated information on the web that might have examples using these commands. You should generally not use these commands (see \href{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=2letterfontcmd}{Two Letter Font Commands}); if you do encounter problems, you can pass the option |[oldfontcommands]| to the class. +\subsection{Extra Packages} +The \pkg{memoir}\ class replicates the functionality of many independent packages, so if you are transferring \LaTeX\ source from other documents using the \pkg{article}\ class, you may encounter some warnings or errors. The \pkg{memoir}\ documentation has substantial information about the packages it emulates, and the packages for which it provides equivalent functionality. See Chap. 18 Sec. 24 of the \pkg{memoir}\ manual for details. Quoting from the manual: +\begin{quote} At the time of writing the emulated packages are: {\sffamily abstract, appendix, booktabs, ccaption, chngcntr, crop, enumerate, epigraph, ifmtarg, ifpdf, index, makeidx, moreverb, needspace, newfile, nextpage, pagenote, patchcmd, parskip, setspace, shortvrb, showidx, titleref, tocbibind, tocloft, verbatim, and verse.} As well as the emulated packages memoir provides functions equivalent to those in the following packages, although the class does not prevent you from using them: {\sffamily fancyhdr, framed, geometry, sidecap, subfigure, and titlesec.}\\\hfill{\normalfont\emph{The Memoir Class} 10th impression, 2015, p.345} +\end{quote} +\subsection{Captions} +\subsubsection{Caption delimiter}\label{captiondelim} +Because the thesis office doesn't understand anything about punctuation, it requires the colon that would appear in a caption to also appear in the contents lists. Since they don't care about the colon itself, but just consistency I've removed colons from the captions entirely, since leaving it in makes the contents lists look really stupid. But in case you or your advisor want the colon in captions, you can add the colon back in by adding |\renewcommand{\msucaptiondelim}{:\space}| to your preamble, and the class will make sure the Lists of Tables and Figures match in formatting. If you have other floating objects with captions (e.g., algorithms, listings) you may need to change their delimiter too (see below). How you do this may depend on the particular packages you are using. +\subsubsection{New lists} +If you are using other kinds of floats such as listings, you should use the Memoir |\newlistof| command to make the relevant list. The class provides a macro |\msucaptiondelim| which can be used to make sure the formatting of the captions in the list-of-X match the setting you have for Figures and Tables. Here is an example of how you would add a listings list. For lists of algorithms, see section \ref{algorithms} below. The following code goes in your preamble: +\begin{quote} +\begin{lstlisting} +\newlistof{listoflistings}{lol}{List of Listings} +\newfloat[chapter]{listing}{lol}{Listing} +\newlistentry{listing}{lol}{0} +\renewcommand*{\cftlistingname}{Listing\space} +\renewcommand*{\cftlistingaftersnum}{\msucaptiondelim} +\end{lstlisting} +\end{quote} + +Then in your front matter you include a |\listoflistings| in the same way you would add the |\listoffigures| or |\listoftables| (preceded by a |\clearpage|). In your actual document you would use. (Note that this code doesn't actually format a listing as code; you would further embed your favourite code listing environment inside this environment.) + +\begin{quote} +\begin{lstlisting} +\begin{listing} +Your listing code here +\end{listing} +\end{lstlisting} +\end{quote} + +Another common kind of list is a List of Abbreviations. The thesis office seems to want to call this “Key to Abbreviations”. To add such a list, you need to do the following: + +\begin{quote} +\begin{lstlisting} +\clearpage +\chapter*{Key to Abbreviations} +\vspace{\cftparskip} +\addcontentsline{toc}{chapter}{Key to Abbreviations} +Your list of abbreviations here. +\end{lstlisting} +\end{quote} + +\subsection{Algorithm packages\label{algorithms}} +Because the various algorithm formatting packages such as \pkg{algorithm2e}\ and \pkg{algorithmicx}\ (or its related packages) sometimes create incompatibilities with the \pkg{memoir}\ float methods, the class provides you with floating |{algorithm}| environment and the corresponding list of algorithms, so you do not have to create your own list of algorithms. Here are some specific important points about using \pkg{algorithm2e}\ and \pkg{algorithmicx}. +\begin{itemize}[label=\textbullet] +\item Do \emph{not} load the \pkg{algorithm}\ package. +\item If you use the \pkg{algorithm2e}\ package you \emph{must} load it with the |[algo2e]| option (along with any other options you need). +\end{itemize} +\subsubsection{\pkg{algorithmicx}~package} If you are using the \pkg{algorithmicx}\ package, any of its related packages (including its older predecessor \pkg{algorithmic}) which suggest that you use the \pkg{algorithm}\ package to create floating algorithms, you can load the \pkg{float}\ package to use the its float styling capabilities instead of loading the \pkg{algorithm}\ package. You should \emph{not} however use the \pkg{float}\ package to create new floating environments. You must use the \pkg{memoir}\ methods to create new floating environments and only then load the \pkg{float}\ package. + +If you would normally load the \pkg{algorithm}\ package to create floating algorithms do the following instead. If you are creating any other new floating environments (like listings as described above) you \emph{must} create these environments first \emph{before} loading the \pkg{float}\ package otherwise your document will not compile. +\begin{quote} +\begin{lstlisting} +% This code should only appear AFTER you have created any other new lists +\usepackage{float} +\floatstyle{ruled}% or any of the predefined float styles +\restylefloat{algorithm} +\end{lstlisting} +\end{quote} +\subsubsection{Algorithm caption delimiter} +If you have changed the |\msucaptiondelimeter| to use a colon (see \ref{captiondelim}) then depending on the particular algorithm package you are using, there may be a mismatch between the format of the caption in the algorithm itself and in the List of Algorithms. The Graduate School thinks the presence or absence of a colon in captions and lists is of vital importance, and they may complain about this. Here are two options to use if they complain: + +The first method removes the colon from the word Algorithm in the List of Algorithms: +\begin{quote} +\begin{lstlisting} +% Use this code after loading any algorithm package and the float package +% This removes the colon after the word Algorithm in the List of Algorithms +\renewcommand*{\cftalgorithmaftersnum}{} +\end{lstlisting} +\end{quote} + +The second method adds a colon to the word Algorithm in the captions of the algorithms + +\begin{quote} +\begin{lstlisting} +% Use this code after loading any algorithm package and the float package +% This removes the colon after the word Algorithm in the List of Algorithms +% Change the [ruled] specification to the algorithm style you are using. +\usepackage{caption} +\captionsetup[ruled]{labelsep=colon} +\end{lstlisting} +\end{quote} + + + +\subsection{The \pkg{microtype}~package and contents lists} +If you use the \pkg{microtype}\ package with |protrusion| set, it’s best to turn it off before your contents lists. You can do this by using |\microtypesetup{protrusion=false}| +before the contents lists and |\microtypesetup{protrusion=true}| afterwards. Schematically: + +\begin{quote} +\begin{lstlisting} +\microtypesetup{protrusion=false} +\tableofcontents* +\clearpage +\listoftables +\clearpage +\listoffigures +... +\microtypesetup{protrusion=true} +\end{lstlisting} +\end{quote} +\subsection{Abstracts} +MSU requires you to have an abstract, but you may also have a public abstract, which is weirdly unnumbered and uncounted. + +\subsubsection{Spacing after the author name in the abstract}\label{abstractspacing} +The thesis office is very inconsistent in how it determines what it thinks is a “double space”, and this especially seems to be true after the author name in the the abstract. Because of this, I’ve created a way to change the spacing within the user document so that you can appease the thesis office bureaucrats without reporting an issue to me. + +Use the command |\setabstractnamespace| to change the spacing after the author name in the abstract (and the public abstract, if present). This command takes a value typically between -1 and and 1 where 0 reduces the space to a single baselineskip, while 1 adds an extra baselineskip. The default is set to 0. Depending on their mood at the time they check your thesis, the thesis office may want more or less space here, so use this command only to satisfy their bureaucratic self-importance. + +\subsubsection{Public abstract} +If your thesis requires a public abstract, it should go immediately before the regular abstract. Use the |{publicabstract}| environment for this. Please note that you \emph{must} have an abstract even if you also have a public abstract. +\subsection{Landscape figures and tables} +If you have large figures and tables that must be rotated, you should use the |[lscape]| class option. This enables a pagestyle |lscape| and places the page numbers correctly on the long edge of the page. The option loads the \pkg{pdflscape}\ package which provides a |landscape| environment to place the landscape figure in. Before the landscape environment, you need to issue a |\clearpage| command and change the pagestyle to |lscape|, and afterwards, change it back to |plain|. Schematically, then, any landscape pages should be created in the following way. + +\begin{quote} +\begin{lstlisting} +\clearpage\pagestyle{lscape} +\begin{landscape} + ... your large table(s) or figure(s) here +\end{landscape} +\pagestyle{plain} +\end{lstlisting} + +\end{quote} + +The |landscape| environment makes all pages within it landscape, so if you have multiple landscape figures in a row, you can put all of them inside a single |landscape| environment. This option correctly rotates the landscape pages within the pdf document itself, which the thesis office seems to require. +\subsection{Appendices} +Appendices in a thesis are usually at the end of the document, but before the bibliography. MSU requires appendices to be preceded by a cover page which says either ``Appendix'' (if there is only one) or ``Appendices'' if there is more than one. The class implements this with two environments: |{appendix}| for a single appendix and |{appendices}| for multiple appendices. If your thesis organization requires appendices per-chapter, you must use the |[chapterapp]| class option. In either case, the code for appendices is identical, i.e., each appendix is introduced with the |\chapter| command. +\subsubsection{Single appendix} +If you have a single appendix, your code should look like this: + +\begin{quote} +\begin{lstlisting} +\begin{appendix} +\chapter{Your appendix title} +Appendix text goes here +\end{appendix} +\end{lstlisting} +\end{quote} + +\subsubsection{Multiple appendices} +If you have more than one appendix, your code should look like this: + +\begin{quote} +\begin{lstlisting} +\begin{appendices} +\chapter{Your first appendix title} +Appendix text goes here +\chapter{Your second appendix title} +Appendix text goes here +\end{appendices} +\end{lstlisting} +\end{quote} + +\subsubsection{Appendices per chapter} +If you need to add an appendix or appendices to a chapter, you must use the \pkg{[chapterapp]}\ class option. The code for the appendices themselves is exactly as described above. This means that the appendix itself is introduced by the |\chapter| command, \emph{not} a |\section| command (because the this seems to be how the thesis office wants things to look). Furthermore, per-chapter appendices should \emph{not} be preceded by the |\backmatter| command, which should only precede the global bibliography or appendices. + +\subsection{Bibliographies} +The class places no constraints on how you do your bibliography. It doesn't care whether you are using the \pkg{chapterbib}\ package with \pkg{natbib}\ or the per-chapter bibliography functionality provided by \pkg{biblatex}. If you have per-chapter bibliographies, however, you \emph{must}\ use the |[chapterbib]| class option. This option lets the class know that you are using per-chapter bibliographies. Before any bibliography (whether global or per-chapter) you should use the |\makebibliographypage| command. Note that per-chapter bibliographies should \emph{not} be preceded by the |\backmatter| command, which should only precede the global bibliography or appendices. + +\subsubsection{Bibliography spacing}\label{bibspacing} +Please note that although bibliography entries must be single spaced, there must be a space between each entry. This parameter is set by your bibliography package and not by the class itself. If you are using \pkg{natbib}\ or \pkg{biblatex}\ these spacing parameters are set for you by the class. If you are using another package for your bibliography you are responsible for adjusting the relevant spacing parameters. + +\subsection{Customizing the look of things} +I have created a basic looking style for Chapter headings based on the |thatcher| style in |memoir|. If you want to change these things, you may, using the appropriate |\renewcommand| commands. More information can be found in the |memoir| documentation. The Thesis Office seems to require dotted leaders for the List of Figures/Tables in the Table of Contents, (despite the guide saying they are optional) even though they get typeset as Chapters. If you wish your Chapter headings to have no leaders, add the following command just after the |\mainmatter| command. To put the dots back for the Bibliography, repeat the same command right after the |\backmatter| command, but replace |\cftnodots| with |\cftdotsep|. The default template leaves dots everywhere, which should appease the thesis office. +\begin{quote} +\begin{lstlisting} +\addtocontents{toc}{% + \protect\renewcommand{\protect\cftchapterdotsep} + {\cftnodots}} +\end{lstlisting} +\end{quote} +Despite there being no explicit formatting requirements for Chapter headings (other than that they start 1 in from the top of the page), the thesis office has been known to dislike many things, so if you do decide to change things, be prepared for rejection or a frustrating fight. +\subsection{Things to watch out for\label{watchout}} +\begin{itemize} +\item If you are having problems with the Thesis office about non-conforming formatting, please check first whether you have a local copy of the class instead of the latest version distributed via CTAN. The log file will reflect the date of the current version number. Remember if you are using the most current and updated TeXLive or MikTeX you will automatically have the latest version already and you should not need to install a local version. Overleaf users may need a local copy, since Overleaf is usually a year behind the TeXLive distribution schedule. +\item If your title is long and you want to put a newline (|\\|) into it to improve the spacing, you must precede the newline with |\protect|. +\item Make sure you pay attention to any ``Overfull hbox'' warnings when you are producing your final copy. You should make sure you eliminate all of them or else the thesis office is likely to reject your thesis. One common way to eliminate such warnings is to place the command |\sloppy| at the beginning of the paragraph that triggers the warning. You should only use this technique at the very end when you are completely done with everything. Alternatively, rewording the text may also fix things. +\item Remember to use the |\tableofcontents*| command so that your table of contents is not listed in the table of contents. +\item Remember to use the |{appendix}| environment for single appendices, and the |{appendices}| environment for multiple appendices. Do not use the standard LaTeX |\appendix| command. +\item Remember also that \emph{all} appendices whether global or per-chapter should be |\chapter| commands in your source document. +\item Remember to add the |\makebibliographypage| command before any bibliography in your document. +\end{itemize} +\subsection{Master’s Theses} +Master’s theses are sometimes relatively short, and you may think that you can just have |\section| commands with no chapters. This will \emph{not} work. The class is designed to use chapters (and as far as I can tell, the Graduate School also expects chapters). + +\section{Bugs and redistribution} +\subsection{Current version} +The latest copy of \pkg{msu-thesis}\ will always be available on \href{https://ctan.org/pkg/msu-thesis?lang=en}{CTAN} and on \href{https://github.com/amunn/msu-thesis}{GitHub}. If you use MiKTeX, or a current year TeX Live then their respective package managers can update or install the latest version. If you are using Overleaf, you may not have the most recent version, since Overleaf is usually about one year behind in its TeX distribution. If you are using a Linux-based distribution, or your TeXLive distribution is not the most recent year, you may need to install the latest copy in your local |texmf| directory or simply in the same directory as your main source file. If you want others to use the class, \textsc{please} point them to CTAN, or tell them to use an up-to-date TeX distribution so that they can use an up-to-date version with all accompanying documentation and examples rather than passing along your copy. Please report \textsc{any} problems you have with the class to me \href{mailto:amunn@msu.edu}{amunn@msu.edu}, as this will aid in making things easier for those who follow you. You may also report actual bugs or class-caused formatting issues using GitHub: \href{https://github.com/amunn/msu-thesis}{github.com/amunn/msu-thesis}, but in my experience, most issues are more easily dealt with using email. The Graduate School rarely announces changes it makes to the formatting requirements, and it is often very inconsistent in what kinds of things it chooses to get annoyed about, so your problem reports are extremely helpful for keeping the class in compliance with the latest standards. +\subsection{Usage survey} +If you are using the class, please take a moment to fill out my \href{https://forms.gle/bm2AUzthFxW2naK36}{anonymous usage survey}. Thanks! You should be signed into your MSU Google account to access the form, but the form itself is anonymous. + +\subsection{Asking me for help} +I'm happy to answer emails about formatting issues with the class, especially when you are in the final stages of formatting your dissertation or thesis, but please keep in mind the following: +\begin{itemize} +\item If you have general LaTeX questions that are not specifically related to the class, please try to find answers elsewhere. \href{https://tex.stackexchange.com/}{tex.stackexchange.com} is an excellent resource for LaTeX help. +\item Please make sure you have the latest version of the class (check the log file and compare it with \href{https://ctan.org/pkg/msu-thesis?lang=en}{CTAN} or \href{https://github.com/amunn/msu-thesis}{GitHub}). +\item Please make sure you've checked all the issues listed in section \ref{watchout}. +\item Please send me an error-free, compilable sample document for me to test. The best option is for this to be a small sample document using the class that you create that recreates the problem you're having. (Of course if the class actually causes the error, your sample doesn't need to be error free; but it should be free of errors unrelated to the class itself.). +\item If you feel the need to send me your thesis, please send a zip of all the files, otherwise it becomes impossible to test otherwise. +\item If you are using Overleaf, PLEASE check the log file for errors, and fix them \emph{before} you send me a sample document. Overleaf has a tendency to produce output even when the document has lots of errors, and it is extremely time consuming for me to fix errors that have nothing to do with the class before trying to help you with your actual problem. +\end{itemize} +\subsection{Archiving your thesis for the future} +Since the current version of the \pkg{msu-thesis}\ class satisfies the Graduate School requirements at any one time, as these requirements change, you may find that if you need to recompile your thesis after you have graduated that the formatting changes. To avoid this, I would recommend saving an archived version of the \pkg{msu-thesis.cls}\ file in the same folder as your thesis file. You only need to do this once you have completely finished your thesis however; there's no need to do it during the writing process. +\subsection{Major Version history} +Previous versions of \pkg{msu-thesis}\ (versions 1.0--1.4b) were created for non-electronic submission and should not be used. Versions 1.5--1.6 (the first electronic submission versions) contained a |\makeabstract| command and a separate |msuabstract| environment. These have been removed as of version 1.7. Users who are upgrading from earlier versions to version 1.7 do not need to change these commands however but their use will trigger a warning.) Version 2.0 implemented landscape pages; version 2.1 added support for \pkg{hyperref}. Versions 2.2--2.5 mainly accommodated to the ever changing whims of the MSU Graduate School. Version 2.6 fixed some appendix bugs introduced by the previous whim accommodation. Version 2.7 fixed various small spacing issues, fixed a bug which prevented a new chapter page to be a landscape page, added support for the \pkg{apacite}\ package, and updated degree options. Version 2.8 fixed some spacing and capitalization issues and added support for the public abstract. Version 2.9 removed subscript/superscript size restrictions, added font size options and made small spacing changes to appease the thesis office. Version 3.0 added full support for per-chapter bibliographies and appendices, and automated bibliography spacing for |natbib| and |biblatex| produced bibliographies. Version 3.1 added support for an |{algorithm}| environment and a list of algorithms to combat incompatibilities with the \pkg{algorithm}\ and \pkg{algorithm2e}\ packages. Version 3.2 fixed some lingering problems with per-chapter appendices. Version 3.3 added code to accommodate the insane inconsistencies in formatting requirements that the thesis office requires, including a new contents option which hopefully should never be used, and fixed some numbering problems with per-chapter appendices. Version 3.4 added a starred option to the |\makecopyrightpage| command after complaints about placement. The documentation has also been updated to include more information about caption formatting and removed colons from the default caption format. Version 3.5 added user level way to change the spacing after the author’s name in the abstract, to deal with thesis office inconsistency. + +\section{Acknowledgements} +Thanks to Lars Madsen, Ulrike Fischer and Peter Wilson for help with setting up parts of the memoir code for versions 1.0--1.4 (now eliminated due to changed requirements). Thanks to Wolfgang Sternefeld for supplying the \pkg{linguex}\ spacing fix code, Leo Liu for the landscape page numbering code, which greatly simplified my original version, and Florent Chervet for the \pkg{hyperref}\ code. Thanks also to the following students who have reported problems over the years: Irina Agafonova, Ali Al-jiboory, Abubakr Ayesh, Julian Blank, Dmitriy Bryndin, Greg Christian, Kyle Crayne, Ciaron Hamilton, Matt Husband, Changkuk Jung, Adam Liter, Vanessa Maldonado, William Muir, Alicia Parrish, Neil ver Planck, Giacomo Romanini, William Sands, Adam Soliman, Erik Stitt, Eremey Valetov, Matthew Vincent, Michael Wojcik, Stephen Yowono, Ali Zare, and Yisu Zhou. A special thank you to Non Thongprong who graciously provided a copy of his entire thesis which allowed me to debug some especially subtle spacing inconsistencies. + +\appendix +\renewcommand{\thesection}{Appendix \Alph{section}} +\clearpage +\section{Sample template} +You can find a copy of this template \href{http://mirrors.ctan.org/macros/latex/contrib/msu-thesis/samples/MSU-thesis-template.tex}{here}. +\enlargethispage{2\baselineskip} +\begin{lstlisting} +\documentclass[PhD]{msu-thesis} +% Your extra packages here +% +% Define the title, author, field of study, date, and dedication (optional) +% +\title{The syntax and semantics of phonology} +\author{Joe Linguist} +\fieldofstudy{Linguistics} % should be in sentence case +\dedication{This thesis is dedicated to someone.} +\date{2014} +% +\begin{document} +\frontmatter +% +\maketitlepage +% +\begin{abstract} +Your abstract text here +\end{abstract} +% +\clearpage +\makecopyrightpage +\makededicationpage +% +\clearpage +\chapter*{Acknowledgements} +\DoubleSpacing +Your acknowledgements here +% +\clearpage +\SingleSpacing +\tableofcontents* +\clearpage +\listoftables +\clearpage +\listoffigures +% +\mainmatter +\chapter{Your first chapter} +% +\appendix +\chapter{Your first appendix} +\backmatter +\makebibliographypage +\SingleSpacing +\bibliography{your-bib-file} +\end{document} + +\end{lstlisting} +\clearpage +\section{Linguistic Examples with \pkg{gb4e}\ and \pkg{linguex}} +The \pkg{msu-thesis}\ class has been tested with both the \pkg{gb4e}\ package, and the \pkg{linguex}\ package. Unfortunately some versions of \pkg{gb4e}\ use old font commands, and so does \pkg{linguex}, so if you encounter problems with either package, load the class with the |oldfontcommands| option. Since linguistic examples are usually single spaced, even in theses, you should use the |\singlegloss| command (from the \pkg{cgloss4e}\ package loaded by both \pkg{gb4e}\ and \pkg{linguex}) to make your glosses examples singlespaced. The default mode for examples themselves is to make them doublespaced. If you want all examples to be single spaced (which looks better if the examples take up more than one line) you need to put the following code in your preamble, which redefines the |exe| environment to be single spaced. The |\patchcommand| macro is part of \pkg{memoir}. Other patching commands such as those provided by the \pkg{etoolbox}\ package could also be used. +\begin{quote} +\begin{lstlisting} +\patchcommand{\exe}{\SingleSpacing}{} +\end{lstlisting} +\end{quote} +For the \pkg{linguex}\ package, you can use the following code: +\begin{quote} +\begin{lstlisting} +\patchcommand{\ex}{\SingleSpacing}{} +\renewcommand{\ExEnd}{% + \ifnum\theExDepth=0\global\unembeddedfalse\DoubleSpacing\else% + \end{list}\addtocounter{ExDepth}{-1}\ExEnd\fi} +\end{lstlisting} +\end{quote} + +\end{document} \ No newline at end of file diff --git a/macros/latex/contrib/msu-thesis/msu-thesis.cls b/macros/latex/contrib/msu-thesis/msu-thesis.cls index 07e3fee9c3..fe9b7b3a14 100644 --- a/macros/latex/contrib/msu-thesis/msu-thesis.cls +++ b/macros/latex/contrib/msu-thesis/msu-thesis.cls @@ -2,7 +2,7 @@ % % Copyright 2009-2022 by Alan Munn % -% This is a class file for producing dissertations and theses according to the +% This is a class file for producing dissertations and theses according to the % Michigan State University Graduate School Guidelines % % @@ -15,18 +15,18 @@ % version 2005/12/01 or later. % % This package has the LPPL maintenance status `maintained'. -% +% % The Current Maintainer of this package is Alan Munn. % -% This package consists of the following source file: -% msu-thesis.cls +% This package consists of the following source file: +% msu-thesis.cls % Documentation files: -% msu-thesis.tex and msu-thesis.pdf; +% msu-thesis.tex and msu-thesis.pdf; % A template file: % MSU-thesis-template.tex -% A test file and test bibliography: +% A test file and test bibliography: % MSU-thesis-testfile.tex, MSU-thesis-testfile.bib -% It also contains a copy of the LSA Unified Style Sheet for linguistics: +% It also contains a copy of the LSA Unified Style Sheet for linguistics: % unified.bst % % Version 1.0 2010/04/17 Initial release @@ -51,9 +51,9 @@ % in anticipation of electronic submission % Version 1.4b 2010/12/11 Fixed problems with Appendix formatting in the TOC % Version 1.5 2010/12/12 Removed code to format the second abstract since this -% is no longer part of the document with electronic +% is no longer part of the document with electronic % submission. Removed \advisor command and [final] option. -% Version 1.5b 2010/12/13 Fixed margins to new specifications; fixed page numbering +% Version 1.5b 2010/12/13 Fixed margins to new specifications; fixed page numbering % issue when dedication was missing. % Version 1.6 2010/12/16 Bug fixes that introduced another bug. Never released. % Version 1.7 2010/12/16 Fixed page numbering problems with TOC; Fixed abstract @@ -74,7 +74,7 @@ % on landscape pages. Implemented as a package option % so that people aren't forced to load lscape or tikz % if they don't need it. Compatible also with pdflscape -% for those using pdflatex; fixed problem with some long +% for those using pdflatex; fixed problem with some long % TOC entries % Version 2.1 2011/09/04 Added code to make the class compatible with hyperref % This is experimental, and mainly useful for drafts. @@ -99,7 +99,7 @@ % Added \msu@fieldseparator in case they object to an en-dash. Don't they % have better things to do with their time? % To comply with the new MSWord mimicry, all section elements in the TOC -% are bold; this can be turned off with the [noboldtoc] option for a +% are bold; this can be turned off with the [noboldtoc] option for a % prettier, but possibly non-compliant TOC. % Changed capitalization of 'by' to 'By' which makes things so much better... % Version 2.5 2014/08/08 Fixed problem with bibliography cover page and appendix formatting @@ -108,11 +108,11 @@ % User commands simplified: \appendix = 1 appendix; \appendices = >1 % Added three TOC options: boldtoc, plaintoc, mixedtoc replacing noboldtoc % Improved hyperref support for Appendices and Bibliography -% Version 2.5b 2015/04/20 Changed spacing between top of page and titles by .06” to appease the +% Version 2.5b 2015/04/20 Changed spacing between top of page and titles by .06” to appease the % the Grad School who measure to the tops of letters instead of to baselines. % Version 2.5c 2015/07/11 Made loading etex conditional due to changes in LaTeX kernel for 2015. % Removed gb4e compatibility code (code remains in the distributed files) -% Version 2.6 2016/05/09 Completely revised the stupid appendix/appendices and bibliography cover page +% Version 2.6 2016/05/09 Completely revised the stupid appendix/appendices and bibliography cover page % code using memoir internals instead of hacks. % This should fix numbering issues in the TOC w.r.t the cover pages and % also fix bookmarks in the PDF when hyperref is loaded. @@ -121,27 +121,27 @@ % Version 2.6b 2016/06/08 Reworked some vertical spacing after complaints from the thesis office % despite the fact that people successfully submitted theses in May with % the previous spacing. This is getting ridiculous. -% Also updated documentation to show how to add list of abbreviations -% Version 2.7 2017/06/22 Updated list of degree options; renamed msu@diss to \msu@thesistype and made +% Also updated documentation to show how to add list of abbreviations +% Version 2.7 2017/06/22 Updated list of degree options; renamed msu@diss to \msu@thesistype and made % definition a conditional via \ifmsu@dissertation. Fixed problem with placement % of 'to' on title page. Adjusted landscape page number position and added internal % \msu@lsyshift for possible adjustment of landscape page numbering. Added boolean -% to change pagestyle for \chapter within a landscape environment. +% to change pagestyle for \chapter within a landscape environment. % Fixed spacing issue after contents lists and bibliography and unnumbered chapters % Any list of abbreviations \chapter* will need an extra \vspace in the source. % Added support for apacite package which messes with bibname and TOC. % Removed gb4e compatibility code from distribution. -% Version 2.8 2017/12/13 Added {publicabstract} environment and \publicabstractname for the public abstract. +% Version 2.8 2017/12/13 Added {publicabstract} environment and \publicabstractname for the public abstract. % This is an unnumbered and uncounted abstract. It’s not clear whether the title -% should be the same as \abstractname. For the moment it is. Updated documentation to +% should be the same as \abstractname. For the moment it is. Updated documentation to % include section about microtype and contents lists. % Changed \droptitle (again) % Fixed capitalization problem with Appendices % % Version 2.9 2020/12/12 Removed super/subscript/footnote restrictions % Added document fontsize options. -% Changed use of \baselineskip to \onelineskip so that idiocy of the -% thesis office can be accommodated. If complaints about the spacing +% Changed use of \baselineskip to \onelineskip so that idiocy of the +% thesis office can be accommodated. If complaints about the spacing % of “double space” arise, redefine \onelineskip to be the fontsize rather % than the leading. % @@ -153,7 +153,7 @@ % Removed unified.bst from distribution; replaced with apalike in the test file. % Version 3.0 2021/06/10 Full support for per-chapter appendices and bibliographies. % Added global chapter counter for proper hyperrefs to appendices -% Added a formatting hook for appendix numbering. We'll see how this works in practice. +% Added a formatting hook for appendix numbering. We'll see how this works in practice. % Added spacing hooks for bibliographies to make users' lives a little easier % Version 3.0b 2021/07/14 Added msu@hchap counter for hyperref targets in appendices (unreleased) % Version 3.1 2022/03/03 Added support for List of Algorithms plus fixes for algorithm2e and algorithmicx etc @@ -162,18 +162,19 @@ % Version 3.3 2022/04/18 New option bibassection to allow for thesis office inconsistencies. % Also adjusted chapter title code so that Appendix chapters can have % the extra blank line that the thesis office wants. More inconsistencies. -% Version 3.3b 2022/06/24 Fixed secnumdepth problem when appendices are used; -% Fixed numbering issue of subsequent chapters; +% Version 3.3b 2022/06/24 Fixed secnumdepth problem when appendices are used; +% Fixed numbering issue of subsequent chapters; % made TOC leaders all identical. % Version 3.4 2022/06/30 Added a starred version of \makecopyrightpage; % removed colons from captions; % updated documentation on algorithms and captions % Version 3.5 2022/08/15 Added \setabstractnamespace to allow user control over thesis office idiocy +% Version 3.5b 2022/08/19 Changed default for \setabstractnamespace % % Report bugs/problems/questions to % -\def\msu@version{3.5} -\def\msu@date{2022/08/15} +\def\msu@version{3.5b} +\def\msu@date{2022/08/19} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{msu-thesis}[\msu@date\space Michigan State University Thesis Class version \msu@version] \newif\ifmsu@dissertation\msu@dissertationtrue % added v2.7 boolean for \msu@thesistype @@ -218,15 +219,15 @@ \DeclareOption{chapterapp}{ \global\msu@chapterapptrue \def\msu@apptype{CHAPAPP} - % per-chapter appendices added v3.0 + % per-chapter appendices added v3.0 \renewcommand\msuappendixnumformat{\the@ppsavesec\Alph{chapter}} % Appendix numbers per-chapter (now permitted) } \DeclareOption{12pt}{\def\msu@sizeoption{12pt}} % added v2.9 \DeclareOption{11pt}{\def\msu@sizeoption{11pt}} \DeclareOption{10pt}{\def\msu@sizeoption{10pt}} \ExecuteOptions{PhD,12pt} -\DeclareOption*{ -\PassOptionsToClass{\CurrentOption}{memoir} +\DeclareOption*{ +\PassOptionsToClass{\CurrentOption}{memoir} } \ProcessOptions\relax \LoadClass[\msu@sizeoption,oneside,letterpaper]{memoir}[2008/05/27] @@ -254,7 +255,7 @@ \makeoddfoot{lscape}{}{\tikz[remember picture,overlay] \node[msu landscape pagenum] at (current page.east) {\thepage};}{} -\fi +\fi % set up page for MSU Thesis guidelines \settypeblocksize{9in}{6.5in}{*} @@ -265,8 +266,8 @@ % set up contents title % we use a private macro here to avoid problems with babel and % polyglossia if they are loaded since they redefine the contents title -% -\newcommand*{\msu@contentsname}{TABLE OF CONTENTS} +% +\newcommand*{\msu@contentsname}{TABLE OF CONTENTS} \newcommand*{\fieldofstudy}[1]{\gdef\msu@fieldofstudy{#1}} % removed \MakeUppercase 6/5/12 \newcommand{\dedication}[1]{\gdef\msu@dedication{#1}} \newcommand*{\msu@titleintro}{A~} % this is the beginning to the title page phrase @@ -302,7 +303,7 @@ \renewcommand*{\printchapternonum}{} % modified 3/5/2017 % added 18/4/2022 to allow stupid extra space for appendix chapter title \setlength{\midchapskip}{0pt} -\renewcommand*{\afterchapternum}{\par\nobreak\vskip\midchapskip} +\renewcommand*{\afterchapternum}{\par\nobreak\vskip\midchapskip} \renewcommand*{\printchaptername}{% \centerline{\chapnumfont{\MakeUppercase\@chapapp\ \ifmsu@singleappendix\else\thechapter\fi}}}% added v3.1b \renewcommand{\partnamefont}{\centering\bfseries} @@ -311,7 +312,7 @@ \renewcommand{\printpartname}{\partnamefont{\MakeUppercase{\partname}}} \renewcommand{\printparttitle}[1]{\parttitlefont \MakeUppercase#1} % Set epigraph fonts to \normalsize -\renewcommand{\epigraphsize}{\normalsize} % added 2/26/21 +\renewcommand{\epigraphsize}{\normalsize} % added 2/26/21 % set up the section styles @@ -362,7 +363,7 @@ % If using the algorithm2e package, you must load it with the algo2e package option % If you are using algorithmicx or its related versions you should not load % the algorithm package, but instead load the float package and then style -% your algorithms accordingly using \floatstyle +% your algorithms accordingly using \floatstyle % Importantly you MUST load float after defining any new lists since it clobbers % the memoir float methods @@ -377,7 +378,7 @@ % Makes appendices formatted as sections not chapters in the TOC % This is due to MSU idiocy, and also will make the appendix name % upper case (because of MSU case matching requirements in TOC/chap) -% So the appendices are chapters in the document but formatted as +% So the appendices are chapters in the document but formatted as % sections in the TOC. Code needs to be changed back for subsequent chapters. % This also accounts for the bizarre formatting of per-chapter appendices and % bibliographies which look like chapters except for the spacing in the TOC @@ -402,7 +403,7 @@ % This code adds extra space in the TOC margin for the APPENDIX name, and % makes the appendices formatted like sections even though they are % chapters in the source - + \newlength\apptoclen \settowidth{\apptoclen}{APPENDIX M} \cftinsertcode{APPENDICES}{ @@ -480,7 +481,7 @@ % MSU requires double spacing between entries in the list of tables, figures etc. % so we add the commands to change the 'list of' -% spacing after the ToC is formatted. +% spacing after the ToC is formatted. \let\oldmem@tableofcontents\mem@tableofcontents \renewcommand\mem@tableofcontents[1]{% @@ -500,18 +501,20 @@ % set up footnotes % Most of this removed v2.9 %\footmarkstyle{\normalsize\textsuperscript{#1}} % reset size so that mark is right size -%\setlength{\footmarkwidth}{1.8em} -%\setlength{\footmarksep}{-1.8em} -%\setlength{\footparindent}{1em} +%\setlength{\footmarkwidth}{1.8em} +%\setlength{\footmarksep}{-1.8em} +%\setlength{\footparindent}{1em} %\renewcommand{\foottextfont}{\normalsize} % footnotes will be 12pt \feetbelowfloat % footnotes will appear below bottom floats % set up abstract and public abstract -% The thesis office is inconsistent in how they measure what they call a "double space". +% The thesis office is inconsistent in how they measure what they call a "double space". % Adding a fudge factor that can be changed at the user level (v3.5 8/15/2022) -% We'll set it to 1 for the moment; 0 is what should be 1 double space, but they seem to want more +% We'll set it to 0 for the moment; 0 is what should be 1 double space, +% but depending on their mood and and whether Mars is in conjunction with Jupiter they seem to want more +% or less. Nothing better than random application of useless rules to waste everyone’s time. \newcommand\setabstractnamespace[1]{\gdef\msu@abstractnamespacefactor{#1}} -\setabstractnamespace{1} +\setabstractnamespace{0} % this may be too big \renewenvironment{abstract}{% \setlength{\afterchapskip}{\onelineskip} % changed 2020/12/14 again removed manual spacing from 2016 \chapter*{\abstractname} @@ -544,13 +547,14 @@ \MakeUppercase{\thetitle}\plainbreak{1}By\plainbreak{1}\theauthor \end{center} % \plainbreak{-.5} % changed 2016/06/08 after complaints + \plainbreak{\msu@abstractnamespacefactor} % changed 2016/06/08 after complaints \DoubleSpacing }{\clearpage\setcounter{page}{\value{msu@pubabspages}}} % set up captions \captionstyle[\centering]{\raggedright} -% Make the caption delimiter a space instead of colon space so that the +% Make the caption delimiter a space instead of colon space so that the % contents lists don't look so stupid. Can be changed if necessary. \newcommand*\msucaptiondelim{\space} \captiondelim{\msucaptiondelim} @@ -568,7 +572,7 @@ % make the copyright page % added * version because a new grad school minion has decided to interpret the formatting guide -% as requiring left aligned copyright mark, even though the guide says it can be +% as requiring left aligned copyright mark, even though the guide says it can be % anywhere on the page as long as the text itself is left aligned. % * version will make things left aligned. Added v3.4 6/20/2022 \newcommand*{\makecopyrightpage}{% @@ -627,7 +631,7 @@ % Code for appendix/appendices % Because the thesis office wants chapter appendices to look like chapters % we make the same code work for per-chapter or global appendices -% +% % Instead of using \appendix we create an {appendix} environment for a single % appendix. This allows the same code to be used for both global and per chapter % appendices. @@ -637,7 +641,7 @@ \renewcommand{\appendixtocname}{Appendix} \renewcommand{\appendixpagename}{Appendix} % It's not clear if this should apply to per-chapter appendices also -% I think it probably should, even though it leads to ambiguity. +% I think it probably should, even though it leads to ambiguity. % Changing this in 3.2 2022/04/16 % \ifmsu@chapterapp\else \msu@singleappendixtrue @@ -650,11 +654,11 @@ \@resets@pp\anappendixtrue}% {\@ppsaveapp\@pprestoresec\anappendixfalse\cftinserthook{toc}{CHAPAPPR}} % reset added 2022/04/16 -% The default numbering that memoir assumes is for appendices -% is sequential throughout the document; the thesis office +% The default numbering that memoir assumes is for appendices +% is sequential throughout the document; the thesis office % requires them to restart from A every chapter. In case they % ever allow a saner numbering system we provide the \msuappendixnumberformat hook -% for modifying the numbering scheme if allowed. +% for modifying the numbering scheme if allowed. % \renewcommand{\@resets@pp}{% @@ -670,7 +674,7 @@ % Don't save the appendix counters even for per-chapter appendices -%\let\restoreapp\relax % removed 6/24/2022 +%\let\restoreapp\relax % removed 6/24/2022 % make the bibliography page @@ -693,7 +697,7 @@ \printparttitle{\bibpagename}\par}% \@endpart \cftinserthook{toc}{BIB}} - + \newcommand\msu@preaddbibpagetotochook{} \newcommand\msu@postaddbibpagetotochook{} \newcommand{\msu@bibpageinfo}[1]{} @@ -722,7 +726,7 @@ \AtEndDocument{% \ifmsu@dissertation\else\ClassWarningNoLine{msu-thesis}{Masters theses MUST have chapters to be formatted correctly!}\fi } -% Do some stuff at begin document: +% Do some stuff at begin document: \AtBeginDocument{% % Moved to AtBeginDocument to override apacite \@ifpackageloaded{apacite}{\@tocbibfalse}{} % added 6/22/17 @@ -745,7 +749,7 @@ %\DeclareMathSizes{10}{10}{10}{10} % % check for hyperref -% The hyperref code allows hyperref to be used. It is not guaranteed to +% The hyperref code allows hyperref to be used. It is not guaranteed to % work and has been lightly tested. % Thanks to Florent Chervet for the code. % Added hypersetup to remove borders around links 5/9/16 diff --git a/macros/latex/contrib/msu-thesis/msu-thesis.pdf b/macros/latex/contrib/msu-thesis/msu-thesis.pdf index 37f508b169..18ceda29d0 100644 Binary files a/macros/latex/contrib/msu-thesis/msu-thesis.pdf and b/macros/latex/contrib/msu-thesis/msu-thesis.pdf differ diff --git a/macros/latex/contrib/msu-thesis/msu-thesis.tex b/macros/latex/contrib/msu-thesis/msu-thesis.tex deleted file mode 100644 index ae36197dbe..0000000000 --- a/macros/latex/contrib/msu-thesis/msu-thesis.tex +++ /dev/null @@ -1,477 +0,0 @@ -% !TEX TS-program = pdflatexmk - -\documentclass[11pt]{article} - -\def\msuversion{3.5} -\def\msudate{2022/08/15} -\title{\textbf{Using the MSU Thesis Class}} -\author{\textbf{Alan Munn}\\Department of Linguistics, Languages, and Cultures\\Michigan State University\\\texttt{\href{mailto:amunn@msu.edu}{amunn@msu.edu}}} -\date{Version \msuversion\\\msudate} -\usepackage[T1]{fontenc} -\usepackage[lmargin=.75in,rmargin=.75in,tmargin=1in,bmargin=1in]{geometry} -\usepackage{titling} -\usepackage{array, booktabs, multicol, fancyhdr, xspace,tabularx} -\usepackage{enumitem} -\usepackage{fancyvrb,listings,url} -\usepackage[sf]{titlesec} -\usepackage[section]{placeins} -\usepackage[colorlinks=true]{hyperref} - - - -\DefineShortVerb{\|} -\newcommand*\bs{\textbackslash} - - -\IfFileExists{luximono.sty}% -{% - \usepackage[scaled]{luximono}% -} -{% - \IfFileExists{beramono.sty}% - {% - \usepackage[scaled]{beramono}% - }{} -} - - -\lstset{% - basicstyle=\ttfamily\small, - commentstyle=\itshape\ttfamily\small, - showspaces=false, - showstringspaces=false, - breaklines=true, - breakautoindent=true, - frame=single - captionpos=t - language=TeX -} - -\newcommand*{\pkg}[1]{\texttt{#1}\xspace} -\newlist{scheme}{itemize}{2} -\setlist[scheme]{label={}} -\setdescription{font={\normalfont}} -\setlength{\droptitle}{-1in} - -\lhead{} -\chead{} -\rhead{} -\lfoot{\emph{}} -\cfoot{\thepage} -\rfoot{} -\renewcommand{\headrulewidth}{0pt} -\renewcommand{\footrulewidth}{0pt} -\pagestyle{fancy} - - -\begin{document} -\maketitle -\thispagestyle{empty} -\renewcommand{\abstractname}{\sffamily Abstract} - -\abstract{\noindent\begin{quote} This is a class file for MSU theses and dissertations. It is based on the \pkg{memoir} class, and therefore supports all of the functionality of that class. It should generate a document which meets all the basic formatting requirements laid out by the \href{https://grad.msu.edu/etd/formatting-guide}{Formatting Guide For Submission of Master’s Theses and Doctoral Dissertations} (March 2020) produced by the Graduate School, including requirements for margins, titlepage, page numbering, section titles, sub- and superscript sizes etc.\end{quote}} -\section{Introduction} -Formatting a dissertation according to a University's thesis requirements is not always a simple task in \LaTeX, especially since the requirements are generally aimed at MSWord users. Furthermore, most of the work of formatting a document is supposed to be done by the document class itself, and not by the individual user. Fortunately, Michigan State University's thesis requirements are for the most part sane, and fairly straightforward. The present class file is designed to further make the process easier for \LaTeX\ users, by doing all the heavy lifting for you, so that you can focus on the content and not the formatting. -\section{Background} -The MSU Thesis Class is based on the \pkg{memoir} document class. The \pkg{memoir} class is an extensive class that incorporates the functionality of many other packages into it. The class is extensively documented, and the documentation (\pkg{memman.pdf}) should be available with any \TeX\ distribution. I strongly recommend that you familiarize yourself with \pkg{memoir} as you use the present class. -\section{Class Options} -In addition to any options passed to the \pkg{memoir} class (e.g. |oldfontcommands|; see Section \ref{sec:fonts}, font size), the \pkg{msu-thesis} takes six options: one to specify the type of degree, (see Table~\ref{degrees}), one to enable landscape page numbering, two to enable per-chapter bibliographies and appendices, two to make small adjustments to Table of Contents. If no degree option is specified, a Ph.D. dissertation is assumed. -\begin{table}[htpb] -\centering -\begin{tabularx}{.8\textwidth}{>{\ttfamily}lX} -\toprule -\multicolumn{1}{c}{Option name} & \multicolumn{1}{l}{Description}\\ -\midrule -{[PhD]} & Doctor of Philosophy (default)\\ -{[DEd]} & Doctor of Education\\ -{[DMA]} & Doctor of Musical Arts\\ -{[DNP]} & Doctor of Nursing Practice\\ -{[MA]} & Master of Arts\\ -{[MS]} & Master of Science\\ -{[MAT]} & Master of Arts for Teachers \\ -{[MBA]} & Master of Business Administration \\ -{[MFA]} & Master of Fine Arts \\ -{[MIPS]} & Master of International Planning Studies \\ -{[MHRL]} & Master of Human Resources and Labor Relations \\ -{[MMus]} & Master of Music \\ -%{[MSN]} & Master of Science in Nursing \\ -{[MPH]} & Master of Public Health\\ -{[MPP]} & Master of Public Policy \\ -{[MSW]} & Master of Social Work \\ -{[MURP]} & Master in Urban and Regional Planning \\ -\bottomrule -\end{tabularx} -\caption{Package degree options}\label{degrees} -\end{table} -\subsection{The \pkg{[lscape]} option} -The Formatting Guide requires that any lansdscape pages be numbered in landscape mode (i.e. along the long edge of the page) rather than in portrait mode, and rotated in the final PDF. The |[lscape]| option enables this. The option loads both the \pkg{pdflscape} package and \pkg{tikz}, and is implemented as a class option so that you are not required to load those packages if they are not needed. -\subsection{The \pkg{[chapterbib]} option} -This option enables per-chapter bibliographies. Each chapter must have its own bibliography. If you are using \pkg{natbib} for bibliographies, per-chapter bibliographies can be implemented using the \pkg{chapterbib} package. Please read its documentation carefully, as it requires each chapter to be a separate file. A newer alternative which I highly recommend is to use \pkg{biblatex} for your bibliography, which makes per-chapter bibliographies very simple. If you have per-chapter bibliographies you cannot have a global bibliography. -\subsection{The \pkg{[chapterapp]} option} -This option enables per-chapter appendices. Any appendix must be associated with its own chapter. If you have per-chapter appendices you cannot have any global appendices. -\subsection{The contents options} -\subsubsection{Bold vs. plain contents} -In 2013 I received reports that the thesis office now requires all elements in the Table of Contents to have the same formatting as they are in the main document, which means that all section, subsection, and subsubsection headings need to be bold. Since this looks very ugly, I have created two options to turn it off, the |[plaintoc]| option (which makes all ToC entries plain) and |[mixedtoc]| option (which makes Chapters bold and other elements plain). I suspect that the thesis office checkers don't notice this all the time so if you want to have a prettier table of contents and are willing to have that format be corrected, you can use these options to turn off the MSWord inspired ugliness of an entirely bold Table of Contents. I've made |[plaintoc]| the default. If you are forced by the thesis office to have an entirely bold ToC, use the |[boldtoc]| option. - -\subsubsection{Per-chapter bibliography contents format} -I also have received inconsistent formatting requirements for per-chapter bibliographies. Some students have been told that they should appear in the Table of Contents formatted like sections, while others have been told they should be formatted like chapters, but without the leading space. The latter option is most consistent with how per-chapter appendices are formatted in the Table of Contents, and is therefore the default. If you are told that the per-chapter bibliographies should be formatted like sections, then use the |[bibassection]| class option. You should avoid using this option unless forced to use it. -\subsection{Font size options}\label{fontsize} -As of v2.9, the class now supports |10pt|, |11pt| and |12pt| font sizes. The default is |12pt|. If you are using a small font like Times New Roman or equivalent, you should stick to the default. If you are using a larger font like Computer Modern, |11pt| is probably fine. Use |10pt| at your own peril, as I suspect the Thesis Office will not accept it! - -\section{User commands} -In addition to all the user functionality defined by \pkg{memoir}, the \pkg{msu-thesis} class defines seven new titling commands, and two “appeasement” commands, i.e., commands to tweak the formatting to appease the the thesis office’s inconsistency. -\begin{table}[htpb] -\centering -\begin{tabularx}{.8\textwidth}{>{\ttfamily}lX} -\toprule -{\bs maketitlepage} & Makes the main title page for the thesis.\\ -{\bs fieldofstudy\{\}} & Takes one argument corresponding to your field of study.\\ -{\bs dedication\{\}} & Takes one argument (should be short), your dedication.\\ -{\{publicabstract\}} & Environment for the public abstract (unnumbered, uncounted).\\ -{\bs makecopyrightpage} & Creates the copyright page (use \texttt{\bs makecopyrightpage*} to align the text on the left.)\\ -{\bs makededicationpage} & Creates the dedication page.\\ -{\bs makebibliographypage} & Creates the bibliography cover page.\\ -\bottomrule -\end{tabularx} -\caption{Class titling commands} -\end{table} - -\begin{table}[htpb] -\centering -\begin{tabularx}{.8\textwidth}{>{\ttfamily}lX} -\toprule -{\bs msucaptiondelim} & Delimiter for floating elements (see section \ref{captiondelim}).\\ -{\bs setabstractnamespace} & Changes spacing after the name in the abstract (see section \ref{abstractspacing}).\\ -\bottomrule -\end{tabularx} -\caption{Appeasement commands} -\end{table} - -\section{Using the class} -\subsection{Logical parts of the document} - -Most book-length documents are divided into three main kinds of parts: the front matter, the main matter, and the back matter. In \pkg{memoir} (and therefore \pkg{msu-thesis}) these sections are preceded by the commands |\frontmatter|, |\mainmatter|, and |\backmatter|. These commands tell the class when to change the page numbering, for example, front matter pages use lower case roman numerals, but main matter pages use arabic numerals. - -The basic outline of a dissertation or thesis document is shown in Table~\ref{structure}: (your thesis may not have all of these parts, but if it does, they should be in this order.) You can find an annotated copy of the basic structure in the \href{https://ctan.org/tex-archive/macros/latex/contrib/msu-thesis/samples}{\pkg{samples}} folder of the \pkg{msu-thesis} documentation. - -\begin{table}[ht] -\begin{scheme} -\item |\begin{document}| -\item |\frontmatter| -\begin{scheme} - \item Titlepage - \item Public Abstract - \item Abstract - \item Copyright Page - \item Dedication - \item Acknowledgements - \item Preface - \item Table of Contents - \item List of Tables - \item List of Figures - \item List of Abbreviations/Symbols -\end{scheme} -\item |\mainmatter| -\begin{scheme} - \item Chapter 1 - \item Chapter 2 - \item \ldots - \item Chapter $n$ - \item{Appendices} -\end{scheme} -\item |\backmatter| -\begin{scheme} - \item{Bibliography} -\end{scheme} -\item |\end{document}| -\end{scheme} -\caption{Basic structure of a thesis or dissertation}\label{structure} -\end{table} -\subsection{What does the class file do?} -The class itself sets up the margins, page numbering, and formatting of all of the required pieces. It doesn't put everything in the right order, so you are responsible for that. The best way to do this is to use the included sample \LaTeX\ file as a basic template for your thesis. -\subsection{Line Spacing} -The \pkg{memoir} class provides commands for single and double spacing (|\SingleSpacing| and |\DoubleSpacing|) most of your thesis will be double spaced, but certain parts (such as the table of contents, lists of figures/tales, bibliography) may be single spaced. This duplicates the functionality of the \pkg{setspace} package, which therefore should not be used. For bibliography spacing issues, see also Section \ref{bibspacing}. - -\subsection{Font changing commands}\label{sec:fonts} -\sloppy The \pkg{memoir} class enforces the so-called ``new'' font changing commands (although they have now been in use for many years.) This means that it does not allow you to use the commands |\bf|, |\it|, |\rm|, etc. Unfortunately there are some old packages that still use these commands, and there is also some outdated information on the web that might have examples using these commands. You should generally not use these commands (see \href{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=2letterfontcmd}{Two Letter Font Commands}); if you do encounter problems, you can pass the option |[oldfontcommands]| to the class. -\subsection{Extra Packages} -The \pkg{memoir} class replicates the functionality of many independent packages, so if you are transferring \LaTeX\ source from other documents using the \pkg{article} class, you may encounter some warnings or errors. The \pkg{memoir} documentation has substantial information about the packages it emulates, and the packages for which it provides equivalent functionality. See Chap. 18 Sec. 24 of the \pkg{memoir} manual for details. Quoting from the manual: -\begin{quote} At the time of writing the emulated packages are: {\sffamily abstract, appendix, booktabs, ccaption, chngcntr, crop, enumerate, epigraph, ifmtarg, ifpdf, index, makeidx, moreverb, needspace, newfile, nextpage, pagenote, patchcmd, parskip, setspace, shortvrb, showidx, titleref, tocbibind, tocloft, verbatim, and verse.} As well as the emulated packages memoir provides functions equivalent to those in the following packages, although the class does not prevent you from using them: {\sffamily fancyhdr, framed, geometry, sidecap, subfigure, and titlesec.}\\\hfill{\normalfont\emph{The Memoir Class} 10th impression, 2015, p.345} -\end{quote} -\subsection{Captions} -\subsubsection{Caption delimiter}\label{captiondelim} -Because the thesis office doesn't understand anything about punctuation, it requires the colon that would appear in a caption to also appear in the contents lists. Since they don't care about the colon itself, but just consistency I've removed colons from the captions entirely, since leaving it in makes the contents lists look really stupid. But in case you or your advisor want the colon in captions, you can add the colon back in by adding |\renewcommand{\msucaptiondelim}{:\space}| to your preamble, and the class will make sure the Lists of Tables and Figures match in formatting. If you have other floating objects with captions (e.g., algorithms, listings) you may need to change their delimiter too (see below). How you do this may depend on the particular packages you are using. -\subsubsection{New lists} -If you are using other kinds of floats such as listings, you should use the Memoir |\newlistof| command to make the relevant list. The class provides a macro |\msucaptiondelim| which can be used to make sure the formatting of the captions in the list-of-X match the setting you have for Figures and Tables. Here is an example of how you would add a listings list. For lists of algorithms, see section \ref{algorithms} below. The following code goes in your preamble: -\begin{quote} -\begin{lstlisting} -\newlistof{listoflistings}{lol}{List of Listings} -\newfloat[chapter]{listing}{lol}{Listing} -\newlistentry{listing}{lol}{0} -\renewcommand*{\cftlistingname}{Listing\space} -\renewcommand*{\cftlistingaftersnum}{\msucaptiondelim} -\end{lstlisting} -\end{quote} - -Then in your front matter you include a |\listoflistings| in the same way you would add the |\listoffigures| or |\listoftables| (preceded by a |\clearpage|). In your actual document you would use. (Note that this code doesn't actually format a listing as code; you would further embed your favourite code listing environment inside this environment.) - -\begin{quote} -\begin{lstlisting} -\begin{listing} -Your listing code here -\end{listing} -\end{lstlisting} -\end{quote} - -Another common kind of list is a List of Abbreviations. The thesis office seems to want to call this “Key to Abbreviations”. To add such a list, you need to do the following: - -\begin{quote} -\begin{lstlisting} -\clearpage -\chapter*{Key to Abbreviations} -\vspace{\cftparskip} -\addcontentsline{toc}{chapter}{Key to Abbreviations} -Your list of abbreviations here. -\end{lstlisting} -\end{quote} - -\subsection{Algorithm packages\label{algorithms}} -Because the various algorithm formatting packages such as \pkg{algorithm2e} and \pkg{algorithmicx} (or its related packages) sometimes create incompatibilities with the \pkg{memoir} float methods, the class provides you with floating |{algorithm}| environment and the corresponding list of algorithms, so you do not have to create your own list of algorithms. Here are some specific important points about using \pkg{algorithm2e} and \pkg{algorithmicx}. -\begin{itemize}[label=\textbullet] -\item Do \emph{not} load the \pkg{algorithm} package. -\item If you use the \pkg{algorithm2e} package you \emph{must} load it with the |[algo2e]| option (along with any other options you need). -\end{itemize} -\subsubsection{\pkg{algorithmicx} package} If you are using the \pkg{algorithmicx} package, any of its related packages (including its older predecessor \pkg{algorithmic}) which suggest that you use the \pkg{algorithm} package to create floating algorithms, you can load the \pkg{float} package to use the its float styling capabilities instead of loading the \pkg{algorithm} package. You should \emph{not} however use the \pkg{float} package to create new floating environments. You must use the \pkg{memoir} methods to create new floating environments and only then load the \pkg{float} package. - -If you would normally load the \pkg{algorithm} package to create floating algorithms do the following instead. If you are creating any other new floating environments (like listings as described above) you \emph{must} create these environments first \emph{before} loading the \pkg{float} package otherwise your document will not compile. -\begin{quote} -\begin{lstlisting} -% This code should only appear AFTER you have created any other new lists -\usepackage{float} -\floatstyle{ruled}% or any of the predefined float styles -\restylefloat{algorithm} -\end{lstlisting} -\end{quote} -\subsubsection{Algorithm caption delimiter} -If you have changed the |\msucaptiondelimeter| to use a colon (see \ref{captiondelim}) then depending on the particular algorithm package you are using, there may be a mismatch between the format of the caption in the algorithm itself and in the List of Algorithms. The Graduate School thinks the presence or absence of a colon in captions and lists is of vital importance, and they may complain about this. Here are two options to use if they complain: - -The first method removes the colon from the word Algorithm in the List of Algorithms: -\begin{quote} -\begin{lstlisting} -% Use this code after loading any algorithm package and the float package -% This removes the colon after the word Algorithm in the List of Algorithms -\renewcommand*{\cftalgorithmaftersnum}{} -\end{lstlisting} -\end{quote} - -The second method adds a colon to the word Algorithm in the captions of the algorithms - -\begin{quote} -\begin{lstlisting} -% Use this code after loading any algorithm package and the float package -% This removes the colon after the word Algorithm in the List of Algorithms -% Change the [ruled] specification to the algorithm style you are using. -\usepackage{caption} -\captionsetup[ruled]{labelsep=colon} -\end{lstlisting} -\end{quote} - - - -\subsection{The \pkg{microtype} package and contents lists} -If you use the \pkg{microtype} package with |protrusion| set, it’s best to turn it off before your contents lists. You can do this by using |\microtypesetup{protrusion=false}| -before the contents lists and |\microtypesetup{protrusion=true}| afterwards. Schematically: - -\begin{quote} -\begin{lstlisting} -\microtypesetup{protrusion=false} -\tableofcontents* -\clearpage -\listoftables -\clearpage -\listoffigures -... -\microtypesetup{protrusion=true} -\end{lstlisting} -\end{quote} -\subsection{Abstracts} -MSU requires you to have an abstract, but you may also have a public abstract, which is weirdly unnumbered and uncounted. - -\subsubsection{Spacing after the author name in the abstract}\label{abstractspacing} -The thesis office is very inconsistent in how it determines what it thinks is a “double space”, and this especially seems to be true after the author name in the the abstract. Because of this, I’ve created a way to change the spacing within the user document so that you can appease the thesis office bureaucrats without reporting an issue to me. - -Use the command |\setabstractnamespace| to change the spacing after the author name in the abstract. This command takes a value typically between 0 and 1 where 0 reduces the space to a single baselineskip, while 1 adds an extra baselineskip. The default is set to 1, but if that’s too large, try 0.5 or 0 as needed. - -\subsubsection{Public abstract} -If your thesis requires a public abstract, it should go immediately before the regular abstract. Use the |{publicabstract}| environment for this. Please note that you \emph{must} have an abstract even if you also have a public abstract. -\subsection{Landscape figures and tables} -If you have large figures and tables that must be rotated, you should use the |[lscape]| class option. This enables a pagestyle |lscape| and places the page numbers correctly on the long edge of the page. The option loads the \pkg{pdflscape} package which provides a |landscape| environment to place the landscape figure in. Before the landscape environment, you need to issue a |\clearpage| command and change the pagestyle to |lscape|, and afterwards, change it back to |plain|. Schematically, then, any landscape pages should be created in the following way. - -\begin{quote} -\begin{lstlisting} -\clearpage\pagestyle{lscape} -\begin{landscape} - ... your large table(s) or figure(s) here -\end{landscape} -\pagestyle{plain} -\end{lstlisting} - -\end{quote} - -The |landscape| environment makes all pages within it landscape, so if you have multiple landscape figures in a row, you can put all of them inside a single |landscape| environment. This option correctly rotates the landscape pages within the pdf document itself, which the thesis office seems to require. -\subsection{Appendices} -Appendices in a thesis are usually at the end of the document, but before the bibliography. MSU requires appendices to be preceded by a cover page which says either ``Appendix'' (if there is only one) or ``Appendices'' if there is more than one. The class implements this with two environments: |{appendix}| for a single appendix and |{appendices}| for multiple appendices. If your thesis organization requires appendices per-chapter, you must use the |[chapterapp]| class option. In either case, the code for appendices is identical, i.e., each appendix is introduced with the |\chapter| command. -\subsubsection{Single appendix} -If you have a single appendix, your code should look like this: - -\begin{quote} -\begin{lstlisting} -\begin{appendix} -\chapter{Your appendix title} -Appendix text goes here -\end{appendix} -\end{lstlisting} -\end{quote} - -\subsubsection{Multiple appendices} -If you have more than one appendix, your code should look like this: - -\begin{quote} -\begin{lstlisting} -\begin{appendices} -\chapter{Your first appendix title} -Appendix text goes here -\chapter{Your second appendix title} -Appendix text goes here -\end{appendices} -\end{lstlisting} -\end{quote} - -\subsubsection{Appendices per chapter} -If you need to add an appendix or appendices to a chapter, you must use the \pkg{[chapterapp]} class option. The code for the appendices themselves is exactly as described above. This means that the appendix itself is introduced by the |\chapter| command, \emph{not} a |\section| command (because the this seems to be how the thesis office wants things to look). Furthermore, per-chapter appendices should \emph{not} be preceded by the |\backmatter| command, which should only precede the global bibliography or appendices. - -\subsection{Bibliographies} -The class places no constraints on how you do your bibliography. It doesn't care whether you are using the \pkg{chapterbib} package with \pkg{natbib} or the per-chapter bibliography functionality provided by \pkg{biblatex}. If you have per-chapter bibliographies, however, you \emph{must} use the |[chapterbib]| class option. This option lets the class know that you are using per-chapter bibliographies. Before any bibliography (whether global or per-chapter) you should use the |\makebibliographypage| command. Note that per-chapter bibliographies should \emph{not} be preceded by the |\backmatter| command, which should only precede the global bibliography or appendices. - -\subsubsection{Bibliography spacing}\label{bibspacing} -Please note that although bibliography entries must be single spaced, there must be a space between each entry. This parameter is set by your bibliography package and not by the class itself. If you are using \pkg{natbib} or \pkg{biblatex} these spacing parameters are set for you by the class. If you are using another package for your bibliography you are responsible for adjusting the relevant spacing parameters. - -\subsection{Customizing the look of things} -I have created a basic looking style for Chapter headings based on the |thatcher| style in |memoir|. If you want to change these things, you may, using the appropriate |\renewcommand| commands. More information can be found in the |memoir| documentation. The Thesis Office seems to require dotted leaders for the List of Figures/Tables in the Table of Contents, (despite the guide saying they are optional) even though they get typeset as Chapters. If you wish your Chapter headings to have no leaders, add the following command just after the |\mainmatter| command. To put the dots back for the Bibliography, repeat the same command right after the |\backmatter| command, but replace |\cftnodots| with |\cftdotsep|. The default template leaves dots everywhere, which should appease the thesis office. -\begin{quote} -\begin{lstlisting} -\addtocontents{toc}{% - \protect\renewcommand{\protect\cftchapterdotsep} - {\cftnodots}} -\end{lstlisting} -\end{quote} -Despite there being no explicit formatting requirements for Chapter headings (other than that they start 1 in from the top of the page), the thesis office has been known to dislike many things, so if you do decide to change things, be prepared for rejection or a frustrating fight. -\subsection{Things to watch out for\label{watchout}} -\begin{itemize} -\item If you are having problems with the Thesis office about non-conforming formatting, please check first whether you have a local copy of the class instead of the latest version distributed via CTAN. The log file will reflect the date of the current version number. Remember if you are using the most current and updated TeXLive or MikTeX you will automatically have the latest version already and you should not need to install a local version. Overleaf users may need a local copy, since Overleaf is usually a year behind the TeXLive distribution schedule. -\item If your title is long and you want to put a newline (|\\|) into it to improve the spacing, you must precede the newline with |\protect|. -\item Make sure you pay attention to any ``Overfull hbox'' warnings when you are producing your final copy. You should make sure you eliminate all of them or else the thesis office is likely to reject your thesis. One common way to eliminate such warnings is to place the command |\sloppy| at the beginning of the paragraph that triggers the warning. You should only use this technique at the very end when you are completely done with everything. Alternatively, rewording the text may also fix things. -\item Remember to use the |\tableofcontents*| command so that your table of contents is not listed in the table of contents. -\item Remember to use the |{appendix}| environment for single appendices, and the |{appendices}| environment for multiple appendices. Do not use the standard LaTeX |\appendix| command. -\item Remember also that \emph{all} appendices whether global or per-chapter should be |\chapter| commands in your source document. -\item Remember to add the |\makebibliographypage| command before any bibliography in your document. -\end{itemize} -\subsection{Master’s Theses} -Master’s theses are sometimes relatively short, and you may think that you can just have |\section| commands with no chapters. This will \emph{not} work. The class is designed to use chapters (and as far as I can tell, the Graduate School also expects chapters). - -\section{Bugs and redistribution} -\subsection{Current version} -The latest copy of \pkg{msu-thesis} will always be available on \href{https://ctan.org/pkg/msu-thesis?lang=en}{CTAN} and on \href{https://github.com/amunn/msu-thesis}{GitHub}. If you use MiKTeX, or a current year TeX Live then their respective package managers can update or install the latest version. If you are using Overleaf, you may not have the most recent version, since Overleaf is usually about one year behind in its TeX distribution. If you are using a Linux-based distribution, or your TeXLive distribution is not the most recent year, you may need to install the latest copy in your local |texmf| directory or simply in the same directory as your main source file. If you want others to use the class, \textsc{please} point them to CTAN, or tell them to use an up-to-date TeX distribution so that they can use an up-to-date version with all accompanying documentation and examples rather than passing along your copy. Please report \textsc{any} problems you have with the class to me \href{mailto:amunn@msu.edu}{amunn@msu.edu}, as this will aid in making things easier for those who follow you. You may also report actual bugs or class-caused formatting issues using GitHub: \href{https://github.com/amunn/msu-thesis}{github.com/amunn/msu-thesis}, but in my experience, most issues are more easily dealt with using email. The Graduate School rarely announces changes it makes to the formatting requirements, and it is often very inconsistent in what kinds of things it chooses to get annoyed about, so your problem reports are extremely helpful for keeping the class in compliance with the latest standards. -\subsection{Asking me for help} -I'm happy to answer emails about formatting issues with the class, especially when you are in the final stages of formatting your dissertation or thesis, but please keep in mind the following: -\begin{itemize} -\item If you have general LaTeX questions that are not specifically related to the class, please try to find answers elsewhere. \href{https://tex.stackexchange.com/}{tex.stackexchange.com} is an excellent resource for LaTeX help. -\item Please make sure you have the latest version of the class (check the log file and compare it with \href{https://ctan.org/pkg/msu-thesis?lang=en}{CTAN} or \href{https://github.com/amunn/msu-thesis}{GitHub}). -\item Please make sure you've checked all the issues listed in section \ref{watchout}. -\item Please send me an error-free, compilable sample document for me to test. The best option is for this to be a small sample document using the class that you create that recreates the problem you're having. (Of course if the class actually causes the error, your sample doesn't need to be error free; but it should be free of errors unrelated to the class itself.). -\item If you feel the need to send me your thesis, please send a zip of all the files, otherwise it becomes impossible to test otherwise. -\item If you are using Overleaf, PLEASE check the log file for errors, and fix them \emph{before} you send me a sample document. Overleaf has a tendency to produce output even when the document has lots of errors, and it is extremely time consuming for me to fix errors that have nothing to do with the class before trying to help you with your actual problem. -\end{itemize} -\subsection{Archiving your thesis for the future} -Since the current version of the \pkg{msu-thesis} class satisfies the Graduate School requirements at any one time, as these requirements change, you may find that if you need to recompile your thesis after you have graduated that the formatting changes. To avoid this, I would recommend saving an archived version of the \pkg{msu-thesis.cls} file in the same folder as your thesis file. You only need to do this once you have completely finished your thesis however; there's no need to do it during the writing process. -\subsection{Major Version history} -Previous versions of \pkg{msu-thesis} (versions 1.0--1.4b) were created for non-electronic submission and should not be used. Versions 1.5--1.6 (the first electronic submission versions) contained a |\makeabstract| command and a separate |msuabstract| environment. These have been removed as of version 1.7. Users who are upgrading from earlier versions to version 1.7 do not need to change these commands however but their use will trigger a warning.) Version 2.0 implemented landscape pages; version 2.1 added support for \pkg{hyperref}. Versions 2.2--2.5 mainly accommodated to the ever changing whims of the MSU Graduate School. Version 2.6 fixed some appendix bugs introduced by the previous whim accommodation. Version 2.7 fixed various small spacing issues, fixed a bug which prevented a new chapter page to be a landscape page, added support for the \pkg{apacite} package, and updated degree options. Version 2.8 fixed some spacing and capitalization issues and added support for the public abstract. Version 2.9 removed subscript/superscript size restrictions, added font size options and made small spacing changes to appease the thesis office. Version 3.0 added full support for per-chapter bibliographies and appendices, and automated bibliography spacing for |natbib| and |biblatex| produced bibliographies. Version 3.1 added support for an |{algorithm}| environment and a list of algorithms to combat incompatibilities with the \pkg{algorithm} and \pkg{algorithm2e} packages. Version 3.2 fixed some lingering problems with per-chapter appendices. Version 3.3 added code to accommodate the insane inconsistencies in formatting requirements that the thesis office requires, including a new contents option which hopefully should never be used, and fixed some numbering problems with per-chapter appendices. Version 3.4 added a starred option to the |\makecopyrightpage| command after complaints about placement. The documentation has also been updated to include more information about caption formatting and removed colons from the default caption format. Version 3.5 added user level way to change the spacing after the author’s name in the abstract, to deal with thesis office inconsistency. - -\section{Acknowledgements} -Thanks to Lars Madsen, Ulrike Fischer and Peter Wilson for help with setting up parts of the memoir code for versions 1.0--1.4 (now eliminated due to changed requirements). Thanks to Wolfgang Sternefeld for supplying the \pkg{linguex} spacing fix code, Leo Liu for the landscape page numbering code, which greatly simplified my original version, and Florent Chervet for the \pkg{hyperref} code. Thanks also to the following students who have reported problems over the years: Irina Agafonova, Ali Al-jiboory, Abubakr Ayesh, Julian Blank, Dmitriy Bryndin, Greg Christian, Kyle Crayne, Ciaron Hamilton, Matt Husband, Changkuk Jung, Adam Liter, Vanessa Maldonado, William Muir, Alicia Parrish, Neil ver Planck, Giacomo Romanini, William Sands, Adam Soliman, Erik Stitt, Eremey Valetov, Matthew Vincent, Michael Wojcik, Stephen Yowono, Ali Zare, and Yisu Zhou. A special thank you to Non Thongprong who graciously provided a copy of his entire thesis which allowed me to debug some especially subtle spacing inconsistencies. - -\appendix -\renewcommand{\thesection}{Appendix \Alph{section}} -\clearpage -\section{Sample template} -You can find a copy of this template \href{http://mirrors.ctan.org/macros/latex/contrib/msu-thesis/samples/MSU-thesis-template.tex}{here}. -\enlargethispage{2\baselineskip} -\begin{lstlisting} -\documentclass[PhD]{msu-thesis} -% Your extra packages here -% -% Define the title, author, field of study, date, and dedication (optional) -% -\title{The syntax and semantics of phonology} -\author{Joe Linguist} -\fieldofstudy{Linguistics} % should be in sentence case -\dedication{This thesis is dedicated to someone.} -\date{2014} -% -\begin{document} -\frontmatter -% -\maketitlepage -% -\begin{abstract} -Your abstract text here -\end{abstract} -% -\clearpage -\makecopyrightpage -\makededicationpage -% -\clearpage -\chapter*{Acknowledgements} -\DoubleSpacing -Your acknowledgements here -% -\clearpage -\SingleSpacing -\tableofcontents* -\clearpage -\listoftables -\clearpage -\listoffigures -% -\mainmatter -\chapter{Your first chapter} -% -\appendix -\chapter{Your first appendix} -\backmatter -\makebibliographypage -\SingleSpacing -\bibliography{your-bib-file} -\end{document} - -\end{lstlisting} -\clearpage -\section{Linguistic Examples with \pkg{gb4e} and \pkg{linguex}} -The \pkg{msu-thesis} class has been tested with both the \pkg{gb4e} package, and the \pkg{linguex} package. Unfortunately some versions of \pkg{gb4e} use old font commands, and so does \pkg{linguex}, so if you encounter problems with either package, load the class with the |oldfontcommands| option. Since linguistic examples are usually single spaced, even in theses, you should use the |\singlegloss| command (from the \pkg{cgloss4e} package loaded by both \pkg{gb4e} and \pkg{linguex}) to make your glosses examples singlespaced. The default mode for examples themselves is to make them doublespaced. If you want all examples to be single spaced (which looks better if the examples take up more than one line) you need to put the following code in your preamble, which redefines the |exe| environment to be single spaced. The |\patchcommand| macro is part of \pkg{memoir}. Other patching commands such as those provided by the \pkg{etoolbox} package could also be used. -\begin{quote} -\begin{lstlisting} -\patchcommand{\exe}{\SingleSpacing}{} -\end{lstlisting} -\end{quote} -For the \pkg{linguex} package, you can use the following code: -\begin{quote} -\begin{lstlisting} -\patchcommand{\ex}{\SingleSpacing}{} -\renewcommand{\ExEnd}{% - \ifnum\theExDepth=0\global\unembeddedfalse\DoubleSpacing\else% - \end{list}\addtocounter{ExDepth}{-1}\ExEnd\fi} -\end{lstlisting} -\end{quote} - -\end{document} \ No newline at end of file diff --git a/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.pdf b/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.pdf index 0845300e57..a2f192bdda 100644 Binary files a/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.pdf and b/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.pdf differ diff --git a/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.tex b/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.tex index d9a2196b85..7cc0d964cc 100644 --- a/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.tex +++ b/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.tex @@ -3,6 +3,7 @@ \listfiles \documentclass[lscape]{msu-thesis} +\setabstractnamespace{0} % lscape option is needed for this sample file to show correct placement % of page numbers on landscape pages. If you don't have any landscape pages % in your document, you don't need to load this option. -- cgit v1.2.3