test workork
gork
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
int i, j;
|
||||
|
||||
// Number of rows
|
||||
int rows = 3;
|
||||
|
||||
// Taking first character of alphabet
|
||||
// which is useful to print pattern
|
||||
char character = 'A';
|
||||
|
||||
// This loop is used to identify
|
||||
// number rows
|
||||
for (i = 0; i < rows; i++) {
|
||||
// This for loop is used to
|
||||
// identify number of columns
|
||||
// based on the rows
|
||||
for (j = 0; j <= i; j++) {
|
||||
// Printing character to get
|
||||
// the required pattern
|
||||
printf("%c ", character);
|
||||
|
||||
// Incrementing character value so
|
||||
// that it will print the next character
|
||||
character++;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
1,2,3,4
|
||||
5,6,7,8
|
||||
|
@@ -0,0 +1,4 @@
|
||||
#import "/utils.typ": code
|
||||
|
||||
= Код програми sample.c <foo-c>
|
||||
#code(read("/assets/sample.c"))
|
||||
@@ -0,0 +1,24 @@
|
||||
university = "ХНУРЕ"
|
||||
subject = "ЕРВ"
|
||||
type = "ЛБ"
|
||||
number = 2
|
||||
|
||||
[[mentors]]
|
||||
name = "Шевченко Т. Г."
|
||||
degree = "Доцент кафедри ПІ"
|
||||
gender = "m"
|
||||
|
||||
[[mentors]]
|
||||
name = "Франко І. Я."
|
||||
degree = "Асистент кафедри ПІ"
|
||||
gender = "m"
|
||||
|
||||
[[authors]]
|
||||
name = "Косач Л. П."
|
||||
edu_program = "КУІБ"
|
||||
group = "23-2"
|
||||
gender = "f"
|
||||
variant = 8
|
||||
full_name_gen = "Косач Лариси Петрівни"
|
||||
course = 2
|
||||
semester = 4
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -0,0 +1,54 @@
|
||||
#import "@unexplrd/test-multifile:0.1.0": *
|
||||
// #import "/lib/lib.typ": *
|
||||
#import "utils.typ": *
|
||||
|
||||
#import style: spacing
|
||||
|
||||
// #show: correctly-indent-list-and-enum-items
|
||||
|
||||
// #show: style.dstu
|
||||
#show: pz-lb.with(
|
||||
..toml("doc.toml"),
|
||||
title: lorem(2),
|
||||
)
|
||||
|
||||
== #lorem(3)
|
||||
#v(-spacing)
|
||||
=== #lorem(5)
|
||||
|
||||
#lorem(20)
|
||||
|
||||
+ #lorem(10)
|
||||
+ #lorem(10)
|
||||
+ #lorem(10)
|
||||
+ #lorem(10)
|
||||
$ 1/2 dot 3 = 3/2 $
|
||||
+ #lorem(10)
|
||||
$ 1/2 dot 3 = 3/2 $
|
||||
+ #lorem(10)
|
||||
+ #lorem(10)
|
||||
+ #lorem(10)
|
||||
|
||||
#lorem(20)
|
||||
|
||||
// #img("/figures/Google-Logo-700x394.png", [Корпорація зла], width: 60%)
|
||||
|
||||
|
||||
#lorem(50)
|
||||
|
||||
#figure(caption: "Приклад коду на C", code(read("assets/sample.c")))
|
||||
|
||||
#lorem(20)
|
||||
|
||||
#figure(
|
||||
caption: [Цифри],
|
||||
table(
|
||||
columns: 4,
|
||||
table.header([Один], [Два], [Три], [Чотири]),
|
||||
..csv("assets/table.csv").flatten(),
|
||||
),
|
||||
)
|
||||
|
||||
#lorem(20)
|
||||
|
||||
#style.appendices(include "chapters/appendices.typ")
|
||||
@@ -0,0 +1,109 @@
|
||||
/// takes in a string of code, e.g. #code(read("foo.c"))
|
||||
#let code(content) = raw(block: true, theme: none, content)
|
||||
|
||||
/// read file as bytes
|
||||
#let p(path) = bytes(read(path, encoding: none))
|
||||
|
||||
/// include chapters by file names from /chapters
|
||||
#let chapters(ch) = (
|
||||
array(ch).map(chapter => include str(chapter) + ".typ").join()
|
||||
)
|
||||
|
||||
#let pz-header(worknumber, name) = columns[#text(weight: "bold", [
|
||||
#align(left)[Практичне заняття №#worknumber]
|
||||
#colbreak()
|
||||
#align(right)[#name]
|
||||
])]
|
||||
|
||||
/// https://forum.typst.app/t/how-to-make-bullet-list-item-bodies-flow-like-paragraphs/3756/3?u=andrew
|
||||
/// Spacing doesn't work the same way as native solution if par leading and
|
||||
/// spacing are different.
|
||||
#let correctly-indent-list-and-enum-items(doc) = {
|
||||
let first-line-indent() = if type(par.first-line-indent) == dictionary {
|
||||
par.first-line-indent.amount
|
||||
} else {
|
||||
par.first-line-indent
|
||||
}
|
||||
|
||||
show list: li => {
|
||||
for (i, it) in li.children.enumerate() {
|
||||
let nesting = state("list-nesting", 0)
|
||||
let indent = context h((nesting.get() + 1) * li.indent)
|
||||
let get-nesting() = calc.div-euclid(nesting.get(), 10)
|
||||
let marker = context {
|
||||
let n = get-nesting()
|
||||
if type(li.marker) == array {
|
||||
li.marker.at(calc.rem-euclid(n, li.marker.len()))
|
||||
} else if type(li.marker) == content {
|
||||
li.marker
|
||||
} else {
|
||||
li.marker(n)
|
||||
}
|
||||
}
|
||||
let parents = state("enum-parents", ()) // Support enum nesting.
|
||||
let body = {
|
||||
parents.update(arr => arr + (-1,))
|
||||
nesting.update(x => x + 10)
|
||||
it.body + parbreak()
|
||||
nesting.update(x => x - 10)
|
||||
parents.update(arr => arr.slice(0, -1))
|
||||
}
|
||||
let content = {
|
||||
marker
|
||||
h(li.body-indent)
|
||||
body
|
||||
}
|
||||
context pad(left: int(nesting.get() != 0) * li.indent, content)
|
||||
}
|
||||
}
|
||||
|
||||
show enum: en => {
|
||||
let start = if en.start == auto {
|
||||
if en.children.first().has("number") {
|
||||
if en.reversed { en.children.first().number } else { 1 }
|
||||
} else {
|
||||
if en.reversed { en.children.len() } else { 1 }
|
||||
}
|
||||
} else {
|
||||
en.start
|
||||
}
|
||||
let number = start
|
||||
for (i, it) in en.children.enumerate() {
|
||||
number = if it.number != auto { it.number } else { number }
|
||||
if en.reversed { number = start - i }
|
||||
let parents = state("enum-parents", ())
|
||||
let get-parents() = parents.get().filter(x => x >= 0)
|
||||
let indent = context h((get-parents().len() + 1) * en.indent)
|
||||
let num = if en.full {
|
||||
context numbering(en.numbering, ..get-parents(), number)
|
||||
} else {
|
||||
numbering(en.numbering, number)
|
||||
}
|
||||
let max-num = if en.full {
|
||||
context numbering(en.numbering, ..get-parents(), en.children.len())
|
||||
} else {
|
||||
numbering(en.numbering, en.children.len())
|
||||
}
|
||||
num = context box(
|
||||
width: measure(max-num).width,
|
||||
align(right, text(overhang: false, num)),
|
||||
)
|
||||
let list-nesting = state("list-nesting", 0) // Support list nesting.
|
||||
let body = {
|
||||
parents.update(arr => arr + (number,))
|
||||
list-nesting.update(x => x + 1)
|
||||
it.body + parbreak()
|
||||
list-nesting.update(x => x - 1)
|
||||
parents.update(arr => arr.slice(0, -1))
|
||||
}
|
||||
if not en.reversed { number += 1 }
|
||||
let content = {
|
||||
num
|
||||
h(en.body-indent)
|
||||
body
|
||||
}
|
||||
context pad(left: int(parents.get().len() != 0) * en.indent, content)
|
||||
}
|
||||
}
|
||||
doc
|
||||
}
|
||||
Reference in New Issue
Block a user