Code
<- outp_m %>%
archivableDocuments5days filter(是否归档=='未归档' & 出院天数<=5) %>%
select(c(住院号, 病人姓名, 出院时间, 住院天数, 类型, 出院天数, 到期时间_5天, 管床医生)) %>%
arrange(desc(出院天数), 住院天数) %>%
mutate(出院天数 = as.character(出院天数)) # 没搞明白,出院天数不转换为字符型时,出院天数都会少1。
warning: false
format-links: [docx]
format:
html:
toc: true
code-fold: true
toc-depth: 5
docx:
reference-doc: custom-reference-doc.docx
number-sections: true
number-depth: 3
pdf:
documentclass: scrartcl
papersize: A4
The Render buttons in RStudio and VS Code will not automatically render all formats if the document isn’t part of a Quarto website. To render all formats use quarto render on the command line:
quarto render multi-format.qmd
Pandoc自带一个样式文件,在样式文件的基础上修改样式,在样式文件对应的样式文本基础上修改,样式文本不要删除。样式文件通过以下代码导出:
quarto pandoc -o custom-reference-doc.docx --print-default-data-file reference.docx
修改样式后,将文件上传覆盖好可应用新样式。
wget -qO- "https://yihui.org/tinytex/install-bin-unix.sh" | sh
cd ~/posts/her2 # qmd所在文件夹
quarto add kapsner/authors-block
title: Her2
authors:
- name: Yating Hou
affiliations:
- ref: mmph
corresponding: false
email: stuythou@163.com
orcid: 0000-1111-2222-3333
equal-contributor: true
- name: Zichuan Liu
affiliations:
- ref: gmui
orcid: 0000-3333-2222-1111
email: 13719063021@126.com
equal-contributor: true
- name: Xingyang Xue
affiliations:
- ref: gmui
- ref: gmut
orcid: 0000-2222-1111-3333
email: xxy1023970@126.com
equal-contributor: true
- name: Yisheng Huang
affiliations:
- ref: mmph
orcid: 0000-2222-1111-3333
email: hysd0760@163.com
corresponding: true
affiliations:
- id: mmph
name: Department of Oncology, Maoming People's Hospital, 101 Weimin Road, Maoming, 525000, Guangdong, China.
- id: gmut
name: Department of Thoracic Surgery, Affiliated Cancer Hospital & Institute of Guangzhou Medical University, Guangzhou, 510095, Guangdong, China.
- id: gmui
name: Internal Medicine Section 2, Affiliated Cancer Hospital & Institute of Guangzhou Medical University, Guangzhou, 510030, Guangdong, China.
filters:
- authors-block
经测试发现: 1. authors要跟在title后面。 2. 最后只能隔一行
This is an example of a ‘folded’ caution callout that can be expanded by the user. You can use collapse="true"
to collapse it by default or collapse="false"
to make a collapsible callout that is expanded by default.
Ctrl + Q
,在Tools \(\rightarrow\) Modify Keyboard Shortcuts 搜索blockquote,设置为Ctrl + Q
。bibliography: 'https://api.citedrive.com/bib/5bf3dbf3-77b6-4f56-99a3-9f6a2677dcce/references.bib?x=eyJpZCI6ICI1YmYzZGJmMy03N2I2LTRmNTYtOTlhMy05ZjZhMjY3N2RjY2UiLCAidXNlciI6ICI2NTk4IiwgInNpZ25hdHVyZSI6ICI3NDViNzNkNTBjOGJjZmUyNzdkNThhZjQ5Yzc3MTdjZjYzN2RmZmUyMzk2NzdjOTQwZGM2YjVhZjdlMmE5OTFjIn0=/bibliography.bib'
csl: "data/critical-care.csl"
comments:
hypothesis: true
posts各下级文件夹里的index.qmd
可以命名为具体的名称,方便选项卡的分辨,不影响blog的正确显示,如数据环境建设.qmd
quarto在render整数时,可能出现少1的情况。如以下代码中的出院天数
,转换为字符型则问题消失。出院天数
是由as.integer(Sys.Date() - as.Date(df$出院时间))
得到的。
Render
跟Run
的执行环境不一样,解决问题的根本方法为在qmd文件开头执行Sys.setenv(TZ="Asia/Shanghai")
<- outp_m %>%
archivableDocuments5days filter(是否归档=='未归档' & 出院天数<=5) %>%
select(c(住院号, 病人姓名, 出院时间, 住院天数, 类型, 出院天数, 到期时间_5天, 管床医生)) %>%
arrange(desc(出院天数), 住院天数) %>%
mutate(出院天数 = as.character(出院天数)) # 没搞明白,出院天数不转换为字符型时,出院天数都会少1。
# 获取posts目录下所有子文件夹名称
<- dir("posts", full.names = FALSE)
subdirs
# 循环遍历所有子文件夹,并重命名其下存在的index.qmd文件
for (subdir in subdirs) {
<- paste0("posts/", subdir, "/index.qmd")
index_file
# 检测index.qmd文件是否存在
if (file.exists(index_file)) {
<- paste0("posts/", subdir, "/", subdir, ".qmd")
new_name
# 重命名文件
file.rename(index_file, new_name)
} }
删除
_site
文件夹下的listing.json
,search.json
和_freeze/posts
文件下的所有子文件夹。再通过生成任意一个posts下的qmd文件以重新生成。
code-link
.chalkboard
.multiplex
.code-line-numbers
.output-location
.echo: fenced
.