Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Convert an expression to a string in Markdown format
ResourceFunction["ExportMarkdownString"][expr] converts expr to a string in Markdown format. |
| ImageExportMethod | None | the method used to export images |
| ConversionRules | {} | a list of rules to apply to low-level box structures |
Convert an expression to markdown:
| In[1]:= | ![]() |
| Out[1]= |
Create a Markdown table:
| In[2]:= |
| Out[2]= | ![]() |
Include a code block and TEX expressions:
| In[3]:= | ![]() |
| Out[3]= |
Convert cells:
| In[4]:= |
| Out[4]= |
| In[5]:= |
| Out[5]= |
| In[6]:= |
| Out[6]= |
A CellGroup:
| In[7]:= | ![]() |
| Out[7]= | ![]() |
Convert a notebook:
| In[8]:= |
| Out[8]= | ![]() |
Convert a CellObject:
| In[9]:= |
| Out[9]= | ![]() |
| In[10]:= |
| Out[10]= | ![]() |
| In[11]:= | ![]() |
See the cell:
| In[12]:= |
| Out[12]= |
Export it to Markdown:
| In[13]:= |
| Out[13]= |
External language cells:
| In[14]:= | ![]() |
| Out[14]= | ![]() |
Convert a NotebookObject:
| In[15]:= |
| Out[15]= |
| In[16]:= |
| Out[16]= | ![]() |
| In[17]:= |
Symbolic representations of notebooks:
| In[18]:= | ![]() |
| Out[18]= | ![]() |
| In[19]:= |
| Out[19]= | ![]() |
By default, images in notebooks will be represented as snippets of their box representations:
| In[20]:= | ![]() |
| Out[20]= | ![]() |
| In[21]:= |
| Out[21]= | ![]() |
Specify an image export method to create markdown images:
| In[22]:= |
| Out[22]= | ![]() |
Specify a directory for exporting images:
| In[23]:= |
| Out[23]= |
| In[24]:= | ![]() |
| Out[24]= | ![]() |
Images are saved in the given directory:
| In[25]:= |
| Out[25]= |
| In[26]:= |
| Out[26]= | ![]() |
Specify a custom function:
| In[27]:= | ![]() |
| Out[27]= | ![]() |
Give a notebook as context to an LLM:
| In[28]:= |
| In[29]:= |
| Out[29]= | ![]() |
For many simple markdown strings, ExportMarkdownString and ImportMarkdownString are effectively inverses of one another:
| In[30]:= |
| Out[30]= |
ExportMarkdownString uses a set of heuristics to determine when to show string characters:
| In[31]:= |
| Out[31]= |
| In[32]:= |
| Out[32]= |
Explicitly control this behavior using the ShowStringCharacters option with Style in the appropriate place:
| In[33]:= |
| Out[33]= |
| In[34]:= |
| Out[34]= |
Use Defer instead of Unevaluated to prevent evaluation of arguments:
| In[35]:= |
| Out[35]= |
| In[36]:= |
| Out[36]= |
Wolfram Language 14.0 (January 2024) or above
This work is licensed under a Creative Commons Attribution 4.0 International License