New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let smallcaps
be element function
#3977
Comments
If this is a good suggestion, I can help to implement it and send a PR :) |
I slightly modified #set align(center)
$ #smallcaps[SmallCaps] $
#show smallcaps: set text(font: "linux libertine", fill: blue)
$ #smallcaps[SmallCaps] $
#show math.equation: it => {
show smallcaps: set text(font: "linux libertine", fill: red)
it
}
$ #smallcaps[SmallCaps inside Math Equation] $
#smallcaps[SmallCaps outside Math Equation] |
The reason why |
It is. Math fonts rarely (never?) have small caps, because they're not intended for use as a text font. |
When writing algorithm (using algorithmic:0.1.0), I meet such need: #algorithm({
import algorithmic: *
Function("NewTime", args: ($t$,), {
While(cond: $#CallI("CmpTime")[$t_"new"$ = #CallI("GetTime")[], $t$] != 1$, {
Cmt[pause for a while and retry]
State[*continue*]
})
Return[$t_"new"$]
})
}) Where Though my need can be satisfied when that issue is resolved, I see that issue has been opened for a long time and seems not to be resolved in short time. Maybe just making |
The reason why I didn't make At the same time, I can see how it's useful to be able to process smallcaps with show rules, since sometimes the smallcaps are in a different font and that can't be selected automatically by Typst. |
Thanks for your reply.
Yes, the example (fill
I agree with your opinion that |
Description
emph
,strong
,highlight
and some other functions are element functions, so that we can useset
/show
rules to customize their behavior. This issue suggestssmallcaps
be element function.For the past few days, I looked into how we can customize text font of
smallcaps
. Especially in math equations, the default math font does not supportsmallcaps
feature. For fine-grained adaptation purpose (i.e. just change font ofsmallcaps
, instead of all text font in math environment), I attempted to customize font ofsmallcaps
in math equations usingshow
rules, but I found it impossible sincesmallcaps
is not element function.Use Case
just like what we can do with
strong
,emph
...The text was updated successfully, but these errors were encountered: