Printing with FLTK: Difference between revisions

From Octave
Jump to navigation Jump to search
m (Minor format changes)
(fix savanah link)
Line 1: Line 1:
Printing with graphics_toolkit FLTK has some known limitations:
Printing with graphics_toolkit FLTK has some known limitations:


* Tex/Latex symbols won't show up in the generated print even if they are visible in the plot window. See bugs #42988, [http://savannah.gnu.org/bugs/?42320| #42320], #42340 which are mostly duplicate entries for the same problem.
* Tex/Latex symbols won't show up in the generated print even if they are visible in the plot window. See bugs #42988, [http://savannah.gnu.org/bugs/?42320 #42320], #42340 which are mostly duplicate entries for the same problem.


* Can't print multiline text objects: [http://savannah.gnu.org/bugs/?31468 bug#31468]
* Can't print multiline text objects: [http://savannah.gnu.org/bugs/?31468 bug#31468]

Revision as of 23:15, 19 August 2014

Printing with graphics_toolkit FLTK has some known limitations:

  • Tex/Latex symbols won't show up in the generated print even if they are visible in the plot window. See bugs #42988, #42320, #42340 which are mostly duplicate entries for the same problem.
  • Can't print multiline text objects: bug#31468

However there are some ways to overcome these:

Use print [ps|eps|pdf] latex [standalone] for symbols and formulas

See "help print" for a description of 'pslatex', 'epslatex' 'pdflatex', 'pslatexstandalone', 'epslatexstandalone', 'pdflatexstandalone'

Code: print with fltk and epslatexstandalone"
close all
graphics_toolkit fltk
sombrero ();
title ("The sombrero function:")
fcn = "$z = \\frac{\\sin\\left(\\sqrt{x^2 + y^2}\\right)}{\\sqrt{x^2 + y^2}}$";
text (0.5, -10, 1.8, fcn, "fontsize", 20);

print -depslatexstandalone sombrero

## process generated files with pdflatex
system ("latex sombrero.tex");

## dvi to ps
system ("dvips sombrero.dvi");

## convert to png for wiki page
system ("gs -dNOPAUSE -dBATCH -dSAFER -sDEVICE=png16m -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r100x100 -dEPSCrop -sOutputFile=sombrero.png sombrero.ps")

Sombrero epslatexstandalone.png

Use psfrag

TODO: Fill me!