夸托beamer演示编号部分

n7taea2i  于 12个月前  发布在  其他
关注(0)|答案(2)|浏览(90)

我正在用夸托构建一个文档,我使用的是1. 3. 340版本。我安装了一个基于TeX Live tinytex::install_tinytex()的LaTeX发行版,我使用的是0. 45版本。
我与YAML的文档如下:

---
title: "Title"
format: 
  beamer:
    pdf-engine: xelatex
    number-sections: true
    number-depth: 3
editor: visual
---

## Section

This is the content of the section

### Subsection

This is the content of the subsection

字符串
然而,我得到以下结果的部分没有编号:


的数据



如何给章节标题编号?代码中是否有错误?

mwkjh3gx

mwkjh3gx1#

你所说的sectionsubsection不是一个节或子节。节是beamer中的顶级节级别,在夸托中,你可以用

# section name

字符串
如果您使用较低级别的标题,例如夸托中的#####,您将获得beamer帧标题或块标题。如果您真的确定,您可以将帧标题和块标题编号:

---
title: "Title"
format: 
  beamer:
    pdf-engine: xelatex
editor: visual
header-includes: |
  \setbeamertemplate{section in toc}[sections numbered]
  \newcounter{block}
  \makeatletter
  \setbeamertemplate{block begin}{%
    \addtocounter{block}{1}%
    \par\vskip\medskipamount%
    \begin{beamercolorbox}[colsep*=.75ex]{block title}
      \usebeamerfont*{block title}\theblock{} \insertblocktitle%
    \end{beamercolorbox}%
    {\parskip0pt\par}%
    \ifbeamercolorempty[bg]{block title}
    {}
    {\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}%
    \usebeamerfont{block body}%
    \begin{beamercolorbox}[colsep*=.75ex,vmode]{block body}%
      \ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%
  }
  \setbeamertemplate{frametitle}{%
    \ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
    \@tempdima=\textwidth%
    \advance\@tempdima by\beamer@leftmargin%
    \advance\@tempdima by\beamer@rightmargin%
    \begin{beamercolorbox}[sep=0.3cm,wd=\the\@tempdima]{frametitle}
      \usebeamerfont{frametitle}%
      \vbox{}\vskip-1ex%
      \if@tempswa\else\csname beamer@fteleft\endcsname\fi%
      \strut\insertframenumber{} \insertframetitle\strut\par%
      {%
        \ifx\insertframesubtitle\@empty%
        \else%
        {\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\strut\insertframesubtitle\strut\par}%
        \fi
      }%
      \vskip-1ex%
      \if@tempswa\else\vskip-.3cm\fi% set inside beamercolorbox... evil here...
    \end{beamercolorbox}%
  }
  \makeatother
---

# Section

## frametitle

This is the content of the section

### block

This is the content of the subsection


的数据

bxjv4tth

bxjv4tth2#

Christophe Dervieux(夸托开发人员)通过https://github.com/quarto-dev/quarto-cli/pull/6958修复了该问题。现在您可以获得所需的结果。

相关问题