Skip to content

Commit c50ae9c

Browse files
committed
Adjust example references
1 parent 452fefb commit c50ae9c

File tree

12 files changed

+89
-75
lines changed

12 files changed

+89
-75
lines changed

.github/increment_version.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
cd "$(dirname "${BASH_SOURCE[0]}")/.."
5+
6+
OLD_VERSION=$(awk -F'= *' '/^version/{gsub(/"/,"",$2);gsub("\r","",$2);print $2}' typst.toml)
7+
NEW_VERSION=$1
8+
9+
echo "Old version: $OLD_VERSION"
10+
11+
if [ -z "${NEW_VERSION}" ]; then
12+
read -p "New version: " NEW_VERSION
13+
else
14+
echo "New version: $NEW_VERSION"
15+
fi
16+
17+
for file in typst.toml README.md template/paper.typ; do
18+
sed --debug -i "s|${OLD_VERSION//./\\.}|${NEW_VERSION//./\\.}|" $file
19+
git add $file
20+
done
21+
22+
#git diff --staged
23+
#git commit -m "Increment Version"
24+

jacow.typ

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,11 @@
116116
else if lower(paper-size) in ("jacow", "test") {(width: 21cm, height: 11in)}
117117
else {panic("Unsupported paper-size, use 'a4', 'us-letter' or 'jacow'!")}
118118
)
119+
119120
// jacow margins slightly increased as per editor request
120121
let left-margin = 20mm
121-
let column-width = 82.5mm - 0.4mm
122-
let column-gutter = 5mm + 0.4mm
122+
let column-width = 82.5mm
123+
let column-gutter = 5mm
123124
let bottom-margin = 0.75in + 0.1in
124125
let column-height = 9.5in - 0.1in
125126

@@ -128,14 +129,16 @@
128129
height: if lower(paper-size) == "test" {auto} else {paper.height},
129130
margin: (
130131
left: left-margin,
131-
right: paper.width - left-margin - 2*column-width - column-gutter,
132+
right: paper.width - left-margin - 2*column-width - column-gutter + 0.4mm,
132133
top: paper.height - bottom-margin - column-height + 0.005in,
133134
bottom: bottom-margin + 0.03in
134135
),
135136
columns: 2,
136137
)
137138

138-
set columns(gutter: column-gutter)
139+
set columns(gutter: column-gutter + 0.4mm)
140+
141+
139142

140143
set text(
141144
font: "TeX Gyre Termes",

template/paper.typ

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
Typst @typst // a citation to the respective entry in "references.bib" (see below)
5959
is a great, modern and blazingly fast typesetting system focussed on scientific papers.
60-
It is markup based, supporting *strong* _emphasis_ of text, #underline[underlining], `monospace` font, smart "quotes" and much more.
60+
Being markup based, it supports *strong* _emphasis_ of text, #underline[underlining], `monospace` font, smart "quotes" and much more.
6161
Equations can be typeset inline like $beta_"x" (s)$, and in display mode:
6262

6363
$
@@ -71,7 +71,7 @@ $
7171
e^("i" pi) + 1 = 0
7272
$ <eq:mycustomlabel>
7373

74-
we can reference @eq:mycustomlabel. // a reference to a labelled equation
74+
they can be referenced as in @eq:mycustomlabel. // a reference to a labelled equation
7575
The same works for @fig:writer and @table:xydata too.
7676
Remember to use the long form at the beginning of a sentence:
7777
@fig:writer[Figure].
@@ -84,7 +84,7 @@ Done.
8484
The accelerated-jacow template is based on the JACoW paper preparation guide @jacowguide @jacow.org. // citations
8585
It takes care of proper page size, margins and spacing, generates the front matter with properly formatted title, author list, footnotes and abstract using the show-rule at the top of this document and formats headings, tables, references and more.
8686

87-
Headings are automatically transformed to all-caps and word-caps case as specified by the paper preparation guide.
87+
Headings are automatically transformed to all-caps and word-caps case respectively.
8888
Should you require custom control on upper/lower case, this can be forced not only in the title (see above), but also in headings like so:
8989

9090
#let nacl = [#upper[N]#lower[a]#upper[C]#lower[l]]
@@ -146,7 +146,7 @@ These support top, bottom or automatic placement as well.
146146
box(fill: silver, width: 100%, height: 2cm),
147147
scope: "parent", // two column-figure
148148
placement: top, // `top`, `bottom` or `auto` for floating placement or `none` for inline placement
149-
caption: [A column spanning figure. #lorem(21)],
149+
caption: [A column spanning figure. #lorem(41)],
150150
) <fig:rect>
151151

152152

@@ -192,15 +192,20 @@ With the *lilaq* package, plots can be create directly in the document, so you c
192192

193193
#figure(
194194
lq.diagram(
195-
// sine
195+
196+
// plot a sine function
196197
let x = lq.linspace(0, 10),
197198
let y = x.map(x => calc.cos(x)),
198199
lq.plot(x, y, mark: none, label: [$cos(x)$]),
199-
// data
200+
201+
// plot some data (practically you can load data from a file using `json` etc.)
200202
lq.plot((1, 2, 3, 7, 9), (-1, 1.8, 0.7, -0.3, 1), yerr: 0.3, mark: "o", stroke: (dash: "dashed"), label: [Data]),
201-
// plot layout
203+
204+
// adjust plot layout
205+
height: 3cm,
202206
xlabel: [Angle ~ $x$ / rad], xlim: (0, 10),
203207
ylabel: [$y$ / m], ylim: (-1.5, 2.5),
208+
204209
),
205210
placement: auto, // `top`, `bottom` or `auto` for floating placement or `none` for inline placement
206211
caption: [A plot create with the Lilaq package directly inside the typst source code]
@@ -229,24 +234,25 @@ For more details, refer to https://typst.app/universe/package/glossy.
229234

230235

231236

232-
= Conclusions
233-
#lorem(42)
237+
= Citations
238+
Reference formatting uses standard bib files.
239+
The bib snippets can conveniently be copied by selecting the format type "BibTex" when using the JACoW reference search tool at https://refs.jacow.org/.
240+
Examples are given below @typst @jacowguide @jacow.org @example-journal-article @example-report @example-book @example-book-chapter @example-thesis @example-jacow-unpublished.
234241

235-
= Acknowledgements
236-
#lorem(42)
237242

238243

239244

240245
#bibliography("references.bib")
241246

242247

248+
243249
// Workaround until balanced columns are available
244250
// See https://github.com/typst/typst/issues/466
245251
#place(
246252
bottom,
247253
scope: "parent",
248254
float: true,
249-
clearance: 108pt, // TODO: increase clearance for manual column balancing
255+
clearance: 70pt, // TODO: increase clearance for manual column balancing
250256
[]
251257
)
252258

template/references.bib

Lines changed: 40 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,52 @@
1+
2+
% Journal article
3+
@article{example-journal-article,
4+
author = {A. Alpha and B. Beta and C. Gamma and D. Delta and E. Eta and F. Zeta},
5+
title = {New techniques in accelerators},
6+
journal = {Nucl. Instrum. Methods Phys. Res. A},
7+
volume = {12},
8+
number = {34},
9+
pages = {56-78},
10+
date = {2009},
11+
doi = {10.1016/1234-5678-9},
12+
}
13+
14+
% Paper in JACoW Proceedings
115
@inproceedings{jacowguide,
216
author = {A. N. Author and H. Coauthor and P. Contributor},
317
title = {Preparation of Papers for {JACoW} Conferences},
4-
booktitle = {Proc. 0th Int. Joint Accelerator Conf. (IJAC'00)},
5-
pages = {000--999},
6-
paper = {JACOW000},
18+
booktitle = {Proc. IPAC'00},
719
venue = {City, Country, Month 0000},
8-
publisher = {JACoW Publishing, Geneva, Switzerland},
20+
pages = {000--999},
921
doi = {10.18429/JACoW-XXXX},
10-
url = {https://github.com/JACoW-org/JACoW_Templates/},
11-
language = {english}
1222
}
1323

24+
% Report
25+
@techreport{example-report,
26+
author = {Z. C. Omega},
27+
title = {Title of report},
28+
address = {CERN, Geneva, Switzerland},
29+
number = {NR-123-XYZ},
30+
date = {1999-01},
31+
url = {https://cds.cern.ch/record/00000}
32+
}
33+
34+
% Website
1435
@online{jacow.org,
15-
title = {Joint Accelerator Conferences Website},
36+
title = {Joint Accelerator Conferences Website (JACoW)},
37+
1638
url = {https://jacow.org/}
1739
}
1840

41+
% Software
1942
@software{typst,
2043
author = {Mädje, Laurenz and Haug, Martin and {The Typst Project Developers}},
2144
license = {Apache-2.0},
2245
title = {{Typst}},
2346
url = {https://github.com/typst/typst}
2447
}
2548

26-
@inproceedings{example-jacow,
27-
author = {A. N. Author and B. Coauthor and C. Contributor},
28-
title = {A novel {TeV} accelerator},
29-
booktitle = {Proc. IPAC'00},
30-
pages = {000-999},
31-
howpublished = {paper ABC123},
32-
venue = {City, Country, Month 2000},
33-
doi = {10.18429/JACoW-XXXX},
34-
}
35-
36-
@unpublished{example-jacow-sameconf,
37-
author = {A. N. Author and B. Coauthor},
38-
title = {A talk at the same conference},
39-
note = {presented at IPAC’00, City, Country, Jan. 2000, paper ABC123, this conference},
40-
}
41-
42-
@unpublished{example-jacow-unpublished,
43-
author = {A. N. Author and B. Coauthor},
44-
title = {A talk without published paper},
45-
note = {presented at IPAC’00, City, Country, Jan. 2000, paper ABC123, unpublished},
46-
}
47-
48-
@article{example-journal,
49-
author = {A. Alpha and B. Beta and C. Gamma and D. Delta and E. Eta and F. Zeta},
50-
title = {New techniques in accelerators},
51-
journal = {Phys. Rev. ST Accel. Beams},
52-
volume = {00},
53-
pages = {000000},
54-
date = {2000-01},
55-
doi = {10.1103/PhysRevAccelBeams.00.000000},
56-
}
57-
58-
@unpublished{example-journal-unpublished,
59-
author = {A. Alpha and B. Beta and C. Gamma and D. Delta and E. Eta and F. Zeta},
60-
title = {New techniques in accelerators},
61-
note = {submitted for publication},
62-
}
63-
64-
@misc{example-website,
65-
title = {{JACoW}},
66-
url = {http://www.jacow.org},
67-
}
68-
69-
49+
% Book
7050
@book{example-book,
7151
author = {A. Writer},
7252
title = {Title of Book},
@@ -75,6 +55,7 @@ @book{example-book
7555
year = {2000},
7656
}
7757

58+
% Book chapter
7859
@inbook{example-book-chapter,
7960
author = {A. Writer},
8061
title = {Title of chapter in the book},
@@ -86,14 +67,7 @@ @inbook{example-book-chapter
8667
pages = {100-200},
8768
}
8869

89-
@techreport{example-report,
90-
author = {Z. Omega},
91-
title = {Title of report},
92-
institution = {CERN, Geneva, Switzerland},
93-
number = {CERN-2000-9999},
94-
date = {2000-01},
95-
}
96-
70+
% Thesis
9771
@thesis{example-thesis,
9872
author = {A. Student},
9973
title = {Title of thesis},
@@ -103,3 +77,10 @@ @thesis{example-thesis
10377
year = {2014},
10478
}
10579

80+
% Paper at same conference
81+
@unpublished{example-jacow-unpublished,
82+
author = {A. N. Author and B. Coauthor},
83+
title = {A talk at the same conference},
84+
note = {presented at IPAC’00, City, Country, Jan. 2000, paper ABC123, this conference},
85+
}
86+

tests/captions/ref/1.png

-87 Bytes
Loading

tests/guide/ref/1.png

-1011 Bytes
Loading

tests/head/ref/1.png

-175 Bytes
Loading

tests/head/ref/2.png

-348 Bytes
Loading

tests/head/ref/3.png

-136 Bytes
Loading

tests/head/ref/4.png

-481 Bytes
Loading

0 commit comments

Comments
 (0)