diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/CHANGELOG.md b/packages/preview/elegant-polimi-thesis/0.2.1/CHANGELOG.md new file mode 100644 index 0000000000..6dc92b89fb --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/CHANGELOG.md @@ -0,0 +1,29 @@ +# Changelog + +## 0.2.1 - 2026-06-27 + +- Added presentation template +- Changed *advisor to *supervisor +- Changed most defaults arguments to `none` +- Fixed thesis second page numbering +- Fixed thesis lvl.1 headings colour +- Fixed top margin + +## 0.2.0 - 2026-03-04 + +- Added executive summary, article format and other theses types +- Added examples, thumbnails +- Added DEIB logo +- Removed localization (now only ENG) +- Removed `phdcycle` +- Reorganized docs +- Fixed figure numbering + +# 0.1.1 - 2025-09-12 + +- Fixed the transparency for the sunburst (_raggiera_) +- Fixed localization and frontispiece attributes + +# 0.1.1 - 2025-06-10 + +Template released. diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/CONTRIBUTING.md b/packages/preview/elegant-polimi-thesis/0.2.1/CONTRIBUTING.md new file mode 100644 index 0000000000..f96b6906a6 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/CONTRIBUTING.md @@ -0,0 +1,28 @@ +# Contributing + +If you want to test the package, you must clone the repository in the local packages folder; depending on your operating system it will be: + +- `$XDG_DATA_HOME` or `~/.local/share` on Linux +- `%APPDATA%` on Windows +- `~/Library/Application Support` on macOS + +Then, the structure will be `typst/packages/local/{package.name}/{package.version}` where `name` and `version` are matching the `typst.toml` file. + +Finally, create a new project with: + +```shell +typst init "@local/{package.name}:{package.version}" +``` + +See the [official documentation](https://github.com/typst/packages?tab=readme-ov-file#local-packages). + +> [!TIP] +> Create a symlink to the location Typst needs to the location where the repository is. For instance in a Unix environment it would be: +> +> ```shell +> mkdir ~/.local/share/typst/packages/local/PACKAGE.NAME +> ln -s REPO_FOLDER \ +> ~/.local/share/typst/packages/local/PACKAGE.NAME/PACKAGE.VERSION +> ``` +> +> You could do the same for the `preview` namespace, will be the one used for the template on Typst Universe. There is the `symlink.sh` to account for those operations: make sure to configure the correct paths. diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/LICENSE b/packages/preview/elegant-polimi-thesis/0.2.1/LICENSE new file mode 100644 index 0000000000..f288702d2f --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/README.md b/packages/preview/elegant-polimi-thesis/0.2.1/README.md new file mode 100644 index 0000000000..5bf33b4b9c --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/README.md @@ -0,0 +1,288 @@ +# elegant-polimi-thesis 🎓 + +![Version](https://img.shields.io/badge/package-v0.2.1-239dad?logo=typst) +[![Github Repo](https://img.shields.io/badge/github-repo-blue?logo=github)](https://github.com/VictuarVi/PoliMi-PhD-Thesis) +![License](https://img.shields.io/badge/license-GPLv3-green) +[![Documentation](https://img.shields.io/badge/docs-docs.pdf-red?logo=readthedocs)](https://github.com/VictuarVi/PoliMi-PhD-Thesis/blob/v0.2.1/docs/docs.pdf?raw=true) + +[Typst](https://typst.app/) theses and summaries templates for the [Polytechnic University of Milan](https://www.polimi.it/). The package supports all the templates that can be found on [this page](https://www.overleaf.com/latex/templates/tagged/polimi). + +It also supports the presentation. It is loosely based on the templates that can be found [here](https://drive.google.com/drive/folders/1PJUOglX63IjCMPYhZXAoPIVuH_-DmsPR) while also taking into account the [Digital Brand Manual](https://www.polimi.it/en/the-politecnico/communication/brand-identity-manual). + +See the [examples](https://github.com/VictuarVi/PoliMi-PhD-Thesis/tree/v0.2.1/examples) directory and [documentation](https://github.com/VictuarVi/PoliMi-PhD-Thesis/blob/v0.2.1/docs/docs.pdf?raw=true) for more information. + +## Preview ✨ + + + + + + + + + + + + + + + + + +
+ PhD frontispiece +
+
PhD
+
+ DEIB PhD frontispiece +
+
DEIB PhD
+
+ Computer Science and Engineering frontispiece +
+
Computer Science and Engineering
+
+ Classical Master frontispiece +
+
Classical Master
+
+ Executive Summary frontispiece +
+
Executive Summary
+
+ Article Format frontispiece +
+
Article Format
+
+

+ Title page of presentation +

+
Title page of presentation
+
+ +## Usage 🖋 + +You can either use this template in the webapp by clicking on "Create project in webapp" or, from the CLI, run: + +```shell +typst init @preview/elegant-polimi-thesis:0.2.1 +``` + +I'd also recommend to export with the `a-3u` PDF standard flag ([see more](https://typst.app/docs/reference/pdf/#pdf-standards)). + +To get started: + +```typ +#import "@preview/elegant-polimi-thesis:0.2.1": * + +#show: polimi-thesis.with( + title: "Thesis Title", + author: "Vittorio Robecchi", + supervisor: "Prof. Donatella Sciuto", + cosupervisor: "Prof. Antonio Capone", + tutor: "Prof. Marco Bramanti", + academic-year: [2026 --- 2027], + frontispiece: "phd", +) + +#show: frontmatter + +// abstract in English + +// sommario in Italian + +#show: acknowledgements + +// acknowledgements + +#toc +#list-of-figures +#list-of-tables + +#let _nomenclature = ( + "key" : "value" +) +#nomenclature( + _nomenclature, + indented: true +) + +#show: mainmatter + +// main section of the thesis + +#show: backmatter + +// backmatter + +#show: appendix + +// appendix + +#show: backmatter + +// bibliography + +#show: acknowledgements + +// acknowledgements +``` + +Depending on the **thesis template** you need change the `frontispiece` argument accordingly: + +- `phd` for "PhD Thesis Template" +- `deib-phd` for "DEIB PhD Thesis" +- `classical-master` for "Classical Format Thesis" +- `cs-eng-master` for "Computer Science and Engineering" + +The template also offers the Executive Summary and the Article Format; in order to use them show the respective functions: + +```typ +#import "@preview/elegant-polimi-thesis:0.2.1": * + +// For the article format +#show: polimi-article-format.with( + title: "Thesis Title", + author: "Vittorio Robecchi", + supervisor: "Prof. Donatella Sciuto", + cosupervisor: "Prof. Antonio Capone", + academic-year: [2026 --- 2027], + abstract: include "../sections/abstract.typ" +) + +// For the executive summary +#show: polimi-executive-summary.with( + title: "Thesis Title", + author: "Vittorio Robecchi", + supervisor: "Prof. Donatella Sciuto", + cosupervisor: "Prof. Antonio Capone", + academic-year: [2026 --- 2027], +) +``` + +The templates are **three distinct documents**, however they share _most_ of the arguments: + +- `title`: title of the document +- `author`: name and surname of the author +- `supervisor`: name and surname of the supervisor +- `cosupervisor`: name and surname of the cosupervisor(s) (can be empty) +- `course`: the course you are graduating in +- `academic-year`: the corresponding academic year +- `custom-logo`: logo of the thesis (the logos provided by the template are distributed with NC-BY 4.0 license) + +I recommend to import all the library anyway in order to access all the functions (`*matter`, theorems-related among others). + +The following are exclusive to `polimi-thesis`: + +- `tutor`: name and surname of the tutor +- `cycle`: the cycle of the thesis +- `chair`: the chair of the thesis +- `student-id`: your student ID +- `frontispiece`: the specific type of frontispiece to be used (default: `phd`; supported: `deib-phd`, `cs-eng-master`, `classical-master`) + +Depending on the selected frontispiece, not all these attributes may be needed. + +The following are exclusive to `polimi-article-format-thesis`: + +- `abstract`: the abstract +- `keywords`: keywords (that will also appear in the document metadata) + +### Presentation + +In regards to the presentation, **you'll have to download on your own** the [Manrope](https://fonts.google.com/specimen/Manrope) font. + +Built on [Touying](https://typst.app/universe/package/touying/), the structure is quite standard: + +```typ +#import "@preview/elegant-polimi-thesis:0.2.1": * + +#show: polimi-digital-presentation.with( + config-info( + title: "Title of the Presentation", + author: "Name Surname", + subtitle: "Subtitle", + theme: "Theme", + date: datetime.today(), + ), + ..args +) + +#title-slide() + +#make-outline() + += First Section + +== Slide in first section + +#lorem(50) + +#lorem(40) + +== Split slide + +#split-slide( + left: [ + #lorem(30) + + #lorem(30) + ], + right: [ + === Paragraph title + #lorem(120) + + === Paragraph title + #lorem(120) + ], +) + += Second Section + +== Slide in second section + +#lorem(20) + +#lorem(20) + +#lorem(20) + +#focus-slide[Thanks for listening] +``` + +Do note `..args` are all valid Touying arguments, as can be seen in all Touying-based presentation templates. + +## Recommended packages + +Useful packages for a thesis include: + +- [equate](https://typst.app/universe/package/equate), [physica](https://typst.app/universe/package/physica) for mathematical expressions +- [unify](https://typst.app/universe/package/unify), [zero](https://typst.app/universe/package/zero) to correctly format numbers +- [cetz](https://typst.app/universe/package/cetz), [fletcher](https://typst.app/universe/package/fletcher) for drawing diagrams, [lilaq](https://typst.app/universe/package/lilaq) to plot data +- [zebraw](https://typst.app/universe/package/zebraw), [codly](https://typst.app/universe/package/codly) for syntax highlighting in code blocks +- [frame-it](https://typst.app/universe/package/frame-it), [showybox](https://typst.app/universe/package/showybox) to display formatted blocks +- [meander](https://typst.app/universe/package/meander/) to wrap text around images and such + +The [smartaref](https://typst.app/universe/package/smartaref) and [hallon](https://typst.app/universe/package/hallon) packages have been integrated to provide subfigures ([currently unsupported](https://github.com/typst/typst/issues/246)), while [great-theorems](https://typst.app/universe/package/great-theorems) and [headcount](https://typst.app/universe/package/headcount) to handle theorems implementations. + +| Typst package | LaTeX equivalent | +| :-----------------------------------------------------: | :---------------------------------------: | +| [equate](https://typst.app/universe/package/equate) | ams\*, mathtools | +| [phisica](https://typst.app/universe/package/physica) | ams\*, mathtools | +| [unify](https://typst.app/universe/package/unify) | [siunitx](https://ctan.org/pkg/siunitx) | +| [zero](https://typst.app/universe/package/zero) | [siunitx](https://ctan.org/pkg/siunitx) | +| [cetz](https://typst.app/universe/package/cetz) | [TikZ](https://tikz.dev/) | +| [fletcher](https://typst.app/universe/package/fletcher) | [TikZ](https://tikz.dev/) | +| [lilaq](https://typst.app/universe/package/lilaq) | [TikZ](https://tikz.dev/) | +| [zebraw](https://typst.app/universe/package/zebraw) | [listings](https://ctan.org/pkg/listings) | +| [codly](https://typst.app/universe/package/codly) | [listings](https://ctan.org/pkg/listings) | +| [frame-it](https://typst.app/universe/package/frame-it) | [mdframed](https://ctan.org/pkg/mdframed) | +| [showybox](https://typst.app/universe/package/showybox) | [mdframed](https://ctan.org/pkg/mdframed) | +| [lovelace](https://typst.app/universe/package/lovelace) | [pseudo](https://ctan.org/pkg/pseudo) | +| [algo](https://typst.app/universe/package/algo) | [pseudo](https://ctan.org/pkg/pseudo) | +| [meander](https://typst.app/universe/package/meander/) | [wrapfig](https://ctan.org/pkg/wrapfig) | + +The complete list of packages can be found on the [Typst Universe](https://typst.app/universe/search/?kind=packages). + +## Contributing 🚀 + +If you happen to have suggestions, ideas or anything else feel free to open issues and pull requests or contact me. diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/docs/docs.typ b/packages/preview/elegant-polimi-thesis/0.2.1/docs/docs.typ new file mode 100644 index 0000000000..8ca4010cac --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/docs/docs.typ @@ -0,0 +1,107 @@ +#import "@preview/tidy:0.4.3": * +#import "../src/polimi-phd-thesis.typ" +#import "../src/utils.typ" +#import "../src/figures.typ" +#import "../src/polimi-digital-presentation.typ" +#import "@preview/metalogo:1.2.0": LaTeX, TeX + +#show "LaTeX": LaTeX + +#set text(hyphenate: true) +#set par(justify: true) +#set page(numbering: "1") +#set enum(numbering: "1.a.i.", indent: 1em) +#set list(indent: 1em) + +#align( + center, + heading( + text(size: 1.5em)[`elegant-polimi-thesis` documentation], + outlined: false, + ), +) + +#v(1em) + +This chapter is the result of the documentation generated from the source code. Since it's not strictly needed to use the template -- most of the functions are straightforward -- it's quite barebones. + +This document contains them all, even those that are not exposed to the user, which are marked with "\_" before. + +#set heading(numbering: none) + +#let toc-block = columns[ + #heading(level: 1, outlined: false, "All functions") + #outline(title: none, depth: 2, indent: 1em) +] + +#context block(height: measure(toc-block).height / 2 + 1em, toc-block) + +#show-module( + parse-module( + read("../src/polimi-phd-thesis.typ"), + name: "Theses templates", + scope: (polimi-phd-thesis: polimi-phd-thesis), + preamble: "#import polimi-phd-thesis: *\n", + ), + style: styles.default, + first-heading-level: 1, + show-outline: false, + show-module-name: true, + omit-private-definitions: false, + omit-private-parameters: false, + sort-functions: none, +) + +#v(1cm) + +#show-module( + parse-module( + read("../src/utils.typ"), + name: "Utilities", + scope: (utils: utils), + preamble: "#import utils: *\n", + ), + style: styles.default, + first-heading-level: 1, + show-outline: false, + show-module-name: true, + omit-private-definitions: false, + omit-private-parameters: false, + sort-functions: none, +) + +#v(1cm) + +#show-module( + parse-module( + read("../src/figures.typ"), + name: "Figures styling", + scope: (figures: figures), + preamble: "#import figures: *\n", + ), + style: styles.default, + first-heading-level: 1, + show-outline: false, + show-module-name: true, + omit-private-definitions: false, + omit-private-parameters: false, + sort-functions: none, +) + +#pagebreak() + +#show-module( + parse-module( + read("../src/polimi-digital-presentation.typ"), + name: "Presentation", + scope: (polimi-digital-presentation: polimi-digital-presentation), + preamble: "#import polimi-digital-presentation: *\n", + ), + style: styles.default, + first-heading-level: 1, + show-outline: false, + show-module-name: true, + omit-private-definitions: false, + omit-private-parameters: false, + sort-functions: none, +) diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/colors.typ b/packages/preview/elegant-polimi-thesis/0.2.1/src/colors.typ new file mode 100644 index 0000000000..a16643f14a --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/colors.typ @@ -0,0 +1,8 @@ +/// Color palette. +/// -> dict +#let _poli-palette = ( + primary: rgb("#022d56"), // main: blue heritage + neutral-light: rgb("#c0cbd5"), // circle stroke + secondary-light: rgb("#E1E6EB"), // divider-light + secondary-dark: rgb("#7F94A9"), // divider-dark +) diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/figures.typ b/packages/preview/elegant-polimi-thesis/0.2.1/src/figures.typ new file mode 100644 index 0000000000..27acc59b38 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/figures.typ @@ -0,0 +1,123 @@ +#import "utils.typ": _localization, bluepoli + +/// It displays the caption of subfigures. Use "(a)" that will be colored based on `colored-headings` parameter. +/// -> content +#let _subfigure-caption( + /// Whether to apply bluepoli on captions + /// -> bool + colored-caption: true, + /// Parent figure of this subfigure + /// -> figure + parent: none, + it, +) = context { + align( + center, + block({ + set align(left) + text( + fill: if (colored-caption) { bluepoli } else { black }, + it.counter.display("(a)"), + ) + [ ] + it.body + }), + ) +} + +/// Style-figures handles (optional heading-dependent) numbering of figures and subfigures. +/// Can modify the caption of all figures. +/// -> none +#let _style-figures( + /// Whether to apply bluepoli on captions (#text(fill: rgb("#5f859f"), "Figure 1")). + /// -> bool + colored-caption: true, + /// Heading level to account for in the numbering. + /// -> int + heading-levels: 0, + body, +) = context { + show figure.caption: it => context { + if (it.kind != "__lists" and it.kind != "_blank-toc") { + text( + fill: if (colored-caption) { bluepoli } else { black }, + { + it.supplement + " " + it.counter.display(it.numbering) + it.separator + }, + ) + it.body + } else { + it + } + } + // Numbering patterns for figures and subfigures. + let fig-numbering = "1." * heading-levels + "1" // e.g. "1.1" + let subfig-numbering = "1." * heading-levels + "1a" // e.g. "1.1a" + + // Set default supplement for subfigures. + show figure.where(kind: "subfigure"): set figure( + supplement: _localization.at(text.lang).figure, + ) + + // removed styling function because the one used is the template global one + + show heading: outer => { + if outer.level <= heading-levels { + // reset figure counter. + counter(figure.where(kind: image)).update(0) + counter(figure.where(kind: table)).update(0) + counter(figure.where(kind: raw)).update(0) + } + outer + } + + set figure(numbering: (..nums) => { + // TODO: check if we need to provide more context (i.e. using `at` instead + // of `get`)? + // + // ref: https://github.com/typst/typst/issues/3930 + let heading-nums = counter(heading).get() + if heading-nums.len() > heading-levels { + // truncate if needed. + heading-nums = heading-nums.slice(0, heading-levels) + } else if heading-nums.len() < heading-levels { + // zero pad if needed. + for i in range(heading-nums.len(), heading-levels) { + heading-nums.push(0) + } + } + std.numbering(fig-numbering, ..heading-nums, ..nums) + }) + + show figure.where(kind: image): outer => { + // reset subfigure counter + counter(figure.where(kind: "subfigure")).update(0) + + // use nesting level of figure to infer numbering of subfigures. + set figure(numbering: (..nums) => { + let heading-nums = counter(heading).at(outer.location()) + if heading-nums.len() > heading-levels { + // truncate if needed. + heading-nums = heading-nums.slice(0, heading-levels) + } else if heading-nums.len() < heading-levels { + // zero pad if needed. + for i in range(heading-nums.len(), heading-levels) { + heading-nums.push(0) + } + } + let outer-nums = counter(figure.where(kind: image)).at(outer.location()) + std.numbering(subfig-numbering, ..heading-nums, ..outer-nums, ..nums) + }) + + show figure.where(kind: "subfigure"): inner => { + show figure.caption: _subfigure-caption.with(colored-caption: colored-caption, parent: outer) + inner + } + outer + } + + body +} diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/frontispiece.typ b/packages/preview/elegant-polimi-thesis/0.2.1/src/frontispiece.typ new file mode 100644 index 0000000000..cdaa47137d --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/frontispiece.typ @@ -0,0 +1,269 @@ +#import "utils.typ": * + +#let _frontispiece-phd( + title, + author, + supervisor, + cosupervisor, + academic-year, + logo, + cycle, + chair, + tutor, + colored-headings: false, +) = { + set page( + margin: (top: 0cm), + background: context { + place( + dx: 102mm, + dy: -41mm, + _raggiera-image(147mm), + ) + }, + ) + + v(4.85cm) + + logo + + v(4.4cm) + + text( + size: _sizes.at("12pt").huge, + weight: 700, + fill: if (colored-headings) { bluepoli } else { black }, + title, + ) + + v(0.35cm) + + align(end, context { + set text(size: _sizes.at("12pt").Large) + _localization.at(text.lang).dissertation + ":\n" + text(weight: "bold", author) + }) + + v(1fr) + + align(start, context { + set text(size: _sizes.at("12pt").large) + _show-starvisor(supervisor, "supervisor") + _show-starvisor(cosupervisor, "cosupervisor") + _show-field(_localization.at(text.lang).tutor + ": ", tutor) + _show-field(none, academic-year, separator: "") + _show-cycle(cycle) + _show-field(_localization.at(text.lang).chair + ": ", chair) + }) +} + +#let _frontispiece-deib-phd( + title, + author, + supervisor, + cosupervisor, + academic-year, + logo, + cycle, + chair, + tutor, + colored-headings: true, +) = { + set page( + margin: (top: 0cm), + background: context { + place( + dx: 102mm, + dy: -41mm, + _raggiera-image(147mm), + ) + }, + ) + + v(3.8cm) + + logo + + // v(4.4cm) + v(3cm) + + text( + size: _sizes.at("12pt").huge, + weight: 700, + fill: if (colored-headings) { bluepoli } else { black }, + title, + ) + + // v(0.35cm) + v(0.26cm) + + align(end, context { + set text(size: _sizes.at("12pt").Large) + _localization.at(text.lang).dissertation + ":\n" + text(weight: "bold", author) + }) + + v(1fr) + + align(start, context { + set text(size: _sizes.at("12pt").large) + _show-starvisor(supervisor, "supervisor") + _show-starvisor(cosupervisor, "cosupervisor") + _show-field(_localization.at(text.lang).tutor + ": ", tutor) + _show-field(none, academic-year, separator: "") + _show-cycle(cycle) + _show-field(_localization.at(text.lang).chair + ": ", chair) + }) +} + +#let _frontispiece-classical-master( + title, + author, + supervisor, + cosupervisor, + academic-year, + logo, + course, + student-id, +) = { + // assert( + // course != none and couse != "", + // message: "You need to specify a course for the Classical Master frontispiece.", + // ) + + set page( + margin: (top: 0cm), + background: context { + place( + dx: 102mm, + dy: -41mm, + _raggiera-image(147mm), + ) + }, + ) + + v(4.7cm) + + logo + + v(4.2cm) + + text( + fill: bluepoli, + size: _sizes.at("12pt").huge, + weight: "bold", + title, + ) + + v(0.2cm) + + text( + fill: bluepoli, + size: _sizes.at("12pt").large, + weight: "bold", + smallcaps[ + Tesi di Laurea Magistrale In + #linebreak() + #course + ], + ) + + v(0.6cm) + + context text( + size: _sizes.at("12pt").Large, + _localization.at(text.lang).author + ": " + strong(author), + ) + + // v(1.1fr) + + align(bottom + start, context { + set text(size: _sizes.at("12pt").normalsize) + _show-field(_localization.at(text.lang).student-id + ": ", student-id) + _show-starvisor(supervisor, "supervisor") + _show-starvisor(cosupervisor, "cosupervisor") + _show-field( + _localization.at(text.lang).academic-year + ": ", + academic-year, + separator: none, + ) + }) +} + +#let _frontispiece-cs-eng-master( + title, + author, + supervisor, + cosupervisor, + academic-year, + logo, + student-id, + preface: [ + Tesi di Laurea Magistrale In\ + Computer Science and Engineering\ + Ingegneria Informatica + ], +) = { + set page( + margin: (top: 0cm), + background: context { + place( + dx: 102mm, + dy: -41mm, + _raggiera-image(147mm), + ) + }, + ) + + v(4.7cm) + + logo + + v(2.1cm) + + align( + center, + text( + fill: bluepoli, + size: _sizes.at("12pt").large, + weight: "bold", + smallcaps(preface), + ), + ) + + v(0.4cm) + + align( + center, + text( + size: _sizes.at("12pt").huge, + weight: "bold", + title, + ), + ) + + v(0.2cm) + + context { + _localization.at(text.lang).author + ":\n" + text( + weight: "bold", + size: _sizes.at("12pt").large, + author, + ) + if student-id != none { + parbreak() + _localization.at(text.lang).student-id + ":\n" + text( + weight: "bold", + size: _sizes.at("12pt").large, + student-id, + ) + } + } + + align(bottom + start, context { + set text(size: _sizes.at("12pt").normalsize) + _show-starvisor(supervisor, "supervisor", separator: ":\n", out: strong) + _show-starvisor(cosupervisor, "cosupervisor", separator: ":\n", out: strong) + _show-field(none, academic-year, separator: "") + }) +} diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/9-cerchi.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/9-cerchi.svg new file mode 100644 index 0000000000..9c8a1038e3 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/9-cerchi.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/foreground/title-background.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/foreground/title-background.svg new file mode 100644 index 0000000000..18086bfff8 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/foreground/title-background.svg @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/foreground/title.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/foreground/title.svg new file mode 100644 index 0000000000..1d1b07a7ff --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/foreground/title.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/logo/blue.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/logo/blue.svg new file mode 100644 index 0000000000..47f41d1f1b --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/logo/blue.svg @@ -0,0 +1,8509 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/logo/white.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/logo/white.svg new file mode 100644 index 0000000000..1f3353d606 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/logo/white.svg @@ -0,0 +1,8529 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/logo_deib.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/logo_deib.svg new file mode 100644 index 0000000000..ca5224a879 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/logo_deib.svg @@ -0,0 +1,827 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/logo_ingegneria.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/logo_ingegneria.svg new file mode 100644 index 0000000000..2f7610f453 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/logo_ingegneria.svg @@ -0,0 +1,818 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/raggiera.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/raggiera.svg new file mode 100644 index 0000000000..afc11a2e57 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/raggiera.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/above.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/above.svg new file mode 100644 index 0000000000..97bbbcf6d9 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/above.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/background/above.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/background/above.svg new file mode 100644 index 0000000000..ff51124790 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/background/above.svg @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/background/below.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/background/below.svg new file mode 100644 index 0000000000..a06e924ef0 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/background/below.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/below.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/below.svg new file mode 100644 index 0000000000..f6cd617b3a --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/below.svg @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/default/above.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/default/above.svg new file mode 100644 index 0000000000..efd5479f3d --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/default/above.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/default/below.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/default/below.svg new file mode 100644 index 0000000000..f6cd617b3a --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/default/below.svg @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/logos/below.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/logos/below.svg new file mode 100644 index 0000000000..25a914fa21 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/logos/below.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/white/below.svg b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/white/below.svg new file mode 100644 index 0000000000..65dcad6fb8 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/img/title/white/below.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/lib.typ b/packages/preview/elegant-polimi-thesis/0.2.1/src/lib.typ new file mode 100644 index 0000000000..07d14b89ba --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/lib.typ @@ -0,0 +1,10 @@ +#import "polimi-phd-thesis.typ": ( + polimi-article-format-thesis, polimi-executive-summary, polimi-thesis, theorems-init, lemma, proof, proof, theorem, + acknowledgements, appendix, backmatter, frontmatter, mainmatter, proposition, toc, list-of-figures, list-of-tables, + banner, subfigure, nomenclature, bluepoli, +) +#import "polimi-digital-presentation.typ": ( + background-slide, bluepoli, exact-split-slide, focus-slide, image-slide, make-outline, plot-slide, poli-slide, + polimi-digital-presentation, split-slide, title-slide, +) + diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/locale.yaml b/packages/preview/elegant-polimi-thesis/0.2.1/src/locale.yaml new file mode 100644 index 0000000000..812c16b572 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/locale.yaml @@ -0,0 +1,52 @@ +it: + supervisor: Relatore + cosupervisor: Correlatore + cosupervisors: Correlatori + tutor: Tutor + toc: Indice + dissertation: Tesi di laurea di + academic-year: Anno Accademico + year: Anno + cycle: Ciclo + list-of-figures: Lista delle Figure + list-of-tables: Lista delle Tabelle + nomenclature: Nomenclatura + theorem: Teorema + proof: Dimostrazione + proposition: Proposizione + lemma: Lemma + remark: Osservazione + figure: Figura + studend-id: Matricola + author: Autore + chair: Il Presidente del Dottorato + abstract: Sommario + keywords: Parole chiave + chapter: Capitolo + appendix: Appendice +en: + supervisor: Supervisor + cosupervisor: Co-supervisor + cosupervisors: Co-supervisors + tutor: Tutor + toc: Table of Contents + dissertation: Doctoral Dissertation of + academic-year: Academic Year + year: Year + cycle: Cycle + list-of-figures: List of Figures + list-of-tables: List of Tables + nomenclature: Nomenclature + theorem: Theorem + proof: Proof + proposition: Proposition + lemma: Lemma + remark: Remark + figure: Figure + student-id: Student ID + author: Author + chair: The Chair of the Doctoral Program + abstract: Abstract + keywords: Keywords + chapter: Chapter + appendix: Appendix diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/polimi-digital-presentation.typ b/packages/preview/elegant-polimi-thesis/0.2.1/src/polimi-digital-presentation.typ new file mode 100644 index 0000000000..eb3274ec68 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/polimi-digital-presentation.typ @@ -0,0 +1,666 @@ +#import "@preview/touying:0.7.4": * +#import "utils.typ": * +#import "colors.typ": * + +/// Basic slide. +/// -> content +#let poli-slide( + /// Touying overrides for this slide. + /// -> dictionary + config: (:), + /// Whether to repeat this slide. + /// -> auto | bool + repeat: auto, + setting: body => body, + composer: auto, + ..args, + body, +) = touying-slide-wrapper(self => { + let self = utils.merge-dicts( + self, + config-page(header: _poli-header), + config-common( + subslide-preamble: _basic-subslide-preamble(self), + ), + ) + touying-slide( + self: self, + config: config, + repeat: repeat, + setting: setting, + composer: composer, + ..args, + body, + ) +}) + +// TITLE SLIDE + +/// The title slide. The style can be specified via the corresponding argument. For the +/// background and logos style you must also specify a background and logos. +/// -> content +#let title-slide( + /// Style of the title slide. + /// -> "default" | "white" | "logos" | "background" + style: "default", + /// Required background for the "background" style; otherwise ignored. + /// -> image + background: none, + /// Required logos for the "logos" style; otherwise ignored. + /// -> array + logos: (), + /// Touying overrides for this slide. + /// -> dictionary + config: (:), +) = touying-slide-wrapper(self => { + let title-style = ( + "default": ( + text: (fill: white), + stroke: white, + logo: image("img/logo/white.svg"), + fill: gradient.linear(rgb("#042f57"), rgb("#c3c6c9"), angle: -90deg), + ), + "white": ( + text: (fill: self.colors.primary), + stroke: self.colors.primary, + logo: image("img/logo/blue.svg"), + ), + "logos": ( + text: (fill: white), + stroke: white, + logo: image("img/logo/blue.svg"), + fill: gradient.linear(rgb("#042f57"), rgb("#c3c6c9"), angle: 90deg), + height: 15.47cm - 6cm, + height-subtitle: -23cm, + ), + "background": ( + text: (fill: self.colors.primary), + stroke: self.colors.primary, + logo: image("img/logo/white.svg"), + circle-above: image("img/title/background/above.svg"), + circle-below: image("img/title/background/below.svg"), + height: 17.8cm, + ), + ) + if (style == "background") { + assert( + background != none, + message: "You need to specify a background if you want to use background title style.", + ) + } + if (style == "logos") { + assert( + logos.len() != 0, + message: "You need to specify logos if you want to use logos title style.", + ) + } + let self = utils.merge-dicts( + self, + config-page( + // foreground: title-style.at(style).at("foreground", default: none), + fill: title-style.at(style).at("fill", default: none), + background: move( + dy: if style == "logos" { -6cm } else { 0cm }, + { + if style == "background" { + place( + top + left, + background, + ) + } + grid( + columns: (42cm, 22.28cm, 1fr), + align: (top + left, center, center), + stroke: _stroke-no-border(title-style.at(style).stroke), + { + block( + inset: (left: 3cm, top: 3cm), + if style != "logos" { title-style.at(style).logo }, + ) + if self.info.subtitle != none and (self.store.subtitle-every-style or style == "background") { + place( + bottom, + pad( + left: 2cm, + bottom: 1.4cm, + text( + ..title-style.at(style).at("text", default: none), + size: 1.7em, + self.info.subtitle, + ), + ), + ) + } + }, + title-style.at(style).at("circle-above", default: image("img/title/above.svg")), + [], + + [], title-style.at(style).at("circle-below", default: image("img/title/below.svg")), + ) + }, + ), + footer-descent: if style == "logos" { -4.1cm } else { 30% }, + footer: if style == "logos" { + show: components.cell.with( + fill: white, + height: 6cm, + inset: (x: 2cm), + ) + set align(horizon) + grid( + columns: (13cm,) + (auto,) * logos.len(), + column-gutter: 1cm, + align: left + horizon, + { + set image(height: 4cm) + title-style.at(style).logo + }, + ..logos + ) + }, + ), + config-common( + freeze-slide-counter: true, + ), + ) + let body = { + show: pad.with(top: title-style.at(style).at("height", default: 15.47cm)) + let info = self.info + block( + width: 42cm, + { + text( + size: 120pt, + weight: "extrabold", + ..title-style.at(style).at("text", default: none), + info.title, + ) + v(title-style.at(style).at("height-subtitle", default: 1fr)) + text( + size: 18pt, + weight: "light", // extralight + ..title-style.at(style).at("text", default: none), + { + let arr = (info.author,) + let tmp = info.at("theme", default: none) + if tmp != none { + arr.push(tmp) + } + arr.join(" / ") + " | " + utils.display-info-date(self) + }, + ) + v(1cm) + }, + ) + } + touying-slide(self: self, config: config, body) +}) + +/// Generate the outline based on headings. +/// -> content +#let make-outline( + /// Touying overrides for this slide. + /// -> dictionary + config: (:), +) = touying-slide-wrapper(self => { + let self = utils.merge-dicts( + self, + config-page( + fill: rgb("#f3f3f3"), + ), + config-common( + subslide-preamble: block( + inset: (top: 40pt, bottom: 45pt), + context text( + size: 42pt, + fill: self.colors.primary, + _localization.at(text.lang).toc, + ), + ), + freeze-slide-counter: true, + ), + ) + let body = context { + let h1-h2-headings = query(heading).filter(e => e.level <= 2) + let h1s = h1-h2-headings.filter(e => e.level == 1).len() + + let h1s-final = () + let h2s-final = () + + for i in range(0, h1-h2-headings.len()) { + if h1-h2-headings.at(i).level == 1 { + let tmp = () + let j = i + 1 + while j < h1-h2-headings.len() and h1-h2-headings.at(j).level != 1 { + tmp.push(h1-h2-headings.at(j)) + j = j + 1 + } + let h1-linked = link(h1-h2-headings.at(i).location(), h1-h2-headings.at(i).body) + h1s-final.push(h1-linked) + let h2-linked = tmp.map(e => link(e.location(), e.body)) + h2s-final.push(h2-linked) + } + } + + let _max-columns = 6 + + let arr = ( + range(1, h1s + 1).map(e => rotate( + 270deg, + reflow: true, + text( + size: 100pt, + weight: 300, + str(_numbering-with-padding(e)), + ), + )), + h1s-final.map(e => text( + size: 23pt, + weight: "bold", + underline(e), + )), + if h2s-final != none { + h2s-final.map( + sections => sections.map(e => underline(text(fill: gray, e))).join("\n"), + ) + }, + ).map(e => e.chunks(_max-columns)) + + arr = arr.at(0).zip(arr.at(1), arr.at(2)) + + arr = ( + arr + .map(arr => arr.map(e => { + if e.len() < _max-columns { + return e + ("",) * (_max-columns - e.len()) + } else { + return e + } + })) + .map(e => ( + e.at(0), + e.at(1), + e.at(2).map(e => if type(e) == array { e.join("\n") } else { e }), + )) + ) + + [#metadata(none) <_polimi-digital-presentation-toc>] + grid( + columns: (1fr,) * _max-columns, + gutter: 1cm, + align: (_, y) => if y <= 1 { left + bottom } else { left }, + ..arr.flatten() + ) + } + touying-slide(self: self, config: config, body) +}) + +/// Generate the outline based on headings. +/// -> content +#let outline-slide(..args) = make-outline(..args) + +// SPLIT SLIDES + +/// Slide exactly split in 2 or 4. Requires content for each split. +/// -> content +#let exact-split-slide( + /// Content of each split. Usually a title with a small description. + /// -> array + splits: (), + /// Touying overrides for this slide. + /// -> dictionary + config: (:), +) = touying-slide-wrapper(self => { + let splits-num = splits.len() + let self = utils.merge-dicts( + self, + config-common( + subslide-preamble: _basic-subslide-preamble( + self, + inset: (top: 3cm, bottom: 1.8cm), + text-args: (size: 42pt), + ), + ), + config-page( + header: _poli-header(self), + background: { + set line(length: 100%, angle: 90deg, stroke: self.colors.neutral-light) + set circle(stroke: self.colors.neutral-light) + set stack(dir: ltr) + if splits-num == 2 { + stack( + circle(radius: 16cm), + line(), + circle(radius: 16cm), + ) + } else if splits-num == 4 { + let bottom-circle = align(bottom, pad(bottom: 1.91cm, circle(radius: 8cm))) + stack( + bottom-circle, + line(), + bottom-circle, + line(), + bottom-circle, + line(), + bottom-circle, + ) + } else { + panic("The splits must be either 2 or 4.") + } + }, + ), + ) + let body = { + grid( + columns: (1fr,) * splits-num, + align: left + horizon, + inset: { + if splits-num == 2 { 5cm } + if splits-num == 3 { 3cm } + if splits-num == 4 { 0.7cm } + }, + ..splits + ) + } + touying-slide(self: self, config: config, body) +}) + +/// Split a slide in two panes -- similar to header spacing. +/// -> content +#let split-slide( + /// Left split content. + /// -> content + left: [], + /// Right split content. + /// -> content + right: [], + /// Touying overrides for this slide. + /// -> dictionary + config: (:), +) = touying-slide-wrapper(self => { + let self = utils.merge-dicts( + self, + config-common( + subslide-preamble: _basic-subslide-preamble( + self, + inset: (top: 4.6cm, bottom: 1.8cm), + text-args: (size: 42pt), + ), + ), + config-page( + header: _poli-header, + background: _poli-bg-split(), + ), + ) + let body = grid( + columns: (_pane.left - 2cm, _pane.right - 1.25cm), + inset: (x, _) => if x == 0 { (right: 2cm) } else { (left: 2cm) }, + left, right, + ) + touying-slide(self: self, config: config, body) +}) + +// GRAPHIC SLIDES + +/// Slide with coloured background. Used for plots. +/// -> content +#let plot-slide( + /// Touying overrides for this slide. + /// -> dictionary + config: (:), + body, +) = touying-slide-wrapper(self => { + let self = utils.merge-dicts( + self, + config, + config-page( + header: _poli-header(self, text-args: (size: 15pt, weight: "regular", fill: white)), + fill: self.colors.primary, + ), + ) + let body = { + components.cell(height: 2.5cm) + set text(fill: white) + body + } + touying-slide(self: self, config: config, body) +}) + +/// Slide with image on the left, right or as whole background. Deprecated. Use +/// ```typc background-slide()```. +/// -> content +#let image-slide( + /// Image for the slide. + /// -> image + image: none, + /// Style of the image, that is where it will be placed and sized. + /// -> "background" | "left" + style: "background", + /// Touying overrides for this slide. + /// -> dictionary + config: (:), + body, +) = touying-slide-wrapper(self => { + panic("Deprecated! Use `background-slide()`.") + let self = utils.merge-dicts( + self, + config-page( + header: _poli-header( + self, + text-args: ( + size: 15pt, + weight: "regular", + fill: if style == "background" { white } else { rgb("#5e5e5e") }, + ), + ), + background: if style == "background" { + set std.image(height: 100%, width: 100%) + image + } else if style == "left" { + _poli-bg-split() + }, + ), + ) + touying-slide(self: self, config: config, body) +}) + +/// Slide with image as whole background. +/// -> content +#let background-slide( + /// Image for the slide. + /// -> image + image: none, + /// Touying overrides for this slide. + /// -> dictionary + config: (:), +) = touying-slide-wrapper(self => { + let self = utils.merge-dicts( + self, + config-page( + header: _poli-header( + self, + text-args: ( + size: 15pt, + weight: "regular", + fill: white, + ), + ), + background: { + set std.image(height: 100%, width: 100%) + image + }, + ), + ) + touying-slide(self: self, config: config) +}) + + +// FOCUS SLIDE + +/// Last slide. Usually it contains "Thanks for listening!" or similar phrases. +/// -> content +#let focus-slide( + /// Bottom lettering. + /// -> content + lettering: none, + /// Touying overrides for this slide. + /// -> dictionary + config: (:), + body, +) = touying-slide-wrapper(self => { + let self = utils.merge-dicts( + self, + config, + config-page( + // OPINIONATED CHOICE: it doesn't make sense to have an header in this slide + // header: _poli-header(self, text-args: (size: 15pt, weight: "regular", fill: white)), + .._divider-bg-args(self.colors.primary, self.colors.secondary-dark), + ), + config-common( + freeze-slide-counter: true, + ), + ) + let body = _divider-body(body, lettering, none, white) + touying-slide(self: self, config: config, body) +}) + +// SECTION DIVIDERS + +/// The so-called "Divisorio", a new section. Invoked with a level 1 heading. +/// -> content +#let _new-section-slide(config: (:), ..args) = touying-slide-wrapper(self => { + let config-divisorio = if self.store.divider-style == "dark" { + (self.colors.primary, self.colors.secondary-dark) + } else { + (rgb("#e2e6eb"), rgb("#7a8aa0")) + } + let self = utils.merge-dicts( + self, + config-page( + .._divider-bg-args(..config-divisorio), + ), + config-common( + freeze-slide-counter: true, + ), + ) + let body = _divider-body( + utils.display-current-heading( + level: 1, + numbered: false, + ), + none, + context _numbering-with-padding(counter(heading.where(level: 1)).at(here()).at(0)), + if self.store.divider-style == "dark" { + white + } else { + self.colors.primary + }, + ) + touying-slide(config: config, self: self, body) +}) + +/// The other so-called "Divisorio", but for lvl.2 heading and in a light background. Unused. +/// -> content +#let _new-subsection-slide(config: (:), ..args) = touying-slide-wrapper(self => { + let self = utils.merge-dicts( + self, + config-page( + .._divider-bg-args(rgb("#e2e6eb"), rgb("#7a8aa0")), + ), + config-common( + freeze-slide-counter: true, + ), + ) + let body = _divider-body( + text( + fill: self.colors.primary, + utils.display-current-heading( + level: 2, + numbered: false, + ), + ), + none, + text( + fill: self.colors.primary, + context { + _numbering-with-padding(counter(heading.where(level: 1)).at(here()).at(0)) + "." + str(counter(heading.where(level: 2)).at(here()).at(1)) + }, + ), + ) + touying-slide(config: config, self: self, ..args, body) +}) + +// MAIN FUNCTION + +/// Main presentation function. +/// -> content +#let polimi-digital-presentation( + /// The style of the divider. + /// -> "dark" | "light" + divider-style: "dark", + /// Whether to use the subtitle on all title styles. + /// -> bool + subtitle-every-style: false, + ..args, + body, +) = { + set text(size: 24pt, font: "Manrope") + show heading.where(level: 1): set heading(numbering: "1") // needed for the dividers + // show heading.where(level: 2): set heading(numbering: "1") + + show table.cell: it => { + if it.y == 0 { + text(fill: white, it) + } else if it.x == 0 { + text(fill: _poli-palette.primary, it) + } else { + it + } + } + set table( + align: center + horizon, + inset: (x: 3cm, y: 1.5cm), + stroke: (x, y) => ( + top: if y > 0 { if x == 0 { white + 1pt } else { gray + 1pt } }, + bottom: if y > 0 { if x == 0 { white + 1pt } else { gray + 1pt } }, + left: if x > 0 { gray }, + ), + fill: (x, y) => { + if y > 0 and x == 0 { + rgb("#c0cbd5") + } else if x > 0 and y == 0 { + _poli-palette.primary + } + }, + ) + + show: touying-slides.with( + config-page( + width: 677mm, + height: 381mm, + margin: ( + top: 3cm, + x: 2cm, + bottom: 2.5cm, + ), + ), + config-common( + slide-fn: poli-slide, + new-section-slide-fn: _new-section-slide, + // new-subsection-slide-fn: new-subsection-slide, + datetime-format: "[day]. [month]. [year]", + ), + config-colors( + .._poli-palette, + ), + config-store( + divider-style: divider-style, + subtitle-every-style: subtitle-every-style, + ), + ..args, + ) + + body +} diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/polimi-phd-thesis.typ b/packages/preview/elegant-polimi-thesis/0.2.1/src/polimi-phd-thesis.typ new file mode 100644 index 0000000000..00dd8a025f --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/polimi-phd-thesis.typ @@ -0,0 +1,1005 @@ +#import "utils.typ": * +#import "figures.typ": * + +#let language = "en" + +// https://typst.app/universe/package/smartaref +#import "@preview/smartaref:0.1.0": Cref, cref + +/// The main thesis formatting function. +/// -> content +#let polimi-thesis( + /// Title of the thesis. + /// -> str + title: "Thesis Title", + /// Author of the thesis. + /// -> str + author: none, + /// Supervisor(s) of the thesis. + /// -> str | array + supervisor: none, + /// Cosupervisor(s) of the thesis. + /// -> str | array + cosupervisor: none, + /// Deprecated: use `supervisor`. + /// -> str | array + advisor: none, + /// Deprecated use `cosupervisor`. + /// -> str | array + coadvisor: none, + /// Academic year of the thesis. + /// -> auto | str + academic-year: auto, + /// Tutor of the thesis. + /// -> str + tutor: none, + /// Cycle of the thesis. + /// -> str + cycle: none, + /// Chair of the thesis. + /// -> str + chair: none, + /// Student ID. + /// -> str + student-id: none, + /// Student course. + /// -> str + course: none, + /// Frontispiece of the thesis. Can be either: `phd`, `deib-phd`, `cs-eng-master` or `classical-master`. + /// -> "phd" | "deib-phd" | "cs-eng-master" | "classical-master" + frontispiece: "phd", + /// Custom logo of the thesis. + /// -> image + custom-logo: none, + body, +) = { + let colored-headings = false + if frontispiece in ("deib-phd", "classical-master", "cs-eng-master") { + colored-headings = true + } + // retrocompatibility + if (supervisor == none and advisor != none) { + supervisor = advisor + } + if (cosupervisor == none and coadvisor != none) { + cosupervisor = coadvisor + } + _document-type.update(frontispiece) + + set document( + title: title, + author: author, + ) + + set text( + lang: language, + size: 12pt, + font: "New Computer Modern", + hyphenate: true, + ) + show math.equation: set text(font: "New Computer Modern Math") + + set par( + justify: true, + linebreaks: "optimized", + spacing: 1.7em, + ) + + set page( + paper: "a4", + margin: ( + top: 4.2cm, + bottom: 2.5cm, + inside: 3cm, + outside: 2cm, + ), + numbering: "i", + header: context { + let page-counter = counter(page).display() + if ( + _is-page-empty() or _document-state.get() == "TITLE_PAGE" + ) { + return + } else if ( + _document-state.get() in ("FRONTMATTER", "BACKMATTER") + ) { + if (calc.even(here().page())) { + page-counter + h(1fr) + } else { + h(1fr) + page-counter + } + } else if ( + _document-state.get() in ("MAINMATTER", "APPENDIX", "ACKNOWLEDGEMENTS") + ) { + let h1-current-page = ( + query(heading.where(level: 1)).filter(h1 => h1.location().page() == here().page()).len() != 0 + ) + let last-h1 = query(selector(heading.where(level: 1)).before(here())).last().body + + let chapter-info = if not (h1-current-page) { + set text(weight: "bold") + if (heading.numbering != none) { + let heading-num = counter(heading.where(level: 1)).display(header-numbering) + text( + fill: if (colored-headings) { bluepoli } else { black }, + heading-num, + ) + } + last-h1 + } + + if (calc.even(here().page())) { + page-counter + h(1fr) + chapter-info + } else { + chapter-info + h(1fr) + page-counter + } + } else { + _document-state.update("FIRST_RAGGIERA") + } + }, + footer: none, + background: context { + if (_is-page-empty() or _document-state.get() == "FIRST_RAGGIERA") and not _is-page-in-outline() { + // measurements taken from PDF via Inkscape + place( + dx: -36.970mm, + dy: 129.629mm, + _raggiera-image(178.435mm), + ) + } + }, + ) + + // FIGURES SETTINGS + + set figure(gap: 1.5em) + show figure: set block(breakable: true) + show: _style-figures.with( + colored-caption: colored-headings, + heading-levels: if frontispiece == "phd" { 0 } else { 1 }, + ) + + // --------------------- [ TITLE PAGE ] --------------------- + + import "frontispiece.typ": * + + if academic-year == auto { + academic-year = _show-academic-year( + year: str(std.datetime.today().year() - 1) + "-" + str(std.datetime.today().year()).slice(2), + ) // 20XX-XX) + } + + let shared-attributes = (title, author, supervisor, cosupervisor, academic-year) + + let logos = () + if custom-logo == none { + logos = ( + image("img/logo_ingegneria.svg", width: 112mm), + image("img/logo_deib.svg", height: 38mm), + image("img/logo_ingegneria.svg", width: 93mm), + image("img/logo_ingegneria.svg", width: 93mm), + ) + } else { + logos = (custom-logo,) * 4 + } + + let frontispieces = ( + "phd": _frontispiece-phd(..shared-attributes, logos.at(0), cycle, chair, tutor), + "deib-phd": _frontispiece-deib-phd(..shared-attributes, logos.at(1), cycle, chair, tutor), + "classical-master": _frontispiece-classical-master(..shared-attributes, logos.at(2), course, student-id), + "cs-eng-master": _frontispiece-cs-eng-master(..shared-attributes, logos.at(3), student-id), + ) + + if frontispieces.keys().contains(frontispiece) { + frontispieces.at(frontispiece) + } else { + panic("The frontispiece must be either one of: `phd`, `deib-phd`, `cs-eng-master` or `classical-master`.") + } + + // Document + + show heading: it => { + if (colored-headings) { + text(fill: bluepoli, it) + } else { + it + } + } + + // --------------------- [ CHAPTER STYLE ] --------------------- + + show heading.where(level: 1): it => context { + _empty-page() + v(4cm) + set text(weight: "bold", fill: if (colored-headings) { bluepoli } else { black }) + + let heading-num = counter(selector(heading)).display(chapter-numbering) + if ( + it.numbering != none and (_document-state.get() == "MAINMATTER" or _document-state.get() == "APPENDIX") + ) { + text( + size: 50pt, + weight: "regular", + text( + // weight: "bold", + heading-num, + ), + ) + } + text( + size: 25.2pt, + it.body, + ) + v(10pt) + + // reset all figures counter + context { + for e in query(figure).map(e => e.kind).dedup() { + counter(figure.where(kind: e)).update(0) + } + } + } + + show heading: it => context { + let section-fill = if (colored-headings) { bluepoli } else { black } + if (it.level == 1) { + it + } else if (it.level == 2) { + text( + size: _sizes.at("12pt").Large, + fill: section-fill, + if it.numbering != none { counter(heading).display(tab-numbering) } + it.body, + ) + } else if (it.level >= 3) { + text( + size: _sizes.at("12pt").large, + fill: section-fill, + if it.numbering != none { counter(heading).display(tab-numbering) } + it.body, + ) + } + parbreak() + // v(0.5em) + } + + // heading are always referred as chapters, except for the appendix + set heading( + supplement: context if _document-state.get() in "APPENDIX" { + _localization.at(text.lang).appendix + } else { + _localization.at(text.lang).chapter + }, + ) + + // ----------- [ TABLE OF CONTENTS ] ----------- + + // chapter are bold and don't have "..." + show outline.entry.where(level: 1): it => context { + v(19pt, weak: true) + link( + it.element.location(), + strong(it.indented(it.prefix(), it.element.body + h(1fr) + it.page())), + ) + } + + show outline.entry: it => context { + v(1em) + if ( + it.element.func() == figure and it.element.at("kind") == "_blank-toc" + ) { + v(it.element.at("gap")) // \addtocontents{toc}{\vspace{1em}} + return + // } else if it.element.func() == figure and it.element.at("kind") == "__lists" { + // it + // return + } else if it.level > 1 { + v(1em, weak: true) + let spacing = it.level - 1 + h(2em) * spacing + // link(it.element.location(), it) + link(it.element.location(), it.indented( + it.prefix(), + it.element.body + box(width: 1fr, repeat([\u{0009} . \u{0009} \u{0009}])) + it.page(), + )) + } else { + it + } + } + + // custom figures alignment + + show figure.where(kind: "theorem").or(figure.where(kind: "proposition")): it => { + align(start, it) + } + + show outline: set heading(bookmarked: true, outlined: true) + + // show ref: it => text( + // fill: if (colored-headings) { bluepoli } else { black }, + // it, + // ) + + set list(indent: 1.2em) + + set enum(indent: 1.2em) + + // empty page after the frontispiece + _empty-page() + + body +} + +/// The thesis article format styling function. +/// -> content +#let polimi-article-format-thesis( + /// Title of the thesis. + /// -> str + title: "Thesis Title", + /// Author of the thesis. + /// -> str + author: none, + /// Supervisor of the thesis. + /// -> str + supervisor: none, + /// Cosupervisor(s) of the thesis. + /// -> str | array + cosupervisor: none, + /// Deprecated: use `supervisor`. + /// -> str | array + advisor: none, + /// Deprecated: use `cosupervisor`. + /// -> str | array + coadvisor: none, + /// Academic year of the thesis. + /// -> auto | str + academic-year: auto, + /// Student ID. + /// -> str + student-id: none, + /// Student course. + /// -> str + course: none, + /// Abstract. + /// -> content + abstract: [], + /// Keywords, that appear below the abstract (and in the PDF metadata). + /// -> str + keywords: none, + /// Logo of the thesis. + /// -> path + logo: image("img/logo_ingegneria.svg", width: 83mm), + body, +) = { + set document( + title: title, + author: author, + ) + if keywords != none { + set document( + keywords: keywords, + ) + } + // retrocompatibility + if (supervisor == none and advisor != none) { + supervisor = advisor + } + if (cosupervisor == none and coadvisor != none) { + cosupervisor = coadvisor + } + _document-type.update("article-format") + + set text( + lang: language, + size: 11pt, + font: "New Computer Modern", + hyphenate: true, + ) + show math.equation: set text(font: "New Computer Modern Math") + + set par( + justify: true, + linebreaks: "optimized", + spacing: 0.65em, + first-line-indent: 0pt, + ) + + set page( + margin: ( + top: 2cm, + right: 2cm, + bottom: 2cm, + left: 2cm, + ), + numbering: "1", + number-align: bottom + center, + background: context if here().page() == 1 { + place( + dx: 135mm, + dy: -30mm, + _raggiera-image(105mm), + ) + }, + ) + + set list(indent: 1.2em, tight: true, marker: ($bullet$, $circle$, $-$)) + set enum(indent: 1.2em, tight: true) + + set heading(numbering: "1.1.") + show heading: it => { + set text(fill: bluepoli) + v(0.45cm) + if it.numbering != none { counter(heading).display() + h(1em) } + it.body + v(0.45cm) + } + + set figure(gap: 1.5em) + show figure: set block(breakable: true) + show: _style-figures.with(colored-caption: true) + + { + set text(size: _sizes.at("11pt").small) + { + // Title + set text(size: 0.3cm, weight: "bold") + set par(spacing: 0.5cm) + + v(0.8cm) + + logo + + v(0.7cm) + + { + set text(fill: bluepoli) + + text(size: _sizes.at("11pt").Large, title) + + v(0.25cm) + + smallcaps( + "Tesi di Laurea Magistrale in" + linebreak() + course, + ) + } + + v(0.15cm) + + (author, student-id).filter(e => e != none).map(e => text(size: _sizes.at("11pt").large, e)).join(", ") + } + + v(0.25cm) + + line(length: 100%, stroke: 0.4pt) + + v(0.25cm) + + if academic-year == auto { + academic-year = str(std.datetime.today().year() - 1) + "-" + str(std.datetime.today().year()) + } + + grid( + columns: (22%, 1fr), + align: (horizon + left, left), + grid.cell( + inset: 5%, + context { + set text(size: _sizes.at("11pt").scriptsize) + set par(justify: false, spacing: 1.7em) + + _show-starvisor(supervisor, "supervisor", separator: ":\n", key: strong) + + parbreak() + + _show-starvisor(cosupervisor, "cosupervisor", separator: ":\n", key: strong) + + parbreak() + + strong(_show-academic-year()) + linebreak() + academic-year + }, + ), + context text(fill: bluepoli, _localization.at(text.lang).abstract + ": ") + abstract, + ) + + v(1em) + + if keywords != none { + banner[#strong(_localization.at(text.lang).keywords + ": ") #keywords] + } + } + + // this must be an error from the original template... + // set text(size: _sizes.at("11pt").small) + + v(0.4cm) + + body +} + +/// The executive summary styling function. +/// -> content +#let polimi-executive-summary( + /// Title of the thesis. + /// -> str + title: "Thesis Title", + /// Author of the thesis. + /// -> str + author: none, + /// Supervisor of the thesis. + /// -> str + supervisor: none, + /// Cosupervisor(s) of the thesis. + /// -> str | array + cosupervisor: none, + /// Deprecated: use `supervisor`. + /// -> str | array + advisor: none, + /// Deprecated: use `cosupervisor`. + /// -> str | array + coadvisor: none, + /// Academic year of the thesis. + /// -> auto | str + academic-year: auto, + /// Student course. + /// -> str + course: none, + /// Logo of the thesis. + /// -> path + logo: image("img/logo_ingegneria.svg", width: 83mm), + body, +) = { + set document( + title: title, + author: author, + ) + // retrocompatibility + if (supervisor == none and advisor != none) { + supervisor = advisor + } + if (cosupervisor == none and coadvisor != none) { + cosupervisor = coadvisor + } + _document-type.update("executive-summary") + + set text( + lang: language, + size: 10.5pt, // it should be 11pt, though due to how LaTeX originally handles it this size seems to be best for an adaptation + font: "New Computer Modern", + hyphenate: true, + ) + show math.equation: set text(font: "New Computer Modern Math") + + set par( + justify: true, + linebreaks: "optimized", + spacing: 0.7em, + first-line-indent: 0pt, + ) + + set page( + margin: ( + top: 3cm, + left: 2cm, + right: 2cm, + bottom: 2cm, + ), + numbering: "1", + number-align: bottom + center, + columns: 2, + header: context if here().page() > 1 { + banner(strong("Executive Summary" + h(1fr) + author)) + }, + background: context if here().page() == 1 { + place( + dx: 135mm, + dy: -30mm, + _raggiera-image(105mm), + ) + }, + ) + set columns(gutter: 30pt) + + // Title + { + if academic-year == auto { + academic-year = str(std.datetime.today().year() - 1) + "-" + str(std.datetime.today().year()) + } + + place( + top + left, + float: true, + scope: "parent", + context { + set text(weight: "bold", size: 0.3cm) + set par(spacing: 0.5cm) + + v(0.8cm) + + logo + + v(0.7cm) + + { + set text(fill: bluepoli) + + smallcaps( + "Executive Summary of the Thesis", + ) + + v(0.1cm) + + text(size: _sizes.at("11pt").Large, title) + + v(0.25cm) + + smallcaps( + "Laurea Magistrale in " + course, + ) + } + + v(0.1cm) + + _show-author() + smallcaps(author) + v(-0.3em) + + _show-starvisor(supervisor, "supervisor", separator: ": ", out: smallcaps) + + parbreak() + + _show-starvisor(cosupervisor, "cosupervisor", separator: ": ", out: smallcaps) + + parbreak() + + _show-academic-year() + " " + smallcaps(academic-year) + + v(0.25cm) + + line(length: 100%, stroke: 0.4pt) + }, + ) + } + + set list(indent: 1.2em, tight: true, marker: ($bullet$, $circle$, $-$)) + set enum(indent: 1.2em, tight: true) + + set heading(numbering: tab-numbering) + show heading: it => { + set text(fill: bluepoli) + v(1em, weak: true) + // if it.numbering != none { counter(heading).display() + h(1em) } + // it.body + it + v(0.75em, weak: true) + } + + set figure(gap: 1.5em) + show figure: set block(breakable: true) + show: _style-figures.with(colored-caption: true) + + body +} + +/// Helper function to manually add blank space above an outline entry (similar to LaTeX's ```tex \addtocontents{toc}{\vspace{1em}}```). +/// -> content +#let _blank-toc( + /// Vertical space to add before the next outline entry. + /// -> length + space: 1em, +) = { + let _blank-toc-figure = figure.with( + kind: "_blank-toc", + numbering: none, + supplement: none, + outlined: true, + gap: space, + caption: [], + ) + + { + show heading: none + show figure: none + _blank-toc-figure("") + } +} + +// Document sections + +/// Frontmatter section. Similar to LaTeX's ```tex \frontmatter```, it is meant to be only used in the thesis. It sets the page numbering to `"i"` and ```typc numbering: none``` for headings. +/// -> content +#let frontmatter(body) = { + _document-state.update("FRONTMATTER") + // counter(page).update(0) + // _empty-page() + set page(numbering: "i") + set heading(numbering: none) + + body +} + +/// Acknowledgements section. It sets ```typc numbering: none``` for headings. +/// -> content +#let acknowledgements(body) = { + _blank-toc() + _document-state.update("ACKNOWLEDGEMENTS") + set heading(numbering: none) + + body +} + +/// Mainmatter section. Similar to LaTeX's ```tex \mainmatter```, it is meant to be only used in the thesis. It sets to page numbering to `"1"`, heading numbering to ```typc "1.1" + h()``` and resets the page counter. +/// -> content +#let mainmatter(body) = { + _blank-toc() + _document-state.update("MAINMATTER") + set heading(numbering: "1.1.") + _empty-page() + set page(numbering: "1") + counter(page).update(1) + + body +} + +/// Appendix section. Similar to LaTeX's ```tex \appendix```. It sets heading numbering to ```typc "A.1"``` and resets their counter. +/// -> content +#let appendix(body) = context { + _blank-toc() + _document-state.update("APPENDIX") + counter(heading).update(0) + set heading(numbering: "A.1.") + + body +} + +/// Backmatter section. Similar to LaTeX's ```tex \backmatter```, it is meant to be only used in the thesis. It sets heading numbering to ```typc none```. +/// -> content +#let backmatter(body) = context { + _blank-toc() + _document-state.update("BACKMATTER") + set heading(numbering: none) + + body +} + +// Outlines + +#let target = ( + figure.where(kind: "_blank-toc", outlined: true).or(heading.where(outlined: true)) +) + +/// Custom-built ```typc outline()```. +/// -> content +#let toc = { + [#metadata(none) <__toc-start>] + outline( + title: context _localization.at(text.lang).toc, + indent: 1.2em, + target: target, + ) + [#metadata(none) <__toc-end>] +} + +/// Internal helper function to create the custom lists of figures and table. +/// -> content +#let _lists-entries-style( + /// Outline entry to edit. + /// -> outline-entry + outline-entry, + /// The kind of the outline entry element (image or table). + /// -> function + kind, +) = { + // don't print figures without caption + if outline-entry.element.at("caption") == none { return } + let count = ( + str(counter(heading.where(level: 1)).at(outline-entry.element.location()).at(0)) + + "." + + str(counter(figure.where(kind: kind)).at(outline-entry.element.location()).at(0)) + ) + link(outline-entry.element.location(), { + count + h(1em) + outline-entry.element.at("caption").body + box(width: 1fr, repeat([\u{0009} \u{0009} . \u{0009}])) // \u{0009} = Tab + str(counter(page).at(outline-entry.element.location()).at(0)) + }) + linebreak() +} + +/// List of figures. Similar to LaTeX's ```tex \listoffigures```. +/// -> content +#let list-of-figures = { + show outline.entry: it => { + _lists-entries-style(it, image) + } + [#metadata(none) <__toc-start>] + outline( + title: context _localization.at(text.lang).list-of-figures, + indent: 1.2em, + target: figure.where(kind: image), + ) + [#metadata(none) <__toc-end>] +} + +/// List of tables. Similar to LaTeX's ```tex \listoftables```. +/// -> content +#let list-of-tables = { + show outline.entry: it => { + _lists-entries-style(it, table) + } + [#metadata(none) <__toc-start>] + outline( + title: context _localization.at(text.lang).list-of-tables, + indent: 1.2em, + target: figure.where(kind: table), + ) + [#metadata(none) <__toc-end>] +} + +/// Displays a simple nomenclature with keys and values. +/// ```example +/// +/// #nomenclature(( +/// "Polimi": "Politecnico di Milano", +/// "CdL": "Corso di Laurea", +/// "CCS": "Consigli di Corsi di Studio", +/// "CFU": "Crediti Formativi Universitari", +/// )) +/// ``` +/// -> content +#let nomenclature( + /// Dictionary that hold keys and values. + /// -> dictionary + dict, + /// Whether to indent or not the nomenclature. + /// -> bool + indented: true, +) = context { + heading( + _localization.at(text.lang).nomenclature, + // outlined: false, + ) + if (indented) { + show grid.cell: it => { + if (it.x == 0) { + text(style: "oblique", upper(it)) + } else { + it + } + } + grid( + columns: 2, + column-gutter: 1em, + row-gutter: 1em, + ..dict.pairs().flatten() + ) + } else { + for (key, value) in dict { + text(style: "oblique", upper(key)) + h(1.5em) + value + parbreak() + } + } +} + +// Theorems implementation + +#import "@preview/great-theorems:0.1.2": * +#import "@preview/headcount:0.1.1": * + +#let thm-cnt = counter("thm") +#let prop-cnt = counter("prop") +#let lemma-cnt = counter("lemma") +#let remark-cnt = counter("remark") + +/// Theorem block. +/// -> content +#let theorem = mathblock( + blocktitle: context _localization.at(text.lang).theorem, + prefix: count => [ + #context { + set text(weight: "bold", fill: if ("executive-summary", "article-format").contains(_document-type.get()) { + bluepoli + } else { black }) + _localization.at(text.lang).theorem + " " + count + "." + } + ], + counter: thm-cnt, + bodyfmt: text.with(style: "italic"), + numbering: dependent-numbering("1.1", levels: 1), + suffix: context { if _document-type.get() == "executive-summary" { v(0.2cm) } }, +) + +/// Proposition block. +/// -> content +#let proposition = mathblock( + blocktitle: context _localization.at(text.lang).proposition, + prefix: count => [ + #context { + set text(weight: "bold", fill: if ("executive-summary", "article-format").contains(_document-type.get()) { + bluepoli + } else { black }) + _localization.at(text.lang).proposition + " " + count + "." + } + ], + counter: prop-cnt, + bodyfmt: text.with(style: "italic"), + numbering: dependent-numbering("1.1", levels: 1), + suffix: context { if _document-type.get() == "executive-summary" { v(0.2cm) } }, +) + +/// Lemma block. +/// -> content +#let lemma = mathblock( + blocktitle: context _localization.at(text.lang).lemma, + prefix: count => [ + #context { + set text(weight: "bold", fill: if ("executive-summary", "article-format").contains(_document-type.get()) { + bluepoli + }) + _localization.at(text.lang).lemma + " " + count + "." + } + ], + counter: lemma-cnt, + bodyfmt: text.with(style: "italic"), + numbering: dependent-numbering("1.1", levels: 1), + suffix: context { if _document-type.get() == "executive-summary" { v(0.2cm) } }, +) + +/// Remark block. +/// -> content +#let remark = mathblock( + blocktitle: context _localization.at(text.lang).remark, + prefix: count => [ + #context { + set text(weight: "bold", fill: if ("executive-summary", "article-format").contains(_document-type.get()) { + bluepoli + }) + _localization.at(text.lang).remark + " " + count + "." + } + ], + counter: remark-cnt, + bodyfmt: text.with(style: "italic"), + numbering: dependent-numbering("1.1", levels: 1), + suffix: context { if _document-type.get() == "executive-summary" { v(0.2cm) } }, +) + +/// Proof block. +/// -> content +#let proof = proofblock( + suffix: context { if _document-type.get() == "executive-summary" { v(0.2cm) } }, +) + +/// Utility function to initialize the theorem environments#footnote[Provided by #link("https://typst.app/universe/package/great-theorems", "great-theorems") package.]: +/// - theorem +/// - proposition +/// - lemma +/// - remark +/// -> content +#let theorems-init(body) = { + show: great-theorems-init + show heading.where(level: 1): reset-counter(thm-cnt, levels: 1) + show heading.where(level: 1): reset-counter(prop-cnt, levels: 1) + show heading.where(level: 1): reset-counter(lemma-cnt, levels: 1) + show heading.where(level: 1): reset-counter(remark-cnt, levels: 1) + + body +} + +/// Creates a new subfigure with the given arguments and an optional label. From #link("https://github.com/mewmew/hallon-typ", "hallon") package. +/// -> content +#let subfigure( + ..args, + /// Whether to outline this subfigure or not. + /// -> bool + outlined: false, + /// Unique label to reference this subfigure + /// -> str + label: none, + body, +) = { + let fig = figure(body, kind: "subfigure", outlined: outlined, ..args) + if label == none { + return fig + } + [ #fig #label ] +} diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/src/utils.typ b/packages/preview/elegant-polimi-thesis/0.2.1/src/utils.typ new file mode 100644 index 0000000000..1bfbc0e073 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/src/utils.typ @@ -0,0 +1,461 @@ +/// LaTeX sizes to match original templates (https://tex.stackexchange.com/questions/24599/what-point-pt-font-size-are-large-etc) +/// -> dict +#let _sizes = ( + "10pt": ( + tiny: 5pt, + scriptsize: 7pt, + footnotesize: 8pt, + small: 9pt, + normalsize: 10pt, + large: 12pt, + Large: 14.4pt, + LARGE: 17.28pt, + huge: 20.74pt, + Huge: 24.88pt, + ), + "11pt": ( + tiny: 6pt, + scriptsize: 8pt, + footnotesize: 9pt, + small: 10pt, + normalsize: 10.95pt, + large: 12pt, + Large: 14.4pt, + LARGE: 17.28pt, + huge: 20.74pt, + Huge: 24.88pt, + ), + "12pt": ( + tiny: 6pt, + scriptsize: 8pt, + footnotesize: 10pt, + small: 10.95pt, + normalsize: 12pt, + large: 14.4pt, + Large: 17.28pt, + LARGE: 20.74pt, + huge: 24.88pt, + Huge: 24.88pt, + ), +) + +/// The current state (title page, \*matter...) +/// -> state +#let _document-state = state("init", "TITLE_PAGE") + +/// The current type of document. +/// -> state +#let _document-type = state("init", "phd") + +/// Localization dictionary. It could be deprecated since theses are written exclusively in English. +/// -> dict +#let _localization = yaml("locale.yaml") + +/// Signature PoliMi colour (#box(baseline: 0.1em, rect(height: 0.7em, width: 0.7em, fill: rgb("#5f859f")))), used in headings and labels. +/// -> color +#let bluepoli = rgb("#5f859f") + +// Raggiera related functions + +// https://forum.typst.app/t/how-to-use-set-page-without-adding-an-unwanted-pagebreak/3129/2 + +/// Adds an empty page between an odd page and the next. Used to check when to remove the header and place a raggiera in the bottom left corner. +/// -> content +#let _empty-page() = { + [#metadata(none) <__chapter-end>] + pagebreak(weak: true, to: "odd") + [#metadata(none) <__chapter-start>] +} + +/// Check if the current page is between the given labels. +/// -> bool +#let _is-page-between-labels( + /// The start label. + /// -> label + start-label, + /// The end label. + /// -> label + end-label, + /// Function to apply to the array. + /// -> function + function, +) = query(start-label).zip(query(end-label)).any(function) + +/// Check if a page is empty. +/// -> bool +#let _is-page-empty() = _is-page-between-labels( + <__chapter-end>, + <__chapter-start>, + ((start, end)) => { + let page = here().page() + let first-page = start.location().page() + let last-page = end.location().page() + return page > first-page and page < last-page + }, +) + +/// Check if a page is in an outline. +/// -> bool +#let _is-page-in-outline() = _is-page-between-labels( + <__toc-start>, + <__toc-end>, + ((start, end)) => { + let page = here().page() + let first-page = start.location().page() + let last-page = end.location().page() + return not _is-page-empty() and page > first-page and page < last-page or page == first-page or page == last-page + }, +) + +/// Inserts a raggiera, given a specified width. +/// -> content +#let _raggiera-image( + /// Side of the raggiera. + /// -> length + side, +) = ( + image( + width: side, + height: side, + "img/raggiera.svg", + ) +) + +/// Draw a banner. +/// -> content +#let banner( + /// Body of the banner. + /// -> content + body, +) = rect( + width: 100%, + fill: bluepoli.lighten(40%), // #9AAFC2 + inset: (rest: 1em, x: 1.7em), + text( + fill: white, + body, + ), +) + +// Numbering functions + +/// Alternative numbering: ```typc "1.1." + h-space```. +/// -> content +#let tab-numbering( + /// Horizontal space. + /// -> length + h-space: 0.7em, + /// Numbers. + /// -> arguments + ..n, +) = return n.pos().map(str).join(".") + "." + h(h-space) + +/// Chapter numbering. +/// -> content +#let chapter-numbering( + /// Numbers. + /// -> arguments + ..n, +) = return text(weight: "bold", str(n.pos().first())) + h(1.5mm) + "|" + h(7.5mm) + +/// Numbering used in the theses header. +/// -> content +#let header-numbering( + /// Numbers. + /// -> arguments + ..n, +) = return str(n.pos().first()) + "| " + +#let shared-formatting(title, author, language, body, text-size: 11pt, keywords: "") = { + set document( + title: title, + author: author, + keywords: keywords, + ) + + set text( + lang: language, + size: text-size, + font: "New Computer Modern", + hyphenate: true, + ) + show math.equation: set text(font: "New Computer Modern Math") + + set par( + justify: true, + linebreaks: "optimized", + spacing: 0.7em, + first-line-indent: 0pt, + ) + + set figure(gap: 1.5em) + show figure: set block(breakable: true) + show: _style-figures.with(colored-caption: true, heading-levels: 1) + + body +} + +/// Helper function to detect whether a field is present and, if true, show it. +/// -> content +#let _show-field( + /// Prefix (e.g. "Prof: "), + /// -> str + prefix, + /// Exact field to check (e.g. title). + /// -> variable + field, + /// Separator between fields. + /// -> function | content + separator: linebreak(), +) = { + if (field != none and field != "") { + return prefix + field + separator + } +} + +/// Helper function to handle (co)supervisor(s). +/// -> content +#let _show-starvisor( + /// (Co)Supervisor(s) of the thesis. + /// -> str | array + starvisor, + /// The key to look for in the locale dictionary + /// -> "supervisor" | "cosupervisor" + locale-key, + /// How to seperate the key from the content. + /// -> string | content + separator: ": ", + /// How to separate multiple starvisors. + /// -> string | content + join-separator: ", ", + /// Function that will be applied to the key. + /// -> function + key: x => x, + /// Function that will be applied to the content. + /// -> function + out: x => x, +) = { + if (starvisor == none) { return } + context { + if type(starvisor) == str or (type(starvisor) == array and starvisor.len() == 1) { + key(_localization.at(text.lang).at(locale-key)) + separator + out(starvisor) + } else if type(starvisor) == array and starvisor.len() > 1 { + key(_localization.at(text.lang).at(locale-key + "s")) + separator + starvisor.map(out).join(join-separator) + } else { + panic("(Co)supervisor(s) must be passed as string or as array.") + } + linebreak() + } +} + +/// Helper function to show localized author. +/// -> content +#let _show-author() = context { + return _localization.at(text.lang).author + ": " +} + +/// Helper function to show localized academic year. +/// -> content +#let _show-academic-year(year: none) = context { + if (year == none) { + return _localization.at(text.lang).academic-year + } else { + return _localization.at(text.lang).academic-year + ": " + year + } +} + +/// Helper function to show the thesis cycle. +/// -> content +#let _show-cycle(cycle) = context { + if (cycle != none) { + " -- " + cycle + " " + _localization.at(text.lang).cycle + } else { + linebreak() + } +} + +// ===================== +// PRESENTATION +// ===================== + +#import "@preview/touying:0.7.4": * + +/// The background panes used in some slides. +/// -> dict +#let _pane = ( + left: 15.86cm, + right: 51.86cm, +) + +/// (1..20) -> (01,02,03,..., 10, 11, 12,...,20) +/// -> numbering +#let _numbering-with-padding = (..args) => { + let numbers = args.pos() + let output = numbering( + "1", + ..numbers, + ) + if (str(numbers.first()).len() == 1) { + output = "0" + output + } + return output +} + +/// Empty block. +/// -> content +#let _spacer(width, height) = block( + width: width, + height: height, +) + +/// Internal stroke. +/// -> stroke +#let _stroke-no-border(color) = (x, y) => ( + top: if (y > 0) { (paint: color, thickness: 0.1pt) }, + left: if (x > 0) { (paint: color, thickness: 0.1pt) }, +) + +/// Custom made header. +/// -> content +#let _poli-header( + /// The text arguments for the title. + /// -> dict + text-args: (size: 15pt, weight: "regular", fill: rgb("#5e5e5e")), + self, +) = context { + set text(..text-args) + let svg-bytes = read("img/9-cerchi.svg") + svg-bytes = svg-bytes.replace( + "#aaaaaa", + text-args.fill.to-hex(), + ) + let toc-label = query(<_polimi-digital-presentation-toc>) + show: pad.with(left: 2cm, right: 1.25cm) + grid( + columns: (_pane.left, 1fr), + { + _numbering-with-padding(counter(heading.where(level: 1)).at(here()).at(0)) + ". " + utils.display-current-heading(level: 1, numbered: false) + }, + { + let arr = () + if (self.info.title != none) { + arr.push(self.info.title) + } + if (self.info.date != none) { + arr.push(utils.display-info-date(self)) + } + arr.join(" | ") + h(1fr) + if toc-label.len() != 0 { + link( + (page: toc-label.first().location().page(), x: 0pt, y: 0pt), + box( + image(bytes(svg-bytes), height: 1em), + baseline: 10%, + ), + ) + } + h(1cm) + context utils.slide-counter.display() + }, + ) +} + +/// Apply a fill colour to the panes. +/// -> content +#let _poli-bg-split() = { + set rect(stroke: none, height: 100%) + stack( + dir: ltr, + rect(width: _pane.left, fill: rgb("#fdfdfd")), + rect(width: _pane.right, fill: rgb("#f3f3f3")), + ) +} + +// DIVIDER + +/// New section body, that is title, lettering and chapter number. +/// -> content +#let _divider-body(title, lettering, number, text-fill) = { + if title != none { + pad( + top: 7.54cm, + left: 15.93cm, + text( + size: 54pt, + weight: "bold", + fill: text-fill, + title, + ), + ) + } + if lettering != none { + place( + bottom, + pad( + bottom: 0.32cm, // forse da sistemare + left: 15.93cm, + text( + fill: text-fill, + lettering, + ), + ), + ) + } + if number != none { + place( + right + bottom, + pad( + right: 2.71cm, + bottom: 2cm, + text( + size: 200pt, + weight: "light", + fill: text-fill, + number, + ), + ), + ) + } +} + +/// Style the new section background. +/// -> content +#let _divider-bg-args(fill, stroke) = { + return ( + fill: fill, + background: { + place(top + left, grid( + columns: (auto, 1fr), + stroke: _stroke-no-border(stroke), + inset: (right: 0.1cm), + align: horizon, + [], _spacer(100%, 20%), + circle(radius: 72mm / 2, stroke: stroke), [], + _spacer(auto, 1fr), + )) + }, + ) +} + +/// Standard subslide preamble. +/// -> content +#let _basic-subslide-preamble( + self, + inset: (top: 4.6cm), + text-args: ( + size: 42pt, + ), +) = { + return block( + inset: inset, + text( + ..text-args, + weight: "light", + fill: self.colors.primary, + utils.display-current-heading(level: self.slide-level), + ), + ) +} diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/template/main.typ b/packages/preview/elegant-polimi-thesis/0.2.1/template/main.typ new file mode 100644 index 0000000000..cbae4982fe --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/template/main.typ @@ -0,0 +1,65 @@ +#import "@preview/elegant-polimi-thesis:0.2.1": * + +#show: polimi-thesis.with( + title: "Thesis Title", + author: "Name Surname", + supervisor: "Prof. Supervisor", + cosupervisor: "Prof. Cosupervisor", + // cosupervisor: ("Prof. Cosupervisor1", "Prof. Cosupervisor2"), + tutor: "Prof. Tutor", + academic-year: "2025-2026", + frontispiece: "phd", +) + +#show: theorems-init // remove if you don't plan to use theorems, proposition, lemmas or remarks + +#show: frontmatter + += Abstract + +#lorem(100) + += Sommario + +#lorem(100) + +#toc +#list-of-figures +#list-of-tables + +#let _nomenclature = ( + "Polimi": "Politecnico di Milano", + "CdL": "Corso di Laurea", + "CCS": "Consigli di Corsi di Studio", + "CFU": "Crediti Formativi Universitari", +) +#nomenclature( + _nomenclature, + indented: false, +) + +#show: mainmatter + +#heading("Introduction", numbering: none) + +#lorem(100) + += First chapter + +#lorem(100) + +#show: backmatter + +// bibliography + +#show: appendix + += First appendix + +#lorem(100) + +#show: acknowledgements + += Acknowledgements + +#lorem(100) diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/template/presentation.typ b/packages/preview/elegant-polimi-thesis/0.2.1/template/presentation.typ new file mode 100644 index 0000000000..675b18cd66 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/template/presentation.typ @@ -0,0 +1,53 @@ +#import "@preview/elegant-polimi-thesis:0.2.1": * +#import "@preview/touying:0.7.4": * + +#show: polimi-digital-presentation.with( + config-info( + title: "Title of the Presentation", + author: "Name Surname", + subtitle: "Subtitle", + theme: "Theme", + date: datetime.today(), + ), +) + +#title-slide() + +#make-outline() + += First Section + +== Slide in first section + +#lorem(50) + +#lorem(40) + +== Split slide + +#split-slide( + left: [ + #lorem(30) + + #lorem(30) + ], + right: [ + === Paragraph title + #lorem(120) + + === Paragraph title + #lorem(120) + ], +) + += Second Section + +== Slide in second section + +#lorem(20) + +#lorem(20) + +#lorem(20) + +#focus-slide[Thanks for listening] diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/article-format.png b/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/article-format.png new file mode 100644 index 0000000000..de594db035 Binary files /dev/null and b/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/article-format.png differ diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/classical-master.png b/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/classical-master.png new file mode 100644 index 0000000000..ee14516292 Binary files /dev/null and b/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/classical-master.png differ diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/cs-eng-master.png b/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/cs-eng-master.png new file mode 100644 index 0000000000..6013332269 Binary files /dev/null and b/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/cs-eng-master.png differ diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/deib-phd.png b/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/deib-phd.png new file mode 100644 index 0000000000..d1633c1590 Binary files /dev/null and b/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/deib-phd.png differ diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/executive-summary.png b/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/executive-summary.png new file mode 100644 index 0000000000..654d4ee724 Binary files /dev/null and b/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/executive-summary.png differ diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/phd.png b/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/phd.png new file mode 100644 index 0000000000..5b0e02824a Binary files /dev/null and b/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/phd.png differ diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/presentation.png b/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/presentation.png new file mode 100644 index 0000000000..a39b16f936 Binary files /dev/null and b/packages/preview/elegant-polimi-thesis/0.2.1/thumbnails/presentation.png differ diff --git a/packages/preview/elegant-polimi-thesis/0.2.1/typst.toml b/packages/preview/elegant-polimi-thesis/0.2.1/typst.toml new file mode 100644 index 0000000000..933e2313d2 --- /dev/null +++ b/packages/preview/elegant-polimi-thesis/0.2.1/typst.toml @@ -0,0 +1,23 @@ +[package] +name = "elegant-polimi-thesis" +version = "0.2.1" +entrypoint = "src/lib.typ" +authors = ["Vittorio Robecchi "] +repository = "https://github.com/VictuarVi/PoliMi-PhD-Thesis" +license = "GPL-3.0-or-later" +description = "Unofficial theses and summaries templates for the Polytechnic University of Milan." +keywords = [ + "polimi", + "politecnico di milano", + "thesis", + "polytechnic university of milan", +] +categories = ["thesis", "paper"] +disciplines = ["engineering", "mathematics", "physics"] +compiler = "0.13.0" +exclude = ["*.sh", "*.pdf", "/examples/*", "/thumbnails/*.typ", "/docs/*"] + +[template] +path = "template" +entrypoint = "main.typ" +thumbnail = "thumbnails/classical-master.png"