diff --git a/13-toc/basicActivity.tex b/13-toc/basicActivity.tex new file mode 100644 index 0000000..b819829 --- /dev/null +++ b/13-toc/basicActivity.tex @@ -0,0 +1,43 @@ +\documentclass{ximera} + +\author{Bart Snapp} + +\title{A basic activity} + +\begin{document} +\begin{abstract} + This is filler content for a table of contents. +\end{abstract} +\maketitle + +This is a basic activity, with sections, subsections, and paragraphs. + + +Note: option \verb!numbers! needed in the \verb!xourse! file for numbered entries in TOC. + + + + + +\section{A true section in a basic activity} +\lipsum[1][1-2] + + +\subsection{A true subsection in a basic activity} +\lipsum[2][1-2] + +\paragraph{A true paragraph in a basic activity} +\lipsum[3][1] + + +\section{A second true section in a basic activity} +\lipsum[4][1-2] + + +\subsection{Another true subsection in a basic activity} +\lipsum[1][1-2] + +\paragraph{Another true paragraph in a basic activity} +\lipsum[2][1] + +\end{document} \ No newline at end of file diff --git a/13-toc/chapterLevelActivity.tex b/13-toc/chapterLevelActivity.tex new file mode 100644 index 0000000..9db9a70 --- /dev/null +++ b/13-toc/chapterLevelActivity.tex @@ -0,0 +1,42 @@ +\documentclass{ximera} + +\author{Bart Snapp} + +\title{A chapter level activity} + +\begin{document} +\begin{abstract} +This is a chapter level Ximera activity. +\end{abstract} +\maketitle + +This an activity, that is considered a +\textbf{chapter} within a document, where \verb!\chapterstyle! delineates +chapters. + +Note: option \verb!numbers! needed in the \verb!xourse! file for numbered entries in TOC. + + +This should be primarly used as a ``chapter overview'' and while it can contain +sections, we advise not mixing \verb!!\sectionstyle! and \verb!\section! with a +chapter level document (though we do it here for illustration purposes). + +\section{A true section in a chapter level activity} +\lipsum[1][1-2] + +\subsection{A true subsection in a chapter level activity} +\lipsum[2][1-2] + +\paragraph{A true paragraph in a chapter level activity} +\lipsum[3][1] + +\section{A second true section in a chapter level activity} +\lipsum[1][1-2] + +\subsection{Another true subsection in a chapter level activity} +\lipsum[2][1-2] + +\paragraph{Another true paragraph in a chapter level activity} +\lipsum[3][1] + +\end{document} \ No newline at end of file diff --git a/13-toc/sectionLevelActivity.tex b/13-toc/sectionLevelActivity.tex new file mode 100644 index 0000000..f8da8ed --- /dev/null +++ b/13-toc/sectionLevelActivity.tex @@ -0,0 +1,42 @@ +\documentclass{ximera} + +\author{Bart Snapp} + +\title{A section level Ximera activity} + +\begin{document} +\begin{abstract} +This is a Ximera activity interpreted as a section. +\end{abstract} +\maketitle + +This a section level activity, that is considered a +\textbf{section} within a document, where \verb!\part! delineates chapters or a +previous activity with \verb!\chapterstyle! delineates the chapter and sections. + +Note: option \verb!numbers! needed in the \verb!xourse! file for numbered entries in TOC. + +\begin{warning} + Since the level of the activity is a section, within this activity, + \verb!\section! will create subsections. +\end{warning} + +\section{A true section in a section level activity} +\lipsum[1][1-2] + +\subsection{A true subsection in a section level activity} +\lipsum[1][1-2] + +\paragraph{A true paragraph in a section level activity} +\lipsum[1][1] + +\section{A second true section in a section level activity} +\lipsum[1][1-2] + +\subsection{Another true subsection in a section level activity} +\lipsum[1][1-2] + +\paragraph{Another true paragraph in a section level activity} +\lipsum[1][1] + +\end{document} \ No newline at end of file diff --git a/13-toc/toc.tex b/13-toc/toc.tex new file mode 100644 index 0000000..07eb321 --- /dev/null +++ b/13-toc/toc.tex @@ -0,0 +1,66 @@ +\documentclass[numbers]{xourse} + +\author{Bart Snapp} + +\title{Basic Table of Contents} + +\setcounter{secnumdepth}{3} +\setcounter{tocdepth}{1} + +\begin{document} +\begin{abstract} + This document is an example of a basic table of contents. +\end{abstract} +\maketitle + + + +\activity{basicActivity} +\activity{basicActivity} +\activity{basicActivity} + + + + + + + + + +%% Make a new command for this \xmPartAsChapter +\newcommand{\xourseChapter}[1]{ + \ifonlineTF + {\part{#1}} % Online an 'empty' \chapter does not exist ...? + {\chapterstyle\def\thechaptertitle{#1}\title{#1}\begin{abstract}\end{abstract}\maketitle} +} + + +\xourseChapter{Some chapter defined as a part} %% Part needs to be redefined in xmPreamble +\sectionstyle +\activity{sectionLevelActivity} +\activity{sectionLevelActivity} +\activity{sectionLevelActivity} + +\xourseChapter{The next chapter defined as a part} +\sectionstyle +\activity{sectionLevelActivity} +\activity{sectionLevelActivity} +\activity{sectionLevelActivity} + + + + +\chapterstyle +\activity{chapterLevelActivity} +\sectionstyle +\activity{sectionLevelActivity} +\activity{sectionLevelActivity} + + +\chapterstyle +\activity{chapterLevelActivity} +\sectionstyle +\activity{sectionLevelActivity} +\activity{sectionLevelActivity} + +\end{document} \ No newline at end of file diff --git a/13-toc/toc_wim.tex b/13-toc/toc_wim.tex new file mode 100644 index 0000000..9d0459e --- /dev/null +++ b/13-toc/toc_wim.tex @@ -0,0 +1,80 @@ +\documentclass[numbers]{xourse} + +\usepackage{titlesec} + +\author{Bart Snapp} + +\usepackage{lipsum} + +\title{Basic Table of Contents (wim)} + +\setcounter{secnumdepth}{6} +\setcounter{tocdepth}{1} + +\begin{document} +\begin{abstract} +\end{abstract} +\maketitle + +% % Second TOC; DOES NOT WORK +% \clearpage +% \begingroup +% \setcounter{tocdepth}{6} +% \renewcommand{\contentsname}{Appendix Contents} +% \makeatletter +% \patchcmd{\@mkboth}{\ttl@savemark}{\relax}{}{} +% \makeatother +% \tableofcontents +% \endgroup + +% TOCDEPTH = \arabic{tocdepth} xxx yzz + + +%% Mabe a new command for this \xmPartAsChapter +\pdfOnly{\renewcommand{\part}[1]{\chapterstyle\def\thechaptertitle{#1}\title{#1}\begin{abstract}\end{abstract}\maketitle}} + +% \part{The first part} +\chapterstyle +\activity{basicActivity} +\activity{basicActivity} +% \sectionstyle +% \activity{basicActivity} +% \activity{basicActivity} + +% \activity{basicActivity} + + +\part{Some chapter defined as a part} %% Part needs to be redefined in xmPreamble +\sectionstyle +\activity{sectionLevelActivity} +\activity{sectionLevelActivity} +% \activity{sectionLevelActivity} + +\part{The next chapter defined as a part} +\sectionstyle +\activity{sectionLevelActivity} +\activity{sectionLevelActivity} +% \activity{sectionLevelActivity} + + +\chapterstyle +\activity{chapterLevelActivity} +\sectionstyle +\activity{sectionLevelActivity} +\activity{sectionLevelActivity} + + +\chapterstyle +\activity{chapterLevelActivity} +\sectionstyle +\activity{sectionLevelActivity} +\activity{sectionLevelActivity} + +\part{And now for basicActivity as a section} +\chapterstyle +\activity{basicActivity} +\sectionstyle +\activity{basicActivity} + + +\end{document} \ No newline at end of file diff --git a/13-toc/xmPreamble.tex b/13-toc/xmPreamble.tex new file mode 100644 index 0000000..6d1fa56 --- /dev/null +++ b/13-toc/xmPreamble.tex @@ -0,0 +1,114 @@ +\usepackage{lipsum} % for filler text + + +\renewcommand{\theHsection}{chapter.section.\thesection} %% MAKES LINKS WORK should be added to CLS + + + + +\makeatletter +\renewcommand\chapterstyle{% + \def\activitystyle{activity-chapter} + \def\maketitle{% + \addtocounter{titlenumber}{1}% + \phantomsection\addcontentsline{toc}{section}{\textbf{\thetitlenumber\hspace{1em}\@title}} + {\flushleft\small\sffamily\bfseries\@pretitle\par\vspace{-1.5em}}% + {\flushleft\LARGE\sffamily\bfseries\thetitlenumber\hspace{1em}\@title \par }% + {\vskip .6em\noindent\textit\theabstract\setcounter{problem}{0}\setcounter{section}{0}}% + \par\vspace{2em} +}} + + + + + +\renewcommand\sectionstyle{% MOVE TO CLS + \def\activitystyle{activity-section} + \def\maketitle{% + \gdef\headerNameContent{\thechaptertitle:~\@title}%% Needs a gdef to make the definition global. + \addtocounter{section}{1}% + \setcounter{sectiontitlenumber}{\value{section}}% + \phantomsection\addcontentsline{toc}{section}{\thetitlenumber.\thesectiontitlenumber\hspace{1em}\@title}% + {\flushleft\small\sffamily\bfseries\@pretitle\par\vspace{-1.5em}}% + {\flushleft\Large\sffamily\bfseries\thetitlenumber.\thesectiontitlenumber\hspace{1em}\@title \par}% + {\vskip .6em\noindent\textit\theabstract\setcounter{subsection}{0}}% + \par\vspace{2em} + + \renewcommand\section{\@startsection{subsection}{2}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\normalfont\large\sffamily\bfseries}} + + \renewcommand\subsection{\@startsection{subsubsection}{3}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\normalfont\normalsize\sffamily\bfseries}} +\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% + {3.25ex \@plus1ex \@minus.2ex}% + {-1em}% + {\normalfont\normalsize\sffamily\bfseries}} +}} +\makeatother + + + + + +%%% LET'S see what this does: +% \makeatletter +% %% Redefine section and subsection %% MOVE TO CLS +% \renewcommand\section{\@startsection{subsection}{1}{\z@}% +% {-3.5ex \@plus -1ex \@minus -.2ex}% +% {2.3ex \@plus.2ex}% +% {\boldmath\normalfont\Large\sffamily\bfseries}} +% \renewcommand\subsection{\@startsection{subsubsection}{2}{\z@}% +% {-3.25ex \@plus -1ex \@minus -.2ex}% +% {1.5ex \@plus .2ex}% +% {\boldmath\normalfont\large\sffamily\bfseries}} +% \renewcommand\subsubsection{\@startsection{paragraph}{3}{\z@}% +% {-3.25ex \@plus -1ex \@minus -.2ex}% +% {1.5ex \@plus .2ex}% +% {\normalfont\normalsize\sffamily\bfseries}} +% \makeatother +% \renewcommand\thesubsection{\thesection} +% \renewcommand\thesubsubsection{\thesubsection.\arabic{subsubsection}} + + +\makeatletter +%% Redefine section and subsection %% MOVE TO CLS +\renewcommand\section{\@startsection{section}{1}{\z@}% + {-3.5ex \@plus -1ex \@minus -.2ex}% + {2.3ex \@plus.2ex}% + {\boldmath\normalfont\Large\sffamily\bfseries}} +\renewcommand\subsection{\@startsection{subsection}{2}{\z@}% + {-3.25ex \@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\boldmath\normalfont\large\sffamily\bfseries}} +\renewcommand\subsubsection{\@startsection{subsection}{3}{\z@}% + {-3.25ex \@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\normalfont\normalsize\sffamily\bfseries}} +\makeatother + +\makeatletter %% move to CLS +\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\normalfont\normalsize\sffamily\bfseries}} +\makeatother + +\makeatletter +\def\activitystyle{activity-chapter} +\def\maketitle{% + \addtocounter{titlenumber}{1}% + \phantomsection\addcontentsline{toc}{section}{\textbf{\thetitlenumber\hspace{1em}\@title}} + {\flushleft\small\sffamily\bfseries\@pretitle\par\vspace{-1.5em}}% + {\flushleft\LARGE\sffamily\bfseries\thetitlenumber\hspace{1em}\@title \par }% + {\vskip .6em\noindent\textit\theabstract\setcounter{problem}{0}\setcounter{section}{0}}% + \par\vspace{2em} +} +\makeatother + + +%% The bug is that the +