typst-physics icon indicating copy to clipboard operation
typst-physics copied to clipboard

`evaluated` location

Open dunzhichen opened this issue 2 months ago • 3 comments

Using the latest Typst 0.13.1, web app

#import "@preview/physica:0.9.6" :*

$evaluated(pdv(vb(f),vb(u)))_((vb(x)_0,vb(u)_0))$

I am getting

Image

Feel the (x_0,u_0) location needs to be adjusted. Is there a way to move it up a bit?

dunzhichen avatar Oct 17 '25 07:10 dunzhichen

I believe the location is specified by the font designer.

Nevertheless, you can move it like this:

Image
#import "@preview/physica:0.9.6": *

$evaluated(pdv(vb(f), vb(u)))_#move(dy: -5pt, $script((vb(x)_0,vb(u)_0))$)$

$ evaluated(pdv(vb(f), vb(u)))_#move(dy: -7pt, $script((vb(x)_0,vb(u)_0))$) $

YDX-2147483647 avatar Oct 17 '25 07:10 YDX-2147483647

Hmm yeah. I noticed it myself before and wondered if this was a problem that has been arising so frequently that this package should do the move for users? But that highly depends on the font.. and it's unfortunate that the default font has this issue:(

Followup: I tweaked Typst's impl code and compared my locally-built Typst vs LaTeX's rendering carefully. My conclusion is the font (New Computer Modern)'s subscript_baseline_drop_min (a field in the font's MathConstants Table) is ~3 times the value in LaTeX's default font (Computer Modern).

Leedehai avatar Oct 17 '25 08:10 Leedehai

It's not perfect, but here's a snippet I'd like to share:

#import "@preview/physica:0.9.7": *

$evaluated(pdv(vb(f), vb(u)))_(#place(bottom, box($script((vb(x)_0,vb(u)_0))$, height: 0pt), float: true, clearance: 0pt))$

$ evaluated(pdv(vb(f), vb(u)))_(#place(bottom, box($script((vb(x)_0,vb(u)_0))$, height: 0pt), float: true, clearance: 0pt)) $
Image

azyarashi avatar Nov 08 '25 12:11 azyarashi