This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Expressing the Factur-X schema in Typst | |
| #let factur-x-ns = pdf.xmp.namespace( | |
| prefix: "fx", | |
| urn: "urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#", | |
| ) | |
| #let factur-x = factur-x-ns.schema( | |
| DocumentType: ( | |
| // The type can be str (Text), bool (Boolean), datetime (Date), int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// Role the structure element fulfills in the document for PDF 1.7 and below. | |
| /// | |
| /// These are the predefined standard roles in PDF 1.7 and below, matching the | |
| /// `https://www.iso.org/pdf/ssn` namespace. The writer may write their own | |
| /// roles and then provide a mapping with [`StructTreeRoot::role_map`], or, if | |
| /// writing PDF 2.0, with [`Namespace::role_map_ns`]. PDF 1.4+. | |
| #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] | |
| pub enum StructRole { | |
| /// The whole document. | |
| Document, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::num::NonZeroU16; | |
| /// PDF 2.0 roles the structure element fulfills in the document. | |
| /// | |
| /// These are the predefined standard roles in PDF 2.0, matching the | |
| /// `https://www.iso.org/pdf2/ssn` namespace. The writer may write their own | |
| /// types and then provide a mapping using [`Namespace::role_map_ns`]. PDF 2.0+. | |
| #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] | |
| pub enum StructRole2 { | |
| /// The whole document. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| DIN Letter template | |
| Save this file in your project. Use it like this | |
| in your project file: | |
| #import "template.typ": * | |
| #show: letter.with( | |
| sender: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.junit.Assert; | |
| import org.junit.Before; | |
| import org.junit.Test; | |
| import java.util.LinkedList; | |
| import java.util.Random; | |
| public class testKnapsack { | |
| private Knapsack knapsackGlo; |