repo
stringlengths
26
115
file
stringlengths
54
212
language
stringclasses
2 values
license
stringclasses
16 values
content
stringlengths
19
1.07M
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/034%20-%20Dominaria/012_Return%20to%20Dominaria%3A%20Episode%2012.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Return to Dominaria: Episode 12", set_name: "Dominaria", story_date: datetime(day: 30, month: 05, year: 2018), author: "<NAME>", doc ) "And everything was going so well, too," Liliana said with a grimace. Thunder rumbled in the distance and she cast another spell at Yargle, then gripped the railing as the #emph[Weatherlight] jerked sideways. The purple bolts slid across Yargle's slimy skin with no effect. Shanna and Arvad hacked at the giant fingers gripping the ship's bow, but they couldn't break Yargle's grip. The massive creature made a rasping noise in its throat and spat onto the deck. The corrosive stench of acid filled the air and Liliana choked as the fumes reached her. "Oh good, it's worse." Raff clung to the railing on the opposite side of the ship and blue light flashed as he flung a counterspell. The acid cloud roiled against it and turned liquid, flowing across the deck. Raff gasped, "Oh, that's new! Jhoira!" Liliana gritted her teeth with the effort of holding on to the undead army she had raised out of the swamp. It was taking all the power she could muster, and she wasn't strong enough to hold it and attack Yargle at the same time. Most of the dead were panther warriors, just different enough from humans to make them slippery and difficult to control. She found herself having to cajole them rather than just give orders, and under the current circumstances it was more than frustrating. Jaya slid sideways across the deck and dropped to her knees to aim a stream of fire. It burned off the remaining acid cloud but Yargle jerked the ship sideways again and nearly knocked Shanna and Arvad off the bow. Liliana smashed against the railing and clawed at it to hold on. Jaya swore and blasted Yargle again. Jhoira bolted out of the hatch under the ship's bridge. She reached the center of the deck and tossed something into the air. It was her mechanical owl and it gripped something like a metallic grapefruit in its claws. Yargle roared and the #emph[Weatherlight] lurched again and swung sideways, the deck at an acute angle. Liliana gasped as the jolt almost threw her over the rail. Shanna and Arvad tumbled toward the side but Raff, still gripping the other railing, cast a blue-tinged light that turned into a glowing rope. Arvad caught it with one hand and grabbed Shanna's arm with the other. She planted her boots against the railing to brace them. As Jhoira tumbled across the deck, Liliana made a wild grab and caught her jacket just as Jhoira hit the rail. Jhoira gripped Liliana's wrist. They hung there for a breathless instant before the ship tipped the other way. As they swung back, Liliana managed to wedge herself between the deck and the rail, gripping Jhoira's arm to keep her from falling. "Thanks," Jhoira said breathlessly. "Don't mention it," Liliana said. She could feel her panther warriors attacking Yargle, slashing and tearing at its feet, but it didn't seem to be helping. The angle of the #emph[Weatherlight] 's deck was so steep Shanna and Arvad couldn't move, and Raff was stuck holding the support spell that kept them from falling off the ship. Jaya's fire blasts kept the acid at bay but couldn't penetrate Yargle's thick hide. Liliana couldn't let go of the rail or Jhoira, and Jhoira couldn't let go of Liliana. Up on the bridge, Liliana saw Tiana at the wheel, struggling to free the ship from Yargle's grip. The engines strained so hard the deck vibrated like it might burst apart. Liliana added grimly, "I rather hope you have a plan." "I do, actually," Jhoira said, her voice rough with the effort of holding on. "My owl has one of the mana-charged burners I constructed to use against the Stronghold." "Oh, good," Liliana managed. Her arms were going numb. "And is this going to happen soon, because—" "Everyone, brace yourselves!" Jhoira shouted. Liliana ordered her undead to break off, just before a blue light flashed and Yargle's enraged shriek deafened her. The #emph[Weatherlight] shook like a child's toy, rattling her teeth. Her eyes were dazzled and she blinked hard, unable to make anything out. Then her vision cleared. #figure(image("012_Return to Dominaria: Episode 12/01.jpg", width: 100%), caption: [Yargle, Glutton of Urborg | Art by <NAME>], supplement: none, numbering: none) Yargle still gripped the bow, and now its gigantic maw was opening. Jhoira swore bitterly and added, "I should have used all the burners." Exasperated, Liliana snarled, "This is a ridiculous way to die!" #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Gideon hit the ground and rolled, then came to his feet. The pit was a nightmare of fighting, screaming figures, slashing blades, and flailing clubs and chains. Above him, Chandra shouted a warning. Gideon leapt aside just as a Cabal grimnant hit the ground. Chandra must have shoved him into the pit, but Gideon couldn't see her from this angle. He lunged forward, kicked the man in the head, and took his sword. That was all he had time for as he was rushed by a swarm of desperate fighters. Some dragged at the grimmant's body to get his remaining weapons and armor. Others charged at Gideon. Wary his eternal aegis shield spell would give him away, he blocked wild sword thrusts and dodged a blow from a broken mace. He shouted, "Why are you fighting for the Cabal's amusement? Just stop!" #figure(image("012_Return to Dominaria: Episode 12/02.jpg", width: 100%), caption: [Gideon's Reproach | Art by Izzy], supplement: none, numbering: none) That was when he realized everyone attacking him was wild-eyed with dementia magic. They had no idea where they were—they were trapped in their own nightmares. One flung himself forward like a berserker and Gideon stabbed him through the chest. As he freed his sword and backed away, the others leapt on the fallen man to tear at his weapons and armor. Gideon dodged away from the wall and headed farther into the pit. He couldn't get out on this side and there was no point in trying to stay near Chandra if it ended with them both dead. Another group charged him and, left with no choice, he cut his way through, then looked around, desperate to find someone in their right mind. Toward the center of the pit he saw a small group fighting back to back, defending each other from the prisoners maddened by dementia magic. Relieved, Gideon fought his way toward them. The leader was a tall, muscular warrior with dark hair and blue-gray skin, dressed in battered leather armor. Gideon cut his way through the wailing cultists attacking the group and asked, "May I join you?" "Since you ask so politely." She jerked her head, telling him to join the circle on her right. As he moved to her side she said, "I don't recognize you, are you new?" "I just arrived." Gideon swung his sword to knock aside a spear cast at the man on his far right. "You were all captured together?" She drove back another attacker with a flurry of sword strokes. "No, my companions were killed. We all met in the cells." #figure(image("012_Return to Dominaria: Episode 12/03.jpg", width: 100%), caption: [Run Amok | Art by <NAME>], supplement: none, numbering: none) If there were others trapped in the Stronghold who weren't infected with dementia magic, then they could free them. If the #emph[Weatherlight] ever arrived. "I'm Gideon." She thrust her sword through the chest of a black-robed cultist and said, "I'm Radha." #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Slimefoot crawled out of the #emph[Weatherlight] 's hatch, its usual method of locomotion now coming in handy with the deck angled so sharply. The light was dim, the sky obscured by dark storm clouds and the volcano's haze of smoke, framing the terrifying creature holding the ship's bow. Slimefoot headed toward the rail, which was now only twenty feet above the treetops. It used all its stalks to hold on and leaned over. Amid the swamp grass and ponds below, it saw the undead panther warriors as they hacked at Yargle's feet. But they weren't the only spirits here. Liches and other spiritfolk had been drawn by the battle and gathered in the trees below. Like the others Slimefoot had met, they were all shapes and sizes, from small bulbous lumps to tall gangly creatures. Slimefoot called, #emph[Please help us!] They all looked up. #emph[Who are you to ask for help?] they said. #emph[I am Slimefoot, friend to Yxarit] . Slimefoot hoped Yxarit hadn't been lying or tricking it. The #emph[Weatherlight] shuddered underfoot and Slimefoot knew they didn't have much time before the engines burst from the effort to escape. #emph[We go to attack the Cabal and kill the demon] . #emph[Kill the demon] , the spirit voices echoed. #emph[We can't help you] , another spirit said, and Slimefoot's insides sank. #emph[But we will call something that can] . #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Jhoira gripped Liliana's wrist and the rail as the ship wrenched around again. Everything she had that could blast Yargle's hands off the ship might take out the whole bow. And Shanna and Arvad were trapped up there. The #emph[Weatherlight] groaned in protest, and she knew she might not have a choice. She'd just drawn a breath to shout to the others to try to get off the bow when Liliana demanded, "What is that thing doing?" "Which thing, the one trying to eat the ship?" Jhoira said, baffled at the question. Liliana jerked her head. "No, that thallid." Jhoira turned to look. "The thallid?" It was at the stern near the bridge, leaning far out over the rail. #emph[It's talking to someone, something] , Jhoira thought, startled. Then Liliana said, "Something else is coming~It's not dead, either, but it's not alive~" A wind swept the deck and drove away Yargle's heavy stench with the strong scent of green plants, wet earth, and flowers. Jhoira knew it instantly. "That can't be Multani, not here!" The wind carried the scent of Yavimaya, but there was something wrong with it, a tinge of corruption and sourness. "The Yavimaya fragment," Liliana said, almost under her breath. "Could it be an elemental like Multani but—" A shape rose up behind Yargle. It was larger, suffused with green light and wrapped in the remnants of rotting vines and wood and woven through with fragmented corpses and mud. Huge horns topped its head and its open maw was a rage-filled rictus. Jhoira grimaced with dismay. It made Multani's enraged unconscious manifestation look no more than vaguely annoyed. "—but much angrier," Liliana finished. With one arm still looped around the rail, she lifted her hand. "But while it's distracted, I can send the panther army at it—" "Wait!" Jhoira said. The elemental wrapped its arms around Yargle. Yargle, apparently finally realizing that something was attacking it, twisted its head around to clamp its massive jaw on the elemental's torso. The #emph[Weatherlight] slewed sideways in Yargle's grip and Jhoira slammed into the railing again. Jaya slid across the deck on her back and shouted, "It's Muldrotha, a corrupted elemental!" #figure(image("012_Return to Dominaria: Episode 12/04.jpg", width: 100%), caption: [Muldrotha, the Gravetide | Art by Jason Rainville], supplement: none, numbering: none) Muldrotha extruded a limb made of rotting wood and corpses into Yargle's clamped jaw and pried it open. With a strangled gasp of acid, Yargle released the #emph[Weatherlight] . As the #emph[Weatherlight] wobbled free, Jhoira shouted, "Tiana, get us out of here!" The deck shoved upward underfoot and the engines thrummed. The ship lifted away. Liliana slid down the rail to the deck and Jhoira staggered forward to see the battle. Yargle tried to grip Muldrotha but its claws slid harmlessly through the mosaic of vegetation and earth and rot. Muldrotha pried at Yargle's jaws with its hands, and its weight bore the creature down into the muddy swamp. The thallid stumped over to Jhoira's side. She looked at it, her brow quirking in amazement. "What did you do?" It waved at her. #figure(image("012_Return to Dominaria: Episode 12/05.jpg", width: 100%), caption: [Slimefoot, the Stowaway | Art by <NAME>], supplement: none, numbering: none) Raff dragged himself up on the rail. "I'd feel sorry for Yargle, if it hadn't tried to eat our ship," he gasped. "I don't feel sorry at all," Jhoira said. She was certain she was watching Yargle get exactly what was coming to it. Shanna and Arvad stumbled down from the bow deck and reached the railing. "Are you all right?" Jhoira asked. Acid had melted Arvad's armor off his right arm and side, but the reddened skin beneath was rapidly healing. Shanna had lost her shield and some of her braids, but looked unhurt. She glanced at Arvad, got a confirming nod, and said, "We've been better, but we'll do." Jhoira turned to where Jaya and Liliana had clambered to their feet. "Liliana, you still have the army?" "Of course." Liliana tossed her head, stumbled, and recovered her balance. "Let's go kill a demon, shall we?" Jhoira agreed. It was time to end this. "To the Stronghold." #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Chandra managed to trip some brawling cultists into the pit to distract Gideon's attackers, and in the confusion no one noticed. Cultists were knocking each other into the pit anyway, howling with joy as they fell. This was all much worse than Chandra had imagined. #emph[Where is the ] Weatherlight#emph[? Why are they taking so long?] she wondered desperately. As Gideon broke free and moved across the pit, she ran along the edge, ducking around groups of chanting grimnants. She could feel Belzenlok's terrifying presence at the far end of the arena, like his gaze was burning her skin. If he noticed her and Gideon, they would be torn apart. Chandra could only burn so many cultists before they overwhelmed her. Someone grabbed her arm and shoved her toward the edge, and she twisted out of his grip and kicked him in the hip. He flailed backward and fell into the pit. All the cultists around her cheered. Chandra bolted past them. She found another vantage point, an almost empty section near the stairs leading up to the arena, shielded from Belzenlok's view by a curved riblike pillar. She spotted Gideon where he had joined a group near the center of the pit who were cooperating, defending each other. The tight fear in her chest eased a little. Then a deep bell-like tone sounded, loud enough to make Chandra stagger and cover her ears. She wasn't the only one. Everyone froze, staring, suddenly dead silent. The only sound was from the pit, where the combatants still frenzied from dementia magic barely seemed to notice the interruption. Then Belzenlok stood. His voice roared, "Defend the Stronghold!" Then he turned and shoved past the throne, vanishing into the shadows at the back of the arena. Chandra gasped in relief. #emph[Finally!] All around her the chanting crowd dissolved as the grimnants and clerics streamed for the doors. As the crowd cleared, Chandra looked for a way to get Gideon out of the pit. She spotted something back toward the end of the arena where they had first entered, some kind of apparatus with gears and chains and folded wooden stairs, tucked up just below the ledge. She caught Gideon's gaze and pointed emphatically at it. He jerked his head in acknowledgement and Chandra ran back around the arena. As she reached the mechanism, she saw the chained lever that released the stairs. But there were still too many cultists in the arena to just trip it without getting caught. And a large group of armed grimnants and a few robed clerics still clustered around the main doors. They seemed to be waiting for the cleric Whisper. She had stepped back up onto the blocks overlooking the pit. As Chandra waited impatiently, Whisper spread her arms and started to speak. A black mist formed in front of her and drifted down into the pit. Chandra gasped in realization just as the mist touched the first of the dementia-maddened fighters below and they collapsed, choking and gasping. Whisper was going to kill the rest of the prisoners in the pit. Chandra sent the first blast of fire out of pure reflex, but after Jaya's help, it was an accurate reflex. Whisper must have felt or sensed the heat; she twisted sideways just before the impact. The blast struck the grimnant behind her, dissolving him in flame. Whisper shouted in rage and pointed at Chandra. The grimnants charged, and the black orbs of death spells shot toward her. Chandra didn't need to brace herself or draw in a breath. She shot a dozen fireballs in different directions, aimed toward the clerics and the grimnants who moved toward her. Then she threw herself out of the path of the death spells, hit the ground and rolled to her knees, and shot another barrage of fire toward Whisper. The cultists she set on fire ran, rammed into each other, fell over the side of the pit. Whisper leapt down from the block to duck behind the grimnants. Chandra raked the whole group with fire. It immolated most of them and sent the survivors fleeing for the doorways. Chandra shoved to her feet and fought the urge to just blast the whole arena; she knew she needed to conserve her strength if they were going to get through this alive. But all that effort keeping multiple fireballs afloat and contained while having emotional conversations with Jaya had come in handy. #figure(image("012_Return to Dominaria: Episode 12/06.jpg", width: 100%), caption: [Exquisite Firecraft | Art by Chase Stone], supplement: none, numbering: none) Chandra ran back to the stair mechanism, burned through the chain lock, and threw the lever. The stairs unfolded down the side of the pit with a wheezing clank. The grimnants nearby were either charred heaps, on fire, or gone, and she couldn't see any others in the dimness of the arena's upper reaches. Down in the pit knots of prisoners still fought, surrounded by the bodies of the fallen. She couldn't see Gideon or the other fighters with him and stepped to the edge of the pit to look down the stairs. The group was climbing up, Gideon nearly at the top. Chandra stepped back, relieved, and turned just as Whisper appeared out of nowhere and cast a black cloud. Chandra blasted it with a thin, targeted, but intense burst of fire, the only thing she could think of. It wouldn't have worked to counter the death spell, but Gideon slung himself onto the platform and cast his shield spell. Its golden light dazzled Chandra's eyes as it deflected Whisper's magic. Then suddenly a blade blossomed in Whisper's right eye. She staggered back and collapsed. "Huh?" Chandra stared at Gideon, then saw the gray-skinned woman behind him. She hung onto the edge of the pit with one hand and had thrown the knife with the other. "Oh, thanks!" The woman slung herself up. "It doesn't bode well that it took three of us to take out a cleric." "I'm sure we'll get better with practice," Gideon said. "Chandra, this is Radha." "Hello," Chandra said. She told Gideon, "I don't know what delayed the #emph[Weatherlight] , but they're here now. We need to get moving!" "The #emph[Weatherlight] ?" Radha turned to Chandra in astonishment. "It was destroyed." "Jhoira brought it back," Chandra replied before Gideon could draw breath. "Teferi and Karn are here too, do you know them? Do you want to help us?" More fighters climbed out of the pit. "Radha, you'll lead us out?" one asked. #figure(image("012_Return to Dominaria: Episode 12/07.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) Radha hesitated, then turned to Gideon and Chandra. "You have an escape route planned?" "We have something we need to get first," Gideon said. "Our friends are attacking the Stronghold—you should be able to get out in the confusion." Radha's dark brows lifted. "Will this something rain destruction on the Cabal?" "Probably," Chandra said. She sure hoped so. "That's the plan." "Then I'll come with you." Radha turned to the others. "Go on, we'll meet outside." The other fighters saluted her and headed for the door. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) "Now?" Liliana asked Jhoira. The #emph[Weatherlight] was just about to crest the last hill. The dark tower of the volcano loomed ahead, stark against the ash-filled sky and the lowering clouds. "Now," Jhoira said, and Liliana told her undead army, #emph[Destroy the Cabal, my lovelies. Take your revenge] . As the #emph[Weatherlight] sailed over the hill, thunder cracked and the sky split with lightning. Liliana saw the Stronghold, protected by multiple curtain walls and moats, each gate guarded by traps and dark magic. The desire for revenge made her heart pound. #emph[Soon] , she told herself. She urged her undead warriors on, but their own lust for vengeance was so intense they needed no encouragement as they surged through the brush and trees and streamed down toward the first wall. "There's <NAME>!" Shanna called out from the starboard side. Arvad went to the rail and flung the ladder over. "Don't we need to slow down?" Raff asked. "Oh right, I forgot, time mage," he added, as <NAME> Karn appeared on the deck in a blur of motion. Fitful rain slicked the deck as the #emph[Weatherlight] reached the outer wall. A hail of arrows and crossbow bolts struck the hull. Dark orbs of death magic flew over the railing but dissolved into sizzling gold sparks as Shanna blocked them with her body and her sword. Jhoira's hands moved as she cast counterspells and deflected the arrows away from the deck. Raff murmured something and Liliana glanced back to see two more #emph[Weatherlight] s sail over the hills to draw the Cabal's fire. "Not bad," Liliana commented, most of her attention still on her undead warriors. Teferi stepped up beside Liliana, his robes tossed by the wind, and leaned out over the bow. "I'll take the first gate, shall I?" he asked. "Go ahead," Jhoira said, grinning. Her owl shot past overhead, carrying another mana-burner. Teferi held out his hand and the gate across the causeway turned red with corrosion, then dissolved in a puff of rust. Liliana's undead panther warriors flowed through the opening like water to tear through the armored grimnants. On the next wall, Jhoira's owl dropped its first mana-burner and the gate exploded. The fragments of stone and metal froze in midair, then swirled into a tempest that slammed through the nearby grimnants and cultists. Jhoira held up another mana-burner and her owl swooped back around to grab it. Fiercely pleased with the destruction so far, Liliana said aloud, "This is going well." Belzenlok would be writhing in a horrible death in no time and she couldn't wait to see it. From the bow deck, Shanna shouted, "Something's coming! From the volcano, there!" Liliana swore in annoyance. "Oh, I wish I hadn't said that." She turned to look. A dark shape rose out of the light-colored smoke streaming from the volcano's cauldron. At first all she could see was the wings of a flying creature far too much like a dragon for comfort. Its head was shaped like a double-headed ax blade, and as it twisted in midair she saw the clawed limbs and the tail. Then she spotted the armored figure riding it. It caught the draft off the hot air above the volcano and soared upward toward the storm clouds. Raff said, "Uh, I wish you hadn't said it, too. I have a bad feeling about this." He raised his voice. "I think that's Urgoros!" #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Gideon led the way out of the arena through the nearest archway. The shadowy corridor was empty now and he started to run, Chandra and Radha easily keeping pace. A distant roar punctuated by explosions suggested the battle outside was well under way. "You do know where this treasury is?" Radha asked, looking back down the corridor. The dancing torchlight made the place alive with shadows. "The Cabal is constantly rebuilding their defenses." "It should be down here." Gideon spotted the opening just beyond the next archway. From the flickering light of the nearest torch, it was a tunnel of Phyrexian construction, a curving gullet that led down into darkness. "Probably." Raff had extracted the information at Tolaria West from the Cabal agent's fractured thoughts, and they just had to hope he had interpreted it correctly. #figure(image("012_Return to Dominaria: Episode 12/08.jpg", width: 100%), caption: [Memorial to Genius | Art by <NAME>], supplement: none, numbering: none) The corridor curved around and finally opened into a large, mostly unlit chamber with more of the curving riblike supports. There were half a dozen sets of doors in the walls, all sealed with heavy chains. A miasma of dark spells floated in front of each one like a gray veil. Gideon stopped and felt that sinking sensation that usually accompanied the moments when he realized his plan had just encountered a possibly catastrophic obstacle. "Which door?" Radha asked, her brow furrowed as she looked around. "That's a good question," Gideon said. "Our informant knew the weapon we need is in this treasury, in this part of the Stronghold, but that was all." Radha's expression was doubtful. "It's going to take us time to get through these doors. If the attack outside fails while we're searching—" Gideon flinched as fire roared. He and Radha spun around to see Chandra blast the first door. Her fire washed over it, white-hot, and burned away chains, the sigils powering the guard spells, and the door itself. She stopped and flexed her gloved hands. The fire vanished to reveal an open hole in the wall where the door had been. Chandra stepped over to face the next door. "Or we could do that," Gideon said, relieved. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Liliana grimaced as she watched Urgoros and its mount circle down toward the #emph[Weatherlight] , rain glinting on its dark wings. "And what exactly is an Urgoros, Raff?" Teferi asked conversationally. A barrage of arrows came at them from a gate tower and he gestured absently to freeze them in midair. "I don't know, but the Cabal agent we questioned was really afraid of it!" Raff said. He pulled his book around and paged frantically through it. Karn stepped forward, his metal head turning as he tracked Urgoros's progress through the rain and ash-clouds. He said, "It's a powerful lich. But like the spirits created from the purest dark magic, it's never been human." As Urgoros turned to dive on them, Liliana saw the armored warrior's head was also a double-sickle shape, confirmation that it wasn't human. She had a bad feeling about this. "Liliana, can you stop it?" Jhoira shouted. Her owl had just left with another mana-burner. The path to the Stronghold's doors was almost clear as the undead panthers poured through the destroyed gates. #emph[No one wants a necromancer around until they're being attacked by something giant and undead] , Liliana thought wryly. "I'll try, but somebody should be thinking of another means of attack. Belzenlok knows I'm here, he wouldn't have sent this thing against us if I could take control of it." She gripped the railing to steady herself and stretched her awareness toward that dark figure. And felt nothing. Urgoros was a hungry emptiness, growing closer, and there was nothing in it for her to seize hold of, or even speak to. There had to be something she could do. She instinctively touched the Chain Veil, but though the Onakke whispered, she knew she wasn't strong enough to use it again yet. Not without endangering herself and everyone on the #emph[Weatherlight] . She snarled under her breath. She hated being helpless. "Jhoira, I can't stop it!" Jhoira stepped forward, her hands cupped around a blue swirl of light. Teferi moved to her side, staff extended, waiting. Shanna and Karn stepped up beside Raff and Jaya. Urgoros and its beast slammed into the deck through a haze of blue spell light as Jhoira, Teferi, and Raff cast a barrage of attacks and defenses. Liliana dove out of the way as Urgoros deflected it all with magic so dark it was like the heart of a dying star. Shanna walked forward and her resistance to magic deflected Urgoros's spells in flares of gold light. Karn crouched behind her, using Shanna's immunity to get close enough to attack. Liliana cast her own spell, hoping all the distraction would let her kill Urgoros before it could shield itself. #figure(image("012_Return to Dominaria: Episode 12/09.jpg", width: 100%), caption: [Urgoros, the Empty One | Art by Daarken], supplement: none, numbering: none) The purple light struck Urgoros but washed over it, lighting up the joints in its armor. #emph[Oh, that didn't work] , Liliana had time to think before the beast's tail slammed her sideways. Liliana hit the opposite railing and sprawled, too stunned to move. She looked up to see the others scattered and Urgoros's spear lifted and about to drive down through her body. Tiana suddenly landed in front of her. Her sword flashed and deflected the spear, and the dark weapon careened over the rail. Jaya blasted Urgoros from the side and the wash of fire drove it back and away from them. Karn jumped on its back and grabbed its head. Tiana leapt after the snarling beast, Arvad following her. Liliana pushed herself up, dazed. Who was flying the ship? She looked back toward the bridge and saw the green shape of the thallid gripping the ship's wheel. #emph[Oh, that's all we need] , she thought. Jhoira turned to her urgently. "This is a distraction, Belzenlok is trying to keep us out of the Stronghold." Liliana swore. "You're right." She hated that she hadn't thought of it first. "I need to keep the panther warriors on the attack. And I need to get down there!" Gideon and Chandra might be fighting Belzenlok right now and Liliana needed to be there. She needed to see the Blackblade rip Belzenlok's life force out of his body. Jhoira jerked her head toward the ladders. "Go on. We can handle Urgoros." Liliana strode to the railing but the mechanism that dropped the ladders had been sheared off the deck by the battle with Urgoros. She grimaced in annoyance, but this wasn't going to stop her. She leaned over the railing and sent her awareness to her undead warriors. Many still fought the Cabal grimnants all along the causeway, in the water, in the guard towers. She focused in on the group just below the #emph[Weatherlight] , gathered to watch a strange procession of the spirit creatures flowing in through the broken gates. The spirits were all strange shapes and sizes, from round and bulbous to thin and insubstantial as willows. Liliana sent to her undead panther warriors, #emph[I need to get down to the ground. You have a solution, my lovelies?] They replied,#emph[ We have allies.] Some spirits turned aside and climbed, ran, floated, or bounced into place below the #emph[Weatherlight] , then piled on top of each other and clung together. They kept coming, the tower of spirit bodies rising higher and higher. As they reached the hull of the #emph[Weatherlight] , Liliana swung herself up over the rail and dropped down to land on top. A three-fingered hand reached up to grip hers, and a strange array of faces peered up at her, all with a seemingly random number of eyes and features. "Well, this is interesting," Liliana breathed, as they began to lower her to the ground. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Gideon ran across the shadowy chaos of the Stronghold's hall with Chandra and Radha. Undead panther warriors and odd-shaped spirits had swarmed in through the main doors. Pockets of cultists and clerics still fought, but their dementia magic had no effect on the dead. The panther warriors surrounded and overwhelmed the cultists, protecting the more vulnerable spirits as they tore the hall apart. "We're winning!" Chandra shouted. "Stay focused," Gideon told her. He carried the Blackblade, still in its scabbard. They had found the weapon inside the fourth treasury vault, mounted on a stone plinth like a trophy. He could feel the dark power of it burning through the leather into his hand, and he didn't want to use it on anyone except Belzenlok. #figure(image("012_Return to Dominaria: Episode 12/10.jpg", width: 100%), caption: [Blackblade Reforged | Art by <NAME>], supplement: none, numbering: none) They reached the outer foyer of the hall. A cleric stood in the open doors, holding a circle of panther warriors back with a dark haze of spells. She saw them, snarled, and cast something that took the form of a net expanding in the air. Gideon turned instinctively to use his shield spell, but Chandra shot a bolt of fire that neatly missed the undead warriors and struck the cleric square in the chest. The cleric staggered back and the panthers overwhelmed her, her spell dissolving in midair. Before Gideon could circle around them, a wave of spirits crashed through the doors and scattered the panther warriors and the few remaining cultists blocking the way. Gideon braced himself, and Radha planted her shield and pulled Chandra behind her. The spirits flowed past them, but a familiar bulbous creature stopped in front of Gideon and pointed urgently outside. "Belzenlok!" it said. #emph[Good] , Gideon thought. He told it, "We need to get out there." The spirit turned and gestured agitatedly. The other spirits scrambled out of the way to make a path. Gideon plunged through and ran out into the open area in front of the Stronghold. Outside it was chaos. The sky boiled with dark gray clouds and the paving was slick with rain. The #emph[Weatherlight] hung just above the innermost wall, spell-lights and blasts of fire erupting off the deck, though Gideon couldn't make out who or what they were fighting. The gates had been blasted open, the Cabal structures on this side of the wall were on fire, and dead cultists, pieces of panther warriors, and the bodies of spirits lay scattered across the ground. Then he saw Belzenlok. At the far end of the compound, the demon strode through a mass of spirits and the undead, a sword in his hand, his reptilian wings spread. He swung the sword in an arc that sent bodies flying out of his path. Gideon took a deep breath and drew the Blackblade. He hated to use such a dark weapon, but there was no choice. Shouts and battle cries behind him made him turn. A new surge of grimnants poured out of the Stronghold. Chandra flung fireballs to hold them off while Radha shouted orders, urging the spirits into a defensive formation. Chandra glanced back at Gideon and said, "Go on! We'll guard your back!" Gideon hesitated, but he knew the grimnants would break when he killed Belzenlok. He turned and started toward the demon. Belzenlok swung around at Gideon's approach, then tilted his horned head in recognition at the sight of the Blackblade. "That sword is mine! I forged it to kill an elder dragon." Belzenlok sneered, his teeth sharp against his pale lips. "You think you can wield my own sword against me? Your death will be excruciating." #figure(image("012_Return to Dominaria: Episode 12/11.jpg", width: 100%), caption: [Demonlord Belzenlok | Art by <NAME>], supplement: none, numbering: none) "Out of curiosity, do you actually believe these lies you spout to your deluded cultists?" Gideon said and circled to the side. Belzenlok pivoted to follow him. The Blackblade made Gideon's hands ache, as if the dark power was weakening his bones. He knew he only had to get close enough to pierce Belzenlok's flesh with the sword. But the demon was taller and bulkier than him, with a longer reach. Belzenlok was furious. "Lies? I will disembowel you as you scream—" Gideon heard Chandra's fire roar, holding off the grimnants at the Stronghold's doors, and knew he couldn't wait for a better opportunity. He charged, ducked in close, and thrust. The Blackblade came within a breath of Belzenlok's hide but the demon smashed him aside and swung his sword down. The blade glittered with dark magic and Gideon's shield spell glinted gold as it deflected the spells. Gideon and Belzenlok circled each other. Suddenly sounding like a cunning demon and not a deluded megalomaniac, Belzenlok said, "I smell Planeswalker. Who are you?" Gideon didn't hesitate. "I'm <NAME>. I came here with <NAME> to kill you." Belzenlok bared his fangs again in a grin. "You. The Gatewatch. I know what's planned for you. It almost seems a shame to kill you now. Almost." Belzenlok lunged forward. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Liliana ran down the causeway and through the smashed gates into the Stronghold's court. A grimnant charged at her and she gestured a spell that slammed him into the wet pavement. She saw Chandra first, obvious from the bursts of fire and the smoldering bodies. She and another warrior blocked the Stronghold's door, fighting the grimnants back with the help of a collection of spirits. At the far end of the court, surrounded by wood and stone debris and the shredded remnants of the red Cabal banners, Gideon fought Belzenlok. He wielded the Blackblade, the darkness in it teasing the edge of Liliana's senses. She started forward. All she had to do was distract the demon so Gideon could strike him. The Blackblade should do the rest. She smiled and whispered, "Belzenlok." The demon's horned head twitched toward her. Liliana drew power from the dead sprawled everywhere and cast it like an arrow at Belzenlok. The purple bolts struck the demon's head and chest but the light flowed harmlessly over his pale skin. He laughed and deflected Gideon's next stroke. "You're weak, Liliana, and you always have been. Who but a weak-willed fool would sign a pact with me?" Liliana set her jaw. Most of her strength was spent keeping the undead panther warriors from collapsing back into inert corpses. If she let them go—no, it was too dangerous. There were still too many grimnants, too many horrors like Urgoros in the Stronghold. And even if she let the panther warriors sink back to death, she still wouldn't have the power to kill Belzenlok alone, not without the Chain Veil. She had to stick with the plan and distract him. She strode closer, tempting the demon to break off from Gideon and attack her. "The others who signed that pact are dead at my hand. You're about to join them." She knew she shouldn't betray her real feelings, but she couldn't help adding, "You should have left my brother alone." Belzenlok laughed as he blocked another sword thrust. "Everything in Dominaria is mine, the corpse of your brother, your home, you. And I use it as I want." #emph[His ego is so enormous he probably believes that] , Liliana thought. "You're a buffoon and a liar, and all of Dominaria knows it," she jeered. Belzenlok swung at Gideon and narrowly missed him. "You'll beg to serve me before I'm done, and perhaps I'll let you live," he growled. Liliana heard the real irritation under Belzenlok's bluster. Her words were striking in a sensitive spot. "You should have heard how they laughed at you at Tolaria West. 'The massive horned idiot thinks we're as deluded as he is,' they said. That ridiculous ode!" Putting every ounce of contempt she had in her body into it, Liliana started to sing a satirical version of the Rite to <NAME> had composed. Belzenlok roared with fury and Gideon took the opportunity to lunge in. But the demon was too fast. Belzenlok turned back at the last instant to slam Gideon to the pavement. Gideon lost his grip on the Blackblade—Liliana hissed in dismay. But the Blade hadn't fallen to the ground. It had pierced Belzenlok's hide and hung from his thigh, glinting with dark energy. Oblivious with victory, his mouth split with glee, Belzenlok lifted his sword to drive it through Gideon's sprawled body. Liliana leapt forward, under Belzenlok's arm, and seized the Blackblade's hilt. She gasped as the dark energy jolted through her, using her body to pull the demon's life force into the blade. Belzenlok froze, trapped by the Blade's power, held immobile, his fanged mouth open in a rictal grin. #figure(image("012_Return to Dominaria: Episode 12/12.jpg", width: 100%), caption: [Settle the Score | Art by Yongjae Choi], supplement: none, numbering: none) Liliana gazed up at him in triumph and her skin coursed with sparks of violet light as the Blade drained Belzenlok's life. It was almost too much, the power stored within the Blackblade nearly overwhelming her body, her mind. She set her jaw and braced herself, riding the flow of dark energy as Belzenlok's body shrank and shriveled under the Blade. It had been a pleasure to kill all her demons, but destroying Belzenlok in this way was a particular delight. She managed, "You should have left Josu alone." Belzenlok's body writhed, folded in on itself, as the Blade drained it. Abruptly the Blade released him and Liliana staggered back. What was left of Belzenlok collapsed into lumps of white flesh. His horns, still intact, clattered to the pavement. Liliana's knees went weak and she sat down hard on the rain-slick pavement. She felt almost as drained as Belzenlok and shoved the Blackblade away. It lay there on the stone, glinting with dark satisfaction, new power sparking within it. She looked down at herself, but the lines of her pact were still written on her skin. #emph[I thought it would disappear,] she thought, her brow furrowing in confusion. But maybe that had been a forlorn hope; just because the signers of the pact were dead didn't mean it had never existed. Beside her, a dazed Gideon pushed himself up into a sitting position. "Are you all right?" he demanded blearily. Liliana smiled at him. "I'm magnificent." #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Jhoira stood on the #emph[Weatherlight] 's bridge with Tiana. Through the port, they had a good view of the Stronghold under a cloud-strewn sky and the ruins of the Cabal's defenses. Urgoros had vanished when Belzenlok died, and Jhoira had no idea if it had been destroyed or just freed. It was something she was putting firmly in the "worry about it later" category. All day, more spirits and the human resistance fighters had continued to appear out of the surrounding countryside, drawn by the news of the Stronghold's defeat. Gideon, Shanna, and Radha had organized a group to search the prison, releasing any captives still trapped within and helping the injured. The grimnants, cultists, and clerics were all dead or had fled into the swamps. #figure(image("012_Return to Dominaria: Episode 12/13.jpg", width: 100%), caption: [Grand Warlord Radha | Art by <NAME>], supplement: none, numbering: none) Teferi had been shocked to see that Radha had been a prisoner of the Cabal, but at least she was free now. The #emph[Weatherlight] would take her back to Keld, and drop off the other former prisoners who wanted to leave Urborg, and then take Slimefoot and its children to Yavimaya. They would be traveling without Teferi, Karn, and Jaya, who had decided to accompany the other Planeswalkers in their effort to destroy <NAME>. Jhoira had admitted to herself that if she were a Planeswalker, she would have been tempted to join them. But her life and her work had always been here, on Dominaria, and she had a job to finish. Watching Tiana's expression as the angel looked out over the deck, Jhoira said, "Once we get Radha and the others home, we've fulfilled our bargain with the Church of Serra." She steeled herself. "And I suppose we need to return Serra's Realm to you, so you can deliver it to the Church." If Tiana took the Powerstone, Jhoira would just have to think of another way to power the #emph[Weatherlight] . But Jhoira didn't want to break up their crew. They felt right, felt like they were meant to be here. Tiana's gaze was on the deck, where Raff and Shanna stood talking with Arvad. Raff said something that made Shanna laugh and punch him in the shoulder, and Arvad's expression was quietly amused. Slimefoot was giving its children a tour of the deck. Tiana lifted her brows. "Is that what the bargain was?" Jhoira pressed her lips together to hide her relief and put a quizzical look on her face. "Wasn't it?" Tiana shrugged a little. "I thought it was to eradicate the Cabal from all of Dominaria. I mean, Belzenlok being dead is going to help, of course, but there are clerics all over the world that are going to try to hang onto their power." Jhoira tilted her head. "You're right, of course. But that could take years." Tiana met her gaze, and they both smiled as she answered, "Yes. Yes, I guess it could, couldn't it?" #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) It was late in the day when Jhoira stood on the court with Liliana. The spirits had dragged away most of the bodies, and Jaya had melted the Stronghold's doors closed. Not that Jhoira expected that would stop whoever decided to occupy the place next. The sky was just as overcast, but the rain had washed the court's pavement clean. In front of the Stronghold's broken doors, Gideon was giving Teferi the Gatewatch oath while Chandra stood by. Karn and Jaya had agreed to join the fight against Bolas, but hadn't agreed to take the oath. Karn because he meant to leave soon to continue his effort to destroy New Phyrexia, and Jaya because, as she had said, "I'm not a joiner." #figure(image("012_Return to Dominaria: Episode 12/14.jpg", width: 100%), caption: [Oath of Teferi | Art by <NAME>], supplement: none, numbering: none) Liliana shook her head slightly and said, "Gideon and his oath. I don't know how Teferi keeps from laughing." Jhoira smiled at her. "Did you laugh when you took it? Somehow I have trouble imagining that." "I laughed on the inside." Liliana eyed her. "We couldn't have done this without you." "Likewise." Jhoira nodded. "You'll go with them to fight <NAME> now?" "Yes. That was the deal I made with Gideon." Liliana rubbed her hands together in anticipation. "Though I'm rather looking forward to it now. Killing Belzenlok whetted my appetite." Finally they were ready to leave, and Jhoira said her goodbyes to Teferi and Karn. She hugged Teferi and said, "I'd tell you to be careful, but I know you too well." "I could say the same to you," he told her with a smile. "I'll return to visit you as soon as I can. Have a good time raining destruction down upon the Cabal." She turned to Karn, and hugged him too, despite the hard edges of his metal body. "Take care. And remember the Phyrexians are in the past. You have a great future to look forward to." Karn didn't comment on that, but said, "I too will return to visit you, as soon as we destroy Bolas." Jhoira had said her goodbyes to the other Planeswalkers already. She waved, and climbed the ladder up to the #emph[Weatherlight] 's deck. She swung over the railing and signaled to Tiana at the wheel, and the ship curved away from the Stronghold and its smoking volcano. Shanna and Raff stood on the bow, looking into the distance, with Radha and the other warriors they were returning to their homes. As Arvad rolled up the ladder, Jhoira clapped him on the shoulder, and went to join the others. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) As the #emph[Weatherlight] sailed away into the clouds, Liliana was ready to be done with Dominaria. She stood with Gideon, Chandra, Jaya, Teferi, and Karn. They were finally bringing the help Jace and Ajani had asked for, but she didn't expect either to be pleased to see her. They would just have to get over it; Liliana intended to stand over Bolas's corpse. And hopefully make it dance for her amusement, if anything was left of it when they were finished. Gideon had the Blackblade slung over his shoulder, tucked into its scabbard and wrapped in canvas to hide it. It still radiated dark energy that Liliana could feel in her bones. Gideon glanced around at them all and said, "Are we ready?" "We were all born ready," Teferi said, with an ironic smile. Chandra grinned and Jaya rolled her eyes. Karn just nodded. Gideon left first, vanishing in a storm of gold light. Chandra and Jaya went next, in a brief conflagration of red flames, then Teferi in a blue whirlwind. Karn simply vanished with a sharp metallic sound. And Liliana still stood on the pavement in the deserted court, the smoke-tinged breeze stirring her hair. She stared down at herself, baffled. She had meant to follow Gideon. #figure(image("012_Return to Dominaria: Episode 12/15.jpg", width: 100%), caption: [Swamp | Art by <NAME>], supplement: none, numbering: none) She tried to step out of the plane again, but again, nothing happened. "What~How~" she began in dawning horror, afraid she had somehow lost her spark without realizing it. Had it been the Blackblade? Too many uses of the Chain Veil? Then she saw the dust in the court rise and swirl into a whirlwind. A dark form grew at the center of the maelstrom. "No," she breathed, as sick realization settled on her like iron chains. "Oh, no." <NAME> materialized out of the darkness, his huge scaled dragon form looming over her, the sheer weight of his presence drawing all the light and air out of her world. "You really should have read the details of your pact more closely, Liliana. You seem unaware that with your demons dead, your contract defaults to its broker. #emph[Me] ." Liliana stood frozen, fury and dread closing her throat as a gratified smirk stole across Bolas's face. That was why the lines of the pact hadn't faded from her skin with Belzenlok's death. The contract still controlled her, and now she belonged to an entity more vicious than any demon in all the planes of the Multiverse. #emph[I thought I was setting myself free] , she thought, the shock threatening to overwhelm her. #emph[I was playing into his hands all along, making it possible for him to own me] . Everything she had done, every demon's death, every battle, every betrayal, every manipulation. It was all leading to this, to enslavement by <NAME>. And fool that she was, she had never suspected it. She hardened her jaw. #emph[But what if I disobey?] As if he had plucked the thought from her mind, Bolas said, "No. If you disobey my orders in any way, the pact will kill you. You will age hundreds of years in a moment, a desiccated husk to be blown away on the wind." For a moment, Liliana considered it. It would be better to die than to serve Bolas; that she knew in her bones. But part of her refused to give up. There had to be a way out of this, a way to escape this fate. #emph[You can't free yourself if you're dead] , she thought, cold resolve settling over her. Bolas watched her with complacent satisfaction, confident his trap had made her helpless to resist. "Now come. We have work to do." The sky split with lightning and the world warped around him as he planeswalked away. Sick at heart, bound like a prisoner to a new incarnation of a fate she had schemed so long to cheat, Liliana followed in his wake. #figure(image("012_Return to Dominaria: Episode 12/16.jpg", width: 100%), caption: [In Bolas's Clutches | Art by <NAME>], supplement: none, numbering: none) #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) The others stepped into the new plane, the darkness around them lit by the colored flashes of their appearances, as Gideon waited in growing consternation. "Where's Liliana?" he said. Chandra lifted a tiny fireball, driving the shadows back, revealing more of the alley they had arrived in. "Maybe she went to the wrong place?" Jaya turned, studying the dark sky with narrowed eyes. "I don't see any Planeswalker traces. I don't think she got here at all." Teferi frowned and exchanged a worried look with Karn. "There may have been some trap we missed, something hiding at the Stronghold that attacked as we left." Karn nodded. "Urgoros was still unaccounted for. We thought it vanished when Belzenlok was killed, but perhaps not." Gideon was afraid they were right. "I'll go back—" he began. "Don't bother." <NAME> stepped out of a shadowy doorway. "I told you, she can't be trusted. She never intended to come with you." "No, Jace." Gideon shook his head in frustration. "She wouldn't do that. She's changed." "Yeah, Jace," Chandra added, her forehead creased in worry. "She wanted Bolas dead, and she wanted to help kill him. She said she was going to dance on his corpse or something typical." "Don't be so naive." Jace's gaze was hard as he looked around at them. "She used you, just like she uses everyone. Whatever she told you, it was a lie." Teferi eyed Jace skeptically. "She had plenty of opportunity to betray us, yet she risked her life over and over again." Jaya folded her arms. "She saved Jhoira when Yargle attacked the #emph[Weatherlight] . I saw her. And, by the way, don't call me naive, kid." "All because she needed you to kill her demon." Jace shook his head, still certain. "You served your purpose and now she's done with you. Look, I'm sorry you had to learn this for yourselves, but it's the truth. Now we have to go. So much has happened here already. If we're going to have a chance against Bolas, we have a lot of work to do." Jace turned away, walking back into the shadows. The others turned to Gideon. Teferi said, "One of us needs to return. If she's trapped there—" Gideon nodded sharply. "I'll go. Wait for me here." #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) When Gideon walked back onto the paving in front of the Stronghold's broken doors, he wasn't sure what he was expecting. What he saw was an empty court under a hazy gray sky, stone and metal debris from the shattered gates still scattered around, just as they had left it minutes ago. Smoke drifted in the air, and there was no sign of movement, not even a stray spirit. No sign of Liliana. Gideon narrowed his eyes and pivoted, searching for aether trails. After a moment he saw Liliana's, leading away. She had left Dominaria, but she hadn't followed him and the others. It was an unexpectedly sharp blow to his heart. He thought she had changed, had been so sure of it. Even now, with the evidence of his own eyes, it was hard to believe. #emph[She said she was coming with us. Why lie? She could have left any moment after Belzenlok was killed. Why wait while we liberated prisoners from the Stronghold?] It didn't make sense. But this was Liliana. Maybe at the last instant, she had changed her mind. Maybe, in the end, her old self had gotten the better of her. Gideon hesitated, desperate for some sign, some hope, that Liliana hadn't betrayed him after all. But Jace was waiting, and he knew that plans were already in motion to attack <NAME>. He needed to get back to the others. Aloud, he said, "Wherever you are, Liliana, I hope you know what you're doing. And I hope I see you again. Truly." Then he turned and walked away from Dominaria.
https://github.com/LDemetrios/Typst4k
https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/loading/json.typ
typst
--- json --- // Test reading JSON data. #let data = json("/assets/data/zoo.json") #test(data.len(), 3) #test(data.at(0).name, "Debby") #test(data.at(2).weight, 150) --- json-invalid --- // Error: 7-30 failed to parse JSON (expected value at line 3 column 14) #json("/assets/data/bad.json") --- issue-3363-json-large-number --- // Big numbers (larger than what i64 can store) should just lose some precision // but not overflow #let bignum = json("/assets/data/big-number.json") #bignum
https://github.com/Treeniks/bachelor-thesis-isabelle-vscode
https://raw.githubusercontent.com/Treeniks/bachelor-thesis-isabelle-vscode/master/chapters/06-conclusion.typ
typst
#import "/utils/todo.typ": TODO #import "/utils/isabelle.typ": * = Evaluation Our original goal included enhancing the Isabelle language server's flexibility and enabling the development of language clients for other code editors. In order to assess the server's new flexibility with our advancements, we built two prototype language clients for the Neovim and Sublime Text code editors. == Neovim Originally the motivation behind this thesis, our Neovim language plugin has seen significant usability improvements. We found the greatest boon in user experience to be the highlighting in output and state panels. Especially state content has become significantly easier to read thanks to proper highlighting. While #vscode and our Neovim Isabelle plugin still differ in the details, they are now comparable in functionality. Other users have also already used the plugin with success, and it can be found publicly on GitHub. #footnote[https://github.com/Treeniks/isabelle-lsp.nvim] == Sublime Text // #figure( // box(stroke: 1pt, image("/resources/sublime-isabelle-light.png", width: 80%)), // kind: image, // caption: [Sublime Text with prototype Isabelle language client.], // // placement: auto, // ) <fig:sublime-isabelle> Utilizing the Sublime LSP package #footnote[https://lsp.sublimetext.io/], we found that a working Sublime Text Isabelle language package was doable in only $~200$ lines of Python code/* , the result of which can be seen in @fig:sublime-isabelle */. This package supports dynamic highlighting, a working output panel with highlighting, active markup via code actions, completions for symbols, and conversion of symbols from ASCII representations to Unicode---all that on top of more typical LSP features like diagnostics. Although still rough around the edges, we found this package already usable for basic theories. = Conclusion The primary objective of this thesis was to refine and enhance the functionality of #vscode, trying to mimic #jedit while also adding features that make supporting Isabelle in other code editors possible. We discussed different ways of implementing the unique features required by Isabelle into a language server/client setup. In the process, we discovered that, by migrating away from #jedit's exact functionality, certain features can be built without needing any custom handlers in the language client, like how we used LSP code actions to implement Isabelle's active markup. We also found existing issues in the language server, like frequent desyncs of theory contents or limited options regarding symbol handling, and implemented improvements to those areas to make the language server more robust. That way, we found that usage of the language server outside of #vscode became viable, like with our Neovim and Sublime Text language client prototypes. Lastly, it became apparent that great care must be taken in the handling of Isabelle symbols, as it consistently proved challenging to deal with. We extended the language server to allow for more granular control over how symbols are sent, making it more flexible. Thus, a language client now has more freedom when choosing how to deal with these symbols. All in all, Isabelle is a uniquely monolithic system. This is both its greatest strength and its greatest weakness. It gives it the power to build a large set of tools, which are all consistent with one another, and do things that seem magical. However, once you want to venture outside its system, it becomes all the more difficult to integrate. Nevertheless, our work shows that it is not impossible. // in Adrian's words: "kinda useless" // #TODO[ // Recap shortly which problem you solved in your thesis and discuss your *contributions* here. // // Sublime Text prototype // ] = Future Work <future-work> #vscode is still far from perfect, and there are many things that future projects may improve upon. To name just a few: / More Clients: Now that the language server offers enough flexibility for other clients, it would be interesting to build Isabelle support for many more editors. / Sublime Text: We already mentioned a working prototype for Sublime Text. However, this prototype needs a lot more work before it can be reliably used. It does not retain decorations when switching files; in fact, it often completely breaks when switching files. There is also no way to open state panels. / Zed #footnote[https://zed.dev/]: Developed by the creators of Atom #footnote[https://atom-editor.cc/] and Tree-sitter #footnote[https://tree-sitter.github.io/tree-sitter/], Zed is a relatively new code and text editor. At the time of writing, the capabilities of extensions are still fairly limited, although language extensions, in particular, are now possible~@zed-lsp. It could be interesting to investigate a possible Isabelle language extension for Zed. / Pulsar #footnote[https://pulsar-edit.dev/]: While the once-popular code editor Atom has been abandoned, a community-led fork called Pulsar has emerged. While the user base is pretty small, it is a very extensible code editor for which an Isabelle client is certainly conceivable. / Helix #footnote[https://helix-editor.com/]: A modern terminal-based text editor with support for the LSP out of the box. Its plugin system is still in the works #footnote[https://github.com/helix-editor/helix/pull/8675], so an Isabelle client is currently not realistically doable. However, once it is, it may be a nice candidate. / Minor Advancements: Many further small improvements could be made to the language server. These are things that are relatively easy and obvious to build but just require some additional work. / Multiple State Panels for VSCode: We already mentioned in @state-init that #vscode does not currently support using multiple state panels. This would require some work in the Isabelle VSCode extension. However, since most users tend to use only one auto-updated state panel, this feature is not of particularly high priority. / Update VSCode Version: As previously noted, #vscode is based on a rather old version of VSCode: `1.70.1` released on 11 August 2022. Because Isabelle adds its own patches, upgrading #vscode to a newer version is not entirely trivial. Users may run into compatibility issues with newer extensions in the meantime. / Custom Symbols: The `PIDE/symbols_request` notification currently does not relay custom symbols defined by the user. Instead, it only sends the default set of symbols defined in the Isabelle distribution. This makes it virtually impossible for a language client to support such custom symbols and should be changed. Ideally, #vscode would also support user symbols. However, that is much more difficult to achieve due to the use of the #utf8isa encoding. In this context, it may be worth exploring other ideas for symbol handling in #vscode that do not rely on a custom encoding. / More Active Markup: Currently, the only active markup supported with code actions is sendback active markup. However, there are also other kinds of active markup: `browser`, `theory_exports`, and `simp_trace_panel`, to name a few. The latter, for example, is supposed to open a window that shows Isabelle's simplifier trace. Some of these other active markup types may also be possible to support with the language server, but further work is needed. / Indentation Support: As mentioned in @correct-formatting, #jedit has an internal function to automatically indent a theory document. This function uses jEdit buffers and other internal data and is not usable outside of #jedit. However, the actual indentation logic could be extracted, and the feature could be added to the language server. The LSP specifies a `textDocument/formatting` client request for formatting source files, which could be used here. Once such an indentation function is available within the language server, correct indentation for sendback active markup would also be possible. / Updating Options Through Language Server: One potentially useful API to offer a client is the permanent changing of Isabelle system options. That way, the client could send notifications to the server, which then writes the appropriate entries into the user's `preferences` file. It could also offer a request to get the value of certain options. That way, synchronization of #vscode settings and Isabelle preferences would become feasible. // #TODO[ // - more clients (Zed, the Atom fork, better Sublime Text) // - update State ID handling in VSCode // - update VSCode version // - dynamic Symbol additions should be handleable // - refer to previous section that SymbolsRequest only gives compile-time symbols, not all actually current symbols // - in VSCode difficult, but in neovim possible to add these dynamically as new symbols // - code actions for other types of active markup // - indentation as LSP format provider // - in general, extract indentation logic from jEdit // - then also ability to use that logic for Code Actions // // idea: ability to update isabelle options through language server, making synchronization of VSCode settings and preferences potentially doable // ]
https://github.com/antran22/typst-cv-builder
https://raw.githubusercontent.com/antran22/typst-cv-builder/main/lib/cover-letter-template.typ
typst
MIT License
#import "@preview/fontawesome:0.1.0": * #import "@preview/linguify:0.4.0": * #import "./common.typ": * /// ---- Coverletter ---- /// Cover letter template that is inspired by the Awesome CV Latex template by posquit0. This template can loosely be considered a port of the original Latex template. /// This coverletter template is designed to be used with the resume template. /// - author (content): Structure that takes in all the author's information /// - profile-picture (image): The profile picture of the author. This will be cropped to a circle and should be square in nature. /// - date (date): The date the cover letter was created /// - accent-color (color): The accent color of the cover letter /// - body (content): The body of the cover letter #let CoverLetterTemplate( author: (:), profile-picture: image, date: datetime.today().display("[month repr:long] [day], [year]"), language: "en", body, ) = { if type(accent-color) == "string" { accent-color = rgb(accent-color) } // language data let lang_data = toml("lang.toml") set document( author: author.first_name + " " + author.last_name, title: "cover-letter", ) set text( font: (text-font), lang: language, size: 11pt, fill: color-darkgray, fallback: true, ) set page( paper: "a4", margin: (left: 15mm, right: 15mm, top: 10mm, bottom: 10mm), footer: [ #set text( fill: gray, size: 8pt, ) #__justify_align_3[ #smallcaps[#date] ][ #smallcaps[ #author.first_name #author.last_name #sym.dot.c #linguify("cover-letter", from: lang_data) ] ][ #counter(page).display() ] ], footer-descent: 0pt, ) // set paragraph spacing show par: set block( above: 0.75em, below: 0.75em, ) set par(justify: true) set heading( numbering: none, outlined: false, ) show heading: it => [ #set block( above: 1em, below: 1em, ) #set text( size: 16pt, weight: "regular", ) #align(left)[ #text[#strong[#text(accent-color)[#it.body.text]]] #box(width: 1fr, line(length: 100%)) ] ] let name = { align(right)[ #pad(bottom: 5pt)[ #block[ #set text( size: 32pt, style: "normal", font: (display-font), ) #text(accent-color, weight: "thin")[#author.first_name] #text(weight: "bold")[#author.last_name] ] ] ] } let positions = { set text( accent-color, size: 9pt, weight: "regular", ) align(right)[ #smallcaps[ #author.positions.join( text[#" "#sym.dot.c#" "], ) ] ] } let address = { set text( size: 9pt, weight: "bold", fill: color-gray, ) align(right)[ #author.address ] } let contacts = { set box(height: 9pt) let separator = [#box(sym.bar.v)] align(right)[ #set text( size: 8pt, weight: "light", style: "normal", ) #block[ #align(horizon)[ #stack( dir: ltr, spacing: 0.5em, if author.phone != none [ #ICONS.phone #box[#text(author.phone)] #separator ], if author.email != none [ #ICONS.email #box[#link("mailto:" + author.email)[#author.email]] ], if author.github != none [ #separator #ICONS.github #box[#link("https://github.com/" + author.github)[#author.github]] ], if author.linkedin != none [ #separator #ICONS.linkedin #box[ #link("https://www.linkedin.com/in/" + author.linkedin)[#author.first_name #author.last_name] ] ], ) ] ] ] } let letter-heading = { grid( columns: (1fr, 2fr), rows: (100pt), align(left + horizon)[ #block( clip: true, stroke: 0pt, radius: 2cm, width: 4cm, height: 4cm, profile-picture, ) ], [ #name #positions #address #contacts ], ) } let letter-conclusion = { align(bottom)[ #pad(bottom: 2em)[ #text(weight: "light")[Sincerely,] \ #text(weight: "bold")[#author.first_name #author.last_name] \ \ #text(weight: "light", style: "italic")[ #linguify( "attached", from: lang_data, )#sym.colon #linguify("curriculum-vitae", from: lang_data)] ] ] } // actual content letter-heading body linebreak() letter-conclusion } /// Cover letter heading that takes in the information for the hiring company and formats it properly. /// - entity-info (content): The information of the hiring entity including the company name, the target (who's attention to), street address, and city /// - date (date): The date the letter was written (defaults to the current date) #let hiring-entity-info( entity-info: (:), date: datetime.today().display("[month repr:long] [day], [year]"), ) = { set par(leading: 1em) pad(top: 1.5em, bottom: 1.5em)[ #__justify_align[ #text(weight: "bold", size: 12pt)[#entity-info.target] ][ #text(weight: "light", style: "italic", size: 9pt)[#date] ] #pad(top: 0.65em, bottom: 0.65em)[ #text(weight: "regular", fill: color-gray, size: 9pt)[ #smallcaps[#entity-info.name] \ #entity-info.street-address \ #entity-info.city \ ] ] ] } /// Letter heading for a given job position and addressee. /// - job-position (string): The job position you are applying for /// - addressee (string): The person you are addressing the letter to #let letter-heading(job-position: "", addressee: "") = { let lang_data = toml("lang.toml") // TODO: Make this adaptable to content underline(evade: false, stroke: 0.5pt, offset: 0.3em)[ #text(weight: "bold", size: 12pt)[Job Application for #job-position] ] pad(top: 1em, bottom: 1em)[ #text(weight: "light", fill: color-gray)[ #linguify("dear", from: lang_data) #addressee, ] ] } /// Cover letter content paragraph. This is the main content of the cover letter. /// - content (content): The content of the cover letter #let coverletter-content(content) = { pad(top: 1em, bottom: 1em)[ #set par(first-line-indent: 3em) #set text(weight: "light") #content ] } /// ---- End of Coverletter ----
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/layout/pagebreak-04.typ
typst
Other
// Test hard and weak pagebreak followed by page with body. // Should result in three navy-colored pages. #set page(fill: navy) #set text(fill: white) First #pagebreak() #page[Second] #pagebreak(weak: true) #page[Third]
https://github.com/valentinvogt/npde-summary
https://raw.githubusercontent.com/valentinvogt/npde-summary/main/src/chapters/02.typ
typst
#import "../setup.typ": * #import "@preview/xarrow:0.3.1": xarrow #show: thmrules = Finite Element Method <ch:finite-element-method> #counter(heading).step(level: 2) == Galerkin Discretization <sub:galerkin-discretization> The idea of Galerkin discretization is to replace the infinite-dimensional function space $V_0$ by a finite-dimensional subspace $V_(0 , h) subset V_0$. #theorem( number: "2.2.1.5", title: "Theorem", "Unique solution of discrete variational problems", )[ If the bilinear form $a : V_0 times V_0 arrow.r bb(R)$ is symmetric and positive definite and the linear form \ $ell : V_0 arrow.r bb(R)$ is continuous @eq:continuity-linear-form w.r.t. $norm("")_a$, then the discrete variational problem #neq( $ u_h in V_(0 , h) : a (u_h , v_h) = ell (v_h) , quad forall v_h in V_(0 , h) $, ) <eq:disc-var-prob> has a unique #emph[Galerkin] solution $u_h in V_(0 , h)$ satisfying the energy estimate $ norm(u)_a lt.eq sup_(v_h in V_(0 , h)) frac(lr(|ell (v_h)|), norm(v_h)_a) $ ] Recall the definition of a basis (here, superscripts are indices and not to be confused with exponents): ${ b^1 , dots.h , b^N } subset V$ is a basis, if for every $v in V$ there are unique coefficients $mu_i$ such that $v = sum_(i = 1)^N mu_i b^i$ and $N=dim V$. Now we can expand $u_h = mu_1 b^1 + dots.h.c + mu_N b^N$ and our goal is to find the coefficients $mu_i$. #mybox( "Galerkin Discretization", )[ Linear discrete variational problem @eq:disc-var-prob $xarrow(sym: -->, "Choice of basis" frak(B)_h)$ Linear system of equations $bold(A arrow(mu) = arrow(phi))$ $ bold("Galerkin Matrix") : & quad bA = [a (b^k , b^j)]_(j , k = 1)^N in bb(R)^(N , N)\ bold("RHS vector") : & quad bold(arrow(phi)) = [ell (b^j)]_(j = 1)^N in bb(R)^N\ bold("coefficient vector") : & quad bold(arrow(mu)) = [mu_1 , dots.h , mu_N]^top in bb(R)^N $ ] Note that $bA_(j , k) = a (b_h^k , b_h^j) colMath(eq.not a (b_h^j , b_h^k), #red)$ if $a$ is not symmetric (note the order of arguments $k,j$). Of course the bilinear form $a$ determines some properties of the Galerkin matrix. If $a$ is symmetric and/or positive definite, the Galerkin matrix $bA$ will have the same properties. The choice of $V_(0 , h)$ alone determines the quality of the solution $u_h$. While mathematically the choice of basis $frak(B)_h$ does not matter, for solving the equation numerically, the choice is crucial: The basis determines properties of $bA$ like sparsity, so it influences how stable and efficient the numerical solution is. #tip-box( [Computing the energy norm in code], )[ Sometimes, problems ask you to compute $norm(u_h)_a$, i.e., the energy norm of a discrete solution. $ norm(u_h)_a^2 = a(u_h,u_h) = a(sum_(i=0)^N mu_i b_i^h, sum_(j=0)^N mu_j b_j^h) = sum_(i=0)^N sum_(j=0)^N mu_i mu_j a(b_i^h,b_j^h) = arrow(mu)^top bA arrow(mu) $ So $norm(u_h)_a$ can be computed as `sqrt(mu.transpose() * A * mu)`. ] #pagebreak() == Linear FEM in 1D <sub:linfem1d> In FEM, the goal is to approximate $u$ by piecewise polynomial functions. #mybox( "Mesh in one dimension", )[ Let $Omega = [a , b]$, we equip it with $M + 1$ #strong[nodes] resulting in the set of nodes: $ cal(V (M)) = { a = x_0 < x 1 < dots.h.c < x_M = b } $ The nodes define intervals, which build up the mesh: $ msh = { openint(x_(j - 1), x_j) : 1 lt.eq j lt.eq M } $ The intervals $[x_(j - 1) , x_j]$ are the #strong[cells] of the mesh. We define local cell size $h_j = lr(|x_j - x_(j - 1)|)$ and global mesh width $h_(msh) = max_j h_j$. ] A simple space for continuous, $msh$-piecewise polynomial functions in $H_0^1 (openint(a, b))$ consists of linear functions on each cell: #neq( $ V_(0 , h) = S_(1 , 0)^0 (msh) = {v in C^0 ([a , b]) : eval(v)_[x_(i - 1),x_i ] upright("is linear") , i = 1 , dots.h , M , v (a) = v (b) = 0} $, )<eq:linfem1d-space> $ arrow.r N = dim S_(1 , 0)^0 (msh) = M - 1 $ The 0-superscript stands for $C^0$: functions are globally continuous. The 1-subscript denotes local degree 1 polynomial and the 0-subscript denotes value 0 on the boundary. The $cal(S)$ stands for $cal(S)$calar functions. Common basis functions are the 1D tent functions: #neq( $ b_h^j (x) = cases( delim: "{", (x - x_(j - 1)) \/ h_j & upright("if ") x_(j - 1) lt.eq x lt.eq x_j, (x_j - x) \/ h_(j + 1) & upright("if ") x_j lt.eq x lt.eq x_(j + 1), 0 & "else", ) $, ) #neq($ arrow.r b_h^j (x_i) = delta_(i j) $) <eq:cardinal-property> A basis satisfying condition @eq:cardinal-property is called a #strong[cardinal] basis. Another key property of tent functions is that their support just comprises two adjacent cells: $ "supp"(b_h^j) = [x_(j - 1) , x_(j + 1)] $ The support of a function $f : Omega arrow.r bb(R)$ is defined as $overline({ x in Omega : f (x) eq.not 0 })$, the set of inputs for which the function is nonzero. Since polynomials are easy to differentiate and integrate, computing (bi)linear forms $a$ and $ell$ for them is quite easy. #pagebreak() == Linear FEM in 2D <sub:linfem2d> #mybox( "Mesh in two dimension", )[ Meshes in 2D rely on #strong[triangulations];. A #strong[triangulation] $msh$ of $Omega$ satisfies: - $msh = { K_i }$, where $K_i$ are open triangles - $i eq.not j arrow.r K_i sect K_j = diameter$ - $union.big_(i = 1)^M overline(K_i) = overline(Omega)$ - $i eq.not j arrow.r overline(K_i) sect overline(K_j)$ is either $diameter$, an edge from both triangles or a vertex from both Again, the vertices are called #strong[nodes] and the triangles are the #strong[cells];. ] #grid( columns: (0.75fr, 0.2fr), [ This definition does not allow for hanging nodes because of point 4. Hanging nodes are those which lie on the edge of a triangle: ], image("../../images/hanging_node.png", width: 80%), ) #v(-0.9cm) We define a space of piecewise-linear functions analogously to @eq:linfem1d-space: #neq( $ V_(0 , h) = S_1^0 (msh) = {v in C^0 (overline(Omega)) : v_K (bx) = alpha_K + bold(beta)_K dot.op bx , alpha_K in bb(R) , bold(beta)_K in bb(R)^2 , bx in K} $, ) <eq:linfem2d-space> $ arrow.r dim S_1^0 (msh) = \# cal(V (M)) $ And $S_(1 , 0)^0 (msh)$ additionally requires functions to be zero on $partial Omega$, with $ dim S_(1 , 0)^0 (msh) = \# lr({ bx in cal(V (M)) : bx in.not partial Omega }) $ Similarly, the 1D tent functions can be extended to 2D by requiring the cardinal property. This property is already enough since three points fully define a plane — in other words, knowing the values in three points (the vertices of a triangle) fully defines a linear function. Cardinal bases will produce sparse Galerkin matrices, as the support of a basis function only covers the triangles adjacent to its node, which can only interact with neighboring basis functions. #v(-0.1cm) #mybox( "Computation of Galerkin Matrix", )[ Often, bilinear forms are defined by integration over the whole domain. But we have seen that the support of basis functions is only local. We can exploit this by performing integration only over the cells. #neq( $ bA_(i j) = a (b_h^j , b_h^i) = sum_(K in "supp"(b_h^j) sect "supp"(b_h^i)) eval(a)_K (b_h^j , b_h^i) $, )<eq:galerkin_matrix_entry> where $eval(a)_K$ is the local bilinear form over cell $K$. ] #v(-1.1cm) #mybox( "Cell oriented assembly", )[ To further take advantage of @eq:galerkin_matrix_entry, cell oriented assembly can be performed. Go through all cells and compute $eval(a)_K (b_h^j , b_h^i)$ for all pairs of basis functions associated with cell $K$ (element matrix) and add the values to the entry at $(i , j)$ of $bA$. ] The same procedure can be applied to calculating the right hand side vector $phi$, just that only one basis function is involved as the RHS comes from a linear functional. == Building Blocks of General Finite Element Methods <sub:fem-building-blocks> The first building block are meshes, see @sub:linfem1d and @sub:linfem2d. Next we need to choose a space of functions. #definition( number: "2.5.2.2", "Multivariate Polynomials", )[ Space of d-variate (taking inputs in $RR^d$) polynomials with total degree $p$: $ cal(P)_p (bb(R)^d) = {bx in bb(R)^d arrow.r sum_(balpha in bb(N)_0^d , lr(|balpha|) lt.eq p) c_balpha bx^balpha , c_balpha in bb(R)} $ with $balpha = (alpha_1 , dots.h.c , alpha_d) , bx^balpha = x_1^(alpha_1) dot.op dots.h.c dot.op x_d^(alpha_d)$ and $lr(|balpha|) = alpha_1 + dots.h.c + alpha_d$ ] <concept:multi-index> As an example, $cal(P)_2 (bb(R)^2) = "Span"{ 1 , x_1 , x_2 , x_1^2 , x_2^2 , x_1 x_2 }$ #lemma( number: "2.5.2.5", "Dimension of spaces of Polynomials", )[ $ dim cal(P)_p (bb(R)^d) = binom(d + p, p) , quad p in bb(N)_0 , d in bb(N) $ which in the limit of $p arrow.r oo$ behaves like $Order(p^d)$. ] #definition( number: "2.5.2.7", "Tensor Product Polynomials", )[ The space of tensor product polynomials of degree $p$ in each coordinate is $ cal(Q)_p (bb(R)^d) = {bx in bb(R)^d arrow.r sum_(l_1 = 0)^p dots.h.c sum_(l_d = 0)^p c_(l_1 , dots.h , l_d) x_1^(l_1) dot.op dots.h.c dot.op x_d^(l_d) , quad "where" c_(l_1 , dots.h , l_d) in bb(R)}\ = "Span"{bx arrow.r p_1 (x_1) dot.op dots.h.c dot.op p_d (x_d) , p_i in cal(P)_p (bb(R))} $ ] As an example, $cal(Q)_2 (bb(R)^2) = "Span" { 1 , x_1 , x_2 , x_1 x_2 , x_1^2 , x_1^2 x_2 , x_1^2 x_2^2 , x_1 x_2^2 , x_2^2 }$ #lemma( number: "2.5.2.8", "Dimension of spaces of tensor product polynomials", )[ $ dim cal(Q)_p (bb(R)^d) = (p + 1)^d , quad p in bb(N)_0 , d in bb(N) $ ] Finally we need #strong[locally] supported basis functions. This basis $frak(B)_h = b_h^1 , dots.h.c , b_h^N$ should satisfy the following constraints: + $frak(B)_h$ is a basis of $V_h$, hence $dim frak(B)_h = dim V_h$. + Each $b_h^i$ is associated with a single mesh entity (cell/edge/face/vertex). + Each $b_h^i$ is only locally supported, i.e., only nonzero on cells adjacent to the associated entity. == Lagrangian Finite Element Methods <sub:lagrangian-fem> Remember Eqs. @eq:linfem1d-space and @eq:linfem2d-space as two examples of finite element spaces. They are examples of the general Lagrangian FE spaces. First we introduce them for #emph[simplicial] meshes, i.e., those consisting of triangles (2D) or tetrahedra (3D). #definition( number: "2.6.1.1", "Simplicial Lagrangian finite element spaces", )[ #neq( $ cal(S)_p^0 (msh) = {v in C^0 (overline(Omega)) : v_K in cal(P)_p (K) , forall K in msh} $, )<eq:simp_lfes> ] This space is well suited for triangular meshes, as the local dimension $binom(d + p, p) = binom(2 + p, p)$ (in 2D) is the same as the number of interpolation nodes of a triangle. The local basis functions of $cal(S)_1^0$ are the barycentric coordinate functions. In $cal(S)_2^0$, the local basis functions are combinations of barycentric coordinate functions, see @eq:barycentric-cardinal-property. #grid( columns: (0.5fr, 0.5fr), [ #h(1cm) $ b_K^1 & = (2 lambda_1 - 1) lambda_1 , quad b_K^4 = 4 lambda_1 lambda_2 ,\ b_K^2 & = (2 lambda_2 - 1) lambda_2 , quad b_K^5 = 4 lambda_2 lambda_3 ,\ b_K^3 & = (2 lambda_3 - 1) lambda_3 , quad b_K^6 = 4 lambda_1 lambda_3 $ ], [ #v(-0.7cm) #image("../../images/triangle_nodes.png", width: 80%) ], ) where the local basis functions 1-3 are associated with vertices and 4-6 with edges. Analogously, the following space is well suited for quadrilaterals, as its local dimension $(p + 1)^2$ is the same as the amount of vertices and interpolation points on quads. #definition( number: "2.6.2.5", "Tensor product Lagrangian finite element spaces", )[ #neq( $ cal(S)_p^0 (msh) = {v in C^0 (overline(Omega)) : eval(v)_K in cal(Q)_p (K) , forall K in msh} $, ) <eq:tens_lfes> ] Note that the choice of local polynomial space is the only difference, $cal(Q)_p (K)$ instead of $cal(P)_p (K)$. Of course these spaces can be mixed: on mixed (so-called hybrid) meshes, we use @eq:simp_lfes on triangles and @eq:tens_lfes on quadrilaterals. #pagebreak(weak: true) == Implementation of Finite Element Methods <sub:implementation-of-fem> Remember the principle of cell-oriented assembly. The goal is to rely mostly on local computations. To perform cell-oriented assembly, a map from local to global indices is needed. In LehrFEM++ this is the job of the dofhandler (#link( "https://craffael.github.io/lehrfempp/classlf_1_1assemble_1_1_dof_handler.html", )[`lf::assemble::DofHandler`];). It provides the following main methods: - `NumDofs()`, returns the total number of global basis functions, the dimension of the FE space. - `NumLocalDofs(const lf::mesh::Entity &)`, returns the number of global basis functions *covering* any geometric entity, so counts those associated with the entity and with its sub-entities. - `GlobalDofIndices(const lf::mesh::Entity &)`, returns an array of indices of the global basis function *covering* the given entity. The order is with decreasing co-dimension of the functions's associated entity, so vertex, edge, cell. Within each co-dimension, the order is according to the local numbering of the entity. - `NumInteriorDofs(const lf::mesh::Entity &)`, returns the number of global basis functions *associated with* the given entity (so for a triangle, the number of basis functions in the interior of the triangle, not those of the edges or vertices). - `InteriorGlobalDofIndices(const lf::mesh::Entity &)`, similar to `GlobalDofIndices` but returns only the indices of the global basis functions *associated with* the given entity. - `Entity(unsigned int dofum)`, returning the entity associated with the global index `dofnum`. Instead of dimension, in LehrFEM++ the concept of #strong[co-dimension] is used. Instead of going from a point with dimension 0 to a triangle with dimension 2, the co-dimension is the other way around. The highest-dimensional entity has co-dimension 0. This ensures that cells are always of co-dimension 0. To assemble the Galerkin matrix, #link( "https://craffael.github.io/lehrfempp/group__assemble__matrix__locally.html#ga39b4197203dd4e896bd7073fc033aca3", )[`lf::assemble::AssembleMatrixLocally`]; can be used. To use it, we need element matrix providers, constructs which provide the _local_ element matrix for given bilinear forms. Some common bilinear forms are already implemented. - $integral_K alpha (bx) med grad u dot.op grad v dif bx$ is implemented in #link( "https://craffael.github.io/lehrfempp/classlf_1_1fe_1_1_diffusion_element_matrix_provider.html", )[`lf::fe::DiffusionElementMatrixProvider`] - $integral_K gamma (bx) med u med v dif bx$ is implemented in #link( "https://craffael.github.io/lehrfempp/classlf_1_1fe_1_1_mass_element_matrix_provider.html", )[`lf::fe::MassElementMatrixProvider`] - $integral_e gamma (bx) med u med v dif S$ is implemented in #link( "https://craffael.github.io/lehrfempp/classlf_1_1fe_1_1_mass_edge_matrix_provider.html", )[`lf::fe::MassEdgeMatrixProvider`];. Note the integration over an edge and not a cell. - $integral_K alpha (bx) med grad u dot.op grad v dif bx med med + integral_K gamma (bx) med u med v dif bx$ combined is implemented in\ #link( "https://craffael.github.io/lehrfempp/classlf_1_1uscalfe_1_1_reaction_diffusion_element_matrix_provider.html", )[`lf::uscalfe::ReactionDiffusionElementMatrixProvider`] - $integral_K f (bx) v dif bx$ is implemented by #link( "https://craffael.github.io/lehrfempp/classlf_1_1fe_1_1_scalar_load_element_vector_provider.html", )[`lf::fe::ScalarLoadElementVectorProvider`] - $integral_e f (bx) v dif S$ is implemented by #link( "https://craffael.github.io/lehrfempp/classlf_1_1fe_1_1_scalar_load_edge_vector_provider.html", )[`lf::fe::ScalarLoadEdgeVectorProvider`];. Note again the integration over an edge. Note that the last two are actually element vector providers. #pagebreak(weak: true) The following formula is usually used when computing element matrices by hand: #lemma( number: "2.7.5.5", "Integration of powers of barycentric coordinate functions", )[ For a $d$-simplex $K$ (line in 1D, triangle in 2D, tetrahedron in 3D) with barycentric coordinate functions $lambda_1 , dots.h , lambda_(d + 1)$ as defined in @eq:barycentric-cardinal-property, #neq( $ integral_K lambda_1^(alpha_1) dot.op dots.h.c dot.op lambda_(d + 1)^(alpha_(d + 1)) dif bx = d ! lr(|K|) frac( alpha_1 ! dot.op dots.h.c dot.op alpha_(d + 1) !, (alpha_1 + dots.h.c + alpha_(d + 1) + d) !, ) , quad alpha_i in bb(N), $, ) where $|K|$ is the volume of the simplex. ] #strong[Quadrature rules] $ integral_K f (x) dif x approx sum_(l = 1)^(P_K) w_l^K f (zeta_l^K) , quad w_l^K arrow.r upright("weights") , zeta_l^K arrow.r upright("(quadrature) nodes") $ #subtle-box()[ *Order* of a quadrature rule: a quad rule is of order $q$ if - for a simplex $K$, it is exact for all polynomials $f in cal(P)_(p - 1) (bb(R)^d)$ - for a tensor product element $K$, it is exact for all polynomials $f in cal(Q)_(p - 1) (bb(R)^d)$ ] #strong[Essential Boundary Conditions] Remember from @sub:boundary-conditions that essential boundary conditions are Dirichlet boundary conditions, i.e., $u = g$ on $partial Omega$, and can be solved with the offset function trick. This trick can also be used in FEM.\ Assume that the basis functions are sorted such that all interior ones come first, followed by the ones on the boundary (we are free to choose the order of basis functions). Then, it is possible to write $bA$ as follows: $ bA = nat( delim: "[", bA_0, bA_(0 partial);bA_(0 partial)^top, bA_(partial partial) ) $ where $bA_0$ is the Galerkin matrix for $cal(S)_(p , 0)^0 (msh)$, containing the interactions among interior basis functions. $(bA_(0 partial))_(i j) = a (b_h^j , b_h^i)$, where $b_h^j$ belongs to the boundary and $b_h^i$ to the interior, so $bA_(0 partial)$ contains the interactions of interior with boundary functions. Similarly, $bA_(partial partial)$ consists only of entries calculated from basis functions of the boundary. Then we want to solve: $ nat( delim: "[", bA_0, bA_(0 partial);bA_(0 partial)^top, bA_(partial partial), ) nat(delim: "[", bold(arrow(mu))_0;bold(arrow(mu))_partial) = nat(delim: "[", bold(arrow(phi));bold(arrow(phi))_partial) $ where $bold(arrow(mu))_partial$ are the coefficients of the basis expansion of $g$ on the boundary, which are known since $g$ is given. We only need to solve for $bold(arrow(mu))_0$ which results in $ bA_0 bold(arrow(mu))_0 = bold(arrow(phi)) - bA_(0 partial) bold(arrow(mu))_partial $ This can be done in LehrFEM++ with #link( "https://craffael.github.io/lehrfempp/namespacelf_1_1assemble.html#a4fba0f99e10227530fcb990ddda7b305", )[lf::assemble::FixFlaggedSolutionComponents] or\ #link( "https://craffael.github.io/lehrfempp/namespacelf_1_1assemble.html#ad8de42b7c7e79eeba5704e43a5b4d67f", )[lf::assemble::FixFlaggedSolutionCompAlt];. Both modify the matrix $bA$ and RHS vector $bold(arrow(b))$ such that $bold(A arrow(mu) = arrow(b))$ has the same solution as the above equation, but do it in slightly different ways (see docs). #tip-box( [Boundary data in LehrFEM], )[ `FixFlaggedSolutionComponents` (in both versions) requires a lambda function `std::pair<bool, double> selector(unsigned int dof_idx)`. It returns wether the dof is to be fixed and if so, the value it should be fixed to. We get the boundary flags with ```cpp auto bd_flags = lf::mesh::utils::flagEntitiesOnBoundary(dofh.Mesh(), 2); ``` The second argument is the codim of entities we are interested in. To fix all dofs on the boundary (including those associated with edges and cells), give no second argument. *1. One function $g$ for the whole boundary* To get the function values of $g$ at the boundary nodes, wrap it in a `MeshFunction`: ```cpp auto mf_g = lf::mesh::utils::MeshFunctionGlobal(g); auto boundary_val = lf::fe::InitEssentialConditionFromFunction(*fe_space, bd_flags, mf_g); ``` This gives a `std::vector<std::pair<bool, scalar_t>>`. To get our selector: ```cpp auto selector = [&](unsigned int dof_idx) -> std::pair<bool, double> { return boundary_val[dof_idx]; }; ``` If $g$ has different definitions on different parts of the boundary (e.g., $g=0$ on $Gamma_0$ and $g=1$ on $Gamma_1$), try to express $g$ as a lambda function with an if-else statement. *2. Constant value* The selector becomes ```cpp auto selector = [&](unsigned int dof_idx) -> std::pair<bool, double> { if (bd_flags[dof_idx]) { return std::make_pair(true, boundary_value); } else { return std::make_pair(false, 0.0); // value irrelevant } }; ``` *3. BC only on part of the boundary* Wee need to create our own `bd_flags`. Initialize it with default value `false`: ```cpp lf::mesh::utils::AllCodimMeshDataSet<bool> bd_flags(mesh_p, false); ``` Then loop over nodes and edges _separately_ and set `bd_flags` to `true` for the nodes/edges where the BC should be applied. ```cpp for (const auto& edge : fe_space->Mesh()->Entities(1)) { if (...) bd_flags(*edge) = true; } for (const auto& node : fe_space->Mesh()->Entities(2)) {...} ``` ] #pagebreak() == Parametric Finite Element Methods <sub:parametric-fem> #lemma( number: "2.7.5.14", "Affine transformation of triangles", )[ For any triangle $K$ s.t. $lr(|K|) > 0$, there is a unique affine transformation $Phi_K (bxhat) = F_K bxhat + tau_K$, with $K = Phi_K (Khat)$ and $Khat$ the unit triangle. ]<thm:affine-triangle-transformation> This is nice since it allows us to transform integrals on an arbitrary triangle to ones on the unit triangle and perform easy integration there. Additionally, $Phi_K$ can be computed straightforwardly: $ "Let " K "be a triangle with vertices " a^1 , a^2 , a^3. "Then" Phi_K (bxhat) = mat(delim: "[", a_1^2 - a_1^1, a_1^3 - a_1^2;a_2^2 - a_2^1, a_2^3 - a_2^2) bxhat + mat(delim: "[", a_1^1;a_2^1) $ #definition( number: "2.8.1.2", "Pullback", )[ Given domains $Omega , mhat(Omega) subset bb(R)^d$ and a bijective mapping $Phi : mhat(Omega) arrow.r Omega$, the #emph[pullback] $Phi^(\*) u$ of a function $u : Omega arrow.r bb(R)$ is a function on $mhat(Omega)$ defined by $(Phi^(\*) u) (bxhat) := u (Phi (bxhat)) , bxhat in mhat(Omega)$. ] An example for this is the affine transformation of triangles (@thm:affine-triangle-transformation) above. Note that in the following we will use $hat(x)$ for an element that \"lives\" in a reference triangle (or quadrilateral). The reference triangle has corners ${ (0 , 0) , (1 , 0) , (0 , 1) }$; the reference quad is the unit square. When dealing with #emph[parametric] finite element methods, we know that $ hat(b)_Khat^i = Phi_k ^(\*) b_K^i, $ where $b_K^i:K -> RR$ are the local basis functions on the concrete element $K$ and $hat(b)_Khat^i$ are the local basis functions on the reference element $Khat$ that matches $K$. To make life easier, we call everything on the reference element *local* and everything on the concrete element *global*. Note that all bilinear forms and linear forms in this course consist of integrals, so we will sooner or later need to use quadrature to approximate the integrals. But in the literature, quadrature rules are defined on reference elements. Hence, we want a change of variables in the integrals of the linear and bilinear forms such that we can apply these quadrature rules. This change of variable is given by the pullback function. For the simple example of a mass matrix we get (by some multidimensional analysis) #neq( $ (A_K)_(i j) = integral_K b_K^j (x) b_K^i (x) dif x = integral_(Khat) (Phi_K^(\*) b_K^j) (hat(x)) (Phi_K^(\*) b_K^i) (hat(x)) med sqrt(det (D Phi_K^top (hat(x)) D Phi_K (hat(x)))) dif x , $, ) <eq:mass-matrix-pullback> where we have simply applied the pullback to both functions, switched to integration on $Khat$, and added an integration element. Similarly, for the diffusion matrix we get #neq( $ integral_K gradsub(bx) &b_K^j (x) dot.op gradsub(bx) b_K^i (x) dif x \ &= integral_(Khat) Phi_K^(\*) (gradsub(bx) b_K^j) (hat(x)) thin dot thin Phi_K^(\*) (gradsub(bx) b_K^i) (hat(x)) med sqrt(det (D Phi_K^top (hat(x)) D Phi_K (hat(x)))) dif x . $, ) <eq:diffusion-matrix-pullback> by pulling back the global gradients (denoted by $gradsub(x)$) of the global shape functions. Why is the integration element $det (D Phi_K^top (hat(x)) D Phi_K (hat(x)))$ more complicated than what we know from @thm:transformation-rule-for-integration? It is needed when $Omega$ and $mhat(Omega)$ do not live in the same space. If, for example, $Omega subset bb(R)^3$ describes a 2D plane "living" in 3D space and $mhat(Omega) subset bb(R)^2$, we will have $D Phi_K in bb(R)^(3 times 2)$ and hence $det (Phi_K)$ is not defined, so the full term is used. In the simpler case of square $Phi$, this simplifies to $det (Phi_K)$. For both cases, the term is provided by #link( "https://craffael.github.io/lehrfempp/classlf_1_1geometry_1_1_geometry.html#a80112cf5cfa9314cb44e61756299607d", )[`lf::geometry::IntegrationElement`];. The next thing which needs clarification is $Phi_K^(\*) (gradsub(bx) b_K^i)$, pullback of the gradient. As the gradient $gradsub(bx) b_K^i (x)$ depends on the shape of $K$, it would be complicated to compute this term directly. Therefore we use #lemma( number: "2.8.3.10", "Transformation formula for gradients", )[ For differentiable $u : K arrow.r bb(R)$ and any diffeomorphism $Phi : Khat arrow.r K$ we have $ (gradsub(bxhat) Phi^(\*) u) (bxhat) = (D Phi (bxhat))^top underbrace([(gradsub(bx) u) (Phi(hat(x)))], (Phi^(\*) gradsub(bx)) u) (bxhat) $ In words: on the left side we have *local gradient of the pullback* of $u$, on the right side we have *pullback of the global gradient* of $u$. ] This is exactly what we need since the pullback of the global gradient occurs in @eq:diffusion-matrix-pullback and the local gradient of local shape functions is easy to compute. Now we need to get rid of $(D Phi (hat(x)))^top$ on the right. Let's define $J=D Phi (hat(x))$. Since J might not be square, we cannot simply invert it. But we can multiply by $J (J^top J)^(- 1)$ to get $ Phi_K^(\*) (gradsub(bxhat) b_K^i) = J (J^top J)^(- 1) (gradsub(bxhat) hat(b)_Khat^i) $ $hat(b) (hat(x))$ is a reference basis function on the reference shape --- we can compute its gradient easily by hand. Note that in the script, the case of square $J$ is assumed, such that this simplifies to $J^(- top) (gradsub(bxhat) hat(b)_Khat^i)$. The long term only matters when we have (as above) $Omega$ and $mhat(Omega)$ not living in the same space. The same remedy applies here, you can in any case use #link( "https://craffael.github.io/lehrfempp/classlf_1_1geometry_1_1_geometry.html#a7cb2b572966d7492522acb1b127cbbd0", )[`lf::geometry::JacobianverseGramian`] which will return $J^(- top)$ or $J (J^top J)^(- 1)$, respectively. #block[ #strong[Bilinear Transformation for Quadrilaterals] Let ${ bold(a^1 \, a^2 \, a^3 \, a^4) }$ be the ordered corners of a quadrilateral. Then $ Phi_K (hat(x)) & = (1 - hat(x)_1) (1 - hat(x)_2) bold(a^1) + hat(x)_1 (1 - hat(x)_2) bold(a^2) + (1 - hat(x)_1) hat(x)_2 bold(a^3) + (1 - hat(x)_1) hat(x)_2 bold(a^4)\ & = mat( delim: "[", alpha_1 + beta_1 hat(x)_1 + gamma_1 hat(x)_2 + delta_1 hat(x)_1 hat(x)_2;alpha_2 + beta_2 hat(x)_1 + gamma_2 hat(x)_2 + delta_2 hat(x)_1 hat(x)_2, , , , ) $ with $ mat(delim: "[", alpha_1;alpha_2) = bold(a^1) , mat(delim: "[", beta_1;beta_2) = bold(a^2 - a^1) , mat(delim: "[", gamma_1;gamma_2) = bold(a^4 - a^1) , mat(delim: "[", delta_1;delta_2) = bold(a^4 - a^3 - a^2 + a^1) $ ]
https://github.com/fywc/Resume_Template
https://raw.githubusercontent.com/fywc/Resume_Template/main/template.typ
typst
// Note: 本模板修改自 https://typst.app/project/p1sVlu8OxI122an3_UdDfG #let black = rgb(0,0,0) #let gray = rgb(128,128,128) #let miku = rgb(57, 197, 187) #let project( name: "", body ) = { // 标题 set document(title: name) // 页边距设定 set page(paper: "a4", margin: ( top: 1.8cm, bottom: 1.8cm, left: 2cm, right: 2cm )) set text(font: "Noto Serif CJK SC"); // 设置标题(名字)字体 block(text(weight: 345, 1.8em, name)) // Main body. set par(justify: true) body } // 日期 #let dateFn(date:"",body) = { set text( font:"Noto Serif" , fill:black, size:0.9em, // weight: 350 ) place( end, body ) } // 个人信息 #let info( phone:"", email:"", github:"" ) = { set text(font: "Noto Serif Balinese",size:1.16em,weight: 450) set box(baseline: 2pt) box( height: 11pt, image.decode("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d=\"M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z\"/></svg>") ) h(3pt) phone h(5pt) `|` h(5pt) box( height: 11pt, image.decode("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d=\"M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48H48zM0 176V384c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V176L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z\"/></svg>") ) h(3pt) email h(5pt) `|` h(5pt) box( height: 11pt, image.decode("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 496 512\"><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d=\"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z\"/></svg>") ) h(3pt) // link("https://" + github)[#github] github } // 教育背景 #let education( school:"", major:"", degree:"", lab:"", mentor:"", research:"", date:"", grade:"", body ) = { dateFn[#date] set par(leading: 0.9em) set text(font: "Noto Serif CJK SC",size:1em,weight: 400) text[ #strong(delta:280, school) #h(10pt)#major #h(10pt)#degree #linebreak() #h(10pt)#lab #h(10pt)#mentor #h(10pt)#research #grade ] body } #let education2( school:"", major:"", degree:"", date:"", grade:"", body ) = { dateFn[#date] set par(leading: 0.9em) set text(font: "Noto Serif CJK SC",size:1em,weight: 400) text[ #strong(delta:280, school) #h(10pt)#major #h(10pt)#degree #linebreak() #grade ] body } // 获奖情况(单个可复用) #let prize( game:"", grade:"", date:"", body ) = { v(10pt, weak: true) // 更紧凑 dateFn[#date] set text(font: "Noto Serif CJK SC",size:0.95em,weight: 100) text[ // 用#box来保证间距不随内容变化 #box(width:250pt)[#strong(delta:280, game)] #box(width:50pt)[#strong(delta:280, grade)] ] } // 项目 / 工作经历 #let experience( name:"", type:"", date:"", description:"", body ) = { dateFn[#date] set par(leading: 0.95em) set text(font:("Noto Serif","Noto Serif CJK SC"),size:0.95em,weight: 400,tracking:0.2pt) // 设置是否斜体: // set text(style:"italic") text[ #set text(size: 1.05em) #strong(delta:280, name) #h(1em) #box(width:120pt)[#strong(delta:280, type)] ] linebreak() text[#description] body } // 其他 #let other( body ) = { set text(font:("Noto Serif","Noto Serif CJK SC"),size:0.95em,weight: 400,tracking:0.2pt) // set text(font: "Noto Serif CJK SC",size:0.95em,weight: 400) body }
https://github.com/cnaak/blindex.typ
https://raw.githubusercontent.com/cnaak/blindex.typ/main/lang.typ
typst
MIT License
//============================================================================================// // Imports // //============================================================================================// #import "./books.typ": iBoo //============================================================================================// // blindex Languages File // //============================================================================================// // Declaration and structuring of the {lDict} language dictionary #let lDict = (:) // Populate lDict with book keys #for K in iBoo.keys() { lDict.insert(K, (:)) } //--------------------------------------------------------------------------------------------// // Default, 3-char English, "en-3", language // //--------------------------------------------------------------------------------------------// #{ let LANG = "en-3" lDict.at("1001").insert(LANG, ("Gen", "Genesis")) lDict.at("1002").insert(LANG, ("Exo", "Exodus")) lDict.at("1003").insert(LANG, ("Lev", "Leviticus")) lDict.at("1004").insert(LANG, ("Num", "Numbers")) lDict.at("1005").insert(LANG, ("Det", "Deuteronomy")) lDict.at("1101").insert(LANG, ("Jos", "Joshua")) lDict.at("1102").insert(LANG, ("Jdg", "Judges")) lDict.at("1103").insert(LANG, ("Rth", "Ruth")) lDict.at("1104").insert(LANG, ("1Sm", "1 Samuel")) lDict.at("1105").insert(LANG, ("2Sm", "2 Samuel")) lDict.at("1106").insert(LANG, ("1Ki", "1 Kings")) lDict.at("1107").insert(LANG, ("2Ki", "2 Kings")) lDict.at("1108").insert(LANG, ("1Ch", "1 Chronicles")) lDict.at("1109").insert(LANG, ("2Ch", "2 Chronicles")) lDict.at("1110").insert(LANG, ("Ezr", "Ezra")) lDict.at("1111").insert(LANG, ("Neh", "Nehemiah")) lDict.at("1112").insert(LANG, ("Est", "Esther")) lDict.at("1201").insert(LANG, ("Job", "Job")) lDict.at("1202").insert(LANG, ("Psa", "Psalms")) lDict.at("1203").insert(LANG, ("Pro", "Proverbs")) lDict.at("1204").insert(LANG, ("Ecc", "Ecclesiastes")) lDict.at("1205").insert(LANG, ("SOS", "Song of Solomon")) lDict.at("1301").insert(LANG, ("Isa", "Isaiah")) lDict.at("1302").insert(LANG, ("Jer", "Jeremiah")) lDict.at("1303").insert(LANG, ("Lam", "Lamentations")) lDict.at("1304").insert(LANG, ("Eze", "Ezekiel")) lDict.at("1305").insert(LANG, ("Dan", "Daniel")) lDict.at("1306").insert(LANG, ("Hos", "Hosea")) lDict.at("1307").insert(LANG, ("Jol", "Joel")) lDict.at("1308").insert(LANG, ("Ams", "Amos")) lDict.at("1309").insert(LANG, ("Oba", "Obadiah")) lDict.at("1310").insert(LANG, ("Jon", "Jonah")) lDict.at("1311").insert(LANG, ("Mic", "Micah")) lDict.at("1312").insert(LANG, ("Nah", "Nahum")) lDict.at("1313").insert(LANG, ("Hab", "Habakkuk")) lDict.at("1314").insert(LANG, ("Zep", "Zephaniah")) lDict.at("1315").insert(LANG, ("Hag", "Haggai")) lDict.at("1316").insert(LANG, ("Zec", "Zechariah")) lDict.at("1317").insert(LANG, ("Mal", "Malachi")) lDict.at("1401").insert(LANG, ("Mat", "Matthew")) lDict.at("1402").insert(LANG, ("Mrk", "Mark")) lDict.at("1403").insert(LANG, ("Luk", "Luke")) lDict.at("1404").insert(LANG, ("Jhn", "John")) lDict.at("1501").insert(LANG, ("Act", "Acts")) lDict.at("1601").insert(LANG, ("Rom", "Romans")) lDict.at("1602").insert(LANG, ("1Co", "1 Corinthians")) lDict.at("1603").insert(LANG, ("2Co", "2 Corinthians")) lDict.at("1604").insert(LANG, ("Gal", "Galatians")) lDict.at("1605").insert(LANG, ("Eph", "Ephesians")) lDict.at("1606").insert(LANG, ("Php", "Philippians")) lDict.at("1607").insert(LANG, ("Col", "Colossians")) lDict.at("1608").insert(LANG, ("1Th", "1 Thessalonians")) lDict.at("1609").insert(LANG, ("2Th", "2 Thessalonians")) lDict.at("1610").insert(LANG, ("1Ti", "1 Timothy")) lDict.at("1611").insert(LANG, ("2Ti", "2 Timothy")) lDict.at("1612").insert(LANG, ("Tit", "Titus")) lDict.at("1613").insert(LANG, ("Phm", "Philemon")) lDict.at("1700").insert(LANG, ("Heb", "Hebrews")) lDict.at("1701").insert(LANG, ("Jas", "James")) lDict.at("1702").insert(LANG, ("1Pe", "1 Peter")) lDict.at("1703").insert(LANG, ("2Pe", "2 Peter")) lDict.at("1704").insert(LANG, ("1Jn", "1 John")) lDict.at("1705").insert(LANG, ("2Jn", "2 John")) lDict.at("1706").insert(LANG, ("3Jn", "3 John")) lDict.at("1707").insert(LANG, ("Jud", "Jude")) lDict.at("1801").insert(LANG, ("Rev", "Revelation")) lDict.at("3101").insert(LANG, ("1Es", "1 Esdras")) lDict.at("3102").insert(LANG, ("Jdt", "Judith")) lDict.at("3103").insert(LANG, ("Tob", "Tobit")) lDict.at("3104").insert(LANG, ("1Ma", "1 Maccabees")) lDict.at("3105").insert(LANG, ("2Ma", "2 Maccabees")) lDict.at("3106").insert(LANG, ("3Ma", "3 Maccabees")) lDict.at("3107").insert(LANG, ("4Ma", "4 Maccabees")) lDict.at("3108").insert(LANG, ("AEs", "Additions to Esther")) lDict.at("3201").insert(LANG, ("APs", "Additional Psalm")) lDict.at("3202").insert(LANG, ("Ode", "Ode")) lDict.at("3203").insert(LANG, ("Wis", "Wisdom of Solomon")) lDict.at("3204").insert(LANG, ("Sir", "Sirach")) lDict.at("3205").insert(LANG, ("PsS", "Psalms of Solomon")) lDict.at("3206").insert(LANG, ("Bar", "Baruch")) lDict.at("3207").insert(LANG, ("LJe", "Letter of Jeremiah")) lDict.at("3208").insert(LANG, ("Sus", "Susanna")) lDict.at("3209").insert(LANG, ("Bel", "Bel and the Dragon")) lDict.at("3210").insert(LANG, ("Sg3", "Song of Three Youths")) lDict.at("5101").insert(LANG, ("3Es", "3 Esdras")) lDict.at("5102").insert(LANG, ("4Es", "4 Esdras")) lDict.at("5103").insert(LANG, ("PMa", "Prayer of Manasseh")) } //--------------------------------------------------------------------------------------------// // English, Logos bible, "en-logos", language // //--------------------------------------------------------------------------------------------// #{ let LANG = "en-logos" lDict.at("1001").insert(LANG, ("Gen", "Genesis")) lDict.at("1002").insert(LANG, ("Ex", "Exodus")) lDict.at("1003").insert(LANG, ("Lev", "Leviticus")) lDict.at("1004").insert(LANG, ("Num", "Numbers")) lDict.at("1005").insert(LANG, ("Deut", "Deuteronomy")) lDict.at("1101").insert(LANG, ("Josh", "Joshua")) lDict.at("1102").insert(LANG, ("Judg", "Judges")) lDict.at("1103").insert(LANG, ("Ruth", "Ruth")) lDict.at("1104").insert(LANG, ("1Sam", "1 Samuel")) lDict.at("1105").insert(LANG, ("2Sam", "2 Samuel")) lDict.at("1106").insert(LANG, ("1Kings", "1 Kings")) lDict.at("1107").insert(LANG, ("2Kings", "2 Kings")) lDict.at("1108").insert(LANG, ("1Chron", "1 Chronicles")) lDict.at("1109").insert(LANG, ("2Chron", "2 Chronicles")) lDict.at("1110").insert(LANG, ("Ezra", "Ezra")) lDict.at("1111").insert(LANG, ("Neh", "Nehemiah")) lDict.at("1112").insert(LANG, ("Est", "Esther")) lDict.at("1201").insert(LANG, ("Job", "Job")) lDict.at("1202").insert(LANG, ("Ps", "Psalms")) lDict.at("1203").insert(LANG, ("Prov", "Proverbs")) lDict.at("1204").insert(LANG, ("Eccles", "Ecclesiastes")) lDict.at("1205").insert(LANG, ("Song", "Song of Solomon")) lDict.at("1301").insert(LANG, ("Isa", "Isaiah")) lDict.at("1302").insert(LANG, ("Jer", "Jeremiah")) lDict.at("1303").insert(LANG, ("Lam", "Lamentations")) lDict.at("1304").insert(LANG, ("Ezek", "Ezekiel")) lDict.at("1305").insert(LANG, ("Dan", "Daniel")) lDict.at("1306").insert(LANG, ("Hos", "Hosea")) lDict.at("1307").insert(LANG, ("Joel", "Joel")) lDict.at("1308").insert(LANG, ("Amos", "Amos")) lDict.at("1309").insert(LANG, ("Obad", "Obadiah")) lDict.at("1310").insert(LANG, ("Jonah", "Jonah")) lDict.at("1311").insert(LANG, ("Mic", "Micah")) lDict.at("1312").insert(LANG, ("Nah", "Nahum")) lDict.at("1313").insert(LANG, ("Hab", "Habakkuk")) lDict.at("1314").insert(LANG, ("Zeph", "Zephaniah")) lDict.at("1315").insert(LANG, ("Hag", "Haggai")) lDict.at("1316").insert(LANG, ("Zech", "Zechariah")) lDict.at("1317").insert(LANG, ("Mal", "Malachi")) lDict.at("1401").insert(LANG, ("Matt", "Matthew")) lDict.at("1402").insert(LANG, ("Mark", "Mark")) lDict.at("1403").insert(LANG, ("Luke", "Luke")) lDict.at("1404").insert(LANG, ("John", "John")) lDict.at("1501").insert(LANG, ("Acts", "Acts")) lDict.at("1601").insert(LANG, ("Rom", "Romans")) lDict.at("1602").insert(LANG, ("1Cor", "1 Corinthians")) lDict.at("1603").insert(LANG, ("2Cor", "2 Corinthians")) lDict.at("1604").insert(LANG, ("Gal", "Galatians")) lDict.at("1605").insert(LANG, ("Eph", "Ephesians")) lDict.at("1606").insert(LANG, ("Phil", "Philippians")) lDict.at("1607").insert(LANG, ("Col", "Colossians")) lDict.at("1608").insert(LANG, ("1Thess", "1 Thessalonians")) lDict.at("1609").insert(LANG, ("2Thess", "2 Thessalonians")) lDict.at("1610").insert(LANG, ("1Tim", "1 Timothy")) lDict.at("1611").insert(LANG, ("2Tim", "2 Timothy")) lDict.at("1612").insert(LANG, ("Titus", "Titus")) lDict.at("1613").insert(LANG, ("Philem", "Philemon")) lDict.at("1700").insert(LANG, ("Heb", "Hebrews")) lDict.at("1701").insert(LANG, ("James", "James")) lDict.at("1702").insert(LANG, ("1Pet", "1 Peter")) lDict.at("1703").insert(LANG, ("2Pet", "2 Peter")) lDict.at("1704").insert(LANG, ("1John", "1 John")) lDict.at("1705").insert(LANG, ("2John", "2 John")) lDict.at("1706").insert(LANG, ("3John", "3 John")) lDict.at("1707").insert(LANG, ("Jude", "Jude")) lDict.at("1801").insert(LANG, ("Rev", "Revelation")) lDict.at("3101").insert(LANG, ("1Esd", "1 Esdras")) lDict.at("3102").insert(LANG, ("Jth", "Judith")) lDict.at("3103").insert(LANG, ("Tob", "Tobit")) lDict.at("3104").insert(LANG, ("1Macc", "1 Maccabees")) lDict.at("3105").insert(LANG, ("2Macc", "2 Maccabees")) lDict.at("3106").insert(LANG, ("3Macc", "3 Maccabees")) lDict.at("3107").insert(LANG, ("4Macc", "4 Maccabees")) lDict.at("3108").insert(LANG, ("AddEsth", "Additions to Esther")) lDict.at("3201").insert(LANG, ("AddPsalm", "Additional Psalm")) lDict.at("3202").insert(LANG, ("Ode", "Ode")) lDict.at("3203").insert(LANG, ("WisdOfSol", "Wisdom of Solomon")) lDict.at("3204").insert(LANG, ("Sir", "Sirach")) lDict.at("3205").insert(LANG, ("PsSolomon", "Psalms of Solomon")) lDict.at("3206").insert(LANG, ("Bar", "Baruch")) lDict.at("3207").insert(LANG, ("EpJer", "Letter of Jeremiah")) lDict.at("3208").insert(LANG, ("Sus", "Susanna")) lDict.at("3209").insert(LANG, ("BelAndDr", "Bel and the Dragon")) lDict.at("3210").insert(LANG, ("SgOf3", "Song of Three Youths")) lDict.at("5101").insert(LANG, ("3Esd", "3 Esdras")) lDict.at("5102").insert(LANG, ("4Esd", "4 Esdras")) lDict.at("5103").insert(LANG, ("PrOfMan", "Prayer of Manasseh")) } //--------------------------------------------------------------------------------------------// // Brazilian Portuguese, Protestant, "br-pro", language // //--------------------------------------------------------------------------------------------// #{ let LANG = "br-pro" lDict.at("1001").insert(LANG, ("Gn", "Gênesis")) lDict.at("1002").insert(LANG, ("Êx", "Êxodo")) lDict.at("1003").insert(LANG, ("Lv", "Levítico")) lDict.at("1004").insert(LANG, ("Nm", "Números")) lDict.at("1005").insert(LANG, ("Dt", "Deuteronômio")) lDict.at("1101").insert(LANG, ("Js", "Josué")) lDict.at("1102").insert(LANG, ("Jz", "Juízes")) lDict.at("1103").insert(LANG, ("Rt", "Rute")) lDict.at("1104").insert(LANG, ("1Sm", "1 Samuel")) lDict.at("1105").insert(LANG, ("2Sm", "2 Samuel")) lDict.at("1106").insert(LANG, ("1Rs", "1 Reis")) lDict.at("1107").insert(LANG, ("2Rs", "2 Reis")) lDict.at("1108").insert(LANG, ("1Cr", "1 Crônicas")) lDict.at("1109").insert(LANG, ("2Cr", "2 Crônicas")) lDict.at("1110").insert(LANG, ("Ed", "Esdras")) lDict.at("1111").insert(LANG, ("Ne", "Neemias")) lDict.at("1112").insert(LANG, ("Et", "Ester")) lDict.at("1201").insert(LANG, ("Jó", "Jó")) lDict.at("1202").insert(LANG, ("Sl", "Salmos")) lDict.at("1203").insert(LANG, ("Pv", "Provérbios")) lDict.at("1204").insert(LANG, ("Ec", "Eclesiastes")) lDict.at("1205").insert(LANG, ("Ct", "Cântico dos Cânticos")) lDict.at("1301").insert(LANG, ("Is", "Isaías")) lDict.at("1302").insert(LANG, ("Jr", "Jeremias")) lDict.at("1303").insert(LANG, ("Lm", "Lamentações")) lDict.at("1304").insert(LANG, ("Ez", "Ezequiel")) lDict.at("1305").insert(LANG, ("Dn", "Daniel")) lDict.at("1306").insert(LANG, ("Os", "Oséias")) lDict.at("1307").insert(LANG, ("Jl", "Joel")) lDict.at("1308").insert(LANG, ("Am", "Amos")) lDict.at("1309").insert(LANG, ("Ob", "Obadias")) lDict.at("1310").insert(LANG, ("Jn", "Jonas")) lDict.at("1311").insert(LANG, ("Mq", "Miquéias")) lDict.at("1312").insert(LANG, ("Na", "Naum")) lDict.at("1313").insert(LANG, ("Hc", "Habacuc")) lDict.at("1314").insert(LANG, ("Sf", "Sofonias")) lDict.at("1315").insert(LANG, ("Ag", "Ageu")) lDict.at("1316").insert(LANG, ("Zc", "Zacarias")) lDict.at("1317").insert(LANG, ("Ml", "Malaquias")) lDict.at("1401").insert(LANG, ("Mt", "Mateus")) lDict.at("1402").insert(LANG, ("Mc", "Marcos")) lDict.at("1403").insert(LANG, ("Lc", "Lucas")) lDict.at("1404").insert(LANG, ("Jo", "João")) lDict.at("1501").insert(LANG, ("At", "<NAME> Apóstolos")) lDict.at("1601").insert(LANG, ("Rm", "Romanos")) lDict.at("1602").insert(LANG, ("1Co", "1 Coríntios")) lDict.at("1603").insert(LANG, ("2Co", "2 Coríntios")) lDict.at("1604").insert(LANG, ("Gl", "Gálatas")) lDict.at("1605").insert(LANG, ("Ef", "Efésios")) lDict.at("1606").insert(LANG, ("Fp", "Filipenses")) lDict.at("1607").insert(LANG, ("Cl", "Colossenses")) lDict.at("1608").insert(LANG, ("1Ts", "1 Tessalonicenses")) lDict.at("1609").insert(LANG, ("2Ts", "2 Tessalonicenses")) lDict.at("1610").insert(LANG, ("1Tm", "1 Timóteo")) lDict.at("1611").insert(LANG, ("2Tm", "2 Timóteo")) lDict.at("1612").insert(LANG, ("Tt", "Tito")) lDict.at("1613").insert(LANG, ("Fm", "Filemon")) lDict.at("1700").insert(LANG, ("Hb", "Hebreus")) lDict.at("1701").insert(LANG, ("Tg", "Tiago")) lDict.at("1702").insert(LANG, ("1Pe", "1 Pedro")) lDict.at("1703").insert(LANG, ("2Pe", "2 Pedro")) lDict.at("1704").insert(LANG, ("1Jo", "1 João")) lDict.at("1705").insert(LANG, ("2Jo", "2 João")) lDict.at("1706").insert(LANG, ("3Jo", "3 João")) lDict.at("1707").insert(LANG, ("Jd", "Judas")) lDict.at("1801").insert(LANG, ("Ap", "Apocalipse")) lDict.at("3101").insert(LANG, ("1Ed", "1 Esdras")) lDict.at("3102").insert(LANG, ("Jt", "Judite")) lDict.at("3103").insert(LANG, ("Tb", "Tobias")) lDict.at("3104").insert(LANG, ("1Mc", "1 Macabeus")) lDict.at("3105").insert(LANG, ("2Mc", "2 Macabeus")) lDict.at("3106").insert(LANG, ("3Mc", "3 Macabeus")) lDict.at("3107").insert(LANG, ("4Mc", "4 Macabeus")) lDict.at("3108").insert(LANG, ("EG", "Ester (Grego)")) lDict.at("3201").insert(LANG, ("SA", "Salmo Adicional")) lDict.at("3202").insert(LANG, ("Od", "Odes")) lDict.at("3203").insert(LANG, ("Sb", "Sabedoria (de Salomão)")) lDict.at("3204").insert(LANG, ("Si", "Sirácida (Eclesiástico)")) lDict.at("3205").insert(LANG, ("SS", "Salmos de Salomão")) lDict.at("3206").insert(LANG, ("Ba", "Baruque")) lDict.at("3207").insert(LANG, ("CJ", "Cart<NAME> Jeremias")) lDict.at("3208").insert(LANG, ("Su", "Susana")) lDict.at("3209").insert(LANG, ("BD", "Bel e o Dragão")) lDict.at("3210").insert(LANG, ("TJ", "Canção dos Três Jovens")) lDict.at("5101").insert(LANG, ("3Ed", "3 Esdras")) lDict.at("5102").insert(LANG, ("4Ed", "4 Esdras")) lDict.at("5103").insert(LANG, ("OM", "Oração de Manassés")) } //--------------------------------------------------------------------------------------------// // Brazilian Portuguese, Catholic, "br-cat", language // //--------------------------------------------------------------------------------------------// #{ let LANG = "br-cat" lDict.at("1001").insert(LANG, ("Gn", "Gênesis")) lDict.at("1002").insert(LANG, ("Ex", "Êxodo")) lDict.at("1003").insert(LANG, ("Lv", "Levítico")) lDict.at("1004").insert(LANG, ("Nm", "Números")) lDict.at("1005").insert(LANG, ("Dt", "Deuteronômio")) lDict.at("1101").insert(LANG, ("Js", "Josué")) lDict.at("1102").insert(LANG, ("Jz", "Juízes")) lDict.at("1103").insert(LANG, ("Rt", "Rute")) lDict.at("1104").insert(LANG, ("1Sm", "1 Samuel")) lDict.at("1105").insert(LANG, ("2Sm", "2 Samuel")) lDict.at("1106").insert(LANG, ("1Rs", "1 Reis")) lDict.at("1107").insert(LANG, ("2Rs", "2 Reis")) lDict.at("1108").insert(LANG, ("1Cr", "1 Crônicas")) lDict.at("1109").insert(LANG, ("2Cr", "2 Crônicas")) lDict.at("1110").insert(LANG, ("Esd", "Esdras")) lDict.at("1111").insert(LANG, ("Ne", "Neemias")) lDict.at("3103").insert(LANG, ("Tb", "Tobias")) lDict.at("3102").insert(LANG, ("Jt", "Judite")) lDict.at("1112").insert(LANG, ("Est", "Ester")) lDict.at("3108").insert(LANG, ("Est", "Ester (Grego)")) // Same abbr due to book merging lDict.at("3104").insert(LANG, ("1Mc", "1 Macabeus")) lDict.at("3105").insert(LANG, ("2Mc", "2 Macabeus")) lDict.at("1201").insert(LANG, ("Jó", "Jó")) lDict.at("1202").insert(LANG, ("Sl", "Salmos")) lDict.at("1203").insert(LANG, ("Pr", "Provérbios")) lDict.at("1204").insert(LANG, ("Ecl", "Eclesiastes")) lDict.at("1205").insert(LANG, ("Ct", "Cântico dos Cânticos")) lDict.at("3203").insert(LANG, ("Sb", "Sabedoria")) lDict.at("3204").insert(LANG, ("Eclo", "Eclesiástico")) lDict.at("1301").insert(LANG, ("Is", "Isaías")) lDict.at("1302").insert(LANG, ("Jr", "Jeremias")) lDict.at("1303").insert(LANG, ("Lm", "Lamentações")) lDict.at("3206").insert(LANG, ("Br", "Baruc")) lDict.at("3207").insert(LANG, ("Br", "<NAME>")) // book merging lDict.at("1304").insert(LANG, ("Ez", "Ezequiel")) lDict.at("1305").insert(LANG, ("Dn", "Daniel")) lDict.at("3210").insert(LANG, ("Dn", "Canção dos Três Jovens")) // book merging lDict.at("3208").insert(LANG, ("Dn", "Susana")) // book merging lDict.at("3209").insert(LANG, ("Dn", "Bel e o Dragão")) // book merging lDict.at("1306").insert(LANG, ("Os", "Oséias")) lDict.at("1307").insert(LANG, ("Jl", "Joel")) lDict.at("1308").insert(LANG, ("Am", "Amos")) lDict.at("1309").insert(LANG, ("Ab", "Abdias")) lDict.at("1310").insert(LANG, ("Jn", "Jonas")) lDict.at("1311").insert(LANG, ("Mq", "Miquéias")) lDict.at("1312").insert(LANG, ("Na", "Naum")) lDict.at("1313").insert(LANG, ("Hab", "Habacuc")) lDict.at("1314").insert(LANG, ("Sf", "Sofonias")) lDict.at("1315").insert(LANG, ("Ag", "Ageu")) lDict.at("1316").insert(LANG, ("Zc", "Zacarias")) lDict.at("1317").insert(LANG, ("Ml", "Malaquias")) lDict.at("1401").insert(LANG, ("Mt", "Mateus")) lDict.at("1402").insert(LANG, ("Mc", "Marcos")) lDict.at("1403").insert(LANG, ("Lc", "Lucas")) lDict.at("1404").insert(LANG, ("Jo", "João")) lDict.at("1501").insert(LANG, ("At", "Atos dos Apóstolos")) lDict.at("1601").insert(LANG, ("Rm", "Romanos")) lDict.at("1602").insert(LANG, ("1Cor", "1 Coríntios")) lDict.at("1603").insert(LANG, ("2Cor", "2 Coríntios")) lDict.at("1604").insert(LANG, ("Gl", "Gálatas")) lDict.at("1605").insert(LANG, ("Ef", "Efésios")) lDict.at("1606").insert(LANG, ("Fl", "Filipenses")) lDict.at("1607").insert(LANG, ("Cl", "Colossenses")) lDict.at("1608").insert(LANG, ("1Ts", "1 Tessalonicenses")) lDict.at("1609").insert(LANG, ("2Ts", "2 Tessalonicenses")) lDict.at("1610").insert(LANG, ("1Tm", "1 Timóteo")) lDict.at("1611").insert(LANG, ("2Tm", "2 Timóteo")) lDict.at("1612").insert(LANG, ("Tt", "Tito")) lDict.at("1613").insert(LANG, ("Fm", "Filemon")) lDict.at("1700").insert(LANG, ("Hb", "Hebreus")) lDict.at("1701").insert(LANG, ("Tg", "Tiago")) lDict.at("1702").insert(LANG, ("1Pd", "1 Pedro")) lDict.at("1703").insert(LANG, ("2Pd", "2 Pedro")) lDict.at("1704").insert(LANG, ("1Jo", "1 João")) lDict.at("1705").insert(LANG, ("2Jo", "2 João")) lDict.at("1706").insert(LANG, ("3Jo", "3 João")) lDict.at("1707").insert(LANG, ("Jd", "Judas")) lDict.at("1801").insert(LANG, ("Ap", "Apocalipse")) lDict.at("3101").insert(LANG, ("1Esd", "1 Esdras")) lDict.at("3106").insert(LANG, ("3Mc", "3 Macabeus")) lDict.at("3107").insert(LANG, ("4Mc", "4 Macabeus")) lDict.at("5101").insert(LANG, ("3Esd", "3 Esdras")) lDict.at("5102").insert(LANG, ("4Esd", "4 Esdras")) lDict.at("5103").insert(LANG, ("PrM", "Prece de Manassés")) lDict.at("3201").insert(LANG, ("SlA", "Salmo Adicional")) lDict.at("3202").insert(LANG, ("Ode", "Odes")) lDict.at("3205").insert(LANG, ("SlS", "Salmos de Salomão")) }
https://github.com/PuntitOwO/template-informe-memoria-fcfm
https://raw.githubusercontent.com/PuntitOwO/template-informe-memoria-fcfm/main/example.typ
typst
MIT License
#import "conf.typ": conf, guia, pronombre #let mostrar_guias = true #show: conf.with( titulo: "El Título de mi Tema", autor: (nombre: "<NAME>", pronombre: pronombre.elle), profesores: ((nombre: "<NAME>", pronombre: pronombre.el),), coguias: ((nombre: "<NAME>", pronombre: pronombre.ella),), supervisor: (nombre: "<NAME>", pronombre: pronombre.ella), anno: "2023", espaciado_titulo: 2fr, ) #guia(visible: mostrar_guias)[Se debe quitar todas las guías (estas cajas grises) antes de entregar el documento. Para ello, se debe cambiar el valor de la variable `mostrar_guias` a `false` en la segunda línea del archivo. Además, hay que reemplazar los datos de la portada en los parámetros de la función `conf` en la línea 3 del archivo. Los parámetros que acepta la función `conf` son: - título: El título del tema. - autor: Un diccionario con campos `nombre` y `pronombre`. Para los pronombres, importar el diccionario `pronombre` desde `conf.typ`. Los valores disponibles son `pronombre.el`, `pronombre.ella` y `pronombre.elle`. - informe: `false` si es la propuesta de tema, `true` si es el informe final. - codigo: Omitir si es la propuesta de tema. Si es el informe final, colocar el código del ramo. (CC6908 para malla v3, CC6907 para malla v5) - modalidad: Puede ser \"Memoria\", \"Práctica extendida\", \"Titulación con Magíster\" o \"Doble Titulación de Dos Especialidades\" - profesores: Lista de profesores guías. Cada elemento de la lista es un diccionario con campos `nombre` y `pronombre`. Si es un solo elemento, recordar poner una coma al final: `(dict_guia,)` - supervisor: Información del supervisor en caso de práctica extendida. Es un diccionario con campos `nombre` y `pronombre`. - anno: Año en que se entrega el informe. Por defecto se usa el año actual. - espaciado_titulo: Espaciado extra antes del título y al rededor de autor. Por defecto es `1fr`. Se puede usar `2fr` para un espaciado doble, `3fr` para un espaciado triple, etc. Como aproximación, se espera que la propuesta sea de 5 a 10 páginas. No es necesario poner texto antes de la introducción.] = Introducción #guia(visible: mostrar_guias)[Dar una introducción al contexto del tema. Explicar, en términos generales, el problema abordado. Motivar la necesidad, la importancia y/o el valor de tener una (mejor) solución al problema. En el caso de la práctica extendida, incluir detalles de la organización, su quehacer, el equipo y el supervisor con los cuales se va a trabajar, la relevancia del problema a la organización, etc. (1 a 2 páginas)] = Situación Actual #guia(visible: mostrar_guias)[Discutir las soluciones o recursos existentes relacionados con el problema. Justificar por qué es necesario un trabajo novedoso. (1 a 2 páginas)] Ejemplos de referencias: - Conferencia: @CorlessJK97 // azucar sintactica para #cite("CorlessJK97") - Revista y Tesis: #cite("NewmanT42", "Turing38") // para citas múltiples se usa #cite = Objetivos #guia(visible: mostrar_guias)[Describir las _metas_ del trabajo. Hay que contestar acá: ¿_qué_ quieres lograr? (La sección que sigue contestará la pregunta: ¿_cómo_ lo vas a lograr?) Ejemplos de metas: lograr que X sea (más) eficiente, usable, seguro, completo, preciso, barato, informativo, posible por primera vez, etc. Ejemplos de _no_ metas: implementar algo en Javascript, aplicar modelo Y sobre los datos, etc. (Estas cosas van en la descripción de la *Solución propuesta*.) Los objetivos deberían ser específicos, medibles, alcanzables y relevantes al problema (ver la clase 2). El plan de trabajo debería argumentar que sean acotados en tiempo (un semestre). Al final del trabajo, debería ser factible saber si se ha logrado los objetivos enumerados acá, o saber cuán bien se han logrado, o no. Por ejemplo, si la meta es tener algo eficiente en términos de tiempo, debería haber una forma de evaluar o estudiar los tiempos. Acá tendrás que definir la forma general en que se podrá evaluar el trabajo. (No hay que poner texto acá. Se puede empezar directamente con el objetivo general.)] == Objetivo General #guia(visible: mostrar_guias)[ Un _resumen conciso_ (no más de un párrafo) de la meta principal del trabajo, es decir, qué quieres lograr con el trabajo (o qué significa \"éxito\" en el contexto del trabajo). El objetivo debería ser específico, medible, alcanzable, relevante al problema, y acotado en tiempo. (\"Titularse\" no es una repuesta válida. :\))] == Objetivos Específicos #guia(visible: mostrar_guias)[ Una _lista_ de los hitos principales que se quieren lograr para (intentar) cumplir con el objetivo general. Divide el objetivo general en varios hitos que formarán las etapas del trabajo. Cada objetivo debería ser específico, medible, alcanzable, relevante al problema, y acotado en tiempo. No se debería escribir más de un párrafo por hito. Los objetivos específicos deberían \"sumar\" al objetivo general. (Una lista de 3 a 7 párrafos)] + ... + ... == Evaluación #guia(visible: mostrar_guias)[ Describe cómo vas a poder evaluar el trabajo en términos de cuán bien cumple con los objetivos planteados. Se pueden discutir los datos, las medidas, los usuarios, las técnicas, etc., utilizables para la evaluación. (1 a 2 párrafos)] = Solución Propuesta #guia(visible: mostrar_guias)[ Una descripción general de la solución propuesta: los datos, las técnicas, las tecnologías, las herramientas, los lenguajes, los marcos, etc., que se usarán para intentar lograr los objetivos planteados. Aquí hay que contestar la pregunta: ¿_cómo_ vas a lograr los objetivos planteados? Aquí, sí, está muy bien hablar de Javascript, CNNs, Numpy, Django, índices invertidos, árboles wavelet, privacidad diferencial, PageRank, Diffie--Hellman, triangulaciones de Delaunay, CUDA, Postgres, etc. (1 a 2 páginas)] = Plan de Trabajo (Preliminar) #guia(visible: mostrar_guias)[ Aquí se puede dar una lista preliminar de los pasos que se van a seguir para desarrollar la solución propuesta. La lista debería contemplar la evaluación del trabajo y la escritura del informe final del trabajo de título (memoria o práctica extendida). Siendo un plan preliminar, su propósito es dar una mejor idea de la factibilidad del tema y el trabajo que implica, pero se pueden aplicar cambios al plan para el informe final de este curso. (0.5 a 2 páginas)] + ... + ... #bibliography( "bibliografia.yml", title: "Referencias", style: "ieee", )
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/valkyrie/0.1.0/src/types/dictionary.typ
typst
Apache License 2.0
#import "../base-type.typ": base-type, assert-base-type-dictionary #import "../context.typ": context /// Valkyrie schema generator for dictionary types /// /// - ..args (schema): Variadic named arguments, the values for which are schema types. *MUST* not contain positional arguments. /// -> schema #let dictionary( ..args ) = { // Does not accept positional arguments assert( args.pos().len() == 0, message: "Dictionary only accepts named arguments") args = args.named() assert-base-type-dictionary(args) return (:..base-type(), name: "dictionary", dictionary-schema: args, validate: (self, dict, ctx: context(), scope: ("arguments",) ) => { // assert type if not (self.assert-type)(self, dict, scope: scope, ctx: ctx, types: (type((:)),)){ return none } // If strict mode, ensure dictionary exactly matches schema if ( ctx.strict ) { for (key, value) in self.dictionary-schema { if ( key not in dict ){ (self.fail-validation)(self, dict, ctx: ctx, scope: (..scope, key), message: "Missing expected dictionary entry") } } } // Check elements for (key, schema) in self.dictionary-schema{ dict.at(key) = (schema.validate)(schema, dict.at(key), ctx: ctx, scope: (..scope, str(key))) } return dict } ) }
https://github.com/Quaternijkon/Typst_USTC_CS
https://raw.githubusercontent.com/Quaternijkon/Typst_USTC_CS/main/content.typ
typst
#import "config.typ": * #outline-slide() = 第一章:样式 == 想分列显示? // #slide[ // 第一列 // ][ // 第二列 // ] #slide(composer: (1fr,1fr, auto))[ #Colorful[GOOGLE]. ][ *Second column.第二列* ][ #figure( image("./assets/img/brand-rust.svg", width: 30%), caption: [Rust logo], ) ] == 表格 //表格内容设置在main.typ中 #let a = table.cell( fill: green.lighten(60%), )[A] #let b = table.cell( fill: aqua.lighten(60%), )[B] #table( columns: 4, [], [Exam 1], [Exam 2], [Exam 3], [John], [], a, [], [Mary], [], a, a, [Robert], b, a, b, ) = 第二章:小组件 == 时间轴,很简单 //timeliney: https://typst.app/universe/package/timeliney #timeliney.timeline( show-grid: true, { import timeliney: * headerline(group(([*2023*], 4)), group(([*2024*], 4))) headerline( group(..range(4).map(n => strong("Q" + str(n + 1)))), group(..range(4).map(n => strong("Q" + str(n + 1)))), ) taskgroup(title: [*Research*], { task("Research the market", (0, 2), style: (stroke: 2pt + gray)) task("Conduct user surveys", (1, 3), style: (stroke: 2pt + gray)) }) taskgroup(title: [*Development*], { task("Create mock-ups", (2, 3), style: (stroke: 2pt + gray)) task("Develop application", (3, 5), style: (stroke: 2pt + gray)) task("QA", (3.5, 6), style: (stroke: 2pt + gray)) }) taskgroup(title: [*Marketing*], { task("Press demos", (3.5, 7), style: (stroke: 2pt + gray)) task("Social media advertising", (6, 7.5), style: (stroke: 2pt + gray)) }) milestone( at: 3.75, style: (stroke: (dash: "dashed")), align(center, [ *Conference demo*\ Dec 2023 ]) ) milestone( at: 6.5, style: (stroke: (dash: "dashed")), align(center, [ *App store launch*\ Aug 2024 ]) ) } ) == 代码块,很优雅 #slide[ ```typc pub fn main() { println!("Hello, world!"); } ``` ][ //codly: https://typst.app/universe/package/codly ```rust pub fn main() { println!("Hello, world!"); } ``` ] == 用节点和箭头绘制图表 #slide[ #set text(size: .5em,) ```typc #diagram(cell-size: 15mm, $ G edge(f, ->) edge("d", pi, ->>) & im(f) \ G slash ker(f) edge("ur", tilde(f), "hook-->") $) ``` ][ #align(center,{ diagram(cell-size: 15mm, $ G edge(f, ->) edge("d", pi, ->>) & im(f) \ G slash ker(f) edge("ur", tilde(f), "hook-->") $) }) ] #slide[ #set text(size: .5em,) ```typc #import fletcher.shapes: diamond #set text(font: "Comic Neue", weight: 600) #diagram( node-stroke: 1pt, edge-stroke: 1pt, node((0,0), [Start], corner-radius: 2pt, extrude: (0, 3)), edge("-|>"), node((0,1), align(center)[ Hey, wait,\ this flowchart\ is a trap! ], shape: diamond), edge("d,r,u,l", "-|>", [Yes], label-pos: 0.1) ) ``` ][ #align(center,{ import fletcher.shapes: diamond set text(font: "Comic Neue", weight: 600) diagram( node-stroke: 1pt, edge-stroke: 1pt, node((0,0), [Start], corner-radius: 2pt, extrude: (0, 3)), edge("-|>"), node((0,1), align(center)[ Hey, wait,\ this flowchart\ is a trap! ], shape: diamond), edge("d,r,u,l", "-|>", [Yes], label-pos: 0.1) ) }) ] #slide[ #set text(size: .5em,) ```typc #set text(10pt) #diagram( node-stroke: .1em, node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%), spacing: 4em, edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center), node((0,0), `reading`, radius: 2em), edge(`read()`, "-|>"), node((1,0), `eof`, radius: 2em), edge(`close()`, "-|>"), node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)), edge((0,0), (0,0), `read()`, "--|>", bend: 130deg), edge((0,0), (2,0), `close()`, "-|>", bend: -40deg), ) ``` ][ #align(center,{ set text(10pt) diagram( node-stroke: .1em, node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%), spacing: 4em, edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center), node((0,0), `reading`, radius: 2em), edge(`read()`, "-|>"), node((1,0), `eof`, radius: 2em), edge(`close()`, "-|>"), node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)), edge((0,0), (0,0), `read()`, "--|>", bend: 130deg), edge((0,0), (2,0), `close()`, "-|>", bend: -40deg), ) }) ] #slide[ #set text(size: .5em) ```typc #diagram(cell-size: 15mm, $ G edge(f, ->) edge("d", pi, ->>) & im(f) \ G slash ker(f) edge("ur", tilde(f), "hook-->") $) ``` ][ #align(center,{ diagram(cell-size: 15mm, $ G edge(f, ->) edge("d", pi, ->>) & im(f) \ G slash ker(f) edge("ur", tilde(f), "hook-->") $) }) ] == 展示框,很有趣 #slide[ #set text(size: .5em) ```typc #showybox( [Hello world!] ) ``` ```typc showybox( frame: ( dash: "dashed", border-color: red.darken(40%) ), body-style: ( align: center ), sep: ( dash: "dashed" ), shadow: ( offset: (x: 2pt, y: 3pt), color: yellow.lighten(70%) ), [This is an important message!], [Be careful outside. There are dangerous bananas!] ) ``` ][ #align(center,{ showybox( [Hello world!] ) showybox( frame: ( dash: "dashed", border-color: red.darken(40%) ), body-style: ( align: center ), sep: ( dash: "dashed" ), shadow: ( offset: (x: 2pt, y: 3pt), color: yellow.lighten(70%) ), [This is an important message!], [Be careful outside. There are dangerous bananas!] ) }) ] == 提示框 #slide[ #set text(size: .5em) ```typc #info[ This is the info clue ... ] #tip(title: "Best tip ever")[Check out this cool package] ``` ][ #align(center,{ info[ This is the info clue ... ] tip(title: "Best tip ever")[Check out this cool package] }) ] == 类obsidian #info[This is information] #success[I'm making a note here: huge success] #check[This is checked!] #warning[First warning...] #note[My incredibly useful note] #question[Question?] #example[An example make things interesting] #quote[To be or not to be] #callout( title: "Callout", fill: blue, title-color: white, body-color: black, icon: none)[123] #let mycallout = callout.with(title: "My callout")//TODO:放到config中去 #mycallout[Hey this is my custom callout!] = 第三章:页面 // == focus-slide // #focus-slide[ // 聚焦页 // ] // == matrix-slide // #matrix-slide[ // left // ][ // middle // ][ // right // ] // #matrix-slide(columns: 1)[ // top // ][ // bottom // ] // #matrix-slide(columns: (1fr, 2fr, 1fr), ..(lorem(8),) * 9) == demo页 // #BlueBox(title: "你好")[bubu] == 致谢 #ending-slide[ #align(center + horizon)[ #set text(size: 3em, weight: "bold", s.colors.primary) THANKS FOR ALL 敬请指正! ] ]
https://github.com/dashuai009/dashuai009.github.io
https://raw.githubusercontent.com/dashuai009/dashuai009.github.io/main/src/content/blog/004/004.typ
typst
#let date = datetime( year: 2022, month: 5, day: 1, ) #metadata(( "title": "ToDo", "author": "dashuai009", description: "", pubDate: date.display(), subtitle: [kotlin,Android], ))<frontmatter> #import "../../__template/style.typ": conf #show: conf #date.display(); = 相关技术 == kotlin 在Google I/O 2017中,Google 宣布 Kotlin 成为 Android官方开发语言。官方文档中,java和kotlin是并列出现的。作为一种新型语言,相比与java, 它有以下优势: 1. 简洁:大大减少样板代码的数量(没有new关键字,没有分号等)。 2. 安全: 避免空指针异常等整个类的错误。 3. 互操作性: 充分利用 JVM、Android 和浏览器的现有库。 4. 工具友好: 可用任何 Java IDE 或者使用命令行构建。 == room可持久库 Room 在 SQLite 上提供了一个抽象层,以便在充分利用 SQLite的强大功能的同时,能够流畅地访问数据库。更重要的,**Google官方强烈建议我们使用Room(而不是SQLite)**。 Room 包含 3 个主要组件: 1. 数据库:包含数据库持有者,并作为应用已保留的持久关系型数据的底层连接的主要接入点。 使用 `@Database` 注释的类应满足以下条件: - 是扩展 RoomDatabase 的抽象类。 - 在注释中添加与数据库关联的实体列表。 - 包含具有 0 个参数且返回使用`@Dao` 注释的类的抽象方法。 在运行时,您可以通过调用 `Room.databaseBuilder()` 或`Room.inMemoryDatabaseBuilder()` 获取 `Database` 的实例。 2. Entity:表示数据库中的表。 3. DAO:包含用于访问数据库的方法。 应用使用 Room 数据库来获取与该数据库关联的数据访问对象(DAO)。然后,应用使用每个 DAO从数据库中获取实体,然后再将对这些实体的所有更改保存回数据库中。最后,应用使用实体来获取和设置与数据库中的表列相对应的值。 Room 不同组件之间的关系如图 1 所示: ![Room 架构图](https://blog-picture-1305172231.cos.ap-beijing.myqcloud.com/4/room_architecture.png) == Android架构 在大多数情况下,桌面应用将桌面或程序启动器当做单个入口点,然后作为单个整体流程运行。Android应用则不然,它们的结构要复杂得多。典型的 Android应用包含多个应用组件,包括Activity、Fragment、Service、内容提供程序和广播接收器。 移动设备的资源也很有限,因此操作系统可能会随时终止某些应用进程,以便为新的进程腾出空间。 鉴于这种环境条件,应用组件可以不按顺序地单独启动,并且操作系统或用户可以随时销毁它们。由于这些事件不受您的控制,因此**我们不应在应用组件中存储任何应用数据或状态**,并且应 用组件不应相互依赖。 == 常见的架构原则 === 分离关注点 要遵循的最重要的原则是**分离关注点**。 一种常见的错误是在一个 Activity或 Fragment 中编写所有代码。这些基于界面的类应仅包含处理界面和操作系统交互的逻辑。应使这些类尽可能保 持精简,这样可以避免许多与生命周期相关的问题。 请注意,我们并非拥有 Activity 和 Fragment 的实现; 它们只是表示 Android操作系统与应用之间关系的粘合类。操作系统可能会根据用户互动或因内存不足等系统条件随时销毁它们。为了提供令人满意的用户体验和更易于管理的应用维护体验,最好尽量减少对它们的依赖。 === 通过模型驱动界面 另一个重要原则是您应该通过模型驱动界面(最好是持久性模型)。模型是负责处理应用数据的组件。它们独立于应用中的View 对象和应用组件,因此不受应用的生命周期以及相关的关注点的影响。 持久性是理想之选,原因如下: - 如果 Android 操作系统销毁应用以释放资源,用户不会丢失数据。 - 当网络连接不稳定或不可用时,应用会继续工作。 应用所基于的模型类应明确定义数据管理职责,这样将使应用更可测试且更一致。 == ToDo的应用结构 Google官方推荐如下架构,在我的ToDo应用中也实现了如下架构,非常amazing。 ![ToDo架构图](https://blog-picture-1305172231.cos.ap-beijing.myqcloud.com/4/final-architecture.png) = 系统功能要求 == 用户需求 普通用户需要一个待办记录软件,希望我们实现如下功能: - 记录并展示待办事项。 - 可编辑每个事项。 - 可以对事项进行排序。 == 需求分析 通过对用户需求的调查,我们可以得出如下具体的需求。 - 将每个事项抽象为包括**id(编号)、content(待办内容)、priority(优先级)、date(截止日期)、Done(是否完成)**。 - 将所有事项依次展示,形成一个列表。 - 添加一个事项。 我们可以实现一个添加按钮,用户点击之后,可以添加一个事项,并实时展示相应内容。 - 编辑事项。 当用户点击列表中的某个事项,可以对该事项进行编辑。 - 排序。 设定两种排序方式,一种按照`id`字段进行排序,另一种按照`priority,date`两个字段进行排序。 = 系统设计与实现 总共设计了`MainActivity`和`NoteActivity`两个Acticity组件,`db`和`ui`两个模块。 == MainActicity 这是整个程序的主入口。 主要有如下几个函数和接口 - `onCreate` 这是MainActivity的生命周期中的开始部分。绑定视图等内容就是在这里定义和实现。 - 扩展了`NoteListAdapter.NoteListener` 对于ListView中的每条目,实现三个接口。`onContentClick(curNote: Note)`,\ `onCheckBoxClick(curNote: Note)`,`onDeleteBtnClick(curNote: Note)` - refresh 用于更新RecylerView的模块,是否排序等。 - `private lateinit var mSharedPreferences: SharedPreferences` 用户保存用户配置:是否排序。 - onOptionsItemSelected 右上角给出用户是否排序的选项。 - onActivityResult 接收 NoteActivity的返回结果,根据id段是否为0分别进行插入和删除操作。 == NoteActivity 该组件提供给用户编辑条目的界面。当用户新建条目或编辑条目时都会跳转至该界面。 - `var editText: EditText`用于编辑和显示事项的内容。 - `var dateText: TextView;var timeText: TextView`显示选择的日期和时间。 - `var addBtn: Button`提交按钮。 - `var prioritySpinner: Spinner`选择优先级,0,1,2 - 直接通过xml定义timePicker和datePicker。 == db 这里实现了数据库,使用到了*room可持久库*,有如下四个部分。 === dao 定义了NoteDao类,这里实现了数据库的sql语句。 === entity 有两个类。 1. Note 这是数据库条目的具体定义,并扩展了`Parcelable`,利用kotlin的序列化,可以非常方便的在Activity之间传递`note`类。 2. DateToLongConverters android内的SQLite无法直接保存Date类型,定一个转换器,将Date自动转化为Long类型,自动将Long转化回Date类型。 === NoteRepository 存储库可管理查询,且允许您使用多个后端。在最常见的示例中,存储库可实现对以下任务做出决定时所需的逻辑:是否从网络中提取数据;是否使用缓存在本地数据库中的结果。 ![存储库](https://blog-picture-1305172231.cos.ap-beijing.myqcloud.com/4/cdfae5b9b10da57f.png) === Room数据库:TodoDateBase 什么是 Room 数据库? - Room 是 SQLite 数据库之上的一个数据库层。 - Room 负责您平常使用 SQLiteOpenHelper 所处理的单调乏味的任务。 - Room 使用 DAO 向其数据库发出查询请求。 - 为避免界面性能不佳,默认情况下,Room 不允许在主线程上发出查询请求。当 Room 查询返回 Flow时,这些查询会在后台线程上自动异步运行。 - Room 提供 SQLite 语句的编译时检查。 == ui 这里定义了几个关于界面的组件。 === NoteListAdapter ListView的适配器。绑定了试图的操作,根据`分离关注点`的原则,我定义了几个接口,这些接口将在MainActivity中实现(这样比较方便而已,最好是定义在一个单独的类中)。 === NoteViewModel ViewModel 的作用是向界面提供数据,不受配置变化的影响。ViewModel充当存储库和界面之间的通信中心。您还可以使用 ViewModel 在 fragment之间共享数据。ViewModel 是 Lifecycle 库的 一部分。 ![ViewModel](https://blog-picture-1305172231.cos.ap-beijing.myqcloud.com/4/72848dfccfe5777b.png) ViewModel以一种可以感知生命周期的方式保存应用的界面数据,不受配置变化的影响。它会将应用的界面数据与Activity 和 Fragment 类区分开,让您更好地遵循单一责任原则:activity 和fragment 负责将数据绘制到屏幕上,ViewModel则负责保存并处理界面所需的所有数据。 LiveData 是一种可观察的数据存储器,每当数据发生变化时,都会收到通知。与Flow 不同,LiveData 具有生命周期感知能力,即遵循其他应用组件(如activity 或 fragment)的生命周期。LiveData会根据负责监听变化的组件的生命周期自动停止或恢复观察。因此,LiveData适用于界面使用或显示的可变数据。 ViewModel 会将存储库中的数据从 Flow 转换为 LiveData,并将字词列表作为LiveData传递给界面。这样可以确保每次数据库中的数据发生变化时,界面都会自动更新。 在 Kotlin 中,所有协程都在 CoroutineScope中运行。范围用于控制协程在整个作业过程中的生命周期。如果取消某一范围内的作业,该范围内启动的所有协程也将取消。 AndroidX lifecycle-viewmodel-ktx 库将 viewModelScope 添加为 ViewModel类的扩展函数,使您能够使用范围。 === 两个Fragment 分别是DatePicker和DatePicker。 = 软件可能的扩展 == 存储库 在这里我们定义并实现了NoteResposity。在当前这个应用中,数据库的来源只有本地的数据库。这个存储库可以实现网络数据的拉取,而不需要更改其他代码。 == 功能更新 可以将事项添加到日历,并添加闹钟。但作为一个普通应用,而不是系统内置应用,访问日历有隐私问题。暂不考虑。 分类。可以将不同的事项分为不同的类。同类产品中有这种功能,实际体验中,用户需求度不高。 == 应用迭代 代码和apk发布在如下github仓库。 [github](https://github.com/dashuai009/ToDo) 如果有更新会提交的这里。 = 总结体会 1. 课程体会。本门课程与实际生活关联很大,不仅有用户体验方面的,还有技术实现上。 2. 技术总结。 - kotlin。 非常的简洁,也避免的null错误等。 - room可持久库。 避免使用 SQLiteOpenHelper 所处理的单调乏味的任务。 - android设计原则。 虽然在这次编程中实现的不是很好,但可以明显的看出遵循原则之后,代码比较优美。'
https://github.com/gaoachao/uniquecv-typst
https://raw.githubusercontent.com/gaoachao/uniquecv-typst/main/template.typ
typst
#import "@preview/fontawesome:0.1.0" as fa // 小标题的蓝色 #let cv-blue = rgb(56, 115, 192) // 日期的灰色 #let gray = rgb(128, 128, 128) #let en-font = "New Computer Modern" #let cn-font = "Source Han Serif SC" #let cn-italic-font = "KaiTi" #let font-list = (en-font, cn-font) #let italic-font-list = (en-font, cn-italic-font) #let project( name: "", body, font-list: font-list, italic-font-list: italic-font-list, ) = { // 标题 set document(title: name) // 页边距设定 set page( paper: "a4", numbering: none, margin: (top: 2cm, bottom: 2.5cm, left: 2.5cm, right: 2.5cm), ) set text( font: font-list, lang: "zh", region: "cn", ) set par( justify: true, linebreaks: "optimized", leading: 0.8em, ) // 行间距 show par: set block(spacing: 1em) // 段间距 show emph: it => [ #set text(font: italic-font-list) #it ] show heading.where(level: 1): it => block(width: 100%)[ #it #place(dy: 0.3em, left)[#line(length: 100%, stroke: 0.7pt + cv-blue)] ] show heading: set block(spacing: 0.2em) // 设置标题(名字)字体 align(center)[ #block(text(weight: 400, 2.4em, name)) ] body } // 日期 #let date-style(y) = { set text(fill: gray) y } // 个人信息 #let info(phone: "", email: "", github: "") = { set align(center) grid(columns: 3, column-gutter: 5pt)[ #fa.fa-phone() #phone ][ #fa.fa-envelope() #email ][ #fa.fa-github() #github ] } // 教育背景 #let education( school: [], major: [], degree: [], date: [], grade: [], English: [], body, ) = { [ *#school* #h(10pt)#major #h(10pt)#degree #h(1fr) #date-style(date) #grade #h(10pt)#English ] body } #let prize(data) = { let cells = () for d in data { cells.push(strong(d.at("game", default: ""))) cells.push(strong(d.at("grade", default: ""))) cells.push(date-style(d.at("date", default: ""))) } [ #v(-0.4em) #table( columns: (1fr, 1fr, auto), inset: (x: 0pt, y: 0.4em), stroke: none, ..cells, ) #v(-0.4em) ] } // 项目经历 #let proj-exps(exps) = { let cells = () for exp in exps { cells.push(strong(exp.at("name", default: []))) cells.push(strong(exp.at("type", default: []))) cells.push(date-style(exp.at("date", default: []))) cells.push( table.cell( colspan: 3, [ #if "tech" in exp [ #emph(exp.tech) #linebreak() ] #exp.at("description", default: []) ], ), ) } [ #v(-0.4em) #table( columns: (auto, 1fr, auto), column-gutter: 1em, inset: (x: 0pt, y: 0.4em), stroke: none, ..cells, ) #v(-0.4em) ] }
https://github.com/frectonz/the-pg-book
https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/068.%20goodart.html.typ
typst
goodart.html How Art Can Be Good December 2006I grew up believing that taste is just a matter of personal preference. Each person has things they like, but no one's preferences are any better than anyone else's. There is no such thing as good taste.Like a lot of things I grew up believing, this turns out to be false, and I'm going to try to explain why.One problem with saying there's no such thing as good taste is that it also means there's no such thing as good art. If there were good art, then people who liked it would have better taste than people who didn't. So if you discard taste, you also have to discard the idea of art being good, and artists being good at making it.It was pulling on that thread that unravelled my childhood faith in relativism. When you're trying to make things, taste becomes a practical matter. You have to decide what to do next. Would it make the painting better if I changed that part? If there's no such thing as better, it doesn't matter what you do. In fact, it doesn't matter if you paint at all. You could just go out and buy a ready-made blank canvas. If there's no such thing as good, that would be just as great an achievement as the ceiling of the Sistine Chapel. Less laborious, certainly, but if you can achieve the same level of performance with less effort, surely that's more impressive, not less.Yet that doesn't seem quite right, does it?AudienceI think the key to this puzzle is to remember that art has an audience. Art has a purpose, which is to interest its audience. Good art (like good anything) is art that achieves its purpose particularly well. The meaning of "interest" can vary. Some works of art are meant to shock, and others to please; some are meant to jump out at you, and others to sit quietly in the background. But all art has to work on an audience, and—here's the critical point—members of the audience share things in common.For example, nearly all humans find human faces engaging. It seems to be wired into us. Babies can recognize faces practically from birth. In fact, faces seem to have co-evolved with our interest in them; the face is the body's billboard. So all other things being equal, a painting with faces in it will interest people more than one without. [1]One reason it's easy to believe that taste is merely personal preference is that, if it isn't, how do you pick out the people with better taste? There are billions of people, each with their own opinion; on what grounds can you prefer one to another? [2]But if audiences have a lot in common, you're not in a position of having to choose one out of a random set of individual biases, because the set isn't random. All humans find faces engaging—practically by definition: face recognition is in our DNA. And so having a notion of good art, in the sense of art that does its job well, doesn't require you to pick out a few individuals and label their opinions as correct. No matter who you pick, they'll find faces engaging.Of course, space aliens probably wouldn't find human faces engaging. But there might be other things they shared in common with us. The most likely source of examples is math. I expect space aliens would agree with us most of the time about which of two proofs was better. Erdos thought so. He called a maximally elegant proof one out of God's book, and presumably God's book is universal. [3]Once you start talking about audiences, you don't have to argue simply that there are or aren't standards of taste. Instead tastes are a series of concentric rings, like ripples in a pond. There are some things that will appeal to you and your friends, others that will appeal to most people your age, others that will appeal to most humans, and perhaps others that would appeal to most sentient beings (whatever that means).The picture is slightly more complicated than that, because in the middle of the pond there are overlapping sets of ripples. For example, there might be things that appealed particularly to men, or to people from a certain culture.If good art is art that interests its audience, then when you talk about art being good, you also have to say for what audience. So is it meaningless to talk about art simply being good or bad? No, because one audience is the set of all possible humans. I think that's the audience people are implicitly talking about when they say a work of art is good: they mean it would engage any human. [4]And that is a meaningful test, because although, like any everyday concept, "human" is fuzzy around the edges, there are a lot of things practically all humans have in common. In addition to our interest in faces, there's something special about primary colors for nearly all of us, because it's an artifact of the way our eyes work. Most humans will also find images of 3D objects engaging, because that also seems to be built into our visual perception. [5] And beneath that there's edge-finding, which makes images with definite shapes more engaging than mere blur.Humans have a lot more in common than this, of course. My goal is not to compile a complete list, just to show that there's some solid ground here. People's preferences aren't random. So an artist working on a painting and trying to decide whether to change some part of it doesn't have to think "Why bother? I might as well flip a coin." Instead he can ask "What would make the painting more interesting to people?" And the reason you can't equal Michelangelo by going out and buying a blank canvas is that the ceiling of the Sistine Chapel is more interesting to people.A lot of philosophers have had a hard time believing it was possible for there to be objective standards for art. It seemed obvious that beauty, for example, was something that happened in the head of the observer, not something that was a property of objects. It was thus "subjective" rather than "objective." But in fact if you narrow the definition of beauty to something that works a certain way on humans, and you observe how much humans have in common, it turns out to be a property of objects after all. You don't have to choose between something being a property of the subject or the object if subjects all react similarly. Being good art is thus a property of objects as much as, say, being toxic to humans is: it's good art if it consistently affects humans in a certain way. ErrorSo could we figure out what the best art is by taking a vote? After all, if appealing to humans is the test, we should be able to just ask them, right?Well, not quite. For products of nature that might work. I'd be willing to eat the apple the world's population had voted most delicious, and I'd probably be willing to visit the beach they voted most beautiful, but having to look at the painting they voted the best would be a crapshoot.Man-made stuff is different. For one thing, artists, unlike apple trees, often deliberately try to trick us. Some tricks are quite subtle. For example, any work of art sets expectations by its level of finish. You don't expect photographic accuracy in something that looks like a quick sketch. So one widely used trick, especially among illustrators, is to intentionally make a painting or drawing look like it was done faster than it was. The average person looks at it and thinks: how amazingly skillful. It's like saying something clever in a conversation as if you'd thought of it on the spur of the moment, when in fact you'd worked it out the day before.Another much less subtle influence is brand. If you go to see the Mona Lisa, you'll probably be disappointed, because it's hidden behind a thick glass wall and surrounded by a frenzied crowd taking pictures of themselves in front of it. At best you can see it the way you see a friend across the room at a crowded party. The Louvre might as well replace it with copy; no one would be able to tell. And yet the Mona Lisa is a small, dark painting. If you found people who'd never seen an image of it and sent them to a museum in which it was hanging among other paintings with a tag labelling it as a portrait by an unknown fifteenth century artist, most would walk by without giving it a second look.For the average person, brand dominates all other factors in the judgement of art. Seeing a painting they recognize from reproductions is so overwhelming that their response to it as a painting is drowned out.And then of course there are the tricks people play on themselves. Most adults looking at art worry that if they don't like what they're supposed to, they'll be thought uncultured. This doesn't just affect what they claim to like; they actually make themselves like things they're supposed to.That's why you can't just take a vote. Though appeal to people is a meaningful test, in practice you can't measure it, just as you can't find north using a compass with a magnet sitting next to it. There are sources of error so powerful that if you take a vote, all you're measuring is the error.We can, however, approach our goal from another direction, by using ourselves as guinea pigs. You're human. If you want to know what the basic human reaction to a piece of art would be, you can at least approach that by getting rid of the sources of error in your own judgements.For example, while anyone's reaction to a famous painting will be warped at first by its fame, there are ways to decrease its effects. One is to come back to the painting over and over. After a few days the fame wears off, and you can start to see it as a painting. Another is to stand close. A painting familiar from reproductions looks more familiar from ten feet away; close in you see details that get lost in reproductions, and which you're therefore seeing for the first time.There are two main kinds of error that get in the way of seeing a work of art: biases you bring from your own circumstances, and tricks played by the artist. Tricks are straightforward to correct for. Merely being aware of them usually prevents them from working. For example, when I was ten I used to be very impressed by airbrushed lettering that looked like shiny metal. But once you study how it's done, you see that it's a pretty cheesy trick—one of the sort that relies on pushing a few visual buttons really hard to temporarily overwhelm the viewer. It's like trying to convince someone by shouting at them.The way not to be vulnerable to tricks is to explicitly seek out and catalog them. When you notice a whiff of dishonesty coming from some kind of art, stop and figure out what's going on. When someone is obviously pandering to an audience that's easily fooled, whether it's someone making shiny stuff to impress ten year olds, or someone making conspicuously avant-garde stuff to impress would-be intellectuals, learn how they do it. Once you've seen enough examples of specific types of tricks, you start to become a connoisseur of trickery in general, just as professional magicians are.What counts as a trick? Roughly, it's something done with contempt for the audience. For example, the guys designing Ferraris in the 1950s were probably designing cars that they themselves admired. Whereas I suspect over at General Motors the marketing people are telling the designers, "Most people who buy SUVs do it to seem manly, not to drive off-road. So don't worry about the suspension; just make that sucker as big and tough-looking as you can." [6]I think with some effort you can make yourself nearly immune to tricks. It's harder to escape the influence of your own circumstances, but you can at least move in that direction. The way to do it is to travel widely, in both time and space. If you go and see all the different kinds of things people like in other cultures, and learn about all the different things people have liked in the past, you'll probably find it changes what you like. I doubt you could ever make yourself into a completely universal person, if only because you can only travel in one direction in time. But if you find a work of art that would appeal equally to your friends, to people in Nepal, and to the ancient Greeks, you're probably onto something.My main point here is not how to have good taste, but that there can even be such a thing. And I think I've shown that. There is such a thing as good art. It's art that interests its human audience, and since humans have a lot in common, what interests them is not random. Since there's such a thing as good art, there's also such a thing as good taste, which is the ability to recognize it.If we were talking about the taste of apples, I'd agree that taste is just personal preference. Some people like certain kinds of apples and others like other kinds, but how can you say that one is right and the other wrong? [7]The thing is, art isn't apples. Art is man-made. It comes with a lot of cultural baggage, and in addition the people who make it often try to trick us. Most people's judgement of art is dominated by these extraneous factors; they're like someone trying to judge the taste of apples in a dish made of equal parts apples and jalapeno peppers. All they're tasting is the peppers. So it turns out you can pick out some people and say that they have better taste than others: they're the ones who actually taste art like apples.Or to put it more prosaically, they're the people who (a) are hard to trick, and (b) don't just like whatever they grew up with. If you could find people who'd eliminated all such influences on their judgement, you'd probably still see variation in what they liked. But because humans have so much in common, you'd also find they agreed on a lot. They'd nearly all prefer the ceiling of the Sistine Chapel to a blank canvas.Making ItI wrote this essay because I was tired of hearing "taste is subjective" and wanted to kill it once and for all. Anyone who makes things knows intuitively that's not true. When you're trying to make art, the temptation to be lazy is as great as in any other kind of work. Of course it matters to do a good job. And yet you can see how great a hold "taste is subjective" has even in the art world by how nervous it makes people to talk about art being good or bad. Those whose jobs require them to judge art, like curators, mostly resort to euphemisms like "significant" or "important" or (getting dangerously close) "realized." [8]I don't have any illusions that being able to talk about art being good or bad will cause the people who talk about it to have anything more useful to say. Indeed, one of the reasons "taste is subjective" found such a receptive audience is that, historically, the things people have said about good taste have generally been such nonsense.It's not for the people who talk about art that I want to free the idea of good art, but for those who make it. Right now, ambitious kids going to art school run smack into a brick wall. They arrive hoping one day to be as good as the famous artists they've seen in books, and the first thing they learn is that the concept of good has been retired. Instead everyone is just supposed to explore their own personal vision. [9]When I was in art school, we were looking one day at a slide of some great fifteenth century painting, and one of the students asked "Why don't artists paint like that now?" The room suddenly got quiet. Though rarely asked out loud, this question lurks uncomfortably in the back of every art student's mind. It was as if someone had brought up the topic of lung cancer in a meeting within Philip Morris."Well," the professor replied, "we're interested in different questions now." He was a pretty nice guy, but at the time I couldn't help wishing I could send him back to fifteenth century Florence to explain in person to Leonardo & Co. how we had moved beyond their early, limited concept of art. Just imagine that conversation.In fact, one of the reasons artists in fifteenth century Florence made such great things was that they believed you could make great things. [10] They were intensely competitive and were always trying to outdo one another, like mathematicians or physicists today—maybe like anyone who has ever done anything really well.The idea that you could make great things was not just a useful illusion. They were actually right. So the most important consequence of realizing there can be good art is that it frees artists to try to make it. To the ambitious kids arriving at art school this year hoping one day to make great things, I say: don't believe it when they tell you this is a naive and outdated ambition. There is such a thing as good art, and if you try to make it, there are people who will notice.Notes[1] This is not to say, of course, that good paintings must have faces in them, just that everyone's visual piano has that key on it. There are situations in which you want to avoid faces, precisely because they attract so much attention. But you can see how universally faces work by their prevalence in advertising.[2] The other reason it's easy to believe is that it makes people feel good. To a kid, this idea is crack. In every other respect they're constantly being told that they have a lot to learn. But in this they're perfect. Their opinion carries the same weight as any adult's. You should probably question anything you believed as a kid that you'd want to believe this much.[3] It's conceivable that the elegance of proofs is quantifiable, in the sense that there may be some formal measure that turns out to coincide with mathematicians' judgements. Perhaps it would be worth trying to make a formal language for proofs in which those considered more elegant consistently came out shorter (perhaps after being macroexpanded or compiled).[4] Maybe it would be possible to make art that would appeal to space aliens, but I'm not going to get into that because (a) it's too hard to answer, and (b) I'm satisfied if I can establish that good art is a meaningful idea for human audiences.[5] If early abstract paintings seem more interesting than later ones, it may be because the first abstract painters were trained to paint from life, and their hands thus tended to make the kind of gestures you use in representing physical things. In effect they were saying "scaramara" instead of "uebfgbsb."[6] It's a bit more complicated, because sometimes artists unconsciously use tricks by imitating art that does.[7] I phrased this in terms of the taste of apples because if people can see the apples, they can be fooled. When I was a kid most apples were a variety called Red Delicious that had been bred to look appealing in stores, but which didn't taste very good.[8] To be fair, curators are in a difficult position. If they're dealing with recent art, they have to include things in shows that they think are bad. That's because the test for what gets included in shows is basically the market price, and for recent art that is largely determined by successful businessmen and their wives. So it's not always intellectual dishonesty that makes curators and dealers use neutral-sounding language.[9] What happens in practice is that everyone gets really good at talking about art. As the art itself gets more random, the effort that would have gone into the work goes instead into the intellectual sounding theory behind it. "My work represents an exploration of gender and sexuality in an urban context," etc. Different people win at that game.[10] There were several other reasons, including that Florence was then the richest and most sophisticated city in the world, and that they lived in a time before photography had (a) killed portraiture as a source of income and (b) made brand the dominant factor in the sale of art.Incidentally, I'm not saying that good art = fifteenth century European art. I'm not saying we should make what they made, but that we should work like they worked. There are fields now in which many people work with the same energy and honesty that fifteenth century artists did, but art is not one of them.Thanks to <NAME>, <NAME>, and <NAME> for reading drafts of this, and to <NAME> for permission to use the image at the top.Japanese TranslationSimplified Chinese Translation
https://github.com/Fr4nk1inCs/typst-homework
https://raw.githubusercontent.com/Fr4nk1inCs/typst-homework/master/complicated/example.typ
typst
MIT License
#import "homework.typ": * #show: homework.with( course: "课程作业", number: 0, name: "姓名", id: "PB2XXXXXXX", code_with_line_number: true, ) #question(1)[ #lorem(60) $ upright(i) planck.reduce (diff)/(diff t) Phi(arrow(r), t) = [- planck.reduce/(2m) nabla^2 + V(arrow(r))] Phi(arrow(r), t) $ ```rust fn main() { println!("Hello, world!"); } ``` ][ #lorem(10) ] #lorem(300) $ upright(i) planck.reduce (diff)/(diff t) Phi(arrow(r), t) = [- planck.reduce/(2m) nabla^2 + V(arrow(r))] Phi(arrow(r), t) $ ```rust fn main() { println!("Hello, world!"); } ```
https://github.com/noahjutz/AD
https://raw.githubusercontent.com/noahjutz/AD/main/notizen/sortieralgorithmen/insertion_sort/induction_1.typ
typst
#import "/components/num_row.typ": single_num_row, braced, arrowed #import "/config.typ": theme #let nums = (12, 34, 34, 45, 45, 18, 38, 17, 43, 51) #single_num_row( (4, 5, 3, 2, 1), labels: ( (0, 2, braced[`:j`]), ), hl_success: range(2) )
https://github.com/0x1B05/algorithm-journey
https://raw.githubusercontent.com/0x1B05/algorithm-journey/main/practice/note/content/快速幂.typ
typst
#import "../template.typ": * #pagebreak() = 快速幂 如何计算\(a^n\), \(a \in Z\)? \(a^{100,000,000}\)朴素算法要遍历 100,000,000 次? 复杂度太高. 特殊情况, n 为 2 的幂的时候, 计算$a^64$? ``` a^1 * a^1 = a^2 a^2 * a^2 = a^4 a^4 * a^4 = a^8 a^8 * a^8 = a^16 a^16 * a^16 = a^32 a^32 * a^32 = a^64 ``` 特殊情况, n 不为 2 的幂的时候, 计算$a^{105}$? ``` 105 = 1+8+32+64 105 -> 1 1 0 1 0 0 1 1 -> 0 0 0 0 0 0 1 8 -> 0 0 0 1 0 0 0 32 -> 0 1 0 0 0 0 0 64 -> 1 0 0 0 0 0 0 ``` 伪代码 ```py function BINEXP(a, n): r = 1 while n != 0 # if n mod 2==1 if n & 1 == 1 r = r*a a = a*a n = n>>1 return r ``` #image("images/2023-11-20-11-46-29.png") 时间复杂度 O(logn) == 应用 1 计算 $a^n \bmod m$ == 应用 2 计算斐波那契数列的第 n 项 == 应用 3 将线性变化重复 n 次.
https://github.com/rabotaem-incorporated/probability-theory-notes
https://raw.githubusercontent.com/rabotaem-incorporated/probability-theory-notes/master/sections/03-characteristic-functions/03-central-limit-theorem.typ
typst
#import "../../utils/core.typ": * == Центральная предельная теорема #th(name: "Центральная предельная теорема в форме <NAME>")[ Пусть $xi_1$, $xi_2$, $xi_3$, ... --- независмые, одинаково распределенные случайные величины, $a := E xi_1$, $sigma^2 := D xi_1 > 0$ конечна, $S_n := xi_1 + xi_2 + ... + xi_n$. Тогда $ P((S_n - n a)/(sigma sqrt(n)) <= x) = P((S_n - E S_n)/sqrt(D S_n) <= x) arrows Phi(x) = 1/sqrt(2pi) integral_(-oo)^x e^(-t^2/2) dif t, $ где $Phi(x)$ --- функция распределения для $Nn(0, 1)$. ] #proof[ Сдвинем эти случайные величины на матожидание: считаем $E xi_k = 0$ и доказываем $ S_n / (sigma sqrt(n)) "сходится к" Nn(0, 1) "по распределению". $ Достаточно проверить поточечную сходимость характеристических функций. $ phi_(S_n) (t) = phi_(xi_1 + xi_2 + ... + xi_n) (t) = product_(k = 1)^n phi_(xi_k) (t) = (phi_(xi_1) (t))^n. $ Наличие моментов $xi_1$ означает наличие производных функции распределения. Напишем разложение $phi_(xi_1) (t)$ в ряд Тейлора: $ 1 - (sigma^2 t^2)/2 + o(t^2), $ так как $ E xi_1 = -i (phi'_xi_1) (0) = 0, quad D xi_1 = -phi''_(xi_1)(0) + (phi'_xi_1 (0))^2. $ Тогда $ phi_(S_n/(sigma sqrt(n))) (t) = phi_(S_n) (t/(sigma sqrt(n))) = (phi_xi_1 (t/(sigma sqrt(n))))^n = (1 - (sigma^2 t^2)/(2n sigma^2) + o(t^2/(sigma^2 n)))^n -->^? e^(-t^2/2) $ Логарифмируем $ n ln (1 - t^2/(2n) + o(1/n)) = n (-t^2/(2n) + o(1/n)) --> -t^2/2. $ ] #follow(name: "интегральная теорема Муавра-Лапласа", label: "clt-de-moivre-laplace-integral")[ $xi_1$, $xi_2$, ... --- независимые бернуллевские случайные величины с вероятностью успеха $p in (0, 1)$, $q = 1 - p$. Тогда $ P((S_n - n p)/(sqrt(n p q)) <= x) arrows Phi(x). $ ] #(make_theorem("Интерлюдия"))[ Посчитам характеристическую функцию для распределения Пуассона. Фиксируем $lambda > 0$. $ phi_xi (t) = E e^(i t xi) = sum_(n = 0)^oo e^(i t n) P(xi = n) = sum_(n = 0)^oo e^(i t n) dot (lambda^n e^(-lambda))/n! = e^(-lambda) sum_(n = 0)^oo (e^(i t) lambda)^n/n! = e^(-lambda) e^(e^(i t) lambda) = e^(lambda (e^(i t) - 1)). $ ] #th(name: "Пуассона")[ Пусть $xi_(n 1)$, $xi_(n 2)$, ..., $xi_(n n)$ независимые бернуллевские. $P(xi_(n k) = 1) = p_(n k)$. $p_(n 1) + p_(n 2) + ... + p_(n n) -->_(n->oo) lambda in [0, +oo)$ и $max {p_(n 1), p_(n 2), ..., p_(n n)} --> 0$, $S_n = xi_(n 1) + xi_(n 2) + ... + xi_(n n)$. Тогда $ P(S_n = k) --> (lambda^k e^(-lambda))/(k!). $ ] #notice[ В старой теореме Пуассона $p_(n 1) = p_(n 2) = ... = p_(n n) =: p_n$, $n p_n --> lambda$. ] #proof[ Покажем, что $S_n$ сходится по распределению к $op("Poisson") (lambda)$. $ phi_(xi_(n k)) (t) = E e^(i t xi_(n k)) = P(xi_(n k) = 0) + e^(i t) P(xi_(n k) = 1) = 1 - p_(n k) + e^(i t) p_(n k) = 1 + (e^(i t) - 1) p_(n k). $ Тогда $ phi_(S_n) (t) = product_(k = 1)^n phi_(xi_(n k)) (t) = product_(k = 1)^n (1 + (e^(i t) - 1) p_(n k)) -->^? e^(lambda (e^(i t) - 1)). $ Логарифмируем, $ sum_(k = 1)^n ln(1 + (e^(i t) - 1) p_(n k)) -->^? lambda (e^(i t) - 1). $ $ sum_(k = 1)^n ((e^(i t) - 1) p_(n k) + O(p_(n k)^2)) = (e^(i t) - 1) underbrace(sum_(k = 1)^n p_(n k), --> lambda) + O(sum_(k = 1)^n p_(n k)^2). $ Надо доказать, что $sum_(k = 1)^n p_(n k)^2 --> 0$: $ sum_(k = 1)^n p_(n k)^2 <= underbrace(max_(k = 1,...,n) {p_(n k)}, --> 0) underbrace(sum_(k = 1)^n p_(n k), --> lambda) --> 0. $ Наконец, $ P(S_n = k) = F_(S_n) (k + 1/2) - F_(S_n) (k - 1/2) --> F(k + 1/2) - F(k - 1/2) = P(eta = k), $ где $eta sim op("Poisson") (lambda)$. ] #th(name: "Центральная предельная теорема в форме Линденберга")[ Пусть $xi_1$, $xi_2$, $xi_3$, ... --- независмые, $a_n := E xi_n$, $sigma_n^2 := D xi_n > 0$, $S_n := xi_1 + xi_2 + ... + xi_n$, $D_n^2 := sum_(k = 1)^n sigma_k^2$ конечна. Тогда если для любого $eps > 0$ $ op("Lind") (eps, n) := 1/D_n^2 sum_(k = 1)^n E f(xi_k - a_k) -->_(n -> +oo) 0, $ где $f(x) := x^2 dot bb(1)_{abs(x) >= eps D_n}$, то $ P((S_n - E S_n)/sqrt(D S_n) <= x) arrows Phi(x) = 1/sqrt(2pi) integral_(-oo)^x e^(-t^2/2) dif t, $ где $Phi(x)$ --- функция распределения для $Nn(0, 1)$. ] #proof[ Ладно доказывать... вы хотите эту теорему _применять_?.. ] #th(name: "Центральная предельная теорема в форме Ляпунова")[ Пусть $xi_1$, $xi_2$, $xi_3$, ... --- независмые, $a_n := E xi_n$, $sigma_n^2 := D xi_1 > 0$, $S_n := xi_1 + xi_2 + ... + xi_n$, $D_n^2 := sum_(k = 1)^n sigma_k^2$ конечна. Пусть $ L(delta, n) := 1/D_n^(2 + delta) sum_(k = 1)^n E abs(xi_k - a_k)^(2 + delta) -->_(n -> oo) 0 "для некоторого" delta > 0. $ Тогда $ P((S_n - E S_n)/sqrt(D S_n) <= x) arrows Phi(x) = 1/sqrt(2pi) integral_(-oo)^x e^(-t^2/2) dif t, $ ] #let Lind = math.op("Lind") #proof[ Выведем из Линденберга. Очевидно, $ f(x) <= x^2 (abs(x)/(eps D_n))^delta. $ Значит $ Lind(eps, n) = 1/D_n^2 sum_(k = 1)^n E f(xi_k - a_k) <= 1/D_n^2 sum_(k = 1)^n (E abs(xi_k - a_k)^(2 + delta))/(eps^delta dot D_n^delta) newline(=) 1/eps^delta dot 1/(D_n^(2 + delta)) sum_(k = 1)^n E abs(xi_k - a_k)^(2 + delta) = L(delta, n)/eps^delta -->_(n -> oo) 0. $ ] #th[ В предположении теоремы Ляпунова, пусть $delta in (0, 1)$. Тогда $ abs(P((S_n - E S_n)/sqrt(D S_n) <= x) - Phi(x)) <= C_delta dot L(delta, n). $ ] #proof[ Если бы мы ее доказывали, мы бы не выводили Ляпунова из Линденберга. ] #notice[ Если случайные величины одинаково распределны, $ L(delta, n) = 1/(sqrt(n) sigma)^(2 + delta) dot n E abs(xi_1 - a)^(2 + delta) = E abs(xi_1 - a)^(2 + delta)/(n^(delta/2) sigma^(2 + delta)). $ ] #th(name: "Берри-Эссеена")[ Пусть $xi_1$, $xi_2$, $xi_3$, ... --- независмые, одинаково распределенные случайные величины, $a := E xi_1$, $sigma^2 := D xi_1$. Тогда $ abs(P((S_n - n a)/(sqrt(n) sigma) <= x) - Phi(x)) <= C (E|xi_1 - a|^3)/(sqrt(n) sigma^3). $ ] #proof[ нет. ] #notice[ Для схемы Бернулли, $ (E abs(xi_1 - a)^3)/sigma^3 = (p^2 + q^2)/sqrt(p q). $ ] #notice[ Про константу $C$ из условия теоремы: - Эссеен (1956): $C >= (sqrt(10) + 3)/(6 sqrt(2pi)) approx 0.4037...$ - Реально доказать $C >= 1/sqrt(2pi)$. - Шевцова (2014): $C <= 0.463$. ] #th(name: "Хартмана-Винтнера, более известна как закон повторного логарифма")[ Пусть $xi_1$, $xi_2$, ... независимые, одинаково распределенные случайные величины, $E xi_1 = 0$, $sigma^2 = D xi_1 > 0$ конечная. Тогда $ limsup S_n/(sqrt(2n ln ln n)) &= sigma,\ liminf S_n/(sqrt(2n ln ln n)) &= -sigma,\ $ ] #notice[ В ЦПТ $S_n/(sqrt(n) sigma)$ стримится к $Nn(0, 1)$. Если мы делим хоть на чуть-чуть побольше ($ln ln n$), то все распределение попадет в отрезок. ] #th(name: "Штрассена")[ Пусть $xi_1$, $xi_2$, ... независимые, одинаково распределенные случайные величины, $E xi_1 = 0$, $sigma^2 = D xi_1 > 0$ конечная. Тогда любая точка из $[-sigma, sigma]$ --- предельная для последовательности $S_n/(sqrt(2n ln ln n))$. ]
https://github.com/Jacobgarm/typst_linalg
https://raw.githubusercontent.com/Jacobgarm/typst_linalg/master/pkg/main.typ
typst
The Unlicense
#import "./lib.typ" as mat #{ let m1 = math.mat((20,20),(0,20)) let m2 = math.mat((0.2,1),(5,7)) let m3 = math.mat((0.5, 1, 0), (0, 1, 0), (0, 0, 2)) // let v = mat.vec(1,2) // mat.mul_vec(m1,v) mat.mul(mat.inverse(m3), m3) }
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/meta/footnote_03.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Currently, numbers a bit out of order if a nested footnote ends up in the // same frame as another one. :( #footnote[A, #footnote[B]], #footnote[C]
https://github.com/GYPpro/DS-Course-Report
https://raw.githubusercontent.com/GYPpro/DS-Course-Report/main/Rep/02.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.where(block: false): box.with( fill: luma(230), inset: (x: 3pt, y: 0pt), outset: (y: 3pt), radius: 2pt, ) // #set raw(align: center) #show raw: set text( font: ("consolas", "Source Han Serif SC") ) #set page( // flipped: true, paper: "a4", // background: [#image("background.png")] ) #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()] // Display block code in a larger block // // with more padding. // #show raw.where(block: true): block.with( // fill: luma(230), // inset: 7pt, // radius: 4pt, // ) #set par( // first-line-indent: 1cm ) #set math.equation(numbering: "(1)") // Display block code in a larger block // with more padding. #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)) ] ) /*----*/ = 基于增长数组的`vector` \ #text( font:"KaiTi", size: 15pt )[ 课程名称#underline[#text(" 数据结构 ")]成绩评定#underline[#text(" ")]\ 实验项目名称#underline[#text(" ") 基于增长数组的`vector` #text(" ")]指导老师#underline[#text(" 干晓聪 ")]\ 实验项目编号#underline[#text(" 02 ")]实验项目类型#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." ) = 实验目的 \ #h(1.8em) 实现基于增长数组的类STL `vector`类,提供尾端插入与随机访问和迭代器。 = 实验环境 \ #h(1.8em)计算机:PC X64 操作系统:Windows + Ubuntu20.0LTS 编程语言:C++:GCC std20 IDE:Visual Studio Code = 程序原理 增长数组会周期性的申请连续的内存,并将以往的数据移动到新申请的内存中。其倍增的特性保证了其均摊的插入复杂度在$OO(1)$,其连续的性质保证了随机访问的速度。 #pagebreak() = 程序代码 == `memDeleteTest.cpp` #sourcecode[```cpp #include <iostream> #include <new> #include <stdlib.h> using namespace std; class testClass{ public: int a = 0; testClass(){a=1;}; ~testClass(){cout << "Distroy TestClass\n";}; }; int main() { testClass * arr = new testClass[10]; cout << "Finish Alloc\n"; for(int i = 0;i < 10;i ++) arr[i].~testClass(); if(arr) //delete[] arr; ::operator delete[](arr); else cout << "nullPtr\n"; cout << "Finish Delete\n"; return 0; } ``` == `myVector.h` ```cpp #ifndef PRVLIBCPP_VECTOR_HPP #define PRVLIBCPP_VECTOR_HPP #include <new> #include <cstddef> #include <type_traits> #include <string.h> namespace myDS { const size_t _EXPENSION_RATIO = 2; const size_t _INITIAL_SIZE = 16; template <typename TYPE_NAME> class vector { private: std::size_t _size; std::size_t _max_cap; TYPE_NAME *_begin = nullptr; TYPE_NAME *_push_back_idx = _begin; class _iterator { private: TYPE_NAME *_ptr; myDS::vector<TYPE_NAME> * _upper_pointer; size_t _upper_idx; public: enum __iter_dest_type { front, back }; __iter_dest_type _iter_dest; _iterator( myDS::vector<TYPE_NAME> *_upper, size_t _n, __iter_dest_type _d) { _upper_idx = _n; _upper_pointer = _upper; _ptr = &(*_upper_pointer)[_n]; _iter_dest = _d; } TYPE_NAME & operator*() { return (*_ptr); } TYPE_NAME *operator->() { return _ptr; } myDS::vector<TYPE_NAME>::_iterator operator++() { if (_iter_dest == front) _upper_idx++; else _upper_idx--; _ptr = &((*_upper_pointer)[_upper_idx]); return *this; } myDS::vector<TYPE_NAME>::_iterator operator++(int) { myDS::vector<TYPE_NAME>::_iterator old = *this; if (_iter_dest == front) _upper_idx++; else _upper_idx--; _ptr = &((*_upper_pointer)[_upper_idx]); return old; } myDS::vector<TYPE_NAME>::_iterator operator+(size_t _n) { if (_iter_dest == front) _upper_idx += _n; else _upper_idx -= _n; _ptr = &((*_upper_pointer)[_upper_idx]); return *this; } bool operator==( myDS::vector<TYPE_NAME>::_iterator _b) { if (&(*_b) == _ptr) return 1; else return 0; } bool operator!=( myDS::vector<TYPE_NAME>::_iterator _b) { if (&(*_b) == _ptr) return 0; else return 1; } }; private: void _expension() { if (_max_cap == 0) { if(_begin) ::operator delete[](_begin); _begin = new TYPE_NAME[_INITIAL_SIZE]; _max_cap = _INITIAL_SIZE; } else { TYPE_NAME *_next_begin = new TYPE_NAME[_EXPENSION_RATIO * (std::size_t)_max_cap]; // for (std::size_t i = 0; i < _size; i++) // _next_begin[i] = _begin[i]; memcpy(_next_begin,_begin,_size*sizeof(TYPE_NAME)); // for(TYPE_NAME * __ptr = _begin;__ptr != _begin + _max_cap;__ptr ++) // __ptr->~TYPE_NAME(); delete[] _begin; _max_cap *= _EXPENSION_RATIO; _begin = _next_begin; } _push_back_idx = _begin + _size; } public: vector() { _size = 0; _max_cap = 0; _push_back_idx = _begin + _size; } vector(std::size_t _n) { _size = 0; _max_cap = 0; resize(_n); _push_back_idx = _begin + _size; } // FIXME: vector(std::size_t _n, TYPE_NAME _init_value) { _begin = new TYPE_NAME[_n]; _size = _n; _max_cap = _n; _push_back_idx = _n; for (std::size_t i = 0; i < _push_back_idx; i++) _begin[i] = _init_value; } vector( myDS::vector<TYPE_NAME> &_b) { for (auto x : _b) this->push_back(x); } void resize(size_t _n) { if(_n > _size) for(int __i = 0;__i < _n;__i++) { if(_size + 1 >= _max_cap) _expension(); _size ++; _push_back_idx ++; } _size = _n; _push_back_idx = _begin + _size; } void push_back(const TYPE_NAME &__tmp) { if(_size + 1 >= _max_cap) _expension(); memcpy(_push_back_idx,&__tmp,sizeof(TYPE_NAME)); _push_back_idx++; _size++; } void clear() { this->resize(0); } vector<TYPE_NAME>::_iterator begin() { enum myDS::vector<TYPE_NAME>::_iterator::__iter_dest_type s = myDS::vector<TYPE_NAME>::_iterator::__iter_dest_type::front; return myDS::vector<TYPE_NAME>::_iterator(this, 0,s); } myDS::vector<TYPE_NAME>::_iterator rbegin() { enum myDS::vector<TYPE_NAME>::_iterator::__iter_dest_type s = myDS::vector<TYPE_NAME>::_iterator::__iter_dest_type::back; return myDS::vector<TYPE_NAME>::_iterator(this, _size - 1,s); } myDS::vector<TYPE_NAME>::_iterator end() { enum myDS::vector<TYPE_NAME>::_iterator::__iter_dest_type s = myDS::vector<TYPE_NAME>::_iterator::__iter_dest_type::front; return myDS::vector<TYPE_NAME>::_iterator(this,_size,s); } myDS::vector<TYPE_NAME>::_iterator rend() { enum myDS::vector<TYPE_NAME>::_iterator::__iter_dest_type s = myDS::vector<TYPE_NAME>::_iterator::__iter_dest_type::back; return myDS::vector<TYPE_NAME>::_iterator(this, 0, s); } TYPE_NAME at(std::size_t _n) { return _begin[_n]; } std::size_t size() { return _size; } bool equal( myDS::vector<TYPE_NAME> _b) { for (int i = 0; i < _size; i++) if (_b[i] != _begin[i]) return false; return true; } TYPE_NAME &operator[](std::size_t _n) { return _begin[_n]; } myDS::vector<TYPE_NAME> &operator=( myDS::vector<TYPE_NAME> _b) { this->resize(0); for(auto __x:_b) this->push_back(__x); } myDS::vector<TYPE_NAME> &operator+( myDS::vector<TYPE_NAME> _b) { for (auto x : _b) this->push_back(x); } ~vector() { if(_begin) delete[] _begin; } }; } // namespace myDS #endif ```] == `_PRIV_TEST.cpp` #sourcecode[```cpp #define DS_TOBE_TEST vector #define _PRIVATE_DEBUG #include "Dev\02\myVector.h" #include <iostream> #include <math.h> #include <vector> using namespace std; using TBT = myDS::DS_TOBE_TEST<int>; void accuracyTest() {//结构正确性测试 TBT tc = TBT(); for(;;) { string op; cin >> op; if(op == "clr") { //清空 tc.clear(); } else if(op == "q") //退出测试 { return; } else if(op == "pb")//push_back { int c; cin >> c; tc.push_back(c); // } else if(op == "pf")//push_frount // { // int c; // cin >> c; // tc.push_frount(c); } else if(op == "at")//随机访问 { int p; cin >> p; cout << tc[p] << "\n"; // } else if(op == "delEL")//删除所有等于某值元素 // { // int p; // cin >> p; // cout << tc.erase(p) << "\n"; // } else if(op == "delPS")//删除某位置上的元素 // { // int p; // cin >> p; // cout << tc.erase(tc.get(p)) << "\n"; } else if(op == "iterF") //正序遍历 { // tc.innerPrint(); cout << "Iter with index:\n"; for(int i = 0;i < tc.size();i ++) cout << tc[i] << " ";cout << "\n"; cout << "Iter with begin end\n"; for(auto x = tc.begin();x != tc.end();x ++) cout << (*x) << " ";cout << "\n"; cout << "Iter with AUTO&&\n"; for(auto x:tc) cout << x << " ";cout << "\n"; } else if(op == "iterB") //正序遍历 { // tc.innerPrint(); cout << "Iter with index:\n"; for(int i = 0;i < tc.size();i ++) cout << tc[tc.size()-1-i] << " ";cout << "\n"; cout << "Iter with begin end\n"; for(auto x = tc.rbegin();x != tc.rend();x ++) cout << (*x) << " ";cout << "\n"; // cout << "Iter with AUTO&&\n";."\n"; } else if(op == "mv")//单点修改 { int p; cin >> p; int tr; cin >> tr; tc[p] = tr; } else if(op == "") { } else { op.clear(); } } } void memLeakTest() {//内存泄漏测试 TBT tc = TBT(); for(;;){ tc.push_back(1); tc.push_back(1); tc.push_back(1); tc.push_back(1); tc.clear(); } } signed main() { accuracyTest(); // memLeakTest(); } ```] = 测试数据与运行结果 运行上述`_PRIV_TEST.cpp`测试代码中的正确性测试模块,得到以下内容: ``` * * @file myVector.h * @brief A Memory-contiguous, variable-length array * @details * 不知道该写什么,反正就是vector,正常用就行了 * @author github.com/GYPpro * @version 0.2.0 ``` ``` pb 1 pb 2 pb 3 pb 4 iterF pb 9 iterB clr iterF pb 1 iterF pb 1 pb 2 pb 3 pb 4 iterF Iter with index: 1 2 3 4 Iter with begin end 1 2 3 4 Iter with AUTO&& 1 2 3 4 pb 9 iterB Iter with index: 9 4 3 2 1 Iter with begin end 9 4 3 2 clr iterF Iter with index: Iter with begin end Iter with AUTO&& pb 1 iterF Iter with index: 1 Iter with begin end 1 Iter with AUTO&& 1 ``` 可以看出,代码运行结果与预期相符,可以认为代码正确性无误。 #image("1.png") 运行`_PRIV_TEST.cpp`中的内存测试模块,在保持CPU高占用率运行一段时间后内存变化符合预期,可以认为代码内存安全性良好。
https://github.com/augustebaum/petri
https://raw.githubusercontent.com/augustebaum/petri/main/tests/fletcher/four-seasons/test.typ
typst
MIT License
#import "/src/lib.typ": * #set page(width: auto, height: auto, margin: 1cm) #import "@preview/fletcher:0.4.2" as fletcher: edge /// % Change style /// thick, /// node distance=2cm, /// on grid, /// pre/.style={<-, shorten <=1pt, >={Stealth}}, /// post/.style={->,shorten >=1pt, >={Stealth}}, /// every transition/.style={fill,minimum width=1mm, minimum height=10mm}, /// every place/.style={fill=cyan!25,draw=cyan!75}, /// every label/.style={cyan}] /// /// % Place 1 /// \node[place,tokens=1, /// label=left:spring] (place1) {}; /// /// % Transition 1 /// \node[transition, above right= of place1, /// label=above:T$_1$] (trans1) {}; /// /// % Transition 4 /// \node[transition,below right= of place1, /// label=below:$T_4$] (trans4) {}; /// /// % Place 2 /// \node[place,right=of trans1, /// label=above:summer] (place2) {}; /// /// % Transition 2 /// \node[transition,right= of place2, /// label=above:$T_2$] (trans2) {}; /// /// % Place 3 /// \node[place,below right=of trans2, /// label=right:autumn] (place3) {}; /// /// % Place 4 /// \node[place,right=of trans4, /// label=below:winter] (place4) {}; /// /// % Transition 3 /// \node[transition,right= of place4, /// label=below:$T_3$] (trans3) {}; /// /// % Connections /// \draw (place1) edge[post] (trans1) /// (trans1) edge[post] (place2) /// (place2) edge[post] (trans2) /// (trans2) edge[post] (place3) /// (place3) edge[post] (trans3) /// (trans3) edge[post] (place4) /// (place4) edge[post] (trans4) /// (trans4) edge[post] (place1); #set text(fill: eastern.darken(50%)) #let place-fill = teal.lighten(25%) #let place-stroke = teal.darken(15%) #fletcher.diagram( node-stroke: 0.5pt, spacing: 1.5cm, p((0,0), [spring], fill: place-fill, stroke: place-stroke, tokens: 1, label-args: (anchor: "west")), edge("-|>"), t((1,-1), $T_1$, fill: black), edge("-|>"), p((2,-1), [summer], fill: place-fill, stroke: place-stroke), edge("-|>"), t((3,-1), $T_2$, fill: black), edge("-|>"), p((4,0), [autumn], fill: place-fill, stroke: place-stroke, label-args: (anchor: "east")), edge("-|>"), t((3,1), $T_3$, fill: black, label-args: (anchor: "south")), edge("-|>"), p((2,1), [winter], fill: place-fill, stroke: place-stroke, label-args: (anchor: "south")), edge("-|>"), t((1,1), $T_4$, fill: black, label-args: (anchor: "south")), edge((1,1), (0,0), "-|>"), )
https://github.com/spidersouris/touying-unistra-pristine
https://raw.githubusercontent.com/spidersouris/touying-unistra-pristine/main/src/lib.typ
typst
MIT License
#import "unistra.typ": * #import "settings.typ": * #import "colors.typ": * #import "admonition.typ": *
https://github.com/LEXUGE/poincare
https://raw.githubusercontent.com/LEXUGE/poincare/main/src/templates/shorthands.typ
typst
MIT License
#import "@preview/ctheorems:1.1.0": * #let axiom = thmbox("axiom", "Axiom", stroke: red + 1pt) #let postl = thmbox("postulate", "Postulate", stroke: red + 1pt) #let def = thmbox("definition", "Definition", stroke: purple + 1pt) #let thm = thmbox("theorem", "Theorem", fill: color.lighten(orange, 70%)) #let eg = thmbox("example", "Example", fill: color.lighten(green, 85%), breakable: true) #let remark = thmplain("remark", "Remark", base: "theorem") #let proof = thmplain( "proof", "Proof", base: "theorem", titlefmt: smallcaps, bodyfmt: body => [ #body #h(1fr) $square$ // float a QED symbol to the right ], ).with(numbering: none) // Override the vb in physica #let vb(body) = $bold(upright(body))$ #let ii = sym.dotless.i #let al = sym.angle.l #let ar = sym.angle.r #let cdot = sym.dot.c #let to = sym.arrow.r #let span = text("span") #let img = text("Im") #let ker = text("Ker") #let tp = sym.times.circle #let sendto = sym.arrow.r.bar #let L1 = $cal(L)^1$ #let L2 = $cal(L)^2$ #let Lp = $cal(L)^p$ #let caniso = sym.tilde.equiv #let conj(body) = $overline(body)$ #let inv(body) = $body^(-1)$
https://github.com/7sDream/fonts-and-layout-zhCN
https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/06-features-2/anchor/mark.typ
typst
Other
#import "/template/template.typ": web-page-template #import "/template/components.typ": note #import "/lib/glossary.typ": tr #show: web-page-template // ### Mark positioning === 符号#tr[positioning] // Anchors can also be used to position "mark" glyphs (such as accents) above "base" glyphs. The anusvara (nasalisation) mark in Devanagari is usually placed above a consonant, but where exactly does it go? It often goes above the descending stroke - but not always: 锚点也能够用来#tr[positioning]位于基本#tr[glyph]顶部的“符号”#tr[glyph](比如变音符等)。天城文中在元音上会有表示鼻音化的随韵符,但它们的位置很难准确指定。它们通常位于#tr[decender]笔画的正上方,但也不总是这样: #figure(placement: none)[#include "anusvara.typ"] // Again, your font editor will usually help you to create the anchors which make this work, but let's see what is going on underneath. (We're looking at the Hind font from Indian Type Foundry.) 和之前一样,字体编辑软件通常会帮助你完成创建锚点的工作,但我们还是来看看这到底是怎么完成的。(本例我们使用的是 Indian Type Foundary 的 Hind 字体) // According to Microsoft's [Devanagari script guidelines](https://docs.microsoft.com/en-us/typography/script-development/devanagari#shaping-engine), we should use the `abvm` feature for positioning the anusvara. First, we declare an anchor on the anusvara mark. We do this by asking for a mark class (even though there's only one glyph in this class), called `@MC_abvm.bindu`. 根据微软的天城文字体开发规范@Microsoft.DevelopingDevanagari,应该使用`abvm`特性来完成对随韵符的#tr[positioning]。首先,我们需要在随韵符#tr[glyph]中声明一个锚点,这可以通过创建一个符号类(虽然里面只有一个#tr[glyph])来完成。我们把这个类叫做 `@MC_abvm.bindu`。 ```fea markClass dvAnusvara <anchor -94 642> @MC_abvm.bindu; ``` // This specifies a point (with coordinates -94,642) on the `dvAnusvara` glyph which we will use for attachment. 这在`dvAnusvara`#tr[glyph]中指定了一个坐标为 `(-94, 642)` 的点作为它的锚点。 // Next, in our `abvm` feature, we will declare how this mark is attached to the base glyphs, using the `pos base` (or `position base`) command: `pos base *baseGlyph* anchor mark *markclass*` 下一步,我们需要在 `abvm` 特性中定义这个符号需要衔接到基本#tr[glyph]的什么位置。这可以使用`pos base`(或者`position base`)命令,语法为:```fea pos base *baseGlyph* *anchor* mark *markclass*```。 ```fea feature abvm { pos base dvAA <anchor 704 642> mark @MC_abvm.bindu; pos base dvAI <anchor 592 642> mark @MC_abvm.bindu; pos base dvB_DA <anchor 836 642> mark @MC_abvm.bindu; #... } abvm; ``` // This says "you can attach any marks in the class `MV_abvm.bindu` to the glyph `dvAA` at position 704,642; on glyph `dvAI`, they should be attached at position 592,642" and so on. 这段代码的意思是:你可以把`MV_abvm.bindu`符号类中的任何符号衔接到`dvAA`#tr[glyph]的 `(704, 642)` 座标处;对于`dvAI`#tr[glyph],衔接到坐标 `(592, 642)`;以此类推。
https://github.com/zurgl/typst-resume
https://raw.githubusercontent.com/zurgl/typst-resume/main/templates/resume/entry.typ
typst
#import "../../metadata.typ": * #import "../commun.typ": * #import "@preview/fontawesome:0.1.0": * /* fill: regularColors.subtlegray, */ /* cv entry specific */ #let entryTagStyle(str) = { align(center, text(white, size: 7pt, weight: "medium", str)) } #let entryTagListStyle(tags) = { for tag in tags { box( inset: (x: 0.3em), outset: (y: 0.3em), fill: rgb("#53565c"), radius: 5pt, entryTagStyle(tag), stroke: rgb("#000000") ) h(5pt) } } #let entryA1Style(str) = { text(size: 10pt, weight: "bold", str) } #let entryA2Style(str) = { align( right, text(weight: "medium", fill: accentColor, style: "oblique", str), ) } #let entryB1Style(str) = { text(size: 8pt, fill: accentColor, weight: "medium", smallcaps(str)) } #let entryB2Style(str) = { align( right, text(size: 8pt, weight: "medium", fill: gray, style: "oblique", str), ) } #let entryDescriptionStyle(str) = { text(fill: regularColors.lightgray, { v(beforeEntryDescriptionSkip) str }) } #let cvEntry( title: "Title", society: "Society", date: "Date", location: "Location", description: "Description", logo: "", tags: (), double: "", ) = { let ifSocietyFirst(condition, field1, field2) = { return if condition { field1 } else { field2 } } let ifLogo(path, ifTrue, ifFalse, two) = { return if varDisplayLogo { if path == "" { ifFalse } else { if two == "" { ifTrue} else { 8% } } } else { ifFalse } } let setLogoLength(path) = { return if path == "" { 0% } else { 4% } } let setLogoContent(path) = { return if logo == "" [] else { image("../../assets/logos/" + path, width: 100%) } } v(beforeEntrySkip) table( columns: (ifLogo(logo, 4%, 0%, double), 1fr), inset: 0pt, stroke: none, align: horizon, column-gutter: ifLogo(logo, 4pt, 0pt, ""), setLogoContent(logo), table( columns: (1fr, auto), inset: 0pt, stroke: none, row-gutter: 6pt, align: auto, { entryA1Style(ifSocietyFirst(varEntrySocietyFirst, society, title)) }, { entryA2Style(ifSocietyFirst(varEntrySocietyFirst, location, date)) }, { entryB1Style(ifSocietyFirst(varEntrySocietyFirst, title, society)) }, { entryB2Style(ifSocietyFirst(varEntrySocietyFirst, date, location)) }, ), ) entryDescriptionStyle(description) { align(left, entryTagListStyle(tags)) } }
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-116D0.typ
typst
Apache License 2.0
#let data = ( ("MYANMAR PAO DIGIT ZERO", "Nd", 0), ("MYANMAR PAO DIGIT ONE", "Nd", 0), ("MYANMAR PAO DIGIT TWO", "Nd", 0), ("MYANMAR PAO DIGIT THREE", "Nd", 0), ("MYANMAR PAO DIGIT FOUR", "Nd", 0), ("MYANMAR PAO DIGIT FIVE", "Nd", 0), ("MYANMAR PAO DIGIT SIX", "Nd", 0), ("MYANMAR PAO DIGIT SEVEN", "Nd", 0), ("MYANMAR PAO DIGIT EIGHT", "Nd", 0), ("MYANMAR PAO DIGIT NINE", "Nd", 0), ("MYANMAR EASTERN PWO KAREN DIGIT ZERO", "Nd", 0), ("MYANMAR EASTERN PWO KAREN DIGIT ONE", "Nd", 0), ("MYANMAR EASTERN PWO KAREN DIGIT TWO", "Nd", 0), ("MYANMAR EASTERN PWO KAREN DIGIT THREE", "Nd", 0), ("MYANMAR EASTERN PWO KAREN DIGIT FOUR", "Nd", 0), ("MYANMAR EASTERN PWO KAREN DIGIT FIVE", "Nd", 0), ("MYANMAR EASTERN PWO KAREN DIGIT SIX", "Nd", 0), ("MYANMAR EASTERN PWO KAREN DIGIT SEVEN", "Nd", 0), ("MYANMAR EASTERN PWO KAREN DIGIT EIGHT", "Nd", 0), ("MYANMAR EASTERN PWO KAREN DIGIT NINE", "Nd", 0), )
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/lint/markup.typ
typst
Apache License 2.0
/// Test markup lints. // Ref: false --- // Warning: 1-3 no text within stars // Hint: 1-3 using multiple consecutive stars (e.g. **) has no additional effect ** --- // Warning: 1-3 no text within stars // Hint: 1-3 using multiple consecutive stars (e.g. **) has no additional effect // Warning: 11-13 no text within stars // Hint: 11-13 using multiple consecutive stars (e.g. **) has no additional effect **not bold** --- // Warning: 1-3 no text within underscores // Hint: 1-3 using multiple consecutive underscores (e.g. __) has no additional effect __ --- // Warning: 1-3 no text within underscores // Hint: 1-3 using multiple consecutive underscores (e.g. __) has no additional effect // Warning: 13-15 no text within underscores // Hint: 13-15 using multiple consecutive underscores (e.g. __) has no additional effect __not italic__
https://github.com/ohmycloud/computer-science-notes
https://raw.githubusercontent.com/ohmycloud/computer-science-notes/main/Misc/weekly.typ
typst
#import "@preview/cetz:0.1.1" #import "@preview/splash:0.3.0": * #let code(body, color, orientation: bool) = { set text(size: 18pt, weight: "regular") show: box.with( fill: color, inset: 0.4em, radius: 3pt, baseline: 0.4em, width: if orientation == true { 100% } else { 50% }, height: if orientation == true { 30% } else { 10% }, ) align(center)[#body] } #show "你": it => { text(red)[#it] } #show heading.where(level: 1): it => { align(left)[#code(text(tol-light.light-blue)[ *#it*], rgb(23,45,56))] v(0.25em) } #let weeks = ("周一", "周二", "周三", "周四") #let indices = range(weeks.len()) #let data(orientation) = weeks.zip(indices).map( ((v, k)) => if calc.even(k) { code(v, rgb(12,165,160), orientation: orientation) } else { code(v, rgb(165,250,178), orientation: orientation) } ) #let weekly_cols(title) = [ #grid( columns: (auto,) * data(true).len(), rows: (auto), row-gutter: 10pt, column-gutter: (10pt, 25pt), ..data(true) ) ] // 一列多行 #let weekly_rows(title) = [ #grid( columns: (auto), rows: (auto,) * data(false).len(), row-gutter: (10pt, ) * (data(false).len() - 1), column-gutter: 10pt, ..data(false) ) ] #weekly_cols("test") // #pagebreak() // #weekly_rows("title")
https://github.com/uben0/tree-sitter-typst
https://raw.githubusercontent.com/uben0/tree-sitter-typst/master/README.md
markdown
MIT License
# A TreeSitter grammar for the Typst language Typst official page https://typst.app TreeSitter documentation page https://tree-sitter.github.io Typst doesn't have yet an official TreeSitter grammar. This grammar is complete but may contains bug as it is very recent. ## Get involved Your help is welcome. You don't have to know anything about tree-sitter to help. We need you to find bugs! Find a bug by using this grammar. If you find an incorrect highlighting of your Typst files, then you found a bug. You can open an issue or simply send me by mail the Typst code causing the bug. See below installation instructions for this grammar. Even if your not sure it is a bug, it doesn't hurt to repport it. Any inconsistancy between this syntax and Typst's one is considered a bug. In Helix editor, the syntax tree of selected text can be displayed with `:tree-sitter-subtree` command. Don't hesitate to contact me: <EMAIL> The documentation of this implementation is available in [DOC](DOC.md). Because parsing Typst is really tricky. It would also be great to have a competitor parser, to see if the other finds better ways, and for redunduncy, because as of today, only one person understand how this parser works (me), and if I'm out, this parser won't be maintained (I guess). If your interresting in implementing a competitor Typst tree-sitter parser, I'd be happy to help you. ## TODO - [ ] Update 0.12 - [X] New import syntax - [ ] Other changes? - [ ] More tests, objectif 1000, current 433 - [X] Installation - [X] Helix - [X] Emacs - [X] NeoVim - [ ] Simplification - [ ] Implement a type 3/4 parser generator (work in progress) - [ ] Migrate all lexing to external scanner - [ ] Remove dependency on `get_column` - [ ] Check if this fixes [`fixme/011`](corpus/fixme.scm) ## Features - [X] Markup mode - [X] Code mode - [X] Math mode - [X] Indentation - [X] Foldable sections - [X] Unicode characters # Installation Having syntax highlighting is great but having syntax highlighting and the language server is even greater. If you have `cargo` installed (Rust's package manager), you can install Typst language server with the following command (you don't have to be in any particular directory): ```sh cargo install --git https://github.com/nvarner/typst-lsp typst-lsp ``` ## Neovim The https://github.com/nvim-treesitter/nvim-treesitter provides this grammar. ## Emacs Typst support for Emacs is available through the following package: [typst-ts-mode](https://git.sr.ht/~meow_king/typst-ts-mode) ```scheme (use-package typst-ts-mode :elpaca (:type git :host sourcehut :repo "meow_king/typst-ts-mode") :custom (typst-ts-mode-watch-options "--open")) ``` ## Helix The next release of Helix will support Typst. Waiting until then, you can add support for Typst with the following instructions: 1. Locate the configuration directory: - Global `/usr/share/helix` - Local `~/.config/helix` 2. Append the following configuration to the `languages.toml` file (create it if it doesn't exist). ```toml [language-server.typst-lsp] command = "typst-lsp" [[language]] name = "typst" scope = "source.typst" file-types = ["typst", "typ"] indent = { tab-width = 2, unit = " " } comment-token = "//" injection-regex = "typ(st)?" roots = ["typst.toml"] language-servers = [ "typst-lsp" ] [language.auto-pairs] '(' = ')' '{' = '}' '[' = ']' '$' = '$' '"' = '"' [[grammar]] name = "typst" source.git = "https://github.com/uben0/tree-sitter-typst" source.rev = "master" ``` 3. Copy the content of the `queries` directory (`highlights.scm` and `injections.scm`) inside your corresponding `runtime/queries/typst` directory. You should have the following structure: ``` config.toml languages.toml runtime └── queries └── typst ├── highlights.scm └── injections.scm ``` 4. And finally execute (you don't have to be in any particular directory): ```sh hx --grammar fetch hx --grammar build ``` The fetch command will clone the git repository, and the build command will compile the grammar.
https://github.com/zjutjh/zjut-report-typst
https://raw.githubusercontent.com/zjutjh/zjut-report-typst/main/template/template.typ
typst
#import "fonts.typ" :* #import "utils.typ" :* #import "covers.typ":* #let _empty_par() = { v(-1em) box() } #let project( title: "Title", authors: ("author1", "author2"), date: (2023, 5, 14), name: "测试名称", cover_style: "normal", class:"计科2000", grade:"2021", department:"计算机科学与技术学院", id:"2020000000", body ) = { set document(title: title, author: authors); set page("a4", numbering: "1") set text(font: font_style.songti, size: font_size.五号, lang: "zh"); set par(first-line-indent: 2em); if cover_style == "normal" { cover_normal( title: title, authors: authors, date: date ); } else if cover_style == "zjut_report" { cover_zjut_report( title:title, author:authors, name:name, class:class, grade:grade, department:department, date:date, id:id, ); } else { cover_normal( title: title, authors: authors, date: date ); } show figure: it => { set align(center) locate(loc => { let chapt = counter(heading).at(loc).at(0) let c = counter(it.kind + "-chapter" + str(chapt)) c.step() }) if it.kind == "image" { set text(font: font_style.heiti, size: 12pt) it.body it.caption } else if it.kind == "table" { set text(font: font_style.heiti, size: 12pt) it.caption set text(font: font_style.songti, size: 10.5pt) it.body } else if it.kind == "equation" { // 通过大比例来达到中间和靠右的排布 grid( columns: (20fr, 1fr), it.body, align(center + horizon, it.counter.display(it.numbering) ) ) } else if it.kind == "code"{ set text(font: font_style.songti, size: 10.5pt) it.body set text(font: font_style.songti, size: 10pt) it.caption } else { it } } show heading: it => { set text(weight: "bold", font: font_style.heiti, size: 12pt) set block(above: 1.5em, below: 1em) it } + _empty_par() set heading(numbering: (..nums) => { nums.pos().map(str).join(".") + " " }) show heading.where(level: 1): it => { set align(center) set text(weight: "bold", font: font_style.songti, size: 14pt) set block(spacing: 1em) it } show heading.where(level: 2): it => { set text(weight: "bold", font: font_style.songti, size: 12.5pt) it } body }
https://github.com/phinixplus/docs
https://raw.githubusercontent.com/phinixplus/docs/master/README.md
markdown
Other
# PHINIX+ Documentation This is the repository containing architectural documentation for the PHINIX+ system. Contained within are several separate documents addressing each part of a complete system. The document source is written using [Typst](https://github.com/typst/typst). The contents of this repository are licensed under the [CC BY-NC-SA 4.0](LICENSE.txt) license. ## Contents - Part 1: [CPU](documents/cpu.pdf) ## Versioning The document versioning system is to indicate the severity of the changes being made. Each version is made out of three numbers separated by dots (x.y.z) with an increment to X indicating severe, braking changes to the specification, to Y indicating an augmentation of the specification, and to Z indicating bugfix / addressing of errata. ### Special Cases - **0.0.0**: Workspace setup - **0.0.z**: Initial template development - **0.y.z**: Initial document draft - **x.y.z**: Subsequent document releases
https://github.com/typst-jp/typst-jp.github.io
https://raw.githubusercontent.com/typst-jp/typst-jp.github.io/main/docs/changelog/0.1.0.md
markdown
Apache License 2.0
--- title: 0.1.0 description: Changes in Typst 0.1.0 --- # Version 0.1.0 (April 04, 2023) ## Breaking changes - When using the CLI, you now have to use subcommands: - `typst compile file.typ` or `typst c file.typ` to create a PDF - `typst watch file.typ` or `typst w file.typ` to compile and watch - `typst fonts` to list all fonts - Manual counters now start at zero. Read the "How to step" section [here]($counter) for more details - The [bibliography styles]($bibliography.style) `{"author-date"}` and `{"author-title"}` were renamed to `{"chicago-author-date"}` and `{"chicago-author-title"}` ## Figure improvements - Figures now automatically detect their content and adapt their behavior. Figures containing tables, for instance, are automatically prefixed with "Table X" and have a separate counter - The figure's supplement (e.g. "Figure" or "Table") can now be customized - In addition, figures can now be completely customized because the show rule gives access to the automatically resolved kind, supplement, and counter ## Bibliography improvements - The [`bibliography`] now also accepts multiple bibliography paths (as an array) - Parsing of BibLaTeX files is now more permissive (accepts non-numeric edition, pages, volumes, dates, and Jabref-style comments; fixed abbreviation parsing) - Labels and references can now include `:` and `.` except at the end - Fixed APA bibliography ordering ## Drawing additions - Added [`polygon`] function for drawing polygons - Added support for clipping in [boxes]($box.clip) and [blocks]($block.clip) ## Command line interface - Now returns with non-zero status code if there is an error - Now watches the root directory instead of the current one - Now puts the PDF file next to input file by default - Now accepts more kinds of input files (e.g. `/dev/stdin`) - Added `--open` flag to directly open the PDF ## Miscellaneous improvements - Added [`yaml`] function to load data from YAML files - Added basic i18n for a few more languages (IT, RU, ZH, FR, PT) - Added numbering support for Hebrew - Added support for [integers]($int) with base 2, 8, and 16 - Added symbols for double bracket and laplace operator - The [`link`] function now accepts [labels]($label) - The link syntax now allows more characters - Improved justification of Japanese and Chinese text - Calculation functions behave more consistently w.r.t to non-real results - Replaced deprecated angle brackets - Reduced maximum function call depth from 256 to 64 - Fixed [`first-line-indent`]($par.first-line-indent) being not applied when a paragraph starts with styled text - Fixed extraneous spacing in unary operators in equations - Fixed block spacing, e.g. in `{block(above: 1cm, below: 1cm, ..)}` - Fixed styling of text operators in math - Fixed invalid parsing of language tag in raw block with a single backtick - Fixed bugs with displaying counters and state - Fixed crash related to page counter - Fixed crash when [`symbol`] function was called without arguments - Fixed crash in bibliography generation - Fixed access to label of certain content elements - Fixed line number in error message for CSV parsing - Fixed invalid autocompletion after certain markup elements ## Contributors <contributors from="v23-03-28" to="v0.1.0" />
https://github.com/jamesrswift/pixel-pipeline
https://raw.githubusercontent.com/jamesrswift/pixel-pipeline/main/src/layers/drawing/shapes/lib.typ
typst
The Unlicense
#import "polygon.typ": polygon
https://github.com/AOx0/expo-nosql
https://raw.githubusercontent.com/AOx0/expo-nosql/main/book/src/theme-gallery/bipartite.typ
typst
MIT License
#import "../../../slides.typ": * #import "../../../themes/bipartite.typ": * #show: slides.with( authors: ("Author A", "Author B"), short-authors: "Short author", title: "Title", short-title: "Short title", subtitle: "Subtitle", date: "Date", theme: bipartite-theme(), ) #slide(theme-variant: "title slide") #new-section("section name") #slide(title: "A longer slide title")[ #lorem(40) ] #slide(theme-variant: "east", title: "On the right!")[ #lorem(40) ] #slide(theme-variant: "center split")[ #lorem(40) ][ #lorem(40) ]
https://github.com/katamyra/Notes
https://raw.githubusercontent.com/katamyra/Notes/main/README.md
markdown
This is a collection of all my Georgia Tech notes/discussion preparation/study guides. Most of my preliminary notes are written on **Obsidian**, and are on the .md file format. Note: currently, images from these md files don't show when viewing from github. More thorough compiled notes that I write to study for tests are stored in Compiled Notes/. These are compiled into PDF's primarily using **Typst**. Viewing compiled notes on a chrome viewer rather than Github's built in viewer allows you to skip around using the table of contents. # Current Notes I am Taking *CS 1332* - Data Structures and Algorithms *CS 2340* - Objects and Design *CS 3001* - CS Ethics *CS 2110* - Computer Organization and Programming
https://github.com/alireza-hariri/my-cv
https://raw.githubusercontent.com/alireza-hariri/my-cv/main/hariri-cv.typ
typst
//#import "@preview/modern-cv:0.6.0": * #import "./lib.typ": * #show: resume.with( author: ( firstname: "Alireza", lastname: "Hariri", email: "<EMAIL>", // homepage: "https://example.com", phone: "(+98) 936-521-2590", github: "alireza-hariri", // twitter: "typstapp", // scholar: "", // orcid: "0000-0000-0000-000X", birth: "August 29, 1992", linkedin: "alireza-hariri-0b5b8455", linkedinName:"alireza-hariri", // address: "111 Example St. Example City, EX 11111", positions: ( "Data Scientist", "Software Engineer", "Deep Learning Specialist", ), ), date: datetime.today().display(), language: "en", colored-headers: true, show-footer: false, ) = Experience #resume-entry( title: "Data Scientist", location: "Tehran", date: "2020 - 2024", description: "Hara co.", title-link: "https://hara.ai", ) #resume-item[ - Designed and developed a speech search-engine on a 50,000-hour dataset, which can find queries based on combinations of keywords and metadata filtering. - Trained and managed large-scale speech-to-text models, handling over 70GB of compressed data. - Built a neural network from scratch for speech-understanding tasks. - Achieved up to 20x speed optimizations in text normalization, improving processing efficiency. - Improved inference time by 55% in a critical production bottleneck. - Improving labeling pipelines. ] #resume-entry( title: "Developer", location: "Tehran", date: "May 2018 - August 2018", description: "Frontend Developer at Kalapich", title-link: "https://kalapich.com/", ) #resume-item[ - Created the website with `react` from scratch. - A bit of data analyses with python. ] #resume-entry( title: "Intern", location: "Tehran, Shahid Beheshti University", date: "May 2019 - August 2020", description: "Natural Language Processing lab.", title-link: "https://encse.sbu.ac.ir/en/natural-language-processing", ) #resume-item[ - Trained a question pair similarity detection model with pytorch. - Worked with word embeddings and convolution. - Learned `pytorch` here. ] = Example Projects #resume-entry( title: "Simple Retriever", location: [#github-link("alireza-hariri/simple-retriever")], description: "A simple wrapper around common retrieval tools in python", ) #resume-item[ - Dense and sparce retrieval methods. - Examples of typo-tolerant `tf-idf` retrieval by `sk-learn`. ] #resume-entry( title: "Long-Polling tool for python", location: [#github-link("alireza-hariri/long-polling")], description: "Long-polling tool for asynchronous Python backend.", ) #resume-item[ - Real-time message passing between server and clients without using sockets. - Asynchronous (with `asyncio`). - load-tested (with `geventhttp`). ] = Skills #resume-skill-item( "Languages", (strong("Python"), "C", " JavaScript"), ) #resume-skill-item("Spoken Languages", (("English"), "Persian")) #resume-skill-item( "tools", (strong("pytorch"),strong("numpy"), "linux", "scikit-learn", "flask"), ) = Education #resume-entry( title: "University Of Tehran", // location: "Example City, EX", date: " September 2018 - October 2021", description: "Master of Science (MS), Artificial Intelligence And Robotics", ) #resume-item[ - Enjoyed practical and theoretical courses such as #underline("Active Learning"), #underline("Complex Networks"), and #underline("Statistical Inference"). - Thesis: Neural Architecture Search on residually connected networks. ] #resume-entry( title: "University Of Tehran", // location: "Example City, EX", date: "October 2011 - September 2016", description: "Bachelor of Science (BS), Engineering Science (Electronics Engineering)", ) #resume-item[ - Learned a lot of things like #underline("FPGA-Programming") and #underline("Circuit-Design") in this period. ]
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-12000.typ
typst
Apache License 2.0
#let data = ( ("CUNEIFORM SIGN A", "Lo", 0), ("CUNEIFORM SIGN A TIMES A", "Lo", 0), ("CUNEIFORM SIGN A TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN A TIMES GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN A TIMES HA", "Lo", 0), ("CUNEIFORM SIGN A TIMES IGI", "Lo", 0), ("CUNEIFORM SIGN A TIMES LAGAR GUNU", "Lo", 0), ("CUNEIFORM SIGN A TIMES MUSH", "Lo", 0), ("CUNEIFORM SIGN A TIMES SAG", "Lo", 0), ("CUNEIFORM SIGN A2", "Lo", 0), ("CUNEIFORM SIGN AB", "Lo", 0), ("CUNEIFORM SIGN AB TIMES ASH2", "Lo", 0), ("CUNEIFORM SIGN AB TIMES DUN3 GUNU", "Lo", 0), ("CUNEIFORM SIGN AB TIMES GAL", "Lo", 0), ("CUNEIFORM SIGN AB TIMES GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN AB TIMES HA", "Lo", 0), ("CUNEIFORM SIGN AB TIMES IGI GUNU", "Lo", 0), ("CUNEIFORM SIGN AB TIMES IMIN", "Lo", 0), ("CUNEIFORM SIGN AB TIMES LAGAB", "Lo", 0), ("CUNEIFORM SIGN AB TIMES SHESH", "Lo", 0), ("CUNEIFORM SIGN AB TIMES U PLUS U PLUS U", "Lo", 0), ("CUNEIFORM SIGN AB GUNU", "Lo", 0), ("CUNEIFORM SIGN AB2", "Lo", 0), ("CUNEIFORM SIGN AB2 TIMES BALAG", "Lo", 0), ("CUNEIFORM SIGN AB2 TIMES GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN AB2 TIMES ME PLUS EN", "Lo", 0), ("CUNEIFORM SIGN AB2 TIMES SHA3", "Lo", 0), ("CUNEIFORM SIGN AB2 TIMES TAK4", "Lo", 0), ("CUNEIFORM SIGN AD", "Lo", 0), ("CUNEIFORM SIGN AK", "Lo", 0), ("CUNEIFORM SIGN AK TIMES ERIN2", "Lo", 0), ("CUNEIFORM SIGN AK TIMES SHITA PLUS GISH", "Lo", 0), ("CUNEIFORM SIGN AL", "Lo", 0), ("CUNEIFORM SIGN AL TIMES AL", "Lo", 0), ("CUNEIFORM SIGN AL TIMES DIM2", "Lo", 0), ("CUNEIFORM SIGN AL TIMES GISH", "Lo", 0), ("CUNEIFORM SIGN AL TIMES HA", "Lo", 0), ("CUNEIFORM SIGN AL TIMES KAD3", "Lo", 0), ("CUNEIFORM SIGN AL TIMES KI", "Lo", 0), ("CUNEIFORM SIGN AL TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN AL TIMES USH", "Lo", 0), ("CUNEIFORM SIGN ALAN", "Lo", 0), ("CUNEIFORM SIGN ALEPH", "Lo", 0), ("CUNEIFORM SIGN AMAR", "Lo", 0), ("CUNEIFORM SIGN AMAR TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN AN", "Lo", 0), ("CUNEIFORM SIGN AN OVER AN", "Lo", 0), ("CUNEIFORM SIGN AN THREE TIMES", "Lo", 0), ("CUNEIFORM SIGN AN PLUS NAGA OPPOSING AN PLUS NAGA", "Lo", 0), ("CUNEIFORM SIGN AN PLUS NAGA SQUARED", "Lo", 0), ("CUNEIFORM SIGN ANSHE", "Lo", 0), ("CUNEIFORM SIGN APIN", "Lo", 0), ("CUNEIFORM SIGN ARAD", "Lo", 0), ("CUNEIFORM SIGN ARAD TIMES KUR", "Lo", 0), ("CUNEIFORM SIGN ARKAB", "Lo", 0), ("CUNEIFORM SIGN ASAL2", "Lo", 0), ("CUNEIFORM SIGN ASH", "Lo", 0), ("CUNEIFORM SIGN ASH ZIDA TENU", "Lo", 0), ("CUNEIFORM SIGN ASH KABA TENU", "Lo", 0), ("CUNEIFORM SIGN ASH OVER ASH TUG2 OVER TUG2 TUG2 OVER TUG2 PAP", "Lo", 0), ("CUNEIFORM SIGN ASH OVER ASH OVER ASH", "Lo", 0), ("CUNEIFORM SIGN ASH OVER ASH OVER ASH CROSSING ASH OVER ASH OVER ASH", "Lo", 0), ("CUNEIFORM SIGN ASH2", "Lo", 0), ("CUNEIFORM SIGN ASHGAB", "Lo", 0), ("CUNEIFORM SIGN BA", "Lo", 0), ("CUNEIFORM SIGN BAD", "Lo", 0), ("CUNEIFORM SIGN BAG3", "Lo", 0), ("CUNEIFORM SIGN BAHAR2", "Lo", 0), ("CUNEIFORM SIGN BAL", "Lo", 0), ("CUNEIFORM SIGN BAL OVER BAL", "Lo", 0), ("CUNEIFORM SIGN BALAG", "Lo", 0), ("CUNEIFORM SIGN BAR", "Lo", 0), ("CUNEIFORM SIGN BARA2", "Lo", 0), ("CUNEIFORM SIGN BI", "Lo", 0), ("CUNEIFORM SIGN BI TIMES A", "Lo", 0), ("CUNEIFORM SIGN BI TIMES GAR", "Lo", 0), ("CUNEIFORM SIGN BI TIMES IGI GUNU", "Lo", 0), ("CUNEIFORM SIGN BU", "Lo", 0), ("CUNEIFORM SIGN BU OVER BU AB", "Lo", 0), ("CUNEIFORM SIGN BU OVER BU UN", "Lo", 0), ("CUNEIFORM SIGN BU CROSSING BU", "Lo", 0), ("CUNEIFORM SIGN BULUG", "Lo", 0), ("CUNEIFORM SIGN BULUG OVER BULUG", "Lo", 0), ("CUNEIFORM SIGN BUR", "Lo", 0), ("CUNEIFORM SIGN BUR2", "Lo", 0), ("CUNEIFORM SIGN DA", "Lo", 0), ("CUNEIFORM SIGN DAG", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES A PLUS MASH", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES AMAR", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES BALAG", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES BI", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES GA", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES GA PLUS MASH", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES GI", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES GIR2", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES GUD", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES HA", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES IR", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES IR PLUS LU", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES KAK", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES LA", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES LU", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES LU PLUS MASH2", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES LUM", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES NE", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES PAP PLUS PAP", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES SI", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES TAK4", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES U2 PLUS GIR2", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES USH", "Lo", 0), ("CUNEIFORM SIGN DAM", "Lo", 0), ("CUNEIFORM SIGN DAR", "Lo", 0), ("CUNEIFORM SIGN DARA3", "Lo", 0), ("CUNEIFORM SIGN DARA4", "Lo", 0), ("CUNEIFORM SIGN DI", "Lo", 0), ("CUNEIFORM SIGN DIB", "Lo", 0), ("CUNEIFORM SIGN DIM", "Lo", 0), ("CUNEIFORM SIGN DIM TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN DIM2", "Lo", 0), ("CUNEIFORM SIGN DIN", "Lo", 0), ("CUNEIFORM SIGN DIN KASKAL U GUNU DISH", "Lo", 0), ("CUNEIFORM SIGN DISH", "Lo", 0), ("CUNEIFORM SIGN DU", "Lo", 0), ("CUNEIFORM SIGN DU OVER DU", "Lo", 0), ("CUNEIFORM SIGN DU GUNU", "Lo", 0), ("CUNEIFORM SIGN DU SHESHIG", "Lo", 0), ("CUNEIFORM SIGN DUB", "Lo", 0), ("CUNEIFORM SIGN DUB TIMES ESH2", "Lo", 0), ("CUNEIFORM SIGN DUB2", "Lo", 0), ("CUNEIFORM SIGN DUG", "Lo", 0), ("CUNEIFORM SIGN DUGUD", "Lo", 0), ("CUNEIFORM SIGN DUH", "Lo", 0), ("CUNEIFORM SIGN DUN", "Lo", 0), ("CUNEIFORM SIGN DUN3", "Lo", 0), ("CUNEIFORM SIGN DUN3 GUNU", "Lo", 0), ("CUNEIFORM SIGN DUN3 GUNU GUNU", "Lo", 0), ("CUNEIFORM SIGN DUN4", "Lo", 0), ("CUNEIFORM SIGN DUR2", "Lo", 0), ("CUNEIFORM SIGN E", "Lo", 0), ("CUNEIFORM SIGN E TIMES PAP", "Lo", 0), ("CUNEIFORM SIGN E OVER E NUN OVER NUN", "Lo", 0), ("CUNEIFORM SIGN E2", "Lo", 0), ("CUNEIFORM SIGN E2 TIMES A PLUS HA PLUS DA", "Lo", 0), ("CUNEIFORM SIGN E2 TIMES GAR", "Lo", 0), ("CUNEIFORM SIGN E2 TIMES MI", "Lo", 0), ("CUNEIFORM SIGN E2 TIMES SAL", "Lo", 0), ("CUNEIFORM SIGN E2 TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN E2 TIMES U", "Lo", 0), ("CUNEIFORM SIGN EDIN", "Lo", 0), ("CUNEIFORM SIGN EGIR", "Lo", 0), ("CUNEIFORM SIGN EL", "Lo", 0), ("CUNEIFORM SIGN EN", "Lo", 0), ("CUNEIFORM SIGN EN TIMES GAN2", "Lo", 0), ("CUNEIFORM SIGN EN TIMES GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN EN TIMES ME", "Lo", 0), ("CUNEIFORM SIGN EN CROSSING EN", "Lo", 0), ("CUNEIFORM SIGN EN OPPOSING EN", "Lo", 0), ("CUNEIFORM SIGN EN SQUARED", "Lo", 0), ("CUNEIFORM SIGN EREN", "Lo", 0), ("CUNEIFORM SIGN ERIN2", "Lo", 0), ("CUNEIFORM SIGN ESH2", "Lo", 0), ("CUNEIFORM SIGN EZEN", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES A", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES A PLUS LAL", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES A PLUS LAL TIMES LAL", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES AN", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES DUN3 GUNU", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES DUN3 GUNU GUNU", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES HA", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES HA GUNU", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES IGI GUNU", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES KASKAL", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES KASKAL SQUARED", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES KU3", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES LA", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES LAL TIMES LAL", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES LI", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES LU", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES U2", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES UD", "Lo", 0), ("CUNEIFORM SIGN GA", "Lo", 0), ("CUNEIFORM SIGN GA GUNU", "Lo", 0), ("CUNEIFORM SIGN GA2", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES A PLUS DA PLUS HA", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES A PLUS HA", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES A PLUS IGI", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES AB2 TENU PLUS TAB", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES AN", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES ASH", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES ASH2 PLUS GAL", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES BAR PLUS RA", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES BUR", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES BUR PLUS RA", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES DA", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES DI", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES DIM TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES DUB", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES EL", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES EL PLUS LA", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES EN", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES EN TIMES GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES GAR", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES GI", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES GI4", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES GI4 PLUS A", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES GIR2 PLUS SU", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES HA PLUS LU PLUS ESH2", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES HAL", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES HAL PLUS LA", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES HI PLUS LI", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES HUB2", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES IGI GUNU", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES ISH PLUS HU PLUS ASH", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES KAK", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES KASKAL", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES KID", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES KID PLUS LAL", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES KU3 PLUS AN", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES LA", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES ME PLUS EN", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES MI", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES NUN", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES NUN OVER NUN", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES PA", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES SAL", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES SAR", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES SHE PLUS TUR", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES SHID", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES SUM", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES TAK4", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES U", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES UD", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES UD PLUS DU", "Lo", 0), ("CUNEIFORM SIGN GA2 OVER GA2", "Lo", 0), ("CUNEIFORM SIGN GABA", "Lo", 0), ("CUNEIFORM SIGN GABA CROSSING GABA", "Lo", 0), ("CUNEIFORM SIGN GAD", "Lo", 0), ("CUNEIFORM SIGN GAD OVER GAD GAR OVER GAR", "Lo", 0), ("CUNEIFORM SIGN GAL", "Lo", 0), ("CUNEIFORM SIGN GAL GAD OVER GAD GAR OVER GAR", "Lo", 0), ("CUNEIFORM SIGN GALAM", "Lo", 0), ("CUNEIFORM SIGN GAM", "Lo", 0), ("CUNEIFORM SIGN GAN", "Lo", 0), ("CUNEIFORM SIGN GAN2", "Lo", 0), ("CUNEIFORM SIGN GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN GAN2 OVER GAN2", "Lo", 0), ("CUNEIFORM SIGN GAN2 CROSSING GAN2", "Lo", 0), ("CUNEIFORM SIGN GAR", "Lo", 0), ("CUNEIFORM SIGN GAR3", "Lo", 0), ("CUNEIFORM SIGN GASHAN", "Lo", 0), ("CUNEIFORM SIGN GESHTIN", "Lo", 0), ("CUNEIFORM SIGN GESHTIN TIMES KUR", "Lo", 0), ("CUNEIFORM SIGN GI", "Lo", 0), ("CUNEIFORM SIGN GI TIMES E", "Lo", 0), ("CUNEIFORM SIGN GI TIMES U", "Lo", 0), ("CUNEIFORM SIGN GI CROSSING GI", "Lo", 0), ("CUNEIFORM SIGN GI4", "Lo", 0), ("CUNEIFORM SIGN GI4 OVER GI4", "Lo", 0), ("CUNEIFORM SIGN GI4 CROSSING GI4", "Lo", 0), ("CUNEIFORM SIGN GIDIM", "Lo", 0), ("CUNEIFORM SIGN GIR2", "Lo", 0), ("CUNEIFORM SIGN GIR2 GUNU", "Lo", 0), ("CUNEIFORM SIGN GIR3", "Lo", 0), ("CUNEIFORM SIGN GIR3 TIMES A PLUS IGI", "Lo", 0), ("CUNEIFORM SIGN GIR3 TIMES GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN GIR3 TIMES IGI", "Lo", 0), ("CUNEIFORM SIGN GIR3 TIMES LU PLUS IGI", "Lo", 0), ("CUNEIFORM SIGN GIR3 TIMES PA", "Lo", 0), ("CUNEIFORM SIGN GISAL", "Lo", 0), ("CUNEIFORM SIGN GISH", "Lo", 0), ("CUNEIFORM SIGN GISH CROSSING GISH", "Lo", 0), ("CUNEIFORM SIGN GISH TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN GISH TIMES TAK4", "Lo", 0), ("CUNEIFORM SIGN GISH TENU", "Lo", 0), ("CUNEIFORM SIGN GU", "Lo", 0), ("CUNEIFORM SIGN GU CROSSING GU", "Lo", 0), ("CUNEIFORM SIGN GU2", "Lo", 0), ("CUNEIFORM SIGN GU2 TIMES KAK", "Lo", 0), ("CUNEIFORM SIGN GU2 TIMES KAK TIMES IGI GUNU", "Lo", 0), ("CUNEIFORM SIGN GU2 TIMES NUN", "Lo", 0), ("CUNEIFORM SIGN GU2 TIMES SAL PLUS TUG2", "Lo", 0), ("CUNEIFORM SIGN GU2 GUNU", "Lo", 0), ("CUNEIFORM SIGN GUD", "Lo", 0), ("CUNEIFORM SIGN GUD TIMES A PLUS KUR", "Lo", 0), ("CUNEIFORM SIGN GUD TIMES KUR", "Lo", 0), ("CUNEIFORM SIGN GUD OVER GUD LUGAL", "Lo", 0), ("CUNEIFORM SIGN GUL", "Lo", 0), ("CUNEIFORM SIGN GUM", "Lo", 0), ("CUNEIFORM SIGN GUM TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN GUR", "Lo", 0), ("CUNEIFORM SIGN GUR7", "Lo", 0), ("CUNEIFORM SIGN GURUN", "Lo", 0), ("CUNEIFORM SIGN GURUSH", "Lo", 0), ("CUNEIFORM SIGN HA", "Lo", 0), ("CUNEIFORM SIGN HA TENU", "Lo", 0), ("CUNEIFORM SIGN HA GUNU", "Lo", 0), ("CUNEIFORM SIGN HAL", "Lo", 0), ("CUNEIFORM SIGN HI", "Lo", 0), ("CUNEIFORM SIGN HI TIMES ASH", "Lo", 0), ("CUNEIFORM SIGN HI TIMES ASH2", "Lo", 0), ("CUNEIFORM SIGN HI TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN HI TIMES DISH", "Lo", 0), ("CUNEIFORM SIGN HI TIMES GAD", "Lo", 0), ("CUNEIFORM SIGN HI TIMES KIN", "Lo", 0), ("CUNEIFORM SIGN HI TIMES NUN", "Lo", 0), ("CUNEIFORM SIGN HI TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN HI TIMES U", "Lo", 0), ("CUNEIFORM SIGN HU", "Lo", 0), ("CUNEIFORM SIGN HUB2", "Lo", 0), ("CUNEIFORM SIGN HUB2 TIMES AN", "Lo", 0), ("CUNEIFORM SIGN HUB2 TIMES HAL", "Lo", 0), ("CUNEIFORM SIGN HUB2 TIMES KASKAL", "Lo", 0), ("CUNEIFORM SIGN HUB2 TIMES LISH", "Lo", 0), ("CUNEIFORM SIGN HUB2 TIMES UD", "Lo", 0), ("CUNEIFORM SIGN HUL2", "Lo", 0), ("CUNEIFORM SIGN I", "Lo", 0), ("CUNEIFORM SIGN I A", "Lo", 0), ("CUNEIFORM SIGN IB", "Lo", 0), ("CUNEIFORM SIGN IDIM", "Lo", 0), ("CUNEIFORM SIGN IDIM OVER IDIM BUR", "Lo", 0), ("CUNEIFORM SIGN IDIM OVER IDIM SQUARED", "Lo", 0), ("CUNEIFORM SIGN IG", "Lo", 0), ("CUNEIFORM SIGN IGI", "Lo", 0), ("CUNEIFORM SIGN IGI DIB", "Lo", 0), ("CUNEIFORM SIGN IGI RI", "Lo", 0), ("CUNEIFORM SIGN IGI OVER IGI SHIR OVER SHIR UD OVER UD", "Lo", 0), ("CUNEIFORM SIGN IGI GUNU", "Lo", 0), ("CUNEIFORM SIGN IL", "Lo", 0), ("CUNEIFORM SIGN IL TIMES GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN IL2", "Lo", 0), ("CUNEIFORM SIGN IM", "Lo", 0), ("CUNEIFORM SIGN IM TIMES TAK4", "Lo", 0), ("CUNEIFORM SIGN IM CROSSING IM", "Lo", 0), ("CUNEIFORM SIGN IM OPPOSING IM", "Lo", 0), ("CUNEIFORM SIGN IM SQUARED", "Lo", 0), ("CUNEIFORM SIGN IMIN", "Lo", 0), ("CUNEIFORM SIGN IN", "Lo", 0), ("CUNEIFORM SIGN IR", "Lo", 0), ("CUNEIFORM SIGN ISH", "Lo", 0), ("CUNEIFORM SIGN KA", "Lo", 0), ("CUNEIFORM SIGN KA TIMES A", "Lo", 0), ("CUNEIFORM SIGN KA TIMES AD", "Lo", 0), ("CUNEIFORM SIGN KA TIMES AD PLUS KU3", "Lo", 0), ("CUNEIFORM SIGN KA TIMES ASH2", "Lo", 0), ("CUNEIFORM SIGN KA TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN KA TIMES BALAG", "Lo", 0), ("CUNEIFORM SIGN KA TIMES BAR", "Lo", 0), ("CUNEIFORM SIGN KA TIMES BI", "Lo", 0), ("CUNEIFORM SIGN KA TIMES ERIN2", "Lo", 0), ("CUNEIFORM SIGN KA TIMES ESH2", "Lo", 0), ("CUNEIFORM SIGN KA TIMES GA", "Lo", 0), ("CUNEIFORM SIGN KA TIMES GAL", "Lo", 0), ("CUNEIFORM SIGN KA TIMES GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN KA TIMES GAR", "Lo", 0), ("CUNEIFORM SIGN KA TIMES GAR PLUS SHA3 PLUS A", "Lo", 0), ("CUNEIFORM SIGN KA TIMES GI", "Lo", 0), ("CUNEIFORM SIGN KA TIMES GIR2", "Lo", 0), ("CUNEIFORM SIGN KA TIMES GISH PLUS SAR", "Lo", 0), ("CUNEIFORM SIGN KA TIMES GISH CROSSING GISH", "Lo", 0), ("CUNEIFORM SIGN KA TIMES GU", "Lo", 0), ("CUNEIFORM SIGN KA TIMES GUR7", "Lo", 0), ("CUNEIFORM SIGN KA TIMES IGI", "Lo", 0), ("CUNEIFORM SIGN KA TIMES IM", "Lo", 0), ("CUNEIFORM SIGN KA TIMES KAK", "Lo", 0), ("CUNEIFORM SIGN KA TIMES KI", "Lo", 0), ("CUNEIFORM SIGN KA TIMES KID", "Lo", 0), ("CUNEIFORM SIGN KA TIMES LI", "Lo", 0), ("CUNEIFORM SIGN KA TIMES LU", "Lo", 0), ("CUNEIFORM SIGN KA TIMES ME", "Lo", 0), ("CUNEIFORM SIGN KA TIMES ME PLUS DU", "Lo", 0), ("CUNEIFORM SIGN KA TIMES ME PLUS GI", "Lo", 0), ("CUNEIFORM SIGN KA TIMES ME PLUS TE", "Lo", 0), ("CUNEIFORM SIGN KA TIMES MI", "Lo", 0), ("CUNEIFORM SIGN KA TIMES MI PLUS NUNUZ", "Lo", 0), ("CUNEIFORM SIGN KA TIMES NE", "Lo", 0), ("CUNEIFORM SIGN KA TIMES NUN", "Lo", 0), ("CUNEIFORM SIGN KA TIMES PI", "Lo", 0), ("CUNEIFORM SIGN KA TIMES RU", "Lo", 0), ("CUNEIFORM SIGN KA TIMES SA", "Lo", 0), ("CUNEIFORM SIGN KA TIMES SAR", "Lo", 0), ("CUNEIFORM SIGN KA TIMES SHA", "Lo", 0), ("CUNEIFORM SIGN KA TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN KA TIMES SHID", "Lo", 0), ("CUNEIFORM SIGN KA TIMES SHU", "Lo", 0), ("CUNEIFORM SIGN KA TIMES SIG", "Lo", 0), ("CUNEIFORM SIGN KA TIMES SUHUR", "Lo", 0), ("CUNEIFORM SIGN KA TIMES TAR", "Lo", 0), ("CUNEIFORM SIGN KA TIMES U", "Lo", 0), ("CUNEIFORM SIGN KA TIMES U2", "Lo", 0), ("CUNEIFORM SIGN KA TIMES UD", "Lo", 0), ("CUNEIFORM SIGN KA TIMES UMUM TIMES PA", "Lo", 0), ("CUNEIFORM SIGN KA TIMES USH", "Lo", 0), ("CUNEIFORM SIGN KA TIMES ZI", "Lo", 0), ("CUNEIFORM SIGN KA2", "Lo", 0), ("CUNEIFORM SIGN KA2 CROSSING KA2", "Lo", 0), ("CUNEIFORM SIGN KAB", "Lo", 0), ("CUNEIFORM SIGN KAD2", "Lo", 0), ("CUNEIFORM SIGN KAD3", "Lo", 0), ("CUNEIFORM SIGN KAD4", "Lo", 0), ("CUNEIFORM SIGN KAD5", "Lo", 0), ("CUNEIFORM SIGN KAD5 OVER KAD5", "Lo", 0), ("CUNEIFORM SIGN KAK", "Lo", 0), ("CUNEIFORM SIGN KAK TIMES IGI GUNU", "Lo", 0), ("CUNEIFORM SIGN KAL", "Lo", 0), ("CUNEIFORM SIGN KAL TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN KAL CROSSING KAL", "Lo", 0), ("CUNEIFORM SIGN KAM2", "Lo", 0), ("CUNEIFORM SIGN KAM4", "Lo", 0), ("CUNEIFORM SIGN KASKAL", "Lo", 0), ("CUNEIFORM SIGN KASKAL LAGAB TIMES U OVER LAGAB TIMES U", "Lo", 0), ("CUNEIFORM SIGN KASKAL OVER KASKAL LAGAB TIMES U OVER LAGAB TIMES U", "Lo", 0), ("CUNEIFORM SIGN KESH2", "Lo", 0), ("CUNEIFORM SIGN KI", "Lo", 0), ("CUNEIFORM SIGN KI TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN KI TIMES U", "Lo", 0), ("CUNEIFORM SIGN KI TIMES UD", "Lo", 0), ("CUNEIFORM SIGN KID", "Lo", 0), ("CUNEIFORM SIGN KIN", "Lo", 0), ("CUNEIFORM SIGN KISAL", "Lo", 0), ("CUNEIFORM SIGN KISH", "Lo", 0), ("CUNEIFORM SIGN KISIM5", "Lo", 0), ("CUNEIFORM SIGN KISIM5 OVER KISIM5", "Lo", 0), ("CUNEIFORM SIGN KU", "Lo", 0), ("CUNEIFORM SIGN KU OVER HI TIMES ASH2 KU OVER HI TIMES ASH2", "Lo", 0), ("CUNEIFORM SIGN KU3", "Lo", 0), ("CUNEIFORM SIGN KU4", "Lo", 0), ("CUNEIFORM SIGN KU4 VARIANT FORM", "Lo", 0), ("CUNEIFORM SIGN KU7", "Lo", 0), ("CUNEIFORM SIGN KUL", "Lo", 0), ("CUNEIFORM SIGN KUL GUNU", "Lo", 0), ("CUNEIFORM SIGN KUN", "Lo", 0), ("CUNEIFORM SIGN KUR", "Lo", 0), ("CUNEIFORM SIGN KUR OPPOSING KUR", "Lo", 0), ("CUNEIFORM SIGN KUSHU2", "Lo", 0), ("CUNEIFORM SIGN KWU318", "Lo", 0), ("CUNEIFORM SIGN LA", "Lo", 0), ("CUNEIFORM SIGN LAGAB", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES A", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES A PLUS DA PLUS HA", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES A PLUS GAR", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES A PLUS LAL", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES AL", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES AN", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES ASH ZIDA TENU", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES BI", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES DAR", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES EN", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES GA", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES GAR", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES GUD", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES GUD PLUS GUD", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES HA", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES HAL", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES HI TIMES NUN", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES IGI GUNU", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES IM", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES IM PLUS HA", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES IM PLUS LU", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES KI", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES KIN", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES KU3", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES KUL", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES KUL PLUS HI PLUS A", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES LAGAB", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES LISH", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES LU", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES LUL", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES ME", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES ME PLUS EN", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES MUSH", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES NE", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES SHE PLUS SUM", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES SHITA PLUS GISH PLUS ERIN2", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES SHITA PLUS GISH TENU", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES SHU2", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES SHU2 PLUS SHU2", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES SUM", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES TAG", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES TAK4", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES TE PLUS A PLUS SU PLUS NA", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES U", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES U PLUS A", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES U PLUS U PLUS U", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES U2 PLUS ASH", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES UD", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES USH", "Lo", 0), ("CUNEIFORM SIGN LAGAB SQUARED", "Lo", 0), ("CUNEIFORM SIGN LAGAR", "Lo", 0), ("CUNEIFORM SIGN LAGAR TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN LAGAR TIMES SHE PLUS SUM", "Lo", 0), ("CUNEIFORM SIGN LAGAR GUNU", "Lo", 0), ("CUNEIFORM SIGN LAGAR GUNU OVER LAGAR GUNU SHE", "Lo", 0), ("CUNEIFORM SIGN LAHSHU", "Lo", 0), ("CUNEIFORM SIGN LAL", "Lo", 0), ("CUNEIFORM SIGN LAL TIMES LAL", "Lo", 0), ("CUNEIFORM SIGN LAM", "Lo", 0), ("CUNEIFORM SIGN LAM TIMES KUR", "Lo", 0), ("CUNEIFORM SIGN LAM TIMES KUR PLUS RU", "Lo", 0), ("CUNEIFORM SIGN LI", "Lo", 0), ("CUNEIFORM SIGN LIL", "Lo", 0), ("CUNEIFORM SIGN LIMMU2", "Lo", 0), ("CUNEIFORM SIGN LISH", "Lo", 0), ("CUNEIFORM SIGN LU", "Lo", 0), ("CUNEIFORM SIGN LU TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN LU2", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES AL", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES ESH2", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES ESH2 TENU", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES HI TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES IM", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES KAD2", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES KAD3", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES KAD3 PLUS ASH", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES KI", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES LA PLUS ASH", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES LAGAB", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES ME PLUS EN", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES NE", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES NU", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES SI PLUS ASH", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES SIK2 PLUS BU", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES TUG2", "Lo", 0), ("CUNEIFORM SIGN LU2 TENU", "Lo", 0), ("CUNEIFORM SIGN LU2 CROSSING LU2", "Lo", 0), ("CUNEIFORM SIGN LU2 OPPOSING LU2", "Lo", 0), ("CUNEIFORM SIGN LU2 SQUARED", "Lo", 0), ("CUNEIFORM SIGN LU2 SHESHIG", "Lo", 0), ("CUNEIFORM SIGN LU3", "Lo", 0), ("CUNEIFORM SIGN LUGAL", "Lo", 0), ("CUNEIFORM SIGN LUGAL OVER LUGAL", "Lo", 0), ("CUNEIFORM SIGN LUGAL OPPOSING LUGAL", "Lo", 0), ("CUNEIFORM SIGN LUGAL SHESHIG", "Lo", 0), ("CUNEIFORM SIGN LUH", "Lo", 0), ("CUNEIFORM SIGN LUL", "Lo", 0), ("CUNEIFORM SIGN LUM", "Lo", 0), ("CUNEIFORM SIGN LUM OVER LUM", "Lo", 0), ("CUNEIFORM SIGN LUM OVER LUM GAR OVER GAR", "Lo", 0), ("CUNEIFORM SIGN MA", "Lo", 0), ("CUNEIFORM SIGN MA TIMES TAK4", "Lo", 0), ("CUNEIFORM SIGN MA GUNU", "Lo", 0), ("CUNEIFORM SIGN MA2", "Lo", 0), ("CUNEIFORM SIGN MAH", "Lo", 0), ("CUNEIFORM SIGN MAR", "Lo", 0), ("CUNEIFORM SIGN MASH", "Lo", 0), ("CUNEIFORM SIGN MASH2", "Lo", 0), ("CUNEIFORM SIGN ME", "Lo", 0), ("CUNEIFORM SIGN MES", "Lo", 0), ("CUNEIFORM SIGN MI", "Lo", 0), ("CUNEIFORM SIGN MIN", "Lo", 0), ("CUNEIFORM SIGN MU", "Lo", 0), ("CUNEIFORM SIGN MU OVER MU", "Lo", 0), ("CUNEIFORM SIGN MUG", "Lo", 0), ("CUNEIFORM SIGN MUG GUNU", "Lo", 0), ("CUNEIFORM SIGN MUNSUB", "Lo", 0), ("CUNEIFORM SIGN MURGU2", "Lo", 0), ("CUNEIFORM SIGN MUSH", "Lo", 0), ("CUNEIFORM SIGN MUSH TIMES A", "Lo", 0), ("CUNEIFORM SIGN MUSH TIMES KUR", "Lo", 0), ("CUNEIFORM SIGN MUSH TIMES ZA", "Lo", 0), ("CUNEIFORM SIGN MUSH OVER MUSH", "Lo", 0), ("CUNEIFORM SIGN MUSH OVER MUSH TIMES A PLUS NA", "Lo", 0), ("CUNEIFORM SIGN MUSH CROSSING MUSH", "Lo", 0), ("CUNEIFORM SIGN MUSH3", "Lo", 0), ("CUNEIFORM SIGN MUSH3 TIMES A", "Lo", 0), ("CUNEIFORM SIGN MUSH3 TIMES A PLUS DI", "Lo", 0), ("CUNEIFORM SIGN MUSH3 TIMES DI", "Lo", 0), ("CUNEIFORM SIGN MUSH3 GUNU", "Lo", 0), ("CUNEIFORM SIGN NA", "Lo", 0), ("CUNEIFORM SIGN NA2", "Lo", 0), ("CUNEIFORM SIGN NAGA", "Lo", 0), ("CUNEIFORM SIGN NAGA INVERTED", "Lo", 0), ("CUNEIFORM SIGN NAGA TIMES SHU TENU", "Lo", 0), ("CUNEIFORM SIGN NAGA OPPOSING NAGA", "Lo", 0), ("CUNEIFORM SIGN NAGAR", "Lo", 0), ("CUNEIFORM SIGN NAM NUTILLU", "Lo", 0), ("CUNEIFORM SIGN NAM", "Lo", 0), ("CUNEIFORM SIGN NAM2", "Lo", 0), ("CUNEIFORM SIGN NE", "Lo", 0), ("CUNEIFORM SIGN NE TIMES A", "Lo", 0), ("CUNEIFORM SIGN NE TIMES UD", "Lo", 0), ("CUNEIFORM SIGN NE SHESHIG", "Lo", 0), ("CUNEIFORM SIGN NI", "Lo", 0), ("CUNEIFORM SIGN NI TIMES E", "Lo", 0), ("CUNEIFORM SIGN NI2", "Lo", 0), ("CUNEIFORM SIGN NIM", "Lo", 0), ("CUNEIFORM SIGN NIM TIMES GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN NIM TIMES GAR PLUS GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN NINDA2", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES AN", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES ASH", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES ASH PLUS ASH", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES GUD", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES ME PLUS GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES NE", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES NUN", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES SHE PLUS A AN", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES SHE PLUS ASH", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES SHE PLUS ASH PLUS ASH", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES U2 PLUS ASH", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES USH", "Lo", 0), ("CUNEIFORM SIGN NISAG", "Lo", 0), ("CUNEIFORM SIGN NU", "Lo", 0), ("CUNEIFORM SIGN NU11", "Lo", 0), ("CUNEIFORM SIGN NUN", "Lo", 0), ("CUNEIFORM SIGN NUN LAGAR TIMES GAR", "Lo", 0), ("CUNEIFORM SIGN NUN LAGAR TIMES MASH", "Lo", 0), ("CUNEIFORM SIGN NUN LAGAR TIMES SAL", "Lo", 0), ("CUNEIFORM SIGN NUN LAGAR TIMES SAL OVER NUN LAGAR TIMES SAL", "Lo", 0), ("CUNEIFORM SIGN NUN LAGAR TIMES USH", "Lo", 0), ("CUNEIFORM SIGN NUN TENU", "Lo", 0), ("CUNEIFORM SIGN NUN OVER NUN", "Lo", 0), ("CUNEIFORM SIGN NUN CROSSING NUN", "Lo", 0), ("CUNEIFORM SIGN NUN CROSSING NUN LAGAR OVER LAGAR", "Lo", 0), ("CUNEIFORM SIGN NUNUZ", "Lo", 0), ("CUNEIFORM SIGN NUNUZ AB2 TIMES ASHGAB", "Lo", 0), ("CUNEIFORM SIGN NUNUZ AB2 TIMES BI", "Lo", 0), ("CUNEIFORM SIGN NUNUZ AB2 TIMES DUG", "Lo", 0), ("CUNEIFORM SIGN NUNUZ AB2 TIMES GUD", "Lo", 0), ("CUNEIFORM SIGN NUNUZ AB2 TIMES IGI GUNU", "Lo", 0), ("CUNEIFORM SIGN NUNUZ AB2 TIMES KAD3", "Lo", 0), ("CUNEIFORM SIGN NUNUZ AB2 TIMES LA", "Lo", 0), ("CUNEIFORM SIGN NUNUZ AB2 TIMES NE", "Lo", 0), ("CUNEIFORM SIGN NUNUZ AB2 TIMES SILA3", "Lo", 0), ("CUNEIFORM SIGN NUNUZ AB2 TIMES U2", "Lo", 0), ("CUNEIFORM SIGN NUNUZ KISIM5 TIMES BI", "Lo", 0), ("CUNEIFORM SIGN NUNUZ KISIM5 TIMES BI U", "Lo", 0), ("CUNEIFORM SIGN PA", "Lo", 0), ("CUNEIFORM SIGN PAD", "Lo", 0), ("CUNEIFORM SIGN PAN", "Lo", 0), ("CUNEIFORM SIGN PAP", "Lo", 0), ("CUNEIFORM SIGN PESH2", "Lo", 0), ("CUNEIFORM SIGN PI", "Lo", 0), ("CUNEIFORM SIGN PI TIMES A", "Lo", 0), ("CUNEIFORM SIGN PI TIMES AB", "Lo", 0), ("CUNEIFORM SIGN PI TIMES BI", "Lo", 0), ("CUNEIFORM SIGN PI TIMES BU", "Lo", 0), ("CUNEIFORM SIGN PI TIMES E", "Lo", 0), ("CUNEIFORM SIGN PI TIMES I", "Lo", 0), ("CUNEIFORM SIGN PI TIMES IB", "Lo", 0), ("CUNEIFORM SIGN PI TIMES U", "Lo", 0), ("CUNEIFORM SIGN PI TIMES U2", "Lo", 0), ("CUNEIFORM SIGN PI CROSSING PI", "Lo", 0), ("CUNEIFORM SIGN PIRIG", "Lo", 0), ("CUNEIFORM SIGN PIRIG TIMES KAL", "Lo", 0), ("CUNEIFORM SIGN PIRIG TIMES UD", "Lo", 0), ("CUNEIFORM SIGN PIRIG TIMES ZA", "Lo", 0), ("CUNEIFORM SIGN PIRIG OPPOSING PIRIG", "Lo", 0), ("CUNEIFORM SIGN RA", "Lo", 0), ("CUNEIFORM SIGN RAB", "Lo", 0), ("CUNEIFORM SIGN RI", "Lo", 0), ("CUNEIFORM SIGN RU", "Lo", 0), ("CUNEIFORM SIGN SA", "Lo", 0), ("CUNEIFORM SIGN SAG NUTILLU", "Lo", 0), ("CUNEIFORM SIGN SAG", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES A", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES DU", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES DUB", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES HA", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES KAK", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES KUR", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES LUM", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES MI", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES NUN", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES SAL", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES SHID", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES TAB", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES U2", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES UB", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES UM", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES UR", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES USH", "Lo", 0), ("CUNEIFORM SIGN SAG OVER SAG", "Lo", 0), ("CUNEIFORM SIGN SAG GUNU", "Lo", 0), ("CUNEIFORM SIGN SAL", "Lo", 0), ("CUNEIFORM SIGN SAL LAGAB TIMES ASH2", "Lo", 0), ("CUNEIFORM SIGN SANGA2", "Lo", 0), ("CUNEIFORM SIGN SAR", "Lo", 0), ("CUNEIFORM SIGN SHA", "Lo", 0), ("CUNEIFORM SIGN SHA3", "Lo", 0), ("CUNEIFORM SIGN SHA3 TIMES A", "Lo", 0), ("CUNEIFORM SIGN SHA3 TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN SHA3 TIMES GISH", "Lo", 0), ("CUNEIFORM SIGN SHA3 TIMES NE", "Lo", 0), ("CUNEIFORM SIGN SHA3 TIMES SHU2", "Lo", 0), ("CUNEIFORM SIGN SHA3 TIMES TUR", "Lo", 0), ("CUNEIFORM SIGN SHA3 TIMES U", "Lo", 0), ("CUNEIFORM SIGN SHA3 TIMES U PLUS A", "Lo", 0), ("CUNEIFORM SIGN SHA6", "Lo", 0), ("CUNEIFORM SIGN SHAB6", "Lo", 0), ("CUNEIFORM SIGN SHAR2", "Lo", 0), ("CUNEIFORM SIGN SHE", "Lo", 0), ("CUNEIFORM SIGN SHE HU", "Lo", 0), ("CUNEIFORM SIGN SHE OVER SHE GAD OVER GAD GAR OVER GAR", "Lo", 0), ("CUNEIFORM SIGN SHE OVER SHE TAB OVER TAB GAR OVER GAR", "Lo", 0), ("CUNEIFORM SIGN SHEG9", "Lo", 0), ("CUNEIFORM SIGN SHEN", "Lo", 0), ("CUNEIFORM SIGN SHESH", "Lo", 0), ("CUNEIFORM SIGN SHESH2", "Lo", 0), ("CUNEIFORM SIGN SHESHLAM", "Lo", 0), ("CUNEIFORM SIGN SHID", "Lo", 0), ("CUNEIFORM SIGN SHID TIMES A", "Lo", 0), ("CUNEIFORM SIGN SHID TIMES IM", "Lo", 0), ("CUNEIFORM SIGN SHIM", "Lo", 0), ("CUNEIFORM SIGN SHIM TIMES A", "Lo", 0), ("CUNEIFORM SIGN SHIM TIMES BAL", "Lo", 0), ("CUNEIFORM SIGN SHIM TIMES BULUG", "Lo", 0), ("CUNEIFORM SIGN SHIM TIMES DIN", "Lo", 0), ("CUNEIFORM SIGN SHIM TIMES GAR", "Lo", 0), ("CUNEIFORM SIGN SHIM TIMES IGI", "Lo", 0), ("CUNEIFORM SIGN SHIM TIMES IGI GUNU", "Lo", 0), ("CUNEIFORM SIGN SHIM TIMES KUSHU2", "Lo", 0), ("CUNEIFORM SIGN SHIM TIMES LUL", "Lo", 0), ("CUNEIFORM SIGN SHIM TIMES MUG", "Lo", 0), ("CUNEIFORM SIGN SHIM TIMES SAL", "Lo", 0), ("CUNEIFORM SIGN SHINIG", "Lo", 0), ("CUNEIFORM SIGN SHIR", "Lo", 0), ("CUNEIFORM SIGN SHIR TENU", "Lo", 0), ("CUNEIFORM SIGN SHIR OVER SHIR BUR OVER BUR", "Lo", 0), ("CUNEIFORM SIGN SHITA", "Lo", 0), ("CUNEIFORM SIGN SHU", "Lo", 0), ("CUNEIFORM SIGN SHU OVER INVERTED SHU", "Lo", 0), ("CUNEIFORM SIGN SHU2", "Lo", 0), ("CUNEIFORM SIGN SHUBUR", "Lo", 0), ("CUNEIFORM SIGN SI", "Lo", 0), ("CUNEIFORM SIGN SI GUNU", "Lo", 0), ("CUNEIFORM SIGN SIG", "Lo", 0), ("CUNEIFORM SIGN SIG4", "Lo", 0), ("CUNEIFORM SIGN SIG4 OVER SIG4 SHU2", "Lo", 0), ("CUNEIFORM SIGN SIK2", "Lo", 0), ("CUNEIFORM SIGN SILA3", "Lo", 0), ("CUNEIFORM SIGN SU", "Lo", 0), ("CUNEIFORM SIGN SU OVER SU", "Lo", 0), ("CUNEIFORM SIGN SUD", "Lo", 0), ("CUNEIFORM SIGN SUD2", "Lo", 0), ("CUNEIFORM SIGN SUHUR", "Lo", 0), ("CUNEIFORM SIGN SUM", "Lo", 0), ("CUNEIFORM SIGN SUMASH", "Lo", 0), ("CUNEIFORM SIGN SUR", "Lo", 0), ("CUNEIFORM SIGN SUR9", "Lo", 0), ("CUNEIFORM SIGN TA", "Lo", 0), ("CUNEIFORM SIGN TA ASTERISK", "Lo", 0), ("CUNEIFORM SIGN TA TIMES HI", "Lo", 0), ("CUNEIFORM SIGN TA TIMES MI", "Lo", 0), ("CUNEIFORM SIGN TA GUNU", "Lo", 0), ("CUNEIFORM SIGN TAB", "Lo", 0), ("CUNEIFORM SIGN TAB OVER TAB NI OVER NI DISH OVER DISH", "Lo", 0), ("CUNEIFORM SIGN TAB SQUARED", "Lo", 0), ("CUNEIFORM SIGN TAG", "Lo", 0), ("CUNEIFORM SIGN TAG TIMES BI", "Lo", 0), ("CUNEIFORM SIGN TAG TIMES GUD", "Lo", 0), ("CUNEIFORM SIGN TAG TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN TAG TIMES SHU", "Lo", 0), ("CUNEIFORM SIGN TAG TIMES TUG2", "Lo", 0), ("CUNEIFORM SIGN TAG TIMES UD", "Lo", 0), ("CUNEIFORM SIGN TAK4", "Lo", 0), ("CUNEIFORM SIGN TAR", "Lo", 0), ("CUNEIFORM SIGN TE", "Lo", 0), ("CUNEIFORM SIGN TE GUNU", "Lo", 0), ("CUNEIFORM SIGN TI", "Lo", 0), ("CUNEIFORM SIGN TI TENU", "Lo", 0), ("CUNEIFORM SIGN TIL", "Lo", 0), ("CUNEIFORM SIGN TIR", "Lo", 0), ("CUNEIFORM SIGN TIR TIMES TAK4", "Lo", 0), ("CUNEIFORM SIGN TIR OVER TIR", "Lo", 0), ("CUNEIFORM SIGN TIR OVER TIR GAD OVER GAD GAR OVER GAR", "Lo", 0), ("CUNEIFORM SIGN TU", "Lo", 0), ("CUNEIFORM SIGN TUG2", "Lo", 0), ("CUNEIFORM SIGN TUK", "Lo", 0), ("CUNEIFORM SIGN TUM", "Lo", 0), ("CUNEIFORM SIGN TUR", "Lo", 0), ("CUNEIFORM SIGN TUR OVER TUR ZA OVER ZA", "Lo", 0), ("CUNEIFORM SIGN U", "Lo", 0), ("CUNEIFORM SIGN U GUD", "Lo", 0), ("CUNEIFORM SIGN U U U", "Lo", 0), ("CUNEIFORM SIGN U OVER U PA OVER PA GAR OVER GAR", "Lo", 0), ("CUNEIFORM SIGN U OVER U SUR OVER SUR", "Lo", 0), ("CUNEIFORM SIGN U OVER U U REVERSED OVER U REVERSED", "Lo", 0), ("CUNEIFORM SIGN U2", "Lo", 0), ("CUNEIFORM SIGN UB", "Lo", 0), ("CUNEIFORM SIGN UD", "Lo", 0), ("CUNEIFORM SIGN UD KUSHU2", "Lo", 0), ("CUNEIFORM SIGN UD TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN UD TIMES MI", "Lo", 0), ("CUNEIFORM SIGN UD TIMES U PLUS U PLUS U", "Lo", 0), ("CUNEIFORM SIGN UD TIMES U PLUS U PLUS U GUNU", "Lo", 0), ("CUNEIFORM SIGN UD GUNU", "Lo", 0), ("CUNEIFORM SIGN UD SHESHIG", "Lo", 0), ("CUNEIFORM SIGN UD SHESHIG TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN UDUG", "Lo", 0), ("CUNEIFORM SIGN UM", "Lo", 0), ("CUNEIFORM SIGN UM TIMES LAGAB", "Lo", 0), ("CUNEIFORM SIGN UM TIMES ME PLUS DA", "Lo", 0), ("CUNEIFORM SIGN UM TIMES SHA3", "Lo", 0), ("CUNEIFORM SIGN UM TIMES U", "Lo", 0), ("CUNEIFORM SIGN UMBIN", "Lo", 0), ("CUNEIFORM SIGN UMUM", "Lo", 0), ("CUNEIFORM SIGN UMUM TIMES KASKAL", "Lo", 0), ("CUNEIFORM SIGN UMUM TIMES PA", "Lo", 0), ("CUNEIFORM SIGN UN", "Lo", 0), ("CUNEIFORM SIGN UN GUNU", "Lo", 0), ("CUNEIFORM SIGN UR", "Lo", 0), ("CUNEIFORM SIGN UR CROSSING UR", "Lo", 0), ("CUNEIFORM SIGN UR SHESHIG", "Lo", 0), ("CUNEIFORM SIGN UR2", "Lo", 0), ("CUNEIFORM SIGN UR2 TIMES A PLUS HA", "Lo", 0), ("CUNEIFORM SIGN UR2 TIMES A PLUS NA", "Lo", 0), ("CUNEIFORM SIGN UR2 TIMES AL", "Lo", 0), ("CUNEIFORM SIGN UR2 TIMES HA", "Lo", 0), ("CUNEIFORM SIGN UR2 TIMES NUN", "Lo", 0), ("CUNEIFORM SIGN UR2 TIMES U2", "Lo", 0), ("CUNEIFORM SIGN UR2 TIMES U2 PLUS ASH", "Lo", 0), ("CUNEIFORM SIGN UR2 TIMES U2 PLUS BI", "Lo", 0), ("CUNEIFORM SIGN UR4", "Lo", 0), ("CUNEIFORM SIGN URI", "Lo", 0), ("CUNEIFORM SIGN URI3", "Lo", 0), ("CUNEIFORM SIGN URU", "Lo", 0), ("CUNEIFORM SIGN URU TIMES A", "Lo", 0), ("CUNEIFORM SIGN URU TIMES ASHGAB", "Lo", 0), ("CUNEIFORM SIGN URU TIMES BAR", "Lo", 0), ("CUNEIFORM SIGN URU TIMES DUN", "Lo", 0), ("CUNEIFORM SIGN URU TIMES GA", "Lo", 0), ("CUNEIFORM SIGN URU TIMES GAL", "Lo", 0), ("CUNEIFORM SIGN URU TIMES GAN2 TENU", "Lo", 0), ("CUNEIFORM SIGN URU TIMES GAR", "Lo", 0), ("CUNEIFORM SIGN URU TIMES GU", "Lo", 0), ("CUNEIFORM SIGN URU TIMES HA", "Lo", 0), ("CUNEIFORM SIGN URU TIMES IGI", "Lo", 0), ("CUNEIFORM SIGN URU TIMES IM", "Lo", 0), ("CUNEIFORM SIGN URU TIMES ISH", "Lo", 0), ("CUNEIFORM SIGN URU TIMES KI", "Lo", 0), ("CUNEIFORM SIGN URU TIMES LUM", "Lo", 0), ("CUNEIFORM SIGN URU TIMES MIN", "Lo", 0), ("CUNEIFORM SIGN URU TIMES PA", "Lo", 0), ("CUNEIFORM SIGN URU TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN URU TIMES SIG4", "Lo", 0), ("CUNEIFORM SIGN URU TIMES TU", "Lo", 0), ("CUNEIFORM SIGN URU TIMES U PLUS GUD", "Lo", 0), ("CUNEIFORM SIGN URU TIMES UD", "Lo", 0), ("CUNEIFORM SIGN URU TIMES URUDA", "Lo", 0), ("CUNEIFORM SIGN URUDA", "Lo", 0), ("CUNEIFORM SIGN URUDA TIMES U", "Lo", 0), ("CUNEIFORM SIGN USH", "Lo", 0), ("CUNEIFORM SIGN USH TIMES A", "Lo", 0), ("CUNEIFORM SIGN USH TIMES KU", "Lo", 0), ("CUNEIFORM SIGN USH TIMES KUR", "Lo", 0), ("CUNEIFORM SIGN USH TIMES TAK4", "Lo", 0), ("CUNEIFORM SIGN USHX", "Lo", 0), ("CUNEIFORM SIGN USH2", "Lo", 0), ("CUNEIFORM SIGN USHUMX", "Lo", 0), ("CUNEIFORM SIGN UTUKI", "Lo", 0), ("CUNEIFORM SIGN UZ3", "Lo", 0), ("CUNEIFORM SIGN UZ3 TIMES KASKAL", "Lo", 0), ("CUNEIFORM SIGN UZU", "Lo", 0), ("CUNEIFORM SIGN ZA", "Lo", 0), ("CUNEIFORM SIGN ZA TENU", "Lo", 0), ("CUNEIFORM SIGN ZA SQUARED TIMES KUR", "Lo", 0), ("CUNEIFORM SIGN ZAG", "Lo", 0), ("CUNEIFORM SIGN ZAMX", "Lo", 0), ("CUNEIFORM SIGN ZE2", "Lo", 0), ("CUNEIFORM SIGN ZI", "Lo", 0), ("CUNEIFORM SIGN ZI OVER ZI", "Lo", 0), ("CUNEIFORM SIGN ZI3", "Lo", 0), ("CUNEIFORM SIGN ZIB", "Lo", 0), ("CUNEIFORM SIGN ZIB KABA TENU", "Lo", 0), ("CUNEIFORM SIGN ZIG", "Lo", 0), ("CUNEIFORM SIGN ZIZ2", "Lo", 0), ("CUNEIFORM SIGN ZU", "Lo", 0), ("CUNEIFORM SIGN ZU5", "Lo", 0), ("CUNEIFORM SIGN ZU5 TIMES A", "Lo", 0), ("CUNEIFORM SIGN ZUBUR", "Lo", 0), ("CUNEIFORM SIGN ZUM", "Lo", 0), ("CUNEIFORM SIGN KAP ELAMITE", "Lo", 0), ("CUNEIFORM SIGN AB TIMES NUN", "Lo", 0), ("CUNEIFORM SIGN AB2 TIMES A", "Lo", 0), ("CUNEIFORM SIGN AMAR TIMES KUG", "Lo", 0), ("CUNEIFORM SIGN DAG KISIM5 TIMES U2 PLUS MASH", "Lo", 0), ("CUNEIFORM SIGN DAG3", "Lo", 0), ("CUNEIFORM SIGN DISH PLUS SHU", "Lo", 0), ("CUNEIFORM SIGN DUB TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES GUD", "Lo", 0), ("CUNEIFORM SIGN EZEN TIMES SHE", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES AN PLUS KAK PLUS A", "Lo", 0), ("CUNEIFORM SIGN GA2 TIMES ASH2", "Lo", 0), ("CUNEIFORM SIGN GE22", "Lo", 0), ("CUNEIFORM SIGN GIG", "Lo", 0), ("CUNEIFORM SIGN HUSH", "Lo", 0), ("CUNEIFORM SIGN KA TIMES ANSHE", "Lo", 0), ("CUNEIFORM SIGN KA TIMES ASH3", "Lo", 0), ("CUNEIFORM SIGN KA TIMES GISH", "Lo", 0), ("CUNEIFORM SIGN KA TIMES GUD", "Lo", 0), ("CUNEIFORM SIGN KA TIMES HI TIMES ASH2", "Lo", 0), ("CUNEIFORM SIGN KA TIMES LUM", "Lo", 0), ("CUNEIFORM SIGN KA TIMES PA", "Lo", 0), ("CUNEIFORM SIGN KA TIMES SHUL", "Lo", 0), ("CUNEIFORM SIGN KA TIMES TU", "Lo", 0), ("CUNEIFORM SIGN KA TIMES UR2", "Lo", 0), ("CUNEIFORM SIGN LAGAB TIMES GI", "Lo", 0), ("CUNEIFORM SIGN LU2 SHESHIG TIMES BAD", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES ESH2 PLUS LAL", "Lo", 0), ("CUNEIFORM SIGN LU2 TIMES SHU", "Lo", 0), ("CUNEIFORM SIGN MESH", "Lo", 0), ("CUNEIFORM SIGN MUSH3 TIMES ZA", "Lo", 0), ("CUNEIFORM SIGN NA4", "Lo", 0), ("CUNEIFORM SIGN NIN", "Lo", 0), ("CUNEIFORM SIGN NIN9", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES BAL", "Lo", 0), ("CUNEIFORM SIGN NINDA2 TIMES GI", "Lo", 0), ("CUNEIFORM SIGN NU11 ROTATED NINETY DEGREES", "Lo", 0), ("CUNEIFORM SIGN PESH2 ASTERISK", "Lo", 0), ("CUNEIFORM SIGN PIR2", "Lo", 0), ("CUNEIFORM SIGN SAG TIMES IGI GUNU", "Lo", 0), ("CUNEIFORM SIGN TI2", "Lo", 0), ("CUNEIFORM SIGN UM TIMES ME", "Lo", 0), ("CUNEIFORM SIGN U U", "Lo", 0), )
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/chuli-cv/0.1.0/modules/entry.typ
typst
Apache License 2.0
#import "@preview/fontawesome:0.1.0": * #import "./styles.typ": * //TODO Fix the distance between the elements #let render-entry-icon-info(date: "", location: "") = { { if date.len() > 0{ box({ fa-hourglass-2() regular-text-style(date) }) } h(10pt) if location.len() > 0{ box({ fa-location-dot() regular-text-style(location) }) } } } #let render-entry-header( title, company-or-university, date, location, ) = { table( columns: (1fr), inset: 0pt, stroke: none, row-gutter: entry-style.margins.between-title-and-subtitle, align: auto, { black-topic-style(title) accent-subtopic-style(" @" + company-or-university) }, render-entry-icon-info(date: date, location: location) ) }
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/math/underover.typ
typst
Apache License 2.0
// Test under/over things. --- // Test braces. $ x = underbrace( 1 + 2 + ... + 5, underbrace("numbers", x + y) ) $ --- // Test lines and brackets. $ x = overbracket( overline(underline(x + y)), 1 + 2 + ... + 5, ) $ --- // Test brackets. $ underbracket([1, 2/3], "relevant stuff") arrow.l.r.double.long overbracket([4/5,6], "irrelevant stuff") $
https://github.com/carreter/problemst
https://raw.githubusercontent.com/carreter/problemst/main/pset.typ
typst
MIT License
#let pset(class: "6.100", title: "PSET 0", student: "<NAME>", date: datetime.today(), subproblems: "1.1.a.i", collaborators: (), doc ) = {[ /* Convert collaborators to a string if necessary */ #let collaborators=if type(collaborators) == array {collaborators.join(", ")} else {collaborators} /* Problem + subproblem headings */ #set heading(numbering: (..nums) => { nums = nums.pos() if nums.len() == 1 { [Problem #nums.at(0):] } else { numbering(subproblems, ..nums) } }) /* Set metadata */ #set document( title: [#class - #title], author: student, date: date, ) /* Set up page numbering and continued page headers */ #set page( numbering: "1", header: context { if counter(page).get().first() > 1 [ #set text(style: "italic") #class -- #title #h(1fr) #student #if collaborators != none {[w/ #collaborators]} #block(line(length: 100%, stroke: 0.5pt), above: 0.6em) ] }) /* Add numbering and some color to code blocks */ #show raw.where(block: true): it => { block[ #h(1fr) #box( width: 100%-0.5em, radius: 0.3em, stroke: luma(50%), inset: 1em, fill: luma(98%) )[ #show raw.line: l => { box(width:measure([#it.lines.last().count]).width, align(right, text(fill: luma(50%))[#l.number])) h(0.5em) l.body } #it ] ] } /* Make the title */ #align(center, { text(size: 1.6em, weight: "bold")[#class -- #title \ ] text(size: 1.2em, weight: "semibold")[#student \ ] emph[ #date.display("[year]-[month]-[day]") #if collaborators != none {[ \ Collaborators: #collaborators ]} ] box(line(length: 100%, stroke: 1pt)) }) #doc ]}
https://github.com/rabarbra/cv
https://raw.githubusercontent.com/rabarbra/cv/main/render.typ
typst
#let header_v_sp = v(8pt) #let gmaps = "https://www.google.com/maps/place/" #let imgs = ( tel: "img/tel.svg", github: "img/github.svg", linkedin: "img/linkedin.svg", location: "img/location.svg", email: "img/email.svg", ) #let icon(name, shift: 1.5pt) = { box( baseline: shift, height: 10pt, image(imgs.at(name)) ) h(3pt) } #let maybe_link(key, value) = { if key == "tel" { link("tel:" + value) } else if key == "email" { link("mailto:" + value) } else if key == "github" { link("https://" + value)[#value] } else if key == "linkedin" { link("https://" + value)[#value] } else if key == "location" { link(gmaps + value.city)[#value.city, #value.country] } else { value } } #let build_contacts(contacts) = { heading(level: 3, contacts.title) header_v_sp for (key, value) in contacts.content { text[#icon(key) #maybe_link(key, value)] [\ ] } } #let build_education(education) = { heading(level: 3, education.title) header_v_sp for item in education.content { text(size: 9pt)[#item.from - #item.to] [\ ] text(size: 11pt, weight: "regular")[#item.organization] [\ ] text(size: 10pt, weight: "light")[#item.discipline] v(2pt) } } #let build_skills(skills) = { heading(level: 3, skills.title) header_v_sp for el in skills.content { list(el) } } #let build_languages(languages) = { heading(level: 3, languages.title) header_v_sp for el in languages.content { list[#el.lang - #el.level] } } #let build_profile(profile) = { heading(level: 3, profile.title) v(8pt) for el in profile.content { el [\ ] } } #let build_experience(experience) = { heading(level: 3, experience.title) header_v_sp for el in experience.content { [#text(size: 11pt)[#el.position] #h(1fr) #text(size: 9pt)[#el.from - #el.to]] [\ ] text(size: 10pt, weight: "light")[#el.organization] v(2pt) for it in el.description { list(text(size: 9pt, it)) } v(3pt) } } #let render(contents) = { set document( title: "Full Stack Developer", author: "<NAME>", keywords: "Full Stack", date: auto, ) set text( font: "Blinker", size: 10pt ) set page( paper: "a4", margin: (x: 1.3cm, y: 1.5cm), ) set list(indent: 1em) show heading: it => { set block(below: 8pt) set text( weight: "semibold", fill: rgb(100, 100, 100), tracking: 1.2pt, spacing: 150% ) upper(it) } text(size: 20pt, fill: rgb(10, 10, 10))[#heading(level: 1)[#contents.title]] heading(level: 2)[#contents.subtitle] v(30pt) grid( columns: (1fr, 2fr), gutter: 3pt, stack( spacing: 1fr, build_contacts(contents.contact), build_education(contents.education), build_skills(contents.skills), build_languages(contents.languages), ), stack( spacing: 30pt, build_profile(contents.profile), build_experience(contents.experience) ) ) }
https://github.com/T1mVo/shadowed
https://raw.githubusercontent.com/T1mVo/shadowed/main/tests/grid/test.typ
typst
MIT License
#import "../../src/lib.typ": shadowed #set page(margin: 20pt, height: auto) #set par(justify: true) #let content = shadowed(radius: 4pt, inset: 12pt)[ #lorem(40) ] #grid( columns: 2, content, content, grid.cell(colspan: 2, content), )
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/009%20-%20Born%20of%20the%20Gods/001_The%20Nature%20of%20Identity.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "The Nature of Identity", set_name: "Born of the Gods", story_date: datetime(day: 15, month: 01, year: 2014), author: "<NAME>", doc ) #emph[When sentient, mortal beings die on Theros,] #emph[they pass into the Underworld with the aid of the god Athreos, the River Guide.] #emph[They dwell in this eternally gray realm without sun or night under the watch of Erebos, god of the Underworld.] #emph[But over the centuries, many denizens of the Underworld have escaped and returned to the sunlit realm of the living.] #emph[They are called the Returned.] —Excerpt from the book, #emph[Observations and Metaphysics] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) #emph[When a dead person escapes the Underworld,] #emph[that person loses all identity and becomes one of the faceless Returned.] #emph[But in this process of severing the physical body from the "soul," an eidolon is also created.] #emph[An eidolon is the spectral embodiment of the lost identity, but without its body, it has no agency.] #emph[Unlike the Returned, it has no sense of what it lost.] #emph[The Returned and its severed eidolon are never reunited, nor are they aware of one another's existence.] —Excerpt from the book, #emph[Observations and Metaphysics] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) "What is identity? What makes us who we are?" Perisophia's voice mixed with the sounds of the breeze and the birds. "Is that all we are?" She stood before her students, who sat on wooden benches in a semicircle around her. It was a beautiful day and, in that moment, the terrible fear of war had disappeared, replaced only by the fascination of learning and discovery. Perisophia could see that plainly in their young faces and felt an upwelling of emotion. It surprised her, and she allowed it to blossom and fade as she looked with deep affection at her class. She could only hope her students would grow and thrive so as to carry on the torch of logic, reason, and science in an age of madness and superstition. "Take for instance the leonin cub who is raised by wolves. His identity has been shifted, influenced by his adopted culture. Is he a leonin or is he a wolf or is he something else?" #figure(image("001_The Nature of Identity/01.jpg", width: 100%), caption: [Art by Raymond Swanland], supplement: none, numbering: none) "He is still a leonin, but his mannerisms and actions will be that of a wolf," Kyrios said, half stating and half-questioning. "So you say that it is his physical body that defines his identity," Perisophia said, her eyebrow raised. "But what of his mind?" Samia said, "Isn't his mind more capable than a wolf's? His capacity to understand is greater, therefore he will always be different in kind to a wolf. He's a leonin." Students then began to volunteer answers one way or the other, some saying, "Leonin, definitely." Some saying. "No, his mind is a wolf's and the mind is primary in defining who we are. He's a wolf by that definition." Perisophia spoke. "Wait, wait. Don't always be so quick to try and answer the question. Dwell in the mystery for a bit and see what arises. We are always so eager to know, to label it and move on to the next thing without really looking. Just be with it. Put your desire of knowing aside and just observe the problem without wanting it known." The students sat and Perisophia watched them wrestle with their own internal struggles, the mind's desire to know and not think it through. It was an irrational impulse within people, especially so-called philosophers, to kill the mystery with a hastily come-to answer and pass it off as truth. Setessans used arrows. Akroans used swords. Meletians used their minds. Each polis killed truth in its own way. Rhytho spoke. "He is neither wolf nor leonin. If identity is who we are and that is known only to ourselves, then it cannot given to us by an outside observer. It cannot be given to us by the #emph[status quo] ." "Interesting." Perisophia said. "Are you saying that identity can't be known by someone outside? That our identity is our own possession?" Rhytho thought a bit while the other students looked on. "Yes. I believe so." "Let's move from there. If you cannot get your true identity from another—whether it be an individual or a group—then can you know yourself? Or is your identity unknown even to you?" Melia raised her hand and Perisophia nodded. Melia said, "Phelos states that identity is the condition of being oneself, of remaining the same over time." "That is the surface logic," Perisophia replied, "but I am interested in something deeper. Can you know yourself? Can your identity be an object of knowledge, or is it something entirely different?" The sun was moving higher in the sky, toward its zenith. The breeze had shifted slightly and carried with it the sounds of the fountain and the distant marketplace. People moved around the forum and the smells of the bakers and cooks began to permeate the air as the midday break approached. Perisophia took a deep breath and inhaled the life all around her. She opened her eyes and absorbed the light, the images, the movement. It was a beautiful sight. People tended to good when left in peace, when freed from stress and worry and turmoil. She could sense the goodness, the rightness in them, as they smiled at one another in passing. They took pride in their crafts, made their buildings strong, made their bread wholesome. Their work carried and reflected their joy. She also could sense the storm on the horizon, the seed of Mogis lurking in every living soul, just waiting to erupt and take over. Only through awareness could his darkness be held back and, perhaps, dissolved entirely. She sensed a student's question as it bubbled up to the surface. "Master Perisophia," Samia said. "What about the Returned and the eidolons? Their identity is claimed to be destroyed, so that would imply that their identity exists as some kind of object otherwise it could not be erased." #figure(image("001_The Nature of Identity/02.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) "Ah, you have read Dekatia's #emph[Observations] . Let us look at that." Perisophia looked up at the sky. They were under the hypostyle of the Forum, shaded from the sun's growing heat, but Perisophia was known to gaze up at the sun and the sky from time to time. Her students soon learned that she was always listening and aware even if she appeared to be disengaged or distracted. They waited for her like hungry cats waited for a saucer of milk. At last, she said, "Have you watched water boil from a pot? Some might say that the water is destroyed and is gone forever. If one looks more closely, it becomes evident that the water is transmuted into vapor and is not destroyed. It would appear that the Returned and the eidolons lack the capacity for an identity. Similar to the wolf, they have sunk below human intellect and act from a rudimentary cluster of memories. Unlike the leonin cub, they cannot become aware of themselves." "It makes me think of the story of Matatios, who met himself," Salis said. #figure(image("001_The Nature of Identity/03.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) Perisophia laughed. "Indeed. His overwhelming infatuation with himself manifested wholly. Let that be a lesson of the power of your own mind and intention. But be careful in drawing that parallel, <NAME> did not become #emph[aware] of himself, he only met himself. Matatios was just as ignorant after meeting himself as he was before, and the meeting taught him little of the nature of his identity." "So, what is the nature of identity?" Rhytho asked. The sun had reached its zenith. Perisophia reached over and collected her book and staff. The students knew that the lesson was coming to a close. She looked at them and smiled. "It is something that I cannot tell you. It is something that I cannot give you. Perhaps it is something we cannot know. Identity is not in the past, nor does it dwell in the future. It lives in the moment. This moment. And you are the architect of this moment. Your actions, your speech, your deeds, all speak to your identity, but ultimately, it would seem that it is elusive to the mind. It is one of the great mysteries, and it is up to you in every moment that you become aware to figure out what your identity will be." #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) #linebreak #figure(image("001_The Nature of Identity/04.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) Perisophia's body slept but she was very much awake. "How is my city?" The voice of Ephara echoed into the void. "Meletis is filled with goodness. People do your works, even if they are not aware of it, the weaving of their fabric is strong and firm." Perisophia sat under a tree in a field that floated within a sea of stars. "War is coming. A tyrant tears at the threshold of our world and yours, and he will bring out the worst in people's hearts. You have done much to shore up the tide of fear that swells within humanity, Perisophia, but your work has only just begun." Perisophia looked at the leaves of the tree as they shimmered with an internal light in the airless netherworld. Perisophia turned and looked at the face of the god and gazed into her eyes. "With my dying breath I will speak only words that uplift the human mind and soul. How could I do anything less?" #figure(image("001_The Nature of Identity/05.jpg", height: 40%), caption: [], supplement: none, numbering: none)
https://github.com/masaori/exact-solution-of-2d-ising-model
https://raw.githubusercontent.com/masaori/exact-solution-of-2d-ising-model/main/main.typ
typst
#import "@preview/cetz:0.1.2" #import "@preview/commute:0.2.0": node, arr, commutative-diagram #import "@preview/fletcher:0.5.1" as fletcher: diagram, node, edge #import "theorem.typ": theorem, claim, proof, definition, note, theorem_rules #set block(breakable: false) #show: theorem_rules.with(qed-symbol: $square$) #let mapDef(f, A, B, a, b, comment) = { $ #grid( columns: 6, gutter: 5pt, $#f$, $:$, $#A$, $->$, $#B$, $#comment$, "", "", rotate(-90deg, $in$), "", rotate(-90deg, $in$), "", "", "", $#a$, $|->$, $#b$, "" ) $ } == 線型写像のexp #theorem(none)[ 体$K$: $RR$または$CC$, $V$: 有限次元$K$-ノルム線型空間 線型写像 $X$ : $V -> V$ について、 $ sum_(n=0)^(infinity) (1/n!) overbrace(X compose X compose dots compose X, n "times") $ は、線型写像 $V -> V$に各点収束する ] #proof[ $V$は有限次元なので、基底$E subset V$が存在するので、$X$は有限次元行列$A in M(K)$として表せる。 $v in V$について、$v$は数ベクトル$w in K^d$として表せて、$(sum_(n=0)^(infinity) (1/n!) A^n)w$の各成分は、絶対収束する。 (証明略) ] #definition(none)[ 有限次元線型空間 $V$ $exp : "End"(V) -> "End"(V)$を以下のように定める。 線型写像 $X in "End"(V)$ について、 $ exp(X) := sum_(n=0)^(infinity) (1/n!) overbrace(X compose X compose dots compose X, n "times") $ ] = 対角化の計算 (ホロノミック量子場 付録B) == 記号の定義 - $cal(F) := (CC^2)^(times.circle M)$ - $sigma_k^x := I times.circle dots.c times.circle limits(k"th")(sigma^x) times.circle dots.c times.circle I in "End"(cal(F))$ - $sigma_k^y := I times.circle dots.c times.circle limits(k"th")(sigma^y) times.circle dots.c times.circle I in "End"(cal(F))$ - $sigma_k^z := I times.circle dots.c times.circle limits(k"th")(sigma^z) times.circle dots.c times.circle I in "End"(cal(F))$ - $V_1 := exp (sqrt(-1) K_1 dot.op (sigma_1^z sigma_2^z + sigma_2^z sigma_3^z + dots.c + sigma_M^z sigma_1^z)) in "End"(cal(F))$ - $V_2 := (2 sinh 2K_2)^(M/2) exp (K_2^* dot.op (sigma_1^x + sigma_2^x + dots.c + sigma_M^x)) in "End"(cal(F))$ - $Z_m := sigma_1^x dots.c sigma_(m-1)^x sigma_m^z in "End"(cal(F)) quad "ただし、" Z_1 := sigma_1^z quad ("ホロノミック量子場では" p_m)$ 正し、$Z_(M+1) := Z_1$ - $Y_m := sigma_1^x dots.c sigma_(m-1)^x sigma_m^y in "End"(cal(F)) quad "ただし、" Y_1 := sigma_1^y quad ("ホロノミック量子場では" q_m)$ 正し、$Y_(M+1) := Y_1$ - $K_1^* := -1/2 log(tanh K_1) arrow.l.r sinh(K_1) sinh(K_1^*) = 1$ - $K_2^* := -1/2 log(tanh K_2) arrow.l.r sinh(K_2) sinh(K_2^*) = 1$ - $c_i := cosh 2K_i, quad s_i := sinh 2K_i,$ - $c_i^* := cosh 2K_i^, quad s_i^ := sinh 2K_i^*$ - $epsilon := sigma_1^x dots.c sigma_M^x = (sqrt(-1))^M Z_1 Y_1 dots.c Y_M Y_M in "End"(cal(F))$ TODO: Z Zhatを定義 #definition(none)[ $ H_1^((plus.minus)) := Y_1 Z_2 + Y_2 Z_3 + dots.c minus.plus 1_("End"(cal(F))) Y_M Z_1 $ $ H_2 := Z_1 Y_1 + Z_2 Y_2 + dots.c + Z_M Y_M $ ] よって、 $ V_1^((plus.minus)) = exp(K_1 dot.op H_1^((plus.minus))), quad V_1^((-)) = exp(K_1 dot.op H_2) $ #claim[$H_1^((plus.minus)), H_2$を$hat(Z),hat(Y)$で表す][ $ H_1^((plus.minus)) &= 1/M sum_(j in {1, dots.c, M}) ( hat(Y)_j hat(Z)_(-j)^((plus.minus)) exp( - sqrt(-1) (2 pi j) / M ) ) \ H_2 &= 1/M sum_(j in {1, dots.c, M}) ( hat(Z)_(-j)^((-)) hat(Y)_j ) $ ] == $T_(V_(1))(hat(Z))$と$hat(Z),hat(Y)$の関係 #claim(none)[ $ T_((V_1^((plus.minus)))^(1/2))(hat(Z)_mu^((plus.minus))) &= (V_1^((plus.minus)))^(1/2) dot hat(Z)_mu^((plus.minus)) dot (V_1^((plus.minus)))^(-1/2) \ &= cosh(K_1) dot hat(Z)_mu^((plus.minus)) + sqrt(-1) exp( - sqrt(-1) (2 pi mu) / M ) sinh(K_1) dot hat(Y)_mu \ T_((V_1^((-)))^(1/2))(hat(Y)_mu) &= (V_1^((-)))^(1/2) dot hat(Y)_mu dot (V_1^((-)))^(-1/2) \ &= - sqrt(-1) exp( - sqrt(-1) (2 pi mu) / M ) hat(Z)_mu^((-)) dot + cosh(K_1) dot hat(Y)_mu \ T_(V_2)(hat(Z)_mu^((plus.minus))) &= V_2 dot hat(Z)_mu^((plus.minus)) dot V_2^(-1) \ &= c_2^* dot hat(Z)_mu^((plus.minus)) - sqrt(-1) s_2^* dot hat(Y)_mu \ T_(V_2)(hat(Y)_mu) &= V_2 dot hat(Y)_mu dot V_2^(-1) \ &= sqrt(-1) s_2 dot hat(Z)_mu^((-)) + c_2 dot hat(Y)_mu \ $ ] #proof[ $T_((V_1^((plus.minus)))^(1/2))(hat(Z)_mu^((plus.minus)))$について、 $ T_((V_1^((plus.minus)))^(1/2))(hat(Z)_mu^((plus.minus))) &= (V_1^((plus.minus)))^(1/2) dot hat(Z)_mu^((plus.minus)) dot (V_1^((plus.minus)))^(-1/2) \ &= (exp(K_1 dot.op H_1^((plus.minus))))^(1/2) dot hat(Z)_mu^((plus.minus)) dot (exp(K_1 dot.op H_1^((plus.minus))))^(-1/2) \ $ ] == $e^(X) Y e^(-X) = e^("ad"(X))(Y)$ の証明 === リー群リー環を使うノリ *参考) Lie群とLie環1 の 定理 5.49* #box[ #diagram( cell-size: 15mm, $ frak(g) edge(dif phi, ->) edge("d", exp, ->) & frak(h) edge("d", exp, ->) \ G edge(phi, ->) & H $ ) ] $G, H:$ Lie群, 連続な準同型写像 $phi: G -> H$ について、 - $phi$は$C^(omega)$級である。 - Lie環$frak(g) := "Lie"(G)$から$frak(h) := "Lie"(H)$への準同型写像$dif phi_(e): frak(g) -> frak(h)$が存在し、$phi(exp(X)) = exp(dif phi_(e)(X))$を満たす。 この定理の証明を参考に、以下の定理を示したい。 #definition(none)[ $G:$リー群, $frak(g):$リー環 #mapDef("Ad", $G$, $"Aut"(G)$, $g$, $(x -> g x g^(-1))$, "") #mapDef("ad", $frak(g)$, $"End"(frak(g))$, $X$, $(Y -> [X, Y])$, "") ] #theorem(none)[ $G:$ Lie群, $frak(g):$ Lie環 $ "Ad"(exp(X))= exp("ad"(X)) $ #proof[ TODO: もし、$"Aut"(G)$がLie群であり、$"End"(frak(g))$がそれに付随するLie環(接空間)であるならば、上の定理がそのまま使える。 そうでないなら、$phi$を$G->"Aut"(H)$とした別の定理を示す必要がある。 ] ] === 式変形を頑張るノリ - $M(n:CC)$を$CC^(n times n)$と同一視することで、$M(n:CC)$上に内積が定まる - その内積からノルムと距離が定まる - そのノルムから具体的な位相が定まるので、収束の議論がわかりやすくできる - 「収束」の定義だけしておく。一般の位相構造には触れないで良いのでは? #definition([$M(n:CC)$の内積])[TODO] #definition([$M(n:CC)$のノルム])[TODO] #definition([$M(n:CC)$の収束])[TODO] #theorem("Lie Groups, Lie Algebras, and Representations excise 14")[ $K := bb(R)$もしくは$bb(C)$, $d in bold(Z)_(gt.eq)$ $X, Y in M(K, d)$について、 $ overbrace( #$[X, [X, dots.c , [X, Y] dots.c ]$, m "times" ) = sum_(k=0)^m binom(m, k) X^k Y(-X)^(m-k) $ #proof[ TODO: 帰納法で行ける ] ] #definition("Lie Groups, Lie Algebras, and Representations Definition 1.4")[ $"GL"(n, CC) := { x"は可逆" | x in "M"(n, CC)}$ このとき、$"GL"(n, CC)$は群になる。 TODO: これを2組でちゃんと書く $bold("GL")(n, CC) := ("GL"(n, CC), dot)$ ] #definition("Lie Groups, Lie Algebras, and Representations Definition 1.4")[ $G subset bold("GL")(n, CC)$ で、以下の性質を満たす 1. $G$は部分群 2. $forall A_m : M(n, CC)"上収束する"G"の元の列" A := lim_(m->oo) A_m"とするとき、"A in G or A in.not bold("GL")(n, CC) $ このとき、$G$を Matrix Lie群という ] // #definition("Lie Groups, Lie Algebras, and Representations Definition 3.18")[ // $G$ : Matrix Lie群について、 // $frak(g) := {X in M(n, CC) | exp(t X) in G "for all" t in RR}$ // $frak(g)$を$G$のLie環という // ] // #theorem([$frak(g)$が和と交換子で閉じていることの証明])[ // TODO // ] // #definition([$G$と$frak(g)$の共通集合])[ // $cal(G) subset M(n, CC)$を、 // $ // cal(G) := G sect frak(g) // $ // と定める。 // ] #definition("Lie Groups, Lie Algebras, and Representations Definition 3.32")[ // $G$ : Matrix Lie群, $frak(g)$ : $G$のLie環 $G$ : Matrix Lie群 $g in G$について、 #mapDef($"Ad"_g$, $G$, $G$, $h$, $g h g^(-1)$, "") // $X in frak(g)$について、 // #mapDef($"ad"_X$, $frak(g)$, $frak(g)$, $Y$, $[X, Y]$, "") $X in M(n, CC)$について、 #mapDef($"ad"_X$, $M(n, CC)$, $M(n, CC)$, $Y$, $[X, Y]$, "") ] #theorem("Lie Groups, Lie Algebras, and Representations Proposition 3.35")[ // $forall X in frak(g), forall Y in cal(G)$ $forall X, Y in M(n, CC)$ $ e^(op("ad")_X)(Y) = Y + [X, Y] + 1/2 [X, [X, Y]] + dots $ ] #theorem("Lie Groups, Lie Algebras, and Representations Proposition 3.35")[ // $forall X in frak(g), forall Y in cal(G)$ $forall X in M(n, CC) s.t. (forall t in RR exp(t X) in G), forall Y in G$ $ exp(X) Y exp(-X) = op("Ad")_(exp(X))(Y) = exp(op("ad")_X)(Y) $ ] 次回(9/29) - Lie Groups, Lie Algebras, and RepresentationsのProposition 3.35.の証明の概略はたどりたい - 続き - 公式の意味は定まったので、計算は進みそう - Lie群であることはどこで使われるか?(収束性の話) - 文献管理 Bibliography https://typst.app/docs/reference/model/bibliography/ やってみる = 全体のノリ - 分配関数を行列環の元のtraceに対応させる $<-$ この元の固有値を求めたい - その元が、行列環の「群をなす部分集合(かつ次元の低い部分空間の中にある)」の元だとわかると、リー群 リー環の対応によって計算が進む - なので、行列環とクリフォード代数の同型が見つけたい - かつ、分配関数がクリフォード群の元のtraceに対応するとわかりたい
https://github.com/SillyFreak/typst-crudo
https://raw.githubusercontent.com/SillyFreak/typst-crudo/main/docs/manual.typ
typst
MIT License
#import "template.typ" as template: * #import "/src/lib.typ" as crudo #let package-meta = toml("/typst.toml").package #let date = datetime(year: 2024, month: 9, day: 28) #show: manual( title: "Crudo", // subtitle: "...", authors: package-meta.authors.map(a => a.split("<").at(0).trim()), abstract: [ _Crudo_ lets you take slices from raw blocks and more: slice, filter, transform and join the lines of raw blocks. ], url: package-meta.repository, version: package-meta.version, date: date, ) // the scope for evaluating expressions and documentation #let scope = (crudo: crudo) = Introduction `raw` elements feel similar to arrays and strings in a lot of ways: they feel like lists of lines; it's common to want to extract spcific lines, join multiple ones together, etc. As values, though, `raw` elements don't behave this way. While a package can't add methods such as `raw.slice()` to an element, we can at least provide functions to help with common tasks. The module reference describes these utility functions: - #ref-fn("r2l()") and #ref-fn("l2r()") are the building blocks the others build on: _raw-to-lines_ and _lines-to-raw_ conversions. - #ref-fn("transform-text()") and #ref-fn("transform()") are one layer above and allow arbitrarily transforming the text content, viewed as a single string or an array of strings, respectively. - #ref-fn("read()") reads a text file and puts it in a raw element with the provided `raw` properties. - #ref-fn("map()"), #ref-fn("filter()") and #ref-fn("slice()") are analogous to their `array` counterparts. - #ref-fn("lines()") is similar to `slice()` but allows more advanced line selections in a single step. - #ref-fn("join()") combines multiple `raw` elements and is convenient e.g. to add preambles to code snippets. All functions that accept raw elements as parameters alternatively accept simple strings. In these cases, a string `code` behaves like `raw(code)`, i.e. it's not a `block` element and has no `lang` set on it. This is mostly useful with #ref-fn("join()"), which takes multiple raw elements, but the other functions don't disallow this usage. = Module reference #module( read("/src/lib.typ"), name: "crudo", label-prefix: none, scope: scope, )
https://github.com/Skimmeroni/Appunti
https://raw.githubusercontent.com/Skimmeroni/Appunti/main/Matematica4AI/LinAlg/Transformations.typ
typst
Creative Commons Zero v1.0 Universal
#import "../Math4AI_definitions.typ": * A transformation $phi.alt: V |-> W$, with both $V$ and $W$ being vector spaces, is called a *linear transformation* if and only if: #grid( columns: (0.5fr, 0.5fr), [$ phi.alt(underline(v_(1)) + underline(v_(2))) = phi.alt(underline(v_(1))) + phi.alt(underline(v_(2))) space forall underline(v_(1)), underline(v_(2)) in V $], [$ phi.alt(lambda underline(v)) = lambda phi.alt(underline(v)) space forall underline(v) in V, lambda in RR $] ) In particular, if $V = W$, the transformation $phi.alt$ is said to be an *endomorphism*. #exercise[ Consider the vector space $RR$ (that is, the set of real numbers). Check whether the transformations $phi.alt_(1) (x) = 2 x$ and $phi.alt_(2) (x) = x + 1$ are linear or not. ] #solution[ - The transformation $phi.alt_(1) (x) = 2 x$ is linear. Infact, given two real numbers $a$ and $b$, is indeed true that $2(a + b) = 2 a + 2 b$, since the product between real numbers has the distributive property. Similarly, given a real number $a$ and a real number $lambda$, it is true that $2(lambda a) = 2 lambda a$, since the product between real numbers has the associative property; - The transformation $phi.alt_(2) (x) = x + 1$ is not linear. Given two real numbers $a$ and $b$, it results in $phi.alt_(2) (a + b) = (a + b) + 1 = a + b + 1$, while $phi.alt_(2) (a) + phi.alt_(2) (b) = a + 1 + b + 1 = a + b + 2$. ] It can be shown that a linear transformation is equivalent to a manipulation of matrices. Let $phi.alt: V |-> W$ be a linear transformation between two vector space $V$ and $W$. Let $B = {underline(b_(1)), dots, underline(b_(n))}$ be a basis for $V$ and $C = {underline(c_(1)), dots, underline(c_(m))}$ a basis for $W$. Each vector $underline(x) in V$ can be written as a linear combination of the vectors of $B$: $ underline(x) = sum_(i = 1)^(n) lambda_(i) underline(b_(i)) $ Applying $phi.alt$ to $underline(x)$ gives: $ phi.alt(underline(x)) = phi.alt(sum_(i = 1)^(n) lambda_(i) underline(b_(i))) = sum_(i = 1)^(n) phi.alt(lambda_(i) underline(b_(i))) = sum_(i = 1)^(n) lambda_(i) phi.alt(underline(b_(i))) $ The two rightmost equalities stem from the fact that $phi.alt$ is linear. Each $phi.alt(b_(i))$ is a vector of $W$, since it's the result of applying $phi.alt$ to an vector of $V$. This means that each $phi.alt(b_(i))$ can itself be written as a linear combination of elements of $C$: $ phi.alt(b_(i)) = sum_(j = 1)^(m) gamma_(j, i) c_(j) $ Substituting it back in the previous expression gives: $ phi.alt(underline(x)) = sum_(i = 1)^(n) lambda_(i) (sum_(j = 1)^(m) gamma_(j, i) c_(j)) = sum_(i, j = 1)^(n, m) lambda_(i) gamma_(j, i) c_(j) $ This means that, fixed a given basis $B$, to know all the relevant information regarding a vector $underline(x)$ of $V$ it suffices to "store" the $lambda$ coefficients of its linear combination with respect to $B$ in a (column) vector. In a similar fashion, to know all the relevant information of its image $phi.alt(underline(x))$ it suffices to store the $sum_(j = 1)^(m) lambda_(i) gamma_(j, i)$ coefficients of its linear combination with respect to $C$ in a (column) vector: #grid( columns: (0.5fr, 0.5fr), [$ underline(x) <==> mat(lambda_(1); dots.v; lambda_(n)) $], [$ phi.alt(underline(x)) <==> mat(mu_(1); dots.v; mu_(n)) $] ) Where, for clarity, each $sum_(j = 1)^(m) lambda_(i) gamma_(j, i)$ has been written simply as $mu_(i)$. It is then possible to describe the application of the transformation $phi.alt$ as the following product of matrices: $ mat(mu_(1); dots.v; mu_(n)) = mat(gamma_(1, 1), gamma_(1, 2), dots, gamma_(1, n); gamma_(2, 1), gamma_(2, 2), dots, gamma_(2, n); dots.v, dots.v, dots.down, dots.v; gamma_(m, 1), gamma_(m, 2), dots, gamma_(m, n)) mat(lambda_(1); dots.v; lambda_(n)) $ #exercise[ Consider the linear application $T: RR^(3) |-> RR^(2)$ defined below. Express it as a matrix multiplication with respect to the two bases $cal(B)_(1)$ and $cal(B)_(2)$. #grid( columns: (0.33fr, 0.33fr, 0.33fr), [$ T mat(x; y; z) = mat(x - z; y + z) $], [$ cal(B)_(1) = {mat(1; 0; 1), mat(2; 1; -1), mat(-2; 1; 4)} $], [$ cal(B)_(2) = {mat(1; 2), mat(2; 1)} $], ) ] #solution[ The first step is to express the vectors of $cal(B)_(1)$ for $RR^(3)$ evaluated in $T$ as linear combinations of the vectors of $cal(B)_(2)$ for $RR^(2)$: #grid( columns: (0.33fr, 0.33fr, 0.33fr), [$ T mat(1; 0; 1) = lambda_(1, 1) mat(1; 2) + lambda_(2, 1) mat(2; 1) $], [$ T mat(2; 1; -1) = lambda_(1, 2) mat(1; 2) + lambda_(2, 2) mat(2; 1) $], [$ T mat(-2; 1; 4) = lambda_(1, 3) mat(1; 2) + lambda_(2, 3) mat(2; 1) $], ) // And then? ] // There's a VERY nice exercise using polynomials and derivatives in the // October 1st lecture. Should be stolen ASAP Let $T: V |-> W$ a linear transformation between vector spaces $V$ and $W$. The set of all vectors of $W$ that have a correspondant in $V$ through $T$ is called the *image* of the transformation $T$, and is denoted as $Im(T)$. It may or may not coincide with $W$. $ Im(T) = {underline(w) in W: exists underline(v) in V space "s.t." space T(underline(v)) = underline(w)} $ The notion of image is present in every transformations, not just linear ones, but images of linear transformations possess properties that images of generic transformations don't. #theorem[ Let $T: V |-> W$ be a linear transformation between vector spaces $V$ and $W$. $Im(W)$ is a subspace of $W$. ] <Image-of-transformation-is-vector-space> #proof[ By @Subspace-proven-by-being-algebraically-closed, it suffices to prove that $underline(w_(1)) + underline(w_(2)) in Im(W)$ holds for all $underline(w_(1)), underline(w_(2)) in Im(W)$ and that $lambda underline(w) in Im(W)$ holds for all $underline(w) in Im(W)$ and $lambda in RR$. By definition, if $underline(w) in Im(W)$ then there exists $underline(v) in V$ such that $T(underline(v)) = underline(w)$. Therefore: #grid( columns: (0.5fr, 0.5fr), [$ underline(w_(1)) + underline(w_(2)) = T(underline(v_(1))) + T(underline(v_(2))) $], [$ lambda underline(w) = lambda T(underline(v)) $] ) By virtue of $T$ being linear: #grid( columns: (0.5fr, 0.5fr), [$ underline(w_(1)) + underline(w_(2)) = T(underline(v_(1))) + T(underline(v_(2))) = T(underline(v_(1)) + underline(v_(2))) $], [$ lambda underline(w) = lambda T(underline(v)) = T(lambda underline(v)) $] ) In both cases, there exists a vector in $V$ such that the application of $T$ gives such vector, therefore $Im(W)$ is algebraically closed with respect to the operations defined for $W$. ] Let $T: V |-> W$ a linear transformation between vector spaces $V$ and $W$. The set of all vectors of $V$ such that the application of $T$ to those vectors gives the null vector (of $W$) is called the *kernel* of $T$, and is denoted as $ker(T)$. $ ker(T) = {underline(v) in V: T(underline(v)) = underline(0)} $ #theorem[ Let $T: V |-> W$ be a linear transformation between vector spaces $V$ and $W$. $ker(V)$ is a subspace of $V$. ] <Kernel-of-transformation-is-vector-space> #proof[ By @Subspace-proven-by-being-algebraically-closed, it suffices to prove that $underline(v_(1)) + underline(v_(2)) in ker(V)$ holds for all $underline(v_(1)), underline(v_(2)) in ker(V)$ and that $lambda underline(v) in ker(V)$ holds for all $underline(v) in ker(V)$ and $lambda in RR$. By definition, if $underline(v) in ker(V)$ holds, then $T(underline(v)) = 0$. By virtue of $T$ being linear: #grid( columns: (0.5fr, 0.5fr), [$ T(underline(v_(1)) + underline(v_(2))) = T(underline(v_(1))) + T(underline(v_(2))) = underline(0) + underline(0) = underline(0) $], [$ T(lambda underline(v)) = lambda T(underline(v)) = lambda (underline(0)) = underline(0) $] ) ] Let $T: V |-> W$ be a linear transformation between vector spaces $V$ and $W$. The dimension of the image of $T$ is called the *rank* of $T$, and denoted as $"rank"(T)$, while the dimension of the kernel of $T$ is called the *nullity* of $T$, and denoted as $"null"(T)$. #theorem("Rank-nullity theorem")[ Let $T: V |-> W$ be a linear transformation between vector spaces $V$ and $W$. The dimension of $V$ is given by the sum of the rank of $T$ and the nullity of $T$: $ dim(V) = "rank"(T) + "null"(T) = dim(ker(T)) + dim(Im(T)) $ ] <Rank-nullity-theorem> // #proof[ // Hard to prove // ] Let $T: V |-> W$ be a linear transformation between vector spaces $V$ and $W$. The linear transformation $T^(-1): W |-> V$ is said to be the *inverse* of $T$ if: $ T^(-1)(T(underline(v))) = T(T^(-1)(underline(v))) = underline(v), space forall underline(v) in V $ As for any function, a linear transformation $T$ has an inverse if and only if it is both injective and subjective. A linear transformation that has an inverse is said to be *invertible*. #theorem[ Let $T: V |-> W$ be a linear transformation. If $T$ is injective, then its nullity is $0$. ] <Injective-transformations-have-empty-nullity> #proof[ If $T$ is injective then, for any distinct $underline(v_(1)), underline(v_(2)) in V$, $T(underline(v_(1))) eq.not T(underline(v_(2)))$, which is to say $T(underline(v_(1))) - T(underline(v_(2))) eq.not underline(0)$. But $T$ is linear by definition, therefore $T(underline(v_(1))) - T(underline(v_(2))) = T(underline(v_(1)) - underline(v_(2)))$. Being $V$ a vector space, it algebraically closed with respect to the sum of vectors, therefore $(underline(v_(1)) - underline(v_(2)))$ is itself a member of $V$ distinct from $underline(0)$, be it $underline(v)$. In other words, if $T$ is injective, $T(underline(v))$ has to be different from $underline(0)$ for any $underline(v) in V$, that isn't the null vector, that is to say that the kernel is only composed of the null vector, which is the definition of the nullity of a linear transformation to be $0$. ] #theorem[ Let $T: V |-> W$ be a linear transformation. If $T$ is invertible, then $V$ and $W$ have the same dimension. ] <Invertible-transformations-have-equal-dimensions> #proof[ By @Rank-nullity-theorem, $dim(V) = dim(ker(T)) + dim(Im(T))$. Being $T$ invertible, the dimension of the image equals the dimension of the codomain $W$. By @Injective-transformations-have-empty-nullity, $dim(ker(T)) = 0$. Therefore, $dim(V) = 0 + dim(Im(T)) = dim(W)$. ] As stated before, every result concerning linear transformations can be formulated very naturally as a result concerning matrices. #theorem[ Let A be the $m times n$ matrix associated to the invertible linear application $T: V |-> W$ with respect to two bases $cal(B)$ and $cal(C)$. Then, $m$ and $n$ are equal (that is, $A$ is a square matrix). ] <Invertible-matrices-have-equal-dimensions> #proof[ By @Invertible-transformations-have-equal-dimensions, if $T$ is an invertible linear transformation, $dim(V) = dim(W)$. Since the dimensions of $A$ are $dim(V)$ and $dim(W)$ respectively, $m = n$. ] Indeed, it is possible to define a kernel and an image for an invertible matrix. Consider the linear transformation $T: V |-> W$, with respect to whom a $n times n$ matrix $A$ of real values can be associated. Therefore, any vector $underline(w) in W$ can be written as $A underline(v)$, where $underline(v)$ is a vector in $V$. Writing $v$ as a linear combination of the canonical basis of $V$ gives: $ underline(w) = A underline(v) = A(lambda_(1) underline(e_(1)) + lambda_(2) underline(e_(2)) + dots + lambda_(n) underline(e_(n))) = A lambda_(1) underline(e_(1)) + A lambda_(2) underline(e_(2)) + dots + A lambda_(n) underline(e_(n)) $ But multiplying the matrix $A$ by the canonical vector $underline(e_(i))$ simply returns the $i$-th column of $A$: $ A underline(e_(i)) = mat( a_(1, 1), a_(1, 2), dots, a_(1, n); a_(2, 1), a_(2, 2), dots, a_(2, n); dots.v, dots.v, dots.down, dots.v; a_(n, 1), a_(n, 2), dots, a_(n, n); ) mat(0; dots.v; i; dots.v; 0) = mat(a_(1, i); a_(2, i); dots.v; a_(n, i)) $ Which means that any image can be written as a linear combination of the columns of $A$, taken as vectors: $ underline(w) = A underline(v) = A lambda_(1) underline(e_(1)) + A lambda_(2) underline(e_(2)) + dots + A lambda_(n) underline(e_(n)) = lambda_(1) mat(a_(1, 1); a_(2, 1); dots.v; a_(n, 1)) + lambda_(2) mat(a_(1, 2); a_(2, 2); dots.v; a_(n, 2)) + dots + lambda_(n) mat(a_(1, n); a_(2, n); dots.v; a_(n, n)) $ Being $underline(w)$ a generic vector, this must mean that the columns of $A$, taken as vectors, is a set that can generate $W$. To know the dimension of $Im(V)$, that is to say, the rank of $A$, it suffices to find the smallest number of column-vectors of $A$ that is linearly independent. By @Rank-nullity-theorem, the dimension of $Im(V)$, which is equal to $"rank"(A)$, has to be equal to the dimension of the domain, which in this case is just $RR^(n)$ having dimension $n$. Therefore, for a matrix to be invertible (that is, to be the matrix associated to an invertible linear transformation), its rank has to be equal to the number of its columns or, equivalently, if its columns form a linearly independent set. If this happens, such a matrix is said to have *full rank*. // To move this around #theorem[ A matrix is invertible if and only if it has full rank. ] <Full-rank-matrices-are-invertible> @Basis-change-is-matrix-multiplication proves that it is possible to convert the representation of a vector with respect to a given basis in the representation of the same vector to a different basis by multiplying the known representation with respect to a "conversion" matrix $P$. The same can be achieved with respect to matrices associated to endomorphisms. #theorem[ Let $T: V |-> V$ be an endomorphism of dimension $n$. Let $A$ be the matrix associated to $T$ with respect to the basis $cal(B)$ (for both domain and codomain), and let $A'$ be the matrix associated to $T$ with respect to a different basis $cal(B')$. There exists an invertible matrix $P$ such that: $ A = P A' P^(-1) $ ] <Matrix-basis-change-is-matrix-multiplication> #proof[ Let $underline(x)$ be a vector of $V$, and let $underline(y)$ be the result of applying $T$ to $underline(x)$. Being $T$ an endomorphism, both $underline(x)$ and $underline(y)$ belong to the same vector space, and can therefore be represented by the bases $cal(B)$ and $cal(B')$: #grid( columns: (0.25fr, 0.25fr, 0.25fr, 0.25fr), [$ underline(x) <=> mat(x_(1); dots.v; x_(n))_(cal(B)) $], [$ underline(x) <=> mat(x'_(1); dots.v; x'_(n))_(cal(B')) $], [$ underline(y) = T(underline(x)) <=> mat(y_(1); dots.v; y_(n))_(cal(B)) $], [$ underline(y) = T(underline(x)) <=> mat(y'_(1); dots.v; y'_(n))_(cal(B')) $], ) By definition of associated matrix, applying $T$ to $underline(x)$ is equivalent to multiplying $A$ with the representation of $underline(x)$ with respect to $cal(B)$, or multiplying $A'$ with the representation of $underline(x)$ with respect to $cal(B')$: #grid( columns: (0.5fr, 0.5fr), [$ mat(y_(1); dots.v; y_(n))_(cal(B)) = A mat(x_(1); dots.v; x_(n))_(cal(B)) $], [$ mat(y'_(1); dots.v; y'_(n))_(cal(B')) = A' mat(x'_(1); dots.v; x'_(n))_(cal(B')) $] ) As stated in @Basis-change-is-matrix-multiplication, there exist a matrix $P$ that permits to convert the representation of a vector with respect to a given basis in the representation to a different basis, while the inverse matrix $P^(-1)$ does the opposite conversion. Such conversion, since they belong to the same vector space $V$, can be done for both $underline(x)$ and $underline(y)$: #grid( columns: (0.5fr, 0.5fr), [$ mat(y'_(1); y'_(2); dots.v; y'_(n)) = P^(-1) mat(y_(1); y_(2); dots.v; y_(n)) $], [$ mat(x'_(1); x'_(2); dots.v; x'_(n)) = P^(-1) mat(x_(1); x_(2); dots.v; x_(n)) $]) Substituting in the previous expression gives: $ mat(y'_(1); dots.v; y'_(n))_(cal(B')) = A' mat(x'_(1); dots.v; x'_(n))_(cal(B')) => P^(-1) mat(y_(1); dots.v; y_(n))_(cal(B)) = A' P^(-1) mat(x_(1); dots.v; x_(n))_(cal(B)) => P^(-1) A cancel(mat(x_(1); dots.v; x_(n))_(cal(B))) = A' P^(-1) cancel(mat(x_(1); dots.v; x_(n))_(cal(B))) => \ P^(-1) A = A' P^(-1) => cancel(P) cancel(P^(-1)) A = P A' P^(-1) => A = P A' P^(-1) $ ]
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/mitex/0.2.0/examples/example.typ
typst
Apache License 2.0
#import "../lib.typ": * #set page(width: 500pt, height: auto, margin: 1em) #assert.eq(mitex-convert("\alpha x"), "alpha x ") Write inline equations like #mi("x") or #mi[y]. Also block equations (this case is from #text(blue.lighten(20%), link("https://katex.org/")[katex.org])): #mitex(` \newcommand{\f}[2]{#1f(#2)} \f\relax{x} = \int_{-\infty}^\infty \f\hat\xi\,e^{2 \pi i \xi x} \,d\xi `) We also support text mode (in development): #mitext(` \iftypst #set math.equation(numbering: "(1)", supplement: "equation") \fi \section{Title} A \textbf{strong} text, a \emph{emph} text and inline equation $x + y$. Also block \eqref{eq:pythagoras}. \begin{equation} a^2 + b^2 = c^2 \label{eq:pythagoras} \end{equation} `)
https://github.com/ryuryu-ymj/mannot
https://raw.githubusercontent.com/ryuryu-ymj/mannot/main/examples/usage4.typ
typst
MIT License
#import "/src/lib.typ": * #set page(width: auto, height: auto, margin: (x: 4cm, y: 1cm), fill: white) #set text(24pt) #show: mannot-init $ mark(integral x dif x, tag: #<i>, color: #green) + mark(3, tag: #<3>, color: #red) mark(x, tag: #<x>, color: #blue) #annot(<i>, pos: left)[Set pos to left.] #annot(<i>, pos: top + left)[Top left.] #annot(<3>, pos: top, yshift: 1.2em)[Use yshift.] #annot(<x>, pos: right, yshift: 1.2em)[Auto arrow.] $
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/include-03.typ
typst
Other
// Error: 18 expected semicolon or line break #include "hi.typ" Hi
https://github.com/TimPaasche/Typst.Template.SimpleDocument
https://raw.githubusercontent.com/TimPaasche/Typst.Template.SimpleDocument/master/template/style.typ
typst
MIT License
// +-------------------------------------------+ // | STYLE OF THE HEADER | // +-------------------------------------------+ #let setHeader(title: [], subtitle: [], authors: ()) = { set text(font: "Cascadia Mono", size: 10pt, weight: "bold", fill: rgb("#288733")) locate(loc => if calc.odd(loc.page()) { grid( columns: (25%,50%,25%), gutter: 0%, [ #set align(left); ], [ #set align(center); #title; #linebreak(); #subtitle ], [ #set align(right); #image("./../images/logos/HKA_EIT_Logo.jpg", height: 1cm) ]) } else { grid( columns: (25%,50%,25%), gutter: 0%, [ #set align(left); #image("./../images/logos/HKA_EIT_Logo.jpg", height: 1cm) ], [ #set align(center); #title; #linebreak(); #subtitle ], [ #set align(right); ]) } ) } // +-------------------------------------------+ // | STYLE OF THE FOOTER | // +-------------------------------------------+ #let setFooterRoman(title: [], subtitle: [], authors: ()) = { set text(font: "Cascadia Mono", size: 10pt) locate(loc => if calc.odd(loc.page()) { grid( columns: (20%,60%,20%), gutter: 0%, [ #set align(left); ], [ #set align(center); #for author in authors { author.name if(authors.last() != author){ " - " } } ], [ #set align(right); #counter(page).display("I") ]) } else { grid( columns: (20%,60%,20%), gutter: 0%, [ #set align(left); #counter(page).display("I") ], [ #set align(center); #for author in authors { author.name if(authors.last() != author){ " - " } } ], [ #set align(right); ]) } ) } #let setFooter(title: [], subtitle: [], authors: ()) = { set text(font: "Cascadia Mono", size: 10pt) locate(loc => if calc.odd(loc.page()) { grid( columns: (20%,60%,20%), gutter: 0%, [ #set align(left); ], [ #set align(center); #for author in authors { author.name if(authors.last() != author){ " - " } } ], [ #set align(right); #counter(page).display("1") ]) } else { grid( columns: (20%,60%,20%), gutter: 0%, [ #set align(left); #counter(page).display("1") ], [ #set align(center); #for author in authors { author.name if(authors.last() != author){ " - " } } ], [ #set align(right); ]) } ) } // +-------------------------------------------+ // | SETTINGS OF THE DOCUMENT | // +-------------------------------------------+ #let loadStyle(doc, title, subtitle, authors) = { set text( font: "Roboto", size: 12pt, lang: "de", ) set heading(numbering: "1.1.1.") show heading.where(level: 1): it => block(width: 100%)[ #set text(18pt, weight: 1200, font: "Cascadia Mono") #smallcaps(it) #v(4mm) ] show heading.where(level: 2): it => block(width: 100%)[ #set text(16pt, weight: 1000, font: "Cascadia Mono") #smallcaps(it) #v(2mm) ] show heading.where(level: 3): it => block(width: 100%)[ #set text(14pt, weight: 800, font: "Cascadia Mono") #smallcaps(it) #v(2mm) ] set page( paper: "a4", margin: ( top: 3cm, bottom: 2cm, //left: 1.5cm, //right: 1.5cm ) ) set par( justify: true, leading: 0.52em, ) set page( header: setHeader(title: title, subtitle: subtitle, authors: authors), footer: setFooter(title: title, subtitle: subtitle, authors: authors) ) counter(page).update(1) doc } // +-------------------------------------------+ // | STYLE OF THE TITLEPAGE | // +-------------------------------------------+ #let setPage( headerLine1: [], headerLine2: [], authors: (), doc, ) = { set page( header: setHeader( title: headerLine1, subtitle: headerLine2, authors: authors ), footer: setFooterRoman( title: headerLine1, subtitle: headerLine2, authors: authors ) ) loadStyle(doc, headerLine1, headerLine2, authors) }
https://github.com/Error-418-SWE/Documenti
https://raw.githubusercontent.com/Error-418-SWE/Documenti/src/2%20-%20RTB/Documentazione%20interna/Analisi%20dei%20Rischi/Analisi%20dei%20Rischi.typ
typst
#import "/template.typ": * #show: project.with( title: "Analisi dei Rischi", subTitle: "", authors: ( "<NAME>", "<NAME>", "<NAME>", ), showLog: true, showImagesIndex: false, showTablesIndex: false, ); = Profili di rischio A ciascun rischio individuato si associano: - informazioni descrittive sul suo contesto; - impatto: può essere lieve, medio o grave. Esprime l'ordine di grandezza dell'effetto generato dall'evento; - probabilità: da 1 a 5. Esprime la probabilità di verificarsi del rischio; - soglie di accettazione del rischio; - azioni previste in funzione delle soglie, possono includere: - l'eliminazione del rischio; - la riduzione della sua probabilità o gravità; - l'accettazione del rischio. - conseguenze relative a ciascuna delle azioni possibili, esse descrivono gli effetti collaterali a breve o medio termine che il rischio può comportare. = Rischi == Comunicazione con il Proponente I contatti con il Proponente subiscono variazioni nella qualità e nella frequenza a causa di problematiche fuori dal controllo del gruppo. Questa situazione potrebbe causare un rallentamento significativo del lavoro, soprattutto durante l'analisi dei requisiti. - Impatto: grave; - Probabilità: 1; - Soglie: - se il periodo critico previsto è sufficientemente breve da permettere al gruppo di continuare con un corretto avanzamento dei lavori nonostante la variazione nella comunicazione con il Proponente, si adotta l'"Accettazione del rischio" mantenendo monitorata la situazione; - se il periodo critico previsto può mettere a rischio il corretto avanzamento dei lavori o la qualità degli stessi, si adotta l'azione correttiva di rischio: "Riduzione della sua probabilità o gravità". === Opzioni di trattamento del rischio ==== Riduzione della sua probabilità o gravità *Strategia di trattamento* \ Si possono adottare, in accordo con il Proponente, una o più tra le seguenti strategie comunicative: - uso di strumenti asincroni per facilitare lo scambio di informazioni tra gruppo e Proponente; - pianificazione anticipata degli incontri di revisione dell'avanzamento; - programmazione di incontri periodici di aggiornamento, anche brevi. \ *Conseguenze* \ È prevista una modifica sostanziale, più o meno temporanea, nella comunicazione con il Proponente. Questo potrebbe portare a ritardi nei lavori dovuti ad un maggior impegno da parte del gruppo nel garantire l'adozione delle nuove pratiche. ==== Accettazione del rischio *Strategia di trattamento* \ Si attende il termine del periodo nel quale la comunicazione con il Proponente risulta problematica. Per evitare perdite di tempo il gruppo continua a lavorare priorizzando task che non dipendono direttamente dall'intervento del Proponente. In caso di Accettazione del rischio è importante tenere monitorata nel tempo la situazione per accertarsi che le circostanze non richiedano una modifica nell'approccio di risoluzione. \ *Conseguenze* \ Lo sviluppo potrebbe allontanarsi dalle linee guida o dalle aspettative del Proponente, non rispettando quanto preventivato o pianificato. Tale rischio, comporterebbe dunque la produzione di un software non in linea con le richieste, conducendo a rallentamenti per analisi, progettazione e implementazione aggiuntive. == "Effetto sottomarino" Uno o più membri cessano temporaneamente la partecipazione attiva alle attività del gruppo. È necessario evitare che la durata di queste assenze impedisca il regolare svolgimento delle attività di progetto. È da considerare ulteriormente grave la situazione in cui è mancata totalmente una segnalazione responsabile e preventiva di difficoltà o impedimenti da parte dei singoli membri coinvolti. - Impatto: medio; - Probabilità: 3; - Soglie: - se la cessazione della partecipazione da parte di uno o più membri del gruppo può causare un rallentamento nell'avanzamento dei lavori è necessario discutere con i diretti interessati al fine di inquadrare al meglio la situazione. Nel caso in cui tale dialogo rivelasse un'impossibilità nella ripresa delle attività in breve termine oppure nel caso in cui non sia possibile contattare i diretti interessati, è necessario attuare la "Riduzione della sua probabilità o gravità"; - in caso contrario, se contattando i membri coinvolti emerge la previsione certa di una corretta ripresa delle attività in breve tempo, si attua l'"Accettazione del rischio". === Opzioni di trattamento del rischio ==== Riduzione della sua probabilità o gravità *Strategia di trattamento* \ Le attività di lavoro assegnate ai membri coinvolti che non hanno una corretta conclusione nei tempi e nelle modalità previste possono essere riassegnate ad altri membri del gruppo. Viene sollecitato il dialogo con i membri coinvolti per capire la situazione e programmare al meglio le attività da svolgere. \ *Conseguenze* \ Vengono ridotti, seppur non eliminati, i ritardi nell'avanzamento dei lavori. Le task svolte senza una chiara condivisione di informazioni da parte dei membri coinvolti possono portare a risultati non conformi con le decisioni prese dal gruppo di lavoro quindi possono risultare in parte o totalmente inutilizzabili. ==== Accettazione del rischio *Strategia di trattamento* \ Si attende il termine del periodo nel quale la partecipazione dei membri interessati risulti insufficiente. In caso di Accettazione del rischio è importante tenere monitorata nel tempo la situazione per accertarsi che le circostanze non richiedano una modifica nell'approccio di risoluzione. \ *Conseguenze* \ I membri che si dovessero trovare in questa situazione rischierebbero di accentuare eventuali incomprensioni nel proprio lavoro senza la possibilità di confrontarsi con gli altri accorgendosi degli errori troppo tardi. Lo stato di avanzamento dei lavori potrebbe subire ulteriori rallentamenti. == Rallentamento delle attività dovuto a cause esterne Rallentamento nel completamento di attività e task assegnate derivato dalla congiunzione tra gli impegni individuali e progettuali. Esso comporta un generale ritardo nello sviluppo. - Impatto: grave; - Probabilità: 4 _Probabilità aumentata nel periodo della sessione invernale_; - Soglie: se i rallentamenti previsti possono ridurre l'efficienza lavorativa del gruppo, si attua il trattamento "Riduzione della sua probabilità o gravità". === Opzioni di trattamento del rischio ==== Riduzione della sua probabilità o gravità *Strategia di trattamento* \ Implementazione di una pianificazione più flessibile decisa in sede di meeting, per adattarsi agli impegni individuali e progettuali. Questo prevede una priorizzazione nell'uso di strumenti di lavoro asincroni, al fine di permettere a tutti i membri un'equa divisione del lavoro da svolgere nei momenti a loro più comodi, a patto di rispettare le linee guida delle Norme di Progetto. Assegnazione chiara delle responsabilità in luce dei rallentamenti previsti e monitoraggio costante dello stato di avanzamento. Inoltre è richiesta comunicazione costante con i membri del gruppo al fine di rendere note eventuali indisponibilità o impegni. \ *Conseguenze* \ Miglioramento dell'efficienza nel completamento dei compiti nonostante i rallentamenti inevitabili. Le attività non svolte o completate parzialmente possono determinare uno slittamento della data di consegna e delle scadenze intermedie prefissate. == Utilizzo problematico delle tecnologie Le tecnologie individuate o suggerite durante i processi di analisi e progettazione potrebbero risultare complesse da comprendere e/o integrare. - Impatto: medio; - Probabilità: 4; - Soglie: - se, compreso un ragionevole rallentamento dovuto all'apprendimento di nuove competenze, la complessità delle tecnologie risulta gestibile con le competenze attuali del gruppo e non compromette significativamente la tempistica del progetto, si adotta l'"Accettazione del rischio"; - se la complessità delle tecnologie supera significativamente le competenze attuali del gruppo e potrebbe quindi causare gravi ritardi nell'avanzamento dei lavori, si adotta l'azione correttiva di rischio: "Riduzione della sua probabilità o gravità". === Opzioni di trattamento del rischio ==== Riduzione della sua probabilità o gravità *Strategia di trattamento* \ Viene considerata in sede di meeting la necessità di individuare tecnologie sostitutive che rimpiazzeranno quelle coinvolte, esse dovranno essere studiate ed implementate al fine di soddisfare i requisiti rimasti irrisolti a causa dell'occorrenza del rischio. Se si ritiene necessario, si richiede una maggiore partecipazione da parte degli altri membri del gruppo, con conseguente riassegnazione di attività e/o ruoli, per integrare le nuove tecnologie nel minor tempo possibile. \ *Conseguenze* \ Le analisi tecnologiche precedentemente svolte devono essere riviste in luce delle nuove opzioni individuate. Queste ultime possono essere a loro volta totalmente o parzialmente sconosciute al gruppo, il quale dovrà dedicare tempo, non preventivato precedentemente, alla loro comprensione ed integrazione. Le nuove tecnologie individuate possono potenzialmente generare nuovamente questo rischio portando ad un rallentamento grave nell'avanzamento dei lavori. ==== Accettazione del rischio *Strategia di trattamento* \ Il gruppo accetta la complessità delle tecnologie e si impegna a risolvere eventuali problemi nell'implementazione e utilizzo delle stesse. Se si ritiene necessario, si richiede una maggiore partecipazione da parte degli altri membri del gruppo, con conseguente riassegnazione di attività e/o ruoli, alla risoluzione degli eventuali problemi riscontrati. In caso di Accettazione del rischio è importante tenere monitorata nel tempo la situazione per accertarsi che le circostanze non richiedano una modifica nell'approccio di risoluzione. \ *Conseguenze* \ Rallentamenti non preventivati che possono avere conseguenze a cascata sulle attività dipendenti e che possono coinvolgere più membri del gruppo per un periodo di tempo difficilmente prevedibile.
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/text/quote_03.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Inline citation #set text(8pt) #quote(attribution: <tolkien54>)[In a hole in the ground there lived a hobbit.] #set text(0pt) #bibliography("/assets/files/works.bib")
https://github.com/goshakowska/Typstdiff
https://raw.githubusercontent.com/goshakowska/Typstdiff/main/tests/test_working_types/quoted/quoted.typ
typst
#quote[I know that I know nothing.] #quote[Only the dead have seen the end of war.]
https://github.com/Shedward/dnd-charbook
https://raw.githubusercontent.com/Shedward/dnd-charbook/main/dnd/game/biography.typ
typst
#import "../core/core.typ": * #let biographySection(title, body) = [ #framed(fitting: expand-h, insets: paddings(2))[ #align(left)[ #abilityHeader(title)\ #body ] ] ] #let biographySubsection(title, body) = [ #abilitySubsection(title) #par(first-line-indent: 0.5em, justify: true)[ #body ] ]
https://github.com/LDemetrios/Typst4k
https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/scripting/return.typ
typst
// Test return out of functions. --- return-with-value --- // Test return with value. #let f(x) = { return x + 1 } #test(f(1), 2) --- return-join --- // Test return with joining. #let f(x) = { "a" if x == 0 { return "b" } else if x == 1 { "c" } else { "d" return "e" } } #test(f(0), "b") #test(f(1), "ac") #test(f(2), "ad") --- return-in-nested-content-block --- // Test return with joining and content. #let f(text, caption: none) = { text if caption == none [\.#return] [, ] emph(caption) [\.] } #f(caption: [with caption])[My figure] #f[My other figure] --- return-outside-of-function --- // Test return outside of function. #for x in range(5) { // Error: 3-9 cannot return outside of function return } --- return-in-first-arg --- // Test that the expression is evaluated to the end. #let sum(..args) = { let s = 0 for v in args.pos() { s += v } s } #let f() = { sum(..return, 1, 2, 3) "nope" } #test(f(), 6) --- return-in-content-block --- // Test value return from content. #let x = 3 #let f() = [ Hello 😀 #return "nope" World ] #test(f(), "nope") --- return-semicolon-or-linebreak --- // Test rejection of extra value #let f() = [ // Error: 16-16 expected semicolon or line break #return a + b Hello World ]
https://github.com/GES233/interview-trancript-template
https://raw.githubusercontent.com/GES233/interview-trancript-template/main/interview_template.typ
typst
/**/ #let format_datetime(timestamp: datetime, has_time: false) = { let date_segment = [#timestamp.year() 年 #timestamp.month() 月 #timestamp.day() 日] if has_time { return [#date_segment #timestamp.hour() : #timestamp.minute() : #timestamp.second()] } else { return date_segment } } // TODO: implement. #let set_comment(comments: (:)) = { let render(content) = text(size: 8pt) rect(radius: 6pt, fill: gray, for comment in comments { if type(comment) == content {} if type(comment) == array {} } ) } #let content_opt(header, ..content_and_comment) = { // Oprate comment. let content = content_and_comment.pos().first() let comments = content_and_comment.pos().slice(1) // Body part. if comments.len() > 1 { box( grid(columns: (2fr, 9fr, 3fr))[#header][#par(first-line-indent: 2em, content)][#set_comment(comments)] ) } else { box( grid(columns: (1fr, 6fr))[#header][#par(first-line-indent: 2em, content)] ) } } #let record(color: none, sign: none, name, ..content_and_comment) = { // Header part. let header = "" let header_common_args = arguments(font: "SimHei", weight: 500, name) if color == none { header = text(..header_common_args) } else { header = text(..header_common_args, fill: color) } // if use sign, replace name. if sign != none { let color_in_sign = if color != none {color} else {"black"} header = text(color: color_in_sign, sign) } content_opt(header, ..content_and_comment) } #let follow(..content_and_comments) = content_opt([], ..content_and_comments) /** * Present interview. */ #let interview( title: none, subtitle: none, interviewer: none, interviewee: none, interview_time: datetime.today(), interview_method: none, theme: none, archive_name: none, transcript: none, brief_intro: none, meta_extra: (:), context_extra: (:), body ) = { set page( paper: "a4", margin: 1.15in, numbering: "1" ) // Title let gen_title(title, subtitle) = { if title == none { return [] } else { if subtitle == none { return text(17pt, font: "SimHei")[*#title*] } else { return [ #text(17pt, font: "SimHei")[*#title*] \ #text(15pt, subtitle)] } } } align(center, gen_title(title, subtitle)) // insert a blank line if title is not none. if gen_title(title, subtitle) != [] { [\ ] } // Meta let fields = ( interviewer: "采访者", interviewee: "受访者", theme: "采访主题", method: "采访方式", interview_time: "访谈时间", archive_name: "存档名", transcript: "转录者", ) let special_fields = (fields.archive_name, fields.interview_time) // let name_fields = (fields.interviewer, fields.interviewee, fields.transcript) let gen_mata(items) = { [ #set par(leading: 8pt) #set block(spacing: 8pt) #for (key, value) in items { if key in special_fields and value != none { if key == fields.interview_time { // 时间修正为特定的格式 grid( columns: (1fr, 4fr), [#fields.interview_time:], format_datetime(timestamp: value) ) } if key == fields.archive_name { // 存档名选择等线字体 grid( columns: (1fr, 4fr), [#fields.archive_name:], text(font: "Consolas", weight: 400, value) ) } } else { if value != none {grid(columns: (1fr, 4fr), [#key:], value)} // if none => do nothing. } } ] } align(center, [ // Meta section. #set block(width: 80%) #set text(font: "SimSun") #block(width: 80%, align(left, gen_mata(( fields.interviewer: interviewer, fields.interviewee: interviewee, fields.interview_time: interview_time, fields.theme: theme, fields.method: interview_method, fields.archive_name: archive_name, fields.transcript: transcript, ) + meta_extra))) \ // Blank line. ] ) // Brief intro and context align(center, [ #block( width: 92%, [ #if brief_intro != none { [#text(font: "SimHei", "受访者的小传", size: 11pt) #par(first-line-indent: 2em, align(left, brief_intro))] } #if context_extra.len() > 0 { for (title, body) in context_extra { [#text(font: "SimHei", title, size: 11pt) #par(first-line-indent: 2em, align(left, body))] } } ] ) ]) [\ #body] }
https://github.com/CarlosCraveiro/PDSA_Presentation
https://raw.githubusercontent.com/CarlosCraveiro/PDSA_Presentation/main/main.typ
typst
Other
#import "./poster.typ": * #show: poster.with( size: "36x24", title: "MIMD - Múltiplos Fluxos de Instruções, Múltiplos Fluxos de Dados", authors: "<NAME> - 12547187, <NAME> - 11798853", departments: "Engenharia de Computação", univ_logo: "./images/eesc_usp_logo.png", univ_logo_scale: 90, footer_text: "SEL0631 - Processadores Digitais de Sinais e Aplicações", footer_url: "Setembro - 2024", footer_url_email_font_size: 28, footer_email_ids: "<EMAIL>, <EMAIL>", footer_color: "23477C", footer_text_color: "FFFFFF", body_text_size: 18, keywords: ("MIMD", "Taxonomia de Flynn", "Arquitetura de Computadores", "Processadores Paralelos"), ) = Classificação Taxonômica de Flynn Em 1966, <NAME> em seu artigo "_Very high-speed computing systems_" propôs a primeira versão de um sistema de classificação de arquiteturas para computadores de "alta performance", motivado pela diversidade dos computadores de alta performance voltados para aplicações científicas na época. As quatro classificações iniciais definida por Flynn eram baseada na multiplicidade de recursos em hardware disponíveis para manipulação de fluxos de Dados e Instruções, sendo as quatro: - Único Fluxo de Instruções-Único Fluxo de Dados (SISD) - Único Fluxo de Instruções-Único Fluxo de Dados (SIMD) - Múltiplos Fluxos de Instruções-Único Fluxo de Dados (MISD) - Múltiplos Fluxos de Instruções-Múltiplos Fluxos de Dados (MIMD) O sistema de classificação pode ser melhor entendido por meio da Figura 1. #figure( image("./images/flynns_taxonomy.png", width: 100%), caption: [Diagrama esquemático das diferentes classes propostas por Flynn] ) Ressalta-se que o sistema proposto por Flynn, apesar da idade, ainda é utilizado como ferramenta para design de processadores modernos. Sua última alteração foi em 1972, no artigo "_Some Computer Organizations and Their Effectiveness_" onde Flynn propôs três sub-classificações para a Arquitetura SIMD: Processamento Matricial (SIMT), Processamento com Pipeline (_packed SIMD_), Processamento Associativo (_predicated/masked SIMD_). = Múltiplos Fluxos de Instruções, Múltiplos Fluxos de Dados (MIMD) A classe MIMD de arquitetura paralela é a forma mais familiar e possivelmente a mais básica de processador paralelo: consiste em múltiplas unidades de processamento (núcleos), cada um com sua unidade lógico aritimética (ULA), conjunto de registradores (REG) e unidade de controle (UC), interconectadas, como pode ser visto na Figura 2. Ao contrário dos processadores SIMD, cada CPU executa de forma completamente independente (embora, tipicamente, o mesmo programa seja executado). Embora não haja um requisito para que todas os núcleos sejam idênticas, a maioria das configurações MIMD são homogêneas, com todas os núcleos sendo idênticas. Quando a comunicação entre os núcleos é realizada por meio de um espaço de endereçamento de memória compartilhada (seja global ou distribuída entre os núcleos, chamada de memória compartilhada distribuída para diferenciá-la da memória distribuída), dois problemas significativos surgem. O primeiro é manter a consistência da memória—os efeitos de ordenação visíveis ao programador das referências de memória, tanto dentro de um núcleo quanto entre diferentes núcleos. O segundo é manter a coerência de cache—o mecanismo invisível ao programador para garantir que todas os núcleos vejam o mesmo valor para uma determinada posição de memória. O problema da consistência de memória é geralmente resolvido através de uma combinação de técnicas de hardware e software. O problema da coerência de cache é geralmente resolvido exclusivamente por meio de técnicas em hardware, como a implementação de algum protocolo de coerência de cache, como o protocolo MESI, por meio de estratégias como _Snooping_ de Barramento ou Sistema de Diretório. #figure( image("./images/mimd.svg", width: 90%), caption: [Diagrama esquemático da arquitetura MIMD - Autoral] ) = Usos e aplicações de máquinas MIMD #block( fill: luma(230), inset: 8pt, radius: 4pt, [ - Exemplos de uso: simulações científicas, inteligência artificial, computação distribuída. - Tendências futuras: maior uso em processamento paralelo e sistemas distribuídos. ] ) = Referências - <NAME>, "Very high-speed computing systems" in Proceedings of the IEEE, vol. 54, no. 12, pp. 1901-1909, Dec. 1966, doi: 10.1109/PROC.1966.5273. - <NAME>, "Some Computer Organizations and Their Effectiveness" in IEEE Transactions on Computers, vol. C-21, no. 9, pp. 948-960, Sept. 1972, doi: 10.1109/TC.1972.5009071. - <NAME>, <NAME>, "Parallel architectures" in ACM Computing Surveys, vol. 28, pp. 67-70, 1996, doi: 10.1145/234313.234345
https://github.com/MattiaOldani/Teoria-dei-Linguaggi
https://raw.githubusercontent.com/MattiaOldani/Teoria-dei-Linguaggi/master/appunti.typ
typst
// Setup #import "template.typ": project #show: project.with( title: "Teoria dei linguaggi" ) #import "@preview/lemmify:0.1.5": * #let ( theorem, lemma, corollary, remark, proposition, example, proof, rules: thm-rules ) = default-theorems("thm-group", lang: "it") #show: thm-rules #show thm-selector("thm-group", subgroup: "proof"): it => block( it, stroke: green + 1pt, inset: 1em, breakable: true ) #pagebreak() // Appunti /* INIZIO LEZIONE 01 */ = Introduzione == Storia Un *linguaggio* è _uno strumento di comunicazione usato da membri di una stessa comunità_, ed è composto da due elementi: - *sintassi*: insieme di simboli (o _parole_) che devono essere combinati con una serie di regole; - *semantica*: associazione frase-significato. Per i linguaggi naturali è difficile dare delle regole sintattiche: vista questa difficoltà, nel 1956 *<NAME>* introduce il concetto di *grammatiche formali*, che si servono di regole matematiche per la definizione della sintassi di un linguaggio. Il primo utilizzo dei linguaggi risale agli stessi anni con il *compilatore Fortran*, ovvero un traduttore da un linguaggio di alto livello ad uno di basso livello, ovvero il _linguaggio macchina_. == Ripasso Un *alfabeto* è un insieme _non vuoto_ e _finito_ di simboli, di solito indicato con $Sigma$ o $Gamma$. Una *stringa* (o *parola*) è una sequenza _finita_ di simboli appartenenti a $Sigma$. Data una parola $w$, possiamo definire: - $|w|$ _numero di caratteri_ di $w$; - $|w|_a$ _numero di occorrenze_ della lettera $a in Sigma$ in $w$. Una parola molto importante è la *parola vuota* $epsilon$, che, come dice il nome, ha simboli, ovvero $|epsilon| = 0$. L'insieme di tutte le possibili parole su $Sigma$ è detto $Sigma^*$. Un'importante operazione sulle parole è la *concatenazione* (o _prodotto_), ovvero se $x,y in Sigma^*$ allora la concatenazione $w$ è la parola $w = x y$. Questo operatore di concatenazione: - _non è commutativo_, infatti $w_1 = x y eq.not y z = w_2$ in generale; - _è associativo_, infatti $(x y) z = x (y z)$. La struttura $(Sigma^*, dot, epsilon)$ è un *monoide* libero generato da $Sigma$. Vediamo ora alcune proprietà delle parole: - *prefisso*: $x$ si dice _prefisso_ di $w$ se esiste $y in Sigma^*$ tale che $x y = w$; - *prefisso proprio* se $y eq.not epsilon$; - *prefisso non banale* se $x eq.not epsilon$; - il numero di prefissi è uguale a $|w|+1$. - *suffisso*: $y$ si dice _suffisso_ di $w$ se esiste $x in Sigma^*$ tale che $x y = w$; - *suffisso proprio* se $x eq.not epsilon$; - *suffisso non banale* se $y eq.not epsilon$; - il numero di suffissi è uguale a $|w|+1$. - *fattore*: $y$ si dice _fattore_ di $w$ se esistono $x,z in Sigma^*$ tali che $x y z = w$; - il numero di fattori è al massimo $frac(|w| dot |w+1|, 2) + 1$. - *sottosequenza*: $x$ si dice _sottosequenza_ di $w$ se $x$ è ottenuta eliminando $0$ o più caratteri da $w$; - un _fattore_ è una sottosequenza ordinata. Un *linguaggio* $L$ definito su un alfabeto $Sigma$ è un qualunque sottoinsieme di $Sigma^*$. #pagebreak() = Gerarchia di Chomsky == Rappresentazione Vogliamo rappresentare in maniera finita un oggetto infinito come un linguaggio. Abbiamo a nostra disposizione due modelli molto potenti: - *generativo*: date delle regole, si parte da _un certo punto_ e si generano tutte le parole di quel linguaggio con le regole date; parleremo di questi modelli tramite le _grammatiche_; - *riconoscitivo*: si usano dei _modelli di calcolo_ che prendono in input una parola e dicono se appartiene o meno al linguaggio. Considerando il linguaggio sull'alfabeto ${(,)}$ delle parole ben bilanciate, proviamo a dare due modelli: - _generativo_: a partire da una sorgente $S$ devo applicare delle regole per derivate tutte le parole appartenenti a questo linguaggio; - la parola vuota $epsilon$ è ben bilanciata; - se $x$ è ben bilanciata, allora anche $(x)$ è ben bilanciata; - se $x,y$ sono ben bilanciate, allora anche $x y$ sono ben bilanciate. - _riconoscitivo_: abbiamo una _black-box_ che prende una parola e ci dice se appartiene o meno al linguaggio (in realtà potrebbe non terminare mai la sua esecuzione); - $\#\( space = space \#\)$; - per ogni prefisso, $\#\( space gt.eq space \#\)$. /* FINE LEZIONE 01 */ /* INIZIO LEZIONE 02 */ == Grammatiche Una *grammatica* è una tupla $(V, Sigma, P, S)$, con: - $V$ _insieme finito e non vuoto_ delle *variabili*; queste ultime sono anche dette _simboli non terminali_ e sono usate durante il processo di generazione delle parole del linguaggio; - $Sigma$ _insieme finito e non vuoto_ dei *simboli terminali*; questi ultimi appaiono nelle parole generate, a differenza delle variabili che invece non possono essere presenti; - $P$ _insieme finito_ delle *regole di produzione*; - $S in V$ *simbolo iniziale* o *assioma*, è il punto di partenza della generazione. === Regole di produzione Soffermiamoci sulle regole di produzione: la forma di queste ultime è $alpha arrow.long beta$, con $alpha in (V union Sigma)^+$ e $beta in (V union Sigma)^*$. Una regola di produzione viene letta come "$italic("se ho ") alpha italic("allora posso sostituirlo con ") beta$". L'applicazione delle regole di produzione è alla base del *processo di derivazione*: esso è formato infatti da una serie di *passi di derivazione*, che permettono di generare una parola del linguaggio. Diciamo che $x$ deriva $y$ in un passo, con $x,y in (V union Sigma)^*$, se e solo se $exists (alpha arrow.long beta) in P$ e $exists eta, delta in (V union Sigma)^*$ tali che $x = eta alpha delta$ e $y = eta beta delta$. Il passo di derivazione lo indichiamo con $x arrow.stroked y$. La versione estesa afferma che $x$ deriva $y$ in $k gt.eq 0$ passi, e lo indichiamo con $x arrow.stroked^k y$, se e solo se $exists x_0, dots, x_k in (V union Sigma)^*$ tali che $x = x_0$, $x_k = y$ e $x_(i-1) arrow.stroked x_i space.quarter forall i in [1,k]$. Se non ho indicazioni sul numero di passi $k$ posso scrivere: - $x arrow.stroked^* y$ per indicare un numero generico di passi, e questo vale se e solo se $exists k gt.eq 0$ tale che $x arrow.stroked^k y$; - $x arrow.stroked^+ y$ per indicare che serve almeno un passo, e questo vale se e solo se $exists k gt 0$ tale che $x arrow.stroked^k y$. === Linguaggio generato da una grammatica Indichiamo con $L(G)$ il linguaggio generato dalla grammatica $G$, ed è l'insieme ${w in Sigma^* bar.v S arrow.stroked^* w}$. Due grammatiche $G_1, G_2$ sono *equivalenti* se e solo se $L(G_1) = L(G_2)$. Se consideriamo l'esempio delle parentesi ben bilanciate, possiamo definire una grammatica per questo linguaggio con le seguenti regole di produzione: - $S arrow.long epsilon$; - $S arrow.long (S)$; - $S arrow.long S S$. Vediamo un esempio più complesso. Siano: - $Sigma = {a,b,c}$; - $V = {S, B}$; - $P = {S arrow.long a B S c bar.v a b c, B a arrow.long a B, B b arrow.long b b}$. Questa grammatica genera il linguaggio $L(G) = {a^n b^n c^n bar.v n gt.eq 1}$: infatti, il "caso base" genera la stringa _abc_, mentre le iterazioni "maggiori" generano il numero di _a_ e _c_ corretti, con i primi che vengono ordinati prima di inserire anche il numero corretto di _b_. == Gerarchia Negli anni 50 <NAME> studia la generazione dei linguaggi formali e crea una *gerarchia di grammatiche formali*. La classificazione delle grammatiche viene fatta in base alle regole di produzione che definiscono la grammatica. #align(center)[ #table( columns: (31%, 37%, 32%), inset: 10pt, align: horizon, [*Grammatica*], [*Regole*], [*Modello riconoscitivo*], [_Tipo 0_.], [Nessuna restrizione, sono il tipo più generale.], [_Macchine di Turing_.], [_Tipo 1_, dette *context-sensitive* o _dipendenti dal contesto_.], [Se $(alpha arrow.long beta) in P$ allora $|beta| gt.eq |alpha|$, ovvero devo generare parole che non siano più corte di quella di partenza. \ \ Sono dette _dipendenti dal contesto_ perché ogni regola $(alpha arrow.long beta) in P$ può essere riscritta come $alpha_1 A alpha_2 arrow.long alpha_1 B alpha_2$, $space.thin$ con $alpha_1, alpha_2 in (V union Sigma)^*$ che rappresentano il _contesto_, $A in V$ e $B in (V union Sigma)^+$.], [_Automi limitati linearmente_.], [_Tipo 2_, dette *context-free* o _libere dal contesto_.], [Le regole in $P$ sono del tipo $alpha arrow.long beta$, con $alpha in V$ e $beta in (V union Sigma)^+$.], [_Automi a pila_.], [_Tipo 3_, dette *grammatiche regolari*], [Le regole in $P$ sono del tipo $A arrow.long a B$ oppure $A arrow.long a$, con $A,B in V$ e $a in Sigma$. \ Vale anche il simmetrico.], [_Automi a stati finiti_.], ) ] Nella figura successiva vediamo una rappresentazione grafica della gerarchia di Chomsky: notiamo come sia una gerarchia propria, ovvero $ L_3 subset L_2 subset L_1 subset L_0, $ ma questa gerarchia non esaurisce comunque tutti i linguaggi possibili. Esistono infatti linguaggi che non sono descrivibili in maniera finita con le grammatiche. #v(12pt) #figure( image("assets-teoria/gerarchia.svg", width: 50%) ) #v(12pt) Sia $L subset.eq Sigma^*$, allora $L$ è di tipo $i$, con $i in [0,3]$, se e solo se esiste una grammatica $G$ di tipo $i$ tale che $L = L(G)$, ovvero posso generare $L$ a partire dalla grammatica di tipo $i$. == Potenza computazionale Se una grammatica é di tipo 1 allora possiamo costruire una macchina che sia in grado di dire, in tempo finito, se una parola appartiene o meno al linguaggio generato da quella grammatica. #theorem()[ Una grammatica di tipo 1 è *decidibile*. ]<thm> #proof[ \ Siano $G$ una grammatica di tipo 1 e $w in Sigma^*$, ci chiediamo se $w in L(G)$. \ Sia $h = |w|$, ma allora essendo $G$ di tipo 1 ogni forma sentenziale che compare in $P$ non deve superare la lunghezza $h$, altrimenti potremmo ridurre il numero di caratteri presenti nella forma sentenziale e andare contro la definizione di grammatica di tipo 1. \ \ Sia $T_i = {gamma in (V union Sigma)^(lt.eq n) bar.v S arrow.stroked^(lt.eq i) gamma}$ l'insieme di tutte le parole generate dalla grammatica $G$ che hanno al massimo $n$ caratteri e sono generate in massimo $i$ passi di derivazione. \ Data questa definizione di $T_i$ possiamo affermare che: - $T_0 = {S}$; - $T_i = T_(i-1) union {gamma in (V union Sigma)^(lt.eq n) bar.v exists beta in T_(i-1) text(" tale che ") beta arrow.stroked gamma}.$ Per come sono costruiti gli insiemi $T_i$ possiamo affermare che $ T_0 subset.eq T_1 subset.eq dots subset.eq (V union Sigma)^(lt.eq n), $ ma quest'ultimo insieme è un insieme _finito_. \ Prima o poi non si potranno più generare delle stringhe, ovvero $exists k$ tale che $T_(k-1) = T_k$. \ Una volta individuato questo valore $k$ basta controllare se $w in T_k$. ]<proof> Questo non vale invece per le grammatiche di tipo 0: infatti, queste sono dette *semidecidibili*, in quanto un sistema riconoscitivo potrebbe non terminare mai l'algoritmo di riconoscimento e finire quindi in un loop infinito. #theorem()[ Una grammatica di tipo 0 è *semidecidibile*. ] #proof[ \ Siano $G$ una grammatica di tipo 0 e $w in Sigma^*$, ci chiediamo se $w in L(G)$. \ Non essendo $G$ di tipo 1 non abbiamo il vincolo $|beta| gt.eq |alpha|$ nelle regole di produzione. \ \ Sia $U_i = {gamma in (V union Sigma)^* bar.v S arrow.stroked^(lt.eq i) gamma}$ l'insieme di tutte le parole generate dalla grammatica $G$ in massimo $i$ passi di derivazione. \ Data questa definizione di $U_i$ possiamo affermare che: - $U_0 = {S}$; - $U_i = U_(i-1) union {gamma in (V union Sigma)^* bar.v exists beta in U_(i-1) text(" tale che ") beta arrow.stroked gamma}$. Per come sono costruiti gli insiemi $U_i$ possiamo affermare che $ U_0 subset.eq U_1 subset.eq dots subset.eq (V union Sigma)^*, $ ma quest'ultimo insieme è un insieme _infinito_. \ Vista questa caratteristica, nessuno garantisce l'esistenza di un $k$ tale che $U_(k-1) = U_k$ e quindi non si ha la certezza di terminare l'algoritmo di riconoscimento. ]<proof> Le grammatiche di tipo 0 generano i *linguaggi ricorsivamente enumerabili*: per stabilire se $w in L(G)$ devo _elencare_ con un programma tutte le stringhe del linguaggio e controllare se $w$ compare in esse. Questa operazione di elencazione in poche parole è la generazione degli insiemi $U_i$, che poi vengono ispezionati per vedere se la parole $w$ è presente o meno. /* FINE LEZIONE 02 */ /* INIZIO LEZIONE 03 */ == Estensione con la parola vuota La parola vuota é molto "noiosa" perché la sua presenza in una regola di derivazione del tipo $alpha arrow.long epsilon$ esclude la grammatica dai tipi superiori allo 0. Inserire la parola vuota nel linguaggio generato da una grammatica non é un'operazione critica: infatti, essa non modifica la cardinalità del linguaggio. Voglio quindi costruire l'insieme $L' = L(G) union {epsilon}$. Per far ciò dobbiamo aggiungere la regola di produzione $S arrow.long epsilon$, ma dobbiamo garantire di più: infatti, se in $P$ é presente anche una regola del tipo $A arrow.long alpha_1 S alpha_2$ riesco a generare più parole di quelle che riesco effettivamente a generare senza la parola vuota. In poche parole, _la variabile che genera la parola vuota non deve essere presente nella parte destra delle regole di produzione_. La nuova grammatica $G' = (V', Sigma, P', S')$ é formata da: - $V'$ insieme delle variabili, definito come $S union {S'}$; - $Sigma$ insieme dei simboli terminali; - $P'$ insieme delle regole di produzione; - $S' in V'$ assioma. Vengono aggiunte due regole di produzione: - $S' arrow.long epsilon$ per generare la parola vuota; - $S' arrow.long S$ per collegare il comportamento di $G'$ a $G$. Con queste due nuove regole riesco a generare il linguaggio $L(G)$, grazie alla regola $S' arrow.long S$, unito alla parola vuota, grazie alla regola $S' arrow.long epsilon$. Questo tipo di costruzione vale per tutte le grammatiche di tipo 1. Per le grammatiche di tipo 2 é più facile: basta rilassare il vincolo $beta in (V union Sigma)^+$ in $beta in (V union Sigma)^*$. Infine, per le grammatiche di tipo 3 basta aggiungere la regola di produzione $A arrow.long epsilon$. Le regole di produzione nella forma $alpha arrow.long epsilon$ sono dette *$epsilon$-produzioni*. #pagebreak() = Linguaggi di tipo 3 == Automi a stati finiti (deterministici) Gli *automi a stati finiti* sono un modello riconoscitivo usato per caratterizzare i _linguaggi regolari_. === Definizione informale Gli automi a stati finiti sono delle macchine molto semplici: hanno un *controllo a stati finiti* che legge l'input da un *nastro* _read-only_, formato da una serie di celle, ognuna delle quali contiene un carattere dell'input. Per leggere l'input si utilizza una *testina di lettura*, posizionata inizialmente sulla cella più a sinistra (ovvero sul primo carattere di input), e poi spostata iterazione dopo iterazione da sinistra verso destra. Gli automi che studieremo per ora sono *one-way*, ovvero la lettura avviene _solo_ da sinistra verso destra. Il controllo a stati finiti, prima della lettura dell'input, è allo *stato iniziale*. Ad ogni iterazione, a partire dallo stato corrente e dal carattere letto dal nastro, ci si muove con la testina a destra sul simbolo successivo e si cambia stato. Quando si arriva alla fine del nastro, in base allo stato corrente dell'automa, quest'ultimo risponde _"si"_, ovvero la parola in input appartiene al linguaggio, oppure _"no"_, ovvero la parola in input non appartiene al linguaggio. #v(12pt) #figure( image("assets-teoria/automa_macchina.svg", width: 50%) ) #v(12pt) === Definizione formale Un automa è una tupla ${Q, Sigma, delta, q_0, F}$, con: - $Q$ insieme _finito e non vuoto_ degli stati; - $Sigma$ insieme _finito e non vuoto_ dell'alfabeto di input; - $delta: Q times Sigma arrow.long Q$ funzione di transizione, il programma della macchina; - $q_0 in Q$ stato iniziale; - $F subset.eq Q$ insieme _finito e non vuoto_ degli stati finali. La parte dinamica dell'automa è la *funzione di transizione* che, dati lo stato iniziale e un simbolo del linguaggio, calcola lo stato successivo. Possiamo estendere la funzione di transizione affinché utilizzi una parola del linguaggio. Per induzione sulla lunghezza delle parole definiamo $delta^*: Q times Sigma^* arrow.long Q$ la funzione tale che: - $delta^*(q, epsilon) = q quad forall q in Q$; - $delta^*(q, x a) = delta(delta^*(q,x), a) quad forall q in Q, x in Sigma^*, a in Sigma$. Per semplicità useremo $delta$ al posto di $delta^*$ perché sui singoli caratteri $delta$ e $delta^*$ hanno lo stesso comportamento. === Linguaggio Chiamiamo $L(A) = {w in Sigma^* bar.v delta(q_0, w) in F}$ il *linguaggio riconosciuto dall'automa*, ovvero l'insieme delle parole che applicate alla funzione di transizione, a partire dallo stato iniziale, mi mandano in uno stato finale. === Rappresentazione grafica Possiamo vedere un automa come un grafo, dove: - i vertici sono gli *stati*; - gli archi sono le *transizioni*; gli archi sono orientati ed etichettati con la lettera dell'alfabeto che causa quella transizione. Lo *stato iniziale* è indicato con una freccia entrante nello stato, mentre gli *stati finali* sono nodi doppiamente cerchiati. #v(12pt) #figure( image("assets-teoria/automa_grafo.svg", width: 50%) ) #v(12pt) == Automi a stati finiti non deterministici === Definizione informale Gli *automi a stati finiti non deterministici* (_NFA_) sono automi che hanno _almeno_ uno stato dal quale escono $2$ o più archi con la stessa lettera. Negli automi *deterministici* (_DFA_), invece, da _ogni_ stato esce al più un arco con la stessa lettera. La differenza principale sta nella complessità computazionale: se negli automi deterministici devo controllare se la parola ci porta in uno stato finale, negli automi non deterministici devo controllare se tra _tutti_ i possibili cammini dell'*albero di computazione* ne esiste uno che ci porta in uno stato finale. Possiamo vedere il non determinismo come _una scommessa che va sempre a buon fine_. === Definizione formale Un automa non deterministico differisce da un automa deterministico solo per la funzione di transizione: infatti, quest'ultima diventa $delta: Q times Sigma arrow.long 2^Q$. Il valore ritornato é un elemento dell'*insieme delle parti* di $Q$, cioè un sottoinsieme di stati nei quali possiamo finire applicando un carattere di $Sigma$ allo stato corrente. Come prima, definiamo l'estensione della funzione di transizione per induzione sulla lunghezza delle parole come la funzione $overline(delta): Q times Sigma^* arrow.long 2^Q$ tale che: - $delta^*(q, epsilon) = {q}$; - $delta^*(q, x a) = limits(union.big)_(p in delta^*(q,x)) delta(p,a)$. Il linguaggio riconosciuto dall'automa diventa $L(A) = {w in Sigma^* bar.v overline(delta)(q_0, w) sect.big F eq.not emptyset.rev}$. === Albero di computazione L'*albero di computazione* é una rappresentazione grafica di tutti i cammini percorsi dall'automa non deterministico quando deve dire se una parola appartiene o meno al linguaggio. Il singolo cammino é detto *computazione*. Prendiamo l'automa nella pagina precedente e aggiungiamo un cappio in $q_1$ causato dalla lettura del carattere $b$. Ci chiediamo se la parola $w = a b a b b$ viene riconosciuta o meno dall'automa. #v(12pt) #figure( image("assets-teoria/albero-computazione.svg", width: 80%) ) #v(12pt) Nella parte superiore vediamo i passi intermedi della _funzione di transizione_: all'inizio é un insieme che contiene solo lo stato iniziale, poi mano a mano l'insieme viene modificato con gli insiemi nei quali si é "allo stesso momento". Nella parte inferiore vediamo invece l'_albero di computazione_. /* FINE LEZIONE 03 */ /* INIZIO LEZIONE 04 */ == Numero di stati La domanda sorge spontanea: _quale é il minimo numero di stati necessari affinché un DFA per un dato linguaggio L riconosca una parola?_ === Distinguibilità Dato un linguaggio $L subset.eq Sigma^*$, due parole $x,y in Sigma^*$ sono *distinguibili* rispetto ad $L$ se $exists z in Sigma^*$ tale che $(x z in L and y z in.not L) or (x z in.not L and y z in L)$. #theorem()[ Siano $L subset.eq Sigma^*$ un linguaggio e $X subset.eq Sigma^*$ tale che ogni coppia di parole in $X$ é distinguibile rispetto ad $L$, allora ogni DFA per $L$ deve avere almeno $|X|$ stati. ]<thm> #proof[ \ Supponiamo che l'insieme $X$ sia $X = {x_1, dots, x_k}$ di cardinalità $k$. Definiamo l'automa $A = (Q, Sigma, delta, q_0, F)$ tale che $delta(q_0, x_i) = p_i quad forall i in [1,k].$ #figure( image("assets-teoria/dfa-inizio.svg", width: 40%) ) Per assurdo sia $|Q| < k$, ma allora $exists i,j in [1,k]$ tali che $i eq.not j$ e $delta(q_0, x_i) = p_i = p_j = delta(q_0, x_j)$. Questo vale perché avendo meno stati del numero di elementi da "mappare" almeno due elementi finiscono nello stesso stato. Ma $x_i$ e $x_j$ sono due parole distinguibili: allora $exists z in Sigma^*$ tale che $x_i z in L and x_j z in.not L$ (o viceversa). #figure( image("assets-teoria/dfa-assurdo.svg", width: 50%) ) Ma questo é assurdo: infatti, $x_i$ e $x_j$ sono due parole distinguibili che però finiscono in uno stato che deve essere sia finale che non finale. Allora $|Q| gt.eq k$. ]<proof> La costruzione dell'insieme $X$ é molto utile per dimostrare che alcuni linguaggi non possono essere di tipo 3: infatti, se si riesce a costruire un insieme $X$ tale che $|X| = +infinity$ allora si dimostra che un dato linguaggio non é riconoscibile da un DFA. Vediamo un esempio: sia $L_n = {x in {a,b}^* bar.v "il simbolo di" x "in posizione " n "da destra é una " a}$. Il più semplice DFA utilizza $2^n$ stati, ovvero tutte le possibili finestre di lunghezza $n$, mentre il più semplice NFA utilizza $n+1$ stati. Come costruiamo un insieme $X$ la cui cardinalità ci faccia da lower-bound? Sia $X = {a,b}^n = {w in {a,b}^+ bar.v |w| = n}$ e siano $x,y in X$ tali che $x eq.not y$, ma allora $exists i in [1,n]$ tale che $x_i eq.not y_i$, ovvero $ x = x_1 dots & x_i dots x_n \ & eq.not \ y = y_1 dots & y_i dots y_n. $ Per semplicità sia $x_i = a$ e $y_i = b$. Aggiungiamo ora $i-1$ caratteri in coda alle parole, che per semplicità saranno delle $a$. $ x = x_1 dots & a dots x_n a^(i-1) \ y = y_1 dots & b dots y_n a^(i-1). $ I caratteri dopo la posizione $i$ diventano $(n-i) + (i-1) = n-1$, spostando i caratteri $x_i$ e $y_i$ nella posizione $n$-esima da destra, ma per come li avevamo definiti essi sono diversi, quindi le due parole sono distinguibili. === Da DFA a NFA L'*automa di <NAME>* é un NFA molto importante ideato nel 1971 per dare un lower-bound al numero di stati necessari per rappresentare un DFA a partire da un NFA di $n$ stati. #v(12pt) #figure( image("assets-teoria/meyer-fischer.svg", width: 60%) ) #v(12pt) L'automa viene chiamato $M_n$ ed é formato da: - $Q = {0, dots, n-1}$; - $Sigma = {a,b}$; - $q_0 = 0$; - $F = {0}$. La funzione di transizione é definita come $ delta(i,a) &= {i+1} \ delta(i,b) &= cases(emptyset.rev & "se" i eq.not 0, {i,0} quad & "se" 1 lt.eq i lt n) quad . $ Prima della dimostrazione effettiva vediamo un paio di proprietà molto importanti di questo automa. Sia $S subset.eq {0, dots, n-1}$, definiamo la parola $ w_s = cases(b & "se" S = emptyset.rev, a^i & "se" S = {i}, a^(e_k - e_(k-1)) b a^(e_(k-1) - e_(k-2)) b dots b a^(e_2 - e_1) b a^(e_1) quad & "se" S = {e_k, dots, e_1} "insieme ordinato e" k gt.eq 2) quad . $ #proposition[ $forall S subset.eq {0, dots, n-1} quad delta(0, w_s) = S$. ] #proposition[ Dati $S,T subset.eq {0, dots, n-1}$, se $S eq.not T$ allora $w_s$ e $w_t$ sono distinguibili. ] #proof[ \ Sia $x in S \\ T$ numero intero che appartiene a $S$ ma non a $T$. \ Sappiamo che $delta(0, w_s) = S$ per la proprietà precedente e che $x in S$, ma allora $ 0 arrow.long.squiggly^(w_s) x arrow.long.squiggly^(a^(n-x)) 0. $ Sappiamo inoltre che $delta(0, w_t) = T$ per la proprietà precedente e che $x in.not T$. Sia $y in T$, ma allora $ 0 arrow.long.squiggly^(w_t) y arrow.long.squiggly^(a^(n-x)) U. $ L'insieme $U$ non contiene $0$ perché l'unico modo per finire in $0$ é aggiungere un numero di $a$ uguale a $n-y$, ma sappiamo che $n-x eq.not n-y$ per come sono stati definiti $x$ e $y$. \ Ma allora la stringa $a^(n-x)$ distingue $w_s$ e $w_t$. ]<proof> Ora possiamo dimostrare il seguente teorema. #theorem()[ Sia $A$ un NFA per $L$ di $n$ stati, allora $A'$ DFA per $L$ ha almeno $2^n$ stati. ]<thm> #proof[ \ Sia $S subset.eq {0, dots, n-1}$, l'insieme degli stati di $A$. Definisco l'insieme $ X = {w_s bar.v S subset.eq {0, dots, n-1}}. $ Questo insieme ha cardinalità $2^n$: infatti, é formato da tutte le stringhe $w_s$ generate da $S$ sottoinsieme di ${0, dots, n-1}$ di $n$ elementi, ma tutti i possibili sottoinsiemi di un insieme di $n$ elementi sono $2^n$. \ Per la seconda proprietà le stringhe $w_s in X$ sono tutte distinguibili, ma allora per il teorema precedente $A'$ deve avere almeno $2^n$ stati. ]<proof> == Estensioni === $epsilon$-mosse Le *$epsilon$-mosse* sono una possibile estensione degli automi a stati finiti che permettono transizioni sulla parola vuota, ovvero permettono di spostarsi da uno stato all'altro senza leggere un carattere dal nastro. Sono utili nei compilatori quando é possibile definire gli interi positivi senza il segno _più_. #v(12pt) #figure( image("assets-teoria/segno.svg", width: 50%) ) #v(12pt) Questa estensione non aumenta però la potenza espressiva dell'automa: infatti, ogni sequenza del tipo $ p arrow.long.squiggly^epsilon p' arrow.long^a q' arrow.long.squiggly^epsilon q $ può essere tradotta nella transizione $p arrow.long^a q$. === Stati iniziali multipli L'ultima estensione che vediamo é quella degli *stati iniziali multipli*: al posto di avere un singolo stato iniziale abbiamo un insieme di stati dai quali poter iniziare. Anche questa estensione non aumenta la potenza espressiva dell'automa: infatti, la funzione di transizione partirà direttamente con un insieme di stati e non da un insieme con un solo stato. /* FINE LEZIONE 04 */ /* INIZIO LEZIONE 05 */ == Equivalenza tra linguaggi di tipo 3 e automi a stati finiti Dimostriamo che dato l'automa $A$ per $L$ possiamo costruire una costruire una grammatica $G$ di tipo $3$ tale che $L(A) = L(G)$. #theorem()[ Le grammatiche di tipo $3$ sono equivalenti agli automi a stati finiti. ]<thm> #proof[ \ [$A arrow.long.double G$] Dato $A = (Q, Sigma, delta, q_0, F)$ DFA per $L$ costruisco la grammatica $G = (V, Sigma, P, S)$ tale che: - $V = Q$; - $Sigma$ rimane uguale; - $S = q_0$. Le regole di produzione in $P$ sono nella forma: - $A arrow.long a B$ se $delta(A,a) = B$, con $A,B in Q$ e $a in Sigma$; - $A arrow.long a$ se $A in F$, con $A in Q$ e $a in Sigma$. Si può dimostrare che $ q_0 arrow.stroked x A arrow.long.double.l.r delta(q_0, x) = A. $ [$G arrow.long.double A$] Data $G = (V, Sigma, P, S)$ grammatica di tipo $3$ costruisco un DFA $A = (Q, Sigma, delta, q_0, F)$ tale che: - $Q = V union {q_f}$; - $Sigma$ rimane uguale; - $q_0 = S$; - $F = {q_f}$. La funzione di transizione $delta$ é definita nel seguente modo: - se $A arrow.long a B$ allora $B in delta(A, a)$; - se $A arrow.long a$ allora $q_f in delta(A, a)$. ]<proof> == Esempi Vediamo qualche esempio notevole. === $L_n$ Sia $L_n = {x in {a,b}^+ bar.v x "contiene due simboli uguali a distanza" n}$. Con $n = 3$, la stringa $a b a b b a$ appartiene a $L_n$. Costruiamo un NFA per questo linguaggio con $n = 3$. #v(12pt) #figure( image("assets-teoria/ln.svg", width: 60%) ) #v(12pt) Questo NFA ha $2n+2$ stati, un DFA quanti stati avrebbe? Cerchiamo di costruire un insieme $X$ di stringhe distinguibili per dare un lower bound al numero di stati. Sia $X = {a,b}^n$ e siano $x,y in X$ tali che $x eq.not y$, ma allora $exists i in [1,n]$ tale che $x_i eq.not y_i$ rappresenta la prima cifra diversa delle due parole: $ x = x_1 dots & x_i dots x_n \ & eq.not \ y = y_1 dots & y_i dots y_n. $ Le prime $i-1$ cifre sono tutte uguali, allora se prendo la stringa $z = overline(x_1) dots overline(x_(i-1)) a$ ogni stringa in $X$ diventa distinguibile: infatti, prendendo il complemento di ogni cifra evitiamo che le prime $i-1$ cifre _"matchino"_ quelle inserite. Inserendo una $a$ in fondo a $z$ andiamo ad accettare solo $x$ o solo $y$, in base a quale parole ha la cifra $i$-esima uguale ad $a$. La cardinalità di questo insieme é $2^n$, quindi ogni DFA per $L$ ha almeno $2^n$ stati. === $L_n '$ Sia $L_n ' = {x in {a,b}^+ bar.v "ogni coppia di simboli a distanza" n "contiene due simboli uguali"}$. Notiamo subito come valga la relazione $L_n ' subset L_n$. Con $n = 3$, la stringa $a b b a b b a$ appartiene a $L_n '$. In poche parole, $x in L$ se e solo se $exists w in {a,b}^n$, $exists y$ prefisso di $w$ e $exists k gt.eq 0$ tali che $x = w^k y$. Costruiamo un DFA per questo linguaggio con $n = 2$, visto che con $n=3$ il numero di stati esplode, ma di questo ne parleremo dopo. #v(12pt) #figure( image("assets-teoria/ln-primo.svg", width: 60%) ) #v(12pt) Il numero di stati di questo DFA é $2^(n+1)-1 + 2^(n+1)$. Riusciamo a fare meglio con un NFA? La risposta é no: gli NFA _"lavorano male"_ quando si parla di _"ogni"_, mentre _"lavorano bene"_ quando si parla di _"esiste"_. Questo perché se si parla di _"esiste"_ dobbiamo fare una singola scommessa, mentre se si parla di _"ogni"_ dobbiamo fare molte più scommesse. == Fooling set Cerchiamo di fare, come per i DFA con l'insieme $X$ di stringhe distinguibili, un lower bound al numero di stati di un NFA. === Definizione Diamo la definizione di *fooling set*, o _insieme di ingannatori/imbroglioni_. Sia $L subset.eq Sigma^*$, l'insieme di coppie $P subset.eq Sigma^* times Sigma^* = {(x_i, y_i) bar.v x_i,y_i in Sigma^* and i in [1,n]}$ é un fooling set per $L$ se e solo se: + $x_i y_i in L quad forall i in [1,n]$; + $x_i y_j in.not L quad forall i.j in [1,n] and i eq.not j$. Esiste una versione rilassata del fooling set, detta *extended fooling set*, che mantiene la proprietà $1$ ma sostituisce la proprietà $2$ con: 2. $x_i y_j in.not L or x_j y_i in.not L quad forall i.j in [1,n] and i eq.not j$. In questo caso, prese due coppie, basta che _almeno un incrocio_ non appartenga a $L$, mentre nel primo caso _entrambi gli incroci_ non appartengono a $L$. #theorem()[ Siano $L subset.eq Sigma^*$ e $P$ extended fooling set per $L$, allora ogni NFA per $L$ ha almeno $|P|$ stati. ]<thm> #proof[ \ Sia $A = (Q, Sigma, delta, q_0, F)$ NFA per $L$, consideriamo le parole $x_i y_i$ formate dalla concatenazione dei valori contenuti nelle coppie di $P$ e consideriamo i cammini accettanti di queste parole. #v(12pt) #figure( image("assets-teoria/fooling-inizio.svg", width: 50%) ) #v(12pt) Per assurdo sia $|Q| < n$, ma allora $exists i,j in [1,n]$ tali che $p_i = p_j$. #v(12pt) #figure( image("assets-teoria/fooling-assurdo.svg", width: 50%) ) #v(12pt) Ma questo é assurdo: infatti, a partire dallo stesso stato $p_i = p_j$ finiamo in due stati entrambi finali, ma essendo $P$ un extended fooling set per la proprietà $2$ almeno una tra le parole $x_i y_j$ e $x_j y_i$ non deve essere accettata. Allora abbiamo dimostrato che $|Q| gt.eq n$. ]<proof> === Applicazione a $L_n '$ Cerchiamo di definire un extended fooling set per l'insieme $L_n '$. Definiamo l'insieme $P = {(x,x) bar.v x in {a,b}^n}$. Questo é un extended fooling set per $L_n '$ perché: + $x x in L_n '$; + $x y in.not L_n ' or y x in.not L_n '$. La seconda proprietà vale perché essendo $x eq.not y$ esiste almeno una coppia di caratteri a distanza $n$ che non é uguale. Ma allora ogni NFA per $L_n '$ ha almeno $|P| = 2^n$ stati. === Applicazione a $L_k$ L'ultimo esempio al quale applichiamo il concetto di extended fooling set é il linguaggio $ L_k = {0^i 1^i 2^i bar.v 0 lt.eq i lt.eq k}. $ Vediamo il caso $k = 3$ e creiamo un NFA per questo linguaggio. #v(12pt) #figure( image("assets-teoria/lk.svg", width: 100%) ) #v(12pt) Diamo un lower bound al numero di stati di un NFA generico. Definiamo l'insieme $ P = {(0^i 1^(j), 1^(i-j) 2^i) bar.v 0 lt.eq i lt.eq k and 0 lt.eq j lt.eq i}. $ Questo é un extended fooling set per $L_k$, quindi ogni NFA per $L_k$ ha almeno $|P| = (k+1)^2$ stati. /* FINE LEZIONE 05 */ /* INIZIO LEZIONE 06 */ == Espressioni regolari === Operazioni insiemistiche Sia $L subset.eq Sigma^*$ un linguaggio. Essendo un insieme, possiamo utilizzare le classiche operazioni di: - intersezione $sect.big$; - unione $union.big$; - complemento $()^C$. Altre operazioni importanti sono: - *prodotto/concatenazione* di linguaggi: dati $L_1,L_2 subset.eq Sigma^*$ costruisco l'insieme $ L_1 dot.op L_2 = {z bar.v exists x in L_1 and exists y in L_2 bar.v z = x y}. $ Questa operazione _non_ é commutativa ma é associativa. - *potenza* di un linguaggio: dato $L subset.eq Sigma^*$ costruisco l'insieme $ L_k = underbracket(L dot.op dots dot.op L, k). $ Notiamo, usando l'induzione, come $ L^k = cases({epsilon} & "se" k = 0, L dot.op L^(k-1) quad & "altrimenti") quad . $ === Chiusura di Kleene La *chiusura di Kleene*, o _star_, é definita come $ L^* = union.big_(k gt.eq 0) L^k. $ In poche parole, la chiusura di Kleene rappresenta l'insieme di tutte le stringhe ottenute concatenando le parole di $L$, compresa la parola vuota $epsilon$. L'insieme $L^*$ é sempre infinito, tranne quando: - $L = {epsilon}$, ottenendo $L^* = {epsilon}$; - $L = emptyset.rev$, ottenendo $L^* = {epsilon}$ per definizione. La *chiusura positiva* $L^+$ é definita come $ L^+ = union.big_(k gt.eq 1) L^k. $ Se $epsilon in L$ la differenza tra chiusura e chiusura positiva non esiste, mentre se $epsilon in.not L$ si ottene $L^+ = L^* - {epsilon}$. Si può dimostrare che $ L^+ = L dot.op L^* = L dot.op union.big_(k gt.eq 0) L^k = union.big_(k gt.eq 0) L^(k+1) = union.big_(k gt.eq 1) L^k. $ === Definizione di espressione regolare Le *espressioni regolari* sono un _modello dichiarativo_ per le grammatiche di tipo $3$, ovvero permettono di dichiarare la forma delle stringhe del linguaggio tramite una serie di operazioni. Introduciamo una serie di coppie, dove il primo elemento rappresenta un'espressione nel mondo delle espressioni regolari e il secondo elemento rappresenta il linguaggio generato da quell'espressione: - $emptyset.rev arrow.long$ linguaggio vuoto; - $epsilon arrow.long {epsilon}$; - $a in Sigma arrow.long {a}$; - $E_1 + E_2 arrow.long L(E_1) union L(E_2)$; - $E_1 dot.op E_2 arrow.long L(E_1) dot.op L(E_2)$; - $E_1^* arrow.long [L(E_1)]^*$. === Teorema di Kleene Vediamo il *teorema fondamentale degli automi a stati finiti* (o _teorema di Kleene_), che afferma la coincidenza tra la classe degli automi a stati finiti con la classe delle espressioni regolari. #theorem()[ La classe di linguaggi accettati da automi a stati finiti é il più piccolo sottoinsieme di $Sigma^*$ che contiene i linguaggi finiti ed é chiusa rispetto alle operazioni di $union, dot.op$ e $*$. ]<thm> #proof[ \ Dimostriamo che a partire da un automa a stati finiti per $L$ possiamo trovare un'espressione regolare per lo stesso linguaggio $L$. Sia $A = (Q, Sigma, delta, q_1, F)$, con $Q = {q_1, dots, q_n}$. Accetto una parola se e solo se esiste un cammino nel grafo di computazione che finisce in uno stato finale. Chiamo $R_(i j)^((k))$ le espressioni che iniziano nello stato $q_i$, finiscono nello stato $q_j$ e visitano stati con indice $lt.eq k$: $ q_i arrow.long.squiggly q_(h lt.eq k) arrow.long.squiggly q_j. $ Definiamo $R_(i j)^((0))$ l'insieme di tutte le lettere che mi portano da $q_i$ a $q_j$, quindi $ R_(i j)^((0)) = {a in Sigma bar.v delta(q_i, a) = q_j}. $ Se $i = j$ allora $ R_(i j)^((0)) = {epsilon} union {a in Sigma bar.v delta(q_i, a) = q_i}. $ Definiamo ora $R_(i j)^((k))$ sapendo tutte le espressioni fino a $R_(i j)^((k-1))$ Evidenzio tutti i punti del cammino che passano per lo stato $q_k$: $ q_i arrow.long.squiggly_(lt.eq k-1) q_k arrow.long.squiggly_(lt.eq k-1) dots arrow.long.squiggly_(lt.eq k-1) q_k arrow.long.squiggly_(lt.eq k-1) q_j. $ Ma allora $ R_(i j)^((k)) = R_(i j)^((k-1)) union (R_(i k)^((k-1)) dot.op R_(k k)^((k-1)) dot.op R_(k j)^((k-1))). $ Il linguaggio $L$ viene definito come $ L = union.big_(q_i in F) "cammini dallo stato" 1 "allo stato" q_i = union.big_(q_i in F) R_(1 i)^((n)). $ ]<proof> === Come costruire un'espressione regolare Vediamo _come costruire un'espressione regolare a partire da un automa a stati finiti_ con un esempio. #v(12pt) #figure( image("assets-teoria/regex.svg", width: 50%) ) #v(12pt) Per scrivere un'espressione regolare dobbiamo scrivere un sistema di $n$ equazioni, dove $n = |Q|$. Ogni equazione $E_i$ descrive il linguaggio che l'automa riconoscerebbe se si partisse dallo stato $X_i$. Ogni equazione é una somma di fattori, ognuno formato da un simbolo di $Sigma$ e uno stato in $Q$. La presenza di un fattore del tipo $a X_j$ indica che dallo stato $X_i$ si finisce nello stato $X_j$ leggendo una $a$. Scriviamo il sistema di equazioni per il DFA disegnato sopra, ricordandoci di aggiungere $epsilon$ in caso l'equazione $E_i$ descriva uno stato finale. $ cases(X_0 = a X_1 + b X_0, X_1 = a X_2 + b X_0, X_2 = a X_2 + b X_1 + epsilon) quad . $ Risolviamo il sistema, introducendo una regola fondamentale: $ X = a X + B arrow.long X = a^* B. $ Questa ci permette di risolvere ogni sistema di equazioni che definisce un automa a stati finiti. $ cases(X_0 = a (a X_2 + b X_0) + b X_0, X_2 = a X_2 + b (a X_2 + b X_0) + epsilon) quad . $ Raccogliamo $X_2$ nella seconda equazione e applichiamo la regola fondamentale precedente. $ & cases(X_0 = a a X_2 + (a b + b) X_0, X_2 = (a + b a) X_2 + b b X_0 + epsilon) \ & cases(X_0 = a a X_2 + (a b + b) X_0, X_2 = (a + b a)^* (b b X_0 + epsilon)) quad . $ Sostituiamo $X_2$ dentro $X_0$ e applichiamo ancora la regola fondamentale dopo aver raccolto ogni fattore che contiene $X_0$ nell'equazione. $ X_0 &= a a (a + b a)^* (b b X_0 + epsilon) + (a b + b) X_0 \ X_0 &= a a (a + b a)^* b b X_0 + a a (a + b a)^* + (a b + b) X_0 \ X_0 &= (a a (a + b a)^* b b + a b + b) X_0 + a a (a + b a)^* \ X_0 &= (a a (a + b a)^* b b + a b + b)^* (a a (a + b a)^*). $ == Studio della complessità #let sc(linguaggio) = $op("sc")(linguaggio)$ #let nsc(linguaggio) = $op("nsc")(linguaggio)$ Sia $L subset.eq Sigma^*$, la *complessità di stati* di $L$ é il minimo numero di stati di un DFA che accetta $L$. La complessità di stati si indica con $sc(L)$. In modo analogo, si definisce $nsc(L)$ la *complessità di stati non deterministica* come il minimo numero di stati di un NFA che accetta $L$. Come sappiamo già, vale la relazione $ sc(L) lt.eq 2^nsc(L). $ In generale, ogni NFA ha almeno $n+1$ stati, dove $n$ é il numero di caratteri della stringa più corta del linguaggio. /* FINE LEZIONE 06 */
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/021_Battle%20for%20Zendikar.typ
typst
#import "@local/mtgset:0.1.0": conf #show: doc => conf("Battle for Zendikar", doc) #include "./021 - Battle for Zendikar/001_Slaughter at the Refuge.typ" #include "./021 - Battle for Zendikar/002_The Silent Cry.typ" #include "./021 - Battle for Zendikar/003_The Believers' Pilgrimage.typ" #include "./021 - Battle for Zendikar/004_The Survivors of Sky Rock.typ" #include "./021 - Battle for Zendikar/005_Memories of Blood.typ" #include "./021 - Battle for Zendikar/006_Nissa's Quest.typ" #include "./021 - Battle for Zendikar/007_Home Waters.typ" #include "./021 - Battle for Zendikar/008_Revelation at the Eye.typ" #include "./021 - Battle for Zendikar/009_Nissa's Resolve.typ" #include "./021 - Battle for Zendikar/010_Shaping an Army.typ" #include "./021 - Battle for Zendikar/011_Hedron Alignment.typ" #include "./021 - Battle for Zendikar/012_The Liberation of Sea Gate.typ" #include "./021 - Battle for Zendikar/013_At Any Cost.typ" #include "./021 - Battle for Zendikar/014_Promises to Keep.typ"
https://github.com/Kasci/LiturgicalBooks
https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CSL_old/oktoich/Hlas8/4_Stvrtok.typ
typst
#let V = ( "HV": ( ("","Hóspodi, ášče i na sudíšči","Hóspodi, tý Uťíšiteľa zarjámi apóstoly tvojá prosvitíl jesí, i svitíla položív ťích víri utverždénije, úmnym prosviščénijem rázuma tvojehó Vladýko: sehó rádi poklaňájemsja neizrečénnomu čelovikoľúbiju tvojemú."), ("","","Hóspodi, tý apóstol molítvami ohradíl jesí stádo tvojé sijé, ot vrahóv iskušénija nevrédno sochraňája: zané čéstnóju tó iskupíl jesí króviju ot rabóty čuždáho, jáko ščédr i čelovikoľúbec."), ("","","Javístesja kúpno vo osnovániji cerkóvňim, jáko čestnóje kámenije, zaréju svítloju vselénňij blistájušče Bohorazúmije izvístno, apóstoli božéstvenniji, Tróici predstojáteli, i molítvennicy o dušách nášich."), ("","","Hóspodi, tý čestnáho tvojehó svjatíteľa Nikolája v koncách proslávil jesí, dáv tomú čudés blahodáť: i pobórnika pokazál jesí súščym v bidách ľútych, i v skórbech i zlóbach pripádajuščym, i prosjáščym tohó prísno zastuplénija."), ("","","Hóspodi, tý svjatíteľa tvojehó božéstvennymi moľbámi umilosérdisja: i vsjákija bidý, i vsjákaho ozloblénija, i nachoždénija vrážija svobodí rabý tvojá, víroju poklaňájuščyjasja tvojéj deržávi nepobidímij."), ("","","Imúšče tebé ko Vladýci predstáteľa, i zastúpnika tépla Nikólaje, k tebí pritekájem víroju, i vzyvájem: ne otvratí nás bezďíľny ot pokróva tvojehó, no pokaží tvojé milosérdije prostérto na rabý tvojá."), ("Bohoródičen","","Vížď mojehó sokrušénnaho sérdca vozdychánije Bohonevísto, prijimí Ďívo Maríje čístaja, rúk mojích vozďijánije, jáko čelovikoľubíva, i ne otríni vseneporóčnaja: da pojú i veličáju ťá vozvelíčivšuju ród náš."), ), "S": ( ("","","Hóspodi, tebé usérdno na zemlí apóstoli vozľubívše, uméty vminíša vsjá, da tebé jedínaho priobrjáščut, i za ťá na rány ťilesá svojá predáša: sehó rádi proslávleni bývše, i móľatsja o dušách nášich."), ("","","Hóspodi, tý apóstolov pámjať na zemlí vozvelíčil jesí: vsí bo vkúpi sošédšesja v néj slavoslóvim ťá: jáko podajéši nám ťích rádi iscilénija, i vsemú míru umirénije molítvami ích, i véliju mílosť."), ("Múčeničen","","Ášče kája dobroďítel, i ášče kája pochvalá podobájet svjatým: mečém bo prekloníša výji, tebé rádi preklóňšaho nebesá i sošédša: prolijáša króvi svojá tebé rádi istoščívšaho sebé, i zrák rabá prijémša: smiríšasja dáže do smérti, niščeťí tvojéj podóbjaščesja: íchže molítvami, po mnóžestvu ščedrót tvojích, Bóže pomíluj nás."), ("Bohoródičen","","Áz, Ďívo svjatája Bohoródice, k pokróvu tvojemú pribiháju: vím, jáko obrjášču tobóju spasénije, móžeši bo čístaja, pomoščí mňí."), ), ) #let P = ( "1": ( ("","","Kolesnicehoníteľa faraóňa pohruzí, čudotvorjáj inohdá moiséjskij žézl, krestoobrázno porazív, i razďilív móre, Izráiľa že bihlecá, pišechódca spasé, písň Bóhovi vospivájušča."), ("","","Slóvo Bóžije rodilá jesí voploščénno, jéže préžde bezplótnoje, páče jestestvá, vseneporóčnaja Bohoródice Ďívo, Bohomúžno v míri požívšeje: ťímže ťá vsí slávim, súščeje po Bózi zastuplénije náše."), ("","","Ispeščréna razlíčijem šára Bohoblahodátnaja, Ótčeje Slóvo plóť bývšeje za milosérdije neizrečénnoje, páče umá i slóva blahoslovénnaja rodilá jesí, prebývši Ďíva neskvérnaja."), ("","","Ot kórene čístaja cárska prozjablá jesí, carjá Christá, Bóžije Slóvo, páče umá i smýsla, voploščénna rodilá jesí ot čístych krovéj tvojích, suhúba jestestvóm pokazújema, i jedínstvenna vo ipostási."), ("","","Íže Bohoródicu ťá propovídujet prečístaja, na vsjákija jéresi pobiždénije nósit: plóť úbo bývšaho neizmínno porodilá jesi Bohorodíteľnice, výšša vsjákija tvári, Slóvo Bóžije prisnosúščnoje."), ), "3": ( ("","","Utverždéj v načáľi nebesá rázumom, i zémľu na vodách osnovávyj, na kámeni mjá, Christé, zápovidej tvojích utverdí, jáko ňísť svját, páče tebé jedíne čelovikoľúbče."), ("","","Vo tvojú svjatúju utróbu Bóh vselísja, i voplotísja jákože vísť Bohomáti, i spasé nás živonósnymi strasťmí: ťím ťá spasénija dvér slávim."), ("","","Na zemlí voplóščsja i poživé s čelovíki, íže dúšu vsím čelovíkom vdochnúvyj, ot utróby tvojejá prošéd, bez símene prebožéstvennyj: ťímže ťá vírniji vsí písňmi čístaja, ublažájem."), ("","","Ot Otcá préžde vík roždéna vo utróbi tvojéj začénši Ďívo neiskusobráčno, i rodilá jesí nám vkúpi Bóha i čelovíka, vo obojú jestestvú soveršénna i nerazďíľna."), ("","","Žézl prozjábšij cvít netľínija Christá, i zlatúju kadíľnicu vsí ťá znájem čístaja, božéstvennoje suščestvó nosjáščuju na rukú úhľ, Ďívo Bohoblažénnaja."), ), "4": ( ("","","Tý mojá kríposť Hóspodi, tý mojá i síla, tý mój Bóh, tý mojé rádovanije, ne ostávľ ňídra Ótča, i nášu niščetú positív: ťím s prorókom Avvakúmom zovú ti: síľi tvojéj sláva čelovikoľúbče."), ("","","Kivót izdaléča proobrazí prijémšiji zakón Bohopísannyj, vo utróbi živonačáľnoje Slóvo, začátoje neskazánno preneporóčnaja, pitájuščeje bohátno dúš& pojúščich: síľi tvojéj sláva čelovikoľúbče."), ("","","Tý ístinnaja spasénija viná, Bohomáti, jedína bylá jesí, tvorcú i ziždíteľu, ot tvojích prečístych krovéj plóť vzaím dávši: jéjuže smértnyja sokrušíšasja dvéri, i žízň čelovíkom darovásja."), ("","","Da óbraz pohrebényj strasťmí vzýščeši bohátstvom bláhosti, v ďívyja vselílsja jesí utróbu, iz nejáže tý premúdrosť Bóžija chrám sozdál jesí: ímže požív s čelovíki ščédre, i spásl jesí míra koncý."), ("","","Po Bózi ťá predstáteľnicu sťažáchom, preneporóčnaja: tý bo Bóžija Máti bylá jesí tvorcá i ziždíteľa, i náš zrák prijémšaho, i síj spásša ot tlí i bíd, i slávoju božéstvennoju proslávľša."), ), "5": ( ("","","Vskúju mjá otrínul jesí ot licá tvojehó svíte nezachodímyj, i pokrýla mjá jésť čuždája ťmá okajánnaho? No obratí mja i k svítu zápovidej tvojích putí mojá naprávi, moľúsja."), ("","","Jáko Bóha začénšuju prečístaja, ziždíteľa, soďíteľa že i Hóspoda, ródove ťá vsích čelovík blažát, i bezplótnych úmniji činonačáľnicy, jáko Máter ťá Bóha slávjat."), ("","","Vójinstva výšnich síl prečístaja, blažát ťá: tobóju bo tókmo, íže na zemlí s nebésnymi sovokúpľšesja, pojém roždestvó tvojé."), ("","","Neskazánnym Ďívo óbrazom, Slóvo vselísja v ťá i čelovík býsť, íže préžde vík ot Otcá vozsijávyj, i čelovíki ot tlí izbavľája, k žízni netľínňij vozvoďá jedín blahosérdyj."), ("","","Ukrasílasja jesí, prečístaja Ďívo, ďívstva dobrótami, i pérvyja Jévy otpustíla jesí zloobráznoje, Christá róždši, odéždu bezsmértija dárujuščaho, tebé pojúščym."), ), "6": ( ("","","Očísti mjá Spáse, mnóha bo bezzakónija mojá, i iz hlubiný zól vozvedí, moľúsja: k tebí bo vozopích, i uslýši mjá, Bóže spasénija mojehó."), ("","","Íže vsederžávnoju síloju nosjáj vsjáčeskaja, v nemožénije plotskóje ot tebé oblečésja Ďívo vseneporóčnaja, vo blahoďijánije čelovíkov, jáko čelovikoľúbec."), ("","","Nájde na ťá vseďíteľnyj Dúch vseneporóčnaja, i Slóvo Bóžije v ťá vselísja, i plóť býsť neskazánno, prebýv neizmínen."), ("","","Prosvití dúšy pravoslávno pojúščich ťá: rečénija prorók tvojé provozvistíša prečístoje začátije, i páče slóva Bohonevístnaja roždestvó."), ("","","Selénije Bóžije, božéstvennoje voístinnu i prečéstnóje, pojém blahočéstno Maríju prečístuju: Bóha bo vmistí, vosprijémši nevmistímaho i nepostižímaho."), ), "S": ( ("","","Jáko vseneporóčnaja nevísto tvorcú, jáko neiskusomúžnaja Máti izbáviteľa, jáko prijátelišče súšči Uťíšiteľa vsepítaja: bezzakóniju mjá súšča skvérno žilíšče, i bisóm ihrálišče v rázume bývša, potščísja i sích zloďíjstvija mjá izbáviti, svítlo žilíšče dobroďíteľmi soďílavši, svitodáteľnaja i netľínnaja: razžení óblak strastéj, i výšňaho pričástija spodóbi, i svíta nevečérňaho molítvami tvojími."), ), "7": ( ("","","Bóžija snizchoždénija óhň ustyďísja v Vavilóňi inohdá: sehó rádi ótrocy v peščí rádovannoju nohóju, jáko vo cvítnici likújušče pojáchu: blahoslovén jesí Bóže otéc nášich."), ("","","Prečístaja Vladýčice, začénšaja izbáviteľa vsích, neskazánnaho i božéstvennaho spodóbi mjá izbavlénija, velehlásno vopijúščaho, i pojúšča: blahoslovén Bóh otéc nášich."), ("","","Nýňi vsjá ispólnišasja svíta božéstvennaho, tobóju prečístaja: tý bo dvér javílasja jesí, jéjuže mírovi Bóh besídova, prosviščája víroju zovúščyja: blahoslovén Bóh otéc nášich."), ("","","Sé nýňi ispólnisja Davída božéstvennaho božéstvennoje prorečénije: móľatsja voístinnu tvojemú licú Bohorodíteľnice čístaja, sťažávšiji bohátstvo blahodáti, nýňi blahoslovjášče Bóha otéc nášich."), ("","","Začalá jesí prečístaja nad vsími Bóha i Hóspoda, blahovolívšaho spastí čelovíčeskij ród ot smérti i tlí, jehóže dostójno pojúšče, zovém: blahoslovén Bóh otéc nášich."), ), "8": ( ("","","Pobidíteli mučíteľa i plámene, blahodátiju tvojéju bývše, zápovidem tvojím ziló priľižášče, ótrocy vopijáchu: blahoslovíte vsjá ďilá Hospódňa Hóspoda."), ("","","Blahoslovénnaja prečístaja, dušý mojejá jázvy, i hrichóvnyja strúpy očísti, Bóha róždšaja íže nad vsími, otrokovíce čístaja, ot ďivíčeskija neiskusobráčnyja utróby: jehóže ďíti blahoslovíte , i prevoznosíte vo víki."), ("","","Svíta nezachodímaho bylá jesí prijátelišče vsečístaja, ďívstva dobrótami sijájušči: i vsích ozaríla jesí, Bohoródicu ťá ístinnuju ispovídajuščich ot duší, i vopijúščich: ďíti blahoslovíte, svjaščénnicy vospójte, i prevoznosíte jehó vo víki."), ("","","Osvjáščšisja Dúchom svjatým, Bohoródice vseneporóčnaja, voístinnu prijála jesí vo utróbi beznačáľna Sýna i soprisnosúščna Otcú, v tebí čístaja voploščájema, vo blahoďijánije víroju vopijúščym: ďíti blahoslovíte, svjaščénnicy pójte, i prevoznosíte jehó vo víki."), ("","","Jáko Bóha róždši páče slóva i smýsla, sehó umolí prečístaja Bohomáti, býti blahouvítlivu nedostójnym nám vsím, vo strášnoje jehó i užásnoje prišéstvije, jehdá chóščet sudíti čelovíčeskomu jestestvú, nahím stojáščym vsím, i so stráchom sudímym."), ), "9": ( ("","","Užasésja o sém nébo, i zemlí udivíšasja koncý, jáko Bóh javísja čelovíkom plótski, i črévo tvojé býsť prostránňijšeje nebés. Ťím ťá Bohoródicu, ánhelov i čelovík činonačálija veličájut."), ("","","Otvérženych víčnaho prebyvánija, i pádšich okajánno v smérť, páki nás prizvalá jesí, prečístaja Máti bývši izbáviteľa, i k préžnemu teščí spodóbila jesí otéčestvu: ťím ťá Bohomáti, neprestánno veličájem."), ("","","Udób Bohoródice, podážď mí prejtí žitijá vólnu napástej, i nastojánija strastéj, jáko blahá ukroťášči, i nastavľájušči k dobroďíteli nebésnaho šéstvija: da jáko blahodáteľnicu neprestánno veličáju ťá."), ("","","Čístaja preslávnaja Máti Bóžija, pojúščyja ťá ľubóviju spasí ot napástej, molvú rišájušči mílostivno, jáko Bóha úbo róždši: vsjá, jelíko chóščeši tvoríti, tvoríši nevozbránno, i móžeši Ďívo. Ťímže ťá vsí veličájem."), ("","","Pobiždájuščuju jéresi júnošskija, čéstnúju cérkov pokaží, júže <NAME> tvój obrádovannaja, króviju čéstnóju svojéju jáko bláh sťažá, i spasé ot bíd i ot nasílija oderžáščaho nás, Vladýčice."), ), ) #let U = ( "S1": ( ("","","Jáko svitíla míra, i nastávniki nášeho spasénija, íže ot načála božéstvennyja vospojím učenikí Bóha nášeho, jáko svít súščym vo ťmí nám vozsijáša, i Sólnce slávy vsím skazáša. Ťímže i lésť ídoľskuju nizložíša, Tróicu propovídavše vo jedínom Božeství. Sehó rádi mólimsja vám apóstoli, Christá Bóha molíte, hrichóv ostavlénije darováti nám, i véliju mílosť."), ("","","Vo vsjá koncý izšédšeje premúdroje váše viščánije, jáko voístinnu míru prechváľniji Hospódni apóstoli, Bohorazúmije vsím jávi vozpropovída, i jazýčeskoje nevíďinije, vo uvíďinije prevedé. Otonúduže i ídoľskuju mhlú othnávše, svít rázuma súščym vo ťmí vozsijá. Sehó rádi mólimsja, molítesja Christú Bóhu, prehrišénij ostavlénije darováti, čtúščym ľubóviju svjatúju pámjať vášu."), ("Bohoródičen","","Vo iskušénija mnohopleténaja vpád, ot vráh vídimych i nevídimych, i búreju bezčíslennych mojích hrichóv oderžím jésm prečístaja: da jáko k téplomu zastupléniju, i pokróvu, i k pristánišču mojemú pritekáju tvojejá bláhosti. Ťímže prečístaja, iz tebé voplotívšahosja bez símene molí o vsích rabích tvojích, neprestánno pojúščich ťá, Bohoródice prečístaja, moľášči tohó priľížno, sohrišénij ostavlénije darováti poklaňájuščymsja víroju roždéstvú tvojemú."), ), "S2": ( ("","","Vo vsjú zémľu, jákože rečé prorók, izýde premúdrych apóstol viščánije: propovídavše bo slóvo, jazýki vsjá prosvitíša, ťímže ťích po dólhu voschvaľájušče písňmi počtím, jáko móľat vsehdá Christá, spastísja dušám nášym."), ("","","Hospódňa zaviščánija v duší, jáko sokróvišče bohatotvórnoje, víroju vosprijémše apóstoli, javíšasja vsím blahodátelije, niščetú othoňájušče bisóvskuju, i vsích obohaščájušče bohátstvom Bóžijim, k nímže vsí vozopiím: obohatíte i nás dobroďíteľnymi ďijániji nýňi obniščávšich, mólimsja."), ("Múčeničen","","Vozderžánijem strastéj ohnepáľnyja umertvívše zráki i dvizánija, Christóvu prijáša blahodáť múčenicy, nedúhi othoňáti boľáščym, i živúšče, i po končíňi čudesá tvoríti: voístinnu čúdo preslávno, jáko kósti náhi istočájut iscilénija. Sláva jedínomu premúdromu ziždíteľu Bóhu."), ("Bohoródičen","","Predstáteľnice vírnych Bohorodíteľnice, skorbjáščich rádoste, i pláčuščich velíkoje uťišénije, iz čréva tvojehó Ďívo vsesvjatáho, páče jestestvá róždšahosja neprestánno o nás so apóstoly svjatými molí, izbáviti nás v čás ispytánija, ľútaho osuždénija."), ), "S3": ( ("","Poveľínnoje tájno","Svitíla javístesja svítlaja, Christóvy samovídcy, vsehdá vsjú zémľu prosviščájušče, i ťmú othoňájušče mnohobóžija, svítom blahočéstija učéňmi: ťímže mjá súšča vo ťmí strastéj, bez strácha choďášča, prosvitíte vášimi svjatými molítvami, Bohonósniji apóstoli."), ("","","Mréžeju slovés božéstvennych, áki rýby živolovjášče slovésnyja, ťích privedóste, načátok Bóhu nášemu: i Christóvy rány vozľúbľše, v ních oblekóstesja, i podražátelije strástéj jehó javístesja. Ťímže sošédšesja po dólhu počitájem apóstoli slávniji, váše nýňi toržestvó, i sohlásno zovém: molítesja Christú Bóhu, prehrišénij ostavléniju darovátisja, čtúščym ľubóviju svjatúju pámjať vášu."), ("Bohoródičen","","Nepostižímaho Slóva Sýna Bóžija, neskazánno páče umá iz tebé róždšahosja Bohoródice, molí so apóstoly, umirénije čísto vselénňij podáti, i prehrišénij darováti nám préžde koncá proščénije, i cárstvija nebésnaho, krájnija rádi bláhosti, spodóbiti rabý tvojá."), ), "K": ( "P1": ( "1": ( ("","","Vódu prošéd jáko súšu, i jehípetskaho zlá izbižáv, Izráiľťanin vopijáše: izbáviteľu i Bóhu nášemu pojím."), ("","","Líče apóstoľskij svitovídnyj, svítu velíkomu predstojáj, mojé omračénoje ozarí sérdce, i ko spasíteľnym stezjám nastávi."), ("","","Líče apóstoľskij svitovídnyj, svítu velíkomu predstojáj, mojé omračénoje ozarí sérdce, i ko spasíteľnym stezjám nastávi."), ("","","Ískrenniji drúzi izbáviteľa, strastéj mjá ľubvé izbávite, mnóhimi lesťmí žitijá preľščénaho, i nerazúmija nóščiju pokryvájemaho."), ("","","Orúžijem ujázvlenyja lukávaho iscilíte, stríly súšče síľnaho, apóstoli božéstvenniji, víroju pod króv váš pribihájuščyja."), ("Bohoródičen","","Pólnyj istoščavájetsja Bohoľípno, i ot tvojehó čréva plotonósec Máti čístaja, proischódit, spasájaj blahoutróbijem preľščényja zlóboju zmíjevoju."), ), "2": ( ("","","Posíčenyj nesikómaho presičé, i víďi sólnce zémľu, júže ne víďi: ľútaho vrahá vodá potopí, i neprochodímoje prójde Izráiľ: písň že vospivášesja, Hóspodevi pojím, slávno bo proslávisja."), ("","","S líki výšnich síl, carjú vsích blažénne predstojáj, nás na zemlí prísno prizyvájuščich ťá, vsjákaho iskušénija zláho, Nikólaje spasáj, razrišénija prosjá prehrišénij nášich."), ("","","Íže tobóju predstátelem oboháščšijisja Nikólaje, vo dní že i v noščí víroju tebí vzyvájem: nýňi predvarí ny veľmí bídstvujuščyja bisóvskimi lukávymi navíty, i tletvórnych čelovík: jáko da tišinú polučívše, voschvaľájem ťá."), ("","","Krípkimi žílami molítv tvojích Nikólaje, udavíti nás tščáščichsja konéčnomu udavléniju predážď, izbavľája nás ot ťích lukávaho navíta, vo chvaléniji zovúščyja: Hóspodevi pojím, slávno bo proslávisja."), ("Bohoródičen","","Zakónov jestéstvennych kromí, rodilá jesí Bóha i zakonodávca, čelovíka bývša. Tohó jáko bláha molí vseneporóčnaja, náša bezzakónija prezríti, vopijúščich vsehdá: Hóspodevi pojím, slávno bo proslávisja."), ), ), "P3": ( "1": ( ("","","Tý jesí utverždénije pritekájuščich k tebí Hóspodi: tý jesí svít omračénnych, i pojét ťá dúch mój."), ("","","Síloju prepojášite, Spásovy apóstoli, iznemóhšeje strasťmí i pomyšléňmi sérdce mojé."), ("","","Síloju prepojášite, Spásovy apóstoli, iznemóhšeje strasťmí i pomyšléňmi sérdce mojé."), ("","","Jedíno vozviščájušče učenicý, trisvítloje Bóžije sijánije, mnohobóžija mhlú potrebíša."), ("","","Hnój lukávyj sérdca mojehó utolíte, jáko vráčeve božéstvennaho rukoďíjstvija, učenicý Bóha nášeho."), ("Bohoródičen","","Spasí mja čístaja Vladýčice, róždšaja páče jestestvá izbáviteľa vsích, i Vladýku, i Spása i Hóspoda."), ), "2": ( ("","","Tý jesí utverždénije pritekájuščich k tebí Hóspodi: tý jesí svít omračénnych, i pojét ťá dúch mój."), ("","","Da ťá počitájem, da pojém ťá vsehdá, podážď nám rúku pómošči, svjatíteľu Nikólaje."), ("","","Uspí, Nikólaje, tvojími neusypájuščimi molítvami, jáže na ný vostajúščyja napásti, mólim ťá."), ("","","Vsehó mja strasťmí napástvujema, i iskušénij lukávych čelovík, chodátajstvom tvojím svjáte Nikólaje izbávi."), ("Bohoródičen","","Razrišénije hrichóv čístaja, darováti mí, molí izbáviteľa, i žitéjskich ľútych napástej."), ), ), "P4": ( "1": ( ("","","Uslýšach Hóspodi, smotrénija tvojehó tájinstvo, razumích ďilá tvojá, i proslávich tvojé Božestvó."), ("","","Ukrasístesja slávniji apóstoli, božéstvennymi svítlosťmi udobrjájemi, i zarjámi prosviščájemi vás svitíla pokazávšaho."), ("","","Ukrasístesja slávniji apóstoli, božéstvennymi svítlosťmi udobrjájemi, i zarjámi prosviščájemi vás svitíla pokazávšaho."), ("","","Búri vsjákija izbávite mjá, vsích kórmčiji, božéstvenniji apóstoli, v pučíňi bídstvujuščaho, i napásťmi žitéjskimi koléblemaho."), ("","","Móre smuščájušče mnohobóžija, kóni Bohoizbránniji, prehrišénij mojích bézdnu vášimi molítvami potopíte."), ("Bohoródičen","","Ravnoďíjstvenno Rodíteľu Slóvo, iz bokú tvojéju voplotíla jesí Ďívo: ťímže javílasja jesí prevýšši vsích tvárej Vladýčice."), ), "2": ( ("","","Uslýšach Hóspodi, smotrénija tvojehó tájinstvo, razumích ďilá tvojá, i proslávich tvojé Božestvó."), ("","","Ot mnóžestva prehrišénij mojích, vo mnóhija vpádaju bezčíslennyja skórbi: potščísja svjáte Nikólaje pomoščí mi, blahodáteľu podóbjasja."), ("","","Sebé samohó pláčusja pohibájušča, živýj v ľínosti, molítvami tvojími Nikólaje, k pokajániju rukovodí mja."), ("","","Íže trí júnoši izbavléj, ótče Nikólaje, umréti choťáščyja, vsjákija mjá izbávi ťisnotý, i víčnaho osuždénija."), ("Bohoródičen","","Ďílati mí rázumy nebésnyja, prečístaja ukrípí mja, i duší mojejá napravľájušči k živótnym vchódom dvižénija."), ), ), "P5": ( "1": ( ("","","Útreňujušče vopijém tí, Hóspodi, spasí ny: tý bo jesí Bóh náš: rázvi tebé inóho ne vímy."), ("","","Sťisňájema mjá mnóhimi prehrišéňmi, k spasíteľnoj široťí isprávite, jáko okormítelije apóstoli."), ("","","Sťisňájema mjá mnóhimi prehrišéňmi, k spasíteľnoj široťí isprávite, jáko okormítelije apóstoli."), ("","","Počitájuščaho mjá vsečestnýj sobór váš, bohovídcy apóstoli, vsjákaho izbávite bezčéstnaho ďijánija, moľúsja."), ("","","Jáko strastém upodóbľšesja svjatíji Spásovym, vsjákoje sladostrástije ot duší mojejá otženíte apóstoli."), ("Bohoródičen","","Boľáščuju dúšu mojú iscilí, róždšaja vsích vzémľuščaho nedúhi, prečístaja Vladýčice."), ), "2": ( ("","","Útreňujušče vopijém tí, Hóspodi, spasí ny: tý bo jesí Bóh náš: rázvi tebé inóho ne vímy."), ("","","Ukrepí nás molítvami tvojími Bohoblažénne Nikólaje, sobľudáti poveľínija Christá, jedínaho Bóha nášeho."), ("","","V Mírich požív Nikólaje, blahouchánija božéstvennaho nás ispólni, blahočéstno vospivájuščich ťá."), ("","","Uščédri nás molítvami tvojími svjatíteľu, Bóha vseščédraho umoľája Nikólaje, da izbávimsja bíd i skorbéj."), ("Bohoródičen","","Vód životóčnych ispólnena súšči otrokovíce, vsích nás napój, blahočestnomúdrenňi pojúščyja ťá."), ), ), "P6": ( "1": ( ("","","Molítvu prolijú ko Hóspodu, i tomú vozviščú pečáli mojá: jáko zól dušá mojá ispólnisja, i živót mój ádu priblížisja, i moľúsja jáko Jóna: ot tlí Bóže, vozvedí mja."), ("","","Sotrjásše molítv prizyvánijem, nizložíste chrámy ídoľskija, učenicý Christóvy. no moľúsja víroju: umá mojehó sokrušíte ídoly, i pokažíte chrám Bóžij mnóhimi hrichí povínnaho."), ("","","Sotrjásše molítv prizyvánijem, nizložíste chrámy ídoľskija, učenicý Christóvy. no moľúsja víroju: umá mojehó sokrušíte ídoly, i pokažíte chrám Bóžij mnóhimi hrichí povínnaho."), ("","","Íže na kámeni nepokolebímim sozdávšesja, jáko kámenije, izbránniji bohovídcy, mojé sérdce v pescí umovrédno sozdánnoje spasíte: stekájutsja bo napástej ríki, i ľúťi mjá oburevájut."), ("","","Ľubvé lstívyja jáže k plóti, i mérzka mnóhija rádi zlóby jávľšahosja, izbávite mjá drúzi Slóva: i k ľubví privjažíte vozľubívšaho hríšnyja, mnóhija rádi mílosti ostavlénija."), ("Bohoródičen","","Jáko šípok, jáko čisťíjšij krín, jáko blahouchánnoje oboňánije ot krásnych udólij mirskích, tvoréc izbráv ťá otrokovíce, vselívsja vo utróbu tvojú, i rodívsja, blahouchánija vsjáčeskaja ispólnil jésť."), ), "2": ( ("","","Molítvu prolijú ko Hóspodu, i tomú vozviščú pečáli mojá: jáko zól dušá mojá ispólnisja, i živót mój ádu priblížisja, i moľúsja jáko Jóna: ot tlí Bóže, vozvedí mja."), ("","","Ráj sérdce tvojé javísja Nikólaje, žízni drévo posreďí imíja izbáviteľa Christá: jehóže molí neprestánno, rajá sotvoríti žíteli vsjá ný, téplym zastúpnikom tobóju oboháščšyjasja."), ("","","V ľínosti žízň mojú prechoždú, i bezbojáznenno sohrišáju okajánnyj: i támo neotricájemoje sudíšče pomyšľája, stráchom soderžím jésm: uščédri mjá Bóže, Nikolája molítvami, jáko blahoutróben."), ("","","Vnezápu nachoďáščuju mí búrju iskušénij mnohoobráznych, za mnóžestvo mojích sohrišénij, vopijú: ne ostávi mené blažénne bez zastuplénija, no prostrí mi jáko mílostiv pómošči rúku, i spasí mja."), ("Bohoródičen","","Paláta vysókaho carjá, i ohneobráznyj bylá jesí prestól Ďívo, Cheruvím prevýšši, i Serafím, páče umá bývšaja. Ťímže ťá vsjákoje dychánije slávit, jáko Máter ziždíteľa."), ), ), "P7": ( "1": ( ("","","Ótrocy jevréjstiji v peščí popráša plámeň derznovénno, i na rósu óhň preložíša, vopijúšče: blahoslovén jesí Hóspodi Bóže vo víki."), ("","","Nóšč mjá soderžít ľínostej, i pokryvájet mjá ťmá hrichóvnaja: svít míra premúdriji apóstoli jávľšesja, ozaríti potščítesja omračénnoje mojé sérdce."), ("","","Nóšč mjá soderžít ľínostej, i pokryvájet mjá ťmá hrichóvnaja: svít míra premúdriji apóstoli jávľšesja, ozaríti potščítesja omračénnoje mojé sérdce."), ("","","Druhóje nébo jávľšesja, povídajušče Bóha nášeho slávu, bezslávija strastéj izbávite Bohohlahóliviji, víroju pribihájuščyja k deržávnomu vášemu pokróvu."), ("","","Óhnennoje úhlije jávľšesja apóstoli, vozžihájemi ohném Uťíšiteľa, vsjáku véšč popalíte nášeja zlóby, i ohňá nehasímaho izbávite nás vo víki."), ("Bohoródičen","","Horá prisínnaja javílasja jesí nerukosíčnaja, ot nejáže otsičésja kámeň: ťímže Vladýčice, umilénije duší mojéj podážď omračénňij, i okamenénňij hórkimi ľuboslásťmi."), ), "2": ( ("","","Ótrocy jevréjstiji v peščí popráša plámeň derznovénno, i na rósu óhň preložíša, vopijúšče: blahoslovén jesí Hóspodi Bóže vo víki."), ("","","Istočíl jesí strují učénij, jereséj izsušája potóki, i vírnych dúšy napojájuščij bohátno, svjaščennoďíjstvenniče Nikólaje: sehó rádi ťá počitájem."), ("","","ukripílsja jesí síloju Tróičeskoju vozmohájem, kumíry léstnyja pohubíti, ťímže vírno moľúsja tí ótče: umá mojehó ídoly strástnyja otžení."), ("","","Mírjanov prepodóbne pervoprestóľnik býv, po smérti istočáješi božéstvennoje míro, zlosmrádnyja náša othoňája nedúhi, Nikólaje vseblažénne, vírno k tebí pristupájuščym."), ("Bohoródičen","","Ukrotíla jesí tečénije smértnoje, bezsmértnaho Bóha róždšaja: jehóže molí čístaja, strásti umertvíti smirénnaho mojehó ťilesé, i žízni mjá spodóbiti."), ), ), "P8": ( "1": ( ("","","Sedmeríceju péšč chaldéjskij mučíteľ Bohočestívym neístovno razžžé, síloju že lúčšeju spasény sijá víďiv, tvorcú i izbáviteľu vopijáše: ótrocy blahoslovíte, svjaščénnicy vospójte, ľúdije prevoznosíte vo vsjá víki."), ("","","Koléblemuju strasťmí dúšu mojú ukripíte, cérkve nerazorímaja osnovánija súšče, i stolpí nepokolebímiji, vírnych predhrádija, lovcý súščich vo hlubiňí pohíbeli, blahoutíšnaja pristánišča vírno pojúščich: ďíti blahoslovíte, svjaščénnicy vospójte, ľúdije prevoznosíte jehó vo víki."), ("","","Koléblemuju strasťmí dúšu mojú ukripíte, cérkve nerazorímaja osnovánija súšče, i stolpí nepokolebímiji, vírnych predhrádija, lovcý súščich vo hlubiňí pohíbeli, blahoutíšnaja pristánišča vírno pojúščich: ďíti blahoslovíte, svjaščénnicy vospójte, ľúdije prevoznosíte jehó vo víki."), ("","","Íže vo hróbi témnaho otčájanija, i v preispódnich padénija slastéj ležáščaho mjá, vášimi molítvami vozvestí, umilosérditesja učenicý Spásovy, íže učíteleva blahoutróbija obohatítisja jávi spodóbistesja, apóstoli bohovídcy vo vsjá víki."), ("","","Íže vo hróbi témnaho otčájanija, i v preispódnich padénija slastéj ležáščaho mjá, vášimi molítvami vozvestí, umilosérditesja učenicý Spásovy, íže učíteleva blahoutróbija obohatítisja jávi spodóbistesja, apóstoli bohovídcy vo vsjá víki."), ("Bohoródičen","","Jáko svetlá v krasotách dobroďíteli javílasja jesí vsečístaja, dobrotvoríteľnoje vseďíteľevo blahoľípije vo utróbu vmistíla jesí: jehóže priľížno molí, hrichámi strastéj soderžímuju, i dobróty drévnija íščuščuju čístaja, ziló blahoľípnejše dúšu mojú prosvitíti vo vsjá víki."), ), "2": ( ("","","Bohohlahóliviji ótrocy v peščí, so ohném plámeň popirájušče, pojáchu: blahoslovíte ďilá Hospódňa Hóspoda."), ("","","Prosviščén sýj Bohomúdre svjatíteľu, svitozárnymi lučámi trisólnečnaho Božestvá, strastéj mojích ťmú molítvami tvojími razorí Nikólaje."), ("","","Íže vojevódy trí izbavléj ot smérti, prišéstvijem strášnym tvojím, svjaščennotaínniče Nikólaje, ot vsjákaho smertonósnaho vréda i nás izbávi."), ("","","Kolébľuščyjasja bisóvskimi iskušéniji, i ot obíďaščich čelovík, tvojími molítvami utverdí nás, i nevrédny spasí vseblažénne Nikólaje."), ("Bohoródičen","","Moľbú prinesí Hóspodevi, uščédriti i spastí víroju k tebé pritekájuščyja, presvjatája Ďívo, čelovíkom pomóščnice."), ), ), "P9": ( "1": ( ("","","Užasésja o sém nébo, i zemlí udivíšasja koncý, jáko Bóh javísja čelovíkom plótski, i črévo tvojé býsť prostránňijšeje nebés. Ťím ťá Bohoródicu ánhelov i čelovík činonačálija veličájut."), ("","","Ľvóv dušetľínnych síloju Bóžijeju sokrušívše čéľusti apóstoli, jáko ot Christá kňázi postávleni býste na zemlí, psalómski dúchu sijú pokarjájušče blahočéstno: ťímže bezčínnaja dvizánija mojehó sérdca zakónom božéstvennym pokoríte."), ("","","Krásnaho páče vsích synóv čelovíčeskich, jávľšahosja v míri propovídavše, Slóva Bóžija, nózi ukrasíste jáko blahovistvújuščiji vsemúdriji, mír že i živót. Ťímže smuščájemuju strasťmí dúšu mojú vášimi molítvami umiríte."), ("","","Umertvívše údy jáže na zemlí, v živót vsjáčeskij oblekóstesja, strasťmí strásť izobrazújušče čestnúju. Ťímže umerščvlénnaho mjá strilóju zlóby lukávaho, oživíte ľičbámi ístinnaho pokajánija, Bohoblažénniji apóstoli."), ("Bohoródičen","","Nedúhujuščuju dúšu mojú strástiju ľútoju, róždšaja Bóha preblaháho, jáko mílostiva iscilí, i izbávi mjá prísno prečístaja, podstrekájuščich i nachoďáščich mí vrahóv, jáko da spasájem usérdno ťá veličáju, vozvelíčivšuju ród náš."), ), "2": ( ("","","Voístinnu Bohoródicu ťá ispovídujem, spasénniji tobóju Ďívo čístaja, s bezplótnymi líki ťá veličájušče."), ("","","Jáko izbáviteľ v skórbi víroju ťá moľáščym, izbávi mjá zlóby vsjákija Nikólaje, blaháho moľá Bóha i Hóspoda."), ("","","Sýj s nebésnymi nýňi likostojáňmi, svjaťíjšij ótče Nikólaje, blaháho umolí Bóha, spastí nás."), ("","","Súd pri dvérech, bľudí dušé mojá, i sudijí Bóhu vozopíj: Nikolája molítvami spasí mja Hóspodi."), ("Bohoródičen","","Svíta súšči prijátelišče Ďívo, prosvití omračénnuju strasťmí dúšu mojú: jáko da víroju i ľubóviju prísno slávľu ťá."), ), ), ), "CH": ( ("","","Hóspodi, tebé usérdno na zemlí apóstoli vozľubívše, uméty vsjá vminíša, da tebé jedínaho priobrjáščut: i za ťá na rány ťilesá svojá predáša. Sehó rádi proslávľšesja, móľatsja o dušách nášich."), ("","","Hóspodi, tý apóstoľskuju pámjať na zemlí vozvelíčil jesí: vsí bo v néj vkúpi sošédšesja slavoslóvim ťá: jáko podajéši nám ťími iscilénija, i vsemú míru mír molítvami ích, i véliju mílosť."), ("Múčeničen","","Vo broňá víry obólkšesja dóbre, i orúžijem krestnym vooružívše sebé, vójini krípcy javístesja, mučítelem múžeski protívistesja, i dijávoľu prélesť nizložíste, pobidítelije bývše, vincév spodóbistesja. Molíte prísno o nás, spastísja dušám nášym."), ("Bohoródičen","","Ischití mja Vladýčice, rukí zmíja čelovikoubíjcy, choťášča mjá lukávstvom pohlotíti do koncá. Sokruší čéľusti jehó, moľú ťa, i kózni razorí: jáko da izbýv ot nohtéj jehó, veličáju zastuplénije tvojé."), ), ) #let L = ( "B": ( ("","","Pomjaní nás Christé Spáse míra, jákože razbójnika pomjanúl jesí na drévi: i spodóbi vsích jedíne ščédre, nebésnomu cárstviju tvojemú."), ("","","Trubý jávľšesja Christóvy apóstoli, súščyja vo hrobích zlovírija ležáščyja vozdvíhnuli jesté, i božéstvennyja žízni pričástniki soďílaste."), ("","","Símenem tájnym slóva Bohohlahóliviji, vsích jazýk serdcá neplódnaja plodonósna soďílaste božéstvennaho rázuma: ťímže dostójno blažími jesté."), ("","","Vsjákija sebé obnažívše zlóby, posreďí ľútych proidóša dóblestvenno, i s nebesé v rízu spasénija stradáľcy oďíjašasja."), ("","","Umertví zlotvórnych strastéj vostánija duší mojejá okajánnyja, čestnája Tróice vsesvjatája, molítvami božéstvennych apóstol tvojích, jáko da spasájem slávľu ťá."), ("","","Rádujsja kleščé úhľa božéstvennaho: rádujsja prorókov pečáť, i apóstolov ohlašénije, prečístaja Bohoródice, jejáže rádi ot istľínija svobodíchomsja."), ), )
https://github.com/ljgago/typst-chords
https://raw.githubusercontent.com/ljgago/typst-chords/main/docs/chordx-docs.typ
typst
MIT License
#import "@preview/tidy:0.3.0" #import "assets/template.typ": design, custom #set document(date: none) #show link: underline #show: design.with( title: "chordx", subtitle: "A package to write song lyrics with chord diagrams in Typst.", authors: ( "<NAME>", ), date: "July 9, 2024", version: toml("../typst.toml").package.version, url: "https://github.com/ljgago/typst-chords" ) #show raw.where(lang: "typ-lang"): it => { custom(raw(it.text, lang: "typ")) } #show raw.where(lang: "sh-lang"): it => { custom(raw(it.text, lang: "sh")) } #pagebreak() #outline(indent: auto, depth: 3) #pagebreak() = Reference == Chart Chords #{ let module = tidy.parse-module(read("../src/chart.typ")) tidy.show-module(module, sort-functions: none) } ==== Example: ```typ-lang #import "@preview/chordx:0.4.0": * #let chart-chord-sharp = chart-chord.with(size: 18pt) #let chart-chord-round = chart-chord.with(size: 18pt, design: "round") // Design "sharp" #chart-chord-sharp(tabs: "x32o1o", fingers: "n32n1n")[C] #chart-chord-sharp(tabs: "ooo3", fingers: "ooo3")[C] // Desigh "round" with position "bottom" #chart-chord-round(tabs: "xn332n", fingers: "o13421", fret: 3, capos: "115", position: "bottom")[Cm] #chart-chord-round(tabs: "onnn", fingers: "n111", capos: "313", position: "bottom")[Cm] // Design "round" with background color in chord name #chart-chord-round(tabs: "xn332n", fingers: "o13421", fret: 3, capos: "115", background: silver)[Cm] #chart-chord-round(tabs: "onnn", fingers: "n111", capos: "313", background: silver)[Cm] ``` #{ import "../src/chart.typ": chart-chord let chart-chord-sharp = chart-chord.with(size: 18pt) let chart-chord-round = chart-chord.with(size: 18pt, design: "round") v(1em) chart-chord-sharp(tabs: "x32o1o", fingers: "n32n1n")[C] h(2em) chart-chord-sharp(tabs: "ooo3", fingers: "ooo3")[C] h(1fr) chart-chord-round(tabs: "xn332n", fingers: "o13421", fret: 3, capos: "115", position: "bottom")[Cm] h(2em) chart-chord-round(tabs: "onnn", fingers: "n111", capos: "313", position: "bottom")[Cm] h(1fr) chart-chord-round(tabs: "xn332n", fingers: "o13421", fret: 3, capos: "115", background: silver)[Cm] h(2em) chart-chord-round(tabs: "onnn", fingers: "n111", capos: "313", background: silver)[Cm] v(2em) } #pagebreak() == Piano Chords #{ let module = tidy.parse-module(read("../src/piano.typ")) tidy.show-module(module, sort-functions: none) } ==== Example: ```typ-lang #import "@preview/chordx:0.4.0": * #let piano-chord-sharp = piano-chord.with(layout: "F", size: 18pt) #let piano-chord-round = piano-chord.with(layout: "F", size: 18pt, design: "round") #piano-chord-sharp(keys: "<KEY>", fill-key: blue)[B] #piano-chord-round(keys: "<KEY>", fill-key: yellow, position: "top")[B] #piano-chord-round(keys: "<KEY>", fill-key: red, background: silver)[B] ``` #{ import "../src/piano.typ": piano-chord set align(center) let piano-chord-sharp = piano-chord.with(layout: "F", size: 18pt) let piano-chord-round = piano-chord.with(layout: "F", size: 18pt, design: "round") v(1em) piano-chord-sharp(keys: "<KEY>", fill-key: blue)[B] h(1fr) piano-chord-round(keys: "<KEY>", fill-key: yellow, position: "bottom")[B] h(1fr) piano-chord-round(keys: "<KEY>", fill-key: red, background: silver)[B] v(2em) } #pagebreak() == Single Chords #{ let module = tidy.parse-module(read("../src/single.typ")) tidy.show-module(module, sort-functions: none) } ==== Example: ```typ-lang #import "@preview/chordx:0.4.0": * #let chord = single-chord.with( font: "PT Sans", size: 10pt, weight: "semibold", background: silver ) #chord[Jingle][G][2] bells, jingle bells, jingle #chord[all][C][2] the #chord[way!][G][2] \ #chord[Oh][C][] what fun it #chord[is][G][] to ride \ In a #chord[one-horse][A7][2] open #chord[sleigh,][D7][3] hey! ``` #{ import "../src/single.typ": single-chord let chord = single-chord.with( font: "PT Sans", size: 10pt, weight: "semibold", background: silver ) [ #chord[Jingle][G][2] bells, jingle bells, jingle #chord[all][C][2] the #chord[way!][G][2] \ #chord[Oh][C][] what fun it #chord[is][G][] to ride \ In a #chord[one-horse][A7][2] open #chord[sleigh,][D7][3] hey! ] }
https://github.com/lucannez64/Notes
https://raw.githubusercontent.com/lucannez64/Notes/master/Project_Ideas.typ
typst
#import "@preview/bubble:0.1.0": * #import "@preview/fletcher:0.4.3" as fletcher: diagram, node, edge #import "@preview/cetz:0.2.2": canvas, draw, tree #import "@preview/cheq:0.1.0": checklist #import "@preview/wordometer:0.1.1": * #show: bubble.with( title: "Project Ideas", subtitle: "A long derivation towards greatness", author: "<NAME>", affiliation: "LHB", year: "2023/2024", class: "101", logo: image("JOJO_magazine_Spring_2022_cover-min-modified.png"), ) #set page(footer: context [ #set text(8pt) #set align(center) #text(total-words+" words /") #text("page "+ counter(page).display()) ] ) #set heading(numbering: "1.1") #show: checklist.with(fill: luma(95%), stroke: blue, radius: .2em) #show: word-count.with(exclude: (text.where(weight: 8pt))) = Liste - [ ] Une application qui permet de répertorier des objets et leurs positions et de la tracker quand on lui dit qu'on les déplace elle demande une vérification de la nouvelle position et nous la rappelle quand on cherche cet objet - [ ] b = Application == Find My Object `add_db(obj) returns image, pos(inside which tree of object or rooms), in_movement` #diagram( spacing: (10em,2em), node-stroke: .1em, node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%), edge((-1, 0), "r", "--|>", "user_add(object)", label-pos: 0, label-side: center), node((0,0), "add_db(obj)", shape: rect), ) #v(1.5em) #diagram( spacing: (10em,3em), node-stroke: .1em, node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%), edge((-1, 1), "r", "--|>", "user_changing_position", label-pos: 0, label-side:center), node((0,1), "get_which_object_in_movement", shape: rect), edge((0, 1), "d", "-|>", "ask_for_an_update(obj)"), node((0,2), "set_new_position(obj)"), ) #v(1.5em) #diagram( spacing: 10em, node-stroke: .1em, node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%), edge((-1,0), "r", "--|>", "user_ask_for_obj_location" , label-pos: 0, label-side:center), node((0,0), "pos(obj)") ) === Position tree #let data = ( [room], ([drawer a], [compartiment a], [compartiment b]), ([drawer b], [tshirt]) ) #canvas(length: 1cm, { import draw: * tree.tree(data, spread: 4, grow: 1.5, draw-node: (node, ..) => { circle((), radius: .45, stroke: none) content((), node.content) }, draw-edge: (from, to, ..) => { line((a: from, number: .45, 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, 1.5, b), (b, .6, a), mark: (end: ">", start: ">")) })
https://github.com/Az-21/typst-components
https://raw.githubusercontent.com/Az-21/typst-components/main/style/1.0.0/Components/code.typ
typst
Creative Commons Zero v1.0 Universal
#import "../Colors/m3.typ": * #let m3 = material3.blue.dark #let code( content, background: m3.primaryContainer, foreground: m3.onPrimaryContainer, font: "JetBrains Mono", ) = { set text(fill: foreground, font: font) box( fill: background, inset: (x: 0.5em, y: 0em), outset: (y: 0.5em), radius: 2pt, content, ) }
https://github.com/jamesrswift/ionio-illustrate
https://raw.githubusercontent.com/jamesrswift/ionio-illustrate/main/dist/0.1.0/README.md
markdown
MIT License
# The `ionio-illustrate` package This package implements a Cetz chart-like object for displying mass spectrometric data in Typst documents. It allows for individually styled mass peaks, callouts, titles, and mass calipers. ## Usage ```typst #import "@preview/ionio-illustrate:0.1.0": * #let data = csv("isobutelene_epoxide.csv") #let ms = mass-spectrum(massspec, args: ( size: (12,6), range: (0,100), )) #figure((ms.display)(ms)) ``` ## Example output ![](assets/example_plot.png)
https://github.com/peng1999/typst-pyrunner
https://raw.githubusercontent.com/peng1999/typst-pyrunner/main/pkg/pyrunner.typ
typst
MIT License
#let py = plugin("./typst-pyrunner.wasm") #let extract(code) = { if type(code) == "content" { code.text } else { code } } #let block(code, globals: (:)) = { let code = extract(code) cbor.decode(py.run_py(bytes(code), cbor.encode(globals))) } #let compile(code) = { let code = extract(code) py.compile_py(bytes(code)) } #let call(compiled, fn_name, ..args) = { cbor.decode(py.call_compiled(compiled, bytes(fn_name), cbor.encode(args.pos()))) }
https://github.com/MyPedagogicalRessources/BUT1-R1-01-Initiation-developpement
https://raw.githubusercontent.com/MyPedagogicalRessources/BUT1-R1-01-Initiation-developpement/main/TD/TD1-Structures-controle-enonce.typ
typst
#import "TD1-Structures-controle.typ":* #td1(isCorrection: false)
https://github.com/chiplet/typst-utils
https://raw.githubusercontent.com/chiplet/typst-utils/main/utils.typ
typst
// color functions #let r(content) = [#text(red)[#content]] #let g(content) = [#text(green)[#content]] #let b(content) = [#text(blue)[#content]] #let y(content) = [#text(yellow)[#content]] #let rt = [#r[$times$]] // red tick #let gt = [#g[$times$]] // green tick #let bt = [#b[$times$]] // blue tick #let hrule = line(length: 100%) #let todo(description) = [ #text(red)[*TODO*] -- #description ] // matrix row/column line style #let hbar(color: black) = [ #line( length: 3mm, stroke: {color+0.5pt} ) ] #let vbar(color: black) = [ #line( length: 3mm, angle: 90deg, stroke: color+0.5pt ) ] #let rarr = $->$ // Equations #let sci(base, exp) = $#base dot 10^(#exp)$
https://github.com/SkiFire13/master-thesis
https://raw.githubusercontent.com/SkiFire13/master-thesis/master/chapters/background/1-lattices.typ
typst
#import "../../config/common.typ": * #import "@preview/cetz:0.2.2": canvas, draw == Partial orders, lattices and monotone functions We start by defining what is a (complete) lattice and introducing some related concepts. This will be fundamental for defining systems of fixpoint equations, as their domain and codomain will be lattices. Moreover we are interested in least and greatest fixpoints, which intrinsically require a concept of order. #definition("partial order, poset")[ Let $X$ a set. A partial order $sub$ is a binary relation on $X$ which satisfies the following properties for all $x, y, z in X$: - (Antisymmetry): if $x sub y$ and $y sub x$ then $x = y$; - (Reflexivity): $x sub x$; - (Transitivity): if $x sub y$ and $y sub z$ then $x sub z$. A partially ordered set (poset, for short) is a pair $(X, sub)$. ] A common example of poset is $(bb(N), <=)$, the set of natural numbers, and $<=$ is the standard order relation. #example("Posets and Hasse diagrams")[ Posets can conveniently be visualized using _Hasse diagrams_, like the ones in @poset-example. In such diagrams lines connecting two elements represent the one on top being greater than the one on the bottom. Lines that could be obtained by transitivity are instead left implicit due to the fact that the diagram represents a valid poset. #let poset_example = canvas({ import draw: * set-style(content: (padding: .2), stroke: black) let node(pos, name, label) = content(pos, label, name: name) group({ translate((2.5, 2)) content((1, 0), $P$) node((-1, 4), "x", $x$) node((1, 4), "y", $y$) node((0, 2), "w", $w$) node((0, 0), "z", $z$) line("x", "w") line("y", "w") line("z", "w") }) group({ translate((8, 2)) content((1, 0), $Q$) node((0, 4), "top", $top$) node((1.2, 2.8), "q", $q$) node((-1.2, 2.8), "p", $p$) node((1.2, 1.2), "m", $m$) node((-1.2, 1.2), "n", $n$) node((0, 0), "bot", $bot$) line("top", "p") line("top", "q") line("p", "n") line("p", "m") line("q", "n") line("q", "m") line("n", "bot") line("m", "bot") }) group({ translate((1.5, -4)) content((1.5, 0), $L$) node((0, 4), "top", $top$) node((-1.5, 2), "a", $a$) node((0.75, 2.75), "b", $b$) node((0, 1.5), "c", $c$) node((1.5, 1.5), "d", $d$) node((0, 0), "bot", $bot$) line("top", "a") line("top", "b") line("a", "bot") line("b", "c") line("b", "d") line("c", "bot") line("d", "bot") }) group({ translate((6.5, -4)) content((1, 0), $bb(N)_omega$) node((0, 4), "omega", $omega$) node((0, 2.4), "2", $2$) node((0, 1.2), "1", $1$) node((0, 0), "0", $0$) line("omega", "2", stroke: (dash: "densely-dotted")) line("2", "1") line("1", "0") }) group({ translate((10.5, -3)) content((0, -1), $bb(B)$) node((0, 2), "tt", $tt$) node((0, 0), "ff", $ff$) line("tt", "ff") }) }) #figure( poset_example, caption: [Hasse diagrams of five posets], ) <poset-example> ] #definition("join and meet")[ Let $(X, sub)$ be a poset and $S subset.eq X$. The meet (respectively join) of $S$, written $meet S$ (resp. $join S$), is the smallest (resp. greatest) element of $X$ that is bigger (resp. smaller) or equal to every element in $S$. Formally: - (Meet): $forall s in S. s sub meet S$ and $forall t in X. forall s in S. s sub t => meet S sub t$ - (Join): $forall s in S. join S sub s$ and $forall t in X. forall s in S. t sub s => t sub join S$ ] For example in @poset-example, in the poset $L$ the join between $c$ and $d$, that is $join {c, d}$, is $b$, while the join between $a$, $c$ and $d$ is $join {a, c, d} = top$. Meet and join do not always exist, for example in the poset $P$ the join between $x$ and $y$ does not exist because there is no element that is greater than both of them, while in the poset $Q$ the join between $n$ and $m$ does not exist because $p$, $q$ and $top$ are all greater than both $n$ and $m$, but none of them is smaller than the others. It can however be proven that when a join or meet exists, it is unique. For our purposes we will however be interested in posets where meet and join always exists, also commonly called _lattices_. The posets $P$ and $Q$ are thus not lattices, while $L$, $bb(N)_omega$ and $bb(B)$ are all lattices. #definition("complete lattice")[ Let $(L, sub)$ be a poset. It is also a lattice if meet and join exist for every pair of elements, that is given $x, y in L$ both $meet {x, y}$ and $join {x, y}$ are defined. It is a complete lattice if meet and join exist for every subset, that is given $S subset.eq L$ both $meet S$ and $join S$ are defined. ] Observe that every complete lattice $L$ has a smallest element, called the _bottom_ element $bot = meet varempty$, and a largest element, called the _top_ element $top = join L$. In particular, a complete lattice cannot be empty. For example in the three lattices in @poset-example the top elements are $top$, $omega$ and $tt$, while the bottom elements are $bot$, $0$ and $ff$, respectively. From now on we will work with complete lattices. For most examples we will however use finite lattices, which can be proved to always be complete lattices. #lemma("finite complete lattices")[ Let $(L, sub)$ be a finite lattice, that is a lattice where $L$ is a finite set. Then it is also a complete lattice. ] In @poset-example both $L$ and $bb(B)$ are finite complete lattices. In particular $bb(B)$ is called the _boolean lattice_, since it contains the two boolean literals $tt$ and $ff$ and its join and meet operators are respectively the $or$ and $and$ logical operators. The $bb(N)_omega$ lattice is instead an infinite complete lattice, since it contains all natural numbers equipped with a top element $omega$. Note that the plain set of natural numbers $bb(N)$ is not a complete lattice because $join bb(N)$ is not defined, while in $bb(N)_omega$ it is $omega$. #definition("powerset")[ Let $X$ be a set. Its powerset, written $2^X$, is the set of all subsets of $X$, that is $2^X = {S | S subset.eq X}$. ] #example("powerset lattice")[ Given a set $X$, the pair $(2^X, subset.eq)$ is a complete lattice. The $join$ and $meet$ operations are respectively the union $union$ and intersection $sect$ operations on sets, while the $top$ and $bot$ elements are respectively $X$ and $varempty$. #let powerset_example = canvas({ import draw: * set-style(content: (padding: .2), stroke: black) let node(pos, name, label) = content(pos, label, name: name) node((2, 0), "top", ${a, b, c}$) node((0, -1.5), "ab", ${a, b}$) node((2, -1.5), "ac", ${a, c}$) node((4, -1.5), "bc", ${b, c}$) node((0, -3), "a", ${a}$) node((2, -3), "b", ${b}$) node((4, -3), "c", ${c}$) node((2, -4.5), "bot", $varempty$) line("ab", "top") line("ac", "top") line("bc", "top") line("a", "ab") line("a", "ac") line("b", "ab") line("b", "bc") line("c", "ac") line("c", "bc") line("bot", "a") line("bot", "b") line("bot", "c") }) #figure( powerset_example, caption: [Hasse diagram of a powerset lattice], ) <powerset-example> ] When we will later characterize the solutions of a system of fixpoint equations it will be convenient to consider a basis of the lattice involved. Intuitively a basis is a subset of elements which allows to express any other element as a join of a subset of such basis. #definition("basis")[ Let $(L, sub)$ be a lattice. A basis is a subset $B_L subset.eq L$ such that all elements $l in L$, $l = join { b in B_L | b sub l }$. ] To give an example of a basis, consider the lattice $L$ in @poset-example. A basis for it is the set $B_L = {a, c, d}$, where we can express the other elements with $bot = join varempty$, $b = join {c, d}$ and $top = join {a, c, d} = join {a, c} = join {a, d}$. Note that there may be more than one way to obtain an element by joining a subset of a basis, as shown with $top$. The boolean lattice $bb(B)$ instead admits the simple basis ${ tt }$, since $ff = join varempty$ and $tt = join { tt }$. Another basis that we will use often is the basis of a powerset lattice, which we will now define. #definition("basis of powerset", label: <powerset-basis>)[ Given a set $X$, a basis of the poset $(2^X, subset.eq)$ is the set of singletons $B_(2^X) = { {x} | x in X }$. ] We now also define the concept of upward-closed set and upward-closure. This concept will become important later on. #definition("upward-closed set")[ Let $(X, sub)$ be a poset and $U subset.eq X$. $U$ is an upward-closed set if $forall x, y in X$, if $x in U$ and $x sub y$ then $y in U$. ] #definition("upward-closure")[ Let $(L, sub)$ be a lattice and $l in L$. The upward-closure of $l$ is $up l = { l' in L | l sub l' }$. ] It can be proven that the upward-closure of a set is an upward-closed set. #definition("fixpoint")[ Let $(X, sub)$ be a complete lattice and $f: X -> X$ a function. Any element $x in X$ such that $f(x) = x$ is a fixpoint of $f$. ] Given a function $f : L -> L$ where $(L, sub)$ is a complete lattice, it is not guaranteed that a fixpoint exists. However if we restrict ourself to _monotone_ functions, then by the Knaster-Tarski theorem @tarski there exists at least one fixpoint. Moreover the set of all fixpoints is also a complete lattice, which guarantees the existence and uniqueness the least and greatest fixpoints. #definition("monotone function")[ Let $(X, sub)$ be a poset and $f: X -> X$ a function. We say that $f$ is monotone if $forall x, y in X. x sub y => f(x) sub f(y)$ ] #theorem[Knaster-Tarski @tarski][ Let $(X, sub)$ be a complete lattice and $f: X -> X$ a monotone function. The set of fixpoint of $f$ forms a complete lattice with respect to $sub$. The least fixpoint of $f$, written $lfp f$, is the bottom element of such lattice, while the greatest fixpoint of $f$, written $gfp f$, is the top element. ] Kleene iteration @kleene also gives us a constructive way to obtain a least or greatest fixpoint by repeatedly iterating a function starting from respectively the bottom or top element of the lattice. In its most general form it may require a transfinite iteration, though with some stronger hypothesis it can be relaxed to a regular, possibly infinite, iteration, for example by requiring the function to be continuous instead of just monotone. In our case we can limit ourselves to finite lattices, in which case Kleene iteration can be shown to require only a finite amount of steps. It should be noted however that it may not be efficient enough to compute a fixpoint in such a way, because it may require too many iterations (potentially an infinite amount in case of non-finite lattices) or because computing and representing the full solution may require too much space, and we are interested only in some specific characteristics of it. #theorem[Kleene iteration @kleene for finite lattices][ Let $(X, sub)$ be a finite lattice and $f: X -> X$ a monotone function. Consider the ascending chain $bot sub f(bot) sub f(f(bot)) sub dots.h.c sub f^n (bot) sub dots.h.c$, it converges to $lfp f$ in a finite amount of steps, that is there exists a $k$ such that $lfp f = f^k (bot)$. Similarly $gfp f = f^k (top)$ for some $k$. ]
https://github.com/Mineorbit/cryptOgraph
https://raw.githubusercontent.com/Mineorbit/cryptOgraph/master/tests/testpaper.typ
typst
#import "@local/cryptograph:0.0.1": * Hello there! -Some stuff Let the security parameter be $#secpar$.
https://github.com/lucifer1004/leetcode.typ
https://raw.githubusercontent.com/lucifer1004/leetcode.typ/main/problems/p0004.typ
typst
#import "../helpers.typ": * #import "../solutions/s0004.typ": * = Median of Two Sorted Arrays Given two sorted arrays `nums1` and `nums2` of size `m` and `n` respectively, return the *median* of the two sorted arrays. The overall run time complexity should be $cal(O)(log (m+n))$. #let median-of-two-sorted-arrays(nums1, nums2) = { // Solve the problem here } #testcases( median-of-two-sorted-arrays, median-of-two-sorted-arrays-ref, ( (nums1: (1, 3), nums2: (2,)), (nums1: (1, 2), nums2: (3, 4)), (nums1: range(100, step: 3), nums2: range(200, step: 6)), ) )
https://github.com/cherrypiejam/typst-cv-template
https://raw.githubusercontent.com/cherrypiejam/typst-cv-template/main/cv.typ
typst
#import "cv-template.typ": conf #show: conf.with( name: "<NAME>", contact: ( address: "20 Ingram Street, Forest Hills, Queens, New York City, 11375", e-mail: "peter.parker at esu dot edu", ), // research-interests: "", education: ( // first ( institute: "Empire State University", location: "New York City, NY", degrees: ( ( "B.S. in Physics", ( datetime(year: 2023, month: 9, day: 1), datetime.today(), ), (), ), ), ), // second ( institute: "Midtown Science High School", location: "New York City, NY", degrees: ( ( "High School Diploma", ( datetime(year: 2023, month: 5, day: 1), ), ( "GPA: 4.0/4.0", "Graduated with Honors", ), ), ), ), ), awards: ( ( "First Place in the New York City Math League (NYCML)", datetime(year: 2022, month: 10, day: 1), ), ( "Norman Osborn Scholarship", datetime(year: 2022, month: 2, day: 1), ), ( "Best Student Photographer Award", datetime(year: 2021, month: 2, day: 1), ), ), ) === Work Experience *Empire State University* \ - Research Intern #box(width: 1fr, repeat[.]) Jan. 2023 - Mar. 2023 - Worked under Dr. <NAME>' supervision on gene splicing and recombinant DNA to replicate stem cell regeneration in human tissue. - Conducted multiple successful trials on mice by fully re-growing lost limbs using advanced biochemical techniques such as polymerase chain reaction (PCR), gel electrophoresis, and CRISPR-Cas9 gene editing. - Collected and analyzed complex genetic data, utilizing bioinformatics tools to identify patterns and results. Maintained meticulous records of experimental procedures, results, and observations in lab notebooks and electronic databases for accuracy and reproducibility of research. *Osborn Corporation* \ - Biochemical Research Intern #box(width: 1fr, repeat[.]) May. 2022 - Aug. 2022 - Documented the genetic and behavioral found in the irradiated spiders. *Joe's Pizza* \ - Pizza Delivery Service #box(width: 1fr, repeat[.]) Jan. 2021 - Sep. 2021 - Delivered pizzas safely and courteously to customers throughout New York City, ensuring a high level of customer satisfaction. - Quickly resolved issues such as incorrect orders or late deliveries. === Teaching Experience - From Classical to Quantum Mechanics, ESU, PSY 207 #box(width: 1fr, repeat[.]) Spring'24 - AP Chemistry, Midtown Science High School #box(width: 1fr, repeat[.]) Spring'24 - AP Physics 1, Midtown Science High School #box(width: 1fr, repeat[.]) Fall'23 === Publications *<NAME>* and <NAME>. A Novel Decay Rate Algorithm for Enhanced Material Decomposition in Bio-Organic Systems. _Journal of Advanced Biochemical Engineering_, 22(4), 547-580. February 2023. === Skills - Data analysis and web design (Python, R, JavaScript, HTML, Elixir) - RNA extraction (PCR) - Photography (Photoshop)
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/text/linebreak_07.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Test justified breaks. #set par(justify: true) With a soft #linebreak(justify: true) break you can force a break without #linebreak(justify: true) breaking justification. #linebreak(justify: false) Nice!
https://github.com/CmrCrabs/NEA
https://raw.githubusercontent.com/CmrCrabs/NEA/main/paperwork.typ
typst
// Settings #set par(justify: true) #show link: underline #set page( numbering: "1", margin: 2cm, paper: "us-letter", ) #set text( hyphenate: false, font: "EB Garamond" ) #set heading(numbering: "1.", offset: 0) #set text(12pt) #set enum(numbering: "1.1", full: true) #set list(marker: ([•], [‣],[--])) #set math.mat(delim: "["); #set math.vec(delim: "["); // Title Page #page(numbering: none, [ #v(2fr) #align(center, [ //#image("/Assets/ocean.png", width: 60%) #text(23pt, weight: 700, [NEA]) #v(0.1fr) #text(23pt, weight: 700, [Real-Time, Physically Based Ocean Simulation & Renderer]) #v(0.1fr) #text(23pt, weight: 500, [Zayaan Azam]) #v(1.1fr) ]) #v(2fr) ]) // TODO: // cascades // IFFT // dispersion relation derivative // define delta K // jacobian & eigenvalue // define derivatives // how to pack 8 ffts into 4 // expand upon technologies // write objectives // explain IDFT in terms of indices (keith lantz & jump trajectory) // post processing tonemapping // bloom pass // cubemap sampling // // Objectives // Contents Page #page(outline(indent: true, depth: 3)) == Abstract \/\/ synposis // the goal of this project was to.... = Analysis == Client === #text(14pt, [Introduction]) The client is <NAME>. They are a game developer who require a physically based, performant, configurable simulation of an ocean for use in their game. They also require a physically based lighting model derived from microfacet theory, including PBR specular, and empirical subsurface scattering. Also expected is a fully featured GUI allowing direct control over every input parameter, and a functioning orbit camera. === #text(14pt, [Questions]) + Functionality + "what specific ocean phenomena need to be simulated? (e.g. waves, foam, spray, currents)" + "what parameters of the simulation need to be configurable?" + "does there need to be an accompanying GUI?" + Visuals + "do i need to implement an atmosphere / skybox?" + "do i need to implement a pbr water shader?" + "do i need to implement caustics, reflections, or other light-related phenomena?" + Technologies + "are there any limitations due to existing technology?" + "does this need to interop with existing code?" + Scope + "are there limitations due to the target device(s)?" + "are there other performance intesive systems in place?" + "is the product targeted to low / mid / high end systems?" #pagebreak() === #text(14pt, [Interview Notes]) + Functionality + it should simulate waves in all real world conditions and be able to generate foam, if possible simulating other phenomena would be nice. + all necessary parameters in order to simulate real world conditions, ability to control tile size / individual wave quantity + accompanying GUI to control parameters and tile size. GUI should also output debug information and performance statistics + Visuals + a basic skybox would be nice, if possible include an atmosphere shader + implement a PBR water shader, include a microfacet BRDF + caustics are out of scope, implement approximate subsurface scattering, use beckmann distribution in combination with brdf to simulate reflections + Technologies + client has not started technical implementation of project, so is not beholden to an existing technical stack + see response 3.1 + Scope + the simulation is intended to run on both x86 and arm64 devices + see response 3.1 + the simulation is targeted towards mid to high end systems, ideally the solution would also be performant on lower end hardware #pagebreak() == Research === #text(14pt, [Technologies (Unfinished)]) - Rust: - Fast, memory efficient programming language - WGPU: - Graphics library - Rust GPU: - (Rust as a) shader language - Winit: - cross platform window creation and event loop management library - Dear ImGui - Bloat-free GUI library with minimal dependencies - Naga: - Shader translation library - GLAM: - Linear algebra library - Nix: - Declarative, reproducible development environment === #text(14pt, [Algorithm Overview (Unfinished)]) \/\/ like 20x more complex than this \ startup: - generate gaussian random number pairs and store into texture on cpu param change: - generate energy spectrum for every wave and store into texture - generate dispersion relation for every wave and store into texture every frame: - evolve spectrum - inverse fft for all 3 axes - inverse fft for all 5 derivatives - store results into textures - displace vertices per textures - compute jacobian of textures - inject foam into foam texture - lighting - color pixels for foam - exponential decay function on foam @JTessendorf @Empirical-Spectra === #text(14pt, [The IFFT (Unfinished)]) ==== Cooley-Tukey Fast Fourier Transform (FFT) (Unfinished) @Code-Motion @JTessendorf @Jump-Trajectory The Cooley-Tukey FFT is a common implementation of the FFT algorithm used for fast calculation of the DFT. The direct DFT is computed in $O(N^2)$ time whilst the FFT is computed in $O(N log N)$. This is a significant improvement as we are dealing with $M$ (and $N$) in the millions. $ "complex, will write up after learning roots of unity & partial derivatives" $ #pagebreak() === #text(14pt, [Spectrum Generation (Unfinished)]) // overview ==== Dispersion Relation @Empirical-Spectra @JTessendorf The relation between the travel speed of the waves and their wavelength, written as a function relating angular frequency $omega$ to wave number $arrow(k)$. This simulation involves finite depth, and so we will be using a dispersion relation that considers it. This dispersion relation also considers capillary waves using approximate relationships @Empirical-Spectra. $ omega(arrow(k)) = sqrt(g |arrow(k)| tanh (|arrow(k)| h)) $ $ (d omega(arrow(k))) / (d arrow(k)) = $ where - $g$ is gravity - $h$ is the ocean depth ==== Non-Directional Spectrum (JONSWAP) @OW-Spectra @Jump-Trajectory @Acerola-FFT @Empirical-Spectra The JONSWAP energy spectrum is a more parameterised version of the Pierson-Moskowitz spectrum, and an improvement over the Philips Spectrum used in @JTessendorf, simulating an ocean that is not fully developed (as recent oceanographic literature has determined this does not happen). The increase in parameters allows simulating a wider breadth of real world conditions. $ S_"JONSWAP" (omega) = (alpha g^2) / (omega^5) "exp" [- beta (omega_p / omega)^4] gamma^r $ $ r = exp [ - (omega -omega_p)^2 / (2w_p ^2 sigma ^2)] $ $ alpha = 0.076 ( (U_(10) ^2) / (F g))^(0.22) $ $ omega_p = 22( (g^2) / (U_10 F))^(1/3) $ $ sigma = cases( 0.07 "if" omega <= omega_p, 0.09 "if" omega > omega_p, ) $ where - $alpha$ is the intensity of the spectra - $beta = 5/4$, a "shape factor", rarely changed @OW-Spectra - $gamma = 3.3$ - $omega = omega(|arrow(k)|) $is the dispersion relation - $omega_p$ is the peak wave frequency - $U_(10)$ is the wind speed at $10"m"$ above the sea surface @OW-Spectra - $F$ is the distance from a lee shore (a fetch) - distance over which wind blows with constant velocity @OW-Spectra @Empirical-Spectra - $g$ is gravity ==== Depth Attenuation Function (Kitaiigorodskii) @Empirical-Spectra JONSWAP was fit to observations of waves in deep water. This function adapts the JONSWAP spectrum to consider ocean depth, allowing a realistic look based on distance to shore. The actual function is quite complex for a relatively simple graph, so can be well approximated as below @Empirical-Spectra. $ Phi (omega, h) = cases( 1 / 2 omega_h ^2 "if" omega_h <= 1, 1 - 1 / 2 (2 - omega_h)^2 "if" omega_h > 1, ) $ $ omega_h = omega sqrt(h / g) $ where - $omega$ is the dispersion relation - $h$ is the ocean depth - $g$ is gravity ==== Directional Spread Function (Donelan-Banner) @Empirical-Spectra This function is multiplied with the non-directional spectrum in order to produce a direction dependent spectrum @Empirical-Spectra. $ theta = arctan (k_z / k_x) - theta_0$ $ D_"base" (omega, theta) = beta_s / (2 tanh (beta_s pi)) sech^2(beta_s theta) $ $ beta_s = cases( 2.61 (omega / omega_p)^1.3 "if" omega / omega_p < 0.95, 2.28 (omega / omega_p)^(-1.3) "if" 0.95 <= omega / omega_p < 1.6, 10^epsilon "if" omega / omega_p >= 1.6, ) $ $ epsilon = -0.4 + 0.8393 exp[-0.567 ln ( (omega / omega_p)^2 )] $ where - $theta_0$ is a wind direction offset ==== Directional Spread Function including Swell (Unfinished) @Empirical-Spectra Swell refers to the waves which have travelled out of their generating area @Empirical-Spectra. in practice these would be the larger waves seen over a greater area. the final function is based on combining the donelan-banner directional spread function with a swell function as below. It is worth noting that, bar the "magic value" of 16 seen in $s_xi$, the spectrum (and thus the simulation) is fully empirical @Empirical-Spectra. $ D_"final" (omega, theta) = Q_"final" (omega) D_"base" (omega, theta) D_epsilon (omega, theta) $ $ Q_"final" = $ $ D_xi = Q_xi (s_xi) |cos (theta / 2)|^(2 s_xi) $ $ s_xi = 16 tanh (omega_p / omega) xi^2 $ where - - $xi$ is a "swell" parameter, in the range $0..1$ ==== Directional Spectrum Function @Empirical-Spectra the TMA spectrum is a directional spectrum, combining the above functions. $ S_"TMA" (omega, h) = S_"JONSWAP" (omega) Phi (omega, h) $ this takes inputs $omega, h$, whilst we need it to take input $arrow(k)$ per Tessendorf @JTessendorf. In order to do this we apply the following 'transformation'. In order to make the function directional, we also need to multiply it be the directional spread function @Empirical-Spectra. $ S_"TMA" (arrow(k)) = 2 S_"TMA" (omega, h) D_"final" (omega, theta) (d omega(|k|)) / (d |k|) 1 / (|k|) Delta arrow(k)_x Delta arrow(k)_z $ #pagebreak() === #text(14pt, [Ocean Geometry & Foam (Unfinished)]) Note that throughout this project we are defining the positive $y$ direction as "up". // other overview ==== the Statistical Wave Summation @Code-Motion @Jump-Trajectory @Acerola-SOS @Acerola-FFT @JTessendorf @Keith-Lantz For a height field, of dimensions $L_x$ and $L_z$, we calculate the height ($h$) at a position $arrow(x)$ by summating multiple sinusoids with complex, time dependant amplitudes. @JTessendorf. The frequency domain representation of the waves are converted to the spatial domain using an inverse discrete fourier transform. This is split into 2 components, with the derivatives computed seperately to find exact normals: $ "Wave Height": h(arrow(x),t) = sum_(arrow(k)) hat(h) (arrow(k), t) e ^ (i arrow(k) dot arrow(x)) $ $ "Horizontal Displacement:" lambda D (arrow(x), t) = sum_arrow(k) -i arrow(k) / abs(arrow(k)) hat(h)(arrow(k), t) e^(i arrow(k) dot arrow(x)) $ $ "Height Derivative": nabla h(arrow(x),t) = sum_(arrow(k)) i arrow(k) hat(h) (arrow(k), t) e ^ (i arrow(k) dot arrow(x)) $ $ "Displacement Derivative": lambda nabla D(arrow(x),t) = sum_(arrow(k))arrow(k) arrow(k)/abs(arrow(k)) hat(h) (arrow(k), t) e ^ (i arrow(k) dot arrow(x)) $ where - $t$ is the time - $arrow(k) = [k_x, k_z]$, the wave vector, direction vector of the spectrum's texture - $arrow(x) = [x_x,x_z]$, the direction vector for the height map for which we are summing - $hat(h) (arrow(k), t)$ is the frequency spectrum function - $h(arrow(x),t)$ gives the vertical displacement vector at the point $x$ at time $t$ - $arrow(D) (arrow(x),t)$ gives the horizontal displacement at $arrow(x)$ at time $t$, used to simulate "choppy waves". We would split the normalised vector $arrow(k)$ into its components and compute them seperately @JTessendorf - $lambda$ is a convenient scale factor "choppiness" in order to create sharper wave peaks @JTessendorf - $nabla h(arrow(x), t)$ gives the rate of change of the height, used to calculate the normal vector - $nabla arrow(D)(arrow(x), t)$ gives the rate of change of the displacement, used to calculate the normal vector ==== Frequency Spectrum Function @JTessendorf @Jump-Trajectory @Acerola-FFT This function defines the amplitude of the wave at a given point in space at a given time depending on it's frequency. The frequency is generated via the combination of 2 gaussian random numbers and a energy spectrum in order to simulate real world ocean variance and energies. $ hat(h)(arrow(k), t) = hat(h)_0(arrow(k)) e^(i omega(|arrow(k)|)t) + h_0 (-k) e^(-i omega(|arrow(k)|) t) $ $ hat(h)_0(arrow(k)) = 1 / sqrt(2) (xi_r + i xi_i) sqrt( S_"TMA" (arrow(k))) $ where - $hat(h)$ evolves $hat(h)_0$ through time using eulers formula. by combining a positive and negative version of the wave number you ensure the functions output is real @JTessendorf - $hat(h)_0$ is the initial wave state as determined by the energy spectra & gaussian distribution. This is only computed on parameter change / startup and then stored into a texture - $epsilon$ are gaussian random numbers defined below - $S_"TMA" (arrow(k))$ is the spectrum function defined above ==== Gaussian Random Numbers @Gaussian @Empirical-Spectra The ocean exhibits gaussian variance in the possible waves. Due to this the frequency spectrum function is varied by gaussian random numbers with mean ($tilde(x)$) 0 and standard deviation ($sigma$) 1. @JTessendorf \ In order to create repeatability, we create pseudorandom numbers for $x$, by by seeding a random number generator with a hash of the wave number truncated to 5 digits, preventing numerical imprecision from changing the seeding @Empirical-Spectra. These are generated in pairs and then stored into the red and green channels of a texture to be accessed. $ 1 / sqrt(2 pi sigma ^2) e^(- ((x - tilde(x)^2))/(2 sigma^2)) $ where - $sigma$ is the standard deviation - $tilde(x)$ is the mean - $x$ is a random number, $-1..1$ ==== The Inverse Discrete Fourier Transform (IDFT) (Unfinished) @Jump-Trajectory @Keith-Lantz @JTessendorf @Code-Motion The IDFT can be computed using the fast fourier transform if the following conditions are met: - $N = M =L_x = L_z$ - the coordinates & wavenumbers lie on regular grids - $N,M,L_x,L_z = 2^x$, for any positive integer $x$ For implementation, the statistical wave summation is represented in terms of the indices $n'$ and $m'$, where $n',m'$ are of bounds $0 <= n' < N$ & $0 <= m' < M$ where - $N,M$ are the number of points & waves respectively, the simulation resolution - $L_x,L_z$ are the worldspace dimensions - $arrow(k) = [(2 pi n) / L_x, (2 pi m) / L_z]$ - $arrow(x) = [(n L_x) / N, (m L_z) / M]$ note that in Tessendorf's paper @JTessendorf, $n$ & $m$ are defined from $-N / 2 <= n < N / 2, -M / 2 <= m < M / 2$, but for ease of implemntation we shift the bounds (and all subsequent values) to begin at 0. I am thus glossing over some redundant information, further details on how / why are seen at @Jump-Trajectory @Keith-Lantz ==== Foam, The Jacobian & Eigenvalues (Unfinished) @JTessendorf @Acerola-FFT @Code-Motion @Empirical-Spectra The jacobian describes the "uniqueness" of a transformation. This is useful as where the waves would crash, the jacobian determinant of the displacements goes negative. Per Tessendorf @JTessendorf, we compute the determinant of the jacobian for the horizontal displacement, $D(arrow(x), t)$. $ J(x) = J_"xx" J_"yy" - J_"xy" J_"xz" $ $ J_"xx" = 1 + lambda (delta D_x (arrow(x)))/(delta x) $ $ J_"yy" = 1 + lambda (delta h (arrow(x)))/(delta y) $ $ J_"yx" = J_"xy" = 1 + lambda (delta h (arrow(x)))/(delta x) $ we then threshold the value such that $J(x) < 0$, storing it into a texture. This is multiplied by a saved foam texture to add some detailing and then an exponential decay function is applied every frame for smooth dissipation. ==== Level of Detail (LOD) Optimisations (Unfinished) @Code-Motion //@Crysis paper they mentioned, acerola video \/\/ i do not want to do this \/\/ will include frustum culling, gpu instancing & LOD scaling based on distance to camera #pagebreak() === #text(14pt, [Post Processing]) ==== Rendering Equation @Atlas-Water @Acerola-FFT @Acerola-SOS This abstract equation models how a light ray incoming to a viewer is "formed" (in the context of this simulation). Due to there only being a single light source (the sun), subsurface scattering @Atlas-Water can be used to replace the $L_"diffuse"$ and $L_"ambient"$ terms. To include surface foam, we _lerp_ between the foam color and $L_"eye"$ based on foam density @Atlas-Water. We also Increase the roughness in areas covered with foam for $L_"specular"$ @Atlas-Water. $ L_"eye" = (1 - F) L_"scatter" + F(L_"sun" L_"specular" + L_"env_reflected") $ where - $F$ is the fresnel reflectance term - $L_"scatter"$ is the light re-emitted due to subsurface scattering - $L_"sun"$ is the color of the sun - $L_"specular"$ is the reflected light from the sun - $L_"env_reflected"$ is the reflected light from the environemnt ==== Normalisation & Vector Definitions @Blinn-Phong When computing lighting using vectors, we are only concerned with the direction of a given vector not the magnitude. In order to ensure the dot product of 2 vectors is equal to the cosine of their angle we normalise the vectors. Henceforth, a vector $arrow(A)$ when normalised is represented with $hat(A)$. throughout all post processing effects a set of distinct vectors are used as are defined: - $hat(H)$ is the halfway vector - $hat(N)$ is the surface normal - $hat(V)$ is the camera view vector - $hat(L)$ is the light source vector ==== Surface Normals (Unfinished) @JTessendorf @Jump-Trajectory In order to compute the surface normals we need the derivatives of the displacement(s), the values for which are obtained from the fourier transform above. $ arrow(N)(arrow(x), t) = vec(- nabla h_x(arrow(x),t), 1, -nabla h_z(arrow(x), t)) $ note that we need to normalise this for actual usage. ==== Subsurface Scattering @Atlas-Water @Acerola-FFT This is the phenomenon where some light absorbed by a material eventually re-exits and reaches the viewer. Modelling this realistically is impossible in a real time context with current computing power. Specifically within the context of the ocean, we can approximate it particularly well as the majority of light is absorbed. An approximate formula taking into account geometric attenuation, a crude fresnel factor, lamberts cosine law, and an ambient light is used, alongside various artistic parameters to allow for adjustments. @Atlas-Water $ L_"scatter" = ((k_1 W_"max" angle.l hat(L), -hat(V) angle.r ^4 (0.5 - 0.5(hat(L) dot hat(N)))^3 + k_2 angle.l hat(V), hat(N) angle.r ^2) C_"ss" L_"sun") / (1 + lambda_"GGX") $ $ L_"scatter" += k_3 angle.l hat(L), hat(N) angle.r C_"ss" L_"sun" + k_4 P_f C_f L_"sun" $ where - $W_"max"$ is the $"max"(0, "wave height")$ - $k_1, k_2, k_3, k_4$ are artistic parameters //explain what each param does - $C_"ss"$ is the water scatter color - $C_f$ is the air bubbles color - $P_f$ is the density of air bubbles spread in water - $angle.l omega_a, omega_b angle.r$ is the $"max"(0, (omega_a dot omega_b))$ - $lambda_"GGX"$ is the masking function defined under Smith's $G_1$ \ ==== Fresnel Reflectance (Schlick's Approximation) @Acerola-SOS @Blinn-Phong @Schlicks @Acerola-BRDF The fresnel factor is a multiplier that scales the amount of reflected light based on the viewing angle. The more grazing the angle the more light is refleceted. $ F(hat(N),hat(V)) = F_0 + (1 - F_0)(1 - hat(N) dot hat(V))^5 $ where - $F_0 = ((n_1 - n_2) / (n_1 + n_2))^2$ - $n_1$ & $n_2$ are the refractive indices of the two media @Schlicks - if using a microfacet model, replace $hat(N)$ with the Halfway vector, $hat(H)$) @Schlicks \ ==== Blinn-Phong Specular Reflection & Vector Definitions @Blinn-Phong @Acerola-BRDF This is a simplistic, empirical model to determine the specular reflections of a material. It allows you to simulate isotropic surfaces with varying roughnesses whilst remaining very computationally efficient. The model uses "shininess" as an input parameter, whilst the standard to use roughness (due to how PBR models work). In order to account for this when wishing to increase roughness we decrease shininess. $ L_"specular" = (hat(N) dot hat(H))^S $ $ hat(H) = hat(L) + hat(V) $ where - $S$ is the shininess of the material ==== Environment Reflections @Acerola-SOS @Blinn-Phong In order to get the color of the reflection for a given pixel, we compute the reflected vector from the normal and view vector. We then sample the corresponding point on the skybox's cubemap and use that color as the reflected color. This method is somewhat simplistic, and not physically based. $ hat(R) = 2 hat(N) ( hat(N) dot hat(V)) - hat(V) $ where - $hat(R)$ is the normalised vector that points to the point on the cubemap which we sample ==== Microfacet BRDF @Atlas-Water @Acerola-FFT @CC-BRDF @Acerola-BRDF This BRDF (Bidirectional Reflectance Distribution Function) is used to determine the specular reflectance of a sample. There are many methods of doing this - the one used here is derived from microfacet theory. $D$ can be any distribution function - the geometric attenuation function $G$ changing accordingly. $ L_"specular" = f_"microfacet" (hat(N),hat(H),hat(L),hat(V)) = (F(hat(N),hat(H)) G(hat(L), hat(H)) D(hat(N),hat(H))) / (4(hat(N) dot hat(L)) (hat(N) dot hat(V)) ) $ where - $F(hat(N),hat(H))$ is the Fresnel Reflectance - $D(hat(N),hat(H))$ is the Distribution Function - $G(hat(L), hat(V), hat(H))$ is the Geometric Attenuation Function ==== GGX Distribution @CC-BRDF @Acerola-BRDF The distribution function used in the BRDF to model the proportion of microfacet normals aligned with the halfway vector. This is an improvement over the beckmann distribution due to the graph never reaching 0 and only tapering off at the extremes. $ D_"GGX" = (alpha ^2) / (pi ( (alpha^2 - 1)(hat(N) dot hat(H))^2 + 1)^2) $ where - $alpha = "roughness"^2$ ==== Geometric Attenuation Function (Smith's $G_1$ Function) @CC-BRDF Used to counteract the fresnel term, mimics the phenomena of masking & shadowing presented by the microfactets. The $lambda_"GGX"$ term changes depending on the distribution function used. $ G_1 = 1 / (1 + lambda_"GGX" (a)) $ $ a = (hat(H) dot hat(L)) / (alpha sqrt(1 - (hat(H) dot hat(L))^2)) $ $ lambda_"GGX" = (-1 + sqrt( 1 + a^(-2))) / 2 $ where - $alpha = "roughness"^2$ ==== Distance Fog & Sun @Acerola-SOS To hide the imperfect horizon line we use a distance fog attenuated based on height. In order to do this we use the depth buffer to determine the depth of each pixel and then based on that scale the light color to be closer to a defined fog color. Finally we blend a sun into the skybox based on the light position. ==== Color Grading (Unfinished) @Acerola-SOS in order to really sell the sun being as bright as it would be on an open ocean, we apply a bloom pass to the whole image. In order to prevent it from being completely blown out we then apply a tone mapping to rebalance the colors. #pagebreak() == Prototyping A prototype was made in order to test the technical stack and gain experience with graphics programming and managing shaders. I created a Halvorsen strange attractor @Halvorsen, and then did some trigonometry to create a basic camera controller using Winit's event loop. #figure( image("assets/chaotic_attractor.png", width: 50%), caption: [ Found at https://github.com/CmrCrabs/chaotic-attractors ], ) == Project Considerations The project will be split into 4 major stages - the simulation, implementing the IFFT, non PBR lighting, and PBR lighting. The simulation will most likely take the bulk of the project duration as implementing the spectrums, DFT and a GUI with just a graphics library is already a major undertaking. I will then implement the Blinn-Phong lighting model @Blinn-Phong in conjunction with the subsurface scattering seen in Atlas @Atlas-Water. Beyond this I will implement full PBR lighting using a microfacet BRDF and statistical distribution functions in order to simulate surface microfacets. finally, I would also like to look into implementing a sky color simulation based on sun position - as this would allow the complete simulation of a realistic day night cycle of any real world ocean conditions. #pagebreak() == Objectives (Unfinished) + Scene + Language & Environment Setup + setup all dependencies + have development shell to ensure correct execution + ensure compatability for all engines + Window & Compatability + ensure compatability with windows, macos & wayland (& X11?) linux + title & respects client side rendering of respective os + Data Structure + talk abt shared data structures + create struct for all variables + camera struct etc + Render Pipeline + list steps and that it works // alot of yap + Event Loop + able to detect mouse movement for camera inputs + able to detect mouse down for camera inputs + escape to close + resize + redraw requested + Simulation + Startup + On Parameter Change + Every Frame + Optimisations + dynamic render scaling stuff + Rendering + Lighting + calculate light / view / halfway / normal vectors + normalise all vectors + fresnel + subsurface scattering + specular reflections + blinn-phong + pbr + microfacet brdf + distribution function + geometric attenuation + env reflections + acerola + LEADR + lerp between this and foam + adjust roughness of areas with foam + Post Processing / Scene + HDRI + Sun + distance fog + attenuation of fog + bloom pass for sun + tone mapping + Interaction + Orbit Camera + zoom + revolve + aspect ratio + Graphical User Interface + select hdri - file picker + parameter sliders + parameter input boxes + parameter checkboxes + toggle between pbr / non pbr lighting + color select wheel (imgui) for parameters #pagebreak() = Bibliography #bibliography( "bibliography.yml", title:none, full:true, style: "ieee" )
https://github.com/jeffa5/typst-acm
https://raw.githubusercontent.com/jeffa5/typst-acm/main/lib.typ
typst
#let show-authors(authors) = { set align(center) for author in authors { box( inset: 1em, [ #author.name \ #author.institution \ #author.email ] ) } } #let show-abstract(content) = { heading(level: 1, "Abstract") content } #let show-bibliography(bibfile) = { bibliography(bibfile) } #let header(conference, title) = { [#conference.name #conference.location #conference.date #h(1fr) #title] } #let show-keywords(keywords) = { [*Keywords: #keywords.join(", ")*] } #let show-acm-meta(copyright, isbn, doi) = { [ #line(length: 100%) #copyright \ ISBN: #isbn \ doi:#link("https://doi.org/" + doi, doi) \ #line(length: 100%) ] } #let sigplan( title: none, authors: (), conference: (name: "Conference", location: "New York", date: "2023"), abstract: none, keywords: (), copyright: "No copyright", isbn: "XXX-X-XXXX-XXXX-X/XX/XX", doi: "XX.XXXX/XXXXXXX.XXXXXXX", bibliography-file: none, content, ) = { set page(numbering: "1", header: header(conference, title)) align(center, text(size: 24pt, strong(title))) show-authors(authors) columns(2, [ #show-abstract(abstract) #show-keywords(keywords) #show-acm-meta(copyright, isbn, doi) #set heading(numbering: "1.") #content #if bibliography-file != none { show-bibliography(bibliography-file) } ] ) }
https://github.com/flavio20002/typst-presentation-minimal-template
https://raw.githubusercontent.com/flavio20002/typst-presentation-minimal-template/main/template/main.typ
typst
MIT No Attribution
#import "../lib.typ": * //#set text(font: "Lato") //#show math.equation: set text(font: "Lato Math") //#show raw: set text(font: "Fira Code") #show: project.with( title: "Minimalist presentation template", sub-title: "This is where your presentation begins", author: "<NAME>", date: "10/08/2023", index-title: "Contents", logo: image("./logo.svg"), logo-light: image("./logo_light.svg"), cover: image("./image_1.jpg") ) = This is a section == This is a slide title #lorem(10) - #lorem(10) - #lorem(10) - #lorem(10) - #lorem(10) == One column image #figure( image("image_1.jpg", height: 10.5cm), caption: [An image], ) <image_label> == Two columns image #columns-content()[ #figure( image("image_1.jpg", width: 100%), caption: [An image], ) <image_label_1> ][ #figure( image("image_1.jpg", width: 100%), caption: [An image], ) <image_label_2> ] == Two columns #columns-content()[ - #lorem(10) - #lorem(10) - #lorem(10) ][ #figure( image("image_1.jpg", width: 100%), caption: [An image], ) <image_label_3> ] = This is a section == This is a slide title #lorem(10) = This is a section == This is a slide title #lorem(10) = This is a section == This is a slide title #lorem(10) = This is a very v v v v v v v v v v v v v v v v v v v v long section == This is a very v v v v v v v v v v v v v v v v v v v v long slide title = sub-title test == Slide title #lorem(50) === Slide sub-title 1 #lorem(50) === Slide sub-title 2 #lorem(50) == Slide title 2 #lorem(50) === Slide sub-title 3 #lorem(50) === Slide sub-title 4 #lorem(50)
https://github.com/protohaven/printed_materials
https://raw.githubusercontent.com/protohaven/printed_materials/main/common-concepts/image_types.typ
typst
= Image Types For computers to work with image data, the image data needs to be _encoded_ in some way so that the computer can understand it. There are many approaches to encoding visual data, but most of them fall into two categories: - raster images, where the image is encoded as a grid of dots - vector images, where the image is encoded as a collection of objects == Raster Images <about-raster-images> Raster images are composed of lots of dots: a rectangular grid of points, each point encoded with color information. If we zoom way in on a raster image, we'll see that it's made up of this grid of dots. In the following image, we can see from the zoomed in portion of the image that it's made up of lots of tiny dots of color: #figure( image("./images/image_types-raster_zoomed.png"), caption: "A small section of a raster image, magnified." ) These dots are often referred to as _pixels_. The number of pixels we have in an image partially determines its quality. The more dots in the image, the better the image will look (to a degree) and the more we'll be able to adapt it for a variety of uses: we can, for example, scale up an image with lots of pixels and still have it look reasonable for most applications. Raster images are useful for rich graphics: photographs, non-technical line art, etc. Raster images are particularly good for photographic material. Raster images are a poor choice for transmitting text (particularly if scaled), or vector art like line drawings, schematics, etc. Common file formats like `.jpeg`, `.gif`, and `.png` are all image raster data. == Vector Images <about-vector-images> Vector images are built from logical instructions. In a raster image, a line might be encoded as a string of dots on the grid. In a vector image, a line is encoded as a logical connection between two points. A nice property of vector images is that they scale very well: they can be re-rendered with precision at any size. In the following image, we can see in the zoomed in portion of the image that there is no loss in precision or quality of the image: #figure( image("./images/image_types-vector_zoomed.png"), caption: "A small section of a vector image, magnified." ) Vector graphics are made of _objects_. The objects in a vector graphics file logically describe the visual contents of the file. For example, the file my specify that at a particular coordinate on the canvas there is a square, filled in with a particular color. The information is not encoded in dots, like a raster image: the image contents are described instead by a collection of objects that describe an image. Vector graphics are useful for any image that requires precision: vector formats are good choices for infographics, technical line drawings, schematics, and similar art. Vector graphics are also useful for any art that has a text component: labels, legends, titles, etc. With a vector graphic, the text is also stored as vectors (the glyphs of the font, or objects derived from it), and the image can be scaled without any loss of quality for the text or the art. Common file formats like `.ai`, `.dxf`, and `.svg` are all image vector data.
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/vercanard/1.0.0/template/main.typ
typst
Apache License 2.0
#import "@preview/vercanard:1.0.0": * #show: resume.with( name: "<NAME>", title: "What you are looking for", accent-color: rgb("f3bc54"), margin: 2.6cm, aside: [ = Contact // lists in the aside are right aligned - #link("mailto:<EMAIL>") - +33 6 66 66 66 66 - 10 Downing Street, London = Languages - French : native - English : C1 - German : B2 = Hobbies - Writing documents in Typst ] ) = Experience #for i in range(3) { entry(lorem(2 + i), lorem(6 - i), "2022-2023") } = Personal projects #for i in range(2) { entry(lorem(2 + i), lorem(6 - i), "2022-2023") } = Education #for i in range(2) { entry(lorem(2 + i), lorem(6 - i), "2022-2023") }
https://github.com/XcantloadX/TypstMomoTalk
https://raw.githubusercontent.com/XcantloadX/TypstMomoTalk/main/test.typ
typst
#let img = image("momotalk/assets/azusa.png", fit: "contain") // #style(styles => { // let block = block( // img, // inset: 0pt, // outset: 0pt, // clip: true, // // width: 50pt, // // height: 50pt, // radius: 100% // ) // let size = measure(block, styles) // scale(block, x: (size.width / 50pt)) // }) #style(styles => { let size = measure(img, styles) // 需要让图像的 x 放大到 let x = (50pt / size.width) * 100% let y = (50pt / size.height) * 100% x = 120% y = 120% [#x, #y] let img = scale(img, x: x, y: y) let block = block( align(img, center), inset: 0pt, outset: 0pt, clip: true, width: 50pt, height: 50pt, radius: 25pt ) block }) // #block( // align(img, center), // inset: 0pt, // outset: 0pt, // clip: true, // width: 50pt, // height: 50pt, // radius: 25pt // )
https://github.com/MDLC01/board-n-pieces
https://raw.githubusercontent.com/MDLC01/board-n-pieces/main/tests/tests.typ
typst
MIT License
#assert( "lib" in sys.inputs.keys(), message: "the path to the library root should be passed as `--input lib=<path>`", ) // Tests to the package's public interface. #include "api.typ" // Tests to the logic. #include "logic.typ"
https://github.com/LDemetrios/Typst4k
https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/foundations/float.typ
typst
--- float-constructor --- #test(float(10), 10.0) #test(float(50% * 30%), 0.15) #test(float("31.4e-1"), 3.14) #test(float("31.4e\u{2212}1"), 3.14) #test(float("3.1415"), 3.1415) #test(float("-7654.321"), -7654.321) #test(float("\u{2212}7654.321"), -7654.321) #test(float(decimal("4.89")), 4.89) #test(float(decimal("3.1234567891234567891234567891")), 3.123456789123457) #test(float(decimal("79228162514264337593543950335")), 79228162514264340000000000000.0) #test(float(decimal("-79228162514264337593543950335")), -79228162514264340000000000000.0) #test(type(float(10)), float) --- float-constructor-bad-type --- // Error: 8-13 expected float, boolean, integer, decimal, ratio, or string, found type #float(float) --- float-constructor-bad-value --- // Error: 8-15 invalid float: 1.2.3 #float("1.2.3") --- float-is-nan --- // Test float `is-nan()`. #test(float(float.nan).is-nan(), true) #test(float(10).is-nan(), false) #test(float(calc.inf).is-nan(), false) #test(float(-calc.inf).is-nan(), false) --- float-is-infinite --- // Test float `is-infinite()`. #test(float(calc.inf).is-infinite(), true) #test(float(-calc.inf).is-infinite(), true) #test(float(10).is-infinite(), false) #test(float(-10).is-infinite(), false) #test(float(float.nan).is-infinite(), false) --- float-signum --- // Test float `signum()` #test(float(0.0).signum(), 1.0) #test(float(1.0).signum(), 1.0) #test(float(-1.0).signum(), -1.0) #test(float(10.0).signum(), 1.0) #test(float(-10.0).signum(), -1.0) #test(float(calc.inf).signum(), 1.0) #test(float(-calc.inf).signum(), -1.0) #test(float(float.nan).signum().is-nan(), true) --- float-from-and-to-bytes --- // Test float `from-bytes()` and `to-bytes()`. #test(float.from-bytes(bytes((0, 0, 0, 0, 0, 0, 240, 63))), 1.0) #test(float.from-bytes(bytes((63, 240, 0, 0, 0, 0, 0, 0)), endian: "big"), 1.0) #test(1.0.to-bytes(), bytes((0, 0, 0, 0, 0, 0, 240, 63))) #test(1.0.to-bytes(endian: "big"), bytes((63, 240, 0, 0, 0, 0, 0, 0))) --- float-from-bytes-bad-length --- // Error: 2-54 bytes must have a length of exactly 8 #float.from-bytes(bytes((0, 0, 0, 0, 0, 0, 0, 1, 0))) --- float-repr --- // Test the `repr` function with floats. #test(repr(12.0), "12.0") #test(repr(3.14), "3.14") #test(repr(1234567890.0), "1234567890.0") #test(repr(0123456789.0), "123456789.0") #test(repr(0.0), "0.0") #test(repr(-0.0), "-0.0") #test(repr(-1.0), "-1.0") #test(repr(-9876543210.0), "-9876543210.0") #test(repr(-0987654321.0), "-987654321.0") #test(repr(-3.14), "-3.14") #test(repr(4.0 - 8.0), "-4.0") #test(repr(float.inf), "float.inf") #test(repr(-float.inf), "-float.inf") #test(repr(float.nan), "float.nan") --- float-display --- // Test floats. #12.0 \ #3.14 \ #1234567890.0 \ #0123456789.0 \ #0.0 \ #(-0.0) \ #(-1.0) \ #(-9876543210.0) \ #(-0987654321.0) \ #(-3.14) \ #(4.0 - 8.0) \ #float.inf \ #(-float.inf) \ #float.nan
https://github.com/janlauber/bachelor-thesis
https://raw.githubusercontent.com/janlauber/bachelor-thesis/main/chapters/system_architecture_and_design.typ
typst
Creative Commons Zero v1.0 Universal
= System Architecture and Design This chapter presents the architecture and design of the One-Click Deployment system, detailing the system overview, architectural components including backend and frontend, database design, and security considerations that underpin the system's effectiveness and efficiency in deploying OSS. == System Overview The following diagram shows how and what the One-Click operator manages. - In #text(red)[red] you see everything responsible for the frontend / pocketbase backend. - In #text(blue)[blue] you see everything which handles Kubernetes natively. - In #text(green)[green] you see what the One-Click operator manages and controls. Every Kubernetes resource will get created and managed within a Kubernetes namespace named with the *project ID* #figure( image("../figures/system-architecture-and-design.png", width: 100%), caption: "System Architecture and Design" ) #pagebreak() The architecture of the solution is designed to operate within a Kubernetes ecosystem, focusing on simplicity and manageability for deploying containers. Here is a high-level view of its main components: - *Frontend Component*: Developed with Svelte, the frontend provides the user interface. Its primary role is to facilitate user interaction and input, which it relays to the backend for processing. - *Backend System*: The backend, powered by Pocketbase, acts as the central processing unit. It interprets requests from the frontend, managing the necessary API calls and interactions within the Kubernetes environment. - *Kubernetes Cluster Interaction*: The backend is responsible for orchestrating various elements within the Kubernetes cluster. A key function includes the creation and management of namespaces, segregating projects to maintain orderly and isolated operational environments. - *Custom Resource Management (Rollouts)*: Rollouts, defined as CRDs (Custom Resource Definitions #footnote[https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/]) within Kubernetes, are managed by the backend. These are central to the deployment and operational processes, serving as bespoke objects tailored to the system's requirements. - *One-Click Kubernetes Operator*: This component simplifies interactions with Kubernetes. It automates the handling of several Kubernetes native objects and processes, including deployments, scaling, and resource allocation. The operator is crucial for streamlining complex tasks and ensuring efficient system operations. - *System Scalability*: The architecture is designed with scalability in mind, using Kubernetes' capabilities to handle a range of workloads and adapting as necessary for different project sizes and requirements. This architecture aims to streamline the deployment process for OSS containers, offering an efficient and manageable system that leverages the strengths of Kubernetes, Svelte and Pocketbase. #pagebreak() == Architecture Design The system architecture is modular, comprising distinct backend and frontend components, and is built on a microservices architecture principle to ensure scalability, maintainability, and ease of updates. === Backend Architecture The One-Click System leverages the open-source backend platform Pocketbase to manage authentication, data storage, and serving the frontend interface. In the release process, Pocketbase and frontend code are compiled together into a single container image, which is then pushed to the Github container registry, streamlining the deployment process. Pocketbase's flexibility allows for the extension of its capabilities with custom Golang code. This feature is utilized to listen for specific events, upon which custom logic is executed, including making Kubernetes API calls and managing the Kubernetes resources initiated through the frontend interface. The project's code, demonstrating these integrations, can be accessed at: \ \ #link("https://github.com/janlauber/one-click/tree/main/pocketbase") ==== Authentication Using JWT tokens, Pocketbase handles authentication processes efficiently. Upon receiving user credentials, the backend verifies them and returns a JWT token for successful authentications. This token is then stored in the local storage by the frontend and used for subsequent requests to the backend. The system also supports authentication through various providers, including Google, GitHub, and Microsoft, with the frontend dynamically displaying login options based on the enabled providers in Pocketbase. #pagebreak() ==== Database UML The system's database structure is visualized using the PocketBaseUML tool, providing a clear representation of the data model and relationships. #figure( image("../figures/pocketbase-uml.png", width: 100%), caption: "Database UML" ) #emph[Diagram created with the pocketbase uml generator] #footnote[https://github.com/pocketbase-uml/pocketbase-uml.github.io] ==== Custom Endpoints Pocketbase's capability to create custom endpoints is extensively utilized to facilitate frontend interactions. These custom endpoints, defined in the *main.go* file, support various operations, from serving the frontend and backend to fetching rollout metrics and managing Kubernetes resources. Each endpoint enforces JWT authentication to ensure secure access, except for the websocket endpoints, which are designed for real-time updates and logs. ==== Environment Variables A set of environment variables is defined to configure the system's operation, such as specifying local deployment settings and configuring the auto-update feature's checking frequency. === Frontend Architecture The frontend of the One-Click Deployment system is thoughtfully designed to offer a dynamic, user-friendly interface, allowing for an intuitive experience in managing open-source software deployment processes. Built on SvelteKit and augmented with TypeScript, it employs Tailwind CSS for styling and incorporates Flowbite-Svelte for UI components. The frontend leverages the Pocketbase JavaScript SDK for seamless backend interaction. Notably, the frontend's entire codebase—comprising JavaScript, HTML, and CSS—is compiled into optimized static files. These static assets are then served in conjunction with the Pocketbase backend within the same container, highlighting the system's streamlined deployment strategy. ==== SvelteKit #footnote[https://kit.svelte.dev/] Utilizing SvelteKit as the frontend framework enables the One-Click Deployment system to harness Svelte's reactivity and SvelteKit's versatility for building sophisticated web applications. SvelteKit's support for server-side rendering, static site generation, and single-page applications ensures that the frontend is fast, responsive, and accessible across all devices and network conditions. ==== TypeScript #footnote[https://www.typescriptlang.org/] TypeScript brings type safety to the development process, enhancing code reliability and maintainability. It helps in identifying and preventing potential issues early in the development cycle, facilitating easier code management and contributing to a more robust application. ==== Tailwind CSS #footnote[https://tailwindcss.com/] and Flowbite-Svelte #footnote[https://flowbite-svelte.com/] The combination of Tailwind CSS's utility-first approach with Flowbite-Svelte's component library enables rapid, customizable UI development. This setup allows for the quick implementation of a visually appealing and responsive design that aligns with current web standards. ==== Pocketbase JavaScript SDK #footnote[https://github.com/pocketbase/js-sdk] The frontend extensively uses the Pocketbase JavaScript SDK to communicate with the backend efficiently. This SDK simplifies making API requests, managing authentication, and performing CRUD operations, ensuring that the frontend and backend interactions are smooth and secure. ==== Svelte Flow #footnote[https://svelteflow.com/] Svelte Flow is a powerful library for building node-based and interactive diagrams. It is used in the frontend to visualize the deployed resources and their relationships, providing users with a clear overview of their projects and deployments. ==== Compiled Static Assets A key feature of the system's frontend architecture is the compilation of its codebase into static assets. This process transforms the JavaScript, HTML, and CSS into highly optimized files that are ready for deployment. These compiled static assets are then served alongside the Pocketbase backend within the same container. This approach ensures that the deployment of the frontend is not only efficient but also simplifies the overall system architecture by bundling both frontend and backend together. This method of serving compiled static assets alongside the backend within the same container streamlines the deployment and hosting process, eliminating the need for separate setups for the frontend and backend. It encapsulates the essence of operational efficiency and ease of use, key principles that guide the design and implementation of the One-Click Deployment system. If needed, the frontend could also get separated from the backend and hosted independently. #pagebreak() == Security Considerations Security is a paramount concern in the system's design, incorporating best practices to safeguard user data and deployed applications. - *Authentication and Authorization*: Implements secure authentication mechanisms, such as OAuth2, and role-based access control (RBAC) to ensure that users can only access and manage their projects. - *Data Encryption*: Data at rest in the database and data in transit between the client and server are encrypted using industry-standard encryption algorithms. This is also a key feature of Pocketbase. #footnote[https://pocketbase.io/docs/going-to-production#enable-settings-encryption] - *Regular Updates and Patch Management*: The system architecture is designed to facilitate easy updates and patches, ensuring that all components remain secure against known vulnerabilities. This is achieved through automated update checks, notifications and pull requests by the Github Dependabot. @mullansKeepAllYour2020 - *Secure Development Practices*: Adheres to secure coding practices and regular security audits to preemptively address potential security issues.
https://github.com/Fr4nk1inCs/typreset
https://raw.githubusercontent.com/Fr4nk1inCs/typreset/master/src/utils/font.typ
typst
MIT License
/* Font settings for all presets */ #let base-font = "Linux Libertine" #let math-font = "Libertinus Math" #let i18n-fonts = ( "zh-cn": body => { show math.equation: set text(font: ("Libertinus Math", "FandolSong")) set text(font: (base-font, "FandolSong"), lang: "zh") show emph: set text(font: (base-font, "FandolKai")) body }, ) #let set-font(lang: "en", body) = { if lang == "en" { set text(font: base-font, lang: "en") body } else if lang in i18n-fonts.keys() { show: i18n-fonts.at(lang) body } else { assert(false, message: "Font for language " + lang + " not supported") } }
https://github.com/spherinder/ethz-infk-thesis
https://raw.githubusercontent.com/spherinder/ethz-infk-thesis/master/src/abbreviations.typ
typst
#import "dependencies.typ": print-glossary, register-glossary #set heading(numbering: none) = Abbreviations #let entry-list = ( ( key: "cpu", short: "CPU", long: "Central Processing Unit", ), ( key: "freedom", short: "freedom", description: "Freedom is the power or right to speak, act and change as one wants without hindrance or restraint. Freedom is often associated with liberty and autonomy in the sense of \"giving oneself one's own laws\"", ), ) #register-glossary(entry-list) #print-glossary(entry-list, disable-back-references: true)
https://github.com/MasterTemple/typst-wasm-plugin-template
https://raw.githubusercontent.com/MasterTemple/typst-wasm-plugin-template/main/README.md
markdown
# Typst WASM Template ## Explanation - I wanted to create a template for myself to start other plugins from. - The [wasm_macro](https://github.com/astrale-sharp/wasm-minimal-protocol) code comes from https://github.com/astrale-sharp/wasm-minimal-protocol. - I adapted it into a structure I think is easier. ## Running ```bash wasm-pack build --target web ``` ## Tips If you had data in a JSON file and you want it compiled into the .wasm file do this: ```rust const DATA_JSON: &str = include_str!("data.json"); ```
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/031%20-%20Hour%20of%20Devastation/007_Endure.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Endure", set_name: "Hour of Devastation", story_date: datetime(day: 19, month: 07, year: 2017), author: "<NAME>", doc ) #emph["The world crumbled beneath the heel of the mighty God-Pharaoh, and an unnamed hour dawned as the blood red sun drowned the land in crimson. And thus, the Hour of Devastation reigned, and, the God-Pharaoh completed his great plan, leaving behind ruin while darkness consumed and unmade the entirety of the city."] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Samut ran. #figure(image("007_Endure/01.jpg", width: 100%), caption: [Blur of Blades | Art by <NAME>], supplement: none, numbering: none) Behind her, the small band of survivors followed. Djeru kept pace with the slowest of the group, guarding their backs. #emph[Escape the city. Get to the desert.] Hazoret's command burned at the back of Samut's thoughts as they moved. She and Djeru had obeyed the god, parting ways with Hazoret and striking out toward the edges of the city. They had grown in number as they traveled, other survivors joining to fight together. They had shrunk in number as god-fueled destruction crumbled the city around them. #emph[Get to the desert.] #figure(image("007_Endure/02.jpg", width: 100%), caption: [Endless Sands | Art by Noah Bradley], supplement: none, numbering: none) The endless dunes and strangling sands had long been symbols of death and danger to the people of Naktamun, and a personal reminder of folly and loss for Samut. Yet now, the desert was her people's last hope for survival. The rag-tag group approached a building just a short distance from where the Hekma had stood only hours before. Once a barracks for the viziers of Kefnet who helped maintain and repair the barrier, the building looked utterly abandoned, save for a few small clusters of locusts that clung to various surfaces. Samut gestured for the others to take shelter behind a wall. She scrabbled up the rough stone, climbing to the roof for a better vantage. Before her, the deserts of Amonkhet stretched to the horizon. Winds drove sheets of sand through the air, and the rippling dunes cast strange shadows. Samut couldn't tell if they were shifting due to the light, the wind, or because they hid some unknown horror. She knew that other ruins lay buried beyond the city, places where they could possibly hide temporarily for shelter—but beyond that, she was at a loss. Hazoret still believed that the God-Pharaoh might come to save them from the darkness. Some in their group seemed to believe the same, still invoking the God-Pharaoh in their battle cries or whispering prayers for his return to fix what had gone wrong. But Samut knew the truth. A series of cries rang out from below her. Samut looked down to find all the survivors pointing back toward the city. In the sky, a dark void appeared, and from its unfathomable depths, a massive golden figure appeared. For a moment, Samut's brow crinkled in confusion. Then she saw the being's golden horns. The blood drained from Samut's face. #emph[He has arrived.] #figure(image("007_Endure/03.jpg", width: 100%), caption: [<NAME>, the Deceiver | Art by <NAME>], supplement: none, numbering: none) Some in their party cheered. Some started running back toward the heart of the city, toward the distant God-Pharaoh. That was when the dragon raised his hands, and black fire fell from the skies. Samut yelled above the noise, urging the survivors into the enclave behind them. She suppressed her despair as she watched a streaking blast of flames annihilate a young minotaur running back toward the group. She dashed out to scoop an aven girl into her arms, running with the child back toward shelter, pushing her to join the others. Once everyone was inside, she followed. Djeru was herding folks into the center of the room, away from windows and doorways. The shuddering sound of blasts hitting walls and other buildings reverberated through their bones, punctured only by the quiet sobs of the young. "Why—why would the God-Pharaoh—" a naga youth, barely of age to be a disciple by Samut's guess, stammered and stared wide-eyed at those around him. "The God-Pharaoh is a lie." Samut spoke loud enough for the room to hear. "He is no great redeemer. He is a trespasser, an interloper from another world." "That—that can't be true. That . . . #emph[beast] cannot be our promised God-Pharaoh." A tall, barrel-chested man pushed his way forward. Samut recognized him as Masikah of the Ahn crop. "Do your eyes not see, your ears not hear? Does your heart not feel? The death of our gods! The destruction of our city! This spell of hellfire, from the very claws of the God-Pharaoh himself!" Samut spoke with icy conviction, staring straight at Masikah. A voice cried out from the crowd. "We have been betrayed! Our gods have been betrayed!" Angry shouts of agreement rippled across the assembled group. "The dark gods are his harbingers, not his adversaries." Samut put an arm on Masikah's shoulder. "We must confront the truth and fight to survive." Samut turned and addressed the crowd, looking each survivor in the eye. "I have uncovered the erased histories of our people. I have seen the ruins and hidden places in the sands." Samut's words softened as she spoke. "I had hoped that I was wrong, that I was mad, that the heresies I found were not true. But all of my worst fears have come to pass." The survivors murmured among themselves. Some faces hardened with anger, while others turned to Samut, waiting for her next words. She opened her mouth to speak when a sharp, stabbing pain pierced her chest. Samut doubled over, sucking in breath through clenched teeth. As she looked up, she saw all the survivors clutching their chests, their faces frozen in stunned shock. One of the younger survivors vomited. #emph[Which one had fallen?] Samut chose her words with purpose. "Four of our gods are now dead. Yes, four," she said, shouting above the moans and wails from the survivors. Some shook their heads, denying the truth Samut just spoke aloud. Others simply gazed off into space, stunned into silence. Samut pressed on. "I live for the glory of my gods. I reject the lies of the false God-Pharaoh. We must stand and protect what's ours. We must survive. We must defy the great trespasser." "I stand with her." Samut turned, surprised, her chest tight with emotion. Djeru stood from where he had been comforting a young survivor and faced the crowd. "Samut is my oldest friend. I, more than anyone, thought her words were vile heresy when she first spoke against the God-Pharaoh. But I have seen more than I needed to realize she speaks truth." An uneasy silence fell over the group, broken by the young naga boy. "What do we do now?" he asked, looking around at those near him. "What #emph[can] we do?" wailed a voice among the crowd. Murmurs of agreement rippled through the survivors. Another voice cut through, clear and bold. "A good question. What can we do against dark gods who slay divinity, against a dragon who rains fire from the skies?" A few survivors stepped aside as Hapatra strode forward. Samut looked to Djeru then back to the vizier before replying. "Hazoret asked that Djeru and I protect those we could—to hide among the desert sands. To survive. We defy the trespasser by living." Some heads nodded in agreement. Samut drew her twin khopeshes. "But I am going back into the city." She strode to the door, then turned to address the room. "I would not ask any of you to come with me. Escape and survival would be honoring the wish of our god, and would be a brave act in defiance of the trespasser." Samut's voice cracked as she continued speaking. "But I cannot bear the death of another god. Though Hazoret wished for us to flee, I will return because I must try to protect that which has protected me my entire life." Djeru drew his weapon as well. "I will go with you, sister." He turned to address the crowd. "We, the children of the gods, have never feared death. I was glad to give my life in dedication to the glorious after. Now I am proud to give it in defense of the divine." Other warriors stood, drawing blades, readying staves, their faces set in grim determination. "I will not go with you." Hapatra spoke, and all turned to listen. "Though my heart yearns for even the faintest chance to avenge my Rhonas's death, I know my poisons would better serve to pave the path for the living." She drew her dagger and held it to her chest in a salute, a small snake winding its way from her sleeves up her arm. "I am Rhonas's broken fang, and I know where to strike to stop the undead and the monstrosities in their tracks. I will strike down all that would threaten our people as we seek refuge amongst the sands." Hapatra stared at Samut with burning intensity. "I trust the safety of our god to your hands, Samut." Samut returned the gesture with her khopeshes. "Knowing our strengths and sacrificing our wishes for the welfare of others is not easy. Thank you for your bravery." She turned to the others and raised a blade in the air. "The rest, to me! We will find and protect our last god!" #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Samut clenched her teeth. #emph[They're unstoppable.] #figure(image("007_Endure/04.jpg", width: 100%), caption: [Djeru's Renunciation | Art by <NAME>], supplement: none, numbering: none) Even as Djeru smashed two of them back, a third charged forward, spear at the ready. Samut cried out as Djeru parried the jab from the lazotep-coated minotaur's spear. She dashed in and smashed her khopeshes against the undead warrior, leaving two jagged gashes along his chest. The blow didn't seem to affect the minotaur at all as he spun, knocking Djeru and Samut back with a powerful roundhouse kick. As she scrambled to her feet, Samut noted that only four other fighters remained; the rest had fallen to the endless stream of eternalized warriors. The cruel joke of the promised Hours nagged at Samut's thoughts. #emph[The Hour of Eternity—when the worthy dead shall rise again to a glorious afterlife.] Samut grimaced. #emph[If "glorious afterlife" meant slaughtering everything you once held dear.] The minotaur conjured an angry flame that engulfed the head of its spear. Djeru shuffled closer. "I . . . I've never seen the undead cast spells before," he said. "I've never seen the corpses of our slain champions imbued with lazotep then unleashed on the city before," Samut said. "It is a day of firsts." Djeru grinned. "Lucky us." "If these are our past champions, then this must be #emph[him,] " Samut said. Djeru and Samut stepped back as the minotaur approached, his spear spinning in one hand behind him, creating a dizzying pattern of light. Djeru nodded. The brutal champion with a spear of flame: it could only be Neheb the Worthy, a legendary initiate skilled in magic and combat alike. He had passed the Trials when Samut and Djeru were mere children. "The greatest warrior of a generation," their trainers had told them. "Fight like Neheb," their sparring instructors had said. #figure(image("007_Endure/05.jpg", width: 100%), caption: [Neheb, the Eternal | Art by Chris Rahn], supplement: none, numbering: none) "This is a fool's errand," Samut whispered to Djeru, adjusting her grip on her weapons. Djeru shifted his stance, keeping an eye on Neheb. "We can take him, sister." "To what end? We cannot hope to defeat all the returned champions of Amonkhet. We should be finding the last remaining god." Neheb swung his spear forward, sending a wave of flame at Samut. Samut dodged out of the way, but Neheb was already charging in, spear thrusting at Djeru's chest. Djeru held his blade up to parry and the minotaur pressed forward, closing the distance and bringing a powerful fist smashing into Djeru's face, knocking him sprawling. Samut let out a roar and charged, khopeshes swiping down in an overhead strike. Neheb countered with a swift kick to her stomach. The blow knocked her back and left her gasping for air. In a blink, Neheb took advantage of his opening and charged at Djeru, spear raised to pierce the prone warrior. A flash of light dazed all the fighters present. Samut leaped to her feet to find the interloper Gideon standing between Neheb and Djeru, the golden glow of his invulnerability stopping the minotaur's fiery spear. Around him, the other four interlopers charged forward, spells flying as they assaulted the Eternals. Neheb struck blow after blow against Gideon, but nothing pierced the golden light. Samut seized her opportunity. She sprinted toward the Eternal minotaur and stabbed him in the back with both khopeshes, knocking him to the ground. The blades cracked through the lazotep, leaving deep gouges. She drew her weapons back and stabbed again, this time piercing the base of its neck. Neheb—or rather, the monstrosity that once had been Neheb—twitched and spasmed briefly, before finally laying inert. #emph[So they can be destroyed,] Samut thought. She looked around to see the other interlopers dispatching the remaining Eternals. The one with the pointy ears and unnerving green eyes—#emph[Nissa] —was helping some of the injured warriors, healing cuts and wounds. Djeru stood and clapped a hand on Gideon's back. "That is the second time today that you have saved me. The first time, I was furious. Now, I am grateful." Gideon started to reply, but Jace cut him off. "We're wasting time and energy here, Gideon. Bolas remade this place in his image. He has the advantage here. We must approach carefully. But the longer we delay, the more time we give Bolas to prepare for us." #figure(image("007_Endure/06.jpg", width: 100%), caption: [Strategic Planning | Art by <NAME>], supplement: none, numbering: none) "Agreed," Liliana said. "I'm certain he already knows we're here." Samut wondered how the woman's dress came to be soaked in blood—and how she still managed to look elegant and poised despite this. "We bring the fight to him, then." Gideon strode forward, but Samut caught his hand. "I shall come with you," she said. Gideon hesitated. Djeru stepped in. "We will not, Samut. We will stand down." Samut's temper flared. "How could you say that, Djeru? If they intend to slay the trespasser, the one responsible for #emph[all of this] —" "Then we will support them by getting out of their way." Samut fumed, but Djeru held up a hand. "You are a far stronger fighter than I, Samut." Djeru shook his head at Samut's half-formed objection. "Others may speak of us as equals, but you and I know the truth. There is only one thing that I do better than you: seeing the potential of those around me." Samut thought back to Djeru's leadership of their crop, his intuitive knowledge of each member's skills and weaknesses, and fell silent. Djeru continued. "A wise warrior once said, 'Knowing our strengths and sacrificing our wishes for the welfare of others is not easy.'" Samut rolled her eyes. "Don't think flattery will win me over, brother." "The interlopers must strike down the God-Phara—the trespasser." Djeru looked toward the great horns in the distance, toward the second sun perched at its zenith between them. "We must stay true to our course. Find the last god of Amonkhet, protect her, and protect the people of our city." Samut glared at Djeru, then sighed. She clasped his arm, and brought him close for an embrace. "I am grateful to have you with me again, Djeru." She looked to the interlopers, five strangers, bearing strange markings and wielding foreign powers. She did not know if she believed in them or their ability to bring the trespasser low. She looked each of them in the eye as she spoke. "For what he did to my people, my gods, my world—slay him. Slay the great destroyer. Slay the dragon trespasser. Slay <NAME>." #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Samut was not accustomed to stealth or to following. After leaving the interlopers to plot their battle with the dragon, Samut, Djeru, and their small band had picked up a few more survivors. The roaming bands of Eternals seemed to be thinning—but only because the living denizens of the city had either died; escaped; or on extremely rare occasion, hid well enough to survive. The streets of Naktamun were strangely quiet, broken by the occasional buzz of locust wings and the shuffles and groans of roaming corpses raised by the Curse of Wandering. Ahead of Samut, a young vizier of Hazoret led the way. Introducing himself as Haq, the vizier had told Samut and Djeru of the battle he had witnessed between Bontu and Hazoret, of Bontu's betrayal and the God-Pharaoh's ultimate cruelty. The vizier couldn't have been older than fourteen, no more than a year or two into his tenure, yet he spoke with a calmness and eloquence that belied his years. "After Bontu fell, the scarab god woke the Eternals and attacked the city," Haq had said. "I had enough time from my vantage at Hazoret's temple to flee, but in the ensuing bedlam, I lost track of Hazoret." As a vizier of Hazoret, though, his heart beat as one with his god, and he could sense her presence faintly. He was tracking her movements, trying to reach her, when a roaming band of mummies trapped him in a storehouse. He had hidden within the barrels of salted fish until Samut's band happened by. Now the boy led the group with Samut right behind. Samut prayed quietly that they would reach Hazoret in time, then stopped. It seemed strange to pray to the deity you were trying to save. Haq led the survivors down a path at the foot of a massive monument, turned a corner, then froze. As the rest of the group rounded the corner, everyone gasped. Rhonas's body lay inert on the ground. Some of the survivors fell to their knees. Others approached slowly, hands outstretched, desperate to disprove the reality before them. But trembling fingers met solid golden scales and divine robes. The finality of his death washed over the survivors. Tears, angry cries, and quiet embraces followed. Djeru approached the god, kneeling and placing a hand on the god's face. Anger again bubbled in Samut's gut, and she approached the fallen body of Rhonas. She climbed up his chest, drawing gasps from some of the others, and stood. "Brothers. Sisters. We mourn. But we will endure. If you believe the God-Pharaoh tests you, charge with me to prove yourself. If you believe he betrayed us all, join with me to fight for tomorrow. We will embody the strength Rhonas taught us and gifted us, through his teachings and his Trial!" #figure(image("007_Endure/07.jpg", width: 100%), caption: [Life Goes On | Art by Daarken], supplement: none, numbering: none) The survivors around her cried out in solidarity, faces hardening from grief to anger. Suddenly, Djeru stood, his eyes glued to the horizon. "Samut. I think we should seek out shelter," he said. Samut squinted where he looked. From the direction of the Gate to the Afterlife, a massive sandstorm was sweeping in. In the past, such a storm would've crashed into the Hekma, harmlessly rippling against the barrier—but with the Hekma gone, the swirling sands and howling winds approached with alarming speed, a solid wall of dust and darkness. Samut called out to the survivors and turned to retreat the way they had come. But Haq suddenly grasped Samut's hand, pointing in front of him, straight into the storm. "Sister. Hazoret comes. She is not alone." Samut looked at the boy, then drew her khopeshes. "Warriors. Brace yourselves. Stand ready!" The survivors drew their weapons and pulled cloths over mouths and faces. Several ducked behind the monument wall for some shelter. Samut, Djeru, and Haq stood where they were, leaning in as the storm swept over them. The stinging sands nipped at them through their clothes and armor. The three held their arms over their eyes, feet braced against the buffeting winds. Everything dimmed to a semi-darkness, the sand thick enough to filter out most of the twin suns' light, the roar of the wind blocking out any other sounds. Then Samut saw it: a large shadow approaching in the gloom. The silhouette grew, sharpening into a clearer shape, and soon came the sound of massive feet running. And then Hazoret emerged from the clouds of sand, and Samut again felt her heart surge at the sight of the god. Her excitement immediately dampened as she took in what she saw. Hazoret did not look well. She gripped her spear in one hand, while the other dangled oddly by her side. Gashes and wounds decorated her golden body, and the god's breath came labored and frequent. "Hazoret! We've come for you!" Haq cried out above the storm. Samut watched Hazoret turn and gaze toward them, face flickering from determination to surprise. #strong[Run.] The command echoed in Samut's head with the force of an order, and Samut staggered back several steps before seizing control of herself. Hazoret's attention had already turned back behind her, and with a jolt, Samut realized that the towering gloom she had thought was just the rest of the storm was actually a much larger shadow. A scorpion's tail pierced through the haze, and Hazoret parried the strike, dodging to the side as the massive form of the scorpion god crashed into sight. #emph[She's slow,] Samut noted. #emph[Sluggish. And fighting one-handed.] Yet even so injured, Hazoret moved with power and purpose. The scorpion god turned to grasp at her, but Hazoret disappeared in a burst of flame and sand. The scorpion god's mandibles clattered, and Samut watched it swerve and lurch back into the gloom, following Hazoret by some unknown sense. "She's casting a spell," Haq said. Samut looked at the ground where Haq pointed and saw a small ring of fire flickering, buffeted in the wind. In the darkness, through the sands, Samut saw other little glowing points of light emerge as the sounds of titanic blows continued. "Warriors! Fall back!" Djeru cried, backing away from the fiery circle. Samut and Haq followed suit, and the survivors ran for cover behind the monument they passed earlier. The air crackled with energy, and an enormous pillar of flame erupted in the storm, hungry tongues of fire fed by the winds, licking through the sand. The air itself seemed to burn as the spiraling flames created a massive, undulating column of fire as tall as any of Naktamun's grandest monuments. The heat of the blaze blistered the exposed skin of the survivors and seemed to burn away the sandstorm, the twisting fiery spell consuming all in its radius. Samut held a hand up against the heat, peering toward the flame. Silhouetted against the red-orange glow was Hazoret. She held her spear in her one good hand, pointing at the burning pyre, her arm shaking with concentration. Moments crawled by, and Hazoret finally dropped her arm. The flame pillar persisted as the god fell to her knees, leaning against her spear to stay upright. "She . . . she caught it in the flame trap," Haq whispered. And indeed, as the fires slowly burned out, Samut could make out the scorpion god's form standing at the center of the blaze, its carapace glowing white hot. "It cannot still be alive," Djeru breathed. But the scorpion god took a halting step forward, arm outstretched toward Hazoret. Then another step. And another. And its carapace cooled from white to orange, then slowly to charred black. Still it approached, regaining momentum and purpose with each step. Hazoret looked up and moved to stand, but stumbled, falling back to her knees. And the scorpion god ran forward. The flash of a tail. The sickening sound of stinger piercing flesh. #figure(image("007_Endure/08.jpg", width: 100%), caption: [A Reckoning Approaches | Art by Yeong-Hao Han], supplement: none, numbering: none) Samut stared, stunned. Hazoret had whipped her body around, blocking the scorpion god's blow with her deadened arm. The scorpion god pulled its stinger back, and Hazoret cried out in pain. She rolled backward away from the scorpion god's second strike. Samut watched with horror as green ichor glowed and crawled up Hazoret's limb, creeping its way toward the god's body and heart. Hazoret's spear glowed with heat. A swing of its bladed edge. The sizzle of flesh. A small mist of blood evaporated in the air as the molten edge cauterized the cut. Hazoret crouched, panting hard, blood seeping from the wound that had saved her life. Before her, her severed arm blackened, the poison consuming the flesh. And again, the scorpion god approached. Samut let out a primal scream and sprinted forward, terror and rage and pain and heartbreak melting into molten strength. Behind her, she was faintly aware of Haq and other mages readying spells. In front of her, the impossible height of the scorpion god loomed. She was tiny. She was inconsequential. And she did not care. Instinct seized Samut as she channeled magical power to her legs. She #emph[leaped ] into the air, launching herself flying over Hazoret and toward the dark god, khopeshes gripped with blades pointing downward. She smashed into the scorpion god's side, and her blades #emph[pierced ] its carapace, lodging there and giving her a temporary handhold. Surprise turned to epiphany as she realized that the molten heat from Hazoret's spell must have softened the god's impenetrable shell. Samut laughed, a blend of battle rage and utter joy. She gave her blades a shake and a jolt, sliding #emph[down ] the god's body, gravity lending momentum to her descent. She swung her feet out and carved across the god's ribs towards his abdomen, her blades slicing through the heated carapace like an ibis cutting through a clear blue sky. The scorpion god roared and swatted at her, an insect-like god trying to squash an insect-like human. But Samut pulled her blades loose and launched herself again, kicking off his chest, her khopeshes biting into the god's arm. She cut a thin line through his shell before the god flicked her off with a shake of his hand. A cloud of sand softened Samut's crash landing. As she stood, slightly dazed, a minotaur mage approached, hands aglow with power, now shaping the sands into a dense mass, pummeling at the scorpion god's legs. Beside him, other mages launched bolts of fire and blasts of lightning at the god. "Samut! Push it toward the river!" Djeru's cry carried across the distance, and Samut spotted him running with two other warriors towards a cluster of obelisks in the distance. A genuine grin flashed across Samut's face as she realized Djeru's plan. "To me!" she cried, and the remaining survivors from their band charged forward, following her lead. The mortals battled with the weakened god, battering it with blows and spells. An aven screeched as it was snatched out of the air, crushed in the god's grip. A warrior wielding twin axes disappeared underfoot, the god's step obliterating him where he stood. A spray of venom from the god's tail caught several mages by surprise and they collapsed in the acrid pools. #figure(image("007_Endure/09.jpg", width: 100%), caption: [Torment of Venom | Art by Johann Bodin], supplement: none, numbering: none) But the mortals chipped away at the god, their blows battering its melted carapace. And they succeeded in pushing it back, ever closer to the field of obelisks. The scorpion god raged, lashing out at the combatants barraging it with spells, arrows, and spears. Behind it, Djeru stood at the ready with a few others, partially hidden behind a half-toppled obelisk. #emph[So close] , Samut thought, surveying the battle. But the scorpion god managed to hold its ground just a touch too far from Djeru's waiting trap. "We need to push it back! Just a little further!" Samut shouted. From behind her, Samut heard a clear voice ring out. "Dark god! For Rhonas, I will strike you down." She turned, and the sight took Samut's breath away. #figure(image("007_Endure/10.jpg", width: 100%), caption: [Gift of Strength | Art by <NAME>], supplement: none, numbering: none) A lone khenra stood, hoisting Rhonas's staff into the air, the weapon magically reforged into one. Her hands glowed with golden power, some last vestige of the god's strength coursing through her body, and she ran forward with the staff held high overhead. Samut and the other survivors dove out of the way as the khenra passed. With a mighty roar, the khenra swung the staff at the scorpion god. The god raised its arms to block the blow, but the force of the strike knocked it careening back. Fragments of carapace fell from its arms, shattered into pieces. At that moment, Djeru and his team ran forward, a rope held taut between them, tripping the Scorpion God as he fell back toward the obelisks, their pointed ends suddenly a field of daggers for the enormous god. But Samut could see the arc of the god's fall and the angle of the obelisks would not align. Without a word, she once again dashed forward and leaped, propelled by magical force, smashing into the falling god tipping him to the right, just the right amount, and an earth-shattering crunch echoed across the battlefield as the obelisk #emph[pierced ] the scorpion god's chest. #figure(image("007_Endure/11.jpg", width: 100%), caption: [Puncturing Blow | Art by <NAME>], supplement: none, numbering: none) The assembled survivors let out wild cheers, but Samut simply watched the god with grim suspicion. The god twitched and clawed feebly at the obelisk protruding from its chest, but it did not cease moving. Whatever power beckoned it to stalk and kill still pulled at its broken body, still commanded its tail to lash out weakly. "#strong[Thank you, my children.] " Hazoret limped toward the scorpion god, leaning on her staff as a cane, young Haq walking beside her. The survivors surged toward Hazoret, but she shook her head. "#strong[You all have done more than I could have asked. More than any mortal has. But this task I must finish myself.] " Samut, Djeru, and the others stepped back as Hazoret approached the scorpion god, still struggling weakly. Hazoret looked upon the massive beast, tears glistening on her face. "#strong[You have slain my brothers and sisters. But I know it was not by your wish or design. Rest now, brother. May my fires free you from this form and these dark shackles.] " With a jab, Hazoret pierced the scorpion god with her two-pronged spear, right where the obelisk protruded from its shell. Rippling heat emanated from her, and black smoke billowed forth from the scorpion god as it burned from the inside until its outer carapace collapsed inward, the god reduced to cinders and ash. At last, Hazoret drew back her spear and thrust it into the ground. The god looked about until she spotted Samut, then knelt before the mortal. Samut stood, stunned. Hazoret reached out a large hand, and Samut raised her own hands, grasping Hazoret's finger, feeling the warm and healing glow of the god before her. #strong[In the arena, Samut, you told me that you believed that I was not what I was forced to do—that I would protect my children when you all needed me most.] Samut looked into the eyes of her god and smiled. "You have, Hazoret. And I thank you." Hazoret shook her head. #strong[I could not have done so without you. You, my beloved children, protected me when I needed you the most.] #strong[My heart is yours. Thank you, Samut the Tested. You have seen through the Trials and bested the darkness beyond.] Tears of unbridled joy trickled down Samut's face. Pride, strength, and boundless love for her god flooded her body. She knew this moment was but a small triumph in the face of overwhelming darkness, but the flickering flame of hope remained alive, salvaged from destruction and shielded from the winds of the great trespasser. Euphoria drowned out all else around her. And within her soul, a powerful force crackled, and #emph[sparked.] A rush of energy poured out across Samut's body, and she felt her muscles contract as her mind #emph[expanded] —she was falling, falling through space, through flashing waves of aether, moving infinitely fast and not at all, plummeting through a crack in reality itself. The desert air around her was suddenly replaced with a cool breeze, and Samut found herself standing among strange grasses, the plants rippling at her feet. Samut looked up, her eyes not quite comprehending what she saw. The sky held no suns—in fact, the world seemed covered in a strange darkness, punctuated by peculiar speckles of light that danced and twinkled like distant gems. Strange twisting patterns of color danced through the sky, and some of the glowing pinpoints seemed to shine brighter than others. Samut rubbed her eyes. If she stared long enough, they seemed to form a strange sort of pattern, a connected luminescence that almost seemed to take on an almost familiar form, like a thought lingering just outside the reach of memory, or the whispered fragments of a forgotten dream . . . #figure(image("007_Endure/12.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) Samut tore her eyes from the strange sky and looked around her. She could make out the black outline of some buildings in the distance, straight and rigid in their architecture. The wind continued to dance through the grass at her feet, its whistle almost musical as it brushed across her skin, and unfamiliar scents tickled her nose. A deep panic swelled within Samut. #emph[This is not Naktamun. This is not Amonkhet. This is . . . some other world.] She thought of the interlopers, of their strange spells, odd clothing, and unusual markings. #emph[I . . . I am them. I am a walker between worlds.] She shook her head and yelled in frustration. She #emph[needed ] to be back home. #emph[Needed] to help Hazoret, still grievously injured, help her people escape— Samut turned to run, pulling on memory and instinct, drawing on magics still new and tenuous. As her legs churned, she felt the same strange indescribable feeling seize her. Suddenly a force wrenched her from reality, her magic intertwining with the fibers of her muscles, her body serving as medium for a spell she didn't know she could cast. She plummeted again through flashing blue and swirling colors, and as she fell she could vaguely feel other worlds—#emph[planes] —passing her by until with a jolt, she landed on her knees in warm, familiar sand, basking again in the glow of Hazoret's presence. Around her, the other survivors looked on in shock, having watched their champion vanish in a blur, only to reappear before anyone could react. #strong[My child.] Hazoret's warm voice echoed in Samut's head, and she started to stand and reply—but her body slumped forward and she fell, completely drained of energy. Hazoret caught Samut in her hand, and gently held her until two other survivors rushed forward to take her and lie her down. Djeru knelt by Samut's side, worry etching his brow. A thunderous crash and ripple of power drew everyone's attention skyward. The golden dragon flew above the city, lightning crackling between his claws. His gaze fell below him, and thunderous laughter boomed forth. "I imagine the interlopers have engaged the great trespasser." Djeru sheathed his khopesh and stood. A khenra warrior spoke up. "We should go to their aid!" Djeru shook his head. "That is a conflict that we cannot win. We are far from our full strength." The khenra scowled. "So we do nothing?" "#strong[We endure.] " The survivors turned to Hazoret. The god drew her spear from the ground and gazed toward <NAME>. "#strong[When the gods numbered eight, we stood against the dragon, and we fell. I do not know if these interlopers can stop him. I pray for their success.] " She turned back toward the gathered survivors. "#strong[But for now, my children, we must simply endure, persist, survive. We will march forth into the desert and seek shelter among its sands and mirages. And as long as I draw breath as a god of Amonkhet, I will protect you.] " "And us, you." Djeru knelt before Hazoret and pounded his fist against his chest. One by one, the other survivors followed. Hazoret smiled a sad smile and gazed down at Samut. Her unexpected champion, the child who saw the truth, who dared defy the gods because she loved the gods so fiercely. And she marched forward toward the distant sands, her people trailing behind her, as the dragon trespasser descended on his unseen foes among the ruins of Naktamun. #figure(image("007_Endure/13.jpg", width: 100%), caption: [Leave | Art by <NAME>], supplement: none, numbering: none) #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) #emph[". . . But even as the great trespasser rained destruction down upon the ruins of Naktamun, Hazoret, the God-Survivor, mother and protector of the mortals of Amonkhet, shepherded her children from certain ruin. And so it was, and so it shall be, divinity and mortals marching into an unknown future."] #emph[—Haqikah, survivor of Amonkhet]
https://github.com/iorin-io/b3_ml-final-report
https://raw.githubusercontent.com/iorin-io/b3_ml-final-report/main/ml_final-report.typ
typst
#import "@preview/codelst:2.0.0": sourcecode #import "@preview/codelst:2.0.0": sourcefile #set text(font: "Hiragino Mincho ProN") #let mixed(body) = { set text(weight: "extrabold") show regex("[\p{scx:Han}\p{scx:Hira}\p{scx:Kana}]"): set text(font: "Hiragino Kaku Gothic ProN", weight: "bold") body } // 和欧混植のフォント別々指定 #set par(first-line-indent: 1em) #show heading: mixed // 見出しへ応用 #show heading: it => { it par(text(size: 0pt, "")) } #set list(indent: 0.5em) #set enum(numbering: "(1)") //#set math.equation(numbering: "(1)") #let title(body) = { set align(center) set text(size: 2em) v(1em) mixed(body) } #let cap = "∩" #let cup = "∪" #let varnothing = "∅" #set heading(numbering: "1.") #set math.equation(numbering: "(1)") //============================================================ #title[マークアップ言語 期末レポート] #v(1em) #align(center)[#text(size: 1.25em)[202210016 髙𣘺伊織]] #v(1em) = 作成したXSLTスタイルシートとその解説 \ これはボタンを押すたびランダムな書籍ページを表示する「書籍ガチャ」である。以下に作成したコードを示す。 `transform_item.xsl` #sourcecode[```xml <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" encoding="UTF-8" doctype-public="XHTML 1.0 Transitional" /> <xsl:param name="item_id" /> <xsl:template match="/"> <xsl:apply-templates select="/books/item[@no = $item_id]" /> </xsl:template> <xsl:template match="item"> <html> <head> <title><xsl:value-of select="title" /></title> </head> <body> <h1><xsl:value-of select="title" /></h1> <p><b>Creator:</b> <xsl:value-of select="creator" /></p> <p><b>Publisher:</b> <xsl:value-of select="publisher" /></p> <p><b>Description:</b> <xsl:value-of select="description" /></p> <p><b>Price:</b> <xsl:value-of select="price" /></p> <p><b>Date:</b> <xsl:value-of select="date/year" />-<xsl:value-of select="date/month" />-<xsl:value-of select="date/day" /> </p> <p><b>ISBN:</b> <xsl:value-of select="isbn" /></p> <p><a href="{url/@resource}">購入する</a></p> <p><a href="index.html">ガチャに戻る</a></p> </body> </html> </xsl:template> </xsl:stylesheet> ```] `index.html` #sourcefile(read("index.html"), file:"index.html") `generate.sh` #sourcefile(read("generate.sh"), file:"generate.sh") `transform_item.xsl`は、`item_id`を受け取り、そのIDに対応する書籍情報を表示するXSLTスタイルシートである。 このxslを用いて書籍ごとのhtmlファイルを生成するため、`generate.sh`を作成した。\ 以下のように`data0422.xml`の中から`item`要素の`no`属性の値を取得し、値を整形し、`item_ids`リストに格納する。\ #sourcecode[```sh item_ids=$(xmllint --xpath "//item/@no" $input_xml | sed 's/no="\([0-9]*\)"/\1/g') ```] 取得した`item_ids`を用いて、それぞれの`item_id`ごとに`transform_item.xsl`を適用し、`book-$id.html`という名前のファイルを生成する。\ #sourcecode[```sh for id in $item_ids do echo "item_id: $id" xsltproc --stringparam item_id "$id" transform_item.xsl $input_xml > "book-$id.html" done ```] これによって生成されたhtmlファイルの例を以下に示す。 `book-345216013.html` #sourcefile(read("book-345216013.html"), file:"book-345216013.html") `book-$id.html`をランダムに表示するための`index.html`を作成した。\ また、ランダムに選ぶ選択肢を動的に生成するために、`generate.sh`で生成した`book-$id.html`全てを格納するリストを作成する。そのための処理が`generate.sh`にある以下の部分である。 #sourcecode[```sh files=$(ls book-*.html) cat <<EOL > generated_pages.js const pages = [ EOL for file in $files do echo " '$file'," >> generated_pages.js done cat <<EOL >> generated_pages.js ]; EOL ```] これによって生成された`generated_pages.js`は以下のようになる。 `generated_pages.js` #sourcecode[```js const pages = [ 'book-345216013.html', 'book-345216014.html', 'book-345216015.html', 'book-345216016.html', ︙ 'book-731975551.html', 'book-731975552.html', ]; ```] このリストは、`index.html`で以下のように使用される。 #sourcecode[```html <script src="generated_pages.js"></script> <script> function goToRandomPage() { const randomIndex = Math.floor(Math.random() * pages.length); window.location.href = pages[randomIndex]; } </script> ```] = CGIを使った場合はプログラムと解説 \ 今回CGIは使用していない = ウェブブラウザで表示した実行画面とその解説 \ 以下のリンクからアクセスできる。 https://www.u.tsukuba.ac.jp/~s2210016/ml/b3_ml-final-report/index.html アクセスすると次の画像のような画面が表示される。 #image("gacha1.png") 「ガチャを引く」ボタンを押すと、ランダムに書籍情報が表示される。\ 以下の画像は、ボタンを押した後の画面である。 #image("gacha2.png") = 授業の感想 \ 授業を通して、xslを使用してxmlやhtmlを変換する方法を学ぶことができた。思っていたよりも複雑な処理を行うことができることがわかり、興味深かった。
https://github.com/maxgraw/bachelor
https://raw.githubusercontent.com/maxgraw/bachelor/main/apps/document/src/6-evaluation/goal.typ
typst
Das Ziel dieser Arbeit liegt in der erfolgreichen Entwicklung einer zuvor konzipierten Augmented Reality Möbelkonstruktionsumgebung auf Basis von WebXR. Die erfolgreiche Entwicklung der Anwendung wird anhand verschiedener Kriterien überprüft. Die in der Konzeption festgelegten funktionalen Anforderungen, die die Anwendung in ihrer Funktionalität beschreiben, wurden bereits im Kapitel der Implementierung reflektiert. Die Evaluation dient der Überprüfung der Benutzererfahrung. Innerhalb der Anforderungsanalyse wurde hierbei Benutzererfahrung als nicht-funktionale Anforderung definiert. Wie bereits zuvor in dieser Arbeit vorgestellt, wurde die Anwendung in der Arbeit von <NAME> verwendet, um ein Online-Shop-System im Zusammenhang zu entwickeln. Die Anwendung wurde mittels Experteninterviews und einer Think-Aloud-Studie evaluiert. Im Kapitel der Diskussion wird hierbei auf die dort erzielten Ergebnisse eingegangen. Durch die Einbindung der Ergebnisse von <NAME> können weitere Erkenntnisse in Bezug auf die Benutzerfreundlichkeit und Benutzererfahrung der Anwendung sowie weitere nicht funktionale Anforderungen gewonnen werden.
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/999%20-%20Unknown%20Set/001_Ravnica%20High.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Ravnica High", story_date: datetime(day: 14, month: 08, year: 2013), author: "<NAME>", doc ) #figure(image("001_Ravnica High/01.jpg", width: 100%), caption: [Tablet of the Guilds | Art by Nic Klein], supplement: none, numbering: none) Welcome to Ravnica High! I'm Skrygix, and I'll be your mentor during this orientation session. Don't hesitate to ask me questions while we tour the grounds. We've got a full slate of activities designed to get you familiar with daily life here, starting with the general assembly in a few minutes, where Vice Principal Beleren will be laying down the law. Like most orientations, this will focus on class structure and the rules on campus. Principal Mizzet probably won't make an appearance. He's never around these days—I hear he's working on some big research project. But he and Beleren are tight, that's for sure. #figure(image("001_Ravnica High/02.jpg", width: 100%), caption: [Art by Jaime Jones], supplement: none, numbering: none) Okay, now that the lecture is over and you've heard the official line, let me tell you how things #emph[really] work. (I've been here a couple of years now, and I know a few things.) As much as the adults would like to deny it, cliques are the reality of student life, and nowhere is that more true than at Ravnica High. You might find yourself suited to a particular group, or be interested in avoiding one—or you might not belong anywhere. At least there isn't a uniform code here. Now let's start the tour with the admin office. Come here if you need help with paperwork, or if you get written up. Secretary Isperia keeps things running, and she knows where everything is. She has the vice principal's ear, so don't make an enemy of her. #figure(image("001_Ravnica High/03.jpg", width: 100%), caption: [Isperia, Supreme Judge | Art by <NAME>], supplement: none, numbering: none) So what about vice principal Beleren? Well, he tries to have an open-office policy, but he's a bit too concerned about being everyone's pal, know what I mean? He's always calling assemblies to address this problem or that, but we all know that he's too busy to see everything that's going on. I wouldn't attract his attention, though; he's fond of handing out detention, where you have to deal with Gruul roughs and Orzhov bullies. Plus you have to put up with Beleren's lectures. And bossy Azorius monitors. Watch out for those Az-kissers, by the way. They love to rat out kids for the smallest thing. They're easy to spot, though; they always volunteer for hall monitor duty, and they wear a smug expression that goes perfectly with their designer shirts. (Don't look now, but that brat Lavinia is watching us. Act casual.) The kindest thing I can say about them is that they're enthusiastic. You know that one student who sits at the head of the class and always has her hand in the air? Yeah. But if that's your sort of thing, you probably won't get bothered very much. Just don't expect to be popular. Okay, let's keep going. Here's the cafeteria. Friday is pizza day, and you'd better get here early if you want any. The lines get long, and the Gruul always cut in and snag double helpings. A word of warning: don't eat anything a Golgari offers you. Seriously. Just down the hall here you'll find the lockers. You'll each get one assigned to you, but you have to provide your own lock. And if you end up next to a Golgari, I'd recommend some fungicide. Just to be safe. #figure(image("001_Ravnica High/04.jpg", width: 100%), caption: [Golgari Charm | Art by Zoltan Boros], supplement: none, numbering: none) The lockers are conveniently close to the gym. I don't get sports, myself, but PE is a huge deal with the vice principal. Sound mind in sound body and all that. (Though he could use some strength training himself, frankly.) But there's always a few Orzhov bullies who use gym period to push around the weaker kids—plus they'll take your lunch money. So gym can be tough. You'll just have to manage as best you can. Unless you're into sports, of course. I don't mean any insult. In fact, those Boros jocks can be solid in more ways than one. They don't understand much beyond brute force, but they work well in teams and they understand rules. And if you need a defender when a bully is making life tough, you can't do better than calling on one of them. If nothing else, follow a Boros onto the grounds. #figure(image("001_Ravnica High/05.jpg", width: 100%), caption: [Shattering Blow | Art by <NAME>], supplement: none, numbering: none) Over here, behind the auditorium is the backstage area. Drama club meets here, plus there's a piano (out of tune, of course). You'll usually find a few of the Rakdos theater geeks hanging around till all hours. They're entertaining enough in their own way, but their choice of music is downright bizarre. They're always doing this crazy performance art, and they end up in the nurse's office more than most. You know who likes to go to their events? Those creepy Dimir kids. They are seriously strange, always wearing black trench coats, heavy makeup, that sort of thing. I hear they put on live-action roleplaying games on the grounds at night. What a bunch of weirdos. Come on, follow me upstairs. It's mostly classrooms up here, but there's a couple of places to check out. This is the student lounge, and sometimes dances go on here when the gym's not available. You'll usually find a group of Selesnya kids here, just chillaxing. They're super friendly. Maybe too friendly. They sit around in their faded jeans and play guitars and invite passersby to hang out with them. I never see them in class. If you want to join in, I hope grades don't matter much to you. Oh yeah, and AV club meets here. You need a sound system set up, talk to the Izzet. They have a real touch for tech. They hang out in metal shop too, and they do robot battles a couple of times a year that you don't want to miss. #figure(image("001_Ravnica High/06.jpg", width: 100%), caption: [Dynacharge | Art by <NAME>], supplement: none, numbering: none) Speaking of that, let's go down this hall, where the chem and bio labs are. You'll run into Izzet here too. But what I don't understand is those Simic science geeks who spend their free periods in lab, tinkering with chemicals and peering in microscopes. And they really get off on cutting things up. Weird, right? It's even stranger when they sew the pieces back together. Frog-pigs, cricket-spiders—who knows what they'll come up with next? They always have the smell of formaldehyde around them. You know something's not right with someone who wears a lab coat everywhere. Okay, let's tour the grounds. There's the football field and the running track. Field hockey and soccer also happen there. Here's the softball pitch. A lot of the kids eat their lunch outside, but good luck getting a picnic table. You're better off just finding a shady spot. Seniors are allowed to leave the grounds for lunch, and they usually hang out at the fast-food joint down the street. Juniors have to stay on campus, but there are some brushy areas around the edges that are close enough to count. Watch out for the Gruul dudes, though. They're always hanging out in the brush and getting rowdy. Flannel shirts, big stompy boots—you know the type. I figure those guys will still be here when they're in their twenties. Well, that about finishes up the tour. What's that? What clique do I belong to? Truth is, none of them. That's not really by choice—I just didn't really fit in anywhere. There are quite a few like me around here; some of them call themselves the Gateless. I guess you could call it a clique of people who aren't in cliques. Maybe that's the best way to survive around here. Good luck. Go, fighting Froghemoths! #figure(image("001_Ravnica High/07.jpg", width: 100%), caption: [], supplement: none, numbering: none)
https://github.com/Clay438/3bao-hbut-typst
https://raw.githubusercontent.com/Clay438/3bao-hbut-typst/master/README.md
markdown
# 这是对湖工三宝docx格式转换为typst格式文件的一次尝试
https://github.com/teamdailypractice/pdf-tools
https://raw.githubusercontent.com/teamdailypractice/pdf-tools/main/typst-pdf/examples/example-15.typ
typst
#set page("a4") #set text( font: "TSCu_SaiIndira", size: 12pt ) #outline() #set page("a4") #set text( font: "TSCu_SaiIndira", size: 13pt ) #set align(center) = 1 கடவுள் வாழ்த்து \ #set align(left) #table( stroke: none, columns: (2cm, auto), [], [], [1], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [2], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [3], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [4], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [5], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [6], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [7], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [8], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [9], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [10], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [1], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [2], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [3], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [4], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [5], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [6], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [7], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [8], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [9], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], [10], [அகரம் முதல, எழுத்து எல்லாம்; ஆதி- \ பகவன் முதற்றே, உலகு. \ \ ], )
https://github.com/piepert/grape-suite
https://raw.githubusercontent.com/piepert/grape-suite/main/examples/exam01.typ
typst
MIT License
#import "/src/library.typ": exercise, colors #import exercise: project, task, subtask #import colors: * #show: project.with( no: 1, type: [LEV], suffix-title: [Logische Grundlagen], show-point-distribution-in-tasks: true, show-namefield: true, show-timefield: true, max-time: 25, show-lines: true, show-solutions: true, solutions-as-matrix: true, university: [Universität Musterstadt], institute: [Institut für Philosophie], seminar: [Tutorium: Sprache, Logik, Argumentation], task-type: [Aufgabe], extra-task-type: [Extraaufgabe], solution-matrix-task-header: [Aufgabe], solution-matrix-achieved-points-header: [Erreichte Punkte], distribution-header-point-value: [Punkte], distribution-header-point-grade: [Wert], message: (points-sum, extrapoints-sum) => [Insgesamt sind #points-sum + #extrapoints-sum P. erreichbar. Sie haben #box(line(stroke: purple, length: 1cm)) P. von #points-sum P. erreicht.], solutions-title: [Lösungsvorschläge], timefield: (time) => [Zeit: #time min.], grade-scale: (([sehr gut], 0.9), ([gut], 0.76), ([befriedigend], 0.63), ([ausreichend], 0.5), ([n.b.], 0.49)) ) #task(lines: 10, points: 3, [Grundbegriffe], [ Erklären Sie, womit sich die Logik beschäftigt. Nennen Sie außerdem die zwei Gütekriterien von Argumenten. ], [], ( (1, [Bestimmung der Logik als Lehre vom gültigen, formalen Schließen.]), (2, [Benennen der Gütekriterien Gültigkeit und Schlüssigkeit.]), )) #task(lines: 20, [Gütekriterien], [ Beurteilen Sie die folgenden Argumente jeweils in Bezug auf die zwei Gütekriterien! Begründen Sie ihre Antworten kurz. ], [ #subtask(points: 2)[ Wenn ich auf dem Mond laufe, kann ich höher springen als auf der Erde. \ Ich kann nicht höher als auf der Erde springen.\ #box(line(length: 5cm)) \ Ich bin nicht auf dem Mond. ] #subtask(points: 2)[ Entweder alle Kirschen sind grün oder es regnet Sonnenstrahlen.\ Nicht alle Kirschen sind grün.\ #box(line(length: 5cm)) \ Also regnet es Sonnenstrahlen. ] #subtask(points: 2)[ Alle Menschen können Fleisch essen.\ #box(line(length: 5cm)) \ Alle Menschen sollten Fleisch essen. ] ], ( (2, [ 1. Das Argument wurde als schlüssig und gültig charakterisiert, da die Prämissen wahr und die Konklusion logisch aus den Prämissen folgt. Wurde es als unschlüssig beurteilt, so muss eine Begründung erfolgen. ]), (2, [ 2. Das Argument wurde als gültig, aber nicht schlüssig beurteilt, da die Prämissen falsch sind aber die Konklusion logisch aus den Prämissen folgt. Weder sind alle Kirschen grün, noch regnet es Sonnenstrahlen, daher ist die erste Prämisse falsch. Für eine andere Bewertung muss eine angemessene Begründung vorgebracht werden. ]), (2, [ 3. Das Argument ist weder schlüssig noch gültig. Da das Argument nicht gültig ist und auch nicht als gültig gesehen werden kann, kann es ebenfalls nicht schlüssig sein. ]), )) #task(lines: 10, [logische Folgerung], [ Geben Sie zu jedem Argument eine Konklusion an, die logisch aus den Prämissen folgt! ], [ #subtask(points: 1)[ Alle Vögel können fliegen.\ Ein Pinguin ist ein Vogel.\ #box(line(length: 5cm)) \ ... ] #subtask(points: 1)[ Pinguine leben am Südpol und Eisbären am Nordpol.\ #box(line(length: 5cm)) \ ... ] #subtask(points: 1)[ Die Straße ist nass.\ #box(line(length: 5cm)) \ ... ] ], ( (1, [ Eines der folgenden: - "Alle Vögel können fliegen." - "Ein Pinguin ist ein Vogel." - "Ein Pinguin kann fliegen." - äquivalente oder allgemeingültige Aussagen ]), (1, [ Eines der folgenden: - "Pinguine leben am Südpol und Eisbären am Nordpol." - "Pinguine leben am Südpol." - "Eisbären leben am Nordpol." - äquivalente oder allgemeingültige Aussagen ]), (1, [ Eines der folgenden: - "Die Straße ist nass." - "Es ist nicht der Fall, dass die Straße nicht nass ist." - äquivalente oder allgemeingültige Aussagen ]), )) #task(lines: 10, points: 4, extra: true, [Beweis], [ Beweisen Sie die Gültigkeit des folgenden Arguments durch einen indirekten Beweis! ], [ Alle Ärzte sind brilliant. \ Alle Chirurgen sind Ärzte. \ #box(line(length: 5cm)) \ Alle Chirurgen sind brilliant. ], ( (1, [Die Konklusion wurde verneint.]), (1, [Weitere Beweisschritte sind nachvollziehbar.]), (1, [Der Widerspruch wurde gefunden.]), (1, [Der Beweis wurde mit "QED" beendet.]), ))
https://github.com/jamesrswift/typst-chem-par
https://raw.githubusercontent.com/jamesrswift/typst-chem-par/main/src/rules/enantiomers.typ
typst
MIT License
#import "../stateful.typ": * #let enantiomers(body) = { show regex("\([EZRS]\)"): (it) => context { if-state-enabled( it , { show regex("\w"): text.with(style:"italic") it } ) } body }
https://github.com/Joelius300/hslu-typst-template
https://raw.githubusercontent.com/Joelius300/hslu-typst-template/main/chapters/02_state-of-research.typ
typst
MIT License
= Stand der Technik/Praxis Bezogen auf die eigenen Zielsetzungen und Fragestellungen soll aufgezeigt werden, wie andere dieses oder ähnliche Probleme gelöst haben. Worauf können Sie aufbauen, was müssen Sie neu angehen? Wodurch unterscheidet sich Ihre Lösung von anderen Lösungen? Für wissenschaftlich orientierte Arbeiten sei hier explizit auf (Balzert, S. 66 ff) verwiesen. #pagebreak()
https://github.com/dashuai009/dashuai009.github.io
https://raw.githubusercontent.com/dashuai009/dashuai009.github.io/main/src/content/blog/032.typ
typst
#let date = datetime( year: 2022, month: 8, day: 29, ) #metadata(( title: "欧拉公式", subtitle: [math,数论], author: "dashuai009", description: "欧拉公式及其证明", pubDate: date.display(), ))<frontmatter> #import "../__template/style.typ": conf #show: conf == 欧拉函数 <欧拉函数> 在1\~m中与m互素的整数的个数,记作$phi.alt (m)$ $ phi.alt (m) = {a \| 1 lt.eq a lt.eq m , gcd (a , m) = 1} $ 显然,$phi.alt (1) = 0 , phi.alt (p) = p - 1$ == 欧拉公式 若$gcd (a , m) = 1$,则 $ a^(phi.alt (m)) equiv 1 (mod med m) . $ == 证明 <证明> 先来说明一个引理 === 引理 令数列 $1 lt.eq b_1 < b_2 < dots.h < b_(phi.alt (m)) < m$是1\~m中与m互素的$phi.alt (m)$个整数。 若$g c d (a , m) = 1$,则数列$ b_1 a , b_2 a , b_3 a , dots.h , b_(phi.alt (m)) a med med (mod med m) , $于数列 $ 1 , 2 , 3 , dots.h , b_(phi.alt (m)) med med (mod med m) , $ 相同(忽略次序)。 === 引理证明 <引理证明> 证明过程与费马小定理证明过程类似。 注意到$g c d (b_i , m) = g c d (a , m) = 1$,则$g c d (b_i a , m) = 1$. 从而数列(1)与同余于数列(2)每一个数。这两个数列都含有$phi.alt (m)$个数字。 从数列(1)中任取两个数$b_j a$和$b_k a$,假设它们同余: $ b_j a equiv b_k a (mod med p) $ 则$p \| (j - k) a$,又因为$a equiv.not 0 (mod med m)$,所以$m \| (b_j - b_k)$。 而$1 lt.eq b_j , b_k lt.eq m - 1$,则 $0 lt.eq lr(|b_j - b_k|) lt.eq m - 2$,仅有$b_j = b_k$时,$p \| 0$。 所以,$b_1 a , b_2 a , b_3 a , dots.h , b_(phi.alt (m)) a$模m不同余。 $phi.alt (m)$个数模m不同余,这$phi.alt (m)$个余数一定就是数列(2)。得证。 == 证明欧拉公式 <证明欧拉公式> 引理中的两个数列连乘得: $ b_1 a dot.op (b_2 a) dots.h dot.op b_(phi.alt (m)) a equiv b_1 dot.op b_2 dots.h dot.op b_(phi.alt (m)) (mod m) $ 即 $ a^(phi.alt (m)) B equiv B (mod med m) $ 又有$B$与$m$互素,两边消掉得 $a^(phi.alt (m)) equiv 1 (mod med m)$ 得证。 == 卡歇米尔数 如果对于每个满足$gcd (a , m) = 1$的整数a,同余式$a^(m - 1) equiv 1 (#h(0em) mod med m)$成立,则称#strong[合数m为卡歇米尔数];。 例如$m = 561 = 3 \* 11 \* 17$是卡歇米尔数。
https://github.com/pluttan/electron
https://raw.githubusercontent.com/pluttan/electron/main/lab2/lab2.typ
typst
#import "@docs/bmstu:1.0.0":* #import "@preview/tablex:0.0.8": tablex, rowspanx, colspanx, cellx #show: student_work.with( caf_name: "Компьютерные системы и сети", faculty_name: "Информатика и системы управления", work_type: "лабораторной работе", work_num: "2", discipline_name: "Электроника", theme: "Три схемы включения транзистора (Вариант 13)", author: (group: "ИУ6-42Б", nwa: "<NAME>"), adviser: (nwa: "<NAME>"), city: "Москва", table_of_contents: true, ) = Задание == Цель работы Изучить, как влияют различные способы включения биполярного транзистора и величина сопротивления нагрузки на свойства усилительного каскада. == Задание Подготовить к работе схему в Multisim. Подключить к ней измерительные приборы, подать питание. 1. Подавая на вход схемы синусоидальный сигнал с частотой $f_c = 2 "кГц"$ (средняя частота для усилителя) и напряжением $U_г = 35 "мВ"$, для каждого из усилительных каскадов ОЭ, ОБ, ОК провести экспериментальную оценку малосигнальных параметров каскада $R_"вх" , к_i , к_u , к_р , R_"вых"$ различных сопротивлениях нагрузки $R_Н$ . Построить зависимости параметров усилителя от $R_Н$. При опенке выходного сопротивления усилителя $R_"вых" =U_"вых xx"/i_"вых кз"$ будем считать, что холостой ход на выходе усилителя возникает, если установить $R_H = R_"H макс"$ , а режим короткого замыкания – при $R_H = R_"H мин"$. 2. Используя формулы таблицы, оценить те же параметры усилителя и вычислить относительное расхождение между экспериментальными и аналитическими результатами. 3. Пользуясь экспериментальными данными определить, какой каскад и при каких $R_Н$ обладает наибольшим усилением по мощности. Объясните почему? 4. Дать заключение, как соотносятся между собой у различных каскадов $к_i , к_u , R_"вх" , R_"вых"$. Объясните полученные результаты. 5. Экспериментально определить верхнюю граничную частоту для каждого из каскадов ОЭ, ОБ и ОК при $R_Н$ указанном в варианте. Напряжение на выходе ГСС поддерживать неизменным на всех частотах и равным 35 мВ. 6. Рассчитать $f_в$ для каждого каскада и сопоставить расчетные и экспериментально полученные значения между собой. #v(-10pt) == Параметры схемы #align(center)[ #tablex( columns: 14, inset: 7pt, align: center+horizon, [$N$],[$E_к$],[$B$],[$I_s$],[$R_1$],[$R_2$],[$R_к, R_э$],[$R_г$],[$C_"бэ"$],[$C_"бк"$],[$f_alpha$],[$C_1, C_2$],[$C_"блок"$],[$R_H$], [],[В],[],[А],[кОм],[кОм],[кОм],[кОм],[пФ],[пФ],[МГц],[нФ],[нФ],[кОм], [13],[12],[100],[Ge],[10],[5],[3],[3],[3],[5],[100],[2],[100],[4], ) ] = Схема с общим эмиттером #img(image("1.png", width:90%), [Схема с общим эмиттером]) Проведем несколько измерений тока и напряжения с разной нагрузкой (сопротивлением): #align(center)[ #tablex( columns: 5, inset: 7pt, align: center+horizon, [$R_н$, Ом], [100],[1k],[4k],[100k], [$U_"вх"$, В], [0,0109],[0,0109],[0,0109],[0,0109], [$I_"вх"$, А], [$8,02 * 10^"-6"$],[$8,02 * 10^"-6"$],[$8,02 * 10^"-6"$],[$8,02 * 10^"-6"$], [$U_"вых"$, В], [$0,459$],[$0,356$],[$0,8145$],[$1,38$], [$I_"вых"$, А], [$0,000459$],[$0,000356$],[$0,0002036$],[$1,38 * 10^"-8"$] ) ] Ниже представлена схема с холостым ходом, где $R_н = 5 "ТОм"$. #img(image("3.png", width:70%), [Холостой ход]) Также находим значение тока при коротком замыкании, $R_н = 0.0000001 "Ом"$. #img(image("4.png", width:70%), [Короткое замыкание]) С помощью данных, представленных выше (рисунки 3, 4) находим $ R_"вых" = U_"хх" / I_"кз" = 1.4 / 0.000475 = 2947.36 "ом" $ Рассчитываем коэффициент передачи усилителя по току $K_i$, коэффициент передачи усилителя по напряжению $K_u$, коэффициент усиления мощности $K_p$ и входное сопротивление $R_"вх"$.\ Входное сопротивление $R_"вх" = U_"вх" / I_"вх"$\ Коэффициент передачи усилителя по току $K_i = I_"вых" / I_"вх"$\ Коэффициент передачи усилителя по напряжению $K_u = U_"вых" / U_"вх"$\ Коэффициент усиления мощности $K_p = K_i K_u$\ Выходное сопротивление $R_"вых" = U_"хх" / I_"кз"$ #align(center)[ #tablex( columns: 5, inset: 7pt, align: center+horizon, [$R_"вх"$, Ом], [1359,102],[1359,102],[1359,102],[1359,102], [$k_i$], [57,232],[44,389],[25,387],[0,002], [$k_u$], [42,110],[32,661],[74,725],[126,606], [$k_p$], [2410,041],[1449,770],[1897,003],[0,218] ) ] #img(image("5.png", width:70%), [Частотный анализ]) На сопротивлении $5 "кОм"$ максимальное напряжение – $23,925 В$.\ Граничная частота на напряжении $sqrt(2) f_max = 193 "kHz"$. = Схема с общей базой #img(image("6.png", width:70%), [Схема с общей базой]) Проведем несколько измерений тока и напряжения с разной нагрузкой (сопротивлением): #align(center)[ #tablex( columns: 5, inset: 7pt, align: center+horizon, [$R_н$, Ом], [100],[1k],[4k],[100k], [$U_"вх"$, В], [0,522],[0,522],[0,522],[0,522], [$I_"вх"$, А], [$0,0000115$],[$0,0000115$],[$0,0000115$],[$0,0000115$], [$I_"вых"$, А], [$0,000011$],[$0,0000085$],[$0,0000048$],[$3,309 * 10^"-7"$], [$U_"вых"$, В], [$0,001102$],[$0,0085$],[$0,0195$],[$0,0331$] ) ] Ниже представлена схема с холостым ходом, где $R_н = 5 "ТОм"$. #img(image("7.png", width:70%), [Холостой ход]) Также находим значение тока при коротком замыкании, $R_н = 0.0000001 "Ом"$. #img(image("8.png", width:70%), [Короткое замыкание]) С помощью данных, представленных выше (рисунки 7, 8) находим $ R_"вых" = U_"хх" / I_"кз" = 0,0341 / 0,0000113= 3017 "ом" $ Рассчитываем коэффициент передачи усилителя по току $K_i$, коэффициент передачи усилителя по напряжению $K_u$, коэффициент усиления мощности $K_p$ и входное сопротивление $R_"вх"$. #align(center)[ #tablex( columns: 5, inset: 7pt, align: center+horizon, [$R_"вх"$, Ом], [45391,30435],[45391,30435],[45391,30435],[45391,30435], [$k_i$], [0,956521739],[0,739130435],[0,417391304],[0,028773913], [$k_u$], [0,002111111],[0,016283525],[0,037356322],[0,063409962], [$k_p$], [0,002019324],[0,012035649],[0,015592204],[0,001824553] ) ] #img(image("9.png", width:54%), [Частотный анализ]) На сопротивлении $5 "кОм"$ максимальное напряжение – $0,5575 В$.\ Граничная частота на напряжении $sqrt(2) f_max= 9,8 "мГц"$. = Схема с общим коллектором #img(image("10.png", width:70%), [Схема с общим коллектором]) Проведем несколько измерений тока и напряжения с разной нагрузкой (сопротивлением): #align(center)[ #tablex( columns: 5, inset: 7pt, align: center+horizon, [$R_н$, Ом], [100],[1k],[4k],[100k], [$U_"вх"$, В], [0,0164],[0,018],[0,0182],[0,0183], [$I_"вх"$, А], [$0,0000061$],[$0,0000056$],[$0,0000055$],[$0,0000055$], [$I_"вых"$, А], [$0,0001277$],[$0,0000175$],[$0,0000045$],[$0,000000181$], [$U_"вых"$, В], [$0,0127$],[$0,0175$],[$0,018$],[$0,0181$] ) ] Ниже представлена схема с холостым ходом, где $R_н = 5 "ТОм"$. #img(image("11.png", width:70%), [Холостой ход]) Также находим значение тока при коротком замыкании, $R_н = 0.0000001 "Ом"$. #img(image("12.png", width:70%), [Короткое замыкание]) С помощью данных, представленных выше (рисунки 11, 12) находим $ R_"вых" = U_"хх" / I_"кз" = 0,0181 / 0,000334 = 54,19 "Ом"$ Рассчитываем коэффициент передачи усилителя по току $K_i$, коэффициент передачи усилителя по напряжению $K_u$, коэффициент усиления мощности $K_p$ и входное сопротивление $R_"вх"$. #align(center)[ #tablex( columns: 5, inset: 7pt, align: center+horizon, [$R_"вх"$, Ом], [2688,52459],[3214,285714],[3309,090909],[3327,272727], [$k_i$], [20,93442623],[3,125],[0,818181818],[0,032909091], [$k_u$], [0,774390244],[0,972222222],[0,989010989],[0,989071038], [$k_p$], [16,21141543],[3,038194444],[0,809190809],[0,032549429] ) ] #img(image("13.png", width:70%), [Частотный анализ]) На сопротивлении $5 "кОм"$ максимальное напряжение – $0,515 В$.\ Граничная частота на напряжении $sqrt(2) f_max= 7,9 "мГц"$. = Аналитический рассчет #img(image("14.png", width:70%), [Ток для эмиттера]) #img(image("15.png", width:70%), [Ток для базы]) #img(image("16.png", width:70%), [Ток для коллектора]) $ I_э = 0,00119 А $ $ I_б = 0,0012 А $ $ I_к = 0,0012 А $ == Общий эмиттер #align(center)[ #tablex( columns: 2, inset: 7pt, align: center+horizon, rowspanx(2)[Входное сопротивление], [$ R_"вх" = R_"вх тр оэ"||R_б $], [$ R_"вх" = (R_"вх тр оэ" * R_б)/(R_"вх тр оэ" + R_б) $], rowspanx(2)[Сопротивление базы], [$ R_б = R_1||R_2 $], [$ R_б = (R_1 * R_2)/(R_1 + R_2) $], rowspanx(2)[Входное сопротивление\ транзистора], [$ R_"вх тр оэ" = r_"баз" + (1 + B) * r_"эм" $], [$ r_"баз" approx 0 Omega $], rowspanx(2)[Сопротивление эмиттера], [$ r_"эм" = phi/I_"эм" Omega $], [$ phi = k T/q = 0.026$], [Коэффициент передачи по току], [$ K_i = R_б/R_б + R_"вх тр оэ" * B * R_к/R_к + R_н $], rowspanx(2)[Коэффициент передачи\ по напряжению], [$ K_u = (B * R_"кн")/(R_"вх тр оэ") $], [$ R_"кн" = R_к||R_н $], [Коэффициент мощности], [$ K_р = K_i * K_u $] ) ] #align(center)[ #tablex( columns: 2, inset: 7pt, align: center+horizon, [$R_б$, Ом], [3333.333333], [$R_"эм"$, Ом], [21.8487395], [$R_"вх тр оэ"$, Ом], [1332.773109], [$R_"вх"$, Ом], [952.0950894] ) ] #align(center)[ #tablex( columns: 5, inset: 7pt, align: center+horizon, [$R_н$, Ом], [100],[1000],[4000],[100000], [$k_i$], [41.47963393],[32.14671629],[18.36955217],[1.248416167], [$k_u$], [4.356669243],[33.76418663],[77.17528373],[131.1230549], [$k_p$], [180.7130453],[1085.407729],[1417.675401],[163.6961415], [$Delta k_i$], [40.52311219],[31.40758586],[17.95216086],[1.219642254], [$Delta k_u$], [4.354558132],[33.74790311],[77.13792741],[131.0596449], [$Delta k_p$], [180.711026],[1085.395693],[1417.659808],[163.694317], [$psi k_i %$], [43.36507183],[43.49261616],[44.0103854],[43.38708346], [$psi u %$], [2063.685431],[2073.518285],[2065.92298],[2067.862074], [$psi k_p %$], [89491.86695],[90182.73487],[90922.06655],[89718.50439] ) ] Далее рассчитаем частоту. $ f_в = 1/(2*π*τ_в) $ $ τ_в = G(τ_в + С_"кэ" R_"кн") + С_н R_"кн" space (С_н arrow 0 space "Ф") $ $ R_"кн"=R_к||R_н $ $ G = (R_г+r_б+r_э)/(R_г+R_"вх тр оэ") space (r_б arrow 0 "Ом") $ $ R_г = R_г||R_б $ $ τ_в = (В+1)/(2*π*f_α) $ $ f_в=f_α/(В+1) $ $ С_"кэ" = С_"бк" (В+1) $ #align(center)[ #tablex( columns: 2, inset: 7pt, align: center+horizon, [$f_в$, Гц], [213360.4476], [$τ_в$, с], [$7.46322 * 10^-7$], [$r_"кн"$, Ом], [1875], [$R_r$, Ом], [1000], [$R_"r1"$, Ом], [769.2307692], [$G$, См], [0.365951166], [$τ_в$, с], [$3.23779 * 10^-7$], [$С_"кэ"$, Ф], [$9.15 * 10^-10$] ) ] == Общая база #align(center)[ #tablex( columns: 2, inset: 7pt, align: center+horizon, rowspanx(2)[Входное сопротивление], [$ R_"вх" = R_"вх тр об"/(B + 1)||R_б $], [$ R_"вх тр об" = R_"баз" + (1 + B) R_"эм" $], rowspanx(2)[Сопротивление эммитера], [$ R_"эм"= ϕ /I_"эм" $], [$ ϕ= (k T)/q=0,026 $], [Коэффициент передачи по току], [$ K_i = R_э * α * R_к / (R_э + R_"вх тр об"/(В + 1)*(R_к+ R_н)) $], rowspanx(2)[Коэффициент передачи\ по напряжению], [$ K_u = (B * R_"кн")/(R_"вх тр оэ") $], [$ R_"кн" = R_к||R_н $], [Коэффициент мощности], [$ K_р = K_i * K_u $] ) ] Ниже в таблицах представлены рассчитанные значения. #align(center)[ #tablex( columns: 2, inset: 7pt, align: center+horizon, [$R_б$, Ом], [3333.333333], [$R_"эм"$, Ом], [21.66666667], [$R_"вх тр оэ"$, Ом], [1321.666667], [$R_"вх"$, Ом], [10.83333333], [$a$], [0.983606557] ) ] #align(center)[ #tablex( columns: 5, inset: 7pt, align: center+horizon, [$R_н$, Ом], [100],[1000],[4000],[100000], [$k_i$], [126.1633114],[98.72630873],[57.2357264],[3.961422591], [$k_u$], [4.393279909],[34.04791929],[77.82381553],[132.2249293], [$k_p$], [554.2707412],[3361.425392],[4454.302613],[523.798822], [$Delta k_i$], [68.9313912],[54.3372813],[31.84919273],[3.959701893], [$Delta k_u$], [37.71681183],[1.387368835],[3.099044887],[5.619424709], [$Delta k_p$], [1855.770669],[1911.655322],[2557.299707],[523.5809721], [$psi k_i %$], [2.204422129],[2.224115157],[2.254570362],[2302.218056], [$psi u %$], [0.104328434],[1.042478428],[1.041472792],[1.044385311], [$psi k_p %$], [0.229983908],[2.318592073],[2.34807369],[2404.402721] ) ] Далее рассчитаем частоту. $ f_в = 1/(2*π*τ_в) $ $ τ_в = G(τ_в + С_"кэ" R_"кн") + С_н R_"кн" space (С_н arrow 0 space "Ф") $ $ R_"кн"=R_к||R_н $ $ G = (R_г+r_б+r_э)/(R_г+R_"вх тр оэ") space (r_б arrow 0 "Ом") $ $ R_г = R_г||R_б $ $ τ_в = (В+1)/(2*π*f_α) $ $ f_в=f_α/(В+1) $ $ С_"кэ" = С_"бк" (В+1) $ #align(center)[ #tablex( columns: 2, inset: 7pt, align: center+horizon, [$f_в$, Гц], [999388.4436], [$τ_в$, с], [$1.59333 * 10^-7$], [$r_"кн"$, Ом], [1875], [$R_r$, Ом], [1000], [$R_"r1"$, Ом], [769.2307692], [$G$, См], [0.078127284], [$τ_в$, с], [$3.23779 * 10^-7$], [$С_"кэ"$, Ф], [$9.15 * 10^-10$] ) ] == Общий коллектор #align(center)[ #tablex( columns: 2, inset: 7pt, align: center+horizon, rowspanx(2)[Входное сопротивление], [$ R_"вх" = (R_"вх тр ок"+(B + 1))*R_"эн" ||R_б $], [$ R_"вх тр ок" = R_"баз" + (1 + B) R_"эм" (R_"баз" arrow 0) $], rowspanx(2)[Выходное сопротивление], [$ R_"вых"= R_э || (R_"эм" + (R_"r1" + r_б)/(В + 1))$], [$ R_"r1"= R_r || R_б; R_б arrow 0 "Ом" $], [Коэффициент передачи по току], [$ K_i = (R_б (В + 1) R_э)/(R_б + R_"вх тр ок" + (В+1) R_"эн")/(R_э + R_н) $], rowspanx(2)[Коэффициент передачи\ по напряжению], [$ K_u = ((B + 1) R_"эн")/(R_"вх тр ок" + (В + 1) R_"эн") $], [$ R_"кн" = R_к||R_н $], [Коэффициент мощности], [$ K_р = K_i * K_u $] ) ] Ниже в таблицах представлены рассчитанные значения. #align(center)[ #tablex( columns: 2, inset: 7pt, align: center+horizon, [$R_1$, Ом], [10000], [$R_2$, Ом], [5000], [$R_э$, Ом], [3000], [$R_к$, Ом], [3000], [$I_э$, А], [0.00119], [$I_б$, А], [0.0012], [$I_к$, А], [0.0012], [$R_r$, Ом], [1000], [$R_"r1"$, Ом], [769.2307692], [$R_б$, Ом], [3333.333333], [$B$], [1], [$R_"эм"$, Ом], [21.8487395], [$R_"вх тр оэ"$, Ом], [1332.773109], [$R_"вх"$, Ом], [7069.450225], [$R_"вых"$, Ом], [34.06776536] ) ] #align(center)[ #tablex( columns: 5, inset: 7pt, align: center+horizon, [$R_"эн"$, Ом], [96.77419355],[750],[1714.285714],[2912.621359], [$R_н$, Ом], [100],[1000],[4000],[100000], [$k_i$], [18.61746692],[3.024827],[0.797737308],[0.03248031], [$k_u$], [0.815813528],[0.971692978],[0.987415295],[0.992554451], [$k_p$], [15.18838138],[2.939203155],[0.78769802],[0.032238476], [$Delta k_i$], [2.316959306],[0.100173],[0.02044451],[0.000428781], [$Delta k_u$], [0.041423284],[0.000529245],[0.001595694],[0.003483413], [$Delta k_p$], [1.023034054],[0.09899129],[0.021492789],[0.000310952], [$psi k_i %$], [0.889323009],[0.96794464],[0.975012266],[0.986970744], [$psi u %$], [1.053491485],[0.999455634],[0.998386576],[1.003521904], [$psi k_p %$], [0.936894218],[0.967417724],[0.973439158],[0.99044676] ) ] Далее рассчитаем частоту. $ f_в = 1/(2*π*τ_в) $ $ τ_в = G(τ_в + С_"кэ" R_"кн") + С_н R_"кн" space (С_н arrow 0 space "Ф") $ $ R_"кн"=R_к||R_н $ $ G = (R_г+r_б+r_э)/(R_г+R_"вх тр оэ") space (r_б arrow 0 "Ом") $ $ R_г = R_г||R_б $ $ τ_в = (В+1)/(2*π*f_α) $ $ f_в=f_α/(В+1) $ $ С_"кэ" = С_"бк" (В+1) $ #align(center)[ #tablex( columns: 2, inset: 7pt, align: center+horizon, [$f_в$, Гц], [3353715.91], [$τ_в$, с], [$4.74804 * 10^"-8"$], [$r_"кн"$, Ом], [1875], [$R_r$, Ом], [1000], [$R_"r1"$, Ом], [769.2307692], [$G$, См], [0.02328149], [$τ_в$, с], [$3.23779 * 10^"-7"$], [$С_"кэ"$, Ф], [$9.15 * 10^"-10"$] ) ] = Вывод В результате выполнения лабораторной работы было изучено влияние различных способов включения биполярного транзистора и величина сопротивления нагрузки на свойства усилительного каскада.
https://github.com/Kasci/LiturgicalBooks
https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/test.typ
typst
#import "CU_json/all.typ": * #let c_clef = str.from-unicode(0x1D11E) #let f_clef = str.from-unicode(0x1D122) #let full_note = str.from-unicode(0x1D15D) #let half_note = str.from-unicode(0x1D15E) #let quarter_note = str.from-unicode(0x1D15F) #let eigth_note = str.from-unicode(0x1D160) #let sixteenth_note = str.from-unicode(0x1D161) #let thirtysecond_note = str.from-unicode(0x1D162) #let sixtyfourth_note = str.from-unicode(0x1D163) #let hundredtwentyeigth_note = str.from-unicode(0x1D165) #let dys = ( "C-": 0pt, "D-": 3pt, "E-": 6pt, "F-": 9pt, "G-": 12pt, "A-": 15pt, "H-": 18pt, "B-": 18pt, "C": 21pt, "D": 24pt, "E": 27pt, "F": 30pt, "G": 33pt, "A": 36pt, "H": 39pt, "B": 39pt, "C+": 42pt, "D+": 45pt, "E+": 48pt, "F+": 51pt, "G+": 54pt, "A+": 57pt, "H+": 60pt, "B+": 60pt, ) #let lengths = ( "1": full_note, "2": half_note, "4": quarter_note, "8": eigth_note, "16": sixteenth_note, "32": thirtysecond_note, "64": sixtyfourth_note, "128": hundredtwentyeigth_note, ) #let getNotes(notes, lyrics) = { let dx = 30pt for (idx,note) in notes.enumerate() { let tone = note.trim(regex("\d"), at: end) let length = note.trim(regex("\D")) let angle = 0deg let dy = /*-35.3pt*/ 0.7pt - dys.at(tone) let dyoff = 0pt let dxoff = 0pt if tone in ("B","H","C+","D+","E+","F+","G+","A+","H+","B+") { angle = 180deg dyoff = 11pt // dxoff = 2pt } place(dx: dx + dxoff, dy: dy + dyoff, text(size: 25pt, rotate(angle, lengths.at(length)))) if tone in ("C","A+","H+","B+") { place(line(start: (dx - 4pt,dy + 14.5pt), length: 20pt)) } if lyrics != none { place(dx: dx, dy: 5pt, text(size: 12.5pt, lyrics.at(idx))) } dx += 20pt } } #let chordsSplit(notes) = return notes.split(" ") #let chord(notes, lyrics) = { let ns = (notes,) let ls = (lyrics,) if notes.len() > 15 { ns = notes.chunks(15) if lyrics != none { ls = lyrics.chunks(15) } } set line(length: 100%) for n in ns { box( stack( spacing: 6pt, line(), line(), line(), line(), line(), place(dx: 0pt, dy:-23.5pt, text(size: 25pt, c_clef)), // line(), // line(), // line(), // line(), // line(), // place(dx: 0pt, dy:-23.5pt, text(size: 25pt, f_clef)), getNotes( n, ls.at(0) ) ), ) } } // #show: book #chord( chordsSplit("F2 F2 F2 F2 F4 F4 F4 G4 A4 F4 G4 A4"), chordsSplit("Vo sel je si ar chi je - rej ju - -") ) // // ("C4","D4","E4","F4","G4","A4","H4","C+4","D+4","E+4","F+4","G+4","A+4","H+4"), // "C1","D2","E4","F8","G16","A32","H64","C+1","D+2","E+4","F+8","G+16","A+32" //"C-1","D-2","E-4","F-8","G-16","A-32","B-64", // ,"D+2","E+4","F+8","G+16","A+32","B+64"
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/diagraph/0.1.1/lib.typ
typst
Apache License 2.0
#let plugin = plugin("diagraph.wasm") #let render(text, engine: "dot", width: auto, height: auto, fit: "contain", background: "transparent") = { let render = str( plugin.render( bytes(text), bytes(engine), bytes(background) ) ) if render.slice(0, 6) == "error:" { return raw(render) } else { return image.decode( render, format: "svg", height: height, width: width, fit: fit, ) } } #let raw-render(engine: "dot", width: auto, height: auto, fit: "contain", background: "transparent", raw) = { if (not raw.has("text")) { panic("This function requires a `text` field") } let text = raw.text return render(text, engine: engine, width: width, height: height, fit: fit, background: background) }
https://github.com/eternal-flame-AD/typstpp
https://raw.githubusercontent.com/eternal-flame-AD/typstpp/main/README.md
markdown
Apache License 2.0
# typstpp The Typst preprocessor. (Or Typst++)... Executes your Haskell or R code in your Typst source file. Wrapping around the `compile` and `watch` commands of the Typst CLI. ## Installation ```bash cargo install --git https://github.com/eternal-flame-AD/typstpp.git \ --features "r hs" \ --locked ``` ## Usage ```bash typstpp --help ``` ``` The Typst preprocessor Usage: typstpp <COMMAND> Commands: info Print typstpp info preprocess Preprocess a typst file compile Preprocess and compile a typst file watch Watch a typst file and preprocess then recompile on changes help Print this message or the help of the given subcommand(s) Options: -h, --help Print help -V, --version Print version ``` ## Example See [example.typ](example.typ). For an example input. See [example.out.typ](example.out.typ). For the preprocess output. See [example.out.pdf](example.out.pdf). For the final PDF output. ## TODO ### Backend - [X] Mix Haskell and R code - [ ] Inline code - [ ] Raw output ### R - [X] Better kable parsing - [X] Mix of Graphics, Tables, and Text - [ ] Passing arbitrary arguments to knitr ### Haskell - [ ] Remove the need for `:{` and `:}` ## License This project is licensed under the Apache-2.0 license, see [LICENSE](LICENSE) for more information. ### Dependency Licenses Licenses for dependencies: [Table of Dependencies w/SPDX identifiers](./LICENSE-dependencies) A mapping of licenses to their SPDX identifiers can be found [here](https://spdx.org/licenses/).
https://github.com/sitandr/typst-examples-book
https://raw.githubusercontent.com/sitandr/typst-examples-book/main/src/basics/states/index.md
markdown
MIT License
# States & Query <div class="warning">This section is outdated. It may be still useful, but it is strongly recommended to study new context system (using the reference).</div> Typst tries to be a _pure language_ as much as possible. That means, a function can't change anything outside of it. That also means, if you call function, the result should be always the same. Unfortunately, our world (and therefore our documents) isn't pure. If you create a heading №2, you want the next number to be three. That section will guide you to using impure Typst. Don't overuse it, as this knowledge comes close to the Dark Arts of Typst!