Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: MATLAB Publishing of Symbolic Equations through TEX

Subject: MATLAB Publishing of Symbolic Equations through TEX

From: Brandeis

Date: 21 Jan, 2008 21:16:01

Message: 1 of 6

I am using MATLAB's publishing feature to document my
MATLAB code. For many of my equations I have inserted TEX
strings so that when the documentation is created, the
equations are displayed symbolically.

I have noticed that when MATLAB publishes the results, it
automatically creates a ".png" file for each symbolic
equation that you specify in your comments. MATALAB seems
to assign a random name to each of these ".png" files it
creates for symbolic equations. Is there a way to control
what it names each of ".png" file that is created for a
symbolic math equation that is published by MATLAB?


Subject: Re: MATLAB Publishing of Symbolic Equations through TEX

From: Matthew Simoneau

Date: 21 Jan, 2008 21:52:02

Message: 2 of 6

Sorry, nope. Why does this matter to you?

Subject: Re: MATLAB Publishing of Symbolic Equations through TEX

From: Brandeis

Date: 22 Jan, 2008 20:02:01

Message: 3 of 6

We are using a tool to automatically convert MATLAB code
into real time C code. I am also using the publishing
feature of MATLAB to automatically create the algorithm
description document for the MATLAB code.

Since the auto-generated C code keeps MATLAB comments
intact, the MATLAB "publishing tags" are retained. I wrote
a MS-Word VBA macro to suck the auto-generated C code into
MS-Word. The VBA macro catches the "publishing tags" in
the auto-generated C code and insert the appropriate hyper-
text links, image, or formatting. The only hangup is when
the VBA maco encounters the tag for a symbolic equation,
it can not figure out which corresponding ".png" equation
file to insert into the word document.

The idea is to basically have a published version of the
MATLAB code and a published version of the auto-generated
C code that match (i.e. have the same symbolic math
equations and formatting).

If I can just get MS-word to recognize TEX strings that
would also work, but that is a MS-Word issue, not a MATLAB
issue.

"Matthew Simoneau" <matthew@mathworks.com> wrote in
message <fn3461$2l2$1@fred.mathworks.com>...
> Sorry, nope. Why does this matter to you?

Subject: Re: MATLAB Publishing of Symbolic Equations through TEX

From: Matthew Simoneau

Date: 22 Jan, 2008 20:43:01

Message: 4 of 6

OK, I'm with you. Thanks for the detail.

The filename is generated by hashing the actual text of the
TeX. See toolbox/codetools/private/hasEquation.m for the
simple algorithm. You should be able to do this same
calculation in VBA.

(I'll also give you a heads up that the hash function we use
is changing in the next release to something more
complicated, so you'll have to look at this again in the
future.)

Subject: Re: MATLAB Publishing of Symbolic Equations through TEX

From: Brandeis

Date: 06 Feb, 2008 23:48:04

Message: 5 of 6

"Matthew Simoneau" <matthew@mathworks.com> wrote in message
<fn5kgl$c9$1@fred.mathworks.com>...
> OK, I'm with you. Thanks for the detail.
>
> The filename is generated by hashing the actual text of the
> TeX. See toolbox/codetools/private/hasEquation.m for the
> simple algorithm. You should be able to do this same
> calculation in VBA.
>
> (I'll also give you a heads up that the hash function we use
> is changing in the next release to something more
> complicated, so you'll have to look at this again in the
> future.)
>

Thanks for the info; however, I could not find a codetools
subdirectory under toolbox. I am using 2007b. Could it be in
a different location? I tried a search in all the MATLAB
directories and still did not find the file

Thanks, Brandeis

Subject: Re: MATLAB Publishing of Symbolic Equations through TEX

From: Brandeis

Date: 06 Feb, 2008 23:51:03

Message: 6 of 6

"Matthew Simoneau" <matthew@mathworks.com> wrote in message
<fn5kgl$c9$1@fred.mathworks.com>...
> OK, I'm with you. Thanks for the detail.
>
> The filename is generated by hashing the actual text of the
> TeX. See toolbox/codetools/private/hasEquation.m for the
> simple algorithm. You should be able to do this same
> calculation in VBA.
>
> (I'll also give you a heads up that the hash function we use
> is changing in the next release to something more
> complicated, so you'll have to look at this again in the
> future.)
>

Ok,

I found the file ok. It is hashEquation.m

Please disregard previous post. Thanks

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
documentation Brandeis 21 Jan, 2008 16:20:04
publishing Brandeis 21 Jan, 2008 16:20:04
publish Brandeis 21 Jan, 2008 16:20:04
equations Brandeis 21 Jan, 2008 16:20:03
symbolic math Brandeis 21 Jan, 2008 16:20:03
tex Brandeis 21 Jan, 2008 16:20:03
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics