TeX-Encode-2.004/000755 000765 000024 00000000000 13217023067 013227 5ustar00a3fstaff000000 000000 TeX-Encode-2.004/LICENSE000644 000765 000024 00000043666 13217023067 014253 0ustar00a3fstaff000000 000000 This software is copyright (c) 2005 by Timothy D Brody. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2005 by Timothy D Brody. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy 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 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2005 by Timothy D Brody. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End TeX-Encode-2.004/CHANGES000644 000765 000024 00000002663 13217023067 014231 0ustar00a3fstaff000000 000000 ================================================== Changes from 2016-12-21 00:00:00 +0000 to present. ================================================== ------------------------------------------ version 2.004 at 2017-12-21 21:23:00 +0000 ------------------------------------------ Change: 6642b841c784b6636b310918a99950e6f6b85d56 Author: Niko Tyni Date : 2017-12-21 22:22:15 +0000 Remove hardcoded $VERSION from TeX::Encode::BibTex The $VERSION line is nowadays autogenerated, resulting in two clashing version declarations that cause a warning on usage. Bug-Debian: https://bugs.debian.org/877094 ------------------------------------------ version 2.003 at 2017-09-12 19:31:53 +0000 ------------------------------------------ Change: fa4a12d1dc8092aaaa43080dbf370c779e1e5527 Author: Ahmad Fatoum Date : 2017-09-12 21:31:53 +0000 Skip Encode v2.90 as pre-requirement MYMETA now specifies 2.91 as prereq if 2.90 is found. Fixes #2. ------------------------------------------ version 2.002 at 2017-09-12 09:54:26 +0000 ------------------------------------------ Change: ff8167689065d46f5a65b8a633958f1ecd27e282 Author: Ahmad Fatoum Date : 2017-09-12 11:54:26 +0000 Move POD and coverage to xt/ ================================================= Plus 12 releases after 2016-12-21 00:00:00 +0000. ================================================= TeX-Encode-2.004/MANIFEST000644 000765 000024 00000000760 13217023067 014363 0ustar00a3fstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.010. CHANGES CHANGES.pre-2.0 LICENSE MANIFEST META.json META.yml Makefile.PL README debug/debug.pl dist.ini lib/TeX/Encode.pm lib/TeX/Encode/BibTeX.pm lib/TeX/Encode/charmap.pm t/00-compile.t t/00-report-prereqs.dd t/00-report-prereqs.t t/01ltgt.t t/02check.t t/Encode-LaTeX.t t/regressions.t xt/98coverage.t xt/99pod.t xt/author/00-compile.t xt/author/pod-syntax.t xt/author/test-version.t xt/release/minimum-version.t TeX-Encode-2.004/t/000755 000765 000024 00000000000 13217023067 013472 5ustar00a3fstaff000000 000000 TeX-Encode-2.004/xt/000755 000765 000024 00000000000 13217023067 013662 5ustar00a3fstaff000000 000000 TeX-Encode-2.004/README000644 000765 000024 00000004734 13217023067 014117 0ustar00a3fstaff000000 000000 NAME TeX::Encode - Encode/decode Perl utf-8 strings into TeX SYNOPSIS use TeX::Encode; use Encode; $tex = encode('latex', "This will encode an e-acute (".chr(0xe9).") as \'e"); $str = decode('latex', $tex); # Will decode the \'e too! DESCRIPTION This module provides encoding to LaTeX escapes from utf8 using mapping tables in Pod::LaTeX and HTML::Entities. This covers only a subset of the Unicode character table (undef warnings will occur for non-mapped chars). This module is intentionally vague about what it will handle, see Caveats below. Mileage will vary when decoding (converting TeX to utf8), as TeX is in essence a programming language, and this module does not implement TeX. I use this module to encode author names in BibTeX and to do a rough job at presenting LaTeX abstracts in HTML. Using decode rather than seeing $\sqrt{\Omega^2\zeta_n}$ you get something that looks like the formula. The next logical step for this module is to integrate some level of TeX grammar to improve the decoding, in particular to handle fractions and font changes (which should probably be dropped). METHODS TeX::Encode::encode STRING [, CHECK] Encodes a utf8 string into TeX. CHECK isn't implemented. TeX::Encode::decode STRING [, CHECK] Decodes a TeX string into utf8. CHECK isn't implemented. TeX::Encode::perlio_ok Returns 0. PerlIO isn't implemented. CAVEATS Proper Encode checking is not implemented. LaTeX comments (% ...) are ignored because chopping a lot of text may not be what you actually want. encode() Converts non-ASCII Unicode characters to their equivalent TeX symbols (unTeXable characters will result in undef warnings). decode() Attempts to convert TeX symbols (e.g. \ae) to Unicode characters. As an experimental feature this also handles Math-mode TeX by inserting HTML into the resulting string (so you end up with an HTML approximation of the maths - NOT MathML). SEE ALSO Encode::Encoding, Pod::LaTeX, Encode AUTHOR * Timothy D Brody, * Ahmad Fatoum , http://a3f.at COPYRIGHT AND LICENSE Copyright (C) 2005-2007 by Timothy D Brody This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available. TeX-Encode-2.004/CHANGES.pre-2.0000644 000765 000024 00000003513 13217023067 015306 0ustar00a3fstaff000000 000000 Revision history for Perl extension Encode::LaTeX. 2.0 - New co-maintainer, added repository link - Added 295 new mappings (PAUSE issue #118001) 1.3 - Oops, missing BibTeX.pm and charmap.pm from MANIFEST 1.2 - Added support to encode() for check argument - Adds braces to protect whitespace after macros - This version is a clean-up version that doesn't emit HTML fragments, if you want HTML you should look at http://www.mathjax.org/ 1.1 - Added support for \ensuremath{} - Wrap greek letters in \ensuremath{} to fix a typesetting problem (reported by Mark Muldoon) 1.0 - CPAN thinks 0.10 is less than 0.9 0.10 - Remove empty braces e.g. $\sim{}200$ 0.9 - Removed autoloader: this isn't an xs module - Added LaTeX 'special characters' - Changed decode behaviour to decode mathmode first, then other macros - Modified decode to use a single regexp for other macros - Searches for longest named macro first 0.7 - Fixed bug: Wasn't actually eating paired braces at all - math** and text** now map to span classes of the same name in htmlise - Added encoding of TeX reserved characters 0.6 - Fixed incompatibility with HTML::Parser 1.35 - Upped the required versions of Pod::LaTeX and HTML::Entities to ones I know work 0.5 - Fixed an incorrect quoting bug in MathMode - Added a couple of tests for quote bug and escaping - Now unescapes any singular character (\\ => \, \x => x, etc), this may be too broad and need casing? 0.4 - Support for Latex braces (e.g. {\rm \sigma}) - Support for fractions (still off-set though) 0.3 - Moved namespace to TeX::Encode, as this isn't really character encoding per-se (more character escaping) 0.2 - Added support for decoding mathematical symbols 0.1 Tue Aug 16 12:58:54 2005 - original version; created by h2xs 1.23 with options -X -v 0.1 -b 5.8.0 -n Encode::LaTeX TeX-Encode-2.004/META.yml000644 000765 000024 00000024737 13217023067 014515 0ustar00a3fstaff000000 000000 --- abstract: 'Encode/decode Perl utf-8 strings into TeX' author: - 'Timothy D Brody ' - 'Ahmad Fatoum ' build_requires: Encode: '0' ExtUtils::MakeMaker: '0' File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' Test::More: '0.1' blib: '1.01' perl: '5.008' utf8: '0' warnings: '0' configure_requires: CPAN::Meta::Requirements: '2.120620' ExtUtils::MakeMaker: '0' Module::Metadata: '0' perl: '5.008' dynamic_config: 1 generated_by: 'Dist::Zilla version 6.010, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: TeX-Encode no_index: directory: - eg - examples - inc - share - t - xt provides: TeX::Encode: file: lib/TeX/Encode.pm version: '2.004' TeX::Encode::BibTeX: file: lib/TeX/Encode/BibTeX.pm version: '2.004' TeX::Encode::charmap: file: lib/TeX/Encode/charmap.pm version: '2.004' requires: Carp: '0' Encode::Encoding: '0.1' HTML::Entities: '1.27' HTML::Parser: '3.35' Pod::LaTeX: '0.56' perl: '5.008' strict: '0' vars: '0' resources: bugtracker: https://github.com/athreef/TeX-Encode/issues homepage: https://github.com/athreef/TeX-Encode repository: https://github.com/athreef/TeX-Encode.git version: '2.004' x_Dist_Zilla: perl: version: '5.026001' plugins: - class: Dist::Zilla::Plugin::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: [] exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . name: '@Starter/GatherDir' version: '6.010' - class: Dist::Zilla::Plugin::PruneCruft name: '@Starter/PruneCruft' version: '6.010' - class: Dist::Zilla::Plugin::ManifestSkip name: '@Starter/ManifestSkip' version: '6.010' - class: Dist::Zilla::Plugin::MetaConfig name: '@Starter/MetaConfig' version: '6.010' - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: finder_objects: - class: Dist::Zilla::Plugin::FinderCode name: '@Starter/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: '6.010' include_underscores: 0 Dist::Zilla::Role::MetaProvider::Provider: $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' inherit_missing: '1' inherit_version: '1' meta_noindex: '1' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000033' version: '0.004' name: '@Starter/MetaProvides::Package' version: '2.004003' - class: Dist::Zilla::Plugin::MetaNoIndex name: '@Starter/MetaNoIndex' version: '6.010' - class: Dist::Zilla::Plugin::MetaYAML name: '@Starter/MetaYAML' version: '6.010' - class: Dist::Zilla::Plugin::MetaJSON name: '@Starter/MetaJSON' version: '6.010' - class: Dist::Zilla::Plugin::License name: '@Starter/License' version: '6.010' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: '@Starter/ReadmeAnyFromPod' version: '0.163250' - class: Dist::Zilla::Plugin::ExecDir name: '@Starter/ExecDir' version: '6.010' - class: Dist::Zilla::Plugin::ShareDir name: '@Starter/ShareDir' version: '6.010' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Starter/PodSyntaxTests' version: '6.010' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@Starter/Test::ReportPrereqs' version: '0.027' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '0' fail_on_warning: author fake_home: 0 filename: xt/author/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: develop script_finder: - ':PerlExecFiles' skips: [] switch: [] name: '@Starter/Test::Compile' version: '2.056' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@Starter/MakeMaker' version: '6.010' - class: Dist::Zilla::Plugin::Manifest name: '@Starter/Manifest' version: '6.010' - class: Dist::Zilla::Plugin::TestRelease name: '@Starter/TestRelease' version: '6.010' - class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@Starter/RunExtraTests' version: '0.029' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Starter/ConfirmRelease' version: '6.010' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Starter/UploadToCPAN' version: '6.010' - class: Dist::Zilla::Plugin::AutoPrereqs name: AutoPrereqs version: '6.010' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: requires name: Prereqs version: '6.010' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: TestRequires version: '6.010' - class: Dist::Zilla::Plugin::DynamicPrereqs config: Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000033' version: '0.004' name: DynamicPrereqs version: '0.033' - class: Dist::Zilla::Plugin::GithubMeta name: GithubMeta version: '0.54' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.15.1 repo_root: . name: '@Git/Check' version: '2.042' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: v%v%n%n%c Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.15.1 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Git/Commit' version: '2.042' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: v2.004 tag_format: v%v tag_message: v%v Dist::Zilla::Role::Git::Repo: git_version: 2.15.1 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Git/Tag' version: '2.042' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - origin remotes_must_exist: 1 Dist::Zilla::Role::Git::Repo: git_version: 2.15.1 repo_root: . name: '@Git/Push' version: '2.042' - class: Dist::Zilla::Plugin::ChangelogFromGit name: ChangelogFromGit version: '0.016' - class: Dist::Zilla::Plugin::Git::NextVersion config: Dist::Zilla::Plugin::Git::NextVersion: first_version: '2.001' version_by_branch: 0 version_regexp: (?^:^v(.+)$) Dist::Zilla::Role::Git::Repo: git_version: 2.15.1 repo_root: . name: Git::NextVersion version: '2.042' - class: Dist::Zilla::Plugin::OurPkgVersion name: OurPkgVersion version: '0.12' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: ReadmePodInRoot version: '0.163250' - class: Dist::Zilla::Plugin::MinimumPerl name: MinimumPerl version: '1.006' - class: Dist::Zilla::Plugin::Test::MinimumVersion name: Test::MinimumVersion version: '2.000007' - class: Dist::Zilla::Plugin::Test::Version name: Test::Version version: '1.09' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '0' fail_on_warning: author fake_home: 0 filename: t/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: test script_finder: - ':PerlExecFiles' skips: [] switch: [] name: Test::Compile version: '2.056' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: '@Starter/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: '6.010' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.010' x_serialization_backend: 'YAML::Tiny version 1.70' TeX-Encode-2.004/lib/000755 000765 000024 00000000000 13217023067 013775 5ustar00a3fstaff000000 000000 TeX-Encode-2.004/Makefile.PL000644 000765 000024 00000006456 13217023067 015214 0ustar00a3fstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.010. use strict; use warnings; use 5.008; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Encode/decode Perl utf-8 strings into TeX", "AUTHOR" => "Timothy D Brody , Ahmad Fatoum ", "CONFIGURE_REQUIRES" => { "CPAN::Meta::Requirements" => "2.120620", "ExtUtils::MakeMaker" => 0, "Module::Metadata" => 0 }, "DISTNAME" => "TeX-Encode", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.008", "NAME" => "TeX::Encode", "PREREQ_PM" => { "Carp" => 0, "Encode::Encoding" => "0.1", "HTML::Entities" => "1.27", "HTML::Parser" => "3.35", "Pod::LaTeX" => "0.56", "strict" => 0, "vars" => 0 }, "TEST_REQUIRES" => { "Encode" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::More" => "0.1", "blib" => "1.01", "utf8" => 0, "warnings" => 0 }, "VERSION" => "2.004", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Encode" => 0, "Encode::Encoding" => "0.1", "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "HTML::Entities" => "1.27", "HTML::Parser" => "3.35", "IO::Handle" => 0, "IPC::Open3" => 0, "Pod::LaTeX" => "0.56", "Test::More" => "0.1", "blib" => "1.01", "strict" => 0, "utf8" => 0, "vars" => 0, "warnings" => 0 ); # inserted by Dist::Zilla::Plugin::DynamicPrereqs 0.033 requires('Encode', '2.91') if (has_module('Encode') || 0) eq '2.90'; unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); # inserted by Dist::Zilla::Plugin::DynamicPrereqs 0.033 sub _add_prereq { my ($mm_key, $module, $version_or_range) = @_; $version_or_range ||= 0; warn "$module already exists in $mm_key (at version $WriteMakefileArgs{$mm_key}{$module}) -- need to do a sane metamerge!" if exists $WriteMakefileArgs{$mm_key}{$module} and $WriteMakefileArgs{$mm_key}{$module} ne '0' and $WriteMakefileArgs{$mm_key}{$module} ne $version_or_range; warn "$module already exists in FallbackPrereqs (at version $WriteMakefileArgs{$mm_key}{$module}) -- need to do a sane metamerge!" if exists $FallbackPrereqs{$module} and $FallbackPrereqs{$module} ne '0' and $FallbackPrereqs{$module} ne $version_or_range; $WriteMakefileArgs{$mm_key}{$module} = $FallbackPrereqs{$module} = $version_or_range; return; } sub has_module { my ($module, $version_or_range) = @_; require Module::Metadata; my $mmd = Module::Metadata->new_from_module($module); return undef if not $mmd; return $mmd->version($module) if not defined $version_or_range; require CPAN::Meta::Requirements; my $req = CPAN::Meta::Requirements->new; $req->add_string_requirement($module => $version_or_range); return 1 if $req->accepts_module($module => $mmd->version($module)); return 0; } sub requires { goto &runtime_requires } sub runtime_requires { my ($module, $version_or_range) = @_; _add_prereq(PREREQ_PM => $module, $version_or_range); } TeX-Encode-2.004/META.json000644 000765 000024 00000041427 13217023067 014660 0ustar00a3fstaff000000 000000 { "abstract" : "Encode/decode Perl utf-8 strings into TeX", "author" : [ "Timothy D Brody ", "Ahmad Fatoum " ], "dynamic_config" : 1, "generated_by" : "Dist::Zilla version 6.010, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "TeX-Encode", "no_index" : { "directory" : [ "eg", "examples", "inc", "share", "t", "xt" ] }, "prereqs" : { "configure" : { "requires" : { "CPAN::Meta::Requirements" : "2.120620", "ExtUtils::MakeMaker" : "0", "Module::Metadata" : "0", "perl" : "5.008" } }, "develop" : { "requires" : { "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::MinimumVersion" : "0", "Test::More" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "0", "Test::Version" : "1", "blib" : "1.01", "warnings" : "0" } }, "runtime" : { "requires" : { "Carp" : "0", "Encode::Encoding" : "0.1", "HTML::Entities" : "1.27", "HTML::Parser" : "3.35", "Pod::LaTeX" : "0.56", "perl" : "5.008", "strict" : "0", "vars" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "Encode" : "0", "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::More" : "0.1", "blib" : "1.01", "perl" : "5.008", "utf8" : "0", "warnings" : "0" } } }, "provides" : { "TeX::Encode" : { "file" : "lib/TeX/Encode.pm", "version" : "2.004" }, "TeX::Encode::BibTeX" : { "file" : "lib/TeX/Encode/BibTeX.pm", "version" : "2.004" }, "TeX::Encode::charmap" : { "file" : "lib/TeX/Encode/charmap.pm", "version" : "2.004" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/athreef/TeX-Encode/issues" }, "homepage" : "https://github.com/athreef/TeX-Encode", "repository" : { "type" : "git", "url" : "https://github.com/athreef/TeX-Encode.git", "web" : "https://github.com/athreef/TeX-Encode" } }, "version" : "2.004", "x_Dist_Zilla" : { "perl" : { "version" : "5.026001" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." } }, "name" : "@Starter/GatherDir", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@Starter/PruneCruft", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@Starter/ManifestSkip", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Starter/MetaConfig", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : { "finder_objects" : [ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@Starter/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "6.010" } ], "include_underscores" : 0 }, "Dist::Zilla::Role::MetaProvider::Provider" : { "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002004", "inherit_missing" : 1, "inherit_version" : 1, "meta_noindex" : 1 }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000033", "version" : "0.004" } }, "name" : "@Starter/MetaProvides::Package", "version" : "2.004003" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "@Starter/MetaNoIndex", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Starter/MetaYAML", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Starter/MetaJSON", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Starter/License", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "@Starter/ReadmeAnyFromPod", "version" : "0.163250" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Starter/ExecDir", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@Starter/ShareDir", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Starter/PodSyntaxTests", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@Starter/Test::ReportPrereqs", "version" : "0.027" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : 0, "fail_on_warning" : "author", "fake_home" : 0, "filename" : "xt/author/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "develop", "script_finder" : [ ":PerlExecFiles" ], "skips" : [], "switch" : [] } }, "name" : "@Starter/Test::Compile", "version" : "2.056" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@Starter/MakeMaker", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Starter/Manifest", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Starter/TestRelease", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@Starter/RunExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Starter/ConfirmRelease", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Starter/UploadToCPAN", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "AutoPrereqs", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "requires" } }, "name" : "Prereqs", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "TestRequires", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::DynamicPrereqs", "config" : { "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000033", "version" : "0.004" } }, "name" : "DynamicPrereqs", "version" : "0.033" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "GithubMeta", "version" : "0.54" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.1", "repo_root" : "." } }, "name" : "@Git/Check", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "v%v%n%n%c" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.1", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Git/Commit", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "v2.004", "tag_format" : "v%v", "tag_message" : "v%v" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.1", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Git/Tag", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin" ], "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.1", "repo_root" : "." } }, "name" : "@Git/Push", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::ChangelogFromGit", "name" : "ChangelogFromGit", "version" : "0.016" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "config" : { "Dist::Zilla::Plugin::Git::NextVersion" : { "first_version" : "2.001", "version_by_branch" : 0, "version_regexp" : "(?^:^v(.+)$)" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.1", "repo_root" : "." } }, "name" : "Git::NextVersion", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::OurPkgVersion", "name" : "OurPkgVersion", "version" : "0.12" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "ReadmePodInRoot", "version" : "0.163250" }, { "class" : "Dist::Zilla::Plugin::MinimumPerl", "name" : "MinimumPerl", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", "name" : "Test::MinimumVersion", "version" : "2.000007" }, { "class" : "Dist::Zilla::Plugin::Test::Version", "name" : "Test::Version", "version" : "1.09" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : 0, "fail_on_warning" : "author", "fake_home" : 0, "filename" : "t/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "test", "script_finder" : [ ":PerlExecFiles" ], "skips" : [], "switch" : [] } }, "name" : "Test::Compile", "version" : "2.056" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@Starter/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "6.010" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.010" } }, "x_serialization_backend" : "Cpanel::JSON::XS version 3.0237" } TeX-Encode-2.004/debug/000755 000765 000024 00000000000 13217023067 014315 5ustar00a3fstaff000000 000000 TeX-Encode-2.004/dist.ini000644 000765 000024 00000001376 13217023067 014702 0ustar00a3fstaff000000 000000 name = TeX-Encode author = Timothy D Brody author = Ahmad Fatoum license = Perl_5 copyright_holder = Timothy D Brody copyright_year = 2005 [@Starter] [AutoPrereqs] [Prereqs] HTML::Entities = 1.27 HTML::Parser = 3.35 Pod::LaTeX = 0.56 [Prereqs / TestRequires] Test::More = 0.1 [DynamicPrereqs] -body = requires('Encode', '2.91') if (has_module('Encode') || 0) eq '2.90'; [GithubMeta] issues = 1 user = athreef [@Git] [ChangelogFromGit] [Git::NextVersion] first_version = 2.001 [OurPkgVersion] [ReadmeAnyFromPod / ReadmePodInRoot] type = pod filename = README.pod location = root ;[Git::CommitBuild] [MinimumPerl] [Test::MinimumVersion] max_target_perl = 5.8 [Test::Version] [Test::Compile] TeX-Encode-2.004/debug/debug.pl000755 000765 000024 00000001255 13217023067 015746 0ustar00a3fstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use lib 'lib'; use TeX::Encode; warn "Requires UTF-8 Support in Terminal (CTRL+C now to exit)!\n"; binmode(STDOUT,":utf8"); my @terms = split '\|', $TeX::Encode::LATEX_Math_mode_re; print "LATEX_Math_mode_re:\n", join("\n", map { join("\t", $_, ord($TeX::Encode::LATEX_Math_mode{$_}), $TeX::Encode::LATEX_Math_mode{$_}) } keys %TeX::Encode::LATEX_Math_mode), "\n"; print "LATEX_Escapes:\n", join("\n", map { join("\t", $_, sprintf("0x%x", ord($_)), $TeX::Encode::LATEX_Escapes{$_}, $TeX::Encode::LATEX_Escapes_inv{substr($TeX::Encode::LATEX_Escapes{$_},1)}||'') } sort { ord($a) <=> ord($b) } keys %TeX::Encode::LATEX_Escapes), "\n"; TeX-Encode-2.004/lib/TeX/000755 000765 000024 00000000000 13217023067 014475 5ustar00a3fstaff000000 000000 TeX-Encode-2.004/lib/TeX/Encode.pm000644 000765 000024 00000017072 13217023067 016237 0ustar00a3fstaff000000 000000 package TeX::Encode; use 5.008; use strict; #use AutoLoader qw(AUTOLOAD); use Encode::Encoding 0.1; use Carp; use TeX::Encode::charmap; use TeX::Encode::BibTeX; our @ISA = qw(Encode::Encoding); our $VERSION = '2.004'; # VERSION __PACKAGE__->Define(qw(LaTeX latex)); sub _bad_cp { return sprintf("Unsupported character code point 0x%04x\n", ord($_[0])); } sub encode { my( undef, $string, $check ) = @_; my $bad_cp = 0; # set up a "check" sub that will determine how we handle unsupported code # points $check = Encode::FB_DEFAULT if !defined $check; if( $check eq Encode::FB_DEFAULT ) { $check = sub { '?' }; } elsif( $check eq Encode::FB_CROAK ) { $check = sub { Carp::croak(&_bad_cp(@_)) }; } elsif( $check eq Encode::FB_QUIET ) { $check = sub { $bad_cp = 1; '' }; } elsif( $check eq Encode::FB_WARN ) { $check = sub { Carp::carp(&_bad_cp(@_)); $bad_cp = 1; '' }; } else { Carp::confess( "Unknown check argument: expected one of undef, FB_DEFAULT, FB_CROAK, FB_QUIET or FB_WARN" ); } my $tex = ""; pos($string) = 0; for($string) { while(!$bad_cp) { last if pos($_) == length($_); # escape reserved characters /\G($TeX::Encode::charmap::RESERVED_RE)/gc and ($tex .= $TeX::Encode::charmap::RESERVED{$1}, next); # escape all characters supported by tex if( /\G($TeX::Encode::charmap::CHAR_MAP_RE)/gc ) { $tex .= $TeX::Encode::charmap::CHAR_MAP{$1}; if( /\G[a-zA-Z_]/gc ) { --pos($_); $tex =~ /[a-zA-Z_]$/ and $tex .= '{}'; } next; } # basic unreserved characters /\G([\sa-zA-Z0-9\.,:;'"\(\)=\/]+)/gc and ($tex .= $1, next); # unsupported code point (may set $bad_cp) /\G(.)/gc and ($tex .= &$check(ord($1)), next); Carp::confess "Shouldn't happen"; } } if( $bad_cp ) { $_[1] = substr($string,pos($string)-1); } return $tex; } # decode($octets [,$check]) sub decode { my( undef, $tex, $check ) = @_; pos($tex) = 0; my $str = ""; while(pos($tex) < length($tex)) { $str .= _decode( $tex, $check ); } return $str; } sub _decode { my $str = Encode::decode_utf8( "" ); for($_[0]) { /\G\%([^\n]+\n)?/gc and next; # comment # not sure about this: # /\G\\ensuremath/gc and ($str .= _decode_mathmode(_decode_bracket($_)), next); # mathmode /\G\$/gc and ($str .= _decode_mathmode($_), next); # mathmode /\G($TeX::Encode::charmap::MACROS_RE)/gc and ($str .= $TeX::Encode::charmap::MACROS{$1}, next); # macro /\G\\(.)/gc and ($str .= _decode_macro($1,$_), next); # unknown macro /\G\{/gc and ($str .= _decode_brace($_), next); # {foo} /\G\[/gc and ($str .= _decode_bracket($_), next); # [foo] /\G_/gc and ($str .= _subscript(&_decode), next); # _ (subscript) /\G\^/gc and ($str .= _superscript(&_decode), next); # ^ (superscript) /\G([^_\^\%\$\\\{\[ \t\n\r]+)/gc and $str .= $1, next; /\G([ \t\n\r])+/gc and $str .= $1, next; Carp::confess "Shouldn't happen: ".substr($_,0,10)." ...".substr($_,pos($_),10)." [".pos($_)."/".length($_)."]"; } return $str; } sub _subscript { my( $tex ) = @_; return $tex if $tex =~ /[^0-9+\-]/; return _subscript_digits( $tex ); } sub _superscript { my( $tex ) = @_; return $tex if $tex =~ /[^0-9+\-]/; return _superscript_digits( $tex ); } my %SUBSCRIPTS = ( '+' => chr(0x208a), '-' => chr(0x208b), ); $SUBSCRIPTS{''.$_} = chr(0x2080+$_) for 0..9; sub _subscript_digits { my( $tex ) = @_; $tex =~ s/(.)/$SUBSCRIPTS{$1}/g; return $tex; } my %SUPERSCRIPTS = ( '0' => chr(0x2070), '1' => chr(0xb9), '2' => chr(0xb2), '3' => chr(0xb3), '4' => chr(0x2074), '5' => chr(0x2075), '6' => chr(0x2076), '7' => chr(0x2077), '8' => chr(0x2078), '9' => chr(0x2079), '+' => chr(0x207a), '-' => chr(0x207b), ); sub _superscript_digits { my( $tex ) = @_; $tex =~ s/(.)/$SUPERSCRIPTS{$1}/g; return $tex; } sub perlio_ok { 0 } sub _decode_mathmode { my $str = ""; for($_[0]) { while(1) { last if pos($_) == length($_); /\G(\\.)/gc and ($str .= $1, next); /\G\$/gc and last; /\G($TeX::Encode::charmap::MATH_CHARS_RE)/gc and ($str .= $TeX::Encode::charmap::MATH_CHARS{$1}, next); /\G([^\\\$]+)/gc and ($str .= $1, next); Carp::confess "Shouldn't happen"; } } return decode(undef, $str); } # try again to expand a macro sub _decode_macro { my( $c ) = @_; my $str = "\\$c"; for($_[1]) { # expand \'{e} to \'e /\G\{/ and ($str .= _decode_brace( $_ ), next); last; } return $TeX::Encode::charmap::MACROS{$str} || $str; } sub _decode_bracket { my $str = ""; my $depth = 1; for($_[0]) { while(1) { last if pos($_) == length($_) or $depth == 0; /\G(\\.)/gc and ($str .= $1, next); /\G\[/gc and (--$depth, next); /\G\]/gc and (++$depth, next); /\G([^\\\[\]]+)/gc and ($str .= $1, next); Carp::confess "Shouldn't happen"; } } return $str; } sub _decode_brace { my $str = ""; my $depth = 1; for($_[0]) { while(1) { last if pos($_) == length($_) or $depth == 0; /\G(\\.)/gc and ($str .= $1, next); /\G\}/gc and ($str .= '}', --$depth, next); /\G\{/gc and ($str .= '{', ++$depth, next); /\G([^\\\{\}]+)/gc and ($str .= $1, next); Carp::confess "Shouldn't happen"; } } chop($str); # remove trailing '}' return decode(undef, $str); } 1; __END__ =head1 NAME TeX::Encode - Encode/decode Perl utf-8 strings into TeX =head1 SYNOPSIS use TeX::Encode; use Encode; $tex = encode('latex', "This will encode an e-acute (".chr(0xe9).") as \'e"); $str = decode('latex', $tex); # Will decode the \'e too! =head1 DESCRIPTION This module provides encoding to LaTeX escapes from utf8 using mapping tables in L and L. This covers only a subset of the Unicode character table (undef warnings will occur for non-mapped chars). This module is intentionally vague about what it will handle, see Caveats below. Mileage will vary when decoding (converting TeX to utf8), as TeX is in essence a programming language, and this module does not implement TeX. I use this module to encode author names in BibTeX and to do a rough job at presenting LaTeX abstracts in HTML. Using decode rather than seeing $\sqrt{\Omega^2\zeta_n}$ you get something that looks like the formula. The next logical step for this module is to integrate some level of TeX grammar to improve the decoding, in particular to handle fractions and font changes (which should probably be dropped). =head1 METHODS =over 4 =item TeX::Encode::encode STRING [, CHECK] Encodes a utf8 string into TeX. CHECK isn't implemented. =item TeX::Encode::decode STRING [, CHECK] Decodes a TeX string into utf8. CHECK isn't implemented. =item TeX::Encode::perlio_ok Returns 0. PerlIO isn't implemented. =back =head1 CAVEATS Proper Encode checking is not implemented. LaTeX comments (% ...) are ignored because chopping a lot of text may not be what you actually want. =head2 encode() Converts non-ASCII Unicode characters to their equivalent TeX symbols (unTeXable characters will result in undef warnings). =head2 decode() Attempts to convert TeX symbols (e.g. \ae) to Unicode characters. As an experimental feature this also handles Math-mode TeX by inserting HTML into the resulting string (so you end up with an HTML approximation of the maths - NOT MathML). =head1 SEE ALSO L, L, L =head1 AUTHOR =over 4 =item * Timothy D Brody, Etdb01r@ecs.soton.ac.ukE =item * Ahmad Fatoum C<< >>, L =back =head1 COPYRIGHT AND LICENSE Copyright (C) 2005-2007 by Timothy D Brody This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available. =cut TeX-Encode-2.004/lib/TeX/Encode/000755 000765 000024 00000000000 13217023067 015672 5ustar00a3fstaff000000 000000 TeX-Encode-2.004/lib/TeX/Encode/BibTeX.pm000644 000765 000024 00000007673 13217023067 017362 0ustar00a3fstaff000000 000000 package TeX::Encode::BibTeX; our $VERSION = '2.004'; # VERSION use 5.008; use strict; #use AutoLoader qw(AUTOLOAD); use TeX::Encode; our @ISA = qw(Encode::Encoding); __PACKAGE__->Define(qw(BibTeX bibtex)); # encode($self, $string [,$check]) sub encode { my( undef, $string, $check ) = @_; my $tex = ""; pos($string) = 0; for($string) { while(1) { last if pos($_) == length($_); /\G($TeX::Encode::charmap::BIBTEX_RESERVED_RE)/gc and ($tex .= $TeX::Encode::charmap::BIBTEX_RESERVED{$1}, next); # BibTeX requires extra braces around any LaTeX mark-up # (we assume anything we substitute with will be BibTeX-safe) /\G($TeX::Encode::charmap::CHAR_MAP_RE)/gc and ($tex .= '{'.$TeX::Encode::charmap::CHAR_MAP{$1}.'}', next); # basic unreserved characters /\G([\sa-zA-Z0-9\.,:;'"\(\)=\-\/\[\]\*\+]+)/gc and ($tex .= $1, next); /\G([\x00-\x7e])/gc and ($tex .= $1, next); /\G(.)/gc and ($tex .= '?', next); Carp::confess "Shouldn't happen"; } } return $tex; } # encode_url($self, $string [,$check]) sub encode_url { my( undef, $str, $check ) = @_; # replace braces/slash (URL???) and underscore with their URI escape points $str =~ s/([\{\}\\_])/sprintf("%%%02x",ord($1))/seg; $str =~ s/(%)/$TeX::Encode::charmap::BIBTEX_RESERVED{$1}/sg; return $str; } # decode($octets [,$check]) sub decode { return &TeX::Encode::decode; } sub perlio_ok { 0 } # Autoload methods go after =cut, and are processed by the autosplit program. 1; __END__ =head1 NAME TeX::Encode::BibTeX - Encode/decode Perl utf-8 strings into BibTeX =head1 SYNOPSIS use TeX::Encode; use Encode; $tex = encode('bibtex', "This will encode an e-acute (".chr(0xe9).") as \'e"); $str = decode('bibtex', $tex); # Will decode the \'e too! =head1 DESCRIPTION This module provides encoding to LaTeX escapes from utf8 using mapping tables in L and L. This covers only a subset of the Unicode character table (undef warnings will occur for non-mapped chars). This module is intentionally vague about what it will handle, see Caveats below. Mileage will vary when decoding (converting TeX to utf8), as TeX is in essence a programming language, and this module does not implement TeX. I use this module to encode author names in BibTeX and to do a rough job at presenting LaTeX abstracts in HTML. Using decode rather than seeing $\sqrt{\Omega^2\zeta_n}$ you get something that looks like the formula. The next logical step for this module is to integrate some level of TeX grammar to improve the decoding, in particular to handle fractions and font changes (which should probably be dropped). =head1 METHODS =over 4 =item TeX::Encode::BibTeX::encode STRING [, CHECK] Encodes a utf8 string into TeX. CHECK isn't implemented. =item TeX::Encode::BibTeX::encode_url STRING Make a URL safe for inclusion in BibTeX. =item TeX::Encode::BibTeX::decode STRING [, CHECK] Decodes a TeX string into utf8. CHECK isn't implemented. =item TeX::Encode::perlio_ok Returns 0. PerlIO isn't implemented. =back =head1 CAVEATS Proper Encode checking is not implemented. LaTeX comments (% ...) are ignored because chopping a lot of text may not be what you actually want. =head2 encode() Converts non-ASCII Unicode characters to their equivalent TeX symbols (unTeXable characters will result in undef warnings). =head2 decode() Attempts to convert TeX symbols (e.g. \ae) to Unicode characters. As an experimental feature this also handles Math-mode TeX by inserting HTML into the resulting string (so you end up with an HTML approximation of the maths - NOT MathML). =head1 SEE ALSO L, L, L =head1 AUTHOR Timothy D Brody, Etdb01r@ecs.soton.ac.ukE =head1 COPYRIGHT AND LICENSE Copyright (C) 2005-2007 by Timothy D Brody This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available. =cut TeX-Encode-2.004/lib/TeX/Encode/charmap.pm000644 000765 000024 00000107013 13217023067 017645 0ustar00a3fstaff000000 000000 package TeX::Encode::charmap; our $VERSION = '2.004'; # VERSION =head1 NAME TeX::Encode::charmap - Character mappings between TeX and Unicode =head1 DESCRIPTION Most of the mapping was built from Tralics, see http://www-sop.inria.fr/apics/tralics/ A part was built from Clark Grubb's L. =begin comment latex-input is avilable under following terms: Copyright (C) 2014 Clark Grubb Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. =end comment =cut use vars qw( %RESERVED %BIBTEX_RESERVED %CHARS %ACCENTED_CHARS %LATEX_MACROS %GREEK %TEX_GREEK %MATH %MATH_CHARS %ASTRONOMY %GAMES %KEYS %IPA ); # reserved latex characters %RESERVED = ( '#' => '\\#', '$' => '\\$', '%' => '\\%', '&' => '\\&', '_' => '\\_', '{' => '\\{', '}' => '\\}', '\\' => '\\texttt{\\char92}', '^' => '\^{ }', # '\\texttt{\\char94}', '~' => '\\texttt{\\char126}', ); %BIBTEX_RESERVED = ( '#' => '\\#', '$' => '\\$', '%' => '\\%', '&' => '\\&', '_' => '\\_', '{' => '\\{', '}' => '\\}', '\\' => '{$\\backslash$}', '^' => '{\^{ }}', '~' => '{\\texttt{\\char126}}', ); # single, non-ligature characters %CHARS = ( # ASCII characters '<' => "\\ensuremath{<}", '>' => "\\ensuremath{>}", '|' => "\\ensuremath{|}", '[' => '{[}', # opening argument(s) ']' => '{]}', # closing argument(s) chr(0x2014) => "--", # emdash # non-accented chr(0x00a3) => '\\pounds', # £ chr(0x00a7) => '\\S', # § chr(0x00a9) => '\\copyright', chr(0x00b6) => '\\P', # ¶ chr(0x00c5) => '\\AA', # Å chr(0x00c6) => '\\AE', # Æ chr(0x00d0) => '\\DH', # Ð chr(0x00d8) => '\\O', # Ø chr(0x00de) => '\\TH', # Þ chr(0x00df) => '\\ss', # ß chr(0x00e5) => '\\aa', # å chr(0x00e6) => '\\ae', # æ chr(0x00f0) => '\\dh', # ð chr(0x00f8) => '\\o', # ø chr(0x00fe) => '\\th', # þ chr(0x0110) => '\\DJ', # Đ chr(0x0111) => '\\dj', # đ chr(0x0132) => '\\IJ', # IJ chr(0x0133) => '\\ij', # ij chr(0x0141) => '\\L', # Ł chr(0x0142) => '\\l', # ł chr(0x014a) => '\\NG', # Ŋ chr(0x014b) => '\\ng', # ŋ chr(0x0152) => '\\OE', # Œ chr(0x0153) => '\\oe', # œ # superscript/subscript (maths) chr(0x2070) => '$^0$', chr(0x2071) => '$^i$', chr(0x2074) => '$^4$', chr(0x2075) => '$^5$', chr(0x2076) => '$^6$', chr(0x2077) => '$^7$', chr(0x2078) => '$^8$', chr(0x2079) => '$^9$', chr(0x207A) => '$^+$', chr(0x207B) => '$^-$', chr(0x207C) => '$^=$', chr(0x207D) => '$^($', chr(0x207E) => '$^)$', chr(0x207F) => '$^n$', chr(0x2080) => '$_0$', chr(0x2081) => '$_1$', chr(0x2082) => '$_2$', chr(0x2083) => '$_3$', chr(0x2084) => '$_4$', chr(0x2085) => '$_5$', chr(0x2086) => '$_6$', chr(0x2087) => '$_7$', chr(0x2088) => '$_8$', chr(0x2089) => '$_9$', chr(0x208A) => '$_+$', chr(0x208B) => '$_-$', chr(0x208C) => '$_=$', chr(0x208D) => '$_($', chr(0x208E) => '$_)$', chr(0x1D43) => '^a', # ᵃ chr(0x2090) => '_a', # ₐ chr(0x1D47) => '^b', # ᵇ chr(0x1D9C) => '^c', # ᶜ chr(0x1D2C) => '^A', # ᴬ chr(0x1D2E) => '^B', # ᴮ chr(0x1D45) => '^\alpha', # ᵅ chr(0x1D5D) => '^\beta', # ᵝ chr(0x1D66) => '_\beta', # ᵦ chr(0x1D5E) => '^\gamma', # ᵞ chr(0x1D67) => '_\gamma', # ᵧ ); # accented characters %ACCENTED_CHARS = ( ### Æ chr(0x01fc) => "\\\'{\\AE}", # Ǽ chr(0x01e2) => "\\\={\\AE}", # Ǣ ### æ chr(0x01fd) => "\\\'{\\ae}", # ǽ chr(0x01e3) => "\\\={\\ae}", # ǣ ### Å chr(0x01fa) => "\\\'{\\AA}", # Ǻ ### å chr(0x01fb) => "\\\'{\\aa}", # ǻ ### Ø chr(0x01fe) => "\\\'{\\O}", # Ǿ ### ø chr(0x01ff) => "\\\'{\\o}", # ǿ ###  ###  ### A chr(0x00c1) => "\\\'A", # Á chr(0x00c0) => "\\\`A", # À chr(0x00c2) => "\\\^A", #  chr(0x00c4) => "\\\"A", # Ä chr(0x00c3) => "\\\~A", # à chr(0x0104) => "\\kA", # Ą chr(0x01cd) => "\\vA", # Ǎ chr(0x0102) => "\\uA", # Ă chr(0x0226) => "\\\.A", # Ȧ chr(0x0100) => "\\\=A", # Ā chr(0x00c5) => "\\rA", # Å chr(0x1ea0) => "\\dA", # Ạ chr(0x0200) => "\\CA", # Ȁ chr(0x0202) => "\\fA", # Ȃ chr(0x1e00) => "\\DA", # Ḁ chr(0x1ea2) => "\\hA", # Ả ### B chr(0x1e02) => "\\\.B", # Ḃ chr(0x1e06) => "\\bB", # Ḇ chr(0x1e04) => "\\dB", # Ḅ ### C chr(0x0106) => "\\\'C", # Ć chr(0x0108) => "\\\^C", # Ĉ chr(0x010c) => "\\vC", # Č chr(0x00c7) => "\\cC", # Ç chr(0x010a) => "\\\.C", # Ċ ### D chr(0x010e) => "\\vD", # Ď chr(0x1e10) => "\\cD", # Ḑ chr(0x1e0a) => "\\\.D", # Ḋ chr(0x1e0e) => "\\bD", # Ḏ chr(0x1e0c) => "\\dD", # Ḍ chr(0x1e12) => "\\VD", # Ḓ ### E chr(0x00c9) => "\\\'E", # É chr(0x00c8) => "\\\`E", # È chr(0x00ca) => "\\\^E", # Ê chr(0x00cb) => "\\\"E", # Ë chr(0x1ebc) => "\\\~E", # Ẽ chr(0x0118) => "\\kE", # Ę chr(0x011a) => "\\vE", # Ě chr(0x0114) => "\\uE", # Ĕ chr(0x0228) => "\\cE", # Ȩ chr(0x0116) => "\\\.E", # Ė chr(0x0112) => "\\\=E", # Ē chr(0x1eb8) => "\\dE", # Ẹ chr(0x0204) => "\\CE", # Ȅ chr(0x0206) => "\\fE", # Ȇ chr(0x1e1a) => "\\TE", # Ḛ chr(0x1e18) => "\\VE", # Ḙ chr(0x1eba) => "\\hE", # Ẻ ### F chr(0x1e1e) => "\\\.F", # Ḟ ### G chr(0x01f4) => "\\\'G", # Ǵ chr(0x011c) => "\\\^G", # Ĝ chr(0x01e6) => "\\vG", # Ǧ chr(0x011e) => "\\uG", # Ğ chr(0x0122) => "\\cG", # Ģ chr(0x0120) => "\\\.G", # Ġ chr(0x1e20) => "\\\=G", # Ḡ ### H chr(0x0124) => "\\\^H", # Ĥ chr(0x1e26) => "\\\"H", # Ḧ chr(0x021e) => "\\vH", # Ȟ chr(0x1e28) => "\\cH", # Ḩ chr(0x1e22) => "\\\.H", # Ḣ chr(0x0126) => "\\\=H", # Ħ chr(0x1e24) => "\\dH", # Ḥ ### I chr(0x00cd) => "\\\'I", # Í chr(0x00cc) => "\\\`I", # Ì chr(0x00ce) => "\\\^I", # Î chr(0x00cf) => "\\\"I", # Ï chr(0x0128) => "\\\~I", # Ĩ chr(0x012e) => "\\kI", # Į chr(0x01cf) => "\\vI", # Ǐ chr(0x012c) => "\\uI", # Ĭ chr(0x0130) => "\\\.I", # İ chr(0x012a) => "\\\=I", # Ī chr(0x1eca) => "\\dI", # Ị chr(0x0208) => "\\CI", # Ȉ chr(0x020a) => "\\fI", # Ȋ chr(0x1e2c) => "\\TI", # Ḭ chr(0x1ec8) => "\\hI", # Ỉ ### J chr(0x0134) => "\\\^J", # Ĵ ### K chr(0x1e30) => "\\\'K", # Ḱ chr(0x01e8) => "\\vK", # Ǩ chr(0x0136) => "\\cK", # Ķ chr(0x1e34) => "\\bK", # Ḵ chr(0x1e32) => "\\dK", # Ḳ ### L chr(0x0139) => "\\\'L", # Ĺ chr(0x013d) => "\\vL", # Ľ chr(0x013b) => "\\cL", # Ļ chr(0x013f) => "\\\.L", # Ŀ chr(0x1e3a) => "\\bL", # Ḻ chr(0x1e36) => "\\dL", # Ḷ chr(0x1e3c) => "\\VL", # Ḽ ### M chr(0x1e3e) => "\\\'M", # Ḿ chr(0x1e40) => "\\\.M", # Ṁ chr(0x1e42) => "\\dM", # Ṃ ### N chr(0x0143) => "\\\'N", # Ń chr(0x01f8) => "\\\`N", # Ǹ chr(0x00d1) => "\\\~N", # Ñ chr(0x0147) => "\\vN", # Ň chr(0x0145) => "\\cN", # Ņ chr(0x1e44) => "\\\.N", # Ṅ chr(0x1e48) => "\\bN", # Ṉ chr(0x1e46) => "\\dN", # Ṇ chr(0x1e4a) => "\\VN", # Ṋ ### O chr(0x00d3) => "\\\'O", # Ó chr(0x00d2) => "\\\`O", # Ò chr(0x00d4) => "\\\^O", # Ô chr(0x00d6) => "\\\"O", # Ö chr(0x00d5) => "\\\~O", # Õ chr(0x01ea) => "\\kO", # Ǫ chr(0x0150) => "\\HO", # Ő chr(0x01d1) => "\\vO", # Ǒ chr(0x014e) => "\\uO", # Ŏ chr(0x022e) => "\\\.O", # Ȯ chr(0x014c) => "\\\=O", # Ō chr(0x1ecc) => "\\dO", # Ọ chr(0x020c) => "\\CO", # Ȍ chr(0x020e) => "\\fO", # Ȏ chr(0x1ece) => "\\hO", # Ỏ ### P chr(0x1e54) => "\\\'P", # Ṕ chr(0x1e56) => "\\\.P", # Ṗ ### Q ### R chr(0x0154) => "\\\'R", # Ŕ chr(0x0158) => "\\vR", # Ř chr(0x0156) => "\\cR", # Ŗ chr(0x1e58) => "\\\.R", # Ṙ chr(0x1e5e) => "\\bR", # Ṟ chr(0x1e5a) => "\\dR", # Ṛ chr(0x0210) => "\\CR", # Ȑ chr(0x0212) => "\\fR", # Ȓ ### S chr(0x015a) => "\\\'S", # Ś chr(0x015c) => "\\\^S", # Ŝ chr(0x0160) => "\\vS", # Š chr(0x015e) => "\\cS", # Ş chr(0x1e60) => "\\\.S", # Ṡ chr(0x1e62) => "\\dS", # Ṣ ### T chr(0x0164) => "\\vT", # Ť chr(0x0162) => "\\cT", # Ţ chr(0x1e6a) => "\\\.T", # Ṫ chr(0x0166) => "\\\=T", # Ŧ chr(0x1e6e) => "\\bT", # Ṯ chr(0x1e6c) => "\\dT", # Ṭ chr(0x1e70) => "\\VT", # Ṱ ### U chr(0x00da) => "\\\'U", # Ú chr(0x00d9) => "\\\`U", # Ù chr(0x00db) => "\\\^U", # Û chr(0x00dc) => "\\\"U", # Ü chr(0x0168) => "\\\~U", # Ũ chr(0x0172) => "\\kU", # Ų chr(0x0170) => "\\HU", # Ű chr(0x01d3) => "\\vU", # Ǔ chr(0x016c) => "\\uU", # Ŭ chr(0x016a) => "\\\=U", # Ū chr(0x016e) => "\\rU", # Ů chr(0x1ee4) => "\\dU", # Ụ chr(0x0214) => "\\CU", # Ȕ chr(0x0216) => "\\fU", # Ȗ chr(0x1e74) => "\\TU", # Ṵ chr(0x1e76) => "\\VU", # Ṷ chr(0x1ee6) => "\\hU", # Ủ ### V chr(0x1e7c) => "\\\~V", # Ṽ chr(0x1e7e) => "\\dV", # Ṿ ### W chr(0x1e82) => "\\\'W", # Ẃ chr(0x1e80) => "\\\`W", # Ẁ chr(0x0174) => "\\\^W", # Ŵ chr(0x1e84) => "\\\"W", # Ẅ chr(0x1e86) => "\\\.W", # Ẇ chr(0x1e88) => "\\dW", # Ẉ ### X chr(0x1e8c) => "\\\"X", # Ẍ chr(0x1e8a) => "\\\.X", # Ẋ ### Y chr(0x00dd) => "\\\'Y", # Ý chr(0x1ef2) => "\\\`Y", # Ỳ chr(0x0176) => "\\\^Y", # Ŷ chr(0x0178) => "\\\"Y", # Ÿ chr(0x1ef8) => "\\\~Y", # Ỹ chr(0x1e8e) => "\\\.Y", # Ẏ chr(0x0232) => "\\\=Y", # Ȳ chr(0x1ef4) => "\\dY", # Ỵ chr(0x1ef6) => "\\hY", # Ỷ ### Z chr(0x0179) => "\\\'Z", # Ź chr(0x1e90) => "\\\^Z", # Ẑ chr(0x017d) => "\\vZ", # Ž chr(0x017b) => "\\\.Z", # Ż chr(0x1e94) => "\\bZ", # Ẕ chr(0x1e92) => "\\dZ", # Ẓ ### [ ### \ ### ] ### ^ ### _ ### ` ### a chr(0x00e1) => "\\\'a", # á chr(0x00e0) => "\\\`a", # à chr(0x00e2) => "\\\^a", # â chr(0x00e4) => "\\\"a", # ä chr(0x00e3) => "\\\~a", # ã chr(0x0105) => "\\ka", # ą chr(0x01ce) => "\\va", # ǎ chr(0x0103) => "\\ua", # ă chr(0x0227) => "\\\.a", # ȧ chr(0x0101) => "\\\=a", # ā chr(0x00e5) => "\\ra", # å chr(0x1ea1) => "\\da", # ạ chr(0x0201) => "\\Ca", # ȁ chr(0x0203) => "\\fa", # ȃ chr(0x1e01) => "\\Da", # ḁ chr(0x1ea3) => "\\ha", # ả ### b chr(0x1e03) => "\\\.b", # ḃ chr(0x1e07) => "\\bb", # ḇ chr(0x1e05) => "\\db", # ḅ ### c chr(0x0107) => "\\\'c", # ć chr(0x0109) => "\\\^c", # ĉ chr(0x010d) => "\\vc", # č chr(0x00e7) => "\\cc", # ç chr(0x010b) => "\\\.c", # ċ ### d chr(0x010f) => "\\vd", # ď chr(0x1e11) => "\\cd", # ḑ chr(0x1e0b) => "\\\.d", # ḋ chr(0x1e0f) => "\\bd", # ḏ chr(0x1e0d) => "\\dd", # ḍ chr(0x1e13) => "\\Vd", # ḓ ### e chr(0x00e9) => "\\\'e", # é chr(0x00e8) => "\\\`e", # è chr(0x00ea) => "\\\^e", # ê chr(0x00eb) => "\\\"e", # ë chr(0x1ebd) => "\\\~e", # ẽ chr(0x0119) => "\\ke", # ę chr(0x011b) => "\\ve", # ě chr(0x0115) => "\\ue", # ĕ chr(0x0229) => "\\ce", # ȩ chr(0x0117) => "\\\.e", # ė chr(0x0113) => "\\\=e", # ē chr(0x1eb9) => "\\de", # ẹ chr(0x0205) => "\\Ce", # ȅ chr(0x0207) => "\\fe", # ȇ chr(0x1e1b) => "\\Te", # ḛ chr(0x1e19) => "\\Ve", # ḙ chr(0x1ebb) => "\\he", # ẻ ### f chr(0x1e1f) => "\\\.f", # ḟ ### g chr(0x01f5) => "\\\'g", # ǵ chr(0x011d) => "\\\^g", # ĝ chr(0x01e7) => "\\vg", # ǧ chr(0x011f) => "\\ug", # ğ chr(0x0123) => "\\cg", # ģ chr(0x0121) => "\\\.g", # ġ chr(0x1e21) => "\\\=g", # ḡ ### h chr(0x0125) => "\\\^h", # ĥ chr(0x1e27) => "\\\"h", # ḧ chr(0x021f) => "\\vh", # ȟ chr(0x1e29) => "\\ch", # ḩ chr(0x1e23) => "\\\.h", # ḣ chr(0x0127) => "\\\=h", # ħ chr(0x1e96) => "\\bh", # ẖ chr(0x1e25) => "\\dh", # ḥ ### i chr(0x00ed) => "\\\'i", # í chr(0x00ec) => "\\\`i", # ì chr(0x00ee) => "\\\^i", # î chr(0x00ef) => "\\\"i", # ï chr(0x0129) => "\\\~i", # ĩ chr(0x012f) => "\\ki", # į chr(0x01d0) => "\\vi", # ǐ chr(0x012d) => "\\ui", # ĭ chr(0x012b) => "\\\=i", # ī chr(0x1ecb) => "\\di", # ị chr(0x0209) => "\\Ci", # ȉ chr(0x020b) => "\\fi", # ȋ chr(0x1e2d) => "\\Ti", # ḭ chr(0x1ec9) => "\\hi", # ỉ ### j chr(0x0135) => "\\\^j", # ĵ chr(0x01f0) => "\\vj", # ǰ ### k chr(0x1e31) => "\\\'k", # ḱ chr(0x01e9) => "\\vk", # ǩ chr(0x0137) => "\\ck", # ķ chr(0x1e35) => "\\bk", # ḵ chr(0x1e33) => "\\dk", # ḳ ### l chr(0x013a) => "\\\'l", # ĺ chr(0x013e) => "\\vl", # ľ chr(0x013c) => "\\cl", # ļ chr(0x0140) => "\\\.l", # ŀ chr(0x1e3b) => "\\bl", # ḻ chr(0x1e37) => "\\dl", # ḷ chr(0x1e3d) => "\\Vl", # ḽ ### m chr(0x1e3f) => "\\\'m", # ḿ chr(0x1e41) => "\\\.m", # ṁ chr(0x1e43) => "\\dm", # ṃ ### n chr(0x0144) => "\\\'n", # ń chr(0x01f9) => "\\\`n", # ǹ chr(0x00f1) => "\\\~n", # ñ chr(0x0148) => "\\vn", # ň chr(0x0146) => "\\cn", # ņ chr(0x1e45) => "\\\.n", # ṅ chr(0x1e49) => "\\bn", # ṉ chr(0x1e47) => "\\dn", # ṇ chr(0x1e4b) => "\\Vn", # ṋ ### o chr(0x00f3) => "\\\'o", # ó chr(0x00f2) => "\\\`o", # ò chr(0x00f4) => "\\\^o", # ô chr(0x00f6) => "\\\"o", # ö chr(0x00f5) => "\\\~o", # õ chr(0x01eb) => "\\ko", # ǫ chr(0x0151) => "\\Ho", # ő chr(0x01d2) => "\\vo", # ǒ chr(0x014f) => "\\uo", # ŏ chr(0x022f) => "\\\.o", # ȯ chr(0x014d) => "\\\=o", # ō chr(0x1ecd) => "\\do", # ọ chr(0x020d) => "\\Co", # ȍ chr(0x020f) => "\\fo", # ȏ chr(0x1ecf) => "\\ho", # ỏ ### p chr(0x1e55) => "\\\'p", # ṕ chr(0x1e57) => "\\\.p", # ṗ ### q ### r chr(0x0155) => "\\\'r", # ŕ chr(0x0159) => "\\vr", # ř chr(0x0157) => "\\cr", # ŗ chr(0x1e59) => "\\\.r", # ṙ chr(0x1e5f) => "\\br", # ṟ chr(0x1e5b) => "\\dr", # ṛ chr(0x0211) => "\\Cr", # ȑ chr(0x0213) => "\\fr", # ȓ ### s chr(0x015b) => "\\\'s", # ś chr(0x015d) => "\\\^s", # ŝ chr(0x0161) => "\\vs", # š chr(0x015f) => "\\cs", # ş chr(0x1e61) => "\\\.s", # ṡ chr(0x1e63) => "\\ds", # ṣ ### t chr(0x1e97) => "\\\"t", # ẗ chr(0x0165) => "\\vt", # ť chr(0x0163) => "\\ct", # ţ chr(0x1e6b) => "\\\.t", # ṫ chr(0x0167) => "\\\=t", # ŧ chr(0x1e6f) => "\\bt", # ṯ chr(0x1e6d) => "\\dt", # ṭ chr(0x1e71) => "\\Vt", # ṱ ### u chr(0x00fa) => "\\\'u", # ú chr(0x00f9) => "\\\`u", # ù chr(0x00fb) => "\\\^u", # û chr(0x00fc) => "\\\"u", # ü chr(0x0169) => "\\\~u", # ũ chr(0x0173) => "\\ku", # ų chr(0x0171) => "\\Hu", # ű chr(0x01d4) => "\\vu", # ǔ chr(0x016d) => "\\uu", # ŭ chr(0x016b) => "\\\=u", # ū chr(0x016f) => "\\ru", # ů chr(0x1ee5) => "\\du", # ụ chr(0x0215) => "\\Cu", # ȕ chr(0x0217) => "\\fu", # ȗ chr(0x1e75) => "\\Tu", # ṵ chr(0x1e77) => "\\Vu", # ṷ chr(0x1ee7) => "\\hu", # ủ ### v chr(0x1e7d) => "\\\~v", # ṽ chr(0x1e7f) => "\\dv", # ṿ ### w chr(0x1e83) => "\\\'w", # ẃ chr(0x1e81) => "\\\`w", # ẁ chr(0x0175) => "\\\^w", # ŵ chr(0x1e85) => "\\\"w", # ẅ chr(0x1e87) => "\\\.w", # ẇ chr(0x1e98) => "\\rw", # ẘ chr(0x1e89) => "\\dw", # ẉ ### x chr(0x1e8d) => "\\\"x", # ẍ chr(0x1e8b) => "\\\.x", # ẋ ### y chr(0x00fd) => "\\\'y", # ý chr(0x1ef3) => "\\\`y", # ỳ chr(0x0177) => "\\\^y", # ŷ chr(0x00ff) => "\\\"y", # ÿ chr(0x1ef9) => "\\\~y", # ỹ chr(0x1e8f) => "\\\.y", # ẏ chr(0x0233) => "\\\=y", # ȳ chr(0x1e99) => "\\ry", # ẙ chr(0x1ef5) => "\\dy", # ỵ chr(0x1ef7) => "\\hy", # ỷ ### z chr(0x017a) => "\\\'z", # ź chr(0x1e91) => "\\\^z", # ẑ chr(0x017e) => "\\vz", # ž chr(0x017c) => "\\\.z", # ż chr(0x1e95) => "\\bz", # ẕ chr(0x1e93) => "\\dz", # ẓ ); # latex character references %LATEX_MACROS = ( "\\\\" => "\n", "\\char92" => '\\', "\\char94" => '^', "\\char126" => '~', "--" => chr(0x2014), # -- "\\acute{e}" => chr(0x00e9), # é "\\textunderscore" => chr(0x005f), # _ "\\textbraceleft" => chr(0x007b), # { "\\textbraceright" => chr(0x007d), # } "\\textasciitilde" => chr(0x007e), # ~ "\\textexclamdown" => chr(0x00a1), # ¡ "\\textcent" => chr(0x00a2), # ¢ "\\textsterling" => chr(0x00a3), # £ "\\textcurrency" => chr(0x00a4), # ¤ "\\textyen" => chr(0x00a5), # ¥ "\\textbrokenbar" => chr(0x00a6), # ¦ "\\textsection" => chr(0x00a7), # § "\\textasciidieresis" => chr(0x00a8), # ¨ "\\copyright" => chr(0x00a9), # © "\\textcopyright" => chr(0x00a9), # © "\\textordfeminine" => chr(0x00aa), # ª "\\guillemotleft" => chr(0x00ab), # « "\\textlnot" => chr(0x00ac), # ¬ "\\textsofthyphen" => chr(0x00ad), # ­ "\\textregistered" => chr(0x00ae), # ® "\\textasciimacron" => chr(0x00af), # ¯ "\\textdegree" => chr(0x00b0), # ° "\\textpm" => chr(0x00b1), # ± "\\texttwosuperior" => chr(0x00b2), # ² "\\textthreesuperior" => chr(0x00b3), # ³ "\\apostrophe" => chr(0x00b4), # ´ "\\textasciiacute" => chr(0x00b4), # ´ "\\textmu" => chr(0x00b5), # µ "\\textpilcrow" => chr(0x00b6), # ¶ "\\textparagraph" => chr(0x00b6), # ¶ "\\textperiodcentered" => chr(0x00b7), # · "\\textasciicedilla" => chr(0x00b8), # ¸ "\\textonesuperior" => chr(0x00b9), # ¹ "\\textordmasculine" => chr(0x00ba), # º "\\guillemotright" => chr(0x00bb), # » "\\textonequarter" => chr(0x00bc), # ¼ "\\textonehalf" => chr(0x00bd), # ½ "\\textthreequarters" => chr(0x00be), # ¾ "\\textquestiondown" => chr(0x00bf), # ¿ "\\texttimes" => chr(0x00d7), # × "\\textdiv" => chr(0x00f7), # ÷ "\\textflorin" => chr(0x0192), # ƒ "\\textasciibreve" => chr(0x0306), # ̆ "\\textasciicaron" => chr(0x030c), # ̌ "\\textbaht" => chr(0x0e3f), # ฿ "\\textnospace" => chr(0x200b), # ​ "\\textendash" => chr(0x2013), # – "\\textemdash" => chr(0x2014), # — "\\textbardbl" => chr(0x2016), # ‖ "\\textquoteleft" => chr(0x2018), # ‘ "\\textquoteright" => chr(0x2019), # ’ "\\textquotedblleft" => chr(0x201c), # “ "\\textquotedblright" => chr(0x201d), # ” "\\textdagger" => chr(0x2020), # † "\\textdaggerdbl" => chr(0x2021), # ‡ "\\textbullet" => chr(0x2022), # • "\\textellipsis" => chr(0x2026), # … "\\textperthousand" => chr(0x2030), # ‰ "\\textpertenthousand" => chr(0x2031), # ‱ "\\textacutedbl" => chr(0x2033), # ″ "\\textasciigrave" => chr(0x2035), # ‵ "\\textgravedbl" => chr(0x2036), # ‶ "\\textreferencemark" => chr(0x203b), # ※ "\\textinterrobang" => chr(0x203d), # ‽ "\\textfractionsolidus" => chr(0x2044), # ⁄ "\\textlquill" => chr(0x2045), # ⁅ "\\textrquill" => chr(0x2046), # ⁆ "\\textasteriskcentered" => chr(0x204e), # ⁎ "\\textcolonmonetary" => chr(0x20a1), # ₡ "\\textfrenchfranc" => chr(0x20a3), # ₣ "\\textlira" => chr(0x20a4), # ₤ "\\textnaira" => chr(0x20a6), # ₦ "\\textwon" => chr(0x20a9), # ₩ "\\textdong" => chr(0x20ab), # ₫ "\\texteuro" => chr(0x20ac), # € "\\textpeso" => chr(0x20b1), # ₱ "\\textcelsius" => chr(0x2103), # ℃ "\\textnumero" => chr(0x2116), # № "\\textcircledP" => chr(0x2117), # ℗ "\\textrecipe" => chr(0x211e), # ℞ "\\textservicemark" => chr(0x2120), # ℠ "\\texttrademark" => chr(0x2122), # ™ "\\textohm" => chr(0x2126), # Ω "\\textmho" => chr(0x2127), # ℧ "\\textestimated" => chr(0x212e), # ℮ "\\textleftarrow" => chr(0x2190), # ← "\\textuparrow" => chr(0x2191), # ↑ "\\textrightarrow" => chr(0x2192), # → "\\textdownarrow" => chr(0x2193), # ↓ "\\textsurd" => chr(0x221a), # √ "\\textasciicircum" => chr(0x2303), # ⌃ "\\textvisiblespace" => chr(0x2423), # ␣ "\\textopenbullet" => chr(0x25e6), # ◦ "\\textbigcircle" => chr(0x25ef), # ◯ "\\textmusicalnote" => chr(0x266a), # ♪ "\\textlangle" => chr(0x3008), # 〈 "\\textrangle" => chr(0x3009), # 〉 ); %GREEK = %TEX_GREEK = (); { my $i = 0; for(qw( alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu xi omicron pi rho varsigma sigma tau upsilon phi chi psi omega )) { # lowercase $GREEK{$TEX_GREEK{"\\$_"} = chr(0x3b1+$i)} = "\\ensuremath{\\$_}"; # uppercase $GREEK{$TEX_GREEK{"\\\u$_"} = chr(0x391+$i)} = "\\ensuremath{\\\u$_}"; $i++; } # lamda/lambda $TEX_GREEK{"\\lamda"} = $LATEX_Escapes_inv{"\\lambda"}; $TEX_GREEK{"\\Lamda"} = $LATEX_Escapes_inv{"\\Lambda"}; # Remove Greek letters that aren't available in TeX # http://www.artofproblemsolving.com/Wiki/index.php/LaTeX:Symbols for(qw( omicron Alpha Beta Epsilon Zeta Eta Iota Kappa Mu Nu Omicron Rho Varsigma Tau Chi Omega )) { delete $GREEK{delete $TEX_GREEK{"\\$_"}}; } } %MATH_CHARS = ( # Sets, http://www.unicode.org/charts/PDF/Unicode-4.1/U41-2100.pdf 'N' => chr(0x2115), 'R' => chr(0x211d), 'Z' => chr(0x2124), ); %MATH = ( # 'sin' => 'sin', # sin (should be romanised), other trigonometric functions??? chr(0x2192) => '\\to', # --> chr(0x2190) => '\\leftarrow', # <-- chr(0x2192) => '\\rightarrow', # --> chr(0x2248) => '\\approx', # ≈ Approximately equal to chr(0x2272) => '\\lesssim', # May not exist! chr(0x2273) => '\\gtrsim', # May not exist! chr(0x2243) => '\\simeq', chr(0x2264) => '\\leq', chr(0x00b1) => '\\pm', # ± Plus-minus chr(0x00d7) => '\\times', # × Times chr(0x2299) => '\\odot', # odot chr(0x222b) => '\\int', # integral chr(0x221a) => '\\sqrt', # square root chr(0x223c) => '\\sim', # tilda/mathematical similar chr(0x22c5) => '\\cdot', # dot # Relations and Operators chr(0x2265) => '\ge', # ≥ chr(0x2213) => '\mp', # ∓ chr(0x2260) => '\neq', # ≠ chr(0x2249) => '\not\approx', # ≉ chr(0x2218) => '\circ', # ∘ chr(0x2245) => '\cong', # ≅ chr(0x2261) => '\equiv', # ≡ chr(0x2262) => '\not\equiv', # ≢ chr(0x226E) => '\not<', # ≮ chr(0x226F) => '\not>', # ≯ chr(0x2270) => '\not\le', # ≰ chr(0x2271) => '\not\ge', # ≱ # Sets and Logic chr(0x2205) => '\emptyset', # ∅ chr(0x2135) => '\aleph', # ℵ chr(0x2208) => '\in', # ∈ chr(0x2136) => '\beth', # ℶ chr(0x2209) => '\notin', # ∉ chr(0x220B) => '\ni', # ∋ chr(0x2227) => '\wedge', # ∧ chr(0x220C) => '\not\ni', # ∌ chr(0x2228) => '\vee', # ∨ chr(0x2282) => '\subset', # ⊂ chr(0x22BB) => '\veebar', # ⊻ chr(0x2286) => '\subseteq', # ⊆ chr(0x2200) => '\forall', # ∀ chr(0x2284) => '\not\subset', # ⊄ chr(0x2203) => '\exists', # ∃ chr(0x2288) => '\not\subseteq', # ⊈ chr(0x22A4) => '\top', # ⊤ chr(0x228A) => '\subsetneq', # ⊊ chr(0x22A5) => '\bot', # ⊥ chr(0x228B) => '\supsetneq', # ⊋ chr(0x2234) => '\therefore', # ∴ chr(0x2283) => '\supset', # ⊃ chr(0x22A2) => '\vdash', # ⊢ chr(0x2287) => '\supseteq', # ⊇ chr(0x22A8) => '\models', # ⊨ chr(0x222A) => '\cup', # ∪ chr(0x25A1) => '\Box', # □ chr(0x2229) => '\cap', # ∩ chr(0x22C3) => '\bigcup', # ⋃ chr(0x22C2) => '\bigcap', # ⋂ chr(0x2216) => '\setminus', # ∖ # Geometry chr(0x2220) => '\angle', # ∠ chr(0x25B3) => '\triangle', # △ chr(0x22A5) => '\perp', # ⊥ chr(0x2225) => '\parallel', # ∥ chr(0x2245) => '\cong', # ≅ # Analysis chr(0x221E) => '\infty', # ∞ chr(0x230A) => '\lfloor', # ⌊ chr(0x0394) => '\Delta', # Δ chr(0x230B) => '\rfloor', # ⌋ chr(0x2207) => '\nabla', # ∇ chr(0x2308) => '\lceil', # ⌈ chr(0x2202) => '\partial', # ∂ chr(0x2309) => '\rceil', # ⌉ chr(0x2211) => '\sum', # ∑ #chr(0x2225) => '\|', # ∥ chr(0x220F) => '\prod', # ∏ chr(0x27E8) => '\langle', # ⟨ chr(0x27E9) => '\rangle', # ⟩ chr(0x222C) => '\iint', # ∬ #chr(0x2032) => q"'", # ′ chr(0x222D) => '\iiint', # ∭ chr(0x2A0C) => '\iiiint', # ⨌ #chr(0x2034) => q"'''", # ‴ chr(0x222E) => '\oint', # ∮ chr(0x211C) => '\Re', # ℜ chr(0x2111) => '\Im', # ℑ chr(0x2118) => '\wp', # ℘ # Algebra chr(0x2295) => '\oplus', # ⊕ chr(0x2A01) => '\bigoplus', # ⨁ chr(0x2297) => '\otimes', # ⊗ chr(0x2A02) => '\bigotimes', # ⨂ chr(0x25C3) => '\triangleleft', # ◃ chr(0x22B4) => '\unlhd', # ⊴ chr(0x22CA) => '\rtimes', # ⋊ chr(0x2240) => '\wr', # ≀ # Arrows chr(0x21D2) => '\Rightarrow', # ⇒ chr(0x21D0) => '\Leftarrow', # ⇐ chr(0x21D1) => '\Uparrow', # ⇑ chr(0x21D3) => '\Downarrow', # ⇓ chr(0x2196) => '\nwarrow', # ↖ chr(0x2197) => '\nearrow', # ↗ chr(0x2198) => '\searrow', # ↘ chr(0x2199) => '\swarrow', # ↙ chr(0x21A6) => '\mapsto', # ↦ chr(0x2194) => '\leftrightarrow', # ↔ chr(0x21D4) => '\Leftrightarrow', # ⇔ chr(0x21A3) => '\rightarrowtail', # ↣ chr(0x21A0) => '\twoheadrightarrow', # ↠ chr(0x21AA) => '\hookrightarrow', # ↪ # Dots chr(0x22EF) => '\cdots', # ⋯ chr(0x22F1) => '\ddots', # ⋱ chr(0x22EE) => '\vdots', # ⋮ chr(0x1d538) => '\mathbb{A}', # 𝔸 chr(0x1d552) => '\mathbb{a}', # 𝕒 chr(0x1d539) => '\mathbb{B}', # 𝔹 chr(0x1d553) => '\mathbb{b}', # 𝕓 chr(0x2102) => '\mathbb{C}', # ℂ chr(0x1d554) => '\mathbb{c}', # 𝕔 chr(0x1d7d8) => '\mathbb{0}', # 𝟘 chr(0x1d7d9) => '\mathbb{1}', # 𝟙 chr(0x1d7da) => '\mathbb{2}', # 𝟚 chr(0x1d504) => '\mathfrak{A}', # 𝔄 chr(0x1d51e) => '\mathfrak{a}', # 𝔞 chr(0x1d505) => '\mathfrak{B}', # 𝔅 chr(0x1d51f) => '\mathfrak{b}', # 𝔟 chr(0x212d) => '\mathfrak{C}', # ℭ chr(0x1d520) => '\mathfrak{c}', # 𝔠 chr(0x1d49c) => '\mathcal{A}', # 𝒜 chr(0x1d4b6) => '\mathcal{a}', # 𝒶 chr(0x212c) => '\mathcal{B}', # ℬ chr(0x1d4b7) => '\mathcal{b}', # 𝒷 chr(0x1d49e) => '\mathcal{C}', # 𝒞 chr(0x1d4b8) => '\mathcal{c}', # 𝒸 # var greek characters chr(0x03B5) => '\varepsilon', # ε chr(0x03F0) => '\varkappa', # ϰ chr(0x03C6) => '\varphi', # φ chr(0x03D6) => '\varpi', # ϖ chr(0x03F1) => '\varrho', # ϱ chr(0x03C2) => '\varsigma', # ς chr(0x03D1) => '\vartheta', # ϑ ); %ASTRONOMY = ( chr(0x263F) => '\mercury', # ☿ chr(0x2648) => '\aries', # ♈ chr(0x2640) => '\venus', # ♀ chr(0x2649) => '\taurus', # ♉ chr(0x2295) => '\earth', # ⊕ chr(0x264A) => '\gemini', # ♊ chr(0x2642) => '\mars', # ♂ chr(0x264B) => '\cancer', # ♋ chr(0x2643) => '\jupiter', # ♃ chr(0x264C) => '\leo', # ♌ chr(0x2644) => '\saturn', # ♄ chr(0x264D) => '\virgo', # ♍ chr(0x26E2) => '\uranus', # ⛢ chr(0x264E) => '\libra', # ♎ chr(0x2646) => '\neptune', # ♆ chr(0x264F) => '\scorpio', # ♏ chr(0x2647) => '\pluto', # ♇ chr(0x2650) => '\sagittarius', # ♐ chr(0x2609) => '\astrosun', # ☉ chr(0x2651) => '\capricornus', # ♑ chr(0x263D) => '\rightmoon', # ☽ chr(0x2652) => '\aquarius', # ♒ chr(0x263E) => '\leftmoon', # ☾ chr(0x2653) => '\pisces', # ♓ chr(0x260A) => '\ascnode', # ☊ chr(0x260B) => '\descnode', # ☋ chr(0x260C) => '\conjunction', # ☌ chr(0x260D) => '\opposition', # ☍ ); %GAMES = ( chr(0x265D) => '\blackbishop', # ♝ chr(0x2680) => '\epsdice{1}', # ⚀ chr(0x265A) => '\blackking', # ♚ chr(0x2681) => '\epsdice{2}', # ⚁ chr(0x265E) => '\blackknight', # ♞ chr(0x2682) => '\epsdice{3}', # ⚂ chr(0x265F) => '\blackpawn', # ♟ chr(0x2683) => '\epsdice{4}', # ⚃ chr(0x265B) => '\blackqueen', # ♛ chr(0x2684) => '\epsdice{5}', # ⚄ chr(0x265C) => '\blackrook', # ♜ chr(0x2685) => '\epsdice{6}', # ⚅ chr(0x2657) => '\whitebishop', # ♗ chr(0x2663) => '\clubsuit', # ♣ chr(0x2654) => '\whiteking', # ♔ chr(0x2661) => '\heartsuit', # ♡ chr(0x2658) => '\whiteknight', # ♘ chr(0x2660) => '\spadesuit', # ♠ chr(0x2659) => '\whitepawn', # ♙ chr(0x2662) => '\diamondsuit', # ♢ chr(0x2655) => '\whitequeen', # ♕ chr(0x2656) => '\whiterook', # ♖ ); %KEYS = ( chr(0x2318) => '\cmdkey', # ⌘ chr(0x21E5) => '\tabkey', # ⇥ chr(0x2325) => '\optkey', # ⌥ chr(0x21E4) => '\revtabkey', # ⇤ chr(0x21E7) => '\shiftkey', # ⇧ chr(0x238B) => '\esckey', # ⎋ chr(0x232B) => '\delkey', # ⌫ chr(0x23CE) => '\returnkey', # ⏎ chr(0x21EA) => '\capslockkey', # ⇪ chr(0x2324) => '\enterkey', # ⌤ chr(0x23CF) => '\ejectkey', # ⏏ chr(0x2326) => '\rightdelkey', # ⌦ ); # International Phonetic Alphabet %IPA = ( # Plosives chr(0x0062) => 'b', # b voiced bilabial plosive chr(0x0063) => 'c', # c voiceless palatal plosive (e.g. Hungarian ty) chr(0x0064) => 'd', # d voiced dental/alveolar plosive chr(0x0256) => '\textrtaild', # ɖ voiced retroflex plosive chr(0x0067) => 'g', # g voiced velar plosive chr(0x0262) => '\textscg', # ɢ voiced uvular plosive chr(0x006B) => 'k', # k voiceless velar plosive chr(0x0070) => 'p', # p voiceless bilabial plosive chr(0x0071) => 'q', # q voiceless uvular plosive chr(0x0074) => 't', # t voiceless dental/alveolar plosive chr(0x0288) => '\textrtailt', # ʈ voiceless retroflex plosive chr(0x0294) => '\textglotstop', # ʔ glottal plosive chr(0x02A1) => '\textbarglotstop', # ʡ epiglottal plosive # Nasals chr(0x006D) => 'm', # m voiced bilabial nasal chr(0x0271) => '\textltailm', # ɱ voiced labiodental nasal chr(0x006E) => 'n', # n voiced dental/alveolar nasal chr(0x0273) => '\textrtailn', # ɳ voiced retroflex nasal chr(0x0272) => '\textltailn', # ɲ voiced palatal nasal chr(0x0274) => '\textscn', # ɴ voiced uvular nasal # Fricatives & Approximants chr(0x03B2) => '\textbeta', # β voiced bilabial fricative chr(0x0255) => '\textctc', # ɕ voicelss alveolo-palatal median laminal fricative chr(0x0066) => 'f', # f voiceless labiodental fricative chr(0x0263) => '\textgamma', # ɣ voiced velar fricative chr(0x0068) => 'h', # h voiceless glottal fricative/approximant chr(0x0265) => '\textturnh', # ɥ voiced rounded palatal median approximant (i.e. rounded [j]) chr(0x029C) => '\textsch', # ʜ voiceless epiglottal fricative chr(0x0266) => '\texthth', # ɦ voiced glottal fricative chr(0x0267) => '\texththeng', # ɧ combination of [x] and [ʃ] (e.g. Swedish tj, kj) chr(0x006A) => 'j', # j voiced palatal median approximant chr(0x029D) => '\textctj', # ʝ voiced palatal median fricative chr(0x006C) => 'l', # l voiced alveolar lateral approximant chr(0x026D) => '\textrtaill', # ɭ voiced retroflex lateral approximant chr(0x026C) => '\textbeltl', # ɬ voiceless alveolar lateral fricative chr(0x026B) => '\textltilde', # ɫ velarized voiced alveolar lateral approximant chr(0x026E) => '\textlyoghlig', # ɮ voiced alveolar lateral fricative chr(0x029F) => '\textscl', # ʟ voiced velar lateral approximant chr(0x0270) => '\textturnmrleg', # ɰ voiced velar median approximant chr(0x03B8) => '\texttheta', # θ voiceless interdental median fricative chr(0x0278) => '\textphi', # ɸ voiceless bilabial fricative chr(0x0072) => 'r', # r voiced apico-alveolar trill chr(0x0279) => '\textturnr', # ɹ voiced alveolar/postalveolar approximant chr(0x027A) => '\textturnlonglegr', # ɺ voiced alveolar lateral flap chr(0x027E) => '\textfishhookr', # ɾ voiced alveolar flap chr(0x027B) => '\textturnrrtail', # ɻ voiced retroflex approximant chr(0x0280) => '\textscr', # ʀ voiced uvular trill or flap chr(0x0281) => '\textinvscr', # ʁ voiced uvular fricative or approximant (e.g. French r) chr(0x027D) => '\textrtailr', # ɽ voiced retroflex flap chr(0x0073) => 's', # s voiceless alveolar median fricative chr(0x0282) => '\textrtails', # ʂ voiceless retroflex median fricative chr(0x0283) => '\textesh', # ʃ voiceless palato-alveolar median laminal fricative chr(0x0076) => 'v', # v voiced labiodental fricative chr(0x028B) => '\textscriptv', # ʋ voiced labiodental approximant chr(0x0077) => 'w', # w voiced rounded labial-velar approximant chr(0x028D) => '\textturnw', # ʍ voiceless rounded labial-velar approximant/fricative (i.e. voiceless [w]) chr(0x0078) => 'x', # x voiceless velar median fricative chr(0x03C7) => '\textchi', # χ voicelss uvular median fricative chr(0x028E) => '\textturny', # ʎ voiced palatal lateral approximant (e.g. Italian gl) chr(0x007A) => 'z', # z voiced alveolar/dental median fricative chr(0x0290) => '\textrtailz', # ʐ voiced retroflex median fricative chr(0x0291) => '\textctz', # ʑ voiced alveolo-palatal median laminal fricative chr(0x0292) => '\textyogh', # ʒ voiced palato-alveolar median laminal fricative chr(0x0295) => '\textrevglotstop', # ʕ voiced pharyngeal fricative chr(0x02A2) => '\textbarrevglotstop', # ʢ voiced epiglottal fricative # Vowels chr(0x0061) => 'a', # a unrounded front low vowel (cardinal vowel no. 4) chr(0x0250) => '\textturna', # ɐ unrounded central low vowel chr(0x0251) => '\textscripta', # ɑ unrounded back low vowel (cardinal vowel no. 5) chr(0x0252) => '\textturnscripta', # ɒ rounded back low vowel (cardinal vowel no. 13) chr(0x0065) => 'e', # e unrounded front high-mid vowel (cardinal vowel no. 2) chr(0x0259) => '\textschwa', # ə unrounded central mid vowel chr(0x0258) => '\textreve', # ɘ unrounded central high-mid vowel chr(0x025A) => '\textrighthookschwa', # ɚ rhotacized [ə] chr(0x025B) => '\textepsilon', # ɛ unrounded front low-mid vowel (cardinal vowel no. 3) chr(0x025C) => '\textrevepsilon', # ɜ unrounded central low-mid vowel chr(0x025D) => '\textrhookrevepsilon', # ɝ rhotacized [ɜ] chr(0x025E) => '\textcloserevepsilon', # ɞ rounded central low-mid vowel chr(0x0264) => '\textbabygamma', # ɤ unrounded back high-mid vowel (cardinal vowel no. 15) chr(0x026F) => '\textturnm', # ɯ unrounded back high vowel (cardinal vowel no. 16) chr(0x0069) => 'i', # i unrounded front high vowel (cardinal vowel no. 1) chr(0x03B9) => '\textiota', # ι unrounded front semi-high vowel chr(0x026A) => '\textsci', # ɪ synonym for [ι] chr(0x0268) => '\textbari', # ɨ unrounded central high vowel (cardinal vowel no. 17) chr(0x006F) => 'o', # o rounded back high-mid vowel (cardinal vowel no. 7) chr(0x0275) => '\textbaro', # ɵ rounded central high-mid vowel chr(0x0276) => '\textscoelig', # ɶ rounded front low vowel (cardinal vowel no. 12) chr(0x0254) => '\textopeno', # ɔ rounded back low-md vowel (cardinal vowel no. 6) chr(0x0075) => 'u', # u rounded back high vowel (cardinal vowel no. 8) chr(0x0289) => '\textbaru', # ʉ rounded central high vowel (cardinal vowel no. 18) chr(0x028A) => '\textupsilon', # ʊ rounded back semi-high vowel chr(0x028C) => '\textturnv', # ʌ unrounded back low-mid vowel (cardinal vowel no. 14) chr(0x0079) => 'y', # y rounded front high vowel (cardinal vowel no. 9) chr(0x028F) => '\textscy', # ʏ rounded front semi-high vowel # Implosives & Clicks chr(0x0253) => '\texthtb', # ɓ voiced glottalic ingressive bilabial stop chr(0x0257) => '\texthtd', # ɗ voiced glottalic ingressive dental/postalveolar stop chr(0x0260) => '\texthtg', # ɠ voiced glottalic ingressive velar stop chr(0x029B) => '\texthtscg', # ʛ voiced glottalic ingressive uvular stop chr(0x0298) => '\textbullseye', # ʘ bilabial click chr(0x01C0) => '\textpipe', # ǀ dental click chr(0x01C1) => '\textdoublepipe', # ǁ lateral click chr(0x0021) => '!', # ! alveloar/postalveolar click ); # derived mappings use vars qw( %CHAR_MAP $CHAR_MAP_RE ); %CHAR_MAP = (%CHARS, %ACCENTED_CHARS, %GREEK); for(keys %MATH) { $CHAR_MAP{$_} ||= '$' . $MATH{$_} . '$'; } for(keys %MATH_CHARS) { $CHAR_MAP{$MATH_CHARS{$_}} ||= '$' . $_ . '$'; } $CHAR_MAP_RE = '[' . join('', map { quotemeta($_) } sort { length($b) <=> length($a) } keys %CHAR_MAP) . ']'; use vars qw( $RESERVED_RE $BIBTEX_RESERVED_RE ); $RESERVED_RE = '[' . join('', map { quotemeta($_) } sort { length($b) <=> length($a) } keys %RESERVED) . ']'; $BIBTEX_RESERVED_RE = '[' . join('', map { quotemeta($_) } sort { length($b) <=> length($a) } keys %BIBTEX_RESERVED) . ']'; use vars qw( %MACROS $MACROS_RE ); %MACROS = ( reverse(%RESERVED), reverse(%CHARS), reverse(%ACCENTED_CHARS), reverse(%MATH), reverse(%ASTRONOMY), reverse(%GAMES), reverse(%KEYS), reverse(%IPA), %TEX_GREEK, %LATEX_MACROS ); $MACROS_RE = join('|', map { "(?:$_)" } map { quotemeta($_) } sort { length($b) <=> length($a) } keys %MACROS); use vars qw( $MATH_CHARS_RE ); $MATH_CHARS_RE = '[' . join('', map { quotemeta($_) } sort { length($b) <=> length($a) } keys %MATH_CHARS) . ']'; 1; TeX-Encode-2.004/xt/author/000755 000765 000024 00000000000 13217023067 015164 5ustar00a3fstaff000000 000000 TeX-Encode-2.004/xt/release/000755 000765 000024 00000000000 13217023067 015302 5ustar00a3fstaff000000 000000 TeX-Encode-2.004/xt/99pod.t000644 000765 000024 00000000202 13217023067 015005 0ustar00a3fstaff000000 000000 use Test::More; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; all_pod_files_ok(); TeX-Encode-2.004/xt/98coverage.t000644 000765 000024 00000000254 13217023067 016024 0ustar00a3fstaff000000 000000 use Test::Pod::Coverage tests => 2; pod_coverage_ok( "TeX::Encode", "TeX::Encode is covered" ); pod_coverage_ok( "TeX::Encode::BibTeX", "TeX::Encode::BibTeX is covered" ); TeX-Encode-2.004/xt/release/minimum-version.t000644 000765 000024 00000000264 13217023067 020627 0ustar00a3fstaff000000 000000 #!perl use Test::More; eval "use Test::MinimumVersion"; plan skip_all => "Test::MinimumVersion required for testing minimum versions" if $@; all_minimum_version_ok( qq{5.8} ); TeX-Encode-2.004/xt/author/test-version.t000644 000765 000024 00000000637 13217023067 020021 0ustar00a3fstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 1.09 use Test::Version; my @imports = qw( version_all_ok ); my $params = { is_strict => 0, has_version => 1, multiple => 0, }; push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); Test::Version->import(@imports); version_all_ok; done_testing; TeX-Encode-2.004/xt/author/00-compile.t000644 000765 000024 00000002632 13217023067 017221 0ustar00a3fstaff000000 000000 use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.056 use Test::More; plan tests => 4; my @module_files = ( 'TeX/Encode.pm', 'TeX/Encode/BibTeX.pm', 'TeX/Encode/charmap.pm' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ); TeX-Encode-2.004/xt/author/pod-syntax.t000644 000765 000024 00000000252 13217023067 017456 0ustar00a3fstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); TeX-Encode-2.004/t/02check.t000644 000765 000024 00000001763 13217023067 015105 0ustar00a3fstaff000000 000000 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl Encode-LaTeX.t' ######################### # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 6; use Encode; BEGIN { use_ok('TeX::Encode') }; ######################### # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. my $chr = chr(0xfffd); # what character will never be supported by TeX? my $str = "start ".$chr." end"; my $left = encode('latex', $str, Encode::FB_QUIET); is( $left, "start ", "FB_QUIET" ); is( $str, $chr." end", "FB_QUIET" ); $str = "start ".$chr." end"; $left = encode('latex', $str, Encode::FB_DEFAULT); is( $left, "start ? end", "FB_DEFAULT" ); $left = eval { encode('latex', $str, Encode::FB_CROAK) }; my $err = "Unsupported character code point 0x0036"; is( substr($@,0,length($err)), $err, "FB_CROAK" ); ok(1); TeX-Encode-2.004/t/regressions.t000644 000765 000024 00000000507 13217023067 016224 0ustar00a3fstaff000000 000000 use Test::More skip_all => "Work in progress"; use utf8; use Encode; BEGIN { use_ok 'TeX::Encode'; } my %samples = ( 'nop' => 'nop', '!' => '!', ); while (my ($unicode, $expected) = each %samples) { my $got = encode 'LaTeX', $unicode; is $got, $expected, "TeXing $unicode"; } done_testing; TeX-Encode-2.004/t/Encode-LaTeX.t000644 000765 000024 00000005470 13217023067 016035 0ustar00a3fstaff000000 000000 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl Encode-LaTeX.t' ######################### # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 37; use Encode; BEGIN { use_ok('TeX::Encode') }; ######################### # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. # decode of an encode should be equivalent my $str = "eacute = '" . chr(0xe9) . "'"; is(encode('LaTeX', $str), "eacute = '\\'e'", "eacute => '\\'e'"); is(decode('latex', "eacute = '\\'e'"), $str, $str); # General decode tests my @DECODE_TESTS = ( 'foo x^2 bar' => 'foo x'.chr(0xb2).' bar', 'xxx \\texttt{\char92} yyy' => 'xxx \\ yyy', '\\sqrt{2}' => (chr(0x221a) . "2"), 'hyper-K\\"ahler background' => ('hyper-K'.chr(0xe4).'hler background'), '$0<\\sigma\\leq{}2$' => ('0<'.chr(0x3c3).chr(0x2264).'2'), 'foo \\{ bar' => 'foo { bar', # Unescaping Tex escapes 'foo \\\\ bar' => "foo \n bar", # Tex newline 'foo $mathrm$ bar' => 'foo mathrm bar', # Math mode test (strictly should eat spaces inside math mode too) '{\\L}' => chr(0x141), # Polish suppressed-L '\\ss' => chr(0xdf), # German sharp S '\\oe' => chr(0x153), # French oe '\\OE' => chr(0x152), # French OE '\\ae' => chr(0xe6), # Scandinavian ligature ae "consist of \$\\sim{}260,000\$ of subprobes \$\\sim{}4\\\%\$ of in \$2.92\\cdot{}10^{8}\$ years. to \$1.52\\cdot{}10^{7}\$ years." => "consist of ".chr(0x223c)."260,000 of subprobes ".chr(0x223c)."4% of in 2.92".chr(0x22c5)."10".chr(0x2078)." years. to 1.52".chr(0x22c5)."10".chr(0x2077)." years.", # Should remove empty braces too 'L\Boxr' => 'L'.chr(0x25A1).'r', # %MATH box 'L\earthr' => 'L'.chr(0x2295).'r', # %ASTRONOMY 'L\blackpawnr' => 'L'.chr(0x265f).'r', # %GAMES chess 'L\epsdice{6}r' => 'L'.chr(0x2685).'r', # %GAMES dice 'L\returnkeyr' => 'L'.chr(0x23CE).'r', # %KEYS 'L\texteshr' => 'L'.chr(0x0283).'r', # voiceless palato-alveolar median laminal fricative ); # General encode tests my @ENCODE_TESTS = ( 'underscores _ should be escaped' => "underscores \\_ should be escaped", '#$%&_' => '\\#\\$\\%\\&\\_', '\\' => '\\texttt{\\char92}', '^' => '\\^{ }', '~' => '\\texttt{\\char126}', '<>' => '\ensuremath{<}\ensuremath{>}', chr(0xe6) => '\\ae', chr(0xe6).'foo' => '\\ae{}foo', chr(0x3b1) => '\\ensuremath{\\alpha}', chr(0xe6).' foo' => '\\ae foo', 'abcd'.chr(0xe9).'fg' => 'abcd\\\'e{}fg', chr(0x107) => '\\\'c', ); while( my( $in, $out ) = splice(@DECODE_TESTS,0,2) ) { is( decode('latex', $in), $out ); } while( my( $in, $out ) = splice(@ENCODE_TESTS,0,2) ) { is( encode('latex', $in), $out ); } # Check misquoting of tex strings ({}) $str = 'mathrm $\\mathrm{E}$'; is(decode('latex', $str), 'mathrm \\mathrmE'); ok(1); TeX-Encode-2.004/t/00-compile.t000644 000765 000024 00000002723 13217023067 015530 0ustar00a3fstaff000000 000000 use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.056 use Test::More; plan tests => 3 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'TeX/Encode.pm', 'TeX/Encode/BibTeX.pm', 'TeX/Encode/charmap.pm' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; TeX-Encode-2.004/t/01ltgt.t000644 000765 000024 00000001145 13217023067 014773 0ustar00a3fstaff000000 000000 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl Encode-LaTeX.t' ######################### # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 3; use Encode; BEGIN { use_ok('TeX::Encode') }; ######################### # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. my $str = "begin \$d_<=x/2\$ between \$d_>=3x/2\$ end"; is(decode('latex', $str), "begin d<=x/2 between d>=3x/2 end"); ok(1); TeX-Encode-2.004/t/00-report-prereqs.t000644 000765 000024 00000013426 13217023067 017074 0ustar00a3fstaff000000 000000 #!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=4 sts=4 sw=4 et: TeX-Encode-2.004/t/00-report-prereqs.dd000644 000765 000024 00000005003 13217023067 017210 0ustar00a3fstaff000000 000000 do { my $x = { 'configure' => { 'requires' => { 'CPAN::Meta::Requirements' => '2.120620', 'ExtUtils::MakeMaker' => '0', 'Module::Metadata' => '0', 'perl' => '5.008' } }, 'develop' => { 'requires' => { 'File::Spec' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Test::MinimumVersion' => '0', 'Test::More' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '0', 'Test::Version' => '1', 'blib' => '1.01', 'warnings' => '0' } }, 'runtime' => { 'requires' => { 'Carp' => '0', 'Encode::Encoding' => '0.1', 'HTML::Entities' => '1.27', 'HTML::Parser' => '3.35', 'Pod::LaTeX' => '0.56', 'perl' => '5.008', 'strict' => '0', 'vars' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'Encode' => '0', 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Test::More' => '0.1', 'blib' => '1.01', 'perl' => '5.008', 'utf8' => '0', 'warnings' => '0' } } }; $x; }