|
Wikified by Carlos Rodriguez If you find a typo please fix it! (the magic word is “thelab”). This site is based on PmWiki. PmWiki is a wiki-based? system for collaborative creation and maintenance of websites. PmWiki pages look and act like normal web pages, except they have an “Edit” link that makes it easy to modify existing pages and add new pages into the website, using basic editing? rules. You do not need to know or use any HTML or CSS. Page editing can be left open to the public or restricted to small groups of authors. For more information look at DocumentationIndex. This site does LATEX
wfy: Perl script to help wikify Linearalgebra
#!/usr/bin/perl
# section and base number
$S = 1;
$X = 1;
while (<>)
{
# $..$ ==> {$..$}
s/\$([^\$]+)\$/{\$$1\$}/g;
# \begin{eq..} ==> \n=|[$ $$\n\begin{equation*}
s/(\\begin\{eq.+\})/\n=|[\$ \$\$\n$1/;
# \end{eq..} ==> \n=|[$ $$\n\end{equation*}
s/(\\end\{eq.+\})/$1\n\$\$ \$]\n/;
# \( ==> {$
s/\\\(/{\$/g;
# \) ==> $}
s/\\\)/\$}/g;
# \begin{definition} ===> "\n>>bgcolor=lightblue<<\n!!!! S.X Definition"
if (/\\begin{def.+}/) {
s/(\\begin{def.+})/\n>>bgcolor=lightblue<<\n!!!! $S.$X Definition/;
$X = $X + 1;
}
# \end{definition} ==> >><<
s/\\end{definition}/>><<\n/;
# \begin{example} ===> !!!! X.X Example
if (/\\begin{example}/) {
s/(\\begin{example})/\n!!!! $S.$X Example/;
++$X;
}
# \end{example} ==> \n
s/\\end{example}/\n/;
# \begin{theorem} ==> "\n>>bgcolor=lightblue<<\n!!!! X.X Theorem"
if (/\\begin{theorem}/) {
s/(\\begin{theorem})/\n>>bgcolor=lightblue<<\n!!!! $S.$X Theorem/;
++$X;
}
# \end{theorem} ==> >><<
s/\\end{theorem}/>><<\n/;
# \begin{lemma} ==> !!!! x.x Lemma
if (/\\begin{lemma}/) {
s/\\begin{lemma}/\n!!!! $S.$X Lemma/;
++$X;
}
# \end{lemma} ==> \n
s/\\end{lemma}/\n/;
# \begin{remark} ==> !!!! x.x Remark
if (/\\begin{remark}/) {
s/\\begin{remark}/\n!!!! $S.$X Remark/;
++$X;
}
# \end{remark} ==> \n
s/\\end{remark}/\n/;
# \begin{proof} ==> !!!!! PROOF:
s/\\begin{proof}/\n!!!!! PROOF:\n/;
# \end{proof} ==> '''''QED'''''
s/\\end{proof}/'''''QED'''''/;
# \vec{u} ==> \vec{ $u$ }
s/\\vec{u}/\\vec{ \$u\$ }/g;
# \vec{a} ==> \vec{ $a$ }
s/\\vec{a}/\\vec{ \$a\$ }/g;
# \Dash ==> --
s/\\Dash/--/g;
# \label{abc} ==> [[#abc]]
s/\\label{(.+?)}/[[#$1]]/;
# \nearbyxxx{abc} ==> [[#abc | nearbyxxx]]
s/\\nearby(.+?){(.+?)}/[[#$2 | nearby$1]]/;
# \begin{align*} ==> \n=|[$ $$\n\begin{align*}
s/(\\begin{ali.+})/\n=|[\$ \$\$\n$1/;
# \end{ali.} ==> \end{ali.}\n$ $$]\n
s/(\\end{ali.+})/$1\n\$\$ \$]\n/;
# \begin{multl.} ==> \n=|[$ $$\n\begin{multl.}
s/(\\begin{multl.+})/\n=|[\$ \$\$\n$1/;
# \end{multl.} ==> \end{multl.}\n$ $$]\n
s/(\\end{multl.+})/$1\n\$\$ \$]\n/;
# \index{...} ==>
s/\\index{.+}/ /;
# \noindent ==>
s/\\noindent//;
# \begin{corollary} ==> !!!! x.x Corollary
if (/\\begin{corollary}/) {
s/\\begin{corollary}/\n!!!! $S.$X Corollary/;
++$X;
}
# \end{corollary} ==> \n
s/\\end{corollary}/\n/;
# \includegraphics{ch1.1} ==> =|Attach:ch1.1.png
s/^.*\\includegraphics{(ch.+)}/=|Attach:$1.png/;
# \index{...} ==>
s/\\index{.+}//g;
# \definend{...}\index{..} ==> ''...''
s/\\definend{(.+)}/''$1''/;
# ` ==> '
s/`/'/g;
# ~ ==>
s/~/ /g;
# \Dash ==> --
s/\\Dash/--/g;
# \/ ==>
s/\\\///g;
print;
}
wex: Perl Script to wikify Exercises
#!/usr/bin/perl
# Chapter, Section, Subsection, Number
$C = "Three";
$S = "VII";
$B = 4;
$N = 1;
$M = "Markov Chains";
$CSB = "$C.$S.$B";
$abc = "a";
while (<>)
{
# \begin{answer}...\end{answer} ==> delete
if (/\\begin{answer}/) {
while(!/\\end{answer}/) {
$_ = <>;
}
$_ = <>;
}
# \begin{exercises} ==> !Exercises: C.S.B M
s/\\begin{exercises}/(:title Exercises $CSB --- $M:)\nColor codes: %red%recommended%%, %blue%basic%%, %purple%puzzle%%\n/;
# \end{exercises} ==>
s/\\end{exercises}//;
# \recommended \item ==> red
if (/\\recommended\s?\\item/) {
s/^.*\\recommended\s?\\item/* %red%$CSB%%.$N /;
++$N;
}
# \puzzle \item ==> purple
if (/\\puzzle\s?\\item/) {
s/^.*\\puzzle\s?\\item/*.%purple%$CSB%%.$N /;
++$N;
}
# \item ==> blue
if (/\\item/) {
s/^.*\\item/* %blue%$CSB%%.$N /;
++$N;
}
# $..$ ==> {$..$}
s/\$([^\$]+)\$/{\$$1\$}/g;
# \begin{exparts*} ==> re-start $abc
if (/\\begin{ex.+}/) {
$abc = "a";
s/(\\begin\{exp.+\})//;
}
# \end{exparts*} ==>
s/\\end{exp.+}/ /;
# \partsitem ==> **(a)
if (/\\partsitem/) {
s/^.*\\partsitem(.*)/**($abc)$1/;
++$abc;
}
# \begin{linsys} ==> \n=|[$ $$\n\begin{linsys}...
s/[\$]?(\\begin{linsy.+)/\n=|[\$ \$\$\n$1/;
# \end{linsys} ==> \n$$ $]\n
s/(\\end\{linsys\}).*/$1\n\$\$ \$]\n/;
# \end{exp..} ==> \n=|[$ $$\n\end{exp..}
s/(\\end\{exp.+\})/$1\n\$\$ \$]\n/;
# \begin{eq..} ==> \n=|[$ $$\n\begin{equation*}
s/(\\begin\{eq.+\})/\n=|[\$ \$\$\n$1/;
# \end{eq..} ==> \n=|[$ $$\n\end{equation*}
s/(\\end\{eq.+\})/$1\n\$\$ \$]\n/;
# \( ==> {$
s/\\\(/{\$/g;
# \) ==> $}
s/\\\)/\$}/g;
# \vec{u} ==> \vec{ $u$ }
s/\\vec{u}/\\vec{ \$u\$ }/g;
# \vec{a} ==> \vec{ $a$ }
s/\\vec{a}/\\vec{ \$a\$ }/g;
# \Dash ==> --
s/\\Dash/--/g;
# \begin{align*} ==> \n=|[$ $$\n\begin{align*}
s/(\\begin{ali.+?})/\n=|[\$ \$\$\n$1/;
# \end{ali.} ==> \end{ali.}\n$ $$]\n
s/(\\end{ali.+?})/$1\n\$\$ \$]\n/;
# \begin{multl.} ==> \n=|[$ $$\n\begin{multl.}
s/(\\begin{multl.+?})/\n=|[\$ \$\$\n$1/;
# \end{multl.} ==> \end{multl.}\n$ $$]\n
s/(\\end{multl.+})/$1\n\$\$ \$]\n/;
# \index{...} ==>
s/\\index{.+?}/ /;
# \definend{...} ==> ''...''
s/\\definend{(.+?)}/''$1''/;
# \noindent ==>
s/\\noindent//;
# ` ==> '
s/`/'/g;
# ~ ==>
s/~/ /g;
# \Dash ==> --
s/\\Dash/--/g;
# \/ ==>
s/\\\///g;
# \label{abc} ==> [[#abc]]
s/\\label{(.+?)}/[[#$1]]/;
# \nearbyxxx{abc} ==> [[#abc | nearbyxxx]]
s/\\nearby(.+?){(.+?)}/[[#$2 | nearby$1]]/;
# \includegraphics{ch1.1} ==> =|Attach:ch1.1.png
s/^.*\\includegraphics{(ch.+?)}/=|Attach:$1.png/;
print;
}
wnum: Perl Script to renumber exercises
#!/usr/bin/perl
$N = 1;
while(<>) {
if (/[IV]+.[0-9]+%%\.[0-9]+/){
s/([IV]+.[0-9]+%%\.)[0-9]+/$1$N/;
++$N;
}
print;
}
‘macros.el’‘: Elisp macros
;; grb next link
(fset 'grab
[?\C-s ?C ?H ?\C-b ?\C-b ?\C- ?\C-e escape ?w])
;; put TOC trail at the end of the current buffer
(fset 'trail
[escape ?> return return ?% ?t ?r ?a ?i ?l ?% ?< ?< ?| ?W ?i ?k ?i ?p ?u ?b ?l ?i ?s ?h ?e ?r ?/ ?T ?a ?b ?l ?e ?O ?f ?C ?o ?n ?t ?e ?n ?t ?s ?| ?> ?> ?\C-c ?\C-c ?\C-x ?k return])
;; wikify linearalgebra region
(fset 'wfy
[?\C-u escape ?| ?~ ?/ ?w ?f ?y return])
;; wikify exercises region
(fset 'wex
[?\C-u escape ?| ?~ ?/ ?w ?E ?x return])
;; need to change the CHAPTER3.OrthogonalProjectionIntoALine for what you want
(fset 'nearbyexample
"\C-snearbyexample\C-b\C-r[[\C-f\C-fCHAPTER3.OrthogonalProjectionIntoALine\C-e")
;; need to change the CHAPTER3.OrthogonalProjectionIntoALine for what you want
(fset 'nearbylemma
"\C-snearbylemma\C-b\C-r[[\C-f\C-fCHAPTER3.OrthogonalProjectionIntoALine\C-e")
;; need to change the CHAPTER3.OrthogonalProjectionIntoALine for what you want
(fset 'nearbytheorem
"\C-snearbytheorem\C-b\C-r[[\C-f\C-fCHAPTER3.OrthogonalProjectionIntoALine\C-e")
;; need to change the CHAPTER3.OrthogonalProjectionIntoALine for what you want
(fset 'nearbyexercise
"\C-snearbyexercise\C-b\C-r[[\C-f\C-fCHAPTER3.OrthogonalProjectionIntoALine\C-e")
;; need to change the CHAPTER3.OrthogonalProjectionIntoALine for what you want
(fset 'nearbycorollary
"\C-snearbycorollary\C-b\C-r[[\C-f\C-fCHAPTER3.OrthogonalProjectionIntoALine\C-e")
;; need to change the CHAPTER3.OrthogonalProjectionIntoALine for what you want
(fset 'nearbydefinition
"\C-snearbydefinition\C-b\C-r[[\C-f\C-fCHAPTER3.OrthogonalProjectionIntoALine\C-e")
;; run C-u 100 M-x dollar then this function that runs all the others
(fset 'r011
[escape ?x ?e ?q ?* return escape ?x ?e ?q ?* ?e return escape ?x ?e ?q ?n ?* return escape ?x ?e ?q ?n ?* ?e return escape ?x ?r ?1 return escape ?x ?r ?2 return escape ?x ?r ?3 return escape ?x ?r ?4 return escape ?x ?r ?5 return escape ?x ?r ?6 return escape ?x ?r ?7 return escape ?x ?r ?8 return escape ?x ?r ?9 return escape ?x ?r ?1 ?0 return escape ?x ?r ?1 ?1 return])
;; $..$ ==> {$..$} (but one at a time!!)
(fset 'dollar
[?\C-s ?$ ?\C-b ?\C- ?\C-s ?\C-s ?\C-s ?\C-b ?\C-f ?\C-w ?{ ?\C-y ?}])
;; $..$ ==> {$..$}
(fset 'rdollar
[escape ?x ?q ?u ?e tab ?- ?r tab return ?\\ ?$ ?\\ ?( ?[ ?^ ?\\ ?$ ?] ?+ ?\\ ?) ?\\ ?$ return ?{ ?$ ?\\ ?1 ?$ ?} return ?! ?\C-x ?\C-x])
;; \begin{eqnarray*} ==> \n=|[$ $$ \begin{eqnarray*}
(fset 'eqn*
[escape ?\C-% ?\\ ?\\ ?b ?e ?g ?i ?n ?{ ?e ?q ?n ?a ?r ?r ?a ?y ?\\ ?* ?} return ?\\ ?, ?\" ?\\ ?n ?= ?| ?[ ?$ ? ?$ ?$ ? ?\\ ?\\ ?b ?e ?g ?i ?n ?{ ?e ?q ?n ?a ?r ?r ?a ?y ?* ?} ?\" return ?! ?\C-x ?\C-x])
;; \end{eqnarray*} ==> \end{eqnarray*} $$ $]\n
(fset 'eqn*e
[escape ?\C-% ?\\ ?\\ ?e ?n ?d ?{ ?e ?q ?n ?a ?r ?r ?a ?y ?\\ ?* ?} return ?\\ ?, ?\" ?\\ ?\\ ?e ?n ?d ?{ ?e ?q ?n ?a ?r ?r ?a ?y ?* ?} ? ?$ ?$ ? ?$ ?] ?\\ ?n ?\" return ?! ?\C-x ?\C-x])
;; \begin{equation*} ==> =|[$ $$ \begin{equation*}
(fset 'eq*
[escape ?% ?\\ ?b ?e ?g ?i ?n ?{ ?e ?q ?u ?a ?t ?i ?o ?n ?* ?} return ?= ?| ?[ ?$ ? ?$ ?$ ? ?\\ ?b ?e ?g ?i ?n ?{ ?e ?q ?u ?a ?t ?i ?o ?n ?* ?} return ?! ?\C-x ?\C-x])
;; \end{equation*} ==> \end{equation*} $$ $]
(fset 'eq*e
[escape ?% ?\\ ?e ?n ?d ?{ ?e ?q ?u ?a ?t ?i ?o ?n ?* ?} return ?\\ ?e ?n ?d ?{ ?e ?q ?u ?a ?t ?i ?o ?n ?* ?} ? ?$ ?$ ? ?$ ?] return ?! ?\C-x ?\C-x])
;; \( ... \) ===> {$ ... $}
(fset 'r1
[escape ?% ?\\ ?( return ?{ ?$ return ?! ?\C-x ?\C-x escape ?% ?\\ ?) return ?$ ?} return ?! ?\C-x ?\C-x])
;; \begin{definition} ===> ">>bgcolor=lightblue<<\n!!!! X.X Definition"
(fset 'r2
[escape ?\C-% ?\\ ?\\ ?b ?e ?g ?i ?n ?{ ?d ?e ?f ?i ?n ?i ?t ?i ?o ?n ?} return ?\\ ?, ?\" ?> ?> ?b ?g ?c ?o ?l ?o ?r ?= ?l ?i ?g ?h ?t ?b ?l ?u ?e ?< ?< ?\\ ?n ?! ?! ?! ?! ? ?X ?. ?X ? ?D ?e ?f ?i ?n ?i ?t ?i ?o ?n ?\" return ?y ?\C-x ?\C-x])
;; \end{definition} ===> >><<
(fset 'r3
[escape ?% ?\\ ?e ?n ?d ?{ ?d ?e ?f ?i ?n ?i ?t ?i ?o ?n ?} return ?> ?> ?< ?< return ?! ?\C-x ?\C-x])
;; \begin{example} ===> !!!! 2.3 Example
(fset 'r4
[escape ?% ?\\ ?b ?e ?g ?i ?n ?{ ?e ?x ?a ?m ?p ?l ?e ?} return ?! ?! ?! ?! ? ?2 ?. ?5 ? ?E ?x ?a ?m ?p ?l ?e return ?! ?\C-x ?\C-x])
;; \end{example} ===>
(fset 'r5
[escape ?% ?\\ ?e ?n ?d ?{ ?e ?x ?a ?m ?p ?l ?e ?} return return ?! ?\C-x ?\C-x])
;; \begin{theorem} ==> ">>bgcolor=lightblue<<\n!!!! X.X Theorem"
(fset 'r6
[escape ?\C-% ?\\ ?\\ ?b ?e ?g ?i ?n ?{ ?t ?h ?e ?o ?r ?e ?m ?} return ?\\ ?, ?\" ?> ?> ?b ?g ?c ?o ?l ?o ?r ?= ?l ?i ?g ?h ?t ?b ?l ?u ?e ?< ?< ?\\ ?n ?! ?! ?! ?! ? ?X ?. ?X ? ?T ?h ?e ?o ?r ?e ?m ?\" return ?! ?\C-x ?\C-x])
;;\end{theorem} ==> >><<
(fset 'r7
[escape ?% ?\\ ?e ?n ?d ?{ ?t ?h ?e ?o ?r ?e ?m ?} return ?> ?> ?< ?< return ?! ?\C-x ?\C-x])
;; \begin{lemma} ==> !!!! x.x Lemma
(fset 'r8
[escape ?% ?\\ ?b ?e ?g ?i ?n ?{ ?l ?e ?m ?m ?a ?} return ?! ?! ?! ?! ? ?X ?. ?X ? ?L ?e ?m ?m ?a return ?! ?\C-x ?\C-x])
;; \end{lemma} ==>
(fset 'r9
[escape ?% ?\\ ?e ?n ?d ?{ ?l ?e ?m ?m ?a ?} return return ?! ?\C-x ?\C-x])
;; \begin{proof} ==> !!!!! PROOF:
(fset 'r10
[escape ?% ?\\ ?b ?e ?g ?i ?n ?{ ?p ?r ?o ?o ?f ?} return ?! ?! ?! ?! ?! ? ?P ?R ?O ?O ?F ?: ? return ?! ?\C-x ?\C-x])
;; \end{proof} ==> {$\diamond$}
(fset 'r11
[escape ?% ?\\ ?e ?n ?d ?{ ?p ?r ?o ?o ?f ?} return ?{ ?$ ?\\ ?d ?i ?a ?m ?o ?n ?d ?$ ?} return ?! ?\C-x ?\C-x])
|