diff options
author | Norbert Preining <norbert@preining.info> | 2021-05-29 03:01:39 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-05-29 03:01:39 +0000 |
commit | c735cad430ba6a619963ad7248020b781a0a45f3 (patch) | |
tree | ea6084fa9eea4a658d4f3eb9f2495cf269c7f790 /macros/latex/contrib | |
parent | fd03eb3aab9edb9b15484a1130509cebe187d8bd (diff) |
CTAN sync 202105290301
Diffstat (limited to 'macros/latex/contrib')
46 files changed, 2928 insertions, 961 deletions
diff --git a/macros/latex/contrib/bjfuthesis/LICENSE b/macros/latex/contrib/bjfuthesis/LICENSE new file mode 100644 index 0000000000..f288702d2f --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> + 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. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + 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 <https://www.gnu.org/licenses/>. + +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: + + <program> Copyright (C) <year> <name of author> + 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 +<https://www.gnu.org/licenses/>. + + 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 +<https://www.gnu.org/licenses/why-not-lgpl.html>. diff --git a/macros/latex/contrib/bjfuthesis/README.md b/macros/latex/contrib/bjfuthesis/README.md new file mode 100644 index 0000000000..08f84f196b --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/README.md @@ -0,0 +1,23 @@ +# Beijing Forestry University (BJFU) Thesis Template in LaTeX +Copyright (C) 2021 Liu Changxin + +Version 0.0.1 (2021-05-28) + +## License +Licensed under the GNU General Public License v3.0 (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.gnu.org/licenses/gpl-3.0.html + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +## Abstract +The bjfuthesis class is a LaTeX class intended for students in Beijing Forestry University (BJFU) to write their theses. The class is based on the ctexbook class. It modifies some of the layout and style definitions of these packages in order to provide a document layout that should be compatible with Beijing Forestry University Thesis Standard. + +## Installation +Get the latest release of bjfuthesis from + + https://github.com/bjfu-projects/bjfu-thesis
\ No newline at end of file diff --git a/macros/latex/contrib/bjfuthesis/bjfuthesis.cls b/macros/latex/contrib/bjfuthesis/bjfuthesis.cls new file mode 100644 index 0000000000..aa28496212 --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/bjfuthesis.cls @@ -0,0 +1,101 @@ +% +% Copyright 2021 Liu Changxin <liuchx@hotmail.com> +% +% Licensed under the GNU General Public License v3.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% https://www.gnu.org/licenses/gpl-3.0.html +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% + +\NeedsTeXFormat{LaTeX2e}[2020/10/01] +\newcommand*\@iflatexlater{\@ifl@t@r\fmtversion} +\@iflatexlater{2020/10/01}{}{\ClassError{bjfuthesis}{The version of LaTeX you installed does not meet the minimum version requirements}} +\def\header@text{北京林业大学本科毕业论文} +\def\keywords@label@zh{关键词:} +\def\keywords@label@en{Keywords: } +\def\chartnote@label{注:} +\ProvidesClass{bjfuthesis}[2021/05/27 LaTeX document style for BJFU thesis] +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}} +\ProcessOptions* +\LoadClass[a4paper,oneside,fontset=none]{ctexbook} +\RequirePackage{pdfpages} +\RequirePackage{graphicx} +\graphicspath{{figures/}} +\RequirePackage{silence} +\RequirePackage{bicaption} +\DeclareCaptionFormat{bjfucaption}{\textbf{\fontsize{9}{21}\selectfont#1#2#3}} +\captionsetup{format=bjfucaption,skip=0pt,labelsep=space} +\captionsetup[figure][bi-second]{name=Figure} +\captionsetup[table][bi-second]{name=Table} +\RequirePackage{amsmath} +\setlength\voffset{-10.4mm} +\setlength\topmargin{0mm} +\setlength\textheight{242mm} +\setlength\footskip{10mm} +\setlength\textwidth{155mm} +\setlength\oddsidemargin{4.6mm} +\setmainfont{Times New Roman} +\setCJKmainfont[AutoFakeBold]{SimSun} +\setCJKmonofont{SimSun} +\newCJKfontfamily\kaiti{KaiTi} +\linespread{1} +\emergencystretch=1em +\RequirePackage{amssymb} +\renewcommand\fps@figure{htbp} +\renewcommand\fps@table{htbp} +\WarningFilter*{latex}{Text page \thepage\space contains only floats} +\NewCommandCopy\oldfigure\figure +\def\figure{\@ifnextchar[\figure@i \figure@ii} +\def\figure@i[#1]{\oldfigure[#1]\centering} +\def\figure@ii{\oldfigure\centering} +\NewCommandCopy\oldtable\table +\def\table{\@ifnextchar[\table@i \table@ii} +\def\table@i[#1]{\oldtable[#1]\centering} +\def\table@ii{\oldtable\centering} +\RequirePackage{fancyhdr} +\pagestyle{fancy} +\fancyhf{} +\fancyhead[C]{\fontsize{9}{12}\selectfont \header@text} +\fancyfoot[C]{\thepage} +\renewcommand\headrulewidth{.5pt} +\fancypagestyle{plain}{\fancyhead[C]{\fontsize{9}{12}\selectfont\header@text}\renewcommand\headrulewidth{.5pt}} +\renewcommand\floatpagefraction{1} +\RequirePackage{titlesec} +\titleformat{\chapter}{\centering\fontsize{16}{30}\bfseries}{\thechapter}{.5em}{} +\titleformat{\section}{\fontsize{14}{37}\bfseries}{\thesection}{.5em}{} +\titleformat{\subsection}{\fontsize{12}{21}\bfseries}{\thesubsection}{.5em}{} +\titlespacing{\chapter}{0pt}{0pt}{10pt} +\titlespacing{\section}{0pt}{0pt}{3pt} +\titlespacing{\subsection}{0pt}{0pt}{0pt} +\RequirePackage{booktabs} +\RequirePackage{titletoc} +\ctexset{chapter/number=\arabic{chapter},chapter/name={}} +\titlecontents{chapter}[0em]{\fontsize{10.5}{21}\bfseries}{\thecontentslabel~}{\thecontentslabel}{\hspace{.5em}\titlerule*{.}\contentspage} +\titlecontents{section}[1em]{\fontsize{10.5}{21}}{\thecontentslabel~}{\thecontentslabel}{\hspace{.5em}\titlerule*{.}\contentspage} +\titlecontents{subsection}[2em]{\fontsize{10.5}{21}}{\thecontentslabel~}{\thecontentslabel}{\hspace{.5em}\titlerule*{.}\contentspage} +\RequirePackage[hidelinks]{hyperref} +\RequirePackage[gbpub=false,style=gb7714-2015]{biblatex} +\addbibresource{bibliography.bib} +\renewcommand\topfraction{1} +\renewcommand\bottomfraction{1} +\renewcommand\textfraction{0} +\newenvironment{abstract}{\kaiti}{\vskip \baselinestretch\baselineskip\par} +\newcommand\keywordscn[1]{\noindent\fontsize{12}{21}\selectfont\textbf{\keywords@label@zh}#1\par} +\newcommand\keywordsen[1]{\noindent\fontsize{12}{21}\selectfont\textbf{\keywords@label@en}#1\par} +\NewCommandCopy\oldfrontmatter\frontmatter +\renewcommand\frontmatter{\IfFileExists{cover.pdf}{\includepdf[pages={1-2}]{cover.pdf}}{\typeout{!! cover.pdf not found}\ClassWarning{bjfuthesis}{cover.pdf not found}}\oldfrontmatter\renewcommand\thepage{\Roman{page}}\fontsize{12}{21}\selectfont} +\NewCommandCopy\oldmainmatter\mainmatter +\renewcommand\mainmatter{\oldmainmatter\fontsize{12}{21}\selectfont} +\newcommand\chartnote[1]{\fontsize{9}{21}\selectfont\\\begin{flushleft}\chartnote@label#1\end{flushleft}} +\NewCommandCopy\oldbackmatter\backmatter +\renewcommand\backmatter{\oldbackmatter\fontsize{10.5}{21}\selectfont} +\NewCommandCopy\oldprintbibliography\printbibliography +\renewcommand\printbibliography{\oldprintbibliography[heading=bibintoc]} +\endinput diff --git a/macros/latex/contrib/bjfuthesis/demo/bibliography.bib b/macros/latex/contrib/bjfuthesis/demo/bibliography.bib new file mode 100644 index 0000000000..ad383a0c4e --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/bibliography.bib @@ -0,0 +1,317 @@ +@article{su2009survey, + title={A survey of collaborative filtering techniques}, + author={Su, Xiaoyuan and Khoshgoftaar, Taghi M}, + journal={Advances in artificial intelligence}, + volume={2009}, + year={2009}, + publisher={Hindawi} +} + +@article{sun2017collaborative, + title={Collaborative intent prediction with real-time contextual data}, + author={Sun, Yu and Yuan, Nicholas Jing and Xie, Xing and McDonald, Kieran and Zhang, Rui}, + journal={ACM Transactions on Information Systems (TOIS)}, + volume={35}, + number={4}, + pages={1--33}, + year={2017}, + publisher={ACM New York, NY, USA} +} + +@inproceedings{zou2020survey, + title={A survey on application of knowledge graph}, + author={Zou, Xiaohan}, + booktitle={Journal of Physics: Conference Series}, + volume={1487}, + number={1}, + pages={012016}, + year={2020}, + organization={IOP Publishing} +} + +@misc{karlgren1990algebra, + title={An algebra for recommendations: Using reader data as a basis for measuring document proximity}, + author={Karlgren, Jussi}, + year={1990}, + publisher={Department of Computer and Systems Sciences, Stockholm University} +} + +@book{karlgren1994newsgroup, + title={Newsgroup clustering based on user behavior-a recommendation algebra}, + author={Karlgren, Jussi}, + year={1994}, + publisher={Swedish Institute of Computer Science} +} + +@article{jafarkarimi2012naive, + title={A naive recommendation model for large databases}, + author={Jafarkarimi, Hosein and Sim, Alex Tze Hiang and Saadatdoost, Robab}, + journal={International Journal of Information and Education Technology}, + volume={2}, + number={3}, + pages={216}, + year={2012}, + publisher={IACSIT Press} +} + +@article{singhal2012introducing, + title={Introducing the knowledge graph: things, not strings}, + author={Singhal, Amit}, + journal={Official google blog}, + volume={5}, + pages={16}, + year={2012} +} + +@inproceedings{bordes2013translating, + title={Translating embeddings for modeling multi-relational data}, + author={Bordes, Antoine and Usunier, Nicolas and Garcia-Duran, Alberto and Weston, Jason and Yakhnenko, Oksana}, + booktitle={Neural Information Processing Systems (NIPS)}, + pages={1--9}, + year={2013} +} + +@inproceedings{wang2014knowledge, + title={Knowledge graph embedding by translating on hyperplanes}, + author={Wang, Zhen and Zhang, Jianwen and Feng, Jianlin and Chen, Zheng}, + booktitle={Proceedings of the AAAI Conference on Artificial Intelligence}, + volume={28}, + number={1}, + year={2014} +} + +@inproceedings{lin2015learning, + title={Learning entity and relation embeddings for knowledge graph completion}, + author={Lin, Yankai and Liu, Zhiyuan and Sun, Maosong and Liu, Yang and Zhu, Xuan}, + booktitle={Proceedings of the AAAI Conference on Artificial Intelligence}, + volume={29}, + number={1}, + year={2015} +} + +@article{yang2014embedding, + title={Embedding entities and relations for learning and inference in knowledge bases}, + author={Yang, Bishan and Yih, Wen-tau and He, Xiaodong and Gao, Jianfeng and Deng, Li}, + journal={arXiv preprint arXiv:1412.6575}, + year={2014} +} + +@article{lin2015modeling, + title={Modeling relation paths for representation learning of knowledge bases}, + author={Lin, Yankai and Liu, Zhiyuan and Luan, Huanbo and Sun, Maosong and Rao, Siwei and Liu, Song}, + journal={arXiv preprint arXiv:1506.00379}, + year={2015} +} + +@article{guu2015traversing, + title={Traversing knowledge graphs in vector space}, + author={Guu, Kelvin and Miller, John and Liang, Percy}, + journal={arXiv preprint arXiv:1506.01094}, + year={2015} +} + +@inproceedings{toutanova2016compositional, + title={Compositional learning of embeddings for relation paths in knowledge base and text}, + author={Toutanova, Kristina and Lin, Xi Victoria and Yih, Wen-tau and Poon, Hoifung and Quirk, Chris}, + booktitle={Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)}, + pages={1434--1444}, + year={2016} +} + +@book{fielding2000architectural, + title={Architectural styles and the design of network-based software architectures}, + author={Fielding, Roy T}, + volume={7}, + year={2000}, + publisher={University of California, Irvine Irvine} +} + +@inproceedings{koren2008factorization, + title={Factorization meets the neighborhood: a multifaceted collaborative filtering model}, + author={Koren, Yehuda}, + booktitle={Proceedings of the 14th ACM SIGKDD international conference on Knowledge discovery and data mining}, + pages={426--434}, + year={2008} +} + +@inproceedings{wang2018shine, + title={Shine: Signed heterogeneous information network embedding for sentiment link prediction}, + author={Wang, Hongwei and Zhang, Fuzheng and Hou, Min and Xie, Xing and Guo, Minyi and Liu, Qi}, + booktitle={Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining}, + pages={592--600}, + year={2018} +} + +@inproceedings{wang2018dkn, + title={DKN: Deep knowledge-aware network for news recommendation}, + author={Wang, Hongwei and Zhang, Fuzheng and Xie, Xing and Guo, Minyi}, + booktitle={Proceedings of the 2018 world wide web conference}, + pages={1835--1844}, + year={2018} +} + +@article{sun2017collaborative, + title={Collaborative intent prediction with real-time contextual data}, + author={Sun, Yu and Yuan, Nicholas Jing and Xie, Xing and McDonald, Kieran and Zhang, Rui}, + journal={ACM Transactions on Information Systems (TOIS)}, + volume={35}, + number={4}, + pages={1--33}, + year={2017}, + publisher={ACM New York, NY, USA} +} + +@inproceedings{zhang2016collaborative, + title={Collaborative knowledge base embedding for recommender systems}, + author={Zhang, Fuzheng and Yuan, Nicholas Jing and Lian, Defu and Xie, Xing and Ma, Wei-Ying}, + booktitle={Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining}, + pages={353--362}, + year={2016} +} + +@inproceedings{wang2018shine, + title={Shine: Signed heterogeneous information network embedding for sentiment link prediction}, + author={Wang, Hongwei and Zhang, Fuzheng and Hou, Min and Xie, Xing and Guo, Minyi and Liu, Qi}, + booktitle={Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining}, + pages={592--600}, + year={2018} +} + +@inproceedings{yu2014personalized, + title={Personalized entity recommendation: A heterogeneous information network approach}, + author={Yu, Xiao and Ren, Xiang and Sun, Yizhou and Gu, Quanquan and Sturt, Bradley and Khandelwal, Urvashi and Norick, Brandon and Han, Jiawei}, + booktitle={Proceedings of the 7th ACM international conference on Web search and data mining}, + pages={283--292}, + year={2014} +} + +@article{rendle2012factorization, + title={Factorization machines with libfm}, + author={Rendle, Steffen}, + journal={ACM Transactions on Intelligent Systems and Technology (TIST)}, + volume={3}, + number={3}, + pages={1--22}, + year={2012}, + publisher={ACM New York, NY, USA} +} + +@inproceedings{cheng2016wide, + title={Wide \& deep learning for recommender systems}, + author={Cheng, Heng-Tze and Koc, Levent and Harmsen, Jeremiah and Shaked, Tal and Chandra, Tushar and Aradhye, Hrishi and Anderson, Glen and Corrado, Greg and Chai, Wei and Ispir, Mustafa and others}, + booktitle={Proceedings of the 1st workshop on deep learning for recommender systems}, + pages={7--10}, + year={2016} +} + +@inproceedings{wang2018dkn, + title={DKN: Deep knowledge-aware network for news recommendation}, + author={Wang, Hongwei and Zhang, Fuzheng and Xie, Xing and Guo, Minyi}, + booktitle={Proceedings of the 2018 world wide web conference}, + pages={1835--1844}, + year={2018} +} + +@article{漆桂林2017知识图谱研究进展, + title={知识图谱研究进展}, + author={漆桂林 and 高桓 and 吴天星}, + journal={情报工程}, + volume={3}, + number={1}, + pages={004--025}, + year={2017} +} + +@article{徐增林2016知识图谱技术综述, + title={知识图谱技术综述}, + author={徐增林 and 盛泳潘 and 贺丽荣 and 王雅芳}, + year={2016}, + publisher={电子科技大学学报自然版} +} + +@article{李涓子2017知识图谱研究综述, + title={知识图谱研究综述}, + author={李涓子 and 侯磊 and others}, + journal={山西大学学报 (自然科学版)}, + number={2017 年 03}, + pages={454--459}, + year={2017}, + publisher={山西大学} +} + +@article{曹倩2015知识图谱的技术实现流程及相关应用, + title={知识图谱的技术实现流程及相关应用}, + author={曹倩 and 赵一鸣}, + journal={情报理论与实践}, + volume={38}, + number={12}, + pages={13--18}, + year={2015} +} + +@inproceedings{tang2019akupm, + title={AKUPM: Attention-enhanced knowledge-aware user preference model for recommendation}, + author={Tang, Xiaoli and Wang, Tengyun and Yang, Haizhi and Song, Hengjie}, + booktitle={Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery \& Data Mining}, + pages={1891--1899}, + year={2019} +} + +@inproceedings{cao2019unifying, + title={Unifying knowledge graph learning and recommendation: Towards a better understanding of user preferences}, + author={Cao, Yixin and Wang, Xiang and He, Xiangnan and Hu, Zikun and Chua, Tat-Seng}, + booktitle={The world wide web conference}, + pages={151--161}, + year={2019} +} + +@inproceedings{zhao2017meta, + title={Meta-graph based recommendation fusion over heterogeneous information networks}, + author={Zhao, Huan and Yao, Quanming and Li, Jianda and Song, Yangqiu and Lee, Dik Lun}, + booktitle={Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining}, + pages={635--644}, + year={2017} +} + +@inproceedings{sun2018recurrent, + title={Recurrent knowledge graph embedding for effective recommendation}, + author={Sun, Zhu and Yang, Jie and Zhang, Jie and Bozzon, Alessandro and Huang, Long-Kai and Xu, Chi}, + booktitle={Proceedings of the 12th ACM Conference on Recommender Systems}, + pages={297--305}, + year={2018} +} + +@inproceedings{wang2018ripplenet, + title={Ripplenet: Propagating user preferences on the knowledge graph for recommender systems}, + author={Wang, Hongwei and Zhang, Fuzheng and Wang, Jialin and Zhao, Miao and Li, Wenjie and Xie, Xing and Guo, Minyi}, + booktitle={Proceedings of the 27th ACM International Conference on Information and Knowledge Management}, + pages={417--426}, + year={2018} +} + +@article{黄立威2018基于深度学习的推荐系统研究综述, + title={基于深度学习的推荐系统研究综述}, + author={黄立威 and 江碧涛 and 吕守业 and 刘艳博 and 李德毅}, + journal={计算机学报}, + volume={41}, + number={7}, + pages={1619--1647}, + year={2018} +} + +@article{常亮2019知识图谱的推荐系统综述, + title={知识图谱的推荐系统综述}, + author={常亮 and 张伟涛 and 古天龙 and 孙文平 and 宾辰忠 and others}, + journal={智能系统学报}, + volume={14}, + number={2}, + pages={207--216}, + year={2019} +} + +@mastersthesis{王一鸣2018基于知识图谱的推荐技术研究及应用, + title={基于知识图谱的推荐技术研究及应用}, + author={王一鸣}, + year={2018}, + school={电子科技大学} +} diff --git a/macros/latex/contrib/bjfuthesis/demo/contents/abstract.tex b/macros/latex/contrib/bjfuthesis/demo/contents/abstract.tex new file mode 100644 index 0000000000..71627e7e3f --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/contents/abstract.tex @@ -0,0 +1,14 @@ +\chapter*{摘要} +\begin{abstract} + 随着在线电影数量不断增加,用户选择电影的时间成本不断上升,准确的推荐算法成为了必然要求。为解决协同过滤推荐算法中的稀缺性问题与冷启动问题,研究人员用商品属性或社交网络等信息来辅助推荐算法。现有的将知识图谱作为辅助信息的推荐算法包括基于嵌入的方法和基于路径的方法,但这两种方法均存在一些缺陷,没有充分有效地利用知识图谱中的相关信息,推荐的准确度较低。 + + 本文设计并实现了基于“涟漪网络”知识图谱的推荐算法。“涟漪网络”算法的核心是利用现实生活中的雨滴产生的涟漪在水面上不断扩散的思路,来模拟用户偏好的扩散。对于每一个用户,涟漪网络将其过往偏好作为知识图谱中的一个种子集,然后沿知识图谱中的关系路径不断地拓展用户的偏好,进而发现基于等级划分的某个候选物品的潜在兴趣,其中多个“涟漪”重叠形成知识图谱中的用户偏好分布。该算法的实验结果和以往的CKE、DKN、PER等模型结果相比,表现出更优的性能。利用该算法,本文设计并实现了一个基于电影知识图谱的推荐系统,该系统包括管理员用户和普通用户,管理员能够新增、编辑和删除电影与用户,普通用户能够浏览、收藏与购买电影。该系统可以为用户提供一个高效的电影推荐功能,方便用户选择满足自己偏好的电影。 +\end{abstract} +\keywordscn{知识图谱,推荐系统,涟漪网络,用户偏好,电影商店} +\chapter*{Abstract} +\begin{abstract} + As the number of online movies continues to increase and the time cost for users to choose movies continues to rise, accurate recommendation algorithms have become an inevitable requirement. In order to address the scarcity and cold start problem of collaborative filtering, researchers usually make use of side information, such as product attributes or social networks as side information to assist the recommendation. The existing recommendation algorithms that use knowledge graph as side information include embedding-based methods and path-based methods, but both methods have some shortcomings. They do not make full and effective use of the relevant information in the knowledge graph, and the accuracy of recommendation is relatively low. + + This paper designs and implements a recommendation algorithm based on Ripple Network. The core of the Ripple Network algorithm is to use the idea that the ripples produced by raindrops in real life continue to spread on the water surface to stimulate the spread of user preferences. For each user, Ripple Network uses its past preference as a seed set in the knowledge graph, and then continuously expands the user’s preferences along the relationship path in the knowledge graph, and then discovers his hierarchical potential interests concerning a certain candidate item. Multiple ``ripples" overlap to form the user preference distribution in the knowledge graph. Compared with previous model results of CKE, DKN, PER, etc., the experimental results of this algorithm show better performance. Using this algorithm, this paper designs and implements a recommendation system based on the movie knowledge graph. The system includes administrator users and general users. The administrator can add, edit and delete movies and users, and general users can browse, collect and purchase films. The system can provide users with an efficient movie recommendation function, which is convenient for users to choose movies that suit their preferences. +\end{abstract} +\keywordsen{Knowledge graph, recommendation system, Ripple Network, user preferences, movie store} diff --git a/macros/latex/contrib/bjfuthesis/demo/contents/acknowledge.tex b/macros/latex/contrib/bjfuthesis/demo/contents/acknowledge.tex new file mode 100644 index 0000000000..bfccc876b4 --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/contents/acknowledge.tex @@ -0,0 +1,10 @@ +\chapter{致谢} +论文的撰写工作已经接近尾声,在本文的撰写过程中我要特别感谢李冬梅老师的莅临指导。在毕业论文完成期间,李冬梅老师多次对我的毕业论文提出意见与建议。同时,她多次询问论文的撰写进度,更是体现了她对学生无微不至的关怀。每每当我在论文编写中遇到艰深晦涩之处时,她都能不失时机而恰到好处地给予我最有用的提示与建议,使我的毕业论文得以顺利完成。 + +其次,我要感谢我本科期间曾经为我上课的所有老师。比如,由我的概率论老师为我打下的数学基础才使我得以用最大后验概率估计法完成嵌入表示的学习算法,蓝海洋老师任教的网站设计课程是我完成电影推荐系统的基石。总之,我要感谢大学四年来所有老师孜孜不倦的谆谆教诲与夜以继日的无私奉献。 + +接着,我还要感谢我的同学,是他们思维的火花激起了论文写作中的灵感。与他们的交流使我受益匪浅。 + +最后,我还要感谢我的父母,他们一直以来对我生活上与学习上的鼓励与引导是我得益完成论文的关键要素。 + +感谢所有在论文撰写工作中为我提供过帮助的人。 diff --git a/macros/latex/contrib/bjfuthesis/demo/contents/mainbody.tex b/macros/latex/contrib/bjfuthesis/demo/contents/mainbody.tex new file mode 100644 index 0000000000..055e7b1de6 --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/contents/mainbody.tex @@ -0,0 +1,548 @@ +\chapter{绪论} +\section{研究背景与意义} +一直以来,电影推荐都是在线流媒体播放平台发展中的一个重要问题,做好电影推荐可以使用户能在海量电影中选择满足其偏好的电影,提高用户满意度,从而提高在线流媒体播放平台的流量转化率及购买率,提高在线流媒体播放平台的经济收益。近年来,随着电影行业及互联网行业的不断发展,在线电影数量不断增加,用户在海量电影中选择满足其偏好的电影的难度不断上升,性能优异的推荐算法成为了必然要求。自从在线流媒体播放平台出现以来,人们便开始尝试利用推荐算法来提高平台流量转化率,出现了诸如协同过滤的推荐算法\cite{su2009survey}。但这些算法未能解决数据稀缺性及冷启动问题,并不能为在线流媒体播放平台提供良好的推荐性能。为此,人们尝试将辅助信息融入推荐算法中以解决数据稀缺性及冷启动问题\cite{sun2017collaborative},并提高推荐性能。 + +知识图谱,一种结构化的语义知识库,被用于迅速提供对物理世界中的概念和相互关系的描述,为解决推荐问题提供了新的方法\cite{zou2020survey},近年来受到国内外研究人员的广泛关注,成为了当前的研究热点。知识图谱通过对复杂的原始数据进行加工、处理及整合,转化成简单可靠、清晰明了的“实体,关系,实体”三元组,汇聚了大量的知识信息,从而能实现基于知识信息的响应和推理。 + +知识图谱常被用于作为辅助信息添加至推荐算法中以提高推荐的准确性,这已是当前的研究焦点。 + +近年来,随着在线流媒体播放平台的发展,电影推荐系统应运而生,它作为现代信息技术与传统电影产业相结合的产物,对流媒体播放平台的用户体验起着至关重要的作用,其可大幅度减少用户寻找满足其偏好电影的时间,并提高用户点击率与购买率,从而提高流媒体播放平台的经济收益。电影推荐系统能为用户推荐其感兴趣的电影,而减少对用户不感兴内容的显示,从而满足用户需求。但是,目前网络上绝大多数的电影推荐系统都使用传统的基于协同过滤的推荐算法,未能有效利用知识图谱等辅助信息,返回给用户的推荐结果中包含大量用户不感兴趣的电影,同时,却将一些本应推荐给用户的、用户感兴趣的电影丢弃了。造成这一问题的主要原因便是对于新加入的无用户评分的电影以及新注册的用户推荐算法缺少相关信息。 + +对于海量的电影数据,为了实现准确地推荐给用户其感兴趣的电影,传统的基于协同过滤的推荐算法是远远满足了不用户需求的,特别是对新注册用户,推荐的准确度无法得到保证。所以,本文旨在以知识图谱作为辅助信息,构建一个合适的电影推荐系统,并利用知识图谱中包含的丰富的辅助信息,最终实现一个电影推荐系统,为用户提供有效的、准确的电影推荐,从而提高用户满意度,提高平台收益。 +\section{国内外研究现状} +\subsection{推荐系统研究现状} +推荐系统由Jussi Karlgren于哥伦比亚大学在一份技术报告中作为“数字书架”被首次提及\cite{karlgren1990algebra},而后自1994年起被在SICS的Jussi Karlgren\cite{karlgren1994newsgroup}、由Pattie Maes于MIT领导的研究团队、位于Bellcore的Will Hill以及同样位于MIT的Paul Resnick规模实现并在技术性报告及出版物中起作用,他们与GroupLens的工作被授予了2010年ACM软件系统奖。 + +自从在90年代中期首批有关协同过滤的论文出现后推荐系统便成为了重要的研究领域。在工业界与学术界在该世纪有众多建设新的推荐系统的工作。由于该领域包含众多的研究问题及其能帮助用户解决在过多信息中提供个性化推荐的实际应用,因此研究人员对该领域的兴趣依旧很高。 + +当前,推荐列表在推荐系统将其产生的过程中的方式主要有两种:基于内容推荐与协同过滤\cite{jafarkarimi2012naive}。基于内容推荐的算法使用一些有关物品的离散特征来推荐出拥有相似性的物品。协同过滤方法根据用户的历史行为(诸如其评价过的、点击过的、购买过的商品等)并与其他用户的相似决策结合起来建立模形。这种算法可以被用于预测用户对物品的偏好程度。这两种方法常常被同时使用。 + +此外,近来有越来越多的推荐算法被提出:多准则推荐系统。多准则推荐系统可以被定义为包含多标准偏好信息的推荐系统,而不是构建基于单一凭据的推荐系统。风险感知推荐系统,现存推荐系统的主要方法聚焦于基于上下文信息推荐最相关内容给用户,而没有将不相关内容打扰用户的推荐风险纳入考量。考虑推送推荐内容给用户而打扰用户的风险在某些情况下是需要考虑的,比如,在一个专业会议上、在凌晨或是在晚上。而此类推荐算法为该问题提供了解决方案。 + +现实中,大量使用的往往是混合推荐系统。同时结合协同过滤、基于内容过滤以及其他方法的混合方法现在被大量使用。数种不同方法没有任何理由不能被结合起来。混合推荐可以在多种方式下被实现:将基于内容的和基于协同滤的预测被分开实现再将他们将合起来,亦或是将两种方法统一到同一模型中。 +\subsection{知识图谱的研究现状} +在知识表示与知识推理中,知识图谱是一个使用图结构的数据模型或拓扑结构的知识库来整合数据。知识图谱常被用来存储内连接的对实体的描述——对象、事件、情形或抽象概念,并包括自由形式的语义。 + +该词汇早在1972年在一个有关构建模块化指令系统的课程中被提出。在80年代末,名叫知识图谱的项目主要聚焦于语义网络的设计。在2007年,DBpedia和Freebase作为基于图的有关常识的知识库被创立。DBpedia致立于从Wikipedia中抽取数据,而Freebase也包含一系列公开的数据集。它们两者都未将自己称为“知识图谱”但构建并描述了其相关概念。 + +在2012年,谷歌正式提出了知识图谱的概念\cite{singhal2012introducing},建立于DBpedia和Freebase以及其他数据源的基础之上。他们后来将包括CIA World Factbook, Wikidata和Wikipedia的网站的RDFa, Microdata, JSON-LD内容从它们的索引网站上抽取并纳入知识图谱。与知识图谱相关联的实体与关系类型使用来自scheme.org的术语被更广泛地被组织起来。 + +谷歌的知识图谱非常重要的一块是“自由库”,一个大型的协同工作知识库。“自由库”使用图结构作为其数据结构,可以将其视作一个有向图。谷歌知识图谱模型便是谷歌团队利用其在“自由库”之上的技术积累开发出来的\cite{漆桂林2017知识图谱研究进展}。 + +自此,数个大型跨国公司开始利用它们的知识图谱,很快知识图谱流行起来。 + +在2019年,IEEE将其关于“大数据”和“数据挖掘与智能计算”的年度国际会议融入有关知识图谱的国际会议。 + +以上是知识图谱发展的主要进程。 + +知识图谱一般表示为三元组的形式,即G=(h,r,t),其中G为知识图谱,h和t是知识库中的实体集合,分别为三元组的头结点与尾节点\cite{徐增林2016知识图谱技术综述}。 + +目前知识图谱的构建过程中主要使有定义层次学习的思想及事实学习的思想等方法。 + +定义层次学习是通过使用机器学习等技术,从文字、图片等信息中提取知识表达中的定义,并确定其上下文信息。而知识图谱本质上是属于一种精炼的异构信息网络。利用定义层次学习可以在一定程度上完成对于知识图谱的构建。 + +事实学习分为有监督的事实学习、半监督的事实学习以及无监督的事实学习。有监督的事实学习通过人为标注的语料信息输入以及深度学习方法来完成知识图谱的构建,而半监督的事实学习方法使用启发式地自动标注文本,但缺陷是训练数据集中可能含有大量的噪声数据。而无监督的学习方法主要使用基于深度学习模型的自然语言处理(NLP)的方法,无须人为干预,由训练模型自动完成信息抽取、信息整合的方法。随着深度学习算法的发展,目前基于无监督的学习方法的事实学习逐渐成为主流\cite{李涓子2017知识图谱研究综述}。 + +目前出现了诸多使用以上思想设计的知识图谱嵌入算法:基于翻译的TransE\cite{bordes2013translating}、TransH\cite{wang2014knowledge}、TransR\cite{lin2015learning}和基于语义分析的DistMult\cite{yang2014embedding}等。 + +目前,知识图谱在业界的应用已经取得了巨大成功\cite{曹倩2015知识图谱的技术实现流程及相关应用}: + +(1)搜索引擎技术。如前所述,知识图谱最早便是由谷歌提出以改善其搜索引擎的。在将知识图谱应用于搜索引擎之后,搜索引擎能对一些常见的搜索内容基于其使用的知识图谱信息快速给出搜索结果。同时,对于一些名词性的搜索内容,搜索引擎能使用知识图谱以知识卡片的形式给出其相关信息。研究表明,在谷歌将知识图谱技术融入其搜索引擎之后,用户点击进入维基百科的次数明显减少,说明利用知识图谱技术的搜索引擎可以更好的直接给出用户需要的信息而不需要用户再访问其他网站。 + +(2)智能问答。信息检索系统中非常常见的一种便是问答系统。问答系统在用户输入问题后能迅速给出用户需要的答案。而在将知识图谱技术应用于问答系统后,其回答的准确率有非常大的提升。目前苹果的智能助理Siri以及谷歌的智能助理谷歌助理(Google Assistant)都使用了知识图谱技术。 + +此外,知识图谱还广泛应用于金融、医疗等多个领域。 +\subsection{基于知识图谱的推荐系统研究现状} +由于传统的推荐系统无法解决稀缺性问题和冷启动问题,因此研究人员企图将辅助信息加入到推荐算法中以改善推荐性能。而这类辅助信息有社交网络、用户/物品属性、图像与上下文等。 + +在数种类型的辅助信息中,知识图谱通常包含有更丰富的信息与物品间的联结。一个知识图谱是一种结点关联实体、边关联关系的有向异构图。近来,研究者已提出数种学术性知识图谱,比如DBpedia和NELL,以及商业性质的知识图谱,比如谷歌知识图谱和Microsoft Satori。这些知识图谱成功应用于问答系统、词向量嵌入与文字分类等。 + +而目前基于知识图谱构建推荐系统的方法主要有以下几类: + +(1)基于嵌入的方法。基于嵌入的方法通过知识图谱嵌入计算算法将知识图谱中的实体信息与关系信息映射为低维向量空间中的向量表示(嵌入信息)。而后推荐算法利用该嵌入表示来完成相应的计算,并给出推荐结果。目前基于知识图谱中嵌入表示信息的方法的推荐模型有CKE\cite{zhang2016collaborative}、DKN\cite{wang2018dkn}以及SHINE\cite{wang2018shine}等。CKE是微软在 KDD2016 年发表的,其模型结构在原有系统过滤得到 U, V 向量的基础上,将物品的嵌入与其他描述信息相结合,这些信息主要有: +采用 TransR 算嵌入得到的知识图谱,图谱内每个实体嵌入表示被提取为物品的结构化向量信息。 +采用SDAE模型得到物品描述性文本的文本性嵌入表示。 +采用SCAE模型得到物品相关图像的视觉嵌入表示。DKN是之前同样由微软团队在 WWW2018 会议上发表的。它是一个主要针对新闻任务提出的框架,知识图谱用在对新闻标题作嵌入的层面。DKN 提出对新闻标题内每一个关键实体,在知识图谱内找到其实体嵌入和上下文嵌入。 +SHINE设计深度自编码器来嵌入语义网络,社交网络来进行推荐。其为用户-物品的交互使用自动编码器并刻画用户感兴趣的概率。 + +(2)基于路径的方法。基于路径的方法将知识图谱视为异构信息网络,主要是通过知识图谱中的路径中的关系信息来辅助推荐算法来完成推荐相关的计算工作。目前基于知识图谱中路径信息的推荐模型有HIN\cite{zhao2017meta}、RKGE\cite{sun2018recurrent}等。HIN是2017年在KDD上提出的,与 PER\cite{yu2014personalized}类似,都将将知识图谱视为异构信息网络。其针对Yelp和Amazon数据集分别设计了元路径,并得到了L个评估函数。并在建模时使用FM模型,使用FM组损失函数进行梯度下降,并最终得到推荐结果。RKGE模型使用了基于循环神经网络的方法。在人为定义元路径并抽取出所有路径之后,对每种元路径都使用循环神经网络模型来抽取并推理其路径中所包含的信息。 + +(3)混合式方法。基于嵌入的方法未能充分利用实体间的关系模式信息,而基于路径的方法仅考虑了实体间的语义连通信息,未能有效使用用户/物品本身的语义信息。因此,目前出现了混合式方法,即同时结合了基于嵌入的方法与基于路径的方法的优点。混合式方法是当前的研究热点与焦点,使用该方法的典型模型有AKUPM\cite{tang2019akupm}和RCoLM\cite{cao2019unifying}等。AKUPM是用于推荐的以注意力机制增强的推荐模型,RCoLM则是基于联合学习并以任务为导向的推荐算法。本文实现的电影推荐系统是基于论文“涟漪网络:在知识图谱上传递用户偏好的推荐模型\cite{wang2018ripplenet}”的,其中所使用的算法模量型是也隶属混合式方法。 +\begin{figure} + \includegraphics[width=\textwidth]{enhanced-recommendation} + \bicaption{受知识图谱增强的电影推荐系统}{Knowledge graph enhanced movie recommendation system}\label{fig:enhanced-recommendation} +\end{figure} + +受到将知识图谱成功应用于多种类型任务的启发,研究人员企图将知识图谱作为辅助信息加入推荐算法中以改善推荐系统的性能。图~\ref{fig:enhanced-recommendation}中显示了知识图谱提供丰富的信息与物品间的连接,有利于提高推荐结果的准确性、多样性和可解释性。知识图谱可以从以下三个方面提高推荐性能: + +(1)知识图谱引入了实体语义相关性,这可以帮助找到其潜在的联系并提高推荐物品的准确性。 + +(2)知识图谱由各种类型的关系构成,这对合理的扩展用户兴趣并增加推荐商品的多样性是有益的。 + +(3)知识图谱连接用户的历史记录及推荐的商品,因此为推荐系统提高了可解释性。 + +将知识图谱作为辅助信息加入至推荐系统中是当前的热点问题。 +\section{本文的主要研究内容} +本文在研究推荐算法、知识图谱和基于知识图谱的推荐算法的相关研究基础上,做了以下数个方面的研究: + +(1)设计并实现了基于知识图谱的电影推荐系统,使用“电影透镜1兆数据”作为数据集,此外还从IMDb及豆瓣爬取了相关电影数据作为研究对象。 + +(2)根据论文“涟漪网络:在知识图谱上传递用户偏好的推荐模型\cite{wang2018ripplenet}”实现了基于知识图谱的推荐算法——涟漪网络,该算法能根据用户的历史行为来为用户进行电影推荐。此外,将涟漪网络算法与其他基于知识网络的推荐算法(DKN\cite{wang2018dkn}、CKE\cite{zhang2016collaborative} 、PER\cite{yu2014personalized}、SHINE\cite{wang2018shine}、LibFM\cite{rendle2012factorization}和Wide\&Deep\cite{cheng2016wide}等)进行性能比较。 + +(3)实现一个基于知识图谱的电影推荐系统,该系统能够根据用户的历史行为(评分、收藏等)来为用户进行电影推荐。该系统分为管理员、未登录用户、普通登录用户。管理员能增加、修改和删除电影和普通用户;未登录用户能根据影分类查看电影及查看电影详情;普通登录用户除能进行未登录用户的操作外,还能购买、收藏及评价电影。 +\section{论文结构} +本论文一共分为五个章节。 + +第一章是绪论。简明介绍知识图谱作为辅助信息在推荐算法中的重要作用以及推荐算法对在线流媒体播放平台的重要作用,介绍了推荐系统、知识图谱和基于知识图谱的推荐系统的发展和应用以及本文的主要工作及创新点。 + +第二章是相关理论和技术。介绍了目前知识图谱和推荐系统的研究现状,并对传统的推荐算法与加入辅助信息的推荐算法作了较为细致的分类与阐述。同时还介绍了本文实现的电影推荐系统的技术栈,比如数据库、前端架构、后端架构等。 + +第三章是涟漪网络。介绍了涟漪网络算法,以及计算相关实体嵌入的过程中使用的深度学习算法,并对该算法进行了讨论。最后,还对涟漪网络推荐算法的准确度进行了测试。 + +第四章是电影推荐系统。介绍了以涟漪网络算法为基础构建的电影推荐系统:介绍了系统架构、系统功能、电影推荐流程以及如何保证该系统的安全性。 + +第五章是研究结论和展望。总结了涟漪网络算法的设计与实现、电影推荐系统的功能,并指出了其中可以改进的地方。 +\chapter{相关理论和技术} +\section{知识图谱} +\subsection{知识图谱的概念及发展进程} +知识图谱,是一种知识可视化或知识领域映射地图,是显示知识发展进程与结构关系的一系列三元组(实体,关系,实体),用可视化技术描述知识信息及其载体,挖掘、分析、建立、绘制和可视化知识以及它们之间的相互关系。 + +知识图谱是谷歌于2012年提出的,目的是为了增强其搜索引擎。而后微软于2013年7月发布了其Microsoft Satori知识图谱。除传统搜索服务提供商之外,包括Apple,Facebook,IBM等互联网企业也在探索该领域。 + +此外,业界也出现了社区构建的开源知识图谱,如DBpedia,NELL和Wikidata等。 + +以Freebase、WordNet和GeneOntology等为例的知识图谱已成为支持人工智能相关应用的非常重要的资源。 +\subsection{知识图谱的构建方法} +知识图谱是由多实体结点和不同关系边构成的多关系图,一个边是一个事实三元组(头结点,关系,尾结点)(记为(h, r, t))。而知识图谱的构建便是寻找这样的三元组。 + +在过去十年,在构建大型知识图谱方面已取得很大的成就,然而,还没有清晰的支持构建知识图谱的范式。主要有两个困难:(1)知识图谱是符号化的逻辑系统而知识图谱的应用常常是包含在连续空间的计算。(2)在一张图谱上进行知识聚合是困难的。 + +目前,知识图谱主要通过以下3个步骤来完成构建: + +(1)信息抽取。即从各类型的源数据中抽取出实体(概念)、实体间的关系,并在此基础之上形成确切的知识表达。 + +(2)知识融合。对新获得的知识进行整合,以完成消歧义。 + +(3)知识加工。对融合后的新知识经过质量核查后将正确的部分加入至知识图谱中。 +\subsection{知识图谱的应用} +知识图谱以更接近人类认知的方式为互联网的信息表达提供了一种新的方式,而且提供了一种更益于组织与利用海量的方式。当前知识图谱主要用于搜索引擎(Bing,Google Search)、个人助理(Google Assistant)以及问答系统。 +\section{推荐系统} +推荐系统是根据用户可能给某物品评分或用户可能偏好的内容过滤系统的一个子集。 + +推荐系统广泛使用于多个领域,通常有为视频或音乐服务生成推荐清单的表现形式。 +\subsection{传统的推荐系统} +传统的推荐系统主要分为基于内容的推荐系统、基于协同过滤的推荐系统和混合推荐系统\cite{黄立威2018基于深度学习的推荐系统研究综述}。(1)基于内容的推荐系统主要用于文本相关的项目,因为内容常常是使用关键字来描述的。该算法通过计算相关物品的离散特征,然后推荐具有与其类似特征的有关物品。(2)基于协同过滤的推荐系统主要通过将具有与目标用户相似特征的用户所交互过的物品推荐给目标用户。 + +基于内容推荐与通过协同过滤推荐的有关区别可以从比较两个流行音乐推荐系统的实现方式中得出:(1)潘多拉音乐使用一个基于内容推荐的推荐算法。它根据艺人或歌曲的属性来生成一个包含相似风格歌曲的电台,并且该电台的内容会根据收听用户的反馈进行调整。当用户对一首歌曲“不感兴趣”时该算法将弱化该歌曲的一些属性;而当用户喜欢一首歌曲时,将强化一些属性。并且该算法会根据该属性调整歌曲的顺序,若越过一个阀值时将某一歌曲从列表中删除。(2)“终级fm”使用一个协同过滤的推荐算法。它记录用户经常收听的乐队和歌手,然后与其它用户的有关行为进行比较,建立一个电台,并以此推荐歌曲。“终级fm”会给用户推荐其他具有相似特征用户的播放列表(并保证目标用户未收听过)。 + +而上述两种推荐算法都有其长处与短处。潘多拉音乐所使用的基于内容推荐的推荐算法是根据物品本身的性质来进行推荐的,因此不需要用户信息就可以有较好的准确度。但该算法严重以来物品本身的特性,因此局限性较大,推荐的内容都是与种子集相关的,推荐结果的多样性较低。而“终级fm”使用的协同过滤算法需要根据用户与物品的交互来生成推荐结果,因此需要大量的用户数据,存在数据稀缺性问题与冷启动问题。 +\subsection{基于知识图谱的推荐系统} +基于内容推荐与协同过滤推荐两者均存在一些局限性,为了提高推荐的准确性与解决传统的推荐算法的数据稀缺性与冷启动问题,研究者将一些辅助信息加入至推荐算法中,通常这些辅助信息包括上下文信息、用户或物品的属性、图片和社交网络\cite{常亮2019知识图谱的推荐系统综述}\cite{王一鸣2018基于知识图谱的推荐技术研究及应用}。 + +而随着知识图谱的发展,当前将知识图谱作为辅助信息加入推荐系统来提高推荐系统性能已经成为了一个热门的研究方向。将知识图谱作为辅助信息加入推荐算法可以产生两个优点: + +(1)提高推荐系统的准确性。知识图谱可以表示不同实体间的关系,可以将物品及其相关属性对应于知识图谱之中,从而推荐算法可以理解物品之间的关系。此外,用户与用户间的关系信息也可以映射至知识图谱之中,从而推荐算法可以更准确地分析物品与物品间的关系、用户与物品之间的关系。 + +(2)提高推荐系统的可解释性。由于推荐结果依照知识图谱中的关系信息,因此可以由知识图谱中的关系路径得到推荐结果的原因。 + +目前主要的基于知识图谱的推荐算法有基于嵌入的方法、基于路径的方法以及混合式方法: + +(1)基于嵌入的方法。基于嵌入的方法使用知识图谱的信息来完善实体的嵌入表示。为了将知识图谱中的信息添加至推荐算法中来辅助推荐,需要使用知识图谱嵌入表示算法(Knowledge Graph Embedding, KGE)表计算实体嵌入(实体嵌入指由知识图谱中信息得到的在低维向量空间中的向量表示)。KGE算法有TransE\cite{bordes2013translating}、TransH\cite{wang2014knowledge}、TransR\cite{lin2015learning}和DistMult\cite{yang2014embedding}等。而推荐算法将通过计算得到的嵌入表示来计算物品-物品间、用户-用户间以及用户-物品间的关系,从而对用户进行物品推荐。 + +(2)基于路径的方法\cite{lin2015modeling}\cite{guu2015traversing}\cite{toutanova2016compositional}。基于路径的方法将知识图谱视为异构信息网络。而推荐系统利用该异构信息网络寻找实体间的关系,从而完成推荐。 + +(3)混合式方法。基于嵌入的方法未能充分利用实体间的关系模式信息,而基于路径的方法仅考虑了实体间的语义连通信息,未能有效使用用户/物品本身的语义信息。因此,目前出现了混合式方法,即同时结合了基于嵌入的方法与基于路径的方法的优点。混合式方法是当前的研究热点与焦点,使用该方法的典型模型有AKUPM\cite{tang2019akupm}和RCoLM\cite{cao2019unifying}等。本文基于的算法也隶属该类。 +\section{系统开发技术} +\label{sec:tech-stack} +\subsection{数据采集技术} +电影推荐系统使用的数据来自“电影透镜1兆数据”\footnote{https://grouplens.org/datasets/movielens/1m/}数据集,此外还从IMDb\footnote{https://www.imdb.com/}及豆瓣\footnote{https://www.douban.com/}爬取了相关电影数据作为研究对象。 + +在数据采集的过程中,使用Scrapy框架进行了数据爬取,爬取的数据包括电影名称、电影封面、预告片图片、电景情节介绍、导演、演员以及剧作家。 + +最终,一共爬取了3684部电影的数据。其中,从IMDb爬取了3494部电影数据,从豆瓣爬取了190条电影数据(由于豆瓣限制了每IP访问量故爬取的数据较少)。 +\subsection{数据存储技术} +本系统使用MongoDB与Neo4j存储数据。 + +\noindent (1)MongoDB + +MongoDB是一个新兴的非关系型存储的分布式存储数据的数据库,属于NoSQL,与MySQL等传统的关系型数据库相比,它提供更好的高并发支持,具有高可靠性的优点。与此同时,得益于其基于文档储存的特点,相比较传统的关系型数据库,它的存储结构更灵活。 + +在本系统中,MongoDB存储普通用户数据、管理员数据、电影数据等。 + +\noindent(2)Neo4j + +Neo4j是一个具有高性能的图数据库,它将结构化的数据信息储存在网络上而不是存储在表中。它具有健壮和成熟的数据库的所有特点。虽然Neo4j是一个新兴的数据库,但它已在具有超过1亿节点、关系和属性的产品中得到了应用,充分体现了其高性能、高可靠性的特点。 + +在本系统中,知识图谱的有关信息被存储在Neo4j中,由于知识图谱本身图的特性,这充分利用了Neo4j作为图数据库的特点,可以提供良好的性能支持。 +\subsection{后端技术} +本系统使用Flask框架作为网站后端框架。Flask是一个Python编写的轻量级微框架。它具有轻量、便捷、可扩展等特点。 + +本系统选择Flask框架充分利用了其便捷、可扩展以及开发便捷的特点,与本系统要求相符。 + +本系统使用表现层状态转换(REST)风格的应用程序接口(API)作为前后端的交互接口。 + +表现层状态转换(Representational State Transfer,REST)是一种基于HTTP协议的软件交互体系结构样式,该协议是由Roy Thomas Fielding博士在2000年的博士论文中引用的\cite{fielding2000architectural},目的是促进不同的软件/程序的开发。在网络上互相传输数据。表示层状态转换基于超文本传输协议(HTTP)的一组约束,该协议是一种旨在提供万维网服务的软件构造样式。符合或兼容此体系结构样式(简称为REST或RESTful)的网络服务允许客户端发出使用统一资源标识符访问和操作网络资源的请求,这些资源与一组预定义的操作一致。因此,表示层状态转换提供了Internet上计算机系统之间相互使用资源的互操作性。与其他类型的网络服务(例如SOAP服务)相比,它们使用自己定义的一组操作来访问网络资源。 + +得益于本系统使用了REST风格的API,本系统能更有效地使用缓存来提升响应速度,同时本系统前后端的相互间通讯的无状态性可以让不同的服务器的处理一连串请求中不同的请求,提高了本系统的可扩展性。与此同时,得益于REST风格语义化的接口,使前后端交互接口更清晰明了,使接口的使用者能更高效便捷地进行相关的开发工作。 +\subsection{前端技术} +本系统前端使用Angular框架。 + +Angular(通常指“Angular 2+”或“Angular v2及以上”)是一个基于TypeScript的开源网络应用框架,它的开发由Google的Angular团队领导同时也有个人及其他公司维护。Angular完全从相同团队开发的AngularJS重新编写而来。 + +Angular常常作为MEAN技术栈的一部分。MEAN技术栈指MongoDB数据库、Express.js网络服务器框架、Angular/AngularJS以及Node.js服务器运行时。 + +不同于MEAN技术栈,本系统将其中的“E”(指Express.js网络服务器框架)替换为了Flask网络服务器框架。 + +通过使用Angular框架,本系统具有一个现代化、模块化的网页架构。同时借助于Angular Material Components官方组件库,本系统前端UI符合材料设计(Material Design)。 +\chapter{基于涟漪网络知识图谱的推荐算法} +\label{ch:offline-recommendation} +\section{涟漪网络} +\subsection{架构} +涟漪网络的总体架构如图~\ref{fig:ripplenet-framework}中所示,图上方的知识图谱中展示由用户交互产生的涟漪。涟漪网络以一个用户$u$和一个电影$v$作为输入,并输出用户$u$与电影$v$之间产生交互的概率。对输入用户$u$而言,其历史交互记录$V_u$是知识图谱中的种子集,而后沿着知识图谱中的关系边形成多个涟漪集$S_u^{k}\ (k=1, 2, \dots, H)$。一个涟漪集是距离种子集$V_u$ $k$跳的知识三元组。这些涟漪集用于与迭代地与电影$v$的嵌入(黄色的块)表示相计算以得到关于电影$v$的用户$u$的反应(绿色的块),最后结合得到用户的最终嵌入表示(灰色的块)。最终,将用户$u$与电影$v$的嵌入表示相结合以计算出预测概率$y_{uv}$。 +\begin{figure} + \includegraphics[width=\textwidth]{ripplenet-framework} + \bicaption{涟漪网络的总体架构}{The overall framework of the Ripple Network}\label{fig:ripplenet-framework} +\end{figure} +\subsection{涟漪集} +\begin{figure} + \includegraphics[width=\textwidth]{illustration-of-ripple-sets} + \bicaption{电影知识图谱中由“阿甘正传”激发的涟漪集}{Sets of ripples of “Forest Gump” in Knowledge Graph of movies}\label{fig:illustration-of-ripple-sets} +\end{figure} +知识图谱常常含有丰富的事实信息与实体间的联系。比如,如图~\ref{fig:illustration-of-ripple-sets}(图中不同颜色的圆圈表示有不同跳的涟漪集。较浅的蓝色代表中间与周边实体的关联程度。)所示电影“阿甘正传”与“罗伯特·泽米吉斯”相连,它们之间的联系是“罗伯特·泽米吉斯”是电影“阿甘正传”的导演。而“回到未来”也与“罗伯特·泽米吉斯”相连。因此,如果一个用户与电影“阿甘正传”交互过,则他很有可能也对“回到未来”感兴趣。为了描述用户在知识图谱中分层次的可能偏好集,递归定义用户$u$的k跳相关实体如下: + +\textbf{定义1(相关实体集) } 给定交互矩阵$\Upsilon$与知识图谱$G$,则用户$u$的$k$跳相关实体可以定义为 +\begin{equation} + E_u^k=\{t|(h, r, t)\in G \text{且} h\in E^{k-1}_u\}, k = 1, 2, \dots, H\label{relevant-entities} +\end{equation} +式\eqref{relevant-entities}中$E_u^0=V_u=\{v | y_{uv}=1\}$是用户的历史偏好集,可以看作用户$u$在知识图谱中的种子集。 + +相关实体集可以看作用户的历史偏好集在知识图谱中的自然扩展。给定相关实体集的定义,以下定义用户$u$的$k$跳涟漪集: + +\textbf{定义2(涟漪集)}用户u的k跳涟漪集可以看作是知识图谱中以$E^{k-1}_u$为起点的知识三元组: +\begin{equation} + S_u^k = \{(h, r, t)|(h, r, t)\in G \text{且} h\in E^{k-1}_u\}, k = 1, 2, \dots, H\label{ripple-set} +\end{equation} +“涟漪”这个词有两重意思:(1)对由多个雨点产生的真实涟漪的模拟,用户由其在实体中交互过的潜在兴趣集在知识图谱中由近及远地传递。这一过程如图~\ref{fig:illustration-of-ripple-sets}所示。(2)用户的潜在兴趣随着在知识图谱中会传递的跳数$k$的增大逐渐递减。图~\ref{fig:illustration-of-ripple-sets}中蓝色的变浅也显示了潜在兴趣递减的过程。 + +一个顾虑是在跳数$k$增加的过程中涟漪集的大小可能太大。为了解决这个问题,注意到: + +(1)在真实使用的知识图谱中大量的实体是沉没实体,意思是它们只有传入链路而没有传出链路。 + +(2)在电影推荐的具体情境下,关系可以限制在情境相关的分类中以减少涟漪集的数量并提高实体间的相关度。 + +(3)最大跳数$H$通常在实际应用中不会太大,因为离用户历史列表较远的实体会带来更多的嗓音而不是较好的信号。 + +(4)在涟漪网络中,我们可以对一个固定大小的邻集而不是对完整的涟漪集采样从而更进一步地减小计算工作量。设计这样的采样器是一个未来的重要工作,尤其是非统一的采样器能更好地捕获用户的分等级的潜在兴趣。 +\subsection{偏好扩散} +\label{sec:osum} +在传统的协同过滤算法中是通过学习用户与物品的潜在联系来完成推荐过程,而在涟漪网络算法中,这一过程是通过偏好扩散完成的:对每一个用户,涟漪网络将它的过往兴趣视为一个知识图谱中的种子集,然后沿知识图谱中的路径重复地拓展用户的兴趣来发现它的按等级划分的关于一个候选物品的潜在的兴趣。我们使用真实的由雨滴产生的涟漪在水面上扩散来模拟偏好扩散,其中多个“涟漪”重叠形成一个知识图谱上的作为结果的用户偏好分布。 + +如图~\ref{fig:ripplenet-framework},每一部电影都具有一个嵌入表示v,$v\in R^{d}$,其中$d$是嵌入表示向量的维数。嵌入表示可以包含实体的独热编码\cite{koren2008factorization}、词汇集\cite{wang2018dkn}、上下文信息\cite{sun2017collaborative}或属性\cite{wang2018shine},而选择哪一种嵌入向量的计算方式取决于其应用场合。给定电影的嵌入表示v以及用户$1$跳涟漪集$S_u^{1}$,每一个$S_U^{1}$中的事实三元组($h_i$,$r_i$,$t_i$)根据电影v以及三元组中的头节点$head_i$的比较和三元组中的关系$r_i$来确定电影$v$和实体$head_i$之间的相关度: +\begin{equation} + p_i=softmax(v^TR_ih_i)=\frac{exp(v^TR_ih_i)}{\sum_{(h, r, t)\in S_u^1} exp(v^TRh)}\label{eq:item-entity-relevance} +\end{equation} +其中$R_i\in R^{d\times d}$与$h_i\in R^d$分别是关系$r_i$和头节点$h_i$的嵌入表示。相关度$p_i$可以认为是在向量空间$R_i$中的电影v与实体$h_i$之间的相似度。同时还将关系信息的嵌入表示矩阵在计算电影v与实体$h_i$之间的相似度时纳入考量,因为不同就电影-实体对之间的相似度在具有不同关系信息时可能有所不同。比如,“阿甘正传”与“回到未来”在导演方面有很高的相似度,但它们在考虑体裁信息或剧作家方面可能没有任何联系。 + +在取得相似度信息之后,将$S_u^{1}$中三元组的尾节点根据计算得到的相似概率进行加权求和,得到向量$o^{1}_u$: +\begin{equation} + o^1_u=\sum_{(h_i,r_i,t_i)\in S_u^1}p_it_i\label{eq:o1} +\end{equation} +式~\eqref{eq:o1}中$t_i\in R^{d}$是事实三元组中的尾节点$t_i$。向量$o^{1}_u$可以视为用户偏好集$V_u$关于电影$v$的1次反应。与协同过滤算法类似的是,它根据用户交互过的物品来表示用户嵌入而不是使用单独的参数来表示用户并以此来缩减参数。通过式~\eqref{eq:item-entity-relevance}与式~\eqref{eq:o1},用户的偏好从其交互过的电影(种子集)成功在知识图谱中进行了一次扩散,这称为涟漪网络中的偏好扩散。 + +注意到可以将式~\eqref{eq:item-entity-relevance}中的$v$替换为$o_u^1$,我们可以重复偏好扩散的过程以得到用户的2次反应$o_u^2$。以此类推,最终我们可以将该用户偏好集扩散至$H$跳。我们可以得到用户的涟漪集$S_u^{i}, i=1,\dots,H$。从中我们可以得到用户的不同次反应$o^{1}_u, o^{2}_u, o^{H}_u$。用户$u$关于电影$v$的嵌入表示由结合所有次不同反应计算得到: +\begin{equation} + u=o_u^1+o_u^2+\dots+o_u^H\label{eq:osum} +\end{equation} +尽管最后一跳的用户响应中理论上包含了所有之前跳的信息,但对$o^k_u$进行求和仍然是有必要的,因为最后一跳的用户响应可能在偏好传递的过程中稀释了,不能很好地表示用户嵌入。最终,用户嵌入与电影嵌入相结合以来输出预测的用户对电影感兴趣的概率: +\begin{equation} + y_{uv}=\zeta(u^Tv)\label{eq:predicted-possibility} +\end{equation} +其中,$\zeta(x)=\frac{1}{1+exp(-x)}$是sigmoid函数。 +\section{学习算法} +在涟漪网络算法中我们的目标是通过式~\eqref{eq:predicted-possibility}求出用户对电影感兴趣的概率。但是,为了将其计算出来我们需要先求出所有物品、用户以及关系的嵌入表示,如第\ref{sec:osum}节中所述,用户的嵌入表示可以通过其涟漪集来代替,以此消元。但物品及关系的嵌入表示却是需要求出来的。 + +为了求出物品及关系的嵌入表示,我们使用最大后验概率估计的方法。 + +我们的目标是在已经得到知识图谱$G$以及用户与电影的交互矩阵$\Upsilon$的情况下最大化模型参数$\Gamma$: +\begin{equation} + max\ p(\Gamma |G,\Upsilon) +\end{equation} +其中参数$\Gamma$包含了所有的嵌入,包含全部的实体、关系和电影。这我等价于最大化 +\begin{equation} + p(\Gamma |G,\Upsilon)=\frac{p(\Gamma,G,\Upsilon)}{p(G,\Upsilon)}\varpropto p(\Gamma)\centerdot p(G|\Gamma)\centerdot p(\Upsilon|\Gamma,G)\label{eq:equal-max} +\end{equation} +根据贝叶斯公式,在式~\eqref{eq:equal-max}中,第一项$p(\Gamma)$测量模型参数的先验概率。我们将$p(\Gamma)$设为均值为0,方差为对角协方差矩阵的正态分布: +\begin{equation} + p(\Gamma)=N(0,\lambda_1^{-1}I) +\end{equation} +式~\eqref{eq:equal-max}中的第二项是给定$\Gamma$的知识图谱的最大似然函数。最近,有研究者提出了许多种计算知识图谱嵌入的方法,包括基于距离的方法和基于语义匹配的方法。在本算法中,我们使用三路张量分解的方法来建立知识图谱嵌入的最大似然函数: +\begin{equation} + p(G|\Gamma)=\prod_{(h,r,t)\in E\times R\times E}p((h,r,t)|\Gamma)=\prod_{(h,r,t)\in E\times R\times E}N(I_{h,r,t}-h^TRt,\lambda_2^{-1})\label{eq:term2} +\end{equation} +其中若$I_{h,r,t}\in G$则标志$I_{h,r,t}$等于1否则为0。基于式~\eqref{eq:term2}中的定义,知识图谱嵌入中的实体对评分函数与偏好传递过程中的电影-实体对可以在相同的计算模型下被统一。式~\eqref{eq:equal-max}中的第三项是给定$\Gamma$与知识图谱的似然函数,可以看作伯努利分布的累乘: +\begin{equation} + p(\Upsilon|\Gamma,G)=\prod_{(u,v)\in \Upsilon}\zeta(u^Tv)^{y_{uv}}\centerdot (1-\zeta (u^Tv))^{1-y_{uv}} +\end{equation} +对式~\eqref{eq:equal-max}取负对数,我们有下面的损失函数: +\begin{multline} + min\ L=-log(p(\Upsilon|\Gamma,G)\centerdot p(G|\Gamma)\centerdot p(\Gamma))\\ +=\sum_{(u,v)\in \Upsilon}-(y_{uv}log\ \zeta(u^Tv)+(1-y_{uv}log(1-\zeta(u^Tv))))\\ ++\frac{\lambda_2}{2}\sum_{r\in R}\|I_r-E^TRE\|_2^2+\frac{\lambda_1}{2}(\|V\|^2_2+\|E\|^2_2+\sum_{r\in R}\|R\|^2_2)\label{eq:term3} +\end{multline} +其中$V$和$E$是对所有电影与实体的嵌入表示。$I_r$是在知识图谱中的对关系$r$的标志向量$I$的分片。在式~\eqref{eq:term3}中第一项度量交互矩阵$\Upsilon$与由涟漪网络的估测值之间的交叉熵,第二项度量真实的知识图谱分片$I_r$以及人为构建的指示矩阵$E^{T}RE$之间的均方误差,最后一项是为防止过拟合加入的正则项。 + +直接求解上式来得到参数$\Gamma$是不可能的,因此我们使用随机梯度下降算法递归地优化损失函数来求解模型参数。然后我们再计算关于参数$\Gamma$的损失函数的梯度并更根据采样得到的一小批数据反向传递以更新参数并最终得到参数$\Gamma$。 +\section{分析} +\subsection{可解释性} +可解释的推荐系统旨在阐释为什么用户会对一件物品感兴趣,这帮助提升用户对推荐结果的满意度以及对推荐系统的信任。对推荐结果的解释通常基于标签、语义分析等。因为涟漪网络探索用户基于知识图谱的兴趣,因此它提供了一种基于知识图谱中的关系路径来阐述推荐结果的全新方式。比如,在图~\ref{fig:illustration-of-ripple-sets}中,当用户对“幸福终点站”感兴趣,则该用户也可能对“荒岛余生”感兴趣。因为在知识图谱中,“汤姆·汉克斯”与“幸福终点站”相连,关系是演员,而“汤姆·汉克斯”与“荒岛余生”也相连,关系也是演员,也就是说“荒岛余生”与“幸福终点站”有相同的演员。这便解释了为什么当用户对“幸福终点站”感兴趣,则该用户也可能对“荒岛余生”感兴趣。而涟漪网络算法正是通过这种方式运作的。涟漪网络算法通过在知识图谱中寻找与用户交互过的电影(种子集)相连的物品,并不断扩散,最终推荐结果之所以拥有较高的准确性,正是因为如上所述的原因。 +\subsection{涟漪重叠} +在涟漪网络中一个常见的现象是用户涟漪集中的电影可能非常多,而会在偏好传递的过程中不可避免地导致其真实的潜在偏好信息被稀释。然后,观察到用户点击记录中不同的电影常常高度重叠。换句话说,从种子集出发到达一部电影常常有不止一条路径。比如,在图~\ref{fig:illustration-of-ripple-sets}中,如果一个用户喜欢“阿甘正传”,则他也可能喜欢“荒岛余生”。在该知识图谱中,从“阿甘正传”到“荒岛余生”有两条路径:“阿甘正传-U.S.-荒岛余生”与“阿甘正传-汤姆·汉克斯-荒岛余生”,这正是涟漪重叠的表现。 +\section{测试} +\subsection{数据集} +该测试使用“电影透镜1兆数据”数据集。该数据集由电影信息、用户信息以及用户对电影的评分三部分组成。其中,含有电影数据3883条、用户数据6040条以及1000209条用户对电影的评分数据。因该数据集数据量适中,数据准确可靠,因此在推荐系统的性能测试中被广泛使用。 + +对于知识图谱,该测试依据“电影透镜1兆数据”中的电影从Microsoft Satori中提取相关的知识图谱数据来构建知识图谱。 +\subsection{基线} +在本测试中,将本算法的测试结果与以下算法的相比较: + +DKN\cite{wang2018dkn}是之前同样由微软团队在 WWW2018 会议上发表的。它是一个主要针对新闻任务提出的框架,知识图谱用在对新闻标题作嵌入的层面。DKN 提出对新闻标题内每一个关键实体,在知识图谱内找到其实体嵌入和上下文嵌入。 + +CKE\cite{zhang2016collaborative} 是微软在 KDD2016 年发表的,其模型结构在原有系统过滤得到 U, V 向量的基础上,将物品的嵌入与其他描述信息相结合,这些信息主要有: +采用 TransR 算嵌入得到的知识图谱,图谱内每个实体嵌入表示被提取为物品的结构化向量信息。 +采用SDAE模型得到物品描述性文本的文本性嵌入表示。 +采用SCAE模型得到物品相关图像的视觉嵌入表示。 + +SHINE\cite{wang2018shine}设计深度自编码器来嵌入语义网络,社交网络来进行推荐。其为用户-物品的交互使用自动编码器并刻画用户感兴趣的概率。 + +PER\cite{yu2014personalized}将知识图谱作为辅助信息基于路径的方法中比较经典的算法,是对后续模型做的改进。其提出的元路径可以为推荐系统提供可靠的方向,但是需要事先熟悉领域内知识,进行人为路径设计。 + +LibFM\cite{rendle2012factorization}是一个广泛使用的基于功能的在CTR场景中的分解模型。 + +Wide\&Deep\cite{cheng2016wide}是一个结合线性路径的推荐模型。类似于LibFM,我们将用户、物品及实体的嵌入表示作为其输入。 +\subsection{测试步骤} +在涟漪网络中,设置跳数$H$=2。根据实验结果,较大的跳数几乎无法提高性能却会造成较大的计算负担。我们将数据划分为训练集、评估集与测试集,按照6:2:2的比较。实验进行5次,计算准确度与AUC然后取平均值。 +\subsection{结果} +测试结果如表~\ref{tab:acc-auc}中所示,总体上涟漪网络算法的性能最佳,其次是Wide\&Deep算法,说明他们可以充分利用知识图谱中的有效信息来辅助推荐算法。而表现最差的是PER算法,这可能是因为手工定义的元路径在电影推荐方面效果较差。 +\begin{table} + \bicaption{在兴趣预测计算中的AUC和准确度}{AUC and ACC in interest prediction}\label{tab:acc-auc} + \begin{tabular}{lcl} + \toprule + 算法 & AUC & 准确度 \\ + \midrule + 涟漪网络 & 0.899 & 0.835 \\ + DKN & 0.655 & 0.589 \\ + CKE & 0.796 & 0.739 \\ + SHINE & 0.778 & 0.732\\ + LibFM & 0.892 & 0.812\\ + Wide\&Deep & 0.903 & 0.822\\ + \bottomrule + \end{tabular} +\end{table} +\chapter{电影推荐系统} +\section{系统整体设计} +如第\ref{sec:tech-stack}节中所述,本系统使用的数据来自“电影透镜1兆数据”、IMDb和豆瓣。其中IMDb和豆瓣的数据是使用爬虫处理的。最后再使用Python脚本对数据进行处理加工,并导入MongoDB和Neo4j。 + +本系统使用MongoDB和Neo4j存储数据。其中,MongoDB作为非关系型的新兴NoSQL数据库,以灵活非结构化的方式存储普通用户数据、管理员数据、电影数据等,并提供高并发的性能支持与可分布式存储的扩展性。而在以高性能著称的图数据库Neo4j中,则存储用于推荐算法使用的电影知识图谱信息。 + +本系统后端使用由Python编写的Flask框架,Flask框架是轻量级的微框架,以高可扩展性著称,为本系统的后端网页应用服务器提供支持。 + +在Flask中,基于REST风格构建API以供前端使用,REST风格的语义化API使后端API的构建与前端API的使用清晰明了。 + +本系统前端使用Angular作为前端网页框架。Angular是基于TypeScript的网页框架,以模块化及可重用的组件设计著称。Angular为本系统提供了模块化的网页设计,使本系统前端逻辑清晰,易于维护。此外,本系统使用了Angular材料组件库(Angular Material Components),得益于此,本系统遵循材料设计(Material Design)语言,使视觉传达风格清晰明了,具有网格化的布局、响应式动化与过渡效过、光线与阴影等。 +\section{数据库设计} +如前所述,本系统MongoDB用于存储普通用户数据、管理员数据、电影数据等,而Neo4j作为高性能的图数据,用于存储知识图谱。Neo4j的存储逻辑较简单,此处不作介绍。以下说明MongoDB中数据的存储方式。 + +不同于MySQL等关系型数据库,MongoDB作为非结构化存储的NoSQL数据库,没有表、列与行的概念,而只有集合与文档的概念,即在数据库中存储集合(一定程度上对应于关系型数据库的表),在表中存储文档(一定程度上对应于关系型数据库的行),而关系型数据库中的列则对应于MongoDB中文档的属性。 + +本系统在MongoDB中建立4个集合,分别用于用户、管理员、体裁与电影数据。因其中的数据为非结构化数据,因此无法用表格的形式给出,目前习惯上以JSON结构给出数据逻辑结构,故以下以JSON结构来表示存储结构: + +以下为普通用户集合的数据结构,用户集合中的文档存储用户ID、哈希处理后的密码、其评价过的电影(包括电影ID、评分及时间)以及由推荐算法服务器写入的推荐列表、已购买电影及心愿单: +\begin{verbatim} + { + _id: Integer, + password: String, + rating: Array([ + { + movieId: Integer, + rating: Integer, + timestamp: Integer + }, + ... + ]), + recommendation: Array([Interger, ...]), + bought: Array([Interger, ...]), + wishlist: Array([Interger, ...]) + } +\end{verbatim} + +以下来管理员集合的数据结构,其存储结构较简单,管理员集合中的文档存储管理员ID、哈希处理后的密码: +\begin{verbatim} + { + _id: String, + password: String + } +\end{verbatim} + +以下为体裁集合的数据结构,其存储结构较简单,体裁集合中的文档存储体裁名称: +\begin{verbatim} + { + _id: String + } +\end{verbatim} + +以下为电影集合的数据结构,电影集合中的文档存储电影ID、电影封面、体裁、价格、评分累加和、评分总数量、预告片图片、剧情介绍、导演、剧本作家及演员。需要说明的是评分累加和以及评分总数量对应于用户集合中的评分,但只起缓存作用,定期计算。(经测试表明,每次用户访问时计算的开销较大,用户得到响应的时间过长): +\begin{verbatim} + { + _id: Integer, + title: String, + cover: String, + genres: Array([String, ...]), + price: Float, + ratingSum: Integer, + ratingCount: Integer, + trailer_image_url: String, + storyline: Array([String, ...]), + directors: Array([String, ...]), + writers: Array([String, ...]), + actors: Array([String, ...]), + } +\end{verbatim} +\section{系统功能说明} +\begin{figure} + \includegraphics[width=\textwidth]{use-case} + \bicaption{系统功能用例图}{Use case diagram for the system }\label{fig:use-case} +\end{figure} +本系统用户角色分为未登录用户、普通用户与管理员用户,其用例说明如图~\ref{fig:use-case}。 +\subsection{未登录用户} +未登录用户能进行以下操作: + +\noindent (1)接收随机的电影推荐。 + +未登录用户首页随机显示50部电影,如图~\ref{fig:anonymous-index}所示: +\begin{figure} + \includegraphics[width=.96\textwidth]{anonymous-index} + \bicaption{未登录用户首页}{Index page for anonymous user }\label{fig:anonymous-index} +\end{figure} + +\noindent (2)按分类查看电影。 + +未登录用户可以根据电影的分类来查看电影,如图~\ref{fig:anonymous-category}所示: +\begin{figure} + \includegraphics[width=.96\textwidth]{anonymous-category} + \bicaption{未登录用户分类页面}{Category page for anonymous user }\label{fig:anonymous-category} +\end{figure} + +\noindent (3)查看电影详情。 + +未登录用户可以查看电影详情,如图~\ref{fig:anonymous-details}。而点击页面上的“添加至心愿单”和“购买”会跳转至登录界面。 +\begin{figure} + \includegraphics[height=.7\textheight]{anonymous-details} + \bicaption{未登录用户电影详情页面}{Movie details page for anonymous user }\label{fig:anonymous-details} +\end{figure} +\noindent (4)搜索电影 + +未登录用户可从应用栏右部的搜索框搜索电影,本系统支持模糊搜索。 +\subsection{注册与登录} +\noindent(1)注册 + +本系统对普通用户开放注册功能,如图~\ref{fig:sign-up},并能提供用户名是否含不合法字符、是否与已注册用户名冲突、密码是否符合复杂度要求等的检测。 +\begin{figure} + \includegraphics[width=.96\textwidth]{sign-up} + \bicaption{注册页面}{Sign up page}\label{fig:sign-up} +\end{figure} + +\noindent (2)登录 + +本系统提供登录功能,并能根据不同的登录错误类型作出不同的响应。 +\subsection{普通用户} +普通用户具备未登录用户的所有功能。此外,还具有以下功能: + +\noindent (1)添加心愿单 + +已登录用户能在电影详情页面添加电影至心愿单。 + +\noindent (2)购买 + +已登录用户能在电影详情页面购买电影。 + +\noindent (3)评价 + +已登录用户能在电影详情页面评价电影。电影评价功能位于电影详情页面,对于未登录用户不显示用于评分的组件,对于已登录用户显示,如图~\ref{fig:general-details}所示。 + +\begin{figure} + \includegraphics[width=.96\textwidth]{general-details} + \bicaption{电影评分页面}{Rating page for movies}\label{fig:general-details} +\end{figure} + +\noindent (4)查看已购买的电影 + +已登录用户能通过侧导航栏跳转至查看已购买的电影的页面。 + +\noindent (5)查看已添加心愿单的电影 + +已登录用户能通过侧导航栏跳转至查看已添加心愿单的电影的页面。 +\subsection{管理员用户} +\noindent (1)管理电影信息 + +管理员能增加电影、删除电影与修改电影信息,如图~\ref{fig:admin-movie}所示。 +\begin{figure} + \includegraphics[width=.96\textwidth]{admin-movie} + \bicaption{管理电影页面}{Movie administration page }\label{fig:admin-movie} +\end{figure} + +\noindent (2)管理用户信息 + +管理员能增加用户、删除用户与修改用户密码。 +\section{电影推荐流程} +本系统的推荐流程分为离线推荐与实时推荐,如图~\ref{fig:recommendation-procedure}所示。 + +\begin{figure} + \includegraphics[width=\textwidth]{recommendation-procedure} + \bicaption{系统电影推荐流程}{Movie recommendation procedure }\label{fig:recommendation-procedure} +\end{figure} + +其中,离线推荐使用第\ref{ch:offline-recommendation}章中所述的涟漪网络算法,而实时推荐作为补充,描述如下: + +(1)离线推荐服务器定期运行涟漪网络算法。离线推荐服务器从MongoDB服务器获取用户信息与电影评分、电影是否加入心愿单等数据以及从Neo4j服务器获取知识图谱数据信息。然后执行涟漪网络算法。最后离线推荐服务器将计算得到的各用户推荐列表存入MongoDB数据库中,等待用户访问时将该结果推荐给用户。 + +(2)当用户访问时,网页后端服务器查询推荐列表中的电影数据是否达到阀值,如果推荐列表中的数量过少,则根据用户交互随机将同体裁电影加入推荐列表的末端作为补充并最终显示给用户。 + +上述步骤中,(1)中的离线推荐准确度高,但算法运算时间长,无法做到即时响应用户请求。(2)中的实时推荐方法准确度低,但算法运算快,可以做到实时响应请求并即时发出响应。两者相互补充组成了本系统的电影推荐算法。 +\section{系统安全性} +本系统对已登录普通用户与管理员在前后端交互过程中使用JSON网络令牌(JSON Web Token, JWT)实现授权与认证(Authorization and Authentication),以此保证了系统的安全性,本系统的总体安全性设计如图~\ref{fig:jwt}所示。 + +\begin{figure} + \includegraphics[height=.6\textheight]{jwt} + \bicaption{系统总体安全性设计}{Overall security design for the system}\label{fig:jwt} +\end{figure} + +在用户登录时,Flask后端网页服务器会生成一个长期JSON网络令牌和一个临时JSON网络令牌,令牌中存储有用户id以及过期时间,并且该令牌使用非对称加密算法加密,其中含有由Flask后端网页服务器颁发的签名信息,这确保了JSON网络令牌不会被伪造。 + +前端网页服务器在接收到令牌后会将令牌存储在浏览器的localStorage中,并在每一个接下来的请求头中附上该令牌,而后端服务器只有在该令牌有效(指确实为后端网页服务器颁发且该另令牌尚未过期)的情况下才会继续执行有关请求。与此同时,若该请求是用户内容相关,则后端服务器还会检测令牌中的id是否与请求内容中的id相同。若不满足以上任意一项,则后端网页服务器返回未授权错误信息。 + +其中,若后端网页服务器发现令牌过期,则会将该信息发送给前端网页服务器,前端网页服务器将会将长期令牌发送给后端服务器以刷新(renew)临时令牌。 + +此外,本系统还使用了哈希算法对密码进行哈希处理,数据库中的密码全部为哈希处理后的密码。同时,用户登录过程是后端网页服务器使用原密码与哈希处理后的密码进行比较,而没有开放哈希处理后的密码与哈希处理后的密码进行比较,这提高了本系统的安全性。这在同时使网站仅允许HTTPS(HTTPS-only)网络连接的情况下可以充分保证本系统的安全性。 + +需要注意的是,虽然本系统在用户登录与注册时的密码在前端没有进行哈希处理,但是本系统在部署时使用HTTPS-only的连接,在这种情况下,所有的数据传输都处于加密状态,避免了中间人攻击的可能,因此明文传输密码而不使用哈希处理是安全的,在实际应用过程中可行。而本系统在后端对由前端网页服务器传入的明文密码的目的是避免数据库中存入明文的密码。如果数据库中存入明文的密码,则当数据库中用户密码泄露时攻击者可以轻易使用泄露的密码登录本系统。而如上所述,本系统后端只开放了接收明文密码的接口,即直接将数据库中哈希处理后的密码与用户请求中的明文密码进行对比,即使攻击者获取了用户哈希后的密码,要计算其对应的明文密码是困难的,甚至在明文密码足够复杂的情况下是不可能的。以上措施保证了本系统的安全性。 +\chapter{研究结论和展望} +\section{工作总结} +随着互联网的发展,用户可选择的电影数量不断增加,为了使用户快速找到感兴趣的电影,各种推荐算法应运而生。这些算法存在推荐准确性较低、数据稀缺性以及冷启动问题。本文针对此现状,以电影推荐为研究对象,使用知识图谱作为辅助信息,利用涟漪网络算法实现了电影推荐系统。具体地说,主要的研究工作如下: + +(1)从IMDb和豆瓣上使用基于Scrapy框架的爬虫爬取了3684部电影数据。其中,从IMDb爬取了3494部电影数据,从豆瓣爬取了190条电影数据(由于豆瓣限制了每IP访问量故爬取的数据较少)。这些电影数据包括电影封面图片、电影情节介绍、电影预告片图片、电影演员列表、导演以及剧本作家等信息。 + +(2)根据论文“涟漪网络:在知识图谱上传递用户偏好的推荐模型\cite{wang2018ripplenet}”设计并实现了基于知识图谱的涟漪网络推荐算法,通过使用“电影透镜1兆数据”数据集以及从IMDb和豆瓣上爬取的电影数据,实现了基于用户心愿单和用户评分并以知识图谱为辅助信息的推荐算法。并对实现的推荐算法进行了试验,并计算了其AUC和准确度两个关键的性能指标。并对比了DKN\cite{wang2018dkn}、CKE\cite{zhang2016collaborative}、PER\cite{yu2014personalized}、SHINE\cite{wang2018shine}、LibFM\cite{rendle2012factorization}以及Wide\&Deep\cite{cheng2016wide}算法的准确度结果。并以此发现,涟漪网络算法的性能最优。 + +(3)基于涟漪网络算法实现了基于知识图谱的电影推荐系统。该系统为未登录用户提供按分类查看电影、查看电影详情的功能;为普通用户提供电影推荐、按分类查看电影、查看电影详情、电影评分、将电影加入心愿单以及购买电影功能;为管理员提供增加、删除、修改、查找电影及用户的功能。同时使用JSON网络令牌、HTTPS以及哈希化密码等手段保障系统的安全性。 +\section{工作展望} +为了给用户提供准确的推荐电影,需要不断优化并改进推荐过程。推荐系统的基础是用户历史偏好集、知识图谱信息以及推荐算法本身。因此有效地记录用户历史偏好集,完善知识图谱信息并改进推荐算法本身是提高推荐结果的重要因素。本文虽然对基于知识图谱的推荐算法有了一定的研究,并且将其应用于电影推荐系统中,但是由于时间和能力所限,该系统仍存在着不足的地方,主要体现在以下两个方面: + +\noindent (1)需要完善知识图谱的信息 + +知识图谱是本文使用的涟漪网络算法的基础,但本文所使用的知识图谱的信息还不够完善,因此在一定程度上影响了涟漪网络算法的性能。 + +\noindent (2)涟漪网络算法有待进一步改进 + +涟漪网络算法目前仅适用于离线推荐,而无法用于实时推荐,这使它的适用场景受到了限制。未来可考虑改造该算法,使其能满足实时推荐的需求。 + +对于以上提及的问题,未来还需要更深入地学习有关知识图谱、推荐算法、深度学习的有关知识,对系统进行改进,从而使其更完善。 diff --git a/macros/latex/contrib/bjfuthesis/demo/cover.pdf b/macros/latex/contrib/bjfuthesis/demo/cover.pdf Binary files differnew file mode 100644 index 0000000000..6ab70639e4 --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/cover.pdf diff --git a/macros/latex/contrib/bjfuthesis/demo/figures/admin-movie.png b/macros/latex/contrib/bjfuthesis/demo/figures/admin-movie.png Binary files differnew file mode 100644 index 0000000000..163ed11325 --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/figures/admin-movie.png diff --git a/macros/latex/contrib/bjfuthesis/demo/figures/anonymous-category.png b/macros/latex/contrib/bjfuthesis/demo/figures/anonymous-category.png Binary files differnew file mode 100644 index 0000000000..2e0e50c64e --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/figures/anonymous-category.png diff --git a/macros/latex/contrib/bjfuthesis/demo/figures/anonymous-details.png b/macros/latex/contrib/bjfuthesis/demo/figures/anonymous-details.png Binary files differnew file mode 100644 index 0000000000..571e9862dd --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/figures/anonymous-details.png diff --git a/macros/latex/contrib/bjfuthesis/demo/figures/anonymous-index.png b/macros/latex/contrib/bjfuthesis/demo/figures/anonymous-index.png Binary files differnew file mode 100644 index 0000000000..6493ab444f --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/figures/anonymous-index.png diff --git a/macros/latex/contrib/bjfuthesis/demo/figures/enhanced-recommendation.png b/macros/latex/contrib/bjfuthesis/demo/figures/enhanced-recommendation.png Binary files differnew file mode 100644 index 0000000000..d5f11fa4d4 --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/figures/enhanced-recommendation.png diff --git a/macros/latex/contrib/bjfuthesis/demo/figures/general-details.png b/macros/latex/contrib/bjfuthesis/demo/figures/general-details.png Binary files differnew file mode 100644 index 0000000000..d8d33408b5 --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/figures/general-details.png diff --git a/macros/latex/contrib/bjfuthesis/demo/figures/illustration-of-ripple-sets.png b/macros/latex/contrib/bjfuthesis/demo/figures/illustration-of-ripple-sets.png Binary files differnew file mode 100644 index 0000000000..96e2920c7f --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/figures/illustration-of-ripple-sets.png diff --git a/macros/latex/contrib/bjfuthesis/demo/figures/jwt.pdf b/macros/latex/contrib/bjfuthesis/demo/figures/jwt.pdf Binary files differnew file mode 100644 index 0000000000..b6fe019966 --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/figures/jwt.pdf diff --git a/macros/latex/contrib/bjfuthesis/demo/figures/recommendation-procedure.pdf b/macros/latex/contrib/bjfuthesis/demo/figures/recommendation-procedure.pdf Binary files differnew file mode 100644 index 0000000000..049f4c623d --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/figures/recommendation-procedure.pdf diff --git a/macros/latex/contrib/bjfuthesis/demo/figures/ripplenet-framework.png b/macros/latex/contrib/bjfuthesis/demo/figures/ripplenet-framework.png Binary files differnew file mode 100644 index 0000000000..15bf3fe3aa --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/figures/ripplenet-framework.png diff --git a/macros/latex/contrib/bjfuthesis/demo/figures/sign-up.png b/macros/latex/contrib/bjfuthesis/demo/figures/sign-up.png Binary files differnew file mode 100644 index 0000000000..2c0f6ed59d --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/figures/sign-up.png diff --git a/macros/latex/contrib/bjfuthesis/demo/figures/use-case.pdf b/macros/latex/contrib/bjfuthesis/demo/figures/use-case.pdf Binary files differnew file mode 100644 index 0000000000..751a799f6f --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/figures/use-case.pdf diff --git a/macros/latex/contrib/bjfuthesis/demo/thesis.pdf b/macros/latex/contrib/bjfuthesis/demo/thesis.pdf Binary files differnew file mode 100644 index 0000000000..44b245976e --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/thesis.pdf diff --git a/macros/latex/contrib/bjfuthesis/demo/thesis.tex b/macros/latex/contrib/bjfuthesis/demo/thesis.tex new file mode 100644 index 0000000000..b8f5b59421 --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/demo/thesis.tex @@ -0,0 +1,11 @@ +\documentclass{bjfuthesis} +\begin{document} + \frontmatter + \input{contents/abstract} + \tableofcontents + \mainmatter + \input{contents/mainbody} + \backmatter + \printbibliography + \input{contents/acknowledge} +\end{document} diff --git a/macros/latex/contrib/bjfuthesis/documentation/bjfuthesis.pdf b/macros/latex/contrib/bjfuthesis/documentation/bjfuthesis.pdf Binary files differnew file mode 100644 index 0000000000..fd39414e1f --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/documentation/bjfuthesis.pdf diff --git a/macros/latex/contrib/bjfuthesis/documentation/bjfuthesis.tex b/macros/latex/contrib/bjfuthesis/documentation/bjfuthesis.tex new file mode 100644 index 0000000000..1523a5d638 --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/documentation/bjfuthesis.tex @@ -0,0 +1,11 @@ +\documentclass{bjfuthesis} +\begin{document} + \frontmatter + \input{contents/abstract} + \tableofcontents + \mainmatter + \input{contents/mainbody} + \backmatter + \chapter{参考文献} + \input{contents/acknowledge} +\end{document} diff --git a/macros/latex/contrib/bjfuthesis/documentation/contents/abstract.tex b/macros/latex/contrib/bjfuthesis/documentation/contents/abstract.tex new file mode 100644 index 0000000000..457ae84467 --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/documentation/contents/abstract.tex @@ -0,0 +1,10 @@ +\chapter*{摘要} +\begin{abstract} + bjfuthesis文档类是为北京林业大学学生书写毕业论文准备的\LaTeX 文档类。该文档类基于ctexbook文档类。它修改了一些布局与样式来提供与北京林业大学毕业论文规范兼容的文档布局。 +\end{abstract} +\keywordscn{LaTeX,毕业论文,北京林业大学} +\chapter*{Abstract} +\begin{abstract} + The bjfuthesis class is a \LaTeX class intended for students in Beijing Forestry University to write their theses. The class is based on the ctexbook class. It modifies some of the layout and style definitions of these packages in order to provide a document layout that should be compatible with Beijing Forestry University Thesis Standard. +\end{abstract} +\keywordsen{LaTeX, thesis, Beijing Forestry University} diff --git a/macros/latex/contrib/bjfuthesis/documentation/contents/acknowledge.tex b/macros/latex/contrib/bjfuthesis/documentation/contents/acknowledge.tex new file mode 100644 index 0000000000..ceadf4aa0d --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/documentation/contents/acknowledge.tex @@ -0,0 +1,2 @@ +\chapter{致谢} +感谢社区开发者的贡献。 diff --git a/macros/latex/contrib/bjfuthesis/documentation/contents/mainbody.tex b/macros/latex/contrib/bjfuthesis/documentation/contents/mainbody.tex new file mode 100644 index 0000000000..017c18c9e9 --- /dev/null +++ b/macros/latex/contrib/bjfuthesis/documentation/contents/mainbody.tex @@ -0,0 +1,102 @@ +\chapter{绪论} +\section{研究背景} +国内诸多高校都在GitHub上提供了其高校的论文模板,故本作者秉持开源共享的精神,将本\LaTeX 文档类开源于https://github.com/bjfu-projects/bjfu-thesis。 +\section{文档结构} +第一章为绪论,简单介绍研究背景以及文档结构。 + +第二章为英文使用说明,介绍本文档类的使用方法。 + +第三章为中文使用说明,介绍本文档类的使用方法。 +\chapter{Usage Notes} +The order of following usage notes is based on the structure of the thesis. + + * To include the cover of your thesis, put 'cover.pdf' in the directory. + + * You MUST add `\textbackslash frontmatter` before your abstract. + + * Print title of Chinese abstract or English abstract: `\textbackslash chapter*{abstract title}` + + * Print content of abstract: `\textbackslash begin{abstract}abstract` content`\textbackslash end{abstract}` + + * Print Chinese keywords: `\textbackslash keywordscn{Chinese keywords}` + + * Print English keywords: \textbackslash keywordsen{English keywords} + + * Print table of contents: \textbackslash tableofcontents + + * You MUST add `\textbackslash mainmatter` before the main body of your thesis. + + * The hierachy of the thesis: + `\textbackslash chapter{chapter title}` + `\textbackslash section{section title}` + `\textbackslash subsection{subsection title}` + + * Use following structure: + `\textbackslash chapter{chapter 1 title}` + normal text + `\textbackslash section{section 1.1 title}` + normal text + `\textbackslash section{section 1.2 title}` + `\textbackslash subsection{subsection 1.2.1 title}` + normal text + ... + + * Floats are set to be centered by default, with default allowed positions being current position in code, top, bottom and a separate page. + + * Put images you want to insert in `\textbackslash figures`, and you DO NOT need to include 'figures' in your path + + * Show two captions for a figure or a table: `\textbackslash bicaption{Chinese caption}{English caption}` + You MUST place figures in 'figure' environment, and table in 'table' environment, which MUST match. + Or `\textbackslash bicaption{Chinese caption}{English caption}` will not work as expected. + + * Show a note for a figure or table: `\textbackslash chartnote{a note for a figure or a table}` + + * You MUST add `\textbackslash backmatter` before your references and your acknowledgement. + + * Print bibliography: `\textbackslash printbibliography` +\chapter{使用说明} +以下使用说明的顺序基于论文的结构 + +* 要将你的论文封面插入论文,需将"cover.pdf"置于该目录中 + +* 你必须在摘要部分前加入`\textbackslash frontmatter` + +* 显示中文或英文摘要标题:`\textbackslash chapter*{abstract title}` + +* 显示摘要内容:`\textbackslash begin{abstract}摘要内容\textbackslash end{abstract}` + +* 显示中文关键词:`\textbackslash keywordscn{中文关键词}` + +* 显示英文关键词:`\textbackslash keywordsen{英文关键词}` + +* 显示目录:`\textbackslash tableofcontents` + +* 你必须在你的论文的主体部分前加入`\textbackslash mainmatter` + +* 论文具有的层次划分: +`\textbackslash chapter{一级标题}` +`\textbackslash section{二级标题}` +`\textbackslash subsection{三级标题}` + +* 使用以下层次结构: +`\textbackslash chapter{一级标题 1}` +正文文字 +`\textbackslash section{二级标题 1.1}` +正文文字 +`\textbackslash section{二级标题 1.2}` +`\textbackslash subsection{三级标题 1.2.1}` +正文文字 +…… + +* 浮动体已默认居中,且默认允许的位置已设为“当前代码中的位置、顶部、底部、单独成页” + +* 将你需要插入的图片置于`\textbackslash figures`中,无需在路径中包含“figures” + +* 为一张图或一个表显示两个图(表)题:`\textbackslash bicaption{中文图题}{英文图题}` +你必须将图置于“figure”环境中,表置于“table”环境中,必须匹配。 +否则`\textbackslash bicaption{中文图题}{英文图题}`不会起作用 +* 显示图表注:`\textbackslash chartnote{图的注释或表的注释}` + +* 你必须在你的参考文献前加入`\textbackslash backmatter` + +* 显示参考文献:`\textbackslash printbibliography` diff --git a/macros/latex/contrib/derivative/README.md b/macros/latex/contrib/derivative/README.md index 94ee7eff7a..72d73433ed 100644 --- a/macros/latex/contrib/derivative/README.md +++ b/macros/latex/contrib/derivative/README.md @@ -1,4 +1,4 @@ -## README for derivative package v1.0 dated 2021-05-25 +## README for derivative package v1.01 dated 2021-05-28 The package provides a set of commands `\NewDerivative`, `\NewDifferential` etc. that can be used to define a derivative or a differential operator, respectively. The package have already defined several derivatives and differentials: diff --git a/macros/latex/contrib/derivative/derivative.pdf b/macros/latex/contrib/derivative/derivative.pdf Binary files differindex 8f97eaa120..c18c477ca4 100644 --- a/macros/latex/contrib/derivative/derivative.pdf +++ b/macros/latex/contrib/derivative/derivative.pdf diff --git a/macros/latex/contrib/derivative/derivative.sty b/macros/latex/contrib/derivative/derivative.sty index 6994b23a95..13eac36065 100644 --- a/macros/latex/contrib/derivative/derivative.sty +++ b/macros/latex/contrib/derivative/derivative.sty @@ -16,7 +16,7 @@ \NeedsTeXFormat{LaTeX2e} \RequirePackage{xparse}[2018/05/09] -\ProvidesExplPackage{derivative}{2021/05/25}{1.0}{Nice and easy derivatives and differentials for LaTeX} +\ProvidesExplPackage{derivative}{2021/05/28}{1.01}{Nice and easy derivatives and differentials for LaTeX} %%%%% Useful conditionals %%%%% @@ -147,6 +147,7 @@ \prop_const_from_keyval:Nn \c__deriv_dv_pkg_keys_prop { + style-inf = d, style-frac = \frac, style-frac-/ = \slashfrac, style-var = single, @@ -188,12 +189,9 @@ mixed-order = 1 } -\bool_lazy_or:nnTF { \sys_if_engine_luatex_p: } { \sys_if_engine_xetex_p: } -{ \prop_gput:Nnn \c__deriv_dv_pkg_keys_prop { style-inf } { \symnormal } } -{ \prop_gput:Nnn \c__deriv_dv_pkg_keys_prop { style-inf } { \mathnormal } } - \prop_const_from_keyval:Nn \c__deriv_i_pkg_keys_prop { + style-inf = d, style-notation = multiple, style-notation-* = single, scale-var = auto, @@ -207,16 +205,12 @@ sep-var-inf = \mathop{}\!, sep-var-var = {,}, sep-ord-ord = {,}, - sep-end = \mathop{}\!, + sep-end = 0, switch-* = false, var = none, order = 1 } -\bool_lazy_or:nnTF { \sys_if_engine_luatex_p: } { \sys_if_engine_xetex_p: } -{ \prop_gput:Nnn \c__deriv_i_pkg_keys_prop { style-inf } { \symnormal } } -{ \prop_gput:Nnn \c__deriv_i_pkg_keys_prop { style-inf } { \mathnormal } } - %%%%%% Key-val for all %%%%%% \prop_const_from_keyval:Nn \c__deriv_all_pkg_keys_prop @@ -387,12 +381,13 @@ \cs_new_protected:Npn \deriv_preamble:NNnnn #1 #2 #3 #4 #5 { \tl_set:Nx #1 { \cs_to_str:N #2 } - \__deriv_preamble_aux:Vnn #1 {#4} {#5} - \exp_args:NV \deriv_set_style_inf:nnn {#1} {#3} {#5} + \tl_if_novalue:nTF {#4} + { \__deriv_preamble_aux:Vnn #1 { style-inf={#3} } {#5} } + { \__deriv_preamble_aux:Vnn #1 { style-inf={#3}, #4} {#5} } } -% dv/i, variant, inf +% variant, inf, dv/i \cs_new_protected:Npn \deriv_set_style_inf:nnn #1 #2 #3 -{ \keys_set:nn { deriv/#3/#1 } { style-inf = {#2} } } +{ \__deriv_set_default:nnn {#1} { style-inf = {#2} } {#3} } % variant, key-value, dv/i \cs_new_protected:Npn \__deriv_preamble_aux:nnn #1 #2 #3 { diff --git a/macros/latex/contrib/derivative/derivative.tex b/macros/latex/contrib/derivative/derivative.tex index fe7cf2ddc9..840b868396 100644 --- a/macros/latex/contrib/derivative/derivative.tex +++ b/macros/latex/contrib/derivative/derivative.tex @@ -50,17 +50,6 @@ indent_length "2" \definecolor{RoyalBlue}{RGB}{0, 35, 102} \definecolor{RoyalGreen}{RGB}{32, 77, 2} - %\definecolor{RoyalGray}{RGB}{75, 75, 75} - %\definecolor{RoyalDarkGray}{RGB}{225, 225, 225} - %\definecolor{RoyalLightGray}{RGB}{30, 30, 30} - %\definecolor{RoyalRed}{RGB}{255, 177, 151} % 207, 102, 121 - %\definecolor{RoyalBlue}{RGB}{187, 134, 252} % 55, 185, 255 - %\definecolor{RoyalGreen}{RGB}{3, 218, 198} % 52, 177, 20 - %\definecolor{RoyalPageCoulor}{RGB}{18, 18, 18} % 30, 30, 30 - %\definecolor{RoyalTextCoulor}{RGB}{225, 225, 225} - %\pagecolor{RoyalPageCoulor} - %\color{RoyalTextCoulor} - \RequirePackage{amsmath, amsthm} \allowdisplaybreaks \theoremstyle{remark} @@ -103,7 +92,7 @@ indent_length "2" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\NewDocumentCommand{\forside}{} +\NewDocumentCommand{\forside}{ m } { \thispagestyle{empty} @@ -134,7 +123,7 @@ indent_length "2" \begin{abstract} \noindent \ignorespaces - The~\mypackage{}~package~provides~a~set~of~commands~which~makes~writing~ordinary~and~partial~derivatives~of~arbitrary~order~in~a~straight~forward~manner.~Additionally,~this~package~provides~a~set~of~commands~to~define~variants~of~the~aforementioned~derivatives.~A~set~of~optional~arguments~along~with~lots~of~package~options~allow~for~easy~and~great~flexibility~over~the~derivative's~format,~such~as~where~the~function~is~positioned,~point~of~evaluation,~and~switching~between~fraction~styles.~Moreover,~the~mixed~order~of~the~partial~derivative~and~variants~hereof~is~automatically~computed.~This~package~is~written~in~the~\pkg{expl3}~language~and~requires~therefore~the~\LaTeX3~package~bundles~\pkg{l3kernel}~and~\pkg{l3package}.~Additionally,~the~\pkg{mleftright}~package~is~optional~and~provides~the~improved~automatically~scaling~\cs{mleft}~and~\cs{mright}. + #1 \end{abstract} \vfill @@ -394,7 +383,6 @@ indent_length "2" { } - \tl_new:N \l__mydoc_number_tl \tl_new:N \l_mydoc_index_item_tl \tl_new:N \l_mydoc_index_subitem_tl @@ -1319,14 +1307,12 @@ indent_length "2" \ExplSyntaxOff \makeatother - - \Pakkenavn{derivative} \Titel{The \pakkenavn{} package} \Forfatter{Simon Jensen} \Email{sjelatex@gmail.com} -\Dato{2021/05/25} -\Version{1.0} +\Dato{2021/05/28} +\Version{1.01} \RequirePackage{derivative}[\dato] \derivset{all}[scale-auto = mleftmright] @@ -1362,13 +1348,14 @@ indent_length "2" \begin{document} - \forside + \forside{% + The \mypackage{} package provides a set of commands which makes writing ordinary and partial derivatives of arbitrary order in a straight forward manner. Additionally, this package provides a set of commands to define variants of the aforementioned derivatives. A set of optional arguments along with lots of package options allow for easy and great flexibility over the derivative's format, such as where the function is positioned, point of evaluation, and switching between fraction styles. Moreover, the mixed order of the partial derivative and variants hereof is automatically computed. This package is written in the \pkg{expl3} language and requires therefore the \LaTeX3 package bundles \pkg{l3kernel} and \pkg{l3package}. Additionally, the \pkg{mleftright} package is optional and provides the improved automatically scaling \cs{mleft} and \cs{mright}.% + } \clearpage \tableofcontents \clearpage - \section{Introduction} This package started as a personal package a few years ago that I used in various projects. Firstly, it was written in \tex{} and \latex, which gave rise to various errors as the complexity of the package grew larger and ended up as a spaghetti code. Therefore, the code was rewritten into the \latex3 language and may now be easily maintained. Originally this package was written because there did not exist any great package for derivatives. It was first much later that I discovered the \pkg{diffcoeff} package, which does a good job. However, at this time, I had already written much of the code with no documentation. So I decided to write one and make it into a package for the public. As a note on terminology, I use the wording \emph{infinitesimal} abbreviated as \texttt{inf} for the operator symbols $d, \partial, \delta$ etc. that used in derivatives like $\odv{y}{x}, \pdv{y}{x}, \fdv{y}{x}$ and in differentials like $\odif{x}, \pdif{x}, \fdif{x}$. In the description of macros and options, I often write \emph{cs-\meta{placeholder}} to denote a comma-separated list of \meta{placeholder}. For example, \oarg{cs-numbers} is used in the option section for math space keys to denote comma-separated list of numbers. It should also be noted that whenever an argument reads \meta{keyvalue list}, it means that it is a comma-separated list of keyvalue pairs. @@ -2041,7 +2028,7 @@ indent_length "2" \subsubsection*{Miscellaneous} \begin{option}*{fun}[cat=misc, new = v1.0] - \begin{values} + \begin{values}[default = false] true, false \end{values} Adds or remove delimiters around the function. @@ -2054,7 +2041,7 @@ indent_length "2" \end{option} \begin{option}{frac}[cat=misc, new = v1.0] - \begin{values} + \begin{values}[default = false] true, false \end{values} Adds or remove delimiters around the fractional part of the derivative. @@ -2232,7 +2219,7 @@ indent_length "2" \end{option} \begin{option}{sep-end} - \begin{values}[default = \cs{mathop}\{\}\cs{!}] + \begin{values}[default = 0] \meta{cs-number}, \marg{mspace}, \marg{delimiter} \end{values} Sets the math space that is inserted to the right of the last differential. The key's default value is \val{\default}. @@ -2288,7 +2275,6 @@ indent_length "2" \end{option} - \clearpage \section{Defining variants} \label{sec:defvar} This section goes into detail with how to define derivative and differential variants based on the package's internal commands, as mentioned earlier. The \mypackage{} package provides a \latex2 way of defining the derivatives. @@ -2485,6 +2471,8 @@ indent_length "2" \pdv[order={n+3k, n-k}, mixed-order={2(n+k)}]{f}{x,y} \end{example} + + \clearpage \section{Miscellaneous} @@ -2518,7 +2506,6 @@ indent_length "2" \end{function} - \clearpage \section{To do}\label{sec:todo} @@ -2531,11 +2518,11 @@ indent_length "2" \answer{\cmark\xmark}{There could be an draft/final option for the package. But what is should turn off/on is harder to say.} \end{todo} - \subsection{Future changes} - The list describes what \emph{will be changed} in the package in a later release. - \begin{changes} - \item - \end{changes} + %\subsection{Future changes} + %The list describes what \emph{will be changed} in the package in a later release. + %\begin{changes} + % \item + %\end{changes} \subsection{Future considerations} The list describes what \emph{might be changed or added} to the package in a later release. @@ -2547,7 +2534,6 @@ indent_length "2" \end{consideration} - \clearpage \addsec{Index} Numbers in bold refer to the page where the entry is defined. @@ -2558,8 +2544,6 @@ indent_length "2" \printindex[macro] - - \clearpage \addsec{Change history} @@ -2610,6 +2594,11 @@ indent_length "2" \item Fixed Documentation errors \item Enhanced support for preventing options effecting nested derivatives/differentials \end{change} + \begin{change}[version = 1.01, date = 2021-05-28, beta = false] + \item Changed the option \key[index=false]{sep-end} default value because it caused issues + \item Fixed code errors due to changes introduced in version 1.0 to the option \key[index=false]{style-inf} + \item Fixed documentation errors + \end{change} \end{changelog} \end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/fei/README b/macros/latex/contrib/fei/README index 1ef4a40b51..cba5685fb5 100644 --- a/macros/latex/contrib/fei/README +++ b/macros/latex/contrib/fei/README @@ -9,13 +9,12 @@ See http://www.latex-project.org/lppl.txt fei is a class created by graduate students and LaTeX enthusiasts that allow students from FEI University Center to create their academic works, be it a monograph, masters dissertation or phd thesis, under the typographic rules of the institution. The class makes it possible to create a full academic work, supporting functionalities such as cover, title page, catalog entry, dedication, summary, lists of figures, tables, algorithms, acronyms and symbols, multiple authors, index, references, appendices and attachments. -fei is loosely based in the Brazilian National Standards Organization (Associação Brasileira de Normas Técnicas, ABNT) standards for the creation of academic works, such as ABNT NBR 10520:2002 (Citations) and ABNT NBR 6023:2002 (Bibligraphic References). - +fei is loosely based in the Brazilian National Standards Organization (Associação Brasileira de Normas Técnicas, ABNT) standards for the creation of academic works, such as NBR 14724:2011, NBR 6028:2003, NBR 10522:1988, NBR 6024:2012, NBR 6023:2002 and NBR 6034:2004. In the manual, users will find detailed information regarding the class commands, environments and best practices to create an academic text of good quality. We also made available a few template files which students may use as a starting point for their texts. -##License +# License Released under the LaTeX Project Public License v1.3c or later See http://www.latex-project.org/lppl.txt -##Latest releases and version control -To get the newest version of the class, as well as to know the changes we are doing to the class and its functionalities, visit https://douglasrizzo.github.io/Classe-Latex-FEI/. +# Latest releases and version control +CTAN is always the place to go to get the stable version of the class. To know the changes done to the class and get previous and developments versions, visit https://ww.github.com/douglasrizzo/Classe-Latex-FEI/. diff --git a/macros/latex/contrib/fei/fei-template-sublist.tex b/macros/latex/contrib/fei/fei-template-sublist.tex index b228dcb565..8aaa40ba2f 100644 --- a/macros/latex/contrib/fei/fei-template-sublist.tex +++ b/macros/latex/contrib/fei/fei-template-sublist.tex @@ -104,16 +104,16 @@ Vivamus vel erat erat. Integer venenatis nisl velit, vel commodo lectus condimen \end{resumo} \begin{abstract} - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quam turpis, ullamcorper quis laoreet ac, malesuada sed mi. Quisque orci nunc, placerat quis mauris vel, luctus dictum tellus. Ut aliquam dui nunc, quis commodo justo mattis aliquam. Nam congue libero nec dui auctor pharetra. Sed sit amet justo sodales, elementum massa quis, luctus ipsum. Ut et libero mattis, rhoncus nisi vitae, facilisis sapien. Aliquam erat volutpat. Mauris eget libero egestas, ullamcorper leo quis, convallis libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quam turpis, ullamcorper quis laoreet ac, malesuada sed mi. Quisque orci nunc, placerat quis mauris vel, luctus dictum tellus. Ut aliquam dui nunc, quis commodo justo mattis aliquam. Nam congue libero nec dui auctor pharetra. Sed sit amet justo sodales, elementum massa quis, luctus ipsum. Ut et libero mattis, rhoncus nisi vitae, facilisis sapien. Aliquam erat volutpat. Mauris eget libero egestas, ullamcorper leo quis, convallis libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. - Sed a odio porttitor, lacinia libero vel, egestas sem. Donec accumsan tellus nec enim porttitor, id rhoncus neque dignissim. Vestibulum sollicitudin turpis sed ligula tincidunt iaculis. Vestibulum condimentum libero erat, laoreet placerat elit ullamcorper a. Nam consectetur euismod risus. Duis quis ultricies velit, ut volutpat augue. Nam ligula sapien, interdum id leo vitae, porta volutpat velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus sit amet libero varius, consequat ipsum ac, placerat velit. + Sed a odio porttitor, lacinia libero vel, egestas sem. Donec accumsan tellus nec enim porttitor, id rhoncus neque dignissim. Vestibulum sollicitudin turpis sed ligula tincidunt iaculis. Vestibulum condimentum libero erat, laoreet placerat elit ullamcorper a. Nam consectetur euismod risus. Duis quis ultricies velit, ut volutpat augue. Nam ligula sapien, interdum id leo vitae, porta volutpat velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus sit amet libero varius, consequat ipsum ac, placerat velit. - Nunc molestie nunc ac lorem dictum, sit amet placerat tellus congue. In sit amet dolor sed leo lobortis malesuada. Curabitur sit amet tristique urna. Vestibulum sollicitudin pellentesque aliquam. Sed pellentesque enim in lacus sodales laoreet. Suspendisse massa magna, fermentum at massa vitae, fermentum posuere dui. Interdum et malesuada \index{FEI}FEI fames ac ante ipsum primis in faucibus. Pellentesque porttitor mauris adipiscing dolor semper condimentum. Donec in nibh sapien. Cras vestibulum venenatis nisl ultrices feugiat. Donec a neque eu odio vehicula rutrum quis eu nisl. Curabitur mauris diam, sollicitudin egestas condimentum a, faucibus non felis. Duis scelerisque augue sed turpis lobortis accumsan. + Nunc molestie nunc ac lorem dictum, sit amet placerat tellus congue. In sit amet dolor sed leo lobortis malesuada. Curabitur sit amet tristique urna. Vestibulum sollicitudin pellentesque aliquam. Sed pellentesque enim in lacus sodales laoreet. Suspendisse massa magna, fermentum at massa vitae, fermentum posuere dui. Interdum et malesuada \index{FEI}FEI fames ac ante ipsum primis in faucibus. Pellentesque porttitor mauris adipiscing dolor semper condimentum. Donec in nibh sapien. Cras vestibulum venenatis nisl ultrices feugiat. Donec a neque eu odio vehicula rutrum quis eu nisl. Curabitur mauris diam, sollicitudin egestas condimentum a, faucibus non felis. Duis scelerisque augue sed turpis lobortis accumsan. - Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Duis ut dolor erat. Fusce adipiscing interdum eros, in ultrices orci auctor at. Mauris ac ante orci. In nec mauris arcu. In pulvinar tortor a felis interdum pretium. Donec tristique laoreet sollicitudin. Proin erat metus, blandit sed cursus eget, faucibus id nunc. Donec id nisi non mauris tempor tincidunt. Fusce venenatis pulvinar enim. Fusce sit amet tortor nec magna feugiat pharetra ac nec nibh. Praesent non nisi lacus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum rutrum varius velit, id iaculis ante vestibulum quis. Aenean bibendum sit amet quam ornare mollis. Suspendisse sollicitudin fringilla felis in venenatis. + Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Duis ut dolor erat. Fusce adipiscing interdum eros, in ultrices orci auctor at. Mauris ac ante orci. In nec mauris arcu. In pulvinar tortor a felis interdum pretium. Donec tristique laoreet sollicitudin. Proin erat metus, blandit sed cursus eget, faucibus id nunc. Donec id nisi non mauris tempor tincidunt. Fusce venenatis pulvinar enim. Fusce sit amet tortor nec magna feugiat pharetra ac nec nibh. Praesent non nisi lacus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum rutrum varius velit, id iaculis ante vestibulum quis. Aenean bibendum sit amet quam ornare mollis. Suspendisse sollicitudin fringilla felis in venenatis. - Vivamus vel erat erat. Integer venenatis nisl velit, vel commodo lectus condimentum ac. Aliquam id magna at tellus sagittis tempus id quis ante. Maecenas bibendum ipsum nec urna condimentum mollis. In venenatis eget nunc ac adipiscing. Vivamus faucibus vel orci mattis egestas. In hac habitasse platea dictumst. Nulla faucibus neque eu fermentum luctus. Duis ipsum nunc, congue vel justo nec, faucibus iaculis erat. Integer sit amet augue nec enim blandit placerat. Sed bibendum feugiat eros. - \keywords{Keywords. Go. Here.} + Vivamus vel erat erat. Integer venenatis nisl velit, vel commodo lectus condimentum ac. Aliquam id magna at tellus sagittis tempus id quis ante. Maecenas bibendum ipsum nec urna condimentum mollis. In venenatis eget nunc ac adipiscing. Vivamus faucibus vel orci mattis egestas. In hac habitasse platea dictumst. Nulla faucibus neque eu fermentum luctus. Duis ipsum nunc, congue vel justo nec, faucibus iaculis erat. Integer sit amet augue nec enim blandit placerat. Sed bibendum feugiat eros. + \keywords{Keywords. Go. Here.} \end{abstract} \listoffigures @@ -122,7 +122,7 @@ Vivamus vel erat erat. Integer venenatis nisl velit, vel commodo lectus condimen \printglossaries \tableofcontents -\chapter{LOREM IPSUM} +\chapter{Lorem ipsum} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quam turpis, ullamcorper quis laoreet ac, malesuada sed mi. Quisque orci nunc, placerat quis mauris vel, luctus dictum tellus. Ut aliquam dui nunc, quis commodo justo mattis aliquam. Nam congue libero nec dui auctor pharetra. Sed sit amet justo sodales, elementum massa quis, luctus ipsum. Ut et libero mattis, rhoncus nisi vitae, facilisis sapien. Aliquam erat volutpat. Mauris eget libero egestas, ullamcorper leo quis, convallis libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. @@ -138,19 +138,19 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos Vivamus vel erat erat. Integer venenatis nisl velit, vel commodo lectus condimentum ac. Aliquam id magna at tellus sagittis tempus id quis ante. Maecenas bibendum ipsum nec urna condimentum mollis. In venenatis eget nunc ac adipiscing. Vivamus faucibus vel orci mattis egestas. In hac habitasse platea dictumst. Nulla faucibus neque eu fermentum luctus. Duis ipsum nunc, congue vel justo nec, faucibus iaculis erat. Integer sit amet augue nec enim blandit placerat. Sed bibendum feugiat eros. -\section{Class aptent taciti} +\section{CLASS APTENT TACITI} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quam turpis, ullamcorper quis laoreet ac, malesuada sed mi. Quisque orci nunc, placerat quis mauris vel, luctus dictum tellus. Ut aliquam dui nunc, quis commodo justo mattis aliquam. Nam congue libero nec dui auctor pharetra. Sed sit amet justo sodales, elementum massa quis, luctus ipsum. Ut et libero mattis, rhoncus nisi vitae, facilisis sapien. Aliquam erat volutpat. Mauris eget libero egestas, ullamcorper leo quis, convallis libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a odio porttitor, lacinia libero vel, egestas sem. Donec accumsan tellus nec enim porttitor, id rhoncus neque dignissim. Vestibulum sollicitudin turpis sed ligula tincidunt iaculis. Vestibulum condimentum libero erat, laoreet placerat elit ullamcorper a. Nam consectetur euismod risus. Duis quis ultricies velit, ut volutpat augue. Nam ligula sapien, interdum id leo vitae, porta volutpat velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus sit amet libero varius, consequat ipsum ac, placerat velit. -\section{Nunc molestie nunc} +\section{NUNC MOLESTIE NUNC} Nunc molestie nunc ac lorem dictum, sit amet placerat tellus congue. In sit amet dolor sed leo lobortis malesuada. Curabitur sit amet tristique urna. Vestibulum sollicitudin pellentesque aliquam. Sed pellentesque enim in lacus sodales laoreet. Suspendisse massa magna, fermentum at massa vitae, fermentum posuere dui. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque porttitor mauris adipiscing dolor semper condimentum. Donec in nibh sapien. Cras vestibulum venenatis nisl ultrices feugiat. Donec a neque eu odio vehicula rutrum quis eu nisl. Curabitur mauris diam, sollicitudin egestas condimentum a, faucibus non felis. Duis scelerisque augue sed turpis lobortis accumsan. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Duis ut dolor erat. Fusce adipiscing interdum eros, in ultrices orci auctor at. Mauris ac ante orci. In nec mauris \index{FEI}FEI arcu. In pulvinar tortor a felis interdum pretium. Donec tristique laoreet sollicitudin. Proin erat metus, blandit sed cursus eget, faucibus id nunc. Donec id nisi non mauris tempor tincidunt. Fusce venenatis pulvinar enim. Fusce sit amet tortor nec magna feugiat pharetra ac nec nibh. Praesent non nisi lacus. Class aptent taciti sociosqu ad litora torquent per conubi. -\chapter{VESTIBULUM RUTRUM} +\chapter{Vestibulum rutrum} Vestibulum rutrum varius velit, id iaculis ante vestibulum quis. Aenean bibendum sit amet quam ornare mollis. Suspendisse sollicitudin fringilla felis in venenatis. @@ -167,7 +167,8 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quam turpis, ull Sed a odio porttitor, lacinia libero vel, egestas sem. Donec accumsan tellus nec enim porttitor, id rhoncus neque dignissim. Vestibulum sollicitudin turpis sed ligula tincidunt iaculis. Vestibulum condimentum libero erat, laoreet placerat elit ullamcorper a. Nam consectetur euismod risus. Duis quis ultricies velit, ut volutpat augue. Nam ligula sapien, interdum id leo vitae, porta volutpat velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus sit amet libero varius, consequat ipsum ac, placerat velit. \begin{table}[ht!] - \caption{Donec accumsan tellus nec enim porttitor} \label{tbl:exemplo} + \caption{Donec accumsan tellus nec enim porttitor}% + \label{tbl:exemplo} \centering \begin{tabular}{|c|c|c|c|} \hline @@ -183,7 +184,7 @@ Sed a odio porttitor, lacinia libero vel, egestas sem. Donec accumsan tellus nec \caption*{Fonte: Autor} \end{table} -\section{Class aptent taciti} +\section{CLASS APTENT TACITI} Class aptent taciti sociosqu ad litora torquent per conubia nostra, per \index{latex@\LaTeX} inceptos himenaeos. Duis ut dolor erat. Fusce adipiscing interdum eros, in ultrices orci auctor at. Mauris ac ante orci. In nec mauris arcu. In pulvinar tortor a felis interdum pretium. Donec tristique laoreet sollicitudin. Proin erat metus, blandit sed cursus eget, faucibus id nunc. Donec id nisi non mauris tempor tincidunt. Fusce venenatis pulvinar enim. Fusce sit amet tortor nec magna feugiat pharetra ac nec nibh. Praesent non nisi lacus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum rutrum varius velit, id iaculis ante vestibulum quis. Aenean bibendum sit amet quam ornare mollis. Suspendisse sollicitudin fringilla felis in venenatis. diff --git a/macros/latex/contrib/fei/fei-template.tex b/macros/latex/contrib/fei/fei-template.tex index 71fd5aca72..76ae821657 100644 --- a/macros/latex/contrib/fei/fei-template.tex +++ b/macros/latex/contrib/fei/fei-template.tex @@ -82,16 +82,16 @@ Vivamus vel erat erat. Integer venenatis nisl velit, vel commodo lectus condimen \end{resumo} \begin{abstract} - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quam turpis, ullamcorper quis laoreet ac, malesuada sed mi. Quisque orci nunc, placerat quis mauris vel, luctus dictum tellus. Ut aliquam dui nunc, quis commodo justo mattis aliquam. Nam congue libero nec dui auctor pharetra. Sed sit amet justo sodales, elementum massa quis, luctus ipsum. Ut et libero mattis, rhoncus nisi vitae, facilisis sapien. Aliquam erat volutpat. Mauris eget libero egestas, ullamcorper leo quis, convallis libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quam turpis, ullamcorper quis laoreet ac, malesuada sed mi. Quisque orci nunc, placerat quis mauris vel, luctus dictum tellus. Ut aliquam dui nunc, quis commodo justo mattis aliquam. Nam congue libero nec dui auctor pharetra. Sed sit amet justo sodales, elementum massa quis, luctus ipsum. Ut et libero mattis, rhoncus nisi vitae, facilisis sapien. Aliquam erat volutpat. Mauris eget libero egestas, ullamcorper leo quis, convallis libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. - Sed a odio porttitor, lacinia libero vel, egestas sem. Donec accumsan tellus nec enim porttitor, id rhoncus neque dignissim. Vestibulum sollicitudin turpis sed ligula tincidunt iaculis. Vestibulum condimentum libero erat, laoreet placerat elit ullamcorper a. Nam consectetur euismod risus. Duis quis ultricies velit, ut volutpat augue. Nam ligula sapien, interdum id leo vitae, porta volutpat velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus sit amet libero varius, consequat ipsum ac, placerat velit. + Sed a odio porttitor, lacinia libero vel, egestas sem. Donec accumsan tellus nec enim porttitor, id rhoncus neque dignissim. Vestibulum sollicitudin turpis sed ligula tincidunt iaculis. Vestibulum condimentum libero erat, laoreet placerat elit ullamcorper a. Nam consectetur euismod risus. Duis quis ultricies velit, ut volutpat augue. Nam ligula sapien, interdum id leo vitae, porta volutpat velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus sit amet libero varius, consequat ipsum ac, placerat velit. - Nunc molestie nunc ac lorem dictum, sit amet placerat tellus congue. In sit amet dolor sed leo lobortis malesuada. Curabitur sit amet tristique urna. Vestibulum sollicitudin pellentesque aliquam. Sed pellentesque enim in lacus sodales laoreet. Suspendisse massa magna, fermentum at massa vitae, fermentum posuere dui. Interdum et malesuada \index{FEI}FEI fames ac ante ipsum primis in faucibus. Pellentesque porttitor mauris adipiscing dolor semper condimentum. Donec in nibh sapien. Cras vestibulum venenatis nisl ultrices feugiat. Donec a neque eu odio vehicula rutrum quis eu nisl. Curabitur mauris diam, sollicitudin egestas condimentum a, faucibus non felis. Duis scelerisque augue sed turpis lobortis accumsan. + Nunc molestie nunc ac lorem dictum, sit amet placerat tellus congue. In sit amet dolor sed leo lobortis malesuada. Curabitur sit amet tristique urna. Vestibulum sollicitudin pellentesque aliquam. Sed pellentesque enim in lacus sodales laoreet. Suspendisse massa magna, fermentum at massa vitae, fermentum posuere dui. Interdum et malesuada \index{FEI}FEI fames ac ante ipsum primis in faucibus. Pellentesque porttitor mauris adipiscing dolor semper condimentum. Donec in nibh sapien. Cras vestibulum venenatis nisl ultrices feugiat. Donec a neque eu odio vehicula rutrum quis eu nisl. Curabitur mauris diam, sollicitudin egestas condimentum a, faucibus non felis. Duis scelerisque augue sed turpis lobortis accumsan. - Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Duis ut dolor erat. Fusce adipiscing interdum eros, in ultrices orci auctor at. Mauris ac ante orci. In nec mauris arcu. In pulvinar tortor a felis interdum pretium. Donec tristique laoreet sollicitudin. Proin erat metus, blandit sed cursus eget, faucibus id nunc. Donec id nisi non mauris tempor tincidunt. Fusce venenatis pulvinar enim. Fusce sit amet tortor nec magna feugiat pharetra ac nec nibh. Praesent non nisi lacus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum rutrum varius velit, id iaculis ante vestibulum quis. Aenean bibendum sit amet quam ornare mollis. Suspendisse sollicitudin fringilla felis in venenatis. + Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Duis ut dolor erat. Fusce adipiscing interdum eros, in ultrices orci auctor at. Mauris ac ante orci. In nec mauris arcu. In pulvinar tortor a felis interdum pretium. Donec tristique laoreet sollicitudin. Proin erat metus, blandit sed cursus eget, faucibus id nunc. Donec id nisi non mauris tempor tincidunt. Fusce venenatis pulvinar enim. Fusce sit amet tortor nec magna feugiat pharetra ac nec nibh. Praesent non nisi lacus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum rutrum varius velit, id iaculis ante vestibulum quis. Aenean bibendum sit amet quam ornare mollis. Suspendisse sollicitudin fringilla felis in venenatis. - Vivamus vel erat erat. Integer venenatis nisl velit, vel commodo lectus condimentum ac. Aliquam id magna at tellus sagittis tempus id quis ante. Maecenas bibendum ipsum nec urna condimentum mollis. In venenatis eget nunc ac adipiscing. Vivamus faucibus vel orci mattis egestas. In hac habitasse platea dictumst. Nulla faucibus neque eu fermentum luctus. Duis ipsum nunc, congue vel justo nec, faucibus iaculis erat. Integer sit amet augue nec enim blandit placerat. Sed bibendum feugiat eros. - \keywords{Keywords. Go. Here.} + Vivamus vel erat erat. Integer venenatis nisl velit, vel commodo lectus condimentum ac. Aliquam id magna at tellus sagittis tempus id quis ante. Maecenas bibendum ipsum nec urna condimentum mollis. In venenatis eget nunc ac adipiscing. Vivamus faucibus vel orci mattis egestas. In hac habitasse platea dictumst. Nulla faucibus neque eu fermentum luctus. Duis ipsum nunc, congue vel justo nec, faucibus iaculis erat. Integer sit amet augue nec enim blandit placerat. Sed bibendum feugiat eros. + \keywords{Keywords. Go. Here.} \end{abstract} \listoffigures @@ -100,7 +100,7 @@ Vivamus vel erat erat. Integer venenatis nisl velit, vel commodo lectus condimen \printglossaries \tableofcontents -\chapter{LOREM IPSUM} +\chapter{Lorem ipsum} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quam turpis, ullamcorper quis laoreet ac, malesuada sed mi. Quisque orci nunc, placerat quis mauris vel, luctus dictum tellus. Ut aliquam dui nunc, quis commodo justo mattis aliquam. Nam congue libero nec dui auctor pharetra. Sed sit amet justo sodales, elementum massa quis, luctus ipsum. Ut et libero mattis, rhoncus nisi vitae, facilisis sapien. Aliquam erat volutpat. Mauris eget libero egestas, ullamcorper leo quis, convallis libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. @@ -116,19 +116,19 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos Vivamus vel erat erat. Integer venenatis nisl velit, vel commodo lectus condimentum ac. Aliquam id magna at tellus sagittis tempus id quis ante. Maecenas bibendum ipsum nec urna condimentum mollis. In venenatis eget nunc ac adipiscing. Vivamus faucibus vel orci mattis egestas. In hac habitasse platea dictumst. Nulla faucibus neque eu fermentum luctus. Duis ipsum nunc, congue vel justo nec, faucibus iaculis erat. Integer sit amet augue nec enim blandit placerat. Sed bibendum feugiat eros. -\section{Class aptent taciti} +\section{CLASS APTENT TACITI} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quam turpis, ullamcorper quis laoreet ac, malesuada sed mi. Quisque orci nunc, placerat quis mauris vel, luctus dictum tellus. Ut aliquam dui nunc, quis commodo justo mattis aliquam. Nam congue libero nec dui auctor pharetra. Sed sit amet justo sodales, elementum massa quis, luctus ipsum. Ut et libero mattis, rhoncus nisi vitae, facilisis sapien. Aliquam erat volutpat. Mauris eget libero egestas, ullamcorper leo quis, convallis libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a odio porttitor, lacinia libero vel, egestas sem. Donec accumsan tellus nec enim porttitor, id rhoncus neque dignissim. Vestibulum sollicitudin turpis sed ligula tincidunt iaculis. Vestibulum condimentum libero erat, laoreet placerat elit ullamcorper a. Nam consectetur euismod risus. Duis quis ultricies velit, ut volutpat augue. Nam ligula sapien, interdum id leo vitae, porta volutpat velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus sit amet libero varius, consequat ipsum ac, placerat velit. -\section{Nunc molestie nunc} +\section{NUNC MOLESTIE NUNC} Nunc molestie nunc ac lorem dictum, sit amet placerat tellus congue. In sit amet dolor sed leo lobortis malesuada. Curabitur sit amet tristique urna. Vestibulum sollicitudin pellentesque aliquam. Sed pellentesque enim in lacus sodales laoreet. Suspendisse massa magna, fermentum at massa vitae, fermentum posuere dui. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque porttitor mauris adipiscing dolor semper condimentum. Donec in nibh sapien. Cras vestibulum venenatis nisl ultrices feugiat. Donec a neque eu odio vehicula rutrum quis eu nisl. Curabitur mauris diam, sollicitudin egestas condimentum a, faucibus non felis. Duis scelerisque augue sed turpis lobortis accumsan. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Duis ut dolor erat. Fusce adipiscing interdum eros, in ultrices orci auctor at. Mauris ac ante orci. In nec mauris \index{FEI}FEI arcu. In pulvinar tortor a felis interdum pretium. Donec tristique laoreet sollicitudin. Proin erat metus, blandit sed cursus eget, faucibus id nunc. Donec id nisi non mauris tempor tincidunt. Fusce venenatis pulvinar enim. Fusce sit amet tortor nec magna feugiat pharetra ac nec nibh. Praesent non nisi lacus. Class aptent taciti sociosqu ad litora torquent per conubi. -\chapter{VESTIBULUM RUTRUM} +\chapter{Vestibulum rutrum} Vestibulum rutrum varius velit, id iaculis ante vestibulum quis. Aenean bibendum sit amet quam ornare mollis. Suspendisse sollicitudin fringilla felis in venenatis. @@ -145,7 +145,8 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quam turpis, ull Sed a odio porttitor, lacinia libero vel, egestas sem. Donec accumsan tellus nec enim porttitor, id rhoncus neque dignissim. Vestibulum sollicitudin turpis sed ligula tincidunt iaculis. Vestibulum condimentum libero erat, laoreet placerat elit ullamcorper a. Nam consectetur euismod risus. Duis quis ultricies velit, ut volutpat augue. Nam ligula sapien, interdum id leo vitae, porta volutpat velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus sit amet libero varius, consequat ipsum ac, placerat velit. \begin{table}[ht!] - \caption{Donec accumsan tellus nec enim porttitor} \label{tbl:exemplo} + \caption{Donec accumsan tellus nec enim porttitor}% + \label{tbl:exemplo} \centering \begin{tabular}{|c|c|c|c|} \hline @@ -161,7 +162,7 @@ Sed a odio porttitor, lacinia libero vel, egestas sem. Donec accumsan tellus nec \caption*{Fonte: Autor} \end{table} -\section{Class aptent taciti} +\section{CLASS APTENT TACITI} Class aptent taciti sociosqu ad litora torquent per conubia nostra, per \index{latex@\LaTeX} inceptos himenaeos. Duis ut dolor erat. Fusce adipiscing interdum eros, in ultrices orci auctor at. Mauris ac ante orci. In nec mauris arcu. In pulvinar tortor a felis interdum pretium. Donec tristique laoreet sollicitudin. Proin erat metus, blandit sed cursus eget, faucibus id nunc. Donec id nisi non mauris tempor tincidunt. Fusce venenatis pulvinar enim. Fusce sit amet tortor nec magna feugiat pharetra ac nec nibh. Praesent non nisi lacus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum rutrum varius velit, id iaculis ante vestibulum quis. Aenean bibendum sit amet quam ornare mollis. Suspendisse sollicitudin fringilla felis in venenatis. diff --git a/macros/latex/contrib/fei/fei.dtx b/macros/latex/contrib/fei/fei.dtx index 0b68433927..2009205b77 100644 --- a/macros/latex/contrib/fei/fei.dtx +++ b/macros/latex/contrib/fei/fei.dtx @@ -2,35 +2,34 @@ % !TEX program = pdfLaTeX %<*internal> \iffalse - %</internal> - %<*readme> - ----------------------------------------------------------------------------------------------------- - fei --- Class for the creation of academic works under the typographic rules of FEI University Center - Author: Douglas De Rizzo Meneghetti - E-mail: douglasrizzo@fei.edu.br - - Released under the LaTeX Project Public License v1.3c or later - See http://www.latex-project.org/lppl.txt - ----------------------------------------------------------------------------------------------------- +%</internal> +%<*readme> +----------------------------------------------------------------------------------------------------- +fei --- Class for the creation of academic works under the typographic rules of FEI University Center +Author: Douglas De Rizzo Meneghetti +E-mail: douglasrizzo@fei.edu.br - fei is a class created by graduate students and LaTeX enthusiasts that allow students from FEI University Center to create their academic works, be it a monograph, masters dissertation or phd thesis, under the typographic rules of the institution. The class makes it possible to create a full academic work, supporting functionalities such as cover, title page, catalog entry, dedication, summary, lists of figures, tables, algorithms, acronyms and symbols, multiple authors, index, references, appendices and attachments. +Released under the LaTeX Project Public License v1.3c or later +See http://www.latex-project.org/lppl.txt +----------------------------------------------------------------------------------------------------- - fei is loosely based in the Brazilian National Standards Organization (Associação Brasileira de Normas Técnicas, ABNT) standards for the creation of academic works, such as ABNT NBR 10520:2002 (Citations) and ABNT NBR 6023:2002 (Bibligraphic References). +fei is a class created by graduate students and LaTeX enthusiasts that allow students from FEI University Center to create their academic works, be it a monograph, masters dissertation or phd thesis, under the typographic rules of the institution. The class makes it possible to create a full academic work, supporting functionalities such as cover, title page, catalog entry, dedication, summary, lists of figures, tables, algorithms, acronyms and symbols, multiple authors, index, references, appendices and attachments. - In the manual, users will find detailed information regarding the class commands, environments and best practices to create an academic text of good quality. We also made available a few template files which students may use as a starting point for their texts. +fei is loosely based in the Brazilian National Standards Organization (Associação Brasileira de Normas Técnicas, ABNT) standards for the creation of academic works, such as NBR 14724:2011, NBR 6028:2003, NBR 10522:1988, NBR 6024:2012, NBR 6023:2002 and NBR 6034:2004. +In the manual, users will find detailed information regarding the class commands, environments and best practices to create an academic text of good quality. We also made available a few template files which students may use as a starting point for their texts. - # License - Released under the LaTeX Project Public License v1.3c or later - See http://www.latex-project.org/lppl.txt +# License +Released under the LaTeX Project Public License v1.3c or later +See http://www.latex-project.org/lppl.txt - # Latest releases and version control - CTAN is always the place to go to get the stable version of the class. To know the changes done to the class and get previous and developments versions, visit https://ww.github.com/douglasrizzo/Classe-Latex-FEI/. - %</readme> - %<*internal> +# Latest releases and version control +CTAN is always the place to go to get the stable version of the class. To know the changes done to the class and get previous and developments versions, visit https://ww.github.com/douglasrizzo/Classe-Latex-FEI/. +%</readme> +%<*internal> \fi \def\nameofplainTeX{plain} \ifx\fmtname\nameofplainTeX\else - \expandafter\begingroup + \expandafter\begingroup \fi %</internal> %<*install> @@ -68,40 +67,40 @@ fei.cls. \endpostamble \usedir{tex/latex/fei} \generate{ - \file{\jobname.cls}{\from{\jobname.dtx}{class}} + \file{\jobname.cls}{\from{\jobname.dtx}{class}} } %</install> %<install>\endbatchfile %<*internal> \usedir{source/latex/fei} \generate{ - \file{\jobname.ins}{\from{\jobname.dtx}{install}} + \file{\jobname.ins}{\from{\jobname.dtx}{install}} } \nopreamble\nopostamble \usedir{doc/latex/fei} \generate{ - \file{README.txt}{\from{\jobname.dtx}{readme}} + \file{README.txt}{\from{\jobname.dtx}{readme}} } \ifx\fmtname\nameofplainTeX - \expandafter\endbatchfile + \expandafter\endbatchfile \else - \expandafter\endgroup + \expandafter\endgroup \fi %</internal> % \fi % \iffalse %<*driver> \begin{filecontents*}{\jobname.xmpdata} -\Title {Classe LaTeX FEI} -\Author {Douglas De Rizzo Meneghetti} -\Copyright {Copyright \copyright\ 2020 "Douglas De Rizzo Meneghetti"} -\Keywords {manual\sep latex\sep tipografia} -\Publisher {Baking International} -\Language {pt-BR} -\Subject {This is where you put the abstract.} + \Title {Classe LaTeX FEI} + \Author {Douglas De Rizzo Meneghetti} + \Copyright {Copyright \copyright\ 2020 "Douglas De Rizzo Meneghetti"} + \Keywords {manual\sep latex\sep tipografia} + \Publisher {Baking International} + \Language {pt-BR} + \Subject {This is where you put the abstract.} \end{filecontents*} -\documentclass[oneside,symbols,acronym]{\jobname} +\documentclass[oneside,symbols,acronym,font=times]{\jobname} \usepackage{multicol} \usepackage{listings} \lstset{ @@ -109,7 +108,7 @@ basicstyle=\ttfamily, columns=flexible, breaklines=true, literate= - {ã}{{\~a}}1 {ẽ}{{\~e}}1 {ĩ}{{\~i}}1 {õ}{{\~o}}1 {ũ}{{\~u}}1 + {ã}{{\~a}}1 {ẽ}{{\~e}}1 {ĩ}{{\~i}}1 {õ}{{\~o}}1 {ũ}{{\~u}}1 {Ã}{{\~A}}1 {Ẽ}{{\~E}}1 {Ĩ}{{\~I}}1 {Õ}{{\~O}}1 {Ũ}{{\~U}}1 {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 @@ -165,30 +164,30 @@ literate= \maketitle \begin{folhaderosto} - Manual da classe \LaTeX{} da FEI apresentado como pré-requisito para que seus usuários saibam como utilizá-la. + Manual da classe \LaTeX{} da FEI apresentado como pré-requisito para que seus usuários saibam como utilizá-la. \end{folhaderosto} \fichacatalografica \folhadeaprovacao \dedicatoria{Esta dedicatória está aqui para que a função de dedicatória seja testada.} \begin{agradecimentos} - Agradecemos a Donald Knuth pela criação do \TeX{}, a Leslie Lamport pelo \LaTeX{} e a toda a comunidade de desenvolvedores que continua dando suporte e criando pacotes para melhorar a qualidade dos documentos escritos. Agradecimentos especiais são estendidos aos membros da \TeX{} \emph{Stack Exchange} pela divisão do fardo de criar documentos com belas tipografias. Agradece-se também os mantenedores da \gls{ctan}, por hospedar a classe e garantir sua distribuição em todas as maiores distribuições de \LaTeX{} nos principais sistemas operacionais, além de enviar-me e-mails toda vez que subo uma versão errada da classe. + Agradecemos a Donald Knuth pela criação do \TeX{}, a Leslie Lamport pelo \LaTeX{} e a toda a comunidade de desenvolvedores que continua dando suporte e criando pacotes para melhorar a qualidade dos documentos escritos. Agradecimentos especiais são estendidos aos membros da \TeX{} \emph{Stack Exchange} pela divisão do fardo de criar documentos com belas tipografias. Agradece-se também os mantenedores da \gls{ctan}, por hospedar a classe e garantir sua distribuição em todas as maiores distribuições de \LaTeX{} nos principais sistemas operacionais, além de enviar-me e-mails toda vez que subo uma versão errada da classe. \end{agradecimentos} \begin{epigrafe} - \epig{Beware of bugs in the above code; I have only proved it correct, not tried it.}{Donald E. Knuth \nocite{knuth77}} - \epig{Something is rotten in the state of Denmark.}{William Shakespeare \nocite{shakespeare1885tragedy}} + \epig{Beware of bugs in the above code; I have only proved it correct, not tried it.}{Donald E. Knuth \nocite{knuth77}} + \epig{Something is rotten in the state of Denmark.}{William Shakespeare \nocite{shakespeare1885tragedy}} \end{epigrafe} % \epigrafe{A good scientist is a person with original ideas. A good engineer is a person who makes a design that works with as few original ideas as possible. There are no prima donnas in engineering.}{Freeman Dyson \nocite{dyson_disturbing_1979}} \begin{resumo} - O \TeX{} é um sistema de formatação de textos baseado em uma \emph{mark-up language}, criado em 1978 por Donald Knuth e ampliado com uma série de macros por Leslie Lamport, dando à luz o \LaTeX{}. Utilizado com frequência na área acadêmica, foram criadas classes em \LaTeX{} para satisfazer às regras de formatação dos mais variados órgãos, sociedades, institutos e universidades. Baseada nos padrões da ABNT, a biblioteca da FEI criou seu próprio guia para formatação de trabalhos acadêmicos, o qual originou, extra-oficialmente, a classe \LaTeX{} da FEI. Neste guia, os usuários serão guiados no uso dessa classe, desde a criação de elementos pré-textuais (capa, folha de rosto, ficha catalográfica, epígrafe, dedicatória, sumário, listas de figuras, tabelas, algoritmos, siglas e símbolos), passando pelo corpo do texto e elementos pós-textuais (índice remissivo, referências bibliográficas, apêndices e anexos) e terminando com uma explicação referente à instalação dos pré-requisitos e compilação de um trabalho dissertativo com todos os recursos que a classe pode oferecer. - \keywords{\LaTeX{}. FEI.} + O \TeX{} é um sistema de formatação de textos baseado em uma \emph{mark-up language}, criado em 1978 por Donald Knuth e ampliado com uma série de macros por Leslie Lamport, dando à luz o \LaTeX{}. Utilizado com frequência na área acadêmica, foram criadas classes em \LaTeX{} para satisfazer às regras de formatação dos mais variados órgãos, sociedades, institutos e universidades. Baseada nos padrões da ABNT, a biblioteca da FEI criou seu próprio guia para formatação de trabalhos acadêmicos, o qual originou, extra-oficialmente, a classe \LaTeX{} da FEI. Neste guia, os usuários serão guiados no uso dessa classe, desde a criação de elementos pré-textuais (capa, folha de rosto, ficha catalográfica, epígrafe, dedicatória, sumário, listas de figuras, tabelas, algoritmos, siglas e símbolos), passando pelo corpo do texto e elementos pós-textuais (índice remissivo, referências bibliográficas, apêndices e anexos) e terminando com uma explicação referente à instalação dos pré-requisitos e compilação de um trabalho dissertativo com todos os recursos que a classe pode oferecer. + \keywords{\LaTeX{}. FEI.} \end{resumo} \begin{abstract} - Abstract goes here. - \keywords{Keywords. Go. Here.} + Abstract goes here. + \keywords{Keywords. Go. Here.} \end{abstract} \listoffigures @@ -198,17 +197,16 @@ literate= \printglossaries \tableofcontents -\chapter{INTRODUÇÃO} - -\glsaddall +\chapter{Introdução} +\glsaddall% Inspirado nas diversas normas da \index{ABNT}\gls{abnt} para produção de trabalhos acadêmicos, a biblioteca do Centro Universitário \index{FEI}\gls{fei} criou um guia que dita as regras que os alunos devem seguir na formatação de suas monografias, dissertações e teses. Através deste guia (e algumas dúzias de trabalhos corrigidos pelas bibliotecárias), nasceu a classe \LaTeX{} da \gls{fei}, especializada na criação de trabalhos acadêmicos sob as normas da biblioteca da \gls{fei}. Com ela, os alunos podem utilizar seus conhecimentos em \LaTeX{} para criar seus documentos, deixando a maior parte da formatação complexa do documento a cargo da classe. A escrita da classe que formata o texto foi realizada tendo-se como referência principal o guia disponível pela biblioteca. Trabalhos corrigidos e reuniões subsequentes com as bibliotecárias também serviram de referencial para refinar algumas funcionalidades da classe, assim como realizar adições não cobertas pelo guia, como algoritmos e teoremas. Para facilitar a escrita do texto final, alguns comandos/ambientes já existentes foram modificados e novos comandos e ambientes foram adicionados. Desta forma, espera-se que o autor tenha menos trabalho com a formatação do texto do que com a escrita do mesmo. -O texto é organizado da seguinte forma: a seção \ref{chap:instalacao} lista os passos para instalação do \LaTeX{}, da classe e de suas dependências nos principais sistemas operacionais; a seção \ref{chap:comandos} enumera os comandos e ambientes, tanto novos quanto redefinidos do \LaTeX{}, necessários para a criação do corpo do trabalho acadêmico; a seção \ref{chap:referencia} explica o uso do abn\TeX{} e exemplifica o uso de seus diversos comandos de citação; o capítulo \ref{chap:indice} disserta sobre os programas necessários para a criação do índice remissivo e os comandos utilizados para se indexar termos no decorrer do texto; a seção \ref{chap:listas} explica ao autor como criar listas de abreviaturas e símbolos; a seção \ref{chap:compilando} ensina a compilar um projeto utilizando a classe \LaTeX{} da FEI com todas as suas funcionalidades. O apêndice A explica cada um dos arquivos criados pelo processo de compilação, com o propósito de instruir e exemplificar o uso de um apêndice. Já o apêndice B disponibiliza uma lista dos principais símbolos matemáticos disponíveis no \TeX{}. +O texto é organizado da seguinte forma: a seção \ref{chap:instalacao} lista os passos para instalação do \LaTeX{}, da classe e de suas dependências nos principais sistemas operacionais; a seção \ref{chap:comandos} enumera os comandos e ambientes, tanto novos quanto redefinidos do \LaTeX{}, necessários para a criação do corpo do trabalho acadêmico; a seção \ref{chap:referencia} explica o uso do abn\TeX{} e exemplifica o uso de seus diversos comandos de citação; a seção \ref{chap:indice} disserta sobre os programas necessários para a criação do índice remissivo e os comandos utilizados para se indexar termos no decorrer do texto; a seção \ref{chap:listas} explica ao autor como criar listas de abreviaturas e símbolos; a seção \ref{chap:compilando} ensina a compilar um projeto utilizando a classe \LaTeX{} da FEI com todas as suas funcionalidades. O apêndice~\ref{app:hacks} descreve alguns \emph{hacks} úteis para usuários da classe que precisam realizar as customizações mais corriqueiras na formatação de seus trabalhos Já o apêndice~\ref{app:arquivos} explica cada um dos arquivos criados pelo processo de compilação, com o propósito de instruir e exemplificar o uso de um apêndice. Por último, o apêndice~\ref{app:simbolos} disponibiliza uma lista dos principais símbolos matemáticos disponíveis no \TeX{}. \section{NOTA AOS USUÁRIOS ANTIGOS DA CLASSE} @@ -218,7 +216,8 @@ Isso significa que usuários de versões antigas da classe não mais usarão o c Adicionalmente, os \emph{templates} que acompanham a classe foram devidamente atualizados para exemplificar as mudanças. -\section{INSTALAÇÃO} \label{chap:instalacao} +\section{INSTALAÇÃO}% +\label{chap:instalacao} Esta seção guia o leitor na instalação do \LaTeX{}, da classe e dos diferentes pacotes e programas necessários para utilizar todas as funcionalidades dela. @@ -250,61 +249,70 @@ O processo de compilação requer que todas as dependências da classe já estej \section{FONTE ARIAL} -Por ser uma fonte True Type de autoria da Microsoft, as fontes da família Arial não são disponibilizadas nativamente por distribuições \LaTeX{} como o Mik\TeX{} e o \TeX{} \emph{Live}. Para utilizá-las, é necessário instalá-las separadamente. As instruções para instalação das fontes estão disponíveis no site do \TeX \emph{Users Group}\footnote{http://tug.org/fonts/getnonfreefonts/}. +Por ser uma fonte True Type de autoria da Microsoft, as fontes da família Arial não são disponibilizadas nativamente por distribuições do \LaTeX{} como o Mik\TeX{} e o \TeX{} \emph{Live}. Para utilizá-las, é necessário instalá-las separadamente. As instruções para instalação das fontes estão disponíveis no site do \TeX \emph{Users Group}\footnote{http://tug.org/fonts/getnonfreefonts/}. \begin{itemize} - \item Fazer download do script\footnote{http://tug.org/fonts/getnonfreefonts/install-getnonfreefonts}; - \item Instalar o script usando o aplicativo \texttt{texlua}: \lstinline+texlua install-getnonfreefonts+; - \item Rodar o script: \lstinline+getnonfreefonts --all+. + \item Fazer download do script\footnote{http://tug.org/fonts/getnonfreefonts/install-getnonfreefonts}; + \item Instalar o script usando o aplicativo \texttt{texlua}: \lstinline+texlua install-getnonfreefonts+; + \item Rodar o script: \lstinline+getnonfreefonts --all+. \end{itemize} -Após isso, é necessário utilizar a opção \texttt{arial} na declaração da classe, no início do arquivo \texttt{tex}: \lstinline+\documentclass[arial]{fei}+. - -\section{DEPENDÊNCIAS}\label{sec:dependencias} - -A partir da versão 3, aclasse da FEI foi criada tendo a classe \texttt{memoir} como base, o que permitiu com que a classe da FEI fosse personalizada, em sua maioria, através do uso de comandos nativos do \LaTeX{}, reduzindo o número de pacotes do qual ela depende. - -No entanto, ainda é necessário enfatizar a necessidade de instalação de alguns pacotes, listados e descritos mais abaixo, dos quais a classe \LaTeX{} da FEI depende para seu funcionamento correto. Estes pacotes estão disponíveis nas distribuições do Mik\TeX{} (para Windows), Mac\TeX{} (para Mac OS) e \TeX{} \emph{Live} (para Linux e Mac OS). - -\begin{enumerate} - \item\texttt{algorithm2e}: provê comandos para a escrita de algoritmos; - \item\texttt{amsthm}: possibilita criação de teoremas (e derivados); - \item\texttt{babel}: escolha de línguas (importado pacote para português e inglês); - \item\texttt{biblatex}: pacote avançado para o tratamento de referências bibliográficas; - \item\texttt{biblatex-abnt}: formata citações e referências de acordo com o padrão \index{ABNT}\gls{abnt} 6023; - \item\texttt{caption}: altera a formatação de certas legendas; - \item\texttt{chngcntr}: redefine a numeração dos \emph{floats} -- tabelas, figuras, algoritmos e equações; - \item\texttt{csquotes}: proporciona suporte a aspas para diferentes idiomas; - \item\texttt{enumitem}: formatação de alíneas; - \item\texttt{fontenc}: codificação 8 bits para as fontes de saída do PDF (normalmente, elas têm 7 bits); - \item\texttt{glossaries}\index{glossaries@\emph{glossaries}}: permite a criação de listas de símbolos e abreviaturas; - \item\texttt{graphicx}: importação e utilização de imagens; - \item\texttt{hyperref}: gera os links entre referências no PDF; - \item\texttt{icomma}: define a vírgula como separador de decimais no ambiente matemático (padrão português brasileiro); - \item\texttt{ifthen}: permite a utilização de condições na geração do texto; - \item\texttt{imakeidx}: permite a criação de um índice remissivo ao fim do texto; - \item\texttt{inputenc}: permite a entrada de caracteres em formato UTF-8 nos arquivos \texttt{tex}; - \item\texttt{lmodern}: carrega a família de fontes \emph{Latin Modern}, que possui maior abrangência de caracteres; - \item\texttt{mathtools}: extensões para facilitar a escrita de fórmulas matemáticas (inclui o pacote \texttt{amsmath}); - \item\texttt{morewrites}: permite ao LaTeX escrever em mais de 16 arquivos auxiliares simultaneamente; - \item\texttt{pdfpages}: faz a inclusão de páginas em PDF no documento final; - \item\texttt{pdfx}: gera um PDF sob o padrão PDF/A (mais informações na seção \ref{subsec:pdfa}); - \item\texttt{thmtools}: conjunto de macros para o pacote \texttt{amsthm}; - \item\texttt{times}: carrega fonte Times New Roman; - \item\texttt{uarial}: carrega fonte URW Arial. -\end{enumerate} +Após isso, é possível utilizar a opção \texttt{font=arial} na declaração da classe, no início do arquivo \texttt{tex}: \lstinline+\documentclass[font=arial]{fei}+. + +Alternativamente, é possível usar a fonte Arimo, uma versão aberta da fonte Arial disponibilizada nas principais distribuições de \LaTeX{}. Para isso, basta ter o pacote \texttt{arimo} instalado e utilizar a opção \texttt{font=arimo} na declaração da classe. + +\section{DEPENDÊNCIAS}% +\label{sec:dependencias} + +A partir da versão 3, a classe da FEI foi criada tendo a classe \texttt{memoir} como base, o que permitiu com que a classe da FEI fosse personalizada, em sua maioria, através do uso de comandos nativos do \LaTeX{}, reduzindo o número de pacotes do qual ela depende. + +No entanto, ainda é necessário enfatizar a necessidade de instalação de alguns pacotes, listados mais abaixo, dos quais a classe \LaTeX{} da FEI depende para seu funcionamento correto. Estes pacotes estão disponíveis nas distribuições do Mik\TeX{} (para Windows), Mac\TeX{} (para Mac OS) e \TeX{} \emph{Live} (para Linux e Mac OS):\footnote{Como uma ironia do destino, o guia da biblioteca permite alíneas alfabéticas e a lista de pacotes possui mais de 26 itens, o que impede que ela seja representada como uma alínea.} +\texttt{algorithm2e}, +\texttt{amsthm}, +\texttt{arimo}, +\texttt{babel}, +\texttt{biblatex}, +\texttt{biblatex-abnt}, +\texttt{caption}, +\texttt{chngcntr}, +\texttt{csquotes}, +\texttt{enumitem}, +\texttt{fontenc}, +\texttt{glossaries}, +\texttt{glossaries-extra}, +\texttt{graphicx}, +\texttt{hyperref}, +\texttt{icomma}, +\texttt{ifthen}, +\texttt{imakeidx}, +\texttt{inputenc}, +\texttt{kvoptions}, +\texttt{lmodern}, +\texttt{mathtools}, +\texttt{mfirstuc}, +\texttt{microtype}, +\texttt{morewrites}, +\texttt{newtx}, +\texttt{pdfpages}, +\texttt{pdfx}, +\texttt{thmtools}, +\texttt{urwchancal} e +\texttt{xfor}. Os scripts de alguns programas \TeX{}, como o \texttt{makeglossaries}, são dependentes da linguagem \index{Perl}Perl, a qual vem instalada por padrão em alguns sistemas operacionais. Para os usuários de Windows, no entanto, o Perl deve ser instalado separadamente e pode ser encontrado em \url{https://www.perl.org/}. -\chapter{COMANDOS E AMBIENTES}\label{chap:comandos} +\chapter{Comandos e ambientes}% +\label{chap:comandos} Este capítulo descreve os comandos disponibilizados pela classe. Ele é separado em quatro seções: a seção \ref{sec:preambulo} disserta sobre os comandos a serem utilizados antes do início do texto; a seção \ref{sec:pretexto} auxilia na declaração dos elementos pré-textuais do documento; a seção \ref{sec:texto} descreve a estrutura do texto e outros elementos a serem utilizados durante a produção deste, como \emph{floats}; a seção \ref{sec:postexto} disserta sobre os elementos pós-textuais, a saber, referências, apêndices, anexos e índice remissivo. -\section{PREÂMBULO}\label{sec:preambulo} +\section{PREÂMBULO}% +\label{sec:preambulo} No preâmbulo do texto são declaradas as propriedades globais do documento, como a classe que rege a formatação geral do texto e novos comandos a serem utilizados no decorrer do texto. O preâmbulo da classe \LaTeX{} da FEI contém os seguintes elementos que devem ser declarados no preâmbulo: -\subsection{Metadados PDF/A} \label{subsec:pdfa} +\subsection{Metadados PDF/A}% +\label{subsec:pdfa} A partir de 2017, os trabalhos depositados na biblioteca da instituição devem aderir ao padrão PDF/A, um formato específico para o arquivamento de documentos PDF e disponibilização dos metadados do documento para buscas. Para realizar o depósito do trabalho na biblioteca, é necessário que o trabalho esteja no padrão PDF/A. @@ -325,7 +333,8 @@ Uma lista com mais opções de metadados está disponível em \url{https://www.m Antes de depositar a versão final do trabalho, recomenda-se checar se o arquivo PDF adere ao formato PDF/A. O software padrão, que também é gratuito e multiplafatorma, para realizar a checagem é o \emph{veraPDF}\footnote{\url{https://verapdf.org/software/}}. Também é possível usar o Adobe Acrobat Pro. -\subsection{Declaração da classe} \label{subsec:documentclass} +\subsection{Declaração da classe}% +\label{subsec:documentclass} A declaração da classe é feita da seguinte forma: @@ -336,17 +345,18 @@ A declaração da classe é feita da seguinte forma: A classe da FEI pode receber as seguintes opções: \begin{enumerate} - \item \texttt{draft}: Essa opção simplifica o processo de compilação do PDF para que ele seja realizado mais rapidamente. A opção beneficia especialmente a compilação de trabalhos com um número elevado de imagens ou que incluam imagens cujos arquivos sejam grandes, uma vez que as imagens não são adicionadas ao PDF. \emph{Hyperlinks} internos (\emph{e.g. links} para seções, citações, símbolos, abreviaturas, figuras, tabelas) também não são inseridos\footnote{Para uma lista mais completa das mudanças advindas do uso da opção \texttt{draft}, cheque o seguinte tópico no StackExchange: \url{https://tex.stackexchange.com/q/49277/30998}.}; - \item \texttt{nopdfa}: desabilita a geração do documento no formato PDF/A. Essa função é disponibilizada para fins de compatibilidade, para que trabalhos antigos que possivelmente sejam corrompidos durante o processo de compilação devido ao padrão PDF/A ainda possam ser compilados; - \item \texttt{deposito}: Procura por arquivos PDF referentes à ficha catalográfica e folha de aprovação no diretório do documento e os insere nos locais em que \lstinline+\fichacatalografica+ e \lstinline+\folhadeaprovacao+ são chamados. Caso contrário, insere páginas indicativas, para fins de contagem de número de páginas; - \item \texttt{sublist}: configura o pacote \texttt{glossaries} para que sub-listas de símbolos sejam usadas. Mais sobre sub-listas na seção \ref{sec:sublist}; - \item \texttt{numeric}: troca as citações e referências autor-data para numéricas; - \item \texttt{algo-as-figure}: configura o pacote \texttt{algorithm2e} para que algoritmos sejam listados na lista de ilustrações. Essa configuração é preferível, uma vez que a formatação das legendas e da lista de algoritmos, no presente, não condiz com as recomendações do guia da biblioteca; - \item \texttt{twoside}: a atualização de 2015 do guia da biblioteca recomenda que trabalhos acadêmicos com mais de 100 páginas sejam impressos em formato \index{frente-e-verso}frente-e-verso. Por ser derivada da classe \texttt{memoir}, a classe da FEI pode receber algumas opções nativas de \texttt{memoir}. Um exemplo de opção que pode ser útil é \texttt{twoside}, a qual alterna o tamanho das margens direita e esquerda das páginas, assim como a posição da numeração, permitindo realizar uma impressão frente-e-verso de melhor qualidade. Alterações adicionais foram realizadas para que todos os elementos pré-textuais sejam corretamente iniciados nas páginas ímpares, como recomenda o guia e a norma. É importante reparar, contudo, que a utilização de \texttt{twoside} acarreta no aumento do número de páginas, uma vez que os versos de algumas páginas no pré-texto podem ser deixados em branco em prol da norma. - \item \texttt{acronym}: passado para o pacote \texttt{glossaries-extra}, sinaliza o uso de abreviaturas no trabalho; - \item \texttt{symbols}: passado para o pacote \texttt{glossaries-extra}, sinaliza o uso de símbolos no trabalho; - \item \texttt{backrefs}: passa a opção \texttt{backref} ao pacote \texttt{biblatex}, para que ele imprima as páginas nas quais cada trabalho foi citado nas referências bibliográficas. Repare que esta não é uma características prevista no guia de formatação de referências da biblioteca, então use-o somente sob sua conta e risco; - \item \texttt{record}: passado para o pacote \texttt{glossaries-extra}, sinaliza o uso de um arquivo \texttt{.bib} para definição de símbolos e abreviaturas, a ser compilado pelo programa \index{bib2gls@\texttt{bib2gls}}\texttt{bib2gls}. + \item \texttt{draft}: Essa opção simplifica o processo de compilação do PDF para que ele seja realizado mais rapidamente. A opção beneficia especialmente a compilação de trabalhos com um número elevado de imagens ou que incluam imagens cujos arquivos sejam grandes, uma vez que as imagens não são adicionadas ao PDF. \emph{Hyperlinks} internos (\emph{e.g. links} para seções, citações, símbolos, abreviaturas, figuras, tabelas) também não são inseridos\footnote{Para uma lista mais completa das mudanças advindas do uso da opção \texttt{draft}, cheque o seguinte tópico no StackExchange: \url{https://tex.stackexchange.com/q/49277/30998}.}; + \item \texttt{nopdfa}: desabilita a geração do documento no formato PDF/A. Essa função é disponibilizada para fins de compatibilidade, para que trabalhos antigos que possivelmente sejam corrompidos durante o processo de compilação devido ao padrão PDF/A ainda possam ser compilados; + \item \texttt{deposito}: Procura por arquivos PDF referentes à ficha catalográfica e folha de aprovação no diretório do documento e os insere nos locais em que \lstinline+\fichacatalografica+ e \lstinline+\folhadeaprovacao+ são chamados. Caso contrário, insere páginas indicativas, para fins de contagem de número de páginas; + \item \texttt{sublist}: configura o pacote \texttt{glossaries} para que sub-listas de símbolos sejam usadas. Mais sobre sub-listas na seção \ref{sec:sublist}; + \item \texttt{numeric}: troca as citações e referências autor-data para numéricas; + \item \texttt{algo-as-figure}: configura o pacote \texttt{algorithm2e} para que algoritmos sejam listados na lista de ilustrações. Essa configuração é preferível, uma vez que a formatação das legendas e da lista de algoritmos, no presente, não condiz com as recomendações do guia da biblioteca; + \item \texttt{twoside}: a atualização de 2015 do guia da biblioteca recomenda que trabalhos acadêmicos com mais de 100 páginas sejam impressos em formato \index{frente-e-verso}frente-e-verso. Por ser derivada da classe \texttt{memoir}, a classe da FEI pode receber algumas opções nativas de \texttt{memoir}. Um exemplo de opção que pode ser útil é \texttt{twoside}, a qual alterna o tamanho das margens direita e esquerda das páginas, assim como a posição da numeração, permitindo realizar uma impressão frente-e-verso de melhor qualidade. Alterações adicionais foram realizadas para que todos os elementos pré-textuais sejam corretamente iniciados nas páginas ímpares, como recomenda o guia e a norma. É importante reparar, contudo, que a utilização de \texttt{twoside} acarreta no aumento do número de páginas, uma vez que os versos de algumas páginas no pré-texto podem ser deixados em branco em prol da norma. + \item \texttt{acronym}: passado para o pacote \texttt{glossaries-extra}, sinaliza o uso de abreviaturas no trabalho; + \item \texttt{symbols}: passado para o pacote \texttt{glossaries-extra}, sinaliza o uso de símbolos no trabalho; + \item \texttt{backrefs}: passa a opção \texttt{backref} ao pacote \texttt{biblatex}, para que ele imprima as páginas nas quais cada trabalho foi citado nas referências bibliográficas. Repare que esta não é uma funcionalidade prevista no guia de formatação de referências da biblioteca, então use-o somente sob sua conta e risco; + \item \texttt{record}: passado para o pacote \texttt{glossaries-extra}, sinaliza o uso de um arquivo \texttt{.bib} para definição de símbolos e abreviaturas, a ser compilado pelo programa \index{bib2gls@\texttt{bib2gls}}\texttt{bib2gls}; + \item \texttt{abbr-shortcuts}: ativa a opção \texttt{shortcuts=abbr} para o pacote \texttt{glossaries-extra}, permitindo referenciar abreviaturas por comandos menores, como \verb+\ab+, \verb+\as+, \verb+\al+, \verb+\af+, \verb+\abp+, \verb+\asp+, \verb+\alp+ e \verb+\afp+. Ver seção 4.3 do manual do \texttt{glossaries-extra}. \end{enumerate} \subsection{Nome do autor, e título} @@ -364,13 +374,15 @@ Uma vez que as normas da biblioteca demandam formatações específicas para o t \subsection{Cidade e Instituição (opcionais)} Os comandos \lstinline+\cidade{}+ e \lstinline+\instituicao{}+ recebem os nomes da cidade e instituição de ensino para substituí-los na capa e folha de rosto. São comandos opcionais criados por questão de compatibilidade, ou caso outras instituições queiram usar a classe. Seus valores-padrão são ``São Bernardo do Campo'' e ``Centro Universitário FEI'', respectivamente. -\subsection{Arquivos de referências bibliográficas}\label{subsec:referencias-pre} +\subsection{Arquivos de referências bibliográficas}% +\label{subsec:referencias-pre} Em \TeX{}, as referências bibliográficas são mantidas em um ou mais arquivos de extensão \texttt{bib}, preferencialmente no mesmo diretório do arquivo \texttt{tex} do trabalho. Os arquivos \texttt{bib} utilizados pelo trabalho devem ser referenciados no preâmbulo do texto utilizando o comando \lstinline+\addbibresource{ref.bib}+. Mais de um arquivo pode ser referenciado, utilizando-se o comando \lstinline+\addbibresource{}+ mais de uma vez. Para saber como imprimir a lista de referências bibliográficas na seção pós-textual so trabalho, confira a seção \ref{subsec:referencias-pos}. -\section{PRÉ-TEXTO}\label{sec:pretexto} +\section{PRÉ-TEXTO}% +\label{sec:pretexto} O pré-texto do documento engloba todos os elementos textuais que precedem o corpo da obra. A seguir são listados os elementos pré-textuais suportados pela classe \LaTeX{} da FEI e os respectivos comandos para a criação de cada um deles. @@ -443,33 +455,35 @@ Abstract goes here. A classe da FEI permite a impressão de listas de figuras, tabelas, algoritmos, teoremas, abreviaturas e símbolos usando os comandos nativos do \LaTeX{}, redefinidos para aderirem aos padrões da biblioteca. Também é possível inserir um sumário. A tabela \ref{tbl:substituicoes} enumera os comandos para inserção das listas e do sumário. \begin{table}[ht!] - \caption{Listas e os comandos para imprimi-las} \label{tbl:substituicoes} - \centering - \begin{tabular}{|c|c|} - \hline - \textbf{Elemento} & \textbf{Comando} \\ - \hline - Sumário & \lstinline+\tableofcontents+ \\ - \hline - Lista de Figuras & \lstinline+\listoffigures+ \\ - \hline - Lista de Tabelas & \lstinline+\listoftables+ \\ - \hline - Lista de Algoritmos & \lstinline+\listofalgorithms+ \\ - \hline - Lista de Teoremas & \lstinline+\listoftheorems+ \\ - \hline - Listas de Abreviaturas e Símbolos & \lstinline+\printglossaries+ \\ - \hline - \end{tabular} - \smallcaption{Fonte: Autor} + \caption{Listas e os comandos para imprimi-las}% + \label{tbl:substituicoes} + \centering + \begin{tabular}{|c|c|} + \hline + \textbf{Elemento} & \textbf{Comando} \\ + \hline + Sumário & \lstinline+\tableofcontents+ \\ + \hline + Lista de Figuras & \lstinline+\listoffigures+ \\ + \hline + Lista de Tabelas & \lstinline+\listoftables+ \\ + \hline + Lista de Algoritmos & \lstinline+\listofalgorithms+ \\ + \hline + Lista de Teoremas & \lstinline+\listoftheorems+ \\ + \hline + Listas de Abreviaturas e Símbolos & \lstinline+\printglossaries+ \\ + \hline + \end{tabular} + \smallcaption{Fonte: Autor} \end{table} -\section{TEXTO}\label{sec:texto} +\section{TEXTO}% +\label{sec:texto} Sob a nomenclatura do guia da biblioteca, o texto pode ser estruturado utilizando até 5 níveis de títulos de seção. Isso se traduz no uso dos 5 níveis disponibilizados nativamente pelo \LaTeX: capítulo, seção, subseção, subsubseção e parágrafo. Para isso, são usados os comandos nativos do \LaTeX{} para divisão do texto: \lstinline+\chapter{...}+, \lstinline+\section{...}+, \lstinline+\subsection{...}+, \lstinline+\subsubsection{...}+ e \lstinline+\paragraph{...}+. Estes comandos inserem os títulos de suas respectivas divisões de acordo com o guia e são usados posteriormente na criação automática do sumário. -Ao utilizar \lstinline+\chapter{...}+ e \lstinline+\section{...}+, é necessário inserir manualmente os títulos em letras maiúsculas para garantir que os mesmos aparecem em letras maiúsculas tanto no sumário como no texto, garantindo a aderência ao guia. +Apenas ao utilizar \lstinline+\section{...}+, é necessário inserir manualmente os títulos em letras maiúsculas para garantir que os mesmos aparecem em letras maiúsculas tanto no sumário como no texto, garantindo a aderência ao guia. \subsection{\emph{Floats}} @@ -480,10 +494,11 @@ Independente do tipo de float utilizado, a formatação das legendas é realizad A figura \ref{fig:exemplo} demonstra a inserção de uma figura usando o \LaTeX~, assim como a inserção das legendas superior e inferior utilizando a formatação nativa. \begin{figure} - \centering - \caption{Exemplo de figura com sua fonte} - \rule{2cm}{2cm} - \smallcaption{Fonte: \citefloat{lamport1994latex}}\label{fig:exemplo} + \centering + \caption{Exemplo de figura com sua fonte} + \rule{2cm}{2cm} + \smallcaption{Fonte: \citefloat{lamport1994latex}}% + \label{fig:exemplo} \end{figure} \begin{lstlisting} @@ -508,20 +523,21 @@ O código abaixo exemplifica a criação de uma tabela. Um exemplo de tabela cri \end{lstlisting} \begin{table}[ht!] - \caption{Exemplo de tabela com legenda acima e fonte abaixo} \label{tbl:exemplo} - \centering - \begin{tabular}{|c|c|c|c|} - \hline - & \(x_1\) & \(x_2\) & \(x_3\) \\ - \hline - \(y_1\) & 1 & 0 & 0 \\ - \hline - \(y_2\) & 0 & 1 & 0 \\ - \hline - \(y_3\) & 0 & 0 & 1 \\ - \hline - \end{tabular} - \smallcaption{Fonte: Autor} + \caption{Exemplo de tabela com legenda acima e fonte abaixo}% + \label{tbl:exemplo} + \centering + \begin{tabular}{|c|c|c|c|} + \hline + & \(x_1\) & \(x_2\) & \(x_3\) \\ + \hline + \(y_1\) & 1 & 0 & 0 \\ + \hline + \(y_2\) & 0 & 1 & 0 \\ + \hline + \(y_3\) & 0 & 0 & 1 \\ + \hline + \end{tabular} + \smallcaption{Fonte: Autor} \end{table} \subsubsection{Outras ilustrações} @@ -529,17 +545,17 @@ O código abaixo exemplifica a criação de uma tabela. Um exemplo de tabela cri Além de figuras, a lista de ilustrações prevê a inclusão de outros tipos de \emph{floats}, os quais são representados pelos seguintes ambientes: \begin{enumerate} - \item desenho; - \item esquema; - \item fotografia; - \item gráfico; - \item mapa; - \item diagrama; - \item fluxograma; - \item organograma; - \item planta; - \item quadro; - \item retrato. + \item desenho; + \item esquema; + \item fotografia; + \item gráfico; + \item mapa; + \item diagrama; + \item fluxograma; + \item organograma; + \item planta; + \item quadro; + \item retrato. \end{enumerate} A inserção de um desses \emph{floats} é feita de maneira igual à inserção de um \texttt{figure} ou \texttt{table}, porém chamando-se o nome do ambiente desejado. Por exemplo, para criar uma ilustração que será listada como um diagrama na lista de ilustrações, deve-se utilizar o ambiente \texttt{diagrama} ao invés de \texttt{figure}. Apesar de serem inseridos na mesma lista, cada \emph{float} é numerado separadamente, como prevê o guia da biblioteca. Exemplos destes \emph{floats} sendo utilizados podem ser vistos no gráfico \ref{gra:grafico1}, mapa \ref{map:mapa} e gráfico \ref{gra:grafico2}. @@ -547,21 +563,24 @@ A inserção de um desses \emph{floats} é feita de maneira igual à inserção O apêndice A ensina a criar novas categorias de \emph{floats} conforme necessário. \begin{grafico} - \caption{Isto é um gráfico, criado com o ambiente \texttt{grafico}} - \rule{4cm}{4cm} - \smallcaption{Fonte: Autor}\label{gra:grafico1} + \caption{Isto é um gráfico, criado com o ambiente \texttt{grafico}} + \rule{4cm}{4cm} + \smallcaption{Fonte: Autor}% + \label{gra:grafico1} \end{grafico} \begin{mapa} - \caption{Isto é um mapa, criado com o ambiente \texttt{mapa}} - \rule{8cm}{5cm} - \smallcaption{Fonte: Autor}\label{map:mapa} + \caption{Isto é um mapa, criado com o ambiente \texttt{mapa}} + \rule{8cm}{5cm} + \smallcaption{Fonte: Autor}% + \label{map:mapa} \end{mapa} \begin{grafico} - \caption{Isto é outro gráfico, que continua a numeração deste tipo de \emph{float}} - \rule{4cm}{4cm} - \smallcaption{Fonte: Autor}\label{gra:grafico2} + \caption{Isto é outro gráfico, que continua a numeração deste tipo de \emph{float}} + \rule{4cm}{4cm} + \smallcaption{Fonte: Autor}% + \label{gra:grafico2} \end{grafico} \subsubsection{Algoritmos} @@ -605,31 +624,34 @@ Exemplo: \end{lstlisting} \begin{algorithm} - \Entrada{Vetor \(X\)} - \Saida{Vetor \(Y\)} + \Entrada{Vetor \(X\)} + \Saida{Vetor \(Y\)} - \ParaCada{variável \(x_i \in X\)}{ + \ParaCada{variável \(x_i \in X\)}{ - \(y_i = x_i^2\) + \(y_i = x_i^2\) - } + } - \Retorna \(Y\) - \caption{Exemplo de algoritmo usando algorithm2e em português}\label{lst:alg} + \Retorna \(Y\) + \caption{Exemplo de algoritmo usando algorithm2e em português}% + \label{lst:alg} \end{algorithm} \subsubsection{Equações} O guia da biblioteca também dita que todas as equações devem vir acompanhadas de numeração entre parênteses. O ambiente \texttt{equation} insere essa numeração à direita da equação. Adicionalmente, o pacote \texttt{mathtools} permite que uma equação seja referenciada durante o texto utilizando o comando \lstinline+\eqref{label_da_equacao}+, cuja funcionalidade é semelhante à do comando \lstinline+\ref{}+, porém com a adição dos parênteses. -\begin{equation} \label{eq:euler} - e^{i\pi}+1=0 +\begin{equation}% + \label{eq:euler} + e^{i\pi}+1=0 \end{equation} A equação \eqref{eq:euler} foi criada utilizando o seguinte código: \begin{lstlisting} -\begin{equation} \label{eq:euler} +\begin{equation}% +\label{eq:euler} e^{i\pi}+1=0 \end{equation} \end{lstlisting} @@ -646,8 +668,9 @@ Exemplo de teorema. Resultado: -\begin{teorema}\label{thm:ex1} - Exemplo de teorema. +\begin{teorema}% + \label{thm:ex1} + Exemplo de teorema. \end{teorema} Caso um teorema possua um nome ou referência, essa informação pode ser passada entre colchetes, como uma opção do ambiente: @@ -655,30 +678,32 @@ Caso um teorema possua um nome ou referência, essa informação pode ser passad \lstinline+\begin{teorema}[Teorema de Pitágoras \cite{obra}]+ \begin{teorema}[Teorema de Pitágoras \cite{heath1921history}] \label{thm:ex2} - Em qualquer triângulo retângulo, o quadrado do comprimento da hipotenusa é igual à soma dos quadrados dos comprimentos dos catetos. + Em qualquer triângulo retângulo, o quadrado do comprimento da hipotenusa é igual à soma dos quadrados dos comprimentos dos catetos. \end{teorema} A classe da FEI disponibiliza os ambientes \emph{axioma, teorema, lema, hipotese, proposicao, conjectura, paradoxo, corolario, definicao} e \emph{exemplo}, com chamada e numeração em negrito e texto com formatação padrão, como nos teoremas \ref{thm:ex1} e \ref{thm:ex2}. Também há o ambiente \emph{prova}, utilizado para se demonstrar alguma propriedade mencionada, o qual não é numerado e tem sua chamada em itálico. O término de um teorema, denominado ``como se queria demonstrar'' (CQD), do latim \gls{qed}, é representado pelo símbolo \qedsymbol, denominado ``lápide''. \subsection{Alíneas} -Segundo o padrão da biblioteca, ``se houver necessidade de enumerar diversos assuntos dentro de uma seção, deve-se utilizar alíneas ordenadas alfabeticamente por letras minúsculas seguidas de parênteses com margem de 1,25 cm''. Para que não houvesse problemas de formatação, o ambiente \texttt{itemize} foi redirecionado para utilizar o \texttt{enumerate} e este passa a utilizar letras para a sequência de items (como utilizado na seção~\ref{sec:dependencias}). Alíneas em segundo nível são iniciadas pelo caractere \emph{en dash} (--). +Segundo o padrão da biblioteca, ``se houver necessidade de enumerar diversos assuntos dentro de uma seção, deve-se utilizar alíneas ordenadas alfabeticamente por letras minúsculas seguidas de parênteses com margem de 1,25 cm''. Esse comportamento é incorporado ao ambiente \texttt{enumerate}, o qual é utilizado por padrão no \LaTeX{} para alíneas numeradas ou ordenadas alfabeticamente. Uma vez que o guia da biblioteca não preve outro tipo de alínea, o ambiente \texttt{itemize} foi redirecionado para utilizar o \texttt{enumerate}, não havendo diferenças práticas entre os dois. Uma vez que não há recomendações para formatações de alíneas aninhadas, optou-se por iniciar alíneas de segundo nível utilizando o caractere \emph{en dash} (--). \begin{enumerate} - \item Primeiro item; - \item Segundo item; - \begin{enumerate} - \item Primeiro sub-item; - \item Segundo sub-item. - \end{enumerate} - \item Terceiro item extremamente grande utilizado para testar se as linhas das alíneas são alinhadas verticalmente no início, como demanda o guia de 2020. + \item Primeiro item; + \item Segundo item; + \begin{enumerate} + \item Primeiro sub-item; + \item Segundo sub-item. + \end{enumerate} + \item Terceiro item extremamente grande utilizado para testar se as linhas das alíneas são alinhadas verticalmente no início, como demanda o guia de 2020. \end{enumerate} -\section{PÓS-TEXTO}\label{sec:postexto} +\section{PÓS-TEXTO}% +\label{sec:postexto} Fazem parte dos elementos pós-textuais as referências bibliográficas, apêndices, anexos e o índice remissivo. Este capítulo descreve os comandos para \emph{inserção} destes elementos. Os capítulos seguintes instruirão como \emph{criá-los}. -\subsection{Referências bibliográficas} \label{subsec:referencias-pos} +\subsection{Referências bibliográficas}% +\label{subsec:referencias-pos} A lista de referências bibliográficas, contidas em um ou mais arquivos \texttt{bib} e referenciadas assim como descrito na seção \ref{subsec:referencias-pre}, é inserida no trabalho através do comando \lstinline+\printbibliography+. Repare, contudo, que apenas as obras referenciadas no texto através dos comandos de citação são listadas nas referências bibliográficas. @@ -712,45 +737,46 @@ Ao contrário dos apêndices, o \LaTeX{} não possui um comando nativo para decl A biblioteca permite a criação de um índice remissivo de palavras, para que estas sejam encontradas com maior facilidade no decorrer do trabalho. O capítulo, \ref{chap:indice} explica com detalhes os diferentes programas e comandos envolvidos na indexação de palavras e compilação dos arquivos de índices, mas, por motivos de completude, o comando para se imprimir o índice é \lstinline+\printindex+. -\chapter{CITAÇÕES EM FORMATO AUTOR-DATA E NUMÉRICAS} \label{chap:referencia} +\chapter{Citações em formato autor data e numéricas}% +\label{chap:referencia} A classe da \index{FEI}\gls{fei} faz uso do pacote \texttt{biblatex-abnt} para inserção de citações ao longo do texto e impressão da lista de referências bibliográficas ao final do texto. O \texttt{biblatex-abnt} é responsável por formatar tanto citações quanto referências bibliográficas sob os padrões da ABNT. A classe da \index{FEI}\gls{fei} realiza algumas modificações no estilo fornecido pelo \texttt{biblatex-abnt} para se adequar ao guia da biblioteca. Por padrão, as citações são feitas no formato autor-data. Para utilizar o formato numérico, adicione a opção \texttt{numeric} à declaração da classe: \lstinline+\documentclass[numeric]{fei}+. Os comandos mais comuns de citação são exemplificados abaixo e nas próximas seções. Para uma lista detalhada de todos os comandos tanto do formato autor-data como numérico, o leitor é referenciado ao manual do \texttt{biblatex-abnt} \footnote{\url{https://www.ctan.org/pkg/biblatex-abnt}}. O formato autor-data é mencionado como \texttt{abnt}, enquanto o formato numérico é mencionado na documentação como \texttt{abnt-numeric}. -\begin{itemize} - \item citação no final de linha: - - \begin{itemize} - \item Este texto deveria ser uma referência \lstinline+\cite{turing50}+. $\to$ Este texto deveria ser uma referência \cite{turing50}. - \end{itemize} - - \item citação durante o texto: - - \begin{itemize} - \item Segundo \lstinline+\textcite{haykin99a}+, este texto deveria ser uma referência. $\to$ Segundo \textcite{haykin99a}, este texto deveria ser uma referência. - \end{itemize} - - \item citação indireta: - - \begin{itemize} - \item \lstinline+\apud{kahneman2011}{stewart2012}+ formata a citação de forma semelhante a \apud{kahneman2011}{stewart2012}. - \end{itemize} - - \item citações múltiplas: - - \begin{itemize} - \item \lstinline+\cites{mcc43}{kurzweil2013}{haykin99a}+ \(\to\) \cites{mcc43}{kurzweil2013}{haykin99a} - \item \lstinline+\textcites{clarke19932001}{hamlet}{art1}+ \(\to\) \textcites{clarke19932001}{hamlet}{art1} - \end{itemize} - - \item citações de campos específicos: - - \begin{itemize} - \item \lstinline+\citeauthor*{galilei_dialogue_1953}+ \(\to\) \citeauthor*{galilei_dialogue_1953} - \item \lstinline+\citeauthor{galilei_dialogue_1953}+ \(\to\) \citeauthor{galilei_dialogue_1953} - \item \lstinline+\citeyear{galilei_dialogue_1953}+ \(\to\) \citeyear{galilei_dialogue_1953} - \end{itemize} +\begin{itemize} + \item citação no final de linha: + + \begin{itemize} + \item Este texto deveria ser uma referência \lstinline+\cite{turing50}+. $\to$ Este texto deveria ser uma referência \cite{turing50}. + \end{itemize} + + \item citação durante o texto: + + \begin{itemize} + \item Segundo \lstinline+\textcite{haykin99a}+, este texto deveria ser uma referência. $\to$ Segundo \textcite{haykin99a}, este texto deveria ser uma referência. + \end{itemize} + + \item citação indireta: + + \begin{itemize} + \item \lstinline+\apud{kahneman2011}{stewart2012}+ formata a citação de forma semelhante a \apud{kahneman2011}{stewart2012}. + \end{itemize} + + \item citações múltiplas: + + \begin{itemize} + \item \lstinline+\cites{mcc43}{kurzweil2013}{haykin99a}+ \(\to\) \cites{mcc43}{kurzweil2013}{haykin99a} + \item \lstinline+\textcites{clarke19932001}{hamlet}{art1}+ \(\to\) \textcites{clarke19932001}{hamlet}{art1} + \end{itemize} + + \item citações de campos específicos: + + \begin{itemize} + \item \lstinline+\citeauthor*{galilei_dialogue_1953}+ \(\to\) \citeauthor*{galilei_dialogue_1953} + \item \lstinline+\citeauthor{galilei_dialogue_1953}+ \(\to\) \citeauthor{galilei_dialogue_1953} + \item \lstinline+\citeyear{galilei_dialogue_1953}+ \(\to\) \citeyear{galilei_dialogue_1953} + \end{itemize} \end{itemize} \section{CITAÇÃO PARA \emph{FLOATS}} @@ -766,17 +792,17 @@ De acordo com o guia da biblioteca, a citação direta com mais de 3 linhas deve Exemplo do ambiente \texttt{quote}: \begin{quote} - I propose to consider the question, `Can machines think?' This should begin with definitions of the meaning of the terms `machine' and `think'. The definitions might be framed so as to reflect so far as possible the normal use of the words, but this attitude is dangerous. If the meaning of the words `machine' and `think' are to be found by examining how they are commonly used it is difficult to escape the conclusion that the meaning and the answer to the question, `Can machines think?' is to be sought in a statistical survey such as a Gallup poll. But this is absurd. Instead of attempting such a definition I shall replace the question by another, which is closely related to it and is expressed in relatively unambiguous words. \cite{turing50} + I propose to consider the question, `Can machines think?' This should begin with definitions of the meaning of the terms `machine' and `think'. The definitions might be framed so as to reflect so far as possible the normal use of the words, but this attitude is dangerous. If the meaning of the words `machine' and `think' are to be found by examining how they are commonly used it is difficult to escape the conclusion that the meaning and the answer to the question, `Can machines think?' is to be sought in a statistical survey such as a Gallup poll. But this is absurd. Instead of attempting such a definition I shall replace the question by another, which is closely related to it and is expressed in relatively unambiguous words. \cite{turing50} \end{quote} Exemplo do ambiente \texttt{quotation}: \begin{quotation} - The computing world has undergone a revolution since the publication of The C Programming Language in 1978. Big computers are much bigger, and personal computers have capabilities that rival mainframes of a decade ago. During this time, C has changed too, although only modestly, and it has spread far beyond its origins as the language of the UNIX operating system. + The computing world has undergone a revolution since the publication of The C Programming Language in 1978. Big computers are much bigger, and personal computers have capabilities that rival mainframes of a decade ago. During this time, C has changed too, although only modestly, and it has spread far beyond its origins as the language of the UNIX operating system. - The growing popularity of C, the changes in the language over the years, and the creation of compilers by groups not involved in its design, combined to demonstrate a need for a more precise and more contemporary definition of the language than the first edition of this book provided. In 1983, the American National Standards Institute (ANSI) established a committee whose goal was to produce ``an unambiguous and machine-independent definition of the language C'', while still retaining its spirit. The result is the ANSI standard for C. + The growing popularity of C, the changes in the language over the years, and the creation of compilers by groups not involved in its design, combined to demonstrate a need for a more precise and more contemporary definition of the language than the first edition of this book provided. In 1983, the American National Standards Institute (ANSI) established a committee whose goal was to produce ``an unambiguous and machine-independent definition of the language C'', while still retaining its spirit. The result is the ANSI standard for C. - The standard formalizes constructions that were hinted but not described in the first edition, particularly structure assignment and enumerations. It provides a new form of function declaration that permits cross-checking of definition with use. It specifies a standard library, with an extensive set of functions for performing input and output, memory management, string manipulation, and similar tasks. It makes precise the behavior of features that were not spelled out in the original definition, and at the same time states explicitly which aspects of the language remain machine-dependent. \cite{Kernighan1988} + The standard formalizes constructions that were hinted but not described in the first edition, particularly structure assignment and enumerations. It provides a new form of function declaration that permits cross-checking of definition with use. It specifies a standard library, with an extensive set of functions for performing input and output, memory management, string manipulation, and similar tasks. It makes precise the behavior of features that were not spelled out in the original definition, and at the same time states explicitly which aspects of the language remain machine-dependent. \cite{Kernighan1988} \end{quotation} \section{CITAÇÕES DE MÚLTIPLAS OBRAS COM MESMO AUTOR} @@ -787,7 +813,8 @@ Por exemplo, os trabalhos de \textcite{rocha2005brain,rocha2014brain,rocha2016ee Já nos trabalhos de \textcite{duan2012large,duan2012reduced,duan2014functional}, é necessário diferenciar as duas primeiras obras devido às datas semelhantes. Citações entre parênteses para os mesmos trabalhos tomam a seguinte forma: \cite{duan2012large,duan2012reduced,duan2014functional}. -\chapter{ÍNDICES}\label{chap:indice} +\chapter{Índices}% +\label{chap:indice} Assim como as referências são geradas por um programa a parte (o Biber), a criação de índices remissivos também o é. Neste quesito, a classe da FEI faz uso do programa \bigvindex{xindy} como gerador de índices. Mais especificamente, os programas \texttt{xindy} e \texttt{texindy} são necessários para geração de índices remissivos. O xindy foi selecionado como gerador de índices para a classe da FEI devido ao suporte a diversos e idiomas e indexação de palavras com caracteres mais exóticos -- como acentos ou cedilha. @@ -811,7 +838,8 @@ Para aprender dicas avançadas na criação de índices mais complexos, recomend A impressão do índice é feita utilizando o comando \lstinline+\printindex+, o qual também inclui uma entrada para o mesmo no sumário do documento. -\chapter{LISTAS DE SÍMBOLOS E ABREVIATURAS} \label{chap:listas} +\chapter{Listas de símbolos e abreviaturas}% +\label{chap:listas} Para a criação das listas de símbolos e abreviaturas, foi utilizado o pacote \bigvindex{glossaries}, responsável por indexar termos de diferentes categorias e gerar listas destes termos. Ao contrário do índice, que indexa as palavras no decorrer do texto, o pacote \emph{glossaries} exige que os termos sejam declarados antes de serem referenciados durante o texto. Uma boa prática para organizar tais termos consiste em declará-los ao início do documento, ou em um documento separado, o qual pode ser chamado utilizando os comandos \lstinline+\input+ ou \lstinline+\include+. Estas opções ficam a cargo do leitor. As próximas seções ensinarão os comandos básicos para indexação de símbolos e abreviaturas. @@ -830,10 +858,10 @@ A indexação de abreviaturas é feita utilizando o comando \lstinline+\newacronym[longplural=1]{2}{3}{4}+, onde: \begin{enumerate} - \item 1: o significado a abreviatura no plural, escrito por extenso (\emph{opcional}); - \item 2: código que será utilizado para referenciar a abreviatura no decorrer do texto; - \item 3: a abreviatura em si; - \item 4: o significado a abreviatura, escrito por extenso. + \item 1: o significado a abreviatura no plural, escrito por extenso (\emph{opcional}); + \item 2: código que será utilizado para referenciar a abreviatura no decorrer do texto; + \item 3: a abreviatura em si; + \item 4: o significado a abreviatura, escrito por extenso. \end{enumerate} Exemplo: \lstinline+\newacronym[longplural=Associações+ @@ -851,11 +879,11 @@ A indexação de símbolos é feita utilizando o comando \lstinline+name={3},sort={4},description={5}}+, onde: \begin{enumerate} - \item 1: código que será utilizado para referenciar a abreviatura no decorrer do texto); - \item 2: tipo do símbolo; usado para separar letras gregas e subscritos das demais (Cf. exemplo abaixo); - \item 3: o símbolo; caso a notação matemática seja necessária, use \lstinline+\ensuremath{2}+ (Cf. exemplo abaixo); - \item 4: uma sequência de caracteres para indicar a ordenação alfabética do símbolo na lista; - \item 5: a descrição do símbolo, que aparecerá na lista. + \item 1: código que será utilizado para referenciar a abreviatura no decorrer do texto); + \item 2: tipo do símbolo; usado para separar letras gregas e subscritos das demais (Cf. exemplo abaixo); + \item 3: o símbolo; caso a notação matemática seja necessária, use \lstinline+\ensuremath{2}+ (Cf. exemplo abaixo); + \item 4: uma sequência de caracteres para indicar a ordenação alfabética do símbolo na lista; + \item 5: a descrição do símbolo, que aparecerá na lista. \end{enumerate} Exemplo: \lstinline+\newglossaryentry{pi}{parent=greek,type=symbols,+ @@ -869,25 +897,26 @@ Exemplo: \lstinline+\newglossaryentry{pi}{parent=greek,type=symbols,+ O pacote \bigvindex{glossaries} disponibiliza os seguintes comandos para chamar os itens indexados durante o texto: \begin{enumerate} - \item \lstinline+\gls{<rotulo>}+: imprime a entrada em letras minúsculas; - \item \lstinline+\Gls{<rotulo>}+: imprime a entrada em letras maiúsculas; - \item \lstinline+\glspl{<rotulo>}+: imprime a entrada no plural; - \item \lstinline+\Glspl{<rotulo>}+: imprime a entrada no plural e em letras maiúsculas. + \item \lstinline+\gls{<rotulo>}+: imprime a entrada em letras minúsculas; + \item \lstinline+\Gls{<rotulo>}+: imprime a entrada em letras maiúsculas; + \item \lstinline+\glspl{<rotulo>}+: imprime a entrada no plural; + \item \lstinline+\Glspl{<rotulo>}+: imprime a entrada no plural e em letras maiúsculas. \end{enumerate} As siglas possuem alguns comandos únicos para serem referenciadas: \begin{enumerate} - \item \lstinline+\acrfull{<rotulo>}+ imprime a abreviatura completa \(\to\) \acrfull{fei}; - \item \lstinline+\acrlong{<rotulo>}+ imprime a parte por extenso da abreviatura \(\to\) \acrlong{fei}; - \item \lstinline+\acrshort{<rotulo>}+ imprime apenas a abreviatura \(\to\) \acrshort{fei}. + \item \lstinline+\acrfull{<rotulo>}+ imprime a abreviatura completa \(\to\) \acrfull{fei}; + \item \lstinline+\acrlong{<rotulo>}+ imprime a parte por extenso da abreviatura \(\to\) \acrlong{fei}; + \item \lstinline+\acrshort{<rotulo>}+ imprime apenas a abreviatura \(\to\) \acrshort{fei}. \end{enumerate} Repare que, no caso das siglas, quando estas são usadas pela primeira vez, são impressas a definição seguida da sigla entre parênteses. Nas demais vezes, a sigla aparecerá sozinha. Já os símbolos podem ser utilizados dentro de equações, ou na definição de outros símbolos, como no seguinte exemplo \cite{goldberg1989}, \[ \operatorname{E}(\gls{m}(\gls{h},\gls{t}+1)) \geq \frac{\gls{m}(\gls{h},\gls{t}) \gls{f}(\gls{h})}{\gls{at}}[1-\gls{p}], \] onde \[ p = \frac{\gls{delta}(\gls{h})}{\gls{l}-1}\gls{pc} + \gls{oh}(\gls{h}) \gls{pm}. \] Os símbolos utilizados nas equações são cadastrados no início do arquivo, inseridos com o comando \lstinline+\gls{}+ e consequentemente, adicionados na lista de símbolos. É importante ressaltar que o pacote \bigvindex{glossaries} adiciona às listas somente os termos que forem utilizados durante o texto. Para que todos os termos declarados apareçam, basta usar o comando \lstinline+\glsaddall+ no corpo do texto. -\section{HIERARQUIA DE SÍMBOLOS}\label{sec:sublist} +\section{HIERARQUIA DE SÍMBOLOS}% +\label{sec:sublist} Atendendo à demanda de alunos que utilizam uma quantidade muito extensa de símbolos em seus trabalhos, a classe da FEI passou a suportar o uso de listas se símbolos que permitam a ordenação hierárquica dos símbolos. Esta adição foi feita através do uso do estilo \texttt{alttree} do pacote \texttt{glossaries}. Para que este estilo seja utilizado no documento, a opção \texttt{sublist} deve ser passada à classe. O exemplo abaixo demonstra como criar uma categoria de símbolos e inserir um símbolo nela. Mais de uma categoria de símbolos pode ser criada. Para mais exemplos, consulte os arquivos de exemplo do repositório ou o manual do pacote \texttt{glossaries}. @@ -904,30 +933,33 @@ O exemplo abaixo demonstra como criar uma categoria de símbolos e inserir um s A lista de abreviaturas pode ser impressa através do comando \lstinline+\printacronyms+. A lista de símbolos pode ser impressa através do comando \lstinline+\printsymbols+. Todas as listas criadas através do pacote \texttt{glossaries}, inclusive as definidas pelo próprio usuário, podem ser impressas sequencialmente através do comando \lstinline+\printglossaries+. -\chapter{COMPILANDO O PROJETO} \label{chap:compilando} +\chapter{Compilando o projeto}% +\label{chap:compilando} Para utilizar todos os recursos que a \texttt{fei.cls} disponibiliza, é necessário compilar o projeto utilizando diferentes programas. Esta sessão descreve tanto uma maneira automatizada de se compilar o projeto, usando o latexmk, assim como os programas que podem ser chamados manualmente, para fins de depuração.. -\section{COMPILAÇÃO AUTOMATIZADA} \label{sec:latexmk} +\section{COMPILAÇÃO AUTOMATIZADA}% +\label{sec:latexmk} Existem diversas ferramentas que automatizam o processo de compilação de um documento em \LaTeX{}, abstraindo o usuário da complexidade de utilizar todos os programas menores que geram o arquivo final. Dentre as ferramentas mais conhecidas estão o \texttt{latexmk}, \texttt{rubber} e \texttt{arara}, criadas especificamente para realizar a automatização da compilação de documentos \TeX{}. Para a classe da FEI, recomenda-se o uso do \texttt{latexmk}. As configurações necessárias são disponibilizadas no arquivo \texttt{.latexmkrc}, o qual deve ser colocado no mesmo diretório que o arquivo \texttt{.tex} principal do documento. O \texttt{latexmk} pode então ser chamado da seguinte forma (supondo que haja um arquivo chamado \texttt{documento.tex} no diretório atual): \begin{enumerate} - \item \texttt{latexmk -pdf documento.tex} + \item \texttt{latexmk -pdf documento.tex} \end{enumerate} Caso haja apenas um arquivo \texttt{tex} no diretório, não é necessário especificar o nome do documento, assim como nunca é necessário deixar explícito tanto ao \texttt{latexmk} quanto ao \texttt{rubber} se o documento sendo compilado possui bibliografia, índices ou listas. Os programas detectam a existência desses construtos adicionais examinando os arquivos auxiliares gerados durante o processo e executam todos os comandos apropriados na ordem certa e o número suficiente de vezes. -\section{COMPILAÇÃO MANUAL} \label{sec:dificil} +\section{COMPILAÇÃO MANUAL}% +\label{sec:dificil} A compilação manual do projeto depende dos seguintes programas: \begin{enumerate} - \item \texttt{pdflatex}: gera todos os arquivos auxiliares, utilizados pelos demais programas, assim como uma versão do PDF com os elementos compilados até o momento; - \item \texttt{biber}: gera a bibliografia lendo o arquivo \texttt{bib} utilizado. Necessário apenas se citações e referências forem usadas no texto; - \item \texttt{makeglossaries}: cria um ou mais arquivos de listas (de símbolos e abreviaturas). Necessário apenas se houve indexação e utilização de símbolos e abreviaturas no texto; - \item \texttt{texindy}: cria um ou mais arquivos de índice. Necessário apenas se houver indexação de palavras para serem adicionadas ao índice; - \item \texttt{bib2gls}: transforma uma lista de abreviaturas e símbolos, criada utilizando um arquivo \texttt{bib}, em listas de símbolos e abreviaturas a serem processadas pelo \texttt{makeglossaries}. + \item \texttt{pdflatex}: gera todos os arquivos auxiliares, utilizados pelos demais programas, assim como uma versão do PDF com os elementos compilados até o momento; + \item \texttt{biber}: gera a bibliografia lendo o arquivo \texttt{bib} utilizado. Necessário apenas se citações e referências forem usadas no texto; + \item \texttt{makeglossaries}: cria um ou mais arquivos de listas (de símbolos e abreviaturas). Necessário apenas se houve indexação e utilização de símbolos e abreviaturas no texto; + \item \texttt{texindy}: cria um ou mais arquivos de índice. Necessário apenas se houver indexação de palavras para serem adicionadas ao índice; + \item \texttt{bib2gls}: transforma uma lista de abreviaturas e símbolos, criada utilizando um arquivo \texttt{bib}, em listas de símbolos e abreviaturas a serem processadas pelo \texttt{makeglossaries}. \end{enumerate} A ordem na qual os programas devem ser executados depende de quais funcionalidades da classe da FEI forma utilizadas no documento: a ausência de referências bibliográficas torna desnecessário o uso do \texttt{biber}; a ausência de abreviaturas e símbolos torna denecessário o uso do \texttt{makeglossaries} e a ausência de índice remissivo torna desnecessário o uso do \texttt{texindy}. Ademais, se compilações anteriores modificam a localização de certos elementos já posicionados do texto (e.g. uma palavra indexada na página 30 é ``empurrada'' para a página 31 depois que as citações bibliográficas são inseridas no texto), os programas talvez tenham que ser executados diversas vezes até alcançar-se um PDF correto e estável. Essas preocupações são desnecessárias caso o \texttt{latexmk} seja usado, como descrito na sessão~\ref{sec:latexmk}. @@ -939,12 +971,12 @@ Uma ordem comum para se compilar o projeto é a seguinte: onde: \begin{enumerate} - \item gera arquivos auxiliares básicos, utilizados pelos demais programas, e uma versão inicial do PDF; - \item gera a bibliografia lendo o arquivo \texttt{bib} utilizado. Necessário apenas se citações e referências forem usadas no texto; - \item cria um ou mais arquivos de listas (de símbolos e abreviaturas). Necessário apenas se houve indexação e utilização de símbolos e abreviaturas no texto; - \item atualiza todas as referências através do texto, utilizando os arquivos gerados em \emph{b}, \emph{c} e \emph{d} (\emph{desnecessário se os passos b -- d não foram realizados}); - \item cria um ou mais arquivos de índice. Necessário apenas se houver indexação de palavras para serem adicionadas ao índice; - \item gera o PDF final (\emph{desnecessário se os passos b -- e não foram realizados}), incluindo o índice gerado no passo anterior. + \item gera arquivos auxiliares básicos, utilizados pelos demais programas, e uma versão inicial do PDF; + \item gera a bibliografia lendo o arquivo \texttt{bib} utilizado. Necessário apenas se citações e referências forem usadas no texto; + \item cria um ou mais arquivos de listas (de símbolos e abreviaturas). Necessário apenas se houve indexação e utilização de símbolos e abreviaturas no texto; + \item atualiza todas as referências através do texto, utilizando os arquivos gerados em \emph{b}, \emph{c} e \emph{d} (\emph{desnecessário se os passos b -- d não foram realizados}); + \item cria um ou mais arquivos de índice. Necessário apenas se houver indexação de palavras para serem adicionadas ao índice; + \item gera o PDF final (\emph{desnecessário se os passos b -- e não foram realizados}), incluindo o índice gerado no passo anterior. \end{enumerate} Os comandos equivalentes num terminal no Linux ou Mac OS são os seguintes: @@ -958,7 +990,7 @@ texindy documento.idx pdflatex --shell-escape documento.tex \end{lstlisting} -\chapter{LEITURA COMPLEMENTAR} +\chapter{Leitura complementar} \textcite{lamport1994latex} e \textcite{mittelbach_latex_2004} descrevem de maneira completa o \LaTeX: seus comandos, funcionalidades e programas adicionais que interagem com ele, como o Bib\TeX{}, \emph{MakeIndex}, \emph{xindy} entre outros, sendo \citeauthor*{lamport1994latex} o criador do \LaTeXe e \citeauthor*{mittelbach_latex_2004} os atuais mantenedores do \LaTeXe\ e do projeto do \LaTeX{} 3. \textcite{lshort} mantém um guia atualizado de \LaTeX{} em seu site, disponível em PDF para download gratuito. O livro \emph{open-source} de \LaTeX{} no Wikibooks \url{http://en.wikibooks.org/wiki/LaTeX/} também é uma ótima fonte de busca para comandos e pacotes. A \gls{ctan} \url{http://ctan.org} é o repositório online para todos os pacotes utilizados pelo \LaTeX{}, assim como seus manuais. @@ -968,7 +1000,8 @@ Manuais complementares da Classe \LaTeX{} da FEI de possível interesse para usu \appendix -\chapter{\emph{HACKS} ÚTEIS} \label{app:hacks} +\chapter{\emph{Hacks} úteis}% +\label{app:hacks} Existem alguns casos específicos nos quais técnicas de formatação avançadas ou redefinições de comandos são requeridas. Não existe forma simples de disponibilizar os recursos listados neste apêndice aos usuários da classe, então o apêndice ensinará os usuários a realizar personalizações básicas na classe, assim como fazer formatações menos convencionais que sejam necessárias para aderir as padrões da biblioteca. @@ -1018,12 +1051,13 @@ Para redefinir qualquer um destes valores, é necessário fazê-lo dentro do com \section{ALINHANDO FIGURA E LEGENDA} \begin{figure} - \centering - \begin{minipage}{.5\textwidth} - \caption{Exemplo de fonte com sua figura} - \rule{\textwidth}{2cm} - \smallcaption{Fonte: Autor}\label{fig:exemplo_alinhado} - \end{minipage} + \centering + \begin{minipage}{.5\textwidth} + \caption{Exemplo de fonte com sua figura} + \rule{\textwidth}{2cm} + \smallcaption{Fonte: Autor}% + \label{fig:exemplo_alinhado} + \end{minipage} \end{figure} Uma forma de se alinhar as legendas de uma figura com sua extremidade esquerda corretamente sem utilizar recuos é através do uso do ambiente \texttt{minipage}, como mostrado abaixo. A figura \ref{fig:exemplo_alinhado} mostra o resultado. Neste formato, para mudar o tamanho da figura, muda-se o tamanho da \texttt{minipage}. @@ -1035,7 +1069,8 @@ Uma forma de se alinhar as legendas de uma figura com sua extremidade esquerda c \caption{Exemplo de fonte com sua figura} \rule{\textwidth}{2cm} \includegraphics[width=\textwidth]{...} - \smallcaption{Fonte: Autor.}\label{fig:exemplo_alinhado} + \smallcaption{Fonte: Autor.}% +\label{fig:exemplo_alinhado} \end{minipage} \end{figure} \end{lstlisting} @@ -1054,257 +1089,259 @@ Para criar uma nova categoria de \emph{float}, a qual será listada na lista de \setfloatlocations{mapa}{hbtp} % configurando posicionamento padrão \end{lstlisting} -\chapter{ARQUIVOS CRIADOS PELO PROCESSO DE COMPILAÇÃO} \label{app:arquivos} +\chapter{Arquivos criados pelo processo de compilação}% +\label{app:arquivos} A seguir, as descrições dos arquivos auxiliares gerados durante o processo de compilação de um documento utilizando a classe \LaTeX{} da FEI e todos os seus recursos. \begin{enumerate} - \item\lstinline+pdflatex documento.tex+ - \begin{enumerate} - \item \texttt{alg}: \emph{log} do \index{makeindex@\emph{MakeIndex}}\emph{MakeIndex}; - \item \texttt{bcf}: arquivo com as referências a serem processadas pelo \index{Biber}Biber; - \item \texttt{glo,acn,sym}: listas de abreviaturas e símbolos. - \item \texttt{idx}: arquivo com os termos a serem adicionados no índice pelo \emph{MakeIndex}; - \item \texttt{loa}: lista de algoritmos; - \item \texttt{out}: atalhos (\emph{bookmarks}) utilizados pelo leitor de PDF. - \item \texttt{toc}: sumário; - \end{enumerate} - - \item\lstinline+biber documento.aux+ - \begin{enumerate} - \item \texttt{bcf}: arquivo de controle do Biber; - \item \texttt{bbl}: arquivo contendo as citações utilizadas no texto, prontas a serem incluídas na próxima execução do pdf\LaTeX. - \end{enumerate} - - \item\lstinline+texindy documento.idx+ - \begin{enumerate} - \item \texttt{ind}: contém, em linguagem \emph{tex}, a formação do índice a ser inserida na chamada a \lstinline+\printindex+. - \end{enumerate} - - \item\lstinline+makeglossaries documento+ - \begin{enumerate} - \item \texttt{acr,sbl,gls}: contém, em linguagem \emph{tex}, a formação das listas a serem inseridas na chamada a \lstinline+\printglossaries+; - \item \texttt{glg}: \emph{log} do \emph{glossaries}. - \end{enumerate} + \item\lstinline+pdflatex documento.tex+ + \begin{enumerate} + \item \texttt{alg}: \emph{log} do \index{makeindex@\emph{MakeIndex}}\emph{MakeIndex}; + \item \texttt{bcf}: arquivo com as referências a serem processadas pelo \index{Biber}Biber; + \item \texttt{glo,acn,sym}: listas de abreviaturas e símbolos. + \item \texttt{idx}: arquivo com os termos a serem adicionados no índice pelo \emph{MakeIndex}; + \item \texttt{loa}: lista de algoritmos; + \item \texttt{out}: atalhos (\emph{bookmarks}) utilizados pelo leitor de PDF. + \item \texttt{toc}: sumário; + \end{enumerate} + + \item\lstinline+biber documento.aux+ + \begin{enumerate} + \item \texttt{bcf}: arquivo de controle do Biber; + \item \texttt{bbl}: arquivo contendo as citações utilizadas no texto, prontas a serem incluídas na próxima execução do pdf\LaTeX. + \end{enumerate} + + \item\lstinline+texindy documento.idx+ + \begin{enumerate} + \item \texttt{ind}: contém, em linguagem \emph{tex}, a formação do índice a ser inserida na chamada a \lstinline+\printindex+. + \end{enumerate} + + \item\lstinline+makeglossaries documento+ + \begin{enumerate} + \item \texttt{acr,sbl,gls}: contém, em linguagem \emph{tex}, a formação das listas a serem inseridas na chamada a \lstinline+\printglossaries+; + \item \texttt{glg}: \emph{log} do \emph{glossaries}. + \end{enumerate} \end{enumerate} -\chapter{REFERÊNCIA DE SÍMBOLOS \TeX{}} \label{app:simbolos} +\chapter{Referência de símbolos \TeX{}}% +\label{app:simbolos} \section{LETRAS GREGAS} \begin{multicols}{3} - \noindent - \(\alpha\) \lstinline+\alpha+\\ - \(\beta\) \lstinline+\beta+\\ - \(\chi\) \lstinline+\chi+\\ - \(\delta\) \lstinline+\delta+\\ - \(\Delta\) \lstinline+\Delta+\\ - \(\epsilon\) \lstinline+\epsilon+\\ - \(\eta\) \lstinline+\eta+\\ - \(\Gamma\) \lstinline+\Gamma+\\ - \(\gamma\) \lstinline+\gamma+\\ - \(\iota\) \lstinline+\iota+\\ - \(\kappa\) \lstinline+\kappa+\\ - \(\Lambda\) \lstinline+\Lambda+\\ - \(\lambda\) \lstinline+\lambda+\\ - \(\mu\) \lstinline+\mu+\\ - \(\nu\) \lstinline+\nu+\\ - \(\o\) \lstinline+\o+\\ - \(\omega\) \lstinline+\omega+\\ - \(\Omega\) \lstinline+\Omega+\\ - \(\phi\) \lstinline+\phi+\\ - \(\Phi\) \lstinline+\Phi+\\ - \(\Pi\) \lstinline+\Pi+\\ - \(\pi\) \lstinline+\pi+\\ - \(\Psi\) \lstinline+\Psi+\\ - \(\psi\) \lstinline+\psi+\\ - \(\rho\) \lstinline+\rho+\\ - \(\Sigma\) \lstinline+\Sigma+\\ - \(\sigma\) \lstinline+\sigma+\\ - \(\tau\) \lstinline+\tau+\\ - \(\Theta\) \lstinline+\Theta+\\ - \(\theta\) \lstinline+\theta+\\ - \(\upsilon\) \lstinline+\upsilon+\\ - \(\Upsilon\) \lstinline+\Upsilon+\\ - \(\varepsilon\) \lstinline+\varepsilon+\\ - \(\varphi\) \lstinline+\varphi+\\ - \(\varpi\) \lstinline+\varpi+\\ - \(\varrho\) \lstinline+\varrho+\\ - \(\varsigma\) \lstinline+\varsigma+\\ - \(\vartheta\) \lstinline+\vartheta+\\ - \(\xi\) \lstinline+\xi+\\ - \(\Xi\) \lstinline+\Xi+\\ - \(\zeta\) \lstinline+\zeta+\\ + \noindent + \(\alpha\) \lstinline+\alpha+\\ + \(\beta\) \lstinline+\beta+\\ + \(\chi\) \lstinline+\chi+\\ + \(\delta\) \lstinline+\delta+\\ + \(\Delta\) \lstinline+\Delta+\\ + \(\epsilon\) \lstinline+\epsilon+\\ + \(\eta\) \lstinline+\eta+\\ + \(\Gamma\) \lstinline+\Gamma+\\ + \(\gamma\) \lstinline+\gamma+\\ + \(\iota\) \lstinline+\iota+\\ + \(\kappa\) \lstinline+\kappa+\\ + \(\Lambda\) \lstinline+\Lambda+\\ + \(\lambda\) \lstinline+\lambda+\\ + \(\mu\) \lstinline+\mu+\\ + \(\nu\) \lstinline+\nu+\\ + \(\o\) \lstinline+\o+\\ + \(\omega\) \lstinline+\omega+\\ + \(\Omega\) \lstinline+\Omega+\\ + \(\phi\) \lstinline+\phi+\\ + \(\Phi\) \lstinline+\Phi+\\ + \(\Pi\) \lstinline+\Pi+\\ + \(\pi\) \lstinline+\pi+\\ + \(\Psi\) \lstinline+\Psi+\\ + \(\psi\) \lstinline+\psi+\\ + \(\rho\) \lstinline+\rho+\\ + \(\Sigma\) \lstinline+\Sigma+\\ + \(\sigma\) \lstinline+\sigma+\\ + \(\tau\) \lstinline+\tau+\\ + \(\Theta\) \lstinline+\Theta+\\ + \(\theta\) \lstinline+\theta+\\ + \(\upsilon\) \lstinline+\upsilon+\\ + \(\Upsilon\) \lstinline+\Upsilon+\\ + \(\varepsilon\) \lstinline+\varepsilon+\\ + \(\varphi\) \lstinline+\varphi+\\ + \(\varpi\) \lstinline+\varpi+\\ + \(\varrho\) \lstinline+\varrho+\\ + \(\varsigma\) \lstinline+\varsigma+\\ + \(\vartheta\) \lstinline+\vartheta+\\ + \(\xi\) \lstinline+\xi+\\ + \(\Xi\) \lstinline+\Xi+\\ + \(\zeta\) \lstinline+\zeta+\\ \end{multicols} \section{SÍMBOLOS} \begin{multicols}{3} - \noindent - \(\aleph\) \lstinline+\aleph+\\ - \(\hbar\) \lstinline+\hbar+\\ - \(\imath\) \lstinline+\imath+\\ - \(\jmath\) \lstinline+\jmath+\\ - \(\ell\) \lstinline+\ell+\\ - \(\wp\) \lstinline+\wp+\\ - \(\Re\) \lstinline+\Re+\\ - \(\Im\) \lstinline+\Im+\\ - \(\partial\) \lstinline+\partial+\\ - \(\infty\) \lstinline+\infty+\\ - \(\prime\) \lstinline+\prime+\\ - \(\emptyset\) \lstinline+\emptyset+\\ - \(\nabla\) \lstinline+\nabla+\\ - \(\surd\) \lstinline+\surd+\\ - \(\top\) \lstinline+\top+\\ - \(\bot\) \lstinline+\bot+\\ - \(\|\) \lstinline+\|+\\ - \(\angle\) \lstinline+\angle+\\ - \(\triangle\) \lstinline+\triangle+\\ - \(\backslash\) \lstinline+\backslash+\\ - \(\forall\) \lstinline+\forall+\\ - \(\exists\) \lstinline+\exists+\\ - \(\lnot\) \lstinline+\neg+ ou \lstinline+\lnot+\\ - \(\flat\) \lstinline+\flat+\\ - \(\natural\) \lstinline+\natural+\\ - \(\sharp\) \lstinline+\sharp+\\ - \(\clubsuit\) \lstinline+\clubsuit+\\ - \(\diamondsuit\) \lstinline+\diamondsuit+\\ - \(\heartsuit\) \lstinline+\heartsuit+\\ - \(\spadesuit\) \lstinline+\spadesuit+\\ + \noindent + \(\aleph\) \lstinline+\aleph+\\ + \(\hbar\) \lstinline+\hbar+\\ + \(\imath\) \lstinline+\imath+\\ + \(\jmath\) \lstinline+\jmath+\\ + \(\ell\) \lstinline+\ell+\\ + \(\wp\) \lstinline+\wp+\\ + \(\Re\) \lstinline+\Re+\\ + \(\Im\) \lstinline+\Im+\\ + \(\partial\) \lstinline+\partial+\\ + \(\infty\) \lstinline+\infty+\\ + \(\prime\) \lstinline+\prime+\\ + \(\emptyset\) \lstinline+\emptyset+\\ + \(\nabla\) \lstinline+\nabla+\\ + \(\surd\) \lstinline+\surd+\\ + \(\top\) \lstinline+\top+\\ + \(\bot\) \lstinline+\bot+\\ + \(\|\) \lstinline+\|+\\ + \(\angle\) \lstinline+\angle+\\ + \(\triangle\) \lstinline+\triangle+\\ + \(\backslash\) \lstinline+\backslash+\\ + \(\forall\) \lstinline+\forall+\\ + \(\exists\) \lstinline+\exists+\\ + \(\lnot\) \lstinline+\neg+ ou \lstinline+\lnot+\\ + \(\flat\) \lstinline+\flat+\\ + \(\natural\) \lstinline+\natural+\\ + \(\sharp\) \lstinline+\sharp+\\ + \(\clubsuit\) \lstinline+\clubsuit+\\ + \(\diamondsuit\) \lstinline+\diamondsuit+\\ + \(\heartsuit\) \lstinline+\heartsuit+\\ + \(\spadesuit\) \lstinline+\spadesuit+\\ \end{multicols} \section{OPERADORES BINÁRIOS} \begin{multicols}{3} - \noindent - \(\amalg\) \lstinline+\amalg+\\ - \(\ast\) \lstinline+\ast+\\ - \(\bigcirc\) \lstinline+\bigcirc+\\ - \(\bigtriangledown\) \lstinline+\bigtriangledown+\\ - \(\bigtriangleup\) \lstinline+\bigtriangleup+\\ - \(\bullet\) \lstinline+\bullet+\\ - \(\cap\) \lstinline+\cap+\\ - \(\cdot\) \lstinline+\cdot+\\ - \(\circ\) \lstinline+\circ+\\ - \(\cup\) \lstinline+\cup+\\ - \(\dagger\) \lstinline+\dagger+\\ - \(\ddagger\) \lstinline+\ddagger+\\ - \(\diamond\) \lstinline+\diamond+\\ - \(\div\) \lstinline+\div+\\ - \(\mp\) \lstinline+\mp+\\ - \(\odot\) \lstinline+\odot+\\ - \(\ominus\) \lstinline+\ominus+\\ - \(\oplus\) \lstinline+\oplus+\\ - \(\oslash\) \lstinline+\oslash+\\ - \(\otimes\) \lstinline+\otimes+\\ - \(\pm\) \lstinline+\pm+\\ - \(\setminus\) \lstinline+\setminus+\\ - \(\sqcap\) \lstinline+\sqcap+\\ - \(\sqcup\) \lstinline+\sqcup+\\ - \(\star\) \lstinline+\star+\\ - \(\times\) \lstinline+\times+\\ - \(\triangleleft\) \lstinline+\triangleleft+\\ - \(\triangleright\) \lstinline+\triangleright+\\ - \(\uplus\) \lstinline+\uplus+\\ - \(\vee\) \lstinline+\vee+\\ - \(\wedge\) \lstinline+\wedge+\\ - \(\wr\) \lstinline+\wr+\\ + \noindent + \(\amalg\) \lstinline+\amalg+\\ + \(\ast\) \lstinline+\ast+\\ + \(\bigcirc\) \lstinline+\bigcirc+\\ + \(\bigtriangledown\) \lstinline+\bigtriangledown+\\ + \(\bigtriangleup\) \lstinline+\bigtriangleup+\\ + \(\bullet\) \lstinline+\bullet+\\ + \(\cap\) \lstinline+\cap+\\ + \(\cdot\) \lstinline+\cdot+\\ + \(\circ\) \lstinline+\circ+\\ + \(\cup\) \lstinline+\cup+\\ + \(\dagger\) \lstinline+\dagger+\\ + \(\ddagger\) \lstinline+\ddagger+\\ + \(\diamond\) \lstinline+\diamond+\\ + \(\div\) \lstinline+\div+\\ + \(\mp\) \lstinline+\mp+\\ + \(\odot\) \lstinline+\odot+\\ + \(\ominus\) \lstinline+\ominus+\\ + \(\oplus\) \lstinline+\oplus+\\ + \(\oslash\) \lstinline+\oslash+\\ + \(\otimes\) \lstinline+\otimes+\\ + \(\pm\) \lstinline+\pm+\\ + \(\setminus\) \lstinline+\setminus+\\ + \(\sqcap\) \lstinline+\sqcap+\\ + \(\sqcup\) \lstinline+\sqcup+\\ + \(\star\) \lstinline+\star+\\ + \(\times\) \lstinline+\times+\\ + \(\triangleleft\) \lstinline+\triangleleft+\\ + \(\triangleright\) \lstinline+\triangleright+\\ + \(\uplus\) \lstinline+\uplus+\\ + \(\vee\) \lstinline+\vee+\\ + \(\wedge\) \lstinline+\wedge+\\ + \(\wr\) \lstinline+\wr+\\ \end{multicols} \section{RELAÇÕES} \begin{multicols}{3} - \noindent - \(\approx\) \lstinline+\approx+\\ - \(\asymp\) \lstinline+\asymp+\\ - \(\bowtie\) \lstinline+\bowtie+\\ - \(\cong\) \lstinline+\cong+\\ - \(\dashv\) \lstinline+\dashv+\\ - \(\doteq\) \lstinline+\doteq+\\ - \(\equiv\) \lstinline+\equiv+\\ - \(\frown\) \lstinline+\frown+\\ - \(\geq\) \lstinline+\geq+\\ - \(\gg\) \lstinline+\gg+\\ - \(\in\) \lstinline+\in+\\ - \(\leq\) \lstinline+\leq+\\ - \(\ll\) \lstinline+\ll+\\ - \(\mid\) \lstinline+\mid+\\ - \(\models\) \lstinline+\models+\\ - \(\ne\) \lstinline+\ne+\\ - \(\ni\) \lstinline+\ni+\\ - \(\not\equiv\) \lstinline+\not\equiv+\\ - \(\notin\) \lstinline+\notin+\\ - \(\notin\) \lstinline+\notin+\\ - \(\perp\) \lstinline+\perp+\\ - \(\prec\) \lstinline+\prec+\\ - \(\preceq\) \lstinline+\preceq+\\ - \(\propto\) \lstinline+\propto+\\ - \(\sim\) \lstinline+\sim+\\ - \(\simeq\) \lstinline+\simeq+\\ - \(\smile\) \lstinline+\smile+\\ - \(\sqsubseteq\) \lstinline+\sqsubseteq+\\ - \(\sqsupseteq\) \lstinline+\sqsupseteq+\\ - \(\subset\) \lstinline+\subset+\\ - \(\subseteq\) \lstinline+\subseteq+\\ - \(\succ\) \lstinline+\succ+\\ - \(\succeq\) \lstinline+\succeq+\\ - \(\supset\) \lstinline+\supset+\\ - \(\supseteq\) \lstinline+\supseteq+\\ - \(\vdash\) \lstinline+\vdash+\\ - %\(\parallet\) \lstinline++\\ + \noindent + \(\approx\) \lstinline+\approx+\\ + \(\asymp\) \lstinline+\asymp+\\ + \(\bowtie\) \lstinline+\bowtie+\\ + \(\cong\) \lstinline+\cong+\\ + \(\dashv\) \lstinline+\dashv+\\ + \(\doteq\) \lstinline+\doteq+\\ + \(\equiv\) \lstinline+\equiv+\\ + \(\frown\) \lstinline+\frown+\\ + \(\geq\) \lstinline+\geq+\\ + \(\gg\) \lstinline+\gg+\\ + \(\in\) \lstinline+\in+\\ + \(\leq\) \lstinline+\leq+\\ + \(\ll\) \lstinline+\ll+\\ + \(\mid\) \lstinline+\mid+\\ + \(\models\) \lstinline+\models+\\ + \(\ne\) \lstinline+\ne+\\ + \(\ni\) \lstinline+\ni+\\ + \(\not\equiv\) \lstinline+\not\equiv+\\ + \(\notin\) \lstinline+\notin+\\ + \(\notin\) \lstinline+\notin+\\ + \(\perp\) \lstinline+\perp+\\ + \(\prec\) \lstinline+\prec+\\ + \(\preceq\) \lstinline+\preceq+\\ + \(\propto\) \lstinline+\propto+\\ + \(\sim\) \lstinline+\sim+\\ + \(\simeq\) \lstinline+\simeq+\\ + \(\smile\) \lstinline+\smile+\\ + \(\sqsubseteq\) \lstinline+\sqsubseteq+\\ + \(\sqsupseteq\) \lstinline+\sqsupseteq+\\ + \(\subset\) \lstinline+\subset+\\ + \(\subseteq\) \lstinline+\subseteq+\\ + \(\succ\) \lstinline+\succ+\\ + \(\succeq\) \lstinline+\succeq+\\ + \(\supset\) \lstinline+\supset+\\ + \(\supseteq\) \lstinline+\supseteq+\\ + \(\vdash\) \lstinline+\vdash+\\ + %\(\parallet\) \lstinline++\\ \end{multicols} \section{DELIMITADORES} \begin{multicols}{3} - \noindent - \((\!(\) \lstinline+(\!(+\\ - \((\) \lstinline+(+\\ - \()\!)\) \lstinline+)\!)+\\ - \()\) \lstinline+)+\\ - \([\![\) \lstinline+[\![+\\ - \(]\!]\) \lstinline+]\!]+\\ - \(\langle\!\langle\) \lstinline+\langle\!\langle+\\ - \(\langle\) \lstinline+\langle+\\ - \(\lbrace\) \lstinline+\lbrace+ ou \lstinline+\{+\\ - \(\lbrack\) \lstinline+\lbrack+\\ - \(\lceil\) \lstinline+\lceil+\\ - \(\lfloor\) \lstinline+\lfloor+\\ - \(\rangle\!\rangle\) \lstinline+\rangle\!\rangle+\\ - \(\rangle\) \lstinline+\rangle+\\ - \(\rbrace\) \lstinline+\rbrace+ ou \lstinline+\}+\\ - \(\rbrack\) \lstinline+\rbrack+\\ - \(\rceil\) \lstinline+\rceil+\\ - \(\rfloor\) \lstinline+\rfloor+\\ - \(\Vert\) \lstinline+\Vert+\\ - \(\vert\) \lstinline+\vert+\\ + \noindent + \((\!(\) \lstinline+(\!(+\\ + \((\) \lstinline+(+\\ + \()\!)\) \lstinline+)\!)+\\ + \()\) \lstinline+)+\\ + \([\![\) \lstinline+[\![+\\ + \(]\!]\) \lstinline+]\!]+\\ + \(\langle\!\langle\) \lstinline+\langle\!\langle+\\ + \(\langle\) \lstinline+\langle+\\ + \(\lbrace\) \lstinline+\lbrace+ ou \lstinline+\{+\\ + \(\lbrack\) \lstinline+\lbrack+\\ + \(\lceil\) \lstinline+\lceil+\\ + \(\lfloor\) \lstinline+\lfloor+\\ + \(\rangle\!\rangle\) \lstinline+\rangle\!\rangle+\\ + \(\rangle\) \lstinline+\rangle+\\ + \(\rbrace\) \lstinline+\rbrace+ ou \lstinline+\}+\\ + \(\rbrack\) \lstinline+\rbrack+\\ + \(\rceil\) \lstinline+\rceil+\\ + \(\rfloor\) \lstinline+\rfloor+\\ + \(\Vert\) \lstinline+\Vert+\\ + \(\vert\) \lstinline+\vert+\\ \end{multicols} \section{SETAS} \begin{multicols}{2} - \noindent - \(\Downarrow\) \lstinline+\Downarrow+\\ - \(\downarrow\) \lstinline+\downarrow+\\ - \(\hookleftarrow\) \lstinline+\hookleftarroq+\\ - \(\hookrightarrow\) \lstinline+\hookrightarrow+\\ - \(\Leftarrow\) \lstinline+\Leftarrow+\\ - \(\leftarrow\) \lstinline+\leftarrow+\\ - \(\leftrightarrow\) \lstinline+\leftrightarrow+\\ - \(\Leftrightarrow\) \lstinline+\Leftrightarrow+\\ - \(\Longleftarrow\) \lstinline+\Longleftarrow+\\ - \(\longleftarrow\) \lstinline+\longleftarrow+\\ - \(\longleftrightarrow\) \lstinline+\longleftrightarrow+\\ - \(\Longleftrightarrow\) \lstinline+\Longleftrightarrow+\\ - \(\longmapsto\) \lstinline+\longmapsto+\\ - \(\longrightarrow\) \lstinline+\longrightarrow+\\ - \(\Longrightarrow\) \lstinline+\Longrightarrow+\\ - \(\mapsto\) \lstinline+\mapsto+\\ - \(\nearrow\) \lstinline+\nearrow+\\ - \(\nwarrow\) \lstinline+\nwarrow+\\ - \(\rightarrow\) \lstinline+\rightarrow+\\ - \(\Rightarrow\) \lstinline+\Rightarrow+\\ - \(\searrow\) \lstinline+\searrow+\\ - \(\swarrow\) \lstinline+\swarrow+\\ - \(\Uparrow\) \lstinline+\Uparrow+\\ - \(\uparrow\) \lstinline+\uparrow+\\ - \(\updownarrow\) \lstinline+\updownarrow+\\ - \(\Updownarrow\) \lstinline+\Updownarrow+\\ + \noindent + \(\Downarrow\) \lstinline+\Downarrow+\\ + \(\downarrow\) \lstinline+\downarrow+\\ + \(\hookleftarrow\) \lstinline+\hookleftarroq+\\ + \(\hookrightarrow\) \lstinline+\hookrightarrow+\\ + \(\Leftarrow\) \lstinline+\Leftarrow+\\ + \(\leftarrow\) \lstinline+\leftarrow+\\ + \(\leftrightarrow\) \lstinline+\leftrightarrow+\\ + \(\Leftrightarrow\) \lstinline+\Leftrightarrow+\\ + \(\Longleftarrow\) \lstinline+\Longleftarrow+\\ + \(\longleftarrow\) \lstinline+\longleftarrow+\\ + \(\longleftrightarrow\) \lstinline+\longleftrightarrow+\\ + \(\Longleftrightarrow\) \lstinline+\Longleftrightarrow+\\ + \(\longmapsto\) \lstinline+\longmapsto+\\ + \(\longrightarrow\) \lstinline+\longrightarrow+\\ + \(\Longrightarrow\) \lstinline+\Longrightarrow+\\ + \(\mapsto\) \lstinline+\mapsto+\\ + \(\nearrow\) \lstinline+\nearrow+\\ + \(\nwarrow\) \lstinline+\nwarrow+\\ + \(\rightarrow\) \lstinline+\rightarrow+\\ + \(\Rightarrow\) \lstinline+\Rightarrow+\\ + \(\searrow\) \lstinline+\searrow+\\ + \(\swarrow\) \lstinline+\swarrow+\\ + \(\Uparrow\) \lstinline+\Uparrow+\\ + \(\uparrow\) \lstinline+\uparrow+\\ + \(\updownarrow\) \lstinline+\updownarrow+\\ + \(\Updownarrow\) \lstinline+\Updownarrow+\\ \end{multicols} \printindex @@ -1313,15 +1350,19 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de % \fi %<*class> \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{fei}[2020/07/26 4.10.1 Modelo da FEI] +\ProvidesClass{fei}[2021/05/26 4.10.2 Modelo da FEI] + +% cria a opção chave-valor font, com valor padrão times +\RequirePackage{kvoptions} +\DeclareStringOption[times]{font} % passa a opção draft para a classe \DeclareOption{draft}{ - \PassOptionsToClass{\CurrentOption}{memoir} + \PassOptionsToClass{\CurrentOption}{memoir} } % passa a opção final para a classe \DeclareOption{final}{ - \PassOptionsToClass{\CurrentOption}{memoir} + \PassOptionsToClass{\CurrentOption}{memoir} } %--------------------------------------------------------------- @@ -1330,18 +1371,23 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de \glossariesfalse % opção para configurar a lista de símbolos \DeclareOption{symbols}{ - \glossariestrue - \PassOptionsToPackage{\CurrentOption}{glossaries-extra} + \glossariestrue + \PassOptionsToPackage{\CurrentOption}{glossaries-extra} } % opção para configurar a lista de abreviaturas \DeclareOption{acronym}{ - \glossariestrue - \PassOptionsToPackage{\CurrentOption}{glossaries-extra} + \glossariestrue + \PassOptionsToPackage{\CurrentOption}{glossaries-extra} } % opção para configurar a lista de símbolos como um arquivo .bib \DeclareOption{record}{ - \glossariestrue - \PassOptionsToPackage{\CurrentOption}{glossaries-extra} + \glossariestrue + \PassOptionsToPackage{\CurrentOption}{glossaries-extra} +} +% opção para configurar a lista de símbolos como um arquivo .bib +\DeclareOption{abbr-shortcuts}{ + \glossariestrue + \PassOptionsToPackage{shortcuts=abbr}{glossaries-extra} } % opção para criar sub-listas de símbolos \newif\ifsublist @@ -1354,10 +1400,6 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de \depositofalse \DeclareOption{deposito}{\depositotrue} -\newif\ifarial -\DeclareOption{arial}{\arialtrue} -\DeclareOption{times}{\arialfalse} - \newif\ifnumeric \numericfalse \DeclareOption{numeric}{\numerictrue} @@ -1367,7 +1409,7 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de \DeclareOption{twoside}{\onesidefalse} \DeclareOption{backrefs}{% - \PassOptionsToPackage{backref}{biblatex}% + \PassOptionsToPackage{backref}{biblatex}% } \DeclareOption{algo-as-figure}{\PassOptionsToPackage{figure}{algorithm2e}}% @@ -1389,20 +1431,70 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de % processa opções-padrão % oneside é padrão na classe da FEI, apesar de twoside ser padrão na classe base, memoir -\ExecuteOptions{oneside,times} +\ExecuteOptions{oneside} -\ProcessOptions\relax % processa todas as opções +% processa todas as opções +\ProcessOptions\relax +\ProcessKeyvalOptions* + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% processa opções passadas como pares chave-valor +% essa técnica foi tirada daqui: https://tex.stackexchange.com/a/249102/30998 + +% fei é o nome do grupo de parâmetros criado pelo kvoptions +% font é o nome do parâmetro string que eu criei lá em cima +% o terceiro termo é o valor que o parâmetro pode assumir +\@namedef{fei@font@times}{% + \RequirePackage{newtxtext}% +} +\@namedef{fei@font@arial}{% + \RequirePackage[scaled]{uarial}% + \renewcommand*\familydefault{\sfdefault}% +} + +\@namedef{fei@font@arimo}{% + \RequirePackage[sfdefault]{arimo} +} + +% aqui avalia as opções +% serve pra mais do que font, basta implementar acima +\newcommand*{\fei@evaluate}[1]{% + % Check, if option value in \<prefix>@<option> exists + \@ifundefined{fei@#1}{% + % Should not happen + \PackageError{fei}{Evaluating unknown option `#1'}\@ehc + }{% + % Check, if there is an implementation for the value of the option + % in macro \<prefix>@<option>@<value> + \@ifundefined{fei@#1@\csname fei@#1\endcsname}{% + \PackageError{fei}{% + Unknown option setting: #1=% + \csname fei@#1\endcsname + }\@ehc + }{% + % Call the implementation for the value + \csname fei@#1@% + \csname fei@#1\endcsname + \endcsname + \relax + }% + }% +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% manda avaliar o comando font +\fei@evaluate{font} % depois de muitos erros tentando passar opções para a classe após carregá-la, a solução encontrada foi carregá-la com todas as opções de uma vez \ifoneside - \LoadClass[oneside]{memoir} + \LoadClass[oneside]{memoir} \else - \LoadClass{memoir} + \LoadClass{memoir} \fi \RequirePackage[utf8]{inputenc} % carrega idiomas e caracteres de saída de 8 bits \RequirePackage[T1]{fontenc} +\RequirePackage{microtype} \RequirePackage[english,brazil]{babel} \RequirePackage{csquotes} @@ -1473,13 +1565,6 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de \RequirePackage{lmodern} % Latin Modern, fontes tipográficas mais recentes que as do Knuth (Computer Modern) \RequirePackage{icomma} % vírgula como separador decimal -\ifarial - \usepackage[scaled]{uarial} - \renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif -\else - \RequirePackage{times} % usar fonte times no texto todo -\fi - \RequirePackage{graphicx} % figuras \RequirePackage{morewrites} % permite ao LaTeX escrever em mais de 16 arquivos auxiliares simultaneamente @@ -1517,11 +1602,11 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de % redefine lista de algoritmos \let\oldlistofalgorithms\listofalgorithms \renewcommand{\listofalgorithms}{{% - \setlength{\cftfigurenumwidth}{6.2em} % espaço onde a palavra "Algoritmo" é escrita - \renewcommand{\cftfigurepresnum}{Algoritmo } % escrita que precede cada entrada na lista - \renewcommand{\cftfigureaftersnum}{\hfill--\hfill} % traço na frente da escrita que precede as entradas na lista - \part*{\listalgorithmcfname}\pagestyle{empty}\@starttoc{loa}\cleardoublepage % titulo com formato padrão de todas as listas - }} + \setlength{\cftfigurenumwidth}{6.2em} % espaço onde a palavra "Algoritmo" é escrita + \renewcommand{\cftfigurepresnum}{Algoritmo } % escrita que precede cada entrada na lista + \renewcommand{\cftfigureaftersnum}{\hfill--\hfill} % traço na frente da escrita que precede as entradas na lista + \part*{\listalgorithmcfname}\pagestyle{empty}\@starttoc{loa}\cleardoublepage % titulo com formato padrão de todas as listas + }} % -------------------------------------------------------- % teoremas @@ -1529,12 +1614,12 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de \renewcommand{\listtheoremname}{Lista de Teoremas} % traduz nome da lista de teoremas \declaretheoremstyle[ - spaceabove=6pt, spacebelow=6pt, - headfont=\normalfont\bfseries, - notefont=\normalfont\bfseries, notebraces={-- }{}, - bodyfont=\normalfont, - postheadspace=1em - % qed=\qedsymbol + spaceabove=6pt, spacebelow=6pt, + headfont=\normalfont\bfseries, + notefont=\normalfont\bfseries, notebraces={-- }{}, + bodyfont=\normalfont, + postheadspace=1em + % qed=\qedsymbol ]{feistyle} % declaração dos principais tipos de teoremas que o usuário pode querer vir a usar @@ -1667,26 +1752,103 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de % divisoes do texto, formata o título de páginas como resumo, abstract, agradecimentos etc. \renewcommand{\part}{% - \@startsection{part}{-1}{0pt}{\baselineskip}{\baselineskip}{\cleardoublepage\fontsize{12pt}{14.4pt}\centering\bfseries\MakeUppercase}} - -% não há recuo no título de nenhum nível de nenhuma seção -% títulos dos capítulos são em negrito, maiúsculo e com distâncias de 1,5 cm do parágrafo que o sucede -\renewcommand{\chapter}{\cleardoublepage\pagestyle{plain}% - \@startsection{chapter}{0}{0pt}{\baselineskip}{\baselineskip}{\fontsize{12pt}{14.4pt}\bfseries}} + \@startsection{part}{-1}{0pt}{\baselineskip}{\baselineskip}{\cleardoublepage\fontsize{12pt}{14.4pt}\centering\bfseries\MakeUppercase}} + +% estilo para o cabeçalho dos chapters +\makechapterstyle{feichapter}{ + \renewcommand*{\afterchapternum}{\quad} + \renewcommand*{\afterchaptertitle}{\par\nobreak\vskip \afterchapskip} + \renewcommand*{\chapnamefont}{\chapnumfont} + \renewcommand*{\chapnumfont}{\normalfont\bfseries} + \renewcommand*{\chapterheadstart}{\pagestyle{plain}} + \renewcommand*{\chapternamenum}{} + \renewcommand*{\chaptitlefont}{\chapnumfont} + \renewcommand*{\printchaptername}{} + \renewcommand*{\printchapternonum}{} + \renewcommand*{\printchapternum}{\chapnumfont \thechapter\space} + \renewcommand{\printchaptertitle}[1]{\chaptitlefont\MakeUppercase{##1}} + \setlength{\afterchapskip}{\baselineskip} + \setlength{\beforechapskip}{0pt} + \setlength{\midchapskip}{0pt} +} -% demais níveis de seção possuem distância de 1,5 linhas do parágrafo sucessor e predecessor -\renewcommand{\section}{% - \@startsection{section}{1}{0pt}{\baselineskip}{\baselineskip}{\fontsize{12pt}{14.4pt}}} +\chapterstyle{feichapter} + +% estilo para cabeçalhos de apêndices e anexos, que também são chapters +\makechapterstyle{feiappendix}{% + % en-dash após número + \renewcommand*{\afterchapternum}{ -- } + % centraliza texto verticalmente e limpa o resto da página + \renewcommand*{\afterchaptertitle}{\hbox{}\vfill\clearpage} + % "Apêndice [número]" em negrito + \renewcommand*{\chapnamefont}{\normalfont\bfseries} + \renewcommand*{\chapnumfont}{\chapnamefont} + % inicia a página vazia e adiciona espaço vertical para centralizar o texto + \renewcommand*{\chapterheadstart}{\thispagestyle{empty}\hbox{}\vfill} + % Fonte normal, texto centralizado horizontalmente + \renewcommand*{\chaptitlefont}{\normalfont\centering} + % a palavra "Apêndice" na página de título, em maísculas + \renewcommand*{\printchaptername}{\chapnamefont\MakeUppercase{\@chapapp}} + % O título em si, que o usuário digita + \renewcommand{\printchaptertitle}[1]{\chaptitlefont\MakeUppercase{##1}} + % some com tudo isso, já que o espaçamento é feito com centering e vfill + \setlength{\afterchapskip}{0pt} + \setlength{\beforechapskip}{0pt} + \setlength{\midchapskip}{0pt} +} -\renewcommand{\subsection}{% - \@startsection{subsection}{2}{0pt}{\baselineskip}{\baselineskip}{\fontsize{12pt}{14.4pt}\bfseries}} +\appto\appendix{% + % use o estilo criado acima para a página de abertura de um apêndice + \chapterstyle{feiappendix}% + % não numera nada abaixo de chapter nos apêndices + \setsecnumdepth{chapter}% + % hack do egreg para mudar o que é escrito antes do título do apêndice no sumário + % https://tex.stackexchange.com/a/34285/30998 + \addtocontents{toc}{\protect\reformchapapp}% +} -\renewcommand{\subsubsection}{% - \@startsection{subsubsection}{3}{0pt}{\baselineskip}{\baselineskip}{\fontsize{12pt}{14.4pt}\bfseries\itshape}} +% esse comando é adicionado no arquivo .toc assim que o comando \appendix é chamado +\newcommand{\reformchapapp}{% + % não adiciona nada abaixo de chapter no sumário, depois que começam os apêndices + \setcounter{tocdepth}{0}% + % esse é o comando que insere o número do capítulo no sumário, antes do nome do apêndice + % eu coloco um espaço em branco e escrevo APÊNDICE [NÚMERO] -- " + % [NÚMERO] é formatado em alfabético automaticamente pelo memoir, na definição deles de \appendix + \renewcommand{\chapternumberline}[1]{\hspace{\cftchapternumwidth}\MakeUppercase{\appendixname}\ ##1 -- }% +} -\renewcommand{\paragraph}{% - \@startsection{paragraph}{4}{0pt}{\baselineskip}{\baselineskip}{\fontsize{12pt}{14.4pt}\itshape}} +% anexo (funciona da mesma forma do apendice, soh alterando os nomes) +\newcommand{\anexos}{% + \chapterstyle{feiappendix} + \renewcommand{\cftchaptername}{Anexo\space} + \renewcommand{\chaptername}{Anexo}% + \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} + \setcounter{chapter}{0} + \renewcommand{\thechapter}{\Alph{chapter}}% + \renewcommand{\chapter}[1]{% + \stepcounter{chapter}% + \cleardoublepage\phantomsection\thispagestyle{empty}\mbox{}\vfill\begin{center}\MakeUppercase{\textbf{ANEXO \thechapter\ --} ##1}\end{center}\vfill% + \phantomsection% + \addcontentsline{toc}{chapter}{\hspace{\cftchapternumwidth}ANEXO \Alph{chapter} -- ##1}% + \newpage% + }% +}% +% fontes para cabeçalhos das demais seções +\setsecheadstyle{\normalfont\MakeUppercase} +\setsubsecheadstyle{\normalfont\bfseries} +\setsubsubsecheadstyle{\normalfont\bfseries\itshape} +\setparaheadstyle{\normalfont\itshape} + +% espaçamento após cabeçalhos das seções +\setaftersecskip{\baselineskip} +\setaftersubsecskip{\baselineskip} +\setaftersubsubsecskip{\baselineskip} +\setafterparaskip{\baselineskip} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% TABLE OF CONTENTS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \setcounter{secnumdepth}{4} % numerar divisões até o quarto nível (paragraph) \setcounter{tocdepth}{4} % incluir divisões no sumário até o quarto nível (paragraph) @@ -1698,28 +1860,31 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de \renewcommand{\cftparagraphindent}{0pt} % espaçamento igual para a numeração de todos os níveis, causando alinhamento proposital -\renewcommand{\cftchapternumwidth}{4em} -\renewcommand{\cftsectionnumwidth}{4em} -\renewcommand{\cftsubsectionnumwidth}{4em} -\renewcommand{\cftsubsubsectionnumwidth}{4em} -\renewcommand{\cftparagraphnumwidth}{4em} +\newlength{\tocnumwidth} +\setlength{\tocnumwidth}{4em} +\renewcommand{\cftchapternumwidth}{\tocnumwidth} +\renewcommand{\cftsectionnumwidth}{\tocnumwidth} +\renewcommand{\cftsubsectionnumwidth}{\tocnumwidth} +\renewcommand{\cftsubsubsectionnumwidth}{\tocnumwidth} +\renewcommand{\cftparagraphnumwidth}{\tocnumwidth} \renewcommand{\cftbeforechapterskip}{0pt} % remove recuo antes de entradas de capítulos no sumário -% formatação dos títulos de seções. perceba que não há suporte para títulos com letras maiúsculas quando se usa hyperref -% ou seja, as linhas abaixo não funcionam -% \renewcommand{\cftchapterfont}{\bfseries} % coloca o titulo de capítulos em negrito e maiusculo +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% O PROBLEMA MILENAR: ENTRADAS EM MAIÚSCULAS NO SUMÁRIO +% https://tex.stackexchange.com/a/399861 + +% não há suporte para títulos com letras maiúsculas quando se usa hyperref +% ou seja, a linha abaixo não funcionam % \renewcommand{\cftsectionfont}{\MakeTextUppercase} % titulo de seções em maiusculo -% o hack abaixo é mencionado no manual de memoir, mas não funcionou também, então é ponto pro LaTeX por enquanto... -% \settocpreprocessor{chapter}{% -% \let\tempf@rtoc\f@rtoc% -% \def\f@rtoc{% -% \texorpdfstring{\MakeTextUppercase{% -% \tempf@rtoc}% -% }{\tempf@rtoc}% -% }% -% } +% o hack abaixo é mencionado no manual de memoir, mas só funciona com chapter e não com outros elementos de mesmo nível... +\settocpreprocessor{chapter}{% + \let\tempf@rtoc\f@rtoc% + \def\f@rtoc{% + \texorpdfstring{\MakeTextUppercase{\tempf@rtoc}}{\tempf@rtoc}}% +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \renewcommand{\cftchapterfont}{\bfseries} % coloca o titulo de capítulos em negrito \renewcommand{\cftsubsectionfont}{\bfseries} % coloca o titulo das secoes em negrito @@ -1749,53 +1914,56 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de \renewcommand{\listoftables}{\part*{\listtablename}\pagestyle{empty}\@starttoc{lot}\cleardoublepage} \renewcommand{\listoffigures}{\part*{\listfigurename}\pagestyle{empty}\@starttoc{lof}\cleardoublepage} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % redefinindo listas de algoritmos e teoremas para formatar os títulos das % páginas e adicionar 'algoritmo' e 'teorema' antes dos números de cada entrada % das listas \renewcommand{\listoftheorems}{\begingroup% - \let\oldnumberline\numberline% - \renewcommand{\numberline}{Teorema~\oldnumberline}% - \part*{\listtheoremname}\thispagestyle{empty}\@starttoc{loe}\cleardoublepage\endgroup} + \let\oldnumberline\numberline% + \renewcommand{\numberline}{Teorema~\oldnumberline}% + \part*{\listtheoremname}\thispagestyle{empty}\@starttoc{loe}\cleardoublepage\endgroup} \def\and{\\} % modifica função do comando \and para ele ser usado na declaração de múltiplos autores % novas paginas % capa \renewcommand{\maketitle}{% - \pagestyle{empty}% - \begin{center}% - \MakeUppercase{\@instituicao}\\[0.5em]% - \uppercase\expandafter{\@author}% - \vfill% - \textbf{\MakeUppercase{\@title}}\ifthenelse{\isundefined{\@subtitulo}}{}{: \@subtitulo}% - \vfill% - \@cidade\\[0.5em]% - \number\year% - \end{center}% - \cleardoublepage + \pagestyle{empty}% + \begin{center}% + \MakeUppercase{\@instituicao}\\[0.5em]% + \uppercase\expandafter{\@author}% + \vfill% + \textbf{\MakeUppercase{\@title}}\ifthenelse{\isundefined{\@subtitulo}}{}{: \@subtitulo}% + \vfill% + \@cidade\\[0.5em]% + \number\year% + \end{center}% + \cleardoublepage } % folha de rosto \newenvironment{folhaderosto}{ - \setcounter{page}{1} - \thispagestyle{empty} - \begin{center} - \uppercase\expandafter{\@author}\\ - \vspace*{0.45\textheight} - \textbf{\MakeUppercase{\@title}}\ifthenelse{\isundefined{\@subtitulo}}{}{: \@subtitulo} - \vfill - \begin{flushright} - \begin{minipage}{\textwidth - 8cm} - \normalsize - \begin{SingleSpace} - }{\end{SingleSpace}\end{minipage}{} - \end{flushright} - \vfill - \@cidade\\[0.5em] - \number\year - \end{center}% - \clearpage + \setcounter{page}{1} + \thispagestyle{empty} + \begin{center} + \uppercase\expandafter{\@author}\\ + \vspace*{0.45\textheight} + \textbf{\MakeUppercase{\@title}}\ifthenelse{\isundefined{\@subtitulo}}{}{: \@subtitulo} + \vfill + \begin{flushright} + \begin{minipage}{\textwidth - 8cm} + \normalsize + \begin{SingleSpace} + }{\end{SingleSpace}\end{minipage}{} + \end{flushright} + \vfill + \@cidade\\[0.5em] + \number\year + \end{center}% + \clearpage } % folha de aprovação: deixa um texto no lugar falando que pagina é essa @@ -1803,25 +1971,25 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de \RequirePackage{pdfpages} \RequirePackage{ifthen} \newcommand{\folhadeaprovacao}{ - \ifdeposito - \includepdf{ata.pdf}\cleardoublepage - \else - \thispagestyle{empty}\mbox{}\vfill\begin{center}\begin{Huge}Folha de aprova\c{c}\~{a}o\end{Huge}\vfill\end{center}\cleardoublepage - \fi + \ifdeposito + \includepdf{ata.pdf}\cleardoublepage + \else + \thispagestyle{empty}\mbox{}\vfill\begin{center}\begin{Huge}Folha de aprova\c{c}\~{a}o\end{Huge}\vfill\end{center}\cleardoublepage + \fi } % ficha catalográfica: funciona da mesma forma da folha de aprovação, só que procura o arquivo *ficha.pdf* \newcommand{\fichacatalografica}{ - \if@twoside - \else - % se não for frente e verso, a ficha catalográfica não é contada no verso da folha de rosto - \addtocounter{page}{-1} - \fi - \ifdeposito - \includepdf{ficha.pdf}\cleardoublepage - \else - \thispagestyle{empty}\mbox{}\vfill\begin{center}\begin{Huge}Ficha catalogr\'{a}fica\end{Huge}\vfill\end{center}\cleardoublepage - \fi + \if@twoside + \else + % se não for frente e verso, a ficha catalográfica não é contada no verso da folha de rosto + \addtocounter{page}{-1} + \fi + \ifdeposito + \includepdf{ficha.pdf}\cleardoublepage + \else + \thispagestyle{empty}\mbox{}\vfill\begin{center}\begin{Huge}Ficha catalogr\'{a}fica\end{Huge}\vfill\end{center}\cleardoublepage + \fi } % subtítulo @@ -1846,50 +2014,50 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de % dedicatória \newcommand{\dedicatoria}[1]{ - \cleardoublepage - \thispagestyle{empty} - \vspace*{\fill} - \begin{flushright} - \begin{minipage}[t][0.5\textheight][c]{0.5\textwidth} - #1 - \end{minipage} - \end{flushright} + \cleardoublepage + \thispagestyle{empty} + \vspace*{\fill} + \begin{flushright} + \begin{minipage}[t][0.5\textheight][c]{0.5\textwidth} + #1 + \end{minipage} + \end{flushright} } -\newenvironment{epigrafe}{\cleardoublepage\pagestyle{empty}\vspace*{\fill}}{\pagestyle{plain}} +\newenvironment{epigrafe}{\cleardoublepage\thispagestyle{empty}\vspace*{\fill}}{} \newcommand{\epig}[2]{ - \vspace{2\baselineskip} - \begin{flushright} - \begin{minipage}[t]{0.5\textwidth} - ``{#1}'' - \begin{flushright} - #2 - \end{flushright} - \end{minipage} - \end{flushright} + \vspace{2\baselineskip} + \begin{flushright} + \begin{minipage}[t]{0.5\textwidth} + ``{#1}'' + \begin{flushright} + #2 + \end{flushright} + \end{minipage} + \end{flushright} } % resumo -\newenvironment{resumo}{\part*{Resumo}\pagestyle{empty}}{\cleardoublepage\pagestyle{plain}\setlength{\parindent}{1.25cm}} +\newenvironment{resumo}{\part*{Resumo}\pagestyle{empty}}{\cleardoublepage\setlength{\parindent}{1.25cm}} % abstract -\renewenvironment{abstract}{\selectlanguage{english}\part*{Abstract}\pagestyle{empty}\setlength{\parindent}{1.25cm}}{\cleardoublepage\pagestyle{plain}\selectlanguage{brazil}} +\renewenvironment{abstract}{\selectlanguage{english}\part*{Abstract}\pagestyle{empty}\setlength{\parindent}{1.25cm}}{\cleardoublepage\selectlanguage{brazil}} % agradecimentos -\newenvironment{agradecimentos}{\part*{Agradecimentos}\pagestyle{empty}}{\cleardoublepage\pagestyle{plain}} +\newenvironment{agradecimentos}{\part*{Agradecimentos}\pagestyle{empty}}{\cleardoublepage} % índice \RequirePackage[xindy]{imakeidx} \indexsetup{level=\part*} \addto\captionsbrazil{% - \renewcommand{\indexname}{\'Indice}% + \renewcommand{\indexname}{\'Indice}% } \let\oldprintindex\printindex \renewcommand{\printindex}{\clearpage\phantomsection\addcontentsline{toc}{chapter}{\hspace{\cftchapternumwidth}\'INDICE}% - \renewcommand{\chapter}{% - \@startsection{chapter}{0}{0pt}{0pt}{1.5cm}{\clearpage\fontsize{12pt}{14.4pt}\bfseries\MakeUppercase}}% - \oldprintindex% + \renewcommand{\chapter}{% + \@startsection{chapter}{0}{0pt}{0pt}{1.5cm}{\clearpage\fontsize{12pt}{14.4pt}\bfseries\MakeUppercase}}% + \oldprintindex% }% % antigamente, aqui era carregado o pacote hyperref. @@ -1898,16 +2066,19 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de % em teoria, o pacote hyperref deveria ser o último a ser carregado, porém % funcionou posicionado antes do glossaries, possibilitando links das variaveis para lista de simbolos \ifpdfa - \RequirePackage[a-1b]{pdfx} + \RequirePackage[a-1b]{pdfx} \else - \RequirePackage{hyperref} + \RequirePackage{hyperref} \fi % o pacote pdfx carrega o hyperref, então as opções do hyperref são passadas assim agora \hypersetup{% - pdftex,% - pdfborder={0 0 0},% - colorlinks={false}% + pdftex,% + pdfborder={0 0 0},% + colorlinks={false},% + % cria "bookmarks" no PDF até o 4° nível, + % independente do valor de tocdepth, que eu mudo em alguns lugares + bookmarksdepth=4% } % pacote para gerar listas (símbolos, abreviaturas, etc) @@ -1915,116 +2086,90 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de % para uma explicação melhor do motivo de se usar glossaries-extra, % este foi o problema que eu resolvi com ele: https://tex.stackexchange.com/a/77561/30998 \ifglossaries - \ifsublist - \RequirePackage[xindy,nomain,nonumberlist,section=part]{glossaries-extra} - % estilo usado como base - \setglossarystyle{alttree} - % Configuracao de identacao do nivel 0 (titulos) - \glssetwidest[0]{} - % Configuracao de identacao do nivel 1 (a lista de simbolos em si) - \glssetwidest[1]{aaaaaaaaaaaa} - - % remove número de página das listas de símbolos e abreviaturas (executado na primeira página) - \renewcommand*{\glossarypreamble}{\thispagestyle{empty}\pagestyle{empty}\vspace*{-2\baselineskip}} - - \else - \RequirePackage[xindy,nomain,nonumberlist,section=part,nogroupskip]{glossaries-extra} - - \newglossarystyle{mylong}{% - \setglossarystyle{long}% base this style on the long style - \renewenvironment{theglossary}{% - \begin{longtable*}{lp{\glsdescwidth}}}% - {\end{longtable*}}% - }% - - \setglossarystyle{mylong} - \setlength\LTleft{0pt} - \setlength\LTright{0pt} - \setlength\glsdescwidth{\linewidth} - - % remove número de página das listas de símbolos e abreviaturas (executado na primeira página) - \renewcommand*{\glossarypreamble}{\thispagestyle{empty}\pagestyle{empty}} - \fi - % traduz alguns comandos próprios do glossaries - \addto\captionsbrazil{% - \renewcommand*{\acronymname}{Lista de Abreviaturas}% - \renewcommand*{\glssymbolsgroupname}{Lista de S\'imbolos}} - - % redefine comandos do glossaries - % remove número de página das listas de símbolos e abreviaturas (executado nas demais páginas) - \renewcommand*{\glsclearpage}{\pagestyle{empty}} - % remove número de página das listas de símbolos e abreviaturas (executado na última página) - \renewcommand*{\glossarypostamble}{\pagestyle{empty}\cleardoublepage} - % estilo das abreviaturas que permite imprimir a tradução de uma abreviatura em idioma estrangeiro - \setabbreviationstyle[acronym]{long-short-user} - % listas de simbolos e abreviaturas nao aparecem no sumario - \glstocfalse - - % \glscurrentfieldvalue only works with glossaries v4.23 (and above) - \renewcommand{\glsxtrpostdescacronym}{% - \ifglshasfield{\glsxtruserfield}{\glscurrententrylabel}% - { (\glscurrentfieldvalue)}% - {}% - } + \ifsublist + \RequirePackage[xindy,nomain,nonumberlist,section=part]{glossaries-extra} + % estilo usado como base + \setglossarystyle{alttree} + % Configuracao de identacao do nivel 0 (titulos) + \glssetwidest[0]{} + % Configuracao de identacao do nivel 1 (a lista de simbolos em si) + \glssetwidest[1]{aaaaaaaaaaaa} + + % remove número de página das listas de símbolos e abreviaturas (executado na primeira página) + \renewcommand*{\glossarypreamble}{\thispagestyle{empty}\pagestyle{empty}\vspace*{-2\baselineskip}} + + \else + \RequirePackage[xindy,nomain,nonumberlist,section=part,nogroupskip]{glossaries-extra} + + \newglossarystyle{mylong}{% + \setglossarystyle{long}% base this style on the long style + \renewenvironment{theglossary}{% + \begin{longtable*}{lp{\glsdescwidth}}}% + {\end{longtable*}}% + }% + + \setglossarystyle{mylong} + \setlength\LTleft{0pt} + \setlength\LTright{0pt} + \setlength\glsdescwidth{\linewidth} + + % remove número de página das listas de símbolos e abreviaturas (executado na primeira página) + \renewcommand*{\glossarypreamble}{\thispagestyle{empty}\pagestyle{empty}} + \fi + % traduz alguns comandos próprios do glossaries + \addto\captionsbrazil{% + \renewcommand*{\acronymname}{Lista de Abreviaturas}% + \renewcommand*{\glssymbolsgroupname}{Lista de S\'imbolos}% + } + + % redefine comandos do glossaries + % remove número de página das listas de símbolos e abreviaturas (executado nas demais páginas) + \renewcommand*{\glsclearpage}{\pagestyle{empty}} + % remove número de página das listas de símbolos e abreviaturas (executado na última página) + \renewcommand*{\glossarypostamble}{\pagestyle{empty}\cleardoublepage} + % estilo das abreviaturas que permite imprimir a tradução de uma abreviatura em idioma estrangeiro + \setabbreviationstyle[acronym]{long-short-user} + % listas de simbolos e abreviaturas nao aparecem no sumario + \glstocfalse + + % \glscurrentfieldvalue only works with glossaries v4.23 (and above) + \renewcommand{\glsxtrpostdescacronym}{% + \ifglshasfield{\glsxtruserfield}{\glscurrententrylabel}% + { (\glscurrentfieldvalue)}% + {}% + } \fi \addto\captionsbrazil{% - \renewcommand*{\listfigurename}{Lista de Ilustra\c{c}\~oes}% - \renewcommand*{\contentsname}{Sum\'ario}}% + \renewcommand*{\listfigurename}{Lista de Ilustra\c{c}\~oes}% + \renewcommand*{\contentsname}{Sum\'ario}}% \newcommand{\palavraschave}[1]{\mbox{}\\\noindent Palavras-chave: #1}% o resumo pede palavras chave no final \newcommand{\keywords}[1]{\mbox{}\\\noindent Keywords: #1}% mesma coisa, mas pro abstract -% apendice novo -\renewcommand{\appendix}{% - \renewcommand{\chaptername}{\appendixname}% - \setcounter{chapter}{0}% zera o contador do capítulo - \renewcommand{\thechapter}{\Alph{chapter}}% deixa o contador do capítulo em alfabético - \renewcommand{\chapter}[1]{% redefine o comando do capítulo - \stepcounter{chapter}% soma 1 ao contador do capítulo - \cleardoublepage\phantomsection\thispagestyle{empty}\mbox{}\vfill\begin{center}\MakeUppercase{\textbf{AP\^ENDICE \thechapter\ --} ##1}\end{center}\vfill% adiciona uma folha com a letra e título do apêndice - \addcontentsline{toc}{chapter}{\hspace{\cftchapternumwidth}AP\^ENDICE \Alph{chapter} -- ##1}% - \newpage% - }% -}% - -% anexo (funciona da mesma forma do apendice, soh alterando os nomes) -\newcommand{\anexos}{% - \renewcommand{\chaptername}{Anexo}% - \setcounter{chapter}{0}% - \renewcommand{\thechapter}{\Alph{chapter}}% - \renewcommand{\chapter}[1]{% - \stepcounter{chapter}% - \cleardoublepage\phantomsection\thispagestyle{empty}\mbox{}\vfill\begin{center}\MakeUppercase{\textbf{ANEXO \thechapter\ --} ##1}\end{center}\vfill% - \phantomsection% - \addcontentsline{toc}{chapter}{\hspace{\cftchapternumwidth}ANEXO \Alph{chapter} -- ##1}% - \newpage% - }% -}% - % referências e citações % abnTeX alfabético com títulos das publicações em negrito nas referências (como no modelo antigo da ABNT) \ifnumeric - \RequirePackage[backend=biber, - safeinputenc=true, - uniquelist=false, - doi=true, - repeatfields=true, - style=abnt-numeric]{biblatex} + \RequirePackage[backend=biber, + safeinputenc=true, + uniquelist=false, + doi=true, + repeatfields=true, + style=abnt-numeric]{biblatex} \else - \RequirePackage[backend=biber, - safeinputenc=true, - uniquelist=false, - doi=true, - repeatfields=true, - style=abnt]{biblatex} + \RequirePackage[backend=biber, + safeinputenc=true, + uniquelist=false, + doi=true, + repeatfields=true, + style=abnt]{biblatex} \fi \setlength{\bibitemsep}{1.0\baselineskip} \DefineBibliographyStrings{brazil}{% - bibliography = {REFER\^ENCIAS} + bibliography = {REFER\^ENCIAS} } % ############################################################################### @@ -2036,16 +2181,16 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de % Citações: https://github.com/abntex/biblatex-abnt/blob/master/latex/cbx/abnt.cbx % Strings literais: https://github.com/abntex/biblatex-abnt/blob/master/latex/lbx/brazilian-abnt.lbx % ############################################################################### -% + % remove <> das URLs (para a versão de 2019 da classe) -% \DeclareFieldFormat{url}{\bibstring{urlfrom}\addcolon\addspace\url{#1}} % +\DeclareFieldFormat{url}{\bibstring{urlfrom}\addcolon\addspace\url{#1}} % \let\oldprintbibliography\printbibliography \renewcommand{\printbibliography}{% - \linespread{1} - \oldprintbibliography - \linespread{1.5} + \linespread{1} + \oldprintbibliography + \linespread{1.5} } \newcommand{\citeonline}[1]{\textcite{#1}} @@ -2055,9 +2200,9 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de % \renewcommand*{\bibfont}{\raggedright} \defbibheading{bibliography}[\bibname]{% - \clearpage\phantomsection\addcontentsline{toc}{chapter}{\bfseries\hspace{\cftchapternumwidth}REFER\^ENCIAS}% adiciona o titulo ao sumario - \part*{REFER\^ENCIAS} - \urlstyle{same}% URLs nas referências devem ter a mesma fonte do texto + \clearpage\phantomsection\addcontentsline{toc}{chapter}{\bfseries\hspace{\cftchapternumwidth}REFER\^ENCIAS}% adiciona o titulo ao sumario + \part*{REFER\^ENCIAS} + \urlstyle{same}% URLs nas referências devem ter a mesma fonte do texto } % mantido para fins de compatibilidade com a versão 2 e 3 da classe @@ -2066,19 +2211,19 @@ A seguir, as descrições dos arquivos auxiliares gerados durante o processo de % modifica ambiente quote para citações de um parágrafo com mais de 3 linhas \renewenvironment{quote} {\begin{flushright} - \begin{minipage}{\textwidth - 4cm} - \fontsize{10pt}{1em} - \begin{SingleSpace} - }{\end{SingleSpace}\end{minipage}{} - \end{flushright}} + \begin{minipage}{\textwidth - 4cm} + \fontsize{10pt}{1em} + \begin{SingleSpace} + }{\end{SingleSpace}\end{minipage}{} + \end{flushright}} % quotation é igual a quote, porém para citações com mais de um parágrafo. \renewenvironment{quotation} {\begin{center} - \begin{minipage}{\textwidth - 4cm} - \fontsize{10pt}{1em} - \begin{SingleSpace}\setlength{\parindent}{1cm} - }{\end{SingleSpace}\end{minipage}{} -\end{center}} + \begin{minipage}{\textwidth - 4cm} + \fontsize{10pt}{1em} + \begin{SingleSpace}\setlength{\parindent}{1cm} + }{\end{SingleSpace}\end{minipage}{} + \end{center}} %</class> diff --git a/macros/latex/contrib/fei/fei.pdf b/macros/latex/contrib/fei/fei.pdf Binary files differindex a3eb94f92e..2c7c9b92a8 100644 --- a/macros/latex/contrib/fei/fei.pdf +++ b/macros/latex/contrib/fei/fei.pdf diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md index 0ff02b0443..f91a3e17e4 100644 --- a/macros/latex/contrib/siunitx/CHANGELOG.md +++ b/macros/latex/contrib/siunitx/CHANGELOG.md @@ -7,6 +7,16 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ## [Unreleased] +## [v3.0.7] + +### Fixed +- Formatting of some literal units (issue #449) +- Issue a warning for removed option `load-configurations` + (issue #455) +- Printing of `\times` and `\cdot` in text mode when using a + locale (issue #457) +- Implement missing `output-exponent-marker` (issue #458) + ## [v3.0.6] ### Changed @@ -1312,7 +1322,8 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ### Added - First public testing release (as `si`) -[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.6...HEAD +[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.7...HEAD +[v3.0.7]: https://github.com/josephwright/siunitx/compare/v3.0.6...v3.0.7 [v3.0.6]: https://github.com/josephwright/siunitx/compare/v3.0.5...v3.0.6 [v3.0.5]: https://github.com/josephwright/siunitx/compare/v3.0.4...v3.0.5 [v3.0.4]: https://github.com/josephwright/siunitx/compare/v3.0.3...v3.0.4 diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf Binary files differindex ec731faa3f..09c3c9538d 100644 --- a/macros/latex/contrib/siunitx/siunitx-code.pdf +++ b/macros/latex/contrib/siunitx/siunitx-code.pdf diff --git a/macros/latex/contrib/siunitx/siunitx-emulation.dtx b/macros/latex/contrib/siunitx/siunitx-emulation.dtx index 48648e3c13..dc2e9f9035 100644 --- a/macros/latex/contrib/siunitx/siunitx-emulation.dtx +++ b/macros/latex/contrib/siunitx/siunitx-emulation.dtx @@ -125,7 +125,13 @@ % \subsection{Load-time option} % % \begin{macrocode} -\clist_map_inline:nn { abbreviations , binary-units , version-1-compatibility } +\clist_map_inline:nn + { + abbreviations , + binary-units , + load-configurations , + version-1-compatibility + } { \keys_define:nn { siunitx } { #1 .code:n = \@@_option_removed:n {#1} } } diff --git a/macros/latex/contrib/siunitx/siunitx-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx index 22fff7cdb9..cfbff37d9c 100644 --- a/macros/latex/contrib/siunitx/siunitx-number.dtx +++ b/macros/latex/contrib/siunitx/siunitx-number.dtx @@ -2860,6 +2860,7 @@ % \l_@@_group_minimum_int , % \l_@@_group_separator_tl , % \l_@@_negative_color_tl , +% \l_@@_output_exp_marker_tl , % \l_@@_output_uncert_close_tl , % \l_@@_output_uncert_open_tl , % \l_@@_uncert_mode_tl , @@ -2912,6 +2913,8 @@ \l_@@_output_uncert_close_tl , output-decimal-marker .tl_set:N = \l_siunitx_number_output_decimal_tl , + output-exponent-marker .tl_set:N = + \l_@@_output_exp_marker_tl , output-open-uncertainty .tl_set:N = \l_@@_output_uncert_open_tl , print-implicit-plus .bool_set:N = @@ -2980,7 +2983,13 @@ % \@@_output_uncert_S_compact-marker:nn , % \@@_output_uncert_S_full:nn % } -% \begin{macro}[rEXP]{\@@_output_exponent:nnnn} +% \begin{macro}[rEXP] +% { +% \@@_output_exponent:nnnn , +% \@@_output_exponent_auxi:nnnn , +% \@@_output_exponent_auxii:nnnn +% } +% \begin{macro}[rEXP]{\@@_output_exponent_auxiii:nn} % \begin{macro}[rEXP]{\@@_output_end:} % The approach to formatting a single number is to split into % the constituent parts. All of the parts are assembled including @@ -3371,31 +3380,46 @@ { \l_@@_zero_exponent_bool } { ! \str_if_eq_p:nn {#2} { 0 } } { - \bool_lazy_and:nnTF - { \str_if_eq_p:nn {#3} { 1. } } - { ! \l_@@_unity_mantissa_bool } - { \exp_not:n {#4} } - { - \bool_if:NTF \l_@@_tight_bool - { \exp_not:N \mathord } - { \use:n } - { \exp_not:V \l_@@_exponent_product_tl } - \exp_not:n {#4} - } - \exp_not:V \l_@@_exponent_base_tl - ^ - { - \tl_if_blank:nTF {#1} - { - \bool_if:NT \l_@@_implicit_plus_bool - { \@@_output_sign:N + } - } - { \@@_output_sign:N #1 } - \@@_output_digits:nn { integer } {#2} - } + \tl_if_empty:NTF \l_@@_output_exp_marker_tl + { \@@_output_exponent_auxi:nnnn } + { \@@_output_exponent_auxii:nnnn } + {#1} {#2} {#3} {#4} } { \exp_not:n {#4} } } +\cs_new:Npn \@@_output_exponent_auxi:nnnn #1#2#3#4 + { + \bool_lazy_and:nnTF + { \str_if_eq_p:nn {#3} { 1. } } + { ! \l_@@_unity_mantissa_bool } + { \exp_not:n {#4} } + { + \bool_if:NTF \l_@@_tight_bool + { \exp_not:N \mathord } + { \use:n } + { \exp_not:V \l_@@_exponent_product_tl } + \exp_not:n {#4} + } + \exp_not:V \l_@@_exponent_base_tl + ^ + { \@@_output_exponent_auxiii:nn {#1} {#2} } + } +\cs_new:Npn \@@_output_exponent_auxii:nnnn #1#2#3#4 + { + \exp_not:n {#4} + \exp_not:V \l_@@_output_exp_marker_tl + \@@_output_exponent_auxiii:nn {#1} {#2} + } +\cs_new:Npn \@@_output_exponent_auxiii:nn #1#2 + { + \tl_if_blank:nTF {#1} + { + \bool_if:NT \l_@@_implicit_plus_bool + { \@@_output_sign:N + } + } + { \@@_output_sign:N #1 } + \@@_output_digits:nn { integer } {#2} + } % \end{macrocode} % A do-nothing marker used to allow shuffling of the output and so expandable % operations for formatting. @@ -3437,6 +3461,7 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \subsection{Miscellaneous tools} % diff --git a/macros/latex/contrib/siunitx/siunitx-print.dtx b/macros/latex/contrib/siunitx/siunitx-print.dtx index cc26177ef1..15d4452055 100644 --- a/macros/latex/contrib/siunitx/siunitx-print.dtx +++ b/macros/latex/contrib/siunitx/siunitx-print.dtx @@ -78,8 +78,8 @@ % also required to provide the functionality detailed. % \begin{itemize} % \item \pkg{color}: support for color using \cs{textcolor} -% \item \pkg{textcomp}: \cs{textminus} and \cs{textpm} for printing -% in text mode +% \item \pkg{textcomp}: \cs{textminus}, \cs{textpm} \cs{texttimes} and +% \cs{textcenteredperiod} for printing in text mode % \item \pkg{amstext}: the \cs{text} command for printing in text mode % \end{itemize} % For detection of math mode fonts, as well as \cs{mathrm}, the existence of @@ -779,6 +779,10 @@ { \exp_not:n { \ensuremath { \mp } } } - { \exp_not:N \textminus } + \exp_not:N \times + { \exp_not:N \texttimes } + \exp_not:N \cdot + { \exp_not:N \textperiodcentered } \char_generate:nn { `\_ } { 8 } { \exp_not:N \@@_text_sub:n } ^ diff --git a/macros/latex/contrib/siunitx/siunitx-symbol.dtx b/macros/latex/contrib/siunitx/siunitx-symbol.dtx index a517c4e34f..8ba65fc417 100644 --- a/macros/latex/contrib/siunitx/siunitx-symbol.dtx +++ b/macros/latex/contrib/siunitx/siunitx-symbol.dtx @@ -253,62 +253,6 @@ } % \end{macrocode} % -% For the times symbol, only \LuaTeX{} allows us to use the math mode symbol -% directly. However, that likely won't follow the surrounding font appearance, -% so in all cases we use the |TS1| version for text. Otherwise much the -% same as |\textmu| support. It's hard to check for the product symbol, so -% we just go with it an hope for the best! -% \begin{macrocode} -\keys_set:nn { siunitx } - { product-symbol = \ifmmode \times \else \texttimes \fi } -\AtBeginDocument - { - \group_begin: - \tl_set:Nn \l_@@_tmpa_tl - { { } { } { 2 } { } { } { } { 1 } } - \tl_set:Nx \l_@@_tmpa_tl - { \siunitx_number_output:N \l_@@_tmpa_tl } - \tl_set:Nn \l_@@_tmpb_tl { 2 \times 10 ^ { 1 } } - \tl_if_eq:NNTF \l_@@_tmpa_tl \l_@@_tmpb_tl - { - \group_end: - \keys_set:nn { siunitx } - { - exponent-product = - \ifmmode \times \else \texttimes \fi - } - } - { - \tl_set:Nn \l_@@_tmpb_tl { 2 \cdot 10 ^ { 1 } } - \tl_if_eq:NNTF \l_@@_tmpa_tl \l_@@_tmpb_tl - { - \group_end: - \keys_set:nn { siunitx } - { - exponent-product = - \ifmmode \cdot \else \textperiodcentered \fi - } - } - { \group_end: } - } - \group_begin: - \keys_set:nn { siunitx } { forbid-literal-units = false } - \tl_set:Nn \l_@@_tmpa_tl { \mathrm { m } \cdot \mathrm { s } } - \tl_set:Nn \l_siunitx_unit_font_tl { \mathrm } - \siunitx_unit_format:nN { m . s } \l_@@_tmpb_tl - \tl_if_eq:NNTF \l_@@_tmpa_tl \l_@@_tmpb_tl - { - \group_end: - \keys_set:nn { siunitx } - { - inter-unit-product = - \ifmmode \cdot \else \textperiodcentered \fi - } - } - { \group_end: } - } -% \end{macrocode} -% % \subsection{Bookmark definitions} % % Inside PDF strings we disable the text printing function. The definition of diff --git a/macros/latex/contrib/siunitx/siunitx-unit.dtx b/macros/latex/contrib/siunitx/siunitx-unit.dtx index f066530439..604883dfa6 100644 --- a/macros/latex/contrib/siunitx/siunitx-unit.dtx +++ b/macros/latex/contrib/siunitx/siunitx-unit.dtx @@ -1179,8 +1179,12 @@ % \begin{macro}{\@@_format_literal_auxi:w} % \begin{macro}{\@@_format_literal_auxii:w} % \begin{macro}{\@@_format_literal_auxiii:w} -% \begin{macro}{\@@_format_literal_auxiv:w} -% \begin{macro}{\@@_format_literal_auxv:w} +% \begin{macro}{\@@_format_literal_auxiv:n} +% \begin{macro}{\@@_format_literal_auxv:nw} +% \begin{macro}{\@@_format_literal_auxvi:nN} +% \begin{macro}{\@@_format_literal_super:nn, \@@_format_literal_sub:nn} +% \begin{macro}{\@@_format_literal_add:n} +% \begin{macro}{\@@_format_literal_auxvii:nn} % \begin{variable}{\l_@@_separator_tl} % To format literal units, there are two tasks to do. The input is % \texttt{x}-type expanded to force any symbolic units to be converted into @@ -1254,71 +1258,79 @@ \cs_new_protected:Npn \@@_format_literal_auxiii:w #1 / { \quark_if_recursion_tail_stop:n {#1} - \@@_format_literal_auxiv:w #1 ^ ^ \q_stop + \@@_format_literal_auxiv:n {#1} \tl_set:Nn \l_@@_separator_tl { / } \@@_format_literal_auxiii:w } +\cs_new_protected:Npn \@@_format_literal_auxiv:n #1 + { + \@@_format_literal_auxv:nw { } + #1 \q_recursion_tail \q_recursion_stop + } % \end{macrocode} -% Within each unit any sub- and superscript parts need to be separated out: -% wrapping everything in the font command is incorrect. The superscript part -% is relatively easy as there is no catcode issue or font command to add, -% while the subscript part needs a bit more work. As the user might have the -% two parts in either order, picking up the subscript needs to look in two -% places. We assume that only one is given: odd input here is simply accepted. +% To deal properly with literal formatting, we have to worry about super- +% and subscript markers. That can be complicated as they could come anywhere +% in the input: we handle that by iterating through the input and picking +% them out. This avoids any issue with loosing braces for mid-input scripts. +% We also have to deal with fractions, hence needing a series of nested +% loops and a change of separator. % \begin{macrocode} -\use:x +\cs_new_protected:Npn \@@_format_literal_auxv:nw + #1#2 \q_recursion_stop + { + \tl_if_head_is_N_type:nTF {#2} + { \@@_format_literal_auxvi:nN } + { \@@_format_literal_auxvii:nn } + {#1} #2 \q_recursion_stop + } +\cs_new_protected:Npx \@@_format_literal_auxvi:nN #1#2 { - \cs_new_protected:Npn \exp_not:N \@@_format_literal_auxiv:w - ##1 ^ ##2 ^ ##3 \exp_not:N \q_stop + \exp_not:N \quark_if_recursion_tail_stop_do:Nn #2 + { \exp_not:N \@@_format_literal_add:n {#1} } + \exp_not:N \token_if_eq_meaning:NNTF #2 ^ + { \exp_not:N \@@_format_literal_super:nn {#1} } { - \exp_not:N \@@_format_literal_auxv:w - ##1 - \c_@@_math_subscript_tl - \c_@@_math_subscript_tl - \exp_not:N \q_mark - ##2 - \c_@@_math_subscript_tl - \c_@@_math_subscript_tl - \exp_not:N \q_stop + \exp_not:N \token_if_eq_meaning:NNTF + #2 \c_@@_math_subscript_tl + { \exp_not:N \@@_format_literal_sub:nn {#1} } + { \exp_not:N \@@_format_literal_auxvi:nN {#1#2} } } - \cs_new_protected:Npn \exp_not:N \@@_format_literal_auxv:w - ##1 \c_@@_math_subscript_tl - ##2 \c_@@_math_subscript_tl ##3 - \exp_not:N \q_mark - ##4 \c_@@_math_subscript_tl - ##5 \c_@@_math_subscript_tl ##6 - \exp_not:N \q_stop + } +\cs_new_protected:Npn \@@_format_literal_super:nn #1#2 + { + \quark_if_recursion_tail_stop:n {#2} + \@@_format_literal_add:n {#1} + \tl_put_right:Nn \l_@@_formatted_tl { ^ {#2} } + \@@_format_literal_auxvi:nN { } + } +\cs_new_protected:Npx \@@_format_literal_sub:nn #1#2 + { + \exp_not:N \quark_if_recursion_tail_stop:n {#2} + \exp_not:N \@@_format_literal_add:n {#1} + \tl_put_right:Nx \exp_not:N \l_@@_formatted_tl { - \tl_set:Nx \exp_not:N \l_@@_formatted_tl + \c_@@_math_subscript_tl { \exp_not:N \exp_not:V - \exp_not:N \l_@@_formatted_tl - \exp_not:N \tl_if_empty:NF - \exp_not:N \l_@@_formatted_tl - { - \exp_not:N \exp_not:V - \exp_not:N \l_@@_separator_tl - } - \exp_not:N \tl_if_blank:nF {##1} - { - \exp_not:N \exp_not:V - \exp_not:N \l_siunitx_unit_font_tl - { \exp_not:N \exp_not:n {##1} } - } - \exp_not:N \tl_if_blank:nF {##4} - { ^ { \exp_not:N \exp_not:n {##4} } } - \exp_not:N \tl_if_blank:nF {##2##5} - { - \c_@@_math_subscript_tl - { - \exp_not:N \exp_not:V - \exp_not:N \l_siunitx_unit_font_tl - { \exp_not:N \exp_not:n {##2##5} } - } - } + \exp_not:N \l_siunitx_unit_font_tl + { \exp_not:N \exp_not:n {#2} } } } + \exp_not:N \@@_format_literal_auxvi:nN { } } +\cs_new_protected:Npn \@@_format_literal_add:n #1 + { + \tl_put_right:Nx \l_@@_formatted_tl + { + \tl_if_empty:NF \l_@@_formatted_tl + { \exp_not:V \l_@@_separator_tl } + \tl_if_empty:nF {#1} + { \exp_not:V \l_siunitx_unit_font_tl { \exp_not:n {#1} } } + } + \tl_clear:N \l_@@_separator_tl + } +\cs_new_protected:Npn \@@_format_literal_auxvii:nn #1#2 + { \@@_format_literal_auxvi:nN { #1 {#2} } } \tl_new:N \l_@@_separator_tl % \end{macrocode} % \end{variable} @@ -1329,6 +1341,10 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} % % \subsection{(PDF) String creation} % diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx index 5c86624afb..e553abc6b0 100644 --- a/macros/latex/contrib/siunitx/siunitx.dtx +++ b/macros/latex/contrib/siunitx/siunitx.dtx @@ -121,7 +121,7 @@ % % Identify the package and give the over all version information. % \begin{macrocode} -\ProvidesExplPackage {siunitx} {2021-05-25} {3.0.6} +\ProvidesExplPackage {siunitx} {2021-05-28} {3.0.7} {A comprehensive (SI) units package} % \end{macrocode} % diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf Binary files differindex a13fa3ea8b..5e0b6c269d 100644 --- a/macros/latex/contrib/siunitx/siunitx.pdf +++ b/macros/latex/contrib/siunitx/siunitx.pdf diff --git a/macros/latex/contrib/siunitx/siunitx.tex b/macros/latex/contrib/siunitx/siunitx.tex index a45c979be1..3cb5f25ed5 100644 --- a/macros/latex/contrib/siunitx/siunitx.tex +++ b/macros/latex/contrib/siunitx/siunitx.tex @@ -484,7 +484,7 @@ Runs of products of of numbers with units can be handled using the \cs{qtyrange}\oarg{options}\marg{number1}\marg{number2}\marg{unit} \end{syntax} \end{function} -Products of numbers with units can be handled using the \cs{qtyrange} +Ranges of numbers with units can be handled using the \cs{qtyrange} function. The behaviour of this function is similar to \cs{numrange}, but with the addition of a unit to each number. \begin{LaTeXdemo} @@ -493,7 +493,7 @@ with the addition of a unit to each number. The input of lists, products and ranges of quantities using a single command allows them to be adjusted together. These commands are intended to allow -consistent formatting of related values: as such, they apply a a single +consistent formatting of related values: as such, they apply a single unit to all of the values. This is particularly notable when using adjustment of the numerical values. @@ -1580,6 +1580,7 @@ conveys. The options are summarised in Table~\ref{tab:opt:num:out}. negative-color & Literal & \meta{none} \\ ^^A ( output-close-uncertainty & Literal & ) \\ output-decimal-marker & Literal & . \\ + output-exponent-marker & Literal & \meta{none} \\ output-open-uncertainty & Literal & ( \\ ^^A ) print-implicit-plus & Switch & false \\ print-unity-mantissa & Switch & true \\ @@ -1648,6 +1649,13 @@ When exponents are present in the input, the \opt{exponent-base} and \num[exponent-product = \cdot]{1e2} \\ \num[exponent-base = 2]{1e2} \end{LaTeXdemo} +\DescribeOption{output-exponent-marker} +Alternatively, if the \opt{output-exponent-marker} option is set then the value +stored will be used in place of the normal product and base combination. +\begin{LaTeXdemo} + \num[output-exponent-marker = e]{1e2} \\ + \num[output-exponent-marker = \mathrm{E}]{1e2} +\end{LaTeXdemo} \DescribeOption{uncertainty-separator} \DescribeOption{output-open-uncertainty} |