ConTeXt:切換 \title 和 \subject 的字型

ConTeXt:切換 \title 和 \subject 的字型

\title我正在嘗試更改subjectConTeXt 中兩級標題的字體。儘管更改標題字體的程式碼與更改主題字體的程式碼沒有什麼不同,但 Zapf Chancery 中僅顯示標題。

這是我的 MWE:

\define[2]\mytitle{%
  \switchtobodyfont[chorus]%
  #2
}

\define[2]\mysubject{%
  \switchtobodyfont[chorus]%
  #2
}

\setuphead[title][command=\mytitle]
\setuphead[subject][command=\mysubject]

\starttext
\title{In Zapf Chancery}
\subject{Apparently the default font. Why?}

And in the default font, just as expected.
\stoptext

它產生以下輸出:

最小工作範例的輸出

\switchtobodyfont[chorus]刪除對in的呼叫mytitle會使字幕使用 Zapf Chancery,但是,我無法讓它們同時使用 Zapf Chancery。

在此先感謝您的幫忙!

注意:大約兩週前我已經在德國論壇 TeXWelt 上問過這個問題,但不幸的是沒有得到答案。看https://texwelt.de/fragen/29432/context-schriftart-einer-uberschrift-und-unteruberschrift-andern。

答案1

使用style鑰匙。

\setuphead
  [title,subject]
  [style=\switchtobodyfont[chorus]]


\starttext
\title{In Zapf Chancery}
\subject{Apparently the default font. Why?}

And in the default font, just as expected.
\stoptext

標題和主題的合唱

如果您想要不同的款式/尺寸,您可以選擇一件 fortitle和一件 for subject

相關內容