Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Texts, Images, and Tables #45

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Write a description for texts-images-tables chapter
This commit adds a description for the chapter and deletes the previous instructions on modifying texts, images and tables
  • Loading branch information
Reza Hakimazar committed Nov 19, 2024
commit 1650ea0ed3953ec17ae0f5c73654908775459b9b
108 changes: 6 additions & 102 deletions chapters/texts-images-tables.qmd
Original file line number Diff line number Diff line change
@@ -1,106 +1,10 @@
---
title: "Texts, Images, and Tables"
abstract: "This chapter shows how to style your text, add images, and draw tables."
---
# Why does it matter?

### Text Formatting

First and foremost, Quarto is a publishing system. Therefore, it has the flexibility to format text in various ways. It is possible to write in visual or source modes. In visual editor no syntax is involved to change the style of text, as opposed to, source. Below you can see the tables that introduce the syntax related to a specific style such as bold, italic, etc.

#### Bold, Italic, and more...

+------------------------------------------------------------------+------------------------------------------------------------------+
| Syntax | Output |
+==================================================================+==================================================================+
| ``` markdown | *Pizza* **never** texts ***back***. |
| *Pizza* **never** texts ***back***. | |
| ``` | |
+------------------------------------------------------------------+------------------------------------------------------------------+
| ``` markdown | E=mc^2^ — my ex~2~cuse for eating dessert ~~twice~~ three times! |
| E=mc^2^ — my ex~2~cuse for eating dessert ~~twice~~ three times! | |
| ``` | |
+------------------------------------------------------------------+------------------------------------------------------------------+
| ``` markdown | `verbatim code` |
| `verbatim code` | |
| ``` | |
+------------------------------------------------------------------+------------------------------------------------------------------+

### Headings

+-----------------+-----------------------------------+
| Markdown | Output |
+=================+===================================+
| ``` markdown | # Header 1 {.heading-output} |
| # Header 1 | |
| ``` | |
+-----------------+-----------------------------------+
| ``` markdown | ## Header 2 {.heading-output} |
| ## Header 2 | |
| ``` | |
+-----------------+-----------------------------------+
| ``` markdown | ### Header 3 {.heading-output} |
| ### Header 3 | |
| ``` | |
+-----------------+-----------------------------------+
| ``` markdown | #### Header 4 {.heading-output} |
| #### Header 4 | |
| ``` | |
+-----------------+-----------------------------------+
| ``` markdown | ##### Header 5 {.heading-output} |
| ##### Header 5 | |
| ``` | |
+-----------------+-----------------------------------+
| ``` markdown | ###### Header 6 {.heading-output} |
| ###### Header 6 | |
| ``` | |
+-----------------+-----------------------------------+

### Links

Links can be added to a Quarto document by simply using <https://quarto.org>. To link a word, the following syntax is used:
``` markdown
[Quarto Website](<https://quarto.org>)
```
[Quarto Website](<https://quarto.org>)

### Tables

To draw a table on Quarto, you should draw a table! Let's find out with an example:

``` markdown
| Fruits | Animals| Trees |
|:------:|:-------|-------:|
| Orange | Tiger |Sequoia |
| Apple |Dolphin | Cedar |
| Banana | Wolf | Pine |
```

| Fruits | Animals| Trees |
|:------:|:-------|-------:|
| Orange | Tiger |Sequoia |
| Apple |Dolphin | Cedar |
| Banana | Wolf | Pine |

As you see, adding `:` to the left, right or both sides of the dashes will affect the alignment of a column. For further customization options regarding tables see [Quarto's documentation](https://quarto.org/docs/authoring/tables.html) on tables.

### Images

In the simplest form, images can be added to a Quarto document by using
``` markdown
![Description](image address)
```
![Photo by Michael Baccin on Unsplash](..\images\Yellow House.jpg)

Images can also be turned into links. It is basically combining the syntax of an image and a link together:
``` markdown
[![Description](image address)](Link)
```
[![Photo by Kiarash Mansouri on Unsplash](..\images\Up.jpg)](https://unsplash.com/photos/a-yellow-house-with-a-mountain-in-the-background-ZcIquAS0T-I)


For better accessibility, it is possible and recommended to add alt text to the images.

``` markdown
[![Description](image address){fig-alt="Alt text"}](Link)
```

[![Photo by Anita Austvika on Unsplash](..\images\Vase.jpg){fig-alt="A vase with yellow, red, purple and white flowers."}](https://unsplash.com/photos/a-white-pitcher-filled-with-flowers-on-top-of-a-table-6hZbcPBdyek)
Creating educational materials always involves writing texts and displaying images.
It is essential for instructors and researchers to communicate their resources and findings as efficiently as possible.
A key to conveying the message effectively is the ability to adapt the materials and choose the best way to present them.
In this chapter, we discuss how to modify the presentation of texts, design tables, and add images to give the materials some energy!