Robert Izzard's Pages of Astronomical Happiness


  Useful • Reminders
DISCLAIMER I take no responsibility for anything you do, with or without my help!
  • How to put sun symbols in gnuplot
    If you want png output (e.g. with the pngcairo terminal), the easiest way is to use
    set encoding utf8 
    

    Then just type in the appropriate UTF8 symbol e.g. copy paste Unicode U+2609 ☉ or U+2299 ⊙

    Alternatively, if this fails (e.g. if you want postscript output) you can embed the symbol from the cmsy10 font:
    set terminal postscript enhanced ... fontfile 'cmsy10.pfb'
    
    then use the following in your titles and/or labels to get a sun
    {/CMSY10 \\014}

    You will have to find the appropiate font file. On modern Ubuntu Linux it is at /usr/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsy10.pfb
  • Solar Symbols in Inkscape

    The trick here is to remember how to encode Unicode. The solar symbol is U+2609 (HTML ☉) or U+2299. Then press CTRL-U and type (e.g.) "2299" (then enter) and you have your solar symbol.
  • Converting transparent png to transparent postscript
    Both GIMP and ImageMagick's convert are not very useful for this. Use sam2p instead.
  • Converting postscript to png
    You can do this with Image Magick's convert utility, but you run into trouble with antialiasing on gnuplot's pm3d surface plots, and it's incredibly slow. So it's much better to do is with ghostscript. Just set the output from gnuplot to /dev/stdout (or cat your postscript file) and run it through this command:
    gnuplot [gnuplot file] | sed -e "s/Adobe-2.0/Adobe-2.0 EPSF/" | gs -q -dBATCH -dSAFER -dNOPAUSE -sDEVICE=png16m -dEPSCrop -dGraphicsAlphaBits=1 -dTextAlphaBits=4 -r[DPI] -sOutputFile=[png file] -
    If you are using an encapsulated postscript file, you should remove the sed command. DPI is the resolution, 72 is ok, 150 is better, 300 is great (but slower, of course). You must choose your png filename. This should be much quicker than convert and your text will still be antialised, while the graphics are not.
  • How to connect to your machine at work from your machine at home with VNC
    1. Log in (via SSH) to your machine at work (via venus), designated as yyy. Run vncserver or x11vnc to start a VNC server, e.g. with
      x11vnc -usepw -forever -display :0
    2. Choose a three digit number, call it xxx
    3. on your home machine run
      ssh -g -L 5901:localhost:10xxx venus.phys.uu.nl
      where you substitute xxx with your chosen number.
    4. on venus run
      ssh -g -L 10xxx:localhost:5900 yyy
    5. on your home machine, run
      vncviewer localhost::5901

      Note: You can simplify this by merging some of the commands...
  • LyX used to use \mathrm now it uses \mbox and it is very annoying
    Absolutely. So, build LyX yourself. Find the file math_nestinset.C and then look for the line which reads
    if (currentMode() == InsetBase::MATH_MODE && cmd.argument == "on")
    break;

    Immediately after that insert the following code:
    handleFont(cur, cmd.argument, "mathrm");
    break;

    This will select the \mathrm mode instead of \mbox. YAY!
    ...
    Update for Lyx 1.5.5
    The latest lyx is great but still has this annoying feature. Again, hack the code: in InsetMathNest.cpp after
    if (currentMode() == Inset::MATH_MODE && cmd.argument() == "on")
    break;
    insert the lines:
    
     		handleFont(cur, cmd.argument(), "mathrm");
    break;
    and hey presto(n), it works.
Surrey astro - IOA - CHU - SJC - STARS - BRIDGCE - UCam - Binary_c Online - Binary_c  facebook - Tarantula

Contact: Email