Commit c192c4fc authored by Thomas Colcombet's avatar Thomas Colcombet
Browse files

Init with files.

parents
This diff is collapsed.
% \iffalse meta-comment
%
% Copyright (C) 2016 by Thomas Colcombet
% -----------------------------------
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2 % of this license or (at your option) any later version.
% The latest version of this license is in:
%
% http://www.latex-project.org/lppl.txt
%
% and version 1.2 or later is part of all distributions of LaTeX
% version 1999/12/01 or later.
%
% \fi
%
% \iffalse
%
%<*driver>
\documentclass{ltxdoc}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{paralist}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{knowledge-configuration.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
%
% \changes{v2.0}{2016/02/26}{Initial version} %
% \GetFileInfo{scopearticle.def} %
% \DoNotIndex{}
%
%
% \let\ifcode\iffalse
%
%
% \title{The \textsf{knowledge-configuration} part of the \textsf{knowledge} package}
% \author{Thomas Colcombet \\ \texttt{thomas.colcombet@irif.fr}}
% \date{\today}
% \maketitle
%
% \begin{abstract}
% Some code for configuring the scope option of the package knowledge.
% Essentially, it contains configurations for reconstructing the tree of the structure of the document. It is to be expanded when the use requires it.
%
% So far, it stands as a standalone file scopearticle.def. It should eventually be part of knowledge.sty, and be extra configurable (detect the style, and tries to automatically overload it).
% \end{abstract}
%
% \section{Introduction}
%
% This package is in fact part of the code used by \texttt{knowledge} when the scope option is activated.
% Its goal is to configure the hooks for the \texttt{article} class. It works also for similar classes.
%
% \StopEventually{\PrintIndex}
%
%
%
% This package patches the article class for making it compatible with
% the scope package. Essentially, it modifies all the structure and the commands
% that interact with the structure of an article, and weave into it the update of the
% scope structure.
%
%
% \section{Implementation}
%
% \subsection{Code preparation}
% \begin{macrocode}
\knowledge_begin_module_if:n\knowledge_option_scope_bool
% \end{macrocode}
%
% \section{Main structure}
%
% Note that the scopes \texttt{base}, \texttt{document}, \texttt{body} and \texttt{scope} are already configured in knowledge.sty.
%
% \subsection{Standard sectioning command}
%
%
% \begin{macrocode}
\scope_area_set:nn
{part, section,subsection,subsubsection,
paragraph,subparagraph,subsubparagraph}
{ category=structure,
autoclose = true,
occurrences = multiple,
knowledge=accepts
}
\scope_area_set:nn
{base,document,section,subsection,subsubsection,
paragraph,subparagraph,subsubparagraph}
{knowledge=accepts}
\scope_area_set:nn
{base,document}
{knowledge=attracts}
\scope_area_set:nn
{body}
{knowledge=none}
\scope_area_set:nn{part}{parents = {body}, forces = body }
\scope_area_set:nn{section}{parents = {body,part}, forces = body }
\scope_area_set:nn{subsection}{parents = section }
\scope_area_set:nn{subsubsection}{parents = subsection }
\scope_area_set:nn{paragraph}{parents = {document,section,subsection,subsubsection} }
\scope_area_set:nn{subparagraph}{parents = {paragraph} }
\scope_area_set:nn{subsubparagraph}{parents = {subparagraph} }
% \end{macrocode}
%
% \begin{macrocode}
\scope_area_set:nn{abstract}
{autoclose=false,
occurrences=once,
parents={body,structure},
forces=body,
knowledge=none
}
% \end{macrocode}
% \subsubsection{Overloading the commands}
%
% \begin{macrocode}
\OverloadCommand\section{som}
{\scope_area_push:n{section}
\XparseArgs\SUPERsection{som}{#1}{#2}{#3}}
\OverloadCommand\subsection{som}
{\scope_area_push:n{subsection}
\XparseArgs\SUPERsubsection{som}{#1}{#2}{#3}}
\OverloadCommand\subsubsection{som}
{\scope_area_push:n{subsubsection}
\XparseArgs\SUPERsubsubsection{som}{#1}{#2}{#3}}
\OverloadCommand\paragraph{som}
{\scope_area_push:n{paragraph}
\XparseArgs\SUPERparagraph{som}{#1}{#2}{#3}}
\OverloadCommand\subparagraph{som}
{\scope_area_push:n{subparagraph}
\XparseArgs\SUPERsubparagraph{som}{#1}{#2}{#3}}
\OverloadCommand\subsubparagraph{som}
{\scope_area_push:n{subsubparagraph}
\XparseArgs\SUPERsubsubparagraph{som}{#1}{#2}{#3}}
% \end{macrocode}
%
% \subsection{Creation of new environments}
%
%
%
% \begin{macrocode}
\KnowledgeConfigureEnvironment?
{theorem,lemma,proposition,fact,conjecture,problem}
{category=theorem-like,label=accepts}
\KnowledgeConfigureEnvironment?
{remark,proof}
{label=accepts,knowledge=accepts}
\KnowledgeConfigureEnvironment?
{center,flushleft,flushright,minipage,quotation,quote,verbatim,verse}
{knowledge=accepts,label=none}
% \end{macrocode}
%
% Command overloading...
% \begin{macrocode}
\OverloadCommand\newtheorem{m}
{\KnowledgeConfigureEnvironment!{#1}{category=theorem-like,label=accepts}
\SUPERnewtheorem{#1}}
\OverloadCommand\newenvironment{m}
{\KnowledgeConfigureEnvironment!{#1}{label=accepts}
\SUPERnewenvironment{#1}}
\OverloadCommand\NewDocumentEnvironment{m}
{\KnowledgeConfigureEnvironment!{#1}{label=none}
\SUPERNewDocumentEnvironment{#1}}
% \end{macrocode}
%
%
% \subsection{Upgrading scope}
%
% \subsection{Itemizing}
% The default code for \LaTeX{} is absolutely catastrophic.
% In particular, trivlist is used implicitly, making impossible to
% simply Overload the list environements.
% Indeed, some of environments (like theorems) use trivlists and |\item|
% for their internal display. However, one does not want this to be considered
% as a list. Futhremore, normal lists make call to the code of trivlist too.
% Thus we are in the situation in which trivlists have to be patched because otherwise
% items could not guarantee the structure.
% However, trivlist should not be treates as norm lists since these are fake lists used
% for displaying purposes. The below code tries to patch this as cleanly as possible in order
% to obtain a reasonable behaviour.
% \begin{macrocode}
\scope_area_set:nn
{itemize,enumerate,description}
{category=itemize-like}
% {knowledge=none}
\scope_area_set:nn{item}
{autoclose=true,
parents = itemize-like}
\OverloadCommand\item{o}
{%\scope_categoryseq_pop_to:n{itemize-like}
%\scope_category_if_area_in:nnTF{trivlist}\scope_top_area_tl
% {}
% {\scope_area_push:n{item}}
\XparseArgs\SUPERitem{o}{#1}}
%\OverloadCommand\trivlist{}
% {\scope_area_push:n{trivlist}
% \SUPERtrivlist}
%\OverloadCommand\endtrivlist{}{
% \SUPERendtrivlist
% \scope_categoryseq_pop_to:n{itemize-like}
% \exp_args:NV\tl_if_eq:nnTF\scope_top_area_tl{trivlist}
% {\scope_area_pop:n{trivlist}}{}}
% \end{macrocode}
% \subsubsection{Micro areas}
% \begin{macrocode}
\scope_area_set:nn{emph,textit,texttt,textbf}{
autoclose = false,
occurrences = multiple,
forces = body
}
% \end{macrocode}
%
%
% \begin{macrocode}
\knowledge_end_module:
% \end{macrocode}
% \Finale
This diff is collapsed.
%%
%% Copyright (C) 2017 by Thomas Colcombet
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.2 of this license or (at your option) any later
%% version. The latest version of this license is in:
%%
%% http://www.latex-project.org/lppl.txt
%%
%% and version 1.2 or later is part of all distributions of
%% LaTeX version 1999/12/01 or later.
%%
\input docstrip.tex
\keepsilent
\askforoverwritefalse
\preamble
This is a generated file. Copyright (C) 2017 by Thomas Colcombet
This file may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
version 1.2 of this license or (at your option) any later
version. The latest version of this license is in:
http://www.latex-project.org/lppl.txt
and version 1.2 or later is part of all distributions of
LaTeX version 1999/12/01 or later.
\endpreamble
\generate{%
\file{knowledge.sty}{%
\from{knowledge-code.dtx}{head}%
\from{knowledge-utils.dtx}{package}%
\from{knowledge-code.dtx}{package}%
\from{knowledge-configuration.dtx}{package}%
\from{knowledge-code.dtx}{tail}}%
}
\nopreamble\nopostamble
\def\MetaPrefix{}
\generate{%
\file{README.md}{
\usepreamble\empty
\usepostamble\empty%
\from{knowledge-code.dtx}{readme}%
}}%
\obeyspaces
\Msg{****************************************************}
\Msg{*}
\Msg{* To finish the installation you have to move the }
\Msg{* following file into a directory searched by TeX:}
\Msg{*}
\Msg{* knowledge.sty}
\Msg{*}
\Msg{* To produce the documentation run the file *}
\Msg{* knowledge.dtx through LaTeX.}
\Msg{*}
\Msg{****************************************************}
\endbatchfile
This diff is collapsed.
help:
@echo "This is the makefile for the knowledge package"
@echo "- all: produces knowledge.pdf knowledge.sty knowledge-code.pdf README.md"
@echo "- clean"
@echo "- knowledge.zip: a minimalistic install"
@echo "- ctan: creates the knowledge-ctan.zip file tailored for CTAN"
@echo "- sources: creates knowledge-sources-complete.zip"
@echo "- publish: personal use"
all: knowledge.sty knowledge.pdf knowledge-code.pdf README.md
knowledge.sty: knowledge-code.dtx knowledge-utils.dtx knowledge-configuration.dtx knowledge.ins
latex knowledge.ins
README.md: knowledge-code.dtx knowledge.ins
latex knowledge.ins
clean:
rm -f *.aux *.glo *.idx *.aux *.synctex.gz *.out *.toc *.kaux *.diagnose *.log
rm -f *.bbl *.out *.bbl *.ind *.ilg *.idx
rm -f knowledge.sty
rm -f knowledge-code.pdf
rm -f knowledge.pdf knowledge-utils.pdf knowledge-configuration.pdf knowledge-example.pdf
rm -f knowledge-sources-complete.zip knowledge.zip
rm -f knowledge-ctan.zip
rm -f README.md
make -CRegression clean
ctan: knowledge-ctan.zip
knowledge.pdf: knowledge.tex knowledge.sty
pdflatex knowledge.tex
pdflatex knowledge.tex
pdflatex knowledge.tex
knowledge-code.pdf: knowledge-code.dtx knowledge.tex knowledge.sty
pdflatex knowledge-code.dtx
pdflatex knowledge-code.dtx
pdflatex knowledge-code.dtx
knowledge.aux: knowledge.dtx knowledge.sty
pdflatex knowledge.dtx
sources: clean knowledge-ctan.zip knowledge-sources-complete.zip
knowledge-sources-complete.zip: clean
\rm -f knowledge-sources-complete.zip
zip knowledge-sources-complete.zip *.* makefile Regression/*
cp knowledge-sources-complete.zip ../knowledge-sources-complete-`date +%y-%m-%d_%H:%M`.zip
knowledge-ctan.zip: knowledge.pdf knowledge.sty knowledge.ins README.md makefile
rm -f knowledge-ctan.zip
rm -rf knowledge
mkdir knowledge
cp knowledge.pdf knowledge/
cp knowledge.tex knowledge/
cp knowledge-code.dtx knowledge-utils.dtx knowledge-configuration.dtx knowledge/
cp makefile knowledge.ins knowledge-example.tex README.md knowledge/
zip knowledge-ctan.zip knowledge/*
rm -rf knowledge
knowledge.zip: knowledge.pdf knowledge.sty knowledge-example.tex README.md
rm -f knowledge.zip
zip knowledge.zip knowledge.pdf knowledge.sty knowledge.example.tex
publish: knowledge.zip knowledge-ctan.zip
cp knowledge.pdf ~/Travail/Web/public_html/Knowledge/
cp knowledge.zip ~/Travail/Web/public_html/Knowledge/knowledge--lastversion.zip
cp knowledge.zip ~/Travail/Web/public_html/Knowledge/knowledge-`date +%Y-%m-%d`.zip
cp knowledge-ctan.zip ~/Travail/Web/public_html/Knowledge/knowledge-sources-`date +%Y-%m-%d`.zip
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment