Using Rich Text Editor
Table of contents:- Summary
- Live Demo
- Toolbar Commands
- Keyboard Shortcuts
- Links
- Images
- Attachments
- Run feature
- Accelerators
Summary
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.
Toolbar Commands
Option | Description |
---|---|
![]() | Enables text mode (switches to text mode if you are in code mode).
Note: Text mode is active by default. |
![]() | Enables normal text. |
![]() | Enables heading style. |
![]() | Displays text in bold. |
![]() | Displays text in italic. |
![]() | Underlines text. |
![]() | Displays text in monospace font. |
![]() | Adds bulleted list. |
![]() | Adds numbered list. |
Option | Description |
---|---|
![]() | Enables code mode (switches to code mode if you are in text mode). |
![]() | Comments current line. |
![]() | Uncomments current line (if commented). |
![]() | Adds tab space to the start of the current line. |
![]() | Removes tab space from start of current line. |
Option | Description |
---|---|
![]() | Add an image. Learn more |
![]() | Convert selected text to hyperlink. |
![]() | Add LaTeX equation. Learn more |
![]() | Add attachments. Learn more |
![]() | Add formatted code examples. Learn more |
![]() | Get help for Rich Text Editor (this page). |
Option | Description |
---|---|
![]() | Run MATLAB code. Learn more |
![]() | Clears all outputs. |
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** __text__ |
Ctrl+B (⌘B) |
Italic | *text* _text_ |
Ctrl+I (⌘I) |
Bold and italic | ***text*** ___text___ |
Ctrl+B, then Ctrl+I (⌘B, then ⌘I) |
Underline | - | Ctrl+U (⌘U) |
Monospace | `text` |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+] (⌘]) Tab |
Unindent/Outdent | - | Ctrl+[ (⌘[) |
Hyperlink | URL+Space or Enter <URL> [Label](URL) |
Ctrl+K (⌘K) |
LaTeX equation | $LaTeX$ | Ctrl+Alt+G (⌘⌥G) |
Inline equations | - | Ctrl+Shift+E (⌘⇧E) |
Trademark, service mark, and copyright symbols (™, ℠, ®, and ©) | (TM) (SM) (R) (C) |
- |
Links
- Click
on the editor toolbar
- Enter link text and target URL in the popup dialog box.
- Click OK to add link.
Images
- Click
on the editor toolbar.
- Select whether you are uploading from your computer or the Web. Image files must be 15 MB or smaller.
- If uploading from your computer, click Choose File to browse and select a file.
- If uploading from the Web, enter the URL.
- 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.
- Click OK to insert the image.
Attachments
From the Toolbar
- Click
on the editor toolbar.
- Click Open to attach the file.
Drag and Drop
- Select one or more files and drag them to the editor.
- 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.
Run feature
Available in: MATLAB Answers
The Run feature allows you to write, run, generate output and validate code inside the editor window without having to start up MATLAB. Run evaluates code using the most recent MATLAB release only.
Some notes about Run:
- To use Run, your text must be formatted as code using the options on the Code menu.
- Run is not available on mobile devices.
- Run does not support MATLAB Coder and GPU Coder toolboxes.

Attachments with Run feature
Attached files are automatically included when you run your code in MATLAB Answers.
This example Answer has an attachment file named mathworks-icon.png, and it 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.

Code Examples with Run feature
Available in: MATLAB Answers
A code example is sample code that appears as indented monospaced text with MATLAB syntax highlighting. You can use a code example when you don't want the code to be executed by Run.

Accelerators
User Mentions
Available in: MATLAB Answers, MathWorks Communities, Community Highlights, Community Contests, Blogs
When you type @, a popup displays the community members already in the Q/A thread. As you keep typing, the list expands to include members not in the thread. A mentioned community member receives a notification when the question/answer/comment is posted. Each mention links the post to the community member's user profile.


Documentation Links
Available in: MATLAB Answers, MathWorks Communities, Community Highlights, Community Contests, Blogs
To add a link to a documentation page, type @ to insert "@doc:" (or type "@doc:" yourself) and then start typing the function name. In the resulting search popup, select one of the doc topics matching the text you typed to convert it into a hyperlink.
