Community Profile

Using Rich Text Editor

Table of contents:


Use rich editor to enhance your content display with the addition of rich text formatting, hyperlinks, images, and attachments. For your MATLAB code, you can include MATLAB syntax highlighting and LaTeX equations.
RTC help summary

Try this live demo

Toolbar Commands


Option Description
text toggle icon Text toggle Enables text mode (switches to text mode if you are in code mode).
Note: Text mode is active by default.
normal text icon Normal text Enables normal text.
heading icon Heading Enables heading style.
bold icon Bold Displays text in bold.
italic icon Italic Displays text in italic.
underline icon Underline Underlines text.
monospace icon Monospace Displays text in monospace font.
bulleted list icon Bulleted list Adds bulleted list.
numbered list icon Numbered list Adds numbered list.


Option Description
code toggle icon Code toggle Enables code mode (switches to code mode if you are in text mode).
comment icon Comment Comments current line.
uncomment icon Uncomment Uncomments current line (if commented).
indent icon Indent Adds tab space to the start of the current line.
unindent icon Unindent Removes tab space from start of current line.


Option Description
insert image icon Image Add an image. Learn more
hyperlink icon Hyperlink Convert selected text to hyperlink.
equation icon Equation Add LaTeX equation. Learn more
attachments icon Attachments Add attachments. Learn more
help icon Help Get help for Rich Text Editor (this page).
Note: The Rich Text Editor is a MATLAB Live Editor component for creating live scripts but with limited functionalities. Learn more about the MATLAB Live Editor formatting.

Keyboard Shortcuts:

Formatting Style Autoformatting Sequence Keyboard Shortcut
Text/code toggle - Ctrl+E (⌥Enter)
Normal Text - Ctrl+Alt+T (⌃⌥T)
Heading ## text + Enter Ctrl+Alt+H (⌃⌥H)
Bold **text**
Ctrl+B (⌘B)
Italic *text*
Ctrl+I (⌘I)
Bold and italic ***text***
Ctrl+B, then Ctrl+I (⌘B, then ⌘I)
Underline - Ctrl+U (⌘U)
Monospace `text`
Ctrl+M (⌃M)
Bulleted list * text
- text
+ text
Ctrl+Alt+U (⌃⌥U)
Numbered list number. text Ctrl+Alt+O (⌃⌥O)
Comment - Ctrl+R (⌘/)
Indent - Ctrl+] (⌘])
Unindent/Outdent - Ctrl+[ (⌘[)
Hyperlink URL+Space or Enter
Ctrl+K (⌘K)
LaTeX equation $LaTeX$ Ctrl+Alt+G (⌘⌥G)
Inline equations - Ctrl+Shift+E (⌘⇧E)
Trademark, service mark, and copyright symbols (™, ℠, ®, and ©) (TM)

  1. Click hyperlink icon on the editor toolbar
  2. Enter link text and target URL in the popup dialog box.
  3. Click OK to add link.


  1. Click insert image icon on the editor toolbar.
  2. Select whether you are uploading from your computer or the Web. Image files must be 15 MB or smaller.
    1. If uploading from your computer, click Choose File to browse and select a file.
    2. If uploading from the Web, enter the URL.
  3. When inserting an image, you can specify the following parameters:
    • Alt text – Specifies an alternate text for an image, if the image cannot be displayed.
    • Size – Scales the image to specified percentage.
    • Alignment – Aligns the image with the text according to the value selected.
  4. Click OK to insert the image.


From the Toolbar

  1. Click attachments icon on the editor toolbar.
  2. Click Open to attach the file.

Drag and Drop

  1. Select one or more files and drag them to the editor.
  2. When the editor turns gray, release the file(s).
All attachments must meet the following requirements:
  • Files must be 5 MB or smaller.
  • Attachments must be one of the following formats: bmp, csv, fig, gif, jpg, jpeg, m, mat, mdl, mlx, slx, pdf, png, txt, xls, xlsx, zip.
  • You can upload a maximum of 10 attachments in a 24-hour period. If you need to upload an additional file during this period, delete an existing attachment and upload the new file.

Attachments with Run feature

Attached files are automatically included when you run your code in MATLAB Answers. For example, the Answer shown here has an attachment file named mathworks-icon.png, and that file is available in the current directory of MATLAB for the code to use. The code reads the image from the attached file and then displays the image.

Attachments in run demo