diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..b7d1acb --- /dev/null +++ b/.drone.yml @@ -0,0 +1,11 @@ +kind: pipeline +type: docker +name: default + +steps: +- name: build + image: moss/xelatex + commands: + - cd src + - make + - cd .. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..13d7e50 --- /dev/null +++ b/.gitignore @@ -0,0 +1,98 @@ +thesis.pdf +thesis-pdflatex*.pdf +thesis-xelatex*.pdf +thesis-lualatex*.pdf + +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc + +## Intermediate documents: +*.dvi +# these rules might exclude image files for figures etc. +*.ps +*.eps +#*.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Auxiliary and intermediate files from other packages: + +# algorithms +*.alg +*.loa + +# amsthm +*.thm + +# beamer +*.nav +*.snm +*.vrb + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls + +# hyperref +*.brf + +# listings +*.lol + +# makeidx +*.idx +*.ilg +*.ind +*.ist + +# minitoc +*.maf +*.mtc +*.mtc0 + +# minted +*.pyg + +# nomencl +*.nlo + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# todonotes +*.tdo + +# xindy +*.xdy +/tmp +/out + +*.bib~* diff --git a/.project b/.project new file mode 100644 index 0000000..4a197ff --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + diploma + + + + + + net.sourceforge.texlipse.builder.TexlipseBuilder + + + + + + net.sourceforge.texlipse.builder.TexlipseNature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..6d65655 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=utf-8 diff --git a/.texlipse b/.texlipse new file mode 100644 index 0000000..8542bd0 --- /dev/null +++ b/.texlipse @@ -0,0 +1,14 @@ +#TeXlipse project settings +#Thu Aug 14 18:19:20 CEST 2014 +markTmpDer=true +builderNum=2 +outputDir=pdf +makeIndSty= +bibrefDir= +outputFormat=pdf +tempDir=tmp +mainTexFile=diploma.tex +outputFile=diploma.pdf +langSpell=hu +markDer=true +srcDir=src diff --git a/LICENSE b/LICENSE deleted file mode 100644 index e142a52..0000000 --- a/LICENSE +++ /dev/null @@ -1,625 +0,0 @@ -GNU GENERAL PUBLIC LICENSE - -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license -document, but changing it is not allowed. - -Preamble - -The GNU General Public License is a free, copyleft license for software and -other kinds of works. - -The licenses for most software and other practical works are designed to take -away your freedom to share and change the works. By contrast, the GNU General -Public License is intended to guarantee your freedom to share and change all -versions of a program--to make sure it remains free software for all its users. -We, the Free Software Foundation, use the GNU General Public License for most -of our software; it applies also to any other work released this way by its -authors. You can apply it to your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our -General Public Licenses are designed to make sure that you have the freedom -to distribute copies of free software (and charge for them if you wish), that -you receive source code or can get it if you want it, that you can change -the software or use pieces of it in new free programs, and that you know you -can do these things. - -To protect your rights, we need to prevent others from denying you these rights -or asking you to surrender the rights. Therefore, you have certain responsibilities -if you distribute copies of the software, or if you modify it: responsibilities -to respect the freedom of others. - -For example, if you distribute copies of such a program, whether gratis or -for a fee, you must pass on to the recipients the same freedoms that you received. -You must make sure that they, too, receive or can get the source code. And -you must show them these terms so they know their rights. - -Developers that use the GNU GPL protect your rights with two steps: (1) assert -copyright on the software, and (2) offer you this License giving you legal -permission to copy, distribute and/or modify it. - -For the developers' and authors' protection, the GPL clearly explains that -there is no warranty for this free software. For both users' and authors' -sake, the GPL requires that modified versions be marked as changed, so that -their problems will not be attributed erroneously to authors of previous versions. - -Some devices are designed to deny users access to install or run modified -versions of the software inside them, although the manufacturer can do so. -This is fundamentally incompatible with the aim of protecting users' freedom -to change the software. The systematic pattern of such abuse occurs in the -area of products for individuals to use, which is precisely where it is most -unacceptable. Therefore, we have designed this version of the GPL to prohibit -the practice for those products. If such problems arise substantially in other -domains, we stand ready to extend this provision to those domains in future -versions of the GPL, as needed to protect the freedom of users. - -Finally, every program is threatened constantly by software patents. States -should not allow patents to restrict development and use of software on general-purpose -computers, but in those that do, we wish to avoid the special danger that -patents applied to a free program could make it effectively proprietary. To -prevent this, the GPL assures that patents cannot be used to render the program -non-free. - -The precise terms and conditions for copying, distribution and modification -follow. - -TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - -"Copyright" also means copyright-like laws that apply to other kinds of works, -such as semiconductor masks. - -"The Program" refers to any copyrightable work licensed under this License. -Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals -or organizations. - -To "modify" a work means to copy from or adapt all or part of the work in -a fashion requiring copyright permission, other than the making of an exact -copy. The resulting work is called a "modified version" of the earlier work -or a work "based on" the earlier work. - -A "covered work" means either the unmodified Program or a work based on the -Program. - -To "propagate" a work means to do anything with it that, without permission, -would make you directly or secondarily liable for infringement under applicable -copyright law, except executing it on a computer or modifying a private copy. -Propagation includes copying, distribution (with or without modification), -making available to the public, and in some countries other activities as -well. - -To "convey" a work means any kind of propagation that enables other parties -to make or receive copies. Mere interaction with a user through a computer -network, with no transfer of a copy, is not conveying. - -An interactive user interface displays "Appropriate Legal Notices" to the -extent that it includes a convenient and prominently visible feature that -(1) displays an appropriate copyright notice, and (2) tells the user that -there is no warranty for the work (except to the extent that warranties are -provided), that licensees may convey the work under this License, and how -to view a copy of this License. If the interface presents a list of user commands -or options, such as a menu, a prominent item in the list meets this criterion. - - 1. Source Code. - -The "source code" for a work means the preferred form of the work for making -modifications to it. "Object code" means any non-source form of a work. - -A "Standard Interface" means an interface that either is an official standard -defined by a recognized standards body, or, in the case of interfaces specified -for a particular programming language, one that is widely used among developers -working in that language. - -The "System Libraries" of an executable work include anything, other than -the work as a whole, that (a) is included in the normal form of packaging -a Major Component, but which is not part of that Major Component, and (b) -serves only to enable use of the work with that Major Component, or to implement -a Standard Interface for which an implementation is available to the public -in source code form. A "Major Component", in this context, means a major essential -component (kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to produce -the work, or an object code interpreter used to run it. - -The "Corresponding Source" for a work in object code form means all the source -code needed to generate, install, and (for an executable work) run the object -code and to modify the work, including scripts to control those activities. -However, it does not include the work's System Libraries, or general-purpose -tools or generally available free programs which are used unmodified in performing -those activities but which are not part of the work. For example, Corresponding -Source includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically linked -subprograms that the work is specifically designed to require, such as by -intimate data communication or control flow between those subprograms and -other parts of the work. - -The Corresponding Source need not include anything that users can regenerate -automatically from other parts of the Corresponding Source. - - The Corresponding Source for a work in source code form is that same work. - - 2. Basic Permissions. - -All rights granted under this License are granted for the term of copyright -on the Program, and are irrevocable provided the stated conditions are met. -This License explicitly affirms your unlimited permission to run the unmodified -Program. The output from running a covered work is covered by this License -only if the output, given its content, constitutes a covered work. This License -acknowledges your rights of fair use or other equivalent, as provided by copyright -law. - -You may make, run and propagate covered works that you do not convey, without -conditions so long as your license otherwise remains in force. You may convey -covered works to others for the sole purpose of having them make modifications -exclusively for you, or provide you with facilities for running those works, -provided that you comply with the terms of this License in conveying all material -for which you do not control copyright. Those thus making or running the covered -works for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of your copyrighted -material outside their relationship with you. - -Conveying under any other circumstances is permitted solely under the conditions -stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - -No covered work shall be deemed part of an effective technological measure -under any applicable law fulfilling obligations under article 11 of the WIPO -copyright treaty adopted on 20 December 1996, or similar laws prohibiting -or restricting circumvention of such measures. - -When you convey a covered work, you waive any legal power to forbid circumvention -of technological measures to the extent such circumvention is effected by -exercising rights under this License with respect to the covered work, and -you disclaim any intention to limit operation or modification of the work -as a means of enforcing, against the work's users, your or third parties' -legal rights to forbid circumvention of technological measures. - - 4. Conveying Verbatim Copies. - -You may convey verbatim copies of the Program's source code as you receive -it, in any medium, provided that you conspicuously and appropriately publish -on each copy an appropriate copyright notice; keep intact all notices stating -that this License and any non-permissive terms added in accord with section -7 apply to the code; keep intact all notices of the absence of any warranty; -and give all recipients a copy of this License along with the Program. - -You may charge any price or no price for each copy that you convey, and you -may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - -You may convey a work based on the Program, or the modifications to produce -it from the Program, in the form of source code under the terms of section -4, provided that you also meet all of these conditions: - -a) The work must carry prominent notices stating that you modified it, and -giving a relevant date. - -b) The work must carry prominent notices stating that it is released under -this License and any conditions added under section 7. This requirement modifies -the requirement in section 4 to "keep intact all notices". - -c) You must license the entire work, as a whole, under this License to anyone -who comes into possession of a copy. This License will therefore apply, along -with any applicable section 7 additional terms, to the whole of the work, -and all its parts, regardless of how they are packaged. This License gives -no permission to license the work in any other way, but it does not invalidate -such permission if you have separately received it. - -d) If the work has interactive user interfaces, each must display Appropriate -Legal Notices; however, if the Program has interactive interfaces that do -not display Appropriate Legal Notices, your work need not make them do so. - -A compilation of a covered work with other separate and independent works, -which are not by their nature extensions of the covered work, and which are -not combined with it such as to form a larger program, in or on a volume of -a storage or distribution medium, is called an "aggregate" if the compilation -and its resulting copyright are not used to limit the access or legal rights -of the compilation's users beyond what the individual works permit. Inclusion -of a covered work in an aggregate does not cause this License to apply to -the other parts of the aggregate. - - 6. Conveying Non-Source Forms. - -You may convey a covered work in object code form under the terms of sections -4 and 5, provided that you also convey the machine-readable Corresponding -Source under the terms of this License, in one of these ways: - -a) Convey the object code in, or embodied in, a physical product (including -a physical distribution medium), accompanied by the Corresponding Source fixed -on a durable physical medium customarily used for software interchange. - -b) Convey the object code in, or embodied in, a physical product (including -a physical distribution medium), accompanied by a written offer, valid for -at least three years and valid for as long as you offer spare parts or customer -support for that product model, to give anyone who possesses the object code -either (1) a copy of the Corresponding Source for all the software in the -product that is covered by this License, on a durable physical medium customarily -used for software interchange, for a price no more than your reasonable cost -of physically performing this conveying of source, or (2) access to copy the -Corresponding Source from a network server at no charge. - -c) Convey individual copies of the object code with a copy of the written -offer to provide the Corresponding Source. This alternative is allowed only -occasionally and noncommercially, and only if you received the object code -with such an offer, in accord with subsection 6b. - -d) Convey the object code by offering access from a designated place (gratis -or for a charge), and offer equivalent access to the Corresponding Source -in the same way through the same place at no further charge. You need not -require recipients to copy the Corresponding Source along with the object -code. If the place to copy the object code is a network server, the Corresponding -Source may be on a different server (operated by you or a third party) that -supports equivalent copying facilities, provided you maintain clear directions -next to the object code saying where to find the Corresponding Source. Regardless -of what server hosts the Corresponding Source, you remain obligated to ensure -that it is available for as long as needed to satisfy these requirements. - -e) Convey the object code using peer-to-peer transmission, provided you inform -other peers where the object code and Corresponding Source of the work are -being offered to the general public at no charge under subsection 6d. - -A separable portion of the object code, whose source code is excluded from -the Corresponding Source as a System Library, need not be included in conveying -the object code work. - -A "User Product" is either (1) a "consumer product", which means any tangible -personal property which is normally used for personal, family, or household -purposes, or (2) anything designed or sold for incorporation into a dwelling. -In determining whether a product is a consumer product, doubtful cases shall -be resolved in favor of coverage. For a particular product received by a particular -user, "normally used" refers to a typical or common use of that class of product, -regardless of the status of the particular user or of the way in which the -particular user actually uses, or expects or is expected to use, the product. -A product is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent the -only significant mode of use of the product. - -"Installation Information" for a User Product means any methods, procedures, -authorization keys, or other information required to install and execute modified -versions of a covered work in that User Product from a modified version of -its Corresponding Source. The information must suffice to ensure that the -continued functioning of the modified object code is in no case prevented -or interfered with solely because modification has been made. - -If you convey an object code work under this section in, or with, or specifically -for use in, a User Product, and the conveying occurs as part of a transaction -in which the right of possession and use of the User Product is transferred -to the recipient in perpetuity or for a fixed term (regardless of how the -transaction is characterized), the Corresponding Source conveyed under this -section must be accompanied by the Installation Information. But this requirement -does not apply if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has been installed -in ROM). - -The requirement to provide Installation Information does not include a requirement -to continue to provide support service, warranty, or updates for a work that -has been modified or installed by the recipient, or for the User Product in -which it has been modified or installed. Access to a network may be denied -when the modification itself materially and adversely affects the operation -of the network or violates the rules and protocols for communication across -the network. - -Corresponding Source conveyed, and Installation Information provided, in accord -with this section must be in a format that is publicly documented (and with -an implementation available to the public in source code form), and must require -no special password or key for unpacking, reading or copying. - - 7. Additional Terms. - -"Additional permissions" are terms that supplement the terms of this License -by making exceptions from one or more of its conditions. Additional permissions -that are applicable to the entire Program shall be treated as though they -were included in this License, to the extent that they are valid under applicable -law. If additional permissions apply only to part of the Program, that part -may be used separately under those permissions, but the entire Program remains -governed by this License without regard to the additional permissions. - -When you convey a copy of a covered work, you may at your option remove any -additional permissions from that copy, or from any part of it. (Additional -permissions may be written to require their own removal in certain cases when -you modify the work.) You may place additional permissions on material, added -by you to a covered work, for which you have or can give appropriate copyright -permission. - -Notwithstanding any other provision of this License, for material you add -to a covered work, you may (if authorized by the copyright holders of that -material) supplement the terms of this License with terms: - -a) Disclaiming warranty or limiting liability differently from the terms of -sections 15 and 16 of this License; or - -b) Requiring preservation of specified reasonable legal notices or author -attributions in that material or in the Appropriate Legal Notices displayed -by works containing it; or - -c) Prohibiting misrepresentation of the origin of that material, or requiring -that modified versions of such material be marked in reasonable ways as different -from the original version; or - -d) Limiting the use for publicity purposes of names of licensors or authors -of the material; or - -e) Declining to grant rights under trademark law for use of some trade names, -trademarks, or service marks; or - -f) Requiring indemnification of licensors and authors of that material by -anyone who conveys the material (or modified versions of it) with contractual -assumptions of liability to the recipient, for any liability that these contractual -assumptions directly impose on those licensors and authors. - -All other non-permissive additional terms are considered "further restrictions" -within the meaning of section 10. If the Program as you received it, or any -part of it, contains a notice stating that it is governed by this License -along with a term that is a further restriction, you may remove that term. -If a license document contains a further restriction but permits relicensing -or conveying under this License, you may add to a covered work material governed -by the terms of that license document, provided that the further restriction -does not survive such relicensing or conveying. - -If you add terms to a covered work in accord with this section, you must place, -in the relevant source files, a statement of the additional terms that apply -to those files, or a notice indicating where to find the applicable terms. - -Additional terms, permissive or non-permissive, may be stated in the form -of a separately written license, or stated as exceptions; the above requirements -apply either way. - - 8. Termination. - -You may not propagate or modify a covered work except as expressly provided -under this License. Any attempt otherwise to propagate or modify it is void, -and will automatically terminate your rights under this License (including -any patent licenses granted under the third paragraph of section 11). - -However, if you cease all violation of this License, then your license from -a particular copyright holder is reinstated (a) provisionally, unless and -until the copyright holder explicitly and finally terminates your license, -and (b) permanently, if the copyright holder fails to notify you of the violation -by some reasonable means prior to 60 days after the cessation. - -Moreover, your license from a particular copyright holder is reinstated permanently -if the copyright holder notifies you of the violation by some reasonable means, -this is the first time you have received notice of violation of this License -(for any work) from that copyright holder, and you cure the violation prior -to 30 days after your receipt of the notice. - -Termination of your rights under this section does not terminate the licenses -of parties who have received copies or rights from you under this License. -If your rights have been terminated and not permanently reinstated, you do -not qualify to receive new licenses for the same material under section 10. - - 9. Acceptance Not Required for Having Copies. - -You are not required to accept this License in order to receive or run a copy -of the Program. Ancillary propagation of a covered work occurring solely as -a consequence of using peer-to-peer transmission to receive a copy likewise -does not require acceptance. However, nothing other than this License grants -you permission to propagate or modify any covered work. These actions infringe -copyright if you do not accept this License. Therefore, by modifying or propagating -a covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - -Each time you convey a covered work, the recipient automatically receives -a license from the original licensors, to run, modify and propagate that work, -subject to this License. You are not responsible for enforcing compliance -by third parties with this License. - -An "entity transaction" is a transaction transferring control of an organization, -or substantially all assets of one, or subdividing an organization, or merging -organizations. If propagation of a covered work results from an entity transaction, -each party to that transaction who receives a copy of the work also receives -whatever licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the Corresponding -Source of the work from the predecessor in interest, if the predecessor has -it or can get it with reasonable efforts. - -You may not impose any further restrictions on the exercise of the rights -granted or affirmed under this License. For example, you may not impose a -license fee, royalty, or other charge for exercise of rights granted under -this License, and you may not initiate litigation (including a cross-claim -or counterclaim in a lawsuit) alleging that any patent claim is infringed -by making, using, selling, offering for sale, or importing the Program or -any portion of it. - - 11. Patents. - -A "contributor" is a copyright holder who authorizes use under this License -of the Program or a work on which the Program is based. The work thus licensed -is called the contributor's "contributor version". - -A contributor's "essential patent claims" are all patent claims owned or controlled -by the contributor, whether already acquired or hereafter acquired, that would -be infringed by some manner, permitted by this License, of making, using, -or selling its contributor version, but do not include claims that would be -infringed only as a consequence of further modification of the contributor -version. For purposes of this definition, "control" includes the right to -grant patent sublicenses in a manner consistent with the requirements of this -License. - -Each contributor grants you a non-exclusive, worldwide, royalty-free patent -license under the contributor's essential patent claims, to make, use, sell, -offer for sale, import and otherwise run, modify and propagate the contents -of its contributor version. - -In the following three paragraphs, a "patent license" is any express agreement -or commitment, however denominated, not to enforce a patent (such as an express -permission to practice a patent or covenant not to sue for patent infringement). -To "grant" such a patent license to a party means to make such an agreement -or commitment not to enforce a patent against the party. - -If you convey a covered work, knowingly relying on a patent license, and the -Corresponding Source of the work is not available for anyone to copy, free -of charge and under the terms of this License, through a publicly available -network server or other readily accessible means, then you must either (1) -cause the Corresponding Source to be so available, or (2) arrange to deprive -yourself of the benefit of the patent license for this particular work, or -(3) arrange, in a manner consistent with the requirements of this License, -to extend the patent license to downstream recipients. "Knowingly relying" -means you have actual knowledge that, but for the patent license, your conveying -the covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that country -that you have reason to believe are valid. - -If, pursuant to or in connection with a single transaction or arrangement, -you convey, or propagate by procuring conveyance of, a covered work, and grant -a patent license to some of the parties receiving the covered work authorizing -them to use, propagate, modify or convey a specific copy of the covered work, -then the patent license you grant is automatically extended to all recipients -of the covered work and works based on it. - -A patent license is "discriminatory" if it does not include within the scope -of its coverage, prohibits the exercise of, or is conditioned on the non-exercise -of one or more of the rights that are specifically granted under this License. -You may not convey a covered work if you are a party to an arrangement with -a third party that is in the business of distributing software, under which -you make payment to the third party based on the extent of your activity of -conveying the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory patent -license (a) in connection with copies of the covered work conveyed by you -(or copies made from those copies), or (b) primarily for and in connection -with specific products or compilations that contain the covered work, unless -you entered into that arrangement, or that patent license was granted, prior -to 28 March 2007. - -Nothing in this License shall be construed as excluding or limiting any implied -license or other defenses to infringement that may otherwise be available -to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - -If conditions are imposed on you (whether by court order, agreement or otherwise) -that contradict the conditions of this License, they do not excuse you from -the conditions of this License. If you cannot convey a covered work so as -to satisfy simultaneously your obligations under this License and any other -pertinent obligations, then as a consequence you may not convey it at all. -For example, if you agree to terms that obligate you to collect a royalty -for further conveying from those to whom you convey the Program, the only -way you could satisfy both those terms and this License would be to refrain -entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - -Notwithstanding any other provision of this License, you have permission to -link or combine any covered work with a work licensed under version 3 of the -GNU Affero General Public License into a single combined work, and to convey -the resulting work. The terms of this License will continue to apply to the -part which is the covered work, but the special requirements of the GNU Affero -General Public License, section 13, concerning interaction through a network -will apply to the combination as such. - - 14. Revised Versions of this License. - -The Free Software Foundation may publish revised and/or new versions of the -GNU General Public License from time to time. Such new versions will be similar -in spirit to the present version, but may differ in detail to address new -problems or concerns. - -Each version is given a distinguishing version number. If the Program specifies -that a certain numbered version of the GNU General Public License "or any -later version" applies to it, you have the option of following the terms and -conditions either of that numbered version or of any later version published -by the Free Software Foundation. If the Program does not specify a version -number of the GNU General Public License, you may choose any version ever -published by the Free Software Foundation. - -If the Program specifies that a proxy can decide which future versions of -the GNU General Public License can be used, that proxy's public statement -of acceptance of a version permanently authorizes you to choose that version -for the Program. - -Later license versions may give you additional or different permissions. However, -no additional obligations are imposed on any author or copyright holder as -a result of your choosing to follow a later version. - - 15. Disclaimer of Warranty. - -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE -LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER -EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM -PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR -CORRECTION. - - 16. Limitation of Liability. - -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL -ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM -AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, -INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO -USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED -INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE -PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER -PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - -If the disclaimer of warranty and limitation of liability provided above cannot -be given local legal effect according to their terms, reviewing courts shall -apply local law that most closely approximates an absolute waiver of all civil -liability in connection with the Program, unless a warranty or assumption -of liability accompanies a copy of the Program in return for a fee. END OF -TERMS AND CONDITIONS - -How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible -use to the public, the best way to achieve this is to make it free software -which everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach -them to the start of each source file to most effectively state the exclusion -of warranty; and each file should have at least the "copyright" line and a -pointer to where the full notice is found. - - - -Copyright (C) - -This program is free software: you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation, either version 3 of the License, or (at your option) any later -version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with -this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - -If the program does terminal interaction, make it output a short notice like -this when it starts in an interactive mode: - - Copyright (C) - -This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - -This is free software, and you are welcome to redistribute it under certain -conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands might -be different; for a GUI interface, you would use an "about box". - -You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. For -more information on this, and how to apply and follow the GNU GPL, see . - -The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General Public -License instead of this License. But first, please read . diff --git a/README.md b/README.md index 5530a3b..a4baa30 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ -# birbnetes-tdk-latex +# knative-report-latex +2019 Szakdolgozat Latex +[![Build Status](https://travis-ci.com/tormachris/knative-report-latex.svg?branch=master)](https://travis-ci.com/tormachris/knative-report-latex) + +Drone: + +[![Build Status](https://drone.kmlabz.com/api/badges/tormakris/knative-report-latex/status.svg)](https://drone.kmlabz.com/tormakris/knative-report-latex) diff --git a/pdf/.gitignore b/pdf/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/pdf/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/src/.kile/thesis.kilepr.gui b/src/.kile/thesis.kilepr.gui new file mode 100644 index 0000000..f62c6c9 --- /dev/null +++ b/src/.kile/thesis.kilepr.gui @@ -0,0 +1,240 @@ +[General] +kile_livePreviewEnabled=true +kile_livePreviewStatusUserSpecified=true +kile_livePreviewTool=LivePreview-XeLaTeX +lastDocument=content/results.tex + +[document-settings,item:../../thesis-template-latex/src/thesis.tex] +Bookmarks= +Encoding=UTF-8 +Highlighting=LaTeX +Highlighting Set By User=false +Indentation Mode=normal +Mode=LaTeX +Mode Set By User=false + +[document-settings,item:content/abstract.tex] +Bookmarks= +Encoding=UTF-8 +Highlighting=LaTeX +Highlighting Set By User=false +Indentation Mode=normal +Mode=LaTeX +Mode Set By User=false + +[document-settings,item:content/acknowledgement.tex] +Bookmarks= +Encoding=UTF-8 +Highlighting=LaTeX +Highlighting Set By User=false +Indentation Mode=normal +Mode=LaTeX +Mode Set By User=false + +[document-settings,item:content/appendices.tex] +Bookmarks= +Encoding=UTF-8 +Highlighting=LaTeX +Highlighting Set By User=false +Indentation Mode=normal +Mode=LaTeX +Mode Set By User=false + +[document-settings,item:content/closing.tex] +Bookmarks= +Encoding=UTF-8 +Highlighting=LaTeX +Highlighting Set By User=false +Indentation Mode=normal +Mode=LaTeX +Mode Set By User=false + +[document-settings,item:content/create-functions.tex] +Bookmarks= +Encoding=UTF-8 +Highlighting=LaTeX +Highlighting Set By User=false +Indentation Mode=normal +Mode=LaTeX +Mode Set By User=false + +[document-settings,item:content/introduction.tex] +Bookmarks= +Encoding=UTF-8 +Highlighting=LaTeX +Highlighting Set By User=false +Indentation Mode=normal +Mode=LaTeX +Mode Set By User=false + +[document-settings,item:content/preparation.tex] +Bookmarks= +Encoding=UTF-8 +Highlighting=LaTeX +Highlighting Set By User=false +Indentation Mode=normal +Mode=LaTeX +Mode Set By User=false + +[document-settings,item:content/results.tex] +Bookmarks= +Encoding=UTF-8 +Highlighting=LaTeX +Highlighting Set By User=false +Indentation Mode=normal +Mode=LaTeX +Mode Set By User=false + +[document-settings,item:content/theory.tex] +Bookmarks= +Encoding=UTF-8 +Highlighting=LaTeX +Highlighting Set By User=false +Indentation Mode=normal +Mode=LaTeX +Mode Set By User=false + +[document-settings,item:thesis.tex] +Bookmarks= +Encoding=UTF-8 +Highlighting=LaTeX +Highlighting Set By User=false +Indentation Mode=normal +Mode=LaTeX +Mode Set By User=false + +[item:../../thesis-template-latex/src/thesis.tex] +open=true +order=0 + +[item:content/abstract.tex] +open=false +order=0 + +[item:content/acknowledgement.tex] +open=true +order=3 + +[item:content/appendices.tex] +open=true +order=2 + +[item:content/closing.tex] +open=false +order=6 + +[item:content/create-functions.tex] +open=false +order=4 + +[item:content/introduction.tex] +open=false +order=1 + +[item:content/preparation.tex] +open=false +order=3 + +[item:content/results.tex] +open=true +order=1 + +[item:content/theory.tex] +open=true +order=0 + +[item:thesis.kilepr] +open=false +order=-1 + +[item:thesis.tex] +open=false +order=8 + +[view-settings,view=0,item:../../thesis-template-latex/src/thesis.tex] +CursorColumn=32 +CursorLine=37 +Dynamic Word Wrap=false +JumpList= +TextFolding=[] +ViMarks= + +[view-settings,view=0,item:content/abstract.tex] +CursorColumn=141 +CursorLine=10 +Dynamic Word Wrap=true +JumpList= +TextFolding=[] +ViMarks=.,1,0,[,1,0,],1,0 + +[view-settings,view=0,item:content/acknowledgement.tex] +CursorColumn=0 +CursorLine=7 +Dynamic Word Wrap=false +JumpList= +TextFolding=[] +ViMarks=.,8,233,[,8,233,],8,233 + +[view-settings,view=0,item:content/appendices.tex] +CursorColumn=37 +CursorLine=6 +Dynamic Word Wrap=false +JumpList= +TextFolding=[] +ViMarks=.,181,0,[,181,0,],181,9 + +[view-settings,view=0,item:content/closing.tex] +CursorColumn=29 +CursorLine=4 +Dynamic Word Wrap=true +JumpList= +TextFolding=[] +ViMarks=.,4,28,[,4,19,],4,28 + +[view-settings,view=0,item:content/create-functions.tex] +CursorColumn=121 +CursorLine=1 +Dynamic Word Wrap=true +JumpList= +TextFolding=[] +ViMarks=.,34,55,[,34,38,],34,57 + +[view-settings,view=0,item:content/introduction.tex] +CursorColumn=24 +CursorLine=5 +Dynamic Word Wrap=true +JumpList= +TextFolding=[] +ViMarks=.,1,0,[,1,0,],1,0 + +[view-settings,view=0,item:content/preparation.tex] +CursorColumn=866 +CursorLine=125 +Dynamic Word Wrap=true +JumpList= +TextFolding=[] +ViMarks=.,123,241,[,123,232,],123,241 + +[view-settings,view=0,item:content/results.tex] +CursorColumn=0 +CursorLine=195 +Dynamic Word Wrap=true +JumpList= +TextFolding=[] +ViMarks=.,131,180,[,131,177,],131,180 + +[view-settings,view=0,item:content/theory.tex] +CursorColumn=404 +CursorLine=125 +Dynamic Word Wrap=true +JumpList= +TextFolding=[] +ViMarks=.,66,39,[,66,39,],66,39 + +[view-settings,view=0,item:thesis.tex] +CursorColumn=22 +CursorLine=46 +Dynamic Word Wrap=false +JumpList= +TextFolding=[] +ViMarks=.,12,39,[,12,39,],12,39 diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..28b5e34 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,68 @@ +DOCUMENT=thesis +#MODE=-interaction=batchmode + +all: clean xelatex + echo + +xelatex: compile_xelatex + mv $(DOCUMENT)-xelatex.pdf ../pdf/$(DOCUMENT).pdf + +compile_xelatex: + xelatex $(MODE) $(DOCUMENT) + bibtex $(DOCUMENT) + xelatex $(MODE) $(DOCUMENT) + xelatex $(MODE) $(DOCUMENT) + mv $(DOCUMENT).pdf $(DOCUMENT)-xelatex.pdf + +pdflatex: compile_pdflatex + mv $(DOCUMENT)-pdflatex.pdf ../pdf/$(DOCUMENT).pdf + +compile_pdflatex: + pdflatex $(MODE) $(DOCUMENT) + bibtex $(DOCUMENT) + pdflatex $(MODE) $(DOCUMENT) + pdflatex $(MODE) $(DOCUMENT) + mv $(DOCUMENT).pdf $(DOCUMENT)-pdflatex.pdf + +lualatex: compile_lualatex + mv $(DOCUMENT)-lualatex.pdf ../pdf/$(DOCUMENT).pdf + +compile_lualatex: + lualatex $(MODE) $(DOCUMENT) + bibtex $(DOCUMENT) + lualatex $(MODE) $(DOCUMENT) + lualatex $(MODE) $(DOCUMENT) + mv $(DOCUMENT).pdf $(DOCUMENT)-lualatex.pdf + +switch_to_hungarian: + sed -i "s|^\\\input{include/thesis-en}|%\\\input{include/thesis-en}|" $(DOCUMENT).tex + sed -i "s|^%\\\input{include/thesis-hu}|\\\input{include/thesis-hu}|" $(DOCUMENT).tex + +test_hu: + ${MAKE} clean compile_xelatex + ${MAKE} clean compile_pdflatex + ${MAKE} clean compile_lualatex + mv $(DOCUMENT)-xelatex.pdf ../pdf/$(DOCUMENT)-xelatex-hu.pdf + mv $(DOCUMENT)-pdflatex.pdf ../pdf/$(DOCUMENT)-pdflatex-hu.pdf + mv $(DOCUMENT)-lualatex.pdf ../pdf/$(DOCUMENT)-lualatex-hu.pdf + +switch_to_english: + sed -i "s|^\\\input{include/thesis-hu}|%\\\input{include/thesis-hu}|" $(DOCUMENT).tex + sed -i "s|^%\\\input{include/thesis-en}|\\\input{include/thesis-en}|" $(DOCUMENT).tex + +test_en: + ${MAKE} switch_to_english + ${MAKE} clean compile_xelatex + ${MAKE} clean compile_pdflatex + ${MAKE} clean compile_lualatex + mv $(DOCUMENT)-xelatex.pdf ../pdf/$(DOCUMENT)-xelatex-en.pdf + mv $(DOCUMENT)-pdflatex.pdf ../pdf/$(DOCUMENT)-pdflatex-en.pdf + mv $(DOCUMENT)-lualatex.pdf ../pdf/$(DOCUMENT)-lualatex-en.pdf + ${MAKE} switch_to_hungarian + +test: test_hu test_en + echo + +clean: + echo Cleaning temporary files... + rm -f *.aux *.dvi *.thm *.lof *.log *.lot *.fls *.out *.toc *.bbl *.blg diff --git a/src/bib/mybib.bib b/src/bib/mybib.bib new file mode 100644 index 0000000..23f33c6 --- /dev/null +++ b/src/bib/mybib.bib @@ -0,0 +1,402 @@ +@misc{dockervirt, + author = {Nick Janetakis}, + howpublished = {\url{https://nickjanetakis.com/blog/comparing-virtual-machines-vs-docker-containers}}, + note = {Megtekintve 2020-02-20}, + title = {Comparing Virtual Machines vs Docker Containers} +} + +@misc{docker-overview, + howpublished = {\url{https://docs.docker.com/engine/docker-overview/}}, + note = {Megtekintve 2020-02-22}, + title = {Docker overview} +} + +@misc{linux-namespaces, + howpublished = {\url{http://man7.org/linux/man-pages/man7/namespaces.7.html}}, + note = {Megtekintve 2020-02-20}, + title = {namespaces - overview of Linux namespaces} +} + +@misc{cgroups, + howpublished = {\url{https://access.redhat.com/documentation/en-us/red\_hat\_enterprise\_linux/6/html/resource\_management\_guide/ch01}}, + note = {Megtekintve 2020-02-20}, + title = {Introduction to Control Groups (Cgroups)} +} + +@misc{mikroszeviz, + author = {Farkas G{\'a}bor}, + howpublished = {\url{https://ithub.hu/blog/post/A\_microservice\_architekturarol\_diohejban/}}, + note = {Megtekintve 2020-02-23}, + title = {A microservice architekt{\'u}r{\'a}r{\'o}l di{\'o}h{\'e}jban} +} + +@misc{kubernetes-pods, + howpublished = {\url{https://kubernetes.io/docs/concepts/workloads/pods/pod/}}, + note = {Megtekintve 2020-02-21}, + title = {Pods} +} + +@misc{kubernetes-replicaset, + howpublished = {\url{https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/}}, + note = {Megtekintve 2020-02-20}, + title = {ReplicaSet} +} + +@misc{kubernetes-deployment, + howpublished = {\url{https://kubernetes.io/docs/concepts/workloads/controllers/deployment/}}, + note = {Megtekintve 2020-02-20}, + title = {Deployments} +} + +@misc{kubernetes-crd, + howpublished = {\url{https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/}}, + note = {Megtekintve 2020-02-20}, + title = {Extend the Kubernetes API with CustomResourceDefinitions} +} + +@misc{kubernetes-hpa, + howpublished = {\url{https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/}}, + note = {Megtekintve 2020-02-23}, + title = {Horizontal Pod Autoscaler} +} + +@misc{kubeless-http, + howpublished = {\url{https://kubeless.io/docs/http-triggers/}}, + note = {Megtekintve 2020-02-23}, + title = {Expose and secure Kubeless functions} +} + +@misc{kubeless-pubsub, + howpublished = {\url{https://kubeless.io/docs/pubsub-functions/}}, + note = {Megtekintve 2020-02-23}, + title = {PubSub events} +} + +@misc{kubernetes-ingress, + howpublished = {\url{https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/}}, + note = {Megtekintve 2020-02-24}, + title = {Ingress Controllers} +} + +@misc{kubernetes-nginx, + howpublished = {\url{https://kubernetes.github.io/ingress-nginx/}}, + note = {Megtekintve 2020-02-24}, + title = {NGINX Ingress Controller} +} + +@misc{github-issue-1, + howpublished = {\url{https://github.com/kubernetes-incubator/metrics-server/issues/131}}, + note = {Megtekintve 2020-02-24}, + title = {Metrics server issue with hostname resolution of kubelet and apiserver unable to communicate with metric-server clusterIP} +} + +@misc{kubeless-quickstart, + howpublished = {\url{https://kubeless.io/docs/quick-start/}}, + note = {Megtekintve 2020-02-22}, + title = {Installation} +} + +@misc{github-hey, + howpublished = {\url{https://github.com/rakyll/hey}}, + note = {Megtekintve 2020-02-21}, + title = {HTTP load generator, ApacheBench (ab) replacement, formerly known as rakyll/boom} +} + +@misc{github-wrk, + howpublished = {\url{https://github.com/wg/wrk}}, + note = {Megtekintve 2020-02-21}, + title = {Modern HTTP benchmarking tool} +} + +@misc{docker-logging, + howpublished = {\url{https://docs.docker.com/config/containers/logging/configure/}}, + note = {Megtekintve 2020-02-25}, + title = {Configure logging drivers} +} + +@misc{kubernetes-ephemeral-storage, + howpublished = {\url{https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/\#local-ephemeral-storage}}, + note = {Megtekintve 2020-02-24}, + title = {Managing Compute Resources for Containers - Local ephemeral storage} +} + +@misc{kubernetes-eviction, + howpublished = {\url{https://kubernetes.io/docs/tasks/administer-cluster/out-of-resource/\#eviction-policy}}, + note = {Megtekintve 2020-02-27}, + title = {Configure Out of Resource Handling - Eviction Policy} +} + +@misc{kubernetes-nodes, + howpublished = {\url{https://kubernetes.io/docs/concepts/architecture/nodes/}}, + note = {Megtekintve 2020-02-27}, + title = {Nodes} +} + +@misc{kubernetes-kubelet, + howpublished = {\url{https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/}}, + note = {Megtekintve 2020-02-27}, + title = {kubelet} +} + +@misc{cloud, + howpublished = {\url{https://www.ibm.com/cloud/learn/cloud-computing}}, + note = {Megtekintve 2020-02-27}, + title = {Cloud computing: A complete guide} +} + +@misc{faas, + howpublished = {\url{https://www.cloudflare.com/learning/serverless/glossary/function-as-a-service-faas/}}, + note = {Megtekintve 2020-02-23}, + title = {What Is Function as a Service (FaaS)?} +} + +@misc{saas, + howpublished = {\url{https://www.infoworld.com/article/3226386/what-is-saas-software-as-a-service-defined.html}}, + note = {Megtekintve 2020-02-21}, + title = {What is SaaS? Software-as-a-service defined} +} + +@misc{paas, + howpublished = {\url{https://www.bmc.com/blogs/saas-vs-paas-vs-iaas-whats-the-difference-and-how-to-choose/}}, + note = {Megtekintve 2020-02-21}, + title = {SaaS vs PaaS vs IaaS: What{\rq}s The Difference and How To Choose} +} + +@misc{iaas, + howpublished = {\url{https://www.techradar.com/news/what-is-infrastructure-as-a-service}}, + note = {Megtekintve 2020-02-21}, + title = {What is Infrastructure-as-a-Service? Everything you need to know} +} + +@misc{os-virt, + howpublished = {\url{https://www.w3schools.in/cloud-virtualization/os-virtualization/}}, + note = {Megtekintve 2020-02-22}, + title = {Operating System (OS) Virtualization} +} + +@misc{docker-layers, + howpublished = {\url{https://medium.com/@jessgreb01/digging-into-docker-layers-c22f948ed612}}, + note = {Megtekintve 2020-02-21}, + title = {Digging into Docker layers} +} + +@misc{kubernetes-runtimes, + howpublished = {\url{https://kubernetes.io/docs/setup/production-environment/container-runtimes/}}, + note = {Megtekintve 2020-02-21}, + title = {Container runtimes} +} + +@misc{kubernetes-concepts, + howpublished = {\url{https://kubernetes.io/docs/concepts/}}, + note = {Megtekintve 2020-02-20}, + title = {Concepts} +} + +@misc{kube-apiserver, + howpublished = {\url{https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/}}, + note = {Megtekintve 2020-02-20}, + title = {kube-apiserver} +} + +@misc{etcd, + howpublished = {\url{https://etcd.io/docs/v3.4.0/learning/data\_model/}}, + note = {Megtekintve 2020-02-20}, + title = {Data model} +} + +@misc{kubernetes-api, + howpublished = {\url{https://kubernetes.io/docs/concepts/overview/kubernetes-api/}}, + note = {Megtekintve 2020-02-20}, + title = {The Kubernetes API} +} + +@misc{kuebrnetes-controller, + howpublished = {\url{https://kubernetes.io/docs/concepts/architecture/controller/}}, + note = {Megtekintve 2020-02-20}, + title = {Controllers} +} + +@misc{kubernetes-node-controller, + howpublished = {\url{https://unofficial-kubernetes.readthedocs.io/en/latest/concepts/nodes/node/\#node-controller}}, + note = {Megtekintve 2020-02-20}, + title = {Node - Node Controller} +} + +@misc{kuebrnetes-components, + howpublished = {\url{https://kubernetes.io/docs/concepts/overview/components/}}, + note = {Megtekintve 2020-02-20}, + title = {Kubernetes Components} +} + +@misc{kubernetes-scheduler, + howpublished = {\url{https://kubernetes.io/docs/concepts/scheduling/kube-scheduler/}}, + note = {Megtekintve 2020-02-20}, + title = {Kubernetes Scheduler} +} + +@misc{kubernetes-kube-proxy, + howpublished = {\url{https://kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/}}, + note = {Megtekintve 2020-02-20}, + title = {kube-proxy} +} + +@misc{kubernetes-service, + howpublished = {\url{https://kubernetes.io/docs/concepts/services-networking/service/}}, + note = {Megtekintve 2020-02-21}, + title = {Service} +} + +@misc{kubernetes-volume, + howpublished = {\url{https://kubernetes.io/docs/concepts/storage/volumes/}}, + note = {Megtekintve 2020-02-21}, + title = {Volumes} +} + +@misc{kubernetes-ingress-resource, + howpublished = {\url{https://kubernetes.io/docs/concepts/services-networking/ingress/}}, + note = {Megtekintve 2020-02-25}, + title = {Ingress} +} + +@misc{kubeless, + howpublished = {\url{https://itnext.io/kubeless-kubernetes-native-serverless-framework-3d0f96e03add}}, + note = {Megtekintve 2020-02-25}, + title = {Kubeless --- Kubernetes Native Serverless Framework} +} + +@misc{kubeless-api-deploy, + howpublished = {\url{https://kubeless.io/docs/advanced-function-deployment/}}, + note = {Megtekintve 2020-02-25}, + title = {Deploying Kubeless Functions using Kubernetes API} +} + +@misc{kubeless-build, + howpublished = {\url{https://kubeless.io/docs/building-functions/}}, + note = {Megtekintve 2020-02-25}, + title = {Build process for functions} +} + +@misc{istio-service-mesh, + howpublished = {\url{https://istio.io/docs/concepts/what-is-istio/}}, + note = {Megtekintve 2020-02-26}, + title = {What is Istio?} +} + +@misc{istio-observer, + howpublished = {\url{https://istio.io/docs/concepts/observability/}}, + note = {Megtekintve 2020-02-26}, + title = {Observability} +} + +@misc{istio-mgmt, + howpublished = {\url{https://istio.io/docs/concepts/traffic-management/}}, + note = {Megtekintve 2020-02-26}, + title = {Traffic Management} +} + +@misc{knative, + howpublished = {\url{https://containerjournal.com/topics/container-management/what-is-knative-and-what-can-it-do-for-you/}}, + note = {Megtekintve 2020-02-26}, + title = {What is Knative, and What Can It Do for You?} +} + +@misc{knative-serving, + howpublished = {\url{https://knative.dev/docs/serving/}}, + note = {Megtekintve 2020-02-27}, + title = {Knative Serving} +} + +@misc{knative-eventing, + howpublished = {\url{https://knative.dev/docs/eventing/}}, + note = {Megtekintve 2020-02-27}, + title = {Knative Eventing} +} + +@misc{knative-thoughts, + howpublished = {\url{https://searchitoperations.techtarget.com/news/252469607/Knative-serverless-Kubernetes-bypasses-FaaS-to-revive-PaaS}}, + note = {Megtekintve 2020-02-27}, + title = {Knative serverless Kubernetes bypasses FaaS to revive PaaS} +} + +@misc{knative-gateweay, + howpublished = {\url{https://knative.dev/v0.9-docs/serving/samples/knative-routing-go/}}, + note = {Megtekintve 2020-02-27}, + title = {Routing across multiple Knative services - Go} +} + +@misc{knative-autoscaler, + howpublished = {\url{https://knative.dev/docs/serving/configuring-the-autoscaler/}}, + note = {Megtekintve 2020-02-27}, + title = {Configuring the Autoscaler} +} + +@misc{knative-autoscaler-component, + howpublished = {\url{https://github.com/knative/serving/blob/master/docs/scaling/DEVELOPMENT.md}}, + note = {Megtekintve 2020-02-24}, + title = {Autoscaling} +} + +@misc{knative-gloo, + howpublished = {\url{https://medium.com/solo-io/gloo-by-solo-io-is-the-first-alternative-to-istio-on-knative-324753586f3a}}, + note = {Megtekintve 2020-02-25}, + title = {Gloo, by Solo.io, is the first alternative to Istio on Knative} +} + +@misc{knative-monitoring, + howpublished = {\url{https://github.com/knative/docs/blob/master/docs/serving/accessing-metrics.md}}, + note = {Megtekintve 2020-02-22}, + title = {Accessing Metrics} +} + +@misc{knative-crd, + howpublished = {\url{https://github.com/knative/serving/blob/master/docs/spec/overview.md}}, + note = {Megtekintve 2020-02-22}, + title = {Resource Types} +} + +@misc{cloudlab, + howpublished = {\url{https://cloudlab.us/technology.php}}, + note = {Megtekintve 2020-01-29}, + title = {Cloudlab - Software Technology} +} + +@misc{influxdb-performance, + author = {Syeda Noor Zehra Naqvi and Sofia Yfantidou}, + howpublished = {\url{https://cs.ulb.ac.be/public/\_media/teaching/influxdb\_2017.pdf}}, + note = {Megtekintve 2020-03-29}, + title = {Time Series Databases and InfluxDB} +} + +@misc{microservices-apply, + howpublished = {\url{https://microservices.io/articles/applying.html}}, + note = {Megtekintve 2020-02-29}, + title = {Applying the microservice architecture pattern language} +} + +@misc{microservices-intro, + author = {Chris Richardson}, + howpublished = {\url{https://www.nginx.com/blog/introduction-to-microservices/}}, + note = {Megtekintve 2020-02-10}, + title = {Introduction to Microservices} +} + +@misc{microservices-apigateway, + author = {Chris Richardson}, + howpublished = {\url{https://www.nginx.com/blog/building-microservices-using-an-api-gateway/}}, + note = {Megtekintve 2020-03-20}, + title = {Building Microservices: Using an API Gateway} +} + +@misc{microservices-messagequeue, + author = {Alexander Nnakwue}, + howpublished = {\url{https://blog.logrocket.com/understanding-message-queuing-systems-using-rabbitmq/}}, + note = {Megtekintve 2020-03-10}, + title = {Understanding message queuing systems using RabbitMQ} +} + +@misc{microservices-timeseriesdb, + howpublished = {\url{https://www.influxdata.com/time-series-database/}}, + note = {Megtekintve 2020-02-28}, + title = {Time series database (TSDB) explained} +} + diff --git a/src/content/abstract.tex b/src/content/abstract.tex new file mode 100644 index 0000000..84baf8d --- /dev/null +++ b/src/content/abstract.tex @@ -0,0 +1,37 @@ +\pagenumbering{roman} +\setcounter{page}{1} + +\selecthungarian + +%---------------------------------------------------------------------------- +% Abstract in Hungarian +%---------------------------------------------------------------------------- +\chapter*{Kivonat}\addcontentsline{toc}{chapter}{Kivonat} + +Napjainkban a mezőgazdaságban egyre elterjedtebbek a dolgok internetére (Internet of Things – IoT) épülő megoldások, ezek viszont nagy mennyiségű adatot generálnak, amelyek feldolgozása tradicionális rendszerekkel nehézkes. Erre a problémára tud megoldást nyújtani egy jól skálázódó felhő-natív adatfeldolgozó és elemző rendszer, amelynek tervezése és megvalósítása több kihívást is rejt magában. +Kártevő madarak hang alapján történő gyors és automatikus azonosítása fontos feladat, ugyanis például a seregélyek akár több tízmillió forint kárt is képesek okozni egy nagyobb szőlőbirtoknak. Dolgozatunkban seregélyek hang alapján történő azonosítása és riasztása a kitűzött cél, ezzel segítve a szőlősgazdákat. +Az ilyen rendszerek esetében fontos elvárás a közel valós idejű reakció, különben nem képes hatékonyan támogatni a megfigyelni vagy felügyelni kívánt folyamatokat. Ezért a rendszer komponenseinek telepítése és elhelyezése során biztosítani kell, hogy egy adatpont átfutási ideje és az egyes komponensek válaszideje is bizonyos keretek között maradjon. A rendszer tervezése során további lehetőségeket vetnek fel az az edge cloud megoldások. +Dolgozatunk keretein belül egy ilyen rendszer tervezését és fejlesztését mutatjuk be. Ehhez elkészítettem a rendszer architektúrájának tervét, a komponensek közötti interfészeket. A rendszer kidolgozása során számos általános problémát megoldó komponens készült el, valamint több, a seregélyek hangját felismerő elemet is felhasználtam. Ezen az elkészült rendszeren méréseket végeztünk, hogy annak változó méretű és jellegű terhelés alatti működését felmérjük. Az elvégzett méréseket és azok eredményeinek analízisét automatizáljuk, felgyorsítva ezek értelmezését. +A tervezés és fejlesztés során cél kizárólag nyílt forráskódú és szabadon elérhető komponensek, valamint szolgáltatófüggetlen Kubernetes technológiák használata. Így a rendszer felhő szolgáltatók között gyorsan és könnyedén hordozható marad, de komolyabb nehézségek nélkül telepíthető saját Kubernetes fürtbe is. + +\vfill +\selectenglish + + +%---------------------------------------------------------------------------- +% Abstract in English +%---------------------------------------------------------------------------- +\chapter*{Abstract}\addcontentsline{toc}{chapter}{Abstract} + +Nowadays many smart agricultural solutions leverage the novel mechanisms of Internet of Things (IoT), which in turn generate large volume of data that cannot be processed efficiently with legacy data processing methods. This shortcoming can be successfully addressed by cloud native data processing and analytics systems, but due to their complexity, the design and deployment of such systems pose their own challenges. +Fast and automatic recognition of pest birds is important as they can cause great financial harm to larger vineyards. In our work we focused on the detection and deterrence of Sturnus Vulgaris, one such pest bird. +The IoT systems we discuss require tight, near instant response times, otherwise they cannot efficiently support the processes they are supposed to monitor or control. To ensure this, during installation and scheduling of each component the round-trip time of datapoints and the response time of each component must be kept within certain limits. When planning such systems edge cloud solutions give developers tools to achieve this. As a part of our paper we discuss the design and development of such systems. To do this we designed and developed such a system from the ground up and measured its behaviour under loads of varying size and nature. We automated these measurements and their analysis to speed up further research. +During design and development, we had a goal to exclusively use free and open source components as well as a provider-independent Kubernetes distribution. By doing this our system can be moved between cloud providers with relative ease and it may also be deployed to a self-hosted Kubernetes cluster quite easily. + +\vfill +\selectthesislanguage + +\clearpage +\newcounter{romanPage} +\setcounter{romanPage}{\value{page}} +\stepcounter{romanPage} diff --git a/src/content/acknowledgement.tex b/src/content/acknowledgement.tex new file mode 100644 index 0000000..e01ea2e --- /dev/null +++ b/src/content/acknowledgement.tex @@ -0,0 +1,9 @@ +%---------------------------------------------------------------------------- +\chapter*{\koszonetnyilvanitas}\addcontentsline{toc}{chapter}{\koszonetnyilvanitas} +%---------------------------------------------------------------------------- + +K\"osz\"on\"om a konzulensemnek a seg\'itők\'esz hozz\'a\'all\'as\'at \'es \'utmutat\'as\'at Dr. Maliosz Markosznak. K\"osz\"on\"om sz\"uleimnek \'es a bar\'ataimnak a t\'amogat\'ast. + +A szakdolgozatban ismertetett eredmények a Budapesti Műszaki és Gazdaságtudományi Egyetem Villamosmérnöki és Informatikai Kar Balatonfüredi Hallgatói Kutatócsoport szakmai közössége keretében jöttek létre a régió gazdasági fejlődésének elősegítése érdekében. Az eredmények létrehozása során figyelembe vettük a balatonfüredi központú Rendszertudományi Innovációs Klaszter által megfogalmazott célkitűzéseket, valamint a párhuzamosan megvalósuló EFOP 4.2.1-16-2017-00021 pályázat támogatásával elnyert „BME Balatonfüredi Tudáscentrum” térségfejlesztési terveit. + +A kutatás az Európai Unió támogatásával, az Európai Szociális Alap társfinanszírozásával valósult meg (EFOP-3.6.2-16-2017-00013, Innovatív Informatikai és Infokommunikációs Megoldásokat Megalapozó Tematikus Kutatási Együttműködések). diff --git a/src/content/appendices.tex b/src/content/appendices.tex new file mode 100644 index 0000000..42df043 --- /dev/null +++ b/src/content/appendices.tex @@ -0,0 +1,209 @@ +% !TeX root = ../thesis.tex +%---------------------------------------------------------------------------- +\appendix +%---------------------------------------------------------------------------- +\chapter*{\fuggelek}\addcontentsline{toc}{chapter}{\fuggelek} +\setcounter{chapter}{\appendixnumber} +%\setcounter{equation}{0} % a fofejezet-szamlalo az angol ABC 6. betuje (F) lesz +\numberwithin{equation}{section} +\numberwithin{figure}{section} +\numberwithin{lstlisting}{section} +%\numberwithin{tabular}{section} + +\section{Knative Autoscaler napl\'o feldolgoz\'as\'at v\'egző k\'od} +\label{sec:log-analyze} +\begin{lstlisting}[label=code:log-analyze] +class LogAnalyzer(Analyzer): + def __init__(self): + super().__init__(typeof='.txt') + self.concurrencypersec = [] + self.podpersec = [] + self.start = datetime.datetime.now() + self.end = datetime.datetime.now() + + def listtodict(self, inlist: list) -> dict: + it = iter(inlist) + res_dct = dict(zip(it, it)) + return res_dct + + def processfile( + self, + fname, + shouldprint: bool = False) -> dict: + dictofsecs = {} + if 'date' in fname: + return {} + with open(fname, 'r') as inputFile: + line = inputFile.readline() + while line: + try: + linedict = json.loads(line) + try: + currdate = linedict['ts'].split( + '.')[0].replace('T', ' ') + dateformatted = datetime.datetime.strptime( + currdate, '%Y-%m-%d %H:%M:%S') + if self.start < dateformatted < self.end: + message = linedict['msg'] + messagelist = re.split('[ =]', message) + messagedict = self.listtodict(messagelist) + messagedict['ts'] = dateformatted + if 'ObservedStableValue' in messagedict: + if messagedict['ts'] not in dictofsecs: + dictofsecs[messagedict['ts']] = { + 'pod': [], 'cc': []} + dictofsecs[messagedict['ts']]['pod'].append( + float(messagedict['PodCount'])) + dictofsecs[messagedict['ts']]['cc'].append( + float(messagedict['ObservedStableValue'])) + except Exception as exception: + print(exception) + except json.JSONDecodeError: + continue + finally: + line = inputFile.readline() + return dictofsecs + + def readconfigdates(self, directory='.'): + dates = [] + with open(directory + "/dates.txt", 'r') as inputFile: + line = inputFile.readline().rstrip() + currline = 0 + while line: + dateformatted = datetime.datetime.strptime( + line, '%Y-%m-%d %H:%M:%S') + dates.append(dateformatted) + line = inputFile.readline().rstrip() + currline += 1 + self.start = dates[0] + self.end = dates[1] + + def averagepersec( + self, + dictoftimes: dict, + shouldprint: bool = False) -> None: + for key, value in dictoftimes.items(): + pod = value['pod'] + concurrency = value['cc'] + avgpod = average(pod) + avgcc = average(concurrency) + self.podpersec.append(avgpod) + self.concurrencypersec.append(avgcc) + if shouldprint: + print(avgpod) + print(avgcc) + + def work(self, directory: str = '.') -> None: + files = super().getfiles(directory) + self.readconfigdates(directory) + filelines = {} + for afile in files: + filelines.update(self.processfile(afile)) + self.averagepersec(filelines, False) + +\end{lstlisting} + +\section{Folyamatos terhel\'est gener\'al\'o m\'er\'est v\'egző szkriptr\'eszlet Bash nyelven} +\begin{lstlisting}[label=code:bash-banchmark-for] +if [[ $* == *"--for"* ]]; then + for num in 1 2 3 4 5 6 7 8 9 10; do + echo -e "for $num\n" + if $kubeless; then + if [[ $* == *"--loadtest"* ]]; then + loadtest -k -H "Host: $function.kubeless" --rps $rps -c $connection -t $time -p "$function_firendly".body http://$kuberhost/"$function" >./data/"$function"."$num".txt + else + hey -c "$connection" -q $rps -z "$time" -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" >./data/"$function"."$num".csv + fi + else + if [[ $* == *"--loadtest"* ]]; then + loadtest -k -H "Host: $function.default.example.com" --rps $rps -c $connection -t $time http://$kuberhost/ >./data/"$function"."$num".for.csv + else + hey -c "$connection" -q $rps -z "$time" -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ >./data/"$function"."$num".for.csv + fi + fi + done +fi +\end{lstlisting} + +\clearpage +\section{Emelkedő terhel\'est megval\'os\'itő m\'er\'es Bash szkriptnyelven} +\begin{lstlisting}[label=code:bash-banchmark-climb] +if [[ $* == *"--climb"* ]]; then + while [[ $climb -lt $climb_max ]]; do + climb_rps=$((rps * climb)) + echo -e "Rps: $climb_rps" + if $kubeless; then + if [[ $* == *"--loadtest"* ]]; then + loadtest -k -H "Host: $function.kubeless" --rps $climb_rps -c 1 -t $time -p "$function_firendly".body http://$kuberhost/"$function" >./data/"$function"."$climb_rps".climb.txt + else + hey -c $climb -q $rps -z $time -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" >./data/"$function"."$climb_rps".climb.csv + fi + else + if [[ $* == *"--loadtest"* ]]; then + loadtest -k -H "Host: $function.default.example.com" --rps $climb_rps -c 1 -t $time http://$kuberhost/ >./data/"$function"."$climb_rps".climb.txt + else + hey -c $climb -q $rps -z $time -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ >./data/"$function"."$climb_rps".climb.csv + fi + fi + climb=$((climb + 1)) + done +fi +\end{lstlisting} + +\section{Jmeter kimenet\'et feldolgoz\'o k\'odr\'eszlet, Python nyelven} +\begin{lstlisting}[label=code:jmeter-analyze] +class JmeterAnalyzer(CsvAnalyzer): + def __init__(self): + super().__init__() + self.responsepersec = {} + + def processfile( + self, + fname, + shouldprint: bool = False): + with open(fname, 'r') as f: + data = csv.reader(f) + fields = next(data) + for row in data: + items = zip(fields, row) + item = {} + for (name, value) in items: + item[name] = value.strip() + sec = datetime.datetime.fromtimestamp( + int(item['timeStamp']) / 1000.0).strftime('%c') + if sec not in self.responsepersec: + self.responsepersec[sec] = [] + self.responsepersec[sec].append(float(item['Latency'])) + + def collectinfo(self, shouldprint: bool = False) -> None: + self.walkresponsepersec(self.responsepersec, shouldprint) +\end{lstlisting} + +\clearpage +\section{Hey kimenet\'et feldolgoz\'o k\'odr\'eszlet, Python nyelven} +\begin{lstlisting}[label=code:hey-analyze] +class HeyAnalyzer(CsvAnalyzer): + def __init__(self): + super().__init__() + + def processfile( + self, + fname, + shouldprint: bool = False): + with open(fname, 'r') as f: + data = csv.reader(f) + fields = next(data) + responsepersec = {} + for row in data: + items = zip(fields, row) + item = {} + for(name, value) in items: + item[name] = value.strip() + sec = int(item['offset'].split('.')[0]) + if sec not in responsepersec: + responsepersec[sec] = [] + else: + responsepersec[sec].append(float(item['response-time'])) + self.walkresponsepersec(responsepersec, shouldprint) + +\end{lstlisting} diff --git a/src/content/closing.tex b/src/content/closing.tex new file mode 100644 index 0000000..920fe0c --- /dev/null +++ b/src/content/closing.tex @@ -0,0 +1,60 @@ +% !TeX root = ../thesis.tex +\chapter{A rendszer teljesítménymérése} +Dolgozatunk e fejezetében bemutatunk egy olyan módszertant és eszközöket, amik segítségével egy komplex mikroszolgáltatásokból álló rendszerben megtalálhatók az esetleges gócpontok, valamint azok orvoslására javaslat tehető. Emellett bemutatjuk az ennek kidolgozásához és ellenőrzéséhez felhasznált eszközöket. +\section{Mérési környezet ismertetése} +A fejlesztés és teljesítménymérés idejére létrehoztunk egy Kubernetes klasztert, amiben futtattuk a rendszert. A klaszterben három Master és ugyanennyi Worker volt, mindegyik virtuális gépen futott, Microsoft Hyper-V hypervisorban. A Mastereknek kettő processzormagja és nyolc gigabájt memóriája volt, a Workereknek négy magot, valamint tizenhat gigabájt memóriát allokáltunk. A klaszter három fizikai gépen futott, mindegyikben Intel Xeon E5-2450L processzor, valamint 64 gigabájt memória volt. Egy Master és egy Worker példányt telepítettünk mindegyik fizikai gépre. +<Ábra a fizikai architektúráról> +A fizikai hosztgépek kétszer egy gigabites hálózaton kerültek összekötésre. Amint az <ÁBRAHIVATKOZÁS> -n is látható, az egyik hálózaton a hypervisorok és a virtuális gépek az internetet érték el, ezt csak frissítések és csomagok letöltésére használtuk. Emellett egy fizikailag teljesen különálló hálózat állt a virtuális gépek rendelkezésére a klaszter forgalmának lebonyolítására. +Mivel a fürtnek számos tagja volt, telepítettünk egy külön fizikai gépre egy HAProxy HTTP és TCP terheléselosztót, ami a kéréseket roundrobin algoritmussal osztotta el az egyes node-ok között. Ennek segítségével volt elérhető az egyes mikroszolgáltatások API-ja és az MQTT broker az IoT eszközök számára. Ebben a fizikai gépben egy Intel Core i5 2550K és 16 gigabájt ram volt. +A Kubernetes klaszterben a Calico hálózati implementációt használtuk, ami nem hoz létre virtuális hálózatot a meglévő fölé, hanem az egyes alkalmazások és kompnensek között különálló IP alhálózatok és útvonalválasztás segítségével biztosítja a megfelelő izolációt. Emellett NGINX Ingress Controllert használtunk. Ez egy NGINX webszerver konfigurációjával realizálja az Ingress Controller funkcionalitását. +A mikroszolgáltatásokat kiszolgáló relációs adatbázisokat egy külön virtuális gépen futó PostgreSQL szolgálta ki, aminek 2 processzormagot és két gigabájt memóriát allokáltunk. +A méréseket futtató számítógépben egy Core i7 3770 és 16 gigabájt ram volt, valamint csatlakozott mind a publikus, mint a magánhálózatra. + +\section{Mérőszoftver ismertetése} +Mint azt az előző fejezetben ismertettük a leghosszabb út, amit egy minta és az arra generált válasz megtehet egy seregélyként kategorizált minta tesz meg. Ebből következik, hogy egy kritikus mérés a beküldött HTTP kérések és az érkező MQTT üzenetek között eltelt idő lehet. Olyan kész mérőeszköz viszont, ami ennek a mérésére képes nem elérhető, ezért egy saját mérőeszköz fejlesztése mellett döntöttünk. +Annak érdekében, hogy a lehető leggyorsabban legyen képes a szoftver kéréseket generálni azokat indulás után először kigenerálja azok törzsét az Input Service elvárt sémában található eszközazonosító kitöltésével, a többi mező és rész előre beállított sablont érintetlenül hagyásával. Parancssori paraméterként megadható a használni kívánt konkurenciaszám, ami egy külön folyamatot jelent. Az egyes folyamatok a következő lépésben egy saját listában nyilvántartják az aktuális rendszeridőt, elküldenek egy HTTP kérést az előre elkészítettek közül, majd egy másik listába is feljegyzik a rendszeridő aktuális értékét. Fontos kiemelni, hogy az egyes worker folyamatok minden kérés végéig blokkolnak, azaz megvárják, amíg megérkezik a válasz. Ezt a lépést addig ismétlik, amíg a mérést felügyelő folyamat – az előre beállított idő leteltével – le nem állítja őket. Ez alatt és után 600 másodpercig, szintén külön folyamatban, a szoftver fogadja az MQTT-n érkező üzeneteket és feljegyzi azok érkezési idejét egy listába. +Miután minden folyamat végzett, a különböző HTTP kéréseket generáló folyamatoktól lekérdezi a küldési és fogadási időpontokat tartalmazó listákat és egyesíti azokat egy-egy nagy listába, amik a kérések elküldése szerint kerülnek rendezésre. Ez úgy lehetséges, hogy a szoftver minden kéréshez rendel egy egyedi azonosítót, amit a listában az időbélyeg mellé csatol. Ugyanez teszi lehetővé az MQTT üzenetek HTTP kérésekhez párosítását, ugyanis a mérni kívánt rendszer a bemeneti API-ján elfogad egy egyedi azonosítót, amit felhasznál az MQTT téma összeállítása során. Amennyiben a mérések során minden esetben egyedi azonosítóval látunk el egy-egy kérést, azok végig egyértelműen azonosíthatók maradnak lehetővé téve az egyes mérőkomponensek külön folyamatba választását. + +\section{Mérőszoftver értékelése} +Amennyiben a mérőszoftver segítségével méréseket futtatnánk a kapott eredmények csekély információt hordoznának egyéb adatok híján, ugyanis bizonytalan lenne, hogy a mérés a rendszer vagy a mérőeszköz legjobb teljesítményét mutatja, nem tudjuk melyik teljesítményét mértük ki. A mérőszoftvert Pythonban készítettük, ezért annak teljesítménye nem feltétlen haladja meg a mért rendszerét. +Ezt a problémát megoldandó elkészítettünk egy a rendszert imitáló webes alkalmazást. Az alkalmazást Kotlinban írtuk, amiben a korutinok segítségével könnyű aszinkron, nem blokkoló kód írása. Ennek köszönhetően az alkalmazás minden HTTP kérést aszinkron módon szolgál ki, ezzel emelve az alkalmazás áteresztőképességét. Amennyiben az alkalmazáshoz GET kérés érkezik, az egy nullás karakterrel tér vissza. Ezt a viselkedést a mérő alkalmazás működésének tesztelésére hoztuk létre. Ha az alkalmazáshoz POST kérés érkezik, ellenőrzi, hogy a kérés megfelel-e az Input Service által elvártaknak. Amennyiben nem, 500-as hibakóddal válaszol. Amennyiben a kérés átmegy a validáción, a kérés törzséből beolvassa az eszközt – vagy ez esetben a kérést – azonosító mező értékét és aszinkron módon küldd egy üzenetet az MQTT brókernek továbbításra a megfelelő témára, majd válaszol a kérésre egy húsz karakter hosszú karakterlánccal. Ez utóbbi célja, hogy a HTTP válasz mérete is nagyságrendileg akkora legyen, mint amekkorát az Input Service küldene. +Ennek az alkalmazásnak referenciaként teszteltük a teljesítményét az Apache Benchmark (ab) eszközzel. + +Az <ÁBRAHIVATKOZÁS> n is látható, hogy az ab (ab oszlop) és az általunk készített szoftver (BirbBench – requests oszlop) nagy a különbség teljesítmény téren. Ezt a különbséget nem tartottuk elfogadhatónak . A gyanú gyorsan az általunk használt Python HTTP kliensre, a requests-re terelődött, ugyanis az teljes egészében Pythonban készült, valamint a PyCurlhöz összehasonlító teljesítménymérésekben lemarad. Utóbbi egy vékony Python réteg a C-ben implementált libcurl felett. Valóban, a PyCurl használata esetén a mérőeszköz által mért áteresztőképesség jobban megközelítette az ab által elértet, de nem érte azt el, viszont ez nem volt célunk. Ezen mérések által van referenciánk arról, milyen karakterisztikákkal rendelkezik a mérőszoftverünk HTTP kliense. +Az MQTT komponens értékelése során is nem várt anomáliát figyeltünk meg. Amint az <ÁBRAHIVATKOZÁS>n megfigyelhető, az MQTT üzenetek késleltetési ideje a HTTP kérésekhez képest a mérés során szigorúan monoton növekedett, ami arra enged következtetni, hogy vagy a broker áteresztőképességénél nagyobb rátával küldi neki az üzeneteket a Kotlinos alkalmazás, vagy a kliens képes túl lassan fogadni az üzeneteket. Előbbire enged következtetni, hogy a broker folyamata a Workeren egy processzormagot teljesen kihasznál. +<ábra: mqtt latency megy fel, mint a 21-es busz a normáfra> +A fenti hipotézis ellenőrzésére elkészítettünk egy olyan Kotlin programot, ami letárolja az egy másodperc alatt érkezett üzeneteket, majd ezt összehasonlítottuk a Pythonban készült mérőszoftverrel. Az összehasonlítás során +Ezek alapján arra következtettünk , hogy az általunk használt Apache Artemis MQTT broker egy példányt használva a számunkra elérhető hardveren körülbelül száz egyedi témára érkező üzenetet képes továbbítani. + +\section{Skálázódási lehetőségek felmérése} +Méréseinkkel a rendszer skálázhatóságát szerettük volna megvizsgálni, viszont ehhez tudnunk kellett, mely komponenseket érdemes skálázni, melyek azok a mikroszolgáltatások, amk egy adott kérést a legtovább dolgozzák fel, ezzel a rendszerben szűk keresztmetszetként viselkednek. Mivel a mikroszolgáltatásaink egy távoli Kubernetes klaszterben futnak a tradicionális, fejlesztői eszközökbe épített profilozó használata nem lehetséges. Ezt a problémát hivatottak megoldani az Alkalmazás Teljesítmény Monitorozó eszközök. Számos ilyen eszköz elérhető, mint például a Jaeger, vagy a mikroszolgáltatásokban keletkezett hibákat is gyűjteni képes Sentry. Ezek között a különbség tipikusan a támogatott nyelvek és a szerverben használt technológiákban rejlik, mindegyik képes egy megjelölt kódblokk futási idejét monitorozni. A projekt fejlesztése során Sentryt használtunk az elosztott hibakeresési képességei, valamint elsőrangú Python támogatása miatt. +Ezen vizsgálatok során a módszertanunk az volt, hogy a rendszerbe beküldtünk egyetlen mintát, valamint korábban ismertetett mérőeszközzel generáltunk nagyobb terhelést a rendszerben, majd a Sentry által aggregált adatokat összevetettük és értkeltük. Minden mérést húsz alkalommal ismételtünk és az eredmények mértani közepét vettük annak érdekében, hogy egy-egy kiemelkedő mérés ne befolyásolja aránytalanul a kapott eredményeket. + +Általánosan elmondható volt a tesztek alapján, hogy a hangmintákkal dolgozó, valamint mesterséges intelligenciát alkalmazó mikroszolgáltatások válaszideje nagyságrendekkel nagyobb, mint a csak szöveges adatokkal dolgozóké. Ennek oka valószínű az Input és a Storage mikroszolgáltatások esetében a HTTP kérések mérete lehet, a Classification Service-nél pedig a mesterséges intelligencia futási idejéből adódhat a magas átfutási idő. Ezt ellenőrizendő finomítottuk a használt tranzakciókat, hogy a kérdéses HTTP kérések során elvégzett műveletek ideje pontosan látszódjon. + +Ez alapján (ahogy az <ÁBRAHIVATKOZÁS> is látható) megállapítható, hogy valóban a kérés fogadása, valamint a kezelése tart sokáig az Input Service-ben, az egyéb műveletek rövid idő alatt lezajlanak. Ennek okán az egyik skálázásra kijelölt komponenspár az Input és Storage Service-ek voltak. + +Úgy döntöttünk ezeket közösen érdemes skálázni, hiszen az <ÁBRAHIVATKOZÁS>t összevetve az <ÁBRAHIVBATKOZÁS>val is megfigyelhető, hogy a Storage Service esetében a HTTP kérés fogadásával és a hangfájl multipart kérésből kivételével eltöltött idő igen közel van az Input Service-nél tapasztaltakhoz. Ez egy várható eredmény volt, ugyanis mindegyik mikroszolgáltatás Python nyelven, a Flask webes keretrendszert használva készült, így ezen műveletek implementációja és belső viselkedése nagyon hasonló. + +A Classification Service-t górcső alá véve a korábbi hipotézisünk beigazolódni látszik, ugyanis a minta feldolgozásával eltöltött idő közel 85\%-át tölti a mesterséges intelligencia futtatásával a mikroszolgáltatás. Ez azt jelenti, hogy nagy számú egyidejű beérkező minta esetén mindenképpen skálázni kell ezt a mikroszolgáltatást is. +A többi mikroszolgáltatás esetében nem tartottuk indokoltnak a skálázás alkalmazását, ugyanis azok nagy számú konkurens kliens esetében is alacsony válaszidővel képesek voltak feldolgozni az egyes kéréseket, így azok a rendszer áteresztőképességét nem korlátozzák. + +\section{Input és Storage Service-ek skálázásának vizsgálata} +Száz konkurens kliens esetén az Input Service késleltetése nem növekszik meg lényegesen az egy, vagy húsz konkurens kliensek esetén mérttől, amint azt <ÁBRAHIVATKOZÁS>n is láthatjuk. Ez jó jel a skálázhatóságára tekintve, ugyanis ebből arra következtethetünk, hogy ez a mikroszolgáltatás kiszámíthatóan reagál a változatos terhelésekre. Ez alapján megsejthetjük, hogy amennyiben kettő példányt indítunk a komponensből annak áteresztőképessége közel kétszeresére növekedik. Ehhez viszont ki kell kössük, hogy a Storage Service skálázása is szükséges, ellenben az továbbra is szűk keresztmetszet marad. + +A sejtés beigazolódni látszik, ugyanis míg ez a két mikroszolgáltatás egy-egy példányt használtva tíz kérést volt képes feldolgozni másodpercenként, kettő példányt használva húszat, öt esetében pedig negyvennyolcat. + + +\section{Classification Service skálázásának vizsgálata} +A Classification Service bemeneti interfésze, mivel üzenetsoron kapja a bemeneti adatokat más jellegű, mint az Input vagy a Storage Service-eké. A teljesen aszinkron bemeneti interfészén csak akkor kap adatot, ha épp nem dolgoz fel egy másikat, valamint az aszinkron kimeneti interfésze miatt nem blokkolja másik mikroszolgáltatás sem. Emiatt az üzenetsor egyfajta terheléselosztóként is felfogható. + +A fent leírtak alapján azt várjuk, hogy a mikroszolgáltatás skálázása esetén a komponens áteresztőképessége a replikák számával arányosan fog nőni. Amint ez <ÁBRAHIVATKOZÁS>n látható, ez így van, amíg egy példány két mintát képes másodpercenként feldolgozni, tíz példány húszat, húsz példány pedig negyvenet. + +\section{Eredmények értékelése} +A fejezetben ismertetett mérések eredményeiből számos konzekvencia levonható a rendszerrel kapcsolatban. Az első, hogy a teljesítmény szempontjából szűk keresztmetszetet képző komponensek jól skálázódnak. A szűk keresztmetszet megszüntetésére vagy enyhítésére viszont egyéb alternatívák is láthatók. Az Input és Storage Service-ek vizsgálata esetén érdemes lehet meggondolni azok összevonását, ugyanis ezzel a lépéssel az Input Service válaszideje a felére csökkenthető. Ezen túl a komponens skálázásával jól növelhető az áteresztőképessége. +A Classification Service esetében javasoljuk a Kubenetesben automatikus skálázás alkalmazását, egyedi metrikákat megfogalmazva az üzenetsoron egységnyi idő alatt beérkező üzenetek alapján. Ez megoldja a szűk keresztmetszet problémáját amellett, hogy nem pazarol feleslegesen erőforrást a klaszterben. Ennek a skálázódásnak implementációjánál viszont figyelni kell arra, hogy az új példányok az első minta feldolgozása során le kell kérjék az aktuális modellt a Model Service-től. + +\section{A módszer általános leírása} +Az általunk itt alkalmazott módszer jól felhasználható más hasonló mikroszolgáltatásokra épülő szoftverek esetében. Első lépésként valamilyen Alkalmazás Teljesítmény Monitorozó megoldás használata és integrálása kulcsfontosságú. Ezek segítségével megállapítható, mely mikroszolgáltatások szükségesek vizsgálatra skálázási szempontból, melyek jelenthetik a szűk keresztmetszetet. Természetesen a skálázás előfeltétele, hogy a mikroszolgáltatásaink állapotmentesek legyenek. A szűk keresztmetszetet gyanúsan alkotó mikroszolgáltatások azok lehetnek, melyek legalább egy nagyságrenddel nagyobb idő alatt dolgoznak fel egységnyi kérést a rendszerben, ezek lehetnek érdemesek további vizsgálatra. +Második lépésként meg kell vizsgáljuk a kérdéses komponensek miként viselkednek skálázás esetében. Ezt terheléstesztek segítségével érhetjük el. Amennyiben egy komponens nem skálázódik jól, annak refaktorálására lehet szükség. +Az itt leírt tesztek segítségével elég adatot gyűjthetünk ahhoz, hogy javaslatokat tegyünk a rendszerben esetlegesen szükséges változásokra. diff --git a/src/content/create-functions.tex b/src/content/create-functions.tex new file mode 100644 index 0000000..712aa42 --- /dev/null +++ b/src/content/create-functions.tex @@ -0,0 +1,60 @@ +\chapter{F\"uggv\'enyek l\'etrehoz\'asa} +A rendszerek sajátosságai miatt ugyanazt a kódot nem lehet változtatás nélkül felhasználni a két eltérő rendszerben. Mindkét rendszerre két tesztfüggvényt valósítottam meg. Az egyik célja a lehető legrövidebb válaszidő és a legnagyobb áteresztőképesség. A másik célja a kérésenként nagyobb processzorterhelés generálása. + +Az első egy Go nyelven megvalósított tesztfüggvény, amely a meghívás után “Hello Go!” szöveggel tér vissza. A Kubeless rendszerhez írt függvény szignatúrája egyezik \aref{code:hello-kubeless-go} k\'odr\'eszletben l\'athat\'o függvényével. Függőségként importálni kell a Kubeless sztenderd könyvtárát. + +Knative rendszerben szükség van a Go sztenderd könyvtárban megtalálható HTTP szerver implementációra, valamint egy belépési függvényre, amely elindítja a webszervert és beköti a függvényünket úgy, hogy az alapértelmezett URL - ahol elindul a webszerver - az ide érkező kéréseket továbbítsa neki. Mivel a Knative-ba Docker Image-eket lehet telepíteni, ezért azt is létre kell hozni. Annak érdekében, hogy a végső Image a lehető legkisebb méretű legyen, a Go program binárissá fordítását külön végezzük el, a végső Image-be csak bemásoljuk azt. Erre a Docker ad eszközt, az úgynevezett multi-stage buildek segítségével. Ez azt jelenti, hogy egy külön végrehajtási láncot leírva lefordítjuk a kódot, majd a végső Image-be csak bemásoljuk a fordítással végzett konténer Image-éből. Az elkészült Image-et - melyet le\'ir\'o Dockerfile \aref{code:dockerfile-hello-go} k\'odr\'eszleten l\'athat\'o - a Docker Hubra feltöltöttem, hogy ne kelljen minden frissen telepített Workernek megépítenie az Image-et. + +\begin{lstlisting}[float=!ht,caption={Echo t\'ipus\'u f\"uggv\'eny Docker Image-\'et le\'ir\'o Dockerfile},label=code:dockerfile-hello-go] +FROM golang:1.13 as builder + +WORKDIR /app + +COPY go.* ./ +RUN go mod download + +COPY . ./ + +RUN CGO_ENABLED=0 GOOS=linux go build -v -o server + +FROM alpine:3 + +RUN apk add --no-cache ca-certificates + +COPY --from=builder /app/server /server + +CMD ["/server"] +\end{lstlisting} + +A várhatóan nagyobb processzorterhelést generáló függvényként egy Python nyelven implementált prímszám számoló szerepelt. E függvény viselkedése egyezik mindkét rendszerbe telepített verzió esetében, csupán a bemeneti érték kinyerése tér el. A függvény erről a bemeneti értékről dönti el, hogy az prímszám-e. Kubeless esetében a Go-val ellentétben nincs szükség semmilyen függőség megjelölésére, a megírt függvényt egyből lehet telepíteni. + +A Knative esetében szintén eltérő módon érdemes Docker Image-et készíteni a megírt függvényből. Szükség van a Flask nevű könyvtárra, amely segítségével webes alkalmazásokat lehet készíteni Pythonban. Használata igen hasonló a Go-ban megtalálható implementációhoz. Úgynevezett dekorátor segítségével lehet a Flask számára jelezni, hogy az adott függvény milyen URL meghívásakor fusson le, valamint a használni kívánt port számát is itt lehet megadni. A Docker Image építése során multi-stage build használatára nincsen szükség, hiszen a Python értelmezőnek mindenképpen jelen kell lennie a végső Image-ben is. A Flask telepítése mellett úgy döntöttem, hogy a \textit{gunicorn} Pythonban implementált webszervert is telepítem, valamint azt használom, mint webszervert a Docker Image-ben. Használatának előnye, hogy képes kihasználni a Python által nyújtott multiprocessing lehetőségeket, amely azt jelenti, hogy több Python értelmezőt indítva, több folyamat használatával jobb teljesítményt lehet elérni, mint több szál használatával, ugyanis a Python értelmező egyszerre egy szálon futó programkódot értelmez. + +Minden Knative függvényhez definiáltam egy-egy YAML állományban egy olyan Service-t, amelyhez tartozó podok számát nullára képes leskálázni a rendszer, valamint egy konkurencia alapú skálázást használó Service-t. Az ut\'obbit le\'ir\'o YAML \'allom\'any \aref{code:yaml-isprime-py} k\'odr\'eszleten l\'athat\'o. + +\begin{lstlisting}[float=!ht,caption={Pr\'imsz\'aml\'al\'o f\"uggv\'eny Knative Service obejktum\'at le\'ir\'o YAML},label=code:yaml-isprime-py] +apiVersion: serving.knative.dev/v1alpha1 +kind: Service +metadata: + name: isprime-py-sc-cc + namespace: default +spec: + template: + metadata: + annotations: + autoscaling.knative.dev/class: kpa.autoscaling.knative.dev + autoscaling.knative.dev/metric: concurrency + autoscaling.knative.dev/target: "10" + autoscaling.knative.dev/minScale: "1" + autoscaling.knative.dev/maxScale: "100" + spec: + containers: + - image: tormachris/isprime-python + env: + - name: TARGET + value: "Py" +\end{lstlisting} + +Az elkészített függvényen, valamint a Docker Image-eket leíró Dockerfile-okat Git verziókezelőrendszerrel kezeltem, a létrehozott repository-t a GitHub szolgáltatásba feltöltöttem. Ez lehetővé tette a Travis Continuos Integration/Continuos Delivery rendszer használatát. Ezt arra használtam, hogy a változások nyugtázása után, valamint azok GitHubra történő feltöltése után a Docker Image-ek automatikusan épüljenek meg, valamint kerüljenek fel a Docker Hubra. Fontos, hogy ez nem feltétlen jelenti, hogy a Kubernetes-ben éppen futó vagy később létrejövő podok a legfrissebb Image-et fogják használni. Ehhez szükség van vagy a latest nevű címkét használni vagy az ImagePullPolicy nevű opciót bekapcsolni a Knative Service vagy Kubernetes Deployment definiálásánál. + +Az elkészített függvények Kubeless-be telepítése a korábban telepített parancssori interfész segítségével lehetséges. A függvény telepítése, ahhoz HTTP végpont csatolása, valamint a skálázás létrehozása különálló parancs. Skálázás esetében a processzor limit alkalmazása a függvény telepítését végző parancs argumentumaként adható meg. Ebből adódóan skálázás esetén nem lehet csak a skálázás telepítését végrehajtó parancsot kiadni. A Kubeless függvények telepítését megkönnyítendő, elkészítettem egy Bash nyelven írt szkriptet, amely paramétereként elvárja a függvény és az állomány nevét, ami tartalmazza azt, illetve a futtató környezet nevét és azt, hogy kell-e skálázás. Ezek alapján kiadja a szükséges parancsokat helyesen paraméterezve. Ezáltal a parancssori interfész helyes használatát gyorsabbá és könnyebbé tettem. diff --git a/src/content/introduction.tex b/src/content/introduction.tex new file mode 100644 index 0000000..e569cb0 --- /dev/null +++ b/src/content/introduction.tex @@ -0,0 +1,10 @@ +% !TeX root = ../thesis.tex +%---------------------------------------------------------------------------- +\chapter{\bevezetes} +%---------------------------------------------------------------------------- + +A felhő alapú technológiák elterjedésével egyre növekszik az ilyen megoldások iránti igény. Az ebbenrejlő lehetőségek kihasználására képes alkalmazások fejlesztése egyedi és új kihívásokat jelent. Az ilyen alkalmazások komponensei általában egymástól elválasztottak, lazán kötődnek és állapotmentesek. Ez tipikusan, de nem szükségszerűen mikroszolgáltatás alapú alkalmazás architektúrát, agilis fejlesztési folyamatokat, konténer alapú technológiák használatát jelenti. +Szőlőtulajdonosoknak éves szinten jelentős kárt okoznak a seregélyek, akik előszeretettel választják táplálékul a megtermelt szőlőt. Az ilyen kártevő madarakat elriasztó eszközök általában folyamatos ultrahang kibocsájtásával érik el a kívánt hatást. Ezekhez képes egy intelligens, célzottan működő rendszer a környezetre kisebb ráhatással is elérhet hasonló eredményeket, hiszen nincs szükség a többi állatot is zavaró ultrahang kibocsájtására, ha a kártevők nincsenek jelen. Emellett az Internet of Things és a felhő adta lehetőségeket kihasználva a szőlőültetvények számára az általunk készített rendszer további hozzáadott értéket is hordoz. +Az Internet of Things eszközökről általánosságban elmondható, hogy olyan mindennapi használati tárgyak vagy ipari eszközök, amelyeket hálózati kapcsolattal és számítási kapacitással is felruháztak. Az említett hálózati kapcsolat lehet többek között egyes eszközök közötti, vagy akár egy felhőben lévő rendszerhez is kapcsolódhatnak a készülékek. Nagy számú eszközpark esetén megoldandó probléma a készülékek állapotának megfigyelése és központi irányítása is. +Azért, hogy a riasztás effektív legyen elengedhetetlen a relatív alacsony körbefordulási idő a rendszer és az egyes eszközök között. Ahhoz, hogy megtudjuk egy adott rendszerben ez az érték miként alakul méréseket kell végezzünk. Mikroszolgáltatás alapú rendszerek esetében az is érdekes információ lehet, hogy az egyes mikroszolgáltatások mennyi idő alatt képesek egy adatpontot feldolgozni, hogy reagálnak nagy terhelésre és mennyire skálázhatóak, valamint ezeknek milyen hatása van az egész rendszerre. +Feladatunk egy seregélyeket hang alapján felismerni és elriasztani képes rendszer megtervezése és fejlesztése volt, amely kizárólag nyílt komponenseket használ fel. Kiemelten fontos volt, hogy az általunk elkészített rendszerbe későbbi fejlesztések során könnyedén illeszthetők legyenek más típusú adatok és kimenetek. A rendszer architektúráját ezen szempontok és a korábban ismertetett követelményeket figyelembe véve készítettük el. A rendszer elkészülte után megterveztünk és elvégeztünk méréseket, amiknek a célja a rendszer nagy számú szenzor melletti viselkedésének vizsgálata és az egyes komponensek skálázásának az adatok körülfordulási idejére gyakorolt hatásának elemzése volt. Ezek alapján ajánlásokat fogalmazunk meg a saját rendszerünkre, valamint hasonló rendszerek fejlesztésére vonatkozóan. diff --git a/src/content/preparation.tex b/src/content/preparation.tex new file mode 100644 index 0000000..0a47624 --- /dev/null +++ b/src/content/preparation.tex @@ -0,0 +1,22 @@ +\chapter{A rendszer ismertetése} + +A rendszer tervezését olyan alapvető felelősségekkel kezdtük, mint adatok fogadása, ezek tárolása, valamint továbbítása. A fejlesztési folyamat során ezektől haladtunk az egyre specifikusabbak fele, mint a mesterséges intelligencia által használt modellek tárolása és dinamikus frissítése. Ennek a folyamatnak eredményeképp készítettük el a <ÁBRAHIVATKOZÁS> látható architektúrát. A rendszer minden komponense egy-egy mikroszolgáltatás. Ezt a tervezési folyamat egy korai lépésében döntöttük el. E döntés mögött két indokunk volt. Az első a fejlesztés során a kooperáció könnyebbsége, hiszen a mikroszolgáltatások interfészeinek egyeztetése után azok egymástól függetlenül fejleszthetők, ezzel a kooperációt is elősegítve. Emellett ettől a döntéstől azt vártuk, hogy amennyiben a rendszer tervezése során követjük a korábban leírt ajánlásokat, a komponensek skálázhatósága jobb lesz, így a nagyobb terhelés esetén nem lesz érzékelhető növekedés a válaszidőben. Ebben a fejezetben szeretnénk bemutatni az általunk tervezett architektúrát a beérkező adatok útját bejárva. +\section{Felhő rendszer ismertetése} + +A rendszerbe két típusú adat érkezhet . A kihelyezett eszközök által felvett hangadatok a felhő rendszerbe az Input Service-hez kerülnek be, ahol a beérkezett hangfájl és az azt kísérő üzenet formátumának validálása után az alapvető metaadatok – többek között a küldő eszköz azonosítója, beérkezés dátuma, valamint az egész felhős rendszerben használt egyedi azonosító – eltárolódnak. Ezt követően az állomány továbbításra kerül a Storage Service-nek, ahol egy objektumtárban kerül eltárolásra. Ez azért előnyös, mert ha egy mintát szeretnénk többször is feldolgozni , a feldolgozott mintákat meghallgatni validálás céljából vagy az AI Service-ben használt modellt a rendszer felhasználója pontosítani szeretné a rendelkezésre álló valós mintákkal, akkor lehetőség van azt lekérni egyéb metaadatai mellett az egyedi azonosító segítségével. Erre viszont csak limitált ideig van lehetőség, ugyanis az eltárolt hangfájlok beállítható idő múlva – alapértelmezés szerint egy hét – törlésre kerülnek, hogy a beérkezett minták által elfoglalt lemezterületet kordában tartsuk. A fájl sikeres tárolását követően az Input Service egy üzenetsorra beküldi a minta azonosítóját, ezzel jelezve a feldolgozó komponensnek az új minta beérkezését és azt, hogy milyen azonosítót használhat a Storage Service-től lekérdezéskor. +Az üzenetsoron az AI Service példányai fogadják az üzenetet, ezen komponens felelőssége a minták klasszifikálása többek között seregély, traktor és egyéb zaj kategóriákba. Még mielőtt megkezdhetné a feldolgozást, a Model Service-nél ellenőrzi, hogy elérhető-e újabb modell, amivel dolgozni tud. A Model Service egy képes több típusú – beleértve a felhő rendszerben és az IoT eszközön található mesterséges intelligenciák által használtakat – modelleket képes tárolni, a modellek verzióját követni, valamint visszaadni REST API-n keresztül. Az éppen használt modell friss állapotának eldöntésére lekéri az alapértelmezett modell metaadatait, amiket összevet a lokálisan meglévő modell metaadataival. Amennyiben valóban elérhető újabb modell, letölti azt és onnan betölti további használatra. E mechanizmus által lehetőség van a rendszer által használt modellek dinamikus frissítésére és cseréjére , valamint a Model Service-ben az alapértelmezett modell korábbira visszaállításával akár korábbira visszatérés is könnyedén lehetséges. A modell ellenőrzése után az AI Service-ben található mesterséges intelligencia elvégzi a hangfájl klasszifikációját. Ennek eredményét a minta azonosítójával egyetemben egy másik üzenetsoron publikálja. +Az üzenetsorra érkező adatokat három mikroszolgáltatás fogadja, de az üzenetsornak hála újabb ilyen komponens illesztése a meglévő a rendszerhez könnyedén lehetséges. A Results Service feladata eltárolni minden egyes minta adatait úgy, hogy azok egyesével lekérdezhetők legyenek. Ennek a mikroszolgáltatásnak a segítségével lehetséges harmadik fél által gyártott szoftverekhez csatolni az általunk fejlesztett rendszert. A Metrics Service felelőssége idősoros adatbázisba illeszteni az eredményeket. Az idősor adatbázisból statisztikai lekérdezések segítségével betekintést nyerhetünk a szőlőben a seregélyek mozgásába, tendenciáiba akár egy harmadik fél által fejlesztett dashboarddal. Az utolsó mikroszolgáltatás, ami megkapja a klasszifikációk eredményeit a Guard Service. Ez a mikroszolgáltatás üzenetsoron küld egy riasztási parancsot annak az eszköznek, ahonnan seregélyként detektált minta érkezett. +Az egyes komponensek közötti kommunikáció alapvetően HTTP feletti REST API-k segítségével történik, kivéve az előzőekben említett helyeken. Előbbit olyan esetekben alkalmaztuk, amikor az adott interfész külső alkalmazások felé elérhető, nagy mennyiségű adat átvitele történik, vagy fontos a szinkron kommunikáció. Jó példa a Storage Service interfésze, ugyanis itt fontos tudni, hogy mikor áll készen a mikroszolgáltatás a minta kiszolgálására, valamint egy tipikus JSON formátumú üzenethez képest nagy mennyiségű, bináris adat átvitelét jelenti. Természetesen üzenetsorra is megvalósítható lenne ez a viselkedés, viszont jelentősen bonyolultabb üzleti logikát igényelt volna a megvalósítás, jelentősebb előnyt viszont nem hozna. +Az egyes mikroszolgáltatások közötti üzenetsorok AMQP (Advanced Message Queuing Protocol) felett zajlanak. Emellett akkor döntöttünk, amikor több komponensnek is szüksége van egy művelet eredményére – mint például az AI Service kimenetére reagáló három mikroszolgáltatás –, vagy nem szükséges az adott üzenetre válasznak érkeznie. Ilyen az Input Service által az AI Service-nek küldött értesítés is. +Az interfészek és üzenetek tervezése során kiemelten figyeltünk arra, hogy minden üzenetsoron és REST API-n átvitt adat lehetőleg minél kisebb legyen, csak a szükséges adatok kerüljenek továbbításra. Ezzel is növelve a kommunikáció hatékonyságát és kihasználva a HTTP és üzenetsor előnyeit minimális többletköltség mellett. +A minták fogadásában nem vesz részt a Command and Control Service, felelőssége az egyes eszközök és azok szenzorainak állapotának vezérlése, nyomon követése. A kihelyezett IoT eszközök az állapotukat üzenetsoron jelzik. Egy ilyen üzenet például lehet jelzés, hogy az eszköz valamilyen hibás állapotba került és javítást vagy cserét igényel, esetleg egy szenzorrol nem képes adatot olvasni, kikapcsolni készül vagy épp most kapcsolt be. Egy másik üzenetsoron hallgatják a parancsokat és végrehajtják azokat. Ilyen parancs lehet a mesterséges intelligencia által használt modell frissítése és a szenzor vagy eszköz kikapcsolása. Az irányító üzenetek küldését REST API segítségével lehet kiváltani. A Command and Control Service indulásakor nem ismeri a rendszerben futó eszközöket, azokat az első üzenetük fogadásakor jegyzi fel egy saját relációs adatbázisba, ahol követi az állapotukat. Azokat az eszközöket, amik öt perce nem küldtek státusz üzenetet, a mikroszolgáltatás hibás állapotba lépteti a belső állapotreprezentációjában. Az egy hétnél tovább el nem érhető eszközöket automatikusan kikerülnek az adatbázisból kivéve, ha a felhasználó API hívás segítségével permanensnek nem jelölte azt. +Az eszközök és a felhőben lévő komponensek közti üzenetsoros kommunikáció MQTT (Message Queue Telemetry Transport) protokollon történik, ami mellett annak flexibilis téma (topic) architektúrája mellett döntöttünk. Lehetőség van az egyes üzenetsorok vagy másnéven témák struktúrálására és ezáltal egyszere több témára üzenet küldésére, valamint feliratkozásra. Ezt a Command and Control Service esetében ki is használtuk, ugyanis az egyszere iratkozik fel minden eszköz státuszüzeneteire, valamint a struktúrált témáknak köszönhetően minden vezérlőüzenetet csak a céleszköz kap meg, ami csökkenti a szükséges hálózati forgalmat és az eszközök által feldolgozandó üzenetek számát. +\section{Internet of Things eszköz ismertetése} +Az IoT eszköz architektúrájának tervezése során a legfontosabb szempont az új szenzorok bevezetése volt. Emiatt úgy döntöttünk, hogy az egyes szenzorokat teljesen külön kezeljük. Három alapvető lépést határoztunk meg egy mért adat útja során. Az első a szenzor általi mérés elvégzése, amit az opcionális előfeldolgozás követ. Végezetül, a szoftvernek döntést kell hoznia, hogy az eredményt tovább küldje-e felhőbe, majd a döntést végre is kell hajtsa. +Azért, hogy ez a folyamat minél flexibilisebb legyen, az egyes lépéseket összefogja és indítja egy külön osztály, valamint a mintavételezéseket egy központi, belső óra vezérli. +Itt konkrét, hardveres implementációval nem foglalkoztunk, azt a szoftver tervezése és fejlesztése során elabsztracháltnak tekintettük. + +A felvázolt koncepciót a fenti osztálydiagramon valósítottuk meg. Új szenzor felvétele esetén az ISensor, IPreProcessor, ISender interfészek implementálásával és SignalProcessor osztályból leszármazással, valamint ezek az Application osztályba regisztrálásával lehetséges. Új riasztásra képes forgatókönyv esetében az IActuator interfész implementálásával van lehetőségünk a riasztás elvégzésére. +Az Application osztály tartalmazza az eszközök eseményhurkát, ami lehetővé teszi a szenzorok ismételt mintavételét, előfeldolgozását és a minta felhőbe küldését. Az általunk megvalósított viselkedés során egy ütemben a SoundSignalProcessor vezényli a hangminták kezelését. Az ütem elején egy másodperc hosszú hangmintát vesz az előre bekonfigurált mikrofonról, amit egy mesterséges intelligencia bekategorizál többek között traktor, emberhang, méhek és madárcsicsergés kategóriákba. A madárcsiripelés kategóriába sorolt mintákat továbbítja a felhőbe a SoundSender, ahol az előbbiekben leírt folyamat kerül végrehajtásra. Ez a forgatókönyv <ÁBRAHIVATKOZÁS> látható. Minden harmadik ütem végén küld az eszköz státusz frissítést a felhőnek. + +Az eszköz indulásakor az Application osztály a beállított üzenetsoron elküldi, hogy éppen bekapcsolt, hamarosan elkezd adatokat küldeni és képes parancsok végrehajtására. Utóbbi külön szálon történik, emiatt szükség volt a szenzorok offline és online állapotainak szálbiztos kezelésére a SignalProcessor leszármazottjaiban és az ezeket nyilvántartó listának is hasonlóan szálbiztosnak kell lennie. Az offline szenzorok forgatókönyve kikerül az ütemezett forgatókönyvek közül, viszont futó forgatókönyvet az alkalmazás nem szakít meg. diff --git a/src/content/results.tex b/src/content/results.tex new file mode 100644 index 0000000..e265466 --- /dev/null +++ b/src/content/results.tex @@ -0,0 +1,8 @@ +\chapter{Zárszó} + +\section{További kutatási irányok} + +Az elkövetkező időszakban szándékunkban áll megtervezni és implementálni az előző fejezetben javasolt módosításokat, valamint azok hatékonyságának értékelését is szeretnénk elvégezni. +Úgy gondoljuk a rendszerben számos lehetőség rejlik, amit érdemes lenne kiaknázni, ezért további funkciókkal szeretnénk bővíteni mind az IoT eszközön futó szoftvert, mind a felhő-natív rendszert. Egy ilyen lehet hőmérséklet és egy egyéb adatok felhasználása a seregélyek detekciója és a riasztások tüzelése elején. + +\section{Köszönetnyilvánítás} diff --git a/src/content/theory.tex b/src/content/theory.tex new file mode 100644 index 0000000..e312f4c --- /dev/null +++ b/src/content/theory.tex @@ -0,0 +1,24 @@ +% !TeX root = ../thesis.tex +\chapter{Cloud-native rendszerekről} +\label{sec:theory} + +\section{Felhő} +A felhőalapú számítástechnikában a felhasználó elől elrejtve, a szolgáltató erőforrás halmazán elosztva megvalósított szolgáltatásokat értjük, amit jellemzően virtualizációs technológiára építenek. Három alapvető szolgáltatási modellt különböztetünk meg: SaaS (Software as a Service, Szoftver, mint Szolgáltatás, például: Office 365), PaaS (Platform as a Service, Platform, mint Szolgáltatás, például: Oracle Cloud Platform) és IaaS (Infrastructure as a Service, Infrastruktúra, mint Szolgáltatás, például: Microsoft Azure). További szolgáltatási modellek: Container aaS, Function aaS, etc. +\section{Kubernetes} +A Kubernetes egy Go nyelven írt, nyílt forráskódú konténer orkesztrációs platform, amely képes konténerek automatikus konfigurációjára, skálázására, valamint bizonyos hibák automatikus elhárítására is. Több konténer technológiát támogat, köztük a Dockert is. Nagyon népszerű, gyors fejlesztés alatt álló projekt. Emiatt felhasználói és programozói interfésze gyakran változik, megkövetelve a ráépülő megoldásoktól a hasonló sebességű fejlesztést. Jól definiált interfésze miatt sok ráépülő, azt kiegészítő projekt létezik. A Kubernetes kiváló keretet nyújt mikroszolgáltatás alapú alkalmazások fejlesztésére. +<ábra példa k8s klaszterről> +Egy Kubernetes klaszterben két típusú hosztgép lehet. Mindkettőből lehet több darab, de legalább egy-egy példány kötelező. Egy Kubernetes klaszter legalább egy Masterből és Workerből épül fel, ezek több komponensből állnak. A Kubernetes Master felelős a klaszterben lezajló folyamatok irányításáért, valamint a Slave-ek - vagy más néven Workerek - és az alkalmazások állapotának nyilvántartásáért. Egy Master node számos komponensből áll, ezek a Master egy-egy feladatáért felelnek. Több Master node futtatása esetén - úgynevezett multimaster mode - csak az API Server és az etcd komponensekből jön létre több példány, a többiből egyszerre csak egy példány lehet aktív. +A Kubernetesben különböző objektumtípusokat definiáltak, ezek közül a legfontosabbakat bemutatjuk a következőkben (Pod, Deployment, Service és Ingress). +A Pod egy vagy több konténert összefogó logikai hoszt. Egy podon belül lévő konténerek osztoznak a hálózaton és a háttértáron, valamint azonos a futtatási specifikációjuk. Ez azt jelenti, hogy az egy podon belüli konténerek localhoston keresztül elérik egymást, valamint van lehetőség, hogy a konténerekben futó alkalmazások lássák a másik konténerben futó folyamatokat. Egy Kubernetes rendszerben a Pod a legkisebb egység, amit futásra lehet ütemezni. +A Deployment segítségével deklaratívan leírható egy alkalmazást felépítő podok és azok kívánt állapota. Lehetőség van megadni, hány replikát hozzon létre a rendszer. Hasonló módon lehet a podok állapotát frissíteni vagy egy korábbi állapotra visszatérni. Egy Deploymentben lehetőség van több pod definiálására, ami az alkalmazás komponensek lazább csatolását teszi lehetővé. +A podok bármikor törlődhetnek, valamint új példány jöhet belőlük létre. Minden pod saját IP címmel rendelkezik, viszont szükség van valamilyen módszerre, aminek segítségével nyomon lehet követni, hogy egy pod által nyújtott szolgáltatás milyen címen érhető el. Erre a problémára nyújt megoldást a Service, ami absztrakciót jelent a podok felett. +Néhány fontosabb szolgáltatás, melyet a Kubernetes nyújt: +Horizontális skálázás, +Konfiguráció és szenzitív adatok menedzsmentje, +Háttértár orkesztráció, +Szolgáltatások név alapján történő felderítése. +Ingress erőforrás segítségével klaszteren belüli Service erőforrást lehet azon kívülre kiszolgálni. Ennek módját az Ingress erőforrás határozza meg, amelyet az Ingress Controller nevű klaszter szintű objektum szolgál ki. +\section{Mikroszolgáltatások} +A mikroszolgáltatás vagy mikroszolgáltatás szoftverarchitektúra egy alkalmazás architektúra, amelynek segítségével a komplex, skálázható alkalmazások fejlesztése egyszerűbb, valamint a kódbázis növekedésével átlátható marad. Ezt úgy éri el, hogy az alkalmazást kisebb, önálló komponensekre bontja, ezeket lazán, tipikusan REST API-val, vagy üzenet sorok (message queue) segítségével illeszti egymáshoz. Az architektúra alkalmazása esetén felmerülnek bizonyos problémák, mint például az egyes szolgáltatásoknak meg kell egymást találniuk, vagy több példány futtatása esetén megoldandó a terheléselosztás is. Az így fejlesztett alkalmazások kiválóan illeszkednek a felhő alapú rendszerekhez, például a Kuberneteshez. Mikroszolgáltatás architektúra esetében figyelni kell az úgynevezett rejtett monolitra, amikor a fejlesztett alkalmazás viselkedéséből adódóan igazából nem mikroszolgáltatás alapú. Például, ha minden mikroszolgáltatás függ egytől, akkor az adott architektúra rejtett monolit jellegű. Pozitív tulajdonsága a mikroszolgáltatásoknak, hogy jól definiált API-k mellett az egyes szolgáltatások a saját adatszerkezetüket a nekik legmegfelelőbb módon képesek kezelni, nincs szükség kompromisszumokra az egész alkalmazást figyelembe véve. +\section{Internet of Things} +Az Internet of Things (IoT), vagy magyarul a Dolgok Internete mindennapi eszközök szenzorokkal és internet kapcsolattal ellátását jelenti. Ezek az eszközök képesek automatikusan adatok gyűjtésére és azok továbbítására. Gyakran előfordul, hogy több típusú szenzorból gyűjtött adatok egy felhős rendszerben kerülnek összegzésre és feldolgozásra, ugyanis at IoT eszközök tipikusan alacsony számítási kapacitással és fogyasztással rendelkeznek, ami az egyes eszközök árát is alacsonyan tartja. Jó példa az IoT-ben rejlő lehetőségekre egy olyan okos termosz, amely az online elérhető időjárás előrejelzések és a felhőben tárolt felhasználói profil alapján előre melegíti vagy hűti az általa irányított lakást. \ No newline at end of file diff --git a/src/figures/bme_logo.pdf b/src/figures/bme_logo.pdf new file mode 100644 index 0000000..ca1c084 Binary files /dev/null and b/src/figures/bme_logo.pdf differ diff --git a/src/figures/classification-service-rps.png b/src/figures/classification-service-rps.png new file mode 100644 index 0000000..2a4cad4 Binary files /dev/null and b/src/figures/classification-service-rps.png differ diff --git a/src/figures/classification-service-runtime.png b/src/figures/classification-service-runtime.png new file mode 100644 index 0000000..470aca3 Binary files /dev/null and b/src/figures/classification-service-runtime.png differ diff --git a/src/figures/cloud-arch (8).drawio b/src/figures/cloud-arch (8).drawio new file mode 100644 index 0000000..e831612 --- /dev/null +++ b/src/figures/cloud-arch (8).drawio @@ -0,0 +1 @@ +7Zhbb5swFMc/TR6LfAPDY5OlraZV7RRNnfoyucEBqw5mxrnt088Ecwvtlmm9KFLpQ8Pfx8fH5/wwJxnhyXJ7qVmeXquYyxEC8XaEP40Q8oMwtP9KZVcpGMGgUhIt4kqDrTATv7gTgVNXIuZFz9AoJY3I++JcZRmfm57GtFabvtlCyf6qOUv4QJjNmRyqdyI2qVNhELUDV1wkqVs6RLQaWLLa2O2kSFmsNh0JT0d4opUy1afldsJlmb06L9W8i2dGm8A0z8wxE9Y3a0ZnkN98v52Ai5zFZvr1zHlZM7lyG75T+pFrF7LZ1XlQKyNFxidNmsEIjxcqMxMlld7bYPt3Ua49TjSLBW/HMpVZN+PCaPXID8SYFSmPncM110bY5H9hD1zeqkIYoTI7ZlTeGT2XIinVB2WMWtoB5oS5XdPGjsepWUp7D12MDitcxzxz+yrHWZFXG1qIbRnHOFei9DJdW2eFM7K1y8sJy21Scu6xTUE8U+6yDJDJHwXX6/3K8iDyJqSFkLKTK7C/rO4KYLfGt89WFja82CeNqyU3emdN3ASEqxnuGUOUVPebLrDE84kPQhhSn0QIOpO0gy6MQmtDQhD6IYFh4EyYe4KSZt0WMvvBcfYPzKEBc9esMB/MnRRzPkYeiFBEgY+gT2B0Ugjij2Pv9BGEAEMPAGKJCjAKLJEnxSAZMDigj2fxednDtNh0Ktz0E6BhrO5QaJNgHg/am6PfKrSfzoAO0umDYfpq7al8ubVuS9TahSj1ouePEp/QvsNCrfScOx/dfufALQQR/LMnw3TCzcDTvppNPo4qcDK7z8zn+5+7G3adnk0ur2Ly7Yn33IsW+PAJP7bgtoHe7/tvXeEQjCMrr7lkRqz7YRyPQwj6VTsE6tj608ijFLTXAQwIvCkMwzfOqcCA3hMGP4xehgbryIMERPboj0IMSf9wIxTZM5/aK7AWCFDypnC88qvgFeHA7wkHBPXPC/9LR+mpbGehbzsUEtL+WUFC6PlRhw7/heiwt+33/8q8/RkFT38D7V1bc5s6EP41fozH3OHRcZOTTJtOzmmbtH3JEKxgGmy5Qo7t/vojgcCA8JViZEdJZmythBDSp91vtRLpaIPx4h/kTkd3cAjCjtobLjrah46qqprVIx9UskwkimoyiY+CIZOtBF+CP4AJ02KzYAiiQkEMYYiDaVHowckEeLggcxGC82KxFxgW7zp1fcAJvnhuyEsfgyEeMaliOquMGxD4I3ZrW7WSjLGbFmZPEo3cIZznRNpVRxsgCHHybbwYgJD2Xtov+Mp4vfYewtGN+vow+/x0dx3ii6Sy630uyR4BgQk+uOrP/eWv598L5/72P/u+f/t5ZAa/L7Jnw8u0w8CQ9B9LQoRH0IcTN7xaSS8RnE2GgFbbI6lfs/E0Le8ij0hWV32CcErECi0GMF4yeLgzDIlohMchyyUPhpbfaY1dI03+YDeIEx8WhdQyn7oHKBgDDBATZgOVlBj2KYxIcgInIJFcB2GYFsYIvmbQ0InkBU4wa6hisfQAhhDF/aP14h8iT3qOdlcJaVuGiZWL4Ax57NKvd/6PqWU/f7vyH+bzwHse/rxnw9nDLvIB3jCGWoZFMosBJD2BluQ6BEIXB2/FxrlsNvlZuRViyBcGmmoAbWrkmxvO2J0QRhevdsThCs5wGEzAIJvntA995A4DsOpfNkTJoJSEQzcaZah7AwgHZJZ/cp9BeA+jAAdwQvIwBVyW2w8Dn0qfIcZwTDJcJgjBCy4isGrUU1jTfDeaJs1+CRa0FZdTGEwI5q7eSPMjVoggb0ovGC98qk677jzSu94sIjcH6Ml3MZi7S1o5wV8VpIpgpM0IS8+HEk3FwEefEywOgB8PF1aL7rARTfV9mp6vlKdlJ6JRTm2msjoA8x8fkfdx8b1vf/z6Mvx586/77S2dLTmA3SynAF08EOENjDD5UDmsZVBRNoGhPMRlCBRHwyiNG0PlugHaDNASDhsbTUUrjKZumtxoEvjxw5mZ7zrjWW1xbMEsTpaI7U1XzezPeZucysHZ1eSoek2bE19KOsld5grEGjXK1XxPBSs0W1ZRN1lmrwTHpMYVOLOmHY5X3sDddQZap++gzsDoOEr0J04q4/jjA6Yfl5qflJnuZgVLw01+r2kLW7OOHpjE0D6OfcT0KWkD3fApAugtvnNZrWZNWmc6m1KhllYEndrTORVqKl3F4JWo0jMbUqK8URQMaBmkylgrmr9tQFNLQOvVAhoCfhDF2mAPAtaYadaKptlQeNPcFNGqxpQghrlgSg83lduMcNOmVOVN6XoH6gje26ZG5vTILZ1KE9LiOu5baXZlauas3Log7Skh3DY7Zq55hVLhuDlWt8JMmY1RfUcMjQIWAf6e+54n+iS54vk0scwlzpTlazuy/FZVk8appmhO15UuprPnMPA4ZDHngXw3Lslfr9ujlGyQfXYMUmoQ5zj2thz2mctJa+Nz1ERQFFbJLF6oxHWqRoWwSmaV7x0LlIp7l2VqhbCyyop790qNJH/bFHVu8q3X2WXNW1LiuyhiL4g8qDiE2XnxJejWi1sRqk/RPMDeiDdG1336WzEb16nsosVoTH87BeWtKbz2tivWaeymdLcuPYxT9zAMXTAPQzXF4gMs1sQYQZqzOx1450GryjE2duQWtVcQ65ELUcKeGRLVPBR7e0PxnaFnjeI7EngU0cBDSWnetaFkVSJoI4JaCWAYtlqwyKZuldDYQADD2M7kpO8khO+UUdoN7hNjt+t8p4zuHtt7aswxUpzSlOFJrFHhGBmNLWrx00cgErs/c1hHYrOw+DskseaORuRYO6+qby40EPf3ps4JO3WJBcccdF2v9uXTKhKssqtWyNqXoay7T6MMJY2EioLkYpzAerdcelc12Korb0p6K+nt2dBb3eDX/Y9Kb21uOnHbbXltLbfbJpdYTmk0299u62xXjzKOI3Ycxy7piNbjOClYJahOF1SOKhioNEssJ0CGZNhkTw9tbvMCnDa9AE2QzasyJlMHQkrdHWcHrXk4pl1QhUeJyqR9Iv1W6beeoN9q94zSnGk7LCPKGuKaY4Xv+VShou6o/+vGUw5S/3bpgJdmHOFUoSbY1ngZvNkPqXXJ7l9Baik4s2/5ZpCtC7a1TgZz9oR2bRJeb21JlbxY8uKz4cWtx3MU/hwVF9Dh97PKgE5yiSpcPEeRB3M6p772rgu29J6+u0Ji6nQxpRiCgSo9jd66H5Dtb5ULMtmE33VnVzvveTKLbqtlH2NBRhcErjL8eBhUlXYPFIqi7WT8sQ6GjDbUneK0EX+U+2blOsvprrNoRmnKtB1+FO5MsPW3joVJ2pzpTGtHO9LquTBdMCjKAMye6KnNQurBh+cBMjJ9SugRwWXfFpneXLwhxmtJxisZ77kw3tYDi6pg+/WLNGN/liHfg7Bu+XcXo9PqC5lUPiaavisUBW8uBlLPi6nnT/dloetmZLsvEXWseIjysROdNxN/6T2iJLn632cJSVv9Cznt6n8=7V3bduLGEv0aP06vvl8eYzz2nEzmkjgryTxlydAGZQQiQth4vv5UozsSIBgQMLEfbNQ0EqrevWtXdbV8xXrjxV3kTUcfwoENrigeLK7YzRWllCkMf1zLS9JCGE9bhpE/SNuKhnv/m00bs25zf2BnlY5xGAaxP6029sPJxPbjSpsXReFztdtjGFSvOvWGttZw3/eCeuuf/iAepa1EmuKNd9YfjtJLa6qSN8Ze1jm9k9nIG4TPpSb29or1ojCMk1fjRc8GznqZXfgfi7vw4/z96Howsu+HH2bTX5/eJCe73eUj+S1EdhLvferoefRp0Lv9sri7Df3+x0Xg/W3Tj+AnL5in9krvNX7JDDiMwvn0il0/hpM4HV5379fpJ20U20XTSHoP2Rlwy+9PcqMCHG04tnH0Ap9Lz54OS4bDDF/P5UEVHBGdtI9KYyq0RiKFVAqnYX7+wmTwIrXaGgvevpi+/fRVzybBx/Hk6dP0Rb6hNQv+bzKdx9B0b6Mnv29rBgV7TgbWnRODGZ9Hfmzvp17fvfsMkxDaRvEYvsMNWWv1sik3juvq6Ky1rmHIcK41UxQbhimvW1cShHnegVFZN7TGSFAuiGCGMS3FsYzOtsO2auUwikfhMJx4wS9hOE1t+4+N45fUuN48DquWt5PBT45/4HASTmzScuu7L7o8pV348V9ZX3j9xbUDzJKjm0Wp281LevB9ozkL51Hfbsdi7EVDG2/olw6LHVSos46NyAZe7D9VmbRpMNOPfg79SVxgikqNOGFGsARYpDKDOUZUwtxU0khpGFUrYEnuNj3lCl7y77g/hHi3EBp5wWPPj/pBA5AmmduUcDSLo/Br7qpICWj47IB2fAAhvR5Ab4gmQPeYCCOZIMQo3gpBxWVaIjGZT0dDotiORDgL6CXbzl3cemM/cLf2zgZPNvb7XgMg3HEvDMJoeQGGlz/Q7gX+cAJtfQCKjXI8NnV9BAiX2h+XP9A+dYZamk5cX4kbd9LZNJF2j/7CzafryM78b6lAwEf0aoAbZJguIFQBEGNICKI1cRgDQSHrPg/XfVzWdnCnpmo4uI/DyMnbC9MSXDKECcfSKKk4J1qdtZjQr55gf0+gzktywERHhmCRT3l5YJeRXUcbRLEDrkivtZO2ObJHIfWg5Dc7mwfAyhdGJZpoJGVuZG4qZqaGIqHA2sJAAIM5349olAFMUM4xYVIzTDag7ruIhtQ1Zy/wZjP/EXx07IeTSxsdxgjihqybBZRJmCQlDj9vP0DqDvjTwz9OuMCwZJ54ZVhmI2/qXg682JtBn5YSrYvBkZojLvKZo03N+IlhiZaYSyBDyU5ne1mXvOAp7tPDNP4+ekg/8Gaj5fmTznBjubd1ByV36w4Lf7s8OjOHm6H52B4XRB7SSgKJpnrvrByh/nFwdYb5pkxnbAej6QaMEMMB4JyySwFZ1QtEC3BIkmnBMVfa4HYppzrmhUKSlJhzRWRKRDA3mGGlpVKMdIt50yD+gqW+8NyHb64vyYuBISWCCD039s4CECvEZOEGNT+dAKT15ZYPcGK/f3m6nGKEYTwy2tcrrE+QKUQDF2ctyzOaeXUSx8kV45ZOIsu7dOAkCLCGyulbrHAKR0KXEoP7+ggNc6AIXasXMQxRxSnDjGGpupZFmaVLPPS7P7YzG/l2dokuQiMiZL56uSsXYYlwWTSoE3JRxyubh0hGIipKbENOyTVtg6NsefvYVMOVRJzxNA3u6KaCTcHQEk04j5H24xqBHZ3IHL8rpRLgqxMhig3GymjaLdm0WGl9Xd867EpLHu9AbA5RDhOGADJIRo2nWuEirBullTOTKjMT3shM2+TZsUNpfjLq+j6H1WL1ujY9ljPIRm+fbDKR3KDl1XUVLYyrI1udrOk4Bd6DDT6HM3+ZQi9NbTePgB2CX1Y6PIRxHI5LHX5KSSF2AKtTxAoRYAzS8Cb5yktNNF4MXfEk8r7NI4v+ndu5/XtoJ6Cm+h3KIEo4UqwQMSsx2TovUOEChhjopE1BGcMITpLlPeBSx6KKbphi3zCrIIuHIOx/rbBFk/ZdfvwzIAKs4zC1h1c4WPUX7ar8awsghUAYG2koYS6N3C5LBmb3XkrdUme8PthTHHFpCg9ZjcNAzoOHJNKJJ62ESj1UgdzkegcVRLhjaKf6PEf3wbHdnHPYHAi4g2PPB9FyQpCOogFGNMIKZ9Vs2PDahIAuTBrAKVWqXeJh1wnBFAFZxIolW3nyCUG7Wv3riOwPjWPdFsfHSaDtijDFNCKslNutAAyA7d7NV2B4GV87nou5Cj4sFCZUcKqEER2AVb2C9RBgzdLC/xmwck4R0KsyCjNwAUp3gNUWpY2vwVkXwZkwThEVKrTqdKkEnwwhlRKYaoFlU5pme2hGDRLg1dlKHvzwIb/piAF3S8hU1s8OzGqs9RrWWZAaYdzVOeRgwytBT3Mq4KhUxOpL3xdclbCmci5PuzYXGZfm85rtdifZS0dqI5NtA76okgSBDTJaFst4VY6FsMoFX9IIoEhMiWzY7eH2q1GjimKRE45KF7sSVkoOtux3XJdQyOXqaQoimWnJzRnQzyRznn3vH4MRuZFIyFqVVaZ9FUNYEwETk0nChalPvjNiRF73Vecz99Q5zT2ePdHhwuYer/u8iy71h+jAsNJG2UuefLQ2NHdzLxpcmhzZvHPJiRVGQGmAYmEkr1M+0wpJzms2L0d8Bfu9LVpPmQJrWGs7m+V7fV5E2FFFRmfrrOe6FtU2LZrR338mLSq4QUIZnZHhhlxE/cxYIferOc1BXc4t2xjAi7K4XavrNGMQFop1W32FQJJxuA2JsSE0850dVdfxev1NLxyPvYlzmMnvHsyRKLy4eH5L+QDjBLkByWRNUzh/PntLeT3Y64h4NwcWM4Bn3FgMvHynMQSpUrg67n7IE0QWKyyQzXNqEJcca0CTxpKIdmyyxzx/Gk1v5z+bp97Utw+///nv5P7Ob/OgtteVnEoBcOBP/8ggCK/fXe2zMrDDLgTnJNbn3IWr9cYSc8YouBDa9KyZ81niEV3VKG2RdxV6Sq9aI6bGh6KozXueLim2yCRhmQo3ccTR908ly0fFju8VpGuIShWgWUn3MM2Wuw3WC9RDM2k9v/DKpJfEpEwqpCjgD1MjuRRNj6o8DZUufv725aP96z0V08HAnw1t7y5uA7fLFH70Rxd+2cqGkIjhAkuiurSRPGLOCCnTCo4VILWNMrmhSHMNEUmK/CrquRJISSGV5tBTaL0iPw8XZjaiuKs00W4lH6VlkZ1WRUpbF4mpyAbCeIepokZTt80kdlW1nAQ+dF3B8MHwTwH/khjNMfgrurKTjVGNNBYgoCXoZ8xXr3Jk+L9uYTzewrHL/xmW8ytbQdfWLE+XGxiz/NCp46Kc+N64x3DIqmPmXG7jv1NEMQ27MTbp8xNHMUwTpCnm2YN8Vva57c03cFj8x4Cke/GPF9jb/wM=7Vxtc5s4EP41mbn7EAZJvH6M4yTXNu20Sa5p++WGGMWmwYYATuL++pNAQgiwY2wgNCnMJCAJIe/u8+xqJfsAHc+fziInnH0MXOwfQNV9OkDjAwgBVAH5R0tWvMRQs5Jp5LmsTBRcer8wK+TNlp6LY6lhEgR+4oVy4SRYLPAkkcqcKAoe5Wa3gS+/NXSmuFJwOXH8aum15yYzVgoMW1T8g73pjL3agmZWMXd4Y/ZJ4pnjBo+FInRygI6jIEiyq/nTMfap9Lhcrt+trv3zO+Ps/Zf43vl39OHq09fDrLPTJo/kHyHCi2Tnru/P7vXbmw8/v03D975+8hNHwGOPqA+Ov2TyYp81WXEBTqNgGbJmOErwU53anBveXN1ysCCXILE9HMxxEq3Ic7x3YLMXMLuDKtPXY1GJUM8KZwUFaqqt8MYOM55p/gIhIHLBZFQvr7Oxfmd8CX5cXE2vfpxAdH768fbQQDUCM3zy6pHrPdA3+t50kVYY90tqGaMJkQOOxD25mtL/YRRMcBwHEX3ngvz5zAti3iUZYtpr9kBFM8QgQ3q5nPunkTMnl6PHmZfgy9CZ0PJHAmlSNkvm5DOOAbnko2NjIu2ZNC2VNuRSRGr+uqIeN1pQ2TSqquUMApBiIAPwY2vFQs1WbNvW8qMjHSOjomMnJII84mq5ibhKjsLQ9yZO4gWLTdo5926x7y2ogkIceWSYVPhjnxV/FmXPKZDALXHII1F+7/tOGHsZ/KjaIjxZRrH3gC9wnJExLQ2WCX3TcU6yamqxpHE6djTGTpx0oXRWa1gKsAqnWdG5rSq2Kk7L7hvZakWD2CWehN0GUTILpsHC8U9E6YhQ48LFLhdy3uY8CEKmoZ84SVbMLTrLJJD1GSdOlBxRN0cKFkFqImnZqUeHn3aLFy5vMfGdOPYmVzNCGGkFa0a7Ik9NcZLbErUhbzFlfcRJFNzlDhDUanojGOJgGU3wFg2zYWxoqDFoU+luNJ0I+wRZD7Ifr9N7+igRkbMqNAgDb5HEhZ4/0wJhkWvsjZGUbijETFWdH5oh+9ZGnaW1ljjMkrFmQxemm8tgD2sGFQ5LvMmdcDF//V1r7ufODQkAN/sMinpCev4Rq5h7rpuhgTKOI6iIqYB0ro8O9PH2Rmes45d18cZa3jlUFahz02TqOGS3zeyronMNKJzGSh3zPoLb25hAocxMLajX/kNWe5EV56BnyYr32DJZVYwJqFCBZuHUJctCOq0G9prQh0kz61JYW1NKNG1F1wonlMcAUh8ujo2M+ExftZ+nU0bkKt801SnYepW7ipGbAE8xdmtopdtHT8hWzKJxyHyWxVaGOGriaQUZxRPWRNdG2ki4PH3/QOvXxwfvv++ja/376JM5vrz78S78us2Us0oiMhHJTDb8SKagCl2tip6X7ckhhgWUYoxtSVYCLY0Ezyo0+SF3n0mlQiFVXCNLKZqSzFOkntJYfvAxtExUryZ2qwVINXQbGEDa956DAIitK5qOhKpL0VxLCElrdQvxoxOAAGTIjF8KJxq58uc669+XI7sCkZhafD69qU3WXJLpCnHYIu322yVsqkBuJzsDgS5zoFUTQiDJqvkEs7/8jDaY+M1uKl+dTBUlBEkAAjCNlUUEh3YK4ICVMovAIexIE1pdBFfIgWdoSwF5iRcyGssZ7cpjl4XHoOHMKZzSNhfOY1qXl0o9CJQ3z52/MbBnfF04q9Zmqkpx7qaZfWPdGgrWteaZbqjI/pG5T3HUCLwMb1QjcBqdiLUPDXW1/KFV488Uy0fv6r0qq1sDVjIG9XjmReEYT7w4XSeR8fvb4ZLVa11iVM+0Lc6KyRDcKkUQ9w1Rs7pI9lIQBU2lC5CqGIVpgJybgqpG3fFOPrg/kMImPtjFO/lgF6/1wc/C+o9bbmiUFpQzpjWQN2QL1HqGvLVFYqInyMOm0gVQV9TiUdpdUr+1YKgu2tArgn/Vyz/EGqLVt/wV5OY7vVFUYPGC8VOxerwq3hUsbAcIt5cO44jtejGJpXrFKS9TAgQVW9eIzbOjlApuKwel2zuMYm0Sap/eOlpjr4ZAbE/X8TKitpUlnIa90s5XxVpZaYeqnFJlHLnv2qihAE3q95AQbSlx2t1au4neKNkCBRqmTLgQ2AMgXJ4eGAzhIlWV2ShLoIiMXjfLYCQIkVcazG1G0SknmtVV9sh5/JrdkRmIKqYQg+VEDvj9OVEOMnmcsO8qFlTKG5p0XUGl5fru+JBvnO+XD3NWIn5GhUCmJdXYKQ4c0n6m/QhR25YQrU4IsTlx2QpauxALsu0uBeLqgbeqaxpEkilvkfjtd2EuDs39mYtgSjVKQReArfDXoZweP4Sgz2DOfFHyotxly9wFCJn/4a4tuMvsZitmU+7SdJPONMupeZ5IAnQaZIjdR6gH7qquloURZvsc2ByUB2FDnotybLbBXmSiUtp30wp3odKGb7NP6nqRuOvV8Iy57a7O/iaN8q6Q0uytn41ihL/kVYdtdquty9Ht01k31GhVwzqXL1ilQV1pDWu43NhaZEfnT2ZpCx9ohRyJYyyFdoBYeKmb7viRL+O+FX4szohL82Fo6kNI020b2fGFxa4Z1yztmZCzKDSxotl2edrZOuNqSP4qLNpmFGspd5/eOuLc6lfkY2Lo2Vw6TwamOwg4Fw85KuW00kZUqiG9C+LVSlGpTWaZvbGu9rZYt2WO5NT3UlFpY/YyzbrNoxu/Y7SWu3bvqyPmepFtFYXkkA1KySEb7eTIXw08tg4hBvKjAmt2ZeZfu0m9cf4dSzbodfjYp7OmACG34oeMsubi96DQyf8=7V1rc6M4Fv01qdreqqjQGz4mTvdMb3XXZDtdu7OftohNYjbYeIG8+tevBOIhEBi7AXtm8YfEyCAZ6dxzrq6u8AVebN5+idzd+mu48oILZK3eLvDNBULIJkT8kyXvWQlklp2VPEb+SpWVBXf+D08VWqr02V95sXZiEoZB4u/0wmW43XrLRCtzoyh81U97CAO91Z376DUK7pZu0Cz9p79K1qoUMqf84FfPf1yrpm3Esw82bn6yupN47a7C10oR/niBF1EYJtm7zdvCC2Tv5f2yeP77690dcdBv3scXGF9t3W9Pl1llnw65pLiFyNsmR1dtx7+y4H518/tTdPV4/9t/F5x9vYSqF17c4Fl1mLrZ5D3vQW+7upIDIY624VYUXouST76oHN9Y2ZEadkTE4TrZyE+geBsnUfhUdLss8d785Hd5HaDq6F95LeL9zVv14F0dROHzduWt1NFDuE3y5uRxz75RfRiHz9HS6+gQNfjeSkOV6tFfvHDjJdG7OEEZCETKPpR5YIWV1wrUmCpzFZIfi1qKim9DX3z7olZkIeBwCAmyKZd/udYIYgww4nCG1YvoDWQ3qeqsIqLWDIEYUGHPWRuUo+5W9EYSN3r0kkYjAinue+W0nTwhbr9V6JBaq7xanXiT1ZgfVQahLEqRfgDqc4uuoD7HRwX2AgJf3HvBhxqm3cB/3Ir3S4E3LxIFL16U+IJvrtQHG3+1knVcR17s/3Dv0/okUlVXiMrp9QW96YXlbqMVLXtv2vdXLKpa1YjKBF8LcEpYdmnkBW7iv+j90R+zlxDrI2ljUINM+PAQe0lteIcZUDjTmA4Rcg48RrADbJvk/AJrbTAOkMUgt9TrSBpjiABIrZZWkG0BixMbt5DlQDxmcwIQom1cav4SrXdELUB4wf7UPqCykRgT/aEZs+CHARiT5BL1s4wJMRQCqw0tc4AzHWniaUlzbMqD50B5whoBtZ2Ci7DWBoEQOJQRKzdddhzlUWgDm5aMV78TBrBj015ENxiaSANNFgB/KJLI7WEAkqCcaUNyiYehDAZqYoARsJ2pGKPpNl/tdoEYpcQPt42Rjl/9TeCmpJGOiPqk12gn4U6ULtd+sPrivofPctzixF0+5UfX6zDyf4hq3ZJw3KgYdqadcSevzN0wCR/vNgcDrBV9dd+0E7+4caIKlmEQuLvYvy9uYyNMyt9eh0kSbgbx6xrQa4UYEQzQPnczcBmiqmxdCXZAAVXheKE256iKSA1MhyKn6Z9fykCQv5GjfyXefk/f1iEkOiMptGQRBmFUCtGDUKFaUQ6rwHtIWkEV79ylv338kp5zQ8qSb6pfZFEorn0IUt1bC+LxtqkDn7hJK/Fci+5dyPmAoCC0EMewPE5ZaRdGySLcintx/RQLnoDWqyfhdSxjWb1RU8yu++ECS2fW4ix/8ZFg0fQqGxAI/HRoDe7EweNfSIga8O8SDzeXsAEK3AQFNgAgkDJ2G8Z+Sn/4JsrONSjSOYw9s4xjupciBIaRQ1j5GgkLJm/0OiWJ5dNtFC69OA6j+C8fMr54CUVlM12MCxku40NNddgHGeIAREdCSdPLvBOj5QYFQmY3ZFo3pDOEjLiYLnPahA0zwIaLya9TZZqRIERn0TmWQUhvfHQ4HKaxn0xlWIvK7DL+WDxHsgsyThFaMyvMuPjArDbuBokx4YVgQMZySiHfTxCVuNjKdzfhdvV97W8nX1MQoxG9ZxcRx84L5HUQWBDnBeXF6ZF29a0XialXKn9TLEyo8c2CUfu9wdMG86jDgY1Y2yTbpgAzp+bpDBPCg8QGhLJpQ3jQbgAfAvDXJvjPNoRXmO4AITyG8hSRYWN4widyiFV5Ua0VgoTl6nWOF9BrMt3nO2+betEskDrwXZAaYo9JMQSzYz2NY23r2MPMENGTTpPT1EZnIj+6R+rQ7Ed3291P+dEtwz+ZKw2bywGZLy006h+yLI/VpCQyO9KjAqSPI90CGDamL92M10iFWXm6wiwkSiTvz1pzAq3hFgaw5tsa9AYL1yR3d06hN3AO3BzvGA8RuWkDwHSK0xa9iQWlZJKjProqaGXlLf047fErRTLzCgK+fl37iXcnvoas+zVyd1NCq4dWtUFtVK1qLlJ/vo28ysrCrFhnoliYc2DVEmFMMySbAgedULHQrFhH00p/UHTMkVoAMJ1ita1q7wpiUWsNcfqvmDB9KPVqFqkBROpgNPWZULWgayCRegz+ffVpG1nX4dPyb3deYu1ebEMiVQMeQ+bsdm9aKJcs+BFrFpcy98y5qCxaiAJIL45YtLgwLRYct2ph7nWlLdVlC+OJTqdsjbRbDOmxQo6OzCruXsxnSEamHZTvB0N6IwPto0D1jHgF8KF2NxhHrSnTZ5S33HstQ8d7O3t0rHmMuBuMC6p0Ki+9xkGWOIy3PPEmh5IS0VBbwwrChDpX7mPK0UkRnzEpdm8944LLKKcs33pW47Jhdp4xTAEhZOyNZ1TfYsIIHJ8wm1HdPylh4j2EOdxmMG4BZjUJshhVocxTUWaPOOuY+8IqSS0Ua/4hBBY7KqmlkltDnAotSxcUdlKzPJjc22RnTKzdG9w44wAj6lhmzhsmOYYxCERDbb7EcFkyxk5vxqD/pNxH93DfWHvcdEShyTzFZjLMnfTL5szyHiFeA+760WF7Zjm2AeLlZBTqaVLURoA7hj0seJrMciOCmvlzDcz8n4Z79+Cj3R4Pivaaxn6MUG+7GM+Z5eeCjz7xWxNeBsos7wwj1iVGz7n85r6mpfPS4il0h9YjBY6YhZTJurCJItucVjWV6BiWrWfVOZ5VYEteeNci43SJmOav3IxfmxMxS2aZxWdcmPRaPTTDZlQBakbDcwGqpGSWMJFZLou1H+1u8iyqWZNOoEk832WdixKUotRAFIEGf2aEXBcztJox4VmGfoJfWiLP7TJkHP3pNMgUNDanZur0oudnamQzJ2oekgMzAsp6qJgRdaMmwDTjrymarj7P8nWm8oWpfFYVLR5nqT/NOBUz8TfHWDOmh/kpda3HbvBZ1/ozDjtU14yjP52umWK6exM4cwr6YFC1WcrGkbJuYPXZc2AC2qhSdtjD95eBG8f+8kJfTs9/lMAyE1D72rplFUvpWT4R50flXv78s7DLZAE4xfK6Gs69j6BoAVT/1XXTs7Ho4emd1AKYYrvladCUMoFQ3JZl1HfFHUMGIMOw5bm1jgWEyRQazcb5MQBay2WiVvdzsjGlgBG7fEAHq12O5eM79lShX4Mcu2bXY+SbHpbFPbDhE15PqjnuSTGl4asac9MHFjo8qaZGAlUPeRJWMKV4d2x7Pz0vQA4Brj6dRmtWZmsju/4Yvr5sILQQQAe2Zfns4ZyRE3ByYzmN9Tic6LLpcPZz1qNqLK0nM8eDrOc/z5tdPml1o2VDYhvmNLHmmlLaOjZMnd66mLAuijEq0k90A6hmnxxqXFwYFyaI5r/voGd6UiHEjs3tcbOGOay1yqzO78xqMlk7fySZPCx3fxBDL6ySYbtmlegITStpA2rZ+0J0yVHe9skN2ZD037FX//SG7GAiZjYWqS3g98vR72vSTo7M3F+u59UeLYnisPyFuez08of68Mf/AQ== \ No newline at end of file diff --git a/src/figures/cloud-arch-class.pdf b/src/figures/cloud-arch-class.pdf new file mode 100644 index 0000000..730b824 Binary files /dev/null and b/src/figures/cloud-arch-class.pdf differ diff --git a/src/figures/cloud-arch-k8s-general-ach.pdf b/src/figures/cloud-arch-k8s-general-ach.pdf new file mode 100644 index 0000000..465f4c9 Binary files /dev/null and b/src/figures/cloud-arch-k8s-general-ach.pdf differ diff --git a/src/figures/cloud-arch-phys.pdf b/src/figures/cloud-arch-phys.pdf new file mode 100644 index 0000000..ed0c032 Binary files /dev/null and b/src/figures/cloud-arch-phys.pdf differ diff --git a/src/figures/cloud-arch-redesigned.pdf b/src/figures/cloud-arch-redesigned.pdf new file mode 100644 index 0000000..1e49694 Binary files /dev/null and b/src/figures/cloud-arch-redesigned.pdf differ diff --git a/src/figures/convert.cmd b/src/figures/convert.cmd new file mode 100644 index 0000000..bc178bc --- /dev/null +++ b/src/figures/convert.cmd @@ -0,0 +1,7 @@ +@echo off +for %%j in (*.eps) do ( +echo converting file "%%j" +epstopdf "%%j" +) +echo done . + diff --git a/src/figures/input-service-rps.png b/src/figures/input-service-rps.png new file mode 100644 index 0000000..4fd4557 Binary files /dev/null and b/src/figures/input-service-rps.png differ diff --git a/src/figures/input-service-runtime.png b/src/figures/input-service-runtime.png new file mode 100644 index 0000000..588deba Binary files /dev/null and b/src/figures/input-service-runtime.png differ diff --git a/src/figures/input-svc-latency.png b/src/figures/input-svc-latency.png new file mode 100644 index 0000000..1b382ef Binary files /dev/null and b/src/figures/input-svc-latency.png differ diff --git a/src/figures/microservice-comparison.png b/src/figures/microservice-comparison.png new file mode 100644 index 0000000..3b9dfc2 Binary files /dev/null and b/src/figures/microservice-comparison.png differ diff --git a/src/figures/mqtt-latency.png b/src/figures/mqtt-latency.png new file mode 100644 index 0000000..81a1658 Binary files /dev/null and b/src/figures/mqtt-latency.png differ diff --git a/src/figures/softwarecomparison-benchmarks.png b/src/figures/softwarecomparison-benchmarks.png new file mode 100644 index 0000000..2de69e7 Binary files /dev/null and b/src/figures/softwarecomparison-benchmarks.png differ diff --git a/src/figures/storage-service-runtime.png b/src/figures/storage-service-runtime.png new file mode 100644 index 0000000..aa6bfb9 Binary files /dev/null and b/src/figures/storage-service-runtime.png differ diff --git a/src/huplain.bst b/src/huplain.bst new file mode 100644 index 0000000..0c02e48 --- /dev/null +++ b/src/huplain.bst @@ -0,0 +1,1910 @@ +% +% huplain.bst -- plain.bst in Hungarian +% by pts@fazekas.hu at Thu Oct 30 10:10:04 CET 2003 +% tetex-url at Mon May 3 20:01:40 CEST 2004 +% derived from BibTeX standard bibliography style `plain' +% version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09. +% +% 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 2 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. +% +% !! title={Az foo} -> key={foo} +% !! auto add space into URLs longer than 70 characters +% !! don't remove double-accent in T1 encoding: \'{\`a}} +% !! sort year +% !! make sure about Hungarian typography of {proceedings} and {inproceedings} +% it is better now to have talked=1, (Elhangzott a ... cm konferencin) +% !! also remove space after \ae before calling purify$ +% !! crossrefs +% !! ` type ' +% !! hu ordering: author, year, title if author is present +% title, year if author is missing! +% !! use and document ``address'' +% !! MSZ 3401--81. A bibliogrfiai ttelek betrendbe sorolsnak szablyai. +% !! MSZ 3402--80. Knyvek bibliogrfiai adatkzlse s bels elrendezse. +% !! MSZ 3424/*-*. Bibliogrfiai lers. *. +% !! MSZ 3432-85. Szavak s szkapcsolatok rvidtse a bibliogrfiai lersban. +% !! MSZ 3440/*-*. A bibiliogrfiai lers besorolsi adatai. *. +% !! abbrv style for J.-P. Sartre +% !! test all entry types +% !! optional \uppercase or \textsc +% !! "5~ {\hbox{ja}}nu\'ar" #1 "({l,}{ff,})" format.name$ warning$ +% !! format.name$ keeps the first char of the name only, so specify {Gy}ula +% !! don't use width$ ??, because it's the cmr10 font in 1987. +% !! getting the first chars of names +% !! \include... +% !! bibgerman.sty, gerplain.bst, language = "german" | "USenglish" | "english" etc. +% \selectlanguage{...} \bibitem... +% !! doc: parametric volume: `ktet' (volumeisyearly={1}) instead of `vf.' +% OK: smaller space for \newblock +% OK: huname: name in hungarian order +% SUXX: cannot read current (overridden) MACRO values from .bst +% SUXX: #161 int.to.chr$ doesn't work (out of bounds), stupid BibTeX... +% Dat: @preamble { "..." # "..." } +% Dat: bibtex removes spaces from end of field contents +% Dat: `volume=' is `vfolyam' +% Dat: Doc: key={{ }.} +% Dat: Doc: write non-decaptilized titles: title = {Fejt {Ferenc} s a szocildemokrcia}, +% Dat: print debug messages with "foo" warning$ +% + +ENTRY + { address + author + booktitle + chapter + edition + editor + howpublished + institution + journal + key + month + note + number + organization + pages + publisher + school + series + title + type + volume + year + + street + zip + city + phone + mobile + name + + numvolumes + numpages + tetex-url + ctan-url + url + isbn + issn + nocheck % ****pts**** + huname % ****pts**** + inputenc % ****pts**** + author2 % ****pts**** + talked % ****pts**** + volumeisyearly % ****pts**** + + % vvv for fmts + firstname.fmt % ****pts**** + lastname.fmt % ****pts**** + } + {} + { label adr.char } % !! what does this mean? + + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + + + +STRINGS { ss tt } + +%STRINGS { acc.latin2.160 acc.latin1.160 acc.160 } +%FUNCTION {init.accs} { +% " A L LS SSTZ-ZZ a l ls sstz zzRAAAALCCCEEEEIIDDNNOOOO*RUUUUYTsraaaalccceeeeiiddnnoooo/ruuuuytd" 'acc.latin2.160 := +% " ! | AAAAAAACEEEEIIIIDNOOOOO*OUUUUYTsaaaaaaaceeeeiiiidnooooo/ouuuuyty" 'acc.latin1.160 := +%} +%%** @param #1 string +%%** @return string +%FUNCTION {rmacc.latinx} { % ****pts**** +% 'tt := +% "" 'ss := +% { tt empty$ not } { +% #1 +% { duplicate$ tt swap$ #1 substring$ +% duplicate$ "" = { pop$ #0 } { chr.to.int$ #160 < } if$ +% } { #1 + } while$ +% duplicate$ tt swap$ #1 swap$ #1 - substring$ +% % duplicate$ ";" * warning$ +% ss swap$ * 'ss := +% duplicate$ tt swap$ #1 substring$ +% duplicate$ "" = { pop$ } { +% chr.to.int$ #159 - acc.160 swap$ #1 substring$ +% ss swap$ * 'ss := +% #1 + +% } if$ +% tt swap$ global.max$ substring$ 'tt := +% % tt warning$ +% } while$ +% ss +%} +% +%%** @param #1 a string +%%** @return a string +%FUNCTION {rmacc} { % **** pts **** +% inputenc empty$ 'skip$ { +% inputenc "latin1" = { acc.latin1.160 'acc.160 := rmacc.latinx } 'skip$ if$ +% inputenc "latin2" = { acc.latin2.160 'acc.160 := rmacc.latinx } 'skip$ if$ +% } if$ +%} + +STRINGS { acc4.latin2.160 acc4.latin1.160 acc4.160 } +FUNCTION {init.accs4} { + "%%%%%%%%%%%%%%%%%%%%%%%%%%%%\S %\" quote$ "{}%%%%%%%%%%%%%%%%%%%%%%%%\={}%%%%%%%%%%%%%%%%\'{}%%%%\P %%%%%\c\ %%%%%%%%%%%%%%%%%%%%%%%%%%%%\`A%\'A%\^A%\~A%\" quote$ "A%\r A\AE%\c C\`E%\'E%\^E%\" quote$ "E%\`I%\'I%\^I%\" quote$ "I%\DH%\~N%\`O%\'O%\^O%\~O%\" quote$ "O%%%%%\O %\`U%\'U%\^U%\" quote$ "U%\'Y%\TH%\ss%\`a%\'a%\^a%\~a%\" quote$ "a%\r a\ae%\c c\`e%\'e%\^e%\" quote$ "e%\`\i\'\i\^\i\" quote$ "\i\dh%\~n%\`o%\'o%\^o%\~o%\" quote$ "o%%%%%\o %\`u%\'u%\^u%\" quote$ "u%\'y%\th%\" quote$ "y%" * * * * * * * * * * * * * * * * * * * * * * * * 'acc4.latin1.160 := + "%%%%\k A\u{}\L %%%%%\v L\'S%\S %\" quote$ "{}\v S\c S\v T\'Z%%%%%\v Z\.Z%%%%%\k a\k\ \l %\'{}\v l\'s%\v{}\c\ \v s\c s\v t\'z%\H{}\v z\.z%\'R%\'A%\^A%\u A\" quote$ "A%\'L%\'C%\c C\v C\'E%\k E\" quote$ "E%\v E\'I%\^I%\v D\DJ%\'N%\v N\'O%\^O%\H O\" quote$ "O%%%%%\v R\r U\'U%\H U\" quote$ "U%\'Y%\c T\ss%\'r%\'a%\^a%\u a\" quote$ "a%\'l%\'c%\c c\v c\'e%\k e\" quote$ "e%\v e\'\i\^\i\v d\dj%\'n%\v n\'o%\^o%\H o\" quote$ "o%%%%%\v r\r u\'u%\H u\" quote$ "u%\'y%\c t\.{}" * * * * * * * * * * * * * * * * * * 'acc4.latin2.160 := +} +%** @param #1 string +%** @return string +FUNCTION {rmacc4.latinx} { % ****pts**** + 'tt := + "" 'ss := + { tt "" = not } { % Dat: empty$ is true for space + #1 + { duplicate$ tt swap$ #1 substring$ + duplicate$ "" = { pop$ #0 } { chr.to.int$ #160 < } if$ + } { #1 + } while$ + duplicate$ tt swap$ #1 swap$ #1 - substring$ + % duplicate$ ";" * warning$ + ss swap$ * 'ss := + duplicate$ tt swap$ #1 substring$ + duplicate$ "" = { pop$ } { + % chr.to.int$ #159 - acc.160 swap$ #1 substring$ + duplicate$ chr.to.int$ + acc4.160 swap$ duplicate$ + duplicate$ + #639 - #4 substring$ + duplicate$ "%%%%" = { + pop$ + } { + swap$ pop$ + duplicate$ #4 #1 substring$ "%" = { #1 #3 substring$ } 'skip$ if$ + "{" swap$ * "}" * + } if$ + ss swap$ * 'ss := + #1 + + } if$ + tt swap$ global.max$ substring$ 'tt := + % tt warning$ + } while$ + ss +} + +%** Changes "" to "{\'a}" etc. +%** @param #1 a string +%** @return a string +FUNCTION {rmacc4} { % **** pts **** + inputenc empty$ 'skip$ { + inputenc "latin1" = { acc4.latin1.160 'acc4.160 := rmacc4.latinx } 'skip$ if$ + inputenc "latin2" = { acc4.latin2.160 'acc4.160 := rmacc4.latinx } 'skip$ if$ + } if$ +} + +INTEGERS { acc.fwd } +%** Changes "fo{\'o}h{\H u}s" to "fo\'oh\H us". Helps keeping ligatures. +%** Changes `{\ae}' to `\ae ' and `{\\XY}' to `\XY ' +%** Changes only known accents inside braces, followed by 1 or 2 accented +%** letters. +%** Dat: previous \oe must be inserted as {\\oe}, the same for {\DH} etc. +%** @param #1 string +%** @return string +FUNCTION {rmbrace.accs} { % ****pts**** + % Dat: LaTeX non-alphanumeric accents \`\'\^\~\"\=\. + % Dat: LaTeX accents for purify$: \c\u\v\H\d\b\t\r + % Dat: specially removed: {\?...} -> ... + 'tt := + "" 'ss := + { tt "" = not } { + #1 + { duplicate$ tt swap$ #2 substring$ + duplicate$ "" = { pop$ #0 } { "{\" = not } if$ + } { #1 + } while$ + duplicate$ tt swap$ #1 swap$ #1 - substring$ + % duplicate$ ";" * warning$ + ss swap$ * 'ss := + + duplicate$ tt swap$ #2 + #1 substring$ + "}" = { #3 } { + duplicate$ tt swap$ #3 + #1 substring$ + "}" = { % `{\i}' etc. + duplicate$ tt swap$ #2 + #1 substring$ + duplicate$ "o" = {#4} { + duplicate$ "O" = {#4} { + duplicate$ "l" = {#4} { + duplicate$ "L" = {#4} { + duplicate$ "i" = {#4} { + duplicate$ "j" = {#4} { + #3} % Dat: disallow other {\X} + if$} if$} if$} if$} if$} if$ + swap$ pop$ + } { + duplicate$ tt swap$ #4 + #1 substring$ + "}" = { #5 } { + duplicate$ tt swap$ #5 + #1 substring$ + "}" = { #6 } { #3 } if$ + } if$ + } if$ + } if$ + 'acc.fwd := + % Status: offset-of-"\{" + %%acc.fwd int.to.str$ warning$ + acc.fwd #3 = { + duplicate$ tt swap$ acc.fwd substring$ % copy 3 bytes + } { + duplicate$ #1 + tt swap$ acc.fwd #2 - substring$ % keep "\'o" or "\H u" only + %%duplicate$ warning$ + duplicate$ "\oe" = {#5} { + duplicate$ "\OE" = {#5} { + duplicate$ "\ae" = {#5} { + duplicate$ "\AE" = {#5} { + duplicate$ "\aa" = {#5} { + duplicate$ "\AA" = {#5} { + duplicate$ "\th" = {#5} { + duplicate$ "\TH" = {#5} { + duplicate$ "\dh" = {#5} { + duplicate$ "\DH" = {#5} { + duplicate$ "\dj" = {#5} { + duplicate$ "\DJ" = {#5} { + duplicate$ "\ng" = {#5} { + duplicate$ "\NG" = {#5} { + duplicate$ "\ss" = {#5} { + duplicate$ "\SS" = {#5} { + duplicate$ "\o" = {#5} { + duplicate$ "\O" = {#5} { + duplicate$ "\l" = {#5} { + duplicate$ "\L" = {#5} { + duplicate$ "\i" = {#5} { + duplicate$ "\j" = {#5} { + duplicate$ #2 #1 substring$ + duplicate$ "`" = {#1} { + duplicate$ "'" = {#1} { + duplicate$ "^" = {#1} { + duplicate$ "~" = {#1} { + duplicate$ quote$ = {#1} { + duplicate$ "=" = {#1} { + duplicate$ "." = {#1} { + duplicate$ "c" = {#2} { + duplicate$ "u" = {#2} { + duplicate$ "v" = {#2} { + duplicate$ "H" = {#2} { + duplicate$ "d" = {#2} { + duplicate$ "b" = {#2} { + duplicate$ "t" = {#2} { + duplicate$ "r" = {#2} { + duplicate$ "?" = {#3} { + duplicate$ "\" = {#4} { % added at Mon May 17 15:39:30 CEST 2004 + #0} if$} if$} if$} if$} if$} if$} if$} if$} if$} + if$} if$} if$} if$} if$} if$} if$} if$ + % Stack: "\'o" "'" 0|1|2 + swap$ pop$ + } if$} if$} if$} if$} if$} if$} if$} if$} if$} if$} if$} if$} if$} if$} + if$} if$} if$} if$} if$} if$} if$} if$ + + % Stack: "\'o" 0|1|2|3 + duplicate$ #5 = { + pop$ " " * % `{\oe}' becomes `\oe ' + } { duplicate$ #4 = { + pop$ #2 global.max$ substring$ % include single backlsash + " " * % add space so `{\\th}' becomes `\th ' + } { duplicate$ #3 = { + pop$ #3 global.max$ substring$ + } { duplicate$ #2 = { + pop$ + duplicate$ #3 #1 substring$ + " " = + } 'skip$ if$ + % Stack: "\'o" 0|1 + 'skip$ { "{" swap$ * "}" * } if$ + } if$ } if$ } if$ + } if$ + ss swap$ * 'ss := + acc.fwd + tt swap$ global.max$ substring$ 'tt := + } while$ + ss +} + +% --- + +INTEGERS { output.state before.all mid.sentence after.sentence after.block + cur.adr.char after.authors } +STRINGS { s t ls rs } + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := + #4 'after.authors := +} + + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\bibNewBlock " write$ + } + { output.state before.all = + 'write$ + { output.state after.authors = + { write$ newline$ "\bibNewBlock " write$ } + { add.period$ " " * write$ } + if$ + } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ + nocheck empty$ { "empty " t * " in " * cite$ * warning$ } {} if$ + } + 'output.nonnull + if$ +} + +% @return a string +FUNCTION {output.bibitem} +{ newline$ + "\bibitem{" write$ + cite$ write$ + "}" write$ + inputenc empty$ {} { " \bibInputEncoding{" inputenc "}" * * write$ } if$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ + inputenc empty$ 'skip$ { "\bibResetInputEncoding" write$ newline$ } if$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +% ****pts**** +FUNCTION {new.block.authors} { + duplicate$ empty$ 'skip$ { ":" * } if$ + output.state before.all = + 'skip$ + { after.authors 'output.state := } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "{\em " swap$ * "}" * } + if$ +} + +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.isbn} +{ isbn empty$ + { "" } + { new.block "ISBN " isbn * } + if$ +} + +FUNCTION {format.issn} +{ issn empty$ + { "" } + { new.block "ISSN " issn * } + if$ +} + +%** is.url.split.char <0-or-1> +%** Is the spefified char candidate to split the URL at? +FUNCTION {is.url.split.char} { + duplicate$ "/" = { pop$ #1 } { + duplicate$ "." = { pop$ #1 } { + duplicate$ "?" = { pop$ #1 } { + duplicate$ "&" = { pop$ #1 } { + duplicate$ "-" = { pop$ #1 } { + pop$ #0 } if$ } if$ } if$ } if$ } if$ +} + +%** string.length +%** Imp: a faster implementation +%** Dat: destroys 'ls +FUNCTION {string.length} { + 'ls := + #1 + { duplicate$ ls swap$ #1 substring$ "" = #1 swap$ - } + { #1 + } while$ + #1 - + "" 'ls := +} + + +INTEGERS { last.split.ofs } + +%** split.url +%** We have to add spaces (works with \usepackage{url}), because otherwise +%** bibtex adds a % at column 79. +%** After a maxinmum of 71 chars, a space gets inserted. +%** Clobbers 'ss, 'ls and 'rs. +FUNCTION {split.url} { + % We add spaces after the last is.url.split.char + 'ss := % save original string + #0 'last.split.ofs := % Dat: last offset to split _after_ + "" 'rs := + #1 % loop variable + { duplicate$ ss swap$ #1 substring$ "" = #1 swap$ - } % more chars in ss + { duplicate$ ss swap$ #1 substring$ is.url.split.char { + duplicate$ 'last.split.ofs := + } 'skip$ if$ + duplicate$ #70 > { + last.split.ofs #0 = { + duplicate$ 'last.split.ofs := % Dat: split at any char if cannot split at good position + } 'skip$ if$ + rs ss #1 last.split.ofs substring$ " " * * 'rs := + ss last.split.ofs #1 + ss string.length substring$ 'ss := + %% ss warning$ + last.split.ofs - #1 + % decrement loop variable + %% duplicate$ warning$ + #0 'last.split.ofs := + } { #1 + } if$ + } while$ + pop$ % Dat: pop loop variable + rs ss * + "" 'ss := + "" 'rs := +} + +FUNCTION {output.url} { + url empty$ + { "" } + { new.block "" output.nonnull + before.all 'output.state := + newline$ % Dat: bibtex breaks lines -- let it be longer + "\bibUrll{URL} >" url split.url * ">" * } + if$ output + ctan-url empty$ + { "" } + { new.block "" output.nonnull + before.all 'output.state := + newline$ % Dat: bibtex breaks lines -- let it be longer + "\bibUrll{CTAN} >" ctan-url split.url * ">" * } + if$ output + tetex-url empty$ + { "" } + { new.block "" output.nonnull + before.all 'output.state := + newline$ % Dat: bibtex breaks lines -- let it be longer + "\bibUrll{te\TeX} >" tetex-url * split.url ">" * } + if$ output +} + +% ****pts**** +STRINGS { nfmt0 nfmt1 nfmt2 nfmt3 } +STRINGS {firstname.fmt0 lastname.fmt0} +FUNCTION {init.nfmt0} { + "ff" 'firstname.fmt0 := + "ll" 'lastname.fmt0 := + % "f." 'firstname.fmt0 := % similar to abbrev.bst +} +FUNCTION {init.nfmts} { + "{" firstname.fmt0 "~}{vv~}{" lastname.fmt0 "}{, jj}" * * * * 'nfmt0 :=% 0: English order + "{jj~}{vv~}{" lastname.fmt0 "}{~" firstname.fmt0 "}" * * * * 'nfmt1 := % 1: Hungarian name in Hungarian bib + "{vv~}{" lastname.fmt0 "}{, " firstname.fmt0 "}{, jj}" * * * * 'nfmt2 := % 2: English name in Hungarian bib + "{jj~}{vv~}{ll}{~f.}" 'nfmt3 := % 3: Hungarian name in Hungarian bib, abbreviated name +} + +FUNCTION {format.names} +{ rmacc4 's := % ****pts**** + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } { + % ****pts**** + huname empty$ { s nameptr nfmt0 format.name$ 't := }{ % empty: English order + huname "0" = { s nameptr nfmt0 format.name$ 't := }{ % 0: English order + huname "1" = { s nameptr nfmt1 format.name$ 't := }{ % 1: Hungarian name in Hungarian bib + huname "2" = { s nameptr nfmt2 format.name$ 't := } % 2: English name in Hungarian bib + { s nameptr nfmt3 format.name$ 't := } % 3: Hungarian name in Hungarian bib, abbreviated name + if$ }if$ }if$ }if$ + % ^^^ Dat: important to have no space in {ll} for "others" + t rmbrace.accs 't := % ****pts**** + nameptr #1 > + { namesleft #1 > + { "\bibAnd 0" * t * } + { % numnames #2 > { "," * } 'skip$ if$ % ****pts**** + %% t ";;" * warning$ + t "others" = + { "\bibEtAl ." * } + { numnames #2 > { "\bibAnd 2" } { "\bibAnd 1"} if$ * t * } + if$ + } + if$ + } + 't + if$ + %% t warning$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } while$ +} + +FUNCTION {format.authors} +{ author empty$ + { "" } + { author format.names } + if$ +} + +FUNCTION {format.editors} +{ editor empty$ + { "" } + { editor format.names + editor num.names$ #1 > { "\bibEd 1" } { "\bibEd 0" } if$ * %****pts**** + } + if$ +} + +FUNCTION {format.title} +{ title empty$ + { "" } + { title rmacc4 "t" change.case$ rmbrace.accs } % Dat: ****pts**** get used to it in English... + if$ +} + +FUNCTION {n.dashify} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +% Dat: possible months formats in .bib: +% month = jun # "-" # aug, --> "j\'unius--\allowbreak augusztus" !! +% month = jun, --> "j\'unius" +% month = "8~" # feb, --> "februr 8." +% month = nov # ", " # dec, --> "november\nobreak\hskip--\allowbreak december" + +FUNCTION {format.date} +{ year empty$ + { month empty$ + { "" } + { "there's a month but no year in " cite$ * warning$ + month + } + if$ + } + { month empty$ + 'year + { year ".\ " * + month #1 "{ll}{~ff.}" format.name$ % convert "december" -> "december"; "5~december" -> "december~5." + % ^^^ !! convert "janu\'ar--febru\'ar" and "janu\'ar, febru\'ar" to "j--f"... + % ^^^ !! convert . to \hbox{.} at end, to have frenchspacing... + * } % !! date + if$ + } + if$ +} + +FUNCTION {format.btitle} +{ title rmbrace.accs emphasize +} + +%** tie.or.space.connect "" +%** is ~ if is long (>=3 normal letters) +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} + +FUNCTION {numpages.output} { % ****pts**** + numpages empty$ 'skip$ { + numpages "p." tie.or.space.connect output + } if$ +} + +FUNCTION {note.output} { % ****pts**** + note empty$ 'skip$ { note rmbrace.accs output.nonnull } if$ +} + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {format.series} { % ****pts**** + series empty$ { "" } { + series + type$ "inproceedings" = type$ "proceedings" = or + { " kon\-fe\-ren\-cia\-so\-ro\-zat" } { " sorozat" } if$ + * + } if$ +} + +% Dat: INCOLLECTION: number = 23, series = "Fast Computers", +FUNCTION {format.bvolume} { % ****pts**** + volume empty$ number empty$ and { + series empty$ 'skip$ { format.series output new.block } if$ + % ^^^ Dat: don't emphasize {Osiris kziknyvek sorozat}, because it's after the book title. + numvolumes empty$ { "" } + { "\bibNumVolumes {" numvolumes "}." * * } if$ % ****pts**** + } { + "numvolumes and volume/number" numvolumes either.or.check + series empty$ 'skip$ { format.series output } if$ % Dat: no new.block + number empty$ + { volume } + { "volume and number" volume either.or.check number } if$ + n.dashify + duplicate$ #-1 #1 substring$ "-" = 'skip$ 'add.period$ if$ + "\bibVolume {" swap$ * "}." * + } if$ +} + +FUNCTION {format.edition} +{ edition empty$ + { "" } + { output.state mid.sentence = + { edition rmacc4 "l" change.case$ } + { edition rmacc4 "t" change.case$ } + if$ + add.period$ + " kiad." * % Dat: " kiad.": Gyurgyk Jnos: Szerkesztk s szerzk kziknyve, 533. oldal, 2. sor. + } + if$ +} + +% Dat: `FUNCTION {multi.page.check}' not needed + +%** Used by type$ {inbook} and {incollection} +%** English typography has: +%** pages 23--45 (pages={23--45}) +%** pp. 23--45. (pages={23--45}) +%** p. 23. (pages=={23}: on page 23) +%** p. 234 (numpages=234: the book has 234 pages) +%** Hungarian typography has: +%** 234 p. (numpages=234) +%** 23--45. p (pages={23--45}) +%** 23. p. (pages=23) +FUNCTION {format.pages} { % ****pts**** + pages empty$ + { "" } + { pages add.period$ n.dashify "p." tie.or.space.connect } + if$ +} + +FUNCTION {volume.caption} { % ****pts**** + volumeisyearly empty$ { "1" } { volumeisyearly } if$ % default is "1" + "0" = { "k\" quote$ "otet" * * } { "\'evf." } if$ +} + +FUNCTION {format.vol.num.pages} { % ****pts**** + volume duplicate$ empty$ { pop$ "" } { + add.period$ + volume.caption % "\'evf." + tie.or.space.connect } if$ + year empty$ { + nocheck empty$ { "empty year in " cite$ * warning$ } 'skip$ if$ + } { + duplicate$ empty$ + { pop$ format.date add.period$ } + { " (" * format.date * ")" * } if$ + } if$ + number empty$ 'skip$ { + duplicate$ empty$ 'skip$ { " " * } if$ + volume empty$ nocheck empty$ and { "there's a number but no volume in " cite$ * warning$ } 'skip$ if$ + number add.period$ "sz." tie.or.space.connect * + } if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + { "" } % 'format.pages + { chapter + type empty$ { "fejezet" } { + type "subsection" = { "alszakasz" } { + type "subsubsection" = { "alalszakasz" } { + type "chapter" = { "fejezet" } { + type "section" = { "szakasz" } { + type "part" = { "r{\'e}sz" } { + type "appendix" = { "f{\" quote$ "u}ggel{\'e}k" * * } { + type rmacc4 "l" change.case$ } if$ } if$ } if$ } if$ } if$ } if$ } if$ + tie.or.space.connect + % Dat: no format.pages here % ****pts**** + } + if$ +} + +FUNCTION {format.in.edited} { % ****pts**** + editor "self" = % ****pts**** + { "\bibInSelf0" } + { "In " format.editors * ": " * } if$ + booktitle rmbrace.accs emphasize * +} + +FUNCTION {format.in.ed.booktitle} { + booktitle empty$ + { "" } + { editor empty$ + % vvv "In ": Gyurgyk Jnos: Szerkesztk s szerzk kziknyve, 130. oldal, 12. sor. + { "In " booktitle rmbrace.accs emphasize * } + 'format.in.edited if$ + } if$ +} + +INTEGERS { len } + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + + +%* @param #1 a string beginning with a possibly accented letter +%* @return "" or "z", corresponding to the Hungarian definite article "a" and "az" +FUNCTION {article.az} { + rmacc4 % remove accents smartly + purify$ + "l" change.case$ + #1 #1 substring$ + duplicate$ " " = {"z"} { % hack + duplicate$ "a" = {"z"} { + duplicate$ "e" = {"z"} { + duplicate$ "i" = {"z"} { + duplicate$ "o" = {"z"} { + duplicate$ "u" = {"z"} { + ""} if$ }if$ }if$ }if$ }if$ }if$ + swap$ pop$ +} + +%** by pts@fazekas.hu at Thu Nov 9 17:03:00 CET 2006 +%** @example "foo}" split.last.brace "foo" "}" +%** @example "food" split.last.brace "food" "" +FUNCTION {split.last.brace} { + duplicate$ #-1 #1 substring$ "}" = + { duplicate$ string.length #1 - #1 swap$ substring$ "}" } + { "" } if$ +} + +%** by pts@fazekas.hu at Thu Nov 9 17:03:00 CET 2006 +%** Clobbers 'rs and 'ls +%** @example "foobar" "bar" replace.at.end "foo" 1 +%** @example "foobar!" "bar" replace.at.end "foobar!" 0 +FUNCTION {remove.at.end} { + 'rs := % save pattern string % Dat: string.length destroys 'ls + duplicate$ rs string.length #-1 swap$ + substring$ rs = + { duplicate$ string.length rs string.length - #1 swap$ substring$ #1 } + { #0 } if$ +} + +FUNCTION {format.in.talked.booktitle} { + booktitle empty$ + { "" } + { editor empty$ + { + booktitle duplicate$ 's := + "A " swap$ #2 swap$ chop.word + "Az " swap$ #3 swap$ chop.word + %% duplicate$ warning$ + s = { + "a" booktitle article.az * + booktitle rmbrace.accs emphasize + tie.or.space.connect + } { booktitle rmbrace.accs emphasize } if$ + % Dat: now: "a~{\em Foo Konferencia}" + split.last.brace + swap$ + % Dat: now "}" "a~{\em Foo Konferencia" + % vvv Imp: maybe we don't need \- here, because it + % prevents hyphenation in earlier parts of the word + "Conference" remove.at.end { "Con\-fe\-ren\-ce-en" * swap$ * } { + "conference" remove.at.end { "con\-fe\-ren\-ce-en" * swap$ * } { + "Konferencia" remove.at.end { "Kon\-fe\-ren\-ci\'an" * swap$ * } { + "konferencia" remove.at.end { "kon\-fe\-ren\-ci\'an" * swap$ * } { + swap$ * " c{\'i}m{\H u} konferenci{\'a}n" * + } if$ } if$ } if$ } if$ + %% duplicate$ warning$ + % Dat: now "a~{\em Foo Konferencin}" + % or "a~{\em Foo} cm konferencin" + %% "alma" string.length warning$ + "Elhangzott " swap$ * + } 'format.in.edited if$ + } if$ +} + +FUNCTION {empty.misc.check} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ + and and and and and + key empty$ not and + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + +%** @param #1 default value for `type' +FUNCTION {format.thesis.type} { % ****pts**** + type empty$ 'skip$ { pop$ type } if$ + rmacc4 "t" change.case$ rmbrace.accs +} + +FUNCTION {format.tr.number} % ****pts**** +{ type empty$ + { "{\bibTechRep 0}" } % Dat: `{'..`}' to avoid "t" change.case$ + 'type + if$ + number empty$ + { rmacc4 "t" change.case$ } + { number add.period$ swap$ tie.or.space.connect } + if$ +} + +FUNCTION {format.article.crossref} +{ key empty$ + { journal empty$ + { "need key or journal for " cite$ * " to crossref " * crossref * + warning$ + "" + } + { "In {\em " journal * "\/}" * } + if$ + } + { "In " key * } + if$ + " \cite{" * crossref * "}" * +} + +FUNCTION {format.crossref.editor} +{ editor #1 "{vv~}{ll}" format.name$ + editor num.names$ duplicate$ + #2 > + { pop$ " \bibEtAl ." * } + { #2 < + 'skip$ + { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { " \bibEtAl ." * } + { " \'es " * editor #2 "{vv~}{ll}" format.name$ * } % !! + if$ + } + if$ + } + if$ +} + +FUNCTION {format.book.crossref} +{ volume empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + "In " + } + { "Volume" volume tie.or.space.connect + " of " * + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { "{\em " * series * "\/}" * } + if$ + } + { key * } + if$ + } + { format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} + +FUNCTION {format.incoll.inproc.crossref} +{ editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { booktitle empty$ + { "need editor, key, or booktitle for " cite$ * " to crossref " * + crossref * warning$ + "" + } + { "In {\em " booktitle * "\/}" * } + if$ + } + { "In " key * } + if$ + } + { "In " format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} + +FUNCTION {article} %*type* ****pts**** +{ output.bibitem + format.authors "author" output.check + new.block.authors + format.title "title" output.check + new.block + crossref missing$ + { journal emphasize "journal" output.check + format.vol.num.pages output % format.date is inside this + } + { format.article.crossref output.nonnull + } if$ + format.pages output + format.issn output + output.url + new.block numpages.output note.output + fin.entry +} + +% copied from KOMA-Script +% by pts at Thu Oct 30 09:56:33 CET 2003 + +% !! how does it work and why? +FUNCTION {print.adrchr} +{ adr.char empty$ 'skip$ { % ****pts**** Dat: default + adr.char chr.to.int$ cur.adr.char > + { newline$ "\adrchar{" adr.char "}" * * write$ newline$ + adr.char chr.to.int$ 'cur.adr.char := + } + 'skip$ + if$ + } if$ % !! +} + +FUNCTION {get.names} +{ name empty$ + { organization empty$ + { "{}{}" } + { organization "{}" * } + if$ + } + { "{" name #1 "{ll}" format.name$ "}" * * + "{" name #1 "{ff}{ vv}" format.name$ "}" * * * + } + if$ +} + +%** Dat: deliberately with `sss', to avoid conflict +FUNCTION {addresss} { %*type* + % !! many improvements + output.bibitem pop$ + print.adrchr % !! + "\adrentry" write$ + get.names write$ newline$ + "{" + street empty$ + { "" } + { street " \\ " *} + if$ + * + zip empty$ + { "" } + { zip } + if$ + " " * * + city empty$ + { "" } + { city } + if$ + "}{" * * + phone empty$ + { + mobile empty$ + { "" } + { mobile } + if$ + }{ + mobile empty$ + { phone } + { phone "\\" mobile * * } + if$ + } + if$ + "}{}{}{}{" * * + key empty$ + { "" } + { key } + if$ + "}" * * write$ newline$ +} + + +% --- + +%** Used by type$ {book}, {inbook} and {incollection} +FUNCTION {books.tail} { % ****pts**** + crossref missing$ { + format.bvolume output % includes functionality of format.number.series + new.block % no comma in `1--4. kt., 7. kiad.' + } 'skip$ if$ + type$ "book" = { + chapter empty$ 'skip$ + { "can't use chapter for @book; try @inbook or @incollection" warning$ } if$ + } { + format.chapter.pages + pages empty$ { "chapter and pages" output.check } {output} if$ + new.block % new.sentence? -- for incollection + } if$ + author2 empty$ 'skip$ { author2 output.nonnull new.block } if$ + format.edition output new.block + crossref missing$ { + % format.bvolume output + % new.block + % format.number.series output % ****pts**** + % new.sentence + address output + format.date "year" output.check + publisher "publisher" output.check + } { + format.date "year" output.check + new.block + format.book.crossref output.nonnull + } if$ + format.pages output + format.isbn output + format.issn output % Dat: most books don't have this + output.url + new.block numpages.output note.output fin.entry +} + +FUNCTION {book} { %*type* + output.bibitem + author empty$ + { editor empty$ key missing$ { "" } { key } if$ "." = and + 'skip$ + { format.editors "author and editor" output.check } if$ + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block.authors + format.btitle "title" output.check + new.block + books.tail +} + +FUNCTION {booklet} { %*type* ****pts**** + output.bibitem + format.authors output + new.block.authors + format.title "title" output.check + new.block + format.bvolume output new.block + author2 output.nonnull new.block + format.edition output new.block + % howpublished address new.block.checkb + howpublished output + address output + % Dat: no publisher= + format.date output + format.isbn output + format.issn output % Dat: most books don't have this + output.url + new.block numpages.output note.output fin.entry +} + +FUNCTION {inbook} %*type* +{ book % ****pts**** +} + +FUNCTION {incollection} %*type* +{ output.bibitem + format.authors "author" output.check + new.block.authors + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check new.block } + { format.incoll.inproc.crossref output.nonnull } if$ + books.tail +} + +%** @param #1 thesis type +FUNCTION {thesises.tail} { % ****pts**** + format.thesis.type output.nonnull + school empty$ { nocheck empty$ { "empty school in " * cite$ * warning$ } 'skip$ if$ } 'skip$ if$ + school empty$ address empty$ and 'skip$ { + write$ before.all 'output.state := " (" + % school output address ")" * output + school ")" * output + new.block + } if$ + author2 empty$ 'skip$ { author2 output new.block } if$ + new.block + address output + format.date "year" output.check + output.url + new.block numpages.output note.output fin.entry +} + +%** Emits a decapitalized title. +FUNCTION {mastersthesis} { %*type* + output.bibitem + format.authors "author" output.check + new.block.authors + format.title "title" output.check + new.block + "{Diplomaterv}" % "{Doktori} {{\'e}rtekez{\'e}s} " % "Master's thesis" + thesises.tail +} + +%** Emits an \emph-asized title. +FUNCTION {phdthesis} { %*type* + output.bibitem + format.authors "author" output.check + new.block.authors + format.btitle "title" output.check + new.block + "{PhD} {\'e}rtekez{\'e}s " % "PhD thesis" + thesises.tail +} + +FUNCTION {misc} %*type* % ****pts**** +{ output.bibitem + format.authors output + title empty$ howpublished empty$ and 'skip$ { + new.block.authors % Dat: emits ":" + % title howpublished new.block.checkb % Dat: emits "." + format.title output + howpublished new.block.checka + howpublished output + } if$ + format.date output + format.isbn output + format.issn output % Dat: most books don't have this + output.url + new.block numpages.output note.output fin.entry + empty.misc.check +} + +FUNCTION {manual} %*type* ****pts**** +{ output.bibitem + author empty$ + { organization empty$ + 'skip$ + { organization output.nonnull } if$ + new.block + } + { format.authors output.nonnull new.block.authors } + if$ + format.btitle "title" output.check + author2 empty$ 'skip$ { author2 output new.block } if$ + format.edition output new.block + + publisher empty$ 'skip$ { "can't use publisher for @manual; try @book" warning$ } if$ + author empty$ + { address output } + { % organization address new.block.checkb + organization output + address output + } if$ + format.edition output + format.date output + publisher output + output.url + new.block numpages.output note.output fin.entry +} + + +FUNCTION {techreport} %*type* +{ output.bibitem + format.authors "author" output.check + new.block.authors + format.title "title" output.check + new.block + format.tr.number output.nonnull + author2 empty$ 'skip$ { author2 output new.block } if$ + address output + format.date "year" output.check + institution "institution" output.check + output.url + new.block numpages.output note.output fin.entry +} + +FUNCTION {unpublished} %*type* % ****pts**** +{ output.bibitem + format.authors "author" output.check + new.block.authors + format.title "title" output.check new.block + format.date output + output.url + new.block + note "note" output.check + fin.entry +} + +FUNCTION {inproceedings} %*type* +{ output.bibitem + format.authors "author" output.check + new.block.authors + format.title + talked empty$ 'skip$ 'emphasize if$ % at Thu Nov 9 16:19:53 CET 2006 + "title" output.check + new.block + crossref missing$ + { talked empty$ 'format.in.ed.booktitle 'format.in.talked.booktitle if$ + duplicate$ #1 #1 substring$ "I" = { % Dat: don't append to `Elhangzott' or empty booktitle + series empty$ { duplicate$ empty$ 'skip$ { " (kon\-fe\-ren\-cia\-anyag)" * } if$ } 'skip$ if$ + } 'skip$ if$ + "booktitle" output.check + format.bvolume output % includes functionality of format.number.series + author2 empty$ 'skip$ { author2 output.nonnull new.block } if$ + new.block + address output % ****pts**** + format.date "year" output.check + % new.sentence + organization output + publisher output + } + { format.incoll.inproc.crossref output.nonnull } + if$ + format.pages output + format.isbn output + format.issn output % Dat: most books don't have this + output.url + new.block numpages.output note.output fin.entry +} + +FUNCTION {proceedings} %*type* +{ output.bibitem + editor empty$ + { organization output } + { format.editors output.nonnull } + if$ + new.block + format.btitle "title" output.check + series empty$ { " (konferenciaanyag)" * } 'skip$ if$ + format.bvolume output % includes functionality of format.number.series + author2 empty$ 'skip$ { author2 output.nonnull new.block } if$ + address empty$ + { editor empty$ + { publisher new.sentence.checka } + { organization publisher new.sentence.checkb + organization output + } + if$ + publisher output + format.date "year" output.check + } + { address output.nonnull + format.date "year" output.check + % new.sentence % ****pts**** + editor empty$ + 'skip$ + { organization output } + if$ + publisher output + } + if$ + format.isbn output + format.issn output % Dat: most books don't have this + output.url + new.block numpages.output note.output fin.entry +} + +FUNCTION {conference} %*type* % ****pts**** +{ inproceedings } + +FUNCTION {default.type} { misc } + +FUNCTION {fmts} { %*type* % ****pts**** + % Emulation of \bibtem without typesetting anything. + newline$ + "\immediate\write\@auxout{\string\bibcite{" write$ + cite$ write$ + "}{0}}" write$ newline$ +} +FUNCTION {fmts2} { + firstname.fmt empty$ 'skip$ { firstname.fmt 'firstname.fmt0 := } if$ + lastname.fmt empty$ 'skip$ { lastname.fmt 'lastname.fmt0 := } if$ + init.nfmts +} + +%****pts**** +% Dat: {\-} is needed for format.name$ +MACRO {jan} {"ja{\-}nu{\-}\'ar"} +MACRO {feb} {"feb{\-}ru\'ar"} +MACRO {mar} {"m\'ar{\-}cius"} +MACRO {apr} {"\'ap{\-}ri{\-}lis"} +MACRO {may} {"m\'a{\-}jus"} +MACRO {jun} {"j\'u{\-}ni{\-}us"} +MACRO {jul} {"j\'u{\-}li{\-}us"} +MACRO {aug} {"au{\-}gusz{\-}tus"} +MACRO {sep} {"szep{\-}tem{\-}ber"} +MACRO {oct} {"ok{\-}t\'o{\-}ber"} +MACRO {nov} {"no{\-}vem{\-}ber"} +MACRO {dec} {"de{\-}cem{\-}ber"} + +% Dat: see also in mrabbrev.bib +MACRO {acmcs} {"ACM Computing Surveys"} +MACRO {acta} {"Acta Informatica"} +MACRO {cacm} {"Communications of the ACM"} +MACRO {ibmjrd} {"IBM Journal of Research and Development"} +MACRO {ibmsj} {"IBM Systems Journal"} +MACRO {ieeese} {"IEEE Transactions on Software Engineering"} +MACRO {ieeetc} {"IEEE Transactions on Computers"} +MACRO {ieeetcad} {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} +MACRO {ipl} {"Information Processing Letters"} +MACRO {jacm} {"Journal of the ACM"} +MACRO {jcss} {"Journal of Computer and System Sciences"} +MACRO {scp} {"Science of Computer Programming"} +MACRO {sicomp} {"SIAM Journal on Computing"} +MACRO {tocs} {"ACM Transactions on Computer Systems"} +MACRO {tods} {"ACM Transactions on Database Systems"} +MACRO {tog} {"ACM Transactions on Graphics"} +MACRO {toms} {"ACM Transactions on Mathematical Software"} +MACRO {toois} {"ACM Transactions on Office Information Systems"} +MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} +MACRO {tcs} {"Theoretical Computer Science"} + +READ + +%** @param #1 string +%FUNCTION {reverse} { % +% 't := "" 's := +% #1 +% { duplicate$ t swap$ #1 substring$ "" = not } { +% duplicate$ t swap$ #1 substring$ +% s * 's := +% #1 + +% } while$ +% pop$ s +%} + +%** by pts@fazekas.hu at Mon May 17 16:50:26 CEST 2004 +%** @param 1: TeX string +%** @return {\th}, {\TH} {\dh} {\DH} {\dj} {\DJ} {\ng} {\NG} {\SS} changed to +%** th TH dh DH dj DJ ng NG SS +FUNCTION {rmbrace.extrat1} { + % Dat: #4 #1 substring$ is substr($_,3,1) + 'ss := + "" 'tt := + #1 'len := + #5 + { duplicate$ ss swap$ #1 substring$ "" = not } { + % Stack: index-value (#5, #6 ...) + duplicate$ ss swap$ #1 substring$ "}" = { + duplicate$ ss swap$ #4 - #5 substring$ + %% duplicate$ warning$ + duplicate$ "{\th}" = {#1} { + duplicate$ "{\TH}" = {#1} { + duplicate$ "{\dh}" = {#1} { + duplicate$ "{\DH}" = {#1} { + duplicate$ "{\dj}" = {#1} { + duplicate$ "{\DJ}" = {#1} { + duplicate$ "{\ng}" = {#1} { + duplicate$ "{\NG}" = {#1} { + duplicate$ "{\SS}" = {#1} { + #0 }if$ }if$ }if$ }if$ }if$ }if$ }if$ }if$ }if$ + } {#42 #0} if$ + #1 = { + swap$ + % Stack: 5-char-substring index-value + duplicate$ tt swap$ ss swap$ len swap$ len - #4 - substring$ * 'tt := + swap$ tt swap$ #3 #2 substring$ * 'tt := + #1 + + duplicate$ 'len := + } { pop$ #1 + } if$ + } while$ + pop$ % index value + tt ss len global.max$ substring$ * +} + + +FUNCTION {sortify} +{ rmacc4 % remove accents smartly, so purify$ will remove the accent + % rmbrace.accs + duplicate$ % ****pts**** + rmbrace.extrat1 % ****pts**** + purify$ + % Dat: purify$ removes from "vrom", keeps `varom' in "v\'arom","v{\'a}rom" + % Dat: purify$ changes {\ss} to ss, but {\dj} to empty + "l" change.case$ + " " * + swap$ * +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { nameptr #1 > + { " " * } + 'skip$ + if$ + s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't := + nameptr numnames = t "others" = and + { "et al" * } + { t sortify % Dat: calls rmacc4 and purify$ + %% duplicate$ warning$ + * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.title} +{ rmacc4 't := + "A " #2 + "An " #3 + "The " #4 + "Egy " #4 + "Der " #4 + "Die " #4 + "Das " #4 + "Un " #3 + "Une " #4 + "Az " #3 t chop.word + chop.word chop.word chop.word chop.word chop.word % ***pts**** + chop.word + chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} + +FUNCTION {author.sort} +{ name empty$ + { author empty$ + { key empty$ + { "to sort, need author/key/name in " cite$ * warning$ + title empty$ { "" } { title sort.format.title } if$ % ****pts**** + }{ key sortify } + if$ + }{ author sort.format.names } + if$ + }{ name sort.format.names } + if$ +} + +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key missing$ + { title empty$ nocheck empty$ or + { "to sort, need author, editor, or key in " cite$ * warning$ } 'skip$ if$ + title empty$ { "" } { title sort.format.title } if$ % ****pts**** + } + { key "." = % ****pts**** + { " " title sort.format.title * } % duplicate$ warning$ + % ^^^ Dat: " " is here to put them in front of other books + { key sortify } if$ + } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {author.organization.sort} +{ author empty$ + { organization empty$ + { key empty$ + { "to sort, need author, organization, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { "The " #4 organization chop.word sortify } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {editor.organization.sort} +{ editor empty$ + { organization empty$ + { key empty$ + { "to sort, need editor, organization, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { "The " #4 organization chop.word sortify } + if$ + } + { editor sort.format.names } + if$ +} + +FUNCTION {presort} +{ type$ "book" = type$ "inbook" = or + 'author.editor.sort + { type$ "proceedings" = + 'editor.organization.sort + { type$ "manual" = + 'author.organization.sort + { type$ "fmts" = + { fmts2 "" } % ****pts**** + 'author.sort + if$ + } + if$ + } + if$ + } + if$ + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +EXECUTE {init.accs4} +EXECUTE {init.nfmt0} +EXECUTE {init.nfmts} + +ITERATE {presort} + +SORT + +STRINGS { longest.label } + +INTEGERS { number.label longest.label.width } + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} + +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} + +EXECUTE {initialize.longest.label} + +ITERATE {longest.label.pass} + +FUNCTION {bibIE.a} { + "\makeatletter" write$ newline$ + "\global\def\bibIE@lowc{%" write$ newline$ + " \expandafter\ifx\csname inputencoding\endcsname\relax" write$ newline$ + " \def\NeedsTeXFormat##1]{}%" write$ newline$ + " \def\ProvidesPackage##1]{}%" write$ newline$ + " \def\DeclareOption##1##2{}%" write$ newline$ + " \def\ProcessOptions{\@ifstar\@gobble\@empty}%" write$ newline$ + " \input inputenc.sty" write$ newline$ + " \let\NeedsTeXFormat \@notprerr" write$ newline$ + " \let\ProvidesPackage\@notprerr" write$ newline$ + " \let\DeclareOption \@notprerr" write$ newline$ + " \let\ProcessOptions \@notprerr" write$ newline$ + " \fi" write$ newline$ + " \global\let\bibIE@lowc\relax}" write$ newline$ + "\def\bibIE@lowa#1#2{%" write$ newline$ + " \global\def\bibResetInputEncoding{\bibIE@lowb{ascii}}% anti-warning" write$ newline$ + " \ifx#1\relax\else" write$ newline$ + " \ifx#1\@inpenc@undefined@\@empty" write$ newline$ + " \global\def\bibResetInputEncoding{\bibIE@lowb{#2}}%" write$ newline$ + " \ifx\bibResetInputEncoding\reserved@a% keep old encoding" write$ newline$ + " \global\let\bibResetInputEncoding\@empty \let\reserved@a\@empty \fi" write$ newline$ + " \fi\fi}" write$ newline$ +} +FUNCTION {bibIE.b} { + "\let\bibIE@input\input" write$ newline$ + "\def\bibIE@ascii{ascii}" write$ newline$ + "\def\bibIE@lowb#1{%" write$ newline$ + " \def\reserved@a{#1}\ifx\reserved@a\bibIE@ascii" write$ newline$ + " \gdef\@inpenc@test{\global\let\@inpenc@test\relax}%" write$ newline$ + " \edef\@inpenc@undefined{\noexpand\@inpenc@undefined@{ascii}}%" write$ newline$ + " \@inpenc@loop\^^A\^^H\@inpenc@loop\^^K\^^K%" write$ newline$ + " \@inpenc@loop\^^N\^^_\@inpenc@loop\^^?\^^ff%" write$ newline$ + "\else\def\input{\global\let\@inpenc@test\relax \bibIE@input}% no {ascii} warn" write$ newline$ + " \inputencoding{#1}\fi}%" write$ newline$ + "\def\bibInputEncoding#1{%" write$ newline$ + " \bibIE@lowc" write$ newline$ + " \def\reserved@a{\bibIE@lowb{#1}}%" write$ newline$ + " % vvv \@inpenc@undefined -> `\@inpenc@undefined@{latin2}' or undefined" write$ newline$ + " \expandafter\expandafter\expandafter\bibIE@lowa\csname" write$ newline$ + " @inpenc@undefined\endcsname\relax" write$ newline$ + " \reserved@a}" write$ newline$ newline$ +} + +%** Usage: insert `\let\bibEarlyBegin\hfuzz \InputIfFileExists{\jobname.bbl}{}{}' +%** into the LaTeX document preamble to avoid running latex(1) twice after +%** bibtex(1) has been run. +FUNCTION {bibIE.c} { + "\makeatletter \ifx\bibEarlyBegin\hfuzz" write$ newline$ + " \def\bibEarlyBegin{\begingroup\everypar{}\sloppy\hbadness10000 " write$ newline$ + " \def\Hy@colorlink##1{\begingroup}" write$ newline$ % for hyperref.sty + " \def\Hy@endcolorlink{\endgroup}" write$ newline$ % for hyperref.sty + " \def\@inpenc@loop##1##2{}" write$ newline$ + " \def\thebibliography##1{}" write$ newline$ + " \def\endthebibliography{\skip@egroup\aftergroup\bibEarlyEnd}%" write$ newline$ + " \def\inputencoding##1{}\c@enumi\z@" write$ newline$ + " \def\bibitem{\skip@egroup \let\skip@egroup\egroup" write$ newline$ + " \advance\c@enumi\@ne\@ifnextchar[\@lbibitem\@bibitem}%" write$ newline$ + " \def\@lbibitem[##1]##2{\bibcite{##2}{##1}%" write$ newline$ + " \setbox0\vbox\bgroup}% avoid emitting boxes" write$ newline$ + " \def\@bibitem##1{\expandafter\skip@bibcite\expandafter" write$ newline$ + " {\the\c@enumi}{##1}\setbox0\vbox\bgroup}% avoid emitting boxes" write$ newline$ + " \def\skip@bibcite##1##2{\bibcite{##2}{##1}}%" write$ newline$ + " \catcode11=9 % ignored" write$ newline$ + " \@tempcnta 1 \loop\catcode\@tempcnta=9" write$ newline$ + " \ifnum\@tempcnta< 8 \advance\@tempcnta\@ne\repeat" write$ newline$ + " \@tempcnta 14 \loop\catcode\@tempcnta=9" write$ newline$ + " \ifnum\@tempcnta< 31 \advance\@tempcnta\@ne\repeat" write$ newline$ + " \@tempcnta127 \loop\catcode\@tempcnta=9" write$ newline$ + " \ifnum\@tempcnta<255 \advance\@tempcnta\@ne\repeat" write$ newline$ + " \let\skip@egroup\relax}" write$ newline$ + " \def\bibEarlyEnd{\endgroup \let\bibcite\@gobbletwo" write$ newline$ + " \global\let\bibEarlyRead\relax}" write$ newline$ + " \bibEarlyBegin" write$ newline$ + "\else \let\bibEarlyEnd\relax \fi" write$ newline$ + newline$ +} + +FUNCTION {begin.bib} +{ bibIE.c + % Dat: bibTeX breaks long lines (>78 chars), so we wouldn't emit such lines + "\begin{thebibliography}{" longest.label * "}" * write$ newline$ + preamble$ empty$ 'skip$ { preamble$ write$ newline$ } if$ + % ****pts**** Dat: put preamble$ after \begin{thebibliography} + "\frenchspacing" write$ newline$ % !! optional + bibIE.a + bibIE.b + "\def\leftflushbreak{\ifx\\\@centercr\penalty100 \else" write$ newline$ % Dat: \\ is \@centercr for \raggedright + " \unpenalty\unpenalty{\@tempdima\lastskip\unskip\nobreak" write$ newline$ + " \hskip\@tempdima plus1fil}\null\penalty100 \hskip0pt plus-1fil\relax\fi}" write$ newline$ + % "\def\leftflushbreak{\nobreak\hskip0pt plus1fil\null\penalty100 \hskip0pt plus-1fil\relax}" write$ newline$ + + % Ignoring newline + spaces in a \verb (usually called in \bibUrll). + % This doesn't apply for \usepackage{url} -- please use that to have + % line breaks in the URLs. + % Example .bbl excerpt (to be converted to \bibUrll{URL} >http://foobarbaz>.) + % \bibUrll{URL} >http:// + % foobar + % baz<, + "\begingroup\lccode\string`~=\string`\^^M" write$ newline$ + " \lowercase{\endgroup\def\verb@eol@error{\obeylines\def~{\bibVerbNoSp}}}" write$ newline$ + "\begingroup\lccode\string`~=\string`\ \relax" write$ newline$ + " \lowercase{\endgroup\def\bibVerbNoSp#1{\ifx#1~\expandafter\bibVerbNoSp" write$ newline$ + " \else\expandafter#1\fi}}" write$ newline$ + + "\expandafter\ifx\csname bibUrll\endcsname\relax" write$ newline$ + "\expandafter\ifx\csname url\endcsname\relax" write$ newline$ + " \def\bibUrll#1>{\leavevmode\leftflushbreak #1~\verb>}" write$ newline$ % Imp: line breaks etc., \PVerb + "\else\def\bibUrll#1>{\leavevmode\leftflushbreak#1~\begingroup" write$ newline$ + " \catcode\string`\%=12 \catcode\string`\#=12 \bibUrlll}" write$ newline$ + " \def\bibUrlll#1>{\url{#1}\endgroup}\fi" write$ newline$ + % ^^^ "\else\def\bibUrll#1>#2>{\leftflushbreak #1~\url{#2}}\fi" write$ newline$ + % ^^^ Imp: do these parens work? Includes field URL for Internet addresses (best used with with the url.sty package of Donald Arseneau) + "\fi" write$ newline$ + % vvv Dat: so user can specify `{\empty Maf}fia' and still have the `ffi' ligature -- undocumented. + % vvv Dat: doesn't work with hyperref.sty, and has marginal benefits -- commented out + % "\def\empty{\egroup\expandafter\@firstofone\expandafter{\iffalse}\fi}" write$ newline$ + "\def\bibHU@mix#1{\egroup#1}" write$ newline$ + %"\def\empty{\expandafter\bibHU@mix\expandafter{\iffalse}\fi}" write$ newline$ + %"\def\bibHU@mix#1{\egroup#1}" write$ newline$ + % vvv Dat: Hungarian typgrphy dictates 1/3 non-stretchable space, which + % might look ugly, because the space between f+l names stretches more. + "\def\bibAnd#1{\nobreak\,\nobreak\hbox{--}\,}" write$ newline$ + % "\def\bibAnd#1{\ifcase#1 , \or\space and \or, and \fi}" write$ newline$ + % "\def\bibAnd#1{\ifcase#1 , \else\space\'es \fi}" write$ newline$ + % "\def\bibEtAl#1{ et~al.}" write$ newline$ % Dat: or `et al.' (meaning: et alii) + "\def\bibEtAl#1{ \'es m\'asok}" write$ newline$ + % ^^^ Dat: botht \bibEtAl confirmed by Gyurgyk (p. 137) + "\def\bibEd#1{ (szerk.)}" write$ newline$ + % "\def\bibEd#1{ (szerk\ifcase#1 .\else eszt\H{o}k\fi)}" write$ newline$ % (szerk.) or (szerkesztk) + % "\let\bibNewBlock\newblock" write$ newline$ + "\def\bibNewBlock{\unskip\space}" write$ newline$ + % "\def\bibVolume#1{k\" quote$ "otet}" * * write$ newline$ + "\def\bibVolume#1#2{#1 k\" quote$ "ot.} \let\bibNumVolumes\bibVolume" * * write$ newline$ + % "\def\bibTechRep#1{Technical Report}" write$ newline$ + "\def\bibTechRep#1{Jelent\'{e}s}" write$ newline$ % Dat: `.' utn van => nagybet + "\def\bibInSelf#1{In u\H{o}: }" write$ newline$ + "\csname bibOverride\endcsname" write$ newline$ +} + + +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} + +% #****pts**** !! +FUNCTION {what} { + % "dr. Kpeczi, Bla and Jules Verne and Kossuth, Lajos and grf Szchenyi, Istvn and John von Neumann and Donald E. Knuth and Strunk, Jr., William and Knzy, ifj., Jen and L. R. McColvin and Tindi Lantos, Sebestyn and Molnr-Sska, Balzs and Claude Lvi-Strauss and Kis, Pter Pl and Mary-Claire van Leunen and Paul Gerhard Hoel and G. Bernard Godfrey and II., Jnos-Pl and {Szerencsejtk Rt.} and {\empty Earl of} Traquair and Horace [pseud.] Hunt and Verne, {\empty Gy}ula" 's := + % init.nfmts s #1 nfmt0 format.name$ warning$ + % ss #385 #1 substring$ warning$ + % "fo{\'o}\oe{\H u}s{\HON}{\HANT}" rmbrace.accs warning$ % to "fo\'o\oe\H us{\HON}{\HANT}" + % "fr\'e ncia" purify$ warning$ + % "bar" #-1 #1 substring$ warning$ + % "5~janu\'ar" #1 "{ll~~}{ff{}}" format.name$ warning$ + % "janu\'ar" #1 "{ll}{~ff.}" format.name$ warning$ + % "{\null Gy}urgyk" #1 "{l}/" format.name$ warning$ + % "AzBrvztr~tkrfrgp" rmacc.latin2 warning$ + % "fogbar" #3 #1 substring$ warning$ + % "Az rvztr tkrfrgp" sortify warning$ + % "Marjai, Imre and Pataky, Dnes" rmacc.latin2 warning$ + % "{\empty\'\i}purify" purify$ warning$ + % "grof Szechenyi, Istvan" #1 "{ll}/{ff}/{jj}/{vv}" format.name$ warning$ + % "John von Neumann" #1 "{ll}/{ff}/{jj}/{vv}" format.name$ warning$ + % "Tindi Lantos, Sebestyn" #1 "{ll}/{ff}/{jj}/{vv}" format.name$ warning$ + % "II., Janos., Pal" #1 "{ll}/{ff}/{jj}/{vv}" format.name$ warning$ + % "lom" "u" change.case$ warning$ % "LOM" + % "{\'a}lom" "u" change.case$ warning$ % "{\'A}LOM" + %"alma{\ss}t" purify$ warning$ % alma{\ss}t + %"alma{\dj}t" purify$ warning$ % almat (!) + % "egykor{\th}Alma korte" rmbrace.extrat1 warning$ +} +EXECUTE {what} diff --git a/src/include/declaration.tex b/src/include/declaration.tex new file mode 100644 index 0000000..d8522be --- /dev/null +++ b/src/include/declaration.tex @@ -0,0 +1,32 @@ +\selectlanguage{magyar} +\pagenumbering{gobble} +%-------------------------------------------------------------------------------------- +% Nyilatkozat +%-------------------------------------------------------------------------------------- +\begin{center} +\large +\textbf{HALLGATÓI NYILATKOZAT}\\ +\end{center} + +Alulírott \emph{\vikszerzoVezeteknev{} \vikszerzoKeresztnev}, szigorló hallgató kijelentem, hogy ezt a \vikmunkatipusat{} meg nem engedett segítség nélkül, saját magam készítettem, csak a megadott forrásokat (szakirodalom, eszközök stb.) használtam fel. Minden olyan részt, melyet szó szerint, vagy azonos értelemben, de átfogalmazva más forrásból átvettem, egyértelműen, a forrás megadásával megjelöltem. + +Hozzájárulok, hogy a jelen munkám alapadatait (szerző(k), cím, angol és magyar nyelvű tartalmi kivonat, készítés éve, konzulens(ek) neve) a BME VIK nyilvánosan hozzáférhető elektronikus formában, a munka teljes szövegét pedig az egyetem belső hálózatán keresztül (vagy autentikált felhasználók számára) közzétegye. Kijelentem, hogy a benyújtott munka és annak elektronikus verziója megegyezik. Dékáni engedéllyel titkosított diplomatervek esetén a dolgozat szövege csak 3 év eltelte után válik hozzáférhetővé. + +\begin{flushleft} +\vspace*{1cm} +Budapest, \today +\end{flushleft} + +\begin{flushright} + \vspace*{1cm} + \makebox[7cm]{\rule{6cm}{.4pt}}\\ + \makebox[7cm]{\emph{\vikszerzoVezeteknev{} \vikszerzoKeresztnev}}\\ + \makebox[7cm]{hallgató} +\end{flushright} +\thispagestyle{empty} + +\vfill +\clearpage +\thispagestyle{empty} % an empty page + +\selectthesislanguage diff --git a/src/include/guideline.tex b/src/include/guideline.tex new file mode 100644 index 0000000..86e3f94 --- /dev/null +++ b/src/include/guideline.tex @@ -0,0 +1,54 @@ +\selecthungarian +%-------------------------------------------------------------------------------------- +% Rovid formai es tartalmi tajekoztato +%-------------------------------------------------------------------------------------- + +\footnotesize +\begin{center} +\large +\textbf{\Large Általános információk, a diplomaterv szerkezete}\\ +\end{center} + +A diplomaterv szerkezete a BME Villamosmérnöki és Informatikai Karán: +\begin{enumerate} +\item Diplomaterv feladatkiírás +\item Címoldal +\item Tartalomjegyzék +\item A diplomatervező nyilatkozata az önálló munkáról és az elektronikus adatok kezeléséről +\item Tartalmi összefoglaló magyarul és angolul +\item Bevezetés: a feladat értelmezése, a tervezés célja, a feladat indokoltsága, a diplomaterv felépítésének rövid összefoglalása +\item A feladatkiírás pontosítása és részletes elemzése +\item Előzmények (irodalomkutatás, hasonló alkotások), az ezekből levonható következtetések +\item A tervezés részletes leírása, a döntési lehetőségek értékelése és a választott megoldások indoklása +\item A megtervezett műszaki alkotás értékelése, kritikai elemzése, továbbfejlesztési lehetőségek +\item Esetleges köszönetnyilvánítások +\item Részletes és pontos irodalomjegyzék +\item Függelék(ek) +\end{enumerate} + +Felhasználható a következő oldaltól kezdődő \LaTeX diplomatervsablon dokumentum tartalma. + +A diplomaterv szabványos méretű A4-es lapokra kerüljön. Az oldalak tükörmargóval készüljenek (mindenhol 2,5~cm, baloldalon 1~cm-es kötéssel). Az alapértelmezett betűkészlet a 12 pontos Times New Roman, másfeles sorközzel, de ettől kismértékben el lehet térni, ill. más betűtípus használata is megengedett. + +Minden oldalon -- az első négy szerkezeti elem kivételével -- szerepelnie kell az oldalszámnak. + +A fejezeteket decimális beosztással kell ellátni. Az ábrákat a megfelelő helyre be kell illeszteni, fejezetenként decimális számmal és kifejező címmel kell ellátni. A fejezeteket decimális aláosztással számozzuk, maximálisan 3 aláosztás mélységben (pl. 2.3.4.1.). Az ábrákat, táblázatokat és képleteket célszerű fejezetenként külön számozni (pl. 2.4. ábra, 4.2. táblázat vagy képletnél (3.2)). A fejezetcímeket igazítsuk balra, a normál szövegnél viszont használjunk sorkiegyenlítést. Az ábrákat, táblázatokat és a hozzájuk tartozó címet igazítsuk középre. A cím a jelölt rész alatt helyezkedjen el. + +A képeket lehetőleg rajzoló programmal készítsék el, az egyenleteket egyenlet-szerkesztő segítségével írják le (A \LaTeX~ehhez kézenfekvő megoldásokat nyújt). + +Az irodalomjegyzék szövegközi hivatkozása történhet sorszámozva (ez a preferált megoldás) vagy a Harvard-rendszerben (a szerző és az évszám megadásával). A teljes lista névsor szerinti sorrendben a szöveg végén szerepeljen (sorszámozott irodalmi hivatkozások esetén hivatkozási sorrendben). A szakirodalmi források címeit azonban mindig az eredeti nyelven kell megadni, esetleg zárójelben a fordítással. A listában szereplő valamennyi publikációra hivatkozni kell a szövegben (a \LaTeX-sablon a Bib\TeX~segítségével mindezt automatikusan kezeli). Minden publikáció a szerzők után a következő adatok szerepelnek: folyóirat cikkeknél a pontos cím, a folyóirat címe, évfolyam, szám, oldalszám tól-ig. A folyóiratok címét csak akkor rövidítsük, ha azok nagyon közismertek vagy nagyon hosszúak. Internetes hivatkozások megadásakor fontos, hogy az elérési út előtt megadjuk az oldal tulajdonosát és tartalmát (mivel a link egy idő után akár elérhetetlenné is válhat), valamint az elérés időpontját. + +\vspace{5mm} +Fontos: +\begin{itemize} + \item A szakdolgozatkészítő / diplomatervező nyilatkozata (a jelen sablonban szereplő szövegtartalommal) kötelező előírás, Karunkon ennek hiányában a szakdolgozat/diplomaterv nem bírálható és nem védhető! + \item Mind a dolgozat, mind a melléklet maximálisan 15~MB méretű lehet! +\end{itemize} + +\vspace{5mm} +\begin{center} +Jó munkát, sikeres szakdolgozatkészítést, ill. diplomatervezést kívánunk! +\end{center} + +\normalsize +\selectthesislanguage diff --git a/src/include/packages.tex b/src/include/packages.tex new file mode 100644 index 0000000..bd90e7e --- /dev/null +++ b/src/include/packages.tex @@ -0,0 +1,73 @@ +% !TeX root = ../thesis.tex +% thanks to http://tex.stackexchange.com/a/47579/71109 +\usepackage{ifxetex} +\usepackage{ifluatex} +\newif\ifxetexorluatex % a new conditional starts as false +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi>0 + \xetexorluatextrue +\fi + +\ifxetexorluatex + \usepackage{fontspec} +\else + \usepackage[T1]{fontenc} + \usepackage[utf8]{inputenc} + \usepackage[lighttt]{lmodern} +\fi + +\usepackage[english,magyar]{babel} % Alapértelmezés szerint utoljára definiált nyelv lesz aktív, de később külön beállítjuk az aktív nyelvet. + +%\usepackage{cmap} +\usepackage{amsfonts,amsmath,amssymb} % Mathematical symbols. +%\usepackage[ruled,boxed,resetcount,linesnumbered]{algorithm2e} % For pseudocodes. % beware: this is not compatible with LuaLaTeX, see http://tex.stackexchange.com/questions/34814/lualatex-and-algorithm2e +\usepackage{booktabs} % For publication quality tables for LaTeX +\usepackage{graphicx} + +\usepackage{listings} + +%\usepackage{fancyhdr} +%\usepackage{lastpage} + +\usepackage{anysize} +%\usepackage{sectsty} +\usepackage{setspace} % For setting line spacing + +\usepackage[unicode]{hyperref} % For hyperlinks in the generated document. +\usepackage{xcolor} +\usepackage{listings} % For source code snippets. + +\usepackage[amsmath,thmmarks]{ntheorem} % Theorem-like environments. + +\usepackage[hang]{caption} + +\singlespacing + +\newcommand{\selecthungarian}{ + \selectlanguage{magyar} + \setlength{\parindent}{2em} + \setlength{\parskip}{0em} + \frenchspacing +} + +\newcommand{\selectenglish}{ + \selectlanguage{english} + \setlength{\parindent}{0em} + \setlength{\parskip}{0.5em} + \nonfrenchspacing + \renewcommand{\figureautorefname}{Figure} + \renewcommand{\tableautorefname}{Table} + \renewcommand{\partautorefname}{Part} + \renewcommand{\chapterautorefname}{Chapter} + \renewcommand{\sectionautorefname}{Section} + \renewcommand{\subsectionautorefname}{Section} + \renewcommand{\subsubsectionautorefname}{Section} +} + +\usepackage[numbers]{natbib} +\usepackage{xspace} + +\usepackage{tikz} +\usepackage{pgfplots} +\pgfplotsset{compat=1.6} + +\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref} diff --git a/src/include/preamble.tex b/src/include/preamble.tex new file mode 100644 index 0000000..7b2e514 --- /dev/null +++ b/src/include/preamble.tex @@ -0,0 +1,125 @@ +%-------------------------------------------------------------------------------------- +% Page layout setup +%-------------------------------------------------------------------------------------- +% we need to redefine the pagestyle plain +% another possibility is to use the body of this command without \fancypagestyle +% and use \pagestyle{fancy} but in that case the special pages +% (like the ToC, the References, and the Chapter pages)remain in plane style + +\pagestyle{plain} +\marginsize{35mm}{25mm}{15mm}{15mm} + +\setcounter{tocdepth}{3} +%\sectionfont{\large\upshape\bfseries} +\setcounter{secnumdepth}{3} + +\sloppy % Margón túllógó sorok tiltása. +\widowpenalty=10000 \clubpenalty=10000 %A fattyú- és árvasorok elkerülése +\def\hyph{-\penalty0\hskip0pt\relax} % Kötőjeles szavak elválasztásának engedélyezése + + +%-------------------------------------------------------------------------------------- +% Setup hyperref package +%-------------------------------------------------------------------------------------- +\hypersetup{ + % bookmarks=true, % show bookmarks bar? + unicode=true, % non-Latin characters in Acrobat's bookmarks + pdftitle={\vikcim}, % title + pdfauthor={\szerzoMeta}, % author + pdfsubject={\vikdoktipus}, % subject of the document + pdfcreator={\szerzoMeta}, % creator of the document + pdfproducer={}, % producer of the document + pdfkeywords={}, % list of keywords (separate then by comma) + pdfnewwindow=true, % links in new window + colorlinks=true, % false: boxed links; true: colored links + linkcolor=black, % color of internal links + citecolor=black, % color of links to bibliography + filecolor=black, % color of file links + urlcolor=black % color of external links +} + + +%-------------------------------------------------------------------------------------- +% Set up listings +%-------------------------------------------------------------------------------------- +\definecolor{lightgray}{rgb}{0.95,0.95,0.95} +\lstset{ + basicstyle=\scriptsize\ttfamily, % print whole listing small + keywordstyle=\color{black}\bfseries, % bold black keywords + identifierstyle=, % nothing happens + % default behavior: comments in italic, to change use + % commentstyle=\color{green}, % for e.g. green comments + stringstyle=\scriptsize, + showstringspaces=false, % no special string spaces + aboveskip=3pt, + belowskip=3pt, + backgroundcolor=\color{lightgray}, + columns=flexible, + keepspaces=true, + escapeinside={(*@}{@*)}, + captionpos=b, + breaklines=true, + frame=single, + float=!ht, + tabsize=2, + literate=* + {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ö}{{\"o}}1 {ő}{{\H{o}}}1 {ú}{{\'u}}1 {ü}{{\"u}}1 {ű}{{\H{u}}}1 + {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ö}{{\"O}}1 {Ő}{{\H{O}}}1 {Ú}{{\'U}}1 {Ü}{{\"U}}1 {Ű}{{\H{U}}}1 +} + + +%-------------------------------------------------------------------------------------- +% Set up theorem-like environments +%-------------------------------------------------------------------------------------- +% Using ntheorem package -- see http://www.math.washington.edu/tex-archive/macros/latex/contrib/ntheorem/ntheorem.pdf + +\theoremstyle{plain} +\theoremseparator{.} +\newtheorem{example}{\pelda} + +\theoremseparator{.} +%\theoremprework{\bigskip\hrule\medskip} +%\theorempostwork{\hrule\bigskip} +\theorembodyfont{\upshape} +\theoremsymbol{{\large \ensuremath{\centerdot}}} +\newtheorem{definition}{\definicio} + +\theoremseparator{.} +%\theoremprework{\bigskip\hrule\medskip} +%\theorempostwork{\hrule\bigskip} +\newtheorem{theorem}{\tetel} + + +%-------------------------------------------------------------------------------------- +% Some new commands and declarations +%-------------------------------------------------------------------------------------- +\newcommand{\code}[1]{{\upshape\ttfamily\scriptsize\indent #1}} +\newcommand{\doi}[1]{DOI: \href{http://dx.doi.org/\detokenize{#1}}{\raggedright{\texttt{\detokenize{#1}}}}} % A hivatkozások közt így könnyebb DOI-t megadni. + +\DeclareMathOperator*{\argmax}{arg\,max} +%\DeclareMathOperator*[1]{\floor}{arg\,max} +\DeclareMathOperator{\sign}{sgn} +\DeclareMathOperator{\rot}{rot} + + +%-------------------------------------------------------------------------------------- +% Setup captions +%-------------------------------------------------------------------------------------- +\captionsetup[figure]{ + width=.75\textwidth, + aboveskip=10pt} + +\renewcommand{\captionlabelfont}{\bf} +%\renewcommand{\captionfont}{\footnotesize\it} + +%-------------------------------------------------------------------------------------- +% Hyphenation exceptions +%-------------------------------------------------------------------------------------- +\hyphenation{Shakes-peare Mar-seilles ár-víz-tű-rő tü-kör-fú-ró-gép} + + +\author{\vikszerzo} +\title{\viktitle} + +\renewcommand{\lstlistingname}{K\'odr\'eszlet}% Listing -> Algorithm +\renewcommand{\lstlistlistingname}{List of \lstlistingname s}% List of Listings -> List of Algorithms diff --git a/src/include/project.tex b/src/include/project.tex new file mode 100644 index 0000000..313cc4e --- /dev/null +++ b/src/include/project.tex @@ -0,0 +1,10 @@ +%-------------------------------------------------------------------------------------- +% Feladatkiiras (a tanszeken atveheto, kinyomtatott valtozat) +%-------------------------------------------------------------------------------------- +\clearpage +\begin{center} +\large +\textbf{FELADATKIÍRÁS}\\ +\end{center} + +A feladatkiírást a tanszéki adminisztrációban lehet átvenni, és a leadott munkába eredeti, tanszéki pecséttel ellátott és a tanszékvezető által aláírt lapot kell belefűzni (ezen oldal \emph{helyett}, ez az oldal csak útmutatás). Az elektronikusan feltöltött dolgozatban már nem kell beleszerkeszteni ezt a feladatkiírást. diff --git a/src/include/tdk-variables.tex b/src/include/tdk-variables.tex new file mode 100644 index 0000000..3408e12 --- /dev/null +++ b/src/include/tdk-variables.tex @@ -0,0 +1,11 @@ +%-------------------------------------------------------------------------------------- +% TDK-specifikus változók +%-------------------------------------------------------------------------------------- +\newcommand{\tdkszerzoB}{Második Szerző} % Második szerző neve; hagyd üresen, ha egyedül írtad a TDK-t. +\newcommand{\tdkev}{2014} % A dolgozat írásának éve (pl. "2014") (Ez OTDK-nál eltérhet az aktuális évtől.) + +% További adatok az OTDK címlaphoz (BME-s TDK-hoz nem kell kitölteni) +\newcommand{\tdkevfolyamA}{IV} % Első szerző évfolyama, római számmal (pl. IV). +\newcommand{\tdkevfolyamB}{III} % Második szerző évfolyama, római számmal (pl. III). +\newcommand{\tdkkonzulensbeosztasA}{egyetemi tanár} % Első konzulens beosztása (pl. egyetemi docens) +\newcommand{\tdkkonzulensbeosztasB}{doktorandusz} % Második konzulens beosztása (pl. egyetemi docens) diff --git a/src/include/thesis-en.tex b/src/include/thesis-en.tex new file mode 100644 index 0000000..50cb082 --- /dev/null +++ b/src/include/thesis-en.tex @@ -0,0 +1,57 @@ +%-------------------------------------------------------------------------------------- +% Elnevezések +%-------------------------------------------------------------------------------------- +\newcommand{\bme}{Budapest University of Technology and Economics} +\newcommand{\vik}{Faculty of Electrical Engineering and Informatics} + +\newcommand{\bmemit}{Department of Measurement and Information Systems} +\newcommand{\bmetmit}{Department of Telecommunications and Media Informatics} + +\newcommand{\keszitette}{Author} +\newcommand{\konzulens}{Advisor} + +\newcommand{\bsc}{Bachelor's Thesis} +\newcommand{\msc}{Master's Thesis} +\newcommand{\tdk}{Scientific Students' Association Report} +\newcommand{\bsconlab}{BSc Project Laboratory} +\newcommand{\msconlabi}{MSc Project Laboratory 1} +\newcommand{\msconlabii}{MSc Project Laboratory 2} + +\newcommand{\pelda}{Example} +\newcommand{\definicio}{Definition} +\newcommand{\tetel}{Theorem} + +\newcommand{\bevezetes}{Introduction} +\newcommand{\koszonetnyilvanitas}{Acknowledgements} +\newcommand{\fuggelek}{Appendix} + +% Optional custom titles +%\addto\captionsenglish{% +%\renewcommand*{\listfigurename}{Your list of figures title} +%\renewcommand*{\listtablename}{Your list of tables title} +%\renewcommand*{\bibname}{Your bibliography title} +%} + +\newcommand{\szerzo}{\vikszerzoKeresztnev{} \vikszerzoVezeteknev} +\newcommand{\vikkonzulensA}{\vikkonzulensAMegszolitas\vikkonzulensAKeresztnev{} \vikkonzulensAVezeteknev} +\newcommand{\vikkonzulensB}{\vikkonzulensBMegszolitas\vikkonzulensBKeresztnev{} \vikkonzulensBVezeteknev} +\newcommand{\vikkonzulensC}{\vikkonzulensCMegszolitas\vikkonzulensCKeresztnev{} \vikkonzulensCVezeteknev} + +\newcommand{\selectthesislanguage}{\selectenglish} + +\bibliographystyle{unsrt} + +\newcommand{\ie}{i.e.\@\xspace} +\newcommand{\Ie}{I.e.\@\xspace} +\newcommand{\eg}{e.g.\@\xspace} +\newcommand{\Eg}{E.g.\@\xspace} +\newcommand{\etal}{et al.\@\xspace} +\newcommand{\etc}{etc.\@\xspace} +\newcommand{\vs}{vs.\@\xspace} +\newcommand{\viz}{viz.\@\xspace} % videlicet +\newcommand{\cf}{cf.\@\xspace} % confer +\newcommand{\Cf}{Cf.\@\xspace} +\newcommand{\wrt}{w.r.t.\@\xspace} % with respect to +\newcommand{\approximately}{approx.\@\xspace} + +\newcommand{\appendixnumber}{1} % a fofejezet-szamlalo az angol ABC 1. betuje (A) lesz diff --git a/src/include/thesis-hu.tex b/src/include/thesis-hu.tex new file mode 100644 index 0000000..29335e9 --- /dev/null +++ b/src/include/thesis-hu.tex @@ -0,0 +1,46 @@ +%-------------------------------------------------------------------------------------- +% Elnevezések +%-------------------------------------------------------------------------------------- +\newcommand{\bme}{Budapesti Műszaki és Gazdaságtudományi Egyetem} +\newcommand{\vik}{Villamosmérnöki és Informatikai Kar} + +\newcommand{\bmemit}{Méréstechnika és Információs Rendszerek Tanszék} +\newcommand{\bmetmit}{Távközlési és Médiainformatikai Tanszék} + +\newcommand{\keszitette}{Készítette} +\newcommand{\konzulens}{Konzulens} + +\newcommand{\bsc}{Szakdolgozat} +\newcommand{\msc}{Diplomaterv} +\newcommand{\tdk}{TDK dolgozat} +\newcommand{\bsconlab}{BSc Önálló laboratórium} +\newcommand{\msconlabi}{MSc Önálló laboratórium 1.} +\newcommand{\msconlabii}{MSc Önálló laboratórium 2.} + +\newcommand{\pelda}{Példa} +\newcommand{\definicio}{Definíció} +\newcommand{\tetel}{Tétel} + +\newcommand{\bevezetes}{Bevezetés} +\newcommand{\koszonetnyilvanitas}{Köszönetnyilvánítás} +\newcommand{\fuggelek}{Függelék} + +% Opcionálisan átnevezhető címek +%\addto\captionsmagyar{% +%\renewcommand{\listfigurename}{Saját ábrajegyzék cím} +%\renewcommand{\listtablename}{Saját táblázatjegyzék cím} +%\renewcommand{\bibname}{Saját irodalomjegyzék név} +%} + +\newcommand{\szerzo}{\vikszerzoVezeteknev{} \vikszerzoKeresztnev} +\newcommand{\vikkonzulensA}{\vikkonzulensAMegszolitas\vikkonzulensAVezeteknev{} \vikkonzulensAKeresztnev} +\newcommand{\vikkonzulensB}{\vikkonzulensBMegszolitas\vikkonzulensBVezeteknev{} \vikkonzulensBKeresztnev} +\newcommand{\vikkonzulensC}{\vikkonzulensCMegszolitas\vikkonzulensCVezeteknev{} \vikkonzulensCKeresztnev} + +\newcommand{\selectthesislanguage}{\selecthungarian} + +\bibliographystyle{unsrt} + +\def\lstlistingname{lista} + +\newcommand{\appendixnumber}{6} % a fofejezet-szamlalo az angol ABC 6. betuje (F) lesz diff --git a/src/include/titlepage-otdk.tex b/src/include/titlepage-otdk.tex new file mode 100644 index 0000000..54ecb05 --- /dev/null +++ b/src/include/titlepage-otdk.tex @@ -0,0 +1,58 @@ +%% OTDK külső címlap +\begin{titlepage} + $\;$ + \vspace{5cm} + + \begin{center} + \Huge + \textbf{TDK-dolgozat}\let\thefootnote\relax\footnote{A dolgozat bemutatását a XXXXXXXXX ``Lorem ipsum dolor sit amet'' című program támogatta.} + \end{center} + + \vspace{13cm} + + \Large + \hspace{8cm} \szerzo + + \hspace{8cm} \tdkszerzoB + + \hspace{8cm} \tdkev. +\end{titlepage} + +\newpage +\thispagestyle{empty} + + +%% OTDK belső címlap +\begin{titlepage} + \begin{center} + \includegraphics[width=7cm]{./figures/bme_logo.pdf} + \vspace{0.3cm} + + \bme \\ + \vik \\ + \viktanszek \\ + \vspace{3.5cm} + + \huge {\vikcim} + \vspace{1.5cm} + + \large {\textbf{\vikdoktipus}} + \vfill + + {\Large + {\large \keszitette:} \\ \vspace{0.2cm} + \szerzo \\ \tdkevfolyamA. évfolyam \\ + \vspace{0.5cm} + \tdkszerzoB \\ \tdkevfolyamB. évfolyam \\ + \vspace{1.5cm} + {\large \konzulens:} \\ \vspace{0.2cm} + \vikkonzulensA,\\ \tdkkonzulensbeosztasA \\ + \vspace{0.5cm} + \vikkonzulensB,\\ \tdkkonzulensbeosztasB \\ + } + + \vspace{2cm} + \large {\tdkev.} + + \end{center} +\end{titlepage} \ No newline at end of file diff --git a/src/include/titlepage-tdk.tex b/src/include/titlepage-tdk.tex new file mode 100644 index 0000000..fdd3bb3 --- /dev/null +++ b/src/include/titlepage-tdk.tex @@ -0,0 +1,32 @@ +%% TDK címlap +\begin{titlepage} + \begin{center} + \includegraphics[width=7cm]{./figures/bme_logo.pdf} + \vspace{0.3cm} + + \bme \\ + \vik \\ + \viktanszek \\ + \vspace{5cm} + + \huge {\vikcim} + \vspace{1.5cm} + + \large {\textbf{\tdk}} + \vfill + + {\Large + \keszitette: \\ \vspace{0.3cm} + \szerzo \\ + \tdkszerzoB \\ + \vspace{1.5cm} + \konzulens: \\ \vspace{0.3cm} + \vikkonzulensA \\ + \vikkonzulensB \\ + } + + \vspace{2cm} + \large {\tdkev} + \end{center} +\end{titlepage} +%% Címlap vége diff --git a/src/include/titlepage.tex b/src/include/titlepage.tex new file mode 100644 index 0000000..b7835dd --- /dev/null +++ b/src/include/titlepage.tex @@ -0,0 +1,33 @@ +\hypersetup{pageanchor=false} +%-------------------------------------------------------------------------------------- +% The title page +%-------------------------------------------------------------------------------------- +\begin{titlepage} +\begin{center} +\includegraphics[width=60mm,keepaspectratio]{figures/bme_logo.pdf}\\ +\vspace{0.3cm} +\textbf{\bme}\\ +\textmd{\vik}\\ +\textmd{\viktanszek}\\[5cm] + +\vspace{0.4cm} +{\huge \bfseries \vikcim}\\[0.8cm] +\vspace{0.5cm} +\textsc{\Large \vikdoktipus}\\[4cm] + +{ + \renewcommand{\arraystretch}{0.85} + \begin{tabular}{cc} + \makebox[7cm]{\emph{\keszitette}} & \makebox[7cm]{\emph{\konzulens}} \\ \noalign{\smallskip} + \makebox[7cm]{\szerzo} & \makebox[7cm]{\vikkonzulensA} \\ + & \makebox[7cm]{\vikkonzulensB} \\ + & \makebox[7cm]{\vikkonzulensC} \\ + \end{tabular} +} + +\vfill +{\large \today} +\end{center} +\end{titlepage} +\hypersetup{pageanchor=false} + diff --git a/src/lua/language.dat.lua b/src/lua/language.dat.lua new file mode 100644 index 0000000..cd0d9e4 --- /dev/null +++ b/src/lua/language.dat.lua @@ -0,0 +1,731 @@ +-- Generated by ./install-tl on Sun Feb 12 19:17:26 2017 +-- $Id: language.us.lua 18737 2010-06-04 17:09:02Z karl $ +--[[ +language.us.dat (and the start of language.dat.lua), used by: +- a special luatex version of hyphen.cfg (derived from the babel system); +- a special luatex version of etex.src (from the e-TeX distributon). + +See luatex-hyphen.pdf (currently part of the hyph-utf8 package) for details. + +DO NOT EDIT THIS FILE (language.dat.lua)! It is generated by tlmgr. +See language.dat (or language.us) for more information. + +Warning: formats using this file also use one of language.dat or +language.def. Update them accordingly. The interaction between these +files is documented in luatex-hyphen.pdf, but here is a summary: +- a language must be mentioned in language.dat or language.def to be +available; if, in addition, it is: + - not mentioned in language.dat.lua, then it is dumped in the format; + - mentioned in language.dat.lua with a key special="disabled:", + then it is not available at all; + - mentioned in language.dat.lua with a normal entry, then it will not + be dumped in the format, but loaded at runtime when activated. +]] + +return { + ["english"]={ + loader="hyphen.tex", + special="language0", -- should be dumped in the format + lefthyphenmin=2, + righthyphenmin=3, + synonyms={"usenglish","USenglish","american"}, + }, + -- dumylang and zerohyph are dumped in the format, + -- since they contain either very few or no patterns at all +-- END of language.us.lua (missing '}' appended after all entries) +-- from dehyph-exptl: + ['german-x-2014-05-21'] = { + loader = 'dehypht-x-2014-05-21.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { 'german-x-latest' }, + patterns = 'hyph-de-1901.pat.txt', + hyphenation = 'hyph-de-1901.hyp.txt', + }, + ['ngerman-x-2014-05-21'] = { + loader = 'dehyphn-x-2014-05-21.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { 'ngerman-x-latest' }, + patterns = 'hyph-de-1996.pat.txt', + hyphenation = 'hyph-de-1996.hyp.txt', + }, +-- from hyphen-afrikaans: + ['afrikaans'] = { + loader = 'loadhyph-af.tex', + lefthyphenmin = 1, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-af.pat.txt', + hyphenation = 'hyph-af.hyp.txt', + }, +-- from hyphen-ancientgreek: + ['ancientgreek'] = { + loader = 'loadhyph-grc.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-grc.pat.txt', + hyphenation = '', + }, + ['ibycus'] = { + loader = 'ibyhyph.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + special = 'disabled:8-bit only', + }, +-- from hyphen-arabic: + ['arabic'] = { + loader = 'zerohyph.tex', + lefthyphenmin = 2, + righthyphenmin = 3, + synonyms = { }, + patterns = '', + }, +-- from hyphen-armenian: + ['armenian'] = { + loader = 'loadhyph-hy.tex', + lefthyphenmin = 1, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-hy.pat.txt', + hyphenation = '', + }, +-- from hyphen-basque: + ['basque'] = { + loader = 'loadhyph-eu.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-eu.pat.txt', + hyphenation = '', + }, +-- from hyphen-bulgarian: + ['bulgarian'] = { + loader = 'loadhyph-bg.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-bg.pat.txt', + hyphenation = '', + }, +-- from hyphen-catalan: + ['catalan'] = { + loader = 'loadhyph-ca.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-ca.pat.txt', + hyphenation = 'hyph-ca.hyp.txt', + }, +-- from hyphen-chinese: + ['pinyin'] = { + loader = 'loadhyph-zh-latn-pinyin.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-zh-latn-pinyin.pat.txt', + hyphenation = '', + }, +-- from hyphen-churchslavonic: + ['churchslavonic'] = { + loader = 'loadhyph-cu.tex', + lefthyphenmin = 1, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-cu.pat.txt', + hyphenation = 'hyph-cu.hyp.txt', + }, +-- from hyphen-coptic: + ['coptic'] = { + loader = 'loadhyph-cop.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-cop.pat.txt', + hyphenation = '', + }, +-- from hyphen-croatian: + ['croatian'] = { + loader = 'loadhyph-hr.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-hr.pat.txt', + hyphenation = '', + }, +-- from hyphen-czech: + ['czech'] = { + loader = 'loadhyph-cs.tex', + lefthyphenmin = 2, + righthyphenmin = 3, + synonyms = { }, + patterns = 'hyph-cs.pat.txt', + hyphenation = 'hyph-cs.hyp.txt', + }, +-- from hyphen-danish: + ['danish'] = { + loader = 'loadhyph-da.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-da.pat.txt', + hyphenation = '', + }, +-- from hyphen-dutch: + ['dutch'] = { + loader = 'loadhyph-nl.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-nl.pat.txt', + hyphenation = 'hyph-nl.hyp.txt', + }, +-- from hyphen-english: + ['ukenglish'] = { + loader = 'loadhyph-en-gb.tex', + lefthyphenmin = 2, + righthyphenmin = 3, + synonyms = { 'british', 'UKenglish' }, + patterns = 'hyph-en-gb.pat.txt', + hyphenation = 'hyph-en-gb.hyp.txt', + }, + ['usenglishmax'] = { + loader = 'loadhyph-en-us.tex', + lefthyphenmin = 2, + righthyphenmin = 3, + synonyms = { }, + patterns = 'hyph-en-us.pat.txt', + hyphenation = 'hyph-en-us.hyp.txt', + }, +-- from hyphen-esperanto: + ['esperanto'] = { + loader = 'loadhyph-eo.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-eo.pat.txt', + hyphenation = '', + }, +-- from hyphen-estonian: + ['estonian'] = { + loader = 'loadhyph-et.tex', + lefthyphenmin = 2, + righthyphenmin = 3, + synonyms = { }, + patterns = 'hyph-et.pat.txt', + hyphenation = '', + }, +-- from hyphen-ethiopic: + ['ethiopic'] = { + loader = 'loadhyph-mul-ethi.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { 'amharic', 'geez' }, + patterns = 'hyph-mul-ethi.pat.txt', + hyphenation = '', + }, +-- from hyphen-farsi: + ['farsi'] = { + loader = 'zerohyph.tex', + lefthyphenmin = 2, + righthyphenmin = 3, + synonyms = { 'persian' }, + patterns = '', + }, +-- from hyphen-finnish: + ['finnish'] = { + loader = 'loadhyph-fi.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-fi.pat.txt', + hyphenation = '', + }, +-- from hyphen-french: + ['french'] = { + loader = 'loadhyph-fr.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { 'patois', 'francais' }, + patterns = 'hyph-fr.pat.txt', + hyphenation = '', + }, +-- from hyphen-friulan: + ['friulan'] = { + loader = 'loadhyph-fur.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-fur.pat.txt', + hyphenation = '', + }, +-- from hyphen-galician: + ['galician'] = { + loader = 'loadhyph-gl.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-gl.pat.txt', + hyphenation = '', + }, +-- from hyphen-georgian: + ['georgian'] = { + loader = 'loadhyph-ka.tex', + lefthyphenmin = 1, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-ka.pat.txt', + hyphenation = '', + }, +-- from hyphen-german: + ['german'] = { + loader = 'loadhyph-de-1901.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-de-1901.pat.txt', + hyphenation = '', + }, + ['ngerman'] = { + loader = 'loadhyph-de-1996.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-de-1996.pat.txt', + hyphenation = '', + }, + ['swissgerman'] = { + loader = 'loadhyph-de-ch-1901.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-de-ch-1901.pat.txt', + hyphenation = '', + }, +-- from hyphen-greek: + ['monogreek'] = { + loader = 'loadhyph-el-monoton.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-el-monoton.pat.txt', + hyphenation = '', + }, + ['greek'] = { + loader = 'loadhyph-el-polyton.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { 'polygreek' }, + patterns = 'hyph-el-polyton.pat.txt', + hyphenation = '', + }, +-- from hyphen-hungarian: + ['hungarian'] = { + loader = 'loadhyph-hu.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { 'hungarian', 'magyar' }, + patterns = 'hyph-hu.pat.txt', + hyphenation = '', + }, +-- from hyphen-icelandic: + ['icelandic'] = { + loader = 'loadhyph-is.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-is.pat.txt', + hyphenation = '', + }, +-- from hyphen-indic: + ['assamese'] = { + loader = 'loadhyph-as.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-as.pat.txt', + hyphenation = '', + }, + ['bengali'] = { + loader = 'loadhyph-bn.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-bn.pat.txt', + hyphenation = '', + }, + ['gujarati'] = { + loader = 'loadhyph-gu.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-gu.pat.txt', + hyphenation = '', + }, + ['hindi'] = { + loader = 'loadhyph-hi.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-hi.pat.txt', + hyphenation = '', + }, + ['kannada'] = { + loader = 'loadhyph-kn.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-kn.pat.txt', + hyphenation = '', + }, + ['malayalam'] = { + loader = 'loadhyph-ml.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-ml.pat.txt', + hyphenation = '', + }, + ['marathi'] = { + loader = 'loadhyph-mr.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-mr.pat.txt', + hyphenation = '', + }, + ['oriya'] = { + loader = 'loadhyph-or.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-or.pat.txt', + hyphenation = '', + }, + ['panjabi'] = { + loader = 'loadhyph-pa.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-pa.pat.txt', + hyphenation = '', + }, + ['tamil'] = { + loader = 'loadhyph-ta.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-ta.pat.txt', + hyphenation = '', + }, + ['telugu'] = { + loader = 'loadhyph-te.tex', + lefthyphenmin = 1, + righthyphenmin = 1, + synonyms = { }, + patterns = 'hyph-te.pat.txt', + hyphenation = '', + }, +-- from hyphen-indonesian: + ['indonesian'] = { + loader = 'loadhyph-id.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-id.pat.txt', + hyphenation = 'hyph-id.hyp.txt', + }, +-- from hyphen-interlingua: + ['interlingua'] = { + loader = 'loadhyph-ia.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-ia.pat.txt', + hyphenation = 'hyph-ia.hyp.txt', + }, +-- from hyphen-irish: + ['irish'] = { + loader = 'loadhyph-ga.tex', + lefthyphenmin = 2, + righthyphenmin = 3, + synonyms = { }, + patterns = 'hyph-ga.pat.txt', + hyphenation = 'hyph-ga.hyp.txt', + }, +-- from hyphen-italian: + ['italian'] = { + loader = 'loadhyph-it.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-it.pat.txt', + hyphenation = '', + }, +-- from hyphen-kurmanji: + ['kurmanji'] = { + loader = 'loadhyph-kmr.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-kmr.pat.txt', + hyphenation = '', + }, +-- from hyphen-latin: + ['latin'] = { + loader = 'loadhyph-la.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-la.pat.txt', + hyphenation = '', + }, + ['classiclatin'] = { + loader = 'loadhyph-la-x-classic.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-la-x-classic.pat.txt', + hyphenation = '', + }, + ['liturgicallatin'] = { + loader = 'loadhyph-la-x-liturgic.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-la-x-liturgic.pat.txt', + hyphenation = '', + }, +-- from hyphen-latvian: + ['latvian'] = { + loader = 'loadhyph-lv.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-lv.pat.txt', + hyphenation = '', + }, +-- from hyphen-lithuanian: + ['lithuanian'] = { + loader = 'loadhyph-lt.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-lt.pat.txt', + hyphenation = '', + }, +-- from hyphen-mongolian: + ['mongolian'] = { + loader = 'loadhyph-mn-cyrl.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-mn-cyrl.pat.txt', + hyphenation = '', + }, + ['mongolianlmc'] = { + loader = 'loadhyph-mn-cyrl-x-lmc.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + special = 'disabled:only for 8bit montex with lmc encoding', + }, +-- from hyphen-norwegian: + ['bokmal'] = { + loader = 'loadhyph-nb.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { 'norwegian', 'norsk' }, + patterns = 'hyph-nb.pat.txt', + hyphenation = 'hyph-nb.hyp.txt', + }, + ['nynorsk'] = { + loader = 'loadhyph-nn.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-nn.pat.txt', + hyphenation = 'hyph-nn.hyp.txt', + }, +-- from hyphen-occitan: + ['occitan'] = { + loader = 'loadhyph-oc.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-oc.pat.txt', + hyphenation = '', + }, +-- from hyphen-piedmontese: + ['piedmontese'] = { + loader = 'loadhyph-pms.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-pms.pat.txt', + hyphenation = '', + }, +-- from hyphen-polish: + ['polish'] = { + loader = 'loadhyph-pl.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-pl.pat.txt', + hyphenation = 'hyph-pl.hyp.txt', + }, +-- from hyphen-portuguese: + ['portuguese'] = { + loader = 'loadhyph-pt.tex', + lefthyphenmin = 2, + righthyphenmin = 3, + synonyms = { 'portuges' }, + patterns = 'hyph-pt.pat.txt', + hyphenation = 'hyph-pt.hyp.txt', + }, +-- from hyphen-romanian: + ['romanian'] = { + loader = 'loadhyph-ro.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-ro.pat.txt', + hyphenation = '', + }, +-- from hyphen-romansh: + ['romansh'] = { + loader = 'loadhyph-rm.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-rm.pat.txt', + hyphenation = '', + }, +-- from hyphen-russian: + ['russian'] = { + loader = 'loadhyph-ru.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-ru.pat.txt', + hyphenation = 'hyph-ru.hyp.txt', + }, +-- from hyphen-sanskrit: + ['sanskrit'] = { + loader = 'loadhyph-sa.tex', + lefthyphenmin = 1, + righthyphenmin = 3, + synonyms = { }, + patterns = 'hyph-sa.pat.txt', + hyphenation = '', + }, +-- from hyphen-serbian: + ['serbian'] = { + loader = 'loadhyph-sr-latn.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-sh-latn.pat.txt,hyph-sh-cyrl.pat.txt', + hyphenation = 'hyph-sh-latn.hyp.txt,hyph-sh-cyrl.hyp.txt', + }, + ['serbianc'] = { + loader = 'loadhyph-sr-cyrl.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-sh-latn.pat.txt,hyph-sh-cyrl.pat.txt', + hyphenation = 'hyph-sh-latn.hyp.txt,hyph-sh-cyrl.hyp.txt', + }, +-- from hyphen-slovak: + ['slovak'] = { + loader = 'loadhyph-sk.tex', + lefthyphenmin = 2, + righthyphenmin = 3, + synonyms = { }, + patterns = 'hyph-sk.pat.txt', + hyphenation = 'hyph-sk.hyp.txt', + }, +-- from hyphen-slovenian: + ['slovenian'] = { + loader = 'loadhyph-sl.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { 'slovene' }, + patterns = 'hyph-sl.pat.txt', + hyphenation = '', + }, +-- from hyphen-spanish: + ['spanish'] = { + loader = 'loadhyph-es.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { 'espanol' }, + patterns = 'hyph-es.pat.txt', + hyphenation = '', + }, +-- from hyphen-swedish: + ['swedish'] = { + loader = 'loadhyph-sv.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-sv.pat.txt', + hyphenation = '', + }, +-- from hyphen-thai: + ['thai'] = { + loader = 'loadhyph-th.tex', + lefthyphenmin = 2, + righthyphenmin = 3, + synonyms = { }, + patterns = 'hyph-th.pat.txt', + hyphenation = '', + }, +-- from hyphen-turkish: + ['turkish'] = { + loader = 'loadhyph-tr.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-tr.pat.txt', + hyphenation = '', + }, +-- from hyphen-turkmen: + ['turkmen'] = { + loader = 'loadhyph-tk.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-tk.pat.txt', + hyphenation = '', + }, +-- from hyphen-ukrainian: + ['ukrainian'] = { + loader = 'loadhyph-uk.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-uk.pat.txt', + hyphenation = '', + }, +-- from hyphen-uppersorbian: + ['uppersorbian'] = { + loader = 'loadhyph-hsb.tex', + lefthyphenmin = 2, + righthyphenmin = 2, + synonyms = { }, + patterns = 'hyph-hsb.pat.txt', + hyphenation = 'hyph-hsb.hyp.txt', + }, +-- from hyphen-welsh: + ['welsh'] = { + loader = 'loadhyph-cy.tex', + lefthyphenmin = 2, + righthyphenmin = 3, + synonyms = { }, + patterns = 'hyph-cy.pat.txt', + hyphenation = '', + }, +} diff --git a/src/magyar.ldf b/src/magyar.ldf new file mode 100644 index 0000000..06c3961 --- /dev/null +++ b/src/magyar.ldf @@ -0,0 +1,5801 @@ +% +% magyar.ldf -- LaTeX Language Definition for `magyar' (Hungarian), v1.5c +% written and copyright (C) by P\'eter SZAB\'O +% (version 1.5 -- Early October 2003 -- February 2004 --) +% +% The newest version of this magyar.ldf is part of MagyarLaTeX, available from +% http://www.math.bme.hu/latex/ . The web page is in Hungarian language, but +% it is easy to figure out how to download the newest magyar.ldf. Please +% bookmark this link as the definitive source of the newest version. +% +% This program is free software. There is NO WARRANTY. Use at your own risk! +% You can choose any of these licenses: GNU GPL, LaTeX's license, +% Babel's license. +% +% When will magyar.ldf 1.5 be part of mainstream LaTeX / Babel? I have no +% idea, ask the maintainer of Babel. magyar.ldf 1.5 has ptebeen converted to +% magyar.dtx on June 27, 2004. That version has been submitted to the +% maintainer of the Babel package. No reply from him since then. +% +% Should magyar.ldf 1.5 be part of tetex, or should it be available as a +% supplementary package in TeX distributions? Yes, but this is the task of the +% creators of those distributions. The Debian package ``magyarlatex'', +% which supplements the teTeX shipped with Debian Woody, Sarge and Sid, +% is available from http://www.math.bme.hu/latex/dl +% (file magyarlatex-latest.deb). +% +% The author of magyar.ldf 1.5 has uploaded it to CTAN +% (http://www.ctan.org), but he doesn't re-upload regularly, because he +% doesn't have time to maintain it and re-upload it after each bugfix. If +% you think that magyar.ldf 1.5 should be on CTAN, feel free to upload a +% snapshot, since it is free software. +% +% magyar.ldf 1.5 is based on magyar.ldf 1.4. However, it has been totally +% rewritten and extended (just compare the file sizes), and it doesn't share +% code from the earlier versions anymore. However, its default configuration +% tries to be compatible with older versions. +% +% Earlier versions of file `magyar.dtx' Babel package for LaTeX version 2e +% Copyright (C) 1989--2004 by Johannes Braams, TeXniek +% Copyright (C) 1989--2004 by +% \'Arp\'ad B\'IR\'O +% J\'ozsef B\'ERCES (version 1.4c -- 2001; contains a lot of work of him) +% +% To typeset text in Hungarian, please +% +% 1. Include `magyar huhyph.tex' in language.dat, re-run initex(1) (initex +% 'latex.ini \dump') or pdfinitex(1), verify that running latex(1) displays +% the word `magyar' in the line containing `hyphenation patterns' in its +% console output. +% +% 2. In the document preamble, use +% +% \def\magyarOptions{defaults=hu-min} +% \usepackage[magyar]{babel} +% \usepackage{t1enc}% for automatic hyphenation of accented chars +% \usepackage[latin2]{inputenc}% for typing chars +% +% This file is quite long, because it implements a lot of parametric features +% related to typesetting Hungarian text with \LaTeX. Sorry. +% +% Motto: ``There is a lot to do in the future'' -- by Gyngyi Bujdos and +% Ferenc Wettl in their conference proceedings article ``On the localization +% of TeX in Hungary'', presented at EuroBachoTeX 2002. +% +% Most of the code and comments in this file are written by P\'eter Szab\'o. +% The newest version is available from http://www.math.bme.hu/latex/ +% +% The version of this file is 1.5, even when new releases come out. Please see +% the \expandafter\ProvidesLanguage line for the release date. +% + +\expandafter\ifx\csname CurrentOption\endcsname\relax + \def\CurrentOption{magyar}% +\fi +%** So `\input magyar.ldf' will work as well. +\expandafter\ifx\csname ver@babel.sty\endcsname\relax + \csname fi\endcsname + \endinput \expandafter\RequirePackage\expandafter[\CurrentOption]{babel} +\fi + +%\ProvidesFile{magyar.ldf}[1996/12/23 v1.3h Magyar support from the babel system] +%\ProvidesLanguage{magyar}[2001/03/05 v1.4c Magyar support from the babel system] +% vvv for Babel v3.7 +\expandafter\ProvidesLanguage\expandafter{\CurrentOption}[2015/11/24 v1.5c Magyar support from the babel v3.7 system] + +% Possibly do \endinput if .ldf already loaded +\expandafter\LdfInit\expandafter{\CurrentOption}{captions\CurrentOption}% + +% Fix \catcodes{} possibly screwed up by other Babel languages. +% Dat: \string`\string! could have been written as \string`! +\edef\@@magyar@restcats{% + \catcode\string`\string`\the\catcode\string``\space\space + \catcode\string`\string!\the\catcode\string`!\space\space + \catcode\string`\string*\the\catcode\string`*\space\space + \catcode\string`\string+\the\catcode\string`+\space\space + \catcode\string`\string-\the\catcode\string`-\space\space + \catcode\string`\string=\the\catcode\string`=\space\space + \catcode\string`\string|\the\catcode\string`|\space\space + \catcode\string`\string;\the\catcode\string`;\space\space + \catcode\string`\string:\the\catcode\string`:\space\space + \catcode\string`\string'\the\catcode\string`'\space\space + \catcode\string`\string"\the\catcode\string`"\space\space + \catcode\string`\string?\the\catcode\string`?\space\space + \catcode\string`\string/\the\catcode\string`/\space\space + \let\noexpand\@@magyar@restcats\noexpand\@undefined +} +\catcode\string``12 \catcode`!12 \catcode`*12 \catcode`+12 \catcode`-12 +\catcode`=12 \catcode`|12 \catcode`;12 \catcode`:12 \catcode`'12 \catcode`"12 +\catcode`?12 \catcode`/12 + +%** Expand \CurrentOption early. +\edef\@@magyar@error#1{\noexpand\PackageError{\CurrentOption.ldf}{#1}\noexpand\@ehc} + +% --- Declare options. +% +% Dat: \languageattribute{magyar}{...} and \bbl@declare@ttribute{magyar}{foo}{...} +% isn't enough for us, because it is processed +% after \usepackage[magyar]{babel}, but we need the options information +% earlier. And also it cannot contain `='. +% + +%** `\dMf foo-bar {...}' is `\def\foo-bar{...}' where `-' is a letter +\def\dMf#1 {\expandafter\def\csname#1\endcsname} +\def\magyar@@unchanged{unchanged} +\def\magyar@enumarg#1#2{% + \expandafter\ifx\csname magyar@opt@#1@@#2\endcsname\relax + \@@magyar@error{Invalid arg for option: #1 = #2}% + \else + \csname magyar@opt@#1@@#2\endcsname + \fi +} +\def\@@magyar@argw@no {0}% +\def\@@magyar@argw@weak{1}% +\def\@@magyar@argw@yes {2}% +\def\magyar@yesweaknoarg#1#2{% + \expandafter\ifx\csname @@magyar@argw@#2\endcsname\relax + \@@magyar@error{Invalid arg for option: #1 = #2\MessageBreak Must be =no, =yes or =weak}% + \else + \expandafter\edef\csname magyar@opt@@#1\endcsname{\csname @@magyar@argw@#2\endcsname}% + \fi +} + +% Declare defaults. + +%** These defaults load most of the new functionality, but try not to +%** introduce visible typographical changes over magyar.ldf v1.4. These +%** are the ovarall defaults of magyar.ldf v1.5, in case of +%** \def\magyarOptions{} (or if is missing). +%** +%** These are the defaults: (over-1.4) +%** \def\magyarOptions{ +%** accents=defaulthigh, % or =high or =low +%** active=safe, % or =problematic or =none or =onlycs +%** activeprefix=babelopt2, % or =none or =babelopt3 or =grave or =acute or =quotedbl +%** activespace=none, % or =safe or =problematic +%** afterindent=unchanged, % or =force-no or =force-yes +%** amslevelfix=fix-ams, % or =unchanged or =fix-all +%** amsuppercasefix=fix-ams, % or =unchanged or =fix-all +%** amstocnumskip=\enskip, % TeX code or --empty-- +%** amstocnumlang=all, % or =hu +%** amspostsectiondot=no, % or =unchanged +%** appendixdot=yes, % or =no % !! dokumentlni +%** az=weak, % or =yes or =no +%** babelmarkfix=yes, % or =unchanged +%** captionfix=yes, % or =unchanged +%** captions=hu, % or =unchanged +%** chapterhead=yes, % or =unchanged(=no) +%** chapternumber=unchanged, % see partnumber= +%** cjhebrewfix=yes, % or =unchanged or =onlyouter +%** classmod=yes, % or =unchanged(=no) or TeX class name +%** %defaults=over-1.4, % or =compat-1.4 or =safest or =prettiest +%** dottedtocline=fix, % or =unchanged +%** emitdate=weak, % or =no or =yes +%** extras=yes, % or =no +%** fancyhdr=hu, % or =unchanged +%** figurecaptions=hu, % or =us or =unchanged +%** frenchspacing=unchanged, % or =no or =yes +%** hang=weak, % or =no or =yes +%** hunnewlabel=yes, % or =no or =only-hu +%** hunumbers=yes, % or =no +%** hutoday=yes, % or =no +%** hyphenmins=22, % or =unchanged or two chars: \lefthyphenmin\righthyphenmin +%** hyphenation=huhyph3, % or =none or =composite or =phonetic or =huhyphn +%** hynumberline=unchanged, % or =hu +%** labelenums=unchanged, % or =hu-a or =hu-A or =hu-d +%** labelitems=unchanged, % or =hu +%** longcaption=justified, % or =centered or =centernewline or =none (=unchanged) +%** mathbrk=define, % or =unchanged or =fix +%** mathhucomma=define, % or =unchanged or =fix +%** mathfactorial=define, % or =unchanged or =fix +%** mathmuskips=unchanged, % or =latex or =hu +%** mathreal=weak, % or =no or =yes +%** mond=weak, % or =no or =yes +%** ntheoremfix=yes, % or =unchanged +%** openqq=maybedown, % or =up or =down or =unchanged +%** partnumber=unchanged, % or =huordinal or =Huordinal +%** postdescription=unchanged, % see postpara= +%** postpara=unchanged, % or =bfdot or =dot or =quad or =diamond or =enskip or =quad or =em or =empty ... (\magyar@post@...) +%** postsubpara=unchanged, % see postpara= +%** refstruc=weak, % or =no or =yes +%** %safest=no, % or =yes (safest=no has no effect, safest=yes is equivalent to defaults=safest) +%** sectiondot=safe, % or =none or =problematic +%** shorthandcs=\shu, % or =none or a csname or a \cs, e.g shorthandcs=\shu +%** shortrefcmds=yes, % or =no +%** showfix=yes, % or =unchanged +%** suggestions=yes, % or =no +%** tablecaptions=hu, % or =us or =unchanged +%** textqq=weak, % or =no or =yes +%** theoremtitle=hu, % or =unchanged +%** footnote=yes, % or =unchanged or =huplain or =starplain +%** titles=\enskip, % TeX code: =unchanged, =\quad or other +%** toclang=good, % or =badfloat or =badall or =unchanged +%** told=weak, % or =no or =yes +%** varioref=hu, % or =unchanged +%** }\usepackage[magyar]{babel} +\dMf magyar@opt@defaults@@over-1.4 {% + \magyar@opt@accents@@defaulthigh + \magyar@opt@active@@safe + \magyar@opt@activeprefix{activeprefix}{babelopt2}% + \magyar@opt@activespace@@none + \magyar@opt@afterindent@@unchanged + \magyar@opt@amslevelfix{amslevelfix}{fix-ams}% + \magyar@opt@amsuppercasefix{amsuppercasefix}{fix-ams}% + \magyar@opt@amspostsectiondot@@no% change over 1.4 + \magyar@opt@amstocnumlang@@all + \magyar@opt@amstocnumskip{amstocnumskip}{\enskip}% change over 1.4 + \magyar@opt@appendixdot@@yes + \magyar@opt@babelmarkfix@@yes + \magyar@opt@az{az}{weak}% + \magyar@opt@captionfix@@yes + \magyar@opt@captions@@hu + \magyar@opt@chapternumber@@unchanged + \magyar@opt@classmod@@yes + \magyar@opt@dottedtocline@@fix + \magyar@opt@emitdate{emitdate}{weak}% + \magyar@opt@extras@@yes + \magyar@opt@chapterhead@@yes + \magyar@opt@fancyhdr@@hu% change over 1.4 + \magyar@opt@figurecaptions@@hu + \magyar@opt@footnote@@yes + \magyar@opt@frenchspacing@@unchanged + \magyar@opt@hang{hang}{weak}% + \magyar@opt@hunnewlabel@@yes + \magyar@opt@hunumbers@@yes + \magyar@opt@hutoday@@yes + \magyar@opt@hyphenation{hyphenation}{huhyph3-or-any}% + \magyar@opt@hyphenmins{hyphenmins}{22}% change over 1.4 Dat: Default LaTeX is {23} + \magyar@opt@labelenums@@unchanged + \magyar@opt@labelitems@@unchanged + \magyar@opt@longcaption@@justified + \magyar@opt@mathbrk@@define + \magyar@opt@mathfactorial@@define + \magyar@opt@mathhucomma@@define + \magyar@opt@mathmuskips@@unchanged + \magyar@opt@hynumberline@@unchanged + \magyar@opt@mathreal{mathreal}{weak}% + \magyar@opt@mond{mond}{weak}% + \magyar@opt@ntheoremfix@@yes + \magyar@opt@openqq@@maybedown + \magyar@opt@partnumber@@unchanged + \magyar@opt@postpara{}{unchanged}% + \magyar@opt@postsubpara{}{unchanged}% + \magyar@opt@refstruc{refstruc}{weak}% + \magyar@opt@sectiondot@@safe + \magyar@opt@shorthandcs{shorthandcs}{\shu}% + \magyar@opt@shortrefcmds@@yes + \magyar@opt@showfix@@yes + \magyar@opt@suggestions@@yes + \magyar@opt@tablecaptions@@hu + \magyar@opt@textqq{textqq}{weak}% + \magyar@opt@theoremtitle@@hu + \magyar@opt@titles{}{\enskip}% change over 1.4 + \magyar@opt@toclang@@good + \magyar@opt@told{told}{weak}% + \magyar@opt@varioref@@hu + \magyar@opt@cjhebrewfix@@yes +} + +%** These defaults try to be compatible with magyar.ldf v1.4 as much as +%** possible -- but avoids stupid, problematic, dangerous implementation +%** mistakes that would make magyar.ldf incompatible with many LaTeX +%** packages. The purpose of compat-1.4 is to make the document compilable: +%** if a fix would produce better results, but documents are compilable +%** without the fix, the fix will not be applied in compat-1.4. +%** Some very useful fixes are not applied here -- please use +%** defaults=over-1.4 to have them. Also some very nice features such +%** as \emitdate and \told are not available here. +\dMf magyar@opt@defaults@@compat-1.4 {% + \magyar@opt@accents@@defaulthigh% OK + \magyar@opt@active@@safe% we don't want =problematic + \magyar@opt@activeprefix@@grave% OK + \magyar@opt@activespace@@none% OK + \magyar@opt@afterindent@@unchanged% OK + \magyar@opt@amslevelfix@@unchanged% OK + \magyar@opt@amsuppercasefix@@unchanged% OK + \magyar@opt@amspostsectiondot@@unchanged% OK + \magyar@opt@amstocnumlang@@all% OK, irrelevant + \magyar@opt@amstocnumskip{amstocnumskip}{}% OK + \magyar@opt@appendixdot@@yes + \magyar@opt@babelmarkfix@@unchanged + \magyar@opt@az{az}{yes}% OK + \magyar@opt@captionfix@@unchanged + \magyar@opt@captions@@hu% OK + \magyar@opt@chapterhead@@yes% OK + \magyar@opt@chapternumber@@unchanged% OK + \magyar@opt@classmod@@yes% OK + \magyar@opt@dottedtocline@@unchanged% OK + \magyar@opt@emitdate{emitdate}{no}% OK + \magyar@opt@extras@@yes% OK + \magyar@opt@fancyhdr@@unchanged% OK + \magyar@opt@figurecaptions@@hu% OK + \magyar@opt@footnote@@unchanged% OK + \magyar@opt@frenchspacing@@unchanged% OK + \magyar@opt@hang{hang}{no}% OK + \magyar@opt@hunnewlabel@@yes% OK + \magyar@opt@hunumbers@@no% OK + \magyar@opt@hutoday@@yes% OK + \magyar@opt@hyphenation{hyphenation}{huhyph3-or-any}% OK + \magyar@opt@hyphenmins{hyphenmins}{unchanged}% + \magyar@opt@labelenums@@unchanged% OK + \magyar@opt@labelitems@@unchanged% OK + \magyar@opt@longcaption@@justified% OK + \magyar@opt@mathbrk@@unchanged% OK + \magyar@opt@mathhucomma@@unchanged% OK + \magyar@opt@mathfactorial@@unchanged% OK + \magyar@opt@mathmuskips@@unchanged% OK + \magyar@opt@hynumberline@@unchanged% OK + \magyar@opt@mathreal{mathreal}{no}% + \magyar@opt@mond{mond}{no}% OK + \magyar@opt@ntheoremfix@@yes% OK + \magyar@opt@openqq@@maybedown% OK + \magyar@opt@partnumber@@unchanged% OK + \magyar@opt@postpara{}{unchanged}% OK + \magyar@opt@postsubpara{}{unchanged}% OK + \magyar@opt@refstruc{refstruc}{no}% OK + \magyar@opt@sectiondot@@safe% we don't want =problematic + \magyar@opt@shorthandcs{shorthandcs}{none}% OK + \magyar@opt@shortrefcmds@@yes% OK + \magyar@opt@showfix@@yes% OK + \magyar@opt@suggestions@@no% OK -- user has explicity requested defaults=compat-1.4 + \magyar@opt@tablecaptions@@hu% OK + \magyar@opt@textqq{textqq}{no}% OK + \magyar@opt@theoremtitle@@hu% OK + \magyar@opt@titles{}{\quad}% OK -- ugly, but compatible + \magyar@opt@toclang@@good% we don't want weird errors and mischosen languages (would be =badall) + \magyar@opt@told{told}{no}% OK + \magyar@opt@varioref@@hu% was =unchanged, but varioref.sty (2000) is buggy + \magyar@opt@cjhebrewfix@@yes +} + +%** These defaults turn of most features -- the effect is similar to as if +%** magyar.ldf hasn't been loaded at all. Useful for debugging purposes. +\def\magyar@opt@defaults@@safest{% + \magyar@opt@accents@@defaulthigh + \magyar@opt@active@@none + \magyar@opt@activeprefix@@none + \magyar@opt@activespace@@none + \magyar@opt@afterindent@@unchanged + \magyar@opt@amslevelfix@@unchanged + \magyar@opt@amsuppercasefix{amsuppercasefix}{fix-ams}% + \magyar@opt@amspostsectiondot@@unchanged + \magyar@opt@amstocnumlang@@all% OK, irrelevant + \magyar@opt@amstocnumskip{amstocnumskip}{}% + \magyar@opt@appendixdot@@yes + \magyar@opt@az{az}{no}% + \magyar@opt@babelmarkfix@@yes + \magyar@opt@captionfix@@yes + \magyar@opt@captions@@unchanged + \magyar@opt@chapternumber@@unchanged + \magyar@opt@classmod@@unchanged + \magyar@opt@dottedtocline@@unchanged + \magyar@opt@emitdate{emitdate}{no}% + \magyar@opt@extras@@no + \magyar@opt@chapterhead@@no + \magyar@opt@fancyhdr@@unchanged + \magyar@opt@figurecaptions@@unchanged + \magyar@opt@footnote@@unchanged + \magyar@opt@frenchspacing@@unchanged + \magyar@opt@hang{hang}{no}% + \magyar@opt@hunnewlabel@@no + \magyar@opt@hunumbers@@no + \magyar@opt@hutoday@@no + \magyar@opt@hyphenation{hyphenation}{huhyph3-or-any}% + \magyar@opt@hyphenmins{hyphenmins}{unchanged}% + \magyar@opt@labelenums@@unchanged + \magyar@opt@labelitems@@unchanged + \magyar@opt@longcaption@@unchanged + \magyar@opt@mathbrk@@unchanged + \magyar@opt@mathhucomma@@unchanged + \magyar@opt@mathfactorial@@unchanged + \magyar@opt@mathmuskips@@unchanged + \magyar@opt@hynumberline@@unchanged + \magyar@opt@mathreal{mathreal}{no}% + \magyar@opt@mond{mond}{no}% + \magyar@opt@ntheoremfix@@unchanged + \magyar@opt@openqq@@unchanged + \magyar@opt@partnumber@@unchanged + \magyar@opt@postpara{}{unchanged}% + \magyar@opt@postsubpara{}{unchanged}% + \magyar@opt@refstruc{refstruc}{no}% + \magyar@opt@sectiondot@@none + \magyar@opt@shorthandcs{shorthandcs}{none}% + \magyar@opt@shortrefcmds@@no + \magyar@opt@showfix@@unchanged + \magyar@opt@suggestions@@yes + \magyar@opt@tablecaptions@@unchanged + \magyar@opt@textqq{textqq}{no}% + \magyar@opt@theoremtitle@@unchanged + \magyar@opt@titles{}{unchanged}% + \magyar@opt@toclang@@unchanged + \magyar@opt@told{told}{no}% + \magyar@opt@varioref@@unchanged + \magyar@opt@cjhebrewfix@@unchanged +} + +%** These defaults load almost all features, and try to do their best to make +%** the document comply to the Hungarian typography standards. Full compliance +%** is not achieved yet, and as new features are implemented, they will be +%** added to these defaults. +\def\magyar@opt@defaults@@prettiest{% + \magyar@opt@accents@@defaulthigh% {low} would have no effect with \usepackage{t1enc} + \magyar@opt@active@@safe + \magyar@opt@activeprefix{activeprefix}{babelopt2}% + \magyar@opt@activespace@@safe + \magyar@opt@afterindent@@unchanged% keep =force-no + \magyar@opt@amslevelfix{amslevelfix}{fix-ams}% + \magyar@opt@amsuppercasefix{amsuppercasefix}{fix-ams}% + \magyar@opt@amspostsectiondot@@no + \magyar@opt@amstocnumlang@@all + \magyar@opt@amstocnumskip{amstocnumskip}{\enskip}% + \magyar@opt@appendixdot@@no + \magyar@opt@az{az}{yes}% + \magyar@opt@babelmarkfix@@yes + \magyar@opt@captionfix@@yes + \magyar@opt@captions@@hu + \magyar@opt@chapternumber@@unchanged + \magyar@opt@classmod@@yes + \magyar@opt@dottedtocline@@fix + \magyar@opt@emitdate{emitdate}{yes}% + \magyar@opt@extras@@yes + \magyar@opt@chapterhead@@yes + \magyar@opt@fancyhdr@@hu + \magyar@opt@figurecaptions@@hu + \magyar@opt@footnote@@yes + \magyar@opt@frenchspacing@@yes + \magyar@opt@hang{hang}{yes}% + \magyar@opt@hunnewlabel@@yes + \magyar@opt@hunumbers@@yes + \magyar@opt@hutoday@@yes + \magyar@opt@hyphenation{hyphenation}{composite-or-any}% + \magyar@opt@hyphenmins{hyphenmins}{22}% Dat: Default LaTeX is {23} + \magyar@opt@labelenums{labelenums}{hu-a}% + \magyar@opt@labelitems@@hu + \magyar@opt@longcaption@@centered + \magyar@opt@mathbrk@@fix + \magyar@opt@mathhucomma@@fix + \magyar@opt@mathfactorial@@fix + \magyar@opt@mathmuskips@@hu + \magyar@opt@hynumberline@@hu + \magyar@opt@mathreal{mathreal}{yes}% + \magyar@opt@mond{mond}{yes}% + \magyar@opt@ntheoremfix@@yes + \magyar@opt@openqq@@maybedown + \magyar@opt@partnumber@@Huordinal + \magyar@opt@postdescription{}{dot}% + \magyar@opt@postpara{}{diamond}% + \magyar@opt@postsubpara{}{star}% + \magyar@opt@refstruc{refstruc}{yes}% + \magyar@opt@sectiondot@@safe + \magyar@opt@shorthandcs{shorthandcs}{\shu}% + \magyar@opt@shortrefcmds@@no + \magyar@opt@showfix@@yes + \magyar@opt@suggestions@@yes + \magyar@opt@tablecaptions@@hu + \magyar@opt@textqq{textqq}{yes}% + \magyar@opt@theoremtitle@@hu + \magyar@opt@titles{}{\enskip}% + \magyar@opt@toclang@@good + \magyar@opt@told{told}{yes}% + \magyar@opt@varioref@@hu + \magyar@opt@cjhebrewfix@@yes +} + +%** Expands to the \magyarOptions changes defaults=hu-min makes over +%** defaults=safest. +\def\magyar@@humin@options{% + active=safe, + activeprefix=babelopt2, + activespace=safe, + amslevelfix=fix-ams, + amspostsectiondot=no, + amstocnumlang=all, + amstocnumskip=\enskip, + appendixdot=no, + az=weak, + captions=hu, + chapterhead=yes, + cjhebrewfix=yes, + classmod=yes, + classmod=yes, + dottedtocline=fix, + emitdate=weak, + extras=yes, + fancyhdr=hu, + figurecaptions=hu, + footnote=huplain, + frenchspacing=yes, + hang=weak, + hunnewlabel=yes, + hunumbers=yes, + hutoday=yes, + hynumberline=hu, + hyphenmins=22, + labelenums=hu-d, + labelitems=hu, + longcaption=centered, + mathbrk=define, + mathbrk=fix, + mathfactorial=define, + mathhucomma=fix, + mathreal=weak, + mond=weak, + ntheoremfix=yes, + openqq=maybedown, + postdescription=dot, + postpara=diamond, + postsubpara=star, + refstruc=weak, + sectiondot=safe, + shorthandcs=\shu, + shortrefcmds=yes, + showfix=yes, + tablecaptions=hu, + textqq=weak, + theoremtitle=hu, + titles=\enskip, + toclang=good, + told=weak, + varioref=hu, +} + +%** Matches Hungarian typographic rules most closely -- and most +%** simplistically (minimally). +\dMf magyar@opt@defaults@@hu-min {% + %\csname magyar@opt@defaults@@over-1.4\endcsname + \csname magyar@opt@defaults@@safest\endcsname + % Dat: no openqq=unchanged (!) + \expandafter\magyar@doopt\magyar@@humin@options\hfuzz,% +} + +\def\magyarDumpHuMin{% + \begingroup + \typeout{} + \typeout{\expandafter\@gobble\string\% for defaults=hu-min}% + \typeout{\string\def\string\magyarOptions\expandafter\@gobble\string\{}% + \typeout{ \space defaults=safest,}% + \typeout{ \space\expandafter\@gobble\string\%}% + \def\magyar@applyopt##1##2{% + \def\reserved@a{##1=##2,}% + \typeout{ \space\expandafter\strip@prefix\meaning\reserved@a}% + }% + \expandafter\magyar@doopt\magyar@@humin@options\hfuzz,% + \typeout{\expandafter\@gobble\string\}}% + \typeout{\string\usepackage[magyar]{babel}}% + \typeout{}% + \endgroup +} + +\let\magyar@opt@defaults\magyar@enumarg +\def\magyar@opt@safest@@yes{\magyar@opt@defaults@@safest} +\def\magyar@opt@safest@@no{} +\let\magyar@opt@safest\magyar@enumarg + +% Declare normal options. + +\def\magyar@opt@titles#1#2{\def\magyar@opt@@titleskip{#2}} +\def\@@magyar@twodigitcheck#1#2#3\hfuzz#4#5{% + \csname if\ifnum0<0\string#1 \ifnum0<0\string#2 false\else true\fi\else true\fi\endcsname + \@@magyar@error{Option #4 needs [1-9][1-9], got #1#2}% + \fi +} +\def\magyar@opt@hyphenmins#1#2{% + \def\reserved@a{#2}% + \ifx\reserved@a\magyar@@unchanged + \let\magyar@opt@@hyphenmins\@empty + \else + \@@magyar@twodigitcheck#2..\hfuzz{#1}{#2}% + \def\magyar@opt@@hyphenmins{#2}% + \fi +} + +\def\magyar@opt@amstocnumskip#1#2{\def\magyar@opt@@amstocnumskip{#2}} +\def\magyar@opt@amstocnumlang@@all{\def\magyar@opt@@amstocnumlang{2}} +\def\magyar@opt@amstocnumlang@@hu {\def\magyar@opt@@amstocnumlang{1}} +\let\magyar@opt@amstocnumlang\magyar@enumarg +\def\magyar@opt@active@@none{\def\magyar@opt@@active{0}} +\def\magyar@opt@active@@onlycs{\def\magyar@opt@@active{1}} +\def\magyar@opt@active@@safe{\def\magyar@opt@@active{2}} +\def\magyar@opt@active@@problematic{\def\magyar@opt@@active{3}} +\let\magyar@opt@active\magyar@enumarg +\def\magyar@opt@activeprefix@@none {\let\magyar@opt@@activeprefix\relax} +\def\magyar@opt@activeprefix@@acute {\def\magyar@opt@@activeprefix{'}} +\def\magyar@opt@activeprefix@@grave {\def\magyar@opt@@activeprefix{`}} +\def\magyar@opt@activeprefix@@quotedbl{\def\magyar@opt@@activeprefix{"}} +\dMf magyar@opt@activeprefix@@babelopt2 {% + \@ifpackagewith{babel}{activeacute}% Dat: not expandable + {\def\magyar@opt@@activeprefix{'}}% + {\def\magyar@opt@@activeprefix{`}}% +} +\dMf magyar@opt@activeprefix@@babelopt3 {% + \@ifpackagewith{babel}{activeacute}% + {\def\magyar@opt@@activeprefix{'}}% + {\@ifpackagewith{babel}{activegrave}% + {\def\magyar@opt@@activeprefix{`}}% + {\def\magyar@opt@@activeprefix{"}}}% +} +\let\magyar@opt@activeprefix\magyar@enumarg +\def\magyar@opt@activespace@@none{\def\magyar@opt@@activespace{0}} +\def\magyar@opt@activespace@@safe{\def\magyar@opt@@activespace{2}} +\def\magyar@opt@activespace@@problematic{\def\magyar@opt@@activespace{3}} +\let\magyar@opt@activespace\magyar@enumarg +\def\magyar@opt@amspostsectiondot@@no {\def\magyar@opt@@amspostsectiondot{1}} +\def\magyar@opt@amspostsectiondot@@unchanged{\def\magyar@opt@@amspostsectiondot{0}} +\let\magyar@opt@amspostsectiondot\magyar@enumarg +\let\magyar@opt@hyphenation\magyar@enumarg +\def\magyar@opt@hyphenation@@huhyphf {\magyar@opt@hyphenation@@phonetic} +\def\magyar@opt@hyphenation@@huhyphc {\magyar@opt@hyphenation@@composite} +\expandafter\ifx\csname @OFWO\endcsname\relax +% Imp: fix --:hyphenation= reporting above +\def\magyar@opt@hyphenation@@none {\def\magyar@opt@@hyphenation{}} +\dMf magyar@opt@hyphenation@@huhyph3 {\def\magyar@opt@@hyphenation{3rN}} +\dMf magyar@opt@hyphenation@@huhyph3-or-any {\def\magyar@opt@@hyphenation{3CmhwN}} +\def\magyar@opt@hyphenation@@huhyphn {\def\magyar@opt@@hyphenation{nrN}} +\def\magyar@opt@hyphenation@@composite {\def\magyar@opt@@hyphenation{crN}} +\dMf magyar@opt@hyphenation@@composite-or-any {\def\magyar@opt@@hyphenation{cCmhwN}} +\def\magyar@opt@hyphenation@@any {\def\magyar@opt@@hyphenation{CmhwN}} +\def\magyar@opt@hyphenation@@phonetic {\def\magyar@opt@@hyphenation{frN}} +\else% report to lafmtgen.pl + \typeout{--:hyphenation-=\CurrentOption} + \def\magyar@opt@@hyphenation{}% + \def\magyar@opt@hyphenation@@none {\def\magyar@opt@@hypr{}} + \dMf magyar@opt@hyphenation@@huhyph3 {\def\magyar@opt@@hypr{\typeout{--:hyphenation=magyar3}\typeout{--:hyphenation=magyar}}} % install both for safety + \def\magyar@opt@hyphenation@@huhyphn {\def\magyar@opt@@hypr{\typeout{--:hyphenation=magyarn}\typeout{--:hyphenation=magyar}}} + \def\magyar@opt@hyphenation@@composite{\def\magyar@opt@@hypr{\typeout{--:hyphenation=magyarc}\typeout{--:hyphenation=magyar}}} + \def\magyar@opt@hyphenation@@phonetic {\def\magyar@opt@@hypr{\typeout{--:hyphenation=magyarf}}} +\fi +\def\magyar@opt@sectiondot@@none{\def\magyar@opt@@sectiondot{0}} +\def\magyar@opt@sectiondot@@safe{\def\magyar@opt@@sectiondot{1}} +\def\magyar@opt@sectiondot@@problematic{\def\magyar@opt@@sectiondot{2}} +\let\magyar@opt@sectiondot\magyar@enumarg +\def\magyar@opt@captions@@unchanged{\def\magyar@opt@@captions{0}} +\def\magyar@opt@captions@@hu{\def\magyar@opt@@captions{1}} +\let\magyar@opt@captions\magyar@enumarg +\def\magyar@opt@varioref@@unchanged{\def\magyar@opt@@varioref{0}} +\def\magyar@opt@varioref@@hu{\def\magyar@opt@@varioref{1}} +\let\magyar@opt@varioref\magyar@enumarg +\def\magyar@opt@cjhebrewfix@@unchanged{\def\magyar@opt@@cjhebrewfix{0}} +\def\magyar@opt@cjhebrewfix@@onlyouter{\def\magyar@opt@@cjhebrewfix{1}} +\def\magyar@opt@cjhebrewfix@@yes{\def\magyar@opt@@cjhebrewfix{2}} +\let\magyar@opt@cjhebrewfix\magyar@enumarg +\def\magyar@opt@fancyhdr@@unchanged{\def\magyar@opt@@fancyhdr{0}} +\def\magyar@opt@fancyhdr@@hu{\def\magyar@opt@@fancyhdr{1}} +\let\magyar@opt@fancyhdr\magyar@enumarg +\def\magyar@opt@ntheoremfix@@unchanged{\def\magyar@opt@@ntheoremfix{0}} +\def\magyar@opt@ntheoremfix@@yes{\def\magyar@opt@@ntheoremfix{1}} +\let\magyar@opt@ntheoremfix\magyar@enumarg +\def\magyar@opt@figurecaptions@@unchanged{\def\magyar@opt@@figurecaptions{0}} +\def\magyar@opt@figurecaptions@@hu{\def\magyar@opt@@figurecaptions{1}} +\def\magyar@opt@figurecaptions@@us{\def\magyar@opt@@figurecaptions{2}} +\let\magyar@opt@figurecaptions\magyar@enumarg +\def\magyar@opt@tablecaptions@@unchanged{\def\magyar@opt@@tablecaptions{0}} +\def\magyar@opt@tablecaptions@@hu{\def\magyar@opt@@tablecaptions{1}} +\def\magyar@opt@tablecaptions@@us{\def\magyar@opt@@tablecaptions{2}} +\let\magyar@opt@tablecaptions\magyar@enumarg +\def\magyar@opt@toclang@@unchanged{\def\magyar@opt@@toclang{0}}% same as =badall +\def\magyar@opt@toclang@@badall{\def\magyar@opt@@toclang{0}} +\def\magyar@opt@toclang@@badfloat{\def\magyar@opt@@toclang{1}} +\def\magyar@opt@toclang@@good{\def\magyar@opt@@toclang{2}} +\let\magyar@opt@toclang\magyar@enumarg +\def\magyar@opt@mathbrk@@unchanged{\def\magyar@opt@@mathbrk{0}} +\def\magyar@opt@mathbrk@@define{\def\magyar@opt@@mathbrk{1}} +\def\magyar@opt@mathbrk@@fix{\def\magyar@opt@@mathbrk{2}} +\let\magyar@opt@mathbrk\magyar@enumarg +\def\magyar@opt@mathfactorial@@unchanged{\def\magyar@opt@@mathfactorial{0}} +\def\magyar@opt@mathfactorial@@define{\def\magyar@opt@@mathfactorial{1}} +\def\magyar@opt@mathfactorial@@fix{\def\magyar@opt@@mathfactorial{2}} +\let\magyar@opt@mathfactorial\magyar@enumarg +\def\magyar@opt@mathhucomma@@unchanged{\def\magyar@opt@@mathhucomma{0}} +\def\magyar@opt@mathhucomma@@define{\def\magyar@opt@@mathhucomma{1}} +\def\magyar@opt@mathhucomma@@fix{\def\magyar@opt@@mathhucomma{2}} +\let\magyar@opt@mathhucomma\magyar@enumarg +\def\magyar@opt@mathmuskips@@unchanged{\def\magyar@opt@@mathmuskips{0}} +\def\magyar@opt@mathmuskips@@latex{\def\magyar@opt@@mathmuskips{1}} +\def\magyar@opt@mathmuskips@@hu{\def\magyar@opt@@mathmuskips{2}} +\let\magyar@opt@mathmuskips\magyar@enumarg +\def\magyar@opt@hynumberline@@unchanged{\def\magyar@opt@@hynumberline{0}} +\def\magyar@opt@hynumberline@@latex{\def\magyar@opt@@hynumberline{1}} +\def\magyar@opt@hynumberline@@hu{\def\magyar@opt@@hynumberline{2}} +\let\magyar@opt@hynumberline\magyar@enumarg +\def\magyar@opt@hunnewlabel@@no {\def\magyar@opt@@hunnewlabel{0}} +\dMf magyar@opt@hunnewlabel@@only-hu {\def\magyar@opt@@hunnewlabel{1}} +\def\magyar@opt@hunnewlabel@@yes{\def\magyar@opt@@hunnewlabel{2}} +\let\magyar@opt@hunnewlabel\magyar@enumarg +\def\magyar@opt@partnumber@@unchanged{\def\magyar@opt@@partnumber{0}} +\def\magyar@opt@partnumber@@huordinal{\def\magyar@opt@@partnumber{1}} +\def\magyar@opt@partnumber@@Huordinal{\def\magyar@opt@@partnumber{2}} +\let\magyar@opt@partnumber\magyar@enumarg +\def\magyar@opt@chapternumber@@unchanged{\def\magyar@opt@@chapternumber{0}} +\def\magyar@opt@chapternumber@@huordinal{\def\magyar@opt@@chapternumber{1}} +\def\magyar@opt@chapternumber@@Huordinal{\def\magyar@opt@@chapternumber{2}} +\let\magyar@opt@chapternumber\magyar@enumarg +\def\magyar@opt@accents@@high{\def\magyar@opt@@umlaut{\umlauthigh}} +\def\magyar@opt@accents@@low{\def\magyar@opt@@umlaut{\umlautlow\umlautelow}} +\def\magyar@opt@accents@@defaulthigh{\let\magyar@opt@@umlaut\@empty} +\let\magyar@opt@accents\magyar@enumarg +\def\magyar@opt@longcaption@@centered{\def\magyar@caption@centering{\centering}\def\magyar@caption@newline{\ }} +\def\magyar@opt@longcaption@@justified{\def\magyar@caption@centering{\relax}\def\magyar@caption@newline{\ }} +\def\magyar@opt@longcaption@@centernewline{\def\magyar@caption@centering{\centering}\def\magyar@caption@newline{\\\relax}} +\def\magyar@opt@longcaption@@none{\let\magyar@caption@centering\@empty} +\def\magyar@opt@longcaption@@unchanged{\let\magyar@caption@centering\@empty} +\let\magyar@opt@longcaption\magyar@enumarg +\def\magyar@opt@suggestions@@no {\def\magyar@opt@@suggestions{0}} +\def\magyar@opt@suggestions@@yes{\def\magyar@opt@@suggestions{1}} +\let\magyar@opt@suggestions\magyar@enumarg +\def\magyar@opt@appendixdot@@no {\def\@@magyar@appendixname{\appendixname}} +\def\magyar@opt@appendixdot@@yes{\def\@@magyar@appendixname{}} +\let\magyar@opt@appendixdot\magyar@enumarg +\def\magyar@opt@extras@@no {\def\magyar@opt@@extras{0}} +\def\magyar@opt@extras@@yes{\def\magyar@opt@@extras{1}} +\let\magyar@opt@extras\magyar@enumarg +\def\magyar@opt@chapterhead@@unchanged{\def\magyar@opt@@chapterhead{0}} +\def\magyar@opt@chapterhead@@no{\def\magyar@opt@@chapterhead{0}} +\def\magyar@opt@chapterhead@@yes{\def\magyar@opt@@chapterhead{1}} +\let\magyar@opt@chapterhead\magyar@enumarg +\def\magyar@opt@classmod@@no {\let\magyar@opt@@classmod\relax} +\def\magyar@opt@classmod@@unchanged{\let\magyar@opt@@classmod\relax} +\def\magyar@opt@classmod@@yes {\let\magyar@opt@@classmod\@empty} +\def\magyar@opt@classmod#1#2{% + \expandafter\ifx\csname magyar@opt@#1@@#2\endcsname\relax + \@namedef{magyar@opt@@#1}{#2}% + \else + \csname magyar@opt@#1@@#2\endcsname + \fi +} +\def\magyar@opt@shorthandcs#1#2{% + \def\reserved@a{#2}% + \def\reserved@b{none}% + \ifx\reserved@a\reserved@b + \def\magyar@opt@@shorthandcs{0}% overridable + \else + \def\magyar@opt@@shorthandcs{1}% + \ifcat\hfuzz\noexpand#2\relax% #2 is \shu \shu`tty is `tty + \def#2##1{\protect\@@magyar@shorthand}% Dat: ##1 is usually `_12 + \else + \@namedef{#2}{\protect\@@magyar@shorthand}% + \fi + \fi +} +\def\magyar@opt@hunumbers@@no{\def\magyar@opt@@hunumbers{0}} +\def\magyar@opt@hunumbers@@yes{\def\magyar@opt@@hunumbers{1}} +\let\magyar@opt@hunumbers\magyar@enumarg +\let\magyar@opt@az\magyar@yesweaknoarg +\let\magyar@opt@told\magyar@yesweaknoarg +\let\magyar@opt@textqq\magyar@yesweaknoarg +\let\magyar@opt@emitdate\magyar@yesweaknoarg +\let\magyar@opt@mathreal\magyar@yesweaknoarg +\let\magyar@opt@refstruc\magyar@yesweaknoarg +\let\magyar@opt@mond\magyar@yesweaknoarg +\let\magyar@opt@hang\magyar@yesweaknoarg +\def\magyar@opt@theoremtitle@@unchanged{\def\magyar@opt@@theoremtitle{0}} +\def\magyar@opt@theoremtitle@@hu{\def\magyar@opt@@theoremtitle{1}} +\let\magyar@opt@theoremtitle\magyar@enumarg +\def\magyar@opt@footnote@@unchanged{\def\magyar@opt@@footnote{0}} +\def\magyar@opt@footnote@@yes{\def\magyar@opt@@footnote{1}} +\def\magyar@opt@footnote@@huplain{\def\magyar@opt@@footnote{2}} +\def\magyar@opt@footnote@@starplain{\def\magyar@opt@@footnote{3}} +\let\magyar@opt@footnote\magyar@enumarg +\def\magyar@opt@hutoday@@no{\def\magyar@opt@@hutoday{0}} +\def\magyar@opt@hutoday@@yes{\def\magyar@opt@@hutoday{1}} +\let\magyar@opt@hutoday\magyar@enumarg +\def\magyar@opt@shortrefcmds@@no{\def\magyar@opt@@shortrefcmds{0}} +\def\magyar@opt@shortrefcmds@@yes{\def\magyar@opt@@shortrefcmds{1}} +\let\magyar@opt@shortrefcmds\magyar@enumarg +\def\magyar@opt@dottedtocline@@fix{\def\magyar@opt@@dottedtocline{1}} +\def\magyar@opt@dottedtocline@@unchanged{\def\magyar@opt@@dottedtocline{0}} +\let\magyar@opt@dottedtocline\magyar@enumarg +\let\magyar@opt@amslevelfix\magyar@enumarg +\def\magyar@opt@amslevelfix@@unchanged{\def\magyar@opt@@amslevelfix{0}} +\dMf magyar@opt@amslevelfix@@fix-ams {\def\magyar@opt@@amslevelfix{1}} +\dMf magyar@opt@amslevelfix@@fix-all {\def\magyar@opt@@amslevelfix{2}} +\let\magyar@opt@amsuppercasefix\magyar@enumarg +\def\magyar@opt@amsuppercasefix@@unchanged{\def\magyar@opt@@amsuppercasefix{0}} +\dMf magyar@opt@amsuppercasefix@@fix-ams {\def\magyar@opt@@amsuppercasefix{1}} +\dMf magyar@opt@amsuppercasefix@@fix-all {\def\magyar@opt@@amsuppercasefix{2}} +\let\magyar@opt@captionfix\magyar@enumarg +\def\magyar@opt@captionfix@@unchanged{\def\magyar@opt@@captionfix{0}} +\def\magyar@opt@captionfix@@yes {\def\magyar@opt@@captionfix{1}} +\let\magyar@opt@babelmarkfix\magyar@enumarg +\def\magyar@opt@babelmarkfix@@unchanged{\def\magyar@opt@@babelmarkfix{0}} +\def\magyar@opt@babelmarkfix@@yes {\def\magyar@opt@@babelmarkfix{1}} +\let\magyar@opt@showfix\magyar@enumarg +\def\magyar@opt@showfix@@unchanged{\def\magyar@opt@@showfix{0}} +\def\magyar@opt@showfix@@yes {\def\magyar@opt@@showfix{1}} +\def\magyar@opt@labelenums@@unchanged{\def\magyar@opt@@labelenums{0}} +\dMf magyar@opt@labelenums@@hu-a {\def\magyar@opt@@labelenums{1}} +\dMf magyar@opt@labelenums@@hu-A {\def\magyar@opt@@labelenums{2}} +\dMf magyar@opt@labelenums@@hu-d {\def\magyar@opt@@labelenums{3}} +\let\magyar@opt@labelenums\magyar@enumarg +\def\magyar@opt@labelitems@@unchanged{\def\magyar@opt@@labelitems{0}} +\def\magyar@opt@labelitems@@hu {\def\magyar@opt@@labelitems{1}} +\let\magyar@opt@labelitems\magyar@enumarg +\def\magyar@opt@openqq@@unchanged{\def\magyar@opt@@openqq{0}} +\def\magyar@opt@openqq@@up{\def\magyar@opt@@openqq{1}} +\def\magyar@opt@openqq@@down{\def\magyar@opt@@openqq{2}} +\def\magyar@opt@openqq@@maybedown{\def\magyar@opt@@openqq{3}} +\let\magyar@opt@openqq\magyar@enumarg +\def\magyar@opt@frenchspacing@@unchanged{\def\magyar@opt@@frenchspacing{0}}% same as =no +\def\magyar@opt@frenchspacing@@no {\def\magyar@opt@@frenchspacing{1}} +\def\magyar@opt@frenchspacing@@yes{\def\magyar@opt@@frenchspacing{2}} +\let\magyar@opt@frenchspacing\magyar@enumarg +\dMf magyar@opt@afterindent@@force-no {\def\magyar@opt@@afterindent{0}} +\dMf magyar@opt@afterindent@@force-yes {\def\magyar@opt@@afterindent{1}} +\dMf magyar@opt@afterindent@@unchanged {\def\magyar@opt@@afterindent{9}} +\let\magyar@opt@afterindent\magyar@enumarg +\def\magyar@opt@postpara#1#2{% + \def\reserved@a{#2}% + \ifx#2\magyar@@unchanged + \let\magyar@opt@@paragraphs\@undefined + \else + \expandafter\def\csname magyar@opt@@#1\endcsname{#2}% + \let\magyar@opt@@paragraphs\@empty + \fi +} +\let\magyar@opt@postsubpara\magyar@opt@postpara +\let\magyar@opt@postdescription\magyar@opt@postpara + +% --- Option processing code of \magyarOptions +% +% Example: \def\magyarOptions{titles=\quad,active=safe} \usepackage[magyar]{babel} +% Dat: Babel has \languageoptions, but it is quite weak and it's too late +% Dat: this is a complete rewrite based on examplep.sty + +%** @param #1 to gobble a space token +%** @usage \magyar@doopt foo=bar,foo2=bar2,\hfuzz,% +\def\magyar@doopt#1,{% + \if,\noexpand#1,% ignore multiple commas (#1 is empty) + \expandafter\magyar@doopt + \else + \csname fi\endcsname% don't count as `\fi' when being skipped + \magyar@doopt@low#1,=,% + \fi +} +\@gobble\iftrue% \def\magyar@doopt@low contains `\fi'. Make it skippable. +\def\magyar@applyopt#1#2{\csname magyar@opt@#1\endcsname{#1}{#2}}% +%** @param #1 is here for gobbling space tokens +\def\magyar@doopt@low#1#2=#3,#4\fi{% + % Dat: Normal case: #1#2 is key, #3 is value, #4 is `=,' + % Dat: MissingArg case: #1#2 is `key,', #3 is empty, #4 is empty + % Dat: Terminator case: #1#2 is `\hfuzz,', #3 is empty, #4 is empty + % Dat: OnlySpace case: #1 is `,', #2 is empty, #3 is empty, #4 is empty + \ifx\relax#4\relax% MissingArg or Terminator + \ifx#1\hfuzz% Terminator + \else + \if,\noexpand#1\else% OnlySpace case + \if=\noexpand#1\magyar@doopt@missingkey#2% #2 already contains comma at end + \else \magyar@doopt@missingval#1#2\fi + \fi + \expandafter\expandafter\expandafter\magyar@doopt + \fi + \else% Normal + \expandafter\ifx\csname magyar@opt@#1#2\endcsname\relax + \@@magyar@error{Unknown option: #1#2 (= #3)}% + \else + \magyar@applyopt{#1#2}{#3}% + \fi + \expandafter\magyar@doopt + \fi +} +\def\magyar@doopt@missingkey#1,{% + \@@magyar@error{Key missing for value: #1}% +} +\def\magyar@doopt@missingval#1,{% + \@@magyar@error{Value (=) missing for option: #1}% +} +%** Dat: Spaces and newlines at end of #1 are not ignored, so please prefix +%** them with a comma, e.g \magyar@doopts{foo=bar, } +%** @param #1 comma-separated optoinname=value pairs +%\def\magyar@doopts#1{\magyar@doopt #1,\hfuzz,}% + +\def\magyar@dooptions{% + \expandafter\ifx\csname opt@\CurrentOption.ldf.sty\endcsname\relax\else + % Usage: \PassOptionsToPackage{foo=bar}{magyar.ldf} + \expandafter\expandafter\expandafter + \magyar@doopt\csname opt@\CurrentOption.ldf.sty\endcsname,\hfuzz,% + \expandafter\let\csname opt@\CurrentOption.ldf.sty\endcsname\relax + \fi + \expandafter\ifx\csname \CurrentOption Options\endcsname\relax\else% \magyarOptions + \expandafter\expandafter\expandafter + \magyar@doopt\csname\CurrentOption Options\endcsname,\hfuzz,% + \expandafter\let\csname \CurrentOption Options\endcsname\relax + \fi +} +\def\magyar@do@option@low#1#2=#3=,\vfuzz{% + \ifx#1\hfuzz\else + %%\typeout{(#1#2)=(#3)}% + % vvv wastes some heap (\csname), but never mind + \fi +} + + +\magyar@opt@defaults{defaults}{over-1.4} % defaults=over-1.4 by default +\def\magyar@opt@@hdrtitleskip{\enskip}% !! option for that +\magyar@dooptions% in \magyarOptions +\ifnum\magyar@opt@@openqq=3 % =maybedown + \ifnum\magyar@opt@@active=0 + \def\magyar@opt@@openqq{0}% =unchanged + \else + \def\magyar@opt@@openqq{2}% =down + \fi +\fi +\ifnum\magyar@opt@@partnumber >0 \let\magyar@needopt@hunumbers\@empty \fi +\ifnum\magyar@opt@@chapternumber>0 \let\magyar@needopt@hunumbers\@empty \fi +\expandafter\ifx\csname magyar@needopt@hunumbers\endcsname\relax\else + \ifnum\magyar@opt@@hunumbers=0 + \@@magyar@error{(chapter|part)number=... needs hunumbers=yes}% + \magyar@opt@@hunumbers1 + \fi + \def\magyar@hunumbers@noclassmod{% + \@@magyar@error{unsupported \string\documentclass,\MessageBreak + hunumbers=yes,chapternumber=...,partnumber=... disabled}% + }% + % This may get redefined to \@empty later. + \def\magyar@hunumbers@errmsg{\magyar@hunumbers@noclassmod}% + \AtBeginDocument\magyar@hunumbers@errmsg +\fi +\if0\magyar@opt@@shorthandcs\else + \if\magyar@opt@@active0% + \@@magyar@error{active=none implies shorthandcs=none}% + \magyar@opt@@active2 % active=safe + \fi +\fi +% Imp: undef \magyar\@opt@* to save memory + +\@gobble\iftrue +%** Usage: `\if...\else\@@magyar@skiplong\fi ... \@gobble{^}', where {^} is in +%** its own line +\def\@@magyar@skiplong#1{% + \fi + %\typeout{--skipfrom:\the\inputlineno} + \bgroup% so ^} would close it + \catcode\string`^13 \lccode\string`~=\string`^ + \lowercase{\let~\fi}% \lowercase because catcode of ^ in \let^ would have been already assigned + %\lowercase{\def~{\typeout{--skipto:\inputlineno}\fi}}% + \catcode\string`\\14 % comment -- avoid using hash memory + \catcode\string`$14 % %$ + \iffalse +} +\@gobble\fi + +\@namedef{extras\CurrentOption}{}% + +% --- hyphenation= + +\csname magyar@opt@@hypr\endcsname +\let\magyar@sugg@pa\@gobble +%\show\magyar@opt@@hyphenation +\ifx\magyar@opt@@hyphenation\@empty + % Hungarian words won't be hyphenated automatically + \expandafter\chardef\csname l@\CurrentOption\endcsname255 + \@@magyar@skiplong\fi +% Define a warning, will be printed later. +\def\@@magyar@suggpa@req@def{% + \def\magyar@sugg@pa##1{% + \PackageWarningNoLine{##1.ldf}{% + Requested Hungarian hyphenation= patterns missing.\MessageBreak + To make LaTeX hyphenate Hungarian words, please\MessageBreak + modify language.dat and rerun initex or texconfig}}}% +% Define a warning, will be printed later. +\def\@@magyar@suggpa@all@def{% + \def\magyar@sugg@pa##1{% + \PackageWarningNoLine{##1.ldf}{% + All Hungarian hyphenation= patterns missing.\MessageBreak + To make LaTeX hyphenate Hungarian words, please\MessageBreak + modify language.dat and rerun initex or texconfig}}}% +\def\@@magyar@hyphenation@last#1\@@magyar@hyphenation@next#2\hfuzz{#1}% +\def\@@magyar@hyphenation@defcs#1#2{\ifx#1#2\else\chardef#1#2\fi}% Dat: \chardef\foo\foo doesn't work +\def\@@magyar@hyphenation@def#1{% + \expandafter\ifx\csname l@#1\endcsname\relax\else + \expandafter\expandafter\expandafter\@@magyar@hyphenation@defcs + \expandafter\expandafter\csname l@\CurrentOption\endcsname + \csname l@#1\endcsname + \@@magyar@hyphenation@last\fi}% +\def\@@magyar@hyphenation@next#1{% + \ifx#1\hfuzz + \else\if#1N% none + % Turn of hyphenation. + \expandafter\chardef\csname l@\CurrentOption\endcsname255 + \@@magyar@hyphenation@last + \else\if#1C% use l@\CurrentOption if defined + \expandafter\ifx\csname l@\CurrentOption\endcsname\relax\else + \@@magyar@hyphenation@last + \fi + \else\if#1w% print the all-missing-warning + \@@magyar@suggpa@all@def + \else\if#1r% print the req-missing-warning + \@@magyar@suggpa@req@def + \else\if#1h\@@magyar@hyphenation@def{hungarian}% + \else\if#1m\@@magyar@hyphenation@def{magyar}% + \else\if#13\@@magyar@hyphenation@def{magyar3}% + \else\if#1c\@@magyar@hyphenation@def{magyarc}% + \else\if#1f\@@magyar@hyphenation@def{magyarf}% + \else\if#1n\@@magyar@hyphenation@def{magyarn}% + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\@@magyar@hyphenation@next + % Dat: no \adddialect\l@magyar... - it's only a chardef +}% + +%\tracingmacros1 \show\magyar@opt@@hyphenation +\expandafter\@@magyar@hyphenation@next\magyar@opt@@hyphenation\hfuzz +%\show\l@magyar +%\tracingmacros0 +\expandafter\ifx\csname l@\CurrentOption\endcsname\relax + \expandafter\newcount\csname l@\CurrentOption\endcsname + % ^^^ BUGFIX at Tue Oct 12 14:13:54 CEST 2004 +\fi +\let\@@magyar@suggpa@all@def\@undefined +\let\@@magyar@suggpa@req@def\@undefined +\@gobble +{^} + +% --- accents= + +\ifx\magyar@opt@@umlaut\@empty\else% !! test this + % Dat: this only affects \" + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\"\umlautlow \magyar@opt@@umlaut} +\fi + +% --- theorem title number ordering and the dot; theoremtitle= +% +% Dat: \ref{mytheorem} never appends a dot +% +% If you want to define your own theorem style without using theorem.sty or +% ntheorem.sty, then do a +% \PassOptionsToPackage{theoremtitle=unchanged}{magyar.ldf} , and then +% define a custom \@begintheorem, \@opargbegintheorem and \@endtheorem. + +\if0\magyar@opt@@theoremtitle \@@magyar@skiplong\fi +% for theorem.sty and ntheorem.sty +% Define your \newtheorem commands in the preamble, before \theoremstyle +\def\magyar@th@magyar{% + \def\@begintheorem##1##2{% + \item[\hskip \labelsep{\theorem@headerfont ##2.\ ##1.}]}% + \def\@opargbegintheorem##1##2##3{% + \item[\hskip \labelsep{\theorem@headerfont ##2.\ ##1\ (##3).}]}% +} + +% vvv Dat: theorem.sty needs \th@magyar-plain when \theoremstyle{...} +% is called, so we have to define it early (even if theorem.sty is not +% loaded). +\expandafter\let\csname th@\CurrentOption-plain\endcsname\magyar@th@magyar% Dat: moved to earlier +% !! now \usepackage{theorem} +% \usepackage[magyar]{babel} +% \theoremstyle{magyar-plain}% % Dat: must be put before \new +% \newtheorem{Def}{Defin\'{i}ci\'o} + +%** @param #1 magyar +\def\@@magyar@setup@theoremstyle#1{% + \expandafter\ifx\csname theorem@headerfont\endcsname\relax + \let\magyar@th@magyar\@undefined + \else + %\expandafter\let\csname th@#1-plain\endcsname\magyar@th@magyar% Dat: moved to earlier + % vvv Dat: activate the Hungarian theorem style by default. + \def\theorem@headerfont{\bf}% + \edef\reserved@a{\the\theorem@style}% + \def\reserved@b{plain}% + \ifx\reserved@a\reserved@b + \expandafter\theorem@style\expandafter{#1-plain}% + \fi + \fi +} + +% Do this quite late in case theorem.sty or ntheorem.sty is loaded late. +\expandafter\AtBeginDocument\expandafter{\expandafter + \@@magyar@setup@theoremstyle\expandafter{\CurrentOption}} + +\expandafter\addto\csname extras\CurrentOption\endcsname{% + %%\show\theorem@headerfont + \expandafter\ifx\csname thm@swap\endcsname\relax + \expandafter\ifx\csname theorem@headerfont\endcsname\relax% no theorem.sty + \babel@save\@begintheorem + % Dat: amsart.cls: \def\@begintheorem#1#2[#3]{}% + \def\@begintheorem#1#2{\trivlist + \item[\hskip \labelsep{\bfseries #2.\ #1.}]\itshape}% old: \slshape + \babel@save\@opargbegintheorem + \def\@opargbegintheorem#1#2#3{\trivlist + \item[\hskip \labelsep{\bfseries #2.\ #1\ (#3).}]\itshape}% old: \slshape + \else% theorem.sty or ntheorem.sty + % Nothing -- style already set up in the preamble. + \fi + \else% amsthm.sty + \babel@save\thmhead + \babel@save\swappedhead + %** \swapnumbers. \newtheorem{...}{...} already inserts the trailing dot + % \def\thm@swap{S}% no effect :-( + %** overrides amsart.cls + \def\thmhead#1#2#3{% + \thmnumber{\@upn{#2}\@ifnotempty{#1}{.~}}% + \thmname{#1}% + \thmnote{ {\the\thm@notefont(#3)}}% + }% + \let\swappedhead\thmhead + \fi +}% +\@gobble +{^}% + +% --- Quotation marks with \textqq +% +% Symbols of Hungarian quoting: unquoted ,,outer >>middle 'inner'<<'' +% Equivalent: unquoted \quotedblbase outer \guillemotright middle +% \textquoteright inner\textquoteright\guillemotleft\textquotedblright +% With magyar.ldf: unquoted \textqq{outer \textqq{middle \textqq{inner}}} +% Typing this with magyar.ldf works for outer: \textqq{foo} +% Typing this works with T1 and OT1 for outer: \glqq foo'' +% Typing this works in T1, but not in OT1 for outer: ,,foo'' +% + +\if0\magyar@opt@@textqq \@@magyar@skiplong\fi +\def\magyar@textqq@level{0} +%** Provide a placeholder for language-unspecific \textqq +\def\@@magyar@textqq@nolang#1{% + \ifcase\magyar@textqq@level + \def\magyar@textqq@level{1}% + \textquotedblleft#1\textquotedblright + \def\magyar@textqq@level{0}% + \or + \textquoteleft#1\textquoteright + \fi +} +\def\@@magyar@textqq@hu#1{\ifmmode\expandafter\mbox\fi{% + % Imp: \textqq{\textqq{foo}} -> \textqq{\textqq{foo}\,} + % Dat: \showhyphens{\textqq{hello bello}} --> hel-lo bel-lo + % Dat: \guillemotleft is provided by babel.def even for the OT1 encoding + \ifcase\magyar@textqq@level + \def\magyar@textqq@level{1}% + % Dat: \hskip instead of \kern to allow hyphenation + % \nobreak\hskip-.06em adds a non-breakable skip and allows hyphenation + % of the following word. + \quotedblbase\nobreak\hskip-.06em\relax#1\kern\z@\textquotedblright% skip OK for the CM and EC fonts + \def\magyar@textqq@level{0}% + \or + \def\magyar@textqq@level{2}% + \guillemotright\nobreak\hskip-.07em\relax#1\kern-0.05em\guillemotleft% skip OK for CM and EC fonts + \def\magyar@textqq@level{1}% + \or + \def\magyar@textqq@level{3}% + \textquoteright\nobreak\hskip\z@\relax#1\kern\z@\textquoteright + \def\magyar@textqq@level{2}% + \else + \quotedblbase\nobreak\hskip-.06em\relax#1\kern\z@\textquotedblright% skip OK for the CM and EC fonts + \fi +}}% + +\catcode`\ =11\relax% make space a letter +\ifnum\magyar@opt@@textqq\expandafter\ifx\csname\@gobble.textqq\endcsname\relax1\fi>1\relax% 21, 2, 11, 1 +\def\textqq{\protect\textqq }% \MakeRobust +\def\@@magyar@textqq{\protect\textqq }% +\let\textqq \@@magyar@textqq@nolang% +\expandafter\addto\csname\@gobble.extras\CurrentOption\endcsname% +{\babel@save\textqq \let\textqq \@@magyar@textqq@hu}% +\else% +\def\@@magyar@textqq{\protect\@@magyar@textqq }% \MakeRobust +\let\@@magyar@textqq \@@magyar@textqq@nolang% +\expandafter\addto\csname\@gobble.extras\CurrentOption\endcsname% +{\babel@save\@@magyar@textqq \let\@@magyar@textqq \@@magyar@textqq@hu}% +\fi% +\catcode`\ =10\relax% back to space again +\@gobble +{^}% + +% --- Definite articles (\az, \pageref -> \apageref etc.) + +\if0\magyar@opt@@az \@@magyar@skiplong\fi + +\makeatletter + +%** modified by pts at Fri Oct 3 22:19:13 CEST 2003 +%** @param #1 tokens, will be \edef\vfuzz'ed +\def\@@magyar@az@vfuzzedef#1{% + \begingroup + \@safe@activestrue% allow active `:' inside labels; + \def\hyper@@link[##1]##2##3##4{##4}% Dat: \def\b@abook{\hyper@@link [cite]{}{cite.sokt}{2}}% with hyperref.sty + \let\romannumeral\number% by pts@fazekas.hu at Mon Oct 27 23:44:06 CET 2003 + % Dat: deliberately no \autoref for hyperref.sty !! (why??) + \let\ref\@@magyar@zeroref \let\pageref\@@magyar@zeropageref + \let\cite\@@magyar@zerocite \let\eqref\@@magyar@zeroeqref + % ^^^ fix so \az{\ref{...}} works + \let\refstruc\@@magyar@zerorefplus + \let\refstrucparen\@@magyar@zerorefplus + \def\setbox ##1{}% to get rid of accents and special letters + \def\hbox ##1{}% + \def\accent ##1 ##2{##2}% + \def\add@accent ##1##2{##2}% + \def\@text@composite@x ##1##2{##2}% + \def\i{i}\def\j{j}% + \def\ae{a}\def\AE{A}\def\oe{o}\def\OE{O}% + \def\ss{s}\def\L{L}% + \def\d{}\def\b{}\def\c{}\def\t{}% Dat: no need to redefine \H and \. + % Dat: no need to remove \textsf or \mdseries, because they are + % handled properly by \protect == \string here. + \let\@safe@activestrue\@empty% babel puts these inside \b@...: % Dat: \def\b@abook{\@safe@activesfalse 2}% (what is \@safe@actives??) + \let\@safe@activesfalse\@empty + \edef\vfuzz{\noexpand\def\noexpand\vfuzz{#1}}% + \expandafter\endgroup\vfuzz +} + +%** Makes \az etc. not emit the definite article. +%** Unused. +\def\@@magyar@noaz{% + \def\@@magyar@az@lowt{\@ifstar\@gobble\@firstofone}% + \def\az{\@@magyar@az@lowt}% + \let\Az\az + \def\aref{\@ifstar\@gobble\@@magyar@az@lowa}% + \let\Aref\aref + \def\apageref{\@ifstar\@gobble\firstoftwo}% + \let\Apageref\apageref + \def\acite{\@ifstar\@gobble\cite}% + \let\Acite\acite +} + +%** Usage: \az{alma} -> `az alma'; \Az*{alma} -> `az' +%** Usage: \az+\ref{foo} is equivalent to \az{\ref{foo}} +\def\@@magyar@az@lowt{\@ifstar{\@@magyar@az@lowy}{\@ifnextchar+\@@magyar@az@lowz\@@magyar@az@lowx}} +\def\@@magyar@az@lowz#1#2#3{\@@magyar@az@lowy{#2{#3}}~#2{#3}} +%** Used by new varioref.sty +\def\@@magyar@az@lowxu{\unskip\@@magyar@az@lowx}% +\def\@@magyar@az@lowx#1{\@@magyar@az@lowy{#1}~#1} +\def\@@magyar@az@lowy#1{{% + \begingroup + %\def\protect{\noexpand\protect\noexpand}% + \set@display@protect% screws up \r + \@@magyar@az@vfuzzedef{#1}% + %%\show\vfuzz + \expandafter\endgroup\expandafter + \set@display@protect\expandafter% fixes \r; why?? + \@@magyar@az@set\expandafter{\vfuzz}\hbox$% +}} + +\def\@@magyar@firstarg#1#2\hbox${#1}% + +%** \Aref({e:foo}) -> `az~(5)'; \aref*{e:foo}: `az' +\def\@@magyar@az@lowa{\@ifnextchar({\@@magyar@az@lowb}{\@@magyar@az@lowb\@empty}} +\def\@@magyar@az@lowb#1#2{\@@magyar@az@ref\@firstoftwo{#2}~#1\ref{#2}} +%** @param #1 \@firstoftwo (for \ref) or \@secondoftwo (for \pageref) +%** everything which is not \@secondoftwo is treated is \@firstoftwo +%** @param #2 for \csname r@#2\endcsname +\def\@@magyar@az@ref#1#2{% + \begingroup + % Dat: this works when turning on hyperref.sty for the 1st time (1st .aux file) -- but the original \ref doesn't work (\@fifthoffive) + % Dat: #2 might contain an active : ; ! ? in case + % \def\magyarOptions{activespace=safe} + \begingroup\lccode`~`: \lowercase{\endgroup\edef~{\string~}}% + \begingroup\lccode`~`; \lowercase{\endgroup\edef~{\string~}}% + \begingroup\lccode`~`! \lowercase{\endgroup\edef~{\string~}}% + \begingroup\lccode`~`? \lowercase{\endgroup\edef~{\string~}}% + \@ifundefined{@@magyar@r@#2}{% + \@ifundefined{r@#2}{\let\reserved@a\@empty}{\expandafter\let\expandafter\reserved@a\csname r@#2\endcsname}% + }{\expandafter\let\expandafter\reserved@a\csname @@magyar@r@#2\endcsname}% + \ifx\reserved@a\@empty\endgroup\else% a speed boost + \ifx#1\@secondoftwo\relax % Dat: remove the 1st {...} arg inside \reserved@a + \expandafter\expandafter\expandafter\def\expandafter\expandafter + \expandafter\reserved@a\expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter\@gobble\reserved@a{}}% + \fi + % vvv keep only the 1st arg (w/o braces) of \vbox, without expansion. + % This is to have hyperref.sty with `\newlabel{tab}{{1}{2}{\texorpdfstring {\textit {bg}}{asd}\relax }{section.1}{}}' + % right, and \texorpdfstring not expanded in the \edef below. + \expandafter\expandafter\expandafter\def\expandafter\expandafter + \expandafter\reserved@a\expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter\@@magyar@firstarg\reserved@a{}\hbox$}% + \expandafter\@@magyar@az@vfuzzedef\expandafter{\reserved@a}% + \expandafter\endgroup\expandafter\@@magyar@az@set\expandafter{\vfuzz}\hbox$% + \fi +} + +\def\@@magyar@az@lowd#1{\@@magyar@az@ref\@secondoftwo{#1}~\pageref{#1}} + +\def\@@magyar@acite@lowb{\@ifnextchar [{\@@magyar@acite@lowa}{\@@magyar@acite@lowa[]}} +\def\@@magyar@acite@lowa[#1]#2{% + \@@magyar@acite@lowd{#2}~% + \ifx\vfuzz#1\vfuzz\cite{#2}\else\cite[#1]{#2}\fi +} +\def\@@magyar@acite@lowd#1{\@@magyar@acite@lowc#1,\hbox$} +\def\@@magyar@acite@lowc#1,#2\hbox#3${% + \begingroup + \@ifundefined{@@magyar@b@#1}{% + \@ifundefined{b@#1}{\def\vfuzz{}}{% + \@@magyar@az@vfuzzedef{% + \expandafter\expandafter\expandafter\@@magyar@b@number + \expandafter\expandafter\expandafter{\csname b@#1\endcsname}}}% + } {\@@magyar@az@vfuzzedef{\csname @@magyar@b@#1\endcsname}}% + \expandafter\endgroup\expandafter + \@@magyar@az@set\expandafter{\vfuzz}\hbox$% +} + +% The original version of the \@az macros below were written by +% David Carlisle, but they have been completely rewritten by pts. + +%** Adds definite article for a word #1#2#3 if #1 is in [A..Z]. Spaces +%** between #1, #2 and #3 can be -- fortunately -- ignored. +%** This is used to distinguish single-letter labels from text labels. +%** Dat: by pts: `\Az{Sz} bet' emits `Az Sz bet'; `\az{szlam}' is also OK +%** @param #1#2#3 doesn't contain \hbox (but may contain space) +%** @param #1 #2 #3 never lower case +\def\@@magyar@azuc#1#2#3{% + \if\noexpand#1Az% + \else\if\noexpand#1Ez% + \else\if\noexpand#1F\ifnum11=\the\catcode\string`#2\else z\fi + \else\if\noexpand#1Iz% + \else\if\noexpand#1L\ifnum11=\the\catcode\if\noexpand#2Y\string`#3\else\string`#2\fi\else z\fi + \else\if\noexpand#1M\ifnum11=\the\catcode\string`#2\else z\fi + \else\if\noexpand#1N\ifnum11=\the\catcode\if\noexpand#2Y\string`#3\else\string`#2\fi\else z\fi + \else\if\noexpand#1Oz% + \else\if\noexpand#1S\ifnum11=\the\catcode\if\noexpand#2Z\string`#3\else\string`#2\fi\else z\fi + \else\if\noexpand#1R\ifnum11=\the\catcode\string`#2\else z\fi + \else\if\noexpand#1Uz% + \else\if\noexpand#1X\ifnum11=\the\catcode\string`#2\else z\fi + \else\if\noexpand#1Y\ifnum11=\the\catcode\string`#2\else z\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi +} +\def\@@magyar@azuc@pre#1#2#3#4\hbox${% + \uppercase{\@@magyar@azuc#1#2#3}% Dat: we map a..z -> A..Z +} + +%** Also defined elsewhere. +%** @param #2 \else...\else...\fi...\fi etc. +\def\@@magyar@swaprelax#1#2\relax{#2#1} +\def\@@magyar@ignorehbox@pre#1\hbox${}% +%** Counts the number of digits until a nondigit is found, and insert `z' if +%** appropriate (divisible by 3). +%** We need this to properly handle \aref for eg. 1.3.12 (subsec number) +%** or 3-45 (pagenumber preceeded by chapter number). +\def\@@magyar@eatddd#1#2#3#4{% + % Wizardry: \@@magyar@eatddd throws away #1 (\@@magyar@ignorehbox@pre) + \ifnum9<1\string#2 \ifnum9<1\string#3 \ifnum9<1\string#4 % test for digits + \@@magyar@swaprelax\@@magyar@eatddd\fi\fi\else z\fi + \relax\@@magyar@ignorehbox@pre +} + +% vvv Wizardry: ignore everything (second number?) after first space +\def\@@magyar@eatddd@pre#1 #2\hbox${\@@magyar@eatddd.#1[][]\hbox$}% + +\@gobble\iftrue +\def\@@magyar@azrb@stop#1#2\fi{#1}% +%** Strips spaces and braces automatically +%** @expands to `z' or nothing (last char of definite article) +%** @example \message{R:\removebraces {{foo}{{}{b}{{{{a\fi}}}}r}}\hfuzz;} +\def\@@magyar@azrb#1{% + \ifx\hfuzz#1\@@magyar@azrb@stop\fi + \expandafter\@@magyar@azrb\expandafter{% + \ifcat{\noexpand#1\hfuzz\iffalse}\fi\expandafter + \@@magyar@azrb\else\hfuzz}\@@magyar@azrb@nob{#1}\fi} +\def\@@magyar@azrb@nob#1#2{#2% #2 is \fi + \ifx\hfuzz#1\hfuzz\expandafter\@firstoftwo + \expandafter\@@magyar@azrb\fi\@@magyar@azrb@nobone#1} +\def\@@magyar@azrb@nobone#1{\noexpand#1\@@magyar@azrb}% + +\def\@@magyar@aznospace#1{% + \if\hfuzz\noexpand#1\expandafter\@@magyar@aznospace\else % a \cs, ignored -- may be \relax + \expandafter\@@magyar@aznospace@short\expandafter#1% + \fi +} + +%** @param #1 might not be \cs -- and isn't empty +\def\@@magyar@aznospace@short#1{% + \if5\noexpand#1z% Dat: emit `az 5' + \@@magyar@swaprelax\@@magyar@ignorehbox@pre + \else\if1\noexpand#1% + % Dat: properly handle `az 1001 jszaka', `az 1234567 ves bolyg' + \@@magyar@swaprelax\@@magyar@eatddd@pre + \else\ifnum1<1\noexpand#1 % a different digit, emit `a ' + \@@magyar@swaprelax\@@magyar@ignorehbox@pre + \else\if-\noexpand#1% \az{-5} yields `a~-5' + \@@magyar@swaprelax\@@magyar@ignorehbox@pre + \else\ifcat\string*\noexpand#1% ignore non-digit (non-letter) `other' char + % Wizardary: (undocumented) + % This is a really smart way to ignore control sequence chars resulting + % from \string\textrm etc. Fortunately, most control sequences don't + % contain digits. + \@@magyar@swaprelax\@@magyar@aznospace + \else + \@@magyar@swaprelax{\@@magyar@azuc@pre#1}% safe to call, no \cs + \fi\fi\fi\fi\fi\relax +} + +%** Typesets `z' or nothing (last char of definite article). Is _not_ +%** expandable. +%** @param #1 may contain space(_10) tokens, but mustn't contain expandable +%** tokens. +\def\@@magyar@az@set#1#2\hbox${% by pts + % ^^^ Dat: we have `$' instead of `!' because of catcode changes (shouldn't affect) + \edef\reserved@a{\@@magyar@azrb#1\hfuzz}% + \expandafter\@@magyar@aznospace\reserved@a[b][][] \hbox$% + % ^^^ Wizardry: [b][][] is a smart sentinel for \@@magyar@azuc and `b' for + % \@@magyar@aznospace@short. First `[' is there for aesthetics. Space + % is there for \@@magyar@eatddd@pre. \hbox$ is something that will not + % occur in normal text. +} + +\ifnum\magyar@opt@@az \expandafter\ifx\csname az\endcsname\relax1\fi>1 % 21, 2, 11, 1 + \DeclareRobustCommand\az{a\@@magyar@az@lowt}\fi +\ifnum\magyar@opt@@az \expandafter\ifx\csname Az\endcsname\relax1\fi>1 % 21, 2, 11, 1 + \DeclareRobustCommand\Az{A\@@magyar@az@lowt}\fi +\ifnum\magyar@opt@@az \expandafter\ifx\csname aref\endcsname\relax1\fi>1 % 21, 2, 11, 1 + \DeclareRobustCommand\aref{a\@ifstar{\@@magyar@az@ref\@firstoftwo}{\@@magyar@az@lowa}}\fi +\ifnum\magyar@opt@@az \expandafter\ifx\csname Aref\endcsname\relax1\fi>1 % 21, 2, 11, 1 + \DeclareRobustCommand\Aref{A\@ifstar{\@@magyar@az@ref\@firstoftwo}{\@@magyar@az@lowa}}\fi +\ifnum\magyar@opt@@az \expandafter\ifx\csname apageref\endcsname\relax1\fi>1 % 21, 2, 11, 1 + \DeclareRobustCommand\apageref{a\@ifstar{\@@magyar@az@ref\@secondoftwo}{\@@magyar@az@lowd}}\fi +\ifnum\magyar@opt@@az \expandafter\ifx\csname Apageref\endcsname\relax1\fi>1 % 21, 2, 11, 1 + \DeclareRobustCommand\Apageref{A\@ifstar{\@@magyar@az@ref\@secondoftwo}{\@@magyar@az@lowd}}\fi +\ifnum\magyar@opt@@az \expandafter\ifx\csname acite\endcsname\relax1\fi>1 % 21, 2, 11, 1 + \DeclareRobustCommand\acite{a\@ifstar{\@@magyar@acite@lowd}{\@@magyar@acite@lowb}}\fi +\ifnum\magyar@opt@@az \expandafter\ifx\csname Acite\endcsname\relax1\fi>1 % 21, 2, 11, 1 + \DeclareRobustCommand\Acite{A\@ifstar{\@@magyar@acite@lowd}{\@@magyar@acite@lowb}}\fi + +\@gobble +{^} + +% --- hunnewlabel= + +\if0\magyar@opt@@hunnewlabel + \let\hunnewlabel\@gobbletwo + % ^^^ with this the user would be able to switch from hunnewlabel=yes + % to hunnewlabel=no without removing the .aux file. But now I have a + % better solution to that. (??) !! + \@@magyar@skiplong\fi + +% [pts] Done properly by pts@fazekas.hu at Mon Mar 2 21:53:30 CET 2009 +% +% \label will be redefined to write another line to .aux file: +% \hunnewlabel{...}{...}: similar to \newlabel{sectionStructNr}{pageNr}, +% where the roman numerals are replaced by their arabic representations, so +% \aref and \apageref will work (`a II. rsz'). The name \hunnewlabel is a +% legacy. +% +% We have to redefine \refstepcounter, which defines \@currentlabel, so we +% can define \magyar@@currentlabel@arabic, wich is the same as \@currentlabel, +% but it contains the number in arabic instead of roman. Without +% \magyar@@currentlabel@arabic, \label would have no clue that a roman number +% was involved. hyperref.sty also redefines \refstepcounter, but we are +% agnostic to that: it doesn't matter if we are first. + +\let\magyar@@orig@refstepcounter\refstepcounter +% \relax, or {currentlabel}{pagenumber} +\let\magyar@@currentlabel@intact\relax +% \relax, or {currentlabel-in-arabic}{pagenumber-in-arabic} +\let\magyar@@currentlabel@arabic\relax + +\def\@@magyar@setup@romantoarabic{% + \let\romannumeral\number + \let\@Roman\@roman % avoid uppercasing +} + +\def\refstepcounter#1{% + \magyar@@orig@refstepcounter{#1}% + \begingroup + % Imp: wait till \shipout before expanding \thepage, in case of + % \pagenumbering{roman}. + % \c@page might be wrong (it's correcy at \shipout only), se we fake it. + \c@page\@m + \edef\reserved@b{{\thepage}}% + \let\reserved@a\@currentlabel + % Wrap \reserved@a in {...}, and then append \reserved@b to \reserved@a. + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter\reserved@a% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter{% + \expandafter\reserved@a\expandafter}\reserved@b}% + \expandafter\def\expandafter\reserved@b\expandafter{% + \expandafter\def\expandafter\magyar@@currentlabel@intact\expandafter{% + \reserved@a}}% + \expandafter\endgroup\reserved@b + \begingroup + \c@page\@m + \@@magyar@setup@romantoarabic + % This \protected@edef is from the \refstepcounter code. + \protected@edef\reserved@a{% + {\csname p@#1\endcsname\csname the#1\endcsname}{\thepage}}% + \let\reserved@b\@empty + \ifx\reserved@a\@currentlabel\else + \expandafter\def\expandafter\reserved@b\expandafter{% + \expandafter\def\expandafter\magyar@@currentlabel@arabic\expandafter{% + \reserved@a}}% + \fi + \expandafter\endgroup\reserved@b +} + +%** Make its expansion short so \ifx would be fast down in noextras... +\def\@@magyar@labela{\@@magyar@labelb}% +\def\@@magyar@labelb#1{% + \@@magyar@orig@label{#1}% output \newlabel to \@auxout + \begingroup + \c@page\@m + \edef\reserved@b{{\thepage}}% + \let\reserved@a\@currentlabel + % Wrap \reserved@a in {...}, and then append \reserved@b to \reserved@a. + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter\reserved@a% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter{% + \expandafter\reserved@a\expandafter}\reserved@b}% + \ifx\reserved@a\magyar@@currentlabel@intact + % \@currentlabel created by our overridden \refstepcounter. + \ifx\magyar@@currentlabel@arabic\magyar@@currentlabel@intact\else + \expandafter\@@magyar@labelc\magyar@@currentlabel@arabic{#1}% + \fi + \else + % \@currentlabel from unknown origin. + % Emit \hunnewlabel if \thepage is roman. + \@@magyar@setup@romantoarabic + \edef\reserved@c{{\thepage}}% + \ifx\reserved@b\reserved@c\else % \thepage is roman + \@@magyar@labelc\@currentlabel{}{#1}% + \fi + \fi + \endgroup +} +% @param #1 \@currentlabel (maybe expanded) as roman converted to arabic +% @param #2 any page number in any format; ignored +% @param #3 name of the label +\def\@@magyar@labelc#1#2#3{% + % We have \noexpand\number below to prevent the \edef in \protected@write + % from expanding the page number. It will be expanded at \shipout. + \protected@write\@auxout{}{% + \string\hunnewlabel{#3}{{#1}{\noexpand\number\c@page}}}% +} + +\expandafter\addto\csname extras\CurrentOption\endcsname{% + %%\message{--EXTRAS--}\show\label + \ifx\label\@@magyar@labela\else + \let\@@magyar@orig@label\label + \let\label\@@magyar@labela + \fi +} +\expandafter\addto\csname noextras\CurrentOption\endcsname{% + %%\message{--NO--}% + \ifx\label\@@magyar@labela + % The trick here is not to restore the ``original'' label command if + % somebody has changed it since the previous save in \extrasmagyar. This + % adds compatibility with hyperref.sty, because it loads nameref.sty which + % changes \label after babel.sty and magyar.ldf has been loaded. + % 1. \usepackage[magyar]{babel}% \AtBeginDocument{\select@language{magyar}} + % 2. \usepackage{hyperref}% \AtBeginDocument{\RequirePackage{nameref}} + % 3. \begin{document}: + % 4. \input \jobname.aux + % 5. \AtBeginDocument hooks: + % 6. \select@language{magyar} + % 7. \extrasmagyar + % 8. \let\@@magyar@orig@label\label + % 9. \RequirePackage{nameref}: + % 10. \def\label#1{...} + \if1\magyar@opt@@hunnewlabel % only hunnewlabel=only-hu + \let\label\@@magyar@orig@label + \fi + \fi + % \let\@@magyar@orig@label\relax % Dat: commenting out this makes it possible to load magyar.ldf twice +} +\def\hunnewlabel#1#2{% + \def\reserved@a{#2}% + \expandafter\ifx\csname r@#1\endcsname\reserved@a% hun and normal labels are the same + \relax% \message{No need for def: #1}% + \else + \global\expandafter\let\csname @@magyar@r@#1\endcsname\reserved@a% + \fi +} + +\@gobble +{^} + +% --- captions= + +\if0\magyar@opt@@captions\@@magyar@skiplong\fi +\@namedef{captions\CurrentOption}{% + % Dat: inputenc isn't known, so we just use the safe \'a for accented letters + \def\prefacename{El\H osz\'o}% + \def\refname{Hivatkoz\'asok}% + \def\abstractname{Kivonat}% + \def\bibname{Irodalomjegyz\'ek}% + \def\appendixname{f\"uggel\'ek}% BUGFIX at Sun Feb 29 22:02:51 CET 2004 + \def\contentsname{Tartalomjegyz\'ek}% + \def\listfigurename{\'Abr\'ak jegyz\'eke}% + \def\listtablename{T\'abl\'azatok jegyz\'eke}% + \def\indexname{T\'argymutat\'o}% + \def\enclname{Mell\'eklet}% + \def\ccname{K\"orlev\'el--c\'\i mzettek}% ?? + \def\headtoname{C\'\i mzett}% + \def\proofname{Bizony\'\i t\'as}% AMS-\LaTeX + \def\glossaryname{Sz\'ojegyz\'ek}% glosszrium, (magyarzatos) szjegyzk + % vvv All these are start with a small letter + \def\figurename{\'abra}% + \def\chaptername{fejezet}% + \def\tablename{t\'abl\'azat}% + \def\notesname{Jegyzetek}% endnotes.sty + \def\partname{r\'esz}% + \def\pagename{oldal}% + \def\seename{l\'asd}% + \def\alsoname{l\'asd m\'eg}% +} +\@gobble +{^} + +% --- Changing the order of the table numbers; tablecaptions= + +\if0\magyar@opt@@tablecaptions\@@magyar@skiplong\fi + % Wee need `1. tblzat' instead of `Table 1' + \if1\magyar@opt@@tablecaptions + \def\@@magyar@fnum@table{\thetable.~\tablename}% + \else \def\@@magyar@fnum@table{\tablename\nobreakspace\thetable}\fi + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\fnum@table\let\fnum@table\@@magyar@fnum@table} + \@gobble +{^} + +% --- Changing the order of the figure numbers; figurecaptions= + +\if0\magyar@opt@@figurecaptions\@@magyar@skiplong\fi + \if1\magyar@opt@@figurecaptions + \def\@@magyar@fnum@figure{\thefigure.~\figurename}% + \else \def\@@magyar@fnum@figure{\figurename\nobreakspace\thefigure}\fi + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\fnum@figure\let\fnum@figure\@@magyar@fnum@figure} + \@gobble +{^} + +% --- dottedtocline= + +\if0\magyar@opt@@dottedtocline\@@magyar@skiplong\fi + % Dat: It is quite safe to re-define \@dottedtocline, because it isn't + % redefined in standard packages of teTeX 1. + %** Overrides latex.ltx. Allows the page number extend beyond \@pnumwidth. + \def\@dottedtocline#1#2#3#4#5{% + \ifnum #1>\c@tocdepth \else + \vskip \z@ \@plus.2\p@ + {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip + \parindent #2\relax\@afterindenttrue + \interlinepenalty\@M + \leavevmode + \@tempdima #3\relax + \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip + {#4}\nobreak + \leaders\hbox{\(\m@th + \mkern \@dotsep mu\hbox{.}\mkern \@dotsep + mu\)}\hfill + \nobreak + \setbox\@tempboxa\hbox{\normalfont \normalcolor #5}% ****pts**** + \ifdim\wd\@tempboxa<\@pnumwidth\setbox\@tempboxa\hb@xt@\@pnumwidth{\hfil\unhbox\@tempboxa}\fi + \box\@tempboxa + \par}% + \fi} + \@gobble +{^}% + +% --- amslevelfix= + +% detect ams{ldoc,dtx,art,book,proc}.sty +\ifnum1<0% + \magyar@opt@@amslevelfix + \expandafter\ifx\csname setTrue\endcsname\relax\else 1\fi + \expandafter\ifx\csname allowttyhyphens\endcsname\relax\else 1\fi +\space\else\@@magyar@skiplong\fi + % Fix amsart.cls etc. so no Overfull \hbox occurs in the \listoffigures. + % Changes \@tocline{0}{3pt plus2pt}{0pt}{}{} to \@tocline{0}{3pt plus2pt}{0pt}{\parindent}{} + \def\magyar@amslevelfix#1#2#3#4#5#6#7\vfuzz{% + \def\reserved@a{#6}% + \ifx\@tocline#2\ifx\reserved@a\@empty% + \def#1{\@tocline{#3}{#4}{#5}{\parindent}{}}% + \fi\fi + } + \expandafter\magyar@amslevelfix\expandafter\l@table \l@table ,,,,,,,\vfuzz + \expandafter\magyar@amslevelfix\expandafter\l@figure\l@figure,,,,,,,\vfuzz + \@gobble +{^}% + +% --- amsuppercasefix= + +% Fix for small \'\i in capitalized title (no fix needed for \'i and ): +% \documentlcass{amsart} % amsart.cls +% \usepackage{t1enc} +% \usepackage[latin2]{inputenc} +% \author{author Anal{\'\i}{\'i}zis} +% \title {title Anal{\'\i}{\'i}zis} +% \begin{document} \maketitle a\newpage b\newpage c \end{document} +% This bug is a general amsart.cls bug, not specific to magyar.ldf. +\ifnum1<0% + \magyar@opt@@amsuppercasefix + \expandafter\ifx\csname altucnm\endcsname\relax\else 1\fi +\space\else\@@magyar@skiplong\fi + % textcase.sty is not available by default (Ubuntu 8.04 TeX Live), and + % newer amsart.cls doesn't have this bug (\'\i gets capitalized properly) + \AtEndOfPackage{\IfFileExists{textcase.sty}{\RequirePackage{textcase}}{}} + \@gobble +{^}% + +% --- babelmarkfix= + +% Fix the language name (\foreignlanguage{\languagename}}) appearing in +% \@evenhead. Reason: both amsart.cls and babel.def 3.8 redefine \markboth. +% (There is no problem in Babel 3.7.) +% This bug is a general Babel 3.8 + amsart.cls bug, not specific to +% magyar.ldf. +% +% Dat: amsart.cls redefines \markboth defined in latex.ltx +\ifnum0<0% + \magyar@opt@@babelmarkfix\relax +\space\else\@@magyar@skiplong\fi + \begingroup + %\def\foreignlanguage{\fffffff} % Dat: not called here + % Dat: usually called: \mark{\the\@temptokena} + %\def\mark#1{\showthe\@temptokena{\toks@{B#1}\global\edef\@@magyar@@marktest{\the\toks@}}} + %\def\mark#1{\global\def\@@magyar@@marktest{#1}} + \def\mark#1{\global\edef\@@magyar@@marktest{#1}} + \let\if@nobreak\iffalse \@gobble\fi\@gobble\fi % Dat: \@gobble: make skippable + \def\@@magyar@@marktest@noexp{{\noexpand\@empty BA}{\noexpand\@empty BB}} + \expandafter\org@markboth\@@magyar@@marktest@noexp + % ^^^ Dat: since we call \org@markboth, the result doesn't depend on the Babel + % version, i.e. how Babel redefines \markboth + % ^^^ Dat: call changes \@@magyar@@marktest + % amsart.cls -> {\noexpand \@empty BA}{\noexpand \@empty BB} + % article.cls -> {\@empty BA}{\@empty BB} + \ifx\@@magyar@@marktest\@@magyar@@marktest@noexp + % OK, now test for \markboth, as defined in Babel 3.8 + \def\org@markboth#1#2{\global\def\@@magyar@@marktest{#1..#2}}% + \markboth{CA}{CB}% + % ^^^ Dat: call changes \@@magyar@@marktest + % Babel 3.7 -> \foreignlanguage {magyar}{CA}..\foreignlanguage {magyar}{CB} + % Babel 3.8 -> \noexpand \foreignlanguage {\languagename }{\noexpand \bbl@restore@actives CA}..\noexpand \foreignlanguage {\languagename }{\noexpand \bbl@restore@actives CB} + \def\reserved@a#1#2\hfuzz${#1}% + \expandafter\expandafter\expandafter\ifx + \expandafter\expandafter\expandafter\noexpand + \expandafter\reserved@a\@@magyar@@marktest\relax\hfuzz$% + % Dat: we reach this if \@@magyar@@marktest starts by \noexpand + % Dat: So now we have amsart.cls + \markboth of Babel 3.8. + % The solution is to restore \markboth and \markright of Babel 3.7 + %\let\reserved@a\@empty \zzzzzz + \def\reserved@a{% + \let\markright\org@markright + \bbl@redefine\markright##1{% + \toks@{##1}% + \edef\bbl@tempa{% + \noexpand\org@markright{% + \noexpand\foreignlanguage{\languagename}{\the\toks@}}}% + \bbl@tempa + } + \let\markboth\org@markboth + \bbl@redefine\markboth##1##2{% + \toks@{##1}\toks8{##2}% + \edef\bbl@tempa{% + \noexpand\org@markboth{% + \noexpand\foreignlanguage{\languagename}{\the\toks@}}{% + \noexpand\foreignlanguage{\languagename}{\the\toks8}}}% + \bbl@tempa + }% + }% + \else \let\reserved@a\@empty + \fi + \else \let\reserved@a\empty + \fi + %\show\reserved@a \let\reserved@a\@empty + \global\let\@@magyar@@marktest\@undefined + \global\let\@@magyar@@marktest@noexp\@undefined + \expandafter\endgroup\reserved@a + \@gobble +{^}% + +% --- showfix= +% +% Fix stupid \def\show{...} in AtBeginDocument in ucsencs.def by restoring the original +% definition. + +\ifnum0<0% + \magyar@opt@@showfix\relax +\space\else\@@magyar@skiplong\fi + \def\magyar@stripcolon#1:#2\vfuzz{#2}% + \def\magyar@show@begin@fix{% + \edef\reserved@a{\expandafter\magyar@stripcolon\meaning\show:\vfuzz}% + \ifx\reserved@a\@empty\else % \show is a macro + \let\show\@@magyar@orig@show + \fi + } + \edef\reserved@a{\expandafter\magyar@stripcolon\meaning\show:\vfuzz}% + \ifx\reserved@a\@empty % \show is not a macro + \let\@@magyar@orig@show\show + \expandafter\gdef\expandafter\@preamblecmds\expandafter{% + \expandafter\magyar@show@begin@fix\@preamblecmds}% + %\show\@begindocumenthook + %\AtBeginDocument{\magyar@show@begin@fix}% + \fi + \@gobble +{^}% + +% --- captionfix= +% +% Fix ``1. bra'' order in \caption defined by caption.sty 2004/07/16 v3.0c. +% +% The manual fix would be: +% +% \DeclareCaptionLabelFormat{simpleMagyar}{#2.\bothIfSecond{\nobreakspace}{#1}} +% \let\caption@lfmt\caption@lfmt@simpleMagyar +% + +\if0\magyar@opt@@captionfix\@@magyar@skiplong\fi + \def\@@magyar@captionfix{\@ifundefined{caption@lfmt}{}{% + % Dat: only in preamble: \DeclareCaptionLabelFormat{simpleMagyar}{#2.\bothIfSecond{\nobreakspace}{#1}} + \def\caption@lfmt@simpleMagyar##1##2{##2.\bothIfSecond{\nobreakspace}{##1}}% + }} + \AtBeginDocument{\@@magyar@captionfix} + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \ifx\caption@lfmt\caption@lfmt@default % Imp: not if both undefined + \ifx\caption@lfmt@simpleMagyar\@undefined\else + \babel@save\caption@lfmt + \let\caption@lfmt\caption@lfmt@simpleMagyar + \fi + \fi} + \@gobble +{^}% + + +% --- shortrefcmds= + +\if0\magyar@opt@@shortrefcmds\@@magyar@skiplong\fi + \def\azr{\aref}% better than \let, because it won't keep old value + \def\Azr{\Aref} + \def\azp{\apageref} + \def\Azp{\Apageref} + \def\azc{\acite} + \def\Azc{\Acite} + \@gobble +{^}% + +% --- longcaption= + +\ifx\magyar@caption@centering\@empty\@@magyar@skiplong\fi + \def\magyar@caption@hsizecheck{\hsize} + % We don't emit the two dots of `1. tblzat.' here, because + % has already been emitted by \fnum@table etc. + % We apply some formatting depending on the longcaption= option. + % Dat: Gyurgyk, p95. says: `11. bra. Hajtsi vltozatok.' + \let\@@magyar@do@makecaption\relax% before .toc + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \@@magyar@do@makecaption} + \def\@@magyar@do@makecaption@captiontwo@yes{% + % Dat: caption2.sty or caption3.sty is loaded; do nothing. + } + \def\@@magyar@do@makecaption@captiontwo@no{% + %** @param #1 \fnum@table or \fnum@figure + \def\@makecaption##1##2{% + \vskip\abovecaptionskip + \sbox\@tempboxa{##1.\ ##2}% Dat: `: ' changed to `. ' to match Hungarian typography + \ifdim \wd\@tempboxa>\magyar@caption@hsizecheck\relax + {\magyar@caption@centering ##1.\magyar@caption@newline ##2\csname par\endcsname}% + \else + \global \@minipagefalse + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% + \fi + \vskip\belowcaptionskip}} + \AtBeginDocument{% + \expandafter\ifx\csname captionlabeldelim\endcsname\relax + \expandafter\ifx\csname caption@lsep@period\endcsname\relax + \let\@@magyar@do@makecaption\@@magyar@do@makecaption@captiontwo@no + \else + % Dat: caption3.sty is loaded, and it has caption@lsep defined + % Dat: \show\caption@lsep@colon % \long\def\caption@lsep@colon{: } + % Dat: \show\caption@lsep %\def\caption@lsep{\caption@lsep@colon} + \ifx\caption@lsep\caption@lsep@default + % There was no \captionsetup{labelsep=...} yet, so we set the + % default to period (dot). + % + % This sets \caption@lsep@default and \caption@lsep. + \caption@setdefaultlabelsep{period}% + \fi + \let\@@magyar@do@makecaption\@@magyar@do@makecaption@captiontwo@yes + \fi + \else + % Dat: caption2.sty is loaded (and has \def\captionlabeldelim{.} -- but it might have {:}) + % Dat: we now redefine {:} to {.} + % Dat: the user can force {:} by \def\captionlabeldelim{:\empty} + % Dat: this works now: \usepackage[german,french,magyar]{babel} \usepackage{caption2} \begin{document} \renewcommand*\captionfont{\itshape} \renewcommand*\captionlabelfont{\scshape} + \def\reserved@a{:}% + \ifx\reserved@a\captionlabeldelim \def\captionlabeldelim{.}\fi + \let\@@magyar@do@makecaption\@@magyar@do@makecaption@captiontwo@yes + \fi} + \@gobble +{^}% + +% --- labelenums= + +\if0\magyar@opt@@labelenums \@@magyar@skiplong\fi + \providecommand\@greekalph[1]{% + % We use the robust \ensuremath here, similarly to \def\@fnsymbol in + % latex.ltx. + \ensuremath{\ifcase#1\or\alpha\or\beta\or\gamma\or\delta% + \or\varepsilon\or\zeta\or\eta\or\vartheta\or\iota\or\kappa% + \or\lambda\or\mu\or\nu\or\xi\or\varphi\or\varpi\or\varrho% + \or\varsigma\or\tau\or\upsilon\or\chi\or\psi\or\omega% + \else\@ctrerr\fi}} + \expandafter\ifx\csname c@enumv\endcsname\relax + \@definecounter{enumv}% call this before \def\theenumv + \fi + \if3\magyar@opt@@labelenums + \def\theenumi {\@arabic \c@enumi} \def\labelenumi {\theenumi.} + \def\theenumii {\@alph \c@enumii} \def\labelenumii {\itshape\theenumii)} + \def\theenumiii{\@greekalph\c@enumiii}\def\labelenumiii{\itshape\theenumiii)} + \def\theenumiv {\@Alph \c@enumiv} \def\labelenumiv {\itshape\theenumiv)} + \def\theenumv {\@Roman \c@enumv} \def\labelenumc {\theenumv.} % Dat: I'm not sure + \else + \def\theenumi{\@Roman\c@enumi} \def\labelenumi{\theenumi.} + \def\theenumii{\@arabic\c@enumii} \def\labelenumii{\theenumii.} + % !! correct \ref style for \the + \if1\magyar@opt@@labelenums % hu-a + \def\theenumiii{\@alph\c@enumiii} \def\labelenumiii{\itshape\theenumiii)} + \def\theenumiv{\@greekalph\c@enumiv} \def\labelenumiv{\itshape\theenumiv)} + \def\theenumv{\@Alph\c@enumv} \def\labelenumv {\itshape\theenumv)} + \else% hu-A + \def\theenumiii{\@Alph\c@enumiii} \def\labelenumiii{\itshape\theenumiii)} + \def\theenumiv{\@alph\c@enumiv} \def\labelenumiv{\itshape\theenumiv)} + \def\theenumv{\@greekalph\c@enumv} \def\labelenumv {\itshape\theenumv)} + \fi + \fi + \def\reserved@a{% copied from latex.ltx + \ifnum \@enumdepth >\thr@@\@toodeep\else + \advance\@enumdepth\@ne + \edef\@enumctr{enum\romannumeral\the\@enumdepth}% + \expandafter\list + \csname label\@enumctr\endcsname + {\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}% + \fi} + \ifx\reserved@a\enumerate + \def\enumerate{% no \@enumdepth>3 + \advance\@enumdepth\@ne + \expandafter\ifx\csname labelenum\romannumeral\the\@enumdepth\endcsname\relax + \@toodeep\advance\@enumdepth\m@ne\else + \edef\@enumctr{enum\romannumeral\the\@enumdepth}% + \expandafter\list + \csname label\@enumctr\endcsname + {\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}% + \fi} + \fi + \@gobble +{^}% + +% --- labelitems= + +\if0\magyar@opt@@labelitems \@@magyar@skiplong\fi + \def\labelitemi{\textendash} + % vvv Dat: formerly 2.5pt + \def\labelitemii {\raise0.58ex\hbox{\scriptsize\textbullet}} + \def\labelitemiii{\raise0.58ex\hbox{\(\scriptstyle\circ\)}} + \def\labelitemiv {\raise0.58ex\hbox{\scriptsize\textasteriskcentered}} + \def\labelitemv {\raise0.58ex\hbox{\scriptsize\textperiodcentered}} + \def\reserved@a{% copied from latex.ltx + \ifnum \@itemdepth >\thr@@\@toodeep\else + \advance\@itemdepth\@ne + \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% + \expandafter\list + \csname\@itemitem\endcsname + {\def\makelabel##1{\hss\llap{##1}}}% + \fi} + \ifx\reserved@a\itemize + \def\itemize{% no \@itemdepth>3 + \advance\@itemdepth\@ne + \expandafter\ifx\csname labelitem\romannumeral\the\@itemdepth\endcsname\relax + \@toodeep\advance\@enumdepth\m@ne\else + \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% + \expandafter\list + \csname\@itemitem\endcsname + {\def\makelabel##1{\hss\llap{##1}}}% + \fi} + \fi + \@gobble +{^}% + +% --- postpara= and postsubpara= and postdescription= + +\expandafter\ifx\csname magyar@opt@@paragraphs\endcsname\relax\@@magyar@skiplong\fi + % Dat: We make sure that hspaces emitted by \magyar@post@... are unstretchable + \def\magyar@post@dot{.\enskip}% + \def\magyar@post@bfdot{\textbf.\enskip}% + \let\magyar@post@quad\quad% not recommended in Hungarian + \let\magyar@post@enskip\enskip% not recommended in Hungarian + \def\magyar@post@em{\hskip1em\relax}% + \let\magyar@post@empty\@empty + %** from Gyurgy\'ak J\'anos: Szerkeszt\H{o}k \'es szerz\H{o}k k\'ezik\"onyve. + %** We don't have a square-shaped, black diamond in our math fonts :-(. + \def\magyar@post@diamond{% + \enskip\raise.5ex\hbox{\font\f=msam10 at1.3ex \f\char7}\enskip%\ignorespaces% raised \blacklozenge + %{\usefont{U}{msa}{m}{n}\small\char7} + } + \def\magyar@post@star{\enskip\({}^*\)\enskip}% + \def\magyar@post@endash{ -- }% + \def\magyar@post@semicolon{:\enskip}% + \def\magyar@first#1#2\vfuzz{\noexpand#1}% + %** Calls \magyar@pf@lowb, and never emits code resulting from #3 to TOC + %** @param #1 empty or `*' + %** @param #2 \@startsection{...}{...}... call + %** @param #3 \paragraph or \subparagraph (selects one of \magyar@post@...) + %** @param #4 paragraph title text + \def\magyar@pf@lowa#1#2#3#4{% + \if#1*\relax + \bbl@afterelse\magyar@pf@lowb*% + \else + \bbl@afterfi \magyar@pf@lowb{[#4]}% + \fi + {#2}{#3}{#4}% + }% + % !! a less obscure way for \paragraph, without -1sp etc. + %** Calls \magyar@pf@lowb, and never emits code resulting from #3 to TOC + %** @param #1 \@startsection{...}{...}... call + %** @param #2 \paragraph or \subparagraph (selects one of \magyar@post@...) + %** @param #3 paragraph title text + %** @param #4 [...] arg to \paragraph + \def\magyar@pf@lowc#1#2#3[#4]{% + \magyar@pf@lowb{[#4]}{#1}{#2}{#3}% + }% + %** Calls \magyar@post@paragraph and \magyar@post@subparagraph + %** @param #1 [#4] or `*' (what goes to TOC?) + %** @param #2 \@startsection{...}{...}... call + %** @param #3 \paragraph or \subparagraph + %** @param #4 paragraph title text + \def\magyar@pf@lowb#1#2#3#4{% + #2#1{#4\csname magyar@post@\expandafter\@gobble\string#3\endcsname\kern\z@}% + % ^^^ Dat: \kern\z@ is needed so \unskip won't occur at \paragraph* + % ^^^ Dat: {#4\csname...} is needed so \magyar@post@dot makes a {\bf.} + % Dat: \ignorespaces is superflous here, it also doesn't ignore \par + }% + %** Fixes (redefines) the specified macro so postpara= and postsubpara= + %** takes effect. It is useful to call this after a `\renewcommand\paragraph' + %** in a package. Has no effect if the definition of #1 doesn't look like + %** the one in article.cls (i.e. \@startsection) or if it's not defined + %** (such as in beamer.cls). + %** @param #1 \paragraph or \subparagraph + \def\magyar@paragraphfix#1{% + \ifx#1\@undefined\else + % Change only if defined. + \expandafter\magyar@paragraphfix@defined\expandafter#1\fi + } + \def\magyar@paragraphfix@defined#1{% + \expandafter\magyar@pf@lowd\expandafter#1#1\hfuzz........\vfuzz + } + \def\magyar@pf@lowd#1#2#3#4#5#6#7#8#9\vfuzz{% + % Dat: \unskip doesn't work, have to change \hskip to -1sp: 1sp is the + % amount of horizontal space between the diamond and the paragraph text + % 0sp would be bad, because it isn't negative (positive skips are + % interpreted as vertical). + %% + \expandafter\def\expandafter\reserved@a\expandafter{\magyar@first#9\vfuzz}% + %\def\reserved@a{#9}\ifx\reserved@a\@empty + \if\reserved@a\hfuzz\ifx#2\@startsection\if-\magyar@first#7\vfuzz + \def#1{\@ifstar + {\magyar@pf@lowa *{#2{#3}{#4}{#5}{#6}{-1sp}{#8}}#1}% + {\@ifnextchar[%] + {\magyar@pf@lowc{#2{#3}{#4}{#5}{#6}{-1sp}{#8}}#1}% + {\magyar@pf@lowa{}{#2{#3}{#4}{#5}{#6}{-1sp}{#8}}#1}% + }% + }% + \fi\fi\fi + } + % !! Imp: change Hungarian \paragraphs only, with dual load + \expandafter\ifx\csname magyar@opt@@postpara\endcsname\relax\else + \magyar@paragraphfix\paragraph + \expandafter\let\expandafter\magyar@post@paragraph\csname magyar@post@\magyar@opt@@postpara\endcsname + \ifx\magyar@post@paragraph\relax + \@@magyar@error{Invalid arg for option: postpara = \magyar@opt@@postpara}% + \fi + \fi + \expandafter\ifx\csname magyar@opt@@postsubpara\endcsname\relax\else + \magyar@paragraphfix\subparagraph + \expandafter\let\expandafter\magyar@post@subparagraph\csname magyar@post@\magyar@opt@@postsubpara\endcsname + \ifx\magyar@post@subparagraph\relax + \@@magyar@error{Invalid arg for option: postsubpara = \magyar@opt@@postsubpara}% + \fi + \fi + \expandafter\ifx\csname magyar@opt@@postdescription\endcsname\relax\else + \expandafter\let\expandafter\magyar@post@description\csname magyar@post@\magyar@opt@@postdescription\endcsname + \ifx\magyar@post@description\relax + \@@magyar@error{Invalid arg for option: postdescription = \magyar@opt@@postdescription}% + \fi + \def\magyar@@descriptionfont{\normalfont\bfseries}% + \def\descriptionlabel#1{\hskip\labelsep{\magyar@@descriptionfont#1}\magyar@post@description\hskip-\labelsep}% + \fi + \@gobble +{^}% + +% --- afterindent= + +\ifnum\magyar@opt@@afterindent>8 \@@magyar@skiplong\fi + \ifnum\magyar@opt@@afterindent<1 % force-no + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\@afterindenttrue + \let\@afterindenttrue\@afterindentfalse + }% + \else% force-yes + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\@afterindentfalse + \let\@afterindentfalse\@afterindenttrue + }% + \fi + \@gobble +{^} + +% --- default \frenchspacing; frenchspacing= + +\if0\magyar@opt@@frenchspacing \@@magyar@skiplong\fi + \if1\magyar@opt@@frenchspacing% =no + \def\@@magyar@antifrenchspacing{% only does some caching + \ifnum\the\sfcode`\.=\@m + \nonfrenchspacing + \let\@@magyar@nonfrenchspacing\frenchspacing + \else + \let\@@magyar@nonfrenchspacing\relax + \fi} + \let\@@magyar@nonantifrenchspacing\frenchspacing + \expandafter\addto\csname extras\CurrentOption\endcsname{\@@magyar@antifrenchspacing} + \expandafter\addto\csname noextras\CurrentOption\endcsname{\@@magyar@nonantifrenchspacing} + \else + \expandafter\addto\csname extras\CurrentOption\endcsname{\bbl@frenchspacing} + \expandafter\addto\csname noextras\CurrentOption\endcsname{\bbl@nonfrenchspacing} + \fi + \@gobble +{^} + + +% --- Putting dots after section number in toc/lof/lot; sectiondot= +% +% This is to have a dot after figure/table numbers in lof/lot and +% section numbers in toc. +% +% The option sectiondot= is ill-named, because it doesn't apply to what is +% displayed in \section, but it applies to \tableofcontents, \listoftables +% and \listoffigures. + +\if0\magyar@opt@@sectiondot \@@magyar@skiplong\fi + \ifnum\magyar@opt@@sectiondot>1 + % This solution (for sectiondot=problematic) is what was provided by + % magyar.ldf v1.4. It is incomatible with lots of packages. + % + % [pts] This doesn't work with nameref.sty. + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\@caption + \long\def\@caption#1[#2]#3{% + \csname par\endcsname + \addcontentsline{\csname ext@#1\endcsname}{#1}% + {\protect\numberline{\csname the#1\endcsname.}{\ignorespaces #2}}% + \begingroup + \@parboxrestore + \if@minipage + \@setminipage + \fi + \normalsize + \@makecaption{\csname fnum@#1\endcsname}% + {\ignorespaces #3}\csname par\endcsname + \endgroup}} + + % [pts] This is incompatible with some packages. + \expandafter\addto\csname extras\CurrentOption\endcsname{% + % Alas, \@sect must also be redefined to have that dot in toc too. + % On the other hand, we include a dot after a run-in head. + \babel@save\@sect + \def\@sect#1#2#3#4#5#6[#7]#8{% + \ifnum #2>\c@secnumdepth + \let\@svsec\@empty + \else + \refstepcounter{#1}% + \protected@edef\@svsec{\@seccntformat{#1}\relax}% + \fi + \@tempskipa #5\relax + \ifdim \@tempskipa>\z@ + \begingroup + #6{% + \@hangfrom{\hskip #3\relax\@svsec}% + \interlinepenalty \@M #8\@@par}% + \endgroup + \csname #1mark\endcsname{#7}% + \addcontentsline{toc}{#1}{% + \ifnum #2>\c@secnumdepth \else + \protect\numberline{\csname the#1\endcsname.}% + \fi + #7}% + \else + \def\@svsechd{% + #6{\hskip #3\relax + \@svsec #8.}% + \csname #1mark\endcsname{#7}% + \addcontentsline{toc}{#1}{% + \ifnum #2>\c@secnumdepth \else + \protect\numberline{\csname the#1\endcsname.}% + \fi + #7}}% + \fi + \@xsect{#5}}} + + % [pts] This is incompatible with some packages. + \expandafter\addto\csname extras\CurrentOption\endcsname{% + % In order to have that dot after a run-in head when the star form of the + % sectioning commands is used, we have to redefine \@ssect + \babel@save\@ssect + \def\@ssect#1#2#3#4#5{% + \@tempskipa #3\relax + \ifdim \@tempskipa>\z@ + \begingroup + #4{% + \@hangfrom{\hskip #1}% + \interlinepenalty \@M #5\@@par}% + \endgroup + \else + \def\@svsechd{#4{\hskip #1\relax #5.}}% + \fi + \@xsect{#3}}} + \else + % This implements option sectiondot=safe. + % + % [pts] We definitely want \numberline to emit table number in \listoftables as + % `5.6.' instead of the default `5.6', but we don't want to redefine \@caption, + % because the # args \addcontentsline adds to \contentsline depends on whether + % nameref.sty (hyperref.sty) is loaded (no nameref: 3, w/ nameref: 4); this + % would cause the strange `Package hyperref Warning: No destination for + % bookmark of \addcontentsline'. + % So we rather redefine \numberline. But we cannot simply add a dot, because + % it might be already present (e.g in \tableofcontents). So we add a dot only + % if it is missing. This modification affects \tableofcontents, \listoffigures + % and \listoftables. The presence of the dot in TOC depends on the language + % the section was defined in. + % amsart.sty uses \tocsection instead of \numberline, see amstocnumskip= + % below + \def\magyar@striplastdot@lowa#1.\relax{#1\relax}% + \def\magyar@striplastdot@lowb#1\relax#2\relax{#1}% + %** \@tempdima is set by \@dottedtocline, called by \l@section + \def\magyar@numberline#1\vfuzz{\hb@xt@\@tempdima{#1.\hfil}}% + \def\@@magyar@numberline@pre#1{% + \expandafter\expandafter\expandafter\magyar@numberline + \expandafter\magyar@striplastdot@lowb\magyar@striplastdot@lowa#1\relax.\relax\vfuzz + }% + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\numberline + %** Overrides latex.ltx + \let\numberline\@@magyar@numberline@pre + } + \fi + \@gobble +{^} + +% --- amspostsectiondot= + +\if0\magyar@opt@@amspostsectiondot \@@magyar@skiplong\fi + % Now fix ams*.cls so that they don't put a dot after the section title. + % First check whether the definition of \@sect contains + % \global\@nobreaktrue\@xsect + \long\def\@@magyar@amssect@fixa#1\global\@nobreaktrue\@xsect#2\hfuzz#3{% + \ifx\hfuzz#2\hfuzz\else% found + \@@magyar@amssect@fixb#3\fi} + %** @param #1 a \cs, e.g \@sect + \def\@@magyar@amssect@fixb#1{% + \expandafter\let\csname @@magyar@amssect@saved\string#1\endcsname#1% + \edef#1{\noexpand\expandafter\noexpand\@@magyar@amssect@low + \expandafter\noexpand\csname @@magyar@amssect@saved\string#1\endcsname}% + \let\@svsechd\@empty% prevent Undefied \cs + %** Definition of \@sect in ams*.cs ends by `\global\@nobreaktrue{#5}' + \long\def\@@magyar@amssect@low##1\global\@nobreaktrue{% + ##1% + \expandafter\def\expandafter\@svsechd\expandafter{% + \expandafter\let\expandafter\@addpunct\expandafter\@gobble \@svsechd}% + \global\@nobreaktrue + }% + } + \expandafter\@@magyar@amssect@fixa\@sect[][][][][][][][]\global\@nobreaktrue\@xsect\hfuzz\@sect + \expandafter\@@magyar@amssect@fixa\@sect[][][][][][][][]\global\@nobreaktrue\@xsect\hfuzz\NR@sect% with nameref.sty + \@gobble +{^}% + +% --- amstocnumskip=, amstocnumlang= +% +% Change \tocsection, \tocsubsection etc. in amsart.cls etc. These commands +% have effect in \tableofcontents, e.g. in the .toc file: +% `\contentsline {section}{\tocsubsection {}{1.1}{Foo}}{1}' +% +% We should be careful not to define \tocchapter and \tocsection if +% tocbibind.sty is (or will be) loaded, because it provides its own definition +% as \newcommand. + +\ifx\@empty\magyar@opt@@amstocnumskip \@@magyar@skiplong\fi + % Similar to titleskip=, but AMS classes don't look at \@seccntformat + \def\@@magyar@amstocnumskip@lets{% + \ifx\tocsubsection\@undefined\else + \ifx\tocsubsection\tocparagraph + \def\tocsubsection{\tocsection}% + % These lines are similar to those in amsart.cls. + \let\tocsubsubsection\tocsubsection + \let\tocparagraph\tocsubsection + \let\tocsubparagraph\tocsubsection + \let\tocpart\tocsubsection + \let\tocchapter\tocsubsection + \fi + \fi + }% + \def\@@magyar@amstocnumskip@defs{% + \ifx\tocsubsection\@undefined\else + \ifx\tocsubsection\tocparagraph + %** Overrides amsart.cls, amsbook.cls etc. + %** Only for Hungarian \section{}s. Changes \quad to + %** \magyar@opt@@amstocnumskip in the definition. Also changes + %** ``fejezet 1'' to ``1. fejezet'' for \chapter + %** (We have \def\tocchapter{\tocsection} by default.) + \def\tocsection##1##2##3{% + %%\typeout{--##3--}% + \indentlabel{% + \def\reserved@a{##1}% + \def\reserved@b{##2}% + \ifx\reserved@b\empty + \else\ifx\reserved@a\chaptername + % * Sometimes (but not in \tableofcontents) #1 is + % `\csname chaptername\endcsname'. Why? + % * \tocappendix is called instead of \tocsection for the + % appendix. + \ifnum\magyar@opt@@chapternumber=1 \@huordinal{##2}~% + \else\ifnum\magyar@opt@@chapternumber=2 \@Huordinal{##2}~% + \else##2.~% + \fi\fi + ##1.\magyar@opt@@amstocnumskip + \else\ifx\reserved@a\partname + \ifnum\magyar@opt@@partnumber=1 \@huordinal{##2}~% + \else\ifnum\magyar@opt@@partnumber=2 \@Huordinal{##2}~% + \else##2.~% + \fi\fi + ##1.\magyar@opt@@amstocnumskip + \else + \ignorespaces##1 ##2.\magyar@opt@@amstocnumskip + \fi\fi\fi}% + ##3}% + %** Overrides amsart.cls etc. Only for Hungarian \section{}s. Changes \quad to + %** \magyar@opt@@amstocnumskip in the definition. + \def\tocappendix##1##2##3{% + \indentlabel{% + \def\reserved@a{##1}% + \ifx\reserved@a\appendixname + ##2\ifx\@@magyar@appendixname\@empty.\fi~##1% + \else + ##1\@ifnotempty{##2}{ ##2}% + \fi + .\magyar@opt@@amstocnumskip}% + ##3}% + \fi + \fi + }% + \AtBeginDocument\@@magyar@amstocnumskip@lets % must be before @defs + \if2\magyar@opt@@amstocnumlang + \AtBeginDocument\@@magyar@amstocnumskip@defs + %\let\@@magyar@amstocnumskip@defs\@undefined% for use by the user + \else + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\tocsection \babel@save\tocappendix + \@@magyar@amstocnumskip@defs + } + \fi + \@gobble +{^}% + + +% --- Fixup Babel language selection glitches; toclang= + +% There are fundamental problem of emitting \select@language items in LOT +% files. +% +% Problem (3): When using \begin{table}...\end{table} \selectlanguage{foo} +% \begin{table}...\end{table}, the LaTeX-Babel scheme will not emit a +% \select@language{foo} between the two \contentsline{}s in \jobname.lot. The +% TOC file is OK, because section titles aren't floats. (But what about +% \mark{}s?). +% +% Problem (1): \selectlanguage emits .aux entries even +% if the language isn't really changed. +% +% Problem (2): babel.def has +% `\AtBeginDocument...\selectlanguage...\bbl@main@language', from which an +% \immediate is missing, so the \select@language is emitted to the .aux file +% after the first float has been typeset. A better solution would be +% `\select@language{\languagename}', which forcibly activates the default +% language. +% +% Problem (4): \ps@headings isn't run \AtBeginDocument, but book.cls runs +% \pagestyle{headings} when it is loaded. We should change this to +% \AtBeginDocument or similar. + +\ifnum\magyar@opt@@toclang=0 \@@magyar@skiplong\fi + \ifnum\magyar@opt@@toclang>1 % toclang=good + % Solve problems (2) and (4). Timing is critical. \select@language must + % be called after \AtBeginDocument, so \catcode{}s won't be \activated + % too early. (Because some code in \AtBeginDocument might issue an + % \input such as hyperref.sty which does \RequirePackage{nameref}.) + % Note that \extrasmagyar containing the \catcode changes is + % only run when `magyar' is the default language (last arg of + % \usepackage[...]{babel}). If that is run after \AtBeginDocument hooks, + % then most packages will use 12 as \catcode\string``, which is intended. + % \@@magyar@setup@psheadings might just be run \AtBeginDocument, it doesn't + % need \@preamblecmds -- but it must be after \select@language. + % + % \@preamblecmds is expanded after \@begindocumenthook + \expandafter\gdef\expandafter\@preamblecmds\expandafter{\@preamblecmds + \@@magyar@setup@psheadings% Solve problem (4). Before \selectlanguage. + \select@language{\languagename}% force initial language + }% + % Solve problem (1) and assist solving problem (2) by not emitting + % \select@language twice. + \def\bbl@set@language#1{% + \edef\@Lang@tmp{% + \ifcat\noexpand\noexpand\noexpand#1% a control sequence + \expandafter\expandafter\expandafter\@gobble\expandafter\string + \fi + #1% + }% + \ifx\languagename\@Lang@tmp\else + \let\languagename\@Lang@tmp + \select@language{\languagename}% + \fi + }% + % Solve problem (3). + \long\def\addtocontents#1#2{% + % Dat: \noexpand should be avoided in \protected@write + \protected@write\@auxout + {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble \let\select@language\relax}% + {\string\@writefile{#1}{\string\select@language{\languagename} #2}}} + \else + % Solve problems (2) and (4). + \AtBeginDocument{% + \if@filesw \immediate\write\@mainaux{% + \string\select@language{\languagename}% + \string\@writefile{toc}{\string\select@language{\languagename}}% + \string\@writefile{lof}{\string\select@language{\languagename}}% + \string\@writefile{lot}{\string\select@language{\languagename}}% + }\fi + \@@magyar@setup@psheadings% Solve problem (4). Before \selectlanguage. + \select@language{\languagename}% force initial language + } + % Solve problem (1) and assist solving problem (2) by not emitting + % \select@language twice. + \def\bbl@set@language#1{% + \edef\@Lang@tmp{% + \ifcat\noexpand\noexpand\noexpand#1% a control sequence + \expandafter\expandafter\expandafter\@gobble\expandafter\string + \fi + #1% + }% + \ifx\languagename\@Lang@tmp\else + \let\languagename\@Lang@tmp + \select@language{\languagename}% + \if@filesw \protected@write\@auxout{}{% + \string\select@language{\languagename}% + \string\@writefile{toc}{\string\select@language{\languagename}}% + \string\@writefile{lof}{\string\select@language{\languagename}}% + \string\@writefile{lot}{\string\select@language{\languagename}}% + \fi}% + \fi + }% + % Don't solve problem (3). + \fi + \@gobble +{^}% + +% --- suggestions= + +\ifnum\magyar@opt@@suggestions=0 \@@magyar@skiplong\fi + % Dat: buggy varioref.sty adds this to extrasmagyar (\AtBeginDocument is + % buggy, can be used only in the preamble. + % \def\reftextfaceafter {a k\"o\-vet\-kez\H{o} ol\-da\-lon}% + % \def\reftextfacebefore{az el\H{o}\-z\H{o} ol\-da\-lon}% + % \def\reftextafter {a k\"o\-vet\-kez\H{o} ol\-da\-lon}% + % \def\reftextbefore {az el\H{o}\-z\H{o} ol\-da\-lon}% + % \def\reftextcurrent {ezen az ol\-da\-lon}% + % \def\reftextfaraway#1{\aza{\pageref{#1}} \pageref{#1}.~ol\-da\-lon}% + % \def\reftextpagerange#1#2{\vref@stringwarning\reftextpagerange + % on pages~\pageref{#1}--\pageref{#2}}% + % \def\reftextlabelrange#1#2{\vref@stringwarning\reflabelpagerange + % \ref{#1} to~\ref{#2}}% + % \AtBeginDocument{\providecommand\aza[1]{a/az% + % \PackageError{varioref}{% + % Proper definition for command \noexpand\aza missing}% + % {You need to (re)define the command \noexpand\aza that + % takes one argument (a number or a \noexpand\pageref command) + % and produces the string `a' or `az' depending on the argument + % value. It should also accept an optional argument (default `l') + % to denote whether or not the string should be lowercase or + % uppercase.}}}% + \def\@@magyar@ignorehbox@pree#1\hbox$#2{}%$ + %\def\@@magyar@grep@reftextcurrent#1\def\reftextcurrent#2\hbox$ + \def\@@magyar@grep@reftextbegin#1\def\reftextfaceafter#2\hfuzz\hfuzz\hfuzz#3\hbox$#4{%$ + \toks@={#1#3}% Dat: # -> ## conversion for \def + \expandafter\global\expandafter\edef\csname extras#4\endcsname + {\the\toks@}% + } + \def\@@magyar@grep@reftextcurrent#1\def\reftextlabelrange#2#3#4#5#6% + \AtBeginDocument#7#8\hbox$#9{%$ Dat: no need for \long\def + % ^^^ Dat: Don't use `#21', because then #2 would match multiple tokens + \ifx#31% found real data, not sentinel + \PackageWarningNoLine{#9.ldf}{Do not load buggy \string\usepackage[magyar]{varioref},\MessageBreak load simply \string\usepackage{varioref}}% + % vvv remove code inserted by varioref.sty + \@@magyar@grep@reftextbegin#1\hfuzz\hfuzz\hfuzz#8\hbox${#9}%$ + \fi + } + \def\magyar@sugg@vr#1{% + \expandafter\expandafter\expandafter\@@magyar@grep@reftextcurrent + \csname extras#1\endcsname\hbox${#1}\@@magyar@ignorehbox@pree%$ + \def\reftextlabelrange23456\AtBeginDocument78\hbox${#1}%$ + } + \def\magyar@sugg@to#1{% + \def\reserved@a{T1} + \edef\reserved@b{\encodingdefault}% \encodingdefault is \long for t1enc.sty, but not for fontenc.sty + \ifx\reserved@a\reserved@b\else + \@latex@warning@no@line{Please use \string\usepackage{t1enc} with\MessageBreak \string\usepackage[#1]{babel}, to get accented chars hyphenated}% + % ^^^ Dat: \usepackage[T1]{fontenc} is equally good, but less effective + \fi + } + \def\magyar@sugg@ie@lowb#1{\@latex@warning@no@line{% + Please use \string\usepackage[latin2]{inputenc}\MessageBreak + or \string\usepackage[utf8]{inputenc}\MessageBreak + with \string\usepackage[#1]{babel}}}% + %** @param #1 empty (old) or \protect + %** @param #2 input encoding name + \def\magyar@sugg@ie@low#1\@inpenc@undefined@#2#3\vfuzz#4{% + \def\reserved@b{#2}% + \def\reserved@a{latin2}% + \ifx\reserved@a\reserved@b\else + \def\reserved@a{utf8}% + \ifx\reserved@a\reserved@b\else + \def\reserved@a{utf8x}% + \ifx\reserved@a\reserved@b\else + \def\reserved@a{cp1250}% + \ifx\reserved@a\reserved@b\else + \magyar@sugg@ie@lowb{#4}% + \fi + \fi + \fi + \fi + } + \def\magyar@sugg@ie#1{% + % Dat: don't print warning for missing \usepackage + \expandafter\ifx\csname @inpenc@undefined\endcsname\relax + \magyar@sugg@ie@lowb{#1}% + \else + % from inputenc.sty: \edef\@inpenc@undefined{\noexpand\@inpenc@undefined@{#1}}% + % > \@inpenc@undefined=macro: + % ->\@inpenc@undefined@ {latin2}. + \expandafter\magyar@sugg@ie@low\@inpenc@undefined....\vfuzz{#1}% + \fi + }% + \def\magyar@sugg@af#1{% + \expandafter\ifx\csname#1Options\endcsname\relax\else + \PackageWarningNoLine{#1.ldf}{No effect of \string\def\@backslashchar #1Options{...}\MessageBreak + please move it before \string\usepackage[#1]{babel}}% + \fi + }% + \def\@@magyar@@ps@fancy{\relax}%\@fancyplainfalse\ps@@fancy}% + \def\magyar@sugg@fh#1{% + \ifx\ps@fancy\@@magyar@@ps@fancy + \PackageWarningNoLine{#1.ldf}{No effect on fancyhdr.sty,\MessageBreak + please load it before \string\usepackage[#1]{babel}}% + \fi + }% + \def\magyar@sugg@ap#1{% + \expandafter\ifx\csname opt@#1.ldf.sty\endcsname\relax\else + \PackageWarningNoLine{#1.ldf}{No effect of \@backslashchar PassOptionsToPackage{?}{#1.ldf}\MessageBreak + please move it before \string\usepackage[#1]{babel}}% + \fi + }% + \edef\reserved@a{\noexpand\AtBeginDocument{% + \noexpand\magyar@sugg@pa{\CurrentOption}% + \noexpand\magyar@sugg@af{\CurrentOption}% + \noexpand\magyar@sugg@ap{\CurrentOption}% + \noexpand\magyar@sugg@to{\CurrentOption}% + \noexpand\magyar@sugg@ie{\CurrentOption}% + \noexpand\magyar@sugg@vr{\CurrentOption}% + \noexpand\magyar@sugg@fh{\CurrentOption}% + }}\reserved@a + \@gobble +{^}% + +% --- Active characters and shorthands; active=, activeprefix=, activespace= + +\ifnum0=\magyar@opt@@activespace\magyar@opt@@active\space + \def\@@magyar@declare@shorthandx#1#2{% + \expandafter\def\csname @@magyar@shorthand@\string#1\endcsname{#2}% + } +\@@magyar@skiplong\fi + \def\magyar@activate@shorthands{% + \edef\reserved@a{% + \noexpand\addto\expandafter\noexpand\csname extras\CurrentOption\endcsname + {\noexpand\languageshorthands{\CurrentOption}}% + } + \reserved@a + \let\magyar@activate@shorthands\relax + } + \let\@@magyar@saved@initiate@active@char\initiate@active@char + % + % vvv Fri Oct 1 18:09:55 CEST 2004 + % This is the ultimate fix of the .aux file catcodes when + % \usepackage[german,magyar]{babel} or + % \usepackage[french,magyar]{babel}. + % This enforces \catcode\string``=12 very early into the .aux file. + % Imp: don't let \catcode``\active too early... + {\toks@\expandafter{\expandafter\@@magyar@protect@backtick\@begindocumenthook}% + \xdef\@begindocumenthook{\the\toks@}}% Dat: \@begindocumenthook has #1 #2 etc. + \def\@@magyar@protect@backtick{% + \if@filesw\immediate\write\@auxout{\catcode\noexpand\string``=12}\fi} + % + %** @param #1 a non-active char token + %** @param #2 activation type: 0, 1, 2 or 3 + % !! quick link to \@@magyar@shorthand + \def\magyar@activate@char#1#2{% + \ifnum#2>1 % ignore 0 and 1 + \ifnum#2>2 % 3 + % SUXX, breaks compatibility with graphicx.sty and hyperref.sty and possibly + % with many other packages using \catcode`` etc. + %** Fix .aux load timing bug. + \AtBeginDocument{% + \if@filesw\immediate\write\@auxout{\catcode\noexpand\string`#1=12}\fi + } + \initiate@active@char{#1}% + \else% 2 + % Dat: german.ldf emits `\catcode`"\active'; we should emit our + % catcode change (\catcode\string``=12) before that + % Dat: this works only with \usepackage[magyar,german,magyar]{babel}, + % not with \usepackage[german,magyar]{babel} + % solution: \AtBeginDocument{\if@filesw\immediate\write\@auxout{\catcode\noexpand\string`#1=12}\fi} + \let\magyar@saved@AtBeginDocument\AtBeginDocument + \let\AtBeginDocument\@gobble + % vvv Calls \AtBeginDocument to set \catcode to \active and also write such a + % line to the .aux file. We just ignore it. + \initiate@active@char{#1}% + \let\AtBeginDocument\magyar@saved@AtBeginDocument + \let\magyar@saved@AtBeginDocument\@undefined + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@savevariable{\catcode\string`#1}% + \catcode\string`#1=13 % + }% + \fi + % Dat: now #1 is \active (done by \initiate@active@char) + \lccode\string`~=\string`#1\lowercase{% Dat: luckily everything below is in lowercase + \expandafter\addto\csname extras\CurrentOption\endcsname {\bbl@activate{~}}% + \expandafter\addto\csname noextras\CurrentOption\endcsname{\bbl@deactivate{~}}% + } + \lccode\string`~=0 + \catcode\string`#1=12 % Imp: restore _old_ catcode + \fi + } + %** @param #1 shorthand prefix character (depends on activeprefix=) + %** @param #2 a single character (will be prefixed) + %* @param #3 TeX code + \def\@@magyar@declare@shorthand@low#1#2#3{% + \declare@shorthand{\CurrentOption}{#1#2}{#3}% + } + \edef\@@magyar@shorthandprefix{\string`}% + %** @param #1 a single character (will be prefixed by ``' etc.) + %* @param #2 TeX code + %\def\@@magyar@declare@shorthand#1#2{\magyar@opt@@activeprefix#1{#2}}% defined below + \ifx\magyar@opt@@activeprefix\relax + \def\magyar@opt@@active{0}% =none + \def\magyar@opt@@openqq{0}% =unchanged (this must be defined before processing openqq below) + \else\edef\@@magyar@declare@shorthand#1#2{\noexpand\@@magyar@declare@shorthand@low\expandafter\string\magyar@opt@@activeprefix#1{#2}}\fi + %\magyar@activate@shorthands% not yet + \def\@@magyar@declare@shorthandx#1#2{% + \magyar@activate@shorthands + \expandafter\def\csname @@magyar@shorthand@\string#1\endcsname{#2}% + \expandafter\@@magyar@declare@shorthand\expandafter#1\expandafter{\csname @@magyar@shorthand@\string#1\endcsname}% + } + \@gobble +{^}% + +%** Call \@@magyar@shorthand@... For example: {`tty} and +%** {\@@magyar@shorthand tty} are interchangeable. +%** @param #1 a char token. +\def\@@magyar@shorthand#1{% + \expandafter\ifx\csname @@magyar@shorthand@\string#1\endcsname\relax + \@@magyar@error{Unknown shorthand: \string#1 }% + \else + \expandafter\expandafter\csname @@magyar@shorthand@\string#1\endcsname + \fi +} + +% --- activespace= Extra \thispace before :, ;, ! and ? +% +% french.ldf has \space after `:', but we only have \thinspace + +\ifnum\magyar@opt@@activespace=0 \@@magyar@skiplong\fi + %** @param #1 any of : ; ! ? + \def\magyar@thinspaced#1{% + % Dat: `!' at the end of the word is OK, but at the beginning it makes the + % word unhyphenatable. Imp: maybe \nobreak\hskip\z@skip? + % Dat: this is math-mode safe, because \ifhmode is false in math mode + \ifhmode% \ifhmode and \ifmmode are never true + \ifdim\lastskip>\z@ + \unskip\penalty\@M\kern.1em% \thinspace is .16667em + \else + \kern.1em + \fi + \fi + \string#1% + } + \magyar@activate@shorthands + \magyar@activate@char;\magyar@opt@@activespace + \declare@shorthand{\CurrentOption}{;}{\magyar@thinspaced;} + \magyar@activate@char!\magyar@opt@@activespace + \declare@shorthand{\CurrentOption}{!}{% + \ifmmode + \expandafter\ifx\csname factorial\endcsname\relax\mathchar"5021 \else\factorial\fi + \else\magyar@thinspaced!\fi} + % ^^^ compatibility with nath.sty + \magyar@activate@char?\magyar@opt@@activespace + \declare@shorthand{\CurrentOption}{?}{\magyar@thinspaced?} + \magyar@activate@char:\magyar@opt@@activespace + \declare@shorthand{\CurrentOption}{:}{\magyar@thinspaced:} + \@gobble +{^}% + + +% --- active= +% +% Dat: active=safe isn't safe unless other .ldf files used don't call +% \initiate@active@char{`}. +% +% `` `' `= `_ `-- `- `| `< `> `" `~ etc. + +\ifnum\magyar@opt@@active=0 + \ifnum\magyar@opt@@openqq>0 \@@magyar@error{active=none implies openqq=unchanged}\fi +\@@magyar@skiplong\fi + \ifnum\magyar@opt@@active>1 + \magyar@activate@shorthands% Dat: don't do it if \magyar@opt@@active=0 + \expandafter\magyar@activate@char\magyar@opt@@activeprefix\magyar@opt@@active + \fi + % + \ifnum\magyar@opt@@openqq>1 % =down + % Same as in in ukraineb.ldf + \@@magyar@declare@shorthandx`{\glqq}% down 99 \glqq is Babel's macro containing \quotedblbase + \@@magyar@declare@shorthandx'{\grqq}% up 66 + \else\ifnum\magyar@opt@@openqq>0 % =up + \@@magyar@declare@shorthandx`{\grqq}% up 66 + \@@magyar@declare@shorthandx'{\glqq}% down 99 + \else + \dMf @@magyar@shorthand@\string` {\string`\string`}% unchanged -- expect a ligature in font + \dMf @@magyar@shorthand@\string' {\string`\string'}% unchanged -- expect a ligature in font + \fi\fi + % + %** A hyphen, but hyphenation is OK at both sides + %** reported and asked by Jzsa Mrton + \@@magyar@declare@shorthandx ={\leavevmode\nobreak-\hskip\z@skip} + % ^^^ Dat: no need for \nobreak\hskip\z@skip, because of the empty discretionary + %** \shu?-- typesets an endash (--) with a small space around it (the one to + %** the right is breakable). \shu?- typesets a normal hyphen, having + %** hyphenation OK at both sides. + %** @example Kiss Eld\shu?--Nagy Pl + %** @example kzgazdasg\shu?-tudomnyi + \def\@@magyar@shorthandminus{% + \ifmmode \mskip2.4mu plus3.6mu minus1.8mu \else % ,`- is just a space in math mode + \if-\noexpand\@Lang@tmp \leavevmode\nobreak\,\nobreak\hbox{--}\,\expandafter\expandafter\expandafter\@gobble% Dat: \@gobble - + \else \leavevmode\nobreak-\hskip\z@skip\fi% Dat: e.g hegyes`-szg + \fi + } + \@@magyar@declare@shorthandx -{\futurelet\@Lang@tmp\@@magyar@shorthandminus}% + %** A hyphen that is displayed in both next and current lines. Hyphenation + %** is OK at both sides. This differs from ukraineb.ldf. + %** \showhyphens{ntrium`|klorid} -> nt-ri-um--klo-rid + \@@magyar@declare@shorthandx |{\leavevmode\nobreak-\nobreak\discretionary{}{-}{}\nobreak\hskip\z@skip}% Dat: all \nobreak s are important % e.g egyszer`|ktszer + \@@magyar@declare@shorthandx _{\leavevmode\nobreak\-\nobreak\hskip\z@skip} + \@@magyar@declare@shorthandx <{\flqq} + \@@magyar@declare@shorthandx >{\frqq} + \@@magyar@declare@shorthandx "{\hskip\z@skip}% \allowbreak, but hyphenation is OK at both sides + \@@magyar@declare@shorthandx ~{\textormath{\leavevmode\hbox{-}}{-}}% a hyphen that isn't part of ligatures -- and --- + % + % Dat: `CXY means \discretionary{CS-}{XY}{CXY}, which makes sense only for + % `CCS. But `Ccs wouldn't make sense, since there is no Hungarian word + % (whose first letter has to be capitalized) beginning with ccs. + % Dat: \nobreak\bbl@allowhyphens: \showhyphens{ho`sszabbra} -> hosz-szabb-ra + % Dat: \def\foo{`}\declare@shorthand{\CurrentOption{\foo c}{...} doesn't work + % Dat: these work quite well in math mode + % Dat: \showhyphens{a\hskip\z@skip b} displays "ab", but + % \showhyphens{a\hskip0pt b} displays "a b" + %** These should be equivalent: + %** \showhyphens{verembepot\nobreak\discretionary{y-}{}{}\nobreak\hskip\z@skip tyantam} + %** \showhyphens{verembepo`ttyantam} + \def\@@magyar@disc#1#2{#1\textormath{\nobreak\discretionary{#2-}{}{}}{}\nobreak\hskip\z@skip}% + \@@magyar@declare@shorthandx c{\@@magyar@disc cs}% loccsan --> locs-csan (lo`ccsan) + \@@magyar@declare@shorthandx C{\@@magyar@disc CS} + \@@magyar@declare@shorthandx g{\@@magyar@disc gy}% poggy\'asz --> pogy-gy\'asz (po`ggy\'asz) + \@@magyar@declare@shorthandx G{\@@magyar@disc GY} + \@@magyar@declare@shorthandx l{\@@magyar@disc ly}% Kod\'allyal --> Kod\'aly-lyal (Kod\'a`llyal) + \@@magyar@declare@shorthandx L{\@@magyar@disc LY} + \@@magyar@declare@shorthandx n{\@@magyar@disc ny}% mennyei --> meny-nyei (me`nnyei) + \@@magyar@declare@shorthandx N{\@@magyar@disc NY} + \@@magyar@declare@shorthandx s{\@@magyar@disc sz}% vissza --> visz-sza (vi`ssza) + \@@magyar@declare@shorthandx S{\@@magyar@disc SZ} + \@@magyar@declare@shorthandx t{\@@magyar@disc ty}% pottyan --> poty-tyan (po`ttyan) + \@@magyar@declare@shorthandx T{\@@magyar@disc TY} + \@@magyar@declare@shorthandx z{\@@magyar@disc zs}% rizzsel --> rizs-zsel (ri`zzsel) + \@@magyar@declare@shorthandx Z{\@@magyar@disc ZS} + \def\magyar@fixddzs{\@@magyar@declare@shorthandx d{% bridzs-dzsel + % vvv doesn't handle the rare combination dzs-dzs + %\@@magyar@declare@shorthandx D}{\@@magyar@disc DZ} + %\@@magyar@declare@shorthandx d}{\@@magyar@disc dz}% eddz\"unk (felsz. m.) --> edz-dz\"unk (e`ddz\"unk) + \def\reserved@a{% + \if\noexpand\reserved@b d% + \def\reserved@a{% + \if\noexpand\reserved@b z% + \def\reserved@a{% + \nobreak% so word before `ddzs gets hyphenated + \if\noexpand\reserved@b s% + \discretionary{dzs-}{dz}{ddz}% \showhyphens{szuper`ddzsungelben} + \else + \discretionary{dz-}{d}{dd}z% \showhyphens{szuper`ddzungelben} + \fi + \nobreak\hskip\z@skip% allow both pre- and post breaks + }% + \bbl@afterelse\expandafter\futurelet\expandafter\reserved@b\expandafter\reserved@a\@gobble + \else + \bbl@afterfi dd% + \fi + }% + \bbl@afterelse\expandafter\futurelet\expandafter\reserved@b\expandafter\reserved@a\@gobble + \else\bbl@afterfi d\fi + }% + \futurelet\reserved@b\reserved@a% doesn't remove next token + }}% + \magyar@fixddzs \expandafter\uppercase\expandafter{\magyar@fixddzs} + \@gobble +{^}% + + +% --- hunumbers= + +\ifnum\magyar@opt@@hunumbers=0 \@@magyar@skiplong\fi +\def\@@magyar@egyjegyu#1{% + \ifcase#1 \or\or k\'et\or h\'arom\or n\'egy\or \"ot\or hat\or h\'et\or + nyolc\or kilenc\fi +} +\def\@@magyar@upperfi@nine#1\fi\fi\fi\fi\fi\fi\fi\fi\fi{\fi\fi\fi\fi\fi\fi\fi\fi\fi#1} +\def\@@magyar@upperelse@nine#1\else#2\fi\fi\fi\fi\fi\fi\fi\fi\fi{\fi#1} +\def\@@magyar@uppernum#1{% + \ifx#1\"\@@magyar@upperelse@nine\"O\@gobble% \"o + \else\if\noexpand#1eE% + \else\if\noexpand#1hH% + \else\if\noexpand#1kK% + \else\if\noexpand#1mM% mnusz + \else\if\noexpand#1nN% + \else\if\noexpand#1oO% + \else\if\noexpand#1sS% sokadik + \else\if\noexpand#1tT% + \else\@@magyar@upperfi@nine\expandafter\@@magyar@uppernum#1% do an extra expansion + \fi\fi\fi\fi\fi\fi\fi\fi\fi +} +%** For \pagenumbering{huordinal}. Expands to the Hungarian ordered numeral, +%** spelled out in letters (i.e 1 --> first --> els). Suitable for numbering +%** \part{}s and \chapter{}s of a book (\def\thepart{\@Huordinal\c@part}}) +%** @param #1 a number (input for \number) in -9999..9999 +\def\@huordinal#1{% + % !! larger numbers, also for \@hunumeral + \ifnum#1=-1 m\'nusz egyedik\else + \ifnum#1=-2 m\'nusz kettedik\else + \ifnum#1<0 m\'inusz \expandafter\@huordinal\expandafter{\number-#1 }\else + \ifcase\number#1 nulladik\or els\H o\or m\'asodik\or harmadik\or negyedik\or + \"ot\"odik\or hatodik\or hetedik\or nyolcadik\or kilencedik\else + \ifnum#1>999 \expandafter\@@magyar@ezresedik\number#1.\else + \ifnum#1>99 \expandafter\@@magyar@szazasodik\number#1\else + \expandafter\@@magyar@tizesedik\number#1% + \fi\fi\fi\fi\fi\fi +} +%** @param #1#2 1000..9999 +\def\@@magyar@ezresedik#1#2.{% + \ifnum#1#2>9999 sokadik\else + \@@magyar@egyjegyu#1% + \ifnum#2=0 ezredik\else + ezer\ifnum#1>1 -\fi% ktezer-harmadik + \ifnum#2<100 + \expandafter\@@magyar@tizesedik\number#2% + \else + \ifnum#2<200 egy\fi% ezerszzadik -> ezeregyszzadik + \@@magyar@szazasodik#2% + \fi + \fi + \fi +} +%** @param #1#2 100..999 +%** Imp: binary search +\def\@@magyar@szazasodik#1#2#3{% + \@@magyar@egyjegyu#1sz\'az% + \@@magyar@tizesedik#2#3% +} +%** @param #1 a digit +%** @param #2 a digit +%** Imp: binary search +\def\@@magyar@tizesedik#1#2{% + \ifnum#1#2>89 kilencven\@@magyar@egyesedik#2e% + \else\ifnum#1#2>79 nyolcvan\@@magyar@egyesedik#2a% + \else\ifnum#1#2>69 hetven\@@magyar@egyesedik#2e% + \else\ifnum#1#2>59 hatvan\@@magyar@egyesedik#2a% + \else\ifnum#1#2>49 \"otven\@@magyar@egyesedik#2e% + \else\ifnum#1#2>39 negyven\@@magyar@egyesedik#2e% + \else\ifnum#1#2>29 harminc\@@magyar@egyesedik#2a% + \else\ifnum#1#2>20 huszon\@@magyar@egyesedik#2.% + \else\ifnum#1#2=20 huszadik% + \else\ifnum#1#2>10 tizen\@@magyar@egyesedik#2.% + \else\ifnum#1#2=10 tizedik% + \else \@@magyar@egyesedik#2a% ``ktszzadik'' + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi +}% +\def\@@magyar@egyesedik#1#2{% + \ifcase#1 #2\or egye\or kette\or harma\or negye\or + \"ot\"o\or hato\or hete\or nyolca\or kilence\fi dik% +} +%** Same as \@huordinal, but uppercase +\def\@Huordinal#1{% + % Dat: \newlabel{hellopart}{{Els\H o}{3}} is correctly written out + \ifcase#1 Nulladik\or Els\H o\or M\'asodik\or Harmadik\or Negyedik\or + \"Ot\"odik\or Hatodik\or Hetedik\or Nyolcadik\or Kilencedik\or Tizedik% + \or Tizenegyedik\or Tizenkettedik\else\@@magyar@uppernum\@huordinal{#1}\fi +} +\def\huordinal#1{\expandafter\@huordinal\csname c@#1\endcsname} +\def\Huordinal#1{\expandafter\@Huordinal\csname c@#1\endcsname} + +%** For \pagenumbering{hunumeral}. Expands to the Hungarian ordered numeral, +%** spelled out in letters (i.e 1 --> first --> els). Suitable for numbering +%** \part{}s and \chapter{}s of a book (\def\thepart{\@Hunumeral\c@part}}) +%** @param #1 a number (input for \number) in -9999..9999 +\def\@hunumeral#1{% + \ifnum#1<0 m\'inusz \expandafter\@hunumeral\expandafter{\number-#1 }\else + \ifcase#1 nulla\or egy\or kett\H{o}\or h\'arom\or n\'egy\or + \"ot\or hat\or h\'et\or nyolc\or kilenc\else + \ifnum#1>999 \expandafter\@@magyar@ezer\number#1.\else + \ifnum#1>99 \expandafter\@@magyar@szaz\number#1\else + \expandafter\@@magyar@tiz\number#1% + \fi\fi\fi\fi +} +%** @param #1#2 1000..9999 +\def\@@magyar@ezer#1#2.{% + \ifnum#1#2>9999 sokadik\else + \@@magyar@egyjegyu#1% + \ifnum#2=0 ezer\else + ezer\ifnum#1>1 -\fi% ktezer-harmadik + \ifnum#2<100 + \expandafter\@@magyar@tiz\number#2% + \else + \ifnum#2<200 egy\fi% ezerszzadik -> ezeregyszzadik + \@@magyar@szaz#2% + \fi + \fi + \fi +} +%** @param #1#2 100..999 +%** Imp: binary search +\def\@@magyar@szaz#1#2#3{% + \@@magyar@egyjegyu#1sz\'az% + \@@magyar@tiz#2#3% +} +%** @param #1 a digit +%** @param #2 a digit +%** Imp: binary search +\def\@@magyar@tiz#1#2{% + \ifnum#1#2>89 kilencven\@@magyar@egy#2% + \else\ifnum#1#2>79 nyolcvan\@@magyar@egy#2% + \else\ifnum#1#2>69 hetven\@@magyar@egy#2% + \else\ifnum#1#2>59 hatvan\@@magyar@egy#2% + \else\ifnum#1#2>49 \"otven\@@magyar@egy#2% + \else\ifnum#1#2>39 negyven\@@magyar@egy#2% + \else\ifnum#1#2>29 harminc\@@magyar@egy#2% + \else\ifnum#1#2>20 huszon\@@magyar@egy#2% + \else\ifnum#1#2=20 h\'usz% + \else\ifnum#1#2>10 tizen\@@magyar@egy#2% + \else\ifnum#1#2=10 t\'iz% + \else \@@magyar@egy#2% ``ktszzadik'' + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi +}% +\def\@@magyar@egy#1{% + \ifcase#1 \or egy\or kett\H{o}\or h\'arom\or n\'egy\or + \"ot\or hat\or h\'et\or nyolc\or kilenc\fi% +} +%** Same as \@hunumeral, but uppercase +\def\@Hunumeral#1{% + % Dat: \newlabel{hellopart}{{Els\H o}{3}} is correctly written out + \ifcase#1 Nulla\or Egy\or Kett\H{o}\or H\'arom\or N\'egy\or + \"Ot\or Hat\or H\'et\or Nyolc\or Kilenc\else\@@magyar@uppernum\@hunumeral{#1}\fi +} +\def\hunumeral#1{\expandafter\@hunumeral\csname c@#1\endcsname} +\def\Hunumeral#1{\expandafter\@Hunumeral\csname c@#1\endcsname} + +\@gobble +{^}% + +% --- Appending suffixes to numbers; told= + +\ifnum\magyar@opt@@told=0 \@@magyar@skiplong\fi +% Dat: double accent combinations: +adik,+a,+as,+ad +hoz,+an,+on,+at,+ban... + +% vvv Terminal suffix variants + +% Dat: meaning of classes(#1): {\ifcase 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or 8\or 9\or 10\or 11/-1\or 12/-2\or 100\or 1000\or 10^6\or 10^9\or 20\or 30\or 40\or 60\fi} +% Dat: ...@st is is special for appending +t to \refstruc names +\def\@@magyar@suffix@adik#1{\ifnum#1=1 s\H o\else + \ifcase#1 a\or e\or o\or a\or e\or\"o\or o\or e\or a\or e\or e\or e\or e\or a\or e\or a\or a\or a\or a\or e\or a\or e\or e\fi dik\fi}% +\def\@@magyar@suffix@a#1{\ifcase #1 a\or je\or a\or a\or e\or e\or a\or e\or a\or e\or e\or e\or e\or a\or e\or a\or a\or a\or a\or e\or a\fi}% +\def\@@magyar@suffix@as#1{\ifcase #1 \or e\or e\or a\or e\or\"o\or o\or e\or a\or e\or e\or e\or e\or a\or e\or \or a\or a\or a\or e\or a\fi s}% +\def\@@magyar@suffix@ad#1{\ifcase #1 a\or e\or e\or a\or e\or\"o\or o\or e\or a\or e\or e\or e\or e\or a\or e\or a\or a\or a\or a\or e\or a\fi d}% +\def\@@magyar@suffix@@hoz#1#2{\ifcase#2 o\or e\or\"o\or o\or e\or\"o\or o\or e\or o\or e\or e\or e\or\"o\or o\or e\or o\or o\or o\or o\or e\or o\fi#1}% +\def\@@magyar@suffix@@an#1{\ifcase #1 \or e\or e\or a\or e\or e\or a\or e\or a\or e\or e\or e\or e\or a\or e\or a\or a\or a\or a\or e\or a\fi n}% +\def\@@magyar@suffix@on#1{\ifcase #1 \or e\or \or o\or e\or\"o\or o\or e\or a\or e\or e\or e\or e\or o\or e\or \or o\or o\or o\or e\or o\fi n}% +\def\@@magyar@suffix@st#1{\ifcase #1 \or \or \or \or e\or \or \or \or \or \or \or \or \or \or \or \or \or \or \or \or \fi t}% +\def\@@magyar@suffix@@at#1{\ifcase #1 \or e\or \or a\or e\or\"o\or o\or e\or a\or e\or e\or e\or \or a\or e\or \or a\or a\or a\or e\or a\fi t}% +\def\@@magyar@suffix@@a#1#2{\ifcase #2 a\or e\or e\or a\or e\or e\or a\or e\or a\or e\or e\or e\or e\or a\or e\or a\or a\or a\or a\or e\or a\fi#1}% +\def\@@magyar@suffix@nal#1{n\ifcase #1 \'a\or \'e\or \'e\or\'a\or \'e\or \'e\or\'a\or \'e\or\'a\or \'e\or \'e\or \'e\or \'e\or\'a\or \'e\or \'a\or \'a\or \'a\or\'a\or \'e\or\'a\fi l}% +\def\@@magyar@suffix@@ol#1{\ifcase #1 \'o\or\H o\or\H o\or\'o\or\H o\or\H o\or\'o\or\H o\or\'o\or\H o\or\H o\or\H o\or\H o\or\'o\or\H o\or \'o\or \'o\or \'o\or\'o\or\H o\or\'o\fi l}% +\def\@@magyar@suffix@ul#1{\ifcase #1 u\or \"u\or \"u\or u\or \"u\or \"u\or u\or \"u\or u\or \"u\or \"u\or \"u\or \"u\or u\or \"u\or u\or u\or u\or u\or \"u\or u\fi l}% +\def\@@magyar@suffix@val#1{\ifcase #1 va\or gye\or ve\or ma\or gye\or te\or ta\or te\or ca\or ce\or ze\or gye\or ve\or za\or re\or va\or da\or sza\or ca\or ne\or na\fi l}% +% @example: \atold(2.31)+es+sel{} +\def\@@magyar@suffix@sal#1{\ifcase #1 sa\or se\or se\or sa\or se\or se\or sa\or se\or sa\or se\or se\or se\or se\or sa\or se\or sa\or sa\or sa\or sa\or se\or sa\fi l}% +% @example: \atold(2.31)+ed+del{} +\def\@@magyar@suffix@dal#1{\ifcase #1 da\or de\or de\or da\or de\or de\or da\or de\or da\or de\or de\or de\or de\or da\or de\or da\or da\or da\or da\or de\or da\fi l}% +% @example: \atold(2.31)+edik+kel{} +\def\@@magyar@suffix@kal#1{\ifcase #1 ka\or ke\or ke\or ka\or ke\or ke\or ka\or ke\or ka\or ke\or ke\or ke\or ke\or ka\or ke\or ka\or ka\or ka\or ka\or ke\or da\fi l}% +\def\@@magyar@suffix@an{\@@magyar@suffix@@an}% make \ifx\@@magyar@suffix@an faster +\def\@@magyar@suffix@at{\@@magyar@suffix@@at}% make \ifx\@@magyar@suffix@at faster +\def\@@magyar@suffix@hoz{h\@@magyar@suffix@@hoz z} +\def\@@magyar@suffix@ban{b\@@magyar@suffix@@a n} +\def\@@magyar@suffix@nak{n\@@magyar@suffix@@a k} +\def\@@magyar@suffix@ba{b\@@magyar@suffix@@a \@empty} +\def\@@magyar@suffix@ra{r\@@magyar@suffix@@a \@empty} +\def\@@magyar@suffix@bol{b\@@magyar@suffix@@ol} +\def\@@magyar@suffix@tol{t\@@magyar@suffix@@ol} +\def\@@magyar@suffix@rol{r\@@magyar@suffix@@ol} +\def\@@magyar@suffix@szor{sz\@@magyar@suffix@@hoz r} + +% vvv Continued suffix variants + +\def\@@magyar@skipfi\fi\else{\fi}% +%** Usage: \@@magyar@suffix@aS{5}\magyar@@suffix@hoz +\def\@@magyar@suffix@aS#1#2{% + \ifnum#2=5 \ifx#1\@@magyar@suffix@at \"oset\else\@@magyar@skipfi\fi\else + \ifcase#2 \or e\or e\or a\or e\or \"o\or o\or e\or a\or e\or e\or e\or e\or a\or e\or \or a\or a\or a\or e\or a\fi s% + \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter + \ifx#1\@@magyar@suffix@val\@@magyar@suffix@sal\else#1\fi % +es+vel -> +es+sel + % Imp: +ad+val, +adik+val etc. + \ifcase#2 3\or 1\or 1\or 3\or 1\or 5\or 3\or 1\or 3\or 1\or 1\or 1\or 1\or 3\or 1\or 3\or 3\or 3\or 3\or 1\or 3\fi + \fi +}% +\def\@@magyar@suffix@aD#1#2{% + \ifcase#2 \or e\or e\or a\or e\or \"o\or o\or e\or a\or e\or e\or e\or e\or a\or e\or \or a\or a\or a\or e\or a\fi d% + \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter + \ifx#1\@@magyar@suffix@val\@@magyar@suffix@dal\else#1\fi % +ed+vel -> +ed+del + \ifcase#2 3\or 1\or 1\or 3\or 1\or 5\or 3\or 1\or 3\or 1\or 1\or 1\or 1\or 3\or 1\or 3\or 3\or 3\or 3\or 1\or 3\fi +}% +\def\@@magyar@suffix@adiK#1#2{% + \ifnum#2=1 \ifx#1\@@magyar@suffix@at s\"ot\else\@@magyar@skipfi\fi\else + \ifcase#2 \or e\or e\or a\or e\or \"o\or o\or e\or a\or e\or e\or e\or e\or a\or e\or \or a\or a\or a\or e\or a\fi dik% + \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter + \ifx#1\@@magyar@suffix@val\@@magyar@suffix@kal\else#1\fi % +edik+vel -> +ed+kel + \ifcase#2 3\or 1\or 1\or 3\or 1\or 1\or 3\or 1\or 3\or 1\or 1\or 1\or 1\or 3\or 1\or 3\or 3\or 3\or 3\or 1\or 3\fi + \fi +}% +\def\@@magyar@suffix@A#1#2{% + \ifcase#2 \'a\or j\'e\or \'a\or \'a\or \'e\or \'e\or \'a\or \'e\or \'a\or \'e\or \'e\or \'e\or \'e\or \'a\or \'e\or \'a\or\'a\or\'a\or\'a\or\'e\or\'a\fi + \ifx#1\@@magyar@suffix@at t\else + \ifx#1\@@magyar@suffix@an n\else% Dat: suffix overload: 2-a-an => 2-n + \expandafter#1\ifcase#2 3\or 1\or 1\or 3\or 1\or 1\or 3\or 1\or 3\or 1\or 1\or 1\or 1\or 3\or 1\or 3\or 3\or 3\or 3\or 1\or 3\fi + \fi\fi +}% +\def\@@magyar@suffix@@bad#1#2{\@@magyar@error{Unknown suffix \string`#1' for \string\told}} + +% vvv Input suffix parser + +%** Also defined elsewhere. +%** @param #2 \else...\else...\fi...\fi etc. +\def\@@magyar@swaprelax#1#2\relax{#2#1} +%\def\@@magyar@swapno#1\noexpand{...} +\def\@@magyar@contn#1\relax{#1\@@magyar@told@cont{}} +\def\@@magyar@conta#1#2#3\relax{#3\noexpand#1\@@magyar@told@cont{#2}} +\def\@@magyar@badsuffix#1#2\relax{#2\noexpand\@@magyar@suffix@@bad{#1}\@@magyar@told@cont{#1}}% +\def\@@magyar@fs@#1{% + \if a\noexpand#1\@@magyar@swaprelax\@@magyar@fs@a\else + \if b\noexpand#1\@@magyar@swaprelax\@@magyar@fs@b\else + \if d\noexpand#1\@@magyar@swaprelax\@@magyar@fs@d\else + \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@e\else + \if h\noexpand#1\@@magyar@swaprelax\@@magyar@fs@h\else + \if k\noexpand#1\@@magyar@swaprelax\@@magyar@fs@k\else + \if n\noexpand#1\@@magyar@swaprelax\@@magyar@fs@n\else + \if o\noexpand#1\@@magyar@swaprelax\@@magyar@fs@o\else + \if r\noexpand#1\@@magyar@swaprelax\@@magyar@fs@r\else + \if s\noexpand#1\@@magyar@swaprelax\@@magyar@fs@s\else + \if t\noexpand#1\@@magyar@swaprelax\@@magyar@fs@t\else + \if u\noexpand#1\@@magyar@swaprelax\@@magyar@fs@u\else + \if v\noexpand#1\@@magyar@swaprelax\@@magyar@fs@v\else + % Imp: SUXX: badsuffix doesn't work for +qal here -- fix error reporting + \@@magyar@badsuffix{#1}{}\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\relax +} +\def\@@magyar@fs@a#1{% + %\if -\noexpand#1\@@magyar@swapno\else + \if +\noexpand#1\noexpand\@@magyar@suffix@A\@@magyar@swaprelax\@@magyar@fs@\else + \if d\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ad\else + \if n\noexpand#1\noexpand\@@magyar@suffix@an\@@magyar@contn\else + \if s\noexpand#1\@@magyar@swaprelax\@@magyar@fs@as\else + \if t\noexpand#1\noexpand\@@magyar@suffix@at\@@magyar@contn\else + \@@magyar@conta\@@magyar@suffix@a{#1}% + \fi\fi\fi\fi\fi\relax +} +\def\@@magyar@fs@ad#1{% + %\if -\noexpand#1\@@magyar@swapno\else + \if +\noexpand#1\noexpand\@@magyar@suffix@aD\@@magyar@swaprelax\@@magyar@fs@\else + \if i\noexpand#1\@@magyar@swaprelax\@@magyar@fs@adi\else + \@@magyar@conta\@@magyar@suffix@ad{#1}% + \fi\fi\relax +} +\def\@@magyar@fs@adi#1{% + \if k\noexpand#1\@@magyar@swaprelax\@@magyar@fs@adik\else + \@@magyar@badsuffix{adi#1}{}\fi\relax +} +\def\@@magyar@fs@adik#1{% + %\if -\noexpand#1\@@magyar@swapno\else + \if +\noexpand#1\noexpand\@@magyar@suffix@adiK\@@magyar@swaprelax\@@magyar@fs@\else + \@@magyar@conta\@@magyar@suffix@adik{#1}% + \fi\relax +} +\def\@@magyar@fs@as#1{% + %\if -\noexpand#1\@@magyar@swapno\else + \if +\noexpand#1\noexpand\@@magyar@suffix@aS\@@magyar@swaprelax\@@magyar@fs@\else + \@@magyar@conta\@@magyar@suffix@as{#1}% + \fi\relax +} +\def\@@magyar@fs@b#1{% + \if a\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ba\else + \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ba\else + \if o\noexpand#1\@@magyar@swaprelax\@@magyar@fs@bo\else + \@@magyar@badsuffix{b#1}{}\fi\fi\fi\relax +} +\def\@@magyar@fs@ba#1{% + \if n\noexpand#1\noexpand\@@magyar@suffix@ban\@@magyar@contn\else + \@@magyar@conta\@@magyar@suffix@ba{#1}% + \fi\relax +} +\def\@@magyar@fs@bo#1{% + \if l\noexpand#1\noexpand\@@magyar@suffix@bol\@@magyar@contn\else + \@@magyar@badsuffix{bo#1}{}\fi\relax +} +\def\@@magyar@fs@d#1{% + \if a\noexpand#1\@@magyar@swaprelax\@@magyar@fs@da\else + \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@da\else + \@@magyar@badsuffix{d#1}{}\fi\fi\relax +} +\def\@@magyar@fs@da#1{% + \if l\noexpand#1\noexpand\@@magyar@suffix@dal\@@magyar@contn\else + \@@magyar@badsuffix{da#1}{}\fi\relax +} +\def\@@magyar@fs@e#1{% + \if d\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ad\else + \if s\noexpand#1\@@magyar@swaprelax\@@magyar@fs@as\else + \if t\noexpand#1\noexpand\@@magyar@suffix@at\@@magyar@contn\else + \if n\noexpand#1\noexpand\@@magyar@suffix@an\@@magyar@contn\else + \if +\noexpand#1\noexpand\@@magyar@suffix@A\@@magyar@swaprelax\@@magyar@fs@\else + %\@@magyar@badsuffix{e#1}{} + \@@magyar@conta\@@magyar@suffix@a{#1}{}% + \fi\fi\fi\fi\fi\relax +} +\def\@@magyar@fs@h#1{% + \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ho\else + \if o\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ho\else + \@@magyar@badsuffix{h#1}{}\fi\fi\relax +} +\def\@@magyar@fs@ho#1{% + \if z\noexpand#1\noexpand\@@magyar@suffix@hoz\@@magyar@contn\else + \@@magyar@badsuffix{ho#1}{}\fi\relax +} +\def\@@magyar@fs@k#1{% + \if a\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ka\else + \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ka\else + \@@magyar@badsuffix{k#1}{}\fi\fi\relax +} +\def\@@magyar@fs@ka#1{% + \if l\noexpand#1\noexpand\@@magyar@suffix@kal\@@magyar@contn\else + \@@magyar@badsuffix{ka#1}{}\fi\relax +} +\def\@@magyar@fs@n#1{% + \if a\noexpand#1\@@magyar@swaprelax\@@magyar@fs@na\else + \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@na\else + \@@magyar@badsuffix{n#1}{}\fi\fi\relax +} +\def\@@magyar@fs@na#1{% + \if k\noexpand#1\noexpand\@@magyar@suffix@nak\@@magyar@contn\else + \if l\noexpand#1\noexpand\@@magyar@suffix@nal\@@magyar@contn\else + \@@magyar@badsuffix{na#1}{}\fi\fi\relax +} +\def\@@magyar@fs@o#1{% + \if d\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ad\else + \if n\noexpand#1\noexpand\@@magyar@suffix@on\@@magyar@contn\else + \if s\noexpand#1\@@magyar@swaprelax\@@magyar@fs@as\else + \if t\noexpand#1\noexpand\@@magyar@suffix@at\@@magyar@contn\else + \@@magyar@badsuffix{o#1}{}\fi\fi\fi\fi\relax +} +\def\@@magyar@fs@r#1{% + \if a\noexpand#1\noexpand\@@magyar@suffix@ra\@@magyar@contn\else + \if e\noexpand#1\noexpand\@@magyar@suffix@ra\@@magyar@contn\else + \if o\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ro\else + \@@magyar@badsuffix{r#1}{}\fi\fi\fi\relax +} +\def\@@magyar@fs@ro#1{% + \if l\noexpand#1\noexpand\@@magyar@suffix@rol\@@magyar@contn\else + \@@magyar@badsuffix{ro#1}{}\fi\relax +} +\def\@@magyar@fs@s#1{% + \if z\noexpand#1\@@magyar@swaprelax\@@magyar@fs@sz\else + \if a\noexpand#1\@@magyar@swaprelax\@@magyar@fs@sa\else + \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@sa\else + \if t\noexpand#1\noexpand\@@magyar@suffix@st\@@magyar@contn\else + \@@magyar@badsuffix{s#1}{}\fi\fi\fi\fi\relax +} +\def\@@magyar@fs@sa#1{% + \if l\noexpand#1\noexpand\@@magyar@suffix@sal\@@magyar@contn\else + \@@magyar@badsuffix{sa#1}{}\fi\relax +} +\def\@@magyar@fs@sz#1{% + \if o\noexpand#1\@@magyar@swaprelax\@@magyar@fs@szo\else + \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@szo\else + \@@magyar@badsuffix{sz#1}{}\fi\fi\relax +} +\def\@@magyar@fs@szo#1{% + \if r\noexpand#1\noexpand\@@magyar@suffix@szor\@@magyar@contn\else + \@@magyar@badsuffix{szo#1}{}\fi\relax +} +\def\@@magyar@fs@t#1{% + \if o\noexpand#1\@@magyar@swaprelax\@@magyar@fs@to\else% Dat: works even if #1 is empty + \@@magyar@conta\@@magyar@suffix@at{#1}% + \fi\relax +} +\def\@@magyar@fs@to#1{% + \if l\noexpand#1\noexpand\@@magyar@suffix@tol\@@magyar@contn\else + \@@magyar@badsuffix{to#1}{}\fi\relax +} +\def\@@magyar@fs@u#1{% + \if l\noexpand#1\noexpand\@@magyar@suffix@ul\@@magyar@contn\else + \@@magyar@badsuffix{u#1}{}\fi\relax +} +\def\@@magyar@fs@v#1{% + \if a\noexpand#1\@@magyar@swaprelax\@@magyar@fs@va\else + \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@va\else + \@@magyar@badsuffix{v#1}{}\fi\fi\relax +} +\def\@@magyar@fs@va#1{% + \if l\noexpand#1\noexpand\@@magyar@suffix@val\@@magyar@contn\else + \@@magyar@badsuffix{va#1}{}\fi\relax +} + +% vvv Classification + +% Old: \def\@@magyar@skipor#1\or#2\fi{\fi#1}% +%** Usage: \expandafter\@@magyar@skipor\expandafter\token\ifcase ... \else ... \or\else\fi +\def\@@magyar@skipor#1\or{\@@magyar@skipelse#1\else}% +\def\@@magyar@skipelse#1\else#2\fi{\fi#1}% + +%** Usage: \@@magyar@classify@none{N}{...} +%** Reads till \vfuzz, considers the last decimal number, ignores space, +%** punctuation and the minus `-' sign. Ignores spaces, so `1 2' and `12' are +%** treated the same number. There must ne no `{' or `}' inside `...'. +%** x ends by 0..9, y ends by 1..9 below. +%** @expands to: +%** c0: 0 +%** c1: 1 +%** c2: x2 ... +%** c9: x9 +%** c10: x10 +%** c11: x1 +%** c12: x2 +%** c13: y00 +%** c14: y000 y0000 y00000 +%** c15: y000000 y0000000 y00000000 +%** c16: x000000000 +%** c17: x20 +%** c18: x30 +%** c19: x40 x50 x70 x90 +%** c20: x60 x80 +%** On error, expansion doesn't start with `c' +%** @param #1 default classification, if no (more) numbers found +%** @param #2 next token +\def\@@magyar@classify@none#1#2{% + \if\noexpand#20\@@magyar@swaprelax{\@@magyar@classify@none{c0}}\else + % Dat: smart way to test whether #1 is in 1..9: \ifnum0<0\string#1 foo\fi + \ifnum0<0\string#2 \@@magyar@swaprelax{\@@magyar@classify@single#2}\else + \if\noexpand#2- \@@magyar@swaprelax{\@@magyar@classify@neg{#1}}\else + \ifx#2\vfuzz \@@magyar@swaprelax{#1}\else% stop processing if terminating \vfuzz is found + \@@magyar@swaprelax{\@@magyar@classify@none{#1}}% find next (possibly) number + % ^^^ Dat: it is safe to call \@@magyar@swaprelax here, even if #2 contains \relax + \fi\fi\fi\fi\relax +} +\def\@@magyar@classify@neg#1#2{% + \if\noexpand#20\@@magyar@swaprelax{\@@magyar@classify@none{c0}}\else + % Dat: smart way to test whether #1 is in 1..9: \ifnum0<0\string#1 foo\fi + \ifnum0<0\string#2 \@@magyar@swaprelax{\@@magyar@classify@singleneg#2}\else + \if\noexpand#2- \@@magyar@swaprelax{\@@magyar@classify@none{#1}}\else% double negation + \ifx#2\vfuzz \@@magyar@swaprelax{#1}\else% stop processing if terminating \vfuzz is found + \@@magyar@swaprelax{\@@magyar@classify@none{#1}}% find next (possibly) number, start as positive + % ^^^ Dat: it is safe to call \@@magyar@swaprelax here, even if #2 contains \relax + \fi\fi\fi\fi\relax +} +%** @param #1 previous digit 1..9 +%** @param #2 next token +\def\@@magyar@classify@single#1#2{% + \if\noexpand#20\@@magyar@swaprelax{\@@magyar@classify@tens#1}\else + \ifnum0<0\string#2 \@@magyar@swaprelax{\@@magyar@classify@more#2}\else + \ifx#2\vfuzz \@@magyar@swaprelax{c#1}\else + \@@magyar@swaprelax{\@@magyar@classify@none{c#1}#2}% + % ^^^ Dat: it is safe to call \@@magyar@swaprelax here, even if #2 contains \relax + \fi\fi\fi\relax +} +%** @param #1 previous digit 1..9 +%** @param #2 next token +\def\@@magyar@classify@singleneg#1#2{% + \if\noexpand#20\@@magyar@swaprelax{\@@magyar@classify@tens#1}\else + \ifnum0<0\string#2 \@@magyar@swaprelax{\@@magyar@classify@more#2}\else + \ifx#2\vfuzz \@@magyar@swaprelax{c\ifcase#1 0\or11\or12\else#1\fi}\else % turn `-1' -> `11' and `-2' to `12' + \if#11\@@magyar@swaprelax{\@@magyar@classify@neg{c11}#2}\else + \if#12\@@magyar@swaprelax{\@@magyar@classify@neg{c12}#2}\else + \@@magyar@swaprelax{\@@magyar@classify@neg{c#1}#2}% + % ^^^ Dat: it is safe to call \@@magyar@swaprelax here, even if #2 contains \relax + \fi\fi\fi\fi\fi\relax +} +%** @param #1 previous digit 1..9 +%** @param #2 next token +\def\@@magyar@classify@more#1#2{% + \if\noexpand#20\@@magyar@swaprelax{\@@magyar@classify@tens#1}\else + \ifnum0<0\string#2 \@@magyar@swaprelax{\@@magyar@classify@more#2}\else + \@@magyar@swaprelax{% + \expandafter\@@magyar@skipor\expandafter\@@magyar@classify@none + \ifcase#1 M\or {c11}\or {c12}\else {c#1}\or\else\fi#2}% + % ^^^ Dat: it is safe to call \@@magyar@swaprelax here, even if #2 contains \relax + \fi\fi\relax +} +%** @param #1 prev-prev digit, 1..9 +%** @param #2 next token +\def\@@magyar@classify@tens#1#2{% + \if\noexpand#20\@@magyar@swaprelax{\@@magyar@classify@zeroes2}\else + \ifnum0<0\string#2 \@@magyar@swaprelax{\@@magyar@classify@more#2}\else + \@@magyar@swaprelax{% + \expandafter\@@magyar@skipor\expandafter\@@magyar@classify@none + \ifcase#1 T\or{c10}\or{c17}\or{c18}\or{c19}\or{c19}\or{c20}\or{c19}\or{c20}\else{c19}\or\else\fi#2}% + % ^^^ Dat: it is safe to call \@@magyar@swaprelax here, even if #2 contains \relax + \fi\fi\relax +} +%** @param #1 zero-count 2..9 +%** @param #2 next token +\def\@@magyar@classify@zeroes#1#2{% + \if\noexpand#20\@@magyar@swaprelax{% + %\def\foo#1,{.(#1)} + %\message{\expandafter\expandafter\expandafter\foo\expandafter + % \@@magyar@skipor\ifcase3 zero\or one\or two\else three\or\fi,done} + \expandafter\@@magyar@skipor\expandafter\@@magyar@classify@zeroes + %\ifcase#1 Y\or Y\or 3\or 4\or 5\or 6\or 7\or 8\or 9\or 9\or% Dat: no \else + \ifcase#1 Y\or Y\or 3\or 4\or 5\or 6\or 7\or 8\else 9% + \or\else\fi}\else% ^^^ Dat: 2 -> 3 ... 8 -> 9, 9 -> 9 + \ifnum0<0\string#2 \@@magyar@swaprelax{\@@magyar@classify@more#2}\else + \@@magyar@swaprelax{% + \expandafter\@@magyar@skipor\expandafter\@@magyar@classify@none + \ifcase#1 Z\or Z\or {c13}\or {c14}\or {c14}\or {c14}\or {c15}\or {c15}\or + {c15}\else {c16}\or\else\fi#2}% + % ^^^ Dat: it is safe to call \@@magyar@swaprelax here, even if #2 contains \relax + \fi\fi\relax +} + +% vvv The user interface for suffixing + +\def\@@magyar@ccheck#1#2\vfuzz#3{% + \if\noexpand#1c\relax\else + \@@magyar@error{\string\told\space needs number, not \string`#3'}% + \def\reserved@a{c0}% + \fi +} + +%** Expands #1 with \the if it is \cs (possibly \count or \toks etc.) +\def\@@magyar@the#1{% + \ifx#1\relax\else\if\noexpand\noexpand\noexpand#1% + \expandafter\expandafter\expandafter\the\fi\fi#1% +}% + +\def\@@magyar@firsthfuzz#1#2\hfuzz{#1} +\def\@@magyar@secondhfuzz#1#2#3\hfuzz{#2} +%** See docs in magyar.dtx +\def\@@magyar@zerocite#1{% + \ifx[#1\expandafter\@secondoftwo\fi\@thirdofthree\@firstoftwo + {\@@magyar@zerocite@lowa[, }% had `[' + {\@@magyar@zerocite@lowa[]{#1}}% +} +\def\@@magyar@zerocite@lowa[#1]#2{[\@@magyar@zerocite@lowb#2,\hbox,${#1}} +\def\@@magyar@swapvfuzz#1#2\vfuzz{#2#1} +\def\@@magyar@zerocite@lowb#1#2,{% + \ifx\hfuzz#1\hfuzz + \else\ifx\hbox#1\@@magyar@swapvfuzz\@@magyar@zerocite@lowc + \else\ifx,#1\@@magyar@swapvfuzz\@@magyar@zerocite@lowb{#2,}% + \else\expandafter\ifx\csname b@#1#2\endcsname\relax + 0, \@@magyar@swapvfuzz\@@magyar@zerocite@lowb + \else\expandafter\expandafter\expandafter\@@magyar@b@number + \expandafter\expandafter\expandafter{\csname b@#1#2\endcsname}, + \@@magyar@swapvfuzz\@@magyar@zerocite@lowb + \fi\fi\fi\fi\vfuzz} +\def\@@magyar@zerocite@lowc$#1{]#1} + +%** Expands to the numeric value of a \b@foobar definition +%** Dat: with natbib.sty, we get \def\b@foobar{{1}{...}...}, +%** otherwise something like \def\b@foobar{\... 1} +%** @param #1 value of a \b@foobar +\def\@@magyar@b@number{% + \expandafter\ifx\csname ver@natbib.sty\endcsname\relax + \expandafter\@firstofone + \else \expandafter\@@magyar@b@number@natbibone \fi +} +\def\@@magyar@b@number@natbibone#1{\@@magyar@b@number@natbibtwo#1.\vfuzz} +\def\@@magyar@b@number@natbibtwo#1#2\vfuzz{#1}% + +\def\@@magyar@zeroaref#1{% + % Dat: we cannot use \@ifnextchar here, because it is not expandable + \ifx(#1\expandafter\@secondoftwo\fi\@thirdofthree\@firstoftwo + {\@@magyar@zeroref}{% Dat: gobble the ( + \ifx*#1\expandafter\@secondoftwo\fi\@thirdofthree\@firstoftwo + {\NotAllowedArefStar\@@magyar@zeropageref}% Dat: gobble the * + {\@@magyar@zeroref{#1}}% + {\@@magyar@zeroref{#1}}}% +} + +\def\@@magyar@zeroapageref#1{% + % Dat: we cannot use \@ifnextchar here, because it is not expandable + \ifx*#1\expandafter\@secondoftwo\fi\@thirdofthree\@firstoftwo + {\NotAllowedApagerefStar\@@magyar@zeropageref}% Dat: gobble the * + {\@@magyar@zeropageref{#1}}% +} + +\def\@@magyar@zeroref#1{% + \expandafter\ifx\csname r@#1\endcsname\relax0\else + \expandafter\expandafter\expandafter\@@magyar@firsthfuzz\csname r@#1\endcsname00\hfuzz + \fi +}% +\def\@@magyar@zeroeqref#1{(\@@magyar@zeroref{#1})}% +\def\@@magyar@zerorefplus#1{\@@magyar@zerorefplus@low#1+\vfuzz} +\def\@@magyar@zerorefplus@low#1+#2\vfuzz{% + \expandafter\ifx\csname r@#1\endcsname\relax0\else + \expandafter\expandafter\expandafter\@@magyar@firsthfuzz\csname r@#1\endcsname00\hfuzz + \fi +}% +\def\@@magyar@zeropageref#1{% + \expandafter\ifx\csname r@#1\endcsname\relax0\else + \expandafter\expandafter\expandafter\@@magyar@secondhfuzz\csname r@#1\endcsname00\hfuzz + \fi +}% + +%** A space might be discared after the suffix, depending on the suffix. So +%** please use `\told5+adik{} ' to ensure the space. +%** May raise `! Package magyar.ldf Error: Unknown suffix `...' for \told', but +%** emits unchanged suffix to DVI file. +%** \atold\apageref emits double article +%** \cite, \acite etc. is allowed, but without comma +%** \aref({...}), \aref*, \apageref*, \acite* aren't allowed +%** \refstruc doesn't work inside it, because \refstruc isn't expandable +%** @example \told4+a+a+a+a+adik raises strange error +%** @example no -en is provided for -an/-on, to avoid ambiguity +%** @example \told4+adik: 0-adik 1-s 2-odik 3-adik 12-edik 10^8-adik +%** @example augusztus \told20-a: 1-je 2-a 3-a 4-e 5-e 6-a ... (augusztus 20-a) +%** @example \told3+as: 0-s(??) 1-es 2-es 3-as 4-es 5-s 10^6-s +%** @example \told0+ad: 0-ad 1-ed 2-ed 3-ad 5-d 10^6-ad +%** @example \told1000+hoz: 0-hoz 3-hoz 6-hoz 8-hoz 100-hoz 10^6-hoz 10^9-hoz 1-hez 4-hez 7-hez 9-hez 10-hez 1000-hez 2-hz 5-hz +%** @example \told5+an: 5-en 2-en 100-an 10^6-n +%** @example \told5+on: 5-n 2-n 3-on 100-on 10^6-n +%** @example \told0+at: 0-t 2-t 10^6-t 1-et 4-et 7-et 9-et 10-et 1000-et 3-at 8-at 6-ot 10^9-ot 5-t +%** @example \told1000+ban: 1000-ben +%** @example \told7+ba: 7-be +%** @example \told5+nak: 7-nek +%** @example \told2+ra: 2-re +%** @example \told4+nal: 4-nl +%** @example \told7+bol: 7-bl +%** @example \told5+tol: 5-tl +%** @example \told3+rol: 3-rl +%** @example \told2+ul: 0-ul 1-l 2-l 3-ul +%** @example \told5+odik+hoz +%** @example \told{300}+szor +%** @example -i and -ig don't change have alternate forms +%** @param #1 something that expands to an integer, or `\count...' or `\toks...' +\DeclareRobustCommand \@@magyar@told{\@@magyar@xtold 0} +\DeclareRobustCommand\@@magyar@atold{\@@magyar@xtold a} +\DeclareRobustCommand\@@magyar@Atold{\@@magyar@xtold A} +\def\@@magyar@xtold#1#2+{\@@magyar@told@low{#2}#1} +%** @param #1 something that expands to an integer, or `\count...' or `\toks...' +%** @param #2 add \az? (0: no, a: lowercase A: uppercase) +\def\@@magyar@told@low#1#2{% + % Dat: a level of braces has already been stripped from #1 + % Dat: negative sign isn't important, because it is skipped by \@@magyar@classify@none + \begingroup\begingroup + \@safe@activestrue% allow active `:' inside labels + \let\@safe@activesfalse\@empty \let\@safe@activestrue\@empty% inside \b@... emitted by \cite + % vvv Dat: gobbles its arg and `-' below + % `\@@magyar@toldas{42}' must be the very end of #1 + \let\@@magyar@toldas\@gobbletwo + \let\-\relax +% \let\@@magyar@save@tilde~% + \let~\relax% influenced by \@safe@activestrue + \let\refstruc\relax \let\refstrucparen\relax + \let \ref\relax \let \pageref\relax \let \cite\relax % all unexpandable, even for \@@magyar@the + \let\aref\relax \let\apageref\relax \let\acite\relax + \let\Aref\relax \let\Apageref\relax \let\Acite\relax + \let\autoref\relax + \let\hbox\@firstofone % Make \hbox{...} work by removing the braces. TODO(pts): Make \hbox to...{...} work. + \let\@@magyar@told@optdot\@empty % The optional dot disappears. + %\set@display@protect% \string. Why?? doesn't seem to screw up \r + \set@typeset@protect% \relax. + \edef\reserved@c{#1-}% + \edef\reserved@c{\def\noexpand\reserved@c{\expandafter\@@magyar@the\reserved@c\@empty}}% `\expandafter' is here so `the' and `number' take place + % + \def\@@magyar@toldas##1{.##1.}% emit the number + \let\romannumeral\number + \def\refstruc##1{0}% + \def\refstrucparen##1{0}% + \let\@safe@activestrue\@empty% babel puts these inside \b@...: % Dat: \def\b@abook{\@safe@activesfalse 2}% (what is \@safe@actives??) + \let\@safe@activesfalse\@empty% \b@DuplanJauneau1986 ->\@safe@activesfalse 15 + \def\hyper@@link[##1]##2##3##4{##4}% Dat: \def\b@abook{\hyper@@link [cite]{}{cite.sokt}{2}}% with hyperref.sty % BUGFIX at Tue Nov 21 03:15:32 CET 2006 + % + \let\ref\@@magyar@zeroref + \let\pageref\@@magyar@zeropageref + \let\cite\@@magyar@zerocite + \let\eqref\@@magyar@zeroeqref + % + \let\aref\@@magyar@zeroaref \let\Aref\aref % Dat: supports \aref* and \aref( + \let\apageref\@@magyar@zeroapageref \let\Apageref\apageref % Dat: supports \apageref* and \apageref( + \let\acite\cite \let\Acite\acite + % + \let\autoref\ref% Dat: SUXX: ``section 1-gyel'' + \edef\reserved@a{#1}% + \edef\reserved@a{\expandafter\@@magyar@the\reserved@a\@empty}% `\expandafter' is here so `the' and `number' take place + %\let~\@@magyar@save@tilde% vvv for ~ below etc. + \if0#2\else + #2% a or A + % vvv Dat: we do \az with \romannumeral changed to \number + \expandafter\@@magyar@az@set\expandafter{\reserved@a}\hbox$% Dat: \reserved@a is already expanded, as required by \@@magyar@az@set + \nobreakspace% Dat: `~' is wrong here, it has been redefined !! + \fi + \edef\reserved@a{\noexpand\reserved@c\def\noexpand\reserved@a{\reserved@a}}% + % + \expandafter\expandafter\expandafter\endgroup\reserved@a% keep \reserved@a and \reserved@c + %%\show\reserved@a \show\reserved@c \show\@@magyar@toldas + % vvv Dat: shows friendly LaTeX error: \told{\refstruc{refstruc=}}+ban + \def\refstruc{\@@magyar@error{Cannot use \string\refstruc\space inside \string\told}\@@magyar@refstruc}% + \edef\reserved@a{\expandafter\@@magyar@classify@none\expandafter N\reserved@a\vfuzz}% + %%\show\reserved@a + \expandafter\@@magyar@ccheck\reserved@a..\vfuzz\reserved@c% + %\edef\reserved@a{{\ifcase\expandafter\@gobble\reserved@a\space 0\or1\or2\or + % 3\or4\or5\or6\or7\or8\or9\or10\or11\or12\or13\or14\or15\or16\or + % 8\or8\else 9\fi}}% 20->8 30->8 40->9 % no need for this anymore + \edef\reserved@a{{\number\expandafter\@gobble\reserved@a}}% keeps 17,18,19 for +val + \expandafter\edef\expandafter\reserved@b\expandafter{\if}.\fi\@@magyar@fs@ +} +\def\@@magyar@told@optdot{.} +%** @in \reserved@a is suffix classification in braces: {0}, {1} ... or {16} +%** @param #1 \@empty or a char token +\def\@@magyar@told@cont#1{% + \reserved@a% add the suffix class, example: {11} + #1%\if/\noexpand#1\else#1\fi% add extra char unless `/' + \if{.\fi}% close \edef\reserved@b opened in \@@magyar@told + % Now: example \reserved@b: \@@magyar@suffix@aS \@@magyar@suffix@sal {11} + % Now: example \reserved@b: \@@magyar@suffix@aS \@@magyar@suffix@val {11} + % Dat: \reserved@b is now like \@@magyar@suffix@A \@@magyar@suffix@ban + % vvv Dat: \aref in \reserved@c may modify \reserved@b, so we call it + % late by \expandafter + \expandafter\reserved@c% print the number and the hyphen + \reserved@b% print the suffix + \endgroup +} +% Dat: \told is an unused \cs in LaTeX and its standard packages +\ifnum\magyar@opt@@told>1 + \let \told\@@magyar@told + \let\atold\@@magyar@atold + \let\Atold\@@magyar@Atold +\else + \expandafter\ifx\csname told\endcsname\relax \let \told\@@magyar@told\fi + \expandafter\ifx\csname atold\endcsname\relax \let\atold\@@magyar@atold\fi + \expandafter\ifx\csname Atold\endcsname\relax \let\Atold\@@magyar@Atold\fi +\fi +\@gobble +{^}% + +% --- hutoday= + +% Dat: latex.ltx has \edef for \today, but we have \def +\def\SafeToday{\the\year/\two@digits{\the\month}/\two@digits{\the\day}:% + \two@digits{\the\count@}:\two@digits{\the\count2}} + +\ifnum\magyar@opt@@hutoday=0 \@namedef{date\CurrentOption}{\let\today\SafeToday}\@@magyar@skiplong\fi +%** Same as what latex.ltx has. Expansion doesn't change it, doesn't contain +%** accents. +\@namedef{date\CurrentOption}{% + \def\today{% + \number\year.~\ifcase\month\or + janu\'ar\or febru\'ar\or m\'arcius\or + \'aprilis\or m\'ajus\or j\'unius\or + j\'ulius\or augusztus\or szeptember\or + okt\'ober\or november\or december\fi + \space\number\day.\hbox{}}% + } +% vvv Dat: ondate... and \ontoday is specific to magyar.ldf +\@namedef{ondate\CurrentOption}{% + \number\year.~\ifcase\month\or janu\'ar\or febru\'ar\or m\'arcius\or + \'aprilis\or m\'ajus\or j\'unius\or j\'ulius\or augusztus\or szeptember\or + okt\'ober\or november\or december\fi\space\ifcase\day\or + 1-j\'en\or 2-\'an\or 3-\'an\or 4-\'en\or 5-\'en\or + 6-\'an\or 7-\'en\or 8-\'an\or 9-\'en\or 10-\'en\or + 11-\'en\or 12-\'en\or 13-\'an\or 14-\'en\or 15-\'en\or + 16-\'an\or 17-\'en\or 18-\'an\or 19-\'en\or 20-\'an\or + 21-\'en\or 22-\'en\or 23-\'an\or 24-\'en\or 25-\'en\or + 26-\'an\or 27-\'en\or 28-\'an\or 29-\'en\or 30-\'an\or + 31-\'en\fi} +\edef\reserved@a{% + \noexpand\addto\expandafter\noexpand\csname extras\CurrentOption\endcsname{% + \noexpand\babel@save\noexpand\ontoday + \let\noexpand\ontoday\expandafter\noexpand\csname ondate\CurrentOption\endcsname} +} +\reserved@a +\@gobble +{^}% + +% --- refstruc= + +\if0\magyar@opt@@refstruc \@@magyar@skiplong\fi +\def\@@magyar@nonumbers@skipa#1\@@magyar@nonumbers@s{#1\@@magyar@nonumbers@a} +%** Changes arabic and roman numbers to 1 or i, respectively. +%** Usage: \typeout{((\@@magyar@nonumbers@a 35.2.iv\hfuzz))} -> ((1.1.i)) +\def\@@magyar@nonumbers@a#1{% + \ifx#1\hfuzz \expandafter\@gobble + \else\if\noexpand#101% !! Imp: 1<1\string#1 + \else\if\noexpand#111% + \else\if\noexpand#121% + \else\if\noexpand#131% + \else\if\noexpand#141% + \else\if\noexpand#151% + \else\if\noexpand#161% + \else\if\noexpand#171% + \else\if\noexpand#181% + \else\if\noexpand#191% + \else\if\noexpand#1mi% + \else\if\noexpand#1di% + \else\if\noexpand#1ci% + \else\if\noexpand#1li% + \else\if\noexpand#1xi% + \else\if\noexpand#1vi% + \else\if\noexpand#1ii% + \else\if\noexpand#1MI% + \else\if\noexpand#1DI% + \else\if\noexpand#1CI% + \else\if\noexpand#1LI% + \else\if\noexpand#1XI% + \else\if\noexpand#1VI% + \else\if\noexpand#1II% + \else\noexpand#1\@@magyar@nonumbers@skipa + \fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi \fi + \@@magyar@nonumbers@s +} +\def\@@magyar@nonumbers@s#1{% + \ifx#1\hfuzz \expandafter\@gobble + \else\if\noexpand#10% + \else\if\noexpand#11% + \else\if\noexpand#12% + \else\if\noexpand#13% + \else\if\noexpand#14% + \else\if\noexpand#15% + \else\if\noexpand#16% + \else\if\noexpand#17% + \else\if\noexpand#18% + \else\if\noexpand#19% + \else\if\noexpand#1m% + \else\if\noexpand#1d% + \else\if\noexpand#1c% + \else\if\noexpand#1l% + \else\if\noexpand#1x% + \else\if\noexpand#1v% + \else\if\noexpand#1i% + \else\if\noexpand#1M% + \else\if\noexpand#1D% + \else\if\noexpand#1C% + \else\if\noexpand#1L% + \else\if\noexpand#1X% + \else\if\noexpand#1V% + \else\if\noexpand#1I% + \else\noexpand#1\@@magyar@nonumbers@skipa + \fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi \fi + \@@magyar@nonumbers@s +} + +\let\@@magyar@toldas\@gobble +\def\@@magyar@strucname@part{r\'esz\@@magyar@toldas{4}}% SUXX: may not contain \-; !! rsszel (vs. rszszel) +\def\@@magyar@strucname@chapter{fejezet\@@magyar@toldas{9}}% !! fejezettel +\def\@@magyar@strucname@appendix{f\"ug\-gel\'ek\@@magyar@toldas{4}}% !! fuggelekkel +\def\@@magyar@strucname@section{szakasz\@@magyar@toldas{20}}% +\def\@@magyar@strucname@subsection{al\-sza\-kasz\@@magyar@toldas{20}}% +\def\@@magyar@strucname@subsubsection{al\-al\-szakasz\@@magyar@toldas{20}}% +\def\@@magyar@strucname@subsubsubsection{al\-al\-al\-szakasz\@@magyar@toldas{20}}% +\def\@@magyar@strucname@paragraph{bekezd\'es\@@magyar@toldas{4}}% +\def\@@magyar@strucname@subparagraph{albekezd\'es\@@magyar@toldas{4}}% +\def\@@magyar@strucname@subsubparagraph{alalbekezd\'es\@@magyar@toldas{4}}% +\def\@@magyar@strucname@figure{\'ab\-ra\@@magyar@toldas{4}}% !! brban etc. +\def\@@magyar@strucname@table{t\'ab\-l\'azat\@@magyar@toldas{6}}% +\def\@@magyar@strucname@equation{egyenlet\@@magyar@toldas{7}}% +\def\@@magyar@strucname@footnote{l\'ab\-jegy\-zet\@@magyar@toldas{7}}% +\def\@@magyar@strucname@item{elem\@@magyar@toldas{4}}% !! elemmel etc. +\def\@@magyar@strucname@FancyVerbLine{sor\@@magyar@toldas{8}}% !! sorral +\def\@@magyar@strucname@theorem{t\'e-tel\@@magyar@toldas{4}}% !! ttellel + +%** Must be expandable. +%** @param #1 `section' etc. +%** @expands to its name in English +\def\@@magyar@strucname#1{#1} +%** @param #1 `section' etc. +%** @expands to its name in Hungarian +\def\@@magyar@strucname@hu#1{\csname @@magyar@strucname@#1\endcsname} + +%** Keeps only structure number, discards page number etc. +\def\@@magyar@refstruc@parse#1#2\vfuzz{% + \ifx\relax#1\let\reserved@a\relax + \else\def\reserved@a{#1}\fi +}% +%** Retrieves the structure name (arg #4) from arg 2 of a \newlabel emitted +%** by hyperref.sty. +%** @example \newlabel{fig:vonal}{{1}{1}{my title}{figure.1}{}} +%** \@namedef{r@fig:vonal}{{1}{1}{my title}{figure.1}{}} +%** -> extract `figure' to \reserved@c +\def\@@magyar@refstruc@parsehyname#1#2#3#4#5\vfuzz{% + \ifx\relax#1% + \else\expandafter\@@magyar@refstruc@parsehynamedot#4\vfuzz\fi +}% +\def\@@magyar@refstruc@parsehynamedot#1.#2\vfuzz{% + \expandafter\ifx\csname @@magyar@strucname@#1\endcsname\relax + \else\def\reserved@c{#1}\fi +} + +%** @param #1 name of a count register (e.g c@part) +\def\@@magyar@refstruc@setcnt#1{% + \expandafter\ifx\csname#1\endcsname\relax\expandafter\@tempcnta + \else\csname#1\endcsname\fi +}% + +%** @param #1 a label name +\def\@@magyar@refstruc@ref#1{% + \ref{#1}.~% +} + +%** May not touch \reserved@a +\def\@@magyar@refstruc@split#1+#2\vfuzz#3{% + \if\noexpand#30\else\@@magyar@refstruc@ref{#1}\fi + \ifx\vfuzz#2% + \textbf{??}% + \G@refundefinedtrue + \else + \begingroup + \@safe@activestrue% so active `:' etc. will work inside \csname... + \edef\reserved@c{\noexpand\@@magyar@refstruc@splitlow + \expandafter\ifx\csname r@#1\endcsname\relax\relax\else + \expandafter\noexpand\csname r@#1\endcsname\fi}% + % ^^^ Dat: would emit `undefined' instead of `\relax' w/o \ifx + \expandafter\endgroup\reserved@c{#2}% + \fi +} + +%** @param #1 csname \r@foo:bar +%** @param #2 suffix to add +\def\@@magyar@refstruc@splitlow#1#2{% + \ifx#1\relax + \textbf{??+#2}% + \G@refundefinedtrue + \else + \expandafter\@@magyar@refstruc@parse#1..\vfuzz% + \@@magyar@refstruc@work#1% + \let\@@magyar@save@m\-% + \let\-\relax + \let\@@magyar@toldas\relax + \edef\reserved@c{\expandafter\@@magyar@strucname\expandafter{\reserved@c}}% + \let\-\@@magyar@save@m + \let\@@magyar@suffix@at\@@magyar@suffix@st% fix the -t suffix + \ifx\reserved@b\@empty\else + \@@magyar@refstruc@splitb#2\vfuzz% strip `+' from the end of #2 + \fi + \fi +} + +\def\@@magyar@refstruc@splitb#1+\vfuzz{% + \expandafter\@@magyar@told\reserved@c+#1{}% fejezet -> fejezetben +} + +%** The +val suffix does not produce the desired result. +%** @param #1 \ref id or with \told +%** (@param #2 1 to prefix with 1\ref{...}.~' in Hungarian order) +%** @example \refstruc{sec:foo} +%** @example \refstruc{sec:foo+as+an} +%** May not touch \reserved@a +\def\@@magyar@refstruc@name#1{% + \begingroup + \begingroup + \@safe@activestrue% so active `:' etc. will work inside \csname... + \edef\reserved@c{\noexpand\@@magyar@refstruc@namelow + \expandafter\ifx\csname r@#1\endcsname\relax\relax\else + \expandafter\noexpand\csname r@#1\endcsname\fi}% + % ^^^ Dat: would emit `undefined' instead of `\relax' w/o \ifx + \expandafter\endgroup\reserved@c{#1}% +} + +%** @param #1 csname \r@foo:bar +%** @param #2 foo:bar +%** @param #3 1 to prefix with 1\ref{...}.~' in Hungarian order) +\def\@@magyar@refstruc@namelow#1#2#3{% + \ifx#1\relax + \@@magyar@refstruc@split#2+\vfuzz#3% ends by +suffix, needs \told + \else + \expandafter\@@magyar@refstruc@parse#1..\vfuzz% sets \reserved@a to ref target + %%\show\reserved@a% first arg of ref, i.e section number, eg. `1.2.3' -- or \relax + \if\noexpand#30\else + \begingroup% Dat: \ref might redefine \reserved@a, especially in hyperref.sty + \@@magyar@refstruc@ref{#2}\endgroup\fi + \@@magyar@refstruc@work#1% + \expandafter\@@magyar@strucname\expandafter{\reserved@c}% + \fi + \endgroup +} + +\def\@@magyar@appendix@chapapp{\appendixname}% + +%** Input is \reserved@a, output is \reserved@c +%** @param #1 the control sequence \r@foo:bar +\def\@@magyar@refstruc@work#1{% + \edef\reserved@a{\expandafter\@@magyar@nonumbers@a\reserved@a\hfuzz}% + %\expandafter\lowercase\expandafter{\expandafter\def\expandafter\reserved@a\expandafter{\reserved@a}}% + % ^^^ Dat: don't do lowercasing, deliberately. + % Imp: referring from \@alph sections such as the appendix + \@@magyar@refstruc@setcnt{c@part}1 + \@@magyar@refstruc@setcnt{c@chapter}1 + \@@magyar@refstruc@setcnt{c@section}1 + \@@magyar@refstruc@setcnt{c@subsection}1 + \@@magyar@refstruc@setcnt{c@subsubsection}1 + \@@magyar@refstruc@setcnt{c@subsubsubsection}1 + \@@magyar@refstruc@setcnt{c@paragraph}1 + \@@magyar@refstruc@setcnt{c@subparagraph}1 + \@@magyar@refstruc@setcnt{c@subsubparagraph}1 + \let\reserved@c\relax + \expandafter\@@magyar@refstruc@parsehyname#1....\vfuzz% + \ifx\reserved@c\relax% hyperref.sty and nameref.sty has helped us + \def\reserved@c{subsubparagraph}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{subparagraph}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{paragraph}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{subsubsubsection}\edef\reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{subsubsection}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{subsection}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{section}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{chapter}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{appendix}\edef \reserved@b{\expandafter\ifx\csname c@chapter\endcsname\relax\else\@Alph\c@chapter\fi}\ifx\reserved@a\reserved@b\else% Imp: do this without changing counters in \appendix + \def\reserved@c{part}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + %%\show\@chapapp \show\@@magyar@appendix@chapapp + \ifx\@chapapp\@@magyar@appendix@chapapp% we're in an appendix referring to a normal chapter + \def\thechapter{\@arabic\c@chapter}\fi + \def\reserved@c{subsubparagraph}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{subparagraph}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{paragraph}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{subsubsubsection}\edef\reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{subsubsection}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{subsection}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{section}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + \def\reserved@c{chapter}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else + % + \@latex@error{Unknown structure level for ref \string`\reserved@a'; + \reserved@b}\@ehc% + \def\reserved@c{??}% Dat: must be expandable + \let\reserved@b\@empty + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi +} + +\def\@@magyar@refstruc@hu#1{\@@magyar@refstruc@name{#1}1}% +% Imp: Undocumented: \refstrucparen can be used instead of \refstruc +% to format the section number inside parentheses. +\def\@@magyar@refstrucparen@hu#1{% + \begingroup + \def\@@magyar@refstruc@ref##1{\told(\ref{##1})+es{}~}% + \@@magyar@refstruc@name{#1}1% + \endgroup}% +\def\@@magyar@refstruc#1{\@@magyar@refstruc@name{#1}0~\ref{#1}}% +\def\@@magyar@refstrucparen#1{\@@magyar@refstruc@name{#1}0~(\ref{#1})}% + +\expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\@@magyar@refstruc + \babel@save\@@magyar@strucname + \let\@@magyar@refstruc \@@magyar@refstruc@hu + \let\@@magyar@refstrucparen \@@magyar@refstrucparen@hu + \let\@@magyar@strucname\@@magyar@strucname@hu +} + +\ifnum\magyar@opt@@refstruc \expandafter\ifx\csname refstruc\endcsname\relax1\fi>1 % 21, 2, 11, 1 + \DeclareRobustCommand\refstruc{\@@magyar@refstruc}% + \DeclareRobustCommand\refstrucparen{\@@magyar@refstrucparen}% +\fi +\@gobble +{^} + +% --- Printing dates; emitdate= + +\ifnum\magyar@opt@@emitdate=0 \@@magyar@skiplong\fi +%** @param #1 1..12 (month number) +\def\@@magyar@month@a#1{\two@digits{#1}}% +\def\@@magyar@month@b#1{\ifcase#1\or janu\'ar\or febru\'ar\or m\'arcius\or + \'aprilis\or m\'ajus\or j\'unius\or j\'ulius\or augusztus\or szeptember\or + okt\'ober\or november\or december\fi}% +\def\@@magyar@month@c#1{\ifcase#1\or jan\or feb\or m\'arc\or + \'apr\or m\'aj\or j\'un\or j\'ul\or aug\or szept\or + okt\or nov\or dec\fi.\hbox{}}% +\def\@@magyar@month@d#1{\@Roman{#1}}% + +\def\@@magyar@four@digits#1{% + \ifnum#1<10 000\else\ifnum#1<100 00\else\ifnum#1<1000 0\fi\fi\fi\number#1% +} + +\def\@@magyar@date@a#1#2#3{#1-\@@magyar@month@a{#2}-\two@digits{#3}} +\def\@@magyar@date@b#1#2#3{#1.~\@@magyar@month@b{#2} \number#3\@@magyar@told@optdot\hbox{}}% Dat: \hbox is to force \frenchspacing +\def\@@magyar@date@c#1#2#3{#1.~\@@magyar@month@c{#2} \number#3\@@magyar@told@optdot\hbox{}} +\def\@@magyar@date@d#1#2#3{#1.~\@@magyar@month@d{#2}.\ \number#3\@@magyar@told@optdot\hbox{}} +\def\@@magyar@date@e#1#2#3{#1.~\@@magyar@month@a{#2}.\ \two@digits{#3}\@@magyar@told@optdot\hbox{}} +\def\@@magyar@date@f#1#2#3{#1.~\@@magyar@month@b{#2}} +\def\@@magyar@date@g#1#2#3{#1.~\@@magyar@month@b{#2} \number#3}% Dat: \told{\@@magyar@date@g{1848}{3}{15}}+e{} +\def\@@magyar@date@h#1#2#3{#1~\@@magyar@month@b{#2}}% Imp: suffixes to months +\def\@@magyar@date@i#1#2#3{#1/\@@magyar@month@a{#2}/\two@digits{#3}}% not Hungarian + +\def\@@magyar@parsedate@a#1-#2-#3!#4\hfuzz{% ISO date: YYYY-MM-DD + \ifx\hfuzz#4\hfuzz\else \ifnum1<1\string#1\relax \ifnum1<1\string#2\relax \ifnum1<1\string#3\relax + \def\reserved@a{\@@magyar@fixdate{#1}{#2}{#3}}% + \fi\fi\fi\fi +} +\def\@@magyar@parsedate@b#1/#2/#3!#4\hfuzz{% LaTeX date: YYYY/MM/DD + \ifx\hfuzz#4\hfuzz\else \ifnum1<1\string#1\relax \ifnum1<1\string#2\relax \ifnum1<1\string#3\relax + \def\reserved@a{\@@magyar@fixdate{#1}{#2}{#3}}% + \fi\fi\fi\fi +} +\def\@@magyar@parsedate@c#1.#2.#3!#4\hfuzz{% English date: YYYY.DD.MM + \ifx\hfuzz#4\hfuzz\else \ifnum1<1\string#1\relax \ifnum1<1\string#2\relax \ifnum1<1\string#3\relax + \def\reserved@a{\@@magyar@fixdate{#1}{#3}{#2}}% + \fi\fi\fi\fi +} +\def\@@magyar@mon@jan{1}% +\def\@@magyar@mon@feb{2}% +\def\@@magyar@mon@mar{3}% +\def\@@magyar@mon@apr{4}% +\def\@@magyar@mon@maj{5}% +\def\@@magyar@mon@may{5}% english.ldf +\def\@@magyar@mon@jun{6}% +\def\@@magyar@mon@jul{7}% +\def\@@magyar@mon@aug{8}% +\def\@@magyar@mon@sze{9}% +\def\@@magyar@mon@sep{9}% english.ldf +\def\@@magyar@mon@okt{10}% +\def\@@magyar@mon@oct{10}% english.ldf +\def\@@magyar@mon@nov{11}% +\def\@@magyar@mon@dec{12}% +\def\@@magyar@parsedate@d#1. #2#3#4#5 #6!#7\hfuzz{% {2003. oktober 25} with \catcodes 12 and 10 + \ifx\hfuzz#7\hfuzz\else + % Dat: now: {#1} is {2003}, {#2#3#4#5} is {oktober}, {#6} is {25} + \ifnum1<1\string#1\relax \ifnum1<1\string#6\relax + \lowercase{% + \expandafter\ifx\csname @@magyar@mon@#2#3#4\endcsname\relax\else + %%\errmessage{(#1)(#2#3#4)(#6)}% + \edef\reserved@a{\noexpand\@@magyar@fixdate{\number#1}{\csname @@magyar@mon@#2#3#4\endcsname}{\number#6}}\fi + }% + \fi\fi\fi +} +\def\@@magyar@parsedate@e#1#2#3#4 #5, #6!#7\hfuzz{% {October 25, 2003} with \catcodes 12 and 10 + \ifx\hfuzz#7\hfuzz\else + \ifnum1<1\string#5\relax \ifnum1<1\string#6\relax + \lowercase{% + \expandafter\ifx\csname @@magyar@mon@#1#2#3\endcsname\relax\else + \edef\reserved@a{\noexpand\@@magyar@fixdate{\number#6}{\csname @@magyar@mon@#1#2#3\endcsname}{\number#5}}\fi + }% + \fi\fi\fi +} + +\def\@@magyar@parsedate@f#1/#2/#3:#4!#5\hfuzz{% LaTeX default \today: YYYY/MM/DD:XX:YY + \ifx\hfuzz#5\hfuzz\else \ifnum1<1\string#1\relax \ifnum1<1\string#2\relax \ifnum1<1\string#3\relax + \def\reserved@a{\@@magyar@fixdate{#1}{#2}{#3}}% + \fi\fi\fi\fi +} + +\def\@@magyar@stripdot@lowa#1.\relax{#1\relax}% +\def\@@magyar@stripdot@lowb#1\relax#2\relax{#1}% +%** by pts@fazekas.hu at Sun Jul 27 15:17:57 CEST 2003 +%** Expands to #1, with a single optional dot (token `.') at the end removed. +%** @param #1 a token list not containing `\relax' (sic) +\def\@@magyar@stripdot#1{\expandafter\@@magyar@stripdot@lowb\@@magyar@stripdot@lowa#1\relax.\relax}% + +%** Definies \reserved@a to {{YYYY}{MM}{DD}} (possibly fewer digits). Parsing +%** is not perfect, but can distinguish between the known formats +%** @param #1 a date in any format, will be expanded +\def\@@magyar@parsedate#1{% + %\let\@@protect\protect \let\protect\@gobble \afterassignment\restore@protect + \begingroup + \def\today{\the\year-\the\month-\the\day}% ISO format + \let\protect\string + \let\'\@firstofone% Dat: (j\'unius, janu\'ar, okt\'ober) date won't contain other accents -- I hope + \let~\space + % ^^^ change `2003.~okt\'ober 25.' to `2003. oktober 25.' + \edef\reserved@b{\def\noexpand\reserved@b{#1}}% + \expandafter\endgroup\reserved@b + \edef\reserved@b{\expandafter\@@magyar@stripdot\expandafter{\reserved@b}}% + %%\show\reserved@b\tracingmacros1 + % vvv Wizardry: deep, parsing dates + \let\reserved@a\@empty \expandafter\@@magyar@parsedate@a\reserved@b!--!\hfuzz + \ifx\reserved@a\@empty \expandafter\@@magyar@parsedate@f\reserved@b!//:!\hfuzz \fi + \ifx\reserved@a\@empty \expandafter\@@magyar@parsedate@b\reserved@b!//!\hfuzz \fi + \ifx\reserved@a\@empty \expandafter\@@magyar@parsedate@c\reserved@b!..!\hfuzz \fi + \ifx\reserved@a\@empty \expandafter\@@magyar@parsedate@d\reserved@b!. xyz !\hfuzz \fi + \ifx\reserved@a\@empty \expandafter\@@magyar@parsedate@e\reserved@b!xyz , !\hfuzz \fi + %%\show\reserved@a + \ifx\reserved@a\@empty + \@@magyar@error{Unrecognised date: \reserved@b}% + %\@@magyar@fixdate{0}{1}{1}}% + \def\reserved@a{{0}{1}{1} {\noexpand\reset@font\noexpand\bfseries \string?date\string?}}% + \else + \reserved@a% calls \@@magyar@fixdate, which sets \reserved@a + \fi + %%\show\reserved@a +}% +%** Definies \reserved@a to {{YYYY}{MM}{DD}} (possibly fewer digits) +%** @param #1 year (50..99 += 1900, 0..49 += 2000) +%** @param #2 month (1..12) +%** @param #3 day of month (1..31), validity of 29..31 not verified +\def\@@magyar@fixdate#1#2#3{% + \edef\reserved@a{\number#1}% + \ifnum\reserved@a<0 \def\reserved@a{0}\@@magyar@error{Year too small: #1}\else + \ifnum\reserved@a<10 \edef\reserved@a{200\reserved@a}\else + \ifnum\reserved@a<50 \edef\reserved@a{20\reserved@a}\else + \ifnum\reserved@a<100 \edef\reserved@a{19\reserved@a}\else + \ifnum\reserved@a<10000 \else + \def\reserved@a{0}\@@magyar@error{Year too large: #1}% + \fi\fi\fi\fi\fi + \ifnum#2<1 \@@magyar@error{Month too small: #2}\fi% Imp: reset to 0? + \ifnum#2>12 \@@magyar@error{Month too large: #2}\fi + \ifnum#3<1 \@@magyar@error{Day of month too small: #3}\fi% Imp: reset to 0? + \ifnum#3>31 \@@magyar@error{Day of month too large: #3}\fi + \edef\reserved@a{{\reserved@a}{\number#2}{\number#3}}% +} + +%** Usage: \magyar@emitdate{FMT}{DATE} or \magyar@emitdate[SUFFIX]{FMT}{DATE} +%** @example [\emitdate{b}{October 25, 2003}] +%** @example %[\emitdate{b}{x-y-z}]% ! Package magyar.ldf Error: Unrecognised date: x-y-z. +%** @example A mai dtum: [\emitdate{b}{\today}]. +%** @example [\emitdate[e]{g}{1848.15.3}] a nap, mikor elhangzott a Nemzeti dal. +%** @example [\emitdate{b}{1956-10-23}] +%** @example \told{\@@magyar@date@g{1848}{3}{115}}+a{} +%** @param SUFFIX any suffix for \told, e.g `e' or `adik+an' +%** @param DATE date in any format, will be expanded +%** @param FMT a single letter, specifies the format of the emitted date +%** a: 1848-03-15 (ISO dtumformtum, 2002-tl(?) a magyar helyesrs rsze) +%** b: 1848.\ mrcius 15. +%** c: 1848.\ mrc.\ 15. +%** d: 1848.\ III.\ 15. +%** e: 1848.\ 03.\ 15. +%** f: 1848. mrcius kzepe +%** g: 1848. mrcius 15[-e reggele] +%** h: 1848 mrcius [hnapjnak kzepe, mrciusnak kzepe, mrciusban stb.] birtokos rag +%** english.ldf: `October 25, 2003' or [UK]: `25th October 2003' +\def\@@magyar@emitdate{% + \@ifnextchar[\@@magyar@emitdate@opt{\@@magyar@emitdate@opt[]}%] +} +\def\@@magyar@emitdate@opt[#1]#2#3{% + \begingroup + \@@magyar@parsedate{#3}% + % Imp: error message if \@@magyar@told is undefined + %\show\reserved@a + \edef\reserved@a{% + \ifx\vfuzz#1\vfuzz \expandafter\noexpand\csname @@magyar@date@#2\endcsname\reserved@a + \else \noexpand\@@magyar@told{\expandafter\noexpand\csname @@magyar@date@#2\endcsname\reserved@a}+#1{}\fi + }% + %\show\reserved@a + %%\show~ + %\show\reserved@a% \told {\@@magyar@date@g {1848}{3}{15}}+e{} + \reserved@a + \endgroup +} + +\ifnum\magyar@opt@@emitdate \expandafter\ifx\csname emitdate\endcsname\relax1\fi>1 % 21, 2, 11, 1 + \let\emitdate\@@magyar@emitdate +\fi +\@gobble +{^}% + +% --- titleskip= + +\ifx\magyar@opt@@titleskip\magyar@@unchanged + \def\magyar@opt@@titleskip{\enspace}% for the appendix with appendixdot=no +\@@magyar@skiplong\fi + \expandafter\addto\csname extras\CurrentOption\endcsname{\magyar@@seccntfix}% + \let\magyar@@seccntfix\@empty + \let\magyar@@default@seccntformat\@seccntformat + \AtBeginDocument{% + % vvv \ifx added for compatiblity with other packages redefining \@seccntformat _after_ magyar.ldf has been loaded + \ifx\@seccntformat\magyar@@default@seccntformat + % \@seccntformat affects dot after the section number in the main text. + % We don't change the TOC file, because we've changed \numberline. Also + % \ps@headings in book.cls already contains a dot. + \def\magyar@@seccntfix{% + \ifx\@seccntformat\@gobble\else + \babel@save\@seccntformat + \def\@seccntformat##1{\csname the##1\endcsname.\magyar@opt@@titleskip}% + \fi + } + \fi + } + \@gobble +{^}% + +% --- footnote= + +\if0\magyar@opt@@footnote \@@magyar@skiplong\fi + %** Overrides latex.ltx. Expand old contents of \cl@#2 only once. + \def\@addtoreset#1#2{% + \begingroup + \edef\reserved@a{\noexpand\@elt{#1}}% + \expandafter\magyar@fo@consra\csname cl@#2\endcsname\gdef + \endgroup + } + %** Similar to \@cons in latex.ltx + %** Appends first-level expansion of \reserved@a + %** @param #1 a \cs + %** @param #2 \def or \gdef + \def\magyar@fo@consra{\expandafter\magyar@fo@cons\expandafter{\reserved@a}}% + %** @param #1 tokens to append + %** @param #2 a \cs + %** @param #3 \def or \gdef + \def\magyar@fo@cons#1#2#3{\expandafter#3\expandafter#2\expandafter{#2#1}}% + + % vvv Dat: \@definecounter can be called twice, \newcounter cannot + \@definecounter{footnote@add}% \newcounter{footnote@add} + %** Number of times footnote numbering has been reset + \@definecounter{footnote@ch} + + \def\magyar@fo@pickzero#1#2#3\hfuzz#4{% + \ifx\relax#1\else \def#4{{#1}{#2}}\fi% pick {#1}{#2} + } + %** Dat: footnotes inside \begin{minipage} are not affected -- intentionally. + %** Will be called by \stepcounter{...} after `\advance\c@footnote1' + \def\magyar@fo@resetzero@afterpage{% + {% { is better \begingroup, because { works in a tabular + \@tempcnta\c@footnote@add + \advance\@tempcnta\c@footnote + \let\reserved@a\@empty% default + % Dat: we ignore \@roman etc. in \thefootnote + \expandafter\expandafter\expandafter\magyar@fo@pickzero\csname r@footnote&\the\c@footnote@ch&\the\@tempcnta\endcsname00\hfuzz\reserved@a% this footnote + \ifx\reserved@a\@empty \G@refundefinedtrue\fi + % + \def\magyar@fo@@prevfn{-}% default + \advance\@tempcnta\m@ne + \expandafter\expandafter\expandafter\magyar@fo@pickzero\csname r@footnote&\the\c@footnote@ch&\the\@tempcnta\endcsname00\hfuzz\magyar@fo@@prevfn% previous footnote + \advance\@tempcnta\@ne + % + \ifx\reserved@a\magyar@fo@@prevfn\else + % Restart footnote numbering (from 1) if \label is missing for previous + % footnote, or \label reports that prev and this footnotes aren't on the + % same page. + \global\advance\c@footnote@add\c@footnote + \global\advance\c@footnote@add\m@ne + \global\c@footnote\@ne + \fi + \def\@currentlabel{\noexpand\number\c@page}% + % ^^^ Dat: \noexpand is here to make \number\c@page expanded during \shipout + \ifx\@listdepth\@mplistdepth% inside \begin{minipage} + % vvv Dat: expand \thepage both early (minipage) and late (real page) + \edef\@currentlabel{\@currentlabel-\thepage}% + \fi + \edef\reserved@a{\noexpand\label{footnote&\the\c@footnote@ch&\the\@tempcnta}}% + % ^^^ Dat: the \label command above produces correct warning (LaTeX + % Warning: Label(s) may have changed. Rerun to get cross-references + % right.), and it also produces `LaTeX Warning: There were undefined + % references.' in case a footnote is removed or changed, and also for + % the very first run. Fine. + \reserved@a + }%\endgroup + } + + \let\magyar@fo@resetzero\relax + + %\magyar@fo@cons{XY}\cl@footnote\gdef + \magyar@fo@cons{\magyar@fo@resetzero}\cl@footnote\gdef + + %\def\magyar@fo@resetadd{% + % \global\advance\c@footnote\c@footnote@add + % \global\c@footnote@add\z@ + %} + \def\magyar@fo@aftergrouprelax#1{% + \ifx#1\relax\else + \aftergroup#1% + \expandafter\magyar@fo@aftergrouprelax + \fi + } + + \def\magyar@fo@mtostar#1{% + \if#1m% + *\expandafter\magyar@fo@mtostar + \fi + } + %** Producing `m's based on the idea of David Kastrup. + %** The default `*' character is in raised position, and we also move it to + %** \@textsuperscript, so it will be double raised. But never mind. + \def\magyar@fo@thefootnote@stars{\expandafter\magyar@fo@mtostar\romannumeral\number\c@footnote000A}% + \def\magyar@fo@thefootnote@starsspmax{\ifcase\c@footnote\or*\or**\or***\or\dag\or\dag\dag\or\dag\dag\dag\else*\the\c@footnote\fi}% + \def\magyar@fo@thefootnote@arabic{\@arabic\c@footnote} + \def\magyar@fo@thempfootnote@stars{\expandafter\magyar@fo@mtostar\romannumeral\number\c@mpfootnote000 A}% + \def\magyar@fo@thempfootnote@starsspmax{\ifcase\c@mpfootnote\or*\or**\or***\or\dag\or\dag\dag\or\dag\dag\dag\else*\the\c@mpfootnote\fi}% + \def\magyar@fo@thempfootnote@arabic{\@arabic\c@mpfootnote} + + % !! indent=article must work within \maketitle for article.cls etc. + + %** Copied from article.cls, added \,. + %** Has #1, but partially applied here + \def\magyar@fo@indent@articlesp{% + \parindent1em % SUXX: impossible to acquire default value + % Dat: don't use \@makefnmark here, because it puts the footnote mark + % only to the main text + \noindent\hb@xt@1.8em{\hss\@textsuperscript{\normalfont\@thefnmark\,}}% + } + %** Same as \@makefntext in article.cls + %** Has #1, but partially applied here + \def\magyar@fo@indent@articlenosp{% + \parindent1em % SUXX: impossible to acquire default value + % Dat: don't use \@makefnmark here, because it puts the footnote mark + % only to the main text + \noindent\hb@xt@1.8em{\hss\@textsuperscript{\normalfont\@thefnmark}}% + } + \def\magyar@@fo@indent@dimensetup{% + \parindent1em % SUXX: impossible to acquire default value + %\advance\leftskip1.8em % SUXX: impossible to acquire default value + \leftskip\leftmargini % SUXX: impossible to acquire default value + } + %** Has #1, but partially applied here + \def\magyar@fo@indent@hulist{% + % Dat: superscript is emitted by \@makefnmark + % Dat: \parindent doesn't apply for the 1st par of the footnote + \magyar@@fo@indent@dimensetup + \ifvmode\noindent\hb@xt@\z@\else\hbox\fi + % ^^^ \usepackage[para]{footmisc} emits footnotes in horizontal mode + {\hss\@textsuperscript{\normalfont\@thefnmark\,}}% + } + + %** Limit the size of the footnote mark (in main text) to \normalsize. + %** Overrides latex.ltx + \def\magyar@fo@makefnmark{% + \hbox{% has \begingroup + \edef\reserved@a{\f@size}% + {\normalsize\edef\reserved@b{\def\noexpand\reserved@b{\f@size}}\expandafter}\reserved@b + \ifdim\reserved@a pt>\reserved@b pt + %\normalsize\@textsuperscript{\normalfont\footnotesize\@thefnmark}% Dat: would place index too low + \@textsuperscript{\normalfont\scriptsize\@thefnmark}% + \else\@textsuperscript{\normalfont\@thefnmark}\fi + }% + } + \let\magyar@fo@@cont@number\@empty + \def\magyar@fo@savecont{\global\edef\magyar@fo@@cont@number{\global\c@footnote\the\c@footnote\space}} + + %** \footnoterule, as defined in latex.ltx + \def\magyar@fo@defaultrule{\kern-3\p@ + \hrule \@width 2in \kern 2.6\p@} % the \hrule is .4pt high + \def\magyar@fo@fourthrule{\kern-3\p@%\hrule\hrule\hrule + \hrule \@width .25\textwidth \kern 2.6\p@} % the \hrule is .4pt high + \def\magyar@fo@onelinerule{% + \unskip% undo \vskip\skip\footins + {\normalsize% Dat: \normalfont is superfluous + \vskip1\baselineskip plus.1\baselineskip minus .1\baselineskip}% + % ^^^ Dat: plus,minus is necessary to avoid `Overfull \vbox (8.86676pt too high)' + } + \def\magyar@fo@chooserule{\relax + \ifx \@listdepth\@mplistdepth \mpfootnoterule \else + \ifnum\split@prev=\z@ \pagefootnoterule \else \splitfootnoterule + \fi + %%\typeout{\string\split@prev=\split@prev}% + \xdef\split@prev{\the\insertpenalties}% + \fi + } + + % `Szerkesztk s szerzk kziknyve, p. 116' says this about Hungarian + % footnotes. Implementation notes are marked with [...]. See better docs + % in magyarldf-doc.tex + % + % (1) Use numbering and/or stars (in upper index) for footnote marks. + % Numbering is recommended. + % [1] Use \footnotestyle{mark=...} + % (2) You can put footnotes by the editor with a star, and footnotes by the + % author with numbers. + % [2] Use \footnotestyle{huplain} in the preamble, and emit each editorial + % footnote with {\footnotestyle{editor}\footnote{Her note.}} + % (3) Don't put \footnoterule if the footnote starts on current page. + % [3] Use \footnotestyle{rule=none}. Please make sure that the group lasts + % till \shipout. + % (4) Put a \footnoterule (1/3\textwidth or 1/4\textwidth) if footnote is + % continued from previous page. + % [4] Not supported. Imp: how to? + % (5) Multiple short footnotes may be put into a single line. + % [5] \usepackage[para]{footmisc} or \usepackage{fnpara} + % (6) Footnotes for \begin{figure} and \begin{table} must be put just under + % them, not at EOP. + % [6] The author should enclose the matrial in a \begin{minipage} + % (7) The size of the \footnotemark should not be scaled up. + % [7] Use \footnotestyle{marksize=max-normal} + % (8) It is possible to use either \parindent or \item when starting a + % footnote. + % [8] Use \footnotestyle{indent=hulist} + % (9) The footnotemark must be followed by a thin space (only at BOP). + % [9] OK, see \@makefntext + % (10) Don't emit too much stars. Recommended: * ** *** + ++ +++ + % [10] OK, see \footnoterule{mark=stars-max}. `\dag' is emitted instead + % of `+', and `*7' is emitted for the 7th footnote on the page. + % + + \@namedef{fos@reset=none}{\let\magyar@fo@resetzero\relax}% + %** Similar to \@addtoreset{footnote}{section}, but isn't \global. + \@namedef{fos@reset=section}{% + \let\magyar@fo@resetzero\relax + \magyar@fo@cons{\@elt{footnote}}\cl@section\def + \magyar@fo@cons{\@elt{footnote}}\cl@chapter\def + }% + \@namedef{fos@reset=chapter}{% + \let\magyar@fo@resetzero\relax + \magyar@fo@cons{\@elt{footnote}}\cl@chapter\def + }% + %** Next footnote-mark will be `*'. The slots of `*'s of \fos@huplain + %** were skipped when changing back to \fos@plain. Restarts numbering from + %** 1 (`*'). Usually called as \footnotestyle{resume,reset=page-cont} + \@namedef{fos@reset=page}{% + \stepcounter{footnote@ch}% + \global\c@footnote@add\z@% + \global\c@footnote\z@% + \let\magyar@fo@resetzero\magyar@fo@resetzero@afterpage + %\aftergroup\magyar@fo@resetadd% switched off deliberately + } + %** editorial footnote on the same page + \@namedef{fos@reset=page-cont}{% + \aftergroup\magyar@fo@savecont + \fos@resume% only \aftergroup + \magyar@fo@@cont@number + \let\magyar@fo@resetzero\magyar@fo@resetzero@afterpage + } + \@namedef{fos@reset=page-resume}{% + \fos@resume \csname fos@reset=page\endcsname + } + %** Resume to the previous footnote number at the end of the group. (Default: don't resume) + %** \footnotestyle{resume,reset=page} is the correct order + \def\fos@resume{% + \aftergroup\global + \aftergroup\c@footnote + \expandafter\magyar@fo@aftergrouprelax\the\c@footnote\relax + \aftergroup\space + %\magyar@fo@resetadd% Dat: not needed because \magyar@fo@resetzero@afterpage won't find prev. ref + } + % + \@namedef{fos@indent=article-sp}{\let\@makefntext\magyar@fo@indent@articlesp}% + \@namedef{fos@indent=article-nosp}{\let\@makefntext\magyar@fo@indent@articlenosp}% + \@namedef{fos@indent=hulist}{\let\@makefntext\magyar@fo@indent@hulist}% + %** This is not a 100% solution, because there might be multiple iterations + %** of \footnoterule with different \split@prev values. + \@namedef{fos@rule=choose}{% ripped from footmisc.sty + \ifx\footnoterule\magyar@fo@chooserule + \let\footnoterule\magyar@fo@defaultrule + \fi + \expandafter\ifx\csname pagefootnoterule\endcsname\relax \let \pagefootnoterule\footnoterule\fi + \expandafter\ifx\csname mpfootnoterule\endcsname\relax \let \mpfootnoterule\footnoterule\fi + \expandafter\ifx\csname splitfootnoterule\endcsname\relax \let\splitfootnoterule\magyar@fo@fourthrule\fi + \expandafter\ifx\csname split@prev\endcsname\relax \gdef\split@prev{0}\fi + % ^^^ Dat: \split@prev is named the same in footmisc.sty + \let\footnoterule\magyar@fo@chooserule + } + \@namedef{fos@rule=none}{\let\footnoterule\@empty}% + \@namedef{fos@rule=fourth}{\let\footnoterule\magyar@fo@fourthrule}% + \@namedef{fos@rule=one-line}{\let\footnoterule\magyar@fo@onelinerule}% + \@namedef{fos@marksize=max-normal}{\let\@makefnmark\magyar@fo@makefnmark}% + \@namedef{fos@mark=arabic}{\let\thefootnote\magyar@fo@thefootnote@arabic}% + \@namedef{fos@mark=stars}{\let\thefootnote\magyar@fo@thefootnote@stars}% + \@namedef{fos@mark=stars-max}{\let\thefootnote\magyar@fo@thefootnote@starsspmax}% + \@namedef{fos@mpmark=arabic}{\let\thempfootnote\magyar@fo@thempfootnote@arabic}% + \@namedef{fos@mpmark=stars}{\let\thempfootnote\magyar@fo@thempfootnote@stars}% + \@namedef{fos@mpmark=stars-max}{\let\thempfootnote\magyar@fo@thempfootnote@starsspmax}% + %\def\fos@globalmark{\expandafter\global\expandafter\let\csname the\@mpfn\endcsname\endcsname\thefootnote} + %\def\fos@globalmpmark{\global\let\thempfootnote\thefootnote} + + \def\fos@plain{\csname fos@reset=none\endcsname\csname fos@mark=arabic\endcsname} + \def\fos@huplain {\csname fos@marksize=max-normal\endcsname \csname fos@reset=none\endcsname\csname fos@mark=arabic\endcsname\csname fos@rule=none\endcsname\csname fos@indent=hulist\endcsname} + \def\fos@starplain{\fos@huplain\csname fos@reset=page\endcsname\csname fos@mark=stars-max\endcsname}% + %\def\fos@editor{\fos@resume\fos@starplain}% + \def\fos@editor{\fos@huplain\csname fos@reset=page-cont\endcsname\csname fos@mark=stars-max\endcsname}% + + \def\footnotestyle#1{% + \@for\reserved@a:=#1\do{% + \@ifundefined{fos@\reserved@a}{\@latex@error{Undefined footnote style: \reserved@a}\@ehc}% + {\csname fos@\reserved@a\endcsname}% + }% + } + + \def\editorfootnote#1{\begingroup\footnotestyle{editor}% + \footnote{#1}\endgroup}% + \def\headingfootnote{% + \ifx\protect\@typeset@protect\expandafter\footnote + \else\expandafter\@gobble\fi + % ^^^ Dat: this test is better, because it makes magyar.ldf compatible + % with nath.sty that says \def\protect{\noexpand} in its redefinition + % of \addtocontents + %\ifx\protect\@unexpandable@protect\expandafter\@gobble + %\else\expandafter\footnote\fi + } + + %** @param #1 an end-csname, example: \endfigure + \def\magyar@fo@mp@setup#1{% + \let\@footnotetext\@mpfootnotetext + \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@ + % ^^^ This line is optional, but strongly recommended. Restart numbering + % for each float, and number with \thempfootnote. + % vvv Very tricky use of `#' in expansion. + % Dat: \magyar@fo@mp@show is idempotent + % vvv Prepend \magyar@fo@mp@show to the definition of \@makecaption + \expandafter\def\expandafter\@makecaption\expandafter##\expandafter1% + \expandafter##\expandafter2\expandafter{\expandafter\magyar@fo@mp@show% + \@makecaption{##1}{##2}% + }% + %%\show\@currenvir + % vvv Dat: this prepending has only local effect. + \expandafter\def\expandafter#1\expandafter{% + \expandafter\magyar@fo@mp@show#1}% + %\expandafter\magyar@fo@mp@prepend\csname\@currenvir\endcsname + \setbox\@mpfootins\box\voidb@x + } + \def\magyar@fo@mp@show{% ripped from latex.ltx (\endminipage) + \ifvoid\@mpfootins\else + \par\unskip \vskip\skip\@mpfootins + \normalcolor \footnoterule + \expandafter\ifx\csname mpmakefootnoteparagraph\endcsname\relax + \unvbox\@mpfootins + \else% fnpara.sty + \mpmakefootnoteparagraph + \fi + \fi + } + + %** Only works if \cs of #1 doesn't have macro arguments. It works for + %** \figure and \table, because their optional argument `[b]' etc. is not + %** a macro argument. + %** @example \makeFootnotable{figure} + %** @example \makeFootnotable{} -- current instance of current environment + \def\makeFootnotable#1{% + \if\relax#1\relax + \expandafter\magyar@fo@mp@setup\csname end\@currenvir\endcsname + \else + \expandafter\expandafter\expandafter\magyar@fo@makef@low + \expandafter\expandafter\csname #1\endcsname + \csname end#1\endcsname + \fi + } + %** @example \magyar@fo@makef@low\table\endtable + \def\magyar@fo@makef@low#1#2{\expandafter\def\expandafter#1\expandafter{% + \expandafter\magyar@fo@mp@setup\expandafter#2#1}}% + + \if2\magyar@opt@@footnote \fos@huplain\fi + \if3\magyar@opt@@footnote \fos@starplain\fi + \@gobble +{^} + +% --- mathbrk= + +\if0\magyar@opt@@mathbrk \@@magyar@skiplong\fi + %** Similar to \@@magyar@fixmathcmd@low, but inserts symbol immediately. + %** @param #1 `\mathchar', all catcodes + %** @param #2 hex code + %** @param #3 ignored + %** @param #4 a \cs + \def\@@magyar@breakmathcmd@low#1"#2"#3\hfuzz#4{% + \def\reserved@a{#1}% + \edef\reserved@b{\string\mathchar}% + \ifx\reserved@a\reserved@b + \mathchar"#2 + \ifnum"#2<"8000 % redundant sanity check, trueness implied by #1==\mathchar + \nobreak\discretionary{}{\hbox{\(\mathchar"#2 \)}}{}% + \fi + \fi + }% + %** Dat: robustness is tested and works with nath.sty + %** @param #1 a \cs or char of a MathBin or MathRel, e.g `\prec' or `+' + \DeclareRobustCommand\MathBrkAll[1]{% + \ifcat\noexpand#1\relax + \expandafter\@@magyar@breakmathcmd@low\meaning#1""\hfuzz#1% + \else + \ifnum\mathcode`#1="8000 + \expandafter\expandafter\expandafter#1% keep original meaning + \else + \mathchar\the\mathcode`#1\relax% disable \active meaning + \ifnum\mathcode`#1<"8000 % redundant sanity check + \nobreak\discretionary{}{\hbox{\(\mathchar\the\mathcode`#1\relax\)}}{}% + \fi + \fi + \fi + } + \let\MathBrk\relax + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\MathBrk + \let\MathBrk\MathBrkAll + } + \@gobble +{^} + +\if2\magyar@opt@@mathbrk\else \@@magyar@skiplong\fi % mathbrk=fix + \def\@@magyar@resetmathchars{% + \mathcode`+"202B \catcode`+12 + \mathcode`-"2200 \catcode`-12 + \mathcode`*"2203 \catcode`*12 + \mathcode`/"013D \catcode`/12 + \mathcode`>"313E \catcode`>12 + \mathcode`<"313C \catcode`<12 + \mathcode`="303D \catcode`=12 + % vvv Dat: leave these chars intact, for compatibility (with nath.sty and others) + %\mathcode`:"303A \catcode`:12 + %\mathcode`;"603B \catcode`;12 + %\mathcode`,"613B \catcode`,12 + %\mathcode`!"5021 \catcode`!12 + %\mathcode`?"503F \catcode`?12 + %\mathcode`|"026A \catcode`|12 + %\mathcode`."013A \catcode`.12 + } + %** Dat: don't do `/', because slash is unbreakable + \def\@@magyar@domathbins{% + \do-\@@magyar@fix@newmcodes@dash + \do+\do*\do>\do<\do=}% + %** @param #1 a char token with \mathcode != "8000, like + + \def\@@magyar@fixmathbinchar#1{% + \ifnum\mathcode`#1="8000 \else + % Dat: \(...\) is safer than `$...$', because \( has a fixed \catcode + % that works with and w/o nath.sty + \begingroup\lccode\string`~\string`#1\lowercase{\endgroup\edef~}{% + \mathchar\the\mathcode`#1\relax% Dat: would need \space\space + \noexpand\ifx\noexpand\MathBrk\noexpand\MathBrkAll% Hungarian language is active + \nobreak\discretionary{}{\hbox{\noexpand\(\mathchar\the\mathcode`#1 \noexpand\)}}{}% + \noexpand\fi}% + \mathcode`#1"8000 + \fi + \catcode`#112 + } + %** \newmcodes@ defined in amsopn.sty doesn't work (triggered by + %** \DeclareMathOperator{\tg}{tg} $\tg$) because it wants to assign + %** \mathchardef\std@minus\mathcode`\-, which is "8000, which is a bad + %** matchar. We fix that by prepending \mathcode`-45 to \newmcodes@ . + %** This is OK, because \newmcodes@ is protected by a block set up by + %** \qopname. + \def\@@magyar@newmcodes@fixed{\mathcode`-"45 \magyar@@newmcodes}% + \def\@@magyar@fix@newmcodes@dash{% + \ifx\newmcodes@\@undefined\else + \ifx\newmcodes@\@@magyar@newmcodes@fixed\else % Protect against double redefinition such as in \begin{align*}\tg\end{align*} + \let\magyar@@newmcodes\newmcodes@ + \let\newmcodes@\@@magyar@newmcodes@fixed + \fi + \fi + }% + + %** @param #1 `\mathchar', all catcodes + %** @param #2 hex code + %** @param #3 ignored + %** @param #4 a \cs + \def\@@magyar@fixmathcmd@low#1"#2"#3\hfuzz#4{% + % Imp: check \cong and \notin with txfonts and pxfonts. Do they look OK? + \def\reserved@a{#1}% + \edef\reserved@b{\string\mathchar}% + \ifx\reserved@a\reserved@b + \ifnum"#2<"8000 % redundant sanity check, trueness implied by #1==\mathchar + % Make #4 robust. + \edef#4{\noexpand\protect\expandafter\noexpand\csname + \expandafter\@gobble\string#4 \endcsname}% + % vvv Imp: \def would be better than \edef? + \expandafter\edef\csname\expandafter\@gobble\string#4 \endcsname{% + % Dat: \mathchar already produces: `! Missing $ inserted.' + \mathchar"#2 + \noexpand\ifx\noexpand\MathBrk\noexpand\MathBrkAll% Hungarian language is active + \nobreak\discretionary{}{\hbox{\noexpand\(\mathchar"#2 \noexpand\)}}{}% + \noexpand\fi + }% + \fi + \fi + }% + %** Works even if #1 is undefined (but consumes hash memory) + %** @param #1 a \cs of a MathBin or MathRel, e.g \prec + \def\@@magyar@fixmathcmd#1{% + \expandafter\@@magyar@fixmathcmd@low\meaning#1""\hfuzz#1% + } + + \let\@@magyar@domathbins@prefix\@empty + \def\@@magyar@fixeverymathcmds@appendto#1{% + \expandafter\def\expandafter#1\expandafter{#1% append + \@@magyar@resetmathchars + \let\do\@@magyar@fixmathbinchar + \@@magyar@domathbins@prefix\@@magyar@domathbins% only in math mode start + }% + } + \def\@@magyar@fixeverymathcmds@setup{% + \expandafter\ifx\csname mathoptions@on\endcsname\relax% no nath.sty + \@@magyar@fixeverymathcmds@appendto\check@mathfonts + \else\@@magyar@fixeverymathcmds@appendto\mathoptions@on\fi + } + + % The definition of \@tabular contains a $, which calls + % \@@magyar@domathbins, which has some unintended side effects of changing + % \catcode values and the meaning of the active character : . This magic + % prevents the call to \@@magyar@domathbins . + % + % Test code: \author{a:b} \maketitle + % Test code: \def\foo{a:b} \begin{tabular}[t]{c}x\foo y\end{tabular} + \def\@@magyar@mathbins@tabularfix#1${% + #1\def\@@magyar@domathbins@prefix{% + \let\@@magyar@domathbins@prefix\@empty\@gobble}$}% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter\@tabular + \expandafter\expandafter\expandafter{% + \expandafter\@@magyar@mathbins@tabularfix\@tabular} + + \def\@@magyar@fixmathcmds{% + \let\do\@@magyar@fixmathcmd + % vvv Binary relations listed in Table 3.4 in lshort.dvi + \do\leq\do\le\do\ll\do\prec\do\preceq\do\subset\do\subseteq\do\sqsubset + \do\sqsubseteq\do\in\do\vdash\do\mid\do\smile\do\geq\do\ge\do\gg\do\succ + \do\succeq\do\supset\do\supseteq\do\sqsupset\do\sqsupseteq\do\ni\do\owns + \do\dashv\do\parallel\do\frown\do\notin\do\equiv\do\doteq\do\sim\do\simeq + \do\approx\do\cong\do\Join\do\bowtie\do\propto\do\models\do\perp\do\asymp + \do\neq\do\ne + % vvv Binary operators listed in Table 3.5 in lshort.dvi + %\do\cdot% unbreakable + \do\pm\do\times\do\cup\do\sqcup\do\vee\do\lor\do\oplus\do\odot\do\otimes + \do\bigtriangleup\do\lhd\do\unlhd\do\mp\do\div\do\setminus\do\cap\do\sqcap + \do\wedge\do\land\do\ominus\do\oslash\do\bigcirc\do\bigtriangledown\do\rhd + \do\unrhd\do\triangleleft\do\triangleright\do\star\do\ast\do\circ\do\bullet + \do\diamond\do\uplus\do\amalg\do\dagger\do\ddagger\do\wr + \edef\cdot{\noexpand\protect\csname cdot \endcsname}% + \expandafter\def\csname cdot \endcsname{\nobreak\mathchar"2201\nobreak}% + \def\slash{\nobreak/\nobreak}% only in math-mode start, \nobreak + % ^^^ Dat: \slash is fragile in latex.ltx + } + \AtBeginDocument{\@@magyar@fixmathcmds\@@magyar@fixeverymathcmds@setup} + \@gobble +{^} + +% --- mathfactorial= + +\if0\magyar@opt@@mathfactorial \@@magyar@skiplong\fi + % Imp: weak define? It doesn't conflict with nath.sty -- yet. + \def\factorial{\mathchar"5021\mathopen{}\mathinner{}} + \@gobble +{^} + +\if2\magyar@opt@@mathfactorial\else \@@magyar@skiplong\fi + \expandafter\addto\csname \expandafter\ifx\csname mathoptions@on\endcsname + \relax check@mathfonts\else mathoptions@on\fi\endcsname{% detect nath.sty + \catcode`!12 \mathcode`!"8000 + \begingroup\lccode`~`!\lowercase{\endgroup\def~}{\factorial}% + } + \@gobble +{^} + +% --- mathhucomma= + +\if0\magyar@opt@@mathhucomma \@@magyar@skiplong\fi + %** Dat: works for all catcodes, even for `end group character 5' + %** Inspired by Donald Aresenau + %** @param #1 the + %** @param #2 character + %** @example The sample in your article would be typed + %** \[ F_{i}(x,y) = y^i + 1,3x \qquad x,y \in A,\ i = 1, 2, 3,\ldots \] + \edef\@@magyar@hucomma@lowa#1#2 #3#4 #5#6\hfuzz{% + \noexpand\ifnum9<1#5 \noexpand\if#1t\noexpand\if#3c% + \noexpand\mathord\noexpand\fi\noexpand\fi\noexpand\fi\mathchar + \ifnum\mathcode`,="8000 "613B \else\the\mathcode`, \space\fi% immed expand + % Dat: "613B is the punctuation, "013B is ordinary + }% + %%\show\@@magyar@hucomma@lowa + \def\@@magyar@hucomma@lowb{\expandafter\@@magyar@hucomma@lowa\meaning\reserved@a/ / /\hfuzz}% + %** Put a \mathord, if it is followed by a digit; otherwise put a normal, + \DeclareRobustCommand\HuComma{\futurelet\reserved@a\@@magyar@hucomma@lowb} + \@gobble +{^} + +\if2\magyar@opt@@mathhucomma\else \@@magyar@skiplong\fi + % !! into \extrasmagyar + \expandafter\addto\csname \expandafter\ifx\csname mathoptions@on\endcsname + \relax check@mathfonts\else mathoptions@on\fi\endcsname{% detect nath.sty + \catcode`,12 \mathcode`,"8000 + \begingroup\lccode`~`,\lowercase{\endgroup\def~}{\HuComma}% + } + \@gobble +{^} + +% --- mathmuskips= + +% +\if1\magyar@opt@@mathmuskips% =latex, as defined in latex.ltx + \thickmuskip 5mu plus 5mu + \medmuskip 4mu plus 2mu minus 4mu + \thinmuskip 3mu +\fi +\if2\magyar@opt@@mathmuskips% =hu + \thickmuskip 4mu plus 2mu minus 4mu + \medmuskip 2mu plus 1.5mu minus 2mu % \medmuskip<\thinmuskip OK + \thinmuskip 3mu +\fi + +% --- hynumberline= +% by pts@fazekas.hu at Tue Nov 21 00:34:37 CET 2006 +% +% hynumberline=hu adds a dot after the section number in the bookmarks/outline +% with \hypersetup{bookmarksnumbered=true} in hyperref.sty. + +\if0\magyar@opt@@hynumberline \@@magyar@skiplong\fi + %** Overrides original definition (\def\Hy@numberline#1{#1 }) in + %** pdfmark.def. + %** Also possible with: + %** \pdfstringdefDisableCommands{\renewcommand*{\numberline}[1]{#1. }} + \def\@@magyar@@hynumberline@old#1{#1 }% as defined in pdfmark.def + \def\@@magyar@@hynumberline@hu #1{#1. }% + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \ifx \Hy@numberline\@@magyar@@hynumberline@old + \let\Hy@numberline\@@magyar@@hynumberline@hu \fi}% +\@gobble +{^}% + +% --- mathreal= + +\if0\magyar@opt@@mathreal \@@magyar@skiplong\fi + %** @param #1 a number with a possible decimal digit, e.g `12' or `-12.3' + \def\@@magyar@mathreal@lowa#1{\ensuremath{\@@magyar@mathreal@lowb#1\@gobble.}}% + \def\@@magyar@mathreal@lowb#1.{% + #1% + \@secondoftwo\@gobble% Wizardry: \@secondoftwo may be \@gobbled by token before `.' + {\mathchar"013B \@@magyar@mathreal@lowb}% + } + \DeclareRobustCommand\@@magyar@mathreal{\ensuremath}% + \expandafter\expandafter\expandafter\addto + \expandafter\expandafter\csname extras\CurrentOption\endcsname\expandafter{% + \expandafter\babel@save\csname @@magyar@mathreal \endcsname + \expandafter\let\csname @@magyar@mathreal \endcsname \@@magyar@mathreal@lowa}% + \ifnum\magyar@opt@@mathreal \expandafter\ifx\csname mathreal\endcsname\relax1\fi>1 % 21, 2, 11, 1 + \let\MathReal\@@magyar@mathreal + \fi +\@gobble +{^}% + +% --- \documentclass-specific modifications; classmod= + +% Callback which redefines \ps@headings and runs it again if needed, when +% magyar.ldf has an override for the standard \ps@headings, and +% \pagestyle{headings} is active either explictly (e.g. in article.cls) or +% by default (e.g. in book.cls). +\let\@@magyar@setup@psheadings\relax + +%** Localized definition which replaces \ps@headings, if appropriate. +\let\@@magyar@overridden@psheadings\@empty + +\ifx\magyar@opt@@classmod\relax\@@magyar@skiplong\fi + +%** Appends the first-level expansion of argless macro ##2 to ##1. +\def\magyar@letappendto#1#2{% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter#1% + \expandafter\expandafter\expandafter{% + \expandafter#1#2}}% + +%** Defines #1 to the concatenation of \partmark ... \subparagraphmark, +%** \oddfoot, \evenfoot, \oddhead, \evenhead. +\def\magyar@mark@fingerprint@def#1{% + % We have ! here because some macros (such as \partmark) have #1, which + % gets expanded by \expandafter + \def#1{markfp: }% + \ifx\partmark\@undefined + \expandafter\def\expandafter\reserved@b\expandafter{% + \expandafter{-partmark}}% + \else + \expandafter\def\expandafter\reserved@b\expandafter{% + \expandafter{\partmark!:partmark}}% + \fi + \magyar@letappendto#1\reserved@b + % + \ifx\chaptermark\@undefined + \expandafter\def\expandafter\reserved@b\expandafter{% + \expandafter{-chaptermark}}% + \else + \expandafter\def\expandafter\reserved@b\expandafter{% + \expandafter{\chaptermark!:chaptermark}}% + \fi + \magyar@letappendto#1\reserved@b + % + \expandafter\def\expandafter\reserved@b\expandafter{% + \expandafter{\sectionmark!:sectionmark}}% + \magyar@letappendto#1\reserved@b + \expandafter\def\expandafter\reserved@b\expandafter{% + \expandafter{\subsectionmark!:subsectionmark}}% + \magyar@letappendto#1\reserved@b + \expandafter\def\expandafter\reserved@b\expandafter{% + \expandafter{\paragraphmark!:paragraphmark}}% + \magyar@letappendto#1\reserved@b + \expandafter\def\expandafter\reserved@b\expandafter{% + \expandafter{\subparagraphmark!}}% + \magyar@letappendto#1\reserved@b + \expandafter\def\expandafter\reserved@b\expandafter{% + \expandafter{\@oddfoot!:oddfoot}}% + \magyar@letappendto#1\reserved@b + \expandafter\def\expandafter\reserved@b\expandafter{% + \expandafter{\@evenfoot!:evenfoot}}% + \magyar@letappendto#1\reserved@b + \expandafter\def\expandafter\reserved@b\expandafter{% + \expandafter{\@evenhead!:evenhead}}% + \magyar@letappendto#1\reserved@b + \expandafter\def\expandafter\reserved@b\expandafter{% + \expandafter{\@oddhead!:oddhead}}% + \magyar@letappendto#1\reserved@b + % Dat: don't use \@mkboth (\let\@mkboth\markboth) +}% + +%** Branches based on whether the \pagestyle has changed since loading the +%** class file. +%** @param #1 class file name, e.g. `book.cls'. Tested with book.cls and +%** report.cls. +%** @param #2 tokens to insert before fingerprinting the current page style. +%** @param implicit-#3 then-branch +%** @param implicit-#4 else-branch +\def\magyar@if@originalpagestyle#1#2{% + \begingroup + % article.cls calls \pagenumbering, which does a \gdef\thepage and + % \global\c@page=1. We'll cancel that below. + \let\magyar@@pagestyle@save@thepage\thepage + \edef\magyar@@pagestyle@save@c@page{\the\c@page\space} + \edef\magyar@@pagestyle@save@c@tocdepth{\the\c@tocdepth\space} + % Dat: no \paragraphmark or \subparagraphmark + % vvv Dat: already defined in latex.ltx + %\providecommand\sectionmark[1]{\relax} + %\providecommand\subsectionmark[1]{\relax} + #2\magyar@mark@fingerprint@def\@@magyar@now@marks + % + \def\ProvidesClass##1[##2]{}% + \def\NeedsTeXFormat##1[##2]{}% avoid ``can be used only in preamble'' + \long\def\DeclareOption##1##2{}% + \def\ExecuteOptions##1{}% + \def\ProcessOptions{}% + \def\DeclareOldFontCommand##1##2##3{}% + % + \def\magyar@gobbleopt[##1]{}% + % Dat: \newcommand etc. are not \global. Good. + \let\@onlypreamble\@gobble % In letter.cls . + \let\newdimen\@gobble + \let\newif\@gobble + \let\newskip\@gobble + \let\newmuskip\@gobble + \let\newcount\@gobble + \let\newbox\@gobble + \let\newtoks\@gobble + \let\newread\@gobble + \let\newwrite\@gobble + \let\newlaunguage\@gobble + \let\newlength\@gobble + \def\newcounter##1{\@ifnextchar[\magyar@gobbleopt{}}% + \def\setcounter##1##2{\@ifundefined{c@##1}{\@nocounterr{##1}}% + {\csname c@##1\endcsname##2\relax}} + %** Like \newcommand, but always overrides old values. + \def\magyar@defcommand{\@star@or@long\magyar@defcommand@low} + \def\magyar@defcommand@low##1{% + \begingroup + \escapechar\m@ne\xdef\@gtempa{\string##1}% + \endgroup + \expandafter\let\csname\@gtempa\endcsname\@undefined + \@star@or@long\new@command##1% + }% + \def\newcommand{\magyar@defcommand}% + \def\renewcommand{\magyar@defcommand}% + \def\magyar@defenvironment##1{% + \@ifundefined{##1}{}{% + \expandafter\let\csname ##1\endcsname\@undefined + \expandafter\let\csname end##1\endcsname\@undefined + }% + \@star@or@long\new@environment{##1}% + }% + \def\newenvironment{\magyar@defenvironment}% + \def\renewenvironment{\magyar@defenvironment}% + % + \ps@empty % Clean \@oddhead as of latex.ltx + \let\@mkboth\@gobbletwo + \let\@oddhead\@empty + \let\@evenhead\@empty + \let\@oddfoot\@empty + \let\@evenfoot\@empty + % + \def\input##1 {} % size10.clo etc. + \makeatletter \@@input #1 % + #2\magyar@mark@fingerprint@def\@@magyar@class@marks + %\message{AAA \meaning\@@magyar@now@marks}% + %\message{BBB \meaning\@@magyar@class@marks}% + \global\let\thepage\magyar@@pagestyle@save@thepage + \global\c@page\magyar@@pagestyle@save@c@page + \global\c@tocdepth\magyar@@pagestyle@save@c@tocdepth + \ifx\@@magyar@now@marks\@@magyar@class@marks + \endgroup\expandafter\@firstoftwo + \else + \endgroup\expandafter\@secondoftwo + \fi +} + +%\begingroup +%\magyar@mark@fingerprint@def\OOO +%\message{OOO \meaning\OOO}% +%\endgroup + +%** Branches based on whether the specified \pagestyle is active. +%** @param #1 tokens which change to the \pagestyle specified, e.g. +%** `\ps@headings'. +%** @param implicit-#2 then-branch +%** @param implicit-#3 else-branch +\def\magyar@if@currentpagestyle#1{% + \begingroup + \magyar@mark@fingerprint@def\@@magyar@now@marks + #1% + \magyar@mark@fingerprint@def\@@magyar@specified@marks + \ifx\@@magyar@now@marks\@@magyar@specified@marks + \endgroup\expandafter\@firstoftwo + \else + \endgroup\expandafter\@secondoftwo + \fi +} + +%** Redefine \@@magyar@setup@psheadings for #2.cls. +%** @param #1 is the expanded value of \CurrentOption (`magyar'). +\def\magyar@def@psheadings#1#2{% + \def\@@magyar@setup@psheadings{% + % SUXX: \show doesn't work here. + \ifx\@@magyar@overridden@psheadings\ps@headings + \@@magyar@error{assert: \string\let\string\ps@headings\string\@@magyar@overridden@psheadings\space was too early}% + \else\ifx\@@magyar@overridden@psheadings\@empty + \@@magyar@error{assert: \string\@@magyar@overridden@psheadings\space should be redefined}% + \else + \magyar@if@originalpagestyle{#2.cls}{\ps@headings}{% + % \ps@headings still has its original definition (as of #1.cls). + % + % For efficiency reasons, we make the following restriction. If the + % user does \selectlanguage{...} throughout the document, he should + % call \pagetsyle{...} after that to make the pagestyle + % language-dependent. + % + % !! add support for \thispagestyle in the preamble. + % !! don't add this if extras gets cleared. + \expandafter\addto\csname extras#1\endcsname{% + \babel@save\ps@headings + \let\ps@headings\@@magyar@overridden@psheadings + }% + \magyar@if@currentpagestyle{\ps@headings}{% + % The current \pagestyle has been selected by the current + % \ps@headings, i.e. \pagestyle{headings} is active. + \edef\reserved@a{\languagename}% + \edef\reserved@a{\expandafter\strip@prefix\meaning\reserved@a}% + \edef\reserved@b{#1}% + \edef\reserved@b{\expandafter\strip@prefix\meaning\reserved@a}% + \ifx\reserved@a\reserved@b + % Localize the current \pagestyle to Hungarian `headings'. + \@@magyar@overridden@psheadings + \fi + }{}% + }{}% + \fi\fi + }% +} + +\def\magyar@ulladik{ulladik0}% [Nn]ulladik, `0' at end is intentional + +\def\@@magyar@macro@appendixname{\appendixname} + +%** \thechapter (possibly with huordinal), dot, space. +\def\magyar@huordinal@chapterheaddot{% + \ifx\@chapapp\@@magyar@appendixname \thechapter\hbox{\magyar@opt@@titleskip}% appendixdot=no + \else\ifx\@chapapp\@@magyar@macro@appendixname \thechapter.~% + \else\ifnum\magyar@opt@@chapternumber=1 \@huordinal\c@chapter~% + \else\ifnum\magyar@opt@@chapternumber=2 \@Huordinal\c@chapter~% + \else \thechapter.~% + \fi\fi\fi\fi +} + +%** \thepart (possibly with huordinal), dot, space. +\def\magyar@huordinal@partheaddot{% + \ifnum\magyar@opt@@partnumber=1 \@huordinal\c@part~% + \else\ifnum\magyar@opt@@partnumber=2 \@Huordinal\c@part~% + \else \thepart.~% + \fi\fi +} + +%** Emits the rule to the running head. Must put something of zero width +%** to the horizontal list. +%** @param #1 0: even page, 1: odd page, 3: page w/o [twoside] +\def\@@magyar@headrule#1{} +\def\@@magyar@slshape{}% running head is not slanted + +\ifx\magyar@opt@@classmod\@empty + \let\@@magyar@ifclassloaded\@ifclassloaded +\else + \def\@@magyar@ifclassloaded#1#2{% force specific class + \def\reserved@a{#1}% + \ifx\reserved@a\magyar@opt@@classmod #2\fi + } +\fi + +\@@magyar@ifclassloaded{amsbook}{% + \let\magyar@hunumbers@errmsg\@empty + \let\@@magyar@orig@makechapterhead\@makechapterhead + \def\@makechapterhead#1{% + \begingroup + \let\@@magyar@orig@centerline\centerline + \def\centerline##1{% + \@@magyar@orig@centerline{% + \normalsize\mdseries + \ifx\chaptername\appendixname % We're in the appendix. + \ifx\@@magyar@appendixname\@empty + % print a dot in the appendix only if appendixdot=yes + \thechapter.~% + \else + \thechapter\hbox{\magyar@opt@@titleskip}% + \fi + \else\ifnum\magyar@opt@@chapternumber=1 + \uppercase\@xp{\@huordinal\c@chapter}~% + \else\ifnum\magyar@opt@@chapternumber=2 + \uppercase\@xp{\@Huordinal\c@chapter}~% + \else\thechapter.~% + \fi\fi\fi + \uppercase\@xp{\chaptername}% + }% + }% + \@@magyar@orig@makechapterhead{#1}% + \endgroup + }% + \let\@@magyar@orig@chapter\@chapter + \def\@chapter{% + \let\@@magyar@orig@chapter@typeout\typeout + \def\typeout##1{% + % Original: \typeout{\chaptername\space\@secnumber} + \@@magyar@orig@chapter@typeout{% + \ifnum\c@secnumdepth<\z@ + \chaptername\space + \else + \thechapter\ifx\chaptername\appendixname\else.\fi + \space\chaptername + \fi + }% + \let\typeout\@@magyar@orig@chapter@typeout + }% + \@@magyar@orig@chapter + }% + % Just to be sure, no need for this in amsbook.cls 2004/08/06 + \@ifundefined{tocpart}{\let\tocpart\tocsection}{} + % TODO(pts): Override only parts of \@part + \def\@part[#1]#2{% + \ifnum \c@secnumdepth >-2\relax \refstepcounter{part}% + % TODO(pts): What does \tocpart do for a non-hungarian \tableofcontents? + \addcontentsline{toc}{part}{\protect\tocpart{\partname}{\thepart}% + {#1}}% + \else + \addcontentsline{toc}{part}{#1}\fi + \begingroup\centering + \ifnum \c@secnumdepth >-2\relax + {\fontsize{\@xviipt}{22}\bfseries + \ifnum\magyar@opt@@partnumber=1 \@huordinal\c@part~% + \else\ifnum\magyar@opt@@partnumber=2 \@Huordinal\c@part~% + \else\thechapter.~% + \fi\fi + \partname + } \vskip 20\p@ \fi + \fontsize{\@xxpt}{25}\bfseries + #1\vfil\vfil\endgroup \newpage\thispagestyle{empty}} +}{} + +\@@magyar@ifclassloaded{book}{% + \let\magyar@hunumbers@errmsg\@empty + % Headings: inserting dots, changing orders + %\def\@@magyar@appendixname{\appendixname}% by appendixdot= + \def\@@magyar@overridden@psheadings{% + \if@twoside + \let\@oddfoot\@empty\let\@evenfoot\@empty + \def\@evenhead{\@@magyar@headrule0\thepage\hfil\@@magyar@slshape\leftmark}% + \def\@oddhead {\@@magyar@headrule1{\@@magyar@slshape\rightmark}\hfil\thepage}% + \let\@mkboth\markboth + \def\chaptermark##1{% + \markboth {\MakeUppercase{% + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter% Dat: mainmatter only in book.cls, not in report.cls + \magyar@huordinal@chapterheaddot + \@chapapp.\magyar@opt@@hdrtitleskip% \ % + \fi + \fi + ##1}}{}}% + \def\sectionmark##1{% + \markright {\MakeUppercase{% + \ifnum \c@secnumdepth >\z@ + \thesection.\magyar@opt@@hdrtitleskip% \ % + \fi + ##1}}}% + \else + \let\@oddfoot\@empty + \def\@oddhead{\@@magyar@headrule3{\@@magyar@slshape\rightmark}\hfil\thepage}% + \let\@mkboth\markboth + \def\chaptermark##1{% + \markright {\MakeUppercase{% + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \magyar@huordinal@chapterheaddot + \@chapapp.\magyar@opt@@hdrtitleskip% \ % + \fi + \fi + ##1}}}% + \fi + }% + \expandafter\magyar@def@psheadings\expandafter{\CurrentOption}{book}% + % Part: inserting dot, changing order, toc + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\@part + \def\@part[#1]#2{% book + \ifnum \c@secnumdepth >-2\relax + \refstepcounter{part}% + \ifnum\magyar@opt@@partnumber>0 \protected@edef\@currentlabel{\@huordinal\c@part}\fi + \addcontentsline{toc}{part}{\thepart.\hspace{1em}#1}% + \else + \addcontentsline{toc}{part}{#1}% + \fi + \markboth{}{}% + {\centering + \interlinepenalty \@M + \normalfont + \ifnum \c@secnumdepth >-2\relax + \huge\bfseries \magyar@huordinal@partheaddot\partname% hu + \csname par\endcsname + \vskip 20\p@ + \fi + \Huge \bfseries #2\csname par\endcsname}% + \@endpart}} + % Chapter: dot, changing typeout, toc + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\@chapter + \def\@chapter[#1]#2{% !! don't \def, but \let, other places, too + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \refstepcounter{chapter}% + \typeout{\thechapter\ifx\@chapapp\@@magyar@appendixname\else.\fi\space\@chapapp.}% + \ifx\@chapapp\@@magyar@appendixname + % \@gobble gobbles the dot emitted by \numberline. + \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter\protect\@gobble}#1}% + \else + \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}% + \fi + \ifx\@chapapp\@@magyar@appendix@chapapp\else + \ifnum\magyar@opt@@chapternumber>0 \protected@edef\@currentlabel{\@huordinal\c@chapter}\fi + \fi + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}% + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + %\csname par\endcsname + \@afterheading % Imp: why doesn't it work? + \fi}} + \if0\magyar@opt@@chapterhead\else + % Chapter: dot, changing order + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\@makechapterhead + \def\@makechapterhead#1{% + \vspace*{50\p@}% + {\parindent \z@ \raggedright \normalfont + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \huge\bfseries + \magyar@huordinal@chapterheaddot \@chapapp{}% + \csname par\endcsname\nobreak + \vskip 20\p@ + \fi + \fi + \interlinepenalty\@M + \Huge \bfseries #1\csname par\endcsname\nobreak + \vskip 40\p@ + }}% + }% + \fi +}{} + +\@@magyar@ifclassloaded{report}{% + \let\magyar@hunumbers@errmsg\@empty + %\def\@@magyar@appendixname{\appendixname}% by appendixdot= + % Headings: inserting dots, changing orders + \def\@@magyar@overridden@psheadings{% + \if@twoside + \let\@oddfoot\@empty\let\@evenfoot\@empty + \def\@evenhead{\@@magyar@headrule0\thepage\hfil\@@magyar@slshape\leftmark}% + \def\@oddhead {\@@magyar@headrule1{\@@magyar@slshape\rightmark}\hfil\thepage}% + \let\@mkboth\markboth + \def\chaptermark##1{% + \markboth {\MakeUppercase{% + \ifnum \c@secnumdepth >\m@ne + \magyar@huordinal@chapterheaddot + \@chapapp.\magyar@opt@@hdrtitleskip% \ % + \fi + ##1}}{}}% + \def\sectionmark##1{% + \markright {\MakeUppercase{% + \ifnum \c@secnumdepth >\z@ + \thesection.\magyar@opt@@hdrtitleskip% \ % + \fi + ##1}}}% + \else + \let\@oddfoot\@empty + \def\@oddhead{% + \@@magyar@headrule3{\@@magyar@slshape\rightmark}\hfil\thepage}% + \let\@mkboth\markboth + \def\chaptermark##1{% + \markright{\MakeUppercase{% + \ifnum \c@secnumdepth >\m@ne + \magyar@huordinal@chapterheaddot + \@chapapp.\magyar@opt@@hdrtitleskip% \ % + \fi + ##1}}}% + \fi + }% + \expandafter\magyar@def@psheadings\expandafter{\CurrentOption}{report}% + % Chapter: dot, changing typeout, toc + % Part... + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\@chapter + \def\@chapter[#1]#2{% + \ifnum \c@secnumdepth >\m@ne + \refstepcounter{chapter}% + \typeout{\thechapter\ifx\@chapapp\@@magyar@appendixname\else.\fi\space\@chapapp.}% + \ifx\@chapapp\@@magyar@appendixname + % \@gobble gobbles the dot emitted by \numberline. + \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter\protect\@gobble}#1}% + \else + \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}% + \fi + \ifx\@chapapp\@@magyar@appendix@chapapp\else + \ifnum\magyar@opt@@chapternumber>0 \protected@edef\@currentlabel{\@huordinal\c@chapter}\fi + \fi + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}% + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi}% + \babel@save\@part + \def\@part[#1]#2{% report; added at Fri Jul 23 11:45:57 CEST 2004 + \ifnum \c@secnumdepth >-2\relax + \refstepcounter{part}% + \ifnum\magyar@opt@@partnumber>0 \protected@edef\@currentlabel{\@huordinal\c@part}\fi + \addcontentsline{toc}{part}{\thepart.\hspace{1em}#1}% + \else + \addcontentsline{toc}{part}{#1}% + \fi + \markboth{}{}% %%%%% \l@chapter in report.cls + {\centering + \interlinepenalty \@M + \normalfont + \ifnum \c@secnumdepth >-2\relax + \huge\bfseries \magyar@huordinal@partheaddot\partname% hu + \csname par\endcsname + \vskip 20\p@ + \fi + \Huge \bfseries #2\csname par\endcsname}% + \@endpart}% + } + \if0\magyar@opt@@chapterhead\else + % Chapter: dot, changing order + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\@makechapterhead + \def\@makechapterhead#1{% + \vspace*{50\p@}% + {\parindent \z@ \raggedright \normalfont + \ifnum \c@secnumdepth >\m@ne + \huge\bfseries + \magyar@huordinal@chapterheaddot \@chapapp{}% + \vskip 20\p@ + \fi + \interlinepenalty\@M + \Huge \bfseries #1\csname par\endcsname\nobreak + \vskip 40\p@ + }}% + }% + \fi +}{} + +\@@magyar@ifclassloaded{article}{% + % article.cls has no \chapter. We'll hook \part below though. + \let\magyar@hunumbers@errmsg\@empty + % Headings: inserting dots + % In order for this to take effect, \pagestyle{plain} should be put below + % \begin{document}. + \def\@@magyar@overridden@psheadings{% + \if@twoside + \let\@oddfoot\@empty\let\@evenfoot\@empty + % Dat: by pts: \slshape -> \relax + \def\@evenhead{\@@magyar@headrule0\thepage\hfil\@@magyar@slshape\leftmark}% + \def\@oddhead {\@@magyar@headrule1{\@@magyar@slshape\rightmark}\hfil\thepage}% + \let\@mkboth\markboth + \def\sectionmark##1{% + \markboth {\MakeUppercase{% + \ifnum \c@secnumdepth >\z@ + \thesection.\magyar@opt@@hdrtitleskip + \fi + ##1}}{}}% + \def\subsectionmark##1{% + \markright {% + \ifnum \c@secnumdepth >\@ne + \thesubsection.\magyar@opt@@hdrtitleskip + \fi + ##1}}% + \else + \let\@oddfoot\@empty + \def\@oddhead{\@@magyar@headrule3{\@@magyar@slshape\rightmark}\hfil\thepage}% + \let\@mkboth\markboth + \def\sectionmark##1{% + \markright {\MakeUppercase{% + \ifnum \c@secnumdepth >\m@ne + \thesection.\magyar@opt@@hdrtitleskip + \fi + ##1}}} + \fi}% + \expandafter\magyar@def@psheadings\expandafter{\CurrentOption}{article}% + \expandafter\addto\csname extras\CurrentOption\endcsname{% + \babel@save\@part + \def\@part[#1]#2{% article % added at Fri Jul 23 11:45:57 CEST 2004 + \ifnum \c@secnumdepth >\m@ne + \refstepcounter{part}% + \ifnum\magyar@opt@@partnumber>0 \protected@edef\@currentlabel{\@huordinal\c@part}\fi + \addcontentsline{toc}{part}{\thepart.\hspace{1em}#1}% + \else + \addcontentsline{toc}{part}{#1}% + \fi + {\parindent \z@ \raggedright + \interlinepenalty \@M + \normalfont + \ifnum \c@secnumdepth >\m@ne + \Large\bfseries \magyar@huordinal@partheaddot\partname% hu + \csname par\endcsname\nobreak + \fi + \huge \bfseries #2% + \markboth{}{}\csname par\endcsname}% + \nobreak + \vskip 3ex + \@afterheading}}% +}{} + +\@@magyar@ifclassloaded{letter}{% + % letter.cls has no \part or \chapter. No need to hook anything here, but + % we make \magyar@hunumbers@errmsg just to pacify + % `\PassOptionsToPackage{defaults=prettiest}{magyar.ldf}'. + \let\magyar@hunumbers@errmsg\@empty + % Headings: inserting dots + % In order for this to take effect, \pagestyle{plain} should be put below + % \begin{document}. + \def\@@magyar@overridden@psheadings{% + \if@twoside + \let\@oddfoot\@empty\let\@evenfoot\@empty + \def\@oddhead{\@@magyar@headrule3\@@magyar@slshape\headtoname{:} \ignorespaces\toname + \hfil \@date + \hfil \thepage.~\pagename}% + \let\@evenhead\@oddhead + \else + \let\@oddfoot\@empty + \def\@oddhead{\@@magyar@headrule3\@@magyar@slshape\headtoname{:} \ignorespaces\toname + \hfil \@date + \hfil \thepage.~\pagename}% + \fi}% + \expandafter\magyar@def@psheadings\expandafter{\CurrentOption}{letter}% +}{} +\@gobble +{^}% + +% --- mond= + +\if0\magyar@opt@@mond \@@magyar@skiplong\fi +%** Dat: `--\enspace' would be too much +%** Use this in the beginning of the paragraph. +\def\@@magyar@mond{% + % Dat: \noindent after \subsection in article.cls + % Dat: \indent after \subsection in amsart.cls (\@noskipsecfalse) + % vvv Dat: strange: \ifvmode anf \if@noskipsec. + \ifvmode\if@noskipsec\leavevmode\fi\par\vskip-\parskip + \else\@noskipsecfalse\par\vskip-\parskip\fi + \leavevmode--\hbox{ }} +\ifnum\magyar@opt@@mond \expandafter\ifx\csname mond\endcsname\relax1\fi>1 % 21, 2, 11, 1 + \let\mond\@@magyar@mond +\fi +\@gobble +{^}% + +% --- hang= + +\if0\magyar@opt@@hang \@@magyar@skiplong\fi +%** Usage: \hang{-- } Foo\par +\def\@@magyar@hang#1{% + \begingroup + \setbox0\hbox{#1}% + \advance\linewidth-\wd0 % not \hsize + \advance\@totalleftmargin\wd0 + \edef\reserved@a{\parshape=1 \the\@totalleftmargin\space\space\the\linewidth\space}% + \par\noindent\kern-\wd0 \box0 % Dat: \box0 destroys \wd0 + \expandafter\endgroup\expandafter\begingroup\reserved@a + \let\hang@@par\par + \def\par{\hang@@par\endgroup}% OK, works even inside \begin{quotation} + %\def\par{\endgroup\par}% doesn't work, restores \parshape too early + \ignorespaces +}% +\ifnum\magyar@opt@@hang \expandafter\ifx\csname hang\endcsname\relax1\fi>1 % 21, 2, 11, 1 + \let\hang\@@magyar@hang +\fi +\@gobble +{^}% + +% vvv hyphenmins= + +\ifx\magyar@opt@@hyphenmins\@empty\else + \edef\reserved@a{\noexpand\@namedef{\CurrentOption hyphenmins}{\magyar@opt@@hyphenmins}} + \reserved@a +\fi + +% !! + +%\def\skipfoo #1foo {% +% \ifx#1\hfuzz\else +% (#1)% +% \expandafter\skipfoo +% \fi +%} + + +% vvv cjhebrewfix= % by pts@fazekas.hu at Tue Apr 19 18:26:54 CEST 2005 +% thanks to Zoltn Hamar for reporting the problem +% Dat: the ultimate solution is active=onlycs, but it limits other +% functionality +% Dat: use \def\h{\cjRL} in the preamble to abbreviate \cjRL +% wrong: \let\h\cjRL +% wrong: \newcommand{\h}[1]{\cjRL{#1}} +% Dat: cjhebrew uses the following strings for typesetting Hebrew letters: +% ' b g d h w z .h .t y k K l m M n N s ` p P .s .S q r ,s +s t * a a: +% /a e i o O u U E E: A A: | * : ; -- +% Dat: headings in `\pagestyle{headings} \section{(\cjRL{`l})}' doesn't work +% as expected, because \MakeUppercase capitalizes the L, too. +% Solution #1: +% \DeclareRobustCommand\mycjcommand{\cjRL{`l}} +% \section{(\mycjcommand)} +% Solution #2: (won't convert any heading to uppercase) +% % change the definition of \ps@headings, remove \MakeUppercase +% \makeatletter \def\ps@headings{% +% \let\@oddfoot\@empty \let\@mkboth\markboth +% \def\@oddhead{{\slshape\rightmark}\hfil\thepage}% +% \def\sectionmark##1{\markright {\iffalse\MakeUppercase\fi{% +% \ifnum \c@secnumdepth >\m@ne \thesection\quad \fi##1}}}} +\if0\magyar@opt@@cjhebrewfix \@@magyar@skiplong\fi +% Dat: \cjRL{`l} in cjhebrew.sty should typeset two letters, but typesets +% only one if ` is \active. Use this code to fix it. +% Imp: also fix in command arguments etc. Change catcode later. +\if1\magyar@opt@@cjhebrewfix % =onlyouter +% Dat: this doesn't work in the argument of \section etc., but it allows +% LaTeX commands (\) in the arg of \cjRL +\def\@@magyar@cjhebrewfix{% + \let\@@magyar@orig@cjRL\cjRL + \def\cjRL{\begingroup\catcode\string``=12 \@@magyar@cjRL@low}% + \def\@@magyar@cjRL@low##1{\@@magyar@orig@cjRL{##1}\endgroup}} +\else % =yes +% Dat: this works in the argument of \section etc., but it doesn't allow +% LaTeX commands (\) in the arg of \cjRL +\def\reserved@b{\protect} +\edef\reserved@b{\expandafter\strip@prefix\meaning\reserved@b} +%\show\reserved@b +\edef\reserved@a{% + \noexpand\def\noexpand\@@magyar@cjhebrew@skipa##1\reserved@b{% + \noexpand\ifx##1\noexpand\hfuzz\noexpand\@empty\noexpand\else + ##1%(##1)% + \noexpand\expandafter\noexpand\@@magyar@cjhebrew@skipa + \noexpand\fi}% + \noexpand\def\noexpand\@@magyar@cjhebrew@skipb##1\noexpand\hfuzz{% Dat: this removes all `\protect ' + \noexpand\@@magyar@cjhebrew@skipa##1\reserved@b\noexpand\hfuzz\reserved@b}} +\reserved@a +\def\@@magyar@cjhebrewfix{% + \let\@@magyar@orig@cjRL\cjRL + %\let\@@magyar@orig@cjRL\bf + \DeclareRobustCommand\cjRL[1]{\begingroup + \toks@{##1}% + %\showthe\toks@ + \edef\reserved@a{\the\toks@}% + \edef\reserved@a{\expandafter\strip@prefix\meaning\reserved@a}% + % Dat: we're almost complete here, but 1st we want to remove all + % instances of `\protect ' (catcodes 12 and 10), which were inserted + % into \firstmark, i.e. with \section{A\cjRL{`l}B}, \firstmark + % becomes: `{}{\protect \csname foreignlanguage \endcsname {magyar}{\protect \MakeUppercase {1\hskip 1em\relax A\protect \cjRL {\protect `l}B}}}' + \edef\reserved@a{\expandafter\@@magyar@cjhebrew@skipb\reserved@a\hfuzz}% + %\show\reserved@a + \expandafter\@@magyar@orig@cjRL\expandafter{\reserved@a}\endgroup}} +\fi +\AtBeginDocument{\ifx\cjRL\@undefined\else\@@magyar@cjhebrewfix\fi} +\@gobble +{^}% + +% vvv varioref= + +\if0\magyar@opt@@varioref \@@magyar@skiplong\fi +\expandafter\addto\csname extras\CurrentOption\endcsname{% + \@@magyar@setup@varioref} % Dat: we are we late enough so we override varioref.sty +% vvv don't apply changes if varioref.sty wasn't loaded +\AtBeginDocument{\expandafter\ifx\csname vpagerefrange\endcsname\relax + \let\@@magyar@setup@varioref\@empty\fi} +\def\@@magyar@setup@varioref{% Dat: must be a separate macro for suggestions= not to find our \reftextfaceafter etc. + \def\reftextfaceafter {\reftextvario{a t\'ul\-ol\-da\-lon}{a k\"o\-vet\-kez\H{o} ol\-da\-lon}}% + \def\reftextfacebefore{\reftextvario{a t\'ul\-ol\-da\-lon}{az el\H{o}\-z\H{o} ol\-da\-lon}}% + \def\reftextafter {a k\"o\-vet\-kez\H{o} ol\-da\-lon}% + \def\reftextbefore {az el\H{o}\-z\H{o} ol\-da\-lon}% + \def\reftextcurrent {ezen az ol\-da\-lon}% + \def\reftextfaraway##1{a~\csname @@magyar@az@lowxu\endcsname{\pageref{##1}}.~ol\-da\-lon}% + \def\reftextpagerange##1##2{a~\csname @@magyar@az@lowxu\endcsname{\pageref{##1}}% + --\pageref{##2}.~ol\-da\-la\-kon}% + \def\reftextlabelrange##1##2{{}\csname @@magyar@told\endcsname\ref{##1}+tol{} + \ref{##2}-ig}% Dat: `{}' is here for anti-\capitalize +} +\@gobble +{^}% + +% vvv fancyhdr= +% +% Dat: magyar.ldf has to be loaded first, otherwise it cannot fix +% `\usepackage{fancyhdr} \pagestyle{fancy}' + +\if0\magyar@opt@@fancyhdr \@@magyar@skiplong\fi +\expandafter\ifx\csname ps@fancy\endcsname\relax + % Emit a warning if \pagestyle{fancy} is used after this. + % The original definition: \def\ps@fancy{\@fancyplainfalse\ps@@fancy} + \def\@@magyar@@ps@fancy{\@fancyplainfalse\ps@@fancy}% +\else + \addto\ps@fancy{% works for article.cls, report.cls and book.cls + \@ifundefined{chapter}{% + % article: + % > \sectionmark=macro: + %#1->\markboth {\MakeUppercase {\ifnum \c@secnumdepth >\z@ + %\thesection \hskip 1em\relax \fi #1}}{}. + \def\sectionmark#1{\markboth{\MakeUppercase{\ifnum \c@secnumdepth>\z@ + \thesection.\magyar@opt@@hdrtitleskip \fi #1}}{}}% + % vvv Imp: do we need \if@twoside to set \subsectionmark here? + % #1->\markright {\ifnum \c@secnumdepth >\@ne \thesubsection + % \hskip 1em\relax \fi #1}. + \def\subsectionmark#1{\markright {\ifnum \c@secnumdepth >\@ne + \thesubsection.\magyar@opt@@hdrtitleskip \fi #1}}% + }{\def\chaptermark#1{ + \markboth{\MakeUppercase{\ifnum \c@secnumdepth>\m@ne + % report.cls doesn't have \if@mainmatter, so we replace it with \iftrue + \@gobble\iftrue % balance for quick skipping + \@@magyar@ifmainmatter % must be macro if quick skipping + \magyar@huordinal@chapterheaddot + \@chapapp.\magyar@opt@@hdrtitleskip + \fi % for \if@mainmatter + \fi#1}}{}}% + \def\sectionmark#1{\markright{\MakeUppercase{\ifnum \c@secnumdepth>\z@ + \thesection.\magyar@opt@@hdrtitleskip \fi#1}}}}}% + \def\@@magyar@@ps@fancy{\relax}% must be done after suggestions= +\fi +% This definition must be outside \iffalse. +\def\@@magyar@ifmainmatter{% + \csname \ifx\if@mainmatter\@undefined iftrue\else if@mainmatter\fi + \endcsname} +\@gobble +{^}% + +% vvv ntheoremfix= + +%** Fix for the `! Undefined control sequence. \select' error message with +%** ntheorem.sty +%** +%** The reason for the error is that magyar.ldf emits +%** \select@language{magyar} into .thm files (as well as .toc, .lof, .lot +%** etc. files), and LaTeX cannot read those files without \makeatletter +%** because of the @ in the \select@language command. +%** +%** Our solution: add \makeatletter somewhere before \@input{\jobname.thm} to +%** the macro which reads the .thm file (\thm@processlist) in ntheorem.sty . +\if0\magyar@opt@@ntheoremfix \@@magyar@skiplong\fi + \def\magyar@@ntheoremfix{% + \expandafter\ifx\csname ver@ntheorem.sty\endcsname\relax\else + \ifx\thm@processlist\@undefined\else + % This doesn't work, because the body of \thm@processlist contains # + %\expandafter\def\expandafter\thm@processlist\expandafter{% + % \expandafter\begingroup\expandafter\makeatletter + % \thm@processlist\endgroup}% + \expandafter\@temptokena\expandafter{% + \expandafter\begingroup\expandafter\makeatletter + \thm@processlist\endgroup}% + \edef\thm@processlist{\the\@temptokena}% + \fi + \fi + } + \AtBeginDocument{\magyar@@ntheoremfix} + \@gobble +{^}% + +% vvv extras=, must be last + +\ifnum\magyar@opt@@extras=0 + % Dat: \extrasmagyar might break compatibility with future LaTeX packages. + % Use this option to turn all of them off, for debugging purposes. + \expandafter\let\csname extras\CurrentOption\endcsname\@empty + \expandafter\let\csname noextras\CurrentOption\endcsname\@empty +\fi + +% --- Finish + +\ldf@finish\CurrentOption% \input \CurrentOption.cfg + +% !! doc: (\string!) +% !! doc: \umlautlow is much more important in OT1 cmr fonts than in T1 +% !! %** @example rtelmezs\/bellts +% \def\per{/\penalty\exhyphenpenalty\hskip\z@skip} +% !! \itemize identation +% !! layout.sty +%\DeclareOption{magyar}{% +% \def\Headertext{Fejl\'ec} +% \def\Bodytext{A dokumentum teste\qquad} +% \def\Footertext{L\'abl\'ec} +% \def\MarginNotestext{Sz\'el-\\jegyzet} +% \def\oneinchtext{1 inch} +% \def\notshown{nem l\'atszik} +% } +% !! vvv this w/ and w/o nathb.sty: $H_{`symm}$, $H_``symm $ +%\let\@@magyar@saved@mathoptions@on\mathoptions@on +%\def\mathoptions@on{% overrides nath.sty +% \catcode``12 % deactivate +% \begingroup\lccode`~``\lowercase{\endgroup\def~}{\abbreviation}% +% % ^^^ \def`{\abbreviation}, but with active ` +% \@@magyar@saved@mathoptions@on +%} +% !! doc: hegyes`-szg +% !! option to detect new magyar.ldf from a TeX file +% !! book.cls \appendix \chapter, sub-numbers into TOC, need dot after `A. fggelk'? Gyurgyk recommends `1. fggelk'. +% !! \MathReal, frenchb.ldf, \nombre +% !! \told\ref{foo}+ban{}, if \foo expands to empty (no \section etc. in .tex file) +% !! french.ldf number decimal comma etc. +% !! \hunnewlabel should store `table', `figure', `section', `equation' etc. +% !! letter.cls +% !! should \newlabel emit a `.' ? (now doesn't) -- compatibility +% `\aref{ekezetek}.\ tblzat' needs explicit `.' +% !! alternative solutions for meny-nyi (possibly defining ligatures?) +% !! baseline grid? +% !! Bujdos`--Wettl: http://www.math.bme.hu/~wettl/plcv/pdf/BWfinal.pdf +% !! some comments not related to magyar.ldf, but to *hyph.tex etc. +% !! add their postpara symbols +% !! section title sizes +% !! baseline grid +% !! rigid \parskip=0pt unless in prospestus or other short doc with \parindent=0pt +% !! add their \leftmargini and variations +% !! substitute bold-extended fonts with bold fonts +% !! no page numbers on blank pages +% !! \hsize <= 24cc (or 20cc) => parindent:=1quad else 2quad +% !! length of last line of par... (break line) +% !! reduce vertical whitespace around \section +% +% !! \MathReal{1.25 cm} +% !! \H,\. in OT1 \texttt +% !! maybe \index{|run husort.pl} +% !! virtual fonts to support \umlauthigh and \umlautlow in T1 encoding +% fnt_def1: scaled size is relative (2^20==1), design size is absolute (same as in local TFM) +% disallowed DVI: bop,eop, >=243 +% down(2^19) moves down 10/2 pt if the design size is 10pt +% dimensions must be <2^24 (160pt, ~5.62cm) +% w=x=y=z=0 +% !! \begin{description} \bf -> \em ?, auto-dot +% !! \def\mdqon{\shorthandon{"}} \def\mdqoff{\shorthandoff{"}} (possibly deactivate `?' etc.) +% !! fix \initiate@active@char for other languages +% !! \addto\shorthandsspanish... +% !! spanish.ldf \es@activate, \if@safe@actives\then +% !! esperanto.ldf why? \declare@shorthand{system}{^}{\csname normal@char\string^\endcsname} +% !! add other low accents for umlaut=low: \. (i) and \' +% !! full amsart.cls compatibility?? +% !! huhyph.tex wrong \showhyphens{azthehe}% az-t-hehe +% !! huhyph.tex wrong zs-hehe +% !! huhyph.tex why sza-badstrand, but szbadsg-rand +% !! \index{foo|hyperpagearg{\textbf}} +% !! combine \magyar@opt@@titleskip, amstocnumskip and \magyar@post@... +% !! \begin{textqq} ? combined command and env +% !! tmagyar.tex \tableofcontents wide \section +% !! \restoreparindent in \item in \itemize +% \edef\restoreparindent{\parindent\the\parindent\relax} in \@listi +% !! 1848 mrcius+nak kzepe +% !! should \told insert \, ?? (no, only \told*??) +% !! \told45{-ed-hez} ?? +% !! \told{45}-ed-hez ?? +% !! \told45\od\hoz \told45+\od\hoz +% !! \told45+adik+val +ad+val etc. +% !! \azhuphy +% !! \huphy{-3331234.5678pF^{-1}} -> $-$3\,331\,234,5678\,pF^{-1} +% !! \huphy if non-Hungarian is the lang {,}->{.} +% !! \huphy ifmmode? +% !! french.ldf \CyrillicGuillemets +% !! french.ldf \LasyGuillemets +% !! huplain.bst editor = "Wizar{\BN dj} V. Oz and Mihalis Yannakakis", +% !! huplain.bst w/o magyar.ldf +% !! hyperref.sty bugfix when turning hyperref.sty on, \ref is spoiled: +% w/ or w/o magyar.ldf +% ! Argument of \@fifthoffive has an extra }. +% +% \par +% l.48 Ld. \ref{tab} +% !! > Kiprbltam, s tnyleg pontosan ugyanaz a fjl magyar.ldf (texmf fban) s +% > magyar-0510.ldf (aktulis knyvtrban) nven ms eredmnyt ad. +% (cjhebrew) +% !! a4wide.sty doesn't compile +% \documentclass[12pt,a4paper]{article} +% \usepackage{t1enc} +% \usepackage{times}% Imp: math mode +% \usepackage[magyar]{babel} +% \usepackage{graphicx} +% \usepackage[latin2]{inputenc} +% %\usepackage{a4wide}% SUXX: doesn't work with magyar.ldf +% \pagestyle{empty} +% \begin{document} +% !! % Imp: magyar.ldf: \textdt{tudja`=e}, \textdt{tudja`-e}; +% !! space in front of `;' is too large with \usepackage{times} +% \declare@shorthand{\CurrentOption}{;}{\magyar@thinspaced;} +% !! doc: `- not suitable in .bib files etc. +% !! \cite{foo,bar} -> `[2, 1]' increasing order preferred +% Imp: indent using the maximum footnotemark *** count on the current page +% Imp: generate ,,harminchrombl'' by \told{\@huordinal{33}}+bol etc. +% +% Dat: \mathcode`\,="013B % s gy a tizedes trtekben matematikai mdban sem lesz kz +% Dat: \mathchardef\comma="613B % a vesz (,) ami matematikai mdban elvlaszt karakterknt hasznlhat +% Dat: additive \PassOptionsToPackage{foo=bar}{magyar.ldf} +% Dat: for book.cls and article.cls: the user has to run \pagestyle{headings} after \selectlanguage{magyar} -- for performance reasons +% Dat: doc: \let\@@magyar@setup@psheadings\relax maybe needed in the preamble +% Dat: \pagestyle{headings} is forced \AtBeginDocument -- user should change it later +% Dat: babel.def assumes we have: \textquotedblright \textquoteright \ll \gg +% < > +% Dat: babel.def defines for OT1 and others: \quotedblbase \quotesinglbase +% \guillemotleft \guillemotright \guilsinglleft \guilsinglright \ij \IJ +% \dj \DJ \SS +% Dat: babel.def defines the following robust commands in math and text modes: +% \glq \grq \glqq \grqq \flq \frq \flqq \frqq +% Dat: OT1 encoding respects accents=low (\umlauthigh and \umlautlow), but T1 +% doesn't -- but we need T1 for hyphenation of accented words +% Dat: \usepackage{t1enc} is faster than \usepackage[T1]{fontenc} +% Dat: \languageattribute should be specified in the document preamble, and +% not changed again +% Dat: it is possible to have 1 letter, e.g \declare@shorthand{turkish}{=}{...} +% Dat: Babel \@activated emits a \PackageInfo entry +% Dat: (` `) is equivalent to (``), because TeX ignores spaces before macro +% arguments +% Dat: example of the so-called ``dual load'': +% \PassOptionsToPackage{frenchspacing=yes}{magyar.ldf} +% \PassOptionsToPackage{frenchspacing=no}{hungarian.ldf} +% \usepackage[hungarian,magyar]{babel} +% Dat: argument of \az and \told may not contain \if..., \else and \fi +% OK: works with article.cls: (mathbrk=fix) +% \noindent s ebbl a tovbbi hrom rsz terlete +% $\displaystyle{1\over3}-{1\over 4}={1\over 12}$, +% $\displaystyle{1\over 2}-{1\over 4}={1\over 4}$ s +% $\displaystyle{1\over 4}+\bigg({1\over 2}-{1\over 3}\bigg)={1\over 4}+{1\over 6}}=\displaystyle{5\over 12}$ +% terletegysg. +% OK: doc in magyarldf-doc.tex: enumeration in math, see $a,\ b$ in nath.sty +% OK: mathbrk=fix +\\+ (all binary ops and relations) in math, \nobreak\cdot, \nobreak\slash +% OK: footnote text indented, asterisks on pages +% OK: Kiss Eld\nobreak\,\nobreak--\,Nagy Pl ... +% OK: \partname in book.cls (seems to work now) +% OK: Els rsz +% OK: smartly disable active chars in preamble +% OK: \@inpenc@undefined defined and != latin2 => recommend \usepackage[latin2]{inputenc} +% OK: \encodingdefault != T1 => recommend \usepackage{t1enc} +% OK: Warning if \l@hungarian vs \l@magyar undefined +% OK: amsart.cls \listoftables overfull \hbox (\magyar@amslevelfix) +% OK: dzs-dzs +% OK: \expandafter\addto\csname extras\CurrentOption\endcsname{\bbl@frenchspacing} +% OK: provide \magyarhyphenmins +% OK: compatibility with latex.ltx, theorem.sty, ntheorem.sty, amsthm.sty +% OK: \PackageWarning if \magyarOptions defined too late +% OK: like frenchb.ldf \declare@shorthand{french}{;}{ +% OK: \told\ref{hellopart}+es{} rszt olvasd el. +% OK: \told appends suffixes to numbers +% OK: activeacute, activegrave babel options +% OK: even more parts made conditional +% OK: \@hunumeral \@huordinal \@Hunumeral \@Huordinal +% OK: negative numbers \told-5-nek, `mnusz kettedik' etc. +% OK: magyar.ldf defaults=hu-min (mathbrk=define) $x+116=\break x-97$ adds space only to BOL; added \nobreak before \discretionary -- and the problem was solved +% OK: fixed. varioref.sty (2001/09/04 v1.3c) mustn't be loaded with option +% [magyar], because that option contains a stupid \AtBeginDocument hook +% added to \extrasmagyar +% OK: Bujdos`--Wettl: add their {itemize} symbols and {enumerate} styles +% OK: spacing around excl. marks in math mode ! closing(5) -> punct(6) +% better solution (found in nath.sty): \def!{\mathchar20513\relax\mathopen{}\mathinner{}}, +% because it doesn't need braces +% No: \@makecaption in frenchb.ldf -> magyar.ldf + +\@@magyar@restcats +\endinput% of magyar.ldf diff --git a/src/thesis.kilepr b/src/thesis.kilepr new file mode 100644 index 0000000..3df15a3 --- /dev/null +++ b/src/thesis.kilepr @@ -0,0 +1,85 @@ +[General] +bib_extensions=.bib +bibliographyBackendAutoDetected= +bibliographyBackendUserOverride=BibTeX +def_graphic_ext= +img_extIsRegExp=false +img_extensions=.eps .jpg .jpeg .png .pdf .ps .fig .gif +kileprversion=3 +kileversion=2.9.93 +masterDocument= +name=thesis +pkg_extIsRegExp=false +pkg_extensions=.cls .sty .bbx .cbx .lbx +src_extIsRegExp=false +src_extensions=.tex .ltx .latex .dtx .ins + +[Tools] +MakeIndex= +QuickBuild= + +[item:content/abstract.tex] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX + +[item:content/acknowledgement.tex] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX + +[item:content/appendices.tex] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX + +[item:content/closing.tex] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX + +[item:content/create-functions.tex] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX + +[item:content/introduction.tex] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX + +[item:content/preparation.tex] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX + +[item:content/results.tex] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX + +[item:content/theory.tex] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX + +[item:thesis.kilepr] +archive=true +encoding= +highlight= +mode= + +[item:thesis.tex] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX diff --git a/src/thesis.tex b/src/thesis.tex new file mode 100644 index 0000000..80acb52 --- /dev/null +++ b/src/thesis.tex @@ -0,0 +1,111 @@ +% !TeX spellcheck = hu_HU +% !TeX encoding = UTF-8 +% !TeX program = xelatex +%\documentclass[11pt,a4paper,oneside]{report} % Single-side +\documentclass[11pt,a4paper,twoside,openright]{report} % Duplex + +\input{include/packages} + +% Set the main variables +\newcommand{\vikszerzoVezeteknev}{Torma} +\newcommand{\vikszerzoKeresztnev}{Krist\'of} + +\newcommand{\tdkszerzoB}{Pünkösd Marcell} + +\newcommand{\vikkonzulensAMegszolitas}{Dr.~} +\newcommand{\vikkonzulensAVezeteknev}{Maliosz} +\newcommand{\vikkonzulensAKeresztnev}{Markosz} + +\newcommand{\vikkonzulensBMegszolitas}{Dr.~} +\newcommand{\vikkonzulensBVezeteknev}{Simon Csaba} +\newcommand{\vikkonzulensBKeresztnev}{} + +\newcommand{\vikkonzulensCMegszolitas}{} +\newcommand{\vikkonzulensCVezeteknev}{} +\newcommand{\vikkonzulensCKeresztnev}{} + +\newcommand{\vikcim}{Madárhang azonosító és riasztó felhő-natív rendszer} % Cím +\newcommand{\viktanszek}{\bmetmit} % Tanszék +\newcommand{\vikdoktipus}{\msc} % Dokumentum típusa (\bsc vagy \msc) +\newcommand{\vikmunkatipusat}{szakdolgozatot} % a "hallgató nyilatkozat" részhez: szakdolgozatot vagy diplomatervet + +%\input{include/tdk-variables} +%\newcommand{\szerzoMeta}{\vikszerzoVezeteknev{} \vikszerzoKeresztnev} % egy szerző esetén +\newcommand{\szerzoMeta}{\vikszerzoVezeteknev{} \vikszerzoKeresztnev, \tdkszerzoB} % két szerző esetén + +%Language configuration -- choose one +% Beállítások magyar nyelvű dolgozathoz +\input{include/thesis-hu} +% Settings for English documents +%\input{include/thesis-en} + +\input{include/preamble} + +%-------------------------------------------------------------------------------------- +% Table of contents and the main text +%-------------------------------------------------------------------------------------- +\begin{document} + +\pagenumbering{gobble} + +%These includes define guidelines -- remove these +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +%\include{include/guideline} +%\include{include/project} + +\selectthesislanguage + +%Titlepage -- choose one from below +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\input{include/titlepage} % Szakdolgozat/Diplomaterv címlap +%\include{include/titlepage-tdk} % TDK címlap +%\include{include/titlepage-otdk} % OTDK címlap + + +% Table of Contents +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\tableofcontents\vfill +\clearpage + + +% Declaration and Abstract +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +%\input{include/declaration} %Hallgatói nyilatkozat -- TDK és OTDK esetén törlendő! +\input{content/abstract} %Összefoglaló -- TDK és OTDK esetén nem kötelező + + +% The main part of the thesis +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\pagenumbering{arabic} + +%import your own content +\input{content/introduction} +\input{content/theory} +\input{content/preparation} +\input{content/create-functions} +\input{content/results} +\input{content/closing} + + +% Acknowledgements +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\input{content/acknowledgement} + + +% List of Figures, Tables +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +%\listoffigures\addcontentsline{toc}{chapter}{\listfigurename} +%\listoftables\addcontentsline{toc}{chapter}{\listtablename} + + +% Bibliography +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\addcontentsline{toc}{chapter}{\bibname} +\bibliography{bib/mybib} + +% Appendix +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\input{content/appendices} + +%\label{page:last} +\end{document}