Releases: jakobjpeters/Typstry.jl
Releases Β· jakobjpeters/Typstry.jl
v0.4.0
Typstry v0.4.0
Features
- Support Typst version 0.12
- Throw a
ContextError
forcontext
values of an incorrect type - The
preamble
used inrender
and someshow
methods can now be specified usingset_preamble
render
now supports theignorestatus = true
keyword parameter- Emulation of Typst command line interface via the
typst
function
Bug Fixes
- If a
TypstCommand
orTypstString
contains any characters that satisfy!isprint
,
theirshow
methods now print a format that preserves those characters - Account for a Typst bug with single-letter strings in
math
mode - The
"TYPST_FONT_PATHS"
environment variable is no longer overridden inrender
Merged pull requests
- Add
typst
function to mimic command line interface (#8) (@GunnarFarneback)
v0.3.0
Typstry.jl v0.3.0
Strings
context
- New default key
backticks = 3
- The
indent
setting is nowtab_size = 2
, to correspond with Typst's default parameter
- New default key
show_typst
- Implemented for
VersionNumber
,Dates.Date
,Dates.DateTime
,Dates.Period
,Dates.Time
,Docs.HTML
,LaTeXStrings.LaTeXString
, andMarkdown.MD
AbstractFloat
,Irrational
, andSigned
inmarkup
mode are now enclosed in dollar signsBool
inmarkup
mode is no longer prefixed by a number sign- An
AbstractChar
andAbstractString
incode
andmath
mode is no longer escaped and quoted - A
Complex
is no longer parenthesized when one of the terms is zero - Typst parameters are now printed on their own lines using the
indent
anddepth
settings
- Implemented for
- Improved error handling for interpolating incomplete expressions into a
@typst_str
Commands
- The
preamble
used at the beginning of Typst source files is now exported render
now supports a custompreamble
- The
show
method with theapplication/pdf
,image/png
, andimage/svg+xml
MIME types now supports- A custom
preamble
Typst
andTypstText
- A custom
- Removed an unnecessary
TypstCommand
constructor
Bug Fixes
@typst_str
- No longer errors during interpolation when
TypstString
isn't loaded - Handles interpolation and escaped interpolation in the same manner as a
String
@typst_str
syntax and pretty-printing withshow(::IO, ::TypstString)
now correspond
- No longer errors during interpolation when
show_typst
AbstractFloat
values that satisfyisinf
andisnan
now correspond tocalc.inf
andcalc.nan
, respectivelyAbstractString
andDocs.Text
no longer escape dollar signs- Removed incorrect special formatting of
Docs.Text
inmarkup
mode
- A
@typst_cmd
with no parameters no longer inserts an empty parameter
v0.2.0
Typstry.jl v0.2.0
Strings
- Pass formatting configuration to a
TypstString
with keyword parameters instead ofPair{Symbol}
s - Remove type piracy of
show
with thetext/typst
MIME type- Values may instead be wrapped in
Typst
- Formatting may be configured by implementing a custom
context
- Values may instead be wrapped in
- Support
show(::IO, ::MIME"application/pdf", ::TypstString)
- Replace
typst_text
constructor with theTypstText
wrapper show_typst
- Implement
show_typst(x)
, which prints tostdout
- Implemented for
AbstractArray
,Complex{Bool}
,Tuple
,Typst
,TypstText
, andUnsigned
Nothing
now corresponds to the Typstnone
AbtractMatrix
andAbstractVector
incode
mode now correspond to a Typst arrayOrdinalRange{<:Integer, <:Integer}
andStepRangeLen{<:Integer, <:Integer, <:Integer}
code
mode implicitily uses the Typst defaultstep
if it is equal to1
markup
andmath
mode now correspond to a Typst vector
- The
Docs.Text
format is simpler inmarkup
mode- This introduced a bug, which is patched in v0.3.0
- New default setting
parenthesize = true
- Used for
Complex
andRational
- Used for
- Rename the
inline
setting toblock
for consistency with Typst'sequation
function- This toggles the default behavior, which is now inline
- Implement
Commands
- Easily
render
a Julia value to a Typst source file and compiled document - Increase coverage of the
Cmd
interface implementation forTypstCommand
- Improve error handling
- The Typst compiler prints error messages to
stderr
- If not
ignorestatus
, a Typst compiler error will throw a JuliaTypstError
- The Typst compiler prints error messages to
Bug Fixes
- Patch an assumption in
repr(::MIME, ::AbstractString)
that is incorrect forTypstString
- Format values in containers using
show(::IO, ::MIME"text/typst", ::Typst)
show_typst(io, ::AbstractString)
now correctly escapes double quotation marksand dollar signs.show_typst(io, ::Complex)
- Fix
Complex{Bool}
- Handle negative imaginary part
- Fix
v0.1.0
Typstry.jl v0.1.0
Strings
show_typst
prints a value in Typst format, with Julia settings and Typst parameters given in anIOContext
show(::IO, ::MIME"text/typst", ::Any)
provides default settings toshow_typst
Mode
is a setting that specifies the current Typst contextTypstString
is anAbstractString
implementing theString
interface and usesshow(::IO, ::MIME"text/typst", ::Any)
to print values to Typst format@typst_str
constructsTypstString
s and supports formatted interpolationtypst_text
constructs aTypstString
usingprint
instead ofshow(::IO, ::MIME"text/typst", ::Any)
show(::IO, ::Union{MIME"image/png", MIME"image/svg+xml}, ::TypstString)
renders aTypstString
and prints it in PNG or SVG format
Commands
TypstCommand
implements theCmd
interface and represents the Typst compiler@typst_cmd
constructsTypstCommand
sjulia_mono
is an artifact containing the JuliaMono typeface, which may be used in rendered Typst documents
Merged Pull Requests
- Implement
@T_str
by @nialamarcotte in #1