MATLAB Answers

0

Need documentation for hgexport function

Asked by Ivan Abraham on 20 Jan 2017
Latest activity Answered by Walter Roberson
on 20 Jan 2017
After being introduced in R2007 even in R2016 there is very little documentation for the hgexport() function. Many different sources seem to use the function in numerous and different ways. Where can I find a comprehensive account of the many ways hgexport can be used? Specifically R2016 has a built in export settings called "Documents", "Presentations", "default". I would like to use the hgexport() function to load the Presentations style and apply it.
Trying
s = hgexport('readstyle','Presentations')
Seems to not help.
Error using hgexport
Style 'Presentations' does not exist.
Error in hgexport

  0 Comments

Sign in to comment.

1 Answer

Answer by Walter Roberson
on 20 Jan 2017

hgexport('factorystyle') returns a built-in style.
exportsetupdlg.m checks the figure appdata 'Exportsetup' property to see if a style has been applied to the figure. If not then it looks for default style information and if not it initializes with factorystyle.
The settings you are looking at, Documents and Presentations, do not exist until the exportsetupdlg initialization is run. Internally it uses the names MSWord and PowerPoint
The style information for MSWord and PowerPoint is looked for in prefdir subdirectory ExportSetup in files MSWord.txt and PowerPoint.txt . It will write them there if it does not find them. So you could customize those files.
MSWord style defaults to the same as factorystyle.
PowerPoint style defaults to bold scaled fontsize 140 with fixed width lines.
Look near lines 1450 in exportsetupdlg.m
hgexport() can also be called with a figure, then a filename, then a style, then 'Format', then the name of one of the supported formats. The supported formats are extracted from the printtables() command which uses information about what is locally available. Look starting at roughly line 350 in filemenufcn.m

  0 Comments

Sign in to comment.