Leedehai / typst-physics

physica: vectors, fields, differentials, derivatives, Dirac brakets, tensors, and more. See examples in the manual PDF.
https://github.com/Leedehai/typst-physics
MIT License
312 stars 8 forks source link

Potential error when evaluating pdv #15

Closed drxm1 closed 9 months ago

drxm1 commented 9 months ago

Hi, I am encountering an error when using the pdv function, for example $ pdv(,t,2) $ and am trying to find the cause. In an empty document it works fine:

#import "@preview/physica:0.8.1": *
$pdv(x,y)$

But in my document: typst 0.7.0 (bcab7705)

#import "template.typ": *
#import "@preview/metro:0.1.0": qty
#import "@preview/truthfy:0.2.0": generate-table, generate-empty 
#import "@preview/codelst:1.0.0": sourcecode
#import "@preview/physica:0.8.1": *
#import "@preview/big-todo:0.2.0": todo
// ...
$ pdv(,t, 2) $

the following error occurs: error: unknown variable: content ┌─ @preview/physica:0.8.1\physica.typ:549:19 │ 549 │ if type(last) == content { │ ^^^^^^^

help: error occurred in this call of function partialderivative

Where my template contains no variable called content.

This could of course just be a conflict with other includes, but I did not find the cause and am wondering if it could be an error in the library. Thank you for a response.

Actually it seems to be specific to my compiler or version of typst.

drxm1 commented 9 months ago

Updating typst resolved the issue^^

Leedehai commented 9 months ago

Glad you solved it:) it appears the compiler was not checking the minimum version requirement in the package's manifest (typst.toml compiler = "0.8.0")..