The Archives

  • 27.Apr.10
    Setting variables in emacs at file header shell | pfortuny | (2)
    When editing LaTeX files, I usually call the master file of a project 00father.ltx for historical reasons. Moreover, the following line is part of my .emacs: (setq-default TeX-master "00father.ltx") because most of the time I am editing multifile projects. However, from time to time I need to write a single-file document and in this case, naming it 00father.ltx is not that useful, and I do not want to have to set the master-file variable each time I load the file. There is an easy way to get this done. Just include a line at the top of the file -as a comment in the ...
  • 24.Mar.09
    gnuplot just for coordinates shell | pfortuny | (2)
    I needed a list of coordinates urgently, and I needed it in a text file (I am using LaTeX a lot lately). Gnuplot does the job properly, if told to do so: $ gnuplot gnuplot> set terminal table gnuplot> set output "hyperbola" gnuplot> set parametric gnuplot> plot [t=-1.5:1.5] cosh(t),sinh(t) gnuplot> quit $ cat hiberbola |awk '/[0-9]/{print "(",$1,",",$2,")"}' > hyperbola.txt The above saves in "hyperbola" a list of coordinates: each line contains a pair x y i (x coordinate, y coordinate, type of coordinate). The awk line turns it into a list of parenthesized coordinate pairs. The lines above saved me a lot of troubles yesterday.