#let java = read("Typst.java")
#figure(
raw(java, lang: "java"),
caption: [Java code imported]
)
#figure(
```java
class Typst {
public static void main (String[] args)
{
// This be a comment. A comment it be.
System.out.println("Typst is fun");
}
}
```,
caption: [Java code inline]
)
And this isn't a listing:
#raw(java, lang: "java")
The inline code looks right. It’s centered overall on the page, but the text is aligned left within the block. However, the imported external code is weird, with every single line centered. Passing an align parameter to the raw function has no effect.
The raw block outside the figure works fine, and is left aligned.