小编Mic*_*l K的帖子

如何使用主题中本地存储的字体覆盖默认字体?

我正在使用 Quarto 构建一个网站,并尝试覆盖主题中的默认字体。(我的总体目标是使用本地谷歌字体而不是使用谷歌API)。

我的_quarto.yml样子是这样的:

project:
  type: website

format:
  html:
    theme: 
      light: [flatly, light.scss]
Run Code Online (Sandbox Code Playgroud)

确实light.scss看起来像那样。所有字体都在fonts/

/*-- scss:defaults --*/

/* lato-regular - latin-ext_latin */
@font-face {
  font-display: swap; 
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/lato-v23-latin-ext_latin-regular.woff2') format('woff2'), /* Chrome 36+, Opera 23+, Firefox 39+ */
       url('fonts/lato-v23-latin-ext_latin-regular.woff') format('woff'); /* Chrome 5+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
Run Code Online (Sandbox Code Playgroud)

我正在使用 chromium 中的开发人员模式来调查是否使用了本地文件。不幸的是,我的custom.scss ie,(light.scss)无法覆盖默认配置。

如何才能覆盖 api 的使用并使用本地字体呢?

css google-fonts quarto

8
推荐指数
1
解决办法
1219
查看次数

如何配置批处理脚本以使用 future.batchtools (SLURM) 并行化 R 脚本

我试图使用 future.batchtools 包在 SLURM HPC 上并行化 R 文件。虽然脚本在多个节点上执行,但它只使用 1 个 CPU 而不是可用的 12 个。

到目前为止,我尝试了不同的配置(参见附上的代码),但都没有达到预期的结果。我的 bash 文件配置如下:

#!/bin/bash
#SBATCH --nodes=2
#SBATCH --cpus-per-task=12

R CMD BATCH test.R output
Run Code Online (Sandbox Code Playgroud)

在 R 中,我使用 foreach 循环:

# First level = cluster
# Second level = multiprocess 
# https://cran.r-project.org/web/packages/future.batchtools/vignettes/future.batchtools.html
plan(list(batchtools_slurm, multiprocess))

# Parallel for loop
result <- foreach(i in 100) %dopar% {
       Sys.sleep(100)
return(i) 
}
Run Code Online (Sandbox Code Playgroud)

如果有人可以指导我如何为多个节点和多个核心配置代码,我将不胜感激。

parallel-processing hpc future r slurm

5
推荐指数
1
解决办法
737
查看次数

标签 统计

css ×1

future ×1

google-fonts ×1

hpc ×1

parallel-processing ×1

quarto ×1

r ×1

slurm ×1