repo
stringlengths 26
115
| file
stringlengths 54
212
| language
stringclasses 2
values | license
stringclasses 16
values | content
stringlengths 19
1.07M
|
---|---|---|---|---|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/note-me/0.2.1/example.typ | typst | Apache License 2.0 | // Import from @preview namespace is suggested
// #import "@preview/note-me:0.1.1": *
// Import from @local namespace is only for debugging purpose
#import "@local/note-me:0.2.1": *
= Basic Examples
#note[
Highlights information that users should take into account, even when skimming.
]
#tip[
Optional information to help a user be more successful.
]
#important[
Crucial information necessary for users to succeed.
]
#warning[
Critical content demanding immediate user attention due to potential risks.
]
#caution[
Negative potential consequences of an action.
]
#admonition(
icon: "icons/stop.svg",
color: color.fuchsia,
title: "Customize",
foreground-color: color.white,
background-color: color.black,
)[
The icon, (theme) color, title, foreground and background color are customizable.
]
= More Examples
#todo[
Fix `note-me` package.
] |
https://github.com/3w36zj6/textlint-plugin-typst | https://raw.githubusercontent.com/3w36zj6/textlint-plugin-typst/main/test/fixtures/Strong/input.typ | typst | MIT License | *strong*
* a b c *
\
This is *strong*.
|
https://github.com/noahjutz/AD | https://raw.githubusercontent.com/noahjutz/AD/main/notizen/sortieralgorithmen/quicksort/partition.typ | typst | #import "@preview/cetz:0.2.2"
#import "/components/num_row.typ": num_row, arrowed, arrowed_b, braced_b
#import "/config.typ": theme
#let partition_loop(nums) = {
let swaps = ()
let pivot = nums.at(0)
let j = 1
for (i, x) in nums.enumerate() {
if i == 0 {continue}
if x <= pivot {
swaps.push((i, j))
swaps.push((j, i, (paint: theme.bg_trans)))
(nums.at(i), nums.at(j)) = (nums.at(j), nums.at(i))
j += 1
}
}
return (swaps, nums, j)
}
#let partition_finalize(nums, j) = {
let swaps = ()
swaps.push((0, j))
swaps.push((j, 0, (paint: theme.bg_trans)))
(nums.at(0), nums.at(j)) = (nums.at(j), nums.at(0))
return (swaps, nums)
}
#let nums = (34, 45, 12, 34, 23, 18, 38, 17, 43, 7)
#let (
swaps_loop,
nums_loop,
j_loop
) = partition_loop(nums)
#let (
swaps_finalize,
nums_finalize
) = partition_finalize(nums_loop, j_loop - 1)
#block(
breakable: false,
table(
columns: (auto,) + (1fr,) * (nums.len()+1),
align: center,
column-gutter: (0pt, 4pt, 0pt),
..num_row(
nums,
prefix: ([(a)],),
prefix_frame: none,
hl_tertiary: 0,
below: 0pt,
arrow_down: swaps_loop,
labels: (
(0, 1, arrowed[`f`]),
(nums.len()-1, nums.len(), arrowed[`l`])
),
),
..num_row(
nums_loop,
prefix: ([(b)],),
prefix_frame: none,
hl_primary: range(1, j_loop),
hl_secondary: range(j_loop, nums.len()),
hl_tertiary: 0,
below: 0pt,
arrow_down: swaps_finalize
),
..num_row(
nums_finalize,
prefix: ([(c)],),
prefix_frame: none,
hl_primary: range(j_loop - 1),
hl_secondary: range(j_loop, nums.len()),
hl_tertiary: j_loop - 1,
labels_b: (
(0, j_loop - 1, braced_b[$<=$]),
(j_loop - 1, j_loop, arrowed_b[`j-1`]),
(j_loop, nums.len(), braced_b[$>=$]),
)
)
)
) |
|
https://github.com/tymbalodeon/job-application | https://raw.githubusercontent.com/tymbalodeon/job-application/main/README.md | markdown | # Job Application
Create resumes and cover letters created with [Typst](https://typst.app/docs).
# Dependencies
- [Typst](https://typst.app/docs)
- [checkexec](https://github.com/kurtbuilds/checkexec "checkexec")
- [watchexec](https://watchexec.github.io/ "watchexec")
- [skim](https://skim-app.sourceforge.io/ "skim")
Dependencies can be installed by running the included script:
`./install_dependencies.sh`
Or, if `just` is already installed: `just install` to install the rest of the
dependencies.
## Tasks
Task scripts are provided using [`just`](https://just.systems/man/en/ "just").
Available commands:
- `clean`: Remove output files
- `compile \*args`: Compile input files [options: "--force", "--open"]
- `edit file`: Edit {resume|cover-letter}, compiling using \<TAGS\> on changes
- `example *open`: Compile and optionally open example files
- `install`: Install dependencies
- `list`: List output files
- `open`: Open output files
## Usage
### Example
The output style can be viewed using example data by running `just example --open`.
### Add your own data
The contents of your resume and cover letter are read from content files written
in [yaml](https://yaml.org/). The required format is modeled in
`cover-letter.example.yaml` and `resume.example.yaml`. Copy `.env.example` to
`.env`, replacing the values with the path to your resume and/or cover letter
content file (which can be anywhere on your machine), and optionally the path to
an output folder outside of the project directory, and run `just edit
{resume|cover-letter}>` to open a file for editing and compiling on changes, or
`just compile` to compile only.
_Note: Paths must be full paths, NOT relative paths!_
### Tags
Resume content can be tagged with keywords to allow for compiling different
versions from the same content source. For example, you could tag some content
so that it is only included in an "long" version, or in a version meant to
emphasize a particular aspect of your background. Content without any tags will
always be included and content with one or more tags will only be included if
either no tags are targeted at compilation or if all of the content's tags are
targeted. Consult the `*.example.yaml` files to see how tags should be
specified. Run `just compile <TAG> ...` to compile output targeting specific
tags only.
|
|
https://github.com/protohaven/printed_materials | https://raw.githubusercontent.com/protohaven/printed_materials/main/common-tools/band_saw_metal_vertical.typ | typst |
#import "/meta-environments/env-features.typ": *
= Vertical Metal Band Saw
The vertical meal band saw can remove large amounts of material from a workpiece.
== Notes
=== Use
In general, use of the vertical metal bandsaw is limited to cutting either mild steel or aluminum. A comprehensive chart of permitted materials is inside the upper cabinet.
A good rule of thumb is to only cut material that is at least as thick as the height of three teeth on the saw blade. The will reduce the chances of a tooth catching the top edge of the workpiece too deeply. There are better methods for cutting thin materials (see the SHeetmetal classes for more).
// === Consumables
// blades?
=== Materials
This tool can be used to cut:
- mild steel
- aluminum
- brass
This tool must not be used to cut:
- Ordinary tool steel
- High speed steel
- Stainless steel
== Parts of the Vertical Metal Band Saw
=== Front Quarter View
#figure(
image("./images/band_saw-metal-vertical-front_quarter-annotated.png", width: 100%),
caption: [An annotated front quarter view of the vertical metal band saw.]
)
=== On/Off Switch
Press the *on* button to start the saw.
Press the *off* button to stop the saw.
=== Low/High Range Shift Lever
The low/high range shift lever changes the gearing for cutting aluminum (low) and steel (high).
#warning("Do not use this lever while the saw is running.") Turn off the saw before making any changes to the speed range.
=== Variable Speed Crank
The variable speed crank adjusts the speed of the saw blade within the selected speed range.
#warning("Do not turn this crank while the saw is stopped.") Only make speed adjustments when the blade is moving under power.
=== Fence
Used the optional fence to register the workpiece a specific distance from the blade.
=== Table Tilt
The table can be tilted to support angled cuts.
#figure(
image("./images/band_saw-metal-vertical-table_tilt-annotated.png", width: 100%),
caption: [Annotated view of the vertical metal band saw table tilt mechanism.]
)
To tilt the table left or right, loosen the two screws under the back of the table. Use the angle guide to set the necessary angle.
To tilt the table front to back, loosen the four screws under the right and left sides of the table.
Always re-tighten and screws under the table before making a cut.
=== Upper Blade Guide Lock Knob
Use the upper blade guide lock knob to release or lock the upper blade guide during setup.
Use caution when releasing the blade guide: it is very heavy, and may cause injury or damage to the machine if not properly supported when released.
=== Upper Blade Guide
The upper blade guide can be moved up and down to cover the unused part of the blade during a cutting operation.
Always cover as much of the blade as possible for a particular cut, leaving a 1/4" gap between the bottom of the blade guide and the top of the workpiece. Test the workpiece clearance first with the saw turned off. Be careful of workpieces with complicated profiles: make sure that all parts of the workpiece will clear the upper balde guide.
=== Work Lamp Switch
Turn on the work lamp for better illumination during a cut.
== Basic Operation
=== Setting Up
+ Plug in the vertical metal band saw.
+ Loosen the guard screw to free the blade guard.\
_Be careful: the guard is heavy, and may drop unexpectedly._
+ Set the blade guard to just above the height of the workpiece.
+ Tighten the guard screw to lock the blade guard in place.
+ Check the blade alignment with the guides. \
_The blade guides should be close to but not touching the blade, and should still turn freely.
// There should be .02" between blade and guides.
Make sure that the blade guides sit behind the teeth._
+ Turn on the work light.
=== Setting the Speed
First, *set the speed range shift lever to _high_ or _low_* as appropriate for the workpiece material.\
Make sure that the gearing is fully engaged in the new setting: you may need to manually advance the drive wheel to make sure the gears properly mesh.
The drive wheel is found in the bottom cabinet door to the right of the lever. Fully engaging the drive wheel can be difficult, make sure the gears are properly meshed before cutting. Gears that are not fully meshed will cause blade slippage.
Second, *set the speed crank to an appropriate speed* for the material you are cutting.
A table of appropriate speeds follows:
#block[
#set text(size: 11pt)
#let app_materials = csv("/data-reference/band_saw-metal-vertical/band_saw-metal-vertical-materials.csv")
// We have to do a custom table header for this one
#let _ = app_materials.remove(0)
#let _ = app_materials.remove(0)
#let table_header = (
table.cell(
colspan:6,
align: center,
inset: 18pt,
text(weight: "bold", size: 11pt,[Blade Speed (M/m)]),
),
table.cell(
rowspan: 2,
[*Material*],
),
table.cell(
colspan: 5,
align: center,
[#h(3em)*Thickness (in)*]
),
[*\< 1/4*],[*1/4 – 1*],[*1 – 3*],[*3 – 6*],[*6 \<*]
)
#table(
columns: (auto, 1fr, 1fr, 1fr, 1fr, 1fr),
stroke: none,
align: (col, row) => (left+top,right+top,right+top,right+top,right+top,right+top).at(col),
inset: (
x: 5pt,
y: 7pt,
),
fill: (_, y) => if calc.odd(y) and y > 2 { color.tablegrey },
table.header(..table_header),
table.hline(),
..app_materials.flatten()
)
]
// Include materials chart here
=== Workholding
- Support the workpiece with the fence during the cut, if possible.
- If the fence cannot support the workpiece, hold the workpiece firmly during the cut. Hold the workpiece on both sides of the cut if it is safe to do so.
=== Making a Cut
+ Turn on the saw.
+ Using the fence or with a firm grip, bring the workpiece up to the blade.
+ Push the workpiece gently into the blade with constant pressure.\
_Go slowly. A gentle, consistent pressure will yield a better cut, and protect the workpiece and the tool._
+ Adjust pressure during the cut as needed.\
_Excessive pressure should not be used. Notify staff if the blade is not cutting properly._
+ Use gentle pressure at the end of the cut.
+ Turn off the saw.
Wait until the blade has completely stopped before starting cleanup.
=== Cleaning Up
+ Use a chip brush to clean off the table.
+ Sweep up any chips and dust in the surrounding area.
+ Turn off the work light.
+ Unplug the vertical metal band saw.
== Resources
// == Acknowledgements
|
|
https://github.com/RiccardoTonioloDev/TypUrNotes | https://raw.githubusercontent.com/RiccardoTonioloDev/TypUrNotes/main/tun_template/tun.typ | typst | MIT License | #import "@preview/glossarium:0.4.1": make-glossary
#import "@preview/codly:1.0.0": *
#let not_break(content) = {
block(content,breakable: false, width: 100%)
}
#let pb() = {
pagebreak(to: "odd")
}
#let config(
myAuthor: "<NAME>",
myTitle: "Title",
myLang: "en",
pages_numbering: "1",
creation_day: "NaN",
creation_month: "NaN",
creation_year: "NaN",
associated_with: "nothing",
digital: true,
use_glossary: true,
use_bibliography: true,
body
) = {
// GENERAL DOCUMENT SETTINGS
set document(author: myAuthor, title: myTitle, date: datetime(day:int(creation_day), month: int(creation_month), year: int(creation_year)))
show math.equation: set text(weight: 400)
// PAGE & HEADING SETTINGS
set page(margin: 1.1811in, number-align: center)
show heading: set block(above: 1.4em, below: 1em)
show heading: set text(weight: "medium")
set heading(numbering: (..nums) => nums.pos().map(str).join("."))
show heading.where(level: 1): it => {
pagebreak()
stack(
spacing: 2em,
if it.numbering != none {
align(center)[#text(size: 4.5em,fill: rgb(149, 0, 6),weight: "thin")[#counter(heading).display()]]
},
align(center)[#text(size:2em,it.body, weight: "thin")],
[]
)
}
let bgcolor = white
if(digital){
bgcolor = rgb(255, 241, 214)
}
set page(fill: bgcolor)
// TEXT SETTINGS
set par(leading: 0.55em, justify: true)
show raw: set text(font: "JetBrains Mono", size: 9pt, lang: myLang)
show par: set block(spacing: 1.25em)
set par(leading: 0.75em)
set list(indent: 9pt, body-indent: 9pt)
set enum(indent: 9pt, body-indent: 9pt)
set text(font: "EB Garamond", size: 12pt, lang: myLang, hyphenate: false)
let color = luma(0)
if(digital){
color = luma(50)
}
show: set text(color)
// REF & IMAGES SETTINGS
show ref: set text(fill: blue.darken(70%), weight: "medium")
show figure.caption: set text(size: 10pt, font: "Optima")
// DEPENDENCIES SETTINGS
show: codly-init.with()
codly(number-format: none, zebra-fill: none, display-icon: false,stroke: none, fill: rgb(255, 248, 235),lang-outset: (x:-2pt,y:5pt))
if(not digital){
codly(stroke: 0.1pt + black, fill: white,lang-outset: (x:-2pt,y:5pt),default-color: white, lang-stroke: 0.1pt + black)
}
show: make-glossary
// FIRST PAGE SETTINGS
set page(numbering: none)
grid(
columns: (auto),
rows: (40pt, 1fr, 20pt),
// Heading
[
#align(center,stack(dir: ttb,
text(18pt, weight: "light", smallcaps("author")),
v(11pt),
text(18pt, weight: "medium", myAuthor)
))
],
// Body
[
#align(horizon+center,text(40pt, weight: "medium",myTitle))
#align(horizon+center,text(18pt, weight: "light", smallcaps("associated with")))
#align(horizon+center,text(20pt, weight: "medium", associated_with))
#v(240pt)
],
// Footer
[
#line(length: 100%)
#align(center, text(12pt, weight: 400, smallcaps("created: " + creation_day + "/" + creation_month + "/" + creation_year)))
#align(center, text(12pt, weight: 400, smallcaps("last change: " + datetime.today().display("[day]/[month]/[year]"))))
]
)
// INDEX SETTINGS
show outline.entry.where(level: 1): it => {
linebreak()
link(it.element.location(), strong(it.body))
h(1fr)
link(it.element.location(), strong(it.page))
}
outline(
indent: auto,
depth: 5
)
// PAGE NUMBERINGS FOR THE BODY SETTINGS
set page(numbering: pages_numbering)
counter(page).update(1)
body
// APPENDIX SETTINGS
set page(numbering: none)
if(use_glossary){
include "./appendix/glossary.typ"
}
if(use_bibliography){
include "./appendix/bibliography.typ"
}
}
|
https://github.com/MooersLab/writingLogInTypst | https://raw.githubusercontent.com/MooersLab/writingLogInTypst/main/logTemplate.typ | typst | // Created 2024-09-29 Sun 23:01
// Intended Typst compiler
#import "@local/in-dexter:0.6.0": *
#import "@local/cheq:0.2.0": checklist
#set page(width: 8.5in, height: 11in, margin: (x: 0.5in, y: 0.75in),)
#set text(11pt)
#set text(font: "Helvetica")
// Set the title use for reuse in the running title and the main title page.
#let title = [Wrting log template in typst]
// Set the title and running title
#let title = [Wrting log template in typst]
#let running = [Writing log #datetime.today().display()]
#set page(
header:[ Student, ..., and Mooers #h(1fr) #running],
numbering: "1 / 1",
number-align: right,
)
#align(center, text(17pt)[
*#title*
])
#grid(
columns: (1fr, 1fr),
align(center)[
Partner PI \
Amazing Institute \
#link("mailto:<EMAIL>")
],
align(center)[
Dr. <NAME> \
OUHS \
#link("mailto:<EMAIL>")
]
)
#outline(
title: [Table of Contents],
depth: 3,
indent: 2em
)
#set par(justify: true)
= Overview of this writing log
This template is in Org mode \cite{Dominik2016TheOrgMode9ReferenceManualOrganizeYourLifeWithGNUEmacs}.
Org-mode aims to be a used for organizing your life, managing knowledge, doing literate programming, and preparing manuscripts.
It can be used to teach programming \cite{Birkenkrahe2023TeachingDataScienceWithLiterateProgrammingTools}.
Many people prefer to work in org-mode all day.
This template is similar to the writing log formatted for LaTeX.
They share much of the same preamble.
It is exported from org-mode through LaTeX to PDF.
This file compiles by entering \textbf{C-c C-e l o} without using an init.el file (e.g., \textbf{emacs -Q logXXXX.org}), but you may have to export it twice to get all of the changes in the source file deployed in the PDF.
You have to wait half a minute for the compiled document to appear.
The compiling is faster in LaTeX and on Overleaf.
This does not matter much because I mostly read and work with the org file when planning my writing session.
This template contains a table of contents, numbered outline, and an index that support navigating the document when it has been rendered into a PDF.
The label and ref macros are part of LaTeX's hyperlinking system.
Items in the table of contents and in the index are hyperlinked to sites in the body of the writing log.
You can navigate to different sections of the document by clicking on the file outline in this left column.
The comments in the GUIDNACE drawers are usually hidden to reduce the clutter in the document.
The comments provide a quick access to suggested ways of using a section.
Put the cursor on the title of the drawer and enter tab to open the drawer.
Repeat to close the drawer.
The GUIDANCE drawers are under a headline with a :noexport: tag.
= Project initiation
== Rationale for this article
* What is the rationale for writing this paper? *
Here are some prompts to stimulate your own thoughts.
+ _To help advance the field?_
+ _To help win or renew a grant funding?_
+ _To establish credibility in a new field?_
== Audience for the paper
*Describe in a paragraph of prose the target audience of this paper.*
== Potential target journal for submission
_The journal titles are enumerated in descending order of desirability.
You have a plan B journal identified at the time of submission so that
you can respond swiftly if the plan A journal rejects the paper._
+ Nature Methods
+ Science
+ Cell
+
== Related projects
_By listing projects that are closely and even somewhat distantly related
to the project at hand, it is possible to identify some synergies that
might otherwise be overlooked. For example, when working in a new area,
it is often useful to capitalize on the investment made in reading in
the new field by capturing those insights in the form of a review
article or book chapter. If you use Overleaf, you can include a
hyperlink to the project's webpage._
+ similar paper
+
== Draft Introduction
_In this section and in the next two sections, we assemble the key
components of the paper. You may wonder why we did not do this in the
manuscript document. We find it easier to keep this prose close to the
other lists in the sections that follow these subsections. In other
words, we are using the writing log as an incubator for the initial
drafts of these components of the paper._
_We craft a two-paragraph introduction following the method of Lindsay
(Lindsay 2020 Scientific Writing Thinking In Words 2nd Ed). We do this
drafting in the writing log until we are satisfied that we have a vision
of the project that is clear enough to proceed. At this point, we
transfer the draft introduction to the main manuscript._
== Potential Results
_This section contains a list of the potential key results that are vital
to addressing the central hypothesis. Usually, there are 4 to 6 key
results. Yes, we can think about the nature of the results even before
we have performed the experiments._ \ \
_We are not necessarily thinking about the expected results, but we can
guess about the nature of the results with regard to whether they will
be in the form of a table, a graph or an image. We then do an initial
sorting of the results on the basis of how much weight they bear upon
testing the central hypothesis. This sorting will be the order in which
the results are presented, in contrast to the general tendency to
deliver the results in the order in which we obtain the results. At this
point, we might even draft an initial paragraph for the results section
that outlines the order of the results. This initial paragraph helps to
set the reader's expectations about the results that follow. After this
initial paragraph is assembled and the planned results are listed, we
will transfer this text to the main manuscript._ \ \
== Potential Discussion Points
_After some years of experience in a particular field, one has a sense of
the critical discussion points about how the proposed results will
relate to the results from the work of others. The content of this
discussion is supposed to be about the relationship of our results to
those reported by others. Sometimes, we expand these discussion points
into initial paragraphs. After we think this section is well-developed,
we will transfer it to the main manuscript._ \ \
+ Suitability for supporting writing in three kinds of documents.
== Prior Discussion Points
_The discussion section should contain new points of discussion. If you
are writing a series of papers about a topic, it is all too easy to
recycle old discussion points. Before making the transfer mentioned
above, we will check the proposed discussion points against those we
have published to avoid repeating ourselves and remind ourselves to
review our new results against our prior discussion points. You can
check this list against the discussion section of your current
manuscript to ensure that you are raising new points or updating prior
points while appropriately citing yourself. The new results may require
that we update our published discussion points._ \ \
+ Point published last year.
+ Point published in 2016.
+
== Potential Titles
_Titles of 3-7 words long are easier for people to remember. We generally
iterate through enough titles to find one that is catchy. Sometimes,
this requires generating a list of more than 100 titles. This work takes
time and should not be delayed until the day of manuscript submission._
+ Writing log template in typst
+
== Potential Keywords
_Below is a list of potential keywords. Abstracting services use the
title and abstract to extract terms for searching. As a result, select
keywords that are not in these two parts of the paper. Usually, there is
a limit on the number of keywords, so we choose the keywords carefully.
We make a long list of keywords and select the best ones._
+ project management
+ time management
+
== Potential Abstract
_After filling in the above subsections, we are in a solid position to
draft the abstract for the paper. This is just a draft and will be
updated as the results emerge. However, going through this exercise is
another way of visualizing the paper's contents and helps to strengthen
that vision. Such clarity is essential to maintain momentum._
== Potential Abbreviations and Acronyms
_A common mistake is to delay the assembly of the list of acronyms and
abbreviations. An incomplete list tells the reviewer that the authors
assembled the manuscript in a hurry._
== Potential Collaborators
== Potential Competitors
== Potential Reviewers
== Draft Cover Letter
_It is never too early to start writing the cover letter for a project.
This letter is another form of summary that is part of the actualization
of the project. If we have enough energy and time left over from
completing the initialization of the writing project, we may proceed to
drafting the cover letter. The advantage of doing so is to capture one's
excitement about the project._
== Acknowledgements
_It is never too early to start this section.
Work on it should not be delayed until the last minute because you risk overlooking somebody's contribution._
== Funding sources
_It is never too early to start this section.
Work on it should not be delayed until the last minute because you risk overlooking a funding source._
= Data
_This section catalogs the data to be used in the paper._
== Inventory of data on hand
== Inventory of project's required external software
== Inventory of project's software repositories
== Inventory of relevant videos
== Inventory of relevant blogs
== Inventory of literature sources
== Project's progress sumnmary for annual grant report
== Project's progress summary for annual report to college
= Plans supporting project
== Timeline for experiments
== User proposals
=== Ligtht source access
=== HPC access
== Recruitment Plans
=== Collaborators
=== Workers
== Career development plans for self and workers
== Biosafety approval
== Authentication of key biological resources
== Authentication of chemical resources
== Statistical sampling and power analysis
==
== Data Analysis Plans
== Data management plans
== Data sharing plans
== NIH PEDP
= Project Management For Timely Completion
_This section is to plan the completion of the manuscript and for making periodic assessments of its status.
Having the checklist and the timeline adjacent each other will aid the scheduling of remaining tasks.
The assessment of the current state could be included within the diary section, but we think it is more useful to include it in this area near the timeline and the checklist for completion.
By having the assessments adjacent to each other, you should be able to see more clearly how progress is being made on the manuscript._
#show: checklist
== Checklist for manuscript completion
- [x] Central hypothesis identified.
- [ ] Introduction drafted to define scope.
- [ ] Results ordered by relevance to the central hypothesis.
- [ ] Results imagined as figures and tables.
- [ ] Results outlined to the subsection level.
- [ ] Results outlined to the paragraph level.
- [ ] Figures have been conceptualized.
- [ ] Figures have been drafted.
- [ ] Figure legends have been drafted.
- [ ] Tables have been conceptualized.
- [ ] Tables have been drafted.
- [ ] Table legends have been drafted.
- [ ] Paragraphs in the Results section drafted.
- [ ] Results concluding sentences checked.
- [ ] Discussion points identified.
- [ ] Prior publications checked for Discussion points.
- [ ] Discussion paragraphs drafted.
- [ ] Discussion concluding sentences checked.
- [ ] Discussion subsections check with the central hypothesis.
- [ ] Citations have been entered.
- [ ] Citations have been checked.
- [ ] Bibliographic information has been checked.
- [ ] Accuracy of Bibliographic information checked.
- [ ] Citations have entries in the annotated bibliography.
- [ ] Abstract drafted.
- [ ] Supplemental materials assembled.
- [ ] The first draft is finished.
- [ ] Round 1 of rewriting finished.
- [ ] Round 2 of rewriting finished.
- [ ] Ready for reverse outline.
- [ ] Round 3 of rewriting.
- [ ] Solicit review by co-authors.
- [ ] Internal polishing editing.
- [ ] Ready for intense review by a professional writer.
- [ ] Intensive review revisions have been incorporated.
- [ ] Penultimate draft ready for internal proofreader.
- [ ] Penultimate review revisions incorporated.
- [ ] Manuscript ready for submission.
== Timeline and Milestones
_This is the planning section where the calendar is matched up with milestones: goals without deadlines are just dreams.
This is a tricky section to include inside of a writing log document because it often requires a heavy-duty external Library to be able to generate an image.
This could be done by simply copying the checklist and pasting it into this section as a table with three columns: milestone, target date, and achievement date.
This would lead to a very long table that might be too cluttered.
There might be a subset of the items in the checklist that are larger in scope that could be listed.
For example, completion of various parts of the writing log, key experiments, and solicitation of outside expertise.
The setting up of the time timeline will be very Project Specific and will require customization.
The main thing is to keep it simple enough to be useful but no simpler than necessary._
#figure(
table(
columns: (auto, auto, auto),
inset: 10pt,
align: horizon,
table.header(
[*Milestone*], [*Traget date*], [*Achievement data*],),
[milestone 1], [date], [date],
[milestone 2], [date], [date],
[milestone 3], [date], [date]
),
caption: [Milestones and dates.]
)
== Periodic assessments of the current state of the manuscript
+ How far is the manuscript from being completed (in percent completion)?
+ What keeps the manuscript from being submitted today?
+ List what is missing from the manuscript that could improve its impact.
+ What could be removed from the manuscriupt to streamline it?
= Daily Log
Record for each daily entry whatever of the following is needed to move the project forward:
- planned actions (optional)
- accomplishments
- descisions
- data
- new knowledge
- thoughts
- correspondence
- code that you have not finished
Often, I will paste email messages if they contain key information or decisions.
Record as much or little as needed.
== 2024 Ocotober 8
=== Accomplishments
- Created typst.app account. User name is hosed.
- Worked on biblatex and csl file for annotated bibliography
- Downloaded MDPI templated for crystal imaging review article
== 2024 October 9
=== Accomplishments
- Developed this template.
- Added key-bindings C-c C-f for folding section tree in typst. Unfold with C-c C-u to e29os/init.el.
- Learned how to make index with in-dexter.
- Learned how to make table of contents with builtin package.
- Learned how to install packages locally.
== 2024 October 10
- Read a LaTeX vs Typst post on TeXExchange. LaTeX is still the Gold Standard.
- I really should read <NAME>'s book LaTeX Companion. It is only 1800 pages long.
- Visited the webiste of TUG (Tex User Group). There was a synopsis of the 2023 meeting in a newsletter (TUG boat). I need to sign up for this newsletter. Someone spoke aobut typst at the 2023 meeting. The next meeting is in Keerala, India in mid-July 2025.
- Installed Codly (like minted) and tested example code.
- I have the Hayagaria package already installed.
- Downloaded the Masters Thesis from one of the cofounders.
- Brainstormed during the morning commute.
- One question is th ability
=== Correspondence
Sent e-mail to <NAME> about his upcoming talk on Typst.
== Next Action
- make new writing log template using the \#include funciton to include annotations with multiple paragraphs.
- install codly (like minted)
== To Be (Maybe) Done
_These are the tasks that are thought to be required to get the project
finished. The prioritizing of the tasks is the hard part. The book "Time
Power" by <NAME> provides helpful guidance on setting priorities.
I use an unordered list below but you can use a list of TODO items and
include this org file in the list of source files for the generation of
TODOs in org agenda. I generally would have an overwhelming number of
TODOs so I do not use org-agenda in this fashion._
- Wrapping figures in typst: https://github.com/typst/typst/discussions/1069
- Typst port of undergrad math in LaTeX: https://github.com/johanvx/typst-undergradmath
= Knowledgebase Management
_ This is a reminder to update your knowledge base(s) if you found anything worth adding to it._
This may any of the following:
- Add to your zettelkasten
- Process downloaded PDFs.
- Make entries in the BibTeX
If you maintain a knowledge base like a Zettelkästen in org-roam or
Obsidian or Notion, you might consider adding literature notes and
permanent notes at the end of a work session #footnote[https://wiki2.org/en/Zettelkasten] #footnote[https://wiki2.org/en/Comparison_of_note-taking_software].
The name of the index for this project is =XXXXXXXXX=. Enter =Control-c n f= to find
this project note. This knowledge base can store information that you
may want to use eventually in the paper.
These notes that you may add might be in the form of what are called
*permanent notes* that include new insights or plans for the work. These
thoughts are not directly linked or derived from any particular
reference in the literature. Another kind of note is known as a
*citation note* or *literature note* is derived from a specific
reference. This kind of note will contain the BibTeX cite key.
Although such notes can be stored in an annotated bibliography #footnote[https://github.com/MooersLab/annotatedBibliography], I seem less likely
to utilize this information while working on a manuscript because the
annotated bibliographies are in a different document. Because it is out
of sight, the annotated bibliography is also out of mind.
The advantage of keeping these bits of knowledge inside the writing log
is that you can link the entries made in the daily log section to these
bits of knowledge by using the label and ref macros of LaTeX. You can
also set up label and ref pairs between to-do items and the bits of
knowledge. Some of these notes may refer to a particular reference, so
you can include the cite key with these notes if the reference has been
included in the BibTeX library file sourced at the bottom of this file.
I usually source the BibTeX library file that I am using in the
annotated bibliography for a particular project. Keeping these items
together in one document will improve the odds that you act upon the
collected information, reducing the mental bandwidth you have to commit
to managing this writing log.
Another approach I use sometimes is to include such information on lines
that have been commented out in the manuscript's tex document near where
I want to utilize that information. I must admit that this approach can
become a little unwieldy if the comments span many lines.
If you use the Pomodoro method, you would probably want to commit the
last one or two poms of a work session on a writing project to update
your knowledge base. If you have been lagging on doing such updates, you
may want to commit four to six poms to this kind of work; you might have
to do this over multiple days if you have fallen behind.
= Daily Progress Accountability (Optional)
== Word count
#let results = csv("wordcount.csv")
#table(
columns: 3,
[*Date*], [*Day*],[*Words*],
..results.flatten(),
)
== Time log and autotracking
== Writing progress Google Sheets
The writing progress notebook enables the tracking of progress on a
project basis #footnote[https://github.com/MooersLab/writing-progress-2024-25]. The Notebook automatically updates sums of words
written and minutes spent across all projects on a given day. It only
takes a few seconds to enter the number of words written and the time
spent for a specific project on that project's Google Sheet. If you have
Voice In plus activated, say the words "open sheet 37" to have the
worksheet for project 37 opened in the web browser. If not, click on
this direct link to the Google Sheet in the compiled PDF of this writing log.
= Future additions and tangents
== Ideas to consider adding to the manuscript
=== Introduction
=== Results
=== Discussion
== Someday
_This section stores tasks that are related to the current project and
that may be worth doing someday. Often these tasks are tangential to
addressing the central hypothesis of the paper. This is a place for
capturing those wonderful ideas. Sometimes these ideas blossom into new
projects. This section can capture ideas that might be mentioned in
terms of future work in the discussion section of the manuscript._
=== Spin-off writing projects
= Guidelines, checklists, protocols, helpful hints
== Daily writing protocol #label("daily")
+ At start of work session, review the timeline, recent daily entries, next action item , and
to-do list.
+ Write the goal(s) for the current writing session as a means of
engaging mentally in the work. This prose could be retained or
deleted at the end of the work session.
+ At the end of the work session, move finished items to an achievement
list for the day.
+ Move the unfinished items to the to-do list.
+ Identify the next task or action.
+ [Optional] Update the wordcount.txt file, if you wrote anything.
+ [Optional] Update the project Sheet in the Writing Progress Workbook.
+ [Optional] Update your personal knowledge base.
== Installing Typst local packages
No installing is often required.
The package is downloaded when called by typst.
+ git clone repo in /Users/blaine/Library/Application Support/typst/packages/local/ on a Mac.
+ Check in the toml file for the version number. You will create a subfolder with this number and move the software to it.
+ The package-name and the github repo name may differ.
+ mkdir package-name/version-number
+ move folder contents to package-name/version-number/.
+ see examples at top of file of using the *local* namespace to import the package. The examples on the typst universe show the preview namespace instead.
+ enjoy
== Guidelines for debugging the annotated bibliography
For a template annotated bibliography, see
https://github.com/MooersLab/annotatedBibliography.
A variant for use with biblatex is coming soon.
+ Escape with a forward slash the following: \&, \_, \%, and \#.
+ Title case the journal titles.
+ Replace unicode characters with LaTeX code. Not all LaTeX document classes are compatible with unicode.
+ The primes have to be replaced with '.
+ The vertical red rectangles with a white dot in the middle should be replaced with a whitespace.
+ There are two styles in the bibtex world: bibtex and biblatex. BibTeX is simpler but typst requires BibLaTeX
+ Use Google Scholar bibtex over Medline or PubMed biblatex.
+ Often the error is in the bibitem entry above the one indicated in the error messages.
+ All interior braces must by followed by a comma, including the last one.
+ When stumped, replace the entry with a fresh one from Google Scholar.
== Guidelines for BibTeX to BibLaTeX library conversion
- Start R-Studio
- library(devtools)
- install_github("GeoBosh/rbibutils")
- library(rbibutils)
- bibConvert("~/Documents/global.bib", "~/Documents/globalBiblatex.bib", "bibtex", "biblatex")
== Graphical Abstract Protocol
#index[graphical abstract]
#show link: underline
I usually make the mistake of treating the graphical abstract as an
afterthought. Then there is no time to make one during submission of the
manuscript. This can lead to delays or to the journal converting one of
your sub-figures into a graphical abstract. A good example of a
graphical abstract is found #link("https://www.mdpi.com/2073-4352/11/3/273")[here].
This quote below is from #link("https://www.mdpi.com/journal/crystals/instructions#preparation")[preparation instructions].
#set quote(block: true)
#quote(attribution: [From last link])[A graphical abstract (GA)
is an image that appears alongside the text
abstract is the Table of Contents. In addition to summarizing the
content, it should represent the topic of the article in an interesting
way. The GA should be a high-quality illustration or diagram in any of
the following formats: PNG, JPEG, EPS, SVG, PSD or AI. Written text in a
GA should be clear and easy to read, using one of the following fonts:
Times, Arial, Courier, Helvetica, Ubuntu or Calibri. The minimum size
required for the GA is 560 \(\times\) 1100 pixels (height \(\times\)
width). When submitting larger images, please, keep to the same ratio.]
== Writer's Creede
A writer does the following #index[writer's creed]:
- Schedules daily writing time on workdays; takes a relaxed approach on weekends @Mooers2021Templates.
- Shows up and writes during the scheduled writing time.
- Stands up and walks around every 25 minutes for no more than 5 minutes (i.e., uses the Pomodoro technique).
- Limits generative writing to 3-5 hours daily; spends the rest of the day on supportive tasks and other duties.
- Overcomes writer's block by rewriting the last paragraph or reverse outlining a section.
- Keeps near a list of tricks for overcoming writer's block.
- Manages their energy by doing generative writing first, rewriting second, and supportive tasks later in the day.
- Jumps into generative writing; does not wait to be inspired.
- Does generative writing when half-awake early in the day and editing and rewriting when fully alert, generally mid to late morning.
- Masters their writing tools without letting the tools master them.
- Writes without distractions (no YouTube videos, TV, radio, etc.; playing classical music is okay sometimes).
- Tracks the time spent and words written by project ID.
- Takes credit for time spent reading material related to the project, especially if finished by making an entry in an annotated bibliography.
- Uses a separate writing log for each writing project.
- Makes writing social when it is mutually beneficial.
- Reads and writes about writing at least once a fortnight.
- Keeps up on weasel words, wordy phrases, cliché, and other junk English; reviews this list quarterly to avoid their use.
- If a scientist, writes with precision, clarity, and conciseness. The order is in descending importance. Has memorized this list.
- Uses computerized writing tools responsibly, not blindly: Takes full responsibility for the final draft.
- Documents in writing log any use of AI to generate or paraphrase passages.
- Uses dictation software for some generative writing.
- Uses software tools like *Grammarly*, the *LanguageTool*, and the *Hemingway.app* to stimulate improvements in their writing.
- Knows enough about good writing to accept only useful suggestions.
- Does not blindly accept noun clusters, English contractions, and weasel words suggested by AI software.
- Uses copilot when exhausted to complete sentences.
- Uses the paraphrasing tool of some chatbots (e.g. TexGPT) cautiously and only to generate intermediate drafts.
- Reviews this list periodically.
Premises of the creed:
- Writing is any activity that advances a writing project. Most of the time spent on these writing activities does not involve generative writing.
- Generative writing is the most valuable activity: All other activities descend from it.
- Generative writing and editing use different parts of the brain, so they should be done at separate times.
- Generative writing is best done when half awake because your internal editor is not fully on so new ideas are more likely to emerge.
- Generative writing be done by dictation while commuting if planned before the commute.
- Editing is best done when fully awake because your internal editor will be activated. (Be careful; late-night editing can keep you awake later than intended and interfere with your sleep pattern.)
- Most of the time spent on actual *writing* involves rewriting.
- Planning is an important (underemphasized) component of writing.
- Writing includes any activity that advances a writing project.
- The word count does not capture most writing-related activities. Hence, the time spent on these activities must be tracked to document these efforts.
- Time tracking is an essential component of time management. It is hard to manage what you do not measure. *Writing involves a lot of time management!!*
- 90 minutes of generative writing per day on one project is the optimal length of time due to our #link("https://www.youtube.com/watch?v=ezT8kGzYOng")[ultradian cycles].
- Writing includes reading the papers that you cite and those that you do not wind up citing. This reading activity can rejuvenate your momentum and inspire new ideas. It is best done in the evening so your subconscious can work overnight with the new insights. *Writing involves feeding your subconscious: Feed our head!*. Reading is grossly underemphasized in writing books. Time should be scheduled for it else it is less likely to be done.
- Writing includes mundane tasks like managing bibliographic libraries and making figures; these are good afternoon activities.
- Writing includes data analysis.
= Codly example
#import "@preview/codly:1.0.0": *
#show: codly-init.with()
#codly(
languages: (
rust: (
name: "Rust",
color: rgb("#CE412B")
),
)
)
```rust
pub fn main() {
println!("Hello, world!");
}
```
= Typst links to support customization
- #link("https://johnmacfarlane.net/texmath.html")[texmath web app: convert from Latex to typst]
- #link("https://github.com/sitandr/typst-examples-book")[Typst examples book]
- #link("https://typst.app")[typst.app]
- #link("https://typst.app/universe")[typst.app/universe]
- #link("https://typst.app/universe/search/?kind=packages&q=")[packages]
- #link("https://typst.app/universe/search/?kind=templates&q=")[templates]
- #link("https://forum.typst.app/")[typst forum: username of Blaine_Mooers]
- #link("https://typst.app/docs/reference/data-loading/csv/")[csv files]
- #link("https://typst.app/docs/guides/guide-for-latex-users/")[for LaTeX users]
- #link("https://github.com/cetz-package/cetz?tab=readme-ov-file")[cetz]
- #link("https://github.com/Jollywatt/typst-fletcher")[fletcher]
- #link("https://typst.app/universe/package/in-dexter")[in-dexter]
= Back matter
#set par(leading: 0.5em, justify: false)
#bibliography("template.bib",
title: "Cited References",
style: "cell")
= Index
#columns(3)[
#make-index(title: none)
]
|
|
https://github.com/Nianyi-GSND-Projects/GSND-5130-GP1 | https://raw.githubusercontent.com/Nianyi-GSND-Projects/GSND-5130-GP1/master/Draft%201/Research%20Proposal.typ | typst | #set page(paper: "us-letter")
#set par(justify: true)
#let title = "Research Proposal for Group #2"
#{
set align(center)
set text(size: 17pt, weight: "bold")
title
}
= Movitation
When discussing with the team about the RQ, a video I watched earlier came up in my mind.
The video is #link("https://www.youtube.com/watch?v=kI2CLIDj4Kw")[on _YouTube_], with a title of "The 2 Week Minecraft Phase Explained".
It introduces a phenomenon that a lot of _Minecraft_ players often get tired of their newly-started savegames quickly after playing them for a period of 2 weeks or so.
However, unlike what it's stating in the title, the video does _not_ explain why players do that _at all_; all it does is just pointing the thing out and leaves a mystery in viewers' minds!
This has been bugging me for a month (I've even put this question on the brainstorm board on the first class), so I proposed this as the topic for us to do the research.
Surprisingly, the other two members approved this plan immediately; it turns out they are _Minecraft_ players as well.
So this is it, the RQ is set.
Next we need to do is to look for possible related research papers and hope that it hasn't been done yet!
#{
set align(right)
[Nian'yi Wang]
}
= Research question
#let research_question = [Why do many _Minecraft_ players get tired of savegames quickly?]
#box(width: 100%, height: 40pt)[#{
set align(center + horizon)
set text(style: "italic", size: 15pt)
["#research_question"]
}]
= Methods & Data Samples
The question is asking about a subjective feeling of _Minecraft_ players, thus we must try to get direct information from real people. For qualitative researches, there are two major methods that fit our case: _taking surveys_ and _doing interviews_.
To us, with in a limited time range, taking surveys would be an easier options.
The target sample would be any reachable _Minecraft_ players, online or in-person.
Fortunately, we are in touch with #underline([the _Minecraft Wiki_ Discord server]), which is a place consisting of thousands of players all across the globe.
They make up an amazing sample base for our research.
We could also do in-person interviews, but then we will not be able to gather data from online sources.
Instead, we can narrow the sampling range to #underline([all students on the campus]);
there should be many students that play _Minecraft_!
---That means we will find a place in the campus area and randomly interview passing-by students.
With interviews, we could get more in-depth feedbacks of players' experiences towards the game.
We could then do some detailed case studies and extract key information out of them.
But either way, we will first design a rough roadmap of the questions we would like to cover for each target to make sure we don't get lost on the topic. |
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/rivet/0.1.0/src/schema.typ | typst | Apache License 2.0 | #import "config.typ" as conf
#import "renderer.typ"
#import "structure.typ"
#import "xml-loader.typ"
#let valid-extensions = ("yaml", "json", "xml")
#let parse-file(path) = {
let ext = path.split(".").last()
if not ext in valid-extensions {
let fmts = valid-extensions.map(fmt => "." + fmt).join(", ")
fmts = "(" + fmts + ")"
panic("." + ext + " files are not supported. Valid formats: " + fmts)
}
if ext == "yaml" {
return yaml(path)
} else if ext == "json" {
return json(path)
} else if ext == "xml" {
return xml-loader.load(path)
}
}
#let parse-raw(schema) = {
let lang = schema.lang
let content = schema.text
if not lang in valid-extensions {
let fmts = valid-extensions.join(", ")
fmts = "(" + fmts + ")"
panic("Unsupported format '" + lang + "'. Valid formats: " + fmts)
}
if lang == "yaml" {
return yaml.decode(content)
} else if lang == "json" {
return json.decode(content)
} else if lang == "xml" {
return xml-loader.parse(xml.decode(content).first())
}
}
#let load(path-or-schema) = {
let schema = if type(path-or-schema) == str {
parse-file(path-or-schema)
} else if type(path-or-schema) == dictionary {
path-or-schema
} else {
parse-raw(path-or-schema)
}
if "colors" in schema {
for struct in schema.colors.keys() {
for (span, col) in schema.colors.at(struct) {
if type(col) == str {
if col.starts-with("#") {
col = rgb(col)
} else {
let (r, g, b) = col.split(",").map(v => int(v))
col = rgb(r, g, b)
}
} else if type(col) == array {
col = rgb(..col)
} else if type(col) != color {
panic("Invalid color format")
}
schema.colors.at(struct).at(span) = col
}
}
} else {
schema.insert("colors", (:))
}
let structures = (:)
for (id, data) in schema.structures {
id = str(id)
structures.insert(id, structure.load(id, data))
}
return (
structures: structures,
colors: schema.at("colors", default: (:))
)
}
#let render(schema, width: 100%, config: auto) = {
if config == auto {
config = conf.config()
}
let renderer_ = renderer.make(config)
(renderer_.render)(schema, width: width)
} |
https://github.com/Shuenhoy/modern-zju-thesis | https://raw.githubusercontent.com/Shuenhoy/modern-zju-thesis/master/pages/graduate-cover.typ | typst | MIT License | #import "../utils/fonts.typ": 字号, 字体
#import "../utils/datetime-display.typ": datetime-display
#import "../utils/twoside.typ": *
#let graduate-cover(
info: (:),
// 其他参数
stoke-width: 0.5pt,
row-gutter: 11.5pt
) = {
if type(info.submit-date) == datetime {
info.submit-date = datetime-display(info.submit-date)
}
twoside-pagebreak
context {
counter(page).update(0)
v(-40pt)
set grid(
row-gutter: row-gutter,
rows: 1em,
stroke: (x, y) => (
bottom: if x == 1 {
stoke-width
} else {
none
},
),
)
set align(center)
[
#set text(size: 字号.小四, font: 字体.宋体)
#grid(
columns: (auto, auto, 1fr, auto, auto),
align: (left, center, left, left, center),
stroke: (x, y) => (
bottom: if x == 1 or x == 4 {
stoke-width
} else {
none
},
),
[分类号:], [#info.clc], [], [单位代码:], [#info.unitcode],
[密#h(1em)级:], [#info.secret-level], [], [学#h(2em)号:], info.student-id,
)
]
image("../assets/zju-name-graduate.png", width: page.width * 0.3)
v(-30pt)
text(size: 字号.小一, font: 字体.宋体)[#(info.degree)学位论文<mzt:no-header-footer>]
image("../assets/zju-emblem.svg", width: page.width * 0.15)
v(20pt)
block(
width: 80%,
[
#set text(size: 字号.小二, weight: "bold")
#grid(
columns: (auto, 1fr),
align: (start, center),
"中文论文题目:", info.title.first(),
..info.title.slice(1).map(v => (none, v)).flatten(),
grid.cell(stroke: none)[], grid.cell(stroke: none)[],
"英文论文题目:", text(size: 16pt, info.title-en.first()),
..info.title-en.slice(1).map(v => (none, text(size: 16pt, v))).flatten(),
grid.cell(stroke: none)[], grid.cell(stroke: none)[],
)
],
)
block(
width: 60%,
[
#set text(size: 字号.四号)
#grid(
columns: (auto, 1fr),
align: (start, center),
"申请人姓名:", info.author ,
"指导教师:", info.supervisor,
"专业名称:", info.grade + info.major,
"研究方向:", info.field,
"所在学院:", info.department,
grid.cell(stroke: none)[], grid.cell(stroke: none)[],
)
],
)
block(
width: 50%,
[
#set text(size: 字号.小三, weight: "bold")
#grid(
columns: (0.5fr, 0.3fr),
align: (start, center),
"论文提交日期", info.submit-date,
)
],
)
}
twoside-emptypage
} |
https://github.com/Myriad-Dreamin/arch-media-box-typst | https://raw.githubusercontent.com/Myriad-Dreamin/arch-media-box-typst/main/box.typ | typst |
#set page(margin: 0pt, height: 230mm, width: 153mm)
#let box-layout(content) = [
#place(image("background.svg"))
#scale(77.19%, content)
]
#show: box-layout
#set text(font: "Noto Sans CJK SC")
#let box-front = 124pt
#let box-side = 340pt
#let padding = 12pt
#let front-content(dy: 0pt, content) = place(dx: box-front, dy: dy, box(inset: padding, width: 220pt, content))
#let side-content(dy: 0pt, content) = place(dx: box-side, dy: dy, box(inset: (left: padding), content))
#let right-content(dy: 0pt, content) = rotate(270deg, place(dx: -192pt * 2, dy: 225pt * 2, box(inset: (left: padding), content)))
#let left-content(dy: 0pt, content) = rotate(90deg, place(dx: 225pt * 2, dy: -55pt * 2, box(inset: (left: padding), width: 250pt, content)))
#let arch-linux-logo = image("arch-log.svg")
#let arch-linux = [
#set text(size: 21pt)
Arch Linux™
]
#let title = [
#set text(size: 25pt)
盒装安装媒介
]
#let spec = [
#set text(size: 10pt)
#set list(marker: [---])
- Flash Drive
- x86-64
]
#front-content(dy: 11pt * 2, arch-linux)
#front-content(dy: 45pt * 2)[
#set text(size: 9pt)
请仔细阅读安装指南并在系统管理员指导下使用
谨慎用于生产环境安装
#arch-linux
#v(-1em)
#title
]
#front-content(dy: 210pt * 2, arch-linux)
#front-content(dy: 235pt * 2)[
#arch-linux
#v(-1em)
#title
#v(-1em)
#set text(size: 8.7pt, tracking: 0.025pt)
Arch Linux 是一个通用 x86-64 GNU/Linux 发行版,通过滚动更新尽可能地提供最新的稳定版软件。默认安装是一个最小的基本系统,用户可以随后安装需要的软件并对系统进行配置。
该包装内含一枚刻录有出厂时最新的 Arch Linux 安装映像的可引导 USB 闪存驱动器。您可以在之后向该USB 闪存驱动器刻录新的 Arch Linux 安装映像。
贮藏:-40℃ \~ 70℃ 温度范围内保存。
#linebreak()
妥善贮藏安装媒介,勿使非安装人员触及。
安装方法、常见问题、注意事项等详见安装指南
#let hl = linebreak() + h(5em)
硬件要求:x86-64 (AMD64) 架构 CPU
#hl 512 MiB 内存
#hl 2 GiB 硬盘可用空间
#hl Internet 连接
网站主页:https://archlinux.org/
]
#side-content(dy: 30pt * 2, spec)
#side-content(dy: 45pt * 2, arch-linux-logo)
#side-content(dy: 183pt * 2, spec)
#side-content(dy: 218pt * 2, spec)
#side-content(dy: 373pt * 2, spec)
#side-content(dy: 235pt * 2, arch-linux-logo)
#place(dx: box-front + 40pt * 2, dy: 394pt * 2)[
#set text(font: "Montserrat")
CC BY-SA 4.0
#set text(font: "Montserrat", weight: 200, size: 8pt)
#linebreak()
#v(-1.2em)
Based on arch-media-box
]
#side-content(dy: 393pt * 2, box(inset: (left: 3pt))[
#set text(font: "Montserrat", size: 7pt, weight: 300)
Made by
#linebreak()
#set text(font: "Montserrat", size: 11pt, weight: 400)
<NAME>
])
#right-content[
#set text(size: 9.5pt)
#set block(spacing: 1em)
码上放心 主签名密钥
网站查询:https://archlinux.org/master-keys/
]
#left-content[
#let row(l, r) = box(height: 0.65em, width: 100%, place(left, [
#set text(size: 9.5pt)
#l
]) + place(right, [
#set text(font: "Inconsolata", weight: 300, size: 12pt, tracking: 5pt)
#r
]))
#row([产品批号], [114514])
#row([生产日期], [2023-10-18])
#row([有效期至], [2033-10-17])
]
|
|
https://github.com/AOx0/expo-nosql | https://raw.githubusercontent.com/AOx0/expo-nosql/main/examples/gauss.typ | typst | MIT License | #import "../slides.typ": *
#show: slides.with(
authors: "<NAME>",
short-authors: "<NAME>",
title: "On a revolutionary way to sum up natural numbers",
subtitle: "What they won't teach you in school",
short-title: "Sum of natural numbers",
date: "1784",
)
#set text(font: "GFS Neohellenic")
#show math.equation: set text(font: "GFS Neohellenic Math")
#slide(theme-variant: "title slide")
#new-section("Introduction")
#slide(title: "Problem statement")[
Let $n in NN$.
We are interested in sums of the form
$ 1 + ... + n = sum_(i=1)^n i $
]
#slide(title: "The theorem")[
I discovered that
$ sum_(i=1)^n i = n(n+1)/2 $
Let's prove that!
]
#new-section("Proof")
#slide(title: "Method of proof")[
We will prove the theorem by induction, following these steps:
+ base case
+ induction hypothesis
+ induction step
]
#slide(title: "Proof")[
#set text(.7em)
#one-by-one[
*base case:* Let $n = 1$. Then $sum_(i=1)^1 i = (1 dot.c 2)/2 = 1$ $checkmark$
][
*ind. hypothesis:* Let $sum_(i=1)^k i = k(k+1)/2$ for some $k >= 1$.
][
*ind. step:* Show that
$sum_(i=1)^(k+1) i = ((k+1)(k+2))/2$
$sum_(i=1)^(k+1) i = sum_(i=1)^k i quad + quad (k+1)$
][
$= k(k+1)/2 + (k+1)$
][
$= (k+1) dot.c (k/2 + 1)
= (k+1) dot.c (k/2 + 2/2)
= ((k+1)(k+2))/2
#h(1em) checkmark$
]
]
#slide(theme-variant: "wake up")[
= Proof is over, wake up!
]
#new-section("Conclusion")
#slide(title: "That's it!")[
Now you know how to calculate those sums more quickly, nice!
]
|
https://github.com/ludwig-austermann/typst-timetable | https://raw.githubusercontent.com/ludwig-austermann/typst-timetable/main/lib/default-blocks.typ | typst | MIT License | #let display-time(time) = {
let hour = int(time)
let minute = 60 * (time - hour)
if hour < 10 { [0] }
str(hour)
[:]
if minute < 10 { [0] }
str(minute)
}
#let event-cell(event, show-time: false, show-day: false, unique: true) = {
box(stroke: (left: event.color + 3pt), inset: (left: 5pt, y: 2pt), {
strong(event.abbrv)
h(1fr)
event.kind
linebreak()
set text(9pt)
event.room
if not unique {
h(1fr)
emoji.warning
}
if show-time {
linebreak()
if show-day { event.day + ": "}
display-time(event.start)
[ -- ]
display-time(event.end)
}
})
}
#let time-cell(time, lang-dict) = align(horizon + right, {
if time.keys().contains("display") {
time.display
} else {
lang-dict.from + " "
display-time(time.start)
linebreak()
lang-dict.to + " "
display-time(time.end)
}
}) |
https://github.com/eliapasquali/typst-thesis-template | https://raw.githubusercontent.com/eliapasquali/typst-thesis-template/main/preface/table-of-contents.typ | typst | Other | #import "../config/constants.typ": figuresList, tablesList
#set page(numbering: "i")
#[
#show outline.entry.where(level: 1): it => {
linebreak()
link(it.element.location(), strong(it.body))
h(1fr)
link(it.element.location(), strong(it.page))
}
#outline(
indent: auto,
depth: 5
)
]
#v(8em)
#outline(
title: figuresList,
target: figure.where(kind: image)
)
#v(8em)
#outline(
title: tablesList,
target: figure.where(kind: table),
indent: auto
) |
https://github.com/matthiasbeyer/typst-template-paper | https://raw.githubusercontent.com/matthiasbeyer/typst-template-paper/master/paper.typ | typst | MIT License | #import "@preview/charged-ieee:0.1.2": ieee
#import "@preview/cetz:0.2.2": canvas, draw, tree
#import "@preview/gviz:0.1.0": *
#show raw.where(lang: "dot-render"): it => render-image(it.text)
#show: ieee.with(
title: [A typesetting system to untangle the scientific writing process],
abstract: [
The process of scientific writing is often tangled up with the intricacies
of typesetting, leading to frustration and wasted time for researchers. In
this paper, we introduce Typst, a new typesetting system designed
specifically for scientific writing. Typst untangles the typesetting
process, allowing researchers to compose papers faster. In a series of
experiments we demonstrate that Typst offers several advantages, including
faster document creation, simplified syntax, and increased ease-of-use.
],
authors: (
(
name: "<NAME>",
department: [Co-Founder],
organization: [Typst GmbH],
location: [Berlin, Germany],
email: "<EMAIL>"
),
(
name: "<NAME>",
department: [Co-Founder],
organization: [Typst GmbH],
location: [Berlin, Germany],
email: "<EMAIL>"
),
),
index-terms: ("Scientific writing", "Typesetting", "Document creation", "Syntax"),
bibliography: bibliography("refs.bib"),
)
= Introduction
Scientific writing is a crucial part of the research process, allowing
researchers to share their findings with the wider scientific community.
However, the process of typesetting scientific documents can often be a
frustrating and time-consuming affair, particularly when using outdated tools
such as LaTeX. Despite being over 30 years old, it remains a popular choice for
scientific writing due to its power and flexibility. However, it also comes with
a steep learning curve, complex syntax, and long compile times, leading to
frustration and despair for many researchers. @netwok2020
== Paper overview
In this paper we introduce Typst, a new typesetting system designed to
streamline the scientific writing process and provide researchers with a fast,
efficient, and easy-to-use alternative to existing systems. Our goal is to shake
up the status quo and offer researchers a better way to approach scientific
writing.
By leveraging advanced algorithms and a user-friendly interface, Typst offers
several advantages over existing typesetting systems, including faster document
creation, simplified syntax, and increased ease-of-use.
To demonstrate the potential of Typst, we conducted a series of experiments
comparing it to other popular typesetting systems, including LaTeX. Our findings
suggest that Typst offers several benefits for scientific writing, particularly
for novice users who may struggle with the complexities of LaTeX. Additionally,
we demonstrate that Typst offers advanced features for experienced users,
allowing for greater customization and flexibility in document creation.
Overall, we believe that Typst represents a significant step forward in the
field of scientific writing and typesetting, providing researchers with a
valuable tool to streamline their workflow and focus on what really matters:
their research. In the following sections, we will introduce Typst in more
detail and provide evidence for its superiority over other typesetting systems
in a variety of scenarios.
= Methods
#lorem(90)
$ a + b = gamma $
#lorem(20)
#let data = (
[A], ([B], [C], [D]), ([E], [F])
)
= Figures
@some-things shows a graph of things.
#figure(
canvas(length: 1cm, {
import draw: *
set-style(content: (padding: .2),
fill: gray.lighten(70%),
stroke: gray.lighten(70%))
tree.tree(data, spread: 2.5, grow: 1.5, draw-node: (node, ..) => {
circle((), radius: .45, stroke: none)
content((), node.content)
}, draw-edge: (from, to, ..) => {
line((a: from, number: .6, b: to),
(a: to, number: .6, b: from), mark: (end: ">"))
}, name: "tree")
// Draw a "custom" connection between two nodes
let (a, b) = ("tree.0-0-1", "tree.0-1-0",)
line((a, .6, b), (b, .6, a), mark: (end: ">", start: ">"))
}),
caption: [A Graph of some things.],
) <some-things>
= Some code examples
Some code examples go here.
```python
def foo():
print(1)
```
Or lets do the same thing in `Rust`:
```rust
fn foo() -> () {
println!("1")
}
```
= Lets try some formulas
$
a = b_c * 2 \
b_c = { f_o^2 in RR | f_o gt.eq.not a } \
$
$
vec(1, 2, delim: "[") colon.eq "foo"
sum_(k=0)^n k
&= 1 + ... + n \
&= (n(n+1)) / 2
$
We really love the math equations we can write in here, which is really a great
thing, isn't it?
$ frac(
frac(x^2, y^2 + 15y + 4),
frac(x^2^4, f(y))
)
$
= Some graphs again
```dot-render
digraph someshape {
node [shape=box];
A -> B;
B -> C;
C -> D;
C -> E;
A -> E;
}
```
|
https://github.com/nicolas-geniteau/resume-nicolas-geniteau | https://raw.githubusercontent.com/nicolas-geniteau/resume-nicolas-geniteau/main/metadata.typ | typst | #let firstName = "Nicolas"
#let lastName = "Géniteau"
#let personalInfo = (
// phone: "",
// email: "",
linkedin: "nicolas-geniteau",
github: "nicolas-geniteau",
)
#let headerQuoteInternational = (
"": text(size: 13pt)[*Freelance* - Site Reliability Engineer / DevOps Engineer / Cloud Architect],
)
#let cvFooterInternational = (
"": "Curriculum vitae",
)
#let letterFooterInternational = (
"": "Cover Letter",
)
#let awesomeColor = "skyblue"
#let profilePhoto = "../images/photo.png"
#let varLanguage = ""
#let varEntrySocietyFirst = true
#let varDisplayLogo = true |
|
https://github.com/8LWXpg/typst-ansi-render | https://raw.githubusercontent.com/8LWXpg/typst-ansi-render/master/test/test.typ | typst | MIT License | #import "../ansi-render.typ": ansi-render as __ansi-render, terminal-themes
#set document(date: none)
// workaround before set is implemented
#let ansi-render = __ansi-render.with(inset: 5pt, radius: 3pt, theme: terminal-themes.vscode)
// newline with background color
#ansi-render("\u{1b}[101mHello
World")
// Render empty newlines
#grid(
columns: (auto, auto),
column-gutter: 1pt,
ansi-render("\n\n\n\n\n"),
ansi-render("1\n2\n3\n4\n5\n6"),
) |
https://github.com/rangerjo/tutor | https://raw.githubusercontent.com/rangerjo/tutor/main/example/src/ex1/ex.typ | typst | MIT License | #import "@local/tutor:0.4.0": points, checkbox
#let exercise(cfg) = [
#heading(level:cfg.level,
[Abbreviation FHIR (#points(1) point)])
What does FHIR stand for?
#set list(marker: none)
- #checkbox(cfg, false) Finally He Is Real
- #checkbox(cfg, true) Fast Health Interoperability Resources
- #checkbox(cfg, false) First Health Inactivation Restriction
#if cfg.sol {
[ Further explanation: FHIR is the new standard developed by HL7. ]
}
]
|
https://github.com/Az-21/typst-components | https://raw.githubusercontent.com/Az-21/typst-components/main/style/1.0.0/dependencies.typ | typst | Creative Commons Zero v1.0 Universal | #import "@preview/fletcher:0.5.1" as fletcher: diagram, node, edge
#import "@preview/fontawesome:0.4.0": *
#import "@preview/name-it:0.1.1": name-it as name
#import "@preview/note-me:0.2.1": *
#import "@preview/nth:1.0.1": nths as nth
#import "@preview/physica:0.9.3": *
#import "@preview/showybox:2.0.1": showybox
#import "@preview/splash:0.4.0": tailwind
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/style_05.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Test text properties.
$text(#red, "time"^2) + sqrt("place")$
|
https://github.com/matthiasbeyer/typst-template-paper | https://raw.githubusercontent.com/matthiasbeyer/typst-template-paper/master/transcript.typ | typst | MIT License | #import "@matthiasbeyer/ttt:0.1.0": *
#set text(lang: "en")
#show: ttt.with(
author: "<NAME>",
class: [Computer Science],
subject: [Trees],
date: datetime(year: 2024, month: 03, day: 19),
bibliography: bibliography("refs.bib"),
)
= Some example
Some text.
|
https://github.com/frectonz/the-pg-book | https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/090.%20googles.html.typ | typst | googles.html
Why There Aren't More Googles
Want to start a startup? Get funded by
Y Combinator.
April 2008U<NAME>
wrote recently that the reason there aren't more Googles is
that most startups get bought before they can change the world.
Google, despite serious interest from Microsoft and Yahoo—what
must have seemed like lucrative interest at the time—didn't
sell out. Google might simply have been nothing but Yahoo's or
MSN's search box.Why isn't it? Because Google had a deeply felt sense of purpose:
a conviction to change the world for the better.
This has a nice sound to it, but it isn't true.
Google's founders were willing to sell early on.
They just wanted more than acquirers were willing to pay.It was the same with Facebook. They would have sold, but Yahoo blew it
by offering too little.Tip for acquirers: when a startup turns you down, consider raising
your offer, because there's a good chance the outrageous price they
want will later seem a bargain.
[1]From the evidence I've seen so far,
startups that turn down acquisition offers usually end up doing better.
Not always, but usually there's a bigger offer coming, or
perhaps even an IPO.Of course, the reason startups do better when they turn down
acquisition offers is not necessarily that all such offers undervalue
startups. More likely the reason is that the kind of founders who
have the balls to turn down a big offer also tend to be very
successful. That spirit is exactly what you want in a startup.While I'm sure Larry and Sergey do want to change the world, at
least now, the reason Google survived to become a big, independent
company is the same reason Facebook has so far remained independent:
acquirers underestimated them.Corporate M&A is a strange business in that respect. They consistently
lose the best deals, because turning down reasonable offers is the
most reliable test you could invent for whether a startup will make
it big.VCsSo what's the real reason there aren't more Googles? Curiously
enough, it's the same reason Google and Facebook have remained
independent: money guys undervalue the most innovative startups.The reason there aren't more Googles is not that investors encourage
innovative startups to sell out, but that they won't even fund them.
I've learned a lot about VCs during the 3 years we've been doing Y
Combinator, because we often have to work quite closely with them.
The most surprising thing I've learned is how conservative they
are. VC firms present an image of boldly encouraging innovation.
Only a handful actually do, and even they are more conservative in
reality than you'd guess from reading their sites.I used to think of VCs as piratical: bold but unscrupulous. On
closer acquaintance they turn out to be more like bureaucrats.
They're more upstanding than I used to think (the good ones, at
least), but less bold. Maybe the VC industry has changed. Maybe
they used to be bolder.
But I suspect it's the startup world that has
changed, not them. The low cost of starting a startup means the
average good bet is a riskier one, but most existing VC firms still
operate as if they were investing in hardware startups in 1985.<NAME> said "Don't worry about people stealing your ideas.
If your ideas are any good, you'll have to ram them down people's
throats." I have a similar feeling when I'm trying to convince VCs
to invest in startups Y Combinator has funded. They're terrified
of really novel ideas, unless the founders are good enough salesmen
to compensate.But it's the bold ideas that generate the biggest returns. Any
really good new idea will seem bad to most people; otherwise someone
would already be doing it. And
yet most VCs are driven by consensus, not just within their firms,
but within the VC community. The biggest factor determining how a
VC will feel about your startup is how other VCs feel about it. I
doubt they realize it, but this algorithm guarantees they'll miss
all the very best ideas. The more people who have to like a new
idea, the more outliers you lose.Whoever the next Google is, they're probably being told right now
by VCs to come back when they have more "traction."Why are VCs so conservative? It's probably a combination of factors.
The large size of their investments makes them conservative.
Plus they're investing other people's money, which makes
them worry they'll get in trouble if they do something risky and
it fails. Plus most of them are money guys rather than technical
guys, so they don't understand what the startups they're investing
in do.What's NextThe exciting thing about market economies is that stupidity equals
opportunity. And so it is in this case. There is a huge, unexploited
opportunity in startup investing. Y Combinator funds startups at
the very beginning. VCs will fund them once they're already starting
to succeed. But between the two there is a substantial gap.There are companies that will give $20k to a startup that has nothing
more than the founders, and there are companies that will give $2
million to a startup that's already taking off,
but there aren't enough investors who will give $200k to a startup
that seems very promising but still has some things to figure out.
This territory is occupied mostly by
individual angel investors—people like <NAME>, who
gave Google $100k when they seemed promising but still had some
things to figure out. I like angels, but there just aren't enough
of them, and investing is for most of them a part time job.And yet as it gets cheaper to start startups, this sparsely occupied
territory is becoming more and more valuable. Nowadays a lot of
startups don't want to raise multi-million dollar series A rounds.
They don't need that much money, and they don't want the hassles
that come with it. The median startup coming out of Y Combinator
wants to raise $250-500k. When they go to VC firms they have to
ask for more because they know VCs aren't interested in such small
deals.VCs are money managers. They're looking for ways to put large sums
to work. But the startup world is evolving away from their current
model.Startups have gotten cheaper. That means they want less money, but
also that there are more of them. So you can still get large returns
on large amounts of money; you just have to spread it more broadly.I've tried to explain this to VC firms. Instead of making one $2
million investment, make five $400k investments. Would that mean
sitting on too many boards? Don't sit on their boards. Would that
mean too much due diligence? Do less. If you're investing at a
tenth the valuation, you only have to be a tenth as sure.It seems obvious. But I've proposed to several VC firms that they
set aside some money and designate one partner to make more, smaller
bets, and they react as if I'd proposed the partners all get nose
rings. It's remarkable how wedded they are to their standard m.o.But there is a big opportunity here, and one way or the other it's
going to get filled. Either VCs will evolve down into this gap or,
more likely, new investors will appear to fill it. That will be a
good thing when it happens, because these new investors will be
compelled by the structure of the investments they make to be ten
times bolder than present day VCs. And that will get us a lot more
Googles. At least, as long as acquirers remain stupid.
Notes[1]
Another tip: If you want to get all that value, don't destroy the
startup after you buy it. Give the founders enough autonomy that
they can grow the acquisition into what it would have become.Thanks to <NAME>, <NAME>, <NAME>, Jessica
Livingston, <NAME>, and <NAME> for reading drafts of this.Russian Translation
|
|
https://github.com/soul667/typst | https://raw.githubusercontent.com/soul667/typst/main/PPT/typst-slides-fudan/themes/polylux/book/src/dynamic/one-by-one-start.typ | typst | #import "../../../polylux.typ": *
#set page(paper: "presentation-16-9")
#set text(size: 50pt)
#polylux-slide[
#one-by-one(start: 3)[first ][second ][third]
]
|
|
https://github.com/i-am-wololo/cours | https://raw.githubusercontent.com/i-am-wololo/cours/master/main/parties_i23/logique.typ | typst | #import "../templates.typ": *
= Definitions et props
#definition(title:"Commutatif")[les variables peuvent etre inverses]
#definition(title:"L'arbre de Derivation")[C'est un format de pour representer une proposition]
#figure(
image("../ArbreDerivation.png", width:60%),
caption: text(size:8pt, $(P => Q) and (P or not R) $)
)
#definition(title:"<NAME>")[Soit $P$ et $Q$ deux assertions, alors \
$not (P or Q) eq.triple not P and not Q \
not (P and Q) eq.triple not P or not Q
$
]
= Tables de verite
il est assume qu'un connecteur est commutatif sauf mentione autrement
== table de $and$: q binaire
#truthtable(($bot$, $bot$, $bot$,
$top$, $bot$, $bot$,
$bot$, $top$, $bot$,
$top$, $top$, $top$
), $and$
)
== table de $or$: q binaire
#truthtable(($bot$, $bot$, $bot$,
$bot$, $top$, $top$,
$top$, $bot$, $top$,
$top$, $top$, $top$
),
$or$)
== table de $xor$: q binaire
#truthtable(($bot$, $bot$, $bot$,
$bot$, $top$, $top$,
$top$, $bot$, $top$,
$top$, $top$, $bot$
)
,$xor$)
== table de $=>$: q binaire dit non commutatif
#truthtable(($bot$, $bot$, $top$,
$bot$, $top$, $top$,
$top$, $bot$, $bot$,
$top$, $top$, $top$),
$=>$)
autrement dit, vrai sauf si p est vrai et q est faux
== table de $<=>$: q binaire
#truthtable(($bot$, $bot$, $top$,
$bot$, $top$, $bot$,
$top$, $bot$, $bot$,
$top$, $top$, $top$,
),$<=>$) vrai si les deux variables ont la meme valeur
== Proprietes
- comutativite de $and$ et $or$
$ (p and q) eq.triple (q and p) $
$ (p or q) eq.triple (q or p) $
- associativite de $and$ et $or$
$ ((P and Q) and R) eq.triple ((q and R) and P)$
$((P or Q) or R) eq.triple ((Q or R) or P) $
- idempotence de $and$ et $or$
$ (p and p) eq.triple p$ \
$ (p or p) eq.triple p$
== Modus{ponens, tollens}
#definition(title:"modus ponen")[Soit $P$ et $Q$ deux propositions, si $P$ est vrai et $P => Q$ est vrai, alors Q est vrai.
$ P, P => Q tack.l Q $]
car $P => q eq.triple not Q => not P$
#definition(title:"modus ponen")[Soit $P$ et $Q$ deux propositions, si $not Q$ est vrai et $P => Q$ est vrai, alors la proposition $not P$ est vrai.
$ not Q, P => Q tack.l not P $
]
= TPs
== Question 1: Ecrire une fonction #py("interpretations(nbVar)") qui renvoie le tuple constitue de toutes les interpretations possible de nbvar variables propositionnelles
la technique que j'ai opte est de calculer tous les nombre possible en binaire jusqu'a $2^"nbvar"$, puis de les retranscrire en tuple de vrai/faux. Voici le code (on assume une fonction translate to tuple defini comme le suit)
#py("
# Q1: ecrire une fonction Inter(nbvar) qui renvoie le tuple constitue de toutes les interpretations possible de nbvar variables propositionnelles
def translatetotuple(binary: str):
result = []
for i in binary:
if i == '1':
result.append(True)
else:
result.append(False)
return tuple(result)
def inter(nbvar):
finalresult = ()
for i in range(nbvar**2):
result = bin(i)
result = result[2:]
while len(result)<nbvar:
result = '0'+result
result = translatetotuple(result)
finalresult += result,
return finalresult
")
== Question 2.
Une formule propositionelle FP de n variables est codee par une chiande de caracteres respectant la syntaxe python.
les variables étant toujours codées V[0], V[1],… ,V[n-1]. Écrivez une fonction TV(FP,n) qui renvoie la table de vérité de la formule FP sous forme de tuple de tuples à l'aide de la fonction Inter et la fonction d'évaluation eval(chaine) du Python qui évalue une chaine de caractères si elle respecte la syntaxe du langage Python.
Exemple. Avec la chaîne de caractère FP = "V[0] and V[1]", l'appel de la fonction TV(FP,2) doit renvoyer le tuple
#py("((False,False,False),(False,True,False),(True,False,False),(True,True,True))")
le code est incomplet, mais le concept est juste. on genere les combinaison, puis on laisse exec evaluer l'expression, enfin on append dans la variable resultat final et on renvoie (le code n'est pas au point mais le concept est celui la)
#py("
def TV(fp, nbvar):
variables = inter(nbvar)
endresult = ()
for V in variables:
endresult += (i, (exec(fp)),)")
|
|
https://github.com/VeeIsForVanana/resume_template | https://raw.githubusercontent.com/VeeIsForVanana/resume_template/main/resume.typ | typst | #import "@preview/oxifmt:0.2.0": strfmt
#let contact_box(
body
) = {
align(horizon)[
#set text(
size: 0.85em,
)
#box(
width: 70%,
height: auto,
fill: rgb("f2f2f2"),
radius: 20%,
outset: 11pt,
)[
#align(left)[
#body
]
]
]
}
// document-wide template
#let resume(
author: "",
doccode: "4",
subtitle: "",
contacts-l: (0,),
contacts-r: (0,),
body
) = {
set document(
author: author,
title: strfmt("{} R{}", author, doccode),
date: auto
)
set page(
margin: (
top: 1.25cm,
bottom: 1.25cm,
left: 1.5cm,
right: 1.5cm,
),
footer: align(right)[
#block(
fill: rgb(26, 70, 116, 65%),
width: 100%,
height: 100%,
inset: 1%
)[
#set text(size: 10pt)
#set align(horizon)
This resume was made using #link("https://typst.app")[Typst] with a #link("https://github.com/VeeIsForVanana/resume_template")[template] by <NAME>
]
]
)
set text(
font: "Fira Sans",
size: 11.2pt
)
show link: it => underline(text(
fill: rgb("#0645AD"), [#it]
))
block[
#align(center)[
#block(text(weight: 700, 3em)[#smallcaps(author)])
#linebreak()
#block(width: auto, height: 5%)[
#grid(
columns: (1fr, 1fr),
rows: (1fr, 1fr),
column-gutter: 1%,
row-gutter: 4fr,
..contacts-l.map(contact_box),
..contacts-r.map(contact_box),
)
]
]
]
body
}
// section headers
#let section(
name: ""
) = {
set text(
fill: rgb("1a4674"),
weight: "bold"
)
[= #name]
line(length: 100%, stroke: 0.5pt + rgb("ffe052"))
}
// education section
#let edu(
institution: "",
duration: "",
main_attainment: (),
awards: (),
gwa: "",
body
) = {
grid(
columns: (auto, 1fr),
align(left)[
#strong[#main_attainment] | #institution
],
align(right)[
#emph[#duration]
]
)
for award in awards {
emph[Awarded #award]
}
body
}
// skills section
#let skills(
field: "",
skills: ()
) = {
strong[#field: ]
skills.join(" | ")
}
// experience section
#let exp(
position: "",
organization: "",
duration: "",
body
) = {
grid(
columns: (auto, 1fr),
align(left)[
#strong[#position] | #organization
],
align(right)[
#emph[#duration]
]
)
body
}
// projects section
#let proj(
name: "",
duration: "",
body
) = {
grid(
columns: (auto, 1fr),
align(left)[
#strong[#name]
],
align(right)[
#emph[#duration]
]
)
body
} |
|
https://github.com/howardlau1999/sysu-thesis-typst | https://raw.githubusercontent.com/howardlau1999/sysu-thesis-typst/master/chapters/appendix02.typ | typst | MIT License | = 关于 sysu-thesis <sysu-thesis>
地里实,常手会因陆月有,面小者县巴么用要中事才轻树客各集背物阿据员重友报原声之知女依中别很,岸本本和北们动基速不。 运是知文人么具东,一大惊住多家族我能知金妈。 用孩他...... 次而的管案外,脑新告? 集离主经先当小部这对校话来动。 然兴童农些其着住...... 天片独什性什信!
住是走有一足时一办为以! 条会其不造便影重色政,丽路受体朋美现把代有选什关以文近起明也音职,了市新! 术放立分很文一又山局大二外一收起案时:变日两,被使么,响气热更到说语于社一少点都的文出节...... 广感两争:应英知高不厂爱次成这理孩受艺性全; 其了球境化火一? 包亲我这很到的该有:上命品选正容自儿法地情候性一门转,头成言。 子势较男展却么求部论像评屋特请白,都研人实观笔比。 跟例统一惊学风住农共数广如保对星代方过手事力后平:房感经要大那国算房奖老未程收,分她国? 的者第河老部不高正,那雄事意; 的却公。 来入喜、什问整达去水远政子统,艺一专,热印。
费品来; 东告排可学分不书、男长门投己期了亲好让游同多者名次值农苦晚点权友...... 地政场候金转是回领课多,感于谈香加成。 服投目术经西好政善上主价水事,确有于宝,来维的部感作场出他精风! 我房字元的每光我金毛师? 通快男市评很地。 适信没步,步要统我大一一长? 重兴东实孩够电深的天去!
从的那动星,无深规,后前第月。 公需是,明生日接甚她部相说美止联个设你了代到可叫常病和的童种时减于常生能心成而费大以,人现色; 量变公接? 你知跟不处设角一手态买? 构石小些年进行就处电着来养文用、始素票愿,步较展食,术持会总,压这基到假的片地心研分有渐是纸经企? 合人听无行、护四他子无化保们真子年权年星式五...... 得处方? 真男长时没阳两形一己样教论,于星开、大推团产心方在要下节景。 车关程香一,生得空活生资力:车是到,争杂常李越谈政区:全相标助,前动题下切力此不女安边成心且子有? 买儿那去经,生完但? 人岸兴上证动体意较之观教告展题看像是是至结妈住城员望洋说老样一社们上有那方个着食为者主了级中落我高和研。 来率车着,后良满灯质片突来欢一庭点施课最管风史有总而闻果什人活上将须河草不早出们身,见例正,照多着观进心为形制法级康职医单改他台年林学当怕以严,得那效器眼没我们乐长同合管水精全...... 素她们有。
她经们因画土水来这体里外速难出亲来:名超交开相的子孩国看能子相,建我却乡本面人,们物喜之过回多天合,笔题头运、公新比,代公规企尽是对大育队开好门新美...... 小车经...... 境在子优时原交空外离家这亚水智来心体学这定量听学众过招草常品上觉代到人...... 诉作望他游女,此以已我看主各身上,奖奖一脚。
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/import-08.typ | typst | Other | // Can't import from closures, despite modifiers.
#let f(x) = x
// Error: 9-18 cannot import from user-defined functions
#import f.with(5): x
|
https://github.com/edgarcarbajal/typst-resume | https://raw.githubusercontent.com/edgarcarbajal/typst-resume/main/README.md | markdown | MIT License | # typst-resume
A resume made in Typst. Special thanks to [<NAME>](https://github.com/angelacastaneda) for helping me out set the project up and helping me learn Typst!
## License
Under MIT License
|
https://github.com/ClazyChen/Table-Tennis-Rankings | https://raw.githubusercontent.com/ClazyChen/Table-Tennis-Rankings/main/history/2013/MS-06.typ | typst |
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (1 - 32)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[1], [<NAME>], [CHN], [3395],
[2], [MA Long], [CHN], [3386],
[3], [XU Xin], [CHN], [3318],
[4], [WANG Hao], [CHN], [3280],
[5], [<NAME>], [GER], [3160],
[6], [<NAME>], [CHN], [3132],
[7], [WANG Liqin], [CHN], [3122],
[8], [HAO Shuai], [CHN], [3067],
[9], [<NAME>], [BLR], [3013],
[10], [#text(gray, "<NAME>")], [CHN], [3004],
[11], [CHEN Qi], [CHN], [2997],
[12], [CHUANG Chih-Yuan], [TPE], [2996],
[13], [OVTCHAROV Dimitrij], [GER], [2992],
[14], [<NAME>], [JPN], [2979],
[15], [GAO Ning], [SGP], [2950],
[16], [<NAME>], [GER], [2945],
[17], [<NAME>], [JPN], [2939],
[18], [#text(gray, "<NAME>ungmin")], [KOR], [2925],
[19], [MIZUTANI Jun], [JPN], [2898],
[20], [MAZE Michael], [DEN], [2889],
[21], [<NAME>], [ROU], [2881],
[22], [<NAME>], [IRI], [2874],
[23], [<NAME>], [KOR], [2862],
[24], [FANG Bo], [CHN], [2856],
[25], [<NAME>], [CRO], [2855],
[26], [<NAME>], [GER], [2854],
[27], [<NAME>], [HKG], [2838],
[28], [<NAME>], [POR], [2835],
[29], [<NAME>], [TPE], [2822],
[30], [<NAME>], [AUT], [2821],
[31], [<NAME>], [SGP], [2817],
[32], [<NAME>], [JPN], [2797],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (33 - 64)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[33], [<NAME>], [KOR], [2791],
[34], [OH Sangeun], [KOR], [2778],
[35], [<NAME>], [CRO], [2773],
[36], [<NAME>], [SLO], [2748],
[37], [MURAMATSU Yuto], [JPN], [2746],
[38], [APOLONIA Tiago], [POR], [2745],
[39], [SHIBAEV Alexander], [RUS], [2744],
[40], [KIM Minseok], [KOR], [2744],
[41], [<NAME>], [CHN], [2735],
[42], [<NAME>], [GER], [2734],
[43], [TAKAKIWA Taku], [JPN], [2732],
[44], [GIONIS Panagiotis], [GRE], [2731],
[45], [LIVENTSOV Alexey], [RUS], [2724],
[46], [CHO Eonrae], [KOR], [2721],
[47], [WANG Eugene], [CAN], [2714],
[48], [ZHOU Yu], [CHN], [2712],
[49], [SKACHKOV Kirill], [RUS], [2711],
[50], [YOSHIMURA Maharu], [JPN], [2704],
[51], [KREANGA Kalinikos], [GRE], [2702],
[52], [KIM Hy<NAME>], [PRK], [2699],
[53], [<NAME>], [JPN], [2699],
[54], [<NAME>], [ESP], [2693],
[55], [SMIRNOV Alexey], [RUS], [2688],
[56], [<NAME>], [CHN], [2684],
[57], [<NAME>], [AUT], [2681],
[58], [<NAME>], [BRA], [2677],
[59], [<NAME>], [SWE], [2676],
[60], [YOSHIDA Kaii], [JPN], [2671],
[61], [JIANG Tianyi], [HKG], [2670],
[62], [PITCHFORD Liam], [ENG], [2658],
[63], [<NAME>], [FRA], [2655],
[64], [LUNDQVIST Jens], [SWE], [2654],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (65 - 96)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[65], [#text(gray, "<NAME>")], [KOR], [2648],
[66], [<NAME>], [HKG], [2646],
[67], [SVENSSON Robert], [SWE], [2643],
[68], [<NAME>], [BLR], [2639],
[69], [<NAME>], [CZE], [2638],
[70], [<NAME>], [AUT], [2637],
[71], [<NAME>], [KOR], [2636],
[72], [MONTEIRO Joao], [POR], [2633],
[73], [#text(gray, "<NAME>")], [PRK], [2631],
[74], [<NAME>], [AUT], [2629],
[75], [<NAME>], [IND], [2627],
[76], [<NAME>], [KOR], [2624],
[77], [WANG Yang], [SVK], [2622],
[78], [<NAME>], [FRA], [2621],
[79], [<NAME>], [KOR], [2618],
[80], [<NAME>], [POL], [2617],
[81], [<NAME>], [EGY], [2616],
[82], [TSUBOI Gustavo], [BRA], [2615],
[83], [<NAME>], [SGP], [2606],
[84], [<NAME>], [FRA], [2605],
[85], [GERELL Par], [SWE], [2604],
[86], [KIM Junghoon], [KOR], [2600],
[87], [<NAME>], [DOM], [2594],
[88], [JEOUNG Youngsik], [KOR], [2593],
[89], [MATSUDAIRA Kenji], [JPN], [2591],
[90], [<NAME>], [CHN], [2589],
[91], [<NAME>], [SGP], [2588],
[92], [<NAME>], [FRA], [2585],
[93], [<NAME>], [JPN], [2583],
[94], [<NAME>], [HUN], [2582],
[95], [<NAME>], [CHN], [2577],
[96], [<NAME>], [GER], [2574],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (97 - 128)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[97], [KARAKASEVIC Aleksandar], [SRB], [2572],
[98], [GROTH Jonathan], [DEN], [2571],
[99], [FRANZISKA Patrick], [GER], [2561],
[100], [PROKOPCOV Dmitrij], [CZE], [2561],
[101], [MADRID Marcos], [MEX], [2558],
[102], [KARLSSON Kristian], [SWE], [2553],
[103], [KORBEL Petr], [CZE], [2552],
[104], [<NAME>], [POL], [2550],
[105], [<NAME>], [CRO], [2549],
[106], [<NAME>], [IND], [2549],
[107], [<NAME>], [HUN], [2549],
[108], [<NAME>], [CRO], [2548],
[109], [<NAME>], [BRA], [2545],
[110], [<NAME>], [HKG], [2545],
[111], [BAI He], [SVK], [2545],
[112], [<NAME>], [TPE], [2544],
[113], [<NAME>], [SCO], [2543],
[114], [<NAME>], [JPN], [2539],
[115], [<NAME>], [RUS], [2537],
[116], [<NAME>], [POL], [2537],
[117], [<NAME>], [SRB], [2537],
[118], [<NAME>], [GER], [2534],
[119], [<NAME>], [JPN], [2533],
[120], [UEDA Jin], [JPN], [2532],
[121], [LI Ping], [QAT], [2531],
[122], [<NAME>], [KOR], [2530],
[123], [<NAME>], [IND], [2523],
[124], [<NAME>], [ESP], [2522],
[125], [<NAME>], [AUS], [2520],
[126], [<NAME>], [BIH], [2518],
[127], [<NAME>], [CZE], [2517],
[128], [#text(gray, "<NAME>")], [PRK], [2514],
)
) |
|
https://github.com/7sDream/fonts-and-layout-zhCN | https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/02-concepts/g2.typ | typst | Other | #import "/lib/draw.typ": *
#import "/template/theme.typ": theme
#import "mtop.typ": shape-points
#let start = (0, 0)
#let end = (1000, 680)
#let shape-c1 = (
((58, 318), (0, 0), (58, 550)),
((480, 650), (285, 650)),
((930, 320), (930, 628)),
)
#let shape-g2 = (
((58, 32), (0, 0), (58, 275)),
((480, 350), (285, 350), (565, 350)),
((950, 50), (950, 333)),
)
#let graph = with-unit((ux, uy) => {
// mesh(start, end, (100, 100), stroke: 1 * ux + gray)
let point-color = gray
let style = (
line: (
stroke: 7 * ux + point-color,
),
point: (
main: (
circle: (
radius: 10,
color: point-color,
),
rect: (
width: 20,
color: point-color,
)
),
ctrl: (
radius: 7,
color: point-color,
)
),
need-rect: false,
)
shape-points(style, ..shape-c1)
shape(..shape-c1, stroke: 8 * ux + theme.main)
shape-points(style, ..shape-g2)
shape(..shape-g2, stroke: 8 * ux + theme.main)
})
#canvas(end, start: start, width: 50%, graph)
|
https://github.com/duskmoon314/THU_AMA | https://raw.githubusercontent.com/duskmoon314/THU_AMA/main/ebook.typ | typst | Creative Commons Attribution 4.0 International | #import "@preview/book:0.2.5": *
#import "/templates/ebook.typ"
#show: ebook.project.with(title: "应用近世代数:笔记", spec: "book.typ")
// set a resolver for inclusion
#ebook.resolve-inclusion(it => include it)
|
https://github.com/gyarab/2023-4e-ruzicka-jako_pavouk | https://raw.githubusercontent.com/gyarab/2023-4e-ruzicka-jako_pavouk/main/src-docs/kapitoly/zaver.typ | typst | = Závěr
Výsledkem této práce je webová aplikace, která nejen splňuje stanovené požadavky, ale také přesahuje mé očekávání.
Naučil jsem se všechno okolo vývoje backendu. Od napojení na databázi až po ošetření nejrůznějších bezpečnostních skulinek. Také jsem se zorientoval v konfiguraci linuxových serverů na produkci. V tom mi cestu velmi usnadnil studentský vývojový server a jeho pohledný, smělý a velmi inteligentní admin. Díky tomu, že mi bylo svoleno k použití moderního jazyku Go, jsem si ho nejen mohl porovnat s jazyky, ve kterých jsem si již byl jistější, ale také mě přiblížil k více low level programování. S Vue jsem už sice zkušenosti měl, ale znalosti týkající se SEO určitě v budoucnu využiji.
Myslím, že ve vývoji aplikace budu dále pokračovat, jelikož mě baví vyvíjet něco, na co se může moje mamka podívat a být na mě pyšná, že už na počítači jen nehraji hry. |
|
https://github.com/nafkhanzam/typst-common | https://raw.githubusercontent.com/nafkhanzam/typst-common/main/src/templates/general.typ | typst | #import "@preview/valkyrie:0.2.1" as z
#import "@preview/codly:1.0.0"
#import "@preview/drafting:0.2.0": *
#import "../common/data.typ": *
#import "../common/style.typ": *
#import "../common/utils.typ": *
#let template(
title: [],
logo: "res/its-logo.png",
event: [],
author: [],
author-desc: [],
affiliation: [],
date-display: datetime.today().display("[day] [month repr:long] [year]"), // date
with-date: false,
footer-left: args => [#args.author -- #args.author-desc],
footer-right: context counter(page).display("1"),
bib: none,
infinite-height: false,
hl-todo: false,
theme: (
main: rgb("#0079C2"),
),
font-size: 10pt,
body,
) = {
// ~ Argument Validations
let z-content = z.either(z.string(), z.content())
title = z.parse(title, z-content)
logo = z.parse(logo, z.string(optional: true))
event = z.parse(event, z-content)
author = z.parse(author, z-content)
author-desc = z.parse(author-desc, z-content)
affiliation = z.parse(affiliation, z-content)
date-display = z.parse(date-display, z-content)
with-date = z.parse(with-date, z.boolean())
bib = z.parse(bib, z.content(optional: true))
let args = arguments((
title: title,
logo: logo,
event: event,
author: author,
author-desc: author-desc,
affiliation: affiliation,
date-display: date-display,
with-date: with-date,
bib: bib,
))
// ~ Setups
set text(font: "FreeSerif", size: font-size, fallback: false, hyphenate: false)
set page(
paper: "a4",
margin: (
x: 2cm,
y: 3cm,
),
header: context {
let page-counter = counter(page).get().at(0)
if page-counter > 1 [
#set text(.8em)
#title
#h(1fr)
#event
#line(length: 100%)
]
},
footer: [
#set text(.8em)
#line(length: 100%)
#call-or-value(footer-left, args)
#h(1fr)
#call-or-value(footer-right, args)
],
)
show: it => {
if infinite-height {
set page(height: auto)
it
} else {
it
}
}
set-page-properties()
set par(justify: true, linebreaks: "optimized")
set enum(indent: 1em)
set list(indent: 1em)
show table: set enum(indent: 0pt)
show table: set list(indent: 0pt)
show table: set par(justify: false)
show table: set align(left)
// show link: underline
// show link: text.with(fill: rgb(0, 0, 238))
// show par: set block(spacing: 2em)
set heading(numbering: "1.", supplement: "Section")
// show heading: it => block({
// if it.numbering != none {
// grid(
// columns: (32pt, 1fr),
// gutter: .25em,
// counter(heading).display(), it.body,
// )
// } else {
// it.body
// }
// })
show heading.where(level: 1): it => {
set text(fill: theme.main)
it
v(0.25em)
}
show heading.where(level: 2): it => {
it
v(0.25em)
}
show heading.where(level: 3): it => {
it
v(0.25em)
}
show figure.where(kind: "table"): set text(size: .8em)
show figure.caption: it => [
#set text(size: .9em)
#grid(
columns: 2,
gutter: .5em,
[
#set text(fill: theme.main, weight: "bold")
#it.supplement
#context it.counter.display(it.numbering).
],
it.body,
)
]
show raw: set block(above: .65em)
show: enable-todo-hl
show: codly.codly-init.with()
codly.codly(number-format: none)
//~ Title
[
#set par(spacing: .6em)
#grid(
columns: (1fr, 60%, 1fr),
if logo != none {
set align(left + top)
image(logo, height: 6em)
},
{
set align(center)
set par(justify: false)
text(size: 16pt, weight: "bold", title)
linebreak()
text(size: .9em, event)
linebreak()
set text(size: 1.0em)
author
linebreak()
author-desc
linebreak()
affiliation
},
if with-date {
set align(right + top)
set text(size: 1.0em)
date-display
},
)
#line(length: 100%)
]
// ~ Content
body
if bib != none {
set par(justify: false)
bib
}
}
#let toc(..args) = {
// show outline.entry: it => {
// [
// #it.body.children.at(0) #it.element.body #box(width: 1fr, it.fill) #it.page
// ]
// }
// show outline.entry: it => {
// [
// #box(width: auto, it.body.children.at(0)) #box(width: auto, it.element.body) #box(
// width: 1fr,
// it.fill,
// ) #box(
// width: auto,
// it.page,
// )
// ]
// }
// show outline.entry: it => link(it.element.location())[
// // #set box(clip: true, outset: (y: 0.5em), inset: (top: 0.125em))
// // #show: pad.with(left: .75em * (it.element.depth - 1))
// #grid(
// columns: 3,
// column-gutter: 4pt,
// row-gutter: 0em,
// inset: 0pt,
// gutter: 0pt,
// rows: 1,
// [
// #it.body.children.at(0)
// ],
// [
// #it.element.body #box(width: 1fr, it.fill)
// ],
// [
// #set align(bottom)
// #it.page
// ],
// )
// ]
// show outline.entry: it => repr(it)
// show outline.entry: it => it
show outline.entry.where(level: 1): strong
set outline(indent: true, title: [Table of Contents])
outline(..args)
}
#let fig-img-args = state(
"fig-img-args",
(
supplement: "Figure",
),
)
#let fig-img(
img,
caption: none,
lab: none,
..args,
) = (
context [
#figure(
img,
kind: "image",
caption: caption,
..fig-img-args.get(),
// placement: top,
..args,
) #if lab != none {
label(lab)
}
]
)
#let fig-tab-args = state(
"fig-tab-args",
(
supplement: "Table",
),
)
#let fig-tab(
tab,
caption: none,
lab: none,
..args,
) = (
context [
#figure(
tab,
kind: "table",
caption: figure.caption(position: top, caption),
..fig-tab-args.get(),
// placement: top,
..args,
) #if lab != none {
label(lab)
}
]
)
//~ Utilities
#let setup-indonesian(body) = [
#fig-img-args.update(v => {
v.at("supplement") = "Gambar"
v
})
#fig-tab-args.update(v => {
v.at("supplement") = "Tabel"
v
})
#body
]
|
|
https://github.com/crd2333/template-report | https://raw.githubusercontent.com/crd2333/template-report/master/figures.typ | typst | MIT License | #import "@preview/fletcher:0.5.1" as fletcher: diagram, node, edge
#import "@preview/tablem:0.1.0": tablem
#import "@preview/lovelace:0.3.0": pseudocode-list, pseudocode, line-label
#import "@preview/truthfy:0.4.0": truth-table, truth-table-empty
#import "@preview/codly:1.0.0": *
#import "@preview/timeliney:0.1.0": timeline as timeliney, headerline, group, taskgroup, task, milestone
// 简单取代 i-figured
#let process_figure_and_equation(unnumbered-label: "-", body) = {
show heading.where(level:1):it => { // reset counters when new chapter starts
counter(figure.where(kind: image)).update(0)
counter(figure.where(kind: table)).update(0)
counter(figure.where(kind: raw)).update(0)
counter(math.equation).update(0)
it
}
// show styles: `1-1` for image, code, table, and `(1-1)` for math
show figure.where(kind: image): set figure(numbering: _ => [#counter(heading.where(level: 1)).display("1")-#counter(figure.where(kind: image)).display("1")])
show figure.where(kind: table): set figure(numbering: _ => [#counter(heading.where(level: 1)).display("1")-#counter(figure.where(kind: table)).display("1")])
show figure.where(kind: raw): set figure(numbering: _ => [#counter(heading.where(level: 1)).display("1")-#counter(figure.where(kind: raw)).display("1")])
set math.equation(numbering: _ => [(#counter(heading.where(level: 1)).display("1")-#counter(math.equation).display("1"))])
show math.equation.where(block: true): it => {
if (it.has("label") and str(it.label) == unnumbered-label) {
counter(math.equation).update(i => i - 1)
math.equation(it.body) // unnumbered equation, and won't be counted, e.g. $ x + y $<->
} else {it}
}
body
}
// 插入图片
#let fig(caption: "", ..args) = figure(
image(..args),
caption: caption,
)
#let timeline(
caption: "",
..args,
body) = figure(
timeliney(..args, body),
caption: caption,
)
// 正则捕捉自动设置数学环境,对表格等使用
#let automath_rule = it => {
show regex("\d+(.\d+)*"): it => $it$
it
}
// 普通表,包含居中
#let tbl(caption: "", alignment: center + horizon, automath: false, ..args) = {
let fig = figure(
table(
align: alignment,
..args,
),
caption: caption,
)
if automath {
show table.cell: automath_rule
fig
} else {fig}
}
// 三线表,包含居中
#let tlt(caption: "", alignment: center + horizon, automath: false, ..args) = {
let fig = figure(
table(
stroke: none,
align: alignment,
table.hline(y: 0),
table.hline(y: 1),
..args,
table.hline(),
),
caption: caption,
)
if automath {
show table.cell: automath_rule
fig
} else {fig}
}
// 类 markdown 表格,使用 tablem 包实现
#let tblm(caption: "", automath: false, ..args) = {
let fig = figure(
tablem(
..args,
),
caption: caption,
)
if automath {
show table.cell: automath_rule
fig
} else {fig}
}
// csv 表格,使用 csv decode 处理转为表格
#let csvtable(caption: "", alignment: center + horizon, automath: false, raw) = {
let data = csv.decode(raw.text)
let fig = figure(
table(
columns: data.at(0).len(),
align: alignment,
..data.flatten()
),
caption: caption
)
if automath {
show table.cell: automath_rule
fig
} else {fig}
}
// 真值表,使用 truthfy 实现
#let truth-tbl(caption: "", ..args) = figure(
caption: caption,
truth-table(..args)
)
#let truth-tbl-empty(caption: "", ..args) = figure(
caption: caption,
truth-table-empty(..args)
)
// 算法框,使用 lovelace 实现
#let my-lovelace-defaults = (
line-numbering: "1",
booktabs: true,
// stroke: none,
hooks: 0.5em,
indentation: 1em,
booktabs-stroke: 2pt + black,
)
#let pseudocode-list = pseudocode-list.with(..my-lovelace-defaults)
#let algo(title: none, body) = {
figure(
kind: "algorithm",
supplement: [Algorithm],
pseudocode-list(
booktabs: true,
numbered-title: title + h(1fr),
body
)
)
}
#let comment(body) = {
h(1fr)
text(size: .85em, fill: gray, sym.triangle.stroked.r + sym.space + body)
}
#let no-number = [- #hide([])] // empty line and no number
// 代码块,使用 codly + i-figure 实现
#let code(caption: "", body) = figure(
// disable-codly()
body
,
caption: caption,
)
// icons for codly
#let codly_icon(codepoint) = {
box(
height: 1em,
baseline: 0.1em,
image(codepoint)
)
h(0.2em)
}
#let c_svg = codly_icon("assets/c.svg")
#let cpp_svg = codly_icon("assets/cpp.svg")
#let python_svg = codly_icon("assets/python.svg")
#let rust_svg = codly_icon("assets/rust.svg")
#let java_svg = codly_icon("assets/java.svg")
#let sql_svg = codly_icon("assets/sql.svg")
#let typst_svg = codly_icon("assets/typst.svg")
#let verilog_svg = codly_icon("assets/verilog.svg")
#let diagram(..args) = align(center, fletcher.diagram(
node-stroke: 1pt,
edge-stroke: 1pt,
mark-scale: 70%,
..args
))
#let edge(..args, marks: "-|>") = fletcher.edge(..args, marks: marks)
|
https://github.com/elteammate/typst-shell-escape | https://raw.githubusercontent.com/elteammate/typst-shell-escape/main/example-latex.typ | typst | #import "shell-escape.typ": *
#let url-to-latex(latex-source) = {
"https://latex.codecogs.com/svg.image?"
encode-url(latex-source)
}
#http-get(
url-to-latex(
```latex
\begin{align*}
\frac{\partial^2}{\partial t_1^2} f(t_0,t_1) =
( \delta+2t_0+2t_1)^{\alpha( w-t_0+t_1 )-1} \cdot \bigl(
\frac{\partial^2}{\partial t_1^2}\alpha(w-t_0+t_1) \cdot ( \delta+2t_0+2t_1) \cdot \log ( \delta+2t_0+2t_1) +\\
\alpha'(w-t_0+t_1) \cdot 2 \cdot \log ( \delta+2t_0+2t_1)+
\alpha'(w-t_0+t_1) \cdot ( \delta+2t_0+2t_1) \cdot \frac{2}{\delta+2t_0+2t_1}\bigl)
\end{align*}
```.text
),
method: image,
format: ".svg",
)
|
|
https://github.com/GYPpro/DS-Course-Report | https://raw.githubusercontent.com/GYPpro/DS-Course-Report/main/Rep/12.typ | typst | #import "@preview/tablex:0.0.6": tablex, hlinex, vlinex, colspanx, rowspanx
#import "@preview/codelst:2.0.1": sourcecode
// Display inline code in a small box
// that retains the correct baseline.
#set text(font:("Times New Roman","Source Han Serif SC"))
#show raw: set text(
font: ("consolas", "Source Han Serif SC")
)
#show raw.where(block: false): box.with(
fill: luma(230),
inset: (x: 3pt, y: 0pt),
outset: (y: 3pt),
radius: 2pt,
)
#set page(
paper: "a4",
)
#set text(
font:("Times New Roman","Source Han Serif SC"),
style:"normal",
weight: "regular",
size: 13pt,
)
#let nxtIdx(name) = box[ #counter(name).step()#counter(name).display()]
#set math.equation(numbering: "(1)")
#show raw.where(block: true): block.with(
fill: luma(240),
inset: 10pt,
radius: 4pt,
)
#set math.equation(numbering: "(1)")
#set page(
paper:"a4",
number-align: right,
margin: (x:2.54cm,y:4cm),
header: [
#set text(
size: 25pt,
font: "KaiTi",
)
#align(
bottom + center,
[ #strong[暨南大学本科实验报告专用纸(附页)] ]
)
#line(start: (0pt,-5pt),end:(453pt,-5pt))
]
)
/*----*/
= 字典树`Trie`
\
#text(
font:"KaiTi",
size: 15pt
)[
课程名称#underline[#text(" 数据结构 ")]成绩评定#underline[#text(" ")]\
实验项目名称#underline[#text(" ") 字典树`Trie` #text(" ")]指导老师#underline[#text(" 干晓聪 ")]\
实验项目编号#underline[#text(" 12 ")]实验项目类型#underline[#text(" 设计性 ")]实验地点#underline[#text(" 数学系机房 ")]\
学生姓名#underline[#text(" 郭彦培 ")]学号#underline[#text(" 2022101149 ")]\
学院#underline[#text(" 信息科学技术学院 ")]系#underline[#text(" 数学系 ")]专业#underline[#text(" 信息管理与信息系统 ")]\
实验时间#underline[#text(" 2024年6月13日上午 ")]#text("~")#underline[#text(" 2024年7月13日中午 ")]\
]
#set heading(
numbering: "1.1."
)
= 实验目的
实现一个字典树
= 实验环境
计算机:PC X64
操作系统:Windows + Ubuntu20.0LTS
编程语言:C++:GCC std20
IDE:Visual Studio Code
= 程序原理
基于一棵每层至多`26`分支的搜索树,实现在已有字典的基础上,查询字符串`s`在字典中是否出现。
规定每个节点$t$一一对应一个字母$c_t$,$t$的子节点列表$S_t$
则$exists t' in S_t arrow.l.r.double $在字典中有$c_t$的后缀为$c_(t')$
因此如果存在路径$t_0 arrow.r t_1 ... t_(|s|) s.t. forall i in [1,|s| ] $ 有 $t_i = s[i]$,则s在字典中出现过。
容易证明,查询复杂度为$OO(|s|)$,与字典大小无关。
对于字典规模$n$,建立时的时间复杂度为$OO(n)$,字典树空间复杂度为$OO(n log_26 n)$
#pagebreak()
= 程序代码
== `template_overAll.h`
#sourcecode[```cpp
#include <vector>
#include <map>
#include <string>
#include <string.h>
#include <math.h>
#include <set>
#include <algorithm>
#include <iostream>
#include <queue>
using namespace std;
#define ll long long
#define pb push_back
#define ld long double
const ll int maxn = 1E5+10;
const ll int mod1 = 998244353;
const ll int mod2 = 1E9+7;
#define _IN_TEMPLATE_
ll int str2int(string s)
{
ll int rec = 0;
ll int pw = 1;
for(int i = s.length()-1;i >= 0;i --)
{
int gt = s[i] - '0';
if(gt < 0 || gt > 9) return INT64_MAX;
rec += gt * pw;
pw *= 10;
}
return rec;
}
vector<ll int> testReadLine()
{
string s;
getline(cin,s);
s.push_back(' ');
vector<ll int> rearr;
vector<string> substring;
string ts;
for(int i = 0;i < s.size();i ++)
{
if(s[i] == ' '){
substring.push_back(ts);
ts.clear();
} else ts.push_back(s[i]);
}
for(int i = 0;i < substring.size();i ++)rearr.push_back(str2int(substring[i]));
return rearr;
}
```]
== `trie_Tree.h`
#sourcecode[```cpp
#include <template_overAll.h>
class Trie//AC
{
public:
vector<map<char, int>> t;
int root = 0;
Trie()
{
t.resize(1);
}
void addedge(string _s)
{
int pvidx = root;
_s.push_back('-');
for (int i = 0; i < _s.size(); i++)
{
if (t[pvidx].find(_s[i]) != t[pvidx].end())
{
pvidx = t[pvidx][_s[i]];
}
else
{
t[pvidx][_s[i]] = t.size();
t.push_back(map<char, int>());
pvidx = t[pvidx][_s[i]];
}
}
}
bool ifcmp(string &s)
{
int pvidx = root;
for(int i = 0;i < s.size();i ++)
{
if(t[pvidx].find(s[i]) != t[pvidx].end()) pvidx = t[pvidx][s[i]];
else return 0;
}
return t[pvidx].find('-') != t[pvidx].end();
}
};
```]
= 测试数据与运行结果
代码通过在线平台`luogu.org`正确性测试
#image("12.png") |
|
https://github.com/NMD03/CV | https://raw.githubusercontent.com/NMD03/CV/main/README.md | markdown | # CV
This is a template for a CV. It is written in typst. |
|
https://github.com/tingerrr/hydra | https://raw.githubusercontent.com/tingerrr/hydra/main/examples/main.typ | typst | MIT License | #page(
width: auto,
height: auto,
margin: 0pt,
block(
fill: gray,
inset: 1em,
radius: 1em,
grid(
columns: 4,
gutter: 1em,
..range(1, 5).map(i => image("pages/" + str(i) + ".png"))
),
),
)
|
https://github.com/7sDream/fonts-and-layout-zhCN | https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/07-localisation/practice.typ | typst | Other | #import "/template/template.typ": web-page-template
#import "/template/components.typ": note
#import "/lib/glossary.typ": tr
#show: web-page-template
// ## Features in Practice
== 特性实践
// Up to this point, I have very confidently told you which features you need to use to achieve certain goals - for example, I said things like "We'll put a contextual rule in the `akhn` feature to make the Kssa conjunct." But when it comes to creating your own fonts, you're going to have to make decisions yourself about where to place your rules and lookups and what features you need to implement. Obviously a good guideline is to look around and copy what other people have done; the growing number of libre fonts on GitHub make it a very helpful source of examples for those learning to program fonts.
此前,每次我都会非常直接的告诉你需要用哪些特性来完成设计目标。比如我会说,我们可以在`akhn`特性中添加#tr[contextual]规则来构建不可分的`kssa`合体#tr[glyph]。但当实际制作字体时,你需要自己决定把规则和#tr[lookup]放在哪个特性里。当然,看看别人是怎么做的并复制过来也是不错的参考。现在GitHub上有越来越多的自由字体,它们对于学习字体程序设计来说是非常有帮助的示例资源。
// But while copying others is a good way to get started, it's also helpful to reason for oneself about what your font ought to do. There are two parts to being able to do this. The first is a general understanding of the OpenType Layout process and how the shaper operates, and by now you should have some awareness of this. The second is a careful look at the [feature tags list](https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags) of the OpenType specification to see if any of them seem to fit what we're doing.
虽然复制别人的代码是入门的好方法,但亲自思考字体应该怎样实现某一功能也很有帮助。这可以分成两步来进行。首先要对OpenType的#tr[layout]流程有基本的理解,这方面你应该已经有些认识了。第二是仔细阅读OpenType规范中的特性列表@Microsoft.OpenTypeRegistered,分析其中哪些比较适合当前想完成的目标。
#note[
// > Don't get *too* stressed out about choosing the right feature for your rules. If you put the rule in a strange feature but your font behaves in the way that you want it to, that's good enough; there is no OpenType Police who will tell you off for violating the specification. Heck, you can put substitution rules in the `kern` feature if you like, and people might look at you funny but it'll probably work fine. The only time this gets critical is when we are talking about
对于选择正确的特性这件事压力不用太大。如果你最后把规则放到了一个不常用的特性里,但字体的显示行为符合你的预期,那这样就挺好。不会有OpenType警察出来说你违反了规范之类的。你可以把#tr[substitution]规则放到`kern`特性里,但除了人们会觉得有些幽默之外,它应该也能正常工作。只有在下面两种情况下,对于特性的选择才会特别关键:
#set enum(numbering: "a)")
// (a) features which are selected by the user interface of the application doing the layout (for example, the `smcp` feature is usually turned on when the user asks for small caps, and it would be bizarre - and arguably *wrong* - if this also turned on additional ligatures)
+ 特性是由排版软件的UI来决定是否开启的。比如`smcp`特性是当用户要求小型大写字母时启用的。如果你在这个特性中还添加了#tr[ligature]功能的话,用户就会觉得非常奇怪了,甚至说可以说是*错误的*。
// and (b) more complex fonts with a large number of rules which need to be processed in a specific order. Getting things in the right place in the processing chain will increase the chances of your font behaving in the way you expect it to, and, more importantly, will reduce the chances of features interacting with each other in unexpected ways.
+ 当你的字体特别复杂,有大量的需要按特定顺序处理的特性。让操作都在处理过程中的正确时机发生能够增加字体按预想方式工作的几率。更重要的是,这也会减少特性以预期外的方式互相影响的几率。
]
// Let's suppose we are implementing a font for the Takri script of north-west India. There's no Script Development Standard for Takri, so we're on our own. We've designed our glyphs, but we've found a problem. When a consonant has an i-matra and an anusvara, we'd like to move the anusvara closer to the matra. So instead of:
假设我们正在为印度东北部的塔克里文设计字体。当前这种#tr[script]并没有开发规范可以参考,所以我们只能自力更生了。假设我们已经设计好了基本的#tr[glyph],但发现有一个问题:当辅音上有`i-matra`和`anusvara`时,我们希望`anusvara`能和`matra`离得近一点。参考@figure:takri-problem。
// We've designed a new glyph `iMatra_anusvara` which contains both the matra and the correctly-positioned anusvara, and we've written a chained contextual substitution rule:
我们为此设计了一个新#tr[glyph]`iMatra_anusvara`,它包含`matra`和重新放置在了正确位置的`anusvara`。同时还编写了一个#tr[chaining]#tr[contextual]#tr[substitution]规则:
#figure(
caption: [塔克里文字体中需要解决的一个问题]
)[#include "takri.typ"] <figure:takri-problem>
```fea
lookup iMatraAnusVara {
sub iMatra by iMatra_anusvara;
sub anusvara by emptyGlyph;
}
sub iMatra' lookup iMatraAnusVara @consonant' anusvara' lookup iMatraAnusVara;
```
// This replaces the matra with our matra-plus-anusvara form, and replaces the old anusvara with an empty glyph. Nice. But what feature does it belong in?
这段代码会将`matra`替换为我们新设计的`matra+anusvara`,然后将原本的`anusvara`替换为空#tr[glyph]。这看上去应该可以完成我们的目标。不过,这些代码应该写在哪个特性中呢?
// First, we decide what broad category this rule should belong to. Are we rewriting the mapping between characters and glyphs? Not really. So this doesn't go in the initial "pre-shaping" feature collection. It's something that should go towards the end of the processing chain. But it's also a substitution rule rather than a positioning rule, so it should go in the substitution part of the processing chain. It's somewhere in the middle.
首先我们先确定这些规则所处的大分类。这是在重写#tr[character]和#tr[glyph]的映射关系吗?应该不是。所以它就不属于#tr[shaping]前特性。这是一个应该放在处理流程末尾的工作吗?不,这是一个#tr[substitution]而不是#tr[positioning]操作,所以不该在最后。那么看上去它应该处于流程中间。
// Second, we ask ourselves if this is something that we want the user to control or something we want to require. We'd rather it was something that was on by default. So we look through the collection of features that shapers execute by default, and go through their descriptions in the [feature tags](https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags) part of the OpenType spec.
第二步,问问自己我们希不希望用户能够控制这个操作,还是说这是一个必须的操作?答案是我们希望默认就是这个效果。那么现在就看看#tr[shaper]默认启用的那些特性吧。这可以在OpenType规范的特性列表#[@Microsoft.OpenTypeRegistered]中对每个特性的描述里找到。
// For example, we could make it a required ligature, but we're not exactly "replacing a sequence of glyphs with a single glyph which is preferred for typographic purposes." `dist` might be an option, but that's usually executed at the positioning stage. What about `abvs`, which "substitutes a ligature for a base glyph and mark that's above it"? This feature should be on by default, and is required for Indic scripts; it's normally executed near the start of the substitution phase, after those features which rewrite the input stream. This sounds like it will do the job, so we'll put it there.
我们可以把它放在必要#tr[ligature](`rlig`)里,但这段代码好像并不完全符合“将一系列#tr[glyph]替换为它们在#tr[typography]意义上更加合适的单个#tr[glyph]”这个描述。`dist`特性看上去也是个选择,但它通常在#tr[positioning]阶段处理。`abvs`如何呢?它的描述是“将基本字符和其上的符号替换为它们的#tr[ligature]形式”、“它是默认启用的”、“对印度系#tr[scripts]来说是必要的”、“它通常在#tr[substitution]阶段的初期,所有改写输入流的特性执行完后被应用”。这听上去挺符合我们想做的事情的,我们就把代码放在`abvs`特性里吧。
// Once again, this is not an exact science, and unless you are building up extremely complex fonts, it isn't going to cause you too many problems. So try to reason about what your features are doing, but feel free to copy others, and don't worry too much about it.
再次提醒,这里并没有科学标准。而且,除非你是在创建超级复杂的字体,否则放在什么特性中并不会带来什么问题。所以,尽量尝试自己做出合理的选择,但也不要太过拘谨,去复制别人的也没问题。
// Now let's look at how to implement some specific features, starting with a few simple ones to get us started, and then getting to the more tricky stuff later.
现在我们去看看如何实现某些具体功能。先从简单的开始,然后再慢慢接触更刁钻的部分。
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/meta/figure_04.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Test custom separator for figure caption
#set figure.caption(separator: [ --- ])
#figure(
table(columns: 2)[a][b],
caption: [The table with custom separator.],
)
|
https://github.com/Treeniks/bachelor-thesis-isabelle-vscode | https://raw.githubusercontent.com/Treeniks/bachelor-thesis-isabelle-vscode/master/chapters/05-main-enhancements/isabelle-system-options.typ | typst | #import "/utils/todo.typ": TODO
#import "/utils/isabelle.typ": *
#import "@preview/fletcher:0.5.1" as fletcher: diagram, node, edge
== Isabelle System Options as VSCode Settings
Isabelle has many options that can be set to adjust different aspects of the interactive sessions. For example, the option `editor_output_state` defines whether the current state should additionally be printed within the output panel.
The options, including their default values, are generally defined within `etc/options` files scattered throughout the codebase. Users can overwrite these options by adding respective entries into a `$ISABELLE_HOME_USER/etc/preferences` file. When using #jedit, the user will also find many of these options within #jedit's settings, as seen in @jedit-settings. These settings and the content of the `preferences` file are kept in sync @manual-jedit.
#figure(
image("/resources/jedit-settings.png", width: 80%),
kind: image,
caption: [Isabelle options inside of #jedit.],
placement: auto,
) <jedit-settings>
The Isabelle language server offers one additional way of overwriting Isabelle system options: Via CLI arguments. When starting the Isabelle language server with `isabelle vscode_server`, one may add additional option overwrites with `-o NAME=VAL` arguments. The order of priority for Isabelle options for the language server is then as follows:
1. CLI arguments.
2. User preferences defined in the `preferences` file.
3. Isabelle defaults.
The same is true for #vscode. When starting #vscode with `isabelle vscode`, the user can add option overwrites as CLI arguments. However, previously, there was no method to set Isabelle options through #vscode's UI. We wanted to alleviate this discrepancy between #vscode and #jedit by adding relevant options to #vscode to its settings.
Ideally, the settings in #vscode would be kept in sync with the user's `preferences` file, as #jedit does. However, to do so, we would need to be able to parse and understand the `preferences` file from within the VSCode extension, yet this file is supposed to be managed exclusively by #scala. Therefore, we instead chose to use the #vscode settings as pure overwrites.
=== Passing Options from VSCode to the Language Server
#vscode itself has no use for Isabelle system options. These options are used by Isabelle internally, not by the code editor. That means that only the language server needs to know the options set by the user.
When using #vscode, the user does not manually start the language server. Instead, they run `isabelle vscode`, which starts an instance of Isabelle's patched VSCodium with an Isabelle extension installed, which starts the language server once the user opens an Isabelle theory.
The `isabelle vscode` command optionally takes option overwrites as CLI arguments and converts these into an environment variable called "`ISABELLE_VSCODIUM_ARGS`", such that the extension can read this environment variable later. On top of that, the extension used to add a few hard-coded options that are needed for #vscode to function properly. This set of options is finally given to the language server as CLI arguments. @vscode-options-flow-previous shows this process.
#figure(
diagram(
edge-stroke: 1pt,
edge((-1, -1.5), (-1, -0.7), "-}>", [CLI arguments], label-side: left),
node((-1, -0.7), [Isabelle System], height: 40pt, stroke: 1pt),
edge((-1, -0.7), (-1, 0)),
node((-1, 0), [`ISABELLE_VSCODIUM_ARGS`]),
edge((-1, 0), (0, 0), "-}>"),
node((0, 0), [VSCodium\ Extension], height: 40pt, stroke: 1pt),
edge((0, 0), (2, 0), "-}>", align(center, [CLI\ arguments]), label-anchor: "center", label-sep: 0pt),
node((2, 0), [Language Server], height: 40pt, stroke: 1pt),
),
kind: image,
caption: [Previous passing of option overwrites.],
) <vscode-options-flow-previous>
The language server gets its option values by first taking the Isabelle default, overwriting those with whatever the user specified in their `preferences` file, and overwriting those again with whatever was given as CLI arguments.
In order to additionally consider VSCode settings, we must add them from within the extension, as we do not have access to the VSCode settings from within the language server nor the original Isabelle process that starts VSCodium. Therefore, the only part we can actively influence with VSCode settings is the CLI arguments sent to the server by the extension. Here, we must decide whether the user's CLI arguments or VSCode settings take precedence. This limits the possible order of priority to two different possibilities, seen in @priority-order-options.
#figure(
table(
columns: 2,
align: left,
stroke: (x, y) => (
left: if x > 0 { .5pt } else { 0pt },
right: 0pt,
top: if y > 0 { .5pt } else { 0pt },
bottom: 0pt,
),
table.header([*Option 1*], [*Option 2*]),
enum(indent: 0pt, [CLI], [VSCode Settings], [Preferences], [Defaults]),
enum(indent: 0pt, [VSCode Settings], [CLI], [Preferences], [Defaults]),
),
caption: [Different possibilities for Isabelle system option priority order.],
kind: table,
) <priority-order-options>
Of these, we chose to proceed with option 1, as CLI option overwrites are more explicit than the user's VSCode settings and should be prioritized.
#figure(
diagram(
edge-stroke: 1pt,
edge((-1, -1.65), (-1, -0.85), "-}>", [CLI arguments], label-side: left),
node((-1, -0.85), [Isabelle System], height: 40pt, stroke: 1pt),
edge((-1, -0.85), (-1, -0.15)),
node((-1, -0.15), [`ISABELLE_VSCODIUM_ARGS`]),
edge((-1, -0.15), (0, -0.15), "-}>"),
node((-1, 0.15), [VSCode settings]),
edge((-1, 0.15), "r", "-}>"),
node((0, 0), [VSCodium\ Extension], height: 40pt, stroke: 1pt),
edge((0, 0), (2, 0), "-}>", align(center, [CLI\ arguments]), label-anchor: "center", label-sep: 0pt),
node((2, 0), [Language Server], height: 40pt, stroke: 1pt),
),
kind: image,
caption: [Passing of option overwrites with VSCode settings.],
placement: auto,
) <vscode-options-flow-after>
@vscode-options-flow-after shows the new flow of Isabelle options when starting #vscode. The VSCode Isabelle extension has access to both the CLI arguments given to the `isabelle vscode` command, and whatever settings are set in VSCode.
These two get merged, prioritizing the options within the `ISABELLE_VSCODIUM_ARGS` variable, and this merged set of option overwrites gets passed to the language server.
=== Option Types
// I realized after submission that I actually changed the settings from "on" and "off" to "true" and "false"...oof
Isabelle system options all have a type: `string`, `int`, `real`, or `bool`. Using the same type for the VSCode extension's settings might be tempting. However, since we ultimately want the user to be able to _overwrite_ these options, this is not optimal. Taking the `editor_output_state` as an example, which is of type `bool`, the respective VSCode setting would be of type `boolean`. In the UI, this would make it a checkbox, giving it two states. However, we actually need three states: Do not overwrite, `off` and `on`. If the type of the VSCode setting were `boolean` with a default value of `off`, there would be no difference between the user not wanting VSCode to overwrite their user preferences and wanting to overwrite it with `off`.
Instead, we made all #vscode settings of type `string`. For Isabelle options of type `bool`, the respective VSCode setting will have possible values `""`, `"off"`, and `"on"`, meaning don't-overwrite, overwrite with `off`, and overwrite with `on`, respectively. For Isabelle options of any other type, the empty string `""` means do not overwrite, and any other value is the value the option should be overwritten with.
This system has another advantage for numerical options: The types of VSCode settings are just JavaScript types. Isabelle differentiates between `real` and `int` options, but JavaScript only has a singular `numeric` type. If the VSCode option were to take such `numeric` values, the extension would need to convert this value to a string to pass it to the language server as a CLI argument. By keeping it a string from the start, we skip potential conversion errors that may occur otherwise.
=== Extending #vscode's Settings
Many Isabelle options are annotated with a tag, thus creating groupings of similar options. For example, the `content` tag includes options such as `names_long`, `names_short`, and `names_unique`, which affect how names (like function names) are printed within output and state panels.
Many of the options Isabelle exposes are not relevant for #vscode. For example, one of the option tags available is the `jedit` tag, which, as the name suggests, includes options relevant specifically to #jedit.
The first options we deemed relevant are those specifically designed for #vscode and the language server. These options are defined within #box[`src/Tools/VSCode/etc/options`]. We added and assigned a new `vscode` option tag to these options to allow easy access.
The second set of relevant options are options tagged with the aforementioned `content` tag.
The third set are manually chosen options helpful for #vscode but not included in the previous two tags. The list of options we chose is:
#columns(2)[
- `editor_output_state`
- `auto_time_start`
- `auto_time_limit`
- `auto_nitpick`
- `auto_sledgehammer`
#colbreak()
- `auto_methods`
- `auto_quickcheck`
- `auto_solve_direct`
- `sledgehammer_provers`
- `sledgehammer_timeout`
]
To add custom settings to VSCode with a VSCode extension, one can add a `contributes.configuration` entry into the extensions `package.json` file @extension-api. Since the options available in the given tags may change in the future, simply adding them manually to the `package.json` file was unsatisfactory. Instead, the options are dynamically added while building the extension with `isabelle component_vscode_extension`. To do so, the `package.json` file includes a #box[`"ISABELLE_OPTIONS": {},`] marker, which is replaced with the appropriate JSON format of the given options by the Isabelle system during build.
Additionally, we gave the options that were previously hard-coded into the extension a respective default value during this build process instead. That way, the user can change these settings if they want, which was not possible before.
|
|
https://github.com/cwreed/cv | https://raw.githubusercontent.com/cwreed/cv/main/src/modules/research.typ | typst | #import "../template.typ": cvEntry
#let mcdermid-lab-resume = cvEntry(
title: [Graduate Research Assistant, McDermid Lab],
institution: [New York University, Department of Environmental Studies],
date: [July 2020 -- September 2022],
location: [New York, NY],
description: list(
[Developed end-to-end deep learning pipeline to detect floods and smallholder croplands in Sentinel-1 and Sentinel-2 satellite image time series over sub-Saharan Africa],
[Conducted geospatial time series analysis using econometric modeling techniques to assess the impact of floods on food security in sub-Saharan Africa from 2009-2020 @reed2022],
),
)
#let bradford-lab-resume = cvEntry(
title: [Research Assistant, The Bradford Lab],
institution: [Yale School of the Environment],
date: [January 2016 -- August 2020],
location: [New Haven, CT],
description: list(
[Assisted with field and laboratory data collection for experiments studying the
ecological function, formation, and rapid measurement of soil organic carbon],
[Conducted meta-analysis (data collection, statistical analysis) of long-term experiments to quantify the mediating
effect of soil organic carbon on the relationship between conservation
agriculture practices and crop yield stability],
),
) |
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-1700.typ | typst | Apache License 2.0 | #let data = (
("TAGALOG LETTER A", "Lo", 0),
("TAGALOG LETTER I", "Lo", 0),
("TAGALOG LETTER U", "Lo", 0),
("TAGALOG LETTER KA", "Lo", 0),
("TAGALOG LETTER GA", "Lo", 0),
("TAGALOG LETTER NGA", "Lo", 0),
("TAGALOG LETTER TA", "Lo", 0),
("TAGALOG LETTER DA", "Lo", 0),
("TAGALOG LETTER NA", "Lo", 0),
("TAGALOG LETTER PA", "Lo", 0),
("TAGALOG LETTER BA", "Lo", 0),
("TAGALOG LETTER MA", "Lo", 0),
("TAGALOG LETTER YA", "Lo", 0),
("TAGALOG LETTER RA", "Lo", 0),
("TAGALOG LETTER LA", "Lo", 0),
("TAGALOG LETTER WA", "Lo", 0),
("TAGALOG LETTER SA", "Lo", 0),
("TAGALOG LETTER HA", "Lo", 0),
("TAGALOG VOWEL SIGN I", "Mn", 0),
("TAGALOG VOWEL SIGN U", "Mn", 0),
("TAGALOG SIGN VIRAMA", "Mn", 9),
("TAGALOG SIGN PAMUDPOD", "Mc", 9),
(),
(),
(),
(),
(),
(),
(),
(),
(),
("TAGALOG LETTER ARCHAIC RA", "Lo", 0),
)
|
https://github.com/ShapeLayer/ucpc-solutions__typst | https://raw.githubusercontent.com/ShapeLayer/ucpc-solutions__typst/main/docs/README.md | markdown | Other | # ucpc-solutions Documentation
ucpc-solutions is not rich in default style definitions. This is because the style definitions in the original LaTeX version of ucpc-solutions were like that, and many contest organizers interpreted and modified the overall style definitions of the template to create their own uniquely styled documents.
This ucpc-solutions also respects that meta, specifying a minimum of basic style definitions and providing various customizable document creation utilities.
So, unlike other typst templates that create a document, you still need to use a utility function that provides styling.
For example, if you create a cover page from a general template as follows:
```typst
#import "<template.typ>": *
#show: <template>.with()
= Document Title
```
ucpc-solutions requires calling a somewhat complex function.
```typst
#import "@preview/ucpc-solutions:0.1.0" as ucpc
#ucpc.utils.make-hero(
title: [Document Title]
)
```
One advantage of this approach is that if you don't like the creation utility provided by ucpc-solutions, you can define your own styles and use them.
```typst
#show ucpc.ucpc.with(
title: "2024 GIST Algorithm Masters",
hero: [
// Title Page
#set page(margin: 0%)
#rect(fill: secondary_color, width: 100%, height: 70%, outset: 0%)[
#align(horizon)[
#rect(fill: none, stroke: none, inset: (left: 5em), outset: 0%)[
#text(fill: rgb("#fff"), size: 32pt)[= #text(fill: rgb("#ff3e29"))[G]IST \ ALGORITHM \ MASTERS]
#text(fill: rgb("#fff"), size: 20pt)[2024 Contest\
Official Solutions Editorial]
]
]
]
#align(center + horizon)[
#text(fill: secondary_color)[
#text(size: 2em)[GIST Algorithm Masters TF]
\
]
]
],
)
```
## Definitions
- [ucpc.ucpc](#)
- [ucpc.colors](./colors.md)
- [ucpc.i18n](./i18n.md)
- [ucpc.presets](./presets.md)
- [ucpc.utils](./utils.md)
|
https://github.com/OctarineSourcerer/NeonInTheDark | https://raw.githubusercontent.com/OctarineSourcerer/NeonInTheDark/main/crews/boostergang.typ | typst | #import "../templates/crewTemplate.typ": crew, specialAbility
#crew(
[Boostergang],
[MERCENARIES AND THUGS],
[Some crews plot, some crews scheme, some crews sneak around in the darkness. It makes sense, Neo-Duskvol is a dangerous place. However, to hell with that. You fight. Violence and any monetisations of it are your game. You carry out destructive heists, extortion, hit jobs, anything where hardware is worth its weight in platinum.],
[
When you play a Boostergang, you earn XP when you execute a successful battle, extortion, smash & grab, or sabotage jobs
],
[Are you brutal thugs, savvy mercs, or ruthless gangsters?],
[
/ Training: Prowess
/ Cohort: Gang (Thugs)
],
[
/ Hugo: A ripperdoc
/ Pascal: A police detective
/ Yu: A bar owner
/ <NAME>: A corpo
/ Zed: A cyberware dealer
/ Gunkin' Ste: A mechanic
],
[
/ Battle: Defeat an enemy
/ Extortion: Threaten violence unless you're paid
/ Smash & Grab: Fast and violent armed robbery
/ Sabotage: Hurt an opponent by destroying something
],
[
/ Boostergang Rigging: You get 2 free load worth of weapon or armor items. _For example, you could carry a sword & pistol, or wear armor for 0 load._
/ Prison Contacts: Your tier is effectively +1 higher in prison. _This counts for any Tier-related element in prison, including the incarceration roll._
/ Elite Movers: All of your cohorts with the Movers type get +1d to quality rolls for Rover-related actions.
/ Elite Thugs: All of your cohorts with the Thugs type get +1d to quality rolls for Thug-related actions.
/ Hardened: Each PC gets +1 trauma box. This costs three upgrades to unlock, not just one. _This may bring a PC with 4 trauma back into play if you wish._
],
[
/ Barracks: Your Thug cohorts get +1 scale. Extra room means more gang members.
/ Fighting Pits: During downtime, roll dice equal to your Tier. You earn credit equal to the highest result, minus your heat. The locals love to gamble away their hard-earned cash on the bloodsports you host
/ Infirmary: You get +1d to healing treatment rolls. The infirmary also has beds for long-term convalescence.
/ Informants: You get +1d to gather information for a Run. Your eyes and ears on the streets are always on the lookout for new targets.
/ Police Confederates: You get +1d to the engagement roll for assault plans. The street patrol around here helps you out now.
/ Police Intimidation: You get -2 heat per Run. The law doesn't want any trouble from you; they look the other way.
/ Protection Racket: Any time during downtime, roll dice equal to your Tier. You earn credit equal to the highest result, minus your heat. Some of the locals are terrified of you and will gladly pay for “protection.”
/ Street Fence: You get +2 credit in your payoff for Runs that involve lower-class targets. An expert can find the treasure amid the trash you loot from your poorer victims.
/ Terrorized Citizens: You get +2 credit in your payoff for Runs that involve battle or extortion. The frightened locals offer you tribute whenever you lash out. They don't want to be next.
/ Warehouses: You get +1d to acquire asset rolls. You have space to hold all the various spoils you end up with after your battles. It can be useful on its own or for barter when you need it.
],
// These get given special treatment as there are THREE aspects to each special ability.
[
#specialAbility("Dangerous",
[
Each PC may add +1 action rating to Trace, Scrap, or Scramble (up to a max rating of 3).
],
clarification: [
Each player may choose the action they prefer (you don't all have to choose the same one). If you take this ability during initial character and crew creation, it supersedes the normal starting limit for action ratings.
])
#specialAbility("Blood Brothers",
[
When you fight alongside your cohorts in combat, they get +1d for teamwork rolls (setup and group actions). All of your cohorts get the Thugs type for free (if they're already Thugs, add another type).
],
clarification: [
If you have the Elite Thugs upgrade, it stacks with this ability. So, if you had an Adepts gang cohort, and the Elite Thugs upgrade, and then took Blood Brothers, your Adepts would add the Thugs type and also get +1d to rolls when they did Thug-type actions. This ability may result in a gang with three types, surpassing the normal limit of two.
])
#specialAbility("Door Kickers",
[
When you execute an assault plan, take +1d to the engagement roll.
],
clarification: [
This ability applies when the goal is to attack an enemy. It doesn't apply to other operations you attempt that happen to involve fighting.
])
#specialAbility("Fiends",
[
Fear is as good as respect. You may count each wanted level as if it were turf.
],
clarification: [
The maximum wanted level is 4. Regardless of how much turf you hold (from this ability or otherwise) the minimum rep cost to advance your Tier is always 6.
])
#specialAbility("Forged in the Fire",
[
Each PC has been toughened by cruel experience. You get +1d to resistance rolls.
],
clarification: [
This ability applies to PCs in the crew. It doesn't confer any special toughness to your cohorts.
])
#specialAbility("Patron",
[
When you advance your Tier, it costs half the credit it normally would.
],
clarification: [
Who is your patron? Why do they help you?
])
#specialAbility("War Dogs",
[
When you're at war (-3 faction status), your crew does not suffer -1 hold and PCs still get two downtime activities, instead of just one.
])
]
) |
|
https://github.com/Jollywatt/typst-fletcher | https://raw.githubusercontent.com/Jollywatt/typst-fletcher/master/tests/coords/test.typ | typst | MIT License | #set page(width: auto, height: auto, margin: 1em)
#import "/src/exports.typ" as fletcher: diagram, node, edge
#import "/src/diagram.typ": compute-cell-centers, interpret-axes
#import "/src/utils.typ": vector-2d, interp, interp-inv
#import "/src/coords.typ": *
// this test contains no visual output
#show: none
= Test `interp()` and `interp-inv()` are inverses
#let values = (1pt, 2pt, 4pt)
#let indices = (-1, 0, 0.5, 1, 1.75, 3, 4)
#for i in indices {
let value = interp(values, i, spacing: 10pt)
let i2 = interp-inv(values, value, spacing: 10pt)
assert(i == i2)
}
#for v in values {
let index = interp-inv(values, v , spacing: 10pt)
let v2 = interp(values, index, spacing: 10pt)
assert(v == v2)
}
= Test `uv-to-xy()` and `xy-to-uv()` are inverses
#for grid in (
(
origin: (0, 0),
axes: (ltr, ttb),
),
(
origin: (1, -1),
axes: (ttb, rtl),
),
) {
let grid = grid + (
cell-sizes: (
(36pt, 72pt, 24pt),
(12pt, 48pt)
),
spacing: (12pt, 48pt),
)
grid += fletcher.interpret-axes(grid.axes)
grid += fletcher.compute-cell-centers(grid)
for uv in ((0,0), (1,2), (-5.5, 0.75), (3,1.125)) {
let xy = uv-to-xy(grid, uv)
assert(uv == xy-to-uv(grid, xy))
assert(xy == uv-to-xy(grid, uv))
}
}
#let assert-resolve(ctx, lhs, rhs) = {
lhs = vector-2d(resolve(ctx, lhs).at(1))
rhs = vector-2d(resolve(ctx, rhs).at(1))
assert(lhs == rhs, message: repr((lhs, rhs)))
}
= Resolving $u v$ coordinates independently of grid
#let ctx = default-ctx + (
target-system: "uv",
nodes: (
"a": (anchors: _ => (100, 100)),
"b": (anchors: _ => (20, 50)),
"o": (anchors: _ => (0, 0)),
)
)
#assert-resolve(ctx, (rel: (2, 3), to: (10, 10)), (12, 13))
#assert-resolve(ctx, (rel: (v: 3, u: 4), to: "a"), (104, 103))
#assert-resolve(ctx, (bary: (a: 1, b: 3)), ("a", 75%, "b"))
#assert(is-nan-vector(resolve(ctx, (45deg, 1cm)).at(1)))
== Polar coordinates
#assert-resolve(ctx, (90deg, 1), (calc.cos(90deg), 1))
= Resolving $x y$ coordinates
#let grid = {
let g = (
origin: (0, 0),
axes: (ltr, btt),
cell-sizes: (
(36pt, 72pt, 24pt),
(12pt, 48pt)
),
spacing: (12pt, 48pt),
)
g += interpret-axes(g.axes)
g += compute-cell-centers(g)
g
}
#assert(grid.centers == ((18pt, 84pt, 144pt), (6pt, 84pt)))
#let ctx = default-ctx + (
target-system: "xyz",
grid: grid,
nodes: (
"a": (anchors: a => (100, 100)),
"b": (anchors: a => (20, 50)),
"o": (anchors: a => (0, 0)),
)
)
#assert-resolve(ctx, (0, 0), (18pt, 6pt))
#assert-resolve(ctx, (0, 1), (18pt, 84pt))
#assert-resolve(ctx, (rel: (1, 0), to: (0, 2)), (1, 2))
#assert-resolve(ctx,
(rel: (1pt, 1pt), to: (1, 2)),
(rel: (45deg, calc.sqrt(2)*1pt), to: (1, 2)),
)
#assert(
resolve(ctx, (-1, 0), (rel: (1, 0))).slice(1) ==
resolve(ctx, (-1, 0), (0, 0)).slice(1)
)
= Going from $x y$ coordinates to $u v$
#let ctx = ctx + (target-system: "uv")
#assert-resolve(ctx, (18pt, 6pt), (0, 0))
#assert-resolve(ctx, (18pt, 84pt), (0, 1))
= Testing grid-dependence of coordinates
If a grid isn't provided, $x y$-derived coordinates should resolve to #NAN_COORD.
#let ctx = default-ctx + (
target-system: "xyz",
)
#assert(is-nan-vector(resolve(ctx, (1, 2)).at(1)))
#assert(not is-nan-vector(resolve(ctx, (1pt, 2pt)).at(1)))
#assert(
resolve(ctx, (1pt, 2pt), (rel: (0deg, 1pt))).slice(1) ==
resolve(ctx, (1pt, 2pt), (2pt, 2pt)).slice(1)
)
#assert(is-nan-vector(resolve(ctx, (rel: (45deg, 2), to: (1pt, 2pt))).at(1)))
#assert(resolve(ctx, (1, 2), (rel: (45deg, 2pt))).slice(1).all(is-nan-vector))
#assert(is-grid-independent-uv-coordinate((1,2)))
#assert(not is-grid-independent-uv-coordinate((1pt,2pt)))
#let uv-coord-is-grid-independent(coord) = {
let ctx = default-ctx + (
target-system: "uv",
)
(ctx, coord) = resolve(ctx, coord)
not coord.all(x => type(x) == float and x.is-nan())
}
#assert(uv-coord-is-grid-independent((1, 2)))
#assert(uv-coord-is-grid-independent((rel: (+10, 0), to: (1, 2))))
#assert(not uv-coord-is-grid-independent((1pt, 2pt)))
#assert(not uv-coord-is-grid-independent((rel: (+10pt, 0pt), to: (1, 2))))
= Previous coordinate
#let ctx = default-ctx + (
target-system: "xyz",
grid: grid,
prev: (pt: (4, 5))
)
#assert-resolve(ctx, (), (4, 5))
= `em` coordinates
#let ctx = default-ctx + (
target-system: "uv",
grid: grid,
)
#assert-resolve(ctx,
(rel: (0pt, 1em), to: (0pt, 1pt)),
(0pt, 1em + 1pt),
)
#assert-resolve(ctx + (em-size: (width: 1cm)),
(0deg, 1pt + 1em),
(0deg, 1pt + 1cm),
)
|
https://github.com/patrick-kidger/typst_pyimage | https://raw.githubusercontent.com/patrick-kidger/typst_pyimage/main/README.md | markdown | Apache License 2.0 | <h1 align="center">typst_pyimage</h1>
<p align="center">Wraps <a href="https://github.com/typst/typst">Typst</a> to support inline Python code for generating content and figures.</p>
## Example
<img align="right" width="45%" src="https://raw.githubusercontent.com/patrick-kidger/typst_pyimage/main/imgs/lotka_volterra.png">
```typst
#import ".typst_pyimage/pyimage.typ": pyimage
Consider the Lotka--Volterra (predator-prey)
equations:
#pyimage("
import diffrax
import jax.numpy as jnp
import matplotlib.pyplot as plt
def func(t, y, args):
rabbits, cats = y
d_rabbits = rabbits - rabbits*cats
d_cats = -cats + rabbits*cats
return d_rabbits, d_cats
term = diffrax.ODETerm(func)
solver = diffrax.Tsit5()
y0 = (2, 1)
t0 = 0
t1 = 20
dt0 = 0.01
ts = jnp.linspace(t0, t1, 100)
saveat = diffrax.SaveAt(ts=ts)
sol = diffrax.diffeqsolve(term, solver, t0,
t1, dt0, y0,
saveat=saveat)
plt.plot(ts, sol.ys[0], label='Rabbits')
plt.plot(ts, sol.ys[1], label='Cats')
plt.xlim(0, 20)
plt.ylim(0, 2.5)
plt.xlabel('Time')
plt.ylabel('Population')
plt.legend()
", width: 70%)
```
_(This example uses [JAX](https://github.com/google/jax) and [Diffrax](https://github.com/patrick-kidger/diffrax) to solve an ODE.)_
## Installation
```
pip install typst_pyimage
```
This requires that you're using Typst locally -- it won't work with the web app.
## Usage
1. Import `pyimage.typ`. At the start of your `.typ` file, add the line `#import ".typst_pyimage/pyimage.typ": pyimage, pycontent, pyinit`.
2. Use these functions.
a. `pyimage(string, ..arguments) -> content`. The positional string should be a Python program that creates a single matplotlib figure. Any named arguments are forwarded on to Typst's built-in `image` function. You can use it just like the normal `image` function, e.g. `#align(center, pyimage("..."))`.
b. `pycontent(string)`. The positional string should be a Python program that produces a string on its final line. This string will be treated as Typst code.
c. `pyinit(string)`. The positional string should be a Python program. This will be evaluated before all `pyimage` or `pycontent` calls, e.g. to perform imports or other setup.
3. Compile or watch. Run either of the following two commands:
```
python -m typst_pyimage compile your_file.typ
python -m typst_pyimage watch your_file.typ
```
This will extract and run all your Python code. In addition it will call either `typst compile your_file.typ` or `typst watch your_file.typ`.
The resulting images are saved in the `.typst_pyimage` folder.
For more information on the available arguments, run `python -m typst_pyimage -h`.
## Notes
It's common to have an initial block of code that is in common to all `#pyimage("...")` and `#pycontent("...")` calls (such as import statements, defining helpers etc). These can be placed in a `#pyinit("...")` directive.
Each `#pyimage("...")` block is executed as a fresh module (i.e. as if each was a separate Python file), but with the same Python interpreter.
Overall, this is essentially equivalent to the following Python code:
```
# main.py
import pyinit
import pyimage1
import pyimage2
# pyinit.py
... # your #pyinit("...") code
# pyimage1.py
from pyinit import *
... # your first #pyimage("...") code
# pyimage2.py
from pyinit import *
... # your second #pyimage("...") code
```
This means that e.g. any global caches will be shared across all `#pyimage("...")` calls. (Useful when using a library like JAX, which has a JIT compilation cache.)
## Limitations
1. The watcher just extracts all the `pyimage("...")` etc. blocks via regex, and runs them in the order that they appear in the file. This means that (a) the `"` character may not appear anywhere in the Python code (even if escaped), and (b) trying to call `pyimage` etc. dynamically (i.e. not with a literal string at the top level of your program) will not work.
2. Only `pyimage("...")` etc. calls inside the single watched file are tracked.
We could probably lift 1a and 2 with a bit of effort. PRs welcome.
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-2580.typ | typst | Apache License 2.0 | #let data = (
("UPPER HALF BLOCK", "So", 0),
("LOWER ONE EIGHTH BLOCK", "So", 0),
("LOWER ONE QUARTER BLOCK", "So", 0),
("LOWER THREE EIGHTHS BLOCK", "So", 0),
("LOWER HALF BLOCK", "So", 0),
("LOWER FIVE EIGHTHS BLOCK", "So", 0),
("LOWER THREE QUARTERS BLOCK", "So", 0),
("LOWER SEVEN EIGHTHS BLOCK", "So", 0),
("FULL BLOCK", "So", 0),
("LEFT SEVEN EIGHTHS BLOCK", "So", 0),
("LEFT THREE QUARTERS BLOCK", "So", 0),
("LEFT FIVE EIGHTHS BLOCK", "So", 0),
("LEFT HALF BLOCK", "So", 0),
("LEFT THREE EIGHTHS BLOCK", "So", 0),
("LEFT ONE QUARTER BLOCK", "So", 0),
("LEFT ONE EIGHTH BLOCK", "So", 0),
("RIGHT HALF BLOCK", "So", 0),
("LIGHT SHADE", "So", 0),
("MEDIUM SHADE", "So", 0),
("DARK SHADE", "So", 0),
("UPPER ONE EIGHTH BLOCK", "So", 0),
("RIGHT ONE EIGHTH BLOCK", "So", 0),
("QUADRANT LOWER LEFT", "So", 0),
("QUADRANT LOWER RIGHT", "So", 0),
("QUADRANT UPPER LEFT", "So", 0),
("QUADRANT UPPER LEFT AND LOWER LEFT AND LOWER RIGHT", "So", 0),
("QUADRANT UPPER LEFT AND LOWER RIGHT", "So", 0),
("QUADRANT UPPER LEFT AND UPPER RIGHT AND LOWER LEFT", "So", 0),
("QUADRANT UPPER LEFT AND UPPER RIGHT AND LOWER RIGHT", "So", 0),
("QUADRANT UPPER RIGHT", "So", 0),
("QUADRANT UPPER RIGHT AND LOWER LEFT", "So", 0),
("QUADRANT UPPER RIGHT AND LOWER LEFT AND LOWER RIGHT", "So", 0),
)
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/gentle-clues/0.1.0/admonish.typ | typst | Apache License 2.0 | // color profiles
#let colors = (
gray: (border: luma(70), bg: luma(230)),
blue: (border: rgb(29, 144, 208), bg: rgb(232, 246, 253)),
green: (border: rgb(102, 174, 62), bg: rgb(235, 244, 222)),
red: (border: rgb(237, 32, 84), bg: rgb(255, 231, 236)),
yellow: (border: rgb(255, 201, 23), bg: rgb(252, 243, 207)),
purple: (border: rgb(158, 84, 159), bg: rgb(241, 230, 241)),
teal: (border: rgb(0, 191, 165), bg: rgb(229, 248, 246)),
orange: (border: rgb(255, 145, 0), bg: rgb(255, 244, 229)),
memo: (border: rgb(255, 82, 82), bg: rgb(253, 228, 224)),
blueish:(border: rgb(0, 184, 212), bg: rgb(229, 248, 251)),
grayish:(border: rgb(158, 158, 158),bg: rgb(245, 245, 245)),
quest:(border: rgb(0, 143, 115),bg: rgb(221, 243, 231)),
abstract: (border: rgb(124, 77, 255), bg: rgb(242, 237, 255)),
)
/*
Basic admonish template
*/
#let admonish(
content,
title: none, // string or none
icon: "assets/flag.svg", // file or symbol
color: "gray", // color profile name
width: auto, // length
radius: 2pt, // length
inset: 1em, // length
) = {
// setting bg and stroke color from color argument
let stroke-color = colors.at(color).border
let bg-color = colors.at(color).bg;
// Disable Heading numbering for those headings
set heading(numbering: none, outlined: false, supplement: "Box")
let header = rect(
fill: bg-color,
width: 100%,
radius: (top-right: radius),
inset: 1em,
)[
#grid(
columns: (auto, auto),
gutter: 1em,
box(height: 1em)[
#if type(icon) == "symbol" {
text(1em,icon)
} else {
image(icon, fit: "contain")
}
],
align(left + horizon,strong(title))
)
]
box(
width: width,
inset: (left: 1pt),
radius: (right: radius, ),
stroke: (
left: (thickness: 2pt, paint: stroke-color, cap: "butt"),
top: 0.1pt + bg-color,
rest: 0.1pt + luma(200),
)
)[
#set align(start)
#if title != none { header; v(-1em)}
#box(
width: 100%,
fill: white,
inset: inset,
radius: (bottom-left: 0pt, rest: radius)
)[#content]
]
}
// Predefined admonishments
/* info, note */
#let info(title: "Info", icon: "assets/info.svg", ..args) = admonish(color: "blue", title: title, icon: icon, ..args)
#let note = info
/* success, check, done */
#let success(title: "Success", icon: "assets/checkbox.svg", ..args) = admonish(color: "green", title: title, icon: icon, ..args)
#let check = success
#let done = success
/* warning, attention, caution */
#let warning(title: "Warning", icon: "assets/warning.svg", ..args) = admonish(color: "orange", title: title, icon: icon, ..args)
#let attention = warning
#let caution = warning
/* error, failure */
#let error(title: "Error", icon: "assets/crossmark.svg", ..args) = admonish(color: "red", title: title, icon: icon, ..args)
#let failure = error
/* task */
#let task(title: "Task", icon: "assets/task.svg", ..args) = admonish(color: "purple", title: title, icon: icon, ..args)
#let todo = task
/* tip, hint, important */
#let tip(title: "Tip", icon: "assets/tip.svg", ..args) = admonish(color: "teal", title: title, icon: icon, ..args)
#let hint = tip
#let important = tip
/* abstract, summary, tldr */
#let abstract(title: "Abstract", icon: "assets/abstract.svg", ..args) = admonish(color: "abstract", title: title, icon: icon, ..args)
/* conclusion, idea */
#let conclusion(title: "Conclusion", icon: "assets/lightbulb.svg", ..args) = admonish(color: "yellow", title: title, icon: icon, ..args)
#let idea = conclusion
/* memorize, remember */
#let memo(title: "Memo", icon: "assets/excl.svg", ..args) = admonish(color: "memo", title: title, icon: icon, ..args)
#let remember = memo
/* question, faq, help */
#let question(title: "Question", icon: "assets/questionmark.svg", ..args) = admonish(color: "quest", title: title, icon: icon, ..args)
#let faq = question
#let help = question
/* quote */
#let quote(title: "Quote", icon: "assets/quote.svg", ..args) = admonish(color: "gray", title: title, icon: icon, ..args)
|
https://github.com/Mc-Zen/quill | https://raw.githubusercontent.com/Mc-Zen/quill/main/src/process-args.typ | typst | MIT License | // This file contains helper functions to process and normalize special
// arguments to functions, especially where multiple formats and types
// are allowed.
#import "layout.typ"
#let process-padding-arg(padding) = {
let type = type(padding)
if type == length {
return (left: padding, top: padding, right: padding, bottom: padding)
}
if type == dictionary {
let rest = padding.at("rest", default: 0pt)
let x = padding.at("x", default: rest)
let y = padding.at("y", default: rest)
return (
left: padding.at("left", default: x),
right: padding.at("right", default: x),
top: padding.at("top", default: y),
bottom: padding.at("bottom", default: y),
)
}
assert(false, message: "Unsupported type \"" + type + "\" as argument for padding")
}
/// Process the label argument to `gate`. Allowed input formats are none, array of dictionaries
/// or a single dictionary/string/content (for just one label).
///
/// Each dictionary needs to contain the key content and may optionally have values
/// for the keys `pos` (specifying a 1d or 2d alignment) and `dx` as well as `dy`
#let process-label-arg(
labels,
default-pos: right,
default-dx: .4em,
default-dy: .4em
) = {
if labels == none { return () }
let type = type(labels)
if type == dictionary { labels = (labels,) }
else if type in (content, str) { labels = ((content: labels),) }
else if type == dictionary { labels = ((content: labels),) }
let processed-labels = ()
for label in labels {
let alignment = layout.make-2d-alignment(label.at("pos", default: default-pos))
let (x, y) = layout.make-2d-alignment-factor(alignment)
processed-labels.push((
content: label.content,
pos: alignment,
dx: label.at("dx", default: default-dx * x),
dy: label.at("dy", default: default-dy * y)
))
}
processed-labels
} |
https://github.com/benedict-armstrong/typstCV | https://raw.githubusercontent.com/benedict-armstrong/typstCV/main/typst/cv.typ | typst | #let configuration = yaml("configuration.yml")
#let settings = yaml("settings.yml")
#let heading_font = "Poppins"
#set page(margin: 20mm)
#show heading.where(level: 1): it => [
#set text(size: 14pt, font: heading_font, weight: "semibold")
#it
#v(0.2em)
]
#set par(leading: eval(settings.paragraph.leading))
#set text(size: eval(settings.font.size.body), font: "Source Serif 4")
#let sidebarSection = {
[
/* Headshot */
#par[
#figure(image("images/headshot.jpg"), placement: top)
]
#par(
justify: true,
)[
#par[
#set text(size: eval(settings.font.size.sidebar))
Born and raised in Vienna, currently living in Zürich.
In my free time, I like to code, tinker with electronics, design and make
furniture, and generally enjoy all types of DIY/maker projects. I am also
interested in FPV drones, IoT prototyping, 3D printing, tennis, cycling,
triathlons, and of course, all things computer science.
*Email:* #link("mailto:<EMAIL>") \
*Phone:* #link("tel:+41784215042") \
*LinkedIn:* #link("www.linkedin.com/in/benedictarmstrong")[benedictarmstrong] \
*GitHub:* #link("https://github.com/benedict-armstrong")[benedict-armstrong] \
]
]
]
}
#let mainSection = {
[
#upper[
#set text(font: heading_font)
#[
#set text(size: 20pt, weight: "medium")
*<NAME>*
]
#[
#set text(size: 10pt)
#link("mailto:<EMAIL>")[<EMAIL>] #h(1fr)
// #link("https://benarmstro.ng")[benarmstro.ng]
]
]
= Education
#{
for place in configuration.education [
- #[
#set text(size: 11pt)
#[
#link(place.university.link)[*#place.university.name*]
] \
#place.degree #place.major \
#place.from — #place.to \
]
#v(1em)
]
}
= Experience
#{
for job in configuration.jobs [
- #[
#set text(size: 11pt)
*#job.position*,
#link(job.company.link)[#job.company.name] \
#job.from #if job.to != "_" [— #job.to] \
#[
#par[
#set text(size: eval(settings.font.size.body))
#job.description
]
]
// #{
// set text(
// size: eval(settings.font.size.tags),
// )
// let tag_line = job.tags.join(" • ")
// tag_line
// }
]
#v(1em)
]
}
= Languages and Technologies
#{
let languages = configuration.skills.languages.join(", ")
let technologies = configuration.skills.technologies.join(", ")
[
- #languages
- #technologies
]
}
]
}
#{
grid(
columns: (1.618fr, 1fr),
column-gutter: 1em,
mainSection,
sidebarSection,
)
} |
|
https://github.com/MyPedagogicalRessources/BUT1-R1-01-Initiation-developpement | https://raw.githubusercontent.com/MyPedagogicalRessources/BUT1-R1-01-Initiation-developpement/main/TD/TD1-Structures-controle.typ | typst | #let td1(isCorrection: true) = [
#import "@preview/lovelace:0.3.0": *
#import "../TD_TP_Commons.typ": *
= R101- TD1 - Les structures de contrôle
== Objectifs
- Travailler les instructions conditionnelles.
- Travailler la sélection imbriquée et simple.
- Travailler les instructions de répétition.
== Exercice 1
Une société de location de voitures propose à ses clients le contrat suivant : Un forfait fixe de 65€ si le nombre de kilomètres parcourus est inférieur ou égal à 100. Si le kilométrage du forfait est dépassé, 0,25€ par kilomètre parcouru supplémentaire est ajouté. L’algorithme suivant permet de calculer le prix d’une location pour une distance de $X$ kilomètres.
#pseudocode-list(booktabs:true, title: smallcaps[Algorithme 1 : Calcul prix de location])[
+ *Données*
+ La valeur saisie de type Entier
+ *Début*
+ Saisir une valeur ;
+ *si* la valeur saisie est inférieure ou égale à 100 *alors*
+ le prix de la location est de 65€
+ Afficher le message pour indiquer que le forfait n’a pas été dépassé ;
+ *sinon*
+ le prix de la location est calculé comme 65+0,25$*$(la valeur saisie - 100)€
+ Afficher message pour indiquer que le forfait a été dépassé ;
+ *fin si*
+ Afficher le prix ;
+ *Fin*
]
#set enum(numbering: "a)")
1.1. Que va afficher cet algorithme si
+ $X = 30$ ?
+ $X = 110$ ?
+ $X = 100$ ?
+ $X = -20$ ?
#correction(displayCorrection: isCorrection)[
+ $X = 30$ : Le prix de la location est de 65€. Le forfait n’a pas été dépassé.
+ $X = 110$ : Le prix de la location est de 67,5€. Le forfait a été dépassé.
+ $X = 100$ : Le prix de la location est de 65€. Le forfait n’a pas été dépassé.
+ $X = -20$ : Le prix de la location est de 65€. Le forfait n’a pas été dépassé.
#remarque[
- Faire comprendre à l’étudiant « dans quel cas nous allons tomber » (si ou sinon).
- Expliquer « le cas égalité » de la condition dont la valeur X est égale à 100.
- Insister dans le fait que dans la vie réelle un tarif ne devrait pas être calculé pour la valeur X=-20.
]
]
1.2. Quelles sont les pré/post-conditions à respecter dans cet algorithme ?
#correction(displayCorrection: isCorrection)[
- Pré-conditions :
- La valeur X doit être un entier.
- Post-conditions :
- Le prix de la location doit être un réel supérieur à 65.
]
== Exercice 2
#correction(displayCorrection: isCorrection)[
#remarque[C’est la première fois (après le cours) que les étudiants vont voir une structure de répétition. Prenez le temps d’expliquer l’intérêt d’une structure de répétition.
]
]
2.1. Ecrire un algorithme qui demande un nombre de départ, et qui ensuite affiche les dix nombres suivants.
Par exemple, si l’utilisateur entre le nombre 17, le programme affichera les nombres de 18 à 27. Nous considérons que les actions élémentaires de
lecture, affichage, comparaison, stockage, addition de valeurs existent.
#correction(displayCorrection: isCorrection)[
#pseudocode-list(booktabs:true, title: smallcaps[Algorithme 2 : Affichage des 10 nombres suivants])[
+ *Données*
+ La valeur saisie de type Entier
+ le compteur de type Entier
+ *Début*
+ Écrire "Saisir une valeur :" ;
+ Lire la valeur saisie ;
+ Écrire "Les 10 nombres suivants sont :" ;
+ Initialiser le compteur à 1 ;
+ *tant que* _la valeur du compteur est inférieure ou égale à 10_ *faire*
+ Afficher la valeur saisie plus la valeur du compteur ;
+ Incrémenter le compteur de 1 ;
+ *fin tant que*
+ *Fin*
]
]
2.2. Quelles sont les informations en entrée et en sortie de l'algorithme ? Quels sont les types de données ?
#correction(displayCorrection: isCorrection)[
- Informations en entrée :
- La valeur saisie de type Entier.
- Informations en sortie :
- Les 10 nombres suivants de la valeur saisie.
- Types de données :
- Entier.
]
2.3. Indiquez l'initialisation, la progression et la condition d'arrêt dans la structure itérative de l'algorithme.
#correction(displayCorrection: isCorrection)[
- Initialisation :
- Initialiser le compteur à 1.
- Progression :
- Incrémenter le compteur de 1.
- Condition d'arrêt :
- La valeur du compteur est inférieure ou égale à 10.
]
== Exercice 3
Écrire un algorithme qui demande un nombre compris entre 10 et 20, jusqu'à ce que la réponse convienne. En cas de réponse supérieure à 20, on fera apparaître un message : « Plus petit ! », et inversement, « Plus grand ! » si le nombre est inférieur à 10.
Indiquez l’initialisation, la progression et la condition d’arrêt dans la structure itérative de l’algorithme.
#correction(displayCorrection: isCorrection)[
#remarque[ndiquez que nous avons besoin d’une premiere lecture (avant la boucle) afin d’évaluer la condition une première fois]
#pseudocode-list(booktabs:true, title: smallcaps[Algorithme 3 : Demande d'un nombre compris entre 10 et 20])[
+ *Données*
+ La valeur saisie de type Entier
+ *Début*
+ Écrire "Saisir un nombre entre 10 et 20 :" ;
+ Lire la valeur saisie ;
+ *tant que* _la valeur saisie $<$ 10 ou la valeur saisie $>$ 20_ *faire*
+ *si* _la valeur saisie est inférieure à 10_ *alors*
+ Écrire "Plus grand !" ;
+ *sinon*
+ Écrire "Plus petit !" ;
+ *fin si*
+ Écrire "Saisir un nombre entre 10 et 20 :";
+ Lire la valeur saisie ;
+ *fin tant que*
+ Écrire "Le nombre est correct." ;
+ *Fin*
]
- Initialisation :
- Lire la valeur saisie.
- Progression :
- Lire la valeur saisie.
- Condition d'arrêt :
- La valeur saisie est comprise entre 10 et 20.
]
== Exercice 4
Nous aimerions écrire un algorithme qui sera utilisé par un distributeur automatique de billets afin d’identifier leurs utilisateurs. Un utilisateur est bien identifié s’il tape un code sur le distributeur égal au code qui est sur sa carte bancaire.
On suppose que l’utilisateur peut se tromper lorsqu’il communique son code. Dans la suite, nous supposons que la valeur du code de la carte bancaire est connue par le distributeur.
4.1. Écrire un algorithme qui demande à l’utilisateur de saisir son code autant de fois que nécessaire de saisir son code jusqu’à ce qu’il soit correct.
#correction(displayCorrection: isCorrection)[
#pseudocode-list(booktabs:true, title: smallcaps[Algorithme 4.1 : Identification de l'utilisateur])[
+ *Données*
+ Le code de la carte bancaire de type Entier
+ Le code saisi par l'utilisateur de type Entier
+ *Début*
+ Lire le code de la carte bancaire ;
+ Écrire "Quel est votre code ?" ;
+ Lire le code saisi par l'utilisateur ;
+ *tant que* le code saisi est différent du code de la carte bancaire *faire*
+ Écrire "Quel est votre code ?" ;
+ Lire le code saisi par l'utilisateur ;
+ *fin tant que*
+ Afficher "Le code est correct." ;
+ *Fin*
]
]
4.2. Modifier l’algorithme précédent pour limiter le nombre d’essais maximum (par exemple 3).
#correction(displayCorrection: isCorrection)[
#pseudocode-list(booktabs:true, title: smallcaps[Algorithme 4.2 : Identification de l'utilisateur avec un nombre d'essais maximum])[
+ *Données*
+ Le code de la carte bancaire de type Entier
+ Le code saisi par l'utilisateur de type Entier
+ Le nombre d'essais de type Entier
+ *Début*
+ Lire le code de la carte bancaire ;
+ Initialiser le nombre d'essais à 3 ;
+ Écrire "Quel est votre code ?" ;
+ Lire le code saisi par l'utilisateur ;
+ *tant que* le code saisi est différent du code de la carte bancaire et le nombre d'essais $>$ 0 *faire*
+ Écrire "Quel est votre code ?" ;
+ Lire le code saisi par l'utilisateur ;
+ Décrémenter le nombre d'essais de 1 ;
+ *fin tant que*
+ *si* le code saisi est égal au code de la carte *alors*
+ Écrire "Le code est correct." ;
+ *sinon*
+ Écrire "Le code est erroné." ;
+ *fin si*
+ *Fin*
]
]
4.3. Traduire les algorithmes précédents dans le langage du distributeur automatique de billets
en considérant que les informations du distributeur sont stockées dans les trois registres :
- « _codeCarte_ » : stocke la valeur du code réel (correct) de la carte bancaire déjà connue par le distributeur avant le traitement demandé.
- « _codeSaisi_ » : permet de stocker la valeur du code saisi par l’utilisateur.
- « _nbEssais_ » : permet de stocker le nombre d’essais restants.
Les actions élémentaires du distributeur sont :
#table(
columns: (auto, auto),
inset: 10pt,
align: horizon,
table.header(
[*Nom de l'action*], [*Description*],
),
[_lireCode_], [Affecter au registre _codeSaisi_ le code saisi par l'utilisateur],
[_demanderCode_], [Afficher à l'écran le message _"Quel est votre code ?"_],
[_initialiserNbEssais_], [Affecter au registre _nbEssais_ la valeur 3 (nb essais max.)],
[_decrementerNbEssais_], [Décrémenter le registre _nbEssais_ de 1],
[_afficherCodeCorrect_], [Afficher à l'écran le message _"Le code est correct."_],
[_afficherCodeErrone_], [Afficher à l'écran le message _"Le code est erroné."_],
)
On suppose que le distributeur est capable de comparer soit les valeurs de 2 registres, soit la valeur d’un registre avec une constante et ce à l’aide des opérateurs $>$, $>=$, $<$, $<=$, $=$.
#correction(displayCorrection: isCorrection)[
#pseudocode-list(booktabs:true, title: smallcaps[Programme 4.1 : Identification de l'utilisateur])[
+ *Début*
+ _lireCode_ ;
+ _demanderCode_ ;
+ *tant que* _codeSaisi_ $!=$ _codeCarte_ *faire*
+ _demanderCode_ ;
+ _lireCode_ ;
+ *fin tant que*
+ _afficherCodeCorrect_ ;
+ *Fin*
]
#pseudocode-list(booktabs:true, title: smallcaps[Programme 4.2 : Identification de l'utilisateur avec un nombre d'essais maximum])[
+ *Début*
+ _lireCode_ ;
+ _initialiserNbEssais_ ;
+ _demanderCode_ ;
+ _lireCode_ ;
+ *tant que* _codeSaisi_ $!=$ _codeCarte_ et _nbEssais_ $>$ 0 *faire*
+ _demanderCode_ ;
+ _lireCode_ ;
+ _decrementerNbEssais_ ;
+ *fin tant que*
+ *si* _codeSaisi_ $=$ _codeCarte_ *alors*
+ _afficherCodeCorrect_ ;
+ *sinon*
+ _afficherCodeErrone_ ;
+ *fin si*
+ *Fin*
]
]
] |
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/nth/0.1.0/nth.typ | typst | Apache License 2.0 | #let nth(ordinal-num) = {
let ordinal-str = str(ordinal-num)
if ordinal-str.contains(regex(".*1[0-9]"))
show: ordinal-str + super("th")
}
else if ordinal-str.last() == "1" {
show: ordinal-str + super("st")
}
else if ordinal-str.last() == "2" {
show: ordinal-str + super("nd")
}
else if ordinal-str.last() == "3" {
show: ordinal-str + super("rd")
}
else {
show: ordinal-str + super("th")
}
}
|
https://github.com/Dav1com/resume | https://raw.githubusercontent.com/Dav1com/resume/main/modules/skills.typ | typst | Apache License 2.0 | #import "../brilliant-CV/template.typ": *
#cvSection("Skills")
#cvSkill(
type: [Languages],
info: [English #hBar() Spanish]
)
#cvSkill(
type: [Programming],
info: [Java, Groovy, Scala #hBar() C/C++ #hBar() OCaml, F\#, F\* #hBar() Python ]
)
#cvSkill(
type: [Frameworks],
info: [Spring #hBar() DJango #hBar() Apache Camel #hBar() Sturdy]
)
#cvSkill(
type: [Miscellaneous],
info: [Linux power user #hBar() Formal Language Semantics #hBar() Static Analysis #hBar() Typst #hBar() Coq #hBar() Git]
)
#cvSkill(
type: [Personal Interests],
info: [Reading #hBar() Videogames #hBar() Anime #hBar() Programming Languages]
)
|
https://github.com/janlauber/bachelor-thesis | https://raw.githubusercontent.com/janlauber/bachelor-thesis/main/common/titlepage.typ | typst | Creative Commons Zero v1.0 Universal | #let titlepage(
title: "",
subtitle: "",
degree: "",
program: "",
advisor: "",
expert: "",
author: "",
projectPartner: "",
submissionDate: none,
) = {
set document(title: title, author: author)
set page(
margin: (left: 25mm, right: 25mm, top: 10mm, bottom: 10mm),
numbering: none,
number-align: center,
)
let body-font = "New Computer Modern"
let sans-font = "New Computer Modern Sans"
set text(
font: body-font,
size: 10pt,
lang: "en"
)
set par(leading: 1em)
// --- Title Page ---
align(left, image("../figures/logo.svg", width: 35%))
v(10mm)
align(left, text(font: sans-font, 2.5em, weight: 700, title))
align(left, text(font: sans-font, 2em, weight: 100, subtitle))
v(5mm)
align(left, text(font: sans-font, 1.4em, weight: 700, degree + "’s Thesis in " + program))
v(12cm)
pad(
top: 3em,
right: 15%,
grid(
columns: 2,
gutter: 1em,
strong("Author: "), author,
strong("Advisor: "), advisor,
strong("Expert: "), expert,
strong("Project Partner: "), projectPartner,
strong("Submission Date: "), submissionDate
)
)
pagebreak()
} |
https://github.com/pluttan/asmlearning | https://raw.githubusercontent.com/pluttan/asmlearning/master/dz1/dz1.typ | typst | #import "@docs/bmstu:1.0.0":*
#show: student_work.with(
caf_name: "Компьютерные системы и сети",
faculty_name: "Информатика и системы управления",
work_type: "домашней работе",
work_num: "1",
discipline_name: "Машинно-зависимые языки и основы компиляции",
theme: "Обработка символьной информации",
author: (group: "ИУ6-42Б", nwa: "<NAME>"),
adviser: (nwa: "<NAME>"),
city: "Москва",
table_of_contents: true,
)
= Выполнение работы
== Цель работы
Изучение команд обработки цепочек и приемов обработки символьной информации
== Задание
Дан текст, состоящий из слов, разделенных несколькими пробелами. Определить количество букв Р в каждом слове.
== Выполнение
=== Алгоритм
Так как словами являемся любой набор символов, разделенный пробелами создадим цикл, в котором будет 4 проверки.
1. Проверка на пробел (Если 1-ый -- выводим результат для текущего слова)
2. Проверка на Р (Если истина -- прибавляем к счетчику 1)
3. Проверка на выход (Если истина -- выводим последнее слово и выходим)
4. Проверка на первую букву (Если истина -- запоминаем смещение (для вывода) и обнуляем счетчик Р)
Вот схема алгоритма:
#img(image("flow.svg", width: 64%), [Схема алгоритма для основной программы])
=== Выделение памяти
Выделим 255 байт для хранения введенного текста и 4 байта для хранения ответа. Проинициализируем несколько строк для красивого вывода.
#let dz1 = parserasm(read("dz1.asm"))
#code(funcstr(dz1, "section .data") + funcstr(dz1, "section .bss"), "asm", [Объявление и инициализация данных])
=== Начало программы
В начале выведем приглашения для ввода текста пользователю и считаем текст.
#code(funcstr(dz1, "_start:"), "asm", [Выводим приглашение на ввод и ожидаем ввода])
После начнем готовить регистры к циклу. ```asm ecx``` будет отвечать за общий счетчик, объявлен он 1 из-за особенностей обработки первой буквы слова, о которой я расскажу позже.```asm esi``` будет флагом общего выхода -- для того, чтобы не дублировать код для вывода последнего слова, я просто вызываю метку вывода, а в этой метке проверяю ```asm esi```: если 0 -- возвращаемся к циклу, если 1 -- выходим из программы.
#code(funcstr(dz1, "txparser:"), "asm", [Готовим несколько регистров перед циклом])
=== Цикл
==== Начало цикла
Цикл я разделил на сного частей, в начале цикла обрабатываются начала слов: сюда мы входим в 1 раз из ```asm txparser``` и каждый раз, когда предыдущим символом был пробел, а текущий пробелом не является.
#code(funcstr(dz1, "txparserls:"), "asm", [Начало цикла])
Так как начальную букву необходимо обработать, а в общем теле цикла ```asm ecx``` всегда увеличивается на 1 будем проходить по этой букве 2 раза: в первый будем загружать адрес этой буквы в ```asm edx```, ```asm eax``` будет счетчиком букв, во второй будем обрабатывать в цикле эту букву, как и все буквы. Условием входа в это начало будет 0 в регистре ```asm edx```, который мы будем ставить после первого пробела, для того, чтобы отметить, что предыдущее слово закончено и выведено. Вторым условием обязательно болжно быть то, что текущяя буква не пробел.
#pagebreak()
==== Основное тело цикла
Тут мы будем обрабатывать все 4 условия из алгоритма.
#code(funcstr(dz1, "txparserl:"), "asm", [Начало цикла])
В начале переносим текущую букву в регистр ```asm bl```, после чего увеличиваем счетчик букв на 1.
Проверяем условие выхода: если текущая буква -- служебный знак переноса строки переходим к метке ```asm txparsere```.
Если текущая буква -- пробел переходим к обработке пробелов.
Если ```asm edx``` равен нулю, переходим к началу цикла -- у нас новая буква (она не пробел -- иначе мы бы даже не дошли до этого сравнения).
Если нам встретилась буква Р, неважно в каком регистре переходим к обработке букв Р.
Если ни одно условие не выполнилось так же повторяем цикл.
==== Обработка пробелов
#code(funcstr(dz1, "txparserlsp:"), "asm", [Обработка пробелов])
Если ```asm edx``` не равен нулю, значит мы наткнулись на 1 пробел: толлько в таком случае мы будем выводить предыдущее слово. Поэтому последнее слово, не имеющее пробелов после необходимо будет выводить вручную.
В начале сохраняем все используемые регистры, чтобы не потерять значения. Сохраняем текущее значение количества букв в отдельную ячейку памяти.
Добавляя к ```asm ecx``` общее смещение в памяти получим адрес конца слова. Вычитая адрес начала слова ```asm edx``` получим количество букв в этом слове. Таким боразом в ```asm ecx``` получили количество букв, а в ```asm edx``` адрес первой буквы, загрузим сначала адрес, потом количество в стек.
Необходимо подготовить и вывести первую часть предложения, которая будет выглядеть, как ```c "There are "``` и количество букв, которое мы сохранили ранее. Все это сделает моя библеотека, подробно описанная в лабораторной работе 2. Поэтому просто передаем память с цифрой и память с буквами первой части предложения в регистры, после чего вызываем ```asm outi```.
Далее выводим вторую часть предложения ```c " letter(s) 'p' in word "```.
После чего выводим само слово, сначала помещаем в ```asm edx``` количество его букв, затем в ```asm ecx``` адрес, все это в таком порядке лежало в стеке.
Но этого не достаточно, после самого слова я хочу выводить знак переноса строки, поэтому помещаем в уже ненужный буфер для хранения количества букв код переноса строки 10, а в регистр количества букв перемещаем 1, таким образом и выводим только перенос строки.
После чего возвращаем все регистры обратно, кроме ```asm edx```, в него помещаем 0, как знак того, что следующие пробелы будут не первые и выводить слово не нужно.
Далее проверяем ```asm esi```, если он не равен нулю, то значит текущее слово последнее и мы можем выходить из программы.
#code(funcstr(dz1, "txparserlpr:"), "asm", [Вывод слова и количества букв])
==== Обработка буквы Р
Для обработки буквы, необходимо изменить значение счетчика на 1 и перейти к следующей итерации цикла.
#code(funcstr(dz1, "txparserlcmpiax:"), "asm", [Обработка буквы Р])
=== Выход и вывод последнего слова
При выходе еще раз вызовем метку ```asm parsetxlpr```, с ```asm esi``` равным 1.
#code(funcstr(dz1, "txparsere:"), "asm", [Вывод последнего слова])
После чего из метки перейдем к финальному выходу из программы.
#code(funcstr(dz1, "txparseree:"), "asm", [Финальный выход из программы])
== Тестировние программы
Тестировать программу будем на тексте-рыбе:
``` Loppem pipsum pdolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpppa ppp sint ad nisi Lorem papriatur mollit ex esse exercitation amet.```
#img(image("test.png", width: 55%), [Тестирование программы])
== Вывод
В процессе выполения работы были изучены команды обработки цепочек и приемы обработки символьной информации.
== Контрольные вопросы
1. *Дайте определение символьной строки.*
Символьная строка -- массив символов, оканчивающийся спецсимволом (обычно концом строки(10) или 0)
2. *Назовите основные команды обработки цепочек?*
- пересылка цепочки: ```asm movs Адрес_приемника,Адрес_источника```
- сравнение цепочек: ```asm cmps Адрес_приемника,Адрес_источника```
- сканирование цепочки: ```asm scas Адрес_приемника```
- загрузка элемента из цепочки: ```asm lods Адрес_источника```
- сохранение элемента в цепочке: ```asm stos Адрес_приемника```
3. *Какие операции выполняют строковые команды ```asm MOVS```? Какие особенности характерны для этих команд?*
```asm movs``` обрабатывает текущий элемент и изменяет текущий адрес, указывая на следующий элемент цепочки.
4. *Какие операции выполняют строковые команды ```asm CMPS, SCAS```? Какие особенности характерны для этих команд?*
```asm cmps``` сравнивает два цепочки и возвращает флаги так же как и ```asm cmp```. Используется совместно с операциями ```asm rep*``` и помогает организовать поиск по цепочке, сравнение цепочек и тд.
5. *Как обеспечить циклическую обработку строк?*
Необходимо использовать команду-префикс ```asm rep*```, в совокупности с условием команда помогает избежать организации цикла для операций с цепочками.
6. *Какова роль флага ```asm DF``` во флажковом регистре при выполнении команд обработки строк?*
Так как цепочечные команды сами организуют изменения регистров, флаг ```asm df``` погомает понять, в какую строну мы будем идти в памяти. Если флаг равен 0, то с каждой итерацией адрес увеличивается, иначе уменьшается.
7. *Как правильно выбрать тестовые данные для проверки алгоритма обработки строки?*
Необходимо взять максимально длинный текст, с большим количеством различных символов. Например, при проверке в своем варианте я использовал текст-рыбу с увеличенным количеством пробелов и букв "p".
|
|
https://github.com/longlin10086/HITSZ-PhTyp | https://raw.githubusercontent.com/longlin10086/HITSZ-PhTyp/main/template.typ | typst | #import "layout/page.typ" : *
#show: page_style[
#head_elements_line(
"114514班",
"1919810",
"longlin",
"../assets/images/signature.png",
"2024.4.1",
"2.0",
"3.0"
)
#two_lines
= RLC 暂态电路研究
#counter(heading.where(level: 2)).step()
== 预习
#question_list(
"RC、RL串联电路暂态过程电压表达式,以及时间常数t的表达式是什么?",
"RLC串联电路的暂态过程(三种阻尼过程)电压表达式、时间常数t表达式是什么?",
"请绘制数字示波器、信号发生器观测RC、RL和RLC串联电路的连接线路示意图。"
)
#lorem(200)
#pagebreak()
#counter(heading.where(level: 2)).step()
== 原始数据记录
#question_list(
[*RC串联电路的暂态特性*\(使用方波信号进行实验,可取 $V_(p p)=10V$\)
#simple_table(
column-num: 5,
[$R=500 Omega$ #h(1em) #underline_element([方波信号周期T], [$220 mu s$、60 ms、600ms、3s], 15pt)],
[$tau$ \\ C], [$0.022 mu F$], [$10 mu F$], [$100 mu F$], [$470 mu F$],
[时间常数 $tau$], [$12 mu s$], [6ms], [56ms], [288ms]
)
#simple_table(
column-num: 5,
[$C=100 mu F$ #h(1em) #underline_element([方波信号周期T], [10ms、50 ms、100ms、500ms], 15pt)],
[$tau$ \\ R], [$10 Omega$], [$50 Omega$], [100 Omega], [$500 Omega$],
[时间常数 $tau$], [1ms], [5.1ms], [12ms], [56ms]
)
],
[*RL串联电路的暂态特性*\(使用方波信号进行实验,可取 $V_(p p)=10V$\)
#simple_table(
column-num: 4,
[$L=10 m H$ #h(1em) #underline_element([方波信号周期T], [$220 mu s$、60 ms、600ms], 15pt)],
[$tau$ \\ R], [$100 Omega$], [$500Omega$], [$900 Omega$],
[时间常数 $tau$], [$92 mu s$], [$16 mu s$], [$10.4 mu s$],
)
#simple_table(
column-num: 4,
[$R=1000 Omega$ #h(1em) #underline_element([方波信号周期T], [10ms、50 ms、100ms], 15pt)],
[$tau$ \\ L], [$10 m H$], [$50 m H$], [100 m H],
[时间常数 $tau$], [$8.8 mu s$], [$44 mu s$], [$88 mu s$],
)
],
[*RLC串联电路的暂态特性*\(使用方波信号进行实验,可取 $V_(p p)=10V$\)
#simple_table(
column-num: 10,
[测量欠阻尼情况下 $U_C$ 充电时振荡波形的任一 $t_1$ 时峰值 $U_(c t_1)$ 和 $t_1+n T$ 时峰值 $U_(c\(t_1+n T\))$ ],
[n], 0, 1, 2, 3, 4, 5, 6, 7, 8,
[$U_(c\(t_1+n T\))$], [13.4], [11.0], [9.4], [8.2], [7.2], [6.6], [6.2], [5.8], [5.4]
)
#underline_element([E], [10 V], 7pt) #h(10pt) #underline_element([$t_1$], [52 \u{03BC} s], 7pt)
],
)
#signature_table("../assets/images/signature.png")
#pagebreak()
#counter(heading.where(level: 2)).step()
== 数据处理
#question_list(
[记录各项实验任务过程中的R、C和L各参数值,示波器观察到的波形,以及时间常数 $tau$ 。],
[测量欠阻尼情况下 $U_C$ 充电时振荡波形的任一 $t_1$ 时峰值 $U_(c t_1)$ 和 $t_1+n T$ 时峰值 $U_(c\(t_1+n T\))$ ,采用最小二乘法或作图法求出 $ln(1- U_C / E)~t$ 的斜率,计算时间常数 $tau$,并与理论值 $tau= (2L) / R \(R=R_("电阻")+R_S+R_L\)$ 进行比较,分析误差产生的原因。]
)
#lorem(200)
#pagebreak()
#counter(heading.where(level: 2)).step()
== 实验现象分析及结论
#lorem(100)
#counter(heading.where(level: 2)).step()
== 讨论题
#question_list(
"在RC和RL电路中,固定方波频率f而改变R的阻值,为什么会有各种不同的波形?若固定R而改变方波频f,会得到类似的波形吗?为什么?",
"在RLC电路中,为什么要适当调节方波频率才能观测到阻尼振荡的波形?如果频率很高,将会发生什么样的情况?试观察。"
)
#lorem(100)
]
|
|
https://github.com/drupol/master-thesis | https://raw.githubusercontent.com/drupol/master-thesis/main/src/thesis/theme/colors.typ | typst | Other | // Source: https://web.umons.ac.be/app/uploads/sites/8/2017/07/REF-COULEURS-FACS-UMONS.pdf
#let umons-red = rgb(168, 0, 57)
#let umons-turquoise = rgb(0, 171, 204)
#let umons-grey = rgb(150, 150, 150)
#let umons-yellow = rgb(246, 167, 35)
#let umons-faculty-sciences = rgb(2, 150, 135)
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/007%20-%20Theros/001_The%20Lost%20Confession.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"The Lost Confession",
set_name: "Theros",
story_date: datetime(day: 11, month: 09, year: 2013),
author: "<NAME>",
doc
)
Ajani,
I'm writing you this letter knowing that you'll never read it. When I'm finished with these words, I'm going to roll the parchment up, slide it into a ceramic vial, and sink it in a swamp. That's what you do with prayers here, or at least prayers to Pharika, who seems to be the god of potions. She's also the god of poison, so maybe these words will just make things worse for me. I don't understand this plane yet—I've been too busy trying not to die. But I'm getting ahead of myself.
I once told you where I got my sword—it's from a plane called Theros, and that's where I am. I had hazy memories from my first visit years ago—an old forest with massive, gnarled olive trees, and a dizzying precipice overlooking a rocky expanse. When I arrived this time, I ended up in a bleak swamp near an entrance to a cave. It was a stroke of good luck because the cave is a temple, and I was cared for by these snake-loving priests, who are cold but efficient. Luckily, the priests don't care where I came from, nor do they want any compensation for their aid. Today, they pushed this charcoal pencil into my hand. I know they want me to write prayers... but how can I when I don't understand the nature of the divine?
#figure(image("001_The Lost Confession/01.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
Koth said he saw you a second time after Urborg, but he never told me the circumstances. I hope you didn't try to find me on Mirrodin, but at least you know some of what's happened. You know that Phyrexia reared up and engulfed the metal plane. You know that a young Mirran named Melira provided us with a natural immunity to the Phyrexian contagion. You've wandered the planes more than me, so you probably understand the contagion more than I do.
Koth is... was... a remarkable man. I don't know whether he lived. For all I know, he was killed in some brutally excruciating way. Since Koth is also immune to the contagion, they'll have to cut him up to make him submit. The Phyrexians specialize in dismemberment, and we promised each other we'd kill ourselves before they could take us apart limb from limb while we were still alive. But I wasn't there with him at the end, so I don't know for certain. If he's gone, I pray he died quickly.
There was a brief time after Karn left that I thought the resistance had a chance. The praetors were squabbling among themselves for supremacy. But they all began to despise the interloper, Tezzeret. Although the resistance had limited access to information, we believed <NAME> had dominated Urabrask's and Sheoldreds' domains. So we focused our energies on destroying her. But for every life we saved, they slaughtered eight, ten, a hundred more. And soon there were precious few left to save. In the words of E<NAME>, "We are a single entity. Dissenters must be sutured into the orthodoxy."
#figure(image("001_The Lost Confession/02.jpg", width: 100%), caption: [Elesh Norn, Grand Cenobite | Art by Igor Kieryluk], supplement: none, numbering: none)
Life on Mirrodin was a sickness beyond words, beyond comprehension. And yet we lived it. Day after day after day... until we could go no further. The resistance was lost. We reached the finale—the night of our final stand.
We were separated from Melira and her keepers. I don't know if they were captured, but I don't see how they weren't. Koth and I managed to infiltrate their cathedral-fortress and navigate that warren of death and madness. We had to cross the Butcher Hall to reach the secret chamber, which had been used for "special" executions in the days of Karn. Now, it was empty except the dramatic pattern of dried blood dotting the ceiling, almost like stars in the night sky.
The most important thing about the chamber was that it was beneath the new throne room, and Koth carried a spellbomb. The Mirrans have had spellbombs for ages, but no one had ever built one this powerful. We'd modified it using Venser's schematics. The idea was scrawled in that notebook of his along with his plans for Phyrexian-inspired ships that could drift between the planes. Don't hate me, but I'm glad he died before he could finish that ship.
Ajani, I pray you never see Phyrexia. But imagine a white sheet with its corner dipped in bucket of blood. It's a law of nature that it will spread until there's nothing left except a seeping stain. That's Phyrexia. By that last night, #emph[everything] had been marred by them. They'd consumed and necrotized until Koth and I were the last natural forms on that unnatural plane. At least that's the way it seemed to us.
#figure(image("001_The Lost Confession/03.jpg", width: 100%), caption: [Remember the Fallen | Art by Eric Deschamps], supplement: none, numbering: none)
We'd learned that the praetors were gathering in the throne room to select a new Father—or Mother—of Machines. Tezzeret was supposed to be there, too. But if so, it was probably so the others could decapitate him or steal his body parts for some grand new construct. We didn't know if the praetors would ever be in such close proximity again. This was our last chance to do damage that they might actually #strong[feel] .
Still, I couldn't help but thinking: What is left on this world to save? I saw the praetors as the gods of New Phyrexia. I imagine that's how they thought of themselves. "Behold, perfection." Even if we succeeded and we killed all the gods of New Phyrexia, it wouldn't bring an end to it. They don't need a mind to drive that genocide—it's inherent in the contagion itself. <NAME>, Sheoldred, Jin-Gitaxias—one head lost, another one grows in glorious perfection. And Phyrexia #strong[will] spread, you know that as well as I do.
You know what Koth says: "If there is no victory, then I will fight forever." But that night, I reached the edge of forever. Writing this makes me so tired, Ajani. I feel like shards of glass line my throat. I would go blind if only I could forget all that I've seen. Was I ready to die there, with Koth, to sacrifice myself for a greater good? He was willing. It was never a choice in his mind. Wherever he is, whatever he became, there is no doubt he is a better soul than me.
#figure(image("001_The Lost Confession/04.jpg", width: 100%), caption: [Koth of the Hammer | Art by <NAME>an], supplement: none, numbering: none)
The Phyrexians zeroed in us even though we'd sealed the door. It was just a matter of time before they broke the defenses that Koth had slapped into place. The clanging of the weapons against the wall was a cadence, counting the seconds until they were inside. I felt no glory, no desire for greatness. I'll tell you the truth—I just wanted it over. I wanted it done. I was wounded, starving, and burdened with the names of the dead from this world and others. Koth set the spellbomb.
"You're leaving," he says.
Have you noticed that time is a funny thing? Have you ever felt it slow to where the seconds feel like knives into your skin? It's the angel's truth, but I didn't understand what he was saying to me. I'd like to say that I protested: "No, no, I must stay and fight." Something like that. But I just stared at him, listening to the door bend to the intruders' single-minded determination to flay our skin from our still-living bodies.
"You're leaving," he says again. "And there's nothing to come back for. Seal this world off, and throw away the key."
And go where? "There is no home for me, Koth. Not after this." Not after everything.
"You can find rest or you can find another battlefield," he says. "But not here."
Did I ever tell you what Koth did to Venser? Back on Urborg, when he saw that Venser was building that Phyrexian ship? He encased his head in rock and coerced him to planeswalk to Mirrodin.
Now it was my turn, but he just sunk me up to my knees in the stone and left me there. Like I was a sign post warning the world of its imminent demise. And then he raised a wall between us to keep the spell bomb from blowing me to shreds. That's Koth for you. He'll #strong[present] you a simple choice, as if that made it easy. Leave or die.
I know you'd tell me to forgive him. He was trying to save my life, which I had no interest in saving myself. But I hate him for locking me inside a cage with a door controlled by other hands than mine. A door with every nightmare I've ever had slobbering on the other side.
I've never been fast at planeswalking. Once, you told me that it would get easier and hurt less. But it still feels like I have to use a metaphysical knife to shred my skin in preparation for the Blind Eternities. With my legs immobilized, I readied myself. But to leave, I had to bond with that fetid, violent mockery of a civilization. Before I could find the strength, the door exploded in its frame. I was still seconds away from being gone.
#figure(image("001_The Lost Confession/05.jpg", width: 100%), caption: [Phyrexian Obliterator | Art by <NAME>], supplement: none, numbering: none)
An Obliterator lurched into the chamber. This is a brainchild of the contagion—an abomination designed solely to kill. And under that twisted vision, these creatures are perfect at what they do. It came at me with rows of teeth ripped from the mouths of living beings. Multiple blade-like arms shredded the air while noxious fumes leaked out of its chest cavities. It wore the skin of the dead and carried a legacy of crushed and broken lives.
It only took a single step, and it was on me. I didn't even raise my sword before two of its blades drove deep into my belly. I reeled back and fell to the floor with my lower legs still encased in stone. The ground rumbled beneath my back as Koth's spellbomb exploded on the other side of his makeshift wall, but I don't know the fruits of its destruction. Above me on the ceiling, I saw the strange constellations, the pattern born of violence and degradation. The Obliterator loomed above me, its blade plummeting toward my head, and blocked the ceiling from view. So I closed my eyes, and in the darkness of my mind, the constellations transformed into the night sky of Theros.
I remembered Heliod, the god of the sun. I saw him the day I got my sword. His form dominated the horizon. He was like a man, but with the essence of stars. I desperately wanted to be on Theros, in the arms of the only plane where I'd ever seen the face of god.
#figure(image("001_The Lost Confession/06.jpg", width: 100%), caption: [Heliod, God of the Sun | Art by <NAME>], supplement: none, numbering: none)
My blood rushed out of me as I left that nightmare world. In that strange blur and chaos of the Blind Eternities, I thought about the divine. Maybe there is something about the gods that will make Theros indestructible. Maybe the divine presence means it can't be destroyed or infected. Maybe, if there are gods, then everything can't fall apart.
I must discover what the gods are and what they want. Do they desire sacrifice? Loyalty? Honor? Until I heal, I am in limbo in this sacred cave where life and death seem to co-exist in some strange harmony. From where I lay, I can see the blue sky of my new world through the narrow rift in the rock. There's nothing to bar my exit. As soon as I am able, I can walk out and be reborn. I am resolved to stay here until I understand the nature of the world and its divine stewards.
If you were here, Ajani, what would you tell me to do? Should I scream Heliod's name to the heavens? Or am I allowed to speak his name at all? Should I make a sacrifice? My sword is the only thing of value I have that a god might covet.
How about this prayer: Please let there be something greater than me. Greater than the relentless evil that seems to devour every place where I lay my head. Please take away the pain and loneliness and memories I no longer want.
Here's what I would say to Heliod, if I ever see his face: Give me quiet. Give me peace. Give me rest at last.
So there you have it, Ajani. If you ever hear my story, will you judge me? Will you call me a coward for leaving, yet again? Maybe others would, but not you. When you look at me, you see all that I could be. When I look at myself, I see only what I should have been.
Eternally Yours, Elspeth
|
|
https://github.com/lucannez64/Notes | https://raw.githubusercontent.com/lucannez64/Notes/master/Olympiades_Correction.typ | typst | #import "template.typ": *
// Take a look at the file `template.typ` in the file panel
// to customize this template and discover how it works.
#show: project.with(
title: "Olympiades Correction",
authors: (
"<NAME>",
),
date: "30 Octobre, 2023",
)
#set heading(numbering: "1.1.")
+
#block[
#set enum(numbering: "a.", start: 1)
+ Une autre exemple de liste de longueur 8 et de score 3 est
$lr([1 comma 3 comma 5 comma 2 comma 4 comma 8 comma 7 comma 6])$.
+ Les listes de longueur 3 possibles sont:
]
- $lr([1 comma 2 comma 3])$ avec un score de 2
- $lr([1 comma 3 comma 2])$ avec un score de 1
- $lr([2 comma 1 comma 3])$ avec un score de 1
- $lr([2 comma 3 comma 1])$ avec un score de 1
- $lr([3 comma 1 comma 2])$ avec un score de 1
- $lr([3 comma 2 comma 1])$ avec un score de 0
#block[
#set enum(numbering: "1.", start: 2)
+ Voici la syntaxe d’une fonction Python qui calcule le score d’une
liste L de longueur n :
]
```python
def calcul_score(L, n):
score = 0
for i in range(1, n):
if L[i] > L[i-1]:
score += 1
return score
```
#block[
#set enum(numbering: "1.", start: 3)
+
]
- Pour une liste triée par ordre croissant, le score est 0. Par exemple,
pour $n eq 5$, la liste $lr([1 comma 2 comma 3 comma 4 comma 5])$ a un
score de 0.
- Pour une liste triée par ordre décroissant, le score est $n minus 1$.
Par exemple, pour $n eq 5$, la liste
$lr([5 comma 4 comma 3 comma 2 comma 1])$ a un score de 4. On peut
voir que dans le pire des cas, il y a au moins une inversion entre
chaque paire de cartes, sauf pour la première et la dernière.
#block[
#set enum(numbering: "1.", start: 4)
+
]
#block[
#set enum(numbering: "a.", start: 1)
+ On peut construire une liste de score $k$ en commençant avec une liste
triée, puis en échangeant les cartes $i$ et $i plus 1$ pour les $k$
premières paires de cartes (c’est-à-dire pour $i eq 0$ à
$i eq k minus 1$). Par exemple, pour $n eq 4$ et $k eq 2$, on peut
construire la liste $lr([1 comma 3 comma 2 comma 4])$ qui a un score
de 2. On peut vérifier qu’il y a bien deux inversions dans cette liste
: (1,3) et (3,2).
+ Il est possible de trouver deux listes de longueur $n$ et de score $k$
si et seulement si $k eq.not n slash 2$. En effet, si
$k eq n slash 2$, alors pour chaque inversion, il y a exactement une
autre inversion correspondante, c’est-à-dire que si on échange les
positions de deux cartes pour enlever une inversion, on en rajoute une
autre. Donc on ne peut pas atteindre un score différent. Pour tout
autre $k$, on peut construire deux listes en appliquant l’algorithme
de l’étape a. à deux listes triées différentes.
]
#block[
#set enum(numbering: "1.", start: 5)
+ On a déjà trouvé que $L_n lr((0)) eq 1$ et $L_n lr((n minus 1)) eq 1$
dans les exemples de listes triées par ordre croissant et décroissant.
+
]
#block[
#set enum(numbering: "a.", start: 1)
+ On a vu dans la question 1.b. que $L_3 lr((0)) eq 1$,
$L_3 lr((1)) eq 3$ et $L_3 lr((2)) eq 2$. Pour insérer la carte 4 dans
la liste $lr([3 comma 1 comma 2])$ pour obtenir un score de 1, on peut
la placer à la deuxième position pour obtenir la liste
$lr([3 comma 4 comma 1 comma 2])$.
+ Pour insérer la carte 4 dans la liste $lr([3 comma 2 comma 1])$ pour
obtenir un score de 0, on doit la placer à la fin pour obtenir la
liste $lr([3 comma 2 comma 1 comma 4])$.
+ On peut construire une liste de score 1 pour $L_4$ en insérant la
carte 4 dans une liste de score 1 pour $L_3$ de deux manières
différentes :
]
- En insérant la carte 4 à la fin de la liste de score 1 pour $L_3$, par
exemple $lr([3 comma 2 comma 4 comma 1])$.
- En insérant la carte 4 entre les deux cartes de la liste de score 1
pour $L_3$, par exemple $lr([3 comma 4 comma 2 comma 1])$. On peut
vérifier que ces deux listes ont un score de 1 pour $L_4$. On peut
aussi construire une liste de score 1 pour $L_4$ en insérantla carte 4
dans une liste de score 0 pour $L_3$ de trois manières différentes :
- En insérant la carte 4 à la fin de la liste de score 0 pour $L_3$, par
exemple $lr([3 comma 2 comma 1 comma 4])$.
- En insérant la carte 4 à la première position de la liste de score 0
pour $L_3$, par exemple $lr([4 comma 3 comma 2 comma 1])$.
- En insérant la carte 4 entre les deux premières cartes de la liste de
score 0 pour $L_3$, par exemple $lr([3 comma 4 comma 2 comma 1])$. On
peut vérifier que ces trois listes ont un score de 1 pour $L_4$. En
utilisant ces observations, on peut écrire une relation de récurrence
pour $L_n lr((1))$ :
$ L_n lr((1)) eq 2 L_(n minus 1) lr((1)) plus lr((n minus 1)) L_(n minus 1) lr((0)) $
#block[
#set enum(numbering: "a.", start: 4)
+ Pour tout entier naturel $n gt.eq 3$, on peut construire une liste de
score 1 pour $L_(n plus 1)$ en insérant la carte $n plus 1$ dans une
liste de score 1 pour $L_n$ de deux manières différentes :
]
- En insérant la carte $n plus 1$ à la fin de la liste de score 1 pour
$L_n$.
- En insérant la carte $n plus 1$ entre les deux cartes de la liste de
score 1 pour $L_n$. On peut vérifier que ces deux listes ont un score
de 1 pour $L_(n plus 1)$. En utilisant ces observations, on peut
écrire une relation de récurrence pour $L_(n plus 1) lr((1))$ :
$ L_(n plus 1) lr((1)) eq 2 L_n lr((1)) plus n L_n lr((0)) $
#block[
#set enum(numbering: "a.", start: 5)
+ Pour tout entier naturel $n gt.eq 3$ et pour tout entier naturel $k$
non nul, on peut construire une liste de score $k$ pour $L_(n plus 1)$
en insérant la carte $n plus 1$ dans une liste de score $k$ pour $L_n$
de deux manières différentes :
]
- En insérant la carte $n plus 1$ à la fin de la liste de score $k$ pour
$L_n$.
- En insérant la carte $n plus 1$ entre deux cartes consécutives de la
liste de score $k$ pour $L_n$. On peut vérifier que ces deux listes
ont un score de $k$ pour $L_(n plus 1)$. Donc on a la relation de
récurrence suivante :
$ L_(n plus 1) lr((k)) eq L_n lr((k)) plus k L_n lr((k minus 1)) plus lr((n minus k)) L_n lr((k)) $
#block[
#set enum(numbering: "a.", start: 6)
+ Voici le tableau des valeurs de $L_n lr((k))$ pour
$n in brace.l 3 comma 4 comma 5 brace.r$ et
$k in brace.l 0 comma 1 comma 2 comma 3 comma 4 brace.r$ :
$ & k eq 0 & k eq 1 & k eq 2 & k eq 3 & k eq 4\
n eq 3 & 1 & 3 & 2 & minus & minus\
n eq 4 & 1 & 4 & 5 & 2 & minus\
n eq 5 & 1 & 5 & 9 & 9 & 2\
$
]
Partie 1:
+ Pour un polynôme de la forme $P lr((x)) eq x^2 plus b x plus c$, où
$b$ et $c$ sont des réels, les coefficients $b$ et $c$ peuvent être
exprimés en fonction des racines $r_1$ et $r_2$ du polynôme. On a:
$b eq minus lr((r_1 plus r_2))$
$c eq r_1 r_2$
+ Si $b lt.eq 0$ et $c gt.eq 0$, alors on peut dire que les racines
$r_1$ et $r_2$ du polynôme sont de signes opposés. Cela est dû au fait
que la somme des racines est donnée par $r_1 plus r_2 eq minus b$, et
puisque $b lt.eq 0$, cela implique que $r_1 plus r_2 gt.eq 0$. De
plus, le produit des racines est donné par $r_1 r_2 eq c$, et puisque
$c gt.eq 0$, cela signifie que $r_1$ et $r_2$ ne peuvent pas être tous
les deux négatifs ou tous les deux positifs. Par conséquent, $r_1$ et
$r_2$ doivent être de signes opposés.
Partie 2:
+ #block[
#set enum(numbering: "a.", start: 1)
+ Si le triplet $lr((x_1 comma x_2 comma x_3)) in bold(Z)^3$ est une
solution de l’équation (E), alors en prenant les valeurs absolues
des éléments du triplet, on obtient
$lr((lr(|x_1|) comma lr(|x_2|) comma lr(|x_3|)))$. Puisque le carré
d’un nombre réel est positif ou nul, la substitution de $x_1$, $x_2$
et $x_3$ par leurs valeurs absolues ne change pas l’équation. Donc,
$lr((lr(|x_1|) comma lr(|x_2|) comma lr(|x_3|)))$ est également une
solution de l’équation (E).
+ En supposant l’existence d’un triplet d’entiers relatifs solution de
l’équation (E), différent de $lr((0 comma 0 comma 0))$, alors il
existe un triplet d’entiers naturels différent de
$lr((0 comma 0 comma 0))$ qui est également une solution de
l’équation (E). Cela découle du fait que prendre les valeurs
absolues des éléments d’une solution ne change pas le fait que c’est
une solution, et les valeurs absolues des entiers relatifs sont des
entiers naturels.
]
+ Si le triplet $lr((x_1 comma x_2 comma x_3)) in bold(Z)^3$ est une
solution de l’équation (E), alors le triplet
$lr((x_2 comma x_1 comma x_3))$ est également une solution de
l’équation. Cela peut être démontré en remplaçant les variables dans
l’équation (E) par leurs nouvelles valeurs:
$x_2^2 plus x_1^2 plus x_3^2 eq alpha x_2 x_1 x_3$
Donc, le triplet $lr((x_2 comma x_1 comma x_3))$ vérifie également
l’équation (E).
+ Si l’équation (E) admet une solution dans $bold(Z)^3$ différente du
triplet $lr((0 comma 0 comma 0))$, alors elle admet une solution
$lr((x_1 comma x_2 comma x_3))$ dans $bold(N)^3$ différente du triplet
$lr((0 comma 0 comma 0))$ et telle que $x_1 lt.eq x_2 lt.eq x_3$.
Cette conclusion découle du fait que si une solution existe, on peut
réarranger les éléments du triplet de manière croissante tout en
restant une solution de l’équation (E).
Partie 3:
+ Pour le triplet $lr((x_1 comma x_2 comma x_3))$ qui est une solution
de l’équation (E), si $x_1 lt.eq x_2 lt.eq x_3$, alors on peut montrer
que $x_1 gt 0$. Supposons par l’absurde que $x_1 lt.eq 0$. Alors, le
terme $x_1^2$ serait soit nul, soit négatif. Cependant, puisque
$x_2^2$ et $x_3^2$ sont tous deux positifs (car ce sont des carrés),
l’équation $x_1^2 plus x_2^2 plus x_3^2 eq alpha x_1 x_2 x_3$ ne
serait pas satisfaite. Par conséquent, nous devons avoir $x_1 gt 0$.
+ On définit la fonction $Q$ de $bold(R)$ dans $bold(R)$ par
$Q lr((x)) eq x^2 minus alpha x_1 x_2 x plus x_1^2 plus x_2^2$. Pour
montrer que $lr((x_1 comma x_2 comma y))$ est un triplet d’entiers
naturels solution de l’équation (E), il suffit de montrer que $y$ est
une racine de $Q$.
#block[
#set enum(numbering: "a.", start: 1)
+ En remplaçant $x_3$ par $y$ dans l’équation (E), on obtient
$x_1^2 plus x_2^2 plus y^2 eq alpha x_1 x_2 y$. Cela peut être
réarrangé comme suit:
$x_1^2 plus x_2^2 plus y^2 minus alpha x_1 x_2 y eq 0$. En comparant
avec la fonction $Q lr((x))$, nous voyons que si $y$ est une racine
de $Q$, alors $lr((x_1 comma x_2 comma y))$ est une solution de
l’équation (E).
+ Une première racine de $Q$ peut être obtenue en substituant
$x eq x_2$ dans $Q lr((x))$. Nous obtenons alors
$Q lr((x_2)) eq lr((3 minus alpha x_1)) x_2^2 plus lr((x_1^2 minus x_2^2))$.
+ Pour montrer que $Q lr((x_2)) lt 0$, nous devons montrer que le
coefficient devant $x_2^2$ est négatif. Cela signifie que
$3 minus alpha x_1 lt 0$, ce qui est vrai puisque
$alpha gt n gt.eq 2$ et $x_1 gt 0$. De plus, puisque
$x_1^2 minus x_2^2$ est négatif (car $x_1 lt.eq x_2$), nous pouvons
conclure que $Q lr((x_2)) lt 0$.
+ Le signe de $Q lr((0))$ est donné par
$Q lr((0)) eq x_1^2 plus x_2^2$. Puisque $x_1$ et $x_2$ sont des
entiers naturels non nuls, le terme $x_1^2 plus x_2^2$ est
strictement positif.
+ Pour montrer que $Q$ a deux racines distinctes, nous devons montrer
qu’il existe une autre racine $y$. Puisque $Q lr((0)) gt 0$ et
$Q lr((x_2)) lt 0$, il existe un réel $y$ tel que $0 lt y lt x_2$ et
$Q lr((y)) eq 0$. De plus, puisque $Q lr((x_2)) lt 0$ et
$Q lr((0)) gt 0$, la fonction $Q$ change de signe entre $y$ et
$x_2$, ce qui garantit qu’il existe une racine distincte dans cet
intervalle.
+ Puisque $y$ est une racine de $Q$, le triplet
$lr((x_1 comma x_2 comma y))$ est une solution de l’équation (E) et
est également un triplet d’entiers naturels différent de
$lr((0 comma 0 comma 0))$.
]
+ En utilisant le raisonnement de la question 2 et en remplaçant le
triplet solution $lr((x_1 comma x_2 comma x_3))$ par le triplet
$lr((x_1 comma x_2 comma y))$ (où $y$ est la deuxième racine de $Q$),
on peut conclure que si l’équation (E) admet une solution différente
de $lr((0 comma 0 comma 0))$, alors elle admet une solution
$lr((x_1 comma x_2 comma y))$ dans $bold(N)^3$ différente de
$lr((0 comma 0 comma 0))$ et telle que $x_1 lt.eq x_2 lt.eq y$.
+ En poursuivant ce raisonnement, on peut répéter l’étape précédente et
montrer qu’il existe une autre racine $z$ de $Q$ telle que
$x_1 lt.eq x_2 lt.eq y lt.eq z$. On peut continuer ainsi pour obtenir
une séquence infinie d’entiers naturels strictement croissante
$x_1 comma x_2 comma y comma z comma dots.h$. Cela conduit à une
contradiction car il ne peut exister une séquence infinie strictement
croissante d’entiers naturels. Par conséquent, l’hypothèse initiale
selon laquelle il existe un triplet d’entiers naturels différent de
$lr((0 comma 0 comma 0))$ solution de l’équation (E) est fausse.
+ En conclusion, nous avons démontré que pour tout $n in bb(N)$ et
$alpha in bb(N)$ avec $alpha gt n gt.eq 2$, l’équation
$x_1^2 plus dots.h.c plus x_n^2 eq alpha x_1 dots.h x_n$ n’admet pas
de $n$-uplet d’entiers relatifs solution autre que
$lr((0 comma 0 comma dots.h comma 0))$.
|
|
https://github.com/TypstApp-team/typst | https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/bugs/equation-numbering-reference.typ | typst | Apache License 2.0 | // In this bug, the hint and error messages for an equation
// being reference mentioned that it was a "heading" and was
// lacking the proper path.
// Ref: false
---
#set page(height: 70pt)
$
Delta = b^2 - 4 a c
$ <quadratic>
// Error: 14-24 cannot reference equation without numbering
// Hint: 14-24 you can enable equation numbering with `#set math.equation(numbering: "1.")`
Looks at the @quadratic formula. |
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/bugs/subelement-panic_02.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
//
// // #2328
// // Error: 4-43 footnote entry must have a location
// // Hint: 4-43 try using a query or a show rule to customize the footnote instead
// HI#footnote.entry(clearance: 2.5em)[There] |
https://github.com/linsyking/messenger-manual | https://raw.githubusercontent.com/linsyking/messenger-manual/main/main.typ | typst | // Dark mode for debugging
// #set page(fill: rgb("444352"))
// #set text(fill: rgb("fdfdfd"))
#set text(
size: 12pt
)
#show link: it => {set text(blue); underline(it)}
#set par(
justify: true,
leading: 1em,
first-line-indent: 2em,
)
#show heading: it => {it;text()[#v(0.3em, weak: true)];text()[#h(0em)]}
#set heading(numbering: "1.")
// #show regex("\b[Ss]cenes?\b"): it => {text(fill: purple, it)}
// #show regex("\b[Ll]ayers?\b"): it => {text(fill: eastern, it)}
// #show regex("\b[Cc]omponents?\b"): it => {text(fill: green, it)}
#line(start: (0%, 10%), end: (8.5in, 10%), stroke: (thickness: 2pt))
#align(horizon + left)[
#text(size: 32pt, "Messenger Manual")\
#v(1em)
#text(size: 16pt, "A Game Engine for Elm")
#v(10em)
FOCS Messenger Team
]
#align(bottom + right)[#datetime.today().display()]
#pagebreak()
#outline(depth: 2, indent: auto)
#pagebreak()
#align(horizon + center)[
#text(size: 32pt, "User Guide")\
#v(1em)
#text(size: 16pt, "Exploring the features of Messenger", style: "italic")
]
#pagebreak()
#set page(
paper: "us-letter",
header: text()[*Messenger: A Game Engine for Elm*],
number-align: center,
numbering: "1"
)
#include "intro.typ"
#include "hello world.typ"
#include "render.typ"
#include "event.typ"
#include "component.typ"
#include "transition.typ"
#include "sceneproto.typ"
#include "advanced.typ"
#include "appendix.typ"
#pagebreak()
#align(horizon + center)[
#text(size: 32pt, "Developer Guide")\
#v(1em)
#text(size: 16pt, "Implementation details of Messenger", style: "italic")
]
#include "generalmodel.typ" |
|
https://github.com/mattfbacon/aswvc-bylaws-and-constitution | https://raw.githubusercontent.com/mattfbacon/aswvc-bylaws-and-constitution/main/doc.typ | typst | #let font-size = 12pt
#let line-height = 0.7em
#set page(paper: "us-letter", margin: 1in)
#set text(font: ("Times New Roman", "Liberation Serif"), size: font-size)
#set par(leading: line-height, linebreaks: "optimized")
#show par: set block(spacing: line-height)
#set grid(gutter: line-height)
#show heading: it => align(center, it)
#show heading.where(level: 2): set block(above: 2em)
#show heading: it => text(size: font-size, it)
#let enum-nest-to-string(l) = numbering("1.1a.i.1", ..l).trim()
#let enum-nest-counter = state("enum-nest")
#let enum-numberings = ("1.", "a.", "i.", "1.")
#show enum: it => enum-nest-counter.display(nest => block(inset: (left: if nest.len() > 1 { 2em } else { 0em }, rest: 0pt), spacing: 0pt, {
for (i, child) in it.children.enumerate(start: 1) {
block(spacing: line-height, {
{
show heading: none
heading(level: nest.len() + 2, enum-nest-to-string(nest + (i,)))
}
[*#numbering(enum-numberings.at(nest.len() - 1), i)* ]
enum-nest-counter.update(v => v + (i,))
child.body
enum-nest-counter.update(v => v.slice(0, -1))
})
}
}))
#show ref: it => locate(loc => {
let ref-label = it.target
let ref-loc = query(ref-label, loc).first().location()
let num = enum-nest-counter.at(ref-loc)
link(ref-label, enum-nest-to-string(num))
})
#let article-counter = counter(<article>)
#article-counter.step()
#let article(i, name) = [
#article-counter.update(v => { assert.eq(i, v, message: "Please fix the numbering for Article " + str(v) + ", " + str(name) + ", which is currently numbered incorrectly as Article " + str(i)); v })
#article-counter.display(v => [
#enum-nest-counter.update((v,))
== #[ARTICLE #numbering("I", v) (#v)\ #text(weight: "regular", underline(name)) <article>]
])
]
#show heading.where(level: 1): it => {
article-counter.update(1)
it
}
= Constitution of the Associated Students of West Valley College
== Preamble
We the students of West Valley College, in order to form an efficient, representative student government, to encourage greater student participation in the governance of West Valley College and the West Valley--Mission Community College District, to promote and direct those student activities which stimulate the intellectual, physical, and social life of our college, and to improve relations within the college community; do hereby establish this constitution and assume the powers and duties of self-government pursuant to policies of the Board of Trustees of the West Valley--Mission Community College District as authorized in Section 7606D of the California Educational Code.
#article(1, "Name")
+ The name of this organization shall be the Associated Students of West Valley College (ASWVC).
#article(2, "Conduct")
+ This organization and/or its members, while functioning as representatives of the ASWVC and/or the College shall be committed to a policy of non-discrimination, specifically, the ASWVC shall be not for profit, non-partisan, and the ASWVC shall be in compliance with West Valley--Mission Community College District Board policies regarding equal opportunity at all times.
#article(3, "Bylaws")
+ The bylaws of this Constitution shall be the lawful means whereby the purposes and principles of this Constitution shall be implemented.
#article(4, "Rules of Order")
+ Except as explicitly provided to the contrary in this constitution and its bylaws, the most current edition of Robert’s Rules of Order shall govern the procedures of the ASWVC.
#article(5, "Membership")
+ All registered students of West Valley College, whom have paid the Student Representation Fee or have had the aforementioned fee waived, shall be members of ASWVC and shall be entitled to all the privileges and rights thereof.
#article(6, "Organization")
+ The ASWVC will comprise an Executive Board and a Student Senate.
+ The ASWVC Executive Board shall consist of a President, Vice President, six (6) Directors, and a Student Trustee.
+ The requirements to hold office within the ASWVC shall be enumerated in the Bylaws of this constitution.
+ All ASWVC Executive Board members and Student Senate members must be elected into office, as outlined within the Bylaws of this constitution.
#article(7, "Constitutional Amendments")
+ This Constitution may be amended by referendum from the Student Senate in a special Election submitted to the ASWVC Senate, provided that:
+ Constitutional amendments shall be publicly posted and announced in a regular meeting of the ASWVC Senate, as outlined in the bylaws of this constitution, for at least fourteen (14) consecutive calendar days immediately prior to the election.
+ Adoption of amendments to this Constitution shall require two-thirds (2/3) favorable vote of those legal ballots cast in an election of the ASWVC.
+ A legal ballot shall be defined as a physical or electronic document that includes a form of identification—used to prevent miscount of the votes—as well as the voting members declaration of either yea or nay for the proposed amendment.
+ Said legal ballot must be easily accessible for one (1) year after the voting process to future Executive Board Members for the purpose of record keeping
+ Voting may be conducted through a physical document created by the ASWVC Executive Board
+ Voting may be conducted through electronic means
+ A student may only vote once (1), either yea or nay, for the proposed constitutional amendment.
+ The voting period on the suggested constitutional amendment shall remain open for a minimum of ten (10) days.
+ Adoption of amendments to this constitution shall be effective immediately upon certification of the election results by the ASWVC Advisor.
== Constitutional Amendment Log
#grid(columns: (8em, 1fr), row-gutter: 2 * line-height,
[January 1984],[Adoption of Constitution],
[August 1993],["treasure" typo corrected],
[December 1994],[Name Change, ASBWVC to ASWVC],
[December 1994],[Article VI, Section 1, Clause 1, 10% changed to 5% 12/94 Rules of Order change Sturgis to Roberts],
[September 2007],[Constitution Retyped],
[April 2016],[Name Changed from Associated Student Organization to Associate Student of West Valley College (ASWVC), Positions within ASWVC redefined, and Constitution Retyped],
[March 2023],[Article I, Associated Students at West Valley College changed to Associated Students of West Valley College \
Article VI, Section 2, The ASWVC Executive Board shall consist of a President, three (3) Vice Presidents, and a Student Trustee changed to The ASWVC Executive Board shall consist of a President, Vice President, six (6) Directors, and a Student Trustee. \
Article VII, Section 1, Clause 1, Constitutional amendments shall be publicly posted, as outlined in the bylaws of this constitution for at least fourteen (14) consecutive calendar days immediately prior to the election changed to Constitutional amendments shall be publicly posted and announced in a regular meeting of the ASWVC Senate, as outlined in the bylaws of this constitution, for at least fourteen (14) consecutive calendar days immediately prior to the election. \
Article VII, Section 1, Clause 2, Section 1 added. \
Article VII, Section 1, Clause 2, Section 1, Subsection A added. \
Article VII, Section 1, Clause 2, Section 2 added. \
Article VII, Section 1, Clause 2, Section 3 added. \
Article VII, Section 1, Clause 2, Section 4 added.],
[October 2023],[Retyped],
)
#pagebreak(weak: true)
= Bylaws of the\ Associated Students of West Valley College
#article(1, "Legal Statutes")
+ All senate business shall be conducted in accordance with the Brown Act. This includes, but is not limited to: all meetings, all notices, all agendas and the rights of the public.
#article(2, "Membership")
+ Members of the Associated Students of West Valley College (ASWVC) are outlined in Article V Section I of the ASWVC Constitution.
+ Non-voting (Ex Officio) members of the ASWVC shall include but not be limited to the ASWVC Advisor.
#article(3, "Executive Board")
+ The Executive Board consists of the ASWVC President, Vice President, Director of Finance, Director of Marketing, Director of Records, Director of Student Engagement, Director of External Operations, Director of Club Relations, and a Student Trustee.
+ The Executive Board’s term of office shall end on the last day of the Spring Semester.
The newly elected Executive Board shall assume office on the following academic day of Summer Session.
+ With the exception of the Student Trustee, whose term shall begin and end in accordance with the Board of Trustees.
#article(4, "Meetings")
+ For guidelines on parliamentary procedure, ASWVC will use Robert's Rules of Order in all meetings, except in the cases where these bylaws or other special rules conflict, or Robert’s Rules are suspended as shown in Article IV Section 2.
+ These rules may be suspended by article and section by a two-thirds (2/3) majority vote of the voting members present.
+ Suspension of rules shall apply only to the meeting during which the vote was taken.
+ The regular ASWVC Senate meetings will be held on Tuesdays and as written in the agenda of the previous meeting, commencing the first week of the semester and ending the week prior to finals.
+ The regular ASWVC Executive Board meetings will be held on Thursdays and as written in the agenda of the previous meeting, commencing the first week of the semester and ending the week prior to finals.
+ All regular meetings of the ASWVC, excluding committee meetings, shall be held following ample (minimum 72 hours) notification by posting the agenda, which includes the meeting time and location, in accordance with the Brown Act.
+ Any regular meeting still in session after two (2) hours of the day on which it began shall immediately adjourn, unless the ASWVC extends the meeting (for a specified amount of time) by a two thirds (2/3) favorable vote of the members present and voting.
+ Regular meetings of the ASWVC Senate shall not be held during Summer Session and Winter Session of West Valley College.
+ Meeting Norms
+ Each speaker shall be formally recognized by the acting Chairperson.
+ Debate on each item being considered by the Senate shall be limited to fifteen (15) minutes unless otherwise specified by a motion that is passed by a majority vote.
+ Debate shall be extended ten (10) minutes at a time.
+ Meetings of the ASWVC shall be open to the general public. Meetings shall be closed to the public only when personnel matters are being considered.
+ All legislation presented to the Senate shall be presented on the floor of the Senate, with the reading of the legislation to be followed by a motion and a second for the adoption of the legislation.
+ Meeting Agendas and Minutes
+ Items to be placed on the agenda shall be submitted to the appropriate Chairperson at least 72 hours prior to the meeting.
+ All ASWVC meeting minutes will be made available to the public within 72 hours prior to the next meeting.
+ Quorum must be established to take vote on any items, which is defined as 51% of active members with voting rights.
+ Special or emergency meetings may be called by any ASWVC Executive Officer or by a majority of the currently voting Senators.
+ A special or emergency meeting can only be called in accordance with the Brown Act and must follow all Brown Act requirements.
+ If an Officer or Senator has class at the time of the special or emergency meeting, the student will be excused with no repercussion for attendance for regularly scheduled meetings.
+ All special or emergency meetings must be presided in the same manner as regular meetings.
#article(5, "Voting Rights")
+ Senate voting privileges are limited to ASWVC Senators, Director of Finance, Director of Marketing, Director of Records, Director of Student Engagement, Director of External Operations, Director of Club Relations, and the Student Trustee.
+ The ASWVC Vice President can vote only in the event of a tie.
+ The ASWVC President has the power of veto, but has no vote in the Senate.
+ Executive Board voting privileges are limited to the ASWVC Vice President, Director of Finance, Director of Marketing, Director of Records, Director of Student Engagement, Director of External Operations, Director of Club Relations, and the Student Trustee.
+ The ASWVC President can vote only in the event of a tie.
+ As a voting member of the ASWVC Senate, any Senators running for candidacy in an ASWVC Vacancy Process maintain the right to vote for themselves when presented to the ASWVC Senate for a roll call vote.
+ All voting members maintain the right to only vote once (1).
#article(6, "Requirements for Executive Board Officers")
+ Grade Point Average (GPA) Requirements
+ All Executive Board members must have a 2.0 cumulative GPA and maintain a 2.0 GPA during their time in Office.
+ New students to West Valley College without any completed units will have the GPA requirement waived until their first completed semester.
+ All officers must be enrolled in five (5) or more units at the time of their election and during their time in office or they will be automatically removed at the next regular ASWVC meeting.
+ All Executive Board members must remain in good standing with the West Valley College Student Code of Conduct, as well as all West Valley College Campus Policies and West Valley College Board Policies.
+ If a candidate in a regular ASWVC Election or ASWVC Vacancy Process is in violation of the West Valley College Student Code of Conduct, their candidacy may be immediately removed.
+ If an Executive Board member is in violation of the West Valley College Student Code of Conduct, they may be immediately removed from office.
+ All Executive Board members must be in consistent attendance and have no existing scheduling conflicts with all regular ASWVC Senate meetings and ASWVC Executive Board meetings throughout the entirety of the academic school year.
#article(7, "ASWVC Executive Board Officers Accountability")
+ Conditions of Office
+ No student may hold more than one permanent ASWVC position, unless circumstances deem it "urgent and necessary," with a two-thirds (2/3) favorable vote of the Senate.
+ A student may not be elected or appointed to the same Executive Board position for more than two (2) consecutive years.
+ A student may not serve on the Executive Board for more than three (3) years within a five (5) year period.
+ For purposes of determining eligibility to continue in office, an officer who has served more than half a term is considered to have served a full term.
+ Absences and Tardiness for ASWVC-Sponsored Meetings and Events
+ For an excused absence, the ASWVC Senator or ASWVC Executive Board member must give adequate notice of being absent or be absent for an emergency or medical reason.
+ Adequate notice shall be defined as notifying the respective meeting Chair 72 hours in advance of the meeting at which the ASWVC Senator or ASWVC Executive Board member cannot be in attendance.
+ If an Executive Board Officer is unable to attend an event for a non-emergency related matter such as a schedule conflict, the Executive Board Officer shall communicate that absence to the ASWVC President 72 hours in advance. This shall be considered an excused absence.
+ If an Executive Board Officer is unable to attend a Senate or Committee Meeting, they shall communicate their absence 72 hours in advance to the Vice President.
+ If an Executive Board Officer is unable to attend an Executive Board Meeting, they shall communicate their absence 72 hours in advance to the President.
+ All other absences shall be considered unexcused.
+ In the event that the Officer has had five (5) unexcused absences, it is recommended that the Executive Board submit a “Vote of No Confidence” to the ASWVC Senate for that Executive Board Officer.
+ Two (2) instances of tardiness shall equal (1) unexcused absence. For the purpose of calculating absences, tardiness is defined as arriving after the roll call or after the posted start time of an ASWVC-Sponsored Event.
+ Two (2) excused absences shall equal (1) unexcused absence.
+ Paid Hours
+ All ASWVC officers shall post and hold a minimum of three (3) “Office Hours” per week on behalf of the students that must be spent in their ASWVC office.
+ All ASWVC officers shall post and hold a minimum of three (3) “Work Hours” per week that must be spent on West Valley College’s Campus.
+ Three (3) instances of an officer failing to hold these hours, as posted, shall equal one (1) absence, unless excused by the President (or the Presiding Officer if the President is not available).
+ The President, Vice President, Director of Student Engagement, and Director of Records shall keep a public record of all unexcused and excused absences for Executive Board Officers.
#article(8, "Executive Board Election Process")
+ The Election Committee shall be composed of the President (or designee if the President is running for a position), ASWVC Advisor, and members appointed by the Vice President.
+ The purpose of this committee will be to plan and communicate the election timeline, provide platforms for candidates to campaign to the student body, and ensure compliance with the rules outlined in this article and fair election procedures in general.
+ Members of the Election Committee shall not run for a position.
+ This committee shall not be a standing committee.
+ Prospective candidates must submit an application for consideration by the Election Committee by the specified deadline.
+ Notification of officer position openings is to be provided to all students and shall contain the following: position title, description of the job, term of office, deadline for the application, phone number, address or building number for further information, and requirements for the position.
+ In the event that there are no applications submitted, the Election Committee may extend the application deadline for that position.
+ A student may apply for only one position during an election process.
+ Committee members shall consider all applications as private and confidential information during the formal screening process. Discussion of a candidate's information shall remain confidential between the committee and the said candidate.
+ The ASWVC Advisor shall retain all applications for one academic year, after which they may be destroyed.
+ The election timeline, including notification of the results, shall be provided by the Election Committee before the election.
+ The application for candidacy shall be open for a minimum of ten (10) days. The voting for candidates shall take place for five (5) business days.
+ Elections will be conducted among all currently enrolled West Valley Students.
+ Elections may be conducted via electronic software.
#article(9, "Vacancies in the Executive Board")
+ If a position, other than President, is vacated for any reason, the ASWVC Senate shall fill the position by a majority vote.
+ In the event of an absence in the office of the President, the line of succession shall be as follows: Vice President, Director of Finance, Director of Student Engagement, Director of Marketing, Director of Records, Director of External Operations, Director of Club Relations, Student Trustee.
+ All vacancies shall be posted for a minimum of seven (7) days, in the same manner as the ASWVC meeting agendas.
+ To apply, students shall submit an application for the open position.
+ Before being appointed, candidates must be interviewed by the Executive Board at an Executive Board meeting.
+ The Executive Board will then forward two candidates to face off in a regular meeting of the ASWVC Senate for consideration.
+ In the event that only one student applies for any position, the Executive Board may put forth only one candidate to the Senate.
+ Regardless of the number of candidates forwarded, the options for consideration shall include "No Confidence".
+ The successor to any position vacated will be appointed by a majority of the Senate.
+ Any position filled by the Senate shall be for the remaining period of office in said term.
#article(10, "Vote of No Confidence")
+ Grounds for removal of office of a Senator or Executive Board Officer shall be limited to malfeasance, misfeasance, and nonfeasance.
+ If a Senator or Executive Board officer has been found in violation of the Student Code of Conduct, they may be immediately removed by the College Conduct Officer without a Vote of No Confidence.
+ Removal of Senators and Executive Officers by a Vote of No Confidence
+ Any member of the Senate with active voting rights has the right to request a Vote of No Confidence.
+ The subject of a Vote of No Confidence is limited to Senators and Executive Board Officers.
+ The request for a Vote of No Confidence must be lodged in an open, regularly scheduled meeting of the Senate.
+ A Vote of No Confidence shall be requested by a voting member of the Senate under Public Comments.
+ The Vote of No Confidence shall be taken at the next scheduled meeting after the initial request.
+ A two-thirds (2/3) vote of the Senate members present and voting shall be necessary to qualify as a "Vote of No Confidence."
+ Should the Vote of No Confidence be put forth against a voting member of the ASWVC Senate or the ASWVC Executive Board, that individual does not retain the right to vote in their own Vote of No Confidence.
+ A Vote of No Confidence shall result in removal of office and loss of voting rights.
+ A Vote of No Confidence is not subject to a presidential veto.
+ Any subject of a successful Vote of No Confidence has the right to appeal to the ASWVC Advisor within five (5) business days.
#article(11, "Committees")
+ The Vice President shall have the ability to appoint individuals to any Ad Hoc committees.
+ The Bylaws Committee shall be composed of the Vice President and at least three additional Senate members. The Director of Records or their designee shall serve as an Ex-Officio member of the committee for minute recording purposes.
+ The Vice President shall serve as the Chairperson or assign a designee to do so.
+ The Bylaws Committee shall certify that the ASWVC Bylaws are applicable and up to date.
+ The Bylaws Committee shall meet at least every two weeks while the ASWVC Senate is active.
+ The Budget and Finance Committee shall be composed of the Director of Finance, and at least three additional Senate members. The Director of Records or their designee shall serve as an Ex-Officio member of the committee for minute recording purposes.
+ The Director of Finance shall serve as the Chairperson or assign a designee to do so.
+ The Budget and Finance Committee shall certify the ASWVC Financial Code is enforced and up to date, reviewing budget proposals, and reviewing purchases made by the ASWVC.
+ The Budget and Finance Committee shall meet at least every two weeks while the ASWVC Senate is active.
+ The Outreach Committee is to be a standing internal committee of the ASWVC and be composed of the Director of Marketing and at least three additional Senate Members. The Director of Records or their designee shall serve as an Ex-Officio member of the committee for minute recording purposes.
+ The Director of Marketing shall serve as the Chairperson or assign a designee to do so.
+ The Outreach Committee shall create and execute marketing plans for ASWVC-sponsored Events.
+ The Outreach Committee shall meet at least every two weeks while the ASWVC Senate is active.
+ The Activities Committee is to be a standing internal committee of the ASWVC and be composed of the Director of Student Engagement, Director of External Operations, and three additional Senate Members. The Director of Records or their designee shall serve as an Ex-Officio member of the committee for minute recording purposes.
+ The Director of Student Engagement shall serve as the Chairperson or assign a designee to do so.
+ The Activities Committee shall brainstorm and schedule events for the ASWVC to host.
+ The Activities Committee shall meet at least every two weeks while the ASWVC Senate is active.
+ In the event of a dispute, the Bylaws Committee shall determine the interpretation of the ASWVC Constitution and Bylaws.
+ If the Bylaws Committee is not set to convene for a regularly scheduled committee meeting within five (5) business days, then the committee shall be required to convene for an emergency meeting within that period in order to resolve the dispute.
+ The Bylaws Committee shall define the premise for the directive in question and consider suggestions made by attending members at said meeting to resolve the dispute.
#article(12, "Senator Requirements")
+ Any student who is currently registered for credit at West Valley College, has passed the Parliamentary Procedure test, and has attended and signed in as a guest on the Senate Meeting Guest Sign-In Sheet for two (2) Senate Meetings will be granted voting rights at the beginning of the student’s third Senate meeting. <to-become-senator>
+ Any Senator who has two (2) consecutive unexcused absences for regularly scheduled Senate meetings of ASWVC will have all rights and privileges, including voting, automatically suspended. All rights and privileges will be reinstated at the beginning of the student’s second consecutive regularly scheduled Senate meeting.
+ Attendance is defined as being present for at least 100% of the meeting or 1.25 hours, whichever is shorter.
+ Two (2) instances of tardiness shall equal (1) unexcused absence.
+ For the purpose of calculating absences, tardiness is defined as arriving five (5) minutes after the predetermined meeting time. Call to order must take place at most five (5) minutes after the predetermined meeting time.
+ Two (2) or more consecutive unexcused absences may be considered as nonfeasance.
+ For an excused absence, senators must give notice at least 72 hours in advance. With less than 72 hours of notice, absence can only be excused in cases of emergency.
+ Status of absence (excused or unexcused) is subject to approval.
+ Senators shall serve on at least one (1) internal committee, external committee, or ad-hoc committee at all times during the academic year, as such committees become available.
+ Senators shall serve on various committees as appointed by the ASWVC Vice President.
+ There is no regulatory limit on the number of committees that a Senator can be a member of.
+ Senators shall be an active member of their committee.
+ Senators deemed inactive in a committee by the majority of the Executive Board may have privileges and voting rights suspended or be removed from the Senate. Attendance and tardiness in committee meetings will be considered the same as senate meetings. Two (2) unexcused absences will result in a removal of voting rights. For the purposes of counting attendance, two (2) tardinesses will be considered an unexcused absence.
+ Senators must make at least two committee reports at a regular Senate meeting per semester.
+ Members of the Senate who serve as chairs of ASWVC internal committees shall be exempt from making at least two committee reports at a regular Senate meeting per semester.
+ Senators shall be an active member at ASWVC regular Senate meetings for the duration of the semester.
+ To qualify as an active Senator at the end of a semester, a Senator must attend at least 51% of ASWVC Senate meetings.
+ Senators have the right to request an excused leave of absence for up to one semester without penalty.
+ Senators must request the leave of absence before the first Senate meeting of the semester in question with details of the conflict and submit it in writing to the ASWVC Executive Board.
+ Requests must be reviewed by the ASWVC Executive Board before becoming active.
+ An excused leave of absence is allowed for up to one semester.
+ Any Senate meetings missed before the request for a leave of absence will be counted against the Senator’s attendance record.
+ Senators who miss two consecutive semesters will be required to repeat the steps laid out in @to-become-senator to be re-granted voting rights.
+ Should a Senator require a leave of absence after the first Senate meeting has passed, they should contact the current Vice President and decide upon further action.
#article(13, "Student Organizations and Funding Requests")
+ A student organization is any organization that organizes around a stated, legal, and authorized purpose.
+ Each student organization must consist of a President, three (3) additional student officers, and a faculty advisor to be recognized as an organization eligible for funding and other benefits from the ASWVC.
+ Proposed student organizations must register with West Valley College through an online or physical process prior to being eligible for funding or other benefits from ASWVC. This process is repeated each semester.
+ Campus Entity Funding
+ The ASWVC will entertain funding request for uses that will improve the student experience. Entities that may request funding include but are not limited to recognized clubs, students, student organizations, campus programs, departments and divisions of West Valley College, and staff, faculty and administration.
+ Funding requests must not exceed the allotted amount in the ASWVC Budget set by the Advisor and Director of Finance.
+ If the funding request exceeds the allotted amount, the budget may be amended to allocate additional funds for funding requests in general.
+ All funding of entities on campus by the ASWVC must be approved in a Budget and Finance committee meeting before being put forth to the Senate.
+ The campus entity requesting funding must submit an agenda request to the ASWVC Director of Finance seventy-two (72) hours before a regular committee meeting for any action to be taken on the funding request.
+ The campus entity must include in the agenda request a description of the purpose for which funding is needed as well as the dollar amount of funding needed.
+ A representative of the campus entity may attend and give a detailed report of proposed spending for each endeavor to the committee.
+ Student organizations must include in the detailed report of proposed spending the goods or services that need to be purchased, proof of the scheduled future event or endeavor, and an explanation of the dollar amount requested as it relates to the goods or services needed. Failure to include these items will result in an automatic denial of the funding request.
+ The Senate shall have the final deciding vote to approve or reject club funding requests and will vote on any funding requests approved by the Budget and Finance committee at a regular meeting of the Senate.
+ A representative of the campus entity must attend and give a detailed report of proposed spending for each endeavor at a regular meeting of the Senate under the standing action item, Club Funding Requests, prior to spending the funds requested.
+ All funding requests must be discussed and voted on in this standing Senate item to be considered allocated.
+ Campus entities must include in the detailed report of proposed spending the goods or services that need to be purchased, proof of the scheduled future event or endeavor, and an explanation of the dollar amount requested as it relates to the goods or services needed. Failure to include these items will result in an automatic denial of the funding request.
+ Campus entities must share a student attendance list with the ASWVC Director of Finance following each endeavor at which ASWVC funds shall be used specifically for reimbursements.
+ Campus entities must submit proof of the endeavor’s occurrence, such as an event flyer, to the ASWVC Director of Finance in order to receive reimbursements.
+ Campus entities must provide additional information as requested by the ASWVC Director of Finance or the ASWVC Advisor when spending or requesting any and all funds or receiving reimbursements.
+ Each entity capable of receiving funding shall start each semester with zero dollars (\$0) in allotted funding, with funds to be added on a rolling basis based on ASWVC approval or fundraising endeavors.
+ Student Organization Fundraisers
+ All fundraising proposals must be approved by the ASWVC Advisor.
+ A student organization representative must meet with and give a detailed report of the fundraising endeavour to the ASWVC Advisor.
+ Student organizations must submit proof of the fundraising endeavor’s occurrence to the ASWVC Advisor.
+ The ASWVC Advisor may deny any and all fundraising requests that are not equitable or allowed on the college campus at their discretion.
+ Executive Board Internal Funding
+ The Executive Board shall receive a dedicated pool of funding, the Executive Board Internal Funding Pool, allocated in the ASWVC budget for spending without the previously described process of approval through the Budget and Finance committee.
+ The amount should be determined based on the financial standing of the ASWVC and historical spending of the Executive Board from this pool.
+ The amount may be altered as necessary by an amendment to the budget.
+ Funding from this pool shall be used on items such as office supplies and equipment, meeting snacks, and temporary short-term borrowing pending full reimbursement via bonafide funding requests.
+ If it becomes apparent that any sanctioned student organization is failing to fulfill its stated objectives or obligations, a two-thirds (2/3) majority vote of the Senate present and voting may revoke the funding.
#article(14, "Executive Board")
+ Duties and Responsibilities by Office
+ President
+ Act as the Chief Executive Officer and official spokesperson of the ASWVC.
+ Serve as the Chairperson of the Executive Board.
+ Have the power to veto legislative actions of the ASWVC.
+ The President must exercise the option of veto within seven (7) days of the action by ASWVC.
+ The veto must be put on display as a public notice in the same manner as Senate meeting agendas for at least one week.
+ The veto may be overridden by a two-thirds (2/3) favorable vote of the voting membership of the ASWVC at a regular scheduled meeting within the next two (2) regular meetings following the posting and transmission of the veto.
+ Appoint temporary replacements for any vacancies, until a permanent replacement can be appointed.
+ Temporary replacements shall last six (6) weeks, or until the next ASWC Senate meeting, whichever is longer in duration. A permanent appointment shall be appointed by the end of this duration.
+ Serve as an Ex-Officio member on all ASWVC internal Committees.
+ Represent the ASWVC at the West Valley--Mission Community College District Board of Trustees meetings, or delegate a representative from the ASWVC.
+ Give a report to the ASWVC at every regular Senate meeting.
+ Attend, represent, and vote on behalf of ASWVC at all SSCCC Region IV Meetings or assign a designee to do so.
+ Give monthly reports of SSCCC of the California Community College meetings and business.
+ Act as liaison between local, state, and federal government and the ASWVC.
+ Inform the ASWVC of all government legislation that pertains to WVC.
+ Establish frequent communication with district administration.
+ Establish frequent communication with West Valley College students, faculty, and administration.
+ Coordinate with Student Services consistently throughout the year to discuss ASWVC activities and events.
+ Serve as the ASWVC representative to College Council or designate an ASWVC delegate.
+ Serve on the Graduation Committee or assign a designee to do so.
+ Serve on the Career & Internship Readiness Week Committee or assign a designee to do so.
+ Hold ASWVC Executive Board Officers accountable to the following requirements: <eboard-requirements>
+ Ten (10) hours of on-campus time dedicated to ASWVC activities
+ Attendance at all ASWVC-sponsored events
+ Attendance at all appropriate Executive Board, Senate, and Committee Meetings
+ Coordinate appropriate disciplinary actions with ASWVC Advisor and appropriate Executive Board Member if @eboard-requirements requirements are not followed.
+ Serve as Chairperson for the Elections Committee or assign a designee to do so if running for office for the following academic year.
+ Hold all Executive Board Members accountable to their responsibilities and recommend appropriate disciplinary action for any malfeasance.
+ Hold regularly scheduled meetings with appropriate Executive Board Members.
+ Review and approve event responsibilities assigned by the Director of Student Engagement to the Executive Board prior to events.
+ Represent the ASWVC at West Valley--Mission District Council meetings or assign a designee to do so.
+ Vice President
+ Perform the duties of the President in the event of their absence, disability, or removal from the office.
+ Serve as the Chairperson of the ASWVC Senate.
+ Serve on the Executive Board of the ASWVC.
+ Enforce all rules, regulations, and procedures passed by the ASWVC and/or stated in the ASWVC Constitution and Bylaws.
+ Maintain a record of all Senators with active voting rights.
+ Have the authority to delegate duties and responsibilities to all Senators.
+ Bring forth amendments to the ASWVC Constitution and Bylaws to the attention of the ASWVC Senate as needed.
+ Form and dissolve committees, organizations, and associations for specific purposes to conform to the bylaws contained herein.
+ Have authority to appoint Senators to help with programs, events, or any other ASWVC business.
+ Give a report to the ASWVC at every regular Senate meeting.
+ Attend, represent, and vote on ASWVC's behalf at all SSCCC Region IV Meetings as the alternate delegate or appoint a designee to do so.
+ Student Trustee
+ Inform the ASWVC of all actions of the West Valley--Mission Community College District Board of Trustees.
+ Serve on the Executive Board of the ASWVC.
+ Attend all West Valley--Mission Community College District Board of Trustees meetings.
+ Announce appropriate West Valley--Mission Community College District Board of Trustees agenda items to the ASWVC.
+ Make themselves informed about issues that have a direct or significant impact on students of the district or that are brought to the attention of the Student Trustee by any concerned students.
+ Gather student input and disseminate information by meeting at least once per month, school calendar permitting, at a scheduled meeting of the student government organization at their respective College and in other ways as appropriate.
+ Be subject to recall in the manner prescribed by the procedures established by the Board of Trustees.
+ Their external committee shall be the Board of Trustees meetings.
+ Give a report to the ASWVC at every regular Senate meeting.
+ Represent the ASWVC at West Valley--Mission District Council meetings or assign a designee to do so.
+ Director of Finance
+ Serve as Chairperson of the Budget and Finance Committee.
+ Perform and enforce all procedures outlined in the ASWVC Financial Code.
+ Serve on the Executive Board of the ASWVC.
+ Maintain the account for all ASWVC money on a day-to-day basis.
+ Submit a comprehensive monthly report of income, expenses, and state of reserves and progress of the budget of the ASWVC to the ASWVC Advisor.
+ Give a report every regular Senate meeting to the ASWVC of ASWVC financial status.
+ Keep records of decisions made in meetings.
+ Coordinate records with the ASWVC Advisor.
+ Submit all check requests and reimbursements.
+ Give a report to the ASWVC at every regular Senate meeting.
+ Director of Marketing
+ Facilitate communication between students and the ASWVC.
+ Serve as a member of the Executive Board of the ASWVC.
+ Keep students up to date on all issues affecting the campus community.
+ Produce a current monthly calendar of events and post the aforementioned calendar in a way that is easily and readily accessible to ASWVC student officers and West Valley students.
+ Provide weekly updates on events and legislation to the student body via ASWVC social media accounts.
+ Create and post flyers and advertisements.
+ All flyers and advertisements for an event should be prepared for distribution before the event is held.
+ Serve as the Chairperson of the Outreach Committee.
+ Give a report to the ASWVC at every regular Senate meeting.
+ Abide by the ASWVC Marketing Standards and Procedures.
+ Director of Records
+ Maintain all ASWVC records including agendas, minutes, committee records, an authenticated copy of the ASWVC Constitution, Bylaws, Codes, and all standing rules and orders of the ASWVC and ensure that said documents are available for reference and public inspection at all times.
+ Serve as a member of the Executive Board of the ASWVC.
+ Serve as an Ex-Officio member of all ASWVC internal committee meetings for record-keeping purposes.
+ Perform the recording, written and by device, of the minutes of all ASWVC meetings. In the event of their absence, the presiding officer shall appoint a member of the ASWVC to take minutes for the duration of that meeting.
+ Be responsible for ensuring that the minutes of the previous meeting of the ASWVC are available to the public at least seventy two (72) hours prior to the next scheduled meeting.
+ Update the ASWVC Constitution, Bylaws, Marketing Standards and Procedures, and Financial Code to reflect changes made in the Senate and by the student body.
+ Coordinate updates to the ASWVC Constitution, Bylaws, and Financial Codes to West Valley College’s Information Services to reflect changes on the website.
+ Give a report to the ASWVC at every regular Senate meeting.
+ Attend all ASWVC internal committee meetings for minute-taking purposes or assign designees to do so as necessary.
+ Director of Student Engagement
+ Serve as Chairperson for all Activities Committee meetings.
+ Serve on the Executive Board of the ASWVC.
+ Attend all ASWVC-sponsored events throughout the academic year.
+ Function as project manager, overlooking and coordinating all student-run campus activities.
+ Create and maintain an event calendar for each semester within one week before each semester begins.
+ Keep students up to date on all events affecting the campus community.
+ Provide updates on events to the Director of Marketing.
+ Coordinate all setup and takedown procedures for campus events.
+ Coordinate all volunteers at campus events.
+ Maintain a schedule of which Executive Board officers are present at each ASWVC-sponsored event.
+ Communicate responsibilities of Executive Board Members for ASWVC-sponsored events to the Executive Board seventy-two (72) hours in advance of the Event.
+ Event responsibilities must be reviewed by the ASWVC President.
+ Give a report to the ASWVC at every regular Senate meeting.
+ Ensure that the ASWVC is hosting no fewer than two (2) ASWVC-sponsored events per month.
+ Director of External Operations
+ Serve on the Executive Board of the ASWVC.
+ Research and contact outside vendors for campus events.
+ Work with the Director of Student Engagement on the planning process for events.
+ Facilitate payments with ASWVC Fiscal Assistant to vendors for campus events.
+ Coordinate insurance policy for the use of external vendors for campus events.
+ Serve as an Ex-Officio member on the Activities Committee.
+ Give a report to the ASWVC at every regular Senate meeting.
+ Director of Club Relations
+ Serve on the Executive Board of the ASWVC.
+ Serve as the official ASWVC representative to all clubs on campus.
+ Give a report to the ASWVC at every regular Senate meeting.
+ Remain in contact with all active clubs to consistently provide updates and any other relevant information which regards the ASWVC and clubs.
+ Keep a record of all active clubs.
+ Serve as a liaison between clubs and ASWVC.
+ Plan and hold at least one club fair per semester.
+ Supply clubs with opportunities to promote their organization throughout the academic year.
+ Incorporate club participation in ASWVC events should the event include an opportunity for clubs to promote their organization and gain membership.
+ Communicate with clubs to keep the student body informed of any opportunities to participate in club activities, meetings, or other business.
+ Student Senator
+ Represent the student body by being the voice of West Valley College students to the ASWVC.
+ Carry out all duties and responsibilities as delegated to them through formal action of committees and/or by direction of the Executive Board.
+ Vote on all matters brought up in ASWVC Student Senate meetings in order to foster positive change for all West Valley College students.
+ General Executive Board Responsibilities
+ All Executive Board Members shall serve on the ASWVC Senate and follow appropriate procedures to become an active Senate Member.
+ Executive Board members are not subject to take the Parliamentary Procedure Test if they have previously done so as an active Senator.
+ All Executive Board members are required to attend two-thirds (2/3) of all ASWVC-sponsored events, with the exception of the ASWVC Director of Student Engagement, who must be present at all ASWVC-sponsored events.
+ Executive Board Members shall attend the setup and cleanup portions of events, as well as perform any respective roles at the event.
+ Executive Board Members must be present for two-thirds (2/3) of the event to be considered in attendance at the respective event.
+ A minimum of five (5) Executive Board members must be present at such ASWVC-sponsored events.
+ All Executive Board Members are required to attend all ASWVC Senate Meetings and ASWVC Executive Board Meetings.
+ The Chairperson of a meeting shall be responsible for the creation of agendas for that meeting.
#article(15, "Financial Code")
+ The usage and distribution of ASWVC funds shall be subject to a governing document known as the ASWVC Financial Code.
+ The ASWVC Financial Code shall be made publicly available in the same manner as the ASWVC Constitution and Bylaws.
+ The language of the ASWVC Financial Code shall be enacted, rescinded, or amended by a two-thirds (2/3) vote of the active ASWVC members with voting rights.
+ Such proposals shall be submitted as an agenda request to the ASWVC Executive Board at least 24 hours prior to the Agenda posting requirements for the meeting at which they will be voted upon.
+ Adoption of the changes to the Financial Code shall become effective immediately following a two-thirds (2/3) favorable vote of the Senate.
+ The Director of Finance, along with the ASWVC Budget and Finance Committee, shall certify that the ASWVC Financial Code is enforced and up to date.
#article(16, "Article of Changes")
+ These bylaws shall be enacted, rescinded, or amended by a two-thirds (2/3) vote of the ASWVC Senate.
+ Such proposals shall be submitted as an agenda request to the ASWVC Executive Board at least 24 hours prior to the Agenda posting requirements for the meeting at which they will be voted upon.
+ These bylaws may also be enacted, rescinded, or amended by ed petition of ten percent (10%) of the members of the Student Body.
+ Adoption of the changes to the bylaws shall become effective immediately following a two-thirds (2/3) favorable vote of the ASWVC or upon certification of the required features on the aforementioned petition.
+ ASWVC Advisor, along with the Vice President, shall bear the responsibility of certifying the validity of the aforementioned petition.
|
|
https://github.com/7sDream/fonts-and-layout-zhCN | https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/12-freetype/freetype.typ | typst | Other | #import "/template/template.typ": web-page-template
#import "/template/heading.typ": chapter
#import "/lib/glossary.typ": tr
#show: web-page-template
#chapter[
// OpenType for Programmers: Freetype2
OpenType编程利器:Freetype2
]
|
https://github.com/brainworkup/neurocog | https://raw.githubusercontent.com/brainworkup/neurocog/main/README.md | markdown | MIT License | # Neurocog Typst Format
## Installing
_TODO_: Replace the `<github-organization>` with your GitHub organization.
```bash
quarto use template brainworkup/neurocog
```
This will install the format extension and create an example qmd file that you
can use as a starting place for your document.
## Using
_TODO_: Describe how to use your format.
|
https://github.com/Many5900/aau-typst | https://raw.githubusercontent.com/Many5900/aau-typst/main/chapters/chapter2.typ | typst | #import "../custom.typ": *
= Chapter 2
#lorem(300)
#todo[Remember to remove the "Lorem ipsum" text in chapter 2!] |
|
https://github.com/ChristophVanDeest/FH-Kiel-Typst-Template | https://raw.githubusercontent.com/ChristophVanDeest/FH-Kiel-Typst-Template/main/examples/report/main.typ | typst | MIT License | // Import dependencies such as glossaries etc.
#import "dependencies.typ": *
// Take a look at the file `template.typ` in the file panel
// to customize this template and discover how it works.
#import "../../src/lib.typ": report
#show: report.with(
language: "en",
title: "Universal Declaration of Human Rights",
author:"United Nations",
faculty: "Engineering and Computer Science",
department: "Computer Science",
include-declaration-of-independent-processing: true,
)
// Enable glossary
// Use: #gls("key") or #glspl("key") to reference and #print-glossary to print it
// More documentation: https://typst.app/universe/package/glossarium/
#show: make-glossary
// Print abbreviations
#pagebreak(weak: true)
#include "abbreviations.typ"
// Include chapters of report
#pagebreak(weak: true)
#include "chapters/01_preamble.typ"
#include "chapters/02_articles.typ"
// Print glossary
#pagebreak(weak: true)
#include "glossary.typ"
// Print bibliography
#pagebreak(weak: true)
#bibliography("bibliography.bib", style: "../../src/assets/ieeetran.csl")
|
https://github.com/extua/nth | https://raw.githubusercontent.com/extua/nth/main/nth.typ | typst | MIT No Attribution | #let nth(ordinal-num, sup: bool) = {
// Conditinally define ordinal-num, and if it's an integer change it to a string
let ordinal-str = if type(ordinal-num) == int {
str(ordinal-num)
} else {
ordinal-num
}
// Main if-else tree for this function
let ordinal-suffix = if ordinal-str.ends-with(regex("1[0-9]")) {
"th"
} else if ordinal-str.last() == "1" {
"st"
} else if ordinal-str.last() == "2" {
"nd"
} else if ordinal-str.last() == "3" {
"rd"
} else {
"th"
}
// Check whether sup attribute is set, and if so return suffix superscripted
if sup == true {
return ordinal-str + super(ordinal-suffix)
} else {
return ordinal-str + ordinal-suffix
}
}
// define nths function, which is just nth with sup attribute applied
#let nths(ordinal) = {
nth(ordinal, sup: true)
}
|
https://github.com/kdog3682/mathematical | https://raw.githubusercontent.com/kdog3682/mathematical/main/0.1.0/src/examples/graphs/schoolbook.typ | typst | #import "@preview/cetz:0.2.2"
#import "@local/stdlib:0.1.0" as stdlib: *
#import cetz.draw: *
#let axes-opts = (
grid: (
stroke: (paint: black.lighten(50%), thickness: 0.1pt),
),
minor-grid: (
stroke: (paint: black.lighten(75%), thickness: 0.1pt),
),
x: (
// grid: (stroke: blue + 0.1pt),
tick: (
length: 0.2,
minor-length: 0.1,
offset: -0.1,
stroke: black + 0.5pt
),
label: (
offset: 0.4cm,
angle: 360deg,
anchor: "center",
)
),
y: (
// grid: (stroke: blue + 0.1pt),
tick: (
length: 0.2,
minor-length: 0.1,
offset: -0.1,
stroke: black + 0.5pt
),
label: (
offset: 0.4cm,
angle: 360deg,
anchor: "center",
)
),
right: ( tick: ( stroke: none, ) ),
top: ( tick: ( stroke: none, ) ),
left: (
grid: (stroke: blue + 0.1pt),
label: (
offset: 0.2,
angle: 360deg,
anchor: "center",
),
tick: (
length: 0.2,
minor-length: 0.1,
offset: -0.1,
stroke: black + 0.5pt
),
),
bottom: (
grid: (stroke: blue + 5.1pt),
tick: (
length: 0.2,
minor-length: 0.1,
offset: -0.1,
stroke: black + 0.5pt
),
label: (
offset: 0.4cm,
angle: 360deg,
anchor: "center",
)
)
)
#let resolve-list(x) = {
if type(x) == array {
x
} else {
(x,)
}
}
#let schoolbook-opts = (
plot-size: (4, 4),
grid: true,
axis-style: "school-book",
x-label: auto,
y-label: auto,
)
#let schoolbook(plots, domain: (-5, 5), ..style) = cetz.canvas({
let plots = resolve-list(plots)
// let o = stdlib.styles.resolve(style, "schoolbook")
let o = schoolbook-opts
let tick-step = 1
let minor-tick-step = none
let tick-format-size = 8pt
let plot-opts = (
size: o.plot-size,
x-tick-step: tick-step,
// y-tick-step: tick-step,
x-grid: o.grid,
y-grid: o.grid,
axis-style: o.axis-style,
x-minor-tick-step: minor-tick-step,
y-minor-tick-step: minor-tick-step,
x-format: (x) => text(str(x), size: tick-format-size),
y-format: (x) => text(str(x), size: tick-format-size),
x-label: o.x-label,
y-label: o.y-label,
)
set-style(axes: axes-opts)
cetz.plot.plot(..plot-opts, {
for p in plots {
let d = p.at("domain", default: domain)
cetz.plot.add(domain: d, style: (stroke: p.stroke), p.fn)
}
})
})
// #panic("HI")
#let plots = (
( fn: (x) => x * x, stroke: 0.5pt + blue ),
( fn: (x) => x * x * x, stroke: 0.5pt + green ),
)
#schoolbook(plots)
|
|
https://github.com/marcelarie/marcelarie | https://raw.githubusercontent.com/marcelarie/marcelarie/main/marcel-cv.typ | typst | #import "@preview/modern-cv:0.3.0": *
#show: resume.with(
author: (
firstname: "Marcel",
lastname: "Manzanares",
email: "<EMAIL>",
phone: "(+34) 647 147 012",
github: "marcelarie",
linkedin: "marcelarie",
address: "Barcelona",
positions: (
"Software Engineer",
),
),
date: datetime.today().display(),
language: "en",
colored-headers: true,
)
\
= Experience
#resume-entry(
title: "Stuart - Fullstack developer",
location: "Barcelona, Spain",
date: "2022 - Present",
description: "B2B delivery platform",
)
#resume-item[
- Designed and implemented responsive web components and functionalities.
- Led the migration to a micro-frontend architecture to enhance scalability
and maintainability.
- Developed and maintained server-side rendered (SSR) applications using an
in-house framework.
- Collaborated with cross-functional teams to troubleshoot and resolve complex
technical issues.
- Ensured code quality and efficiency, consistently meeting project deadlines.
]
#resume-entry(
title: "Soy Super - Backend developer, Sys Admin",
location: "Barcelona Spain",
date: "2021 - 2022",
description: "Supermarket Comparator",
)
#resume-item[
- Developed and maintained web crawlers using Perl and Typescript, enhancing
data aggregation capabilities.
- Managed system infrastructure, ensuring high availability and performance.
- Extended and optimized business frameworks to improve functionality and user
experience.
]
\
= Projects
#resume-entry(
title: "Rust GitHub CLI tool",
location: [#github-link("marcelarie/git-tellme")],
date: "Dec 2022",
description: "Developer",
)
#resume-item[
- Designed and implemented a CLI tool to check for GH notifications.
- Check and subscribe to users new changes and repositories
]
#resume-entry(
title: "Automatic directory runner",
location: github-link("marcelarie/rund"),
date: "May 2024",
description: "Developer",
)
#resume-item[
- Implemented multiple shell hooks that run specific scripts when changing a directory.
- Similarly to direnv the user needs to validate the scripts and will run when entering on a directory for the first time
]
\
= Skills
#resume-skill-item(
"Languages",
(strong("TypeScript"), strong("PHP"), strong("Ruby"), strong("Lua"), "Rust", "Go", "Bash", "Perl"),
)
#resume-skill-item(
"Databases",
(strong("SQL"), strong("GraphQL"), strong("Redis"), "MongoDB", "PostgreSQL"),
)
#resume-skill-item(
"Systems and CI",
(strong("Linux"), strong("Git"), strong("Docker"), strong("Vim"), "Nginx", "AWS"),
)
#resume-skill-item(
"Software skills",
(strong("Unit and E2E testing"), strong("Scripting"), strong("Pipelines"), strong("FP"), strong("OOP"), strong("REST"), strong("Microservices"), "DDD"),
)
#resume-skill-item("Spoken Languages", (strong("Spanish"), strong("Catalan"), strong("English")))
#resume-skill-item(
"Soft Skills",
(
strong("Positive and active"),
strong("Problem solver"),
strong("Emphatic and sociable"),
strong("Good conversation skills"),
strong("Commited")
)
)
\
= Education
#resume-entry(
title: "Assembler School",
location: "Barcelona, Spain",
date: "October 2020 - June 2021",
description: "Master of Computer Engineering",
)
#resume-item[
Intensive and practical master that gives a bird's-eye view of the world of
software development.
]
|
|
https://github.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024 | https://raw.githubusercontent.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024/giga-notebook/entries/identify-intake.typ | typst | Creative Commons Attribution Share Alike 4.0 International | #import "/packages.typ": notebookinator
#import notebookinator: *
#import themes.radial.components: *
#show: create-body-entry.with(
title: "Identify Problem: Intaking Triballs",
type: "identify",
date: datetime(year: 2023, month: 8, day: 5),
author: "<NAME>",
witness: "<NAME>",
)
In order to be able to manipulate the triballs inside our robot, we will first
need to bring them inside our robot. While these are normally extremely
essential to every season, this season they are less important due to the fact
that triballs can be loaded directly into the robot when its touching the match
load zone.
#align(
center,
)[
#image("../assets/game-challenges/picking-up-triballs.svg", height: 25%)
]
= Design Constraints
- needs to use 11Ws of motors or less
- needs to fit within an 18" by 18" by 18" cube
- if it expands, it cannot make the robot go beyond a vertical size of 36"
= Design Goals
- Can intake a triball in at least 2s
- Can intake triballs out of the match load zone
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/glossy/0.1.1/examples/readme.typ | typst | Apache License 2.0 | // a minimal example, also listed in the README
#import "@preview/glossy:0.1.1": *
#let myGlossary = (
(key: "html", short: "HTML", long: "Hypertext Markup Language", description: "A standard language for creating web pages", group: "Web"),
(key: "css", short: "CSS", long: "Cascading Style Sheets", description: "A language used for describing the presentation of a document", group: "Web"),
(key: "tps", short: "TPS", long: "test procedure specification"),
// Add more entries as needed
)
#show: init-glossary.with(myGlossary)
#set heading(numbering: "1.1")
= Hello, `glossy`!
In modern web development, languages like @html and @css are essential.
Now make sure I get your @tps:short reports by 2pm!
= Examples with modifiers
#table(
columns: 2,
table.header([*Input*], [*Output*]),
[`@tps:short` ], [@tps:short],
[`@tps:long` ], [@tps:long],
[`@tps:both` ], [@tps:both],
[`@tps:long:cap` ], [@tps:long:cap],
[`@tps:long:pl` ], [@tps:long:pl],
[`@tps:short:pl` ], [@tps:short:pl],
[`@tps:both:pl:cap`], [@tps:both:pl:cap],
)
== Using conflicting modifiers (short, long, both)
These modifiers are semantically mutually exclusive, by they can be combined
syntactically. When multiple are used, `glossy` tries to make a smart choice on
which one to display.
#table(
columns: 2,
table.header([*Input*], [*Output*]),
[`@tps:short:long` ], [@tps:short:long],
[`@tps:long:short` ], [@tps:long:short],
[`@tps:short:both` ], [@tps:short:both],
[`@tps:long:both` ], [@tps:long:both],
[`@tps:short:long:both` ], [@tps:short:long:both],
[`@tps:long:pl` ], [@tps:long:pl],
)
#let my-theme = (
section: (title, body) => {
heading(level: 1, title)
body
},
group: (name, i, n, body) => {
if name != "" and n > 1 {
heading(level: 2, name)
}
body
},
entry: (entry, i, n) => {
// i is the entry's index, n is total number of entries
let output = [#entry.short]
if entry.long != none {
output = [#output -- #entry.long]
}
if entry.description != none {
output = [#output: #entry.description]
}
block(
grid(
columns: (auto, 1fr, auto),
output,
repeat([#h(0.25em) . #h(0.25em)]),
entry.pages,
)
)
}
)
#glossary(theme: my-theme)
#glossary(title: "Glossary with just empty group", groups: ("",), theme: my-theme)
#glossary(title: "Glossary with just Web group", groups: ("Web",), theme: my-theme)
|
https://github.com/swablab/documents | https://raw.githubusercontent.com/swablab/documents/main/3d-druck-agb.typ | typst | Creative Commons Zero v1.0 Universal | #import "templates/tmpl_doc.typ": tmpl_doc
#show: doc => tmpl_doc(
title: "3D Druck Service - AGB",
changes: (
[v1.0], [29.07.2021], [erste Fassung],
),
doc,
)
= Geltungsbereich
+ Diese Geschäftsbedingungen gelten für Geschäftsbeziehungen jeglicher Art zwischen dem swablab e.V. und dem Besteller also Unternehmern, juristischen Personen des öffentlichen Rechts oder öffentlich-rechtlichen Sondervermögen im Sinne von § 310 Absatz 1 BGB, sowie gegenüber natürlichen Personen. Entgegenstehende oder abweichende Bedingungen des Bestellers werden nur nach ausführlicher Überprüfung und schriftlicher Genehmigung durch ein vertretungsberechtigtes Mitglied des swablab e.V. anerkannt.
+ Diese Bedingungen gelten auch für alle zukünftigen Geschäfte mit dem Besteller, soweit es sich um Rechtsgeschäfte verwandter Art handelt.
+ Im Einzelfall getroffene, individuelle Vereinbarungen mit dem Käufer (einschließlich Nebenabreden, Ergänzungen und Änderungen) haben in jedem Fall Vorrang vor diesen Verkaufsbedingungen. Für den Inhalt derartiger Vereinbarungen ist, vorbehaltlich des Gegenbeweises, ein schriftlicher Vertrag bzw. eine schriftliche Bestätigung durch ein vertretungsberechtigtes Mitglied des swablab e.V. maßgebend.
= Angebot und Vertragsabschluss
+ Sofern eine Bestellung als Angebot gemäß § 145 BGB anzusehen ist, behält sich der swablab e.V. vor, jene Bestellung innerhalb von zwei Wochen anzunehmen oder ggf. abzulehnen.
+ Im Fall einer Bestellung beim 3D Druck Service des swablab e.V. erhält der Kunde eine Bestätigungs-Email durch einen Vertreter des swablab e.V. Diese Mitteilung über den Bestelleingang stellt keine Annahme des Angebots dar, sie dokumentiert lediglich den Eingang der Bestellung durch den Verein.
+ Erst durch den Versand der Auftragsbestätigung durch ein vertretungsberechtigtes Mitglied des swablab e.V. (Annahme des Angebots), welche in einer separaten Email versandt wird, kommt ein Vertrag zustande.
+ Die Bauteilfertigung erfolgt unter Verwendung der vom Kunden übermittelten 3D Daten. Es gelten die allgemeinen Toleranzen für Prototypen in Anlehnung an die DIN 16742. Insbesondere tolerierte Fertigungsmaße, Oberflächentolerierungen und Form- bzw. Lagetoleranzen laut beiliegender Zeichnungen sind je nach Bauteilgeometrie als Richtlinie zu sehen, können allerdings nicht direkt in der Produktion beeinflusst werden und stellen keine zugesicherte Eigenschaft dar.
= Überlassene Unterlagen
+ An allen in Zusammenhang mit der Auftragserteilung dem Kunden überlassenen Unterlagen - auch in elektronischer Form -, wie z. B. Kalkulationen, Zeichnungen etc., behält sich der swablab e.V. Eigentums- und Urheberrechte vor. Diese Unterlagen dürfen Dritten nicht zugänglich gemacht werden, es sei denn, es liegt eine, durch den swablab e.V. ausgestelle, ausdrückliche, schriftliche Zustimmung zur Veröffentlichung vor. Soweit das Angebot des Kunden/ Bestellers nicht innerhalb der Frist von § 2 angenommen wird, sind diese Unterlagen dem swablab e.V. unverzüglich zurückzusenden.
= Preise und Zahlung
+ Sofern nichts Gegenteiliges schriftlich vereinbart wird, gelten die genannten Preise ab Werk ausschließlich Verpackung in jeweils gültiger Höhe. Kosten für Verpackung werden gesondert in Rechnung gestellt.
+ Die Zahlung des Kaufpreises hat ausschließlich auf das auf den Vertragspapieren genannte Konto zu erfolgen. Der Abzug von Skonto ist nur bei schriftlicher besonderer Vereinbarung zulässig.
+ Sofern nichts anderes vereinbart wird, ist der Kaufpreis innerhalb von 14 Tagen nach Lieferung bzw. Rechnungserhalt zu zahlen. Verzugszinsen werden in Höhe von 8 % über dem jeweiligen Basiszinssatz p.a. festgelegt. Die Geltendmachung eines höheren Verzugsschadens bleibt vorbehalten.
+ Kann auch nach zweifacher Abmahnung keine Bezahlung des Kaufpreises festgestellt werden, behält sich der swablab e.V. weitere rechtliche Schritte vor.
+ Privatpersonen (natürlich Personen) können von einem Rechnungskauf keinen Gebrauch machen. In dem Fall ist der gesamte Warenwert, sowie der Wert der Verpackungs- und Versandkosten sofort vor Produktion der Ware fällig. Der Rechnungsbetrag kann per *Vorkasse oder PayPal im Voraus beglichen werden.* Nach Eingang des vollständigen Rechnungsbetrags wird der swablab e.V. die Bestellung, je nach Auslastung, schnellstmöglich ausführen. + Sofern keine Festpreisabrede getroffen wurde, bleiben angemessene Preisänderungen wegen veränderter Lohn-, Material- und Vertriebskosten für Lieferungen, die 3 Monate oder später nach Vertragsabschluss erfolgen, vorbehalten.
= Zurückbehaltungsrechte
+ Zur Ausübung eines Zurückbehaltungsrechts ist der Besteller nur insoweit befugt, als sein Gegenanspruch auf dem gleichen Vertragsverhältnis beruht.
= Lieferzeit & Versandkosten
+ Der Beginn der vom swablab e.V. angegebenen Lieferzeit setzt die rechtzeitige und ordnungsgemäße Erfüllung der Verpflichtungen des Bestellers voraus. Die Einrede des nicht erfüllten Vertrages bleibt vorbehalten.
+ Kommt der Besteller in Annahmeverzug oder verletzt er schuldhaft sonstige Mitwirkungspflichten, so ist der swablab e.V. berechtigt, den insoweit entstehenden Schaden, einschließlich etwaiger Mehraufwendungen, zu verlangen. Weitergehende Ansprüche bleiben vorbehalten. Sofern vorstehende Voraussetzungen vorliegen, geht die Gefahr eines zufälligen Untergangs oder einer zufälligen Verschlechterung der Kaufsache in dem Zeitpunkt auf den Besteller über, in dem dieser in Annahme- oder Schuldnerverzug geraten ist.
+ Soweit kein ausdrücklich verbindlicher Liefertermin vereinbart wurde, sind die Liefertermine bzw. Lieferfristen des swablab e.V. ausschließlich unverbindliche Angaben.
+ Kosten für Verpackungsmaterial sowie dem Versand sind nicht Bestandteil des ausgewiesenen Kaufpreises. Sollten mehrere Produkte bestellt werden, werden diese ggf. zusammen in einem Karton geliefert.
+ Der swablab e.V. versendet hauptsächlich mit UPS, DHL und der Deutschen Post. Die Kosten für den Versand berechnen sich aus dem Gewicht, den Abmaßen der Versandkartons sowie dem Lieferland.
= Gefahrenübergang bei Versendung
+ Wird die Ware auf Wunsch des Bestellers an diesen versandt, so geht mit der Absendung an den Besteller, spätestens mit Verlassen des Werks/Lagers die Gefahr des zufälligen Untergangs oder der zufälligen Verschlechterung der Ware auf den Besteller über. Dies gilt unabhängig davon, ob die Versendung der Ware vom Erfüllungsort erfolgt oder wer die Frachtkosten trägt.
= Eigentumsvorbehalt
+ Der swablab e.V. behält sich das Eigentum an der gelieferten Sache bis zur vollständigen Zahlung sämtlicher Forderungen aus dem Liefervertrag vor. Dies gilt auch für alle zukünftigen Lieferungen, auch wenn sich der swablab e.V. nicht stets ausdrücklich hierauf beruft. Weiter ist der swablab e.V. berechtigt, die Kaufsache zurückzunehmen, wenn der Besteller sich vertragswidrig verhält.
+ Der Besteller ist verpflichtet, solange das Eigentum noch nicht auf ihn übergegangen ist, die Kaufsache pfleglich zu behandeln. Solange das Eigentum noch nicht übergegangen ist, hat der Besteller den swablab e.V. unverzüglich schriftlich zu benachrichtigen, wenn der gelieferte Gegenstand gepfändet oder sonstigen Eingriffen Dritter ausgesetzt ist. Soweit der Dritte nicht in der Lage ist, dem swablab e.V. die gerichtlichen und außergerichtlichen Kosten einer Klage gemäß § 771 ZPO zu erstatten, haftet der Besteller für den dem swablab e.V. entstandenen Ausfall.
+ Der Besteller ist zur Weiterveräußerung der Vorbehaltsware im normalen Geschäftsverkehr berechtigt. Die Forderungen gegenüber dem Abnehmer aus der Weiterveräußerung der Vorbehaltsware tritt der Besteller schon jetzt an den swablab e.V. in Höhe des mit dem swablab e.V. vereinbarten Faktura-Endbetrages ab. Diese Abtretung gilt unabhängig davon, ob die Kaufsache ohne oder nach Verarbeitung weiterverkauft worden ist. Der Besteller bleibt zur Einziehung der Forderung auch nach der Abtretung ermächtigt. Die Befugnis des swablab e.V., die Forderung selbst einzuziehen, bleibt davon unberührt. Der swablab e.V. wird jedoch die Forderung nicht einziehen, solange der Besteller seinen Zahlungsverpflichtungen aus den vereinnahmten Erlösen nachkommt, nicht in Zahlungsverzug ist und insbesondere kein Antrag auf Eröffnung eines Insolvenzverfahrens gestellt ist oder Zahlungseinstellung vorliegt.
+ Die Be- und Verarbeitung oder Umbildung der Kaufsache durch den Besteller erfolgt stets Namens und im Auftrag des swablab e.V. In diesem Fall setzt sich das Anwartschaftsrecht des Bestellers an der Kaufsache an der umgebildeten Sache fort. Sofern die Kaufsache mit anderen, nicht dem swablab e.V. gehörenden Gegenständen verarbeitet wird, erwirbt sich der swablab e.V. das Miteigentum an der neuen Sache im Verhältnis des objektiven Wertes der Kaufsache zu den anderen bearbeiteten Gegenständen zur Zeit der Verarbeitung. Dasselbe gilt für den Fall der Vermischung. Sofern die Vermischung in der Weise erfolgt, dass die Sache des Bestellers als Hauptsache anzusehen ist, gilt als vereinbart, dass der Besteller dem swablab e.V. anteilmäßig Miteigentum überträgt und das so entstandene Alleineigentum oder Miteigentum verwahrt. Zur Sicherung der Forderungen des swablab e.V. gegen den Besteller tritt der Besteller auch solche Forderungen an den swablab e.V. ab, die ihm durch die Verbindung der Vorbehaltsware mit einem Grundstück gegen einen Dritten erwachsen; der swablab e.V. nimmt diese Abtretung schon jetzt an.
+ Der swablab e.V. verpflichtet sich, die ihm zustehenden Sicherheiten auf Verlangen des Bestellers freizugeben, soweit ihr Wert die zu sichernden Forderungen um mehr als 20 % übersteigt.
= Urheberrecht
+ Die Nutzer sind jeweils selbst dafür verantwortlich, die Rechte an der dem swablab e.V. zur Verfügung gestellten Daten, CAD/3D-Modelle zu besitzen. Der swablab e.V. ist insbesondere nicht verpflichtet, die Berechtigung der Nutzer zu überprüfen. Die Nutzer stellen dem swablab e.V. bei einem Verstoß gegen die vorstehend beschriebene Rechteeinräumung von sämtlichen berechtigten Ansprüchen Dritter im Hinblick frei.
= Gewährleistung und Mängelrüge sowie Rückgriff/Herstellerregress
+ Gewährleistungsrechte des Bestellers setzen voraus, dass dieser seinen nach § 377 HGB geschuldeten Untersuchungs- und Rügeobliegenheiten ordnungsgemäß nachgekommen ist.
+ Mängelansprüche verjähren in 12 Monaten nach erfolgter Ablieferung der vom swablab e.V. gelieferten Ware bei unserem Besteller. Für Schadensersatzansprüche bei Vorsatz und grober Fahrlässigkeit sowie bei Verletzung von Leben, Körper und Gesundheit, die auf einer vorsätzlichen oder fahrlässigen Pflichtverletzung des Verwenders beruhen, gilt die gesetzliche Verjährungsfrist. Soweit das Gesetz gemäß § 438 Abs. 1 Nr. 2 BGB (Bauwerke und Sachen für Bauwerke), § 445 b BGB (Rückgriffsanspruch) und § 634a Absatz 1 BGB (Baumängel) längere Fristen zwingend vorschreibt, gelten diese Fristen. Vor etwaiger Rücksendung der Ware ist die Zustimmung durch ein vertretungsberechtigtes Mitglied des swablab e.V. einzuholen.
+ Sollte trotz aller aufgewendeter Sorgfalt die gelieferte Ware einen Mangel aufweisen, der bereits zum Zeitpunkt des Gefahrübergangs vorlag, so wird der swablab e.V. die Ware, vorbehaltlich fristgerechter Mängelrüge nach Wahl des swablab e.V. nachbessern oder Ersatzware liefern. Es ist dem swablab e.V. stets Gelegenheit zur Nacherfüllung innerhalb angemessener Frist zu geben. Rückgriffsansprüche bleiben von vorstehender Regelung ohne Einschränkung unberührt.
+ Schlägt die Nacherfüllung fehl, kann der Besteller - unbeschadet etwaiger Schadensersatzansprüche - vom Vertrag zurücktreten oder die Vergütung mindern.
+ Mängelansprüche bestehen nicht bei nur unerheblicher Abweichung von der vereinbarten Beschaffenheit, bei nur unerheblicher Beeinträchtigung der Brauchbarkeit, bei natürlicher Abnutzung oder Verschleiß wie bei Schäden, die nach dem Gefahrübergang infolge fehlerhafter oder nachlässiger Behandlung, übermäßiger Beanspruchung, ungeeigneter Betriebsmittel, mangelhafter Bauarbeiten, ungeeigneten Baugrundes oder aufgrund besonderer äußerer Einflüsse entstehen, die nach dem Vertrag nicht vorausgesetzt sind. Werden vom Besteller oder Dritten unsachgemäß Instandsetzungsarbeiten oder Änderungen vorgenommen, so bestehen für diese und die daraus entstehenden Folgen ebenfalls keine Mängelansprüche.
+ Ansprüche des Bestellers wegen der zum Zweck der Nacherfüllung erforderlichen Aufwendungen, insbesondere Transport-, Wege-, Arbeits- und Materialkosten, sind ausgeschlossen, soweit die Aufwendungen sich erhöhen, weil die vom swablab e.V. gelieferte Ware nachträglich an einen anderen Ort als die Niederlassung des Bestellers verbracht worden ist, es sei denn, die Verbringung entspricht ihrem bestimmungsgemäßen Gebrauch.
+ Rückgriffsansprüche des Bestellers gegen den swablab e.V. bestehen nur insoweit, als der Besteller mit seinem Abnehmer keine über die gesetzlich zwingenden Mängelansprüche hinausgehenden Vereinbarungen getroffen hat. Für den Umfang des Rückgriffsanspruches des Bestellers gegen den Lieferer gilt ferner Absatz 6 entsprechend.
= Sonstiges
+ Dieser Vertrag und die gesamten Rechtsbeziehungen der Parteien unterliegen dem Recht der Bundesrepublik Deutschland unter Ausschluss des UN-Kaufrechts (CISG).
+ Erfüllungsort und ausschließlicher Gerichtsstand und für alle Streitigkeiten aus diesem Vertrag ist der Vereinssitz des swablab e.V., sofern sich aus der Auftragsbestätigung nichts anderes ergibt.
+ Alle Vereinbarungen, die zwischen den Parteien zwecks Ausführung dieses Vertrages getroffen werden, sind in diesem Vertrag schriftlich niedergelegt.
+ Sollten einzelne Bestimmungen dieses Vertrages unwirksam sein, werden oder eine Lücke enthalten, so bleiben die übrigen Bestimmungen hiervon unberührt. |
https://github.com/dyc3/ssw-555-agile-methods | https://raw.githubusercontent.com/dyc3/ssw-555-agile-methods/main/apatest.typ | typst | #import "apa.typ": *
#show: apa.with(
title: "Example APA Document",
running-head: "Running head",
authors: (
(
name: "<NAME>",
affiliation: "University of Nowhere"
),
(
name: "<NAME>",
affiliation: "University of Nowhere"
),
(
name: "<NAME>",
affiliation: "US Department of Nothing"
)
),
abstract: lorem(100),
instructor: "<NAME>",
course: "Nothing 101",
due-date: datetime(year: 2018, month: 12, day: 31),
)
#lorem(100)
== Level 2
#lorem(25)
=== Level 3
#lorem(25)
// ==== Level 4
// #lorem(25)
// ===== Level 5
// #lorem(25) |
|
https://github.com/chaosarium/typst-templates | https://raw.githubusercontent.com/chaosarium/typst-templates/main/slides-simple/lib.typ | typst | // based on https://github.com/skriptum/Diatypst
#let layouts = (
"small": ("height": 9cm, "space": 1.4cm),
"medium": ("height": 10.5cm, "space": 1.6cm),
"large": ("height": 12cm, "space": 1.8cm),
)
#let slides(
content,
title: none,
subtitle: none,
date: none,
authors: (),
layout: "medium",
ratio: 16/9,
title-color: blue.darken(50%),
slides_counter: true,
footer: true,
toc: true,
// code-styling: true,
font_size: 11pt,
font: "Libertinus Serif",
leading: 0.65em
) = {
// Parsing
if layout not in layouts {
panic("Unknown layout " + layout)
}
let (height, space) = layouts.at(layout)
let width = ratio * height
// Colors
let body-color = title-color.lighten(80%)
let header-color = title-color.lighten(65%)
let fill-color = title-color.lighten(50%)
// Setup
set document(
title: title,
)
set heading(numbering: "1.1.")
set page(
width: width,
height: height,
margin: (x: 0.5 * space, top: space, bottom: 0.6 * space),
// Header
header: [
#context {
let page = here().page()
let headings = query(selector(heading.where(level: 2)))
let heading = headings.rev().find(x => x.location().page() <= page)
if heading != none {
set align(top)
set text(1.4em, weight: "bold", fill: title-color)
v(space / 2)
block(heading.body +
if not heading.location().page() == page [
#{numbering("(i)", page - heading.location().page() + 1)}
]
)
}
}
// Slides Counter
#if slides_counter == true {
v(-space/1.5)
align(right+top)[
#context {
let curr_page = here().page()
let all_h2 = query(selector(heading.where(level: 2)))
let curr_h2 = all_h2.rev().find(x => x.location().page() <= curr_page)
let curr_h2_page = curr_h2.location().page()
let last_h1 = query(selector(heading.where(level: 1))).rev().find(x => x.location().page() <= here().page())
let next_h1 = query(selector(heading.where(level: 1))).find(x => x.location().page() >= here().page())
let h2s_before = query(
selector(heading.where(level: 2)).before(curr_h2.location())
)
.filter(x => x.location().page() < curr_h2_page)
.filter(x => if last_h1 != none {x.location().page() >= last_h1.location().page()} else {true})
.filter(x => if next_h1 != none {x.location().page() <= next_h1.location().page()} else {true})
let h2s_after = query(
selector(heading.where(level: 2)).after(curr_h2.location())
).slice(1)
.filter(x => if last_h1 != none {x.location().page() >= last_h1.location().page()} else {true})
.filter(x => if next_h1 != none {x.location().page() <= next_h1.location().page()} else {true})
// Dots before the current slide
for h in h2s_before {
[
#link(h.location())[
#box(circle(radius: 0.08cm, stroke: 1pt+fill-color))
]
]
}
link(curr_h2.location())[
#box(circle(radius: 0.08cm, fill: fill-color, stroke: 1pt+fill-color))
]
for h in h2s_after {
[
#link(h.location())[
#box(circle(radius: 0.08cm, stroke: 1pt+fill-color))
]
]
}
}
]
}
],
header-ascent: 0%,
// Footer
footer: [
#if footer == true {
set text(7pt, fill: fill-color, font: "IBM Plex Sans")
// box()[#line(length: 50%, stroke: 1pt+fill-color )]
// box()[#line(length: 50%, stroke: 1pt+body-color)]
// v(-0.3cm)
grid(
columns: (1fr, 1fr),
align: (left,right),
inset: 0pt,
[#title],
// [ #if subtitle != none {
// subtitle
// } else if authors != none {
// authors
// } else [#date]
// ],
[
#context counter(page).get().at(0) /
#context counter(page).final().at(0)
// .display(
// "1/1",
// both: true,
// )
]
)
}
],
footer-descent:0.8em,
)
// Text
set text(
size: font_size,
font: font
)
set par(
leading: leading
)
show footnote.entry: set text(size: 0.9em)
set footnote.entry(separator: line(stroke: 1pt + fill-color.lighten(40%), length: 20%), indent: 0cm)
// Bib
set bibliography(
title: none
)
// Section Slides
show heading.where(level: 1): x => {
set page(header: none,footer: none, margin: 0cm)
set align(horizon)
grid(
columns: (1fr, 3fr),
inset: 10pt,
align: (right,left),
fill: (title-color, white),
[#block(height: 100%)],[#text(1.2em, weight: "bold", fill: title-color)[#x]]
)
}
show heading.where(level: 2): pagebreak(weak: true)
show heading: set text(1.1em, fill: title-color)
// Title Slide
if (title == none) {
panic("A title is required")
}
else {
set page(footer: none, header: none, margin: 0cm)
block(
inset: (x:0.5*space, bottom:1em),
fill: title-color,
width: 100%,
height: 60%,
align(bottom)[#text(2.5em, fill: white, title, weight: 900)]
)
block(
height: 30%,
width: 100%,
inset: (x:0.5*space,top: 0em, bottom: 1em),
if subtitle != none {[
#text(1.4em, fill: title-color, subtitle, weight: 800)
]} +
if subtitle != none and date != none {
text(1.4em)[ \ ]
} +
if date != none {
text(1.1em, date)
} +
align(left+bottom, authors)
)
}
// Term
show terms.item: it => {
// set block(width: 100%, inset: 5pt)
stack(
block(
fill: header-color.lighten(40%),
radius: (top: 0.1em, bottom: 0cm),
strong(it.term),
width: 100%,
inset: 0.6em,
),
block(
fill: body-color.lighten(40%),
radius: (top: 0cm, bottom: 0.1em),
it.description,
width: 100%,
inset: 0.6em,
),
)
}
// Code
show raw.where(block: false): it => {
set text(font: "Hack")
box(
fill: body-color.lighten(70%),
outset: (y: 0.3em),
inset: (x: 0.2em),
stroke: 0.05em + body-color.lighten(30%),
radius: 0.2em,
it
)
}
show raw.where(block: true): it => {
set text(font: "Hack")
block(
fill: body-color.lighten(70%),
inset: 0.6em,
stroke: 0.05em + body-color.lighten(30%),
radius: 0.2em,
width: 100%,
it
)
}
// List
show list: set list(marker: (
text(fill: title-color)[•],
text(fill: title-color)[‣],
text(fill: title-color)[-],
))
// Table styling
show table: set table(
stroke: (x, y) => (
x: none,
bottom: 0.8pt+black,
top: if y == 0 {0.8pt+black} else if y==1 {0.4pt+black} else { 0pt },
)
)
show table.cell.where(y: 0): set text(
style: "normal", weight: "bold") // for first / header row
set table.hline(stroke: 0.4pt+black)
set table.vline(stroke: 0.4pt)
// Outline
set outline(
// target: heading.where(level: 1),
indent: true,
fill: line(length: 100%, stroke: (thickness: 1pt, dash: "dotted", paint: header-color)),
)
show outline: set heading(level: 2)
if (toc == true) {
outline()
}
// Content
content
} |
|
https://github.com/lkndl/typst-bioinfo-thesis | https://raw.githubusercontent.com/lkndl/typst-bioinfo-thesis/main/main.typ | typst |
#import "modules/template.typ": *
#import "chapters/0_abstract.typ": de_abstract, en_abstract
#import "@preview/tablex:0.0.6": tablex, hlinex
#show: doc.with(
author: "<NAME>",
lang: "en",
title: [
Quantum~Algorithms for~Bioinformatic~Applications: Navigating~the~DNA~Multiverse
],
short-title: [quantum bioinfo],
translated-title: [
Quantenalgorithmik für bioinformatische~Anwendungen: Unterwegs~im #box[DNA-Multiversum]
],
date: datetime(
year: 2024,
month: 01,
day: 15,
),
degree: "bachelor",
german-abstract: de_abstract,
english-abstract: en_abstract,
supervisors: ([Prof. Dr. <NAME>, Chair~of Quantum~Computing and~Computational~Biology],),
advisors: ([Dr. <NAME>], [<NAME>, M.Sc.]),
flavour: "info",
pagination-align: "outside",
bibliography-file: "../stuff.bib",
)
// Include an entire chapter like this:
//#include "chapters/1_intro.typ"
// But the rest of this example just goes right here:
= intro
=== Motivation
As xkcd wisely reminds us, "There's nothing quite so beautiful as watching someone code in a language they're fluent in." In this linguistic dance between quantum bits and biological sequences, we strive to achieve fluency in the unique syntax that intertwines the principles of quantum computation with the complex language of life.
=== Background and related work
Drawing inspiration from xkcd #link("https://xkcd.com/378/", "#378"), where "Python" is the programming language of choice for researchers plotting world domination, our research aligns itself with the power and elegance of Pythonic quantum algorithms. The literature review explores the quantum landscape, guiding us through the footsteps of pioneers like Schrödinger and Turing, who, if xkcd is to be believed (#795), may have shared a cup of coffee in a parallel computational universe.
=== Outline
In the spirit of xkcd #327, we adopt a robust methodology akin to the "Exploits of a Mom," ensuring the security and integrity of our quantum bioinformatics framework. Through the careful implementation of quantum gates and bioinformatic algorithms, we navigate the vast space of possibilities, akin to the legendary "Lorenz Attractor" (#137).
= materials & methods
some materials are important: food, WiFi, entertainment, ...
== differentiating material materials from immaterial methods
That's important, but I have no idea how to do it. Maybe @tv-problems can help us a tiny bit already?
#figure(
image("/images/tv_problems.png"),
placement: bottom,
gap: 1em,
caption: figure.caption(position: top, flex-caption([Example full-width image, caption above], [. Most people do not have computer science degrees, and they would probably count as more _method-y_ than _material-y_?])),
) <tv-problems>
Also: #lorem(200)
#figure(
image("/images/dingos.jpg", width: 100%),
placement: auto,
gap: 1em,
caption: flex-caption([Another example full-width image], [. Consumers are generally unaware that toddlers fall right into the #box(["tasty food"]) category for dingos; with anecdotal evidence suggesting that only individuals suffering from excessive slobbering ever successfully repelled the fanged predators. As tasty food, toddlers are clearly a *material*, _not_ a method.]),
) <dingos>
=== method A
This is a little bit of math and a link to @results, which you can find on #ref-page(<results>):
$
"HVAL" = "PIDE" - cases(
100 & forall L <= 11,
480 dot L^(-0.32[1+exp(-L\/1000)])#h(1em) & forall L <= 450,
19.5 & forall L > 450
)
$
#wrap-fig(
fig: align(right, image("images/laser_pointer_more_power.png", width: 60%)),
width: 40%,
supplement-position: "above",
gap: -6mm, // this is just passed through to `figure`
position: left + bottom,
caption: flex-caption([Example wrapped figure], [. In fact this is a side-by-side grid of text and this image. Actually a lot easier than in LaTeX! Also flexing the *@more-power* label is in a different position now.]),
label: <more-power>,
[
=== method B
This world is super chaotic! And the quantum realm isn't any better: #citeprose(<May1976>) found this already (and we're quoting them a bit like `citetext` here). But by now we are lucky to have #ibm[ColabFold] @Mirdita2022 and in combination with some more power (see @more-power), we can go far~-- for an example look no further than at #citeprose(<Bryant2022>). #lorem(10)
],
)
#lorem(100)
== materials <materials>
- Food
- WiFI
- coffee
#lorem(200)
#side-cap-fig(
fig: image("/images/dreams.png"),
fig-width: 60%,
caption-width: 40% - 1em, // because gutter: 1em,
caption-pos: bottom + left,
caption: flex-caption([Side caption example], [. Look it's floating! In addition to `caption-pos` and two `-width`s, you can pass `placement` to `side-cap-fig`. But not all combinations work -- have a look at #{show link: underline; link("https://typst.app/docs/reference/layout/place/", [the docs])} if the figure crashes into text or the compiler does. The underlining show rule is scoped, see? Also #underline[underlined] text; un-underlined #link("https://youtu.be/dQw4w9WgXcQ?feature=shared&t=42", [link]).]),
label: <floaty>,
supplement-position: "inline",
placement: arguments(bottom + right, float: true),
)
= results <results>
Quantum entanglement meets genomic entanglement as our algorithms traverse the DNA multiverse. Much like the unpredictable nature of xkcd's "Random Number" (#221), the results paint a colorful tapestry of possibilities, offering glimpses into the potential of quantum-enhanced bioinformatics applications.
// helper function for table alignment
#let aligner(column, row) = {
if row == 0 {
if column == 0 or column == 2 {
top + left
} else {
top + right
}
} else if column > 2 {
bottom + right
} else {
bottom + left
}
}
#align(center, box(width: 85%,
figure(
kind: table,
pad(
left: 0em, right: 0em, top: -1em,
tablex(
auto-lines: false,
stroke: .5pt,
inset: 6pt,
columns: (auto, auto, auto, auto, auto, auto), // or just a number
column-gutter: 16pt,
rows: (21pt, 23pt, auto, auto, 20pt, auto, auto),
align: (column, row) => aligner(column, row),
"size", "source", "split", "spp.", "proteins", "PPIs",
hlinex(),
"full", `APID`, "train", $18$, $39393$, $143171$,
"", "", "validate", $10$, $1750$, $2279$,
"", `HuRI`, "test", $1$, $4458$, $19106$,
"small", `APID`, "train", $8$, $8565$, $15586$,
"", "", "validate", $7$, $818$, $1184$,
"", `HuRI`, "test", $1$, $430$, $666$,
),
),
caption: flex-caption([PPI data in the sets], [; disregarding negatives and extra compensation proteins. Finished sets are about twice or $11 times$ the size.])
)
)) <mytable>
|
|
https://github.com/timetraveler314/Note | https://raw.githubusercontent.com/timetraveler314/Note/main/24Spring/Calculus/Calculus.typ | typst | #import "@local/MetaNote:0.0.1" : *
#import "@preview/physica:0.9.0": *
#import "@preview/pinit:0.1.2": *
#let pinit-highlight-equation-from(height: 2em, pos: bottom, fill: rgb(0, 180, 255), highlight-pins, point-pin, body) = {
pinit-highlight(..highlight-pins, dy: -0.6em, fill: rgb(..fill.components().slice(0, -1), 40))
pinit-point-from(
fill: fill, pin-dx: -0.6em, pin-dy: if pos == bottom { 0.8em } else { -0.6em }, body-dx: 0pt, body-dy: if pos == bottom { -1.7em } else { -1.6em }, offset-dx: -0.6em, offset-dy: if pos == bottom { 0.8em + height } else { -0.6em - height },
point-pin,
rect(
inset: 0.5em,
stroke: (bottom: 0.12em + fill),
{
set text(fill: fill)
body
}
)
)
}
#let detm = math.mat.with(delim: "|")
#let vol = math.op("Vol")
#let int = math.integral
#let iint = math.integral.double
#let iiint = math.integral.triple
#let oint = math.integral.cont
#let oiint = math.integral.surf
#let oiiint = math.integral.vol
#let vr = math.bold($r$)
#let vs = math.bold($s$)
#let vn = math.bold($n$)
#let vF = math.bold($F$)
#let vS = math.bold($S$)
#let rot = math.op("rot")
#let gradd = math.op("grad")
#let divv = math.op("div")
#let lnf = $lim_(n->+oo)$
#let ser = $sum_(n=1)^(oo)$
#let ser0 = $sum_(n=0)^(oo)$
#show: doc => MetaNote(
title: [
Calculus (II)
],
authors: (
(
name: "timetraveler314",
affiliation: "University of Genshin",
email: "<EMAIL>",
),
),
doc,
)
#outline()
= Multiple Integral
== Defining Mass
Assume $D$ is Jordan measurable. Given a density function $f: D -> RR$, the mass of the object is given by the integral of the density function over the region $D$, denoted by $integral_D f dif sigma$.
How can we define the integral? Like what we learned in the single-variate case, we can use Riemann sums to define the integral.
$ integral_D f dif sigma = lim_(norm(P) -> 0) sum tilde(f) (xi_i) "Vol"(P_i), "if the limit exists." $
Here, $P$ is a partition of $D$, and $xi_i$ is a point in the $i$-th subregion of the partition. The volume of the $i$-th subregion is denoted by $"Vol"(P_i)$.
== Multiple Integral
The intuition above is "using finite combination of straight polyhedron to approximate the region $D$". Similarly, introducing Riemann sums gives us the multiple integral, as in the single-variate case.
By the intuition above, we can define the multiple integral of a function over a region $D$.
#definition("Multiple Integral")[
Let $D subset Q$ be a bounded Jordan measurable set, where $Q$ is a bounded straight polyhedron in $RR^n$. Let $f: D -> RR$. For any given straight polyhedron partition $P$ of $Q$ and any choice of points $xi_i$ in the $i$-th subregion of the partition, we consider the Riemann sum
$ sum_(i=1)^(n(P)) tilde(f) (xi_i) "Vol"(P_i) $
where $ tilde(f)=cases(f(xi) comma "if" xi in D, 0 comma "otherwise"). $
If the limit of the Riemann sum exists as the norm of the partition goes to zero, we say that $f$ is integrable over $D$, and we define the multiple integral of $f$ over $D$ as
$ integral_D f dif sigma = lim_(norm(P) -> 0) sum tilde(f) (xi_i) "Vol"(P_i). $
]
#note()[
(1) $f$ is integral over $D$ $=>$ $f$ is bounded on $D$.
However, the converse is not true. Consider $ f(x,y) = cases(1 comma space x comma y in QQ sect [0 comma 1], 0 comma "otherwise")$.
(2) $f$ is integral over $D$ $<=>$ $lim_(norm(P) -> 0) omega(P_i)"Vol"(P_i) = 0$, where $ omega(P_i) = sup_(xi in P_i) f(xi) - inf_(xi in P_i) f(xi) $ stands for the oscillation of $f$ on $P_i$.
(3) If $f$ is continuous on $accent(D, -)$, then $f$ is integrable over $D$.
(4) $f$ is integrable over $D$ $<=>$ The Lebesgue measure of the set of discontinuities of $f$ on $D$ is zero.
]
The basic properties of multiple integrals are similar to those of single integrals, omitted here.
=== Calculation of Multiple Integrals - Fubini Theorem
The core idea of the Fubini theorem is "reducing the multiple integral to iterated integrals", which we are able to compute by the single-variable calculus.
#theorem("Fubini Theorem")[
Let $f$ be continuous on $D = [a,b] times [c,d]$. Then
$ integral_a^b #pin("i1") integral_c^d f(x,y)#pin("i3") dif y #pin("i2") dif x =^((I)) integral.double_D f(x,y) dif sigma =^((J)) integral_c^d integral_a^b f(x,y) dif x dif y . $
#pinit-highlight-equation-from(("i1", "i2"), "i3", height: 1.5em, pos: bottom, fill: rgb(150, 90, 170))[
$I(x)$
]
]
#corollary[
(1) $ integral.double_D f(x,y) dif sigma = integral_a^b integral_(g_1(x))^(g_2(x)) f(x,y) dif y dif x. $
(2) $ integral.double_D f(x,y) dif sigma = integral_c^d integral_(h_1(y))^(h_2(y)) f(x,y) dif x dif y. $
]
#example[
$ integral_0^1 (x-1)/(ln x) dif x. $
]
#solution[
$ integral_0^1 (x-1)/(ln x) dif x = integral_0^1 integral_0^1 x^y dif y dif x
= integral_0^1 integral_0^1 x^y dif x dif y = dots. $
]
#example("Using Periodicity of the Integrand")[
$ iint_D abs(cos(x+y)) dif sigma, D=[0,pi] times [0,pi]. $
]
#solution[
Notice $ integral_0^pi abs(cos(a+x)) dif x = integral_0^pi abs(cos x) dif x = 2, $
$ iint_D abs(cos(x+y)) = integral_0^pi 2 dif y = 2pi. $
]
==== Fubini Theorem for Triple Integrals
The Fubini theorem can be generalized to triple integrals.
#theorem("Fubini Theorem for Triple Integrals, (i)")[
(i) $Omega$ is a cylindrical set, and $f$ is continuous on $Omega$.
Let the projection of $Omega$ onto the $x y$-plane be $D$, and the lower and upper surfaces of $Omega$ be $z = h_1(x,y)$ and $z = h_2(x,y)$, respectively. Then
$ iiint_Omega f(x,y,z) dif V &= iint_D [integral_(h_1(x,y))^(h_2(x,y)) f(x,y,z) dif z] dif x dif y. $
#figure(image("assets/fubini-1.jpg", width: 10em), caption: "(i)")
]
#example[
Solve for the volume of the solid bounded by the equations $ cases(z=x^2+3y^2,z=8-x^2-y^2). $
]
#solution[
The intersection: $x^2+3y^2=8-x^2-y^2$ gives $diff D: x^2/4+y^2/2=1$.
$ V &= iint_D (integral_(x^2+3y^2)^(8-x^2-y^2) dif z) dif x dif y = iint_D (8-2x^2-4y^2) dif x dif y
\ &= integral_0^2 dif x integral_(-sqrt((4-x^2)/2))^sqrt((4-x^2)/2) (8-2x^2-4y^2) dif y = dots. $
]
#theorem("Fubini Theorem for Triple Integrals, (ii)")[
(ii) $Omega$ is a laminar set, and $f$ is continuous on $Omega$.
Let the $z$-coordinate of the lowermost and uppermost points of $Omega$ be $z = a,b$. Then
$ iiint_Omega f(x,y,z) dif V &= integral_a^b iint_(D(z)) f(x,y,z) dif x dif y dif z. $
// #figure(image("assets/fubini-2.jpg", width: 10em), caption: "(ii)")
]
#question("Volume of Hyperspheres")[
$B_n (a)={(x_1,dots,x_n)|sum x_i^2 <= a^2}$. Solve for $op("Vol") (B_n(a))$.
]
#solution[
$\#_1:$ Using recurrence.
]
#theorem("Generalized Fubini Theorem")[
Let $Omega$ be a Jordan measurable set in $RR^n$, and $f$ be continuous on $Omega$. Then
$ & integral_(X times Y) f(x_1,dots,x_m;y_1,dots,y_n) dif x_1 dots dif x_m dif y_1 dots dif y_n \ =& integral_X (integral_Y f(x_1,dots,x_m;y_1,dots,y_n) dif y_1 dots dif y_n) dif x_1 dots dif x_m. $
]
== Transformation of Coordinates
#theorem[
Let $O subset RR^2$ be a bounded open set; $phi : O -> RR^2, (u,v) |-> (x,y) $ be a $C^1$ transformation, and $E subset O$ be a Jordan measurable set. If
- (i) $det D phi (u,v) = diff(x,y)/diff(u,v) != 0, forall (u,v) in E^o$;
- (ii) $phi$ is injective on $E^0$,
then $phi(E)$ is still Jordan measurable, and for any continuous function $f$ on $phi(E)$, we have
$ integral_(phi(E)) f(x,y) dif sigma = integral_E (f compose phi) det D phi dif u dif v. $
]
== Exercises
#question[
]
== Appendix : Random Integrals in Calculation
#question[
$ int_0^1 sqrt((1-r^2)/(1-r^2)) r^3 dif r. $
]
#solution[
$ int_0^1 sqrt((1-r^2)/(1-r^2)) r^3 dif r &= 1/2 int_0^1 sqrt((1-t)/(1+t))t dif t quad (t = r^2) \
&= 1/2 int_0^1 sqrt((1-t)^2/(1-t^2)) t dif t \
&= 1/2 int_0^1 (1-sin v)/(cos v) sin v dif (sin v) quad (t = sin v) \
&= 1/2 int_0^(pi/2) (sin v -sin^2 v) dif v = 1 - pi/4.
$
]
= Curvilinear Integral
== Line Integral : The Second Kind & Green's Theorem
=== Flow and Divergence
Consider the flow of a vector field $F$ along a curve $Gamma^+$ in $RR^2$. The line integral of $F$ along $Gamma^+$ is defined as
$ oint_(Gamma^+) vF dot vn dif s $
where $vn$ is the unit normal vector of $Gamma^+$. Compute as follows:
$ oint_(Gamma^+) vF dot vn dif s &= oint_(Gamma^+) P dif x - Q dif y \
&= iint_D underbrace((pdv(P,x)+pdv(Q,y)), div vF slash divv vF) dif sigma. $
Here, $D$ is the region enclosed by $Gamma^+$, and $P,Q$ are the components of $F$.
Thus $div vF$ is created to measure the "flow" of $F$.
Now if we consider $u$ as the potential function of $F$, then $vF = grad u$. The line integral of $vF$ along $Gamma^+$ is then
$ oint_(Gamma^+) pdv(u,vn) dif s &= oint_(Gamma^+) grad u dot vn dif s \
&= iint_D div grad u dif sigma \
&= iint_D laplace u dif sigma.
$
=== Curl and Circulation
Now we see what happens in $RR^3$ when we consider the circulation of a vector field $vF$ along a small closed curve $Gamma$ in $RR^2$. The line integral of $vF$ along $Gamma$ is defined as
$ oint_Gamma vF dot dif vr $
Consider the projection of $Gamma$ onto those planes $x O y, y O z, z O x$. Then the circulation of $vF$ along $Gamma$ is
$ oint_Gamma vF dot dif vr &= oint_Gamma_1 vF dot dif vr_1 + oint_Gamma_2 vF dot dif vr_2 + oint_Gamma_3 vF dot dif vr_3 \
&= iint_S (pdv(R,y)-pdv(Q,z)) dif x dif y + iint_S (pdv(P,z)-pdv(R,x)) dif y dif z + iint_S (pdv(Q,x)-pdv(P,y)) dif z dif x \
&= iint_S curl vF dot dif sigma. $
== Surface Integral : The First Kind
When the surface is expressed by two parameters $u, v$,
$ norm(bold(r_u) times bold(r_v)) dif u dif v $ is called the "surface element" of the surface $S$. Now we try to evaluate the factor $norm(bold(r_u) times bold(r_v))$.
#theorem[
$ norm(bold(r_u) times bold(r_v)) = detm(bold(i), bold(j), bold(k); x_u, y_u, z_u; x_v, y_v, z_v) &= (D(y,z)/D(u,v), D(z,x)/D(u,v), D(x,y)/D(u,v)) \
&= (A,B,C) $
]
After changing the coordinates, we are here with the factor $norm(bold(r_u) times bold(r_v))$. Given the above way of calculating $sqrt(A^2 + B^2 + C^2)$, are there any simpler ways to calculate this? Consider the following.
#note[
We have the identity (which is just equvalent to $sin^2 + cos^2 = 1$):
$ (bold(r_u) times bold(r_v)) dot (bold(r_u) times bold(r_v)) = norm(bold(r_u) times bold(r_v))^2 = norm(bold(r_u))^2 norm(bold(r_v))^2 - (bold(r_u) dot bold(r_v))^2. $
So letting
$ cases(E = x_u^2 + y_u^2 + z_u^2, F = x_u x_v + y_u y_v + z_u z_v, G = x_v^2 + y_v^2 + z_v^2) $
yields $norm(bold(r_u) times bold(r_v)) = sqrt(E G - F^2)$. This is the so-called "first fundamental form" of the surface $S$.
]
#corollary[
For sphere surface $ cases(x = a cos theta sin phi, y = a sin theta sin phi, z = a cos phi) $ we have
$ bold(r)_theta &= (- a sin theta sin phi, a sin phi cos theta, 0), \
bold(r)_phi &= (a cos theta cos phi, a cos phi sin theta, - a sin phi), $
Then $ E=a^2 sin phi, F = 0, G = a^2. $
]
== Surface Integral : The Second Kind
#definition("Surface Integral : The Second Kind")[
Let $S$ be a orientable smooth surface in $RR^3$, and $vF$ be a vector field defined on $S$, $vn$ is a given unit normal vector of $S$. The surface integral of $vF$ over $S$ is defined as
$ oiint_S vF dot vn dif sigma $
]
== Exterior Differential
#let wedge = math.and
We call $dif x, dif y, dots$ 1-differential forms. Now we introduce the operation "wedging" of two differential forms, denoted by $wedge$. It is a bilinear operation, and satisfies the following properties:
(1) $dif x wedge dif x = 0$ (Direct consequence of the antisymmetry);
(2) Antisymmetry: $dif x wedge dif y = - dif y wedge dif x$;
(3) Associativity: $(dif x wedge dif y) wedge dif z = dif x wedge (dif y wedge dif z)$;
#definition("k-differential Form")[
The $k$-differential form is a linear combination of the form
$ omega = sum a_(i_1 i_2 dots i_k) dif x_(i_1) wedge dif x_(i_2) wedge dots wedge dif x_(i_k), $
where $a_(i_1 i_2 dots i_k)$ are smooth functions.
]
#definition($"The" dif "-map"$)[
The $dif$-map is a linear map from the space of $k$-differential forms to the space of $(k+1)$-differential forms, denoted by $dif$. It satisfies the following properties:
(1) $dif (f dif x) = dif f wedge dif x$;
]
Finally, here's the generalized Stokes' theorem, also known as the "Cartan's magic formula".
== Exercises
#question[
Evaluate $ oint_C x y dif s, $
where $C$ is the intersection of the sphere $x^2 + y^2 + z^2 = a^2$ and the plane $x+y+z = 0$.
]
#solution[
#let ve = math.bold($e$)
Consider a basis of the plane: $ve_1 = 1/sqrt(3) (1,1,1), ve_2 = 1/sqrt(2)(1,0,-1)$.
Then $C : bold(x) = a cos theta ve_1 + a sin theta ve_2$ is a parameterization of $C$.
#note[
It's wiser to take advantage of the rotational symmetry within the curve.
$ I &= 1/3 oint_C x y + y z + z x dif s \
&= 1/6 oint_C (x+y+z)^2 - (x^2+y^2+z^2) dif s \
&= -1/6 pi a^2. $
]
]
=== Harmonic Functions
Before we introduce the concept of harmonic functions, let's see some equalities on the boundary and interior of a domain.
#theorem[
Let closed region $D$ be bounded by finitely many smooth curves, and $u, v in C^2(D)$. $vn$ is the unit normal vector of $diff D$. Then
(1) $ iint_D laplace u dif x dif y = oint_(diff D) pdv(u,vn) dif s, $
(2) $ iint_D v laplace u dif x dif y = oint_(diff D) v pdv(u,vn) dif s - iint_D grad u dot grad v dif x dif y, $
(3) $ iint_D (u laplace v - v laplace u) dif x dif y = oint_(diff D) (u pdv(v,vn) - v pdv(u,vn)) dif s. $
] <boundary-interior-equalities>
#proof[
(1) Let $bold(t)$ be the unit tangent vector of $L^+$ with direction cosines $cos alpha, cos beta$, then $bold(n) = (cos beta, -cos alpha)$. By the definition of directional derivative,
$ oint_(L^+) v pdv(u,bold(n)) dif s &= oint_(L^+) (v cos beta pdv(u,x) - v cos alpha pdv(u,y)) dif s \
&= oint_(L^+) (v pdv(u,x) dif y - v pdv(u,y) dif x) \
&= iint_D pdv((v pdv(u,x)),x) + pdv((v pdv(u,y)),y) dif sigma ("by Green's theorem") \
&= iint_D (pdv(v,x) pdv(u,x) + v pdv(u,x,2) + pdv(v,y) pdv(u,y) + v pdv(u,y,2)) dif sigma \
&= iint_D v Delta u dif sigma + iint_D (pdv(u,x) pdv(v,x) + pdv(u,y) pdv(v,y)) dif sigma
. $
Rearranging the terms, we obtain the desired result.
(2) Omitted, similar to (1)(3).
(3) The same discussion as in (1),
$ integral_(L^+) (u pdv(v,bold(n)) - v pdv(u,bold(n))) dif s & = integral_(L^+) (u pdv(v,x) - v pdv(u,x)) dif x + (u pdv(v,y) - v pdv(u,y)) dif y \
&= iint_D (pdv(u,y) pdv(v,y) + u pdv(v,y,2) - pdv(u,y)pdv(v,y) - v pdv(u,y,2) \
&- pdv(u,x) pdv(v,x) - u pdv(v,x,2) + pdv(u,x) pdv(v,x) + v pdv(u,x,2)) dif sigma \
&= iint_D (u Delta v - v Delta u) dif sigma
. $
]
#note[
These are all direct consequences of the Green's theorem. However, when expressed in the language of field theory, they are more intuitive.
$ oint_(diff D) vF dot vn dif s = iint_D div vF dif sigma ("Green"). $
$ oiint_(diff Omega^+) vF dot vn dif S = iiint_(Omega) div vF dif V ("Gauss"). $
$ oint_(diff S) vF dot dif vr = iint_S (curl vF) dot vn dif S ("Stokes"). $
Based on these, a simpler proof can be given.
]
#proof[
(1) $ "RHS" &= oint_(diff D) grad u dot vn dif s = iint_D div grad u dif sigma = "LHS". $
(2) $ oint_(diff D) v grad u dif s &= iint_D div (v grad u) dif sigma \
&= iint_D grad u grad v + v div grad u.
$
(3) Direct consequence of (2).
]
#definition[
A function $u$ is called harmonic if it satisfies the Laplace equation $laplace u = 0$.
]
#theorem("Properties of Harmonic Function")[
(1) Let $D$ be a domain in $RR^2$, and $u in C^2(D)$. Then $u$ is harmonic iff $u$ satisfies
$ oint_C pdv(u,vn) dif s = 0, $
where $C subset D$ is a circle s.t. the interior of $C$ is in $D$.
(2) Given the same conditions, $u$ is harmonic iff $u$ satisfies the mean value property:
$ u(x_0,y_0) = 1/(2pi) integral_0^(2pi) u(x_0+r cos theta, y_0 + r sin theta) dif theta, $
for all $P(x_0,y_0) in D$ and $0<r< op("dist")(P,diff D)$.
(3) Let $D$ be bounded by finitely many smooth curves, and harmonic function $u$ on $D$. Then $u equiv 0$ if $u = 0$ on the boundary of $D$.
(4) Let $L$ be simple closed curve in $RR^2$, and $u in C^2(D)$ be harmonic on $D$. Then $u$ reaches its maximum and minimum on $L$.
]
#proof[
(1) Just a conclusion in @boundary-interior-equalities.
(2) From (1),
]
#question("An Exercise on Mean Value Property")[
Let $u(x,y)$ be continuous on $RR^2$. Prove that
$ u(x,y) = 1/(pi r^2) iint_((x-xi)^2+(y-eta)^2<=r^2) u(xi,eta) dif xi dif eta, forall r > 0 $
holds iff
$ u(x,y) = 1/(2 pi r) oint_(C_r(xi,eta)) u(xi,eta) dif s, forall r > 0. $
]
#proof[
Unify the two equations by change of coordinates.
$ pi r^2 u(x,y) &= int_0^(2pi) dif theta integral_0^r u(x - rho cos theta, y - rho sin theta) rho dif rho
. $
Take the derivative of the equation above with respect to $r$.
$ 2pi r u(x,y) &= integral_0^(2pi) u(x - r cos theta, y - r sin theta) r dif theta \
&= oint_(C_r(xi,eta)) u(xi,eta) dif s. $
]
== More Exercises
#example("Green Formula with Singularities")[
Solve for
$ I = oint_C e^x/(x^2+y^2) [(x sin y - y cos y) dif x + (x cos y + y sin y ) dif y], $
where $C$ is a close curve enclosing the origin, oriented counterclockwise.
]
#solution[
Note that $div vF = 0$, denote $L$ as a small enough circle with radius $r$ enclosing the origin, oriented clockwise. Then by Green's theorem,
$ I &= oint_(C union L) - oint_(L) = 0 -(- int_0^(2pi) e^(r cos theta) cos (r sin theta) dif theta) \
&= e^(theta_0 r cos theta_0) cos (r sin theta_0) dot integral_0^(2pi) dif theta ("MVT of Integral," theta in (0,1)) \
&= 2pi e^(theta_0 r cos theta_0) cos (r sin theta_0)
. $
Because the integral is independent of $r$, we just take the limit as $r -> 0$. and $I = 2pi.$
]
== Appendix : Field Theory
#theorem("Gradient and Gauss Theorem")[
#let vp = math.bold($p$)
Let $M$ be a closed surface in $RR^3$ satisfying the conditions of the Gauss theorem, and $vn$ is the unit normal vector field of $diff M$, scalar field $u in C^1 (M, RR)$, a point $bold(p) in bar(M)$. Then
$ grad u (bold(p)) = lim_(M -> bold(p)) 1/(op("Vol") (M)) oiint_(diff M) u vn dif sigma. $
]
#proof[
Consider
$ oiint_(diff M) u vn dif sigma &= oiint_(diff M) (u cos alpha, u cos beta, u cos gamma) dot (cos alpha, cos beta, cos gamma) dif sigma \
&= oiint_(diff M) u dif y dif z + u dif z dif x + u dif x dif y \
&= iiint_M div u dif sigma ("Gauss"), $
where $alpha, beta, gamma$ are the angles between $vn$ and the coordinate axes.
Then $ div u(p) = lim_(M -> bold(p)) 1/(op("Vol") (M)) iiint_M div u dif sigma. $
Then the conclusion follows.
]
=== Laplacian, Green Formula and Field Theory
#note[
For curve integral, let $vn = (cos alpha, cos beta)$ be the unit normal vector of the curve $L$, then
$ cos alpha dif s = dif y, cos beta dif s = - dif x. $
Then the curve integral of $vF$ along $L$ is
$ oint_L vF dot vn dif s = oint_L P dif y - Q dif x. $
]
#corollary[
$ int_U pdv(u,x_i) dif bold(x) = int_(diff u) u cos (vn_0, bold(e)_i) dif bold(s). $
]
#theorem("Integral by Parts, but Multiple")[
$ iint_D P dot pdv(f,x) dif x dif y = int_(diff D) f dot P dif y - iint_D pdv(P,x) f dif x dif y. $
$ iint_D Q dot pdv(f,y) dif x dif y = int_(diff D) f dot Q dif x - iint_D pdv(Q,y) f dif x dif y. $
]
#exercise[
Let $D : x^2+y^2 = a^2$, $f(x,y)$ has continuous partial derivative on $D$, and $f(x,y) = 0$ on $diff D$. Prove that
$
I = abs(iint_D f(x,y) dif x dif y) <= (pi a^3)/3 max_((x,y) in D) abs(grad f).
$
]
#proof[
First notice similarity to the Cauchy inequality:
$ x pdv(f,x) + y pdv(f,y) <= sqrt(x^2+y^2) ((pdv(f,x))^2+(pdv(f,y)^2))^(1/2). $
To get LHS, integrate by parts:
$ I = iint_D f(x,y) dif x dif y &= int_(diff D) f dif x - iint_D pdv(f,x) x dif x dif y \
&= int_(diff D) f dif y- iint_D pdv(f,y) y dif x dif y \
. $
Because $f = 0$ on $diff D$, we have $ int_(diff D) f dif x = 0, int_(diff D) f dif y = 0. $
Then
$
I = -1/2 iint_D sqrt(x^2+y^2) dif x dif y max abs(grad f).
$
]
= Differential Equations
== Integrating Factor
=== Integrating Factor for Homogeneous Equations
#lemma("Euler")[
Let $f(x,y)$ be a homogeneous function of degree $n$, Then $
n f(x,y) = x pdv(f,x) + y pdv(f,y).
$
]
#proof[
Take the derivative of $f(t x, t y)$ w.r.t. $t$:
$
x pdv(,x) f(x,t y) + y pdv(,y) f(t x, y) = pdv(,t) (t^n f(x,y)) = n t^(n-1) f(x,y).
$
Letting $t=1$, we get the desired result.
]
Now we consider the homogeneous ODE
$
M(x,y) dif x + N(x,y) dif y = 0,
$
where $M, N$ are homogeneous functions of the same degree $k$. We assume $mu$ to be a homogeneous integrating factor of degree $d$. Then by the lemma above,
$
x pdv(,x) (mu M) + y pdv(,y) (mu M) &= (k+d) mu M, \
x pdv(,x) (mu M) + y pdv(,x) (mu N) &= (k+d) mu M, ("Property of Integrating Factor") \
[mu M + x pdv(,x) (mu M)] dif x + pdv(,x) (y dot mu M) dif y &= (k+d+1) mu M, \
pdv(,x) (mu (x M + y N)) &= (k+d+1) mu M.
$
Similarly, $pdv(,y) (mu (x M + y N)) = (k+d+1) mu N$.
We might want $k=-d-1$ to eliminate RHS, then we will see $mu (x M + y N) = c$ is a constant. Wonderfully, we have found the integrating factor $mu = 1/(x M + y N)$, which is homogeneous of degree $-d-1$, consistent with our assumption.
== Existence and Uniqueness of Solutions
=== Picard Iteration
#proof[
(1)
Construct a rectangle area $D = {(x,y) | |x-x_0| <= a, |y-y_0| <= b}$. Because $p(x)$ is continuous, $p(x)$ is bounded on $D$, i.e. $|p(x)| <= M$.
$ derivative(y,x) = f(x,y) = p(x) cos^2 y - sin^2 y, \
abs(pdv(f,y)) &= abs(-2p(x)sin y cos y - 2 sin y cos y) \
&<= 2abs(p(x))+2 <= 2M+2. $
Then $f(x,y)$ is bounded on $D$. By Lagrange Mean Value Theorem, for every $y_1, y_2 in D$,
$ abs(f(x,y_1) - f(x,y_2)) = pdv(f,y) (x, xi) |y_1 - y_2| <= (2M+2) |y_1 - y_2|. $
Then $f(x)$ is Lipschitz continuous on $D$. By Picard's theorem, the solution in $[x_0-h, x_0+h]$ exists and is unique, where $h = min(a, b/M), M = max abs(f(x,y))$.
Consider the endpoint $x_0+h$, which is still in $D$. Then we can repeatedly apply Picard's theorem to get the solution in a larger interval.
Thus we proved that the solution exists and is unique.
(2) It's easily
]
== Exercises
#exercise[
$ (x y-x^3 y^3) dif x + (1+x^2) dif y = 0. $
]
#solution[
$y$: Divide both sides by $y^3$,
$
1/y^2 x dif x - x^3 dif x + (1+x^2) dif y/y^3 &= 0 \
1/y^2 x dif x - x^3 dif x + (1+x^2) dif (1/y^2) &= 0\
v x dif x - x^3 dif x + (1+x^2) dif v &= 0, v = 1/y^2. $
Notice $dif (1/(1+x^2)) = - (2x)/(1+x^2)$, divide both sides by $(1+x^2)^2$,
$
v dif u + u dif v &= (1/u +1) dif u \
dif (u v) &= (1/u + 1) dif u \
v &= ln abs(u)/u + 1 + C/u.
$
]
#let vy = math.bold($y$)
#let vxi = math.bold($xi$)
#let mA = math.bold($A$)
#let mB = math.bold($B$)
#let mJ = math.bold($J$)
#let mN = math.bold($N$)
#let mP = math.bold($P$)
#let mD = math.bold($D$)
== $n$-th Order Linear ODEs
=== When Coefficients are Constant
Let's begin from the simplest case where the coefficients are constant.
From the perspective of linear algebra, we can consider the $n$-th order linear ODE in a elegant way:
#definition("Linear ODE")[
Given the ODE
$
y^((n)) + a_(n-1) y^((n-1)) + ... + a_1 y' + a_0 y = 0,
$
when we denote $vy = (y,y',...,y^((n-1)))^T$, we can rewrite the ODE as
$
vy' = mA vy,
$
where $mA$ is the Frobenius matrix
$
mat(
0,1,0,...,0;
0,0,1,...,0;
dots.v, dots.v, dots.v, dots.down, dots.v;
-a_0,-a_1,-a_2,...,-a_(n-1)
).
$
]
At the first glance, we might want to unify $vy'$ and $vy$ in both sides. Note that for normal functions, $e^(A x)$ does the job by $(e^(A x))' = A e^(A x)$. So a natural choice is to consider the exponential function of a matrix.
#definition("Matrix Exponential")[
Given a matrix $mA$, the exponential of $mA$ is defined as
$
e^(mA) = I + mA + 1/2! mA^2 + 1/3! mA^3 + ...
$
where $I$ is the identity matrix.
]
We might wonder why the definition makes sence - after all, matrices and numbers are different things altogether. Using the theory of power series, we can show that the series converges for all matrices, omitting the proof here.
We see that $e^(mA x)$ is indeed a solution to the ODE $vy' = mA vy$. So the problem reduces to finding a simple form of $e^(mA x)$. Recall the theory of operators, $mA$ may be better to work with under a change of basis, giving us the Jordan form. Before that, we need the important property of the matrix exponential.
#theorem("Properties of Matrix Exponential")[
The matrix exponential has the following properties:
1. $e^(mP^(-1)mA mP) = mP^(-1) e^(mA) mP$ for any invertible matrix $mP$.
]
#proofsk[
1. We can show that for every polynomial $f(x)$, $f(mP^(-1) mA mP) = mP^(-1) f(mA) mP$. The result follows by considering the power series of $e^(mA)$.
]
So we can work with the Jordan form $mJ = mP^(-1) mA mP$ instead of $mA$. The above property allows us to calculate like this:
$
e^(mA x) = e^(mP mJ x mP^(-1)) => e^(mA) mP = mP e^(mJ x).
$
Multiplying $mP$ to the right of the equation does not change the result, so the solution has a better form $mP e^(mJ x)$. The Jordan form is a block diagonal matrix, so we can calculate the exponential of each block separately.
Before considering the general case, we can consider the simplest case where $mA$ is diagonalizable.
#theorem[
If $mJ = op("diag")(lambda_1, ..., lambda_n)$ is diagonal, let $mP = (vxi_1, ..., vxi_n)$ be the matrix of eigenvectors. Then
$
mP e^(mJ x) = e^(lambda_1 x) vxi_1 + ... + e^(lambda_n x) vxi_n.
$
Now $mP e^(mJ x)$ is a basic solution matrix to the ODE. And then we can extract $y$ from the first row of the matrix:
$
y(x) = c_1 e^(lambda_1 x) + ... + c_n e^(lambda_n x).
$
]
When $mJ$ is a non-trivial Jordan form, we calculate $e^(mJ x)$ by considering the Jordan blocks.
#lemma("Exponential of Jordan Blocks")[
Given a Jordan block
$
mJ = mat(
lambda,1,0,...,0;
0,lambda,1,...,0;
dots.v, dots.v, dots.v, dots.down, dots.v;
0,0,0,...,lambda
),
$
and a function $f(x)$, if $f(mJ)$ converges, then
$
f(mJ) = mat(
f(lambda),f'(lambda),1/2! f''(lambda),...,1/(n-1)! f^((n-1))(lambda);
0,f(lambda),f'(lambda),...,1/(n-2)! f^((n-2))(lambda);
dots.v, dots.v, dots.v, dots.down, dots.v;
0,0,0,...,f(lambda)
).
$
In particular, $e^(mJ)$ is calculated by the above formula:
$
e^(mJ) = mat(
e^(lambda),e^(lambda) x,1/2! e^(lambda) x^2,...,1/(n-1)! e^(lambda) x^(n-1);
0,e^(lambda),e^(lambda) x,...,1/(n-2)! e^(lambda) x^(n-2);
dots.v, dots.v, dots.v, dots.down, dots.v;
0,0,0,...,e^(lambda)
).
$
]
#proofsk[
By virtue of mathematical induction, we can show the fact
$
mJ^m = mat(
lambda^m,binom(m,1) lambda^(m-1),binom(m,2)lambda^(m-2),...,binom(m,n-1) lambda^(m-n+1);
0,lambda^m,binom(m,1) lambda^(m-1),...,binom(m,n-2) lambda^(m-n+2);
dots.v, dots.v, dots.v, dots.down, dots.v;
0,0,0,...,lambda^m
).
$
Then for polynomial $f$, the lemma is trivial; for others we might need to consider the power series of $f$, and the result follows.
]
Then
$
e^(mJ_i (lambda_i) x) = e^(lambda_i) (I + mN_i x + 1/2! mN_i^2 x^2 + ... + 1/(n-1)! mN_i^(n-1) x^(n-1)),
$
as a result, for every Jordan block $mJ_i$ of order $n_i$, we have a solution matrix block
$
mP_i e^(mJ_i x) = e^(lambda_i x) (vxi_1, x vxi_1 + vxi_2, ..., 1/(n_i-1)! x^(n_i-1) vxi_1 + ... + vxi_n_i),
$
corresponding to the solution family of dimension $n_i$:
$
y(x) = (a_0 + a_1 x + ... + a_(n_i-1) x^(n_i-1)) e^(lambda_i x).
$
The general solution is the linear combination of all solution families.
But for linear ODEs, things are actually simpler than this, because of the special structure of the matrix $mA$, a Frobenius matrix.
#theorem("Minimal Polynomial of Frobenius Matrix")[
Given the Frobenius matrix $mA$, the minimal polynomial of $mA$ is the characteristic polynomial of $mA$.
]
#proof[
See the book 谢启鸿.
]
This nice property promises that every eigenvalue only appears once in the Jordan form, so the approach to solve those ODE can be pretty mechanicized.
$
&"Every eigenvalue only appears once" \
<=>&"Eigen root " lambda_i "with multiplicity " n_i "gives a family of solutions" \
& (a_0 + a_1 x + ... + a_(n_i-1) x^(n_i-1)) e^(lambda_i x).
$
This is the general solution to the ODE, well-known as the characteristic equation method.
== Linear Operator $f(D)$
Denote the vector space of $n$-times differentiable functions by $C^n$. The differential operator $D : C^n -> C^0$ is defined as $D = derivative(,x)$. Given a polynomial $f(lambda)$, we can define the linear operator $f(D)$. Then the ODE becomes $f(D) y = 0$. Now it suffice to study the kernel of $f(D)$.
#lemma[
$
ker op("lcm") (f(x),g(x))(D) = ker f(D) + ker g(D).
$
]
By the primary decomposition lemma, we factor $f(lambda)$ into irreducible polynomials
$
f(lambda) = (lambda-lambda_1)^(n_1) ... (lambda-lambda_k)^(n_k).
$
= Series
== Review
=== Uniform Convergence
Criteria : M-test, Abel, Dirichlet ($ser a_n (x) b_n (x)$).
=== Sufficienct Conditions for Commutative Operations
When is it possible to exchange
$
lim_(x->x_0), derivative(,x), integral_a^b dif x " and" lnf, sum_0^oo "?"
$
== Power Series $sum_0^oo a_n (x-x_0)^n$
#note("Questions of Interest")[
- Region of convergence: find $E$ s.t. $ser0 a_n (x-x_0)^n " converges" <=> x in E$.
- Exchangeability of operations: $
lim_(x->x_0), derivative(,x), integral_a^b dif x " and" sum_0^oo.
$
- What functions $f(x)$ can be represented by power series? $
f(x) = f(x_0) + ser f^((n)) / n! (x-x_0)^n, x in E.
$
]
=== Radius of Convergence
#theorem("Power Series has a Radius of Convergence")[
For $ser0 a_n x^n$, there exists a number $R in [0, +oo]$ such that
i) The series converges absolutely for $abs(x) < R$.
ii) The series diverges for $abs(x) > R$.
iii) The series may either converge or diverge for $abs(x) = R$.
]
#proof[
Let $
R = sup{ abs(r) : ser0 a_n r^n " converges"},
$
then $forall x, abs(x) <R, exists r "s.t." ser0 a_n r^n " converges", abs(x) < abs(r) < R$.
Convergence $=>$ boundedness, i.e. $abs(a_n r^n) <= M, forall n > N$.
By the *comparison test*, $
abs(a_n x^n) = abs(a_n r^n) (abs(x)/abs(r))^n => abs(a_n x^n) <= M (abs(x)/abs(r))^n ("converges").
$
This shows that the series converges absolutely for $abs(x) < R$. By definition, the series diverges for $abs(x) > R$.
]
#note($"When " abs(x) = R$)[
The series may converge or diverge. E.g.
$
ser x^n/n^p, R = 1, E = cases(
(-1,1)\, quad p = 0,
[-1,1)\, quad p in (0,1],
[-1,1]\, quad p > 1.
)
$
]
How to find the radius of convergence? The essence lies in the Cauchy-Hadamard formula.
#theorem("Cauchy-Hadamard Formula")[
Given the power series $ser0 a_n x^n$, let
$
R = 1/(limsup_(n->+oo) root(n,abs(a_n))).
$
Then the radius of convergence is $R$.
]
#example[
Recall the series $ser root(n, abs(a_n))$.
]
#corollary("Ratio Test Equivalent")[
If $lnf abs(a_(n+1)/a_n) = l$, then
$
R = 1/l = cases(
1/l\, l > 0,
+oo\, l = 0,
0\, l = +oo.
).
$
]
#proof[
Fix $x$, consider $b_n = abs(a_n x^n)$. Then by a ratio test, we have
$
lim_(n->+oo) b_(n+1)/b_n = abs(x) lim_(n->+oo) abs(a_(n+1)/a_n) = l abs(x).
$
Compare the above RHS with $1$.
]
#example[
$
ser 1/n^p x^n, ser x^n/sqrt(n!), ser n! x^n.
$
All of them have a radius of convergence $R = 1$.
]
#corollary[
If $lnf root(n, abs(a_n)) = l$, then $R = 1/l$.
]
#proofsk[
Fix $x$, $root(n, abs(a_n x^n)) = abs(x) root(n, abs(a_n)) -> l abs(x)$.
]
#example[
$
ser (3^n + (-2)^n)/n x^n, ser (3^n + (-2)^n)/n (x+1)^n.
$
]
== Operations on Power Series
Before we start, let's discuss the properties of power series.
=== Sum and Product
#theorem[
Given two power series $ser0 a_n x^n$ and $ser0 b_n x^n$, their sum and product are also power series. Let $R = min(R_a, R_b)$, then
i) The sum $ser0 (a_n plus.minus b_n) x^n$ has a radius of convergence $R$.
ii) The product $ser0 a_n x^n ser0 b_n x^n = ser0 c_n x^n$ has a radius of convergence $R$. $c_n = sum_(k=0)^n a_k b_(n-k)$.
]
#proofsk("Cauchy")[
ii) By the property of absolute convergence, reordering the terms of the product series does not change the result. Let $ser u_n, ser v_n$ be absolute convergent series, then
$
sum u_n sum v_n = sum c_(i_k) d_(j_k),
$
where all $(i_k,j_k)$ are a permutation of $NN times NN$.
$
sum_0^N abs(c_i_k d_j_k) <= ser abs(c_n) ser abs(d_n).
$
]
#example[
Power Series of $1/((1-x)(2-x))$:
- Sum of two series: $1/(1-x) - 1/(2-x)$.
- Product of two series: $1/(1-x) dot 1/(2-x)$.
]
#example[
$
1/(1-x)^2 = ser0 x^n dot ser0 x^n = ser n x^(n-1), x in (-1,1).
$
]
Given multiplication, how can we define division? See the following example:
#example("Bernoulli Numbers")[
$
x/(e^x-1) -> x = (e^x-1) ser B_n x^n/n!, B_0 = 1.
$
]
=== Properties of Calculus Operations on Power Series
#theorem("Locally Uniform Convergence (-[-]-)")[
Given a power series $ser0 a_n x^n$, the series converges uniformly on every compact subset of the interval of convergence.
i.e.
i) $
forall [a,b] "s.t." -R < a < b < R, ser0 a_n x^n arrows u(x) "on " [a,b].
$
ii) If $ser0 a_n R^n$ converges, then $ser0 a_n x^n arrows u(x) "on " [0,R]$.
iii) If $ser0 a_n (-R)^n$ converges, then $ser0 a_n x^n arrows u(x) "on " [-R,0]$.
]
#proofsk[
i) $
abs(a_n x^n) <= abs(a_n) c^n, c = max(abs(a),abs(b)).
$
RHS is a convergent geometric series, by M-test, the series converges uniformly on $[a,b]$.
ii) $
ser0 a_n x^n = ser underbrace(a_n R^n, ser0 a_n R^n "uniformly converges") underbrace((x/R)^n, "monotone\n and is uniformly bounded"), abs(x/R) < 1.
$
The rest follows by Abel test of uniform convergence.
iii) Similar to ii).
]
#theorem("Continuity of Power Series")[
Let $ser0 a_n x^n$ be a power series with radius of convergence $R$. Then
i) $ser0 a_n x^n$ is continuous on $(-R,R)$.
ii) if $ser0 a_n x^n$ converges at $x =R$, then $ser0 a_n x^n$ is left-continuous at $x = R$.
iii) if $ser0 a_n x^n$ converges at $x = -R$, then $ser0 a_n x^n$ is right-continuous at $x = -R$.
]
#proofsk[
]
#theorem("Integratability of Power Series")[
Let $ser0 a_n x^n$ be a power series with radius of convergence $R$. Then
$
u(x) = ser0 a_n x^n " is integrable on " (-R,R),\ integral_0^x u(t) dif t = ser0 integral_0^x a_n t^n dif t = ser0 a_n x^(n+1)/(n+1).
("integrate termwise")
$
#note[
$ser0 a_n x^(n+1)/(n+1)$ and $ser0 a_n x^n$ have the same radius of convergence. At the endpoints, $1/(n+1)$ gives us a sense of being smaller, hence being more possibly convergent. We'll discuss this later in the examples.
]
]
#proofsk[
// TODO
$
limsup root(n, abs(a_n/(n+1))) = limsup root(n, abs(a_n)).
$
]
#example($ln(1+x)$)[
$
1/(1+x) = 1/(1-(-x)) = ser0 (-x)^n, abs(x) < 1. \
ln(1+x) = integral_0^x 1/(1+t) dif t = ser0 (-1)^n x^(n+1)/(n+1), abs(x) < 1.
$
]
#solution[
Because the alternating series $ser0 (-1)^n/(n+1)$ converges, $ser0 (-1)^n x^(n+1)/(n+1)$ is left-continuous at $x = 1$.
At $x = -1$, the series $ser0 1/(n+1)$ diverges.
So $ln(1+x) = ser0 (-1)^n x^(n+1)/(n+1)$ holds on $(-1,1]$.
]
#example($arctan$)[
$ derivative(,x) arctan x = 1/(1+x^2) $
$
1/(1+x^2) = ser0 (-1)^n x^(2n) , abs(x) < 1. \
forall x in (-1,1), arctan x = ser0 integral_0^x (-1)^n t^(2n) dif t = ser0 (-1)^n x^(2n+1)/(2n+1).
$
The series converges at $x = 1, -1$, so $arctan x = ser0 (-1)^n x^(2n+1)/(2n+1)$ holds on $[-1,1]$.
$
pi/4 = arctan 1 = ser0 (-1)^n/(2n+1).
$
]
#theorem("Differentiating Termwise")[
Let $ser0 a_n x^n$ be a power series with radius of convergence $R$. Then
$
u(x) = ser0 a_n x^n " is differentiable on " (-R,R),\
derivative(,x) u(x) = ser0 derivative(,x) a_n x^n = ser0 n a_n x^(n-1). ("differentiate termwise")
$
]
$
forall r <R, ser0 a_n x^n "converges in " (-R,R) \
and ser0 n a_n x^n "converges uniformly in " [-r,r].
$
The radius of convergence of $ser0 n a_n x^n$ is also $R$.
#corollary("Smoothness of Power Series")[
$
ser0 a_n x^n in C^oo (-R,R)
$
]
#example[
Prove that $forall x in (-1,1)$,
$
ser0 (n+1)(n+2) x^n = 2/(1-x)^3.
$
Reminder: dont be too rigid. Solve for
$
ser 1/(n(2n+1)) (2ser 1/(2n(2n+1)))
$
]
== Solving for Infinite Sums
=== Abel Method
Based on Abel's Second Theorem, we can solve for a convergent series $ser a_n x^n$ by studying the power series $ser a_n x^n$, whose radius of convergence is at least $1$. If we are able to caluclate $S(x)$, then we can find the sum of the series by taking the limit $lim_(x->1^-) S(x) = S(1)$.
#example[
$
ser (cos n x)/n
$
]
#solution[
By Dirichlet test, the series converges when $x != 2k pi$. Then we only need to calculate the sum on $(0,2pi)$. By uniform convergence on compact subsets, $S(x)$ is continuous.
Introduce variable $alpha in (-1,1)$, consider the power series $
f(alpha) = ser (cos n x)/n alpha^n.
$
Differentiate termwise on $(-1,1)$, we have
$
f'(alpha) &= ser alpha^(n-1) cos n x = Re ser alpha^(n-1) e^(i n x) \
&= Re (e^(i x))/(1-alpha e^(i x)) = Re (cos x-alpha)/(1-2 alpha cos x + alpha^2).
$
Integrate on $(-1,1)$ and notice $f(0)=0$, we have
$
f(alpha) = -1/2 ln(1-2 alpha cos x + alpha^2), alpha in (-1,1).
$
Then $
S(x) = lim_(alpha -> 1^-) f(alpha) = -1/2 ln(1-2 cos x + 1) = - ln 2 - ln abs(sin x/2).
$
#note[
Informally, we have
$
integral Re (e^(i x))/(1-alpha e^(i x)) dif alpha &= 1/2( integral e^(i x)/(1-alpha e^(i x)) dif alpha + "c.c.") \
&= - 1/2 (integral 1/(alpha-e^(-i x)) dif alpha + "c.c.") \
&= - 1/2 (ln(alpha-e^(-i x)) + ln(alpha-e^(i x))) \
&= - 1/2 ln (alpha^2 - alpha (e^(i x) + e^(-i x)) + 1) = - 1/2 ln (1-2 alpha cos x + alpha^2).
$
]
]
#note[
From the example above, we see that trig functions are actually the real (imaginary) part of complex exponentials, so we may treat them as geometric series.
]
=== $Gamma$ and $Beta$ Functions
#example[
Prove that
$
pi = ser0 (n!)^2/(2n+1)!2^(n+1).
$
]
#proof[
Note that
$
Beta(n+1,n+1) = (n!)^2/(2n+1)! = 2 integral_0^(pi/2) (cos theta sin theta)^(2n+1) dif theta.
$
We have $
ser0 (n!)^2/(2n+1)!2^(n+1) = 2 ser0 Beta(n+1,n+1) 2^(n+1) = 4 ser0 integral_0^(pi/2) cos theta sin theta (2 cos^2 theta sin^2 theta)^n dif theta.
$
Let $u_n = (2 cos^2 theta sin^2 theta)^n = (1-cos 2 theta)^n/4^n$, then $0<= u_n <= 1/2^n$. By the M-test, the series $ser0 u_n$ converges uniformly on $[0,pi/2]$, so by continuity we can exchange the sum and integral.
$
ser0 (n!)^2/(2n+1)!2^(n+1) &= 4 integral_0^(pi/2) ser0 cos theta sin theta (2 sin^2 theta cos^2 theta)^n dif theta = 4 integral_0^(pi/2) (sin theta cos theta)/(1-2 sin^2 theta cos^2 theta) dif theta \
&= 2 integral_0^(pi/2) (dif sin^2 theta)/(2sin^4 theta-2sin^2 theta+1) = 2 integral_(-1)^1 (dif u)/(u^2+1) = pi.
$
]
= Improper Integrals
== Exercises
#theorem("Frullani")[
Let $f(x)$ be a continuous function on $(0, +oo)$, then
$
integral_0^(+oo) (f(a x)-f(b x))/x dif x = (f(0^+)-f(+oo))ln(b/a) quad (a>0,b>0).
$
Even if $f(0^+)$(or $f(+oo)$) does not exist, we may replace them with $0$ if
$
integral_k^(+oo) f(x)/x dif x "converges for some " k >= 0, \
("or" integral_0^k f(x)/x dif x "converges for some " k > 0).
$
]
#proof[
$
lim_(t -> 0\ T->+oo) integral_t^T (f(a x)-f(b x))/x dif x
&=^(u=a x) lim integral_(a t)^(a T) f(u)/u dif u - lim integral_(b t)^(b T) f(u)/u dif u \
&= lim integral_(a t)^(b t) f(u)/u dif u - lim integral_(a T)^(b T) f(u)/u dif u \
&= lim f(xi_1) integral_(a t)^(b t) 1/u dif u - f(xi_2) integral_(a T)^(b T) 1/u dif u ("MVT") \
&= (f(0^+)-f(+oo))ln(b/a) (xi_1->0^+, xi_2->+oo).
$
Suppose $f(+oo)$ does not exist, if $integral_k^(+oo) f(x)/x dif x$ converges, by Cauchy criterion, we have
$
forall epsilon > 0, exists A "s.t." forall T > A/a, abs(integral_(a T)^(b T) f(u)/u dif u) < epsilon.
$
Then we can show that the limit $
lim_(T->+oo) integral_(a T)^(b T) f(u)/u dif u = 0.
$
]
#example[
$
integral_0^(+oo) (sin a x sin b x)/x dif x.
$
]
#solution[
StackExchange: #link("https://math.stackexchange.com/questions/4436436/calculate-int-0-infty-frac-sinax-sinbxx-dx")[https://math.stackexchange.com/questions/4436436/calculate-int-0-infty-frac-sinax-sinbxx-dx]
Note that $integral_1^(+oo) cos(x)/x dif x$ converges by Dirichlet's test. Then
$
I &= 1/2 integral_0^(+oo) (cos(a-b)x - cos(a+b)x)/x dif x \
&= 1/2 f(0^+) ln (a+b)/(a-b) = 1/2 ln (a+b)/(a-b).
$
]
= Fourier Series
== Exercises
#question[
Let $f(x)$ be a $2pi$-periodic function with Fourier series
$
f(x) tilde a_0/2 + sum_(n=1)^oo (a_n cos n x + b_n sin n x),
$
then what's the Fourier series of $
F(x) = 1/pi integral_(-pi)^(pi) f(t) f(x+t) dif t?
$
]
#solution[
Note that $
F(x) = iprod(f(t), f(x+t)),
$
and because $
g(t) = f(x+t) tilde a_0/2 + sum_(n=1)^oo (a_n cos n x + b_n sin n x) cos n t + (b_n cos n x - a_n sin n x) sin n t,
$
by Parseval's identity, we have
$
F(x) &= iprod(f(t), g(t)) \
&= a_0^2/2 + sum_(n=1)^oo (a_n (a_n cos n x + b_n sin n x) + b_n (b_n cos n x - a_n sin n x)) \
&= a_0^2/2 + sum_(n=1)^oo (a_n^2 + b_n^2) cos n x.
$
]
#theorem[
$f in C^k [-pi,pi]$, and $f^((k+1))$ is integrable or absolute integrable. Then the Fourier coefficients of $f$ satisfy
$
a_n, b_n = o(1/n^(k+1)).
$
]
= Useful Integrals
== Trig Functions
#theorem[
$
2integral_0^(pi/2) (dif theta)/(A + B cos theta) = integral_0^pi (dif theta)/(A + B cos theta) = 1/2 integral_0^(2pi) (dif theta)/(A + B cos theta) = pi/sqrt(A^2-B^2), A>B>0.
$
]
#proof[
$
I_1 &= integral_0^pi ((A - B cos theta) dif theta)/(A^2 - B^2 cos^2 theta) = integral_0^pi (A dif theta)/(A^2 - B^2 cos^2 theta) ("odd") \
&= (integral_0^(pi/2) + integral_(pi/2)^(pi)) (A (tan^2 + 1) dif theta)/(A^2 tan^2 + (A^2-B^2)) = integral_(-oo)^(+oo) (A dif t)/(A^2 t^2 + (A^2-B^2)) \
&= 1/sqrt(A^2-B^2) arctan u|_(-oo)^(+oo) = pi/sqrt(A^2-B^2).
$
] |
|
https://github.com/exdevutem/taller-git | https://raw.githubusercontent.com/exdevutem/taller-git/main/template.typ | typst | #let template(doc) = [
// Lenguaje del documento.
#set text(lang: "es")
// Las secciones se enumeran.
#set heading(numbering: "1.")
// Vuelve las secciones principales negritas.
#show outline.entry.where(level: 1): it => {
v(12pt, weak: true)
strong(it)
}
// Muestra los links subrayados.
#show link: underline
// Siempre muestra los raw como bloque
#set raw(block: true)
// Display inline code in a small box
// that retains the correct baseline.
#show raw.where(block: false): box.with(
fill: luma(240),
inset: (x: 3pt, y: 0pt),
outset: (y: 3pt),
radius: 2pt,
)
// Display block code in a larger block
// with more padding.
#show raw.where(block: true): block.with(
fill: luma(240),
inset: 10pt,
radius: 4pt,
)
#doc
]
|
|
https://github.com/Catlordx/WUT-LAB-Report-Typst-Template | https://raw.githubusercontent.com/Catlordx/WUT-LAB-Report-Typst-Template/master/wut.typ | typst | MIT License | #let conf(
title: none,
number: none,
course: none,
college: none,
teacher: none,
author: none,
class: none,
from: none,
to: none,
which: none,
doc,
) = {
set page(paper: "a4", margin: (bottom: 2.54cm, top: 2.54cm, left: 3.18cm, right: 3.18cm), numbering: "1")
// TODO: This maybe a bug
set text(font: ("Times New Roman", "SimSun"), lang: "zh", region: "cn")
// 设置首段缩进
set par(first-line-indent: 2em)
grid(columns: (70%, auto), rows: (30pt), [
#table(
columns: (23.54%, 25.49%, 25.49%, 25.49%),
align: (center, center, center, auto,),
stroke: (.6pt),
[学生学号],
[#number],
[实验课成绩],
[],
)
])
box(height: 20pt)
[
#set block(spacing: 10pt)
#align(center, image("assets/logo.jpg"))
#align(center)[
#set text(size: 40pt)
学 生 实 验 报 告 书
]
]
// text的tracking参数用来设置字间距
box(height: 140pt)
[
#set text(18pt)
#set table.hline(stroke: .6pt)
#align(center)[
#set text(font: "FangSong_GB2312")
#table(
stroke: none,
columns: (120pt, 190pt),
align: (left, center),
row-gutter: (4pt),
[实验课程名称],
[#course],
table.hline(start: 1),
[#text(tracking: 0.7em)[开课学院]],
[#college],
table.hline(start: 1),
[#text(tracking: 0.02em)[指导老师姓名]],
[#teacher],
table.hline(start: 1),
[#text(tracking: 0.7em)[学生姓名]],
[#author],
table.hline(start: 1),
[学生专业班级],
[#class],
table.hline(start: 1),
)
]
]
box(height: 30pt)
align(center)[
#set text(size: 16pt)
// #h 用来插入水平距离
#from #h(0.5cm) -- #h(0.5cm) #to#h(0.3cm)学年#h(0.8cm) 第#h(0.3cm)#text(size: 18pt)[#which]#h(0.3cm)学期
]
pagebreak()
doc
}
#let indent = h(2em)
#let experiment_table(course_name: none, project_name: none, student: none, class: none, year: none, month: none, day: none, content) = {
box(width: 100%, height: 100%)[
#set block(spacing: 6pt)
#text(size: 16pt)[实验课程名称 #underline(course_name) ]
#figure(align(center)[#table(
columns: (19.72%, 13.6%, 16.66%, 16.66%, 14.7%, 18.65%),
align: (auto, auto, auto, auto, auto, auto,),
[实验项目名称],
table.cell(colspan: 3)[#project_name],
[实验成绩],
[],
[实验者],
[#student],
[专业班级],
[#class],
[组别],
[/],
[同组者],
table.cell(colspan: 3)[/],
[实验日期],
[#year 年#month 月#day 日],
table.cell(colspan: 6, align: left)[#content],
)], kind: table)
]
pagebreak()
}
#let blank_table(content) = {
box(width: 100%, height: 100%)[
#figure(align(center)[#table(columns: (100%), align: left, content)], kind: table)
]
pagebreak()
}
#let enf(content) = {
set text(lang: "en", font: "Times New Roman")
set text(size: 11pt)
content
}
#let section_1() = [
#set text(font: "SimHei")
#heading()[第一部分:实验分析与设计]
]
#let section_1_1() = [
#heading(level: 2)[一、实验内容描述(问题域描述)]
]
#let section_1_2() = [
#heading(level: 2)[二、实验基本原理与设计(包括实验方案设计,实验手段的确定,试验步骤等,用硬件逻辑或者算法描述)]
]
#let section_1_3() = [
#heading(level: 2)[三、主要仪器设备及耗材]
PC机
]
#let section_2() = [
#set text(font: "SimHei")
#heading()[第二部分:实验调试与结果分析]
]
#let section_2_1() = [
#heading(level: 2)[一、调试过程(包括调试方法描述、实验数据记录,实验现象记录,实验过程发现的问题等)]
]
#let section_2_2() = [
#heading(level: 2)[二、实验结果及分析(包括结果描述、实验现象分析、影响因素讨论、综合分析和结论等)]
]
#let section_2_3() = [
#heading(level: 2)[三、实验小结、建议及体会]
] |
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/dict-05.typ | typst | Other | // Test dictionary methods.
#let dict = (a: 3, c: 2, b: 1)
#test("c" in dict, true)
#test(dict.len(), 3)
#test(dict.values(), (3, 2, 1))
#test(dict.pairs().map(p => p.first() + str(p.last())).join(), "a3c2b1")
#dict.remove("c")
#test("c" in dict, false)
#test(dict, (a: 3, b: 1))
|
https://github.com/typst-community/valkyrie | https://raw.githubusercontent.com/typst-community/valkyrie/main/src/base-type.typ | typst | Other | #import "ctx.typ": z-ctx
#import "assertions-util.typ": assert-boilerplate-params
/// Schema generator. Provides default values for when defining custom types.
#let base-type(
name: "unknown",
description: none,
optional: false,
default: none,
types: (),
assertions: (),
pre-transform: (self, it) => it,
post-transform: (self, it) => it,
) = {
assert-boilerplate-params(
assertions: assertions,
pre-transform: pre-transform,
post-transform: post-transform,
)
return (
valkyrie-type: true,
name: name,
description: if (description != none){ description } else { name },
optional: optional,
default: default,
types: types,
assertions: assertions,
pre-transform: pre-transform,
post-transform: post-transform,
assert-type: (self, it, scope: (), ctx: z-ctx(), types: ()) => {
if ((self.optional) and (it == none)) {
return true
}
if (self.types.len() == 0) {
return true
}
if (type(it) not in self.types) {
(self.fail-validation)(
self,
it,
scope: scope,
ctx: ctx,
message: "Expected " + self.types.map(repr).join(
", ",
last: " or ",
) + ". Got " + type(it),
)
return false
}
true
},
handle-assertions: (self, it, scope: (), ctx: z-ctx()) => {
for (key, value) in self.assertions.enumerate() {
if (value.at("precondition", default: none) != none) {
if (self.at(value.precondition, default: none) == none) {
continue
}
}
if not (it == none or (value.condition)(self, it)) {
(self.fail-validation)(
self,
it,
ctx: ctx,
scope: scope,
message: (value.message)(self, it),
)
return self.default
}
}
it
},
handle-descendents: (self, it, ctx: z-ctx(), scope: ()) => {
it
},
validate: (self, it, scope: (), ctx: z-ctx()) => {
//it = self.default
if (it == none or it == auto) {
it = self.default
}
it = (self.pre-transform)(self, it)
// assert types
if (
not (self.assert-type)(
self,
it,
scope: scope,
ctx: ctx,
types: self.types,
)
) {
return none
}
it = (self.handle-descendents)(self, it, scope: scope, ctx: ctx)
// Custom assertions
it = (self.handle-assertions)(self, it, scope: scope, ctx: ctx)
(self.post-transform)(self, it)
},
fail-validation: (self, it, scope: (), ctx: z-ctx(), message: "") => {
let display = "Schema validation failed on " + scope.join(".")
if message.len() > 0 {
display += ": " + message
}
ctx.outcome = display
assert(ctx.soft-error, message: display)
return none
},
)
}
|
https://github.com/mem-courses/calculus | https://raw.githubusercontent.com/mem-courses/calculus/main/homework-1/calculus-homework11.typ | typst | #import "../template.typ": *
#show: project.with(
title: "Calculus Homework #11",
authors: ((
name: "<NAME> (#47)",
email: "<EMAIL>",
phone: "3230104585"
),),
date: "December 9, 2023",
)
#let int = math.integral
= P192 习题4-1 1 #ac
$
int (1-x)(1-2x)(1-3x) dx
&= int (1-6x+11x^2-6x^3) dx\
&= -3/2 x^4 + 11/3 x^3 - 3 x^2 + x + C\
$
= P192 习题4-1 3 #ac
$
int (1-1/x^2) sqrt(x sqrt(x)) dx
= int (x^(3/4) - x^(-5/4)) dx
= 4/7 x^(7/4) + 4 x^(1/4) + C
$
= P192 习题4-1 5 #ac
$
int (x^2)/(1 + x^2) dx
= int ((1 + x^2)/(1 + x^2) - 1/(1 + x^2))dx
= x - arctan x + C
$
= P192 习题4-1 7 #ac
$
int cot^2 x = dx
= int (cos^2 x)/(sin^2 x) dx
= int (1/(sin ^2 x) - 1) dx
= -cot x - x + C
$
= P203 习题4-2 2 #ac
$
int (2x-3)^10 dx
= 1/2 int (2x-3)^10 dif(2x-3)
= 1/22 (2x-3)^11 + C
$
= P203 习题4-2 3 #ac
$
int root(3,1-3x) dx
= -1/3 int (1-3x)^(1/3) d(1-3x)
= -1/4 (1-3x)^(4/3) + C
$
= P203 习题4-2 4 #ac
$
int dx/(5x-2)^(5/2)
= 1/5 int (5x-2)^(-5/2) dif(5x-2)
= -2/15 (5x-2)^(-3/2) + C
$
= P203 习题4-2 5 #ac
$
int dx/(2+3x^2)
= 1/2 int dx/((3/2) x^2 + 1)
= 1/2 dot sqrt(2)/sqrt(3) int (dif(sqrt(3)/sqrt(2) x))/((sqrt(3)/sqrt(2) x)^2 + 1)
= 1/sqrt(6) arctan(sqrt(6)/2 x) + C
$
= P203 习题4-2 6 #ac
$
int dx/(2-3x^2)
&= -1/3 int dx/(x^2 - 2/3)
= -1/3 dot 1/(2 dot sqrt(2)/sqrt(3)) int ((x+sqrt(2/3)) - (x-sqrt(2/3)))/(x^2 - 2/3) dx\
&= -1/(2 sqrt(6)) (int dif(x-sqrt(2/3))/(x-sqrt(2/3)) + int dif(x+sqrt(2/3))/(x+sqrt(2/3)))
= -1/(2 sqrt(6)) ln lr(| (x-sqrt(2/3))/(x+sqrt(2/3)) |) + C\
&= -1/(2 sqrt(6)) ln lr(| (sqrt(3) x - sqrt(2))/(sqrt(3) x + sqrt(2)) |) + C
$
= P203 习题4-2 7 #ac
$
int dx/sqrt(2-3x^2)
&= 1/sqrt(2) int dx/sqrt(1-(sqrt(3/2) x)^2)
= 1/sqrt(3) int (dif(sqrt(3/2) x))/sqrt(1-(sqrt(3/2) x)^2) \
&= 1/sqrt(3) arcsin(sqrt(3/2) x) + C
$
= P203 习题4-2 8 #ac
$
int (tan x)/sqrt(cos x) dx
= int sin x cos^(-3/2) x dx
= - int cos^(-3/2) x dif(cos x)
= - 2/sqrt(cos x) + C
$
= P203 习题4-2 9 #ac
$
int (e^(-x) + e^(-2x)) dx
= int e^(-x) (1 + e^(-x)) dx
= - int (1 + e^(-x)) dif(e^(-x))
= - e^(-x) - 1/2 e^(-2x) + C
$
= P203 习题4-2 10 #ac
$
int dx/(1 + cos x)
&= int dx/(sin^2(1/2 x) + cos^2(1/2 x) + cos^2(1/2 x) - sin^2(1/2 x))\
&= int (dif (1/2 x))/(cos^2 (1/2 x))
= tan(1/2 x) + C
$
#note[
等价于 $-cot x + display(1/(sin x)) + C$.
]
= P203 习题4-2 11 #ac
$
int (x dx)/sqrt(1 - x^2)
= -1/2 int dif(1 - x^2)/sqrt(1 - x^2)
= -1/2 (2 sqrt(1 - x^2)) + C
= -sqrt(1 - x^2) + C
$
= P203 习题4-2 12 #ac
$
int x^2 root(3, 1 + x^3) dx
= 1/3 int (1 + x^3)^(1/3) dif(1 + x^3)
= 1/4 (1 + x^3)^(4/3) + C
$
= P203 习题4-2 13 #pc
$
int x/(3 - 2 x^2) dx
= -1/2 int dif(3 - 2 x^2)/(3 - 2 x^2)
= -1/2 ln |3 - 2 x^2| + C
$
#warn[
系数别算漏了,这里既有幂次贡献的 $2$,也有系数贡献的 $2$.
$
int x/(3 - 2 x^2) dx
= -1/4 int dif(3 - 2 x^2)/(3 - 2 x^2)
= -1/4 ln |3 - 2 x^2| + C
$
]
= P203 习题4-2 14 #ac
$
int (x dx)/((1 + x^2)^2)
= 1/2 int (dif(1 + x^2))/((1 + x^2)^2)
= -1/(2(1 + x^2)) + C
$
= P203 习题4-2 15 #ac
$
int (x dx)/(4 + x^4)
= 1/2 int (dif (x^2))/((x^2)^2 + 2^2)
= 1/4 int (dif (1/2 x^2))/((1/2 x^2)^2 + 1)
= 1/4 arctan (1/2 x^2) + C
$
= P203 习题4-2 16 #ac
$
int (x dx)/(sqrt(x) (1 + x))
&= 2 int x/(1 + x) dif(sqrt(x))
= 2 int (1 - 1/(1 + (sqrt(x))^2)) dif(sqrt(x))\
&= 2 sqrt(x) - 2 arctan(sqrt(x)) + C
$
= P203 习题4-2 17 #ac
$
int 1/x^2 sin 1/x dx
= - int sin 1/x dif(1/x)
= cos 1/x + C
$
= P203 习题4-2 18 #ac
$
int (x^3)/(x^8 - 2) dx
= 1/4 int dif(x^4)/((x^4)^2 - (sqrt(2))^2)
= 1/(8 sqrt(2)) ln lr(| (x^4 - sqrt(2))/(x^4 + sqrt(2)) |) + C
$
= P203 习题4-2 19 #ac
令 $t=sqrt(x^2 - 1),sp |x| >=1$,有 $x^2 = t^2 + 1$.
$
int dx/(x sqrt(x^2 - 1))
&= int 1/x^2 (x/sqrt(x^2 - 1) dx)
= int 1/(t^2 + 1) dt\
&= arctan t + C
= arctan sqrt(x^2 - 1) + C
$
= P203 习题4-2 20 #ac
$
int dx/(x (1 + 2 ln x))
= 1/2 int dif(1 + 2ln x)/(1 + 2 ln x)
= 1/2 ln|1 + 2 ln x| + C
$
= P203 习题4-2 21 #ac
$
int x e^(-x^2) dx
= -1/2 int e^(-x^2) d(-x^2)
= -1/2 e^(-x^2) + C
$
= P203 习题4-2 22 #ac
$
int dx/(e^x + e^(-x))
= int (e^x)/(e^(2x) + 1) dx
= int 1/((e^x)^2 + 1) dif(e^x)
= arctan e^x + 1
$
= P203 习题4-2 23 #ac
$
int dx/(x ln x ln(ln x))
= int dif(ln x)/(ln x ln(ln x))
= int dif(ln (ln x))/(ln (ln x))
= ln lr(|ln(ln x)|) + C
$
= P203 习题4-2 24 #ac
$
int (ln^2 x)/x dx
= int (ln^2 x) dif(ln x)
= 1/3 ln^3 x
$
= P203 习题4-2 25 #ac
令 $t=sqrt(1-x),sp x in (-oo,1)$,有 $x=1-t^2$.
$
int dx/sqrt(x (1-x))
&= -2 int 1/sqrt(x) (-1/(2 sqrt(1-x)) dx)
= -2 int 1/sqrt(1-t^2) dt\
&= -2 arcsin t + C
= -2 arcsin sqrt(1-x) + C
$
= P203 习题4-2 26 #ac
$
int (arctan x)/(1+x^2) dx
= int arctan x dif(arctan x)
= 1/2 arctan^2 x + C
$
= P203 习题4-2 27 #ac
$
int dx/((arcsin x)^2 sqrt(1-x^2))
= int (arcsin x)^(-2) dif(arcsin x)
= - 1/(arcsin x) + C
$
= P203 习题4-2 28 #ac
$
int (x^2+1)/(x^4+1) dx
&= int (1+1/x^2)/(x^2 + 1/(x^2)) dx
= int 1/((x-1/x)^2 + 2) dif(x-1/x)\
&= 1/sqrt(2) arctan(1/sqrt(2) (x-1/x)) + C
= 1/sqrt(2) arctan(x/sqrt(2) - 1/(x sqrt(2))) + C
$
= P203 习题4-2 29 #wa
$
int (cos x dx)/sqrt(2 + cos 2x)
= int (dif (sin x))/sqrt(3 - 2 sin^2 x)
= -1/2 int (dif(3 - 2 sin^2 x))/sqrt(3 - 2 sin^2 x)
= - sqrt(3 - 2 sin^2 x) + C
$
#warn[
$
int (cos x dx)/sqrt(2 + cos 2x)
&= int (dif (sin x))/sqrt(3 - 2 sin^2 x)
= 1/sqrt(3) dot sqrt(3)/sqrt(2) int (dif(sqrt(2)/sqrt(3) x))/(sqrt(1-(sqrt(2)/sqrt(3) x)^2))\
&= 1/sqrt(2) arcsin (sqrt(2)/sqrt(3) x) + C
$
]
= P203 习题4-2 30 #ac
$
int (x dx)/sqrt(1 + x^2 + sqrt((1 + x^2)^3))
&= int (x dx)/sqrt((1+x^2)(1 + sqrt(1 + x^2)))
= int 1/sqrt(1 + sqrt(1 + x^2)) dif(sqrt(1 + x^2))\
&= int 1/sqrt(1 + sqrt(1 + x^2)) dif(sqrt(1 + x^2) + 1)
= 2 sqrt(sqrt(1 + x^2) + 1) + C
$
= P203 习题4-2 31 #ac
$
int (x^2)/(1 + x) dx
&= int ((x+1)^2 - 2 (x+1) + 1)/(x+1) dx
= int (x + 1 - 2 + 1/(x+1)) dx\
&= int (x-1) dx + int (dif(x+1))/(x+1)
= 1/2 x^2 - x + ln|1+x| + C
$
= P203 习题4-2 32 #ac
$
int dx/(x^2 + x - 2)
&= int dx/((x+1/2)^2 - (3/2)^2)
= int (dif(x+1/2))/((x+1/2)^2 - (3/2)^2)\
&= (1/3 ln lr(| (x+1/2-3/2)/(x+1/2+3/2) |)) + C
= 1/3 ln lr(| (x-1)/(x+2) |) + C
$
= P203 习题4-2 33 #ac
$
int cos^2 x dx
= int (1+cos 2x)/2 dx
= 1/4 int (1+cos 2x) dif(2x)
= 1/2 x + 1/4 sin 2x + C
$
= P203 习题4-2 34 #wa
$
int tan^3 x dx
&= int (sin^3 x)/(cos^3 x) dx
= - int (1 - cos^2 x)/(cos^3 x) dif(cos x)\
&= int (1/(cos x) - 1/(cos^3 x)) dif(cos x)
= 1/(4 cos^4 x) - 1/(2 cos^2 x) + C
$
#warn[
$
int tan^3 x dx
&= int (sin^3 x)/(cos^3 x) dx
= - int (1 - cos^2 x)/(cos^3 x) dif(cos x)\
&= int (1/(cos x) - 1/(cos^3 x)) dif(cos x)
= 1/(2 cos^2 x) + ln|cos x| + C
$
]
= P203 习题4-2 35 #ac
$
int dx/(cos^4 x)
&= int (sin^2 x + cos^2 x)/(cos^4 x) dx
= int (tan^2 x + 1)/(cos^2 x) dx\
&= int (tan^2 x + 1) dif(tan x)
= 1/3 tan^3 x + tan x + C
$
= P203 习题4-2 36 #ac
令 $t=e^x$,则有 $dt=e^x dx=t dx$.
$
int dx/(1 + e^x)
&= int 1/(1+t) dot (dt)/t
= int ((t+1)-t)/(t(t+1)) dt
= int (1/t - 1/(t+1)) dt\
&= ln |t/(t+1)| + C
= ln (e^x/(e^x+1)) + C
= x - ln(e^x + 1) + C
$
= P203 习题4-2 37 #ac
令 $t=root(3,1-x)$,则有 $dt=display(-dx/(3 (root(3,1-x))^2) = -dx/(3t^2))$.
$
int x^2 root(3,1-x) dx
&= int (1-t^3)^2 t (-3t^2) dt
= int (-3t^9 + 6t^6 - 3t^3) dt\
&= -3/10 t^10 + 6/7 t^7 - 3/4 t^4 + C\
&= -3/10 (1-x)^(10/3) + 6/7 (1-x)^(7/3) - 3/4 (1-x)^(4/3) + C
$
= P203 习题4-2 38 #ac
令 $t=1-5x^2$,则有 $dt=-10x dx$.
$
int x^3 (1-5x^2)^10 dx
&= int 1/5(1-t) t^10 dt
= 1/5 int (t^10 - t^11) dt\
&= 1/55 t^11 - 1/60 t^12 + C
= 1/55 (1-5x^2)^11 - 1/60 (1-5x^2)^12 + C
$
= P203 习题4-2 39 #ac
令 $t=1-x^2$,则 $dt=-2x dx$.
$
int x^5/sqrt(1-x^2) dx
&= -1/2 int (1-t)^2/sqrt(t) dt
= -1/2 int (t^(-1/2) - 2 t^(1/2) + t^(3/2)) dt\
&= - t^(1/2) + 2/3 t^(3/2) - 1/5 t^(5/2) + C\
&= - (1-x^2)^(1/2) + 2/3 (1-x^2)^(3/2) - 1/5 (1-x^2)^(5/2) + C
$
= P203 习题4-2 40 #ac
令 $t=2-5x^3$,则 $dt=-15 x^2 dx$
$
int x^5 (2-5x^3)^(2/3) dx
&= -1/75 int (2-t) t^(2/3) dt
= -1/75 int (2 t^(2/3) - t^(5/3)) dt\
&= -1/75 (6/5 t^(5/3) - 3/8 t^(8/3)) + C\
&= -2/125 (2-5x^3)^(5/3) + 1/200 (2-5x^3)^(8/3) + C
$
= P204 习题4-2 41 #ac
$
int dx/((2x^2+1) sqrt(x^2 + 1))
&= int (dif (tan t))/((2 tan^2 t + 1) sqrt(tan^2 t + 1))
= int (cos^3 t)/(2 sin^2 t + cos^2 t) dif(tan t)\
&= int (cos t)/(2 sin^2 t + cos^2 t) dt
= int 1/(sin^2 t + 1) dif(sin t)\
&= arctan (sin (arctan x)) + C
$
= P204 习题4-2 42 #ac
令 $t=ln x$,则 $dt=display(dx/x)$.再令 $u=sqrt(1+t)$,则 $du = display(1/(2 u)) dt$,$t=u^2-1$
$
int (ln x dx)/(x sqrt(1 + ln x))
&= int (t)/sqrt(1+t) dt
= int (u^2 - 1)/u (2u du)
= 2 int (u^2 - 1) du\
&= 2/3 u^3 - 2 u + C
= 2/3 (1+t)^(3/2) - 2 (1+t)^(1/2) + C\
&= 2/3 (1+ln x)^(3/2) - 2 (1+ln x)^(1/2) + C\
$
= P204 习题4-2 43 #wa
已知:$a<x<b$.
$
int dx/sqrt((x-a)(b-x))
&= int dx/sqrt(((a-b)/2)^2 - (x-(a+b)/2)^2)
= int (dif((2x)/(a-b) - (a+b)/(a-b)))/sqrt(1-((2x)/(a-b) - (a+b)/(a-b))^2)\
&= arcsin ((2x)/(a-b) - (a+b)/(a-b)) + C
$
#warn[
这里 $a-b<0$.*根号内的系数提出来的时候注意正负号!*
$
int dx/sqrt((x-a)(b-x))
&= int dx/sqrt(((a-b)/2)^2 - (x-(a+b)/2)^2)
= - int (dif((2x)/(a-b) - (a+b)/(a-b)))/sqrt(1-((2x)/(a-b) - (a+b)/(a-b))^2)\
&= - arcsin ((2x)/(a-b) - (a+b)/(a-b)) + C
$
采用别的方法可以得到:$2 arcsin display(sqrt((x-a)/(b-a))) + C$.
]
= P204 习题4-2 44 #wa
令 $t = e^x$,则 $dt = t dx$.再令 $u=sqrt(1+t)$,则 $du = display(1/(2 u)) dt$.
$
int dx/sqrt(1 + e^x)
&= int t/sqrt(1+t) dt
= int (u^2-1)/u (2u du)
= 2 int (u^2 - 1) du\
&= 2/3 u^3 - 2 u + C
= 2/3 (sqrt(1+t))^3 - 2 sqrt(1+t) + C\
&= 2/3 (1+e^x)^(3/2) - 2 (1+e^x)^(1/2) + C
$
#warn[
令 $u=e^x+1$,则 $du=(u-1) dx$.再令 $v=sqrt(u)$,则 $dv=display(du/(2 v))$
$
int dx/sqrt(1 + e^x)
&= int du/(sqrt(u) (u-1))
= int (2v dv)/(v(v^2-1))
= 2 int (dv)/(v^2-1)\
&= int ((v+1)-(v-1))/((v+1)(v-1)) dv
= int (1/(v-1) - 1/(v+1)) dv\
&= ln|v-1| - ln|v+1| + C\
&= ln|sqrt(e^x+1)-1| - ln|sqrt(e^x+1)+1| + C\
&= ln(sqrt(e^x+1)-1) - ln(sqrt(e^x+1)+1) + C\
$
采用别的方法可以得到:$x-2 ln(1+sqrt(1+e^x)) + C$.
]
= P204 习题4-2 45 #ac
令 $t=sqrt(e^x-1)$,则 $dt = display((e^x)/(2 sqrt(e^x-1))) dx$,且 $x = ln(t^2 + 1)$.
$
int (x e^x)/sqrt(e^x - 1) dx
&= 2 int ln(t^2 + 1) dt
= 2 (t ln(t^2 + 1) - int t dif(ln(t^2 + 1)))\
&= 2 (t ln(t^2 + 1) - int (2t^2)/(t^2 + 1) dt)\
&= 2t ln(t^2 + 1) - 4t + 4 arctan t + C\
&= 2x sqrt(e^x - 1) - 4 sqrt(e^x - 1) + 4 arctan sqrt(e^x - 1) + C
$ |
|
https://github.com/DeveloperPaul123/modern-cv | https://raw.githubusercontent.com/DeveloperPaul123/modern-cv/main/docs/manual.typ | typst | Other | #import "../lib.typ"
#import "@preview/tidy:0.3.0"
#let docs = tidy.parse-module(
read("../lib.typ"),
name: "Modern CV",
scope: (resume: lib),
)
#tidy.show-module(docs)
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/vienna-tech/0.1.0/template/main.typ | typst | Apache License 2.0 | #import "@preview/vienna-tech:0.1.0": *
// Fancy Representation for LaTeX and Typst
#let typst = {
text(font: "Linux Libertine", weight: "semibold", fill: eastern)[typst]
}
#let latex = {
set text(font: "New Computer Modern")
box(width: 2.55em, {
[L]
place(top, dx: 0.3em, text(size: 0.7em)[A])
place(top, dx: 0.7em)[T]
place(top, dx: 1.26em, dy: 0.22em)[E]
place(top, dx: 1.8em)[X]
})
}
#show "Typst": typst
#show "LaTeX": latex
// Useing the configuration
#show: tuw-thesis.with(
title: [Instruktionen zur Abfassung der Bachelorarbeit],
thesis-type: [Bachelorarbeit],
lang: "de",
authors: (
(
name: "<NAME>",
email: "<EMAIL>",
matrnr: "12345678",
date: datetime.today().display("[day] [month repr:long] [year]"),
),
),
abstract: include "abstract.typ",
bibliography: bibliography("assets/refs.bib"),
appendix: include "appendix.typ",
)
// Main Content
= Einleitung
Die Bachelorarbeit kann in Deutsch oder Englisch verfasst werden.
Die Länge darf 12 Seiten nicht unterschreiten und 30 Seiten nicht
überschreiten (exkl. Anhang).
Nach dem Titel der Arbeit werden der Autor und darauf eine Kurzfassung
angeführt.
Danach beginnt der Hauptteil der Arbeit.
Die Bachelorarbeit hat keine Titelseite und nur bei Bedarf ein
Inhaltsverzeichnis (zwischen Kurzfassung und Kapitel 1).
Der Titel der Arbeit wird in dem Konfigurationsbefehl `tuw-thesis` angegeben, ebenso wie der Name des/der Autors/Autoren, die E-Mailadresse, die Matrikelnummer und das Datum.
Durch den Konfigurationsbefehl wird nicht nur der Typografische Stil der Arbeit festgelegt, sondern es wird auch der Titelblock, das Inhalts- und das Literaturverzeichnis generiert.
#include "sections.typ" |
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-1F00.typ | typst | Apache License 2.0 | #let data = (
("GREEK SMALL LETTER ALPHA WITH PSILI", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH DASIA", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI", "Ll", 0),
("GREEK CAPITAL LETTER ALPHA WITH PSILI", "Lu", 0),
("GREEK CAPITAL LETTER ALPHA WITH DASIA", "Lu", 0),
("GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA", "Lu", 0),
("GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA", "Lu", 0),
("GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA", "Lu", 0),
("GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA", "Lu", 0),
("GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI", "Lu", 0),
("GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI", "Lu", 0),
("GREEK SMALL LETTER EPSILON WITH PSILI", "Ll", 0),
("GREEK SMALL LETTER EPSILON WITH DASIA", "Ll", 0),
("GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA", "Ll", 0),
("GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA", "Ll", 0),
("GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA", "Ll", 0),
("GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA", "Ll", 0),
(),
(),
("GREEK CAPITAL LETTER EPSILON WITH PSILI", "Lu", 0),
("GREEK CAPITAL LETTER EPSILON WITH DASIA", "Lu", 0),
("GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA", "Lu", 0),
("GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA", "Lu", 0),
("GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA", "Lu", 0),
("GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA", "Lu", 0),
(),
(),
("GREEK SMALL LETTER ETA WITH PSILI", "Ll", 0),
("GREEK SMALL LETTER ETA WITH DASIA", "Ll", 0),
("GREEK SMALL LETTER ETA WITH PSILI AND VARIA", "Ll", 0),
("GREEK SMALL LETTER ETA WITH DASIA AND VARIA", "Ll", 0),
("GREEK SMALL LETTER ETA WITH PSILI AND OXIA", "Ll", 0),
("GREEK SMALL LETTER ETA WITH DASIA AND OXIA", "Ll", 0),
("GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI", "Ll", 0),
("GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI", "Ll", 0),
("GREEK CAPITAL LETTER ETA WITH PSILI", "Lu", 0),
("GREEK CAPITAL LETTER ETA WITH DASIA", "Lu", 0),
("GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA", "Lu", 0),
("GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA", "Lu", 0),
("GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA", "Lu", 0),
("GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA", "Lu", 0),
("GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI", "Lu", 0),
("GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI", "Lu", 0),
("GREEK SMALL LETTER IOTA WITH PSILI", "Ll", 0),
("GREEK SMALL LETTER IOTA WITH DASIA", "Ll", 0),
("GREEK SMALL LETTER IOTA WITH PSILI AND VARIA", "Ll", 0),
("GREEK SMALL LETTER IOTA WITH DASIA AND VARIA", "Ll", 0),
("GREEK SMALL LETTER IOTA WITH PSILI AND OXIA", "Ll", 0),
("GREEK SMALL LETTER IOTA WITH DASIA AND OXIA", "Ll", 0),
("GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI", "Ll", 0),
("GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI", "Ll", 0),
("GREEK CAPITAL LETTER IOTA WITH PSILI", "Lu", 0),
("GREEK CAPITAL LETTER IOTA WITH DASIA", "Lu", 0),
("GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA", "Lu", 0),
("GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA", "Lu", 0),
("GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA", "Lu", 0),
("GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA", "Lu", 0),
("GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI", "Lu", 0),
("GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI", "Lu", 0),
("GREEK SMALL LETTER OMICRON WITH PSILI", "Ll", 0),
("GREEK SMALL LETTER OMICRON WITH DASIA", "Ll", 0),
("GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA", "Ll", 0),
("GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA", "Ll", 0),
("GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA", "Ll", 0),
("GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA", "Ll", 0),
(),
(),
("GREEK CAPITAL LETTER OMICRON WITH PSILI", "Lu", 0),
("GREEK CAPITAL LETTER OMICRON WITH DASIA", "Lu", 0),
("GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA", "Lu", 0),
("GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA", "Lu", 0),
("GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA", "Lu", 0),
("GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA", "Lu", 0),
(),
(),
("GREEK SMALL LETTER UPSILON WITH PSILI", "Ll", 0),
("GREEK SMALL LETTER UPSILON WITH DASIA", "Ll", 0),
("GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA", "Ll", 0),
("GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA", "Ll", 0),
("GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA", "Ll", 0),
("GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA", "Ll", 0),
("GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI", "Ll", 0),
("GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI", "Ll", 0),
(),
("GREEK CAPITAL LETTER UPSILON WITH DASIA", "Lu", 0),
(),
("GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA", "Lu", 0),
(),
("GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA", "Lu", 0),
(),
("GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI", "Lu", 0),
("GREEK SMALL LETTER OMEGA WITH PSILI", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH DASIA", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI", "Ll", 0),
("GREEK CAPITAL LETTER OMEGA WITH PSILI", "Lu", 0),
("GREEK CAPITAL LETTER OMEGA WITH DASIA", "Lu", 0),
("GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA", "Lu", 0),
("GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA", "Lu", 0),
("GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA", "Lu", 0),
("GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA", "Lu", 0),
("GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI", "Lu", 0),
("GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI", "Lu", 0),
("GREEK SMALL LETTER ALPHA WITH VARIA", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH OXIA", "Ll", 0),
("GREEK SMALL LETTER EPSILON WITH VARIA", "Ll", 0),
("GREEK SMALL LETTER EPSILON WITH OXIA", "Ll", 0),
("GREEK SMALL LETTER ETA WITH VARIA", "Ll", 0),
("GREEK SMALL LETTER ETA WITH OXIA", "Ll", 0),
("GREEK SMALL LETTER IOTA WITH VARIA", "Ll", 0),
("GREEK SMALL LETTER IOTA WITH OXIA", "Ll", 0),
("GREEK SMALL LETTER OMICRON WITH VARIA", "Ll", 0),
("GREEK SMALL LETTER OMICRON WITH OXIA", "Ll", 0),
("GREEK SMALL LETTER UPSILON WITH VARIA", "Ll", 0),
("GREEK SMALL LETTER UPSILON WITH OXIA", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH VARIA", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH OXIA", "Ll", 0),
(),
(),
("GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI", "Ll", 0),
("GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI", "Lt", 0),
("GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI", "Ll", 0),
("GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI", "Lt", 0),
("GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI", "Ll", 0),
("GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI", "Lt", 0),
("GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI", "Lt", 0),
("GREEK SMALL LETTER ALPHA WITH VRACHY", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH MACRON", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI", "Ll", 0),
(),
("GREEK SMALL LETTER ALPHA WITH PERISPOMENI", "Ll", 0),
("GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI", "Ll", 0),
("GREEK CAPITAL LETTER ALPHA WITH VRACHY", "Lu", 0),
("GREEK CAPITAL LETTER ALPHA WITH MACRON", "Lu", 0),
("GREEK CAPITAL LETTER ALPHA WITH VARIA", "Lu", 0),
("GREEK CAPITAL LETTER ALPHA WITH OXIA", "Lu", 0),
("GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI", "Lt", 0),
("GREEK KORONIS", "Sk", 0),
("GREEK PROSGEGRAMMENI", "Ll", 0),
("GREEK PSILI", "Sk", 0),
("GREEK PERISPOMENI", "Sk", 0),
("GREEK DIALYTIKA AND PERISPOMENI", "Sk", 0),
("GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI", "Ll", 0),
(),
("GREEK SMALL LETTER ETA WITH PERISPOMENI", "Ll", 0),
("GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI", "Ll", 0),
("GREEK CAPITAL LETTER EPSILON WITH VARIA", "Lu", 0),
("GREEK CAPITAL LETTER EPSILON WITH OXIA", "Lu", 0),
("GREEK CAPITAL LETTER ETA WITH VARIA", "Lu", 0),
("GREEK CAPITAL LETTER ETA WITH OXIA", "Lu", 0),
("GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI", "Lt", 0),
("GREEK PSILI AND VARIA", "Sk", 0),
("GREEK PSILI AND OXIA", "Sk", 0),
("GREEK PSILI AND PERISPOMENI", "Sk", 0),
("GREEK SMALL LETTER IOTA WITH VRACHY", "Ll", 0),
("GREEK SMALL LETTER IOTA WITH MACRON", "Ll", 0),
("GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA", "Ll", 0),
("GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA", "Ll", 0),
(),
(),
("GREEK SMALL LETTER IOTA WITH PERISPOMENI", "Ll", 0),
("GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI", "Ll", 0),
("GREEK CAPITAL LETTER IOTA WITH VRACHY", "Lu", 0),
("GREEK CAPITAL LETTER IOTA WITH MACRON", "Lu", 0),
("GREEK CAPITAL LETTER IOTA WITH VARIA", "Lu", 0),
("GREEK CAPITAL LETTER IOTA WITH OXIA", "Lu", 0),
(),
("GREEK DASIA AND VARIA", "Sk", 0),
("GREEK DASIA AND OXIA", "Sk", 0),
("GREEK DASIA AND PERISPOMENI", "Sk", 0),
("GREEK SMALL LETTER UPSILON WITH VRACHY", "Ll", 0),
("GREEK SMALL LETTER UPSILON WITH MACRON", "Ll", 0),
("GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA", "Ll", 0),
("GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA", "Ll", 0),
("GREEK SMALL LETTER RHO WITH PSILI", "Ll", 0),
("GREEK SMALL LETTER RHO WITH DASIA", "Ll", 0),
("GREEK SMALL LETTER UPSILON WITH PERISPOMENI", "Ll", 0),
("GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI", "Ll", 0),
("GREEK CAPITAL LETTER UPSILON WITH VRACHY", "Lu", 0),
("GREEK CAPITAL LETTER UPSILON WITH MACRON", "Lu", 0),
("GREEK CAPITAL LETTER UPSILON WITH VARIA", "Lu", 0),
("GREEK CAPITAL LETTER UPSILON WITH OXIA", "Lu", 0),
("GREEK CAPITAL LETTER RHO WITH DASIA", "Lu", 0),
("GREEK DIALYTIKA AND VARIA", "Sk", 0),
("GREEK DIALYTIKA AND OXIA", "Sk", 0),
("GREEK VARIA", "Sk", 0),
(),
(),
("GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI", "Ll", 0),
(),
("GREEK SMALL LETTER OMEGA WITH PERISPOMENI", "Ll", 0),
("GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI", "Ll", 0),
("GREEK CAPITAL LETTER OMICRON WITH VARIA", "Lu", 0),
("GREEK CAPITAL LETTER OMICRON WITH OXIA", "Lu", 0),
("GREEK CAPITAL LETTER OMEGA WITH VARIA", "Lu", 0),
("GREEK CAPITAL LETTER OMEGA WITH OXIA", "Lu", 0),
("GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI", "Lt", 0),
("GREEK OXIA", "Sk", 0),
("GREEK DASIA", "Sk", 0),
)
|
https://github.com/Complex2-Liu/macmo | https://raw.githubusercontent.com/Complex2-Liu/macmo/main/contests/2023/content/problem-11.typ | typst | #import "../lib/math.typ": problem, proof, note, ans
#problem[
试确定满足以下三个条件的所有正整数数列 $(a_n)_(n >= 1)$:
#enum(numbering: "(i)", indent: 1em)[
对任意的整数 $n >= 1$ 都有 $a_n < a_(n + 1)$;
][
对任意的整数 $n >= 1$ 都有 $a_(2n) = a_n + n$;
][
若 $a_n$ 是素数, 则 $n$ 是素数.
]
并给出以上的证明.
]
#proof[
条件 (i) 和 (ii) 告诉我们 $a_(n + 1) = a_n + 1$, 从而 $a_n = n + a$
for some $a >= 0$. 问题归结为: 试确定所有非负整数 $a$, 使得若 $n + a$
是素数, 则 $(n + a) - a = n$ 是素数. Now we claim that $a = 0$. Assume to the contrary
that $a > 0$, 任取正整数 $d$ 使得 $gcd(a, d) = 1$, 然后考虑等差数列 $a + k d$,
Dirichlet's theorem 告诉我们这个等差数列中有无穷多个素数,
但此时 $(a + k d) - a = k d$ 是两个正整数的乘积, 并不是素数, 这就引出了矛盾.
]
/* vim: set ft=typst: */
|
|
https://github.com/RaphGL/ElectronicsFromBasics | https://raw.githubusercontent.com/RaphGL/ElectronicsFromBasics/main/DC/chap7/5_building_series_parallel_resistor_circuits.typ | typst | Other | #import "../../core/core.typ"
=== Building series-parallel resistor circuits
Once again, when building battery/resistor circuits, the student or
hobbyist is faced with several different modes of construction. Perhaps
the most popular is the #emph[solderless breadboard]: a platform for
constructing temporary circuits by plugging components and wires into a
grid of interconnected points. A breadboard appears to be nothing but a
plastic frame with hundreds of small holes in it. Underneath each hole,
though, is a spring clip which connects to other spring clips beneath
other holes. The connection pattern between holes is simple and uniform:
#image("static/00447.png")
Suppose we wanted to construct the following series-parallel combination
circuit on a breadboard:
#image("static/00123.png")
The recommended way to do so on a breadboard would be to arrange the
resistors in approximately the same pattern as seen in the schematic,
for ease of relation to the schematic. If 24 volts is required and we
only have 6-volt batteries available, four may be connected in series to
achieve the same effect:
#image("static/00458.png")
This is by no means the only way to connect these four resistors
together to form the circuit shown in the schematic. Consider this
alternative layout:
#image("static/00459.png")
If greater permanence is desired without resorting to soldering or
wire-wrapping, one could choose to construct this circuit on a
#emph[terminal strip] (also called a #emph[barrier strip], or
#emph[terminal block]). In this method, components and wires are secured
by mechanical tension underneath screws or heavy clips attached to small
metal bars. The metal bars, in turn, are mounted on a nonconducting body
to keep them electrically isolated from each other.
Building a circuit with components secured to a terminal strip isn\'t as
easy as plugging components into a breadboard, principally because the
components cannot be physically arranged to resemble the schematic
layout. Instead, the builder must understand how to \"bend\" the
schematic\'s representation into the real-world layout of the strip.
Consider one example of how the same four-resistor circuit could be
built on a terminal strip:
#image("static/00460.png")
Another terminal strip layout, simpler to understand and relate to the
schematic, involves anchoring parallel resistors (R#sub[1]\/\/R#sub[2]
and R#sub[3]\/\/R#sub[4]) to the same two terminal points on the strip
like this:
#image("static/00461.png")
Building more complex circuits on a terminal strip involves the same
spatial-reasoning skills, but of course requires greater care and
planning. Take for instance this complex circuit, represented in
schematic form:
#image("static/00137.png")
The terminal strip used in the prior example barely has enough terminals
to mount all seven resistors required for this circuit! It will be a
challenge to determine all the necessary wire connections between
resistors, but with patience it can be done. First, begin by installing
and labeling all resistors on the strip. The original schematic diagram
will be shown next to the terminal strip circuit for reference:
#image("static/00462.png")
Next, begin connecting components together wire by wire as shown in the
schematic. Over-draw connecting lines in the schematic to indicate
completion in the real circuit. Watch this sequence of illustrations as
each individual wire is identified in the schematic, then added to the
real circuit:
#image("static/00463.png")
#image("static/00464.png")
#image("static/00465.png")
#image("static/00466.png")
#image("static/00467.png")
#image("static/00468.png")
#image("static/00469.png")
#image("static/00470.png")
#image("static/00471.png")
#image("static/00472.png")
#image("static/00473.png")
Although there are minor variations possible with this terminal strip
circuit, the choice of connections shown in this example sequence is
both electrically accurate (electrically identical to the schematic
diagram) and carries the additional benefit of not burdening any one
screw terminal on the strip with more than two wire ends, a good
practice in any terminal strip circuit.
An example of a \"variant\" wire connection might be the very last wire
added (step 11), which I placed between the left terminal of R#sub[2]
and the left terminal of R#sub[3]. This last wire completed the parallel
connection between R#sub[2] and R#sub[3] in the circuit. However, I
could have placed this wire instead between the left terminal of
R#sub[2] and the right terminal of R#sub[1], since the right terminal of
R#sub[1] is already connected to the left terminal of R#sub[3] (having
been placed there in step 9) and so is electrically common with that one
point. Doing this, though, would have resulted in #emph[three] wires
secured to the right terminal of R#sub[1] instead of two, which is a
#emph[faux pax] in terminal strip etiquette. Would the circuit have
worked this way? Certainly! It\'s just that more than two wires secured
at a single terminal makes for a \"messy\" connection: one that is
aesthetically unpleasing and may place undue stress on the screw
terminal.
Another variation would be to reverse the terminal connections for
resistor R#sub[7]. As shown in the last diagram, the voltage polarity
across R#sub[7] is negative on the left and positive on the right (- ,
+), whereas all the other resistor polarities are positive on the left
and negative on the right (+ , -):
#image("static/00492.png")
While this poses no electrical problem, it might cause confusion for
anyone measuring resistor voltage drops with a voltmeter, especially an
analog voltmeter which will \"peg\" downscale when subjected to a
voltage of the wrong polarity. For the sake of consistency, it might be
wise to arrange all wire connections so that all resistor voltage drop
polarities are the same, like this:
#image("static/00493.png")
Though electrons do not care about such consistency in component layout,
people do. This illustrates an important aspect of any engineering
endeavor: the human factor. Whenever a design may be modified for easier
comprehension and/or easier maintenance -- with no sacrifice of
functional performance -- it should be done so.
#core.review[
- Circuits built on terminal strips can be difficult to lay out, but
when built they are robust enough to be considered permanent, yet easy
to modify.
- It is bad practice to secure more than two wire ends and/or component
leads under a single terminal screw or clip on a terminal strip. Try
to arrange connecting wires so as to avoid this condition.
- Whenever possible, build your circuits with clarity and ease of
understanding in mind. Even though component and wiring layout is
usually of little consequence in DC circuit function, it matters
significantly for the sake of the person who has to modify or
troubleshoot it later.
]
|
https://github.com/JamesWilmot/master-applied-cybernetics-2025 | https://raw.githubusercontent.com/JamesWilmot/master-applied-cybernetics-2025/main/application/Wilmot_James_Portfolio.typ | typst | #import "@preview/fontawesome:0.4.0": *
#import "@preview/modernpro-coverletter:0.0.3": *
#show: statement.with(
font-type: "PT Serif",
name: [],
address: [],
contacts: (
(text: [#fa-icon("location-dot") UK]),
(text: [#fa-icon("mobile") 123-456-789], link: "tel:123-456-789"),
(text: [#fa-icon("link") example.com], link: "https://www.example.com"),
(text: [#fa-icon("github") github], link: "https://github.com/"),
(text: [#fa-icon("envelope") <EMAIL>], link: "mailto:<EMAIL>"),
),
)
#v(1em)
#align(center, text(13pt, weight: "semibold")[#underline([Title])])
#set par(first-line-indent: 2em, justify: true)
#set text(11pt, weight: "regular")
// Main body of the statement |
|
https://github.com/Treeniks/bachelor-thesis-isabelle-vscode | https://raw.githubusercontent.com/Treeniks/bachelor-thesis-isabelle-vscode/master/README.md | markdown | # Improving Isabelle/VSCode: Towards Better Prover IDE Integration via Language Server
Bachelor's Thesis in *Informatics: Games Engineering* at [TUM](https://www.tum.de/). The thesis and colloquium presentation slides are written with [Typst](https://typst.app/). The thesis template is my own, and may be released separately in the future. Build using [just](https://just.systems/).
- **Author:** <NAME>
- **Supervisor:** Prof. Dr. <NAME>
- **Advisors:** Prof. Dr. <NAME>, M.Sc. <NAME>
- **Start Date:** 15.04.2024
- **Submission Date:** 15.08.2024
**German Title:** Isabelle/VSCode Verbesserungen: Fortschritte in der Prover IDE Integration mittels Language Server
## Acknowledgements
There are several people I would like to thank:
**Prof. Dr. <NAME>** for giving me the opportunity to work on a tool as big and prominent as Isabelle.
**My advisor <NAME>** for meeting with me weekly, helping me understand the inner workings of Isabelle, discussing design and implementation details and lending me his time for other silly questions.
**My father <NAME>** for doing his best rubber duck impression and letting me waste his time by explaining the contents of this thesis to him to sort out my thoughts.
**My friends <NAME> and <NAME>** for their valuable feedback on various sections of this thesis and helping me with its overall structure.
**Many more of my fellow student friends** for joining me in my visits to the cafeteria and providing mental and emotional respite during lunch.
## Abstract
> The primary interface for interacting with the Isabelle proof assistant is the Isabelle/jEdit prover IDE. Isabelle/VSCode was developed as an alternative, implementing a language server for the Language Server Protocol and a language client for Visual Studio Code. However, Isabelle/VSCode did not provide a user experience comparable to Isabelle/jEdit. This thesis explores and implements several improvements to address these shortcomings by refining existing functionality and augmenting Isabelle/VSCode with new features. Key enhancements include improved completions, persistent decorations on file switch, code actions for interacting with active markup, and better formatting for state and output panels. Additionally, we implemented more granular control over symbol handling and an Isabelle system option to turn off HTML output, increasing compatibility with potential new language clients. We developed prototype language clients for the Neovim and Sublime Text code editors to evaluate the improved language server's versatility. While an Isabelle language client for these editors was previously infeasible, our enhancements made them viable. Our work not only brings Isabelle/VSCode closer to feature parity with Isabelle/jEdit, but also paves the way for future integrations with a broader range of development environments.
## Fonts & Logo
The thesis uses the following fonts:
- Isabelle's modified DejaVu Sans Mono
- [DejaVu Sans](https://dejavu-fonts.github.io/)
- [JetBrains Mono](https://www.jetbrains.com/lp/mono/)
- [Noto Sans Mono](https://fonts.google.com/noto/specimen/Noto+Sans+Mono)
- [STIX Two](https://www.stixfonts.org/)
For ease of building, these are all included in the `fonts` directory.
It also requires a TUM's logo in svg format, included as `resources/tum-logo.svg` and grabbed from [MyTUM-Portal](https://portal.mytum.de/corporatedesign/index_html).
|
|
https://github.com/soul667/typst | https://raw.githubusercontent.com/soul667/typst/main/PPT/typst-slides-fudan/themes/polylux/book/src/dynamic/only-uncover.typ | typst | #import "../../../polylux.typ": *
#set page(paper: "presentation-16-9")
#set text(size: 30pt)
#polylux-slide[
before #only(2)[*displayed only on subslide 2*] after
before #uncover(2)[*uncovered only on subslide 2*] after
]
|
|
https://github.com/QuadnucYard/crossregex-typ | https://raw.githubusercontent.com/QuadnucYard/crossregex-typ/main/README.md | markdown | MIT License | # crossregex-typ
A crossword-like game written in Typst. You should fill in letters to satisfy regular expression constraints.
Currently, _squares_ and _regular hexagons_ are supported.
> [!note]
> This is not a puzzle solver, but a puzzle layout builder.
It takes inspiration from a web image, which derives our standard example. **I'm not the original author.**

## Examples
Code can be found in `./examples`
### Sudoku
Derives from <https://regexcrossword.com/playerpuzzles/65bbe21e88914>.

### Mini hex

### Standard hex

## Appearance
### Cells
The cells can be customized.
For squares, the default is
```typst
#polygon.regular(size: calc.sqrt(2) * 1em, vertices: 4, stroke: 0.5pt)
```
For hexagons, the default is
```typst
#rotate(30deg, polygon.regular(size: 2em, vertices: 6, stroke: 0.5pt), origin: center)
```
### Constraint hints
In front of each regex constraint text, we have a circle in red, yellow or green. It has the following meaning:
- $\color{red}\text{Red}$: This constraint is not satisfied.
- $\color{yellow}\text{Yellow}$: This constraint is satisfied, but unfilled cells exist.
- $\color{green}\text{Green}$: This constraint is satisfied.
You can change this default behavior by passing a custom `deco-config.hint-marker`.
The regex box can also be customized by the `deco-config.regex-style` function. The default function is
```typst
#box.with(fill: gray.transparentize(90%), outset: (x: 0.1em, y: 0.2em), radius: 0.2em)
```
We use a wasm plugin to check regex matching, which employs the [`fancy-regex`](https://docs.rs/fancy-regex/latest/fancy_regex/) crate to bring more features than `regex` used by Typst provided. You can refer to its doc to learn about supported syntax. Note that `\d` is not supported. Please use `[0-9]` directly instead.
### Filled letters
In the grids, upper-case letters are colored $\color{blue}\text{blue}$, while others are colored $\color{purple}\text{purple}$. So you can use lower-case letters or symbols as hints.
This default behavior can also be changed by a custom `cell-config`.
### Counting
If you provide answers, it will show the number of filled and total cells at bottom left.
You can provide a custom creator function `progress-creator`, whose default is
```typst
#(filled, total) => text(orange)[#filled/#total]
```
You can turn of the progress by a `none` value.
## Basic Usage
We use `crossregex-square` and `crossregex-hex` to build square and hex layouts respectively. They have the same argument formats. A `crossregex` dispatcher function can be used for dynamic grid kind, which is compatible with version 0.1.0.
```typst
#import "@preview/crossregex:0.2.0": crossregex
// or import and use `crossregex-hex`
#crossregex(
3,
constraints: (
`A.*`, `B.*`, `C.*`, `D.*`, `E.*`,
`F.*`, `G.*`, `H.*`, `I.*`, `J.*`,
`K.*`, `L.*`, `M.*`, `N.*`, `O.*`,
),
answer: (
"ABC",
"DEFG",
"HIJKL",
"MNOP",
"QRS",
),
)
```
```typst
#import "@preview/crossregex:0.2.0": crossregex-square
#crossregex-square(
9,
alphabet: regex("[0-9]"),
constraints: (
`.*`,
`.*`,
`.*`,
`.*`,
`.*[12]{2}8`,
`[1-9]9.*`,
`.*`,
`.*`,
`.*`,
`[1-9]7[29]{2}8.6.*`,
`.*2[^3]{2}1.`,
`.9.315[^6]+`,
`.+4[15]{2}79.`,
`[75]{2}18.63[1-9]+`,
`8.*[^2][^3][^1]+56[^6]`,
`[^5-6][0-9][56]{2}.*9`,
`.*`,
`[98]{2}5.*[27]{2}6`,
),
answer: (
"934872651",
"812456937",
"576913482",
"125784369",
"467395128",
"398261574",
"241537896",
"783649215",
"659128743",
),
cell: rect(width: 1.4em, height: 1.4em, radius: 0.1em, stroke: 1pt + orange, fill: orange.transparentize(80%)),
cell-config: (size: 1.6em, text-style: (size: 1.4em)),
)
```
## Document
Details are shown in the doc comments above the `crossregex` function in `lib.typ`. You can choose to turn off some views.
Feel free to open issues if any problems.
## Changelog
### 0.2.0
- Feature: Supports square shapes.
- Feature: Supports customization the appearance of everything, even the cells.
- Feature: Supports custom alphabets.
- Fix: An mistake related to import in the README example.
### 0.1.0
First release with basic hex features.
|
https://github.com/jamesrswift/pixel-pipeline | https://raw.githubusercontent.com/jamesrswift/pixel-pipeline/main/src/pipeline/stages/computation.typ | typst | The Unlicense | #let compute(commands, middleware) = {
commands.map(cmd=>cmd + middleware(cmd,(:)))
} |
https://github.com/a-kkiri/SimpleNote | https://raw.githubusercontent.com/a-kkiri/SimpleNote/main/main.typ | typst | Apache License 2.0 | #import "template.typ": *
#show: template.with(
// 笔记标题
title: [SimpleNote],
// 在页眉展示的短标题(选填)
short-title: "SimepleNote",
// 笔记描述(选填)
description: [
此模板修改自 #link("https://github.com/jskherman/jsk-lecnotes")[jsk-lecnotes] \ Winter 2023
],
// 笔记创建日期(选填)
date: datetime(year: 2023, month: 12, day: 19),
// 作者信息(除 name 外,其他参数选填)
authors: (
(
name: "Akkiri",
github: "https://github.com/a-kkiri",
homepage: "https://github.com/a-kkiri",
affiliations: "1,2",
),
),
// 所属组织列表,每一项包括一个 id 和 name。这些将显示在作者下方。
affiliations: (
(id: "1", name: "Example University"),
(id: "2", name: "Example Inc."),
),
// 参考书目文件路径及引用样式
bibliography-file: "refs.bib",
bibstyle: "gb-7714-2015-numeric",
// 页面尺寸,同时会影响页边距。
paper-size: "a4",
// 中英文文本和代码的字体
fonts: (
(
en-font: "Linux Libertine",
zh-font: "Noto Sans CJK SC",
code-font: "DejaVu Sans Mono",
)
),
// 主题色
accent: orange,
// 封面背景图片(选填图片路径或 none)
cover-image: "./figures/cover-image.png",
// 正文背景颜色(选填 HEX 颜色或 none)
background-color: "#FAF9DE"
)
#include "content/chapter1.typ"
#include "content/chapter2.typ" |
https://github.com/huyufeifei/grad | https://raw.githubusercontent.com/huyufeifei/grad/master/docs/paper/src/template/template.typ | typst | #import "fakebold.typ": *
#import "util.typ": *
#import "ch_padding.typ": ch_padding
#let fsz = (
chu: 42pt,
s_chu: 36pt,
one: 26pt,
s_one: 24pt,
two: 22pt,
s_two: 18pt,
three: 16pt,
s_three: 15pt,
four: 14pt,
m_four: 13pt,
s_four: 12pt,
five: 10.5pt,
s_five: 9pt,
six: 7.5pt,
s_six: 6.5pt,
seven: 5.5pt,
s_seven: 5pt,
)
#let ff = (
fangsong: ("Times New Roman", "FangSong"), // 仿宋
song: ("Times New Roman", "SimSun"), // 宋体
hei: ("Times New Roman", "SimHei"), // 黑体
kai: ("Times New Roman", "KaiTi"), // 楷体
code: ("New Computer Modern Mono", "Times New Roman", "SimSun"),
// since there is no standard code font, you can use whatever you like
)
#let lengthceil(len, unit: fsz.s_four) = calc.ceil(len / unit) * unit
#let partcounter = counter("part")
#let chaptercounter = counter("chapter")
#let appendixcounter = counter("appendix")
#let footnotecounter = counter(footnote)
#let rawcounter = counter(figure.where(kind: "code"))
#let imagecounter = counter(figure.where(kind: image))
#let tablecounter = counter(figure.where(kind: table))
#let equationcounter = counter(math.equation)
#let appendix() = {
appendixcounter.update(10)
chaptercounter.update(0)
counter(heading).update(0)
}
#let skippedstate = state("skipped", false)
#let chinesenumber(num, standalone: false) = if num < 11 {
("零", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十").at(num)
} else if num < 100 {
if calc.rem(num, 10) == 0 {
chinesenumber(calc.floor(num / 10)) + "十"
} else if num < 20 and standalone {
"十" + chinesenumber(calc.rem(num, 10))
} else {
chinesenumber(calc.floor(num / 10)) + "十" + chinesenumber(calc.rem(num, 10))
}
} else if num < 1000 {
let left = chinesenumber(calc.floor(num / 100)) + "百"
if calc.rem(num, 100) == 0 {
left
} else if calc.rem(num, 100) < 10 {
left + "零" + chinesenumber(calc.rem(num, 100))
} else {
left + chinesenumber(calc.rem(num, 100))
}
} else {
let left = chinesenumber(calc.floor(num / 1000)) + "千"
if calc.rem(num, 1000) == 0 {
left
} else if calc.rem(num, 1000) < 10 {
left + "零" + chinesenumber(calc.rem(num, 1000))
} else if calc.rem(num, 1000) < 100 {
left + "零" + chinesenumber(calc.rem(num, 1000))
} else {
left + chinesenumber(calc.rem(num, 1000))
}
}
#let chinesenumbering(..nums, location: none, brackets: false, split: ".") = locate(
loc => {
let actual_loc = if location == none { loc } else { location }
if appendixcounter.at(actual_loc).first() < 10 {
if nums.pos().len() == 1 {
"第" + str(nums.pos().first()) + "章"
} else {
numbering(if brackets { "(1" + aplit + "1)" } else { "1" + split + "1" }, ..nums)
}
} else {
if nums.pos().len() == 1 {
"附录 " + numbering("A.1", ..nums)
} else {
numbering(if brackets { "(A.1)" } else { "A.1" }, ..nums)
}
}
},
)
#let chineseunderline(s, width: 300pt, bold: false) = {
let chars = s.clusters()
let n = chars.len()
style(styles => {
let i = 0
let now = ""
let ret = ()
while i < n {
let c = chars.at(i)
let nxt = now + c
if measure(nxt, styles).width > width or c == "\n" {
if bold {
ret.push(strong(now))
} else {
ret.push(now)
}
ret.push(v(-1em))
ret.push(line(length: 100%))
if c == "\n" {
now = ""
} else {
now = c
}
} else {
now = nxt
}
i = i + 1
}
if now.len() > 0 {
if bold {
ret.push(strong(now))
} else {
ret.push(now)
}
ret.push(v(-0.9em))
ret.push(line(length: 100%))
}
ret.join()
})
}
#let chineseoutline(title: [目#h(1em)录], depth: none, indent: false) = {
heading(title, numbering: none, outlined: false)
locate(
it => {
let elements = query(heading.where(outlined: true), it)
for el in elements {
// Skip list of images and list of tables
// if partcounter.at(el.location()).first() < 20 and el.numbering == none { continue }
// Skip headings that are too deep
if depth != none and el.level > depth { continue }
let maybe_number = if el.numbering != none {
if el.numbering == chinesenumbering {
chinesenumbering(..counter(heading).at(el.location()), location: el.location())
} else {
numbering(el.numbering, ..counter(heading).at(el.location()))
}
h(0.5em)
}
let line = {
if indent {
h(1em * (el.level - 1))
}
if el.level == 1 {
v(0.5em, weak: true)
}
if maybe_number != none {
style(styles => {
let width = measure(maybe_number, styles).width
box(width: lengthceil(width), link(el.location(), maybe_number))
})
}
link(el.location(), el.body)
// Filler dots
box(width: 1fr, h(10pt) + box(width: 1fr, repeat[.]) + h(10pt))
// Page number
let footer = query(selector(<__footer__>).after(el.location())).first()
let page_number = if partcounter.at(el.location()).first() < 20 {
numbering("I", counter(page).at(el.location()).first())
} else {
counter(page).at(footer.location()).first()
}
link(el.location(), str(page_number))
linebreak()
v(-0.2em)
}
line
}
},
)
}
#let listoffigures(title: "插图", kind: image) = {
heading(title, numbering: none, outlined: false)
locate(
it => {
let elements = query(figure.where(kind: kind).after(it), it)
for el in elements {
let maybe_number = {
let el_loc = el.location()
chinesenumbering(
chaptercounter.at(el_loc).first(),
counter(figure.where(kind: kind)).at(el_loc).first(),
location: el_loc,
)
h(0.5em)
}
let line = {
style(styles => {
let width = measure(maybe_number, styles).width
box(width: lengthceil(width), link(el.location(), maybe_number))
})
link(el.location(), el.caption.body)
// Filler dots
box(width: 1fr, h(10pt) + box(width: 1fr, repeat[.]) + h(10pt))
// Page number
let footers = query(selector(<__footer__>).after(el.location()), el.location())
let page_number = if footers == () {
0
} else {
counter(page).at(footers.first().location()).first()
}
link(el.location(), str(page_number))
linebreak()
v(-0.2em)
}
line
}
},
)
}
#let codeblock(raw, caption: none, outline: false) = {
figure(if outline {
rect(width: 100%)[
#set align(left)
#raw
]
} else {
set align(left)
raw
}, caption: caption, kind: "code", supplement: "")
}
#let booktab(columns: (), aligns: (), width: auto, caption: none, ..cells) = {
let headers = cells.pos().slice(0, columns.len())
let contents = cells.pos().slice(columns.len(), cells.pos().len())
set align(center)
if aligns == () {
for i in range(0, columns.len()) {
aligns.push(center)
}
}
let content_aligns = ()
for i in range(0, contents.len()) {
content_aligns.push(aligns.at(calc.rem(i, aligns.len())))
}
return figure(block(
width: width,
grid(columns: (auto), row-gutter: 1em, line(length: 100%), [
#set align(center)
#box(
width: 100% - 1em,
grid(columns: columns, ..headers.zip(aligns).map(it => [
#set align(it.last())
#strong(it.first())
])),
)
], line(length: 100%), [
#set align(center)
#box(width: 100% - 1em, grid(
columns: columns,
row-gutter: 1em,
..contents.zip(content_aligns).map(it => [
#set align(it.last())
#it.first()
]),
))
], line(length: 100%)),
), caption: caption, kind: table)
}
#let conf(
cauthor: "张三",
eauthor: "<NAME>",
studentid: "1120xxxxxx",
blindid: "",
cthesisname: "本科生毕业设计(论文)",
cheader: "北京理工大学本科学位论文",
ctitle: "北京理工大学学位论文 Typst 模板",
etitle: "Typst Template for BIT Dissertations",
school: "某个学院",
cfirstmajor: "某个一级学科",
cmajor: "某个专业",
emajor: "Some Major",
direction: "某个研究方向",
csupervisor: "李四",
esupervisor: "<NAME>",
date: "二零〇〇年〇月",
cabstract: [],
ckeywords: (),
eabstract: [],
ekeywords: (),
acknowledgements: [],
linespacing: 1em,
outlinedepth: 3,
blind: false,
listofimage: false,
listoftable: false,
listofcode: false,
// alwaysstartodd: false,
doc,
) = {
let smartpagebreak = () => {
// if alwaysstartodd {
// skippedstate.update(true)
// pagebreak(to: "odd", weak: true)
// skippedstate.update(false)
// } else {
pagebreak(weak: true)
// }
}
set page(
"a4",
margin: (left: 3cm, right: 2.6cm, top: 3.5cm, bottom: 2.6cm),
header-ascent: 0%,
footer-descent: 20%,
header: locate(loc => {
set text(size: fsz.four, font: ff.song)
set align(center)
let part = partcounter.at(loc).first()
let pg = counter(page).at(loc).first()
if (part != 0) or (pg != 1) {
[
#ch_padding(pad: 1pt)[北京理工大学本科生毕业设计(论文)]
#v(-0.8em)
#line(length: 100%)
]
}
v(2em)
}),
footer: locate(loc => {
// if skippedstate.at(loc) and calc.even(loc.page()) { return }
set text(size: fsz.five, font: ff.song)
set align(center)
let part = partcounter.at(loc).first()
[
#if 0 < part and part < 20 {
numbering("I", counter(page).at(loc).first())
}
#if 20 <= part {
str(counter(page).at(loc).first())
}
<__footer__>
]
}),
)
set text(fsz.one, font: ff.song, lang: "zh")
set align(center + horizon)
set heading(numbering: chinesenumbering)
set figure(numbering: (..nums) => locate(loc => {
numbering("1-1", chaptercounter.at(loc).first(), ..nums)
}))
set math.equation(numbering: (..nums) => locate(loc => {
set text(font: ff.song)
numbering("(1-1)", chaptercounter.at(loc).first(), ..nums)
}))
set list(indent: 2em)
set table(stroke: (left: none, right: none), align: center+horizon,)
set enum(indent: 2em)
set bibliography(style: "gb-7714-2015-numeric")
// if your system fonts support bold character, then comment this line
show strong: it => show-fakebold(it.body)
show emph: it => text(style: "italic", it.body)
show par: set block(spacing: linespacing)
show raw: set text(font: ff.code)
show heading: it => [
#if it.body.has("text"){
if it.body.text == "Abstract" {
return []
}
if it.body.text == "摘要" {
return []
}
}
// Cancel indentation for headings
#set par(first-line-indent: 0em, justify: false)
#set text(font: ff.hei)
#let makeheading = (before: 0.5em, after: 0em, sz, s) => {
v(before)
set text(size: sz)
strong(s)
v(after)
empty_par
}
#if it.level == 1 {
smartpagebreak()
if it.numbering != none {
chaptercounter.step()
}
footnotecounter.update(())
imagecounter.update(())
tablecounter.update(())
rawcounter.update(())
equationcounter.update(())
set align(center)
makeheading(after: 1em, fsz.three, it)
} else {
set align(left)
if it.level == 2 {
makeheading(fsz.four, it)
} else if it.level == 3 {
makeheading(fsz.s_four, it) // s_four have strange problem
} else {
makeheading(fsz.s_four, it)
}
}
]
show figure: it => [
#set align(center)
#set text(size: fsz.five, font: ff.song)
#if not it.has("kind") {
it
} else if it.kind == image {
it.body
[
#it.caption
]
} else if it.kind == table {
[
#it.caption
]
it.body
} else if it.kind == "code" {
it.body
[
代码#it.caption
]
}
]
show ref: it => {
if it.element == none {
// Keep citations as is
it
} else {
// Remove prefix spacing
h(0em, weak: true)
let el = it.element
let el_loc = el.location()
if el.func() == math.equation {
// Handle equations
link(el_loc, [
式
#chinesenumbering(
chaptercounter.at(el_loc).first(),
equationcounter.at(el_loc).first(),
location: el_loc,
split: "-",
)
])
} else if el.func() == figure {
// Handle figures
if el.kind == image {
link(el_loc, [
图
#chinesenumbering(
chaptercounter.at(el_loc).first(),
imagecounter.at(el_loc).first(),
location: el_loc,
split: "-",
)
])
} else if el.kind == table {
link(el_loc, [
表
#chinesenumbering(
chaptercounter.at(el_loc).first(),
tablecounter.at(el_loc).first(),
location: el_loc,
split: "-",
)
])
} else if el.kind == "code" {
link(el_loc, [
代码
#chinesenumbering(
chaptercounter.at(el_loc).first(),
rawcounter.at(el_loc).first(),
location: el_loc,
split: "-",
)
])
}
} else if el.func() == heading {
// Handle headings
if el.level == 1 {
link(
el_loc,
chinesenumbering(..counter(heading).at(el_loc), location: el_loc),
)
} else {
link(el_loc, [
节
#chinesenumbering(..counter(heading).at(el_loc), location: el_loc)
])
}
}
// Remove suffix spacing
h(0em, weak: true)
}
}
let fieldname(name) = [
#align(right + top)[
#name
#h(0.3em)
]
]
let fieldvalue(value) = [
#set align(center + horizon)
#set text(font: ff.song, size: fsz.three)
#grid(rows: (auto, auto), row-gutter: 0.2em, value, line(length: 100%))
]
// Cover page -----------------------------
if blind {
// set align(center + top)
// text(fsz.chu)[#strong(cheader)]
// linebreak()
// set text(fsz.three, font: ff.fangsong)
// set par(justify: true, leading: 1em)
// [(匿名评阅论文封面)]
// v(2fr)
// grid(
// columns: (80pt, 320pt),
// row-gutter: 1.5em,
// align(left + top)[中文题目:],
// align(left + top)[#ctitle],
// align(left + top)[英文题目:],
// align(left + top)[#etitle],
// )
// v(2em)
// grid(
// columns: (80pt, 320pt),
// row-gutter: 1.5em,
// align(left + top)[一级学科:],
// align(left + top)[#cfirstmajor],
// align(left + top)[二级学科:],
// align(left + top)[#cmajor],
// align(left + top)[论文编号:],
// align(left + top)[#blindid],
// )
// v(4fr)
// text(fsz.s_two, font: ff.fangsong)[#date]
// v(1fr)
} else {
// v(2fr)
box(image("bit_name.png", height: 2.2em))
linebreak()
set text(fsz.s_chu, font: ff.song)
strong(ch_padding(pad: 3pt, cthesisname))
set text(size: fsz.two, font: ff.hei)
v(30pt)
grid(rows: (auto, auto), gutter: 1.25em, [
#set align(center)
*#ctitle*
], [
#set align(center)
*#etitle*
])
v(30pt)
set text(fsz.three, weight: "regular", font: ff.song)
grid(
columns: (90pt, 240pt),
row-gutter: 1em,
fieldname(text("学") + h(2em) + text("院:")),
fieldvalue(school),
fieldname(text("专") + h(2em) + text("业:")),
fieldvalue(cmajor),
fieldname("学生姓名:"),
fieldvalue(cauthor),
fieldname(text("学") + h(2em) + text("号:")),
fieldvalue(studentid),
fieldname("指导教师:"),
fieldvalue(csupervisor),
)
v(40pt)
text(fsz.s_two)[#date]
}
smartpagebreak()
counter(page).update(1)
partcounter.update(1)
// declare ----------------------------------------
if not blind {
set text(font: ff.song, size: fsz.s_three)
set align(top)
partcounter.update(1)
text(font: ff.hei, size: fsz.two)[*原创性声明*]
par(
justify: true,
first-line-indent: 2em,
leading: linespacing,
)[
#set align(left)
本人郑重声明:所呈交的毕业设计(论文),是本人在指导老师的指导下独立进行研究所取得的成果。除文中已经注明引用的内容外,本文不包含任何其他个人或集体已经发表或撰写过的研究成果。对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。
特此申明。
]
v(1em)
align(right)[
本人签名:#h(5em)日#h(0.5em)期:#h(2em)年#h(2em)月#h(2em)日
]
v(3em)
text(font: ff.hei, size: fsz.two)[*关于使用授权的声明*]
par(
justify: true,
first-line-indent: 2em,
leading: linespacing,
)[
#set align(left)
本人完全了解北京理工大学有关保管、使用毕业设计(论文)的规定,其中包括:①学校有权保管、并向有关部门送交本毕业设计(论文)的原件与复印件;②学校可以采用影印、缩印或其它复制手段复制并保存本毕业设计(论文);③学校可允许本毕业设计(论文)被查阅或借阅;④学校可以学术交流为目的,复制赠送和交换本毕业设计(论文);⑤学校可以公布本毕业设计(论文)的全部或部分内容。
]
v(1em)
align(right)[
本人签名:#h(5em)日#h(0.5em)期:#h(2em)年#h(2em)月#h(2em)日
#v(0.5em)
指导老师签名:#h(5em)日#h(0.5em)期:#h(2em)年#h(2em)月#h(2em)日
]
}
smartpagebreak()
// Chinese abstract ----------------------------------------
set align(top + center)
heading(numbering: none, [摘要])
text(font: ff.hei, size: fsz.s_two)[
*#ctitle*
#v(1em)
摘#h(1em)要
]
v(1em)
set align(left)
par(justify: true, first-line-indent: 2em, leading: linespacing)[
#text(font: ff.song, size: fsz.s_four)[
#cabstract
]
]
v(1em)
text(font: ff.hei, size: fsz.s_four)[
*关键词:#ckeywords.join(";")*
]
smartpagebreak()
// English abstract -------------------
set align(center)
heading(numbering: none, [Abstract])
text(size: fsz.three)[
*#etitle*
#v(2em)
Abstract
]
v(0.5em)
set align(left)
par(justify: true, first-line-indent: 2em, leading: linespacing)[
#text(size: fsz.s_four)[
#eabstract
]
]
v(1em)
text(size: fsz.s_four)[
*Key Words:#h(0.5em)#ekeywords.join("; ")*
]
// Table of contents --------------------------------
set text(font: ff.song, size: fsz.s_four)
chineseoutline(depth: outlinedepth, indent: true)
if listofimage {
listoffigures()
}
if listoftable {
listoffigures(title: "表格", kind: table)
}
if listofcode {
listoffigures(title: "code", kind: "code")
}
smartpagebreak()
partcounter.update(20)
counter(page).update(1)
// content --------------------------------------
set align(left + top)
par(justify: true, first-line-indent: 2em, leading: linespacing)[
#doc
]
// acknowledgement ------------------------------
if not blind {
heading(numbering: none, [致#h(1em)谢])
par(justify: true, first-line-indent: 2em, leading: linespacing)[
#text(font: ff.song, size: fsz.s_four, acknowledgements)
]
}
}
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/scholarly-tauthesis/0.4.0/template/main.typ | typst | Apache License 2.0 | /*** main.typ
*
* The main document to be compiled. Run
*
* typst compile main.typ
*
* to perform the compilation. If you are writing a multi-file
* project, this file is where you need to include your content
* files.
*
***/
//// Initialize document type.
#import "@preview/scholarly-tauthesis:0.4.0" as tauthesis
#import "meta.typ"
#show: doc => tauthesis.tauthesis(
fignumberwithinlevel : 1,
eqnumberwithinlevel : 1,
doc
)
//// Include your chapters here.
//
// Your text can be written entirely in this file, or split into
// multiple subfiles. If you do, you will need to import the
// preamble separately to those files, if you wish to use the
// commands.
//
#include("content/01.typ")
#include("content/02.typ")
#include("content/03.typ")
#include("content/04.typ")
#show: tauthesis.bibsettings
#bibliography(style: meta.citationstyle, "bibliography.bib")
//// Place appendix-related chapters here.
#show: doc => tauthesis.appendix(
fignumberwithinlevel : 1,
eqnumberwithinlevel : 1,
doc
)
#include "content/A.typ"
|
https://github.com/wildabc/Gu-Xingqing-Memoirs | https://raw.githubusercontent.com/wildabc/Gu-Xingqing-Memoirs/main/欧战工作回忆录.typ | typst | #let chinesedigits(n) = {
let dict = (
"0": "〇",
"1": "一",
"2": "二",
"3": "三",
"4": "四",
"5": "五",
"6": "六",
"7": "七",
"8": "八",
"9": "九",
)
let s = str(n)
s.clusters().map(
x => dict.at(x)
).join()
}
#set page(
paper: "a6",
)
#set text(
font: ("Linux Libertine", "FZNewShuSong-Z10"),
size: 11pt,
hyphenate: false
)
#set par(
justify: true,
first-line-indent: 2em,
)
#show par: set block(spacing: 0.65em)
#set heading(
numbering: (..nums) =>
if nums.pos().len()==2 {chinesedigits(nums.pos().at(-1))+"\u{3000}"}
)
#show heading.where(level: 1): it => [
#set text(
font:"FZXiaoBiaoSong-B05",
size: if it.body.text == "欧战工作回忆录" {24pt} else {18pt}
)
#pagebreak(weak: true)
#counter(page).update(1)
#it
#v(1cm)
]
#let appendname(n) = {
let names = ("Folkestone", "Noyelles", "Pomperinghe")
if (n >= 6 and n <= 8) [(#names.at(n - 6))] else []
}
#show heading.where(level: 2): it => [
#let sectn = counter(heading).at(it.location()).at(-1)
#if sectn!=1 {pagebreak(weak: true)}
#set text(size: 14pt, weight: "regular")
#block([#h(1em)#box(it)]+appendname(sectn))
#par()[#text(size:1cm)[#h(0em)]]
]
#page(margin: 0cm)[#image("cover.png", width: 100%)]
#set page(
margin: 1cm,
numbering: chinesedigits,
footer: [
#set align(center)
#set text(8pt)
#counter(page).display(chinesedigits)
])
= 潘序
#h(2em)同学顾杏卿君以其亲身经历,著成《欧战工作回忆录》。余快读一过,觉其事实之真切,文笔之生动,实不可多得之作也。
顾君于一九一七年春,欧洲大战方酣之际,应聘英、法在华招请之译员,随同华工十余万出国,转辗数国,亲历艰险,发扬我中华民族之精神,增高我国际上之地位,此不特个人之荣,亦国家民族之荣也。
故此书不仅可作游记读,且可激励我民族之精神也。
#h(1em)中华民国二十五年十一月吴兴潘公展序
#pagebreak()
学愈进步,人类愈不幸,是则深可慨焉!用是不揣谫陋,追溯既往,爰成《欧战工作回忆录》。幸海内读者,有以教正之。
#h(1em)民国二十五年十一月\u{3000}顾杏卿序于镇江
#show outline.entry: it => {
let sectn = counter(heading).at(it.element.location()).at(-1)
if sectn < 10 {h(2em)+it} else {h(1em)+it}
}
#outline(
target: heading.where(level: 2),
title: [目次],
fill: repeat([#sym.dot.op])
)
= 欧战工作回忆录
== 远别祖国
一九一七年春,余因体弱养疴于华北,既不能攻读,又不能服务,心灵上顿感痛苦,某日忽闻英公使署,有征聘华工译员之举,余认为出国漫游之绝好机会临矣。于是毅然应聘,虽体弱如故,亦不遑顾及。
余既应聘赴法,数日内即须成行,故亟亟整理行装,从事远征,并于启行前一日赴各友处告辞,而至友之来余寓话别者,慰勉备至,使余感激莫名。教会会长英人史培志之以“自由”“正义”“和平”,勉余为服务宗旨,实为确切不移之座右铭。至友周菊人君,以“少年须具冒险精神,方可建功立业”相勗,尤使余感动不置。是夜,念邻室徐、林二友处,尚未得闲一往,拟作最后之告别,然彼等皆入睡乡,怅然而返。独坐斗室,万籁无声,往事前程,萦绕脑际,酣梦未成,东方已白,起身盥洗,略进早点,赴站候车,同行者已先后莅站,送行之人,拥满月台,于晨光熹微中,挥巾不已,有无限惜别之情,其中有一老人,泪涔涔下,双目红肿。睹此情状,诚令人心酸不已。人生于普通之离别,已足使柔肠九转,而况远别祖国,赴万里重洋之外乎?
是日启行,按预定路程,先往济南,再转靑岛搭轮放洋,余等至济南,时已日暮,乃投宿逆旅。翌晨,方乘胶济车行,其时胶济铁路,大权操诸日人,在站购票及乘车时,均系日人指挥。所有旅客一一列队,依次前进,秩序井然。迨余等车抵青岛,已有多数华工,先余辈而至。闻此辈华工,每日从事操练,以备送往法境战线服务,余闻而愕然者久之。
下车后至待发所,见有工人数千,在场操练,英人教以简单之步伐,闻彼等抵所时,须先沐浴,然后经医生检查体格,有无肺痨花柳及沙眼等传染病,不合格者,给资遣回,其查验合格者,改换服装,签订合同,编列号码,留待出发。翌晨(四月六日)五时,余见英方官员,正在发给津贴及衣帽等物,汗流浃背,倍觉忙碌。(依照普通规定,华工一人除在中国每月付十元给其家属为赡养费,及在法日予一法郎工资外,上船时又各给二十元津贴。所有华工衣服食物等件概由雇主发给。)分发事毕,即命排成列队,以便出发,每四百人一大排,排长以在中国各商埠回国投效之商人或教士充之,临行时,所中职员,醵资备多量爆竹燃放,用以表示欢送远别同胞之意。是时工人亦全体新装,肃立致谢,且均喜形于色,抱有乘长风破万里浪之气概焉。余在同侪中年最幼,时尚未满二十,参此壮游,颇足自豪;第因同轮者思家情热,亦不禁顿生别离家国之感。然转念此行大可增加识见,方庆幸之不暇,何郁郁以自苦,乃以此旨互相告勉,同往者精神为之一振。
== 道经日本
十七日晨,船始启椗,风平浪静,如履平地。十九日晨,抵日之长崎。解缆停舶,即有日医官登船检查,二十一晚九时,船又开行,工人中长于音乐者颇众,故途中管弦杂奏,颇不岑寂。二十三日下午一时,抵日之横滨,余上岸一游,街道整洁,店铺林立,书肆尤多,所有店员,十九皆女子,来往车辆,除电车外,以人力车为多,车夫休息时,皆读报纸,由此可知日本教育之普及。当时日本虽已加入欧战,究与战地距离遥远,故国内仍安静异常,毫不受战事之影响。
二十四日晚,船又起椗,翌晨风浪骤作,船身摇撼特甚,致睡铺前后倾欹,左右转侧,目为之眩,头为之晕,且气候暴冷,更使身体不适,饮食莫能进。航行之苦实难忍受,故同行者有云:“设余一旦返故乡,誓必终身蛰居乡里以事耕种,优游岁月,决不慕此虚荣,而受此无谓痛苦。”余闻之不禁哑然失笑。
== 赴坎途中
舟行十九日(五月六日)船主云:此去离“坎拿大” Vancouver 埠,只有数日矣;苟能风平浪静,则又减少一日行程,余等正苦舟行日长,闻之皆怡然自乐,盖众人企望登岸之心,十分急切。舟行又一日余,遥望群鸟飞旋空际,盖离岸已不远矣。众皆喜悦不可言状。
五月七、八两日,天空忽起大雾,虽伸手可见五指,但三尺以外,已无法辨认。因此舟行极缓,每隔二分钟,必鸣笛一次,以防与他船互撞,雾之大,为余有生以来所仅见。如是者一日半,雾始消失。浪静风平,余等至此,精神一爽。数日不思饮食之余,亦觉饥肠辘辘,乃狂啖午餐以果腹。翌晨举目遥望,高山隐现,询诸船役,则谓离岸已近,数小时水程可达,余闻之不禁雀跃。
== 坎境一瞥
五月九日晨,乃安抵“温哥华”,计海行已二十余日;余辈在舟中,但见黯淡之苍天,与澎湃之怒潮而已。迨登彼岸,衷心安慰,无可言喻。余见舟已傍岸,乃与美人马君,共雇汽车游览该处,马君年虽七十余,仍在船上服役为医,精神矍铄,实为常人所不及。
温城商业繁茂,为坎拿大铁道之终点,由此海口航行可以直达中国、日本及澳大利亚,数十年前,荒无人烟,今则崇楼层叠,船舶云集。一跃而为坎拿大西岸之第一良港,称最重要之新兴市场。该处街道平整可观,交通则有电车、汽车。汽车之多,不下于吾国之人力车,电车座位不分等级,稳妥舒适。店铺林立,有所谓五分,一角及一角五分店铺者,即铺中所售各种物件,至贱者五分而最贵者则一角五分也。价目虽贱,然日用之物,应有尽有,在吾国尚未有与此相类之店铺。然在“坎拿大”全国共有七十所,在英国共有六十处,店员均为妙龄女子,人往购物,彼必道谢。游览时曾往邮局寄信,见有禁止吐痰通告一纸,违者须罚茄金五十元,夫随地吐痰,吾国人向不注意,彼国禁止极严,吐痰之害于此可见。马君于该地最熟悉,乃导余往游斯丹来公园(Stanley Park),园地甚大,长宽各二英里,园中树林甚密,松柏尤茂,天然胜境也。
游园后往咖啡店饮茶,侍者为一妙龄女郎,见余饮时格格作捧腹笑,余询何故?则曰朱古律糖亦饮料之一也。盖是时,余命取咖啡茶后,再命取朱古律糖故。余盖初涉重洋,履此异地,宜乎不识茶之种种名称,此犹外人在我国茶馆,既饮红茶,又需要淡茶相仿佛云。
余与马君饮毕出外游览时,途遇侨胞数人,均广东籍。彼等见余为同胞,如旧相识然,又知余乃初莅该地者,特趋前与余握手,并以国语询余曰:君是否赴法参与华工翻译职务者?余曰然,并询彼曰,君等何能先知?曰顷间傍岸之船,闻载有华工甚多,君既似初来者,谅搭是船至此无疑。且此船不载其他旅客,故能知君之行踪也。侨胞言语之间,除屡露赴法之不利外,更详述经大西洋而赴法途中之种种危险,余固初出国者,身临异地而聆此危言,心颇忐忑不安,然细察华侨行为,实系君子者流,所说似可深信;但余既立志赴法,一切利害皆不之顾,祈求赴目的地耳。
翌晨即见三千余华工,由英兵率领登岸,改乘特备之专车进发,以期早达目的地。第闻此地定例,凡华工入境须纳人头税,计每人茄金五百元,兹则英政府早已与茄政府商定临时办法,即华工之赴法,路过茄境时,免除缴纳人头税,而以华工不能自由登岸为条件,故船傍温岸,华工一律伏居船中,不得上岸。迨专车至,始由负管理责任之英兵,督率上车,其车厢两端,均有英兵看守,是以在车华工,仍不能在车中随意往来。随车之英医,每晨巡视车厢各一次,查察华工是否患有疾病,然每日巡查所得,华工患有胃病者甚多,断为缺少运动所致,但余以为处此囚车式之火车中,亦所难免耳。
余在车上所有饮食起居,尚称满意,晨间为余治寝具者,乃一黑人,其面貌一如炉炭砚墨,余初见时,以为若人之污秽,至斯而极,然细察之,亦甚清洁。不过皮肤特别黧黑耳。
余等所乘之车,为英政府所特备者,车行一星期,除车头加煤进水外,从未一靠任何车站,不然沿途各地风土人情,与夫习俗惯例,正可增余识见不鲜。兹则昙花一现,等于过眼烟云,即有所见,亦不过若干特异之点,映于眼帘已耳。途中一路风景绝佳,令人欣赏不已。回忆幼年读书时,地理教授曾问余“落矶山”何在?余瞠目不知所答,今在车中忽见巍然陈列于我眼帘者,正名闻世界之大“落矶山”也。是山远望,但见满山积雪,恍似一片白银世界,“岭表明霁色,城中增暮寒,”此地有焉。时在夏季,有此奇异之雪景,颇觉洋洋可观。据熟悉此地情形者言,是山终年积雪,以致毫无生物产生,至山中有无矿质,至今亦尚未有发现者。车行是山之隧道,凡五英里,闻为世界最长之隧道,辟此隧道之工程,其伟大可想而知矣。又据某英人语余,当开凿隧道时,以平均计,日必死伤工人三四名,非丧生于大石之堕落中者,即因呼吸山中之毒气而致窒息以死者,综计二年余之工作期内,工人之无辜牺牲,何可胜数,余闻之悚然。
每站设有饮食店,以便列车到站时,旅客下车购物(车上无售物者),沿铁路一带房屋,纯系木制,未见用砖砌者,即车站办公室亦多为木质,余异而询之,始悉此地富森林,木材可以随意取用,不必化费分文也。
== 大西洋中之脱险
五月十八日,车抵坎拿大东岸蒙特利奥(Montreal)城,为坎拿大工商业最繁盛之区,计自温城车行至此,已五千四百余英里,稍停,车即开行至海列发克斯(Halifax)。乃舍车登轮。时前线紧急,德国实行其“无限制”潜艇政策,敌人潜艇出没无常,海上船只,奉有英海军部命令,晚间行驶,一律不许燃火,以避敌艇袭击。
此次航行大西洋,先有英二等巡洋舰一只,随轮护送;待舟离英约有四日水程,英海军部又派出驱逐雷艇七艘迎护,据同舰之英军官谓余曰:舟经此处,巡视偶一不慎,辄遭鱼雷之险,敝国(英国)为尊重贵国(指我国)尊严,爱护多数华工起见,政府特命海军部派遣多数军舰迎送,以资保护。余于感谢之中,寸心实觉惴惴不安也。
迎送余等之军舰,每小时速力能行三十海里,余等乘船为商轮,行驶极缓,常见该项军舰,忽焉前进,忽焉后退,忽焉后退而又前进,竭卫护之能事。
余等乘船首尾均装大炮,有英海军官日夜驻守,并有英军官若干人,特在舱面教授各华工,使用舢舨与救命圈种种方法,用以预防不测,并指授行驶小舢小艇之术,船上所置小艇,均储干粮饼干之类,并嘱:如遇危险,凡任工头者须令工人先行下艇,在此数日内,晚间不可解衣而卧,以防万一之危险。
某日深夜,余正熟睡,忽为人声所惊醒,急询何事,同室之王君子安云:不必询问,速起速起!余聆其言,为之大惊,立由床上一跃而起,拟将置在身旁之救命圈,捆扎身上,时虽夏季,竟寒冷如严冬,又在黑暗之中,一时竟不易摸索,余此时恐怖万状,不可言喻。余乃于恐怖之黑暗中,徐徐将救命圈置之身上,并奔赴邻室,以探究竟,所有同人等,均默坐无言,未几,王君谓我曰,船已抛锚,余闻炮声已有三次矣。当吾人寂静无声时,似闻有炮声隆隆,然事后询问经过事实,始知曾有敌国潜水艇之桅杆出现水面,适被英军官所见,发炮攻之,敌艇始遁去。华工中之胆怯者,往往发生无谓之惊惶与忧虑,余兴之所至,时入统舱,与华工辈讲解故事,以资娱乐,盖如此方法,一以自解愁闷,一以劝慰枯寂之华籍同胞也。
越数日,船长(英人)语余曰:船抵目的地,仅二日行程矣,但船之最危险时期,亦在此数日中,请余转告华工,自此时至登岸时止,每晚须和衣而睡,及练习小舢舨之行驶术与救命圈之使用法,更有一语,请告彼等特别注意,设一旦船临险地,务当镇静行事,设或鼓噪无常,心神错乱,虽有急救方法,亦将无从施展,予闻语唯唯,即将此意一一为之转达,然余之心房中,此时竟如千万辘轳,无一刻安宁也。万一遇险,亦在意中,念及死之最凄惨者,莫甚于沉溺汪洋之水中。葬身鱼腹,家莫闻知,犹以为乘风破浪正在前进中也。余等于此三日中,朝夕未曾安眠,环顾是时之船长,竟日夜不寐,奋勇从事,西人之勇敢任劳,实予吾人以深刻之认识也。
六月一日,下午六时左右,余船已安抵英之利物浦(Liverpool)埠,行将系岸时,余为同事所推举,特草一英文长函致船长,表示途次驾驶有方,化险为夷,代表同胞感谢之意,船长得函,异常欣喜,并谓余等曰:予将此函深藏箧中,留作永久纪念,盖余与贵国人士通函,此实为破天荒第一遭也。迨船泊已定,余等乃与船长及诸船员,一一握手道别登岸。在余等联袂登岸时,早有英之士女,前来欢迎,脱帽狂呼者有之,扬巾呐喊者有之,所以有此盛况者,该地人士自接有三千华工到埠之消息,英政府为亲睦华工起见,与该埠市长等,特先致意于该地人民,行此欢迎盛典,盖不如此,不足以鼓励华工之兴奋而赴前线工作也。
== 驻英福克斯登
同船来此之大队华工,亦于此欢呼声中,离舟登岸,并由英政府指派之干事人员,担任招待,盖此次华工之由英赴法,名虽华工,实际上为赴前线服务耳。英军得此战斗上助力,或可优占胜势,彼国政府与该地人民之热烈欢迎,自属应有之表示。
翌晨即由利物浦上车,凡途中所经市镇,辄有英人扬巾狂呼,车行十二小时,乃抵英吉利海峡之福克斯登地方;福克斯登为由英赴法轮埠之一,此地工厂林立,人烟稠密,惟因时受德飞机之蹂躏,市面已呈萧条之象,英陆军部在此郊外,建有华工休息之营舍,占地甚广,派中校军官管理其事,并挑选华工数百名,留以担任一切杂役,车行抵此,即由该管理者指挥招待,并供应一切,凡华工之由英赴法者,即以此地为休息营舍。
余等与众华工,本拟在此暂宿一宵,即搭轮赴法。奈医官查验结果,患有耳腺炎病者,竟有一千四百名以上之多,被扣而居此者,凡一月有余,余则因此而得饱览此地之风景。不可谓非旅途中之眼福也。
此千余人,在常人之目光,一无患病之征象,外表与寻常人无异,现被英医官验得有疾,可见英医查验之严密矣。吾人在英,敌人飞机,时由敌境飞至城中,抛投炸弹,其声如雷,无不惊惧,华工初见飞机,不禁喜甚,昂首仰视,以为翱翔如鸟,兴趣盎然,后经一次之爆炸,始觉危险之堪虞,某日之夜(时间约在晨间二时),余正熟睡之际,忽闻英军官叩帐声甚急,为之惊醒,并大声疾呼曰,速起!速起!继又大呼不可燃火。⋅⋅⋅⋅⋅⋅余惊问何故,英军官又大声呼曰,速出!速出!事急!无须穿衣,余乃赤足而出,时虽夏季,然此时之风紧气冷,一如我国之冬季,余出帐后,即有同营之队伍,强曳余至附近树林中,在黑暗中,询以何事急急如此,话犹未毕,轰然爆炸声已至。次晨阅报,方知英人死者七十六人,妇女幼稚之受伤者百七十四人,余辈以急急奔避,未伤毫末,余辈居此危险地者,约一月有余,每日除操练外,一无所事,余乃利用暇时,阅书报以消遣,报纸所载,除战事消息外,颇多盗劫与离婚等新闻。洵见战时社会状态之纷乱也。
== 抵法老爱儿
七月七日,为我国华工与余等离英赴法之第一日,晨间三时即起身,整理行装,以备下轮启行。钟鸣六下,所有华工,先行整队下船,余与英军官等,至九时许,始行下轮,十时许轮始起桅出口。
轮行四小时,过英海峡,抵法之白龙(Boulogne),为法西北境重要之大城市,遥望岸上,营幕累累,军械重重,盖是地已入军事重心区域,招募华工原意,本为分发各工厂充当工人,然以现在情形证之,殆将使我华工,咸临前线工作也。
抵法后,起岸登车,向华工总分发处事务所报到,惟所乘火车为法政府所供给,向皆装载货物牛马,战时因输送太忙,载人之客车万不敷用,乃即以此项货车装运兵士,车中既无灯火,又无椅凳,所供食品,只有坚硬之饼干,我华人参与欧战工作,困苦生活者,即以此为起点,和会之得占一席地于日后,或即种因于是,华工为祖国争国格,为同胞争光荣,于此可见一斑。沿途每过一站,停顿时间甚久,以便来往不绝之兵车及载货车先行,但余辈在车,急切渴望者,即能早时到达目的地,以脱离车上之困苦,然处此军事运输繁忙之际,余辈亦莫可如何,诚如法人所谓:“此因战争故也。”车行约十二小时,乃抵老爱儿地(Noyelles),是地华工云集,为华工之总招待与总事务所所在地。
华工未进营之先,须由所中英军官点名后,始得鱼贯而入。营门外有英国宪兵,持枪守卫,华工不能自由出入,营舍本空地,乃英军租于法人者,方圆数百亩,四周围以坚固之铁网,工人所住者,全系行军所用帐幕,每一帐幕,约有英尺一丈余之大,可宿十五人。既抵老爱儿,由带领华工之英官员,将所带队伍,一律交与华工督办处办理,而彼等则须前往伦敦一行,投英陆军部报到。由部考验其平日旅华之经验,然后加以陆军官衔,改穿制服,再返法国老爱儿,听候英人华工督办差遣委用,或派往已经成立之华工队伍,充当中尉或队长之职。但道中与华工相处既久,感情较深,一旦分离,颇为怅然,当握手道别时,彼此多有泣下沾襟者,足见同受患难之人,其精神上之结合本诸天性也。噫!感情之足以动人也如此。
老爱儿位于法国北部索姆河(Somme)之口,法国极小之一村落也。顾以地居铁路沿线之中心,故为法北部南往巴黎京城必经之道,且该地与英国远征第五军总司令部驻扎之阿不畏儿城(Abbeville)相距仅八法里,军令之传达,队伍之调遣,极形便利。因而华工至法者,须先会集于此,然后分发法、比各战地工作,余抵此后,亦受英军医之检查,因英政府对于身体之检查,极加重视,工人中有患沙眼、耳腺炎及肺症者,莫不悉被留居医院,其经检查及格者,始重行编队,每队五百名,由英军官五人,下士二十人统率,并置译员一人或二人,又置中国工头二十人,队长一员,以陆军少校或上尉任之,军官及下士一律戎装,与军人无异惟不备枪耳。
吾侪目击此状,不觉如堕五里雾中,盖余辈初为工作应募而来,而在祖国并未见有军官率领工人者,今睹斯状,引起我人之惊异,自在意中。但我华工同舟来法者,彼此极行亲密,形同骨肉,难舍难分。故当局每将同来者,编成一队,但间有少数,因检查不及格而被摈弃者,一旦分袂,不胜依依,令人发生生死离别之感,盖此辈工人,从未远离本乡,一旦跋涉重洋,来此海外,咸认为最可亲近者,惟此同伴耳。
英政府在老爱儿地方,为吾华工,特设大医院一所,凡华工有患重病及传染病,或工作时为炮弹炸伤者,均一律送至该院医治,或休养院中,所有英医官二十余人,均曾在吾国行医,因此对于吾华人患病,颇有经验,且多通华语,似无扞格不通之虞。
至该院组织,规模宏敞,予戚杨君永贵在该院服务,曾导余周览全院,内容完备,有开刀室、验尸所、外科及内科病房、隔离病室(专为传染病人所设)、眼科病室及花柳科病室,配药室,爱克司光线室等等,英人格莱上校(Lieut. <NAME>)(前任英国使馆医官)为该院主任,学问渊博,心地慈祥,克尽厥职,颇为人所称道不置。
该院尚附有疯人院(患者约一百余人),其中大多数因受炮火之惊骇而顿失常态之工人,此外因思家过度,神经错乱成疯者,亦不在少数。患者既精神失常态,故入院监禁一如囚犯,当然无自由可言,总计全院病人,约有三千余,为数至足惊人。
余与英人华工副督办波顿少校(Purdon)晤谈后,督办为英人法亚法克上校(Fairfax),即被派至四十九队服务,该队工人均与余同舟来法者,故彼等闲之咸来问候,欢欣之状,莫可言喻,中以山东籍者居多,年龄均在二十与四十之间,有军人、工匠、伶人、教员等等,而以农夫占大半,渠等均未出国门一步,而能抱此大无畏精神,背井离乡,远渡重洋,历此空前未有之危险,来充参战之华工,究为何故乎?实为生计耳!然而吾华工之勇敢,亦足以自豪矣。
余等守候约二星期,队长始接到上峰出发命令,余乃奉命通知总工头,转令各工头,传达各工人,各工人闻信之下,莫不喜形于色,静极思动,人同此情也。
== 驻比怕勃伦基城
时至深夜,始列队出发,抵站上车后,车即开行,但开往何地,无一知悉,待车抵目的地,始知为比之怕勃伦基城,英军驻扎比境之总司令部在焉。队长不知营地何在,乃出其所带之军令及地图,翻阅一过,始命全队一律在站候命,彼与余及一中尉,同乘军用摩托车,四处寻觅,沿途所见者,全系来往荷枪之军队,架炮之炮车,及红十字救护伤兵车耳,经数小时,始发现空旷营地一方,该地四周,围有坚固之铁丝网,前面仅有一大铁门,可通出入,其中仅有临时木造军用厨房一间,余无他屋,队长觅得营地后,通知全队入营,迨全队开到,先令盖搭帐幕及置放军灶,然后分发粗硬之军用饼干及干酪充饥,但各人到此,均觉疲乏不堪,多有不食而睡者矣。是夜月明如昼,仰视天空,所谓“露从今夜白,月自故乡明,”思家之念,油然而生。然终因疲乏而睡,讵料好梦方酣,忽被门外汽笛声所惊醒,俄顷,天空间轧轧之声不绝于耳,仰观云际,德飞机三五,盘绕其上,隐约可辨,我方侦敌电光,照耀如同白日,亟将高射炮,向上轰击如连珠,然终未获中一机,余等至是,拟即逃出营门,以避危险,然铁门紧闭,竟不得出;须臾又闻炸弹之下坠轰炸声,地面为之震动,余等更恐怖万分,但既无路可逃,亦只有静待死神之下降已耳。是时之余,亦以昂藏七尺之躯,遭此无谓之牺牲,不免有负来日之壮志,愁思万种,莫展一筹,亦惟有听诸天命而已。
敌机既去,余倦极入睡,中夜忽再来袭。又被惊醒,竟夜不得安睡,且抛投炸弹,满布恐怖,直至清晨始止,然朝暾既上,不得不起而工作,盖前方军士不能一日无粮秣,不能一日缺军需,而兵士所携有限,消耗甚易,子弹告竭即束手待毙,运输实战事之命脉,故工作极度紧张,不容稍缓。
次晨,英下士等笑谓余辈曰:尔等昨晚饱受惊慌矣。谈笑中似有表示此种遭遇,实不足注意之状,一若昨晚无事件发生者,余等闻此,精神为之一振,英军官见余时,亦谈笑自若。
依照华工队之组织,除留十二人组成一卫生队,专司营中清洁外,又命十二人为一巡警队,维持营中秩序,更派厨司十二人,理发匠一人,补鞋匠一人,各任其专门工作。即将全队工人,分成四小队,每队有一中尉率领出外工作,并令各人携带防毒面具,以备万一,是日工作之地,乃屯集炮弹之暗藏所也,所内藏有要塞、野战、过山各种大小炮弹极夥,输出输入,皆以军用摩托车或军用火车装载之,无论何人,禁止在内吸烟,违者军法从事,盖防疏忽或致爆炸之虞也。
#align(center)[#rect(width:70%)[
原书此处有一照片\
“一九一七年著者摄于比利时”\
不甚清晰,故略去
]]
== 大战中之摩托车
大战中摩托车之供军用,为战争时一大利器,实非常人所可意想者,在宣战后之第一月,交战各国,用于阵地之各式汽车,殆不下二十五万辆,战事开始时,各国政府向民间征用汽车甚多,其数累有增加,余日常所见摩托车之多,触目皆是,载炮也,运兵也,输送军火、食粮、辎重也,救护伤兵也,随时随地所设临时修理工场之各项器具,亦均由摩托车运输,摩托车有利于战争,由此可知。然其应用尚不止此,盖我人所知者,对于战事运输,火车甚属重要,惟铁轨一旦被毁,火车即不能于短时间内前进,势必停顿,贻误军机。而汽车道则不然,即使一旦被毁,随时修缮较易且速,于短时间内,仍可前进无阻,常见英、法军队一面浩浩荡荡前进,而兵工队在后方仍奋勇从事修缮,未见军队因汽车道被毁而停止前进,亦未见因敌人之轰击而不进也,彼西人之勇敢,自可钦佩,而得摩托车之一大助力,亦一昭彰之事实也,即战事开始时,德军攻击比利时,以至进逼巴黎,亦莫非利用此摩托车以运输兵械耳,故摩托车对于战事效用之广,有如上述。
== 战地生活
华工饮食,每日三次,午餐在野外席地而食,其余早晚两餐,均在营中,在外因不便煮饭,故仅食面包,佐以牛油充饥。
华工之饮食,颇得英人美满之考虑;因若辈来自我国南北两地,南人食米,而北人食面,且华工在家所惯食者,未必尽能得之于法地,故英人所供给之食物,未必全为华工所喜,如最初发给之乳酪及麦片,华工均不能惯食,后乃改给以乳油及米粉等,以适合华工之生活,若非经英人之考虑周详,安能得此美满之饮食哉。
每一工人食粮均有定额,然并不分发各个人,每日由队长派人向大粮栈领取,交与厨司,依定额每人应得之粮,计肉(羊或牛)四两、米十两、面包十两、面粉六两、蔬菜(马铃薯及葱)八两、糖一两、火腿二两、硬壳油一两半、奶酪一两、茶八分之三、盐四分之一、牛油一两(以上均以英两计算)。由此可知所发食物既夥,亦可适口,至于肉食,常以兔肉代之,当系牛羊缺乏之故。
除军粮外,每人每周得领烟草及纸烟等物,但余不嗜此,持以赠人。至英军队中,再另给糖酒(rum)一种,俾作战时增加其精神,兴奋其勇敢云云。
英为一大工业国,故平时食物,多运自海外,至欧战时因更须供给在比、法之军队,于是食物之需要更殷,德人熟知此故,乃采用潜艇政策,暗中封锁,使食物无可到达英岸,但英人既视食物之接济为紧要,于是不惜冒大险,渡重洋,源源载物而归,生命之丧失,船只之击沉,皆置之不顾,工人有时偶感食物之不足,即出怨言,余与同事戴君步云及总工头张君连荣为之解释一切,务使各人体恤英人购买食物之艰难困苦也。余经此次工作,而知足食足兵之古训为不诬矣。
至我人日常生活中,颇感不自由者,厥为通信问题,凡寄递信件,照例无须贴用邮票,果属便利,然非先经英军官严密检查,不准置邮,故华文信件须先寄至老爱儿,受检查后始准寄往中国,至英文信件,先经本营官员检阅,方送邮局,再由驻局之英检阅官,复行查阅核准后,方能发出,信中如载所驻地点及有关战情内容者,一概不许寄出,故所书家信,仅能略道寒暄,无关紧要之语,实际情况,不能吐露只字。英军官及军士信件,亦受同样之检查,其目的无非严守战地消息,不使军情有所泄漏于敌人耳。
我华工同胞,固非军士可比,但我华工队因附属于驻法英国远征军之下,为英输送队之一种,故虽不受英军法之管束,然须服从英军纪律,工人中设有抗令及侮辱长官者,轻者罚锾,重者亦须受军法裁判,甚至有处以死刑者。余尝闻交战国军人,有因违抗长官命令临阵脱逃而被判枪毙者。余队中有一工人,因殴打长官,被判死刑,该工人为二四二三二号,系卫潘汉克地方(Wippenhoek),用铲击中尉汉特莱(2/Lient. Hadley)(此军官年二十许,善华语,生于吾国),被判死刑,幸邀总司令之特赦,减轻为五年惩役。按英国军法裁判,例须队中长官先禀告上校,要求批准,再由上校禀呈总部,然后由军法官三人,赴请求之队中审判之,审判之前,法官及证人等,依照习俗,均须起立手持基督教之圣经接吻,吻后各人手持圣经宣誓,借以表示所作证言,既诚实不欺,判决罪名亦为公正无私之意,誓毕开始行其裁判。
== 大战中之飞机
余队驻在怕勃伦基城工作时,敌之侦察飞机,日间则从事侦察及摄影工作,晚间则改以爆炸机,抛掷炸弹,每值皓月当空,敌机辄来侵犯,故当月明星稀皎洁可爱之夜,反增恐怖之心。敌之爆炸机,亦时至伦敦、巴黎各地,恒掷巨量炸弹于伟大之建筑物,伤亡人口,牺牲财产,难以估计,战神之足以毁坏物质文明,古今一例。
某晚,敌机正飞空侦察时,某队有一工人,偶站营幕外,燃火柴以吸烟,讵料此星星之火,适为敌机所见,立即描准投下巨大炸弹,以至全幕工人十四名均受死伤,该工人为个人吸烟而丧性命于俄顷,并危及同幕者生命,若该工人者,亦可为罪魁祸首也已。
每值敌机将到,例用汽笛狂鸣,借以警报,八月二十七晚,五十九队队长得警报后,遥闻机声,度敌方必有猛烈攻击,急将营中铁门大开,大声疾呼,工人于仓卒间,尽力奔避,不旋踵营内果中弹而炸,全队工人幸免于难,而得不死,咸赖该队队长机警营救之功也。
战器中功用最大,而能发挥最大力量者,莫如飞机,此为各军事家所公认,亦为余在欧战中,观察所得者,盖大战时之飞机,最能活动,敌方之大炮、敌人之铁甲车,虽属战争利器,未能常施其威力于战线之外,惟飞机则不然,远如法、比、英各大都市,近如前线后方,不分昼夜,往来飞翔,侦察轰炸;冀以消灭士气,破坏物力,伤失对方人民战斗之志,减少对方士兵战斗之力,此外尚有一种最大功用,为常人所不及知者,为交战时作军队之眼线是也。因士兵日夜蛰伏壕沟,对方攻击之由何方而来,吾方应向何方猛攻,对方炮弹之由何地而来,吾方应向何地射放,颇有辨别不清之处,胥惟借飞机之报告是赖。故各飞机均备有摄影箱及无线电机,随时随地,均可通知作战军队,使有所适从。至于炮队,若无飞机之侦察报告,必至无从射放,盖飞机之于炮队,尤属重要,因大战时,必以炮战为决胜之战斗也,由此观之,飞机于战事上之价值可想而知矣。
== 战地见闻
怕勃伦基为英在比战线后方重要之根据地,军需物品,堆积如山,工人众多,输送迅速,军人连续过此,或开往前线作战,或由战线归来休息,不绝于途,余于暇时,信步出游,偶至比人开设之咖啡店,遇一军官,彼备述前方战壕生活,据云:日夜潜伏其中,秉勇敢精神,毅力对敌,虽弹如雨下,毫不胆怯,实早置生命于度外,效死战场,为国争光,男儿之天职也。何惧之有?吁!西人之爱国心理有如此者。
既而又曰:吾人久处壕内,生活艰苦,不易忍受,实为事实,身污不得沐浴,疲乏又难安睡,日在尘土中过活,因此周身肮脏,食物之难求清洁,亦所难免。倘值大雨,水深腰际,其中痛苦,有难以言语形容者!然吾辈一无沮丧之气,茹苦含辛,常戏言相投曰,“谈笑足增勇毅之战斗精神,危惧反足以消灭士卒之壮志,”故我等于战壕中,置敌方枪炮于不顾,习以为常,处之泰然,我等每晨必须受长官检阅,事先须各自修面、刷衣、擦枪、整钮扣、擦皮鞋,检阅时间,计约五分钟。盖其目的,不外维持清洁,减少疾病,奉守军纪,于生命危险之中,犹整饬军容,以鼓励生机,保持勇敢,引起同仇敌忾为国争光之心理耳。
工作之暇,余与比、法人民谈及战事,知战前德人,准备作战计划已有数十年,而在联军方面尚无大准备,尤以英国为甚,战争之初起,联军大败,幸有英军之援助,比、法二国得免并吞,其在战前,敌探满布比、法全境,若辈均用科学方法,精密组织之;迨至开战后,在战事方面观察,更可显出敌人战前侦探之效力,盖敌方辄利用所探得之密报,以达其军事目标;即如联军之军力,及其军队之移动,彼皆借探密报,知之甚详,且在法、比境内时,每于形迹可疑之家庭中,查见无线电报之仪器,均有极巧妙之方法,隐秘于人所不能窥见之处;闻其密报方法,间有用窗户上之灯光,或开闭窗户,以暗示敌人,可谓精巧严密之至矣。
时队中有在前线作战之军官,每喜以作战法引为谈资,余又因而闻得一二,转述于次:
据云:“近世战争炮兵占最重要部份,在战线上,每次步兵前进,先须用大炮向敌方,铲除敌人之铁丝网及电网,并毁灭四周布列之机关枪及大小炮,庶步兵前进无阻;因此,欲占取敌人之壕沟,备足军火,亦属重要。否则,生命之牺牲,不堪胜言,但步兵之前进,每次仅有数百码之遥,如若过远,则被敌方未毁之炮所铲灭;是以在战术上,欲占据敌人防地数英里,非一朝一夕所能得,即非经数旬或数月之战斗不为功。
最大之炮弹,不能穿达数码以下之深土,所以在三、四十尺泥土以下,若用木料及三合土,建一堡垒,大炮力量亦即不可及也。是以防守者,虽在敌人炮攻时,竟可安居其中,如饮食,如睡眠,悉如常时,有开留声机,借以娱乐者。
关于敌人具倔强抵抗之决心,有一事足述者,为某日,英国某上校,占居某地高屋一所,约四十分钟后,德人之大炮弹,忽落于屋之四周,密如雨下,某上校不胜骇异,急命部下搜觅室内各地窖,发现一更深者,见有德军人三名匿居在内,且有一军官,明知本人生命危险,正用电话指挥炮队,如何轰击,彼等瞥见某英军官,料为重要指挥官员,一见我人(英人)入窖时,彼即起立,态度自若,毫无惊惧,静待彼最后命运之来临,其勇敢实可钦佩也。
此外尚有一德军官,匿于礼拜堂中,而该堂内外,遍埋地雷,设一爆裂,全村之半,立即炸成瓦砾之场,幸我人(英人)发见该军官正在暗中摸索,以备发放,遂举枪歼之。
至近代之战争性,如在广大之地面作平面战争,实为不可能,盖生命之牺牲,至为浩大也,故在 Marne 一战将终止时,双方军队,均忙于掘壕作战,以避敌人眼目,当此时也,新式大炮,互相攻击,惟有泥土足以保护若辈之生命耳。自此次一战之后,在法及欧东之一部份,由山至海,所防备者,仅为战壕,双方军队伏于壕内,有如田鼠然,不使敌人窥见,以免危险。”某军官所言,盖战争之常识也。
== 大战中之民众
一般普通民众,日常战争所抱之态度,以缺乏军事学识,遂无助战之能力,于是袖手旁观者有之,远而避之者有之,徒于战事,胜利时喜形于色,挫折时咨嗟兴叹而已,此均不明近代战争性所致,实无可非议也。在大战期间,常有数百万军士,在前线作战,另有数百万民众,在后方从事作战上需要之各项工作,若辈虽不亲临战场,然与身临战地者无异,何也?盖开战后,无论各界,均应间接加入战线,惟不若军人为前方真实之战斗也,如农产物之讲求增加,利器之准备完全,一切应用物品之充实,以及文字之宣传,不断之接济,凡此种种,皆为后方之要着;此等工作,与壕沟中继续不断之战斗相较,虽重要性各有不同,但为增进战事上之效力计,则其重要性,无异于直接战争也。试以面包一项而言,每天须烘制数百万枚,又妇女必日夜缝合沙袋,以备战壕随时不测之用,即军鞋一项,亦须无数男若女为之修补及赶制,工作亦甚紧张,是以后方民众,有功于前方战事,诚非浅鲜,余观于欧战一役而益信。
== 军官与华工
查我华工队中之官员,考其来历,有在吾国传教之牧师,有在吾国营业之商人,有由军队奉调而来者;至若辈待遇华工,以各员性质之优劣及资格之不同,自有区别;态度从容,和蔼慈善,而令人悦服者有之,声色俱厉,粗暴成性,而一无官员资格者亦有之,以余队而言,先后官员,共约十余人,内有一名马太斯(Matthews)者,系来自英军队中,曾参战而受伤多次,今英政府特免其前线军役,而命其服务于华工队,以示优异,该军官对待工人,毫无骄色,待人浑厚,温言慰勉,如工人无力工作时,准予给假休养,群情爱戴,工人咸称之曰马大人。
另有一军官,生长吾国,善操华语,但暴躁性成,动辄詈骂,倘工人表示无力工作,彼毫不怜惜,必报告队长,使其受罚,最可笑者,敌机来时,彼即惶惧,首先逃避,匿于沟渠,跪求上帝,宽恕其罪,以保生命。但至翌日,旧态复萌,咒骂如故,殊堪发噱,此人毫无修养,殆未受高等教育使然欤?余队尚有良善官员二,一名汉莱荪(<NAME>)中尉,彼曾著一书名《日本之战争精神》,极为外人所赞赏,一名少布莱(<NAME>),彼曾在上海麦伦书院任童子军教练长,其父母死于歇浦,葬于上海,彼在工人前,自称华人,温和谦恭,绝无傲气,故工人亦均爱之如同胞,彼爱华人,一若爱其本国之同胞然。人为有感情之动物,信然。
至英军官之良善与否,与华工工作成绩之优劣,颇有连带关系;未有队官良善,而工作成绩不佳者,亦未有队官不良,而工作仍佳者;某英教会领袖,尝语余云,余时闻人言,成绩不佳之工队,究其原因,由于不得适宜之官员所致者多,由于队中募有不良之工友者,实居少数。然在战事进行中,所有前线作战之军队,均须胜任之军官充当之,至在后方指挥华工队之军官,已非上乘,故不能得适当之处置也。
对于官员之待遇,在老爱儿地方,贴有大字中文之通告,凡工人或工头如受不公平之待遇,必须控诉英官员者,得直接禀告督办,以便处置,督办亦常派善操华语之英参谋,巡察各队,秘密询问工头及工人,英军官有无虐待事情?如确有其事,一经查明属实,即将虐待工人之军官查办,或调往前线作战,作为惩罚,因此队中官员,亦有所警惧,乃不敢擅作威福,夫华工在军队生活中,尚受军法之保障,于此而益知法之足以保障人权矣。
== 舌人情操
吾华工队译员,共约四百余人,如夏奇峰、蔡善身、杨永经、戴步云、吴泽湘、沈向高、余光超、毛华棵、陈俊德、何事耕、魏光征、古伟青、赵卓甫、刘国光、王琢芝、陈安慈、宋文奎、林逸仁、张荣森等,大多为年约二、三十岁之青年学生,来自我国各大学校(如约翰、沪江、南洋、金陵、清华、北大等校),余在法遇有清华学生二名,彼等不愿赴美留学,甘愿冒险来法,任华工译员者,实因参加欧战,为难得之机会。
军人服从领袖,日常礼节,异常重视,惟对于译员则不然,因余辈既非军人,又非官员,除行晋接普通常礼外,并无军礼之拘束,故余辈之出入,及游行散步,或与英官谈话,一无麻烦,尚觉自由也。
在华工队中任译员,甚非易事,因吾国工人来自各省,语言不一,如奉天、热河、河北、河南、安徽等处,山东尤以泰安、靑州、济南居多,官员方面,亦来自英之各处,如爱尔兰(Ireland)、苏格兰(Scotland)及伟尔斯(Wales)等地,同属英人,语音亦不一致,尚有含糊而不清晰者。设置译员,原使明了双方言语,免致隔膜,但事实亦有困难之处,各队中一无华籍官员,因此译员自居于中国官员之地位,任指导及保护之职,并常为华工辩护,因华工被审时,持有充分理由而苦不能申述,故得有译员在旁,代为据情解释申辩,务使得公平裁判,以免冤屈,侨工受译员之护佑,实非浅鲜。
== 死里逃生
余队在法工作,约有三载,然并不常驻一地,各地调动,先后约有十余次之多,至迁调之原因,有时因处境危险,工人自动要求迁居他处,有时因敌人猛进,英兵后退,不得不迁往后方,以避危险,每次迁营命令,无不突然而来者。军令一到,立即他迁,且命令之发出,无分昼夜,余忆及一九一八年三月之某晚四句钟,余等正在酣睡时,忽英军工团司令之迁营命令到达,只得立刻起程,列队出发,乘军用小火车,向后方退却,时敌人行将攻入该地,已间不容发矣。然每次离营之前,无论如何紧急,队长必命营中卫生队,将全营场地扫除一周,务使全场清洁,而后列队开拔。英人之重视清洁,与整齐严肃之精神,亦由此可见一斑。
余队虽常在战线后方工作,但距离前线仅有数英里之遥,故敌炮敌机轰炸之危险,随时可以发生,迄今回忆前情,犹觉不寒而栗。
某日,余队驻在比境时。正与同事戴君步云,畅谈国事,忽屋顶洞穿,飞下炮弹碎片若干。始知德又用大炮轰击矣,乃偕向邻近比国民家地窖中奔避,时有比国夫妇二人,各抱小儿(一年约四、五岁,一年约二、三岁),极形恐怖,屋外炮声隆隆,余即语彼夫妇曰,余等为战事工作而来,不得已而留此,但君等何以尚居此险地,不速离耶?乃夫若妇以法语答曰:囊橐空虚,何以遁为,身无分文,即出亡亦将饿死。言语悽恻,若不胜其唏嘘也者。
某月,余队所驻地点,距离比国火车站甚近(其时期及地点,曾有记录,因一二八闸北之战遗失),敌人每逢午夜后,常用大炮轰炸车站,所幸无一击中者,敌机亦时来投弹,故每夜余被惊醒者必数次,日间服务辛苦,夜间又不得安睡,此种困苦生活,实非身居局外者所能想象万一。
某晚二时,一弹正落在余睡幕之后,顿时炸成大洞,面积巨大如桌,余被惊醒,周身如覆重物,盖为实弹炸力,震动泥土塌下所致,所幸余队均睡于地下,当时预将睡处掘土甚深,上面覆以帐幕,以避风雨,因此炮弹炸裂碎片散布全营,故一无死伤者,队长梅克歪伦(MacFarlane)为一热心天主教徒,据其侍从云,彼闻炮弹炸裂声后,即起身跪地祷告,然后奔至余处慰问,余死里得生,实为万幸,倘该弹正落在余幕中时,余必被炸成齑粉矣。
一九一八年三月间,余队驻在比境之尔能汉斯脱(Reninghelst)时,适为月之十六夜间,余疲极熟睡,好梦正甜,忽被落在营外之炮弹声所惊醒,立即起床出营,继又闻炮弹落地声,亟尽力奔逃,待抵距离数英里之英军青年会时,犹闻炮声不绝,乃复向前奔,其时手中仅携一绒毯,月明如昼,更深夜寒,但闻犬吠之声,不绝于耳,此情此景,凄惨欲绝,一路飞奔,仍不稍懈,人虽疲劳,竟忘其苦,后幸觅得空屋一小间,入内安睡,以天气严寒,终不得合眼,乃起身回营,奔至半途,遥见工人络续于途,时正午夜后二小时也,据同伴云,敌人仍用炮轰营前之木工厂,恐已毁矣,余乃随队而行,寻得草墩一所,疲极而睡,仅数小时,东方已白,再回营中已八句钟矣。
== 炮轰机炸
次夜同事戴君,约往巴斯察波(Boeschepe)居住(在比、法二国间之一小镇),据云,彼有女友(比人)名球孟(Germaine)者(余曾晤及),已由伊波斯城(Etaples)迁往彼地以避危险,现借宿法籍人民家中,该法人仅有一子,以身许国,作战于韦尔顿(Verdun),沿途步行相谈,不觉已抵该女友家,戴即高声叩门,其时适值深夜,彼女友已早入睡乡,嗣为叩门声所惊醒,乃出外开门,立谈少许,该女友即领导余二人至另一法人家寄宿,余与戴君同睡,甚觉舒适,迄今回思当夜之安睡情况,可谓余在法最舒适之一夜。酣睡至晨,余二人乃相偕回营,时余队仍工作于营前之木工厂中,忽一敌弹飞落厂中,余立时出厂,余即通知营中队长,正在出厂之际,忽又飞来一弹,落在余之近旁,幸未爆炸,迨见队长嘱余镇静毋恐,并谓余曰:“避弹之法,最好卧伏壕沟内,或有掩避之处,缘敌弹倘正落在身旁,实无幸免之理,即落在丈余外,或再稍远,则炮弹爆裂后之铁皮及被弹力轰起之石块亦足以丧生命。”余闻而颔之,行至营外,见各工人正向各处奔逃,秩序大乱,余亦偕同前奔,此时余侪四周,均有炮弹落地,危险万状,然炮弹无情,安可不避,各工人见余,亦均追随余后奔避,至日中已离数英里之遥,时各人饥肠辘辘,余乃为彼等购买咖啡,借以解渴,不料法人竟拒绝出售,余即用法语尽力解释误会,始允出售,除购咖啡外,并购大面包十枚,每枚约计二佛郎,以分飨四十余工胞,又请比国居民,特为彼等煮咖啡茶,工人对余,均甚感激,盖欧战时之比、法二国食物甚感缺乏,因军民二界,食物均有定额,所谓有钱即可购物之一语,实不适用于此时矣,是晚工人露天席地而睡,余则借宿于比国民家。
余队在法,虽屡受炮轰机炸之虚惊,然始终无一人受伤,实为幸事,但他队则不然。某晚,深夜间,有一炮弹正落五十二队之一帐幕中,炸死全幕工人十四名,幕中尚有一人,适往如厕,因免于难。某日,午饭后,四十八队正在列队,以备出发工作时,忽一炮弹直落队中,队中工人多名,当即炸毙,译员一人亦受重伤,翌日,余特往该队慰问,见各工人及官员,双眼红肿,均极伤心,余亦为之泪下。又一日,余在爱亚(Aire)之地,曾与二十六队译员,谈及彼队所遇之危险,据云,彼队在顿克(Dunkirk)工作时,敌人常用飞机掷弹及用水陆大炮轰炸,死伤甚多,惨不忍言。
念吾华人,为求生计而来欧,其不幸者,或死于病,或死于弹,欲求生活而反丧失其生命,夫岂余辈初料所及哉?余等在欧,日夜思虑者,除想协助克服强敌者外,即为吾身能否安全回返祖国一问题,自念苟能一旦安抵故里,得再与家人戚友等,重行叙晤,于愿亦良足矣,各人身处危险时期之感想,莫不如此,人非木石,谁能无情?万里他乡,不知何日始能重见故国河山也。
华工来欧前,曾与英招工局,订有合同,载明在铁路、道路、船坞、矿厂等处工作,今在比、法二国被派至战线工作,实非诸工胞所料及者,但既已来欧,亦无可奈何,遇危急时,惟有一方设法避免,一方请求工团司令,迁居安全地带而已。
然在欧战期间,华工不幸而死于危险者,约计二千余人,受伤及患重病死者,尚不在内,法政府特在老爱儿地方,辟地以葬华工,为留永久之纪念。黄土一抔,魂羁异国,伤哉!
吾华工虽常处于危险境遇中,然遇战事紧急时,仍冒险而勤于工作,虽为联军出力,实亦为祖国争光。华工在欧战中,获得劳绩,亦可为我民族吐气矣。
== 华工劳绩
一九一八年三月,德军施总攻击时,英、法联军之阵线,非常危险,如白龙、加来各埠及法国北部,皆有朝不保暮之势,幸吾华工在后方,日夜挖掘战壕,输运子弹,故联军得以凭借防守,平均每一英兵,每日能掘战壕一百二十尺,而华工则倍之,我工胞以耐劳苦著称,此可谓欧战史上我华工助战之极大成绩也。其余如修理坦克炮车,制造飞机,修缮军用铁道及汽车道路,建筑野战病院,或在船坞上下船货,搬运子弹食物,以供英军之用,无不勤奋异常,为英军官所赞扬,当敌人施总攻击时,前线需用军火及食料,急如星火,于是华工分为日夜二班工作,晚班每于下午六时,列队出发,直至次晨五时停工,辛苦万状,故因此患病者甚多,于是总部特许每日百分之十休息在营,并准许在营之四周一英里半内,在下午二时至四时间,由工头率领出外散步,借以运动身体,较之以前一出大门即须受罚,优待多矣。
余队所有工作,与其他各队无甚区别,惟一九一八年春间,大战正殷时,协约联军二方面每日死于大炮、炸弹、地雷等种种之杀人利器者,擢发难数,故余队及邻队之工作,即转而为埋葬战死之军士及官员之工作,吾华工将无数毛毯包裹战士之尸身(不用棺木),一一埋之于地穴,埋葬时仅由天主教神父或耶稣教牧师,行一简单之教会葬仪,费时仅数分钟,葬毕覆以泥土,插一十字形之木架,姓名死期,一一为之载明,此情此景,不禁为之目睹心伤焉,然于吾华工之因伤或病致死者,埋葬时遵照华俗,一律用棺,足见英政府亦重视吾国数千年相传之葬礼也。
== 战地青年会
战地生活,枯燥异常,耳所闻者,枪炮轰炸声也,目所见者,各种杀人利器也。然欲调节战地生活,则有法、比女子所开设咖啡店于各战地,然亦不足供军人之消遣及娱乐;是以英国救世军队,有见及此,特在战地开辟会所,招待军人,而法政府并专为其军队,备有影片戏剧等等,以供娱乐,法之著名伶人及歌唱大家,均欣然担任服务,甚受彼辈之欢迎;因军人年龄皆在十八左右,均属青年,得此调节,自足以增进其兴奋也。回顾我华工,十之八九,既不能阅读书报,又无正当娱乐之可言,且偶或出外散步、游玩,又不准入比、法人所设之咖啡店(英军令二七四五号禁止各有色工人入内),故我华工生活之单调,不堪胜言,乃有借赌博,暂为工余唯一之娱乐者,是不可以为训。但至一九一八年,始有华工青年会之设立,干事人员各国皆有,如英、美、法、丹、瑞、华等国人士,均系义务职,然吾国干事,居其多数,大半为英、美之留学生,如蒋廷黻、李权时、全绍文、陈湘涛、陈立廷、王正序、程其保、王志仁、梅景周、吴维德、全绍武、傅葆琛、温万庆、郑道儒、邝光林、林凤岐、钟宝璇、舒鸿等是。彼等半途辍学往欧为同胞服务,实行其博爱主义,至足钦佩。该会一切用费,大都捐自英、美两国,计建造六十会所,所中一切布置,共费英金七万磅,会中事业,注重教育、娱乐及宗教。教育方面,设有英法文、算术、历史、地理及国文班,并演讲时事,西方风俗,及战时常识,娱乐则有电影、演讲、足球、弈棋、拳术、蓄音机等。此外又由该会编刊《华工周报》,借以互通消息,联络情感,主编者为傅若愚、陆士寅、晏阳初诸干事,并组设小商铺,以便工人之购物,每逢星期,宣讲教道,开设查经班,使得宗教上之认识,心灵上之安慰,并又特编六百汉字,以便工人易于识字实用,余队工人自愿加入研读此六百汉字者,计有一百三十人,读地理、算术者,约六十人。自该会创设后,一班华工在青年会训导之下,非但知识得以增进,且生活亦感兴趣,对于赌博,咸觉无益而乏味,竟收绝对不犯之效果,此亦提倡正当娱乐,有以使然。中国社会上正当娱乐提倡之不可缓也明矣。
== 爱国热忱
华工之在祖国,国人皆以下等阶级视之,欧洲白人亦以苦力呼之,然华工爱国之心,实未尝较受有高等教育者稍逊,余为此言实非虚语,谨以事实,以证予言之不谬。
某队有一华工,不惜将二年之积蓄,悉数交于王正廷代表(王氏当时适为巴黎和会中国代表),请资助最有利于吾国者,其爱国心可见一斑。
欧战停止后,在比国之英军人,某日特开国际大运动会,并请各华工队加入,计吾华工队前往参加者,共有十二队之多,约共六千人,待抵场地,仅见各国国旗飘扬空际,独无吾国国旗,各华工于非常愤怒之下,立即退出会场,各自回营,当时译员夏君奇峰及予之亲戚杨君永经,均在场目睹此爱国举动者也。
当凡尔赛举行和会时,美国大总统威尔逊赴欧出席和会,轮抵法国勒哈佛尔(Le Havre)(系法国西部海港)时,我华工队曾派代表多人,整队至该处欢迎,予威尔逊氏一极良之印象;当和会未开时,日本四处活动,主张中日直接解决山东问题,并迫我代表,承认日本承继战前德国在华一切权利,我华工队闻之大愤,曾派代表致书,并赠一手枪于陆征祥,书云:“苟签字承诺日本之要求,请即以此枪自裁,否则吾辈必置尔于死地⋅⋅⋅⋅⋅⋅”陆君于是未敢签字承诺。凡此种种亦可见吾华工爱国之热忱矣。
== 可歌可泣
中国之参战虽未曾直接出兵助战(惟一九一八年九月,曾派兵若干至海参威协助捷克军而已),然不无有几分实力之赞助者,厥为华工,此人所共知者也。但若辈虽为华工,尚有令人闻之可歌可泣者,此为人所不尽知,然亦为国人所不可不知者也;聊纪一二,以告国人。
新婚遥怨\u{3000}一九一八年中秋日(在欧每年英政府特准放假三天,即端午、中秋、旧历新年,各一天)一百二十队中,有一年约二十岁工人,自经于营舍之厨房内,平时常有人闻其自言自语曰,三年太久,三年太久(凡赴法工人签有合同,三年为期)此或为其自杀之原因,按该工人,为一新婚之靑年。婚后仅数日,即行离国,待抵法地,始悉英人招工赴法,目的为在欧战服务,非一时所能回国,且为合同所束缚,若欲私自逃归,既不识途径,且囊无川资,佳节已届,遥望家乡,苟得团聚天伦,何等快乐,而今孑然一身,飘流海外,回国之日,杳杳无期,思念至此,惟求一死为快,因此自萌短见,遂牺牲一生幸福矣。
游子思亲\u{3000}五十八队中有一监工某,当彼在中国启程后,伊妻即吞服吗啡自尽,先是某念国内无法生活,故急思赴法谋生。伊妻百般苦劝,终不置听,气愤之极,即行自杀,迨该工头在法接得此项噩耗,急欲回国,未蒙准许,彼自念既不能归,家中尚有老母,乏人照顾,于是恳切哀求,终不见允,悔恨之余,徒叹不听妻言,致失行动自由,因之神经错乱,致病疯狂,卒被送至老爱儿疯人院拘禁,良可悯矣。
念子殉生\u{3000}一九一八年七月之某日,余队有一年老之工人,年约五十许,忽被救护车由厂送回营中,待军医到营,开其眼,已不能动,抚其身,已失知觉,二小时即死,其致死原因,为中暑病。按该工人,是日午饭后,大饮冰水,复仰卧于烈日之下,待醒后即行大吐,顷刻间,人已昏迷,卒致不起。至该工人赴法唯一之目的,在希望寻觅其爱子,一俟寻获后,即同行回国,不料爱子未获,而渠竟先赴黄泉矣。伤哉!
== 华工艳事
华工在法娶法女事,在英募华工队中,未有所闻,然与法女由认识而交友者,亦间有所闻,惟在法华工队内,华工娶法妇生子女者,不在少数,法募华工,大半系机工,所入多倍于英募之华工,且其日常起居生活,自由较多,又加接近法女工之机会更多,彼等与法女,双方因好奇之心,始而生热趣,继而生情感,及情感日深,于是每多由爱情而结婚,但其后因华工之娶法女者日众,因此引起法政府之注意,在一九一九年十一月十日,法国内务总长鲍慕司为华工与法妇联婚事,有黄祸通告,略谓“华工皆多苦力,家境贫寒。饮食起居,不堪言状,吾大法民国之妇女,何不嫁与凯旋之法国兵士,而欲与黄种苦力联婚,殊失吾强国名誉,望法国贵女,速起反对,以免日后黄祸之发生。”但大战时间,法国甚感男子之缺乏,大半壮男,或死于战,或受重伤,亦成废人,女子因不参战,故死伤究属少数,因此全国人口,女多于男,倘法政府坚持每一法女须嫁法人,势所不能,此通告因不顾当时之实况,竟亦无补于事,然法女究非无识者,既见政府之通告,咸有戒心,凡嫁华人,其唯一条件,为不使其离国,而华工因谋生计故,亦愿久留法国,以随法妇人而生活也。可慨!可慨!
大战期间所有男子,既均赴前方作战,故留于战线后方者,除从事军事工作者外,当然仅有年老之男女,妙龄之女子,与残废及小儿而已。依照战时军人休息定律,兵士作战九个月,可回家休养一星期,然终因前线紧急,军士竟有连战三年,未得请假回里者,其最不幸者战死于前线,或受伤而死于医院,终不得一归家乡,因此战时之法国女子,未嫁者多不得与本国人成为情侣,已嫁者,有送别良人赴战线后,数年间未获一晤,即幸得一晤,其后亦有难以重逢者,彼姝者子,顿感怀春,于是法女,因前途暗淡,甚觉独身之无聊,渐致不耐寂寞而恣行浪漫生活。此皆由万恶之战争,有以造成此当然结果也。
英国法官 Justice Darling 云,战争影响于我国人民之德行,数倍于物质上之损失,而尤以养成妇女浪漫行为尤甚等语,由是观之,英国虽非直接战地,然尚如此,况在战地之法国人民乎?
== 民间交际
华工在欧与西人日有接触,每日工作,任管理及指导者,皆彼西人,工厂中同伴工作者,均为比、法两国人,工人出外购物,或游览时,相过从者,皆比、法士女也,法之各地及比境佛莱特斯(Flanders),随处见有华工散居其间。比、法人初遇华工时,似觉诧怪,相处日久遂不为异,华工亦然,日久亦习知西人性情,乐与周旋,加之华工抵法不久,能操英、法语者甚多,所谈虽不足成语,然能使英、法人闻之明了,已属不易。华工居法有年,工余之后常赴比、法人家游玩,余在比、法人家,曾遇华工多次,彼与主人翁闲谈一切,或饮其家之特制啤酒(按法人之饮啤酒,即如吾国人之饮茶,各家全备),情甚亲密,彼主人或男或女,殷勤招待,一无轻视吾苦力之表示,而吾华工举止有礼,毫无粗鲁之态度。华工常取营中所发之香烟,贻赠彼等,盖比、法人甚喜吸烟,然因战时限于法定之数额,往往不能如愿购吸。工作时,华工每喜与和善之欧人谈笑,彼欧人突以为奇,因普通欧人,于未见华人前以为华人乃不知诙谐之民族,今见中国之最低级苦力,尚能嬉戏,一如白人,始悉彼理想中无风趣之华人,并非真确。我华工以全体而论,在欧所予白人印象甚佳,彼英、法人常言华工,为世界上最快乐之儿童,由此亦可知彼国人士,对华工之心理得美满见解矣。
== 休战日之狂欢
一日,午前十一句钟,余辈正在 Rouen 油厂工作之时,忽闻教堂钟声,工厂汽笛声,以及厂外欢呼声与歌唱声,同时并作,余辈惊问何故,始知敌人业已签订休战条约,战事从此可以终止矣,此何日也,即余永久不忘之一九一八年十一月十一日也。是日各地工作,各地战事,自十一点起,一律停止,余返营午膳后,乃即出外,欲一观当日法人庆祝休战之盛况,迨行至街市间,已人山人海,男女老幼,军士人民,各色人种,混在一起,互相携手,时或唱歌,时或欢呼;其尤甚者,不顾一切,彼此狂吻,且有法女纷向男子接吻者,以示喜庆之诚意,其尤可异者,在万人欢呼歌唱之中,竟有哭泣者,此实喜极而涕之表现,亦有念家人之伤亡,由悲痛而号哭者,此情此景虽觉惊奇,然静心细思,亦无足异,何也?盖彼法人久困于凶暴之战争中,日夜忍受种种精神及肉体上之痛苦,自不待言,今一旦得获解除,其情不自禁之快乐,自非言语所可形容此种种狂欢之状也。
== 德国致败之由
欧战自一九一四年八月初爆发后,直至一九一八年十一月十一日始告休战,计四年零三月之久,在此长久时期中,德国始终未被协约国之一兵一卒侵入寸土,其大屠杀之恐怖战场,终在法、比两国境内,是德国之乞和,实非军事上之失败,乃外交上以及其他方面之种种原因而失败,爰略述其致败之由若干点,如下:
比利时拒绝假道\u{3000}欧战发生前数年,德国已充分预备。故宣战后,预料在英国未及动员前,德国军队可以假道比国,长驱入法,一月之内即可占领巴黎,则英国必不致加入战团,而德国胜利,唾手可得也。孰知比虽蕞尔小国,不受德国之威胁利诱,对德国之假道,竟坚决拒绝,死力抵抗,实出德国意料之外,德国虽于一星期内完全占领比国全境,然在此短短七日内,畀予英、法两国以动员时机,竭力预备,从容布置,故比国之不辞牺牲拒绝假道,实为联军胜利之第一功也。
义大利脱盟联协\u{3000}欧战发生前,义大利本为同盟国之一,经英、法外交家动之以利,乃脱离同盟,而加入协约,此亦为德国失败之一大原因也。
潜艇政策之失败\u{3000}一九一七年,德国施行潜艇政策,以极少数人与极多数人相拼,以极小之艇与极大之船只相拼,故其损失小而收效大,以为联军方面之运输船只,感牺牲太大,必不敢再航行于海面,则协约方面之后援绝,而粮草断不能支持,势必降服无疑也。孰知世界第一之英国海军,被击沉之船只虽多,而制造新船之速度,竟超过被击沉之数。牺牲虽大,仍得在洋面上往来运输不绝,初非德国预料所及,吾故曰英国为欧战之中坚,协约国之胜利,英国之功最大也。
德国外交之失败\u{3000}欧战爆发时,德国以为英国不致加入战团,疏于对英外交,迨至一九一七年实行潜艇政策时,实冒天下之大不韪而为之,于是素以洁身自守之美国,亦起而加入协约方面,此则完全为德国外交上之大失败也。
== 华工荣誉
常人侈谈战事,往往注重军队及枪炮、飞机等种种利器,以为战场取胜之道,端赖乎是。故非有雄壮之军队,精制之枪炮及最新式之武器,从何取胜,此种观念,虽有理由,殊不知后方工作,所关甚大,设对于后方工兵之工作,漠然视之,断不能有利于战事。盖战无工兵,难操必胜之算。所谓工兵乃军中之血脉,诚非过言。故欧战中若无华工自始至终、日夜不间断之工作,力助联军,则联军之胜利与否,尚难断定。前英大元帅,欧战时英远征军总司令海格大将(<NAME>ig)曾在英之圣安得烈大学(St. Andrew's University),对参战前线工作之华工赞扬云:“华工在欧,虽饮食起居,远不如欧人之丰富舒适,然仍能精神奋发,克苦耐劳,其工作效率,余虽不敢断言完全胜过白人,然至少能与工作最优之白人相等。
#align(center)[#block(
width: 90%,
spacing: 0.65em
)[#set align(left)
‘Our experience with the Chinese labour in France has shown us that in all classes of routine work, both skilled and unskilled, Chinamen can labour as efficiently, if not more efficiently, than the best European workmen, and with a persistence without rival. They are content with a far smaller wage, accustomed to less food, and expect fewer comforts.’]]
彼中国人大多数皆能如此勤劳,加之地大物博,蕴藏既富,耐劳多力,将来中国,势必有一日与吾白人竞争于世界”云云,其言确有见地,实非过赞,愿我大中华民族其共勉之。
欧战后,英、法政府念吾华工,有功于战事,特给每一华工及译员,参战奖牌一枚,借以感谢,吾华工不远万里而赴欧参加战事工作,虽受尽艰辛困苦,能得此奖励而生回者,亦可以稍自慰安矣。
此次我华工被募而来,乃接替联军壮丁,在后方担任各项工作,若辈壮丁,悉被遣送前方作战,因此联军多募一华工,即可多得一作战之兵士,而我中国人,勤苦素著,故前后共被英、法招募来欧者,计吾国工人及机匠,约十七万五千人。分南北两帮,南帮多浙人,北帮多直、鲁、豫人,附属于驻法英国远征军者,有十二万五千人,美国远征军者六千人,派往菲洲及米波大米者,计有四千人,而为法政府招雇者,计有四万人,总共计约十七万五千人,此十余万工人,耐苦勤劳,始终勿懈,故颇为西人所赞誉。若将此种耐苦精神,发挥而光大之,中国其庶几有豸。
== 军犬寻尸
欧战告终,协联方面,既已休战,战事工作,当然停止,然战场凌乱不堪,急需整理,英、法政府乃调各华工队,任此清理工作,但战场上未曾爆炸之炮弹及炸弹,遍地皆是,稍一不慎,即遭危险,故战后工作之危险,实不亚于战时,例如英所募某队华工,在比地掘洞置锅烹茶时,各工人皆环立四周,待饮甚急,不知地下藏有未经爆发之炸弹,未知详察,忽闻轰然一声,工人多名,均被炸成齑粉,血肉横飞,惨烈之状,目不忍睹。
战地清理工作,除收拾炮弹、炸弹及铁丝网等外,尚需发掘英人尸骸,以备英人运回迁葬。然战场广大,寻觅死尸,亦非易事,乃利用红十字犬搜寻,此种犬类嗅觉敏捷,如寻觅有得,则狂吠不止,唤起人之注意,俾人可前往起掘,但因战场广大之故,清理至数月之久,尚未竣事,亦可见工程之浩大。直至一九一九年十月,余队方得回国之命令,至是英募各华工队,乃于清理工作告竣后,完全遣回矣(惟法之技术华工,与法政府订有合同五年。因战后之法国,建筑工程甚属需要,故多被继续雇用,从事建设)。华工乘船回国之集合地,为法之勒哈佛尔(Le Havre),该城华工云集,盛极一时。至回华途程,则仍由大西洋赴坎拿大,而由坎乘船渡太平洋抵中国,此时渡洋之一切情景,自与战时不同,各人心中既无危险之忧虑,又得安返故里,一种愉快之情状,喜形于色,有非笔墨所能形容者。
== 归途遭遇
船经坎拿大,大受坎政府不自由之待遇,仍与前赴法经过时无异,当时适有中国政府英顾问福开森(<NAME>)君,途经坎拿大,目击此状,代鸣不平,即在坎报诘责坎拿大政府。兹将一九一九年十月三十日温哥城之《Daily Colonist》报所登载者,译述如下。中国总统政府政治顾问福开森,返华途经此城,见坎拿大待遇华工,深抱不平,据云:“余深知中国为世界最大之市场,倘坎拿大有意增进在华之商业,而思参与此中国大市场之利益,彼必能改变其对待华人之方针与态度,此辈华工现由法返国,在法战地时曾在战线后方,从事战时重要工作,以便有训练之军士,得免除其劳役,开往前线,为国作战,以增加联军之战斗力,彼等为联军出力,故英、法两国特许彼等在英、法两国行动自由,然坎政府则不然,竟在海利发克斯(Halifax),先驱逐经过坎国之二十万华工出船,置之于火车,横越坎境,一如铁笼中之野兽,然后再由车中驱出至栅中,而由栅再驱之上船,送之回国,如牛羊然,敢问坎拿大希望此辈华工返国后,对坎拿大之制造品或坎拿大之出产品,作何等之宣传,坎国如此待遇华工,岂不知羞辱华工为可耻乎!”
次日温报(Vancouver Sun)更载有坎拿大斯迪华脱(Brig.-Gen. J. W. Stewart)大将发表之谈话,而深对坎国政府表示不满云:“即坎拿大移民律不许华工以自由,然该律未曾禁止坎民,或以香烟,或以糖食,款待此辈有功于欧战者,余之参战中曾有数万华工助我工作,深觉彼等天性温和,冒险从事,毫不推让,甚得联军兵士之友爱,且有多数人竟为联军牺牲其生命者云云。”可知公道自在人心,又可知受此不平等之遭遇,亦天之所以策励吾人欤?吾同胞其猛省之!
== 天伦之乐
余辈所乘之船,离坎之温哥华城后,直驶青岛,各人因归家心切,在船竟不觉时间久长,虽渡太平洋时,略有风浪,亦不觉其苦,舟抵青岛,余等下船后,有立即乘车返家者,有须转轮回里者,各人一旦重归故土,心中快乐,有非言语所可喻者。余因须换轮,乃宿青岛一宵,翌日,始乘轮返申,待舟抵沪埠,急雇车回家,家人骤见余回,惊喜若狂,余亦见祖父母、父母、叔父母、弟妹等,均安好如故,更使余不胜欣慰,盖当余在欧时,彼此远隔重洋,思念虽殷,难通款曲,更不知何时可赋归欤,盖家人日夜所望者,即为余得早日平安返家。今果如愿以偿,久别重逢,团圆之乐,自非楮墨所能描写者矣。
== 欧战杂感
大战损失之巨\u{3000}此次欧洲大战实为人类空前未有之大惨剧,其损失之巨,实堪惊人。某报曾例以建筑,作财产之计算比较,颇能使人对于欧战之巨大损失,更多认识,兹特抄录于左,以供众览而有所警惕焉。
“此次欧战之结果,除兵士死伤三千万,及人民生命之死伤,精神之耗费不计外,仅以财产损失一项而言,己达美金四千万万圆之巨。如将此款用之于建筑房屋,以每所占地五英亩,每亩价一百元,房屋建造费二千五百元,家具一千元计,建成后除可容美、坎、奥、英、法、比、德、俄诸国人民居住其中外,尚余可建二万人以上之城市,五百万元之图书馆,及一千万元之大学各一,再集所余之零星杂款,以之存入银行,如以常年五厘计,每年之利息,亦足支付年俸一千元之教员十二万五千人,看护者十二万五千人。”
大战前之准备\u{3000}一般人民皆视战前之准备,问题简单,以为只须将枪炮飞机等利器,备就后即可作战,实不知衣食之供给,交通之布置,战时运输之计划,兵士之训练,原料如煤、铁等物之备足,完成一切在在需要充足周密之设计,如何可称足以应战,乃一绝大问题,非一朝一夕之事。所谓养兵千日,用兵一旦,如欧战前德人之攻法准备,亦无时或息也。
大战之科学化\u{3000}协联两方,均以科学先进竞称,故利用科学,从事战争,理所当然,德飞机之改进,英坦克之发明,无不借科学之发达,开杀人之新路,故毒瓦斯死光等等,练术之士,莫不早夜研究,以期完成残酷之杀戮为宗旨,或云“将来之战争,不复以争地争城为取胜之道,而以歼尽敌人军队,消灭敌国军备,使敌人战斗力完全丧失,为战争主要目的,”实非过言。
大战之全民性\u{3000}我国人民有以战争为政府之事,与己漠不相干,故远离战地则取旁观态度,祸延眉睫则出于逃避之一法,对于人民与国家间之关系,淡焉置之。实不知人民利害与战争之胜败互相联系,胜则利,败则害,此事所当然者也。故欧战时,彼交战国人民,其先无不热烈赞助政府,予以精神物质之协助,举凡军器之制造,军用品之供给,食用之节省,宣传之普及,在在足以表示彼人民助战之热忱,增加战力,鼓励勇气,实非浅鲜,同盟方面之德国,其所以难于支持而乞和停战者,系因人民对于彼政府不满,与食用之发生恐慌,遂群起革命而反抗之故也。
大战中之女子\u{3000}大战期间,女子所受之痛苦,实不亚于男子,对从事战争努力,亦不下于作战之男子,实可证明男女平等,权利义务亦相等也。当余在欧战时,感觉最深者,厥为来往客车中所见之妇女幼孩,非领披黑纱,即面露忧色,一望而知其若夫若父,已疆场效命,为国捐躯矣,但同时所见者,即战线后方,许多工作,凡战前为男子所担任者,今大战时皆以女子代之。如电车、摩托车之驾驶员,邮局之信差,弹药厂之工人,店铺及公司经理等等,无一非女子任之。盖战事发生,向为男子所经营之事业,今已被征而十室九空,不得不由彼女子起而代之,然工作之成绩,亦殊不亚于男子也。
英军营中,时见服军装之少妇,往返不已,若辈即为英政府组织之女子军,借以辅佐英军后方工作,其一种饱满之精神,竟与军人无异也。
大战中之精神\u{3000}军士在战场中虽日处于危险万分之境,但日常生活秩序井然,即饮食起居,虽与下等动物无异,其耐劳精神,仍始终不懈,而人民则于恐怖、忧虑、缺乏、不安、家破人亡之中,亦极力助战,刻苦度日,一无难色,此种精神有足多者。
忍耐\u{3000}军士人民日处危险,境遇困苦,已如上述,然仍时抱乐观之态度,日常谈笑如故,即大战多日不休,毫无怨色,对于一切痛苦危险,悉持以忍耐之心。
服从\u{3000}战时军令森严,长官命令,不得违抗批评,盖军令重在绝对服从,故战时之征募新兵命令,人民均无异言,一律加入行伍,如遇人民抗募者,则罚以监禁之罪,但未闻有逃避,冀免军役者。
合作\u{3000}彼人民之于政府,随时随地,皆合作协助,如政府征发军用品,人民尽量供给之,军粮缺乏,人民自动节省饮食,而补充之,军队之间,合作尤甚,盖稍一散漫,即关全军生命,例如当一九一八年三月,英之第五军队阵线,在阿米恒斯(Amiens)突被德军冲击,其危急情状,实有全军覆亡之虞,法之福尔斯(Folles)大将,立即率领法之新军,赶往营救,英军始得脱险。
勇敢\u{3000}军士人民于大战时,勇敢精神,实足为我人钦仰,尤以凡尔登(Verdun)战役,最为显著,当时德全副精力,皆集于此地而为总攻击;而法亦以全力来相抵御,卒之德军之死伤及被俘者竟达三十万人之多,损失之巨,为开战以来所罕见,法国因困守死地,损失亦属不赀。然双方勇敢之精神,于此可见一斑矣。
亲善\u{3000}古昔战争,苟掳敌犯,杀戮殆尽,至为残忍,近代战争,较为文明,所有俘虏,囚之于营,只使其无自由行动而已。而欧人尚以敌犯所受之待遇,仍不免非常恶劣,然余在大战时所见者,适为相反,余队在一九一九年之九月,曾迁居德犯之英营中,其中洗浴室、盥漱室、厨室、大运动场等种种设备,甚为完全,彼敌犯日常生活之舒适,由此可想而知,据云,优待俘虏自有目的,盖敌犯一经善待,必有报告,寄往敌国,敌兵阅后,战场上如遇有确实无法抵抗时,必自愿投降,或竟不战而降。所谓以德服人者,此也。
友爱\u{3000}此次英、法所募之华工,虽不足以代表我国之全体民族,但实足代表中国大多数之人民,盖华工大半均系农人,而农人又占我国人口百分之八十以上,华工之在欧,同胞间患难相共,即对于彼邦人士,如有困难之处,亦莫不尽力救助,兹略引事实一二,以资佐证。
一九一八年三月某日,余目睹英兵五十名左右,精神疲乏,饥饿垂毙,由前线归来,经过余队时,向我营中华工乞食,我华工人虽因当时全法食物缺乏,粮额业已减少,每一面包,十人分食,然华工博爱心重,自愿节食,分赠饥饿之英兵。一九一八年春间,大战正属剧烈,当敌兵大举进攻时,各工程队,均已迁出险地,但我华工仍有不顾危险,与英兵朝夕相处,助其煮饭等工作,吾华工友爱之精神,于此可见一斑。
大战中所得之教训\u{3000}一般主张和平主义者,辄以战争为酷残,摧文化,荡民居,故有起而提倡解除或减少世界各国军备,以实行世界和平者。此种论调,似是实非,盖欲维持和平,惟有日常备战,虽我不犯人,但一旦人欲犯我,其将奈何,故余敢言世界一日不灭,战争亦一日不止,美之威尔逊氏,曾倡言以战争停止战争,作为欧战最大之目的,虽不免过于崇拜战神,蔑视和平,但际此世界战云漫弥之时,列强野心日亟之秋,我人为自卫而备战,为御侮而备战,为保存民族而备战,为公理人道而备战,显非不当,盖守土争存,舍死抗敌,为世界和平国际信约而战,谁云不宜,愿我国人,速起图之,其毋忽焉。 |
|
https://github.com/jakobjpeters/Typstry.jl | https://raw.githubusercontent.com/jakobjpeters/Typstry.jl/main/docs/source/index.md | markdown | MIT License |
```@meta
DocTestSetup = :(using Typstry)
```
# Home
## Introduction
Typstry.jl is the interface to convert the computational power of Julia into beautifully formatted Typst documents.
### What is Typst?
Typst is an open-source and relatively new typesetting system (written in Rust 🦀🚀),
[designed to improve upon the performance and usability of LaTeX](https://typst.app/about).
See also the Typst [repository](https://github.com/typst/typst) and
[documentation](https://typst.app/docs) for examples and how to get started.
## Installation
```julia-repl
julia> using Pkg: add
julia> add("Typstry")
julia> using Typstry
```
## Showcase
```jldoctest
julia> show(stdout, "text/typst", Typst([true 1; 1.0 [Any[true 1; 1.0 nothing]]]))
$mat(
"true", 1;
1.0, mat(
"true", 1;
1.0, #none
)
)$
julia> TypstString(1 // 2; block = true)
typst"$ 1 / 2 $"
julia> typst"$ \(1 + 2im; mode = math) $"
typst"$ (1 + 2i) $"
julia> TypstCommand(["help"])
typst`help`
julia> typst`compile input.typ output.pdf`
typst`compile input.typ output.pdf`
julia> render(1:4);
```
## Features
### Strings
- Print Julia values in Typst format
- Specify Julia settings and Typst parameters
- Implement formatting for custom types
- Construct Typst strings
- Interpolate formatted values
### Commands
- Construct Typst commands
- Render documents using the Typst compiler
- Display in IJulia.jl, Pluto.jl, and QuartoRunner.jl notebooks
- Use the [JuliaMono](https://github.com/cormullion/juliamono) typeface
### Planned
- Default `auto::Mode`?
- Automatically determine the Typst syntactic context
- Use a tree-sitter grammar or jll package
- Implement Typst formatting for more types
- `Base`
- `AbstractDict`
- `AbstractIrrational`
- `AbstractSet`
- `Enum`
- `Mode`
- `Expr`
- `Symbol`
- Package extensions
- Standard Library
- LinearAlgebra.jl
- Partial Julia to Typst transpilation
- ```
@typst(a * b) ==
TypstString(:(a * b)) ==
TypstString(TypstFunction(*, :a, :b)) ==
typst"(a b)"
```
## Similar Packages
### Typst
- [Labelyst.jl](https://github.com/emanuel-kopp/Labelyst.jl)
- [TypstGenerator.jl](https://github.com/onecalfman/TypstGenerator.jl)
- [TypstJlyFish.jl](https://github.com/andreasKroepelin/TypstJlyfish.jl)
- Interoperable with Typstry.jl
- [Typst_jll.jl](https://github.com/JuliaBinaryWrappers/Typst_jll.jl)
- Dependency of Typstry.jl
#### Typst and LaTeX
- [MakieTeX.jl](https://github.com/JuliaPlots/MakieTeX.jl)
- Dependent of Typstry.jl
- [SummaryTables.jl](https://github.com/PumasAI/SummaryTables.jl)
### LaTeX
- [Latexify.jl](https://github.com/korsbo/Latexify.jl)
- [LaTeXEntities.jl](https://github.com/JuliaString/LaTeX_Entities.jl)
- [LaTeXStrings.jl](https://github.com/JuliaStrings/LaTeXStrings.jl)
- [LaTeXTabulars.jl](https://github.com/tpapp/LaTeXTabulars.jl)
- [LatexPrint.jl](https://github.com/scheinerman/LatexPrint.jl)
- [LibTeXPrintf.jl](https://github.com/JuliaStrings/LibTeXPrintf.jl)
- [MathJaxRenderer.jl](https://github.com/MichaelHatherly/MathJaxRenderer.jl)
- [MathTeXEngine.jl](https://github.com/Kolaru/MathTeXEngine.jl)
- [tectonic_jll.jl](https://github.com/JuliaBinaryWrappers/tectonic_jll.jl)
|
https://github.com/typst-doc-cn/tutorial | https://raw.githubusercontent.com/typst-doc-cn/tutorial/main/src/basic/reference-calculation.typ | typst | Apache License 2.0 | #import "mod.typ": *
#show: book.ref-page.with(title: [参考:数值计算])
#let table-lnk(name, ref, it, scope: (:), res: none, ..args) = (
align(center + horizon, link("todo", name)),
it,
align(
horizon,
{
set heading(
bookmarked: false,
outlined: false,
)
eval(it.text, mode: "markup", scope: scope)
},
),
)
// calc.*
等待#link("https://github.com/typst/typst/pull/3489")[PR: Begin migration of calc functions to methods]
|
https://github.com/EGmux/PCOM-2023.2 | https://raw.githubusercontent.com/EGmux/PCOM-2023.2/main/lista2/lista2q12.typ | typst | === O padrão ASCII possui 128 char's, que são codificados em binário. Se um certo computador gera 100.000 char's por segundo, determine:
\
==== a) O número de bits requerido por caracter.
\
se ele gera 100.000 caracteres por segundo e assumindo que caractere representa
um símbolo
#math.equation(block: true, $ R_s &= R_b/ k && \ $)
💡 o truque é perceber que L é 128 isto é os níveis de quantização, e que são 7
bits por caractere.
==== O número de bits por segundo requeridos para transmitiar a saída do computador e a largura de banda mìnìma requerida para transmitir este sinal.
\
ele quer a taxa de bits, como temos a taxa de amostragem, é simplesmente
multiplicar
#math.equation(
block: true, $ R_b &= f_s dot l && \
&= 100.000 "caracteres/s" dot 7 "bits/caractere" && \
&= 700 "kbits/s" && \ $,
)
e a largura de banda mínima é de *$W_"min" = R_b/2 =$* 350 kHz
==== Para ter a capacidade de detecção de error simples, um bit adicional (bit de paridade) é inserido no código em cada carcter. Calcule novamente os items (a) e (b) considerando essa informação.
\
para a) o que muda é que agora são 8 bits por caractere.
para b) o que muda é que a taxa de bits aumenta
#math.equation(
block: true, $ R_b &= 100.000 "caracteres/s" dot 8 "bits/caractere" && \
&= 800 "kbits/s" && \ $,
)
e a banda mínima tambem irá aumentar, irá para 400 "kHz"
🚨 A banda mínima é essa porque o símbolo transmitido é 2-PAM, se foses algo
diferente seria alterada a banda mínima, em outras palavras é enviado um bit por
vez, k=1.
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.