texlive[41636] Master/texmf-dist: ycbook (5jul16)

commits+karl at tug.org commits+karl at tug.org
Tue Jul 5 23:39:42 CEST 2016


Revision: 41636
          http://tug.org/svn/texlive?view=revision&revision=41636
Author:   karl
Date:     2016-07-05 23:39:42 +0200 (Tue, 05 Jul 2016)
Log Message:
-----------
ycbook (5jul16)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/ycbook/ycbook-doc.pdf
    trunk/Master/texmf-dist/doc/latex/ycbook/ycbook-doc.tex
    trunk/Master/texmf-dist/tex/latex/ycbook/ycbook.cls

Modified: trunk/Master/texmf-dist/doc/latex/ycbook/ycbook-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/ycbook/ycbook-doc.tex
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/latex/ycbook/ycbook.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/ycbook/ycbook.cls	2016-07-05 21:39:30 UTC (rev 41635)
+++ trunk/Master/texmf-dist/tex/latex/ycbook/ycbook.cls	2016-07-05 21:39:42 UTC (rev 41636)
@@ -1,4 +1,4 @@
-  %% br-lex.cls
+  %% yc-book.cls
   %% Copyright (c) Youssef Cherem <ycherem(at)gmail.com>, 2016
   %
   % This work may be distributed and/or modified under the
@@ -13,13 +13,12 @@
   % 
   % The Current Maintainer of this work is Youssef Cherem.
   %
-  % This work consists of the files ycbook.cls and ycbook-doc.tex, and the files compiled therefrom: 
-  % ycbook.pdf and ycbook-doc.pdf
+  % This work consists of the files ycbook.cls, ycbook-doc.tex, and ycbook-doc.pdf
 
 
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{ycbook}[2016/05/23 ycbook class]
+\ProvidesClass{ycbook}[2016/07/04 ycbook class]
  
 \LoadClassWithOptions{mwbk}	
 
@@ -58,9 +57,25 @@
 %%%%%%
 
 
+%\DeclareSectioningCommand[breakbefore,breakafter,wholewidth]{part}{-1}
+%{0\p@ plus1fil}
+%{\FormatChapterHeading{20\p@}%
+%	{\centering\large\partname\space}%
+%	{\centering\LARGE}}
+%{0\p@ plus1fil}
+
+
 %%%% OPTIONS %%%%%
 
 
+\SetSectionFormatting[breakbefore,breakafter,wholewidth]{part}
+{0pt plus1pt}
+{\FormatChapterHeading{20pt}%
+	{\centering\Large\partname\space}%
+	{\centering\LARGE}}
+{0pt plus1pt}
+
+
 \DeclareOption{chapterrule}{\SetSectionFormatting[breakbefore,wholewidth]{chapter}
 	{56pt plus8pt minus4pt}%espaço antes do capítulo
 	{\Large\textbf{\ifHeadingNumbered
@@ -250,7 +265,6 @@
 %%%%%%%%%%
 
 
-\DeclareOption{myheadings}{%
 \def\ps at myheadings{%
 	\let\ps at normal\hf at headings
 	\let\ps at opening\hf at plain
@@ -261,11 +275,10 @@
 	\let\chaptermark\@gobble
 	\let\sectionmark\@gobble
 }
-\pagestyle{myheadings}
-}
 
-\DeclareOption{myheadings=beforeplain}{%
-	\def\ps at myheadings{%
+
+
+	\def\ps at myheadingsbeforeplain{%
 		\let\ps at normal\hf at headings
 		\let\ps at opening\hf at plain
 		\let\ps at closing\hf at plain
@@ -275,8 +288,6 @@
 		\let\chaptermark\@gobble
 		\let\sectionmark\@gobble
 	}
-	\pagestyle{myheadings}
-}
 
 
 %The macro \@chapapp is initially defined to expand to \chaptername, but \appendix redefines it to be \appendixname.
@@ -283,35 +294,172 @@
 
 
 %%for headings:%%%%
-\DeclareOption{headings}{%
 
-\renewcommand\ps at headings{%
+\if at twoside
+\def\ps at headings{%
+		\let\@mkboth\@gobbletwo
+		\let\ps at normal\hf at headings
+		\let\ps at opening\hf at plain
+		\let\ps at closing\hf at headings %% <-- this was @empty, now @headings!!! use this for page numbers and headings to appear on even pages before new chapter
+		\let\ps at blank\hf at empty
+		\ps at normal
+	\def\chaptermark##1{%
+		\markboth{%
+			\ifHeadingNumbered
+			\if at mainmatter
+			\@chapapp\
+			\thechapter.\enspace
+			\fi
+			\fi
+			##1}{}}%
+	\def\sectionmark##1{%
+		\markright{%
+			\ifHeadingNumbered \thesection.\enspace \fi
+			##1}}}
+\else
+\def\ps at headings{%
 	\let\@mkboth\@gobbletwo
 	\let\ps at normal\hf at headings
 	\let\ps at opening\hf at plain
 	\let\ps at closing\hf at headings %% <-- this was @empty, now @headings!!! use this for page numbers and headings to appear on even pages before new chapter
 	\let\ps at blank\hf at empty
-	\ps at normal}
+	\ps at normal
+	\def\chaptermark##1{%
+		\markright{%
+			\ifHeadingNumbered
+			\if at mainmatter
+			\@chapapp\
+			\thechapter.\enspace
+			\fi
+			\fi
+			##1}}}
+\fi
 
-\pagestyle{headings}
-}
 
-\DeclareOption{headings=beforeplain}{%
-	
-	\renewcommand\ps at headings{%
-		\let\@mkboth\@gobbletwo
-		\let\ps at normal\hf at headings
-		\let\ps at opening\hf at plain
-		\let\ps at closing\hf at headings %% <-- this was @empty, now @headings!!! use this for page numbers and headings to appear on even pages before new chapter
-		\let\ps at blank\hf at plain
-		\ps at normal}
-	
-	\pagestyle{headings}
-}
+\if at twoside
+\def\ps at headingsnodot{%
+	\let\@mkboth\@gobbletwo
+	\let\ps at normal\hf at headings
+	\let\ps at opening\hf at plain
+	\let\ps at closing\hf at headings %% <-- this was @empty, now @headings!!! use this for page numbers and headings to appear on even pages before new chapter
+	\let\ps at blank\hf at empty
+	\ps at normal
+	\def\chaptermark##1{%
+		\markboth{%
+			\ifHeadingNumbered
+			\if at mainmatter
+			\@chapapp\
+			\thechapter\enspace
+			\fi
+			\fi
+			##1}{}}%
+	\def\sectionmark##1{%
+		\markright{%
+			\ifHeadingNumbered \thesection\enspace \fi
+			##1}}}
+\else
+\def\ps at headingsnodot{%
+	\let\@mkboth\@gobbletwo
+	\let\ps at normal\hf at headings
+	\let\ps at opening\hf at plain
+	\let\ps at closing\hf at headings %% <-- this was @empty, now @headings!!! use this for page numbers and headings to appear on even pages before new chapter
+	\let\ps at blank\hf at empty
+	\ps at normal
+	\def\chaptermark##1{%
+		\markright{%
+			\ifHeadingNumbered
+			\if at mainmatter
+			\@chapapp\
+			\thechapter\enspace
+			\fi
+			\fi
+			##1}}}
+\fi
 
 
+\if at twoside
+\def\ps at headingsbeforeplain{%
+	\let\@mkboth\@gobbletwo
+	\let\ps at normal\hf at headings
+	\let\ps at opening\hf at plain
+	\let\ps at closing\hf at headings %% <-- this was @empty, now @headings!!! use this for page numbers and headings to appear on even pages before new chapter
+	\let\ps at blank\hf at plain
+	\ps at normal
+	\def\chaptermark##1{%
+		\markboth{%
+			\ifHeadingNumbered
+			\if at mainmatter
+			\@chapapp\
+			\thechapter.\enspace
+			\fi
+			\fi
+			##1}{}}%
+	\def\sectionmark##1{%
+		\markright{%
+			\ifHeadingNumbered \thesection.\enspace \fi
+			##1}}}
+\else
+\def\ps at headingsbeforeplain{%
+	\let\@mkboth\@gobbletwo
+	\let\ps at normal\hf at headings
+	\let\ps at opening\hf at plain
+	\let\ps at closing\hf at headings %% <-- this was @empty, now @headings!!! use this for page numbers and headings to appear on even pages before new chapter
+	\let\ps at blank\hf at plain
+	\ps at normal
+	\def\chaptermark##1{%
+		\markright{%
+			\ifHeadingNumbered
+			\if at mainmatter
+			\@chapapp\
+			\thechapter.\enspace
+			\fi
+			\fi
+			##1}}}
+\fi
 
+		
 \if at twoside
+\def\ps at headingsbeforeplainnodot{%
+	\let\@mkboth\@gobbletwo
+	\let\ps at normal\hf at headings
+	\let\ps at opening\hf at plain
+	\let\ps at closing\hf at headings %% <-- this was @empty, now @headings!!! use this for page numbers and headings to appear on even pages before new chapter
+	\let\ps at blank\hf at plain
+	\ps at normal
+	\def\chaptermark##1{%
+		\markboth{%
+			\ifHeadingNumbered
+			\if at mainmatter
+			\@chapapp\
+			\thechapter\enspace
+			\fi
+			\fi
+			##1}{}}%
+	\def\sectionmark##1{%
+		\markright{%
+			\ifHeadingNumbered \thesection\enspace \fi
+			##1}}}
+\else
+\def\ps at headingsbeforeplainnodot{%
+	\let\@mkboth\@gobbletwo
+	\let\ps at normal\hf at headings
+	\let\ps at opening\hf at plain
+	\let\ps at closing\hf at headings %% <-- this was @empty, now @headings!!! use this for page numbers and headings to appear on even pages before new chapter
+	\let\ps at blank\hf at plain
+	\ps at normal
+	\def\chaptermark##1{%
+		\markright{%
+			\ifHeadingNumbered
+			\if at mainmatter
+			\@chapapp\
+			\thechapter\enspace
+			\fi
+			\fi
+			##1}}}
+\fi
+
+
+\if at twoside
 \def\ps at uheadings{%
 	\let\@mkboth\markboth
 	\let\ps at normal\hf at uheadings
@@ -363,13 +511,77 @@
 
 
 
+\if at twoside
+\def\ps at uheadingsnodot{%
+	\let\@mkboth\markboth
+	\let\ps at normal\hf at uheadings
+	\let\ps at opening\hf at plain
+	\let\ps at closing\hf at uheadings
+	\let\ps at blank\hf at empty
+	\ps at normal
+	\def\chaptermark##1{%
+		\markboth{%
+			\ifHeadingNumbered
+			\if at mainmatter
+			\@chapapp\
+			\thechapter\enspace
+			\fi
+			\fi
+			##1}{}}%
+	\def\sectionmark##1{%
+		\markright{%
+			\ifHeadingNumbered \thesection\enspace \fi
+			##1}}}
+\else
+\def\ps at uheadingsnodot{%
+	\let\@mkboth\markboth
+	\let\ps at normal\hf at uheadings
+	\let\ps at opening\hf at plain
+	\let\ps at closing\hf at uheadings
+	\let\ps at blank\hf at empty
+	\ps at normal
+	\def\chaptermark##1{%
+		\markright{%
+			\ifHeadingNumbered
+			\if at mainmatter
+			\@chapapp\
+			\thechapter\enspace
+			\fi
+			\fi
+			##1}}}
+\fi
+%\def\ps at myuheadingsnodot{%
+%	\let\ps at normal\hf at uheadings
+%	\let\ps at opening\hf at plain
+%	\let\ps at closing\hf at uheadings
+%	\let\ps at blank\hf at empty
+%	\ps at normal
+%	\let\@mkboth\@gobbletwo
+%	\let\chaptermark\@gobble
+%	\let\sectionmark\@gobble
 
+%%% to add color to sepline
+%\renewcommand*\hf at uheadings{%
+%	\def\@oddhead{\vtop{%
+%			\hb at xt@\textwidth{%
+%				\reset at font{\heading at font\rightmark}\hfil\thepage\strut}%
+%			\vskip2pt{\color{JungleGreen}\hrule}\vskip-2.4pt}}%
+%	\let\@oddfoot\@empty
+%	\def\@evenhead{\vtop{%
+%			\hb at xt@\textwidth{%
+%				\reset at font\strut\thepage\hfil\heading at font\leftmark}%
+%			\vskip2pt{\color{JungleGreen}\hrule}\vskip-2.4pt}}%
+%	\let\@evenfoot\@empty
+%}
+
+
+
 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{mwbk}}
 
 
 \DeclareOption{sansserifnotes}{%marginpar to sans serif
-	\let\oldmarginpar\marginpar
-	\renewcommand{\marginpar}[1]{\oldmarginpar{\footnotesize \raggedright \sffamily#1}}
+%	\let\oldmarginpar\marginpar
+%	\renewcommand{\marginpar}[1]{\oldmarginpar{\footnotesize \raggedright \sffamily#1}}
 	
 	%footnote to sans serif
 	\let\oldfootnote\footnote
@@ -382,21 +594,213 @@
 		}
 
 
-%\PassOptionsToClass{withmarginpar}{mwbk}
-
-\DeclareOption{toc}{%
-%%% you can use this package. says there is an error, but it works nonetheless%%%
-\AtEndOfClass{\RequirePackage[tocgraduated]{tocstyle}}%\AtEndOfClass -- important
-%\usetocstyle{nopagecolumn}
-\ClassWarning{ycbook}{'toc' option implemented by the 'tocstyle' package. You can use this package. says there is an error, but it works nonetheless.}
+\DeclareOption{nodots}{
+\renewcommand*\@seccntformat[1]{\csname the#1\endcsname\enspace}
+\def\mw at seccntformat#1{#1\enspace}
 }
+%%%%%%%%%%%% end of nodots option %%%%%%%%%%%%%%%%
 
+
+
+
 \ExecuteOptions{headings,chapterleft}
 
 \ProcessOptions\relax
 
+\RequirePackage{titletoc}
 
 
+
+%\titlecontents{chapter}[1em]{\addvspace{1pc}\bfseries}{\contentslabel{1em}}{}
+%{\titlerule*[0.3pc]{.}\contentspage}
+
+%\titlecontents{chapter}
+%[0pt]
+%{\addvspace{1pc}%
+%	\itshape}%
+%{\contentsmargin{0pt}%
+%	\bfseries
+%	\makebox[0pt][r]{\huge\thecontentslabel\enspace}%
+%	\large}
+%{\contentsmargin{0pt}%
+%	\large}
+%{\quad\thepage}
+%[\addvspace{.5pc}]
+
+%%%%% FANCY TOC %%%%%%%%%
+
+%double all #1 like ##1 if it's inside another definition
+
+%%%%original changed:
+
+%\renewcommand*\l at part[2]{%
+%	\ifnum \c at tocdepth >-2\relax
+%	\mw at tocskip{-1}{.6\baselineskip}%
+%	\begingroup
+%	\parindent \z@ \rightskip \@pnumwidth
+%	\parfillskip -\@pnumwidth
+%	{\leavevmode%\normalsize\normalfont 
+%		\bfseries
+%		\let\numberline\partnumberline  % <--- added
+%		\centering \Large #1\par
+%	}
+%	\nobreak
+%	\global\@nobreaktrue
+%	\everypar{\global\@nobreakfalse\everypar{}}%
+%	\endgroup
+%	\addvspace{.4\baselineskip}%
+%	\fi}
+%\def\partnumberline#1{\@partnumberline#1\@nil}
+%\def\@partnumberline#1.#2\@nil{\partname\ #1\\\large\itshape}%
+
+
+\newcommand{\fancytoc}{%	
+%	\renewcommand*\l at part[2]{%
+%		\ifnum \c at tocdepth >-2\relax
+%		\mw at tocskip{-1}{.6\baselineskip}%
+%		\begingroup
+%		\parindent \z@ \rightskip \@pnumwidth
+%		\parfillskip -\@pnumwidth
+%		{\leavevmode%\normalsize\normalfont 
+%			\bfseries
+%			\let\numberline\partnumberline  % <--- added
+%			\centering \Large ##1\par
+%		}
+%		\nobreak
+%		\global\@nobreaktrue
+%		\everypar{\global\@nobreakfalse\everypar{}}%
+%		\endgroup
+%		\addvspace{.4\baselineskip}%
+%		\fi}
+%	\def\partnumberline##1{\@partnumberline##1\@nil}
+%	\def\@partnumberline##1.##2\@nil{\partname\ ##1\\\large\itshape}%
+	
+	\titlecontents{part}
+	[0pt]
+	{\addvspace{2pc}%
+		\bfseries\centering}%
+	{\contentsmargin{0pt}%
+		\bfseries
+		 \huge Parte~\thecontentslabel
+		 \\[12pt]%
+		\Large\itshape}
+	{\contentsmargin{0pt}%
+		\huge}
+	{\quad\contentspage}
+	[\addvspace{.5pc}]
+	
+	\titlecontents{chapter}
+	[0pt]
+	{\addvspace{1pc}%
+		\itshape}%
+	{\contentsmargin{0pt}%
+		%\bfseries
+		\large\thecontentslabel\enspace%
+	}
+	{\contentsmargin{0pt}%
+		\itshape\large}
+	{\quad\contentspage}
+	[\addvspace{.5pc}]%
+	
+	%
+	%\titlecontents{section}
+	%[3.8em] % ie, 1.5em (chapter) + 2.3em
+	%{}
+	%{\contentslabel{2.3em}}
+	%{\hspace*{-2.3em}}
+	%{\titlerule*[1pc]{.}\contentspage}
+	
+	\titlecontents{section}
+	[3.4em] % ie, 1.5em (chapter) + 2.3em
+	{}
+	{\contentslabel{2em}\enspace\enspace}
+	{\hspace*{-2.3em}\enspace}
+	{\quad\contentspage}%
+	
+	\titlecontents{subsection}
+	[6.6em] % ie, 1.5em (chapter) + 2.3em
+	{}
+	{\contentslabel{2.3em}\enspace\enspace}
+	{\hspace*{-2.3em}\enspace}
+	{\quad\contentspage}%
+	
+	\titlecontents{subsubsection}
+	[8.9em] % ie, 1.5em (chapter) + 2.3em
+	{}
+	{\contentslabel{2.3em}\enspace\enspace}
+	{\hspace*{-2.3em}\enspace}
+	{\quad\contentspage}%
+	
+	
+	\titlecontents{figure}
+	[0pt] % ie, 1.5em (chapter) + 2.3em
+	{}
+	{\contentslabel{2.3em}\enspace}
+	{\hspace*{-2.3em}\enspace}
+	{\quad\contentspage}
+	
+	\titlecontents{table}
+	[0pt] % ie, 1.5em (chapter) + 2.3em
+	{}
+	{\contentslabel{2.3em}\enspace}
+	{\hspace*{-2.3em}\enspace}
+	{\quad\contentspage}
+	
+	
+	%%%%%%% end part in toc %%%%%%%%
+}
+
+%For the parameters of a definition inside a definition you need to double the hash char:
+%
+%\renewcommand\appendix{\par
+%	\def\@makechapterhead##1{%
+%		... ##1 ...
+%	}%
+%	...
+%}
+
+
+%from http://tex.stackexchange.com/questions/62438/how-to-add-leaders-to-table-of-contents-without-tocloft/62441#62441 
+
+\newcommand{\traditionaltoc}{
+	
+	\renewcommand*\l at part[2]{%
+		\ifnum \c at tocdepth >-2\relax
+		\addpenalty{-\@highpenalty}%
+		\addvspace{2.25em \@plus\p@}%
+		\begingroup
+		\parindent \z@ \rightskip \@pnumwidth
+		\parfillskip -\@pnumwidth
+		{\leavevmode
+			\large \bfseries ##1\hfil \hb at xt@\@pnumwidth{\hss ##2}}\par
+		\nobreak
+		\global\@nobreaktrue
+		\everypar{\global\@nobreakfalse\everypar{}}%
+		\endgroup
+		\fi}
+	
+	
+	\renewcommand*\l at chapter[2]{%
+		\ifnum \c at tocdepth >\m at ne
+		\addpenalty{-\@highpenalty}%
+		\vskip 1.0em \@plus\p@
+		\setlength\@tempdima{1.5em}%
+		\begingroup
+		\parindent \z@ \rightskip \@pnumwidth
+		\parfillskip -\@pnumwidth
+		\leavevmode \bfseries
+		\advance\leftskip\@tempdima
+		\hskip -\leftskip
+		##1\nobreak
+		\xleaders\hbox{$\m at th
+			\mkern \@dotsep mu\hbox{.}\mkern \@dotsep
+			mu$}\hfill%
+		\nobreak\hb at xt@\@pnumwidth{\hss ##2}\par
+		\penalty\@highpenalty
+		\endgroup
+		\fi}
+	}
+
 \RequirePackage{ifxetex}
 \ifxetex
 \RequirePackage{fontspec}
@@ -428,9 +832,9 @@
 
 
 
-%\setlength{\marginparwidth}{1.3in}
 
 
+
 % remove toc, list of figures and list of tables from table of contents
 % NEED TO TAKE CHAPTER NAME FROM TOC IN nochapterleft etc. options%%%
 %\renewcommand*\chapter at toc{%
@@ -453,9 +857,9 @@
 
 %%% para notas sempre à direita.
 %%%http://tex.stackexchange.com/questions/69595/marginnote-always-on-right-side-of-the-page
-\RequirePackage{etoolbox}
-\patchcmd{\@addmarginpar}{\ifodd\c at page}{\ifodd\c at page\@tempcnta\m at ne}{}{}
-\reversemarginpar
+%\RequirePackage{etoolbox}
+%\patchcmd{\@addmarginpar}{\ifodd\c at page}{\ifodd\c at page\@tempcnta\m at ne}{}{}
+%\reversemarginpar
 
 
 \frenchspacing
@@ -463,15 +867,15 @@
 
 	%%%% uso econômico de espaços%%%%
 	
-	\renewcommand\floatpagefraction{.99} % 9 before 
-	\renewcommand\dblfloatpagefraction{.99} % for two column documents
-	\renewcommand\topfraction{.99}
-	\renewcommand\dbltopfraction{.99} % for two column documents
-	\renewcommand\bottomfraction{.99}
-	\renewcommand\textfraction{.01}  %1 before 
-	\setcounter{totalnumber}{1} % 50 before
-	\setcounter{topnumber}{1}
-	\setcounter{bottomnumber}{1}
+	\renewcommand\floatpagefraction{.9}
+	\renewcommand\dblfloatpagefraction{.9} % for two column documents
+	\renewcommand\topfraction{.9}
+	\renewcommand\dbltopfraction{.9} % for two column documents
+	\renewcommand\bottomfraction{.9}
+	\renewcommand\textfraction{.1}   
+	\setcounter{totalnumber}{50}
+	\setcounter{topnumber}{50}
+	\setcounter{bottomnumber}{50}
 
 %\setcounter{totalnumber}{1}
 %\setcounter{topnumber}{1}
@@ -481,6 +885,27 @@
 %\renewcommand{\textfraction}{.01}
 
 
+%%%% margins in two-side 
+
+
+\if at marginparsused
+\setlength\marginparsep{1cc}
+\addtolength\oddsidemargin{-1cc}
+\addtolength\evensidemargin{5.5cc}
+\setlength{\marginparwidth}{1.3in}
+\setlength\marginparpush{.5\baselineskip}
+\else
+\setlength\marginparsep{0cc}
+\setlength\marginparwidth{0cc}
+\def\marginpar{\ClassError{mwcls}{Marginpars are disabled by
+		default in this class.\MessageBreak  Use `withmarginpar'
+		option to enable}{}\global\let\marginpar\@gobble}
+\fi
+
+
+
+
+
 %%%%%% TWO PAGE PICTURE %%%%%%%%
 %%%% from: http://tex.stackexchange.com/questions/23860/how-to-include-a-picture-over-two-pages-left-part-on-left-side-right-on-right
 %%% Thanks to Martin Scharrer
@@ -625,4 +1050,4 @@
 
 
 
-\endinput
\ No newline at end of file
+\endinput



More information about the tex-live-commits mailing list