Warning: this is a htmlized version!
The original is across this link.
#######
#
# E-scripts for TeX-related things.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/a/e/tex.e>
#           or at <http://angg.twu.net/e/tex.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/a/.emacs[.html]>,
#                 <http://angg.twu.net/a/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######



############
#
# some docs
#
############

#  «docs»
#
#   texbook:   p.427=438 font charts
#              p.434=445 symbol commands
#   essential: p.20      huge table of symbols commands (<- use this)
#   amsguide:  p.20=21   symbol commands
#
#   amsldoc:   many examples of ams math mode
#
export DISPLAY=:0.0
xdvi +438 $SCTAN/systems/knuth/tex/texbook.dvi &
xdvi +445 $SCTAN/systems/knuth/tex/texbook.dvi &
xdvi +21  /usr/lib/texmf/doc/ams/amstex/amsguide.dvi &
xdvi +10 /usr/doc/texmf/latex/amslatex/amsldoc.dvi &
xdvi +20 /usr/doc/texmf/latex/general/essential.dvi &
xdvi /usr/lib/texmf/source/latex/amslatex/math/testmath.dvi &

# (find-fline "$SCTAN/systems/knuth/tex/texbook.tex" 25862)
# xdvi /usr/lib/texmf/texmf/doc/ams/amstex/amsguide.dvi &
# xdvi /usr/lib/texmf/texmf/doc/ams/amslatex/amsldoc.dvi &
# xdvi /usr/lib/texmf/texmf/doc/latex/general/essential.dvi &
# xdvi /usr/lib/texmf/texmf/doc/ams/amslatex/testmath.dvi &

gzip -dv /usr/doc/texmf/latex/amslatex/amsldoc.dvi.gz

# cd /b2/usr/lib/texmf/texmf/doc/metapost/
# rm mpman.ps manfig.[0-9]* manfig.mpx
# make DVIPS='dvips -Pold' mpman.ps
xdvi /b2/usr/lib/texmf/texmf/doc/metapost/mpman.dvi &
gv /b2/usr/lib/texmf/texmf/doc/metapost/mpman.ps &

gv /usr/src/xy-3.6/doc/xyrefer.ps &
gv /usr/src/xy-3.6/doc/xyguide.ps &

# Source2e:
xdvi /usr/lib/texmf/source/latex/base/source2e.dvi &
# and its index...
# (find-lsrcfile "base/source2e.ind")
cd /usr/lib/texmf/source/latex/base/
agrep '\{part\}...hspace' source2e.toc

xdvi $SCTAN/systems/knuth/tex/texbook.dvi &
xdvi $SCTAN/systems/knuth/mf/mfbook.dvi &
#
# (find-fline "$SCTAN/systems/knuth/mf/mfbook.tex")
# (find-fline "$SCTAN/systems/knuth/tex/texbook.tex")
# (find-web2cfile "tex/tex.web")
# (find-web2cfile "mf/mf.web")
# (find-knuthfile "tex/index.tex")

# (find-fline "/usr/doc/texmf/latex/amslatex/testmath.tex.gz")
# (find-fline "/usr/lib/texmf/source/latex/amslatex/math/testmath.tex")
# (find-fline "/usr/lib/texmf/source/latex/guide/essential.tex")
# (find-fline "/usr/lib/texmf/source/latex/guide/essential2e.tex")

export DISPLAY=:0.0
xdvi /usr/lib/texmf/texmf/doc/latex/general/essential.dvi &
# xdvi /usr/lib/texmf/texmf/doc/latex/general/guide.dvi &
# xdvi /usr/lib/texmf/texmf/doc/latex/general/l2kurz.dvi &

# (find-node "(latex)Top")
xdvi /usr/lib/texmf/texmf/doc/latex/general/latex2e.dvi &
# (find-lshfile "lshort2e.tex")
xdvi /usr/lib/texmf/texmf/doc/latex/general/lshort2e.dvi &
xdvi /usr/lib/texmf/texmf/doc/latex/base/fntguide.dvi &

cd /usr/lib/texmf/texmf/doc/ams/amslatex/
latex testmath.tex
latex testmath.tex
latex testmath.tex

xdvi /usr/lib/texmf/texmf/doc/generic/xypic/xyguide.dvi &
xdvi /usr/lib/texmf/texmf/doc/generic/xypic/xyrefer.dvi &

xdvi /snarf/ftp/ftp.dcs.qmw.ac.uk/pub/tex/contrib/pt/proofs/prooftree-doc.dvi &

# amsldoc has many examples of ams math mode.
#
xdvi /usr/lib/texmf/texmf/doc/ams/amslatex/amsldoc.dvi &
xdvi /usr/lib/texmf/texmf/doc/ams/amslatex/instr-l.dvi &
xdvi /usr/lib/texmf/texmf/doc/ams/amstex/amsguide.dvi &

# amsfndoc has font charts at the end.
xdvi /usr/lib/texmf/texmf/doc/ams/amsfonts/amsfndoc.dvi &
xdvi /usr/lib/texmf/texmf/doc/ams/amsfonts/amsfonts.dvi &
xdvi /usr/lib/texmf/texmf/doc/ams/amsfonts/eufrak.dvi &
xdvi /usr/lib/texmf/texmf/doc/ams/amsfonts/euscript.dvi &

# xdvi /usr/lib/texmf/texmf/doc/metapost/mpman.dvi &
# xdvi /usr/lib/texmf/texmf/doc/metapost/mpgraph.dvi &
gv /usr/lib/texmf/texmf/doc/metapost/mpman.ps &
gv /usr/lib/texmf/texmf/doc/metapost/mpgraph.ps &


# But perhaps you'll need to make the `.ps's...
#
# (find-fline "/usr/lib/texmf/texmf/doc/metapost/Makefile" "DVIPS")
cd /usr/lib/texmf/texmf/doc/metapost/
make				|& tee om
#make DVIPS='dvips -Pold'	|& tee om

# Install the LaTeX2e texinfo docs, to be accessed with, e.g.:
# (find-node "(latex)Top")
#
cd /usr/lib/texmf/source/info/
makeinfo latex2e.texi
mv -v latex latex-* /usr/info/

locate '/usr/*.dvi' | sort




######
#
# TeXing testmath (slink)
#
######

cd /usr/lib/texmf/source/latex/amslatex/math/
latex testmath.tex



######
#
# Indexing the .dtx's (and other preparations)
# 99sep04
#
######

apti tetex-src
# (find-vldifile "tetex-src.list")
# (find-fline "/usr/doc/tetex-src/")
# (find-fline "/usr/lib/texmf/source/latex/")

# (find-fline "~/.zshrc" "dtxagrep")
cd /usr/lib/texmf/
find * -type f > .files
grep '\.dtx$' .files > .files.dtx

apti tetex-doc
gzip -dv /usr/doc/texmf/latex/general/essential.dvi.gz

# Allowing portuguese hyphenation:
# (find-fline "/etc/texmf/language.dat" "portuges")
/usr/bin/texconfig init |& tee ~/o
# (find-fline "~/o")




######
#
# tetex-0.9 source (slink)
# 99oct12
#
######

#  «tetex-0.9»
#  «tetex-0.9-nonfree»

pdsc /big/slinks2/dists/slink/main/source/tex/tetex-base_0.9.981113-1.dsc
cd /usr/src/tetex-base-0.9.981113/
debian/rules binary	|& tee odrb

mv -v /usr/src/tetex-nonfree*deb /usr/src/.debs/
apt-update
apti tetex-nonfree




#######
#
# metapost
#
#######

# (find-fline "~/MP/arrow.mp")
cd ~/MP/
mp arrow.mp
gv -watch arrow.1





############
#
# minha tese
#
############

# (find-fline "$SCTAN/macros/latex/contrib/other/proof/proof.sty")
# (find-fline "$SCTAN/macros/latex/contrib/other/proof/proofeg.tex")

export TESE=tese1
export TESE=categs
export DISPLAY=:0.0
xdvi ~/LATEX/$TESE.dvi &

cd ~/LATEX/
latex $TESE.tex

cd ~/LATEX/
dvips -D300 -o$TESE.ps $TESE.dvi

# (find-node "(zsh)Filename Generation" "<x-y>")
# (find-node "(mtools)mcopy" 40)

cd ~/LATEX/
rm $TESE.p<->
gs -sDEVICE=djet500 -r300 -sOutputFile=$TESE.p%02d -dNOPAUSE -dBATCH $TESE.ps
zip pr.zip $TESE.p<->

mcopy pr.zip a:

cd ~/LATEX/
rm -v $TESE.{log,aux,ps,p<->} pr.zip *.tgz
tar -cvzf tese.tgz *

mcopy tese.tgz ~/CRIM/008ideas ~/ZHTML/escripts/tex.e a:





#######
#
# rail
#
#######

rm -Rv /usr/src/rail/
cd /usr/src/
tar -xvzf $CTAN/support/rail.tar.gz
cd /usr/src/rail/
# (find-fline "/usr/src/rail/")
make |& tee om




############
#
# xypic 3.6
#
############

cd /usr/src/
rm -Rv xy-3.6
tar -xvzf /snarf/ftp/ftp.ens-lyon.fr/pub/users/LIP/krisrose/TeX/xy36src.tar.gz
tar -xvzf /snarf/ftp/ftp.ens-lyon.fr/pub/users/LIP/krisrose/TeX/xy36doc.tar.gz
cd /usr/src/xy-3.6/
tar -xvzf /snarf/ftp/ftp.ens-lyon.fr/pub/users/LIP/krisrose/TeX/qsymbols.tar.gz

# (find-xy36file "INSTALL" "UN*X\n----")
# (find-xy36file "Makefile")

cd /usr/src/xy-3.6/src/
make TDSROOT=/usr/lib/texmf/texmf all |& tee om
make TDSROOT=/usr/lib/texmf/texmf install |& tee omi
make TDSROOT=/usr/lib/texmf/texmf GAWK=gawk TAGS |& tee omT
texhash

cd /usr/src/xy-3.6/src/
cp -v /usr/src/latex2html/texinputs/* .
cp -v ~/xysource.man .
echo -n > version.tex
latex xyguide.man

# (find-xy36file "xyrefer.man")

#  Kernel:
# (find-xy36file "xy.doc")

#  Extensions:
# p.20 (find-xy36file "xycurve.doc")
# p.24 (find-xy36file "xyframe.doc")
# p.27 (find-xy36file "xytips.doc")
# p.27 (find-xy36file "xyline.doc")
# p.29 (find-xy36file "xyrotate.doc")
# p.30 (find-xy36file "xycolor.doc")
# p.31 (find-xy36file "xytile.doc")
# p.33 (find-xy36file "xyimport.doc")
# p.34 (find-xy36file "xymovie.doc")
# p.34 (find-xy36file "xyps.doc")
# p.36 (find-xy36file "xytpic.doc")
# p.37 (find-xy36file "xyemtex.doc")

#  Features:
# p.37 (find-xy36file "xyall.doc")
# p.37 (find-xy36file "xydummy.doc")
# p.37 (find-xy36file "xyarrow.doc")
# p.43 (find-xy36file "xy2cell.doc")
# p.47 (find-xy36file "xymatrix.doc")
# p.50 (find-xy36file "xygraph.doc")
# p.53 (find-xy36file "xypoly.doc")
# p.56 (find-xy36file "xyweb.doc")
# p.57 (find-xy36file "xyarc.doc")
# p.61 (find-xy36file "xyknot.doc")

#  Pulei o resto do manual. Quanto aos DOCMODEs,
#
# (find-xy36file "xydoc.sty" "\\inputdoc <type>")
# (find-xy36file "xydoc.sty" "where each <mode>")


#
# ! TeX capacity exceeded, sorry [main memory size=263001].!
#
latex xyrefer.man
#
# (find-web2cfile "tex.web" "capacity exceeded, sorry")
# (find-web2cfile "tex.web" "  overflow(\"m")
# (find-web2cfile "tex.web" "\noverflow(\"m")
#
# (find-xy36file "MAKE" "extra_mem_top")
# (find-xy36file "MAKE" "LARGE TeX")

# (find-xy36tag "\\ar{")

# (find-xy36file "Makefile" "OPTIONSOURCES")
# (find-xy36file "Makefile" ".dvips.dvi")
# (find-xy36file "Makefile" ".man.dvips")
# (find-xy36file "Makefile" "xyrefer.man")
# (find-xy36file "Makefile" "xysource.man")

# cd /usr/src/xy-3.6/src/
# sh install-tds |& tee oshi

# (find-xy36file "INSTALL")
# (find-xy36file "MAKE")
# (find-xy36file "README")
# (find-xy36file "TRAILER")

cd /usr/src/xy-3.6/src/
cp -iv /usr/src/latex2html/texinputs/* .
cp -iv ~/xysource.man .
make GAWK=gawk TeXnical		|& tee omT

# (find-xy36file "xydoc.sty" "TeXnical")
# (find-xy36file "xydoc.sty" "html")

cd /usr/src/xy-3.6/src/
cp -iv /usr/src/latex2html/texinputs/html.sty .
latex '\input xydoc.sty \inputdoc2{xyweb.doc}'

cd ~/LATEX/
latex xytest.tex
# (find-fline "~/LATEX/xytest.tex")







###########
#
# LaTeX kernel: generating source2e.dvi (kernel docs)
#
###########

# (find-lsrcfile "base/manifest.txt")
# (find-lsrcfile "base/texpert.txt" "source2e.tex")
# (find-lsrcfile "base/source2e.tex" "latex source2e.tex")

# Index:
# (find-lsrcfile "base/source2e.ind")
cd /usr/lib/texmf/source/latex/base/
agrep '\{part\}...hspace' source2e.toc

# Compiling:
cd /usr/lib/texmf/source/latex/base/
latex source2e.tex
makeindex -s source2e.ist source2e.idx
makeindex -s gglo.ist -o source2e.gls source2e.glo
latex source2e.tex
latex source2e.tex	|& tee ols

xdvi /usr/lib/texmf/source/latex/base/source2e.dvi &

# Índice das seções:

# (find-lsrcfile "base/ols")
# (find-pl5pod "var" "undef $/;")
cd /usr/lib/texmf/source/latex/base/
grep -v '^\*' ols | perl -e '
  undef $/; $ols = <STDIN>;
  $i = 0;
  @letras = split(//, " abdefghiklmnopqrstuwyzABCDEFGHIJKLMNO  ");
  # @letras = split(//, " abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNO  ");
  while ($ols =~ m/\(([a-z0-9.]*)[ \n]\[([0-9]*)\]/g) {
    # print "$1 $2\n";
    printf "%1s %12s %3d\n", $letras[$i++], $1, $2;
  }
' | tee olss

grep 'part.*hspace' source2e.toc
grep 'part.*hspace' source2e.toc | cut -b 22,30,36- |
  perl -nle 'm/^(.*?)\}/ && print $1' | tee oletras






latex classes.dtx

export DISPLAY=:0.0
xdvi /usr/lib/texmf/source/latex/base/source2e.dvi &
xdvi /usr/lib/texmf/source/latex/base/classes.dvi &

# verbatim: p.212=221.
# (find-lsrcfile "base/ltmiscen.dtx" 564)

# (find-fline "/usr/lib/texmf/texmf/tex/plain/base/plain.tex" 42)
# (find-fline "/usr/lib/texmf/texmf/tex/plain/base/plain.tex" 1231)




###########
#
# LaTeX kernel: generating latex.ltx
#
###########

# Note: I still haven't found anything like a `makefile' where this
# gets automated, but I think I'm getting pretty close to the original
# method.

# (find-lsrcfile "base/manifest.txt" "unpack.ins")
# (find-lsrcfile "base/unpack.ins")
# (find-lsrcfile "base/format.ins" "file{latex.ltx}")
#
cd /usr/lib/texmf/source/latex/base/
yes n | initex unpack.ins |& tee o




###########
#
# .dtx -> .dvi in the general case
#
###########

# (find-lsrcfile "base/docstrip.dtx" 179)
# (find-lsrcfile "base/docstrip.dtx" 932)
# (find-lsrcfile "base/docstrip.ins")
# (find-lsrcfile "base/docstrip.ins" 166)
# (find-lsrcfile "base/doc.dtx" "abstract")
# (find-lsrcfile "base/ltxdoc.dtx" 82)

cd /usr/lib/texmf/source/latex/base/
latex docstrip.ins
makeindex -s docstrip.ist docstrip.aux

cat <<'EOF' | latex |& tee ol
\def\batchfile{keywords.ins}
\input docstrip.tex
\generateFile{keywords.ist}{f}{\from{keywords.dtx}{index}}
\endinput
EOF

# (find-fline "/usr/lib/texmf/source/latex/progkeys/keywords.dtx" 9)
# (find-fline "/usr/lib/texmf/source/latex/progkeys/keywords.dtx" 478)
# (find-fline "/usr/lib/texmf/source/latex/progkeys/Makefile.tetex")
# (find-fline "/usr/lib/texmf/source/latex/progkeys/keywords.ins" 43)
#
cd /usr/lib/texmf/source/latex/progkeys/
#
cat <<'EOF' | latex |& tee ol
\def\batchfile{keywords.ins}
\input docstrip.tex
\generateFile{keywords.drv}{f}{\from{keywords.dtx}{driver}}
\generateFile{keywords.sty}{f}{\from{keywords.dtx}{style}}
\generateFile{keywords.ist}{f}{\from{keywords.dtx}{index}}
\endinput
EOF
#
latex keywords.drv
latex keywords.drv
latex keywords.drv
makeindex -s keywords.ist keywords.idx
latex keywords.drv

# AFAIremember, the general case doesn't work.





########
#
# pstricks
#
########

rm -Rv $CTAN/graphics/pstricks/
cd $CTAN/graphics/
tar -xvzf pstricks.tar.gz
gzip -dv $(find pstricks -name '*.gz')

gv $CTAN/graphics/pstricks/origdoc/pst-quik.ps &
gv $CTAN/graphics/pstricks/origdoc/pst-usr1.ps &
gv $CTAN/graphics/pstricks/origdoc/pst-usr2.ps &
gv $CTAN/graphics/pstricks/origdoc/pst-usr3.ps &
gv $CTAN/graphics/pstricks/origdoc/pst-usr4.ps &

cd $CTAN/graphics/pstricks/origdoc/

# (find-pstfile "src.old/pst-user.tex")
# (find-pstfile "src.old/pst-user.sty" 199)
# (find-pstfile "src.old/pstricks.doc")
# (find-pstfile "src.old/pst-make.tex")
# (find-pstfile "src.old/pst-code.tex")

# (find-fline "~/PS/pst1.tex")

# (find-lsrcfile "base/doc.dtx" "abstract")
# (find-lsrcfile "base/doc.dtx" "produce the documentation")
# (find-lsrcfile "base/ltxdoc.dtx" 82)
# (find-fline "/usr/lib/texmf/texmf/tex/latex/base/doc.sty")






########
#
# teTeX
#
########

rpm -iv $RS/tetex-0.4pl8-5.src.rpm
cd $RSP
rpm -bp tetex-0.4pl8.spec |& tee obp-tetex
rpm -bc tetex-0.4pl8.spec |& tee obc-tetex

# (find-specfile "tetex-0.4pl8.spec" 138)

cd /usr/src/redhat/BUILD/teTeX-src-0.4
export X_EXTRA_LIBS='-lSM -lICE'
make RPM_OPT_FLAGS="-O2 -m486 -fno-strength-reduce" config clean |& tee o1
make RPM_OPT_FLAGS="-O2 -m486 -fno-strength-reduce" texhash all |& tee o2

# (find-web2cfile "tex/tex.p" 42)
# (find-web2cfile "tex/tex0.c" 388)

# Use M-x what-line.
# (find-web2cfile "tex/tex.web" 1894)

(find-etag "line-number-mode")





###########
#
# fixing the executables after installing the source
#
###########

rpm -iv -h --force	\
	$RP/tetex-0.4pl8-5.i386.rpm	\
	$RP/tetex-dvips-0.4pl8-5.i386.rpm	\
	$RP/tetex-latex-0.4pl8-5.i386.rpm	\
	$RP/tetex-xdvi-0.4pl8-5.i386.rpm	\
	$RP/texinfo-3.9-1.i386.rpm

rpm -iv -h --force	\
	$RP/tetex-texmf-src-0.4pl8-5.i386.rpm




###########
#
# MetaPost (weave docs, teTeX 0.4)
#
###########

# (find-web2cfile "mp/README")

cd $RBU/teTeX-src-0.4/kpse-2.6/web2c/mp/
weave mp.web mp.ch |& tee owch
mv mp.tex mpch.tex
tex mpch.tex |& tee otch
weave mp.web mp.ch |& tee owch
tex mp.tex |& tee ot

cd $RBU/teTeX-src-0.4/kpse-2.6/web2c/mpware/
weave dvitomp.web
tex dvitomp.tex





########
#
# (lixo?)
#
########

# (find-fline "/usr/lib/texmf/source/latex/misc/epsf.sty")
# (find-fline "/usr/lib/texmf/texmf/tex/generic/dvips/epsf.sty")
# (find-fline "/usr/lib/texmf/texmf/tex/generic/dvips/epsf.tex")
# (find-fline "/usr/lib/texmf/texmf/tex/generic/dvips/epsf.tex" 74)

diff /usr/lib/texmf/source/latex/misc/epsf.sty \
/usr/lib/texmf/texmf/tex/generic/dvips/epsf.tex

# (find-fline "/usr/lib/texmf/texmf/tex/plain/misc/xepsf.tex")

# (find-fline "/usr/lib/texmf/texmf/dvips/config/config.epsf")






#####################
#
# .fmt files for TeX
# (with portuguese hyphenation)
#
#####################

# Debian:

xdvi /usr/lib/texmf/doc/generic/babel/user.dvi
# (find-fline "/usr/lib/texmf/doc/generic/babel/")
# (find-fline "/usr/lib/texmf/doc/generic/babel/install.txt" 55)
# (find-fline "/usr/lib/texmf/source/generic/babel/")
# (find-fline "/usr/lib/texmf/source/generic/babel/babel.dtx")
# (find-fline "/usr/lib/texmf/source/generic/babel/language.dat")
# (find-fline "/etc/texmf/language.dat")

# (find-fline "/usr/lib/texmf/source/generic/babel/babel.dtx" "with an equals")
# (find-fline "/usr/lib/texmf/tex/generic/babel/portuges.sty")

# (find-fline "/usr/lib/texmf/tex/generic/babel/")
# (find-fline "/usr/lib/texmf/tex/generic/hyphen/")
# (find-fline "/usr/lib/texmf/tex/generic/hyphen/pthyph.tex")
# (find-fline "/usr/lib/texmf/tex/generic/babel/hyphen.cfg")

# (find-vldifile "")
# (find-vldifile "tetex-base.postinst" "Running initex")
# (find-fline "/usr/bin/texconfig")

/usr/bin/texconfig init |& tee ~/o
# (find-fline "~/o")


/usr/lib/texmf/doc/help/faq/uktug-faq/texfaq_toc.html

# (find-fline "/usr/lib/texmf/doc/tetex/teTeX-FAQ")

# Old stuff:

# (find-fline "/usr/lib/texmf/texmf/doc/generic/babel/install.txt" 55)
# (find-fline "/usr/lib/texmf/texmf/tex/generic/config/language.dat" 41)

initex 'lplain'\
  '\usepackage{amsmath}'\
  '\usepackage{amsfonts}'\
  '\usepackage[cp850]{inputenc}'\
  '\dump' |& tee o

mv lplain.fmt lamsp.fmt

lamsptex teste.tex

# (find-node "(zsh)Quoting" 7)




###########
#
# tese do Maurício
#
###########

cd ~/mauricio/
fig2dev -L ps fig0.fig > fig0.eps
fig2dev -L ps fig1.fig > fig1.eps
fig2dev -L ps fig2.fig > fig2.eps
fig2dev -L ps fig3.fig > fig3.eps
fig2dev -L ps fig4.fig > fig4.eps
fig2dev -L ps fig5.fig > fig5.eps
fig2dev -L ps fig6.fig > fig6.eps
fig2dev -L ps fig7.fig > fig7.eps
fig2dev -L ps fig8.fig > fig8.eps
fig2dev -L ps fig9.fig > fig9.eps
fig2dev -L ps fig10.fig > fig10.eps
fig2dev -L ps fig11.fig > fig11.eps
fig2dev -L ps fig12.fig > fig12.eps
fig2dev -L ps fig13.fig > fig13.eps
fig2dev -L ps fig14.fig > fig14.eps
fig2dev -L ps fig15.fig > fig15.eps
fig2dev -L ps fig16.fig > fig16.eps
fig2dev -L ps fig17.fig > fig17.eps
fig2dev -L ps fig18.fig > fig18.eps

cd ~/mauricio/
latex blank1.tex
latex blank1.tex
latex blank1.tex
dvips -o blank1.ps blank1.dvi

export DISPLAY=:0.0
gv blank1.ps

rm blank1.zip
zip blank1.zip blank1.tex caixa.tex fig<1-19>.{fig,eps} blank1.ps
mcopy -mnot    blank1.tex caixa.tex fig<1-19>.{fig,eps} blank1.ps a:
mcopy -mno blank1.zip a:


unzip -o blank1.fev9.zip blank1.tex
mv -v blank1.tex blank1.fev9.tex
mcopy -nt a:blank1.tex blank1.fev15.tex
diff blank1.fev9.tex blank1.fev15.tex




# (find-xfigfile "Doc/FORMAT3.1")
# (find-xfigfile "Doc/FORMAT3.1" 315)
# (find-xfigfile "Doc/FORMAT3.1" 171)
# (find-xfigfile "Doc/FORMAT3.1" 386)
# (find-fline "~/mauricio/fig13b.fig" 135)
# (find-fline "~/mauricio/blank1.tex" 1197)

cd ~/mauricio/
for i in {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}
do
  ~/ICON/mauricio < fig$i.fig | fig2dev -L ps > fig$i.eps
done
#
cd ~/mauricio/
latex blank1.tex
dvips -o blank1.ps blank1.dvi

cd ~/mauricio/
for i in {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}
do
  fig2dev -L ps < fig$i.fig > fig$i.eps
done
#
cd ~/mauricio/
latex blank1.tex
dvips -o blank1.ps blank1.dvi



cd ~/mauricio/
for i in {1,2,3,4,5,6,7,8}
do
  ~/ICON/mauricio < fig$i.fig > fig$i.a.fig
  mv fig$i.a.fig fig$i.fig
done


rm blank1.zip
zip blank1.16fev.v2.zip blank1.tex caixa.tex fig<1-19>.{fig,eps} blank1.ps


# mcopy a:blank1.zip a.zip
# unzip -l a.zip

# (find-node "(mtools)mcopy" 40)

gs -sDEVICE=djet500 -r300 -sOutputFile=p%02d -dNOPAUSE -dBATCH blank1.ps
zip pa.zip p0?
zip pb.zip p1?
zip pc.zip p2?
zip pd.zip p3?
mcopy pa.zip a:
mcopy pb.zip a:
mcopy pc.zip a:
mcopy pd.zip a:

rm p[0-9][0-9] p[a-d].zip







###########
#
# xfig
#
###########

xfig fig6.fig
fig2dev -L ps fig6.fig > fig6.eps

fig2dev -L latex

# (find-fline "/big/rpmcontents" 35063)
# (find-xfigfile "Doc/FORMAT3.1")

man xfig
# 1801: SELECTING OBJECTS




###########
#
# getting a CTAN subdirectory (pstricks)
#
###########

cd $CTAN/graphics/
wget ftp://ftp.rge.com/pub/tex/graphics/pstricks.tar.gz

cd $CTAN/graphics/
rm -Rv pstricks
tar -xvzf pstricks.tar.gz
gzip -dv $(find pstricks)

mkdir -p $CTAN/fonts/
cd       $CTAN/fonts/
wget ftp://ftp.rge.com/pub/tex/fonts/ascii.tar.gz
mkdir -p $CTAN/fonts/utilities/
cd       $CTAN/fonts/utilities/
wget 	ftp://ftp.rge.com/pub/tex/fonts/utilities/a2ac.tar.gz	\
	ftp://ftp.rge.com/pub/tex/fonts/utilities/ega2mf.tar.gz
mkdir -p $CTAN/help/Catalogue/
cd       $CTAN/help/Catalogue/
wget 	ftp://ftp.rge.com/pub/tex/help/Catalogue/catalogue.html.gz	\
	ftp://ftp.rge.com/pub/tex/help/Catalogue/ctfull.html.gz	\
	ftp://ftp.rge.com/pub/tex/help/Catalogue/ctindex.html

ps2mf
mff-29
MF-PS
metafont-for-beginners

moredefs
morehelp
phonet
picins
proofs
pslatex
pstotext
rail
rlepsf
rmpage
rsfs
saferef
schedule
semantic
showlabels
simpsons
smallcap
sobolev
startex
stmaryrd
subeqn
subeqnarray
subfigure
swift
syngen
syntonly
tensor
theorem
thumb
time
times
tipa
titleref
twg-list
typehtml
uniqleaf
varioref
verbatim
word2x
wsuipa
xr
xspace





#############
#
# xypic docs
#
#############

export DISPLAY=:0.0
xdvi /usr/lib/texmf/texmf/doc/generic/xypic/xyguide.dvi &
xdvi /usr/lib/texmf/texmf/doc/generic/xypic/xyrefer.dvi &
xdvi ~/XYPIC/0.dvi &


cd /usr/lib/texmf/texmf/doc/generic/xypic/
if [ ! -f xyguide.ps ] ; then dvips -o xyguide.ps xyguide.dvi ; fi
if [ ! -f xyrefer.ps ] ; then dvips -o xyrefer.ps xyrefer.dvi ; fi

export DISPLAY=:0.0
# gv /usr/lib/texmf/texmf/doc/generic/xypic/xyguide.ps &
# xdvi -geometry 1000x1500+0+0 /usr/lib/texmf/texmf/doc/generic/xypic/xyguide.dvi &
xdvi /usr/lib/texmf/texmf/doc/generic/xypic/xyguide.dvi &

export DISPLAY=:0.0
# gv /usr/lib/texmf/texmf/doc/generic/xypic/xyrefer.ps &
# xdvi -geometry 1000x1500+0+0 /usr/lib/texmf/texmf/doc/generic/xypic/xyrefer.dvi &
xdvi /usr/lib/texmf/texmf/doc/generic/xypic/xyrefer.dvi &

# (find-fline "~/XYPIC/1.tex")

cd /usr/lib/texmf/source/generic/xypic/src/
agrep \\.doc xyrefer.tex
agrep '\([0-9]\,' *.doc *.tex
l `agrep -l '\([0-9]\,' *.doc *.tex`

cd /usr/lib/texmf/source/generic/xypic/src/
agrep 'section\{' $(<.reffiles)

cd /usr/lib/texmf/source/generic/xypic/src/
mycat $(<.reffiles)


# Minhas dúvidas sobre placement e labels são respondidas no xyrefer,
# pp.8--11 (na 11, a nota 3p).

# (find-xyfile "xy.doc" "\\section{Positions}")

# (find-fline "/usr/lib/texmf/source/generic/xypic/src/xyguide.tex")
# (find-fline "/usr/lib/texmf/source/generic/xypic/src/xyrefer.tex")

cd
rm -Rv /usr/lib/texmf/source/generic/xypic/src
rpm -iv --force $RP/tetex-texmf-src-0.4pl8-5.i386.rpm

make guide |& tee o

# Broken; the author says to use the .ps's.





############
#
# mf with X support, old notes
#
############

# (...notes specific to the crappy RedHat distro deleted.)

cd ~/MF/
cat > beg.mf <<EOF
beginchar(incr code,10pt#,10pt#,0);
pickup pencircle scaled .3pt; draw unitsquare scaled w;
pickup pencircle scaled 1pt;
for k=1 upto 100:
  drawdot(uniformdeviate w, uniformdeviate w);
endfor;
showit;
EOF

export DISPLAY=:0.0
mf \&plain beg.mf
# then type `endchar. bye'.

mf '\\mode:=ljfour; mag:=1; screen_rows := 100; screen_cols := 100; input beg.mf; '

# (find-fline "/usr/lib/texmf/texmf/metafont/misc/modes.mf" 869)

# (find-fline "/etc/texmf/modes.mf" "one pixel one point")
# (find-fline "/etc/texmf/modes.mf" "screen_rows :=")
# (find-fline "/usr/lib/texmf/metafont/base/plain.mf")
# (find-fline "/usr/lib/texmf/metafont/base/plain.mf" "openwindow currentwindow")

# I remeber vaguely that mf has an "ascii cheapo" device that outputs
# a matrix of asterisks; how can I use it?

# Note: mf opens a giant window and doesn't display anything. Aaargh!@#$!





#######
#
# metafont with X support (slink)
# 99aug31
#
#######

# (find-vldifile "tetex-bin.list" "mf.X")
# (find-vldifile "" "tetex-bin.list")
# (find-fline "/usr/doc/tetex-bin/")

# (find-knuthfile "mf/mfbook.tex" "Chapter 23. Online\\\\Displays")
# (find-knuthfile "mf/mfbook.tex" "Appendix E. Examples")
xdvi $SCTAN/systems/knuth/mf/mfbook.dvi +204 &
xdvi $SCTAN/systems/knuth/mf/mfbook.dvi +314 &


cd /tmp/
mf '\mode=lowres; input logo10'

cp /usr/bin/mf.X /tmp/mf
cd /tmp/
cat > beg.mf <<EOF
beginchar(incr code,10pt#,10pt#,0);
pickup pencircle scaled .3pt; draw unitsquare scaled w;
pickup pencircle scaled 1pt;
for k=1 upto 10:
  drawdot(uniformdeviate w, uniformdeviate w);
endfor;
showit;
EOF
(sleep 3; kill $(pidof mf)) &
# (sleep 10; kill $(pidof X)) &
./mf '\screen_width:=100; screen_depth:=200; screenstrokes; input beg.mf; bye'
# ./mf '\screen_rows:=40; screen_cols:=50; screenstrokes; input beg.mf; bye'





######
#
# Inspecting Metafont's X support code
# 99aug31
#
######

# (code-c-d "texbin" "/usr/src/tetex-bin-0.9.981113/")

pdsc /big/slinks2/dists/slink/main/source/tex/tetex-bin_0.9.981113-2.dsc
cd /usr/src/tetex-bin-0.9.981113/
find * > .files

# (find-texbinfile "")
# (find-texbinfile ".files")
# (find-texbinfile "texk/web2c/")
# (find-texbinfile "texk/web2c/window/")
# (find-texbinfile "texk/web2c/mf.web")
# (find-texbinfile "texk/web2c/mf.web" "Online graphic output.")
# (find-texbinfile "texk/web2c/window/x11-Xt.c")
# (find-texbinfile "texk/web2c/window/x11-Xt.c" "mf_x11_initscreen")
# (find-node "(web2c)Online Metafont graphics" "`Metafont'")

cd $(gnudoit texbindir)texk/web2c/
# agrep screen_col $(find *)
# agrep screen_row $(find *)
# agrep screen_ $(find *)
# agrep _screen $(find *)
agrep initscreen $(find *)


# Weaving the .web sources:
#
rm -Rv /tmp/mfprog/
mkdir  /tmp/mfprog/
cd $(gnudoit texbindir)texk/web2c/
cp -v mf.web mf.ch /tmp/mfprog/

cd /tmp/mfprog/
weave mf.web mf.ch
mv mf.tex mf-ch.tex
mv mf.log mf-ch.log
tex mf-ch.tex
mv CONTENTS.tex CONTENTS-ch.tex

weave mf.web
tex mf.tex

xdvi mf-ch.dvi &
xdvi mf.dvi &

# (find-fline "/tmp/mfprog/")
# (find-fline "/tmp/mfprog/mf.tex")
# (find-fline "/tmp/mfprog/mf.tex" "\\:\\X")
# (find-fline "/tmp/mfprog/mf-ch.tex")
# (find-fline "/tmp/mfprog/mf-ch.tex" "\\:\\X")




strace-to ~/s mf '\mode=lowres; input logo10'

# (find-fline "/usr/lib/texmf/web2c/texmf.cnf")
# (find-fline "/var/lib/texmf/web2c/texmf.cnf")
# (find-fline "/etc/texmf/texmf.cnf")

diff /usr/lib/texmf/web2c/texmf.cnf /var/lib/texmf/web2c/texmf.cnf
diff /etc/texmf/texmf.cnf /var/lib/texmf/web2c/texmf.cnf






###########
#
# MetaPost (docs)
#
###########

# (find-mpfile "INDEX")
# (find-mpfile "manfig.mp")

export DISPLAY=:0.0
cd /usr/lib/texmf/texmf/doc/metapost/
make DVIPS='dvips -Pold'
gv mpman.ps
# Setas na p.36 e da p.56 em diante.

export DISPLAY=:0.0
cd /usr/lib/texmf/texmf/doc/metapost/
gv mpman.ps

gv mpgraph.ps
gv grdemo.ps

# % \input epsf.tex
# \usepackage{epsf}
# $$\epsfbox{fig.1}$$

# (find-node "(dvips)EPSF Macros")
# (find-fline "/usr/lib/texmf/texmf/tex/latex/graphics/epsfig.sty")
# (find-fline "/usr/lib/texmf/source/latex/graphics/epsfig.dtx")
# (find-fline "/usr/lib/texmf/source/latex/graphics/epsfig.dtx" "epsf.tex")

# Boxes:
kpsewhich mp boxes.mp
# (find-fline "/usr/lib/texmf/texmf/metapost/base/boxes.mp")

kpsewhich tex epsf.sty
kpsepath latex

# (find-fline "/usr/lib/texmf/texmf/metapost/base/plain.mp" 421)

# Roubar o código de setas de alguma fonte do TeX (ams, talvez)
# Escrever o script que usa o testfont.

# (find-fline "/usr/lib/texmf/texmf/tex/plain/base/testfont.tex")

# (find-fline "/usr/lib/texmf/texmf/tex/plain/misc/mproof.tex")




###########
#
# Proofing a font
#
###########

cd /MP
mf cmr10
gftodvi cmr10.2602gf

export DISPLAY=:0.0
xdvi -p 300 cmr10.dvi

# The gray font is broken by default, so
# take a look at missfont.log (on the current directory) and

MakeTeXPK gray 600 600 1+0/600 ljfour

# It is trying to produce a gray font for an "imagen". What is it?

# (find-fline "/usr/lib/texmf/texmf/fonts/source/public/misc/gray.mf")
# (find-fline "/usr/lib/texmf/texmf/ls-R")
# (find-fline "/usr/lib/texmf/texmf/metafont/misc/")
# (find-fline "/usr/lib/texmf/texmf/metafont/misc/modes.mf" 869)
# (find-fline "/usr/bin/MakeTeXPK" 104)
# (find-fline "/usr/lib/texmf/texmf/metafont/misc/modes.mf" 1591)
# (find-fline "/usr/lib/texmf/texmf/metafont/misc/modes.mf" 2303)

(write-heredoc "~/MP/grayljfour.mf")
if mode<>ljfour: errmessage "This file is for ljfour only"; fi
rep=5; boolean large_pixels;
font_identifier "GRAYLJFOUR";
input grayf
EOF

cd ~/MP/
rm /var/lib/texmf/fonts/pk/ljfour/gnu/raleigh/grayljfour.600pk
MakeTeXPK grayljfour 600 600 1+0/600 ljfour

# Quem decide o diretório do pk? E o tfm novo, é sempre escrito? Como
# a fonte vai mudar muito eu quero apagar sempre o tfm velho. Onde ele
# está?




#########
#
# psfrag
#
#########

# (find-fline "/usr/lib/texmf/source/latex/psfrag/announce.txt" "overlay")





###########
#
# Kpathsea search
#
###########

(find-node "(kpathsea)Top")
(find-fline "/usr/lib/texmf/texmf.cnf")

(find-node "(kpathsea)Slow path searching")
(find-node "(kpathsea)Debugging")
(find-node "(kpathsea)Filename database")

kpsewhich -n tex tex epsf.tex

# How can I make emacs use kpathsea to get the full path for a filename?
# (find-node "(elisp)Synchronous Processes")





#####
#
# kpathsea debugging
#
#####

# (find-node "(kpathsea)Debugging")
# TeX finds the lilypond .texs but LaTeX doesn't.
#
export KPATHSEA_DEBUG=63
tex '\input lilyponddefs'   |& tee ot
latex '\input lilyponddefs' |& tee ol
#
# I guess the .texs are being installed at the wrong place (in my system).
#
# kdebug:  before expansion = $KPSE_DOT:$TEXMFS/tex{/plain,/generic,}//
# kdebug:  before expansion = $KPSE_DOT:$TEXMFS/tex/{latex,latex209,generic}//
#
# (find-fline "/usr/lib/texmf/texmf.cnf" 62)

Eu copiei o diretório /usr/lib/texmf/texmf/..lily.. para um lugar
acessivel pelo latex e rehasheei.

(find-lilyfile "bin/make-website.pl")
(find-lilyfile "bin/out/make-website" 88)
(find-lilyfile "bin/out/make-website" 114)
(find-lilyfile "bin/out/make-website" 157)
(find-lilyfile "input/wtk1-fugue2.ly")
(find-lilyfile "input/wtk1-fugue2.ly")
(find-lilyfile "Documentation/out/wtk1-fugue2.ly.txt")





#########
#
# ega2mf
#
#########

cd /usr/src/
rm -Rv ega2mf
tar -xvzf $CTAN/fonts/utilities/ega2mf.tar.gz
cd ega2mf
gzip -dv *
gcc -o ega2mf ega2mf.c
gcc -o vga2mf vga2mf.c

# (find-fline "/c5/home/BUP/PROgLOJA/vga437t.mf")
# (find-fline "/c5/home/BUP/PROgLOJA/vga437t0.mf")
# (find-fline "/c5/home/BUP/PROgLOJA/vga850.mf")
# (find-fline "/c5/home/BUP/PROgLOJA/vgasqdot.mf")

# Name of the .gf file: <jobname>.<resolution>gf; MFbook p.324, MFprog
# block 1164.
#
# p.277 (find-knuthfile "mf/mfbook.tex" "|screenchars|.")
# (find-fline "/usr/lib/texmf/texmf/metafont/base/plain.mf" "z@#")

## Eu modifiquei o vga2mf à beça, ele não tem mais pickups, usa chars
## 8x8 e isso é o header novo:

% This is vga850.mf generated by vga8tomf from /home/replace/ega1.8.
if unknown cmbase: input cmbase fi
mode_setup;
def generate suffix t= enddef;
input cmtt10; font_setup;
if ligs>1: font_coding_scheme:="TeX text";
else: font_coding_scheme:=if ligs=0: "TeX typewriter text"
  else: "TeX text without f-ligatures" fi; fi

def corner(expr row,col) =
  ((col/8)[0, 9u],
   (row/8)[body_height, -desc_depth])
enddef;
def crt(expr row,col) =
  numeric x[],y[];
  z0=corner(row,col);
  z1=corner(row+1,col+1);
  fill (x0,y0)--(x0,y1)--(x1,y1)--(x1,y0)--cycle;
enddef;

## Todas as outras coisas importantes foram parar dentro de uma
## Makefile:

SRCDIR = /usr/lib/texmf/texmf/fonts/source/vga
PKDIR  = /var/lib/texmf/fonts/pk/ljfour/unknown/unknown
PK600  = $(PKDIR)/vga850.600pk

vga8tomf: vga8tomf.c
	gcc -o vga8tomf vga8tomf.c

vga850.mf: vga8tomf
	vga8tomf /home/replace/ega1.8 vga850.mf

font0:
	-rm -Rv  $(SRCDIR)
	-mkdir -p $(SRCDIR)
	cd       $(SRCDIR)/
	#
	-rm -v $(SRCDIR)/vga850.mf
	-ln -s ~/LATEX/vga850.mf $(SRCDIR)/vga850.mf
	texhash

fonttfm:
	-rm -Rv /usr/lib/texmf/texmf/fonts/tfm/public/vga
	-mkdir  /usr/lib/texmf/texmf/fonts/tfm/public/vga
	-rm -v  /var/lib/texmf/fonts/tfm/unknown/unknown/vga850.tfm
	MakeTeXTFM vga850

clearpks:
	-rm -v $(PKDIR)/vga850*pk

btype:
	mf '\mode:=ljfour; mag:=1; scrollmode; input vga850b'
	gftype -i vga850b.600gf

$(PK600): vga850.mf
	-rm -v $(PK600)
	MakeTeXPK vga850 600 600 1.0

font600: $(PK600)

##
##

# (find-fline "/usr/lib/texmf/texmf/fonts/source/vga/vga850.mf")
# (find-fline "~/LATEX/vga850.mf")
# (find-fline "$CTAN/systems/knuth/mf/mfbook.tex" "^@beginchar@")





###########
#
# pstricks (remaking)
#
###########

# (code-c-d "pst" "/usr/src/pstricks/")

rm -Rv /usr/src/pstricks
cd /usr/src/
cp -dipvR $CTAN/graphics/pstricks .

cd /usr/src/pstricks

cd /usr/src/pstricks/src.old/
# (find-pstfile "src.old/pst-user.tex")
# (find-pstfile "src.old/pst-user.sty")
cp -iv /usr/lib/texmf/texmf/tex/latex/base/article.sty art12.sty

# (find-pstfile "src.old/pst-user.sty")
# (find-pstfile "src.old/art12.sty")
# (find-pstfile "src.old/npsfont.sty")
# (find-pstfile "src.old/pst-user.sty" 93)
# (find-pstfile "src.old/pst-user.log")

cd /usr/src/pstricks/origdoc/
# Logotipos do Denis Girou; só dá pra ver com o gv.
tex denis1.tex
dvips -o denis1.ps denis1.dvi
gv denis1.ps

tex denis2.tex
dvips -o denis2.ps denis2.dvi
gv denis2.ps

latex samples.tex
dvips -o samples.ps samples.dvi
gv samples.ps





######
#
# stmaryrd / testfont
#
######

#  «testfont»

cd /usr/lib/texmf/fonts/source/public/stmary/
agrep cmchar *.mf
# (find-fline "/usr/lib/texmf/tex/latex/misc/stmaryrd.sty")

cd /usr/lib/texmf/fonts/source/
agrep cmchar $(find * -name '*.mf')

# (find-knuthfile "mf/mfbook.tex" "The last line of |testfont| is")
# (find-fline "/usr/lib/texmf/tex/plain/base/testfont.tex")

tex '\let\noinit! \input testfont.tex'\
    '\def\fontname{bbmbx10}\startfont\table'\
    '\def\fontname{stmary10}\startfont\table'\
    '\def\fontname{msam10}\startfont\table'\
    '\bye'

tex '\let\noinit! \input testfont.tex'\
    '\def\Test#1{\def\fontname{#1}\startfont\table}'\
    '\Test{bbmbx10}'\
    '\Test{stmary10}'\
    '\Test{msam10}'\
    '\bye'


# (find-fline "/usr/bin/MakeTeXPK")
# (find-fline "/usr/bin/mktexmf")
# (find-fline "/usr/bin/mktexpk")
cd /tmp/
mf '\mode:=ljfour; mag:=1/2; nonstopmode; input stmary10'
gftype -i stmary10.300gf > o
# (find-fline "/tmp/o")
# (find-fline "/usr/lib/texmf/tex/latex/misc/stmaryrd.sty" "bindnasrepma")





######
#
# blackboard bold
#
######

cd /usr/lib/texmf/fonts
find | grep bb

tex '\let\noinit! \input testfont.tex'\
    '\def\Test#1{\def\fontname{#1}\startfont\table}'\
    '\Test{bbold10}'\
    '\Test{bbm10}'\
    '\Test{bbmbx10}'\
    '\bye'
xdvi testfont.dvi

# (find-fline "/usr/lib/texmf/doc/latex/jknappen/")
# (find-fline "/usr/lib/texmf/fonts/source/jknappen/sauter/")
# (find-fline "/usr/lib/texmf/tex/latex/jknappen/")
# (find-fline "/usr/lib/texmf/fonts/source/public/bbold/")
# (find-fline "/usr/lib/texmf/tex/latex/misc/bbold.sty")
# (find-fline "/usr/lib/texmf/source/latex/bbm/")
# (find-fline "/usr/lib/texmf/source/latex/bbm/bbm.dtx")
# (find-fline "/usr/lib/texmf/tex/latex/bbm/")

cd /usr/lib/texmf/
find * -type f | sort > .files
agrep -i 'blackboard bold' $(grep dtx .files)

# (find-fline "/usr/lib/texmf/source/latex/amsfonts/amsfonts.dtx")
# (find-fline "/usr/lib/texmf/source/latex/amsfonts/euscript.dtx")
# (find-fline "/usr/lib/texmf/source/latex/psnfss/mathtime.dtx")

# (find-fline "$SCTAN/systems/knuth/tex/texbook.tex" 25862)

cd ~/LATEX/
cat > bb.tex <<'---'
\nonstopmode\tracingonline1\makeatletter
\documentclass{book}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
$\mathbb{R}\mathbb{I}$
\show\mathbb
\end{document}
---
latex bb.tex
dvifonts bb.dvi


xdvi testfont.dvi






#######
#
# ?
#
#######

% (find-fline "/usr/lib/texmf/source/latex/progkeys/programs.dtx" "programf")
% Diller p.52, p.138: tabbing
% (find-fline "/usr/lib/texmf/source/latex/base/Makefile.tetex")
% (find-fline "/usr/lib/texmf/source/latex/make.rules")
% (find-fline "/usr/lib/texmf/source/latex/base/manifest.txt")
% (find-fline "/usr/lib/texmf/source/latex/base/texpert.txt" "source2e.tex")
% (find-fline "/usr/lib/texmf/source/latex/base/lttab.dtx" "\\>")



######
#
# 720dpi fonts
#
######

# (find-fline "/var/spool/texmf/")
# (find-fline "/var/spool/texmf/ls-R")

# (find-fline "/var/spool/texmf/pk/cx/")
# (find-fline "/var/spool/texmf/pk/cx/public/cm/")
# (find-fline "/var/spool/texmf/pk/ljfour/public/cm/")

rm /var/spool/texmf/pk/cx/public/cm/cmr10.300pk
rm /var/spool/texmf/pk/ljfour/public/cm/cmr10.600pk

rm /var/spool/texmf/pk/ljfour/public/cm/cmr10.600pk
cd ~/LATEX/
strace-to ~/s xdvi -geometry +240+0  99feb11.dvi |& tee ~/o

cut -b 7- ~/s | sort | uniq
cut -b 7- ~/s | sort | uniq | getstrings | sort | uniq |& tee ~/o2
find $(grep '^/' ~/o2) -type f -maxdepth 0 > ~/o3
agrep -l ljfour $(<~/o3)

# (find-fline "/usr/bin/mktexpk" "ljfour")
# (find-fline "/usr/lib/texmf/web2c/mf.base")

/etc/texmf/modes.mf
/usr/lib/texmf/metafont/misc/modes.mf

# (find-node "(kpathsea)Top")
# (find-node "(kpathsea)mktex configuration")

# (find-fline "/var/spool/texmf/pk/cx/")
/usr/lib/texmf/web2c/texmf.cnf


agrep ljfour $(locate mktex)

# (find-fline "/etc/texmf/mktex.cnf")
# (find-fline "/usr/bin/mktexlsr")
# (find-fline "/usr/bin/mktexmf")
# (find-fline "/usr/bin/mktexpk")
# (find-fline "/usr/bin/mktextfm")
# (find-fline "/usr/lib/texmf/web2c/mktex.cnf")
# (find-fline "/usr/lib/texmf/web2c/mktex.opt" "ljfour")
# (find-fline "/usr/lib/texmf/web2c/mktexdir")
# (find-fline "/usr/lib/texmf/web2c/mktexdir.opt")
# (find-fline "/usr/lib/texmf/web2c/mktexnam")
# (find-fline "/usr/lib/texmf/web2c/mktexnam.opt")
# (find-fline "/usr/lib/texmf/web2c/mktexupd")


# (find-node "(bash)Bourne Shell Builtins" "`:'")
# (find-node "(bash)Shell Parameter Expansion")




kpathsea: Running mktexpk --mfmode ljfour --bdpi 600 --mag 1+0/600 --dpi 600 cmr10
mktexpk: Running mf \mode:=ljfour; mag:=1+0/600; nonstopmode; input cmr10


kpathsea: Running mktexpk --mfmode / --bdpi 720 --mag 1+0/720 --dpi 720 cmr10
mktexpk: Mismatched mode ljfour and resolution 720; ignoring mode.
mktexpk: Can't guess mode for 720 dpi devices.
mktexpk: Use a config file, or update me.
kpathsea: Appending font creation commands to missfont.log.
dvips: Font cmr10 at 720 not found; scaling 600 instead.
dvips: Such scaling will generate extremely poor output.




#######
#
# latex2html on slink
#
#######

# (find-vldifile "latex2html.list")
# (find-fline "/usr/doc/latex2html/")

# (find-file "/usr/bin/latex2html")





#####
#
# ctan mirrors
#
#####

# (find-fline "/usr/doc/texmf/help/ctan/CTAN.sites.gz")

mynetselect $(
  gzip -cd /usr/doc/texmf/help/ctan/CTAN.sites.gz |
    grep '^  [a-z]' |
    awk '{print tolower($1)}'
)

# (find-fline "~/o2")


# Para FCTAN=ftp://ctan.tug.org/tex-archive :
psne $FCTAN/ls-lR.gz
#
cd $SCTAN
gzip -dv ls-lR.gz
~/ICON/lslR2find -1 < ls-lR | cut -b0-8,21- > ls-lR.i

# (find-fline "$SCTAN/ls-lR.i")

psne $FCTAN/macros/tip.tgz
cd $SCTAN/macros/
tar -xvzf tip.tgz




#####
#
# TeX in practice
# 99nov01
#
#####

#  «tip»
# (find-fline "$SCTAN/macros/tip/boxing7.tip")

% (code-c-d "tip" "$SCTAN/macros/tip/")
% (find-tipfile "" "boxing")
%
% (find-tipfile "boxing7.tip")
% (find-tipfile "boxing6.tip")
% (find-tipfile "box-zero.tip")
% (find-tipfile "boxing5.tip")
% (find-tipfile "box-bul.tip")
% (find-tipfile "box-bb.tip")
% (find-tipfile "box-thck.tip")
% (find-tipfile "vcentx.tip")

% (find-tipfile "inputd.tip")

cd $SCTAN/macros/tip/
cp -v boxing7.tip boxing6.tip box-zero.tip boxing5.tip box-bul.tip \
  box-bb.tip box-thck.tip vcentx.tip ~/LATEX/

cd $SCTAN/macros/tip/
zip /tmp/tip.zip boxing7.tip boxing6.tip box-zero.tip boxing5.tip \
  box-bul.tip box-bb.tip box-thck.tip vcentx.tip
laf /tmp/tip.zip

%*
\def\wlog#1{}
\def\InputD#1{\input #1}
\input boxing7.tip

a\HboxR{bcd}e
%*





#####
#
# ethiop
#
#####

# (find-vldifile "ethiop.list")
# (find-fline "/usr/doc/ethiop/")

cd /usr/doc/ethiop/
gzip -dv *
latex ethiodoc.tex
latex ethiodoc.tex
latex ethiodoc.tex
xdvi ethiodoc.dvi




#####
#
# The pic manual
#
#####

#  «pic_manual»

gv $S/http/cm.bell-labs.com/cm/cs/cstr/116.ps
# But gv is not happy...
# (find-es "ps" "gv_psheaders")

# (find-fline "$S/http/cm.bell-labs.com/cm/cs/cstr/116.ps")
# (find-node "(gawk)If Statement")

(
echo "116.ps:\n"
awk '{if ($0 ~ /^%/) {print $0; c=0} else {if (c==0) {print ""; c=1}}}' \
  < $S/http/cm.bell-labs.com/cm/cs/cstr/116.ps
# echo "\n\n\ntmp.ps:\n"
# awk '{if ($0 ~ /^%/) {print $0; c=0} else {if (c==0) {print ""; c=1}}}' \
#   < ~/LATEX/tmp.ps
) > ~/o

# (find-fline "~/o")

# (find-fline "$S/http/cm.bell-labs.com/cm/cs/cstr/116.ps" "%%Page: 14 16")



pstotext $S/http/cm.bell-labs.com/cm/cs/cstr/116.ps \
  | tr ­ - | tee ~/o

# (find-es "ps" "pstotext")
# (find-es "ps" "pstotext")

# Incomplete output.
# (find-es "ps" "pstotext")





#####
#
# Gothic fonts
# 99oct24
#
#####

# (find-fline "/usr/lib/texmf/tex/latex/amsfonts/eufrak.sty")





#####
#
# Tese do Max
#
#####

#  «tese_do_max»

rm -Rv /tmp/thesis*
cd /tmp/
tar -xvzf ~/tese-max.tgz

cd /tmp/thesis/
latex thesis.tex	|& tee olt
# latex thesis.tex
# latex thesis.tex

(cd /tmp/thesis/; xdvi /tmp/thesis/thesis.dvi &)

# (find-fline "/tmp/thesis/")
# (find-fline "/tmp/thesis/")




#####
#
# TeX ruler (to estimate dims with xdvi)
#
#####

xdvi $S/http/www.loria.fr/services/tex/divers/tex-ruler.dvi &





#####
#
# Showing the dimensions of a box
# 99nov06
#
#####

% (find-knuthfile "tex/texbook.tex" "\\newlinechar=`\\^^J")
% (find-knuthfile "tex/texbook.tex" "10&Space")
% (find-knuthfile "tex/texbook.tex" "12&Other character")
# (find-knuthfile "tex/texbook.tex" "^|\\message||{...}|")

%*
\setbox1\hbox{bp}
\newlinechar=`\^^J
\catcode` =12\def\spac{ }\catcode` =10
\message{^^J \the\wd1\spac \the\ht1\spac \the\dp1}
\dp1=12pt
\message{^^J \the\wd1\spac \the\ht1\spac \the\dp1}
%*

# Converting dimensions:
# (find-knuthfile "tex/texbook.tex" "newdimen")
# (find-fline "/usr/lib/texmf/tex/plain/base/plain.tex" "newdimen")
# (find-knuthfile "tex/texbook.tex" "in=72.27")
# (/ 1 72.27)

%*
\newlinechar=`\^^J
\newdimen\tmpdimen
%\def\rmpt#1pt{#1}
\def\rmpt#1{#1}

\tmpdimen=72.27pt
\message{^^J \the\tmpdimen}
\tmpdimen=0.013837\tmpdimen
\message{^^J \rmpt\the\tmpdimen in}
%*



# Other notes:

%*
\message{hello}
\setbox1\hbox{bp}
\scrollmode
\showthe\wd1
\show\ht1
\show\dp1
%*
\newlinechar=`\^^J
\def\sp{ }
\setbox1\hbox{bp}
\catcode` =12\def\spac{ }\catcode` =10
\message{    \the\wd1   \the\ht1\ \the\dp1}
\message{^^J \the\wd1^^ \the\ht1{} \the\dp1}
\message{^^J \the\wd1\sp \the\ht1^^20 \the\dp1}
\message{^^J \the\wd1\string\ \the\ht1\char` \the\dp1}
\message{^^J \the\wd1\spac \the\ht1\spac \the\dp1}
\message{^^J \the\wd1\spac \the\ht1\spac \the\dp1}
%*

# (find-knuthfile "tex/texbook.tex")
# (find-knuthfile "tex/texbook.tex" "256 box registers")
# (find-knuthfile "tex/texbook.tex" "^|\\expandafter|\\<token>")
# (find-knuthfile "tex/texbook.tex" "futurelet")
# (find-knuthfile "tex/texbook.tex" "batchmode")
# (find-knuthfile "tex/texbook.tex" "`^|\\showthe|'")
# (find-knuthfile "tex/texbook.tex" "\\csname")
# (find-knuthfile "tex/texbook.tex" "2\\wd3")

# (find-fline "/usr/lib/texmf/tex/plain/base/manmac.tex" "index")

# (find-fline "~/LATEX/")
# (find-fline "~/LATEX/boxing7.tip")
# (find-fline "~/LATEX/Makefile")





######
#
# tex -> png
# 99nov06
#
######

#  «tex2png»

# (find-fline "~/LATEX/Makefile")
# (find-es "music" "ps_to_png")





#####
#
# Hunting ps fonts (for certain calligraphic chars)
# 99nov16
#
#####

#  «hunting_ps_fonts»
#  «rsfs»

# (find-es "tex" "testfont")
# (find-fline "~/.zshrc" "dvifonts")
# (find-lsrcfile "psnfss/")
# (find-lsrcfile "psnfss/mathtime.dtx")
# (find-lsrcfile "psnfss/mathtest.tex")

cd /usr/lib/texmf/source/latex/psnfss/
latex mathtest
xdvi mathtest.dvi &

cd /usr/lib/texmf/source/latex/psnfss/
dvifonts mathtest.dvi

cd
tex '\let\noinit! \input testfont.tex'\
    '\def\Test#1{\def\fontname{#1}\startfont\table}'\
    '\Test{ectt1000}'\
    '\Test{ptmb7t}'\
    '\Test{ptmb8t}'\
    '\Test{ptmr8t}'\
    '\Test{ptmri8t}'\
    '\Test{zptmcm7m}'\
    '\Test{zptmcm7t}'\
    '\Test{zptmcm7v}'\
    '\Test{zptmcm7y}'\
    '\bye'
xdvi testfont.dvi &

dtxagrep ptm
locate zptmcm

# (find-fline "/usr/lib/texmf/fonts/vf/adobe/mathptmx/zptmcm7y.vf")
# (eeman "vftovp")

cp /usr/lib/texmf/fonts/vf/adobe/mathptmx/zptmcm7y.vf /tmp/
cp /usr/lib/texmf/fonts/tfm/adobe/mathptmx/zptmcm7y.tfm /tmp/
cd /tmp/
vftovp zptmcm7y > o

# (find-fline "/tmp/o")
# There's a mention to the "rsfs" encoding, and rsfs sounds familiar...
# So,

dtxagrep rsfs
# (find-fline "/usr/lib/texmf/source/latex/jknappen/mathrsfs.rme")
# (find-fline "/usr/lib/texmf/source/latex/jknappen/mathrsfs.sty")
# (find-fline "/usr/lib/texmf/source/latex/jknappen/ursfs.fd")

# The trick is to put a \usepackage{mathrsfs} in the preamble and use
# things like \mathscr{ABCDE} in the body of the text.





#####
#
# Patrick Lincoln's linear logic "par" macro
# 99sep??
#
#####

#  «upside_down_ampersand»

# (find-fline "$S/ftp/ftp.csl.sri.com/pub/linear/mailing-list-traffic/18.summary" "\\draw package")





#####
#
# \edrxnotes
# 00jan19
#
#####

#  «edrxnotes»

# 00jan19: moved the script below to my .zshrc. Now I can use
# "savetmptex" insted of "/tmp/save". See:
# (find-angg ".zshrc" "savetmptex")
# (find-angg ".emacs" "eelatex")

# (find-node "(zsh)Conditional Expressions")
# (find-fline "~/LATEX/tese2.sty" "\\def\\edrxnotes#1")
# (find-angg "eev.el" "eelatex")

cat > /tmp/save <<'---'
i=$(perl -nle 'm/^\\edrxnotes{([!-~]+)}/ && print $1' < tmp.tex)
if [[ -n $i ]]; then
  echo $i.tex
  sed -e "s/^\\\\input tmp.dnt/\\\\input $i.auto.dnt/" < tmp.tex > $i.tex
fi
---

# First, run the block above to create the script /tmp/save; then,
# instead of doing just "ee" to run LaTeX on a block saved with f3,
# do:
#
#   ee; . /tmp/save
#
# if the LaTeXable block had a line like "\edrxnotes{xxx}" then
# tmp.tex will be copied to xxx.tex; if it had a "\input tmp.dnt" then
# it will be changed to "\input xxx.auto.dnt".



# (find-es "emacs" "saving_emacs_macros")
# (load-library "edmacro")
# (insert-kbd-macro (make-symbol ""))

(setq last-kbd-macro
  (read-kbd-macro "<<search-forward>> edrxnotes RET <f3>"))

# Only use the macro below if you have two windows and the other one
# is a shell buffer...

(setq last-kbd-macro
  (read-kbd-macro "<<search-forward>> edrxnotes RET <f3>
      C-x o ee; SPC . SPC /tmp/save RET C-x o"))



cd ~/LATEX/
export A=""
echo -n .INTERMEDIATE: > ~/o2
echo -n edrxnotes: > ~/o3
for i in [0-9]*.tex; do
  j=$(basename $i .tex)
  echo -n " $j.dvi" >> ~/o3
  if grep "input $j.auto.dnt" $i > /dev/null; then
    echo $j.dvi: $j.tex $j.auto.dnt
    echo -n " $j.auto.dnt" >> ~/o2
  else
    echo $j.dvi: $j.tex
  fi
done |& tee ~/o
(cat ~/o2; echo; echo; cat ~/o; echo; cat ~/o3) | tee ~/o4

# (find-fline "~/LATEX/Makefile")
# (find-fline "~/o4")





#####
#
# Leo Moura's PIC examples
# 00jan24
#
#####

#  «leo_moura_pic»

# (find-fline "~/99oct26.pucmail" "eevP")

cd /tmp/
rm -fv 7 instrs examples.tar.gz
expect -c '
  spawn mail -f ~/99oct26.pucmail
  send "s7 7\rx\r"
  interact
  spawn metamail -r -w -q 7
  send "instrs\r\r"
  interact
'
rm -fv mm.a00*

rm -Rv /tmp/pic
mkdir /tmp/pic
cd /tmp/pic/
tar -xvzf /tmp/examples.tar.gz

tr -d \\r < eev.el > eev0.el
mv eev0.el eev.el

# (find-fline "/tmp/pic/")
# (find-fline "/tmp/pic/eev.el")

rm -v Makefile~
rm -v abs_tree_fatorial.tex
rm -v comp_tree_range_1.tex
rm -v eev.el
rm -v eev.el~
rm -v gravelSFC.tex
rm -v test.tex~

tar -cvzf /tmp/examples0.tar.gz *
laf	  /tmp/examples*gz

cd /tmp/pic/
make	|& tee om

# (find-fline "/tmp/instrs")
# (find-fline "/tmp/pic/")
# (find-fline "/tmp/pic/Makefile")
# (find-fline "/tmp/pic/test.tex")
# (find-fline "/tmp/pic/gravelSFC.pic")
# (find-fline "/tmp/pic/abs_tree_fatorial.pic")
# (find-fline "/tmp/pic/comp_tree_range_1.pic")
# (find-fline "/tmp/pic/sfc.pic")




#####
#
# Leo Moura's extensions to eev.el
# 00jan24
#
#####

#  «leo_moura_eev»

# (find-fline "~/99oct26.pucmail" "eevP")
# (find-etag "file-name-sans-extension")

(defun se-to-string-without-comments (s e char)
  (let ((currpos) (content))
	(save-excursion
	  (setq currpos s)
	  (setq content "")
	  (while (< currpos e)
		(goto-char currpos)
		(beginning-of-line)
		(while (eq (char-after (point)) (string-to-char char))
		  (forward-char))
		(setq currpos (point))
		(end-of-line)
		(setq content (concat content (buffer-substring
					       currpos (point)) "\n"))
		(next-line 1)
		(setq currpos (point)))
	  content)))

(defun tst-se-to-string-without-comments (s e)
  (interactive "r")
  (insert (se-to-string-without-comments s e ";")))

(defun write-ee-without-comments
  (s e comment-char pre post &optional other-ee-file fmode)
  (write-ee-string (concat pre (se-to-string-without-comments
				s e comment-char)
			   post)

;;

(defun eevP (s e &optional other-ee-file) (interactive "r")
  (write-ee-without-comments s e "%" "set -v\n" "\nset +v" other-ee-file)
  (shell-command ". ~/bin/emacs.ee &")
  )             ; zsh/bash

(defun eevB (s e &optional other-ee-file) (interactive "r")
  (write-ee-without-comments s e "/" "set -v\n" "\nset +v" other-ee-file)
  (shell-command ". ~/bin/emacs.ee &")
  )             ; zsh/bash

(defun eevC (s e &optional other-ee-file) (interactive "r")
  (write-ee-without-comments s e ";" "set -v\n" "\nset +v" other-ee-file)
  (shell-command ". ~/bin/emacs.ee &")
  )             ; zsh/bash

;;;;;
;;;;;  «eepic»
;;;;; things to run PIC on a block of text
;;;;;
;
(defun eepic (s e) (interactive "r")
  (write-ee s e "cat > ~/LATEX/tmp.pic <<'--%%--'
		 .PS\n"                 
	        "\n.PE\n--%%--\n
                 cd ~/LATEX
                 pic -t tmp.pic > tmp_pic.tex
                 cat > ~/LATEX/tmp.tex <<'--%%--'
                 \\input{tese_defs}
                 \\begin{document}
                 \\begin{figure}
                   \\scriptsize
                   \\input{tmp_pic} 
                   \\centerline{\\box\\graph}
                 \\end{figure}
                 \\end{document}\n--%%--\n
                 rm tmp.dvi
                 latex tmp.tex\n
                 xdvi tmp.dvi")
  (shell-command ". ~/bin/emacs.ee &"))

;;;;;
;;;;;  «eespic»
;;;;; things to run PIC on buffer
;;;;;
;
(defun eespic () (interactive)
  (write-ee (point-min) (point-max) "cat > tmp.pic <<'--%%--'\n"
	    "\n--%%--\n
             pic -t tmp.pic > ~/LATEX/tmp_pic.tex
             rm tmp.pic
             cd ~/LATEX
             cat > ~/LATEX/tmp.tex <<'--%%--'
             \\input{tese_defs}
             \\begin{document}
             \\begin{figure}
               \\scriptsize
               \\input{tmp_pic} 
               \\centerline{\\box\\graph}
             \\end{figure}
             \\end{document}\n--%%--\n
             rm tmp.dvi
             latex tmp.tex\n
             xdvi tmp.dvi")
  (shell-command ". ~/bin/emacs.ee &"))

;;;;;
;;;;;  «eespic»
;;;;; things to run PIC on buffer
;;;;;
;
;
(defun pic2tex () 
  (interactive)
  (shell-command (concat "pic -t " (buffer-name) " > " (file-name-sans-extension (buffer-name)) ".tex")))