|
Hi all,
I wish to publish my m-file in word,
using the 'save and publish' command in the editor.
I use several function form different m-file.
I wish to show a simple description of the functions.
Instead of to put a cell like
%%
%
% $$f(x)= \cases{x & if $x<1$ \cr 0 & if $\ge1$}$$
to describe the function , I wrote the string in the function itself
i.e., the command myFunction('giveMeYourDescription')
return the above string $f(x)= \cases{ ... etc
I write a simple function plotInLatex (see below) that display the
latex output in a graphic window.
So, my m.file for publish my work is:
%%
% this is my 1-st function
plotInLatex( myFunction_1('giveMeYourDescription'));
%%
% this is my 2-nd function
plotInLatex( myFunction_2('giveMeYourDescription'));
It works, that is my .doc contain the latex output
but I have 4 questions.
1- the output in word is not of good quality. I have explored the
'publishing images preferences', but without improving the quality.
2- there is a way to estimate the size of the formula, in order to set
the 'height' value inside the function plotInLatex? There is a way to
'autofit' the formula?
3- yes I now, probabily the best result is obtained publishing in
latex (that I don't know)
I tried to publish in latex using the 'save and publish' command,
but my figures[[plot (x, f(x))] exits to the page... In word this
don't happen.
There is some stupid setting that I forgot?
4- maybe I'm using the most complicate way to do the things...
any suggestion?
Thanks!!
------------------------------------------------------------------------------------
function plotInLatex(mytexstr)
% mytexstr = '$f(x)= \cases{x & if $x<1$ \cr 0 & if $\ge1$}$';
h1=figure;
h = text('string',mytexstr,...
'interpreter','latex',...
'fontsize',14,...
'units','norm',...
'pos',[0 .5]);
axis off
height=100;
set(h1,'Position',[0,300,600,height]);
set(h1,'OuterPosition',[0,300,600,height]);
set(h1,'Color',[1,1,1])
set (h1,'MenuBar','none')
------------------------------------------------------------------------------------
|