11 maggio 2014

Ricerca manuali pacchetti LaTex

Dopo una lunga assenza, ecco l'occasione che mi fa scrivere questo post: velocizzare la consultazione della documentazione LaTex all'interno di emacs.

 Per scrivere il seguente codice elisp ho consultato http://www.gnu.org/software/emacs/manual/html_node/elisp/Association-Lists.html e mi solo lasciato ispirare da letture varie (anche se non strettamente collegate al lavoro da svolgere) come http://ergoemacs.org/emacs/elisp_list_vector.html. Ho anche consultato il manuale di AWK e quello di ls.

In sostanza: dopo l'istallazione di pacchetti LaTex, e relativa documentazione (anche in pdf! In totale diversi Mb di files) è necessario cercare a mano il file che contiene la documentazione di ciascun pacchetto. Fino a poco tempo fa ritenevo il metodo più veloce essere la ricerca sul sito ctan.org, ma poi mi sono chiesto: se ho già scaricato tutti i manuali in pdf, perché devo ri-cercarli e ri-scaricarli ogni volta?

Visto che utilizzo spessisso emacs per scrivere in LaTex (aiutato dal meraviglioso minor mode CDLaTex) ho deciso di scrivere implementare la ricerca e la visualizzazione direttamente all'interno di questo potente editor.

;;;
;;Elenco ricavato con il comando:
;;
;;$ sudo find /usr/share/doc/texlive-doc/latex -type f | xargs ls -al  | \\
;;awk -v pwd="$PWD"  '{ split($(NF),array,"\/"); a=substr(array[8],;;1,match(array[8],/.pdf/)-1); print "(\"" a "\" . \"/" substr($(NF), 2) "\")" }' | grep pdf\"\)$
;;
;;
;;ho cercato i file con find, per ciascuno (grazie ad xargs) ho estratto nome e path grazie ad awk
;;;


(setq dictionary '(

;; (amsbooka . "/usr/share/doc/texlive-doc/latex/amscls/amsbooka.pdf")
;; (amsclass . "/usr/share/doc/texlive-doc/latex/amscls/amsclass.pdf")
;; (amsdtx . "/usr/share/doc/texlive-doc/latex/amscls/amsdtx.pdf")
;; (amsmidx . "/usr/share/doc/texlive-doc/latex/amscls/amsmidx.pdf")
;; (amsthdoc . "/usr/share/doc/texlive-doc/latex/amscls/amsthdoc.pdf")
;; (instr-l . "/usr/share/doc/texlive-doc/latex/amscls/instr-l.pdf")
;; (thmtest . "/usr/share/doc/texlive-doc/latex/amscls/thmtest.pdf")
;; (upref . "/usr/share/doc/texlive-doc/latex/amscls/upref.pdf")
;; (amsbsy . "/usr/share/doc/texlive-doc/latex/amsmath/amsbsy.pdf")
;; (amscd . "/usr/share/doc/texlive-doc/latex/amsmath/amscd.pdf")
;; (amsgen . "/usr/share/doc/texlive-doc/latex/amsmath/amsgen.pdf")
;; (amsldoc . "/usr/share/doc/texlive-doc/latex/amsmath/amsldoc.pdf")
;; (amsmath . "/usr/share/doc/texlive-doc/latex/amsmath/amsmath.pdf")
;; (amsopn . "/usr/share/doc/texlive-doc/latex/amsmath/amsopn.pdf")
;; (amstext . "/usr/share/doc/texlive-doc/latex/amsmath/amstext.pdf")
;; (amsxtra . "/usr/share/doc/texlive-doc/latex/amsmath/amsxtra.pdf")
;; (subeqn . "/usr/share/doc/texlive-doc/latex/amsmath/subeqn.pdf")
;; (technote . "/usr/share/doc/texlive-doc/latex/amsmath/technote.pdf")
;; (testmath . "/usr/share/doc/texlive-doc/latex/amsmath/testmath.pdf")
;; (babel . "/usr/share/doc/texlive-doc/latex/babel/babel.pdf")
;; (alltt . "/usr/share/doc/texlive-doc/latex/base/alltt.pdf")
;; (cfgguide . "/usr/share/doc/texlive-doc/latex/base/cfgguide.pdf")
;; (classes . "/usr/share/doc/texlive-doc/latex/base/classes.pdf")
;; (clsguide . "/usr/share/doc/texlive-doc/latex/base/clsguide.pdf")
;; (cmfonts . "/usr/share/doc/texlive-doc/latex/base/cmfonts.pdf")
;; (cyrguide . "/usr/share/doc/texlive-doc/latex/base/cyrguide.pdf")
;; (doc . "/usr/share/doc/texlive-doc/latex/base/doc.pdf")
;; (docstrip . "/usr/share/doc/texlive-doc/latex/base/docstrip.pdf")
;; (encguide . "/usr/share/doc/texlive-doc/latex/base/encguide.pdf")
;; (exscale . "/usr/share/doc/texlive-doc/latex/base/exscale.pdf")
;; (fixltx2e . "/usr/share/doc/texlive-doc/latex/base/fixltx2e.pdf")
;; (fntguide . "/usr/share/doc/texlive-doc/latex/base/fntguide.pdf")
;; (graphpap . "/usr/share/doc/texlive-doc/latex/base/graphpap.pdf")
;; (ifthen . "/usr/share/doc/texlive-doc/latex/base/ifthen.pdf")
;; (inputenc . "/usr/share/doc/texlive-doc/latex/base/inputenc.pdf")
;; (latex209 . "/usr/share/doc/texlive-doc/latex/base/latex209.pdf")
;; (latexsym . "/usr/share/doc/texlive-doc/latex/base/latexsym.pdf")
;; (lb2 . "/usr/share/doc/texlive-doc/latex/base/lb2.pdf")
;; (letter . "/usr/share/doc/texlive-doc/latex/base/letter.pdf")
;; (lgc2 . "/usr/share/doc/texlive-doc/latex/base/lgc2.pdf")
;; (lppl . "/usr/share/doc/texlive-doc/latex/base/lppl.pdf")
;; (ltnews . "/usr/share/doc/texlive-doc/latex/base/ltnews.pdf")
;; (ltx3info . "/usr/share/doc/texlive-doc/latex/base/ltx3info.pdf")
;; (ltxcheck . "/usr/share/doc/texlive-doc/latex/base/ltxcheck.pdf")
;; (ltxdoc . "/usr/share/doc/texlive-doc/latex/base/ltxdoc.pdf")
;; (makeindx . "/usr/share/doc/texlive-doc/latex/base/makeindx.pdf")
;; (manual . "/usr/share/doc/texlive-doc/latex/base/manual.pdf")
;; (modguide . "/usr/share/doc/texlive-doc/latex/base/modguide.pdf")
;; (newlfont . "/usr/share/doc/texlive-doc/latex/base/newlfont.pdf")
;; (oldlfont . "/usr/share/doc/texlive-doc/latex/base/oldlfont.pdf")
;; (proc . "/usr/share/doc/texlive-doc/latex/base/proc.pdf")
;; (slides . "/usr/share/doc/texlive-doc/latex/base/slides.pdf")
;; (slifonts . "/usr/share/doc/texlive-doc/latex/base/slifonts.pdf")
;; (source2e . "/usr/share/doc/texlive-doc/latex/base/source2e.pdf")
;; (syntonly . "/usr/share/doc/texlive-doc/latex/base/syntonly.pdf")
;; (tlc2 . "/usr/share/doc/texlive-doc/latex/base/tlc2.pdf")
;; (usrguide . "/usr/share/doc/texlive-doc/latex/base/usrguide.pdf")
;; (utf8ienc . "/usr/share/doc/texlive-doc/latex/base/utf8ienc.pdf")
;; (webcomp . "/usr/share/doc/texlive-doc/latex/base/webcomp.pdf")
;; (ltxtable . "/usr/share/doc/texlive-doc/latex/carlisle/ltxtable.pdf")
;; (colortbl-DE . "/usr/share/doc/texlive-doc/latex/colortbl/colortbl-DE.pdf")
;; (colortbl . "/usr/share/doc/texlive-doc/latex/colortbl/colortbl.pdf")
;; (fancyhdr . "/usr/share/doc/texlive-doc/latex/fancyhdr/fancyhdr.pdf")
;; (fix2col . "/usr/share/doc/texlive-doc/latex/fix2col/fix2col.pdf")
;; (geometry . "/usr/share/doc/texlive-doc/latex/geometry/geometry.pdf")
;; (color . "/usr/share/doc/texlive-doc/latex/graphics/color.pdf")
;; (drivers . "/usr/share/doc/texlive-doc/latex/graphics/drivers.pdf")
;; (epsfig . "/usr/share/doc/texlive-doc/latex/graphics/epsfig.pdf")
;; (graphics . "/usr/share/doc/texlive-doc/latex/graphics/graphics.pdf")
;; (graphicx . "/usr/share/doc/texlive-doc/latex/graphics/graphicx.pdf")
;; (grfguide . "/usr/share/doc/texlive-doc/latex/graphics/grfguide.pdf")
;; (keyval . "/usr/share/doc/texlive-doc/latex/graphics/keyval.pdf")
;; (lscape . "/usr/share/doc/texlive-doc/latex/graphics/lscape.pdf")
;; (trig . "/usr/share/doc/texlive-doc/latex/graphics/trig.pdf")
;; (backref . "/usr/share/doc/texlive-doc/latex/hyperref/backref.pdf")
;; (hyperref . "/usr/share/doc/texlive-doc/latex/hyperref/hyperref.pdf")
;; (manual . "/usr/share/doc/texlive-doc/latex/hyperref/manual.pdf")
;; (nameref . "/usr/share/doc/texlive-doc/latex/hyperref/nameref.pdf")
;; (options . "/usr/share/doc/texlive-doc/latex/hyperref/options.pdf")
;; (paper . "/usr/share/doc/texlive-doc/latex/hyperref/paper.pdf")
;; (README . "/usr/share/doc/texlive-doc/latex/hyperref/README.pdf")
;; (slides . "/usr/share/doc/texlive-doc/latex/hyperref/slides.pdf")
;; (mflogo . "/usr/share/doc/texlive-doc/latex/mflogo/mflogo.pdf")
;; (oldgerm . "/usr/share/doc/texlive-doc/latex/mfnfss/oldgerm.pdf")
;; (natbib . "/usr/share/doc/texlive-doc/latex/natbib/natbib.pdf")
;; (natnotes . "/usr/share/doc/texlive-doc/latex/natbib/natnotes.pdf")
;; (accsupp . "/usr/share/doc/texlive-doc/latex/oberdiek/accsupp.pdf")
;; (aliascnt . "/usr/share/doc/texlive-doc/latex/oberdiek/aliascnt.pdf")
;; (alphalph . "/usr/share/doc/texlive-doc/latex/oberdiek/alphalph.pdf")
;; (askinclude . "/usr/share/doc/texlive-doc/latex/oberdiek/askinclude.pdf")
;; (atbegshi . "/usr/share/doc/texlive-doc/latex/oberdiek/atbegshi.pdf")
;; (atenddvi . "/usr/share/doc/texlive-doc/latex/oberdiek/atenddvi.pdf")
;; (attachfile2 . "/usr/share/doc/texlive-doc/latex/oberdiek/attachfile2.pdf")
;; (atveryend . "/usr/share/doc/texlive-doc/latex/oberdiek/atveryend.pdf")
;; (auxhook . "/usr/share/doc/texlive-doc/latex/oberdiek/auxhook.pdf")
;; (bigintcalc . "/usr/share/doc/texlive-doc/latex/oberdiek/bigintcalc.pdf")
;; (bitset . "/usr/share/doc/texlive-doc/latex/oberdiek/bitset.pdf")
;; (bmpsize . "/usr/share/doc/texlive-doc/latex/oberdiek/bmpsize.pdf")
;; (bookmark . "/usr/share/doc/texlive-doc/latex/oberdiek/bookmark.pdf")
;; (catchfile . "/usr/share/doc/texlive-doc/latex/oberdiek/catchfile.pdf")
;; (centernot . "/usr/share/doc/texlive-doc/latex/oberdiek/centernot.pdf")
;; (chemarr . "/usr/share/doc/texlive-doc/latex/oberdiek/chemarr.pdf")
;; (classlist . "/usr/share/doc/texlive-doc/latex/oberdiek/classlist.pdf")
;; (colonequals . "/usr/share/doc/texlive-doc/latex/oberdiek/colonequals.pdf")
;; (dvipscol . "/usr/share/doc/texlive-doc/latex/oberdiek/dvipscol.pdf")
;; (embedfile . "/usr/share/doc/texlive-doc/latex/oberdiek/embedfile.pdf")
;; (engord . "/usr/share/doc/texlive-doc/latex/oberdiek/engord.pdf")
;; (enparen . "/usr/share/doc/texlive-doc/latex/oberdiek/enparen.pdf")
;; (eolgrab . "/usr/share/doc/texlive-doc/latex/oberdiek/eolgrab.pdf")
;; (epst . "/usr/share/doc/texlive-doc/latex/oberdiek/epstopdf.pdf")
;; (etexcmds . "/usr/share/doc/texlive-doc/latex/oberdiek/etexcmds.pdf")
;; (fibnum . "/usr/share/doc/texlive-doc/latex/oberdiek/fibnum.pdf")
;; (flags . "/usr/share/doc/texlive-doc/latex/oberdiek/flags.pdf")
;; (gettitlestring . "/usr/share/doc/texlive-doc/latex/oberdiek/gettitlestring.pdf")
;; (grfext . "/usr/share/doc/texlive-doc/latex/oberdiek/grfext.pdf")
;; (grffile . "/usr/share/doc/texlive-doc/latex/oberdiek/grffile.pdf")
;; (hobsub . "/usr/share/doc/texlive-doc/latex/oberdiek/hobsub.pdf")
;; (hologo . "/usr/share/doc/texlive-doc/latex/oberdiek/hologo.pdf")
;; (holtxdoc . "/usr/share/doc/texlive-doc/latex/oberdiek/holtxdoc.pdf")
;; (hopatch . "/usr/share/doc/texlive-doc/latex/oberdiek/hopatch.pdf")
;; (hycolor . "/usr/share/doc/texlive-doc/latex/oberdiek/hycolor.pdf")
;; (hypbmsec . "/usr/share/doc/texlive-doc/latex/oberdiek/hypbmsec.pdf")
;; (hypcap . "/usr/share/doc/texlive-doc/latex/oberdiek/hypcap.pdf")
;; (hypdestopt . "/usr/share/doc/texlive-doc/latex/oberdiek/hypdestopt.pdf")
;; (hypdoc . "/usr/share/doc/texlive-doc/latex/oberdiek/hypdoc.pdf")
;; (hypgotoe . "/usr/share/doc/texlive-doc/latex/oberdiek/hypgotoe.pdf")
;; (hyphsubst . "/usr/share/doc/texlive-doc/latex/oberdiek/hyphsubst.pdf")
;; (ifdraft . "/usr/share/doc/texlive-doc/latex/oberdiek/ifdraft.pdf")
;; (iflang . "/usr/share/doc/texlive-doc/latex/oberdiek/iflang.pdf")
;; (ifluatex . "/usr/share/doc/texlive-doc/latex/oberdiek/ifluatex.pdf")
;; (i . "/usr/share/doc/texlive-doc/latex/oberdiek/ifpdf.pdf")
;; (ifvtex . "/usr/share/doc/texlive-doc/latex/oberdiek/ifvtex.pdf")
;; (infwarerr . "/usr/share/doc/texlive-doc/latex/oberdiek/infwarerr.pdf")
;; (inputenx . "/usr/share/doc/texlive-doc/latex/oberdiek/inputenx.pdf")
;; (intcalc . "/usr/share/doc/texlive-doc/latex/oberdiek/intcalc.pdf")
;; (kvdefinekeys . "/usr/share/doc/texlive-doc/latex/oberdiek/kvdefinekeys.pdf")
;; (kvoptions . "/usr/share/doc/texlive-doc/latex/oberdiek/kvoptions.pdf")
;; (kvsetkeys . "/usr/share/doc/texlive-doc/latex/oberdiek/kvsetkeys.pdf")
;; (letltxmacro . "/usr/share/doc/texlive-doc/latex/oberdiek/letltxmacro.pdf")
;; (listingsutf8 . "/usr/share/doc/texlive-doc/latex/oberdiek/listingsutf8.pdf")
;; (ltxcmds . "/usr/share/doc/texlive-doc/latex/oberdiek/ltxcmds.pdf")
;; (luacolor . "/usr/share/doc/texlive-doc/latex/oberdiek/luacolor.pdf")
;; (luatex . "/usr/share/doc/texlive-doc/latex/oberdiek/luatex.pdf")
;; (magicnum . "/usr/share/doc/texlive-doc/latex/oberdiek/magicnum.pdf")
;; (makerobust . "/usr/share/doc/texlive-doc/latex/oberdiek/makerobust.pdf")
;; (mleftright . "/usr/share/doc/texlive-doc/latex/oberdiek/mleftright.pdf")
;; (oberdiek . "/usr/share/doc/texlive-doc/latex/oberdiek/oberdiek.pdf")
;; (pagegrid . "/usr/share/doc/texlive-doc/latex/oberdiek/pagegrid.pdf")
;; (pagesel . "/usr/share/doc/texlive-doc/latex/oberdiek/pagesel.pdf")
;; (pdfcolfoot . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfcolfoot.pdf")
;; (pdfcolmk . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfcolmk.pdf")
;; (pdfcolparallel . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfcolparallel.pdf")
;; (pdfcolparcolumns . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfcolparcolumns.pdf")
;; (pdfcol . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfcol.pdf")
;; (pdfcrypt . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfcrypt.pdf")
;; (pdfescape . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfescape.pdf")
;; (pdflscape . "/usr/share/doc/texlive-doc/latex/oberdiek/pdflscape.pdf")
;; (pdfrender . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfrender.pdf")
;; (pdftexcmds . "/usr/share/doc/texlive-doc/latex/oberdiek/pdftexcmds.pdf")
;; (picture . "/usr/share/doc/texlive-doc/latex/oberdiek/picture.pdf")
;; (pmboxdraw . "/usr/share/doc/texlive-doc/latex/oberdiek/pmboxdraw.pdf")
;; (protecteddef . "/usr/share/doc/texlive-doc/latex/oberdiek/protecteddef.pdf")
;; (refcount . "/usr/share/doc/texlive-doc/latex/oberdiek/refcount.pdf")
;; (rerunfilecheck . "/usr/share/doc/texlive-doc/latex/oberdiek/rerunfilecheck.pdf")
;; (resizegather . "/usr/share/doc/texlive-doc/latex/oberdiek/resizegather.pdf")
;; (rotchiffre . "/usr/share/doc/texlive-doc/latex/oberdiek/rotchiffre.pdf")
;; (scrindex . "/usr/share/doc/texlive-doc/latex/oberdiek/scrindex.pdf")
;; (selinput . "/usr/share/doc/texlive-doc/latex/oberdiek/selinput.pdf")
;; (setouterhbox . "/usr/share/doc/texlive-doc/latex/oberdiek/setouterhbox.pdf")
;; (settobox . "/usr/share/doc/texlive-doc/latex/oberdiek/settobox.pdf")
;; (soulutf8 . "/usr/share/doc/texlive-doc/latex/oberdiek/soulutf8.pdf")
;; (stackrel . "/usr/share/doc/texlive-doc/latex/oberdiek/stackrel.pdf")
;; (stampinclude . "/usr/share/doc/texlive-doc/latex/oberdiek/stampinclude.pdf")
;; (stringenc . "/usr/share/doc/texlive-doc/latex/oberdiek/stringenc.pdf")
;; (tabularht . "/usr/share/doc/texlive-doc/latex/oberdiek/tabularht.pdf")
;; (tabularkv . "/usr/share/doc/texlive-doc/latex/oberdiek/tabularkv.pdf")
;; (telprint . "/usr/share/doc/texlive-doc/latex/oberdiek/telprint.pdf")
;; (th . "/usr/share/doc/texlive-doc/latex/oberdiek/thepdfnumber.pdf")
;; (transparent . "/usr/share/doc/texlive-doc/latex/oberdiek/transparent.pdf")
;; (twoopt . "/usr/share/doc/texlive-doc/latex/oberdiek/twoopt.pdf")
;; (uniquecounter . "/usr/share/doc/texlive-doc/latex/oberdiek/uniquecounter.pdf")
;; (zref . "/usr/share/doc/texlive-doc/latex/oberdiek/zref.pdf")
;; (psfonts . "/usr/share/doc/texlive-doc/latex/psnfss/psfonts.pdf")
;; (psnfss2e . "/usr/share/doc/texlive-doc/latex/psnfss/psnfss2e.pdf")
;; (pspicture . "/usr/share/doc/texlive-doc/latex/pspicture/pspicture.pdf")
;; (afterpage . "/usr/share/doc/texlive-doc/latex/tools/afterpage.pdf")
;; (array . "/usr/share/doc/texlive-doc/latex/tools/array.pdf")
;; (bm . "/usr/share/doc/texlive-doc/latex/tools/bm.pdf")
;; (calc . "/usr/share/doc/texlive-doc/latex/tools/calc.pdf")
;; (dcolumn . "/usr/share/doc/texlive-doc/latex/tools/dcolumn.pdf")
;; (delarray . "/usr/share/doc/texlive-doc/latex/tools/delarray.pdf")
;; (enumerate . "/usr/share/doc/texlive-doc/latex/tools/enumerate.pdf")
;; (fileerr . "/usr/share/doc/texlive-doc/latex/tools/fileerr.pdf")
;; (fontsmpl . "/usr/share/doc/texlive-doc/latex/tools/fontsmpl.pdf")
;; (ftnright . "/usr/share/doc/texlive-doc/latex/tools/ftnright.pdf")
;; (hhline . "/usr/share/doc/texlive-doc/latex/tools/hhline.pdf")
;; (indentfirst . "/usr/share/doc/texlive-doc/latex/tools/indentfirst.pdf")
;; (layout . "/usr/share/doc/texlive-doc/latex/tools/layout.pdf")
;; (longtable . "/usr/share/doc/texlive-doc/latex/tools/longtable.pdf")
;; (multicol . "/usr/share/doc/texlive-doc/latex/tools/multicol.pdf")
;; (rawfonts . "/usr/share/doc/texlive-doc/latex/tools/rawfonts.pdf")
;; (showkeys . "/usr/share/doc/texlive-doc/latex/tools/showkeys.pdf")
;; (somedefs . "/usr/share/doc/texlive-doc/latex/tools/somedefs.pdf")
;; (tabularx . "/usr/share/doc/texlive-doc/latex/tools/tabularx.pdf")
;; (theorem . "/usr/share/doc/texlive-doc/latex/tools/theorem.pdf")
;; (tools . "/usr/share/doc/texlive-doc/latex/tools/tools.pdf")
;; (trace . "/usr/share/doc/texlive-doc/latex/tools/trace.pdf")
;; (varioref . "/usr/share/doc/texlive-doc/latex/tools/varioref.pdf")
;; (verbatim . "/usr/share/doc/texlive-doc/latex/tools/verbatim.pdf")
;; (xr . "/usr/share/doc/texlive-doc/latex/tools/xr.pdf")
;; (xspace . "/usr/share/doc/texlive-doc/latex/tools/xspace.pdf")

("amsbooka" . "/usr/share/doc/texlive-doc/latex/amscls/amsbooka.pdf")
("amsclass" . "/usr/share/doc/texlive-doc/latex/amscls/amsclass.pdf")
("amsdtx" . "/usr/share/doc/texlive-doc/latex/amscls/amsdtx.pdf")
("amsmidx" . "/usr/share/doc/texlive-doc/latex/amscls/amsmidx.pdf")
("amsthdoc" . "/usr/share/doc/texlive-doc/latex/amscls/amsthdoc.pdf")
("instr-l" . "/usr/share/doc/texlive-doc/latex/amscls/instr-l.pdf")
("thmtest" . "/usr/share/doc/texlive-doc/latex/amscls/thmtest.pdf")
("upref" . "/usr/share/doc/texlive-doc/latex/amscls/upref.pdf")
("amsbsy" . "/usr/share/doc/texlive-doc/latex/amsmath/amsbsy.pdf")
("amscd" . "/usr/share/doc/texlive-doc/latex/amsmath/amscd.pdf")
("amsgen" . "/usr/share/doc/texlive-doc/latex/amsmath/amsgen.pdf")
("amsldoc" . "/usr/share/doc/texlive-doc/latex/amsmath/amsldoc.pdf")
("amsmath" . "/usr/share/doc/texlive-doc/latex/amsmath/amsmath.pdf")
("amsopn" . "/usr/share/doc/texlive-doc/latex/amsmath/amsopn.pdf")
("amstext" . "/usr/share/doc/texlive-doc/latex/amsmath/amstext.pdf")
("amsxtra" . "/usr/share/doc/texlive-doc/latex/amsmath/amsxtra.pdf")
("subeqn" . "/usr/share/doc/texlive-doc/latex/amsmath/subeqn.pdf")
("technote" . "/usr/share/doc/texlive-doc/latex/amsmath/technote.pdf")
("testmath" . "/usr/share/doc/texlive-doc/latex/amsmath/testmath.pdf")
("babel" . "/usr/share/doc/texlive-doc/latex/babel/babel.pdf")
("alltt" . "/usr/share/doc/texlive-doc/latex/base/alltt.pdf")
("cfgguide" . "/usr/share/doc/texlive-doc/latex/base/cfgguide.pdf")
("classes" . "/usr/share/doc/texlive-doc/latex/base/classes.pdf")
("clsguide" . "/usr/share/doc/texlive-doc/latex/base/clsguide.pdf")
("cmfonts" . "/usr/share/doc/texlive-doc/latex/base/cmfonts.pdf")
("cyrguide" . "/usr/share/doc/texlive-doc/latex/base/cyrguide.pdf")
("doc" . "/usr/share/doc/texlive-doc/latex/base/doc.pdf")
("docstrip" . "/usr/share/doc/texlive-doc/latex/base/docstrip.pdf")
("encguide" . "/usr/share/doc/texlive-doc/latex/base/encguide.pdf")
("exscale" . "/usr/share/doc/texlive-doc/latex/base/exscale.pdf")
("fixltx2e" . "/usr/share/doc/texlive-doc/latex/base/fixltx2e.pdf")
("fntguide" . "/usr/share/doc/texlive-doc/latex/base/fntguide.pdf")
("graphpap" . "/usr/share/doc/texlive-doc/latex/base/graphpap.pdf")
("ifthen" . "/usr/share/doc/texlive-doc/latex/base/ifthen.pdf")
("inputenc" . "/usr/share/doc/texlive-doc/latex/base/inputenc.pdf")
("latex209" . "/usr/share/doc/texlive-doc/latex/base/latex209.pdf")
("latexsym" . "/usr/share/doc/texlive-doc/latex/base/latexsym.pdf")
("lb2" . "/usr/share/doc/texlive-doc/latex/base/lb2.pdf")
("letter" . "/usr/share/doc/texlive-doc/latex/base/letter.pdf")
("lgc2" . "/usr/share/doc/texlive-doc/latex/base/lgc2.pdf")
("lppl" . "/usr/share/doc/texlive-doc/latex/base/lppl.pdf")
("ltnews" . "/usr/share/doc/texlive-doc/latex/base/ltnews.pdf")
("ltx3info" . "/usr/share/doc/texlive-doc/latex/base/ltx3info.pdf")
("ltxcheck" . "/usr/share/doc/texlive-doc/latex/base/ltxcheck.pdf")
("ltxdoc" . "/usr/share/doc/texlive-doc/latex/base/ltxdoc.pdf")
("makeindx" . "/usr/share/doc/texlive-doc/latex/base/makeindx.pdf")
("manual" . "/usr/share/doc/texlive-doc/latex/base/manual.pdf")
("modguide" . "/usr/share/doc/texlive-doc/latex/base/modguide.pdf")
("newlfont" . "/usr/share/doc/texlive-doc/latex/base/newlfont.pdf")
("oldlfont" . "/usr/share/doc/texlive-doc/latex/base/oldlfont.pdf")
("proc" . "/usr/share/doc/texlive-doc/latex/base/proc.pdf")
("slides" . "/usr/share/doc/texlive-doc/latex/base/slides.pdf")
("slifonts" . "/usr/share/doc/texlive-doc/latex/base/slifonts.pdf")
("source2e" . "/usr/share/doc/texlive-doc/latex/base/source2e.pdf")
("syntonly" . "/usr/share/doc/texlive-doc/latex/base/syntonly.pdf")
("tlc2" . "/usr/share/doc/texlive-doc/latex/base/tlc2.pdf")
("usrguide" . "/usr/share/doc/texlive-doc/latex/base/usrguide.pdf")
("utf8ienc" . "/usr/share/doc/texlive-doc/latex/base/utf8ienc.pdf")
("webcomp" . "/usr/share/doc/texlive-doc/latex/base/webcomp.pdf")
("ltxtable" . "/usr/share/doc/texlive-doc/latex/carlisle/ltxtable.pdf")
("colortbl-DE" . "/usr/share/doc/texlive-doc/latex/colortbl/colortbl-DE.pdf")
("colortbl" . "/usr/share/doc/texlive-doc/latex/colortbl/colortbl.pdf")
("fancyhdr" . "/usr/share/doc/texlive-doc/latex/fancyhdr/fancyhdr.pdf")
("fix2col" . "/usr/share/doc/texlive-doc/latex/fix2col/fix2col.pdf")
("geometry" . "/usr/share/doc/texlive-doc/latex/geometry/geometry.pdf")
("color" . "/usr/share/doc/texlive-doc/latex/graphics/color.pdf")
("drivers" . "/usr/share/doc/texlive-doc/latex/graphics/drivers.pdf")
("epsfig" . "/usr/share/doc/texlive-doc/latex/graphics/epsfig.pdf")
("graphics" . "/usr/share/doc/texlive-doc/latex/graphics/graphics.pdf")
("graphicx" . "/usr/share/doc/texlive-doc/latex/graphics/graphicx.pdf")
("grfguide" . "/usr/share/doc/texlive-doc/latex/graphics/grfguide.pdf")
("keyval" . "/usr/share/doc/texlive-doc/latex/graphics/keyval.pdf")
("lscape" . "/usr/share/doc/texlive-doc/latex/graphics/lscape.pdf")
("trig" . "/usr/share/doc/texlive-doc/latex/graphics/trig.pdf")
("backref" . "/usr/share/doc/texlive-doc/latex/hyperref/backref.pdf")
("hyperref" . "/usr/share/doc/texlive-doc/latex/hyperref/hyperref.pdf")
("manual" . "/usr/share/doc/texlive-doc/latex/hyperref/manual.pdf")
("nameref" . "/usr/share/doc/texlive-doc/latex/hyperref/nameref.pdf")
("options" . "/usr/share/doc/texlive-doc/latex/hyperref/options.pdf")
("paper" . "/usr/share/doc/texlive-doc/latex/hyperref/paper.pdf")
("README" . "/usr/share/doc/texlive-doc/latex/hyperref/README.pdf")
("slides" . "/usr/share/doc/texlive-doc/latex/hyperref/slides.pdf")
("mflogo" . "/usr/share/doc/texlive-doc/latex/mflogo/mflogo.pdf")
("oldgerm" . "/usr/share/doc/texlive-doc/latex/mfnfss/oldgerm.pdf")
("natbib" . "/usr/share/doc/texlive-doc/latex/natbib/natbib.pdf")
("natnotes" . "/usr/share/doc/texlive-doc/latex/natbib/natnotes.pdf")
("accsupp" . "/usr/share/doc/texlive-doc/latex/oberdiek/accsupp.pdf")
("aliascnt" . "/usr/share/doc/texlive-doc/latex/oberdiek/aliascnt.pdf")
("alphalph" . "/usr/share/doc/texlive-doc/latex/oberdiek/alphalph.pdf")
("askinclude" . "/usr/share/doc/texlive-doc/latex/oberdiek/askinclude.pdf")
("atbegshi" . "/usr/share/doc/texlive-doc/latex/oberdiek/atbegshi.pdf")
("atenddvi" . "/usr/share/doc/texlive-doc/latex/oberdiek/atenddvi.pdf")
("attachfile2" . "/usr/share/doc/texlive-doc/latex/oberdiek/attachfile2.pdf")
("atveryend" . "/usr/share/doc/texlive-doc/latex/oberdiek/atveryend.pdf")
("auxhook" . "/usr/share/doc/texlive-doc/latex/oberdiek/auxhook.pdf")
("bigintcalc" . "/usr/share/doc/texlive-doc/latex/oberdiek/bigintcalc.pdf")
("bitset" . "/usr/share/doc/texlive-doc/latex/oberdiek/bitset.pdf")
("bmpsize" . "/usr/share/doc/texlive-doc/latex/oberdiek/bmpsize.pdf")
("bookmark" . "/usr/share/doc/texlive-doc/latex/oberdiek/bookmark.pdf")
("catchfile" . "/usr/share/doc/texlive-doc/latex/oberdiek/catchfile.pdf")
("centernot" . "/usr/share/doc/texlive-doc/latex/oberdiek/centernot.pdf")
("chemarr" . "/usr/share/doc/texlive-doc/latex/oberdiek/chemarr.pdf")
("classlist" . "/usr/share/doc/texlive-doc/latex/oberdiek/classlist.pdf")
("colonequals" . "/usr/share/doc/texlive-doc/latex/oberdiek/colonequals.pdf")
("dvipscol" . "/usr/share/doc/texlive-doc/latex/oberdiek/dvipscol.pdf")
("embedfile" . "/usr/share/doc/texlive-doc/latex/oberdiek/embedfile.pdf")
("engord" . "/usr/share/doc/texlive-doc/latex/oberdiek/engord.pdf")
("enparen" . "/usr/share/doc/texlive-doc/latex/oberdiek/enparen.pdf")
("eolgrab" . "/usr/share/doc/texlive-doc/latex/oberdiek/eolgrab.pdf")
("epst" . "/usr/share/doc/texlive-doc/latex/oberdiek/epstopdf.pdf")
("etexcmds" . "/usr/share/doc/texlive-doc/latex/oberdiek/etexcmds.pdf")
("fibnum" . "/usr/share/doc/texlive-doc/latex/oberdiek/fibnum.pdf")
("flags" . "/usr/share/doc/texlive-doc/latex/oberdiek/flags.pdf")
("gettitlestring" . "/usr/share/doc/texlive-doc/latex/oberdiek/gettitlestring.pdf")
("grfext" . "/usr/share/doc/texlive-doc/latex/oberdiek/grfext.pdf")
("grffile" . "/usr/share/doc/texlive-doc/latex/oberdiek/grffile.pdf")
("hobsub" . "/usr/share/doc/texlive-doc/latex/oberdiek/hobsub.pdf")
("hologo" . "/usr/share/doc/texlive-doc/latex/oberdiek/hologo.pdf")
("holtxdoc" . "/usr/share/doc/texlive-doc/latex/oberdiek/holtxdoc.pdf")
("hopatch" . "/usr/share/doc/texlive-doc/latex/oberdiek/hopatch.pdf")
("hycolor" . "/usr/share/doc/texlive-doc/latex/oberdiek/hycolor.pdf")
("hypbmsec" . "/usr/share/doc/texlive-doc/latex/oberdiek/hypbmsec.pdf")
("hypcap" . "/usr/share/doc/texlive-doc/latex/oberdiek/hypcap.pdf")
("hypdestopt" . "/usr/share/doc/texlive-doc/latex/oberdiek/hypdestopt.pdf")
("hypdoc" . "/usr/share/doc/texlive-doc/latex/oberdiek/hypdoc.pdf")
("hypgotoe" . "/usr/share/doc/texlive-doc/latex/oberdiek/hypgotoe.pdf")
("hyphsubst" . "/usr/share/doc/texlive-doc/latex/oberdiek/hyphsubst.pdf")
("ifdraft" . "/usr/share/doc/texlive-doc/latex/oberdiek/ifdraft.pdf")
("iflang" . "/usr/share/doc/texlive-doc/latex/oberdiek/iflang.pdf")
("ifluatex" . "/usr/share/doc/texlive-doc/latex/oberdiek/ifluatex.pdf")
("i" . "/usr/share/doc/texlive-doc/latex/oberdiek/ifpdf.pdf")
("ifvtex" . "/usr/share/doc/texlive-doc/latex/oberdiek/ifvtex.pdf")
("infwarerr" . "/usr/share/doc/texlive-doc/latex/oberdiek/infwarerr.pdf")
("inputenx" . "/usr/share/doc/texlive-doc/latex/oberdiek/inputenx.pdf")
("intcalc" . "/usr/share/doc/texlive-doc/latex/oberdiek/intcalc.pdf")
("kvdefinekeys" . "/usr/share/doc/texlive-doc/latex/oberdiek/kvdefinekeys.pdf")
("kvoptions" . "/usr/share/doc/texlive-doc/latex/oberdiek/kvoptions.pdf")
("kvsetkeys" . "/usr/share/doc/texlive-doc/latex/oberdiek/kvsetkeys.pdf")
("letltxmacro" . "/usr/share/doc/texlive-doc/latex/oberdiek/letltxmacro.pdf")
("listingsutf8" . "/usr/share/doc/texlive-doc/latex/oberdiek/listingsutf8.pdf")
("ltxcmds" . "/usr/share/doc/texlive-doc/latex/oberdiek/ltxcmds.pdf")
("luacolor" . "/usr/share/doc/texlive-doc/latex/oberdiek/luacolor.pdf")
("luatex" . "/usr/share/doc/texlive-doc/latex/oberdiek/luatex.pdf")
("magicnum" . "/usr/share/doc/texlive-doc/latex/oberdiek/magicnum.pdf")
("makerobust" . "/usr/share/doc/texlive-doc/latex/oberdiek/makerobust.pdf")
("mleftright" . "/usr/share/doc/texlive-doc/latex/oberdiek/mleftright.pdf")
("oberdiek" . "/usr/share/doc/texlive-doc/latex/oberdiek/oberdiek.pdf")
("pagegrid" . "/usr/share/doc/texlive-doc/latex/oberdiek/pagegrid.pdf")
("pagesel" . "/usr/share/doc/texlive-doc/latex/oberdiek/pagesel.pdf")
("pdfcolfoot" . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfcolfoot.pdf")
("pdfcolmk" . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfcolmk.pdf")
("pdfcolparallel" . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfcolparallel.pdf")
("pdfcolparcolumns" . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfcolparcolumns.pdf")
("pdfcol" . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfcol.pdf")
("pdfcrypt" . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfcrypt.pdf")
("pdfescape" . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfescape.pdf")
("pdflscape" . "/usr/share/doc/texlive-doc/latex/oberdiek/pdflscape.pdf")
("pdfrender" . "/usr/share/doc/texlive-doc/latex/oberdiek/pdfrender.pdf")
("pdftexcmds" . "/usr/share/doc/texlive-doc/latex/oberdiek/pdftexcmds.pdf")
("picture" . "/usr/share/doc/texlive-doc/latex/oberdiek/picture.pdf")
("pmboxdraw" . "/usr/share/doc/texlive-doc/latex/oberdiek/pmboxdraw.pdf")
("protecteddef" . "/usr/share/doc/texlive-doc/latex/oberdiek/protecteddef.pdf")
("refcount" . "/usr/share/doc/texlive-doc/latex/oberdiek/refcount.pdf")
("rerunfilecheck" . "/usr/share/doc/texlive-doc/latex/oberdiek/rerunfilecheck.pdf")
("resizegather" . "/usr/share/doc/texlive-doc/latex/oberdiek/resizegather.pdf")
("rotchiffre" . "/usr/share/doc/texlive-doc/latex/oberdiek/rotchiffre.pdf")
("scrindex" . "/usr/share/doc/texlive-doc/latex/oberdiek/scrindex.pdf")
("selinput" . "/usr/share/doc/texlive-doc/latex/oberdiek/selinput.pdf")
("setouterhbox" . "/usr/share/doc/texlive-doc/latex/oberdiek/setouterhbox.pdf")
("settobox" . "/usr/share/doc/texlive-doc/latex/oberdiek/settobox.pdf")
("soulutf8" . "/usr/share/doc/texlive-doc/latex/oberdiek/soulutf8.pdf")
("stackrel" . "/usr/share/doc/texlive-doc/latex/oberdiek/stackrel.pdf")
("stampinclude" . "/usr/share/doc/texlive-doc/latex/oberdiek/stampinclude.pdf")
("stringenc" . "/usr/share/doc/texlive-doc/latex/oberdiek/stringenc.pdf")
("tabularht" . "/usr/share/doc/texlive-doc/latex/oberdiek/tabularht.pdf")
("tabularkv" . "/usr/share/doc/texlive-doc/latex/oberdiek/tabularkv.pdf")
("telprint" . "/usr/share/doc/texlive-doc/latex/oberdiek/telprint.pdf")
("th" . "/usr/share/doc/texlive-doc/latex/oberdiek/thepdfnumber.pdf")
("transparent" . "/usr/share/doc/texlive-doc/latex/oberdiek/transparent.pdf")
("twoopt" . "/usr/share/doc/texlive-doc/latex/oberdiek/twoopt.pdf")
("uniquecounter" . "/usr/share/doc/texlive-doc/latex/oberdiek/uniquecounter.pdf")
("zref" . "/usr/share/doc/texlive-doc/latex/oberdiek/zref.pdf")
("psfonts" . "/usr/share/doc/texlive-doc/latex/psnfss/psfonts.pdf")
("psnfss2e" . "/usr/share/doc/texlive-doc/latex/psnfss/psnfss2e.pdf")
("pspicture" . "/usr/share/doc/texlive-doc/latex/pspicture/pspicture.pdf")
("afterpage" . "/usr/share/doc/texlive-doc/latex/tools/afterpage.pdf")
("array" . "/usr/share/doc/texlive-doc/latex/tools/array.pdf")
("bm" . "/usr/share/doc/texlive-doc/latex/tools/bm.pdf")
("calc" . "/usr/share/doc/texlive-doc/latex/tools/calc.pdf")
("dcolumn" . "/usr/share/doc/texlive-doc/latex/tools/dcolumn.pdf")
("delarray" . "/usr/share/doc/texlive-doc/latex/tools/delarray.pdf")
("enumerate" . "/usr/share/doc/texlive-doc/latex/tools/enumerate.pdf")
("fileerr" . "/usr/share/doc/texlive-doc/latex/tools/fileerr.pdf")
("fontsmpl" . "/usr/share/doc/texlive-doc/latex/tools/fontsmpl.pdf")
("ftnright" . "/usr/share/doc/texlive-doc/latex/tools/ftnright.pdf")
("hhline" . "/usr/share/doc/texlive-doc/latex/tools/hhline.pdf")
("indentfirst" . "/usr/share/doc/texlive-doc/latex/tools/indentfirst.pdf")
("layout" . "/usr/share/doc/texlive-doc/latex/tools/layout.pdf")
("longtable" . "/usr/share/doc/texlive-doc/latex/tools/longtable.pdf")
("multicol" . "/usr/share/doc/texlive-doc/latex/tools/multicol.pdf")
("rawfonts" . "/usr/share/doc/texlive-doc/latex/tools/rawfonts.pdf")
("showkeys" . "/usr/share/doc/texlive-doc/latex/tools/showkeys.pdf")
("somedefs" . "/usr/share/doc/texlive-doc/latex/tools/somedefs.pdf")
("tabularx" . "/usr/share/doc/texlive-doc/latex/tools/tabularx.pdf")
("theorem" . "/usr/share/doc/texlive-doc/latex/tools/theorem.pdf")
("tools" . "/usr/share/doc/texlive-doc/latex/tools/tools.pdf")
("trace" . "/usr/share/doc/texlive-doc/latex/tools/trace.pdf")
("varioref" . "/usr/share/doc/texlive-doc/latex/tools/varioref.pdf")
("verbatim" . "/usr/share/doc/texlive-doc/latex/tools/verbatim.pdf")
("xr" . "/usr/share/doc/texlive-doc/latex/tools/xr.pdf")
("xspace" . "/usr/share/doc/texlive-doc/latex/tools/xspace.pdf")

)
)

;stampo nell'area echo il path del manuale di amsdtx
;(message "message is %s" (cdr (assoc amsdtx dictionary) ) )

;apre il file di doc relativo a amsdtx
;(find-file (cdr (assoc 'amsdtx dictionary) ) )

;attende il nome del pacchetto latex ed apre la documentazione in pdf
(defun latex-doc-pdf (x)
  "ciaociaociaociao"
  (interactive "sNome pacchetto: ")
  (find-file (cdr (assoc x dictionary) ) )
  (message "Name: %s" x)
)



8 gennaio 2013

MathJax, formule matematiche nell'html

Prendo un respiro dallo studio per condividere (è -come sempre- un pretesto per avere un memo) questa piccola rivoluzione < MathJax is an open source JavaScript display engine for mathematics that works in all modern browsers> Cioè a dire: una serie di strumenti, trasparenti all'utente finale, per inserire porzioni di ambiente matematico Tex/LaTex in un file HTML5. Si possono poi inserire estratti di codice  MathML o AsciiMath. Tutta la matematica che volete scrivere entra a far parte della struttura del documento, non come immagine statica oppure come codice Flash, ma  con un sofisticato uso di CSS e fonts. I vantaggi principali sono tre:
  • Facile e leggibile: se scrivete complicate formule in LaTex potete copiarle direttamente nel documento html; una seconda persona (anche voi stessi a distanza di tempo) sarà in grado di leggere -e correggere il documento- senza aver bisogno di files o strumenti esterni (prima di questo strumento si era costretti a consultare il documento, trovare il nome dell'immagine relatica al codice, aprire il file LaTex corrispondente, modificarlo, ri-compilarlo, aggiornare il browser)
  • <equations scale with surrounding text at all zoom levels> Cioè potete zummare, modificare le dimensioni della finestra del browser e cambiare impostazioni CSS: la parte matematica seguirà questi cambiamenti.
  • Ricerca innovativa: il documento HTML5 conterrà codice LaTex (o MathML o AsciiMath) quindi sarà possibile eseguire ricerche per simboli (o loro composizioni) matematici.
Ecco un piccolo esempio.

Buoni propositi:

  • Trovare il modo semplice per utilizzarlo qui.
  • Scrivere un softwarino (probabilmente in forma di script) che converte un file LaTex in un documento HTML5 in questo modo: i comandi di struttura e di testo vengono processati dai "tradizionali" convertitori, gli ambienti (in particolare quello matematico) vengono processati separatamente ed il lavoro finale utilizza mathjax.

Tempo permettendo, mi piacerebbe lavorare a questo progetto. 

17 novembre 2011

Bach geometra?

Trascrizione del meraviglioso Canone 1 a 2 dell'"Offerta musicale" di J. S. Bach (1747) ad uso didattico (la funzione proviene da http://dvoi.com/files/lilypond/2.5.3/Documentation/user/out-www/lilypond/Manipulating-music-expressions.html)

\version "2.12.3"


\paper {

}

\header {
title = \markup \center-column {\fontsize #6.0 "Bach's Crab Canon" \line { } }
}


#(define (reverse-music music)
(let* ((elements (ly:music-property music 'elements))
(reversed (reverse elements))
(e (ly:music-property music 'element))
(span-dir (ly:music-property music 'span-direction)))

(ly:music-set-property! music 'elements reversed)

(if (ly:music? e)
(ly:music-set-property!
music 'element
(reverse-music e)))

(if (ly:dir? span-dir)
(ly:music-set-property! music 'span-direction (- span-dir)))

(map reverse-music reversed)

music))


frase = \relative c' {
%\clef treble
%\key c \minor
%\time 4/4

c2 ees | g aes |
b, r4 g'4~ | g fis2 f4~ |
f e2 ees4~ | ees d des c |
b g c f | ees2 d | %9
c ees | g8 f g c g ees d ees |
f g a b c ees, f g | aes d, ees f g f ees d |
ees f g aes bes aes g f | g aes bes c des bes aes g |
a b c d ees c b a | b c d ees f d g, d' | %17
c d ees f ees d c b | c4 g ees c
}

pausa =\relative c {
%\clef treble
%\key c \minor
%\time 4/4

s1 | s1 |
s1 | s1 |
s1 | s1 |
s1 | s1 |
s1 | s1 |
s1 | s1 |
s1 | s1 |
s1 | s1 |
s1 | s1 |

}



\score {
\new PianoStaff <<
%\set PianoStaff.instrumentName = #"Piano "
\new Staff = "upper" {
\clef treble
\key c \minor
\time 4/4
\frase
\pausa
\applyMusic #reverse-music \frase
\bar "|."
}
\new Staff = "lower" {
\clef treble
\key c \minor
\time 4/4
\pausa
\applyMusic #reverse-music \frase
\frase
}
>>
\layout {

}
\midi {

}
}

Ecco il pdf: http://git.phc.unipi.it/presentazione/preslily/blobs/raw/ec22b5076b79fbc3631993613a92cf0ac8943011/Esempi/canon_crab.pdf

Stampando le 18 battute su una striscia di carta (le prime nove verso, le altre 9 retro) come in http://www.youtube.com/watch?v=xUHQ2ybTejU ed incollando propriamente le due estremità si ottiene un esempio musicale del Nastro di Möbius

26 giugno 2011

Studio: da Glass verso l'uscita dal Minimalismo

Qualche tempo fa (anni?) mi sono appassinato al Minimalismo Americano (ed andando indietro nel tempo a "quello francese") ed ho iniziato a studiare perché "funziona". Come è possibile che un ritmo costante ed una armonia semplice (ma non banale) regalino tanto piacere sia all'ascoltatore sia all'esegutore? Per quanto riguarda l'armonia -forse- il minimalismo si è piazzato alla fine di un periodo di esasperazione nella musica classica e al principio della musica pop come la intendiamo noi oggi. Il ritmo invece richiede -secondo me- una spiegazione <> Glass si è appassionato al buddismo e all'India, dove si hanno prove di conoscenza delle leggi che legano suono a onde celebrali (non una conoscenza scientifica, direi piuttosto una "intuizione") [se siete interessati: http://en.wikipedia.org/wiki/Brainwave_entrainment e relativi riferimenti] e ne ha ricavato una personale commistione "fra Mozart (studiato con la Boulanger) ei chakra". Tutti questi discorsi pseudo-filosifici servono per inquadrare la musica, ma certo non riescono a

Appreso questo, mi è venuta voglia di sperimentare: scelti due brani (Truman sleeps e piano angel) ho iniziato a lavorarci. Ho cambiato tonalità al primo, e ne ho estratto il giro armonico; il secondo mi è servito come riferimento per le figure ritmiche. Quello che ho aggiunto di mio è stato

1) dare figure ritmiche diverse alle due mani, notando che lo sfasamento (tanto caro a Reich e fonte di ispirazione per Glass) funziona meglio con numeri primi

2) ripetere la stessa figura ritmica, alternando però le note dell'arpeggio con note alterate (cosa molto poco usata da Glass) per creare anche uno sfasamento tonale

Il risultato è "poco musicale" ma l'effetto è utilizzabile con successo in brani alienanti :)

Di seguito il codice LilyPond riesumato da un Beckup, relativo file PDF e MIDI.

%%%

%This program is free software: you can redistribute it and/or modify
%it under the terms of the GNU General Public License as published by
%the Free Software Foundation, either version 3 of the License, or
%(at your option) any later version.
%
%This program is distributed in the hope that it will be useful,
%but WITHOUT ANY WARRANTY; without even the implied warranty of
%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%GNU General Public License for more details.
%
%You should have received a copy of the GNU General Public License
%along with this program. If not, see .

%Author: Giulio Masetti

%E-mail: masetti@mail.dm.unipi.it or 106ohm@gmail.com

%%%

\version "2.12.3"


destra = \relative c'' {
\clef treble
\key c\major
%modulo 4
a16 c e a a, c e a a, c e a a, c e a
a, c e a a, c e a a, c e a a, c e a
%
a, c f a a, c f a a, c f a a, c f a
a, c f a a, c f a a, c f a a, c f a
%
g, c e g g, c e g g, c e g g, c e g
g, c e g g, c e g g, c e g g, c e g
%
gis, b e gis gis, b e gis gis, b e gis gis, b e gis
gis, b e gis gis, b e gis gis, b e gis gis, b e gis
%modulo 6
\times 2/6 {a8 e c a c e} \times 2/6 {a e c a c e} \times 2/6 {a e c a c e} \times 2/6 {a e c a c e}
a16 e c a c e a e c a c e a e c a
%
\times 2/6 {a'8 f c a c f} \times 2/6 {a8 f c a c f} \times 2/6 {a8 f c a c f} \times 2/6 {a8 f c a c f}
a16 f c a c f a f c a c f a f c a
%
\times 2/6 {g'8 e c g c e} \times 2/6 {g8 e c g c e} \times 2/6 {g8 e c g c e} \times 2/6 {g8 e c g c e}
g16 e c g c e g e c g c e g e c g
%
\times 2/6 {gis'8 e b gis b e} \times 2/6 {gis8 e b gis b e} \times 2/6 {gis8 e b gis b e} \times 2/6 {gis8 e b gis b e}
gis16 e b gis b e gis e b gis b e gis e b gis
% %modulo 6 variazioni
% \times 2/6 {a'8 e c a c e} \times 2/6 {a f c a c e} \times 2/6 {a e c a c e} \times 2/6 {a f c a c e}
% a16 e c a c e a f c a c e a e c a
% %
% \times 2/6 {a'8 f c a c f} \times 2/6 {g8 e c a c f} \times 2/6 {a8 f c a c f} \times 2/6 {g8 e c a c f}
% a16 f c a c f g e c a c f a f c a
% %
% \times 2/6 {g'8 e c g c e} \times 2/6 {gis8 e c g c e} \times 2/6 {g8 e c g c e} \times 2/6 {gis8 e c g c e}
% g16 e c g c e gis e c g c e g e c g
% %
% \times 2/6 {gis'8 e b gis b e} \times 2/6 {gis8 e b gis c e} \times 2/6 {gis8 e b gis b e} \times 2/6 {gis8 e b gis c e}
% gis16 e b gis b e gis e b gis c e gis e b gis

%modulo 7
\times 2/7 {a8 c a' e c a c} \times 2/7 {a c a' e c a c} \times 2/7 {a c a' e c a c} \times 2/7 {a c a' e c a c}
a16 c a' e c a c a c a' e c a c a c
%
\times 2/7 {a8 c a' f c a c} \times 2/7 {a c a' f c a c} \times 2/7 {a c a' f c a c} \times 2/7 {a c a' f c a c}
a16 c a' f c a c a c a' f c a c a c
%
\times 2/7 {g8 c g' e c g c} \times 2/7 {g c g' e c g c} \times 2/7 {g c g' e c g c} \times 2/7 {g c g' e c g c}
g16 c g' e c g c g c g' e c g c g c
%
\times 2/7 {gis8 b gis' e b gis b} \times 2/7 {gis8 b gis' e b gis b} \times 2/7 {gis8 b gis' e b gis b} \times 2/7 {gis8 b gis' e b gis b}
gis16 b gis' e b gis b gis16 b gis' e b gis b gis b
%
a1
}

sinistra = \relative c {
\clef bass
\key c\major
%modulo 3
a16 c e a, c e a, c e a, c e a, c e a, c e a, c e a, c e a, c e a, c e a, c
%
a c f a, c f a, c f a, c f a, c f a, c f a, c f a, c f a, c f a, c f a, c
%
g c e g, c e g, c e g, c e g, c e g, c e g, c e g, c e g, c e g, c e g, c
%
gis b e gis, b e gis, b e gis, b e gis, b e gis, b e gis, b e gis, b e gis, b e gis, b e gis, b
%modulo 4
a c e a a, c e a a, c e a a, c e a
a, c e a a, c e a a, c e a a, c e a
%
a, c f a a, c f a a, c f a a, c f a
a, c f a a, c f a a, c f a a, c f a
%
g, c e g g, c e g g, c e g g, c e g
g, c e g g, c e g g, c e g g, c e g
%
gis, b e gis gis, b e gis gis, b e gis gis, b e gis
gis, b e gis gis, b e gis gis, b e gis gis, b e gis
% %modulo 4 variazioni
% a, c e a a, c e a a, c e a a, c a c
% a c e a a, c e a a, c e a a, c a c
% %
% a c f a a, c f a a, c f a a, c a c
% a c f a a, c f a a, c f a a, c a c
% %
% g c e g g, c e g g, c e g g, c g c
% g c e g g, c e g g, c e g g, c g c
% %
% gis b e gis gis, b e gis gis, b e gis gis, b gis b
% gis b e gis gis, b e gis gis, b e gis gis, b gis b

%modulo 3, 4 e 2
a, c e a, c e a, c e a a, c e a a, c
a c e a, c e a, c e a a, c e a a, c
%
a c f a, c f a, c f a a, c f a a, c
a c f a, c f a, c f a a, c f a a, c
%
g c e g, c e g, c e g g, c e g g, c
g c e g, c e g, c e g g, c e g g, c
%
gis b e gis, b e gis, b e gis gis, b e gis gis, b
gis b e gis, b e gis, b e gis gis, b e gis gis, b
%
a1
}

\score {
\new PianoStaff <<
\set PianoStaff.instrumentName = #"Piano "
\new Staff = "destra" \destra
\new Staff = "sinistra" \sinistra
>>
\midi{
\context {
\Score tempoWholesPerMinute = #(ly:make-moment 120 4)
}
}
\layout { }
}

file PDF e file MIDI

19 aprile 2011

Seminario Calcolo Scientfico

Argomento: come scegliere matrici di linearizzazione per problemi polinomiali agli autovalori.

Potete andare sul server gitorius http://git.phc.unipi.it e cercare il mio seminario [così potrete sempre trovare ua versione aggiornata, qualora io ci rimetta le mani...] in pdf, oppure in sorgente LaTex.

È presente anche del codice in FORTRAN90 relativo a sperimentazioni varie.