How to Generate a Slide Deck with Diagrams, Charts, and Formulas with Gemini 2.5 Flash

How to Install Visual Studio Code on Mac (Step-by-Step)

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 the how-to!

d

Step-by-step Guide

1. Download Visual Studio Code

If you have never installed it, read an specific section for your operating system to install it.

d

2. Install the "Marp for VS Code" extension

  1. Open Visual Studio Code.
  2. Click the icon with 4 squares in the left tab bar.
  3. Type "Marp for VS Code" in the search bar of the left tab bar.
  4. Click the "Marp for VS Code" section.
  5. Click "Install."
  6. Type >Preferences: Open User Settings in the search bar in the upper center position of the screen, and click "Preferences: Open User Settings."
  7. Type markdown.marp.html in the User Setting's search bar.
  8. Change the "default" to "all."

3. Set up a Gem on Google Gemini

  1. Go to https://gemini.google.com/gems/create.
  2. Type "Slide Deck Generator" in the Name section and type the custom instruction below in the Instuructions section.
  3. ### Purpose and Aim
       
    
    - To create a copyable 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.
      - If you need to visualize data using charts, include the code below in the optional setting on the top.
          ```markdown
          html:true
          ```
      - If you need to use any mathematical formula, adhere strictly to [this article](https://note.com/kiyo_ai_note/n/n47e9657874a9#cb4b44d5-28c3-4074-af93-c12a9b55348c).
        "
          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. Go to https://drive.google.com/file/d/1gpoAIhSh6mVKY27Riaa-bWEBvQ03fEBk/view?usp=sharing
  5. Click the download button to download the Mermaid syntax zip file.
  6. A highlighted download button for my shared file on Google Drive
    Source: https://drive.google.com/file/d/1gpoAIhSh6mVKY27Riaa-bWEBvQ03fEBk/view?usp=sharing
  7. Unpack the file.
  8. Click "+" to upload Mermaid syntax PDFs in the unpacked folder.
  9. Click "Save."

4. Generate a slide deck

  1. Type the sample idea below into the textbox and execute this prompt.
  2. 1. How to integrate Gen AIs into a workflow
    2. software engineer
  3. Click a button with 2 layered squares to copy the generated code.
  4. Go back to Visual Studio Code, and click "File."
  5. Click "New File."
  6. Type sample.md in the search bar in the upper center position.
  7. Save the file in a folder you want to store it in.
  8. The saved file will open automatically, and paste the previously generated code.
  9. Click the preview button.
  10. A highlighted 'Open Preview to the Slide' button beside the 'Show Quick Pick of Marp Commands' in the screen of Visual Studio Code
    Source: Visual Studio Code
  11. Click "..." .
  12. Click "Refresh Preview."
  13. Okay now, your slide is ready on the left side!

5. Export the slide deck

Finally, let's export it for future use.

  1. Click the icon with 2 layered rectangles.
  2. A 'Show Quick Pick of Marp Commands' button beside the 'Open Preview to the Slide' in the screen of Visual Studio Code
    Source: Visual Studio Code
  3. Click "Export Slide Deck."
  4. Now, you have a PDF installed.
  5. Change the export option (Optional).
    1. Type >Preferences: Open User Settings in the search bar and click "Preferences: Open User Settings."
    2. Type markdown.marp.export-type in the search bar.
    3. Choose an export option out of pdf, html, pptx, png (the first slide only), or jpeg (the first slide only).

Use cases

  • As a lesson slide deck: streamlining lesson material creation for efficiency and accuracy.
  • As a marketing material: uploading your company's data and creating a slide deck with a data visual in a few seconds.
  • As a personalized sales proposal: quickly generating customized sales presentations tailored to potential clients.

  • Troubleshooting

    If your slide deck is having some errors, please read this article below.

    Also Read
    thumbnail of the article 'How to Troubleshoot Errors with a Gemini-Made Slide Deck'
    How to Troubleshoot Errors with a Gemini-Made Slide Deck

    That's it. You successfully set up a big time-saver. With continuous interaction, you can create a more tailored slide deck.

    Comments