Desktop Tools and Development Environment |
Example of Publishing with Text Markup
This simple example adds text markup to the sine_wave.m
file used in Example of Publishing Without Text Markup to produce the following published HTML document. General instructions for marking up M-files for publishing are in the section after the following example.
TITLE
, replacing it with Plot Sine Wave
. Add a
comment about the overall file in line 2. Type
% Calculate and plot a sine wave.
and add a blank line beneath it for better readability.
You can add any overall comments about the file in the lines following the this title. You cannot add code after the first title and before the next cell (line starting with %%
) if you want the first title to appear as the overall document title.
String
property on the MATLAB reference page for graphics text
properties. In this example, use text markup to create a comment containing an equation:
Define the range for x
.
Select Cell -> Insert Text Markup -> Insert TeX Equation.
MATLAB inserts the following lines that contain a sample equation you will replace.
The sample equation is the text between the set of $$
, and is highlighted.
The three new lines that will display the TeX equation in the published document appear as follows in the M-file.
y = sin(x)
appear in monospace in the published
document, add the | symbol before and after the equation so it appears
as follows.
200
for the number of pixels. Click OK to close the dialog box.
sine_wave.html
, and the associated image files in d:/mymfiles/html
for this example.
The file sine_wave.m
now appears as shown in the following illustration.
Example of Publishing Without Text Markup | Marking Up Text in Cells for Publishing |
© 1994-2005 The MathWorks, Inc.