Skip to content

Commit 5c425db

Browse files
committed
feat: Add markdown demo, bibliography, and images for test1
1 parent 35a997e commit 5c425db

File tree

7 files changed

+281
-2
lines changed

7 files changed

+281
-2
lines changed

tests/test1/content.md

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
# Articulate by Coders' Compass
2+
3+
## Introduction
4+
5+
This is a demonstration of the template that supports combining markdown with Typst through cmarker. The integration allows for seamless academic writing with proper citations and cross-references. Sample reference [@texbook].
6+
7+
You can reference headings using their auto-generated labels. For example, see [Introduction](#introduction). Generally, it is the heading in lowercase with the words joined together with dashes. A longer example in [Citations and Bibliography](#citations-and-bibliography).
8+
9+
## Headings and Cross-References
10+
11+
## Citations and Bibliography
12+
13+
### Academic Citations
14+
15+
The concept of literate programming was introduced by Knuth [@knuth:1984]. This revolutionary approach changed how we think about code documentation. The foundational work on TeX [@texbook] laid the groundwork for modern typesetting systems.
16+
17+
For comprehensive LaTeX documentation, see [@latex:companion] and [@latex2e]. Early work on computer typesetting can be found in [@lesk:1977].
18+
19+
### Multiple Citations
20+
21+
Several authors have contributed to this field [@texbook] [@latex:companion] [@knuth:1984].
22+
23+
> **Note**: You need to have spaces betwen consecutive citations:
24+
>
25+
> `[@texbook] [@latex:companion] [@knuth:1984]`
26+
27+
# H1 Heading
28+
## H2 Heading
29+
### H3 Heading
30+
#### H4 Heading
31+
##### H5 Heading
32+
###### H6 Heading
33+
34+
## Paragraphs and Text Styles
35+
36+
This is a normal paragraph with various text formatting options.
37+
This is **bold text**, this is *italic text*, and this is ***bold italic***.
38+
You can also use `inline code` in a sentence, and even ~strikethrough text~.
39+
40+
Hard line break example:
41+
This line has two spaces at the end
42+
So this appears on a new line without a paragraph break.
43+
44+
## Lists with References
45+
46+
### Unordered List
47+
- Item one referencing [@texbook]
48+
- Item two with a footnote[^important-note]
49+
- Subitem two-point-one[^sub-note]
50+
- Subitem two-point-two
51+
- Item three citing multiple sources [@latex:companion] [@knuth:1984]
52+
53+
[^important-note]: This footnote references [@latex2e] to demonstrate footnotes with citations.
54+
[^sub-note]: A simple footnote without citations.
55+
56+
### Ordered List with Cross-References
57+
1. First item - see [Introduction](#introduction)
58+
2. Second item - refer to
59+
1. Subitem 2.1 citing [@lesk:1977]
60+
2. Subitem 2.2
61+
3. A third item
62+
63+
## Links and References
64+
65+
- [Coders' Compass](https://coderscompass.org) - External link
66+
- [Typst Documentation](https://typst.app/docs) - Another external link
67+
- [Go to Introduction](#introduction) - Internal link to section
68+
69+
## Enhanced Blockquotes
70+
71+
> This is a standard blockquote citing [@texbook].
72+
> It can span multiple lines and include citations.
73+
>
74+
> **Note:** This is important information from [@knuth:1984].
75+
76+
> **Tip:** For best results with LaTeX, consult [@latex:companion].
77+
78+
## Code Blocks with Enhanced Features
79+
80+
### Python Example
81+
```python
82+
# Python example
83+
def greet(name: str) -> str:
84+
"""
85+
A simple greeting function
86+
"""
87+
return f"Hello, {name}! Welcome to Python."
88+
89+
# Usage
90+
print(greet("Typst"))
91+
```
92+
93+
### Rust Example with Syntax Highlighting
94+
```rust
95+
// Rust implementation
96+
fn fibonacci(n: usize) -> usize {
97+
match n {
98+
0 => 0,
99+
1 => 1,
100+
_ => fibonacci(n - 1) + fibonacci(n - 2),
101+
}
102+
}
103+
104+
fn main() {
105+
println!("The 10th Fibonacci number is: {}", fibonacci(10));
106+
}
107+
```
108+
109+
### Bash Example
110+
```bash
111+
#!/bin/bash
112+
echo "Processing document with modern tools..."
113+
typst compile document.typ
114+
echo "Document compiled successfully!"
115+
```
116+
117+
---
118+
119+
## Horizontal Rules and Separators
120+
121+
Above and below this line are horizontal rules.
122+
123+
---
124+
125+
## Tables Section
126+
127+
### Basic Table
128+
| Author | Work | Year | Citation |
129+
| ------ | ---- | ---- | -------- |
130+
| Donald Knuth | The TeXbook | 1986 | [@texbook] |
131+
| Leslie Lamport | LaTeX Manual | 1994 | [@latex2e] |
132+
| Mittelbach et al. | LaTeX Companion | 2004 | [@latex:companion] |
133+
134+
### Advanced Table with References
135+
| Concept | Description | Reference |
136+
| ------- | ----------- | --------- |
137+
| Literate Programming | Code as literature | [@knuth:1984] |
138+
| Computer Typesetting | Early digital publishing | [@lesk:1977] |
139+
| Document Preparation | Systematic approach | [@latex2e] |
140+
141+
As shown in the [Tables Section](#tables-section), we can reference tables and their content.
142+
143+
## Footnotes with Citations
144+
145+
Here is a sentence with a regular footnote[^regular] and another with a citation footnote[^citation-note].
146+
147+
Complex footnotes can contain multiple citations[^complex-footnote].
148+
149+
[^regular]: This is a simple footnote without citations.
150+
[^citation-note]: This footnote references the fundamental work by [@texbook].
151+
[^complex-footnote]: This footnote discusses multiple works [@knuth:1984] [@latex:companion] and their impact on modern typesetting.
152+
153+
## Mathematics Integration
154+
155+
### Inline Math
156+
The famous equation $E = mc^2$ demonstrates mass-energy equivalence. Integration can be expressed as $\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}$.
157+
158+
### Block Math
159+
Mathematical typesetting, as described in [@texbook], allows for complex expressions:
160+
161+
$$
162+
\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}
163+
$$
164+
165+
The Fibonacci sequence can be expressed mathematically as:
166+
167+
$$
168+
F_n = \begin{cases}
169+
0 & \text{if } n = 0 \\
170+
1 & \text{if } n = 1 \\
171+
F_{n-1} + F_{n-2} & \text{if } n > 1
172+
\end{cases}
173+
$$
174+
175+
## HTML Elements and Styling
176+
177+
### Text Styling with HTML
178+
This text contains <sub>subscript</sub> and <sup>superscript</sup> elements.
179+
You can also <mark>highlight important text</mark> using HTML tags.
180+
181+
### Definition Lists
182+
<dl>
183+
<dt>Literate Programming</dt>
184+
<dd>A programming paradigm introduced by Donald Knuth</dd>
185+
186+
<dt>TeX</dt>
187+
<dd>A typesetting system created by Knuth</dd>
188+
189+
<dt>LaTeX</dt>
190+
<dd>A document preparation system built on TeX</dd>
191+
</dl>
192+
193+
194+
## Combined References and Citations
195+
The work presented in [Introduction](#introduction) builds upon foundational research [@texbook] [@knuth:1984].
196+
197+
198+
## Summary and Conclusions
199+
200+
This document has demonstrated the comprehensive integration of Markdown with Typst through cmarker, showcasing:
201+
202+
1. **Citations**: Proper academic citations using [@texbook] [@latex:companion] [@knuth:1984] [@latex2e] [@lesk:1977]
203+
2. **Cross-references**: Internal linking to sections like [Introduction](#introduction).
204+
3. **Advanced formatting**: Tables, footnotes, and mathematical expressions
205+
4. **Code integration**: Syntax-highlighted code blocks in multiple languages
206+
5. **HTML support**: Enhanced styling with HTML elements
207+
208+
The combination of Markdown's simplicity with Typst's power, enhanced by proper citation management, provides an excellent foundation for academic and technical writing [@knuth:1984].
209+
210+
For the complete bibliography of sources referenced in this document, see the Bibliography section below.

tests/test1/ref/1.png

184 KB
Loading

tests/test1/ref/2.png

231 KB
Loading

tests/test1/ref/3.png

261 KB
Loading

tests/test1/ref/4.png

158 KB
Loading

tests/test1/refs.bib

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@book{texbook,
2+
author = {Donald E. Knuth},
3+
year = {1986},
4+
title = {The {\TeX} Book},
5+
publisher = {Addison-Wesley Professional}
6+
}
7+
8+
@book{latex:companion,
9+
author = {Frank Mittelbach and Michel Gossens
10+
and Johannes Braams and David Carlisle
11+
and Chris Rowley},
12+
year = {2004},
13+
title = {The {\LaTeX} Companion},
14+
publisher = {Addison-Wesley Professional},
15+
edition = {2}
16+
}
17+
18+
@book{latex2e,
19+
author = {Leslie Lamport},
20+
year = {1994},
21+
title = {{\LaTeX}: a Document Preparation System},
22+
publisher = {Addison Wesley},
23+
address = {Massachusetts},
24+
edition = {2}
25+
}
26+
27+
@article{knuth:1984,
28+
title={Literate Programming},
29+
author={Donald E. Knuth},
30+
journal={The Computer Journal},
31+
volume={27},
32+
number={2},
33+
pages={97--111},
34+
year={1984},
35+
publisher={Oxford University Press}
36+
}
37+
38+
@inproceedings{lesk:1977,
39+
title={Computer Typesetting of Technical Journals on {UNIX}},
40+
author={Michael Lesk and Brian Kernighan},
41+
booktitle={Proceedings of American Federation of
42+
Information Processing Societies: 1977
43+
National Computer Conference},
44+
pages={879--888},
45+
year={1977},
46+
address={Dallas, Texas}
47+
}

tests/test1/test.typ

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1-
#import "/src/lib.typ" as my-package
1+
#import "/src/lib.typ": *
22

3-
Hello World
3+
#show: articulate-coderscompass.with(
4+
title: lorem(15),
5+
subtitle: lorem(10),
6+
authors: (
7+
(name: "First Author", email: "[email protected]", affiliation: "Coders' Compass"),
8+
(name: "Second Author", email: "[email protected]", affiliation: "Coders' Compass"),
9+
// (name: "Third Author", email: "[email protected]", affiliation: "Coders' Compass"),
10+
),
11+
abstract: [
12+
#lorem(40)
13+
],
14+
keywords: (
15+
"keyword1",
16+
"keyword2",
17+
"keyword3",
18+
),
19+
version: "1.0.0",
20+
reading-time: "6 minutes",
21+
date: datetime.today(),
22+
bibliography: bibliography("refs.bib", style: "institute-of-electrical-and-electronics-engineers")
23+
)
24+
25+
#render-markdown(read("content.md"))

0 commit comments

Comments
 (0)