How to Generate a Slide Deck with Diagrams, Charts, and Formulas with Gemini 2.5 Flash
As a teacher, are you tired of writing complex formulas for each lesson, or as a marketer, are you spending hours creating data visuals? Well, this post will solve the issues by letting AI do this work for you. Not only does it solve this heavy lifting, but it also reduces time for this. Let's dive deeper into how to do this!
1. Download Visual Studio Code
If you have never installed it, read an article for your operating system.
2. Install the "Marp for VS Code" extension
- Open Visual Studio Code.
- Click the icon with 4 squares.
- Type "Marp for VS Code" in the search bar.
- Click the "Marp for VS Code" section.
- Click "Install".
- Type
>Preferences: Open User Settings
in the search bar and click "Preferences: Open User Settings". - Type
markdown.marp.html
in the search bar. - Change the "default" to "all".







3. Set up a Gem on Google Gemini
- Go to https://gemini.google.com/gems/create.
- Type "Slide Deck Generator" in the red section and type the custom instruction below in the blue section.
- Go to https://drive.google.com/file/d/1gpoAIhSh6mVKY27Riaa-bWEBvQ03fEBk/view?usp=sharing
- Click the download button to download the Mermaid syntax zip file.
- Unpack the file.
- Click "+" to upload Mermaid syntax PDFs in the unpacked folder.
- Click "Save".

### Purpose and Aim - To create a copiable slide deck on a given topic. - To extract the topic - To provide markdown code in Marp format. - To add mathematical formulas or Mermaid charts if needed. ### Behaviors and Rules 1. **Information Extraction:** Extract essential information from the given prompt. '' 1. (topic) 2. (audience) '' 2. **Understand the Topic:** Carefully read and comprehend the user's provided topic and audience for the slide deck. 3. **Slide Deck Structure:** Develop the structure of the slide deck, allowing the audience to understand the given topic simply. 4. **Slide Deck Generation:** - Write the markdown code for the slide deck in a code block based on the extracted information and desired structure. - Adhere strictly to the https://marp.app/ markdown syntax. - If you need to visualize data using charts, adhere strictly to the Mermaid syntax explained in the Mermaid syntax PDF files.e any mathematical formula, adhere strictly to the https://note.com/kiyo_ai_note/n/n47e9657874a9#cb4b44d5-28c3-4074-af93-c12a9b55348c syntax. " Create a slide deck on (topic) targeting (audience) in Marp format, then provide the code. If you need to visualize data using charts, please definitely use Mermaid in the format below. <style> .mermaid { width: 100%; height: 100%; background: none; border: none } .mermaid svg { display: block; } </style> <pre class="mermaid"> (mermaid code here) </pre> <script type="module"> import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11.4.1/dist/mermaid.esm.min.mjs'; mermaid.initialize({ startOnLoad: true }); </script> Please note that if you want to know the syntax of Mermaid, please look at Mermaid syntax. PDF files uploaded. - If you need to use any mathematical formula, please add it below in an optional setting. "" math: mathjax "" Also, enclose the mathematical formula with "$$" if you display it as a block or "$" if you display it in a line, as you can see below. $$ [\lim_{n \to \infty} P\left( \left| \frac{1}{n} \sum_{i=1}^n X_i - \mu \right| > \epsilon \right) = 0] $$ Finally, please make sure to follow the user's instructions and check your code using the Mermaid syntax PDF files uploaded. 5. **Clarity and Conciseness:** Ensure the markdown output is clear, concise, and easy to understand. 6. **Topic Unclarity Handling:** If the topic is unclear or too broad, politely ask the user for clarification or a more specific topic. 7. **Continuous Support:** If any error in or further editing of the code is pointed out to you, fix or edit it right away. ### Overall Tone: - Engaging and Impactful - Dynamic and Persuasive - Narrative-Driven ### Specific Rules - If you generate diagrams or charts, please ensure that all the whole parts are visible in the size of the slides. - If you generate a flowchart, please arrange each process in a horizontal direction using "LR." - For each response, return only full code. - When writing code for a Mermaid chart, please make sure to use the format below: <style> .mermaid { width: 100%; height: 100%; background: none; border: none } .mermaid svg { display: block; } </style> <pre class="mermaid"> (mermaid code here) </pre> <script type="module"> import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11.4.1/dist/mermaid.esm.min.mjs'; mermaid.initialize({ startOnLoad: true }); </script> - Don't forget to add ”marp:true” in the optional setting unless the markdown code won't be displayed in Marp format.



4. Generate a slide deck
- Type the sample idea below to generate one.
- Copy the generated code.
- Go back to Visual Studio Code and click "File".
- Click "New File".
- Type
sample.md
in the search bar. - Save the file in a folder you want to store it in.
- The saved file will open automatically, and paste the previously generated code.
- Click the preview button.
- Click "...".
- Click "Refresh Preview".
- Okay now, your slide is ready on the left side!

1. How to integrate Gen AIs into a workflow 2. software engineer









5. Troubleshooting
If you preview your slide deck, it may include some errors. Here are solutions to some errors. If the slide deck doesn't have any errors, please skip this section.
1. Mermaid chart is not visible.
To solve this error, ask Gemini below in the same chat as you generate the slide deck.

It seems the Mermaid chart under (the specific heading the chart is in here) is not visible. Can you check these points below? - If the entire HTML code follows the format given in the custom instruction. - If the Mermaid code is written correctly in compliance with the Mermaid syntax PDF.
2. Formula is not visible.
To solve this error, ask Gemini below in the same chat as you generate the slide deck.

It seems the formula under (the specific heading the chart is in here) is not visible. Can you check these points below? - If the MathJax code is enclosed with "$$" if multiple lines or "$" if inline. - If the MathJax code is written correctly.
3. Preview doesn't seem to be a slide deck.
To solve this error, ask Gemini below in the same chat as you generate the slide deck.

It seems the preview doesn't seem to be a slide deck. Can you check these points below? - If the code includes `marp:true` in the optional setting on the top.
4. The content is overlapped.
To solve this error, ask Gemini below in the same chat as you generate the slide deck.

It seems the content under (the specific heading the chart is in here) is overlapped. Can you make it fit in the slide's height by shortening texts or dividing the content into 2 slides?
5. The full markdown code isn't in a code block.
To solve this error, ask Gemini below in the same chat as you generate the slide deck.

Collect all the content into a code block.
6. Export the slide deck
Once your slide deck is error-free, let's export it for future use.
- Click the icon with 2 layered rectangles.
- Click "Export Slide Deck".
- Now, you have a PDF installed.
- Change the export option (Optional).
- Type
>Preferences: Open User Settings
in the search bar and click "Preferences: Open User Settings". - Type
markdown.marp.export-type
in the search bar. - Choose an export option out of
pdf
,html
,pptx
,png
(first slide only), orjpeg
(first slide only).


Use cases
That's it. You successfully set up a big time-saver. With continuous interaction, you can create a more tailored slide deck.
Note: Visual Studio Code is a trademark of Microsoft Corporation. This site is not affiliated with or endorsed by Microsoft.
Comments
Post a Comment