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

Thread Subject: Publish without code output

Subject: Publish without code output

From: Fran?ois Bouffard

Date: 11 Apr, 2008 14:12:01

Message: 1 of 3

The preferences options for publishing (in the version of
Matlab I'm using, which admitedly is not the latest) enable
us to decide if we want to a) evaluate code, b) use new
figures, and c) display the code in the output. I want to
produce a report in which the code is evaluated (to generate
figures), so a) has to be checked. Since the code is quite
lengthy, I don't want it displayed in the HTML file, so c)
has to be unchecked.

However even if the code itself is not displayed in the HTML
file, the code output is listed. This is a problem since I'm
using third-party functions that spew out dozens of
uninteresting messages. Thus I'd like the code output not
shown in the report. Is there an easy way to do this?

Since there is no "Display code output" checkbox in the
preferences or an equivalent option to the publish function,
I guess I should either use an appropriate XSL stylesheet,
or parse the HTML and remove the "codeoutput"-class pre
tags. Has anyone produced such an XSL stylesheet?

Thanks for any hint,

Fran?ois

Subject: Re: Publish without code output

From: Matthew Simoneau

Date: 14 Apr, 2008 14:51:45

Message: 2 of 3

"Fran?ois Bouffard"
<remove.fbouffard.this@and.gmail.this.com> wrote in message
<ftnrjh$aq0$1@fred.mathworks.com>...
> The preferences options for publishing (in the version of
> Matlab I'm using, which admitedly is not the latest) enable
> us to decide if we want to a) evaluate code, b) use new
> figures, and c) display the code in the output. I want to
> produce a report in which the code is evaluated (to generate
> figures), so a) has to be checked. Since the code is quite
> lengthy, I don't want it displayed in the HTML file, so c)
> has to be unchecked.
>
> However even if the code itself is not displayed in the HTML
> file, the code output is listed. This is a problem since I'm
> using third-party functions that spew out dozens of
> uninteresting messages. Thus I'd like the code output not
> shown in the report. Is there an easy way to do this?
>
> Since there is no "Display code output" checkbox in the
> preferences or an equivalent option to the publish function,
> I guess I should either use an appropriate XSL stylesheet,
> or parse the HTML and remove the "codeoutput"-class pre
> tags. Has anyone produced such an XSL stylesheet?
>
> Thanks for any hint,
>
> Fran?ois

In newer versions of MATLAB, there's an option for this
called maxOutputLines.

On older versions, you're solution of modifying the
stylesheet is a good one.

>> edit private/mxdom2simplehtml.xsl

Find where "mcodeoutput" is in your version and delete it.
Then re-save this file to a new location. When you publish,
specify you want to use this custom stylesheet.

Subject: Re: Publish without code output

From: Francois Bouffard

Date: 14 Apr, 2008 16:08:01

Message: 3 of 3

> On older versions, you're solution of modifying the
> stylesheet is a good one.
>
> >> edit private/mxdom2simplehtml.xsl
>
> Find where "mcodeoutput" is in your version and delete it.
> Then re-save this file to a new location. When you publish,
> specify you want to use this custom stylesheet.

Thanks for your help, this worked very well.

Fran?ois

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
stylesheet Francois Bouffard 11 Apr, 2008 10:15:07
publishing Francois Bouffard 11 Apr, 2008 10:15:06
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