Creating your first document

Welcome to the world of Quarto, where creating beautiful and interactive documents has never been simpler! Whether you’re a seasoned writer, a data enthusiast, or just starting out, Quarto empowers you to craft compelling content that informs, engages, and stands out. Today, we’ll embark on a journey to create your first Quarto document, guiding you through every step from setup to publication.

Ready? Let’s dive in!

Open RStudio and navigate to File > New File > Quarto Document. Here comes the fun part - choosing your format and theme!

  • Formats: HTML, PDF, Word, and more - pick the one that best suits your needs.
  • Themes: From clean and elegant to playful and vibrant, select a theme that reflects your style.

For this tutorial, we’ll create an HTML document with the “default” theme. Once you’ve made your selections, click “Create” to generate your new Quarto document.

Writing with Markdown

Quarto leverages Markdown, a simple yet powerful language for writing. Think of it as plain text on steroids, allowing you to format headings, paragraphs, quotes, and even code, all through intuitive symbols.

Quick Demo of Markdown

Welcome to the wondrous world of Markdown within Quarto, where crafting compelling content becomes a dance between text and code! This tutorial equips you with the essential tools to weave narrative, integrate R, and create stunning documents.

Markdown Essentials: Building Your Textual Toolkit

Markdown embraces simplicity, using symbols to format your text beautifully. Imagine it as a secret code for writers:

  • Headings: Announce your sections with # for main titles, ## for subtitles, and so on.
  • Paragraphs: Just hit enter to separate paragraphs, keeping your text clear and readable.
  • Emphasis: Highlight key points with **bold** for bold and _italics_ for emphasis.
  • Lists: Organize information with * or - for unordered lists and 1. or a. for ordered ones.
  • Quotes: Share impactful thoughts with > quotes.
Exercise:
  1. Open a new Quarto document and practice these basics. Craft a mini-blog post with a title, headings, paragraphs, and a bulleted list.

Code Integration: Bringing R to Life

Quarto’s magic lies in marrying text and R code seamlessly. Encapsulate your R magic within ```{r} chunks:

print("Hello from R!")
[1] "Hello from R!"
1 + 2
[1] 3

Click the “Run” button, and voila! R executes the code, displaying the output right within your document.

Exercise:
  1. Add an R chunk that calculates the average of numbers and displays the result within your blog post.

Markdown Magic: Advanced Techniques

Markdown offers more than just the basics. Spice up your content with these gems:

  • Links: Connect readers to further information with [text](link).
  • Images: Showcase visuals with ![alt text](image.jpg).
  • Code Blocks: Highlight code snippets using triple backticks and language specificators.
  • Tables: Organize data clearly with | Column 1 | Column 2 |, adding rows and formatting as needed.
Exercise:
  1. Add a link to an interesting website, incorporate an image related to your blog post, and create a simple table using Markdown syntax.

Beyond the Basics

Explore Quarto’s documentation for a deeper dive:

  • Themes: Choose a theme that reflects your style and brand.
  • Interactive Elements: Craft dynamic charts, dashboards, and even embed live R sessions.
  • Output Formats: Export your work as HTML, PDF, Word, and more.

Remember: Experimentation is key! Practice, explore, and unleash the power of Markdown and Quarto.

Additional Resources: