commit 7a7671ce4014d87654ed6f7d07e5e10ebf7c12d4 Author: marcsello Date: Fri May 7 17:04:57 2021 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dfecfdd --- /dev/null +++ b/.gitignore @@ -0,0 +1,96 @@ +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 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/Makefile b/src/Makefile new file mode 100755 index 0000000..bd11833 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,70 @@ +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) + makeglossaries ${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) + makeglossaries ${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 *.synctex.gz *.acn *.acr *.alg *.glg *.glo *.gls *.ist diff --git a/src/bib/mybib.bib b/src/bib/mybib.bib new file mode 100644 index 0000000..d836e19 --- /dev/null +++ b/src/bib/mybib.bib @@ -0,0 +1,312 @@ +@techreport{RFC6020, + author = {M. Bjorklund}, + title = {YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)}, + howpublished = {Internet Requests for Comments}, + type = {RFC}, + number = {6020}, + year = {2010}, + month = {October}, + issn = {2070-1721}, + publisher = {RFC Editor}, + institution = {RFC Editor}, + url = {http://www.rfc-editor.org/rfc/rfc6020.txt}, + note = {\url{http://www.rfc-editor.org/rfc/rfc6020.txt}}, +} + +@techreport{RFC6241, + author = {R. Enns and M. Bjorklund and J. Schoenwaelder and A. Bierman}, + title = {Network Configuration Protocol (NETCONF)}, + howpublished = {Internet Requests for Comments}, + type = {RFC}, + number = {6241}, + year = {2011}, + month = {June}, + issn = {2070-1721}, + publisher = {RFC Editor}, + institution = {RFC Editor}, + url = {http://www.rfc-editor.org/rfc/rfc6241.txt}, + note = {\url{http://www.rfc-editor.org/rfc/rfc6241.txt}}, +} + +@techreport{RFC8040, + author = {A. Bierman and M. Bjorklund and K. Watsen}, + title = {RESTCONF Protocol}, + howpublished = {Internet Requests for Comments}, + type = {RFC}, + number = {8040}, + year = {2017}, + month = {January}, + issn = {2070-1721}, + publisher = {RFC Editor}, + institution = {RFC Editor}, + url = {http://www.rfc-editor.org/rfc/rfc8040.txt}, + note = {\url{http://www.rfc-editor.org/rfc/rfc8040.txt}} +} + +@techreport{RECXPATH, + author = {J. Clark and S. DeRose}, + title = {XML Path Language (XPath) Version 1.0}, + howpublished = {W3C Recommendation}, + year = {1999}, + publisher = {W3C}, + institution = {W3C}, + url = {https://www.w3.org/TR/1999/REC-xpath-19991116/}, + note = {\url{https://www.w3.org/TR/1999/REC-xpath-19991116/}} +} + +@techreport{talwar-rtgwg-grpc-use-cases, + author = {gRPC Protocol Specification and Jayant Kolhe and Anees Shaikh and Joshua George}, + title = {Use cases for gRPC in network management}, + howpublished = {Working Draft}, + type = {Internet-Draft}, + number = {draft-talwar-rtgwg-grpc-use-cases-01}, + year = {2017}, + month = {July}, + institution = {IETF Secretariat}, + url = {https://tools.ietf.org/id/draft-talwar-rtgwg-grpc-use-cases-01.txt}, + note = {\url{https://tools.ietf.org/id/draft-talwar-rtgwg-grpc-use-cases-01.txt}}, +} + + +@techreport{kumar-rtgwg-grpc-protocol, + author = {Abhishek Kumar and Jayant Kolhe and Sanjay Ghemawat and Louis Ryan}, + title = {gRPC Protocol}, + howpublished = {Working Draft}, + type = {Internet-Draft}, + number = {draft-kumar-rtgwg-grpc-protocol-00}, + year = {2016}, + month = {July}, + institution = {IETF Secretariat}, + url = {https://tools.ietf.org/id/draft-kumar-rtgwg-grpc-protocol-00.txt}, + note = {\url{https://tools.ietf.org/id/draft-kumar-rtgwg-grpc-protocol-00.txt}}, +} + +@techreport{RFC7540, + author = {M. Belshe and R. Peon and M. Thomson}, + title = {Hypertext Transfer Protocol Version 2 (HTTP/2)}, + howpublished = {Internet Requests for Comments}, + type = {RFC}, + number = {7540}, + year = {2015}, + month = {May}, + issn = {2070-1721}, + publisher = {RFC Editor}, + institution = {RFC Editor}, + url = {http://www.rfc-editor.org/rfc/rfc7540.txt}, + note = {\url{http://www.rfc-editor.org/rfc/rfc7540.txt}}, +} + +@techreport{RFC1050, + author = {{Sun Microsystems, Inc.}}, + title = {RPC: Remote Procedure Call Protocol specification}, + howpublished = {Internet Requests for Comments}, + type = {RFC}, + number = {1050}, + year = {1988}, + month = {April}, + issn = {2070-1721}, + publisher = {RFC Editor}, + institution = {RFC Editor}, +} + +@techreport{RFC3411, + author = {D. Harrington and R. Presuhn and B. Wijnen}, + title = {An Architecture for Describing Simple Network Management Protocol (SNMP) Management Frameworks}, + howpublished = {Internet Requests for Comments}, + type = {STD}, + number = {62}, + year = {2002}, + month = {December}, + issn = {2070-1721}, + publisher = {RFC Editor}, + institution = {RFC Editor}, + url = {http://www.rfc-editor.org/rfc/rfc3411.txt}, + note = {\url{http://www.rfc-editor.org/rfc/rfc3411.txt}}, +} + +@techreport{RFC5424, + author = {R. Gerhards}, + title = {The Syslog Protocol}, + howpublished = {Internet Requests for Comments}, + type = {RFC}, + number = {5424}, + year = {2009}, + month = {March}, + issn = {2070-1721}, + publisher = {RFC Editor}, + institution = {RFC Editor}, + url = {http://www.rfc-editor.org/rfc/rfc5424.txt}, + note = {\url{http://www.rfc-editor.org/rfc/rfc5424.txt}}, +} + +@article{an2015variational, + title={Variational autoencoder based anomaly detection using reconstruction probability}, + author={An, Jinwon and Cho, Sungzoon}, + journal={Special Lecture on IE}, + volume={2}, + number={1}, + year={2015} +} + +@misc{protobuf_enc, + author = {Google}, + title = {Protocol Buffers - Encoding}, + howpublished = {\url{https://developers.google.com/protocol-buffers/docs/encoding}}, + note = {Accessed: 2019-11-23} +} + +@misc{protobuf, + author = {Google}, + title = {Protocol Buffers - Overview}, + howpublished = {\url{https://developers.google.com/protocol-buffers/docs/overview}}, + note = {Accessed: 2019-11-23} +} + +@misc{protofilespec3, + author = {Google}, + title = {Protocol Buffers Version 3 Language Specification}, + howpublished = {\url{https://developers.google.com/protocol-buffers/docs/reference/proto3-spec}}, + note = {Accessed: 2019-11-25} +} + +@misc{protofilespec2, + author = {Google}, + title = {Protocol Buffers Version 2 Language Specification}, + howpublished = {\url{https://developers.google.com/protocol-buffers/docs/reference/proto2-spec}}, + note = {Accessed: 2019-11-25} +} + +@misc{grpcoverhttp, + title = {gRPC over HTTP2}, + howpublished = {\url{https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md}}, + note = {Accessed: 2019-11-25} +} + +@misc{whatisgrpc, + title={What is gRPC?}, + howpublished = {\url{https://grpc.io/docs/guides/}}, + note = {Accessed: 2019-11-25} +} + +@misc{grpcconcepts, + title={gRPC Concepts}, + howpublished = {\url{https://grpc.io/docs/guides/concepts/}}, + note = {Accessed: 2019-11-25} +} + +@misc{grpcauth, + title={Authentication}, + howpublished = {\url{https://grpc.io/docs/guides/auth/}}, + note = {Accessed: 2019-11-25} +} + +@misc{grpcdesign, + title={gRPC Motivation and Design Principles}, + howpublished = {\url{https://grpc.io/blog/principles/}}, + note = {Accessed: 2019-11-25} +} + +@misc{gnmispec, + title={gRPC Network Management Interface (gNMI) - Specificaion}, + howpublished = {\url{https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md}}, + note = {Accessed: 2019-11-29} +} + +@misc{gnmipath, + title={gRPC Network Management Interface (gNMI) - Schema path encoding conventions for gNMI}, + howpublished = {\url{https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-path-conventions.md}}, + note = {Accessed: 2019-11-30} +} + +@misc{protoc, + title={Protocol Buffers - Google's data interchange format}, + howpublished = {\url{https://github.com/protocolbuffers/protobuf/blob/master/README.md}}, + note = {Accessed: 2019-12-01} +} + +@manual{core_components_of_mdt, + title = {Core Components of Model-driven Telemetry Streaming}, + date = {March 28, 2019}, + language = {English}, + organization = {Cisco Systems, Inc.}, + pagetotal = {4}, +} + +@manual{iosxr_telemetry_configuration, + title = {Telemetry Configuration Guide for Cisco ASR 9000 Series Routers, IOS XR Release 6.5.x}, + date = {January 1, 2019}, + language = {English}, + organization = {Cisco Systems, Inc.}, + pagetotal = {30}, + pubstate = {March 29, 2019}, +} + + +@manual{nxos_gnmi_configuration, + title = {Cisco Nexus 9000 Series NX-OS Programmability Guide, Release 9.3(x)}, + date = {September 23, 2019}, + language = {English}, + organization = {Cisco Systems, Inc.}, + pubstate = {September 23, 2019}, +} + +@manual{iosxe_gnmi_configuration, + title = {Programmability Configuration Guide, Cisco IOS XE Gibraltar 16.10.x}, + date = {September 10, 2019}, + language = {English}, + organization = {Cisco Systems, Inc.}, + pubstate = {September 10, 2019}, +} + +@misc{grafanadocs, + title = {Grafana Documentation}, + howpublished = {\url{https://grafana.com/docs/}}, + note = {Accessed: 2019-12-03} +} + +@misc{influxdbdocs, + title = {InfluxDB documentation}, + howpublished = {\url{https://docs.influxdata.com/influxdb/v1.7/}}, + note = {Accessed: 2019-12-03} +} + +@misc{tsdbexplained, + title = {Time series database (TSDB) explained}, + howpublished = {\url{https://www.influxdata.com/time-series-database/}}, + note = {Accessed: 2019-12-03} +} + + +@misc{whycaretelemetry, + author={Shelly Cadora}, + title={Why You Should Care About Model-Driven Telemetry}, + howpublished={\url{https://blogs.cisco.com/sp/why-you-should-care-about-model-driven-telemetry}}, + note = {Accessed: 2019-12-03} +} + +@inproceedings{cao2006density, + title={Density-based clustering over an evolving data stream with noise}, + author={Cao, Feng and Estert, Martin and Qian, Weining and Zhou, Aoying}, + booktitle={Proceedings of the 2006 SIAM international conference on data mining}, + pages={328--339}, + year={2006}, + organization={SIAM} +} + +@inproceedings{putina2018telemetry, + title={Telemetry-based stream-learning of BGP anomalies}, + author={Putina, Andrian and Rossi, Dario and Bifet, Albert and Barth, Steven and Pletcher, Drew and Precup, Cristina and Nivaggioli, Patrice}, + booktitle={Proceedings of the 2018 Workshop on Big Data Analytics and Machine Learning for Data Communication Networks}, + pages={15--20}, + year={2018}, + organization={ACM} +} + +@inproceedings{zhou2017anomaly, + title={Anomaly detection with robust deep autoencoders}, + author={Zhou, Chong and Paffenroth, Randy C}, + booktitle={Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining}, + pages={665--674}, + year={2017}, + organization={ACM} +} \ No newline at end of file diff --git a/src/content/abstract.tex b/src/content/abstract.tex new file mode 100644 index 0000000..cf67471 --- /dev/null +++ b/src/content/abstract.tex @@ -0,0 +1,31 @@ +% !TeX root = ../thesis.tex +\pagenumbering{roman} +\setcounter{page}{1} + +\selecthungarian + +%---------------------------------------------------------------------------- +% Abstract in Hungarian +%---------------------------------------------------------------------------- +\chapter*{Kivonat}\addcontentsline{toc}{chapter}{Kivonat} + + +\lipsum{2} + +\vfill +\selectenglish + + +%---------------------------------------------------------------------------- +% Abstract in English +%---------------------------------------------------------------------------- +\chapter*{Abstract}\addcontentsline{toc}{chapter}{Abstract} + +\lipsum{2} + +\vfill +\selectthesislanguage + +\newcounter{romanPage} +\setcounter{romanPage}{\value{page}} +\stepcounter{romanPage} \ No newline at end of file diff --git a/src/content/acknowledgement.tex b/src/content/acknowledgement.tex new file mode 100644 index 0000000..251be46 --- /dev/null +++ b/src/content/acknowledgement.tex @@ -0,0 +1,5 @@ +%---------------------------------------------------------------------------- +\chapter*{\koszonetnyilvanitas}\addcontentsline{toc}{chapter}{\koszonetnyilvanitas} +%---------------------------------------------------------------------------- + +\lipsum{1} \ No newline at end of file diff --git a/src/content/appendices.tex b/src/content/appendices.tex new file mode 100644 index 0000000..071eb12 --- /dev/null +++ b/src/content/appendices.tex @@ -0,0 +1,14 @@ +% !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} + + +%---------------------------------------------------------------------------- diff --git a/src/content/conclusion.tex b/src/content/conclusion.tex new file mode 100644 index 0000000..f98e22b --- /dev/null +++ b/src/content/conclusion.tex @@ -0,0 +1,12 @@ +% !TeX root = ../thesis.tex +%---------------------------------------------------------------------------- +\chapter{Konklúzió} +%---------------------------------------------------------------------------- + +\section{Összefoglalás} + +\lipsum{3} + +\section{Jövőbeni tervek} + +\lipsum{1} \ No newline at end of file diff --git a/src/content/glossary.tex b/src/content/glossary.tex new file mode 100644 index 0000000..c8a976e --- /dev/null +++ b/src/content/glossary.tex @@ -0,0 +1,130 @@ +\newglossaryentry{cisco} +{ + name={Cisco}, + description={Cisco Systems Inc.~is an american multinational corporation which designs, manufactures and sells costumer grade electronics, network appliences, voice and other communication solutions} +} + +\newglossaryentry{ospf_glo} % TODO +{ + name={OSPF}, + description={\acrfull{ospf} is an interior gateway protocol classified as link state protocol. \acrshort{ospf} is usually used to exchange routing information between routers inside an organization} +} + +\newglossaryentry{bgp_glo} % TODO +{ + name={BGP}, + description={\acrfull{bgp} is an exterior gateway protocol classified as path vector protocol. \acrshort{bgp} defines \acrfullpl{as} and exchanges routing information between them over the public internet} +} + +\newglossaryentry{telemetry} +{ + name={telemetry}, + description={Telemetry is a form of automatized communication process which allows the collection of sensor measurements and similar on remote or inaccassable locations and conveys them to a processing facility for monitoring} +} + +\newglossaryentry{ios_glo} +{ + name={IOS}, + description={\acrfull{ios} is an operating system developed by \Gls{cisco}. It is designed to run primarily on \Gls{cisco} designed networking hardware. Running \acrshort{ios} in virtualized environment is also possible} +} + +\newglossaryentry{cpython} +{ + name={CPython}, + description={CPython is the standard interpreter for the Python programming language. CPython is written in C (hence the name) and it is the most widely used Python interpreter} +} + +\newglossaryentry{openconfig} % TODO ez ne legyen lopoott +{ + name={OpenConfig}, + description={OpenConfig is an informal working group of network operators sharing the goal of moving computer networks toward a more dynamic, programmable infrastructure by adopting software-defined networking principles such as declarative configuration and model-driven management and operations} +} + +\newglossaryentry{serialization} +{ + name={serialization}, + description={Serialization is the process of translating data structures or object state represented in a computer program into a format that can be stored or transmitted and reconstructed later into an object or data structure that represents the same values as the original one in a different or the same computer program}, +} + +\newglossaryentry{method_stub} +{ + name={method stub}, + description={Method stub is a piece of code which act as a placeholder because of the implementation of its real functionality is not (yet) aviliable in the software} +} + +\newglossaryentry{rfc_glo} +{ + name={RFC}, + description={\acrfull{rfc} is a document which is published when a new Internet standard is defined. The purpose of the \acrshort{rfc} is to serve as a detialed as possible definition for each standard. Individuals implementing the standards must refer to the relevant \acrshort{rfc} and work accordingly in order to have their implementation compatible with the rest of the implementations on the Internet} +} + +\newglossaryentry{library} +{ + name={library}, + text={library}, + description={A library in software development is a set of generic prewritten, reusable sub-programs that are already developed and can be used by a software project} +} + +\newglossaryentry{opensource} +{ + name={open source}, + description={The source code of the software is open and publicly available for anyone to read, analyze or modify} +} + +\newacronym{mdt}{MDT}{Model-Driven Telemetry} +\newacronym{ai}{AI}{Artificial Intelligence} +\newacronym{ml}{ML}{Machine Learning} +\newacronym{ospf}{OSPF}{Open Shortest Path First} +\newacronym{rip}{RIP}{Routing Information Protocol} +\newacronym{bgp}{BGP}{Border Gateway Protocol} +\newacronym{ietf}{IETF}{Internet Engineering Task Force} +\newacronym{igp}{IGP}{Interior Gateway Protocol} +\newacronym{egp}{EGP}{Exterior Gateway Protocol} +\newacronym{as}{AS}{Autonomous System} +\newacronym{iot}{IoT}{Internet of Things} +\newacronym{vod}{VoD}{Video on Demand} +\newacronym{snmp}{SNMP}{Simple Network Management Protocol} +\newacronym{ssh}{SSH}{Secure SHell} +\newacronym{mib}{MIB}{Management Information Base} % Man in Black +\newacronym{tcp}{TCP}{Transmission Control Protocol} +\newacronym{udp}{UDP}{User Datagram Protocol} +\newacronym{grpc}{gRPC}{gRPC Remote Procedure Call} +\newacronym{json}{JSON}{JavaScript Object Notation} +\newacronym{gpb}{GPB}{(Google) Protocol Buffers} +\newacronym{mtu}{MTU}{Maximum Transmission Unit} +\newacronym{gil}{GIL}{Global Interpreter Lock} +\newacronym{gc}{GC}{Garbage Collector} +\newacronym{csv}{CSV}{Comma-Separated Values} +\newacronym{os}{OS}{Operating System} +\newacronym{ios}{IOS}{\Gls{cisco} Internetwork \acrlong{os}} +\newacronym{lan}{LAN}{Local Area Network} +\newacronym{vlan}{VLAN}{Virtual \acrlong{lan}} +\newacronym{nasa}{NASA}{National Aeronautics and Space Administration} +\newacronym{gnmi}{gNMI}{gRPC Network Management Interface} +\newacronym{xml}{XML}{Extensible Markup Language} +\newacronym{xpath}{XPath}{\acrshort{xml} Path Language} +\newacronym{idl}{IDL}{Interface Definition Language} +\newacronym{http}{HTTP}{HyperText Transfer Protocol} +\newacronym{http2}{HTTP/2}{HyperText Transfer Protocol Version 2} +\newacronym{rpc}{RPC}{Remote Procedure Call} +\newacronym{tls}{TLS}{Transport Layer Security} +\newacronym{ssl}{SSL}{Secure Sockets Layer} +\newacronym{ip}{IP}{Internet Protocol} +\newacronym{rfc}{RFC}{Request for Comments} +\newacronym{gnu}{GNU}{GNU's Not Unix!} +\newacronym{html}{HTML}{HyperText Markup Language} +\newacronym{ascii}{ASCII}{American Standard Code for Information Interchange} +\newacronym{cli}{CLI}{Command Line Interface} +\newacronym{dsdl}{DSDL}{Document Schema Definition Languages} +\newacronym{uml}{UML}{Unified Modeling Language} +\newacronym{tas}{TAS}{Telemetry Analytics System} +\newacronym{gui}{GUI}{Graphical User Interface} +\newacronym{tsdb}{TSDB}{Time Series Database} +\newacronym{api}{API}{Application Programming Interface} +\newacronym{tsm}{TSM}{Time Structured Merge Tree} +\newacronym{smp}{SMP}{Symmetric Multiprocessing} +\newacronym{stdout}{STDOUT}{Standard Output} +\newacronym{ciscoie}{Cisco-IE}{Cisco Innovation Edge} +\newacronym{oid}{OID}{Object Identifier} +\newacronym{ann}{ANN}{Artificial Neural Network} +\newacronym{nms}{NMS}{Network Management Station} \ No newline at end of file diff --git a/src/content/introduction.tex b/src/content/introduction.tex new file mode 100644 index 0000000..59ef56c --- /dev/null +++ b/src/content/introduction.tex @@ -0,0 +1,14 @@ +% !TeX root = ../thesis.tex +%---------------------------------------------------------------------------- +\chapter{\bevezetes} +%---------------------------------------------------------------------------- + +\lipsum{3} + +\section{Objectives} + +\lipsum{2} + +\section{Overview of Chapters} + +\lipsum{3} \ 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/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..e6b8c5f --- /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..4bbe4e2 --- /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..0e628ea --- /dev/null +++ b/src/include/packages.tex @@ -0,0 +1,72 @@ +% 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{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} + +% User packages +\usepackage{lipsum} +\usepackage[acronym,toc]{glossaries} +\usepackage{soul} +\usepackage{tabularx} +\usepackage{rotating} +\usepackage{mdframed} \ No newline at end of file diff --git a/src/include/preamble.tex b/src/include/preamble.tex new file mode 100644 index 0000000..40e3d91 --- /dev/null +++ b/src/include/preamble.tex @@ -0,0 +1,135 @@ +%-------------------------------------------------------------------------------------- +% 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} + +% True magic +\renewcommand\lstlistingname{Example} +\renewcommand\lstlistlistingname{List of Examples} % name of listings list + +\newmdenv[ + topline=false, + bottomline=false, + rightline=false, + linewidth = 0.5pt, + skipabove=\topsep, + skipbelow=\topsep +]{siderule} \ No newline at end of file diff --git a/src/include/project.tex b/src/include/project.tex new file mode 100644 index 0000000..251eda7 --- /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..06497fe --- /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{\kulsokonzulenstitle}{Industrial 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{\vikkonzulens}{\vikkonzulensMegszolitas\vikkonzulensKeresztnev{} \vikkonzulensVezeteknev} +\newcommand{\kulsokonzulens}{\kulsokonzulensMegszolitas\kulsokonzulensKeresztnev{} \kulsokonzulensVezeteknev} + +\newcommand{\selectthesislanguage}{\selectenglish} + +\bibliographystyle{ieeetr} %CHANGED FROM PLAINNAT + +\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..461db5c --- /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{huplain} + +\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..5dcae50 --- /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} \smallskip \\ + & \makebox[7cm]{\vikkonzulensB} \\ + \\ + \end{tabular} +} + +\vfill +{\large Budapest, \the\year} % lol +\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.tex b/src/thesis.tex new file mode 100644 index 0000000..8694dad --- /dev/null +++ b/src/thesis.tex @@ -0,0 +1,103 @@ +% !TeX spellcheck = en_US +% !TeX encoding = UTF-8 +% !TeX program = xelatex + +%\documentclass[11pt,a4paper,oneside]{report} % Single-side +\documentclass[11pt,a4paper,twoside,openright]{report} % Duplex + +\input{include/packages} + + +\newcommand{\vikszerzoVezeteknev}{Pünkösd} +\newcommand{\vikszerzoKeresztnev}{Marcell} + +\newcommand{\vikkonzulensAMegszolitas}{dr.~} +\newcommand{\vikkonzulensAVezeteknev}{Maliosz} +\newcommand{\vikkonzulensAKeresztnev}{Markosz} + +\newcommand{\vikkonzulensBMegszolitas}{dr.~} +\newcommand{\vikkonzulensBVezeteknev}{Simon} +\newcommand{\vikkonzulensBKeresztnev}{Csaba} + +\newcommand{\vikcim}{Szolgáltatás létesítés peremhálózati és felhő számítástechnika ötvözésével} % Cím +\newcommand{\viktanszek}{\bmetmit} % Tanszék +\newcommand{\vikdoktipus}{\msc} % Dokumentum típusa (\bsc vagy \msc) +\newcommand{\vikmunkatipusat}{diplomatervet} % 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 + +\input{include/thesis-hu} + +\input{include/preamble} + +%glossary stuff +\glstoctrue +\makeglossaries +\include{content/glossary} % wut? + + +%-------------------------------------------------------------------------------------- +% Table of contents and the main text +%-------------------------------------------------------------------------------------- +\begin{document} + +\pagenumbering{gobble} + +\selectthesislanguage + + +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\include{include/titlepage} + + + +% Table of Contents +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\tableofcontents\vfill + + +% Declaration and Abstract +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\include{include/declaration} +\include{content/abstract} + + +% The main part of the thesis +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\pagenumbering{arabic} + + +\include{content/introduction} +% Include chapters here +\include{content/conclusion} + + +% Acknowledgements +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\include{content/acknowledgement} + + +% List of Figures, Tables +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\listoffigures\addcontentsline{toc}{chapter}{\listfigurename} +\listoftables\addcontentsline{toc}{chapter}{\listtablename} + +% Glossary + acronyms +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\printglossaries + + +% Bibliography +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\addcontentsline{toc}{chapter}{\bibname} +\bibliography{bib/mybib} + + +% Appendix +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\include{content/appendices} + +%\label{page:last} +\end{document} diff --git a/src/todo.sh b/src/todo.sh new file mode 100755 index 0000000..8c054ac --- /dev/null +++ b/src/todo.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +for i in include content bib; do + grep --color '%*TODO' $i/* +done | if [[ "$@" == "--summary" ]]; then + echo $(wc -l)" Todos" +else + cat +fi