Quarto Authoring

1 Overview

2 Output formats

2.1 Format options

Quarto는 노트북을 수십 가지의 다양한 출력 형식으로 렌더링하는 기능을 지원합니다. 기본적으로 HTML 형식이 사용되지만, 문서 옵션에서 다른 형식을 지정할 수 있습니다.
code-line-numbers: true : 코드에 숫자 넣어줌

2.1.1 Introduction

code-line-numbers
  pdf:
    code-line-numbers: true
Packages
library(openintro) # for data
library(tidyverse) # for data wrangling and visualization
library(knitr) # for table
library(broom) # for model summary

2.2 Multiple Formats

mutliple formats
title: "Quarto Authoring"
autho: "KIDI"

highlight-style: pygments

format:
  html: 
    code-fold: true
    html-math-method: katex
    
  pdf:
    code-line-numbers: true
    geometry: 
      - top=30mm
      - left=30mm
      
  docx: default
    
excecute:
  cashe: true

다음 줄은 모든 형식에 적용되는 문서 형식 옵션이므로 루트 수준에서 지정됩니다.

highlight-style
highlight-style: pygments

3 Rendering

한꺼번에 여러포맷 렌더링 할 경우 cli 명령을 사용

Code
quarto::quarto_render(
  "authoring.qmd", 
  output_format = c("pdf", "html", "docx")
)

4 Sections

  • table of contents(toc) : root 레벨
toc
toc: true
  • section numbering : root 레벨
number-sections
number-sections: true

5 Equations

price = \hat{\beta}_0 + \hat{\beta}_1 \times area + \epsilon inline math: E = mc^{2}

price = \hat{\beta}_0 + \hat{\beta}_1 \times area + \epsilon

6 Citations

제대로 이해 못함

7 Diagrams

https://quarto.org/docs/authoring/markdown-basics.html#equations

flowchart LR
  A[Hard edge] --> B(Round edge)
  B --> C{Decision}
  C --> D[Result one]
  C --> E[Result two]

8 Cross References

교차 참조는 번호가 매겨진 참조와 그림, 표, 방정식, 섹션에 대한 하이퍼링크를 제공하여 독자가 문서를 더 쉽게 탐색할 수 있도록 해줍니다. 교차 참조가 가능한 엔터티에는 일반적으로 레이블(고유 식별자)과 캡션이 필요합니다.

price = \hat{\beta}_0 + \hat{\beta}_1 \times area + \epsilon \tag{1}

Then, add a cross reference using the Inserted Anything tool in the visual editor. You might add a sentence like We can fit a simpler linear regression model of the form shown in to contextualized the cross reference and then add the reference to the end of that sentence.

we can fit a simple linear regression model of the form shown in Equation 1

8.1 Exploratory Data Analysis

We present the results of exploratory data analysis in Section 8.1 and the regression model in Equation 1.

Code
ggplot(mpg, aes(x=hwy, y=cty, color=cyl)) +
  geom_point(alpha=0.5, size=2) +
  scale_color_viridis_c() +
  theme_minimal()


ggplot(mpg, aes(x=hwy, y=cty, color=displ)) +
  geom_point(alpha=0.5, size=2) +
  scale_color_viridis_c(option="E") +
  theme_minimal()
(a) Color by number of cylinder
(b) color by engine displacement, in liters
Figure 1: City and highway mileage for 38 popular models of cars.

Figure 1 displays the relationship between these two variables in a scatterplot.

Table 1: Summary statistics for price and area of houses in Duke Forest
Code
iris

Table 1 show boots and chicks

9 Callouts

콜아웃은 특정 개념에 대해 특별히 주의를 끌거나 특정 콘텐츠가 일부 시나리오에만 보완적이거나 적용 가능하다는 것을 보다 명확하게 나타내는 훌륭한 방법입니다.

note-defalut-icon

This is a pretty incomplete analysis, but hopefully the document provides a good overview of some of the authoring features of Quarto!

one of five types of callout (note, tip, important, caution, or warning), customize its appearance (default, simple, or minimal), and decide whether you want to show the icon.

tip-simple-noicon

tip type, simple appearance, no icon

tip-simple-with icon

tip type, simple appearance, with icon

warning-minimal-icon

tip type, simple appearance, no icon

10 Article layout

We can use the column: page-right cell option to indicate we would like our figure to occupy the full width of the screen, with some inset. Go ahead and add this chunk option to the chunk labeled Figure 2.`

Code
ggplot(mpg, aes(x=hwy, y=cty, color=cyl)) +
  geom_point(alpha=0.5, size=2) +
  scale_color_viridis_c() +
  theme_minimal()


ggplot(mpg, aes(x=hwy, y=cty, color=displ)) +
  geom_point(alpha=0.5, size=2) +
  scale_color_viridis_c(option="E") +
  theme_minimal()
(a) Color by number of cylinder
(b) color by engine displacement, in liters
Figure 2: City and highway mileage for 38 popular models of cars.