summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/SQLTeX/doc/SQLTeX.pdfbin270112 -> 0 bytes
-rw-r--r--support/SQLTeX/man/Makefile.am15
-rw-r--r--support/SQLTeX/src/Makefile.am20
-rw-r--r--support/SQLTeX/src/SQLTeX_r.dat29
-rw-r--r--support/TeX4ht/source/ChangeLog190
-rw-r--r--support/TeX4ht/source/Makefile4
-rw-r--r--support/TeX4ht/source/mktex4ht-cnf.tex8
-rw-r--r--support/TeX4ht/source/tex4ht-4ht.tex544
-rw-r--r--support/TeX4ht/source/tex4ht-cpright.tex4
-rw-r--r--support/TeX4ht/source/tex4ht-env.tex17
-rw-r--r--support/TeX4ht/source/tex4ht-fonts-noncjk.tex166
-rw-r--r--support/TeX4ht/source/tex4ht-html4.tex183
-rw-r--r--support/TeX4ht/source/tex4ht-jats.tex26
-rw-r--r--support/TeX4ht/source/tex4ht-mathjax.tex39
-rw-r--r--support/TeX4ht/source/tex4ht-mathml.tex215
-rw-r--r--support/TeX4ht/source/tex4ht-ooffice.tex122
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/Changes86
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/LICENSE379
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/MANIFEST44
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/Makefile.PL71
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/Makefile.TDS35
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/README9
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/dist.ini28
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/lib/BibTeX/Parser.pm366
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/lib/BibTeX/Parser/Author.pm429
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/lib/BibTeX/Parser/Entry.pm435
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/notes26
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/00-load.t11
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/01-parse.t36
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/02-parse_string.t39
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/03-parse_entry.t102
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/04-entry.t42
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/05-author.t68
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/06-parse_complex.t46
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/07-parse_englishbib.t42
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/08-parse_large.t24
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/09-complex.t42
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/10-funnyname.t61
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/11-split_braced.t28
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/12-von_token.t12
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/13_output.t39
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/14-extratext.t65
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/15-capitalization.t72
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/bibs/01.bib7
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/bibs/06.bib27
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/bibs/09-complex.bib11
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/bibs/10-funnyname.bib10
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/bibs/14-extratext.bib22
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/bibs/braces.bib21
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/bibs/endnote.txt6
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/bibs/engineering_village.txt24
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib55
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/bibs/mathscinet.txt40
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/bug66325.t71
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/bug67419.t29
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/cleaned_field.t143
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/pod-coverage.t18
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/pod.t12
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/release-pod-coverage.t21
-rw-r--r--support/bibtexperllibs/BibTeX-Parser/t/release-pod-syntax.t15
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/Changes27
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/LICENSE375
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/MANIFEST17
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/Makefile.PL51
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/Makefile.TDS53
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/README13
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/dist.ini16
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/head.ltx28
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/latex-tounicode.pdfbin191418 -> 0 bytes
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/lib/LaTeX/ToUnicode.pm778
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/lib/LaTeX/ToUnicode/Tables.pm726
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/ltx2unitxt.173
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/ltx2unitxt.pdfbin2226 -> 0 bytes
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/script/convert.pl156
-rwxr-xr-xsupport/bibtexperllibs/LaTeX-ToUnicode/script/ltx2unitxt169
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/t/convert.t136
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/t/release-pod-coverage.t21
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/t/release-pod-syntax.t15
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/t/release-synopsis.t16
-rw-r--r--support/bibtexperllibs/LaTeX-ToUnicode/weaver.ini24
-rw-r--r--support/bibtexperllibs/Makefile27
-rw-r--r--support/bibtexperllibs/README49
-rw-r--r--support/crossrefware/Makefile5
-rw-r--r--support/crossrefware/README9
-rw-r--r--support/crossrefware/bibdoiadd.134
-rwxr-xr-xsupport/crossrefware/bibdoiadd.pl38
-rw-r--r--support/crossrefware/bibmradd.113
-rwxr-xr-xsupport/crossrefware/bibmradd.pl14
-rw-r--r--support/crossrefware/bibzbladd.111
-rwxr-xr-xsupport/crossrefware/bibzbladd.pl13
-rw-r--r--support/crossrefware/crossrefware.pdfbin234836 -> 236994 bytes
-rw-r--r--support/crossrefware/head.ltx17
-rw-r--r--support/crossrefware/ltx2crossrefxml.157
-rwxr-xr-xsupport/crossrefware/ltx2crossrefxml.pl416
-rw-r--r--support/digestif/INSTALL.md4
-rw-r--r--support/digestif/LICENSE.md14
-rw-r--r--support/digestif/README.md24
-rwxr-xr-xsupport/digestif/bin/digestif3
-rwxr-xr-xsupport/digestif/bin/digestif.texlua3
-rw-r--r--support/digestif/data/natbib.sty.tags628
-rw-r--r--support/digestif/data/tikz.tags3
-rw-r--r--support/digestif/digestif/Cache.lua2
-rw-r--r--support/digestif/digestif/Manuscript.lua172
-rw-r--r--support/digestif/digestif/ManuscriptBibTeX.lua5
-rw-r--r--support/digestif/digestif/ManuscriptConTeXt.lua4
-rw-r--r--support/digestif/digestif/ManuscriptLaTeX.lua5
-rw-r--r--support/digestif/digestif/Schema.lua2
-rw-r--r--support/digestif/digestif/bibtex.lua35
-rw-r--r--support/digestif/digestif/config.lua6
-rw-r--r--support/digestif/digestif/data.lua119
-rw-r--r--support/digestif/digestif/langserver.lua42
-rw-r--r--support/digestif/digestif/util.lua10
-rwxr-xr-xsupport/epstopdf/epstopdf.pl12
-rw-r--r--support/lacheck/Makefile.in121
-rw-r--r--support/lacheck/aclocal.m4415
-rwxr-xr-xsupport/lacheck/configure.texk335
-rw-r--r--support/latex-git-log/README.md22
-rw-r--r--support/latex-git-log/example-output.tex217
-rw-r--r--support/latex-git-log/example.pdfbin77887 -> 51051 bytes
-rw-r--r--support/latex-git-log/example.tex40
-rwxr-xr-xsupport/latex-git-log/latex-git-log81
-rw-r--r--support/latex-git-log/po/de.po8
-rw-r--r--support/latexdiff/README55
-rw-r--r--support/latexdiff/doc/example-diff.tex4
-rw-r--r--support/latexdiff/doc/latexdiff-man.pdfbin272513 -> 290596 bytes
-rwxr-xr-xsupport/latexdiff/latexdiff836
-rwxr-xr-xsupport/latexdiff/latexdiff-fast836
-rwxr-xr-xsupport/latexdiff/latexdiff-so836
-rwxr-xr-xsupport/latexdiff/latexdiff-vc111
-rw-r--r--support/latexdiff/latexdiff-vc.116
-rw-r--r--support/latexdiff/latexdiff.1155
-rw-r--r--support/latexdiff/latexrevise.14
-rw-r--r--support/latexindent/LatexIndent/GetYamlSettings.pm35
-rw-r--r--support/latexindent/LatexIndent/Logger.pm2
-rw-r--r--support/latexindent/LatexIndent/Sentence.pm4
-rw-r--r--support/latexindent/LatexIndent/Special.pm4
-rw-r--r--support/latexindent/LatexIndent/TrailingComments.pm32
-rw-r--r--support/latexindent/LatexIndent/UTF8CmdLineArgsFileOperation.pm40
-rw-r--r--support/latexindent/LatexIndent/Version.pm4
-rw-r--r--support/latexindent/LatexIndent/Wrap.pm7
-rw-r--r--support/latexindent/README2
-rw-r--r--support/latexindent/bin/linux/latexindentbin7847663 -> 7875489 bytes
-rw-r--r--support/latexindent/bin/macos/latexindentbin7564675 -> 7569299 bytes
-rw-r--r--support/latexindent/defaultSettings.yaml4
-rw-r--r--support/latexindent/documentation/contributors.bib11
-rw-r--r--support/latexindent/documentation/latexindent-yaml-schema.json9
-rw-r--r--support/latexindent/documentation/latexindent.pdfbin1297746 -> 1274961 bytes
-rw-r--r--support/latexindent/documentation/latexindent.tex77
-rwxr-xr-xsupport/latexindent/latexindent.pl2
-rw-r--r--support/luafindfont/CHANGELOG1
-rw-r--r--support/luafindfont/doc/luafindfont-doc.pdfbin98571 -> 98752 bytes
-rw-r--r--support/luafindfont/doc/luafindfont-doc.tex4
-rwxr-xr-xsupport/luafindfont/scripts/luafindfont.lua42
-rw-r--r--support/mf2pt1/ChangeLog19
-rw-r--r--support/mf2pt1/README2
-rw-r--r--support/mf2pt1/mf2pt1.mp2
-rw-r--r--support/mf2pt1/mf2pt1.pdfbin183116 -> 182727 bytes
-rwxr-xr-xsupport/mf2pt1/mf2pt1.pl8
-rw-r--r--support/mf2pt1/mf2pt1.texi16
-rw-r--r--support/pdfjam/VERSION2
-rwxr-xr-xsupport/pdfjam/bin/pdfjam4
-rw-r--r--support/pdfxup/README4
-rw-r--r--support/pdfxup/RELEASES4
-rw-r--r--support/pdfxup/doc/Makefile3
-rw-r--r--support/pdfxup/doc/pdfxup-doc.pdf (renamed from support/pdfxup/pdfxup.pdf)bin90128 -> 94798 bytes
-rw-r--r--support/pdfxup/doc/pdfxup-doc.tex163
-rw-r--r--support/pdfxup/doc/pdfxup.pdfbin0 -> 96697 bytes
-rwxr-xr-xsupport/pdfxup/pdfxup134
-rw-r--r--support/pdfxup/pdfxup.12
-rw-r--r--support/pkgcheck/CHANGES.md17
-rw-r--r--support/pkgcheck/Cargo.toml63
-rwxr-xr-xsupport/pkgcheck/bin/pkgcheckbin7266008 -> 8028168 bytes
-rw-r--r--support/pkgcheck/docs/errorsd.tex154
-rw-r--r--support/pkgcheck/docs/pkgcheck.pdfbin89893 -> 90348 bytes
-rw-r--r--support/pkgcheck/docs/title.tex2
-rw-r--r--support/pkgcheck/docs/warningsd.tex53
-rw-r--r--support/pkgcheck/src/gparser.rs1
-rw-r--r--support/pkgcheck/src/linkcheck.rs4
-rw-r--r--support/pkgcheck/src/main.rs338
-rw-r--r--support/pkgcheck/src/messages/errorsd.rs26
-rw-r--r--support/pkgcheck/src/messages/fatald.rs1
-rw-r--r--support/pkgcheck/src/messages/informationd.rs1
-rw-r--r--support/pkgcheck/src/messages/mod.rs76
-rw-r--r--support/pkgcheck/src/messages/warningsd.rs19
-rw-r--r--support/pkgcheck/src/recode.rs4
-rw-r--r--support/pkgcheck/src/utils.rs46
-rw-r--r--support/sqltex/Makefile.am (renamed from support/SQLTeX/Makefile.am)0
-rw-r--r--support/sqltex/Makefile.in (renamed from support/SQLTeX/Makefile.in)42
-rw-r--r--support/sqltex/README.md (renamed from support/SQLTeX/README.md)60
-rw-r--r--support/sqltex/aclocal.m4 (renamed from support/SQLTeX/aclocal.m4)71
-rw-r--r--support/sqltex/aclocal/ax_prog_perl_modules.m4 (renamed from support/SQLTeX/aclocal/ax_prog_perl_modules.m4)0
-rwxr-xr-xsupport/sqltex/configure (renamed from support/SQLTeX/configure)1134
-rw-r--r--support/sqltex/configure.ac (renamed from support/SQLTeX/configure.ac)11
-rw-r--r--support/sqltex/doc/Makefile.am (renamed from support/SQLTeX/doc/Makefile.am)1
-rw-r--r--support/sqltex/doc/Makefile.in (renamed from support/SQLTeX/doc/Makefile.in)43
-rw-r--r--support/sqltex/doc/SQLTeX.pdfbin0 -> 311719 bytes
-rw-r--r--support/sqltex/doc/SQLTeX.tex (renamed from support/SQLTeX/doc/SQLTeX.tex)247
-rwxr-xr-xsupport/sqltex/install-sh (renamed from support/SQLTeX/install-sh)181
-rw-r--r--support/sqltex/man/Makefile.am16
-rw-r--r--support/sqltex/man/Makefile.in (renamed from support/SQLTeX/man/Makefile.in)51
-rw-r--r--support/sqltex/man/sqltex.man (renamed from support/SQLTeX/man/SQLTeX.man)30
-rwxr-xr-xsupport/sqltex/missing (renamed from support/SQLTeX/missing)16
-rw-r--r--support/sqltex/src/Makefile.am30
-rw-r--r--support/sqltex/src/Makefile.in (renamed from support/SQLTeX/src/Makefile.in)66
-rw-r--r--support/sqltex/src/SQLTeX.cfg (renamed from support/SQLTeX/src/SQLTeX.cfg)35
-rw-r--r--support/sqltex/src/SQLTeX_r.dat101
-rwxr-xr-x[-rw-r--r--]support/sqltex/src/sqltex (renamed from support/SQLTeX/src/SQLTeX.pl)669
-rw-r--r--support/texlab/CHANGELOG.md40
-rw-r--r--support/texlab/Cargo.lock139
-rw-r--r--support/texlab/crates/base-db/Cargo.toml8
-rw-r--r--support/texlab/crates/base-db/src/config.rs54
-rw-r--r--support/texlab/crates/base-db/src/deps/graph.rs87
-rw-r--r--support/texlab/crates/base-db/src/deps/root.rs4
-rw-r--r--support/texlab/crates/base-db/src/document.rs17
-rw-r--r--support/texlab/crates/base-db/src/semantics/auxiliary.rs2
-rw-r--r--support/texlab/crates/base-db/src/semantics/tex.rs123
-rw-r--r--support/texlab/crates/base-db/src/workspace.rs2
-rw-r--r--support/texlab/crates/bibfmt/src/lib.rs6
-rw-r--r--support/texlab/crates/bibtex-utils/Cargo.toml6
-rw-r--r--support/texlab/crates/citeproc/Cargo.toml4
-rw-r--r--support/texlab/crates/commands/Cargo.toml14
-rw-r--r--support/texlab/crates/commands/src/dep_graph.rs1
-rw-r--r--support/texlab/crates/commands/src/find_envs.rs2
-rw-r--r--support/texlab/crates/commands/src/fwd_search.rs2
-rw-r--r--support/texlab/crates/commands/src/placeholders.rs2
-rw-r--r--support/texlab/crates/completion-data/Cargo.toml10
-rw-r--r--support/texlab/crates/completion/Cargo.toml3
-rw-r--r--support/texlab/crates/completion/src/lib.rs8
-rw-r--r--support/texlab/crates/completion/src/providers/argument.rs2
-rw-r--r--support/texlab/crates/completion/src/providers/color.rs2
-rw-r--r--support/texlab/crates/completion/src/providers/color_model.rs2
-rw-r--r--support/texlab/crates/completion/src/providers/command.rs4
-rw-r--r--support/texlab/crates/completion/src/providers/environment.rs6
-rw-r--r--support/texlab/crates/completion/src/providers/glossary.rs2
-rw-r--r--support/texlab/crates/completion/src/providers/import.rs8
-rw-r--r--support/texlab/crates/completion/src/providers/include.rs6
-rw-r--r--support/texlab/crates/completion/src/providers/label_ref.rs46
-rw-r--r--support/texlab/crates/completion/src/providers/tikz_library.rs2
-rw-r--r--support/texlab/crates/completion/src/tests.rs213
-rw-r--r--support/texlab/crates/definition/Cargo.toml4
-rw-r--r--support/texlab/crates/definition/src/command.rs12
-rw-r--r--support/texlab/crates/definition/src/tests.rs2
-rw-r--r--support/texlab/crates/diagnostics/Cargo.toml8
-rw-r--r--support/texlab/crates/diagnostics/src/chktex.rs2
-rw-r--r--support/texlab/crates/diagnostics/src/citations.rs6
-rw-r--r--support/texlab/crates/diagnostics/src/manager.rs10
-rw-r--r--support/texlab/crates/diagnostics/src/tests.rs4
-rw-r--r--support/texlab/crates/distro/Cargo.toml4
-rw-r--r--support/texlab/crates/distro/src/language.rs2
-rw-r--r--support/texlab/crates/highlights/src/lib.rs2
-rw-r--r--support/texlab/crates/hover/src/lib.rs12
-rw-r--r--support/texlab/crates/inlay-hints/Cargo.toml2
-rw-r--r--support/texlab/crates/inlay-hints/src/label.rs1
-rw-r--r--support/texlab/crates/ipc/Cargo.toml8
-rw-r--r--support/texlab/crates/line-index/Cargo.toml2
-rw-r--r--support/texlab/crates/parser/Cargo.toml8
-rw-r--r--support/texlab/crates/parser/src/bibtex.rs54
-rw-r--r--support/texlab/crates/parser/src/bibtex/tests.rs277
-rw-r--r--support/texlab/crates/parser/src/build_log.rs2
-rw-r--r--support/texlab/crates/parser/src/config.rs26
-rw-r--r--support/texlab/crates/parser/src/file_list.rs44
-rw-r--r--support/texlab/crates/parser/src/latex/lexer/types.rs49
-rw-r--r--support/texlab/crates/parser/src/latexmkrc.rs8
-rw-r--r--support/texlab/crates/parser/src/lib.rs6
-rw-r--r--support/texlab/crates/parser/src/util.rs52
-rw-r--r--support/texlab/crates/references/Cargo.toml2
-rw-r--r--support/texlab/crates/references/src/command.rs2
-rw-r--r--support/texlab/crates/references/src/entry.rs4
-rw-r--r--support/texlab/crates/references/src/label.rs2
-rw-r--r--support/texlab/crates/rename/Cargo.toml3
-rw-r--r--support/texlab/crates/rename/src/command.rs7
-rw-r--r--support/texlab/crates/rename/src/entry.rs4
-rw-r--r--support/texlab/crates/rename/src/label.rs47
-rw-r--r--support/texlab/crates/rename/src/lib.rs30
-rw-r--r--support/texlab/crates/rename/src/tests.rs111
-rw-r--r--support/texlab/crates/symbols/Cargo.toml4
-rw-r--r--support/texlab/crates/symbols/src/document.rs1
-rw-r--r--support/texlab/crates/syntax/Cargo.toml3
-rw-r--r--support/texlab/crates/syntax/src/file_list.rs10
-rw-r--r--support/texlab/crates/syntax/src/lib.rs1
-rw-r--r--support/texlab/crates/texlab/Cargo.toml22
-rw-r--r--support/texlab/crates/texlab/src/features/folding.rs2
-rw-r--r--support/texlab/crates/texlab/src/features/formatting.rs3
-rw-r--r--support/texlab/crates/texlab/src/features/rename.rs2
-rw-r--r--support/texlab/crates/texlab/src/main.rs1
-rw-r--r--support/texlab/crates/texlab/src/server.rs20
-rw-r--r--support/texlab/crates/texlab/src/server/extensions.rs28
-rw-r--r--support/texlab/crates/texlab/src/server/options.rs7
-rw-r--r--support/texlab/crates/texlab/src/util.rs61
-rw-r--r--support/texlab/crates/texlab/src/util/client_flags.rs6
-rw-r--r--support/texlab/crates/texlab/src/util/from_proto.rs80
-rw-r--r--support/texlab/crates/texlab/src/util/to_proto.rs11
-rw-r--r--support/texlab/texlab.14
-rw-r--r--support/texlab/texlab.pdfbin26307 -> 26472 bytes
-rw-r--r--support/texlogfilter/README7
-rwxr-xr-xsupport/texlogfilter/texlogfilter17
-rw-r--r--support/texlogfilter/texlogfilter.html7
-rw-r--r--support/texplate/README.md75
-rw-r--r--support/texplate/doc/texplate-manual.pdfbin105290 -> 105697 bytes
-rw-r--r--support/texplate/doc/texplate-manual.tex20
-rw-r--r--support/texshop/README.txt2
-rw-r--r--support/texshop/texshop533.html29
-rw-r--r--support/texshop/texshop544.html30
303 files changed, 9602 insertions, 10082 deletions
diff --git a/support/SQLTeX/doc/SQLTeX.pdf b/support/SQLTeX/doc/SQLTeX.pdf
deleted file mode 100644
index 5b8d934189..0000000000
--- a/support/SQLTeX/doc/SQLTeX.pdf
+++ /dev/null
Binary files differ
diff --git a/support/SQLTeX/man/Makefile.am b/support/SQLTeX/man/Makefile.am
deleted file mode 100644
index 26b80bc375..0000000000
--- a/support/SQLTeX/man/Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-# Automake makefile for the linux manpage
-
-.PHONY: all distdir
-DISTFILES = Makefile.am Makefile.in SQLTeX.man
-
-all :
-
-SQLTeX.1 : SQLTeX.man
- cat $^ | sed -e 's#{BINDIR}#$(bindir)#;s#{SYSCONFDIR}#$(sysconfdir)#' > $@
-
-distdir : ${DISTFILES}
- cp ${DISTFILES} $(distdir)
-
-install: SQLTeX.1
- cp $^ ${mandir}/man1
diff --git a/support/SQLTeX/src/Makefile.am b/support/SQLTeX/src/Makefile.am
deleted file mode 100644
index b8194eeba5..0000000000
--- a/support/SQLTeX/src/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-# Automake makefile for the SQLTeX code and configfiles
-
-.PHONY: distdir
-DATAFILES = SQLTeX_r.dat SQLTeX.cfg
-DISTFILES = Makefile.am Makefile.in SQLTeX.pl ${DATAFILES}
-
-PL=$(shell which perl)
-
-all : SQLTeX
-
-distdir : ${DISTFILES}
- cp $(DISTFILES) $(distdir)
-
-SQLTeX: SQLTeX.pl
- cat $^ | sed -e 's#{PERLDIR}#!$(PL)#;s#{SYSCONFDIR}#$(sysconfdir)#' > $@
- @chmod +x $@
-
-install : SQLTeX ${DATAFILES}
- @cp $< $(bindir)
- @cp $(DATAFILES) $(sysconfdir)
diff --git a/support/SQLTeX/src/SQLTeX_r.dat b/support/SQLTeX/src/SQLTeX_r.dat
deleted file mode 100644
index c4f56bda08..0000000000
--- a/support/SQLTeX/src/SQLTeX_r.dat
+++ /dev/null
@@ -1,29 +0,0 @@
-; This file contains all characters or character sequences that
-; will be be replaced by SQLTeX when the occur in the response
-; of an SQL query.
-; It is mainly used for escaping the (La)TeX special characters,
-; but any value can be added here.
-; The first column is the character (sequence) that will be replaced.
-; The second column is the value to replace col 1 with.
-; Columns are sepated with one or more tab- characters.
-;
-; Note all values are case sensitive; if you add the line:
-; LaTeX \LaTeX\
-; the word "latex" will be untouched, but "LaTeX" will be replaced.
-;
-; To replace using regular expressions, use 're(<regular expression>)' as key (or any other
-; regexp indicator if that has been changed in the config file), e.g.
-; re(<p\.*?>) \paragraph*{}
-; will replace all HTML <p> variants (<p style='font-size: normal'>, <p align='center'> etc)
-;
-$ \$
-_ \_
-% \%
-& \&
-< \texttt{<}
-> \texttt{>}
-{ \{
-} \}
-# \#
-~ \~{}
-\ \ensuremath{\backslash}
diff --git a/support/TeX4ht/source/ChangeLog b/support/TeX4ht/source/ChangeLog
index ccd09bba95..0efdd8bc4f 100644
--- a/support/TeX4ht/source/ChangeLog
+++ b/support/TeX4ht/source/ChangeLog
@@ -1,3 +1,193 @@
+2024-09-11 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): prevent insertion of
+ spaces after \begin and \end in \VerbMath.
+
+2024-09-10 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): use \detokenize again,
+ the alternative method could lead to commands joined with the
+ following text (\int A to \intA).
+
+2024-09-09 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (usepackage.4ht, enumitem-hooks.4ht, enumitem.4ht),
+ * tex4ht-html4.tex (html4.4ht): added support for environments
+ defined using \newlist.
+ https://github.com/michal-h21/make4ht/issues/150
+
+2024-09-03 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-fonts-noncjk.tex (
+ ./tex4ht.dir/texmf/tex4ht/ht-fonts/unicode/bbm/bbm.htf
+ ): added support for the BBM font. Thanks to Arkady Benediktov.
+ * tex4ht-fonts-noncjk.tex (
+ ./tex4ht.dir/texmf/tex4ht/ht-fonts/unicode/TeXvect10/vect10.htf
+ ./tex4ht.dir/texmf/tex4ht/ht-fonts/unicode/TeXvect10/vect.htf
+ ): fixed Esvect fonts characters. Thanks to Arkady Benediktov.
+ * tex4ht-mathml.tex (mathml.4ht): use actual arrow symbol defined in
+ the vect10.htf font.
+
+2024-08-27 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-mathml.tex (mathml.4ht): fixed support of upper case Greek
+ letters inside pictures.
+ https://tex.stackexchange.com/q/725157/2891
+
+2024-08-19 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (moderncv.4ht),
+ * tex4ht-html4.tex (html4.4ht): added support for the Moderncv
+ package.
+ https://tex.stackexchange.com/q/721180/2891
+
+2024-08-13 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (amsfonts.4ht): fixed support for \mathbb and
+ \mathfrak.
+
+ * tex4ht-jats.tex (jats.4ht): added support for LaTeX
+ bibliographies.
+
+2024-08-11 Karl Berry <karl@freefriends.org>
+
+ * tex4ht-mathml.tex (html-mml.4ht): copyright 2024.
+
+2024-08-02 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-mathml.tex (mathml.4ht): added "texsource" option. It will
+ keep the original LaTeX code as an annotation in MathML.
+ https://chat.stackexchange.com/rooms/154333/discussion-on-question-by-yannisl-alternatives-to-mathml-for-pdf-tagging
+
+ * tex4ht-4ht.tex (esvect.4ht),
+ * tex4ht-mathml.tex (mathml.4ht): added support for the Esvect
+ package.
+ https://tex.stackexchange.com/a/723587/2891
+
+2024-07-31 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-fonts-noncjk.tex (
+ ./tex4ht.dir/texmf/tex4ht/ht-fonts/unicode/TeXvect10/vect10.htf
+ ): Added support for the vector font from the Esvect package.
+ https://tex.stackexchange.com/q/723560/2891
+
+2024-07-28 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): don't add spaces after
+ LaTeX commands.
+
+2024-07-26 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (tagpdf-hooks.4ht, tagpdf-base-hooks.4ht): removed
+ \__tag_whatsits definitions, they fix is no longer necessary.
+ https://github.com/michal-h21/make4ht/issues/145#issuecomment-2085215582
+
+2024-07-07 Karl Berry <karl@freefriends.org>
+
+ * Makefile (tex4ht_env_derived),
+ * tex4ht-env.tex: no longer generate tex4ht.env, just
+ .env-unix and .env-win32, since those are the only ones we use.
+
+2024-07-06 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-html4.tex (html4.4ht): added itemize+ option. It will keep
+ original characters for itemize bullets.
+ https://tex.stackexchange.com/a/722062/2891
+
+2024-07-03 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (fontawesome5.4ht): use icon name as the alt text.
+
+2024-06-21 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (arydshln.4ht): fixed clash between Colortbl and
+ Arydshln packages.
+ https://tex.stackexchange.com/a/721185/2891
+
+2024-06-23 Karl Berry <karl@freefriends.org>
+
+ * tex4ht-cpright.tex: https for urls.
+
+2024-06-21 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-html4.tex (html4.4ht): don't use picture name as alt in
+ \epsfbox, it can lead to spurious characters in the resulting HTML.
+ Thanks to Rolf Brigola
+
+2024-06-20 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (footmisc.4ht): fixed handling of footnote counter
+ reset.
+ https://tex.stackexchange.com/a/720989/2891
+
+
+2024-06-17 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (tabularray.4ht): updated names of token lists that
+ holds rowspan and colspan.
+ https://tex.stackexchange.com/a/720800/2891
+
+2024-06-15 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (nameref.4ht): use \@currentlabelname if \NR:Title
+ is not set.
+ https://tex.stackexchange.com/a/720647/2891
+
+2024-06-10 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (babel-sty-hooks.4ht): use \ProvideDocumentCommand
+ to define \:babelfont, in order to prevent errors if Babel is used
+ multiple times.
+ https://puszcza.gnu.org.ua/bugs/?626
+
+2024-06-06 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (listings.4ht): fixed error with otherkeywords
+ style.
+ https://tex.stackexchange.com/a/719878/2891
+
+2024-05-28 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-html4.tex (html4.4ht): renamed jurabib cofigurations to
+ jurabook.
+
+ * tex4ht-4ht.tex (jurabook.4ht): fixed footnotes handling in
+ Jurabook.
+ https://github.com/michal-h21/make4ht/issues/148
+
+2024-05-27 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-ooffice.tex (ooffice.4ht): added support for jurabook
+ sections and toc in the ODT format.
+ https://github.com/michal-h21/make4ht/issues/148
+
+ * tex4ht-4ht.tex (jurabook.4ht, juraovw.4ht, juraurtl.4ht),
+ * tex4ht-html4.tex (html4.4ht): added support for custom sectioning
+ commands provided by Jurabook.
+ https://github.com/michal-h21/make4ht/issues/148
+
+2024-05-22 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (imakeidx.4ht): added support for the
+ \indexprologue command.
+ https://tex.stackexchange.com/a/714548/2891
+
+2024-05-20 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (
+ index.4ht, imakeidx.4ht, memoir.4ht, indextools.4ht
+ ): added support for optional argument of \index used inside of
+ \caption.
+ https://tex.stackexchange.com/a/718360/2891
+
+2024-05-10 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (lettrine.4ht): defined more keys supported by the
+ \lettrine command.
+ https://tex.stackexchange.com/a/717883/2891
+ * tex4ht-html4.tex (html4.4ht): moved HTML declarations for the
+ Lettrine package from lettrine.4ht.
+
2024-05-10 Michal Hoftich <michal.h21@gmail.com>
* tex4ht-fonts-noncjk.tex (
diff --git a/support/TeX4ht/source/Makefile b/support/TeX4ht/source/Makefile
index fd6995f4a5..5328185f78 100644
--- a/support/TeX4ht/source/Makefile
+++ b/support/TeX4ht/source/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile 1503 2024-04-18 22:51:03Z karl $
+# $Id: Makefile 1538 2024-07-07 15:55:16Z karl $
# This file is public domain. Originally written 2010, Karl Berry.
# Assumes GNU make.
@@ -138,7 +138,7 @@ tex4ht_docbook_xtpipes_derived = docbook.4xt $(wd)/src/DbUtilities.java
endif
derived += $(tex4ht_env_derived)
-tex4ht_env_derived = tex4ht.env-unix tex4ht.env-win32 tex4ht.env
+tex4ht_env_derived = tex4ht.env-unix tex4ht.env-win32
derived += $(tex4ht_fonts_cjk_derived)
tex4ht_fonts_cjk_derived = \
diff --git a/support/TeX4ht/source/mktex4ht-cnf.tex b/support/TeX4ht/source/mktex4ht-cnf.tex
index 9fdfe40b68..2bddd28013 100644
--- a/support/TeX4ht/source/mktex4ht-cnf.tex
+++ b/support/TeX4ht/source/mktex4ht-cnf.tex
@@ -1,4 +1,4 @@
-% $Id: mktex4ht-cnf.tex 1502 2024-04-18 12:55:56Z michal_h21 $
+% $Id: mktex4ht-cnf.tex 1552 2024-09-09 14:48:03Z michal_h21 $
% Manually-maintained file, listing *.4ht files created by tex4ht-4ht.tex.
% Read by tex4ht-cond4ht.
%
@@ -111,6 +111,9 @@
\AddFile{9}{scrbook}
\AddFile{9}{scrartcl}
\AddFile{9}{scrreprt}
+\AddFile{9}{jurabook}
+\AddFile{9}{juraurtl}
+\AddFile{9}{juraovw}
\AddFile{6}{letter}
\AddFile{9}{elsart}
\AddFile{9}{apa}
@@ -235,8 +238,10 @@
\AddFile{9}{europecv}
\AddFile{9}{resume}
\AddFile{9}{curve}
+\AddFile{9}{moderncv}
\AddFile{9}{vowel}
\AddFile{9}{enumitem}
+\AddFile{9}{enumitem-hooks}
\AddFile{9}{esperanto}
\AddFile{9}{IEEEtran}
\AddFile{9}{enumerate}
@@ -412,4 +417,5 @@
\AddFile{9}{fontawesome5}
\AddFile{9}{mhchem}
\AddFile{9}{chemfig}
+\AddFile{9}{esvect}
% \AddFile{9}{mktex4ht}
diff --git a/support/TeX4ht/source/tex4ht-4ht.tex b/support/TeX4ht/source/tex4ht-4ht.tex
index 8d96fba96d..2bd694407c 100644
--- a/support/TeX4ht/source/tex4ht-4ht.tex
+++ b/support/TeX4ht/source/tex4ht-4ht.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1516 2024-05-09 13:28:51Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1552 2024-09-09 14:48:03Z michal_h21 $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
% Copyright 2009-2024 TeX Users Group
@@ -3487,11 +3487,20 @@ configuration until now. It seems to be useful when we need to inject something
into the environment without messing the existing \`|\ConfigureEnv|
definitions.
+% Michal 2024-06-15
+% I've added use of \a:newlabel{\@currentlabelname} if \NR:Type is empty.
+% It seems to add support for name ref labels that are not supported yet
+% We need to empty \NR:Type after \label. I hope this doesn't break anything.
+% https://tex.stackexchange.com/a/720647/2891
+
\<nameref v.2 configurations\><<<
\let\NR:Type\relax
\let\ltx@label\label
-\def\prf:label{{\ifx \NR:Title\:UnDef \else \NR:Title\fi}%
+\def\prf:label{{\ifx \NR:Title\:UnDef \a:newlabel{\@currentlabelname}\else \NR:Title\fi}%
{\ifx \NR:Type\relax \else \NR:Type .1\fi}{}}%
+
+\append:defI\label{\let\NR:Title\undefined}
+
\let\NR:StartSec\:StartSec
\let\NR:no@sect\no@sect
\def\no@sect#1#2#3#4#5#6[#7]#8{\gdef\NR:Title{\a:newlabel{#7}}%
@@ -4256,18 +4265,19 @@ icons to pictures by TeX4ht conversion.
\<fontawesome5.4ht\><<<
% fontawesome5.4ht (|version), generated from |jobname.tex
-% Copyright 2021 TeX Users Group
+% Copyright 2021-2024 TeX Users Group
|<TeX4ht license text|>
\NewConfigure{fontawesome}{2}
\ExplSyntaxOn
\cs_new_protected:Nn\temp:nn{%
+\def\:fontawesomeicon{#2}% to be used in the alt text
\a:fontawesome%
\o:fontawesome_use_icon:nn:{#1}{#2}
\b:fontawesome}
\HLet\fontawesome_use_icon:nn\temp:nn
\ExplSyntaxOff
-\Configure{fontawesome}{\Picture+{}}{\EndPicture}
+\Configure{fontawesome}{\Picture+[icon: \:fontawesomeicon]{}}{\EndPicture}
\Hinput{fontawesome5}
\endinput
>>> \AddFile{9}{fontawesome5}
@@ -5090,13 +5100,14 @@ as it leads to a fatal error.
\Configure{PackageHooks}{tagpdf.sty}{tagpdf-hooks.4ht}
>>>
+% This is no longer useful, it was fixed in tagpdf code
+% \cs_set_protected:Npn \__tag_whatsits: {}
+
\<tagpdf-hooks.4ht\><<<
% tagpdf-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2022-2024 TeX Users Group
|<TeX4ht license text|>
\ExplSyntaxOn
-% ignore tagpdf's specials
-\cs_set_protected:Npn \__tag_whatsits: {}
\ExplSyntaxOff
\:AtEndOfPackage{%
\RenewDocumentCommand \tagpdfsetup { m }{}
@@ -5108,16 +5119,17 @@ as it leads to a fatal error.
\Configure{PackageHooks}{tagpdf-base.sty}{tagpdf-base-hooks.4ht}
>>>
-This file can be used explicitly, we need to provide the whatsits command
-here as well.
+This file can be used explicitly, we used to provide the whatsits command
+here as well, but it is no longer neeeded.
+
+% ignore tagpdf's specials
+% we use csname, because \ExplSyntaxOn .. Off caused catcode issues
+% \expandafter\def\csname __tag_whatsits:\endcsname{}
\<tagpdf-base-hooks.4ht\><<<
% tagpd-base-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
-% ignore tagpdf's specials
-% we use csname, because \ExplSyntaxOn .. Off caused catcode issues
-\expandafter\def\csname __tag_whatsits:\endcsname{}
\endinput
>>> \AddFile{9}{tagpdf-base-hooks}
@@ -11216,12 +11228,13 @@ compilation errors
\<arydshln.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% arydshln.4ht (|version), generated from |jobname.tex
-% Copyright 2022 TeX Users Group
+% Copyright 2022-2024 TeX Users Group
|<TeX4ht license text|>
% this is a copy of code that arydshln inserts to \@array
\def\:new:array{\adl@everyvbox\everyvbox
\everyvbox{\adl@arrayinit \the\adl@everyvbox \everyvbox\adl@everyvbox}%
- \ifadl@inactive \adl@inactivate \else \adl@activate \fi
+ % this line may lead to errors if the document uses Colortbl:
+ % \ifadl@inactive \adl@inactivate \else \adl@activate \fi
\let\adl@noalign\noalign}
\ifcsname n:@array:\endcsname% if \@array was already patched by TeX4ht
\let\orig:n@array\n:@array:
@@ -11335,7 +11348,7 @@ We need to load the tabularx package, because we use it instead of Tabu for actu
\<tabularray.4ht\><<<
% tabularray.4ht (|version), generated from |jobname.tex
-% Copyright 2022-2023 TeX Users Group
+% Copyright 2022-2024 TeX Users Group
|<TeX4ht license text|>
|<tabularray definitions|>
|<tabularray table and rows|>
@@ -11441,13 +11454,13 @@ for horizontal and vertical alignment, background color and rules.
% find columns that are covered by rowspan and colspan
\xdef\HCol{\@arabic\c@colnum}
\xdef\HRow{\@arabic\c@rownum}
- \xdef\HMultispan{\l__tblr_cell_colspan_tl}
- \xdef\HRowspan{\l__tblr_cell_rowspan_tl}
+ \xdef\HMultispan{\lTblrCellColSpanTl}
+ \xdef\HRowspan{\lTblrCellRowSpanTl}
\let\CellAttributes\@empty
\let\CellStyle\@empty
% calculate ignored cells, if the current cell uses colspan or rowspan
- \int_step_inline:nnn{\c@rownum }{\c@rownum - 1 + \l__tblr_cell_rowspan_tl}{
- \int_step_inline:nnn{\c@colnum }{\c@colnum - 1 + \l__tblr_cell_colspan_tl}{
+ \int_step_inline:nnn{\c@rownum }{\c@rownum - 1 + \lTblrCellRowSpanTl}{
+ \int_step_inline:nnn{\c@colnum }{\c@colnum - 1 + \lTblrCellColSpanTl}{
% the loop always matches the current cell, we must ignore it
\str_if_eq:eeF{\HCol.\HRow}{####1.##1}{%
\cs_gset:cpn{ignoredcell-####1-##1}{}
@@ -12261,6 +12274,13 @@ and print them when it is safe.
\ExplSyntaxOff
>>>
+\<latex caption index optional\><<<
+\ExplSyntaxOn
+\renewcommand\:saveindex[2][]{\seq_gput_right:Nn\:savedindex{[#1]{#2}}}
+\def\:printsavedindex{\seq_map_inline:Nn\:savedindex{\index##1}}
+\ExplSyntaxOff
+>>>
+
\<latex caption index save\><<<
\:initsaveindex%
\let\index\:saveindex%
@@ -16518,6 +16538,7 @@ DIV.right
\<memoir.4ht\><<<
% memoir.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2003. Eitan M. Gurari
+% Copyright 2003-2024 TeX Users Group
|<TeX4ht copywrite|>
\input book.4ht
\input verse.4ht
@@ -16530,6 +16551,7 @@ DIV.right
|<memoir 2008|>
|<mempatch cfg|>
\fi
+|<latex caption index optional|>
\Hinput{memoir}
\endinput
>>> \AddFile{8}{memoir}
@@ -19214,6 +19236,119 @@ UnDFexyz}%
\HtmlEnv \Toc:Title{#1}\:addchap{#2}}
>>>
+%%%%%%%%%%%%%%%%%%
+\Chapter{juramisc}
+%%%%%%%%%%%%%%%%%%
+
+Classes in the Juramisc bundle
+
+\<jurabook.4ht\><<<
+% jurabook.4ht (|version), generated from |jobname.tex
+% Copyright 2024 TeX Users Group
+|<TeX4ht copywrite|>
+|<jurabook subsections|>
+|<jurabook toc|>
+|<jurabook footnotes|>
+\Hinput{jurabook}
+>>> \AddFile{9}{jurabook}
+
+\<juraurtl.4ht\><<<
+% juraurtl.4ht (|version), generated from |jobname.tex
+% Copyright 2024 TeX Users Group
+|<TeX4ht copywrite|>
+\Hinput{juraurtl}
+>>> \AddFile{9}{juraurtl}
+
+\<juraovw.4ht\><<<
+% juraovw.4ht (|version), generated from |jobname.tex
+% Copyright 2024 TeX Users Group
+|<TeX4ht copywrite|>
+\Hinput{juraovw}
+>>> \AddFile{9}{juraovw}
+
+\Section{Jurabook sections}
+
+Jurabook defines lot of extra sectioning commands, so we need to
+define them. Other than that, it reuses classic LaTeX classes, so
+other sectioning commands should work out of the box.
+
+\<jurabook subsections\><<<
+\let\no@subthreesection\subthreesection
+\Def:Section\subthreesection{\ifnum \c:secnumdepth>\c@secnumdepth \else
+ \thesubthreesection \fi}{#1}
+\let\no:subthreesection\subthreesection
+\def\subthreesection{\rdef:sec{subthreesection}}
+
+\let\no@subfoursection\subfoursection
+\Def:Section\subfoursection{\ifnum \c:secnumdepth>\c@secnumdepth \else
+ \thesubfoursection \fi}{#1}
+\let\no:subfoursection\subfoursection
+\def\subfoursection{\rdef:sec{subfoursection}}
+
+\let\no@subfivesection\subfivesection
+\Def:Section\subfivesection{\ifnum \c:secnumdepth>\c@secnumdepth \else
+ \thesubfivesection \fi}{#1}
+\let\no:subfivesection\subfivesection
+\def\subfivesection{\rdef:sec{subfivesection}}
+
+\let\no@subsixsection\subsixsection
+\Def:Section\subsixsection{\ifnum \c:secnumdepth>\c@secnumdepth \else
+ \thesubsixsection \fi}{#1}
+\let\no:subsixsection\subsixsection
+\def\subsixsection{\rdef:sec{subsixsection}}
+
+
+\let\no@subsevensection\subsevensection
+\Def:Section\subsevensection{\ifnum \c:secnumdepth>\c@secnumdepth \else
+ \thesubsevensection \fi}{#1}
+\let\no:subsevensection\subsevensection
+\def\subsevensection{\rdef:sec{subsevensection}}
+
+
+\let\no@subeightsection\subeightsection
+\Def:Section\subeightsection{\ifnum \c:secnumdepth>\c@secnumdepth \else
+ \thesubeightsection \fi}{#1}
+\let\no:subeightsection\subeightsection
+\def\subeightsection{\rdef:sec{subeightsection}}
+>>>
+
+We need to include these sectionins in the TOC
+
+\<jurabook toc\><<<
+\NewConfigure{tableofcontents*}[1]{%
+ \def\:tempa{#1}\ifx\empty\:tempa
+ \ifx \au:StartSec\:UnDef \else \gdef\:StartSec{\au:StartSec}\fi
+ \else
+ \edef\auto:toc{#1}%
+ \ifx \au:StartSec\:UnDef
+ \let\au:StartSec\:StartSec
+ \def\:StartSec{\:tableofcontents
+ \global\let\auto:toc\:UnDef \global\let\:StartSec\au:StartSec\:StartSec}%
+ \append:def\tableofcontents{\gdef\:StartSec{\au:StartSec}}%
+ \fi \fi
+}
+
+\Configure{tableofcontents*}{part,chapter,section,subsection,subsubsection,subthreesection,subfoursection,subfivesection,subsixsection,subsevensection,subeightsection}
+>>>
+
+This code is a copy from jurabook.cls. It rewrites the default version used by
+Jurabook, which starts a list environment. This leads to HTML tag mismatches
+and is unnecessary in general.
+
+The \`'\@makefntext' command will be redefined again in book.4ht, so we don't need to
+insert TeX4ht hooks in this version.
+
+\<jurabook footnotes\><<<
+ \renewcommand{\@makefntext}[1]{%
+ \stepcounter{totalfootnotes}%
+ \renewcommand{\baselinestretch}{\@ne}% (nur) dieses hinzugefuegt fuer einzeilige Ausgabe
+ \parindent 1em%
+ \noindent%
+ \@infootnotetrue%
+ \hb@xt@1.8em{\hss\@makefnmark}#1%
+ \@infootnotefalse}
+>>>
+
%%%%%%%%%%%%%%%%%%%
\Chapter{letter}
%%%%%%%%%%%%%%%%%
@@ -22144,14 +22279,14 @@ $$
\<amsfonts sty\><<<<
\NewConfigure{mathbb}{2}
-\def\:temp#1{{\a:mathbb \o:@mathbb:{#1}\b:mathbb}}
-\HLet\@mathbb\:temp
+\def\:temp#1{{\a:mathbb \o:mathbb:{#1}\b:mathbb}}
+\HLet\mathbb\:temp
>>>
\<amsfonts sty\><<<<
\NewConfigure{mathfrak}{2}
-\def\:temp#1{{\a:mathfrak \o:@mathfrak:{#1}\b:mathfrak}}
-\HLet\@mathfrak\:temp
+\def\:temp#1{{\a:mathfrak \o:mathfrak:{#1}\b:mathfrak}}
+\HLet\mathfrak\:temp
>>>
Commands like \''\rm' need low level implemetation through
@@ -24820,7 +24955,7 @@ Handle circumflex catcodes when the \Verb|early^| option is used.
\<babel-sty-hooks.4ht\><<<
% babel-sty-hooks.4ht, generated from |jobname.tex
-% Copyright 2022 TeX Users Group
+% Copyright 2022-2024 TeX Users Group
|<TeX4ht license text|>
|<disable early sup|>
|<babelfont|>
@@ -24832,7 +24967,7 @@ It can cause fatal errors, because it changes font encodings
and can cause loating of OTF fonts
\<babelfont\><<<
-\NewDocumentCommand\:babelfont{o m o m}{}
+\ProvideDocumentCommand\:babelfont{o m o m}{}
\:AtEndOfPackage{%
% disable \babelfont
@@ -30012,6 +30147,173 @@ A style file for resumes.
>>>
%%%%%%%%%%%%%%%%%%%%%%%%%
+\Section{moderncv}
+%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\<moderncv.4ht\><<<
+% moderncv.4ht (|version), generated from |jobname.tex
+% Copyright 2024 TeX Users Group
+|<TeX4ht license text|>
+|<moderncv configs|>
+\Hinput{moderncv}
+\endinput
+>>>\AddFile{9}{moderncv}
+
+This is a bit messy. We had to redefine a bunch of commands from various
+files that Moderncv uses, mostly to prevent compilation errors and to
+insert some basic formatting.
+
+\<moderncv configs\><<<
+\NewConfigure{section}{2}
+\RenewDocumentCommand\section{sm}{\a:section #2\b:section}
+
+\NewConfigure{subsection}{2}
+\RenewDocumentCommand\subsection{sm}{\a:subsection #2\b:subsection}
+
+
+\NewConfigure{cvitem}{3}
+\renewcommand*{\cvitem}[3][.25em]{
+\a:cvitem #2\b:cvitem #3\c:cvitem
+}
+
+\NewConfigure{cvdoubleitem}{2}
+\renewcommand*{\cvdoubleitem}[5][.25em]{%
+\a:cvdoubleitem
+\cvitem{#2}{#3}
+\cvitem{#4}{#5}
+\b:cvdoubleitem
+}
+
+\NewConfigure{cvlistitem}{2}
+\renewcommand*{\cvlistitem}[2][.25em]{%
+ \a:cvlistitem\cvitem[#1]{\listitemsymbol}{#2}\b:cvlistitem
+}
+
+\NewConfigure{cvlistdoubleitem}{2}
+\renewcommand*{\cvlistdoubleitem}[3][.25em]{%
+ \a:cvlistdoubleitem%
+ \cvitem[#1]{\listitemsymbol}{#2}%
+ \cvitem[#1]{\listitemsymbol}{#3}%
+ \b:cvlistdoubleitem%
+}
+
+\NewConfigure{cvhead}{2}
+\NewConfigure{cvphoto}{2}
+
+
+\renewcommand*{\makecvhead}{%
+ \a:cvhead
+ % recompute lengths (in case we are switching from letter to resume, or vice versa)
+ \recomputecvlengths%
+ % optional detailed information (pre-rendering)
+ \@initializebox{\makecvheaddetailsbox}%
+ \if@details%
+ \def\phonesdetails{}%
+ \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
+ \protected@edef\phonesdetails{\phonesdetails\protect\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
+ \def\socialsdetails{}%
+ \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
+ \protected@edef\socialsdetails{\socialsdetails\protect\makenewline\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
+ \savebox{\makecvheaddetailsbox}{%
+ \addressfont\color{color2}%
+ \if@left\begin{tabular}[b]{@{}r@{}}\fi%
+ \if@right\begin{tabular}[b]{@{}l@{}}\fi%
+ \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
+ \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
+ \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
+ \ifthenelse{\isundefined{\@born}}{}{\makenewline\bornsymbol\@born}%
+ \phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict
+ \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
+ \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httpslink{\@homepage}}%
+ \socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict
+ \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
+ \end{tabular}
+ }\fi%
+ % optional photo (pre-rendering)
+ \@initializebox{\makecvheadpicturebox}%
+ \savebox{\makecvheadpicturebox}{%
+ \ifthenelse{\isundefined{\@photo}}%
+ {}%
+ {%
+ \a:cvphoto\includegraphics[]{\@photo}\b:cvphoto}%
+ }%
+ % name and title (pre-rendering)
+ \@initializelength{\makecvheaddetailswidth}\settowidth{\makecvheaddetailswidth}{\usebox{\makecvheaddetailsbox}}%
+ \@initializelength{\makecvheadpicturewidth}\settowidth{\makecvheadpicturewidth}{\usebox{\makecvheadpicturebox}}%
+ \ifthenelse{\lengthtest{\makecvheadnamewidth=0pt}}% check for dummy value (equivalent to \ifdim\makecvheadnamewidth=0pt)
+ {\setlength{\makecvheadnamewidth}{\textwidth-\makecvheaddetailswidth-\makecvheadpicturewidth}}%
+ {}%
+ \@initializebox{\makecvheadnamebox}%
+ \savebox{\makecvheadnamebox}{%
+ \begin{minipage}[b]{\makecvheadnamewidth}%
+ \if@left\raggedright\fi%
+ \if@right\raggedleft\fi%
+ \namestyle{\@firstname\ \@lastname}%
+ \ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
+ \end{minipage}}%
+ % rendering
+ \if@left%
+ \usebox{\makecvheadnamebox}%
+ \hfill%
+ \llap{\usebox{\makecvheaddetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvheadnamewidth is forced
+ \usebox{\makecvheadpicturebox}\fi%
+ \if@right%
+ \usebox{\makecvheadpicturebox}%
+ \rlap{\usebox{\makecvheaddetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvheadnamewidth is forced
+ \hfill%
+ \usebox{\makecvheadnamebox}\fi%
+ \\[2.5em]%
+ % optional quote
+ \ifthenelse{\isundefined{\@quote}}%
+ {}%
+ {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
+ \b:cvhead\par}% to avoid weird spacing bug at the first section if no blank line is left after \makecvhead
+
+
+\RenewDocumentCommand\cvskilllegend{s +O{.25em} +O{\skillLegend@defaultLevelOne} +O{\skillLegend@defaultLevelTwo} +O{\skillLegend@defaultLevelThree} +O{\skillLegend@defaultLevelFour} +O{\skillLegend@defaultLevelFive} +m}{%
+\begin{tabular}{l l l l l l}
+ \raggedleft\hintstyle{#8} & \cvskill{1}\, & \,{\skillLegend@FontSize #3} & \cvskill{3}\, &\,{\skillLegend@FontSize #5 } \\%
+ %
+ & \cvskill{2}\, & \,\multirow{2}{\cvskilllegend@leftdescriptorwidth}{{\skillLegend@FontSize #4}} & \cvskill{4}\, &\,{\skillLegend@FontSize #6 } \\%
+ %
+ & & & \cvskill{5}\, &\,{\skillLegend@FontSize #7 }%
+ \end{tabular}%
+}%
+
+
+\NewConfigure{cvskill}{2}
+\def\:tempa#1{\def\:cvskillamount{#1}\a:cvskill\o:cvskill:{#1}\b:cvskill}
+\HLet\cvskill\:tempa
+
+\NewConfigure{cvskillhead}{2}
+\NewConfigure{cvskillentry}{2}
+\RenewDocumentCommand\cvskillhead{O{.25em} +O{\skillMatrix@HeaderDefaultOne} +O{\skillMatrix@HeaderDefaultTwo} +O{\skillMatrix@HeaderDefaultThree} +O{\skillMatrix@HeaderDefaultFour}}{%
+ \begingroup
+ \a:cvskillhead
+ \begin{tabular}{ p{6em} p{12em} p{4em} p{20em}}%
+ { #2} & { #3} & { #4} & { #5}
+ \end{tabular}%
+ \b:cvskillhead
+ \endgroup
+ \par\addvspace{#1}
+}
+
+\RenewDocumentCommand\cvskillentry{s +O{.25em} +m +m +m +m +m}{%
+\a:cvskillentry
+\cvitem{#3}{
+ \begin{tabular}{ p{6em} p{12em} p{4em} p{20em}}
+ \centering \cvskill{#4} &\centering {#5} & \centering {#6} &{\itshape#7}%
+ \end{tabular}}%
+ \b:cvskillentry
+ \par\addvspace{#2}
+}
+
+>>>
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Small Ones}
%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -30038,6 +30340,7 @@ A style file for resumes.
% Copyright |CopyYear.2009. Eitan M. Gurari
|<TeX4ht copywrite|>
|<enumitem config|>
+|<enumitem newlist|>
\Hinput{enumitem}
\endinput
>>> \AddFile{9}{enumitem}
@@ -30072,6 +30375,61 @@ See \Link[https://github.com/hendricius/the-sourdough-framework/pull/312]{}{}for
\def\enit@postlabel{}
>>>
+We need to provide a configuration for environments defined using \Verb+\newlist+.
+Because they are defined in the preamble, we must catch them using the early hooks
+file.
+
+The test file and report can be found \Link[https://github.com/michal-h21/make4ht/issues/150]{}{}here\EndLink.
+
+
+\<add to usepackage\><<<
+\Configure{PackageHooks}{enumitem.sty}{enumitem-hooks.4ht}
+>>>
+
+\<enumitem-hooks.4ht\><<<
+% enumitem-hooks.4ht (|version), generated from |jobname.tex
+% Copyright 2024 TeX Users Group
+|<TeX4ht license text|>
+\:AtEndOfPackage{%
+|<enumitem patch newlist|>
+}
+>>> \AddFile{9}{enumitem-hooks}
+
+
+We save all defined environments in \Verb+\enumitem:newlist+. This command
+is then called in the \Verb+\Configure{enumitemnewlist}+, which can
+be used in the output format configuration.
+
+\<enumitem patch newlist\><<<
+\def\enumitem:newlist{}
+\def\:tempa#1#2#3#4{\concat:config\enumitem:newlist{\Configure{enumitemenv}{#2}}\o:enit@newlist{#1}{#2}{#3}{#4}}
+\let\o:enit@newlist\enit@newlist
+\let\enit@newlist\:tempa
+>>>
+
+
+This configuration is called automatically by \Verb+\Configure{enumitenewlist}+ for each
+declared environment. The environment name is saved in \Verb+\a:enumitemenv+,
+and then we call \Verb+\enumitem:newlist+, which should provide a configuration for lists
+in the current output format.
+
+\<enumitem newlist\><<<
+\NewConfigure{enumitemenv}[1]{%
+\def\a:enumitemenv{#1}%
+\enumitem:newlistconfig
+}
+>>>
+
+This configuration should provide a configuration for a list in the current output format.
+Name of the configured environment is saved in \Verb+\a:enumitemenv+.
+
+\<enumitem newlist\><<<
+\NewConfigure{enumitemnewlist}[1]{
+ \def\enumitem:newlistconfig{#1}
+ \enumitem:newlist
+}
+>>>
+
%%%%%%%%%%%%%
\Section{esperanto.sty}
@@ -31275,6 +31633,25 @@ for output formats.
\ExplSyntaxOff
>>>
+%%%%%%%%%%%%%%%
+\Section{Esvect}
+%%%%%%%%%%%%%%%
+
+\<esvect.4ht\><<<
+% esvect.4ht (|version), generated from |jobname.tex
+% Copyright 2024 TeX Users Group
+|<TeX4ht license text|>
+|<esvect redefinitions|>
+
+\Hinput{esvect}
+\endinput
+>>> \AddFile{9}{esvect}
+
+
+\<esvect redefinitions\><<<
+>>>
+
+
%%%%%%%%%%%%%
\Section{Ushort}
%%%%%%%%%%%%%
@@ -32413,6 +32790,7 @@ not necessary in MathML anyway.
\<index.4ht\><<<
% index.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1999. Eitan M. Gurari
+% Copyright 2024 TeX Users Group
|<TeX4ht copywrite|>
|<index shared|>
\expandafter\ifx \csname @vwritefile\endcsname\relax
@@ -32420,6 +32798,7 @@ not necessary in MathML anyway.
\else
|<index 3.02|>
\fi
+|<latex caption index optional|>
\Hinput{index}
\endinput
>>> \AddFile{7}{index}
@@ -32519,11 +32898,11 @@ multind.sty\EndLink
\<imakeidx.4ht\><<<
% imakeidx.4ht (|version), generated from |jobname.tex
-% Copyright 2019-2022 TeX Users Group
+% Copyright 2019-2024 TeX Users Group
|<TeX4ht license text|>
|<imakeidx.sty|>
-
+|<latex caption index optional|>
\Hinput{imakeidx}
\endinput
@@ -32558,10 +32937,10 @@ destination to the idx file
\fi
>>>
-Support for the intoc option of Imakeidx:
+Support for the intoc option of Imakeidx and the \`'\indexprologue' command.
\<imakeidx.sty\><<<
-\Configure{@begin}{theindex}{\ind:defs\imki@maybeaddtotoc}
+\Configure{@begin}{theindex}{\ind:defs\imki@maybeaddtotoc\imki@idxprologue\global\let\imki@idxprologue\relax}
>>>
Prevent the automatic index compilation, the index produced by tex4ht
@@ -32588,11 +32967,12 @@ d|<haddr prefix|>\last:haddr
\<indextools.4ht\><<<
% indextools.4ht (|version), generated from |jobname.tex
-% Copyright 2022 TeX Users Group
+% Copyright 2022-2024 TeX Users Group
|<TeX4ht license text|>
|<indextools index|>
|<indextools defs|>
|<indextools disable options|>
+|<latex caption index optional|>
\Hinput{indextools}
\endinput
@@ -33218,10 +33598,17 @@ content.
\NewConfigure{listings-init}{2}
>>>
+Use the TextStyle hook to insert markup for inline listings. This hook can
+be used also in other contexts, so we need to execute it conditionally,
+based on the \Verb|\lst@ifmode| condition.
+See \Link[https://tex.stackexchange.com/q/719828/2891]{}{}for example\EndLink.
+
\<listings sty\><<<
\lst@AddToHook{TextStyle}{%
\Configure{listings}{}{}{}{}%
- \a:lstinline \bgroup \aftergroup\b:lstinline\aftergroup\egroup
+ \lst@ifmode\else%
+ \a:lstinline \bgroup \aftergroup\b:lstinline\aftergroup\egroup%
+ \fi%
}
\NewConfigure{lstinline}{2}
>>>
@@ -34954,7 +35341,7 @@ but fatal error is a worse possibility.
% Lettrine
\<lettrine.4ht\><<<
% lettrine.4ht (|version), generated from |jobname.tex
-% Copyright 2012-2018 TeX Users Group
+% Copyright 2012-2024 TeX Users Group
|<TeX4ht license text|>
|<config lettrine|>
\Hinput{lettrine}
@@ -34963,10 +35350,24 @@ but fatal error is a worse possibility.
\<config lettrine\><<<
\NewConfigure{lettrine}{7}
+\NewConfigure{lettrinechar}{2}
\define@key{L}{ante}{\def\LH:ante{#1}}%
\define@key{L}{findent}{\def\LH:findent{#1}}%
\define@key{L}{lhang}{\def\LH:lhang{#1}}%
\define@key{L}{lines}{\def\LH:lines{#1}}%
+\define@key{L}{slope}{}
+\define@key{L}{depth}{}
+\define@key{L}{loversize}{}
+\define@key{L}{lraise}{}
+\define@key{L}{nindent}{}
+\define@key{L}{novskip}{}
+\define@key{L}{image}{}
+\define@key{L}{grid}{}
+\define@key{L}{realheight}{}
+\define@key{L}{refstring}{}
+\define@key{L}{refstring}{}
+\define@key{L}{optionsfile}{}
+
\def\reset:LH:keys{\let\LH:ante\@empty
\def\LH:lines{2}%
\def\LH:lhang{0}%
@@ -34979,48 +35380,9 @@ but fatal error is a worse possibility.
\a:lettrine
\ifx\LH:ante\@empty\else\f:lettrine\LH:ante\g:lettrine\fi
\c:lettrine
- \HCode{<span class="lettrine-}#2\HCode{">}#2\HCode{</span>}
+ \a:lettrinechar#2\b:lettrinechar
\b:lettrine\d:lettrine#3\e:lettrine
\reset:LH:keys}
-%
-% a: before lettrine
-% b: after lettrine
-% c: before letter
-% d: between letter and string
-% e: after string
-% f: before ante
-% g: after ante
-%
-\Configure{lettrine}
- {\HCode{<span class="lettrine">}}
- {\HCode{</span>}}
-%
- {\HCode{<span class="lettrine-letter">}}
- {\HCode{</span><span class="lettrine-line">}}
- {\HCode{</span>}}
-%
- {\HCode{<span class="lettrine-ante">}}
- {\HCode{</span>}}
-%
-% Define default Css
-%
-\Css{.lettrine{float: left;
- line-height: 0.7; margin-left: -0.1em;
- margin-bottom: -.5em; margin-right: 0.2em;
- }}
-\Css{.lettrine-ante{vertical-align: top;}}
-\Css{.lettrine-letter{font-style: normal;
- font-size: 4em; color: gray;}}
-%
-\Css{.lettrine-A{margin-right: 0.3em;}}
-\Css{.lettrine-A + .lettrine-line{margin-left: -0.4em;}}
-\Css{.lettrine-J{line-height: 1; margin-right: 0;}}
-\Css{.lettrine-H, .lettrine-I, .lettrine-N, .lettrine-U{margin-right: 0;}}
-\Css{.lettrine-V{margin-right: -0.3em;}}
-\Css{.lettrine-V + .lettrine-line{margin-left: 0.3em;}}
-\Css{.lettrine-Q{padding-bottom: 1em;margin-top: -0.6em;}}
-\Css{.lettrine-line{font-variant: small-caps;}}
-\Css{p.indent{text-indent: 0em;}}
>>>
\Section{osudeG.sty}
@@ -37784,9 +38146,39 @@ Use
\<footmisc.4ht\><<<
% footmisc.4ht (|version), generated from |jobname.tex
-% Copyright 2019 TeX Users Group
+% Copyright 2019-2024 TeX Users Group
|<TeX4ht license text|>
+|<footmisc footnote counter|>
+|<footmisc footnotetext|>
+|<footmisc symbols|>
+
+
+\Hinput{footmisc}
+\endinput
+>>> \AddFile{9}{footmisc}
+
+Footmisc can reset the normal footnote counter on every page. Footnote links are
+then wrong, as they point to an earlier footnote. My solution is to use a global
+counter that gives each footnote unique number and which doesn't rely on the footnote
+symbol.
+
+\<footmisc footnote counter\><<<
+\newcounter{:footnotes}
+
+\def\FNnum{\the\:footnotes}
+
+\HRestore\footnote
+
+\def\:tempc{%
+ \HAssign\FNnum = \csname c@:footnotes\endcsname%
+ \stepcounter{:footnotes}%
+ \HAdvance\FNnum by 1%
+ \o:footnote:%
+}
+\HLet\footnote=\:tempc
+>>>
+\<footmisc footnotetext\><<<
\long\def\@footnotetext#1{\leavevmode
\vbox{%\IgnorePar
\leftskip0pt {\ht:everypar{}\parindent0pt\leavevmode}%
@@ -37805,6 +38197,9 @@ Use
\color@endgroup
\ht:special{t4ht@[}}\ht:special{t4ht@]}}
+>>>
+
+\<footmisc symbols\><<<
% detect if the symbol or symbol* option were used
% we can detect that by testing of \thefootnote macro
@@ -37821,10 +38216,7 @@ Use
\newcommand\p@footmisc@footnote[1]{\p@footnote{#1}}
\fi
\fi
-
-\Hinput{footmisc}
-\endinput
->>> \AddFile{9}{footmisc}
+>>>
%%%%%%%%%%%%%%%
\Section{tablefootnote}
diff --git a/support/TeX4ht/source/tex4ht-cpright.tex b/support/TeX4ht/source/tex4ht-cpright.tex
index 3527690921..c15155fcc5 100644
--- a/support/TeX4ht/source/tex4ht-cpright.tex
+++ b/support/TeX4ht/source/tex4ht-cpright.tex
@@ -4,14 +4,14 @@
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or (at your option) any
% later version. The latest version of this license is in
-% http://www.latex-project.org/lppl.txt
+% https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions
% of LaTeX version 2005/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work
-% is the TeX4ht Project <http://tug.org/tex4ht>.
+% is the TeX4ht Project <https://tug.org/tex4ht>.
%
% If you modify this program, changing the
% version identification would be appreciated.>>>
diff --git a/support/TeX4ht/source/tex4ht-env.tex b/support/TeX4ht/source/tex4ht-env.tex
index 5d66aa43d0..3ac0f4443d 100644
--- a/support/TeX4ht/source/tex4ht-env.tex
+++ b/support/TeX4ht/source/tex4ht-env.tex
@@ -1,8 +1,8 @@
-% $Id: tex4ht-env.tex 1419 2023-12-11 23:23:52Z karl $
+% $Id: tex4ht-env.tex 1538 2024-07-07 15:55:16Z karl $
% latex tex4ht-env
% or htlatex tex4ht-env "xhtml,3"
%
-% Copyright 2009-2023 TeX Users Group
+% Copyright 2009-2024 TeX Users Group
% Copyright 1997-2009 Eitan M. Gurari
% Released under LPPL 1.3c+.
% See tex4ht-cpright.tex for license text.
@@ -1650,27 +1650,30 @@ Note: the permission option `S' takes into account also trailing spaces.
\<unix copyright\><<<
% tex4ht.env-unix (@version), generated from @jobname.tex
-% (can be used as ~/.tex4ht)
-% Copyright 2009-2023 TeX Users Group
+% Copyright 2009-2024 TeX Users Group
% Copyright @CopyYear.1997. Eitan M. Gurari
@<TeX4ht copyright@>>>>
\<private copyright\><<<
% tex4ht.env (private) (@version), generated from @jobname.tex
% (can be used as ~/.tex4ht)
-% Copyright 2009-2023 TeX Users Group
+% Copyright 2009-2024 TeX Users Group
% Copyright @CopyYear.1997. Eitan M. Gurari
@<TeX4ht copyright@>>>>
\<win32 copyright\><<<
% tex4ht.env-win32 (@version), generated from @jobname.tex
-% Copyright 2009-2023 TeX Users Group
+% Copyright 2009-2024 TeX Users Group
% Copyright @CopyYear.1997. Eitan M. Gurari
@<TeX4ht copyright@>>>>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\OutputCode\<tex4ht\>
+% Let's no longer create tex4ht.env; it's too easy to mistakenly update
+% a system version with it. Post-Eitan, we haven't tried to keep it in
+% sync with the others.
+%\OutputCode\<tex4ht\>
+
\OutputCodE\<tex4ht.env-unix\>
\OutputCodE\<tex4ht.env-win32\>
diff --git a/support/TeX4ht/source/tex4ht-fonts-noncjk.tex b/support/TeX4ht/source/tex4ht-fonts-noncjk.tex
index ae68aa34d5..91e506635d 100644
--- a/support/TeX4ht/source/tex4ht-fonts-noncjk.tex
+++ b/support/TeX4ht/source/tex4ht-fonts-noncjk.tex
@@ -1,8 +1,8 @@
-% $Id: tex4ht-fonts-noncjk.tex 1517 2024-05-10 11:27:42Z michal_h21 $
+% $Id: tex4ht-fonts-noncjk.tex 1551 2024-09-03 22:26:09Z karl $
% tex tex4ht-fonts-noncjk
% or ht tex tex4ht-fonts-noncjk
%
-% Copyright 2009-2023 TeX Users Group
+% Copyright 2009-2024 TeX Users Group
% Copyright 1997-2009 Eitan M. Gurari
% Released under LPPL 1.3c+.
% See tex4ht-cpright.tex for license text.
@@ -24483,6 +24483,168 @@ fplmbb 49 90
+\Section{Esvect}
+
+Font file for the Esvect package.
+
+% writing vect10.htf hash: d9018d0b41b7639bd8c3bf0419c3b8a5
+\<vect10\><<<
+vect10 0 47
+'&#x2192;' '' 0000 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+'&#x2192;' '' 0001 1 %% vect.htf (unicode) %
+'&#x2192;' '' 0002 2 %% generated from vect10.tfm, 2024-07-31-11:51 %
+'&#x2192;' '' 0003 3 %% Copyright 2024 TeX Users Group, Arkady Benediktov %
+'&#x2192;' '' 0004 4 %% %
+'&#x2192;' '' 0005 5 %% This work may be distributed and/or modified under the %
+'&#x2192;' '' 0006 6 %% conditions of the LaTeX Project Public License, either %
+'&#x2192;' '' 0007 7 %% version 1.3c of this license or (at your option) any %
+'&#x2192;' '' 0008 8 %% later version. The latest version of this license is in %
+'&#x0009;' '' 0009 9 %% http://www.latex-project.org/lppl.txt %
+'&#x000A;' '' 000A 10 %% and version 1.3c or later is part of all distributions %
+'&#x000B;' '' 000B 11 %% of LaTeX version 2005/12/01 or later. %
+'&#x000C;' '' 000C 12 %% %
+'&#x000D;' '' 000D 13 %% This work has the LPPL maintenance status "maintained". %
+'&#x000E;' '' 000E 14 %% %
+'&#x000F;' '' 000F 15 %% The Current Maintainer of this work %
+'&#x2192;' '' 0010 16 %% is the TeX4ht Project <http://tug.org/tex4ht>. %
+'&#x2192;' '' 0011 17 %% %
+'&#x2192;' '' 0012 18 %% If you modify this program, changing the %
+'&#x2192;' '' 0013 19 % % version identification would be appreciated. %
+'&#x2192;' '' 0014 20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+'&#x2192;' '' 0015 21
+'&#x2192;' '' 0016 22
+'&#x2192;' '' 0017 23
+'&#x2192;' '' 0018 24
+'&#x0019;' '' 0019 25
+'&#x001A;' '' 001A 26
+'&#x001B;' '' 001B 27
+'&#x001C;' '' 001C 28
+'&#x001D;' '' 001D 29
+'&#x001E;' '' 001E 30
+'&#x001F;' '' 001F 31
+'&#x23AF;' '' 0020 32
+'&#x23AF;' '' 0021 33
+'&#x23AF;' '' 0022 34
+'&#x23AF;' '' 0023 35
+'&#x23AF;' '' 0024 36
+'&#x23AF;' '' 0025 37
+'&#x23AF;' '' 0026 38
+'&#x23AF;' '' 0027 39
+'&#x23AF;' '' 0028 40
+'&#x23AF;' '' 0029 41
+'&#x23AF;' '' 002A 42
+'&#x23AF;' '' 002B 43
+'&#x23AF;' '' 002C 44
+'&#x23AF;' '' 002D 45
+'&#x23AF;' '' 002E 46
+'&#x23AF;' '' 002F 47
+vect10 0 47
+
+
+>>>
+\AddFont{vect10}{unicode/TeXvect10/vect10}{}
+
+\<vect\><<<
+.vect10
+htfcss: vect10 font-family: 'TeXvect10', serif;
+htfcss: vect5 font-family: 'TeXvect10', serif;
+>>>
+
+\AddFont{vect}{unicode/TeXvect10/vect}{}
+
+
+
+\Section{BBM}
+
+\<bbm\><<<
+bbm 8 90 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+'&#x2985;' '' 8 %% bbm.htf (unicode) %
+'&#x2986;' '' 9 %% generated from bbm.tfm, 2024-09-03 %
+'' '1' 10 %% Copyright 2024 TeX Users Group, Arkady Benediktov %
+'' '1' 11 %% %
+'' '1' 12 %% This work may be distributed and/or modified under the %
+'' '1' 13 %% conditions of the LaTeX Project Public License, either %
+'' '1' 14 %% version 1.3c of this license or (at your option) any %
+'' '1' 15 %% later version. The latest version of this license is in %
+'' '1' 16 %% http://www.latex-project.org/lppl.txt %
+'&#x1d7d9;' '' 17 %% and version 1.3c or later is part of all distributions %
+'&#x1d7da;' '' 18 %% of LaTeX version 2005/12/01 or later. %
+'' '1' 19 %% %
+'' '1' 20 %% This work has the LPPL maintenance status "maintained". %
+'' '1' 21 %% %
+'' '1' 22 %% The Current Maintainer of this work %
+'' '1' 23 %% is the TeX4ht Project <http://tug.org/tex4ht>. %
+'' '1' 24 %% %
+'' '1' 25 %% If you modify this program, changing the %
+'' '1' 26 % % version identification would be appreciated. %
+'' '1' 27 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+'' '1' 28
+'' '1' 29
+'' '1' 30
+'' '1' 31
+'' '1' 32
+'&#x1d538;' '' 33
+'&#x1d539;' '' 34
+'&#x2102;' '' 35
+'&#x1d53b;' '' 36
+'&#x1d53c;' '' 37
+'&#x1d53d;' '' 38
+'&#x1d53e;' '' 39
+'&#x210d;' '' 40
+'&#x1d540;' '' 41
+'&#x1d541;' '' 42
+'&#x1d542;' '' 43
+'&#x1d543;' '' 44
+'&#x1d544;' '' 45
+'&#x2115;' '' 46
+'&#x1d546;' '' 47
+'&#x2119;' '' 48
+'&#x211a;' '' 49
+'&#x211d;' '' 50
+'&#x1d54a;' '' 51
+'&#x1d54b;' '' 52
+'&#x1d54c;' '' 53
+'&#x1d54d;' '' 54
+'&#x1d54e;' '' 55
+'&#x1d54f;' '' 56
+'&#x1d550;' '' 57
+'&#x2124;' '' 58
+'&#x27e6;' '' 59
+'' '1' 60
+'&#x27e7;' '' 61
+'' '1' 62
+'' '1' 63
+'' '1' 64
+'&#x1d552;' '' 65
+'&#x1d553;' '' 66
+'&#x1d554;' '' 67
+'&#x1d555;' '' 68
+'&#x1d556;' '' 69
+'&#x1d557;' '' 70
+'&#x1d558;' '' 71
+'&#x1d559;' '' 72
+'&#x1d55a;' '' 73
+'&#x1d55b;' '' 74
+'&#x1d55c;' '' 75
+'&#x1d55d;' '' 76
+'&#x1d55e;' '' 77
+'&#x1d55f;' '' 78
+'&#x1d560;' '' 79
+'&#x1d561;' '' 80
+'&#x1d562;' '' 81
+'&#x1d563;' '' 82
+'&#x1d564;' '' 83
+'&#x1d565;' '' 84
+'&#x1d566;' '' 85
+'&#x1d567;' '' 86
+'&#x1d568;' '' 87
+'&#x1d569;' '' 88
+'&#x1d56a;' '' 89
+'&#x1d56b;' '' 90
+bbm 8 90
+>>>
+
+\AddFont{bbm}{unicode/bbm/bbm}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/support/TeX4ht/source/tex4ht-html4.tex b/support/TeX4ht/source/tex4ht-html4.tex
index 4c591c9b37..60ddfad048 100644
--- a/support/TeX4ht/source/tex4ht-html4.tex
+++ b/support/TeX4ht/source/tex4ht-html4.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-html4.tex 1516 2024-05-09 13:28:51Z michal_h21 $
+% $Id: tex4ht-html4.tex 1552 2024-09-09 14:48:03Z michal_h21 $
% Compile 4 times: latex tex4ht-html4
% Copy html4.4ht into the work directory before all but the last compilation.
%
@@ -2950,6 +2950,22 @@ such a case, we don't have proper nestings of environments.
\EndP\HCode{</li></ul>}\ShowPar}
{\end:itm \global\def\end:itm{\EndP\Tg</li>}\DeleteMark}
{\HCode{<li class="\getClass{li}itemize">}\afterGetClass{li}|<list par|>}
+
+\:CheckOption{itemize+}\if:Option
+\ConfigureList{itemize}%
+ {\EndP\HCode{<ul \a:LRdir
+ class="\getClass{itemize}itemize\expandafter\the
+ \csname @itemdepth\endcsname">}%
+ \afterGetClass{itemize}%
+ |<save end:itm|>\global\let\end:itm=\empty}
+ {|<recall end:itm|>\ifvmode \IgnorePar\fi
+ \EndP\HCode{</li></ul>}\ShowPar}
+ {\end:itm \global\def\end:itm{\EndP\Tg</li>}\HCode{<li class="\getClass{li}itemize"><span class="itemizeHead" aria-hidden="true">}\afterGetClass{li}}
+ {\HCode{</span>}|<list par|>}
+\Css{.itemizeHead{float: left; margin-left: -1em; width: 1em;}}
+\Css{li.itemize{list-style: none;}}
+\fi
+
\NewConfigure{itemizeClass}{2}
\Configure{itemizeClass}{}{}
\NewConfigure{liClass}{2}
@@ -9041,8 +9057,70 @@ The hbox is for avoiding the start of a new paragraph, if in vmode.
+%%%%%%%%%%%%%%%%%%
+\section{juramisc}
+%%%%%%%%%%%%%%%%%%
+
+\<configure html4 jurabook\><<<
+|<jurabook sections|>
+|<jurabook toc|>
+>>>
+
+\<configure html4 juraurtl\><<<
+>>>
+
+\<configure html4 juraovw\><<<
+>>>
+
+\<jurabook sections\><<<
+\Configure{subthreesection}
+ {}{}
+ {\ifvmode\IgnorePar\fi\EndP\HCode{<h5 class="subthreesection">}\TitleMark\space} {\HCode{</h5>}\par\ShowPar}
+\ConfigureMark{subthreesection}{\HCode{<span class="titlemark">}\thesubthreesection\HCode{</span>}}
+\Configure{subfoursection}
+ {}{}
+ {\ifvmode\IgnorePar\fi\EndP\HCode{<h5 class="subfoursection">}\TitleMark\space} {\HCode{</h5>}\par\ShowPar}
+
+\ConfigureMark{subfoursection}{\HCode{<span class="titlemark">}\thesubfoursection\HCode{</span>}}
+
+\Configure{subfivesection}
+ {}{}
+ {\ifvmode\IgnorePar\fi\EndP\HCode{<h5 class="subfivesection">}\TitleMark\space} {\HCode{</h5>}\par\ShowPar}
+
+\ConfigureMark{subfivesection}{\HCode{<span class="titlemark">}\thesubfivesection\HCode{</span>}}
+
+\Configure{subsixsection}
+ {}{}
+ {\ifvmode\IgnorePar\fi\EndP\HCode{<h5 class="subsixsection">}\TitleMark\space} {\HCode{</h5>}\par\ShowPar}
+
+\ConfigureMark{subsixsection}{\HCode{<span class="titlemark">}\thesubsixsection\HCode{</span>}}
+
+
+\Configure{subsevensection}
+ {}{}
+ {\ifvmode\IgnorePar\fi\EndP\HCode{<h5 class="subsevensection">}\TitleMark\space} {\HCode{</h5>}\par\ShowPar}
+
+\ConfigureMark{subsevensection}{\HCode{<span class="titlemark">}\thesubsevensection\HCode{</span>}}
+
+
+\Configure{subeightsection}
+ {}{}
+ {\ifvmode\IgnorePar\fi\EndP\HCode{<h5 class="subeightsection">}\TitleMark\space} {\HCode{</h5>}\par\ShowPar}
+
+\ConfigureMark{subeightsection}{\HCode{<span class="titlemark">}\thesubeightsection\HCode{</span>}}
+>>>
+
+\<jurabook toc\><<<
+\def\tocsubthreesection#1#2#3{\par\toc:num{subthreesection}{#1}{#2}\par}
+\def\tocsubfoursection#1#2#3{\par\toc:num{subfoursection}{#1}{#2}\par}
+\def\tocsubfivesection#1#2#3{\par\toc:num{subfivesection}{#1}{#2}\par}
+\def\tocsubsixsection#1#2#3{\par\toc:num{subsixsection}{#1}{#2}\par}
+\def\tocsubsevensection#1#2#3{\par\toc:num{subsevensection}{#1}{#2}\par}
+\def\tocsubeightsection#1#2#3{\par\toc:num{subeightsection}{#1}{#2}\par}
+
+>>>
%%%%%%%%%%%%%%%%%%
\section{letter}
@@ -13762,7 +13840,7 @@ for margin pars.
\<configure html4 epsf\><<<
\Configure{epsfsetgraph}
- {\Picture+[\PicName]{}}
+ {\Picture+[]{}}
{\EndPicture}
>>>
@@ -15872,6 +15950,51 @@ IE doesn't distinguish between upper and lower case characters in css
>>>
+\section{lettrine.sty}
+
+\<configure html4 lettrine\><<<
+%
+% a: before lettrine
+% b: after lettrine
+% c: before letter
+% d: between letter and string
+% e: after string
+% f: before ante
+% g: after ante
+%
+\Configure{lettrine}
+ {\HCode{<span class="lettrine">}}
+ {\HCode{</span>}}
+%
+ {\HCode{<span class="lettrine-letter">}}
+ {\HCode{</span><span class="lettrine-line">}}
+ {\HCode{</span>}}
+%
+ {\HCode{<span class="lettrine-ante">}}
+ {\HCode{</span>}}
+
+\Configure{lettrinechar}{\HCode{<span class="lettrine-\HlettrineChar">}}{\HCode{</span>}}
+%
+% Define default Css
+%
+\Css{.lettrine{float: left;
+ line-height: 0.7; margin-left: -0.1em;
+ margin-bottom: -.5em; margin-right: 0.2em;
+ }}
+\Css{.lettrine-ante{vertical-align: top;}}
+\Css{.lettrine-letter{font-style: normal;
+ font-size: 4em; color: gray;}}
+%
+\Css{.lettrine-A{margin-right: 0em;}}
+\Css{.lettrine-A + .lettrine-line{margin-left: -0.4em;}}
+\Css{.lettrine-J{line-height: 0.9; margin-right: 0;}}
+\Css{.lettrine-H, .lettrine-I, .lettrine-N, .lettrine-U{margin-right: 0;}}
+\Css{.lettrine-V{margin-right: -0.0em;}}
+\Css{.lettrine-V + .lettrine-line{margin-left: 0.3em;}}
+\Css{.lettrine-Q{line-height: 0.9;padding-bottom: 1em;margin-top: -0.6em;}}
+\Css{.lettrine-line{font-variant: small-caps;}}
+>>>
+
%%%%%%%%%%%%%%%%%%
\section{gmatrix.sty}
@@ -16723,9 +16846,26 @@ Blue = 1-minimum(1,Yellow *(1-Black)+Black)
{\end:itm \global\def\end:itm{\EndP\Tg</dd>}\HCode{<dt
class="enumerate-enumitem">}\bgroup \bf}
{\egroup\EndP\HCode{</dt><dd\Hnewline class="enumerate-enumitem">}}
+
\Css{dl.enumerate-enumitem{display:grid; grid-template-columns: 3ch 1fr; align-items: top; row-gap:1ch;}}
>>>
+Configurations for new list environments.
+
+\<configure html4 enumitem\><<<
+\Configure{enumitemnewlist}{%
+\ConfigureList{\a:enumitemenv}%
+ {\EndP\HCode{<dl \a:LRdir class="enumerate-enumitem enumitem-\a:enumitemenv">}%
+ |<save end:itm|>\global\let\end:itm=\empty}
+ {|<recall end:itm|>\EndP\HCode{</dd></dl>}\ShowPar}
+ {\end:itm \global\def\end:itm{\EndP\Tg</dd>}\HCode{<dt
+ class="enumerate-enumitem enumitem-\a:enumitemenv">}\bgroup \bf}
+ {\egroup\EndP\HCode{</dt><dd\Hnewline class="enumerate-enumitem">}}
+}
+
+
+>>>
+
%%%%%%%%%%%%%
\subsection{IEEEtran}
@@ -17683,6 +17823,45 @@ Blue = 1-minimum(1,Yellow *(1-Black)+Black)
>>>
%%%%%%%%%%%%%%%%%%
+\section{moderncv}
+%%%%%%%%%%%%%%%%%%
+
+\<configure html4 moderncv\><<<
+\Configure{cvhead}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvhead">}}{\ifvmode\IgnorePar\fi\EndP\HCode{</div>}}
+\Configure{cvphoto}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvphoto">}}{\ifvmode\IgnorePar\fi\EndP\HCode{</div>}}
+
+\Configure{section}{\ifvmode\IgnorePar\fi\EndP\HCode{<h2>}}{\HCode{</h2>}}
+\Configure{subsection}{\ifvmode\IgnorePar\fi\EndP\HCode{<h3>}}{\HCode{</h3>}}
+\Configure{cvitem}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvitem"><span class="cvitemhead">}}{\HCode{</span><span class="cvitembody">}}{\HCode{</span></div>}}
+\Configure{cvdoubleitem}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvdoubleitem">}}{\HCode{</div>}}
+\Configure{cvlistitem}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvlistitem">}}{\HCode{</div>}}
+\Configure{cvlistdoubleitem}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvlistdoubleitem">}}{\HCode{</div>}}
+
+\Configure{cvskillhead}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvskillhead">}}{\HCode{</div>}}
+\Configure{cvskillentry}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvskillentry">}}{\HCode{</div>}}
+
+\Configure{cvskill}{\Picture*[skill level: \:cvskillamount]{}}{\EndPicture}
+
+\Css{.cvskillentry .tabular, .cvskillhead .tabular {margin:0pt;}}
+\Css{.cvskillentry .tabular td:nth-child(1), .cvskillhead .tabular td:nth-child(1){width: 8ch}}
+\Css{.cvskillentry .tabular td:nth-child(2), .cvskillhead .tabular td:nth-child(2){width: 12ch}}
+\Css{.cvskillentry .tabular td:nth-child(3), .cvskillhead .tabular td:nth-child(3){width: 6ch}}
+\Css{.cvskillentry .tabular td:nth-child(4), .cvskillhead .tabular td:nth-child(4){width: 54ch}}
+
+\Css{.cvitemhead{margin-right: 1em;}}
+
+\Css{
+@media (min-width:94ch) {
+.cvitemhead{
+ margin-left: -14ch;
+ width: 12ch;
+ float: left;
+ text-align: right;
+ }
+}}
+>>>
+
+%%%%%%%%%%%%%%%%%%
\section{CSS}
%%%%%%%%%%%%%%%%%%
diff --git a/support/TeX4ht/source/tex4ht-jats.tex b/support/TeX4ht/source/tex4ht-jats.tex
index e54de5ad20..16182ba8f5 100644
--- a/support/TeX4ht/source/tex4ht-jats.tex
+++ b/support/TeX4ht/source/tex4ht-jats.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-jats.tex 1473 2024-02-23 12:26:51Z michal_h21 $
+% $Id: tex4ht-jats.tex 1545 2024-08-13 19:02:54Z michal_h21 $
% compile 3 times: latex tex4ht-jats
% or xhlatex tex4ht-jats "html,3,sections+"
%
@@ -201,6 +201,7 @@ Configurations that are shared only for article and report
|<latex footnotes|>
|<latex quotes|>
|<latex lists|>
+|<latex bibliography|>
>>>
\<shared article,report\><<<
@@ -841,6 +842,29 @@ them separatelly.
{\EndNoFonts\HCode{</term><def>}\HtmlParOn|<list par|>}
>>>
+
+We cannot create a structured bibliographic record for plain LaTeX references, so we
+at least mark individual entries.
+
+Entry id is set on the label element. The id comes from a child xref element that is removed
+by make4ht. Ideally, it should be set on ref, but we need to use label here, to catch
+potential entry number.
+
+
+\<latex bibliography\><<<
+\ConfigureList{thebibliography}%
+ {\ifvmode\IgnorePar\fi \EndP \HCode{<ref-list>}\let\en:bib=\empty}
+ {\en:bib \ifvmode\IgnorePar\fi \EndP \HCode{</ref-list>}}
+ {\en:bib\def\en:bib{\HCode{</mixed-citation></ref>}}%
+ \HCode{<ref><label>}%
+ \Configure{HtmlPar}%
+ {\EndP}%
+ {\EndP}%
+ {} {}%
+ }
+ {\HCode{</label><mixed-citation>}}
+>>>
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Packages}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/support/TeX4ht/source/tex4ht-mathjax.tex b/support/TeX4ht/source/tex4ht-mathjax.tex
index 23ca24a586..56c53e3698 100644
--- a/support/TeX4ht/source/tex4ht-mathjax.tex
+++ b/support/TeX4ht/source/tex4ht-mathjax.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-mathjax.tex 1474 2024-02-25 16:27:19Z karl $
+% $Id: tex4ht-mathjax.tex 1554 2024-09-11 13:41:52Z michal_h21 $
% compile: latex tex4ht-mathjax
%
% Copyright 2018-2024 TeX Users Group
@@ -37,12 +37,14 @@ in LaTeX kernel now.
\<required packages\><<<
>>>
-The \verb|\alteqtoks| command saves the used command in HTML. It uses detokenize command
-to insert arguments verbatim. The side effect of this is that detokeize inserts space
+The \verb|\alteqtoks| command prints the used LaTeX math code to the output document in
+verbatim.
+
+In the past, we used \verb|\detokenize|. The side effect of this is that detokeize inserts space
after each control sequence. This is completely valid TeX code, but earlier versions of
MathJax didn't like that, rendering resulted in error.
-Fortunatelly, MathJax 3 supports these spaces, so we can remove regular expressions for space handling.
+Fortunatelly, MathJax 3 supports these spaces, so we could remove regular expressions for space handling.
The original code was this:
% % convert \ { to \:{
@@ -53,7 +55,28 @@ The original code was this:
% \regex_replace_all:nnN { \x{5C} \x{5C} \x{3A} \x{7B} } { \x{5C} \x{5C} \x{20} \x{7B} } \l_tmpa_tl
-We still use regula expressions to escape invalid XML characters to entities, so it works only with LaTeX.
+In July 2024, when I researched another issue, I've found that it is actually possible to avoid these
+extra spaces using LaTeX 3 commands. The inspiration comes from
+\Link[https://tex.stackexchange.com/a/44444/2891]this Bruno Le Foch\EndLink.
+One ongoing issue is that newlines are not presented. But they weren't preserved with \verb|\detokenize|
+either, so it shouldn't be a problem.
+
+In September 2024 I found that the LaTeX 3 method of preserving spaces didn't work correctly for
+code like this: \verb|$\int A f(x)\;dx$| -- the space between \verb|\int| and \verb|A| was removed,
+so it ended like command \verb|\intA|. So we are moving back to \verb|\detokenize|.
+
+This is the code that was promising, but didn't work in the end:
+
+\begin{verbatim}
+ % save tokens, but preserve spaces
+ % https://tex.stackexchange.com/a/44444/2891
+ \tl_set:Nn \l_tmpa_tl {#1}
+ \regex_replace_all:nnN { . } { \c{string} \0 } \l_tmpa_tl
+ \tl_set:Nx \l_tmpa_tl { \l_tmpa_tl }
+\end{verbatim}
+
+
+We still use regular expressions to escape invalid XML characters to entities, so it works only with LaTeX.
\<defined commands\><<<
\ExplSyntaxOn
@@ -109,9 +132,9 @@ environments. They will then keep the LaTeX code unchanged.
\long\def\AltlDisplayDollars#1$${\alteqtoks{\[#1\]}$$}
\newcommand\VerbMathToks[2]{%
- \alteqtoks{\begin{#2}
- #1
- \end{#2}}%
+ \HCode{\string\begin{#2}}%
+ \alteqtoks{#1}%
+ \HCode{\string\end{#2}}%
}
>>>
diff --git a/support/TeX4ht/source/tex4ht-mathml.tex b/support/TeX4ht/source/tex4ht-mathml.tex
index e7f496d6bf..8c294f48b7 100644
--- a/support/TeX4ht/source/tex4ht-mathml.tex
+++ b/support/TeX4ht/source/tex4ht-mathml.tex
@@ -1,8 +1,8 @@
-% $Id: tex4ht-mathml.tex 1495 2024-03-21 16:39:31Z michal_h21 $$
+% $Id: tex4ht-mathml.tex 1551 2024-09-03 22:26:09Z karl $$
% compile 3 times: latex tex4ht-mathltx
% or xhlatex tex4ht-mathltx "html,3,sections+"
%
-% Copyright 2009-2023 TeX Users Group
+% Copyright 2009-2024 TeX Users Group
% Copyright 1999-2009 Eitan M. Gurari
% Released under LPPL 1.3c+.
% See tex4ht-cpright.tex for license text.
@@ -584,7 +584,7 @@ in italic and without space that would separate it from the following element.
\<html-mml\><<<
% html-mml.4ht (|version), generated from |jobname.tex
-% Copyright 2009-2022 TeX Users Group
+% Copyright 2009-2024 TeX Users Group
% Copyright |CopyYear.1999. Eitan M. Gurari
|<TeX4ht copywrite|>
>>>
@@ -1939,6 +1939,189 @@ primes.
\fi
>>>
+
+We may want to include LaTeX source as an annotation in MathML. In particular LaTeX PDF tagging code can use
+this feature. We will not use it by default, but only with texsource option, as it can potentially
+break some functionality.
+
+The code is based on the LaTeX MathJax code, but heavily modified.
+
+\<configure html-mml latex\><<<
+\:CheckOption{texsource}\if:Option
+
+\newtoks\mmleqtoks
+\ExplSyntaxOn
+\cs_new_protected:Npn \mmlalteqtoks #1
+{
+ % save tokens, but preserve spaces
+ % https://tex.stackexchange.com/a/44444/2891
+ \tl_set:Nn \l_tmpa_tl {#1}
+ \regex_replace_all:nnN { . } { \c{string} \0 } \l_tmpa_tl
+ \tl_set:Nx \l_tmpa_tl { \l_tmpa_tl }
+ % % replace < > and & with xml entities
+ \regex_replace_all:nnN { \x{26} } { &amp; } \l_tmpa_tl
+ \regex_replace_all:nnN { \x{3C} } { &lt; } \l_tmpa_tl
+ \regex_replace_all:nnN { \x{3E} } { &gt; } \l_tmpa_tl
+ % \regex_replace_all:nnN { \n } {\HCode{ \Hnewline }} \l_tmpa_tl
+ % replace \par command with blank lines
+ \regex_replace_all:nnN { \x{5C}par\b } {\x{A}\x{A}} \l_tmpa_tl
+ \tl_set:Nx \mmleqtoks{ \l_tmpa_tl }
+
+ %\HCode{\l_tmpb_tl}
+}
+\ExplSyntaxOff
+
+
+\def\AltMath#1${\mmlalteqtoks{#1}%
+ #1\HCode{</\a:mathml mrow><\a:mathml annotation encoding="application/x-tex">\mmleqtoks</\a:mathml annotation>}$}
+\Configure{$}{\Configure{@math}{display="inline"}\DviMath\HCode{<\a:mathml semantics><\a:mathml mrow>}}{\HCode{</\a:mathml semantics>}\EndDviMath}{\expandafter\AltMath}
+
+\def\AltMathParen#1\){\mmlalteqtoks{#1}%
+ #1\HCode{</\a:mathml mrow><a\a:mathml nnotation encoding="application/x-tex">\mmleqtoks</\a:mathml annotation>}$}
+
+\def\AltMathParen#1\){\mmlalteqtoks{#1}#1\HCode{</\a:mathml mrow><\a:mathml annotation encoding="application/x-tex">\mmleqtoks</\a:mathml annotation>}\)}
+%\Configure{()}{\Configure{@math}{display="inline"}\DviMath\HCode{<\a:mathml semantics><\a:mathml mrow>}\AltMathParen$}{\EndDviMath\HCode{</\a:mathml semantics>}}
+\Configure{()}
+ {\Configure{@math}{%\a:mathml
+ display="inline"
+}\csname a:mathml()\endcsname
+\DviMath\HCode{<\a:mathml semantics><\a:mathml mrow>}$\expandafter\AltMathParen}
+{$\HCode{</\a:mathml semantics>}\EndDviMath\csname b:mathml()\endcsname}
+
+
+\long\def\AltDisplay#1\]{\mmlalteqtoks{#1}#1\HCode{</\a:mathml mrow><\a:mathml annotation encoding="application/x-tex">\mmleqtoks</\a:mathml annotation></\a:mathml semantics>}\]}
+\Configure{[]}{\Configure{@math}{display="block"}\DviMath$$\DisplayMathtrue\HCode{<\a:mathml semantics><\a:mathml mrow>}\AltDisplay}{$$\EndDviMath}
+
+
+% \long\def\MMLAltlDisplayDollars#1$${\mmlalteqtoks{\[#1\]}#1\HCode{</\a:mathml mrow><\a:mathml annotation encoding="application/x-tex">\mmleqtoks</\a:mathml annotation>}$$}
+
+% configuarartion of display math doesn't work yet. need to investigate it.
+% \Configure{$$}
+% {\Configure{@math}{%\a:mathml
+% display="block"
+% }\IgnorePar
+% \ifvmode\else \HCode{<!--tex4ht:inline-->}\fi
+% \EndP\DviMath\HCode{<\a:mathml semantics><\a:mathml mrow>}}
+% {\HCode{</\a:mathml semantics>}\EndDviMath\ShowPar\par{\csname HCondtrue\endcsname\noindent}}
+% {\DisplayMathtrue\expandafter\MMLAltlDisplayDollars}
+
+
+% \renewcommand\eqannotate[1]{\mmlalteqtoks{#1}\HCode{<\a:mathml semantics><\a:mathml mrow>}#1\HCode{</\a:mathml mrow><\a:mathml annotation encoding="application/x-tex">\mmleqtoks</\a:mathml annotation></\a:mathml semantics>}}
+
+
+% environment support
+\newcommand\MMLVerbMathToks[2]{%
+ \mmlalteqtoks{\begin{#2}
+ #1
+ \end{#2}}%
+ \begingroup%
+ \ifvmode\IgnorePar\fi\EndP\Configure{@math}{display="block"}\DviMath\DisplayMathtrue\HCode{<\a:mathml semantics><\a:mathml mrow>}
+ \Configure{$$}{}{}{}
+ \begin{old#2}
+ #1
+ \end{old#2}
+ \HCode{</\a:mathml mrow><\a:mathml annotation encoding="application/x-tex">}
+ \HCode{\mmleqtoks}
+ \HCode{</\a:mathml annotation></\a:mathml semantics>}
+ \EndDviMath
+ \endgroup
+}
+
+% we must handle equations separatelly.
+% it is a bit messy
+\newcommand\MMLVerbMathToksEquation[2]{%
+ \mmlalteqtoks{\begin{#2}
+ #1
+ \end{#2}}%
+ \begingroup%
+ \def\@tempa{#2}%
+ \def\@equationname{equation}%
+ \def\mlabeledtr{mtr}
+ \ifx\@equationname\@tempa%
+ \def\mlabeledtr{mlabeledtr} % this element can be used to print the equation number, but it is supported only by MathJax
+ \fi
+ \ifvmode\IgnorePar\fi\EndP\Configure{@math}{display="block"}\DviMath\DisplayMathtrue\HCode{<\a:mathml semantics><\a:mathml mrow><\a:mathml mtable><\a:mathml \mlabeledtr><\a:mathml mtd>}%
+ \ifx\@equationname\@tempa%
+ \incr@eqnum%
+ \print@eqnum%
+ \HCode{</\a:mathml mtd><\a:mathml mtd>}%
+ \fi
+ #1%
+ \HCode{</\a:mathml mtd></\a:mathml \mlabeledtr></\a:mathml mtable></\a:mathml mrow><\a:mathml annotation encoding="application/x-tex">}%
+ \HCode{\mmleqtoks}%
+ \HCode{</\a:mathml annotation></\a:mathml semantics>}%
+ \EndDviMath%
+ \endgroup%
+}
+
+\ExplSyntaxOn
+\newcommand\MMLVerbMath[1]{%
+ \cs_if_exist:cTF{#1}{
+ \expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
+ \expandafter\let\csname endold#1\expandafter\endcsname\csname end#1\endcsname
+ \RenewDocumentEnvironment{#1}{+!b}{%
+ \NoFonts\expandafter\MMLVerbMathToks\expandafter{##1}{#1}\EndNoFonts%
+ }{}
+ }{}%
+}
+
+\newcommand\MMLVerbEquation[1]{%
+ \cs_if_exist:cTF{#1}{
+ \expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
+ \expandafter\let\csname endold#1\expandafter\endcsname\csname end#1\endcsname
+ \RenewDocumentEnvironment{#1}{+!b}{%
+ \NoFonts\expandafter\MMLVerbMathToksEquation\expandafter{##1}{#1}\EndNoFonts%
+ }{}
+ }{}%
+}
+\ExplSyntaxOff
+
+% \MMLVerbEquation{equation}
+% \MMLVerbEquation{equation*}
+
+\fi
+>>>
+
+\<configure html-mml amsmath\><<<
+\:CheckOption{texsource}\if:Option
+\MMLVerbMath{subarray}
+\MMLVerbMath{smallmatrix}
+\MMLVerbMath{matrix}
+\MMLVerbMath{pmatrix}
+\MMLVerbMath{bmatrix}
+\MMLVerbMath{Bmatrix}
+\MMLVerbMath{vmatrix}
+\MMLVerbMath{Vmatrix}
+\MMLVerbMath{cases}
+\MMLVerbMath{subequations}
+\MMLVerbMath{aligned}
+\MMLVerbMath{alignedat}
+\MMLVerbMath{gathered}
+\MMLVerbMath{gather}
+\MMLVerbMath{gather*}
+\MMLVerbMath{alignat}
+\MMLVerbMath{alignat*}
+\MMLVerbMath{xalignat}
+\MMLVerbMath{xalignat*}
+\MMLVerbMath{xxalignat}
+\MMLVerbMath{align}
+\MMLVerbMath{align*}
+\MMLVerbMath{flalign}
+\MMLVerbMath{flalign*}
+\MMLVerbMath{split}
+\MMLVerbMath{multline}
+\MMLVerbMath{multline*}
+% equations fails with errors, even though it worked in a .cfg
+% I will need to investigate it more
+% \MMLVerbEquation{equation}
+% \MMLVerbEquation{equation*}
+\MMLVerbMath{math}
+\MMLVerbMath{displaymath}
+\MMLVerbMath{eqnarray}
+\MMLVerbMath{eqnarray*}
+\fi
+>>>
+
%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{plain.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -3584,14 +3767,19 @@ charactes.
Extra brackets are used in order to support subscripts and superscripts.
\<configure mathml latex\><<<
-\def\:temp#1#2{\def#1{\PauseMathClass{\HCode{<mi mathvariant="normal">}\ht:special{t4ht@+\string&{35}x#2{59}}\a:HChar\HCode{</mi>}}\EndPauseMathClass}}
-\:temp\Psi{03A8}
+\def\:temp#1#2{\def\:tempa{\PauseMathClass{\HCode{<mi mathvariant="normal">}\ht:special{t4ht@+\string&{35}x#2{59}}\a:HChar\HCode{</mi>}}\EndPauseMathClass}\HLet#1\:tempa}
+\:temp\Gamma{0393}
\:temp\Delta{0394}
+\:temp\Theta{0398}
+\:temp\Lambda{039B}
\:temp\Xi{039E}
\:temp\Pi{03A0}
\:temp\Sigma{03A3}
\:temp\Upsilon{03A5}
+\:temp\Phi{03A6}
+\:temp\Psi{03A8}
\:temp\Omega{03A9}
+
>>>
@@ -5703,6 +5891,23 @@ elements that are printed to support the munderover element easily.
>>>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{esvec}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+We need to redefine these commands only for MathML. By default, Esvect produces images, which is OK.
+
+\<configure mathml esvect\><<<
+\def\:tempa#1{%
+\bgroup\HCode{<\a:mathml mover><\a:mathml mrow>}#1\HCode{</\a:mathml mrow><\a:mathml mo \a:mathml stretchy="true">}
+\PauseMathClass\fldr\EndPauseMathClass%
+\HCode{</\a:mathml mo></\a:mathml mover>}\egroup
+}
+
+\HRestore\ESV@vecteur
+\HLet\ESV@vecteur\:tempa
+>>>
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Notes}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/support/TeX4ht/source/tex4ht-ooffice.tex b/support/TeX4ht/source/tex4ht-ooffice.tex
index 65a79d3dcc..ed0a77f4ff 100644
--- a/support/TeX4ht/source/tex4ht-ooffice.tex
+++ b/support/TeX4ht/source/tex4ht-ooffice.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-ooffice.tex 1455 2024-01-29 13:45:00Z michal_h21 $
+% $Id: tex4ht-ooffice.tex 1524 2024-05-27 19:41:45Z michal_h21 $
% compile 3 times: latex tex4ht-ooffice
% htlatex tex4ht-ooffice "xhtml,4,sections+"
%
@@ -4620,6 +4620,81 @@ a more desirable for translations into MS Word.
{\HCode{</text:h>\Hnewline}\par\ShowPar}
>>>
+\<jurabook sections\><<<
+\ConfigureMark{subthreesection}
+ {\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble
+ \else \@seccntformat{subthreesection}\fi }
+\Configure{subthreesection}
+ {\IgnorePar\EndP \HCode{<!--start of subthreesection-->}}
+ {\IgnorePar\EndP \HCode{<!--end of subthreesection-->}}
+ {\HCode{<text:h
+ text:style-name="\csname a:Heading-4|<cond rtl class|>\endcsname"
+ \text:outlinelevel="4" ><text:span
+ text:style-name="subthreesection" >}\TitleMark\space
+ \HCode{</text:span>}\IgnoreIndent}
+ {\HCode{</text:h>\Hnewline}\par\ShowPar}
+\ConfigureMark{subfoursection}
+ {\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble
+ \else \@seccntformat{subfoursection}\fi }
+\Configure{subfoursection}
+ {\IgnorePar\EndP \HCode{<!--start of subfoursection-->}}
+ {\IgnorePar\EndP \HCode{<!--end of subfoursection-->}}
+ {\HCode{<text:h
+ text:style-name="\csname a:Heading-4|<cond rtl class|>\endcsname"
+ \text:outlinelevel="4" ><text:span
+ text:style-name="subfoursection" >}\TitleMark\space
+ \HCode{</text:span>}\IgnoreIndent}
+ {\HCode{</text:h>\Hnewline}\par\ShowPar}
+\ConfigureMark{subfivesection}
+ {\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble
+ \else \@seccntformat{subfivesection}\fi }
+\Configure{subfivesection}
+ {\IgnorePar\EndP \HCode{<!--start of subfivesection-->}}
+ {\IgnorePar\EndP \HCode{<!--end of subfivesection-->}}
+ {\HCode{<text:h
+ text:style-name="\csname a:Heading-4|<cond rtl class|>\endcsname"
+ \text:outlinelevel="4" ><text:span
+ text:style-name="subfivesection" >}\TitleMark\space
+ \HCode{</text:span>}\IgnoreIndent}
+ {\HCode{</text:h>\Hnewline}\par\ShowPar}
+\ConfigureMark{subsixsection}
+ {\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble
+ \else \@seccntformat{subsixsection}\fi }
+\Configure{subsixsection}
+ {\IgnorePar\EndP \HCode{<!--start of subsixsection-->}}
+ {\IgnorePar\EndP \HCode{<!--end of subsixsection-->}}
+ {\HCode{<text:h
+ text:style-name="\csname a:Heading-4|<cond rtl class|>\endcsname"
+ \text:outlinelevel="4" ><text:span
+ text:style-name="subsixsection" >}\TitleMark\space
+ \HCode{</text:span>}\IgnoreIndent}
+ {\HCode{</text:h>\Hnewline}\par\ShowPar}
+\ConfigureMark{subsevensection}
+ {\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble
+ \else \@seccntformat{subsevensection}\fi }
+\Configure{subsevensection}
+ {\IgnorePar\EndP \HCode{<!--start of subsevensection-->}}
+ {\IgnorePar\EndP \HCode{<!--end of subsevensection-->}}
+ {\HCode{<text:h
+ text:style-name="\csname a:Heading-4|<cond rtl class|>\endcsname"
+ \text:outlinelevel="4" ><text:span
+ text:style-name="subsevensection" >}\TitleMark\space
+ \HCode{</text:span>}\IgnoreIndent}
+ {\HCode{</text:h>\Hnewline}\par\ShowPar}
+\ConfigureMark{subeightsection}
+ {\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble
+ \else \@seccntformat{subeightsection}\fi }
+\Configure{subeightsection}
+ {\IgnorePar\EndP \HCode{<!--start of subeightsection-->}}
+ {\IgnorePar\EndP \HCode{<!--end of subeightsection-->}}
+ {\HCode{<text:h
+ text:style-name="\csname a:Heading-4|<cond rtl class|>\endcsname"
+ \text:outlinelevel="4" ><text:span
+ text:style-name="subeightsection" >}\TitleMark\space
+ \HCode{</text:span>}\IgnoreIndent}
+ {\HCode{</text:h>\Hnewline}\par\ShowPar}
+>>>
+
@@ -5346,6 +5421,46 @@ Why we need the following in content.xml instead of styles.xml
|<content style 8|>%
>>>
+\<jurabook tocs\><<<
+\ConfigureToc{subthreesection}
+ {\HCode{<text:p text:style-name="P3" ><text:span
+ text:style-name="toc-mark" >}}
+ { \HCode{</text:span>}}
+ {}
+ {\HCode{</text:p>}}
+
+\ConfigureToc{subfoursection}
+ {\HCode{<text:p text:style-name="P3" ><text:span
+ text:style-name="toc-mark" >}}
+ { \HCode{</text:span>}}
+ {}
+ {\HCode{</text:p>}}
+\ConfigureToc{subfivesection}
+ {\HCode{<text:p text:style-name="P3" ><text:span
+ text:style-name="toc-mark" >}}
+ { \HCode{</text:span>}}
+ {}
+ {\HCode{</text:p>}}
+\ConfigureToc{subsixsection}
+ {\HCode{<text:p text:style-name="P3" ><text:span
+ text:style-name="toc-mark" >}}
+ { \HCode{</text:span>}}
+ {}
+ {\HCode{</text:p>}}
+\ConfigureToc{subsevensection}
+ {\HCode{<text:p text:style-name="P3" ><text:span
+ text:style-name="toc-mark" >}}
+ { \HCode{</text:span>}}
+ {}
+ {\HCode{</text:p>}}
+\ConfigureToc{subeightsection}
+ {\HCode{<text:p text:style-name="P3" ><text:span
+ text:style-name="toc-mark" >}}
+ { \HCode{</text:span>}}
+ {}
+ {\HCode{</text:p>}}
+>>>
+
%%%%%%%%%%%%%
\subsection{Tables of Figures}
@@ -9427,6 +9542,11 @@ fn\the\c@footnote x\minipageNum
|<mwcls sections|>
>>>
+\<configure ooffice jurabook\><<<
+|<jurabook sections|>
+|<jurabook tocs|>
+>>>
+
\<configure ooffice slides\><<<
\Configure{maketitle}
{\HCode{<!--begin maketitle-->}}
diff --git a/support/bibtexperllibs/BibTeX-Parser/Changes b/support/bibtexperllibs/BibTeX-Parser/Changes
deleted file mode 100644
index da5c2afb8e..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/Changes
+++ /dev/null
@@ -1,86 +0,0 @@
-Revision history for BibTeX::Parser
-
-1.04 2023-08-20 New release
-
-1.03 2022-11-06
- Avoid extra spaces with von part. (Author.pm)
- Add ' to re_namechar. (Parser.pm)
-
-1.02 2018-04-29 03:19:56 +0000
- Corrected the bug when Jr is not accompanied by von.
-
-1.01 2017-11-19 03:12:34 +0000
- New options for to_string:
- - print_pre - whether to print text preceding the entry
- - type_capitalization ('Uppercase', 'Lowercase',
- 'Titlecase')
- - field_capitalization ('Uppercase', 'Lowercase',
- 'Titlecase')
-
-1.00 2017-03-18 21:53:15+00:00
- Typo corrected: editors -> editor
-
-0.70 2016-11-23 02:28:35+00:00
- Compatibility with perl 5.25 (Alexandr Ciornii)
-
-0.69 2016-03-24 15:13:50-04:00
- Added option canonize_names to Entry::to_string
-
-0.68 2016-03-10 13:45:31-05:00
- Now we preserve the order of entries
-
-0.67 2015-12-28 22:36:42+00:00
- Corrected test t/13_output.t
-
-0.66 2015-12-23 19:52:55-05:00
- Corrected bug 67419.
- Added $entry->to_string function
- No Do not remove braces from the authors' names
-
-0.65 2013-09-03 21:04:43
- Add links in documentation.
-
-0.64 2012-03-10 22:23:50
- Remove a warning about undefined value.
-
-0.63 2011-03-15 23:08:18
- Parse files with errors (no keys, spaces in wrong positions). Bug #66325
-
-0.62 2010-10-15 08:52:53
- Declare Test::More minimum version with done_testing
-
-0.61 2010-07-19 16:37:49
- Add methods $entry->cleaned_author / cleaned_editor
-
-0.6 2010-07-19 14:43:15
- Add method $entry->cleaned_field( 'name' )
- Add prerequisite LaTeX::ToUnicode >= 0.02
-
-0.5 2010-07-06 13:17:45 Europe/Berlin
- Do not attempt to clean up returned values
- Author names with braces are split correctly
-
-0.4 2010-02-09
- Parsing of quoted author names (e.g. "{Foo and Bar, Inc.}")
-
-0.3.2 2009-07-26
- Removed dependency on Text::Balanced
-
-0.3.1 2009-07-19
- No changes, removed huge test file from dist
-
-0.3 2009-07-18
- Better parsing of author names,
- new Method B::P::Entry->raw_bibtex
- Removed Module::Install from package
-
-0.21 2009-01-23
- Fixed errors in synopsis.
-
-0.2 2008-12-30
- First public release.
-
-0.1 2008-03-14
- First version, internal
-
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/LICENSE b/support/bibtexperllibs/BibTeX-Parser/LICENSE
deleted file mode 100644
index 1a50e57d4d..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/LICENSE
+++ /dev/null
@@ -1,379 +0,0 @@
-This software is copyright (c) 2013-2022 by Gerhard Gossen and Boris Veytsman and Karl Berry
-
-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) 2013-2016 by Gerhard Gossen and Boris Veytsman
-
-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, Suite 500, Boston, MA 02110-1335 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.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 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.
-
- <signature of Ty Coon>, 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) 2013 by Gerhard Gossen.
-
-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
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/MANIFEST b/support/bibtexperllibs/BibTeX-Parser/MANIFEST
deleted file mode 100644
index 032eea6a15..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/MANIFEST
+++ /dev/null
@@ -1,44 +0,0 @@
-LICENSE
-Changes
-MANIFEST
-t/pod.t
-t/cleaned_field.t
-t/release-pod-coverage.t
-t/bug67419.t
-t/09-complex.t
-t/bug66325.t
-t/07-parse_englishbib.t
-t/13_output.t
-t/01-parse.t
-t/14-extratext.t
-t/05-author.t
-t/08-parse_large.t
-t/release-pod-syntax.t
-t/12-von_token.t
-t/00-load.t
-t/11-split_braced.t
-t/02-parse_string.t
-t/04-entry.t
-t/03-parse_entry.t
-t/bibs/mathscinet.txt
-t/bibs/10-funnyname.bib
-t/bibs/english.bib
-t/bibs/braces.bib
-t/bibs/endnote.txt
-t/bibs/14-extratext.bib
-t/bibs/01.bib
-t/bibs/engineering_village.txt
-t/bibs/09-complex.bib
-t/bibs/06.bib
-t/pod-coverage.t
-t/10-funnyname.t
-t/15-capitalization.t
-t/06-parse_complex.t
-README
-notes
-lib/BibTeX/Parser/Author.pm
-lib/BibTeX/Parser/Entry.pm
-lib/BibTeX/Parser.pm
-Makefile.PL
-Makefile.TDS
-dist.ini
diff --git a/support/bibtexperllibs/BibTeX-Parser/Makefile.PL b/support/bibtexperllibs/BibTeX-Parser/Makefile.PL
deleted file mode 100644
index e095f253b0..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/Makefile.PL
+++ /dev/null
@@ -1,71 +0,0 @@
-
-use strict;
-use warnings;
-
-
-
-use ExtUtils::MakeMaker 6.30;
-
-
-
-my %WriteMakefileArgs = (
- "ABSTRACT" => "A pure perl BibTeX parser",
- "AUTHOR" => 'Gerhard Gossen <gerhard.gossen@googlemail.com> and Boris Veytsman <boris@varphi.com> and Karl Berry <karl@freefriends.org',
- "BUILD_REQUIRES" => {},
- "CONFIGURE_REQUIRES" => {
- "ExtUtils::MakeMaker" => "6.31"
- },
- "DISTNAME" => "BibTeX-Parser",
- "EXE_FILES" => [],
- "LICENSE" => "perl",
- "NAME" => "BibTeX::Parser",
- "PREREQ_PM" => {
- "File::Spec" => 0,
- "IO::File" => 0,
- "IO::String" => 0,
- "LaTeX::ToUnicode" => "0.52",
- "Test::More" => "0.88"
- },
- "TEST_REQUIRES" => {
- "Test::More" => "0.88"
- },
- 'VERSION_FROM' => 'lib/BibTeX/Parser.pm',
- "test" => {
- "TESTS" => "t/*.t"
- }
-);
-
-
-unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
- my $tr = delete $WriteMakefileArgs{TEST_REQUIRES};
- my $br = $WriteMakefileArgs{BUILD_REQUIRES};
- for my $mod ( keys %$tr ) {
- if ( exists $br->{$mod} ) {
- $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod};
- }
- else {
- $br->{$mod} = $tr->{$mod};
- }
- }
-}
-
-unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
- my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
- my $pp = $WriteMakefileArgs{PREREQ_PM};
- for my $mod ( keys %$br ) {
- if ( exists $pp->{$mod} ) {
- $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
- }
- else {
- $pp->{$mod} = $br->{$mod};
- }
- }
-}
-
-delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
- unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
-
-WriteMakefile(%WriteMakefileArgs);
-
-
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/Makefile.TDS b/support/bibtexperllibs/BibTeX-Parser/Makefile.TDS
deleted file mode 100644
index 780ebc0af1..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/Makefile.TDS
+++ /dev/null
@@ -1,35 +0,0 @@
-# This is Makefile for TDS-compliant TeX distributions
-# Written by Boris Veytsman, boris@varphi.com
-#
-# This file is in public domain
-#
-PREFIX = /usr/local
-
-LIBDIR = $(PREFIX)/scripts/bibtexperllibs
-
-DOCDIR = $(PREFIX)/doc/bibtex/bibtexperllibs
-
-all:
-
-docs:
-
-install:
- mkdir -p $(LIBDIR)
- cp -r lib/* $(LIBDIR)
- mkdir -p $(DOCDIR)
- cp -r man/man3/* $(DOCDIR)
-
-check test: Makefile
-# need bash pipefail so exit status is from the make, not the tr.
-# the -f Makefile is because of possible GNUmakefile -> Makefile.TDS symlink.
- bash -c "set -o pipefail; \
- env PERL5LIB=../LaTeX-ToUnicode/lib \
- make -f Makefile test | tr '\r' '\n'"
-
-Makefile MYMETA.json MYMeta.yml: Makefile.PL force
- perl Makefile.PL || rm -f $@
-
-clean distclean:
- $(RM) Makefile MYMETA.* blib pm_to_blib *.tar.gz
-
-force:
diff --git a/support/bibtexperllibs/BibTeX-Parser/README b/support/bibtexperllibs/BibTeX-Parser/README
deleted file mode 100644
index cb6f19b576..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/README
+++ /dev/null
@@ -1,9 +0,0 @@
-This is the BibTeX::Parser Perl package:
-
- A pure Perl BibTeX parser
-
-Copyright 2013--2023 Gerhard Gossen, Boris Veytsman, Karl Berry
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/dist.ini b/support/bibtexperllibs/BibTeX-Parser/dist.ini
deleted file mode 100644
index bc60ca9352..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/dist.ini
+++ /dev/null
@@ -1,28 +0,0 @@
-name = BibTeX-Parser
-version = 1.04
-author = Gerhard Gossen <gerhard.gossen@googlemail.com> and Boris Veytsman <boris@varphi.com> and Karl Berry <karl@freefriends.org>
-license = Perl_5
-copyright_holder = Gerhard Gossen and Boris Veytsman and Karl Berry
-
-[@Classic]
-
-[NextRelease]
-format = %-7v %{yyyy-MM-dd HH:mm:ss}d
-
-[PodWeaver]
-
-[Prereqs]
-Test::More = 0
-IO::String = 0
-IO::File = 0
-File::Spec = 0
-LaTeX::ToUnicode = 0.11
-
-[Prereqs / TestRequires]
-Test::More = 0.88 ; for done_testing
-
-[PruneFiles]
-filenames = t/bibs/java.bib
-
-[Repository]
-[@Git]
diff --git a/support/bibtexperllibs/BibTeX-Parser/lib/BibTeX/Parser.pm b/support/bibtexperllibs/BibTeX-Parser/lib/BibTeX/Parser.pm
deleted file mode 100644
index 2897d8495d..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/lib/BibTeX/Parser.pm
+++ /dev/null
@@ -1,366 +0,0 @@
-package BibTeX::Parser;
-{
- $BibTeX::Parser::VERSION = '1.04';
-}
-# ABSTRACT: A pure perl BibTeX parser
-use warnings;
-use strict;
-
-use BibTeX::Parser::Entry;
-
-
-my $re_namechar = qr/[a-zA-Z0-9\!\$\&\*\+\-\.\/\:\;\<\>\?\[\]\^\_\`\|\']/o;
-my $re_name = qr/$re_namechar+/o;
-
-
-sub new {
- my ( $class, $fh ) = @_;
-
- return bless {
- fh => $fh,
- strings => {
- jan => "January",
- feb => "February",
- mar => "March",
- apr => "April",
- may => "May",
- jun => "June",
- jul => "July",
- aug => "August",
- sep => "September",
- oct => "October",
- nov => "November",
- dec => "December",
-
- },
- line => -1,
- buffer => "",
- }, $class;
-}
-
-sub _slurp_close_bracket;
-
-sub _parse_next {
- my $self = shift;
-
- while (1) { # loop until regular entry is finished
- return 0 if $self->{fh}->eof;
- local $_ = $self->{buffer};
-
- until (/@/m) {
- my $line = $self->{fh}->getline;
- return 0 unless defined $line;
- $line =~ s/^%.*$//;
- $_ .= $line;
- }
-
- my $current_entry = new BibTeX::Parser::Entry;
- if (/@($re_name)/cgo) {
- my $type = uc $1;
- $current_entry->type( $type );
- my $start_pos = pos($_) - length($type) - 1;
-
- # read rest of entry (matches braces)
- my $bracelevel = 0;
- $bracelevel += tr/\{/\{/; #count braces
- $bracelevel -= tr/\}/\}/;
- while ( $bracelevel != 0 ) {
- my $position = pos($_);
- my $line = $self->{fh}->getline;
- last unless defined $line;
- $bracelevel =
- $bracelevel + ( $line =~ tr/\{/\{/ ) - ( $line =~ tr/\}/\}/ );
- $_ .= $line;
- pos($_) = $position;
- }
-
- # Remember text before the entry
- my $pre = substr($_, 0, $start_pos-1);
- if ($start_pos == 0) {
- $pre = '';
- }
- $current_entry->pre($pre);
-
-
- # Remember raw bibtex code
- my $raw = substr($_, $start_pos);
- $raw =~ s/^\s+//;
- $raw =~ s/\s+$//;
- $current_entry->raw_bibtex($raw);
-
- my $pos = pos $_;
- tr/\n/ /;
- pos($_) = $pos;
-
- if ( $type eq "STRING" ) {
- if (/\G\{\s*($re_name)\s*=\s*/cgo) {
- my $key = $1;
- my $value = _parse_string( $self->{strings} );
- if ( defined $self->{strings}->{$key} ) {
- warn("Redefining string $key!");
- }
- $self->{strings}->{$key} = $value;
- /\G[\s\n]*\}/cg;
- } else {
- $current_entry->error("Malformed string!");
- return $current_entry;
- }
- } elsif ( $type eq "COMMENT" or $type eq "PREAMBLE" ) {
- /\G\{./cgo;
- _slurp_close_bracket;
- } else { # normal entry
- $current_entry->parse_ok(1);
-
- # parse key
- if (/\G\s*\{(?:\s*($re_name)\s*,[\s\n]*|\s+\r?\s*)/cgo) {
- $current_entry->key($1);
-
- # fields
- while (/\G[\s\n]*($re_name)[\s\n]*=[\s\n]*/cgo) {
- $current_entry->field(
- $1 => _parse_string( $self->{strings} ) );
- my $idx = index( $_, ',', pos($_) );
- pos($_) = $idx + 1 if $idx > 0;
- }
-
- return $current_entry;
-
- } else {
-
- $current_entry->error("Malformed entry (key contains illegal characters) at " . substr($_, pos($_) || 0, 20) . ", ignoring");
- _slurp_close_bracket;
- return $current_entry;
- }
- }
-
- $self->{buffer} = substr $_, pos($_);
-
- } else {
- $current_entry->error("Did not find type at " . substr($_, pos($_) || 0, 20));
- return $current_entry;
- }
-
- }
-}
-
-
-sub next {
- my $self = shift;
-
- return $self->_parse_next;
-}
-
-# slurp everything till the next closing brace. Handles
-# nested brackets
-sub _slurp_close_bracket {
- my $bracelevel = 0;
- BRACE: {
- /\G[^\}]*\{/cg && do { $bracelevel++; redo BRACE };
- /\G[^\{]*\}/cg
- && do {
- if ( $bracelevel > 0 ) {
- $bracelevel--;
- redo BRACE;
- } else {
- return;
- }
- }
- }
-}
-
-# parse bibtex string in $_ and return. A BibTeX string is either enclosed
-# in double quotes '"' or matching braces '{}'. The braced form may contain
-# nested braces.
-sub _parse_string {
- my $strings_ref = shift;
-
- my $value = "";
-
- PART: {
- if (/\G(\d+)/cg) {
- $value .= $1;
- } elsif (/\G($re_name)/cgo) {
- warn("Using undefined string $1") unless defined $strings_ref->{$1};
- $value .= $strings_ref->{$1} || "";
- } elsif (/\G"(([^"\\]*(\\.)*[^\\"]*)*)"/cgs)
- { # quoted string with embeded escapes
- $value .= $1;
- } else {
- my $part = _extract_bracketed( $_ );
- $value .= substr $part, 1, length($part) - 2; # strip quotes
- }
-
- if (/\G\s*#\s*/cg) { # string concatenation by #
- redo PART;
- }
- }
- $value =~ s/[\s\n]+/ /g;
- return $value;
-}
-
-sub _extract_bracketed
-{
- for($_[0]) # alias to $_
- {
- /\G\s+/cg;
- my $start = pos($_);
- my $depth = 0;
- while(1)
- {
- /\G\\./cg && next;
- /\G\{/cg && (++$depth, next);
- /\G\}/cg && (--$depth > 0 ? next : last);
- /\G([^\\\{\}]+)/cg && next;
- last; # end of string
- }
- return substr($_, $start, pos($_)-$start);
- }
-}
-
-# Split the $string using $pattern as a delimiter with
-# each part having balanced braces (so "{$pattern}"
-# does NOT split).
-# Return empty list if unmatched braces
-
-sub _split_braced_string {
- my $string = shift;
- my $pattern = shift;
- my @tokens;
- return () if $string eq '';
- my $buffer;
- while (!defined pos $string || pos $string < length $string) {
- if ( $string =~ /\G(.*?)(\{|$pattern)/cgi ) {
- my $match = $1;
- if ( $2 =~ /$pattern/i ) {
- $buffer .= $match;
- push @tokens, $buffer;
- $buffer = "";
- } elsif ( $2 =~ /\{/ ) {
- $buffer .= $match . "{";
- my $numbraces=1;
- while ($numbraces !=0 && pos $string < length $string) {
- my $symbol = substr($string, pos $string, 1);
- $buffer .= $symbol;
- if ($symbol eq '{') {
- $numbraces ++;
- } elsif ($symbol eq '}') {
- $numbraces --;
- }
- pos($string) ++;
- }
- if ($numbraces != 0) {
- return ();
- }
- } else {
- $buffer .= $match;
- }
- } else {
- $buffer .= substr $string, (pos $string || 0);
- last;
- }
- }
- push @tokens, $buffer if $buffer;
- return @tokens;
-}
-
-
-1; # End of BibTeX::Parser
-
-
-__END__
-=pod
-
-=head1 NAME
-
-BibTeX::Parser - A pure perl BibTeX parser
-
-
-=head1 SYNOPSIS
-
-Parses BibTeX files.
-
- use BibTeX::Parser;
- use IO::File;
-
- my $fh = IO::File->new("filename");
-
- # Create parser object ...
- my $parser = BibTeX::Parser->new($fh);
-
- # ... and iterate over entries
- while (my $entry = $parser->next ) {
- if ($entry->parse_ok) {
- my $type = $entry->type;
- my $title = $entry->field("title");
-
- my @authors = $entry->author;
- # or:
- my @editors = $entry->editor;
-
- foreach my $author (@authors) {
- print $author->first . " "
- . $author->von . " "
- . $author->last . ", "
- . $author->jr;
- }
- } else {
- warn "Error parsing file: " . $entry->error;
- }
- }
-
-
-
-=head1 FUNCTIONS
-
-=head2 new
-
-Creates new parser object.
-
-Parameters:
-
- * fh: A filehandle
-
-=head2 next
-
-Returns the next parsed entry or undef.
-
-=head1 NOTES
-
-The fields C<author> and C<editor> are canonized, see
-L<BibTeX::Parser::Author>
-
-
-=head1 SEE ALSO
-
-=over 4
-
-=item
-
-L<BibTeX::Parser::Entry>
-
-=item
-
-L<BibTeX::Parser::Author>
-
-=back
-
-=head1 VERSION
-
-version 1.04
-
-
-=head1 AUTHOR
-
-Gerhard Gossen <gerhard.gossen@googlemail.com> and
-Boris Veytsman <boris@varphi.com> and
-Karl Berry <karl@freefriends.org>
-
-=head1 COPYRIGHT AND LICENSE
-
-This software is copyright (c) 2013-2023 by Gerhard Gossen and Boris Veytsman and Karl Berry.
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
-
-=cut
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/lib/BibTeX/Parser/Author.pm b/support/bibtexperllibs/BibTeX-Parser/lib/BibTeX/Parser/Author.pm
deleted file mode 100644
index a35e2073a6..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/lib/BibTeX/Parser/Author.pm
+++ /dev/null
@@ -1,429 +0,0 @@
-package BibTeX::Parser::Author;
-{
- $BibTeX::Parser::Author::VERSION = '1.04';
-}
-
-use warnings;
-use strict;
-
-use BibTeX::Parser;
-
-
-use overload
- '""' => \&to_string;
-
-
-
-sub new {
- my $class = shift;
-
- if (@_) {
- my $self = [ $class->split(@_) ];
- return bless $self, $class;
- } else {
- return bless [], $class;
- }
-}
-
-sub _get_or_set_field {
- my ($self, $field, $value) = @_;
- if (defined $value) {
- $self->[$field] = $value;
- } else {
- return $self->[$field];
- }
-}
-
-
-sub first {
- shift->_get_or_set_field(0, @_);
-}
-
-
-sub von {
- shift->_get_or_set_field(1, @_);
-}
-
-
-sub last {
- shift->_get_or_set_field(2, @_);
-}
-
-
-sub jr {
- shift->_get_or_set_field(3, @_);
-}
-
-
-# Take a string and create an array [first, von, last, jr]
-sub split {
- my ($self_or_class, $name) = @_;
-
- # remove whitespace at start and end of string
- $name =~ s/^\s*(.*)\s*$/$1/s;
-
-
-
- if (!length($name)) {
- return (undef, undef, undef, undef);
- }
-
- my @comma_separated =
- BibTeX::Parser::_split_braced_string($name,
- '\s*,\s*');
- if (scalar(@comma_separated) == 0) {
- # Error?
- return (undef, undef, undef, undef);
- }
-
- my $first=undef;
- my $von=undef;
- my $last=undef;
- my $jr=undef;
-
- if (scalar(@comma_separated) == 1) {
- # First von Last form
- my @tokens =
- BibTeX::Parser::_split_braced_string($name, '\s+');
- if (!scalar (@tokens)) {
- return (undef, undef, undef, undef);
- }
- my ($start_von, $start_last) = _getStartVonLast (@tokens);
- if ($start_von >0) {
- $first = join(' ', splice(@tokens,0,$start_von));
- }
- if (($start_last-$start_von) >0) {
- $von = join(' ', splice(@tokens,0,$start_last-$start_von));
- }
- $last = join(' ',@tokens);
- return ($first, $von, $last, $jr);
- }
- # Now we work with von Last, [Jr,] First form
- if (scalar @comma_separated == 2) { # no jr
- my @tokens=
- BibTeX::Parser::_split_braced_string($comma_separated[1], '\s+');
- $first = join(' ', @tokens);
- } else { # jr is present
- my @tokens=
- BibTeX::Parser::_split_braced_string($comma_separated[1], '\s+');
- $jr = join(' ', @tokens);
- @tokens=
- BibTeX::Parser::_split_braced_string($comma_separated[2], '\s+');
- $first = join(' ', @tokens);
- }
- my @tokens =
- BibTeX::Parser::_split_braced_string($comma_separated[0], '\s+');
- my $start_last = _getStartLast(@tokens);
- if ($start_last > 0) {
- $von=join(' ', splice(@tokens,0,$start_last));
- }
- $last = join(' ',@tokens);
- return ($first, $von, $last, $jr);
-
-}
-
-# Return the index of the first von element and the first lastname
-# element. If no von element, von=last
-
-sub _getStartVonLast {
- my $length=scalar(@_);
- if ($length==1) {
- return (0,0);
- }
- my $start_von=-1;
- my $start_last=$length-1;
- for (my $i=0; $i<$length; $i++) {
- if (_is_von_token($_[$i])) {
- $start_von=$i;
- last;
- }
- }
- if ($start_von== -1) { # no von part
- return($length-1, $length-1);
- }
- if ($start_von== $length-1) { # all parts but last are upper case?
- return($length-1, $length-1);
- }
- for (my $i=$start_von+1; $i<$length; $i++) {
- if (!_is_von_token($_[$i])) {
- $start_last=$i;
- last;
- }
- }
- return($start_von, $start_last);
-}
-
-
-# Return the index of the first lastname
-# element provided no first name elements are present
-
-sub _getStartLast {
- my $length=scalar(@_);
- if ($length==1) {
- return 0;
- }
- my $start_last=$length-1;
- for (my $i=0; $i<$length; $i++) {
- if (!_is_von_token($_[$i])) {
- $start_last=$i;
- last;
- }
- }
- return $start_last;
-}
-
-
-sub _split_name_parts {
- my $name = shift;
-
- if ( $name !~ /\{/ ) {
- return split /\s+/, $name;
- } else {
- my @parts;
- my $cur_token = '';
- while ( scalar( $name =~ /\G ( [^\s\{]* ) ( \s+ | \{ | \s* $ ) /xgc ) ) {
- $cur_token .= $1;
- if ( $2 =~ /\{/ ) {
- if ( scalar( $name =~ /\G([^\}]*)\}/gc ) ) {
- $cur_token .= "{$1}";
- } else {
- die "Unmatched brace in name '$name'";
- }
- } else {
- if ( $cur_token =~ /^{(.*)}$/ ) {
- $cur_token = $1;
- }
- push @parts, $cur_token;
- $cur_token = '';
- }
- }
- return @parts;
- }
-
-}
-
-
-sub _get_single_author_from_tokens {
- my (@tokens) = @_;
- if (@tokens == 0) {
- return (undef, undef, undef, undef);
- } elsif (@tokens == 1) { # name without comma
- if ( $tokens[0] =~ /(^|\s)[[:lower:]]/) { # name has von part or has only lowercase names
- my @name_parts = _split_name_parts $tokens[0];
-
- my $first;
- while (@name_parts && ucfirst($name_parts[0]) eq $name_parts[0] ) {
- $first .= $first ? ' ' . shift @name_parts : shift @name_parts;
- }
-
- my $von;
- # von part are lowercase words
- while ( @name_parts && lc($name_parts[0]) eq $name_parts[0] ) {
- $von .= $von ? ' ' . shift @name_parts : shift @name_parts;
- }
-
- if (@name_parts) {
- return ($first, $von, join(" ", @name_parts), undef);
- } else {
- return (undef, undef, $tokens[0], undef);
- }
- } else {
- if ( $tokens[0] !~ /\{/ && $tokens[0] =~ /^((.*)\s+)?\b(\S+)$/) {
- return ($2, undef, $3, undef);
- } else {
- my @name_parts = _split_name_parts $tokens[0];
- return ($name_parts[0], undef, $name_parts[1], undef);
- }
- }
-
- } elsif (@tokens == 2) {
- my @von_last_parts = _split_name_parts $tokens[0];
- my $von;
- # von part are lowercase words
- while ( @von_last_parts && lc($von_last_parts[0]) eq $von_last_parts[0] ) {
- $von .= $von ? ' ' . shift @von_last_parts : shift @von_last_parts;
- }
- return ($tokens[1], $von, join(" ", @von_last_parts), undef);
- } else {
- my @von_last_parts = _split_name_parts $tokens[0];
- my $von;
- # von part are lowercase words
- while ( @von_last_parts && lc($von_last_parts[0]) eq $von_last_parts[0] ) {
- $von .= $von ? ' ' . shift @von_last_parts : shift @von_last_parts;
- }
- return ($tokens[2], $von, join(" ", @von_last_parts), $tokens[1]);
- }
-
-}
-
-
-
-# The goal is to return a name in form
-# von Last, Jr, First
-# where any of the parts except Last may be empty.
-#
-sub to_string {
- my $self = shift;
-
- my $last = $self->last; # assume always present
- my $first = $self->first ? (", " . $self->first) : ''; # ", first"
- my $von = $self->von ? ($self->von . " ") : ''; # "von "
- my $jr = $self->jr ? (", " . $self->jr ) : ''; # ", jr"
- #
- my $ret = "${von}${last}${jr}${first}";
- #warn "returning name: $ret\n";
- return $ret;
-
-# original code, which introduced a spurious space with a von part.
-# https://github.com/borisveytsman/crossrefware/issues/11
-#
-# if ($self->jr) {
-# return () . " " . $self->last . ", " . $self->jr . ", " . $self->first;
-# } else {
-# return ($self->von ? $self->von . " " : '') . $self->last . ($self->first ? ", " . $self->first : '');
-# }
-#
-}
-
-
-# Return 1 if the first letter on brace level 0 is lowercase
-sub _is_von_token {
- my $string = shift;
- while ($string =~
- s/^(\\[[:alpha:]]+\{|\{|\\[[:^alpha:]]?|[[:^alpha:]])//) {
- if ($1 eq '{' ) {
- my $numbraces=1;
- while ($numbraces !=0 && length($string)) {
- my $symbol = substr($string, 0, 1);
- if ($symbol eq '{') {
- $numbraces ++;
- } elsif ($symbol eq '}') {
- $numbraces --;
- }
- $string = substr($string,1);
- }
- }
- }
-
- if (length $string ) {
- my $symbol = substr($string, 0, 1);
- if (lc($symbol) eq $symbol) {
- return 1;
- } else {
- return 0;
- }
- } else {
- return 1;
- }
-
-}
-
-1; # End of BibTeX::Entry
-
-__END__
-=pod
-
-=head1 NAME
-
-BibTeX::Author - Contains a single author for a BibTeX document.
-
-=head1 SYNOPSIS
-
-This class ist a wrapper for a single BibTeX author. It is usually created
-by a BibTeX::Parser.
-
- use BibTeX::Parser::Author;
-
- my $entry = BibTeX::Parser::Author->new($full_name);
-
- my $firstname = $author->first;
- my $von = $author->von;
- my $last = $author->last;
- my $jr = $author->jr;
-
- # or ...
-
- my ($first, $von, $last, $jr) = BibTeX::Author->split($fullname);
-
-
-
-=head1 FUNCTIONS
-
-=head2 new
-
-Create new author object. Expects full name as parameter.
-
-=head2 first
-
-Set or get first name(s).
-
-=head2 von
-
-Set or get 'von' part of name.
-
-=head2 last
-
-Set or get last name(s).
-
-=head2 jr
-
-Set or get 'jr' part of name.
-
-=head2 split
-
-Split name into (firstname, von part, last name, jr part). Returns array
-with four strings, some of them possibly empty.
-
-=head2 to_string
-
-Return string representation of the name.
-
-=head1 NOTES
-
-BibTeX allows three representations of a person's name:
-
-=over 4
-
-=item 1.
-
-First von Last
-
-=item 2.
-
-von Last, First
-
-=item 3.
-
-von Last, Jr, First
-
-=back
-
-The module always converts the first form to the second of third one
-to allow simple string comparisons.
-
-The algorithm to determine the von part is the following: von part
-consists of tokens where the first letter at brace level 0 is in lower case.
-Anything in a "special characters" is on brace level 0. Thus the following
-tokens are considered von parts: C<von>, C<\NOOP{von}Von>, and
-the following token is not: C<{von}>
-
-=head1 VERSION
-
-version 1.04
-
-
-=head1 AUTHOR
-
-Gerhard Gossen <gerhard.gossen@googlemail.com> and
-Boris Veytsman <boris@varphi.com> and
-Karl Berry <karl@freefriends.org>
-
-=head1 COPYRIGHT AND LICENSE
-
-This software is copyright (c) 2013--2023 by Gerhard Gossen and Boris Veytsman and Karl Berry.
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
-
-=cut
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/lib/BibTeX/Parser/Entry.pm b/support/bibtexperllibs/BibTeX-Parser/lib/BibTeX/Parser/Entry.pm
deleted file mode 100644
index d0bc9cc80b..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/lib/BibTeX/Parser/Entry.pm
+++ /dev/null
@@ -1,435 +0,0 @@
-package BibTeX::Parser::Entry;
-{
- $BibTeX::Parser::Entry::VERSION = '1.04';
-}
-
-use warnings;
-use strict;
-
-use BibTeX::Parser;
-use BibTeX::Parser::Author;
-
-
-
-sub new {
- my ($class, $type, $key, $parse_ok, $fieldsref) = @_;
-
- my %fields = defined $fieldsref ? %$fieldsref : ();
- my $i=0;
- foreach my $field (keys %fields) {
- if ($field !~ /^_/) {
- $fields{_fieldnums}->{$field}=$i;
- $i++;
- }
- }
- if (defined $type) {
- $fields{_type} = uc($type);
- }
- $fields{_key} = $key;
- $fields{_parse_ok} = $parse_ok;
- $fields{_raw} = '';
- return bless \%fields, $class;
-}
-
-
-
-sub parse_ok {
- my $self = shift;
- if (@_) {
- $self->{_parse_ok} = shift;
- }
- $self->{_parse_ok};
-}
-
-
-sub error {
- my $self = shift;
- if (@_) {
- $self->{_error} = shift;
- $self->parse_ok(0);
- }
- return $self->parse_ok ? undef : $self->{_error};
-}
-
-
-sub type {
- if (scalar @_ == 1) {
- # get
- my $self = shift;
- return $self->{_type};
- } else {
- # set
- my ($self, $newval) = @_;
- $self->{_type} = uc($newval);
- }
-}
-
-
-sub key {
- if (scalar @_ == 1) {
- # get
- my $self = shift;
- return $self->{_key};
- } else {
- # set
- my ($self, $newval) = @_;
- $self->{_key} = $newval;
- }
-
-}
-
-
-sub field {
- if (scalar @_ == 2) {
- # get
- my ($self, $field) = @_;
- return $self->{ lc( $field ) };
- } else {
- my ($self, $key, $value) = @_;
- my $field = lc ($key);
- $self->{$field} = $value; #_sanitize_field($value);
- if (!exists($self->{_fieldnums}->{$field})) {
- my $num = scalar keys %{$self->{_fieldnums}};
- $self->{_fieldnums}->{$field} = $num;
- }
- }
-
-}
-
-use LaTeX::ToUnicode qw( convert );
-
-
-sub cleaned_field {
- my ( $self, $field, @options ) = @_;
- if ( $field =~ /author|editor/i ) {
- return $self->field( $field );
- } else {
- return convert( $self->field( lc $field ), @options );
- }
-}
-
-
-sub cleaned_author {
- my $self = shift;
- $self->_handle_cleaned_author_editor( [ $self->author ], @_ );
-}
-
-
-sub cleaned_editor {
- my $self = shift;
- $self->_handle_cleaned_author_editor( [ $self->editor ], @_ );
-}
-
-sub _handle_cleaned_author_editor {
- my ( $self, $authors, @options ) = @_;
- map {
- my $author = $_;
- my $new_author = BibTeX::Parser::Author->new;
- map {
- $new_author->$_( convert( $author->$_, @options ) )
- } grep { defined $author->$_ } qw( first von last jr );
- $new_author;
- } @$authors;
-}
-
-no LaTeX::ToUnicode;
-
-sub _handle_author_editor {
- my $type = shift;
- my $self = shift;
- if (@_) {
- if (@_ == 1) { #single string
- # my @names = split /\s+and\s+/i, $_[0];
- $_[0] =~ s/^\s*//;
- $_[0] =~ s/\s*$//;
- my @names = BibTeX::Parser::_split_braced_string($_[0],
- '\s+and\s+');
- if (!scalar @names) {
- $self->error('Bad names in author/editor field');
- return;
- }
- $self->{"_$type"} = [map {new BibTeX::Parser::Author $_} @names];
- $self->field($type, join " and ", @{$self->{"_$type"}});
- } else {
- $self->{"_$type"} = [];
- foreach my $param (@_) {
- if (ref $param eq "BibTeX::Author") {
- push @{$self->{"_$type"}}, $param;
- } else {
- push @{$self->{"_$type"}}, new BibTeX::Parser::Author $param;
- }
-
- $self->field($type, join " and ", @{$self->{"_$type"}});
- }
- }
- } else {
- unless ( defined $self->{"_$type"}) {
- my @names = BibTeX::Parser::_split_braced_string($self->{$type} || "", '\s+and\s+' );
- $self->{"_$type"} = [map {new BibTeX::Parser::Author $_} @names];
- }
- return @{$self->{"_$type"}};
- }
-}
-
-
-
-sub author {
- _handle_author_editor('author', @_);
-}
-
-
-sub editor {
- _handle_author_editor('editor', @_);
-}
-
-
-sub fieldlist {
- my $self = shift;
-
- return grep {!/^_/} keys %$self;
-}
-
-
-sub has {
- my ($self, $field) = @_;
-
- return defined $self->{$field};
-}
-
-sub _sanitize_field {
- my $value = shift;
- for ($value) {
- tr/\{\}//d;
- s/\\(?!=[ \\])//g;
- s/\\\\/\\/g;
- }
- return $value;
-}
-
-
-
-sub raw_bibtex {
- my $self = shift;
- if (@_) {
- $self->{_raw} = shift;
- }
- return $self->{_raw};
-}
-
-sub pre {
- my $self = shift;
- if (@_) {
- $self->{_pre} = shift;
- }
- return $self->{_pre};
-}
-
-
-sub to_string {
- my $self = shift;
- my %options=@_;
- if (!exists($options{canonize_names})) {
- $options{canonize_names}=1;
- }
- my @fields = grep {!/^_/} keys %$self;
- @fields = sort {
- $self->{_fieldnums}->{$a} <=>
- $self->{_fieldnums}->{$b}} @fields;
- my $result = '';
- if ($options{print_pre}) {
- $result .= $self->pre()."\n";
- }
- my $type = $self->type;
- if (exists($options{type_capitalization})) {
- if ($options{type_capitalization} eq 'Lowercase') {
- $type = lc $type;
- }
- if ($options{type_capitalization} eq 'Titlecase') {
- $type = ucfirst lc $type;
- }
- }
- print STDERR $self->key, "\n";
- $result .= '@'.$type."{".$self->key.",\n";
- foreach my $field (@fields) {
- my $value = $self->field($field);
- if ($field eq 'author' && $options{canonize_names}) {
- my @names = ($self->author);
- $value = join(' and ', @names);
- }
- if ($field eq 'editor' && $options{canonize_names}) {
- my @names = ($self->editor);
- $value = join(' and ', @names);
- }
- if (exists($options{field_capitalization})) {
- if ($options{field_capitalization} eq 'Uppercase') {
- $field = uc $field;
- }
- if ($options{field_capitalization} eq 'Titlecase') {
- $field = ucfirst $field;
- }
- }
- $result .= " $field = {"."$value"."},\n";
- }
- $result .= "}";
- return $result;
-}
-
-1; # End of BibTeX::Entry
-
-__END__
-=pod
-
-=head1 NAME
-
-BibTeX::Parser::Entry - Contains a single entry of a BibTeX document.
-
-=head1 SYNOPSIS
-
-This class ist a wrapper for a single BibTeX entry. It is usually created
-by a BibTeX::Parser.
-
- use BibTeX::Parser::Entry;
-
- my $entry = BibTeX::Parser::Entry->new($type, $key, $parse_ok, \%fields);
-
- if ($entry->parse_ok) {
- my $type = $entry->type;
- my $key = $enty->key;
- print $entry->field("title");
- my @authors = $entry->author;
- my @editors = $entry->editor;
-
- ...
-
- print $entry->to_string;
- }
-
-
-
-
-
-=head1 FUNCTIONS
-
-=head2 new
-
-Create new entry.
-
-=head2 parse_ok
-
-If the entry was correctly parsed, this method returns a true value, false otherwise.
-
-=head2 error
-
-Return the error message, if the entry could not be parsed or undef otherwise.
-
-=head2 type
-
-Get or set the type of the entry, eg. 'ARTICLE' or 'BOOK'. Return value is
-always uppercase.
-
-=head2 key
-
-Get or set the reference key of the entry.
-
-=head2 field($name [, $value])
-
-Get or set the contents of a field. The first parameter is the name of the
-field, the second (optional) value is the new value.
-
-=head2 cleaned_field($name)
-
-Retrieve the contents of a field in a format that is cleaned of TeX markup.
-
-=head2 cleaned_author
-
-Get an array of L<BibTeX::Parser::Author> objects for the authors of this
-entry. Each name has been cleaned of accents and braces.
-
-=head2 cleaned_editor
-
-Get an array of L<BibTeX::Parser::Author> objects for the editors of this
-entry. Each name has been cleaned of accents and braces.
-
-=head2 author([@authors])
-
-Get or set the authors. Returns an array of L<BibTeX::Author|BibTeX::Author>
-objects. The parameters can either be L<BibTeX::Author|BibTeX::Author> objects
-or strings.
-
-Note: You can also change the authors with $entry->field('author', $authors_string)
-
-=head2 editor([@editors])
-
-Get or set the editors. Returns an array of L<BibTeX::Author|BibTeX::Author>
-objects. The parameters can either be L<BibTeX::Author|BibTeX::Author> objects
-or strings.
-
-Note: You can also change the authors with $entry->field('editor', $editors_string)
-
-=head2 fieldlist ()
-
-Returns a list of all the fields used in this entry.
-
-=head2 has($fieldname)
-
-Returns a true value if this entry has a value for $fieldname.
-
-=head2 pre ()
-
-Return the text in BibTeX file before the entry
-
-=head2 raw_bibtex ()
-
-Return raw BibTeX entry (if available).
-
-=head2 to_string ([options])
-
-Returns a text of the BibTeX entry in BibTeX format. Options are
-a hash.
-
-=over 4
-
-=item C<canonize_names>
-
-If true (the default), authors' and editors'
-names are translated into canonical bibtex form. The command
-C<$entry-E<gt>to_string(canonize_names=E<gt>0)> overrides this behavior.
-
-=item C<field_capitalization>
-
-Capitalization of the field names.
-Can take values 'Uppercase', 'Lowercase' (the default) or 'Titlecase'
-
-=item C<print_pre>
-
-False by default. If true, the text in the Bib file before the
-entry is printed. Note that at present we assume the text
-before the entry NEVER has the @ symbol inside
-
-=item C<type_capitalization>
-
-Capitalization of the type names.
-Can take values 'Uppercase' (the default), 'Lowercase' or 'Titlecase'
-
-
-=back
-
-=head1 VERSION
-
-version 1.04
-
-=head1 AUTHOR
-
-Gerhard Gossen <gerhard.gossen@googlemail.com> and
-Boris Veytsman <boris@varphi.com> and
-Karl Berry <karl@freefriends.org>
-
-=head1 COPYRIGHT AND LICENSE
-
-This software is copyright (c) 2013-2023 by Gerhard Gossen and Boris Veytsman and Karl Berry
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
-
-=cut
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/notes b/support/bibtexperllibs/BibTeX-Parser/notes
deleted file mode 100644
index 5e41df4090..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/notes
+++ /dev/null
@@ -1,26 +0,0 @@
-from Biblio::Catalog::BibTeX :
-
-sub tex2html {
- my $latex = shift;
- return "" unless defined($latex);
-
- for ($latex) {
- s/\\textit\{([^{]+)\}/<i>$1<\/i>/g;
- s/\\textbf\{([^{]+)\}/<b>$1<\/b>/g;
- s/\\texttt\{([^{]+)\}/<tt>$1<\/tt>/g;
- s/\\emph{([^{]+)}/<i>$1<\/i>/g;
- s/\\item\b/<li>/g;
- s/\\_/_/g;
- s/\\mbox{([^}]+)}/$1/g;
- s/{\\it\s([^}]+)}/<i>$1<\/i>/g;
- s/\\LaTeX/LaTeX/g;
- s/\\begin{itemize}/<ul>/g;
- s/\\begin{quote}/<blockquote><i>/g;
- s/\\end{quote}/<\/i><\/blockquote>/g;
- s/\\end{itemize}/<\/ul>/g;
- s/[}{]//g;
- }
-
- return $latex;
-}
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/00-load.t b/support/bibtexperllibs/BibTeX-Parser/t/00-load.t
deleted file mode 100644
index 9862dc7986..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/00-load.t
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/perl -w
-
-use Test::More tests => 3;
-
-BEGIN {
- use_ok( 'BibTeX::Parser' );
- use_ok( 'BibTeX::Parser::Author' );
- use_ok( 'BibTeX::Parser::Entry' );
-}
-
-diag( "Testing BibTeX::Parser $BibTeX::Parser::VERSION, Perl $], $^X" );
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/01-parse.t b/support/bibtexperllibs/BibTeX-Parser/t/01-parse.t
deleted file mode 100644
index 70e298d4be..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/01-parse.t
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/perl -w
-
-use Test::More tests => 11;
-
-use BibTeX::Parser;
-use IO::File;
-
-use constant ENTRIES => 1;
-
-my $fh = new IO::File "t/bibs/01.bib", "r" ;
-
-if (defined $fh) {
- my $parser = new BibTeX::Parser $fh;
-
- isa_ok($parser, "BibTeX::Parser");
-
- my $count = 0;
-
- while (my $entry = $parser->next) {
- $count++;
- isa_ok($entry, "BibTeX::Parser::Entry");
- is($entry->key, "key01", "key");
- is($entry->type, "ARTICLE", "type");
- ok($entry->parse_ok, "parse_ok");
- is($entry->field("year"), 1950, "field");
- is($entry->field("month"), "January~1", "field");
-
- my @authors = $entry->author;
- is(scalar @authors, 2, "#authors");
- isa_ok($authors[0], "BibTeX::Parser::Author");
- is("$authors[0]", "Duck, Donald", "correct author");
- }
-
- is($count, ENTRIES, "number of entries");
-}
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/02-parse_string.t b/support/bibtexperllibs/BibTeX-Parser/t/02-parse_string.t
deleted file mode 100644
index 90b87eba14..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/02-parse_string.t
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/perl -w
-
-use Test::More tests => 7;
-
-use BibTeX::Parser;
-
-my %strings = ();
-
-$_ = 1234;
-parse_ok("parse digit string");
-
-$_ = '"simple double quoted string"';
-parse_is("simple double quoted string", "- double quoted string");
-
-$_ = '"double quotes { with embeded } brackets"';
-parse_is("double quotes { with embeded } brackets", "- with embeded brackets");
-
-$_ = '"string 1 " # "string 2"';
-parse_is("string 1 string 2", "- concatenation");
-
-$strings{test} = "string";
-$strings{other} = "text";
-
-$_ = "test";
-parse_is("string", "- string variable");
-
-$_ = "test # other";
-parse_is("stringtext", "- concatenation of string variables");
-
-$_ = '"M{\"{u}}nchen"';
-parse_is('M{\"{u}}nchen', "- escaped quote");
-
-sub parse_ok {
- is(BibTeX::Parser::_parse_string(\%strings), $_, shift);
-}
-
-sub parse_is {
- is(BibTeX::Parser::_parse_string(\%strings), shift, shift);
-}
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/03-parse_entry.t b/support/bibtexperllibs/BibTeX-Parser/t/03-parse_entry.t
deleted file mode 100644
index 6b4e4632bc..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/03-parse_entry.t
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/perl -w
-
-use Test::More tests => 3;
-
-use IO::String;
-use BibTeX::Parser;
-
-{
- my $string = q|@article{lin1973,
- author = "Shen Lin and Brian W. Kernighan",
- title = "An Effective Heuristic Algorithm for the Travelling-Salesman Problem",
- journal = "Operations Research",
- volume = 21,
- year = 1973,
- pages = "498--516"
- }|;
- my $fh = IO::String->new($string);
-
- my $parser = BibTeX::Parser->new( $fh );
-
-#my @result = BibTeX::Parser->_parse($fh);
-
- my $entry = $parser->next;
-
- is_deeply($entry, {_type => 'ARTICLE', _key => 'lin1973', author => "Shen Lin and Brian W. Kernighan",
- title => "An Effective Heuristic Algorithm for the Travelling-Salesman Problem",
- journal => "Operations Research",
- volume => 21,
- year => 1973,
- pages => "498--516", _parse_ok => 1,
- _fieldnums => {'author' => 0, 'title' => 1,
- 'journal' => 2, 'volume' => 3,
- 'year' => 4, 'pages' => 5},
- _pre => '',
- _raw => $string}, "parse \@ARTICLE");
-
-}
-{
- my $string1 = q|@article{lin1973,
- author = "Shen Lin and Brian W. Kernighan",
- title = "An Effective Heuristic Algorithm for the Travelling-Salesman Problem",
- journal = "Operations Research",
- volume = 21,
- year = 1973,
- pages = "498--516"
- }|;
- my $string = "some
-text
-$string1";
- my $fh = IO::String->new($string);
-
- my $parser = BibTeX::Parser->new( $fh );
-
-#my @result = BibTeX::Parser->_parse($fh);
-
- my $entry = $parser->next;
-
- is_deeply($entry, {_type => 'ARTICLE', _key => 'lin1973', author => "Shen Lin and Brian W. Kernighan",
- title => "An Effective Heuristic Algorithm for the Travelling-Salesman Problem",
- journal => "Operations Research",
- volume => 21,
- year => 1973,
- pages => "498--516", _parse_ok => 1,
- _fieldnums => {'author' => 0, 'title' => 1,
- 'journal' => 2, 'volume' => 3,
- 'year' => 4, 'pages' => 5},
- _pre => "some\ntext",
- _raw => $string1}, "parse \@ARTICLE");
-
-}
-{
- my $string = q|@InProceedings{Herper:2001:MVS,
- author = {Henry Herper},
- title = {{M}odellierung von {S}ystemen: ein
- {A}pplikationsgebiet im {I}nformatikunterricht},
- booktitle = {Informatikunterricht und Medienbildung, INFOS 2001
- (9. Fachtagung Informatik und Schule, Paderborn
- 17.-20- September 2001) -- Tagungsband},
- editor = {Reinhard Keil-Slavik and Johannes Magenheim},
- year = {2001},
-}|;
- my $fh = IO::String->new($string);
-
- my $parser = BibTeX::Parser->new( $fh );
-
- my $entry = $parser->next;
-
- is_deeply($entry, {
- _type => 'INPROCEEDINGS',
- _key => 'Herper:2001:MVS',
- _fieldnums => {'author' => 0, 'title' => 1,
- 'booktitle' => 2, 'editor' => 3,
- 'year' => 4},
- author => "Henry Herper",
- title => "{M}odellierung von {S}ystemen: ein {A}pplikationsgebiet im {I}nformatikunterricht",
- booktitle => "Informatikunterricht und Medienbildung, INFOS 2001 (9. Fachtagung Informatik und Schule, Paderborn 17.-20- September 2001) -- Tagungsband",
- editor => "Reinhard Keil-Slavik and Johannes Magenheim",
- year => 2001,
- _parse_ok => 1,
- _pre => '',
- _raw => $string}, "parse \@ARTICLE");
-}
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/04-entry.t b/support/bibtexperllibs/BibTeX-Parser/t/04-entry.t
deleted file mode 100644
index 3ca9797011..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/04-entry.t
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/perl -w
-
-use Test::More tests => 13;
-
-use BibTeX::Parser::Entry;
-
-
-my $entry = new BibTeX::Parser::Entry("type", "key", 1, {title => "title"});
-
-isa_ok($entry, "BibTeX::Parser::Entry");
-
-is($entry->type, "TYPE", "Entry::type get");
-
-$entry->type("newtype");
-
-is($entry->type, "NEWTYPE", "Entry::type set");
-
-is($entry->key, "key", "Entry::key get");
-
-$entry->key("newkey");
-
-is($entry->key, "newkey", "Entry::key set");
-
-is($entry->field("title"), "title", "Entry::field with new");
-
-$entry->field("title" => "newtitle");
-
-is($entry->field("title"), "newtitle", "Entry::field overwrite");
-
-$entry->field("year" => 2008);
-
-is($entry->field("year"), 2008, "Entry::field set");
-
-is($entry->field("pages"), undef, "Entry::field undef on unknown value");
-
-is($entry->fieldlist, 2, "size of fieldlist");
-
-ok($entry->has("title"), "Entry::has true on known value");
-
-ok($entry->has("year"), "Entry::has true on known value");
-
-ok( ! $entry->has("pages"), "Entry::has false on unknown value");
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/05-author.t b/support/bibtexperllibs/BibTeX-Parser/t/05-author.t
deleted file mode 100644
index 45bc5413df..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/05-author.t
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/perl
-
-use Test::More;
-
-use BibTeX::Parser::Author;
-
-# Names from Mittelbach, Goossens: The LaTeX Companion, Second Edition.
-my %names = (
- "Donald E. Knuth" => ["Donald E.", undef, "Knuth", undef],
- "John Chris Smith" => ["John Chris", undef, "Smith", undef],
- "Smith, John Chris" => ["John Chris", undef, "Smith", undef],
- "Thomas von Neumann" => ["Thomas", "von", "Neumann", undef],
- "von Neumann, Thomas" => ["Thomas", "von", "Neumann", undef],
- "Lopez Fernandez, Miguel" => ["Miguel", undef, "Lopez Fernandez", undef],
- "Pierre de la Porte" => ["Pierre", "de la", "Porte", undef],
- "Smith, Jr., Robert" => ["Robert", undef, "Smith", "Jr."],
- "von Smith, Jr., Robert" => ["Robert", "von", "Smith", "Jr."],
- "Johannes Martinus Albertus van de Groene Heide" => ["Johannes Martinus Albertus", "van de", "Groene Heide", undef],
- "Maria-Victoria Delgrande" => ["Maria-Victoria", undef, "Delgrande", undef],
- "Anonymous" => [undef, undef, "Anonymous", undef],
- "von Neumann" => [undef, "von", "Neumann", undef],
- "N. Tetteh-Lartey" => ["N.", undef, "Tetteh-Lartey", undef],
- "von Tetteh-Lartey, N." => ["N.", "von", "Tetteh-Lartey", undef],
- "von Tetteh-Lartey, Jr., N." => ["N.", "von", "Tetteh-Lartey", "Jr."],
- "" => [undef, undef, undef, undef],
- " " => [undef, undef, undef, undef],
- "\n" => [undef, undef, undef, undef],
- "al." => [undef, undef, "al.", undef],
- "et.~al." => [undef, undef, "et.~al.", undef],
- "O'Malley, A." => ["A.", undef, "O'Malley", undef],
- "A. O'Malley" => ["A.", undef, "O'Malley", undef],
- "Arthur O'Malley" => ["Arthur", undef, "O'Malley", undef],
- "O'Malley, Arthur" => ["Arthur", undef, "O'Malley", undef],
- 'L.M. M\"uller' => ["L.M.", undef, 'M\"uller', undef],
- 'M\"uller, L.M.' => ["L.M.", undef, 'M\"uller', undef],
- 'L.M. M"uller' => ["L.M.", undef, 'M"uller', undef],
- 'M"uller, L.M.' => ["L.M.", undef, 'M"uller', undef],
- 'van Beethoven, Ludwig' => ["Ludwig", "van", "Beethoven", undef ],
- '{Barnes and Noble, Inc.}' => [undef, undef, '{Barnes and Noble, Inc.}', undef],
- "Ludwigg {van Beethoven}" => ["Ludwigg", undef, "{van Beethoven}", undef],
- '{van Beethoven}, Ludwig' => ["Ludwig", undef, "{van Beethoven}", undef ],
-);
-
-plan tests => (keys(%names) * 6 + 5);
-
-my $author = new BibTeX::Parser::Author;
-
-isa_ok($author, "BibTeX::Parser::Author", "Correct type");
-
-is($author->first, undef, "Initial state 'first'");
-is($author->von, undef, "Initial state 'von'");
-is($author->last, undef, "Initial state 'last'");
-is($author->jr, undef, "Initial state 'jr'");
-
-
-foreach my $name (keys %names) {
-
- is_deeply([BibTeX::Parser::Author->split($name)], $names{$name}, $name =~ /\w/ ? $name : "whitespace name: '$name'" );
-
- $author = new BibTeX::Parser::Author $name;
-
- isa_ok($author, "BibTeX::Parser::Author");
-
- is($author->first, $names{$name}->[0] );
- is($author->von, $names{$name}->[1]);
- is($author->last, $names{$name}->[2]);
- is($author->jr, $names{$name}->[3]);
-}
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/06-parse_complex.t b/support/bibtexperllibs/BibTeX-Parser/t/06-parse_complex.t
deleted file mode 100644
index 95a5848a71..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/06-parse_complex.t
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/perl
-
-use Test::More tests => 19;
-
-use strict;
-use IO::File;
-use BibTeX::Parser;
-
-my $fh = IO::File->new("t/bibs/06.bib");
-
-my $parser = new BibTeX::Parser $fh;
-
-
-my $entry = $parser->next;
-
-isa_ok($entry, 'BibTeX::Parser::Entry', "Correct type");
-ok($entry->parse_ok, "Entry parsed correctly");
-is($entry->type, "ARTICLE", "BibTeX type is correct");
-is($entry->field("title"), "Paper title", "Title attribute");
-is($entry->field("year"), 2008);
-is($entry->field("month"), "August", "Month expansion");
-is($entry->key, 'key1', "key");
-
-my @authors = $entry->author;
-is(scalar @authors, 2, "number of authors correct");
-my $author = shift @authors;
-is_deeply(
- [$author->first, $author->von, $author->last, $author->jr],
- ['Gerhard', undef, 'Gossen', undef], "author correct");
-
-$author = shift @authors;
-is_deeply(
- [$author->first, $author->von, $author->last, $author->jr],
- ['Ludwig', 'van', 'Beethoven', undef], "author correct");
-
-$entry = $parser->next;
-isa_ok($entry, 'BibTeX::Parser::Entry', "Correct type");
-ok($entry->parse_ok, "Entry parsed correctly");
-is($entry->type, "BOOK", "BibTeX type is correct");
-is($entry->field("title"), "Book title", "Title attribute");
-is($entry->field("year"), 2008);
-is($entry->field("month"), "August", "Month expansion");
-is($entry->key, 'key2', "key");
-@authors = $entry->author;
-is(scalar @authors, 1, "number of authors");
-is(scalar $entry->editor, 0, "number of editors");
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/07-parse_englishbib.t b/support/bibtexperllibs/BibTeX-Parser/t/07-parse_englishbib.t
deleted file mode 100644
index 3348a55248..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/07-parse_englishbib.t
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/perl
-
-use Test::More tests => 8;
-
-use strict;
-use IO::File;
-use BibTeX::Parser;
-
-
-my $fh = IO::File->new("t/bibs/english.bib");
-
-my $parser = new BibTeX::Parser $fh;
-
-my $count = 0;
-
-my $entry = $parser->next;
-
-is($entry->parse_ok, 0, "Ignore spurious @ before parenthesis");
-
-$entry = $parser->next;
-
-is($entry->parse_ok, 0, "Ignore spurious @ in email address");
-
-$entry = $parser->next;
-
-is(scalar $entry->author, 1, "# authors");
-#@BOOK{Carey,
-# AUTHOR="G. V. Carey",
-is($entry->field("title"), "Mind the Stop: A Brief Guide to Punctuation", "title");
-is($entry->field("publisher"), "Penguin", "publisher");
-is($entry->field("year"), 1958, "year");
-$count++;
-
-while ($entry = $parser->next) {
- $count++;
- if ($count == 8) {
- is( scalar $entry->author, 4, 'Last entry has 4 authors');
- }
-}
-
-
-is($count, 8, "number of entries");
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/08-parse_large.t b/support/bibtexperllibs/BibTeX-Parser/t/08-parse_large.t
deleted file mode 100644
index 5375d9a062..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/08-parse_large.t
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/perl -w
-
-use Test::More skip_all => "Performance test", tests => 1;
-
-use IO::File;
-use BibTeX::Parser;
-
-my $starttime = time;
-
-my $fh = IO::File->new('t/bibs/java.bib'); #cl-nlp8x.bib');
-
-my $parser = new BibTeX::Parser $fh;
-my $entries = 0;
-
-#my @result = BibTeX::Parser->_parse($fh);
-
-while(my $entry = $parser->next) {
- $entries++;
-}
-
-my $parsetime = time - $starttime;
-
-warn "Parsed $entries entries in $parsetime seconds";
-ok(1, "Parsed $entries entries in $parsetime seconds");
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/09-complex.t b/support/bibtexperllibs/BibTeX-Parser/t/09-complex.t
deleted file mode 100644
index 56ce75cceb..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/09-complex.t
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/perl -w
-
-use Test::More tests => 1;
-
-use IO::File;
-use BibTeX::Parser;
-
-
-my $fh = IO::File->new('t/bibs/09-complex.bib');
-
-my $parser = new BibTeX::Parser $fh;
-
-#my @result = BibTeX::Parser->_parse($fh);
-
-my $entry = $parser->next;
-
-is_deeply($entry, {_type => 'ARTICLE', _key => 'Ahrenberg88',
- author => "L. Ahrenberg and A. Jonsson",
- title => "An interactive system for tagging dialogues",
- journal => 'Literary \& Linguistic Computing',
- volume => 3,
- number => "2",
- pages => "66--70",
- year => "1988",
- keywords => "conver",
- _fieldnums => {'author' => 0, 'title' => 1,
- 'journal' => 2, 'volume' => 3,
- 'number' => 4, 'pages'=> 5,
- 'year' => 6, 'keywords' => 7},
- _parse_ok => 1,
- _raw => '@Article{Ahrenberg88,
- author = "L. Ahrenberg and A. Jonsson",
- title = "An interactive system for tagging dialogues",
- journal = "Literary \& Linguistic Computing",
- volume = "3",
- number = "2",
- pages = "66--70",
- year = "1988",
- keywords = "conver",
-}',
- _pre => ''
- }, "parse \@ARTICLE");
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/10-funnyname.t b/support/bibtexperllibs/BibTeX-Parser/t/10-funnyname.t
deleted file mode 100644
index 8ab48396e9..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/10-funnyname.t
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/perl -w
-
-use Test::More tests => 11;
-
-use IO::File;
-use BibTeX::Parser;
-
-my $fh = IO::File->new('t/bibs/10-funnyname.bib');
-
-my $parser = BibTeX::Parser->new($fh);
-
-#my @result = BibTeX::Parser->_parse($fh);
-
-my $entry = $parser->next;
-
-is_deeply(
- $entry,
- {
- _type => 'ARTICLE',
- _key => 'testkey',
- author => 'A. Bar and L.M. M\"uller',
- title => 'foo',
- journal => 'journal',
- volume => 1,
- number => 1,
- pages => 1,
- year => 2008,
- _parse_ok => 1,
- _fieldnums => {'year' => 0, 'title' => 1,
- 'author' => 2, 'journal' => 3,
- 'volume' => 4, 'number'=> 5,
- 'pages' => 6},
- _raw => '@article{testkey,
- year = {2008},
- title = "foo",
- author = {A. Bar and L.M. M\"uller},
- journal = {journal},
- volume = {1},
- number = {1},
- pages = {1},
-}',
- _pre => ''
- },
- "parse \@ARTICLE"
-);
-
-my @authors = $entry->author;
-
-pass("->author didn't loop forever");
-ok(@authors == 2, "Two authors");
-
-is($authors[0]->first, 'A.', "A1 first name");
-is($authors[0]->last, 'Bar', "A1 last name");
-ok(!$authors[0]->von, "A1 no 'von'");
-ok(!$authors[0]->jr, "A1 no 'jr'");
-
-is($authors[1]->first, 'L.M.', "A2 first name");
-is($authors[1]->last, 'M\"uller', "A2 last name");
-ok(!$authors[1]->von, "A2 no 'von'");
-ok(!$authors[1]->jr, "A2 no 'jr'");
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/11-split_braced.t b/support/bibtexperllibs/BibTeX-Parser/t/11-split_braced.t
deleted file mode 100644
index 85a29be86f..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/11-split_braced.t
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/perl -w
-
-use Test::More tests => 12;
-
-use BibTeX::Parser;
-use IO::File;
-
-my @tokens = BibTeX::Parser::_split_braced_string("a and b", '\s+and\s+');
-is(scalar @tokens,2);
-is($tokens[0],'a');
-is($tokens[1],'b');
-
-@tokens = BibTeX::Parser::_split_braced_string("a {and} b", '\s+and\s+');
-is(scalar @tokens,1);
-is($tokens[0],'a {and} b');
-
-@tokens = BibTeX::Parser::_split_braced_string("a {and b", '\s+and\s+');
-is(scalar @tokens,0);
-
-@tokens = BibTeX::Parser::_split_braced_string("} a {", '\s+');
-is(scalar @tokens,0);
-
-@tokens = BibTeX::Parser::_split_braced_string("{a b} c {d}e u", '\s+');
-is(scalar @tokens,4);
-is($tokens[0],'{a b}');
-is($tokens[1],'c');
-is($tokens[2],'{d}e');
-is($tokens[3],'u');
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/12-von_token.t b/support/bibtexperllibs/BibTeX-Parser/t/12-von_token.t
deleted file mode 100644
index 6daceafa96..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/12-von_token.t
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/perl -w
-
-use Test::More tests => 5;
-
-use BibTeX::Parser::Author;
-use IO::File;
-
-is(BibTeX::Parser::Author::_is_von_token('von'),1);
-is(BibTeX::Parser::Author::_is_von_token('Von'),0);
-is(BibTeX::Parser::Author::_is_von_token('\noop{von}Von'),1);
-is(BibTeX::Parser::Author::_is_von_token('\noop{Von}von'),0);
-is(BibTeX::Parser::Author::_is_von_token('\noop{AE}{\AE}schylus'),0);
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/13_output.t b/support/bibtexperllibs/BibTeX-Parser/t/13_output.t
deleted file mode 100644
index 02fb1cd26f..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/13_output.t
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/perl -w
-
-use Test::More;
-
-use BibTeX::Parser;
-use IO::File;
-
-
-my $fh = new IO::File "t/bibs/01.bib", "r" ;
-
-my $parser = new BibTeX::Parser $fh;
-
-
-
-
-while (my $entry = $parser->next) {
- if($entry->key eq 'key01') {
- my $result1='@ARTICLE{key01,
- year = {1950},
- author = {Duck, Donald and Else, Someone},
- editor = {Itor, E. D. and Other, A. N.},
- title = {Title text},
- month = {January~1},
-}';
- my $result2='@ARTICLE{key01,
- year = {1950},
- author = {Donald Duck and Someone Else},
- editor = {E. D. Itor and A. N. Other},
- title = {Title text},
- month = {January~1},
-}';
- is($entry->to_string,$result1);
- is($entry->to_string(canonize_names=>0),$result2);
- }
-
-}
-
-done_testing();
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/14-extratext.t b/support/bibtexperllibs/BibTeX-Parser/t/14-extratext.t
deleted file mode 100644
index 0a663b043a..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/14-extratext.t
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/perl -w
-
-
-use Test::More tests => 6;
-
-use BibTeX::Parser;
-use IO::File;
-
-
-my $fh = new IO::File "t/bibs/14-extratext.bib", "r" ;
-
-my $parser = new BibTeX::Parser $fh;
-
-
-
-
-while (my $entry = $parser->next) {
-
- if($entry->key eq 'Partridge') {
- my $result1= '@BOOK{Partridge,
- author = {Partridge, Eric},
- title = {Use and Abuse: a Guide to Good {E}nglish},
- publisher = {Hamish Hamilton},
- edition = {4},
- year = {1970},
-}';
- my $result2 = "First published in 1947\n$result1";
- is($entry->to_string,$result1);
- is($entry->to_string(print_pre=>1),$result2);
- }
-
- if ($entry->key eq 'Cooper') {
- my $result1 = '@BOOK{Cooper,
- author = {Cooper, Bruce M.},
- title = {Writing Technical Reports},
- publisher = {Penguin},
- year = {1964},
-}';
- my $result2 = "\n\n$result1";
- is($entry->to_string,$result1);
- is($entry->to_string(print_pre=>1),$result2);
- }
-
-
- if ($entry->key eq 'Fowler-ModernEnglish') {
-
- my $result1 = '@BOOK{Fowler-ModernEnglish,
- author = {Fowler, H. W.},
- title = {[A Dictionary of] Modern {E}nglish Usage},
- publisher = {Oxford University Press},
- edition = {2},
- year = {1965},
-}';
- my $result2 = '
-
-
-First published in 1926
-'. $result1;
- is($entry->to_string,$result1);
- is($entry->to_string(print_pre=>1),$result2);
- }
-}
-
-done_testing();
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/15-capitalization.t b/support/bibtexperllibs/BibTeX-Parser/t/15-capitalization.t
deleted file mode 100644
index 4254f5c12f..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/15-capitalization.t
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/perl -w
-
-use Test::More tests=>7;
-
-use BibTeX::Parser;
-use IO::File;
-
-
-my $fh = new IO::File "t/bibs/01.bib", "r" ;
-
-my $parser = new BibTeX::Parser $fh;
-
-
-
-
-while (my $entry = $parser->next) {
- if($entry->key eq 'key01') {
- my $result1='@ARTICLE{key01,
- year = {1950},
- author = {Duck, Donald and Else, Someone},
- editor = {Itor, E. D. and Other, A. N.},
- title = {Title text},
- month = {January~1},
-}';
- my $result2='@ARTICLE{key01,
- YEAR = {1950},
- AUTHOR = {Duck, Donald and Else, Someone},
- EDITOR = {Itor, E. D. and Other, A. N.},
- TITLE = {Title text},
- MONTH = {January~1},
-}';
- my $result3='@ARTICLE{key01,
- Year = {1950},
- Author = {Duck, Donald and Else, Someone},
- Editor = {Itor, E. D. and Other, A. N.},
- Title = {Title text},
- Month = {January~1},
-}';
- my $result4='@article{key01,
- year = {1950},
- author = {Duck, Donald and Else, Someone},
- editor = {Itor, E. D. and Other, A. N.},
- title = {Title text},
- month = {January~1},
-}';
- my $result5='@Article{key01,
- year = {1950},
- author = {Duck, Donald and Else, Someone},
- editor = {Itor, E. D. and Other, A. N.},
- title = {Title text},
- month = {January~1},
-}';
- is($entry->to_string,$result1);
- is($entry->to_string(field_capitalization=>'Lowercase'),
- $result1);
- is($entry->to_string(field_capitalization=>'Uppercase'),
- $result2);
- is($entry->to_string(field_capitalization=>'Titlecase'),
- $result3);
-
- is($entry->to_string(type_capitalization=>'Lowercase'),
- $result4);
- is($entry->to_string(type_capitalization=>'Uppercase'),
- $result1);
- is($entry->to_string(type_capitalization=>'Titlecase'),
- $result5);
- }
-
-}
-
-done_testing();
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/bibs/01.bib b/support/bibtexperllibs/BibTeX-Parser/t/bibs/01.bib
deleted file mode 100644
index 7f6233d177..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/bibs/01.bib
+++ /dev/null
@@ -1,7 +0,0 @@
-@ARTICLE{key01,
- year = 1950,
- author = {Donald Duck and Someone Else},
- editor = {E. D. Itor and A. N. Other},
- title = {Title text},
- month = jan # "~1"
-}
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/bibs/06.bib b/support/bibtexperllibs/BibTeX-Parser/t/bibs/06.bib
deleted file mode 100644
index 242ae662cc..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/bibs/06.bib
+++ /dev/null
@@ -1,27 +0,0 @@
-this is text, which is ignored by bibtex.
-
-@PREAMBLE{
- This is only used for BibTeX files used in LaTeX documents
-}
-
-@Comment{
- Comments are ignored too.
-}
-
-@ARTICLE{key1,
- author = {Gerhard Gossen and Ludwig van Beethoven},
- title = "Paper title",
- year = 2008,
- month = aug,
-}
-
-@STRING{ gerhard = "Gerhard" }
-
-@STRING{ gossen = "Gossen" }
-
-@BOOK{ key2,
- author = gerhard # " " # gossen,
- title = "Book title",
- year = "2008",
- month = aug,
-}
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/bibs/09-complex.bib b/support/bibtexperllibs/BibTeX-Parser/t/bibs/09-complex.bib
deleted file mode 100644
index cacf322723..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/bibs/09-complex.bib
+++ /dev/null
@@ -1,11 +0,0 @@
-@Article{Ahrenberg88,
- author = "L. Ahrenberg and A. Jonsson",
- title = "An interactive system for tagging dialogues",
- journal = "Literary \& Linguistic Computing",
- volume = "3",
- number = "2",
- pages = "66--70",
- year = "1988",
- keywords = "conver",
-}
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/bibs/10-funnyname.bib b/support/bibtexperllibs/BibTeX-Parser/t/bibs/10-funnyname.bib
deleted file mode 100644
index 050fbc0534..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/bibs/10-funnyname.bib
+++ /dev/null
@@ -1,10 +0,0 @@
-@article{testkey,
- year = {2008},
- title = "foo",
- author = {A. Bar and L.M. M\"uller},
- journal = {journal},
- volume = {1},
- number = {1},
- pages = {1},
-}
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/bibs/14-extratext.bib b/support/bibtexperllibs/BibTeX-Parser/t/bibs/14-extratext.bib
deleted file mode 100644
index 56f96aa01b..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/bibs/14-extratext.bib
+++ /dev/null
@@ -1,22 +0,0 @@
-First published in 1947
-@BOOK{Partridge,
- AUTHOR="Eric Partridge",
- TITLE="Use and Abuse: a Guide to Good {E}nglish",
- PUBLISHER="Hamish Hamilton",
- EDITION="4", YEAR="1970"}
-
-
-@BOOK{Cooper,
- AUTHOR="Bruce M. Cooper",
- TITLE="Writing Technical Reports",
- PUBLISHER="Penguin", YEAR="1964"}
-
-
-
-First published in 1926
-@BOOK{Fowler-ModernEnglish,
- AUTHOR="H. W. Fowler",
- TITLE="[A Dictionary of] Modern {E}nglish Usage",
- PUBLISHER="Oxford University Press",
- EDITION="2", YEAR="1965"}
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/bibs/braces.bib b/support/bibtexperllibs/BibTeX-Parser/t/bibs/braces.bib
deleted file mode 100644
index 3791fb5760..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/bibs/braces.bib
+++ /dev/null
@@ -1,21 +0,0 @@
-@Article{scholkopf98kpca,
- author = {Bernhard {Sch\"olkopf} and Alex Smola and K.R. Muller},
- title = {Nonlinear component analysis as a kernel eigenvalue
-problem},
- journal = {Neural Computation},
- year = {1998},
- volume = {10},
- pages = {1299--1319}
-}
-
-@article{brownetal93,
- author = {Peter F. Brown and Stephen A. {Della Pietra} and
- Vincent J. {Della Pietra} and Robert~L. Mercer},
- title = {The Mathematics of Statistical Machine Translation:
- Parameter Estimation},
- journal = {Computational Linguistics},
- year = 1993,
- volume = 19,
- number = 2,
- pages = {263-311}
-}
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/bibs/endnote.txt b/support/bibtexperllibs/BibTeX-Parser/t/bibs/endnote.txt
deleted file mode 100644
index e75f1d2050..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/bibs/endnote.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-@article{
- volume = {59},
- number = {6},
- year = {1999}
-}
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/bibs/engineering_village.txt b/support/bibtexperllibs/BibTeX-Parser/t/bibs/engineering_village.txt
deleted file mode 100644
index 256f5a853d..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/bibs/engineering_village.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-@inproceedings{1997493856789 ,
-language = {English},
-year = {1997},
-}
-
-
-@inproceedings{1998043944915 ,
-language = {English},
-year = {1997},
-}
-
-
-@article{2003137419501 ,
-language = {English},
-year = {2002},
-}
-
-
-@inproceedings{2002367072517 ,
-language = {English},
-year = {2002},
-}
-
-
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib b/support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib
deleted file mode 100644
index f0f097409f..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib
+++ /dev/null
@@ -1,55 +0,0 @@
-$Id: @(#) english.bib 1.0 23-OCT-1989 17:10:00 Aston archive$
-
-Please notify Adrian F Clark <alien@uk.ac.essex.ese> of any additions
-or corrections to this list.
-
-@BOOK{Carey,
- AUTHOR="G. V. Carey",
- TITLE="Mind the Stop: A Brief Guide to Punctuation",
- PUBLISHER="Penguin", YEAR="1958"}
-
-@BOOK{Cooper,
- AUTHOR="Bruce M. Cooper",
- TITLE="Writing Technical Reports",
- PUBLISHER="Penguin", YEAR="1964"}
-
-@BOOK{Fowler-ModernEnglish,
- AUTHOR="H. W. Fowler",
- TITLE="[A Dictionary of] Modern {E}nglish Usage",
- PUBLISHER="Oxford University Press",
- EDITION="2", YEAR="1965"}
- (but first published in 1926)
-
-@BOOK{Fowler-KingsEnglish,
- AUTHOR="H. W. Fowler and F. G. Fowler",
- TITLE="The {K}ing's {E}nglish",
- PUBLISHER="Oxford University Press",
- EDITION="3", YEAR="1931"}
- (but first published in 1906)
-
-@BOOK{Gowers,
- AUTHOR="Sir Ernest Gowers",
- TITLE="The Complete Plain Words",
- PUBLISHER="Penguin", YEAR="1954"}
- (but first published by HMSO)
-
-@BOOK{Hart,
- AUTHOR="Horace Hart",
- TITLE="[Hart's] Rules for Compositors and Readers
- [at the Oxford University Press]",
- PUBLISHER="Oxford University Press",
- EDITION="39", YEAR="1983"}
- (but first published in 1893)
-
-@BOOK{Partridge,
- AUTHOR="Eric Partridge",
- TITLE="Use and Abuse: a Guide to Good {E}nglish",
- PUBLISHER="Hamish Hamilton",
- EDITION="4", YEAR="1970"}
- (but first published in 1947)
-
-@BOOK{Quirk-CompGram,
- AUTHOR="Randolph Quirk and Sydney Greenbaum and Geoffrey Leach and
- Jan Svartnik",
- TITLE="A Comprehensive Grammar of the {E}nglish Language",
- PUBLISHER="Longman", YEAR="1985"}
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/bibs/mathscinet.txt b/support/bibtexperllibs/BibTeX-Parser/t/bibs/mathscinet.txt
deleted file mode 100644
index eea5a05a70..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/bibs/mathscinet.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-MathSciNet </mathscinet/index.html>
-
- *
- Clipboard </mathscinet/clipboard.html>
- * Home </mathscinet/index.html>
- * Preferences </mathscinet/preferences.html>
- * Help </mathscinet/help/headline_review_help_full.html>
- * Support Mail </mathscinet/support_mail.html>
- * Terms of Use </mathscinet/help/mathscinet_terms_of_use.html>
- * University of Southampton
-
-@article {MR2254280,
- VOLUME = {23},
- YEAR = {2006},
-}
-
-
-@article {MR2254274,
- VOLUME = {23},
- YEAR = {2006},
-}
-
-
-@article {MR2248052,
- VOLUME = {23},
- YEAR = {2006},
-}
-
-
-*Matches:* 3
-Mirror Sites
-
-
-© Copyright 2011, American Mathematical Society
-<http://www.ams.org/ams/copyright.html>
-Privacy Statement <http://www.ams.org/ams/privacy.html>
-American Mathematical Society <http://www.ams.org>
-American Mathematical Society
-201 Charles Street
-Providence, RI 02904-2294
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/bug66325.t b/support/bibtexperllibs/BibTeX-Parser/t/bug66325.t
deleted file mode 100644
index ac83b43aa9..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/bug66325.t
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/perl -w
-
-use Test::More;
-
-use BibTeX::Parser;
-use IO::File;
-
-{
- my $fh = new IO::File "t/bibs/endnote.txt", "r" ;
-
- if (defined $fh) {
- my $parser = new BibTeX::Parser $fh;
-
- while (my $entry = $parser->next) {
- isa_ok($entry, "BibTeX::Parser::Entry");
- ok($entry->parse_ok, "parse_ok");
- is($entry->key, undef, "key");
- is($entry->type, "ARTICLE", "type");
- is($entry->field("year"), 1999, "field");
- is($entry->field("volume"), 59, "first field");
- }
- }
-}
-
-{
- my $fh = new IO::File "t/bibs/mathscinet.txt", "r" ;
- my @keys = qw(MR2254280 MR2254274 MR2248052);
-
- if (defined $fh) {
- my $parser = new BibTeX::Parser $fh;
- my $count = 0;
-
- while (my $entry = $parser->next) {
- isa_ok($entry, "BibTeX::Parser::Entry");
- ok($entry->parse_ok, "parse_ok");
- is($entry->key, $keys[$count], "key");
- is($entry->type, "ARTICLE", "type");
- is($entry->field("volume"), 23, "first field");
- is($entry->field("year"), 2006, "field");
- $count++;
- }
-
- is($count, 3, "number of entries");
- }
-}
-
-{
- my $fh = new IO::File "t/bibs/engineering_village.txt", "r" ;
-
- my @types = qw( inproceedings inproceedings article inproceedings );
- my @keys = qw( 1997493856789 1998043944915 2003137419501 2002367072517 );
- my @years = qw( 1997 1997 2002 2002 );
-
- if (defined $fh) {
- my $parser = new BibTeX::Parser $fh;
- my $count = 0;
-
- while (my $entry = $parser->next) {
- isa_ok($entry, "BibTeX::Parser::Entry");
- ok($entry->parse_ok, "parse_ok");
- is($entry->key, $keys[$count], "key");
- is($entry->type, uc $types[$count], "type");
- is($entry->field("language"), "English", "first field");
- is($entry->field("year"), $years[$count], "field");
- $count++;
- }
-
- is($count, 4, "number of entries");
- }
-}
-done_testing;
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/bug67419.t b/support/bibtexperllibs/BibTeX-Parser/t/bug67419.t
deleted file mode 100644
index 0f944f373a..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/bug67419.t
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/perl -w
-
-use Test::More;
-
-use BibTeX::Parser;
-use IO::File;
-
-my $fh = new IO::File "t/bibs/braces.bib", "r" ;
-my $parser = new BibTeX::Parser $fh;
-while (my $entry=$parser->next) {
- is($entry->parse_ok,1);
- if ($entry->key eq 'scholkopf98kpca') {
- @authors=$entry->author;
- is(scalar @authors,3);
- is("$authors[0]", '{Sch\"olkopf}, Bernhard');
- is("$authors[1]", 'Smola, Alex');
- is("$authors[2]", 'Muller, K.R.');
- }
- if ($entry->key eq 'brownetal93') {
- @authors=$entry->author;
- is(scalar @authors,4);
- is("$authors[0]", 'Brown, Peter F.');
- is("$authors[1]", '{Della Pietra}, Stephen A.');
- is("$authors[2]", '{Della Pietra}, Vincent J.');
- is("$authors[3]", 'Mercer, Robert~L.');
- }
-}
-
-done_testing();
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/cleaned_field.t b/support/bibtexperllibs/BibTeX-Parser/t/cleaned_field.t
deleted file mode 100644
index 980fb1d60d..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/cleaned_field.t
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use utf8;
-
-use Test::More;
-use BibTeX::Parser::Entry;
-
-sub new_entry {
- BibTeX::Parser::Entry->new( 'ARTICLE', 'Foo2010', 1, { @_ } );
-}
-{
- my @german_tests = (
- [ '"a' => 'ä' ],
- ['"`' => '„' ],
- ["\"'" => '“' ],
- );
-
- foreach my $test ( @german_tests ) {
- my $entry = new_entry( foo => $test->[0] );
- is( $entry->cleaned_field( 'foo', german => 1 ), $test->[1], "Convert $test->[0], german => 1" );
- }
-}
-
-{
- binmode( DATA, ':utf8' );
- while (<DATA>) {
- chomp;
- my ( $tex, $result ) = split /\t/;
- is( new_entry( foo => $tex )->cleaned_field( 'foo' ), $result, "Convert $tex" );
- }
- close DATA;
-}
-
-{
- my $entry_with_authors = new_entry( author => 'F{\"o}o Bar and B"ar, F.' );
- my @authors = $entry_with_authors->author;
- is( scalar @authors, 2, "Number of authors is correct");
- is( $authors[0]->first, 'F{\"o}o', "non-cleaned version of first" );
- is( $authors[0]->last, 'Bar', "non-cleaned version of last" );
-
- is( $authors[1]->first, 'F.', "non-cleaned version of first" );
- is( $authors[1]->last, 'B"ar', "non-cleaned version of last" );
-
- my @clean_authors = $entry_with_authors->cleaned_author;
- is( $clean_authors[0]->first, 'Föo', "cleaned version of first" );
- is( $clean_authors[0]->last, 'Bar', "cleaned version of last" );
-
- is( $clean_authors[1]->first, 'F.', "cleaned version of first" );
- is( $clean_authors[1]->last, 'B"ar', "cleaned version of last" );
-}
-done_testing;
-
-__DATA__
-\# #
-\& &
-{\`a} à
-{\^a} â
-{\~a} ã
-{\'a} á
-{\'{a}} á
-{\"a} ä
-{\`A} À
-{\'A} Á
-{\"A} Ä
-{\aa} å
-{\AA} Å
-{\ae} æ
-{\bf 12} 12
-{\'c} ć
-{\cal P} P
-{\c{c}} ç
-{\c{C}} Ç
-{\c{e}} ȩ
-{\c{s}} ş
-{\c{S}} Ş
-{\c{t}} ţ
-{\-d} d
-{\`e} è
-{\^e} ê
-{\'e} é
-{\"e} ë
-{\'E} É
-{\em bits} bits
-{\H{o}} ő
-{\`i} ì
-{\^i} î
-{\i} ı
-{\`i} ì
-{\'i} í
-{\"i} ï
-{\`\i} ì
-{\'\i} í
-{\"\i} ï
-{\`{\i}} ì
-{\'{\i}} í
-{\"{\i}} ï
-{\it Note} Note
-{\k{e}} ę
-{\l} ł
-{\-l} l
-{\log} log
-{\~n} ñ
-{\'n} ń
-{\^o} ô
-{\o} ø
-{\'o} ó
-{\"o} ö
-{\"{o}} ö
-{\'O} Ó
-{\"O} Ö
-{\"{O}} Ö
-{\rm always} always
-{\-s} s
-{\'s} ś
-{\sc JoiN} JoiN
-{\sl bit\/ \bf 7} bit 7
-{\sl L'Informatique Nouvelle} L’Informatique Nouvelle
-{\small and} and
-{\ss} ß
-{\TeX} TeX
-{\TM} ™
-{\tt awk} awk
-{\^u} û
-{\'u} ú
-{\"u} ü
-{\"{u}} ü
-{\'U} Ú
-{\"U} Ü
-{\u{a}} ă
-{\u{g}} ğ
-{\v{c}} č
-{\v{C}} Č
-{\v{e}} ě
-{\v{n}} ň
-{\v{r}} ř
-{\v{s}} š
-{\v{S}} Š
-{\v{z}} ž
-{\v{Z}} Ž
-{\'y} ý
-{\.{z}} ż
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/pod-coverage.t b/support/bibtexperllibs/BibTeX-Parser/t/pod-coverage.t
deleted file mode 100644
index fc40a57c2a..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/pod-coverage.t
+++ /dev/null
@@ -1,18 +0,0 @@
-use strict;
-use warnings;
-use Test::More;
-
-# Ensure a recent version of Test::Pod::Coverage
-my $min_tpc = 1.08;
-eval "use Test::Pod::Coverage $min_tpc";
-plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
- if $@;
-
-# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
-# but older versions don't recognize some common documentation styles
-my $min_pc = 0.18;
-eval "use Pod::Coverage $min_pc";
-plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
- if $@;
-
-all_pod_coverage_ok();
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/pod.t b/support/bibtexperllibs/BibTeX-Parser/t/pod.t
deleted file mode 100644
index e22a39b524..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/pod.t
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use warnings;
-use Test::More;
-
-# Ensure a recent version of Test::Pod
-my $min_tp = 1.22;
-eval "use Test::Pod $min_tp";
-plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;
-
-all_pod_files_ok();
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/release-pod-coverage.t b/support/bibtexperllibs/BibTeX-Parser/t/release-pod-coverage.t
deleted file mode 100644
index 3a818499f0..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/release-pod-coverage.t
+++ /dev/null
@@ -1,21 +0,0 @@
-#!perl
-
-BEGIN {
- unless ($ENV{RELEASE_TESTING}) {
- require Test::More;
- Test::More::plan(skip_all => 'these tests are for release candidate testing');
- }
-}
-
-
-use Test::More;
-
-eval "use Test::Pod::Coverage 1.08";
-plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage"
- if $@;
-
-eval "use Pod::Coverage::TrustPod";
-plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage"
- if $@;
-
-all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
diff --git a/support/bibtexperllibs/BibTeX-Parser/t/release-pod-syntax.t b/support/bibtexperllibs/BibTeX-Parser/t/release-pod-syntax.t
deleted file mode 100644
index d46a955694..0000000000
--- a/support/bibtexperllibs/BibTeX-Parser/t/release-pod-syntax.t
+++ /dev/null
@@ -1,15 +0,0 @@
-#!perl
-
-BEGIN {
- unless ($ENV{RELEASE_TESTING}) {
- require Test::More;
- Test::More::plan(skip_all => 'these tests are for release candidate testing');
- }
-}
-
-use Test::More;
-
-eval "use Test::Pod 1.41";
-plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
-
-all_pod_files_ok();
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/Changes b/support/bibtexperllibs/LaTeX-ToUnicode/Changes
deleted file mode 100644
index 3db5c19724..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/Changes
+++ /dev/null
@@ -1,27 +0,0 @@
-Changes for LaTeX::ToUnicode
-
-0.54 2023-11-17 Better handling of \{ \}. New release
-
-0.53 2023-08-20 Tests fixed, new release
-
-0.52 2022-11-07 Support many more control sequences, \kern removal,
- \<newline>, etc. Add ltxunitxt script to access functionality
- from command line.
-
-0.11 2020-12-12 Updates and cleaing
-
-0.05 2016-11-23 02:28:35+00:00
- Compatibility with perl 5.25 (Alexandr Ciornii)
-
-0.04 2015-12-25 19:16:41+00:00
- Macrons are handled properly
-
-0.03 2010-10-18 18:04:14
- Specify minimal perl version (5.8.0) for UTF-8 support
-
-0.02 2010/07/09
- Handle accents with \i
- Add script used to generate accents table
-
-0.01 2010/07/09
- First release.
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/LICENSE b/support/bibtexperllibs/LaTeX-ToUnicode/LICENSE
deleted file mode 100644
index c3402b3869..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/LICENSE
+++ /dev/null
@@ -1,375 +0,0 @@
-Copyright 2010-2023 Gerhard Gossen, Boris Veytsman, Karl Berry
-
-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 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.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307, 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.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, 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.
-
- <signature of Ty Coon>, 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) 2010 by Gerhard Gossen.
-
-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
-
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/MANIFEST b/support/bibtexperllibs/LaTeX-ToUnicode/MANIFEST
deleted file mode 100644
index 2aa0688c10..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/MANIFEST
+++ /dev/null
@@ -1,17 +0,0 @@
-LICENSE
-Changes
-MANIFEST
-t/release-pod-coverage.t
-t/release-pod-syntax.t
-t/convert.t
-t/release-synopsis.t
-README
-script/ltx2unitxt
-script/convert.pl
-lib/LaTeX/ToUnicode/Tables.pm
-lib/LaTeX/ToUnicode.pm
-Makefile.PL
-head.ltx
-Makefile.TDS
-weaver.ini
-dist.ini
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/Makefile.PL b/support/bibtexperllibs/LaTeX-ToUnicode/Makefile.PL
deleted file mode 100644
index 7aa2b21234..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/Makefile.PL
+++ /dev/null
@@ -1,51 +0,0 @@
-
-use strict;
-use warnings;
-
-BEGIN { require 5.8.0; }
-
-use ExtUtils::MakeMaker 6.31;
-
-
-
-my %WriteMakefileArgs = (
- 'ABSTRACT' => 'Convert LaTeX commands to Unicode',
- 'AUTHOR' => 'Gerhard Gossen <gerhard.gossen@googlemail.com> and Boris Veytsman <boris@varphi.com> and Karl Berry <karl@freefriends.com>',
- 'BUILD_REQUIRES' => {
- 'Pod-LaTeX' => '0.61'
- },
- 'CONFIGURE_REQUIRES' => {
- 'ExtUtils::MakeMaker' => '6.31'
- },
- 'DISTNAME' => 'LaTeX-ToUnicode',
- 'EXE_FILES' => ['script/ltx2unitxt'],
- 'LICENSE' => 'perl',
- 'NAME' => 'LaTeX::ToUnicode',
- 'PREREQ_PM' => {},
- 'VERSION_FROM' => 'lib/LaTeX/ToUnicode.pm',
- 'test' => {
- 'TESTS' => 't/*.t'
- }
-);
-
-
-unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
- my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
- my $pp = $WriteMakefileArgs{PREREQ_PM};
- for my $mod ( keys %$br ) {
- if ( exists $pp->{$mod} ) {
- $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
- }
- else {
- $pp->{$mod} = $br->{$mod};
- }
- }
-}
-
-delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
- unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
-
-WriteMakefile(%WriteMakefileArgs);
-
-
-
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/Makefile.TDS b/support/bibtexperllibs/LaTeX-ToUnicode/Makefile.TDS
deleted file mode 100644
index 4255cfa6b6..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/Makefile.TDS
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# This is Makefile for TDS-compliant TeX distributions
-# Written by Boris Veytsman, boris@varphi.com
-#
-# This file is in public domain
-#
-PREFIX = /usr/local
-
-LIBDIR = $(PREFIX)/scripts/bibtexperllibs
-
-DOCDIR = $(PREFIX)/doc/bibtex/bibtexperllibs
-
-DOCS = latex-tounicode.pdf ltx2unitxt.pdf ltx2unitxt.1
-
-all:
-
-docs: $(DOCS)
-
-latex-tounicode.pdf: latex-tounicode.tex ltx2unitxt.pdf
- texfot pdflatex $< || { rm -f $@; exit 1; }
-
-ToUnicode = lib/LaTeX/ToUnicode
-
-latex-tounicode.tex: $(ToUnicode).pm $(ToUnicode)/Tables.pm
- pod2latex -modify -full -prefile head.ltx -out $@ $^
-
-latex-tounicode.tex: head.ltx
-# unfortunately pod2latex doesn't recognize =encoding, so there
-# are two warnings of "Command encoding not recognised ...". Oh well.
-
-ltx2unitxt.1: script/ltx2unitxt
-# don't run --version since the --help message includes --version output.
- help2man --no-info --version-string=" " \
---name="convert LaTeX source fragment to plain (Unicode) text or simple html" \
- $< >$@ \
- || { rm -f $@; exit 1; }
-ltx2unitxt.pdf: ltx2unitxt.1
- sed 's/^Releases:/\nReleases:/' $< | groff -man -t -rS11 - | ps2pdf - $@
-
-force:
-
-install: all docs
- mkdir -p $(LIBDIR)
- cp -r lib/* $(LIBDIR)
- mkdir -p $(DOCDIR)
- cp -r man/man3/* $(DOCDIR)
- cp -r latex-tounicode.pdf ltx2unitxt.pdf ltx2unitxt.1 $(DOCDIR)
-
-clean:
- $(RM) *.log *.aux *.out *.toc latex-tounicode.tex *.tar.gz
-
-distclean: clean
- $(RM) $(DOCS) \ No newline at end of file
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/README b/support/bibtexperllibs/LaTeX-ToUnicode/README
deleted file mode 100644
index 1f241e3979..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/README
+++ /dev/null
@@ -1,13 +0,0 @@
-This is the LaTeX::ToUnicode Perl package:
-
- Convert LaTeX source fragments to Unicode plain text or simple html
-
-Dev sources, bug tracker: https://github.com/borisveytsman/bibtexperllibs
-Releases: https://ctan.org/pkg/bibtexperllibs
-
-Copyright 2010-2022 Gerhard Gossen, Boris Veytsman, Karl Berry
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl5 programming language system itself.
-
-
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/dist.ini b/support/bibtexperllibs/LaTeX-ToUnicode/dist.ini
deleted file mode 100644
index 5c038d1985..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/dist.ini
+++ /dev/null
@@ -1,16 +0,0 @@
-name = LaTeX-ToUnicode
-author = Gerhard Gossen <gerhard.gossen@googlemail.com> and Boris Veytsman <boris@varphi.com> and Karl Berry <karl@freefriends.org>
-license = Perl_5
-copyright_holder = Gerhard Gossen and Boris Veytsman
-copyright_year = 2010-2023
-version = 0.53
-
-[@Classic]
-[Prereqs]
-perl = 5.8.0
-[NextRelease]
-format = %-7v %{yyyy-MM-dd HH:mm:ss}d
-[PodWeaver]
-[Repository]
-[@Git]
-[SynopsisTests]
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/head.ltx b/support/bibtexperllibs/LaTeX-ToUnicode/head.ltx
deleted file mode 100644
index 3f946fcba0..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/head.ltx
+++ /dev/null
@@ -1,28 +0,0 @@
-% documentation for LaTeX::ToUnicode.
-% head.ltx file public domain.
-%
-\documentclass[11pt]{article}
-\usepackage{fullpage,pdfpages}
-\usepackage[hidelinks]{hyperref}
-\let\printindex=\empty % index is not useful
-\sloppy \hbadness=3000 % not aiming for good typesetting
-
-% Silence useless font warning about braces in cmsy instead of cmtt:
-\makeatletter\def\@font@warning#1{}\makeatother
-
-% https://tex.stackexchange.com/questions/68272
-\newcommand\invisiblesection[1]{%
- \refstepcounter{section}%
- \addcontentsline{toc}{section}{\protect\numberline{\thesection}#1}%
- \sectionmark{#1}%
-}
-
-\begin{document}
-\title{\texttt{LaTeX::ToUnicode} documentation}
-\author{Boris Veytsman\thanks{borisv@lk.net}}
-\maketitle
-\tableofcontents
-
-\invisiblesection{ltx2unitxt---convert \LaTeX\ source fragments}
-
-\includepdf[pages=-]{ltx2unitxt}
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/latex-tounicode.pdf b/support/bibtexperllibs/LaTeX-ToUnicode/latex-tounicode.pdf
deleted file mode 100644
index b319b6ebcb..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/latex-tounicode.pdf
+++ /dev/null
Binary files differ
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/lib/LaTeX/ToUnicode.pm b/support/bibtexperllibs/LaTeX-ToUnicode/lib/LaTeX/ToUnicode.pm
deleted file mode 100644
index 1759a6acd6..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/lib/LaTeX/ToUnicode.pm
+++ /dev/null
@@ -1,778 +0,0 @@
-use strict;
-use warnings;
-package LaTeX::ToUnicode;
-BEGIN {
- $LaTeX::ToUnicode::VERSION = '0.54';
-}
-#ABSTRACT: Convert LaTeX commands to Unicode (simplistically)
-
-require Exporter;
-our @ISA = qw(Exporter);
-our @EXPORT_OK = qw( convert debuglevel $endcw );
-
-use utf8;
-use Encode;
-use LaTeX::ToUnicode::Tables;
-
-# Terminating a control word (not symbol) the way TeX does: at the
-# boundary between a letter (lookbehind) and a nonletter (lookahead),
-# and then ignore any following whitespace.
-our $endcw = qr/(?<=[a-zA-Z])(?=[^a-zA-Z]|$)\s*/;
-
-# all we need for is debugging being on and off. And it's pretty random
-# what gets output.
-my $debug = 0;
-
-sub debuglevel { $debug = shift; }
-sub _debug {
- return unless $debug;
- # The backtrace info is split between caller(0) and caller(1), sigh.
- # We don't need the package name, it's included in $subr in practice.
- my (undef,$filename,$line,undef) = caller(0);
- my (undef,undef,undef,$subr) = caller(1);
- warn @_, " at $filename:$line ($subr)\n";
-}
-
-# The main conversion function.
-#
-sub convert {
- my ($string, %options) = @_;
- #warn debug_hash_as_string("starting with: $string", %options);
-
- # First, remove leading and trailing horizontal whitespace
- # on each line of the possibly-multiline string we're given.
- $string =~ s/^[ \t]*//m;
- $string =~ s/[ \t]*$//m;
-
- # For HTML output, must convert special characters that were in the
- # TeX text (&<>) to their entities to avoid misparsing. We want to
- # do this first, because conversion of the markup commands might
- # output HTML tags like <tt>, and we don't want to convert those <>.
- # Although &lt;tt&gt; works, better to keep the output HTML as
- # human-readable as we can.
- #
- if ($options{html}) {
- $string =~ s/([^\\]|^)&/$1&amp;/g;
- $string =~ s/</&lt;/g;
- $string =~ s/>/&gt;/g;
- }
-
- my $user_hook = $options{hook};
- if ($user_hook) {
- $string = &$user_hook($string, \%options);
- _debug("after user hook: $string");
- }
-
- # Convert general commands that take arguments, since (1) they might
- # insert TeX commands that need to be converted, and (2) because
- # their arguments could well contain constructs that will map to a
- # Perl string \x{nnnn} for Unicode character nnnn; those Perl braces
- # for the \x will confuse further parsing of the TeX.
- #
- $string = _convert_commands_with_arg($string);
- _debug("after commands with arg: $string");
-
- # Convert markups (\texttt, etc.); they have the same brace-parsing issue.
- $string = _convert_markups($string, \%options);
- _debug("after markups: $string");
-
- # And urls, a special case of commands with arguments.
- $string = _convert_urls($string, \%options);
- _debug("after urls: $string");
-
- $string = _convert_control_words($string);
- _debug("after control words: $string");
-
- $string = _convert_control_symbols($string);
- _debug("after control symbols: $string");
-
- $string = _convert_accents($string);
- $string = _convert_german($string) if $options{german};
- $string = _convert_symbols($string);
- $string = _convert_ligatures($string);
-
- # Let's handle ties here, after all the other conversions, since
- # they don't fit well with any of the tables.
- #
- # /~, or ~ at the beginning of a line, is probably part of a url or
- # path, not a tie. Otherwise, consider it a space, since a no-break
- # spot in TeX is most likely fine to break in text or HTML.
- #
- $string =~ s,([^/])~,$1 ,g;
-
- # Remove kerns. Clearly needs generalizing/sharpening to recognize
- # dimens better, and plenty of other commands could use it.
- #_debug("before kern: $string");
- my $dimen_re = qr/[-+]?[0-9., ]+[a-z][a-z]\s*/;
- $string =~ s!\\kern${endcw}${dimen_re}!!g;
-
- # What the heck, let's do \hfuzz and \vfuzz too. They come up pretty
- # often and practically the same thing (plus ignore optional =)..
- $string =~ s!\\[hv]fuzz${endcw}=?\s*${dimen_re}!!g;
-
- # After all the conversions, $string contains \x{....} constructs
- # (Perl Unicode characters) where translations have happened. Change
- # those to the desired output format. Thus we assume that the
- # Unicode \x{....}'s are not themselves involved in further
- # translations, which is, so far, true.
- #
- if (! $options{entities}) {
- # Convert our \x strings from Tables.pm to the binary characters.
-
- # As an extra-special case, we want to preserve the translation of
- # \{ and \} as 007[bd] entities even if the --entities option is
- # not give; otherwise they'd get eliminated like all other braces.
- # Use a temporary cs \xx to keep them marked, and don't use braces
- # to delimit the argument since they'll get deleted.
- $string =~ s/\\x\{(007[bd])\}/\\xx($1)/g;
-
- # Convert all other characters to characters.
- # Assume exactly four hex digits, since we wrote Tables.pm that way.
- $string =~ s/\\x\{(....)\}/ pack('U*', hex($1))/eg;
-
- } elsif ($options{entities}) {
- # Convert the XML special characters that appeared in the input,
- # e.g., from a TeX \&. Unless we're generating HTML output, in
- # which case they have already been converted.
- if (! $options{html}) {
- $string =~ s/&/&amp;/g;
- $string =~ s/</&lt;/g;
- $string =~ s/>/&gt;/g;
- }
-
- # Our values in Tables.pm are simple ASCII strings \x{....},
- # so we can replace them with hex entities with no trouble.
- # Fortunately TeX does not have a standard \x control sequence.
- $string =~ s/\\x\{(....)\}/&#x$1;/g;
-
- # The rest of the job is about binary Unicode characters in the
- # input. We want to transform them into entities also. As always
- # in Perl, there's more than one way to do it, and several are
- # described here, just for the fun of it.
- my $ret = "";
- #
- # decode_utf8 is described in https://perldoc.perl.org/Encode.
- # Without the decode_utf8, all of these methods output each byte
- # separately; apparently $string is a byte string at this point,
- # not a Unicode string. I don't know why that is.
- $ret = decode_utf8($string);
- #
- # Transform everything that's not printable ASCII or newline into
- # entities.
- $ret =~ s/([^ -~\n])/ sprintf("&#x%04x;", ord($1)) /eg;
- #
- # This method leaves control characters as literal; doesn't matter
- # for XML output, since control characters aren't allowed, but
- # let's use the regexp method anyway.
- #$ret = encode("ascii", decode_utf8($string), Encode::FB_XMLCREF);
- #
- # The nice_string function from perluniintro also works.
- #
- # This fails, just outputs numbers (that is, ord values):
- # foreach my $c (unpack("U*", $ret)) {
- #
- # Without the decode_utf8, outputs each byte separately.
- # With the decode_utf8, works, but the above seems cleaner.
- #foreach my $c (split(//, $ret)) {
- # if (ord($c) <= 31 || ord($c) >= 128) {
- # $ret .= sprintf("&#x%04x;", ord($c));
- # } else {
- # $ret .= $c;
- # }
- #}
- #
- $string = $ret; # assigned from above.
- }
-
- if ($string =~ /\\x\{/) {
- warn "LaTeX::ToUnicode::convert: untranslated \\x remains: $string\n";
- warn "LaTeX::ToUnicode::convert: please report as bug.\n";
- }
-
- # Drop all remaining braces.
- $string =~ s/[{}]//g;
-
- if (! $options{entities}) {
- # With all the other braces gone, now we can convert the preserved
- # brace entities from \{ and \} to actual braces.
- $string =~ s/\\xx\((007[bd])\)/ pack('U*', hex($1))/eg;
- }
-
- # Backslashes might remain. Don't remove them, as it makes for a
- # useful way to find unhandled commands.
-
- # leave newlines alone, but trim spaces and tabs.
- $string =~ s/^[ \t]+//s; # remove leading whitespace
- $string =~ s/[ \t]+$//s; # remove trailing whitespace
- $string =~ s/[ \t]+/ /gs; # collapse all remaining whitespace to one space
-
- $string;
-}
-
-# Convert commands that take a single braced argument. The table
-# defines text we're supposed to insert before and after the argument.
-# We let future processing handle conversion of both the inserted text
-# and the argument.
-#
-sub _convert_commands_with_arg {
- my $string = shift;
-
- foreach my $cmd ( keys %LaTeX::ToUnicode::Tables::ARGUMENT_COMMANDS ) {
- my $repl = $LaTeX::ToUnicode::Tables::ARGUMENT_COMMANDS{$cmd};
- my $lft = $repl->[0]; # ref to two-element list
- my $rht = $repl->[1];
- # \cmd{foo} -> LFT foo RHT
- $string =~ s/\\$cmd${endcw}\{(.*?)\}/$lft$1$rht/g;
- #warn "replaced arg $cmd, yielding $string\n";
- }
-
- $string;
-}
-
-# Convert url commands in STRING. This is a special case of commands
-# with arguments: \url{u} and \href{u}{desc text}. The HTML output
-# (generated if $OPTIONS{html} is set) is just too special to be handled
-# in a table; further, \href is the only two-argument command we are
-# currently handling.
-#
-sub _convert_urls {
- my ($string,$options) = @_;
-
- if ($options->{html}) {
- # HTML output.
- # \url{URL} -> <a href="URL">URL</a>
- $string =~ s,\\url$endcw\{([^}]*)\}
- ,<a href="$1">$1</a>,gx;
- #
- # \href{URL}{TEXT} -> <a href="URL">TEXT</a>
- $string =~ s,\\href$endcw\{([^}]*)\}\s*\{([^}]*)\}
- ,<a href="$1">$2</a>,gx;
-
- } else {
- # plain text output.
- # \url{URL} -> URL
- $string =~ s/\\url$endcw\{([^}]*)\}/$1/g;
- #
- # \href{URL}{TEXT} -> TEXT (URL)
- # but, as a special case, if URL ends with TEXT, just output URL,
- # as in:
- # \href{https://doi.org/10/fjzzc8}{10/fjzzc8}
- # ->
- # https://doi.org/10/fjzzc8
- #
- # Yet more specialness: the TEXT might have extra braces, as in
- # \href{https://doi.org/10/fjzzc8}{{10/fjzzc8}}
- # left over from previous markup commands (\path) which got
- # removed. We want to accept and ignore such extra braces,
- # hence the \{+ ... \}+ in recognizing TEXT.
- #
-#warn "txt url: starting with $string\n";
- if ($string =~ m/\\href$endcw\{([^}]*)\}\s*\{+([^}]*)\}+/) {
- my $url = $1;
- my $text = $2;
-#warn " url: $url\n";
-#warn " text: $text\n";
- my $repl = ($url =~ m!$text$!) ? $url : "$text ($url)";
-#warn " repl: $repl\n";
- $string =~ s/\\href$endcw\{([^}]*)\}\s*\{+([^}]*)\}+/$repl/;
-#warn " str: $string\n";
- }
- }
-
- $string;
-}
-
-# Convert control words (not symbols), that is, a backslash and an
-# alphabetic sequence of characters terminated by a non-alphabetic
-# character. Following whitespace is ignored.
-#
-sub _convert_control_words {
- my $string = shift;
-
- foreach my $command ( keys %LaTeX::ToUnicode::Tables::CONTROL_WORDS ) {
- my $repl = $LaTeX::ToUnicode::Tables::CONTROL_WORDS{$command};
- # replace {\CMD}, whitespace ignored after \CMD.
- $string =~ s/\{\\$command$endcw\}/$repl/g;
-
- # replace \CMD, preceded by not-consumed non-backslash.
- $string =~ s/(?<=[^\\])\\$command$endcw/$repl/g;
-
- # replace \CMD at beginning of whole string, which otherwise
- # wouldn't be matched. Two separate regexps to avoid
- # variable-length lookbehind.
- $string =~ s/^\\$command$endcw/$repl/g;
- }
-
- $string;
-}
-
-# Convert control symbols, other than accents. Much simpler than
-# control words, since are self-delimiting, don't take arguments, and
-# don't consume any following text.
-#
-sub _convert_control_symbols {
- my $string = shift;
-
- foreach my $symbol ( keys %LaTeX::ToUnicode::Tables::CONTROL_SYMBOLS ) {
- my $repl = $LaTeX::ToUnicode::Tables::CONTROL_SYMBOLS{$symbol};
-
- # because these are not alphabetic, we can quotemeta them,
- # and we need to because "\" is one of the symbols.
- my $rx = quotemeta($symbol);
-
- # the preceding character must not be a backslash, else "\\ "
- # could have the "\ " seen first as a control space, leaving
- # a spurious \ behind. Don't consume the preceding.
- # Or it could be at the beginning of a line.
- #
- $string =~ s/(^|(?<=[^\\]))\\$rx/$repl/g;
- #warn "after sym $symbol (\\$rx -> $repl), have: $string\n";
- }
-
- $string;
-}
-
-# Convert accents.
-#
-sub _convert_accents {
- my $string = shift;
-
- # first the non-alphabetic accent commands, like \".
- my %tbl = %LaTeX::ToUnicode::Tables::ACCENT_SYMBOLS;
- $string =~ s/(\{\\(.)\s*\{(\\?\w{1,2})\}\})/$tbl{$2}{$3} || $1/eg; #{\"{a}}
- $string =~ s/(\{\\(.)\s*(\\?\w{1,2})\})/ $tbl{$2}{$3} || $1/eg; # {\"a}
- $string =~ s/(\\(.)\s*(\\?\w{1,1}))/ $tbl{$2}{$3} || $1/eg; # \"a
- $string =~ s/(\\(.)\s*\{(\\?\w{1,2})\})/ $tbl{$2}{$3} || $1/eg; # \"{a}
-
- # second the alphabetic commands, like \c. They have to be handled
- # differently because \cc is not \c{c}! The only difference in the
- # regular expressions is using $endcw instead of just \s*.
- #
- %tbl = %LaTeX::ToUnicode::Tables::ACCENT_LETTERS;
- $string =~ s/(\{\\(.)$endcw\{(\\?\w{1,2})\}\})/$tbl{$2}{$3} || $1/eg; #{\"{a}}
- $string =~ s/(\{\\(.)$endcw(\\?\w{1,2})\})/ $tbl{$2}{$3} || $1/eg; # {\"a}
- $string =~ s/(\\(.)$endcw(\\?\w{1,1}))/ $tbl{$2}{$3} || $1/eg; # \"a
- $string =~ s/(\\(.)$endcw\{(\\?\w{1,2})\})/ $tbl{$2}{$3} || $1/eg; # \"{a}
-
-
- # The argument is just one \w character for the \"a case, not two,
- # because otherwise we might consume a following character that is
- # not part of the accent, e.g., a backslash (\"a\'e).
- #
- # Others can be two because of the \t tie-after accent. Even {\t oo} is ok.
- #
- # Allow whitespace after the \CMD in all cases, e.g., "\c c". Even
- # for the control symbols, it turns out spaces are ignored there
- # (as in \" o), unlike the usual syntax.
- #
- # Some non-word constituents would work, but in practice we hope
- # everyone just uses letters.
-
- $string;
-}
-
-# For the [n]german package.
-sub _convert_german {
- my $string = shift;
-
- foreach my $symbol ( keys %LaTeX::ToUnicode::Tables::GERMAN ) {
- $string =~ s/\Q$symbol\E/$LaTeX::ToUnicode::Tables::GERMAN{$symbol}/g;
- }
- $string;
-}
-
-# Control words that produce printed symbols (and letters in languages
-# other than English), that is.
-#
-sub _convert_symbols {
- my $string = shift;
-
- foreach my $symbol ( keys %LaTeX::ToUnicode::Tables::SYMBOLS ) {
- my $repl = $LaTeX::ToUnicode::Tables::SYMBOLS{$symbol};
- # preceded by a (non-consumed) non-backslash,
- # usual termination for a control word.
- # These commands don't take arguments.
- $string =~ s/(?<=[^\\])\\$symbol$endcw/$repl/g;
-
- # or the beginning of the whole string:
- $string =~ s/^\\$symbol$endcw/$repl/g;
- }
- $string;
-}
-
-# Special character sequences, not \commands. They aren't all
-# technically ligatures, but no matter.
-#
-sub _convert_ligatures {
- my $string = shift;
-
- # have to convert these in order specified.
- my @ligs = @LaTeX::ToUnicode::Tables::LIGATURES;
- for (my $i = 0; $i < @ligs; $i+=2) {
- my $in = $ligs[$i];
- my $out = $ligs[$i+1];
- $string =~ s/\Q$in\E/$out/g;
- }
- $string;
-}
-
-#
-# Convert LaTeX markup commands in STRING like \textbf{...} and
-# {\bfshape ...} and {\bf ...}.
-#
-# If we're aiming for plain text output, they are just cleared away (the
-# braces are not removed).
-#
-# If we're generating HTML output ("html" key is set in $OPTIONS hash
-# ref), we use the value in the hash, so that \textbf{foo} becomes
-# <b>foo</b>. Nested markup doesn't work.
-#
-sub _convert_markups {
- my ($string, $options) = @_;
-
- # HTML is different.
- return _convert_markups_html($string) if $options->{html};
-
- # Not HTML, so here we'll "convert" to plain text by removing the
- # markup commands.
-
- # we can do all the markup commands at once.
- my $markups = join('|', keys %LaTeX::ToUnicode::Tables::MARKUPS);
-
- # Remove \textMARKUP{...}, leaving just the {...}
- $string =~ s/\\text($markups)$endcw//g;
-
- # Similarly remove \MARKUPshape, plus remove \upshape.
- $string =~ s/\\($markups|up)shape$endcw//g;
-
- # Remove braces and \command in: {... \MARKUP ...}
- $string =~ s/(\{[^{}]+)\\(?:$markups)$endcw([^{}]+\})/$1$2/g;
-
- # Remove braces and \command in: {\MARKUP ...}
- $string =~ s/\{\\(?:$markups)$endcw([^{}]*)\}/$1/g;
-
- # Remove: {\MARKUP
- # Although this will leave unmatched } chars behind, there's no
- # alternative without full parsing, since the bib entry will often
- # look like: {\em {The TeX{}book}}. Also might, in principle, be
- # at the end of a line.
- $string =~ s/\{\\(?:$markups)$endcw//g;
-
- # Ultimately we remove all braces in ltx2crossrefxml SanitizeText fns,
- # so the unmatched braces don't matter ... that code should be moved.
-
- $string;
-}
-
-# Convert \markup in STRING to html. We can't always figure out where to
-# put the end tag, but we always put it somewhere. We don't even attempt
-# to handle nested markup.
-#
-sub _convert_markups_html {
- my ($string) = @_;
-
- my %MARKUPS = %LaTeX::ToUnicode::Tables::MARKUPS;
- # have to consider each markup \command separately.
- for my $markup (keys %MARKUPS) {
- my $hcmd = $MARKUPS{$markup}; # some TeX commands don't translate
- my $tag = $hcmd ? "<$hcmd>" : "";
- my $end_tag = $hcmd ? "</$hcmd>" : "";
-
- # The easy one: \textMARKUP{...}
- $string =~ s/\\text$markup$endcw\{(.*?)\}/$tag$1$end_tag/g;
-
- # {x\MARKUP(shape) y} -> x<mk>y</mk> (leave out braces)
- $string =~ s/\{([^{}]+)\\$markup(shape)?$endcw([^{}]+)\}
- /$1$tag$3$end_tag/gx;
-
- # {\MARKUP(shape) y} -> <mk>y</mk>. Same as previous but without
- # the x part. Could do it in one regex but this seems clearer.
- $string =~ s/\{\\$markup(shape)?$endcw([^{}]+)\}
- /$tag$2$end_tag/gx;
-
- # for {\MARKUP(shape) ... with no matching brace, we don't know
- # where to put the end tag, so seems best to do nothing.
- }
-
- $string;
-}
-
-
-##############################################################
-# debug_hash_as_string($LABEL, HASH)
-#
-# Return LABEL followed by HASH elements, followed by a newline, as a
-# single string. If HASH is a reference, it is followed (but no recursive
-# derefencing).
-###############################################################
-sub debug_hash_as_string {
- my ($label) = shift;
- my (%hash) = (ref $_[0] && $_[0] =~ /.*HASH.*/) ? %{$_[0]} : @_;
-
- my $str = "$label: {";
- my @items = ();
- for my $key (sort keys %hash) {
- my $val = $hash{$key};
- $val = ".undef" if ! defined $val;
- $key =~ s/\n/\\n/g;
- $val =~ s/\n/\\n/g;
- push (@items, "$key:$val");
- }
- $str .= join (",", @items);
- $str .= "}";
-
- return "$str\n";
-}
-
-1;
-
-__END__
-=pod
-
-=encoding UTF-8
-
-=head1 NAME
-
-LaTeX::ToUnicode - Convert LaTeX commands to Unicode
-
-=head1 VERSION
-
-version 0.54
-
-=head1 SYNOPSIS
-
- use LaTeX::ToUnicode qw( convert debuglevel $endcw );
-
- # simple examples:
- convert( '{\"a}' ) eq 'ä'; # true
- convert( '{\"a}', entities=>1 ) eq '&#00EF;'; # true
- convert( '"a', german=>1 ) eq 'ä'; # true, `german' package syntax
- convert( '"a', ) eq '"a'; # false, not enabled by default
-
- # more generally:
- my $latexstr;
- my $unistr = convert($latexstr); # get literal (binary) Unicode characters
-
- my $entstr = convert($latexstr, entities=>1); # get &#xUUUU;
-
- my $htmstr = convert($latexstr, entities=>1, html=>1); # also html markup
-
- my $unistr = convert($latexstr, hook=>\&my_hook); # user-defined hook
-
- # if nonzero, dumps various info; perhaps other levels in the future.
- LaTeX::ToUnicode::debuglevel($verbose);
-
- # regexp for terminating TeX control words, e.g., in hooks.
- my $endcw = $LaTeX::ToUnicode::endcw;
- $string =~ s/\\newline$endcw/ /g; # translate \newline to space
-
-=head1 DESCRIPTION
-
-This module provides a method to convert LaTeX markups for accents etc.
-into their Unicode equivalents. It translates some commands for special
-characters or accents into their Unicode (or HTML) equivalents and
-removes formatting commands. It is not at all bulletproof or complete.
-
-This module is intended to convert fragments of LaTeX source, such as
-bibliography entries and abstracts, into plain text (or, optionally,
-simplistic HTML). It is not a document conversion system. Math, tables,
-figures, sectioning, etc., are not handled in any way, and mostly left
-in their TeX form in the output. The translations assume standard LaTeX
-meanings for characters and control sequences; macros in the input are
-not considered.
-
-The aim for all the output is utter simplicity and minimalism, not
-faithful translation. For example, although Unicode has a code point for
-a thin space, the LaTeX C<\thinspace> (etc.) command is translated to
-the empty string; such spacing refinements desirable in the TeX output
-are, in our experience, generally not desired in the HTML output from
-this tool.
-
-As another example, TeX C<%> comments are not removed, even on lines by
-themselves, because they may be inside verbatim blocks, and we don't
-attempt to keep any such context. In practice, TeX comments are rare in
-the text fragments intended to be handled, so removing them in advance
-has not been a great burden.
-
-As another example, LaTeX ties, C<~> characters, are replaced with
-normal spaces (exception: unless they follow a C</> character or at the
-beginning of a line, when they're assumed to be part of a url or a
-pathname), rather than a no-break space character, because in our
-experience most ties intended for the TeX output would just cause
-trouble in plain text or HTML.
-
-Regarding normal whitespace: all leading and trailing horizontal
-whitespace (that is, SPC and TAB) is removed. All internal horizontal
-whitespace sequences are collapsed to a single space.
-
-After the conversions, all brace characters (C<{}>) are simply removed
-from the returned string. This turns out to be a significant convenience
-in practice, since many LaTeX commands which take arguments don't need
-to do anything for our purposes except output the argument.
-
-On the other hand, backslashes are not removed. This is so the caller
-can check for C<\\> and thus discover untranslated commands. Of course
-there are many other constructs that might not be translated, or
-translated wrongly. There is no escaping the need to carefully look at
-the output.
-
-Suggestions and bug reports are welcome for practical needs; we know
-full well that there are hundreds of commands not handled that could be.
-Virtually all the behavior mentioned here would be easily made
-customizable, if there is a need to do so.
-
-=head1 FUNCTIONS
-
-=head2 convert( $latex_string, %options )
-
-Convert the text in C<$latex_string> into a plain(er) Unicode string.
-Escape sequences for accented and special characters (e.g., C<\i>,
-C<\"a>, ...) are converted. A few basic formatting commands (e.g.,
-C<{\it ...}>) are removed. See the L<LaTeX::ToUnicode::Tables> submodule
-for the full conversion tables.
-
-These keys are recognized in C<%options>:
-
-=over
-
-=item C<entities>
-
-Output C<&#xUUUU;> entities (valid in XML); in this case, also convert
-the E<lt>, E<gt>, C<&> metacharacters to entities. Recognized non-ASCII
-Unicode characters in the original input are also converted to entities,
-not only the translations from TeX commands.
-
-The default is to output literal (binary) Unicode characters, and
-not change any metacharacters.
-
-=item C<german>
-
-If this option is set, the commands introduced by the package `german'
-(e.g. C<"a> eq C<ä>, note the missing backslash) are also
-handled.
-
-=item C<html>
-
-If this option is set, the output is simplistic html rather than plain
-text. This affects only a few things: S<1) the> output of urls from
-C<\url> and C<\href>; S<2) the> output of markup commands like
-C<\textbf> (but nested markup commands don't work); S<3) two> other
-random commands, C<\enquote> and C<\path>, because they are needed.
-
-=item C<hook>
-
-The value must be a function that takes two arguments and returns a
-string. The first argument is the incoming string (may be multiple
-lines), and the second argument is a hash reference of options, exactly
-what was passed to this C<convert> function. Thus the hook can detect
-whether html is needed.
-
-The hook is called (almost) right away, before any of the other
-conversions have taken place. That way the hook can make use of the
-predefined conversions instead of repeating them. The only changes made
-to the input string before the hook is called are trivial: leading and
-trailing whitespace (space and tab) on each line are removed, and, for
-HTML output, incoming ampersand, less-than, and greater-than characters
-are replaced with their entities.
-
-Any substitutions that result in Unicode code points must use
-C<\\x{nnnn}> on the right hand side: that's two backslashes and a
-four-digit hex number.
-
-As an example, here is a skeleton of the hook function for TUGboat:
-
- sub LaTeX_ToUnicode_convert_hook {
- my ($string,$options) = @_;
-
- my $endcw = $LaTeX::ToUnicode::endcw;
- die "no endcw regexp in LaTeX::ToUnicode??" if ! $endcw;
-
- ...
- $string =~ s/\\newline$endcw/ /g;
-
- # TUB's \acro{} takes an argument, but we do nothing with it.
- # The braces will be removed by convert().
- $string =~ s/\\acro$endcw//g;
- ...
- $string =~ s/\\CTAN$endcw/CTAN/g;
- $string =~ s/\\Dash$endcw/\\x{2014}/g; # em dash; replacement is string
- ...
-
- # ignore \begin{abstract} and \end{abstract} commands.
- $string =~ s,\\(begin|end)$endcw\{abstract\}\s*,,g;
-
- # Output for our url abbreviations, and other commands, depends on
- # whether we're generating plain text or HTML.
- if ($options->{html}) {
- # HTML.
- # \tbsurl{URLBASE} -> <a href="https://URLBASE">URLBASE</a>
- $string =~ s,\\tbsurl$endcw\{([^}]*)\}
- ,<a href="https://$1">$1</a>,gx;
- ...
- # varepsilon, and no line break at hyphen.
- $string =~ s,\\eTeX$endcw,\\x{03B5}<nobr>-</nobr>TeX,g;
-
- } else {
- # for plain text, we can just prepend the protocol://.
- $string =~ s,\\tbsurl$endcw,https://,g;
- ...
- $string =~ s,\\eTeX$endcw,\\x{03B5}-TeX,g;
- }
- ...
- return $string;
- }
-
-As shown here for C<\eTeX> (an abbreviation macro defined in the
-TUGboat style files), if markup is desired in the output, the
-substitutions must be different for HTML and plain text. Otherwise, the
-desired HTML markup is transliterated as if it were plain text. Or else
-the translations must be extended so that TeX markup can be used on the
-rhs to be replaced with the desired HTML (C<&lt;nobr&gt;> in this case).
-
-For the full definition (and plenty of additional information),
-see the file C<ltx2crossrefxml-tugboat.cfg> in the TUGboat source
-repository at
-<https://github.com/TeXUsersGroup/tugboat/tree/trunk/capsules/crossref>.
-
-The hook function is specified in the C<convert()> call like this:
-
- LaTeX::ToUnicode::convert(..., { hook => \&LaTeX_ToUnicode_convert_hook })
-
-=back
-
-=head2 debuglevel( $level )
-
-Output debugging information if C<$level> is nonzero.
-
-=head2 $endcw
-
-A predefined regexp for terminating TeX control words (not control
-symbols!). Can be used in, for example, hook functions:
-
- my $endcw = $LaTeX::ToUnicode::endcw;
- $string =~ s/\\newline$endcw/ /g; # translate \newline to space
-
-It's defined as follows:
-
- our $endcw = qr/(?<=[a-zA-Z])(?=[^a-zA-Z]|$)\s*/;
-
-That is, look behind for an alphabetic character, then look ahead for a
-non-alphabetic character (or end of line), then consume whitespace.
-Fingers crossed.
-
-=head1 AUTHOR
-
-Gerhard Gossen <gerhard.gossen@googlemail.com>,
-Boris Veytsman <boris@varphi.com>,
-Karl Berry <karl@freefriends.org>
-
-L<https://github.com/borisveytsman/bibtexperllibs>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright 2010-2023 Gerhard Gossen, Boris Veytsman, Karl Berry
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl5 programming language system itself.
-
-=cut
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/lib/LaTeX/ToUnicode/Tables.pm b/support/bibtexperllibs/LaTeX-ToUnicode/lib/LaTeX/ToUnicode/Tables.pm
deleted file mode 100644
index dd02926e03..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/lib/LaTeX/ToUnicode/Tables.pm
+++ /dev/null
@@ -1,726 +0,0 @@
-package LaTeX::ToUnicode::Tables;
-BEGIN {
- $LaTeX::ToUnicode::Tables::VERSION = '0.54';
-}
-use strict;
-use warnings;
-#ABSTRACT: Character tables for LaTeX::ToUnicode
-
-use utf8; # just for the german support
-
-# Technically not all of these are ligatures, but close enough.
-# Order is important, so has to be a list, not a hash.
-#
-our @LIGATURES = (
- "---" => '\x{2014}', # em dash
- "--" => '\x{2013}', # en dash
- "!`" => '\x{00A1}', # inverted exclam
- "?`" => '\x{00A1}', # inverted question
- "``" => '\x{201c}', # left double
- "''" => '\x{201d}', # right double
- "`" => '\x{2018}', # left single
- "'" => '\x{2019}', # right single
-);
-# test text: em---dash, en--dash, exc!`am, quest?`ion, ``ld, rd'', `ls, rs'.
-#
-# Some additional ligatures supported in T1 encoding, but we won't (from
-# tex-text.map):
-# U+002C U+002C <> U+201E ; ,, -> DOUBLE LOW-9 QUOTATION MARK
-# U+003C U+003C <> U+00AB ; << -> LEFT POINTING GUILLEMET
-# U+003E U+003E <> U+00BB ; >> -> RIGHT POINTING GUILLEMET
-
-# for {\MARKUP(shape) ...} and \textMARKUP{...}; although not all
-# command names are defined in LaTeX for all markups, we translate them
-# anyway. Also, LaTeX has more font axes not included here: md, ulc, sw,
-# ssc, etc. See ltfntcmd.dtx and ltfssaxes.dtx if we ever want to try
-# for completeness.
-#
-our %MARKUPS = (
- 'bf' => 'b',
- 'cal' => '',
- 'em' => 'em',
- 'it' => 'i',
- 'rm' => '',
- 'sc' => '', # qqq should uppercasify
- 'sf' => '',
- 'sl' => 'i',
- 'small' => '',
- 'subscript' => 'sub',
- 'superscript' => 'sup',
- 'tt' => 'tt',
-);
-
-# More commands taking arguments that we want to handle.
-#
-our %ARGUMENT_COMMANDS = (
- 'emph' => ['\textem{', '}'], # \textem doesn't exist, but we handle it
- 'enquote' => ["`", "'"],
- 'path' => ['\texttt{', '}'], # ugh, might not be a braced argument
-);
-
-# Non-alphabetic \COMMANDs, other than accents and special cases.
-#
-our %CONTROL_SYMBOLS = (
- ' ' => ' ', # control space
- "\t" => ' ', # control space
- "\n" => '\x{0020}', # control space; use entity to avoid being trimmed
- '!' => '', # negative thin space
- # " umlaut
- '#' => '#', # sharp sign
- '$' => '$', # dollar sign
- '%' => '%', # percent sign
- '&' => '\x{0026}', # ampersand, entity to avoid html conflict
- # ' acute accent
- '(' => '', # start inline math
- ')' => '', # end inline math
- '*' => '', # discretionary multiplication
- '+' => '', # tabbing: tab stop to right
- ',' => '', # thin space
- '-' => '', # discretionary hyphenation
- # . overdot accent
- '/' => '', # italic correction
- # 0..9 undefined
- ':' => '', # medium space
- ';' => ' ', # thick space
- '<' => '', # tabbing: text to left of margin
- # = macron accent
- '>' => '', # tabbing: next tab stop
- # ? undefined
- '@' => '#', # end of sentence
- # A..Z control words, not symbols
- '[' => '', # start display math
- '\\' => ' ', # line break
- ']' => '', # end display math
- # ^ circumflex accent
- '_' => '_', # underscore
- # ` grave accent
- # a..z control words, not symbols
- '{' => '\x{007b}', # lbrace
- '|' => '\x{2225}', # parallel
- '}' => '\x{007d}', # rbrace
- # ~ tilde accent
-);
-
-# Alphabetic \COMMANDs that map to nothing. This is simply
-# interpolated into %CONTROL_WORDS (next), not used directly, so we
-# redundantly specify the '' on every line.
-#
-our %CONTROL_WORDS_EMPTY = (
- 'begingroup' => '',
- 'bgroup' => '',
- 'checkcomma' => '',
- #'cite' => '', # keep \cite undefined since it needs manual work
- 'clearpage' => '',
- 'doi' => '',
- 'egroup' => '',
- 'endgroup' => '',
- 'ensuremath' => '',
- 'hbox' => '',
- 'ignorespaces' => '',
- 'mbox' => '',
- 'medspace' => '',
- 'negmedspace' => '',
- 'negthickspace' => '',
- 'negthinspace' => '',
- 'newblock' => '',
- 'newpage' => '',
- 'noindent' => '',
- 'nolinkurl' => '',
- 'oldstylenums' => '',
- 'pagebreak' => '',
- 'protect' => '',
- 'raggedright' => '',
- 'relax' => '',
- 'thinspace' => '',
- 'unskip' => '',
- 'urlprefix' => '',
-);
-
-# Alphabetic commands, that expand to nothing (above) and to
-# something (below).
-#
-our %CONTROL_WORDS = (
- %CONTROL_WORDS_EMPTY,
- 'BibLaTeX' => 'BibLaTeX',
- 'BibTeX' => 'BibTeX',
- 'LaTeX' => 'LaTeX',
- 'LuaLaTeX' => 'LuaLaTeX',
- 'LuaTeX' => 'LuaTeX',
- 'MF' => 'Metafont',
- 'MP' => 'MetaPost',
- 'Omega' => '\x{03A9}',
- 'TeX' => 'TeX',
- 'XeLaTeX' => 'XeLaTeX',
- 'XeTeX' => 'XeTeX',
- 'bullet' => '\x{2022}',
- 'dag' => '\x{2020}',
- 'ddag' => '\x{2021}',
- 'dots' => '\x{2026}',
- 'epsilon' => '\x{03F5}',
- 'hookrightarrow' => '\x{2194}',
- 'ldots' => '\x{2026}',
- 'log' => 'log',
- 'omega' => '\x{03C9}',
- 'par' => "\n\n",
- 'qquad' => ' ', # 2em space
- 'quad' => ' ', # em space
- 'textbackslash' => '\x{005C}', # entities so \ in output indicates
- # untranslated TeX source
- 'textbraceleft' => '\x{007B}', # entities so our bare-brace removal
- 'textbraceright' => '\x{007D}', # skips them
- 'textgreater' => '\x{003E}',
- 'textless' => '\x{003C}',
- 'textquotedbl' => '"',
- 'thickspace' => ' ',
- 'varepsilon' => '\x{03B5}',
-);
-
-# Control words (not symbols) that generate various non-English
-# letters and symbols. Lots more could be added.
-#
-our %SYMBOLS = ( # Table 3.2 in Lamport, plus more
- 'AA' => '\x{00C5}', # A with ring
- 'aa' => '\x{00E5}',
- 'AE' => '\x{00C6}', # AE
- 'ae' => '\x{00E6}',
- 'DH' => '\x{00D0}', # ETH
- 'dh' => '\x{00F0}',
- 'DJ' => '\x{0110}', # D with stroke
- 'dj' => '\x{0111}',
- 'i' => '\x{0131}', # small dotless i
- 'L' => '\x{0141}', # L with stroke
- 'l' => '\x{0142}',
- 'NG' => '\x{014A}', # ENG
- 'ng' => '\x{014B}',
- 'OE' => '\x{0152}', # OE
- 'oe' => '\x{0153}',
- 'O' => '\x{00D8}', # O with stroke
- 'o' => '\x{00F8}',
- 'SS' => 'SS', # lately also U+1E9E, but SS seems good enough
- 'ss' => '\x{00DF}',
- 'TH' => '\x{00DE}', # THORN
- 'textordfeminine' => '\x{00AA}',
- 'textordmasculine' => '\x{00BA}',
- 'textregistered' => '\x{00AE}',
- 'th' => '\x{00FE}',
- 'TM' => '\x{2122}', # trade mark sign
-);
-
-# Accent commands that are not alphabetic.
-#
-our %ACCENT_SYMBOLS = (
- "\"" => { # with diaresis
- A => '\x{00C4}',
- E => '\x{00CB}',
- H => '\x{1E26}',
- I => '\x{00CF}',
- O => '\x{00D6}',
- U => '\x{00DC}',
- W => '\x{1E84}',
- X => '\x{1E8c}',
- Y => '\x{0178}',
- "\\I" => '\x{00CF}',
- "\\i" => '\x{00EF}',
- a => '\x{00E4}',
- e => '\x{00EB}',
- h => '\x{1E27}',
- i => '\x{00EF}',
- o => '\x{00F6}',
- t => '\x{1E97}',
- u => '\x{00FC}',
- w => '\x{1E85}',
- x => '\x{1E8d}',
- y => '\x{00FF}',
- },
- "'" => { # with acute
- A => '\x{00C1}',
- AE => '\x{01FC}',
- C => '\x{0106}',
- E => '\x{00C9}',
- G => '\x{01F4}',
- I => '\x{00CD}',
- K => '\x{1E30}',
- L => '\x{0139}',
- M => '\x{1E3E}',
- N => '\x{0143}',
- O => '\x{00D3}',
- P => '\x{1E54}',
- R => '\x{0154}',
- S => '\x{015A}',
- U => '\x{00DA}',
- W => '\x{1E82}',
- Y => '\x{00DD}',
- Z => '\x{0179}',
- "\\I" => '\x{00CD}',
- "\\i" => '\x{00ED}',
- a => '\x{00E1}',
- ae => '\x{01FD}',
- c => '\x{0107}',
- e => '\x{00E9}',
- g => '\x{01F5}',
- i => '\x{00ED}',
- k => '\x{1E31}',
- l => '\x{013A}',
- m => '\x{1E3f}',
- n => '\x{0144}',
- o => '\x{00F3}',
- p => '\x{1E55}',
- r => '\x{0155}',
- s => '\x{015B}',
- u => '\x{00FA}',
- w => '\x{1E83}',
- y => '\x{00FD}',
- z => '\x{017A}',
- },
- "^" => { # with circumflex
- A => '\x{00C2}',
- C => '\x{0108}',
- E => '\x{00CA}',
- G => '\x{011C}',
- H => '\x{0124}',
- I => '\x{00CE}',
- J => '\x{0134}',
- O => '\x{00D4}',
- R => 'R\x{0302}',
- S => '\x{015C}',
- U => '\x{00DB}',
- W => '\x{0174}',
- Y => '\x{0176}',
- Z => '\x{1E90}',
- "\\I" => '\x{00CE}',
- "\\J" => '\x{0134}',
- "\\i" => '\x{00EE}',
- "\\j" => '\x{0135}',
- a => '\x{00E2}',
- c => '\x{0109}',
- e => '\x{00EA}',
- g => '\x{011D}',
- h => '\x{0125}',
- i => '\x{00EE}',
- j => '\x{0135}',
- o => '\x{00F4}',
- s => '\x{015D}',
- u => '\x{00FB}',
- w => '\x{0175}',
- y => '\x{0177}',
- z => '\x{1E91}',
- },
- "`" => { # with grave
- A => '\x{00C0}',
- E => '\x{00C8}',
- I => '\x{00CC}',
- N => '\x{01F8}',
- O => '\x{00D2}',
- U => '\x{00D9}',
- W => '\x{1E80}',
- Y => '\x{1Ef2}',
- "\\I" => '\x{00CC}',
- "\\i" => '\x{00EC}',
- a => '\x{00E0}',
- e => '\x{00E8}',
- i => '\x{00EC}',
- n => '\x{01F9}',
- o => '\x{00F2}',
- u => '\x{00F9}',
- w => '\x{1E81}',
- y => '\x{1EF3}',
- },
- "." => { # with dot above
- A => '\x{0226}',
- B => '\x{1E02}',
- C => '\x{010A}',
- D => '\x{1E0A}',
- E => '\x{0116}',
- F => '\x{1E1E}',
- G => '\x{0120}',
- H => '\x{1E22}',
- I => '\x{0130}',
- M => '\x{1E40}',
- N => '\x{1E44}',
- O => '\x{022E}',
- P => '\x{1E56}',
- R => '\x{1E58}',
- S => '\x{1E60}',
- T => '\x{1E6a}',
- W => '\x{1E86}',
- X => '\x{1E8A}',
- Y => '\x{1E8E}',
- Z => '\x{017B}',
- "\\I" => '\x{0130}',
- a => '\x{0227}',
- b => '\x{1E03}',
- c => '\x{010B}',
- d => '\x{1E0B}',
- e => '\x{0117}',
- f => '\x{1e1f}',
- g => '\x{0121}',
- h => '\x{1E23}',
- m => '\x{1E41}',
- n => '\x{1E45}',
- o => '\x{022F}',
- p => '\x{1E57}',
- r => '\x{1E59}',
- s => '\x{1E61}',
- t => '\x{1E6b}',
- w => '\x{1E87}',
- x => '\x{1E8b}',
- y => '\x{1E8f}',
- z => '\x{017C}',
- },
- '=' => { # with macron
- A => '\x{0100}',
- AE => '\x{01E2}',
- E => '\x{0112}',
- G => '\x{1E20}',
- I => '\x{012A}',
- O => '\x{014C}',
- U => '\x{016A}',
- Y => '\x{0232}',
- "\\I" => '\x{012A}',
- "\\i" => '\x{012B}',
- a => '\x{0101}',
- ae => '\x{01E3}',
- e => '\x{0113}',
- g => '\x{1E21}',
- i => '\x{012B}',
- o => '\x{014D}',
- u => '\x{016B}',
- y => '\x{0233}',
- },
- "~" => { # with tilde
- A => '\x{00C3}',
- E => '\x{1EBC}',
- I => '\x{0128}',
- N => '\x{00D1}',
- O => '\x{00D5}',
- U => '\x{0168}',
- V => '\x{1E7C}',
- Y => '\x{1EF8}',
- "\\I" => '\x{0128}',
- "\\i" => '\x{0129}',
- a => '\x{00E3}',
- e => '\x{1EBD}',
- i => '\x{0129}',
- n => '\x{00F1}',
- o => '\x{00F5}',
- u => '\x{0169}',
- v => '\x{1E7D}',
- y => '\x{1EF9}',
- },
-);
-
-# Accent commands that are alphabetic.
-#
-our %ACCENT_LETTERS = (
- "H" => { # with double acute
- O => '\x{0150}',
- U => '\x{0170}',
- o => '\x{0151}',
- u => '\x{0171}',
- },
- "c" => { # with cedilla
- C => '\x{00C7}',
- D => '\x{1E10}',
- E => '\x{0228}',
- G => '\x{0122}',
- H => '\x{1E28}',
- K => '\x{0136}',
- L => '\x{013B}',
- N => '\x{0145}',
- R => '\x{0156}',
- S => '\x{015E}',
- T => '\x{0162}',
- c => '\x{00E7}',
- d => '\x{1E11}',
- e => '\x{0229}',
- g => '\x{0123}',
- h => '\x{1E29}',
- k => '\x{0137}',
- l => '\x{013C}',
- n => '\x{0146}',
- r => '\x{0157}',
- s => '\x{015F}',
- t => '\x{0163}',
- },
- "d" => { # with dot below
- A => '\x{1EA0}',
- B => '\x{1E04}',
- D => '\x{1E0C}',
- E => '\x{1EB8}',
- H => '\x{1E24}',
- I => '\x{1ECA}',
- K => '\x{1E32}',
- L => '\x{1E36}',
- M => '\x{1E42}',
- N => '\x{1E46}',
- O => '\x{1ECC}',
- R => '\x{1E5A}',
- S => '\x{1E62}',
- T => '\x{1E6C}',
- U => '\x{1EE4}',
- V => '\x{1E7E}',
- W => '\x{1E88}',
- Y => '\x{1Ef4}',
- Z => '\x{1E92}',
- "\\I" => '\x{1ECA}',
- "\\i" => '\x{1ECB}',
- a => '\x{1EA1}',
- b => '\x{1E05}',
- d => '\x{1E0D}',
- e => '\x{1EB9}',
- h => '\x{1E25}',
- i => '\x{1ECB}',
- k => '\x{1E33}',
- l => '\x{1E37}',
- m => '\x{1E43}',
- n => '\x{1E47}',
- o => '\x{1ECD}',
- r => '\x{1E5b}',
- s => '\x{1E63}',
- t => '\x{1E6D}',
- u => '\x{1EE5}',
- v => '\x{1E7F}',
- w => '\x{1E89}',
- y => '\x{1EF5}',
- z => '\x{1E93}',
- },
- "h" => { # with hook above
- A => '\x{1EA2}',
- E => '\x{1EBA}',
- I => '\x{1EC8}',
- O => '\x{1ECe}',
- U => '\x{1EE6}',
- Y => '\x{1EF6}',
- "\\I" => '\x{1EC8}',
- "\\i" => '\x{1EC9}',
- a => '\x{1EA3}',
- e => '\x{1EBB}',
- i => '\x{1EC9}',
- o => '\x{1ECF}',
- u => '\x{1EE7}',
- y => '\x{1EF7}',
- },
- "k" => { # with ogonek
- A => '\x{0104}',
- E => '\x{0118}',
- I => '\x{012E}',
- O => '\x{01EA}',
- U => '\x{0172}',
- "\\I" => '\x{012E}',
- "\\i" => '\x{012F}',
- a => '\x{0105}',
- e => '\x{0119}',
- i => '\x{012F}',
- o => '\x{01EB}',
- u => '\x{0173}',
- },
- "r" => { # with ring above
- A => '\x{00C5}',
- U => '\x{016E}',
- a => '\x{00E5}',
- u => '\x{016F}',
- w => '\x{1E98}',
- y => '\x{1E99}',
- },
- "u" => { # with breve
- A => '\x{0102}',
- E => '\x{0114}',
- G => '\x{011E}',
- I => '\x{012C}',
- O => '\x{014E}',
- U => '\x{016C}',
- "\\I" => '\x{012C}',
- "\\i" => '\x{012D}',
- a => '\x{0103}',
- e => '\x{0115}',
- g => '\x{011F}',
- i => '\x{012D}',
- o => '\x{014F}',
- u => '\x{016D}',
- },
- "v" => { # with caron
- A => '\x{01CD}',
- C => '\x{010C}',
- D => '\x{010E}',
- DZ => '\x{01C4}',
- E => '\x{011A}',
- G => '\x{01E6}',
- H => '\x{021E}',
- I => '\x{01CF}',
- K => '\x{01E8}',
- L => '\x{013D}',
- N => '\x{0147}',
- O => '\x{01D1}',
- R => '\x{0158}',
- S => '\x{0160}',
- T => '\x{0164}',
- U => '\x{01D3}',
- Z => '\x{017D}',
- "\\I" => '\x{01CF}',
- "\\i" => '\x{01D0}',
- "\\j" => '\x{01F0}',
- a => '\x{01CE}',
- c => '\x{010D}',
- d => '\x{010F}',
- dz => '\x{01C6}',
- e => '\x{011B}',
- g => '\x{01E7}',
- h => '\x{021F}',
- i => '\x{01D0}',
- j => '\x{01F0}',
- k => '\x{01E9}',
- l => '\x{013E}',
- n => '\x{0148}',
- o => '\x{01D2}',
- r => '\x{0159}',
- s => '\x{0161}',
- t => '\x{0165}',
- u => '\x{01D4}',
- z => '\x{017E}',
- },
-);
-
-#
-our %GERMAN = ( # for package `german'/`ngerman'
- '"a' => 'ä',
- '"A' => 'Ä',
- '"e' => 'ë',
- '"E' => 'Ë',
- '"i' => 'ï',
- '"I' => 'Ï',
- '"o' => 'ö',
- '"O' => 'Ö',
- '"u' => 'ü',
- '"U' => 'Ü',
- '"s' => 'ß',
- '"S' => 'SS',
- '"z' => 'ß',
- '"Z' => 'SZ',
- '"ck' => 'ck', # old spelling: ck -> k-k
- '"ff' => 'ff', # old spelling: ff -> ff-f
- '"`' => '„',
- "\"'" => '“',
- '"<' => '«',
- '">' => '»',
- '"-' => '\x{00AD}', # soft hyphen
- '""' => '\x{200B}', # zero width space
- '"~' => '\x{2011}', # non-breaking hyphen
- '"=' => '-',
- '\glq' => '‚', # left german single quote
- '\grq' => '‘', # right german single quote
- '\flqq' => '«',
- '\frqq' => '»',
- '\dq' => '"',
-);
-
-1;
-
-__END__
-=pod
-
-=encoding UTF-8
-
-=head1 NAME
-
-LaTeX::ToUnicode::Tables - Character tables for LaTeX::ToUnicode
-
-=head1 VERSION
-
-version 0.54
-
-=head1 CONSTANTS
-
-=head2 @LIGATURES
-
-Standard TeX character sequences (not \commands) which need to be
-replaced: C<---> with U+2014 (em dash), etc. Includes: em dash, en
-dash, inverted exclamation, inverted question, left double quote, right
-double quote, left single quote, right single quote. They are replaced
-in that order.
-
-=head2 %MARKUPS
-
-Hash where keys are the names of formatting commands like C<\tt>,
-without the backslash, namely: C<bf cal em it rm sc sf sl small tt>. Values
-are the obvious HTML equivalent where one exists, given as the tag name
-without the angle brackets: C<b em i tt>. Otherwise the value is the empty
-string.
-
-=head2 %ARGUMENT_COMMANDS
-
-Hash where keys are the names of TeX commands taking arguments that we
-handle, without the backslash, such as C<enquote>. Each value is a
-reference to a list of two strings, the first being the text to insert
-before the argument, the second being the text to insert after. For
-example, for C<enquote> the value is C<["`", "'"]>. The inserted text is
-subject to further replacements.
-
-Only three such commands are currently handled: C<\emph>, C<\enquote>,
-and C<\path>.
-
-=head2 %CONTROL_SYMBOLS
-
-A hash where the keys are non-alphabetic C<\command>s (without the
-backslash), other than accents and special cases. These don't take
-arguments. Although some of these have Unicode equivalents, such as the
-C<\,> thin space, it seems better to keep the output as simple as
-possible; small spacing tweaks in TeX aren't usually desirable in plain
-text or HTML.
-
-The values are single-quoted strings C<'\x{...}'>, not double-quoted
-literal characters <"\x{...}">, to ease future parsing of the
-TeX/text/HTML.
-
-This hash is necessary because TeX's parsing rules for control symbols
-are different from control words: no space or other token is needed to
-terminate control symbols.
-
-=head2 %CONTROL_WORDS
-
-Keys are names of argument-less commands, such as C<\LaTeX> (without the
-backslash). Values are the replacements, often the empty string.
-
-=head2 %SYMBOLS
-
-Keys are the commands for extended characters, such as C<\AA> (without
-the backslash.)
-
-=head2 %ACCENT_SYMBOLS
-
-Two-level hash of accented characters like C<\'{a}>. The keys of this
-hash are the accent symbols (without the backslash), such as C<`> and
-C<'>. The corresponding values are hash references where the keys are
-the base letters and the values are single-quoted C<'\x{....}'> strings.
-
-=head2 %ACCENT_LETTERS
-
-Same as %ACCENT_SYMBOLS, except the keys are accents that are
-alphabetic, such as C<\c> (without the backslash as always).
-
-As with control sequences, it's necessary to distinguish symbols and
-alphabetic commands because of the different parsing rules.
-
-=head2 %GERMAN
-
-Character sequences (not necessarily commands) as defined by the package
-`german'/`ngerman', e.g. C<"a> (a with umlaut), C<"s> (german sharp s)
-or C<"`"> (german left quote). Note the missing backslash.
-
-The keys of this hash are the literal character sequences.
-
-=head1 AUTHOR
-
-Gerhard Gossen <gerhard.gossen@googlemail.com>,
-Boris Veytsman <boris@varphi.com>,
-Karl Berry <karl@freefriends.org>
-
-L<https://github.com/borisveytsman/bibtexperllibs>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright 2010-2023 Gerhard Gossen, Boris Veytsman, Karl Berry
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl5 programming language system itself.
-
-=cut
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/ltx2unitxt.1 b/support/bibtexperllibs/LaTeX-ToUnicode/ltx2unitxt.1
deleted file mode 100644
index 8dc8e71426..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/ltx2unitxt.1
+++ /dev/null
@@ -1,73 +0,0 @@
-.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
-.TH LTX2UNITXT "1" "November 2023" "ltx2unitxt " "User Commands"
-.SH NAME
-ltx2unitxt \- convert LaTeX source fragment to plain (Unicode) text or simple html
-.SH SYNOPSIS
-.B ltx2unitxt
-[\fI\,-c CONFIG\/\fR] [\fI\,-o OUTPUT\/\fR] [\fI\,--html\/\fR] [...] [\fI\,INFILE\/\fR]...
-.SH DESCRIPTION
-Convert the LaTeX source in INFILE (or standard input) to plain text
-using Unicode code points for accents and other special characters; or,
-optionally, output HTML with simple translations for font changes and url
-commands.
-.PP
-Common accent sequences, special characters, and simple markup commands
-are translated, but there is no attempt at completeness. Math, tables,
-figures, sectioning, etc., are not handled in any way, and mostly left
-in their TeX form in the output. The translations assume standard LaTeX
-meanings for characters and control sequences; macros in the input are
-not considered.
-.PP
-The input can be a fragment of text, not a full document, as the purpose
-of this script was to handle bibliography entries and abstracts (for the
-ltx2crossrefxml script that is part of the crossrefware package).
-Patches to extend this script are welcome. It uses the LaTeX::ToUnicode
-Perl library for the conversion; see its documentation for details.
-.PP
-Conversion is currently done line by line, so TeX constructs that cross
-multiple lines are not handled properly. If it turns out to be useful,
-conversion could be done by paragraph instead.
-.PP
-The config file is read as a Perl source file. It can define a function
-`LaTeX_ToUnicode_convert_hook()' which will be called early; the value
-it returns (which must be a string) will then be subject to the standard
-conversion.
-.PP
-For an example of using this script and associated code, see the TUGboat
-processing at
-https://github.com/TeXUsersGroup/tugboat/tree/trunk/capsules/crossref.
-.SH OPTIONS
-.TP
-\fB\-c\fR, \fB\-\-config\fR=\fI\,FILE\/\fR
-read (Perl) config FILE for a hook, as explained above
-.TP
-\fB\-e\fR, \fB\-\-entities\fR
-output entities &#xNNNN; instead of literal characters
-.TP
-\fB\-g\fR, \fB\-\-german\fR
-handle some features of the german package
-.TP
-\fB\-h\fR, \fB\-\-html\fR
-output simplistic HTML instead of plain text
-.TP
-\fB\-o\fR, \fB\-\-output\fR=\fI\,FILE\/\fR
-output to FILE instead of stdout
-.TP
-\fB\-v\fR, \fB\-\-verbose\fR
-be verbose
-.TP
-\fB\-V\fR, \fB\-\-version\fR
-output version information and exit
-.TP
-\-?, \fB\-\-help\fR
-display this help and exit
-.PP
-Options can be abbreviated unambiguously, and start with either \- or \fB\-\-\fR.
-.PP
-Dev sources, bug tracker: https://github.com/borisveytsman/bibtexperllibs
-Releases: https://ctan.org/pkg/bibtexperllibs
-.PP
-ltx2unitxt (bibtexperllibs) 0.51
-Copyright 2023 Karl Berry.
-This is free software: you can redistribute it and/or
-modify it under the same terms as Perl itself.
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/ltx2unitxt.pdf b/support/bibtexperllibs/LaTeX-ToUnicode/ltx2unitxt.pdf
deleted file mode 100644
index 7dfae7f396..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/ltx2unitxt.pdf
+++ /dev/null
Binary files differ
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/script/convert.pl b/support/bibtexperllibs/LaTeX-ToUnicode/script/convert.pl
deleted file mode 100644
index 70cc0bda84..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/script/convert.pl
+++ /dev/null
@@ -1,156 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use utf8;
-
-use feature 'say';
-use FindBin;
-
-my $UNICODE_DATA_URL = "http://www.unicode.org/Public/UNIDATA/UnicodeData.txt";
-
-
-my $stream;
-if ( -f "$FindBin::Bin/UnicodeData.txt" ) {
- open $stream, "<", "$FindBin::Bin/UnicodeData.txt" or die;
-} else {
- open $stream, "-|", "curl $UNICODE_DATA_URL" or die;
-}
-my %data;
-
-my %chars = (
- 'ACUTE' => "'",
- 'ACUTE AND DOT ABOVE' => '',
- 'BAR' => '',
- 'BELT' => '',
- 'BREVE' => 'u',
- 'BREVE AND ACUTE' => '',
- 'BREVE AND DOT BELOW' => '',
- 'BREVE AND GRAVE' => '',
- 'BREVE AND HOOK ABOVE' => '',
- 'BREVE AND TILDE' => '',
- 'BREVE BELOW' => '',
- 'CARON' => 'v',
- 'CARON AND DOT ABOVE' => '',
- 'CEDILLA' => 'c',
- 'CEDILLA AND ACUTE' => '',
- 'CEDILLA AND BREVE' => '',
- 'CIRCUMFLEX' => '^',
- 'CIRCUMFLEX AND ACUTE' => '',
- 'CIRCUMFLEX AND DOT BELOW' => '',
- 'CIRCUMFLEX AND GRAVE' => '',
- 'CIRCUMFLEX AND HOOK ABOVE' => '',
- 'CIRCUMFLEX AND TILDE' => '',
- 'CIRCUMFLEX BELOW' => '',
- 'COMMA' => '',
- 'COMMA BELOW' => '',
- 'CROSSED-TAIL' => '',
- 'CURL' => '',
- 'DESCENDER' => '',
- 'DIAERESIS' => '"',
- 'DIAERESIS AND ACUTE' => '',
- 'DIAERESIS AND CARON' => '',
- 'DIAERESIS AND GRAVE' => '',
- 'DIAERESIS AND MACRON' => '',
- 'DIAERESIS BELOW' => '',
- 'DIAGONAL STROKE' => '',
- 'DOT ABOVE' => '.',
- 'DOT ABOVE AND MACRON' => '',
- 'DOT BELOW' => 'd',
- 'DOT BELOW AND DOT ABOVE' => '',
- 'DOT BELOW AND MACRON' => '',
- 'DOUBLE ACUTE' => 'H',
- 'DOUBLE BAR' => '',
- 'DOUBLE GRAVE' => '',
- 'FISHHOOK' => '',
- 'FISHHOOK AND MIDDLE TILDE' => '',
- 'FLOURISH' => '',
- 'GRAVE' => '`',
- 'HIGH STROKE' => '',
- 'HOOK' => '',
- 'HOOK ABOVE' => 'h',
- 'HOOK AND TAIL' => '',
- 'HOOK TAIL' => '',
- 'HORIZONTAL BAR' => '',
- 'HORN' => '',
- 'HORN AND ACUTE' => '',
- 'HORN AND DOT BELOW' => '',
- 'HORN AND GRAVE' => '',
- 'HORN AND HOOK ABOVE' => '',
- 'HORN AND TILDE' => '',
- 'INVERTED BREVE' => '',
- 'LEFT HOOK' => '',
- 'LINE BELOW' => '',
- 'LONG LEG' => '',
- 'LONG RIGHT LEG' => '',
- 'LONG STROKE OVERLAY' => '',
- 'LOOP' => '',
- 'LOW RING INSIDE' => '',
- 'MACRON' => '=',
- 'MACRON AND ACUTE' => '',
- 'MACRON AND DIAERESIS' => '',
- 'MACRON AND GRAVE' => '',
- 'MIDDLE DOT' => '',
- 'MIDDLE TILDE' => '',
- 'NOTCH' => '',
- 'OGONEK' => 'k',
- 'OGONEK AND MACRON' => '',
- 'PALATAL HOOK' => '',
- 'RETROFLEX HOOK' => '',
- 'RIGHT HALF RING' => '',
- 'RIGHT HOOK' => '',
- 'RING ABOVE' => 'r',
- 'RING ABOVE AND ACUTE' => '',
- 'RING BELOW' => '',
- 'SMALL LETTER J' => '',
- 'SMALL LETTER Z' => '',
- 'SMALL LETTER Z WITH CARON' => '',
- 'SQUIRREL TAIL' => '',
- 'STRIKETHROUGH' => '',
- 'STROKE' => '',
- 'STROKE AND ACUTE' => '',
- 'STROKE AND DIAGONAL STROKE' => '',
- 'STROKE THROUGH DESCENDER' => '',
- 'SWASH TAIL' => '',
- 'TAIL' => '',
- 'TILDE' => '~',
- 'TILDE AND ACUTE' => '',
- 'TILDE AND DIAERESIS' => '',
- 'TILDE AND MACRON' => '',
- 'TILDE BELOW' => '',
- 'TOPBAR' => '',
-);
-
-my %missing;
-
-while(<$stream>) {
- chomp;
- my @F = split /;/;
- my $hex = $F[0];
- if ( $F[1] =~ /LATIN (SMALL|CAPITAL) LETTER ((?:\w+ )*\w{1,2}) WITH (.+)$/ ) {
- my $case = $1;
- my $letter = $2;
- my $accent = $3;
-
- if ( $case eq 'SMALL' ) {
- $letter = lc $letter;
- }
- if ( $chars{$accent} && $letter !~ / / ) {
- my $char = chr( eval "0x$hex" );
- $data{ $chars{$accent} }->{ $letter } = $char;
- if ( lc( $letter ) eq 'i' ) {
- my $additional_letter = "\\$letter";
- $data{ $chars{$accent} }->{ $additional_letter } = $char;
- }
- } else {
- push @{ $missing{$accent} }, $letter;
- }
- }
-}
-
-use Data::Dumper::Concise;
-
-binmode(STDOUT, ":utf8");
-
-say Dumper( \%data );
-#say Dumper( \%missing );
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/script/ltx2unitxt b/support/bibtexperllibs/LaTeX-ToUnicode/script/ltx2unitxt
deleted file mode 100755
index 661ea40417..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/script/ltx2unitxt
+++ /dev/null
@@ -1,169 +0,0 @@
-#!/usr/bin/env perl
-# Use the LaTeX::ToUnicode module (also in the bibtexperllibs
-# repository/package, like this script) to convert LaTeX to Unicode.
-#
-# We work on fragments of text, not whole documents, the goal being to
-# replace LaTeX commands and syntax with obvious plain text equivalents,
-# or remove them.
-
-use strict;
-use warnings;
-
-use Cwd;
-use File::Basename;
-use File::Spec;
-
-BEGIN {
- # find files relative to our installed location within TeX Live
- chomp(my $TLMaster = `kpsewhich -var-value=SELFAUTOPARENT`); # TL root
- if (length($TLMaster)) {
- unshift @INC, "$TLMaster/texmf-dist/scripts/bibtexperllibs";
- }
- # find development bibtexperllibs in sibling checkout to this script,
- # even if $0 is a symlink. Irrelevant when using from an installation.
- my $real0 = Cwd::abs_path($0);
- my $scriptdir = File::Basename::dirname($real0);
- my $dev_btxperllibs = Cwd::abs_path("$scriptdir/../..");
-
- # we need the lib/ subdirectories inside ...
- unshift (@INC, glob ("$dev_btxperllibs/*/lib")) if -d $dev_btxperllibs;
-
-}
-
-use LaTeX::ToUnicode;
-
-our %opts;
-local *OUT; # output filehandle
-
-exit(main());
-
-sub main {
- init();
-
- # by paragraph?
- while (<>) {
- print OUT (convert($_));
- }
-
- return 0;
-}
-
-sub convert {
- my ($in) = @_;
-
- my @args = (); # what we'll pass to the convert() fn.
- #
- if (defined(&{"LaTeX_ToUnicode_convert_hook"})) {
- push (@args, "hook" => \&LaTeX_ToUnicode_convert_hook); }
- if ($opts{e}) { push (@args, "entities" => 1); }
- if ($opts{g}) { push (@args, "german" => 1); }
- if ($opts{h}) { push (@args, "html" => 1); }
-
- LaTeX::ToUnicode::debuglevel($opts{v});
- my $out = LaTeX::ToUnicode::convert($in, @args);
-
- #warn "out=$out";
- return $out;
-}
-
-
-# Command line options, etc.
-#
-sub init {
- my $USAGE = <<END;
-Usage: $0 [-c CONFIG] [-o OUTPUT] [--html] [...] [INFILE]...
-
-Convert the LaTeX source in INFILE (or standard input) to plain text
-using Unicode code points for accents and other special characters; or,
-optionally, output HTML with simple translations for font changes and url
-commands.
-
-Common accent sequences, special characters, and simple markup commands
-are translated, but there is no attempt at completeness. Math, tables,
-figures, sectioning, etc., are not handled in any way, and mostly left
-in their TeX form in the output. The translations assume standard LaTeX
-meanings for characters and control sequences; macros in the input are
-not considered.
-
-The input can be a fragment of text, not a full document, as the purpose
-of this script was to handle bibliography entries and abstracts (for the
-ltx2crossrefxml script that is part of the crossrefware package).
-Patches to extend this script are welcome. It uses the LaTeX::ToUnicode
-Perl library for the conversion; see its documentation for details.
-
-Conversion is currently done line by line, so TeX constructs that cross
-multiple lines are not handled properly. If it turns out to be useful,
-conversion could be done by paragraph instead.
-
-The config file is read as a Perl source file. It can define a function
-`LaTeX_ToUnicode_convert_hook()' which will be called early; the value
-it returns (which must be a string) will then be subject to the standard
-conversion.
-
-For an example of using this script and associated code, see the TUGboat
-processing at
-https://github.com/TeXUsersGroup/tugboat/tree/trunk/capsules/crossref.
-
-Options:
- -c, --config=FILE read (Perl) config FILE for a hook, as explained above
- -e, --entities output entities &#xNNNN; instead of literal characters
- -g, --german handle some features of the german package
- -h, --html output simplistic HTML instead of plain text
- -o, --output=FILE output to FILE instead of stdout
- -v, --verbose be verbose
- -V, --version output version information and exit
- -?, --help display this help and exit
-
-Options can be abbreviated unambiguously, and start with either - or --.
-
-Dev sources, bug tracker: https://github.com/borisveytsman/bibtexperllibs
-Releases: https://ctan.org/pkg/bibtexperllibs
-END
-
- my $VERSION = <<END;
-ltx2unitxt (bibtexperllibs) 0.51
-Copyright 2023 Karl Berry.
-This is free software: you can redistribute it and/or
-modify it under the same terms as Perl itself.
-END
-
- use Getopt::Long qw(:config no_ignore_case); # otherwise v|V is the same
-
- GetOptions(
- "config|c=s" => \($opts{c}),
- "entities|e" => \($opts{e}),
- "german|g" => \($opts{g}),
- "html|h" => \($opts{h}),
- "output|o=s" => \($opts{o}),
- "verbose|v" => \($opts{v}),
- "version|V" => \($opts{V}),
- "help|?" => \($opts{help}))
- || die "Try $0 --help for more information.\n";
-
- if ($opts{help}) { print "$USAGE\n$VERSION"; exit 0; }
- if ($opts{V}) { print $VERSION; exit 0; }
-
- binmode(STDOUT, ":utf8");
- *OUT = *STDOUT;
-
- if (defined($opts{o})) {
- open(OUT, ">$opts{o}") || die "open(>$opts{o}) failed: $!\n";
- binmode(OUT, ":utf8")
- }
-
- if ($opts{c}) {
- if (-r $opts{c}) {
- # if config arg is absolute, fine; if not, prepend "./" as slightly
- # less troublesome than putting "." in the @INC path.
- my $rel = (File::Spec->file_name_is_absolute($opts{c}) ? "" : "./");
- my $cnffile = "$rel$opts{c}";
- verbose("requiring config file: $cnffile");
- require $cnffile;
- } else {
- die "open config file ($opts{c}) for reading failed: $!\n";
- }
- }
-}
-
-
-sub verbose { print @_ if $::opts{v}; }
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/t/convert.t b/support/bibtexperllibs/LaTeX-ToUnicode/t/convert.t
deleted file mode 100644
index 9bd7a4f3d4..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/t/convert.t
+++ /dev/null
@@ -1,136 +0,0 @@
-use strict;
-use warnings;
-
-use Test::More;
-use utf8;
-
-BEGIN{ use_ok( 'LaTeX::ToUnicode', qw( convert ) ); }
-
-binmode( STDOUT, ':utf8' );
-my @tests = (
- [ '\LaTeX' => 'LaTeX' ],
- [ '\$ \% \& \_ \{ \} \#' => '$ % & _ { } #' ],
- [ '{\"{a}}' => 'ä' ],
- [ '{\"a}' => 'ä' ],
- [ '{\`{a}}' => 'à' ],
- [ '{\`a}' => 'à' ],
- [ '\ae' => 'æ' ],
- [ '\L' => 'Ł' ],
- [ "{\\'e}" => 'é'],
- ['\={a}' => 'ā'],
- ['{\=a}' => 'ā'],
-);
-
-foreach my $test ( @tests ) {
- is( convert( $test->[0] ), $test->[1], "Convert $test->[0]" );
-}
-
-my @german_tests = (
- [ '"a' => 'ä' ],
- ['"`' => '„' ],
- ["\"'" => '“' ],
-);
-
-foreach my $test ( @german_tests ) {
- is( convert( $test->[0], german => 1 ), $test->[1], "Convert $test->[0], german => 1" );
-}
-
-binmode( DATA, ':utf8' );
-while (<DATA>) {
- chomp;
- my ( $tex, $result ) = split /\t/;
- is( convert( $tex ), $result, "Convert $tex" );
-}
-close DATA;
-
-done_testing;
-
-__DATA__
-\& &
-{\`a} à
-{\^a} â
-{\~a} ã
-{\'a} á
-{\'{a}} á
-{\"a} ä
-{\`A} À
-{\'A} Á
-{\"A} Ä
-{\aa} å
-{\AA} Å
-{\ae} æ
-{\bf 12} 12
-{\'c} ć
-{\cal P} P
-{\c{c}} ç
-{\c{C}} Ç
-{\c{e}} ȩ
-{\c{s}} ş
-{\c{S}} Ş
-{\c{t}} ţ
-{\-d} d
-{\`e} è
-{\^e} ê
-{\'e} é
-{\"e} ë
-{\'E} É
-{\em bits} bits
-{\H{o}} ő
-{\`i} ì
-{\^i} î
-{\i} ı
-{\`i} ì
-{\'i} í
-{\"i} ï
-{\`\i} ì
-{\'\i} í
-{\"\i} ï
-{\`{\i}} ì
-{\'{\i}} í
-{\"{\i}} ï
-{\it Note} Note
-{\k{e}} ę
-{\l} ł
-{\-l} l
-{\log} log
-{\~n} ñ
-{\'n} ń
-{\^o} ô
-{\o} ø
-{\'o} ó
-{\"o} ö
-{\"{o}} ö
-{\'O} Ó
-{\"O} Ö
-{\"{O}} Ö
-{\rm always} always
-{\-s} s
-{\'s} ś
-{\sc JoiN} JoiN
-{\sl bit\/ \bf 7} bit 7
-{\sl L'Informatique Nouvelle} L’Informatique Nouvelle
-{\small and} and
-{\ss} ß
-{\TeX} TeX
-{\TM} ™
-{\tt awk} awk
-{\^u} û
-{\'u} ú
-{\"u} ü
-{\"{u}} ü
-{\'U} Ú
-{\"U} Ü
-{\u{a}} ă
-{\u{g}} ğ
-{\v{c}} č
-{\v{C}} Č
-{\v{e}} ě
-{\v{n}} ň
-{\v{r}} ř
-{\v{s}} š
-{\v{S}} Š
-{\v{z}} ž
-{\v{Z}} Ž
-{\'y} ý
-{\.{z}} ż
-Herv{\`e} Br{\"o}nnimann Hervè Brönnimann
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/t/release-pod-coverage.t b/support/bibtexperllibs/LaTeX-ToUnicode/t/release-pod-coverage.t
deleted file mode 100644
index 3a818499f0..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/t/release-pod-coverage.t
+++ /dev/null
@@ -1,21 +0,0 @@
-#!perl
-
-BEGIN {
- unless ($ENV{RELEASE_TESTING}) {
- require Test::More;
- Test::More::plan(skip_all => 'these tests are for release candidate testing');
- }
-}
-
-
-use Test::More;
-
-eval "use Test::Pod::Coverage 1.08";
-plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage"
- if $@;
-
-eval "use Pod::Coverage::TrustPod";
-plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage"
- if $@;
-
-all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/t/release-pod-syntax.t b/support/bibtexperllibs/LaTeX-ToUnicode/t/release-pod-syntax.t
deleted file mode 100644
index d46a955694..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/t/release-pod-syntax.t
+++ /dev/null
@@ -1,15 +0,0 @@
-#!perl
-
-BEGIN {
- unless ($ENV{RELEASE_TESTING}) {
- require Test::More;
- Test::More::plan(skip_all => 'these tests are for release candidate testing');
- }
-}
-
-use Test::More;
-
-eval "use Test::Pod 1.41";
-plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
-
-all_pod_files_ok();
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/t/release-synopsis.t b/support/bibtexperllibs/LaTeX-ToUnicode/t/release-synopsis.t
deleted file mode 100644
index 7a83682539..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/t/release-synopsis.t
+++ /dev/null
@@ -1,16 +0,0 @@
-#!perl
-
-BEGIN {
- unless ($ENV{RELEASE_TESTING}) {
- require Test::More;
- Test::More::plan(skip_all => 'these tests are for release candidate testing');
- }
-}
-
-
-use Test::More;
-
-eval "use Test::Synopsis";
-plan skip_all => "Test::Synopsis required for testing synopses"
- if $@;
-all_synopsis_ok('lib');
diff --git a/support/bibtexperllibs/LaTeX-ToUnicode/weaver.ini b/support/bibtexperllibs/LaTeX-ToUnicode/weaver.ini
deleted file mode 100644
index 1cc341ff23..0000000000
--- a/support/bibtexperllibs/LaTeX-ToUnicode/weaver.ini
+++ /dev/null
@@ -1,24 +0,0 @@
-[-Encoding]
-[@CorePrep]
-
-[Name]
-[Version]
-
-[Region / prelude]
-
-[Generic / SYNOPSIS]
-[Generic / DESCRIPTION]
-[Generic / OVERVIEW]
-
-[Collect / ATTRIBUTES]
-command = attr
-
-[Collect / METHODS]
-command = method
-
-[Leftovers]
-
-[Region / postlude]
-
-[Authors]
-[Legal]
diff --git a/support/bibtexperllibs/Makefile b/support/bibtexperllibs/Makefile
deleted file mode 100644
index d1b0bdc84d..0000000000
--- a/support/bibtexperllibs/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# This is Makefile for TDS-compliant TeX distributions
-# Written by Boris Veytsman, boris@varphi.com
-#
-# This file is in public domain
-#
-
-PACKAGE = bibtexperllibs
-
-DIRS = BibTeX-Parser LaTeX-ToUnicode
-
-all:
-
-clean:
- for dir in ${DIRS}; do (cd $$dir && ${MAKE} -f Makefile.TDS clean); done
-
-
-distclean: clean
- for dir in ${DIRS}; do (cd $$dir && ${MAKE} -f Makefile.TDS distclean); done
-
-install:
- for dir in ${DIRS}; do (cd $$dir && ${MAKE} -f Makefile.TDS install); done
-
-archive:
- for dir in ${DIRS}; do (cd $$dir && ${MAKE} -f Makefile.TDS docs); done
- for dir in ${DIRS}; do (cd $$dir && ${MAKE} -f Makefile.TDS clean); done
- COPYFILE_DISABLE=1 tar -czvf ../$(PACKAGE).tgz -C .. --exclude '*~' --exclude '*.tgz' --exclude CVS --exclude .git --exclude .gitignore --exclude blib --exclude "*.tar.gz" --exclude pm_to_blib $(PACKAGE)
diff --git a/support/bibtexperllibs/README b/support/bibtexperllibs/README
deleted file mode 100644
index fef3d0b276..0000000000
--- a/support/bibtexperllibs/README
+++ /dev/null
@@ -1,49 +0,0 @@
- BibTeX Perl Libs
- Version 1.9
- Gerhard Gossen, Boris Veytsman, Karl Berry
-
-This package provides BibTeX-related Perl libraries by Gerhard Gossen,
-maintained and repackaged by Boris Veytsman for TeX Live and other
-TDS-compliant distributions. The libraries are written in pure Perl,
-so shoud work out of the box on any architecture.
-
-To use them in your scripts, add to the @INC variable the directory
-scripts/bibtexperllibs inside your TeX distribution. A script ltx2unitxt
-packages the conversion libraries for use from the command line.
-
-Bug reports, source code: https://github.com/borisveytsman/bibtexperllibs
-Releases: https://ctan.org/pkg/bibtexperllibs
-
-For an example of using the LaTeX::ToUnicode module, see the
-crossrefware package (which is also the reason for continued development).
-
-Changes:
-
- version 1.9 2023-11-18 Now braces are rendered correctly by
- LaTeX-ToUnicode
-
- version 1.8 2023-08-20 Tests updates, timestamp updates.
-
- version 1.7 2021-01-20 LaTeX::ToUnicode 0.51 for still more
- ltx2crossrefxml support, including simple html output.
- (No changes to BibTeX::Parser.)
-
- version 1.6 2020-12-10 LaTeX::ToUnicode 0.11 for more ltx2crossrefxml
- support. (No changes to BibTeX::Parser.)
-
- version 1.5 Upgraded BibTeX::Parser to 1.02 (bugfixes)
-
- version 1.4 Upgraded BibTeX::Parser to 1.01
-
- version 1.3 Upgraded BibTeX::Parser to 1.00
-
- version 1.2 Upgraded BibTeX::Parser to v0.70 and LaTeX::ToUnicode to 0.05
-
- version 1.1 Upgraded BibTeX::Parser to v0.69
-
- version 1.0 Upgraded BibTeX::Parser to v0.68 and LaTeX::ToUnicode to 0.04
-
- version 0.2 New upstream version for BibTeX::Parser (0.66)
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
diff --git a/support/crossrefware/Makefile b/support/crossrefware/Makefile
index c8caf35d60..fb54525cba 100644
--- a/support/crossrefware/Makefile
+++ b/support/crossrefware/Makefile
@@ -25,6 +25,11 @@ check:
pod2man -c "LATEX CROSSREFWARE" -n $* -s 1 -r "" $< > $@
+lastrel = /home/ftp/tex-archive/support/crossrefware
+reldiff:
+ diff -u0r $(lastrel) .
+gitdiff:
+ git diff
clean:
$(RM) *.aux *.toc *.log *.tex *.idx *.ilg *.ind *.out *.zip *.tgz *~
diff --git a/support/crossrefware/README b/support/crossrefware/README
index 05d375253e..d2de384b79 100644
--- a/support/crossrefware/README
+++ b/support/crossrefware/README
@@ -1,5 +1,5 @@
Crossrefware Bundle
- version 2024-01-31
+ version 2024-08-27
Scripts useful for working with Crossref, MathSciNet and Zentralblatt MATH.
@@ -30,9 +30,14 @@ Princeton University (Mathematics Department). Thank you!
Changes:
+2024-08-27 - output crossref schema 5.3.1:
+ https://www.crossref.org/documentation/schema-library/schema-versions/
+ (and update various doc urls that crossref broke.)
+ - more documentation on the bib*add scripts.
+
2024-01-31 - exit with bad status if no \end{thebibliography}.
-2022-09-11 - add "***" prefix to bib warnings.
+2022-09-11 - add "*** " prefix to bib warnings.
2022-07-28 - find dev checkout of bibtexperllibs.
diff --git a/support/crossrefware/bibdoiadd.1 b/support/crossrefware/bibdoiadd.1
index 737f4f2a4b..1425b1e08d 100644
--- a/support/crossrefware/bibdoiadd.1
+++ b/support/crossrefware/bibdoiadd.1
@@ -55,7 +55,7 @@
.\" ========================================================================
.\"
.IX Title "bibdoiadd 1"
-.TH bibdoiadd 1 2023-08-20 "" "LATEX CROSSREFWARE"
+.TH bibdoiadd 1 2024-09-02 "" "LATEX CROSSREFWARE"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -73,7 +73,7 @@ Configuration file. If this file is absent, some defaults are used.
See below for its format.
.IP "\fB\-C\fR 1|0" 4
.IX Item "-C 1|0"
-Whether to canonize names in the output (1) or not (0). By default, 1.
+Whether to canonicalize names in the output (1) or not (0). By default, 1.
.IP \fB\-e\fR 4
.IX Item "-e"
If 1 (default), add empty doi if a doi cannot be found. This prevents
@@ -96,19 +96,29 @@ corresponding DOI. The result is a BibTeX file with the fields
The name of the output file is either set by the \fB\-o\fR option or
is derived by adding the suffix \f(CW\*(C`_doi\*(C'\fR to the output file.
.PP
-There are two options for making queries with Crossref: free account
-and paid membership. In the first case you still must register with
-Crossref and are limited to a small number of queries, see the
+Every BibTeX record in the input is parsed, using BibTeX::Parser, but
+only the ones that do not have the \f(CW\*(C`doi\*(C'\fR field (or \f(CW\*(C`mrnumber\*(C'\fR or
+\&\f(CW\*(C`zblnumber\*(C'\fR for the sibling scripts) are processed. These entries
+without the requested field are written back, as described in
+BibTeX::Parser::Entry.
+.PP
+The bib records that are not processed (because they already have the
+requested field) are written back as-is, without any reformatting.
+.PP
+There are (were?) two options for making queries with Crossref: free
+account and paid membership. In the first case you still must register
+with Crossref and are limited to a small number of queries, see the
agreement at
-\&\f(CW\*(C`http://www.crossref.org/01company/free_services_agreement.html\*(C'\fR. In
+\&\f(CW\*(C`http://www.crossref.org/01company/free_services_agreement.html\*(C'\fR. In
the second case you have a username and password, and can use them for
-automatic queries. I am not sure whether the use of this script is
-allowed for the free account holders. Anyway if you try to add DOI
-to a large number of entries, you should register as a paid member.
+automatic queries. I am not sure whether the use of this script is
+allowed for the free account holders. At any rate, if you want to add
+DOIs to a large number of entries, you should register as a paid member.
.SH "CONFIGURATION FILE"
.IX Header "CONFIGURATION FILE"
-The configuration file is mostly self-explanatory: it has comments
-(starting with \f(CW\*(C`#\*(C'\fR) and assginments in the form
+The configuration file relates to the Crossref queries, and is mostly
+self-explanatory: it has comments (starting with \f(CW\*(C`#\*(C'\fR) and assginments
+in the form
.PP
.Vb 1
\& $field = value ;
@@ -128,7 +138,7 @@ members.
Boris Veytsman
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
-Copyright (C) 2014\-2021 Boris Veytsman
+Copyright (C) 2014\-2024 Boris Veytsman
.PP
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
diff --git a/support/crossrefware/bibdoiadd.pl b/support/crossrefware/bibdoiadd.pl
index bace84c000..91222af008 100755
--- a/support/crossrefware/bibdoiadd.pl
+++ b/support/crossrefware/bibdoiadd.pl
@@ -21,7 +21,7 @@ See below for its format.
=item B<-C> 1|0
-Whether to canonize names in the output (1) or not (0). By default, 1.
+Whether to canonicalize names in the output (1) or not (0). By default, 1.
=item B<-e>
@@ -50,22 +50,31 @@ C<doi=...> added.
The name of the output file is either set by the B<-o> option or
is derived by adding the suffix C<_doi> to the output file.
-There are two options for making queries with Crossref: free account
-and paid membership. In the first case you still must register with
-Crossref and are limited to a small number of queries, see the
+Every BibTeX record in the input is parsed, using BibTeX::Parser, but
+only the ones that do not have the C<doi> field (or C<mrnumber> or
+C<zblnumber> for the sibling scripts) are processed. These entries
+without the requested field are written back, as described in
+BibTeX::Parser::Entry.
+
+The bib records that are not processed (because they already have the
+requested field) are written back as-is, without any reformatting.
+
+There are (were?) two options for making queries with Crossref: free
+account and paid membership. In the first case you still must register
+with Crossref and are limited to a small number of queries, see the
agreement at
-C<http://www.crossref.org/01company/free_services_agreement.html>. In
+C<http://www.crossref.org/01company/free_services_agreement.html>. In
the second case you have a username and password, and can use them for
-automatic queries. I am not sure whether the use of this script is
-allowed for the free account holders. Anyway if you try to add DOI
-to a large number of entries, you should register as a paid member.
-
+automatic queries. I am not sure whether the use of this script is
+allowed for the free account holders. At any rate, if you want to add
+DOIs to a large number of entries, you should register as a paid member.
=head1 CONFIGURATION FILE
-The configuration file is mostly self-explanatory: it has comments
-(starting with C<#>) and assginments in the form
+The configuration file relates to the Crossref queries, and is mostly
+self-explanatory: it has comments (starting with C<#>) and assginments
+in the form
$field = value ;
@@ -85,7 +94,7 @@ Boris Veytsman
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2014-2021 Boris Veytsman
+Copyright (C) 2014-2024 Boris Veytsman
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
@@ -113,7 +122,7 @@ $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
my $USAGE="USAGE: $0 [-c config] [-C 1|0] [-e 1|0] [-f] [-o output] file\n";
my $VERSION = <<END;
-bibdoiadd v2.2
+bibdoiadd v2.3
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
http://www.gnu.org/licenses/gpl.html. There is NO WARRANTY, to the
@@ -258,7 +267,7 @@ sub GetDoi {
if ($entry->has('pages')) {
my $pages=$entry->field('pages');
$pages =~ s/-.*$//;
- $url .= "&spage=".uri_escape_utf8($pages);
+ $url .= "&spage=".uri_escape_utf8($pages);
}
if ($entry->has('year')) {
$url .= "&date=".uri_escape_utf8($entry->field('year'));
@@ -296,4 +305,3 @@ sub SanitizeText {
$string =~ s/[\{\}]//g;
return $string;
}
-
diff --git a/support/crossrefware/bibmradd.1 b/support/crossrefware/bibmradd.1
index ee49fd5238..54e5c43095 100644
--- a/support/crossrefware/bibmradd.1
+++ b/support/crossrefware/bibmradd.1
@@ -55,7 +55,7 @@
.\" ========================================================================
.\"
.IX Title "bibmradd 1"
-.TH bibmradd 1 2023-08-20 "" "LATEX CROSSREFWARE"
+.TH bibmradd 1 2024-09-02 "" "LATEX CROSSREFWARE"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -84,19 +84,20 @@ Output file. If this option is not used, the name for the
output file is formed by adding \f(CW\*(C`_mr\*(C'\fR to the input file
.SH DESCRIPTION
.IX Header "DESCRIPTION"
-The script reads a BibTeX file. It checks whether the entries have
-mrnumberss. If not, tries to contact internet to get the numbers. The
-result is a BibTeX file with the fields
-\&\f(CW\*(C`mrnumber=...\*(C'\fR added.
+The script reads a BibTeX file. It checks whether the entries have
+mrnumbers. If not, it tries to find the numbers from Internet sites. The
+result is a BibTeX file with \f(CW\*(C`mrnumber=...\*(C'\fR fields added.
.PP
The name of the output file is either set by the \fB\-o\fR option or
is derived by adding the suffix \f(CW\*(C`_mr\*(C'\fR to the output file.
+.PP
+See the \f(CW\*(C`bibdoiadd\*(C'\fR script for more details on the processing.
.SH AUTHOR
.IX Header "AUTHOR"
Boris Veytsman
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
-Copyright (C) 2014\-2022 Boris Veytsman
+Copyright (C) 2014\-2024 Boris Veytsman
.PP
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
diff --git a/support/crossrefware/bibmradd.pl b/support/crossrefware/bibmradd.pl
index 3fea62e3c5..5a0b5a30f7 100755
--- a/support/crossrefware/bibmradd.pl
+++ b/support/crossrefware/bibmradd.pl
@@ -38,21 +38,22 @@ output file is formed by adding C<_mr> to the input file
=head1 DESCRIPTION
-The script reads a BibTeX file. It checks whether the entries have
-mrnumberss. If not, tries to contact internet to get the numbers. The
-result is a BibTeX file with the fields
-C<mrnumber=...> added.
+The script reads a BibTeX file. It checks whether the entries have
+mrnumbers. If not, it tries to find the numbers from Internet sites. The
+result is a BibTeX file with C<mrnumber=...> fields added.
The name of the output file is either set by the B<-o> option or
is derived by adding the suffix C<_mr> to the output file.
+See the C<bibdoiadd> script for more details on the processing.
+
=head1 AUTHOR
Boris Veytsman
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2014-2022 Boris Veytsman
+Copyright (C) 2014-2024 Boris Veytsman
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
@@ -91,7 +92,7 @@ $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
my $USAGE="USAGE: $0 [-d] [-e 1|0] [-f] [-o output] file\n";
my $VERSION = <<END;
-bibmradd v2.2
+bibmradd v2.3
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
http://www.gnu.org/licenses/gpl.html. There is NO WARRANTY, to the
@@ -220,4 +221,3 @@ sub GetMr {
}
}
-
diff --git a/support/crossrefware/bibzbladd.1 b/support/crossrefware/bibzbladd.1
index 755536c73b..ce4240144e 100644
--- a/support/crossrefware/bibzbladd.1
+++ b/support/crossrefware/bibzbladd.1
@@ -55,7 +55,7 @@
.\" ========================================================================
.\"
.IX Title "bibzbladd 1"
-.TH bibzbladd 1 2023-08-20 "" "LATEX CROSSREFWARE"
+.TH bibzbladd 1 2024-09-02 "" "LATEX CROSSREFWARE"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -85,18 +85,19 @@ output file is formed by adding \f(CW\*(C`_zbl\*(C'\fR to the input file
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The script reads a BibTeX file. It checks whether the entries have
-Zbls. If not, tries to contact internet to get the numbers. The
-result is a BibTeX file with the fields
-\&\f(CW\*(C`zblnumber=...\*(C'\fR added.
+Zbls. If not, it tries to find the numbers from Internet sites. The
+result is a BibTeX file with \f(CW\*(C`zblnumber=...\*(C'\fR fields added.
.PP
The name of the output file is either set by the \fB\-o\fR option or
is derived by adding the suffix \f(CW\*(C`_zbl\*(C'\fR to the output file.
+.PP
+See the \f(CW\*(C`bibdoiadd\*(C'\fR script for more details on the processing.
.SH AUTHOR
.IX Header "AUTHOR"
Boris Veytsman
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
-Copyright (C) 2014\-2021 Boris Veytsman
+Copyright (C) 2014\-2024 Boris Veytsman
.PP
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
diff --git a/support/crossrefware/bibzbladd.pl b/support/crossrefware/bibzbladd.pl
index c05a1137f7..549d1cb0db 100755
--- a/support/crossrefware/bibzbladd.pl
+++ b/support/crossrefware/bibzbladd.pl
@@ -24,7 +24,6 @@ If 1 (default), add an empty zblnumber if a zbl cannot be found. This
prevents repeated searches for the same entries if you add new entries
to the file. Calling C<-e 0> suppresses this behavior.
-
=item B<-f>
Force searching for Zbl numbers even if the entry already has one.
@@ -39,20 +38,21 @@ output file is formed by adding C<_zbl> to the input file
=head1 DESCRIPTION
The script reads a BibTeX file. It checks whether the entries have
-Zbls. If not, tries to contact internet to get the numbers. The
-result is a BibTeX file with the fields
-C<zblnumber=...> added.
+Zbls. If not, it tries to find the numbers from Internet sites. The
+result is a BibTeX file with C<zblnumber=...> fields added.
The name of the output file is either set by the B<-o> option or
is derived by adding the suffix C<_zbl> to the output file.
+See the C<bibdoiadd> script for more details on the processing.
+
=head1 AUTHOR
Boris Veytsman
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2014-2021 Boris Veytsman
+Copyright (C) 2014-2024 Boris Veytsman
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
@@ -78,7 +78,7 @@ $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
my $USAGE="USAGE: $0 [-d] [-e 1|0] [-f] [-o output] file\n";
my $VERSION = <<END;
-bibzbladd v2.2
+bibzbladd v2.3
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
http://www.gnu.org/licenses/gpl.html. There is NO WARRANTY, to the
@@ -202,4 +202,3 @@ sub GetZbl {
}
}
-
diff --git a/support/crossrefware/crossrefware.pdf b/support/crossrefware/crossrefware.pdf
index 83b8d3e8a3..18c39074d5 100644
--- a/support/crossrefware/crossrefware.pdf
+++ b/support/crossrefware/crossrefware.pdf
Binary files differ
diff --git a/support/crossrefware/head.ltx b/support/crossrefware/head.ltx
index 72ae89028e..21d2b2d9bb 100644
--- a/support/crossrefware/head.ltx
+++ b/support/crossrefware/head.ltx
@@ -30,13 +30,15 @@ upload the submission, just outputs XML.
This \path{.rpi} file is a plain text representation of the metadata for
one article. It is written by the \path{resphilosophica} package
-(\url{https://ctan.org/pkg/resphilosophica}). It can also be created by
-hand.
+(\url{https://ctan.org/pkg/resphilosophica}) and the TUGboat publication
+procedure (\url{https://tug.org/TUGboat/repository.html}). It can also
+be created by hand.
Several scripts, \path{bibdoiadd}, \path{bibmradd} and \path{bibzbladd}
take a \path{bib} file, and add to each entry a DOI, MR or ZBL number
correspondingly, if they can find this entry in the corresponding
-database.
+database. The output of these scripts reformats the BibTeX entries
+where the respective fields were not already present.
The \path{bbl2bib} script tries to reconstruct a \path{bib} file from the
corresponding \path{thebibliography} environment. One can argue that
@@ -44,7 +46,10 @@ this operation is akin to reconstructing the cow from a steak. The
way the script does it is by searching for the entry in the MR database,
and creating the corresponding Bib\TeX\ fields.
-I am grateful to Josko Plazonic from Princeton Math Dept whose
-(unpublished) Python script was an inspiration for this suite.
+I am grateful to Josko Plazonic from the Princeton mathematics
+department whose (unpublished) Python script was an inspiration for this
+suite.
-Following are manual pages for these scripts.
+Following are manual pages for these scripts. See also the
+\texttt{BibTeX::Parser} package
+(\url{https://ctan.org/pkg/bibtexperllibs}).
diff --git a/support/crossrefware/ltx2crossrefxml.1 b/support/crossrefware/ltx2crossrefxml.1
index 9f6800d8b7..5c9fc681e2 100644
--- a/support/crossrefware/ltx2crossrefxml.1
+++ b/support/crossrefware/ltx2crossrefxml.1
@@ -55,7 +55,7 @@
.\" ========================================================================
.\"
.IX Title "ltx2crossrefxml 1"
-.TH ltx2crossrefxml 1 2024-02-03 "" "LATEX CROSSREFWARE"
+.TH ltx2crossrefxml 1 2024-09-02 "" "LATEX CROSSREFWARE"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -91,8 +91,10 @@ ignored, and \fIlatex_file\fR itself is not read (and need not even exist).
Each \f(CW\*(C`.rpi\*(C'\fR file specifies the metadata for a single article to be
uploaded to Crossref (a \f(CW\*(C`journal_article\*(C'\fR element in their schema); an
example is below. These files are output by the \f(CW\*(C`resphilosophica\*(C'\fR
-package (<https://ctan.org/pkg/resphilosophica>), but (as always) can
-also be created by hand or by whatever other method you implement.
+package (<https://ctan.org/pkg/resphilosophica>) and the TUGboat
+publication procedure (<https://tug.org/TUGboat/repository.html>), but
+(as always) can also be created by hand or by whatever other method you
+implement.
.PP
Any \f(CW\*(C`.bbl\*(C'\fR files present are used for the citation information in the
output XML. See the CITATIONS section below.
@@ -102,18 +104,25 @@ citations), standard TeX control sequences are replaced with plain text
or UTF\-8 or eliminated, as appropriate. The \f(CW\*(C`LaTeX::ToUnicode::convert\*(C'\fR
routine is used for this (<https://ctan.org/pkg/bibtexperllibs>).
Tricky TeX control sequences will almost surely not be handled
-correctly. If \f(CW\*(C`\-\-rpi\-is\-xml\*(C'\fR is given, the author and title strings
-from the rpi files are output as-is, assuming they are valid XML; no
-checking is done. Citation text from \f(CW\*(C`.bbl\*(C'\fR files is always converted
-from LaTeX to plain text.
+correctly.
.PP
-This script just writes an XML file. It's up to you to actually do the
+If \f(CW\*(C`\-\-rpi\-is\-xml\*(C'\fR is given, the author and title strings from the rpi
+files are output as-is, assuming they are valid XML; no checking is
+done.
+.PP
+Citation text from \f(CW\*(C`.bbl\*(C'\fR files is always converted from LaTeX to plain
+text.
+.PP
+This script just writes an XML file. It's up to you to do the
uploading to Crossref; for example, you can use their Java tool
\&\f(CW\*(C`crossref\-upload\-tool.jar\*(C'\fR
(<https://www.crossref.org/education/member\-setup/direct\-deposit\-xml/https\-post>).
-For the definition of their schema, see
-<https://data.crossref.org/reports/help/schema_doc/4.4.2/index.html>
-(this is the schema version currently followed by this script).
+.PP
+For the definition of the Crossref schema currently output by this
+script, see
+<https://data.crossref.org/reports/help/schema_doc/5.3.1/index.html>
+with additional links and information at
+<https://www.crossref.org/documentation/schema\-library/metadata\-deposit\-schema\-5\-3\-1/>.
.SH "CONFIGURATION FILE FORMAT"
.IX Header "CONFIGURATION FILE FORMAT"
The configuration file is read as Perl code. Thus, comment lines
@@ -188,7 +197,8 @@ Any other journal must always specify this.
The \f(CW%authors\fR field is split at \f(CW\*(C`\eand\*(C'\fR (ignoring whitespace before
and after), and output as the \f(CW\*(C`contributors\*(C'\fR element, using
\&\f(CW\*(C`sequence="first"\*(C'\fR for the first listed, \f(CW\*(C`sequence="additional"\*(C'\fR for
-the remainder.
+the remainder. The authors are parsed using \f(CW\*(C`BibTeX::Parser::Author\*(C'\fR
+(<https://ctan.org/pkg/bibtexperllibs>).
.PP
If the \f(CW%publicationType\fR is not specified, it defaults to
\&\f(CW\*(C`full_text\*(C'\fR, since that has historically been the case; \f(CW\*(C`full_text\*(C'\fR
@@ -200,8 +210,7 @@ from the given \f(CW\*(C`journal_article\*(C'\fR element.
Each \f(CW\*(C`.rpi\*(C'\fR must contain information for only one article, but multiple
files can be read in a single run. It would not be difficult to support
multiple articles in a single \f(CW\*(C`.rpi\*(C'\fR file, but it makes debugging and
-error correction easier when each uploaded XML contains a single
-article.
+error correction easier to keep the input to one article per file.
.SS "MORE ABOUT AUTHOR NAMES"
.IX Subsection "MORE ABOUT AUTHOR NAMES"
The three formats for names recognized are (not coincidentally) the same
@@ -220,7 +229,8 @@ separators are not supported, unlike BibTeX.
In short, you may almost always use the first form; you shouldn't if
either there's a Jr part, or the Last part has multiple tokens but
there's no von part. See the \f(CW\*(C`btxdoc\*(C'\fR (``BibTeXing'' by Oren Patashnik)
-document for details.
+document for details. The authors are parsed using
+\&\f(CW\*(C`BibTeX::Parser::Author\*(C'\fR (<https://ctan.org/pkg/bibtexperllibs>).
.PP
In the \f(CW%authors\fR line of a \f(CW\*(C`.rpi\*(C'\fR file, some secondary directives are
recognized, indicated by \f(CW\*(C`|\*(C'\fR characters. Easiest to explain with an
@@ -284,12 +294,17 @@ this same format.
.PP
Feature request: if anyone is interested in figuring out how to generate
structured citations
-(<https://data.crossref.org/reports/help/schema_doc/5.3.1/schema_5_3_1.html#citation>)
-instead of these flat text dumps, that would be great. Except the schema
-seems to support much less than described at
-<https://www.crossref.org/documentation/principles\-practices/best\-practices/bibliographic/>?
-Anyway, the most viable approach is probably to change tugboat.bst to
-output no-op TeX commands like \etubibauthor, \etubibtitle, etc. (a la
+(<https://data.crossref.org/reports/help/schema_doc/5.3.1/common5_3_1_xsd.html#citation>),
+that would be great. The schema does not support many useful fields, so
+we also want to keep the unstructured text output.
+.PP
+Norman Gray's beastie program (<https://heptapod.host/nxg/beastie>)
+supports this, via \f(CW\*(C`beastie extract\-bib.scm \-O crossref $(doc).aux\*(C'\fR,
+as invoked in the TUGboat \f(CW\*(C`Common.mak\*(C'\fR file. Work in progress.
+.PP
+By the way, if for some reason we have to switch away from using
+beastie, the most viable approach is probably to change \f(CW\*(C`tugboat.bst\*(C'\fR
+to output no-op TeX commands like \etubibauthor, \etubibtitle, etc. (a la
biblatex), and use those commands to discern the various crossref field
values. We can't start from the .bib because then we'd have to
reimplement Bib(La)TeX.
diff --git a/support/crossrefware/ltx2crossrefxml.pl b/support/crossrefware/ltx2crossrefxml.pl
index 5d8e16b383..80c7218758 100755
--- a/support/crossrefware/ltx2crossrefxml.pl
+++ b/support/crossrefware/ltx2crossrefxml.pl
@@ -43,8 +43,10 @@ ignored, and I<latex_file> itself is not read (and need not even exist).
Each C<.rpi> file specifies the metadata for a single article to be
uploaded to Crossref (a C<journal_article> element in their schema); an
example is below. These files are output by the C<resphilosophica>
-package (L<https://ctan.org/pkg/resphilosophica>), but (as always) can
-also be created by hand or by whatever other method you implement.
+package (L<https://ctan.org/pkg/resphilosophica>) and the TUGboat
+publication procedure (L<https://tug.org/TUGboat/repository.html>), but
+(as always) can also be created by hand or by whatever other method you
+implement.
Any C<.bbl> files present are used for the citation information in the
output XML. See the L<CITATIONS> section below.
@@ -54,18 +56,25 @@ citations), standard TeX control sequences are replaced with plain text
or UTF-8 or eliminated, as appropriate. The C<LaTeX::ToUnicode::convert>
routine is used for this (L<https://ctan.org/pkg/bibtexperllibs>).
Tricky TeX control sequences will almost surely not be handled
-correctly. If C<--rpi-is-xml> is given, the author and title strings
-from the rpi files are output as-is, assuming they are valid XML; no
-checking is done. Citation text from C<.bbl> files is always converted
-from LaTeX to plain text.
+correctly.
-This script just writes an XML file. It's up to you to actually do the
+If C<--rpi-is-xml> is given, the author and title strings from the rpi
+files are output as-is, assuming they are valid XML; no checking is
+done.
+
+Citation text from C<.bbl> files is always converted from LaTeX to plain
+text.
+
+This script just writes an XML file. It's up to you to do the
uploading to Crossref; for example, you can use their Java tool
C<crossref-upload-tool.jar>
(L<https://www.crossref.org/education/member-setup/direct-deposit-xml/https-post>).
-For the definition of their schema, see
-L<https://data.crossref.org/reports/help/schema_doc/4.4.2/index.html>
-(this is the schema version currently followed by this script).
+
+For the definition of the Crossref schema currently output by this
+script, see
+L<https://data.crossref.org/reports/help/schema_doc/5.3.1/index.html>
+with additional links and information at
+L<https://www.crossref.org/documentation/schema-library/metadata-deposit-schema-5-3-1/>.
=head1 CONFIGURATION FILE FORMAT
@@ -136,7 +145,8 @@ Any other journal must always specify this.
The C<%authors> field is split at C<\and> (ignoring whitespace before
and after), and output as the C<contributors> element, using
C<sequence="first"> for the first listed, C<sequence="additional"> for
-the remainder.
+the remainder. The authors are parsed using C<BibTeX::Parser::Author>
+(L<https://ctan.org/pkg/bibtexperllibs>).
If the C<%publicationType> is not specified, it defaults to
C<full_text>, since that has historically been the case; C<full_text>
@@ -148,8 +158,7 @@ from the given C<journal_article> element.
Each C<.rpi> must contain information for only one article, but multiple
files can be read in a single run. It would not be difficult to support
multiple articles in a single C<.rpi> file, but it makes debugging and
-error correction easier when each uploaded XML contains a single
-article.
+error correction easier to keep the input to one article per file.
=head2 MORE ABOUT AUTHOR NAMES
@@ -167,7 +176,8 @@ separators are not supported, unlike BibTeX.
In short, you may almost always use the first form; you shouldn't if
either there's a Jr part, or the Last part has multiple tokens but
there's no von part. See the C<btxdoc> (``BibTeXing'' by Oren Patashnik)
-document for details.
+document for details. The authors are parsed using
+C<BibTeX::Parser::Author> (L<https://ctan.org/pkg/bibtexperllibs>).
In the C<%authors> line of a C<.rpi> file, some secondary directives are
recognized, indicated by C<|> characters. Easiest to explain with an
@@ -230,12 +240,17 @@ this same format.
Feature request: if anyone is interested in figuring out how to generate
structured citations
-(L<https://data.crossref.org/reports/help/schema_doc/5.3.1/schema_5_3_1.html#citation>)
-instead of these flat text dumps, that would be great. Except the schema
-seems to support much less than described at
-L<https://www.crossref.org/documentation/principles-practices/best-practices/bibliographic/>?
-Anyway, the most viable approach is probably to change tugboat.bst to
-output no-op TeX commands like \tubibauthor, \tubibtitle, etc. (a la
+(L<https://data.crossref.org/reports/help/schema_doc/5.3.1/common5_3_1_xsd.html#citation>),
+that would be great. The schema does not support many useful fields, so
+we also want to keep the unstructured text output.
+
+Norman Gray's beastie program (L<https://heptapod.host/nxg/beastie>)
+supports this, via C<beastie extract-bib.scm -O crossref $(doc).aux>,
+as invoked in the TUGboat C<Common.mak> file. Work in progress.
+
+By the way, if for some reason we have to switch away from using
+beastie, the most viable approach is probably to change C<tugboat.bst>
+to output no-op TeX commands like \tubibauthor, \tubibtitle, etc. (a la
biblatex), and use those commands to discern the various crossref field
values. We can't start from the .bib because then we'd have to
reimplement Bib(La)TeX.
@@ -273,7 +288,7 @@ extent permitted by law.
# find files relative to our installed location within TeX Live
chomp(my $TLMaster = `kpsewhich -var-value=TEXMFROOT`); # TL root
if (length($TLMaster)) {
- unshift @INC, "$TLMaster/texmf-dist/scripts/bibtexperllibs";
+ unshift @INC, "$TLMaster/texmf-dist/scripts/bibtexperllibs";
}
# find development bibtexperllibs in sibling checkout to this script,
# even if $0 is a symlink. All irrelevant when using from an installation.
@@ -292,15 +307,17 @@ extent permitted by law.
my $USAGE = <<END;
Usage: $0 [-c CONFIG] [-o OUTPUT] [--rpi-is-xml] LTXFILE...
-Convert .rpi and (if any are present) .bbl files corresponding to each
-LTXFILE to xml, for submitting to crossref.org. The LTXFILE is not read
-(and need not even exist); any extension it has is replaced by .rpi and
-.bbl.
+Convert .rpi and (if any are present) .bbl and .crbib files
+corresponding to each LTXFILE to xml, for submitting to crossref.org.
+The LTXFILE is not read, and need not even exist; any extension given is
+replaced by .rpi, .bbl, .crbib.
The .rpi files are plain text, with values on lines beginning with %, as
output by (for example) the resphilosophica LaTeX package. The .bbl
-files are as output by BibTeX. Both are also commonly created by hand.
-The documentation for this script has examples.
+files are as output by BibTeX. The .crbib files are xml files ready for
+incorporation in the final xml, as output by the beastie program. All
+may also be created by other methods. The documentation for this script
+has examples.
The xml is written to standard output by default; the -o (--output)
option overrides this.
@@ -314,6 +331,8 @@ For an example of using this script and associatd code, see the TUGboat
processing at
https://github.com/TeXUsersGroup/tugboat/tree/trunk/capsules/crossref.
+This script depends on https://github.com/borisveytsman/bibtexperllibs.
+
Development sources, bug tracker: https://github.com/borisveytsman/crossrefware
Releases: https://ctan.org/pkg/crossrefware
END
@@ -343,6 +362,7 @@ END
use utf8;
binmode(STDOUT, ":utf8");
+
################################################################
# Defaults and parameters
################################################################
@@ -365,7 +385,7 @@ END
our $timestamp = strftime("%Y%m%d%H%M%S", gmtime);
# use timestamp in batchid, since the value is supposed to be unique
# for every submission to crossref by a given publisher.
- # https://data.crossref.org/reports/help/schema_doc/4.4.2/schema_4_4_2.html#doi_batch_id
+ # https://data.crossref.org/reports/help/schema_doc/5.3.1/common5_3_1_xsd.html#doi_batch_id
our $batchId="ltx2crossref-$timestamp-$$";
if ($opts{c}) {
@@ -373,9 +393,9 @@ END
# if config arg is absolute, fine; if not, prepend "./" as slightly
# less troublesome than putting "." in the @INC path.
my $rel = (File::Spec->file_name_is_absolute($opts{c}) ? "" : "./");
- require "$rel$opts{c}";
+ require "$rel$opts{c}";
} else {
- die "Cannot read config file $opts{c}. Goodbye.";
+ die "Cannot read config file $opts{c}. Goodbye.";
}
}
@@ -386,30 +406,32 @@ END
#
my %papers;
+ # Read the papers.
foreach my $file (@ARGV) {
AddPaper($file);
}
+ # Write the papers.
foreach my $year (keys %papers) {
foreach my $volume (keys %{$papers{$year}}) {
- foreach my $issue (keys %{$papers{$year}->{$volume}}) {
- PrintIssueHead($year, $volume, $issue);
- my $paperList = $papers{$year}->{$volume}->{$issue};
+ foreach my $issue (keys %{$papers{$year}->{$volume}}) {
+ PrintIssueHead($year, $volume, $issue);
+ my $paperList = $papers{$year}->{$volume}->{$issue};
#warn "papers for year=$year, volume=$volume, issue=$issue\n";
# Nice to have the issue.xml in some stable order, so sort
# by starting page. Doesn't matter if it's not perfect.
- foreach my $paper (sort { $a->{startpage} <=> $b->{startpage} }
- @{$paperList}) {
- PrintPaper($paper);
- }
- }
+ foreach my $paper (sort { $a->{startpage} <=> $b->{startpage} }
+ @{$paperList}) {
+ PrintPaper($paper);
+ }
+ }
}
}
PrintTail();
exit($ERROR_COUNT);
-
+
#####################################################
# Printing the head and the tail
#####################################################
@@ -422,12 +444,10 @@ sub PrintHead {
? "\n$indent<abbrev_title>$abbrevTitle</abbrev_title>"
: "";
- # as of schema version 4.3.4, crossref renamed the <name> element
- # inside <depositor> to <depositor_name>. Sigh. Something to take
- # into account with older schemas.
- # https://www.crossref.org/education/content-registration/crossrefs-metadata-deposit-schema/schema-versions/
+ # Crossref schema info:
+ # https://www.crossref.org/documentation/schema-library/schema-versions/
print OUT <<END;
-<doi_batch xmlns="http://www.crossref.org/schema/4.4.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.4.2" xsi:schemaLocation="http://www.crossref.org/schema/4.4.2 http://www.crossref.org/schema/deposit/crossref4.4.2.xsd">
+<doi_batch xmlns="http://www.crossref.org/schema/5.3.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="5.3.1" xsi:schemaLocation="http://www.crossref.org/schema/5.3.1 http://www.crossref.org/schema/deposit/crossref5.3.1.xsd">
<head>
<doi_batch_id>$batchId</doi_batch_id>
<timestamp>$timestamp</timestamp>
@@ -440,7 +460,7 @@ sub PrintHead {
<body><journal>
<journal_metadata language="en">
<full_title>$fullTitle</full_title>$abbrev_title_out
- <issn>$issn</issn>$coden_out
+ <issn>$issn</issn>$coden_out
</journal_metadata>
END
}
@@ -454,20 +474,20 @@ END
return;
}
-
+
#######################################################
-# Adding one paper from $file.rpi and .bbl to global %papers.
+# Adding one paper from $file.rpi and .bbl and .crbib to global %papers.
#######################################################
sub AddPaper {
my $file = shift;
my ($name,$path,$suffix) = fileparse($file, '\.[^\.]*$');
my $rpifile = File::Spec->catfile($path, "$name.rpi");
open (RPI, $rpifile)
- or die "open($rpifile) failed: $! (did you process $file?)\n";
+ or die "$0: open($rpifile) failed: $! (did you process $file?)\n";
my %data;
#warn "reading rpi file: $rpifile\n";
while (<RPI>) {
- chomp;
+ chomp;
if (/^%([^=]*)\s*=\s*(.*)\s*$/) {
if (exists $data{$1}) {
warn "$rpifile:$.: already saw data{$1}=$data{$1};"
@@ -479,12 +499,15 @@ sub AddPaper {
}
close RPI;
- # look for bibliographies in both the .rpi and any .bbl file.
+ # also look for bibliographies in FILE.bbl and FILE.crbib files.
my @bibliography;
- foreach my $bibfile ($file, File::Spec->catfile($path, "$name.bbl")) {
- @bibliography = (@bibliography, AddBibliography($bibfile));
+ foreach my $bblfile ($rpifile, File::Spec->catfile($path, "$name.bbl")) {
+ push (@bibliography, AddBibliography($bblfile));
}
$data{'bibliography'} = \@bibliography;
+ #
+ $data{'crbib'}
+ = AddCrossrefBib (File::Spec->catfile($path, "$name.crbib"));
# Die if the fields we use unconditionally are empty. Not all of
# them are required by the schema, but we can wait to generalize.
@@ -500,13 +523,15 @@ sub AddPaper {
push @{$papers{$data{year}}->{$data{volume}}->{$data{issue}}}, \%data;
}
+
##############################################################
-# Reading a list of papers from BIBFILE and adding it to the
+# Read a list of references from BIBFILE and adding it to the
# bibliography. Each item is assumed to start with
# \bibitem{KEY} and the whole bib to end with \end{thebibliography}.
#
# We return a list of hashes, each hash with a single key, the citation
-# key, and its value a flat string of the entry.
+# key with an integer (starting at 1), and its value a flat string of
+# the entry.
#
# No conversion of the text is done here.
##############################################################
@@ -515,59 +540,59 @@ sub AddBibliography {
open (BIB, $bibfile) or return;
my $insidebibliography = 0;
- my $currpaper = ""; # that is, the current bib entry
+ my $currpaper = ""; # the current bib entry
my $bibno = 0;
my @result;
my $key;
while (<BIB>) {
- chomp;
- next if /^\s*%/; # TeX comment line
- s/[ \t]%.*//; # remove TeX comment
- #
- # allow empty \bibitem key for the sake of handwritten bbls.
- # Similarly, might be more stuff on the line when handwritten.
- # Ignore a TeX %comment following.
- if (s/^\s*\\bibitem(?:\[.*?\])?+\s*\{(.*?)\}\s*(%.*$)?//) {
- my $newkey = $1;
- if ($insidebibliography) {
- if ($currpaper) {
+ chomp;
+ next if /^\s*%/; # TeX comment line
+ s/[ \t]%.*//; # remove TeX comment
+ #
+ # allow empty \bibitem key for the sake of handwritten bbls.
+ # Similarly, might be more stuff on the line when handwritten.
+ # Ignore a TeX %comment following.
+ if (s/^\s*\\bibitem(?:\[.*?\])?+\s*\{(.*?)\}\s*(%.*$)?//) {
+ my $newkey = $1;
+ if ($insidebibliography) {
+ if ($currpaper) {
# Append the current sequence number for this citation,
# since that's what Crossref recommends (sort of).
# For prettiness, if the key is otherwise empty,
# don't include a dash beforehand.
- $bibno++;
+ $bibno++;
$key .= ($key ? "-" : "") . $bibno;
#
my %paperhash;
- $paperhash{$key} = $currpaper;
- push @result, \%paperhash;
- }
- }
- # The citation key (required by schema) starts as the bibitem key.
- $key = $newkey;
-
- $currpaper = $_;
- $insidebibliography = 1;
- next;
- }
- if (/^\s*\\end\{thebibliography\}/) {
- if ($currpaper) {
- $bibno++;
+ $paperhash{$key} = $currpaper;
+ push @result, \%paperhash;
+ }
+ }
+ # The citation key (required by schema) starts as the bibitem key.
+ $key = $newkey;
+
+ $currpaper = $_;
+ $insidebibliography = 1;
+ next;
+ }
+ if (/^\s*\\end\{thebibliography\}/) {
+ if ($currpaper) {
+ $bibno++;
$key .= ($key ? "-" : "") . $bibno;
#
- my %paperhash;
- $paperhash{$key} = $currpaper;
- push @result, \%paperhash;
- }
- $currpaper = "";
- $insidebibliography = 0;
- next;
- }
- if ($insidebibliography) {
- $currpaper .= " $_";
- }
+ my %paperhash;
+ $paperhash{$key} = $currpaper;
+ push @result, \%paperhash;
+ }
+ $currpaper = "";
+ $insidebibliography = 0;
+ next;
+ }
+ if ($insidebibliography) {
+ $currpaper .= " $_";
+ }
}
- close BIB;
+ close BIB or warn "close($bibfile) failed: $!";
# We look in the .rpi files too, which will generally have none.
if (@result == 0 && $bibfile =~ /\.bbl$/) {
@@ -580,6 +605,75 @@ sub AddBibliography {
return @result;
}
+
+##############################################################
+# Read an XML <citation_list> element from CRBIBFILE, if it exists.
+# No error if it doesn't exist; it often won't, even if there is a bbl file.
+#
+# Return a hash reference, with each element's key being the citation
+# key plus an integer, the same keys as in AddBibliography from the .bbl
+# file.# Each value is a flat string, the structured citation items for
+# that element.
+#
+# We ignore any <unstructured_citation> element, since we generate our
+# own (which we prefer).
+#
+# We don't parse XML, just extract the pieces with regexps.
+# This is generated by Norman Gray's beastie program. Example:
+# <citation_list>
+# <citation key="bookshelf">
+# <author>Peter Flynn</author>
+# <volume_title>The bookshelf package</volume_title>
+# <cYear>2020</cYear>
+# <unstructured_citation>Flynn, Peter (manual): The bookshelf package[...]
+# </citation>
+# <citation key="Calibre">
+# <author>Kovid Goyal</author>
+# <volume_title>calibre User Manual</volume_title>
+# <cYear>2024</cYear>
+# <unstructured_citation>Kovid Goyal (manual): calibre User Manual[...]
+# </citation>
+# </citation_list>
+##############################################################
+sub AddCrossrefBib {
+ my ($crbibfile,$refs) = @_;
+ my %result;
+
+ #warn "crbibfile=$crbibfile\n";
+ open (CRBIB, $crbibfile) or return;
+
+ # read whole file.
+ my $crbib_as_string = join("", <CRBIB>);
+ #warn "doing crbib $crbibfile; $crbib_as_string\n";
+ close (CRBIB) or warn "close($crbibfile) failed: $!";
+
+ my $bibno = 0;
+
+ # We're matching each <citation> here by virtue of .*? to be a
+ # non-greedy match, the /s modifier to treat the whole thing as one
+ # string, and the /g modifier to return an array of all matches.
+ my @crbib = ($crbib_as_string =~ m,<citation\s+(key=.*?)</citation>,sg);
+ for my $crb (@crbib) {
+ $bibno++;
+
+ # wipe out the unstructured text.
+ $crb =~ s,\s*<unstructured_citation>.*</unstructured_citation>\s*,,;
+
+ $crb = SanitizeTextNoEntities($crb);
+
+ # qqq undone - must save by key, then write by key into the xml.
+ # need to be able to clean the text, beastie removes braces.
+ warn "crb $bibno: $crb\n";
+ }
+
+ if ($bibno == 0) {
+ warn "$0: *** no crossref cites found in: $crbibfile; check if ok\n";
+ }
+
+ return %result;
+}
+
+
#################################################################
# Printing information about one issue
#################################################################
@@ -596,8 +690,9 @@ sub PrintIssueHead {
END
}
+
###############################################################
-# Printing information about one paper
+# Printing information about one paper
###############################################################
sub PrintPaper {
my $paper = shift;
@@ -617,7 +712,7 @@ END
my @authors = split /\s*\\and\s*/, $paper->{authors};
my $seq = 'first';
foreach my $author (@authors) {
- PrintAuthor($author, $seq);
+ PrintAuthor($author, $seq);
$seq = 'additional';
}
@@ -638,15 +733,7 @@ END
END
if (scalar(@{$paper->{bibliography}})) {
- print OUT <<END;
- <citation_list>
-END
- foreach my $citation (@{$paper->{bibliography}}) {
- PrintCitation($citation);
- }
- print OUT <<END;
- </citation_list>
-END
+ PrintCitationList($paper->{bibliography}, $paper->{crbib});
}
print OUT <<END;
@@ -654,16 +741,15 @@ END
END
}
-
+
###############################################################
# Crossref <title> strings can contain a few so-called "face" HTML
# commands. Complain if they have anything anything else.
-# schema doc: https://data.crossref.org/reports/help/schema_doc/4.4.2/schema_4_4_2.html#title
-# face doc: https://www.crossref.org/education/content-registration/crossrefs-metadata-deposit-schema/face-markup/
-# mathml doc: https://www.crossref.org/education/content-registration/crossrefs-metadata-deposit-schema/including-mathml-in-deposits/
+# schema doc: https://data.crossref.org/reports/help/schema_doc/5.3.1/crossref5_3_1_xsd.html#title
+# face doc: https://www.crossref.org/documentation/schema-library/markup-guide-metadata-segments/face-markup/
#
# We don't technically validate the string, e.g., mismatched tags will
-# go unnoticed here. The real validator at Crossref will catch whatever.
+# go unnoticed here. The real validator at Crossref should catch everything.
###############################################################
sub TitleCheck {
my $title = shift;
@@ -686,33 +772,7 @@ sub TitleCheck {
}
}
-###############################################################
-# Simplistic TeX-to-html
-# (no-op for rpi text if --input-is-xml was given).
-###############################################################
-sub SanitizeText {
- my $string = shift;
- return $string if $opts{xi}; # do nothing if --rpi-is-xml
- return SanitizeTextAlways($string);
-}
-
-# Split into two functions so we can sanitize bbl but not rpi.
-sub SanitizeTextAlways {
- my $string = shift;
-
- # pass user hook subroutine if defined.
- my @hook = (defined(&{"LaTeX_ToUnicode_convert_hook"}))
- ? ("hook" => \&LaTeX_ToUnicode_convert_hook)
- : ();
-
- # conversion of accented control sequences to characters, etc.
- # Let's use &#uuuu; entities instead of literal UTF-8; Crossref
- # recommends it, and it's easier for postprocessing.
- $string = LaTeX::ToUnicode::convert($string, entities => 1, @hook);
-
- return $string;
-}
-
+
################################################################
# Printing one author in arg ORIG_AUTHOR, in sequence SEQ.
################################################################
@@ -809,27 +869,45 @@ END
END
}
+
#############################################################
-# Printing citations
+# Print citations in order from BIBLIOGRAPHY, a list reference, and
+# CRBIB, a hash reference. Each element in BIBLIOGRAPHY is a
+# one-element hash, with the key being the citation key and the value
+# the (original) bbl text. We sanitize (de-texify) the text.
+# Each element in CRBIB has key the citation key (from the same set)
+# and value the structured citation string from any .crbib file.
+#
#############################################################
-sub PrintCitation {
- my $paperhash=shift;
-
- foreach my $key (keys (%{$paperhash})) {
- my $citation = $paperhash->{$key};
- $citation = SanitizeTextAlways($citation);
-
- print OUT <<END;
- <citation key="$key"><unstructured_citation>
- $citation
- </unstructured_citation></citation>
+sub PrintCitationList {
+ my ($bibliography,$crbib) = shift;
+
+ print OUT " <citation_list>\n";
+ foreach my $citation_hash (@$bibliography) {
+ foreach my $citekey (keys (%{$citation_hash})) { # only one key
+ my $citation_text = $citation_hash->{$citekey};
+ $citation_text = SanitizeTextAlways($citation_text);
+
+ #warn " printing citation $citekey: $citation_text\n";
+ my $structured_citation = "";
+ if ($crbib->{$citekey}) {
+ $structured_citation = "\n" . " "x10 . $crbib->{$citekey};
+ warn " with structured citation: $structured_citation\n";
+ }
+ print OUT <<END;
+ <citation key="$citekey">$structured_citation
+ <unstructured_citation>$citation_text</unstructured_citation>
+ </citation>
END
+ }
}
+ print OUT " </citation_list>\n";
}
+
##############################################################
# Return publication_type attribute for <journal_article>, given $PUBTYPE.
-# https://data.crossref.org/reports/help/schema_doc/4.4.2/schema_4_4_2.html#publication_type.atts
+# https://data.crossref.org/reports/help/schema_doc/5.3.1/crossref5_3_1_xsd.html#publication_type.atts_publication_type
#
# If not specified in input, return " publication_type=full_text" since
# it was hardwired that way before. If set to "omit", return empty
@@ -862,11 +940,11 @@ sub GetURL {
my $result;
if ($paper->{paperUrl}) {
- $result = $paper->{paperUrl}
+ $result = $paper->{paperUrl}
} elsif ($paper->{doi} =~ m,^10\.11612/resphil,) {
- my $doi = $paper->{doi};
- $result = 'http://www.pdcnet.org/oom/service?url_ver=Z39.88-2004&rft_val_fmt=&rft.imuse_synonym=resphilosophica&rft.DOI='.$doi.'&svc_id=info:www.pdcnet.org/collection';
+ my $doi = $paper->{doi};
+ $result = 'http://www.pdcnet.org/oom/service?url_ver=Z39.88-2004&rft_val_fmt=&rft.imuse_synonym=resphilosophica&rft.DOI='.$doi.'&svc_id=info:www.pdcnet.org/collection';
} else {
die ("$0: paperUrl field is required\n "
@@ -877,7 +955,41 @@ sub GetURL {
return $result;
}
+
+###############################################################
+# Simplistic TeX-to-html
+# (no-op for rpi text if --input-is-xml was given).
+###############################################################
+sub SanitizeText {
+ my $string = shift;
+ return $string if $opts{xi}; # do nothing if --rpi-is-xml
+ return SanitizeTextEntities($string);
+}
+
+# Conversion of accented control sequences to characters, etc.
+# This uses &#uuuu; entities instead of literal UTF-8; Crossref
+# recommends it, and it's easier for postprocessing.
+#
+sub SanitizeTextEntities {
+ my $string = shift;
+ return SanitizeTextNoEntities($string, entities => 1, @_);
+}
+
+# Generic sanitize text.
+sub SanitizeTextNoEntities {
+ my $string = shift;
+
+ # pass user hook subroutine if defined.
+ my @hook = (defined(&{"LaTeX_ToUnicode_convert_hook"}))
+ ? ("hook" => \&LaTeX_ToUnicode_convert_hook)
+ : ();
+
+ $string = LaTeX::ToUnicode::convert($string, @hook, @_);
+
+ return $string;
+}
+
##############################################################
# debug_hash_as_string($LABEL, HASH)
#
diff --git a/support/digestif/INSTALL.md b/support/digestif/INSTALL.md
index f99f4b286a..ff4ac037e0 100644
--- a/support/digestif/INSTALL.md
+++ b/support/digestif/INSTALL.md
@@ -59,12 +59,12 @@ Packaging for a TeX distribution
--------------------------------
For an installation depending only on the `texlua` interpreter from
-LuaTeX (which already includes all other dependencies except cjson),
+LuaTeX (which bundles all dependencies except the optional cjson),
create a zip file containing `digestif/*.lua` and `data/*.tags` (no
subdirectories), place it anywhere kpathsearch will find it and use
the `bin/digestif.texlua` executable script. For instance:
- zip -j digestif.zip digestif/*.lua tags/*.tags
+ zip -j digestif.zip digestif/*.lua data/*.tags
install -Dt $TEXMF/scripts digestif.zip
install bin/digestif.texlua $PREFIX/bin/digestif
diff --git a/support/digestif/LICENSE.md b/support/digestif/LICENSE.md
index 55165a272d..2b19eb74af 100644
--- a/support/digestif/LICENSE.md
+++ b/support/digestif/LICENSE.md
@@ -119,6 +119,20 @@ latex.tags:
Adapted from the LaTeX2e Unofficial Reference Manual, which can be found at
https://latexref.xyz/.
+natbib.sty.tags:
+
+ Copyright 1993-2010 Patrick W Daly
+
+ This file may be distributed and/or modified under the conditions of the
+ LaTeX Project Public License, either version 1.3 of this license or (at
+ your option) any later version. The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+ and version 1.3 or later is part of all distributions of LaTeX version
+ 2005/12/01 or later.
+
+ Adapted from the natbib package documentation, which can be found at
+ https://ctan.org/pkg/natbib
+
pgf.tags:
Copyright 2007-2013 Till Tantau
diff --git a/support/digestif/README.md b/support/digestif/README.md
index a7528020ec..25b4fe4920 100644
--- a/support/digestif/README.md
+++ b/support/digestif/README.md
@@ -2,7 +2,7 @@ Digestif
========
<p align="center">
-<a href="https://app.travis-ci.com/astoff/digestif"><img src="https://app.travis-ci.com/astoff/digestif.svg?branch=main" alt="Build Status"></a>
+<a href="https://github.com/astoff/digestif/actions/workflows/test.yml"><img src="https://github.com/astoff/digestif/actions/workflows/test.yml/badge.svg"></a>
<a href="https://ctan.org/pkg/digestif"><img alt="CTAN" src="https://img.shields.io/ctan/v/digestif?color=blue"></a>
<a href="https://luarocks.org/modules/astoff/digestif"><img alt="LuaRocks" src="https://img.shields.io/luarocks/v/astoff/digestif?color=blue"></a>
</p>
@@ -12,18 +12,20 @@ ConTeXt et caterva. It provides context-sensitive completion,
documentation, code navigation, and related functionality to any text
editor that speaks the LSP protocol.
-<p align="center"><img src="https://raw.githubusercontent.com/astoff/digestif/images/screenshot.gif" alt="Madatory GIF"></p>
-
Features
--------
- Completion for commands, environments, key-value options (for
instance, TikZ options), cross-references and citations.
+ <p align="center"><img src="https://raw.githubusercontent.com/astoff/digestif/images/completion.png"></p>
+
- Popup help messages, including command signature and documentation.
For the best results, make sure you have the [LaTeX reference
manual][latexref] installed as an [info node][info-issues].
+ <p align="center"><img src="https://raw.githubusercontent.com/astoff/digestif/images/help.png"></p>
+
- Find definition and references to labels and citations.
- Document outline.
@@ -37,12 +39,16 @@ Features
- Digestif is fuzzy! For citations, it tries an exact match against
the BibTeX identifier and a fuzzy match against author and title.
- In the GIF above, the user types `groalhom`, which matches
+ In the picture below, the user typed `groalhom`, which matches
**Gro**thendieck's “Sur quelques points d'**al**gébre
**hom**ologique”; selecting this inserts the BibTeX identifier
- `Tohoku`. Similarly, for cross-references, Digestif tries an exact
- match against the label and a fuzzy match against the text around
- the label.
+ `Tohoku`.
+
+ <p align="center"><img src="https://raw.githubusercontent.com/astoff/digestif/images/cite.png"></p>
+
+ Similarly, for cross-references, Digestif tries an exact match
+ against the label and a fuzzy match against the text around the
+ label.
- Support for LaTeX, ConTeXt, plain TeX, DocTeX (`.dtx` files) and
Texinfo.
@@ -112,6 +118,10 @@ To ensure that Digestif is used, add the following to your init file:
See instructions [here](https://github.com/neoclide/coc.nvim/wiki/Language-servers#latex).
+### Sublime Text with the [LSP](https://packagecontrol.io/packages/LSP) package
+
+See instructions [here](https://lsp.sublimetext.io/language_servers/#digestif).
+
### Other editors
It shouldn't be hard to set up other editors to use Digestif. Please
diff --git a/support/digestif/bin/digestif b/support/digestif/bin/digestif
index 818d5b355a..73b51457b4 100755
--- a/support/digestif/bin/digestif
+++ b/support/digestif/bin/digestif
@@ -1,2 +1,5 @@
#!/usr/bin/env lua
+-- Remove relative directories from package path
+package.path = package.path:gsub("%f[^\0;]%.[^;]*", ""):gsub(";+", ";"):gsub("^;", ""):gsub(";$", "")
+package.cpath = package.cpath:gsub("%f[^\0;]%.[^;]*", ""):gsub(";+", ";"):gsub("^;", ""):gsub(";$", "")
require "digestif.langserver".main(arg)
diff --git a/support/digestif/bin/digestif.texlua b/support/digestif/bin/digestif.texlua
index 5f22a17e12..f0f6c9e84f 100755
--- a/support/digestif/bin/digestif.texlua
+++ b/support/digestif/bin/digestif.texlua
@@ -1,4 +1,7 @@
#!/usr/bin/env texlua
+-- Remove relative directories from package path
+package.path = package.path:gsub("%f[^\0;]%.[^;]*", ""):gsub(";+", ";"):gsub("^;", ""):gsub(";$", "")
+package.cpath = package.cpath:gsub("%f[^\0;]%.[^;]*", ""):gsub(";+", ";"):gsub("^;", ""):gsub(";$", "")
-- Use an invalid directory name in order not to allow kpse to search
-- in the current directory.
os.setenv("TEXMFDOTDIR", package.config:find("^\\") and "NUL" or "/dev/null")
diff --git a/support/digestif/data/natbib.sty.tags b/support/digestif/data/natbib.sty.tags
index fc62570636..5cf757d7c6 100644
--- a/support/digestif/data/natbib.sty.tags
+++ b/support/digestif/data/natbib.sty.tags
@@ -1,34 +1,616 @@
+-- Copyright 1993-2010 Patrick W Daly
+-- SPDX-License-Identifier: LPPL-1.3c+
+--
+-- Adapted from the natbib package documentation, which can be found at
+-- https://ctan.org/pkg/natbib
ctan_package = "natbib"
+
+-- 5 Package Options
+options = {
+ round = {
+ summary = "for round parentheses (default)"
+ },
+ square = {
+ summary = "for square brackets"
+ },
+ angle = {
+ summary = "for angle brackets"
+ },
+ semicolon = {
+ summary = "separate multiple citations with semi-colons (default)"
+ },
+ colon = {
+ summary = "same as `semicolon`"
+ },
+ comma = {
+ summary = "use commas as separators"
+ },
+ authoryear = {
+ summary = "for author-year citations (default)"
+ },
+ numbers = {
+ summary = "for numerical citations"
+ },
+ super = {
+ summary = "for superscripted numerical citations"
+ },
+ sort = {
+ summary = "orders multiple citations into the sequence of the list of references"
+ },
+ ["sort&compress"] = {
+ summary = "as `sort` but multiple numerical citations are compressed if possible"
+ },
+ compress = {
+ summary = "compress without sorting"
+ },
+ longnamesfirst = {
+ summary = "makes the first citation of any reference the equivalent of the starred variant"
+ },
+ sectionbib = {
+ "redefines `\\thebibliography` to issue `\\section*` instead of `\\chapter*`"
+ },
+ nonamebreak = {
+ summary = "keeps all the authors' names in a citation on one line"
+ },
+ merge = {
+ summary = "allow the * prefix to the citation key and for merging"
+ },
+ elide = {
+ summary = "elide common elements of merged references"
+ },
+ mcite = {
+ summary = "elide common elements of merged references"
+ }
+}
+
commands = {
- Citealp = "$ref:natbib.sty#/commands/cite",
- Citealt = "$ref:natbib.sty#/commands/cite",
- Citeauthor = "$ref:natbib.sty#/commands/cite",
- Citep = "$ref:natbib.sty#/commands/cite",
- Citet = "$ref:natbib.sty#/commands/cite",
+
+ -- 2.3 Basic Citation Commands
cite = {
action = "cite",
arguments = {
+ {literal = "*", optional = true},
{delimiters = {"[", "]"}, meta = "prenote", optional = true},
{delimiters = {"[", "]"}, meta = "postnote", optional = true},
{list = true, meta = "keys"}
},
- summary = "Refer to a bibliography item."
- },
- citealp = "$ref:natbib.sty#/commands/cite",
- citealt = "$ref:natbib.sty#/commands/cite",
- citeauthor = "$ref:natbib.sty#/commands/cite",
- citeauthoryear = "$ref:natbib.sty#/commands/cite",
- citefullauthor = "$ref:natbib.sty#/commands/cite",
- citename = "$ref:natbib.sty#/commands/cite",
- citenum = "$ref:natbib.sty#/commands/cite",
- citep = "$ref:natbib.sty#/commands/cite",
- citepalias = "$ref:natbib.sty#/commands/cite",
- citestarts = "$ref:natbib.sty#/commands/cite",
+ summary = "Refer to a bibliography item.",
+ details = [[
+```latex
+\cite[prenote][postnote]{key}
+\cite*[prenote][postnote]{key}
+```
+
+`\cite` (without notes) is the same as `\citet` in author-year mode,
+whereas in numerical mode, it is the same as `\citep`. The starred
+version, as well as the one or two optional notes, may also be used.
+This syntax has been retained for compatibility, but is no longer
+encouraged.
+
+* `\cite{jon90}` => Jones et al., (1990)
+* `\cite[]{jon90}` => (Jones et al., 1990)
+* `\cite[chap.~2]{jon90}` => (Jones et al., 1990, chap. 2)
+* `\cite*{jon90}` => Jones, Baker, and Williams, (1990)
+* `\cite*[]{jon90}` => (Jones, Baker, and Williams, 1990)]]
+ },
+
+ citep = {
+ action = "cite",
+ arguments = "$ref:natbib.sty#/commands/cite/arguments",
+ summary = "Refer to a bibliography item in parenthetical form.",
+ details = [[
+```latex
+\citep[prenote][postnote]{key}
+\citep*[prenote][postnote]{key}
+```
+
+Basic command for a parenthetical citation. The starred version prints
+the full author list, and not just the abbreviated one. These macros
+may take one or two optional arguments to add some text before and
+after the citation. Multiple citations may be made by including more
+than one citation key in the \cite command argument.
+
+* `\citep{jon90}` => (Jones et al., 1990)
+* `\citep[chap.~2]{jon90}` => (Jones et al., 1990, chap. 2)
+* `\citep[see][]{jon90}` => (see Jones et al., 1990)
+* `\citep[see][chap.~2]{jon90}` => (see Jones et al., 1990, chap. 2)
+* `\citep*{jon90}` => (Jones, Baker, and Williams, 1990)
+* `\citep{jon90,jam91}` => (Jones et al., 1990; James et al. 1991)
+* `\citep{jon90,jon91}` => (Jones et al., 1990, 1991)
+* `\citep{jon90a,jon90b}` => (Jones et al., 1990a,b)
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text, as shown above.]]
+ },
+
+ citet = {
+ action = "cite",
+ arguments = "$ref:natbib.sty#/commands/cite/arguments",
+ summary = "Refer to a bibliography item in textual form.",
+ details = [[
+```latex
+\citet[prenote][postnote]{key}
+\citet*[prenote][postnote]{key}
+```
+
+Basic command for a textual citation. The starred version prints the
+full author list, and not just the abbreviated one. These macros may
+take one or two optional arguments to add some text before and after
+the citation. Multiple citations may be made by including more than
+one citation key in the \cite command argument.
+
+* `\citet{jon90}` => Jones et al. (1990)
+* `\citet[chap.~2]{jon90}` => Jones et al. (1990, chap. 2)
+* `\citet[see][]{jon90}` => Jones et al. (see 1990)
+* `\citet[see][chap.~2]{jon90}` => Jones et al. (see 1990, chap. 2)
+* `\citet*{jon90}` => Jones, Baker, and Williams (1990)
+* `\citet{jon90,jam91}` => Jones et al. (1990); James et al. (1991)
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text, as shown above.]]
+ },
+
+ -- 2.4 Extended Citation Commands
+
+ citealp = {
+ action = "cite",
+ arguments = "$ref:natbib.sty#/commands/cite/arguments",
+ summary = "Refer to a bibliography item.",
+ details = [[
+```latex
+\citalp[prenote][postnote]{key}
+\citalp*[prenote][postnote]{key}
+```
+
+Alternative from of `\citep` without parentheses. The starred version
+prints the full author list, and not just the abbreviated one. These
+macros may take one or two optional arguments to add some text before
+and after the citation. Multiple citations may be made by including
+more than one citation key in the \cite command argument.
+
+* `\citealp{jon90}` => Jones et al., 1990
+* `\citealp*{jon90}` => Jones, Baker, and Williams, 1990
+* `\citealp{jon90,jam91}` => Jones et al., 1990; James et al. 1991
+* `\citealp[pg.~32]{jon90}` => Jones et al., 1990, pg. 32
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text.]]
+ },
+
+ citealt = {
+ action = "cite",
+ arguments = "$ref:natbib.sty#/commands/cite/arguments",
+ summary = "Refer to a bibliography item.",
+ details = [[
+```latex
+\citealt[prenote][postnote]{key}
+\citealt*[prenote][postnote]{key}
+```
+
+Alternative from of `\citet` without parentheses. The starred version
+prints the full author list, and not just the abbreviated one. These
+macros may take one or two optional arguments to add some text before
+and after the citation. Multiple citations may be made by including
+more than one citation key in the \cite command argument.
+
+* `\citealt{jon90}` => Jones et al. 1990
+* `\citealt*{jon90}` => Jones et al. 1990
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text.]]
+ },
+
+ citenum = {
+ action = "cite",
+ arguments = {{meta = "key"}},
+ summary = "Print the citation number.",
+ details = [[
+```latex
+\citenum{key}
+```
+
+This command prints the citation number, without parentheses, even in
+author-year mode, and without raising it in superscript mode. This is
+intended to be able to refer to citation numbers without
+superscripting them.
+
+`\citenum{jon90}` => 11]]
+ },
+
+ citetext = {
+ arguments = {{meta = "text"}},
+ summary = "Insert text in the current citation parentheses.",
+ details = [[
+```latex
+\citetext{text}
+```
+
+This command allows arbitrary text to be placed in the current
+citation parentheses. This may be used in combination with
+`\citealp`. For example,
+
+* `\citetext{see \citealp{jon90}, or even better \citealp{jam91}}`
+=> (see Jones et al., 1990, or even better James et al., 1991)]]
+ },
+
+ citeauthor = {
+ action = "cite",
+ arguments = "$ref:natbib.sty#/commands/cite/arguments",
+ summary = "Refer to a bibliography item.",
+ details = [[
+```latex
+\citeauthor[prenote][postnote]{key}
+\citeauthor*[prenote][postnote]{key}
+```
+
+Refer to the authors without the year. Mostly useful in author-year
+schemes. The starred version prints the full author list, and not
+just the abbreviated one. These macros may take one or two optional
+arguments to add some text before and after the citation. Multiple
+citations may be made by including more than one citation key in the
+\cite command argument.
+
+* `\citeauthor{jon90}` => Jones et al.
+* `\citeauthor*{jon90}` => Jones, Baker, and Williams
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text.]]
+ },
+
+ citefullauthor = {
+ action = "cite",
+ arguments = "$ref:natbib.sty#/commands/citeyear/arguments",
+ summary = "Refer to a bibliography item.",
+ details = [[
+```latex
+\citefullauthor[prenote][postnote]{key}
+```
+
+Refer to the full list of authors without the year. Mostly useful in
+author-year schemes. This macro is equivalent to `\citeauthor*`:
+
+`\citefullauthor{jon90}` => Jones, Baker, and Williams
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text.]]
+ },
+
+ citeyear = {
+ action = "cite",
+ arguments = {
+ {delimiters = {"[", "]"}, meta = "prenote", optional = true},
+ {delimiters = {"[", "]"}, meta = "postnote", optional = true},
+ {list = true, meta = "key"}
+ },
+ summary = "Refer to a bibliography item.",
+ details = [[
+```latex
+\citeyear[prenote][postnote]{key}
+```
+
+Refer to the year of a citation. Mostly useful in author-year
+schemes.:
+
+`\citeyear{jon90}` => 1990
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text.]]
+ },
+
+ citeyearpar = {
+ action = "cite",
+ arguments = "$ref:natbib.sty#/commands/citeyear/arguments",
+ summary = "Refer to a bibliography item.",
+ details = [[
+```latex
+\citeyearpar[prenote][postnote]{key}
+```
+
+Refer to the year of a citation printed in parentheses. Mostly useful
+in author-year schemes.:
+
+`\citeyearpar{jon90}` => (1990)
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text.]]
+ },
+
+ -- 2.5 Forcing Upper Cased Name
+
+ Citep = {
+ action = "cite",
+ arguments = "$ref:natbib.sty#/commands/cite/arguments",
+ summary = "Refer to a bibliography item in parenthetical form.",
+ details = [[
+```latex
+\Citep[prenote][postnote]{key}
+\Citep*[prenote][postnote]{key}
+```
+
+Like `\citep` with the first letter uppercased. The starred version
+prints the full author list, and not just the abbreviated one. These
+macros may take one or two optional arguments to add some text before
+and after the citation. Multiple citations may be made by including
+more than one citation key in the \cite command argument.
+
+* `\citep{dRob98}` => (della Robbia, 1990)
+* `\Citep{dRob98}` => (Della Robbia, 1990)
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text.]]
+ },
+
+ Citet = {
+ action = "cite",
+ arguments = "$ref:natbib.sty#/commands/cite/arguments",
+ summary = "Refer to a bibliography item in textual form.",
+ details = [[
+```latex
+\Citet[prenote][postnote]{key}
+\Citet*[prenote][postnote]{key}
+```
+
+Like `\citet` with the first letter uppercased. The starred version
+prints the full author list, and not just the abbreviated one. These
+macros may take one or two optional arguments to add some text before
+and after the citation. Multiple citations may be made by including
+more than one citation key in the \cite command argument.
+
+* `\citet{dRob98}` => della Robbia (1998)
+* `\Citet{dRob98}` => Della Robbia (1998)
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text.]]
+ },
+
+ Citealp = {
+ action = "cite",
+ arguments = "$ref:natbib.sty#/commands/cite/arguments",
+ summary = "Refer to a bibliography item.",
+ details = [[
+```latex
+\Citealp[prenote][postnote]{key}
+\Citealp*[prenote][postnote]{key}
+```
+
+Like `\citealp` with the first letter uppercased. The starred version
+prints the full author list, and not just the abbreviated one. These
+macros may take one or two optional arguments to add some text before
+and after the citation. Multiple citations may be made by including
+more than one citation key in the \cite command argument.
+
+* `\citealp{dRob98}` => della Robbia, 1998
+* `\Citealp{dRob98}` => Della Robbia, 1998
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text.]]
+ },
+
+ Citealt = {
+ action = "cite",
+ arguments = "$ref:natbib.sty#/commands/cite/arguments",
+ summary = "Refer to a bibliography item.",
+ details = [[
+```latex
+\Citealt[prenote][postnote]{key}
+\Citealt*[prenote][postnote]{key}
+```
+
+Like `\citealt` with the first letter uppercased. The starred version
+prints the full author list, and not just the abbreviated one. These
+macros may take one or two optional arguments to add some text before
+and after the citation. Multiple citations may be made by including
+more than one citation key in the \cite command argument.
+
+* `\citealt{dRob98}` => della Robbia 1998
+* `\Citealt{dRob98}` => Della Robbia 1998
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text.]]
+ },
+
+ Citeauthor = {
+ action = "cite",
+ arguments = "$ref:natbib.sty#/commands/cite/arguments",
+ summary = "Refer to a bibliography item.",
+ details = [[
+```latex
+\Citeauthor[prenote][postnote]{key}
+\Citeauthor*[prenote][postnote]{key}
+```
+
+Like `\citeauthor` with the first letter uppercased. Mostly useful in
+author-year schemes. The starred version prints the full author list,
+and not just the abbreviated one. These macros may take one or two
+optional arguments to add some text before and after the citation.
+Multiple citations may be made by including more than one citation key
+in the \cite command argument.
+
+* `\citeauthor{dRob98}` => della Robbia
+* `\Citeauthor{dRob98}` => Della Robbia
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text.]]
+ },
+
+ -- 2.6 Citation Aliasing
+
+ defcitealias = {
+ action = "bibitem",
+ arguments = {
+ {meta = "key"},
+ {meta = "replacement"}
+ },
+ summary = "Create an alias to a bibliography item.",
+ details = [[
+```latex
+\defcitealias{key}{replacement}
+```
+
+This command creates a special designation for a reference, i.e. Paper I.
+Such aliases can be defined like this:
+
+`\defcitealias{jon90}{Paper~I}`]]
+ },
+
+ citetalias = {
+ action = "cite",
+ arguments = "$ref:natbib.sty#/commands/citeyear/arguments",
+ summary = "Refer to a bibliography alias in textual form.",
+ details = [[
+```latex
+\citetalias[prenote][postnote]{key}
+
+```
+
+Like `\citet` but for aliases. This macro may take one or two
+optional arguments to add some text before and after the citation.
+Multiple citations may be made by including more than one citation key
+in the \cite command argument.
+
+* `\defcitealias{jon90}{Paper~I}`
+* `\citetalias{jon90}` => Paper I
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text.]]
+ },
+
+ citepalias = {
+ action = "cite",
+ arguments = "$ref:natbib.sty#/commands/cite/arguments",
+ summary = "Refer to a bibliography alias in parenthetical form.",
+ details = [[
+```latex
+\citepalias[prenote][postnote]{key}
+```
+
+Like `\citep` but for aliases. This macro may take one or two
+optional arguments to add some text before and after the citation.
+Multiple citations may be made by including more than one citation key
+in the \cite command argument.
+
+* `\defcitealias{jon90}{Paper~I}`
+* `\citepalias{jon90}` => (Paper I)
+
+Note that a single optional text is a post-note, while two are the pre-
+and post-notes. To have only a pre-note, it is necessary to provide
+an empty post-note text, as shown above.]]
+ },
+
+ -- 2.9 Selecting Citation Punctuation
+
+ setcitestyle = {
+ arguments = {
+ {meta = "citestyle",
+ keys = {
+ authoryear = {
+ summary = "citation mode, corresponds to fourth argument of `\\bibpunct`."
+ },
+ numbers = {
+ summary = "citation mode, corresponds to fourth argument of `\\bibpunct`."
+ },
+ super = {
+ summary = "citation mode, corresponds to fourth argument of `\\bibpunct`."
+ },
+ round = {
+ summary = "braces, corresponds to first and second arguments of `\\bibpunct`"
+ },
+ square = {
+ summary = "braces, corresponds to first and second arguments of `\\bibpunct`"
+ },
+ open = {
+ summary = "braces, corresponds to first and second arguments of `\\bibpunct`"
+ },
+ close = {
+ summary = "braces, corresponds to first and second arguments of `\\bibpunct`"
+ },
+ semicolon = {
+ summary = "between citations, corresponds to third argument of `\\bibpunct`"
+ },
+ comma = {
+ summary = "between citations, corresponds to third argument of `\\bibpunct`"
+ },
+ citesep = {
+ summary = "between citations, corresponds to third argument of `\\bibpunct`"
+ },
+ aysep = {
+ summary = "between years with common author, corresponds to fifth argument of `\\bibpunct`"
+ },
+ yysep = {
+ summary = "between years with common author, corresponds to sixth argument of `\\bibpunct`"
+ },
+ notesep = {
+ summary = "Text before post-note, corresponds to optional argument of `\\bibpunct`"
+ }
+ }
+ }
+ },
+ summary = "Command for setting the citation style.",
+ details = [[
+```latex
+\setcitestyle{key=val}
+```
+
+Command for setting the citation style with key=val pairs.]]
+ },
+
+ bibpunct = {
+ arguments = {
+ {meta = "before postnote",
+ optional = true, delimiters = {"[", "]"}},
+ {meta = "opening bracket"},
+ {meta = "closing bracket"},
+ {meta = "between citations"},
+ {meta = "style"},
+ {meta = "between names&year"},
+ {meta = "between years for suppressed author lists"}
+ },
+ summary = "Older command for setting the citation style.",
+ details = [[
+```latex
+\bibpunct[before-postnote]{open}{close]{between}{style}{author-year}{between-years}
+```
+
+Command for setting the citation style. This command is superseded by
+`\setcitestyle`.]]
+ },
+
+ -- 2.10 Predefining a citation style
citestyle = {arguments = {{meta = "style"}}},
- citet = "$ref:natbib.sty#/commands/cite",
- citetalias = "$ref:natbib.sty#/commands/cite",
- citetext = {arguments = {{meta = "text"}}},
- citeyear = "$ref:natbib.sty#/commands/cite",
- citeyearpar = "$ref:natbib.sty#/commands/cite",
- shortcites = "$ref:natbib.sty#/commands/cite"
+
+ -- 2.18 Long Author List on First Citation
+ shortcites = {
+ action = "cite",
+ arguments = {{meta = "key", list = true,}},
+ summary = "Print short list of authors on first citation.",
+ details = [[
+```latex
+\shortcites{key}
+```
+
+When the package option `longnamesfirst` is given, the full author
+list is printed with the first citation of any reference, and
+afterwards only the abbreviated list. Some references have so many
+authors that you want to suppress the automatic long list only for
+them. In this case, issue
+
+`\shortcites{key}`
+
+before the first citations, and those included in key-list will have a
+short list on their first citation.]]
+ }
}
diff --git a/support/digestif/data/tikz.tags b/support/digestif/data/tikz.tags
index f14f8093f9..2c20853bca 100644
--- a/support/digestif/data/tikz.tags
+++ b/support/digestif/data/tikz.tags
@@ -2103,7 +2103,8 @@ Sections ?? to ??.
documentation = "texmf:doc/generic/pgf/pgfmanual.pdf#pgf.back/usegdlibrary"
},
usetikzlibrary = {
- arguments = {{meta = "list of libraries"}},
+ arguments = {{meta = "list of libraries", list=true}},
+ action="input", filename="tikzlibrary?.code.tex",
details = [[
Once TikZ has been loaded, you can use this command to load further
libraries. The list of libraries should contain the names of libraries
diff --git a/support/digestif/digestif/Cache.lua b/support/digestif/digestif/Cache.lua
index d7e3e16f85..303e6d34b9 100644
--- a/support/digestif/digestif/Cache.lua
+++ b/support/digestif/digestif/Cache.lua
@@ -78,7 +78,7 @@ local search_magic_comment_patt = util.choice(
-- Determine the root path of a document from magic comments.
function Cache:rootname(filename)
- local _, cookie = self(filename) -- warm up
+ local _, cookie = self(filename) -- luacheck: ignore cookie (warm up the cache)
local props = assert(self.store[filename])
local rootname = props.rootname
if rootname == nil then
diff --git a/support/digestif/digestif/Manuscript.lua b/support/digestif/digestif/Manuscript.lua
index d9101d8c07..e358a70b47 100644
--- a/support/digestif/digestif/Manuscript.lua
+++ b/support/digestif/digestif/Manuscript.lua
@@ -1,12 +1,14 @@
-- Manuscript class
+local lfs = require "lfs"
local config = require "digestif.config"
local util = require "digestif.util"
local require_data = require "digestif.data".require
+local ctan_package_of = require "digestif.data".ctan_package_of
local get_info = require "digestif.data".get_info
local resolve_doc_items = require "digestif.data".resolve_doc_items
-local path_join, path_split = util.path_join, util.path_split
+local path_split = util.path_split
local path_normalize = util.path_normalize
local find_file = util.find_file
local format_filename_template = util.format_filename_template
@@ -244,23 +246,23 @@ end
-- Compute the line and column number (both 1-based) at the given
-- position.
---
--- TODO: make len function a parameter
-function Manuscript:line_column_at(pos)
- -- Out ranges are excluside on the right, Lua is inclusive, so we
+-- `length_fun` should be utf8.len or a similar function adapted to
+-- other text encodings.
+function Manuscript:line_column_at(pos, length_fun)
+ -- Our ranges are exclusive on the right, Lua is inclusive, so we
-- may have pos == 1 + #self.src.
pos = min(pos, #self.src)
local l, line_pos = self:line_number_at(pos)
- local c = utf8_len(self.src, line_pos, pos) or error("Invalid UTF-8")
+ local c = length_fun(self.src, line_pos, pos) or error("Invalid offset")
return l, c
end
-- Compute the source position at the given line an column.
---
--- TODO: make offset function a parameter
-function Manuscript:position_at(line, col)
+-- `offset_fun` should be utf8.offset or a similar function adapted to
+-- other text encodings.
+function Manuscript:position_at(line, col, offset_fun)
local line_pos = self.lines[line] or error("Position out of bounds")
- return utf8_offset(self.src, col, line_pos) or error("Position out of bounds")
+ return offset_fun(self.src, col, line_pos) or error("Position out of bounds")
end
@@ -679,7 +681,7 @@ end
-- (of length twice that of args) indicating the positions of each
-- argument within that string.
--
-function Manuscript:signature_args(args, before)
+function Manuscript:signature_args(args, before) -- luacheck: ignore self
if not args then return before or "", {} end
local t, p, pos = {before}, {}, 1 + (before and #before or 0)
for i = 1, #args do
@@ -727,7 +729,7 @@ Manuscript.signature_env = Manuscript.signature_cmd
-- Returns:
-- The formatted snippet, as a string, without the $0 placeholder.
--
-function Manuscript:snippet_args(args, i)
+function Manuscript:snippet_args(args, i) -- luacheck: ignore self
if not args then return "" end
i = i or 1
local t = {}
@@ -809,6 +811,7 @@ end
Manuscript.completion_handlers = {}
+--** Command and environment name completion
function Manuscript.completion_handlers.cs(self, ctx)
local commands, environments = self.commands, self.environments
local extra_snippets = config.extra_snippets
@@ -845,6 +848,28 @@ function Manuscript.completion_handlers.cs(self, ctx)
return ret
end
+function Manuscript.completion_handlers.begin(self, ctx, pos)
+ local environments = self.environments
+ local prefix = self:substring(ctx.pos, pos - 1)
+ local has_prefix = matcher(prefix)
+ local r = {
+ pos = ctx.pos,
+ prefix = prefix,
+ kind = "environment"
+ }
+ for env in pairs(map_keys(has_prefix, environments)) do
+ local cmd = environments[env]
+ r[#r+1] = {
+ text = env,
+ summary = cmd.summary,
+ }
+ end
+ return r
+end
+
+Manuscript.completion_handlers["end"] = Manuscript.completion_handlers.begin
+
+--** Key/value completion
function Manuscript.completion_handlers.key(self, ctx, pos)
local prefix = self:substring(ctx.pos, pos - 1)
local len = #prefix
@@ -887,26 +912,7 @@ function Manuscript.completion_handlers.value(self, ctx, pos)
return r
end
-function Manuscript.completion_handlers.begin(self, ctx, pos)
- local environments = self.environments
- local prefix = self:substring(ctx.pos, pos - 1)
- local has_prefix = matcher(prefix)
- local r = {
- pos = ctx.pos,
- prefix = prefix,
- kind = "environment"
- }
- for env in pairs(map_keys(has_prefix, environments)) do
- local cmd = environments[env]
- r[#r+1] = {
- text = env,
- summary = cmd.summary,
- }
- end
- return r
-end
-
-Manuscript.completion_handlers["end"] = Manuscript.completion_handlers.begin
+--** Cross-reference and citation completion
-- Get a short piece of text around a label. If there is a recognized
-- command ending right before the label, the context starts there.
@@ -990,6 +996,58 @@ function Manuscript.completion_handlers.cite(self, ctx, pos)
return r
end
+--** File name completion
+function Manuscript.completion_handlers.input(self, ctx, pos)
+ local template
+ if ctx.arg then
+ template = nested_get(ctx, "parent", "data", "filename") or "?"
+ elseif ctx.item then
+ template = nested_get(ctx, "parent", "parent", "data", "filename") or "?"
+ else
+ return
+ end
+ local pre, post = template:match("([^?]*)%?(.*)")
+ local i_pre, i_post = #pre + 1, -1 - #post
+ local prefix = self:substring(ctx.pos, pos - 1)
+ local has_prefix = matcher(pre..prefix)
+ local has_suffix = matcher(post)
+ local match = function(s)
+ return has_suffix(s, -#post) and has_prefix(s)
+ end
+ local r = {
+ pos = ctx.pos,
+ prefix = prefix,
+ kind = "file"
+ }
+ -- Candidate from TeX directories. Don't try that if the command
+ -- expects the literal file name.
+ if template ~= "?" then
+ for name, _ in pairs(require "digestif.data".texmf_index) do
+ if match(name) then
+ local pkg = ctan_package_of(name)
+ r[#r+1] = {
+ text = name:sub(i_pre, i_post),
+ summary = pkg and pkg.summary
+ }
+ end
+ end
+ end
+ -- Candidates from current directory
+ local ok, iter, dir_obj = pcall(lfs.dir, ".")
+ if ok then
+ for name in iter, dir_obj do
+ if match(name) and lfs.attributes(name, "mode") == "file" then
+ r[#r+1] = {
+ text = name:sub(i_pre, i_post)
+ }
+ end
+ end
+ end
+ -- Sort candidates
+ table.sort(r, function(a, b) return a.text < b.text end)
+ return r
+end
+
--* Context help
-- Get information about the thing at the given position.
@@ -1102,6 +1160,30 @@ function Manuscript.help_handlers.ref(self, ctx)
}
end
+function Manuscript.help_handlers.input(self, ctx)
+ local name = self:substring(ctx)
+ local template
+ if ctx.arg then
+ template = nested_get(ctx, "parent", "data", "filename") or "?"
+ elseif ctx.item then
+ template = nested_get(ctx, "parent", "parent", "data", "filename") or "?"
+ else
+ return
+ end
+ local pre, post = template:match("([^?]*)%?(.*)")
+ local filename = pre .. name .. post
+ local data = ctan_package_of(filename)
+ if not data then return end
+ local docstring = self:make_docstring("file", filename, data)
+ return {
+ pos = ctx.pos,
+ cont = ctx.cont,
+ kind = "file",
+ summary = data.summary,
+ details = docstring,
+ }
+end
+
function Manuscript.help_handlers.begin(self, ctx)
local env_name = self:substring(ctx)
local data = self.environments[env_name]
@@ -1186,6 +1268,9 @@ function Manuscript:make_docstring_header(kind, name, data)
ret = self:signature_env(name, data.arguments)
elseif kind == "key" and data.meta then
ret = ret .. " = " .. data.meta
+ elseif kind == "file" then
+ local pkg = ctan_package_of(name)
+ ret = pkg and pkg.ctan_package or name
end
if data.summary then
ret = "`" .. ret .. "`: " .. data.summary
@@ -1231,11 +1316,11 @@ local function make_docstring_details(data)
local details = data.details
local doc_field = data.documentation
if details then
- return "# Details\n\n" .. details
+ return "# Details\n\n" .. details .. (details:sub(-1) == "\n" and "" or "\n")
elseif type(doc_field) == "string" and doc_field:match"^info:" then
local str, node, subnode = get_info(doc_field)
if str then
- return format("# Info: (%s)%s\n\n```Info\n%s```", node, subnode, str)
+ return format("# Info: (%s)%s\n\n```Info\n%s```\n", node, subnode, str)
end
else
return
@@ -1243,8 +1328,8 @@ local function make_docstring_details(data)
end
function Manuscript:make_docstring_docs(kind, name, data)
- local item_doc = data.documentation
- local pkg = data.package
+ local item_doc = kind ~= "file" and data.documentation
+ local pkg = kind == "file" and data or data.package
local pkg_doc = pkg and pkg.documentation
local t = {"# Documentation\n"}
if pkg and pkg.ctan_package then
@@ -1253,10 +1338,17 @@ function Manuscript:make_docstring_docs(kind, name, data)
elseif kind == "cs" then
name = self:signature_cmd(name)
end
- t[#t+1] = format(
- "`%s` is defined in the [%s](https://www.ctan.org/pkg/%s) package.\n",
- name, pkg.ctan_package, pkg.ctan_package
- )
+ if kind == "file" then
+ t[#t+1] = format(
+ "`%s` is part of the [%s](https://www.ctan.org/pkg/%s) package.\n",
+ name, pkg.ctan_package, pkg.ctan_package
+ )
+ else
+ t[#t+1] = format(
+ "`%s` is defined in the [%s](https://www.ctan.org/pkg/%s) package.\n",
+ name, pkg.ctan_package, pkg.ctan_package
+ )
+ end
end
if item_doc then
extend(t, resolve_doc_items(item_doc))
diff --git a/support/digestif/digestif/ManuscriptBibTeX.lua b/support/digestif/digestif/ManuscriptBibTeX.lua
index 219f4552b4..659c3d5ec9 100644
--- a/support/digestif/digestif/ManuscriptBibTeX.lua
+++ b/support/digestif/digestif/ManuscriptBibTeX.lua
@@ -1,13 +1,8 @@
-local lpeg = require "lpeg"
local util = require "digestif.util"
local Manuscript = require "digestif.Manuscript"
local Parser = require "digestif.Parser"
local bibtex = require "digestif.bibtex"
-local path_join, path_split = util.path_join, util.path_split
-local nested_get, nested_put = util.nested_get, util.nested_put
-local map, update, merge = util.map, util.update, util.merge
-
local ManuscriptBibtex = util.class(Manuscript)
ManuscriptBibtex.parser = Parser()
diff --git a/support/digestif/digestif/ManuscriptConTeXt.lua b/support/digestif/digestif/ManuscriptConTeXt.lua
index 2243d3a9fc..4ee33b5df4 100644
--- a/support/digestif/digestif/ManuscriptConTeXt.lua
+++ b/support/digestif/digestif/ManuscriptConTeXt.lua
@@ -28,7 +28,7 @@ local function collect(s)
local top = {}
table.insert(stack, top)
local ni,c,label,xarg, empty
- local i, j = 1, 1
+ local i, j = 1, 1 -- luacheck: ignore j
while true do
ni,j,c,label,xarg, empty = string.find(s, "<(%/?)([%w:]+)(.-)(%/?)>", i)
if not ni then break end
@@ -290,7 +290,7 @@ end
local function tags_from_xml(file, pkg)
local ok, str = util.find_file(file, nil, true)
if not ok then return end
- local ok, data = pcall(collect, str)
+ local ok, data = pcall(collect, str) -- luacheck: ignore ok
if not ok then return end
return setmetatable(gen_tags(data), {__index = pkg})
end
diff --git a/support/digestif/digestif/ManuscriptLaTeX.lua b/support/digestif/digestif/ManuscriptLaTeX.lua
index 1366b0e146..22df3e9980 100644
--- a/support/digestif/digestif/ManuscriptLaTeX.lua
+++ b/support/digestif/digestif/ManuscriptLaTeX.lua
@@ -5,8 +5,7 @@ local Parser = require "digestif.Parser"
local path_join, path_split = util.path_join, util.path_split
local path_normalize = util.path_normalize
-local nested_get, nested_put = util.nested_get, util.nested_put
-local map, update, merge = util.map, util.update, util.merge
+local merge = util.merge
local format_filename_template = util.format_filename_template
local ManuscriptLatex = util.class(Manuscript)
@@ -49,7 +48,7 @@ local function first_mand(args)
end
end
-local function first_opt(args)
+local function first_opt(args) -- luacheck: ignore first_opt
for i, v in ipairs(args) do
if v.optional then return i end
end
diff --git a/support/digestif/digestif/Schema.lua b/support/digestif/digestif/Schema.lua
index b59a95157d..0ce26199a5 100644
--- a/support/digestif/digestif/Schema.lua
+++ b/support/digestif/digestif/Schema.lua
@@ -151,7 +151,7 @@ function Schema:assert_fail(obj)
assert(not self:validate(obj))
end
-local schema_of_schema = Schema {
+local schema_of_schema = Schema { -- luacheck: ignore schema_of_schema
fields = {
description = {
type = "string",
diff --git a/support/digestif/digestif/bibtex.lua b/support/digestif/digestif/bibtex.lua
index f1430474e3..277db0d364 100644
--- a/support/digestif/digestif/bibtex.lua
+++ b/support/digestif/digestif/bibtex.lua
@@ -1,10 +1,8 @@
local lpeg = require "lpeg"
local util = require "digestif.util"
-local B, P, R, S, V
- = lpeg.B, lpeg.P, lpeg.R, lpeg.S, lpeg.V
-local C, Cc, Cp, Ct, Cmt, Cg
- = lpeg.C, lpeg.Cc, lpeg.Cp, lpeg.Ct, lpeg.Cmt, lpeg.Cg
+local B, P, R, S = lpeg.B, lpeg.P, lpeg.R, lpeg.S
+local C, Cp, Ct, Cg = lpeg.C, lpeg.Cp, lpeg.Ct, lpeg.Cg
local concat = table.concat
local merge = util.merge
local search, gobble_until, case_fold = util.search, util.gobble_until, util.case_fold
@@ -34,7 +32,6 @@ local rparen = P")" * whitespace
local equals = P"=" * whitespace
local hash = P"#" * whitespace
local comma = P"," * whitespace
-local quote = P'"' * whitespace
local lit_string = C(case_fold "string") * whitespace
local lit_comment = C(case_fold "comment") * whitespace
local lit_preamble = C(case_fold "preamble") * whitespace
@@ -54,7 +51,6 @@ local fields = field * (comma * field)^0
local token = curly_braced_string/0 + char
local nonspace = token - space
local author_sep = space * "and" * space
-local etal_marker = P("et al") * whitespace * P(-1)
-- either curly or round braced
local function braced(patt)
@@ -114,9 +110,7 @@ function bibtex.parse(src, options)
}
for _, t in ipairs(entries) do
local entry_type = t[1]:lower()
- if entry_type == "comment" then
- -- pass
- elseif entry_type == "preamble" then
+ if entry_type == "preamble" then
preambles[#preambles + 1] = t[2]
elseif entry_type == "string" then
for _, u in ipairs_from(t, 2) do
@@ -124,9 +118,9 @@ function bibtex.parse(src, options)
local val = process_value(u, strings)
strings[key] = val
end
- else
+ elseif entry_type ~= "comment" then
local id = t[2]
- local fields = {}
+ local fields = {} -- luacheck: ignore fields
for _, u in ipairs_from(t, 3) do
local key = u[1]:lower()
local val = process_value(u, strings)
@@ -203,7 +197,6 @@ local detexify_symbols = replace(tex_cs_patt, tex_symbols, tex_char_or_math)
local detexify_accents = replace(tex_accent_patt, repl_accents_fun, tex_char_or_math)
local debracify = replace(curly_braced_string, 1, tex_char_or_math)
local detitlify = replace(B(space) * C(tex_letter), string.lower, tex_char_or_math)
-local trim = util.trim(space)
local clean = util.clean(space)
local function deuglify_name (s)
@@ -231,11 +224,11 @@ local split_last = search(Cp() * C(nonspace^1) * whitespace * P(-1))
function BibItem:authors()
local t = {}
- local author = self.fields.author
- if not author then return {} end
- for _, name in ipairs(split_authors(author)) do
+ local authors = self.fields.author
+ if not authors then return {} end
+ for _, author in ipairs(split_authors(authors)) do
local u = {}
- local parts = split_name(name)
+ local parts = split_name(author)
if #parts == 3 then
u.first = parts[3]
u.last = parts[1]
@@ -244,12 +237,12 @@ function BibItem:authors()
u.first = parts[2]
u.last = parts[1]
else
- local p, l = split_last:match(name)
+ local p, l = split_last:match(author)
if p then
- u.first = name:sub(1, p - 1)
+ u.first = author:sub(1, p - 1)
u.last = l
else
- u.last = name
+ u.last = author
end
end
t[#t + 1] = u
@@ -259,8 +252,8 @@ end
function BibItem:pretty_print()
local t, a = {}, {}
- for _, name in ipairs(self:authors()) do
- a[#a + 1] = deuglify_name(name.last)
+ for _, author in ipairs(self:authors()) do
+ a[#a + 1] = deuglify_name(author.last)
end
t[#t + 1] = concat(a, ", ")
t[#t + 1] = (self.fields.year or self.fields.date or "(n.d.)") .. ";"
diff --git a/support/digestif/digestif/config.lua b/support/digestif/digestif/config.lua
index 43b7971094..edad15b317 100644
--- a/support/digestif/digestif/config.lua
+++ b/support/digestif/digestif/config.lua
@@ -3,7 +3,7 @@ local format = string.format
local config = {}
-config.version = "0.5.1"
+config.version = "0.6"
local pre_version = os.getenv("DIGESTIF_PRERELEASE")
if pre_version then
config.version = config.version .. "-" .. pre_version
@@ -142,8 +142,8 @@ end
function config.check_data(dir)
if not dir then
- for _, dir in ipairs(config.data_dirs) do
- if config.check_data(dir) then return true end
+ for _, data_dir in ipairs(config.data_dirs) do
+ if config.check_data(data_dir) then return true end
end
end
local f = io.open(util.path_join(dir, "primitives.tags"))
diff --git a/support/digestif/digestif/data.lua b/support/digestif/digestif/data.lua
index 621048f4a9..c9a094536b 100644
--- a/support/digestif/digestif/data.lua
+++ b/support/digestif/digestif/data.lua
@@ -1,3 +1,4 @@
+local lfs = require "lfs"
local lpeg = require "lpeg"
local util = require "digestif.util"
local config = require "digestif.config"
@@ -9,11 +10,11 @@ local P, C, Cg, Ct = lpeg.P, lpeg.C, lpeg.Cg, lpeg.Ct
local match = lpeg.match
local many, sequence = util.many, util.sequence
local gobble, search = util.gobble, util.search
-local nested_get, extend = util.nested_get, util.extend
+local nested_get = util.nested_get
local find_file = util.find_file
local parse_uri, make_uri = util.parse_uri, util.make_uri
local log = util.log
-local path_split, path_join = util.path_split, util.path_join
+local path_join, path_split = util.path_join, util.path_split
local data = {}
local loaded_tags = {}
@@ -123,51 +124,63 @@ else
if config.verbose then log("TLPDB not found") end
end
-
---* kpathsea emulation
-
--- function kpsewhich(name)
---
--- Like the kpsewhich command, return the full path of tex input file
--- name. We use luatex's kpse bindings if available, and parse the
--- system's ls-R files otherwise.
---
-local kpsewhich
-
-if kpse then -- we're on luatex
-
- local kpse_obj = kpse.new("luatex")
-
- function kpsewhich(name)
- return kpse_obj:find_file(name, "tex")
- end
-
-else -- on plain lua, we look for ls-R files
-
- local texmf_files = {}
- local texmf_dirs = config.texmf_dirs
- local dir_patt = P"./" * C(gobble(":" * P(-1)))
- for i = 1, #texmf_dirs do
- local texmf_dir = texmf_dirs[i]
- local listing_path = find_file(texmf_dir, "ls-R")
- if listing_path then
+data.ctan_package_of = ctan_package_of
+
+--* Indexing of TeX input files
+
+-- Table mapping TeX input file names to the directory where it is
+-- located.
+local texmf_index = {}
+do
+ local dir_patt = C(P"."^-2 * P"/" * gobble(":" * P(-1)))
+ for _, texmf_dir in ipairs(config.texmf_dirs) do
+ local clock = config.verbose and os.clock()
+ local ls_file = io.open(path_join(texmf_dir, "ls-R"))
+ if ls_file then
local current_dir
- for line in io.lines(listing_path) do
- local subdir = match(dir_patt, line)
- if subdir then
- current_dir = path_join(texmf_dir, subdir)
- elseif current_dir and not texmf_files[line] then
- texmf_files[line] = path_join(current_dir, line)
+ for name in ls_file:lines() do
+ if name ~= "" then
+ local subdir = match(dir_patt, name)
+ if subdir then
+ current_dir = path_join(texmf_dir, subdir)
+ elseif current_dir and not texmf_index[name] then
+ texmf_index[name] = current_dir
+ end
end
end
+ ls_file:close()
+ else
+ local function recur(current_dir, max_depth)
+ local ok, iter, dir_obj = pcall(lfs.dir, current_dir)
+ if not ok then return end
+ for name in iter, dir_obj do
+ if name ~= "." and name ~= ".." then
+ local path = path_join(current_dir, name)
+ local mode = lfs.attributes(path, "mode")
+ if mode == "directory" then
+ if max_depth > 0 then
+ recur(path, max_depth - 1)
+ end
+ elseif mode == "file" then
+ if not texmf_index[name] then
+ texmf_index[name] = current_dir
+ end
+ end
+ end
+ end
+ end
+ recur(texmf_dir, 10)
+ end
+ if clock then
+ log(
+ "Scanned %s%s in %0.3f ms",
+ texmf_dir, ls_file and "/ls-R" or "",
+ 1000*(os.clock() - clock)
+ )
end
end
-
- function kpsewhich(name)
- return texmf_files[name]
- end
-
end
+data.texmf_index = texmf_index
--* Generate tags from the user's TeX installation
@@ -213,12 +226,13 @@ local function tags_from_manuscript(script, ctan_data)
end
-- Generate tags from TeX source code (or ConTeXt interface XML file,
--- if applicable). The argument is a file name found by kpsewhich.
+-- if applicable). The argument is TeX input file name.
--
local function generate_tags(name)
- local path = kpsewhich(name)
- path = path and find_file(config.texmf_dirs, path)
- if not path then return end
+ local dir = texmf_index[name]
+ local path = dir and path_join(dir, name)
+ local f = path and io.open(path)
+ if f then f:close() else return end
local texformat = infer_format(path)
if not texformat then return end
if config.verbose then log("Generating tags: %s", path) end
@@ -251,7 +265,7 @@ local parse_ref = util.matcher(
P"$ref:",
C(gobble"#") * P"#",
Ct(many(P"/" * C(gobble"/")))))
-p=parse_ref
+
local function resolve_refs(tbl, seen)
seen = seen or {}
for k, v in pairs(tbl) do
@@ -310,8 +324,6 @@ data.require_tags = require_tags
-- for debugging and testing only, and depends on luafilesystem.
local function load_all_tags()
local t = {}
- local ok, lfs = pcall(require, "lfs")
- assert(ok, "Function data.load_all() need the luafilesystem library.")
for _, data_dir in ipairs(config.data_dirs) do
for path in lfs.dir(data_dir) do
local pkg = path:match("(.*)%.tags")
@@ -352,7 +364,16 @@ local function resolve_doc_items(items)
local t = {}
for _, item in ipairs(items) do
if type(item) == "string" then
- t[#t+1] = format("- <%s>", resolve_uri(item))
+ local uri = resolve_uri(item)
+ local scheme, _, location, _, fragment = parse_uri(uri)
+ if scheme == "info" then
+ t[#t+1] = format("- Info node [%s(%s)](%s)", location, fragment, uri)
+ elseif scheme == "file" then
+ local _, filename = path_split(location)
+ t[#t+1] = format("- [%s](%s)", filename, uri)
+ else
+ t[#t+1] = format("- <%s>", uri)
+ end
else
t[#t+1] = format("- [%s](%s)", item.summary, resolve_uri(item.uri))
end
diff --git a/support/digestif/digestif/langserver.lua b/support/digestif/digestif/langserver.lua
index bbda819f11..ac460d758d 100644
--- a/support/digestif/digestif/langserver.lua
+++ b/support/digestif/digestif/langserver.lua
@@ -21,6 +21,7 @@ else
end
--* Convert LSP API objects to/from internal representations
+local length_fun, offset_fun = utf8.len, utf8.offset
-- This will be a digestif.Cache object. Its initialization is
-- deferred to `initialized` method.
@@ -61,7 +62,7 @@ local function from_Position(str, position, p0, l0)
if l0 and l0 > l then p0, l0 = nil, nil end
for n, i in lines(str, p0, l0) do
if n == l then
- return utf8.offset(str, c, i), i, l
+ return offset_fun(str, c, i), i, l
end
end
end
@@ -85,13 +86,13 @@ local function from_TextDocumentPositionParams(arg)
local texformat = open_documents[filename]
local script = cache:manuscript(filename, texformat)
local l, c = arg.position.line + 1, arg.position.character + 1
- return script, script:position_at(l, c)
+ return script, script:position_at(l, c, offset_fun)
end
local function to_Range(item)
local script = item.manuscript
- local l1, c1 = script:line_column_at(item.pos)
- local l2, c2 = script:line_column_at(item.cont)
+ local l1, c1 = script:line_column_at(item.pos, length_fun)
+ local l2, c2 = script:line_column_at(item.cont, length_fun)
return {
start = {line = l1 - 1, character = c1 - 1},
["end"] = {line = l2 - 1, character = c2 - 1},
@@ -110,8 +111,8 @@ local function to_MarkupContent(str)
end
local function to_TextEdit(script, pos, old, new)
- local l, c_start = script:line_column_at(pos)
- local c_end = c_start + utf8.len(old)
+ local l, c_start = script:line_column_at(pos, length_fun)
+ local c_end = c_start + length_fun(old)
return {
range = {
start = {line = l - 1, character = c_start - 1},
@@ -185,8 +186,37 @@ methods["initialize"] = function(params)
if params.initializationOptions then
config.load_from_table(params.initializationOptions)
end
+ local enc, encodings = nil, nested_get(params.capabilities, "general", "positionEncodings")
+ for _, e in ipairs(encodings or {}) do
+ if e == "utf-32" then
+ enc = e
+ break
+ elseif e == "utf-8" then
+ enc = e
+ length_fun = function(s, i, j)
+ if i then
+ j = j or #s
+ if i < 1 or j < i then error("Invalid offset") end
+ return j - i + 1
+ else
+ return #s
+ end
+ end
+ offset_fun = function(s, n, i)
+ i = i or n < 0 and #s + 1 or 1
+ local v = n + (i or 1) - 1
+ if v < 1 or v > #s + 1 then error("Invalid offset") end
+ return v
+ end
+ break
+ end
+ end
+ if not enc and config.verbose then
+ log("Digestif and you editor couldn't agree on a fully supported position encoding")
+ end
return {
capabilities = {
+ positionEncoding = enc,
textDocumentSync = {
openClose = true,
change = 2
diff --git a/support/digestif/digestif/util.lua b/support/digestif/digestif/util.lua
index 2e042ebd70..c33756cdf0 100644
--- a/support/digestif/digestif/util.lua
+++ b/support/digestif/digestif/util.lua
@@ -301,7 +301,7 @@ local line_patt = I * (search(I * eol) * I + P(true))
local function lines(s, i, n)
return co_wrap(function()
- local n, i, j, k = n or 1, match(line_patt, s, i)
+ local n, i, j, k = n or 1, match(line_patt, s, i) -- luacheck: ignore n i
while k do
co_yield(n, i, j - 1)
n, i, j, k = n + 1, match(line_patt, s, k)
@@ -641,10 +641,10 @@ do
t[n] = encode_number(obj)
return n + 1
elseif obj_type == "table" then
- local v = obj[1]
- if v ~= nil then
+ local v1 = obj[1]
+ if v1 ~= nil then
t[n] = "["
- n = do_encode(v, t, n + 1)
+ n = do_encode(v1, t, n + 1)
for i = 2, #obj do
t[n] = ","
n = do_encode(obj[i], t, n + 1)
@@ -658,7 +658,7 @@ do
t[n + 1] = encode_string(k)
t[n + 2] = "\":"
n = do_encode(v, t, n + 3)
- for k, v in next, obj, k do
+ for k, v in next, obj, k do -- luacheck: ignore k v
t[n] = ",\""
t[n + 1] = encode_string(k)
t[n + 2] = "\":"
diff --git a/support/epstopdf/epstopdf.pl b/support/epstopdf/epstopdf.pl
index df768ef815..4fa1a59001 100755
--- a/support/epstopdf/epstopdf.pl
+++ b/support/epstopdf/epstopdf.pl
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
use warnings;
-# $Id: epstopdf.pl 71121 2024-04-29 17:27:25Z karl $
+# $Id: epstopdf.pl 71777 2024-07-11 21:24:57Z karl $
# (Copyright lines below.)
#
# Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,11 @@ use warnings;
#
# emacs-page
#
-my $ver = "2.34";
+my $ver = "2.36";
+# 2024/07/11 2.36 (Karl Berry)
+# * regexp syntax for OS/2 test, found by John Collins.
+# 2024/06/21 2.35 (Karl Berry)
+# * path_sep for OS/2 is also ";".
# 2024/04/29 2.34 (Karl Berry)
# * if --debug is first argument, give more output.
# * do not check for kpsewhich in PATH unless restricted.
@@ -226,7 +230,7 @@ my $ver = "2.34";
### emacs-page
### program identification
my $program = "epstopdf";
-my $ident = '($Id: epstopdf.pl 71121 2024-04-29 17:27:25Z karl $)' . " $ver";
+my $ident = '($Id: epstopdf.pl 71777 2024-07-11 21:24:57Z karl $)' . " $ver";
my $copyright = <<END_COPYRIGHT ;
Copyright 2009-2024 Karl Berry et al.
Copyright 2002-2009 Gerben Wierda et al.
@@ -258,7 +262,7 @@ debug " on_cygwin=$on_cygwin, on_msys=$on_msys";
# Split PATH and use / as directory separator.
#
-my $path_sep = ( ($^O =~ /^MSWin/) ? ';' : ':' ); # not msys
+my $path_sep = ($^O =~ /^(OS2|MSWin)/i) ? ';' : ':'; # not msys
my @pdirs = split($path_sep, $ENV{"PATH"});
# Normalize directory separators to /. Always valid on Windows.
if ($on_windows_or_cygwin) {
diff --git a/support/lacheck/Makefile.in b/support/lacheck/Makefile.in
index c9bca0b244..08234e7ceb 100644
--- a/support/lacheck/Makefile.in
+++ b/support/lacheck/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# Makefile.in generated by automake 1.17 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+# Copyright (C) 1994-2024 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -70,6 +70,8 @@ am__make_running_with_option = \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+am__rm_f = rm -f $(am__rm_f_notfound)
+am__rm_rf = rm -rf $(am__rm_f_notfound)
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -172,10 +174,9 @@ am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
+ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \
}
man1dir = $(mandir)/man1
NROFF = nroff
@@ -307,6 +308,7 @@ am__sh_e_setup = case $$- in *e*) set +e;; esac
# Default flags passed to test drivers.
am__common_driver_flags = \
--color-tests "$$am__color_tests" \
+ $$am__collect_skipped_logs \
--enable-hard-errors "$$am__enable_hard_errors" \
--expect-failure "$$am__expect_failure"
# To be inserted before the command running the test. Creates the
@@ -331,6 +333,11 @@ if test -f "./$$f"; then dir=./; \
elif test -f "$$f"; then dir=; \
else dir="$(srcdir)/"; fi; \
tst=$$dir$$f; log='$@'; \
+if test -n '$(IGNORE_SKIPPED_LOGS)'; then \
+ am__collect_skipped_logs='--collect-skipped-logs no'; \
+else \
+ am__collect_skipped_logs=''; \
+fi; \
if test -n '$(DISABLE_HARD_ERRORS)'; then \
am__enable_hard_errors=no; \
else \
@@ -391,20 +398,22 @@ distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
- find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -rf "$(distdir)" \
+ find "$(distdir)" -type d ! -perm -700 -exec chmod u+rwx {} ';' \
+ ; rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
DIST_ARCHIVES = $(distdir).tar.gz
-GZIP_ENV = --best
+GZIP_ENV = -9
DIST_TARGETS = dist-gzip
# Exists only to be overridden by the user if desired.
AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
-distcleancheck_listfiles = find . -type f -print
+distcleancheck_listfiles = \
+ find . \( -type f -a \! \
+ \( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -464,8 +473,10 @@ ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
+am__rm_f_notfound = @am__rm_f_notfound@
am__tar = @am__tar@
am__untar = @am__untar@
+am__xargs_n = @am__xargs_n@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
@@ -559,12 +570,12 @@ config.h: stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status config.h
+ $(AM_V_at)rm -f stamp-h1
+ $(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
- rm -f stamp-h1
- touch $@
+ $(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ $(AM_V_at)rm -f stamp-h1
+ $(AM_V_at)touch $@
distclean-hdr:
-rm -f config.h stamp-h1
@@ -608,10 +619,10 @@ uninstall-binPROGRAMS:
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(bindir)" && rm -f $$files
+ cd "$(DESTDIR)$(bindir)" && $(am__rm_f) $$files
clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+ -$(am__rm_f) $(bin_PROGRAMS)
lacheck$(EXEEXT): $(lacheck_OBJECTS) $(lacheck_DEPENDENCIES) $(EXTRA_lacheck_DEPENDENCIES)
@rm -f lacheck$(EXEEXT)
@@ -627,7 +638,7 @@ distclean-compile:
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
- @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+ @: >>$@
am--depfiles: $(am__depfiles_remade)
@@ -763,7 +774,6 @@ distclean-tags:
am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
am--force-recheck:
@:
-
$(TEST_SUITE_LOG): $(TEST_LOGS)
@$(am__set_TESTS_bases); \
am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
@@ -839,10 +849,37 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
result_count $$1 "XPASS:" $$xpass "$$red"; \
result_count $$1 "ERROR:" $$error "$$mgn"; \
}; \
+ output_system_information () \
+ { \
+ echo; \
+ { uname -a | $(AWK) '{ \
+ printf "System information (uname -a):"; \
+ for (i = 1; i < NF; ++i) \
+ { \
+ if (i != 2) \
+ printf " %s", $$i; \
+ } \
+ printf "\n"; \
+}'; } 2>&1; \
+ if test -r /etc/os-release; then \
+ echo "Distribution information (/etc/os-release):"; \
+ sed 8q /etc/os-release; \
+ elif test -r /etc/issue; then \
+ echo "Distribution information (/etc/issue):"; \
+ cat /etc/issue; \
+ fi; \
+ }; \
+ please_report () \
+ { \
+echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \
+echo "together with the test-suite.log file (gzipped) and your system"; \
+echo "information. Thanks."; \
+ }; \
{ \
echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
$(am__rst_title); \
create_testsuite_report --no-color; \
+ output_system_information; \
echo; \
echo ".. contents:: :depth: 2"; \
echo; \
@@ -862,26 +899,25 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
create_testsuite_report --maybe-color; \
echo "$$col$$br$$std"; \
if $$success; then :; else \
- echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\
if test -n "$(PACKAGE_BUGREPORT)"; then \
- echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \
fi; \
echo "$$col$$br$$std"; \
fi; \
$$success || exit 1
check-TESTS: $(dist_check_SCRIPTS)
- @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
- @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
- @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @$(am__rm_f) $(RECHECK_LOGS)
+ @$(am__rm_f) $(RECHECK_LOGS:.log=.trs)
+ @$(am__rm_f) $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
log_list=`for i in $$bases; do echo $$i.log; done`; \
- trs_list=`for i in $$bases; do echo $$i.trs; done`; \
- log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ log_list=`echo $$log_list`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
exit $$?;
recheck: all $(dist_check_SCRIPTS)
- @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @$(am__rm_f) $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
bases=`for i in $$bases; do echo $$i; done \
| $(am__list_recheck_tests)` || exit 1; \
@@ -910,7 +946,7 @@ distdir: $(BUILT_SOURCES)
distdir-am: $(DISTFILES)
$(am__remove_distdir)
- test -d "$(distdir)" || mkdir "$(distdir)"
+ $(AM_V_at)$(MKDIR_P) "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -996,7 +1032,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
+ eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@@ -1006,7 +1042,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
+ eval GZIP= gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
*.tar.zst*) \
@@ -1106,28 +1142,28 @@ install-strip:
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
- -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
- -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
- -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ -$(am__rm_f) $(TEST_LOGS)
+ -$(am__rm_f) $(TEST_LOGS:.log=.trs)
+ -$(am__rm_f) $(TEST_SUITE_LOG)
clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+ -$(am__rm_f) $(CLEANFILES)
distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -$(am__rm_f) $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
- -rm -f lacheck.c
+ -$(am__rm_f) lacheck.c
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f ./$(DEPDIR)/lacheck.Po
+ -rm -f ./$(DEPDIR)/lacheck.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-tags
@@ -1175,7 +1211,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -f ./$(DEPDIR)/lacheck.Po
+ -rm -f ./$(DEPDIR)/lacheck.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -1222,3 +1258,10 @@ lacheck.log: lacheck$(EXEEXT)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+
+# Tell GNU make to disable its built-in pattern rules.
+%:: %,v
+%:: RCS/%,v
+%:: RCS/%
+%:: s.%
+%:: SCCS/s.%
diff --git a/support/lacheck/aclocal.m4 b/support/lacheck/aclocal.m4
index cf145f2e53..4a0523918b 100644
--- a/support/lacheck/aclocal.m4
+++ b/support/lacheck/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
+# generated automatically by aclocal 1.17 -*- Autoconf -*-
-# Copyright (C) 1996-2021 Free Software Foundation, Inc.
+# Copyright (C) 1996-2024 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2021 Free Software Foundation, Inc.
+# Copyright (C) 2002-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.16'
+[am__api_version='1.17'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.16.5], [],
+m4_if([$1], [1.17], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.16.5])dnl
+[AM_AUTOMAKE_VERSION([1.17])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2021 Free Software Foundation, Inc.
+# Copyright (C) 2001-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2021 Free Software Foundation, Inc.
+# Copyright (C) 1997-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2021 Free Software Foundation, Inc.
+# Copyright (C) 1999-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -273,7 +273,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # When given -MP, icc 7.0 and 7.1 complain thus:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
@@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2021 Free Software Foundation, Inc.
+# Copyright (C) 1999-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -400,7 +400,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2021 Free Software Foundation, Inc.
+# Copyright (C) 1996-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -534,7 +534,7 @@ if test -z "$CSCOPE"; then
fi
AC_SUBST([CSCOPE])
-AC_REQUIRE([AM_SILENT_RULES])dnl
+AC_REQUIRE([_AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
@@ -542,47 +542,9 @@ AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-# POSIX will say in a future version that running "rm -f" with no argument
-# is OK; and we want to be able to make that assumption in our Makefile
-# recipes. So use an aggressive probe to check that the usage we want is
-# actually supported "in the wild" to an acceptable degree.
-# See automake bug#10828.
-# To make any issue more visible, cause the running configure to be aborted
-# by default if the 'rm' program in use doesn't match our expectations; the
-# user can still override this though.
-if rm -f && rm -fr && rm -rf; then : OK; else
- cat >&2 <<'END'
-Oops!
-
-Your 'rm' program seems unable to run without file operands specified
-on the command line, even when the '-f' option is present. This is contrary
-to the behaviour of most rm programs out there, and not conforming with
-the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
-
-Please tell bug-automake@gnu.org about your system, including the value
-of your $PATH and any error possibly output before this message. This
-can help us improve future automake versions.
+AC_REQUIRE([_AM_PROG_RM_F])
+AC_REQUIRE([_AM_PROG_XARGS_N])
-END
- if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
- echo 'Configuration will proceed anyway, since you have set the' >&2
- echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
- echo >&2
- else
- cat >&2 <<'END'
-Aborting the configuration process, to ensure you take notice of the issue.
-
-You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <https://www.gnu.org/software/coreutils/>.
-
-If you want to complete the configuration process using your problematic
-'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
-to "yes", and re-run configure.
-
-END
- AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
- fi
-fi
dnl The trailing newline in this macro's definition is deliberate, for
dnl backward compatibility and to allow trailing 'dnl'-style comments
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
@@ -615,7 +577,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2021 Free Software Foundation, Inc.
+# Copyright (C) 2001-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -636,7 +598,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2021 Free Software Foundation, Inc.
+# Copyright (C) 2003-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -658,7 +620,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996-2021 Free Software Foundation, Inc.
+# Copyright (C) 1996-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -693,7 +655,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2021 Free Software Foundation, Inc.
+# Copyright (C) 2001-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -736,7 +698,7 @@ AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2021 Free Software Foundation, Inc.
+# Copyright (C) 1997-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -770,7 +732,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2021 Free Software Foundation, Inc.
+# Copyright (C) 2001-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -799,7 +761,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2021 Free Software Foundation, Inc.
+# Copyright (C) 1999-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -846,7 +808,23 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2021 Free Software Foundation, Inc.
+# Copyright (C) 2022-2024 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_RM_F
+# ---------------
+# Check whether 'rm -f' without any arguments works.
+# https://bugs.gnu.org/10828
+AC_DEFUN([_AM_PROG_RM_F],
+[am__rm_f_notfound=
+AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""'])
+AC_SUBST(am__rm_f_notfound)
+])
+
+# Copyright (C) 2001-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -865,16 +843,169 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2021 Free Software Foundation, Inc.
+# Copyright (C) 1996-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
+# _AM_SLEEP_FRACTIONAL_SECONDS
+# ----------------------------
+AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl
+AC_CACHE_CHECK([whether sleep supports fractional seconds],
+ am_cv_sleep_fractional_seconds, [dnl
+AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes],
+ [am_cv_sleep_fractional_seconds=no])
+])])
+
+# _AM_FILESYSTEM_TIMESTAMP_RESOLUTION
+# -----------------------------------
+# Determine the filesystem's resolution for file modification
+# timestamps. The coarsest we know of is FAT, with a resolution
+# of only two seconds, even with the most recent "exFAT" extensions.
+# The finest (e.g. ext4 with large inodes, XFS, ZFS) is one
+# nanosecond, matching clock_gettime. However, it is probably not
+# possible to delay execution of a shell script for less than one
+# millisecond, due to process creation overhead and scheduling
+# granularity, so we don't check for anything finer than that. (See below.)
+AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl
+AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS])
+AC_CACHE_CHECK([filesystem timestamp resolution],
+ am_cv_filesystem_timestamp_resolution, [dnl
+# Default to the worst case.
+am_cv_filesystem_timestamp_resolution=2
+
+# Only try to go finer than 1 sec if sleep can do it.
+# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work,
+# - 1 sec is not much of a win compared to 2 sec, and
+# - it takes 2 seconds to perform the test whether 1 sec works.
+#
+# Instead, just use the default 2s on platforms that have 1s resolution,
+# accept the extra 1s delay when using $sleep in the Automake tests, in
+# exchange for not incurring the 2s delay for running the test for all
+# packages.
+#
+am_try_resolutions=
+if test "$am_cv_sleep_fractional_seconds" = yes; then
+ # Even a millisecond often causes a bunch of false positives,
+ # so just try a hundredth of a second. The time saved between .001 and
+ # .01 is not terribly consequential.
+ am_try_resolutions="0.01 0.1 $am_try_resolutions"
+fi
+
+# In order to catch current-generation FAT out, we must *modify* files
+# that already exist; the *creation* timestamp is finer. Use names
+# that make ls -t sort them differently when they have equal
+# timestamps than when they have distinct timestamps, keeping
+# in mind that ls -t prints the *newest* file first.
+rm -f conftest.ts?
+: > conftest.ts1
+: > conftest.ts2
+: > conftest.ts3
+
+# Make sure ls -t actually works. Do 'set' in a subshell so we don't
+# clobber the current shell's arguments. (Outer-level square brackets
+# are removed by m4; they're present so that m4 does not expand
+# <dollar><star>; be careful, easy to get confused.)
+if (
+ set X `[ls -t conftest.ts[12]]` &&
+ {
+ test "$[]*" != "X conftest.ts1 conftest.ts2" ||
+ test "$[]*" != "X conftest.ts2 conftest.ts1";
+ }
+); then :; else
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ _AS_ECHO_UNQUOTED(
+ ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""],
+ [AS_MESSAGE_LOG_FD])
+ AC_MSG_FAILURE([ls -t produces unexpected output.
+Make sure there is not a broken ls alias in your environment.])
+fi
+
+for am_try_res in $am_try_resolutions; do
+ # Any one fine-grained sleep might happen to cross the boundary
+ # between two values of a coarser actual resolution, but if we do
+ # two fine-grained sleeps in a row, at least one of them will fall
+ # entirely within a coarse interval.
+ echo alpha > conftest.ts1
+ sleep $am_try_res
+ echo beta > conftest.ts2
+ sleep $am_try_res
+ echo gamma > conftest.ts3
+
+ # We assume that 'ls -t' will make use of high-resolution
+ # timestamps if the operating system supports them at all.
+ if (set X `ls -t conftest.ts?` &&
+ test "$[]2" = conftest.ts3 &&
+ test "$[]3" = conftest.ts2 &&
+ test "$[]4" = conftest.ts1); then
+ #
+ # Ok, ls -t worked. If we're at a resolution of 1 second, we're done,
+ # because we don't need to test make.
+ make_ok=true
+ if test $am_try_res != 1; then
+ # But if we've succeeded so far with a subsecond resolution, we
+ # have one more thing to check: make. It can happen that
+ # everything else supports the subsecond mtimes, but make doesn't;
+ # notably on macOS, which ships make 3.81 from 2006 (the last one
+ # released under GPLv2). https://bugs.gnu.org/68808
+ #
+ # We test $MAKE if it is defined in the environment, else "make".
+ # It might get overridden later, but our hope is that in practice
+ # it does not matter: it is the system "make" which is (by far)
+ # the most likely to be broken, whereas if the user overrides it,
+ # probably they did so with a better, or at least not worse, make.
+ # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html
+ #
+ # Create a Makefile (real tab character here):
+ rm -f conftest.mk
+ echo 'conftest.ts1: conftest.ts2' >conftest.mk
+ echo ' touch conftest.ts2' >>conftest.mk
+ #
+ # Now, running
+ # touch conftest.ts1; touch conftest.ts2; make
+ # should touch ts1 because ts2 is newer. This could happen by luck,
+ # but most often, it will fail if make's support is insufficient. So
+ # test for several consecutive successes.
+ #
+ # (We reuse conftest.ts[12] because we still want to modify existing
+ # files, not create new ones, per above.)
+ n=0
+ make=${MAKE-make}
+ until test $n -eq 3; do
+ echo one > conftest.ts1
+ sleep $am_try_res
+ echo two > conftest.ts2 # ts2 should now be newer than ts1
+ if $make -f conftest.mk | grep 'up to date' >/dev/null; then
+ make_ok=false
+ break # out of $n loop
+ fi
+ n=`expr $n + 1`
+ done
+ fi
+ #
+ if $make_ok; then
+ # Everything we know to check worked out, so call this resolution good.
+ am_cv_filesystem_timestamp_resolution=$am_try_res
+ break # out of $am_try_res loop
+ fi
+ # Otherwise, we'll go on to check the next resolution.
+ fi
+done
+rm -f conftest.ts?
+# (end _am_filesystem_timestamp_resolution)
+])])
+
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
+[AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION])
+# This check should not be cached, as it may vary across builds of
+# different projects.
+AC_MSG_CHECKING([whether build environment is sane])
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -893,49 +1024,40 @@ esac
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
-if (
- am_has_slept=no
- for am_try in 1 2; do
- echo "timestamp, slept: $am_has_slept" > conftest.file
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
- alias in your environment])
- fi
- if test "$[2]" = conftest.file || test $am_try -eq 2; then
- break
- fi
- # Just in case.
- sleep 1
- am_has_slept=yes
- done
- test "$[2]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
+am_build_env_is_sane=no
+am_has_slept=no
+rm -f conftest.file
+for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[]*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ test "$[]2" = conftest.file
+ ); then
+ am_build_env_is_sane=yes
+ break
+ fi
+ # Just in case.
+ sleep "$am_cv_filesystem_timestamp_resolution"
+ am_has_slept=yes
+done
+
+AC_MSG_RESULT([$am_build_env_is_sane])
+if test "$am_build_env_is_sane" = no; then
+ AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
-AC_MSG_RESULT([yes])
+
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
- ( sleep 1 ) &
+AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl
+ ( sleep "$am_cv_filesystem_timestamp_resolution" ) &
am_sleep_pid=$!
-fi
+])
AC_CONFIG_COMMANDS_PRE(
[AC_MSG_CHECKING([that generated files are newer than configure])
if test -n "$am_sleep_pid"; then
@@ -946,18 +1068,18 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2021 Free Software Foundation, Inc.
+# Copyright (C) 2009-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# AM_SILENT_RULES([DEFAULT])
-# --------------------------
-# Enable less verbose build rules; with the default set to DEFAULT
-# ("yes" being less verbose, "no" or empty being verbose).
-AC_DEFUN([AM_SILENT_RULES],
-[AC_ARG_ENABLE([silent-rules], [dnl
+# _AM_SILENT_RULES
+# ----------------
+# Enable less verbose build rules support.
+AC_DEFUN([_AM_SILENT_RULES],
+[AM_DEFAULT_VERBOSITY=1
+AC_ARG_ENABLE([silent-rules], [dnl
AS_HELP_STRING(
[--enable-silent-rules],
[less verbose build output (undo: "make V=1")])
@@ -965,11 +1087,6 @@ AS_HELP_STRING(
[--disable-silent-rules],
[verbose build output (undo: "make V=0")])dnl
])
-case $enable_silent_rules in @%:@ (((
- yes) AM_DEFAULT_VERBOSITY=0;;
- no) AM_DEFAULT_VERBOSITY=1;;
- *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
-esac
dnl
dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
dnl do not support nested variable expansions.
@@ -988,14 +1105,6 @@ am__doit:
else
am_cv_make_support_nested_variables=no
fi])
-if test $am_cv_make_support_nested_variables = yes; then
- dnl Using '$V' instead of '$(V)' breaks IRIX make.
- AM_V='$(V)'
- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
- AM_V=$AM_DEFAULT_VERBOSITY
- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
AC_SUBST([AM_V])dnl
AM_SUBST_NOTMAKE([AM_V])dnl
AC_SUBST([AM_DEFAULT_V])dnl
@@ -1004,9 +1113,33 @@ AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
AM_BACKSLASH='\'
AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls
+dnl to AM_SILENT_RULES to change the default value.
+AC_CONFIG_COMMANDS_PRE([dnl
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+esac
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+])dnl
])
-# Copyright (C) 2001-2021 Free Software Foundation, Inc.
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or
+# empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_REQUIRE([_AM_SILENT_RULES])
+AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])])
+
+# Copyright (C) 2001-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1034,7 +1167,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2021 Free Software Foundation, Inc.
+# Copyright (C) 2006-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1053,7 +1186,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2021 Free Software Foundation, Inc.
+# Copyright (C) 2004-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1099,15 +1232,19 @@ m4_if([$1], [v7],
am_uid=`id -u || echo unknown`
am_gid=`id -g || echo unknown`
AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
- if test $am_uid -le $am_max_uid; then
- AC_MSG_RESULT([yes])
+ if test x$am_uid = xunknown; then
+ AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work])
+ elif test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
else
- AC_MSG_RESULT([no])
- _am_tools=none
+ AC_MSG_RESULT([no])
+ _am_tools=none
fi
AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
- if test $am_gid -le $am_max_gid; then
- AC_MSG_RESULT([yes])
+ if test x$gm_gid = xunknown; then
+ AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work])
+ elif test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
_am_tools=none
@@ -1184,5 +1321,25 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
+# Copyright (C) 2022-2024 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_XARGS_N
+# ----------------
+# Check whether 'xargs -n' works. It should work everywhere, so the fallback
+# is not optimized at all as we never expect to use it.
+AC_DEFUN([_AM_PROG_XARGS_N],
+[AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl
+AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2
+3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])])
+AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl
+ am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }'
+])dnl
+AC_SUBST(am__xargs_n)
+])
+
m4_include([../../m4/kpse-common.m4])
m4_include([../../m4/kpse-warnings.m4])
diff --git a/support/lacheck/configure.texk b/support/lacheck/configure.texk
index 06f1ce8f4e..0b986c73d7 100755
--- a/support/lacheck/configure.texk
+++ b/support/lacheck/configure.texk
@@ -669,6 +669,8 @@ CC
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
+am__xargs_n
+am__rm_f_notfound
AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
@@ -2408,7 +2410,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-am__api_version='1.16'
+am__api_version='1.17'
@@ -2511,6 +2513,165 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sleep supports fractional seconds" >&5
+printf %s "checking whether sleep supports fractional seconds... " >&6; }
+if test ${am_cv_sleep_fractional_seconds+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if sleep 0.001 2>/dev/null
+then :
+ am_cv_sleep_fractional_seconds=yes
+else case e in #(
+ e) am_cv_sleep_fractional_seconds=no ;;
+esac
+fi
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5
+printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; }
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5
+printf %s "checking filesystem timestamp resolution... " >&6; }
+if test ${am_cv_filesystem_timestamp_resolution+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) # Default to the worst case.
+am_cv_filesystem_timestamp_resolution=2
+
+# Only try to go finer than 1 sec if sleep can do it.
+# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work,
+# - 1 sec is not much of a win compared to 2 sec, and
+# - it takes 2 seconds to perform the test whether 1 sec works.
+#
+# Instead, just use the default 2s on platforms that have 1s resolution,
+# accept the extra 1s delay when using $sleep in the Automake tests, in
+# exchange for not incurring the 2s delay for running the test for all
+# packages.
+#
+am_try_resolutions=
+if test "$am_cv_sleep_fractional_seconds" = yes; then
+ # Even a millisecond often causes a bunch of false positives,
+ # so just try a hundredth of a second. The time saved between .001 and
+ # .01 is not terribly consequential.
+ am_try_resolutions="0.01 0.1 $am_try_resolutions"
+fi
+
+# In order to catch current-generation FAT out, we must *modify* files
+# that already exist; the *creation* timestamp is finer. Use names
+# that make ls -t sort them differently when they have equal
+# timestamps than when they have distinct timestamps, keeping
+# in mind that ls -t prints the *newest* file first.
+rm -f conftest.ts?
+: > conftest.ts1
+: > conftest.ts2
+: > conftest.ts3
+
+# Make sure ls -t actually works. Do 'set' in a subshell so we don't
+# clobber the current shell's arguments. (Outer-level square brackets
+# are removed by m4; they're present so that m4 does not expand
+# <dollar><star>; be careful, easy to get confused.)
+if (
+ set X `ls -t conftest.ts[12]` &&
+ {
+ test "$*" != "X conftest.ts1 conftest.ts2" ||
+ test "$*" != "X conftest.ts2 conftest.ts1";
+ }
+); then :; else
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
+as_fn_error $? "ls -t produces unexpected output.
+Make sure there is not a broken ls alias in your environment.
+See 'config.log' for more details" "$LINENO" 5; }
+fi
+
+for am_try_res in $am_try_resolutions; do
+ # Any one fine-grained sleep might happen to cross the boundary
+ # between two values of a coarser actual resolution, but if we do
+ # two fine-grained sleeps in a row, at least one of them will fall
+ # entirely within a coarse interval.
+ echo alpha > conftest.ts1
+ sleep $am_try_res
+ echo beta > conftest.ts2
+ sleep $am_try_res
+ echo gamma > conftest.ts3
+
+ # We assume that 'ls -t' will make use of high-resolution
+ # timestamps if the operating system supports them at all.
+ if (set X `ls -t conftest.ts?` &&
+ test "$2" = conftest.ts3 &&
+ test "$3" = conftest.ts2 &&
+ test "$4" = conftest.ts1); then
+ #
+ # Ok, ls -t worked. If we're at a resolution of 1 second, we're done,
+ # because we don't need to test make.
+ make_ok=true
+ if test $am_try_res != 1; then
+ # But if we've succeeded so far with a subsecond resolution, we
+ # have one more thing to check: make. It can happen that
+ # everything else supports the subsecond mtimes, but make doesn't;
+ # notably on macOS, which ships make 3.81 from 2006 (the last one
+ # released under GPLv2). https://bugs.gnu.org/68808
+ #
+ # We test $MAKE if it is defined in the environment, else "make".
+ # It might get overridden later, but our hope is that in practice
+ # it does not matter: it is the system "make" which is (by far)
+ # the most likely to be broken, whereas if the user overrides it,
+ # probably they did so with a better, or at least not worse, make.
+ # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html
+ #
+ # Create a Makefile (real tab character here):
+ rm -f conftest.mk
+ echo 'conftest.ts1: conftest.ts2' >conftest.mk
+ echo ' touch conftest.ts2' >>conftest.mk
+ #
+ # Now, running
+ # touch conftest.ts1; touch conftest.ts2; make
+ # should touch ts1 because ts2 is newer. This could happen by luck,
+ # but most often, it will fail if make's support is insufficient. So
+ # test for several consecutive successes.
+ #
+ # (We reuse conftest.ts[12] because we still want to modify existing
+ # files, not create new ones, per above.)
+ n=0
+ make=${MAKE-make}
+ until test $n -eq 3; do
+ echo one > conftest.ts1
+ sleep $am_try_res
+ echo two > conftest.ts2 # ts2 should now be newer than ts1
+ if $make -f conftest.mk | grep 'up to date' >/dev/null; then
+ make_ok=false
+ break # out of $n loop
+ fi
+ n=`expr $n + 1`
+ done
+ fi
+ #
+ if $make_ok; then
+ # Everything we know to check worked out, so call this resolution good.
+ am_cv_filesystem_timestamp_resolution=$am_try_res
+ break # out of $am_try_res loop
+ fi
+ # Otherwise, we'll go on to check the next resolution.
+ fi
+done
+rm -f conftest.ts?
+# (end _am_filesystem_timestamp_resolution)
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5
+printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; }
+
+# This check should not be cached, as it may vary across builds of
+# different projects.
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
printf %s "checking whether build environment is sane... " >&6; }
# Reject unsafe characters in $srcdir or the absolute working directory
@@ -2531,49 +2692,45 @@ esac
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
-if (
- am_has_slept=no
- for am_try in 1 2; do
- echo "timestamp, slept: $am_has_slept" > conftest.file
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
- alias in your environment" "$LINENO" 5
- fi
- if test "$2" = conftest.file || test $am_try -eq 2; then
- break
- fi
- # Just in case.
- sleep 1
- am_has_slept=yes
- done
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- as_fn_error $? "newly created file is older than distributed files!
+am_build_env_is_sane=no
+am_has_slept=no
+rm -f conftest.file
+for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ test "$2" = conftest.file
+ ); then
+ am_build_env_is_sane=yes
+ break
+ fi
+ # Just in case.
+ sleep "$am_cv_filesystem_timestamp_resolution"
+ am_has_slept=yes
+done
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5
+printf "%s\n" "$am_build_env_is_sane" >&6; }
+if test "$am_build_env_is_sane" = no; then
+ as_fn_error $? "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
+
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
- ( sleep 1 ) &
+if test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1
+then :
+
+else case e in #(
+ e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) &
am_sleep_pid=$!
+ ;;
+esac
fi
rm -f conftest.file
@@ -2863,17 +3020,13 @@ else
fi
rmdir .tst 2>/dev/null
+AM_DEFAULT_VERBOSITY=1
# Check whether --enable-silent-rules was given.
if test ${enable_silent_rules+y}
then :
enableval=$enable_silent_rules;
fi
-case $enable_silent_rules in # (((
- yes) AM_DEFAULT_VERBOSITY=0;;
- no) AM_DEFAULT_VERBOSITY=1;;
- *) AM_DEFAULT_VERBOSITY=1;;
-esac
am_make=${MAKE-make}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
printf %s "checking whether $am_make supports nested variables... " >&6; }
@@ -2896,15 +3049,45 @@ esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
printf "%s\n" "$am_cv_make_support_nested_variables" >&6; }
-if test $am_cv_make_support_nested_variables = yes; then
- AM_V='$(V)'
- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
- AM_V=$AM_DEFAULT_VERBOSITY
- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
AM_BACKSLASH='\'
+am__rm_f_notfound=
+if (rm -f && rm -fr && rm -rf) 2>/dev/null
+then :
+
+else case e in #(
+ e) am__rm_f_notfound='""' ;;
+esac
+fi
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5
+printf %s "checking xargs -n works... " >&6; }
+if test ${am_cv_xargs_n_works+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2
+3"
+then :
+ am_cv_xargs_n_works=yes
+else case e in #(
+ e) am_cv_xargs_n_works=no ;;
+esac
+fi ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5
+printf "%s\n" "$am_cv_xargs_n_works" >&6; }
+if test "$am_cv_xargs_n_works" = yes
+then :
+ am__xargs_n='xargs -n'
+else case e in #(
+ e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }'
+ ;;
+esac
+fi
+
@@ -4151,7 +4334,7 @@ else case e in #(
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # When given -MP, icc 7.0 and 7.1 complain thus:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
@@ -4469,47 +4652,9 @@ fi
-# POSIX will say in a future version that running "rm -f" with no argument
-# is OK; and we want to be able to make that assumption in our Makefile
-# recipes. So use an aggressive probe to check that the usage we want is
-# actually supported "in the wild" to an acceptable degree.
-# See automake bug#10828.
-# To make any issue more visible, cause the running configure to be aborted
-# by default if the 'rm' program in use doesn't match our expectations; the
-# user can still override this though.
-if rm -f && rm -fr && rm -rf; then : OK; else
- cat >&2 <<'END'
-Oops!
-Your 'rm' program seems unable to run without file operands specified
-on the command line, even when the '-f' option is present. This is contrary
-to the behaviour of most rm programs out there, and not conforming with
-the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
-Please tell bug-automake@gnu.org about your system, including the value
-of your $PATH and any error possibly output before this message. This
-can help us improve future automake versions.
-END
- if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
- echo 'Configuration will proceed anyway, since you have set the' >&2
- echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
- echo >&2
- else
- cat >&2 <<'END'
-Aborting the configuration process, to ensure you take notice of the issue.
-
-You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <https://www.gnu.org/software/coreutils/>.
-
-If you want to complete the configuration process using your problematic
-'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
-to "yes", and re-run configure.
-
-END
- as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
- fi
-fi
# am_maintainer_mode
@@ -5058,6 +5203,18 @@ printf %s "checking that generated files are newer than configure... " >&6; }
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5
printf "%s\n" "done" >&6; }
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+esac
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+
if test -n "$EXEEXT"; then
am__EXEEXT_TRUE=
am__EXEEXT_FALSE='#'
diff --git a/support/latex-git-log/README.md b/support/latex-git-log/README.md
index f3d5f15f2c..c186186418 100644
--- a/support/latex-git-log/README.md
+++ b/support/latex-git-log/README.md
@@ -1,7 +1,15 @@
+<!--
+SPDX-FileCopyrightText: 2013,2020,2024 Robin Schneider <ypid@riseup.net>
+
+SPDX-License-Identifier: GPL-3.0-or-later
+-->
+
# latex-git-log
This program will output the entire version history as table written in LaTeX
if it is executed within a git repository.
+When file argument(s) are given, only the history that changed these file(s)
+will be output.
It is intended that you redirect the standard output of this script to a file which can then be included from your main LaTeX document.
@@ -12,7 +20,7 @@ landscape page.
### Of this script
-This module requires these other modules and libraries:
+This script requires the following Perl modules:
IPC::System::Simple
Locale::Maketext::Simple
@@ -25,27 +33,25 @@ The table is using the *longtable* package and the links to a web resource for
each commit use the `\href` macro from *hyperref*. So these two packages have
to be loaded.
-Furthermore you need to defined the macro `\longtableendfoot` which will be
+Furthermore you need to define the macro `\longtableendfoot` which will be
expanded on the bottom of every page if the table will be continued on the next
page. You can defined it to a localized message to inform the reader that this
table is not complete and will be continued.
## License and development
-Copyright (C) 2012-2013,2017,2019-2020 Robin Schneider <ypid@riseup.net> <br/>
-SPDX-License-Identifier: GPL-3.0-or-later <br/>
+License: GPL-3.0-or-later <br/>
CTAN: https://ctan.org/pkg/latex-git-log <br/>
Source code repository: https://github.com/ypid/typesetting/tree/master/scripts/latex-git-log <br/>
Please report bugs and feature requests at https://github.com/ypid/typesetting/issues
## Usage
- latex-git-log [options]
+ latex-git-log [options] [file] ...
Options:
--author set this if you want the author included
- --startcommit set the start value of count commit
--width set the width in cm of the commit message field in the LaTeX table
--git-c-add set an base URL to link to a commit
--user set a github user to derive the base URL
@@ -80,3 +86,7 @@ Please report bugs and feature requests at https://github.com/ypid/typesetting/i
need a translation to another language then you can either
create a .po file or I can register this project on one of those
websites for online translation.
+
+## Bugs and limitations
+
+* The translation features does not seem to work. So this script is unable to output German. English works.
diff --git a/support/latex-git-log/example-output.tex b/support/latex-git-log/example-output.tex
index da2c199b5c..f8a396e651 100644
--- a/support/latex-git-log/example-output.tex
+++ b/support/latex-git-log/example-output.tex
@@ -1,9 +1,13 @@
-%% This file was generated by the script latex-git-log
-%% Base git commit URL: https://github.com/ypid/typesetting/commit
+% SPDX-FileCopyrightText: 2024 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: CC0-1.0 OR MIT
+
+% This file was generated by the script latex-git-log.
+% Base git commit URL: https://github.com/ypid/typesetting/commit
\begin{tabular}{lp{12cm}}
\label{tabular:legend:git-log}
\textbf{acronym} & \textbf{meaning} \\
- V & \texttt{version} \\
+ H & \texttt{commit hash} \\
tag & \texttt{git tag} \\
MF & Number of \texttt{modified files}. \\
AL & Number of \texttt{added lines}. \\
@@ -12,9 +16,8 @@
\bigskip
-\iflanguage{ngerman}{\shorthandoff{"}}{}
-\begin{longtable}{|rllp{13cm}rrr|}
-\hline \multicolumn{1}{|c}{\textbf{V}} & \multicolumn{1}{c}{\textbf{tag}}
+\begin{longtable}{|rllp{12cm}rrr|}
+\hline \multicolumn{1}{|c}{\textbf{H}} & \multicolumn{1}{c}{\textbf{tag}}
& \multicolumn{1}{c}{\textbf{date}}
& \multicolumn{1}{c}{\textbf{commit message}} & \multicolumn{1}{c}{\textbf{MF}}
& \multicolumn{1}{c}{\textbf{AL}} & \multicolumn{1}{c|}{\textbf{DL}} \\ \hline
@@ -26,45 +29,165 @@
\hline% \hline
\endlastfoot
-\hline 1 & & 2012-08-18 & \href{https://github.com/ypid/typesetting/commit/3ff663fcfbc56662426740cf6bab2a840e320db6}{added template.dtx from http://texhacks.blogspot.de/2011/01/simpler-dtx-template.html} & 2 & 127 & 0 \\
-\hline 2 & & 2012-08-19 & \href{https://github.com/ypid/typesetting/commit/e9fc9a2847fe14067bb3ec8d4e4298ff8806f11f}{made my first changes on the docstrip template} & 2 & 40 & 48 \\
-\hline 3 & & 2012-08-19 & \href{https://github.com/ypid/typesetting/commit/cbc7bbcdda54f7b43f2039531d2a4f58c35f8964}{optimized} & 1 & 5 & 4 \\
-\hline 4 & & 2012-08-22 & \href{https://github.com/ypid/typesetting/commit/55d994c391c509897dd56a6a755c51a1e62bd4d4}{optimized} & 2 & 119 & 115 \\
-\hline 5 & & 2012-08-23 & \href{https://github.com/ypid/typesetting/commit/933466b223d70adeda6a865b4b13b4cdfa245070}{added my primary template} & 6 & 252 & 6 \\
-\hline 6 & & 2012-08-23 & \href{https://github.com/ypid/typesetting/commit/5995d70f82b680d3a529aa592558dcdde6f407b7}{added PDFs} & 2 & 0 & 0 \\
-\hline 7 & & 2012-08-23 & \href{https://github.com/ypid/typesetting/commit/7e1efb265b43fb9aad3fa94b22408951076016f3}{added README (Credits)} & 1 & 1 & 0 \\
-\hline 8 & & 2012-08-26 & \href{https://github.com/ypid/typesetting/commit/619a7f6db915bc1e05d0c9ee374aaff53195b257}{converted template.dtx and template.ins to a template for sty2dtx} & 7 & 49 & 62 \\
-\hline 9 & & 2012-08-27 & \href{https://github.com/ypid/typesetting/commit/06f948149a3b0bd2c81062078add19af6bb1ac5d}{optimized} & 6 & 48 & 22 \\
-\hline 10 & & 2012-08-27 & \href{https://github.com/ypid/typesetting/commit/09316b528dc90f45fa4ef6cf9cf5886c4e25c5bb}{added scripts} & 6 & 222 & 0 \\
-\hline 11 & & 2012-08-27 & \href{https://github.com/ypid/typesetting/commit/4c434dcd45aa4a73112b1393d096776eaa938b83}{added README for scripts} & 1 & 10 & 0 \\
-\hline 12 & & 2012-08-27 & \href{https://github.com/ypid/typesetting/commit/794a3db5bd4f0165a347f0628c78f32350731b2a}{optimized scripts} & 4 & 9 & 6 \\
-\hline 13 & & 2012-08-28 & \href{https://github.com/ypid/typesetting/commit/7c80a541828c3e7896c7f55c8b56d745b84a5414}{added MyPackages} & 22 & 1162 & 2 \\
-\hline 14 & & 2012-08-28 & \href{https://github.com/ypid/typesetting/commit/b408bc9fa5f91ff5a7687fc4903d520ab09a288d}{added my Makefile} & 5 & 106 & 0 \\
-\hline 15 & & 2012-08-28 & \href{https://github.com/ypid/typesetting/commit/d86bd28e3f0d0e14d7eb239eb6ad9afab2da47c0}{added more scripts} & 4 & 1465 & 0 \\
-\hline 16 & & 2012-08-28 & \href{https://github.com/ypid/typesetting/commit/ab0554ce8d44852a76b7ad0246e04268b8347acb}{optimized} & 5 & 4 & 1459 \\
-\hline 17 & & 2012-08-31 & \href{https://github.com/ypid/typesetting/commit/75a5b9d653b2798a9cb8f10535f50abf98e94cd2}{optimized} & 7 & 52 & 31 \\
-\hline 18 & & 2012-09-09 & \href{https://github.com/ypid/typesetting/commit/2a99a061ae89f5bd6bd6ace4aac66ad9a768b0fc}{optimized} & 4 & 23 & 10 \\
-\hline 19 & & 2012-09-16 & \href{https://github.com/ypid/typesetting/commit/c2463e8229fbc506a70b4efb157679ecf3aae795}{optimized} & 6 & 10 & 7 \\
-\hline 20 & & 2012-09-23 & \href{https://github.com/ypid/typesetting/commit/1b6cb46337c516e3042d94956e7bf4f097822a47}{added more packages} & 9 & 491 & 12 \\
-\hline 21 & & 2012-09-23 & \href{https://github.com/ypid/typesetting/commit/92a41f208a275b6fcdfe9c442be8c135ec0d1c92}{added school templates} & 25 & 502 & 25 \\
-\hline 22 & & 2012-09-30 & \href{https://github.com/ypid/typesetting/commit/32e21641dff2ffd9fecfe33b93def53d6a305963}{added more templates} & 20 & 537 & 4 \\
-\hline 23 & & 2012-11-03 & \href{https://github.com/ypid/typesetting/commit/2309fa9dd41d0acaf74d6de66976f7ae6f1e7c6b}{rewrote LaTeX-git-log as perl script} & 2 & 63 & 61 \\
-\hline 24 & & 2012-11-03 & \href{https://github.com/ypid/typesetting/commit/773e5b801cfd2ad9a2af8c9d379dd0e2f9afd3cf}{optimized} & 2 & 5 & 4 \\
-\hline 25 & & 2012-11-28 & \href{https://github.com/ypid/typesetting/commit/4ffc0488959ada2a97ba50d5a7db1390afce4a26}{added more templates and optimized} & 12 & 141 & 3 \\
-\hline 26 & & 2013-04-04 & \href{https://github.com/ypid/typesetting/commit/dc3b091e5e8d68daa1c4b73ab96e7bc201a6ed08}{Updated templates.} & 17 & 92 & 55 \\
-\hline 27 & & 2013-04-04 & \href{https://github.com/ypid/typesetting/commit/457664094f33618c62348fe5a9798cc98117bcad}{Added macro for showing the github URL and optimized.} & 8 & 26 & 38 \\
-\hline 28 & & 2013-04-04 & \href{https://github.com/ypid/typesetting/commit/71547c919a2b36548e65320be8ce0d318b473523}{Optimized} & 3 & 36 & 0 \\
-\hline 29 & & 2013-04-20 & \href{https://github.com/ypid/typesetting/commit/3681cf7bc6d18878ca03af4009bdfc9e8835dbcd}{Optimized.} & 5 & 40 & 12 \\
-\hline 30 & & 2013-04-20 & \href{https://github.com/ypid/typesetting/commit/c0ef81a414620007d6f39fa95e59888045fa5cf0}{Optimized.} & 12 & 67 & 22 \\
-\hline 31 & & 2013-04-21 & \href{https://github.com/ypid/typesetting/commit/782b0e0e51773b02cf909600444da892c890b926}{Optimized.} & 4 & 30 & 13 \\
-\hline 32 & & 2013-05-22 & \href{https://github.com/ypid/typesetting/commit/f3048459117aa782b32324bd08ce77bfde325a62}{Optimized (mainly LaTeX-git-wdiff).} & 9 & 229 & 78 \\
-\hline 33 & & 2013-06-15 & \href{https://github.com/ypid/typesetting/commit/c5c45122518ad0e6cf9712dc248b26fd3eea4cf0}{Optimized.} & 3 & 15 & 12 \\
-\hline 34 & v1.0 & 2013-06-15 & \href{https://github.com/ypid/typesetting/commit/af3d63d88a8e37c45c4dc7c8b54ee55091f7ea80}{Made latex-git-log ready for CTAN.} & 6 & 482 & 199 \\
-\hline 35 & & 2013-06-15 & \href{https://github.com/ypid/typesetting/commit/489927feca92be10ddb5bde1b8fb11dae6b37bbb}{Optimized latex-git-log.} & 6 & 12 & 15 \\
-\hline 36 & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/6d0ff0a6ae2baba715704f7dea23ebb0ac9ddc02}{Optimized.} & 3 & 106 & 79 \\
-\hline 37 & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/ff9d61b343971ca964ca5e2708253abe3dad4dab}{Fixed layout.} & 1 & 9 & 5 \\
-\hline 38 & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/2c128bf3eb4d734a11f3e7ebfdc93c01eafbd6f4}{Taking care about special charters in the commit message.} & 2 & 48 & 10 \\
-\hline 39 & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/7b1683a671fe687ca58f895564341ee4c82a7f7d}{Fixed problem with escaped $\backslash$href.} & 1 & 10 & 3 \\
-\hline 40 & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/6b25666f78ff276bbe161a0a7b659ad0c836aa22}{Made the script prettier with perltidy.} & 1 & 33 & 25 \\
-\hline 41 & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/38698ff91b2253abddacd135e332d9ace5127122}{Also escape the author field.} & 3 & 10 & 10 \\
+\hline 3ff663f & & 2012-08-18 & \href{https://github.com/ypid/typesetting/commit/3ff663fcfbc56662426740cf6bab2a840e320db6}{added template.dtx from http://texhacks.blogspot.de/2011/01/simpler-dtx-template.html} & 2 & 127 & 0 \\
+\hline e9fc9a2 & & 2012-08-19 & \href{https://github.com/ypid/typesetting/commit/e9fc9a2847fe14067bb3ec8d4e4298ff8806f11f}{made my first changes on the docstrip template} & 2 & 40 & 48 \\
+\hline cbc7bbc & & 2012-08-19 & \href{https://github.com/ypid/typesetting/commit/cbc7bbcdda54f7b43f2039531d2a4f58c35f8964}{optimized} & 1 & 5 & 4 \\
+\hline 55d994c & & 2012-08-22 & \href{https://github.com/ypid/typesetting/commit/55d994c391c509897dd56a6a755c51a1e62bd4d4}{optimized} & 1 & 17 & 13 \\
+\hline 933466b & & 2012-08-23 & \href{https://github.com/ypid/typesetting/commit/933466b223d70adeda6a865b4b13b4cdfa245070}{added my primary template} & 6 & 252 & 6 \\
+\hline 5995d70 & & 2012-08-23 & \href{https://github.com/ypid/typesetting/commit/5995d70f82b680d3a529aa592558dcdde6f407b7}{added PDFs} & 2 & 0 & 0 \\
+\hline 7e1efb2 & & 2012-08-23 & \href{https://github.com/ypid/typesetting/commit/7e1efb265b43fb9aad3fa94b22408951076016f3}{added README (Credits)} & 1 & 1 & 0 \\
+\hline 619a7f6 & & 2012-08-26 & \href{https://github.com/ypid/typesetting/commit/619a7f6db915bc1e05d0c9ee374aaff53195b257}{converted template.dtx and template.ins to a template for sty2dtx} & 7 & 49 & 62 \\
+\hline 06f9481 & & 2012-08-27 & \href{https://github.com/ypid/typesetting/commit/06f948149a3b0bd2c81062078add19af6bb1ac5d}{optimized} & 6 & 48 & 22 \\
+\hline 09316b5 & & 2012-08-27 & \href{https://github.com/ypid/typesetting/commit/09316b528dc90f45fa4ef6cf9cf5886c4e25c5bb}{added scripts} & 6 & 222 & 0 \\
+\hline 4c434dc & & 2012-08-27 & \href{https://github.com/ypid/typesetting/commit/4c434dcd45aa4a73112b1393d096776eaa938b83}{added README for scripts} & 1 & 10 & 0 \\
+\hline 794a3db & & 2012-08-27 & \href{https://github.com/ypid/typesetting/commit/794a3db5bd4f0165a347f0628c78f32350731b2a}{optimized scripts} & 4 & 9 & 6 \\
+\hline 7c80a54 & & 2012-08-28 & \href{https://github.com/ypid/typesetting/commit/7c80a541828c3e7896c7f55c8b56d745b84a5414}{added MyPackages} & 22 & 1162 & 2 \\
+\hline b408bc9 & & 2012-08-28 & \href{https://github.com/ypid/typesetting/commit/b408bc9fa5f91ff5a7687fc4903d520ab09a288d}{added my Makefile} & 5 & 106 & 0 \\
+\hline d86bd28 & & 2012-08-28 & \href{https://github.com/ypid/typesetting/commit/d86bd28e3f0d0e14d7eb239eb6ad9afab2da47c0}{added more scripts} & 4 & 1465 & 0 \\
+\hline ab0554c & & 2012-08-28 & \href{https://github.com/ypid/typesetting/commit/ab0554ce8d44852a76b7ad0246e04268b8347acb}{optimized} & 5 & 4 & 1459 \\
+\hline 75a5b9d & & 2012-08-31 & \href{https://github.com/ypid/typesetting/commit/75a5b9d653b2798a9cb8f10535f50abf98e94cd2}{optimized} & 7 & 52 & 31 \\
+\hline 2a99a06 & & 2012-09-09 & \href{https://github.com/ypid/typesetting/commit/2a99a061ae89f5bd6bd6ace4aac66ad9a768b0fc}{optimized} & 4 & 23 & 10 \\
+\hline c2463e8 & & 2012-09-16 & \href{https://github.com/ypid/typesetting/commit/c2463e8229fbc506a70b4efb157679ecf3aae795}{optimized} & 6 & 10 & 7 \\
+\hline 1b6cb46 & & 2012-09-23 & \href{https://github.com/ypid/typesetting/commit/1b6cb46337c516e3042d94956e7bf4f097822a47}{added more packages} & 9 & 491 & 12 \\
+\hline 92a41f2 & & 2012-09-23 & \href{https://github.com/ypid/typesetting/commit/92a41f208a275b6fcdfe9c442be8c135ec0d1c92}{added school templates} & 25 & 502 & 25 \\
+\hline 32e2164 & & 2012-09-30 & \href{https://github.com/ypid/typesetting/commit/32e21641dff2ffd9fecfe33b93def53d6a305963}{added more templates} & 20 & 537 & 4 \\
+\hline 2309fa9 & & 2012-11-03 & \href{https://github.com/ypid/typesetting/commit/2309fa9dd41d0acaf74d6de66976f7ae6f1e7c6b}{rewrote LaTeX-git-log as perl script} & 2 & 63 & 61 \\
+\hline 773e5b8 & & 2012-11-03 & \href{https://github.com/ypid/typesetting/commit/773e5b801cfd2ad9a2af8c9d379dd0e2f9afd3cf}{optimized} & 2 & 5 & 4 \\
+\hline 4ffc048 & & 2012-11-28 & \href{https://github.com/ypid/typesetting/commit/4ffc0488959ada2a97ba50d5a7db1390afce4a26}{added more templates and optimized} & 12 & 141 & 3 \\
+\hline dc3b091 & & 2013-04-04 & \href{https://github.com/ypid/typesetting/commit/dc3b091e5e8d68daa1c4b73ab96e7bc201a6ed08}{Updated templates.} & 17 & 92 & 55 \\
+\hline 4576640 & & 2013-04-04 & \href{https://github.com/ypid/typesetting/commit/457664094f33618c62348fe5a9798cc98117bcad}{Added macro for showing the github URL and optimized.} & 8 & 26 & 38 \\
+\hline 71547c9 & & 2013-04-04 & \href{https://github.com/ypid/typesetting/commit/71547c919a2b36548e65320be8ce0d318b473523}{Optimized} & 3 & 36 & 0 \\
+\hline 3681cf7 & & 2013-04-20 & \href{https://github.com/ypid/typesetting/commit/3681cf7bc6d18878ca03af4009bdfc9e8835dbcd}{Optimized.} & 5 & 40 & 12 \\
+\hline c0ef81a & & 2013-04-20 & \href{https://github.com/ypid/typesetting/commit/c0ef81a414620007d6f39fa95e59888045fa5cf0}{Optimized.} & 12 & 67 & 22 \\
+\hline 782b0e0 & & 2013-04-21 & \href{https://github.com/ypid/typesetting/commit/782b0e0e51773b02cf909600444da892c890b926}{Optimized.} & 4 & 30 & 13 \\
+\hline f304845 & & 2013-05-22 & \href{https://github.com/ypid/typesetting/commit/f3048459117aa782b32324bd08ce77bfde325a62}{Optimized (mainly LaTeX-git-wdiff).} & 8 & 205 & 54 \\
+\hline c5c4512 & & 2013-06-15 & \href{https://github.com/ypid/typesetting/commit/c5c45122518ad0e6cf9712dc248b26fd3eea4cf0}{Optimized.} & 3 & 15 & 12 \\
+\hline af3d63d & v1.0 & 2013-06-15 & \href{https://github.com/ypid/typesetting/commit/af3d63d88a8e37c45c4dc7c8b54ee55091f7ea80}{Made latex-git-log ready for CTAN.} & 6 & 482 & 199 \\
+\hline 489927f & & 2013-06-15 & \href{https://github.com/ypid/typesetting/commit/489927feca92be10ddb5bde1b8fb11dae6b37bbb}{Optimized latex-git-log.} & 6 & 12 & 15 \\
+\hline 6d0ff0a & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/6d0ff0a6ae2baba715704f7dea23ebb0ac9ddc02}{Optimized.} & 2 & 53 & 26 \\
+\hline ff9d61b & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/ff9d61b343971ca964ca5e2708253abe3dad4dab}{Fixed layout.} & 1 & 9 & 5 \\
+\hline 2c128bf & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/2c128bf3eb4d734a11f3e7ebfdc93c01eafbd6f4}{Taking care about special charters in the commit message.} & 2 & 48 & 10 \\
+\hline 7b1683a & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/7b1683a671fe687ca58f895564341ee4c82a7f7d}{Fixed problem with escaped $\backslash$href.} & 1 & 10 & 3 \\
+\hline 6b25666 & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/6b25666f78ff276bbe161a0a7b659ad0c836aa22}{Made the script prettier with perltidy.} & 1 & 33 & 25 \\
+\hline 38698ff & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/38698ff91b2253abddacd135e332d9ace5127122}{Also escape the author field.} & 3 & 10 & 10 \\
+\hline 92a1348 & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/92a13483f1d72b15b80a80a0353edaac344d09a2}{Fixed translation and problem with --author.} & 4 & 33 & 17 \\
+\hline 971d92b & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/971d92bd25176270a817fe106010ef7f2db6a4f5}{Fixed spelling.} & 3 & 16 & 15 \\
+\hline 997c10c & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/997c10ca34da6d579ecbc3f6cbeeec2898cb8b17}{Updated README.} & 1 & 3 & 6 \\
+\hline dae8299 & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/dae82997bac80dc9a205e901159cc4ed38678bc1}{Updated README.} & 2 & 8 & 2 \\
+\hline 2c6c975 & & 2013-06-16 & \href{https://github.com/ypid/typesetting/commit/2c6c975b9b4e570155127fffad9d09d819e286b2}{Updated README.} & 1 & 1 & 1 \\
+\hline b452ef3 & & 2013-06-18 & \href{https://github.com/ypid/typesetting/commit/b452ef377e4254584ebd70cf0575a86de75ddd15}{Fixed typo.} & 2 & 2 & 2 \\
+\hline 812516f & & 2013-06-23 & \href{https://github.com/ypid/typesetting/commit/812516f2d3679c80df731968d0ad048e70ecd287}{Optimized MyPackages.} & 5 & 157 & 123 \\
+\hline 28d6d14 & & 2013-06-23 & \href{https://github.com/ypid/typesetting/commit/28d6d149c978a37614a1c3a85e6bb185d9831366}{Enhanced.} & 27 & 176 & 252 \\
+\hline 86c9ef8 & & 2013-06-24 & \href{https://github.com/ypid/typesetting/commit/86c9ef8898b858504417b0ce600eddad4ddcf07a}{Optimized. Now using minted for listings ;)} & 2 & 91 & 9 \\
+\hline 07dd7bc & & 2013-06-29 & \href{https://github.com/ypid/typesetting/commit/07dd7bc664fcf781261f3acb8227e9f65ab07ff4}{Optimized.} & 18 & 49 & 45 \\
+\hline 78e5eb9 & & 2013-07-01 & \href{https://github.com/ypid/typesetting/commit/78e5eb9e5e65efac6f37c887c668a7af5cca1789}{Enhanced.} & 10 & 97 & 78 \\
+\hline d434467 & & 2014-03-04 & \href{https://github.com/ypid/typesetting/commit/d43446790b1f599b4b9603ea6a35ef38c6d89a46}{Committed changes.} & 10 & 50 & 42 \\
+\hline 2c282ba & & 2014-03-24 & \href{https://github.com/ypid/typesetting/commit/2c282badd9181e22bf87d5d7bd1c62b9f340e988}{Optimized.} & 6 & 18 & 9 \\
+\hline 23bcb81 & & 2014-05-14 & \href{https://github.com/ypid/typesetting/commit/23bcb81711a102774651e7a29d19e57a7eeee7b9}{Optimized.} & 4 & 20 & 19 \\
+\hline 0a23f56 & & 2014-05-14 & \href{https://github.com/ypid/typesetting/commit/0a23f5635d4abba9b2aaa85813b25cda3dd2fd09}{Use $\backslash$listoflistings … ($\backslash$lstlistoflistings locks wired in my setting)} & 5 & 21 & 21 \\
+\hline 3c24da4 & & 2014-05-22 & \href{https://github.com/ypid/typesetting/commit/3c24da481eddd7217f5a4a54ac182a32cd37bcd4}{Added testing code for macros …} & 8 & 60 & 40 \\
+\hline eaff441 & & 2014-06-03 & \href{https://github.com/ypid/typesetting/commit/eaff44162c1027cb579a4bf3c894ebb0cc949e81}{Optimized. Fixes git hooks.} & 2 & 3 & 1 \\
+\hline e4d004f & & 2015-02-05 & \href{https://github.com/ypid/typesetting/commit/e4d004f8e12657918d8078299f68e77d71476803}{Enhanced my LaTeX bundles and added support for LuaLaTeX.} & 14 & 214 & 188 \\
+\hline 48bf054 & & 2015-02-06 & \href{https://github.com/ypid/typesetting/commit/48bf054fb8aa82ae9acae2b104e1343e544254a9}{Set new email address.} & 30 & 108 & 109 \\
+\hline f7f1f3c & & 2015-02-06 & \href{https://github.com/ypid/typesetting/commit/f7f1f3cfd3ddee1c55167e7265a70a923a4ab64b}{Enhanced LuaLaTeX compatibility.} & 7 & 35 & 11 \\
+\hline 5017aa0 & & 2015-02-06 & \href{https://github.com/ypid/typesetting/commit/5017aa052d3e93b58b4da31cbcee32f73ea3ea2e}{Fixed up my packages and the Epochenheft template.} & 19 & 173 & 250 \\
+\hline 9b0a20b & & 2015-02-06 & \href{https://github.com/ypid/typesetting/commit/9b0a20b9e00535e507da3acfca7efd75fd508a7f}{Fixed hook.} & 1 & 1 & 1 \\
+\hline 1d1cc01 & & 2015-02-07 & \href{https://github.com/ypid/typesetting/commit/1d1cc0109eb2f1eed704ac6bdaa5c4dfa15e2c8a}{Fixed up template and packages. Added the package authorRS.} & 15 & 77 & 21 \\
+\hline 8525167 & & 2015-02-07 & \href{https://github.com/ypid/typesetting/commit/85251679b1f39bf874649307db1e2f8dcd671747}{Fixed up packages. Use native $\backslash$subject command.} & 4 & 25 & 8 \\
+\hline df826ed & & 2015-02-07 & \href{https://github.com/ypid/typesetting/commit/df826ed8d0c0341dbcc02c17876fc225811bdd6c}{Fixed up acro for LuaLaTeX.} & 4 & 32 & 1 \\
+\hline 4699c6f & & 2015-02-07 & \href{https://github.com/ypid/typesetting/commit/4699c6f84612f410119e64e67b56960ed0dac977}{Fixed up packages.} & 12 & 68 & 33 \\
+\hline cb4e89e & & 2015-02-11 & \href{https://github.com/ypid/typesetting/commit/cb4e89e28145dff637a9af13e726c0bb8b11440a}{Optimized for final document.} & 8 & 58 & 5 \\
+\hline 5d61a8f & & 2015-02-11 & \href{https://github.com/ypid/typesetting/commit/5d61a8fc1bf1a3193dc03b442293299ef9f50ced}{Optimized.} & 3 & 18 & 2 \\
+\hline 8fb9e99 & & 2015-02-11 & \href{https://github.com/ypid/typesetting/commit/8fb9e9912fdb76c11651516d2d17cfec6be68cb7}{Merge branch 'luaLaTeX'.} & - & - & - \\
+\hline f352a8f & & 2015-02-11 & \href{https://github.com/ypid/typesetting/commit/f352a8fe35c4a93a3d239b5dd755d3335957e9c4}{Optimized.} & 9 & 112 & 85 \\
+\hline a6429ca & & 2015-02-11 & \href{https://github.com/ypid/typesetting/commit/a6429ca856fcdfa010861001b80528333de16cba}{Enabled hooks for this repo.} & 1 & 1 & 0 \\
+\hline 1d398ca & & 2015-02-11 & \href{https://github.com/ypid/typesetting/commit/1d398cac05aa7c0be07139b30e8549c0bfb75544}{Added README.md.} & 3 & 4 & 1 \\
+\hline fcecad4 & & 2015-02-13 & \href{https://github.com/ypid/typesetting/commit/fcecad42d65fad16e7d86a6f1b94ff94d58d0ee5}{Optimized.} & 10 & 73 & 31 \\
+\hline 60ed275 & & 2015-02-28 & \href{https://github.com/ypid/typesetting/commit/60ed275b248d08ba1f5158552db2b31b4ccaf68b}{Optimized typography based on LaTeX für Studierende und Wissenschaftler.} & 12 & 121 & 32 \\
+\hline 848c689 & & 2015-02-28 & \href{https://github.com/ypid/typesetting/commit/848c689cdb6d1a19933e3d5c348cfd3090bae747}{Fixed encoding of Unicode in PDF bookmarks.} & 4 & 2 & 7 \\
+\hline 0fdd501 & & 2015-02-28 & \href{https://github.com/ypid/typesetting/commit/0fdd50162acc66341e9e89291b247f0e37516cec}{Optimized.} & 16 & 151 & 72 \\
+\hline 343d887 & & 2015-02-28 & \href{https://github.com/ypid/typesetting/commit/343d8873e5ebe25449548f69aee587e07aed151d}{Fixed up letter template.} & 8 & 43 & 15 \\
+\hline 889175a & & 2015-03-05 & \href{https://github.com/ypid/typesetting/commit/889175a7db49b5d43a20c212a90e5aadec5f953b}{Optimized packages.} & 4 & 19 & 13 \\
+\hline 087ec11 & & 2015-03-25 & \href{https://github.com/ypid/typesetting/commit/087ec11ee218690b9a73face011878e811263377}{Optimized for moderncv.} & 12 & 131 & 116 \\
+\hline e9eaaa5 & & 2015-04-05 & \href{https://github.com/ypid/typesetting/commit/e9eaaa5736d2e4020d670d3b860cb9968a0f2fba}{Fixed English language code.} & 2 & 6 & 2 \\
+\hline 753afd6 & & 2015-04-08 & \href{https://github.com/ypid/typesetting/commit/753afd6bb0f28c70b5f12c017814371ccb728272}{Use ((( ))) as fold marker.} & 1 & 8 & 8 \\
+\hline c0247ea & & 2015-04-08 & \href{https://github.com/ypid/typesetting/commit/c0247ea085a45a9ae2ed56ecaadc81355632db5e}{Hyperref should be loaded after most packages. But hyperxmp should be loaded after.} & 1 & 3 & 1 \\
+\hline d6f3e50 & & 2015-05-16 & \href{https://github.com/ypid/typesetting/commit/d6f3e50f0c134e42fa994d5544f6580d33c7c1c8}{Optimized.} & 3 & 7 & 2 \\
+\hline 535c7de & & 2015-05-20 & \href{https://github.com/ypid/typesetting/commit/535c7dec92682c4eadcaee1340b0fdec28d39a28}{Added acronymRS removed ctr files and optimized literature and others.} & 27 & 455 & 123 \\
+\hline 4c92122 & & 2015-05-24 & \href{https://github.com/ypid/typesetting/commit/4c92122decb454e876e1791b3ae1e67f4a5c75f7}{Optimized packages. Added acronyms, fixed literatureRS. Coped TeXinfoRS.} & 13 & 273 & 42 \\
+\hline 5bc68b0 & & 2015-05-24 & \href{https://github.com/ypid/typesetting/commit/5bc68b0ab50912c9070f74b533585b07cc3ed078}{Optimized references in the document.} & 4 & 26 & 8 \\
+\hline 66dfa73 & & 2015-05-25 & \href{https://github.com/ypid/typesetting/commit/66dfa73c3a531fdf2b97f4d9975d0646a49ab161}{Optimized references in the text further.} & 3 & 26 & 12 \\
+\hline 396332c & & 2015-05-25 & \href{https://github.com/ypid/typesetting/commit/396332c368786b99d0c377c9584ecab333fe45e0}{Added default license to the project.} & 1 & 4 & 0 \\
+\hline 0cb789b & & 2015-05-25 & \href{https://github.com/ypid/typesetting/commit/0cb789b5de0f57dd4770cc0b33c1064a6ccba94d}{Optimized. Fixed a few warnings.} & 11 & 73 & 19 \\
+\hline ff07dad & & 2015-05-25 & \href{https://github.com/ypid/typesetting/commit/ff07dade58ca31b6add898fc584d73d3fddd0776}{Fixed spacing after refer to macros.} & 1 & 4 & 4 \\
+\hline be2ca4d & & 2015-05-26 & \href{https://github.com/ypid/typesetting/commit/be2ca4d5d361ff5e536d6964a131d13c3d4f5b55}{Fixed up my packages for twoside print. It messed up my draft print :(} & 3 & 9 & 4 \\
+\hline faa3eea & & 2015-05-26 & \href{https://github.com/ypid/typesetting/commit/faa3eeaf213ebf6747c5a68c7e8b64c638db0009}{Fixed typo.} & 1 & 1 & 1 \\
+\hline c2d15ea & & 2015-05-27 & \href{https://github.com/ypid/typesetting/commit/c2d15ea2b7a84867deebfe6786277a61bdc139f7}{Optimized.} & 4 & 13 & 3 \\
+\hline eecd0ea & & 2015-05-27 & \href{https://github.com/ypid/typesetting/commit/eecd0ea5a2647ba47ab2c2fc71fe5e999573032d}{Made tables look nicer in print.} & 1 & 3 & 1 \\
+\hline 95126ec & & 2015-05-28 & \href{https://github.com/ypid/typesetting/commit/95126ecaa1d48056fc925abc1a1e239b44edd4ca}{Added acronyms and forced isodate to use german as default language.} & 4 & 45 & 9 \\
+\hline 22adff8 & & 2015-05-28 & \href{https://github.com/ypid/typesetting/commit/22adff897223ea40efba41208af032cbb02f8c62}{Fixed release critical bugs :)} & 4 & 26 & 7 \\
+\hline c655ba2 & v2.0 & 2015-05-28 & \href{https://github.com/ypid/typesetting/commit/c655ba2046a65613d267a0e3734b5f98f49d5f45}{Added new Makefile for LaTeX projects.} & 4 & 53 & 82 \\
+\hline beea9b8 & & 2015-06-07 & \href{https://github.com/ypid/typesetting/commit/beea9b8a0d6f38a4a9e93b788618a24045732d4d}{Removed LPPL license.} & 1 & 0 & 15 \\
+\hline 69c0326 & & 2015-06-07 & \href{https://github.com/ypid/typesetting/commit/69c03266945f16253e5b3fefe09c6eeb08f0898f}{Optimized my packages for working with letters.} & 5 & 78 & 65 \\
+\hline 82e04e2 & & 2015-06-21 & \href{https://github.com/ypid/typesetting/commit/82e04e29efeeda55760c0531f0f79b77116fded6}{Fixed up beamer template.} & 11 & 387 & 213 \\
+\hline 4848209 & & 2015-06-21 & \href{https://github.com/ypid/typesetting/commit/4848209c7a69582944332e14f0419e44de5ddf19}{Created my own beamer style.} & 8 & 107 & 62 \\
+\hline c5681ea & & 2015-06-22 & \href{https://github.com/ypid/typesetting/commit/c5681ea9ebccbde05a7f1f3dd4e25d5aee2a247d}{Fixed layout bug in my slides.} & 2 & 122 & 5 \\
+\hline fdc127a & & 2015-07-20 & \href{https://github.com/ypid/typesetting/commit/fdc127a83c75e189e526c3caed2ff9ad753eb286}{Updated. Making old chemistry documents work again.} & 6 & 184 & 41 \\
+\hline 3b9114b & & 2015-09-01 & \href{https://github.com/ypid/typesetting/commit/3b9114b22434f0b24a8b4a1c2daaef74268c9228}{Optimized.} & 3 & 11 & 6 \\
+\hline c68e656 & & 2015-12-10 & \href{https://github.com/ypid/typesetting/commit/c68e65600b3cdf0d7e99f25d0e4181dd40ef197c}{Improved latex-optimize-text a bit and tried URL regex stuff.} & 4 & 17 & 5 \\
+\hline 6258007 & & 2017-02-16 & \href{https://github.com/ypid/typesetting/commit/625800737b800725c9ac4efb8b875e4032f4078e}{Evolve} & 8 & 75 & 51 \\
+\hline 92fe6b5 & & 2017-04-26 & \href{https://github.com/ypid/typesetting/commit/92fe6b5dabbfe7ba28ff77bc7e73c21214c70c6d}{Optimize MyPackages} & 7 & 26 & 25 \\
+\hline 6b37fcc & & 2017-10-08 & \href{https://github.com/ypid/typesetting/commit/6b37fcc7dbe70aec3de054f95a4bce25932985e9}{No more legacy date formats. ISO 8601 is an international standard.} & 1 & 5 & 5 \\
+\hline a1cfa47 & & 2017-11-13 & \href{https://github.com/ypid/typesetting/commit/a1cfa47484f2232b589e8a3f3805a539ee20d1b7}{specify git revision range} & 2 & 6 & 0 \\
+\hline f95c860 & & 2017-11-13 & \href{https://github.com/ypid/typesetting/commit/f95c860585111290ac5dc3685c9d72226e8d69d0}{Align command line option variables} & 1 & 7 & 7 \\
+\hline 565872f & & 2017-11-13 & \href{https://github.com/ypid/typesetting/commit/565872fdc58731167cbf73975325435bf8c5145d}{Merge branch '\#1'} & - & - & - \\
+\hline 3af2ecd & & 2018-05-28 & \href{https://github.com/ypid/typesetting/commit/3af2ecdc13baa29772324d40e1ba4582a192dfac}{TOC: Link from both: The section label and the page number.} & 1 & 1 & 0 \\
+\hline 27e1441 & & 2019-02-13 & \href{https://github.com/ypid/typesetting/commit/27e14417b30e91e48777567d2fcdcb3ac51b7f78}{change latex-git-log to cover merge commits} & 1 & 14 & 4 \\
+\hline 258a37d & & 2019-02-13 & \href{https://github.com/ypid/typesetting/commit/258a37d98c192f82012bb5a3425218d472b677af}{restore confusion with tags} & 1 & 2 & 2 \\
+\hline 21e32d5 & & 2019-02-13 & \href{https://github.com/ypid/typesetting/commit/21e32d57d373bf9a831ff2a6c7d31091227d9050}{repair getting tags} & 1 & 4 & 3 \\
+\hline 239d959 & & 2019-04-07 & \href{https://github.com/ypid/typesetting/commit/239d95916f60e7fea6fbf32363b4757a28aa5e91}{Make git tag parsing more robust} & 1 & 4 & 2 \\
+\hline f98f16a & & 2019-04-07 & \href{https://github.com/ypid/typesetting/commit/f98f16a34f006a07803350ea1b73a64584fa6e97}{Remove space introduced in \#2} & 1 & 1 & 1 \\
+\hline d345341 & & 2019-05-27 & \href{https://github.com/ypid/typesetting/commit/d345341bd4937e6cbc904c2782c61be31e8a9678}{Move latex-rm-tmpfiles from my scripts repo to this one} & 1 & 5 & 0 \\
+\hline 93b1ec2 & & 2019-05-27 & \href{https://github.com/ypid/typesetting/commit/93b1ec27a9776c7226cbbc1857bc456f33153edd}{Use updated license SPDX identifier} & 2 & 2 & 2 \\
+\hline abb549e & & 2019-05-27 & \href{https://github.com/ypid/typesetting/commit/abb549e71d92f13fa835e8a0d5ad63ddb1ff4b2e}{Don’t require calctime which is not public} & 1 & 1 & 1 \\
+\hline 22efbf1 & & 2019-05-27 & \href{https://github.com/ypid/typesetting/commit/22efbf199a379cd0cb09970f7bfc56274ef85b37}{Don’t load private package authorRobinRS by default} & 2 & 1 & 1 \\
+\hline bbebfbb & & 2019-05-27 & \href{https://github.com/ypid/typesetting/commit/bbebfbb96859f767e26d9f543532c960819cb375}{Don’t load slashbox which is not in TexLive 2016} & 1 & 1 & 1 \\
+\hline b40d5cb & & 2019-05-27 & \href{https://github.com/ypid/typesetting/commit/b40d5cbb7ecdf573f4a20a1f761fd2d4e08cd6ff}{Make acronymRS compatible with acro v2.7} & 1 & 27 & 34 \\
+\hline 11e3514 & & 2019-05-27 & \href{https://github.com/ypid/typesetting/commit/11e3514b0153cf01f7522fb502f63434037ad33c}{hyphsubst is not needed for LuaLaTeX} & 1 & 8 & 4 \\
+\hline 4bae2cb & & 2019-09-04 & \href{https://github.com/ypid/typesetting/commit/4bae2cbb59aec4a6399970d11a22221eaccb0ab1}{Support to use $\backslash$Anschrift directly in letters} & 1 & 2 & 2 \\
+\hline ec4ad7d & & 2019-09-04 & \href{https://github.com/ypid/typesetting/commit/ec4ad7de54dd3497c7ef20f5d7dfa6ed084a47f1}{RFC 3339/ISO 8201 overwrites DIN norm when it comes to dates} & 1 & 3 & 2 \\
+\hline e9a422c & & 2019-04-07 & \href{https://github.com/ypid/typesetting/commit/e9a422c028b4819ec539bd8fecafeccf64904fd1}{Remove git repo url auto detect and href disable. href is now opt-in.} & 1 & 3 & 17 \\
+\hline 653096c & & 2020-01-26 & \href{https://github.com/ypid/typesetting/commit/653096ccc55a4380de64a64355ba180ad76bc6a0}{Merge branch '\#2'. Closes \#4.} & - & - & - \\
+\hline 087b27b & & 2020-02-26 & \href{https://github.com/ypid/typesetting/commit/087b27b6c43b1771ecb015e47f2436b480f95e0d}{Fix latex-git-log documentation} & 2 & 13 & 7 \\
+\hline 35437de & & 2020-02-26 & \href{https://github.com/ypid/typesetting/commit/35437def862b666d4c21b7df61b6e21e98150374}{Calling --help should also output Synopsis} & 1 & 4 & 3 \\
+\hline 95549c6 & latex-git-log/v1.0.0 & 2020-02-26 & \href{https://github.com/ypid/typesetting/commit/95549c6bf98962170d3caee8552d6fa58715e5da}{Release version 1.0.0 of latex-git-log} & 1 & 1 & 1 \\
+\hline 23bef58 & & 2024-03-20 & \href{https://github.com/ypid/typesetting/commit/23bef58ed102850dcfad56464e739ccb33227714}{latex-git-log: Add file arguments} & 2 & 12 & 2 \\
+\hline 51be3d0 & & 2024-04-17 & \href{https://github.com/ypid/typesetting/commit/51be3d03735a1bb6f4d2e1cbe63ac6ccf8fef72a}{Merge branch '\#5'} & - & - & - \\
+\hline 72f0882 & & 2024-05-19 & \href{https://github.com/ypid/typesetting/commit/72f08826873fd1263b3d2f9c2c48466d3300934c}{fix: lower case LaTeX-git-log to remove pain for macOS and Windows users} & 9 & 2 & 2 \\
+\hline 852d74c & & 2024-05-19 & \href{https://github.com/ypid/typesetting/commit/852d74c620d608bc2a59737ecd0b0225f40970a9}{chore(latex-git-log): start to follow https://reuse.software/} & 4 & 245 & 2 \\
+\hline 6058f64 & & 2024-05-19 & \href{https://github.com/ypid/typesetting/commit/6058f64889abd60b9c001054bde50813236d8b1d}{chore: drop outdated git hook templates} & 5 & 0 & 24 \\
+\hline 724ea64 & & 2024-05-19 & \href{https://github.com/ypid/typesetting/commit/724ea647f0aea74925f721f3a8215f4aa66c5b05}{build(latex-git-log): use commitizen for release management} & 2 & 14 & 5 \\
+\hline 98fb3b1 & & 2024-05-19 & \href{https://github.com/ypid/typesetting/commit/98fb3b1cf71101d0012b85cfb6211f75dd1b8db9}{chore: extend .gitignore file for bazel.build} & 1 & 16 & 0 \\
+\hline 84d9df5 & & 2024-05-20 & \href{https://github.com/ypid/typesetting/commit/84d9df575a7918619051ffd8a6c0c8851a829594}{fix(latex-git-log): --user and --repo flags where not included in URL} & 1 & 1 & 1 \\
+\hline 366fc89 & & 2024-05-19 & \href{https://github.com/ypid/typesetting/commit/366fc89342d611b5ac11a5a3a036586451318113}{build(latex-git-log): start using Bazel build system} & 19 & 3933 & 18 \\
+\hline 9286ca6 & & 2024-05-29 & \href{https://github.com/ypid/typesetting/commit/9286ca6535ad3c02fa26ee241abb6d4accbd77ed}{build: get aspect-correctness.bazelrc file} & 1 & 75 & 0 \\
+\hline 0120766 & & 2024-05-26 & \href{https://github.com/ypid/typesetting/commit/01207665460cf9108bfa17594a196867216da55e}{build(latex-git-log): finish setting up Bazel build system} & 11 & 231 & 1418 \\
+\hline 3cd73f8 & & 2024-05-29 & \href{https://github.com/ypid/typesetting/commit/3cd73f8d353cbe36ed96b6dbbfb0de2d7a6c30ef}{build(latex-git-log): remove genrule\_stamped.bzl experiment} & 1 & 0 & 27 \\
+\hline a2fe127 & & 2024-05-29 & \href{https://github.com/ypid/typesetting/commit/a2fe12786b6485a4a7288f1aab26afe4c2494d63}{build(latex-git-log): drop Taskfile.yml, it is too limited} & 1 & 0 & 30 \\
+\hline aa05c17 & & 2024-05-29 & \href{https://github.com/ypid/typesetting/commit/aa05c177cd3baf0a6a12f5ac9d2aecb3b23271f8}{build: use commitizen to check commit messages} & 1 & 9 & 0 \\
+\hline 8dd67eb & & 2024-05-29 & \href{https://github.com/ypid/typesetting/commit/8dd67eb9671cd239c3981479f9b4fd60a0ab74a1}{chore: make new files reuse.software compliant} & 2 & 12 & 0 \\
+\hline 8ad9824 & & 2024-05-29 & \href{https://github.com/ypid/typesetting/commit/8ad9824e30d54ad7a0d907614d28a7e6cb9aac07}{chore(latex-git-log): make reuse.software compliant} & 4 & 21 & 1 \\
+\hline b920b12 & & 2024-05-29 & \href{https://github.com/ypid/typesetting/commit/b920b12c04122cbadc052ccc4317ab197940f4a4}{style(latex-git-log): TeX code comments are introduced by one \%, not two} & 1 & 2 & 2 \\
+\hline 8ab96f4 & & 2024-05-29 & \href{https://github.com/ypid/typesetting/commit/8ab96f41efe17743b5bb0d1967df232c291addd8}{feat(latex-git-log): make generated file reuse.software compliant} & 1 & 6 & 1 \\
+\hline a7eb636 & & 2024-05-29 & \href{https://github.com/ypid/typesetting/commit/a7eb6364ab40b79c6e1a49a02243b516439a68d7}{chore: ensure text of all used licenses are included} & 3 & 203 & 0 \\
+\hline db1869f & & 2024-05-31 & \href{https://github.com/ypid/typesetting/commit/db1869f27961af46d7a73cdd0bde3cc1b03c8e20}{docs(latex-git-log): mention that script is in Perl} & 2 & 2 & 2 \\
+\hline c029c99 & & 2024-05-31 & \href{https://github.com/ypid/typesetting/commit/c029c99427424d53d728db46c785f39bd3cca5c6}{docs(latex-git-log): drop German version of GPL from manpage} & 1 & 0 & 13 \\
+\hline faeaae7 & & 2024-05-31 & \href{https://github.com/ypid/typesetting/commit/faeaae7b2b7d3dcb844fb3e376824313b03aef15}{chore(latex-git-log): copyright years in script need to be in sync} & 1 & 1 & 1 \\
+\hline 474e980 & & 2024-05-31 & \href{https://github.com/ypid/typesetting/commit/474e980e1f8e5fa36b7782095d383101827abb13}{docs(latex-git-log): note that only English works to known bugs} & 2 & 14 & 0 \\
+\hline 4e8a7ed & & 2024-05-31 & \href{https://github.com/ypid/typesetting/commit/4e8a7edb69e6a02178dd6d81948a7120b8caaa20}{docs(latex-git-log): fix typo} & 2 & 2 & 2 \\
+\hline 07d3a7e & & 2024-05-31 & \href{https://github.com/ypid/typesetting/commit/07d3a7e838beeb5737d1506fedfa28288b03956d}{fix(latex-git-log): print commit hash instead of artificial version} & 3 & 14 & 17 \\
+\hline 422272d & & 2024-05-31 & \href{https://github.com/ypid/typesetting/commit/422272dcdf41b36c51d856b0005b70551102f059}{build(latex-git-log): SOURCE\_DATE\_EPOCH from env has precedence} & 1 & 4 & 2 \\
+\hline 3cdf233 & & 2024-05-31 & \href{https://github.com/ypid/typesetting/commit/3cdf2337c930b9446bacf51ccef880434c1596ad}{chore(latex-git-log): regenerate example.tex} & 1 & 167 & 47 \\
+\hline e7dda12 & & 2024-05-31 & \href{https://github.com/ypid/typesetting/commit/e7dda1265766365bf5e13668734a8f9768d9c14f}{Merge branch 'bump/latex-git-log/v1.1.0'} & - & - & - \\
+\hline 84d7a6c & HEAD -> master, latex-git-log/v1.1.0 & 2024-05-31 & \href{https://github.com/ypid/typesetting/commit/84d7a6c64cd4c962fff02a04638b793ce50d19f2}{bump(latex-git-log): version 1.0.0 → 1.1.0} & 2 & 2 & 2 \\
\end{longtable}
diff --git a/support/latex-git-log/example.pdf b/support/latex-git-log/example.pdf
index 54c9c6093e..ecccf4777e 100644
--- a/support/latex-git-log/example.pdf
+++ b/support/latex-git-log/example.pdf
Binary files differ
diff --git a/support/latex-git-log/example.tex b/support/latex-git-log/example.tex
index fec2a0e31f..7527e47673 100644
--- a/support/latex-git-log/example.tex
+++ b/support/latex-git-log/example.tex
@@ -1,8 +1,38 @@
-\documentclass[12pt,a4paper,english,landscape]{scrartcl}
+% SPDX-FileCopyrightText: 2013,2020,2024 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: GPL-3.0-or-later
+
+\documentclass[
+ a4paper,
+ ngerman,
+ landscape,
+ DIV=15,
+]{scrartcl}
+
+\usepackage{
+ iftex,
+}
+
+\ifPDFTeX%
+ \usepackage[utf8]{inputenc}
+ \usepackage[T1]{fontenc}
+ \usepackage{babel}
+\fi
+\ifLuaTeX%
+ \usepackage{
+ fontspec,
+ polyglossia,
+ }
+\fi
+
+\ifLuaTeX%
+ \usepackage{selnolig}
+\fi
+
+\usepackage[
+ tracking=true,
+]{microtype}
-\usepackage[utf8]{inputenc}
-\usepackage[T1]{fontenc}
-\usepackage{babel}
\usepackage{longtable,hyperref}
\newcommand{\longtableendfoot}{Please continue at the next page}
@@ -11,7 +41,7 @@
The example-output.tex was generated with this command:
\begin{verbatim}
- latex-git-log --width=13 --lang=en > example-output.tex
+ latex-git-log --user ypid --repo typesetting --width=12 --lang=en > example-output.tex
\end{verbatim}
\end{document}
diff --git a/support/latex-git-log/latex-git-log b/support/latex-git-log/latex-git-log
index 35d831b6eb..3cce9ef9b8 100755
--- a/support/latex-git-log/latex-git-log
+++ b/support/latex-git-log/latex-git-log
@@ -1,4 +1,6 @@
#!/usr/bin/env perl
+# SPDX-FileCopyrightText: 2012-2013,2017,2019-2020,2024 Robin Schneider <ypid@riseup.net>
+#
# SPDX-License-Identifier: GPL-3.0-or-later
# Modules and pragmas {{{
@@ -8,6 +10,7 @@ use autodie;
use feature qw(say);
use utf8;
use open qw(:std :utf8);
+use English;
binmode STDOUT, ':encoding(UTF-8)';
use IPC::System::Simple qw(capturex);
use Getopt::Long;
@@ -31,7 +34,6 @@ use Locale::Maketext::Simple (
# Optional parameters {{{
my $print_author = 0;
-my $commit_count = 1;
my $width = 0;
my $lang = undef;
my $version = 0;
@@ -41,7 +43,6 @@ my $revision_range = 0;
my ( $git_user, $git_repo, $git_commit_address );
GetOptions(
'author' => \$print_author,
- 'startcommit=s' => \$commit_count,
'width=s' => \$width,
'git-c-add=s' => \$git_commit_address,
'user=s' => \$git_user,
@@ -58,14 +59,19 @@ pod2usage( -verbose => 99, -sections => 'Version' ) if $version;
my $git_remote = ( split /\n/xms, capturex(qw(git remote -v)) )[0];
loc_lang($lang) if ( defined $lang );
-say '%% This file was generated by the script latex-git-log';
+my $committer_year_of_last_commit = ( split /\n/xms, capturex('git', '--no-pager', 'log', '-1', '--pretty=%cd', '--date=format:%Y') )[0];
+say "% SPDX-FileCopyrightText: $committer_year_of_last_commit Robin Schneider <ypid\@riseup.net>
+%
+% SPDX-License-Identifier: CC0-1.0 OR MIT
+
+% This file was generated by the script latex-git-log.";
my $git_command_commit_msg = '%s';
if ( (defined $git_user and defined $git_repo) or $git_commit_address ) {
unless ( defined $git_commit_address ) {
- $git_commit_address = "https://github.com/$+{user}/$+{repo}/commit";
+ $git_commit_address = "https://github.com/$git_user/$git_repo/commit";
}
$git_command_commit_msg = '%H & %s';
- say '%% Base git commit URL: ' . $git_commit_address;
+ say '% Base git commit URL: ' . $git_commit_address;
}
if ($width) {
$width = "p{${width}cm}";
@@ -79,7 +85,7 @@ else {
say '\begin{tabular}{lp{12cm}}
\label{tabular:legend:git-log}
\textbf{' . loc('acronym') . '} & \textbf{' . loc('meaning') . '} \\\\
- V & \texttt{' . loc('version') . '} \\\\
+ H & \texttt{' . loc('commit hash') . '} \\\\
' . loc('tag') . ' & ' . loc('\texttt{git tag}') . ' \\\\
' . loc('MF') . ' & ' . loc('Number of \texttt{modified files}.') . ' \\\\
' . loc('AL') . ' & ' . loc('Number of \texttt{added lines}.') . ' \\\\
@@ -87,8 +93,11 @@ say '\begin{tabular}{lp{12cm}}
\end{tabular}
\bigskip
+';
-\iflanguage{ngerman}{\shorthandoff{"}}{}';
+# Users should set this themselves if they need it because it can cause build errors like:
+# Undefined control sequence.
+# \iflanguage{ngerman}{\shorthandoff{"}}{}';
if ($print_author) {
say "\\begin{longtable}{|rllllrrr|}";
@@ -96,7 +105,7 @@ if ($print_author) {
else {
say "\\begin{longtable}{|rll${width}rrr|}";
}
-say '\hline \multicolumn{1}{|c}{\textbf{' . loc('V') . '}} & \multicolumn{1}{c}{\textbf{' . loc('tag') . '}}';
+say '\hline \multicolumn{1}{|c}{\textbf{' . loc('H') . '}} & \multicolumn{1}{c}{\textbf{' . loc('tag') . '}}';
say '& \multicolumn{1}{c}{\textbf{' . loc('author') . '}}' if $print_author;
say '& \multicolumn{1}{c}{\textbf{' . loc('date') . '}}
& \multicolumn{1}{c}{\textbf{' . loc('commit message') . '}} & \multicolumn{1}{c}{\textbf{' . loc('MF') . '}}
@@ -122,19 +131,25 @@ say '\endfoot
my @lines;
my @git_command = qw(git log --date=short --shortstat);
if ($print_author) {
- push( @git_command, qq(--pretty=format:%H & %an NoTinAuthorFiled& %ad & $git_command_commit_msg) );
+ push( @git_command, qq(--pretty=format:%h & %an NoTinAuthorFiled& %ad & $git_command_commit_msg) );
}
else {
- push( @git_command, qq(--pretty=format:%H %ad & $git_command_commit_msg) );
+ push( @git_command, qq(--pretty=format:%h %ad & $git_command_commit_msg) );
}
if ($revision_range) {
push( @git_command, qq($revision_range) );
}
+
+# check for command-line file arguments
+if ($#ARGV >= 0) {
+ push( @git_command, ("--", @ARGV) );
+}
+
@lines = reverse capturex(@git_command);
# }}}
# Get tags {{{
-my @tags_commits = capturex( 'git', 'log', '--tags', '--no-walk', '--pretty=\'%H %d\'' );
+my @tags_commits = capturex( 'git', 'log', '--tags', '--no-walk', '--pretty=\'%h %d\'' );
my %commit_tags; # The key will be a SHA1 commit hash and the value a comma separated list of all tags.
for (@tags_commits) {
chomp;
@@ -185,12 +200,13 @@ my @changes;
for (@lines) {
next if /\A\Z/xms;
chomp;
- if ( m/^([0-9a-f]{40})\s/g and !$which_line) {
+ if ( m/^([0-9a-f]{7,})\s/g and !$which_line) {
$which_line ^= 1; ## additional toggle for merge commits
@changes = ( "-", "-", "-" );
}
if ($which_line) {
- s/\A([0-9a-f]{40})\s//xms or die "Did not match the commit hash\n";
+ s/\A(?<short_commit_hash>[0-9a-f]{7,})\s//xms or die "Did not match the commit hash\n";
+ my $short_commit_hash = $LAST_PAREN_MATCH{short_commit_hash};
my $tags = exists $commit_tags{$1} ? $commit_tags{$1} : q();
my $date_author = '';
my $c_msg = '';
@@ -211,8 +227,7 @@ for (@lines) {
else {
$c_msg = latex_escape($c_msg);
}
- say "\\hline $commit_count & $tags & $date_author $c_msg & " . join( ' & ', @changes ) . ' \\\\';
- $commit_count++;
+ say "\\hline $short_commit_hash & $tags & $date_author $c_msg & " . join( ' & ', @changes ) . ' \\\\';
} ## end if ($which_line)
else {
@changes = ( 0, 0, 0 );
@@ -235,12 +250,11 @@ latex-git-log - Generates the version history of a git project as LaTeX source c
=head1 Synopsis
-latex-git-log [options]
+latex-git-log [options] [file] ...
Options:
--author set this if you want the author included
- --startcommit set the start value of count commit
--width set the width in cm of the commit message field in the LaTeX table
--git-c-add set an base URL to link to a commit
--user set a github user to derive the base URL
@@ -291,7 +305,7 @@ You can use it like this:
=head2 Of this script
-This module requires these other modules and libraries:
+This script requires the following Perl modules:
IPC::System::Simple
Locale::Maketext::Simple
@@ -306,13 +320,15 @@ be loaded.
Furthermore you need to defined the macro B<\longtableendfoot> which will be
expanded on the bottom of every page if the table will be continued on the next
-page. You can defined it to a localized message to inform the reader that this
+page. You can define it to a localized message to inform the reader that this
table is not complete and will be continued.
=head1 Description
B<This program> will output the entire version history as table written in
LaTeX if it is executed within a git repository.
+When I<file> argument(s) are given, only the history that changed these file(s)
+will be output.
It is intended that you redirect the standard output of this script to a file
which can then be included from your main LaTeX document.
@@ -322,7 +338,7 @@ landscape page.
=head1 Version
-1.0.0
+1.1.0
=head1 Author
@@ -336,9 +352,19 @@ Source code repository: https://github.com/ypid/typesetting/tree/master/scripts/
Please report bugs and feature requests at https://github.com/ypid/typesetting/issues
+=head1 Bugs and limitations
+
+=over 4
+
+=item
+
+The translation features does not seem to work. So this script is unable to output German. English works.
+
+=back
+
=head1 License and Copyright
-Copyright (C) 2012-2013,2017,2019 Robin Schneider <ypid@riseup.net>
+Copyright (C) 2012-2013,2017,2019-2020,2024 Robin Schneider <ypid@riseup.net>
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
@@ -353,18 +379,5 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-Dieses Programm ist Freie Software: Sie können es unter den Bedingungen
-der GNU General Public License, wie von der Free Software Foundation,
-Version 3 der Lizenz oder (nach Ihrer Option) jeder späteren
-veröffentlichten Version, weiterverbreiten und/oder modifizieren.
-
-Dieses Programm wird in der Hoffnung, dass es nützlich sein wird, aber
-OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
-Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
-Siehe die GNU General Public License für weitere Details.
-
-Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
-Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
-
=cut
# }}}
diff --git a/support/latex-git-log/po/de.po b/support/latex-git-log/po/de.po
index 401e7fe172..c9dcdab438 100644
--- a/support/latex-git-log/po/de.po
+++ b/support/latex-git-log/po/de.po
@@ -17,11 +17,11 @@ msgstr "Abkürzung"
msgid "meaning"
msgstr "Bedeutung"
-msgid "version"
-msgstr "Version"
+msgid "commit hash"
+msgstr "Commit Prüfsumme"
-msgid "V"
-msgid "V"
+msgid "H"
+msgid "H"
msgid "tag"
msgstr "Tag"
diff --git a/support/latexdiff/README b/support/latexdiff/README
index 6f4d1a280a..f0310ce32d 100644
--- a/support/latexdiff/README
+++ b/support/latexdiff/README
@@ -1,4 +1,13 @@
+latexdiff
+=========
+
+Compares two latex files and marks up significant differences between them. Releases on https://ctan.org/pkg/latexdiff and mirrors.
+
+Link to full manual: http://mirrors.ctan.org/support/latexdiff/doc/latexdiff-man.pdf
+
+
INTRODUCTION
+------------
latexdiff is a Perl script, which compares two latex files and marks
up significant differences between them (i.e. a diff for latex files).
@@ -16,11 +25,9 @@ behaviour and accept or reject selected changes only.
The author is F Tilmann.
-Project webpage: https://github.com/ftilmann/latexdiff/
-CTAN page: http://www.ctan.org/pkg/latexdiff
-
REQUIREMENTS
+------------
Perl 5.8 or higher must be installed.
The latexdiff script makes use of the Perl package Algorithm::Diff (available
@@ -38,6 +45,7 @@ UNIX-diff mean that the resulting set of differences will generally not be the s
for the standard latexdiff. In most practical cases, these differences are minor, though.
INSTALLATION UNIX/LINUX
+-----------------------
The basic installation procedure is almost trivial:
@@ -53,34 +61,40 @@ The basic installation procedure is almost trivial:
The attached trivial Makefile contains example commands to carry out above
steps as root for a typical UNIX installation. Type
- make install (for the stand alone version)
+ `make install` (for the stand alone version)
+
or
- make install-ext (for the version using the external Algorithm::Diff)
+
+ `make install-ext` (for the version using the external Algorithm::Diff)
+
or
- make install-fast (for the version using the UNIX 'diff' function for fast differencing)
+
+ `make install-fast` (for the version using the UNIX 'diff' function for fast differencing)
to get it rolling. You can type
- make test
-or
- make test-ext
-or
- make test-fast
+ `make test` or
+
+ `make test-ext` or
+
+ `make test-fast`
to test the respective versions on a brief example before installation. It will often be
as easy to carry out these steps manually instead of using the Makefile.
-DOCUMENTATION:
+DOCUMENTATION
+-------------
Usage instructions are in the manual latexdiff-man.pdf as well as the
man pages.
-CHANGELOGS:
-
+CHANGELOGS
+----------
Check out the comment lines at the beginning of the perl scripts (latexdiff, latexdiff-vc, latexrevise)
CONTRIBUTIONS
+-------------
The directory contrib contains code written by others relating to latexdiff.
Currently this directory contains:
@@ -97,15 +111,19 @@ Contributions by the following authors were incorporated into the latexdiff code
extend latexdiff in a similar way: J. Paisley, N. Becker, K. Huebner
EXTERNAL LATEXDIFF SUPPORT PROGRAMS
+-----------------------------------
+
+LATEXDIDFFR (Author: David Hugh-Jones) is a small library that uses the latexdiff command to create a diff of two Rmarkdown, .Rnw or TeX files.
+https://github.com/hughjonesd/latexdiffr
LATEXDIFFCITE (Author: Christer van der Meeren) is a wrapper around latexdiff to make citations diff properly. It works by expanding \cite type commands using the bbl or bib file, such that citations are treated just like normal text rather than as atomic in the plain latexdiff.
-https://latexdiffcite.readthedocs.org
+https://github.com/twilsonco/latexdiffcite
GIT-LATEXDIFF (lead author: Matthieu Moy) is a wrapper (bash script) around latexdiff that allows using it to diff two revisions of a LaTeX file under git revision control (similar functionality is provided by latexdiff-vc --git with --flatten option included with this distribution but git-latexdiff allows more fine-grained control on (not to be confused with latexdiff-git, which is normally installed as a soft link to latexdiff-vc)
https://gitorious.org/git-latexdiff/
-LICENSE (also see file COPYING)
-
+LICENSE
+-------
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3 as published by
the Free Software Foundation.
@@ -116,3 +134,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details (file LICENSE in the
distribution).
+
+
+
diff --git a/support/latexdiff/doc/example-diff.tex b/support/latexdiff/doc/example-diff.tex
index 8eda2a43aa..b68c11aff9 100644
--- a/support/latexdiff/doc/example-diff.tex
+++ b/support/latexdiff/doc/example-diff.tex
@@ -22,7 +22,7 @@
\RequirePackage[normalem]{ulem} %DIF PREAMBLE
\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1} %DIF PREAMBLE
\providecommand{\DIFadd}[1]{{\protect\color{blue}\uwave{#1}}} %DIF PREAMBLE
-\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}} %DIF PREAMBLE
+\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}} %DIF PREAMBLE
%DIF SAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddbegin}{} %DIF PREAMBLE
\providecommand{\DIFaddend}{} %DIF PREAMBLE
@@ -53,6 +53,8 @@
} %DIF PREAMBLE
\lstnewenvironment{DIFverbatim}{\lstset{style=DIFverbatimstyle}}{} %DIF PREAMBLE
\lstnewenvironment{DIFverbatim*}{\lstset{style=DIFverbatimstyle,showspaces=true}}{} %DIF PREAMBLE
+\lstset{extendedchars=\true,inputencoding=utf8}
+
%DIF END PREAMBLE EXTENSION ADDED BY LATEXDIFF
\begin{document}
diff --git a/support/latexdiff/doc/latexdiff-man.pdf b/support/latexdiff/doc/latexdiff-man.pdf
index 2ea00571b3..d0e57ad5c9 100644
--- a/support/latexdiff/doc/latexdiff-man.pdf
+++ b/support/latexdiff/doc/latexdiff-man.pdf
Binary files differ
diff --git a/support/latexdiff/latexdiff b/support/latexdiff/latexdiff
index a032ae23b5..5df02b753f 100755
--- a/support/latexdiff/latexdiff
+++ b/support/latexdiff/latexdiff
@@ -25,6 +25,21 @@
#
# Note references to issue numbers are for the github repository of latexdiff: https://github.com/ftilmann/latexdiff
#
+# Version 1.3.4:
+# New features:
+# - Option to use lua-ul instead of ulem (for use with LuaLaTeX) (fix #17, #60, #188, #255, #270)
+# Enhancement
+# - If amsmath is detected as one of the included (based on idea in PR #263 contributed by github user xlucn
+# Bug fix
+# - sometimes the introduction of aux commands to show deleted lists or descriptions leaves in place empty auxiliary
+# list environments, which would cause error messages (though skipping messages would result in a correct output pdf).
+# These are now removed.
+# - add more mboxsafecmd and safecmd commands for SIunitx to stay compatible with newer versionsof SIunitx (PR #283, fixing issue #282, contributed by github user joe6302413)
+# - File added via --preamble option is no longer assumed to be ASCII, but read either with encoding as defined by --encoding option or using the encoding of the LOCALE (fixes issue #285 )
+# - multicolumn argument is now treated as text
+# - when tikz-dependency package is used, \& is no longer a safe command as it has special meaning inside dependency environment. The fix is a little of a hack as really it should only be considered unsafe within dependency environment (fixes (mostly) issue #303 )
+# - listings package had trouble with non-ASCII chars. The encoding is now set (thanks to github user anka-213 for finding this). Fixes #304
+#
# Version 1.3.3:
# New features:
# - Option --no-del to remove all deleted text (merge contributed by github user tdegeus PR #252, fixing issue #66
@@ -33,22 +48,22 @@
# - Abbreviations involving punctuations within them. They need special treatment because otherwise in some
# circumstances the gnoring of white space differences in conjunction with merging according to MINWORDSBLOCK rule
# could turn 'i.e.' into 'i.\PAR e.' (see https://github.com/ftilmann/latexdiff/issues/269). A few abbreviations
-# are now hard-coded and treated as atomic:
+# are now hard-coded and treated as atomic:
# English: i.e., e.g. Deutsch: z.B.
# (fixes issue #269)
# - In WHOLE and COARSE math modes, now properly treat math environments with arguments such as \alignat. Fixes #251
-# - For FINE math mode, multiple improvments to the processing work flow yield more robust outcomes. In particular, changes
-# to the equation type, e.g. \begin{displaymath} -> \begin{equation} without modifications now usually no longer result
-# in errors. (Partially) fixes issues #235 and #244.
-# - When encountering deleted math array environments such as align or eqnarray, rather than replacing them with a
-# fixed replacement environment (e.g. align* or eqnarray*), an asterisk is now added to the original command, which
+# - For FINE math mode, multiple improvments to the processing work flow yield more robust outcomes. In particular, changes
+# to the equation type, e.g. \begin{displaymath} -> \begin{equation} without modifications now usually no longer result
+# in errors. (Partially) fixes issues #235 and #244.
+# - When encountering deleted math array environments such as align or eqnarray, rather than replacing them with a
+# fixed replacement environment (e.g. align* or eqnarray*), an asterisk is now added to the original command, which
# in amsmath (and with eqnarray) will result in the same environment but without line numbers. Config variable MATHARRREPL
# is therefore (nearly) redundant, and a depracation warning is given when it is set. Reference to MATHARRREPL are have
# been removed from the manual (there is one exception, when it's still being used: sometimes latexdiff can figure out
# that there is a deleted array environment, but does not know which one. In this case, MATHARRREPL is still being used
-# to encapsulate these parts of the source, and therefore it is still set internally. But this is a quite rare situation).
+# to encapsulate these parts of the source, and therefore it is still set internally. But this is a quite rare situation).
# Fixes issue #216
-# - Unlike 'array' environment, 'split' (amsmath) does not work in argument of \DIFadd or \DIFdl in UNDERLINE modes; therefore remove it from ARRENV configuration variable.
+# - Unlike 'array' environment, 'split' (amsmath) does not work in argument of \DIFadd or \DIFdl in UNDERLINE modes; therefore remove it from ARRENV configuration variable.
# Exclude \begin and \end in math environments in COARSE and WHOLE modes. Fixes #258. Fixes #109
# - --flatten now works for empty files. Fixes issue #242
# - improved processing of Chinese and Japanese texts in that splitting is done based on characters. Thanks to LuXu (Oliver Lew) in git for working this out. Fixes #229, fixes #145
@@ -65,7 +80,7 @@
# Bug fixes:
# - fix issue #206 affecting proper markup of text commands which are not also safe cmd's and have multiple arguments
# - fix issue #210 by adding \eqref (amsmath package) to the list of safe commands
-# - fix bug reported in issue #168 mangled verbatim line environment
+# - fix bug reported in issue #168 mangled verbatim line environment
# - fix bug reported in issue #218 by replacing \hspace{0pt} after \mbox{..} auxiliary commands with \hskip0pt.
# - more ways to process \frac correctly with atomic arguments (committed by julianuu PR #246
# - fix a bug in biblatex mode, which prevented proper processing of modified \textcite (see: https://tex.stackexchange.com/questions/555157/latexdiff-and-biblatex-citation-commands)
@@ -74,10 +89,10 @@
# Version 1.3.1.1
# - remove spurious \n to fix error: Unknown regexp modifier "/n" at .../latexdiff line 1974, near "=~ " (see github issue #201)
#
-# Version 1.3.1
+# Version 1.3.1
# Bug fixes:
# - remove some uninitialised variable $2 warnings in string substitution in flatten function in case included file is not found
-# - add minimal postprocessing to diff processing of preamble commands (replace \RIGHTBRACE by \} )
+# - add minimal postprocessing to diff processing of preamble commands (replace \RIGHTBRACE by \} )
# - pre-processing: replace (contributed) routine take_comments_and_enter_from_frac() with take_comments_and_newline_from_frac(), which does the same thing
# (remove whitespace characters and comments between the argument of \frac commands) in an easier and more robust way. In addition, it
# will replace commands like \frac12 with \frac{1}{2} as pre-processing step. Fixes issue #184
@@ -95,15 +110,15 @@
# Version 1.3.0 (7 October 2018):
# - treat options to \documentclass as potential package names (some packages allow implicit loading of or imply selected packages
# - improved pattern matching: now allows nested angular brackets, and is no longer confused by escaped curly braces
-# - improved pattern matching in COARSE mode: occasionally, the closing bracket or some other elements would be matched in an 'unnatural' way due to another sequence being more minimal in the computational sense, sometimes even causing errors due to tokens moving in or out of the scope of math environments. This is now discouraged by adding internal \DIFANCHOR commands (which are removed again in post-processing) (fixes issues reported via email by li_ruomeng .
+# - improved pattern matching in COARSE mode: occasionally, the closing bracket or some other elements would be matched in an 'unnatural' way due to another sequence being more minimal in the computational sense, sometimes even causing errors due to tokens moving in or out of the scope of math environments. This is now discouraged by adding internal \DIFANCHOR commands (which are removed again in post-processing) (fixes issues reported via email by li_ruomeng .
# - verbatim and lstlisting environments are marked-up with line-by-line in a similar style to non-verbatim text (requires the listing package to be installed)
# (see new configuration variable VERBATIMLINEENV) (several issues and pull requests by jprotze)
-# - --flatten: now supports \verbatiminput and \lstlistinput
+# - --flatten: now supports \verbatiminput and \lstlistinput
# - --flatten: if file is not found, do not fail, simply warn and leave command unexpanded (inspired by issue #112). Don't warn if file name contains #[0-9] as it is then most likely an argument within a command definition rather than an actual file (applies to \input, \subfile, \include commands)
# - added to textcmds: \intertext
# - new config variable CUSTOMDIFCMD to allow defining special versions of commands in added or deleted blocks (Pull request by github user jprotze)
# - added option -no-links (mostly for use by latexdiff-vc in only-changes modes) (Pull request by github user jprotze)
-# - new option --filter-script to run both input through a pre-processing script (PR jasonmccsmith #167)
+# - new option --filter-script to run both input through a pre-processing script (PR jasonmccsmith #167)
# new option --no-filter-stderr to hide stderr output from filter-script (potentially dangerous, as this might hide malfunctioning of filter scripts)
# - --flatten now can deal with imports made using the import package {PR jasonmccsmith #173)
# Bug fixes:
@@ -122,12 +137,12 @@
# make environments that are treated like verbatim environments configurable (config variable VERBATIMENV)
# treat lstinlne as equivalent to verb command
# partially addresses issue #38
-# - refactoring: set default configuration variables in a hash, and those that correspond to lists
+# - refactoring: set default configuration variables in a hash, and those that correspond to lists
# - feature: option --add-to-config used to amend configuration variables, which are regex pattern lists
# - bug fix: deleted figures when endfloat package is activated
# - bug fix: alignat environment now always processed correctly (fix issues #65)
# - bug fix: avoid processing of commands as potential files in routine init_regex_arr (fix issue #70 )
-# - minimal feature enhancement: treat '@' as allowed character in commands (strictly speaking requires prior \makeatletter statement, but always assuming it to be
+# - minimal feature enhancement: treat '@' as allowed character in commands (strictly speaking requires prior \makeatletter statement, but always assuming it to be
# @ a letter if it is part of a command name will usually lead to the correct behaviour (see http://tex.stackexchange.com/questions/346651/latexdiff-and-let)
# - new feature/bug fix: --flatten option \endinput in included files now respected but only if \endinput stands right at the beginning of the line (issue #77)
# - bug fix: flatten would incorrectly attempt to process commented out \include commands (from discussion in issue #77 )
@@ -165,7 +180,7 @@
# - introduce list UNSAFEMATHCMD, which holds list of commands which cannot be marked up with \DIFadd or \DIFdel commands (only relevant for WHOLE and COARSE math markup modes)
# - new subtype LABEL which gives each change a label. This can later be used to only display pages where changes
# have been made (instructions for that are put as comments into the diff'ed file) inspired by answer on http://tex.stackexchange.com/questions/166049/invisible-markers-in-pdfs-using-pdflatex
-# - Configuration variables take into accout some commands from additional packages:
+# - Configuration variables take into accout some commands from additional packages:
# tikzpicture environment now treated as PICTUREENV, and \smallmatrix in ARRENV (amsmath)
# - --flatten: support for \subfile command (subfiles package) (in response to http://tex.stackexchange.com/questions/167620/latexdiff-with-subfiles )
# - --flatten: \bibliography commands expand if corresponding bbl file present
@@ -179,11 +194,11 @@
# - \% in one-letter sub/Superscripts was not converted correctly
#
# Version 1.0.3
-# - fix bug in add_safe_commands that made latexdiff hang on DeclareMathOperator
+# - fix bug in add_safe_commands that made latexdiff hang on DeclareMathOperator
# command in preamble
# - \(..\) inline math expressions were not parsed correctly, if they contained a linebreak
# - applied patch contributed by tomflannaghan via Berlios: [ Patch #3431 ] Adds correct handling of \left< and \right>
-# - \$ is treated correctly as a literal dollar sign (thanks to Reed Cartwright and Joshua Miller for reporting this bug
+# - \$ is treated correctly as a literal dollar sign (thanks to Reed Cartwright and Joshua Miller for reporting this bug
# and sketching out the solution)
# - \^ and \_ are correctly interpreted as accent and underlined space, respectively, not as superscript of subscript
# (thanks to Wail Yahyaoui for pointing out this bug)
@@ -191,19 +206,19 @@
# Version 1.0.1 - treat \big,\bigg etc. equivalently to \left and
# \right - include starred version in MATHENV - apply
# - flatten recursively and --flatten expansion is now
-# aware of comments (thanks to Tim Connors for patch)
+# aware of comments (thanks to Tim Connors for patch)
# - Change to post-processing for more reliability for
# deleted math environments
-# - On linux systems, recognise and remove DOS style newlines
+# - On linux systems, recognise and remove DOS style newlines
# - Provide markup for some special preamble commands (\title,
-# \author,\date,
-# - configurable by setting context2cmd
+# \author,\date,
+# - configurable by setting context2cmd
# - for styles using ulem package, remove \emph and \text.. from list of
# safe commands in order to allow linebreaks within the
-# highlighted sections.
-# - for ulem style, now show citations by enclosing them in \mbox commands.
-# This unfortunately implies linebreaks within citations no longer function,
-# so this functionality can be turned off (Option --disable-citation-markup).
+# highlighted sections.
+# - for ulem style, now show citations by enclosing them in \mbox commands.
+# This unfortunately implies linebreaks within citations no longer function,
+# so this functionality can be turned off (Option --disable-citation-markup).
# With --enable-citation-markup, the mbox markup is forced for other styles)
# - new substyle COLOR. This is particularly useful for marking up citations
# and some special post-processing is implemented to retain cite
@@ -211,11 +226,11 @@
# - four different levels of math-markup
# - Option --driver for choosing driver for modes employing changebar package
# - accept \\* as valid command (and other commands of form \.*). Also accept
-# \<nl> (backslashed newline)
+# \<nl> (backslashed newline)
# - some typo fixes, include commands defined in preamble as safe commands
-# (Sebastian Gouezel)
+# (Sebastian Gouezel)
# - include compared filenames as comments as line 2 and 3 of
-# the preamble (can be modified with option --label, and suppressed with
+# the preamble (can be modified with option --label, and suppressed with
# --no-label), option --visible-label to show files in generated pdf or dvi
# at the beginning of main document
#
@@ -231,7 +246,7 @@
#
# Version 0.4 March 06 option for fast differencing using UNIX diff command, several minor bug fixes (\par bug, improved highlighting of textcmds)
#
-# Version 0.3 August 05 improved parsing of displayed math, --allow-spaces
+# Version 0.3 August 05 improved parsing of displayed math, --allow-spaces
# option, several minor bug fixes
#
# Version 0.25 October 04 Fix bug with deleted equations, add math mode commands to safecmd, add | to allowed interpunctuation signs
@@ -247,12 +262,13 @@ use utf8 ;
use File::Spec ;
+
my ($algodiffversion)=split(/ /,$Algorithm::Diff::VERSION);
my ($versionstring)=<<EOF ;
-This is LATEXDIFF 1.3.3 (Algorithm::Diff $Algorithm::Diff::VERSION, Perl $^V)
- (c) 2004-2022 F J Tilmann
+This is LATEXDIFF 1.3.4 (Algorithm::Diff $Algorithm::Diff::VERSION, Perl $^V)
+ (c) 2004-2024 F J Tilmann
EOF
# Hash with defaults for configuration variables. These marked undef have default values constructed from list defined in the DATA block
@@ -343,9 +359,9 @@ my $DELCMDOPEN='%DIFDELCMD < '; # To mark begin of deleted commands (must begin
my $DELCMDCLOSE="%%%\n"; # To mark end of deleted commands (must end with a new line)
my $AUXCMD='%DIFAUXCMD' ; # follows auxiliary commands put in by latexdiff to make difference file legal
# auxiliary commands must be on a line of their own
- # Note that for verbatim environment openings the %DIFAUXCMD cannot be placed in
+ # Note that for verbatim environment openings the %DIFAUXCMD cannot be placed in
# the same line as this would mean they are shown
- # so the special form "%DIFAUXCMD NEXT" is used to indicate that the next line
+ # so the special form "%DIFAUXCMD NEXT" is used to indicate that the next line
# is an auxiliary command
# Similarly "%DIFAUXCMD LAST" would indicate the auxiliary command is in previous line (not currently used)
my $DELCOMMENT='DIF < '; # To mark deleted comment line
@@ -356,21 +372,21 @@ my @TEXTCMDLIST=(); # array containing patterns of commands with text arguments
my @TEXTCMDEXCL=(); # array containing patterns of commands without text arguments (if a pattern
# matches both TEXTCMDLIST and TEXTCMDEXCL it is excluded)
my @CONTEXT1CMDLIST=(); # array containing patterns of commands with text arguments (subset of text commands),
- # but which cause confusion if used out of context (e.g. \caption).
+ # but which cause confusion if used out of context (e.g. \caption).
# In deleted passages, the command will be disabled but its argument is marked up
- # Otherwise they behave exactly like TEXTCMD's
+ # Otherwise they behave exactly like TEXTCMD's
my @CONTEXT1CMDEXCL=(); # exclude list for above, but always empty
my @CONTEXT2CMDLIST=(); # array containing patterns of commands with text arguments, but which fail or cause confusion
# if used out of context (e.g. \title). They and their arguments will be disabled in deleted
# passages
my @CONTEXT2CMDEXCL=(); # exclude list for above, but always empty
my @MATHTEXTCMDLIST=(); # treat like textcmd. If a textcmd is in deleted or added block, just wrap the
- # whole content with \DIFadd or \DIFdel irrespective of content. This functionality
+ # whole content with \DIFadd or \DIFdel irrespective of content. This functionality
# is useful for pseudo commands \MATHBLOCK.. into which math environments are being
- # transformed
-my @MATHTEXTCMDEXCL=(); #
+ # transformed
+my @MATHTEXTCMDEXCL=(); #
-# Note I need to declare this with "our" instead of "my" because later in the code I have to "local"ise these
+# Note I need to declare this with "our" instead of "my" because later in the code I have to "local"ise these
our @SAFECMDLIST=(); # array containing patterns of safe commands (which do not break when in the argument of DIFadd or DIFDEL)
our @SAFECMDEXCL=();
my @MBOXCMDLIST=(); # patterns for commands which are in principle safe but which need to be surrounded by an \mbox
@@ -435,7 +451,7 @@ $mathmarkup=COARSE;
$verbose=0;
$onlyadditions=0;
# output debug and intermediate files, set to 0 in final distribution
-$debug=0;
+$debug=0;
# insert preamble directly after documentclass - experimental feature, set to 0 in final distribution
# Note that this failed with mini example (or other files, where packages used in latexdiff preamble
# are called again with incompatible options in preamble of resulting file)
@@ -458,9 +474,9 @@ END
my %verbhash;
Getopt::Long::Configure('bundling');
-GetOptions('type|t=s' => \$type,
- 'subtype|s=s' => \$subtype,
- 'floattype|f=s' => \$floattype,
+GetOptions('type|t=s' => \$type,
+ 'subtype|s=s' => \$subtype,
+ 'floattype|f=s' => \$floattype,
'config|c=s' => \@configlist,
'add-to-config=s' => \@addtoconfiglist,
'preamble|p=s' => \$preamblefile,
@@ -509,11 +525,11 @@ if ( $help ) {
if ( $version ) {
- print STDERR $versionstring ;
+ print STDERR $versionstring ;
exit 0;
}
-print STDERR $versionstring if $verbose;
+print STDERR $versionstring if $verbose;
if (defined($showall)){
$showpreamble=$showsafe=$showtext=$showconfig=1;
@@ -531,7 +547,7 @@ if (defined($mathmarkup)) {
$mathmarkup=~tr/a-z/A-Z/;
if ( $mathmarkup eq 'OFF' ){
$mathmarkup=OFF;
- } elsif ( $mathmarkup eq 'WHOLE' ){
+ } elsif ( $mathmarkup eq 'WHOLE' ){
$mathmarkup=WHOLE;
} elsif ( $mathmarkup eq 'COARSE' ){
$mathmarkup=COARSE;
@@ -634,7 +650,7 @@ foreach $config ( @configlist ) {
}
}
foreach $assign ( @config ) {
- $assign=~ m/\s*(\w*)\s*=\s*(\S*)\s*$/ or die "Illegal assignment $assign in configuration list (must be variable=value)";
+ $assign=~ m/\s*(\w*)\s*=\s*(\S*)\s*$/ or die "Illegal assignment $assign in configuration list (must be variable=value)";
exists $CONFIG{$1} or die "Unknown configuration variable $1.";
$CONFIG{$1}=$2;
}
@@ -671,7 +687,7 @@ foreach $key ( keys(%CONFIG) ) {
foreach $assign ( @addtoconfig ) {
###print STDERR "assign:|$assign|\n";
- $assign=~ m/\s*(\w*)\s*=\s*(\S*)\s*$/ or die "Illegal assignment $assign in configuration list (must be variable=value)";
+ $assign=~ m/\s*(\w*)\s*=\s*(\S*)\s*$/ or die "Illegal assignment $assign in configuration list (must be variable=value)";
exists $CONFIG{$1} or die "Unknown configuration variable $1.";
$CONFIG{$1}.=";$2";
}
@@ -686,8 +702,8 @@ foreach ( keys(%CONFIG) ) {
elsif ( $_ eq "MATHENV" ) { $MATHENV = liststringtoregex($CONFIG{$_}) ; }
elsif ( $_ eq "MATHREPL" ) { $MATHREPL = $CONFIG{$_} ; }
elsif ( $_ eq "MATHARRENV" ) { $MATHARRENV = liststringtoregex($CONFIG{$_}) ; }
- elsif ( $_ eq "MATHARRREPL" ) { $MATHARRREPL = $CONFIG{$_} ;
- print STDERR "WARNING: Setting MATHARRREPL is depracated. Generally deleted math array environments will be set to their starred varieties and the setting of MATHARREPL is ignored.\n\n" unless $MATHARRREPL =~ /eqnarray\*/ ;
+ elsif ( $_ eq "MATHARRREPL" ) { $MATHARRREPL = $CONFIG{$_} ;
+ print STDERR "WARNING: Setting MATHARRREPL is depracated. Generally deleted math array environments will be set to their starred varieties and the setting of MATHARREPL is ignored.\n\n" unless $MATHARRREPL =~ /eqnarray\*/ ;
}
elsif ( $_ eq "ARRENV" ) { $ARRENV = liststringtoregex($CONFIG{$_}) ; }
elsif ( $_ eq "VERBATIMENV" ) { $VERBATIMENV = liststringtoregex($CONFIG{$_}) ; }
@@ -714,11 +730,11 @@ foreach $pkg ( @packagelist ) {
if ($showconfig || $showtext || $showsafe || $showpreamble) {
show_configuration();
- exit 0;
+ exit 0;
}
-if ( @ARGV != 2 ) {
+if ( @ARGV != 2 ) {
print STDERR "2 and only 2 non-option arguments required. Write latexdiff -h to get help\n";
exit(2);
}
@@ -726,7 +742,7 @@ if ( @ARGV != 2 ) {
# Are extra spaces between command arguments permissible?
my $extraspace;
if ($allowspaces) {
- $extraspace='\s*';
+ $extraspace='\s*';
} else {
$extraspace='';
}
@@ -749,14 +765,14 @@ push(@SAFECMDLIST, qr/^QLEFTBRACE$/, qr/^QRIGHTBRACE$/);
# if you get "undefined control sequence MATHBLOCKmath" error, increase the maximum value in this loop
for (my $i_pat = 0; $i_pat < 20; ++$i_pat){
$pat_n = '(?:[^{}]|\{'.$pat_n.'\}|\\\\\{|\\\\\})*';
- # Actually within the text body, quoted braces are replaced in pre-processing. The only place where
+ # Actually within the text body, quoted braces are replaced in pre-processing. The only place where
# the last part of the pattern matters is when processing the arguments of context2cmds in the preamble
# and these contain a \{ or \} combination, probably rare.
# It should thus be fine to use the simpler version below.
### $pat_n = '(?:[^{}]|\{'.$pat_n.'\})*';
}
- my $brat0 = '(?:[^\[\]]|\\\[|\\\])*';
+ my $brat0 = '(?:[^\[\]]|\\\[|\\\])*';
my $brat_n = $brat0;
for (my $i_pat = 0; $i_pat < 4; ++$i_pat){
$brat_n = '(?:[^\[\]]|\['.$brat_n.'\]|\\\[|\\\])*';
@@ -773,7 +789,7 @@ push(@SAFECMDLIST, qr/^QLEFTBRACE$/, qr/^QRIGHTBRACE$/);
# could turn 'i.e.' into 'i.\PAR e.' (see https://github.com/ftilmann/latexdiff/issues/269)
# English: i.e., e.g. Deutsch: z.B.
my $abbreviation='(?:i\. ?e\.|e\. ?g\.|z\. ?B\.)' ;
- my $number='-?\d*\.\d*';
+ my $number='-?\d*\.\d*';
# word: sequence of letters or accents followed by letter
my $word_cj='\p{Han}|\p{InHiragana}|\p{InKatakana}';
@@ -801,7 +817,7 @@ push(@SAFECMDLIST, qr/^QLEFTBRACE$/, qr/^QRIGHTBRACE$/);
# inline math $....$ or \(..\)
### the commented out version is simpler but for some reason cannot cope with newline (in spite of s option) - need to include \newline explicitly
### my $math='\$(?:[^$]|\\\$)*?\$|\\\\[(].*?\\\\[)]';
- my $math='\$(?:[^$]|\\\$)*?\$|\\\\[(](?:.|\n)*?\\\\[)]';
+ my $math='\$(?:[^$]|\\\$)*?\$|\\\\[(](?:.|\n)*?\\\\[)]';
### test version (this seems to give the same results as version above)
## the current maths command cannot cope with newline within the math expression
### my $math='\$(?:[^$]|\\\$)*?\$|\\[(].*?\\[)]';
@@ -819,7 +835,7 @@ push(@SAFECMDLIST, qr/^QLEFTBRACE$/, qr/^QRIGHTBRACE$/);
-# now we are done setting up and can start working
+# now we are done setting up and can start working
my ($oldfile, $newfile) = @ARGV;
# check for existence of input files
if ( ! -e $oldfile ) {
@@ -847,7 +863,7 @@ my ($oldtime,$newtime,$oldlabel,$newlabel);
if (defined($labels[0])) {
$oldlabel=$labels[0] ;
} else {
- $oldtime=localtime((stat($oldfile))[9]);
+ $oldtime=localtime((stat($oldfile))[9]);
$oldlabel="$oldfile " . " "x($oldlabel_n_spaces) . $oldtime;
}
if (defined($labels[1])) {
@@ -860,6 +876,7 @@ if (defined($labels[1])) {
$encoding=guess_encoding($newfile) unless defined($encoding);
$encoding = "utf8" if $encoding =~ m/^utf8/i ;
+print STDERR "Encoding $encoding\n" if $verbose;
if (lc($encoding) eq "utf8" ) {
binmode(STDOUT, ":utf8");
binmode(STDERR, ":utf8");
@@ -943,7 +960,7 @@ my @auxlines;
my ($ulem)=0;
if ( length $oldpreamble && length $newpreamble ) {
- # pre-process preamble by looking for commands used in \maketitle (title, author, date etc commands)
+ # pre-process preamble by looking for commands used in \maketitle (title, author, date etc commands)
# and marking up content with latexdiff markup
@auxlines=preprocess_preamble($oldpreamble,$newpreamble);
@@ -975,7 +992,7 @@ if (defined($graphicsmarkup)) {
} else {
# Default: no explicit setting in menu
if ( defined $packages{"graphicx"} or defined $packages{"graphics"} ) {
- $graphicsmarkup=NEWONLY;
+ $graphicsmarkup=NEWONLY;
} else {
$graphicsmarkup=NONE;
}
@@ -1008,7 +1025,7 @@ if ($graphicsmarkup != NONE ) {
@matches=( $latexdiffpreamble =~ m/command\{\\DIFaddbeginFL}\{($pat_n)}/sg ) ;
# we look at the last one of the list to take into account possible redefinition but almost always matches should have exactly one element
if ( $matches[$#matches] =~ m/\\DIFaddbegin/ ) {
- die "Cannot combine graphics markup with float styles defining \\DIFaddbeginFL in terms of \\DIFaddbegin. Use --graphics-markup=none option or choose a different float style.";
+ die "Cannot combine graphics markup with float styles defining \\DIFaddbeginFL in terms of \\DIFaddbegin. Use --graphics-markup=none option or choose a different float style.";
exit 10;
}
###}
@@ -1022,6 +1039,11 @@ if ($graphicsmarkup != NONE ) {
$ulem = ($latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{ulem\}/ || defined $packages{"ulem"});
+# If amsmath is defined and $ulem is used for markup, redefine the \sout command to also work (mostly) in math mode
+# See stack exchange https://tex.stackexchange.com/questions/20609/strikeout-in-math-mode/308647#308647 based on comment by Taylor Raine
+if ( defined($packages{'amsmath'}) and $ulem ) {
+ $latexdiffpreamble .= join "\n",(extrapream('AMSMATHULEM'),"");
+}
# If listings is being used or can be found in the latexdiff search path, add to the preamble auxiliary code to enable line-by-line markup
if ( defined($packages{"listings"}) or `kpsewhich listings.sty` ne "" ) {
@@ -1031,7 +1053,7 @@ if ( defined($packages{"listings"}) or `kpsewhich listings.sty` ne "" ) {
}
my @listingDIFcode=();
my $replaced;
- # note that in case user supplies preamblefile the type might not reflect well the
+ # note that in case user supplies preamblefile the type might not reflect well the actual markup style
@listingDIFcode=extrapream("-nofail","DIFCODE_" . $type) unless defined($preamblefile);
if (!(@listingDIFcode)) {
# if listingDIFcode is empty try to guess a suitable one from the preamble
@@ -1045,13 +1067,17 @@ if ( defined($packages{"listings"}) or `kpsewhich listings.sty` ne "" ) {
@listingDIFcode=extrapream("DIFCODE_BOLD");
}
}
- # now splice it in
+ # add configuration so that listings work with utf-8
+ push @listingpreamble, '\lstset{extendedchars=\true,inputencoding='.$encoding."}\n";
+
+
+ # now splice it in
$replaced=0;
###print STDERR "DEBUG: listingDIFcode: ",join("\n",@listingDIFcode),"|||\n" if $debug;
- @listingpreamble=grep {
+ @listingpreamble=grep {
# only replace if this has not been done already (use short-circuit property of and)
- if (!$replaced and $_ =~ s/^.*%DIFCODE TEMPLATE.*$/join("\n",@listingDIFcode)/e ) {
+ if (!$replaced and $_ =~ s/^.*%DIFCODE TEMPLATE.*$/join("\n",@listingDIFcode)/e ) {
###print STDERR "DEBUG: Replaced text $_\n" if $debug;
$replaced=1;
1;
@@ -1081,7 +1107,7 @@ if ( length $oldpreamble && length $newpreamble ) {
unshift @oldpreamble,'';
@diffpreamble = linediff(\@oldpreamble, \@newpreamble);
# remove dummy line again
- shift @diffpreamble;
+ shift @diffpreamble;
# add filenames, modification time and latexdiff mark
defined($nolabel) or splice @diffpreamble,1,0,
"%DIF LATEXDIFF DIFFERENCE FILE",
@@ -1130,8 +1156,8 @@ if (defined $packages{"siunitx"} ) {
# protect SI command by surrounding them with an \mbox
# this is done to get around an incompatibility between the ulem and siunitx package
print STDERR "siunitx package detected.\n" if $verbose ;
- my $mboxcmds='SI,ang,numlist,numrange,SIlist,SIrange';
- init_regex_arr_list(\@SAFECMDLIST,'num,si');
+ my $mboxcmds='SI,ang,numlist,numrange,SIlist,SIrange,qty,qtylist,qtyproduct,qtyrange,complexqty';
+ init_regex_arr_list(\@SAFECMDLIST,'num,si,numproduct,unit,complexnum');
if ( $enablecitmark || ( $ulem && ! $disablecitmark )) {
init_regex_arr_list(\@MBOXCMDLIST,$mboxcmds);
} else {
@@ -1153,7 +1179,7 @@ if (defined $packages{"cleveref"} ) {
if (defined $packages{"glossaries"} ) {
# protect selected command by surrounding them with an \mbox
- # this is done to get around an incompatibility between ulem and glossaries package
+ # this is done to get around an incompatibility between ulem and glossaries package
print STDERR "glossaries package detected.\n" if $verbose ;
my $mboxcmds='[gG][lL][sS](?:|pl|disp|link|first|firstplural|desc|user[iv][iv]?[iv]?),[aA][cC][rR](?:long|longpl|full|fullpl),[aA][cC][lfp]?[lfp]?';
init_regex_arr_list(\@SAFECMDLIST,'[gG][lL][sS](?:(?:entry)?(?:text|plural|name|symbol)|displaynumberlist|entryfirst|entryfirstplural|entrydesc|entrydescplural|entrysymbolplural|entryuser[iv][iv]?[iv]?|entrynumberlist|entrydisplaynumberlist|entrylong|entrylongpl|entryshort|entryshortpl|entryfull|entryfullpl),[gG]lossentry(?:name|desc|symbol),[aA][cC][rR](?:short|shortpl),[aA]csp?');
@@ -1182,6 +1208,10 @@ if (defined $packages{"mhchem"} ) {
# push(@MATHTEXTCMDLIST,'cee');
}
+if ( defined $packages{"tikz-dependency"} ) {
+ init_regex_arr_ext(\@SAFECMDEXCL, 'AMPERSAND');
+}
+
my ( $citpat);
@@ -1269,7 +1299,7 @@ print STDERR "(",exetime()," s)\n","Done.\n" if $verbose;
# liststringtoregex(liststring)
-# expands string with semi-colon separated list into a regular expression corresponding
+# expands string with semi-colon separated list into a regular expression corresponding
# matching any of the elements
sub liststringtoregex {
my ($liststring)=@_;
@@ -1282,7 +1312,7 @@ sub liststringtoregex {
}
# show_configuration
-# note that this is not encapsulated but uses variables from the main program
+# note that this is not encapsulated but uses variables from the main program
# It is provided for convenience because in the future it is planned to allow output
# to be modified based on what packages are read etc - this works only if the input files are actually read
# whether or not additional files are provided
@@ -1309,7 +1339,7 @@ sub show_configuration {
print "\nContext1 commands (last argument textual, command will be disabled in deleted passages, last argument will be shown as plain text):\n";
print_regex_arr(@CONTEXT1CMDLIST);
print "\nContext2 commands (last argument textual, command and its argument will be disabled in deleted passages):\n";
- print_regex_arr(@CONTEXT2CMDLIST);
+ print_regex_arr(@CONTEXT2CMDLIST);
print "\nExclude list of Commands with last argument not textual (overrides patterns above):\n";
print_regex_arr(@TEXTCMDEXCL);
}
@@ -1417,7 +1447,7 @@ sub list_packages {
my %packages=();
my $pkg;
- # remove comments
+ # remove comments
$preamble=~s/(?<!\\)%.*$//mg ;
while ( $preamble =~ m/\\(?:documentclass|usepackage|RequirePackage)(?:\[($brat_n)\])?\{(.*?)\}/gs ) {
@@ -1522,7 +1552,7 @@ sub flatten {
my ($includeonly,$dirname,$fname,$newpage,$fullfile,$filecontent,$replacement,$begline,$inputcmd,$bblfile,$subfile,$command,$verbenv,$verboptions,$ignore,$fileonly);
my ($subpreamble,$subbody,$subpost);
my ($subdir,$subdirfull,$importfilepath);
- require File::Basename ;
+ require File::Basename ;
### require File::Spec ; # now this is needed even if flatten option not given
$filename = File::Spec->rel2abs( $filename ) ;
($ignore, $dirname, $fileonly) = File::Spec->splitpath($filename) ;
@@ -1562,15 +1592,15 @@ sub flatten {
$subdirfull = (defined($3) ? File::Spec->catdir($dirname,$subdir) : $subdir);
$importfilepath = File::Spec->catfile($subdirfull, $fname);
-
+
print STDERR "importing importfilepath:", $importfilepath,"\n" if $verbose;
if ( -f $importfilepath ) {
# If file exists, replace input or include command with expanded input
#TODO: need remove_endinput & newpage similar to other replacements inside flatten
- $replacement=flatten(read_file_with_encoding($importfilepath, $encoding), $preamble,$importfilepath,$encoding);
+ $replacement=flatten(read_file_with_encoding($importfilepath, $encoding), $preamble,$importfilepath,$encoding);
} else {
# if file does not exist, do not expand include or input command (do not warn if fname contains #[0-9] as it is then likely part of a command definition
- # and is not meant to be expanded directly
+ # and is not meant to be expanded directly
print STDERR "WARNING: Could not find included file ",$importfilepath,". I will continue but not expand |$2|\n";
$replacement = $2;
$replacement .= "{$subdir}{$fname} % Processed";
@@ -1579,13 +1609,13 @@ sub flatten {
}/exgm;
# recursively replace \\input and \\include files
- $text =~ s/(^(?:[^%\n]|\\%)*)(\\input\{(.*?)\}|\\include\{(${includeonly}(?:\.tex)?)\})/{
+ $text =~ s/(^(?:[^%\n]|\\%)*)(\\input\{(.*?)\}|\\include\{(${includeonly}(?:\.tex)?)\})/{
$begline=(defined($1)? $1 : "") ;
$inputcmd=$2;
$fname = $3 if defined($3) ;
$fname = $4 if defined($4) ;
$newpage=(defined($4)? " \\newpage " : "") ;
- # # add tex extension unless there is a three or four letter extension already
+ # # add tex extension unless there is a three or four letter extension already
$fname .= ".tex" unless $fname =~ m|\.\w{3,4}$|;
$fullfile = File::Spec->catfile($dirname,$fname);
print STDERR "DEBUG Beg of line match |$1|\n" if defined($1) && $debug ;
@@ -1594,12 +1624,12 @@ sub flatten {
# content of file becomes replacement value (use recursion), add \newpage if the command was include
if ( -f $fullfile ) {
# If file exists, replace input or include command with expanded input
- $replacement=flatten(read_file_with_encoding($fullfile, $encoding), $preamble,$filename,$encoding);
- $replacement = remove_endinput($replacement);
+ $replacement=flatten(read_file_with_encoding($fullfile, $encoding), $preamble,$filename,$encoding);
+ $replacement = remove_endinput($replacement);
# \include always starts a new page; use explicit \newpage command to simulate this
} else {
# if file does not exist, do not expand include or input command (do not warn if fname contains #[0-9] as it is then likely part of a command definition
- # and is not meant to be expanded directly
+ # and is not meant to be expanded directly
print STDERR "WARNING: Could not find included file ",$fullfile,". I will continue but not expand |$inputcmd|\n" unless $fname =~ m(#[0-9]) ;
$replacement = $inputcmd ; # i.e. just the original command again -> make no change file does not exist
$newpage="";
@@ -1608,7 +1638,7 @@ sub flatten {
}/exgm;
# replace bibliography with bbl file if it exists
- $text=~s/(^(?:[^%\n]|\\%)*)\\bibliography\{(.*?)\}/{
+ $text=~s/(^(?:[^%\n]|\\%)*)\\bibliography\{(.*?)\}/{
if ( -f $bblfile ){
$replacement=read_file_with_encoding(File::Spec->catfile($bblfile), $encoding);
} else {
@@ -1620,10 +1650,10 @@ sub flatten {
}/exgm;
# replace subfile with contents (subfile package)
- $text=~s/(^(?:[^%\n]|\\%)*)\\subfile\{(.*?)\}/{
+ $text=~s/(^(?:[^%\n]|\\%)*)\\subfile\{(.*?)\}/{
$begline=(defined($1)? $1 : "") ;
- $fname = $2;
- # # add tex extension unless there is a three or four letter extension already
+ $fname = $2;
+ # # add tex extension unless there is a three or four letter extension already
$fname .= ".tex" unless $fname =~ m|\.\w{3,4}|;
print STDERR "Include file as subfile $fname\n" if $verbose;
# content of file becomes replacement value (use recursion)
@@ -1634,10 +1664,10 @@ sub flatten {
# if file exists, expand \subfile command by contents of file
$subfile=read_file_with_encoding($fullfile,$encoding) or die "Could not open included subfile ",$fullfile,": $!";
($subpreamble,$subbody,$subpost)=splitdoc($subfile,'\\\\begin\{document\}','\\\\end\{document\}');
- ### $subfile=~s|^.*\\begin{document}||s;
+ ### $subfile=~s|^.*\\begin{document}||s;
### $subfile=~s|\\end{document}.*$||s;
$replacement=flatten($subbody, $preamble,$fullfile,$encoding);
- ### $replacement = remove_endinput($replacement);
+ ### $replacement = remove_endinput($replacement);
} else {
# if file does not exist, do not expand subfile
print STDERR "WARNING: Could not find subfile ",$fullfile,". I will continue but not expand |$2|\n" unless $fname =~ m(#[0-9]) ;
@@ -1648,11 +1678,11 @@ sub flatten {
}/exgm;
# replace \verbatiminput and \lstlistinginput
- $text=~s/(^(?:[^%\n]|\\%)*)\\(verbatiminput\*?|lstinputlisting)$extraspace(\[$brat_n\])?$extraspace\{(.*?)\}/{
+ $text=~s/(^(?:[^%\n]|\\%)*)\\(verbatiminput\*?|lstinputlisting)$extraspace(\[$brat_n\])?$extraspace\{(.*?)\}/{
$begline=(defined($1)? $1 : "") ;
$command = $2 ;
$fname = $4 ;
- $verboptions = defined($3)? $3 : "" ;
+ $verboptions = defined($3)? $3 : "" ;
if ($command eq 'verbatiminput' ) {
$verbenv = "verbatim" ;
} elsif ($command eq 'verbatiminput*' ) {
@@ -1661,7 +1691,7 @@ sub flatten {
$verbenv = "lstlisting" ;
} else {
die "Internal errorL Unexpected verbatim input type $command.\n";
- }
+ }
print STDERR "DEBUG Beg of line match |$begline|\n" if $debug ;
print STDERR "Include file $fname verbatim\n" if $verbose;
print STDERR "DEBUG looking for file ",File::Spec->catfile($dirname,$fname), "\n" if $debug;
@@ -1693,8 +1723,8 @@ sub print_regex_arr {
# if $type is a filename, it will read the file instead of reading from the appendix
# otherwise it will screen appendix for line "%DIF $TYPE" and copy everything up to line
# '%DIF END $TYPE' (where $TYPE is upcased version of $type)
-# extrapream('-nofail',$type) will---instead of failing---simply return nothing if
-# it does not find the matching line in a appendix (do not use -nofail option with multiple types!)
+# extrapream('-nofail',$type) will---instead of failing---simply return nothing if
+# it does not find the matching line in appendix (do not use -nofail option with multiple types!)
sub extrapream {
my @types=@_;
my ($type,$arg);
@@ -1711,14 +1741,20 @@ sub extrapream {
$type=$arg;
$copy=0;
if ( -f $type || lc $type eq '/dev/null' ) {
- open (FILE,$type) or die "Cannot open preamble file $type: $!";
print STDERR "Reading preamble file $type\n" if $verbose ;
+ open (FILE,$type) or die "Cannot open preamble file $type: $!";
+ if (defined($encoding)) {
+ binmode(FILE,":encoding($encoding)");
+ } else {
+ require Encode::Locale;
+ binmode(FILE,":encoding(locale)");
+ }
while (<FILE>) {
chomp ;
if ( $_ =~ m/%DIF PREAMBLE/ ) {
- push (@retval,"$_");
+ push (@retval,"$_");
} else {
- push (@retval,"$_ %DIF PREAMBLE");
+ push (@retval,"$_ %DIF PREAMBLE");
}
}
} else { # not (-f $type)
@@ -1730,9 +1766,9 @@ sub extrapream {
my $data_start = tell DATA;
while (<DATA>) {
if ( m/^%DIF $type/ ) {
- $copy=1;
+ $copy=1;
} elsif ( m/^%DIF END $type/ ) {
- last;
+ last;
}
chomp;
push (@retval,"$_ %DIF PREAMBLE") if $copy;
@@ -1772,7 +1808,7 @@ sub splitdoc {
$pos=pos $rest;
$part2=substr($rest,0,$pos-length($2));
$part3=substr($rest,$pos);
- }
+ }
else {
die "$word1 and $word2 not in the correct order or not present as a pair." ;
}
@@ -1844,7 +1880,7 @@ sub splitlatex {
my $leadin=$1;
length($string)>0 or return ($leadin);
- my @retval=($string =~ m/$pat/osg);
+ my @retval=($string =~ m/$pat/osg);
if (length($string) != length(join("",@retval))) {
print STDERR "\nWARNING: Inconsistency in length of input string and parsed string:\n This often indicates faulty or non-standard latex code.\n In many cases you can ignore this and the following warning messages.\n Note that character numbers in the following are counted beginning after \\begin{document} and are only approximate." unless $ignorewarnings;
@@ -1888,17 +1924,17 @@ sub splitlatex {
# pass1( \@seq1,\@seq2)
# Look for differences between seq1 and seq2.
-# Where an common-subsequence block is flanked by deleted or appended blocks,
+# Where an common-subsequence block is flanked by deleted or appended blocks,
# and is shorter than $MINWORDSBLOCK words it is appended
-# to the last deleted or appended word. If the block contains tokens other than words
+# to the last deleted or appended word. If the block contains tokens other than words
# or punctuation it is not merged.
# Deleted or appended block consisting of words and safe commands only are
# also merged, to prevent break-up in pass2 (after previous isolated words have been removed)
-# If there are commands with textual arguments (e.g. \caption) both in corresponding
-# appended and deleted blocks split them such that the command and opening bracket
-# are one token, then the rest is split up following standard rules, and the closing
+# If there are commands with textual arguments (e.g. \caption) both in corresponding
+# appended and deleted blocks split them such that the command and opening bracket
+# are one token, then the rest is split up following standard rules, and the closing
# bracket is a separate token, ie. turn
-# "\caption{This is a textual argument}" into
+# "\caption{This is a textual argument}" into
# ("\caption{","This ","is ","a ","textual ","argument","}")
# No return value. Destructively changes sequences
sub pass1 {
@@ -1927,15 +1963,15 @@ sub pass1 {
my $adddiscard = sub {
if ($cnt > 0 ) {
$matblkcnt++;
- # just after an unchanged block
+ # just after an unchanged block
# print STDERR "Unchanged block $cnt, $last1,$last2 \n";
- if ($cnt < $MINWORDSBLOCK
+ if ($cnt < $MINWORDSBLOCK
&& $cnt==scalar (
- grep { /^$wpat/ || ( /^\\((?:[`'^"~=.]|[\w\d@*]+))((?:\[$brat_n\]|\{$pat_n\})*)/o
- && iscmd($1,\@SAFECMDLIST,\@SAFECMDEXCL)
+ grep { /^$wpat/ || ( /^\\((?:[`'^"~=.]|[\w\d@*]+))((?:\[$brat_n\]|\{$pat_n\})*)/o
+ && iscmd($1,\@SAFECMDLIST,\@SAFECMDEXCL)
&& scalar(@dummy=split(" ",$2))<3 ) }
@$block) ) {
- # merge identical blocks shorter than $MINWORDSBLOCK
+ # merge identical blocks shorter than $MINWORDSBLOCK
# and only containing ordinary words
# with preceding different word
# We cannot carry out this merging immediately as this
@@ -1943,23 +1979,23 @@ sub pass1 {
# the algorithm, instead we store in @$todo where we have to merge
push(@$todo, [ $last1,$last2,$cnt,@$block ]);
}
- $block = [];
+ $block = [];
$cnt=0; $last1=-1; $last2=-1;
}
};
my $discard=sub { $deltokcnt++;
&$adddiscard; #($_[0],$_[1]);
push(@$delblock,[ $seq1->[$_[0]],$_[0] ]);
- $last1=$_[0] };
+ $last1=$_[0] };
my $add = sub { $addtokcnt++;
&$adddiscard; #($_[0],$_[1]);
push(@$addblock,[ $seq2->[$_[1]],$_[1] ]);
- $last2=$_[1] };
+ $last2=$_[1] };
my $match = sub { $mattokcnt++;
if ($cnt==0) { # first word of matching sequence after changed sequence or at beginning of word sequence
- $deltextblocks = extracttextblocks($delblock);
+ $deltextblocks = extracttextblocks($delblock);
$delblkcnt++ if scalar @$delblock;
$addtextblocks = extracttextblocks($addblock);
$addblkcnt++ if scalar @$addblock;
@@ -1975,7 +2011,7 @@ sub pass1 {
### Algorithm::Diff 1.19
$matchindex=Algorithm::Diff::_longestCommonSubsequence($delcmds,$addcmds, 0, sub { $_[0]->[0] } );
} else {
- ### Algorithm::Diff 1.15
+ ### Algorithm::Diff 1.15
$matchindex=Algorithm::Diff::_longestCommonSubsequence($delcmds,$addcmds, sub { $_[0]->[0] } );
}
@@ -2006,11 +2042,11 @@ sub pass1 {
my ($index,$block,$cnt)=@{ shift(@$addtextblocks) };
push(@$todo, [-1,$index,$cnt,@$block]);
}
-
+
$addblock=[];
$delblock=[];
}
- push(@$block,$seq2->[$_[1]]);
+ push(@$block,$seq2->[$_[1]]);
$cnt++ };
my $keyfunc = sub { join(" ",split(" ",shift())) };
@@ -2018,7 +2054,7 @@ sub pass1 {
traverse_sequences($seq1,$seq2, { MATCH=>$match, DISCARD_A=>$discard, DISCARD_B=>$add }, $keyfunc );
- # now carry out the merging/splitting. Refer to elements relative from
+ # now carry out the merging/splitting. Refer to elements relative from
# the end (with negative indices) as these offsets don't change before the instruction is executed
# cnt>0: merged small unchanged groups with previous changed blocks
# cnt==-1: split textual commands into components
@@ -2033,7 +2069,7 @@ sub pass1 {
}
}
- if ($verbose) {
+ if ($verbose) {
print STDERR "\n";
print STDERR " $mattokcnt matching tokens in $matblkcnt blocks.\n";
print STDERR " $deltokcnt discarded tokens in $delblkcnt blocks.\n";
@@ -2043,10 +2079,10 @@ sub pass1 {
# extracttextblocks(\@blockindex)
-# $blockindex has the following format
-# [ [ token1, index1 ], [token2, index2],.. ]
-# where index refers to the index in the original old or new word sequence
-# Returns: reference to an array of the form
+# $blockindex has the following format
+# [ [ token1, index1 ], [token2, index2],.. ]
+# where index refers to the index in the original old or new word sequence
+# Returns: reference to an array of the form
# [[ $index, $textblock, $cnt ], ..
# where $index index of block to be merged
# $textblock contains all the words to be merged with the word at $index (but does not contain this word)
@@ -2054,7 +2090,7 @@ sub pass1 {
#
# requires: iscmd
#
-sub extracttextblocks {
+sub extracttextblocks {
my $block=shift;
my ($i,$token,$index);
my $textblock=[];
@@ -2064,13 +2100,13 @@ sub extracttextblocks {
# we redefine locally $extraspace (shadowing the global definition) to capture command sequences with intervening spaces no matter what the global setting
# this is done so we can capture those commands with a predefined number of arguments without having to introduce them again explicitly here
- my $extraspace='\s*';
+ my $extraspace='\s*';
for ($i=0;$i< scalar @$block;$i++) {
($token,$index)=@{ $block->[$i] };
# store pure text blocks
- if ($token =~ /$wpat/ || ( $token =~/^\\((?:[`'^"~=.]|[\w\d@\*]+))((?:${extraspace}\[$brat_n\]${extraspace}|${extraspace}\{$pat_n\})*)/
- && iscmd($1,\@SAFECMDLIST,\@SAFECMDEXCL)
+ if ($token =~ /$wpat/ || ( $token =~/^\\((?:[`'^"~=.]|[\w\d@\*]+))((?:${extraspace}\[$brat_n\]${extraspace}|${extraspace}\{$pat_n\})*)/
+ && iscmd($1,\@SAFECMDLIST,\@SAFECMDEXCL)
&& !iscmd($1,\@TEXTCMDLIST,\@TEXTCMDEXCL))) {
# we have text or a command which can be treated as text
if ($last<0) {
@@ -2078,7 +2114,7 @@ sub extracttextblocks {
$last=$index;
} else {
# add to pure-text block
- push(@$textblock, $token);
+ push(@$textblock, $token);
}
} else {
# it is not text
@@ -2099,29 +2135,29 @@ sub extracttextblocks {
# extractcommands( \@blockindex )
-# $blockindex has the following format
-# [ [ token1, index1 ], [token2, index2],.. ]
-# where index refers to the index in the original old or new word sequence
-# Returns: reference to an array of the form
-# [ [ "\cmd1", index, "\cmd1[optarg]{arg1}{", "arg2" ,"} " ],..
-# where index is just taken from input array
-# command must have a textual argument as last argument
-#
-# requires: iscmd
-#
-sub extractcommands {
+# $blockindex has the following format
+# [ [ token1, index1 ], [token2, index2],.. ]
+# where index refers to the index in the original old or new word sequence
+# Returns: reference to an array of the form
+# [ [ "\cmd1", index, "\cmd1[optarg]{arg1}{", "arg2" ,"} " ],..
+# where index is just taken from input array
+# command must have a textual argument as last argument
+#
+# requires: iscmd
+#
+sub extractcommands {
my $block=shift;
my ($i,$token,$index,$cmd,$open,$mid,$closing);
my $retval=[];
# we redefine locally $extraspace (shadowing the global definition) to capture command sequences with intervening spaces no matter what the global setting
# this is done so we can capture those commands with a predefined number of arguments without having to introduce them again explicitly here
- my $extraspace='\s*';
+ my $extraspace='\s*';
for ($i=0;$i< scalar @$block;$i++) {
($token,$index)=@{ $block->[$i] };
# check if token is an alphanumeric command sequence with at least one non-optional argument
- # \cmd[...]{...}{last argument}
+ # \cmd[...]{...}{last argument}
# Capturing in the following results in these associations
# $1: \cmd[...]{...}{
# $2: \cmd
@@ -2129,7 +2165,7 @@ sub extractcommands {
# $4: } + trailing spaces
if ( ( $token =~ m/^(\\([\w\d\*]+)(?:${extraspace}\[$brat_n\]|${extraspace}\{$pat_n\})*${extraspace}\{)($pat_n)(\}\s*)$/so )
&& iscmd($2,\@TEXTCMDLIST,\@TEXTCMDEXCL) ) {
- print STDERR "DEBUG EXTRACTCOMMANDS Match |$1|$2|$3|$4|$index \n" if $debug;
+ print STDERR "DEBUG EXTRACTCOMMANDS Match |$1|$2|$3|$4|$index \n" if $debug;
# push(@$retval,[ $2,$index,$1,$3,$4 ]);
($cmd,$open,$mid,$closing) = ($2,$1,$3,$4) ;
$closing =~ s/\}/\\RIGHTBRACE/ ;
@@ -2140,7 +2176,7 @@ sub extractcommands {
}
# iscmd($cmd,\@regexarray,\@regexexcl) checks
-# return 1 if $cmd matches any of the patterns in the
+# return 1 if $cmd matches any of the patterns in the
# array $@regexarray, and none of the patterns in \@regexexcl, otherwise return 0
sub iscmd {
my ($cmd,$regexar,$regexexcl)=@_;
@@ -2148,7 +2184,7 @@ sub iscmd {
### print STDERR "DEBUG: iscmd($cmd)=" if $debug;
foreach $pat ( @$regexar ) {
if ( $cmd =~ m/^${pat}$/ ) {
- $ret=1 ;
+ $ret=1 ;
last;
}
}
@@ -2164,13 +2200,13 @@ sub iscmd {
# pass2( \@seq1,\@seq2)
-# Look for differences between seq1 and seq2.
+# Look for differences between seq1 and seq2.
# Mark begin and end of deleted and appended sequences with tags $DELOPEN and $DELCLOSE
# and $ADDOPEN and $ADDCLOSE, respectively, however exclude { } & and all comands, unless
# they match an element of the whitelist (SAFECMD)
# For words in TEXTCMD but not in SAFECMD, enclose interior with $ADDOPEN and $ADDCLOSE brackets
-# Deleted comment lines are marked with %DIF <
-# Added comment lines are marked with %DIF >
+# Deleted comment lines are marked with %DIF <
+# Added comment lines are marked with %DIF >
sub pass2 {
my $seq1 = shift ;
my $seq2 = shift ;
@@ -2202,7 +2238,7 @@ sub pass2 {
$addhunk = [];
}
push(@$retval,$seq2->[$_[1]]) };
-
+
my $keyfunc = sub { join(" ",split(" ",shift())) };
traverse_sequences($seq1,$seq2, { MATCH=>$match, DISCARD_A=>$discard, DISCARD_B=>$add }, $keyfunc );
@@ -2211,7 +2247,7 @@ sub pass2 {
push @$retval,marktags($ADDMARKOPEN,$ADDMARKCLOSE,$ADDOPEN,$ADDCLOSE,"","",$ADDCOMMENT,$addhunk) if scalar @$addhunk;
- if ($verbose) {
+ if ($verbose) {
print STDERR "\n";
print STDERR " $mattokcnt matching tokens. \n";
print STDERR " $deltokcnt discarded tokens in $delblkcnt blocks.\n";
@@ -2233,7 +2269,7 @@ sub marktags {
my (@argtext);
my $retval=[];
my $noncomment=0;
- my $cmd=-1; # -1 at beginning 0: last token written is a ordinary word
+ my $cmd=-1; # -1 at beginning 0: last token written is a ordinary word
# 1: last token written is a command
# for keeping track whether we are just in a command sequence or in a word sequence
my $cmdcomment= ($opencmd =~ m/^%/); # Flag to indicate whether opencmd is a comment (i.e. if we intend to simply comment out changed commands)
@@ -2249,31 +2285,31 @@ sub marktags {
# we redefine locally $extraspace (shadowing the global definition) to capture command sequences with intervening spaces no matter what the global setting
# this is done so we can capture those commands with a predefined number of arguments without having to introduce them again explicitly here
- my $extraspace_mt='\s*';
+ my $extraspace_mt='\s*';
foreach (@$block) {
- $word=$_;
+ $word=$_;
if ( $word =~ s/^%/%$comment/ ) {
# a comment
if ($cmd==1) {
push (@$retval,$closecmd) ;
$cmd=-1;
}
- push (@$retval,$word);
+ push (@$retval,$word);
next;
}
if ( $word =~ m/^\s*$/ ) {
### print STDERR "DEBUG MARKTAGS: whitespace detected |$word| cmdcom |$cmdcomment| |$opencmd|\n" if $debug;
# a sequence of white-space characters - this should only ever happen for the first element of block.
- # in deleted block, omit, otherwise just copy it in
+ # in deleted block, omit, otherwise just copy it in
if ( ! $cmdcomment) { # ignore in deleted blocks
push(@$retval,$word);
}
next;
}
if (! $noncomment) {
- push (@$retval,$openmark);
+ push (@$retval,$openmark);
$noncomment=1;
}
# negative lookahead pattern (?!) in second clause is put in to avoid matching \( .. \) patterns
@@ -2283,7 +2319,7 @@ sub marktags {
# word is a command or other significant token (not in SAFECMDLIST)
## same conditions as in subroutine extractcommand:
# check if token is an alphanumeric command sequence with at least one non-optional argument
- # \cmd[...]{...}{last argument}
+ # \cmd[...]{...}{last argument}
# Capturing in the following results in these associations
# $1: \cmd[...]{...}{
# $2: cmd
@@ -2300,11 +2336,11 @@ sub marktags {
# Condition 3: But if we are in a deleted block ($cmdcomment=1) and
# $2 (the command) is in context2, just treat it as an ordinary command (i.e. comment it open with $opencmd)
# Because we do not want to disable this command
- # here we do not use $opencmd and $closecmd($opencmd is empty)
+ # here we do not use $opencmd and $closecmd($opencmd is empty)
print STDERR "DEBUG: Detected text |$word| but not safe command \$2: $2 \$3: $3\n." if $debug;
if ($cmd==1) {
push (@$retval,$closecmd) ;
- } elsif ($cmd==0) {
+ } elsif ($cmd==0) {
push (@$retval,$close) ;
}
$command=$1; $commandword=$2; $closingbracket=$4;
@@ -2320,16 +2356,16 @@ sub marktags {
# for latexrevise
push (@$retval,$command,"%\n{$AUXCMD\n",marktags("","",$open,$close,$opencmd,$closecmd,$comment,\@argtext),$closingbracket);
} elsif ( iscmd($commandword,,\@MATHTEXTCMDLIST, \@MATHTEXTCMDEXCL) ) {
- # MATHBLOCK pseudo command: consider all commands safe, except & and \\, \begin and \end and a few package sprcific one (look at UNSAFEMATHCMD definition)
- # Keep these commands even in deleted blocks, hence set $opencmd and $closecmd (5th and 6th argument of marktags) to
+ # MATHBLOCK pseudo command: consider all commands safe, except & and \\, \begin and \end and a few package sprcific one (look at UNSAFEMATHCMD definition)
+ # Keep these commands even in deleted blocks, hence set $opencmd and $closecmd (5th and 6th argument of marktags) to
# ""
- local @SAFECMDLIST=(".*");
+ local @SAFECMDLIST=(".*");
local @SAFECMDEXCL=('\\','\\\\',@UNSAFEMATHCMD);
push(@$retval,$command,marktags("","",$open,$close,"","",$comment,\@argtext)#@argtext
,$closingbracket);
} else {
# normal textcmd or context1cmd in an added block
- push (@$retval,$command,marktags("","",$open,$close,$opencmd,$closecmd,$comment,\@argtext),$closingbracket);
+ push (@$retval,$command,marktags("","",$open,$close,$opencmd,$closecmd,$comment,\@argtext),$closingbracket);
}
push (@$retval,$AUXCMD,"\n") if $cmdcomment ;
$cmd=-1 ;
@@ -2415,10 +2451,10 @@ sub take_comments_and_newline_from_frac() {
# names or labels but it does not matter because they are converted back in the postprocessing step
# Returns: leading white space removed in step 1
sub preprocess {
- for (@_) {
+ for (@_) {
- # change in \verb and similar commands - note that I introduce an extra space here so that the
+ # change in \verb and similar commands - note that I introduce an extra space here so that the
# already hashed variants do not trigger again
# transform \lstinline{...}
# s/\\lstinline(\[$brat0\])?(\{(?:.*?)\})/"\\DIFlstinline". $1 ."{". tohash(\%verbhash,"$2") ."}"/esg;
@@ -2448,7 +2484,7 @@ sub preprocess {
1 while s/(?<!\\)_(\s*{($pat_n)})/\\SUBSCRIPT$1/g ;
# Convert ^n into \SUPERSCRIPTNB{n} and ^{nnn} into \SUPERSCRIPT{nn}
1 while s/(?<!\\)\^(\s*([^{\\\s]|\\\w+))/\\SUPERSCRIPTNB{$1}/g ;
- 1 while s/(?<!\\)\^(\s*{($pat_n)})/\\SUPERSCRIPT$1/g ;
+ 1 while s/(?<!\\)\^(\s*{($pat_n)})/\\SUPERSCRIPT$1/g ;
# Convert \sqrt{n} into \SQRT{n} and \sqrt nn into SQRTNB{nn}
1 while s/(?<!\\)\\sqrt(\s*([^{\\\s]|\\\w+))/\\SQRTNB{$1}/g ;
1 while s/(?<!\\)\\sqrt(\s*{($pat_n)})/\\SQRT$1/g ;
@@ -2468,16 +2504,16 @@ sub preprocess {
if ( $mathmarkup != FINE ) {
# DIFANCHORARRB and DIFANCHORARRE, DIFANCHORMATHB and DIFANCHORMATHE markers are inserted here to encourage the matching algorithm
# to always match up the closing brace. Otherwise sometimes one ends up with a situation where
- # the closing brace is deleted and added at another point. The deleted closing brace is then
+ # the closing brace is deleted and added at another point. The deleted closing brace is then
# prevented by a %DIFDELCMD, leading to material leaking in or out of the math environment.
# The anchors are removed in post-processing again. (note that they are simple text to cause least amount of complications
- # Admittedly, this is something of a hack and will not always work. If it does not, then one needs to
+ # Admittedly, this is something of a hack and will not always work. If it does not, then one needs to
# resort to WHOLE or FINE, or NONE math mode processing.
s/\\begin\{($ARRENV)}(.*?)\\end\{\1}/\\ARRAYBLOCK$1\{$2\\DIFANCHORARRB \}\\DIFANCHORARRE /sg;
take_comments_and_newline_from_frac();
- # Convert Math environments with arguments
+ # Convert Math environments with arguments
s/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)\}((?:\[$brat_n\])|(?:\{$pat_n\}))+(.*?)\\end\{\1\}/\\MATHBLOCK$1\[$2\]\{$3\\DIFANCHORMATHB \}\\DIFANCHORMATHE /sg;
# Convert Math environments without arguments
s/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)\}(.*?)\\end\{\1\}/\\MATHBLOCK$1\{$2\\DIFANCHORMATHB \}\\DIFANCHORMATHE /sg;
@@ -2491,7 +2527,7 @@ sub preprocess {
# $expanded=linecomment($string)
#preface all lines with verbatim marker (usually DIFVRB)
-sub linecomment {
+sub linecomment {
my @verbatimlines=split("\n",$_[0]);
# the first line needs special treatment - we do want to retain optional arguments as is but wrap the remainder also with VERBCOMMENT
### print STDERR "DEBUG: before verbatimlines[0] = ",$verbatimlines[0],"\n";
@@ -2501,7 +2537,7 @@ sub linecomment {
}
# $simple=reverselinecomment($env $string)
-# remove DIFVRB comments but leave changed lines marked
+# remove DIFVRB comments but leave changed lines marked
sub reverselinecomment {
my ($environment, $verbatimtext)=@_;
### print STDERR "DEBUG REVERSELINECOMMENT input: $environment,|$verbatimtext|\n" if $debug;
@@ -2516,7 +2552,7 @@ sub reverselinecomment {
$verbatimtext =~ s/\\DIFdelend //g;
$verbatimtext =~ s/$DELCMDOPEN.*//g;
- # remove DIFVRB mark
+ # remove DIFVRB mark
$verbatimtext=~ s/%$VERBCOMMENT//g;
# remove part of the markup in changed lines
@@ -2607,7 +2643,7 @@ sub writedebugfile {
# * Remove STOP token from the end
# * Replace \RIGHTBRACE by }
# * If option --no-del is set delete all deleted blocks
-# 1. Check all deleted blocks:
+# 1. Check all deleted blocks:
# a.where a deleted block contains a matching \begin and
# \end environment (these will be disabled by a %DIFDELCMD statements), for selected environments enable
# these commands again (such that for example displayed math in a deleted equation
@@ -2628,14 +2664,14 @@ sub writedebugfile {
# For added blocks:
# c. If in-line math mode contains array environment, enclose the whole environment in \mbox'es
# d. place \cite commands in mbox'es (for UNDERLINE style)
-#
+#
# 2. If math-mode COARSE,WHOLE or NONE option set: Convert \MATHBLOCKmath{..} commands back to environments
#
# Convert all PICTUREblock{..} commands back to the appropriate environments
# 3. Convert DIFadd, DIFdel, DIFaddbegin , ... into FL varieties
# within floats (currently recognised float environments: plate,table,figure
# plus starred varieties).
-# 4. Remove empty %DIFDELCMD < lines
+# 4. Remove empty %DIFDELCMD < lines
# 4. Convert \begin{SQUAREBRACKET} \end{SQUAREBRACKET} into \[ \]
# Convert \begin{DOLLARDOLLAR} \end{DOLLARDOLLAR} into $$ $$
# 5. Convert \SUPERSCRIPTNB{n} into ^n and \SUPERSCRIPT{nn} into ^{nnn}
@@ -2648,7 +2684,7 @@ sub writedebugfile {
# 4, undo renaming of the \begin, \end,{,} in comments
# Change \QLEFTBRACE, \QRIGHTBRACE,\AMPERSAND to \{,\},\&
#
-# Note have to manually synchronize substitution commands below and
+# Note have to manually synchronize substitution commands below and
# DIF.. command names in the header
sub postprocess {
my ($begin,$len,$float,$delblock,$addblock); ### $cnt
@@ -2660,7 +2696,7 @@ sub postprocess {
my (@itemargs, $itemarg);
- for (@_) {
+ for (@_) {
# change $'s in comments to something harmless
1 while s/(%.*)\$/$1DOLLARDIF/mg ;
@@ -2670,7 +2706,7 @@ sub postprocess {
# the only way to get these is as %DIFDELCMD < \RIGHTBRACE construction
# This essentially marks closing right braces of MATHBLOCK environments, which did not get matched
# up. This case should be rare, so I just leave this in the diff file output. Not really elegant
- # but can still be dealt with later if it results in problems.
+ # but can still be dealt with later if it results in problems.
s/%DIFDELCMD < \\RIGHTBRACE/%DIFDELCMD < \\MBLOCKRIGHTBRACE/g ;
# Replace \RIGHTBRACE by }
s/\\RIGHTBRACE/}/g;
@@ -2698,7 +2734,7 @@ sub postprocess {
$len=length($&);
$begin=pos($_) - $len;
$delblock=$&;
- ### A much simpler method for math replacement might follow this strategy (can recycle part of the commands below for following
+ ### A much simpler method for math replacement might follow this strategy (can recycle part of the commands below for following
### this strategy:
### 1. a Insert aux commands \begin{MATHMODE} or \end{MATHMODE} for all deleted commands opening or closing displayed math mode
### b Insert aux commands \begin{MATHARRMODE} or \end{MATHARRMODE} for all deleted commands opening or closing math array mode
@@ -2724,14 +2760,14 @@ sub postprocess {
###0.5: $delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \s*\\end\{((?:$MATHENV)|SQUAREBRACKET)\}\s*?(?:$DELCMDCLOSE|\n))(.*?[^\n]?)\n?(?<!${AUXCMD}\n)(\%DIFDELCMD < \s*\\begin\{\2\})/\\end{MATHMODE}$AUXCMD\n$1$3\n\\begin{MATHMODE}$AUXCMD\n$4/sg;
$delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\end\{((?:$MATHENV)|SQUAREBRACKET)\}.*?(?:$DELCMDCLOSE|\n))(.*?[^\n]?)\n?(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\begin\{\2\})/\\end\{MATHMODE\}$AUXCMD\n$1$3\n\\begin\{MATHMODE\}$AUXCMD\n$4/sg;
- # now look for unpaired %DIFDELCMD < \begin{MATHENV}; if found add \begin{$MATHREPL} and insert \end{$MATHREPL}
+ # now look for unpaired %DIFDELCMD < \begin{MATHENV}; if found add \begin{$MATHREPL} and insert \end{$MATHREPL}
# just before end of block; again we use look-behind assertion to avoid matching constructions which have already been converted
if ($delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\begin\{((?:$MATHENV)|SQUAREBRACKET)\}\s*?(?:$DELCMDCLOSE|\n))/$1\\begin{$MATHREPL}$AUXCMD\n/sg ) {
### print STDERR "BINGO: begin block: \nBefore: |" . substr($_,$begin,$len) . "|\n" if $debug ;
$delblock =~ s/(\\DIFdelend$)/\\end{$MATHREPL}$AUXCMD\n$1/s ;
### print STDERR "After: |" . $delblock . "|\n\n" if $debug ;
}
- # now look for unpaired %DIFDELCMD < \end{MATHENV}; if found add \end{MATHMODE} and insert \begin{MATHMODE}
+ # now look for unpaired %DIFDELCMD < \end{MATHENV}; if found add \end{MATHMODE} and insert \begin{MATHMODE}
# just before end of block; again we use look-behind assertion to avoid matching constructions which have already been converted
if ($delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\end\{((?:$MATHENV)|SQUAREBRACKET)\}\s*?(?:$DELCMDCLOSE|\n))/$1\\end\{MATHMODE\}$AUXCMD\n/sg ) {
### print STDERR "BINGO: end block:\nBefore: |" . substr($_,$begin,$len) . "|\n" if $debug;
@@ -2754,15 +2790,15 @@ sub postprocess {
$delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\end\{($MATHARRENV)\}\s*?(?:$DELCMDCLOSE|\n))(.*?[^\n]?)\n?(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\begin\{\2\})/\\end{MATHMODE}$AUXCMD\n$1$3\n\\begin{MATHMODE}$AUXCMD\n$4/sg;
### print STDERR "STEP1: |" . $delblock . "|\n\n" if $debug ;
- # now look for unpaired %DIFDELCMD < \begin{MATHARRENV}; if found add \begin{$MATHARRREPL} and insert \end{$MATHARRREPL}
+ # now look for unpaired %DIFDELCMD < \begin{MATHARRENV}; if found add \begin{$MATHARRREPL} and insert \end{$MATHARRREPL}
# just before end of block; again we use look-behind assertion to avoid matching constructions which have already been converted
if ($delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\begin\{($MATHARRENV)\}(.*?)(?:$DELCMDCLOSE|\n))/$1\\begin{$2*}$3$AUXCMD\n/sg ) {
$arrenv=$2;
- $delblock =~ s/(\\DIFdelend$)/\\end{$arrenv*}}$AUXCMD\n$1/s ;
+ $delblock =~ s/(\\DIFdelend$)/\\end{$arrenv*}$AUXCMD\n$1/s ;
}
### print STDERR "STEP2: |" . $delblock . "|\n\n" if $debug ;
- # now look for unpaired %DIFDELCMD < \end{MATHENV}; if found add \end{MATHMODE} and insert \begin{MATHMODE}
+ # now look for unpaired %DIFDELCMD < \end{MATHENV}; if found add \end{MATHMODE} and insert \begin{MATHMODE}
# just before end of block; again we use look-behind assertion to avoid matching constructions which have already been converted
if ($delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\end\{($MATHARRENV)\}\s*?(?:$DELCMDCLOSE|\n))/$1\\end{MATHMODE}$AUXCMD\n/sg ) {
$delblock =~ s/(\\DIFdelend$)/\\begin{MATHMODE}$AUXCMD\n$1/s ;
@@ -2780,7 +2816,7 @@ sub postprocess {
### $eqarrayblock=~ s/(\%DIFDELCMD < \s*(\&|\\\\)\s*?(?:$DELCMDCLOSE|\n))/$1$2$AUXCMD\n/sg ;
$eqarrayblock =~ s/(\%DIFDELCMD < (.*?(?:\&|\\\\).*)(?:$DELCMDCLOSE|\n))/
# The pattern captures comments with at least one of & or \\
- @symbols= split(m@((?:&|\\\\)\s*)@,$2); # extract & and \\ and other material from sequence
+ @symbols= split(m@((?:&|\\\\)\s*)@,$2); # extract & and \\ and other material from sequence
@symbols= grep ( m@&|\\\\\s*@, @symbols); # select & and \\ (and subsequent spaces)
"$1@symbols$AUXCMD\n"
/eg ;
@@ -2793,7 +2829,7 @@ sub postprocess {
} elsif ( $mathmarkup == COARSE || $mathmarkup == WHOLE ) {
# Convert MATHBLOCKmath commands to their uncounted numbers (e.g. convert equation -> displaymath
# (environments defined in $MATHENV will be replaced by $MATHREPL, and environments in $MATHARRENV
- # will be replaced by their starred variety
+ # will be replaced by their starred variety
$delblock=~ s/\\MATHBLOCK($MATHENV)((?:\[$brat_n\])?)\{($pat_n)\}/\\MATHBLOCK$MATHREPL$2\{$3\}/sg;
$delblock=~ s/\\MATHBLOCK($MATHARRENV)((?:\[$brat_n\])?)\{($pat_n)\}/\\MATHBLOCK$1\*$2\{$3\}/sg;
}
@@ -2807,10 +2843,10 @@ sub postprocess {
print STDERR "DELBLOCK after maths processing: |" . $delblock . "|\n\n" if $debug ;
- # Reinstate completely deleted list environments. note that items within the
+ # Reinstate completely deleted list environments. note that items within the
# environment will still be commented out. They will be restored later
$delblock=~ s/(\%DIFDELCMD < \s*\\begin\{($LISTENV)\}\s*?(?:\n|$DELCMDCLOSE))(.*?)(\%DIFDELCMD < \s*\\end\{\2\})/{
- ### # block within the search; replacement environment
+ ### # block within the search; replacement environment
### "$1\\begin{$2}$AUXCMD\n". restore_item_commands($3). "\n\\end{$2}$AUXCMD\n$4";
"$1\\begin{$2}$AUXCMD\n$3\n\\end{$2}$AUXCMD\n$4";
}/esg;
@@ -2844,7 +2880,7 @@ sub postprocess {
### if ($CITE2CMD) {
###### ${extraspace}(?:\[$brat0\]${extraspace}){0,2}\{$pat_n\})) .*?%%%\n
### $delblock=~s/($DELCMDOPEN\s*\\($CITE2CMD)(.*)$DELCMDCLOSE)/
- ### # Replacement code
+ ### # Replacement code
### {my ($aux,$all);
### $aux=$all=$1;
### $aux=~s#\n?($DELCMDOPEN|$DELCMDCLOSE)##g;
@@ -2854,7 +2890,7 @@ sub postprocess {
### if ($CITECMD) {
###### $delblock=~s/(\\($CITECMD)${extraspace}(?:\[$brat0\]${extraspace}){0,2}\{$pat_n\})(\s*)/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/msg ;
### $delblock=~s/(\\($CITECMD)${extraspace}(?:<$abrat0>${extraspace})?(?:\[$brat0\]${extraspace}){0,2}\{$pat_n\})(\s*)/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/msg ;
- ### }
+ ### }
# if MBOXINLINEMATH is set, protect inlined math environments with an extra mbox
@@ -2862,7 +2898,7 @@ sub postprocess {
# note additional \newline after command is omitted from output if right at the end of deleted block (otherwise a spurious empty line is generated)
$delblock=~s/($math)(?:[\s\n]*)?/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/sg;
}
- ###if ( defined($packages{"listings"} and $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{color\}/)) {
+ ###if ( defined($packages{"listings"} and $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{color\}/)) {
### # change included verbatim environments
### $delblock =~ s/\\DIFverb\{/\\DIFDIFdelverb\{/g;
### $delblock =~ s/\\DIFlstinline/\\DIFDIFdellstinline/g;
@@ -2904,7 +2940,7 @@ sub postprocess {
##$addblock=~s/($math)/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/sg;
$addblock=~s/($math)(?:[\s\n]*)?/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/sg;
}
- ###if ( defined($packages{"listings"} and $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat0\])?\{color\}/)) {
+ ###if ( defined($packages{"listings"} and $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat0\])?\{color\}/)) {
# mark added verbatim commands
$addblock =~ s/\\DIFverb/\\DIFDIFaddverb/g;
$addblock =~ s/\\DIFlstinline/\\DIFDIFaddlstinline/g;
@@ -2922,11 +2958,11 @@ sub postprocess {
pos = $begin + length($addblock);
}
- # Go through whole text, and by counting list environment commands, find out when we are within a list environment.
+ # Go through whole text, and by counting list environment commands, find out when we are within a list environment.
# Within those restore deleted \item commands
- @textparts=split /(?<!$DELCMDOPEN)(\\(?:begin|end)\{$LISTENV\})/ ;
+ @textparts=split /(?<!$DELCMDOPEN)(\\(?:begin|end)\{$LISTENV\})/ ;
@liststack=();
- @newtextparts=map {
+ @newtextparts=map {
### print STDERR ":::::::: $_\n";
if ( ($listtype) = m/^\\begin\{($LISTENV)\}$/ ) {
print STDERR "DEBUG: postprocess \\begin{$listtype}\n" if $debug;
@@ -2942,7 +2978,7 @@ sub postprocess {
} else {
print STDERR "DEBUG: postprocess \@liststack=(",join(",",@liststack),")\n" if $debug;
if (scalar @liststack > 0 ) {
- # we are within a list environment and should replace all item commands
+ # we are within a list environment and should replace all item commands
$_=restore_item_commands($_);
}
# else: we are outside a list environment and do not need to do anything
@@ -2955,17 +2991,17 @@ sub postprocess {
# Replace MATHMODE environments from step 1a above by the correct Math environment and remove unncessary pairings
-
+
if ( $mathmarkup == FINE ) {
# look for AUXCMD math-mode pairs which have only comments (or empty lines between them), and remove the added commands
# \begin{..} ... \end{..} pairs
- s/\\begin\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET|MATHMODE)\}$AUXCMD\n((?:\s*%.[^\n]*\n)*)\\end\{\1\}$AUXCMD\n/$2/sg;
+ s/\\begin\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET|MATHMODE)\}$AUXCMD\n((?:\s*%.[^\n]*\n)*)\\end\{\1\}$AUXCMD\n/$2/sg;
# \end{..} .... \begin{..} pairs
- s/\\end\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET|MATHMODE)\}$AUXCMD\n((?:\s*%.[^\n]*\n)*)\\begin\{\1\}$AUXCMD\n/$2/sg;
+ s/\\end\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET|MATHMODE)\}$AUXCMD\n((?:\s*%.[^\n]*\n)*)\\begin\{\1\}$AUXCMD\n/$2/sg;
writedebugfile($_,'postprocess15');
# The next line is complicated. The negative look-ahead insertion makes sure that no \end{$MATHENV} (or other mathematical
- # environments) are between the \begin{$MATHENV} and \end{MATHMODE} commands. This is necessary as the minimal matching
+ # environments) are between the \begin{$MATHENV} and \end{MATHMODE} commands. This is necessary as the minimal matching
# is not globally minimal but only 'locally' (matching is beginning from the left side of the string)
# [NB: Do not be tempted to prettify the expression with /x modified. It seems this is applied after strings are expanded so will ignore spaces in strings
1 while s/(?<!$DELCMDOPEN)\\begin\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}((?:${DELCMDOPEN}[^\n]*|.(?!(?:\\end\{(?:(?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}|\\begin\{MATHMODE})))*?)\\end\{MATHMODE}/\\begin{$1}$2\\end{$1}/s;
@@ -3040,7 +3076,7 @@ sub postprocess {
# remove empty DIFCMD < lines
s/^\Q${DELCMDOPEN}\E\n//msg;
- # Expand hashes of verb and verbatim environments
+ # Expand hashes of verb and verbatim environments
s/${DELCMDOPEN}\\($VERBATIMENV)\{([-\d]*?)\}/"${DELCMDOPEN}\\begin{${1}}".fromhash(\%verbhash,$2,$DELCMDOPEN)."${DELCMDOPEN}\\end{${1}}"/esg;
# revert changes to verbatim environments for line diffs (and add code to mark up changes) (note negative look behind assertions to not leak out of DIFDELCMD comments)
# Example:
@@ -3066,8 +3102,8 @@ sub postprocess {
((?:\%\Q$DELCOMMENT$VERBCOMMENT\E[^\n]*?\n)*)
# Deleted \end command of verbatim environment. Note that the type is forced to match the opening. Captures: $5: Whole deleted environment (previous way this line was written: (\Q$DELCMDOPEN\E\\end\{\2\}(?:\n|\s|\Q$DELCMDOPEN\E)*\Q$DELCMDCLOSE\E)
(\Q$DELCMDOPEN\E\\end\{\2\})
- / # Substitution part
- $1 # Leave expression as is
+ / # Substitution part
+ $1 # Leave expression as is
. "$AUXCMD NEXT\n" # Mark the following line as an auxiliary command
. "" # reinstate the original environment without options
. reverselinecomment($2, "$3$4") # modify the body to change the markup; reverselinecomment parses for options
@@ -3076,7 +3112,7 @@ sub postprocess {
/esgx; # Modifiers of substitution command
writedebugfile($_,'postprocess2');
# where changes have occurred in verbatim environment, change verbatim to DIFverbatim to allow mark-up
- # (I use the presence of optional paramater to verbatim environment as the marker - normal verbatim
+ # (I use the presence of optional paramater to verbatim environment as the marker - normal verbatim
# environment does not take optional arguments)
s/(?<!$DELCMDOPEN)\\begin\{(verbatim[*]?)\}(\[$brat_n\].*?)\\end\{\1\}/\\begin{DIF$1}$2\\end{DIF$1}/sg;
@@ -3090,7 +3126,7 @@ sub postprocess {
# convert remaining PAR commands (which are preceded by non-white space characters, usually "}" ($ADDCLOSE)
s/\\PAR\n/\n\n/sg;
- # package specific processing:
+ # package specific processing:
if ( defined($packages{"endfloat"})) {
#endfloat: make sure \begin{figure} and \end{figure} are always
# on a line by themselves, similarly for table environment
@@ -3103,12 +3139,16 @@ sub postprocess {
s/^((?:[^%]+)\\(?:begin|end)\{(?:figure|table)\}(?:\[[a-zA-Z]+\])?)(.+)((?:%.*)?)$/$1\n$2$3/mg;
}
- # Convert '\PERCENTAGE ' back into '\%' (the final question mark catches a special situation where due to a latter pre-processing step the ' ' becomes separated
+ # Remove empty auxiliary LISTENV (sometmes these are generated if list environment occurs within the argument of a deleted comment)
+ # (slightly hacky but I could not see an easy way to see if in argument of another command when this extra markup is added)
+ s/\\begin\{($LISTENV)\}$AUXCMD\n((?:\s*\%[^\n]*\n)*\n?)\\end\{\1\}$AUXCMD\n/$2\n/msg ;
+
+ # Convert '\PERCENTAGE ' back into '\%' (the final question mark catches a special situation where due to a latter pre-processing step the ' ' becomes separated
s/\\PERCENTAGE ?/\\%/g;
- # Convert '\DOLLAR ' back into '\$'
+ # Convert '\DOLLAR ' back into '\$'
s/\\DOLLAR /\\\$/g;
- # undo renaming of the \begin and \end,{,} and dollars in comments
+ # undo renaming of the \begin and \end,{,} and dollars in comments
# although we only renamed $ in comments to DOLLARDIFF, we might have lost the % in unchanged verbatim blocks, so rename all
s/DOLLARDIF/\$/g;
@@ -3126,7 +3166,7 @@ sub postprocess {
# Convert \SQRT{n} into \sqrt{n} and \SQRTNB{nn} into \sqrt nn
1 while s/\\SQRT(\s*\{($pat_n)\})/\\sqrt$1/g ;
1 while s/\\SQRTNB\{(\s*$pat0)\}/\\sqrt$1/g ;
-
+
1 while s/(%.*)\\CFRAC (.*)$/$1\\frac$2/mg ;
1 while s/(%.*)\\CRIGHTBRACE (.*)$/$1\}$2/mg ;
1 while s/(%.*)\\CLEFTBRACE (.*)$/$1\{$2/mg ;
@@ -3137,7 +3177,7 @@ sub postprocess {
s/\\QRIGHTBRACE /\\\}/sg;
s/\\AMPERSAND /\\&/sg;
# Highlight added inline verbatim commands if possible
- if ( $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{color\}/ ) {
+ if ( $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{color\}/ ) {
# wrap added verb commands with color commands
s/\\DIFDIFadd((?:verb\*?|lstinline(?:\[$brat_n\])?)\{[-\d]*?\}[\s\n]*)/\{\\color{blue}$AUXCMD\n\\DIF$1%\n\}$AUXCMD\n/sg;
s/\\DIFDIFdel((?:verb\*?|lstinline(?:\[$brat_n\])?)\{[-\d]*?\}[\s\n]*$AUXCMD)/\{\\color{red}${AUXCMD}\n\\DIF$1\n\}${AUXCMD}/sg;
@@ -3152,8 +3192,8 @@ sub postprocess {
# finally add the comment to the ones not having an optional argument before
###s/\\DIFaddlstinline(?!\[)/\\lstinline\n[basicstyle=\\color{blue}]$AUXCMD\n/g;
- return;
}
+ return;
}
# $out = restore_item_commands($listenviron)
@@ -3177,13 +3217,13 @@ sub restore_item_commands {
# @auxlines=preprocess_preamble($oldpreamble,$newpreamble);
- # pre-process preamble by looking for commands used in \maketitle (title, author, date etc commands)
- # the list of commands is defined in CONTEXT2CMD
- # if found then use a bodydiff to mark up content, and replace the corresponding commands
+ # pre-process preamble by looking for commands used in \maketitle (title, author, date etc commands)
+ # the list of commands is defined in CONTEXT2CMD
+ # if found then use a bodydiff to mark up content, and replace the corresponding commands
# in both preambles by marked up version to 'fool' the linediff (such that only body is marked up).
# A special case are e.g. author commands being added (or removed)
# 1. If commands are added, then the entire content is marked up as new, but also the lines are marked as new in the linediff
- # 2. If commands are removed, then the linediff will mark the line as deleted. The program returns
+ # 2. If commands are removed, then the linediff will mark the line as deleted. The program returns
# with $auxlines a text to be appended at the end of the preamble, which shows the respective fields as deleted
sub preprocess_preamble {
my ($oldpreambleref,$newpreambleref)=(\$_[0],\$_[1]) ;
@@ -3205,7 +3245,7 @@ EOF
$titlecmd = "(?:".join("|",@CONTEXT2CMDLIST).")";
# as context2cmdlist is stored as regex, e.g. ((?-xism:^title$), we need to remove ^- fo
# resue in a more complex regex
- $titlecmd =~ s/[\$\^]//g;
+ $titlecmd =~ s/[\$\^]//g;
# make sure to not match on comment lines:
$titlecmdpat=qr/^(?:[^%\n]|\\%)*(\\($titlecmd)$extraspace(?:\[($brat_n)\])?(?:\{($pat_n)\}))/ms;
###print STDERR "DEBUG:",$titlecmdpat,"\n";
@@ -3231,7 +3271,7 @@ EOF
$cmd=shift @newtitlecommands;
$optarg=shift @newtitlecommands;
$arg=shift @newtitlecommands;
-
+
if ( defined($newhash{$cmd})) {
warn "$cmd is used twice in preamble of new file. Reverting to pure line diff mode for preamble.\n";
print STDERR $warnmsgdetail;
@@ -3258,7 +3298,7 @@ EOF
}
$argnew=$newhash{$cmd}->[2];
$argdiff="{" . join("",bodydiff($argold,$argnew)) ."}";
- # Replace \RIGHTBRACE by }
+ # Replace \RIGHTBRACE by }
$argdiff =~ s/\\RIGHTBRACE/}/g;
if ( length $optargnew ) {
@@ -3273,7 +3313,7 @@ EOF
$optargdiff="";
}
### print STDERR "DEBUG s/\\Q$newhash{$cmd}->[0]\\E/\\$cmd$optargdiff$argdiff/s\n";
- # Note: \Q and \E force literal interpretation of what it between them but allow
+ # Note: \Q and \E force literal interpretation of what it between them but allow
# variable interpolation, such that e.g. \title matches just that and not TAB-itle
$$newpreambleref=~s/\Q$newhash{$cmd}->[0]\E/\\$cmd$optargdiff$argdiff/s;
# replace this in old preamble if necessary
@@ -3313,7 +3353,7 @@ EOF
#%< old deleted line(s)
#%DIF -------
#%DIF mmann-nn
-#new appended line %<
+#new appended line %<
#%DIF -------
# Future extension: mark change explicitly
# Assumes: traverse_sequence traverses deletions before insertions in changed sequences
@@ -3325,9 +3365,9 @@ sub linediff {
my $block = [];
my $retseq = [];
my @begin=('','',''); # dummy initialisation
- my $instring ;
+ my $instring ;
- my $discard = sub { @begin=('d',$_[0],$_[1]) unless scalar @$block ;
+ my $discard = sub { @begin=('d',$_[0],$_[1]) unless scalar @$block ;
push(@$block, "%DIF < " . $seq1->[$_[0]]) };
my $add = sub { if (! scalar @$block) {
@begin=('a',$_[0],$_[1]) ;}
@@ -3342,12 +3382,12 @@ sub linediff {
$instring = sprintf "%%DIF %da%d-%d",$begin[1],$begin[2],$_[1]-1; }
elsif ( $begin[0] eq 'c' ) {
$instring = sprintf "%%DIF %sc%s",
- ($begin[1]==$_[0]-1) ? "$begin[1]" : $begin[1]."-".($_[0]-1) ,
+ ($begin[1]==$_[0]-1) ? "$begin[1]" : $begin[1]."-".($_[0]-1) ,
($begin[2]==$_[1]-1) ? "$begin[2]" : $begin[2]."-".($_[1]-1) ; }
else {
$instring = sprintf "%%DIF %d%s%d",$begin[1],$begin[0],$begin[2]; }
- push @$retseq, $instring,@$block, "%DIF -------" ;
- $block = [];
+ push @$retseq, $instring,@$block, "%DIF -------" ;
+ $block = [];
}
push @$retseq, $seq2->[$_[1]]
};
@@ -3355,7 +3395,7 @@ sub linediff {
my $keyfunc = sub { join(" ",split(" ",shift())) };
traverse_sequences($seq1,$seq2, { MATCH=>$match, DISCARD_A=>$discard, DISCARD_B=>$add }, $keyfunc );
- push @$retseq, @$block if scalar @$block;
+ push @$retseq, @$block if scalar @$block;
return wantarray ? @$retseq : $retseq ;
}
@@ -3365,23 +3405,23 @@ sub linediff {
# init_regex_arr_data(\@array,"TOKEN INIT")
# scans DATA file handel for line "%% TOKEN INIT" line
# then appends each line not beginning with % into array (as a quoted regex)
-# This is used for command lists and configuration variables, but the processing is slightly
-# different:
+# This is used for command lists and configuration variables, but the processing is slightly
+# different:
# For lists, the regular expression is extended to include beginning (^) and end ($) markers, to require full-string matching
# For configuration variables (and all others), simply an unadorned list is copied
sub init_regex_arr_data {
my ($arr,$token)=@_;
my $copy=0;
my ($mode);
- if ($token =~ m/COMMANDS/ ) {
- $mode=0; # Reading command list
+ if ($token =~ m/COMMANDS/ ) {
+ $mode=0; # Reading command list
} else {
$mode=1; # Reading configuration variables
}
while (<DATA>) {
if ( m/^%%BEGIN $token\s*$/ ) {
- $copy=1;
+ $copy=1;
next;
} elsif ( m/^%%END $token\s*$/ ) {
last; }
@@ -3462,17 +3502,18 @@ sub exetime {
sub usage {
- print STDERR <<"EOF";
+ print STDERR <<"EOF";
Usage: $0 [options] old.tex new.tex > diff.tex
-Compares two latex files and writes tex code to stdout, which has the same format as new.tex but
+Compares two latex files and writes tex code to stdout, which has the same format as new.tex but
has all changes relative to old.tex marked up or commented. Note that old.tex and new.tex need to
-be real files (not pipes or similar) as they are opened twice.
+be real files (not pipes or similar) as they are opened twice.
--type=markupstyle
-t markupstyle Add code to preamble for selected markup style
- Available styles: UNDERLINE CTRADITIONAL TRADITIONAL CFONT FONTSTRIKE INVISIBLE
+ Available styles: UNDERLINE CTRADITIONAL TRADITIONAL CFONT FONTSTRIKE INVISIBLE
CHANGEBAR CCHANGEBAR CULINECHBAR CFONTCHBAR BOLD PDFCOMMENT
+ LUAUNDERLINE
[ Default: UNDERLINE ]
--subtype=markstyle
@@ -3483,7 +3524,7 @@ be real files (not pipes or similar) as they are opened twice.
* LABEL subtype is deprecated
--floattype=markstyle
--f markstyle Add code to preamble for selected style which
+-f markstyle Add code to preamble for selected style which
replace standard marking and markup commands within floats
(e.g., marginal remarks cause an error within floats
so marginal marking can be disabled thus)
@@ -3492,11 +3533,11 @@ be real files (not pipes or similar) as they are opened twice.
--encoding=enc
-e enc Specify encoding of old.tex and new.tex. Typical encodings are
- ascii, utf8, latin1, latin9. A list of available encodings can be
- obtained by executing
+ ascii, utf8, latin1, latin9. A list of available encodings can be
+ obtained by executing
perl -MEncode -e 'print join ("\\n",Encode->encodings( ":all" )) ;'
[Default encoding is utf8 unless the first few lines of the preamble contain
- an invocation "\\usepackage[..]{inputenc} in which case the
+ an invocation "\\usepackage[..]{inputenc} in which case the
encoding chosen by this command is asssumed. Note that ASCII (standard
latex) is a subset of utf8]
@@ -3513,22 +3554,22 @@ be real files (not pipes or similar) as they are opened twice.
--exclude-safecmd=exclude-file
--exclude-safecmd="cmd1,cmd2,..."
--A exclude-file
+-A exclude-file
--replace-safecmd=replace-file
--append-safecmd=append-file
--append-safecmd="cmd1,cmd2,..."
-a append-file Exclude from, replace or append to the list of regex
- matching commands which are safe to use within the
+ matching commands which are safe to use within the
scope of a \\DIFadd or \\DIFdel command. The file must contain
one Perl-RegEx per line (Comment lines beginning with # or % are
ignored). A literal comma within the comma-separated list must be
- escaped thus "\\,", Note that the RegEx needs to match the whole of
+ escaped thus "\\,", Note that the RegEx needs to match the whole of
the token, i.e., /^regex\$/ is implied and that the initial
"\\" of the command is not included. The --exclude-safecmd
- and --append-safecmd options can be combined with the --replace-safecmd
+ and --append-safecmd options can be combined with the --replace-safecmd
option and can be used repeatedly to add cumulatively to the lists.
---exclude-textcmd=exclude-file
+--exclude-textcmd=exclude-file
--exclude-textcmd="cmd1,cmd2,..."
-X exclude-file
--replace-textcmd=replace-file
@@ -3544,7 +3585,7 @@ be real files (not pipes or similar) as they are opened twice.
Replace or append to the list of regex matching commands
whose last argument is text but which require a particular
context to work, e.g. \\caption will only work within a figure
- or table. These commands behave like text commands, except when
+ or table. These commands behave like text commands, except when
they occur in a deleted section, when they are disabled, but their
argument is shown as deleted text.
@@ -3554,7 +3595,7 @@ be real files (not pipes or similar) as they are opened twice.
As corresponding commands for context1. The only difference is that
context2 commands are completely disabled in deleted sections, including
their arguments.
- context2 commands are also the only commands in the preamble, whose argument will
+ context2 commands are also the only commands in the preamble, whose argument will
be processed in word-by-word mode (which only works, if they occur no more than
once in the preamble).
@@ -3563,15 +3604,15 @@ be real files (not pipes or similar) as they are opened twice.
--append-mboxsafecmd=append-file
--append-mboxsafecmd="cmd1,cmd2,..."
Define safe commands, which additionally need to be protected by encapsulating
- in an \\mbox{..}. This is sometimes needed to get around incompatibilities
+ in an \\mbox{..}. This is sometimes needed to get around incompatibilities
between external packages and the ulem package, which is used for highlighting
in the default style UNDERLINE as well as CULINECHBAR CFONTSTRIKE
-
+
--config var1=val1,var2=val2,...
-c var1=val1,.. Set configuration variables.
--c configfile Available variables:
+-c configfile Available variables:
ARRENV (RegEx)
COUNTERCMD (RegEx)
FLOATENV (RegEx)
@@ -3590,15 +3631,15 @@ be real files (not pipes or similar) as they are opened twice.
--add-to-config varenv1=pattern1,varenv2=pattern2
For configuration variables containing a regular expression (essentially those ending
- in ENV, and COUNTERCMD) this provides an alternative way to modify the configuration
+ in ENV, and COUNTERCMD) this provides an alternative way to modify the configuration
variables. Instead of setting the complete pattern, with this option it is possible to add an
alternative pattern. varenv must be one of the variables listed above that take a regular
- expression as argument, and pattern is any regular expression (which might need to be
+ expression as argument, and pattern is any regular expression (which might need to be
protected from the shell by quotation). Several patterns can be added at once by using semi-colons
to separate them, e.g. --add-to-config "LISTENV=myitemize;myenumerate,COUNTERCMD=endnote"
--packages=pkg1,pkg2,..
- Tell latexdiff that .tex file is processed with the packages in list
+ Tell latexdiff that .tex file is processed with the packages in list
loaded. This is normally not necessary if the .tex file includes the
preamble, as the preamble is automatically scanned for \\usepackage commands.
Use of the --packages option disables automatic scanning, so if for any
@@ -3619,57 +3660,57 @@ be real files (not pipes or similar) as they are opened twice.
--show-all Show all of the above
- NB For all --show commands, no old.tex or new.tex file needs to be given, and no
+ NB For all --show commands, no old.tex or new.tex file needs to be given, and no
differencing takes place.
Other configuration options:
--allow-spaces Allow spaces between bracketed or braced arguments to commands
- [Default requires arguments to directly follow each other without
+ [Default requires arguments to directly follow each other without
intervening spaces]
--math-markup=level Determine granularity of markup in displayed math environments:
Possible values for level are (both numerical and text labels are acceptable):
- off or 0: suppress markup for math environments. Deleted equations will not
- appear in diff file. This mode can be used if all the other modes
+ off or 0: suppress markup for math environments. Deleted equations will not
+ appear in diff file. This mode can be used if all the other modes
cause invalid latex code.
whole or 1: Differencing on the level of whole equations. Even trivial changes
- to equations cause the whole equation to be marked changed. This
- mode can be used if processing in coarse or fine mode results in
+ to equations cause the whole equation to be marked changed. This
+ mode can be used if processing in coarse or fine mode results in
invalid latex code.
coarse or 2: Detect changes within equations marked up with a coarse
- granularity; changes in equation type (e.g.displaymath to equation)
+ granularity; changes in equation type (e.g.displaymath to equation)
appear as a change to the complete equation. This mode is recommended
for situations where the content and order of some equations are still
being changed. [Default]
fine or 3: Detect small change in equations and mark up and fine granularity.
This mode is most suitable, if only minor changes to equations are
- expected, e.g. correction of typos.
+ expected, e.g. correction of typos.
--graphics-markup=level Change highlight style for graphics embedded with \\includegraphics commands
Possible values for level:
none,off or 0: no highlighting for figures
new-only or 1: surround newly added or changed figures with a blue frame [Default]
- both or 2: highlight new figures with a blue frame and show deleted figures
+ both or 2: highlight new figures with a blue frame and show deleted figures
at reduced scale, and crossed out with a red diagonal cross. Use configuration
variable SCALEDELGRAPHICS to set size of deleted figures.
- Note that changes to the optional parameters will make the figure appear as changed
+ Note that changes to the optional parameters will make the figure appear as changed
to latexdiff, and this figure will thus be highlighted.
In some circumstances "Misplaced \\noalign" errors can occur if there are certain types
- of changes in tables. In this case please use option --graphics-markup=none as a
- work-around.
+ of changes in tables. In this case please use option --graphics-markup=none as a
+ work-around.
---no-del Suppress deleted text from the diff. It is similar in effect to the BOLD style,
+--no-del Suppress deleted text from the diff. It is similar in effect to the BOLD style,
but the deleted text ist not just invisible in the output, it is also not included in the
- diff text file. This can be more robust than just making it invisible.
+ diff text file. This can be more robust than just making it invisible.
---disable-citation-markup
---disable-auto-mbox Suppress citation markup and markup of other vulnerable commands in styles
+--disable-citation-markup
+--disable-auto-mbox Suppress citation markup and markup of other vulnerable commands in styles
using ulem (UNDERLINE,FONTSTRIKE, CULINECHBAR)
(the two options are identical and are simply aliases)
--enable-citation-markup
---enforce-auto-mbox Protect citation commands and other vulnerable commands in changed sections
+--enforce-auto-mbox Protect citation commands and other vulnerable commands in changed sections
with \\mbox command, i.e. use default behaviour for ulem package for other packages
(the two options are identical and are simply aliases)
@@ -3685,14 +3726,14 @@ Miscellaneous options
--no-label Suppress inclusion of old and new file names as comment in output file
---visible-label Include old and new filenames (or labels set with --label option) as
+--visible-label Include old and new filenames (or labels set with --label option) as
visible output
--flatten Replace \\input and \\include commands within body by the content
of the files in their argument. If \\includeonly is present in the
- preamble, only those files are expanded into the document. However,
- no recursion is done, i.e. \\input and \\include commands within
- included sections are not expanded. The included files are assumed to
+ preamble, only those files are expanded into the document. However,
+ no recursion is done, i.e. \\input and \\include commands within
+ included sections are not expanded. The included files are assumed to
be located in the same directories as the old and new master files,
respectively, making it possible to organise files into old and new directories.
--flatten is applied recursively, so inputted files can contain further
@@ -3715,7 +3756,7 @@ Miscellaneous options
-h Show this help text.
--ignore-warnings Suppress warnings about inconsistencies in length between input
- and parsed strings and missing characters.
+ and parsed strings and missing characters.
--verbose
-V Output various status information to stderr during processing.
@@ -3727,10 +3768,10 @@ Internal options:
These options are mostly for automated use by latexdiff-vc. They can be used directly, but
the API should be considered less stable than for the other options.
---no-links Suppress generation of hyperreferences, used for minimal diffs
+--no-links Suppress generation of hyperreferences, used for minimal diffs
(option --only-changes of latexdiff-vc).
EOF
- exit 0;
+ exit 0;
}
=head1 NAME
@@ -3756,8 +3797,8 @@ be real files (not pipes or similar) as they are opened twice (unless C<--encodi
The program treats the preamble differently from the main document.
Differences between the preambles are found using line-based
differencing (similarly to the Unix diff command, but ignoring white
-spaces). A comment, "S<C<%DIF E<gt>>>" is appended to each added line, i.e. a
-line present in C<new.tex> but not in C<old.tex>. Discarded lines
+spaces). A comment, "S<C<%DIF E<gt>>>" is appended to each added line, i.e. a
+line present in C<new.tex> but not in C<old.tex>. Discarded lines
are deactivated by prepending "S<C<%DIF E<lt>>>". Changed blocks are preceded by
comment lines giving information about line numbers in the original files. Where there are insignificant
differences, the resulting file C<diff.tex> will be similar to
@@ -3810,7 +3851,7 @@ curly braces immediately following a command (i.e. a sequence of
letters beginning with a backslash) are arguments for that command.
As a restriction to condition 1 above it is thus necessary to surround
all arguments with curly braces, and to not insert
-extraneous spaces. For example, write
+extraneous spaces. For example, write
\section{\textem{This is an emphasized section title}}
@@ -3842,7 +3883,7 @@ but the choice is yours. Any markup within the environment will be
removed, and generally everything within the environment will just be
taken from the new file.
-It is also possible to difference files which do not have a preamble.
+It is also possible to difference files which do not have a preamble.
In this case, the file is processed in the main document
mode, but the definitions of the markup commands are not inserted.
@@ -3860,7 +3901,7 @@ the scope of C<\DIFadd>. Added comments are marked by prepending
Within deleted blocks text is highlighted with C<\DIFdel>. Deleted
comments are marked by prepending "S<C<%DIF E<lt> >>". Non-safe command
-and curly braces within deleted blocks are commented out with
+and curly braces within deleted blocks are commented out with
"S<C<%DIFDELCMD E<lt> >>".
@@ -3870,7 +3911,7 @@ and curly braces within deleted blocks are commented out with
=head2 Preamble
The following options determine the visual markup style by adding the appropriate
-command definitions to the preamble. See the end of this section for a description of
+command definitions to the preamble. See the end of this section for a description of
available styles.
=over 4
@@ -3880,15 +3921,16 @@ B<-t markupstyle>
Add code to preamble for selected markup style. This option defines
C<\DIFadd> and C<\DIFdel> commands.
-Available styles:
+Available styles:
-C<UNDERLINE CTRADITIONAL TRADITIONAL CFONT FONTSTRIKE INVISIBLE
-CHANGEBAR CCHANGEBAR CULINECHBAR CFONTCHBAR BOLD PDFCOMMENT>
+C<UNDERLINE CTRADITIONAL TRADITIONAL CFONT FONTSTRIKE INVISIBLE
+CHANGEBAR CCHANGEBAR CULINECHBAR CFONTCHBAR BOLD PDFCOMMENT
+LUAUNDERLINE>
[ Default: C<UNDERLINE> ]
=item B<--subtype=markstyle> or
-B<-s markstyle>
+B<-s markstyle>
Add code to preamble for selected style for bracketing
commands (e.g. to mark changes in margin). This option defines
@@ -3901,27 +3943,27 @@ Available styles: C<SAFE MARGIN COLOR DVIPSCOL ZLABEL ONLYCHANGEDPAGE (LABEL)*>
=item B<--floattype=markstyle> or
B<-f markstyle>
-Add code to preamble for selected style which
+Add code to preamble for selected style which
replace standard marking and markup commands within floats
(e.g., marginal remarks cause an error within floats
-so marginal marking can be disabled thus). This option defines all
+so marginal marking can be disabled thus). This option defines all
C<\DIF...FL> commands.
Available styles: C<FLOATSAFE TRADITIONALSAFE IDENTICAL>
[ Default: C<FLOATSAFE> ]
-=item B<--encoding=enc> or
+=item B<--encoding=enc> or
B<-e enc>
Specify encoding of old.tex and new.tex. Typical encodings are
-C<ascii>, C<utf8>, C<latin1>, C<latin9>. A list of available encodings can be
-obtained by executing
+C<ascii>, C<utf8>, C<latin1>, C<latin9>. A list of available encodings can be
+obtained by executing
C<perl -MEncode -e 'print join ("\n",Encode->encodings( ":all" )) ;' >
If this option is used, then old.tex, new.tex are only opened once.
[Default encoding is utf8 unless the first few lines of the preamble contain
-an invocation C<\usepackage[..]{inputenc}> in which case the
+an invocation C<\usepackage[..]{inputenc}> in which case the
encoding chosen by this command is asssumed. Note that ASCII (standard
latex) is a subset of utf8]
@@ -3938,7 +3980,7 @@ C<\DIFaddbeginFL, \DIFaddendFL, \DIFaddFL{..},
(If this option is set B<-t>, B<-s>, and B<-f> options
are ignored.)
-=item B<--packages=pkg1,pkg2,..>
+=item B<--packages=pkg1,pkg2,..>
Tell latexdiff that .tex file is processed with the packages in list
loaded. This is normally not necessary if the .tex file includes the
@@ -3949,13 +3991,13 @@ The following packages trigger special behaviour:
=over 8
-=item C<endfloat>
+=item C<endfloat>
Ensure that C<\begin{figure}> and C<\end{figure}> always appear by themselves on a line.
=item C<hyperref>
-Change name of C<\DIFadd> and C<\DIFdel> commands to C<\DIFaddtex> and C<\DIFdeltex> and
+Change name of C<\DIFadd> and C<\DIFdel> commands to C<\DIFaddtex> and C<\DIFdeltex> and
define new C<\DIFadd> and C<\DIFdel> commands, which provide a wrapper for these commands,
using them for the text but not for the link defining command (where any markup would cause
errors).
@@ -4007,17 +4049,17 @@ B<-A exclude-file> or B<--exclude-safecmd="cmd1,cmd2,...">
=item B<--replace-safecmd=replace-file>
-=item B<--append-safecmd=append-file> or
+=item B<--append-safecmd=append-file> or
B<-a append-file> or B<--append-safecmd="cmd1,cmd2,...">
Exclude from, replace or append to the list of regular expressions (RegEx)
-matching commands which are safe to use within the
+matching commands which are safe to use within the
scope of a C<\DIFadd> or C<\DIFdel> command. The file must contain
one Perl-RegEx per line (Comment lines beginning with # or % are
-ignored). Note that the RegEx needs to match the whole of
+ignored). Note that the RegEx needs to match the whole of
the token, i.e., /^regex$/ is implied and that the initial
-"\" of the command is not included.
-The B<--exclude-safecmd> and B<--append-safecmd> options can be combined with the -B<--replace-safecmd>
+"\" of the command is not included.
+The B<--exclude-safecmd> and B<--append-safecmd> options can be combined with the -B<--replace-safecmd>
option and can be used repeatedly to add cumulatively to the lists.
B<--exclude-safecmd>
and B<--append-safecmd> can also take a comma separated list as input. If a
@@ -4030,7 +4072,7 @@ B<-X exclude-file> or B<--exclude-textcmd="cmd1,cmd2,...">
=item B<--replace-textcmd=replace-file>
-=item B<--append-textcmd=append-file> or
+=item B<--append-textcmd=append-file> or
B<-x append-file> or B<--append-textcmd="cmd1,cmd2,...">
Exclude from, replace or append to the list of regular expressions
@@ -4038,7 +4080,7 @@ matching commands whose last argument is text. See
entry for B<--exclude-safecmd> directly above for further details.
-=item B<--replace-context1cmd=replace-file>
+=item B<--replace-context1cmd=replace-file>
=item B<--append-context1cmd=append-file> or
@@ -4047,11 +4089,11 @@ entry for B<--exclude-safecmd> directly above for further details.
Replace or append to the list of regex matching commands
whose last argument is text but which require a particular
context to work, e.g. C<\caption> will only work within a figure
-or table. These commands behave like text commands, except when
+or table. These commands behave like text commands, except when
they occur in a deleted section, when they are disabled, but their
argument is shown as deleted text.
-=item B<--replace-context2cmd=replace-file>
+=item B<--replace-context2cmd=replace-file>
=item B<--append-context2cmd=append-file> or
@@ -4061,9 +4103,9 @@ As corresponding commands for context1. The only difference is that
context2 commands are completely disabled in deleted sections, including
their arguments.
-context2 commands are also the only commands in the preamble, whose argument will be processed in
+context2 commands are also the only commands in the preamble, whose argument will be processed in
word-by-word mode (which only works, if they occur no more than once in the preamble). The algorithm currently cannot cope with repeated context2 commands in the preamble, as they occur e.g. for the C<\author> argument in some journal styles (not in the standard styles, though
-If such a repetition is detected, the whole preamble will be processed in line-by-line mode. In such a case, use C<--replace-context2cmd> option to just select the commands, which should be processed and are not used repeatedly in the preamble.
+If such a repetition is detected, the whole preamble will be processed in line-by-line mode. In such a case, use C<--replace-context2cmd> option to just select the commands, which should be processed and are not used repeatedly in the preamble.
@@ -4072,7 +4114,7 @@ If such a repetition is detected, the whole preamble will be processed in line-b
=item B<--append-mboxsafecmd=append-file> or B<--append-mboxsafecmd="cmd1,cmd2,...">
Define safe commands, which additionally need to be protected by encapsulating
-in an C<\mbox{..}>. This is sometimes needed to get around incompatibilities
+in an C<\mbox{..}>. This is sometimes needed to get around incompatibilities
between external packages and the ulem package, which is used for highlighting
in the default style UNDERLINE as well as CULINECHBAR CFONTSTRIKE
@@ -4086,7 +4128,7 @@ in the default style UNDERLINE as well as CULINECHBAR CFONTSTRIKE
Set configuration variables. The option can be repeated to set different
variables (as an alternative to the comma-separated list).
-Available variables (see below for further explanations):
+Available variables (see below for further explanations):
C<ARRENV> (RegEx)
@@ -4116,10 +4158,10 @@ C<SCALEDELGRAPHICS> (Float)
=item B<--add-to-config varenv1=pattern1,varenv2=pattern2,...>
For configuration variables, which are a regular expression (essentially those ending
-in ENV, COUNTERCMD and CUSTOMDIFCMD, see list above) this option provides an alternative way to modify the configuration
+in ENV, COUNTERCMD and CUSTOMDIFCMD, see list above) this option provides an alternative way to modify the configuration
variables. Instead of setting the complete pattern, with this option it is possible to add an
alternative pattern. C<varenv> must be one of the variables listed above that take a regular
-expression as argument, and pattern is any regular expression (which might need to be
+expression as argument, and pattern is any regular expression (which might need to be
protected from the shell by quotation). Several patterns can be added at once by using semi-colons
to separate them, e.g. C<--add-to-config "LISTENV=myitemize;myenumerate,COUNTERCMD=endnote">
@@ -4139,7 +4181,7 @@ Show values of configuration variables.
Combine all --show commands.
-NB For all --show commands, no C<old.tex> or C<new.tex> file needs to be specified, and no
+NB For all --show commands, no C<old.tex> or C<new.tex> file needs to be specified, and no
differencing takes place.
=back
@@ -4156,29 +4198,29 @@ might get lumpeded with preceding commands) so should only be used if the
default produces erroneous results. (Default requires arguments to
directly follow each other without intervening spaces).
-=item B<--math-markup=level>
+=item B<--math-markup=level>
-Determine granularity of markup in displayed math environments:
+Determine granularity of markup in displayed math environments:
Possible values for level are (both numerical and text labels are acceptable):
-C<off> or C<0>: suppress markup for math environments. Deleted equations will not
-appear in diff file. This mode can be used if all the other modes
+C<off> or C<0>: suppress markup for math environments. Deleted equations will not
+appear in diff file. This mode can be used if all the other modes
cause invalid latex code.
C<whole> or C<1>: Differencing on the level of whole equations. Even trivial changes
-to equations cause the whole equation to be marked changed. This
-mode can be used if processing in coarse or fine mode results in
+to equations cause the whole equation to be marked changed. This
+mode can be used if processing in coarse or fine mode results in
invalid latex code.
C<coarse> or C<2>: Detect changes within equations marked up with a coarse
-granularity; changes in equation type (e.g.displaymath to equation)
+granularity; changes in equation type (e.g.displaymath to equation)
appear as a change to the complete equation. This mode is recommended
for situations where the content and order of some equations are still
being changed. [Default]
C<fine> or C<3>: Detect small change in equations and mark up at fine granularity.
This mode is most suitable, if only minor changes to equations are
-expected, e.g. correction of typos.
+expected, e.g. correction of typos.
=item B<--graphics-markup=level>
@@ -4190,33 +4232,33 @@ C<none>, C<off> or C<0>: no highlighting for figures
C<new-only> or C<1>: surround newly added or changed figures with a blue frame [Default if graphicx package loaded]
-C<both> or C<2>: highlight new figures with a blue frame and show deleted figures at reduced
+C<both> or C<2>: highlight new figures with a blue frame and show deleted figures at reduced
scale, and crossed out with a red diagonal cross. Use configuration
variable SCALEDELGRAPHICS to set size of deleted figures.
-Note that changes to the optional parameters will make the figure appear as changed
+Note that changes to the optional parameters will make the figure appear as changed
to latexdiff, and this figure will thus be highlighted.
In some circumstances "Misplaced \noalign" error can occur if there are certain types
-of changes in tables. In this case please use C<--graphics-markup=none> as a
-work-around.
+of changes in tables. In this case please use C<--graphics-markup=none> as a
+work-around.
-=item B<--no-del>
+=item B<--no-del>
-Suppress deleted text from the diff. It is similar in effect to the BOLD style,
-but the deleted text ist not just invisible in the output, it is also not included in the diff text file.
-This can be more robust than just making it invisible.
+Suppress deleted text from the diff. It is similar in effect to the BOLD style,
+but the deleted text ist not just invisible in the output, it is also not included in the diff text file.
+This can be more robust than just making it invisible.
=item B<--disable-citation-markup> or B<--disable-auto-mbox>
-Suppress citation markup and markup of other vulnerable commands in styles
+Suppress citation markup and markup of other vulnerable commands in styles
using ulem (UNDERLINE,FONTSTRIKE, CULINECHBAR)
(the two options are identical and are simply aliases)
=item B<--enable-citation-markup> or B<--enforce-auto-mbox>
-Protect citation commands and other vulnerable commands in changed sections
+Protect citation commands and other vulnerable commands in changed sections
with C<\mbox> command, i.e. use default behaviour for ulem package for other packages
(the two options are identical and are simply aliases)
@@ -4262,18 +4304,18 @@ Suppress inclusion of old and new file names as comment in output file
=item B<--visible-label>
-Include old and new filenames (or labels set with C<--label> option) as
+Include old and new filenames (or labels set with C<--label> option) as
visible output.
=item B<--flatten>
Replace C<\input> and C<\include> commands within body by the content
of the files in their argument. If C<\includeonly> is present in the
-preamble, only those files are expanded into the document. However,
-no recursion is done, i.e. C<\input> and C<\include> commands within
-included sections are not expanded. The included files are assumed to
+preamble, only those files are expanded into the document. However,
+no recursion is done, i.e. C<\input> and C<\include> commands within
+included sections are not expanded. The included files are assumed to
be located in the same directories as the old and new master files,
-respectively, making it possible to organise files into old and new directories.
+respectively, making it possible to organise files into old and new directories.
--flatten is applied recursively, so inputted files can contain further
C<\input> statements. Also handles files included by the import package
(C<\import> and C<\subimport>), and C<\subfile> command.
@@ -4320,7 +4362,7 @@ Suppress generation of hyperreferences, used for minimal diffs (option --only-ch
=back
-=head2 Predefined styles
+=head2 Predefined styles
=head2 Major types
@@ -4333,9 +4375,14 @@ The major type determine the markup of plain text and some selected latex comman
Added text is wavy-underlined and blue, discarded text is struck out and red
(Requires color and ulem packages). Overstriking does not work in displayed math equations such that deleted parts of equation are underlined, not struck out (this is a shortcoming inherent to the ulem package).
+=item C<LUAUNDERLINE>
+
+Added text is underlined and blue, discarded text is struck out and red
+(Requires lua-ul package + LuaLaTeX).
+
=item C<CTRADITIONAL>
-Added text is blue and set in sans-serif, and a red footnote is created for each discarded
+Added text is blue and set in sans-serif, and a red footnote is created for each discarded
piece of text. (Requires color package)
=item C<TRADITIONAL>
@@ -4376,13 +4423,13 @@ Added text is set in bold face, discarded is not shown. (also see --no-del optio
=item C<PDFCOMMENT>
-The pdfcomment package is used to underline new text, and mark deletions with a PDF comment. Note that this markup might appear differently or not at all based on the pdf viewer used. The viewer with best support for pdf markup is probably acroread. This style is only recommended if the number of differences is small.
+The pdfcomment package is used to underline new text, and mark deletions with a PDF comment. Note that this markup might appear differently or not at all based on the pdf viewer used. The viewer with best support for pdf markup is probably acroread. This style is only recommended if the number of differences is small.
=back
=head2 Subtypes
-The subtype defines the commands that are inserted at the begin and end of added or discarded blocks, irrespectively of whether these blocks contain text or commands (Defined commands: C<\DIFaddbegin, \DIFaddend, \DIFdelbegin, \DIFdelend>)
+The subtype defines the commands that are inserted at the begin and end of added or discarded blocks, irrespectively of whether these blocks contain text or commands (Defined commands: C<\DIFaddbegin, \DIFaddend, \DIFdelbegin, \DIFdelend>)
=over 10
@@ -4400,7 +4447,7 @@ from the intended position.
An alternative way of marking added passages in blue, and deleted ones in red.
(It is recommeneded to use instead the main types to effect colored markup,
-although in some cases coloring with dvipscol can be more complete, for example
+although in some cases coloring with dvipscol can be more complete, for example
with citation commands).
=item C<DVIPSCOL>
@@ -4415,12 +4462,12 @@ although in some cases coloring with dvipscol can be more complete).
can be used to highlight only changed pages, but requires post-processing. It is recommend to not call this option manually but use C<latexdiff-vc> with C<--only-changes> option. Alternatively, use the script given within preamble of diff files made using this style.
-=item C<ONLYCHANGEDPAGE>
+=item C<ONLYCHANGEDPAGE>
also highlights changed pages, without the need for post-processing, but might not work reliably if
there is floating material (figures, tables).
-=item C<LABEL>
+=item C<LABEL>
is similar to C<ZLABEL>, but does not need the zref package and works less reliably (deprecated).
@@ -4428,7 +4475,7 @@ is similar to C<ZLABEL>, but does not need the zref package and works less relia
=head2 Float Types
-Some of the markup used in the main text might cause problems when used within
+Some of the markup used in the main text might cause problems when used within
floats (e.g. figures or tables). For this reason alternative versions of all
markup commands are used within floats. The float type defines these alternative commands.
@@ -4455,7 +4502,7 @@ Make no difference between the main text and floats.
=item C<ARRENV>
-If a match to C<ARRENV> is found within an inline math environment within a deleted or added block, then the inlined math
+If a match to C<ARRENV> is found within an inline math environment within a deleted or added block, then the inlined math
is surrounded by C<\mbox{>...C<}>. This is necessary as underlining does not work within inlined array environments.
[ Default: C<ARRENV>=S<C<(?:array|[pbvBV]matrix)> >
@@ -4475,9 +4522,9 @@ C<|subsubsection|paragraph|subparagraph)> ]
This option is for advanced users and allows definition of special versions of commands, which do not work as safe commands.
Commands in C<CUSTOMDIFCMD> that occur in added or deleted blocks will be given an ADD or DEL prefix.
-The prefixed versions of the command must be defined in the preamble, either by putting them
+The prefixed versions of the command must be defined in the preamble, either by putting them
in the preamble of at least the new file, or by creating a custom preamble file (Option --preamble).
-For example the command C<\blindtext> (from package blindtext) does not interact well with underlining, so that
+For example the command C<\blindtext> (from package blindtext) does not interact well with underlining, so that
for the standard markup type, it is not satisfactory to define it as a safe command. Instead, a customised versions
without underlining can be defined in the preamble:
@@ -4491,7 +4538,7 @@ and then latexdiff should be invoked with the option C<-c CUSTOMDIFCMD=blindtext
=item C<FLOATENV>
-Environments whose name matches the regular expression in C<FLOATENV> are
+Environments whose name matches the regular expression in C<FLOATENV> are
considered floats. Within these environments, the I<latexdiff> markup commands
are replaced by their FL variaties.
@@ -4540,17 +4587,17 @@ If C<--graphics-markup=both> is chosen, C<SCALEDELGRAPHICS> is the factor, by wh
=item C<VERBATIMENV>
-RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of these environments will not be processed in any way:
+RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of these environments will not be processed in any way:
deleted content is commented out, new content is not marked up
[ Default: S<C<comment> > ]
=item C<VERBATIMLINEENV>
-RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of environments described by VERBATIMLINEENV are compared in
+RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of environments described by VERBATIMLINEENV are compared in
line mode, and changes are marked up using the listings package. The markup style is set based on the chosen mains markup type (Option -t), or on an analysis
of the preamble.
-Note that "listings.sty" must be installed. If this file is not found the fallback solution is to
+Note that "listings.sty" must be installed. If this file is not found the fallback solution is to
treat VERBATIMLINEENV environments treated exactly the same way as VERBATIMENV environments.
[ Default: S<C<(?:verbatim[*]?|lstlisting> > ]
@@ -4561,30 +4608,40 @@ treat VERBATIMLINEENV environments treated exactly the same way as VERBATIMENV e
=over 10
-=item Citations result in overfull boxes
+=item Changed citations result in overfull boxes
There is an incompatibility between the C<ulem> package, which C<latexdiff> uses for underlining and striking out in the UNDERLINE style,
-the default style, and the way citations are generated. In order to be able to mark up citations properly, they are enclosed with an C<\mbox>
-command. As mboxes cannot be broken across lines, this procedure frequently results in overfull boxes, possibly obscuring the content as it extends beyond the right margin. The same occurs for some other packages (e.g., siunitx). If this is a problem, you have two possibilities.
+the default style, and the way citations are generated. In order to be able to mark up citations properly, they are enclosed with an C<\mbox>
+command. As mboxes cannot be broken across lines, this procedure frequently results in overfull boxes, possibly obscuring the content as it extends beyond the right margin. The same occurs for some other packages (e.g., siunitx). If this is a problem, you have several possibilities.
1. Use C<CFONT> type markup (option C<-t CFONT>): If this markup is chosen, then changed citations are no longer marked up
-with the wavy line (additions) or struck out (deletions), but are still highlighted in the appropriate color, and deleted text is shown with a different font. Other styles not using the C<ulem> package will also work.
+with the wavy line (additions) or struck out (deletions), but are still highlighted in the appropriate color, and deleted text is shown with a different font. Other styles not using the C<ulem> package will also work.
2. Choose option C<--disable-citation-markup> which turns off the marking up of citations: deleted citations are no longer shown, and
-added citations are shown without markup. (This was the default behaviour of latexdiff at versions 0.6 and older)
-
+added citations are shown without markup. (This was the default behaviour of latexdiff at versions 0.6 and older).
For custom packages you can define the commands which need to be protected by C<\mbox> with C<--append-mboxsafecmd> and C<--excludemboxsafecmd> options
(submit your lists of command as feature request at github page to set the default behaviour of future versions, see section 6)
-=item Changes in complicated mathematical equations result in latex processing errors
+3. If you are using luatex >= 1.12.0 you can use option LUAUNDERLINE that uses lua-ul instead of ulem for underlining, which does not have this problem (experimental feature).
+
+=item Changes in complicated mathematical equations result in latex processing errors.
+
+Try option C<--math-markup=whole>. If even that fails, you can turn off mark up for equations with C<--math-markup=off>.
-Try options C<--math-markup=whole>. If even that fails, you can turn off mark up for equations with C<--math-markup=off>.
+=item Deleted parts in equations are not struck out but underlined.
-=item How can I just show the pages where changes had been made
+This is a limitation of the ulem package that implements the strike-out. If you use the amsmath package, then the strike-out command is redefined in such a way that deleted passages are wrapped with C<\text> command; adding C<\usepackage{amsmath}> to your preamble will trigger this behaviour. (If amsmath is not included directly, but imported by another package, latexdiff will not be able to detect its availability; in this case you can give latexdiff a hint with option C<--packages=amsmath>.
-Use options -C<-s ZLABEL> (some postprocessing required) or C<-s ONLYCHANGEDPAGE>. C<latexdiff-vc --ps|--pdf> with C<--only-changes> option takes care of
+
+=item How can I just show the pages where changes had been made?
+
+Use options C<--s ZLABEL> (some postprocessing required) or C<-s ONLYCHANGEDPAGE>. C<latexdiff-vc --ps|--pdf> with C<--only-changes> option takes care of
the post-processing for you (requires zref package to be installed).
+=item The character encoding breaks when running latexdiff from powershell.
+
+This problem is not limited to C<latexdiff> and has to do with the default settings of C<powershell> in Windows. It is recommended to use C<cmd> instead.
+
=back
=head1 BUGS
@@ -4597,13 +4654,13 @@ different numbers of inter-argument spaces are treated as significant.
=back
-Please submit bug reports using the issue tracker of the github repository page I<https://github.com/ftilmann/latexdiff.git>,
+Please submit bug reports using the issue tracker of the github repository page I<https://github.com/ftilmann/latexdiff.git>,
or send them to I<tilmann -- AT -- gfz-potsdam.de>. Include the version number of I<latexdiff>
(from comments at the top of the source or use B<--version>). If you come across latex
files that are error-free and conform to the specifications set out
above, and whose differencing still does not result in error-free
latex, please send me those files, ideally edited to only contain the
-offending passage as long as that still reproduces the problem. If your
+offending passage as long as that still reproduces the problem. If your
file relies on non-standard class files, you must include those. I will not
look at examples where I have trouble to latex the original files.
@@ -4614,24 +4671,24 @@ L<latexrevise>, L<latexdiff-vc>
=head1 PORTABILITY
I<latexdiff> does not make use of external commands and thus should run
-on any platform supporting Perl 5.6 or higher. If files with encodings
+on any platform supporting Perl 5.6 or higher. If files with encodings
other than ASCII or UTF-8 are processed, Perl 5.8 or higher is required.
The standard version of I<latexdiff> requires installation of the Perl package
-C<Algorithm::Diff> (available from I<www.cpan.org> -
+C<Algorithm::Diff> (available from I<www.cpan.org> -
I<http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15>) but a stand-alone
version, I<latexdiff-so>, which has this package inlined, is available, too.
I<latexdiff-fast> requires the I<diff> command to be present.
=head1 AUTHOR
-Version 1.3.3
-Copyright (C) 2004-2022 Frederik Tilmann
+Version 1.3.4
+Copyright (C) 2004-2024 Frederik Tilmann
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3
-Contributors of fixes and additions: V. Kuhlmann, J. Paisley, N. Becker, T. Doerges, K. Huebner,
+Contributors of fixes and additions: V. Kuhlmann, J. Paisley, N. Becker, T. Doerges, K. Huebner,
T. Connors, Sebastian Gouezel and many others.
Thanks to the many people who sent in bug reports, feature suggestions, and other feedback.
@@ -4902,13 +4959,14 @@ value
underline
sqrt
(SUPER|SUB)SCRIPT
-%%END TEXT COMMANDS
+%%END TEXT COMMANDS
%%BEGIN CONTEXT1 COMMANDS
% Regex matching commands with a text argument (leave out the \), which will fail out of context. These commands behave like text commands, except when they occur in a deleted section, where they are disabled, but their argument is shown as deleted text.
caption
subcaption
-%%END CONTEXT1 COMMANDS
+multicolumn
+%%END CONTEXT1 COMMANDS
%%BEGIN CONTEXT2 COMMANDS
% Regex matching commands with a text argument (leave out the \), which will fail out of context. As corresponding commands for context1. The only difference is that context2 commands are completely disabled in deleted sections, including their arguments.
@@ -4916,7 +4974,7 @@ title
author
date
institute
-%%END CONTEXT2 COMMANDS
+%%END CONTEXT2 COMMANDS
%% CONFIGURATION variabe defaults
%%BEGIN LISTENV CONFIG
@@ -4994,9 +5052,16 @@ verbatim[*]?
\RequirePackage[normalem]{ulem}
\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1}
\providecommand{\DIFadd}[1]{{\protect\color{blue}\uwave{#1}}}
-\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}}
+\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}}
%DIF END UNDERLINE PREAMBLE
+%DIF LUAUNDERLINE PREAMBLE
+\RequirePackage{lua-ul}
+\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1}
+\providecommand{\DIFadd}[1]{{\protect\color{blue}\underLine{#1}}}
+\providecommand{\DIFdel}[1]{{\protect\color{red}\strikeThrough{#1}}}
+%DIF END LUAUNDERLINE PREAMBLE
+
%DIF CTRADITIONAL PREAMBLE
\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1}
\RequirePackage[stable]{footmisc}
@@ -5168,7 +5233,7 @@ verbatim[*]?
% To show only pages with changes (dvips/dvipdf)
% latex diff.tex
% latex diff.tex
-% dvips -pp `perl -lne 'if (m/\\newlabel{DIFchg[be]\d*}{{.*}{(.*)}}/) { print $1 }' diff.aux | uniq | tr -s \\n ','` diff.dvi
+% dvips -pp `perl -lne 'if (m/\\newlabel{DIFchg[be]\d*}{{.*}{(.*)}}/) { print $1 }' diff.aux | uniq | tr -s \\n ','` diff.dvi
\typeout{Check comments in preamble of output for instructions how to show only pages where changes have been made}
\usepackage[user,abspage]{zref}
\newcount\DIFcounterb
@@ -5188,10 +5253,10 @@ verbatim[*]?
\RequirePackage{etoolbox}
\RequirePackage{zref}
% redefine label command to write immediately to aux file - page references will be lost
-\makeatletter \let\oldlabel\label% Store \label
-\renewcommand{\label}[1]{% Update \label to write to the .aux immediately
-\zref@wrapper@immediate{\oldlabel{#1}}}
-\makeatother
+\makeatletter \let\oldlabel\label% Store \label
+\renewcommand{\label}[1]{% Update \label to write to the .aux immediately
+\zref@wrapper@immediate{\oldlabel{#1}}}
+\makeatother
\newbool{DIFkeeppage}
\newbool{DIFchange}
\boolfalse{DIFkeeppage}
@@ -5209,7 +5274,7 @@ verbatim[*]?
\providecommand{\DIFmodend}{\global\booltrue{DIFkeeppage}\global\boolfalse{DIFchange}}
%DIF END ONLYCHANGEDPAGE PREAMBLE
-%% FLOAT TYPES
+%% FLOAT TYPES
%DIF FLOATSAFE PREAMBLE
\providecommand{\DIFaddFL}[1]{\DIFadd{#1}}
@@ -5241,7 +5306,7 @@ verbatim[*]?
%DIF END TRADITIONALSAFE PREAMBLE
% see:
-% http://tex.stackexchange.com/questions/47351/can-i-redefine-a-command-to-contain-itself
+% http://tex.stackexchange.com/questions/47351/can-i-redefine-a-command-to-contain-itself
%DIF HIGHLIGHTGRAPHICS PREAMBLE
\RequirePackage{settobox}
@@ -5287,6 +5352,15 @@ verbatim[*]?
%% SPECIAL PACKAGE PREAMBLE COMMANDS
+%% Redefine strike out command to wrap in text box if amsmath is used and markup style with ulem is used
+%DIF AMSMATHULEM PREAMBLE
+\makeatletter
+\let\sout@orig\sout
+\renewcommand{\sout}[1]{\ifmmode\text{\sout@orig{\ensuremath{#1}}}\else\sout@orig{#1}\fi}
+\makeatother
+%DIF END AMSMATHULEM PREAMBLE
+
+
% Standard \DIFadd and \DIFdel are redefined as \DIFaddtex and \DIFdeltex
% when hyperref package is included.
%DIF HYPERREF PREAMBLE
@@ -5389,7 +5463,7 @@ verbatim[*]?
%DIF END DIFCODE_BOLD
%DIF DIFCODE_PDFCOMMENT
-
+
moredelim=[il][\color{white}\tiny]{\%DIF\ <\ },
moredelim=[il][\sffamily\bfseries]{\%DIF\ >\ }
%DIF END DIFCODE_PDFCOMMENT
diff --git a/support/latexdiff/latexdiff-fast b/support/latexdiff/latexdiff-fast
index ff9a732bac..44d6005845 100755
--- a/support/latexdiff/latexdiff-fast
+++ b/support/latexdiff/latexdiff-fast
@@ -25,6 +25,21 @@
#
# Note references to issue numbers are for the github repository of latexdiff: https://github.com/ftilmann/latexdiff
#
+# Version 1.3.4:
+# New features:
+# - Option to use lua-ul instead of ulem (for use with LuaLaTeX) (fix #17, #60, #188, #255, #270)
+# Enhancement
+# - If amsmath is detected as one of the included (based on idea in PR #263 contributed by github user xlucn
+# Bug fix
+# - sometimes the introduction of aux commands to show deleted lists or descriptions leaves in place empty auxiliary
+# list environments, which would cause error messages (though skipping messages would result in a correct output pdf).
+# These are now removed.
+# - add more mboxsafecmd and safecmd commands for SIunitx to stay compatible with newer versionsof SIunitx (PR #283, fixing issue #282, contributed by github user joe6302413)
+# - File added via --preamble option is no longer assumed to be ASCII, but read either with encoding as defined by --encoding option or using the encoding of the LOCALE (fixes issue #285 )
+# - multicolumn argument is now treated as text
+# - when tikz-dependency package is used, \& is no longer a safe command as it has special meaning inside dependency environment. The fix is a little of a hack as really it should only be considered unsafe within dependency environment (fixes (mostly) issue #303 )
+# - listings package had trouble with non-ASCII chars. The encoding is now set (thanks to github user anka-213 for finding this). Fixes #304
+#
# Version 1.3.3:
# New features:
# - Option --no-del to remove all deleted text (merge contributed by github user tdegeus PR #252, fixing issue #66
@@ -33,22 +48,22 @@
# - Abbreviations involving punctuations within them. They need special treatment because otherwise in some
# circumstances the gnoring of white space differences in conjunction with merging according to MINWORDSBLOCK rule
# could turn 'i.e.' into 'i.\PAR e.' (see https://github.com/ftilmann/latexdiff/issues/269). A few abbreviations
-# are now hard-coded and treated as atomic:
+# are now hard-coded and treated as atomic:
# English: i.e., e.g. Deutsch: z.B.
# (fixes issue #269)
# - In WHOLE and COARSE math modes, now properly treat math environments with arguments such as \alignat. Fixes #251
-# - For FINE math mode, multiple improvments to the processing work flow yield more robust outcomes. In particular, changes
-# to the equation type, e.g. \begin{displaymath} -> \begin{equation} without modifications now usually no longer result
-# in errors. (Partially) fixes issues #235 and #244.
-# - When encountering deleted math array environments such as align or eqnarray, rather than replacing them with a
-# fixed replacement environment (e.g. align* or eqnarray*), an asterisk is now added to the original command, which
+# - For FINE math mode, multiple improvments to the processing work flow yield more robust outcomes. In particular, changes
+# to the equation type, e.g. \begin{displaymath} -> \begin{equation} without modifications now usually no longer result
+# in errors. (Partially) fixes issues #235 and #244.
+# - When encountering deleted math array environments such as align or eqnarray, rather than replacing them with a
+# fixed replacement environment (e.g. align* or eqnarray*), an asterisk is now added to the original command, which
# in amsmath (and with eqnarray) will result in the same environment but without line numbers. Config variable MATHARRREPL
# is therefore (nearly) redundant, and a depracation warning is given when it is set. Reference to MATHARRREPL are have
# been removed from the manual (there is one exception, when it's still being used: sometimes latexdiff can figure out
# that there is a deleted array environment, but does not know which one. In this case, MATHARRREPL is still being used
-# to encapsulate these parts of the source, and therefore it is still set internally. But this is a quite rare situation).
+# to encapsulate these parts of the source, and therefore it is still set internally. But this is a quite rare situation).
# Fixes issue #216
-# - Unlike 'array' environment, 'split' (amsmath) does not work in argument of \DIFadd or \DIFdl in UNDERLINE modes; therefore remove it from ARRENV configuration variable.
+# - Unlike 'array' environment, 'split' (amsmath) does not work in argument of \DIFadd or \DIFdl in UNDERLINE modes; therefore remove it from ARRENV configuration variable.
# Exclude \begin and \end in math environments in COARSE and WHOLE modes. Fixes #258. Fixes #109
# - --flatten now works for empty files. Fixes issue #242
# - improved processing of Chinese and Japanese texts in that splitting is done based on characters. Thanks to LuXu (Oliver Lew) in git for working this out. Fixes #229, fixes #145
@@ -65,7 +80,7 @@
# Bug fixes:
# - fix issue #206 affecting proper markup of text commands which are not also safe cmd's and have multiple arguments
# - fix issue #210 by adding \eqref (amsmath package) to the list of safe commands
-# - fix bug reported in issue #168 mangled verbatim line environment
+# - fix bug reported in issue #168 mangled verbatim line environment
# - fix bug reported in issue #218 by replacing \hspace{0pt} after \mbox{..} auxiliary commands with \hskip0pt.
# - more ways to process \frac correctly with atomic arguments (committed by julianuu PR #246
# - fix a bug in biblatex mode, which prevented proper processing of modified \textcite (see: https://tex.stackexchange.com/questions/555157/latexdiff-and-biblatex-citation-commands)
@@ -74,10 +89,10 @@
# Version 1.3.1.1
# - remove spurious \n to fix error: Unknown regexp modifier "/n" at .../latexdiff line 1974, near "=~ " (see github issue #201)
#
-# Version 1.3.1
+# Version 1.3.1
# Bug fixes:
# - remove some uninitialised variable $2 warnings in string substitution in flatten function in case included file is not found
-# - add minimal postprocessing to diff processing of preamble commands (replace \RIGHTBRACE by \} )
+# - add minimal postprocessing to diff processing of preamble commands (replace \RIGHTBRACE by \} )
# - pre-processing: replace (contributed) routine take_comments_and_enter_from_frac() with take_comments_and_newline_from_frac(), which does the same thing
# (remove whitespace characters and comments between the argument of \frac commands) in an easier and more robust way. In addition, it
# will replace commands like \frac12 with \frac{1}{2} as pre-processing step. Fixes issue #184
@@ -95,15 +110,15 @@
# Version 1.3.0 (7 October 2018):
# - treat options to \documentclass as potential package names (some packages allow implicit loading of or imply selected packages
# - improved pattern matching: now allows nested angular brackets, and is no longer confused by escaped curly braces
-# - improved pattern matching in COARSE mode: occasionally, the closing bracket or some other elements would be matched in an 'unnatural' way due to another sequence being more minimal in the computational sense, sometimes even causing errors due to tokens moving in or out of the scope of math environments. This is now discouraged by adding internal \DIFANCHOR commands (which are removed again in post-processing) (fixes issues reported via email by li_ruomeng .
+# - improved pattern matching in COARSE mode: occasionally, the closing bracket or some other elements would be matched in an 'unnatural' way due to another sequence being more minimal in the computational sense, sometimes even causing errors due to tokens moving in or out of the scope of math environments. This is now discouraged by adding internal \DIFANCHOR commands (which are removed again in post-processing) (fixes issues reported via email by li_ruomeng .
# - verbatim and lstlisting environments are marked-up with line-by-line in a similar style to non-verbatim text (requires the listing package to be installed)
# (see new configuration variable VERBATIMLINEENV) (several issues and pull requests by jprotze)
-# - --flatten: now supports \verbatiminput and \lstlistinput
+# - --flatten: now supports \verbatiminput and \lstlistinput
# - --flatten: if file is not found, do not fail, simply warn and leave command unexpanded (inspired by issue #112). Don't warn if file name contains #[0-9] as it is then most likely an argument within a command definition rather than an actual file (applies to \input, \subfile, \include commands)
# - added to textcmds: \intertext
# - new config variable CUSTOMDIFCMD to allow defining special versions of commands in added or deleted blocks (Pull request by github user jprotze)
# - added option -no-links (mostly for use by latexdiff-vc in only-changes modes) (Pull request by github user jprotze)
-# - new option --filter-script to run both input through a pre-processing script (PR jasonmccsmith #167)
+# - new option --filter-script to run both input through a pre-processing script (PR jasonmccsmith #167)
# new option --no-filter-stderr to hide stderr output from filter-script (potentially dangerous, as this might hide malfunctioning of filter scripts)
# - --flatten now can deal with imports made using the import package {PR jasonmccsmith #173)
# Bug fixes:
@@ -122,12 +137,12 @@
# make environments that are treated like verbatim environments configurable (config variable VERBATIMENV)
# treat lstinlne as equivalent to verb command
# partially addresses issue #38
-# - refactoring: set default configuration variables in a hash, and those that correspond to lists
+# - refactoring: set default configuration variables in a hash, and those that correspond to lists
# - feature: option --add-to-config used to amend configuration variables, which are regex pattern lists
# - bug fix: deleted figures when endfloat package is activated
# - bug fix: alignat environment now always processed correctly (fix issues #65)
# - bug fix: avoid processing of commands as potential files in routine init_regex_arr (fix issue #70 )
-# - minimal feature enhancement: treat '@' as allowed character in commands (strictly speaking requires prior \makeatletter statement, but always assuming it to be
+# - minimal feature enhancement: treat '@' as allowed character in commands (strictly speaking requires prior \makeatletter statement, but always assuming it to be
# @ a letter if it is part of a command name will usually lead to the correct behaviour (see http://tex.stackexchange.com/questions/346651/latexdiff-and-let)
# - new feature/bug fix: --flatten option \endinput in included files now respected but only if \endinput stands right at the beginning of the line (issue #77)
# - bug fix: flatten would incorrectly attempt to process commented out \include commands (from discussion in issue #77 )
@@ -165,7 +180,7 @@
# - introduce list UNSAFEMATHCMD, which holds list of commands which cannot be marked up with \DIFadd or \DIFdel commands (only relevant for WHOLE and COARSE math markup modes)
# - new subtype LABEL which gives each change a label. This can later be used to only display pages where changes
# have been made (instructions for that are put as comments into the diff'ed file) inspired by answer on http://tex.stackexchange.com/questions/166049/invisible-markers-in-pdfs-using-pdflatex
-# - Configuration variables take into accout some commands from additional packages:
+# - Configuration variables take into accout some commands from additional packages:
# tikzpicture environment now treated as PICTUREENV, and \smallmatrix in ARRENV (amsmath)
# - --flatten: support for \subfile command (subfiles package) (in response to http://tex.stackexchange.com/questions/167620/latexdiff-with-subfiles )
# - --flatten: \bibliography commands expand if corresponding bbl file present
@@ -179,11 +194,11 @@
# - \% in one-letter sub/Superscripts was not converted correctly
#
# Version 1.0.3
-# - fix bug in add_safe_commands that made latexdiff hang on DeclareMathOperator
+# - fix bug in add_safe_commands that made latexdiff hang on DeclareMathOperator
# command in preamble
# - \(..\) inline math expressions were not parsed correctly, if they contained a linebreak
# - applied patch contributed by tomflannaghan via Berlios: [ Patch #3431 ] Adds correct handling of \left< and \right>
-# - \$ is treated correctly as a literal dollar sign (thanks to Reed Cartwright and Joshua Miller for reporting this bug
+# - \$ is treated correctly as a literal dollar sign (thanks to Reed Cartwright and Joshua Miller for reporting this bug
# and sketching out the solution)
# - \^ and \_ are correctly interpreted as accent and underlined space, respectively, not as superscript of subscript
# (thanks to Wail Yahyaoui for pointing out this bug)
@@ -191,19 +206,19 @@
# Version 1.0.1 - treat \big,\bigg etc. equivalently to \left and
# \right - include starred version in MATHENV - apply
# - flatten recursively and --flatten expansion is now
-# aware of comments (thanks to Tim Connors for patch)
+# aware of comments (thanks to Tim Connors for patch)
# - Change to post-processing for more reliability for
# deleted math environments
-# - On linux systems, recognise and remove DOS style newlines
+# - On linux systems, recognise and remove DOS style newlines
# - Provide markup for some special preamble commands (\title,
-# \author,\date,
-# - configurable by setting context2cmd
+# \author,\date,
+# - configurable by setting context2cmd
# - for styles using ulem package, remove \emph and \text.. from list of
# safe commands in order to allow linebreaks within the
-# highlighted sections.
-# - for ulem style, now show citations by enclosing them in \mbox commands.
-# This unfortunately implies linebreaks within citations no longer function,
-# so this functionality can be turned off (Option --disable-citation-markup).
+# highlighted sections.
+# - for ulem style, now show citations by enclosing them in \mbox commands.
+# This unfortunately implies linebreaks within citations no longer function,
+# so this functionality can be turned off (Option --disable-citation-markup).
# With --enable-citation-markup, the mbox markup is forced for other styles)
# - new substyle COLOR. This is particularly useful for marking up citations
# and some special post-processing is implemented to retain cite
@@ -211,11 +226,11 @@
# - four different levels of math-markup
# - Option --driver for choosing driver for modes employing changebar package
# - accept \\* as valid command (and other commands of form \.*). Also accept
-# \<nl> (backslashed newline)
+# \<nl> (backslashed newline)
# - some typo fixes, include commands defined in preamble as safe commands
-# (Sebastian Gouezel)
+# (Sebastian Gouezel)
# - include compared filenames as comments as line 2 and 3 of
-# the preamble (can be modified with option --label, and suppressed with
+# the preamble (can be modified with option --label, and suppressed with
# --no-label), option --visible-label to show files in generated pdf or dvi
# at the beginning of main document
#
@@ -231,7 +246,7 @@
#
# Version 0.4 March 06 option for fast differencing using UNIX diff command, several minor bug fixes (\par bug, improved highlighting of textcmds)
#
-# Version 0.3 August 05 improved parsing of displayed math, --allow-spaces
+# Version 0.3 August 05 improved parsing of displayed math, --allow-spaces
# option, several minor bug fixes
#
# Version 0.25 October 04 Fix bug with deleted equations, add math mode commands to safecmd, add | to allowed interpunctuation signs
@@ -808,12 +823,13 @@ use utf8 ;
use File::Spec ;
+
my ($algodiffversion)=split(/ /,$Algorithm::Diff::VERSION);
my ($versionstring)=<<EOF ;
-This is LATEXDIFF 1.3.3 (Algorithm::Diff $Algorithm::Diff::VERSION, Perl $^V)
- (c) 2004-2022 F J Tilmann
+This is LATEXDIFF 1.3.4 (Algorithm::Diff $Algorithm::Diff::VERSION, Perl $^V)
+ (c) 2004-2024 F J Tilmann
EOF
# Hash with defaults for configuration variables. These marked undef have default values constructed from list defined in the DATA block
@@ -904,9 +920,9 @@ my $DELCMDOPEN='%DIFDELCMD < '; # To mark begin of deleted commands (must begin
my $DELCMDCLOSE="%%%\n"; # To mark end of deleted commands (must end with a new line)
my $AUXCMD='%DIFAUXCMD' ; # follows auxiliary commands put in by latexdiff to make difference file legal
# auxiliary commands must be on a line of their own
- # Note that for verbatim environment openings the %DIFAUXCMD cannot be placed in
+ # Note that for verbatim environment openings the %DIFAUXCMD cannot be placed in
# the same line as this would mean they are shown
- # so the special form "%DIFAUXCMD NEXT" is used to indicate that the next line
+ # so the special form "%DIFAUXCMD NEXT" is used to indicate that the next line
# is an auxiliary command
# Similarly "%DIFAUXCMD LAST" would indicate the auxiliary command is in previous line (not currently used)
my $DELCOMMENT='DIF < '; # To mark deleted comment line
@@ -917,21 +933,21 @@ my @TEXTCMDLIST=(); # array containing patterns of commands with text arguments
my @TEXTCMDEXCL=(); # array containing patterns of commands without text arguments (if a pattern
# matches both TEXTCMDLIST and TEXTCMDEXCL it is excluded)
my @CONTEXT1CMDLIST=(); # array containing patterns of commands with text arguments (subset of text commands),
- # but which cause confusion if used out of context (e.g. \caption).
+ # but which cause confusion if used out of context (e.g. \caption).
# In deleted passages, the command will be disabled but its argument is marked up
- # Otherwise they behave exactly like TEXTCMD's
+ # Otherwise they behave exactly like TEXTCMD's
my @CONTEXT1CMDEXCL=(); # exclude list for above, but always empty
my @CONTEXT2CMDLIST=(); # array containing patterns of commands with text arguments, but which fail or cause confusion
# if used out of context (e.g. \title). They and their arguments will be disabled in deleted
# passages
my @CONTEXT2CMDEXCL=(); # exclude list for above, but always empty
my @MATHTEXTCMDLIST=(); # treat like textcmd. If a textcmd is in deleted or added block, just wrap the
- # whole content with \DIFadd or \DIFdel irrespective of content. This functionality
+ # whole content with \DIFadd or \DIFdel irrespective of content. This functionality
# is useful for pseudo commands \MATHBLOCK.. into which math environments are being
- # transformed
-my @MATHTEXTCMDEXCL=(); #
+ # transformed
+my @MATHTEXTCMDEXCL=(); #
-# Note I need to declare this with "our" instead of "my" because later in the code I have to "local"ise these
+# Note I need to declare this with "our" instead of "my" because later in the code I have to "local"ise these
our @SAFECMDLIST=(); # array containing patterns of safe commands (which do not break when in the argument of DIFadd or DIFDEL)
our @SAFECMDEXCL=();
my @MBOXCMDLIST=(); # patterns for commands which are in principle safe but which need to be surrounded by an \mbox
@@ -996,7 +1012,7 @@ $mathmarkup=COARSE;
$verbose=0;
$onlyadditions=0;
# output debug and intermediate files, set to 0 in final distribution
-$debug=0;
+$debug=0;
# insert preamble directly after documentclass - experimental feature, set to 0 in final distribution
# Note that this failed with mini example (or other files, where packages used in latexdiff preamble
# are called again with incompatible options in preamble of resulting file)
@@ -1019,9 +1035,9 @@ END
my %verbhash;
Getopt::Long::Configure('bundling');
-GetOptions('type|t=s' => \$type,
- 'subtype|s=s' => \$subtype,
- 'floattype|f=s' => \$floattype,
+GetOptions('type|t=s' => \$type,
+ 'subtype|s=s' => \$subtype,
+ 'floattype|f=s' => \$floattype,
'config|c=s' => \@configlist,
'add-to-config=s' => \@addtoconfiglist,
'preamble|p=s' => \$preamblefile,
@@ -1070,11 +1086,11 @@ if ( $help ) {
if ( $version ) {
- print STDERR $versionstring ;
+ print STDERR $versionstring ;
exit 0;
}
-print STDERR $versionstring if $verbose;
+print STDERR $versionstring if $verbose;
if (defined($showall)){
$showpreamble=$showsafe=$showtext=$showconfig=1;
@@ -1092,7 +1108,7 @@ if (defined($mathmarkup)) {
$mathmarkup=~tr/a-z/A-Z/;
if ( $mathmarkup eq 'OFF' ){
$mathmarkup=OFF;
- } elsif ( $mathmarkup eq 'WHOLE' ){
+ } elsif ( $mathmarkup eq 'WHOLE' ){
$mathmarkup=WHOLE;
} elsif ( $mathmarkup eq 'COARSE' ){
$mathmarkup=COARSE;
@@ -1195,7 +1211,7 @@ foreach $config ( @configlist ) {
}
}
foreach $assign ( @config ) {
- $assign=~ m/\s*(\w*)\s*=\s*(\S*)\s*$/ or die "Illegal assignment $assign in configuration list (must be variable=value)";
+ $assign=~ m/\s*(\w*)\s*=\s*(\S*)\s*$/ or die "Illegal assignment $assign in configuration list (must be variable=value)";
exists $CONFIG{$1} or die "Unknown configuration variable $1.";
$CONFIG{$1}=$2;
}
@@ -1232,7 +1248,7 @@ foreach $key ( keys(%CONFIG) ) {
foreach $assign ( @addtoconfig ) {
###print STDERR "assign:|$assign|\n";
- $assign=~ m/\s*(\w*)\s*=\s*(\S*)\s*$/ or die "Illegal assignment $assign in configuration list (must be variable=value)";
+ $assign=~ m/\s*(\w*)\s*=\s*(\S*)\s*$/ or die "Illegal assignment $assign in configuration list (must be variable=value)";
exists $CONFIG{$1} or die "Unknown configuration variable $1.";
$CONFIG{$1}.=";$2";
}
@@ -1247,8 +1263,8 @@ foreach ( keys(%CONFIG) ) {
elsif ( $_ eq "MATHENV" ) { $MATHENV = liststringtoregex($CONFIG{$_}) ; }
elsif ( $_ eq "MATHREPL" ) { $MATHREPL = $CONFIG{$_} ; }
elsif ( $_ eq "MATHARRENV" ) { $MATHARRENV = liststringtoregex($CONFIG{$_}) ; }
- elsif ( $_ eq "MATHARRREPL" ) { $MATHARRREPL = $CONFIG{$_} ;
- print STDERR "WARNING: Setting MATHARRREPL is depracated. Generally deleted math array environments will be set to their starred varieties and the setting of MATHARREPL is ignored.\n\n" unless $MATHARRREPL =~ /eqnarray\*/ ;
+ elsif ( $_ eq "MATHARRREPL" ) { $MATHARRREPL = $CONFIG{$_} ;
+ print STDERR "WARNING: Setting MATHARRREPL is depracated. Generally deleted math array environments will be set to their starred varieties and the setting of MATHARREPL is ignored.\n\n" unless $MATHARRREPL =~ /eqnarray\*/ ;
}
elsif ( $_ eq "ARRENV" ) { $ARRENV = liststringtoregex($CONFIG{$_}) ; }
elsif ( $_ eq "VERBATIMENV" ) { $VERBATIMENV = liststringtoregex($CONFIG{$_}) ; }
@@ -1275,11 +1291,11 @@ foreach $pkg ( @packagelist ) {
if ($showconfig || $showtext || $showsafe || $showpreamble) {
show_configuration();
- exit 0;
+ exit 0;
}
-if ( @ARGV != 2 ) {
+if ( @ARGV != 2 ) {
print STDERR "2 and only 2 non-option arguments required. Write latexdiff -h to get help\n";
exit(2);
}
@@ -1287,7 +1303,7 @@ if ( @ARGV != 2 ) {
# Are extra spaces between command arguments permissible?
my $extraspace;
if ($allowspaces) {
- $extraspace='\s*';
+ $extraspace='\s*';
} else {
$extraspace='';
}
@@ -1310,14 +1326,14 @@ push(@SAFECMDLIST, qr/^QLEFTBRACE$/, qr/^QRIGHTBRACE$/);
# if you get "undefined control sequence MATHBLOCKmath" error, increase the maximum value in this loop
for (my $i_pat = 0; $i_pat < 20; ++$i_pat){
$pat_n = '(?:[^{}]|\{'.$pat_n.'\}|\\\\\{|\\\\\})*';
- # Actually within the text body, quoted braces are replaced in pre-processing. The only place where
+ # Actually within the text body, quoted braces are replaced in pre-processing. The only place where
# the last part of the pattern matters is when processing the arguments of context2cmds in the preamble
# and these contain a \{ or \} combination, probably rare.
# It should thus be fine to use the simpler version below.
### $pat_n = '(?:[^{}]|\{'.$pat_n.'\})*';
}
- my $brat0 = '(?:[^\[\]]|\\\[|\\\])*';
+ my $brat0 = '(?:[^\[\]]|\\\[|\\\])*';
my $brat_n = $brat0;
for (my $i_pat = 0; $i_pat < 4; ++$i_pat){
$brat_n = '(?:[^\[\]]|\['.$brat_n.'\]|\\\[|\\\])*';
@@ -1334,7 +1350,7 @@ push(@SAFECMDLIST, qr/^QLEFTBRACE$/, qr/^QRIGHTBRACE$/);
# could turn 'i.e.' into 'i.\PAR e.' (see https://github.com/ftilmann/latexdiff/issues/269)
# English: i.e., e.g. Deutsch: z.B.
my $abbreviation='(?:i\. ?e\.|e\. ?g\.|z\. ?B\.)' ;
- my $number='-?\d*\.\d*';
+ my $number='-?\d*\.\d*';
# word: sequence of letters or accents followed by letter
my $word_cj='\p{Han}|\p{InHiragana}|\p{InKatakana}';
@@ -1362,7 +1378,7 @@ push(@SAFECMDLIST, qr/^QLEFTBRACE$/, qr/^QRIGHTBRACE$/);
# inline math $....$ or \(..\)
### the commented out version is simpler but for some reason cannot cope with newline (in spite of s option) - need to include \newline explicitly
### my $math='\$(?:[^$]|\\\$)*?\$|\\\\[(].*?\\\\[)]';
- my $math='\$(?:[^$]|\\\$)*?\$|\\\\[(](?:.|\n)*?\\\\[)]';
+ my $math='\$(?:[^$]|\\\$)*?\$|\\\\[(](?:.|\n)*?\\\\[)]';
### test version (this seems to give the same results as version above)
## the current maths command cannot cope with newline within the math expression
### my $math='\$(?:[^$]|\\\$)*?\$|\\[(].*?\\[)]';
@@ -1380,7 +1396,7 @@ push(@SAFECMDLIST, qr/^QLEFTBRACE$/, qr/^QRIGHTBRACE$/);
-# now we are done setting up and can start working
+# now we are done setting up and can start working
my ($oldfile, $newfile) = @ARGV;
# check for existence of input files
if ( ! -e $oldfile ) {
@@ -1408,7 +1424,7 @@ my ($oldtime,$newtime,$oldlabel,$newlabel);
if (defined($labels[0])) {
$oldlabel=$labels[0] ;
} else {
- $oldtime=localtime((stat($oldfile))[9]);
+ $oldtime=localtime((stat($oldfile))[9]);
$oldlabel="$oldfile " . " "x($oldlabel_n_spaces) . $oldtime;
}
if (defined($labels[1])) {
@@ -1421,6 +1437,7 @@ if (defined($labels[1])) {
$encoding=guess_encoding($newfile) unless defined($encoding);
$encoding = "utf8" if $encoding =~ m/^utf8/i ;
+print STDERR "Encoding $encoding\n" if $verbose;
if (lc($encoding) eq "utf8" ) {
binmode(STDOUT, ":utf8");
binmode(STDERR, ":utf8");
@@ -1504,7 +1521,7 @@ my @auxlines;
my ($ulem)=0;
if ( length $oldpreamble && length $newpreamble ) {
- # pre-process preamble by looking for commands used in \maketitle (title, author, date etc commands)
+ # pre-process preamble by looking for commands used in \maketitle (title, author, date etc commands)
# and marking up content with latexdiff markup
@auxlines=preprocess_preamble($oldpreamble,$newpreamble);
@@ -1536,7 +1553,7 @@ if (defined($graphicsmarkup)) {
} else {
# Default: no explicit setting in menu
if ( defined $packages{"graphicx"} or defined $packages{"graphics"} ) {
- $graphicsmarkup=NEWONLY;
+ $graphicsmarkup=NEWONLY;
} else {
$graphicsmarkup=NONE;
}
@@ -1569,7 +1586,7 @@ if ($graphicsmarkup != NONE ) {
@matches=( $latexdiffpreamble =~ m/command\{\\DIFaddbeginFL}\{($pat_n)}/sg ) ;
# we look at the last one of the list to take into account possible redefinition but almost always matches should have exactly one element
if ( $matches[$#matches] =~ m/\\DIFaddbegin/ ) {
- die "Cannot combine graphics markup with float styles defining \\DIFaddbeginFL in terms of \\DIFaddbegin. Use --graphics-markup=none option or choose a different float style.";
+ die "Cannot combine graphics markup with float styles defining \\DIFaddbeginFL in terms of \\DIFaddbegin. Use --graphics-markup=none option or choose a different float style.";
exit 10;
}
###}
@@ -1583,6 +1600,11 @@ if ($graphicsmarkup != NONE ) {
$ulem = ($latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{ulem\}/ || defined $packages{"ulem"});
+# If amsmath is defined and $ulem is used for markup, redefine the \sout command to also work (mostly) in math mode
+# See stack exchange https://tex.stackexchange.com/questions/20609/strikeout-in-math-mode/308647#308647 based on comment by Taylor Raine
+if ( defined($packages{'amsmath'}) and $ulem ) {
+ $latexdiffpreamble .= join "\n",(extrapream('AMSMATHULEM'),"");
+}
# If listings is being used or can be found in the latexdiff search path, add to the preamble auxiliary code to enable line-by-line markup
if ( defined($packages{"listings"}) or `kpsewhich listings.sty` ne "" ) {
@@ -1592,7 +1614,7 @@ if ( defined($packages{"listings"}) or `kpsewhich listings.sty` ne "" ) {
}
my @listingDIFcode=();
my $replaced;
- # note that in case user supplies preamblefile the type might not reflect well the
+ # note that in case user supplies preamblefile the type might not reflect well the actual markup style
@listingDIFcode=extrapream("-nofail","DIFCODE_" . $type) unless defined($preamblefile);
if (!(@listingDIFcode)) {
# if listingDIFcode is empty try to guess a suitable one from the preamble
@@ -1606,13 +1628,17 @@ if ( defined($packages{"listings"}) or `kpsewhich listings.sty` ne "" ) {
@listingDIFcode=extrapream("DIFCODE_BOLD");
}
}
- # now splice it in
+ # add configuration so that listings work with utf-8
+ push @listingpreamble, '\lstset{extendedchars=\true,inputencoding='.$encoding."}\n";
+
+
+ # now splice it in
$replaced=0;
###print STDERR "DEBUG: listingDIFcode: ",join("\n",@listingDIFcode),"|||\n" if $debug;
- @listingpreamble=grep {
+ @listingpreamble=grep {
# only replace if this has not been done already (use short-circuit property of and)
- if (!$replaced and $_ =~ s/^.*%DIFCODE TEMPLATE.*$/join("\n",@listingDIFcode)/e ) {
+ if (!$replaced and $_ =~ s/^.*%DIFCODE TEMPLATE.*$/join("\n",@listingDIFcode)/e ) {
###print STDERR "DEBUG: Replaced text $_\n" if $debug;
$replaced=1;
1;
@@ -1642,7 +1668,7 @@ if ( length $oldpreamble && length $newpreamble ) {
unshift @oldpreamble,'';
@diffpreamble = linediff(\@oldpreamble, \@newpreamble);
# remove dummy line again
- shift @diffpreamble;
+ shift @diffpreamble;
# add filenames, modification time and latexdiff mark
defined($nolabel) or splice @diffpreamble,1,0,
"%DIF LATEXDIFF DIFFERENCE FILE",
@@ -1691,8 +1717,8 @@ if (defined $packages{"siunitx"} ) {
# protect SI command by surrounding them with an \mbox
# this is done to get around an incompatibility between the ulem and siunitx package
print STDERR "siunitx package detected.\n" if $verbose ;
- my $mboxcmds='SI,ang,numlist,numrange,SIlist,SIrange';
- init_regex_arr_list(\@SAFECMDLIST,'num,si');
+ my $mboxcmds='SI,ang,numlist,numrange,SIlist,SIrange,qty,qtylist,qtyproduct,qtyrange,complexqty';
+ init_regex_arr_list(\@SAFECMDLIST,'num,si,numproduct,unit,complexnum');
if ( $enablecitmark || ( $ulem && ! $disablecitmark )) {
init_regex_arr_list(\@MBOXCMDLIST,$mboxcmds);
} else {
@@ -1714,7 +1740,7 @@ if (defined $packages{"cleveref"} ) {
if (defined $packages{"glossaries"} ) {
# protect selected command by surrounding them with an \mbox
- # this is done to get around an incompatibility between ulem and glossaries package
+ # this is done to get around an incompatibility between ulem and glossaries package
print STDERR "glossaries package detected.\n" if $verbose ;
my $mboxcmds='[gG][lL][sS](?:|pl|disp|link|first|firstplural|desc|user[iv][iv]?[iv]?),[aA][cC][rR](?:long|longpl|full|fullpl),[aA][cC][lfp]?[lfp]?';
init_regex_arr_list(\@SAFECMDLIST,'[gG][lL][sS](?:(?:entry)?(?:text|plural|name|symbol)|displaynumberlist|entryfirst|entryfirstplural|entrydesc|entrydescplural|entrysymbolplural|entryuser[iv][iv]?[iv]?|entrynumberlist|entrydisplaynumberlist|entrylong|entrylongpl|entryshort|entryshortpl|entryfull|entryfullpl),[gG]lossentry(?:name|desc|symbol),[aA][cC][rR](?:short|shortpl),[aA]csp?');
@@ -1743,6 +1769,10 @@ if (defined $packages{"mhchem"} ) {
# push(@MATHTEXTCMDLIST,'cee');
}
+if ( defined $packages{"tikz-dependency"} ) {
+ init_regex_arr_ext(\@SAFECMDEXCL, 'AMPERSAND');
+}
+
my ( $citpat);
@@ -1830,7 +1860,7 @@ print STDERR "(",exetime()," s)\n","Done.\n" if $verbose;
# liststringtoregex(liststring)
-# expands string with semi-colon separated list into a regular expression corresponding
+# expands string with semi-colon separated list into a regular expression corresponding
# matching any of the elements
sub liststringtoregex {
my ($liststring)=@_;
@@ -1843,7 +1873,7 @@ sub liststringtoregex {
}
# show_configuration
-# note that this is not encapsulated but uses variables from the main program
+# note that this is not encapsulated but uses variables from the main program
# It is provided for convenience because in the future it is planned to allow output
# to be modified based on what packages are read etc - this works only if the input files are actually read
# whether or not additional files are provided
@@ -1870,7 +1900,7 @@ sub show_configuration {
print "\nContext1 commands (last argument textual, command will be disabled in deleted passages, last argument will be shown as plain text):\n";
print_regex_arr(@CONTEXT1CMDLIST);
print "\nContext2 commands (last argument textual, command and its argument will be disabled in deleted passages):\n";
- print_regex_arr(@CONTEXT2CMDLIST);
+ print_regex_arr(@CONTEXT2CMDLIST);
print "\nExclude list of Commands with last argument not textual (overrides patterns above):\n";
print_regex_arr(@TEXTCMDEXCL);
}
@@ -1978,7 +2008,7 @@ sub list_packages {
my %packages=();
my $pkg;
- # remove comments
+ # remove comments
$preamble=~s/(?<!\\)%.*$//mg ;
while ( $preamble =~ m/\\(?:documentclass|usepackage|RequirePackage)(?:\[($brat_n)\])?\{(.*?)\}/gs ) {
@@ -2083,7 +2113,7 @@ sub flatten {
my ($includeonly,$dirname,$fname,$newpage,$fullfile,$filecontent,$replacement,$begline,$inputcmd,$bblfile,$subfile,$command,$verbenv,$verboptions,$ignore,$fileonly);
my ($subpreamble,$subbody,$subpost);
my ($subdir,$subdirfull,$importfilepath);
- require File::Basename ;
+ require File::Basename ;
### require File::Spec ; # now this is needed even if flatten option not given
$filename = File::Spec->rel2abs( $filename ) ;
($ignore, $dirname, $fileonly) = File::Spec->splitpath($filename) ;
@@ -2123,15 +2153,15 @@ sub flatten {
$subdirfull = (defined($3) ? File::Spec->catdir($dirname,$subdir) : $subdir);
$importfilepath = File::Spec->catfile($subdirfull, $fname);
-
+
print STDERR "importing importfilepath:", $importfilepath,"\n" if $verbose;
if ( -f $importfilepath ) {
# If file exists, replace input or include command with expanded input
#TODO: need remove_endinput & newpage similar to other replacements inside flatten
- $replacement=flatten(read_file_with_encoding($importfilepath, $encoding), $preamble,$importfilepath,$encoding);
+ $replacement=flatten(read_file_with_encoding($importfilepath, $encoding), $preamble,$importfilepath,$encoding);
} else {
# if file does not exist, do not expand include or input command (do not warn if fname contains #[0-9] as it is then likely part of a command definition
- # and is not meant to be expanded directly
+ # and is not meant to be expanded directly
print STDERR "WARNING: Could not find included file ",$importfilepath,". I will continue but not expand |$2|\n";
$replacement = $2;
$replacement .= "{$subdir}{$fname} % Processed";
@@ -2140,13 +2170,13 @@ sub flatten {
}/exgm;
# recursively replace \\input and \\include files
- $text =~ s/(^(?:[^%\n]|\\%)*)(\\input\{(.*?)\}|\\include\{(${includeonly}(?:\.tex)?)\})/{
+ $text =~ s/(^(?:[^%\n]|\\%)*)(\\input\{(.*?)\}|\\include\{(${includeonly}(?:\.tex)?)\})/{
$begline=(defined($1)? $1 : "") ;
$inputcmd=$2;
$fname = $3 if defined($3) ;
$fname = $4 if defined($4) ;
$newpage=(defined($4)? " \\newpage " : "") ;
- # # add tex extension unless there is a three or four letter extension already
+ # # add tex extension unless there is a three or four letter extension already
$fname .= ".tex" unless $fname =~ m|\.\w{3,4}$|;
$fullfile = File::Spec->catfile($dirname,$fname);
print STDERR "DEBUG Beg of line match |$1|\n" if defined($1) && $debug ;
@@ -2155,12 +2185,12 @@ sub flatten {
# content of file becomes replacement value (use recursion), add \newpage if the command was include
if ( -f $fullfile ) {
# If file exists, replace input or include command with expanded input
- $replacement=flatten(read_file_with_encoding($fullfile, $encoding), $preamble,$filename,$encoding);
- $replacement = remove_endinput($replacement);
+ $replacement=flatten(read_file_with_encoding($fullfile, $encoding), $preamble,$filename,$encoding);
+ $replacement = remove_endinput($replacement);
# \include always starts a new page; use explicit \newpage command to simulate this
} else {
# if file does not exist, do not expand include or input command (do not warn if fname contains #[0-9] as it is then likely part of a command definition
- # and is not meant to be expanded directly
+ # and is not meant to be expanded directly
print STDERR "WARNING: Could not find included file ",$fullfile,". I will continue but not expand |$inputcmd|\n" unless $fname =~ m(#[0-9]) ;
$replacement = $inputcmd ; # i.e. just the original command again -> make no change file does not exist
$newpage="";
@@ -2169,7 +2199,7 @@ sub flatten {
}/exgm;
# replace bibliography with bbl file if it exists
- $text=~s/(^(?:[^%\n]|\\%)*)\\bibliography\{(.*?)\}/{
+ $text=~s/(^(?:[^%\n]|\\%)*)\\bibliography\{(.*?)\}/{
if ( -f $bblfile ){
$replacement=read_file_with_encoding(File::Spec->catfile($bblfile), $encoding);
} else {
@@ -2181,10 +2211,10 @@ sub flatten {
}/exgm;
# replace subfile with contents (subfile package)
- $text=~s/(^(?:[^%\n]|\\%)*)\\subfile\{(.*?)\}/{
+ $text=~s/(^(?:[^%\n]|\\%)*)\\subfile\{(.*?)\}/{
$begline=(defined($1)? $1 : "") ;
- $fname = $2;
- # # add tex extension unless there is a three or four letter extension already
+ $fname = $2;
+ # # add tex extension unless there is a three or four letter extension already
$fname .= ".tex" unless $fname =~ m|\.\w{3,4}|;
print STDERR "Include file as subfile $fname\n" if $verbose;
# content of file becomes replacement value (use recursion)
@@ -2195,10 +2225,10 @@ sub flatten {
# if file exists, expand \subfile command by contents of file
$subfile=read_file_with_encoding($fullfile,$encoding) or die "Could not open included subfile ",$fullfile,": $!";
($subpreamble,$subbody,$subpost)=splitdoc($subfile,'\\\\begin\{document\}','\\\\end\{document\}');
- ### $subfile=~s|^.*\\begin{document}||s;
+ ### $subfile=~s|^.*\\begin{document}||s;
### $subfile=~s|\\end{document}.*$||s;
$replacement=flatten($subbody, $preamble,$fullfile,$encoding);
- ### $replacement = remove_endinput($replacement);
+ ### $replacement = remove_endinput($replacement);
} else {
# if file does not exist, do not expand subfile
print STDERR "WARNING: Could not find subfile ",$fullfile,". I will continue but not expand |$2|\n" unless $fname =~ m(#[0-9]) ;
@@ -2209,11 +2239,11 @@ sub flatten {
}/exgm;
# replace \verbatiminput and \lstlistinginput
- $text=~s/(^(?:[^%\n]|\\%)*)\\(verbatiminput\*?|lstinputlisting)$extraspace(\[$brat_n\])?$extraspace\{(.*?)\}/{
+ $text=~s/(^(?:[^%\n]|\\%)*)\\(verbatiminput\*?|lstinputlisting)$extraspace(\[$brat_n\])?$extraspace\{(.*?)\}/{
$begline=(defined($1)? $1 : "") ;
$command = $2 ;
$fname = $4 ;
- $verboptions = defined($3)? $3 : "" ;
+ $verboptions = defined($3)? $3 : "" ;
if ($command eq 'verbatiminput' ) {
$verbenv = "verbatim" ;
} elsif ($command eq 'verbatiminput*' ) {
@@ -2222,7 +2252,7 @@ sub flatten {
$verbenv = "lstlisting" ;
} else {
die "Internal errorL Unexpected verbatim input type $command.\n";
- }
+ }
print STDERR "DEBUG Beg of line match |$begline|\n" if $debug ;
print STDERR "Include file $fname verbatim\n" if $verbose;
print STDERR "DEBUG looking for file ",File::Spec->catfile($dirname,$fname), "\n" if $debug;
@@ -2254,8 +2284,8 @@ sub print_regex_arr {
# if $type is a filename, it will read the file instead of reading from the appendix
# otherwise it will screen appendix for line "%DIF $TYPE" and copy everything up to line
# '%DIF END $TYPE' (where $TYPE is upcased version of $type)
-# extrapream('-nofail',$type) will---instead of failing---simply return nothing if
-# it does not find the matching line in a appendix (do not use -nofail option with multiple types!)
+# extrapream('-nofail',$type) will---instead of failing---simply return nothing if
+# it does not find the matching line in appendix (do not use -nofail option with multiple types!)
sub extrapream {
my @types=@_;
my ($type,$arg);
@@ -2272,14 +2302,20 @@ sub extrapream {
$type=$arg;
$copy=0;
if ( -f $type || lc $type eq '/dev/null' ) {
- open (FILE,$type) or die "Cannot open preamble file $type: $!";
print STDERR "Reading preamble file $type\n" if $verbose ;
+ open (FILE,$type) or die "Cannot open preamble file $type: $!";
+ if (defined($encoding)) {
+ binmode(FILE,":encoding($encoding)");
+ } else {
+ require Encode::Locale;
+ binmode(FILE,":encoding(locale)");
+ }
while (<FILE>) {
chomp ;
if ( $_ =~ m/%DIF PREAMBLE/ ) {
- push (@retval,"$_");
+ push (@retval,"$_");
} else {
- push (@retval,"$_ %DIF PREAMBLE");
+ push (@retval,"$_ %DIF PREAMBLE");
}
}
} else { # not (-f $type)
@@ -2291,9 +2327,9 @@ sub extrapream {
my $data_start = tell DATA;
while (<DATA>) {
if ( m/^%DIF $type/ ) {
- $copy=1;
+ $copy=1;
} elsif ( m/^%DIF END $type/ ) {
- last;
+ last;
}
chomp;
push (@retval,"$_ %DIF PREAMBLE") if $copy;
@@ -2333,7 +2369,7 @@ sub splitdoc {
$pos=pos $rest;
$part2=substr($rest,0,$pos-length($2));
$part3=substr($rest,$pos);
- }
+ }
else {
die "$word1 and $word2 not in the correct order or not present as a pair." ;
}
@@ -2405,7 +2441,7 @@ sub splitlatex {
my $leadin=$1;
length($string)>0 or return ($leadin);
- my @retval=($string =~ m/$pat/osg);
+ my @retval=($string =~ m/$pat/osg);
if (length($string) != length(join("",@retval))) {
print STDERR "\nWARNING: Inconsistency in length of input string and parsed string:\n This often indicates faulty or non-standard latex code.\n In many cases you can ignore this and the following warning messages.\n Note that character numbers in the following are counted beginning after \\begin{document} and are only approximate." unless $ignorewarnings;
@@ -2449,17 +2485,17 @@ sub splitlatex {
# pass1( \@seq1,\@seq2)
# Look for differences between seq1 and seq2.
-# Where an common-subsequence block is flanked by deleted or appended blocks,
+# Where an common-subsequence block is flanked by deleted or appended blocks,
# and is shorter than $MINWORDSBLOCK words it is appended
-# to the last deleted or appended word. If the block contains tokens other than words
+# to the last deleted or appended word. If the block contains tokens other than words
# or punctuation it is not merged.
# Deleted or appended block consisting of words and safe commands only are
# also merged, to prevent break-up in pass2 (after previous isolated words have been removed)
-# If there are commands with textual arguments (e.g. \caption) both in corresponding
-# appended and deleted blocks split them such that the command and opening bracket
-# are one token, then the rest is split up following standard rules, and the closing
+# If there are commands with textual arguments (e.g. \caption) both in corresponding
+# appended and deleted blocks split them such that the command and opening bracket
+# are one token, then the rest is split up following standard rules, and the closing
# bracket is a separate token, ie. turn
-# "\caption{This is a textual argument}" into
+# "\caption{This is a textual argument}" into
# ("\caption{","This ","is ","a ","textual ","argument","}")
# No return value. Destructively changes sequences
sub pass1 {
@@ -2488,15 +2524,15 @@ sub pass1 {
my $adddiscard = sub {
if ($cnt > 0 ) {
$matblkcnt++;
- # just after an unchanged block
+ # just after an unchanged block
# print STDERR "Unchanged block $cnt, $last1,$last2 \n";
- if ($cnt < $MINWORDSBLOCK
+ if ($cnt < $MINWORDSBLOCK
&& $cnt==scalar (
- grep { /^$wpat/ || ( /^\\((?:[`'^"~=.]|[\w\d@*]+))((?:\[$brat_n\]|\{$pat_n\})*)/o
- && iscmd($1,\@SAFECMDLIST,\@SAFECMDEXCL)
+ grep { /^$wpat/ || ( /^\\((?:[`'^"~=.]|[\w\d@*]+))((?:\[$brat_n\]|\{$pat_n\})*)/o
+ && iscmd($1,\@SAFECMDLIST,\@SAFECMDEXCL)
&& scalar(@dummy=split(" ",$2))<3 ) }
@$block) ) {
- # merge identical blocks shorter than $MINWORDSBLOCK
+ # merge identical blocks shorter than $MINWORDSBLOCK
# and only containing ordinary words
# with preceding different word
# We cannot carry out this merging immediately as this
@@ -2504,23 +2540,23 @@ sub pass1 {
# the algorithm, instead we store in @$todo where we have to merge
push(@$todo, [ $last1,$last2,$cnt,@$block ]);
}
- $block = [];
+ $block = [];
$cnt=0; $last1=-1; $last2=-1;
}
};
my $discard=sub { $deltokcnt++;
&$adddiscard; #($_[0],$_[1]);
push(@$delblock,[ $seq1->[$_[0]],$_[0] ]);
- $last1=$_[0] };
+ $last1=$_[0] };
my $add = sub { $addtokcnt++;
&$adddiscard; #($_[0],$_[1]);
push(@$addblock,[ $seq2->[$_[1]],$_[1] ]);
- $last2=$_[1] };
+ $last2=$_[1] };
my $match = sub { $mattokcnt++;
if ($cnt==0) { # first word of matching sequence after changed sequence or at beginning of word sequence
- $deltextblocks = extracttextblocks($delblock);
+ $deltextblocks = extracttextblocks($delblock);
$delblkcnt++ if scalar @$delblock;
$addtextblocks = extracttextblocks($addblock);
$addblkcnt++ if scalar @$addblock;
@@ -2536,7 +2572,7 @@ sub pass1 {
### Algorithm::Diff 1.19
$matchindex=Algorithm::Diff::_longestCommonSubsequence($delcmds,$addcmds, 0, sub { $_[0]->[0] } );
} else {
- ### Algorithm::Diff 1.15
+ ### Algorithm::Diff 1.15
$matchindex=Algorithm::Diff::_longestCommonSubsequence($delcmds,$addcmds, sub { $_[0]->[0] } );
}
@@ -2567,11 +2603,11 @@ sub pass1 {
my ($index,$block,$cnt)=@{ shift(@$addtextblocks) };
push(@$todo, [-1,$index,$cnt,@$block]);
}
-
+
$addblock=[];
$delblock=[];
}
- push(@$block,$seq2->[$_[1]]);
+ push(@$block,$seq2->[$_[1]]);
$cnt++ };
my $keyfunc = sub { join(" ",split(" ",shift())) };
@@ -2579,7 +2615,7 @@ sub pass1 {
traverse_sequences($seq1,$seq2, { MATCH=>$match, DISCARD_A=>$discard, DISCARD_B=>$add }, $keyfunc );
- # now carry out the merging/splitting. Refer to elements relative from
+ # now carry out the merging/splitting. Refer to elements relative from
# the end (with negative indices) as these offsets don't change before the instruction is executed
# cnt>0: merged small unchanged groups with previous changed blocks
# cnt==-1: split textual commands into components
@@ -2594,7 +2630,7 @@ sub pass1 {
}
}
- if ($verbose) {
+ if ($verbose) {
print STDERR "\n";
print STDERR " $mattokcnt matching tokens in $matblkcnt blocks.\n";
print STDERR " $deltokcnt discarded tokens in $delblkcnt blocks.\n";
@@ -2604,10 +2640,10 @@ sub pass1 {
# extracttextblocks(\@blockindex)
-# $blockindex has the following format
-# [ [ token1, index1 ], [token2, index2],.. ]
-# where index refers to the index in the original old or new word sequence
-# Returns: reference to an array of the form
+# $blockindex has the following format
+# [ [ token1, index1 ], [token2, index2],.. ]
+# where index refers to the index in the original old or new word sequence
+# Returns: reference to an array of the form
# [[ $index, $textblock, $cnt ], ..
# where $index index of block to be merged
# $textblock contains all the words to be merged with the word at $index (but does not contain this word)
@@ -2615,7 +2651,7 @@ sub pass1 {
#
# requires: iscmd
#
-sub extracttextblocks {
+sub extracttextblocks {
my $block=shift;
my ($i,$token,$index);
my $textblock=[];
@@ -2625,13 +2661,13 @@ sub extracttextblocks {
# we redefine locally $extraspace (shadowing the global definition) to capture command sequences with intervening spaces no matter what the global setting
# this is done so we can capture those commands with a predefined number of arguments without having to introduce them again explicitly here
- my $extraspace='\s*';
+ my $extraspace='\s*';
for ($i=0;$i< scalar @$block;$i++) {
($token,$index)=@{ $block->[$i] };
# store pure text blocks
- if ($token =~ /$wpat/ || ( $token =~/^\\((?:[`'^"~=.]|[\w\d@\*]+))((?:${extraspace}\[$brat_n\]${extraspace}|${extraspace}\{$pat_n\})*)/
- && iscmd($1,\@SAFECMDLIST,\@SAFECMDEXCL)
+ if ($token =~ /$wpat/ || ( $token =~/^\\((?:[`'^"~=.]|[\w\d@\*]+))((?:${extraspace}\[$brat_n\]${extraspace}|${extraspace}\{$pat_n\})*)/
+ && iscmd($1,\@SAFECMDLIST,\@SAFECMDEXCL)
&& !iscmd($1,\@TEXTCMDLIST,\@TEXTCMDEXCL))) {
# we have text or a command which can be treated as text
if ($last<0) {
@@ -2639,7 +2675,7 @@ sub extracttextblocks {
$last=$index;
} else {
# add to pure-text block
- push(@$textblock, $token);
+ push(@$textblock, $token);
}
} else {
# it is not text
@@ -2660,29 +2696,29 @@ sub extracttextblocks {
# extractcommands( \@blockindex )
-# $blockindex has the following format
-# [ [ token1, index1 ], [token2, index2],.. ]
-# where index refers to the index in the original old or new word sequence
-# Returns: reference to an array of the form
-# [ [ "\cmd1", index, "\cmd1[optarg]{arg1}{", "arg2" ,"} " ],..
-# where index is just taken from input array
-# command must have a textual argument as last argument
-#
-# requires: iscmd
-#
-sub extractcommands {
+# $blockindex has the following format
+# [ [ token1, index1 ], [token2, index2],.. ]
+# where index refers to the index in the original old or new word sequence
+# Returns: reference to an array of the form
+# [ [ "\cmd1", index, "\cmd1[optarg]{arg1}{", "arg2" ,"} " ],..
+# where index is just taken from input array
+# command must have a textual argument as last argument
+#
+# requires: iscmd
+#
+sub extractcommands {
my $block=shift;
my ($i,$token,$index,$cmd,$open,$mid,$closing);
my $retval=[];
# we redefine locally $extraspace (shadowing the global definition) to capture command sequences with intervening spaces no matter what the global setting
# this is done so we can capture those commands with a predefined number of arguments without having to introduce them again explicitly here
- my $extraspace='\s*';
+ my $extraspace='\s*';
for ($i=0;$i< scalar @$block;$i++) {
($token,$index)=@{ $block->[$i] };
# check if token is an alphanumeric command sequence with at least one non-optional argument
- # \cmd[...]{...}{last argument}
+ # \cmd[...]{...}{last argument}
# Capturing in the following results in these associations
# $1: \cmd[...]{...}{
# $2: \cmd
@@ -2690,7 +2726,7 @@ sub extractcommands {
# $4: } + trailing spaces
if ( ( $token =~ m/^(\\([\w\d\*]+)(?:${extraspace}\[$brat_n\]|${extraspace}\{$pat_n\})*${extraspace}\{)($pat_n)(\}\s*)$/so )
&& iscmd($2,\@TEXTCMDLIST,\@TEXTCMDEXCL) ) {
- print STDERR "DEBUG EXTRACTCOMMANDS Match |$1|$2|$3|$4|$index \n" if $debug;
+ print STDERR "DEBUG EXTRACTCOMMANDS Match |$1|$2|$3|$4|$index \n" if $debug;
# push(@$retval,[ $2,$index,$1,$3,$4 ]);
($cmd,$open,$mid,$closing) = ($2,$1,$3,$4) ;
$closing =~ s/\}/\\RIGHTBRACE/ ;
@@ -2701,7 +2737,7 @@ sub extractcommands {
}
# iscmd($cmd,\@regexarray,\@regexexcl) checks
-# return 1 if $cmd matches any of the patterns in the
+# return 1 if $cmd matches any of the patterns in the
# array $@regexarray, and none of the patterns in \@regexexcl, otherwise return 0
sub iscmd {
my ($cmd,$regexar,$regexexcl)=@_;
@@ -2709,7 +2745,7 @@ sub iscmd {
### print STDERR "DEBUG: iscmd($cmd)=" if $debug;
foreach $pat ( @$regexar ) {
if ( $cmd =~ m/^${pat}$/ ) {
- $ret=1 ;
+ $ret=1 ;
last;
}
}
@@ -2725,13 +2761,13 @@ sub iscmd {
# pass2( \@seq1,\@seq2)
-# Look for differences between seq1 and seq2.
+# Look for differences between seq1 and seq2.
# Mark begin and end of deleted and appended sequences with tags $DELOPEN and $DELCLOSE
# and $ADDOPEN and $ADDCLOSE, respectively, however exclude { } & and all comands, unless
# they match an element of the whitelist (SAFECMD)
# For words in TEXTCMD but not in SAFECMD, enclose interior with $ADDOPEN and $ADDCLOSE brackets
-# Deleted comment lines are marked with %DIF <
-# Added comment lines are marked with %DIF >
+# Deleted comment lines are marked with %DIF <
+# Added comment lines are marked with %DIF >
sub pass2 {
my $seq1 = shift ;
my $seq2 = shift ;
@@ -2763,7 +2799,7 @@ sub pass2 {
$addhunk = [];
}
push(@$retval,$seq2->[$_[1]]) };
-
+
my $keyfunc = sub { join(" ",split(" ",shift())) };
traverse_sequences($seq1,$seq2, { MATCH=>$match, DISCARD_A=>$discard, DISCARD_B=>$add }, $keyfunc );
@@ -2772,7 +2808,7 @@ sub pass2 {
push @$retval,marktags($ADDMARKOPEN,$ADDMARKCLOSE,$ADDOPEN,$ADDCLOSE,"","",$ADDCOMMENT,$addhunk) if scalar @$addhunk;
- if ($verbose) {
+ if ($verbose) {
print STDERR "\n";
print STDERR " $mattokcnt matching tokens. \n";
print STDERR " $deltokcnt discarded tokens in $delblkcnt blocks.\n";
@@ -2794,7 +2830,7 @@ sub marktags {
my (@argtext);
my $retval=[];
my $noncomment=0;
- my $cmd=-1; # -1 at beginning 0: last token written is a ordinary word
+ my $cmd=-1; # -1 at beginning 0: last token written is a ordinary word
# 1: last token written is a command
# for keeping track whether we are just in a command sequence or in a word sequence
my $cmdcomment= ($opencmd =~ m/^%/); # Flag to indicate whether opencmd is a comment (i.e. if we intend to simply comment out changed commands)
@@ -2810,31 +2846,31 @@ sub marktags {
# we redefine locally $extraspace (shadowing the global definition) to capture command sequences with intervening spaces no matter what the global setting
# this is done so we can capture those commands with a predefined number of arguments without having to introduce them again explicitly here
- my $extraspace_mt='\s*';
+ my $extraspace_mt='\s*';
foreach (@$block) {
- $word=$_;
+ $word=$_;
if ( $word =~ s/^%/%$comment/ ) {
# a comment
if ($cmd==1) {
push (@$retval,$closecmd) ;
$cmd=-1;
}
- push (@$retval,$word);
+ push (@$retval,$word);
next;
}
if ( $word =~ m/^\s*$/ ) {
### print STDERR "DEBUG MARKTAGS: whitespace detected |$word| cmdcom |$cmdcomment| |$opencmd|\n" if $debug;
# a sequence of white-space characters - this should only ever happen for the first element of block.
- # in deleted block, omit, otherwise just copy it in
+ # in deleted block, omit, otherwise just copy it in
if ( ! $cmdcomment) { # ignore in deleted blocks
push(@$retval,$word);
}
next;
}
if (! $noncomment) {
- push (@$retval,$openmark);
+ push (@$retval,$openmark);
$noncomment=1;
}
# negative lookahead pattern (?!) in second clause is put in to avoid matching \( .. \) patterns
@@ -2844,7 +2880,7 @@ sub marktags {
# word is a command or other significant token (not in SAFECMDLIST)
## same conditions as in subroutine extractcommand:
# check if token is an alphanumeric command sequence with at least one non-optional argument
- # \cmd[...]{...}{last argument}
+ # \cmd[...]{...}{last argument}
# Capturing in the following results in these associations
# $1: \cmd[...]{...}{
# $2: cmd
@@ -2861,11 +2897,11 @@ sub marktags {
# Condition 3: But if we are in a deleted block ($cmdcomment=1) and
# $2 (the command) is in context2, just treat it as an ordinary command (i.e. comment it open with $opencmd)
# Because we do not want to disable this command
- # here we do not use $opencmd and $closecmd($opencmd is empty)
+ # here we do not use $opencmd and $closecmd($opencmd is empty)
print STDERR "DEBUG: Detected text |$word| but not safe command \$2: $2 \$3: $3\n." if $debug;
if ($cmd==1) {
push (@$retval,$closecmd) ;
- } elsif ($cmd==0) {
+ } elsif ($cmd==0) {
push (@$retval,$close) ;
}
$command=$1; $commandword=$2; $closingbracket=$4;
@@ -2881,16 +2917,16 @@ sub marktags {
# for latexrevise
push (@$retval,$command,"%\n{$AUXCMD\n",marktags("","",$open,$close,$opencmd,$closecmd,$comment,\@argtext),$closingbracket);
} elsif ( iscmd($commandword,,\@MATHTEXTCMDLIST, \@MATHTEXTCMDEXCL) ) {
- # MATHBLOCK pseudo command: consider all commands safe, except & and \\, \begin and \end and a few package sprcific one (look at UNSAFEMATHCMD definition)
- # Keep these commands even in deleted blocks, hence set $opencmd and $closecmd (5th and 6th argument of marktags) to
+ # MATHBLOCK pseudo command: consider all commands safe, except & and \\, \begin and \end and a few package sprcific one (look at UNSAFEMATHCMD definition)
+ # Keep these commands even in deleted blocks, hence set $opencmd and $closecmd (5th and 6th argument of marktags) to
# ""
- local @SAFECMDLIST=(".*");
+ local @SAFECMDLIST=(".*");
local @SAFECMDEXCL=('\\','\\\\',@UNSAFEMATHCMD);
push(@$retval,$command,marktags("","",$open,$close,"","",$comment,\@argtext)#@argtext
,$closingbracket);
} else {
# normal textcmd or context1cmd in an added block
- push (@$retval,$command,marktags("","",$open,$close,$opencmd,$closecmd,$comment,\@argtext),$closingbracket);
+ push (@$retval,$command,marktags("","",$open,$close,$opencmd,$closecmd,$comment,\@argtext),$closingbracket);
}
push (@$retval,$AUXCMD,"\n") if $cmdcomment ;
$cmd=-1 ;
@@ -2976,10 +3012,10 @@ sub take_comments_and_newline_from_frac() {
# names or labels but it does not matter because they are converted back in the postprocessing step
# Returns: leading white space removed in step 1
sub preprocess {
- for (@_) {
+ for (@_) {
- # change in \verb and similar commands - note that I introduce an extra space here so that the
+ # change in \verb and similar commands - note that I introduce an extra space here so that the
# already hashed variants do not trigger again
# transform \lstinline{...}
# s/\\lstinline(\[$brat0\])?(\{(?:.*?)\})/"\\DIFlstinline". $1 ."{". tohash(\%verbhash,"$2") ."}"/esg;
@@ -3009,7 +3045,7 @@ sub preprocess {
1 while s/(?<!\\)_(\s*{($pat_n)})/\\SUBSCRIPT$1/g ;
# Convert ^n into \SUPERSCRIPTNB{n} and ^{nnn} into \SUPERSCRIPT{nn}
1 while s/(?<!\\)\^(\s*([^{\\\s]|\\\w+))/\\SUPERSCRIPTNB{$1}/g ;
- 1 while s/(?<!\\)\^(\s*{($pat_n)})/\\SUPERSCRIPT$1/g ;
+ 1 while s/(?<!\\)\^(\s*{($pat_n)})/\\SUPERSCRIPT$1/g ;
# Convert \sqrt{n} into \SQRT{n} and \sqrt nn into SQRTNB{nn}
1 while s/(?<!\\)\\sqrt(\s*([^{\\\s]|\\\w+))/\\SQRTNB{$1}/g ;
1 while s/(?<!\\)\\sqrt(\s*{($pat_n)})/\\SQRT$1/g ;
@@ -3029,16 +3065,16 @@ sub preprocess {
if ( $mathmarkup != FINE ) {
# DIFANCHORARRB and DIFANCHORARRE, DIFANCHORMATHB and DIFANCHORMATHE markers are inserted here to encourage the matching algorithm
# to always match up the closing brace. Otherwise sometimes one ends up with a situation where
- # the closing brace is deleted and added at another point. The deleted closing brace is then
+ # the closing brace is deleted and added at another point. The deleted closing brace is then
# prevented by a %DIFDELCMD, leading to material leaking in or out of the math environment.
# The anchors are removed in post-processing again. (note that they are simple text to cause least amount of complications
- # Admittedly, this is something of a hack and will not always work. If it does not, then one needs to
+ # Admittedly, this is something of a hack and will not always work. If it does not, then one needs to
# resort to WHOLE or FINE, or NONE math mode processing.
s/\\begin\{($ARRENV)}(.*?)\\end\{\1}/\\ARRAYBLOCK$1\{$2\\DIFANCHORARRB \}\\DIFANCHORARRE /sg;
take_comments_and_newline_from_frac();
- # Convert Math environments with arguments
+ # Convert Math environments with arguments
s/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)\}((?:\[$brat_n\])|(?:\{$pat_n\}))+(.*?)\\end\{\1\}/\\MATHBLOCK$1\[$2\]\{$3\\DIFANCHORMATHB \}\\DIFANCHORMATHE /sg;
# Convert Math environments without arguments
s/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)\}(.*?)\\end\{\1\}/\\MATHBLOCK$1\{$2\\DIFANCHORMATHB \}\\DIFANCHORMATHE /sg;
@@ -3052,7 +3088,7 @@ sub preprocess {
# $expanded=linecomment($string)
#preface all lines with verbatim marker (usually DIFVRB)
-sub linecomment {
+sub linecomment {
my @verbatimlines=split("\n",$_[0]);
# the first line needs special treatment - we do want to retain optional arguments as is but wrap the remainder also with VERBCOMMENT
### print STDERR "DEBUG: before verbatimlines[0] = ",$verbatimlines[0],"\n";
@@ -3062,7 +3098,7 @@ sub linecomment {
}
# $simple=reverselinecomment($env $string)
-# remove DIFVRB comments but leave changed lines marked
+# remove DIFVRB comments but leave changed lines marked
sub reverselinecomment {
my ($environment, $verbatimtext)=@_;
### print STDERR "DEBUG REVERSELINECOMMENT input: $environment,|$verbatimtext|\n" if $debug;
@@ -3077,7 +3113,7 @@ sub reverselinecomment {
$verbatimtext =~ s/\\DIFdelend //g;
$verbatimtext =~ s/$DELCMDOPEN.*//g;
- # remove DIFVRB mark
+ # remove DIFVRB mark
$verbatimtext=~ s/%$VERBCOMMENT//g;
# remove part of the markup in changed lines
@@ -3168,7 +3204,7 @@ sub writedebugfile {
# * Remove STOP token from the end
# * Replace \RIGHTBRACE by }
# * If option --no-del is set delete all deleted blocks
-# 1. Check all deleted blocks:
+# 1. Check all deleted blocks:
# a.where a deleted block contains a matching \begin and
# \end environment (these will be disabled by a %DIFDELCMD statements), for selected environments enable
# these commands again (such that for example displayed math in a deleted equation
@@ -3189,14 +3225,14 @@ sub writedebugfile {
# For added blocks:
# c. If in-line math mode contains array environment, enclose the whole environment in \mbox'es
# d. place \cite commands in mbox'es (for UNDERLINE style)
-#
+#
# 2. If math-mode COARSE,WHOLE or NONE option set: Convert \MATHBLOCKmath{..} commands back to environments
#
# Convert all PICTUREblock{..} commands back to the appropriate environments
# 3. Convert DIFadd, DIFdel, DIFaddbegin , ... into FL varieties
# within floats (currently recognised float environments: plate,table,figure
# plus starred varieties).
-# 4. Remove empty %DIFDELCMD < lines
+# 4. Remove empty %DIFDELCMD < lines
# 4. Convert \begin{SQUAREBRACKET} \end{SQUAREBRACKET} into \[ \]
# Convert \begin{DOLLARDOLLAR} \end{DOLLARDOLLAR} into $$ $$
# 5. Convert \SUPERSCRIPTNB{n} into ^n and \SUPERSCRIPT{nn} into ^{nnn}
@@ -3209,7 +3245,7 @@ sub writedebugfile {
# 4, undo renaming of the \begin, \end,{,} in comments
# Change \QLEFTBRACE, \QRIGHTBRACE,\AMPERSAND to \{,\},\&
#
-# Note have to manually synchronize substitution commands below and
+# Note have to manually synchronize substitution commands below and
# DIF.. command names in the header
sub postprocess {
my ($begin,$len,$float,$delblock,$addblock); ### $cnt
@@ -3221,7 +3257,7 @@ sub postprocess {
my (@itemargs, $itemarg);
- for (@_) {
+ for (@_) {
# change $'s in comments to something harmless
1 while s/(%.*)\$/$1DOLLARDIF/mg ;
@@ -3231,7 +3267,7 @@ sub postprocess {
# the only way to get these is as %DIFDELCMD < \RIGHTBRACE construction
# This essentially marks closing right braces of MATHBLOCK environments, which did not get matched
# up. This case should be rare, so I just leave this in the diff file output. Not really elegant
- # but can still be dealt with later if it results in problems.
+ # but can still be dealt with later if it results in problems.
s/%DIFDELCMD < \\RIGHTBRACE/%DIFDELCMD < \\MBLOCKRIGHTBRACE/g ;
# Replace \RIGHTBRACE by }
s/\\RIGHTBRACE/}/g;
@@ -3259,7 +3295,7 @@ sub postprocess {
$len=length($&);
$begin=pos($_) - $len;
$delblock=$&;
- ### A much simpler method for math replacement might follow this strategy (can recycle part of the commands below for following
+ ### A much simpler method for math replacement might follow this strategy (can recycle part of the commands below for following
### this strategy:
### 1. a Insert aux commands \begin{MATHMODE} or \end{MATHMODE} for all deleted commands opening or closing displayed math mode
### b Insert aux commands \begin{MATHARRMODE} or \end{MATHARRMODE} for all deleted commands opening or closing math array mode
@@ -3285,14 +3321,14 @@ sub postprocess {
###0.5: $delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \s*\\end\{((?:$MATHENV)|SQUAREBRACKET)\}\s*?(?:$DELCMDCLOSE|\n))(.*?[^\n]?)\n?(?<!${AUXCMD}\n)(\%DIFDELCMD < \s*\\begin\{\2\})/\\end{MATHMODE}$AUXCMD\n$1$3\n\\begin{MATHMODE}$AUXCMD\n$4/sg;
$delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\end\{((?:$MATHENV)|SQUAREBRACKET)\}.*?(?:$DELCMDCLOSE|\n))(.*?[^\n]?)\n?(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\begin\{\2\})/\\end\{MATHMODE\}$AUXCMD\n$1$3\n\\begin\{MATHMODE\}$AUXCMD\n$4/sg;
- # now look for unpaired %DIFDELCMD < \begin{MATHENV}; if found add \begin{$MATHREPL} and insert \end{$MATHREPL}
+ # now look for unpaired %DIFDELCMD < \begin{MATHENV}; if found add \begin{$MATHREPL} and insert \end{$MATHREPL}
# just before end of block; again we use look-behind assertion to avoid matching constructions which have already been converted
if ($delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\begin\{((?:$MATHENV)|SQUAREBRACKET)\}\s*?(?:$DELCMDCLOSE|\n))/$1\\begin{$MATHREPL}$AUXCMD\n/sg ) {
### print STDERR "BINGO: begin block: \nBefore: |" . substr($_,$begin,$len) . "|\n" if $debug ;
$delblock =~ s/(\\DIFdelend$)/\\end{$MATHREPL}$AUXCMD\n$1/s ;
### print STDERR "After: |" . $delblock . "|\n\n" if $debug ;
}
- # now look for unpaired %DIFDELCMD < \end{MATHENV}; if found add \end{MATHMODE} and insert \begin{MATHMODE}
+ # now look for unpaired %DIFDELCMD < \end{MATHENV}; if found add \end{MATHMODE} and insert \begin{MATHMODE}
# just before end of block; again we use look-behind assertion to avoid matching constructions which have already been converted
if ($delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\end\{((?:$MATHENV)|SQUAREBRACKET)\}\s*?(?:$DELCMDCLOSE|\n))/$1\\end\{MATHMODE\}$AUXCMD\n/sg ) {
### print STDERR "BINGO: end block:\nBefore: |" . substr($_,$begin,$len) . "|\n" if $debug;
@@ -3315,15 +3351,15 @@ sub postprocess {
$delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\end\{($MATHARRENV)\}\s*?(?:$DELCMDCLOSE|\n))(.*?[^\n]?)\n?(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\begin\{\2\})/\\end{MATHMODE}$AUXCMD\n$1$3\n\\begin{MATHMODE}$AUXCMD\n$4/sg;
### print STDERR "STEP1: |" . $delblock . "|\n\n" if $debug ;
- # now look for unpaired %DIFDELCMD < \begin{MATHARRENV}; if found add \begin{$MATHARRREPL} and insert \end{$MATHARRREPL}
+ # now look for unpaired %DIFDELCMD < \begin{MATHARRENV}; if found add \begin{$MATHARRREPL} and insert \end{$MATHARRREPL}
# just before end of block; again we use look-behind assertion to avoid matching constructions which have already been converted
if ($delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\begin\{($MATHARRENV)\}(.*?)(?:$DELCMDCLOSE|\n))/$1\\begin{$2*}$3$AUXCMD\n/sg ) {
$arrenv=$2;
- $delblock =~ s/(\\DIFdelend$)/\\end{$arrenv*}}$AUXCMD\n$1/s ;
+ $delblock =~ s/(\\DIFdelend$)/\\end{$arrenv*}$AUXCMD\n$1/s ;
}
### print STDERR "STEP2: |" . $delblock . "|\n\n" if $debug ;
- # now look for unpaired %DIFDELCMD < \end{MATHENV}; if found add \end{MATHMODE} and insert \begin{MATHMODE}
+ # now look for unpaired %DIFDELCMD < \end{MATHENV}; if found add \end{MATHMODE} and insert \begin{MATHMODE}
# just before end of block; again we use look-behind assertion to avoid matching constructions which have already been converted
if ($delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\end\{($MATHARRENV)\}\s*?(?:$DELCMDCLOSE|\n))/$1\\end{MATHMODE}$AUXCMD\n/sg ) {
$delblock =~ s/(\\DIFdelend$)/\\begin{MATHMODE}$AUXCMD\n$1/s ;
@@ -3341,7 +3377,7 @@ sub postprocess {
### $eqarrayblock=~ s/(\%DIFDELCMD < \s*(\&|\\\\)\s*?(?:$DELCMDCLOSE|\n))/$1$2$AUXCMD\n/sg ;
$eqarrayblock =~ s/(\%DIFDELCMD < (.*?(?:\&|\\\\).*)(?:$DELCMDCLOSE|\n))/
# The pattern captures comments with at least one of & or \\
- @symbols= split(m@((?:&|\\\\)\s*)@,$2); # extract & and \\ and other material from sequence
+ @symbols= split(m@((?:&|\\\\)\s*)@,$2); # extract & and \\ and other material from sequence
@symbols= grep ( m@&|\\\\\s*@, @symbols); # select & and \\ (and subsequent spaces)
"$1@symbols$AUXCMD\n"
/eg ;
@@ -3354,7 +3390,7 @@ sub postprocess {
} elsif ( $mathmarkup == COARSE || $mathmarkup == WHOLE ) {
# Convert MATHBLOCKmath commands to their uncounted numbers (e.g. convert equation -> displaymath
# (environments defined in $MATHENV will be replaced by $MATHREPL, and environments in $MATHARRENV
- # will be replaced by their starred variety
+ # will be replaced by their starred variety
$delblock=~ s/\\MATHBLOCK($MATHENV)((?:\[$brat_n\])?)\{($pat_n)\}/\\MATHBLOCK$MATHREPL$2\{$3\}/sg;
$delblock=~ s/\\MATHBLOCK($MATHARRENV)((?:\[$brat_n\])?)\{($pat_n)\}/\\MATHBLOCK$1\*$2\{$3\}/sg;
}
@@ -3368,10 +3404,10 @@ sub postprocess {
print STDERR "DELBLOCK after maths processing: |" . $delblock . "|\n\n" if $debug ;
- # Reinstate completely deleted list environments. note that items within the
+ # Reinstate completely deleted list environments. note that items within the
# environment will still be commented out. They will be restored later
$delblock=~ s/(\%DIFDELCMD < \s*\\begin\{($LISTENV)\}\s*?(?:\n|$DELCMDCLOSE))(.*?)(\%DIFDELCMD < \s*\\end\{\2\})/{
- ### # block within the search; replacement environment
+ ### # block within the search; replacement environment
### "$1\\begin{$2}$AUXCMD\n". restore_item_commands($3). "\n\\end{$2}$AUXCMD\n$4";
"$1\\begin{$2}$AUXCMD\n$3\n\\end{$2}$AUXCMD\n$4";
}/esg;
@@ -3405,7 +3441,7 @@ sub postprocess {
### if ($CITE2CMD) {
###### ${extraspace}(?:\[$brat0\]${extraspace}){0,2}\{$pat_n\})) .*?%%%\n
### $delblock=~s/($DELCMDOPEN\s*\\($CITE2CMD)(.*)$DELCMDCLOSE)/
- ### # Replacement code
+ ### # Replacement code
### {my ($aux,$all);
### $aux=$all=$1;
### $aux=~s#\n?($DELCMDOPEN|$DELCMDCLOSE)##g;
@@ -3415,7 +3451,7 @@ sub postprocess {
### if ($CITECMD) {
###### $delblock=~s/(\\($CITECMD)${extraspace}(?:\[$brat0\]${extraspace}){0,2}\{$pat_n\})(\s*)/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/msg ;
### $delblock=~s/(\\($CITECMD)${extraspace}(?:<$abrat0>${extraspace})?(?:\[$brat0\]${extraspace}){0,2}\{$pat_n\})(\s*)/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/msg ;
- ### }
+ ### }
# if MBOXINLINEMATH is set, protect inlined math environments with an extra mbox
@@ -3423,7 +3459,7 @@ sub postprocess {
# note additional \newline after command is omitted from output if right at the end of deleted block (otherwise a spurious empty line is generated)
$delblock=~s/($math)(?:[\s\n]*)?/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/sg;
}
- ###if ( defined($packages{"listings"} and $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{color\}/)) {
+ ###if ( defined($packages{"listings"} and $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{color\}/)) {
### # change included verbatim environments
### $delblock =~ s/\\DIFverb\{/\\DIFDIFdelverb\{/g;
### $delblock =~ s/\\DIFlstinline/\\DIFDIFdellstinline/g;
@@ -3465,7 +3501,7 @@ sub postprocess {
##$addblock=~s/($math)/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/sg;
$addblock=~s/($math)(?:[\s\n]*)?/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/sg;
}
- ###if ( defined($packages{"listings"} and $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat0\])?\{color\}/)) {
+ ###if ( defined($packages{"listings"} and $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat0\])?\{color\}/)) {
# mark added verbatim commands
$addblock =~ s/\\DIFverb/\\DIFDIFaddverb/g;
$addblock =~ s/\\DIFlstinline/\\DIFDIFaddlstinline/g;
@@ -3483,11 +3519,11 @@ sub postprocess {
pos = $begin + length($addblock);
}
- # Go through whole text, and by counting list environment commands, find out when we are within a list environment.
+ # Go through whole text, and by counting list environment commands, find out when we are within a list environment.
# Within those restore deleted \item commands
- @textparts=split /(?<!$DELCMDOPEN)(\\(?:begin|end)\{$LISTENV\})/ ;
+ @textparts=split /(?<!$DELCMDOPEN)(\\(?:begin|end)\{$LISTENV\})/ ;
@liststack=();
- @newtextparts=map {
+ @newtextparts=map {
### print STDERR ":::::::: $_\n";
if ( ($listtype) = m/^\\begin\{($LISTENV)\}$/ ) {
print STDERR "DEBUG: postprocess \\begin{$listtype}\n" if $debug;
@@ -3503,7 +3539,7 @@ sub postprocess {
} else {
print STDERR "DEBUG: postprocess \@liststack=(",join(",",@liststack),")\n" if $debug;
if (scalar @liststack > 0 ) {
- # we are within a list environment and should replace all item commands
+ # we are within a list environment and should replace all item commands
$_=restore_item_commands($_);
}
# else: we are outside a list environment and do not need to do anything
@@ -3516,17 +3552,17 @@ sub postprocess {
# Replace MATHMODE environments from step 1a above by the correct Math environment and remove unncessary pairings
-
+
if ( $mathmarkup == FINE ) {
# look for AUXCMD math-mode pairs which have only comments (or empty lines between them), and remove the added commands
# \begin{..} ... \end{..} pairs
- s/\\begin\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET|MATHMODE)\}$AUXCMD\n((?:\s*%.[^\n]*\n)*)\\end\{\1\}$AUXCMD\n/$2/sg;
+ s/\\begin\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET|MATHMODE)\}$AUXCMD\n((?:\s*%.[^\n]*\n)*)\\end\{\1\}$AUXCMD\n/$2/sg;
# \end{..} .... \begin{..} pairs
- s/\\end\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET|MATHMODE)\}$AUXCMD\n((?:\s*%.[^\n]*\n)*)\\begin\{\1\}$AUXCMD\n/$2/sg;
+ s/\\end\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET|MATHMODE)\}$AUXCMD\n((?:\s*%.[^\n]*\n)*)\\begin\{\1\}$AUXCMD\n/$2/sg;
writedebugfile($_,'postprocess15');
# The next line is complicated. The negative look-ahead insertion makes sure that no \end{$MATHENV} (or other mathematical
- # environments) are between the \begin{$MATHENV} and \end{MATHMODE} commands. This is necessary as the minimal matching
+ # environments) are between the \begin{$MATHENV} and \end{MATHMODE} commands. This is necessary as the minimal matching
# is not globally minimal but only 'locally' (matching is beginning from the left side of the string)
# [NB: Do not be tempted to prettify the expression with /x modified. It seems this is applied after strings are expanded so will ignore spaces in strings
1 while s/(?<!$DELCMDOPEN)\\begin\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}((?:${DELCMDOPEN}[^\n]*|.(?!(?:\\end\{(?:(?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}|\\begin\{MATHMODE})))*?)\\end\{MATHMODE}/\\begin{$1}$2\\end{$1}/s;
@@ -3601,7 +3637,7 @@ sub postprocess {
# remove empty DIFCMD < lines
s/^\Q${DELCMDOPEN}\E\n//msg;
- # Expand hashes of verb and verbatim environments
+ # Expand hashes of verb and verbatim environments
s/${DELCMDOPEN}\\($VERBATIMENV)\{([-\d]*?)\}/"${DELCMDOPEN}\\begin{${1}}".fromhash(\%verbhash,$2,$DELCMDOPEN)."${DELCMDOPEN}\\end{${1}}"/esg;
# revert changes to verbatim environments for line diffs (and add code to mark up changes) (note negative look behind assertions to not leak out of DIFDELCMD comments)
# Example:
@@ -3627,8 +3663,8 @@ sub postprocess {
((?:\%\Q$DELCOMMENT$VERBCOMMENT\E[^\n]*?\n)*)
# Deleted \end command of verbatim environment. Note that the type is forced to match the opening. Captures: $5: Whole deleted environment (previous way this line was written: (\Q$DELCMDOPEN\E\\end\{\2\}(?:\n|\s|\Q$DELCMDOPEN\E)*\Q$DELCMDCLOSE\E)
(\Q$DELCMDOPEN\E\\end\{\2\})
- / # Substitution part
- $1 # Leave expression as is
+ / # Substitution part
+ $1 # Leave expression as is
. "$AUXCMD NEXT\n" # Mark the following line as an auxiliary command
. "" # reinstate the original environment without options
. reverselinecomment($2, "$3$4") # modify the body to change the markup; reverselinecomment parses for options
@@ -3637,7 +3673,7 @@ sub postprocess {
/esgx; # Modifiers of substitution command
writedebugfile($_,'postprocess2');
# where changes have occurred in verbatim environment, change verbatim to DIFverbatim to allow mark-up
- # (I use the presence of optional paramater to verbatim environment as the marker - normal verbatim
+ # (I use the presence of optional paramater to verbatim environment as the marker - normal verbatim
# environment does not take optional arguments)
s/(?<!$DELCMDOPEN)\\begin\{(verbatim[*]?)\}(\[$brat_n\].*?)\\end\{\1\}/\\begin{DIF$1}$2\\end{DIF$1}/sg;
@@ -3651,7 +3687,7 @@ sub postprocess {
# convert remaining PAR commands (which are preceded by non-white space characters, usually "}" ($ADDCLOSE)
s/\\PAR\n/\n\n/sg;
- # package specific processing:
+ # package specific processing:
if ( defined($packages{"endfloat"})) {
#endfloat: make sure \begin{figure} and \end{figure} are always
# on a line by themselves, similarly for table environment
@@ -3664,12 +3700,16 @@ sub postprocess {
s/^((?:[^%]+)\\(?:begin|end)\{(?:figure|table)\}(?:\[[a-zA-Z]+\])?)(.+)((?:%.*)?)$/$1\n$2$3/mg;
}
- # Convert '\PERCENTAGE ' back into '\%' (the final question mark catches a special situation where due to a latter pre-processing step the ' ' becomes separated
+ # Remove empty auxiliary LISTENV (sometmes these are generated if list environment occurs within the argument of a deleted comment)
+ # (slightly hacky but I could not see an easy way to see if in argument of another command when this extra markup is added)
+ s/\\begin\{($LISTENV)\}$AUXCMD\n((?:\s*\%[^\n]*\n)*\n?)\\end\{\1\}$AUXCMD\n/$2\n/msg ;
+
+ # Convert '\PERCENTAGE ' back into '\%' (the final question mark catches a special situation where due to a latter pre-processing step the ' ' becomes separated
s/\\PERCENTAGE ?/\\%/g;
- # Convert '\DOLLAR ' back into '\$'
+ # Convert '\DOLLAR ' back into '\$'
s/\\DOLLAR /\\\$/g;
- # undo renaming of the \begin and \end,{,} and dollars in comments
+ # undo renaming of the \begin and \end,{,} and dollars in comments
# although we only renamed $ in comments to DOLLARDIFF, we might have lost the % in unchanged verbatim blocks, so rename all
s/DOLLARDIF/\$/g;
@@ -3687,7 +3727,7 @@ sub postprocess {
# Convert \SQRT{n} into \sqrt{n} and \SQRTNB{nn} into \sqrt nn
1 while s/\\SQRT(\s*\{($pat_n)\})/\\sqrt$1/g ;
1 while s/\\SQRTNB\{(\s*$pat0)\}/\\sqrt$1/g ;
-
+
1 while s/(%.*)\\CFRAC (.*)$/$1\\frac$2/mg ;
1 while s/(%.*)\\CRIGHTBRACE (.*)$/$1\}$2/mg ;
1 while s/(%.*)\\CLEFTBRACE (.*)$/$1\{$2/mg ;
@@ -3698,7 +3738,7 @@ sub postprocess {
s/\\QRIGHTBRACE /\\\}/sg;
s/\\AMPERSAND /\\&/sg;
# Highlight added inline verbatim commands if possible
- if ( $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{color\}/ ) {
+ if ( $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{color\}/ ) {
# wrap added verb commands with color commands
s/\\DIFDIFadd((?:verb\*?|lstinline(?:\[$brat_n\])?)\{[-\d]*?\}[\s\n]*)/\{\\color{blue}$AUXCMD\n\\DIF$1%\n\}$AUXCMD\n/sg;
s/\\DIFDIFdel((?:verb\*?|lstinline(?:\[$brat_n\])?)\{[-\d]*?\}[\s\n]*$AUXCMD)/\{\\color{red}${AUXCMD}\n\\DIF$1\n\}${AUXCMD}/sg;
@@ -3713,8 +3753,8 @@ sub postprocess {
# finally add the comment to the ones not having an optional argument before
###s/\\DIFaddlstinline(?!\[)/\\lstinline\n[basicstyle=\\color{blue}]$AUXCMD\n/g;
- return;
}
+ return;
}
# $out = restore_item_commands($listenviron)
@@ -3738,13 +3778,13 @@ sub restore_item_commands {
# @auxlines=preprocess_preamble($oldpreamble,$newpreamble);
- # pre-process preamble by looking for commands used in \maketitle (title, author, date etc commands)
- # the list of commands is defined in CONTEXT2CMD
- # if found then use a bodydiff to mark up content, and replace the corresponding commands
+ # pre-process preamble by looking for commands used in \maketitle (title, author, date etc commands)
+ # the list of commands is defined in CONTEXT2CMD
+ # if found then use a bodydiff to mark up content, and replace the corresponding commands
# in both preambles by marked up version to 'fool' the linediff (such that only body is marked up).
# A special case are e.g. author commands being added (or removed)
# 1. If commands are added, then the entire content is marked up as new, but also the lines are marked as new in the linediff
- # 2. If commands are removed, then the linediff will mark the line as deleted. The program returns
+ # 2. If commands are removed, then the linediff will mark the line as deleted. The program returns
# with $auxlines a text to be appended at the end of the preamble, which shows the respective fields as deleted
sub preprocess_preamble {
my ($oldpreambleref,$newpreambleref)=(\$_[0],\$_[1]) ;
@@ -3766,7 +3806,7 @@ EOF
$titlecmd = "(?:".join("|",@CONTEXT2CMDLIST).")";
# as context2cmdlist is stored as regex, e.g. ((?-xism:^title$), we need to remove ^- fo
# resue in a more complex regex
- $titlecmd =~ s/[\$\^]//g;
+ $titlecmd =~ s/[\$\^]//g;
# make sure to not match on comment lines:
$titlecmdpat=qr/^(?:[^%\n]|\\%)*(\\($titlecmd)$extraspace(?:\[($brat_n)\])?(?:\{($pat_n)\}))/ms;
###print STDERR "DEBUG:",$titlecmdpat,"\n";
@@ -3792,7 +3832,7 @@ EOF
$cmd=shift @newtitlecommands;
$optarg=shift @newtitlecommands;
$arg=shift @newtitlecommands;
-
+
if ( defined($newhash{$cmd})) {
warn "$cmd is used twice in preamble of new file. Reverting to pure line diff mode for preamble.\n";
print STDERR $warnmsgdetail;
@@ -3819,7 +3859,7 @@ EOF
}
$argnew=$newhash{$cmd}->[2];
$argdiff="{" . join("",bodydiff($argold,$argnew)) ."}";
- # Replace \RIGHTBRACE by }
+ # Replace \RIGHTBRACE by }
$argdiff =~ s/\\RIGHTBRACE/}/g;
if ( length $optargnew ) {
@@ -3834,7 +3874,7 @@ EOF
$optargdiff="";
}
### print STDERR "DEBUG s/\\Q$newhash{$cmd}->[0]\\E/\\$cmd$optargdiff$argdiff/s\n";
- # Note: \Q and \E force literal interpretation of what it between them but allow
+ # Note: \Q and \E force literal interpretation of what it between them but allow
# variable interpolation, such that e.g. \title matches just that and not TAB-itle
$$newpreambleref=~s/\Q$newhash{$cmd}->[0]\E/\\$cmd$optargdiff$argdiff/s;
# replace this in old preamble if necessary
@@ -3874,7 +3914,7 @@ EOF
#%< old deleted line(s)
#%DIF -------
#%DIF mmann-nn
-#new appended line %<
+#new appended line %<
#%DIF -------
# Future extension: mark change explicitly
# Assumes: traverse_sequence traverses deletions before insertions in changed sequences
@@ -3886,9 +3926,9 @@ sub linediff {
my $block = [];
my $retseq = [];
my @begin=('','',''); # dummy initialisation
- my $instring ;
+ my $instring ;
- my $discard = sub { @begin=('d',$_[0],$_[1]) unless scalar @$block ;
+ my $discard = sub { @begin=('d',$_[0],$_[1]) unless scalar @$block ;
push(@$block, "%DIF < " . $seq1->[$_[0]]) };
my $add = sub { if (! scalar @$block) {
@begin=('a',$_[0],$_[1]) ;}
@@ -3903,12 +3943,12 @@ sub linediff {
$instring = sprintf "%%DIF %da%d-%d",$begin[1],$begin[2],$_[1]-1; }
elsif ( $begin[0] eq 'c' ) {
$instring = sprintf "%%DIF %sc%s",
- ($begin[1]==$_[0]-1) ? "$begin[1]" : $begin[1]."-".($_[0]-1) ,
+ ($begin[1]==$_[0]-1) ? "$begin[1]" : $begin[1]."-".($_[0]-1) ,
($begin[2]==$_[1]-1) ? "$begin[2]" : $begin[2]."-".($_[1]-1) ; }
else {
$instring = sprintf "%%DIF %d%s%d",$begin[1],$begin[0],$begin[2]; }
- push @$retseq, $instring,@$block, "%DIF -------" ;
- $block = [];
+ push @$retseq, $instring,@$block, "%DIF -------" ;
+ $block = [];
}
push @$retseq, $seq2->[$_[1]]
};
@@ -3916,7 +3956,7 @@ sub linediff {
my $keyfunc = sub { join(" ",split(" ",shift())) };
traverse_sequences($seq1,$seq2, { MATCH=>$match, DISCARD_A=>$discard, DISCARD_B=>$add }, $keyfunc );
- push @$retseq, @$block if scalar @$block;
+ push @$retseq, @$block if scalar @$block;
return wantarray ? @$retseq : $retseq ;
}
@@ -3926,23 +3966,23 @@ sub linediff {
# init_regex_arr_data(\@array,"TOKEN INIT")
# scans DATA file handel for line "%% TOKEN INIT" line
# then appends each line not beginning with % into array (as a quoted regex)
-# This is used for command lists and configuration variables, but the processing is slightly
-# different:
+# This is used for command lists and configuration variables, but the processing is slightly
+# different:
# For lists, the regular expression is extended to include beginning (^) and end ($) markers, to require full-string matching
# For configuration variables (and all others), simply an unadorned list is copied
sub init_regex_arr_data {
my ($arr,$token)=@_;
my $copy=0;
my ($mode);
- if ($token =~ m/COMMANDS/ ) {
- $mode=0; # Reading command list
+ if ($token =~ m/COMMANDS/ ) {
+ $mode=0; # Reading command list
} else {
$mode=1; # Reading configuration variables
}
while (<DATA>) {
if ( m/^%%BEGIN $token\s*$/ ) {
- $copy=1;
+ $copy=1;
next;
} elsif ( m/^%%END $token\s*$/ ) {
last; }
@@ -4023,17 +4063,18 @@ sub exetime {
sub usage {
- print STDERR <<"EOF";
+ print STDERR <<"EOF";
Usage: $0 [options] old.tex new.tex > diff.tex
-Compares two latex files and writes tex code to stdout, which has the same format as new.tex but
+Compares two latex files and writes tex code to stdout, which has the same format as new.tex but
has all changes relative to old.tex marked up or commented. Note that old.tex and new.tex need to
-be real files (not pipes or similar) as they are opened twice.
+be real files (not pipes or similar) as they are opened twice.
--type=markupstyle
-t markupstyle Add code to preamble for selected markup style
- Available styles: UNDERLINE CTRADITIONAL TRADITIONAL CFONT FONTSTRIKE INVISIBLE
+ Available styles: UNDERLINE CTRADITIONAL TRADITIONAL CFONT FONTSTRIKE INVISIBLE
CHANGEBAR CCHANGEBAR CULINECHBAR CFONTCHBAR BOLD PDFCOMMENT
+ LUAUNDERLINE
[ Default: UNDERLINE ]
--subtype=markstyle
@@ -4044,7 +4085,7 @@ be real files (not pipes or similar) as they are opened twice.
* LABEL subtype is deprecated
--floattype=markstyle
--f markstyle Add code to preamble for selected style which
+-f markstyle Add code to preamble for selected style which
replace standard marking and markup commands within floats
(e.g., marginal remarks cause an error within floats
so marginal marking can be disabled thus)
@@ -4053,11 +4094,11 @@ be real files (not pipes or similar) as they are opened twice.
--encoding=enc
-e enc Specify encoding of old.tex and new.tex. Typical encodings are
- ascii, utf8, latin1, latin9. A list of available encodings can be
- obtained by executing
+ ascii, utf8, latin1, latin9. A list of available encodings can be
+ obtained by executing
perl -MEncode -e 'print join ("\\n",Encode->encodings( ":all" )) ;'
[Default encoding is utf8 unless the first few lines of the preamble contain
- an invocation "\\usepackage[..]{inputenc} in which case the
+ an invocation "\\usepackage[..]{inputenc} in which case the
encoding chosen by this command is asssumed. Note that ASCII (standard
latex) is a subset of utf8]
@@ -4074,22 +4115,22 @@ be real files (not pipes or similar) as they are opened twice.
--exclude-safecmd=exclude-file
--exclude-safecmd="cmd1,cmd2,..."
--A exclude-file
+-A exclude-file
--replace-safecmd=replace-file
--append-safecmd=append-file
--append-safecmd="cmd1,cmd2,..."
-a append-file Exclude from, replace or append to the list of regex
- matching commands which are safe to use within the
+ matching commands which are safe to use within the
scope of a \\DIFadd or \\DIFdel command. The file must contain
one Perl-RegEx per line (Comment lines beginning with # or % are
ignored). A literal comma within the comma-separated list must be
- escaped thus "\\,", Note that the RegEx needs to match the whole of
+ escaped thus "\\,", Note that the RegEx needs to match the whole of
the token, i.e., /^regex\$/ is implied and that the initial
"\\" of the command is not included. The --exclude-safecmd
- and --append-safecmd options can be combined with the --replace-safecmd
+ and --append-safecmd options can be combined with the --replace-safecmd
option and can be used repeatedly to add cumulatively to the lists.
---exclude-textcmd=exclude-file
+--exclude-textcmd=exclude-file
--exclude-textcmd="cmd1,cmd2,..."
-X exclude-file
--replace-textcmd=replace-file
@@ -4105,7 +4146,7 @@ be real files (not pipes or similar) as they are opened twice.
Replace or append to the list of regex matching commands
whose last argument is text but which require a particular
context to work, e.g. \\caption will only work within a figure
- or table. These commands behave like text commands, except when
+ or table. These commands behave like text commands, except when
they occur in a deleted section, when they are disabled, but their
argument is shown as deleted text.
@@ -4115,7 +4156,7 @@ be real files (not pipes or similar) as they are opened twice.
As corresponding commands for context1. The only difference is that
context2 commands are completely disabled in deleted sections, including
their arguments.
- context2 commands are also the only commands in the preamble, whose argument will
+ context2 commands are also the only commands in the preamble, whose argument will
be processed in word-by-word mode (which only works, if they occur no more than
once in the preamble).
@@ -4124,15 +4165,15 @@ be real files (not pipes or similar) as they are opened twice.
--append-mboxsafecmd=append-file
--append-mboxsafecmd="cmd1,cmd2,..."
Define safe commands, which additionally need to be protected by encapsulating
- in an \\mbox{..}. This is sometimes needed to get around incompatibilities
+ in an \\mbox{..}. This is sometimes needed to get around incompatibilities
between external packages and the ulem package, which is used for highlighting
in the default style UNDERLINE as well as CULINECHBAR CFONTSTRIKE
-
+
--config var1=val1,var2=val2,...
-c var1=val1,.. Set configuration variables.
--c configfile Available variables:
+-c configfile Available variables:
ARRENV (RegEx)
COUNTERCMD (RegEx)
FLOATENV (RegEx)
@@ -4151,15 +4192,15 @@ be real files (not pipes or similar) as they are opened twice.
--add-to-config varenv1=pattern1,varenv2=pattern2
For configuration variables containing a regular expression (essentially those ending
- in ENV, and COUNTERCMD) this provides an alternative way to modify the configuration
+ in ENV, and COUNTERCMD) this provides an alternative way to modify the configuration
variables. Instead of setting the complete pattern, with this option it is possible to add an
alternative pattern. varenv must be one of the variables listed above that take a regular
- expression as argument, and pattern is any regular expression (which might need to be
+ expression as argument, and pattern is any regular expression (which might need to be
protected from the shell by quotation). Several patterns can be added at once by using semi-colons
to separate them, e.g. --add-to-config "LISTENV=myitemize;myenumerate,COUNTERCMD=endnote"
--packages=pkg1,pkg2,..
- Tell latexdiff that .tex file is processed with the packages in list
+ Tell latexdiff that .tex file is processed with the packages in list
loaded. This is normally not necessary if the .tex file includes the
preamble, as the preamble is automatically scanned for \\usepackage commands.
Use of the --packages option disables automatic scanning, so if for any
@@ -4180,57 +4221,57 @@ be real files (not pipes or similar) as they are opened twice.
--show-all Show all of the above
- NB For all --show commands, no old.tex or new.tex file needs to be given, and no
+ NB For all --show commands, no old.tex or new.tex file needs to be given, and no
differencing takes place.
Other configuration options:
--allow-spaces Allow spaces between bracketed or braced arguments to commands
- [Default requires arguments to directly follow each other without
+ [Default requires arguments to directly follow each other without
intervening spaces]
--math-markup=level Determine granularity of markup in displayed math environments:
Possible values for level are (both numerical and text labels are acceptable):
- off or 0: suppress markup for math environments. Deleted equations will not
- appear in diff file. This mode can be used if all the other modes
+ off or 0: suppress markup for math environments. Deleted equations will not
+ appear in diff file. This mode can be used if all the other modes
cause invalid latex code.
whole or 1: Differencing on the level of whole equations. Even trivial changes
- to equations cause the whole equation to be marked changed. This
- mode can be used if processing in coarse or fine mode results in
+ to equations cause the whole equation to be marked changed. This
+ mode can be used if processing in coarse or fine mode results in
invalid latex code.
coarse or 2: Detect changes within equations marked up with a coarse
- granularity; changes in equation type (e.g.displaymath to equation)
+ granularity; changes in equation type (e.g.displaymath to equation)
appear as a change to the complete equation. This mode is recommended
for situations where the content and order of some equations are still
being changed. [Default]
fine or 3: Detect small change in equations and mark up and fine granularity.
This mode is most suitable, if only minor changes to equations are
- expected, e.g. correction of typos.
+ expected, e.g. correction of typos.
--graphics-markup=level Change highlight style for graphics embedded with \\includegraphics commands
Possible values for level:
none,off or 0: no highlighting for figures
new-only or 1: surround newly added or changed figures with a blue frame [Default]
- both or 2: highlight new figures with a blue frame and show deleted figures
+ both or 2: highlight new figures with a blue frame and show deleted figures
at reduced scale, and crossed out with a red diagonal cross. Use configuration
variable SCALEDELGRAPHICS to set size of deleted figures.
- Note that changes to the optional parameters will make the figure appear as changed
+ Note that changes to the optional parameters will make the figure appear as changed
to latexdiff, and this figure will thus be highlighted.
In some circumstances "Misplaced \\noalign" errors can occur if there are certain types
- of changes in tables. In this case please use option --graphics-markup=none as a
- work-around.
+ of changes in tables. In this case please use option --graphics-markup=none as a
+ work-around.
---no-del Suppress deleted text from the diff. It is similar in effect to the BOLD style,
+--no-del Suppress deleted text from the diff. It is similar in effect to the BOLD style,
but the deleted text ist not just invisible in the output, it is also not included in the
- diff text file. This can be more robust than just making it invisible.
+ diff text file. This can be more robust than just making it invisible.
---disable-citation-markup
---disable-auto-mbox Suppress citation markup and markup of other vulnerable commands in styles
+--disable-citation-markup
+--disable-auto-mbox Suppress citation markup and markup of other vulnerable commands in styles
using ulem (UNDERLINE,FONTSTRIKE, CULINECHBAR)
(the two options are identical and are simply aliases)
--enable-citation-markup
---enforce-auto-mbox Protect citation commands and other vulnerable commands in changed sections
+--enforce-auto-mbox Protect citation commands and other vulnerable commands in changed sections
with \\mbox command, i.e. use default behaviour for ulem package for other packages
(the two options are identical and are simply aliases)
@@ -4246,14 +4287,14 @@ Miscellaneous options
--no-label Suppress inclusion of old and new file names as comment in output file
---visible-label Include old and new filenames (or labels set with --label option) as
+--visible-label Include old and new filenames (or labels set with --label option) as
visible output
--flatten Replace \\input and \\include commands within body by the content
of the files in their argument. If \\includeonly is present in the
- preamble, only those files are expanded into the document. However,
- no recursion is done, i.e. \\input and \\include commands within
- included sections are not expanded. The included files are assumed to
+ preamble, only those files are expanded into the document. However,
+ no recursion is done, i.e. \\input and \\include commands within
+ included sections are not expanded. The included files are assumed to
be located in the same directories as the old and new master files,
respectively, making it possible to organise files into old and new directories.
--flatten is applied recursively, so inputted files can contain further
@@ -4276,7 +4317,7 @@ Miscellaneous options
-h Show this help text.
--ignore-warnings Suppress warnings about inconsistencies in length between input
- and parsed strings and missing characters.
+ and parsed strings and missing characters.
--verbose
-V Output various status information to stderr during processing.
@@ -4288,10 +4329,10 @@ Internal options:
These options are mostly for automated use by latexdiff-vc. They can be used directly, but
the API should be considered less stable than for the other options.
---no-links Suppress generation of hyperreferences, used for minimal diffs
+--no-links Suppress generation of hyperreferences, used for minimal diffs
(option --only-changes of latexdiff-vc).
EOF
- exit 0;
+ exit 0;
}
=head1 NAME
@@ -4317,8 +4358,8 @@ be real files (not pipes or similar) as they are opened twice (unless C<--encodi
The program treats the preamble differently from the main document.
Differences between the preambles are found using line-based
differencing (similarly to the Unix diff command, but ignoring white
-spaces). A comment, "S<C<%DIF E<gt>>>" is appended to each added line, i.e. a
-line present in C<new.tex> but not in C<old.tex>. Discarded lines
+spaces). A comment, "S<C<%DIF E<gt>>>" is appended to each added line, i.e. a
+line present in C<new.tex> but not in C<old.tex>. Discarded lines
are deactivated by prepending "S<C<%DIF E<lt>>>". Changed blocks are preceded by
comment lines giving information about line numbers in the original files. Where there are insignificant
differences, the resulting file C<diff.tex> will be similar to
@@ -4371,7 +4412,7 @@ curly braces immediately following a command (i.e. a sequence of
letters beginning with a backslash) are arguments for that command.
As a restriction to condition 1 above it is thus necessary to surround
all arguments with curly braces, and to not insert
-extraneous spaces. For example, write
+extraneous spaces. For example, write
\section{\textem{This is an emphasized section title}}
@@ -4403,7 +4444,7 @@ but the choice is yours. Any markup within the environment will be
removed, and generally everything within the environment will just be
taken from the new file.
-It is also possible to difference files which do not have a preamble.
+It is also possible to difference files which do not have a preamble.
In this case, the file is processed in the main document
mode, but the definitions of the markup commands are not inserted.
@@ -4421,7 +4462,7 @@ the scope of C<\DIFadd>. Added comments are marked by prepending
Within deleted blocks text is highlighted with C<\DIFdel>. Deleted
comments are marked by prepending "S<C<%DIF E<lt> >>". Non-safe command
-and curly braces within deleted blocks are commented out with
+and curly braces within deleted blocks are commented out with
"S<C<%DIFDELCMD E<lt> >>".
@@ -4431,7 +4472,7 @@ and curly braces within deleted blocks are commented out with
=head2 Preamble
The following options determine the visual markup style by adding the appropriate
-command definitions to the preamble. See the end of this section for a description of
+command definitions to the preamble. See the end of this section for a description of
available styles.
=over 4
@@ -4441,15 +4482,16 @@ B<-t markupstyle>
Add code to preamble for selected markup style. This option defines
C<\DIFadd> and C<\DIFdel> commands.
-Available styles:
+Available styles:
-C<UNDERLINE CTRADITIONAL TRADITIONAL CFONT FONTSTRIKE INVISIBLE
-CHANGEBAR CCHANGEBAR CULINECHBAR CFONTCHBAR BOLD PDFCOMMENT>
+C<UNDERLINE CTRADITIONAL TRADITIONAL CFONT FONTSTRIKE INVISIBLE
+CHANGEBAR CCHANGEBAR CULINECHBAR CFONTCHBAR BOLD PDFCOMMENT
+LUAUNDERLINE>
[ Default: C<UNDERLINE> ]
=item B<--subtype=markstyle> or
-B<-s markstyle>
+B<-s markstyle>
Add code to preamble for selected style for bracketing
commands (e.g. to mark changes in margin). This option defines
@@ -4462,27 +4504,27 @@ Available styles: C<SAFE MARGIN COLOR DVIPSCOL ZLABEL ONLYCHANGEDPAGE (LABEL)*>
=item B<--floattype=markstyle> or
B<-f markstyle>
-Add code to preamble for selected style which
+Add code to preamble for selected style which
replace standard marking and markup commands within floats
(e.g., marginal remarks cause an error within floats
-so marginal marking can be disabled thus). This option defines all
+so marginal marking can be disabled thus). This option defines all
C<\DIF...FL> commands.
Available styles: C<FLOATSAFE TRADITIONALSAFE IDENTICAL>
[ Default: C<FLOATSAFE> ]
-=item B<--encoding=enc> or
+=item B<--encoding=enc> or
B<-e enc>
Specify encoding of old.tex and new.tex. Typical encodings are
-C<ascii>, C<utf8>, C<latin1>, C<latin9>. A list of available encodings can be
-obtained by executing
+C<ascii>, C<utf8>, C<latin1>, C<latin9>. A list of available encodings can be
+obtained by executing
C<perl -MEncode -e 'print join ("\n",Encode->encodings( ":all" )) ;' >
If this option is used, then old.tex, new.tex are only opened once.
[Default encoding is utf8 unless the first few lines of the preamble contain
-an invocation C<\usepackage[..]{inputenc}> in which case the
+an invocation C<\usepackage[..]{inputenc}> in which case the
encoding chosen by this command is asssumed. Note that ASCII (standard
latex) is a subset of utf8]
@@ -4499,7 +4541,7 @@ C<\DIFaddbeginFL, \DIFaddendFL, \DIFaddFL{..},
(If this option is set B<-t>, B<-s>, and B<-f> options
are ignored.)
-=item B<--packages=pkg1,pkg2,..>
+=item B<--packages=pkg1,pkg2,..>
Tell latexdiff that .tex file is processed with the packages in list
loaded. This is normally not necessary if the .tex file includes the
@@ -4510,13 +4552,13 @@ The following packages trigger special behaviour:
=over 8
-=item C<endfloat>
+=item C<endfloat>
Ensure that C<\begin{figure}> and C<\end{figure}> always appear by themselves on a line.
=item C<hyperref>
-Change name of C<\DIFadd> and C<\DIFdel> commands to C<\DIFaddtex> and C<\DIFdeltex> and
+Change name of C<\DIFadd> and C<\DIFdel> commands to C<\DIFaddtex> and C<\DIFdeltex> and
define new C<\DIFadd> and C<\DIFdel> commands, which provide a wrapper for these commands,
using them for the text but not for the link defining command (where any markup would cause
errors).
@@ -4568,17 +4610,17 @@ B<-A exclude-file> or B<--exclude-safecmd="cmd1,cmd2,...">
=item B<--replace-safecmd=replace-file>
-=item B<--append-safecmd=append-file> or
+=item B<--append-safecmd=append-file> or
B<-a append-file> or B<--append-safecmd="cmd1,cmd2,...">
Exclude from, replace or append to the list of regular expressions (RegEx)
-matching commands which are safe to use within the
+matching commands which are safe to use within the
scope of a C<\DIFadd> or C<\DIFdel> command. The file must contain
one Perl-RegEx per line (Comment lines beginning with # or % are
-ignored). Note that the RegEx needs to match the whole of
+ignored). Note that the RegEx needs to match the whole of
the token, i.e., /^regex$/ is implied and that the initial
-"\" of the command is not included.
-The B<--exclude-safecmd> and B<--append-safecmd> options can be combined with the -B<--replace-safecmd>
+"\" of the command is not included.
+The B<--exclude-safecmd> and B<--append-safecmd> options can be combined with the -B<--replace-safecmd>
option and can be used repeatedly to add cumulatively to the lists.
B<--exclude-safecmd>
and B<--append-safecmd> can also take a comma separated list as input. If a
@@ -4591,7 +4633,7 @@ B<-X exclude-file> or B<--exclude-textcmd="cmd1,cmd2,...">
=item B<--replace-textcmd=replace-file>
-=item B<--append-textcmd=append-file> or
+=item B<--append-textcmd=append-file> or
B<-x append-file> or B<--append-textcmd="cmd1,cmd2,...">
Exclude from, replace or append to the list of regular expressions
@@ -4599,7 +4641,7 @@ matching commands whose last argument is text. See
entry for B<--exclude-safecmd> directly above for further details.
-=item B<--replace-context1cmd=replace-file>
+=item B<--replace-context1cmd=replace-file>
=item B<--append-context1cmd=append-file> or
@@ -4608,11 +4650,11 @@ entry for B<--exclude-safecmd> directly above for further details.
Replace or append to the list of regex matching commands
whose last argument is text but which require a particular
context to work, e.g. C<\caption> will only work within a figure
-or table. These commands behave like text commands, except when
+or table. These commands behave like text commands, except when
they occur in a deleted section, when they are disabled, but their
argument is shown as deleted text.
-=item B<--replace-context2cmd=replace-file>
+=item B<--replace-context2cmd=replace-file>
=item B<--append-context2cmd=append-file> or
@@ -4622,9 +4664,9 @@ As corresponding commands for context1. The only difference is that
context2 commands are completely disabled in deleted sections, including
their arguments.
-context2 commands are also the only commands in the preamble, whose argument will be processed in
+context2 commands are also the only commands in the preamble, whose argument will be processed in
word-by-word mode (which only works, if they occur no more than once in the preamble). The algorithm currently cannot cope with repeated context2 commands in the preamble, as they occur e.g. for the C<\author> argument in some journal styles (not in the standard styles, though
-If such a repetition is detected, the whole preamble will be processed in line-by-line mode. In such a case, use C<--replace-context2cmd> option to just select the commands, which should be processed and are not used repeatedly in the preamble.
+If such a repetition is detected, the whole preamble will be processed in line-by-line mode. In such a case, use C<--replace-context2cmd> option to just select the commands, which should be processed and are not used repeatedly in the preamble.
@@ -4633,7 +4675,7 @@ If such a repetition is detected, the whole preamble will be processed in line-b
=item B<--append-mboxsafecmd=append-file> or B<--append-mboxsafecmd="cmd1,cmd2,...">
Define safe commands, which additionally need to be protected by encapsulating
-in an C<\mbox{..}>. This is sometimes needed to get around incompatibilities
+in an C<\mbox{..}>. This is sometimes needed to get around incompatibilities
between external packages and the ulem package, which is used for highlighting
in the default style UNDERLINE as well as CULINECHBAR CFONTSTRIKE
@@ -4647,7 +4689,7 @@ in the default style UNDERLINE as well as CULINECHBAR CFONTSTRIKE
Set configuration variables. The option can be repeated to set different
variables (as an alternative to the comma-separated list).
-Available variables (see below for further explanations):
+Available variables (see below for further explanations):
C<ARRENV> (RegEx)
@@ -4677,10 +4719,10 @@ C<SCALEDELGRAPHICS> (Float)
=item B<--add-to-config varenv1=pattern1,varenv2=pattern2,...>
For configuration variables, which are a regular expression (essentially those ending
-in ENV, COUNTERCMD and CUSTOMDIFCMD, see list above) this option provides an alternative way to modify the configuration
+in ENV, COUNTERCMD and CUSTOMDIFCMD, see list above) this option provides an alternative way to modify the configuration
variables. Instead of setting the complete pattern, with this option it is possible to add an
alternative pattern. C<varenv> must be one of the variables listed above that take a regular
-expression as argument, and pattern is any regular expression (which might need to be
+expression as argument, and pattern is any regular expression (which might need to be
protected from the shell by quotation). Several patterns can be added at once by using semi-colons
to separate them, e.g. C<--add-to-config "LISTENV=myitemize;myenumerate,COUNTERCMD=endnote">
@@ -4700,7 +4742,7 @@ Show values of configuration variables.
Combine all --show commands.
-NB For all --show commands, no C<old.tex> or C<new.tex> file needs to be specified, and no
+NB For all --show commands, no C<old.tex> or C<new.tex> file needs to be specified, and no
differencing takes place.
=back
@@ -4717,29 +4759,29 @@ might get lumpeded with preceding commands) so should only be used if the
default produces erroneous results. (Default requires arguments to
directly follow each other without intervening spaces).
-=item B<--math-markup=level>
+=item B<--math-markup=level>
-Determine granularity of markup in displayed math environments:
+Determine granularity of markup in displayed math environments:
Possible values for level are (both numerical and text labels are acceptable):
-C<off> or C<0>: suppress markup for math environments. Deleted equations will not
-appear in diff file. This mode can be used if all the other modes
+C<off> or C<0>: suppress markup for math environments. Deleted equations will not
+appear in diff file. This mode can be used if all the other modes
cause invalid latex code.
C<whole> or C<1>: Differencing on the level of whole equations. Even trivial changes
-to equations cause the whole equation to be marked changed. This
-mode can be used if processing in coarse or fine mode results in
+to equations cause the whole equation to be marked changed. This
+mode can be used if processing in coarse or fine mode results in
invalid latex code.
C<coarse> or C<2>: Detect changes within equations marked up with a coarse
-granularity; changes in equation type (e.g.displaymath to equation)
+granularity; changes in equation type (e.g.displaymath to equation)
appear as a change to the complete equation. This mode is recommended
for situations where the content and order of some equations are still
being changed. [Default]
C<fine> or C<3>: Detect small change in equations and mark up at fine granularity.
This mode is most suitable, if only minor changes to equations are
-expected, e.g. correction of typos.
+expected, e.g. correction of typos.
=item B<--graphics-markup=level>
@@ -4751,33 +4793,33 @@ C<none>, C<off> or C<0>: no highlighting for figures
C<new-only> or C<1>: surround newly added or changed figures with a blue frame [Default if graphicx package loaded]
-C<both> or C<2>: highlight new figures with a blue frame and show deleted figures at reduced
+C<both> or C<2>: highlight new figures with a blue frame and show deleted figures at reduced
scale, and crossed out with a red diagonal cross. Use configuration
variable SCALEDELGRAPHICS to set size of deleted figures.
-Note that changes to the optional parameters will make the figure appear as changed
+Note that changes to the optional parameters will make the figure appear as changed
to latexdiff, and this figure will thus be highlighted.
In some circumstances "Misplaced \noalign" error can occur if there are certain types
-of changes in tables. In this case please use C<--graphics-markup=none> as a
-work-around.
+of changes in tables. In this case please use C<--graphics-markup=none> as a
+work-around.
-=item B<--no-del>
+=item B<--no-del>
-Suppress deleted text from the diff. It is similar in effect to the BOLD style,
-but the deleted text ist not just invisible in the output, it is also not included in the diff text file.
-This can be more robust than just making it invisible.
+Suppress deleted text from the diff. It is similar in effect to the BOLD style,
+but the deleted text ist not just invisible in the output, it is also not included in the diff text file.
+This can be more robust than just making it invisible.
=item B<--disable-citation-markup> or B<--disable-auto-mbox>
-Suppress citation markup and markup of other vulnerable commands in styles
+Suppress citation markup and markup of other vulnerable commands in styles
using ulem (UNDERLINE,FONTSTRIKE, CULINECHBAR)
(the two options are identical and are simply aliases)
=item B<--enable-citation-markup> or B<--enforce-auto-mbox>
-Protect citation commands and other vulnerable commands in changed sections
+Protect citation commands and other vulnerable commands in changed sections
with C<\mbox> command, i.e. use default behaviour for ulem package for other packages
(the two options are identical and are simply aliases)
@@ -4823,18 +4865,18 @@ Suppress inclusion of old and new file names as comment in output file
=item B<--visible-label>
-Include old and new filenames (or labels set with C<--label> option) as
+Include old and new filenames (or labels set with C<--label> option) as
visible output.
=item B<--flatten>
Replace C<\input> and C<\include> commands within body by the content
of the files in their argument. If C<\includeonly> is present in the
-preamble, only those files are expanded into the document. However,
-no recursion is done, i.e. C<\input> and C<\include> commands within
-included sections are not expanded. The included files are assumed to
+preamble, only those files are expanded into the document. However,
+no recursion is done, i.e. C<\input> and C<\include> commands within
+included sections are not expanded. The included files are assumed to
be located in the same directories as the old and new master files,
-respectively, making it possible to organise files into old and new directories.
+respectively, making it possible to organise files into old and new directories.
--flatten is applied recursively, so inputted files can contain further
C<\input> statements. Also handles files included by the import package
(C<\import> and C<\subimport>), and C<\subfile> command.
@@ -4881,7 +4923,7 @@ Suppress generation of hyperreferences, used for minimal diffs (option --only-ch
=back
-=head2 Predefined styles
+=head2 Predefined styles
=head2 Major types
@@ -4894,9 +4936,14 @@ The major type determine the markup of plain text and some selected latex comman
Added text is wavy-underlined and blue, discarded text is struck out and red
(Requires color and ulem packages). Overstriking does not work in displayed math equations such that deleted parts of equation are underlined, not struck out (this is a shortcoming inherent to the ulem package).
+=item C<LUAUNDERLINE>
+
+Added text is underlined and blue, discarded text is struck out and red
+(Requires lua-ul package + LuaLaTeX).
+
=item C<CTRADITIONAL>
-Added text is blue and set in sans-serif, and a red footnote is created for each discarded
+Added text is blue and set in sans-serif, and a red footnote is created for each discarded
piece of text. (Requires color package)
=item C<TRADITIONAL>
@@ -4937,13 +4984,13 @@ Added text is set in bold face, discarded is not shown. (also see --no-del optio
=item C<PDFCOMMENT>
-The pdfcomment package is used to underline new text, and mark deletions with a PDF comment. Note that this markup might appear differently or not at all based on the pdf viewer used. The viewer with best support for pdf markup is probably acroread. This style is only recommended if the number of differences is small.
+The pdfcomment package is used to underline new text, and mark deletions with a PDF comment. Note that this markup might appear differently or not at all based on the pdf viewer used. The viewer with best support for pdf markup is probably acroread. This style is only recommended if the number of differences is small.
=back
=head2 Subtypes
-The subtype defines the commands that are inserted at the begin and end of added or discarded blocks, irrespectively of whether these blocks contain text or commands (Defined commands: C<\DIFaddbegin, \DIFaddend, \DIFdelbegin, \DIFdelend>)
+The subtype defines the commands that are inserted at the begin and end of added or discarded blocks, irrespectively of whether these blocks contain text or commands (Defined commands: C<\DIFaddbegin, \DIFaddend, \DIFdelbegin, \DIFdelend>)
=over 10
@@ -4961,7 +5008,7 @@ from the intended position.
An alternative way of marking added passages in blue, and deleted ones in red.
(It is recommeneded to use instead the main types to effect colored markup,
-although in some cases coloring with dvipscol can be more complete, for example
+although in some cases coloring with dvipscol can be more complete, for example
with citation commands).
=item C<DVIPSCOL>
@@ -4976,12 +5023,12 @@ although in some cases coloring with dvipscol can be more complete).
can be used to highlight only changed pages, but requires post-processing. It is recommend to not call this option manually but use C<latexdiff-vc> with C<--only-changes> option. Alternatively, use the script given within preamble of diff files made using this style.
-=item C<ONLYCHANGEDPAGE>
+=item C<ONLYCHANGEDPAGE>
also highlights changed pages, without the need for post-processing, but might not work reliably if
there is floating material (figures, tables).
-=item C<LABEL>
+=item C<LABEL>
is similar to C<ZLABEL>, but does not need the zref package and works less reliably (deprecated).
@@ -4989,7 +5036,7 @@ is similar to C<ZLABEL>, but does not need the zref package and works less relia
=head2 Float Types
-Some of the markup used in the main text might cause problems when used within
+Some of the markup used in the main text might cause problems when used within
floats (e.g. figures or tables). For this reason alternative versions of all
markup commands are used within floats. The float type defines these alternative commands.
@@ -5016,7 +5063,7 @@ Make no difference between the main text and floats.
=item C<ARRENV>
-If a match to C<ARRENV> is found within an inline math environment within a deleted or added block, then the inlined math
+If a match to C<ARRENV> is found within an inline math environment within a deleted or added block, then the inlined math
is surrounded by C<\mbox{>...C<}>. This is necessary as underlining does not work within inlined array environments.
[ Default: C<ARRENV>=S<C<(?:array|[pbvBV]matrix)> >
@@ -5036,9 +5083,9 @@ C<|subsubsection|paragraph|subparagraph)> ]
This option is for advanced users and allows definition of special versions of commands, which do not work as safe commands.
Commands in C<CUSTOMDIFCMD> that occur in added or deleted blocks will be given an ADD or DEL prefix.
-The prefixed versions of the command must be defined in the preamble, either by putting them
+The prefixed versions of the command must be defined in the preamble, either by putting them
in the preamble of at least the new file, or by creating a custom preamble file (Option --preamble).
-For example the command C<\blindtext> (from package blindtext) does not interact well with underlining, so that
+For example the command C<\blindtext> (from package blindtext) does not interact well with underlining, so that
for the standard markup type, it is not satisfactory to define it as a safe command. Instead, a customised versions
without underlining can be defined in the preamble:
@@ -5052,7 +5099,7 @@ and then latexdiff should be invoked with the option C<-c CUSTOMDIFCMD=blindtext
=item C<FLOATENV>
-Environments whose name matches the regular expression in C<FLOATENV> are
+Environments whose name matches the regular expression in C<FLOATENV> are
considered floats. Within these environments, the I<latexdiff> markup commands
are replaced by their FL variaties.
@@ -5101,17 +5148,17 @@ If C<--graphics-markup=both> is chosen, C<SCALEDELGRAPHICS> is the factor, by wh
=item C<VERBATIMENV>
-RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of these environments will not be processed in any way:
+RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of these environments will not be processed in any way:
deleted content is commented out, new content is not marked up
[ Default: S<C<comment> > ]
=item C<VERBATIMLINEENV>
-RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of environments described by VERBATIMLINEENV are compared in
+RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of environments described by VERBATIMLINEENV are compared in
line mode, and changes are marked up using the listings package. The markup style is set based on the chosen mains markup type (Option -t), or on an analysis
of the preamble.
-Note that "listings.sty" must be installed. If this file is not found the fallback solution is to
+Note that "listings.sty" must be installed. If this file is not found the fallback solution is to
treat VERBATIMLINEENV environments treated exactly the same way as VERBATIMENV environments.
[ Default: S<C<(?:verbatim[*]?|lstlisting> > ]
@@ -5122,30 +5169,40 @@ treat VERBATIMLINEENV environments treated exactly the same way as VERBATIMENV e
=over 10
-=item Citations result in overfull boxes
+=item Changed citations result in overfull boxes
There is an incompatibility between the C<ulem> package, which C<latexdiff> uses for underlining and striking out in the UNDERLINE style,
-the default style, and the way citations are generated. In order to be able to mark up citations properly, they are enclosed with an C<\mbox>
-command. As mboxes cannot be broken across lines, this procedure frequently results in overfull boxes, possibly obscuring the content as it extends beyond the right margin. The same occurs for some other packages (e.g., siunitx). If this is a problem, you have two possibilities.
+the default style, and the way citations are generated. In order to be able to mark up citations properly, they are enclosed with an C<\mbox>
+command. As mboxes cannot be broken across lines, this procedure frequently results in overfull boxes, possibly obscuring the content as it extends beyond the right margin. The same occurs for some other packages (e.g., siunitx). If this is a problem, you have several possibilities.
1. Use C<CFONT> type markup (option C<-t CFONT>): If this markup is chosen, then changed citations are no longer marked up
-with the wavy line (additions) or struck out (deletions), but are still highlighted in the appropriate color, and deleted text is shown with a different font. Other styles not using the C<ulem> package will also work.
+with the wavy line (additions) or struck out (deletions), but are still highlighted in the appropriate color, and deleted text is shown with a different font. Other styles not using the C<ulem> package will also work.
2. Choose option C<--disable-citation-markup> which turns off the marking up of citations: deleted citations are no longer shown, and
-added citations are shown without markup. (This was the default behaviour of latexdiff at versions 0.6 and older)
-
+added citations are shown without markup. (This was the default behaviour of latexdiff at versions 0.6 and older).
For custom packages you can define the commands which need to be protected by C<\mbox> with C<--append-mboxsafecmd> and C<--excludemboxsafecmd> options
(submit your lists of command as feature request at github page to set the default behaviour of future versions, see section 6)
-=item Changes in complicated mathematical equations result in latex processing errors
+3. If you are using luatex >= 1.12.0 you can use option LUAUNDERLINE that uses lua-ul instead of ulem for underlining, which does not have this problem (experimental feature).
+
+=item Changes in complicated mathematical equations result in latex processing errors.
+
+Try option C<--math-markup=whole>. If even that fails, you can turn off mark up for equations with C<--math-markup=off>.
-Try options C<--math-markup=whole>. If even that fails, you can turn off mark up for equations with C<--math-markup=off>.
+=item Deleted parts in equations are not struck out but underlined.
-=item How can I just show the pages where changes had been made
+This is a limitation of the ulem package that implements the strike-out. If you use the amsmath package, then the strike-out command is redefined in such a way that deleted passages are wrapped with C<\text> command; adding C<\usepackage{amsmath}> to your preamble will trigger this behaviour. (If amsmath is not included directly, but imported by another package, latexdiff will not be able to detect its availability; in this case you can give latexdiff a hint with option C<--packages=amsmath>.
-Use options -C<-s ZLABEL> (some postprocessing required) or C<-s ONLYCHANGEDPAGE>. C<latexdiff-vc --ps|--pdf> with C<--only-changes> option takes care of
+
+=item How can I just show the pages where changes had been made?
+
+Use options C<--s ZLABEL> (some postprocessing required) or C<-s ONLYCHANGEDPAGE>. C<latexdiff-vc --ps|--pdf> with C<--only-changes> option takes care of
the post-processing for you (requires zref package to be installed).
+=item The character encoding breaks when running latexdiff from powershell.
+
+This problem is not limited to C<latexdiff> and has to do with the default settings of C<powershell> in Windows. It is recommended to use C<cmd> instead.
+
=back
=head1 BUGS
@@ -5158,13 +5215,13 @@ different numbers of inter-argument spaces are treated as significant.
=back
-Please submit bug reports using the issue tracker of the github repository page I<https://github.com/ftilmann/latexdiff.git>,
+Please submit bug reports using the issue tracker of the github repository page I<https://github.com/ftilmann/latexdiff.git>,
or send them to I<tilmann -- AT -- gfz-potsdam.de>. Include the version number of I<latexdiff>
(from comments at the top of the source or use B<--version>). If you come across latex
files that are error-free and conform to the specifications set out
above, and whose differencing still does not result in error-free
latex, please send me those files, ideally edited to only contain the
-offending passage as long as that still reproduces the problem. If your
+offending passage as long as that still reproduces the problem. If your
file relies on non-standard class files, you must include those. I will not
look at examples where I have trouble to latex the original files.
@@ -5175,24 +5232,24 @@ L<latexrevise>, L<latexdiff-vc>
=head1 PORTABILITY
I<latexdiff> does not make use of external commands and thus should run
-on any platform supporting Perl 5.6 or higher. If files with encodings
+on any platform supporting Perl 5.6 or higher. If files with encodings
other than ASCII or UTF-8 are processed, Perl 5.8 or higher is required.
The standard version of I<latexdiff> requires installation of the Perl package
-C<Algorithm::Diff> (available from I<www.cpan.org> -
+C<Algorithm::Diff> (available from I<www.cpan.org> -
I<http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15>) but a stand-alone
version, I<latexdiff-so>, which has this package inlined, is available, too.
I<latexdiff-fast> requires the I<diff> command to be present.
=head1 AUTHOR
-Version 1.3.3
-Copyright (C) 2004-2022 Frederik Tilmann
+Version 1.3.4
+Copyright (C) 2004-2024 Frederik Tilmann
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3
-Contributors of fixes and additions: V. Kuhlmann, J. Paisley, N. Becker, T. Doerges, K. Huebner,
+Contributors of fixes and additions: V. Kuhlmann, J. Paisley, N. Becker, T. Doerges, K. Huebner,
T. Connors, Sebastian Gouezel and many others.
Thanks to the many people who sent in bug reports, feature suggestions, and other feedback.
@@ -5463,13 +5520,14 @@ value
underline
sqrt
(SUPER|SUB)SCRIPT
-%%END TEXT COMMANDS
+%%END TEXT COMMANDS
%%BEGIN CONTEXT1 COMMANDS
% Regex matching commands with a text argument (leave out the \), which will fail out of context. These commands behave like text commands, except when they occur in a deleted section, where they are disabled, but their argument is shown as deleted text.
caption
subcaption
-%%END CONTEXT1 COMMANDS
+multicolumn
+%%END CONTEXT1 COMMANDS
%%BEGIN CONTEXT2 COMMANDS
% Regex matching commands with a text argument (leave out the \), which will fail out of context. As corresponding commands for context1. The only difference is that context2 commands are completely disabled in deleted sections, including their arguments.
@@ -5477,7 +5535,7 @@ title
author
date
institute
-%%END CONTEXT2 COMMANDS
+%%END CONTEXT2 COMMANDS
%% CONFIGURATION variabe defaults
%%BEGIN LISTENV CONFIG
@@ -5555,9 +5613,16 @@ verbatim[*]?
\RequirePackage[normalem]{ulem}
\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1}
\providecommand{\DIFadd}[1]{{\protect\color{blue}\uwave{#1}}}
-\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}}
+\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}}
%DIF END UNDERLINE PREAMBLE
+%DIF LUAUNDERLINE PREAMBLE
+\RequirePackage{lua-ul}
+\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1}
+\providecommand{\DIFadd}[1]{{\protect\color{blue}\underLine{#1}}}
+\providecommand{\DIFdel}[1]{{\protect\color{red}\strikeThrough{#1}}}
+%DIF END LUAUNDERLINE PREAMBLE
+
%DIF CTRADITIONAL PREAMBLE
\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1}
\RequirePackage[stable]{footmisc}
@@ -5729,7 +5794,7 @@ verbatim[*]?
% To show only pages with changes (dvips/dvipdf)
% latex diff.tex
% latex diff.tex
-% dvips -pp `perl -lne 'if (m/\\newlabel{DIFchg[be]\d*}{{.*}{(.*)}}/) { print $1 }' diff.aux | uniq | tr -s \\n ','` diff.dvi
+% dvips -pp `perl -lne 'if (m/\\newlabel{DIFchg[be]\d*}{{.*}{(.*)}}/) { print $1 }' diff.aux | uniq | tr -s \\n ','` diff.dvi
\typeout{Check comments in preamble of output for instructions how to show only pages where changes have been made}
\usepackage[user,abspage]{zref}
\newcount\DIFcounterb
@@ -5749,10 +5814,10 @@ verbatim[*]?
\RequirePackage{etoolbox}
\RequirePackage{zref}
% redefine label command to write immediately to aux file - page references will be lost
-\makeatletter \let\oldlabel\label% Store \label
-\renewcommand{\label}[1]{% Update \label to write to the .aux immediately
-\zref@wrapper@immediate{\oldlabel{#1}}}
-\makeatother
+\makeatletter \let\oldlabel\label% Store \label
+\renewcommand{\label}[1]{% Update \label to write to the .aux immediately
+\zref@wrapper@immediate{\oldlabel{#1}}}
+\makeatother
\newbool{DIFkeeppage}
\newbool{DIFchange}
\boolfalse{DIFkeeppage}
@@ -5770,7 +5835,7 @@ verbatim[*]?
\providecommand{\DIFmodend}{\global\booltrue{DIFkeeppage}\global\boolfalse{DIFchange}}
%DIF END ONLYCHANGEDPAGE PREAMBLE
-%% FLOAT TYPES
+%% FLOAT TYPES
%DIF FLOATSAFE PREAMBLE
\providecommand{\DIFaddFL}[1]{\DIFadd{#1}}
@@ -5802,7 +5867,7 @@ verbatim[*]?
%DIF END TRADITIONALSAFE PREAMBLE
% see:
-% http://tex.stackexchange.com/questions/47351/can-i-redefine-a-command-to-contain-itself
+% http://tex.stackexchange.com/questions/47351/can-i-redefine-a-command-to-contain-itself
%DIF HIGHLIGHTGRAPHICS PREAMBLE
\RequirePackage{settobox}
@@ -5848,6 +5913,15 @@ verbatim[*]?
%% SPECIAL PACKAGE PREAMBLE COMMANDS
+%% Redefine strike out command to wrap in text box if amsmath is used and markup style with ulem is used
+%DIF AMSMATHULEM PREAMBLE
+\makeatletter
+\let\sout@orig\sout
+\renewcommand{\sout}[1]{\ifmmode\text{\sout@orig{\ensuremath{#1}}}\else\sout@orig{#1}\fi}
+\makeatother
+%DIF END AMSMATHULEM PREAMBLE
+
+
% Standard \DIFadd and \DIFdel are redefined as \DIFaddtex and \DIFdeltex
% when hyperref package is included.
%DIF HYPERREF PREAMBLE
@@ -5950,7 +6024,7 @@ verbatim[*]?
%DIF END DIFCODE_BOLD
%DIF DIFCODE_PDFCOMMENT
-
+
moredelim=[il][\color{white}\tiny]{\%DIF\ <\ },
moredelim=[il][\sffamily\bfseries]{\%DIF\ >\ }
%DIF END DIFCODE_PDFCOMMENT
diff --git a/support/latexdiff/latexdiff-so b/support/latexdiff/latexdiff-so
index b3571d27b2..9ab8e4169b 100755
--- a/support/latexdiff/latexdiff-so
+++ b/support/latexdiff/latexdiff-so
@@ -25,6 +25,21 @@
#
# Note references to issue numbers are for the github repository of latexdiff: https://github.com/ftilmann/latexdiff
#
+# Version 1.3.4:
+# New features:
+# - Option to use lua-ul instead of ulem (for use with LuaLaTeX) (fix #17, #60, #188, #255, #270)
+# Enhancement
+# - If amsmath is detected as one of the included (based on idea in PR #263 contributed by github user xlucn
+# Bug fix
+# - sometimes the introduction of aux commands to show deleted lists or descriptions leaves in place empty auxiliary
+# list environments, which would cause error messages (though skipping messages would result in a correct output pdf).
+# These are now removed.
+# - add more mboxsafecmd and safecmd commands for SIunitx to stay compatible with newer versionsof SIunitx (PR #283, fixing issue #282, contributed by github user joe6302413)
+# - File added via --preamble option is no longer assumed to be ASCII, but read either with encoding as defined by --encoding option or using the encoding of the LOCALE (fixes issue #285 )
+# - multicolumn argument is now treated as text
+# - when tikz-dependency package is used, \& is no longer a safe command as it has special meaning inside dependency environment. The fix is a little of a hack as really it should only be considered unsafe within dependency environment (fixes (mostly) issue #303 )
+# - listings package had trouble with non-ASCII chars. The encoding is now set (thanks to github user anka-213 for finding this). Fixes #304
+#
# Version 1.3.3:
# New features:
# - Option --no-del to remove all deleted text (merge contributed by github user tdegeus PR #252, fixing issue #66
@@ -33,22 +48,22 @@
# - Abbreviations involving punctuations within them. They need special treatment because otherwise in some
# circumstances the gnoring of white space differences in conjunction with merging according to MINWORDSBLOCK rule
# could turn 'i.e.' into 'i.\PAR e.' (see https://github.com/ftilmann/latexdiff/issues/269). A few abbreviations
-# are now hard-coded and treated as atomic:
+# are now hard-coded and treated as atomic:
# English: i.e., e.g. Deutsch: z.B.
# (fixes issue #269)
# - In WHOLE and COARSE math modes, now properly treat math environments with arguments such as \alignat. Fixes #251
-# - For FINE math mode, multiple improvments to the processing work flow yield more robust outcomes. In particular, changes
-# to the equation type, e.g. \begin{displaymath} -> \begin{equation} without modifications now usually no longer result
-# in errors. (Partially) fixes issues #235 and #244.
-# - When encountering deleted math array environments such as align or eqnarray, rather than replacing them with a
-# fixed replacement environment (e.g. align* or eqnarray*), an asterisk is now added to the original command, which
+# - For FINE math mode, multiple improvments to the processing work flow yield more robust outcomes. In particular, changes
+# to the equation type, e.g. \begin{displaymath} -> \begin{equation} without modifications now usually no longer result
+# in errors. (Partially) fixes issues #235 and #244.
+# - When encountering deleted math array environments such as align or eqnarray, rather than replacing them with a
+# fixed replacement environment (e.g. align* or eqnarray*), an asterisk is now added to the original command, which
# in amsmath (and with eqnarray) will result in the same environment but without line numbers. Config variable MATHARRREPL
# is therefore (nearly) redundant, and a depracation warning is given when it is set. Reference to MATHARRREPL are have
# been removed from the manual (there is one exception, when it's still being used: sometimes latexdiff can figure out
# that there is a deleted array environment, but does not know which one. In this case, MATHARRREPL is still being used
-# to encapsulate these parts of the source, and therefore it is still set internally. But this is a quite rare situation).
+# to encapsulate these parts of the source, and therefore it is still set internally. But this is a quite rare situation).
# Fixes issue #216
-# - Unlike 'array' environment, 'split' (amsmath) does not work in argument of \DIFadd or \DIFdl in UNDERLINE modes; therefore remove it from ARRENV configuration variable.
+# - Unlike 'array' environment, 'split' (amsmath) does not work in argument of \DIFadd or \DIFdl in UNDERLINE modes; therefore remove it from ARRENV configuration variable.
# Exclude \begin and \end in math environments in COARSE and WHOLE modes. Fixes #258. Fixes #109
# - --flatten now works for empty files. Fixes issue #242
# - improved processing of Chinese and Japanese texts in that splitting is done based on characters. Thanks to LuXu (Oliver Lew) in git for working this out. Fixes #229, fixes #145
@@ -65,7 +80,7 @@
# Bug fixes:
# - fix issue #206 affecting proper markup of text commands which are not also safe cmd's and have multiple arguments
# - fix issue #210 by adding \eqref (amsmath package) to the list of safe commands
-# - fix bug reported in issue #168 mangled verbatim line environment
+# - fix bug reported in issue #168 mangled verbatim line environment
# - fix bug reported in issue #218 by replacing \hspace{0pt} after \mbox{..} auxiliary commands with \hskip0pt.
# - more ways to process \frac correctly with atomic arguments (committed by julianuu PR #246
# - fix a bug in biblatex mode, which prevented proper processing of modified \textcite (see: https://tex.stackexchange.com/questions/555157/latexdiff-and-biblatex-citation-commands)
@@ -74,10 +89,10 @@
# Version 1.3.1.1
# - remove spurious \n to fix error: Unknown regexp modifier "/n" at .../latexdiff line 1974, near "=~ " (see github issue #201)
#
-# Version 1.3.1
+# Version 1.3.1
# Bug fixes:
# - remove some uninitialised variable $2 warnings in string substitution in flatten function in case included file is not found
-# - add minimal postprocessing to diff processing of preamble commands (replace \RIGHTBRACE by \} )
+# - add minimal postprocessing to diff processing of preamble commands (replace \RIGHTBRACE by \} )
# - pre-processing: replace (contributed) routine take_comments_and_enter_from_frac() with take_comments_and_newline_from_frac(), which does the same thing
# (remove whitespace characters and comments between the argument of \frac commands) in an easier and more robust way. In addition, it
# will replace commands like \frac12 with \frac{1}{2} as pre-processing step. Fixes issue #184
@@ -95,15 +110,15 @@
# Version 1.3.0 (7 October 2018):
# - treat options to \documentclass as potential package names (some packages allow implicit loading of or imply selected packages
# - improved pattern matching: now allows nested angular brackets, and is no longer confused by escaped curly braces
-# - improved pattern matching in COARSE mode: occasionally, the closing bracket or some other elements would be matched in an 'unnatural' way due to another sequence being more minimal in the computational sense, sometimes even causing errors due to tokens moving in or out of the scope of math environments. This is now discouraged by adding internal \DIFANCHOR commands (which are removed again in post-processing) (fixes issues reported via email by li_ruomeng .
+# - improved pattern matching in COARSE mode: occasionally, the closing bracket or some other elements would be matched in an 'unnatural' way due to another sequence being more minimal in the computational sense, sometimes even causing errors due to tokens moving in or out of the scope of math environments. This is now discouraged by adding internal \DIFANCHOR commands (which are removed again in post-processing) (fixes issues reported via email by li_ruomeng .
# - verbatim and lstlisting environments are marked-up with line-by-line in a similar style to non-verbatim text (requires the listing package to be installed)
# (see new configuration variable VERBATIMLINEENV) (several issues and pull requests by jprotze)
-# - --flatten: now supports \verbatiminput and \lstlistinput
+# - --flatten: now supports \verbatiminput and \lstlistinput
# - --flatten: if file is not found, do not fail, simply warn and leave command unexpanded (inspired by issue #112). Don't warn if file name contains #[0-9] as it is then most likely an argument within a command definition rather than an actual file (applies to \input, \subfile, \include commands)
# - added to textcmds: \intertext
# - new config variable CUSTOMDIFCMD to allow defining special versions of commands in added or deleted blocks (Pull request by github user jprotze)
# - added option -no-links (mostly for use by latexdiff-vc in only-changes modes) (Pull request by github user jprotze)
-# - new option --filter-script to run both input through a pre-processing script (PR jasonmccsmith #167)
+# - new option --filter-script to run both input through a pre-processing script (PR jasonmccsmith #167)
# new option --no-filter-stderr to hide stderr output from filter-script (potentially dangerous, as this might hide malfunctioning of filter scripts)
# - --flatten now can deal with imports made using the import package {PR jasonmccsmith #173)
# Bug fixes:
@@ -122,12 +137,12 @@
# make environments that are treated like verbatim environments configurable (config variable VERBATIMENV)
# treat lstinlne as equivalent to verb command
# partially addresses issue #38
-# - refactoring: set default configuration variables in a hash, and those that correspond to lists
+# - refactoring: set default configuration variables in a hash, and those that correspond to lists
# - feature: option --add-to-config used to amend configuration variables, which are regex pattern lists
# - bug fix: deleted figures when endfloat package is activated
# - bug fix: alignat environment now always processed correctly (fix issues #65)
# - bug fix: avoid processing of commands as potential files in routine init_regex_arr (fix issue #70 )
-# - minimal feature enhancement: treat '@' as allowed character in commands (strictly speaking requires prior \makeatletter statement, but always assuming it to be
+# - minimal feature enhancement: treat '@' as allowed character in commands (strictly speaking requires prior \makeatletter statement, but always assuming it to be
# @ a letter if it is part of a command name will usually lead to the correct behaviour (see http://tex.stackexchange.com/questions/346651/latexdiff-and-let)
# - new feature/bug fix: --flatten option \endinput in included files now respected but only if \endinput stands right at the beginning of the line (issue #77)
# - bug fix: flatten would incorrectly attempt to process commented out \include commands (from discussion in issue #77 )
@@ -165,7 +180,7 @@
# - introduce list UNSAFEMATHCMD, which holds list of commands which cannot be marked up with \DIFadd or \DIFdel commands (only relevant for WHOLE and COARSE math markup modes)
# - new subtype LABEL which gives each change a label. This can later be used to only display pages where changes
# have been made (instructions for that are put as comments into the diff'ed file) inspired by answer on http://tex.stackexchange.com/questions/166049/invisible-markers-in-pdfs-using-pdflatex
-# - Configuration variables take into accout some commands from additional packages:
+# - Configuration variables take into accout some commands from additional packages:
# tikzpicture environment now treated as PICTUREENV, and \smallmatrix in ARRENV (amsmath)
# - --flatten: support for \subfile command (subfiles package) (in response to http://tex.stackexchange.com/questions/167620/latexdiff-with-subfiles )
# - --flatten: \bibliography commands expand if corresponding bbl file present
@@ -179,11 +194,11 @@
# - \% in one-letter sub/Superscripts was not converted correctly
#
# Version 1.0.3
-# - fix bug in add_safe_commands that made latexdiff hang on DeclareMathOperator
+# - fix bug in add_safe_commands that made latexdiff hang on DeclareMathOperator
# command in preamble
# - \(..\) inline math expressions were not parsed correctly, if they contained a linebreak
# - applied patch contributed by tomflannaghan via Berlios: [ Patch #3431 ] Adds correct handling of \left< and \right>
-# - \$ is treated correctly as a literal dollar sign (thanks to Reed Cartwright and Joshua Miller for reporting this bug
+# - \$ is treated correctly as a literal dollar sign (thanks to Reed Cartwright and Joshua Miller for reporting this bug
# and sketching out the solution)
# - \^ and \_ are correctly interpreted as accent and underlined space, respectively, not as superscript of subscript
# (thanks to Wail Yahyaoui for pointing out this bug)
@@ -191,19 +206,19 @@
# Version 1.0.1 - treat \big,\bigg etc. equivalently to \left and
# \right - include starred version in MATHENV - apply
# - flatten recursively and --flatten expansion is now
-# aware of comments (thanks to Tim Connors for patch)
+# aware of comments (thanks to Tim Connors for patch)
# - Change to post-processing for more reliability for
# deleted math environments
-# - On linux systems, recognise and remove DOS style newlines
+# - On linux systems, recognise and remove DOS style newlines
# - Provide markup for some special preamble commands (\title,
-# \author,\date,
-# - configurable by setting context2cmd
+# \author,\date,
+# - configurable by setting context2cmd
# - for styles using ulem package, remove \emph and \text.. from list of
# safe commands in order to allow linebreaks within the
-# highlighted sections.
-# - for ulem style, now show citations by enclosing them in \mbox commands.
-# This unfortunately implies linebreaks within citations no longer function,
-# so this functionality can be turned off (Option --disable-citation-markup).
+# highlighted sections.
+# - for ulem style, now show citations by enclosing them in \mbox commands.
+# This unfortunately implies linebreaks within citations no longer function,
+# so this functionality can be turned off (Option --disable-citation-markup).
# With --enable-citation-markup, the mbox markup is forced for other styles)
# - new substyle COLOR. This is particularly useful for marking up citations
# and some special post-processing is implemented to retain cite
@@ -211,11 +226,11 @@
# - four different levels of math-markup
# - Option --driver for choosing driver for modes employing changebar package
# - accept \\* as valid command (and other commands of form \.*). Also accept
-# \<nl> (backslashed newline)
+# \<nl> (backslashed newline)
# - some typo fixes, include commands defined in preamble as safe commands
-# (Sebastian Gouezel)
+# (Sebastian Gouezel)
# - include compared filenames as comments as line 2 and 3 of
-# the preamble (can be modified with option --label, and suppressed with
+# the preamble (can be modified with option --label, and suppressed with
# --no-label), option --visible-label to show files in generated pdf or dvi
# at the beginning of main document
#
@@ -231,7 +246,7 @@
#
# Version 0.4 March 06 option for fast differencing using UNIX diff command, several minor bug fixes (\par bug, improved highlighting of textcmds)
#
-# Version 0.3 August 05 improved parsing of displayed math, --allow-spaces
+# Version 0.3 August 05 improved parsing of displayed math, --allow-spaces
# option, several minor bug fixes
#
# Version 0.25 October 04 Fix bug with deleted equations, add math mode commands to safecmd, add | to allowed interpunctuation signs
@@ -704,12 +719,13 @@ use utf8 ;
use File::Spec ;
+
my ($algodiffversion)=split(/ /,$Algorithm::Diff::VERSION);
my ($versionstring)=<<EOF ;
-This is LATEXDIFF 1.3.3 (Algorithm::Diff $Algorithm::Diff::VERSION, Perl $^V)
- (c) 2004-2022 F J Tilmann
+This is LATEXDIFF 1.3.4 (Algorithm::Diff $Algorithm::Diff::VERSION, Perl $^V)
+ (c) 2004-2024 F J Tilmann
EOF
# Hash with defaults for configuration variables. These marked undef have default values constructed from list defined in the DATA block
@@ -800,9 +816,9 @@ my $DELCMDOPEN='%DIFDELCMD < '; # To mark begin of deleted commands (must begin
my $DELCMDCLOSE="%%%\n"; # To mark end of deleted commands (must end with a new line)
my $AUXCMD='%DIFAUXCMD' ; # follows auxiliary commands put in by latexdiff to make difference file legal
# auxiliary commands must be on a line of their own
- # Note that for verbatim environment openings the %DIFAUXCMD cannot be placed in
+ # Note that for verbatim environment openings the %DIFAUXCMD cannot be placed in
# the same line as this would mean they are shown
- # so the special form "%DIFAUXCMD NEXT" is used to indicate that the next line
+ # so the special form "%DIFAUXCMD NEXT" is used to indicate that the next line
# is an auxiliary command
# Similarly "%DIFAUXCMD LAST" would indicate the auxiliary command is in previous line (not currently used)
my $DELCOMMENT='DIF < '; # To mark deleted comment line
@@ -813,21 +829,21 @@ my @TEXTCMDLIST=(); # array containing patterns of commands with text arguments
my @TEXTCMDEXCL=(); # array containing patterns of commands without text arguments (if a pattern
# matches both TEXTCMDLIST and TEXTCMDEXCL it is excluded)
my @CONTEXT1CMDLIST=(); # array containing patterns of commands with text arguments (subset of text commands),
- # but which cause confusion if used out of context (e.g. \caption).
+ # but which cause confusion if used out of context (e.g. \caption).
# In deleted passages, the command will be disabled but its argument is marked up
- # Otherwise they behave exactly like TEXTCMD's
+ # Otherwise they behave exactly like TEXTCMD's
my @CONTEXT1CMDEXCL=(); # exclude list for above, but always empty
my @CONTEXT2CMDLIST=(); # array containing patterns of commands with text arguments, but which fail or cause confusion
# if used out of context (e.g. \title). They and their arguments will be disabled in deleted
# passages
my @CONTEXT2CMDEXCL=(); # exclude list for above, but always empty
my @MATHTEXTCMDLIST=(); # treat like textcmd. If a textcmd is in deleted or added block, just wrap the
- # whole content with \DIFadd or \DIFdel irrespective of content. This functionality
+ # whole content with \DIFadd or \DIFdel irrespective of content. This functionality
# is useful for pseudo commands \MATHBLOCK.. into which math environments are being
- # transformed
-my @MATHTEXTCMDEXCL=(); #
+ # transformed
+my @MATHTEXTCMDEXCL=(); #
-# Note I need to declare this with "our" instead of "my" because later in the code I have to "local"ise these
+# Note I need to declare this with "our" instead of "my" because later in the code I have to "local"ise these
our @SAFECMDLIST=(); # array containing patterns of safe commands (which do not break when in the argument of DIFadd or DIFDEL)
our @SAFECMDEXCL=();
my @MBOXCMDLIST=(); # patterns for commands which are in principle safe but which need to be surrounded by an \mbox
@@ -892,7 +908,7 @@ $mathmarkup=COARSE;
$verbose=0;
$onlyadditions=0;
# output debug and intermediate files, set to 0 in final distribution
-$debug=0;
+$debug=0;
# insert preamble directly after documentclass - experimental feature, set to 0 in final distribution
# Note that this failed with mini example (or other files, where packages used in latexdiff preamble
# are called again with incompatible options in preamble of resulting file)
@@ -915,9 +931,9 @@ END
my %verbhash;
Getopt::Long::Configure('bundling');
-GetOptions('type|t=s' => \$type,
- 'subtype|s=s' => \$subtype,
- 'floattype|f=s' => \$floattype,
+GetOptions('type|t=s' => \$type,
+ 'subtype|s=s' => \$subtype,
+ 'floattype|f=s' => \$floattype,
'config|c=s' => \@configlist,
'add-to-config=s' => \@addtoconfiglist,
'preamble|p=s' => \$preamblefile,
@@ -966,11 +982,11 @@ if ( $help ) {
if ( $version ) {
- print STDERR $versionstring ;
+ print STDERR $versionstring ;
exit 0;
}
-print STDERR $versionstring if $verbose;
+print STDERR $versionstring if $verbose;
if (defined($showall)){
$showpreamble=$showsafe=$showtext=$showconfig=1;
@@ -988,7 +1004,7 @@ if (defined($mathmarkup)) {
$mathmarkup=~tr/a-z/A-Z/;
if ( $mathmarkup eq 'OFF' ){
$mathmarkup=OFF;
- } elsif ( $mathmarkup eq 'WHOLE' ){
+ } elsif ( $mathmarkup eq 'WHOLE' ){
$mathmarkup=WHOLE;
} elsif ( $mathmarkup eq 'COARSE' ){
$mathmarkup=COARSE;
@@ -1091,7 +1107,7 @@ foreach $config ( @configlist ) {
}
}
foreach $assign ( @config ) {
- $assign=~ m/\s*(\w*)\s*=\s*(\S*)\s*$/ or die "Illegal assignment $assign in configuration list (must be variable=value)";
+ $assign=~ m/\s*(\w*)\s*=\s*(\S*)\s*$/ or die "Illegal assignment $assign in configuration list (must be variable=value)";
exists $CONFIG{$1} or die "Unknown configuration variable $1.";
$CONFIG{$1}=$2;
}
@@ -1128,7 +1144,7 @@ foreach $key ( keys(%CONFIG) ) {
foreach $assign ( @addtoconfig ) {
###print STDERR "assign:|$assign|\n";
- $assign=~ m/\s*(\w*)\s*=\s*(\S*)\s*$/ or die "Illegal assignment $assign in configuration list (must be variable=value)";
+ $assign=~ m/\s*(\w*)\s*=\s*(\S*)\s*$/ or die "Illegal assignment $assign in configuration list (must be variable=value)";
exists $CONFIG{$1} or die "Unknown configuration variable $1.";
$CONFIG{$1}.=";$2";
}
@@ -1143,8 +1159,8 @@ foreach ( keys(%CONFIG) ) {
elsif ( $_ eq "MATHENV" ) { $MATHENV = liststringtoregex($CONFIG{$_}) ; }
elsif ( $_ eq "MATHREPL" ) { $MATHREPL = $CONFIG{$_} ; }
elsif ( $_ eq "MATHARRENV" ) { $MATHARRENV = liststringtoregex($CONFIG{$_}) ; }
- elsif ( $_ eq "MATHARRREPL" ) { $MATHARRREPL = $CONFIG{$_} ;
- print STDERR "WARNING: Setting MATHARRREPL is depracated. Generally deleted math array environments will be set to their starred varieties and the setting of MATHARREPL is ignored.\n\n" unless $MATHARRREPL =~ /eqnarray\*/ ;
+ elsif ( $_ eq "MATHARRREPL" ) { $MATHARRREPL = $CONFIG{$_} ;
+ print STDERR "WARNING: Setting MATHARRREPL is depracated. Generally deleted math array environments will be set to their starred varieties and the setting of MATHARREPL is ignored.\n\n" unless $MATHARRREPL =~ /eqnarray\*/ ;
}
elsif ( $_ eq "ARRENV" ) { $ARRENV = liststringtoregex($CONFIG{$_}) ; }
elsif ( $_ eq "VERBATIMENV" ) { $VERBATIMENV = liststringtoregex($CONFIG{$_}) ; }
@@ -1171,11 +1187,11 @@ foreach $pkg ( @packagelist ) {
if ($showconfig || $showtext || $showsafe || $showpreamble) {
show_configuration();
- exit 0;
+ exit 0;
}
-if ( @ARGV != 2 ) {
+if ( @ARGV != 2 ) {
print STDERR "2 and only 2 non-option arguments required. Write latexdiff -h to get help\n";
exit(2);
}
@@ -1183,7 +1199,7 @@ if ( @ARGV != 2 ) {
# Are extra spaces between command arguments permissible?
my $extraspace;
if ($allowspaces) {
- $extraspace='\s*';
+ $extraspace='\s*';
} else {
$extraspace='';
}
@@ -1206,14 +1222,14 @@ push(@SAFECMDLIST, qr/^QLEFTBRACE$/, qr/^QRIGHTBRACE$/);
# if you get "undefined control sequence MATHBLOCKmath" error, increase the maximum value in this loop
for (my $i_pat = 0; $i_pat < 20; ++$i_pat){
$pat_n = '(?:[^{}]|\{'.$pat_n.'\}|\\\\\{|\\\\\})*';
- # Actually within the text body, quoted braces are replaced in pre-processing. The only place where
+ # Actually within the text body, quoted braces are replaced in pre-processing. The only place where
# the last part of the pattern matters is when processing the arguments of context2cmds in the preamble
# and these contain a \{ or \} combination, probably rare.
# It should thus be fine to use the simpler version below.
### $pat_n = '(?:[^{}]|\{'.$pat_n.'\})*';
}
- my $brat0 = '(?:[^\[\]]|\\\[|\\\])*';
+ my $brat0 = '(?:[^\[\]]|\\\[|\\\])*';
my $brat_n = $brat0;
for (my $i_pat = 0; $i_pat < 4; ++$i_pat){
$brat_n = '(?:[^\[\]]|\['.$brat_n.'\]|\\\[|\\\])*';
@@ -1230,7 +1246,7 @@ push(@SAFECMDLIST, qr/^QLEFTBRACE$/, qr/^QRIGHTBRACE$/);
# could turn 'i.e.' into 'i.\PAR e.' (see https://github.com/ftilmann/latexdiff/issues/269)
# English: i.e., e.g. Deutsch: z.B.
my $abbreviation='(?:i\. ?e\.|e\. ?g\.|z\. ?B\.)' ;
- my $number='-?\d*\.\d*';
+ my $number='-?\d*\.\d*';
# word: sequence of letters or accents followed by letter
my $word_cj='\p{Han}|\p{InHiragana}|\p{InKatakana}';
@@ -1258,7 +1274,7 @@ push(@SAFECMDLIST, qr/^QLEFTBRACE$/, qr/^QRIGHTBRACE$/);
# inline math $....$ or \(..\)
### the commented out version is simpler but for some reason cannot cope with newline (in spite of s option) - need to include \newline explicitly
### my $math='\$(?:[^$]|\\\$)*?\$|\\\\[(].*?\\\\[)]';
- my $math='\$(?:[^$]|\\\$)*?\$|\\\\[(](?:.|\n)*?\\\\[)]';
+ my $math='\$(?:[^$]|\\\$)*?\$|\\\\[(](?:.|\n)*?\\\\[)]';
### test version (this seems to give the same results as version above)
## the current maths command cannot cope with newline within the math expression
### my $math='\$(?:[^$]|\\\$)*?\$|\\[(].*?\\[)]';
@@ -1276,7 +1292,7 @@ push(@SAFECMDLIST, qr/^QLEFTBRACE$/, qr/^QRIGHTBRACE$/);
-# now we are done setting up and can start working
+# now we are done setting up and can start working
my ($oldfile, $newfile) = @ARGV;
# check for existence of input files
if ( ! -e $oldfile ) {
@@ -1304,7 +1320,7 @@ my ($oldtime,$newtime,$oldlabel,$newlabel);
if (defined($labels[0])) {
$oldlabel=$labels[0] ;
} else {
- $oldtime=localtime((stat($oldfile))[9]);
+ $oldtime=localtime((stat($oldfile))[9]);
$oldlabel="$oldfile " . " "x($oldlabel_n_spaces) . $oldtime;
}
if (defined($labels[1])) {
@@ -1317,6 +1333,7 @@ if (defined($labels[1])) {
$encoding=guess_encoding($newfile) unless defined($encoding);
$encoding = "utf8" if $encoding =~ m/^utf8/i ;
+print STDERR "Encoding $encoding\n" if $verbose;
if (lc($encoding) eq "utf8" ) {
binmode(STDOUT, ":utf8");
binmode(STDERR, ":utf8");
@@ -1400,7 +1417,7 @@ my @auxlines;
my ($ulem)=0;
if ( length $oldpreamble && length $newpreamble ) {
- # pre-process preamble by looking for commands used in \maketitle (title, author, date etc commands)
+ # pre-process preamble by looking for commands used in \maketitle (title, author, date etc commands)
# and marking up content with latexdiff markup
@auxlines=preprocess_preamble($oldpreamble,$newpreamble);
@@ -1432,7 +1449,7 @@ if (defined($graphicsmarkup)) {
} else {
# Default: no explicit setting in menu
if ( defined $packages{"graphicx"} or defined $packages{"graphics"} ) {
- $graphicsmarkup=NEWONLY;
+ $graphicsmarkup=NEWONLY;
} else {
$graphicsmarkup=NONE;
}
@@ -1465,7 +1482,7 @@ if ($graphicsmarkup != NONE ) {
@matches=( $latexdiffpreamble =~ m/command\{\\DIFaddbeginFL}\{($pat_n)}/sg ) ;
# we look at the last one of the list to take into account possible redefinition but almost always matches should have exactly one element
if ( $matches[$#matches] =~ m/\\DIFaddbegin/ ) {
- die "Cannot combine graphics markup with float styles defining \\DIFaddbeginFL in terms of \\DIFaddbegin. Use --graphics-markup=none option or choose a different float style.";
+ die "Cannot combine graphics markup with float styles defining \\DIFaddbeginFL in terms of \\DIFaddbegin. Use --graphics-markup=none option or choose a different float style.";
exit 10;
}
###}
@@ -1479,6 +1496,11 @@ if ($graphicsmarkup != NONE ) {
$ulem = ($latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{ulem\}/ || defined $packages{"ulem"});
+# If amsmath is defined and $ulem is used for markup, redefine the \sout command to also work (mostly) in math mode
+# See stack exchange https://tex.stackexchange.com/questions/20609/strikeout-in-math-mode/308647#308647 based on comment by Taylor Raine
+if ( defined($packages{'amsmath'}) and $ulem ) {
+ $latexdiffpreamble .= join "\n",(extrapream('AMSMATHULEM'),"");
+}
# If listings is being used or can be found in the latexdiff search path, add to the preamble auxiliary code to enable line-by-line markup
if ( defined($packages{"listings"}) or `kpsewhich listings.sty` ne "" ) {
@@ -1488,7 +1510,7 @@ if ( defined($packages{"listings"}) or `kpsewhich listings.sty` ne "" ) {
}
my @listingDIFcode=();
my $replaced;
- # note that in case user supplies preamblefile the type might not reflect well the
+ # note that in case user supplies preamblefile the type might not reflect well the actual markup style
@listingDIFcode=extrapream("-nofail","DIFCODE_" . $type) unless defined($preamblefile);
if (!(@listingDIFcode)) {
# if listingDIFcode is empty try to guess a suitable one from the preamble
@@ -1502,13 +1524,17 @@ if ( defined($packages{"listings"}) or `kpsewhich listings.sty` ne "" ) {
@listingDIFcode=extrapream("DIFCODE_BOLD");
}
}
- # now splice it in
+ # add configuration so that listings work with utf-8
+ push @listingpreamble, '\lstset{extendedchars=\true,inputencoding='.$encoding."}\n";
+
+
+ # now splice it in
$replaced=0;
###print STDERR "DEBUG: listingDIFcode: ",join("\n",@listingDIFcode),"|||\n" if $debug;
- @listingpreamble=grep {
+ @listingpreamble=grep {
# only replace if this has not been done already (use short-circuit property of and)
- if (!$replaced and $_ =~ s/^.*%DIFCODE TEMPLATE.*$/join("\n",@listingDIFcode)/e ) {
+ if (!$replaced and $_ =~ s/^.*%DIFCODE TEMPLATE.*$/join("\n",@listingDIFcode)/e ) {
###print STDERR "DEBUG: Replaced text $_\n" if $debug;
$replaced=1;
1;
@@ -1538,7 +1564,7 @@ if ( length $oldpreamble && length $newpreamble ) {
unshift @oldpreamble,'';
@diffpreamble = linediff(\@oldpreamble, \@newpreamble);
# remove dummy line again
- shift @diffpreamble;
+ shift @diffpreamble;
# add filenames, modification time and latexdiff mark
defined($nolabel) or splice @diffpreamble,1,0,
"%DIF LATEXDIFF DIFFERENCE FILE",
@@ -1587,8 +1613,8 @@ if (defined $packages{"siunitx"} ) {
# protect SI command by surrounding them with an \mbox
# this is done to get around an incompatibility between the ulem and siunitx package
print STDERR "siunitx package detected.\n" if $verbose ;
- my $mboxcmds='SI,ang,numlist,numrange,SIlist,SIrange';
- init_regex_arr_list(\@SAFECMDLIST,'num,si');
+ my $mboxcmds='SI,ang,numlist,numrange,SIlist,SIrange,qty,qtylist,qtyproduct,qtyrange,complexqty';
+ init_regex_arr_list(\@SAFECMDLIST,'num,si,numproduct,unit,complexnum');
if ( $enablecitmark || ( $ulem && ! $disablecitmark )) {
init_regex_arr_list(\@MBOXCMDLIST,$mboxcmds);
} else {
@@ -1610,7 +1636,7 @@ if (defined $packages{"cleveref"} ) {
if (defined $packages{"glossaries"} ) {
# protect selected command by surrounding them with an \mbox
- # this is done to get around an incompatibility between ulem and glossaries package
+ # this is done to get around an incompatibility between ulem and glossaries package
print STDERR "glossaries package detected.\n" if $verbose ;
my $mboxcmds='[gG][lL][sS](?:|pl|disp|link|first|firstplural|desc|user[iv][iv]?[iv]?),[aA][cC][rR](?:long|longpl|full|fullpl),[aA][cC][lfp]?[lfp]?';
init_regex_arr_list(\@SAFECMDLIST,'[gG][lL][sS](?:(?:entry)?(?:text|plural|name|symbol)|displaynumberlist|entryfirst|entryfirstplural|entrydesc|entrydescplural|entrysymbolplural|entryuser[iv][iv]?[iv]?|entrynumberlist|entrydisplaynumberlist|entrylong|entrylongpl|entryshort|entryshortpl|entryfull|entryfullpl),[gG]lossentry(?:name|desc|symbol),[aA][cC][rR](?:short|shortpl),[aA]csp?');
@@ -1639,6 +1665,10 @@ if (defined $packages{"mhchem"} ) {
# push(@MATHTEXTCMDLIST,'cee');
}
+if ( defined $packages{"tikz-dependency"} ) {
+ init_regex_arr_ext(\@SAFECMDEXCL, 'AMPERSAND');
+}
+
my ( $citpat);
@@ -1726,7 +1756,7 @@ print STDERR "(",exetime()," s)\n","Done.\n" if $verbose;
# liststringtoregex(liststring)
-# expands string with semi-colon separated list into a regular expression corresponding
+# expands string with semi-colon separated list into a regular expression corresponding
# matching any of the elements
sub liststringtoregex {
my ($liststring)=@_;
@@ -1739,7 +1769,7 @@ sub liststringtoregex {
}
# show_configuration
-# note that this is not encapsulated but uses variables from the main program
+# note that this is not encapsulated but uses variables from the main program
# It is provided for convenience because in the future it is planned to allow output
# to be modified based on what packages are read etc - this works only if the input files are actually read
# whether or not additional files are provided
@@ -1766,7 +1796,7 @@ sub show_configuration {
print "\nContext1 commands (last argument textual, command will be disabled in deleted passages, last argument will be shown as plain text):\n";
print_regex_arr(@CONTEXT1CMDLIST);
print "\nContext2 commands (last argument textual, command and its argument will be disabled in deleted passages):\n";
- print_regex_arr(@CONTEXT2CMDLIST);
+ print_regex_arr(@CONTEXT2CMDLIST);
print "\nExclude list of Commands with last argument not textual (overrides patterns above):\n";
print_regex_arr(@TEXTCMDEXCL);
}
@@ -1874,7 +1904,7 @@ sub list_packages {
my %packages=();
my $pkg;
- # remove comments
+ # remove comments
$preamble=~s/(?<!\\)%.*$//mg ;
while ( $preamble =~ m/\\(?:documentclass|usepackage|RequirePackage)(?:\[($brat_n)\])?\{(.*?)\}/gs ) {
@@ -1979,7 +2009,7 @@ sub flatten {
my ($includeonly,$dirname,$fname,$newpage,$fullfile,$filecontent,$replacement,$begline,$inputcmd,$bblfile,$subfile,$command,$verbenv,$verboptions,$ignore,$fileonly);
my ($subpreamble,$subbody,$subpost);
my ($subdir,$subdirfull,$importfilepath);
- require File::Basename ;
+ require File::Basename ;
### require File::Spec ; # now this is needed even if flatten option not given
$filename = File::Spec->rel2abs( $filename ) ;
($ignore, $dirname, $fileonly) = File::Spec->splitpath($filename) ;
@@ -2019,15 +2049,15 @@ sub flatten {
$subdirfull = (defined($3) ? File::Spec->catdir($dirname,$subdir) : $subdir);
$importfilepath = File::Spec->catfile($subdirfull, $fname);
-
+
print STDERR "importing importfilepath:", $importfilepath,"\n" if $verbose;
if ( -f $importfilepath ) {
# If file exists, replace input or include command with expanded input
#TODO: need remove_endinput & newpage similar to other replacements inside flatten
- $replacement=flatten(read_file_with_encoding($importfilepath, $encoding), $preamble,$importfilepath,$encoding);
+ $replacement=flatten(read_file_with_encoding($importfilepath, $encoding), $preamble,$importfilepath,$encoding);
} else {
# if file does not exist, do not expand include or input command (do not warn if fname contains #[0-9] as it is then likely part of a command definition
- # and is not meant to be expanded directly
+ # and is not meant to be expanded directly
print STDERR "WARNING: Could not find included file ",$importfilepath,". I will continue but not expand |$2|\n";
$replacement = $2;
$replacement .= "{$subdir}{$fname} % Processed";
@@ -2036,13 +2066,13 @@ sub flatten {
}/exgm;
# recursively replace \\input and \\include files
- $text =~ s/(^(?:[^%\n]|\\%)*)(\\input\{(.*?)\}|\\include\{(${includeonly}(?:\.tex)?)\})/{
+ $text =~ s/(^(?:[^%\n]|\\%)*)(\\input\{(.*?)\}|\\include\{(${includeonly}(?:\.tex)?)\})/{
$begline=(defined($1)? $1 : "") ;
$inputcmd=$2;
$fname = $3 if defined($3) ;
$fname = $4 if defined($4) ;
$newpage=(defined($4)? " \\newpage " : "") ;
- # # add tex extension unless there is a three or four letter extension already
+ # # add tex extension unless there is a three or four letter extension already
$fname .= ".tex" unless $fname =~ m|\.\w{3,4}$|;
$fullfile = File::Spec->catfile($dirname,$fname);
print STDERR "DEBUG Beg of line match |$1|\n" if defined($1) && $debug ;
@@ -2051,12 +2081,12 @@ sub flatten {
# content of file becomes replacement value (use recursion), add \newpage if the command was include
if ( -f $fullfile ) {
# If file exists, replace input or include command with expanded input
- $replacement=flatten(read_file_with_encoding($fullfile, $encoding), $preamble,$filename,$encoding);
- $replacement = remove_endinput($replacement);
+ $replacement=flatten(read_file_with_encoding($fullfile, $encoding), $preamble,$filename,$encoding);
+ $replacement = remove_endinput($replacement);
# \include always starts a new page; use explicit \newpage command to simulate this
} else {
# if file does not exist, do not expand include or input command (do not warn if fname contains #[0-9] as it is then likely part of a command definition
- # and is not meant to be expanded directly
+ # and is not meant to be expanded directly
print STDERR "WARNING: Could not find included file ",$fullfile,". I will continue but not expand |$inputcmd|\n" unless $fname =~ m(#[0-9]) ;
$replacement = $inputcmd ; # i.e. just the original command again -> make no change file does not exist
$newpage="";
@@ -2065,7 +2095,7 @@ sub flatten {
}/exgm;
# replace bibliography with bbl file if it exists
- $text=~s/(^(?:[^%\n]|\\%)*)\\bibliography\{(.*?)\}/{
+ $text=~s/(^(?:[^%\n]|\\%)*)\\bibliography\{(.*?)\}/{
if ( -f $bblfile ){
$replacement=read_file_with_encoding(File::Spec->catfile($bblfile), $encoding);
} else {
@@ -2077,10 +2107,10 @@ sub flatten {
}/exgm;
# replace subfile with contents (subfile package)
- $text=~s/(^(?:[^%\n]|\\%)*)\\subfile\{(.*?)\}/{
+ $text=~s/(^(?:[^%\n]|\\%)*)\\subfile\{(.*?)\}/{
$begline=(defined($1)? $1 : "") ;
- $fname = $2;
- # # add tex extension unless there is a three or four letter extension already
+ $fname = $2;
+ # # add tex extension unless there is a three or four letter extension already
$fname .= ".tex" unless $fname =~ m|\.\w{3,4}|;
print STDERR "Include file as subfile $fname\n" if $verbose;
# content of file becomes replacement value (use recursion)
@@ -2091,10 +2121,10 @@ sub flatten {
# if file exists, expand \subfile command by contents of file
$subfile=read_file_with_encoding($fullfile,$encoding) or die "Could not open included subfile ",$fullfile,": $!";
($subpreamble,$subbody,$subpost)=splitdoc($subfile,'\\\\begin\{document\}','\\\\end\{document\}');
- ### $subfile=~s|^.*\\begin{document}||s;
+ ### $subfile=~s|^.*\\begin{document}||s;
### $subfile=~s|\\end{document}.*$||s;
$replacement=flatten($subbody, $preamble,$fullfile,$encoding);
- ### $replacement = remove_endinput($replacement);
+ ### $replacement = remove_endinput($replacement);
} else {
# if file does not exist, do not expand subfile
print STDERR "WARNING: Could not find subfile ",$fullfile,". I will continue but not expand |$2|\n" unless $fname =~ m(#[0-9]) ;
@@ -2105,11 +2135,11 @@ sub flatten {
}/exgm;
# replace \verbatiminput and \lstlistinginput
- $text=~s/(^(?:[^%\n]|\\%)*)\\(verbatiminput\*?|lstinputlisting)$extraspace(\[$brat_n\])?$extraspace\{(.*?)\}/{
+ $text=~s/(^(?:[^%\n]|\\%)*)\\(verbatiminput\*?|lstinputlisting)$extraspace(\[$brat_n\])?$extraspace\{(.*?)\}/{
$begline=(defined($1)? $1 : "") ;
$command = $2 ;
$fname = $4 ;
- $verboptions = defined($3)? $3 : "" ;
+ $verboptions = defined($3)? $3 : "" ;
if ($command eq 'verbatiminput' ) {
$verbenv = "verbatim" ;
} elsif ($command eq 'verbatiminput*' ) {
@@ -2118,7 +2148,7 @@ sub flatten {
$verbenv = "lstlisting" ;
} else {
die "Internal errorL Unexpected verbatim input type $command.\n";
- }
+ }
print STDERR "DEBUG Beg of line match |$begline|\n" if $debug ;
print STDERR "Include file $fname verbatim\n" if $verbose;
print STDERR "DEBUG looking for file ",File::Spec->catfile($dirname,$fname), "\n" if $debug;
@@ -2150,8 +2180,8 @@ sub print_regex_arr {
# if $type is a filename, it will read the file instead of reading from the appendix
# otherwise it will screen appendix for line "%DIF $TYPE" and copy everything up to line
# '%DIF END $TYPE' (where $TYPE is upcased version of $type)
-# extrapream('-nofail',$type) will---instead of failing---simply return nothing if
-# it does not find the matching line in a appendix (do not use -nofail option with multiple types!)
+# extrapream('-nofail',$type) will---instead of failing---simply return nothing if
+# it does not find the matching line in appendix (do not use -nofail option with multiple types!)
sub extrapream {
my @types=@_;
my ($type,$arg);
@@ -2168,14 +2198,20 @@ sub extrapream {
$type=$arg;
$copy=0;
if ( -f $type || lc $type eq '/dev/null' ) {
- open (FILE,$type) or die "Cannot open preamble file $type: $!";
print STDERR "Reading preamble file $type\n" if $verbose ;
+ open (FILE,$type) or die "Cannot open preamble file $type: $!";
+ if (defined($encoding)) {
+ binmode(FILE,":encoding($encoding)");
+ } else {
+ require Encode::Locale;
+ binmode(FILE,":encoding(locale)");
+ }
while (<FILE>) {
chomp ;
if ( $_ =~ m/%DIF PREAMBLE/ ) {
- push (@retval,"$_");
+ push (@retval,"$_");
} else {
- push (@retval,"$_ %DIF PREAMBLE");
+ push (@retval,"$_ %DIF PREAMBLE");
}
}
} else { # not (-f $type)
@@ -2187,9 +2223,9 @@ sub extrapream {
my $data_start = tell DATA;
while (<DATA>) {
if ( m/^%DIF $type/ ) {
- $copy=1;
+ $copy=1;
} elsif ( m/^%DIF END $type/ ) {
- last;
+ last;
}
chomp;
push (@retval,"$_ %DIF PREAMBLE") if $copy;
@@ -2229,7 +2265,7 @@ sub splitdoc {
$pos=pos $rest;
$part2=substr($rest,0,$pos-length($2));
$part3=substr($rest,$pos);
- }
+ }
else {
die "$word1 and $word2 not in the correct order or not present as a pair." ;
}
@@ -2301,7 +2337,7 @@ sub splitlatex {
my $leadin=$1;
length($string)>0 or return ($leadin);
- my @retval=($string =~ m/$pat/osg);
+ my @retval=($string =~ m/$pat/osg);
if (length($string) != length(join("",@retval))) {
print STDERR "\nWARNING: Inconsistency in length of input string and parsed string:\n This often indicates faulty or non-standard latex code.\n In many cases you can ignore this and the following warning messages.\n Note that character numbers in the following are counted beginning after \\begin{document} and are only approximate." unless $ignorewarnings;
@@ -2345,17 +2381,17 @@ sub splitlatex {
# pass1( \@seq1,\@seq2)
# Look for differences between seq1 and seq2.
-# Where an common-subsequence block is flanked by deleted or appended blocks,
+# Where an common-subsequence block is flanked by deleted or appended blocks,
# and is shorter than $MINWORDSBLOCK words it is appended
-# to the last deleted or appended word. If the block contains tokens other than words
+# to the last deleted or appended word. If the block contains tokens other than words
# or punctuation it is not merged.
# Deleted or appended block consisting of words and safe commands only are
# also merged, to prevent break-up in pass2 (after previous isolated words have been removed)
-# If there are commands with textual arguments (e.g. \caption) both in corresponding
-# appended and deleted blocks split them such that the command and opening bracket
-# are one token, then the rest is split up following standard rules, and the closing
+# If there are commands with textual arguments (e.g. \caption) both in corresponding
+# appended and deleted blocks split them such that the command and opening bracket
+# are one token, then the rest is split up following standard rules, and the closing
# bracket is a separate token, ie. turn
-# "\caption{This is a textual argument}" into
+# "\caption{This is a textual argument}" into
# ("\caption{","This ","is ","a ","textual ","argument","}")
# No return value. Destructively changes sequences
sub pass1 {
@@ -2384,15 +2420,15 @@ sub pass1 {
my $adddiscard = sub {
if ($cnt > 0 ) {
$matblkcnt++;
- # just after an unchanged block
+ # just after an unchanged block
# print STDERR "Unchanged block $cnt, $last1,$last2 \n";
- if ($cnt < $MINWORDSBLOCK
+ if ($cnt < $MINWORDSBLOCK
&& $cnt==scalar (
- grep { /^$wpat/ || ( /^\\((?:[`'^"~=.]|[\w\d@*]+))((?:\[$brat_n\]|\{$pat_n\})*)/o
- && iscmd($1,\@SAFECMDLIST,\@SAFECMDEXCL)
+ grep { /^$wpat/ || ( /^\\((?:[`'^"~=.]|[\w\d@*]+))((?:\[$brat_n\]|\{$pat_n\})*)/o
+ && iscmd($1,\@SAFECMDLIST,\@SAFECMDEXCL)
&& scalar(@dummy=split(" ",$2))<3 ) }
@$block) ) {
- # merge identical blocks shorter than $MINWORDSBLOCK
+ # merge identical blocks shorter than $MINWORDSBLOCK
# and only containing ordinary words
# with preceding different word
# We cannot carry out this merging immediately as this
@@ -2400,23 +2436,23 @@ sub pass1 {
# the algorithm, instead we store in @$todo where we have to merge
push(@$todo, [ $last1,$last2,$cnt,@$block ]);
}
- $block = [];
+ $block = [];
$cnt=0; $last1=-1; $last2=-1;
}
};
my $discard=sub { $deltokcnt++;
&$adddiscard; #($_[0],$_[1]);
push(@$delblock,[ $seq1->[$_[0]],$_[0] ]);
- $last1=$_[0] };
+ $last1=$_[0] };
my $add = sub { $addtokcnt++;
&$adddiscard; #($_[0],$_[1]);
push(@$addblock,[ $seq2->[$_[1]],$_[1] ]);
- $last2=$_[1] };
+ $last2=$_[1] };
my $match = sub { $mattokcnt++;
if ($cnt==0) { # first word of matching sequence after changed sequence or at beginning of word sequence
- $deltextblocks = extracttextblocks($delblock);
+ $deltextblocks = extracttextblocks($delblock);
$delblkcnt++ if scalar @$delblock;
$addtextblocks = extracttextblocks($addblock);
$addblkcnt++ if scalar @$addblock;
@@ -2432,7 +2468,7 @@ sub pass1 {
### Algorithm::Diff 1.19
$matchindex=Algorithm::Diff::_longestCommonSubsequence($delcmds,$addcmds, 0, sub { $_[0]->[0] } );
} else {
- ### Algorithm::Diff 1.15
+ ### Algorithm::Diff 1.15
$matchindex=Algorithm::Diff::_longestCommonSubsequence($delcmds,$addcmds, sub { $_[0]->[0] } );
}
@@ -2463,11 +2499,11 @@ sub pass1 {
my ($index,$block,$cnt)=@{ shift(@$addtextblocks) };
push(@$todo, [-1,$index,$cnt,@$block]);
}
-
+
$addblock=[];
$delblock=[];
}
- push(@$block,$seq2->[$_[1]]);
+ push(@$block,$seq2->[$_[1]]);
$cnt++ };
my $keyfunc = sub { join(" ",split(" ",shift())) };
@@ -2475,7 +2511,7 @@ sub pass1 {
traverse_sequences($seq1,$seq2, { MATCH=>$match, DISCARD_A=>$discard, DISCARD_B=>$add }, $keyfunc );
- # now carry out the merging/splitting. Refer to elements relative from
+ # now carry out the merging/splitting. Refer to elements relative from
# the end (with negative indices) as these offsets don't change before the instruction is executed
# cnt>0: merged small unchanged groups with previous changed blocks
# cnt==-1: split textual commands into components
@@ -2490,7 +2526,7 @@ sub pass1 {
}
}
- if ($verbose) {
+ if ($verbose) {
print STDERR "\n";
print STDERR " $mattokcnt matching tokens in $matblkcnt blocks.\n";
print STDERR " $deltokcnt discarded tokens in $delblkcnt blocks.\n";
@@ -2500,10 +2536,10 @@ sub pass1 {
# extracttextblocks(\@blockindex)
-# $blockindex has the following format
-# [ [ token1, index1 ], [token2, index2],.. ]
-# where index refers to the index in the original old or new word sequence
-# Returns: reference to an array of the form
+# $blockindex has the following format
+# [ [ token1, index1 ], [token2, index2],.. ]
+# where index refers to the index in the original old or new word sequence
+# Returns: reference to an array of the form
# [[ $index, $textblock, $cnt ], ..
# where $index index of block to be merged
# $textblock contains all the words to be merged with the word at $index (but does not contain this word)
@@ -2511,7 +2547,7 @@ sub pass1 {
#
# requires: iscmd
#
-sub extracttextblocks {
+sub extracttextblocks {
my $block=shift;
my ($i,$token,$index);
my $textblock=[];
@@ -2521,13 +2557,13 @@ sub extracttextblocks {
# we redefine locally $extraspace (shadowing the global definition) to capture command sequences with intervening spaces no matter what the global setting
# this is done so we can capture those commands with a predefined number of arguments without having to introduce them again explicitly here
- my $extraspace='\s*';
+ my $extraspace='\s*';
for ($i=0;$i< scalar @$block;$i++) {
($token,$index)=@{ $block->[$i] };
# store pure text blocks
- if ($token =~ /$wpat/ || ( $token =~/^\\((?:[`'^"~=.]|[\w\d@\*]+))((?:${extraspace}\[$brat_n\]${extraspace}|${extraspace}\{$pat_n\})*)/
- && iscmd($1,\@SAFECMDLIST,\@SAFECMDEXCL)
+ if ($token =~ /$wpat/ || ( $token =~/^\\((?:[`'^"~=.]|[\w\d@\*]+))((?:${extraspace}\[$brat_n\]${extraspace}|${extraspace}\{$pat_n\})*)/
+ && iscmd($1,\@SAFECMDLIST,\@SAFECMDEXCL)
&& !iscmd($1,\@TEXTCMDLIST,\@TEXTCMDEXCL))) {
# we have text or a command which can be treated as text
if ($last<0) {
@@ -2535,7 +2571,7 @@ sub extracttextblocks {
$last=$index;
} else {
# add to pure-text block
- push(@$textblock, $token);
+ push(@$textblock, $token);
}
} else {
# it is not text
@@ -2556,29 +2592,29 @@ sub extracttextblocks {
# extractcommands( \@blockindex )
-# $blockindex has the following format
-# [ [ token1, index1 ], [token2, index2],.. ]
-# where index refers to the index in the original old or new word sequence
-# Returns: reference to an array of the form
-# [ [ "\cmd1", index, "\cmd1[optarg]{arg1}{", "arg2" ,"} " ],..
-# where index is just taken from input array
-# command must have a textual argument as last argument
-#
-# requires: iscmd
-#
-sub extractcommands {
+# $blockindex has the following format
+# [ [ token1, index1 ], [token2, index2],.. ]
+# where index refers to the index in the original old or new word sequence
+# Returns: reference to an array of the form
+# [ [ "\cmd1", index, "\cmd1[optarg]{arg1}{", "arg2" ,"} " ],..
+# where index is just taken from input array
+# command must have a textual argument as last argument
+#
+# requires: iscmd
+#
+sub extractcommands {
my $block=shift;
my ($i,$token,$index,$cmd,$open,$mid,$closing);
my $retval=[];
# we redefine locally $extraspace (shadowing the global definition) to capture command sequences with intervening spaces no matter what the global setting
# this is done so we can capture those commands with a predefined number of arguments without having to introduce them again explicitly here
- my $extraspace='\s*';
+ my $extraspace='\s*';
for ($i=0;$i< scalar @$block;$i++) {
($token,$index)=@{ $block->[$i] };
# check if token is an alphanumeric command sequence with at least one non-optional argument
- # \cmd[...]{...}{last argument}
+ # \cmd[...]{...}{last argument}
# Capturing in the following results in these associations
# $1: \cmd[...]{...}{
# $2: \cmd
@@ -2586,7 +2622,7 @@ sub extractcommands {
# $4: } + trailing spaces
if ( ( $token =~ m/^(\\([\w\d\*]+)(?:${extraspace}\[$brat_n\]|${extraspace}\{$pat_n\})*${extraspace}\{)($pat_n)(\}\s*)$/so )
&& iscmd($2,\@TEXTCMDLIST,\@TEXTCMDEXCL) ) {
- print STDERR "DEBUG EXTRACTCOMMANDS Match |$1|$2|$3|$4|$index \n" if $debug;
+ print STDERR "DEBUG EXTRACTCOMMANDS Match |$1|$2|$3|$4|$index \n" if $debug;
# push(@$retval,[ $2,$index,$1,$3,$4 ]);
($cmd,$open,$mid,$closing) = ($2,$1,$3,$4) ;
$closing =~ s/\}/\\RIGHTBRACE/ ;
@@ -2597,7 +2633,7 @@ sub extractcommands {
}
# iscmd($cmd,\@regexarray,\@regexexcl) checks
-# return 1 if $cmd matches any of the patterns in the
+# return 1 if $cmd matches any of the patterns in the
# array $@regexarray, and none of the patterns in \@regexexcl, otherwise return 0
sub iscmd {
my ($cmd,$regexar,$regexexcl)=@_;
@@ -2605,7 +2641,7 @@ sub iscmd {
### print STDERR "DEBUG: iscmd($cmd)=" if $debug;
foreach $pat ( @$regexar ) {
if ( $cmd =~ m/^${pat}$/ ) {
- $ret=1 ;
+ $ret=1 ;
last;
}
}
@@ -2621,13 +2657,13 @@ sub iscmd {
# pass2( \@seq1,\@seq2)
-# Look for differences between seq1 and seq2.
+# Look for differences between seq1 and seq2.
# Mark begin and end of deleted and appended sequences with tags $DELOPEN and $DELCLOSE
# and $ADDOPEN and $ADDCLOSE, respectively, however exclude { } & and all comands, unless
# they match an element of the whitelist (SAFECMD)
# For words in TEXTCMD but not in SAFECMD, enclose interior with $ADDOPEN and $ADDCLOSE brackets
-# Deleted comment lines are marked with %DIF <
-# Added comment lines are marked with %DIF >
+# Deleted comment lines are marked with %DIF <
+# Added comment lines are marked with %DIF >
sub pass2 {
my $seq1 = shift ;
my $seq2 = shift ;
@@ -2659,7 +2695,7 @@ sub pass2 {
$addhunk = [];
}
push(@$retval,$seq2->[$_[1]]) };
-
+
my $keyfunc = sub { join(" ",split(" ",shift())) };
traverse_sequences($seq1,$seq2, { MATCH=>$match, DISCARD_A=>$discard, DISCARD_B=>$add }, $keyfunc );
@@ -2668,7 +2704,7 @@ sub pass2 {
push @$retval,marktags($ADDMARKOPEN,$ADDMARKCLOSE,$ADDOPEN,$ADDCLOSE,"","",$ADDCOMMENT,$addhunk) if scalar @$addhunk;
- if ($verbose) {
+ if ($verbose) {
print STDERR "\n";
print STDERR " $mattokcnt matching tokens. \n";
print STDERR " $deltokcnt discarded tokens in $delblkcnt blocks.\n";
@@ -2690,7 +2726,7 @@ sub marktags {
my (@argtext);
my $retval=[];
my $noncomment=0;
- my $cmd=-1; # -1 at beginning 0: last token written is a ordinary word
+ my $cmd=-1; # -1 at beginning 0: last token written is a ordinary word
# 1: last token written is a command
# for keeping track whether we are just in a command sequence or in a word sequence
my $cmdcomment= ($opencmd =~ m/^%/); # Flag to indicate whether opencmd is a comment (i.e. if we intend to simply comment out changed commands)
@@ -2706,31 +2742,31 @@ sub marktags {
# we redefine locally $extraspace (shadowing the global definition) to capture command sequences with intervening spaces no matter what the global setting
# this is done so we can capture those commands with a predefined number of arguments without having to introduce them again explicitly here
- my $extraspace_mt='\s*';
+ my $extraspace_mt='\s*';
foreach (@$block) {
- $word=$_;
+ $word=$_;
if ( $word =~ s/^%/%$comment/ ) {
# a comment
if ($cmd==1) {
push (@$retval,$closecmd) ;
$cmd=-1;
}
- push (@$retval,$word);
+ push (@$retval,$word);
next;
}
if ( $word =~ m/^\s*$/ ) {
### print STDERR "DEBUG MARKTAGS: whitespace detected |$word| cmdcom |$cmdcomment| |$opencmd|\n" if $debug;
# a sequence of white-space characters - this should only ever happen for the first element of block.
- # in deleted block, omit, otherwise just copy it in
+ # in deleted block, omit, otherwise just copy it in
if ( ! $cmdcomment) { # ignore in deleted blocks
push(@$retval,$word);
}
next;
}
if (! $noncomment) {
- push (@$retval,$openmark);
+ push (@$retval,$openmark);
$noncomment=1;
}
# negative lookahead pattern (?!) in second clause is put in to avoid matching \( .. \) patterns
@@ -2740,7 +2776,7 @@ sub marktags {
# word is a command or other significant token (not in SAFECMDLIST)
## same conditions as in subroutine extractcommand:
# check if token is an alphanumeric command sequence with at least one non-optional argument
- # \cmd[...]{...}{last argument}
+ # \cmd[...]{...}{last argument}
# Capturing in the following results in these associations
# $1: \cmd[...]{...}{
# $2: cmd
@@ -2757,11 +2793,11 @@ sub marktags {
# Condition 3: But if we are in a deleted block ($cmdcomment=1) and
# $2 (the command) is in context2, just treat it as an ordinary command (i.e. comment it open with $opencmd)
# Because we do not want to disable this command
- # here we do not use $opencmd and $closecmd($opencmd is empty)
+ # here we do not use $opencmd and $closecmd($opencmd is empty)
print STDERR "DEBUG: Detected text |$word| but not safe command \$2: $2 \$3: $3\n." if $debug;
if ($cmd==1) {
push (@$retval,$closecmd) ;
- } elsif ($cmd==0) {
+ } elsif ($cmd==0) {
push (@$retval,$close) ;
}
$command=$1; $commandword=$2; $closingbracket=$4;
@@ -2777,16 +2813,16 @@ sub marktags {
# for latexrevise
push (@$retval,$command,"%\n{$AUXCMD\n",marktags("","",$open,$close,$opencmd,$closecmd,$comment,\@argtext),$closingbracket);
} elsif ( iscmd($commandword,,\@MATHTEXTCMDLIST, \@MATHTEXTCMDEXCL) ) {
- # MATHBLOCK pseudo command: consider all commands safe, except & and \\, \begin and \end and a few package sprcific one (look at UNSAFEMATHCMD definition)
- # Keep these commands even in deleted blocks, hence set $opencmd and $closecmd (5th and 6th argument of marktags) to
+ # MATHBLOCK pseudo command: consider all commands safe, except & and \\, \begin and \end and a few package sprcific one (look at UNSAFEMATHCMD definition)
+ # Keep these commands even in deleted blocks, hence set $opencmd and $closecmd (5th and 6th argument of marktags) to
# ""
- local @SAFECMDLIST=(".*");
+ local @SAFECMDLIST=(".*");
local @SAFECMDEXCL=('\\','\\\\',@UNSAFEMATHCMD);
push(@$retval,$command,marktags("","",$open,$close,"","",$comment,\@argtext)#@argtext
,$closingbracket);
} else {
# normal textcmd or context1cmd in an added block
- push (@$retval,$command,marktags("","",$open,$close,$opencmd,$closecmd,$comment,\@argtext),$closingbracket);
+ push (@$retval,$command,marktags("","",$open,$close,$opencmd,$closecmd,$comment,\@argtext),$closingbracket);
}
push (@$retval,$AUXCMD,"\n") if $cmdcomment ;
$cmd=-1 ;
@@ -2872,10 +2908,10 @@ sub take_comments_and_newline_from_frac() {
# names or labels but it does not matter because they are converted back in the postprocessing step
# Returns: leading white space removed in step 1
sub preprocess {
- for (@_) {
+ for (@_) {
- # change in \verb and similar commands - note that I introduce an extra space here so that the
+ # change in \verb and similar commands - note that I introduce an extra space here so that the
# already hashed variants do not trigger again
# transform \lstinline{...}
# s/\\lstinline(\[$brat0\])?(\{(?:.*?)\})/"\\DIFlstinline". $1 ."{". tohash(\%verbhash,"$2") ."}"/esg;
@@ -2905,7 +2941,7 @@ sub preprocess {
1 while s/(?<!\\)_(\s*{($pat_n)})/\\SUBSCRIPT$1/g ;
# Convert ^n into \SUPERSCRIPTNB{n} and ^{nnn} into \SUPERSCRIPT{nn}
1 while s/(?<!\\)\^(\s*([^{\\\s]|\\\w+))/\\SUPERSCRIPTNB{$1}/g ;
- 1 while s/(?<!\\)\^(\s*{($pat_n)})/\\SUPERSCRIPT$1/g ;
+ 1 while s/(?<!\\)\^(\s*{($pat_n)})/\\SUPERSCRIPT$1/g ;
# Convert \sqrt{n} into \SQRT{n} and \sqrt nn into SQRTNB{nn}
1 while s/(?<!\\)\\sqrt(\s*([^{\\\s]|\\\w+))/\\SQRTNB{$1}/g ;
1 while s/(?<!\\)\\sqrt(\s*{($pat_n)})/\\SQRT$1/g ;
@@ -2925,16 +2961,16 @@ sub preprocess {
if ( $mathmarkup != FINE ) {
# DIFANCHORARRB and DIFANCHORARRE, DIFANCHORMATHB and DIFANCHORMATHE markers are inserted here to encourage the matching algorithm
# to always match up the closing brace. Otherwise sometimes one ends up with a situation where
- # the closing brace is deleted and added at another point. The deleted closing brace is then
+ # the closing brace is deleted and added at another point. The deleted closing brace is then
# prevented by a %DIFDELCMD, leading to material leaking in or out of the math environment.
# The anchors are removed in post-processing again. (note that they are simple text to cause least amount of complications
- # Admittedly, this is something of a hack and will not always work. If it does not, then one needs to
+ # Admittedly, this is something of a hack and will not always work. If it does not, then one needs to
# resort to WHOLE or FINE, or NONE math mode processing.
s/\\begin\{($ARRENV)}(.*?)\\end\{\1}/\\ARRAYBLOCK$1\{$2\\DIFANCHORARRB \}\\DIFANCHORARRE /sg;
take_comments_and_newline_from_frac();
- # Convert Math environments with arguments
+ # Convert Math environments with arguments
s/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)\}((?:\[$brat_n\])|(?:\{$pat_n\}))+(.*?)\\end\{\1\}/\\MATHBLOCK$1\[$2\]\{$3\\DIFANCHORMATHB \}\\DIFANCHORMATHE /sg;
# Convert Math environments without arguments
s/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)\}(.*?)\\end\{\1\}/\\MATHBLOCK$1\{$2\\DIFANCHORMATHB \}\\DIFANCHORMATHE /sg;
@@ -2948,7 +2984,7 @@ sub preprocess {
# $expanded=linecomment($string)
#preface all lines with verbatim marker (usually DIFVRB)
-sub linecomment {
+sub linecomment {
my @verbatimlines=split("\n",$_[0]);
# the first line needs special treatment - we do want to retain optional arguments as is but wrap the remainder also with VERBCOMMENT
### print STDERR "DEBUG: before verbatimlines[0] = ",$verbatimlines[0],"\n";
@@ -2958,7 +2994,7 @@ sub linecomment {
}
# $simple=reverselinecomment($env $string)
-# remove DIFVRB comments but leave changed lines marked
+# remove DIFVRB comments but leave changed lines marked
sub reverselinecomment {
my ($environment, $verbatimtext)=@_;
### print STDERR "DEBUG REVERSELINECOMMENT input: $environment,|$verbatimtext|\n" if $debug;
@@ -2973,7 +3009,7 @@ sub reverselinecomment {
$verbatimtext =~ s/\\DIFdelend //g;
$verbatimtext =~ s/$DELCMDOPEN.*//g;
- # remove DIFVRB mark
+ # remove DIFVRB mark
$verbatimtext=~ s/%$VERBCOMMENT//g;
# remove part of the markup in changed lines
@@ -3064,7 +3100,7 @@ sub writedebugfile {
# * Remove STOP token from the end
# * Replace \RIGHTBRACE by }
# * If option --no-del is set delete all deleted blocks
-# 1. Check all deleted blocks:
+# 1. Check all deleted blocks:
# a.where a deleted block contains a matching \begin and
# \end environment (these will be disabled by a %DIFDELCMD statements), for selected environments enable
# these commands again (such that for example displayed math in a deleted equation
@@ -3085,14 +3121,14 @@ sub writedebugfile {
# For added blocks:
# c. If in-line math mode contains array environment, enclose the whole environment in \mbox'es
# d. place \cite commands in mbox'es (for UNDERLINE style)
-#
+#
# 2. If math-mode COARSE,WHOLE or NONE option set: Convert \MATHBLOCKmath{..} commands back to environments
#
# Convert all PICTUREblock{..} commands back to the appropriate environments
# 3. Convert DIFadd, DIFdel, DIFaddbegin , ... into FL varieties
# within floats (currently recognised float environments: plate,table,figure
# plus starred varieties).
-# 4. Remove empty %DIFDELCMD < lines
+# 4. Remove empty %DIFDELCMD < lines
# 4. Convert \begin{SQUAREBRACKET} \end{SQUAREBRACKET} into \[ \]
# Convert \begin{DOLLARDOLLAR} \end{DOLLARDOLLAR} into $$ $$
# 5. Convert \SUPERSCRIPTNB{n} into ^n and \SUPERSCRIPT{nn} into ^{nnn}
@@ -3105,7 +3141,7 @@ sub writedebugfile {
# 4, undo renaming of the \begin, \end,{,} in comments
# Change \QLEFTBRACE, \QRIGHTBRACE,\AMPERSAND to \{,\},\&
#
-# Note have to manually synchronize substitution commands below and
+# Note have to manually synchronize substitution commands below and
# DIF.. command names in the header
sub postprocess {
my ($begin,$len,$float,$delblock,$addblock); ### $cnt
@@ -3117,7 +3153,7 @@ sub postprocess {
my (@itemargs, $itemarg);
- for (@_) {
+ for (@_) {
# change $'s in comments to something harmless
1 while s/(%.*)\$/$1DOLLARDIF/mg ;
@@ -3127,7 +3163,7 @@ sub postprocess {
# the only way to get these is as %DIFDELCMD < \RIGHTBRACE construction
# This essentially marks closing right braces of MATHBLOCK environments, which did not get matched
# up. This case should be rare, so I just leave this in the diff file output. Not really elegant
- # but can still be dealt with later if it results in problems.
+ # but can still be dealt with later if it results in problems.
s/%DIFDELCMD < \\RIGHTBRACE/%DIFDELCMD < \\MBLOCKRIGHTBRACE/g ;
# Replace \RIGHTBRACE by }
s/\\RIGHTBRACE/}/g;
@@ -3155,7 +3191,7 @@ sub postprocess {
$len=length($&);
$begin=pos($_) - $len;
$delblock=$&;
- ### A much simpler method for math replacement might follow this strategy (can recycle part of the commands below for following
+ ### A much simpler method for math replacement might follow this strategy (can recycle part of the commands below for following
### this strategy:
### 1. a Insert aux commands \begin{MATHMODE} or \end{MATHMODE} for all deleted commands opening or closing displayed math mode
### b Insert aux commands \begin{MATHARRMODE} or \end{MATHARRMODE} for all deleted commands opening or closing math array mode
@@ -3181,14 +3217,14 @@ sub postprocess {
###0.5: $delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \s*\\end\{((?:$MATHENV)|SQUAREBRACKET)\}\s*?(?:$DELCMDCLOSE|\n))(.*?[^\n]?)\n?(?<!${AUXCMD}\n)(\%DIFDELCMD < \s*\\begin\{\2\})/\\end{MATHMODE}$AUXCMD\n$1$3\n\\begin{MATHMODE}$AUXCMD\n$4/sg;
$delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\end\{((?:$MATHENV)|SQUAREBRACKET)\}.*?(?:$DELCMDCLOSE|\n))(.*?[^\n]?)\n?(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\begin\{\2\})/\\end\{MATHMODE\}$AUXCMD\n$1$3\n\\begin\{MATHMODE\}$AUXCMD\n$4/sg;
- # now look for unpaired %DIFDELCMD < \begin{MATHENV}; if found add \begin{$MATHREPL} and insert \end{$MATHREPL}
+ # now look for unpaired %DIFDELCMD < \begin{MATHENV}; if found add \begin{$MATHREPL} and insert \end{$MATHREPL}
# just before end of block; again we use look-behind assertion to avoid matching constructions which have already been converted
if ($delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\begin\{((?:$MATHENV)|SQUAREBRACKET)\}\s*?(?:$DELCMDCLOSE|\n))/$1\\begin{$MATHREPL}$AUXCMD\n/sg ) {
### print STDERR "BINGO: begin block: \nBefore: |" . substr($_,$begin,$len) . "|\n" if $debug ;
$delblock =~ s/(\\DIFdelend$)/\\end{$MATHREPL}$AUXCMD\n$1/s ;
### print STDERR "After: |" . $delblock . "|\n\n" if $debug ;
}
- # now look for unpaired %DIFDELCMD < \end{MATHENV}; if found add \end{MATHMODE} and insert \begin{MATHMODE}
+ # now look for unpaired %DIFDELCMD < \end{MATHENV}; if found add \end{MATHMODE} and insert \begin{MATHMODE}
# just before end of block; again we use look-behind assertion to avoid matching constructions which have already been converted
if ($delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\end\{((?:$MATHENV)|SQUAREBRACKET)\}\s*?(?:$DELCMDCLOSE|\n))/$1\\end\{MATHMODE\}$AUXCMD\n/sg ) {
### print STDERR "BINGO: end block:\nBefore: |" . substr($_,$begin,$len) . "|\n" if $debug;
@@ -3211,15 +3247,15 @@ sub postprocess {
$delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\end\{($MATHARRENV)\}\s*?(?:$DELCMDCLOSE|\n))(.*?[^\n]?)\n?(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\begin\{\2\})/\\end{MATHMODE}$AUXCMD\n$1$3\n\\begin{MATHMODE}$AUXCMD\n$4/sg;
### print STDERR "STEP1: |" . $delblock . "|\n\n" if $debug ;
- # now look for unpaired %DIFDELCMD < \begin{MATHARRENV}; if found add \begin{$MATHARRREPL} and insert \end{$MATHARRREPL}
+ # now look for unpaired %DIFDELCMD < \begin{MATHARRENV}; if found add \begin{$MATHARRREPL} and insert \end{$MATHARRREPL}
# just before end of block; again we use look-behind assertion to avoid matching constructions which have already been converted
if ($delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\begin\{($MATHARRENV)\}(.*?)(?:$DELCMDCLOSE|\n))/$1\\begin{$2*}$3$AUXCMD\n/sg ) {
$arrenv=$2;
- $delblock =~ s/(\\DIFdelend$)/\\end{$arrenv*}}$AUXCMD\n$1/s ;
+ $delblock =~ s/(\\DIFdelend$)/\\end{$arrenv*}$AUXCMD\n$1/s ;
}
### print STDERR "STEP2: |" . $delblock . "|\n\n" if $debug ;
- # now look for unpaired %DIFDELCMD < \end{MATHENV}; if found add \end{MATHMODE} and insert \begin{MATHMODE}
+ # now look for unpaired %DIFDELCMD < \end{MATHENV}; if found add \end{MATHMODE} and insert \begin{MATHMODE}
# just before end of block; again we use look-behind assertion to avoid matching constructions which have already been converted
if ($delblock=~ s/(?<!${AUXCMD}\n)(\%DIFDELCMD < \h*\\end\{($MATHARRENV)\}\s*?(?:$DELCMDCLOSE|\n))/$1\\end{MATHMODE}$AUXCMD\n/sg ) {
$delblock =~ s/(\\DIFdelend$)/\\begin{MATHMODE}$AUXCMD\n$1/s ;
@@ -3237,7 +3273,7 @@ sub postprocess {
### $eqarrayblock=~ s/(\%DIFDELCMD < \s*(\&|\\\\)\s*?(?:$DELCMDCLOSE|\n))/$1$2$AUXCMD\n/sg ;
$eqarrayblock =~ s/(\%DIFDELCMD < (.*?(?:\&|\\\\).*)(?:$DELCMDCLOSE|\n))/
# The pattern captures comments with at least one of & or \\
- @symbols= split(m@((?:&|\\\\)\s*)@,$2); # extract & and \\ and other material from sequence
+ @symbols= split(m@((?:&|\\\\)\s*)@,$2); # extract & and \\ and other material from sequence
@symbols= grep ( m@&|\\\\\s*@, @symbols); # select & and \\ (and subsequent spaces)
"$1@symbols$AUXCMD\n"
/eg ;
@@ -3250,7 +3286,7 @@ sub postprocess {
} elsif ( $mathmarkup == COARSE || $mathmarkup == WHOLE ) {
# Convert MATHBLOCKmath commands to their uncounted numbers (e.g. convert equation -> displaymath
# (environments defined in $MATHENV will be replaced by $MATHREPL, and environments in $MATHARRENV
- # will be replaced by their starred variety
+ # will be replaced by their starred variety
$delblock=~ s/\\MATHBLOCK($MATHENV)((?:\[$brat_n\])?)\{($pat_n)\}/\\MATHBLOCK$MATHREPL$2\{$3\}/sg;
$delblock=~ s/\\MATHBLOCK($MATHARRENV)((?:\[$brat_n\])?)\{($pat_n)\}/\\MATHBLOCK$1\*$2\{$3\}/sg;
}
@@ -3264,10 +3300,10 @@ sub postprocess {
print STDERR "DELBLOCK after maths processing: |" . $delblock . "|\n\n" if $debug ;
- # Reinstate completely deleted list environments. note that items within the
+ # Reinstate completely deleted list environments. note that items within the
# environment will still be commented out. They will be restored later
$delblock=~ s/(\%DIFDELCMD < \s*\\begin\{($LISTENV)\}\s*?(?:\n|$DELCMDCLOSE))(.*?)(\%DIFDELCMD < \s*\\end\{\2\})/{
- ### # block within the search; replacement environment
+ ### # block within the search; replacement environment
### "$1\\begin{$2}$AUXCMD\n". restore_item_commands($3). "\n\\end{$2}$AUXCMD\n$4";
"$1\\begin{$2}$AUXCMD\n$3\n\\end{$2}$AUXCMD\n$4";
}/esg;
@@ -3301,7 +3337,7 @@ sub postprocess {
### if ($CITE2CMD) {
###### ${extraspace}(?:\[$brat0\]${extraspace}){0,2}\{$pat_n\})) .*?%%%\n
### $delblock=~s/($DELCMDOPEN\s*\\($CITE2CMD)(.*)$DELCMDCLOSE)/
- ### # Replacement code
+ ### # Replacement code
### {my ($aux,$all);
### $aux=$all=$1;
### $aux=~s#\n?($DELCMDOPEN|$DELCMDCLOSE)##g;
@@ -3311,7 +3347,7 @@ sub postprocess {
### if ($CITECMD) {
###### $delblock=~s/(\\($CITECMD)${extraspace}(?:\[$brat0\]${extraspace}){0,2}\{$pat_n\})(\s*)/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/msg ;
### $delblock=~s/(\\($CITECMD)${extraspace}(?:<$abrat0>${extraspace})?(?:\[$brat0\]${extraspace}){0,2}\{$pat_n\})(\s*)/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/msg ;
- ### }
+ ### }
# if MBOXINLINEMATH is set, protect inlined math environments with an extra mbox
@@ -3319,7 +3355,7 @@ sub postprocess {
# note additional \newline after command is omitted from output if right at the end of deleted block (otherwise a spurious empty line is generated)
$delblock=~s/($math)(?:[\s\n]*)?/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/sg;
}
- ###if ( defined($packages{"listings"} and $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{color\}/)) {
+ ###if ( defined($packages{"listings"} and $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{color\}/)) {
### # change included verbatim environments
### $delblock =~ s/\\DIFverb\{/\\DIFDIFdelverb\{/g;
### $delblock =~ s/\\DIFlstinline/\\DIFDIFdellstinline/g;
@@ -3361,7 +3397,7 @@ sub postprocess {
##$addblock=~s/($math)/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/sg;
$addblock=~s/($math)(?:[\s\n]*)?/\\mbox{$AUXCMD\n$1\n}$AUXCMD\n/sg;
}
- ###if ( defined($packages{"listings"} and $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat0\])?\{color\}/)) {
+ ###if ( defined($packages{"listings"} and $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat0\])?\{color\}/)) {
# mark added verbatim commands
$addblock =~ s/\\DIFverb/\\DIFDIFaddverb/g;
$addblock =~ s/\\DIFlstinline/\\DIFDIFaddlstinline/g;
@@ -3379,11 +3415,11 @@ sub postprocess {
pos = $begin + length($addblock);
}
- # Go through whole text, and by counting list environment commands, find out when we are within a list environment.
+ # Go through whole text, and by counting list environment commands, find out when we are within a list environment.
# Within those restore deleted \item commands
- @textparts=split /(?<!$DELCMDOPEN)(\\(?:begin|end)\{$LISTENV\})/ ;
+ @textparts=split /(?<!$DELCMDOPEN)(\\(?:begin|end)\{$LISTENV\})/ ;
@liststack=();
- @newtextparts=map {
+ @newtextparts=map {
### print STDERR ":::::::: $_\n";
if ( ($listtype) = m/^\\begin\{($LISTENV)\}$/ ) {
print STDERR "DEBUG: postprocess \\begin{$listtype}\n" if $debug;
@@ -3399,7 +3435,7 @@ sub postprocess {
} else {
print STDERR "DEBUG: postprocess \@liststack=(",join(",",@liststack),")\n" if $debug;
if (scalar @liststack > 0 ) {
- # we are within a list environment and should replace all item commands
+ # we are within a list environment and should replace all item commands
$_=restore_item_commands($_);
}
# else: we are outside a list environment and do not need to do anything
@@ -3412,17 +3448,17 @@ sub postprocess {
# Replace MATHMODE environments from step 1a above by the correct Math environment and remove unncessary pairings
-
+
if ( $mathmarkup == FINE ) {
# look for AUXCMD math-mode pairs which have only comments (or empty lines between them), and remove the added commands
# \begin{..} ... \end{..} pairs
- s/\\begin\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET|MATHMODE)\}$AUXCMD\n((?:\s*%.[^\n]*\n)*)\\end\{\1\}$AUXCMD\n/$2/sg;
+ s/\\begin\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET|MATHMODE)\}$AUXCMD\n((?:\s*%.[^\n]*\n)*)\\end\{\1\}$AUXCMD\n/$2/sg;
# \end{..} .... \begin{..} pairs
- s/\\end\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET|MATHMODE)\}$AUXCMD\n((?:\s*%.[^\n]*\n)*)\\begin\{\1\}$AUXCMD\n/$2/sg;
+ s/\\end\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET|MATHMODE)\}$AUXCMD\n((?:\s*%.[^\n]*\n)*)\\begin\{\1\}$AUXCMD\n/$2/sg;
writedebugfile($_,'postprocess15');
# The next line is complicated. The negative look-ahead insertion makes sure that no \end{$MATHENV} (or other mathematical
- # environments) are between the \begin{$MATHENV} and \end{MATHMODE} commands. This is necessary as the minimal matching
+ # environments) are between the \begin{$MATHENV} and \end{MATHMODE} commands. This is necessary as the minimal matching
# is not globally minimal but only 'locally' (matching is beginning from the left side of the string)
# [NB: Do not be tempted to prettify the expression with /x modified. It seems this is applied after strings are expanded so will ignore spaces in strings
1 while s/(?<!$DELCMDOPEN)\\begin\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}((?:${DELCMDOPEN}[^\n]*|.(?!(?:\\end\{(?:(?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}|\\begin\{MATHMODE})))*?)\\end\{MATHMODE}/\\begin{$1}$2\\end{$1}/s;
@@ -3497,7 +3533,7 @@ sub postprocess {
# remove empty DIFCMD < lines
s/^\Q${DELCMDOPEN}\E\n//msg;
- # Expand hashes of verb and verbatim environments
+ # Expand hashes of verb and verbatim environments
s/${DELCMDOPEN}\\($VERBATIMENV)\{([-\d]*?)\}/"${DELCMDOPEN}\\begin{${1}}".fromhash(\%verbhash,$2,$DELCMDOPEN)."${DELCMDOPEN}\\end{${1}}"/esg;
# revert changes to verbatim environments for line diffs (and add code to mark up changes) (note negative look behind assertions to not leak out of DIFDELCMD comments)
# Example:
@@ -3523,8 +3559,8 @@ sub postprocess {
((?:\%\Q$DELCOMMENT$VERBCOMMENT\E[^\n]*?\n)*)
# Deleted \end command of verbatim environment. Note that the type is forced to match the opening. Captures: $5: Whole deleted environment (previous way this line was written: (\Q$DELCMDOPEN\E\\end\{\2\}(?:\n|\s|\Q$DELCMDOPEN\E)*\Q$DELCMDCLOSE\E)
(\Q$DELCMDOPEN\E\\end\{\2\})
- / # Substitution part
- $1 # Leave expression as is
+ / # Substitution part
+ $1 # Leave expression as is
. "$AUXCMD NEXT\n" # Mark the following line as an auxiliary command
. "" # reinstate the original environment without options
. reverselinecomment($2, "$3$4") # modify the body to change the markup; reverselinecomment parses for options
@@ -3533,7 +3569,7 @@ sub postprocess {
/esgx; # Modifiers of substitution command
writedebugfile($_,'postprocess2');
# where changes have occurred in verbatim environment, change verbatim to DIFverbatim to allow mark-up
- # (I use the presence of optional paramater to verbatim environment as the marker - normal verbatim
+ # (I use the presence of optional paramater to verbatim environment as the marker - normal verbatim
# environment does not take optional arguments)
s/(?<!$DELCMDOPEN)\\begin\{(verbatim[*]?)\}(\[$brat_n\].*?)\\end\{\1\}/\\begin{DIF$1}$2\\end{DIF$1}/sg;
@@ -3547,7 +3583,7 @@ sub postprocess {
# convert remaining PAR commands (which are preceded by non-white space characters, usually "}" ($ADDCLOSE)
s/\\PAR\n/\n\n/sg;
- # package specific processing:
+ # package specific processing:
if ( defined($packages{"endfloat"})) {
#endfloat: make sure \begin{figure} and \end{figure} are always
# on a line by themselves, similarly for table environment
@@ -3560,12 +3596,16 @@ sub postprocess {
s/^((?:[^%]+)\\(?:begin|end)\{(?:figure|table)\}(?:\[[a-zA-Z]+\])?)(.+)((?:%.*)?)$/$1\n$2$3/mg;
}
- # Convert '\PERCENTAGE ' back into '\%' (the final question mark catches a special situation where due to a latter pre-processing step the ' ' becomes separated
+ # Remove empty auxiliary LISTENV (sometmes these are generated if list environment occurs within the argument of a deleted comment)
+ # (slightly hacky but I could not see an easy way to see if in argument of another command when this extra markup is added)
+ s/\\begin\{($LISTENV)\}$AUXCMD\n((?:\s*\%[^\n]*\n)*\n?)\\end\{\1\}$AUXCMD\n/$2\n/msg ;
+
+ # Convert '\PERCENTAGE ' back into '\%' (the final question mark catches a special situation where due to a latter pre-processing step the ' ' becomes separated
s/\\PERCENTAGE ?/\\%/g;
- # Convert '\DOLLAR ' back into '\$'
+ # Convert '\DOLLAR ' back into '\$'
s/\\DOLLAR /\\\$/g;
- # undo renaming of the \begin and \end,{,} and dollars in comments
+ # undo renaming of the \begin and \end,{,} and dollars in comments
# although we only renamed $ in comments to DOLLARDIFF, we might have lost the % in unchanged verbatim blocks, so rename all
s/DOLLARDIF/\$/g;
@@ -3583,7 +3623,7 @@ sub postprocess {
# Convert \SQRT{n} into \sqrt{n} and \SQRTNB{nn} into \sqrt nn
1 while s/\\SQRT(\s*\{($pat_n)\})/\\sqrt$1/g ;
1 while s/\\SQRTNB\{(\s*$pat0)\}/\\sqrt$1/g ;
-
+
1 while s/(%.*)\\CFRAC (.*)$/$1\\frac$2/mg ;
1 while s/(%.*)\\CRIGHTBRACE (.*)$/$1\}$2/mg ;
1 while s/(%.*)\\CLEFTBRACE (.*)$/$1\{$2/mg ;
@@ -3594,7 +3634,7 @@ sub postprocess {
s/\\QRIGHTBRACE /\\\}/sg;
s/\\AMPERSAND /\\&/sg;
# Highlight added inline verbatim commands if possible
- if ( $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{color\}/ ) {
+ if ( $latexdiffpreamble =~ /\\RequirePackage(?:\[$brat_n\])?\{color\}/ ) {
# wrap added verb commands with color commands
s/\\DIFDIFadd((?:verb\*?|lstinline(?:\[$brat_n\])?)\{[-\d]*?\}[\s\n]*)/\{\\color{blue}$AUXCMD\n\\DIF$1%\n\}$AUXCMD\n/sg;
s/\\DIFDIFdel((?:verb\*?|lstinline(?:\[$brat_n\])?)\{[-\d]*?\}[\s\n]*$AUXCMD)/\{\\color{red}${AUXCMD}\n\\DIF$1\n\}${AUXCMD}/sg;
@@ -3609,8 +3649,8 @@ sub postprocess {
# finally add the comment to the ones not having an optional argument before
###s/\\DIFaddlstinline(?!\[)/\\lstinline\n[basicstyle=\\color{blue}]$AUXCMD\n/g;
- return;
}
+ return;
}
# $out = restore_item_commands($listenviron)
@@ -3634,13 +3674,13 @@ sub restore_item_commands {
# @auxlines=preprocess_preamble($oldpreamble,$newpreamble);
- # pre-process preamble by looking for commands used in \maketitle (title, author, date etc commands)
- # the list of commands is defined in CONTEXT2CMD
- # if found then use a bodydiff to mark up content, and replace the corresponding commands
+ # pre-process preamble by looking for commands used in \maketitle (title, author, date etc commands)
+ # the list of commands is defined in CONTEXT2CMD
+ # if found then use a bodydiff to mark up content, and replace the corresponding commands
# in both preambles by marked up version to 'fool' the linediff (such that only body is marked up).
# A special case are e.g. author commands being added (or removed)
# 1. If commands are added, then the entire content is marked up as new, but also the lines are marked as new in the linediff
- # 2. If commands are removed, then the linediff will mark the line as deleted. The program returns
+ # 2. If commands are removed, then the linediff will mark the line as deleted. The program returns
# with $auxlines a text to be appended at the end of the preamble, which shows the respective fields as deleted
sub preprocess_preamble {
my ($oldpreambleref,$newpreambleref)=(\$_[0],\$_[1]) ;
@@ -3662,7 +3702,7 @@ EOF
$titlecmd = "(?:".join("|",@CONTEXT2CMDLIST).")";
# as context2cmdlist is stored as regex, e.g. ((?-xism:^title$), we need to remove ^- fo
# resue in a more complex regex
- $titlecmd =~ s/[\$\^]//g;
+ $titlecmd =~ s/[\$\^]//g;
# make sure to not match on comment lines:
$titlecmdpat=qr/^(?:[^%\n]|\\%)*(\\($titlecmd)$extraspace(?:\[($brat_n)\])?(?:\{($pat_n)\}))/ms;
###print STDERR "DEBUG:",$titlecmdpat,"\n";
@@ -3688,7 +3728,7 @@ EOF
$cmd=shift @newtitlecommands;
$optarg=shift @newtitlecommands;
$arg=shift @newtitlecommands;
-
+
if ( defined($newhash{$cmd})) {
warn "$cmd is used twice in preamble of new file. Reverting to pure line diff mode for preamble.\n";
print STDERR $warnmsgdetail;
@@ -3715,7 +3755,7 @@ EOF
}
$argnew=$newhash{$cmd}->[2];
$argdiff="{" . join("",bodydiff($argold,$argnew)) ."}";
- # Replace \RIGHTBRACE by }
+ # Replace \RIGHTBRACE by }
$argdiff =~ s/\\RIGHTBRACE/}/g;
if ( length $optargnew ) {
@@ -3730,7 +3770,7 @@ EOF
$optargdiff="";
}
### print STDERR "DEBUG s/\\Q$newhash{$cmd}->[0]\\E/\\$cmd$optargdiff$argdiff/s\n";
- # Note: \Q and \E force literal interpretation of what it between them but allow
+ # Note: \Q and \E force literal interpretation of what it between them but allow
# variable interpolation, such that e.g. \title matches just that and not TAB-itle
$$newpreambleref=~s/\Q$newhash{$cmd}->[0]\E/\\$cmd$optargdiff$argdiff/s;
# replace this in old preamble if necessary
@@ -3770,7 +3810,7 @@ EOF
#%< old deleted line(s)
#%DIF -------
#%DIF mmann-nn
-#new appended line %<
+#new appended line %<
#%DIF -------
# Future extension: mark change explicitly
# Assumes: traverse_sequence traverses deletions before insertions in changed sequences
@@ -3782,9 +3822,9 @@ sub linediff {
my $block = [];
my $retseq = [];
my @begin=('','',''); # dummy initialisation
- my $instring ;
+ my $instring ;
- my $discard = sub { @begin=('d',$_[0],$_[1]) unless scalar @$block ;
+ my $discard = sub { @begin=('d',$_[0],$_[1]) unless scalar @$block ;
push(@$block, "%DIF < " . $seq1->[$_[0]]) };
my $add = sub { if (! scalar @$block) {
@begin=('a',$_[0],$_[1]) ;}
@@ -3799,12 +3839,12 @@ sub linediff {
$instring = sprintf "%%DIF %da%d-%d",$begin[1],$begin[2],$_[1]-1; }
elsif ( $begin[0] eq 'c' ) {
$instring = sprintf "%%DIF %sc%s",
- ($begin[1]==$_[0]-1) ? "$begin[1]" : $begin[1]."-".($_[0]-1) ,
+ ($begin[1]==$_[0]-1) ? "$begin[1]" : $begin[1]."-".($_[0]-1) ,
($begin[2]==$_[1]-1) ? "$begin[2]" : $begin[2]."-".($_[1]-1) ; }
else {
$instring = sprintf "%%DIF %d%s%d",$begin[1],$begin[0],$begin[2]; }
- push @$retseq, $instring,@$block, "%DIF -------" ;
- $block = [];
+ push @$retseq, $instring,@$block, "%DIF -------" ;
+ $block = [];
}
push @$retseq, $seq2->[$_[1]]
};
@@ -3812,7 +3852,7 @@ sub linediff {
my $keyfunc = sub { join(" ",split(" ",shift())) };
traverse_sequences($seq1,$seq2, { MATCH=>$match, DISCARD_A=>$discard, DISCARD_B=>$add }, $keyfunc );
- push @$retseq, @$block if scalar @$block;
+ push @$retseq, @$block if scalar @$block;
return wantarray ? @$retseq : $retseq ;
}
@@ -3822,23 +3862,23 @@ sub linediff {
# init_regex_arr_data(\@array,"TOKEN INIT")
# scans DATA file handel for line "%% TOKEN INIT" line
# then appends each line not beginning with % into array (as a quoted regex)
-# This is used for command lists and configuration variables, but the processing is slightly
-# different:
+# This is used for command lists and configuration variables, but the processing is slightly
+# different:
# For lists, the regular expression is extended to include beginning (^) and end ($) markers, to require full-string matching
# For configuration variables (and all others), simply an unadorned list is copied
sub init_regex_arr_data {
my ($arr,$token)=@_;
my $copy=0;
my ($mode);
- if ($token =~ m/COMMANDS/ ) {
- $mode=0; # Reading command list
+ if ($token =~ m/COMMANDS/ ) {
+ $mode=0; # Reading command list
} else {
$mode=1; # Reading configuration variables
}
while (<DATA>) {
if ( m/^%%BEGIN $token\s*$/ ) {
- $copy=1;
+ $copy=1;
next;
} elsif ( m/^%%END $token\s*$/ ) {
last; }
@@ -3919,17 +3959,18 @@ sub exetime {
sub usage {
- print STDERR <<"EOF";
+ print STDERR <<"EOF";
Usage: $0 [options] old.tex new.tex > diff.tex
-Compares two latex files and writes tex code to stdout, which has the same format as new.tex but
+Compares two latex files and writes tex code to stdout, which has the same format as new.tex but
has all changes relative to old.tex marked up or commented. Note that old.tex and new.tex need to
-be real files (not pipes or similar) as they are opened twice.
+be real files (not pipes or similar) as they are opened twice.
--type=markupstyle
-t markupstyle Add code to preamble for selected markup style
- Available styles: UNDERLINE CTRADITIONAL TRADITIONAL CFONT FONTSTRIKE INVISIBLE
+ Available styles: UNDERLINE CTRADITIONAL TRADITIONAL CFONT FONTSTRIKE INVISIBLE
CHANGEBAR CCHANGEBAR CULINECHBAR CFONTCHBAR BOLD PDFCOMMENT
+ LUAUNDERLINE
[ Default: UNDERLINE ]
--subtype=markstyle
@@ -3940,7 +3981,7 @@ be real files (not pipes or similar) as they are opened twice.
* LABEL subtype is deprecated
--floattype=markstyle
--f markstyle Add code to preamble for selected style which
+-f markstyle Add code to preamble for selected style which
replace standard marking and markup commands within floats
(e.g., marginal remarks cause an error within floats
so marginal marking can be disabled thus)
@@ -3949,11 +3990,11 @@ be real files (not pipes or similar) as they are opened twice.
--encoding=enc
-e enc Specify encoding of old.tex and new.tex. Typical encodings are
- ascii, utf8, latin1, latin9. A list of available encodings can be
- obtained by executing
+ ascii, utf8, latin1, latin9. A list of available encodings can be
+ obtained by executing
perl -MEncode -e 'print join ("\\n",Encode->encodings( ":all" )) ;'
[Default encoding is utf8 unless the first few lines of the preamble contain
- an invocation "\\usepackage[..]{inputenc} in which case the
+ an invocation "\\usepackage[..]{inputenc} in which case the
encoding chosen by this command is asssumed. Note that ASCII (standard
latex) is a subset of utf8]
@@ -3970,22 +4011,22 @@ be real files (not pipes or similar) as they are opened twice.
--exclude-safecmd=exclude-file
--exclude-safecmd="cmd1,cmd2,..."
--A exclude-file
+-A exclude-file
--replace-safecmd=replace-file
--append-safecmd=append-file
--append-safecmd="cmd1,cmd2,..."
-a append-file Exclude from, replace or append to the list of regex
- matching commands which are safe to use within the
+ matching commands which are safe to use within the
scope of a \\DIFadd or \\DIFdel command. The file must contain
one Perl-RegEx per line (Comment lines beginning with # or % are
ignored). A literal comma within the comma-separated list must be
- escaped thus "\\,", Note that the RegEx needs to match the whole of
+ escaped thus "\\,", Note that the RegEx needs to match the whole of
the token, i.e., /^regex\$/ is implied and that the initial
"\\" of the command is not included. The --exclude-safecmd
- and --append-safecmd options can be combined with the --replace-safecmd
+ and --append-safecmd options can be combined with the --replace-safecmd
option and can be used repeatedly to add cumulatively to the lists.
---exclude-textcmd=exclude-file
+--exclude-textcmd=exclude-file
--exclude-textcmd="cmd1,cmd2,..."
-X exclude-file
--replace-textcmd=replace-file
@@ -4001,7 +4042,7 @@ be real files (not pipes or similar) as they are opened twice.
Replace or append to the list of regex matching commands
whose last argument is text but which require a particular
context to work, e.g. \\caption will only work within a figure
- or table. These commands behave like text commands, except when
+ or table. These commands behave like text commands, except when
they occur in a deleted section, when they are disabled, but their
argument is shown as deleted text.
@@ -4011,7 +4052,7 @@ be real files (not pipes or similar) as they are opened twice.
As corresponding commands for context1. The only difference is that
context2 commands are completely disabled in deleted sections, including
their arguments.
- context2 commands are also the only commands in the preamble, whose argument will
+ context2 commands are also the only commands in the preamble, whose argument will
be processed in word-by-word mode (which only works, if they occur no more than
once in the preamble).
@@ -4020,15 +4061,15 @@ be real files (not pipes or similar) as they are opened twice.
--append-mboxsafecmd=append-file
--append-mboxsafecmd="cmd1,cmd2,..."
Define safe commands, which additionally need to be protected by encapsulating
- in an \\mbox{..}. This is sometimes needed to get around incompatibilities
+ in an \\mbox{..}. This is sometimes needed to get around incompatibilities
between external packages and the ulem package, which is used for highlighting
in the default style UNDERLINE as well as CULINECHBAR CFONTSTRIKE
-
+
--config var1=val1,var2=val2,...
-c var1=val1,.. Set configuration variables.
--c configfile Available variables:
+-c configfile Available variables:
ARRENV (RegEx)
COUNTERCMD (RegEx)
FLOATENV (RegEx)
@@ -4047,15 +4088,15 @@ be real files (not pipes or similar) as they are opened twice.
--add-to-config varenv1=pattern1,varenv2=pattern2
For configuration variables containing a regular expression (essentially those ending
- in ENV, and COUNTERCMD) this provides an alternative way to modify the configuration
+ in ENV, and COUNTERCMD) this provides an alternative way to modify the configuration
variables. Instead of setting the complete pattern, with this option it is possible to add an
alternative pattern. varenv must be one of the variables listed above that take a regular
- expression as argument, and pattern is any regular expression (which might need to be
+ expression as argument, and pattern is any regular expression (which might need to be
protected from the shell by quotation). Several patterns can be added at once by using semi-colons
to separate them, e.g. --add-to-config "LISTENV=myitemize;myenumerate,COUNTERCMD=endnote"
--packages=pkg1,pkg2,..
- Tell latexdiff that .tex file is processed with the packages in list
+ Tell latexdiff that .tex file is processed with the packages in list
loaded. This is normally not necessary if the .tex file includes the
preamble, as the preamble is automatically scanned for \\usepackage commands.
Use of the --packages option disables automatic scanning, so if for any
@@ -4076,57 +4117,57 @@ be real files (not pipes or similar) as they are opened twice.
--show-all Show all of the above
- NB For all --show commands, no old.tex or new.tex file needs to be given, and no
+ NB For all --show commands, no old.tex or new.tex file needs to be given, and no
differencing takes place.
Other configuration options:
--allow-spaces Allow spaces between bracketed or braced arguments to commands
- [Default requires arguments to directly follow each other without
+ [Default requires arguments to directly follow each other without
intervening spaces]
--math-markup=level Determine granularity of markup in displayed math environments:
Possible values for level are (both numerical and text labels are acceptable):
- off or 0: suppress markup for math environments. Deleted equations will not
- appear in diff file. This mode can be used if all the other modes
+ off or 0: suppress markup for math environments. Deleted equations will not
+ appear in diff file. This mode can be used if all the other modes
cause invalid latex code.
whole or 1: Differencing on the level of whole equations. Even trivial changes
- to equations cause the whole equation to be marked changed. This
- mode can be used if processing in coarse or fine mode results in
+ to equations cause the whole equation to be marked changed. This
+ mode can be used if processing in coarse or fine mode results in
invalid latex code.
coarse or 2: Detect changes within equations marked up with a coarse
- granularity; changes in equation type (e.g.displaymath to equation)
+ granularity; changes in equation type (e.g.displaymath to equation)
appear as a change to the complete equation. This mode is recommended
for situations where the content and order of some equations are still
being changed. [Default]
fine or 3: Detect small change in equations and mark up and fine granularity.
This mode is most suitable, if only minor changes to equations are
- expected, e.g. correction of typos.
+ expected, e.g. correction of typos.
--graphics-markup=level Change highlight style for graphics embedded with \\includegraphics commands
Possible values for level:
none,off or 0: no highlighting for figures
new-only or 1: surround newly added or changed figures with a blue frame [Default]
- both or 2: highlight new figures with a blue frame and show deleted figures
+ both or 2: highlight new figures with a blue frame and show deleted figures
at reduced scale, and crossed out with a red diagonal cross. Use configuration
variable SCALEDELGRAPHICS to set size of deleted figures.
- Note that changes to the optional parameters will make the figure appear as changed
+ Note that changes to the optional parameters will make the figure appear as changed
to latexdiff, and this figure will thus be highlighted.
In some circumstances "Misplaced \\noalign" errors can occur if there are certain types
- of changes in tables. In this case please use option --graphics-markup=none as a
- work-around.
+ of changes in tables. In this case please use option --graphics-markup=none as a
+ work-around.
---no-del Suppress deleted text from the diff. It is similar in effect to the BOLD style,
+--no-del Suppress deleted text from the diff. It is similar in effect to the BOLD style,
but the deleted text ist not just invisible in the output, it is also not included in the
- diff text file. This can be more robust than just making it invisible.
+ diff text file. This can be more robust than just making it invisible.
---disable-citation-markup
---disable-auto-mbox Suppress citation markup and markup of other vulnerable commands in styles
+--disable-citation-markup
+--disable-auto-mbox Suppress citation markup and markup of other vulnerable commands in styles
using ulem (UNDERLINE,FONTSTRIKE, CULINECHBAR)
(the two options are identical and are simply aliases)
--enable-citation-markup
---enforce-auto-mbox Protect citation commands and other vulnerable commands in changed sections
+--enforce-auto-mbox Protect citation commands and other vulnerable commands in changed sections
with \\mbox command, i.e. use default behaviour for ulem package for other packages
(the two options are identical and are simply aliases)
@@ -4142,14 +4183,14 @@ Miscellaneous options
--no-label Suppress inclusion of old and new file names as comment in output file
---visible-label Include old and new filenames (or labels set with --label option) as
+--visible-label Include old and new filenames (or labels set with --label option) as
visible output
--flatten Replace \\input and \\include commands within body by the content
of the files in their argument. If \\includeonly is present in the
- preamble, only those files are expanded into the document. However,
- no recursion is done, i.e. \\input and \\include commands within
- included sections are not expanded. The included files are assumed to
+ preamble, only those files are expanded into the document. However,
+ no recursion is done, i.e. \\input and \\include commands within
+ included sections are not expanded. The included files are assumed to
be located in the same directories as the old and new master files,
respectively, making it possible to organise files into old and new directories.
--flatten is applied recursively, so inputted files can contain further
@@ -4172,7 +4213,7 @@ Miscellaneous options
-h Show this help text.
--ignore-warnings Suppress warnings about inconsistencies in length between input
- and parsed strings and missing characters.
+ and parsed strings and missing characters.
--verbose
-V Output various status information to stderr during processing.
@@ -4184,10 +4225,10 @@ Internal options:
These options are mostly for automated use by latexdiff-vc. They can be used directly, but
the API should be considered less stable than for the other options.
---no-links Suppress generation of hyperreferences, used for minimal diffs
+--no-links Suppress generation of hyperreferences, used for minimal diffs
(option --only-changes of latexdiff-vc).
EOF
- exit 0;
+ exit 0;
}
=head1 NAME
@@ -4213,8 +4254,8 @@ be real files (not pipes or similar) as they are opened twice (unless C<--encodi
The program treats the preamble differently from the main document.
Differences between the preambles are found using line-based
differencing (similarly to the Unix diff command, but ignoring white
-spaces). A comment, "S<C<%DIF E<gt>>>" is appended to each added line, i.e. a
-line present in C<new.tex> but not in C<old.tex>. Discarded lines
+spaces). A comment, "S<C<%DIF E<gt>>>" is appended to each added line, i.e. a
+line present in C<new.tex> but not in C<old.tex>. Discarded lines
are deactivated by prepending "S<C<%DIF E<lt>>>". Changed blocks are preceded by
comment lines giving information about line numbers in the original files. Where there are insignificant
differences, the resulting file C<diff.tex> will be similar to
@@ -4267,7 +4308,7 @@ curly braces immediately following a command (i.e. a sequence of
letters beginning with a backslash) are arguments for that command.
As a restriction to condition 1 above it is thus necessary to surround
all arguments with curly braces, and to not insert
-extraneous spaces. For example, write
+extraneous spaces. For example, write
\section{\textem{This is an emphasized section title}}
@@ -4299,7 +4340,7 @@ but the choice is yours. Any markup within the environment will be
removed, and generally everything within the environment will just be
taken from the new file.
-It is also possible to difference files which do not have a preamble.
+It is also possible to difference files which do not have a preamble.
In this case, the file is processed in the main document
mode, but the definitions of the markup commands are not inserted.
@@ -4317,7 +4358,7 @@ the scope of C<\DIFadd>. Added comments are marked by prepending
Within deleted blocks text is highlighted with C<\DIFdel>. Deleted
comments are marked by prepending "S<C<%DIF E<lt> >>". Non-safe command
-and curly braces within deleted blocks are commented out with
+and curly braces within deleted blocks are commented out with
"S<C<%DIFDELCMD E<lt> >>".
@@ -4327,7 +4368,7 @@ and curly braces within deleted blocks are commented out with
=head2 Preamble
The following options determine the visual markup style by adding the appropriate
-command definitions to the preamble. See the end of this section for a description of
+command definitions to the preamble. See the end of this section for a description of
available styles.
=over 4
@@ -4337,15 +4378,16 @@ B<-t markupstyle>
Add code to preamble for selected markup style. This option defines
C<\DIFadd> and C<\DIFdel> commands.
-Available styles:
+Available styles:
-C<UNDERLINE CTRADITIONAL TRADITIONAL CFONT FONTSTRIKE INVISIBLE
-CHANGEBAR CCHANGEBAR CULINECHBAR CFONTCHBAR BOLD PDFCOMMENT>
+C<UNDERLINE CTRADITIONAL TRADITIONAL CFONT FONTSTRIKE INVISIBLE
+CHANGEBAR CCHANGEBAR CULINECHBAR CFONTCHBAR BOLD PDFCOMMENT
+LUAUNDERLINE>
[ Default: C<UNDERLINE> ]
=item B<--subtype=markstyle> or
-B<-s markstyle>
+B<-s markstyle>
Add code to preamble for selected style for bracketing
commands (e.g. to mark changes in margin). This option defines
@@ -4358,27 +4400,27 @@ Available styles: C<SAFE MARGIN COLOR DVIPSCOL ZLABEL ONLYCHANGEDPAGE (LABEL)*>
=item B<--floattype=markstyle> or
B<-f markstyle>
-Add code to preamble for selected style which
+Add code to preamble for selected style which
replace standard marking and markup commands within floats
(e.g., marginal remarks cause an error within floats
-so marginal marking can be disabled thus). This option defines all
+so marginal marking can be disabled thus). This option defines all
C<\DIF...FL> commands.
Available styles: C<FLOATSAFE TRADITIONALSAFE IDENTICAL>
[ Default: C<FLOATSAFE> ]
-=item B<--encoding=enc> or
+=item B<--encoding=enc> or
B<-e enc>
Specify encoding of old.tex and new.tex. Typical encodings are
-C<ascii>, C<utf8>, C<latin1>, C<latin9>. A list of available encodings can be
-obtained by executing
+C<ascii>, C<utf8>, C<latin1>, C<latin9>. A list of available encodings can be
+obtained by executing
C<perl -MEncode -e 'print join ("\n",Encode->encodings( ":all" )) ;' >
If this option is used, then old.tex, new.tex are only opened once.
[Default encoding is utf8 unless the first few lines of the preamble contain
-an invocation C<\usepackage[..]{inputenc}> in which case the
+an invocation C<\usepackage[..]{inputenc}> in which case the
encoding chosen by this command is asssumed. Note that ASCII (standard
latex) is a subset of utf8]
@@ -4395,7 +4437,7 @@ C<\DIFaddbeginFL, \DIFaddendFL, \DIFaddFL{..},
(If this option is set B<-t>, B<-s>, and B<-f> options
are ignored.)
-=item B<--packages=pkg1,pkg2,..>
+=item B<--packages=pkg1,pkg2,..>
Tell latexdiff that .tex file is processed with the packages in list
loaded. This is normally not necessary if the .tex file includes the
@@ -4406,13 +4448,13 @@ The following packages trigger special behaviour:
=over 8
-=item C<endfloat>
+=item C<endfloat>
Ensure that C<\begin{figure}> and C<\end{figure}> always appear by themselves on a line.
=item C<hyperref>
-Change name of C<\DIFadd> and C<\DIFdel> commands to C<\DIFaddtex> and C<\DIFdeltex> and
+Change name of C<\DIFadd> and C<\DIFdel> commands to C<\DIFaddtex> and C<\DIFdeltex> and
define new C<\DIFadd> and C<\DIFdel> commands, which provide a wrapper for these commands,
using them for the text but not for the link defining command (where any markup would cause
errors).
@@ -4464,17 +4506,17 @@ B<-A exclude-file> or B<--exclude-safecmd="cmd1,cmd2,...">
=item B<--replace-safecmd=replace-file>
-=item B<--append-safecmd=append-file> or
+=item B<--append-safecmd=append-file> or
B<-a append-file> or B<--append-safecmd="cmd1,cmd2,...">
Exclude from, replace or append to the list of regular expressions (RegEx)
-matching commands which are safe to use within the
+matching commands which are safe to use within the
scope of a C<\DIFadd> or C<\DIFdel> command. The file must contain
one Perl-RegEx per line (Comment lines beginning with # or % are
-ignored). Note that the RegEx needs to match the whole of
+ignored). Note that the RegEx needs to match the whole of
the token, i.e., /^regex$/ is implied and that the initial
-"\" of the command is not included.
-The B<--exclude-safecmd> and B<--append-safecmd> options can be combined with the -B<--replace-safecmd>
+"\" of the command is not included.
+The B<--exclude-safecmd> and B<--append-safecmd> options can be combined with the -B<--replace-safecmd>
option and can be used repeatedly to add cumulatively to the lists.
B<--exclude-safecmd>
and B<--append-safecmd> can also take a comma separated list as input. If a
@@ -4487,7 +4529,7 @@ B<-X exclude-file> or B<--exclude-textcmd="cmd1,cmd2,...">
=item B<--replace-textcmd=replace-file>
-=item B<--append-textcmd=append-file> or
+=item B<--append-textcmd=append-file> or
B<-x append-file> or B<--append-textcmd="cmd1,cmd2,...">
Exclude from, replace or append to the list of regular expressions
@@ -4495,7 +4537,7 @@ matching commands whose last argument is text. See
entry for B<--exclude-safecmd> directly above for further details.
-=item B<--replace-context1cmd=replace-file>
+=item B<--replace-context1cmd=replace-file>
=item B<--append-context1cmd=append-file> or
@@ -4504,11 +4546,11 @@ entry for B<--exclude-safecmd> directly above for further details.
Replace or append to the list of regex matching commands
whose last argument is text but which require a particular
context to work, e.g. C<\caption> will only work within a figure
-or table. These commands behave like text commands, except when
+or table. These commands behave like text commands, except when
they occur in a deleted section, when they are disabled, but their
argument is shown as deleted text.
-=item B<--replace-context2cmd=replace-file>
+=item B<--replace-context2cmd=replace-file>
=item B<--append-context2cmd=append-file> or
@@ -4518,9 +4560,9 @@ As corresponding commands for context1. The only difference is that
context2 commands are completely disabled in deleted sections, including
their arguments.
-context2 commands are also the only commands in the preamble, whose argument will be processed in
+context2 commands are also the only commands in the preamble, whose argument will be processed in
word-by-word mode (which only works, if they occur no more than once in the preamble). The algorithm currently cannot cope with repeated context2 commands in the preamble, as they occur e.g. for the C<\author> argument in some journal styles (not in the standard styles, though
-If such a repetition is detected, the whole preamble will be processed in line-by-line mode. In such a case, use C<--replace-context2cmd> option to just select the commands, which should be processed and are not used repeatedly in the preamble.
+If such a repetition is detected, the whole preamble will be processed in line-by-line mode. In such a case, use C<--replace-context2cmd> option to just select the commands, which should be processed and are not used repeatedly in the preamble.
@@ -4529,7 +4571,7 @@ If such a repetition is detected, the whole preamble will be processed in line-b
=item B<--append-mboxsafecmd=append-file> or B<--append-mboxsafecmd="cmd1,cmd2,...">
Define safe commands, which additionally need to be protected by encapsulating
-in an C<\mbox{..}>. This is sometimes needed to get around incompatibilities
+in an C<\mbox{..}>. This is sometimes needed to get around incompatibilities
between external packages and the ulem package, which is used for highlighting
in the default style UNDERLINE as well as CULINECHBAR CFONTSTRIKE
@@ -4543,7 +4585,7 @@ in the default style UNDERLINE as well as CULINECHBAR CFONTSTRIKE
Set configuration variables. The option can be repeated to set different
variables (as an alternative to the comma-separated list).
-Available variables (see below for further explanations):
+Available variables (see below for further explanations):
C<ARRENV> (RegEx)
@@ -4573,10 +4615,10 @@ C<SCALEDELGRAPHICS> (Float)
=item B<--add-to-config varenv1=pattern1,varenv2=pattern2,...>
For configuration variables, which are a regular expression (essentially those ending
-in ENV, COUNTERCMD and CUSTOMDIFCMD, see list above) this option provides an alternative way to modify the configuration
+in ENV, COUNTERCMD and CUSTOMDIFCMD, see list above) this option provides an alternative way to modify the configuration
variables. Instead of setting the complete pattern, with this option it is possible to add an
alternative pattern. C<varenv> must be one of the variables listed above that take a regular
-expression as argument, and pattern is any regular expression (which might need to be
+expression as argument, and pattern is any regular expression (which might need to be
protected from the shell by quotation). Several patterns can be added at once by using semi-colons
to separate them, e.g. C<--add-to-config "LISTENV=myitemize;myenumerate,COUNTERCMD=endnote">
@@ -4596,7 +4638,7 @@ Show values of configuration variables.
Combine all --show commands.
-NB For all --show commands, no C<old.tex> or C<new.tex> file needs to be specified, and no
+NB For all --show commands, no C<old.tex> or C<new.tex> file needs to be specified, and no
differencing takes place.
=back
@@ -4613,29 +4655,29 @@ might get lumpeded with preceding commands) so should only be used if the
default produces erroneous results. (Default requires arguments to
directly follow each other without intervening spaces).
-=item B<--math-markup=level>
+=item B<--math-markup=level>
-Determine granularity of markup in displayed math environments:
+Determine granularity of markup in displayed math environments:
Possible values for level are (both numerical and text labels are acceptable):
-C<off> or C<0>: suppress markup for math environments. Deleted equations will not
-appear in diff file. This mode can be used if all the other modes
+C<off> or C<0>: suppress markup for math environments. Deleted equations will not
+appear in diff file. This mode can be used if all the other modes
cause invalid latex code.
C<whole> or C<1>: Differencing on the level of whole equations. Even trivial changes
-to equations cause the whole equation to be marked changed. This
-mode can be used if processing in coarse or fine mode results in
+to equations cause the whole equation to be marked changed. This
+mode can be used if processing in coarse or fine mode results in
invalid latex code.
C<coarse> or C<2>: Detect changes within equations marked up with a coarse
-granularity; changes in equation type (e.g.displaymath to equation)
+granularity; changes in equation type (e.g.displaymath to equation)
appear as a change to the complete equation. This mode is recommended
for situations where the content and order of some equations are still
being changed. [Default]
C<fine> or C<3>: Detect small change in equations and mark up at fine granularity.
This mode is most suitable, if only minor changes to equations are
-expected, e.g. correction of typos.
+expected, e.g. correction of typos.
=item B<--graphics-markup=level>
@@ -4647,33 +4689,33 @@ C<none>, C<off> or C<0>: no highlighting for figures
C<new-only> or C<1>: surround newly added or changed figures with a blue frame [Default if graphicx package loaded]
-C<both> or C<2>: highlight new figures with a blue frame and show deleted figures at reduced
+C<both> or C<2>: highlight new figures with a blue frame and show deleted figures at reduced
scale, and crossed out with a red diagonal cross. Use configuration
variable SCALEDELGRAPHICS to set size of deleted figures.
-Note that changes to the optional parameters will make the figure appear as changed
+Note that changes to the optional parameters will make the figure appear as changed
to latexdiff, and this figure will thus be highlighted.
In some circumstances "Misplaced \noalign" error can occur if there are certain types
-of changes in tables. In this case please use C<--graphics-markup=none> as a
-work-around.
+of changes in tables. In this case please use C<--graphics-markup=none> as a
+work-around.
-=item B<--no-del>
+=item B<--no-del>
-Suppress deleted text from the diff. It is similar in effect to the BOLD style,
-but the deleted text ist not just invisible in the output, it is also not included in the diff text file.
-This can be more robust than just making it invisible.
+Suppress deleted text from the diff. It is similar in effect to the BOLD style,
+but the deleted text ist not just invisible in the output, it is also not included in the diff text file.
+This can be more robust than just making it invisible.
=item B<--disable-citation-markup> or B<--disable-auto-mbox>
-Suppress citation markup and markup of other vulnerable commands in styles
+Suppress citation markup and markup of other vulnerable commands in styles
using ulem (UNDERLINE,FONTSTRIKE, CULINECHBAR)
(the two options are identical and are simply aliases)
=item B<--enable-citation-markup> or B<--enforce-auto-mbox>
-Protect citation commands and other vulnerable commands in changed sections
+Protect citation commands and other vulnerable commands in changed sections
with C<\mbox> command, i.e. use default behaviour for ulem package for other packages
(the two options are identical and are simply aliases)
@@ -4719,18 +4761,18 @@ Suppress inclusion of old and new file names as comment in output file
=item B<--visible-label>
-Include old and new filenames (or labels set with C<--label> option) as
+Include old and new filenames (or labels set with C<--label> option) as
visible output.
=item B<--flatten>
Replace C<\input> and C<\include> commands within body by the content
of the files in their argument. If C<\includeonly> is present in the
-preamble, only those files are expanded into the document. However,
-no recursion is done, i.e. C<\input> and C<\include> commands within
-included sections are not expanded. The included files are assumed to
+preamble, only those files are expanded into the document. However,
+no recursion is done, i.e. C<\input> and C<\include> commands within
+included sections are not expanded. The included files are assumed to
be located in the same directories as the old and new master files,
-respectively, making it possible to organise files into old and new directories.
+respectively, making it possible to organise files into old and new directories.
--flatten is applied recursively, so inputted files can contain further
C<\input> statements. Also handles files included by the import package
(C<\import> and C<\subimport>), and C<\subfile> command.
@@ -4777,7 +4819,7 @@ Suppress generation of hyperreferences, used for minimal diffs (option --only-ch
=back
-=head2 Predefined styles
+=head2 Predefined styles
=head2 Major types
@@ -4790,9 +4832,14 @@ The major type determine the markup of plain text and some selected latex comman
Added text is wavy-underlined and blue, discarded text is struck out and red
(Requires color and ulem packages). Overstriking does not work in displayed math equations such that deleted parts of equation are underlined, not struck out (this is a shortcoming inherent to the ulem package).
+=item C<LUAUNDERLINE>
+
+Added text is underlined and blue, discarded text is struck out and red
+(Requires lua-ul package + LuaLaTeX).
+
=item C<CTRADITIONAL>
-Added text is blue and set in sans-serif, and a red footnote is created for each discarded
+Added text is blue and set in sans-serif, and a red footnote is created for each discarded
piece of text. (Requires color package)
=item C<TRADITIONAL>
@@ -4833,13 +4880,13 @@ Added text is set in bold face, discarded is not shown. (also see --no-del optio
=item C<PDFCOMMENT>
-The pdfcomment package is used to underline new text, and mark deletions with a PDF comment. Note that this markup might appear differently or not at all based on the pdf viewer used. The viewer with best support for pdf markup is probably acroread. This style is only recommended if the number of differences is small.
+The pdfcomment package is used to underline new text, and mark deletions with a PDF comment. Note that this markup might appear differently or not at all based on the pdf viewer used. The viewer with best support for pdf markup is probably acroread. This style is only recommended if the number of differences is small.
=back
=head2 Subtypes
-The subtype defines the commands that are inserted at the begin and end of added or discarded blocks, irrespectively of whether these blocks contain text or commands (Defined commands: C<\DIFaddbegin, \DIFaddend, \DIFdelbegin, \DIFdelend>)
+The subtype defines the commands that are inserted at the begin and end of added or discarded blocks, irrespectively of whether these blocks contain text or commands (Defined commands: C<\DIFaddbegin, \DIFaddend, \DIFdelbegin, \DIFdelend>)
=over 10
@@ -4857,7 +4904,7 @@ from the intended position.
An alternative way of marking added passages in blue, and deleted ones in red.
(It is recommeneded to use instead the main types to effect colored markup,
-although in some cases coloring with dvipscol can be more complete, for example
+although in some cases coloring with dvipscol can be more complete, for example
with citation commands).
=item C<DVIPSCOL>
@@ -4872,12 +4919,12 @@ although in some cases coloring with dvipscol can be more complete).
can be used to highlight only changed pages, but requires post-processing. It is recommend to not call this option manually but use C<latexdiff-vc> with C<--only-changes> option. Alternatively, use the script given within preamble of diff files made using this style.
-=item C<ONLYCHANGEDPAGE>
+=item C<ONLYCHANGEDPAGE>
also highlights changed pages, without the need for post-processing, but might not work reliably if
there is floating material (figures, tables).
-=item C<LABEL>
+=item C<LABEL>
is similar to C<ZLABEL>, but does not need the zref package and works less reliably (deprecated).
@@ -4885,7 +4932,7 @@ is similar to C<ZLABEL>, but does not need the zref package and works less relia
=head2 Float Types
-Some of the markup used in the main text might cause problems when used within
+Some of the markup used in the main text might cause problems when used within
floats (e.g. figures or tables). For this reason alternative versions of all
markup commands are used within floats. The float type defines these alternative commands.
@@ -4912,7 +4959,7 @@ Make no difference between the main text and floats.
=item C<ARRENV>
-If a match to C<ARRENV> is found within an inline math environment within a deleted or added block, then the inlined math
+If a match to C<ARRENV> is found within an inline math environment within a deleted or added block, then the inlined math
is surrounded by C<\mbox{>...C<}>. This is necessary as underlining does not work within inlined array environments.
[ Default: C<ARRENV>=S<C<(?:array|[pbvBV]matrix)> >
@@ -4932,9 +4979,9 @@ C<|subsubsection|paragraph|subparagraph)> ]
This option is for advanced users and allows definition of special versions of commands, which do not work as safe commands.
Commands in C<CUSTOMDIFCMD> that occur in added or deleted blocks will be given an ADD or DEL prefix.
-The prefixed versions of the command must be defined in the preamble, either by putting them
+The prefixed versions of the command must be defined in the preamble, either by putting them
in the preamble of at least the new file, or by creating a custom preamble file (Option --preamble).
-For example the command C<\blindtext> (from package blindtext) does not interact well with underlining, so that
+For example the command C<\blindtext> (from package blindtext) does not interact well with underlining, so that
for the standard markup type, it is not satisfactory to define it as a safe command. Instead, a customised versions
without underlining can be defined in the preamble:
@@ -4948,7 +4995,7 @@ and then latexdiff should be invoked with the option C<-c CUSTOMDIFCMD=blindtext
=item C<FLOATENV>
-Environments whose name matches the regular expression in C<FLOATENV> are
+Environments whose name matches the regular expression in C<FLOATENV> are
considered floats. Within these environments, the I<latexdiff> markup commands
are replaced by their FL variaties.
@@ -4997,17 +5044,17 @@ If C<--graphics-markup=both> is chosen, C<SCALEDELGRAPHICS> is the factor, by wh
=item C<VERBATIMENV>
-RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of these environments will not be processed in any way:
+RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of these environments will not be processed in any way:
deleted content is commented out, new content is not marked up
[ Default: S<C<comment> > ]
=item C<VERBATIMLINEENV>
-RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of environments described by VERBATIMLINEENV are compared in
+RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of environments described by VERBATIMLINEENV are compared in
line mode, and changes are marked up using the listings package. The markup style is set based on the chosen mains markup type (Option -t), or on an analysis
of the preamble.
-Note that "listings.sty" must be installed. If this file is not found the fallback solution is to
+Note that "listings.sty" must be installed. If this file is not found the fallback solution is to
treat VERBATIMLINEENV environments treated exactly the same way as VERBATIMENV environments.
[ Default: S<C<(?:verbatim[*]?|lstlisting> > ]
@@ -5018,30 +5065,40 @@ treat VERBATIMLINEENV environments treated exactly the same way as VERBATIMENV e
=over 10
-=item Citations result in overfull boxes
+=item Changed citations result in overfull boxes
There is an incompatibility between the C<ulem> package, which C<latexdiff> uses for underlining and striking out in the UNDERLINE style,
-the default style, and the way citations are generated. In order to be able to mark up citations properly, they are enclosed with an C<\mbox>
-command. As mboxes cannot be broken across lines, this procedure frequently results in overfull boxes, possibly obscuring the content as it extends beyond the right margin. The same occurs for some other packages (e.g., siunitx). If this is a problem, you have two possibilities.
+the default style, and the way citations are generated. In order to be able to mark up citations properly, they are enclosed with an C<\mbox>
+command. As mboxes cannot be broken across lines, this procedure frequently results in overfull boxes, possibly obscuring the content as it extends beyond the right margin. The same occurs for some other packages (e.g., siunitx). If this is a problem, you have several possibilities.
1. Use C<CFONT> type markup (option C<-t CFONT>): If this markup is chosen, then changed citations are no longer marked up
-with the wavy line (additions) or struck out (deletions), but are still highlighted in the appropriate color, and deleted text is shown with a different font. Other styles not using the C<ulem> package will also work.
+with the wavy line (additions) or struck out (deletions), but are still highlighted in the appropriate color, and deleted text is shown with a different font. Other styles not using the C<ulem> package will also work.
2. Choose option C<--disable-citation-markup> which turns off the marking up of citations: deleted citations are no longer shown, and
-added citations are shown without markup. (This was the default behaviour of latexdiff at versions 0.6 and older)
-
+added citations are shown without markup. (This was the default behaviour of latexdiff at versions 0.6 and older).
For custom packages you can define the commands which need to be protected by C<\mbox> with C<--append-mboxsafecmd> and C<--excludemboxsafecmd> options
(submit your lists of command as feature request at github page to set the default behaviour of future versions, see section 6)
-=item Changes in complicated mathematical equations result in latex processing errors
+3. If you are using luatex >= 1.12.0 you can use option LUAUNDERLINE that uses lua-ul instead of ulem for underlining, which does not have this problem (experimental feature).
+
+=item Changes in complicated mathematical equations result in latex processing errors.
+
+Try option C<--math-markup=whole>. If even that fails, you can turn off mark up for equations with C<--math-markup=off>.
-Try options C<--math-markup=whole>. If even that fails, you can turn off mark up for equations with C<--math-markup=off>.
+=item Deleted parts in equations are not struck out but underlined.
-=item How can I just show the pages where changes had been made
+This is a limitation of the ulem package that implements the strike-out. If you use the amsmath package, then the strike-out command is redefined in such a way that deleted passages are wrapped with C<\text> command; adding C<\usepackage{amsmath}> to your preamble will trigger this behaviour. (If amsmath is not included directly, but imported by another package, latexdiff will not be able to detect its availability; in this case you can give latexdiff a hint with option C<--packages=amsmath>.
-Use options -C<-s ZLABEL> (some postprocessing required) or C<-s ONLYCHANGEDPAGE>. C<latexdiff-vc --ps|--pdf> with C<--only-changes> option takes care of
+
+=item How can I just show the pages where changes had been made?
+
+Use options C<--s ZLABEL> (some postprocessing required) or C<-s ONLYCHANGEDPAGE>. C<latexdiff-vc --ps|--pdf> with C<--only-changes> option takes care of
the post-processing for you (requires zref package to be installed).
+=item The character encoding breaks when running latexdiff from powershell.
+
+This problem is not limited to C<latexdiff> and has to do with the default settings of C<powershell> in Windows. It is recommended to use C<cmd> instead.
+
=back
=head1 BUGS
@@ -5054,13 +5111,13 @@ different numbers of inter-argument spaces are treated as significant.
=back
-Please submit bug reports using the issue tracker of the github repository page I<https://github.com/ftilmann/latexdiff.git>,
+Please submit bug reports using the issue tracker of the github repository page I<https://github.com/ftilmann/latexdiff.git>,
or send them to I<tilmann -- AT -- gfz-potsdam.de>. Include the version number of I<latexdiff>
(from comments at the top of the source or use B<--version>). If you come across latex
files that are error-free and conform to the specifications set out
above, and whose differencing still does not result in error-free
latex, please send me those files, ideally edited to only contain the
-offending passage as long as that still reproduces the problem. If your
+offending passage as long as that still reproduces the problem. If your
file relies on non-standard class files, you must include those. I will not
look at examples where I have trouble to latex the original files.
@@ -5071,24 +5128,24 @@ L<latexrevise>, L<latexdiff-vc>
=head1 PORTABILITY
I<latexdiff> does not make use of external commands and thus should run
-on any platform supporting Perl 5.6 or higher. If files with encodings
+on any platform supporting Perl 5.6 or higher. If files with encodings
other than ASCII or UTF-8 are processed, Perl 5.8 or higher is required.
The standard version of I<latexdiff> requires installation of the Perl package
-C<Algorithm::Diff> (available from I<www.cpan.org> -
+C<Algorithm::Diff> (available from I<www.cpan.org> -
I<http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15>) but a stand-alone
version, I<latexdiff-so>, which has this package inlined, is available, too.
I<latexdiff-fast> requires the I<diff> command to be present.
=head1 AUTHOR
-Version 1.3.3
-Copyright (C) 2004-2022 Frederik Tilmann
+Version 1.3.4
+Copyright (C) 2004-2024 Frederik Tilmann
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3
-Contributors of fixes and additions: V. Kuhlmann, J. Paisley, N. Becker, T. Doerges, K. Huebner,
+Contributors of fixes and additions: V. Kuhlmann, J. Paisley, N. Becker, T. Doerges, K. Huebner,
T. Connors, Sebastian Gouezel and many others.
Thanks to the many people who sent in bug reports, feature suggestions, and other feedback.
@@ -5359,13 +5416,14 @@ value
underline
sqrt
(SUPER|SUB)SCRIPT
-%%END TEXT COMMANDS
+%%END TEXT COMMANDS
%%BEGIN CONTEXT1 COMMANDS
% Regex matching commands with a text argument (leave out the \), which will fail out of context. These commands behave like text commands, except when they occur in a deleted section, where they are disabled, but their argument is shown as deleted text.
caption
subcaption
-%%END CONTEXT1 COMMANDS
+multicolumn
+%%END CONTEXT1 COMMANDS
%%BEGIN CONTEXT2 COMMANDS
% Regex matching commands with a text argument (leave out the \), which will fail out of context. As corresponding commands for context1. The only difference is that context2 commands are completely disabled in deleted sections, including their arguments.
@@ -5373,7 +5431,7 @@ title
author
date
institute
-%%END CONTEXT2 COMMANDS
+%%END CONTEXT2 COMMANDS
%% CONFIGURATION variabe defaults
%%BEGIN LISTENV CONFIG
@@ -5451,9 +5509,16 @@ verbatim[*]?
\RequirePackage[normalem]{ulem}
\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1}
\providecommand{\DIFadd}[1]{{\protect\color{blue}\uwave{#1}}}
-\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}}
+\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}}
%DIF END UNDERLINE PREAMBLE
+%DIF LUAUNDERLINE PREAMBLE
+\RequirePackage{lua-ul}
+\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1}
+\providecommand{\DIFadd}[1]{{\protect\color{blue}\underLine{#1}}}
+\providecommand{\DIFdel}[1]{{\protect\color{red}\strikeThrough{#1}}}
+%DIF END LUAUNDERLINE PREAMBLE
+
%DIF CTRADITIONAL PREAMBLE
\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1}
\RequirePackage[stable]{footmisc}
@@ -5625,7 +5690,7 @@ verbatim[*]?
% To show only pages with changes (dvips/dvipdf)
% latex diff.tex
% latex diff.tex
-% dvips -pp `perl -lne 'if (m/\\newlabel{DIFchg[be]\d*}{{.*}{(.*)}}/) { print $1 }' diff.aux | uniq | tr -s \\n ','` diff.dvi
+% dvips -pp `perl -lne 'if (m/\\newlabel{DIFchg[be]\d*}{{.*}{(.*)}}/) { print $1 }' diff.aux | uniq | tr -s \\n ','` diff.dvi
\typeout{Check comments in preamble of output for instructions how to show only pages where changes have been made}
\usepackage[user,abspage]{zref}
\newcount\DIFcounterb
@@ -5645,10 +5710,10 @@ verbatim[*]?
\RequirePackage{etoolbox}
\RequirePackage{zref}
% redefine label command to write immediately to aux file - page references will be lost
-\makeatletter \let\oldlabel\label% Store \label
-\renewcommand{\label}[1]{% Update \label to write to the .aux immediately
-\zref@wrapper@immediate{\oldlabel{#1}}}
-\makeatother
+\makeatletter \let\oldlabel\label% Store \label
+\renewcommand{\label}[1]{% Update \label to write to the .aux immediately
+\zref@wrapper@immediate{\oldlabel{#1}}}
+\makeatother
\newbool{DIFkeeppage}
\newbool{DIFchange}
\boolfalse{DIFkeeppage}
@@ -5666,7 +5731,7 @@ verbatim[*]?
\providecommand{\DIFmodend}{\global\booltrue{DIFkeeppage}\global\boolfalse{DIFchange}}
%DIF END ONLYCHANGEDPAGE PREAMBLE
-%% FLOAT TYPES
+%% FLOAT TYPES
%DIF FLOATSAFE PREAMBLE
\providecommand{\DIFaddFL}[1]{\DIFadd{#1}}
@@ -5698,7 +5763,7 @@ verbatim[*]?
%DIF END TRADITIONALSAFE PREAMBLE
% see:
-% http://tex.stackexchange.com/questions/47351/can-i-redefine-a-command-to-contain-itself
+% http://tex.stackexchange.com/questions/47351/can-i-redefine-a-command-to-contain-itself
%DIF HIGHLIGHTGRAPHICS PREAMBLE
\RequirePackage{settobox}
@@ -5744,6 +5809,15 @@ verbatim[*]?
%% SPECIAL PACKAGE PREAMBLE COMMANDS
+%% Redefine strike out command to wrap in text box if amsmath is used and markup style with ulem is used
+%DIF AMSMATHULEM PREAMBLE
+\makeatletter
+\let\sout@orig\sout
+\renewcommand{\sout}[1]{\ifmmode\text{\sout@orig{\ensuremath{#1}}}\else\sout@orig{#1}\fi}
+\makeatother
+%DIF END AMSMATHULEM PREAMBLE
+
+
% Standard \DIFadd and \DIFdel are redefined as \DIFaddtex and \DIFdeltex
% when hyperref package is included.
%DIF HYPERREF PREAMBLE
@@ -5846,7 +5920,7 @@ verbatim[*]?
%DIF END DIFCODE_BOLD
%DIF DIFCODE_PDFCOMMENT
-
+
moredelim=[il][\color{white}\tiny]{\%DIF\ <\ },
moredelim=[il][\sffamily\bfseries]{\%DIF\ >\ }
%DIF END DIFCODE_PDFCOMMENT
diff --git a/support/latexdiff/latexdiff-vc b/support/latexdiff/latexdiff-vc
index 697d1e29b7..31760ca14c 100755
--- a/support/latexdiff/latexdiff-vc
+++ b/support/latexdiff/latexdiff-vc
@@ -26,6 +26,12 @@
# Detailed usage information at the end of the file
#
# TODO/IDEAS: - option to call external pre-processing codes
+#
+# version 1.3.4:
+# - Enhancement: if --flatten option is used, and no bbl file is included in the version management, then latexdiff-vc will try to run bibtex to generate the bbl file. Implements the suggestion of PR #127 (contributed by github user cousteaulecommandant )
+# - Efficiency boost: use -draftmode for non-interactive preliminary runs of latex (idea from #
+# - bug fix: minor fix for --only-changed that makes detection of changed pages more reliable [ PR #297 contributed by user nelijuc ]
+#
# version 1.3.2:
# - bug fix: when setting config variables with the command lines it is now possible to use quotes to includes spaces in the value, e.g. -c LATEX="pdflatex --shell-escape"
# - bug fix: --only-changes is not compatible with graphics markup. --graphics-markup=none is now set automatically
@@ -71,7 +77,7 @@
use Getopt::Long ;
use Pod::Usage qw/pod2usage/ ;
use File::Temp qw/tempdir/ ;
-use File::Basename qw/dirname/;
+use File::Basename qw/dirname fileparse/;
use File::Copy;
use File::Path;
@@ -79,8 +85,8 @@ use strict ;
use warnings ;
my $versionstring=<<EOF ;
-This is LATEXDIFF-VC 1.3.2
- (c) 2005-2021 F J Tilmann
+This is LATEXDIFF-VC 1.3.4
+ (c) 2005-2024 F J Tilmann
EOF
# output debug and intermediate files, set to 0 in final distribution
@@ -98,6 +104,8 @@ my ($configlatexdiff,@config,$config,$assign);
#my $latexcmd="latex"; # latex compiler if not further identified
my $vc="";
my $tempdir=tempdir(CLEANUP => 1); # generate a temp dir, which will automatically be deleted at program exit
+#printf STDERR "DEBUG: tempdir $tempdir\n";
+
# Variables
my ($file1,$file2,$diff,$diffbase,$rootdir,$answer,$options,$infile,$append,$dirname,$cwd);
my (@files,@ldoptions,@tmpfiles,@ptmpfiles,@difffiles,$extracomp); # ,
@@ -419,30 +427,39 @@ while ( $infile=$file2=shift @files ) {
print STDERR "Working on $infile \n";
if ( scalar(@revs) == 1 ) {
if ( defined($flatten) ) {
- my $olddir=$tempdir . "/latexdiff-vc-$revs[0]";
- print STDERR "Checking out old dir into: $olddir (rev: $revs[0])\n";
- checkout_dir($revs[0],$olddir);
- $file1=$olddir ."/".$infile;
- } else {
- ($file1=$infile) =~ s/\.(tex|bbl|flt)/-oldtmp-$$.$1/ ;
- push @tmpfiles,$file1;
- # compare file with previous version ($revs[0]="") or specified version
- ### system("$diffcmd$revs[0] $infile| $patchcmd -o$file1") ;
- if (system("$diffcmd$revs[0] \"$infile\" | $patchcmd -o\"$file1\"")==0 and -z $file1 ) {
- # no differences detected, i.e. file is equal to current version
- copy($infile,$file1) || die "copy($infile,$file1) failed: $!";
- }
- }
+ my $olddir=$tempdir . "/latexdiff-vc-$revs[0]";
+ print STDERR "Checking out old dir into: $olddir (rev: $revs[0])\n";
+ checkout_dir($revs[0],$olddir,$infile);
+ $file1=$olddir ."/".$infile;
+
+ # generate bibliography for new file if
+ if ( greptex('^[^%]*\\\\bibliography\\{',$infile) == 0) {
+ my ($filebase,$filedir)=fileparse($infile,".tex");
+ if ( ! -e "$filedir$filebase.bbl" ) {
+ system("$CFG{LATEX} -draftmode -interaction=batchmode '$infile'; $CFG{BIBTEX} '$filedir$filebase'")
+ or die "Something went wrong in executing: $CFG{LATEX} -draftmode -interaction=batchmode '$infile'; $CFG{BIBTEX} '$filedir$filebase'" ;
+ }
+ }
+ } else {
+ ($file1=$infile) =~ s/\.(tex|bbl|flt)/-oldtmp-$$.$1/ ;
+ push @tmpfiles,$file1;
+ # compare file with previous version ($revs[0]="") or specified version
+ ### system("$diffcmd$revs[0] $infile| $patchcmd -o$file1") ;
+ if (system("$diffcmd$revs[0] \"$infile\" | $patchcmd -o\"$file1\"")==0 and -z $file1 ) {
+ # no differences detected, i.e. file is equal to current version
+ copy($infile,$file1) || die "copy($infile,$file1) failed: $!";
+ }
+ }
} elsif ( scalar(@revs) == 2 ) {
if ( defined($flatten) ) {
my $olddir=$tempdir . "/latexdiff-vc-$revs[0]";
print STDERR "Checking out old dir into: $olddir (rev: $revs[0])\n";
- checkout_dir($revs[0],$olddir);
+ checkout_dir($revs[0],$olddir,$infile);
$file1=$olddir ."/".$infile;
my $newdir=$tempdir . "/latexdiff-vc-$revs[1]";
print STDERR "Checking out new dir into: $newdir\n";
- checkout_dir($revs[1],$newdir);
+ checkout_dir($revs[1],$newdir,$infile);
$file2=$newdir ."/".$infile;
} else {
($file1=$infile) =~ s/\.(tex|bbl|flt)/-oldtmp-$$.$1/ ;
@@ -468,7 +485,7 @@ while ( $infile=$file2=shift @files ) {
} else {
($diff=$infile) =~ s/\.(tex|bbl|flt)$/$append.$1/ ;
}
-
+
# make directories if needed
$dirname=dirname($diff) ;
system("mkdir -p $dirname") unless ( -e $dirname );
@@ -488,13 +505,14 @@ while ( $infile=$file2=shift @files ) {
die "Abort ... " ;
}
}
+
print STDERR "Running: $CFG{LATEXDIFF} $options \"$file1\" \"$file2\" > \"$diff\"\n";
unless ( system("$CFG{LATEXDIFF} $options \"$file1\" \"$file2\" > \"$diff\"") == 0 ) {
print STDERR "Something went wrong in $CFG{LATEXDIFF}. Deleting $diff and abort\n" ; unlink $diff ; exit(5)
};
print "Generated difference file $diff\n";
- if ( $run and !( scalar(@revs) && greptex( qr/\\document(?:class|style)/ , $diff ) ) ) {
+ if ( $run and !( scalar(@revs) && greptex( qr/\\document(?:class|style)/ , $diff,25) ) ) {
# save filename for later processing if postscript or pdf conversion is requested and either two-file mode was used (scalar(@revs)==0) or the diff file contains documentclass statement (ie. is a root document)
push @difffiles, $diff ;
}
@@ -519,19 +537,20 @@ foreach $diff ( @difffiles ) {
if ( $run ) {
print STDERR "PDF: $pdf Postscript: $postscript cwd $cwd\n" if $debug;
- if ( system("grep -q \'^[^%]*\\\\bibliography{\' \"$diff\"") == 0 ) {
- system("$CFG{LATEX} --interaction=batchmode \"$diff\"; $CFG{BIBTEX} \"$diffbase\";");
+# if ( system("grep -q \'^[^%]*\\\\bibliography{\' \"$diff\"") == 0 ) {
+ if ( greptex('^[^%]*\\\\bibliography{',$diff ) == 0 ) {
+ system("$CFG{LATEX} -draftmode -interaction=batchmode \"$diff\"; $CFG{BIBTEX} \"$diffbase\";");
push @ptmpfiles, "$diffbase.bbl","$diffbase.bbl" ;
}
# if special needs, as CHANGEBAR
if ( $extracomp ) {
# print "Extracomp\n";
- system("$CFG{LATEX} --interaction=batchmode \"$diff\";");
+ system("$CFG{LATEX} -draftmode -interaction=batchmode \"$diff\";");
}
# final compilation
- system("$CFG{LATEX} --interaction=batchmode \"$diff\";"); # needed if cross-refs
+ system("$CFG{LATEX} -draftmode -interaction=batchmode \"$diff\";"); # needed if cross-refs
system("$CFG{LATEX} \"$diff\";"); # final, with possible error messages
if ( $rundvi2 ) {
@@ -586,10 +605,10 @@ sub findchangedpages {
my %start;
open(AUX,$auxfile) or die ("Could open aux file $auxfile . System error: $!");
while (<AUX>) {
- if (m/\\zref\@newlabel\{DIFchgb(\d*)\}\{.*\\abspage\{(\d*)\}\}/ ) {
+ if (m/\\zref\@newlabel\{DIFchgb(\d*)\}\{.*\\abspage\{(\d*)\}.*\}/ ) {
$start{$1}=$2; $pages{$2}=1;
}
- if (m/\\zref\@newlabel\{DIFchge(\d*)\}\{.*\\abspage\{(\d*)\}\}/) {
+ if (m/\\zref\@newlabel\{DIFchge(\d*)\}\{.*\\abspage\{(\d*)\}.*\}/) {
if (defined($start{$1})) {
for ($j=$start{$1}; $j<=$2; $j++) {
$pages{$j}=1;
@@ -643,12 +662,14 @@ sub compresspages {
return @res;
}
-# checkout_dir(rev,dirname)
+# checkout_dir(rev,dirname, <file>)
# checks out revision rev and stores it in dirname
-# uses global variables: $vc, $rootdir
+# If argument <file> is provided, check if this file imports a bibliography and generate it if necessary
+# uses global variables: $vc, $rootdir, $CFG
sub checkout_dir {
- my ($rev,$dirname)=@_;
+ my ($rev,$dirname,$file)=@_;
+ my ($filebase,$filedir);
unless (-e $dirname) { mkpath([ $dirname ]) or die "Cannot mkdir $dirname ." ;}
if ( $vc eq "SVN" ) {
system("svn checkout -r $rev $rootdir $dirname")==0 or die "Something went wrong in executing: svn checkout -r $rev $rootdir $dirname";
@@ -660,13 +681,25 @@ sub checkout_dir {
} else {
die "checkout_dir: only works with SVN, HG and GIT VCS system (selected: $vc)";
}
+ # Check if the main file needs a bbl generated
+ if ( defined($file) and greptex('^[^%]*\\\\bibliography\\{',$file) == 0) {
+ ($filebase,$filedir)=fileparse($file,".tex");
+ if ( ! -e "$filedir$filebase.bbl" ){
+ printf STDERR "Running $CFG{BIBTEX} to generate $filedir$filebase.bbl.\n";
+ system("cd '$dirname'; $CFG{LATEX} -draftmode -interaction=batchmode '$file'; $CFG{BIBTEX} '$filedir$filebase'")==0
+ or die "Something went wrong in executing: cd '$dirname'; $CFG{LATEX} -draftmode -interaction=batchmode '$file'; $CFG{BIBTEX} '$filedir$filebase'" ;
+ }
+# else { # DEBUG
+# printf STDERR "DEBUG: Skipping bbl file generation as $filedir$filebase.bbl already exists.\n"
+# } #DEBUG
+ }
}
-# greptex returns 1 if regex is not matched in filename
-# only the 25 first non-comment lines are scanned
+# greptex($regex,$filename, <lines>) returns 1 if regex is not matched in filename
+# only the first <lines> non-comment lines are scanned; by default everythin is scanned
# 0 if there is a match
sub greptex {
- my ($regex,$filename)=@_;
+ my ($regex,$filename,$nlines)=@_;
my ($i)=0;
open (FH, $filename) or die("Couldn't open $filename: $!");
while (<FH>) {
@@ -675,9 +708,9 @@ sub greptex {
close(FH);
return(0);
}
- # only scan 25 lines
+ # only scan <nlines> lines, if optional parameter proviede
$i++;
- last if $i>25 ;
+ last if defined($nlines) and $i>$nlines ;
}
close(FH);
return(1);
@@ -761,7 +794,7 @@ complete directory hierarchy. Optionally, a pathname F<path> can be specified,
=item B<--flatten,--flatten=keep-intermediate>
If combined with C<--git>, C<--svn> or C<--hg> option or the corresponding modes, check out the revisions to compare in a separate temporary directory, and then pass on option C<--flatten> to latexdiff. The directory in which C<latexdiff-vc> is invoked defines the subtree which will be checked out.
-Note that if additional files are needed which are not included in the flatten procedure (package files, included graphics), they need to be accessible in the current directory. If you use bibtex, it is recommended to include the C<.bbl> file in the version management.
+Note that if additional files are needed which are not included in the flatten procedure (package files, included graphics), they need to be accessible in the current directory. If you use bibtex, it is recommended to include the C<.bbl> file in the version management. From latexdiff-vc >=1.3.4 there is an attempt to create the C<.bbl> file by running bibtex in the retrieved subdirectories; note that the bibtex is run in the temporary subdirectories so any .bib or .bst files either need to be under version management, or in the global search paths for bibtex (shell environment variables C<BIBINPUTS> and C<BSTINPUTS>).
The generic usage of this function is : C<latexdiff-vc --flatten -r rev1 [-r rev2] master.tex> where master.tex is the project file containing the highest level of includes etc.
@@ -798,7 +831,7 @@ Available variables for latexdiff-vc:
=over 8
-=item C<LATEXDIFF> latexdiff command (e.g. latexdiff-fast, latexdiff-so). This command should support the option C<--interaction=batchmode>
+=item C<LATEXDIFF> latexdiff command (e.g. latexdiff-fast, latexdiff-so). This command should support the options C<-draftmode> and C<-interaction=batchmode>
=item C<LATEX> latex command (e.g. pdflatex, lualatex)
@@ -847,7 +880,7 @@ Show version number
=back
-All other options are passed on to C<latexdiff>.
+All other options are passed on to C<latexdiff>. Note that it is not always easy for latexdiff to correctly assign arguments to options when short form (single letter) options are used so it is recommended to use long-form options.
=head1 SEE ALSO
@@ -868,7 +901,7 @@ or send them to I<tilmann -- AT -- gfz-potsdam.de>. Include the version number
=head1 AUTHOR
-Version 1.3.2
+Version 1.3.4a
Copyright (C) 2005-2017 Frederik Tilmann
This program is free software; you can redistribute it and/or modify
diff --git a/support/latexdiff/latexdiff-vc.1 b/support/latexdiff/latexdiff-vc.1
index 8b6c6f8db7..8ed1715873 100644
--- a/support/latexdiff/latexdiff-vc.1
+++ b/support/latexdiff/latexdiff-vc.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "LATEXDIFF-VC 1"
-.TH LATEXDIFF-VC 1 "2022-03-05" "perl v5.30.0" " "
+.TH LATEXDIFF-VC 1 "2024-07-20" "perl v5.34.0" " "
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -204,7 +204,7 @@ complete directory hierarchy. Optionally, a pathname \fIpath\fR can be specifie
.IP "\fB\-\-flatten,\-\-flatten=keep\-intermediate\fR" 4
.IX Item "--flatten,--flatten=keep-intermediate"
If combined with \f(CW\*(C`\-\-git\*(C'\fR, \f(CW\*(C`\-\-svn\*(C'\fR or \f(CW\*(C`\-\-hg\*(C'\fR option or the corresponding modes, check out the revisions to compare in a separate temporary directory, and then pass on option \f(CW\*(C`\-\-flatten\*(C'\fR to latexdiff. The directory in which \f(CW\*(C`latexdiff\-vc\*(C'\fR is invoked defines the subtree which will be checked out.
-Note that if additional files are needed which are not included in the flatten procedure (package files, included graphics), they need to be accessible in the current directory. If you use bibtex, it is recommended to include the \f(CW\*(C`.bbl\*(C'\fR file in the version management.
+Note that if additional files are needed which are not included in the flatten procedure (package files, included graphics), they need to be accessible in the current directory. If you use bibtex, it is recommended to include the \f(CW\*(C`.bbl\*(C'\fR file in the version management. From latexdiff-vc >=1.3.4 there is an attempt to create the \f(CW\*(C`.bbl\*(C'\fR file by running bibtex in the retrieved subdirectories; note that the bibtex is run in the temporary subdirectories so any .bib or .bst files either need to be under version management, or in the global search paths for bibtex (shell environment variables \f(CW\*(C`BIBINPUTS\*(C'\fR and \f(CW\*(C`BSTINPUTS\*(C'\fR).
.Sp
The generic usage of this function is : \f(CW\*(C`latexdiff\-vc \-\-flatten \-r rev1 [\-r rev2] master.tex\*(C'\fR where master.tex is the project file containing the highest level of includes etc.
.Sp
@@ -232,9 +232,9 @@ Set configuration variables for latexdiff and latexdiff-vc. The option can be r
variables (as an alternative to the comma-separated list).
Available variables for latexdiff-vc:
.RS 4
-.ie n .IP """LATEXDIFF"" latexdiff command (e.g. latexdiff-fast, latexdiff-so). This command should support the option ""\-\-interaction=batchmode""" 8
-.el .IP "\f(CWLATEXDIFF\fR latexdiff command (e.g. latexdiff-fast, latexdiff-so). This command should support the option \f(CW\-\-interaction=batchmode\fR" 8
-.IX Item "LATEXDIFF latexdiff command (e.g. latexdiff-fast, latexdiff-so). This command should support the option --interaction=batchmode"
+.ie n .IP """LATEXDIFF"" latexdiff command (e.g. latexdiff-fast, latexdiff-so). This command should support the options ""\-draftmode"" and ""\-interaction=batchmode""" 8
+.el .IP "\f(CWLATEXDIFF\fR latexdiff command (e.g. latexdiff-fast, latexdiff-so). This command should support the options \f(CW\-draftmode\fR and \f(CW\-interaction=batchmode\fR" 8
+.IX Item "LATEXDIFF latexdiff command (e.g. latexdiff-fast, latexdiff-so). This command should support the options -draftmode and -interaction=batchmode"
.PD 0
.ie n .IP """LATEX"" latex command (e.g. pdflatex, lualatex)" 8
.el .IP "\f(CWLATEX\fR latex command (e.g. pdflatex, lualatex)" 8
@@ -280,7 +280,7 @@ Show help text
.IX Item "--version"
Show version number
.PP
-All other options are passed on to \f(CW\*(C`latexdiff\*(C'\fR.
+All other options are passed on to \f(CW\*(C`latexdiff\*(C'\fR. Note that it is not always easy for latexdiff to correctly assign arguments to options when short form (single letter) options are used so it is recommended to use long-form options.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
latexdiff
@@ -297,7 +297,7 @@ or send them to \fItilmann \*(-- \s-1AT\s0 \*(-- gfz\-potsdam.de\fR. Include th
(option \f(CW\*(C`\-\-version\*(C'\fR).
.SH "AUTHOR"
.IX Header "AUTHOR"
-Version 1.3.2
+Version 1.3.4a
Copyright (C) 2005\-2017 Frederik Tilmann
.PP
This program is free software; you can redistribute it and/or modify
diff --git a/support/latexdiff/latexdiff.1 b/support/latexdiff/latexdiff.1
index 53644f607e..a52d6f03ac 100644
--- a/support/latexdiff/latexdiff.1
+++ b/support/latexdiff/latexdiff.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "LATEXDIFF 1"
-.TH LATEXDIFF 1 "2022-09-25" "perl v5.30.0" " "
+.TH LATEXDIFF 1 "2024-07-20" "perl v5.34.0" " "
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -158,8 +158,8 @@ be real files (not pipes or similar) as they are opened twice (unless \f(CW\*(C`
The program treats the preamble differently from the main document.
Differences between the preambles are found using line-based
differencing (similarly to the Unix diff command, but ignoring white
-spaces). A comment, "\f(CW\*(C`%DIF\ >\*(C'\fR" is appended to each added line, i.e. a
-line present in \f(CW\*(C`new.tex\*(C'\fR but not in \f(CW\*(C`old.tex\*(C'\fR. Discarded lines
+spaces). A comment, "\f(CW\*(C`%DIF\ >\*(C'\fR" is appended to each added line, i.e. a
+line present in \f(CW\*(C`new.tex\*(C'\fR but not in \f(CW\*(C`old.tex\*(C'\fR. Discarded lines
are deactivated by prepending "\f(CW\*(C`%DIF\ <\*(C'\fR". Changed blocks are preceded by
comment lines giving information about line numbers in the original files. Where there are insignificant
differences, the resulting file \f(CW\*(C`diff.tex\*(C'\fR will be similar to
@@ -238,7 +238,7 @@ but the choice is yours. Any markup within the environment will be
removed, and generally everything within the environment will just be
taken from the new file.
.PP
-It is also possible to difference files which do not have a preamble.
+It is also possible to difference files which do not have a preamble.
In this case, the file is processed in the main document
mode, but the definitions of the markup commands are not inserted.
.PP
@@ -256,14 +256,14 @@ the scope of \f(CW\*(C`\eDIFadd\*(C'\fR. Added comments are marked by prependin
.PP
Within deleted blocks text is highlighted with \f(CW\*(C`\eDIFdel\*(C'\fR. Deleted
comments are marked by prepending "\f(CW\*(C`%DIF\ <\ \*(C'\fR\*(L". Non-safe command
-and curly braces within deleted blocks are commented out with
+and curly braces within deleted blocks are commented out with
\&\*(R"\f(CW\*(C`%DIFDELCMD\ <\ \*(C'\fR".
.SH "OPTIONS"
.IX Header "OPTIONS"
.SS "Preamble"
.IX Subsection "Preamble"
The following options determine the visual markup style by adding the appropriate
-command definitions to the preamble. See the end of this section for a description of
+command definitions to the preamble. See the end of this section for a description of
available styles.
.IP "\fB\-\-type=markupstyle\fR or \fB\-t markupstyle\fR" 4
.IX Item "--type=markupstyle or -t markupstyle"
@@ -271,8 +271,9 @@ Add code to preamble for selected markup style. This option defines
\&\f(CW\*(C`\eDIFadd\*(C'\fR and \f(CW\*(C`\eDIFdel\*(C'\fR commands.
Available styles:
.Sp
-\&\f(CW\*(C`UNDERLINE CTRADITIONAL TRADITIONAL CFONT FONTSTRIKE INVISIBLE
-CHANGEBAR CCHANGEBAR CULINECHBAR CFONTCHBAR BOLD PDFCOMMENT\*(C'\fR
+\&\f(CW\*(C`UNDERLINE CTRADITIONAL TRADITIONAL CFONT FONTSTRIKE INVISIBLE
+CHANGEBAR CCHANGEBAR CULINECHBAR CFONTCHBAR BOLD PDFCOMMENT
+LUAUNDERLINE\*(C'\fR
.Sp
[ Default: \f(CW\*(C`UNDERLINE\*(C'\fR ]
.IP "\fB\-\-subtype=markstyle\fR or \fB\-s markstyle\fR" 4
@@ -286,10 +287,10 @@ Available styles: \f(CW\*(C`SAFE MARGIN COLOR DVIPSCOL ZLABEL ONLYCHANGEDPAGE (
* Subtype \f(CW\*(C`LABEL\*(C'\fR is deprecated
.IP "\fB\-\-floattype=markstyle\fR or \fB\-f markstyle\fR" 4
.IX Item "--floattype=markstyle or -f markstyle"
-Add code to preamble for selected style which
+Add code to preamble for selected style which
replace standard marking and markup commands within floats
(e.g., marginal remarks cause an error within floats
-so marginal marking can be disabled thus). This option defines all
+so marginal marking can be disabled thus). This option defines all
\&\f(CW\*(C`\eDIF...FL\*(C'\fR commands.
Available styles: \f(CW\*(C`FLOATSAFE TRADITIONALSAFE IDENTICAL\*(C'\fR
.Sp
@@ -297,14 +298,14 @@ Available styles: \f(CW\*(C`FLOATSAFE TRADITIONALSAFE IDENTICAL\*(C'\fR
.IP "\fB\-\-encoding=enc\fR or \fB\-e enc\fR" 4
.IX Item "--encoding=enc or -e enc"
Specify encoding of old.tex and new.tex. Typical encodings are
-\&\f(CW\*(C`ascii\*(C'\fR, \f(CW\*(C`utf8\*(C'\fR, \f(CW\*(C`latin1\*(C'\fR, \f(CW\*(C`latin9\*(C'\fR. A list of available encodings can be
+\&\f(CW\*(C`ascii\*(C'\fR, \f(CW\*(C`utf8\*(C'\fR, \f(CW\*(C`latin1\*(C'\fR, \f(CW\*(C`latin9\*(C'\fR. A list of available encodings can be
obtained by executing
.Sp
\&\f(CW\*(C`perl \-MEncode \-e \*(Aqprint join ("\en",Encode\-\*(C'\fRencodings( \*(L":all\*(R" )) ;' >
.Sp
If this option is used, then old.tex, new.tex are only opened once.
[Default encoding is utf8 unless the first few lines of the preamble contain
-an invocation \f(CW\*(C`\eusepackage[..]{inputenc}\*(C'\fR in which case the
+an invocation \f(CW\*(C`\eusepackage[..]{inputenc}\*(C'\fR in which case the
encoding chosen by this command is asssumed. Note that \s-1ASCII\s0 (standard
latex) is a subset of utf8]
.IP "\fB\-\-preamble=file\fR or \fB\-p file\fR" 4
@@ -334,7 +335,7 @@ Ensure that \f(CW\*(C`\ebegin{figure}\*(C'\fR and \f(CW\*(C`\eend{figure}\*(C'\f
.ie n .IP """hyperref""" 8
.el .IP "\f(CWhyperref\fR" 8
.IX Item "hyperref"
-Change name of \f(CW\*(C`\eDIFadd\*(C'\fR and \f(CW\*(C`\eDIFdel\*(C'\fR commands to \f(CW\*(C`\eDIFaddtex\*(C'\fR and \f(CW\*(C`\eDIFdeltex\*(C'\fR and
+Change name of \f(CW\*(C`\eDIFadd\*(C'\fR and \f(CW\*(C`\eDIFdel\*(C'\fR commands to \f(CW\*(C`\eDIFaddtex\*(C'\fR and \f(CW\*(C`\eDIFdeltex\*(C'\fR and
define new \f(CW\*(C`\eDIFadd\*(C'\fR and \f(CW\*(C`\eDIFdel\*(C'\fR commands, which provide a wrapper for these commands,
using them for the text but not for the link defining command (where any markup would cause
errors).
@@ -384,13 +385,13 @@ Print generated or included preamble commands to stdout.
.IX Item "--append-safecmd=append-file or -a append-file or --append-safecmd=cmd1,cmd2,..."
.PD
Exclude from, replace or append to the list of regular expressions (RegEx)
-matching commands which are safe to use within the
+matching commands which are safe to use within the
scope of a \f(CW\*(C`\eDIFadd\*(C'\fR or \f(CW\*(C`\eDIFdel\*(C'\fR command. The file must contain
one Perl-RegEx per line (Comment lines beginning with # or % are
-ignored). Note that the RegEx needs to match the whole of
+ignored). Note that the RegEx needs to match the whole of
the token, i.e., /^regex$/ is implied and that the initial
-\&\*(L"\e\*(R" of the command is not included.
-The \fB\-\-exclude\-safecmd\fR and \fB\-\-append\-safecmd\fR options can be combined with the \-\fB\-\-replace\-safecmd\fR
+\&\*(L"\e\*(R" of the command is not included.
+The \fB\-\-exclude\-safecmd\fR and \fB\-\-append\-safecmd\fR options can be combined with the \-\fB\-\-replace\-safecmd\fR
option and can be used repeatedly to add cumulatively to the lists.
\fB\-\-exclude\-safecmd\fR
and \fB\-\-append\-safecmd\fR can also take a comma separated list as input. If a
@@ -422,7 +423,7 @@ entry for \fB\-\-exclude\-safecmd\fR directly above for further details.
Replace or append to the list of regex matching commands
whose last argument is text but which require a particular
context to work, e.g. \f(CW\*(C`\ecaption\*(C'\fR will only work within a figure
-or table. These commands behave like text commands, except when
+or table. These commands behave like text commands, except when
they occur in a deleted section, when they are disabled, but their
argument is shown as deleted text.
.IP "\fB\-\-replace\-context2cmd=replace\-file\fR" 4
@@ -438,7 +439,7 @@ As corresponding commands for context1. The only difference is that
context2 commands are completely disabled in deleted sections, including
their arguments.
.Sp
-context2 commands are also the only commands in the preamble, whose argument will be processed in
+context2 commands are also the only commands in the preamble, whose argument will be processed in
word-by-word mode (which only works, if they occur no more than once in the preamble). The algorithm currently cannot cope with repeated context2 commands in the preamble, as they occur e.g. for the \f(CW\*(C`\eauthor\*(C'\fR argument in some journal styles (not in the standard styles, though
If such a repetition is detected, the whole preamble will be processed in line-by-line mode. In such a case, use \f(CW\*(C`\-\-replace\-context2cmd\*(C'\fR option to just select the commands, which should be processed and are not used repeatedly in the preamble.
.ie n .IP "\fB\-\-exclude\-mboxsafecmd=exclude\-file\fR or \fB\-\-exclude\-mboxsafecmd=""cmd1,cmd2,...""\fR" 4
@@ -450,7 +451,7 @@ If such a repetition is detected, the whole preamble will be processed in line-b
.IX Item "--append-mboxsafecmd=append-file or --append-mboxsafecmd=cmd1,cmd2,..."
.PD
Define safe commands, which additionally need to be protected by encapsulating
-in an \f(CW\*(C`\embox{..}\*(C'\fR. This is sometimes needed to get around incompatibilities
+in an \f(CW\*(C`\embox{..}\*(C'\fR. This is sometimes needed to get around incompatibilities
between external packages and the ulem package, which is used for highlighting
in the default style \s-1UNDERLINE\s0 as well as \s-1CULINECHBAR CFONTSTRIKE\s0
.IP "\fB\-\-config var1=val1,var2=val2,...\fR or \fB\-c var1=val1,..\fR" 4
@@ -489,10 +490,10 @@ Available variables (see below for further explanations):
.IP "\fB\-\-add\-to\-config varenv1=pattern1,varenv2=pattern2,...\fR" 4
.IX Item "--add-to-config varenv1=pattern1,varenv2=pattern2,..."
For configuration variables, which are a regular expression (essentially those ending
-in \s-1ENV, COUNTERCMD\s0 and \s-1CUSTOMDIFCMD,\s0 see list above) this option provides an alternative way to modify the configuration
+in \s-1ENV, COUNTERCMD\s0 and \s-1CUSTOMDIFCMD,\s0 see list above) this option provides an alternative way to modify the configuration
variables. Instead of setting the complete pattern, with this option it is possible to add an
alternative pattern. \f(CW\*(C`varenv\*(C'\fR must be one of the variables listed above that take a regular
-expression as argument, and pattern is any regular expression (which might need to be
+expression as argument, and pattern is any regular expression (which might need to be
protected from the shell by quotation). Several patterns can be added at once by using semi-colons
to separate them, e.g. \f(CW\*(C`\-\-add\-to\-config "LISTENV=myitemize;myenumerate,COUNTERCMD=endnote"\*(C'\fR
.IP "\fB\-\-show\-safecmd\fR" 4
@@ -508,7 +509,7 @@ Show values of configuration variables.
.IX Item "--show-all"
Combine all \-\-show commands.
.Sp
-\&\s-1NB\s0 For all \-\-show commands, no \f(CW\*(C`old.tex\*(C'\fR or \f(CW\*(C`new.tex\*(C'\fR file needs to be specified, and no
+\&\s-1NB\s0 For all \-\-show commands, no \f(CW\*(C`old.tex\*(C'\fR or \f(CW\*(C`new.tex\*(C'\fR file needs to be specified, and no
differencing takes place.
.SS "Other configuration options:"
.IX Subsection "Other configuration options:"
@@ -521,20 +522,20 @@ default produces erroneous results. (Default requires arguments to
directly follow each other without intervening spaces).
.IP "\fB\-\-math\-markup=level\fR" 4
.IX Item "--math-markup=level"
-Determine granularity of markup in displayed math environments:
+Determine granularity of markup in displayed math environments:
Possible values for level are (both numerical and text labels are acceptable):
.Sp
-\&\f(CW\*(C`off\*(C'\fR or \f(CW0\fR: suppress markup for math environments. Deleted equations will not
-appear in diff file. This mode can be used if all the other modes
+\&\f(CW\*(C`off\*(C'\fR or \f(CW0\fR: suppress markup for math environments. Deleted equations will not
+appear in diff file. This mode can be used if all the other modes
cause invalid latex code.
.Sp
\&\f(CW\*(C`whole\*(C'\fR or \f(CW1\fR: Differencing on the level of whole equations. Even trivial changes
-to equations cause the whole equation to be marked changed. This
-mode can be used if processing in coarse or fine mode results in
+to equations cause the whole equation to be marked changed. This
+mode can be used if processing in coarse or fine mode results in
invalid latex code.
.Sp
\&\f(CW\*(C`coarse\*(C'\fR or \f(CW2\fR: Detect changes within equations marked up with a coarse
-granularity; changes in equation type (e.g.displaymath to equation)
+granularity; changes in equation type (e.g.displaymath to equation)
appear as a change to the complete equation. This mode is recommended
for situations where the content and order of some equations are still
being changed. [Default]
@@ -554,29 +555,29 @@ Possible values for level:
.Sp
\&\f(CW\*(C`new\-only\*(C'\fR or \f(CW1\fR: surround newly added or changed figures with a blue frame [Default if graphicx package loaded]
.Sp
-\&\f(CW\*(C`both\*(C'\fR or \f(CW2\fR: highlight new figures with a blue frame and show deleted figures at reduced
+\&\f(CW\*(C`both\*(C'\fR or \f(CW2\fR: highlight new figures with a blue frame and show deleted figures at reduced
scale, and crossed out with a red diagonal cross. Use configuration
variable \s-1SCALEDELGRAPHICS\s0 to set size of deleted figures.
.Sp
-Note that changes to the optional parameters will make the figure appear as changed
+Note that changes to the optional parameters will make the figure appear as changed
to latexdiff, and this figure will thus be highlighted.
.Sp
In some circumstances \*(L"Misplaced \enoalign\*(R" error can occur if there are certain types
-of changes in tables. In this case please use \f(CW\*(C`\-\-graphics\-markup=none\*(C'\fR as a
+of changes in tables. In this case please use \f(CW\*(C`\-\-graphics\-markup=none\*(C'\fR as a
work-around.
.IP "\fB\-\-no\-del\fR" 4
.IX Item "--no-del"
-Suppress deleted text from the diff. It is similar in effect to the \s-1BOLD\s0 style,
-but the deleted text ist not just invisible in the output, it is also not included in the diff text file.
+Suppress deleted text from the diff. It is similar in effect to the \s-1BOLD\s0 style,
+but the deleted text ist not just invisible in the output, it is also not included in the diff text file.
This can be more robust than just making it invisible.
.IP "\fB\-\-disable\-citation\-markup\fR or \fB\-\-disable\-auto\-mbox\fR" 4
.IX Item "--disable-citation-markup or --disable-auto-mbox"
-Suppress citation markup and markup of other vulnerable commands in styles
+Suppress citation markup and markup of other vulnerable commands in styles
using ulem (\s-1UNDERLINE,FONTSTRIKE, CULINECHBAR\s0)
(the two options are identical and are simply aliases)
.IP "\fB\-\-enable\-citation\-markup\fR or \fB\-\-enforce\-auto\-mbox\fR" 4
.IX Item "--enable-citation-markup or --enforce-auto-mbox"
-Protect citation commands and other vulnerable commands in changed sections
+Protect citation commands and other vulnerable commands in changed sections
with \f(CW\*(C`\embox\*(C'\fR command, i.e. use default behaviour for ulem package for other packages
(the two options are identical and are simply aliases)
.SS "Miscellaneous"
@@ -611,17 +612,17 @@ labels like this \f(CW\*(C`\-L labelold \-L labelnew\*(C'\fR.
Suppress inclusion of old and new file names as comment in output file
.IP "\fB\-\-visible\-label\fR" 4
.IX Item "--visible-label"
-Include old and new filenames (or labels set with \f(CW\*(C`\-\-label\*(C'\fR option) as
+Include old and new filenames (or labels set with \f(CW\*(C`\-\-label\*(C'\fR option) as
visible output.
.IP "\fB\-\-flatten\fR" 4
.IX Item "--flatten"
Replace \f(CW\*(C`\einput\*(C'\fR and \f(CW\*(C`\einclude\*(C'\fR commands within body by the content
of the files in their argument. If \f(CW\*(C`\eincludeonly\*(C'\fR is present in the
-preamble, only those files are expanded into the document. However,
-no recursion is done, i.e. \f(CW\*(C`\einput\*(C'\fR and \f(CW\*(C`\einclude\*(C'\fR commands within
-included sections are not expanded. The included files are assumed to
+preamble, only those files are expanded into the document. However,
+no recursion is done, i.e. \f(CW\*(C`\einput\*(C'\fR and \f(CW\*(C`\einclude\*(C'\fR commands within
+included sections are not expanded. The included files are assumed to
be located in the same directories as the old and new master files,
-respectively, making it possible to organise files into old and new directories.
+respectively, making it possible to organise files into old and new directories.
\&\-\-flatten is applied recursively, so inputted files can contain further
\&\f(CW\*(C`\einput\*(C'\fR statements. Also handles files included by the import package
(\f(CW\*(C`\eimport\*(C'\fR and \f(CW\*(C`\esubimport\*(C'\fR), and \f(CW\*(C`\esubfile\*(C'\fR command.
@@ -660,10 +661,15 @@ The major type determine the markup of plain text and some selected latex comman
.IX Item "UNDERLINE"
Added text is wavy-underlined and blue, discarded text is struck out and red
(Requires color and ulem packages). Overstriking does not work in displayed math equations such that deleted parts of equation are underlined, not struck out (this is a shortcoming inherent to the ulem package).
+.ie n .IP """LUAUNDERLINE""" 10
+.el .IP "\f(CWLUAUNDERLINE\fR" 10
+.IX Item "LUAUNDERLINE"
+Added text is underlined and blue, discarded text is struck out and red
+(Requires lua-ul package + LuaLaTeX).
.ie n .IP """CTRADITIONAL""" 10
.el .IP "\f(CWCTRADITIONAL\fR" 10
.IX Item "CTRADITIONAL"
-Added text is blue and set in sans-serif, and a red footnote is created for each discarded
+Added text is blue and set in sans-serif, and a red footnote is created for each discarded
piece of text. (Requires color package)
.ie n .IP """TRADITIONAL""" 10
.el .IP "\f(CWTRADITIONAL\fR" 10
@@ -723,7 +729,7 @@ from the intended position.
.IX Item "COLOR"
An alternative way of marking added passages in blue, and deleted ones in red.
(It is recommeneded to use instead the main types to effect colored markup,
-although in some cases coloring with dvipscol can be more complete, for example
+although in some cases coloring with dvipscol can be more complete, for example
with citation commands).
.ie n .IP """DVIPSCOL""" 10
.el .IP "\f(CWDVIPSCOL\fR" 10
@@ -747,7 +753,7 @@ there is floating material (figures, tables).
is similar to \f(CW\*(C`ZLABEL\*(C'\fR, but does not need the zref package and works less reliably (deprecated).
.SS "Float Types"
.IX Subsection "Float Types"
-Some of the markup used in the main text might cause problems when used within
+Some of the markup used in the main text might cause problems when used within
floats (e.g. figures or tables). For this reason alternative versions of all
markup commands are used within floats. The float type defines these alternative commands.
.ie n .IP """FLOATSAFE""" 10
@@ -767,7 +773,7 @@ Make no difference between the main text and floats.
.ie n .IP """ARRENV""" 10
.el .IP "\f(CWARRENV\fR" 10
.IX Item "ARRENV"
-If a match to \f(CW\*(C`ARRENV\*(C'\fR is found within an inline math environment within a deleted or added block, then the inlined math
+If a match to \f(CW\*(C`ARRENV\*(C'\fR is found within an inline math environment within a deleted or added block, then the inlined math
is surrounded by \f(CW\*(C`\embox{\*(C'\fR...\f(CW\*(C`}\*(C'\fR. This is necessary as underlining does not work within inlined array environments.
.Sp
[ Default: \f(CW\*(C`ARRENV\*(C'\fR=\f(CW\*(C`(?:array|[pbvBV]matrix)\*(C'\fR\
@@ -787,9 +793,9 @@ numbering in the new file.
This option is for advanced users and allows definition of special versions of commands, which do not work as safe commands.
.Sp
Commands in \f(CW\*(C`CUSTOMDIFCMD\*(C'\fR that occur in added or deleted blocks will be given an \s-1ADD\s0 or \s-1DEL\s0 prefix.
-The prefixed versions of the command must be defined in the preamble, either by putting them
+The prefixed versions of the command must be defined in the preamble, either by putting them
in the preamble of at least the new file, or by creating a custom preamble file (Option \-\-preamble).
-For example the command \f(CW\*(C`\eblindtext\*(C'\fR (from package blindtext) does not interact well with underlining, so that
+For example the command \f(CW\*(C`\eblindtext\*(C'\fR (from package blindtext) does not interact well with underlining, so that
for the standard markup type, it is not satisfactory to define it as a safe command. Instead, a customised versions
without underlining can be defined in the preamble:
.Sp
@@ -803,7 +809,7 @@ and then latexdiff should be invoked with the option \f(CW\*(C`\-c CUSTOMDIFCMD=
.ie n .IP """FLOATENV""" 10
.el .IP "\f(CWFLOATENV\fR" 10
.IX Item "FLOATENV"
-Environments whose name matches the regular expression in \f(CW\*(C`FLOATENV\*(C'\fR are
+Environments whose name matches the regular expression in \f(CW\*(C`FLOATENV\*(C'\fR are
considered floats. Within these environments, the \fIlatexdiff\fR markup commands
are replaced by their \s-1FL\s0 variaties.
.Sp
@@ -852,55 +858,62 @@ If \f(CW\*(C`\-\-graphics\-markup=both\*(C'\fR is chosen, \f(CW\*(C`SCALEDELGRAP
.ie n .IP """VERBATIMENV""" 10
.el .IP "\f(CWVERBATIMENV\fR" 10
.IX Item "VERBATIMENV"
-RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of these environments will not be processed in any way:
+RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of these environments will not be processed in any way:
deleted content is commented out, new content is not marked up
.Sp
[ Default: \f(CW\*(C`comment\*(C'\fR\ ]
.ie n .IP """VERBATIMLINEENV""" 10
.el .IP "\f(CWVERBATIMLINEENV\fR" 10
.IX Item "VERBATIMLINEENV"
-RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of environments described by \s-1VERBATIMLINEENV\s0 are compared in
+RegEx describing environments like verbatim, whose contents should be taken verbatim. The content of environments described by \s-1VERBATIMLINEENV\s0 are compared in
line mode, and changes are marked up using the listings package. The markup style is set based on the chosen mains markup type (Option \-t), or on an analysis
of the preamble.
-Note that \*(L"listings.sty\*(R" must be installed. If this file is not found the fallback solution is to
+Note that \*(L"listings.sty\*(R" must be installed. If this file is not found the fallback solution is to
treat \s-1VERBATIMLINEENV\s0 environments treated exactly the same way as \s-1VERBATIMENV\s0 environments.
.Sp
[ Default: \f(CW\*(C`(?:verbatim[*]?|lstlisting\*(C'\fR\ ]
.SH "COMMON PROBLEMS AND FAQ"
.IX Header "COMMON PROBLEMS AND FAQ"
-.IP "Citations result in overfull boxes" 10
-.IX Item "Citations result in overfull boxes"
+.IP "Changed citations result in overfull boxes" 10
+.IX Item "Changed citations result in overfull boxes"
There is an incompatibility between the \f(CW\*(C`ulem\*(C'\fR package, which \f(CW\*(C`latexdiff\*(C'\fR uses for underlining and striking out in the \s-1UNDERLINE\s0 style,
-the default style, and the way citations are generated. In order to be able to mark up citations properly, they are enclosed with an \f(CW\*(C`\embox\*(C'\fR
-command. As mboxes cannot be broken across lines, this procedure frequently results in overfull boxes, possibly obscuring the content as it extends beyond the right margin. The same occurs for some other packages (e.g., siunitx). If this is a problem, you have two possibilities.
+the default style, and the way citations are generated. In order to be able to mark up citations properly, they are enclosed with an \f(CW\*(C`\embox\*(C'\fR
+command. As mboxes cannot be broken across lines, this procedure frequently results in overfull boxes, possibly obscuring the content as it extends beyond the right margin. The same occurs for some other packages (e.g., siunitx). If this is a problem, you have several possibilities.
.Sp
1. Use \f(CW\*(C`CFONT\*(C'\fR type markup (option \f(CW\*(C`\-t CFONT\*(C'\fR): If this markup is chosen, then changed citations are no longer marked up
with the wavy line (additions) or struck out (deletions), but are still highlighted in the appropriate color, and deleted text is shown with a different font. Other styles not using the \f(CW\*(C`ulem\*(C'\fR package will also work.
.Sp
2. Choose option \f(CW\*(C`\-\-disable\-citation\-markup\*(C'\fR which turns off the marking up of citations: deleted citations are no longer shown, and
-added citations are shown without markup. (This was the default behaviour of latexdiff at versions 0.6 and older)
-.Sp
+added citations are shown without markup. (This was the default behaviour of latexdiff at versions 0.6 and older).
For custom packages you can define the commands which need to be protected by \f(CW\*(C`\embox\*(C'\fR with \f(CW\*(C`\-\-append\-mboxsafecmd\*(C'\fR and \f(CW\*(C`\-\-excludemboxsafecmd\*(C'\fR options
(submit your lists of command as feature request at github page to set the default behaviour of future versions, see section 6)
-.IP "Changes in complicated mathematical equations result in latex processing errors" 10
-.IX Item "Changes in complicated mathematical equations result in latex processing errors"
-Try options \f(CW\*(C`\-\-math\-markup=whole\*(C'\fR. If even that fails, you can turn off mark up for equations with \f(CW\*(C`\-\-math\-markup=off\*(C'\fR.
-.IP "How can I just show the pages where changes had been made" 10
-.IX Item "How can I just show the pages where changes had been made"
-Use options \-\f(CW\*(C`\-s ZLABEL\*(C'\fR (some postprocessing required) or \f(CW\*(C`\-s ONLYCHANGEDPAGE\*(C'\fR. \f(CW\*(C`latexdiff\-vc \-\-ps|\-\-pdf\*(C'\fR with \f(CW\*(C`\-\-only\-changes\*(C'\fR option takes care of
+.Sp
+3. If you are using luatex >= 1.12.0 you can use option \s-1LUAUNDERLINE\s0 that uses lua-ul instead of ulem for underlining, which does not have this problem (experimental feature).
+.IP "Changes in complicated mathematical equations result in latex processing errors." 10
+.IX Item "Changes in complicated mathematical equations result in latex processing errors."
+Try option \f(CW\*(C`\-\-math\-markup=whole\*(C'\fR. If even that fails, you can turn off mark up for equations with \f(CW\*(C`\-\-math\-markup=off\*(C'\fR.
+.IP "Deleted parts in equations are not struck out but underlined." 10
+.IX Item "Deleted parts in equations are not struck out but underlined."
+This is a limitation of the ulem package that implements the strike-out. If you use the amsmath package, then the strike-out command is redefined in such a way that deleted passages are wrapped with \f(CW\*(C`\etext\*(C'\fR command; adding \f(CW\*(C`\eusepackage{amsmath}\*(C'\fR to your preamble will trigger this behaviour. (If amsmath is not included directly, but imported by another package, latexdiff will not be able to detect its availability; in this case you can give latexdiff a hint with option \f(CW\*(C`\-\-packages=amsmath\*(C'\fR.
+.IP "How can I just show the pages where changes had been made?" 10
+.IX Item "How can I just show the pages where changes had been made?"
+Use options \f(CW\*(C`\-\-s ZLABEL\*(C'\fR (some postprocessing required) or \f(CW\*(C`\-s ONLYCHANGEDPAGE\*(C'\fR. \f(CW\*(C`latexdiff\-vc \-\-ps|\-\-pdf\*(C'\fR with \f(CW\*(C`\-\-only\-changes\*(C'\fR option takes care of
the post-processing for you (requires zref package to be installed).
+.IP "The character encoding breaks when running latexdiff from powershell." 10
+.IX Item "The character encoding breaks when running latexdiff from powershell."
+This problem is not limited to \f(CW\*(C`latexdiff\*(C'\fR and has to do with the default settings of \f(CW\*(C`powershell\*(C'\fR in Windows. It is recommended to use \f(CW\*(C`cmd\*(C'\fR instead.
.SH "BUGS"
.IX Header "BUGS"
.IP "Option allow-spaces not implemented entirely consistently. It breaks the rules that number and type of white space does not matter, as different numbers of inter-argument spaces are treated as significant." 10
.IX Item "Option allow-spaces not implemented entirely consistently. It breaks the rules that number and type of white space does not matter, as different numbers of inter-argument spaces are treated as significant."
.PP
-Please submit bug reports using the issue tracker of the github repository page \fIhttps://github.com/ftilmann/latexdiff.git\fR,
+Please submit bug reports using the issue tracker of the github repository page \fIhttps://github.com/ftilmann/latexdiff.git\fR,
or send them to \fItilmann \*(-- \s-1AT\s0 \*(-- gfz\-potsdam.de\fR. Include the version number of \fIlatexdiff\fR
(from comments at the top of the source or use \fB\-\-version\fR). If you come across latex
files that are error-free and conform to the specifications set out
above, and whose differencing still does not result in error-free
latex, please send me those files, ideally edited to only contain the
-offending passage as long as that still reproduces the problem. If your
+offending passage as long as that still reproduces the problem. If your
file relies on non-standard class files, you must include those. I will not
look at examples where I have trouble to latex the original files.
.SH "SEE ALSO"
@@ -909,22 +922,22 @@ latexrevise, latexdiff-vc
.SH "PORTABILITY"
.IX Header "PORTABILITY"
\&\fIlatexdiff\fR does not make use of external commands and thus should run
-on any platform supporting Perl 5.6 or higher. If files with encodings
+on any platform supporting Perl 5.6 or higher. If files with encodings
other than \s-1ASCII\s0 or \s-1UTF\-8\s0 are processed, Perl 5.8 or higher is required.
.PP
The standard version of \fIlatexdiff\fR requires installation of the Perl package
-\&\f(CW\*(C`Algorithm::Diff\*(C'\fR (available from \fIwww.cpan.org\fR \-
+\&\f(CW\*(C`Algorithm::Diff\*(C'\fR (available from \fIwww.cpan.org\fR \-
\&\fIhttp://search.cpan.org/~nedkonz/Algorithm\-Diff\-1.15\fR) but a stand-alone
version, \fIlatexdiff-so\fR, which has this package inlined, is available, too.
\&\fIlatexdiff-fast\fR requires the \fIdiff\fR command to be present.
.SH "AUTHOR"
.IX Header "AUTHOR"
-Version 1.3.3
-Copyright (C) 2004\-2022 Frederik Tilmann
+Version 1.3.4
+Copyright (C) 2004\-2024 Frederik Tilmann
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the \s-1GNU\s0 General Public License Version 3
.PP
-Contributors of fixes and additions: V. Kuhlmann, J. Paisley, N. Becker, T. Doerges, K. Huebner,
+Contributors of fixes and additions: V. Kuhlmann, J. Paisley, N. Becker, T. Doerges, K. Huebner,
T. Connors, Sebastian Gouezel and many others.
Thanks to the many people who sent in bug reports, feature suggestions, and other feedback.
diff --git a/support/latexdiff/latexrevise.1 b/support/latexdiff/latexrevise.1
index a67d09564f..d2d91dbe41 100644
--- a/support/latexdiff/latexrevise.1
+++ b/support/latexdiff/latexrevise.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "LATEXREVISE 1"
-.TH LATEXREVISE 1 "2021-12-27" "perl v5.30.0" " "
+.TH LATEXREVISE 1 "2021-12-27" "perl v5.34.0" " "
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/support/latexindent/LatexIndent/GetYamlSettings.pm b/support/latexindent/LatexIndent/GetYamlSettings.pm
index 4d4940371d..cbea5437c6 100644
--- a/support/latexindent/LatexIndent/GetYamlSettings.pm
+++ b/support/latexindent/LatexIndent/GetYamlSettings.pm
@@ -389,36 +389,8 @@ sub yaml_read_settings {
# output the contents of indentconfig to the log file
$logger->info( Dump \%{ $userSettings->[0] } );
- # change the encoding of the paths according to the field `encoding`
- if ( $userSettings and ( ref( $userSettings->[0] ) eq 'HASH' ) and $userSettings->[0]->{encoding} ) {
- use Encode;
- my $encoding = $userSettings->[0]->{encoding};
- my $encodingObject = find_encoding($encoding);
-
- # Check if the encoding is valid.
- if ( ref($encodingObject) ) {
- $logger->info("*Encoding of the paths is $encoding");
- foreach ( @{ $userSettings->[0]->{paths} } ) {
- my $temp = $encodingObject->encode("$_");
- $logger->info("Transform file encoding: $_ -> $temp");
- push( @absPaths, $temp );
- }
- }
- else {
- $logger->warn("*encoding \"$encoding\" not found");
- $logger->warn("Ignore this setting and will take the default encoding.");
- @absPaths = @{ $userSettings->[0]->{paths} };
- foreach ( @{ $userSettings->[0]->{paths} } ) {
- push( @absPaths, $_ );
- }
- }
- }
- else # No such setting, and will take the default
- {
- # $logger->info("*Encoding of the paths takes the default.");
- foreach ( @{ $userSettings->[0]->{paths} } ) {
- push( @absPaths, $_ );
- }
+ foreach ( @{ $userSettings->[0]->{paths} } ) {
+ push( @absPaths, $_ );
}
}
@@ -777,6 +749,9 @@ sub yaml_read_settings {
my $parent = $keysValues[0];
my $child = $keysValues[1];
my $grandchild = $keysValues[2];
+
+ delete $mainSettings{$parent}{$child} if (defined $mainSettings{$parent}{$child} and ref $mainSettings{$parent}{$child} ne "HASH" );
+
$logger->info("Updating mainSettings with $parent: $child: $grandchild: $value");
$mainSettings{$parent}{$child}{$grandchild} = $value;
}
diff --git a/support/latexindent/LatexIndent/Logger.pm b/support/latexindent/LatexIndent/Logger.pm
index 425c8eae07..7c4352a95f 100644
--- a/support/latexindent/LatexIndent/Logger.pm
+++ b/support/latexindent/LatexIndent/Logger.pm
@@ -18,7 +18,7 @@ package LatexIndent::Logger;
use strict;
use warnings;
-use Exporter;
+use Exporter qw/import/;
use LatexIndent::Switches qw/%switches/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK = qw/@logFileLines/;
diff --git a/support/latexindent/LatexIndent/Sentence.pm b/support/latexindent/LatexIndent/Sentence.pm
index 9a7f32e7db..465f2310b3 100644
--- a/support/latexindent/LatexIndent/Sentence.pm
+++ b/support/latexindent/LatexIndent/Sentence.pm
@@ -49,7 +49,7 @@ sub one_sentence_per_line {
{
if ($yesNo) {
if ( $sentencesFollowEachPart eq "par" ) {
- $sentencesFollowEachPart = qr/\R?\\par/s;
+ $sentencesFollowEachPart = qr/\R?\\par(?![a-zA-Z])/s;
}
elsif ( $sentencesFollowEachPart eq "blankLine" ) {
$sentencesFollowEachPart = qr/
@@ -207,7 +207,7 @@ sub one_sentence_per_line {
# similarly for \par
if ( ${ ${ $mainSettings{modifyLineBreaks}{oneSentencePerLine} }{sentencesFollow} }{par} ) {
- $notWithinSentence .= "|" . qr/(?:\R?\\par)/s;
+ $notWithinSentence .= "|" . qr/(?:\R?\\par(?![a-zA-Z]))/s;
}
my $sentenceRegEx = qr/
diff --git a/support/latexindent/LatexIndent/Special.pm b/support/latexindent/LatexIndent/Special.pm
index 096d2935c9..8dac47bfc0 100644
--- a/support/latexindent/LatexIndent/Special.pm
+++ b/support/latexindent/LatexIndent/Special.pm
@@ -17,14 +17,14 @@ package LatexIndent::Special;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
+use Exporter qw/import/;
use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
use LatexIndent::GetYamlSettings qw/%mainSettings/;
use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
use LatexIndent::LogFile qw/$logger/;
-use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::IfElseFi;
use Data::Dumper;
-use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK
= qw/find_special construct_special_begin $specialBeginAndBracesBracketsBasicRegExp $specialBeginBasicRegExp/;
diff --git a/support/latexindent/LatexIndent/TrailingComments.pm b/support/latexindent/LatexIndent/TrailingComments.pm
index 9d6532500a..5e47ae3f3f 100644
--- a/support/latexindent/LatexIndent/TrailingComments.pm
+++ b/support/latexindent/LatexIndent/TrailingComments.pm
@@ -27,12 +27,20 @@ our @EXPORT_OK
= qw/remove_trailing_comments put_trailing_comments_back_in $trailingCommentRegExp add_comment_symbol construct_trailing_comment_regexp @trailingComments/;
our @trailingComments;
our $commentCounter = 0;
+our $notPrecededByRegExp;
our $trailingCommentRegExp;
sub construct_trailing_comment_regexp {
- my $notPreceededBy = qr/${${$mainSettings{fineTuning}}{trailingComments}}{notPreceededBy}/;
+ $notPrecededByRegExp = qr/${${$mainSettings{fineTuning}}{trailingComments}}{notPrecededBy}/;
+ my $notPreceededBy = ${${mainSettings{fineTuning}}{trailingComments}}{notPreceededBy};
- $trailingCommentRegExp = qr/$notPreceededBy%$tokens{trailingComment}\d+$tokens{endOfToken}/;
+ if ( $notPreceededBy ) {
+ $logger->warn(
+ "*fineTuning:trailingComments:notPreceededBy is ok for now, but in future versions, fineTuning:trailingComments:notPrecededBy will be used" );
+ $notPrecededByRegExp = qr/$notPreceededBy/;
+ }
+
+ $trailingCommentRegExp = qr/$notPrecededByRegExp%$tokens{trailingComment}\d+$tokens{endOfToken}/;
}
sub add_comment_symbol {
@@ -66,17 +74,16 @@ sub remove_trailing_comments {
$logger->trace("*Storing trailing comments") if $is_t_switch_active;
- my $notPreceededBy = qr/${${$mainSettings{fineTuning}}{trailingComments}}{notPreceededBy}/;
- my $afterComment = qr/${${$mainSettings{fineTuning}}{trailingComments}}{afterComment}/;
+ my $afterComment = qr/${${$mainSettings{fineTuning}}{trailingComments}}{afterComment}/;
# perform the substitution
${$self}{body} =~ s/
- $notPreceededBy # not preceded by a \
- % # %
+ $notPrecededByRegExp # not preceded by a \
+ % # %
(
- $afterComment # anything else
+ $afterComment # anything else
)
- $ # up to the end of a line
+ $ # up to the end of a line
/
# increment comment counter and store comment
$commentCounter++;
@@ -134,14 +141,13 @@ sub put_trailing_comments_back_in {
# replace the line-broken trailing comment ID with a non-broken trailing comment ID
${$self}{body} =~ s/%\R?$trailingcommentIDwithLineBreaksRegExp/%$trailingcommentID/s;
}
- my $notPreceededBy = qr/${${$mainSettings{fineTuning}}{trailingComments}}{notPreceededBy}/;
if (${$self}{body} =~ m/%$trailingcommentID
(
- (?! # not immediately preceded by
- $notPreceededBy # \
- % # %
+ (?! # not immediately preceded by
+ $notPrecededByRegExp # \
+ % # %
).*?
- ) # captured into $1
+ ) # captured into $1
(\h*)?$
/mx and $1 ne ''
)
diff --git a/support/latexindent/LatexIndent/UTF8CmdLineArgsFileOperation.pm b/support/latexindent/LatexIndent/UTF8CmdLineArgsFileOperation.pm
index 45a2b6f538..d6d8b595c0 100644
--- a/support/latexindent/LatexIndent/UTF8CmdLineArgsFileOperation.pm
+++ b/support/latexindent/LatexIndent/UTF8CmdLineArgsFileOperation.pm
@@ -5,22 +5,39 @@ use warnings;
use feature qw( say state );
use utf8;
use Config qw( %Config );
-use Encode qw( decode encode );
+use Encode qw(find_encoding decode encode );
use Exporter qw/import/;
our @EXPORT_OK
= qw/commandlineargs_with_encode @new_args copy_with_encode exist_with_encode open_with_encode zero_with_encode read_yaml_with_encode isdir_with_encode mkdir_with_encode/;
+our $encodingObject;
+
+if ($^O eq 'MSWin32') {
+ my $encoding_sys = 'cp' . Win32::GetACP();
+ $encodingObject = find_encoding( $encoding_sys );
+
+ # Check if the encoding is valid.
+ unless ( ref($encodingObject) ) {
+ $encodingObject = find_encoding( 'utf-8' );
+ }
+}
+else {
+ $encodingObject = find_encoding( 'utf-8' );
+}
+
sub copy_with_encode {
use File::Copy;
my ( $source, $destination ) = @_;
- if ( $FindBin::Script eq 'latexindent.exe' ) {
+ if ( $FindBin::Script =~ /\.exe$/ ) {
require Win32::Unicode::File;
Win32::Unicode::File->import(qw(copyW));
copyW( $source, $destination, 1 );
}
else {
+ $source = $encodingObject->encode($source);
+ $destination = $encodingObject->encode($destination);
copy( $source, $destination );
}
}
@@ -28,12 +45,13 @@ sub copy_with_encode {
sub exist_with_encode {
my ($filename) = @_;
- if ( $FindBin::Script eq 'latexindent.exe' ) {
+ if ( $FindBin::Script =~ /\.exe$/ ) {
require Win32::Unicode::File;
Win32::Unicode::File->import(qw(statW));
return statW($filename);
}
else {
+ $filename = $encodingObject->encode($filename);
return -e $filename;
}
}
@@ -41,7 +59,7 @@ sub exist_with_encode {
sub zero_with_encode {
my ($filename) = @_;
- if ( $FindBin::Script eq 'latexindent.exe' ) {
+ if ( $FindBin::Script =~ /\.exe$/ ) {
require Win32::Unicode::File;
Win32::Unicode::File->import(qw(file_size));
my $size = file_size($filename);
@@ -53,6 +71,7 @@ sub zero_with_encode {
}
}
else {
+ $filename = $encodingObject->encode($filename);
return -z $filename;
}
}
@@ -62,7 +81,7 @@ sub open_with_encode {
my $filename = shift;
my $fh;
- if ( $FindBin::Script eq 'latexindent.exe' ) {
+ if ( $FindBin::Script =~ /\.exe$/ ) {
require Win32::Unicode::File;
Win32::Unicode::File->import;
$fh = Win32::Unicode::File->new;
@@ -74,6 +93,7 @@ sub open_with_encode {
}
}
else {
+ $filename = $encodingObject->encode($filename);
if ( open( $fh, $mode, $filename ) ) {
return $fh;
}
@@ -95,13 +115,14 @@ sub read_yaml_with_encode {
sub isdir_with_encode {
my $path = shift;
- if ( $FindBin::Script eq 'latexindent.exe' ) {
+ if ( $FindBin::Script =~ /\.exe$/ ) {
require Win32::Unicode::File;
Win32::Unicode::File->import(qw(file_type));
return file_type( 'd', $path );
}
else {
+ $path = $encodingObject->encode($path);
return -d $path;
}
}
@@ -109,7 +130,7 @@ sub isdir_with_encode {
sub mkdir_with_encode {
my $path = shift;
- if ( $FindBin::Script eq 'latexindent.exe' ) {
+ if ( $FindBin::Script =~ /\.exe$/ ) {
require Win32::Unicode::Dir;
Win32::Unicode::Dir->import(qw(mkdirW));
@@ -118,7 +139,7 @@ sub mkdir_with_encode {
else {
require File::Path;
File::Path->import(qw(make_path));
-
+ $path = $encodingObject->encode($path);
make_path($path);
}
}
@@ -126,7 +147,7 @@ sub mkdir_with_encode {
#https://stackoverflow.com/a/63868721
#https://stackoverflow.com/a/44489228
sub commandlineargs_with_encode {
- if ( $FindBin::Script eq 'latexindent.exe' ) {
+ if ( $FindBin::Script =~ /\.exe$/ ) {
require Win32::API;
import Win32::API qw( ReadMemory );
@@ -207,7 +228,6 @@ sub commandlineargs_with_encode {
@ARGV = @{$args};
}
else {
- my $encodingObject = "utf-8";
@ARGV = map { decode( $encodingObject, $_ ) } @ARGV;
our @new_args = @ARGV;
}
diff --git a/support/latexindent/LatexIndent/Version.pm b/support/latexindent/LatexIndent/Version.pm
index b42ea7bdaf..039d492356 100644
--- a/support/latexindent/LatexIndent/Version.pm
+++ b/support/latexindent/LatexIndent/Version.pm
@@ -20,6 +20,6 @@ use warnings;
use Exporter qw/import/;
our @EXPORT_OK = qw/$versionNumber $versionDate/;
-our $versionNumber = '3.24';
-our $versionDate = '2024-04-28';
+our $versionNumber = '3.24.4';
+our $versionDate = '2024-07-18';
1
diff --git a/support/latexindent/LatexIndent/Wrap.pm b/support/latexindent/LatexIndent/Wrap.pm
index 334902dc66..1116b05fa8 100644
--- a/support/latexindent/LatexIndent/Wrap.pm
+++ b/support/latexindent/LatexIndent/Wrap.pm
@@ -659,6 +659,13 @@ sub text_wrap_comment_blocks {
# call the text wrapping routine
my $columns = ${ $mainSettings{modifyLineBreaks}{textWrapOptions} }{columns};
+ # fail gracefully if columns == 0
+ if ($columns==0){
+ $logger->warn("* textWrapOptions: columns is set to 0, can't text wrap with this");
+ ${ ${ $mainSettings{modifyLineBreaks}{textWrapOptions} }{comments} }{wrap} = 0;
+ return;
+ }
+
#
# text wrap comment blocks
#
diff --git a/support/latexindent/README b/support/latexindent/README
index 6b589faadf..3bd2dbfe98 100644
--- a/support/latexindent/README
+++ b/support/latexindent/README
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- latexindent.pl, version 3.24, 2024-04-28
+ latexindent.pl, version 3.24.4, 2024-07-18
PERL script to indent code within environments, and align delimited
environments in .tex files.
diff --git a/support/latexindent/bin/linux/latexindent b/support/latexindent/bin/linux/latexindent
index 60df957ca2..f6337243cb 100644
--- a/support/latexindent/bin/linux/latexindent
+++ b/support/latexindent/bin/linux/latexindent
Binary files differ
diff --git a/support/latexindent/bin/macos/latexindent b/support/latexindent/bin/macos/latexindent
index 3be492c85a..63421aa529 100644
--- a/support/latexindent/bin/macos/latexindent
+++ b/support/latexindent/bin/macos/latexindent
Binary files differ
diff --git a/support/latexindent/defaultSettings.yaml b/support/latexindent/defaultSettings.yaml
index 1d281dd7fa..7ad03f254b 100644
--- a/support/latexindent/defaultSettings.yaml
+++ b/support/latexindent/defaultSettings.yaml
@@ -1,5 +1,5 @@
#
-# latexindent.pl, version 3.24, 2024-04-28
+# latexindent.pl, version 3.24.4, 2024-07-18
#
# defaultSettings.yaml, the default settings for latexindent.pl
#
@@ -649,7 +649,7 @@ fineTuning:
before: (?:#\d\h*;?,?\/?)+|\<.*?\>
between: _|\^|\*
trailingComments:
- notPreceededBy: (?<!\\)
+ notPrecededBy: (?<!\\)
afterComment: .*?
modifyLineBreaks:
doubleBackSlash: \\\\(?:\h*\[\h*\d+\h*[a-zA-Z]+\h*\])?
diff --git a/support/latexindent/documentation/contributors.bib b/support/latexindent/documentation/contributors.bib
index 2da6ea818d..49fc2debe7 100644
--- a/support/latexindent/documentation/contributors.bib
+++ b/support/latexindent/documentation/contributors.bib
@@ -224,3 +224,14 @@
author = "Jesse Stricker",
urldate = {2023-07-12},
keywords = {contributor},}
+
+%
+% 2024
+%
+@online{fengzyf,
+ title = "Encoding work",
+ url = "https://github.com/cmhughes/latexindent.pl/pull/548",
+ date = {2024-06-15},
+ author = "fengzyf",
+ urldate = {2024-06-15},
+ keywords = {contributor},}
diff --git a/support/latexindent/documentation/latexindent-yaml-schema.json b/support/latexindent/documentation/latexindent-yaml-schema.json
index 397d577e92..8f0cf208e2 100644
--- a/support/latexindent/documentation/latexindent-yaml-schema.json
+++ b/support/latexindent/documentation/latexindent-yaml-schema.json
@@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/schema",
"$id": "latexindent-yaml-schema.json",
"title": "latexindent.pl YAML schema",
- "description": "latexindent.pl YAML schema helper, V3.24 2024-04-28",
+ "description": "latexindent.pl YAML schema helper, V3.24.4 2024-07-18",
"type": "object",
"properties": {
"fileExtensionPreference": {
@@ -1496,10 +1496,15 @@
"description": "fine tuning, for trailing comments",
"type": "object",
"properties": {
- "notPreceededBy": {
+ "notPrecededBy": {
"description": "regular expression for what can NOT come before %, for example \\%",
"type": "string"
},
+ "notPreceededBy": {
+ "description": "please use notPrecededBy instead",
+ "type": "string",
+ "deprecated": true
+ },
"afterComment": {
"description": "regular expression for what can come after %",
"type": "string"
diff --git a/support/latexindent/documentation/latexindent.pdf b/support/latexindent/documentation/latexindent.pdf
index 9555a30a14..19361f5268 100644
--- a/support/latexindent/documentation/latexindent.pdf
+++ b/support/latexindent/documentation/latexindent.pdf
Binary files differ
diff --git a/support/latexindent/documentation/latexindent.tex b/support/latexindent/documentation/latexindent.tex
index fc96a1db9a..fefde34ec2 100644
--- a/support/latexindent/documentation/latexindent.tex
+++ b/support/latexindent/documentation/latexindent.tex
@@ -131,6 +131,7 @@
% bibliographies
\addbibresource{latex-indent}
\addbibresource{contributors}
+\BiblatexSplitbibDefernumbersWarningOff
% http://tex.stackexchange.com/questions/122135/how-to-add-a-png-icon-on-the-right-side-of-a-tcolorbox-title
\newtcolorbox{warning}{parbox=false,
@@ -585,14 +586,14 @@
title={example~\thetcbcounter},
fonttitle=\bfseries\sffamily,
detach title,
- before upper={\llap{\tcbtitle\hspace{5mm}}},
coltitle=black,
colback=white,
grow to left by=6mm,
%
% circles and line by the side
%
- overlay unbroken={%
+ overlay unbroken and first={%
+ \node at ([xshift=-8mm,yshift=-4.5mm]interior.north west) {\bfseries example \thetcbcounter};
\path [fill=black] ([xshift=1mm,yshift=3mm]interior.south east) node{\hbox{\rule{1ex}{1ex}}};
},
overlay last={%
@@ -859,6 +860,9 @@
throughout this document for details}.
\subsection{Quick start}\label{sec:quickstart}
+ When \texttt{latexindent.pl} reads and writes files, the files are read and written in UTF-8 format by default.
+ That is to say, the encoding format for tex and yaml files needs to be in UTF-8 format.
+
If you'd like to get started with \texttt{latexindent.pl} then simply type
\begin{commandshell}
@@ -1224,6 +1228,10 @@ perl latexindent-module-installer.pl
written to \texttt{indent.log}, but other additional information will be written
depending on which of the following options are used.
+ When using \texttt{latexindent.pl} in different ways on different systems, the range of
+ characters supported by its switches/flags/options may vary. We discuss these in Section
+ \cref{app:encoding}.
+
\flagbox{-v, --version}
\index{switches!-v, --version definition and details}
\announce{2017-06-25}{version}
@@ -1865,17 +1873,6 @@ latexindent.pl myfile.tex
\texttt{latexindent.yaml} and friends settings files. This can lead to creative nesting
of configuration files; a demonstration is given in \vref{sec:appendix:paths}.
- If you find that \announce{2021-06-19}{encoding option for indentconfig.yaml}
- \texttt{latexindent.pl} does not read your YAML file, then it might be as a result of
- the default commandline encoding not being UTF-8; normally this will only occur for
- Windows users. In this case, you might like to explore the \texttt{encoding} option for
- \texttt{indentconfig.yaml} as demonstrated in \cref{lst:indentconfig-encoding}.%
-
- \cmhlistingsfromfile[style=yaml-LST]{demonstrations/encoding.yaml}[yaml-TCB]{The \texttt{encoding} option for \texttt{indentconfig.yaml}}{lst:indentconfig-encoding}
-
- Thank you to \cite{qiancy98} for this contribution; please see \vref{app:encoding} and
- details within \cite{encoding} for further information.
-
\subsection{localSettings.yaml and friends}\label{sec:localsettings}
The \texttt{-l} switch tells \texttt{latexindent.pl} to look for
\texttt{localSettings.yaml} and/or friends in the \emph{same directory} as
@@ -8567,8 +8564,8 @@ perl latexindent-module-installer.pl
\begin{commandshell}
sudo apt-get install perlbrew
perlbrew init
-perlbrew install perl-5.34.0
-perlbrew switch perl-5.34.0
+perlbrew install perl-5.40.0
+perlbrew switch perl-5.40.0
sudo apt-get install curl
curl -L http://cpanmin.us | perl - App::cpanminus
cpanm YAML::Tiny
@@ -8614,21 +8611,19 @@ sudo apt install texlive-extra-utils
\index{latexindent-linux} \index{linux} \index{TeXLive}
\paragraph{Arch-based distributions}
- First install the dependencies
+ \texttt{latexindent} is included in Arch-packaged TeX Live, and can be installed by:
\begin{commandshell}
-sudo pacman -S perl cpanminus
+sudo pacman -S texlive-binextra perl-yaml-tiny perl-file-homedir
\end{commandshell}
- In addition, install \texttt{perl-file-homedir} from AUR, using your AUR helper of
- choice,
+ To enable optional \texttt{--GCString} switch, install
+ \texttt{perl-unicode-linebreak}:
\begin{commandshell}
-sudo paru -S perl-file-homedir
+sudo pacman -S perl-unicode-linebreak
\end{commandshell}
- then run the latexindent-module-installer.pl file located at helper-scripts/
-
\paragraph{Alpine}
If you are using Alpine, some \texttt{Perl} modules are not build-compatible with
Alpine, but replacements are available through \texttt{apk}. For example, you might
@@ -9427,21 +9422,33 @@ TRACE: Searching myenv for optional and mandatory arguments
and \lstinline!-----! respectively.
\end{example}
- \section{Encoding indentconfig.yaml}\label{app:encoding}
- In relation to \vref{sec:indentconfig}, Windows users that encounter encoding issues
- with \texttt{indentconfig.yaml}, may wish to run the following command in either
- \texttt{cmd.exe} or \texttt{powershell.exe}:
+ \section{Encoding}\label{app:encoding}
+
+ When using latexindent in different ways on different systems, the range of characters
+ supported by its switches/flags/options (see \vref{sec:commandline}) may vary.
+
+ For the Windows executable file \texttt{latexindent.exe}, its options support UTF-8
+ characters.
+
+ For the Windows Perl script \texttt{latexindent.pl}, its option switch supports the
+ characters supported by the encoding corresponding to the system code page. You can
+ check the system code page by running the following command in either \texttt{cmd.exe}
+ or \texttt{powershell.exe}:
\begin{dosprompt}
-chcp
- \end{dosprompt}
- They may receive the following result
+ chcp
+ \end{dosprompt}
+ which may receive the following result
\begin{dosprompt}
-Active code page: 936
- \end{dosprompt}
- and can then use the settings given in \cref{lst:indentconfig-encoding1} within their
- \texttt{indentconfig.yaml}, where 936 is the result of the \texttt{chcp} command.
-
- \cmhlistingsfromfile[style=yaml-LST]{demonstrations/encoding1.yaml}[yaml-TCB]{\texttt{encoding} demonstration for \texttt{indentconfig.yaml}}{lst:indentconfig-encoding1}
+ Active code page: 936
+ \end{dosprompt}
+ and then the characters supported by the code page can be found in \href{Microsoft's
+ code page identifier
+ table}{https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers}. For
+ example, the characters supported by the encoding corresponding to code page 936 are:
+ ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312).
+
+ For Ubuntu Linux and macOS users, whether using the Perl script or the executable file,
+ the options support UTF-8 characters.
\section{dos2unix linebreak adjustment}
diff --git a/support/latexindent/latexindent.pl b/support/latexindent/latexindent.pl
index 2c2232a046..a467fb420e 100755
--- a/support/latexindent/latexindent.pl
+++ b/support/latexindent/latexindent.pl
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
#
-# latexindent.pl, version 3.24, 2024-04-28
+# latexindent.pl, version 3.24.4, 2024-07-18
#
# 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
diff --git a/support/luafindfont/CHANGELOG b/support/luafindfont/CHANGELOG
index 783f804f29..a629f6617a 100644
--- a/support/luafindfont/CHANGELOG
+++ b/support/luafindfont/CHANGELOG
@@ -1,3 +1,4 @@
+0.14 2024-08-25 - small changes to the output
0.13 2023-06-23 - add exrun:close() for every kpsewhich test
0.12 2023-06-21 - bugfix for undefined exrun (l. 251)
- check for empty font list and given font number
diff --git a/support/luafindfont/doc/luafindfont-doc.pdf b/support/luafindfont/doc/luafindfont-doc.pdf
index 65be6ced10..f51c3478b8 100644
--- a/support/luafindfont/doc/luafindfont-doc.pdf
+++ b/support/luafindfont/doc/luafindfont-doc.pdf
Binary files differ
diff --git a/support/luafindfont/doc/luafindfont-doc.tex b/support/luafindfont/doc/luafindfont-doc.tex
index c10483ce5a..818cd16fbb 100644
--- a/support/luafindfont/doc/luafindfont-doc.tex
+++ b/support/luafindfont/doc/luafindfont-doc.tex
@@ -1,4 +1,4 @@
- %% $Id: luafindfont-doc.tex 648 2022-11-03 19:58:48Z herbert $
+ %% $Id: luafindfont-doc.tex 962 2024-08-25 16:50:54Z herbert $
%
\listfiles\setcounter{errorcontextlines}{100}
\documentclass[paper=a4,fontsize=11pt,DIV=14,parskip=half-,
@@ -81,7 +81,7 @@
\def\setVersion#1{\setVVersion#1!!}
\def\setVVersion#1=#2!!{\def\luafindfontVersion{#2}}
-\setVersion{version = 0.11}% can be automatically changed by perl
+\setVersion{version = 0.14}% can be automatically changed by perl
\setkeys{hv}{cleanup={},force}
diff --git a/support/luafindfont/scripts/luafindfont.lua b/support/luafindfont/scripts/luafindfont.lua
index a1d554b5ae..f77f913a7d 100755
--- a/support/luafindfont/scripts/luafindfont.lua
+++ b/support/luafindfont/scripts/luafindfont.lua
@@ -1,6 +1,6 @@
#!/usr/bin/env texlua
--
--- $Id: luafindfont.lua 735 2023-06-22 19:12:29Z herbert $
+-- $Id: luafindfont.lua 961 2024-08-25 16:47:59Z herbert $
-----------------------------------------------------------------------
-- FILE: luafindfont.lua
-- DESCRIPTION: search for fonts in the database
@@ -8,7 +8,7 @@
-- AUTHOR: Herbert Voß (C) 2023-06-21
-----------------------------------------------------------------------
luafindfont = luafindfont or { }
- local version = 0.13
+ local version = 0.14
luafindfont.version = version
--[[
@@ -31,6 +31,7 @@ Report bugs to hvoss@tug.org
]]
+-- equivilant with ConTeXt, e.g. times
-- mtxrun --script font --list --name --all --pattern=times
kpse.set_program_name("luatex")
@@ -38,8 +39,6 @@ local f = kpse.find_file("lualibs.lua")
require("lualibs") -- all part of LuaTeX
---require("luafindfont-utflib")
-
if #arg == 0 then
print("I need at least one argument or option! Will exit ...")
os.exit()
@@ -282,6 +281,13 @@ function compareEntries(f1, f2)
end
end
+function centerText(text, width)
+ if text == nil then return "" end
+ local spaces = math.floor((width-string.len(text))/2)
+ local len = string.len(text)
+ return ((" "):rep(spaces)..text..(" "):rep(spaces))
+end
+
local fontData = {}
local fontListFile = getFileLocation()
if fontListFile == "" then
@@ -375,20 +381,38 @@ if l_max[3] > maxStrLength then l_max[3] = maxStrLength end
local minChars = 26
local Fontname = "Filename"
local Path = "Path"
-local SymbolicName = "Symbolic name"
+local SymbolicName = "Symbolic"
local lfdNr = "No."
if (font_str ~= "*") and not noSymbolicNames then
if args_xetex > 0 then
- print(string.format("%5s %"..l_max[1].."s %"..l_max[2].."s %"..l_max[3].."s".."%4s",lfdNr,Fontname,SymbolicName,Path,"X"))
+-- print(string.format("%5s %"..l_max[1].."s %"..l_max[2].."s %"..l_max[3].."s".."%4s",lfdNr,Fontname,SymbolicName,Path,"X"))
+ io.write(string.format("%5s",lfdNr))
+ io.write(centerText(Fontname,l_max[1]))
+ io.write(centerText(SymbolicName,l_max[2]))
+ io.write(centerText(Path,l_max[3]))
+ print("X")
else
- print(string.format("%5s %"..l_max[1].."s %"..l_max[2].."s %"..l_max[3].."s",lfdNr,Fontname,SymbolicName,Path))
+-- print(string.format("%5s %"..l_max[1].."s %"..l_max[2].."s %"..l_max[3].."s",lfdNr,Fontname,SymbolicName,Path))
+ io.write(string.format("%5s",lfdNr))
+ io.write(centerText(Fontname,l_max[1]))
+ io.write(centerText(SymbolicName,l_max[2]))
+ print(centerText(Path,l_max[3]))
end
else
if args_xetex > 0 then
- print(string.format("%5s %"..l_max[1].."s %"..l_max[3].."s".."%4s",lfdNr,Fontname,Path,"X"))
+-- print(string.format("%5s %"..l_max[1].."s %"..l_max[3].."s".."%4s",lfdNr,Fontname,Path,"X"))
+ io.write(string.format("%5s",lfdNr))
+ io.write(centerText(Fontname,l_max[1]))
+ io.write(centerText(SymbolicName,l_max[2]))
+ io.write(centerText(Path,l_max[3]))
+ print("X")
else
- print(string.format("%5s %"..l_max[1].."s %"..l_max[3].."s",lfdNr,Fontname,Path))
+-- print(string.format("%5s %"..l_max[1].."s %"..l_max[3].."s",lfdNr,Fontname,Path))
+ io.write(string.format("%5s",lfdNr))
+ io.write(centerText(Fontname,l_max[1]))
+ io.write(centerText(SymbolicName,l_max[2]))
+ print(centerText(Path,l_max[3]))
end
end
diff --git a/support/mf2pt1/ChangeLog b/support/mf2pt1/ChangeLog
index a8e6d2d910..6df8f95067 100644
--- a/support/mf2pt1/ChangeLog
+++ b/support/mf2pt1/ChangeLog
@@ -1,4 +1,15 @@
-2021-12-04 Scott Pakin <pakin@pakin.org>
+2024-07-06 Scott Pakin <scott+mf@pakin.org>
+
+ * README, mf2pt1.texi, mf2pt1.mp, mf2pt1.pl: Updated the copyright
+ year to 2024.
+
+ * mf2pt1.pl: Applied a patch from Werner Lemberg <wl@gnu.org> that
+ adds extrema later in the FontForge postprocessing script. This
+ patch originally was submitted as a LilyPond merge request
+ (https://gitlab.com/lilypond/lilypond/-/merge_requests/2374).
+ Updated the program version to 2.8.
+
+2021-12-04 Scott Pakin <scott+mf@pakin.org>
* README, mf2pt1.texi: Updated the copyright year to 2021.
@@ -7,7 +18,7 @@
already exist. Updated the copyright year to 2021. Updated the
version to 2.7.
-2021-11-28 Scott Pakin <pakin@pakin.org>
+2021-11-28 Scott Pakin <scott+mf@pakin.org>
* Makefile, mf2pt1.pl, mf2pt1.texi:
Documented that environment variables for programs can now include
@@ -18,13 +29,13 @@
commands to be overridden by environment variables that can also
include program parameters.
-2021-11-27 Scott Pakin <pakin@pakin.org>
+2021-11-27 Scott Pakin <scott+mf@pakin.org>
* mf2pt1.pl:
Introduced a --save-temps option to suppress deletion of intermediate
files.
-2020-11-27 Scott Pakin <pakin@pakin.org>
+2020-11-27 Scott Pakin <scott+mf@pakin.org>
* ChangeLog, README, mf2pt1.mp, mf2pt1.pl, mf2pt1.texi:
mf2pt1 no longer generates a UniqueID automatically, only when
diff --git a/support/mf2pt1/README b/support/mf2pt1/README
index 0eb57ca8fc..e101952ff9 100644
--- a/support/mf2pt1/README
+++ b/support/mf2pt1/README
@@ -27,7 +27,7 @@ For installation instructions, see the mf2pt1 manual (mf2pt1.pdf).
Copyright and license
---------------------
-Copyright (C) 2005-2021 Scott Pakin, scott+mf@pakin.org
+Copyright (C) 2005-2024 Scott Pakin, scott+mf@pakin.org
This package may be distributed and/or modified under the conditions
of the LaTeX Project Public License, either version 1.3c of this
diff --git a/support/mf2pt1/mf2pt1.mp b/support/mf2pt1/mf2pt1.mp
index 3ef56f9ab9..e5cbc9474f 100644
--- a/support/mf2pt1/mf2pt1.mp
+++ b/support/mf2pt1/mf2pt1.mp
@@ -10,7 +10,7 @@
%%%% ==================================================================== %%%%
%%%% mf2pt1 %%%%
-%%%% Copyright (C) 2005-2020 Scott Pakin %%%%
+%%%% Copyright (C) 2005-2024 Scott Pakin %%%%
%%%% %%%%
%%%% This program may be distributed and/or modified under the conditions %%%%
%%%% of the LaTeX Project Public License, either version 1.3c of this %%%%
diff --git a/support/mf2pt1/mf2pt1.pdf b/support/mf2pt1/mf2pt1.pdf
index a28895171a..e702482c74 100644
--- a/support/mf2pt1/mf2pt1.pdf
+++ b/support/mf2pt1/mf2pt1.pdf
Binary files differ
diff --git a/support/mf2pt1/mf2pt1.pl b/support/mf2pt1/mf2pt1.pl
index a9ee8b74fc..982f8c98be 100755
--- a/support/mf2pt1/mf2pt1.pl
+++ b/support/mf2pt1/mf2pt1.pl
@@ -7,7 +7,7 @@
########################################################################
# mf2pt1 #
-# Copyright (C) 2005-2021 Scott Pakin #
+# Copyright (C) 2005-2024 Scott Pakin #
# #
# This program may be distributed and/or modified under the conditions #
# of the LaTeX Project Public License, either version 1.3c of this #
@@ -21,7 +21,7 @@
# version 2006/05/20 or later. #
########################################################################
-our $VERSION = "2.7"; # mf2pt1 version number
+our $VERSION = "2.8"; # mf2pt1 version number
require 5.6.1; # I haven't tested mf2pt1 with older Perl versions
use Cwd;
@@ -161,7 +161,7 @@ my $filedir;
my $filenoext;
my $versionmsg = "mf2pt1 version $VERSION
-Copyright (C) 2005-2021 Scott Pakin
+Copyright (C) 2005-2024 Scott Pakin
This program may be distributed and/or modified under the conditions
of the LaTeX Project Public License, either version 1.3c of this
@@ -1006,9 +1006,9 @@ else {
Open($1);
SelectAll();
RemoveOverlap();
-AddExtrema();
Simplify(0, 2);
CorrectDirection();
+AddExtrema(1);
Simplify(0, 2);
RoundToInt();
AutoHint();
diff --git a/support/mf2pt1/mf2pt1.texi b/support/mf2pt1/mf2pt1.texi
index 9260689d18..f18ed6694c 100644
--- a/support/mf2pt1/mf2pt1.texi
+++ b/support/mf2pt1/mf2pt1.texi
@@ -11,7 +11,7 @@
@c %**end of header
@copying
-Copyright @copyright{} 2005--2021 Scott Pakin
+Copyright @copyright{} 2005--2024 Scott Pakin
@sp 2
@@ -30,8 +30,8 @@ version 2006/05/20 or later.
@end copying
-@set VERSION 2.7
-@set DATE 4 December 2021
+@set VERSION 2.8
+@set DATE 6 July 2024
@c Define some fonts we intend to use.
@iftex
@@ -679,9 +679,9 @@ parameters that @command{mf2pt1} accepts:
@noindent
@b{if} known @i{ps_output}:
-@multitable {@b{if}} {@b{font_underline_thickness}} {@t{"Copyright (C) 2021 Scott Pakin.";}}
+@multitable {@b{if}} {@b{font_underline_thickness}} {@t{"Copyright (C) 2005-2024 Scott Pakin.";}}
@item @tab @b{font_coding_scheme} @tab @t{"ot1"};
-@item @tab @b{font_comment} @tab @t{"Copyright (C) 2021 Scott Pakin."};
+@item @tab @b{font_comment} @tab @t{"Copyright (C) 2005-2024 Scott Pakin."};
@item @tab @b{font_family} @tab @t{"Kerplotz"};
@item @tab @b{font_fixed_pitch} @tab @b{false};
@item @tab @b{font_identifier} @tab @t{"Kerplotz Light Oblique"};
@@ -708,7 +708,7 @@ The same parameters can also be specified on the command line as
follows:
@example
-mf2pt1 --encoding=ot1 --comment="Copyright (C) 2021 Scott Pakin."
+mf2pt1 --encoding=ot1 --comment="Copyright (C) 2005-2024 Scott Pakin."
--family=Kerplotz --nofixedpitch --fullname="Kerplotz Light Oblique"
--name=Kerplotz-LightOblique --designsize=10 --italicangle=-9.5
--underpos=-100 --underthick=50 --uniqueid=4112233 --version=002.005
@@ -881,7 +881,7 @@ character position the current encoding has designated for the
@section Restoring @file{mfplain} defaults
@command{mf2pt1} normally redefines @strong{filldraw} as @strong{fill}
-and @strong{unfilldraw} and @strong{unfill} because @w{Type 1} fonts
+and @strong{unfilldraw} as @strong{unfill} because @w{Type 1} fonts
don't allow overlapping curves. Similarly, @command{mf2pt1} redefines
@strong{pencircle} as a 20-gon to coerce MetaPost into drawing it
using a filled instead of a stroked PostScript path.
@@ -957,7 +957,7 @@ more robust way to dump @file{mf2pt1.mem}; for directing me to the
overlap-removal code mentioned in @ref{Restrictions}; for supplying
the @emph{crossproduct}, @emph{makeline}, and @emph{is_clockwise}
functions used by @file{mf2pt1.mp}; for proposing the @copt{bpppix}
-command-line option; and for suggesting various features and
+command-line option; and for suggesting numerous features and
improvements to @command{mf2pt1}. Thanks also go to Werner Lemberg
and
@iftex
diff --git a/support/pdfjam/VERSION b/support/pdfjam/VERSION
index ab9bd6936f..cd7061f818 100644
--- a/support/pdfjam/VERSION
+++ b/support/pdfjam/VERSION
@@ -1 +1 @@
-This is pdfjam 3.11
+This is pdfjam 3.12
diff --git a/support/pdfjam/bin/pdfjam b/support/pdfjam/bin/pdfjam
index 814da49599..ff9a0123cd 100755
--- a/support/pdfjam/bin/pdfjam
+++ b/support/pdfjam/bin/pdfjam
@@ -1,5 +1,5 @@
#!/bin/sh
-version=3.11
+version=3.12
#########################################################################
## ##
## pdfjam: A shell-script interface to the "pdfpages" LaTeX package ##
@@ -1144,7 +1144,7 @@ do
then
if tty -s ; then
error_exit \
- "tty is connected to connected to stdin, no PDF/JPG/PNG file found" \
+ "tty is connected to stdin, no PDF/JPG/PNG file found" \
$E_NOINPUT
fi
cat > "$uniqueName"
diff --git a/support/pdfxup/README b/support/pdfxup/README
index 335ae71dd8..7bbb705d4c 100644
--- a/support/pdfxup/README
+++ b/support/pdfxup/README
@@ -1,4 +1,4 @@
-PDFXUP -- v2.11 (2024/03/15)
+PDFXUP -- v2.12 (2024/06/11)
N. Markey <pdfxup@markey.fr>
@@ -18,7 +18,7 @@ graphicx package) in order to produce the new document.
-%% (c) 2024/03/15 Nicolas Markey <pdfxup at markey dot fr>
+%% (c) 2024/06/11 Nicolas Markey <pdfxup at markey dot fr>
%%
%% This work may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
diff --git a/support/pdfxup/RELEASES b/support/pdfxup/RELEASES
index b6272603a3..f0e9b93643 100644
--- a/support/pdfxup/RELEASES
+++ b/support/pdfxup/RELEASES
@@ -65,3 +65,7 @@ v2.10 (2021/04/25)
v2.11 (2024/03/15)
- fixed a bug in testdim, which did not support fractional values
(bug reported by Walt Tuvell)
+
+v2.12 (2024/06/11)
+ - fixed several bugs related with page ranges (bugs reported by
+ Sanjoy Mahajan)
diff --git a/support/pdfxup/doc/Makefile b/support/pdfxup/doc/Makefile
new file mode 100644
index 0000000000..ea9fe01b2f
--- /dev/null
+++ b/support/pdfxup/doc/Makefile
@@ -0,0 +1,3 @@
+all:
+ pdflatex pdfxup-doc.tex
+ pdfxup -o pdfxup.pdf pdfxup-doc.pdf
diff --git a/support/pdfxup/pdfxup.pdf b/support/pdfxup/doc/pdfxup-doc.pdf
index 2c629a8b2e..cf3f9af936 100644
--- a/support/pdfxup/pdfxup.pdf
+++ b/support/pdfxup/doc/pdfxup-doc.pdf
Binary files differ
diff --git a/support/pdfxup/doc/pdfxup-doc.tex b/support/pdfxup/doc/pdfxup-doc.tex
new file mode 100644
index 0000000000..c051d0483f
--- /dev/null
+++ b/support/pdfxup/doc/pdfxup-doc.tex
@@ -0,0 +1,163 @@
+\documentclass{article}
+\usepackage[margin=6cm]{geometry}
+\usepackage{tikz}
+\usepackage{xspace}
+\def\pdfxup{\texttt{pdfxup}\xspace}
+
+\begin{document}
+\title{\pdfxup \\[2mm]
+ \normalsize
+ version 2.12 -- 2024/06/11}
+\author{Nicolas Markey}
+\date{}
+
+\maketitle
+
+\def\abstractname{}
+\begin{abstract}
+\pdfxup is a shell script that creates $n$-up PDF documents, while at
+the same time removing as much white stripes as possible. This
+document reviews the main features of \pdfxup. See the \verb+man+ page
+for more details.
+\end{abstract}
+
+\section{Basic usage}
+Running \pdfxup with no options creates a 2-up document from the
+original PDF file:
+\begin{center}
+\begin{tikzpicture}[scale=1.5]
+ \begin{scope}
+ \draw (0,0) |- (1.1,1.5) |- cycle;
+ \foreach \x in {.3,.4,...,.9}
+ {\draw [line width=.5mm,black!50!white] (.2,\x) -- +(.7,0);}
+ \draw [line width=.5mm,black!50!white] (.3,1.1) -- +(.5,0);
+ \end{scope}
+ \begin{scope}[xshift=1.2cm]
+ \draw (0,0) |- (1.1,1.5) |- cycle;
+ \foreach \x in {.3,.4,...,1.2}
+ {\draw [line width=.5mm,black!50!white] (.2,\x) -- +(.7,0);}
+ %\draw [line width=.5mm,black!50!white] (.3,1.2) -- +(.4,0);
+ \end{scope}
+ %
+ \draw[->] (2.6,.7) -- +(1,0);% node[midway,above] {scale=97\%};
+ %
+ \begin{scope}[yshift=2mm,xshift=4cm]
+ \draw (0,0) |- (1.5,1.1) |- cycle;
+ \begin{scope}[yshift=-1.8mm,xshift=-1.5mm,scale=.97]
+ \draw[line width=.02pt] (.178,.25) |- (.922,1.25) |- cycle;
+ \foreach \x in {.3,.4,...,.9}
+ {\draw [line width=.5mm,black!50!white] (.2,\x) -- +(.7,0);}
+ \draw [line width=.5mm,black!50!white] (.3,1.1) -- +(.5,0);
+ \begin{scope}[xshift=7.5mm]
+ \draw[line width=.02pt] (.178,.25) |- (.922,1.25) |- cycle;
+ \foreach \x in {.3,.4,...,1.2}
+ {\draw [line width=.5mm,black!50!white] (.2,\x) -- +(.7,0);}
+ \end{scope}
+ \end{scope}
+ \end{scope}
+\end{tikzpicture}
+\end{center}
+
+It removes white strips around text, so that it does not need to scale
+down the original document too much. All margins in the resulting PDF
+can be adapted using various options. The number of rows and columns
+of pages can be modified using options \verb+-x+ and \verb+-y+. By
+default, the output file is in landscape mode, but this can be changed
+using option \verb+-l=no+.
+
+Computing the boundig box is performed automatically using
+GhostScript. This may take time for long documents, but it is often
+sufficient to compute the bounding box on the first few pages, using
+option \verb+-bb+. Bounding-box computation can be turned off (so that
+original margins are kept) using \verb+-kbb+.
+
+It is possible to only include a subset of pages using option
+\verb+-p+ (notice that if a page is listed twice, it will be included
+twice).
+
+\section{Creating a booklet}
+\pdfxup can create booklets: this is similar to the operation above,
+but the pages are ordered and oriented in the adequate way. Booklet
+mode is triggered with the \verb+-b+ option.
+\begin{center}
+\begin{tikzpicture}[scale=1.5]
+ \begin{scope}
+ \draw (0,0) |- (1.1,1.5) |- cycle;
+ \foreach \x in {.3,.4,...,.9}
+ {\draw [line width=.5mm,black!50!white] (.2,\x) -- +(.7,0);}
+ \draw [line width=.5mm,black!50!white] (.3,1.1) -- +(.5,0);
+ \end{scope}
+ \begin{scope}[xshift=1.2cm]
+ \draw (0,0) |- (1.1,1.5) |- cycle;
+ \foreach \x in {.3,.4,...,1.2}
+ {\draw [line width=.5mm,black!50!white] (.2,\x) -- +(.7,0);}
+ %\draw [line width=.5mm,black!50!white] (.3,1.2) -- +(.4,0);
+ \end{scope}
+ %
+ \draw[->] (2.6,.7) -- +(1,0);% node[midway,above] {scale=97\%};
+ %
+ \begin{scope}[yshift=2mm,xshift=4cm]
+ \draw (0,0) |- (1.5,1.1) |- cycle;
+ \begin{scope}[yshift=-1.8mm,xshift=6mm,scale=.97]
+% \draw[line width=.02pt] (.178,.25) |- (.922,1.25) |- cycle;
+ \foreach \x in {.3,.4,...,.9}
+ {\draw [line width=.5mm,black!50!white] (.2,\x) -- +(.7,0);}
+ \draw [line width=.5mm,black!50!white] (.3,1.1) -- +(.5,0);
+ \end{scope}
+ \fill[white] (1.2,-.01) -| (1.51,.3) -- cycle;
+ \draw[fill=white] (1.2,0) .. controls +(40:2mm) and +(-60:2mm) .. (1.2,.35) -- (1.5,.3) -- cycle;
+ \begin{scope}
+ \draw[clip] (1.2,0) .. controls +(40:2mm) and +(-60:2mm) .. (1.2,.35) -- (1.5,.3) -- cycle;
+ \draw[line width=.5mm,black!50!white] (1.3,.3) .. controls +(-60:1mm) and +(90:2mm) .. ++(-80:3mm);
+ \draw[line width=.5mm,black!50!white] (1.38,.28) .. controls +(-69:1mm) and +(90:2mm) .. ++(-80:3mm);
+ \end{scope}
+ \end{scope}
+\end{tikzpicture}
+\end{center}
+
+\section{Watermarking}
+Using option \verb+-w+, you can add watermarking to the original file:
+\begin{center}
+\begin{tikzpicture}[scale=1.5]
+ \begin{scope}
+ \draw (0,0) |- (1.1,1.5) |- cycle;
+ \foreach \x in {.3,.4,...,.9}
+ {\draw [line width=.5mm,black!50!white] (.2,\x) -- +(.7,0);}
+ \draw [line width=.5mm,black!50!white] (.3,1.1) -- +(.5,0);
+ \end{scope}
+ \begin{scope}[xshift=1.2cm]
+ \draw (0,0) |- (1.1,1.5) |- cycle;
+ \foreach \x in {.3,.4,...,1.2}
+ {\draw [line width=.5mm,black!50!white] (.2,\x) -- +(.7,0);}
+ %\draw [line width=.5mm,black!50!white] (.3,1.2) -- +(.4,0);
+ \end{scope}
+ %
+ \draw[->] (2.6,.7) -- +(1,0);% node[midway,above] {scale=97\%};
+ %
+ \begin{scope}[yshift=2mm,xshift=4cm]
+ \draw (0,0) |- (1.5,1.1) |- cycle;
+ \begin{scope}[yshift=-1.8mm,xshift=-1.5mm,scale=.97]
+ \path (.178,.5) -- (.922,1) node[midway,sloped,opacity=.5]
+ {\bfseries\large draft};
+ \draw[line width=.02pt] (.178,.25) |- (.922,1.25) |- cycle;
+ \foreach \x in {.3,.4,...,.9}
+ {\draw [line width=.5mm,black!50!white] (.2,\x) -- +(.7,0);}
+ \draw [line width=.5mm,black!50!white] (.3,1.1) -- +(.5,0);
+ \begin{scope}[xshift=7.5mm]
+ \path (.178,.5) -- (.922,1) node[midway,sloped,opacity=.5]
+ {\bfseries\large draft};
+ \draw[line width=.02pt] (.178,.25) |- (.922,1.25) |- cycle;
+ \foreach \x in {.3,.4,...,1.2}
+ {\draw [line width=.5mm,black!50!white] (.2,\x) -- +(.7,0);}
+ \end{scope}
+ \end{scope}
+ \end{scope}
+\end{tikzpicture}
+\end{center}
+
+
+\pdfxup has many other options, setting up margins, frames, order of pages,~...
+Please look at the \texttt{man} page for more details.
+
+
+\end{document}
diff --git a/support/pdfxup/doc/pdfxup.pdf b/support/pdfxup/doc/pdfxup.pdf
new file mode 100644
index 0000000000..7fda750bff
--- /dev/null
+++ b/support/pdfxup/doc/pdfxup.pdf
Binary files differ
diff --git a/support/pdfxup/pdfxup b/support/pdfxup/pdfxup
index d31db88f9e..b7197de00c 100755
--- a/support/pdfxup/pdfxup
+++ b/support/pdfxup/pdfxup
@@ -2,12 +2,12 @@
shopt -s extglob
shopt -s lastpipe
-VERSION="2.11"
-VDATE="2024/03/15"
+VERSION="2.12"
+VDATE="2024/06/11"
## see release notes at the end of this file.
-## (c) 2024/03/15 Nicolas Markey <pdfxup at markey dot fr>
+## (c) 2024/06/11 Nicolas Markey <pdfxup at markey dot fr>
##
## This work may be distributed and/or modified under the conditions of
## the LaTeX Project Public License, either version 1.3 of this license
@@ -392,17 +392,17 @@ function cleancslor()
fi
;;
-+([0-9]))
- if [[ $i -le $nbp ]]; then
+ if [[ ${i%-} -le $nbp ]]; then
result+="1$i,";
nbpages+=${i#-};
else
- myecho 1+ " $file has $nbp page(s); changed 1$i to 1-$nbp."
+ myecho 1+ " $file has $nbp page(s); changed range 1$i to 1-$nbp."
result+="1$nbp,";
nbpages+=${nbp#-};
fi
;;
+([0-9])-)
- if [[ $i -le $nbp ]]; then
+ if [[ ${i%-} -le $nbp ]]; then
result+="$i$nbp,";
nbpages+=$(expr $nbp + 1 - ${i%-});
else
@@ -427,6 +427,20 @@ function cleancslor()
-)
result+="1-$nbp,";
nbpages+=$nbp;;
+ %+([0-9]))
+ ## explicitly list all values...
+ ## (simpler, but admitedly less efficient,
+ ## than handling real modulos)
+ declare -i cptr;
+ cptr=1;
+ step=`echo $i|cut -d% -f2`;
+ while [[ $cptr -le $nbp ]]; do
+ if [[ $cptr -gt 0 ]]; then
+ result+="$cptr,";
+ nbpages+=1;
+ fi
+ cptr+=$step;
+ done;;
+([0-9])%+([0-9]))
## explicitly list all values...
## (simpler, but admitedly less efficient,
@@ -435,8 +449,25 @@ function cleancslor()
cptr=`echo $i|cut -d% -f1`;
step=`echo $i|cut -d% -f2`;
while [[ $cptr -le $nbp ]]; do
- result+="$cptr,";
- nbpages+=1;
+ if [[ $cptr -gt 0 && $cptr -le $nbp ]]; then
+ result+="$cptr,";
+ nbpages+=1;
+ fi
+ cptr+=$step;
+ done;;
+ +([0-9])%+([0-9]-+([0-9])))
+ ## explicitly list all values...
+ ## (simpler, but admitedly less efficient,
+ ## than handling real modulos)
+ declare -i cptr;
+ cptr=`echo $i|cut -d% -f1`;
+ step=`echo $i|cut -d% -f2|cut -d- -f1`;
+ last=`echo $i|cut -d% -f2|cut -d- -f2`;
+ while [[ $cptr -le $last ]]; do
+ if [[ $cptr -gt 0 && $cptr -le $nbp ]]; then
+ result+="$cptr,";
+ nbpages+=1;
+ fi
cptr+=$step;
done;;
*)
@@ -690,22 +721,28 @@ while [ $# != 0 ]; do
shift;;
-p|--pages|--page)
case $2 in
- -)
+ +([0-9,\-%]))
PAGES+="$2,";
;;
- -*)
- echo "Error: option '$1' expects a range, not '$2'.";
+ *)
+ echo "Error: option '$1' expects a set of pages, not '$2'.";
echo "Aborting.";
exit 0;
;;
- *)
- PAGES+="$2,";
- ;;
esac
shift 2;;
- -p*|--page*)
+ -p=*|--pages?=*)
ANS=`echo $1|sed -re "s/--?p(ages?)?=?//"`;
- PAGES+="$ANS,";
+ case $ANS in
+ +([0-9,\-%]))
+ PAGES+="$ANS,";
+ ;;
+ *)
+ echo "Error: option '$1' expects a set of pages, not '$ANS'.";
+ echo "Aborting.";
+ exit 0;
+ ;;
+ esac
shift;;
-o|--out|--output-file|--outfile)
OUTPUTFILE=$2;
@@ -837,41 +874,53 @@ while [ $# != 0 ]; do
shift;;
-nobb|--nobb|-no-bb|--no-bb)
case $2 in
- -)
+ +([0-9,\-%]))
EXCLUDE_FOR_BBOX+="$2,";
;;
- -*)
- echo "Error: option '$1' expects a range, not '$2'.";
+ *)
+ echo "Error: option '$1' expects a set of pages, not '$2'.";
echo "Aborting.";
exit 0;
;;
- *)
- EXCLUDE_FOR_BBOX+="$2,";
- ;;
esac
shift 2;;
-nobb*|--no-bb*)
ANS=`echo $1|sed -re "s/--?no-?bb=?//"`;
- EXCLUDE_FOR_BBOX+="$ANS,";
+ case $ANS in
+ +([0-9,\-%]))
+ EXCLUDE_FOR_BBOX+="$ANS,";
+ ;;
+ *)
+ echo "Error: option '$1' expects a set of pages, not '$ANS'.";
+ echo "Aborting.";
+ exit 0;
+ ;;
+ esac
shift;;
-bb|--bb|--bounding-box)
case $2 in
- -)
+ +([0-9,\-%]))
INCLUDE_FOR_BBOX+="$2,";
;;
- -*)
- echo "Error: option '$1' expects a range, not '$2'.";
+ *)
+ echo "Error: option '$1' expects a set of pages, not '$2'.";
echo "Aborting.";
exit 0;
;;
- *)
- INCLUDE_FOR_BBOX+="$2,";
- ;;
esac
shift 2;;
-bb*|--bb*|--bounding-box)
ANS=`echo $1|sed -re "s/--?b(ounding-?)?b(ox)?=?//"`;
- INCLUDE_FOR_BBOX+="$ANS,";
+ case $ANS in
+ +([0-9,\-%]))
+ INCLUDE_FOR_BBOX+="$ANS,";
+ ;;
+ *)
+ echo "Error: option '$1' expects a set of pages, not '$ANS'.";
+ echo "Aborting.";
+ exit 0;
+ ;;
+ esac
shift;;
-kbb|--keepbb|--keep-bb|--original-bb)
case $2 in
@@ -1008,17 +1057,23 @@ while [ $# != 0 ]; do
shift;;
-*)
usage;;
- *:+([0-9\-,\%]))
+ *:+([0-9\-,%]))
ARG=$1;
file=${ARG%:*};
PAGES+="${ARG#*:},";
## only one file is allowed, and no options
## should appear after the file name...
+ if [[ $2 ]]; then
+ echo "All options after PDF file ($1) will be dropped.";
+ fi
break;;
*)
file=$1;
## only one file is allowed, and no options
## should appear after the file name...
+ if [[ $2 ]]; then
+ echo "All options after PDF file ($1) will be dropped.";
+ fi
break;;
esac;
done
@@ -1223,6 +1278,7 @@ nbwp=1; ## set even if no watemark
if [[ $WATERMARK_FILE != "" ]]; then
if [[ ! -e $WATERMARK_FILE ]]; then
myecho 1+ " pdfxup: watermarking file not found. Omiting watermarking."
+ WATERMARK_FILE=""
else
myecho 2+ " * using file $WATERMARK_FILE for watermarking";
fi
@@ -1259,7 +1315,11 @@ if [[ $KEEP_ORIG_BBOX == 0 ]]; then
if [[ $SBB == 0 ]]; then
myecho 1+ -n "-> computing bounding box";
myecho 2+ "";
-
+
+ ## This does not correctly handles EXCLUDE_FOR_BBOX; actually, option -nobb is ignored
+ ## when page range or -bb is used. Best way of handling this would be to range over all pages
+ ## and test if page should be included. -nobb should then have priority over -bb (for pages
+ ## that would be listed in both of them)
for r in ${INCLUDE_FOR_BBOX//,/$IFS};
do
case $r in
@@ -1561,10 +1621,14 @@ pdfxup has numerous options:
name the resulting file booklet.pdf.
# pdfxup -kbb -x1 -y2 -l0 beamer-frames.pdf
-> arranges 2 beamer frames per page (not reducing margins)
+ Version 2.00 introduces config files; using beamer2.xup
+ config file, you can equivalently do
+ pdfxup -cf beamer2.xup beamer-frames.pdf
# pdfxup -kbb -x2 -y2 -l1 beamer-frames.pdf
+ pdfxup -cf beamer4.xup beamer-frames.pdf
-> arranges 4 beamer frames per page (not reducing margins)
# pdfxup -fw0 -w draft.png file.pdf
- -> remove frame border; add 'draft' watermarking on all pages
+ -> no frame border; add 'draft' watermarking on all pages
##################################################################
##
@@ -1633,3 +1697,7 @@ v2.10 (2021/04/25)
v2.11 (2024/03/15)
- fixed a bug in testdim, which did not support fractional values
(bug reported by Walt Tuvell)
+
+v2.12 (2024/06/11)
+ - fixed several bugs related with page ranges (bugs reported by
+ Sanjoy Mahajan)
diff --git a/support/pdfxup/pdfxup.1 b/support/pdfxup/pdfxup.1
index 8ca0c2b394..49851a17f0 100644
--- a/support/pdfxup/pdfxup.1
+++ b/support/pdfxup/pdfxup.1
@@ -1,6 +1,6 @@
.\" Manpage for pdfxup.
.\" Contact pdfxup@markey.fr to correct errors or typos.
-.TH man 1 "24 april 2021" "2.10" "pdfxup man page"
+.TH man 1 "11 june 2024" "2.12" "pdfxup man page"
.SH NAME
pdfxup \- n-up tool with reduced margins
.SH SYNOPSIS
diff --git a/support/pkgcheck/CHANGES.md b/support/pkgcheck/CHANGES.md
index 3f1414d6bf..c6985a7d06 100644
--- a/support/pkgcheck/CHANGES.md
+++ b/support/pkgcheck/CHANGES.md
@@ -6,6 +6,23 @@
# Changes
+
+## 2024-06-11 (3.2.0)
+### Added
+ - add generation of completion support for nushell
+ - add a new warning message W0011 if a file in the package tree
+ has a future modification time
+ - add Thumbs.db as temporary file
+ - (Experimental) for l3backend-dev and l3kernel-dev use the real directory name
+ latex-dev/l3backend resp. latex-dev/l3kernel when checking path names in the
+ TDS archive
+ - new E0042 error when there are filenames with different letter cases in a TDS archive
+ - new E0043 error when a symlink is found in the TDS archive
+### Changed
+ - small improvement in src/recode.rs due to clippy suggestions
+ - small code reorganization in check_tds_archive()
+ - crates update
+
## 2022-12-26 (3.1.0)
### Added
- now checking for hard links which generate a warning message
diff --git a/support/pkgcheck/Cargo.toml b/support/pkgcheck/Cargo.toml
index c765d91590..b35bb8a7e4 100644
--- a/support/pkgcheck/Cargo.toml
+++ b/support/pkgcheck/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "pkgcheck"
-version = "3.1.0"
+version = "3.2.0"
authors = ["Manfred Lotz <manfred@ctan.org>"]
description = "Command-line tool to check packages uploaded to CTAN."
license = "MIT/Apache-2.0"
@@ -17,52 +17,74 @@ panic = "abort"
lto = true
[dependencies]
-blake3 = "1.3"
+blake3 = "1.5"
clap = { version = "4", features = ["derive"] }
clap_complete = "4"
+clap_complete_nushell = "4.5"
colored = "2"
-config = "0.13"
+config = "0.14"
escargot = "0.5"
fern = "0.6"
glob = "0.3"
-home = "0.5.3"
-once_cell = "1.13"
+home = "0.5.9"
+once_cell = "1.19"
#lazy_static = "1"
-linkify = "0.9"
+linkify = "0.10"
log = "0.4"
num_cpus = "1"
-openssl-probe = "0.1.4"
-pest = "2.3"
-pest_derive = "2.3"
+openssl-probe = "0.1.5"
+pest = "2.7"
+pest_derive = "2.7"
regex = "1"
-reqwest = { version = "0.11", features = ["blocking", "gzip"] }
+reqwest = { version = "0.12", features = ["blocking", "gzip"] }
rustc-hash = "1.1"
scoped_threadpool = "0.1"
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.9"
-tempfile = "3.1"
+tempfile = "3.8"
threadpool = "1.8"
tokio = { version = "1", features = ["full"] }
unbytify = "0.2"
-unicode-bom = "1"
-url = "2.1"
+unicode-bom = "2"
+url = "2.4"
walkdir = "2.3"
-zip = { version = "^0.6", default-features = false, features = ["deflate"] }
+##zip = { version = "^0.6", default-features = false, features = ["deflate"] }
+zip = { version = "^2.1", default-features = false, features = ["deflate"] }
[dev-dependencies]
assert_cmd = "2"
-predicates = "2"
+predicates = "3"
[package.metadata.deb]
section = "utility"
depends = ""
priority = "optional"
assets = [
- ["target/x86_64-unknown-linux-musl/release/pkgcheck", "usr/bin/", "755"],
- ["LICENSE-MIT", "usr/share/doc/pkgcheck/", "644"],
- ["LICENSE-APACHE", "usr/share/doc/pkgcheck/", "644"],
- ["README.md", "usr/share/doc/pkgcheck/README", "644"],
- ["docs/pkgcheck.pdf", "usr/share/doc/pkgcheck/pkgcheck.pdf", "644"],
+ [
+ "target/x86_64-unknown-linux-musl/release/pkgcheck",
+ "usr/bin/",
+ "755",
+ ],
+ [
+ "LICENSE-MIT",
+ "usr/share/doc/pkgcheck/",
+ "644",
+ ],
+ [
+ "LICENSE-APACHE",
+ "usr/share/doc/pkgcheck/",
+ "644",
+ ],
+ [
+ "README.md",
+ "usr/share/doc/pkgcheck/README",
+ "644",
+ ],
+ [
+ "docs/pkgcheck.pdf",
+ "usr/share/doc/pkgcheck/pkgcheck.pdf",
+ "644",
+ ],
]
extended-description = """\
A checker for uploaded packages to CTAN
@@ -71,7 +93,6 @@ A checker for uploaded packages to CTAN
changelog = "CHANGES.md"
-
[package.metadata.rpm]
package = "pkgcheck"
diff --git a/support/pkgcheck/bin/pkgcheck b/support/pkgcheck/bin/pkgcheck
index abaea81efc..293c66dd08 100755
--- a/support/pkgcheck/bin/pkgcheck
+++ b/support/pkgcheck/bin/pkgcheck
Binary files differ
diff --git a/support/pkgcheck/docs/errorsd.tex b/support/pkgcheck/docs/errorsd.tex
index 7fb3509791..c37a082641 100644
--- a/support/pkgcheck/docs/errorsd.tex
+++ b/support/pkgcheck/docs/errorsd.tex
@@ -1,6 +1,5 @@
-\hypertarget{e0001----bad-characters-in-file-name}{%
\subsection{E0001 -\/- Bad characters in file
-name}\label{e0001----bad-characters-in-file-name}}
+name}\label{e0001----bad-characters-in-file-name}
File name should not contain non-ascii characters. Additionally, file
names should not contain control characters or other characters which
@@ -9,9 +8,8 @@ may have a special meaning for UNIX shells.
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#nounixspecialcharacters}
-\hypertarget{e0002----file-permissions}{%
\subsection{E0002 -\/- File
-Permissions}\label{e0002----file-permissions}}
+Permissions}\label{e0002----file-permissions}
Files submitted to CTAN should be world readable.
@@ -21,16 +19,14 @@ be marked as such.
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#filepermissions}
-\hypertarget{e0003----readme-is-not-a-text-file}{%
\subsection{E0003 -\/- README is not a text
-file}\label{e0003----readme-is-not-a-text-file}}
+file}\label{e0003----readme-is-not-a-text-file}
The \texttt{README} file specified in the error message must be a text
-file but it isn't.
+file but it isn\textquotesingle t.
-\hypertarget{e0004----empty-directory-not-allowed}{%
\subsection{E0004 -\/- Empty directory not
-allowed}\label{e0004----empty-directory-not-allowed}}
+allowed}\label{e0004----empty-directory-not-allowed}
Empty directories are considered as rubbish, and are usually not
accepted as part of a package, neither in the package tree nor in the
@@ -39,9 +35,8 @@ TDS zip archive.
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#noemptyfiles}
-\hypertarget{e0005----empty-files-not-allowed}{%
\subsection{E0005 -\/- Empty files not
-allowed}\label{e0005----empty-files-not-allowed}}
+allowed}\label{e0005----empty-files-not-allowed}
Empty files are considered as rubbish, and are usually not accepted as
part of a package.
@@ -49,9 +44,8 @@ part of a package.
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#noemptyfiles}
-\hypertarget{e0006----hidden-directories-not-allowed}{%
\subsection{E0006 -\/- Hidden directories not
-allowed}\label{e0006----hidden-directories-not-allowed}}
+allowed}\label{e0006----hidden-directories-not-allowed}
A package should not contain hidden directories, neither in the package
tree nor in the TDS zip archive.
@@ -59,9 +53,8 @@ tree nor in the TDS zip archive.
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#noauxfiles}
-\hypertarget{e0007----hidden-files-not-allowed}{%
\subsection{E0007 -\/- Hidden files not
-allowed}\label{e0007----hidden-files-not-allowed}}
+allowed}\label{e0007----hidden-files-not-allowed}
A package should not contain hidden files, neither in the package tree
nor in the TDS zip archive.
@@ -69,9 +62,8 @@ nor in the TDS zip archive.
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#noauxfiles}
-\hypertarget{e0008----temporary-file-detected}{%
\subsection{E0008 -\/- Temporary file
-detected}\label{e0008----temporary-file-detected}}
+detected}\label{e0008----temporary-file-detected}
A temporary file was detected. These are typically files created by TeX
\& friends and should not be part of a package.
@@ -81,9 +73,8 @@ Temporary files will also be detected in a TDS zip archive.
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#noauxfiles}
-\hypertarget{e0009----package-doesnt-contain-a-readme-file}{%
-\subsection{E0009 -\/- Package doesn't contain a README
-file}\label{e0009----package-doesnt-contain-a-readme-file}}
+\subsection{E0009 -\/- Package doesn\textquotesingle t contain a README
+file}\label{e0009----package-doesnt-contain-a-readme-file}
A package must contain at least one of \texttt{README},
\texttt{README.md} or \texttt{README.txt} file.
@@ -91,15 +82,13 @@ A package must contain at least one of \texttt{README},
For more details refer to:
\url{http://mirrors.ibiblio.org/CTAN/help/ctan/CTAN-upload-addendum.html\#readme}
-\hypertarget{e0010----broken-symlink-detected}{%
\subsection{E0010 -\/- Broken symlink
-detected}\label{e0010----broken-symlink-detected}}
+detected}\label{e0010----broken-symlink-detected}
A broken symlink was detected.
-\hypertarget{e0011----wrong-permission-for-directory}{%
\subsection{E0011 -\/- Wrong permission for
-directory}\label{e0011----wrong-permission-for-directory}}
+directory}\label{e0011----wrong-permission-for-directory}
Directories should have rwx for the owner and at least \texttt{r-x} for
others (i.e. world readable).
@@ -107,9 +96,8 @@ others (i.e. world readable).
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#filepermissions}
-\hypertarget{e0012----crlf-line-endings-detected}{%
\subsection{E0012 -\/- CRLF line endings
-detected}\label{e0012----crlf-line-endings-detected}}
+detected}\label{e0012----crlf-line-endings-detected}
The file specified in the error message contains CRLF line endings. Text
files should have UNIX style line endings.
@@ -117,37 +105,32 @@ files should have UNIX style line endings.
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#crlf}
-\hypertarget{e0013----socket-special-fie-detected}{%
\subsection{E0013 -\/- Socket special fie
-detected}\label{e0013----socket-special-fie-detected}}
+detected}\label{e0013----socket-special-fie-detected}
The file specified in the error message is a socket special file which
is not allowed.
-\hypertarget{e0014----fifo-special-file-detected}{%
\subsection{E0014 -\/- Fifo special file
-detected}\label{e0014----fifo-special-file-detected}}
+detected}\label{e0014----fifo-special-file-detected}
The file specified in the error message is a fifo special file which is
not allowed.
-\hypertarget{e0015----bloch-device-file-detected}{%
\subsection{E0015 -\/- Bloch device file
-detected}\label{e0015----bloch-device-file-detected}}
+detected}\label{e0015----bloch-device-file-detected}
The file specified in the error message is a block device file which is
not allowed.
-\hypertarget{e0016----character-device-file-detected}{%
\subsection{E0016 -\/- Character device file
-detected}\label{e0016----character-device-file-detected}}
+detected}\label{e0016----character-device-file-detected}
The file specified in the error message is a character device file which
is not allowed.
-\hypertarget{e0017----pdf-document-is-in-error}{%
\subsection{E0017 -\/- PDF document is in
-error}\label{e0017----pdf-document-is-in-error}}
+error}\label{e0017----pdf-document-is-in-error}
The PDF document mentioned in the message is in error.
@@ -167,20 +150,18 @@ Syntax Error: Couldn't find trailer dictionary
Syntax Error: Couldn't read xref table
\end{verbatim}
-\hypertarget{e0018----unwanted-directory-detected}{%
\subsection{E0018 -\/- Unwanted directory
-detected}\label{e0018----unwanted-directory-detected}}
+detected}\label{e0018----unwanted-directory-detected}
A directory was detected which should not be part of a package. Example:
\texttt{\_\_MACOSX}
-\hypertarget{e0019----generated-file-detected}{%
\subsection{E0019 -\/- Generated file
-detected}\label{e0019----generated-file-detected}}
+detected}\label{e0019----generated-file-detected}
-In order to avoid redundancy we don't want to have included files in a
-package which easily can be generated from other files in the
-submission.
+In order to avoid redundancy we don\textquotesingle t want to have
+included files in a package which easily can be generated from other
+files in the submission.
Exceptions are the \texttt{README} files of the package, i.e.
\texttt{README}, \texttt{README.md} or \texttt{README.txt},
@@ -192,10 +173,9 @@ directory tree.
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#nogeneratedfiles}
-\hypertarget{e0020----unwanted-directory-detected-in-the-top-level-directory-in-tds-zip-archive}{%
\subsection{E0020 -\/- Unwanted directory detected in the top level
directory in TDS zip
-archive}\label{e0020----unwanted-directory-detected-in-the-top-level-directory-in-tds-zip-archive}}
+archive}\label{e0020----unwanted-directory-detected-in-the-top-level-directory-in-tds-zip-archive}
The name of a top level directory of a TDS archive must be one of those
listed here: \texttt{asymptote}, \texttt{bibtex}, \texttt{chktex},
@@ -208,30 +188,26 @@ listed here: \texttt{asymptote}, \texttt{bibtex}, \texttt{chktex},
Any other other directory at the top level is an error.
-\hypertarget{e0021----error-when-reading-a-file}{%
\subsection{E0021 -\/- Error when reading a
-file}\label{e0021----error-when-reading-a-file}}
+file}\label{e0021----error-when-reading-a-file}
An error was encountered when reading the file specified in the message.
-\hypertarget{e0022----check-of-an-url-in-a-readme-file-failed}{%
\subsection{E0022 -\/- Check of an URL in a README file
-failed}\label{e0022----check-of-an-url-in-a-readme-file-failed}}
+failed}\label{e0022----check-of-an-url-in-a-readme-file-failed}
URL checking is in effect. An error occcurred when trying to retrieve an
URL which was found in the specified \texttt{README} file.
-\hypertarget{e0023----follow-up-error-when-trying-to-read-a-directory-with-insufficient-permissions}{%
\subsection{E0023 -\/- Follow up error when trying to read a directory
with insufficient
-permissions}\label{e0023----follow-up-error-when-trying-to-read-a-directory-with-insufficient-permissions}}
+permissions}\label{e0023----follow-up-error-when-trying-to-read-a-directory-with-insufficient-permissions}
Error which is a follow-up error. For instance, when a directory could
not be read.
-\hypertarget{e0024----tds-zip-archive-has-wrong-permissions}{%
\subsection{E0024 -\/- TDS zip archive has wrong
-permissions}\label{e0024----tds-zip-archive-has-wrong-permissions}}
+permissions}\label{e0024----tds-zip-archive-has-wrong-permissions}
The TDS zip archive should have at least \texttt{r-\/-} for the owner
and at least \texttt{r-\/-} for others (i.e. world readable).
@@ -239,37 +215,34 @@ and at least \texttt{r-\/-} for others (i.e. world readable).
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#filepermissions}
-\hypertarget{e0025----duplicate-names-when-ignoring-letter-case-for-files-or-directories}{%
\subsection{E0025 -\/- Duplicate names when ignoring letter case for
files or
-directories}\label{e0025----duplicate-names-when-ignoring-letter-case-for-files-or-directories}}
+directories}\label{e0025----duplicate-names-when-ignoring-letter-case-for-files-or-directories}
As there are operating systems which do not distinguish between
-\texttt{myfile} and \texttt{MYFILE} we don't want to have file names in
-a directory which are the same after converting to lower case.
+\texttt{myfile} and \texttt{MYFILE} we don\textquotesingle t want to
+have file names in a directory which are the same after converting to
+lower case.
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#filenames}
-\hypertarget{e0026----files-not-in-tds-or-different-in-tds-and-non-install-tree}{%
\subsection{E0026 -\/- Files not in TDS or different in TDS and
non-install
-tree}\label{e0026----files-not-in-tds-or-different-in-tds-and-non-install-tree}}
+tree}\label{e0026----files-not-in-tds-or-different-in-tds-and-non-install-tree}
The file mentioned in the error message is either not existing in the
TDS zip archive, or it is different to the one in the non-install tree
-\hypertarget{e0027----an-io-error-occurred}{%
\subsection{E0027 -\/- An I/O error
-occurred}\label{e0027----an-io-error-occurred}}
+occurred}\label{e0027----an-io-error-occurred}
Some kind of I/O error occurred. If you believe there is an error in
\texttt{pkgcheck} please contact the author.
-\hypertarget{e0028----a-path-name-in-a-tds-zip-archive-must-contain-the-package-name}{%
\subsection{E0028 -\/- A path name in a TDS zip archive must contain the
package
-name}\label{e0028----a-path-name-in-a-tds-zip-archive-must-contain-the-package-name}}
+name}\label{e0028----a-path-name-in-a-tds-zip-archive-must-contain-the-package-name}
The path names in a TDS zip archive must contain the package name.
@@ -283,9 +256,8 @@ source/latex/somepkg/somepkg.dtx
...
\end{verbatim}
-\hypertarget{e0029----readme-file--encoding-with-bom-detected}{%
\subsection{\texorpdfstring{E0029 -\/- README file: encoding with BOM
-detected}{E0029 -\/- README file: encoding with BOM detected}}\label{e0029----readme-file--encoding-with-bom-detected}}
+detected}{E0029 -\/- README file: encoding with BOM detected}}\label{e0029----readme-file--encoding-with-bom-detected}
A README file should be either ASCII or UTF-8 without BOM(byte order
mark)
@@ -293,55 +265,48 @@ mark)
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#readme}
-\hypertarget{e0030----a-symlink-was-found-which-points-outside-of-the-package-directory-tree}{%
\subsection{E0030 -\/- A symlink was found which points outside of the
package directory
-tree}\label{e0030----a-symlink-was-found-which-points-outside-of-the-package-directory-tree}}
+tree}\label{e0030----a-symlink-was-found-which-points-outside-of-the-package-directory-tree}
A symlink must not point to a file or directory outside of the package
directory tree.
-\hypertarget{e0031----file-name-contains-invalid-utf-8-characters}{%
\subsection{E0031 -\/- File name contains invalid UTF-8
-character(s)}\label{e0031----file-name-contains-invalid-utf-8-characters}}
+character(s)}\label{e0031----file-name-contains-invalid-utf-8-characters}
A file name contains invalid UTF-8 character(s).
-\hypertarget{e0033----error-when-unpacking-tds-archive}{%
\subsection{E0033 -\/- Error when unpacking tds
-archive}\label{e0033----error-when-unpacking-tds-archive}}
+archive}\label{e0033----error-when-unpacking-tds-archive}
In order to investigate the contents of the TDS zip archive
\texttt{pkgcheck} unpacks the TDS zip archive to a temporary location
which failed for the reason given in the error message.
-\hypertarget{e0034----unwanted-file-detected-in-the-top-level-directory-in-tds-zip-archive}{%
\subsection{E0034 -\/- Unwanted file detected in the top level directory
in TDS zip
-archive}\label{e0034----unwanted-file-detected-in-the-top-level-directory-in-tds-zip-archive}}
+archive}\label{e0034----unwanted-file-detected-in-the-top-level-directory-in-tds-zip-archive}
A top level directory of a TDS archive should only contain certain
directories but no files.
-\hypertarget{e0035----unwanted-tds-archive-detected-in-package-directory-tree}{%
\subsection{E0035 -\/- Unwanted TDS archive detected in package
directory
-tree}\label{e0035----unwanted-tds-archive-detected-in-package-directory-tree}}
+tree}\label{e0035----unwanted-tds-archive-detected-in-package-directory-tree}
A package directory should not contain a TDS zip archive.
-\hypertarget{e0036----dtxins-files-found-in-wrong-directory-in-tds-zip-archive}{%
\subsection{E0036 -\/- .dtx/.ins files found in wrong directory in TDS
zip
-archive}\label{e0036----dtxins-files-found-in-wrong-directory-in-tds-zip-archive}}
+archive}\label{e0036----dtxins-files-found-in-wrong-directory-in-tds-zip-archive}
In a TDS zip archive a \texttt{.dtx} resp. \texttt{.ins} file must be in
a subdirectory of either of \texttt{source/} or \texttt{doc/} top level
directories.
-\hypertarget{e0037----cr-line-endings-detected}{%
\subsection{E0037 -\/- CR line endings
-detected}\label{e0037----cr-line-endings-detected}}
+detected}\label{e0037----cr-line-endings-detected}
The file specified in the error message contains CR line endings. Text
files should have UNIX style line endings.
@@ -349,10 +314,9 @@ files should have UNIX style line endings.
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#crlf}
-\hypertarget{e0038----file-has-inconsistent-line-endings-cr-x-lf-y-crlf-z}{%
\subsection{E0038 -\/- File has inconsistent line endings: CR: x, LF: y,
CRLF:
-z}\label{e0038----file-has-inconsistent-line-endings-cr-x-lf-y-crlf-z}}
+z}\label{e0038----file-has-inconsistent-line-endings-cr-x-lf-y-crlf-z}
The file specified in the error message contains CR line endings. Text
files should have UNIX style line endings.
@@ -360,16 +324,14 @@ files should have UNIX style line endings.
For more details refer to:
\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#crlf}
-\hypertarget{e0039----no-doc-directory-found-in-the-top-level-directory-of-the-tds-zip-archive}{%
\subsection{E0039 -\/- No doc/ directory found in the top level
directory of the TDS zip
-archive}\label{e0039----no-doc-directory-found-in-the-top-level-directory-of-the-tds-zip-archive}}
+archive}\label{e0039----no-doc-directory-found-in-the-top-level-directory-of-the-tds-zip-archive}
A TDS zip archive is required to contain a top level directory doc/.
-\hypertarget{e0040----too-few-top-level-directories-in-the-tds-zip-archive}{%
\subsection{E0040 -\/- Too few top level directories in the TDS zip
-archive}\label{e0040----too-few-top-level-directories-in-the-tds-zip-archive}}
+archive}\label{e0040----too-few-top-level-directories-in-the-tds-zip-archive}
The top level directory of a TDS zip archive must contain at least a
\texttt{doc} directory and one or more of the following directories:
@@ -383,16 +345,26 @@ The top level directory of a TDS zip archive must contain at least a
Any other other directory at the top level is an error.
-\hypertarget{e0041----one-or-more-map-file-found-for-the-package-but-none-of-them-is-in-a-path-starting-with-fontsmapdvips}{%
\subsection{E0041 -\/- One or more map file found for the package but
none of them is in a path starting with
-fonts/map/dvips}\label{e0041----one-or-more-map-file-found-for-the-package-but-none-of-them-is-in-a-path-starting-with-fontsmapdvips}}
+fonts/map/dvips}\label{e0041----one-or-more-map-file-found-for-the-package-but-none-of-them-is-in-a-path-starting-with-fontsmapdvips}
At least one map file was found which was not in a path starting with
\texttt{fonts/map/dvips}.
-\hypertarget{e0042----config-file--doesnt-exist}{%
-\subsection{\texorpdfstring{E0042 -\/- Config file doesn't
-exist}{E0042 -\/- Config file doesn't exist}}\label{e0042----config-file--doesnt-exist}}
+\subsection{E0042 -\/- TDS zip archive: duplicate names when ignoring
+letter case for files or
+directories}\label{e0042----tds-zip-archive-duplicate-names-when-ignoring-letter-case-for-files-or-directories}
-The config file specified at the command line doesn't exist.
+As there are operating systems which do not distinguish between
+\texttt{myfile} and \texttt{MYFILE} we don\textquotesingle t want to
+have file names in a directory which are the same after converting to
+lower case.
+
+For more details refer to:
+\url{http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html\#filenames}
+
+\subsection{\texorpdfstring{E0043 -\/- Symlink found in TDS zip
+archive}{E0043 -\/- Symlink found in TDS zip archive}}\label{e0043----symlink--found-in-tds-zip-archive}
+
+The TDS zip archive contained a symlink which is not allowed.
diff --git a/support/pkgcheck/docs/pkgcheck.pdf b/support/pkgcheck/docs/pkgcheck.pdf
index 5d5259bab4..149531d21a 100644
--- a/support/pkgcheck/docs/pkgcheck.pdf
+++ b/support/pkgcheck/docs/pkgcheck.pdf
Binary files differ
diff --git a/support/pkgcheck/docs/title.tex b/support/pkgcheck/docs/title.tex
index 8dcca045d1..9745306ef3 100644
--- a/support/pkgcheck/docs/title.tex
+++ b/support/pkgcheck/docs/title.tex
@@ -1 +1 @@
-\title{pkgcheck Utility, v3.1.0}
+\title{pkgcheck Utility, v3.2.0}
diff --git a/support/pkgcheck/docs/warningsd.tex b/support/pkgcheck/docs/warningsd.tex
index 24667fc2f8..5e1565ef48 100644
--- a/support/pkgcheck/docs/warningsd.tex
+++ b/support/pkgcheck/docs/warningsd.tex
@@ -1,23 +1,20 @@
-\hypertarget{w0001----archive-as-package-file-detected}{%
\subsection{W0001 -\/- Archive as package file
-detected}\label{w0001----archive-as-package-file-detected}}
+detected}\label{w0001----archive-as-package-file-detected}
Usually a CTAN package should not contain archives. An exception are
situations where, for example, the source code of a package is kept in a
separate zip archive.
-\hypertarget{w0002----duplicate-files-detected}{%
\subsection{W0002 -\/- Duplicate files
-detected}\label{w0002----duplicate-files-detected}}
+detected}\label{w0002----duplicate-files-detected}
Duplicate files were detected which are listed right after this message.
The message is a warning message as something like this could not be
seen as an error in general.
-\hypertarget{w0003----same-named-files-detected-in-the-package-tree}{%
\subsection{W0003 -\/- Same named files detected in the package
-tree}\label{w0003----same-named-files-detected-in-the-package-tree}}
+tree}\label{w0003----same-named-files-detected-in-the-package-tree}
We like to have unique file names over the whole package directory tree.
When we discover same named files we report it as a warning. Common
@@ -28,9 +25,8 @@ names like \texttt{README}, \texttt{README.txt}, \texttt{README.md},
For more details refer to:
\url{http://mirror.utexas.edu/ctan/help/ctan/CTAN-upload-addendum.html\#uniquefilenames}
-\hypertarget{w0004-----encoding-with-bom-detected}{%
\subsection{\texorpdfstring{W0004 -\/- encoding with BOM
-detected}{W0004 -\/- encoding with BOM detected}}\label{w0004-----encoding-with-bom-detected}}
+detected}{W0004 -\/- encoding with BOM detected}}\label{w0004-----encoding-with-bom-detected}
A UTF encoded package file contains a BOM (byte order mark). Currently,
we issues a warning.
@@ -38,33 +34,29 @@ we issues a warning.
Nevertheless, the CTAN team discourages uses of BOM. Please be aware,
that in some future time this could be reagarded as an error.
-\hypertarget{w0005----very-large-file--with-size-size-detected-in-package}{%
\subsection{\texorpdfstring{W0005 -\/- Very large file with size
\texttt{\textless{}size\textgreater{}} detected in
-package}{W0005 -\/- Very large file with size \textless size\textgreater{} detected in package}}\label{w0005----very-large-file--with-size-size-detected-in-package}}
+package}{W0005 -\/- Very large file with size \textless size\textgreater{} detected in package}}\label{w0005----very-large-file--with-size-size-detected-in-package}
(Experimental) We issue the message if there is a file is larger than
40MiB in the package directory tree.
-\hypertarget{w0006----very-large-file-with-size-size-detected-in-tds-zip-archive}{%
\subsection{\texorpdfstring{W0006 -\/- Very large file with size
\texttt{\textless{}size\textgreater{}} detected in TDS zip
-archive}{W0006 -\/- Very large file with size \textless size\textgreater{} detected in TDS zip archive}}\label{w0006----very-large-file-with-size-size-detected-in-tds-zip-archive}}
+archive}{W0006 -\/- Very large file with size \textless size\textgreater{} detected in TDS zip archive}}\label{w0006----very-large-file-with-size-size-detected-in-tds-zip-archive}
(Experimental) We issue the message if there is a file larger than 40MiB
in the TDS zip archive.
-\hypertarget{w0007----empty-directory-detected-in-the-tds-zip-archive}{%
\subsection{W0007 -\/- Empty directory detected in the TDS zip
-archive}\label{w0007----empty-directory-detected-in-the-tds-zip-archive}}
+archive}\label{w0007----empty-directory-detected-in-the-tds-zip-archive}
Empty directories in a TDS zip archive are discouraged. As they usually
don\textquotesingle t create errors in the distribution we issue a
warning only.
-\hypertarget{w0008----windows-file-has-unix-line-endings}{%
\subsection{W0008 -\/- Windows file has Unix line
-endings}\label{w0008----windows-file-has-unix-line-endings}}
+endings}\label{w0008----windows-file-has-unix-line-endings}
A Windows file with Unix line endings was detected.
@@ -82,19 +74,36 @@ We regard a file as a Windows file if its name ends with:
\texttt{.reg}
\end{itemize}
-\hypertarget{w0009----replacing-----with-the-same-from-config-file}{%
-\subsection{\texorpdfstring{W0009 -\/- Replacing -\textgreater{} ` with
-the same from config
-file",}{W0009 -\/- Replacing -\textgreater{} ` with the same from config file",}}\label{w0009----replacing-----with-the-same-from-config-file}}
+\subsection{\texorpdfstring{W0009 -\/- Replacing
+\texttt{\textless{}pkgname\textgreater{}\ -\textgreater{}\ \textless{}tpkg\textgreater{}}
+with the same from config
+file",}{W0009 -\/- Replacing \textless pkgname\textgreater{} -\textgreater{} \textless tpkg\textgreater{} with the same from config file",}}\label{w0009----replacing-pkgname---tpkg-with-the-same-from-config-file}
This message can only show up if \texttt{pkgcheck} got called with
\texttt{-\/-config}. Indicates that an entry in the \texttt{pkgcheck}
config file does the same as the hard-coded entry. This helps to keep a
clean config file.
-\hypertarget{w0010----hardlinks-detected-with-inode-}{%
\subsection{\texorpdfstring{W0010 -\/- Hardlinks detected with inode
-}{W0010 -\/- Hardlinks detected with inode }}\label{w0010----hardlinks-detected-with-inode-}}
+}{W0010 -\/- Hardlinks detected with inode }}\label{w0010----hardlinks-detected-with-inode-}
Hardlinks found in the package directory tree. The inode number will be
displayed
+
+\subsection{\texorpdfstring{W0011 -\/- has an mtime in the future by
+seconds, or \textless hours, minutes,
+seconds\textgreater{}}{W0011 -\/- has an mtime in the future by seconds, or \textless hours, minutes, seconds\textgreater{}}}\label{w0011-----has-an-mtime-in-the-future-by--seconds-or-hours-minutes-seconds}
+
+The file has a future modification time. This is most probably caused by
+the archiver tool which doesn\textquotesingle t pay attention to the
+timezone when adding the file to the archive
+
+The future time will be displayed in
+
+\begin{itemize}
+\tightlist
+\item
+ seconds
+\item
+ and hours, minutes and seconds
+\end{itemize}
diff --git a/support/pkgcheck/src/gparser.rs b/support/pkgcheck/src/gparser.rs
index 4c10ba9f7a..136f6f41b1 100644
--- a/support/pkgcheck/src/gparser.rs
+++ b/support/pkgcheck/src/gparser.rs
@@ -1,4 +1,3 @@
-
use log::*;
use pest::Parser;
diff --git a/support/pkgcheck/src/linkcheck.rs b/support/pkgcheck/src/linkcheck.rs
index ba0cd73cea..bd61239ef2 100644
--- a/support/pkgcheck/src/linkcheck.rs
+++ b/support/pkgcheck/src/linkcheck.rs
@@ -121,7 +121,7 @@ fn check_link(url: &str, fname: &str, urlhash: &Arc<Mutex<UrlHash>>, print_all:
match check_link_inner(&url, true) {
UrlStatus::UrlOk => {
let mut urlhash = urlhash.lock().unwrap();
- if let Some(mut hs) = urlhash.get_mut(&url) {
+ if let Some(hs) = urlhash.get_mut(&url) {
if print_all {
for p in hs.paths.iter() {
print_ok(super::ARGS.no_colors, &url, p);
@@ -132,7 +132,7 @@ fn check_link(url: &str, fname: &str, urlhash: &Arc<Mutex<UrlHash>>, print_all:
}
UrlStatus::UrlError(e) => {
let mut urlhash = urlhash.lock().unwrap();
- if let Some(mut hs) = urlhash.get_mut(&url) {
+ if let Some(hs) = urlhash.get_mut(&url) {
for p in hs.paths.iter() {
e0022!(p, e);
}
diff --git a/support/pkgcheck/src/main.rs b/support/pkgcheck/src/main.rs
index 9ff8390f9c..6ad786dcd9 100644
--- a/support/pkgcheck/src/main.rs
+++ b/support/pkgcheck/src/main.rs
@@ -26,10 +26,10 @@ use std::fmt::Display;
use std::str;
use utils::*;
+use scoped_threadpool::Pool;
use serde::{Deserialize, Serialize};
-use std::os::unix::fs::MetadataExt;
use std::borrow::Cow;
-use scoped_threadpool::Pool;
+use std::os::unix::fs::MetadataExt;
use tempfile::Builder;
@@ -54,16 +54,92 @@ use std::path::PathBuf;
use std::sync::atomic::{AtomicBool, Ordering};
use rustc_hash::{FxHashMap, FxHashSet};
+use std::time::SystemTime;
use std::fmt::Arguments;
use std::sync::mpsc::{channel, Sender};
-use clap::{Command, CommandFactory, Parser, ValueHint};
-use clap_complete::{generate, Generator, Shell};
+use clap::builder::PossibleValue;
+use clap::{Command, CommandFactory, Parser, ValueEnum, ValueHint};
+//use clap_complete::{generate, Generator, Shell};
+use clap_complete::{shells, Generator};
+use clap_complete_nushell::Nushell;
#[cfg(unix)]
use walkdir::{DirEntry, WalkDir};
+/// Shell with auto-generated completion script available.
+#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
+#[non_exhaustive]
+pub enum Shell {
+ /// Bourne Again SHell (bash)
+ Bash,
+ /// Elvish shell
+ Elvish,
+ /// Friendly Interactive SHell (fish)
+ Fish,
+ /// PowerShell
+ PowerShell,
+ /// Z SHell (zsh)
+ Zsh,
+ /// Nu shell (nu)
+ Nu,
+}
+
+impl Generator for Shell {
+ fn file_name(&self, name: &str) -> String {
+ match self {
+ Shell::Bash => shells::Bash.file_name(name),
+ Shell::Elvish => shells::Elvish.file_name(name),
+ Shell::Fish => shells::Fish.file_name(name),
+ Shell::PowerShell => shells::PowerShell.file_name(name),
+ Shell::Zsh => shells::Zsh.file_name(name),
+ Shell::Nu => Nushell.file_name(name),
+ }
+ }
+
+ fn generate(&self, cmd: &clap::Command, buf: &mut dyn std::io::Write) {
+ match self {
+ Shell::Bash => shells::Bash.generate(cmd, buf),
+ Shell::Elvish => shells::Elvish.generate(cmd, buf),
+ Shell::Fish => shells::Fish.generate(cmd, buf),
+ Shell::PowerShell => shells::PowerShell.generate(cmd, buf),
+ Shell::Zsh => shells::Zsh.generate(cmd, buf),
+ Shell::Nu => Nushell.generate(cmd, buf),
+ }
+ }
+}
+
+// Hand-rolled so it can work even when `derive` feature is disabled
+impl ValueEnum for Shell {
+ fn value_variants<'a>() -> &'a [Self] {
+ &[
+ Shell::Bash,
+ Shell::Elvish,
+ Shell::Fish,
+ Shell::PowerShell,
+ Shell::Zsh,
+ Shell::Nu,
+ ]
+ }
+
+ fn to_possible_value<'a>(&self) -> Option<PossibleValue> {
+ Some(match self {
+ Shell::Bash => PossibleValue::new("bash"),
+ Shell::Elvish => PossibleValue::new("elvish"),
+ Shell::Fish => PossibleValue::new("fish"),
+ Shell::PowerShell => PossibleValue::new("powershell"),
+ Shell::Zsh => PossibleValue::new("zsh"),
+ Shell::Nu => PossibleValue::new("nu"),
+ })
+ }
+}
+
+fn is_future_mtime(now: SystemTime, mtime: SystemTime) -> bool {
+ mtime > now
+ //mtime > now + Duration::new(1800, 0)
+}
+
fn format_message(message: &Arguments, no_color: bool) -> Cow<'static, str> {
let msg_str = format!("{}", message);
if msg_str.starts_with(' ') {
@@ -99,7 +175,7 @@ pub struct PathExceptions {
fn get_config_file_name() -> Option<String> {
if let Some(config_file) = &ARGS.config_file {
if Path::new(&config_file).exists() {
- return Some(config_file.to_string())
+ return Some(config_file.to_string());
} else {
f0008!(config_file);
std::process::exit(1);
@@ -124,6 +200,8 @@ fn read_yaml_config() -> FxHashMap<String, String> {
for (p, q) in [
("armtex", "armenian"),
("babel-base", "babel"),
+ ("l3backend-dev", "latex-dev/l3backend"),
+ ("l3kernel-dev", "latex-dev/l3kernel"),
("latex-amsmath", "latex"),
("latex-amsmath-dev", "latex-dev"),
("latex-base", "latex"),
@@ -148,7 +226,10 @@ fn read_yaml_config() -> FxHashMap<String, String> {
let data = match fs::read_to_string(&config_filename) {
Ok(str) => str,
- Err(e) => { f0009!(&config_filename, e); std::process::exit(1); }
+ Err(e) => {
+ f0009!(&config_filename, e);
+ std::process::exit(1);
+ }
};
let path_exceptions = serde_yaml::from_str::<PathExceptions>(&data);
@@ -171,7 +252,10 @@ fn read_yaml_config() -> FxHashMap<String, String> {
}
pb
}
- Err(e) => { f0010!(e); std::process::exit(1);},
+ Err(e) => {
+ f0010!(e);
+ std::process::exit(1);
+ }
};
pkg_replacements
}
@@ -277,7 +361,11 @@ fn check_readme(dir_entry: &str, is_readme: &ReadmeKind, ft: &filemagic::Mimetyp
return false;
}
filemagic::Mimetype::Bom(b) => {
- e0029!(msg_name, b.as_ref());
+ // wegmit e0029!(msg_name, b.as_ref());
+ e0029!(
+ msg_name,
+ <unicode_bom::Bom as std::convert::AsRef<str>>::as_ref(b)
+ );
return false;
}
filemagic::Mimetype::Text(_le) => match File::open(dir_entry) {
@@ -329,55 +417,58 @@ fn _get_devno(entry: &DirEntry) -> u64 {
#[derive(Parser, Debug, PartialEq)]
#[clap(author, version, about, long_about = None)]
+#[command(arg_required_else_help(true))]
struct Args {
- #[clap(short = 'I', long = "ignore-dupes", help = "Ignore dupes")]
+ #[arg(short = 'I', long = "ignore-dupes", help = "Ignore dupes")]
ignore_dupes: bool,
- #[clap(long = "ignore-same-named", help = "Ignore same-named files")]
+ #[arg(long = "ignore-same-named", help = "Ignore same-named files")]
ignore_same_named: bool,
- #[clap(short = 'v', long = "verbose", help = "Verbose operation?")]
+ #[arg(short = 'v', long = "verbose", help = "Verbose operation?")]
verbose: bool,
- #[clap(short = 'L', long = "correct-le", help = "Correct line endings")]
+ #[arg(short = 'L', long = "correct-le", help = "Correct line endings")]
correct_le: bool,
- #[clap(short = 'C', long = "correct-perms", help = "Correct permissions")]
+ #[arg(short = 'C', long = "correct-perms", help = "Correct permissions")]
correct_perms: bool,
- #[clap(long = "no-colors", help = "Don't display messages in color")]
+ #[arg(long = "no-colors", help = "Don't display messages in color")]
no_colors: bool,
- #[clap(long = "urlcheck", help = "Check URLs found in README files")]
+ #[arg(long = "urlcheck", help = "Check URLs found in README files")]
urlcheck: bool,
- #[clap(short = 'T', long = "tds-zip", help = "tds zip archive", group = "tds", value_hint = ValueHint::FilePath)]
+ #[arg(short = 'T', long = "tds-zip", help = "tds zip archive", group = "tds", value_hint = ValueHint::FilePath)]
tds_zip: Option<String>,
- #[clap(
+ #[arg(
short = 'e',
long = "explain",
help = "Explain error or warning message",
group = "only_one"
)]
explain: Option<String>,
- #[clap(
+ #[arg(
long = "explain-all",
help = "Explains all error or warning messages",
group = "only_one"
)]
explain_all: bool,
- #[clap(long = "generate-completion", group = "only_one", value_enum)]
+ #[arg(long = "generate-completion", group = "only_one", value_enum)]
generator: Option<Shell>,
- #[clap(
+ #[arg(
long = "show-temp-endings",
help = "Show file endings for temporary files",
group = "only_one"
)]
show_tmp_endings: bool,
- #[clap(short = 'd', long = "package-dir", help = "Package directory", value_hint = ValueHint::DirPath)]
+ #[arg(short = 'd', long = "package-dir", help = "Package directory", value_hint = ValueHint::DirPath)]
pkg_dir: Option<String>,
- #[clap(long = "config-file", help = "Specify config file to use", value_hint = ValueHint::FilePath)]
+ #[arg(long = "config-file", help = "Specify config file to use", value_hint = ValueHint::FilePath)]
config_file: Option<String>,
}
// In the pas we took care to avoid visiting a single inode twice, which takes care of (false positive) hardlinks.
// Now we want to know if there is a hardlink in the package directory
#[cfg(unix)]
-fn check_inode(set: &mut FxHashMap<(u64, u64), Vec<String>>, filename: &str, meta: &Metadata) {
- set.entry((get_devno(meta), meta.ino())).or_insert_with(Vec::new).push(filename.to_string());
+fn check_inode(set: &mut FxHashMap<(u64, u64), Vec<String>>, filename: &str, meta: &Metadata) {
+ set.entry((get_devno(meta), meta.ino()))
+ .or_default()
+ .push(filename.to_string());
}
#[cfg(not(unix))]
@@ -387,6 +478,8 @@ fn check_inode(_: &mut FxHashSet<u64>, _: &Metadata) -> bool {
static ARGS: Lazy<Args> = Lazy::new(Args::parse);
static ERROR_OCCURRED: AtomicBool = AtomicBool::new(false);
+//Get the current time
+static NOW: Lazy<SystemTime> = Lazy::new(SystemTime::now);
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum DPath {
@@ -434,14 +527,15 @@ impl DupPath {
type DupHashes = FxHashMap<(u64, Vec<u8>), DupPath>;
fn print_completions<G: Generator>(gen: G, cmd: &mut Command) {
- generate(gen, cmd, cmd.get_name().to_string(), &mut io::stdout());
+ //generate(gen, cmd, cmd.get_name().to_string(), &mut io::stdout());
+ clap_complete::generate(gen, cmd, "pkgcheck", &mut std::io::stdout());
}
fn main() {
let _ = setup_logger(ARGS.no_colors);
// read yaml config file if one is given explicitly or implicitly
- let pkg_replace : FxHashMap<String, String> = read_yaml_config();
+ let pkg_replace: FxHashMap<String, String> = read_yaml_config();
match &ARGS.explain {
None => (),
@@ -716,9 +810,16 @@ fn check_tds_archive_name(tds_zip: &Option<String>) -> Option<String> {
// }
// }
-fn check_tds_archive(pkg_name: &str, tds_zip: &str, hashes: &DupHashes, pkg_replace: &FxHashMap<String, String>) {
+fn check_tds_archive(
+ pkg_name: &str,
+ tds_zip: &str,
+ hashes: &DupHashes,
+ pkg_replace: &FxHashMap<String, String>,
+) {
i0003!(tds_zip);
+ let mut lcnames: FxHashMap<PathBuf, Vec<(PathBuf, FileKind)>> = FxHashMap::default();
+
let dir_entry = Path::new(tds_zip);
let p = get_perms(dir_entry);
if !owner_has(p, 4) || !others_have(p, 4) || x_bit_set(p) {
@@ -731,12 +832,6 @@ fn check_tds_archive(pkg_name: &str, tds_zip: &str, hashes: &DupHashes, pkg_repl
let ut = Utils::new(utils::CheckType::Tds);
- let real_pkg_name = if let Some(real_name) = pkg_replace.get(pkg_name) {
- real_name
- } else {
- pkg_name
- };
-
let tmp_dir = match Builder::new().prefix("pkgcheck").tempdir() {
Ok(tdir) => tdir,
Err(e) => {
@@ -777,7 +872,7 @@ fn check_tds_archive(pkg_name: &str, tds_zip: &str, hashes: &DupHashes, pkg_repl
let path = dir_entry.path().to_path_buf();
let sizeref = &mut sizes;
- sizeref.entry(fsize).or_insert_with(Vec::new).push(path);
+ sizeref.entry(fsize).or_default().push(path);
};
let mut map_files_found = false;
@@ -846,6 +941,15 @@ fn check_tds_archive(pkg_name: &str, tds_zip: &str, hashes: &DupHashes, pkg_repl
}
};
+ // let mtime = meta.modified().unwrap();
+ // if is_future_mtime(*NOW, mtime) {
+ // let diff = mtime.duration_since(*NOW).unwrap();
+ // println!(
+ // "{} has an mtime in the future by {} seconds",
+ // &file_name,
+ // diff.as_secs()
+ // );
+ // }
let ft = get_filetype(&dir_entry);
if let FType::Error(e) = ft {
@@ -853,12 +957,27 @@ fn check_tds_archive(pkg_name: &str, tds_zip: &str, hashes: &DupHashes, pkg_repl
continue;
}
+ // this is the path name without the temporary part
+ // from unpacking the TDS zip archive
let dir_entry_display = if dir_entry.depth() == 0 {
&dir_entry_str[tmp_dir_offset - 1..]
} else {
&dir_entry_str[tmp_dir_offset..]
};
+ let filetype = match ft {
+ FType::Directory => FileKind::Directory,
+ FType::Regular => FileKind::File,
+ FType::Symlink => {
+ e0043!(dir_entry_display);
+ continue;
+ }
+ _ => panic!(
+ "Unexpected file type for {} in zip archive",
+ dir_entry_display
+ ),
+ };
+ register_duplicate_filename(&mut lcnames, dir_entry_display, filetype);
ut.check_for_temporary_file(dir_entry_display);
// In the top level directory of a TDS zip archive
@@ -912,11 +1031,14 @@ fn check_tds_archive(pkg_name: &str, tds_zip: &str, hashes: &DupHashes, pkg_repl
}
// if the path doesn't contain a man page...
- if !dir_entry_str.contains("/man/") {
- let pkg_name_s = format!("/{}/", real_pkg_name);
- // ...then we want to have the package name in the path
- if !dir_entry_str.contains(&pkg_name_s) {
- e0028!(real_pkg_name, dir_entry_display);
+ if !dir_entry_str.contains("/man/") && !dir_entry_str.contains(pkg_name) {
+ if let Some(real_name) = pkg_replace.get(pkg_name) {
+ let pkg_name_s = format!("/{}/", real_name);
+ if !dir_entry_str.contains(&pkg_name_s) {
+ e0028!(pkg_name_s, dir_entry_display);
+ }
+ } else {
+ e0028!(pkg_name, dir_entry_display);
}
}
@@ -952,10 +1074,7 @@ fn check_tds_archive(pkg_name: &str, tds_zip: &str, hashes: &DupHashes, pkg_repl
let hashref = &mut tds_hashes;
scope.execute(move || {
for (size, path, hash) in rx.iter() {
- hashref
- .entry((size, hash))
- .or_insert_with(Vec::new)
- .push(path);
+ hashref.entry((size, hash)).or_default().push(path);
}
});
@@ -974,6 +1093,7 @@ fn check_tds_archive(pkg_name: &str, tds_zip: &str, hashes: &DupHashes, pkg_repl
e0026!(p);
}
}
+ print_casefolding_tds(&lcnames);
}
fn get_extension_from_filename(filename: &str) -> Option<&str> {
@@ -1073,6 +1193,21 @@ enum ReadmeKind {
Symlink(String),
}
+fn register_duplicate_filename(
+ lcnames: &mut FxHashMap<PathBuf, Vec<(PathBuf, FileKind)>>,
+ dir_entry: &str,
+ fk: FileKind,
+) {
+ let lc_dir_entry_str = dir_entry.to_lowercase();
+ if let Some(_dir_name) = filename(dir_entry) {
+ // let lcnref = &mut lcnames;
+ lcnames
+ .entry(PathBuf::from(lc_dir_entry_str))
+ .or_default()
+ .push((PathBuf::from(&dir_entry), fk));
+ }
+}
+
fn check_package(root: &str, tds_zip: &Option<String>) -> Option<DupHashes> {
let mut lcnames: FxHashMap<PathBuf, Vec<(PathBuf, FileKind)>> = FxHashMap::default();
@@ -1125,6 +1260,12 @@ fn check_package(root: &str, tds_zip: &Option<String>) -> Option<DupHashes> {
// above in the definition of dir_entry_str
let file_name = dir_entry.file_name().to_str().unwrap().to_string();
+ let mtime = meta.modified().unwrap();
+ if is_future_mtime(*NOW, mtime) {
+ let diff = mtime.duration_since(*NOW).unwrap();
+ w0011!(&file_name, diff.as_secs(), &utils::format_duration(&diff));
+ }
+
// we check for weird stuff like socket files aso.
let ft = get_filetype(&dir_entry);
if found_unwanted_filetype(dir_entry_str, &ft) {
@@ -1136,6 +1277,7 @@ fn check_package(root: &str, tds_zip: &Option<String>) -> Option<DupHashes> {
// 1. dealing with symlinks
if ft == FType::Symlink {
match get_symlink(&dir_entry) {
+ // broken symlink
Ok(None) => {
e0010!(&dir_entry_str);
continue;
@@ -1147,22 +1289,18 @@ fn check_package(root: &str, tds_zip: &Option<String>) -> Option<DupHashes> {
Ok(Some(p)) => {
let pd: String =
p.canonicalize().unwrap().to_string_lossy().to_string();
+ // symlink pointing to outside of the package directory tree
if !pd.starts_with(&root_absolute) {
e0030!(&dir_entry_str, p.display());
continue;
}
- let lc_dir_entry_str = dir_entry_str.to_lowercase();
if let Some(_dir_name) = filename(dir_entry_str) {
- let lcnref = &mut lcnames;
- lcnref
- .entry(PathBuf::from(lc_dir_entry_str))
- .or_insert_with(Vec::new)
- .push((
- PathBuf::from(&dir_entry_str),
- //FileKind::Symlink(&dir_entry_str.into()),
- FileKind::Symlink(pd.clone()),
- ));
+ register_duplicate_filename(
+ &mut lcnames,
+ dir_entry_str,
+ FileKind::Symlink(pd.clone()),
+ );
}
if is_readme(&file_name) {
readme_found = true;
@@ -1184,14 +1322,13 @@ fn check_package(root: &str, tds_zip: &Option<String>) -> Option<DupHashes> {
// 2. dealing with directories
if ft == FType::Directory {
- let lc_dir_entry_str = dir_entry_str.to_lowercase();
+ //let lc_dir_entry_str = dir_entry_str.to_lowercase();
if let Some(_dir_name) = filename(dir_entry_str) {
- let lcnref = &mut lcnames;
-
- lcnref
- .entry(PathBuf::from(lc_dir_entry_str))
- .or_insert_with(Vec::new)
- .push((PathBuf::from(dir_entry_str), FileKind::Directory));
+ register_duplicate_filename(
+ &mut lcnames,
+ dir_entry_str,
+ FileKind::Directory,
+ );
}
if !owner_has(p, 5) || !others_have(p, 5) {
@@ -1222,7 +1359,7 @@ fn check_package(root: &str, tds_zip: &Option<String>) -> Option<DupHashes> {
doubleref
.entry(PathBuf::from(file_name))
- .or_insert_with(Vec::new)
+ .or_default()
.push(PathBuf::from(&dir_entry_str));
}
@@ -1258,14 +1395,7 @@ fn check_package(root: &str, tds_zip: &Option<String>) -> Option<DupHashes> {
));
}
- let lc_dir_entry_str = dir_entry_str.to_lowercase();
-
- let lcnref = &mut lcnames;
-
- lcnref
- .entry(PathBuf::from(lc_dir_entry_str))
- .or_insert_with(Vec::new)
- .push((PathBuf::from(&dir_entry_str), FileKind::File));
+ register_duplicate_filename(&mut lcnames, dir_entry_str, FileKind::File);
}
Err(e) => {
@@ -1293,7 +1423,7 @@ fn check_package(root: &str, tds_zip: &Option<String>) -> Option<DupHashes> {
let sizeref = &mut sizes;
let path = path.clone();
- sizeref.entry(fsize).or_insert_with(Vec::new).push(path);
+ sizeref.entry(fsize).or_default().push(path);
};
for (path, (meta, _file_name, is_readme)) in file_names.iter() {
let dir_entry_str = match path.to_str() {
@@ -1362,38 +1492,37 @@ fn check_package(root: &str, tds_zip: &Option<String>) -> Option<DupHashes> {
}
fmm => error!("Should not occur: {} has {:?}", dir_entry_str, fmm),
},
- Some(_) | None => {
- match ft {
- filemagic::Mimetype::Text(LineEnding::Crlf) => {
- e0012!(&dir_entry_str);
- if ARGS.correct_le {
- fix_inconsistent_le(dir_entry_str);
- }
+ Some(_) | None => match ft {
+ filemagic::Mimetype::Text(LineEnding::Crlf) => {
+ e0012!(&dir_entry_str);
+ if ARGS.correct_le {
+ fix_inconsistent_le(dir_entry_str);
}
- filemagic::Mimetype::Text(LineEnding::Cr) => {
- e0037!(&dir_entry_str);
- if ARGS.correct_le {
- fix_inconsistent_le(dir_entry_str);
- }
+ }
+ filemagic::Mimetype::Text(LineEnding::Cr) => {
+ e0037!(&dir_entry_str);
+ if ARGS.correct_le {
+ fix_inconsistent_le(dir_entry_str);
}
- filemagic::Mimetype::Text(LineEnding::Mixed(0, 0, 0)) => (),
- filemagic::Mimetype::Text(LineEnding::Mixed(cr, lf, crlf)) => {
- //println!(">>>{}: {:?} {},{},{}", &dir_entry_str, ft, x, y, z);
- e0038!(&dir_entry_str, cr, lf, crlf);
- if ARGS.correct_le {
- fix_inconsistent_le(dir_entry_str);
- }
+ }
+ filemagic::Mimetype::Text(LineEnding::Mixed(0, 0, 0)) => (),
+ filemagic::Mimetype::Text(LineEnding::Mixed(cr, lf, crlf)) => {
+ e0038!(&dir_entry_str, cr, lf, crlf);
+ if ARGS.correct_le {
+ fix_inconsistent_le(dir_entry_str);
}
- filemagic::Mimetype::Text(LineEnding::Lf) => (),
- fmm => error!("Should not occur: {} has {:?}", dir_entry_str, fmm),
}
- }
+ filemagic::Mimetype::Text(LineEnding::Lf) => (),
+ fmm => error!("Should not occur: {} has {:?}", dir_entry_str, fmm),
+ },
}
}
filemagic::Mimetype::Bom(b) => {
- //println!("{}: {} with BOM detected", dir_entry_str, b.as_ref());
- w0004!(&dir_entry_str, b.as_ref());
+ w0004!(
+ &dir_entry_str,
+ <unicode_bom::Bom as std::convert::AsRef<str>>::as_ref(&b)
+ );
check_and_correct_perms(dir_entry_str, p);
}
filemagic::Mimetype::Binary | filemagic::Mimetype::Script(_) => {
@@ -1462,10 +1591,7 @@ fn check_package(root: &str, tds_zip: &Option<String>) -> Option<DupHashes> {
let hashref = &mut hashes;
scope.execute(move || {
for (size, path, hash) in rx.iter() {
- hashref
- .entry((size, hash))
- .or_insert_with(DupPath::new)
- .push(path);
+ hashref.entry((size, hash)).or_default().push(path);
}
});
@@ -1489,18 +1615,30 @@ fn check_package(root: &str, tds_zip: &Option<String>) -> Option<DupHashes> {
}
fn print_hardlinks(hashes: &FxHashMap<(u64, u64), Vec<String>>) {
- for ((_devid,inode), eles) in hashes.iter() {
+ for ((_devid, inode), eles) in hashes.iter() {
if eles.len() > 1 {
w0010!(inode);
for hfile in eles.iter() {
info!(" >>> {}", &hfile);
}
+ }
+ }
+}
+fn print_casefolding_tds(hashes: &FxHashMap<PathBuf, Vec<(PathBuf, FileKind)>>) {
+ for (k, eles) in hashes.iter() {
+ // println!("pcf_tds: {:?}, {:?}", k, &eles);
+ if eles.len() == 1 {
+ continue;
}
+ e0042!(k.display());
+
+ for (p, ty) in eles {
+ info!(" >>> {} ({})", p.display(), ty);
+ }
}
}
-
fn print_casefolding(hashes: &FxHashMap<PathBuf, Vec<(PathBuf, FileKind)>>) {
for (k, eles) in hashes.iter() {
//println!("pcf: {:?}, {:?}", k, &eles);
diff --git a/support/pkgcheck/src/messages/errorsd.rs b/support/pkgcheck/src/messages/errorsd.rs
index 39a8ccb357..532f0df371 100644
--- a/support/pkgcheck/src/messages/errorsd.rs
+++ b/support/pkgcheck/src/messages/errorsd.rs
@@ -528,3 +528,29 @@ fonts/map/dvips.
"#
)
}
+
+pub fn e0042d() {
+ error!(
+ r#"
+E0042 -- TDS zip archive: duplicate names when ignoring letter case for files or directories
+
+As there are operating systems which do not distinguish between myfile
+and MYFILE we don't want to have file names in a directory which are the
+same after converting to lower case.
+
+For more details refer to:
+http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#filenames
+"#
+ )
+}
+
+pub fn e0043d() {
+ error!(
+ r#"
+E0043 -- Symlink found in TDS zip archive
+
+The TDS zip archive contained a symlink which is not allowed.
+"#
+ )
+}
+
diff --git a/support/pkgcheck/src/messages/fatald.rs b/support/pkgcheck/src/messages/fatald.rs
index 0558612c72..24ece06bad 100644
--- a/support/pkgcheck/src/messages/fatald.rs
+++ b/support/pkgcheck/src/messages/fatald.rs
@@ -107,4 +107,3 @@ rerun.
"#
)
}
-
diff --git a/support/pkgcheck/src/messages/informationd.rs b/support/pkgcheck/src/messages/informationd.rs
index 0eca9849a0..7a87378ad0 100644
--- a/support/pkgcheck/src/messages/informationd.rs
+++ b/support/pkgcheck/src/messages/informationd.rs
@@ -127,4 +127,3 @@ pkgcheck.yml config file like in the following example
"#
)
}
-
diff --git a/support/pkgcheck/src/messages/mod.rs b/support/pkgcheck/src/messages/mod.rs
index 721f27ff7b..265babc961 100644
--- a/support/pkgcheck/src/messages/mod.rs
+++ b/support/pkgcheck/src/messages/mod.rs
@@ -2,11 +2,11 @@ mod errorsd;
mod fatald;
mod informationd;
mod warningsd;
-use colored::Colorize;
use self::errorsd::*;
use self::fatald::*;
use self::informationd::*;
use self::warningsd::*;
+use colored::Colorize;
macro_rules! error_occurred {
() => {
@@ -14,7 +14,6 @@ macro_rules! error_occurred {
};
}
-
macro_rules! no_colors {
() => {
$crate::ARGS.no_colors
@@ -33,7 +32,10 @@ macro_rules! fatal {
macro_rules! f0001 {
() => {{
error_occurred!();
- eprintln!("{} Specify a directory to check (use option -d)", fatal!("F0001"),);
+ eprintln!(
+ "{} Specify a directory to check (use option -d)",
+ fatal!("F0001"),
+ );
}};
}
@@ -42,7 +44,8 @@ macro_rules! f0002 {
error_occurred!();
eprintln!(
"{} Specified directory {} does not exist. Exiting...",
- fatal!("F0002"), $fmt1
+ fatal!("F0002"),
+ $fmt1
);
}};
}
@@ -52,7 +55,8 @@ macro_rules! f0003 {
error_occurred!();
eprintln!(
"{} Specified TDS archive {} does not exist or is no file. Exiting...",
- fatal!("F0003"), $fmt1
+ fatal!("F0003"),
+ $fmt1
);
}};
}
@@ -62,7 +66,8 @@ macro_rules! f0004 {
error_occurred!();
eprintln!(
"{} File {} specified as TDS archive is no zip archive. Exiting...",
- fatal!("F0004"), $fmt1
+ fatal!("F0004"),
+ $fmt1
);
}};
}
@@ -72,7 +77,8 @@ macro_rules! f0005 {
error_occurred!();
eprintln!(
"{} Bad filename {} for the tds.zip archive. Exiting...",
- fatal!("F0005"), $fmt1
+ fatal!("F0005"),
+ $fmt1
);
}};
}
@@ -104,7 +110,8 @@ macro_rules! f0008 {
error_occurred!();
eprintln!(
"{} Config file {} doesn't exist. Exiting...",
- fatal!("F0007"), $fmt
+ fatal!("F0007"),
+ $fmt
);
}};
}
@@ -114,7 +121,9 @@ macro_rules! f0009 {
error_occurred!();
eprintln!(
"{} Error reading config file {}: {} Exiting...",
- fatal!("F0009"), $fmt1, $fmt2
+ fatal!("F0009"),
+ $fmt1,
+ $fmt2
);
}};
}
@@ -124,7 +133,8 @@ macro_rules! f0010 {
error_occurred!();
eprintln!(
"{} Config file's content could not be read properly: {} Exiting...",
- fatal!("F0010"), $fmt
+ fatal!("F0010"),
+ $fmt
);
}};
}
@@ -369,7 +379,10 @@ macro_rules! e0026 {
macro_rules! e0027 {
($fmt1:expr, $fmt2:expr) => {{
error_occurred!();
- error!("{} {}: An I/O error occurred -> {}", "E0027", $fmt1, $fmt2);
+ error!(
+ "{} {}: An I/O error occurred -> {}",
+ "E0027", $fmt1, $fmt2
+ );
}};
}
@@ -494,6 +507,22 @@ macro_rules! e0041 {
}};
}
+macro_rules! e0042 {
+ ($fmt:expr) => {{
+ error_occurred!();
+ error!(
+ "{} TDS zip archive: duplicate names when ignoring letter case for: {}",
+ "E0042", $fmt
+ );
+ }};
+}
+
+macro_rules! e0043 {
+ ($fmt:expr) => {{
+ error_occurred!();
+ error!("{} Symlink {} found in TDS zip archive", "E0043", $fmt);
+ }};
+}
macro_rules! w0001 {
($fmt:expr) => {{
@@ -569,9 +598,7 @@ macro_rules! w0009 {
error_occurred!();
warn!(
"{} Replacing `{} -> {}` with the same from config file",
- "W0009",
- $fmt1,
- $fmt2
+ "W0009", $fmt1, $fmt2
)
}};
}
@@ -582,6 +609,15 @@ macro_rules! w0010 {
}};
}
+macro_rules! w0011 {
+ ($fmt1:expr, $fmt2:expr, $fmt3:expr) => {{
+ warn!(
+ "{} {} has an mtime in the future by {} seconds, or {}",
+ "W0011", $fmt1, $fmt2, $fmt3
+ )
+ }};
+}
+
macro_rules! i0002 {
($fmt:expr) => {{
info!(
@@ -638,11 +674,7 @@ macro_rules! i0009 {
error_occurred!();
warn!(
"{} Updating entry `{} -> {}` with `{} -> {}` from config file",
- "I0009",
- $fmt1,
- $fmt2,
- $fmt1,
- $fmt3
+ "I0009", $fmt1, $fmt2, $fmt1, $fmt3
)
}};
}
@@ -701,6 +733,8 @@ pub fn explains(err: &str) {
"E0039" => e0039d(),
"E0040" => e0040d(),
"E0041" => e0041d(),
+ "E0042" => e0042d(),
+ "E0043" => e0043d(),
// "I0001" => i0001d!(),
"I0001" => i0001d(),
@@ -723,6 +757,7 @@ pub fn explains(err: &str) {
"W0008" => w0008d(),
"W0009" => w0009d(),
"W0010" => w0010d(),
+ "W0011" => w0011d(),
e => eprintln!(
"{} Unknown error code `{}` specified with option -e resp. --explain. Exiting...",
@@ -785,6 +820,8 @@ pub fn explains_all() {
explains("E0039");
explains("E0040");
explains("E0041");
+ explains("E0042");
+ explains("E0043");
explains("I0001");
explains("I0002");
@@ -806,4 +843,5 @@ pub fn explains_all() {
explains("W0008");
explains("W0009");
explains("W0010");
+ explains("W0011");
}
diff --git a/support/pkgcheck/src/messages/warningsd.rs b/support/pkgcheck/src/messages/warningsd.rs
index 6fe37835cf..176fc1d2de 100644
--- a/support/pkgcheck/src/messages/warningsd.rs
+++ b/support/pkgcheck/src/messages/warningsd.rs
@@ -111,7 +111,7 @@ We regard a file as a Windows file if its name ends with:
pub fn w0009d() {
warn!(
r#"
-W0009 -- Replacing -> ` with the same from config file",
+W0009 -- Replacing <pkgname> -> <tpkg> with the same from config file",
This message can only show up if pkgcheck got called with --config.
Indicates that an entry in the pkgcheck config file does the same as the
@@ -131,3 +131,20 @@ displayed
)
}
+pub fn w0011d() {
+ warn!(
+ r#"
+W0011 -- has an mtime in the future by seconds, or <hours, minutes, seconds>
+
+The file has a future modification time. This is most probably caused by
+the archiver tool which doesn't pay attention to the timezone when
+adding the file to the archive
+
+The future time will be displayed in
+
+- seconds
+- and hours, minutes and seconds
+"#
+ )
+}
+
diff --git a/support/pkgcheck/src/recode.rs b/support/pkgcheck/src/recode.rs
index 827da9587b..4d71ac5467 100644
--- a/support/pkgcheck/src/recode.rs
+++ b/support/pkgcheck/src/recode.rs
@@ -74,7 +74,7 @@ pub fn wrong_line_endings2crlf(fname: &str) -> Result<(), io::Error> {
};
// write back
- match hdl_out.write(&another_vec) {
+ match hdl_out.write_all(&another_vec) {
Ok(_) => Ok(()),
Err(e) => Err(e),
}
@@ -102,7 +102,7 @@ pub fn wrong_line_endings2lf(fname: &str) -> Result<(), io::Error> {
};
// write back
- match hdl_out.write(&another_vec) {
+ match hdl_out.write_all(&another_vec) {
Ok(_) => Ok(()),
Err(e) => Err(e),
}
diff --git a/support/pkgcheck/src/utils.rs b/support/pkgcheck/src/utils.rs
index b311453b66..e934c6d9d9 100644
--- a/support/pkgcheck/src/utils.rs
+++ b/support/pkgcheck/src/utils.rs
@@ -5,16 +5,17 @@ use std::fs::read_link;
use std::os::unix::fs::PermissionsExt;
use std::path::Path;
use std::path::PathBuf;
+use std::time::Duration;
use walkdir::DirEntry;
use once_cell::sync::Lazy; // 1.3.1
use regex::Regex;
use std::borrow::Cow;
-use std::io;
use std::fs::File;
+use std::io;
use std::process::Command;
-use zip::result::ZipResult;
use std::sync::atomic::Ordering;
+use zip::result::ZipResult;
use std::fs;
@@ -121,7 +122,6 @@ impl Utils {
}
pub fn check_for_temporary_file(&self, dir_entry_str: &str) {
-
static RE: Lazy<Regex> = Lazy::new(regex_temporary_file_endings);
if RE.is_match(dir_entry_str) {
@@ -269,7 +269,7 @@ pub fn temp_file_endings() -> Vec<(String, String)> {
(".xref", "htlatex related"),
(".xray", "dump of \\show output"),
("~", "a file name ending with ~ (tilde) is temporary anyway"),
- // ( ".lyx~", "LyX related backup file" ),
+ ("Thumbs.db", "thumbnails file in Windows"),
];
v.into_iter()
@@ -474,6 +474,16 @@ pub fn dirname(entry: &str) -> Option<&str> {
}
#[test]
+fn test_format_duration() {
+ assert!(format_duration(&Duration::new(5, 0)) == String::from("5sec"));
+ assert!(format_duration(&Duration::new(105, 0)) == String::from("1min 45sec"));
+ assert!(format_duration(&Duration::new(3801, 0)) == String::from("1h 3min 21sec"));
+ assert!(format_duration(&Duration::new(25449, 0)) == String::from("7h 4min 9sec"));
+ assert!(format_duration(&Duration::new(108245, 0)) == String::from("1d 6h 4min 5sec"));
+ assert!(format_duration(&Duration::new(0, 0)) == String::from("0sec"));
+}
+
+#[test]
fn test_filename() {
assert!(filename("/etc/fstab") == Some("fstab"));
assert!(filename("fstab") == Some("fstab"));
@@ -482,6 +492,7 @@ fn test_filename() {
assert!(filename("/") == None);
}
+// We return the right part of a path name if it does not end with a `/`
pub fn filename(entry: &str) -> Option<&str> {
if entry.ends_with('/') {
return None;
@@ -502,3 +513,30 @@ pub fn basename(path: &str) -> Cow<str> {
None => path.into(),
}
}
+
+pub fn format_duration(duration: &Duration) -> String {
+ let seconds = duration.as_secs();
+ let days = seconds / 86400;
+ let hours = (seconds % 86400) / 3600;
+ let minutes = (seconds % 3600) / 60;
+ let seconds = seconds % 60;
+
+ let mut result = String::new();
+ if days > 0 {
+ result.push_str(&format!("{}d ", days));
+ }
+
+ if hours > 0 {
+ result.push_str(&format!("{}h ", hours));
+ }
+
+ if minutes > 0 {
+ result.push_str(&format!("{}min ", minutes));
+ }
+
+ if seconds > 0 || result.is_empty() {
+ result.push_str(&format!("{}sec", seconds));
+ }
+
+ return result.trim().to_string();
+}
diff --git a/support/SQLTeX/Makefile.am b/support/sqltex/Makefile.am
index 82bde20e48..82bde20e48 100644
--- a/support/SQLTeX/Makefile.am
+++ b/support/sqltex/Makefile.am
diff --git a/support/SQLTeX/Makefile.in b/support/sqltex/Makefile.in
index aaec779cb4..2284b7696f 100644
--- a/support/SQLTeX/Makefile.in
+++ b/support/sqltex/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -134,7 +134,7 @@ am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- cscope distdir dist dist-all distcheck
+ cscope distdir distdir-am dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
@@ -152,11 +152,8 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(srcdir)/Makefile.in install-sh missing
+am__DIST_COMMON = $(srcdir)/Makefile.in README.md install-sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -195,6 +192,8 @@ am__relativize = \
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
+# Exists only to be overridden by the user if desired.
+AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -206,11 +205,14 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
+ETAGS = @ETAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -301,8 +303,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -419,8 +421,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
-distdir: $(DISTFILES)
+distdir-am: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -485,7 +489,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
@@ -500,6 +504,10 @@ dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
+dist-zstd: distdir
+ tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
+ $(am__post_remove_distdir)
+
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@@ -511,7 +519,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
@@ -529,7 +537,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@@ -539,9 +547,11 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
+ *.tar.zst*) \
+ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
@@ -557,7 +567,7 @@ distcheck: dist
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
@@ -718,7 +728,7 @@ uninstall-am:
am--refresh check check-am clean clean-cscope clean-generic \
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
- distcheck distclean distclean-generic distclean-tags \
+ dist-zstd distcheck distclean distclean-generic distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
diff --git a/support/SQLTeX/README.md b/support/sqltex/README.md
index b980c7a9a7..a99022363a 100644
--- a/support/SQLTeX/README.md
+++ b/support/sqltex/README.md
@@ -1,26 +1,52 @@
-SQLTeX v2.1
+SQLTeX v3.0
===========
**SQLTeX** is a preprocessor to enable the use of SQL statements in LaTeX. It is a
-perl script that reads an input file containing the SQL commands, and writes a
-LaTeX file that can be processed with your LaTeX package.
+perl script that reads one or more input files containing the SQL commands, and writes a
+single LaTeX file or multiple files based on the data read from the database.
+Those files can be processed with your LaTeX package.
The SQL commands will be replaced by their values. It's possible to select a
single field for substitution substitution in your LaTeX document, or to be
used as input in another SQL command.
-When an SQL command returns multiple fields and or rows, the values can only be
-used for substitution in the document.
+### Features ###
+
+* Replace the SQL statements with their result. This can be a single field, a row or multiple rows,
+* Configurable replace file to translate special characters or strings to LaTeX format, with support for regular expressions,
+* Use info read from the database as input for new SQL statements,
+* Process parts of the LaTeX input file in a loop generating multiple pages or documents,
+* Write updates to the database when data has been processed,
+* Process parts of the document conditionally using `\sqlif` and `\sqlendif` commands,
+* Process data by external scripts and use the output with the `\sqlsystem` command (by default disabled in the config file),
+
+and more.
+
+### Supported databases ###
+
+* MySQL/MariaDB
+* Sybase
+* Oracle
+* PostgreSQL
+* MSSQL
+
+ODBC is supported.
+
+Others database (Ingres, mSQL, ...) '*should work*'&trade; but haven´t been tested.
Installing SQLTeX
-----------------
+Since version 3.0, **SQLTeX** is part of **TeX Live** and doesn't need further installation.
+
+If you are using a different LaTeX distro, please follow the steps below for your OS.
+
### Linux ###
On a linux system, download the archive and unpack:
- $ tar vxzf sqltex-2.1.tar.gz
- $ cd sqltex-2.1
+ $ tar vxzf sqltex-3.0.tar.gz
+ $ cd sqltex-3.0
Next, install **SQLTeX** with the following commands:
@@ -28,7 +54,7 @@ Next, install **SQLTeX** with the following commands:
$ make
$ sudo make install
-The _`options`_ in `configure` are optional. For an overview of available options
+The *options* in `configure` are optional. For an overview of available options
type:
$ ./configure --help
@@ -39,11 +65,10 @@ type:
#### Windows ####
-This distribution contains an .EXE file that was generated using `PAR::Packer`
-with Strawberry Perl.
+The files `sqltex-3.0\sqltex`, `sqltex-3.0\src\SQLTeX.cfg` and `sqltex-3.0\src\SQLTeX_r.dat` must be placed manually
+in the directory of your choice, all in the same directory.
-The files `sqltex-2.1\SQLTeX.EXE`, `sqltex-2.1\src\SQLTeX.cfg` and `sqltex-2.1\src\SQLTeX_r.dat` must be placed manually
-in the directory of your choice, all in the same direcrtory.
+Since v3.0 the `SQLTeX.EXE` binary is no longer provided in the distribution.
#### OpenVMS ####
@@ -52,9 +77,9 @@ it manually.
On OpenVMS it would be something like:
- $ COPY [.SQLTEX-2_1.SRC]SQLTEX.PL SYS$SYSTEM:
- $ COPY [.SQLTEX-2_1.SRC]SQLTEX.CFG SYS$SYSTEM:
- $ COPY [.SQLTEX-2_1.SRC]SQLTEX_R.DAT SYS$SYSTEM:
+ $ COPY [.SQLTEX-3_0.SRC]SQLTEX. SYS$SYSTEM:SQLTEX.PL
+ $ COPY [.SQLTEX-3_0.SRC]SQLTEX.CFG SYS$SYSTEM:
+ $ COPY [.SQLTEX-3_0.SRC]SQLTEX_R.DAT SYS$SYSTEM:
$ SET FILE/PROTECTION=(W:R) SYS$SYSTEM:SQLTEX*.*
However, on OpenVMS you also need to define the command SQLTEX by setting a
@@ -86,9 +111,11 @@ installed in advance, since gcc is not available in a standard install of Mac OS
Credits
-------
+* **Karl Berry** for integration in TeX Live
* **Ingo Reich** for the comment on Mac OS
* **Johan W. Klüwer** for verifying the SyBase support
* **Paolo Cavallini** for adding PostgreSQL support
+* **Silpa Suresh** for testing the ODBC support
----------
@@ -96,8 +123,9 @@ The **SQLTeX** project is available from [GitHub](https://github.com/oveas/sqlte
For bugs, questions and comments, please use the [issue tracker](https://github.com/oveas/sqltex/issues)
+Copyright (c) 2001-2024 - Oscar van Eijk, Oveas Functionality Provider
+
This software is subject to the terms of the LaTeX Project Public License;
see [http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html](http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html)
-Copyright (c) 2001-2022 - Oscar van Eijk, Oveas Functionality Provider
diff --git a/support/SQLTeX/aclocal.m4 b/support/sqltex/aclocal.m4
index 433d545f67..6d04fca5b5 100644
--- a/support/SQLTeX/aclocal.m4
+++ b/support/sqltex/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -14,13 +14,13 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.15'
+[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.16.5], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.16.5])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -138,6 +138,10 @@ m4_defn([AC_PROG_CC])
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.65])dnl
+m4_ifdef([_$0_ALREADY_INIT],
+ [m4_fatal([$0 expanded multiple times
+]m4_defn([_$0_ALREADY_INIT]))],
+ [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -174,7 +178,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(
- m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
[ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
@@ -197,8 +201,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
@@ -226,6 +230,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
+# Variables for tags utilities; see am/tags.am
+if test -z "$CTAGS"; then
+ CTAGS=ctags
+fi
+AC_SUBST([CTAGS])
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+AC_SUBST([ETAGS])
+if test -z "$CSCOPE"; then
+ CSCOPE=cscope
+fi
+AC_SUBST([CSCOPE])
+
AC_REQUIRE([AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
@@ -265,7 +283,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -307,7 +325,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -328,7 +346,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -349,7 +367,7 @@ AC_SUBST([am__leading_dot])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -370,12 +388,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
@@ -388,7 +401,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -419,7 +432,7 @@ AC_DEFUN([_AM_IF_OPTION],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -500,7 +513,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -560,7 +573,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -588,7 +601,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -607,7 +620,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/support/SQLTeX/aclocal/ax_prog_perl_modules.m4 b/support/sqltex/aclocal/ax_prog_perl_modules.m4
index 11a326c930..11a326c930 100644
--- a/support/SQLTeX/aclocal/ax_prog_perl_modules.m4
+++ b/support/sqltex/aclocal/ax_prog_perl_modules.m4
diff --git a/support/SQLTeX/configure b/support/sqltex/configure
index 4b758dc66c..a5547a0926 100755
--- a/support/SQLTeX/configure
+++ b/support/sqltex/configure
@@ -1,11 +1,12 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for SQLTeX 2.1.
+# Generated by GNU Autoconf 2.71 for SQLTeX 3.0.
#
# Report bugs to <support@oveas.com>.
#
#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
+# Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -16,14 +17,16 @@
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+as_nop=:
+if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
-else
+else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
@@ -33,46 +36,46 @@ esac
fi
+
+# Reset variables that may have inherited troublesome values from
+# the environment.
+
+# IFS needs to be set, to space, tab, and newline, in precisely that order.
+# (If _AS_PATH_WALK were called with IFS unset, it would have the
+# side effect of setting IFS to empty, thus disabling word splitting.)
+# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
+IFS=" "" $as_nl"
+
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# Ensure predictable behavior from utilities with locale-dependent output.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# We cannot yet rely on "unset" to work, but we need these variables
+# to be unset--not just set to an empty or harmless value--now, to
+# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
+# also avoids known problems related to "unset" and subshell syntax
+# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
+for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
+do eval test \${$as_var+y} \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+
+# Ensure that fds 0, 1, and 2 are open.
+if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
+if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
+if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
+if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
@@ -81,13 +84,6 @@ if test "${PATH_SEPARATOR+set}" != set; then
fi
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
@@ -96,8 +92,12 @@ case $0 in #((
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
@@ -109,30 +109,10 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
@@ -154,20 +134,22 @@ esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
+printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ as_bourne_compatible="as_nop=:
+if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
-else
+else \$as_nop
case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
@@ -187,41 +169,52 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+if ( set x; as_fn_ret_success y && test x = \"\$1\" )
+then :
-else
+else \$as_nop
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
+blah=\$(echo \$(echo blah))
+test x\"\$blah\" = xblah || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
+ if (eval "$as_required") 2>/dev/null
+then :
as_have_required=yes
-else
+else $as_nop
as_have_required=no
fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
+then :
-else
+else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
+ as_shell=$as_dir$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
+then :
CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
+then :
break 2
fi
fi
@@ -229,14 +222,21 @@ fi
esac
as_found=false
done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
IFS=$as_save_IFS
+if $as_found
+then :
+
+else $as_nop
+ if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
+then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi
+fi
- if test "x$CONFIG_SHELL" != x; then :
+ if test "x$CONFIG_SHELL" != x
+then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
@@ -254,18 +254,19 @@ esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ if test x$as_have_required = xno
+then :
+ printf "%s\n" "$0: This script requires a shell more modern than all"
+ printf "%s\n" "$0: the shells that I found on your system."
+ if test ${ZSH_VERSION+y} ; then
+ printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
else
- $as_echo "$0: Please tell bug-autoconf@gnu.org and support@oveas.com
+ printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and support@oveas.com
$0: about your system, including any error possibly output
$0: before this message. Then install a modern shell, or
$0: manually run the script under such a shell if you do
@@ -293,6 +294,7 @@ as_fn_unset ()
}
as_unset=as_fn_unset
+
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
@@ -310,6 +312,14 @@ as_fn_exit ()
as_fn_set_status $1
exit $1
} # as_fn_exit
+# as_fn_nop
+# ---------
+# Do nothing but, unlike ":", preserve the value of $?.
+as_fn_nop ()
+{
+ return $?
+}
+as_nop=as_fn_nop
# as_fn_mkdir_p
# -------------
@@ -324,7 +334,7 @@ as_fn_mkdir_p ()
as_dirs=
while :; do
case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
@@ -333,7 +343,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
+printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -372,12 +382,13 @@ as_fn_executable_p ()
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
+then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
-else
+else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
@@ -389,18 +400,27 @@ fi # as_fn_append
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
+then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
-else
+else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
+# as_fn_nop
+# ---------
+# Do nothing but, unlike ":", preserve the value of $?.
+as_fn_nop ()
+{
+ return $?
+}
+as_nop=as_fn_nop
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
@@ -412,9 +432,9 @@ as_fn_error ()
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $2" >&2
+ printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -441,7 +461,7 @@ as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
+printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -485,7 +505,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
@@ -499,6 +519,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
exit
}
+
+# Determine whether it's possible to make 'echo' print without a newline.
+# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
+# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
@@ -512,6 +536,13 @@ case `echo -n x` in #(((((
ECHO_N='-n';;
esac
+# For backward compatibility with old third-party macros, we provide
+# the shell variables $as_echo and $as_echo_n. New code should use
+# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
+as_echo='printf %s\n'
+as_echo_n='printf %s'
+
+
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
@@ -579,8 +610,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='SQLTeX'
PACKAGE_TARNAME='sqltex'
-PACKAGE_VERSION='2.1'
-PACKAGE_STRING='SQLTeX 2.1'
+PACKAGE_VERSION='3.0'
+PACKAGE_STRING='SQLTeX 3.0'
PACKAGE_BUGREPORT='support@oveas.com'
PACKAGE_URL=''
@@ -591,6 +622,9 @@ AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
AM_V
+CSCOPE
+ETAGS
+CTAGS
am__untar
am__tar
AMTAR
@@ -729,8 +763,6 @@ do
*) ac_optarg=yes ;;
esac
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
@@ -771,9 +803,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
@@ -797,9 +829,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
@@ -1010,9 +1042,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
@@ -1026,9 +1058,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
@@ -1072,9 +1104,9 @@ Try \`$0 --help' for more information"
*)
# FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2
: "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
@@ -1090,7 +1122,7 @@ if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
@@ -1154,7 +1186,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_myself" : 'X\(//\)[^/]' \| \
X"$as_myself" : 'X\(//\)$' \| \
X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
+printf "%s\n" X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -1211,7 +1243,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures SQLTeX 2.1 to adapt to many kinds of systems.
+\`configure' configures SQLTeX 3.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1278,7 +1310,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of SQLTeX 2.1:";;
+ short | recursive ) echo "Configuration of SQLTeX 3.0:";;
esac
cat <<\_ACEOF
@@ -1305,9 +1337,9 @@ if test "$ac_init_help" = "recursive"; then
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -1335,7 +1367,8 @@ esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
+ # Check for configure.gnu first; this name is used for a wrapper for
+ # Metaconfig's "Configure" on case-insensitive file systems.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
@@ -1343,7 +1376,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
@@ -1352,10 +1385,10 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-SQLTeX configure 2.1
-generated by GNU Autoconf 2.69
+SQLTeX configure 3.0
+generated by GNU Autoconf 2.71
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2021 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1365,14 +1398,34 @@ fi
## ------------------------ ##
## Autoconf initialization. ##
## ------------------------ ##
+ac_configure_args_raw=
+for ac_arg
+do
+ case $ac_arg in
+ *\'*)
+ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append ac_configure_args_raw " '$ac_arg'"
+done
+
+case $ac_configure_args_raw in
+ *$as_nl*)
+ ac_safe_unquote= ;;
+ *)
+ ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab.
+ ac_unsafe_a="$ac_unsafe_z#~"
+ ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g"
+ ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;;
+esac
+
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by SQLTeX $as_me 2.1, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+It was created by SQLTeX $as_me 3.0, which was
+generated by GNU Autoconf 2.71. Invocation command line was
- $ $0 $@
+ $ $0$ac_configure_args_raw
_ACEOF
exec 5>>config.log
@@ -1405,8 +1458,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ printf "%s\n" "PATH: $as_dir"
done
IFS=$as_save_IFS
@@ -1441,7 +1498,7 @@ do
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
@@ -1476,11 +1533,13 @@ done
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
+ # Sanitize IFS.
+ IFS=" "" $as_nl"
# Save into config.log some information that might help in debugging.
{
echo
- $as_echo "## ---------------- ##
+ printf "%s\n" "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
echo
@@ -1491,8 +1550,8 @@ trap 'exit_status=$?
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
@@ -1516,7 +1575,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
)
echo
- $as_echo "## ----------------- ##
+ printf "%s\n" "## ----------------- ##
## Output variables. ##
## ----------------- ##"
echo
@@ -1524,14 +1583,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- $as_echo "$ac_var='\''$ac_val'\''"
+ printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
+ printf "%s\n" "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
echo
@@ -1539,15 +1598,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- $as_echo "$ac_var='\''$ac_val'\''"
+ printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
- $as_echo "## ----------- ##
+ printf "%s\n" "## ----------- ##
## confdefs.h. ##
## ----------- ##"
echo
@@ -1555,8 +1614,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
echo
fi
test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
+ printf "%s\n" "$as_me: caught signal $ac_signal"
+ printf "%s\n" "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
@@ -1570,63 +1629,48 @@ ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
-$as_echo "/* confdefs.h */" > confdefs.h
+printf "%s\n" "/* confdefs.h */" > confdefs.h
# Predefined preprocessor variables.
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
+printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
+printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
+printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
+printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
+printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
+printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h
# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
+ ac_site_files="$CONFIG_SITE"
elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
+ ac_site_files="$prefix/share/config.site $prefix/etc/config.site"
else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
+ ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+
+for ac_site_file in $ac_site_files
do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ case $ac_site_file in #(
+ */*) :
+ ;; #(
+ *) :
+ ac_site_file=./$ac_site_file ;;
+esac
+ if test -f "$ac_site_file" && test -r "$ac_site_file"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
fi
@@ -1636,19 +1680,117 @@ if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special files
# actually), so we avoid doing that. DJGPP emulates it as a regular file.
if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+printf "%s\n" "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+printf "%s\n" "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
+
+# Auxiliary files required by this configure script.
+ac_aux_files="missing install-sh"
+
+# Locations in which to look for auxiliary files.
+ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.."
+
+# Search for a directory containing all of the required auxiliary files,
+# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates.
+# If we don't find one directory that contains all the files we need,
+# we report the set of missing files from the *first* directory in
+# $ac_aux_dir_candidates and give up.
+ac_missing_aux_files=""
+ac_first_candidate=:
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in $ac_aux_dir_candidates
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ as_found=:
+
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5
+ ac_aux_dir_found=yes
+ ac_install_sh=
+ for ac_aux in $ac_aux_files
+ do
+ # As a special case, if "install-sh" is required, that requirement
+ # can be satisfied by any of "install-sh", "install.sh", or "shtool",
+ # and $ac_install_sh is set appropriately for whichever one is found.
+ if test x"$ac_aux" = x"install-sh"
+ then
+ if test -f "${as_dir}install-sh"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5
+ ac_install_sh="${as_dir}install-sh -c"
+ elif test -f "${as_dir}install.sh"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5
+ ac_install_sh="${as_dir}install.sh -c"
+ elif test -f "${as_dir}shtool"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5
+ ac_install_sh="${as_dir}shtool install -c"
+ else
+ ac_aux_dir_found=no
+ if $ac_first_candidate; then
+ ac_missing_aux_files="${ac_missing_aux_files} install-sh"
+ else
+ break
+ fi
+ fi
+ else
+ if test -f "${as_dir}${ac_aux}"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5
+ else
+ ac_aux_dir_found=no
+ if $ac_first_candidate; then
+ ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}"
+ else
+ break
+ fi
+ fi
+ fi
+ done
+ if test "$ac_aux_dir_found" = yes; then
+ ac_aux_dir="$as_dir"
+ break
+ fi
+ ac_first_candidate=false
+
+ as_found=false
+done
+IFS=$as_save_IFS
+if $as_found
+then :
+
+else $as_nop
+ as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5
+fi
+
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+if test -f "${ac_aux_dir}config.guess"; then
+ ac_config_guess="$SHELL ${ac_aux_dir}config.guess"
+fi
+if test -f "${ac_aux_dir}config.sub"; then
+ ac_config_sub="$SHELL ${ac_aux_dir}config.sub"
+fi
+if test -f "$ac_aux_dir/configure"; then
+ ac_configure="$SHELL ${ac_aux_dir}configure"
+fi
+
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
@@ -1659,12 +1801,12 @@ for ac_var in $ac_precious_vars; do
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
@@ -1673,24 +1815,24 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_old_val_w=`echo x $ac_old_val`
ac_new_val_w=`echo x $ac_new_val`
if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
ac_cache_corrupted=:
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
eval $ac_var=\$ac_old_val
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
@@ -1700,11 +1842,12 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi
done
if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file'
+ and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
@@ -1718,38 +1861,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-am__api_version='1.15'
+am__api_version='1.16'
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-# Find a good install program. We prefer a C program (faster),
+ # Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
@@ -1763,20 +1879,25 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+printf %s "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+if test ${ac_cv_path_install+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ # Account for fact that we put trailing slashes in our PATH walk.
+case $as_dir in #((
+ ./ | /[cC]/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
/usr/ucb/* ) ;;
@@ -1786,13 +1907,13 @@ case $as_dir/ in #((
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# program-specific install script used by HP pwplus--don't use.
:
else
@@ -1800,12 +1921,12 @@ case $as_dir/ in #((
echo one > conftest.one
echo two > conftest.two
mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" &&
test -s conftest.one && test -s conftest.two &&
test -s conftest.dir/conftest.one &&
test -s conftest.dir/conftest.two
then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c"
break 3
fi
fi
@@ -1821,7 +1942,7 @@ IFS=$as_save_IFS
rm -rf conftest.one conftest.two conftest.dir
fi
- if test "${ac_cv_path_install+set}" = set; then
+ if test ${ac_cv_path_install+y}; then
INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. Don't cache a
@@ -1831,8 +1952,8 @@ fi
INSTALL=$ac_install_sh
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+printf "%s\n" "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
@@ -1842,8 +1963,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+printf %s "checking whether build environment is sane... " >&6; }
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -1897,8 +2018,8 @@ else
as_fn_error $? "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
@@ -1917,26 +2038,23 @@ test "$program_suffix" != NONE &&
# Double any \ or $.
# By default was `s,x,x', remove it if useless.
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"`
+
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
+
+ if test x"${MISSING+set}" != xset; then
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
am_missing_run="$MISSING "
else
am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh+set}" != xset; then
@@ -1956,11 +2074,12 @@ if test "$cross_compiling" != no; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
@@ -1968,11 +2087,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -1983,11 +2106,11 @@ fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+printf "%s\n" "$STRIP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -1996,11 +2119,12 @@ if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_STRIP"; then
ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
@@ -2008,11 +2132,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2023,11 +2151,11 @@ fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+printf "%s\n" "$ac_ct_STRIP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_STRIP" = x; then
@@ -2035,8 +2163,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
STRIP=$ac_ct_STRIP
@@ -2048,25 +2176,31 @@ fi
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5
+printf %s "checking for a race-free mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ if test ${ac_cv_path_mkdir+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_prog in mkdir gmkdir; do
for ac_exec_ext in '' $ac_executable_extensions; do
- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
+ as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir ('*'coreutils) '* | \
+ 'BusyBox '* | \
'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext
break 3;;
esac
done
@@ -2077,7 +2211,7 @@ IFS=$as_save_IFS
fi
test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
+ if test ${ac_cv_path_mkdir+y}; then
MKDIR_P="$ac_cv_path_mkdir -p"
else
# As a last resort, use the slow shell script. Don't cache a
@@ -2087,18 +2221,19 @@ fi
MKDIR_P="$ac_install_sh -d"
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+printf "%s\n" "$MKDIR_P" >&6; }
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AWK+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
@@ -2106,11 +2241,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2121,24 +2260,25 @@ fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+printf "%s\n" "$AWK" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
test -n "$AWK" && break
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval test \${ac_cv_prog_make_${ac_make}_set+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
@@ -2154,12 +2294,12 @@ esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
SET_MAKE=
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
@@ -2173,7 +2313,8 @@ fi
rmdir .tst 2>/dev/null
# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
+if test ${enable_silent_rules+y}
+then :
enableval=$enable_silent_rules;
fi
@@ -2183,12 +2324,13 @@ case $enable_silent_rules in # (((
*) AM_DEFAULT_VERBOSITY=1;;
esac
am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if $as_echo 'TRUE=$(BAR$(V))
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+printf %s "checking whether $am_make supports nested variables... " >&6; }
+if test ${am_cv_make_support_nested_variables+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if printf "%s\n" 'TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
@@ -2200,8 +2342,8 @@ else
am_cv_make_support_nested_variables=no
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+printf "%s\n" "$am_cv_make_support_nested_variables" >&6; }
if test $am_cv_make_support_nested_variables = yes; then
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
@@ -2233,17 +2375,13 @@ fi
# Define the identity of the package.
PACKAGE='sqltex'
- VERSION='2.1'
+ VERSION='3.0'
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
+printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
+printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h
# Some tools Automake needs.
@@ -2263,8 +2401,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target (and possibly the TAP driver). The
@@ -2283,6 +2421,20 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+# Variables for tags utilities; see am/tags.am
+if test -z "$CTAGS"; then
+ CTAGS=ctags
+fi
+
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+
+if test -z "$CSCOPE"; then
+ CSCOPE=cscope
+fi
+
+
# POSIX will say in a future version that running "rm -f" with no argument
# is OK; and we want to be able to make that assumption in our Makefile
@@ -2315,7 +2467,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -2337,15 +2489,18 @@ fi
+
+
# Make sure we have perl
if test -z "$PERL"; then
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_PERL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_PERL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$PERL"; then
ac_cv_prog_PERL="$PERL" # Let the user override the test.
else
@@ -2353,11 +2508,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_PERL="perl"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2368,11 +2527,11 @@ fi
fi
PERL=$ac_cv_prog_PERL
if test -n "$PERL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
-$as_echo "$PERL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
+printf "%s\n" "$PERL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -2380,19 +2539,19 @@ fi
if test "x$PERL" != x; then
ax_perl_modules_failed=0
- for ax_perl_module in 'DBI' 'Getopt::Long' 'Term::ReadKey' ; do
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ax_perl_module" >&5
-$as_echo_n "checking for perl module $ax_perl_module... " >&6; }
+ for ax_perl_module in 'DBI' 'DBD::mysql' 'Getopt::Long' 'Term::ReadKey' ; do
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for perl module $ax_perl_module" >&5
+printf %s "checking for perl module $ax_perl_module... " >&6; }
# Would be nice to log result here, but can't rely on autoconf internals
$PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1
if test $? -ne 0; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; };
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; };
ax_perl_modules_failed=1
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; };
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+printf "%s\n" "ok" >&6; };
fi
done
@@ -2402,14 +2561,15 @@ $as_echo "ok" >&6; };
else
:
+ as_fn_error $? "Not all required perl modules are installed" "$LINENO" 5
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5
-$as_echo "$as_me: WARNING: could not find perl" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5
+printf "%s\n" "$as_me: WARNING: could not find perl" >&2;}
fi
-# Makefile to be generated in the subdircetories as welll
+# Makefile to be generated in the subdirectories as well
ac_config_files="$ac_config_files Makefile src/Makefile doc/Makefile man/Makefile"
@@ -2440,8 +2600,8 @@ _ACEOF
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
@@ -2471,15 +2631,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
/^ac_cv_env_/b end
t clear
:clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/
t end
s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+printf "%s\n" "$as_me: updating cache $cache_file" >&6;}
if test ! -f "$cache_file" || test -h "$cache_file"; then
cat confcache >"$cache_file"
else
@@ -2493,8 +2653,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;}
fi
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
@@ -2547,7 +2707,7 @@ U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
@@ -2558,22 +2718,22 @@ LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
-$as_echo_n "checking that generated files are newer than configure... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+printf %s "checking that generated files are newer than configure... " >&6; }
if test -n "$am_sleep_pid"; then
# Hide warnings about reused PIDs.
wait $am_sleep_pid 2>/dev/null
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5
+printf "%s\n" "done" >&6; }
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
@@ -2596,14 +2756,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+as_nop=:
+if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
-else
+else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
@@ -2613,46 +2775,46 @@ esac
fi
+
+# Reset variables that may have inherited troublesome values from
+# the environment.
+
+# IFS needs to be set, to space, tab, and newline, in precisely that order.
+# (If _AS_PATH_WALK were called with IFS unset, it would have the
+# side effect of setting IFS to empty, thus disabling word splitting.)
+# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
+IFS=" "" $as_nl"
+
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# Ensure predictable behavior from utilities with locale-dependent output.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# We cannot yet rely on "unset" to work, but we need these variables
+# to be unset--not just set to an empty or harmless value--now, to
+# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
+# also avoids known problems related to "unset" and subshell syntax
+# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
+for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
+do eval test \${$as_var+y} \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+
+# Ensure that fds 0, 1, and 2 are open.
+if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
+if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
+if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
+if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
@@ -2661,13 +2823,6 @@ if test "${PATH_SEPARATOR+set}" != set; then
fi
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
@@ -2676,8 +2831,12 @@ case $0 in #((
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
@@ -2689,30 +2848,10 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# as_fn_error STATUS ERROR [LINENO LOG_FD]
@@ -2725,13 +2864,14 @@ as_fn_error ()
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $2" >&2
+ printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
+
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
@@ -2758,18 +2898,20 @@ as_fn_unset ()
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
+
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
+then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
-else
+else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
@@ -2781,12 +2923,13 @@ fi # as_fn_append
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
+then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
-else
+else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
@@ -2817,7 +2960,7 @@ as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
+printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -2839,6 +2982,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# Determine whether it's possible to make 'echo' print without a newline.
+# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
+# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
@@ -2852,6 +2999,12 @@ case `echo -n x` in #(((((
ECHO_N='-n';;
esac
+# For backward compatibility with old third-party macros, we provide
+# the shell variables $as_echo and $as_echo_n. New code should use
+# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
+as_echo='printf %s\n'
+as_echo_n='printf %s'
+
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
@@ -2893,7 +3046,7 @@ as_fn_mkdir_p ()
as_dirs=
while :; do
case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
@@ -2902,7 +3055,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
+printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -2964,8 +3117,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by SQLTeX $as_me 2.1, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+This file was extended by SQLTeX $as_me 3.0, which was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -3014,14 +3167,16 @@ $config_files
Report bugs to <support@oveas.com>."
_ACEOF
+ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
+ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"`
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-SQLTeX config.status 2.1
-configured by $0, generated by GNU Autoconf 2.69,
+SQLTeX config.status 3.0
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2021 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -3061,21 +3216,21 @@ do
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
+ printf "%s\n" "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
+ printf "%s\n" "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
'') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h | --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
+ printf "%s\n" "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
@@ -3103,7 +3258,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
exec "\$@"
@@ -3117,7 +3272,7 @@ exec 5>>config.log
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
- $as_echo "$ac_log"
+ printf "%s\n" "$ac_log"
} >&5
_ACEOF
@@ -3145,7 +3300,7 @@ done
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files
fi
# Have a temporary directory for convenience. Make it in the build tree
@@ -3373,7 +3528,7 @@ do
esac ||
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
done
@@ -3381,17 +3536,17 @@ do
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
`' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+printf "%s\n" "$as_me: creating $ac_file" >&6;}
fi
# Neutralize special characters interpreted by sed in replacement strings.
case $configure_input in #(
*\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
+ ac_sed_conf_input=`printf "%s\n" "$configure_input" |
sed 's/[\\\\&|]/\\\\&/g'`;; #(
*) ac_sed_conf_input=$configure_input;;
esac
@@ -3408,7 +3563,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
+printf "%s\n" X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -3432,9 +3587,9 @@ $as_echo X"$ac_file" |
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -3496,8 +3651,8 @@ ac_sed_dataroot='
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
@@ -3541,9 +3696,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
@@ -3590,7 +3745,8 @@ if test "$no_create" != yes; then
$ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
+
diff --git a/support/SQLTeX/configure.ac b/support/sqltex/configure.ac
index 057a159734..058032847b 100644
--- a/support/SQLTeX/configure.ac
+++ b/support/sqltex/configure.ac
@@ -1,5 +1,5 @@
# Autoconf configfile for SQLTeX.
-# To create a new distribuition, 3execute the following steps:
+# To create a new distribution, execute the following steps:
# aclocal
# autoconf
# automake --add-missing
@@ -16,13 +16,16 @@ AC_PREREQ([2.69])
# Ensure configure can check for the required perl modules.
m4_include([aclocal/ax_prog_perl_modules.m4])
-AC_INIT([SQLTeX], [2.1], [support@oveas.com])
+AC_INIT([SQLTeX], [3.0], [support@oveas.com])
AM_INIT_AUTOMAKE
-AX_PROG_PERL_MODULES(DBI Getopt::Long Term::ReadKey, , )
+AX_PROG_PERL_MODULES([DBI DBD::mysql Getopt::Long Term::ReadKey]
+ ,
+ ,[AC_MSG_ERROR([Not all required perl modules are installed])]
+)
-# Makefile to be generated in the subdircetories as welll
+# Makefile to be generated in the subdirectories as well
AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile man/Makefile])
AC_OUTPUT
diff --git a/support/SQLTeX/doc/Makefile.am b/support/sqltex/doc/Makefile.am
index c100c1012b..56ee693ded 100644
--- a/support/SQLTeX/doc/Makefile.am
+++ b/support/sqltex/doc/Makefile.am
@@ -13,4 +13,5 @@ SQLTeX.pdf: SQLTeX.tex
@pdflatex $^
install: SQLTeX.pdf
+ @if [ ! -d ${pdfdir} ]; then mkdir -p ${pdfdir}; fi
cp $^ ${pdfdir}
diff --git a/support/SQLTeX/doc/Makefile.in b/support/sqltex/doc/Makefile.in
index 0c4a9a76f4..f42b41992e 100644
--- a/support/SQLTeX/doc/Makefile.in
+++ b/support/sqltex/doc/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -125,11 +125,14 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
+ETAGS = @ETAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -214,8 +217,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -232,6 +235,37 @@ ctags CTAGS:
cscope cscopelist:
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
check-am: all-am
check: check-am
all-am: Makefile
@@ -358,6 +392,7 @@ SQLTeX.pdf: SQLTeX.tex
@pdflatex $^
install: SQLTeX.pdf
+ @if [ ! -d ${pdfdir} ]; then mkdir -p ${pdfdir}; fi
cp $^ ${pdfdir}
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/support/sqltex/doc/SQLTeX.pdf b/support/sqltex/doc/SQLTeX.pdf
new file mode 100644
index 0000000000..050e48021d
--- /dev/null
+++ b/support/sqltex/doc/SQLTeX.pdf
Binary files differ
diff --git a/support/SQLTeX/doc/SQLTeX.tex b/support/sqltex/doc/SQLTeX.tex
index 2361476460..d3fbc8d667 100644
--- a/support/SQLTeX/doc/SQLTeX.tex
+++ b/support/sqltex/doc/SQLTeX.tex
@@ -1,6 +1,8 @@
\documentclass{article}
\newcommand{\bs}{\ensuremath{\backslash}}
\newcommand{\vs}{\vspace{3mm}}
+\newcommand{\sqltexversion}{3.0}
+\newcommand{\sqltexvmsversion}{3\_0}
\usepackage{makeidx}
\usepackage[pdftex
,pagebackref=true
@@ -8,8 +10,8 @@
,linkcolor=blue
,unicode]{hyperref}
\begin{document}
-\title{SQL\TeX\\v2.1}
-\date{Jan 21, 2022}
+\title{SQL\TeX\ v\sqltexversion}
+\date{Sep 20, 2024}
\author{Oscar van Eijk}
\maketitle
\hrulefill
@@ -34,15 +36,17 @@ in the document.
\item The \LaTeX\ \texttt{\bs includeonly} directive is ignored; all documents included with \texttt{\bs include} will be parsed and written to the output file.
\item Currently, only 9 command- line parameters (1-9), and 10 variables (0-9) can be used in SQL statements.
\item Replace files can hold only 1,000 items.
-\item In multidocument mode, only one parameter can be retrieved.
\end{itemize}
\section{Installing SQL\TeX}
+Since v3.0, SQL\TeX\ is part of \TeX\ Live and doesn't need further installation. \\
+If you are using a different LaTeX distro, please follow the steps below for your OS.
+
Before installing SQL\TeX, you need to have it. The latest version can always be found at
\url{https://github.com/oveas/sqltex}.
The download consists of this do\-cumentation, an installation script for Unix
-(\texttt{install}), and the Perl script \texttt{SQLTeX}, and a replace- file (\texttt{SQLTeX\_r.dat}) for manual installation
+(\texttt{install}), and the Perl script \texttt{sqltex}, and a replace- file (\texttt{SQLTeX\_r.dat}) for manual installation
on non- unix platforms\footnote{on Unix, this file will be generated by the install script}.
\subsection{Requirements}
@@ -59,11 +63,15 @@ SQL\TeX\ requires the following software:
\subsection{Installation}
-To install SQL\TeX, unpack the archive in a location of your choice and follow the steps below.
+If you are using a \TeX\ Live distribution, SQL\TeX\ is already available. For all other distros, follow the steps in this section.
+
+\vs
+
+First unpack the archive in a location of your choice and continue with one if the subsections below depending on you operating system.
\subsubsection{Linux}
-Go to the top directory where the archive was unpacked (`\texttt{cd sqltex-2.1}') and execute the following commands:
+Go to the top directory where the archive was unpacked (`\texttt{cd sqltex-\sqltexversion}') and execute the following commands:
\vs
@@ -101,19 +109,20 @@ After installation, the archive and unpack- directory can be removed.
\subsubsection{Windows}
-This distribution contains an \texttt{.EXE} file that was generated using \texttt{PAR::Packer} (\url{https://metacpan.org/pod/PAR::Packer}) with Strawberry Perl (\url{https://strawberryperl.com/}).
+\noindent\hspace{-3mm}\textit{\underline{Note:}}Since v3.0, the binary \texttt{SQLTEX.EXE} for Windows is not included in the distribution anymore\footnote{ It can be generated with any (portable) perl version for Windows, like Strawberry Perl (\url{https://strawberryperl.com/}\label{winexe}), with \texttt{PAR::Packer} (\url{https://metacpan.org/pod/PAR::Packer}) using the command:\\
+\texttt{pp -o sqltex.exe sqltex}}
\vs
-The files \texttt{sqltex-2.1\ensuremath{\backslash}SQLTeX.EXE}, \texttt{sqltex-2.1\ensuremath{\backslash}src\ensuremath{\backslash}SQLTeX.cfg} and \\ \texttt{sqltex-2.1\ensuremath{\backslash}src\ensuremath{\backslash}SQLTeX\_r.dat} must be placed manually in the directory of your choice, all in the same direcrtory.
+The files \texttt{sqltex-\sqltexversion\ensuremath{\backslash}sqltex}, \texttt{sqltex-\sqltexversion\ensuremath{\backslash}src\ensuremath{\backslash}SQLTeX.cfg} and \\ \texttt{sqltex-\sqltexversion\ensuremath{\backslash}src\ensuremath{\backslash}SQLTeX\_r.dat} must be placed manually in the directory of your choice, all in the same direcrtory.
\subsubsection{OpenVMS}
On \textsc{OpenVMS} the files must be copied manually to the destination. All files must reside in the same location:\\
-\texttt{\$ COPY [.SQLTEX-2\_1.SRC]SQLTEX.PL SYS\$SYSTEM:\\
-\$ COPY [.SQLTEX-2\_1.SRC]SQLTEX.CFG SYS\$SYSTEM:\\
-\$ COPY [.SQLTEX-2\_1.SRC]SQLTEX\_R.DAT SYS\$SYSTEM:\\
+\texttt{\$ COPY [.SQLTEX-\sqltexvmsversion.SRC]SQLTEX. SYS\$SYSTEM:SQLTEX.PL\\
+\$ COPY [.SQLTEX-\sqltexvmsversion.SRC]SQLTEX.CFG SYS\$SYSTEM:\\
+\$ COPY [.SQLTEX-\sqltexvmsversion.SRC]SQLTEX\_R.DAT SYS\$SYSTEM:\\
\$ SET FILE/PROTECTION=(W:RE) SYS\$SYSTEM:SQLTEX.PL}
\vs
@@ -125,15 +134,14 @@ system wide login procedure, with the command: \\
\subsection{Configuration}\label{config}
-The configuration file \texttt{SQLTeX.cfg} is located in \texttt{/etc} (linux) or the same location where
-SQL\TeX\ is installed (all other operating systems).
+The configuration file \texttt{SQLTeX.cfg} is located in \texttt{/usr/local/etc} (linux) or the same location where SQL\TeX\ is installed (all other operating systems and in \TeX\ Live distros)\footnote{ If a 1.x version of SQL\TeX\ is installed on your system, make sure you save the configuration section, which was inline in older versions}.
Multiple configuration files can be created, the command line option \texttt{--configfile} can be used to
select the requested configuration.
\vs
-\noindent\hspace{-3mm}\textit{\underline{Note:}} If a 1.x version of SQL\TeX\ is installed on your system,
-make sure you save the configuration section, which was inline in older versions.
+\noindent\hspace{-3mm}\textit{\underline{Note:}}\label{cfg:disable} Use of the \texttt{--configfile} commandfile option can be disabled on system wide installations. To do so, the script \texttt{sqltex} must be modified.\\
+At the top of the file (line 4), set the value for \texttt{\$main::ext\_cfgfile\_allowed} to \texttt{0}.
\vs
@@ -142,12 +150,18 @@ Some values can be overwritten using command line options (see section~\ref{cmdl
\begin{description}
\item[dbdriver] Database driver. The default is \texttt{mysql}.
-Other supported databases are \texttt{Pg}, \texttt{Sybase}, \texttt{Oracle},
-\texttt{Ingres}, \texttt{mSQL} and \texttt{PostgreSQL}, but also others might
-work without modification. \\
+Other supported databases are \texttt{Pg}, \texttt{Sybase}, \texttt{Oracle}\footnote{ This requires the configuration setting \texttt{oracle\_sid}}, \texttt{Ingres}, \texttt{mSQL}, \texttt{PostgreSQL} and \texttt{ODBC}\footnote{ The actual driver can specified with the configuration setting \texttt{odbc\_driver}}, but also others might work without modification. \\
+
+\vs
+
If your database driver is not support, look for the function
\texttt{db\_connect} to add support (and please notify me :)
+\item[oracle\_sid] Oracle Site Identifier, required when the \texttt{Oracle} database driver is selected.
+
+\item[odbc\_driver] Specification of the ODBC driver. Default is ``\texttt{SQL Server}''
+
+
\item[texex] The default file extension for \LaTeX\ file. When SQL\TeX\ is called, the first
parameter should be the name of the input file. If this filename has no extension,
SQL\TeX\ looks for one with the default extension.
@@ -159,6 +173,9 @@ outputfile with the name \texttt{db-docstx.tex}.
\item[def\_out\_is\_in] By default, when no output file is specified or an output file without (relative) path is given, the output file will be generated in the current directory.\\
This behaviour changed in version 2.1. In older version, the location of the output file always was the same as the input file location. To revert to the old behaviour, set \texttt{def\_out\_is\_in} to `\texttt{1}'\footnote{ Note the pre-v2.1 implementation also contained a bug: if the output file name contained an absolute or relative path, this path was always taken as relative from the input file location. In the new implementation, \texttt{def\_out\_is\_in} is ignored if the output file name contains a path.}.
+
+\item[multi\_rfile]If the commandline option \texttt{--replacementfile} is given, by default the given replacement file will be parsed and after that the default replacement file will be parsed as well.\\
+If only the given replacement file should be parsed skipping the default file, set this value to \texttt{0}.
\item[rfile\_comment] The comment-sign used in replace files. If this is empty, comments are not allowed in
the replace files.
@@ -202,6 +219,8 @@ With the default configuration this command is ``\texttt{\bs sqluse}''.
\item[sql\_end] This string is appended to the \texttt{cmd\_prefix} to get the complete SQL\TeX\ command to end a loop context (see section~\ref{loops}).\\
With the default configuration this command is ``\texttt{\bs sqlend}''.
+\item[sqlsystem\_allowed] Set this to ``1'' to allow the use of the \texttt{\bs sqlsystem} command (see section~\ref{sqlsystem}).
+
\item[repl\_step] Replacing strings (see section~\ref{replfiles} below) is done two steps, to prevent values from being replaced twice.
This setting---followed by a three-digit integer - ``000'' to ``999''---is used in the first step and replaces values from the first column.
In the second step, values from the second column replace the temporary value. \\
@@ -214,15 +233,15 @@ Normally, this setting should never change, but if the value for \texttt{cmd\_pr
\subsection{Create replace files}\label{replfiles}
-Replace files can be used to substitute values in the output of your SQL commands with a different value. This is especially usefull when the database
+Replace files can be used to substitute values in the output of your SQL commands with a different value. This is especially useful when the database
contains characters that are special characters in \LaTeX, like the percent sign (`\%'), underscore (`\_') etc.
-When SQL\TeX\ is installed, it comes with a standard file---\texttt{SQLTeX\_r.dat}---which is located in \texttt{/etc} (linux) or the same location where
-SQL\TeX\ is installed (all other operating systems), with the following replacements:
+When SQL\TeX\ is installed, it comes with a standard file---\texttt{SQLTeX\_r.dat}---which is located in \texttt{/usr/local/etc}\footnote{ if a replace file with that name already exists, it will be stored there as \texttt{SQLTeX\_r.dat.new}} (linux) or the same location where SQL\TeX\ is installed (all other operating systems and in \TeX\ Live distros).
\vspace{3mm}
-\noindent\begin{verbatim}
+\noindent Example:
+\begin{verbatim}
$ \$
_ \_
% \%
@@ -238,8 +257,14 @@ _ \_
\vspace{3mm}
-These are all single character replacements, but you can add your own replacements that consist of a single character or a character sequence (or even regular expressions, see section~\ref{regexp}).\\
-To do so, enter a new line with the character(string) that should be replaced, followed by one or more \texttt{TAB}-character(s) (\textit{not} blanks!) and the character(string) it should be replaced with.
+These are all single character replacements, but you can add your own replacements that consist of a single character or a character sequence (or even regular expressions, see section~\ref{regexp}).
+
+\vs
+
+To do so, enter a new line with the character(string) that should be replaced, followed by one or more \texttt{TAB}-character(s) (\textit{not} blanks!) and the character(string) it should be replaced with.\\
+That last one can be empty if the input character(string) should be ignored, but the \texttt{TAB} after the input character(string) is mandatory!
+
+\vs
If the first non-blank character is a semicolon (`;'), the line is considered a comment line\footnote{ in the default configuration. See the description for \texttt{rfile\_comment} in section~\ref{config} to change of disable comment lines.}. Blank lines are ignored.
@@ -266,7 +291,7 @@ This also requires \texttt{rfile\_regexp} to be changed. Its new value has to be
\vs
Both in the default configuration and with the modification example given above, the key for regular expressions is \texttt{re(<\textit{regular expression}>)}, e.g.:\\
-\hspace{3mm}\verb+re(<p\.*?>) \paragraph*{}+ \\
+\hspace{3mm}\verb+re(<p.*?>) \paragraph*{}+ \\
will replace all HTML \texttt{<}p\texttt{>} variants (\texttt{<}p style='font-size: normal'\texttt{>}, \texttt{<}p align='center'\texttt{>} etc)
\vs
@@ -296,7 +321,7 @@ re(</h\d>) }
For SQL\TeX, you write your \LaTeX\ document just as you're used to. SQL\TeX\ provides you with
some extra commands that you can include in your file.\\
-The basic format\footnote{in this document, in all examples will be asumed the default values in the
+The basic format\footnote{in this document, in all examples will be assumed the default values in the
configuration section as described in section~\ref{config}, have not been changed} of an SQL\TeX\ command is: \\
\texttt{\bs sql\emph{cmd}[options]\{SQL statement\}}
@@ -355,7 +380,7 @@ Details about the SQL\TeX\ commands will be described in the next sections.
\vs
-Let's look at a simple example. Suppose we want to retreive all header information from the database
+Let's look at a simple example. Suppose we want to retrieve all header information from the database
for a specific invoice. The SQL statement could look something like this: \\
\texttt{SELECT $\ast$ FROM INVOICE WHERE NR = 20190062;}\\
To implement this statement in an SQL\TeX\ file, the \texttt{\bs sqlrow} command should be used (see
@@ -403,6 +428,10 @@ this order:\\
Default host is localhost, the default user is the current user.
+\vs
+
+\noindent\hspace{-3mm}\textit{\underline{Note:}} The \texttt{\bs sqldb} command cannot span multiple lines!
+
\subsubsection{Prompt for password and/or username}
If a password is omitted, SQL\TeX\ will try connect to the database without a password, unless the commandline option \texttt{--password} is given (see section \ref{cmdline}).
@@ -414,14 +443,14 @@ Forcing a user to enter a database password when SQL\TeX\ runs can be achieved b
\vs
-When different database users should be able to use the same SQL\TeX\ file, the username can also be a questionmark, forcing SQL\TeX
+When different database users should be able to use the same SQL\TeX\ file, the username can also be a question mark, forcing SQL\TeX
to prompt for a username:\\
\texttt{\bs sqldb[user=?,passwd=?]\{database\}}
\subsection{Reading a single field}\label{sqlfield}
When a single field of information is to be read from the database, the command \texttt{\textbf{\bs sqlfield}}
-is used. By default, the command in the inputfile is replaced by its result in the outputfile.\\
+is used. By default, the command in the input file is replaced by its result in the output file.\\
The SQL command is enclosed by curly braces. Square brackets can optionally be used to enter some extra options.
Currently, the only supported option is \texttt{setvar} (see section~\ref{vars}).
@@ -445,11 +474,11 @@ Therefore, the option \texttt{\textbf{[setvar=\textit{n}]}} is used, where \text
Suppose you have an invoice in \LaTeX. SQL\TeX\ is executed to retrieve the invoice header information
from the database for a specific customer. Next, the invoice lines are read from the database.
-You could pass the invoice number as a paramater to SQL\TeX\ for use in your queries, but that could
+You could pass the invoice number as a parameter to SQL\TeX\ for use in your queries, but that could
change every month. It is easier to :\\
\begin{itemize}
\item pass the customer number as a parameter,
-\item retrieve the current date (asuming that is the invoice date as stored in
+\item retrieve the current date (assuming that is the invoice date as stored in
the database by another program), and store it in a variable: \\
\texttt{\bs sqlfield[setvar=0]\{SELECT DATE\_FORMAT(NOW(), "\%Y-\%m-\%d")\}} \\
This creates a variable that can be used as \texttt{\$VAR0},
@@ -471,7 +500,7 @@ The SQL queries used here do not display any output in your \LaTeX\ document.
When an SQL query returns more information than one single field, the SQL\TeX\
command \texttt{\textbf{\bs sqlrow}} should be used. As with the \texttt{\bs sqlfield},
command, SQL\TeX\ replaces the command with the values it returns, but \texttt{\bs sqlrow}
-accepts different options for formating the output.
+accepts different options for formatting the output.
\vs
@@ -479,8 +508,8 @@ By default, fields are separated by a comma and a blank (`\texttt{,~}'), and row
a newline character (`\texttt{\bs\bs}'). To change this, the options ``\texttt{fldsep}''
and ``\texttt{rowsep}'' can be used.
-e.g. In a \texttt{tabular} enviroment the fields should be seperated by an amphesand (\texttt{\&}),
-perhaps a line should seperate the rows of information. (\texttt{\bs\bs~\bs hline}).
+e.g. In a \texttt{tabular} environment the fields should be separated by an ampersand (\texttt{\&}),
+perhaps a line should separate the rows of information. (\texttt{\bs\bs~\bs hline}).
To do this, the options can be used with \texttt{\bs sqlrow} as shown here: \\
\texttt{\bs sqlrow[fldsep=\&,rowsep=\bs\bs~\bs hline]\{SELECT I.NR, A.NR,
A.PRICE, I.AMOUNT, (A.PRICE * I.AMOUNT) FROM ARTICLE A, INVOICE\_LINE I WHERE I.NR = \$VAR1
@@ -494,9 +523,9 @@ This will produce an output like: \\
3 \& 4363 \& 1.95 \& 10 \& 19.5 \bs\bs~\bs hline
4 \& 8375 \& 12.5 \& 2 \& 25 \bs\bs~\bs hline}
-\subsubsection{Output rows on seperate lines}
+\subsubsection{Output rows on separate lines}
-Some \LaTeX\ packages require input on a seperate line. If this output is to be
+Some \LaTeX\ packages require input on a separate line. If this output is to be
read from a database, this can be set with the \texttt{rowsep} option using the
fixed text ``\texttt{NEWLINE}''.
@@ -507,7 +536,7 @@ AND I.ARTICLE\_NR = A.NR\}}
\vs
-would procude the following result: \\
+would produce the following result: \\
\texttt{1 \& 9712 \& 12 \& 1 \& 12 \bs\bs~\bs hline \\
2 \& 4768 \& 9.75 \& 3 \& 29.25 \bs\bs~\bs hline \\
3 \& 4363 \& 1.95 \& 10 \& 19.5 \bs\bs~\bs hline \\
@@ -526,13 +555,13 @@ Therefore, the option \texttt{\textbf{[setarr=\textit{n}]}} is used, where \text
\subsection{Loop context}\label{loops}
In a loop context, an array is filled with data from the database using \texttt{\bs sqlrow}.\\
-Later in the document, the data can be used in a textblock that will be written to the outputfile once for every record retrieved.
+Later in the document, the data can be used in a text block that will be written to the output file once for every record retrieved.
\vs
-The textblock is between the \texttt{\bs sqlstart\{\textit{n}\}} and \texttt{\bs sqlend\{\textit{n}\}} commands, where \textit{n} is the sequence number of the array to use\footnote{ in \texttt{\bs sqlend}, the sequence number is ignored, but required by syntax.}.
+The text block is between the \texttt{\bs sqlstart\{\textit{n}\}} and \texttt{\bs sqlend\{\textit{n}\}} commands, where \textit{n} is the sequence number of the array to use\footnote{ in \texttt{\bs sqlend}, the sequence number is ignored, but required by syntax.}.
-Multiple textblocks can occur in the document, but they can \textit{not} be nested!
+Multiple text blocks can occur in the document, but they can \textit{not} be nested!
\vs
@@ -549,8 +578,8 @@ In the example below, data for unpaid invoices is stored in an array identified
\vs
-To use this data, a textblock must start with: \texttt{\bs sqlstart\{0\}}\\
-Between this command and the first occurrence of \texttt{\bs sqlend\{\}}, an unlimited amount\footnote{ limited by your computer's memory only} of \LaTeX\ text can be written. Within this text, every occurence of \texttt{\bs sqluse\{<\textit{field name}>\}} will be replaced with the matching field from the current row, e.g.:
+To use this data, a text block must start with: \texttt{\bs sqlstart\{0\}}\\
+Between this command and the first occurrence of \texttt{\bs sqlend\{\}}, an unlimited amount\footnote{ limited by your computer's memory only} of \LaTeX\ text can be written. Within this text, every occurrence of \texttt{\bs sqluse\{<\textit{field name}>\}} will be replaced with the matching field from the current row, e.g.:
\noindent\begin{verbatim}
\sqlstart{0}
@@ -570,21 +599,84 @@ as soon as possible.
\sqlend{}
\end{verbatim}
+\subsubsection{If-endif control block}
+
+In the loop context, parts of the document can be enabled if certain conditions are met, using a control block with \texttt{\bs sqlif\{\textit{condition(s)}\}} and \texttt{\bs sqlendif\{\}}.
+
+\vs
+
+\textit{Conditions} can be up to 2 conditions separated by an \textit{and} (\texttt{\&\&}) or \textit{or} (\texttt{||}).
+
+The condition(s) consist of an left value and an right value seperated by 1 of the following comparisson operators: `\texttt{==}', `\texttt{!=}', `\texttt{<}',. `\texttt{>}', `\texttt{<=}' or `\texttt{>=}'.\\
+Numeric values will be used as is. When the value is text, it is expected to be the name of a field and `\texttt{\bs sqluse\{\}}` will be called to retrieve the value.
+\vs
+
+\noindent Example:\\
+\texttt{\bs sqlif\{article\_nr == 123 \&\& \bs stock < 5\}\\
+Stock is below threshold, please reorder.
+}\\
+\bs sqlendif\{\}
+
+\vs
+
+Note the conditions are very basic with the following limitations:
+\begin{itemize}
+\item A maximum of 2 conditions is supported per if-statement.
+\item Only numeric comparissons are supported.
+\item If-elsif blocks cannot be nested.
+\end{itemize}
+
+When checks are needed that are not supported by SQL\TeX, a workaround can be implemented in the SQL code.
+
+
+\subsection{Get input from external programs}\label{sqlsystem}
+
+The \texttt{\bs sqlsystem} command can be used to call commands at the operating system or external scripts and use their output in the location where the command was given. Any command arguments can be given in the command line.
+
+When used in a loop context (see section~\ref{loops}), \texttt{\bs sqluse} can also be used to provide data to the script. If command arguments must be given for database access, the following tags can be used:
+
+\begin{itemize}
+\item[\texttt{<SRV>}] Name of the database server.
+\item[\texttt{<USR>}] Username to connect to the database.
+\item[\texttt{<PWD>}] Password to connect to the database.
+\item[\texttt{<DB>}] Name of the database.
+\end{itemize}
+
+They will be replaced by the credentials for connecting to the database (see section~\ref{opendb}).
+
+
+\vs
+
+\noindent Example:\\
+\texttt{\bs sqlsystem\{./add\_vat --usr <USR> --db <DB> --pwd <PWD> $\hookleftarrow$ \\
+--inv \bs sqluse\{invoice\_nr\}\}}
+
+\vs
+
+By default, use of this command is disallowed. To enable it, set the value of \texttt{sqlsystem\_allowed} to ``1'' in the configuration file (see also section~\ref{config}.
+
+If the command is disabled, occurances of this command will be replaced by the fixed text ``\texttt{use of the \bs sqlsystem command is disallowed in the configuration}''.
+
+\vs
+
+\noindent\hspace{-3mm}\textit{\underline{Note:}} The \texttt{\bs sqlsystem} command cannot span multiple lines!
+
\subsection{Output multiple documents}\label{multidoc}
A single input file can be created to generate more output files using the \texttt{--multidoc-numbered} or \texttt{--multidoc-named} commandline option.
-The input document must contain the command \texttt{\bs sqlsetparams} without any options. The query that follows can return an unlimited number of rows all containing exactly 1 field: \\
-\texttt{\bs sqlsetparams\{SELECT NR FROM INVOICES WHERE PAY\_DATE = NULL\}}
+The input document must contain the command \texttt{\bs sqlsetparams} without any options. The query that follows can return an unlimited number of rows: \\
+\texttt{\bs sqlsetparams\{SELECT NR, CUST\_NR FROM INVOICES WHERE REMINDERS = \$PAR1\}}
\vs
By processing this command, SQL\TeX\ builds a list with all values retrieved and
-processes the input file again for each value.\\
+processes the input file again for each row.\\
In those runs, the queries are executed as described in the previous sections,
-using the value as a parameter:\\
-\texttt{\bs sqlrow\{SELECT * FROM INVOICES WHERE NR = \$PAR1\}}
+using the returned fields to replace \texttt{\$MPAR\textit{n}} placeholders, where \textit{n} starts with 1 and represents the fields in the order as they have been retrieved:\\
+\texttt{\bs sqlrow\{SELECT * FROM INVOICES WHERE NR = \$MPAR1\}} \\
+\texttt{\bs sqlrow\{SELECT * FROM CUSTOMER WHERE CUST\_NR = \$MPAR2\}}
\vs
@@ -595,9 +687,10 @@ document will be created, ignoring the \texttt{\bs sqlsetparams} command.
\vs
With the \texttt{--multidoc-numbered} option, output filenames will be numbered \texttt{\emph{filename}\_1.tex} to \texttt{\emph{filename}\_\emph{n}.tex}.\\
-With the \texttt{--multidoc-named} option, output filenames will be numbered \texttt{\emph{filename}\_\emph{parameter}.tex}, where \emph{parameter} is the value taken from the database (the incoie number \texttt{nr} in the example above). \\
+With the \texttt{--multidoc-named} option, output filenames will be numbered \\\texttt{\emph{filename}\_\emph{parameter}.tex}, where \emph{parameter} is the first value taken from the database (\texttt{\$MPAR1}, the invoice number \texttt{nr} in the example above). \\
Note the parameter will not be formatted to be filename-friendly!\\
+
\subsection{Update database records}
Since version 1.5, SQL\TeX\ supports database updates as well: \\
@@ -608,7 +701,7 @@ This command accepts no options.
\vs
-By default, the update statements will be ignored. The actually process them, the commandline options \texttt{--updates} must be given!
+By default, the update statements will be ignored. To actually process them, the commandline options \texttt{--updates} must be given!
\section{Process your SQL\TeX\ file}
@@ -635,8 +728,7 @@ parameter `0' cannot be used, since that contains the filename!}, it is replaced
SQL\TeX\ accepts the following command- line options:
\begin{description}
-\item[\texttt{--configfile \textit{file}, -c \textit{file}}] SQL\TeX\ configuration file. Default is \texttt{SQLTeX.cfg}
-in the same location where SQL\TeX\ is installed.
+\item[\texttt{--configfile \textit{file}, -c \textit{file}}] SQL\TeX\ configuration file. Default is \texttt{SQLTeX.cfg} in the systems default location (see section \ref{config}).
\item[\texttt{--file-extension \textit{string}, -E \textit{string}}] replace input file extension in outputfile:
\texttt{input.tex} will be \texttt{input.\textit{string}}. \\
@@ -655,7 +747,7 @@ In \textit{string}, the values between curly braces \{\} will be substituted:
\item[T] current time (\textit{hhmmss})
\end{description}
e.g., the command\\
-\hspace*{1em}\texttt{SQLTeX --filename-extend \_\{P1\}\_\{W\} my\_file code}\\
+\hspace*{1em}\texttt{sqltex --filename-extend \_\{P1\}\_\{W\} my\_file code}\\
will read `\texttt{my\_file.tex}' and write `\texttt{myfile\_code\_Tue.tex}'.\\
The same command, but with option \texttt{---file-extension} would create the outputfile \texttt{my\_file.\_code\_Tue}\\
The options \texttt{--file-extension} and \texttt{--filename-extend} cannot be used together or with \texttt{--output}.
@@ -676,22 +768,26 @@ query returns an empty set.
\item[\texttt{--output \textit{file}, -o \textit{file}}] specify an output file. Cannot be used with \texttt{--file-extension},
\texttt{--filename-extend} or the \texttt{--multidoc} options.
+\item[\texttt{--skip-empty-lines, -S}] All SQL\TeX\ commands will be removed from the input line or replaced by the corresponding value. The rest of the input line is written to the output file.
+This includes lines that only contain a SQL\TeX\ command (and a newline character). This will result in an empty line in the output file.\\
+By specifying this option, these empty lines will be skipped. Lines that were empty in the input will be written.
+
+\item[\texttt{--write-comments, -C}] \LaTeX\ comments in the input file will be skipped by default. With this option, comments will also be copied to the output file.
+
\item[\texttt{--prefix \textit{prefix}, -p \textit{prefix}}] prefix used in the SQL\TeX\ file. Default is \texttt{sql} (see also section~\ref{config}
on page~\pageref{prefix}. This overwrites the configurarion setting \texttt{cmd\_prefix}.
-\item[\texttt{--password \textit{[password]}, -P} \textit{[password]}] database password. The value is optional; if omitted, SQL\TeX\ will prompt for a password. This overwrites the password in the input file.\\
+\item[\texttt{--password \textit{[password]}, -P} \textit{[password]}] database password. The value is optional; if omitted, SQL\TeX\ will prompt for a password. This overwrites the password in the input file.
\item[\texttt{--quiet, -q}] run in quiet mode.
\item[\texttt{--replacementfile \textit{replace}, -r \textit{replace}}] Specify a file that contains the replace characters (see section~\ref{replfiles}). \\
-Default is \texttt{SQLTeX{\_}r.dat} in the same location where SQL\TeX\ is installed.
+Default is \texttt{SQLTeX{\_}r.dat} in the systems default location (see section \ref{replfiles}). This default file will always be used after the given replacement file, unless \texttt{multi\_rfile} is set to \texttt{0} in the configuration (see secion \ref{config}).
\item[\texttt{--no-replacementfile, -R}] Do not use a replace file. \texttt{--no-replacementfile} and \texttt{--replacementfile \textit{file}} are handled in the same order as
they appear on the command line, overwriting each other.\\
For backwards compatibility, \texttt{-rn} is also still supported.
-\item[\texttt{--use-local-config, -l}] Use the current installation directory as default location for the config- and replacement files in stead of \texttt{/etc}\footnote{ linux only}.
-
\item[\texttt{--sqlserver \textit{server}, -s \textit{server}}] SQL server to connect to. Default is \texttt{localhost}.
\item[\texttt{--updates, -u}] if the input file contains updates, process them.
@@ -810,7 +906,7 @@ Otherwise, SQL\TeX\ exits. \\
\vspace{1mm}
\noindent In multidocument mode, the lis of parameters retrieved on line
-\textit{line nr} returned more than one fiels per row. \\
+\textit{line nr} returned more than one fields per row. \\
\textit{Action:} Check your query.
\vs
@@ -860,7 +956,7 @@ For bugs, questions and comments, please use the issue tracker available at \url
\vspace{3mm}
-\noindent Copyright\copyright\ 2001-2022 - Oscar van Eijk, Oveas Functionality Provider
+\noindent Copyright\copyright\ 2001-2024 - Oscar van Eijk, Oveas Functionality Provider
\noindent\hrulefill \\
@@ -870,6 +966,28 @@ see \url{http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html}.
\section{History}
\begin{description}
+\item[v3.0] \textit{released: Sep 20, 2024}
+\begin{itemize}
+\item Made it possible to run SQL\TeX\ directly from the distribution without \texttt{configure} and \texttt{make [install]} to make integration in \TeX\ Live possible.
+\item Renamed the script to \texttt{sqltex}. For backwards compatibility, during installation on linux a symbolic link \texttt{SQLTeX} is created.
+\item The \texttt{SQLTeX.exe} binary is no longer included in the distribution (see footnote \footref{winexe} on page \pageref{winexe}).
+\item Removed support for the \texttt{--use-local-config} commandline option. The options \texttt{--configfile} and \texttt{--replacementfile} can be used instead.
+\item Added an option to disable the \texttt{--configfile} command line option (see note on page \pageref{cfg:disable}).
+\item Added the \texttt{--skip-empty-lines} and \texttt{--write-comments} commandline options.
+\item Added support for multiple replacement files.
+\item Fix: ordering in the replacement file.
+\end{itemize}
+
+\item[v2.2] \textit{released: Jul 31, 2024}
+\begin{itemize}
+\item Extended the default replace file (see \ref{replfiles}) with more special characters (e.g. with diacritics) and HTML tags.
+\item Issue \#6 (\url{https://github.com/oveas/sqltex/issues/6}): added support for ODBC drivers
+\item Issue \#8 (\url{https://github.com/oveas/sqltex/issues/8}): added support for parameter-driven in \texttt{\bs sqlsetparams} statements (multi-document mode).\\
+\textit{\textbf{Note:}} This requires an update of your input files for multi-document mode that have been created before v2.2. Refer to section \ref{mdocupdates} for details.
+\item Added the \texttt{\bs sqlsystem} command.
+\item Added the \texttt{\bs sqlif}-\texttt{\bs sqlendif} control block.
+\end{itemize}
+
\item[v2.1] \textit{released: Jan 21, 2022}
\begin{itemize}
\item Fix bug \#2 (\url{https://github.com/oveas/sqltex/issues/2}): standard path management for output files.\\
@@ -886,7 +1004,6 @@ See config item \texttt{def\_out\_is\_in} in section \ref{config} to revert to p
\item Added option \texttt{--use-local-config}.
\end{itemize}
-
\item[v2.0] \textit{released: Jan 12, 2016}
\begin{itemize}
\item Fix: Oracle support using ORASID
@@ -918,4 +1035,16 @@ First public release
\end{description}
+\subsection{Changes that require updates in your input files}
+
+\subsubsection{Multi-document mode since v2.2}\label{mdocupdates}
+
+Up until v2.1, the statement in \texttt{\bs sqlsetparams} could return only one field per row and the statement itself could not handle parameters. The placeholder \texttt{\$PAR1} was reserved for the subsequent statements.
+
+Since v2.2 it is possible to retrieve multiple values per row. They will replace the placeholders \texttt{\$MPAR\textit{n}} in the subsequent statements, while \texttt{\$PAR\textit{n}} placeholders can now also be used for regular parametes in the \texttt{\bs sqlsetparams} statement itself.
+
+\vs
+
+This means, in input documents created before v2.2, all ``\texttt{\$PAR1}'' placeholders must be replaced by ``\texttt{\$MPAR1}''.
+
\end{document}
diff --git a/support/SQLTeX/install-sh b/support/sqltex/install-sh
index 59990a1049..ec298b5374 100755
--- a/support/SQLTeX/install-sh
+++ b/support/sqltex/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2014-09-12.12; # UTC
+scriptversion=2020-11-14.01; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -69,6 +69,11 @@ posix_mkdir=
# Desired mode of installed file.
mode=0755
+# Create dirs (including intermediate dirs) using mode 755.
+# This is like GNU 'install' as of coreutils 8.32 (2020).
+mkdir_umask=22
+
+backupsuffix=
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
@@ -99,18 +104,28 @@ Options:
--version display version info and exit.
-c (ignored)
- -C install only if different (preserve the last data modification time)
+ -C install only if different (preserve data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
+ -p pass -p to $cpprog.
-s $stripprog installed files.
+ -S SUFFIX attempt to back up existing files, with suffix SUFFIX.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
+
+By default, rm is invoked with -f; when overridden with RMPROG,
+it's up to you to specify -f if you want it.
+
+If -S is not specified, no backups are attempted.
+
+Email bug reports to bug-automake@gnu.org.
+Automake home page: https://www.gnu.org/software/automake/
"
while test $# -ne 0; do
@@ -137,8 +152,13 @@ while test $# -ne 0; do
-o) chowncmd="$chownprog $2"
shift;;
+ -p) cpprog="$cpprog -p";;
+
-s) stripcmd=$stripprog;;
+ -S) backupsuffix="$2"
+ shift;;
+
-t)
is_target_a_directory=always
dst_arg=$2
@@ -255,6 +275,10 @@ do
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
+ # Don't chown directories that already exist.
+ if test $dstdir_status = 0; then
+ chowncmd=""
+ fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@@ -271,15 +295,18 @@ do
fi
dst=$dst_arg
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
+ # If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
- dst=$dstdir/`basename "$src"`
+ dstbase=`basename "$src"`
+ case $dst in
+ */) dst=$dst$dstbase;;
+ *) dst=$dst/$dstbase;;
+ esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
@@ -288,27 +315,16 @@ do
fi
fi
+ case $dstdir in
+ */) dstdirslash=$dstdir;;
+ *) dstdirslash=$dstdir/;;
+ esac
+
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
@@ -318,50 +334,49 @@ do
fi
posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- # $RANDOM is not portable (e.g. dash); use it when possible to
- # lower collision chance
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- # As "mkdir -p" follows symlinks and we work in /tmp possibly; so
- # create the $tmpdir first (and fail if unsuccessful) to make sure
- # that nobody tries to guess the $tmpdir name.
- if (umask $mkdir_umask &&
- $mkdirprog $mkdir_mode "$tmpdir" &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- test_tmpdir="$tmpdir/a"
- ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
- fi
- trap '' 0;;
- esac;;
+ # The $RANDOM variable is not portable (e.g., dash). Use it
+ # here however when possible just to lower collision chance.
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
+ trap '
+ ret=$?
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
+ exit $ret
+ ' 0
+
+ # Because "mkdir -p" follows existing symlinks and we likely work
+ # directly in world-writeable /tmp, make sure that the '$tmpdir'
+ # directory is successfully created first before we actually test
+ # 'mkdir -p'.
+ if (umask $mkdir_umask &&
+ $mkdirprog $mkdir_mode "$tmpdir" &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ test_tmpdir="$tmpdir/a"
+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+ fi
+ trap '' 0;;
esac
if
@@ -372,7 +387,7 @@ do
then :
else
- # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
@@ -401,7 +416,7 @@ do
prefixes=
else
if $posix_mkdir; then
- (umask=$mkdir_umask &&
+ (umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
@@ -434,14 +449,25 @@ do
else
# Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
+ dsttmp=${dstdirslash}_inst.$$_
+ rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+ (umask $cp_umask &&
+ { test -z "$stripcmd" || {
+ # Create $dsttmp read-write so that cp doesn't create it read-only,
+ # which would cause strip to fail.
+ if test -z "$doit"; then
+ : >"$dsttmp" # No need to fork-exec 'touch'.
+ else
+ $doit touch "$dsttmp"
+ fi
+ }
+ } &&
+ $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@@ -467,6 +493,13 @@ do
then
rm -f "$dsttmp"
else
+ # If $backupsuffix is set, and the file being installed
+ # already exists, attempt a backup. Don't worry if it fails,
+ # e.g., if mv doesn't support -f.
+ if test -n "$backupsuffix" && test -f "$dst"; then
+ $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
+ fi
+
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
@@ -481,9 +514,9 @@ do
# file should still install successfully.
{
test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
+ $doit $rmcmd "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
@@ -500,9 +533,9 @@ do
done
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/support/sqltex/man/Makefile.am b/support/sqltex/man/Makefile.am
new file mode 100644
index 0000000000..59b7d84ee5
--- /dev/null
+++ b/support/sqltex/man/Makefile.am
@@ -0,0 +1,16 @@
+# Automake makefile for the linux manpage
+
+.PHONY: all distdir
+DISTFILES = Makefile.am Makefile.in sqltex.man
+
+all :
+
+sqltex.1 : sqltex.man
+ @cat $^ | sed -e 's#{BINDIR}#$(bindir)#;s#{SYSCONFDIR}#$(sysconfdir)#' > $@
+
+distdir : ${DISTFILES}
+ cp ${DISTFILES} $(distdir)
+
+install: sqltex.1
+ @if [ ! -d ${mandir} ]; then mkdir -p ${mandir}; fi
+ cp $^ ${mandir}/man1
diff --git a/support/SQLTeX/man/Makefile.in b/support/sqltex/man/Makefile.in
index 530e2bda19..d6cdd78baf 100644
--- a/support/SQLTeX/man/Makefile.in
+++ b/support/sqltex/man/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -125,11 +125,14 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
+ETAGS = @ETAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -193,7 +196,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-DISTFILES = Makefile.am Makefile.in SQLTeX.man
+DISTFILES = Makefile.am Makefile.in sqltex.man
all: all-am
.SUFFIXES:
@@ -214,8 +217,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -232,6 +235,37 @@ ctags CTAGS:
cscope cscopelist:
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
check-am: all-am
check: check-am
all-am: Makefile
@@ -351,13 +385,14 @@ uninstall-am:
all :
-SQLTeX.1 : SQLTeX.man
- cat $^ | sed -e 's#{BINDIR}#$(bindir)#;s#{SYSCONFDIR}#$(sysconfdir)#' > $@
+sqltex.1 : sqltex.man
+ @cat $^ | sed -e 's#{BINDIR}#$(bindir)#;s#{SYSCONFDIR}#$(sysconfdir)#' > $@
distdir : ${DISTFILES}
cp ${DISTFILES} $(distdir)
-install: SQLTeX.1
+install: sqltex.1
+ @if [ ! -d ${mandir} ]; then mkdir -p ${mandir}; fi
cp $^ ${mandir}/man1
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/support/SQLTeX/man/SQLTeX.man b/support/sqltex/man/sqltex.man
index d685815e7a..8b2915fe77 100644
--- a/support/SQLTeX/man/SQLTeX.man
+++ b/support/sqltex/man/sqltex.man
@@ -5,7 +5,7 @@
- a preprocessor to enable the use of SQL statements in LaTeX documents.
.SH SYNOPSIS
-.B SQLTeX
+.B sqltex
.RB <INPUT-FILE>
.RB [PARAMETERS]
.RB [OPTIONS]
@@ -37,7 +37,7 @@ These parameters are taken from the commandline.
.SH OPTIONS
.IP "\fB-c|--configfile\fP <file>"
-SQLTeX configuration file.
+SQLTeX configuration file. This option might be disallowed by your systems administrator.
.IP "\fB-E|--file-extension\fP <string>"
Replace input file extension in outputfile: 'input.tex' will be 'input.string'.
@@ -93,6 +93,14 @@ Same as -m, but with the parameter in the filename i.s.o. a serial number
.IP "\fB-o|--output\fP <file>"
Specify an output file. Cannot be used with '--file-extension', '--filename-extend' or the '--multidoc' options.
+.IP "\fB-S|--skip-empty-lines"
+All SQLTeX commands will be removed from the input line or replaced by the corresponding value. The rest of the input line is written to the output file.
+This includes lines that only contain a SQLTeX command (and a newline character). This will result in an empty line in the output file.
+By specifying this option, these empty lines will be skipped. Lines that were empty in the input will be written.
+
+.IP "-C|--write-comments"
+LaTeX comments in the input file will be skipped by default. With this option, comments will also be copied to the output file.
+
.IP "\fB-p|--prefix\fP <prefix>"
Prefix used in the SQLTeX file. Default is 'sql' (see documentation)
@@ -100,14 +108,11 @@ Prefix used in the SQLTeX file. Default is 'sql' (see documentation)
Run in quiet mode
.IP "\fB-r|--replacementfile\fP <file>"
-Specify a file that contains replace characters. This is a list with two tab- seperated fields per line. The first field holds a string that will be replaced in the SQL output by the second string.
+Specify a file that contains replace characters. This is a list with two tab-separated fields per line. The first field holds a string that will be replaced in the SQL output by the second string.
.IP "\fB-R|-rn|--no-replacementfile\fP"
Do not use a replace file. '--replacementfile' '--no-replacementfile' are handled in the same order as they appear on the command line.
-.IP "\fB-l|--use-local-config\fP"
-Use the current installation directory as default location for the config- and replacement files in stead of '{SYSCONFDIR}' (linux only).
-
.IP "\fB-s|--sqlserver\fP <server>"
SQL server to connect to. Default is \'localhost\'
@@ -118,21 +123,24 @@ If the input file contains updates, execute them.
.TP
.I
{SYSCONFDIR}/SQLTeX_r.dat
+Default replacement file. If your installation is part of TEX Live the file will redisde in the same directory as the sqltex executable
.TP
.I
{SYSCONFDIR}/SQLTeX.cfg
+Default configuration file. If your installation is part of TEX Live the file will redisde in the same directory as the sqltex executable
.TP
.I
-{BINDIR}/SQLTeX
+{BINDIR}/sqltex
+The sqltex executable. The location might differ depending on your installation type, e.g. as part if the TEX Live distribution.
.SH EXAMPLES
.TP
-.BI SQLTeX\ --filename-extend\ _{P1}_{W}\ my_file\ code
+.BI sqltex\ --filename-extend\ _{P1}_{W}\ my_file\ code
.TP
Read input file 'my_file.tex' and generate 'myfile_code_Tue.tex' with the processed results.
.TP
-.BI SQLTeX\ --file-extension\ _{P1}_{W}\ my_file\ code
+.BI sqltex\ --file-extension\ _{P1}_{W}\ my_file\ code
.TP
Read input file 'my_file.tex' and generate 'myfile._code_Tue' with the processed results.
@@ -149,6 +157,8 @@ SQLTeX ended with an error, check the last message.
.SH COPYRIGHT
.PP
-Copyright 2001-2022 Oscar van Eijk, Oveas Functionality Provider. All rights reserved
+Copyright 2001-2024 Oscar van Eijk, Oveas Functionality Provider.
https://oveas.com
+This software is subject to the terms of the LaTeX Project Public License; see http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
+
diff --git a/support/SQLTeX/missing b/support/sqltex/missing
index f62bbae306..1fe1611f18 100755
--- a/support/SQLTeX/missing
+++ b/support/sqltex/missing
@@ -1,9 +1,9 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2013-10-28.13; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2013-10-28.13; # UTC
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -101,9 +101,9 @@ else
exit $st
fi
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
program_details ()
{
@@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
exit $st
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/support/sqltex/src/Makefile.am b/support/sqltex/src/Makefile.am
new file mode 100644
index 0000000000..bcf72fe6a1
--- /dev/null
+++ b/support/sqltex/src/Makefile.am
@@ -0,0 +1,30 @@
+# Automake makefile for the SQLTeX code and configfiles
+
+.PHONY: distdir
+DATAFILES = SQLTeX_r.dat SQLTeX.cfg
+DISTFILES = Makefile.am Makefile.in sqltex ${DATAFILES}
+
+PL=$(shell which perl)
+
+all : sqltex.pl
+
+distdir : ${DISTFILES}
+ cp $(DISTFILES) $(distdir)
+
+sqltex.pl: sqltex
+ cat $^ | sed -e 's#!/usr/bin/env perl#!$(PL)#;s#/usr/local/etc#$(sysconfdir)#' > $@
+ @chmod +x $@
+
+install : sqltex.pl ${DATAFILES}
+ @if [ ! -d ${bindir} ]; then mkdir -p ${bindir}; fi
+ @if [ ! -d ${sysconfdir} ]; then mkdir -p ${sysconfdir}; fi
+ @if [ -f $(bindir)/SQLTeX ]; then rm $(bindir)/SQLTeX; fi
+ cp $< $(bindir)/sqltex
+ ln -s $(bindir)/sqltex $(bindir)/SQLTeX
+ @$(foreach datafile, $(DATAFILES), \
+ if [ -e $(sysconfdir)/$(datafile) ]; \
+ then echo 'cp $(datafile) $(sysconfdir)/$(datafile).new'; \
+ cp $(datafile) $(sysconfdir)/$(datafile).new; \
+ else echo 'cp $(datafile) $(sysconfdir)/$(datafile)'; \
+ cp $(datafile) $(sysconfdir)/$(datafile); \
+ fi;)
diff --git a/support/SQLTeX/src/Makefile.in b/support/sqltex/src/Makefile.in
index 234100000c..588ef0464d 100644
--- a/support/SQLTeX/src/Makefile.in
+++ b/support/sqltex/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -125,11 +125,14 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
+ETAGS = @ETAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -194,7 +197,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
DATAFILES = SQLTeX_r.dat SQLTeX.cfg
-DISTFILES = Makefile.am Makefile.in SQLTeX.pl ${DATAFILES}
+DISTFILES = Makefile.am Makefile.in sqltex ${DATAFILES}
PL = $(shell which perl)
all: all-am
@@ -216,8 +219,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -234,6 +237,37 @@ ctags CTAGS:
cscope cscopelist:
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
check-am: all-am
check: check-am
all-am: Makefile
@@ -351,18 +385,28 @@ uninstall-am:
.PHONY: distdir
-all : SQLTeX
+all : sqltex.pl
distdir : ${DISTFILES}
cp $(DISTFILES) $(distdir)
-SQLTeX: SQLTeX.pl
- cat $^ | sed -e 's#{PERLDIR}#!$(PL)#;s#{SYSCONFDIR}#$(sysconfdir)#' > $@
+sqltex.pl: sqltex
+ cat $^ | sed -e 's#!/usr/bin/env perl#!$(PL)#;s#/usr/local/etc#$(sysconfdir)#' > $@
@chmod +x $@
-install : SQLTeX ${DATAFILES}
- @cp $< $(bindir)
- @cp $(DATAFILES) $(sysconfdir)
+install : sqltex.pl ${DATAFILES}
+ @if [ ! -d ${bindir} ]; then mkdir -p ${bindir}; fi
+ @if [ ! -d ${sysconfdir} ]; then mkdir -p ${sysconfdir}; fi
+ @if [ -f $(bindir)/SQLTeX ]; then rm $(bindir)/SQLTeX; fi
+ cp $< $(bindir)/sqltex
+ ln -s $(bindir)/sqltex $(bindir)/SQLTeX
+ @$(foreach datafile, $(DATAFILES), \
+ if [ -e $(sysconfdir)/$(datafile) ]; \
+ then echo 'cp $(datafile) $(sysconfdir)/$(datafile).new'; \
+ cp $(datafile) $(sysconfdir)/$(datafile).new; \
+ else echo 'cp $(datafile) $(sysconfdir)/$(datafile)'; \
+ cp $(datafile) $(sysconfdir)/$(datafile); \
+ fi;)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/support/SQLTeX/src/SQLTeX.cfg b/support/sqltex/src/SQLTeX.cfg
index 0ba20c4ff5..db6c507c2b 100644
--- a/support/SQLTeX/src/SQLTeX.cfg
+++ b/support/sqltex/src/SQLTeX.cfg
@@ -1,7 +1,11 @@
-# Pg, Sybase, Oracle, Ingres, mSQL, ...
+# Pg, Sybase, Oracle, Ingres, mSQL, ODBC,...
#
dbdriver = mysql
+# Driver for ODBC, ignored for other databases
+#
+odbc_driver = SQL Server
+
# SID for Oracle users, ignored for other databases
#
oracle_sid = ORASID
@@ -22,6 +26,13 @@ stx = _stx
#
def_out_is_in = 0
+# If the commandline option --replacementfile or -r is given, by default the given replacement file
+# will be parsed and after that the default replacement file will be parsed as well.
+# If only the given replacement file should be parsed skipping the default file, set the value
+# below to 0.
+#
+multi_rfile = 1
+
# Comment-sign used in the replace file(s). Leave empty to disable comments
#
rfile_comment = ;
@@ -33,7 +44,7 @@ rfile_comment = ;
rfile_regexploc = ...
rfile_regexp = re(...)
-# Commend section. All SQLTeX commands start with <cmd_prefix> and are followed
+# Command section. All SQLTeX commands start with <cmd_prefix> and are followed
# by the actual command. Change this only if latex commands are used that conflict
# with the defaults.
#
@@ -46,11 +57,25 @@ sql_update = update
sql_start = start
sql_end = end
sql_use = use
+sql_system = system
+sql_if = if
+sql_endif = endif
+
+# Defines if the \sqlsystem{} command is allowed.
+# This is disabled by default, enable only if you are sure no SQLTeX files can be called that
+# might harm your system
+#
+sqlsystem_allowed = 0
-# Are the commands 'less' and/or 'ore' available on this system ?
+# If the Term::ReadKey perl module is not installed, it is not possible to enter a password
+# and hide it from the console when. In that case SQLTeX will abort if a password is specified
+# as '?' in the LaTeX input file.
+# To allow entering passwords that are readable from at the console, set the following to 1.
+# NOTE: If you need to set this value to 1, you're strongly adviced to install the Term::ReadKey
+# module instead:
+# sudo cpan install Term::ReadKey
#
-less_av = 1
-more_av = 1
+allow_readable_pwd = 0
# The values below are used internally only. There's no need to change these,
# unless there are conflicts. Refer to the documentation for more info.
diff --git a/support/sqltex/src/SQLTeX_r.dat b/support/sqltex/src/SQLTeX_r.dat
new file mode 100644
index 0000000000..309d85b235
--- /dev/null
+++ b/support/sqltex/src/SQLTeX_r.dat
@@ -0,0 +1,101 @@
+; This file contains all characters or character sequences that
+; will be be replaced by SQLTeX when the occur in the response
+; of an SQL query.
+;
+; The first column is the character (sequence) that will be replaced.
+; The second column is the value to replace col 1 with.
+; Columns are separated with one or more tab characters.
+;
+; Note all values are case sensitive; if you add the line:
+; LaTeX \LaTeX\
+; the word "latex" will be untouched, but "LaTeX" will be replaced.
+;
+; To replace using regular expressions, use 're(<regular expression>)'
+; as key (or any other regexp indicator if that has been changed in the
+; config file), e.g.
+; re(<p\.*?>) \paragraph*{}
+; will replace all HTML <p> variants (<p style='font-size: normal'>,
+; <p align='center'> etc)
+;
+; Order matters!
+; We must start with the HTML code, since if the LaTeX special characters
+; would be first, the characters '<' and '>' would be replaced already so
+; HTML code is not recognised anymore.
+;
+;
+; HTML special characters
+; -----------------------
+;
+&nbsp; \hspace{1em}
+&amp; \&
+&#38; \&
+&#39; '
+;
+; HTML font types
+; ---------------
+;
+re(<strong.*?>) \textbf{
+</strong> }
+re(<em.*?>) \textit{
+</em> }
+<del> \sout{
+</del> }
+<sup> $^{
+</sup> }$
+;
+; HTML links (ignored)
+; --------------------
+;
+re(<a .*?>)
+</a>
+;
+; HTML sections and breaks
+; ------------------------
+;
+re(<p.*?>)
+</p> \\[0pt]
+re(<h1.*?>) \section{
+re(<h2.*?>) \subsection{
+re(<h3.*?>) \subsubsection{
+re(</h\d>) }
+re(<br\s*/?>) \\
+;
+; HTML lists
+; ----------
+;
+<ul> \begin{itemize}
+<li> \item\
+</li>
+</ul> \end{itemize}
+;
+; HTML tables
+; -----------
+; This is meant as an example only and outcommented.
+; Replace the tabular with the desired number of columns
+; before using this.
+;
+;re(<table.*?>) \begin{tabular}{lll}
+;re(</?tbody>)
+;re(<tr.*?>)
+;</tr> \\
+;re(<td.*?>)
+;</td> &
+;</table> \end{tabular} \\
+;
+;
+; LaTeX special characters
+; ------------------------
+;
+$ \$
+_ \_
+% \%
+& \&
+< \texttt{<}
+> \texttt{>}
+{ \{
+} \}
+# \#
+~ \~{}
+\ \ensuremath{\backslash}
+;
+
diff --git a/support/SQLTeX/src/SQLTeX.pl b/support/sqltex/src/sqltex
index e44daede41..ea612c790f 100644..100755
--- a/support/SQLTeX/src/SQLTeX.pl
+++ b/support/sqltex/src/sqltex
@@ -1,10 +1,13 @@
-#{PERLDIR}
+#!/usr/bin/env perl
+
+# To disable support for the --configfile option, set the value below to 0.
+$main::ext_cfgfile_allowed = 1;
################################################################################
#
# SQLTeX - SQL preprocessor for Latex
#
-# File: SQLTeX
+# File: sqltex
# =====
#
# Purpose: This script is a preprocessor for LaTeX. It reads a LaTeX file
@@ -13,8 +16,10 @@
# This software is subject to the terms of the LaTeX Project Public License;
# see http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html.
#
-# Copyright: (c) 2001-2022, Oscar van Eijk, Oveas Functionality Provider
+# Copyright: (c) 2001-2024, Oscar van Eijk, Oveas Functionality Provider
# ========== oscar@oveas.com
+# This software is subject to the terms of the LaTeX Project Public License;
+# see http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
#
# History:
# ========
@@ -24,6 +29,11 @@
# v1.5 Nov 23, 2007
# v2.0 Jan 12, 2016
# v2.1 Jan 21, 2022
+# v2.1-1 Apr 19, 2022 (test version for MSSQL, no official release)
+# v2.1-2 Jun 25, 2023 (test version parameter in sql_setparams(), no official release)
+# v2.1-3 Nov 30, 2023 (test version \sqlif-\sqlendif & \sqlsystem, no official release)
+# v2.2 Jul 31, 2024
+# v3.0 Sep 20, 202x
# Refer to the documentation for changes per release
#
# TODO:
@@ -32,26 +42,19 @@
#
################################################################################
#
-use strict;
+#use strict;
use DBI;
use Getopt::Long;
-use Term::ReadKey;
Getopt::Long::Configure ("bundling");
+use Cwd;
use feature 'state';
-#####
-# Check if we're running on linux
-#
-sub is_linux {
- return ($^O eq "linux");
-}
-
-#####
-# Check if we're running on windows
-#
-sub is_windows {
- return ($^O eq "MSWin32");
-}
+$main::ReadKey_available = eval
+{
+ require Term::ReadKey;
+ Term::ReadKey->import();
+ 1;
+};
#####
# Find out if any command-line options have been given
@@ -66,6 +69,8 @@ sub parse_options {
, 'replacementfile|r=s' => \$main::options{'r'}
, 'no-replacementfile|R' => \$main::options{'R'}
, 'output|o=s' => \$main::options{'o'}
+ , 'skip-empty-lines|-S' => \$main::options{'S'}
+ , 'write-comments|-C' => \$main::options{'C'}
, 'filename-extend|e=s' => \$main::options{'e'}
, 'file-extension|E=s' => \$main::options{'E'}
, 'sqlserver|s=s' => \$main::options{'s'}
@@ -81,8 +86,8 @@ sub parse_options {
, 'use-local-config|l' => \$main::options{'l'}
, 'updates|u' => \$main::options{'u'}
)) {
- print "usage: $main::myself [options] <file[.$main::configuration{'texex'}]> [parameter...]\n"
- . " type \"$main::myself --help\" for help\n";
+ print "usage: sqltex [options] <file[.$main::configuration{'texex'}]> [parameter...]\n"
+ . " type \"sqltex --help\" for help\n";
exit(1);
}
@@ -126,8 +131,8 @@ sub parse_options {
}
}
- if (defined $main::options{'l'} && !&is_linux) {
- warn "Option \"-l\" is ignored on $^O";
+ if (defined $main::options{'l'}) {
+ warn "Option '-l' is obsolete, use '-c <location>' instead";
delete $main::options{'l'};
}
}
@@ -137,8 +142,8 @@ sub parse_options {
#
sub short_help ($) {
my $onerror = shift;
- my $helptext = "usage: $main::myself [options] <file[.$main::configuration{'texex'}]> [parameter...]\n";
- $helptext .= " type \"$main::myself -h\" for help\n" if ($onerror);
+ my $helptext = "usage: sqltex [options] <file[.$main::configuration{'texex'}]> [parameter...]\n";
+ $helptext .= " type \"sqltex -h\" for help\n" if ($onerror);
return ($helptext);
}
@@ -149,30 +154,37 @@ sub short_help ($) {
sub print_help {
my $helptext = &short_help (0);
- $helptext .= " Options:\n";
- $helptext .= " --configfile <file>\n";
- $helptext .= " -c <file>\n";
- $helptext .= " SQLTeX configuration file.\n";
- $helptext .= " Default is \'$main::config_location/SQLTeX.cfg\'.\n";
+ $helptext .= " Options:\n";
+ if ($main::ext_cfgfile_allowed) {
+ $helptext .= " --configfile <file>\n";
+ $helptext .= " -c <file>\n";
+ $helptext .= " SQLTeX configuration file.\n";
+ $helptext .= " Default is \'$main::config_location/SQLTeX.cfg\'.\n\n";
+ }
$helptext .= " --file-extension <string>\n";
$helptext .= " -E <string>\n";
$helptext .= " replace input file extension in outputfile:\n";
$helptext .= " \'input.tex\' will be \'input.string\'\n";
- $helptext .= " For further notes, see option \'--filename-extend\' below\n";
+ $helptext .= " For further notes, see option \'--filename-extend\' below\n\n";
+
$helptext .= " --null-allowed\n";
$helptext .= " -N\n";
$helptext .= " NULL return values allowed. By default SQLTeX exits if a\n";
- $helptext .= " query returns an empty set\n";
+ $helptext .= " query returns an empty set\n\n";
+
$helptext .= " --password [password]\n";
$helptext .= " -P [password]\n";
$helptext .= " database password. The value is optional; if omitted, SQLTeX will prompt for\n";
- $helptext .= " a password. This overwrites the password in the input file.\n";
+ $helptext .= " a password. This overwrites the password in the input file.\n\n";
+
$helptext .= " --username <user>\n";
$helptext .= " -U <user>\n";
- $helptext .= " database username\n";
+ $helptext .= " database username\n\n";
+
$helptext .= " --version\n";
$helptext .= " -V\n";
- $helptext .= " print version number and exit\n";
+ $helptext .= " print version number and exit\n\n";
+
$helptext .= " --filename-extend <string>\n";
$helptext .= " -e <string>\n";
$helptext .= " add string to the output filename:\n";
@@ -185,70 +197,89 @@ sub print_help {
$helptext .= " D current date (yyyymmdd)\n";
$helptext .= " DT current date and time (yyyymmddhhmmss)\n";
$helptext .= " T current time (hhmmss)\n";
- $helptext .= " e.g., the command \'$main::myself --filename-extend _{P1}_{W} my_file code\'\n";
+ $helptext .= " e.g., the command \'sqltex --filename-extend _{P1}_{W} my_file code\'\n";
$helptext .= " will read \'my_file.tex\' and write \'myfile_code_Tue.tex\'\n";
$helptext .= " The same command, but with option \--file-extension\' would create the\n";
$helptext .= " outputfile \'myfile._code_Tue\'\n";
$helptext .= " By default the outputfile \'myfile_stx.tex\' would have been written.\n";
$helptext .= " The options \'--file-extension\' and \'--filename-extend\' cannot be used\n";
- $helptext .= " together or with \'--output\'.\n";
+ $helptext .= " together or with \'--output\'.\n\n";
+
$helptext .= " --force\n";
$helptext .= " -f\n";
- $helptext .= " force overwrite of existing files\n";
+ $helptext .= " force overwrite of existing files\n\n";
+
$helptext .= " --help\n";
$helptext .= " -h\n";
- $helptext .= " print this help message and exit\n";
+ $helptext .= " print this help message and exit\n\n";
+
$helptext .= " --multidoc-numbered\n";
$helptext .= " -m\n";
$helptext .= " Multidocument mode; create one document for each parameter that is retrieved\n";
$helptext .= " from the database in the input document (see documentation)\n";
- $helptext .= " This option cannot be used with \'--output\'.\n";
+ $helptext .= " This option cannot be used with \'--output\'.\n\n";
+
$helptext .= " --multidoc-named\n";
$helptext .= " -M\n";
- $helptext .= " Same as -m, but with the parameter in the filename i.s.o. a serial number\n";
+ $helptext .= " Same as -m, but with the parameter in the filename i.s.o. a serial number\n\n";
+
$helptext .= " --output <file>\n";
$helptext .= " -o <file>\n";
$helptext .= " specify an output file. Cannot be used with \'--file-extension\',\n";
- $helptext .= " \'--filename-extend\' or the \'--multidoc\' options.\n";
+ $helptext .= " \'--filename-extend\' or the \'--multidoc\' options.\n\n";
+
+ $helptext .= " --skip-empty-lines\n";
+ $helptext .= " -S\n";
+ $helptext .= " All SQLTeX commands will be removed from the input line or replaced by the\n";
+ $helptext .= " corresponding value. The rest of the input line is written to the output file.\n";
+ $helptext .= " This includes lines that only contain a SQLTeX command (and a newline character).\n";
+ $helptext .= " This will result in an empty line in the output file.\n";
+ $helptext .= " By specifying this option, these empty lines will be skipped. Lines that were empty\n";
+ $helptext .= " in the input will be written.\n\n";
+
+ $helptext .= " --write-comments\n";
+ $helptext .= " -C\n";
+ $helptext .= " LaTeX comments in the input file will be skipped by default. With this option,\n";
+ $helptext .= " comments will also be copied to the output file.\n\n";
+
$helptext .= " --prefix <prefix>\n";
$helptext .= " -p <prefix>\n";
$helptext .= " prefix used in the SQLTeX file. Default is \'sql\'\n";
$helptext .= " (e.g. \\sqldb[user]{database}), but this can be overwritten if it conflicts\n";
- $helptext .= " with other user-defined commands.\n";
+ $helptext .= " with other user-defined commands.\n\n";
+
$helptext .= " --quiet\n";
$helptext .= " -q\n";
- $helptext .= " run in quiet mode\n";
+ $helptext .= " run in quiet mode\n\n";
+
$helptext .= " --replacementfile <file>\n";
$helptext .= " -r <file>\n";
- $helptext .= " specify a file that contains replace characters. This is a list with two tab- seperated\n";
+ $helptext .= " specify a file that contains replace characters. This is a list with two tab-separated\n";
$helptext .= " fields per line. The first field holds a string that will be replaced in the SQL output\n";
$helptext .= " by the second string.\n";
$helptext .= " By default the file \'$main::config_location/SQLTeX_r.dat\' is used.\n";
+ $helptext .= " This default file will still be read after the given replacement file, unless support for\n";
+ $helptext .= " multiple replacement files is disabled in the configuration.\n\n";
+
$helptext .= " --no-replacementfile\n";
$helptext .= " -R\n";
$helptext .= " do not use a replace file. \'--replacementfile\' \'--no-replacementfile\' are handled\n";
$helptext .= " in the same order as they appear on the command line.\n";
- $helptext .= " For backwards compatibility, -rn is also still supported.\n";
-
- if (&is_linux) {
- $helptext .= " --use-local-config\n";
- $helptext .= " -l\n";
- $helptext .= " use $main::my_location as default location for the config- and replacement files\n";
- $helptext .= " in stead of $main::config_location.\n";
- }
+ $helptext .= " For backwards compatibility, -rn is also still supported.\n\n";
$helptext .= " --sqlserver <server>\n";
$helptext .= " -s <server>\n";
- $helptext .= " SQL server to connect to. Default is \'localhost\'\n";
+ $helptext .= " SQL server to connect to. Default is \'localhost\'\n\n";
+
$helptext .= " --updates\n";
$helptext .= " -u\n";
- $helptext .= " If the input file contains updates, execute them.\n";
+ $helptext .= " If the input file contains updates, execute them.\n\n";
- $helptext .= "\n file is the input file that should be read. By default,\n";
- $helptext .= " $main::myself looks for a file with extension \'.$main::configuration{'texex'}\'.\n";
- $helptext .= "\n parameter(s) are substituted in the SQL statements if they contain\n";
- $helptext .= " the string \$PAR[x] somewhere in the statement, where\n";
- $helptext .= " \'x\' is the number of the parameter.\n";
+ $helptext .= " file is the input file that should be read. By default,\n";
+ $helptext .= " sqltex looks for a file with extension \'.$main::configuration{'texex'}\'.\n\n";
+ $helptext .= " parameter(s) are substituted in the SQL statements if they contain\n";
+ $helptext .= " the string \$PAR[x] somewhere in the statement, where\n";
+ $helptext .= " \'x\' is the number of the parameter.\n";
print $helptext;
}
@@ -257,7 +288,7 @@ sub print_help {
# Print the version number
#
sub print_version {
- print "$main::myself v$main::version - $main::rdate\n";
+ print "sqltex v$main::version - $main::rdate\n";
}
#####
@@ -279,20 +310,30 @@ sub get_password ($$) {
my $pwd = "";
- print "Password for $usr\@$srv : ";
-
- ReadMode(4);
- while(ord(my $keyStroke = ReadKey(0)) != 10) {
- if(ord($keyStroke) == 127 || ord($keyStroke) == 8) { # DEL/Backspace
- chop($pwd);
- print "\b \b";
- } elsif(ord($keyStroke) >= 32) { # Skip control characters
- $pwd = $pwd . $keyStroke;
- print '*';
+ my $q = "Password for $usr\@$srv : ";
+ if ($main::ReadKey_available) {
+ print $q;
+ ReadMode(4);
+ while(ord(my $keyStroke = ReadKey(0)) != 10) {
+ if(ord($keyStroke) == 127 || ord($keyStroke) == 8) { # DEL/Backspace
+ chop($pwd);
+ print "\b \b";
+ } elsif(ord($keyStroke) >= 32) { # Skip control characters
+ $pwd = $pwd . $keyStroke;
+ print '*';
+ }
+ }
+ ReadMode(0);
+ print "\n";
+ } else {
+ if ($main::configuration{'allow_readable_pwd'}) {
+ print $q;
+ $pwd = <STDIN>;
+ chomp $pwd;
+ } else {
+ die "Cannot ask for password. Either install the Term::ReadKey module or set 'allow_readable_pwd' to 1 in the configuration";
}
}
- ReadMode(0);
-
return $pwd;
}
@@ -356,6 +397,9 @@ sub file_extension ($) {
#
sub get_configfiles {
if (defined $main::options{'c'}) {
+ if (!$main::ext_cfgfile_allowed) {
+ die "Use of the --configfile option is disallowed by your system administrator";
+ }
$main::configurationfile = $main::options{'c'};
} else {
$main::configurationfile = $main::config_location
@@ -365,20 +409,32 @@ sub get_configfiles {
if (!-e $main::configurationfile) {
die ("Configfile $main::configurationfile does not exist\n");
}
-
- if (defined $main::options{'r'}) {
- $main::replacefile = $main::options{'r'};
- } else {
- $main::replacefile = $main::config_location
- . ($main::config_location eq '' ? '' : '/')
- . 'SQLTeX_r.dat'
- unless (defined $main::options{'R'});
- }
- if (defined $main::replacefile && !-e $main::replacefile) {
- warn ("replace file $main::replacefile does not exist\n") unless ($main::replacefile eq "n");
- undef $main::replacefile;
+
+ @main::replacefiles = ();
+ if (!defined $main::options{'R'} && $main::options{'r'} ne "n") {
+ my $std_replacefile = $main::config_location
+ . ($main::config_location eq '' ? '' : '/') . 'SQLTeX_r.dat';
+ if (!-e $std_replacefile) {
+ warn ("replace file $std_replacefile does not exist\n");
+ $std_replacefile = "";
+ }
+ my $adl_replacefile = "";
+ if (defined $main::options{'r'}) {
+ if (!-e $main::options{'r'}) {
+ warn ("replace file $main::options{'r'} does not exist\n");
+ } else {
+ $adl_replacefile = $main::options{'r'};
+ }
+ }
+ my $rf_cnt = 0;
+ if ($adl_replacefile ne "") {
+ $main::replacefiles[$rf_cnt++] = $adl_replacefile;
+ }
+ if ($std_replacefile ne "") {
+ $main::replacefiles[$rf_cnt++] = $std_replacefile;
+ }
}
-
+
return;
}
@@ -432,6 +488,13 @@ sub get_filenames {
return;
}
+#####
+# Trim functions
+#
+sub ltrim { my $s = shift; $s =~ s/^\s+//; return $s; }
+sub rtrim { my $s = shift; $s =~ s/\s+$//; return $s; }
+sub trim { my $s = shift; return ltrim(rtrim($s)); }
+
#######
# Connect to the database
#
@@ -502,20 +565,38 @@ sub db_connect($$) {
} elsif ($main::configuration{'dbdriver'} eq "Sybase") {
$data_source = "DBI:$main::configuration{'dbdriver'}:$db";
$data_source .= ";server=$hn" unless ($hn eq "");
+ } elsif ($main::configuration{'dbdriver'} eq "ODBC") {
+ if (!exists ($main::configuration{'odbc_driver'})) {
+ $main::configuration{'odbc_driver'} = 'SQL Server';
+ }
+ if ($hn eq "") {
+ $hn = 'localhost';
+ }
+ $data_source = "DBI:ODBC:Driver={$main::configuration{'odbc_driver'}};Server=$hn";
+ $data_source .= ";Database=$db";
+ $data_source .= ";UID=$un" unless ($un eq "");
+ $data_source .= ";PWD=$pw" unless ($pw eq "");
} else { # MySQL, mSQL, ...
$data_source = "DBI:$main::configuration{'dbdriver'}:database=$db";
$data_source .= ";host=$hn" unless ($hn eq "");
}
}
-
if (!defined $main::options{'q'}) {
my $msg = "Connect to database $db on ";
- $msg .= $hn|| 'localhost';
+ $msg .= $hn || 'localhost';
$msg .= " as user $un" unless ($un eq '');
$msg .= " using a password" unless ($pw eq '');
&print_message ($msg);
}
- $main::db_handle = DBI->connect ($data_source, $un, $pw, { RaiseError => 0, PrintError => 1 }) || &just_died (1); # TODO Proper errorhandling
+ if ($main::configuration{'sqlsystem_allowed'}) {
+ %main::connect_info = (
+ 'hn' => $hn
+ ,'un' => $un
+ ,'pw' => $pw
+ ,'db' => $db
+ );
+ }
+ $main::db_handle = DBI->connect ($data_source, $un, $pw, { RaiseError => 0, PrintError => 1 }) || &signal_message (1);
return;
}
@@ -545,16 +626,10 @@ sub check_options ($) {
if ($opt =~ /^fldsep=/i) {
$main::fldsep = qq{$'};
$main::fldsep =~ s/NEWLINE/\n/;
-# if ($main::fldsep eq 'NEWLINE') {
-# $main::fldsep = "\n";
-# }
}
if ($opt =~ /^rowsep=/i) {
$main::rowsep = qq{$'};
$main::rowsep =~ s/NEWLINE/\n/;
-# if ($main::rowsep eq 'NEWLINE') {
-# $main::rowsep = "\n";
-# }
}
}
}
@@ -586,9 +661,9 @@ sub replace_values ($) {
#####
# Select multiple rows from the database. This function can have
# the [fldsep=s] and [rowsep=s] options to define the string which
-# should be used to seperate the fields and rows.
-# By default, fields are seperated with a comma and blank (', '), and rows
-# are seperated with a newline character ('\\')
+# should be used to separate the fields and rows.
+# By default, fields are separated with a comma and blank (', '), and rows
+# are separated with a newline character ('\\')
#
sub sql_row ($$) {
my ($options, $query) = @_;
@@ -605,7 +680,7 @@ sub sql_row ($$) {
$stat_handle->execute ();
if ($main::setarr) {
- &just_died (7) if (defined $main::arr[$main::arr_no] && !$main::multidoc); # TODO Proper errorhandling
+ &signal_message (7) if (defined $main::arr[$main::arr_no] && !$main::multidoc);
@main::arr[$main::arr_no] = ();
while (my $ref = $stat_handle->fetchrow_hashref()) {
foreach my $k (keys %$ref) {
@@ -619,7 +694,7 @@ sub sql_row ($$) {
while (@values = $stat_handle->fetchrow_array ()) {
$fc = $#values + 1;
- if (defined $main::replacefile) {
+ if ($#main::replacefiles >= 0) {
my $list_cnt = 0;
foreach (@values) {
$values[$list_cnt] = replace_values ($values[$list_cnt]);
@@ -631,7 +706,7 @@ sub sql_row ($$) {
$stat_handle->finish ();
if ($#return_values < 0) {
- &just_died (4); # TODO Proper errorhandling
+ &signal_message (4);
}
$rc = $#return_values + 1;
@@ -665,17 +740,17 @@ sub sql_field ($$) {
$stat_handle->finish ();
if ($#result < 0) {
- &just_died (4); # TODO Proper errorhandling
+ &signal_message (4);
} elsif ($#result > 0) {
- &just_died (5); # TODO Proper errorhandling
+ &signal_message (5);
} else {
&print_message ("Found 1 value: \"$result[0]\"");
if ($main::setvar) {
- &just_died (7) if (defined $main::var[$main::var_no] && !$main::multidoc); # TODO Proper errorhandling
+ &signal_message (7) if (defined $main::var[$main::var_no] && !$main::multidoc);
$main::var[$main::var_no] = $result[0];
return '';
} else {
- if (defined $main::replacefile) {
+ if ($#main::replacefiles >= 0) {
return (replace_values ($result[0]));
} else {
return ($result[0]);
@@ -689,7 +764,7 @@ sub sql_field ($$) {
#
sub sql_start ($) {
my $arr_no = shift;
- &just_died (11) if (!defined $main::arr[$arr_no]); # TODO Proper errorhandling
+ &signal_message (11) if (!defined $main::arr[$arr_no]);
if (@main::current_array) {
@main::current_array = ();
}
@@ -702,7 +777,12 @@ sub sql_start ($) {
#
sub sql_use ($$) {
my ($field, $loop) = @_;
- return $main::arr[$#main::current_array][$loop]->{$field};
+ my $return_value = $main::configuration{'no_such_used_fld'};
+ if (defined $main::arr[$#main::current_array][$loop]->{$field}) {
+ $return_value = $main::arr[$#main::current_array][$loop]->{$field};
+ }
+ return $return_value;
+
}
@@ -716,6 +796,25 @@ sub sql_end () {
for (my $lines = 0; $lines < $#{$main::loop_data[$#main::current_array]}; $lines++) {
my $buffered_line = ${$main::loop_data[$#main::current_array]}[$lines];
my $cmdPrefix = $main::configuration{'alt_cmd_prefix'};
+ if ($buffered_line =~ s/\\$cmdPrefix$main::configuration{'sql_endif'}\{\}//) {
+ $main::if_enabled = 1;
+ }
+ if ($buffered_line =~ /\\$cmdPrefix$main::configuration{'sql_if'}/) {
+ my $lin1 = $`;
+ my $lin2 = $';
+ $lin2 =~ s/^\{//;
+ $lin2 =~ /\}/;
+ my $statement = $`;
+ $lin2 = $';
+ $main::if_enabled = &sql_if($statement, $cnt);
+ $buffered_line = $lin1;
+ if ($main::if_enabled) {
+ $buffered_line .= $lin2;
+ }
+ }
+ if (!$main::if_enabled) {
+ next;
+ }
while (($buffered_line =~ /\\$cmdPrefix[a-z]+(\[|\{)/) && !($buffered_line =~ /\\\\$cmdPrefix[a-z]+(\[|\{)/)) {
my $cmdfound = $&;
$cmdfound =~ s/\\//;
@@ -727,10 +826,32 @@ sub sql_end () {
$buffered_line =~ /\}/;
my $statement = $`;
my $lin2 = $';
+
if ($cmdfound =~ /$main::configuration{'sql_use'}/) {
$buffered_line = $lin1 . &sql_use($statement, $cnt) . $lin2;
}
}
+ if ($buffered_line =~ /\\$main::configuration{'last_cmd_prefix'}$main::configuration{'sql_system'}/) {
+ my $cmdfound = $&;
+ $cmdfound =~ s/\\//;
+ $cmdfound =~ s/\{/\\\{/;
+
+ $buffered_line =~ /\\$cmdfound/;
+ my $lin1 = $`;
+ $buffered_line = $';
+ $buffered_line =~ /\}/;
+ my $statement = $`;
+ my $lin2 = $';
+ $statement =~ s/^\{//;
+
+ while ($buffered_line =~ /\\$main::configuration{'alt_cmd_prefix'}$main::configuration{'sql_use'}\{(\w+)\}/) {
+ my $usereplacement = &sql_use($1, $cnt);
+ $buffered_line =~ s/\\$main::configuration{'last_cmd_prefix'}$main::configuration{'sql_use'}\{(\w+)\}/$usereplacement/;
+ }
+ if ($cmdfound =~ /$main::configuration{'sql_system'}/) {
+ $buffered_line = $lin1 . &sql_system($statement) . $lin2;
+ }
+ }
$result .= $buffered_line;
}
}
@@ -739,16 +860,66 @@ sub sql_end () {
return $result;
}
+#####
+# Start a conditional block
+#
+sub sql_if ($$) {
+ my ($condition, $cnt) = @_;
+ if ($condition =~ /(&&|\|\|)/) {
+ my $c1 = &check_condition($`, $cnt);
+ my $c2 = &check_condition($', $cnt);
+ return eval("$c1 $& $c2");
+ } else {
+ return &check_condition($condition, $cnt);
+ }
+}
+#####
+# Helper function for sql_if
+#
+sub check_condition ($$) {
+ my ($condition, $cnt) = @_;
+ $condition =~ /(==|!=|<|>|<=|>=)/;
+
+ my $lval = $`;
+ my $rval = $';
+ my $comparisson = $&;
+ $lval = &trim($lval);
+ $rval = &trim($rval);
+
+ my $uf = &sql_use($lval, $cnt);
+ if ($uf ne $main::configuration{'no_such_used_fld'}) {
+ $lval = $uf;
+ }
+ $uf = &sql_use($rval, $cnt);
+ if ($uf ne $main::configuration{'no_such_used_fld'}) {
+ $rval = $uf;
+ }
+
+ my $result = 0;
+ if ($comparisson eq "==") {
+ $result = ($lval == $rval);
+ } elsif ($comparisson eq '!=') {
+ $result = ($lval != $rval);
+ } elsif ($comparisson eq '<') {
+ $result = ($lval < $rval);
+ } elsif ($comparisson eq '>') {
+ $result = ($lval > $rval);
+ } elsif ($comparisson eq '<=') {
+ $result = ($lval <= $rval);
+ } elsif ($comparisson eq '>=') {
+ $result = ($lval >= $rval);
+ }
+ return $result;
+}
#####
-# Select a (list of) single field(s) from the database. This list is used in
-# multidocument mode as the first parameter in all queries.
-# Currently, only 1 parameter per run is supported.
+# Select a list of rows from the database. Each row will be input
+# for a document in multidocument mode.
#
sub sql_setparams ($$) {
my ($options, $query) = @_;
- my (@values, @return_values, $rc);
+ my (@values, @return_values);
&check_options ($options);
@@ -757,18 +928,19 @@ sub sql_setparams ($$) {
my $stat_handle = $main::db_handle->prepare ($query);
$stat_handle->execute ();
- while (@values = $stat_handle->fetchrow_array ()) {
- &just_died (9) if ($#values > 0); # Only one allowed TODO Proper errorhandling
- push @return_values, @values;
+ for (my $i = 0; @values = $stat_handle->fetchrow_array (); $i++) {
+ for ($j = 0; $j <= $#values; $j++) {
+ $return_values[$i][$j] = $values[$j];
+ }
}
+
$stat_handle->finish ();
if ($#return_values < 0) {
- &just_died (8); # TODO Proper errorhandling
+ &signal_message (8);
}
- $rc = $#return_values + 1;
- &print_message ("Multidocument parameters found; $rc documents will be created: handle document $main::multidoc_cnt");
+ &print_message ('Multidocument parameters found; ' . $#return_values+1 ." documents will be created: handle document $main::multidoc_cnt") unless ($main::multidoc_cnt == 0);
return (@return_values);
}
@@ -792,26 +964,35 @@ sub sql_update ($$) {
&print_message ("$rc rows updated");
}
+####
+# Call an external script or system command
+#
+sub sql_system ($) {
+ my $cmd = shift;
+
+ my $return_value = '\\textbf{use of the \\textbackslash sqlsystem command is disallowed in the configuration}';
+ if ($main::configuration{'sqlsystem_allowed'}) {
+ $cmd =~ s/\<SRV\>/$main::connect_info{'hn'}/;
+ $cmd =~ s/\<USR\>/$main::connect_info{'un'}/;
+ $cmd =~ s/\<PWD\>/$main::connect_info{'pw'}/;
+ $cmd =~ s/\<DB\>/$main::connect_info{'db'}/;
+ $return_value = `$cmd`;
+ }
+ return $return_value;
+}
+
#####
-# Some error handling (mainly cleanup stuff)
+# Simple error handling
# Files will be closed if opened, and if no sql output was written yet,
# the outputfile will be removed.
-# FIXME We need some decent errorhandling
#
-sub just_died ($) {
+sub signal_message ($) {
my $step = shift;
- my $Resurect = 0;
+ my $can_continue = 0;
- $Resurect = 1 if ($step == 4 && $main::NULLallowed);
+ $can_continue = 1 if ($step == 4 && $main::NULLallowed);
- if ($step >= 1 && !$Resurect) {
-# close FI;
-# close FO;
- }
- if ($step > 2 && !$Resurect) {
-# $main::db_handle->disconnect();
- }
- if ($step >= 1 && $step <= 2 && !$Resurect) {
+ if ($step >= 1 && $step <= 2 && !$can_continue) {
unlink ($main::outputfile);
}
@@ -819,7 +1000,9 @@ sub just_died ($) {
# Step specific exit
#
my $msg;
- if ($step == 2) {
+ if ($step == 1) {
+ $msg = "noerror opening database at line $main::lcount[$main::fcount]";
+ } elsif ($step == 2) {
$msg = "no database opened at line $main::lcount[$main::fcount]";
} elsif ($step == 3) {
$msg = "insufficient parameters to substitute variable on line $main::lcount[$main::fcount]";
@@ -833,14 +1016,16 @@ sub just_died ($) {
$msg = "trying to overwrite an existing variable on line $main::lcount[$main::fcount]";
} elsif ($step == 8) {
$msg = "no parameters for multidocument found on line $main::lcount[$main::fcount]";
- } elsif ($step == 9) {
- $msg = "too many fields returned in multidocument mode on $main::lcount[$main::fcount]";
+# } elsif ($step == 9) {
+# $msg = "too many fields returned in multidocument mode on $main::lcount[$main::fcount]";
} elsif ($step == 10) {
$msg = "unrecognized command on line $main::lcount[$main::fcount]";
} elsif ($step == 11) {
$msg = "start using a non-existing array on line $main::lcount[$main::fcount]";
} elsif ($step == 12) {
$msg = "\\sqluse command encountered outside loop context on line $main::lcount[$main::fcount]";
+ } elsif ($step == 13) {
+ $msg = "\\sqlif command encountered outside loop context on line $main::lcount[$main::fcount]";
}
if ($main::fcount > 0) {
for (my $fcnt = 0; $fcnt < $main::fcount; $fcnt++) {
@@ -848,7 +1033,7 @@ sub just_died ($) {
}
}
warn "$msg\n";
- return if ($Resurect);
+ return if ($can_continue);
exit (1);
}
@@ -884,43 +1069,51 @@ sub parse_command ($$$) {
my $statement = $`;
my $lin2 = $';
+ my $raw_statement = $statement;
+ $raw_statement =~ s/^\{//;
$statement =~ s/(\[|\{)//g;
if ($statement =~ /\]/) {
$options = $`;
$statement = $';
}
-
if ($varallowed) {
if (($main::multidoc_cnt > 0) && $main::multidoc) {
- $statement =~ s/\$PAR1/$multidoc_par/g;
- } else {
- for (my $i = 1; $i <= $#ARGV; $i++) {
- $statement =~ s/\$PAR$i/$ARGV[$i]/g;
+ for (my $i = 1; $i <= $#main::parameters; $i++) {
+ $statement =~ s/\$MPAR$i/$main::parameters[$main::multidoc_cnt-1][$i-1]/g;
}
}
+ for (my $i = 1; $i <= $#ARGV; $i++) {
+ $statement =~ s/\$PAR$i/$ARGV[$i]/g;
+ }
while ($statement =~ /\$VAR[0-9]/) {
my $varno = $&;
$varno =~ s/\$VAR//;
- &just_died (6) if (!defined ($main::var[$varno])); # TODO Proper errorhandling
+ &signal_message (6) if (!defined ($main::var[$varno]));
$statement =~ s/\$VAR$varno/$main::var[$varno]/g;
}
- &just_died (3) if ($statement =~ /\$PAR/ && ($main::multidoc_cnt > 0) && $main::multidoc); # TODO Proper errorhandling
+ if ($statement =~ /\$PAR/ && ($main::multidoc_cnt > 0) && $main::multidoc) {
+ print "Did you update your input file to reflect the changes in v2.2?\n";
+ print "Multidoc parameters are now used to replace \$MPARn (was \$PARn).\n";
+ print "Please check the documentation for more info.\n";
+ die ("No parameters found to replace in multidoc mode");
+ }
$statement =~ s/\{//;
}
- if ($cmdfound =~ /$main::configuration{'sql_open'}/) {
+ $cmdfound =~ s/^$main::configuration{'cmd_prefix'}//;
+ if ($cmdfound eq $main::configuration{'sql_open'}
+ ) {
&db_connect($options, $statement);
$main::db_opened = 1;
return 0;
}
- &just_died (2) if (!$main::db_opened); # TODO Proper errorhandling
-
- if ($cmdfound =~ /$main::configuration{'sql_field'}/) {
+ &signal_message (2) if (!$main::db_opened);
+ if ($cmdfound eq $main::configuration{'sql_field'}) {
$main::line = $lin1 . &sql_field($options, $statement) . $lin2;
- } elsif ($cmdfound =~ /$main::configuration{'sql_row'}/) {
+ } elsif ($cmdfound eq $main::configuration{'sql_row'}) {
$main::line = $lin1 . &sql_row($options, $statement) . $lin2;
- } elsif ($cmdfound =~ /$main::configuration{'sql_params'}/) {
+ } elsif ($cmdfound eq $main::configuration{'sql_params'}) {
if ($main::multidoc) { # Ignore otherwise
@main::parameters = &sql_setparams($options, $statement);
$main::line = $lin1 . $lin2;
@@ -928,21 +1121,27 @@ sub parse_command ($$$) {
} else {
$main::line = $lin1 . $lin2;
}
- } elsif ($cmdfound =~ /$main::configuration{'sql_update'}/) {
+ } elsif ($cmdfound eq $main::configuration{'sql_update'}) {
&sql_update($options, $statement);
$main::line = $lin1 . $lin2;
- } elsif ($cmdfound =~ /$main::configuration{'sql_start'}/) {
+ } elsif ($cmdfound eq $main::configuration{'sql_start'}) {
&sql_start($statement);
$main::line = $lin1 . $lin2;
- } elsif ($cmdfound =~ /$main::configuration{'sql_use'}/) {
- &just_died (12) if (!@main::current_array); # TODO Proper errorhandling
+ } elsif ($cmdfound eq $main::configuration{'sql_use'}) {
+ &signal_message (12) if (!@main::current_array);
$main::line = $lin1 . "\\" . $main::configuration{'alt_cmd_prefix'} . $main::configuration{'sql_use'} . "{" . $statement . "}" . $lin2; # Restore the line, will be processed later
- } elsif ($cmdfound =~ /$main::configuration{'sql_end'}/) {
+ } elsif ($cmdfound eq $main::configuration{'sql_end'}) {
$main::line = $lin1 . &sql_end() . $lin2;
+ } elsif ($cmdfound eq $main::configuration{'sql_endif'}) {
+ $main::line = $lin1 . "\\" . $main::configuration{'alt_cmd_prefix'} . $main::configuration{'sql_endif'} . "{}" . $lin2; # Restore the line, will be processed later
+ } elsif ($cmdfound eq $main::configuration{'sql_if'}) {
+ &signal_message (13) if (!@main::current_array);
+ $main::line = $lin1 . "\\" . $main::configuration{'alt_cmd_prefix'} . $main::configuration{'sql_if'} . "{" . $statement . "}" . $lin2; # Restore the line, will be processed later
+ } elsif ($cmdfound =~ /$main::configuration{'sql_system'}/) {
+ $main::line = $lin1 . &sql_system($raw_statement) . $lin2;
} else {
- &just_died (10); # TODO Proper errorhandling
+ &signal_message (10);
}
-
return 0;
}
@@ -960,22 +1159,34 @@ sub read_input($$$$) {
while ($main::line = <$fileIn>) {
$main::lcount[$main::fcount]++;
- next if ($main::line =~ /^\s*%/);
- if ($main::line =~ /(.*?)(\\in(put|clude))(\s*?)\{(.*?)\}(.*)/) {
- print $output_handle "$1" unless ($output_handle == -1);
- &read_input($5, $output_handle, $multidoc_par);
- return if ($main::restart);
- print $output_handle "$6\n" unless ($output_handle == -1);
- }
- my $cmdPrefix = $main::configuration{'cmd_prefix'};
- while (($main::line =~ /\\$cmdPrefix[a-z]+(\[|\{)/) && !($main::line =~ /\\\\$cmdPrefix[a-z]+(\[|\{)/)) {
- if (&parse_command($&, $multidoc_par, $fileIn) && $main::multidoc && ($main::multidoc_cnt == 0)) {
- close $fileIn;
- $main::fcount--;
- $main::restart = 1;
- return;
+ my $line_had_cmd = 0;
+
+ if ($main::line =~ /^\s*%/) {
+ next if (!$main::options{'C'});
+ } else {
+ if ($main::line =~ /(.*?)(\\in(put|clude))(\s*?)\{(.*?)\}(.*)/) {
+ print $output_handle "$1" unless ($output_handle == -1);
+ &read_input($5, $output_handle, $multidoc_par);
+ return if ($main::restart);
+ print $output_handle "$6\n" unless ($output_handle == -1);
+ }
+ my $cmdPrefix = $main::configuration{'cmd_prefix'};
+ if (@main::current_array) {
+ # Inside loop context the \sqlsystem{} command can contain \sqluse{}
+ $main::line =~ s/$cmdPrefix$main::configuration{'sql_system'}/$main::configuration{'last_cmd_prefix'}$main::configuration{'sql_system'}/;
+ }
+ while (($main::line =~ /\\$cmdPrefix[a-z]+(\[|\{)/) && !($main::line =~ /\\\\$cmdPrefix[a-z]+(\[|\{)/)) {
+ $line_had_cmd = 1;
+ if (&parse_command($&, $multidoc_par, $fileIn) && $main::multidoc && ($main::multidoc_cnt == 0)) {
+ close $fileIn;
+ $main::fcount--;
+ $main::restart = 1;
+ return;
+ }
}
}
+ next if ($line_had_cmd && $main::line eq "\n" && $main::options{'S'});
+
if (@main::current_array && $#main::current_array >= 0) {
push @{$main::loop_data[$#main::current_array]}, $main::line;
} else {
@@ -1003,7 +1214,7 @@ sub process_file {
$main::saved_outfile_template = $main::outputfile if ($main::multidoc_cnt == 1); # New global name; should be a static
$main::outputfile = $main::saved_outfile_template if ($main::multidoc_cnt > 1);
$main::outputfile =~ s/\#M\#/$main::multidoc_cnt/;
- $main::outputfile =~ s/\#P\#/$main::parameters[($main::multidoc_cnt-1)]/;
+ $main::outputfile =~ s/\#P\#/$main::parameters[($main::multidoc_cnt-1)][0]/;
$multidoc_par = @main::parameters[$main::multidoc_cnt - 1];
}
my $fileOut;
@@ -1034,58 +1245,64 @@ sub process_file {
# Default config values, can be overwritten with SQLTeX.cfg
#
%main::configuration = (
- 'dbdriver' => 'mysql'
- ,'oracle_sid' => 'ORASID'
- ,'texex' => 'tex'
- ,'stx' => '_stx'
- ,'def_out_is_in' => 0
- ,'rfile_comment' => ';'
- ,'rfile_regexploc' => '...'
- ,'rfile_regexp' => 're(...)'
- ,'cmd_prefix' => 'sql'
- ,'sql_open' => 'db'
- ,'sql_field' => 'field'
- ,'sql_row' => 'row'
- ,'sql_params' => 'setparams'
- ,'sql_update' => 'update'
- ,'sql_start' => 'start'
- ,'sql_end' => 'end'
- ,'sql_use' => 'use'
- ,'repl_step' => 'OSTX'
- ,'alt_cmd_prefix' => 'processedsqlcommand'
+ 'dbdriver' => 'mysql'
+ ,'oracle_sid' => 'ORASID'
+ ,'texex' => 'tex'
+ ,'stx' => '_stx'
+ ,'def_out_is_in' => 0
+ ,'rfile_comment' => ';'
+ ,'rfile_regexploc' => '...'
+ ,'rfile_regexp' => 're(...)'
+ ,'multi_rfile' => 1
+ ,'cmd_prefix' => 'sql'
+ ,'sql_system' => 'system'
+ ,'sql_open' => 'db'
+ ,'sql_field' => 'field'
+ ,'sql_row' => 'row'
+ ,'sql_params' => 'setparams'
+ ,'sql_update' => 'update'
+ ,'sql_start' => 'start'
+ ,'sql_end' => 'end'
+ ,'sql_use' => 'use'
+ ,'sql_if' => 'if'
+ ,'sql_endif' => 'endif'
+ ,'sqlsystem_allowed' => 0
+ ,'allow_readable_pwd'=> 0
+ ,'repl_step' => 'OSTX'
+ ,'alt_cmd_prefix' => 'processedsqlcommand'
+ ,'last_cmd_prefix' => 'lastsqlcommand'
+ ,'no_such_used_fld' => '\textit{SQL\TeX\ use-field does not exist}'
);
#####
# Some globals
#
{
- my @dir_list = split /\//, $0;
+ my $realpath = Cwd::realpath($0);
+
+ my @dir_list = split /\//, $realpath;
pop @dir_list;
$main::my_location = join '/', @dir_list;
-
- if (&is_linux) {
- $main::config_location = '{SYSCONFDIR}';
- } else {
+ $main::if_enabled = 1;
+
+ if ($main::my_location =~ /texmf-dist\/scripts/) {
+ # Config location in a TeX Live distro
$main::config_location = $main::my_location;
+ } else {
+ if ($^O eq "linux") {
+ # Default on linux, can be changed when running configure
+ $main::config_location = '/usr/local/etc';
+ } else {
+ # Default on al other OSes
+ $main::config_location = $main::my_location;
+ }
}
}
-# Check config
-# Used for loops, should not start with $main::configuration{'cmd_prefix'} !!
-if ($main::configuration{'alt_cmd_prefix'} =~ /^$main::configuration{'cmd_prefix'}/) {
- die "Configuration item 'alt_cmd_prefix' cannot start with $main::configuration{'cmd_prefix'}";
-}
-
-$main::myself = $0;
-
-$main::version = '2.1';
-$main::rdate = 'Jan 21, 2022';
+$main::version = '3.0';
+$main::rdate = 'Sep 20, 2024';
&parse_options;
-if (defined $main::options{'l'}) {
- $main::config_location = $main::my_location;
-}
-
&get_configfiles;
if (defined $main::configurationfile) {
@@ -1094,7 +1311,7 @@ if (defined $main::configurationfile) {
next if ($main::line =~ /^\s*#/);
next if ($main::line =~ /^\s*$/);
chomp $main::line;
- my ($ck, $cv) = split /=/, $main::line;
+ my ($ck, $cv) = split /=/, $main::line, 2;
$ck =~ s/\s//g;
$cv =~ s/\s//g;
if ($cv ne '') {
@@ -1104,6 +1321,13 @@ if (defined $main::configurationfile) {
close CF;
}
+# Check config
+# Used for loops, should not start with $main::configuration{'cmd_prefix'} !!
+if ($main::configuration{'alt_cmd_prefix'} =~ /^$main::configuration{'cmd_prefix'}/
+ || $main::configuration{'last_cmd_prefix'} =~ /^$main::configuration{'cmd_prefix'}/) {
+ die "Configuration items 'alt_cmd_prefix' and ĺast_cnd_prefix' cannot start with $main::configuration{'cmd_prefix'}";
+}
+
&get_filenames;
if (!$main::multidoc && -e "$main::outputfile") {
@@ -1111,23 +1335,28 @@ if (!$main::multidoc && -e "$main::outputfile") {
unless (defined $main::options{'f'});
}
-if (defined $main::replacefile) {
+{
my $repl_cnt = '000';
@main::repl_order = ();
- open (RF, "<$main::replacefile");
- while ($main::line = <RF>) {
- next if ($main::line =~ /^\s*$main::configuration{'rfile_comment'}/);
- chomp $main::line;
- $main::line =~ s/\t+/\t/;
- my ($rk, $rv) = split /\t/, $main::line;
- if ($rk ne '') {
- push @main::repl_order, $rk;
- $main::repl_key{$rk} = "$main::configuration{'repl_step'}$repl_cnt";
- $main::repl_val{"$main::configuration{'repl_step'}$repl_cnt"} = $rv;
- $repl_cnt++;
+ for (my $rf_cnt = 0; $rf_cnt <= $#main::replacefiles; $rf_cnt++) {
+ open (RF, "<$main::replacefiles[$rf_cnt]");
+ while ($main::line = <RF>) {
+ next if ($main::line =~ /^\s*$main::configuration{'rfile_comment'}/);
+ chomp $main::line;
+ $main::line =~ s/\t+/\t/;
+ my ($rk, $rv) = split /\t/, $main::line;
+ if ($rk ne '') {
+ push @main::repl_order, $rk;
+ $main::repl_key{$rk} = "$main::configuration{'repl_step'}$repl_cnt";
+ $main::repl_val{"$main::configuration{'repl_step'}$repl_cnt"} = $rv;
+ $repl_cnt++;
+ }
+ }
+ close RF;
+ if (!$main::configuration{'multi_rfile'}) {
+ last;
}
}
- close RF;
}
# Start processing
diff --git a/support/texlab/CHANGELOG.md b/support/texlab/CHANGELOG.md
index 0a3b5ed683..f2fa8d96cf 100644
--- a/support/texlab/CHANGELOG.md
+++ b/support/texlab/CHANGELOG.md
@@ -5,6 +5,46 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [5.19.0] - 2024-07-08
+
+### Added
+
+- Add `texlab.build.useFileList` setting to allow controlling whether to use the `.fls` files
+
+### Changed
+
+- Disable using `.fls` files for project detection by default
+
+## [5.18.0] - 2024-07-06
+
+### Added
+
+- Parse `.fls` files to make the project detection more reliable ([#1145](https://github.com/latex-lsp/texlab/issues/1145))
+
+### Fixed
+
+- Fix parsing commands with unicode characters inside BibTeX entries
+ ([#1147](https://github.com/latex-lsp/texlab/issues/1147))
+- Improve detection of included files when non-ASCII characters are used ([#923](https://github.com/latex-lsp/texlab/issues/923))
+- Fix resolving includes starting from files included using `\subimport` ([#1145](https://github.com/latex-lsp/texlab/issues/1145))
+
+## [5.17.0] - 2024-06-23
+
+### Added
+
+- Add label commands from `zref` and `zref-clever` to the list of default label commands
+ ([#1140](https://github.com/latex-lsp/texlab/pull/1140))
+- Add `texlab.experimental.labelDefinitionPrefixes` and
+ `texlab.experimental.labelReferencePrefixes` options ([#1139](https://github.com/latex-lsp/texlab/pull/1139))
+
+## [5.16.1] - 2024-05-25
+
+### Fixed
+
+- Don't treat `\label{}` and `\ref{}` with macro parameter as label commands ([#1119](https://github.com/latex-lsp/texlab/issues/1119))
+- Fix parsing `latexmkrc` for `latexmk` versions older than `v4.8.4` ([#1128](https://github.com/latex-lsp/texlab/issues/1128))
+- Remove unused `texlab.rootDirectory` setting from documentation
+
## [5.16.0] - 2024-05-01
### Added
diff --git a/support/texlab/Cargo.lock b/support/texlab/Cargo.lock
index 80599217fd..ead2473278 100644
--- a/support/texlab/Cargo.lock
+++ b/support/texlab/Cargo.lock
@@ -73,9 +73,9 @@ dependencies = [
[[package]]
name = "anyhow"
-version = "1.0.82"
+version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519"
+checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
[[package]]
name = "autocfg"
@@ -90,7 +90,7 @@ dependencies = [
"bibtex-utils",
"dirs",
"distro",
- "itertools 0.12.1",
+ "itertools 0.13.0",
"line-index",
"log",
"notify",
@@ -99,7 +99,7 @@ dependencies = [
"percent-encoding",
"regex",
"rowan",
- "rustc-hash",
+ "rustc-hash 2.0.0",
"shellexpand",
"syntax",
"titlecase",
@@ -130,10 +130,10 @@ dependencies = [
"chrono",
"expect-test",
"human_name",
- "itertools 0.12.1",
+ "itertools 0.13.0",
"parser",
"rowan",
- "rustc-hash",
+ "rustc-hash 2.0.0",
"syntax",
"unicode-normalization",
]
@@ -190,9 +190,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
-version = "0.4.31"
+version = "0.4.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38"
+checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
dependencies = [
"num-traits",
]
@@ -232,10 +232,10 @@ dependencies = [
"bibtex-utils",
"expect-test",
"isocountry",
- "itertools 0.12.1",
+ "itertools 0.13.0",
"parser",
"rowan",
- "rustc-hash",
+ "rustc-hash 2.0.0",
"syntax",
"titlecase",
"unicode-normalization",
@@ -244,9 +244,9 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.5.4"
+version = "4.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0"
+checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d"
dependencies = [
"clap_builder",
"clap_derive",
@@ -254,9 +254,9 @@ dependencies = [
[[package]]
name = "clap_builder"
-version = "4.5.2"
+version = "4.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4"
+checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708"
dependencies = [
"anstream",
"anstyle",
@@ -266,9 +266,9 @@ dependencies = [
[[package]]
name = "clap_derive"
-version = "4.5.4"
+version = "4.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64"
+checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085"
dependencies = [
"heck",
"proc-macro2",
@@ -298,11 +298,11 @@ dependencies = [
"crossbeam-channel",
"distro",
"expect-test",
- "itertools 0.12.1",
+ "itertools 0.13.0",
"libc",
"log",
"rowan",
- "rustc-hash",
+ "rustc-hash 2.0.0",
"syntax",
"test-utils",
"thiserror",
@@ -334,9 +334,10 @@ dependencies = [
"expect-test",
"fuzzy-matcher",
"line-index",
+ "parser",
"rayon",
"rowan",
- "rustc-hash",
+ "rustc-hash 2.0.0",
"syntax",
"test-utils",
"url",
@@ -347,9 +348,9 @@ name = "completion-data"
version = "0.0.0"
dependencies = [
"flate2",
- "itertools 0.12.1",
+ "itertools 0.13.0",
"once_cell",
- "rustc-hash",
+ "rustc-hash 2.0.0",
"serde",
"serde_json",
]
@@ -407,9 +408,9 @@ dependencies = [
[[package]]
name = "crossbeam-channel"
-version = "0.5.12"
+version = "0.5.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95"
+checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2"
dependencies = [
"crossbeam-utils",
]
@@ -449,9 +450,9 @@ name = "definition"
version = "0.0.0"
dependencies = [
"base-db",
- "itertools 0.12.1",
+ "itertools 0.13.0",
"rowan",
- "rustc-hash",
+ "rustc-hash 2.0.0",
"syntax",
"test-utils",
]
@@ -464,14 +465,14 @@ dependencies = [
"encoding_rs",
"encoding_rs_io",
"expect-test",
- "itertools 0.12.1",
+ "itertools 0.13.0",
"line-index",
"log",
"multimap",
"once_cell",
"regex",
"rowan",
- "rustc-hash",
+ "rustc-hash 2.0.0",
"syntax",
"test-utils",
"url",
@@ -509,7 +510,7 @@ name = "distro"
version = "0.0.0"
dependencies = [
"anyhow",
- "rustc-hash",
+ "rustc-hash 2.0.0",
]
[[package]]
@@ -594,9 +595,9 @@ dependencies = [
[[package]]
name = "flate2"
-version = "1.0.29"
+version = "1.0.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4556222738635b7a3417ae6130d8f52201e45a0c4d1a907f0826383adb5f85e7"
+checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae"
dependencies = [
"crc32fast",
"miniz_oxide",
@@ -741,7 +742,7 @@ dependencies = [
"base-db",
"expect-test",
"rowan",
- "rustc-hash",
+ "rustc-hash 2.0.0",
"test-utils",
]
@@ -810,9 +811,9 @@ dependencies = [
[[package]]
name = "itertools"
-version = "0.12.1"
+version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
+checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
dependencies = [
"either",
]
@@ -860,15 +861,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
-version = "0.2.153"
+version = "0.2.155"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
+checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
[[package]]
name = "line-index"
version = "0.0.0"
dependencies = [
- "rustc-hash",
+ "rustc-hash 2.0.0",
"text-size",
]
@@ -899,9 +900,9 @@ dependencies = [
[[package]]
name = "log"
-version = "0.4.21"
+version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
+checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "logos"
@@ -1094,9 +1095,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
[[package]]
name = "parking_lot"
-version = "0.12.1"
+version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
+checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
dependencies = [
"lock_api",
"parking_lot_core",
@@ -1126,7 +1127,7 @@ dependencies = [
"pathdiff",
"regex",
"rowan",
- "rustc-hash",
+ "rustc-hash 2.0.0",
"syntax",
"tempfile",
"versions",
@@ -1298,16 +1299,16 @@ version = "0.0.0"
dependencies = [
"base-db",
"rowan",
- "rustc-hash",
+ "rustc-hash 2.0.0",
"syntax",
"test-utils",
]
[[package]]
name = "regex"
-version = "1.10.4"
+version = "1.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c"
+checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f"
dependencies = [
"aho-corasick",
"memchr",
@@ -1337,8 +1338,9 @@ name = "rename"
version = "0.0.0"
dependencies = [
"base-db",
+ "parser",
"rowan",
- "rustc-hash",
+ "rustc-hash 2.0.0",
"syntax",
"test-utils",
]
@@ -1352,7 +1354,7 @@ dependencies = [
"countme",
"hashbrown",
"memoffset",
- "rustc-hash",
+ "rustc-hash 1.1.0",
"text-size",
]
@@ -1363,6 +1365,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
+name = "rustc-hash"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152"
+
+[[package]]
name = "rustix"
version = "0.38.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1404,18 +1412,18 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "serde"
-version = "1.0.199"
+version = "1.0.203"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a"
+checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.199"
+version = "1.0.203"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc"
+checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
dependencies = [
"proc-macro2",
"quote",
@@ -1424,9 +1432,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.116"
+version = "1.0.119"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813"
+checksum = "e8eddb61f0697cc3989c5d64b452f5488e2b8a60fd7d5076a3045076ffef8cb0"
dependencies = [
"itoa",
"ryu",
@@ -1445,9 +1453,9 @@ dependencies = [
[[package]]
name = "serde_repr"
-version = "0.1.18"
+version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb"
+checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [
"proc-macro2",
"quote",
@@ -1494,7 +1502,7 @@ dependencies = [
"base-db",
"distro",
"expect-test",
- "itertools 0.12.1",
+ "itertools 0.13.0",
"line-index",
"regex",
"rowan",
@@ -1519,8 +1527,9 @@ dependencies = [
name = "syntax"
version = "0.0.0"
dependencies = [
- "itertools 0.12.1",
+ "itertools 0.13.0",
"rowan",
+ "rustc-hash 2.0.0",
]
[[package]]
@@ -1548,7 +1557,7 @@ dependencies = [
[[package]]
name = "texlab"
-version = "5.16.0"
+version = "5.19.0"
dependencies = [
"anyhow",
"base-db",
@@ -1582,7 +1591,7 @@ dependencies = [
"regex",
"rename",
"rowan",
- "rustc-hash",
+ "rustc-hash 2.0.0",
"serde",
"serde_json",
"serde_regex",
@@ -1601,18 +1610,18 @@ checksum = "f18aa187839b2bdb1ad2fa35ead8c4c2976b64e4363c386d45ac0f7ee85c9233"
[[package]]
name = "thiserror"
-version = "1.0.59"
+version = "1.0.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa"
+checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.59"
+version = "1.0.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66"
+checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
dependencies = [
"proc-macro2",
"quote",
@@ -1742,11 +1751,11 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
[[package]]
name = "versions"
-version = "6.2.0"
+version = "6.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38a8931f8d167b6448076020e70b9de46dcf5ea1731212481a092d0071c4ac5b"
+checksum = "5fc28d1172a20e32754969ea1a873c2c6e68e36c449c6056aa3e2ee5fe69a794"
dependencies = [
- "itertools 0.12.1",
+ "itertools 0.13.0",
"nom",
]
diff --git a/support/texlab/crates/base-db/Cargo.toml b/support/texlab/crates/base-db/Cargo.toml
index ca477c496c..547ba2ad77 100644
--- a/support/texlab/crates/base-db/Cargo.toml
+++ b/support/texlab/crates/base-db/Cargo.toml
@@ -10,16 +10,16 @@ rust-version.workspace = true
bibtex-utils = { path = "../bibtex-utils" }
dirs = "5.0.1"
distro = { path = "../distro" }
-itertools = "0.12.1"
+itertools = "0.13.0"
line-index = { path = "../line-index" }
-log = "0.4.21"
+log = "0.4.22"
notify = "6.0.1"
once_cell = "1.19.0"
parser = { path = "../parser" }
percent-encoding = "2.3.0"
-regex = "1.10.4"
+regex = "1.10.5"
rowan = "0.15.15"
-rustc-hash = "1.1.0"
+rustc-hash = "2.0.0"
shellexpand = "3.1.0"
syntax = { path = "../syntax" }
titlecase = "3.0.0"
diff --git a/support/texlab/crates/base-db/src/config.rs b/support/texlab/crates/base-db/src/config.rs
index 9814e3e674..e4c827e61c 100644
--- a/support/texlab/crates/base-db/src/config.rs
+++ b/support/texlab/crates/base-db/src/config.rs
@@ -3,9 +3,8 @@ use std::time::Duration;
use parser::SyntaxConfig;
use regex::Regex;
-#[derive(Debug)]
+#[derive(Debug, Default)]
pub struct Config {
- pub root_dir: Option<String>,
pub build: BuildConfig,
pub diagnostics: DiagnosticsConfig,
pub formatting: FormattingConfig,
@@ -36,7 +35,7 @@ pub struct DiagnosticsConfig {
pub delay: Duration,
}
-#[derive(Debug)]
+#[derive(Debug, Default)]
pub struct ChktexConfig {
pub on_open: bool,
pub on_save: bool,
@@ -65,13 +64,13 @@ pub enum Formatter {
LatexIndent,
}
-#[derive(Debug)]
+#[derive(Debug, Default)]
pub struct LatexIndentConfig {
pub local: Option<String>,
pub modify_line_breaks: bool,
}
-#[derive(Debug)]
+#[derive(Debug, Default)]
pub struct SymbolConfig {
pub allowed_patterns: Vec<Regex>,
pub ignored_patterns: Vec<Regex>,
@@ -96,22 +95,6 @@ pub enum MatchingAlgo {
PrefixIgnoreCase,
}
-impl Default for Config {
- fn default() -> Self {
- Self {
- root_dir: None,
- build: BuildConfig::default(),
- diagnostics: DiagnosticsConfig::default(),
- formatting: FormattingConfig::default(),
- synctex: None,
- symbols: SymbolConfig::default(),
- syntax: SyntaxConfig::default(),
- completion: CompletionConfig::default(),
- inlay_hints: InlayHintConfig::default(),
- }
- }
-}
-
impl Default for BuildConfig {
fn default() -> Self {
Self {
@@ -141,17 +124,6 @@ impl Default for DiagnosticsConfig {
}
}
-impl Default for ChktexConfig {
- fn default() -> Self {
- Self {
- on_open: false,
- on_save: false,
- on_edit: false,
- additional_args: Vec::new(),
- }
- }
-}
-
impl Default for FormattingConfig {
fn default() -> Self {
Self {
@@ -163,24 +135,6 @@ impl Default for FormattingConfig {
}
}
-impl Default for LatexIndentConfig {
- fn default() -> Self {
- Self {
- local: None,
- modify_line_breaks: false,
- }
- }
-}
-
-impl Default for SymbolConfig {
- fn default() -> Self {
- Self {
- allowed_patterns: Vec::new(),
- ignored_patterns: Vec::new(),
- }
- }
-}
-
impl Default for InlayHintConfig {
fn default() -> Self {
Self {
diff --git a/support/texlab/crates/base-db/src/deps/graph.rs b/support/texlab/crates/base-db/src/deps/graph.rs
index e07368d078..0d8252688d 100644
--- a/support/texlab/crates/base-db/src/deps/graph.rs
+++ b/support/texlab/crates/base-db/src/deps/graph.rs
@@ -1,4 +1,4 @@
-use std::{ffi::OsStr, path::PathBuf, rc::Rc};
+use std::{ffi::OsStr, path::PathBuf, rc::Rc, sync::Arc};
use distro::Language;
use itertools::Itertools;
@@ -22,7 +22,8 @@ pub struct Edge {
#[derive(Debug, PartialEq, Eq, Clone, Hash)]
pub enum EdgeData {
- DirectLink(DirectLinkData),
+ DirectLink(Box<DirectLinkData>),
+ FileList(Arc<ProjectRoot>),
AdditionalFiles,
Artifact,
}
@@ -74,6 +75,7 @@ impl Graph {
if visited.insert(edge.target.clone()) {
let new_root = match &edge.data {
EdgeData::DirectLink(data) => data.new_root.clone(),
+ EdgeData::FileList(root) => Some(root.as_ref().clone()),
_ => None,
};
@@ -101,6 +103,10 @@ impl Graph {
self.add_direct_links(workspace, start);
self.add_artifacts(workspace, start);
self.add_additional_files(workspace, start);
+
+ if workspace.config().syntax.use_file_list {
+ self.add_file_list_links(workspace, start);
+ }
}
fn add_additional_files(&mut self, workspace: &Workspace, start: Start) {
@@ -120,6 +126,43 @@ impl Graph {
}
}
+ fn add_file_list_links(&mut self, workspace: &Workspace, start: Start) -> Option<()> {
+ let file_list = start.source.data.as_file_list()?;
+ let home_dir = HOME_DIR.as_deref();
+
+ let working_dir = file_list
+ .working_dir
+ .as_deref()
+ .and_then(|dir| Url::from_directory_path(dir).ok());
+
+ let working_dir = working_dir.as_ref().unwrap_or(&start.source.dir);
+ let new_root = Arc::new(ProjectRoot::from_config(workspace, working_dir));
+
+ for target_uri in file_list
+ .inputs
+ .iter()
+ .chain(file_list.outputs.iter())
+ .filter(|path| {
+ path.is_relative()
+ || Language::from_path(&path) == Some(Language::Bib)
+ || home_dir.map_or(false, |home_dir| path.starts_with(home_dir))
+ })
+ .filter_map(|path| working_dir.join(path.to_str()?).ok())
+ {
+ if workspace.lookup(&target_uri).is_some() {
+ self.edges.push(Edge {
+ source: start.source.uri.clone(),
+ target: target_uri,
+ data: EdgeData::FileList(Arc::clone(&new_root)),
+ });
+ } else {
+ self.missing.push(target_uri);
+ }
+ }
+
+ Some(())
+ }
+
fn add_direct_links(&mut self, workspace: &Workspace, start: Start) -> Option<()> {
let data = start.source.data.as_tex()?;
@@ -159,7 +202,7 @@ impl Graph {
for target_uri in file_names
.iter()
.flat_map(|file_name| {
- util::expand_relative_path(&file_name, &start.root.src_dir, workspace.folders())
+ util::expand_relative_path(file_name, &start.root.src_dir, workspace.folders())
})
.chain(distro_files)
{
@@ -169,7 +212,7 @@ impl Graph {
.base_dir
.as_deref()
.and_then(|path| start.root.src_dir.join(path).ok())
- .map(|dir| ProjectRoot::walk_and_find(workspace, &dir));
+ .map(|dir| ProjectRoot::from_config(workspace, &dir));
let link_data = DirectLinkData {
link: link.clone(),
@@ -179,7 +222,7 @@ impl Graph {
self.edges.push(Edge {
source: start.source.uri.clone(),
target: target.uri.clone(),
- data: EdgeData::DirectLink(link_data),
+ data: EdgeData::DirectLink(Box::new(link_data)),
});
break;
@@ -197,27 +240,33 @@ impl Graph {
}
let root = start.root;
- let relative_path = root.compile_dir.make_relative(&start.source.uri).unwrap();
-
- self.add_artifact(
- workspace,
- start.source,
- &root.aux_dir.join(&relative_path).unwrap(),
- "aux",
- );
+ self.add_artifact_group(workspace, start, &root.aux_dir, "aux");
+ self.add_artifact_group(workspace, start, &root.log_dir, "log");
+ self.add_artifact_group(workspace, start, &root.aux_dir, "fls");
+ }
- self.add_artifact(workspace, start.source, &root.aux_dir, "aux");
- self.add_artifact(workspace, start.source, &root.compile_dir, "aux");
+ fn add_artifact_group(
+ &mut self,
+ workspace: &Workspace,
+ start: Start,
+ dir: &Url,
+ extension: &str,
+ ) {
+ let relative_path = start
+ .root
+ .compile_dir
+ .make_relative(&start.source.uri)
+ .unwrap();
self.add_artifact(
workspace,
start.source,
- &root.log_dir.join(&relative_path).unwrap(),
- "log",
+ &dir.join(&relative_path).unwrap(),
+ extension,
);
- self.add_artifact(workspace, start.source, &root.log_dir, "log");
- self.add_artifact(workspace, start.source, &root.compile_dir, "log");
+ self.add_artifact(workspace, start.source, &dir, extension);
+ self.add_artifact(workspace, start.source, &start.root.compile_dir, extension);
}
fn add_artifact(
diff --git a/support/texlab/crates/base-db/src/deps/root.rs b/support/texlab/crates/base-db/src/deps/root.rs
index a8cec6604a..03fd41a9a0 100644
--- a/support/texlab/crates/base-db/src/deps/root.rs
+++ b/support/texlab/crates/base-db/src/deps/root.rs
@@ -31,11 +31,11 @@ impl ProjectRoot {
}
let Ok(parent) = current.join("..") else {
- break Self::from_config(workspace, &dir);
+ break Self::from_config(workspace, dir);
};
if current == parent || Some(&parent) == home_dir.as_ref() {
- break Self::from_config(workspace, &dir);
+ break Self::from_config(workspace, dir);
}
current = parent;
diff --git a/support/texlab/crates/base-db/src/document.rs b/support/texlab/crates/base-db/src/document.rs
index 7a388129fd..6fdcf30c16 100644
--- a/support/texlab/crates/base-db/src/document.rs
+++ b/support/texlab/crates/base-db/src/document.rs
@@ -3,7 +3,7 @@ use std::path::PathBuf;
use distro::Language;
use line_index::{LineCol, LineIndex};
use rowan::TextRange;
-use syntax::{bibtex, latex, latexmkrc::LatexmkrcData, BuildError};
+use syntax::{bibtex, file_list::FileList, latex, latexmkrc::LatexmkrcData, BuildError};
use url::Url;
use crate::{semantics, Config};
@@ -56,7 +56,10 @@ impl Document {
Language::Tex => {
let green = parser::parse_latex(&text, &params.config.syntax);
let mut semantics = semantics::tex::Semantics::default();
- semantics.process_root(&latex::SyntaxNode::new_root(green.clone()));
+ semantics.process_root(
+ &params.config.syntax,
+ &latex::SyntaxNode::new_root(green.clone()),
+ );
DocumentData::Tex(TexDocumentData { green, semantics })
}
Language::Bib => {
@@ -86,6 +89,7 @@ impl Document {
DocumentData::Latexmkrc(data)
}
Language::Tectonic => DocumentData::Tectonic,
+ Language::FileList => DocumentData::FileList(parser::parse_file_list(&text)),
};
Self {
@@ -143,6 +147,7 @@ pub enum DocumentData {
Root,
Latexmkrc(LatexmkrcData),
Tectonic,
+ FileList(FileList),
}
impl DocumentData {
@@ -185,6 +190,14 @@ impl DocumentData {
None
}
}
+
+ pub fn as_file_list(&self) -> Option<&FileList> {
+ if let DocumentData::FileList(data) = self {
+ Some(data)
+ } else {
+ None
+ }
+ }
}
#[derive(Debug, Clone)]
diff --git a/support/texlab/crates/base-db/src/semantics/auxiliary.rs b/support/texlab/crates/base-db/src/semantics/auxiliary.rs
index 489a7d1ac6..8c9fe012e6 100644
--- a/support/texlab/crates/base-db/src/semantics/auxiliary.rs
+++ b/support/texlab/crates/base-db/src/semantics/auxiliary.rs
@@ -36,7 +36,7 @@ impl Semantics {
Some(group)
})?;
- let text = group.content_text()?.replace('{', "").replace('}', "");
+ let text = group.content_text()?.replace(['{', '}'], "");
self.label_numbers.insert(name, text);
Some(())
}
diff --git a/support/texlab/crates/base-db/src/semantics/tex.rs b/support/texlab/crates/base-db/src/semantics/tex.rs
index 1ad8969a80..a1301091d4 100644
--- a/support/texlab/crates/base-db/src/semantics/tex.rs
+++ b/support/texlab/crates/base-db/src/semantics/tex.rs
@@ -3,7 +3,28 @@ use rustc_hash::FxHashSet;
use syntax::latex::{self, HasBrack, HasCurly};
use titlecase::titlecase;
+use parser::SyntaxConfig;
+
use super::Span;
+use crate::semantics::tex::latex::SyntaxToken;
+
+fn maybe_prepend_prefix(
+ map: &Vec<(String, String)>,
+ command: &Option<SyntaxToken>,
+ name: &Span,
+) -> Span {
+ match command {
+ Some(x) => Span::new(
+ map.iter()
+ .find_map(|(k, v)| if k == &x.text()[1..] { Some(v) } else { None })
+ .unwrap_or(&String::new())
+ .to_owned()
+ + &name.text,
+ name.range,
+ ),
+ None => name.clone(),
+ }
+}
#[derive(Debug, Clone, Default)]
pub struct Semantics {
@@ -19,11 +40,11 @@ pub struct Semantics {
}
impl Semantics {
- pub fn process_root(&mut self, root: &latex::SyntaxNode) {
+ pub fn process_root(&mut self, conf: &SyntaxConfig, root: &latex::SyntaxNode) {
for node in root.descendants_with_tokens() {
match node {
latex::SyntaxElement::Node(node) => {
- self.process_node(&node);
+ self.process_node(conf, &node);
}
latex::SyntaxElement::Token(token) => {
if token.kind() == latex::COMMAND_NAME {
@@ -40,17 +61,17 @@ impl Semantics {
.any(|link| link.kind == LinkKind::Cls && link.path.text == "subfiles");
}
- fn process_node(&mut self, node: &latex::SyntaxNode) {
+ fn process_node(&mut self, conf: &SyntaxConfig, node: &latex::SyntaxNode) {
if let Some(include) = latex::Include::cast(node.clone()) {
self.process_include(include);
} else if let Some(import) = latex::Import::cast(node.clone()) {
self.process_import(import);
} else if let Some(label) = latex::LabelDefinition::cast(node.clone()) {
- self.process_label_definition(label);
+ self.process_label_definition(conf, label);
} else if let Some(label) = latex::LabelReference::cast(node.clone()) {
- self.process_label_reference(label);
+ self.process_label_reference(conf, label);
} else if let Some(label) = latex::LabelReferenceRange::cast(node.clone()) {
- self.process_label_reference_range(label);
+ self.process_label_reference_range(conf, label);
} else if let Some(citation) = latex::Citation::cast(node.clone()) {
self.process_citation(citation);
} else if let Some(environment) = latex::Environment::cast(node.clone()) {
@@ -111,11 +132,16 @@ impl Semantics {
});
}
- fn process_label_definition(&mut self, label: latex::LabelDefinition) {
+ fn process_label_definition(&mut self, conf: &SyntaxConfig, label: latex::LabelDefinition) {
let Some(name) = label.name().and_then(|group| group.key()) else {
return;
};
+ let name = Span::from(&name);
+ if name.text.contains('#') {
+ return;
+ }
+
let full_range = latex::small_range(&label);
let mut objects = Vec::new();
for node in label.syntax().ancestors() {
@@ -185,46 +211,75 @@ impl Semantics {
self.labels.push(Label {
kind: LabelKind::Definition,
- name: Span::from(&name),
+ cmd: label.command().map(|x| x.text()[1..].to_string()),
+ name: maybe_prepend_prefix(&conf.label_definition_prefixes, &label.command(), &name),
targets: objects,
full_range,
});
}
- fn process_label_reference(&mut self, label: latex::LabelReference) {
+ fn process_label_reference(&mut self, conf: &SyntaxConfig, label: latex::LabelReference) {
let Some(name_list) = label.name_list() else {
return;
};
let full_range = latex::small_range(&label);
for name in name_list.keys() {
- self.labels.push(Label {
- kind: LabelKind::Reference,
- name: Span::from(&name),
- targets: Vec::new(),
- full_range,
- });
+ let name = Span::from(&name);
+ if !name.text.contains('#') {
+ self.labels.push(Label {
+ kind: LabelKind::Reference,
+ cmd: label.command().map(|x| x.text()[1..].to_string()),
+ name: maybe_prepend_prefix(
+ &conf.label_reference_prefixes,
+ &label.command(),
+ &name,
+ ),
+ targets: Vec::new(),
+ full_range,
+ });
+ }
}
}
- fn process_label_reference_range(&mut self, label: latex::LabelReferenceRange) {
+ fn process_label_reference_range(
+ &mut self,
+ conf: &SyntaxConfig,
+ label: latex::LabelReferenceRange,
+ ) {
let full_range = latex::small_range(&label);
if let Some(from) = label.from().and_then(|group| group.key()) {
- self.labels.push(Label {
- kind: LabelKind::ReferenceRange,
- name: Span::from(&from),
- targets: Vec::new(),
- full_range,
- });
+ let name = Span::from(&from);
+ if !name.text.contains('#') {
+ self.labels.push(Label {
+ kind: LabelKind::ReferenceRange,
+ cmd: label.command().map(|x| x.text()[1..].to_string()),
+ name: maybe_prepend_prefix(
+ &conf.label_reference_prefixes,
+ &label.command(),
+ &name,
+ ),
+ targets: Vec::new(),
+ full_range,
+ });
+ }
}
if let Some(to) = label.to().and_then(|group| group.key()) {
- self.labels.push(Label {
- kind: LabelKind::ReferenceRange,
- name: Span::from(&to),
- targets: Vec::new(),
- full_range,
- });
+ let name = Span::from(&to);
+ if !name.text.contains('#') {
+ self.labels.push(Label {
+ kind: LabelKind::ReferenceRange,
+ cmd: label.command().map(|x| x.text()[1..].to_string()),
+ name: maybe_prepend_prefix(
+ &conf.label_reference_prefixes,
+ &label.command(),
+ &name,
+ ),
+ targets: Vec::new(),
+ full_range,
+ });
+ }
}
}
@@ -232,10 +287,13 @@ impl Semantics {
let full_range = latex::small_range(&citation);
if let Some(list) = citation.key_list() {
for key in list.keys() {
- self.citations.push(Citation {
- name: Span::from(&key),
- full_range,
- });
+ let name = Span::from(&key);
+ if !name.text.contains('#') {
+ self.citations.push(Citation {
+ name: Span::from(&key),
+ full_range,
+ });
+ }
}
}
}
@@ -319,6 +377,7 @@ pub enum LabelKind {
#[derive(Debug, Clone)]
pub struct Label {
pub kind: LabelKind,
+ pub cmd: Option<String>,
pub name: Span,
pub targets: Vec<LabelTarget>,
pub full_range: TextRange,
diff --git a/support/texlab/crates/base-db/src/workspace.rs b/support/texlab/crates/base-db/src/workspace.rs
index 75674dcf8d..f2564ed415 100644
--- a/support/texlab/crates/base-db/src/workspace.rs
+++ b/support/texlab/crates/base-db/src/workspace.rs
@@ -99,7 +99,7 @@ impl Workspace {
Cow::Owned(text) => text,
};
- let owner = if self.distro.file_name_db.contains(&path) {
+ let owner = if self.distro.file_name_db.contains(path) {
Owner::Distro
} else {
Owner::Server
diff --git a/support/texlab/crates/bibfmt/src/lib.rs b/support/texlab/crates/bibfmt/src/lib.rs
index cfce131f2c..8840daa1c4 100644
--- a/support/texlab/crates/bibfmt/src/lib.rs
+++ b/support/texlab/crates/bibfmt/src/lib.rs
@@ -11,7 +11,7 @@ pub struct Options {
impl Options {
fn indent(&self) -> String {
if self.insert_spaces {
- std::iter::repeat(' ').take(self.tab_size).collect()
+ " ".repeat(self.tab_size)
} else {
String::from("\t")
}
@@ -126,7 +126,7 @@ impl<'a> Formatter<'a> {
}
bibtex::FIELD => {
let field = bibtex::Field::cast(parent).unwrap();
- self.output.push_str(&self.indent);
+ self.output.push_str(self.indent);
let name = field.name_token().unwrap();
self.output.push_str(name.text());
self.output.push_str(" = ");
@@ -160,7 +160,7 @@ impl<'a> Formatter<'a> {
if length + current_length + space_length > self.options.line_length {
self.output.push('\n');
self.output.push_str(self.indent.as_ref());
- for _ in 0..=align - self.options.tab_size as usize {
+ for _ in 0..=align - self.options.tab_size {
self.output.push(' ');
}
length = align;
diff --git a/support/texlab/crates/bibtex-utils/Cargo.toml b/support/texlab/crates/bibtex-utils/Cargo.toml
index 97e13517f5..88ba2d3a37 100644
--- a/support/texlab/crates/bibtex-utils/Cargo.toml
+++ b/support/texlab/crates/bibtex-utils/Cargo.toml
@@ -7,11 +7,11 @@ edition.workspace = true
rust-version.workspace = true
[dependencies]
-chrono = { version = "0.4.26", default-features = false, features = ["std"] }
+chrono = { version = "0.4.38", default-features = false, features = ["std"] }
human_name = "2.0.3"
-itertools = "0.12.1"
+itertools = "0.13.0"
rowan = "0.15.15"
-rustc-hash = "1.1.0"
+rustc-hash = "2.0.0"
syntax = { path = "../syntax" }
unicode-normalization = "0.1.23"
diff --git a/support/texlab/crates/citeproc/Cargo.toml b/support/texlab/crates/citeproc/Cargo.toml
index 9e187f88e6..c87ab14b0e 100644
--- a/support/texlab/crates/citeproc/Cargo.toml
+++ b/support/texlab/crates/citeproc/Cargo.toml
@@ -10,9 +10,9 @@ rust-version.workspace = true
bibtex-utils = { path = "../bibtex-utils" }
base-db = { path = "../base-db" }
isocountry = "0.3.2"
-itertools = "0.12.1"
+itertools = "0.13.0"
rowan = "0.15.15"
-rustc-hash = "1.1.0"
+rustc-hash = "2.0.0"
syntax = { path = "../syntax" }
titlecase = "3.0.0"
unicode-normalization = "0.1.23"
diff --git a/support/texlab/crates/commands/Cargo.toml b/support/texlab/crates/commands/Cargo.toml
index c726e5f0d5..6507efb3b8 100644
--- a/support/texlab/crates/commands/Cargo.toml
+++ b/support/texlab/crates/commands/Cargo.toml
@@ -7,17 +7,17 @@ edition.workspace = true
rust-version.workspace = true
[dependencies]
-anyhow = "1.0.82"
+anyhow = "1.0.86"
base-db = { path = "../base-db" }
bstr = "1.9.1"
-crossbeam-channel = "0.5.12"
-itertools = "0.12.1"
-libc = "0.2.153"
-log = "0.4.21"
+crossbeam-channel = "0.5.13"
+itertools = "0.13.0"
+libc = "0.2.155"
+log = "0.4.22"
rowan = "0.15.15"
-rustc-hash = "1.1.0"
+rustc-hash = "2.0.0"
syntax = { path = "../syntax" }
-thiserror = "1.0.59"
+thiserror = "1.0.61"
url = "2.5.0"
[dev-dependencies]
diff --git a/support/texlab/crates/commands/src/dep_graph.rs b/support/texlab/crates/commands/src/dep_graph.rs
index fe9ff3829c..86b49da0ac 100644
--- a/support/texlab/crates/commands/src/dep_graph.rs
+++ b/support/texlab/crates/commands/src/dep_graph.rs
@@ -48,6 +48,7 @@ pub fn show_dependency_graph(workspace: &Workspace) -> Result<String> {
base_db::deps::EdgeData::DirectLink(data) => &data.link.path.text,
base_db::deps::EdgeData::AdditionalFiles => "<project>",
base_db::deps::EdgeData::Artifact => "<artifact>",
+ base_db::deps::EdgeData::FileList(_) => "<fls>",
};
writeln!(&mut writer, "\t{source} -> {target} [label=\"{label}\"];")?;
diff --git a/support/texlab/crates/commands/src/find_envs.rs b/support/texlab/crates/commands/src/find_envs.rs
index 7a17345d80..1ea88657ab 100644
--- a/support/texlab/crates/commands/src/find_envs.rs
+++ b/support/texlab/crates/commands/src/find_envs.rs
@@ -53,7 +53,7 @@ mod tests {
let workspace = fixture.workspace;
let document = workspace.iter().next().unwrap();
let offset = fixture.documents[0].cursor.unwrap();
- let results = find_environments(&document, offset);
+ let results = find_environments(document, offset);
expect.assert_debug_eq(&results);
}
diff --git a/support/texlab/crates/commands/src/fwd_search.rs b/support/texlab/crates/commands/src/fwd_search.rs
index f1991cd48e..f3480ef3e2 100644
--- a/support/texlab/crates/commands/src/fwd_search.rs
+++ b/support/texlab/crates/commands/src/fwd_search.rs
@@ -103,7 +103,7 @@ impl ForwardSearch {
})
.ok_or_else(|| ForwardSearchError::InvalidPath(document.uri.clone()))?;
- let pdf_path = pdf_dir.join(&pdf_name);
+ let pdf_path = pdf_dir.join(pdf_name);
let pdf_exists = pdf_path.exists();
log::debug!("[FwdSearch] pdf_path={pdf_path:?}, pdf_exists={pdf_exists}");
diff --git a/support/texlab/crates/commands/src/placeholders.rs b/support/texlab/crates/commands/src/placeholders.rs
index 9994420f5d..328a95773a 100644
--- a/support/texlab/crates/commands/src/placeholders.rs
+++ b/support/texlab/crates/commands/src/placeholders.rs
@@ -45,6 +45,6 @@ mod tests {
&[('f', "foo")],
);
- assert_eq!(output, vec!["foo".into(), "%f", "%f".into(), "foobar"]);
+ assert_eq!(output, vec!["foo", "%f", "%f", "foobar"]);
}
}
diff --git a/support/texlab/crates/completion-data/Cargo.toml b/support/texlab/crates/completion-data/Cargo.toml
index 59b707e474..6dbb7d4086 100644
--- a/support/texlab/crates/completion-data/Cargo.toml
+++ b/support/texlab/crates/completion-data/Cargo.toml
@@ -7,12 +7,12 @@ edition.workspace = true
rust-version.workspace = true
[dependencies]
-flate2 = "1.0.29"
-itertools = "0.12.1"
+flate2 = "1.0.30"
+itertools = "0.13.0"
once_cell = "1.19.0"
-rustc-hash = "1.1.0"
-serde = { version = "1.0.195", features = ["derive"] }
-serde_json = "1.0.115"
+rustc-hash = "2.0.0"
+serde = { version = "1.0.203", features = ["derive"] }
+serde_json = "1.0.119"
[lib]
doctest = false
diff --git a/support/texlab/crates/completion/Cargo.toml b/support/texlab/crates/completion/Cargo.toml
index e28e04dfc7..f98f12260b 100644
--- a/support/texlab/crates/completion/Cargo.toml
+++ b/support/texlab/crates/completion/Cargo.toml
@@ -13,7 +13,7 @@ fuzzy-matcher = { version = "0.3.7", features = ["compact"] }
line-index = { path = "../line-index" }
rayon = "1.10.0"
rowan = "0.15.15"
-rustc-hash = "1.1.0"
+rustc-hash = "2.0.0"
syntax = { path = "../syntax" }
url = "2.5.0"
@@ -22,6 +22,7 @@ criterion = "0.5.1"
distro = { path = "../distro" }
expect-test = "1.5.0"
test-utils = { path = "../test-utils" }
+parser = { path = "../parser" }
[lib]
doctest = false
diff --git a/support/texlab/crates/completion/src/lib.rs b/support/texlab/crates/completion/src/lib.rs
index 7fc5bba174..5bfd94d944 100644
--- a/support/texlab/crates/completion/src/lib.rs
+++ b/support/texlab/crates/completion/src/lib.rs
@@ -72,12 +72,12 @@ impl<'a> CompletionItemData<'a> {
Self::Citation(data) => &data.entry.name.text,
Self::Environment(data) => data.name,
Self::GlossaryEntry(data) => &data.name,
- Self::Label(data) => data.name,
+ Self::Label(data) => &data.name,
Self::Color(name) => name,
Self::ColorModel(name) => name,
- Self::File(name) => &name,
- Self::Directory(name) => &name,
- Self::Argument(data) => &data.0.name,
+ Self::File(name) => name,
+ Self::Directory(name) => name,
+ Self::Argument(data) => data.0.name,
Self::Package(name) => name,
Self::DocumentClass(name) => name,
Self::EntryType(data) => data.0.name,
diff --git a/support/texlab/crates/completion/src/providers/argument.rs b/support/texlab/crates/completion/src/providers/argument.rs
index 6637cecdd6..a9c8f4304b 100644
--- a/support/texlab/crates/completion/src/providers/argument.rs
+++ b/support/texlab/crates/completion/src/providers/argument.rs
@@ -37,7 +37,7 @@ pub fn complete_arguments<'a>(
.filter(|(i, _)| *i == index)
{
for arg in &param.0 {
- if let Some(score) = builder.matcher.score(&arg.name, &cursor.text) {
+ if let Some(score) = builder.matcher.score(arg.name, &cursor.text) {
let data = CompletionItemData::Argument(ArgumentData(arg));
builder
.items
diff --git a/support/texlab/crates/completion/src/providers/color.rs b/support/texlab/crates/completion/src/providers/color.rs
index cbdd38dc32..8be1b50555 100644
--- a/support/texlab/crates/completion/src/providers/color.rs
+++ b/support/texlab/crates/completion/src/providers/color.rs
@@ -14,7 +14,7 @@ pub fn complete_colors<'a>(
latex::ColorReference::cast(group.syntax().parent()?)?;
for name in COLORS {
- if let Some(score) = builder.matcher.score(&name, &cursor.text) {
+ if let Some(score) = builder.matcher.score(name, &cursor.text) {
let data = CompletionItemData::Color(name);
builder
.items
diff --git a/support/texlab/crates/completion/src/providers/color_model.rs b/support/texlab/crates/completion/src/providers/color_model.rs
index 4b991c4807..80970b1913 100644
--- a/support/texlab/crates/completion/src/providers/color_model.rs
+++ b/support/texlab/crates/completion/src/providers/color_model.rs
@@ -14,7 +14,7 @@ pub fn complete_color_models<'a>(
let cursor = check_color_definition(params).or_else(|| check_color_definition_set(params))?;
for name in MODEL_NAMES {
- if let Some(score) = builder.matcher.score(&name, &cursor.text) {
+ if let Some(score) = builder.matcher.score(name, &cursor.text) {
let data = CompletionItemData::ColorModel(name);
builder
.items
diff --git a/support/texlab/crates/completion/src/providers/command.rs b/support/texlab/crates/completion/src/providers/command.rs
index f404d42ab3..34f8876e1f 100644
--- a/support/texlab/crates/completion/src/providers/command.rs
+++ b/support/texlab/crates/completion/src/providers/command.rs
@@ -44,7 +44,7 @@ impl<'a, 'b> Processor<'a, 'b> {
pub fn add_delimiters(&mut self) {
for (left, right) in DELIMITERS {
- let Some(score) = self.0.builder.matcher.score(&left, &self.0.cursor.text) else {
+ let Some(score) = self.0.builder.matcher.score(left, &self.0.cursor.text) else {
continue;
};
@@ -68,7 +68,7 @@ impl<'a, 'b> Processor<'a, 'b> {
let data = CompletionItemData::Command(CommandData {
name: &command.name,
glyph: command.glyph.as_deref(),
- image: command.image.as_deref(),
+ image: command.image,
package: Some(package),
});
diff --git a/support/texlab/crates/completion/src/providers/environment.rs b/support/texlab/crates/completion/src/providers/environment.rs
index 393dd100ba..b56377550e 100644
--- a/support/texlab/crates/completion/src/providers/environment.rs
+++ b/support/texlab/crates/completion/src/providers/environment.rs
@@ -21,7 +21,7 @@ pub fn complete_environments<'a>(
.and_then(|env| env.begin())
.and_then(|begin| begin.name())
.and_then(|name| name.key())
- .map_or_else(|| String::new(), |name| name.to_string());
+ .map_or_else(String::new, |name| name.to_string());
let mut proc = Processor {
inner: ProviderContext {
@@ -48,7 +48,7 @@ impl<'a, 'b> Processor<'a, 'b> {
for package in included_packages(&self.inner.params.feature) {
let envs_with_score = package.environments.iter().filter_map(|env| {
let matcher = &self.inner.builder.matcher;
- let score = matcher.score(&env, &self.inner.cursor.text)?;
+ let score = matcher.score(env, &self.inner.cursor.text)?;
Some((*env, score))
});
@@ -76,7 +76,7 @@ impl<'a, 'b> Processor<'a, 'b> {
{
let matcher = &self.inner.builder.matcher;
let name = theorem.name.text.as_str();
- if let Some(score) = matcher.score(&name, &self.inner.cursor.text) {
+ if let Some(score) = matcher.score(name, &self.inner.cursor.text) {
let data = CompletionItemData::Environment(EnvironmentData {
name,
package: None,
diff --git a/support/texlab/crates/completion/src/providers/glossary.rs b/support/texlab/crates/completion/src/providers/glossary.rs
index c22f5b5888..d01d62a511 100644
--- a/support/texlab/crates/completion/src/providers/glossary.rs
+++ b/support/texlab/crates/completion/src/providers/glossary.rs
@@ -58,7 +58,7 @@ impl<'a, 'b> Processor<'a, 'b> {
for name in data
.root_node()
.descendants()
- .filter_map(|node| extract(node))
+ .filter_map(&extract)
.filter_map(|name| name.key())
.map(|name| name.to_string())
{
diff --git a/support/texlab/crates/completion/src/providers/import.rs b/support/texlab/crates/completion/src/providers/import.rs
index c506026a99..c0f608f9d2 100644
--- a/support/texlab/crates/completion/src/providers/import.rs
+++ b/support/texlab/crates/completion/src/providers/import.rs
@@ -29,13 +29,13 @@ pub fn complete_imports<'a>(
file_names.insert(file_name);
let stem = &file_name[0..file_name.len() - 4];
if kind == latex::PACKAGE_INCLUDE {
- if let Some(score) = builder.matcher.score(&stem, &cursor.text) {
+ if let Some(score) = builder.matcher.score(stem, &cursor.text) {
let data = CompletionItemData::Package(stem);
builder
.items
.push(CompletionItem::new_simple(score, cursor.range, data));
}
- } else if let Some(score) = builder.matcher.score(&stem, &cursor.text) {
+ } else if let Some(score) = builder.matcher.score(stem, &cursor.text) {
let data = CompletionItemData::DocumentClass(stem);
builder
.items
@@ -51,13 +51,13 @@ pub fn complete_imports<'a>(
{
let stem = &file_name[0..file_name.len() - 4];
if kind == latex::PACKAGE_INCLUDE {
- if let Some(score) = builder.matcher.score(&stem, &cursor.text) {
+ if let Some(score) = builder.matcher.score(stem, &cursor.text) {
let data = CompletionItemData::Package(stem);
builder
.items
.push(CompletionItem::new_simple(score, cursor.range, data));
}
- } else if let Some(score) = builder.matcher.score(&stem, &cursor.text) {
+ } else if let Some(score) = builder.matcher.score(stem, &cursor.text) {
let data = CompletionItemData::DocumentClass(stem);
builder
.items
diff --git a/support/texlab/crates/completion/src/providers/include.rs b/support/texlab/crates/completion/src/providers/include.rs
index 60c432d097..d0a042252f 100644
--- a/support/texlab/crates/completion/src/providers/include.rs
+++ b/support/texlab/crates/completion/src/providers/include.rs
@@ -19,9 +19,7 @@ pub fn complete_includes<'a>(
params: &'a CompletionParams<'a>,
builder: &mut CompletionBuilder<'a>,
) -> Option<()> {
- if params.feature.document.path.is_none() {
- return None;
- }
+ params.feature.document.path.as_ref()?;
let (cursor, group) = find_curly_group_word_list(params)?;
@@ -115,7 +113,7 @@ fn current_dir(
graphics_path: Option<&str>,
) -> Option<PathBuf> {
let workspace = &params.workspace;
- let parent = deps::parents(&workspace, params.document)
+ let parent = deps::parents(workspace, params.document)
.iter()
.next()
.map_or(params.document, Clone::clone);
diff --git a/support/texlab/crates/completion/src/providers/label_ref.rs b/support/texlab/crates/completion/src/providers/label_ref.rs
index 6f71ae3241..8b262f13ca 100644
--- a/support/texlab/crates/completion/src/providers/label_ref.rs
+++ b/support/texlab/crates/completion/src/providers/label_ref.rs
@@ -11,12 +11,30 @@ use crate::{
CompletionItem, CompletionItemData, CompletionParams,
};
+fn trim_prefix<'a>(prefix: Option<&'a str>, text: &'a str) -> &'a str {
+ prefix
+ .and_then(|pref| text.strip_prefix(pref))
+ .unwrap_or(text)
+}
+
pub fn complete_label_references<'a>(
params: &'a CompletionParams<'a>,
builder: &mut CompletionBuilder<'a>,
) -> Option<()> {
- let FindResult { cursor, is_math } =
- find_reference(params).or_else(|| find_reference_range(params))?;
+ let FindResult {
+ cursor,
+ is_math,
+ command,
+ } = find_reference(params).or_else(|| find_reference_range(params))?;
+ let ref_pref = params
+ .feature
+ .workspace
+ .config()
+ .syntax
+ .label_reference_prefixes
+ .iter()
+ .find_map(|(k, v)| if *k == command { Some(v) } else { None })
+ .map(|x| x.as_str());
for document in &params.feature.project.documents {
let DocumentData::Tex(data) = &document.data else {
@@ -29,6 +47,10 @@ pub fn complete_label_references<'a>(
.iter()
.filter(|label| label.kind == LabelKind::Definition)
{
+ if ref_pref.map_or(false, |pref| !label.name.text.starts_with(pref)) {
+ continue;
+ }
+ let labeltext = trim_prefix(ref_pref, &label.name.text);
match render_label(params.feature.workspace, &params.feature.project, label) {
Some(rendered_label) => {
if is_math && !matches!(rendered_label.object, RenderedObject::Equation) {
@@ -41,11 +63,12 @@ pub fn complete_label_references<'a>(
_ => None,
};
- let keywords = format!("{} {}", label.name.text, rendered_label.reference());
+ let keywords = format!("{} {}", labeltext, rendered_label.reference());
if let Some(score) = builder.matcher.score(&keywords, &cursor.text) {
+ let name = trim_prefix(ref_pref, &label.name.text);
let data = CompletionItemData::Label(crate::LabelData {
- name: &label.name.text,
+ name,
header,
footer,
object: Some(rendered_label.object),
@@ -59,12 +82,13 @@ pub fn complete_label_references<'a>(
}
None => {
if let Some(score) = builder.matcher.score(&label.name.text, &cursor.text) {
+ let name = trim_prefix(ref_pref, &label.name.text);
let data = CompletionItemData::Label(crate::LabelData {
- name: &label.name.text,
+ name,
header: None,
footer: None,
object: None,
- keywords: label.name.text.clone(),
+ keywords: labeltext.to_string(),
});
builder
@@ -82,20 +106,26 @@ pub fn complete_label_references<'a>(
struct FindResult {
cursor: Span,
is_math: bool,
+ command: String,
}
fn find_reference(params: &CompletionParams) -> Option<FindResult> {
let (cursor, group) = find_curly_group_word_list(params)?;
let reference = latex::LabelReference::cast(group.syntax().parent()?)?;
let is_math = reference.command()?.text() == "\\eqref";
- Some(FindResult { cursor, is_math })
+ Some(FindResult {
+ cursor,
+ is_math,
+ command: reference.command()?.text()[1..].to_string(),
+ })
}
fn find_reference_range(params: &CompletionParams) -> Option<FindResult> {
let (cursor, group) = find_curly_group_word(params)?;
- latex::LabelReferenceRange::cast(group.syntax().parent()?)?;
+ let refrange = latex::LabelReferenceRange::cast(group.syntax().parent()?)?;
Some(FindResult {
cursor,
is_math: false,
+ command: refrange.command()?.text()[1..].to_string(),
})
}
diff --git a/support/texlab/crates/completion/src/providers/tikz_library.rs b/support/texlab/crates/completion/src/providers/tikz_library.rs
index 10a0aa44ba..4c3d7e8955 100644
--- a/support/texlab/crates/completion/src/providers/tikz_library.rs
+++ b/support/texlab/crates/completion/src/providers/tikz_library.rs
@@ -21,7 +21,7 @@ pub fn complete_tikz_libraries<'a>(
};
for name in libraries {
- if let Some(score) = builder.matcher.score(&name, &cursor.text) {
+ if let Some(score) = builder.matcher.score(name, &cursor.text) {
let data = CompletionItemData::TikzLibrary(name);
builder
.items
diff --git a/support/texlab/crates/completion/src/tests.rs b/support/texlab/crates/completion/src/tests.rs
index c6bed6e08e..8c68b71dd9 100644
--- a/support/texlab/crates/completion/src/tests.rs
+++ b/support/texlab/crates/completion/src/tests.rs
@@ -1,11 +1,17 @@
-use base_db::FeatureParams;
+use base_db::{Config, FeatureParams};
use expect_test::{expect, Expect};
+use parser::SyntaxConfig;
use rowan::TextRange;
use crate::CompletionParams;
-fn check(input: &str, expect: Expect) {
- let fixture = test_utils::fixture::Fixture::parse(input);
+fn check_with_syntax_config(config: SyntaxConfig, input: &str, expect: Expect) {
+ let mut fixture = test_utils::fixture::Fixture::parse(input);
+ fixture.workspace.set_config(Config {
+ syntax: config,
+ ..Config::default()
+ });
+ let fixture = fixture;
let (offset, spec) = fixture
.documents
@@ -37,6 +43,10 @@ fn check(input: &str, expect: Expect) {
expect.assert_debug_eq(&items);
}
+fn check(input: &str, expect: Expect) {
+ check_with_syntax_config(SyntaxConfig::default(), input, expect)
+}
+
#[test]
fn acronym_ref_simple() {
check(
@@ -2134,3 +2144,200 @@ fn issue_885() {
"#]],
);
}
+
+#[test]
+fn test_custom_label_prefix_ref() {
+ let mut config = SyntaxConfig::default();
+ config.label_definition_commands.insert("asm".to_string());
+ config
+ .label_definition_prefixes
+ .push(("asm".to_string(), "asm:".to_string()));
+
+ check_with_syntax_config(
+ config,
+ r#"
+%! main.tex
+ \begin{enumerate}\label{baz}
+ \asm{foo}{what}
+ \end{enumerate}
+
+ \ref{}
+ |
+% Comment"#,
+ expect![[r#"
+ [
+ Label(
+ LabelData {
+ name: "asm:foo",
+ header: None,
+ footer: None,
+ object: None,
+ keywords: "asm:foo",
+ },
+ ),
+ Label(
+ LabelData {
+ name: "baz",
+ header: None,
+ footer: None,
+ object: None,
+ keywords: "baz",
+ },
+ ),
+ ]
+ "#]],
+ );
+}
+
+#[test]
+fn test_custom_label_prefix_custom_ref() {
+ let mut config = SyntaxConfig::default();
+ config.label_definition_commands.insert("asm".to_string());
+ config
+ .label_definition_prefixes
+ .push(("asm".to_string(), "asm:".to_string()));
+ config.label_reference_commands.insert("asmref".to_string());
+ config
+ .label_reference_prefixes
+ .push(("asmref".to_string(), "asm:".to_string()));
+
+ check_with_syntax_config(
+ config,
+ r#"
+%! main.tex
+ \begin{enumerate}\label{baz}
+ \asm{foo}{what}
+ \end{enumerate}
+
+ \asmref{}
+ |
+% Comment"#,
+ expect![[r#"
+ [
+ Label(
+ LabelData {
+ name: "foo",
+ header: None,
+ footer: None,
+ object: None,
+ keywords: "foo",
+ },
+ ),
+ ]
+ "#]],
+ );
+}
+
+#[test]
+fn test_custom_label_multiple_prefix_custom_ref() {
+ let mut config = SyntaxConfig::default();
+ config
+ .label_definition_commands
+ .extend(vec!["asm", "goal"].into_iter().map(String::from));
+ config.label_definition_prefixes.extend(
+ vec![("asm", "asm:"), ("goal", "goal:")]
+ .into_iter()
+ .map(|(x, y)| (String::from(x), String::from(y))),
+ );
+ config
+ .label_reference_commands
+ .extend(vec!["asmref", "goalref"].into_iter().map(String::from));
+ config.label_reference_prefixes.extend(
+ vec![("asmref", "asm:"), ("goalref", "goal:")]
+ .into_iter()
+ .map(|(x, y)| (String::from(x), String::from(y))),
+ );
+
+ check_with_syntax_config(
+ config,
+ r#"
+%! main.tex
+ \begin{enumerate}\label{baz}
+ \asm{foo}{what}
+ \goal{foo}{what}
+ \end{enumerate}
+
+ \goalref{}
+ |
+% Comment"#,
+ expect![[r#"
+ [
+ Label(
+ LabelData {
+ name: "foo",
+ header: None,
+ footer: None,
+ object: None,
+ keywords: "foo",
+ },
+ ),
+ ]
+ "#]],
+ );
+}
+
+#[test]
+fn test_custom_label_multiple_prefix_ref() {
+ let mut config = SyntaxConfig::default();
+ config
+ .label_definition_commands
+ .extend(vec!["asm", "goal"].into_iter().map(String::from));
+ config.label_definition_prefixes.extend(
+ vec![("asm", "asm:"), ("goal", "goal:")]
+ .into_iter()
+ .map(|(x, y)| (String::from(x), String::from(y))),
+ );
+ config
+ .label_reference_commands
+ .extend(vec!["asmref", "goalref"].into_iter().map(String::from));
+ config.label_reference_prefixes.extend(
+ vec![("asmref", "asm:"), ("goalref", "goal:")]
+ .into_iter()
+ .map(|(x, y)| (String::from(x), String::from(y))),
+ );
+
+ check_with_syntax_config(
+ config,
+ r#"
+%! main.tex
+ \begin{enumerate}\label{baz}
+ \asm{foo}{what}
+ \goal{foo}{what}
+ \end{enumerate}
+
+ \ref{}
+ |
+% Comment"#,
+ expect![[r#"
+ [
+ Label(
+ LabelData {
+ name: "asm:foo",
+ header: None,
+ footer: None,
+ object: None,
+ keywords: "asm:foo",
+ },
+ ),
+ Label(
+ LabelData {
+ name: "baz",
+ header: None,
+ footer: None,
+ object: None,
+ keywords: "baz",
+ },
+ ),
+ Label(
+ LabelData {
+ name: "goal:foo",
+ header: None,
+ footer: None,
+ object: None,
+ keywords: "goal:foo",
+ },
+ ),
+ ]
+ "#]],
+ );
+}
diff --git a/support/texlab/crates/definition/Cargo.toml b/support/texlab/crates/definition/Cargo.toml
index 63ba15c308..254bea0314 100644
--- a/support/texlab/crates/definition/Cargo.toml
+++ b/support/texlab/crates/definition/Cargo.toml
@@ -9,11 +9,11 @@ rust-version.workspace = true
[dependencies]
base-db = { path = "../base-db" }
rowan = "0.15.15"
-rustc-hash = "1.1.0"
+rustc-hash = "2.0.0"
syntax = { path = "../syntax" }
[dev-dependencies]
-itertools = "0.12.1"
+itertools = "0.13.0"
test-utils = { path = "../test-utils" }
[lib]
diff --git a/support/texlab/crates/definition/src/command.rs b/support/texlab/crates/definition/src/command.rs
index 3681cdbaa0..ea7ef8c2c2 100644
--- a/support/texlab/crates/definition/src/command.rs
+++ b/support/texlab/crates/definition/src/command.rs
@@ -28,13 +28,11 @@ pub(super) fn goto_definition(context: &mut DefinitionContext) -> Option<()> {
process_old_definition(node.clone()).or_else(|| process_new_definition(node))
})
.filter(|(_, command)| command.text() == name.text())
- .filter_map(|(target_range, command)| {
- Some(DefinitionResult {
- origin_selection_range,
- target: document,
- target_range,
- target_selection_range: command.text_range(),
- })
+ .map(|(target_range, command)| DefinitionResult {
+ origin_selection_range,
+ target: document,
+ target_range,
+ target_selection_range: command.text_range(),
});
context.results.extend(results);
diff --git a/support/texlab/crates/definition/src/tests.rs b/support/texlab/crates/definition/src/tests.rs
index 26f7c0dc3a..0b3f7fa7cc 100644
--- a/support/texlab/crates/definition/src/tests.rs
+++ b/support/texlab/crates/definition/src/tests.rs
@@ -11,7 +11,7 @@ fn check(input: &str) {
.locations()
.filter(|location| location.document == origin_document)
.find(|location| location.range.contains_inclusive(offset))
- .map_or_else(|| TextRange::default(), |location| location.range);
+ .map_or_else(TextRange::default, |location| location.range);
let mut expected = FxHashSet::default();
for document in &fixture.documents {
diff --git a/support/texlab/crates/diagnostics/Cargo.toml b/support/texlab/crates/diagnostics/Cargo.toml
index 1cb09fdec9..37e39280ad 100644
--- a/support/texlab/crates/diagnostics/Cargo.toml
+++ b/support/texlab/crates/diagnostics/Cargo.toml
@@ -10,14 +10,14 @@ rust-version.workspace = true
base-db = { path = "../base-db" }
encoding_rs = "0.8.34"
encoding_rs_io = "0.1.7"
-itertools = "0.12.1"
+itertools = "0.13.0"
line-index = { path = "../line-index" }
-log = "0.4.21"
+log = "0.4.22"
multimap = "0.10.0"
once_cell = "1.19.0"
-regex = "1.10.4"
+regex = "1.10.5"
rowan = "0.15.15"
-rustc-hash = "1.1.0"
+rustc-hash = "2.0.0"
syntax = { path = "../syntax" }
url = "2.5.0"
diff --git a/support/texlab/crates/diagnostics/src/chktex.rs b/support/texlab/crates/diagnostics/src/chktex.rs
index 195ea968e5..a3f539440d 100644
--- a/support/texlab/crates/diagnostics/src/chktex.rs
+++ b/support/texlab/crates/diagnostics/src/chktex.rs
@@ -74,7 +74,7 @@ impl Command {
.build(stdout),
);
- for line in reader.lines().flatten() {
+ for line in reader.lines().map_while(Result::ok) {
let captures = LINE_REGEX.captures(&line).unwrap();
let line = captures[1].parse::<u32>().unwrap() - 1;
let character = captures[2].parse::<u32>().unwrap() - 1;
diff --git a/support/texlab/crates/diagnostics/src/citations.rs b/support/texlab/crates/diagnostics/src/citations.rs
index 0f09f589be..43d5f495d2 100644
--- a/support/texlab/crates/diagnostics/src/citations.rs
+++ b/support/texlab/crates/diagnostics/src/citations.rs
@@ -24,7 +24,7 @@ pub fn detect_undefined_citations<'a>(
for citation in &data.semantics.citations {
let name = citation.name_text();
- if name != "*" && !entries.contains(name) && !name.contains("#") {
+ if name != "*" && !entries.contains(name) {
let diagnostic = Diagnostic::Tex(citation.name.range, TexError::UndefinedCitation);
results
.entry(document.uri.clone())
@@ -65,8 +65,8 @@ pub fn detect_unused_entries<'a>(
Some(())
}
-pub fn detect_duplicate_entries<'a>(
- workspace: &'a Workspace,
+pub fn detect_duplicate_entries(
+ workspace: &Workspace,
results: &mut FxHashMap<Url, Vec<Diagnostic>>,
) {
for conflict in queries::Conflict::find_all::<Entry>(workspace) {
diff --git a/support/texlab/crates/diagnostics/src/manager.rs b/support/texlab/crates/diagnostics/src/manager.rs
index 3573bc40f2..500dc99c13 100644
--- a/support/texlab/crates/diagnostics/src/manager.rs
+++ b/support/texlab/crates/diagnostics/src/manager.rs
@@ -89,16 +89,12 @@ impl Manager {
let config = &workspace.config().diagnostics;
- results.retain(|uri, _| {
- workspace
- .lookup(uri)
- .map_or(false, |document| Self::is_relevant(document))
- });
+ results.retain(|uri, _| workspace.lookup(uri).map_or(false, Self::is_relevant));
- for (_, diagnostics) in &mut results {
+ for diagnostics in results.values_mut() {
diagnostics.retain(|diagnostic| {
filter_regex_patterns(
- &diagnostic.message(),
+ diagnostic.message(),
&config.allowed_patterns,
&config.ignored_patterns,
)
diff --git a/support/texlab/crates/diagnostics/src/tests.rs b/support/texlab/crates/diagnostics/src/tests.rs
index 3688abeaf4..05ad67fc8b 100644
--- a/support/texlab/crates/diagnostics/src/tests.rs
+++ b/support/texlab/crates/diagnostics/src/tests.rs
@@ -6,14 +6,14 @@ fn check(input: &str, expect: Expect) {
let mut manager = crate::Manager::default();
for document in fixture.workspace.iter() {
- manager.update_syntax(&fixture.workspace, &document);
+ manager.update_syntax(&fixture.workspace, document);
}
let results = manager.get(&fixture.workspace);
let results = results
.iter()
.filter(|(_, diags)| !diags.is_empty())
- .sorted_by(|(uri1, _), (uri2, _)| uri1.cmp(&uri2))
+ .sorted_by(|(uri1, _), (uri2, _)| uri1.cmp(uri2))
.map(|(uri, diags)| (uri.as_str(), diags))
.collect_vec();
diff --git a/support/texlab/crates/distro/Cargo.toml b/support/texlab/crates/distro/Cargo.toml
index eefcea2b49..c81288e86e 100644
--- a/support/texlab/crates/distro/Cargo.toml
+++ b/support/texlab/crates/distro/Cargo.toml
@@ -7,8 +7,8 @@ edition.workspace = true
rust-version.workspace = true
[dependencies]
-anyhow = "1.0.82"
-rustc-hash = "1.1.0"
+anyhow = "1.0.86"
+rustc-hash = "2.0.0"
[lib]
doctest = false
diff --git a/support/texlab/crates/distro/src/language.rs b/support/texlab/crates/distro/src/language.rs
index 201ed0702b..0a94a93604 100644
--- a/support/texlab/crates/distro/src/language.rs
+++ b/support/texlab/crates/distro/src/language.rs
@@ -9,6 +9,7 @@ pub enum Language {
Root,
Latexmkrc,
Tectonic,
+ FileList,
}
impl Language {
@@ -32,6 +33,7 @@ impl Language {
"bib" | "bibtex" => Some(Self::Bib),
"aux" => Some(Self::Aux),
"log" => Some(Self::Log),
+ "fls" => Some(Self::FileList),
_ => None,
}
}
diff --git a/support/texlab/crates/highlights/src/lib.rs b/support/texlab/crates/highlights/src/lib.rs
index 009dd20807..9d7a63b096 100644
--- a/support/texlab/crates/highlights/src/lib.rs
+++ b/support/texlab/crates/highlights/src/lib.rs
@@ -23,7 +23,7 @@ pub struct HighlightParams<'a> {
pub fn find_all(params: &HighlightParams) -> Vec<Highlight> {
let mut results = Vec::new();
- label::find_highlights(&params, &mut results);
+ label::find_highlights(params, &mut results);
results
}
diff --git a/support/texlab/crates/hover/src/lib.rs b/support/texlab/crates/hover/src/lib.rs
index 2d22d50b0b..dcf4d442a9 100644
--- a/support/texlab/crates/hover/src/lib.rs
+++ b/support/texlab/crates/hover/src/lib.rs
@@ -35,12 +35,12 @@ pub enum HoverData<'db> {
}
pub fn find<'a>(params: &HoverParams<'a>) -> Option<Hover<'a>> {
- citation::find_hover(&params)
- .or_else(|| package::find_hover(&params))
- .or_else(|| entry_type::find_hover(&params))
- .or_else(|| field_type::find_hover(&params))
- .or_else(|| label::find_hover(&params))
- .or_else(|| string_ref::find_hover(&params))
+ citation::find_hover(params)
+ .or_else(|| package::find_hover(params))
+ .or_else(|| entry_type::find_hover(params))
+ .or_else(|| field_type::find_hover(params))
+ .or_else(|| label::find_hover(params))
+ .or_else(|| string_ref::find_hover(params))
}
#[cfg(test)]
diff --git a/support/texlab/crates/inlay-hints/Cargo.toml b/support/texlab/crates/inlay-hints/Cargo.toml
index ede4ca6188..94651ef4c7 100644
--- a/support/texlab/crates/inlay-hints/Cargo.toml
+++ b/support/texlab/crates/inlay-hints/Cargo.toml
@@ -9,7 +9,7 @@ rust-version.workspace = true
[dependencies]
base-db = { path = "../base-db" }
rowan = "0.15.15"
-rustc-hash = "1.1.0"
+rustc-hash = "2.0.0"
[dev-dependencies]
test-utils = { path = "../test-utils" }
diff --git a/support/texlab/crates/inlay-hints/src/label.rs b/support/texlab/crates/inlay-hints/src/label.rs
index 8db852752e..6e29c806b6 100644
--- a/support/texlab/crates/inlay-hints/src/label.rs
+++ b/support/texlab/crates/inlay-hints/src/label.rs
@@ -9,7 +9,6 @@ use crate::{InlayHint, InlayHintBuilder, InlayHintData};
pub(super) fn find_hints(builder: &mut InlayHintBuilder) -> Option<()> {
let definitions = base_db::semantics::tex::Label::find_all(&builder.params.feature.project)
- .into_iter()
.filter(|(_, label)| label.kind == LabelKind::Definition)
.map(|(_, label)| (label.name_text(), label))
.collect::<FxHashMap<_, _>>();
diff --git a/support/texlab/crates/ipc/Cargo.toml b/support/texlab/crates/ipc/Cargo.toml
index ae31dcaf55..92afbba876 100644
--- a/support/texlab/crates/ipc/Cargo.toml
+++ b/support/texlab/crates/ipc/Cargo.toml
@@ -7,10 +7,10 @@ edition.workspace = true
rust-version.workspace = true
[dependencies]
-crossbeam-channel = "0.5.12"
-serde = "1.0.199"
-serde_json = "1.0.116"
-log = "0.4.21"
+crossbeam-channel = "0.5.13"
+serde = "1.0.203"
+serde_json = "1.0.119"
+log = "0.4.22"
uds_windows = "1.1.0"
[lib]
diff --git a/support/texlab/crates/line-index/Cargo.toml b/support/texlab/crates/line-index/Cargo.toml
index 73d2766d60..58e2fa9e16 100644
--- a/support/texlab/crates/line-index/Cargo.toml
+++ b/support/texlab/crates/line-index/Cargo.toml
@@ -7,7 +7,7 @@ edition.workspace = true
rust-version.workspace = true
[dependencies]
-rustc-hash = "1.1.0"
+rustc-hash = "2.0.0"
text-size = "1.1.1"
[lib]
diff --git a/support/texlab/crates/parser/Cargo.toml b/support/texlab/crates/parser/Cargo.toml
index 39fa34ef63..2faadcb262 100644
--- a/support/texlab/crates/parser/Cargo.toml
+++ b/support/texlab/crates/parser/Cargo.toml
@@ -7,16 +7,16 @@ edition.workspace = true
rust-version.workspace = true
[dependencies]
-log = "0.4.21"
+log = "0.4.22"
logos = "0.14.0"
once_cell = "1.19.0"
pathdiff = "0.2.1"
-regex = "1.10.4"
+regex = "1.10.5"
rowan = "0.15.15"
-rustc-hash = "1.1.0"
+rustc-hash = "2.0.0"
syntax = { path = "../syntax" }
tempfile = "3.10.1"
-versions = "6.2.0"
+versions = "6.3.0"
[dev-dependencies]
expect-test = "1.5.0"
diff --git a/support/texlab/crates/parser/src/bibtex.rs b/support/texlab/crates/parser/src/bibtex.rs
index e2cde27dec..4d1e561dbe 100644
--- a/support/texlab/crates/parser/src/bibtex.rs
+++ b/support/texlab/crates/parser/src/bibtex.rs
@@ -2,6 +2,8 @@ use logos::Logos;
use rowan::{GreenNode, GreenNodeBuilder};
use syntax::bibtex::SyntaxKind::{self, *};
+use crate::util::lex_command_name;
+
pub fn parse_bibtex(input: &str) -> GreenNode {
let mut ptr = TokenPtr {
builder: GreenNodeBuilder::new(),
@@ -135,8 +137,8 @@ fn curly_group(mut ptr: TokenPtr<ContentToken>) -> TokenPtr<ContentToken> {
| ContentToken::Quote
| ContentToken::Word => ptr.bump(),
ContentToken::LCurly => ptr = curly_group(ptr),
- ContentToken::AccentName => ptr = accent(ptr),
- ContentToken::CommandName => ptr = command(ptr),
+ ContentToken::CommandName(CommandName::Accent) => ptr = accent(ptr),
+ ContentToken::CommandName(CommandName::Generic) => ptr = command(ptr),
};
}
@@ -160,8 +162,8 @@ fn quote_group(mut ptr: TokenPtr<ContentToken>) -> TokenPtr<ContentToken> {
| ContentToken::Integer
| ContentToken::Word => ptr.bump(),
ContentToken::LCurly => ptr = curly_group(ptr),
- ContentToken::AccentName => ptr = accent(ptr),
- ContentToken::CommandName => ptr = command(ptr),
+ ContentToken::CommandName(CommandName::Accent) => ptr = accent(ptr),
+ ContentToken::CommandName(CommandName::Generic) => ptr = command(ptr),
};
}
@@ -181,7 +183,7 @@ fn accent(mut ptr: TokenPtr<ContentToken>) -> TokenPtr<ContentToken> {
ptr.expect(ContentToken::Whitespace);
}
- if ptr.at(ContentToken::Word) || ptr.at(ContentToken::CommandName) {
+ if ptr.at(ContentToken::Word) || ptr.at(ContentToken::CommandName(CommandName::Generic)) {
ptr.bump();
}
@@ -355,31 +357,29 @@ enum ContentToken {
#[token(r#"~"#)]
Nbsp,
- #[token(r#"\`"#)]
- #[token(r#"\'"#)]
- #[token(r#"\^"#)]
- #[token(r#"\""#)]
- #[token(r#"\H"#)]
- #[token(r#"\~"#)]
- #[token(r#"\c"#)]
- #[token(r#"\k"#)]
- #[token(r#"\="#)]
- #[token(r#"\b"#)]
- #[token(r#"\."#)]
- #[token(r#"\d"#)]
- #[token(r#"\r"#)]
- #[token(r#"\u"#)]
- #[token(r#"\v"#)]
- #[token(r#"\t"#)]
- AccentName,
-
- #[regex(r"\\([^\r\n]|[@a-zA-Z:_]+\*?)?")]
- CommandName,
+ #[regex(r"\\", |lexer| { CommandName::from(lex_command_name(lexer)) })]
+ CommandName(CommandName),
#[regex(r#"[^\s"\{\}\\~,]+"#)]
Word,
}
+#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
+enum CommandName {
+ Generic,
+ Accent,
+}
+
+impl From<&str> for CommandName {
+ fn from(value: &str) -> Self {
+ match value {
+ "`" | "'" | "^" | "\"" | "H" | "~" | "c" | "k" | "=" | "b" | "." | "d" | "r" | "u"
+ | "v" | "t" => CommandName::Accent,
+ _ => CommandName::Generic,
+ }
+ }
+}
+
impl From<RootToken> for SyntaxKind {
fn from(token: RootToken) -> Self {
match token {
@@ -428,8 +428,8 @@ impl From<ContentToken> for SyntaxKind {
ContentToken::Quote => QUOTE,
ContentToken::Integer => INTEGER,
ContentToken::Nbsp => NBSP,
- ContentToken::AccentName => ACCENT_NAME,
- ContentToken::CommandName => COMMAND_NAME,
+ ContentToken::CommandName(CommandName::Accent) => ACCENT_NAME,
+ ContentToken::CommandName(CommandName::Generic) => COMMAND_NAME,
ContentToken::Word => WORD,
}
}
diff --git a/support/texlab/crates/parser/src/bibtex/tests.rs b/support/texlab/crates/parser/src/bibtex/tests.rs
index e2bb1314d8..f0872b4ca6 100644
--- a/support/texlab/crates/parser/src/bibtex/tests.rs
+++ b/support/texlab/crates/parser/src/bibtex/tests.rs
@@ -3992,3 +3992,280 @@ fn test_rivest_1978() {
"#]],
);
}
+
+#[test]
+fn test_cuesta_2002() {
+ check(
+ r#"@INPROCEEDINGS{Cuesta02,
+ author = {Cuesta, Carlos E. and de la Fuente, Pablo and Barrio-Sol\órzano, Manuel and Beato, Encarnaci\ón},
+ title = {{Coordination in a Reflective Architecture Description Language}},
+ booktitle = {{Proceedings of the 5th International Conference on Coordination Models and Languages (COORDINATION'02)}},
+ year = 2002,
+ editor = {Arbab, Fahrad and Talcott, Carolyn},
+ pages = {141--148},
+ address = {York, United Kingdom},
+ organization = {},
+ publisher = {Springer},
+ volume = {},
+ number = {},
+ series = {Lecture Notes in Computer Science 2315},
+ month = apr,
+ note = {}
+}"#,
+ expect![[r#"
+ ROOT@0..617
+ ENTRY@0..617
+ TYPE@0..14 "@INPROCEEDINGS"
+ L_DELIM@14..15 "{"
+ NAME@15..23 "Cuesta02"
+ COMMA@23..24 ","
+ WHITESPACE@24..27 "\n "
+ FIELD@27..136
+ NAME@27..33 "author"
+ WHITESPACE@33..34 " "
+ EQ@34..35 "="
+ WHITESPACE@35..36 " "
+ CURLY_GROUP@36..135
+ L_CURLY@36..37 "{"
+ WORD@37..43 "Cuesta"
+ COMMA@43..44 ","
+ WHITESPACE@44..45 " "
+ WORD@45..51 "Carlos"
+ WHITESPACE@51..52 " "
+ WORD@52..54 "E."
+ WHITESPACE@54..55 " "
+ WORD@55..58 "and"
+ WHITESPACE@58..59 " "
+ WORD@59..61 "de"
+ WHITESPACE@61..62 " "
+ WORD@62..64 "la"
+ WHITESPACE@64..65 " "
+ WORD@65..71 "Fuente"
+ COMMA@71..72 ","
+ WHITESPACE@72..73 " "
+ WORD@73..78 "Pablo"
+ WHITESPACE@78..79 " "
+ WORD@79..82 "and"
+ WHITESPACE@82..83 " "
+ WORD@83..93 "Barrio-Sol"
+ COMMAND@93..101
+ COMMAND_NAME@93..101 "\\órzano"
+ COMMA@101..102 ","
+ WHITESPACE@102..103 " "
+ WORD@103..109 "Manuel"
+ WHITESPACE@109..110 " "
+ WORD@110..113 "and"
+ WHITESPACE@113..114 " "
+ WORD@114..119 "Beato"
+ COMMA@119..120 ","
+ WHITESPACE@120..121 " "
+ WORD@121..130 "Encarnaci"
+ COMMAND@130..134
+ COMMAND_NAME@130..134 "\\ón"
+ R_CURLY@134..135 "}"
+ COMMA@135..136 ","
+ WHITESPACE@136..139 "\n "
+ FIELD@139..214
+ NAME@139..144 "title"
+ WHITESPACE@144..145 " "
+ EQ@145..146 "="
+ WHITESPACE@146..147 " "
+ CURLY_GROUP@147..213
+ L_CURLY@147..148 "{"
+ CURLY_GROUP@148..212
+ L_CURLY@148..149 "{"
+ WORD@149..161 "Coordination"
+ WHITESPACE@161..162 " "
+ WORD@162..164 "in"
+ WHITESPACE@164..165 " "
+ WORD@165..166 "a"
+ WHITESPACE@166..167 " "
+ WORD@167..177 "Reflective"
+ WHITESPACE@177..178 " "
+ WORD@178..190 "Architecture"
+ WHITESPACE@190..191 " "
+ WORD@191..202 "Description"
+ WHITESPACE@202..203 " "
+ WORD@203..211 "Language"
+ R_CURLY@211..212 "}"
+ R_CURLY@212..213 "}"
+ COMMA@213..214 ","
+ WHITESPACE@214..217 "\n "
+ FIELD@217..336
+ NAME@217..226 "booktitle"
+ WHITESPACE@226..227 " "
+ EQ@227..228 "="
+ WHITESPACE@228..229 " "
+ CURLY_GROUP@229..335
+ L_CURLY@229..230 "{"
+ CURLY_GROUP@230..334
+ L_CURLY@230..231 "{"
+ WORD@231..242 "Proceedings"
+ WHITESPACE@242..243 " "
+ WORD@243..245 "of"
+ WHITESPACE@245..246 " "
+ WORD@246..249 "the"
+ WHITESPACE@249..250 " "
+ WORD@250..253 "5th"
+ WHITESPACE@253..254 " "
+ WORD@254..267 "International"
+ WHITESPACE@267..268 " "
+ WORD@268..278 "Conference"
+ WHITESPACE@278..279 " "
+ WORD@279..281 "on"
+ WHITESPACE@281..282 " "
+ WORD@282..294 "Coordination"
+ WHITESPACE@294..295 " "
+ WORD@295..301 "Models"
+ WHITESPACE@301..302 " "
+ WORD@302..305 "and"
+ WHITESPACE@305..306 " "
+ WORD@306..315 "Languages"
+ WHITESPACE@315..316 " "
+ WORD@316..333 "(COORDINATION'02)"
+ R_CURLY@333..334 "}"
+ R_CURLY@334..335 "}"
+ COMMA@335..336 ","
+ WHITESPACE@336..339 "\n "
+ FIELD@339..351
+ NAME@339..343 "year"
+ WHITESPACE@343..344 " "
+ EQ@344..345 "="
+ WHITESPACE@345..346 " "
+ LITERAL@346..350
+ INTEGER@346..350 "2002"
+ COMMA@350..351 ","
+ WHITESPACE@351..354 "\n "
+ FIELD@354..400
+ NAME@354..360 "editor"
+ WHITESPACE@360..361 " "
+ EQ@361..362 "="
+ WHITESPACE@362..363 " "
+ CURLY_GROUP@363..399
+ L_CURLY@363..364 "{"
+ WORD@364..369 "Arbab"
+ COMMA@369..370 ","
+ WHITESPACE@370..371 " "
+ WORD@371..377 "Fahrad"
+ WHITESPACE@377..378 " "
+ WORD@378..381 "and"
+ WHITESPACE@381..382 " "
+ WORD@382..389 "Talcott"
+ COMMA@389..390 ","
+ WHITESPACE@390..391 " "
+ WORD@391..398 "Carolyn"
+ R_CURLY@398..399 "}"
+ COMMA@399..400 ","
+ WHITESPACE@400..403 "\n "
+ FIELD@403..422
+ NAME@403..408 "pages"
+ WHITESPACE@408..409 " "
+ EQ@409..410 "="
+ WHITESPACE@410..411 " "
+ CURLY_GROUP@411..421
+ L_CURLY@411..412 "{"
+ WORD@412..420 "141--148"
+ R_CURLY@420..421 "}"
+ COMMA@421..422 ","
+ WHITESPACE@422..425 "\n "
+ FIELD@425..458
+ NAME@425..432 "address"
+ WHITESPACE@432..433 " "
+ EQ@433..434 "="
+ WHITESPACE@434..435 " "
+ CURLY_GROUP@435..457
+ L_CURLY@435..436 "{"
+ WORD@436..440 "York"
+ COMMA@440..441 ","
+ WHITESPACE@441..442 " "
+ WORD@442..448 "United"
+ WHITESPACE@448..449 " "
+ WORD@449..456 "Kingdom"
+ R_CURLY@456..457 "}"
+ COMMA@457..458 ","
+ WHITESPACE@458..461 "\n "
+ FIELD@461..479
+ NAME@461..473 "organization"
+ WHITESPACE@473..474 " "
+ EQ@474..475 "="
+ WHITESPACE@475..476 " "
+ CURLY_GROUP@476..478
+ L_CURLY@476..477 "{"
+ R_CURLY@477..478 "}"
+ COMMA@478..479 ","
+ WHITESPACE@479..482 "\n "
+ FIELD@482..505
+ NAME@482..491 "publisher"
+ WHITESPACE@491..492 " "
+ EQ@492..493 "="
+ WHITESPACE@493..494 " "
+ CURLY_GROUP@494..504
+ L_CURLY@494..495 "{"
+ WORD@495..503 "Springer"
+ R_CURLY@503..504 "}"
+ COMMA@504..505 ","
+ WHITESPACE@505..508 "\n "
+ FIELD@508..520
+ NAME@508..514 "volume"
+ WHITESPACE@514..515 " "
+ EQ@515..516 "="
+ WHITESPACE@516..517 " "
+ CURLY_GROUP@517..519
+ L_CURLY@517..518 "{"
+ R_CURLY@518..519 "}"
+ COMMA@519..520 ","
+ WHITESPACE@520..523 "\n "
+ FIELD@523..535
+ NAME@523..529 "number"
+ WHITESPACE@529..530 " "
+ EQ@530..531 "="
+ WHITESPACE@531..532 " "
+ CURLY_GROUP@532..534
+ L_CURLY@532..533 "{"
+ R_CURLY@533..534 "}"
+ COMMA@534..535 ","
+ WHITESPACE@535..538 "\n "
+ FIELD@538..588
+ NAME@538..544 "series"
+ WHITESPACE@544..545 " "
+ EQ@545..546 "="
+ WHITESPACE@546..547 " "
+ CURLY_GROUP@547..587
+ L_CURLY@547..548 "{"
+ WORD@548..555 "Lecture"
+ WHITESPACE@555..556 " "
+ WORD@556..561 "Notes"
+ WHITESPACE@561..562 " "
+ WORD@562..564 "in"
+ WHITESPACE@564..565 " "
+ WORD@565..573 "Computer"
+ WHITESPACE@573..574 " "
+ WORD@574..581 "Science"
+ WHITESPACE@581..582 " "
+ INTEGER@582..586 "2315"
+ R_CURLY@586..587 "}"
+ COMMA@587..588 ","
+ WHITESPACE@588..591 "\n "
+ FIELD@591..603
+ NAME@591..596 "month"
+ WHITESPACE@596..597 " "
+ EQ@597..598 "="
+ WHITESPACE@598..599 " "
+ LITERAL@599..602
+ NAME@599..602 "apr"
+ COMMA@602..603 ","
+ WHITESPACE@603..606 "\n "
+ FIELD@606..616
+ NAME@606..610 "note"
+ WHITESPACE@610..611 " "
+ EQ@611..612 "="
+ WHITESPACE@612..613 " "
+ CURLY_GROUP@613..615
+ L_CURLY@613..614 "{"
+ R_CURLY@614..615 "}"
+ WHITESPACE@615..616 "\n"
+ R_DELIM@616..617 "}"
+
+ "#]],
+ )
+}
diff --git a/support/texlab/crates/parser/src/build_log.rs b/support/texlab/crates/parser/src/build_log.rs
index 420d2dda20..c1f59bd086 100644
--- a/support/texlab/crates/parser/src/build_log.rs
+++ b/support/texlab/crates/parser/src/build_log.rs
@@ -36,7 +36,7 @@ pub fn parse_build_log(log: &str) -> BuildLog {
let warnings = extract_matches(&log, &ranges, &WARNING_REGEX, BuildErrorLevel::Warning);
let bad_boxes = extract_matches(&log, &ranges, &BAD_BOX_REGEX, BuildErrorLevel::Warning);
- let errors = vec![tex_errors, warnings, bad_boxes].concat();
+ let errors = [tex_errors, warnings, bad_boxes].concat();
BuildLog { errors }
}
diff --git a/support/texlab/crates/parser/src/config.rs b/support/texlab/crates/parser/src/config.rs
index f81083f132..2c5380448f 100644
--- a/support/texlab/crates/parser/src/config.rs
+++ b/support/texlab/crates/parser/src/config.rs
@@ -3,12 +3,15 @@ use rustc_hash::FxHashSet;
#[derive(Debug)]
pub struct SyntaxConfig {
pub follow_package_links: bool,
+ pub use_file_list: bool,
pub math_environments: FxHashSet<String>,
pub enum_environments: FxHashSet<String>,
pub verbatim_environments: FxHashSet<String>,
pub citation_commands: FxHashSet<String>,
pub label_definition_commands: FxHashSet<String>,
+ pub label_definition_prefixes: Vec<(String, String)>,
pub label_reference_commands: FxHashSet<String>,
+ pub label_reference_prefixes: Vec<(String, String)>,
}
impl Default for SyntaxConfig {
@@ -38,19 +41,32 @@ impl Default for SyntaxConfig {
.map(ToString::to_string)
.collect();
+ let label_definition_prefixes = DEFAULT_LABEL_DEFINITION_PREFIXES
+ .iter()
+ .map(|(x, y)| (ToString::to_string(x), ToString::to_string(y)))
+ .collect();
+
let label_reference_commands = DEFAULT_LABEL_REFERENCE_COMMANDS
.iter()
.map(ToString::to_string)
.collect();
+ let label_reference_prefixes = DEFAULT_LABEL_REFERENCE_PREFIXES
+ .iter()
+ .map(|(x, y)| (ToString::to_string(x), ToString::to_string(y)))
+ .collect();
+
Self {
follow_package_links: false,
+ use_file_list: false,
math_environments,
enum_environments,
verbatim_environments,
citation_commands,
label_definition_commands,
+ label_definition_prefixes,
label_reference_commands,
+ label_reference_prefixes,
}
}
}
@@ -170,7 +186,9 @@ static DEFAULT_CITATION_COMMANDS: &[&str] = &[
"citeA*",
];
-static DEFAULT_LABEL_DEFINITION_COMMANDS: &[&str] = &["label"];
+static DEFAULT_LABEL_DEFINITION_COMMANDS: &[&str] = &["label", "zlabel"];
+
+static DEFAULT_LABEL_DEFINITION_PREFIXES: &[(&str, &str)] = &[];
static DEFAULT_LABEL_REFERENCE_COMMANDS: &[&str] = &[
"ref",
@@ -182,6 +200,10 @@ static DEFAULT_LABEL_REFERENCE_COMMANDS: &[&str] = &[
"cref*",
"Cref",
"Cref*",
+ "zcref",
+ "zcref*",
+ "zcpageref",
+ "zcpageref*",
"namecref",
"nameCref",
"lcnamecref",
@@ -192,3 +214,5 @@ static DEFAULT_LABEL_REFERENCE_COMMANDS: &[&str] = &[
"labelcpageref",
"eqref",
];
+
+static DEFAULT_LABEL_REFERENCE_PREFIXES: &[(&str, &str)] = &[];
diff --git a/support/texlab/crates/parser/src/file_list.rs b/support/texlab/crates/parser/src/file_list.rs
new file mode 100644
index 0000000000..c892ebfeef
--- /dev/null
+++ b/support/texlab/crates/parser/src/file_list.rs
@@ -0,0 +1,44 @@
+use syntax::file_list::FileList;
+
+pub fn parse_file_list(input: &str) -> FileList {
+ let mut file_list = FileList::default();
+ for line in input.lines() {
+ if let Some(working_dir) = line.strip_prefix("PWD ") {
+ file_list.working_dir = Some(working_dir.into());
+ } else if let Some(input) = line.strip_prefix("INPUT ") {
+ file_list.inputs.insert(input.into());
+ } else if let Some(output) = line.strip_prefix("OUTPUT ") {
+ file_list.outputs.insert(output.into());
+ }
+ }
+
+ file_list
+}
+
+#[cfg(test)]
+mod tests {
+ use rustc_hash::FxHashSet;
+
+ use super::*;
+
+ #[test]
+ fn test_parse_file_list() {
+ let input = r#"
+PWD /home/user
+INPUT file1.tex
+INPUT file1.tex
+OUTPUT file2.pdf"#;
+
+ let expected_file_list = FileList {
+ working_dir: Some("/home/user".into()),
+ inputs: FxHashSet::from_iter(["file1.tex".into()]),
+ outputs: FxHashSet::from_iter(["file2.pdf".into()]),
+ };
+ let actual_file_list = parse_file_list(input);
+ assert_eq!(actual_file_list, expected_file_list);
+
+ assert_eq!(actual_file_list.working_dir, Some("/home/user".into()));
+ assert_eq!(actual_file_list.inputs.len(), 1);
+ assert_eq!(actual_file_list.outputs.len(), 1);
+ }
+}
diff --git a/support/texlab/crates/parser/src/latex/lexer/types.rs b/support/texlab/crates/parser/src/latex/lexer/types.rs
index 896ce01c05..85e542792b 100644
--- a/support/texlab/crates/parser/src/latex/lexer/types.rs
+++ b/support/texlab/crates/parser/src/latex/lexer/types.rs
@@ -1,5 +1,7 @@
use logos::Logos;
+use crate::util::lex_command_name;
+
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash, Logos)]
pub enum Token {
#[regex(r"[\r\n]+", priority = 2)]
@@ -44,55 +46,10 @@ pub enum Token {
#[regex(r"\$\$?")]
Dollar,
- #[regex(r"\\", lex_command_name)]
+ #[regex(r"\\", |lexer| { lex_command_name(lexer); CommandName::Generic } )]
CommandName(CommandName),
}
-fn lex_command_name(lexer: &mut logos::Lexer<Token>) -> CommandName {
- let input = &lexer.source()[lexer.span().end..];
-
- let mut chars = input.chars().peekable();
- let Some(c) = chars.next() else {
- return CommandName::Generic;
- };
-
- if c.is_whitespace() {
- return CommandName::Generic;
- }
-
- lexer.bump(c.len_utf8());
- if !c.is_alphanumeric() && c != '@' {
- return CommandName::Generic;
- }
-
- while let Some(c) = chars.next() {
- match c {
- '*' => {
- lexer.bump(c.len_utf8());
- break;
- }
- c if c.is_alphanumeric() => {
- lexer.bump(c.len_utf8());
- }
- '_' => {
- if !matches!(chars.peek(), Some(c) if c.is_alphanumeric()) {
- break;
- }
-
- lexer.bump(c.len_utf8());
- }
- '@' | ':' => {
- lexer.bump(c.len_utf8());
- }
- _ => {
- break;
- }
- }
- }
-
- CommandName::Generic
-}
-
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
pub enum CommandName {
Generic,
diff --git a/support/texlab/crates/parser/src/latexmkrc.rs b/support/texlab/crates/parser/src/latexmkrc.rs
index 6013a5f646..58c348d01f 100644
--- a/support/texlab/crates/parser/src/latexmkrc.rs
+++ b/support/texlab/crates/parser/src/latexmkrc.rs
@@ -28,9 +28,9 @@ mod v483 {
.current_dir(temp_dir.path())
.output()?;
- let stderr = String::from_utf8_lossy(&output.stderr);
+ let stdout = String::from_utf8_lossy(&output.stdout);
- let (aux_dir, out_dir) = stderr.lines().find_map(extract_dirs).ok_or_else(|| {
+ let (aux_dir, out_dir) = stdout.lines().find_map(extract_dirs).ok_or_else(|| {
std::io::Error::new(
std::io::ErrorKind::InvalidData,
"Normalized aux and out dir were not found in latexmk output",
@@ -106,7 +106,7 @@ mod v484 {
let mut it = lines
.skip_while(|line| !line.starts_with("Latexmk: Normalized aux dir and out dirs:"))
.nth(1)?
- .split(",");
+ .split(',');
let aux_dir = it.next()?.trim().strip_prefix('\'')?.strip_suffix('\'')?;
@@ -133,7 +133,7 @@ pub fn parse_latexmkrc(input: &str, src_dir: &Path) -> std::io::Result<Latexmkrc
.as_ref()
.and_then(|line| Some((line.find("Version")?, line)))
.and_then(|(i, line)| line[i..].trim_end().strip_prefix("Version "))
- .and_then(|text| versions::Versioning::new(text));
+ .and_then(versions::Versioning::new);
let result = if version.map_or(false, |v| v >= versions::Versioning::new("4.84").unwrap()) {
v484::parse_latexmkrc(input, src_dir)
diff --git a/support/texlab/crates/parser/src/lib.rs b/support/texlab/crates/parser/src/lib.rs
index 2a4190b7e2..b3952d6ea5 100644
--- a/support/texlab/crates/parser/src/lib.rs
+++ b/support/texlab/crates/parser/src/lib.rs
@@ -1,10 +1,12 @@
mod bibtex;
mod build_log;
mod config;
+mod file_list;
mod latex;
mod latexmkrc;
+pub(crate) mod util;
pub use self::{
- bibtex::parse_bibtex, build_log::parse_build_log, config::*, latex::parse_latex,
- latexmkrc::parse_latexmkrc,
+ bibtex::parse_bibtex, build_log::parse_build_log, config::*, file_list::parse_file_list,
+ latex::parse_latex, latexmkrc::parse_latexmkrc,
};
diff --git a/support/texlab/crates/parser/src/util.rs b/support/texlab/crates/parser/src/util.rs
new file mode 100644
index 0000000000..cb147c493b
--- /dev/null
+++ b/support/texlab/crates/parser/src/util.rs
@@ -0,0 +1,52 @@
+use std::ops::{Index, Range};
+
+use logos::{Logos, Source};
+
+pub fn lex_command_name<'a, T>(lexer: &mut logos::Lexer<'a, T>) -> &'a str
+where
+ T: Logos<'a>,
+ T::Source: Index<Range<usize>, Output = str>,
+{
+ let start = lexer.span().end;
+ let input = &lexer.source()[start..lexer.source().len()];
+
+ let mut chars = input.chars().peekable();
+ let Some(c) = chars.next() else {
+ return "";
+ };
+
+ if c.is_whitespace() {
+ return "";
+ }
+
+ lexer.bump(c.len_utf8());
+
+ if c.is_alphanumeric() || c == '@' {
+ while let Some(c) = chars.next() {
+ match c {
+ '*' => {
+ lexer.bump(c.len_utf8());
+ break;
+ }
+ c if c.is_alphanumeric() => {
+ lexer.bump(c.len_utf8());
+ }
+ '_' => {
+ if !matches!(chars.peek(), Some(c) if c.is_alphanumeric()) {
+ break;
+ }
+
+ lexer.bump(c.len_utf8());
+ }
+ '@' | ':' => {
+ lexer.bump(c.len_utf8());
+ }
+ _ => {
+ break;
+ }
+ }
+ }
+ }
+
+ &lexer.source()[start..lexer.span().end]
+}
diff --git a/support/texlab/crates/references/Cargo.toml b/support/texlab/crates/references/Cargo.toml
index e78e84ea4c..8d4e3a6936 100644
--- a/support/texlab/crates/references/Cargo.toml
+++ b/support/texlab/crates/references/Cargo.toml
@@ -9,7 +9,7 @@ rust-version.workspace = true
[dependencies]
base-db = { path = "../base-db" }
rowan = "0.15.15"
-rustc-hash = "1.1.0"
+rustc-hash = "2.0.0"
syntax = { path = "../syntax" }
[dev-dependencies]
diff --git a/support/texlab/crates/references/src/command.rs b/support/texlab/crates/references/src/command.rs
index 712da20b73..f4504641f2 100644
--- a/support/texlab/crates/references/src/command.rs
+++ b/support/texlab/crates/references/src/command.rs
@@ -32,7 +32,7 @@ pub(super) fn find_all(context: &mut ReferenceContext) -> Option<()> {
.collect();
for command in &data.semantics.commands {
- if command.text == &token.text()[1..] {
+ if command.text == token.text()[1..] {
let kind = if defs.contains(command) {
ReferenceKind::Definition
} else {
diff --git a/support/texlab/crates/references/src/entry.rs b/support/texlab/crates/references/src/entry.rs
index c3926058e6..722c96fe4a 100644
--- a/support/texlab/crates/references/src/entry.rs
+++ b/support/texlab/crates/references/src/entry.rs
@@ -30,14 +30,14 @@ pub(super) fn find_all(context: &mut ReferenceContext) -> Option<()> {
};
let project = &context.params.feature.project;
- for (document, obj) in queries::objects_with_name::<tex::Citation>(&project, name) {
+ for (document, obj) in queries::objects_with_name::<tex::Citation>(project, name) {
context.results.push(Reference {
location: DocumentLocation::new(document, obj.name.range),
kind: ReferenceKind::Reference,
});
}
- for (document, obj) in queries::objects_with_name::<bib::Entry>(&project, name) {
+ for (document, obj) in queries::objects_with_name::<bib::Entry>(project, name) {
context.results.push(Reference {
location: DocumentLocation::new(document, obj.name.range),
kind: ReferenceKind::Definition,
diff --git a/support/texlab/crates/references/src/label.rs b/support/texlab/crates/references/src/label.rs
index 872ef2dd14..20fc6e0d25 100644
--- a/support/texlab/crates/references/src/label.rs
+++ b/support/texlab/crates/references/src/label.rs
@@ -14,7 +14,7 @@ pub(super) fn find_all(context: &mut ReferenceContext) -> Option<()> {
.name_text();
let project = &context.params.feature.project;
- for (document, label) in queries::objects_with_name::<tex::Label>(&project, name) {
+ for (document, label) in queries::objects_with_name::<tex::Label>(project, name) {
let kind = match label.kind {
tex::LabelKind::Definition => ReferenceKind::Definition,
tex::LabelKind::Reference | tex::LabelKind::ReferenceRange => ReferenceKind::Reference,
diff --git a/support/texlab/crates/rename/Cargo.toml b/support/texlab/crates/rename/Cargo.toml
index 1b2b91ee2a..592bafb474 100644
--- a/support/texlab/crates/rename/Cargo.toml
+++ b/support/texlab/crates/rename/Cargo.toml
@@ -9,11 +9,12 @@ rust-version.workspace = true
[dependencies]
base-db = { path = "../base-db" }
rowan = "0.15.15"
-rustc-hash = "1.1.0"
+rustc-hash = "2.0.0"
syntax = { path = "../syntax" }
[dev-dependencies]
test-utils = { path = "../test-utils" }
+parser = { path = "../parser" }
[lib]
doctest = false
diff --git a/support/texlab/crates/rename/src/command.rs b/support/texlab/crates/rename/src/command.rs
index edcf7db61e..037e09e4ca 100644
--- a/support/texlab/crates/rename/src/command.rs
+++ b/support/texlab/crates/rename/src/command.rs
@@ -19,7 +19,7 @@ pub(super) fn prepare_rename(params: &RenameParams) -> Option<Span> {
))
}
-pub(super) fn rename<'a>(builder: &mut RenameBuilder) -> Option<()> {
+pub(super) fn rename(builder: &mut RenameBuilder) -> Option<()> {
let name = prepare_rename(&builder.params)?;
for document in &builder.params.feature.project.documents {
@@ -35,7 +35,10 @@ pub(super) fn rename<'a>(builder: &mut RenameBuilder) -> Option<()> {
}
}
- builder.result.changes.insert(*document, edits);
+ builder
+ .result
+ .changes
+ .insert(*document, edits.iter().map(|&x| x.into()).collect());
}
Some(())
diff --git a/support/texlab/crates/rename/src/entry.rs b/support/texlab/crates/rename/src/entry.rs
index c0b508a506..d35d9e9e84 100644
--- a/support/texlab/crates/rename/src/entry.rs
+++ b/support/texlab/crates/rename/src/entry.rs
@@ -30,7 +30,7 @@ pub(super) fn prepare_rename(params: &RenameParams) -> Option<Span> {
}
}
-pub(super) fn rename<'a>(builder: &mut RenameBuilder) -> Option<()> {
+pub(super) fn rename(builder: &mut RenameBuilder) -> Option<()> {
let name = prepare_rename(&builder.params)?;
let project = &builder.params.feature.project;
@@ -42,7 +42,7 @@ pub(super) fn rename<'a>(builder: &mut RenameBuilder) -> Option<()> {
for (document, range) in citations.chain(entries) {
let entry = builder.result.changes.entry(document);
- entry.or_default().push(range);
+ entry.or_default().push(range.into());
}
Some(())
diff --git a/support/texlab/crates/rename/src/label.rs b/support/texlab/crates/rename/src/label.rs
index b21e1b795e..1d82f5e2b4 100644
--- a/support/texlab/crates/rename/src/label.rs
+++ b/support/texlab/crates/rename/src/label.rs
@@ -3,22 +3,65 @@ use base_db::{
util::queries::{self, Object},
};
-use crate::{RenameBuilder, RenameParams};
+use crate::{RenameBuilder, RenameInformation, RenameParams};
+
+struct PrefixInformation<'a> {
+ def_prefixes: &'a Vec<(String, String)>,
+ ref_prefixes: &'a Vec<(String, String)>,
+}
+
+fn label_has_prefix(pref_info: &PrefixInformation, label: &tex::Label) -> Option<String> {
+ match label.kind {
+ tex::LabelKind::Definition => pref_info.def_prefixes.iter(),
+ _ => pref_info.ref_prefixes.iter(),
+ }
+ .find_map(|(k, v)| {
+ if k == &label.cmd.clone().unwrap_or(String::new()) {
+ Some(v)
+ } else {
+ None
+ }
+ })
+ .cloned()
+}
+
+fn find_prefix_in_any(
+ builder: &mut RenameBuilder,
+ pref_info: &PrefixInformation,
+ name: &str,
+) -> Option<String> {
+ let project = &builder.params.feature.project;
+ queries::objects_with_name::<tex::Label>(project, name)
+ .find_map(|(_, label)| label_has_prefix(&pref_info, label))
+}
pub(super) fn prepare_rename(params: &RenameParams) -> Option<Span> {
let data = params.feature.document.data.as_tex()?;
let labels = &data.semantics.labels;
let label = queries::object_at_cursor(labels, params.offset, queries::SearchMode::Name)?;
+
Some(Span::new(label.object.name.text.clone(), label.range))
}
pub(super) fn rename(builder: &mut RenameBuilder) -> Option<()> {
let name = prepare_rename(&builder.params)?;
+ let syn = &builder.params.feature.workspace.config().syntax;
+ let pref_info = PrefixInformation {
+ def_prefixes: &syn.label_definition_prefixes,
+ ref_prefixes: &syn.label_reference_prefixes,
+ };
+ let prefix = find_prefix_in_any(builder, &pref_info, &name.text);
+
let project = &builder.params.feature.project;
for (document, label) in queries::objects_with_name::<tex::Label>(project, &name.text) {
+ let prefix = label_has_prefix(&pref_info, label).map_or(prefix.clone(), |_| None);
+
let entry = builder.result.changes.entry(document);
- entry.or_default().push(label.name_range());
+ entry.or_default().push(RenameInformation {
+ range: label.name_range(),
+ prefix: prefix.clone(),
+ });
}
Some(())
diff --git a/support/texlab/crates/rename/src/lib.rs b/support/texlab/crates/rename/src/lib.rs
index b7dd197ce0..e6c05ad268 100644
--- a/support/texlab/crates/rename/src/lib.rs
+++ b/support/texlab/crates/rename/src/lib.rs
@@ -13,8 +13,14 @@ pub struct RenameParams<'a> {
}
#[derive(Debug, Default)]
+pub struct RenameInformation {
+ pub range: TextRange,
+ pub prefix: Option<String>,
+}
+
+#[derive(Debug, Default)]
pub struct RenameResult<'a> {
- pub changes: FxHashMap<&'a Document, Vec<TextRange>>,
+ pub changes: FxHashMap<&'a Document, Vec<RenameInformation>>,
}
struct RenameBuilder<'a> {
@@ -22,14 +28,28 @@ struct RenameBuilder<'a> {
result: RenameResult<'a>,
}
+impl From<TextRange> for RenameInformation {
+ fn from(range: TextRange) -> Self {
+ RenameInformation {
+ range,
+ prefix: None,
+ }
+ }
+}
+impl PartialEq for RenameInformation {
+ fn eq(&self, other: &Self) -> bool {
+ self.range == other.range
+ }
+}
+
pub fn prepare_rename(params: &RenameParams) -> Option<TextRange> {
- command::prepare_rename(&params)
- .or_else(|| entry::prepare_rename(&params))
- .or_else(|| label::prepare_rename(&params))
+ command::prepare_rename(params)
+ .or_else(|| entry::prepare_rename(params))
+ .or_else(|| label::prepare_rename(params))
.map(|span| span.range)
}
-pub fn rename<'a>(params: RenameParams<'a>) -> RenameResult<'a> {
+pub fn rename(params: RenameParams) -> RenameResult {
let result = RenameResult::default();
let mut builder = RenameBuilder { params, result };
diff --git a/support/texlab/crates/rename/src/tests.rs b/support/texlab/crates/rename/src/tests.rs
index 0f4263033e..4da866fb08 100644
--- a/support/texlab/crates/rename/src/tests.rs
+++ b/support/texlab/crates/rename/src/tests.rs
@@ -1,23 +1,37 @@
use rustc_hash::FxHashMap;
-use crate::RenameParams;
+use base_db::Config;
+use parser::SyntaxConfig;
-fn check(input: &str) {
- let fixture = test_utils::fixture::Fixture::parse(input);
+use crate::{RenameInformation, RenameParams};
+
+fn check_with_syntax_config(config: SyntaxConfig, input: &str) {
+ let mut fixture = test_utils::fixture::Fixture::parse(input);
+ fixture.workspace.set_config(Config {
+ syntax: config,
+ ..Config::default()
+ });
+ let fixture = fixture;
- let mut expected = FxHashMap::default();
+ let mut expected: FxHashMap<_, Vec<RenameInformation>> = FxHashMap::default();
for spec in &fixture.documents {
if !spec.ranges.is_empty() {
let document = fixture.workspace.lookup(&spec.uri).unwrap();
- expected.insert(document, spec.ranges.clone());
+ expected.insert(
+ document,
+ spec.ranges.iter().map(|r| r.clone().into()).collect(),
+ );
}
}
-
let (feature, offset) = fixture.make_params().unwrap();
let actual = crate::rename(RenameParams { feature, offset });
assert_eq!(actual.changes, expected);
}
+fn check(input: &str) {
+ check_with_syntax_config(SyntaxConfig::default(), input)
+}
+
#[test]
fn test_command() {
check(
@@ -78,12 +92,97 @@ fn test_label() {
|
^^^
+%! baz.tex
+\ref{foo}
+
%! bar.tex
\ref{foo}
^^^
+"#,
+ )
+}
+
+#[test]
+fn test_custom_label_ref() {
+ let mut config = SyntaxConfig::default();
+ config
+ .label_definition_commands
+ .extend(vec!["asm", "goal"].into_iter().map(String::from));
+ config.label_definition_prefixes.extend(
+ vec![("asm", "asm:"), ("goal", "goal:")]
+ .into_iter()
+ .map(|(x, y)| (String::from(x), String::from(y))),
+ );
+ config
+ .label_reference_commands
+ .extend(vec!["asmref", "goalref"].into_iter().map(String::from));
+ config.label_reference_prefixes.extend(
+ vec![("asmref", "asm:"), ("goalref", "goal:")]
+ .into_iter()
+ .map(|(x, y)| (String::from(x), String::from(y))),
+ );
+ check_with_syntax_config(
+ config,
+ r#"
+%! foo.tex
+\goal{foo}
+
+\asm{foo}\include{bar}\include{baz}
+ |
+ ^^^
+
+%! bar.tex
+\asmref{foo}
+ ^^^
+
+%! baz.tex
+\ref{foo}
+
+\ref{asm:foo}
+ ^^^^^^^
+
+"#,
+ )
+}
+
+#[test]
+fn test_custom_label_def() {
+ let mut config = SyntaxConfig::default();
+ config
+ .label_definition_commands
+ .extend(vec!["asm", "goal"].into_iter().map(String::from));
+ config.label_definition_prefixes.extend(
+ vec![("asm", "asm:"), ("goal", "goal:")]
+ .into_iter()
+ .map(|(x, y)| (String::from(x), String::from(y))),
+ );
+ config
+ .label_reference_commands
+ .extend(vec!["asmref", "goalref"].into_iter().map(String::from));
+ config.label_reference_prefixes.extend(
+ vec![("asmref", "asm:"), ("goalref", "goal:")]
+ .into_iter()
+ .map(|(x, y)| (String::from(x), String::from(y))),
+ );
+ check_with_syntax_config(
+ config,
+ r#"
+%! foo.tex
+\goal{foo}
+
+\label{asm:foo}\include{bar}\include{baz}
+ |
+ ^^^^^^^
+
+%! bar.tex
+\asmref{foo}
+ ^^^
%! baz.tex
\ref{foo}
+
+\ref{asm:foo}
+ ^^^^^^^
"#,
)
}
diff --git a/support/texlab/crates/symbols/Cargo.toml b/support/texlab/crates/symbols/Cargo.toml
index 65db0fc0bd..c44f120153 100644
--- a/support/texlab/crates/symbols/Cargo.toml
+++ b/support/texlab/crates/symbols/Cargo.toml
@@ -12,7 +12,7 @@ doctest = false
[dependencies]
base-db = { path = "../base-db" }
distro = { path = "../distro" }
-itertools = "0.12.1"
+itertools = "0.13.0"
line-index = { path = "../line-index" }
rowan = "0.15.15"
syntax = { path = "../syntax" }
@@ -20,6 +20,6 @@ titlecase = "3.0.0"
url = "2.5.0"
[dev-dependencies]
-regex = "1.10.4"
+regex = "1.10.5"
test-utils = { path = "../test-utils" }
expect-test = "1.5.0"
diff --git a/support/texlab/crates/symbols/src/document.rs b/support/texlab/crates/symbols/src/document.rs
index 791f119919..611a7e0370 100644
--- a/support/texlab/crates/symbols/src/document.rs
+++ b/support/texlab/crates/symbols/src/document.rs
@@ -23,6 +23,7 @@ pub fn document_symbols(workspace: &Workspace, document: &Document) -> Vec<Symbo
| DocumentData::Log(_)
| DocumentData::Root
| DocumentData::Latexmkrc(_)
+ | DocumentData::FileList(_)
| DocumentData::Tectonic => Vec::new(),
};
diff --git a/support/texlab/crates/syntax/Cargo.toml b/support/texlab/crates/syntax/Cargo.toml
index a2d3d866b6..14dfffe380 100644
--- a/support/texlab/crates/syntax/Cargo.toml
+++ b/support/texlab/crates/syntax/Cargo.toml
@@ -7,8 +7,9 @@ edition.workspace = true
rust-version.workspace = true
[dependencies]
-itertools = "0.12.1"
+itertools = "0.13.0"
rowan = "0.15.15"
+rustc-hash = "2.0.0"
[lib]
doctest = false
diff --git a/support/texlab/crates/syntax/src/file_list.rs b/support/texlab/crates/syntax/src/file_list.rs
new file mode 100644
index 0000000000..cd32e787da
--- /dev/null
+++ b/support/texlab/crates/syntax/src/file_list.rs
@@ -0,0 +1,10 @@
+use std::path::PathBuf;
+
+use rustc_hash::FxHashSet;
+
+#[derive(Debug, PartialEq, Eq, Clone, Default)]
+pub struct FileList {
+ pub working_dir: Option<PathBuf>,
+ pub inputs: FxHashSet<PathBuf>,
+ pub outputs: FxHashSet<PathBuf>,
+}
diff --git a/support/texlab/crates/syntax/src/lib.rs b/support/texlab/crates/syntax/src/lib.rs
index 35f1bb8c52..d3e2098757 100644
--- a/support/texlab/crates/syntax/src/lib.rs
+++ b/support/texlab/crates/syntax/src/lib.rs
@@ -1,4 +1,5 @@
pub mod bibtex;
+pub mod file_list;
pub mod latex;
pub mod latexmkrc;
diff --git a/support/texlab/crates/texlab/Cargo.toml b/support/texlab/crates/texlab/Cargo.toml
index 4c142a2229..f4cb2d3283 100644
--- a/support/texlab/crates/texlab/Cargo.toml
+++ b/support/texlab/crates/texlab/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "texlab"
description = "LaTeX Language Server"
-version = "5.16.0"
+version = "5.19.0"
license.workspace = true
readme = "README.md"
authors.workspace = true
@@ -22,15 +22,15 @@ test = false
doctest = false
[dependencies]
-anyhow = "1.0.82"
+anyhow = "1.0.86"
base-db = { path = "../base-db" }
bibfmt = { path = "../bibfmt" }
citeproc = { path = "../citeproc" }
-clap = { version = "4.5.4", features = ["derive"] }
+clap = { version = "4.5.8", features = ["derive"] }
commands = { path = "../commands" }
completion = { path = "../completion" }
completion-data = { path = "../completion-data" }
-crossbeam-channel = "0.5.12"
+crossbeam-channel = "0.5.13"
definition = { path = "../definition" }
diagnostics = { path = "../diagnostics" }
distro = { path = "../distro" }
@@ -42,22 +42,22 @@ inlay-hints = { path = "../inlay-hints" }
ipc = { path = "../ipc" }
line-index = { path = "../line-index" }
links = { path = "../links" }
-log = "0.4.21"
+log = "0.4.22"
lsp-server = "0.7.6"
lsp-types = "0.95.1"
notify = "6.1.1"
notify-debouncer-full = "0.3.1"
-parking_lot = "0.12.1"
+parking_lot = "0.12.3"
parser = { path = "../parser" }
references = { path = "../references" }
-regex = "1.10.4"
+regex = "1.10.5"
rename = { path = "../rename" }
rowan = "0.15.15"
-rustc-hash = "1.1.0"
-serde = "1.0.195"
-serde_json = "1.0.115"
+rustc-hash = "2.0.0"
+serde = "1.0.203"
+serde_json = "1.0.119"
serde_regex = "1.1.0"
-serde_repr = "0.1.18"
+serde_repr = "0.1.19"
symbols = { path = "../symbols" }
syntax = { path = "../syntax" }
tempfile = "3.10.1"
diff --git a/support/texlab/crates/texlab/src/features/folding.rs b/support/texlab/crates/texlab/src/features/folding.rs
index b19fa8a4da..3669021201 100644
--- a/support/texlab/crates/texlab/src/features/folding.rs
+++ b/support/texlab/crates/texlab/src/features/folding.rs
@@ -9,7 +9,7 @@ pub fn find_all(
) -> Option<Vec<serde_json::Value>> {
let params = from_proto::feature_params(workspace, params.text_document)?;
- let foldings = folding::find_all(&params.document)
+ let foldings = folding::find_all(params.document)
.into_iter()
.filter_map(|folding| {
to_proto::folding_range(folding, &params.document.line_index, client_flags)
diff --git a/support/texlab/crates/texlab/src/features/formatting.rs b/support/texlab/crates/texlab/src/features/formatting.rs
index 3fcd66e39b..9d152f6e8b 100644
--- a/support/texlab/crates/texlab/src/features/formatting.rs
+++ b/support/texlab/crates/texlab/src/features/formatting.rs
@@ -27,6 +27,7 @@ pub fn format_source_code(
| Language::Log
| Language::Root
| Language::Latexmkrc
- | Language::Tectonic => None,
+ | Language::Tectonic
+ | Language::FileList => None,
}
}
diff --git a/support/texlab/crates/texlab/src/features/rename.rs b/support/texlab/crates/texlab/src/features/rename.rs
index b905a7105b..a65f42143b 100644
--- a/support/texlab/crates/texlab/src/features/rename.rs
+++ b/support/texlab/crates/texlab/src/features/rename.rs
@@ -18,5 +18,5 @@ pub fn rename_all(
let new_name = &params.new_name;
let params = from_proto::rename_params(workspace, params.text_document_position)?;
let result = rename::rename(params);
- Some(to_proto::workspace_edit(result, &new_name))
+ Some(to_proto::workspace_edit(result, new_name))
}
diff --git a/support/texlab/crates/texlab/src/main.rs b/support/texlab/crates/texlab/src/main.rs
index ceca02b7f7..d9bf6833d8 100644
--- a/support/texlab/crates/texlab/src/main.rs
+++ b/support/texlab/crates/texlab/src/main.rs
@@ -110,6 +110,7 @@ fn setup_logger(opts: &Opts) {
OpenOptions::new()
.write(true)
.create(true)
+ .truncate(true)
.open(log_file)
.expect("failed to open log file"),
),
diff --git a/support/texlab/crates/texlab/src/server.rs b/support/texlab/crates/texlab/src/server.rs
index ef70c42c71..ff3c7904d3 100644
--- a/support/texlab/crates/texlab/src/server.rs
+++ b/support/texlab/crates/texlab/src/server.rs
@@ -46,7 +46,7 @@ use self::{
#[derive(Debug)]
enum InternalMessage {
SetDistro(Distro),
- SetOptions(Options),
+ SetOptions(Box<Options>),
FileEvent(Vec<DebouncedEvent>),
Diagnostics,
ChktexFinished(Url, Vec<diagnostics::Diagnostic>),
@@ -309,7 +309,9 @@ impl Server {
.parse_options(json.pop().expect("invalid configuration request"))
.unwrap();
- sender.send(InternalMessage::SetOptions(options)).unwrap();
+ sender
+ .send(InternalMessage::SetOptions(Box::new(options)))
+ .unwrap();
}
Err(why) => {
log::error!("Retrieving configuration failed: {}", why);
@@ -700,19 +702,19 @@ impl Server {
let status = if pending_builds.lock().remove(&pid) {
if result?.success() {
- BuildStatus::SUCCESS
+ BuildStatus::Success
} else {
- BuildStatus::ERROR
+ BuildStatus::Error
}
} else {
- BuildStatus::CANCELLED
+ BuildStatus::Cancelled
};
Ok(status)
})
.unwrap_or_else(|why| {
log::error!("Failed to compile document \"{uri}\": {why}");
- BuildStatus::FAILURE
+ BuildStatus::Failure
});
drop(progress_reporter);
@@ -723,7 +725,7 @@ impl Server {
let _ = client.send_response(lsp_server::Response::new_ok(id, result));
}
- if fwd_search_after && status != BuildStatus::CANCELLED {
+ if fwd_search_after && status != BuildStatus::Cancelled {
let _ = internal.send(InternalMessage::ForwardSearch(uri, params.position));
}
});
@@ -760,7 +762,7 @@ impl Server {
self.pool.execute(move || {
let status = match command.and_then(ForwardSearch::run) {
- Ok(()) => ForwardSearchStatus::SUCCESS,
+ Ok(()) => ForwardSearchStatus::Success,
Err(why) => {
log::error!("Failed to execute forward search: {why}");
ForwardSearchStatus::from(why)
@@ -1071,7 +1073,7 @@ impl Server {
self.workspace.write().set_distro(distro);
}
InternalMessage::SetOptions(options) => {
- self.update_options(options);
+ self.update_options(*options);
}
InternalMessage::FileEvent(events) => {
for event in events {
diff --git a/support/texlab/crates/texlab/src/server/extensions.rs b/support/texlab/crates/texlab/src/server/extensions.rs
index ce876c7892..8fa78ef3d2 100644
--- a/support/texlab/crates/texlab/src/server/extensions.rs
+++ b/support/texlab/crates/texlab/src/server/extensions.rs
@@ -33,10 +33,10 @@ pub struct BuildResult {
#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize_repr, Deserialize_repr)]
#[repr(i32)]
pub enum BuildStatus {
- SUCCESS = 0,
- ERROR = 1,
- FAILURE = 2,
- CANCELLED = 3,
+ Success = 0,
+ Error = 1,
+ Failure = 2,
+ Cancelled = 3,
}
pub struct ForwardSearchRequest;
@@ -52,21 +52,21 @@ impl lsp_types::request::Request for ForwardSearchRequest {
#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize_repr, Deserialize_repr)]
#[repr(i32)]
pub enum ForwardSearchStatus {
- SUCCESS = 0,
- ERROR = 1,
- FAILURE = 2,
- UNCONFIGURED = 3,
+ Success = 0,
+ Error = 1,
+ Failure = 2,
+ Unconfigured = 3,
}
impl From<ForwardSearchError> for ForwardSearchStatus {
fn from(why: ForwardSearchError) -> Self {
match why {
- ForwardSearchError::Unconfigured => ForwardSearchStatus::UNCONFIGURED,
- ForwardSearchError::NotLocal(_) => ForwardSearchStatus::FAILURE,
- ForwardSearchError::InvalidPath(_) => ForwardSearchStatus::ERROR,
- ForwardSearchError::TexNotFound(_) => ForwardSearchStatus::FAILURE,
- ForwardSearchError::PdfNotFound(_) => ForwardSearchStatus::ERROR,
- ForwardSearchError::LaunchViewer(_) => ForwardSearchStatus::ERROR,
+ ForwardSearchError::Unconfigured => ForwardSearchStatus::Unconfigured,
+ ForwardSearchError::NotLocal(_) => ForwardSearchStatus::Failure,
+ ForwardSearchError::InvalidPath(_) => ForwardSearchStatus::Error,
+ ForwardSearchError::TexNotFound(_) => ForwardSearchStatus::Failure,
+ ForwardSearchError::PdfNotFound(_) => ForwardSearchStatus::Error,
+ ForwardSearchError::LaunchViewer(_) => ForwardSearchStatus::Error,
}
}
}
diff --git a/support/texlab/crates/texlab/src/server/options.rs b/support/texlab/crates/texlab/src/server/options.rs
index 02200392f6..f4853d7cb9 100644
--- a/support/texlab/crates/texlab/src/server/options.rs
+++ b/support/texlab/crates/texlab/src/server/options.rs
@@ -1,11 +1,11 @@
-use regex::Regex;
use serde::{Deserialize, Serialize};
+use regex::Regex;
+
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[serde(default)]
pub struct Options {
- pub root_directory: Option<String>,
pub aux_directory: Option<String>,
pub bibtex_formatter: BibtexFormatter,
pub latex_formatter: LatexFormatter,
@@ -70,6 +70,7 @@ pub struct BuildOptions {
pub log_directory: Option<String>,
pub pdf_directory: Option<String>,
pub filename: Option<String>,
+ pub use_file_list: bool,
}
#[derive(Debug, PartialEq, Eq, Clone, Default, Serialize, Deserialize)]
@@ -126,7 +127,9 @@ pub struct ExperimentalOptions {
pub verbatim_environments: Vec<String>,
pub citation_commands: Vec<String>,
pub label_definition_commands: Vec<String>,
+ pub label_definition_prefixes: Vec<(String, String)>,
pub label_reference_commands: Vec<String>,
+ pub label_reference_prefixes: Vec<(String, String)>,
}
#[derive(Debug, PartialEq, Eq, Clone, Default, Serialize, Deserialize)]
diff --git a/support/texlab/crates/texlab/src/util.rs b/support/texlab/crates/texlab/src/util.rs
index d9ec5a2fb1..87e41a78ae 100644
--- a/support/texlab/crates/texlab/src/util.rs
+++ b/support/texlab/crates/texlab/src/util.rs
@@ -18,11 +18,30 @@ pub fn normalize_uri(uri: &mut lsp_types::Url) {
}
}
+ uri.set_path(&normalize_percent_encoding(uri.path()));
uri.set_fragment(None);
}
+fn normalize_percent_encoding(input: &str) -> String {
+ let mut output = String::new();
+ let mut i = 0;
+ for c in input.chars() {
+ if c == '%' && i == 0 {
+ output.push(c);
+ i = 2;
+ } else if i > 0 {
+ output.push(c.to_ascii_uppercase());
+ i -= 1;
+ } else {
+ output.push(c);
+ }
+ }
+
+ output
+}
+
fn fix_drive_letter(text: &str) -> Option<String> {
- if !text.is_ascii() || text.len() == 0 {
+ if !text.is_ascii() || text.is_empty() {
return None;
}
@@ -59,4 +78,44 @@ mod tests {
normalize_uri(&mut uri);
assert_eq!(uri.as_str(), "foo:///bar/baz.txt");
}
+
+ #[test]
+ #[cfg(unix)]
+ fn test_lowercase_percent_encoding_unix() {
+ let mut uri1 = Url::parse("file:///foo/%c3%a4.tex").unwrap();
+ let uri2 = Url::from_file_path("/foo/ä.tex").unwrap();
+
+ normalize_uri(&mut uri1);
+ assert_eq!(uri1, uri2);
+ }
+
+ #[test]
+ #[cfg(unix)]
+ fn test_uppercase_percent_encoding_unix() {
+ let mut uri1 = Url::parse("file:///foo/%C3%A4.tex").unwrap();
+ let uri2 = Url::from_file_path("/foo/ä.tex").unwrap();
+
+ normalize_uri(&mut uri1);
+ assert_eq!(uri1, uri2);
+ }
+
+ #[test]
+ #[cfg(windows)]
+ fn test_lowercase_percent_encoding_windows() {
+ let mut uri1 = Url::parse("file:///c%3a/foo/%c3%a4.tex").unwrap();
+ let uri2 = Url::from_file_path("C:/foo/ä.tex").unwrap();
+
+ normalize_uri(&mut uri1);
+ assert_eq!(uri1, uri2);
+ }
+
+ #[test]
+ #[cfg(windows)]
+ fn test_uppercase_percent_encoding_windows() {
+ let mut uri1 = Url::parse("file:///c%3A/foo/%C3%A4.tex").unwrap();
+ let uri2 = Url::from_file_path("C:/foo/ä.tex").unwrap();
+
+ normalize_uri(&mut uri1);
+ assert_eq!(uri1, uri2);
+ }
}
diff --git a/support/texlab/crates/texlab/src/util/client_flags.rs b/support/texlab/crates/texlab/src/util/client_flags.rs
index 842dbb1eae..2829041832 100644
--- a/support/texlab/crates/texlab/src/util/client_flags.rs
+++ b/support/texlab/crates/texlab/src/util/client_flags.rs
@@ -20,18 +20,12 @@ pub struct ClientFlags {
/// If not set, then fuzzy citation completion will not work.
pub completion_always_incomplete: bool,
- /// If `true`, the server can include markdown in hover responses.
- pub hover_markdown: bool,
-
/// If `true`, the server can pull the configuration from the client.
pub configuration_pull: bool,
/// If `true`, the client notifies the server when the configuration changes.
pub configuration_push: bool,
- /// If `true`, the client can return `LocationLink` instead of `Location`.
- pub definition_link: bool,
-
/// If `true`, the server can return custom kinds like `section`.
pub folding_custom_kinds: bool,
diff --git a/support/texlab/crates/texlab/src/util/from_proto.rs b/support/texlab/crates/texlab/src/util/from_proto.rs
index db4f3a5b39..b55e3cb0e3 100644
--- a/support/texlab/crates/texlab/src/util/from_proto.rs
+++ b/support/texlab/crates/texlab/src/util/from_proto.rs
@@ -56,15 +56,6 @@ pub fn client_flags(
let completion_always_incomplete = info.map_or(false, |info| info.name == "Visual Studio Code");
- let hover_markdown = capabilities
- .text_document
- .as_ref()
- .and_then(|cap| cap.hover.as_ref())
- .and_then(|cap| cap.content_format.as_ref())
- .map_or(false, |formats| {
- formats.contains(&lsp_types::MarkupKind::Markdown)
- });
-
let configuration_pull = capabilities
.workspace
.as_ref()
@@ -78,13 +69,6 @@ pub fn client_flags(
.and_then(|cap| cap.dynamic_registration)
.unwrap_or(false);
- let definition_link = capabilities
- .text_document
- .as_ref()
- .and_then(|cap| cap.definition)
- .and_then(|cap| cap.link_support)
- .unwrap_or(false);
-
let folding_custom_kinds = capabilities
.text_document
.as_ref()
@@ -111,30 +95,25 @@ pub fn client_flags(
completion_snippets,
completion_kinds,
completion_always_incomplete,
- hover_markdown,
configuration_pull,
configuration_push,
- definition_link,
folding_custom_kinds,
progress,
show_document,
}
}
-pub fn rename_params<'a>(
- workspace: &'a Workspace,
+pub fn rename_params(
+ workspace: &Workspace,
params: lsp_types::TextDocumentPositionParams,
-) -> Option<RenameParams<'a>> {
+) -> Option<RenameParams> {
let (feature, offset) =
feature_params_offset(workspace, params.text_document, params.position)?;
Some(RenameParams { feature, offset })
}
-pub fn hover_params<'a>(
- workspace: &'a Workspace,
- params: lsp_types::HoverParams,
-) -> Option<HoverParams<'a>> {
+pub fn hover_params(workspace: &Workspace, params: lsp_types::HoverParams) -> Option<HoverParams> {
let (feature, offset) = feature_params_offset(
workspace,
params.text_document_position_params.text_document,
@@ -144,8 +123,8 @@ pub fn hover_params<'a>(
Some(HoverParams { feature, offset })
}
-pub fn inlay_hint_params<'a>(
- workspace: &'a Workspace,
+pub fn inlay_hint_params(
+ workspace: &Workspace,
params: lsp_types::InlayHintParams,
) -> Option<InlayHintParams> {
let feature = feature_params(workspace, params.text_document)?;
@@ -153,10 +132,10 @@ pub fn inlay_hint_params<'a>(
Some(InlayHintParams { feature, range })
}
-pub fn highlight_params<'a>(
- workspace: &'a Workspace,
+pub fn highlight_params(
+ workspace: &Workspace,
params: lsp_types::DocumentHighlightParams,
-) -> Option<HighlightParams<'a>> {
+) -> Option<HighlightParams<'_>> {
let (feature, offset) = feature_params_offset(
workspace,
params.text_document_position_params.text_document,
@@ -166,10 +145,10 @@ pub fn highlight_params<'a>(
Some(HighlightParams { feature, offset })
}
-pub fn definition_params<'a>(
- workspace: &'a Workspace,
+pub fn definition_params(
+ workspace: &Workspace,
params: lsp_types::GotoDefinitionParams,
-) -> Option<DefinitionParams<'a>> {
+) -> Option<DefinitionParams> {
let (feature, offset) = feature_params_offset(
workspace,
params.text_document_position_params.text_document,
@@ -179,10 +158,10 @@ pub fn definition_params<'a>(
Some(DefinitionParams { feature, offset })
}
-pub fn completion_params<'a>(
- workspace: &'a Workspace,
+pub fn completion_params(
+ workspace: &Workspace,
params: lsp_types::CompletionParams,
-) -> Option<CompletionParams<'a>> {
+) -> Option<CompletionParams> {
let (feature, offset) = feature_params_offset(
workspace,
params.text_document_position.text_document,
@@ -192,10 +171,10 @@ pub fn completion_params<'a>(
Some(CompletionParams { feature, offset })
}
-pub fn reference_params<'a>(
- workspace: &'a Workspace,
+pub fn reference_params(
+ workspace: &Workspace,
params: lsp_types::ReferenceParams,
-) -> Option<ReferenceParams<'a>> {
+) -> Option<ReferenceParams> {
let (feature, offset) = feature_params_offset(
workspace,
params.text_document_position.text_document,
@@ -210,19 +189,19 @@ pub fn reference_params<'a>(
})
}
-pub fn feature_params<'a>(
- workspace: &'a Workspace,
+pub fn feature_params(
+ workspace: &Workspace,
text_document: lsp_types::TextDocumentIdentifier,
-) -> Option<FeatureParams<'a>> {
+) -> Option<FeatureParams> {
let document = workspace.lookup(&text_document.uri)?;
Some(FeatureParams::new(workspace, document))
}
-pub fn feature_params_offset<'a>(
- workspace: &'a Workspace,
+pub fn feature_params_offset(
+ workspace: &Workspace,
text_document: lsp_types::TextDocumentIdentifier,
position: lsp_types::Position,
-) -> Option<(FeatureParams<'a>, TextSize)> {
+) -> Option<(FeatureParams, TextSize)> {
let feature = feature_params(workspace, text_document)?;
let offset = feature.document.line_index.offset_lsp(position)?;
Some((feature, offset))
@@ -236,7 +215,6 @@ pub fn completion_resolve_info(item: &mut lsp_types::CompletionItem) -> Option<R
pub fn config(value: Options) -> Config {
let mut config = Config::default();
- config.root_dir = value.root_directory;
config.build.program = value.build.executable.unwrap_or(config.build.program);
config.build.args = value.build.args.unwrap_or(config.build.args);
@@ -362,8 +340,18 @@ pub fn config(value: Options) -> Config {
config
.syntax
+ .label_definition_prefixes
+ .extend(value.experimental.label_definition_prefixes);
+
+ config
+ .syntax
.label_reference_commands
.extend(value.experimental.label_reference_commands);
config
+ .syntax
+ .label_reference_prefixes
+ .extend(value.experimental.label_reference_prefixes);
+
+ config
}
diff --git a/support/texlab/crates/texlab/src/util/to_proto.rs b/support/texlab/crates/texlab/src/util/to_proto.rs
index f5cf2edf8b..d2c261c8fb 100644
--- a/support/texlab/crates/texlab/src/util/to_proto.rs
+++ b/support/texlab/crates/texlab/src/util/to_proto.rs
@@ -396,8 +396,15 @@ pub fn workspace_edit(result: RenameResult, new_name: &str) -> lsp_types::Worksp
let mut edits = Vec::new();
ranges
.into_iter()
- .filter_map(|range| document.line_index.line_col_lsp_range(range))
- .for_each(|range| edits.push(lsp_types::TextEdit::new(range, new_name.into())));
+ .filter_map(|info| {
+ document.line_index.line_col_lsp_range(info.range).map(|i| {
+ (
+ i,
+ info.prefix.map_or(new_name.into(), |p| p + new_name.into()),
+ )
+ })
+ })
+ .for_each(|(range, new_name)| edits.push(lsp_types::TextEdit::new(range, new_name)));
changes.insert(document.uri.clone(), edits);
}
diff --git a/support/texlab/texlab.1 b/support/texlab/texlab.1
index 2d4e412dc9..852d37051e 100644
--- a/support/texlab/texlab.1
+++ b/support/texlab/texlab.1
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
-.TH TEXLAB "1" "May 2024" "texlab 5.16.0" "User Commands"
+.TH TEXLAB "1" "July 2024" "texlab 5.19.0" "User Commands"
.SH NAME
-texlab \- manual page for texlab 5.16.0
+texlab \- manual page for texlab 5.19.0
.SH SYNOPSIS
.B texlab
[\fI\,OPTIONS\/\fR] [\fI\,COMMAND\/\fR]
diff --git a/support/texlab/texlab.pdf b/support/texlab/texlab.pdf
index fe59b1f434..55922ca427 100644
--- a/support/texlab/texlab.pdf
+++ b/support/texlab/texlab.pdf
Binary files differ
diff --git a/support/texlogfilter/README b/support/texlogfilter/README
index d621a2aeb4..e2f626bed7 100644
--- a/support/texlogfilter/README
+++ b/support/texlogfilter/README
@@ -66,10 +66,13 @@ texlogfilter
of all distributions of LaTeX version 2005/12/01 or later.
VERSION
- 1.1
+ 1.3.1
HISTORY
- * 2024, February, version 1.3: better detect the current file name.
+ * 2024, June, versions 1.4: add warning patterns.
+
+ * 2024, February, versions 1.3 and 1.3.1: better detect the current
+ file name.
* 2024, February, version 1.2: fix duplicate or missing lines; handle
package and class names with hyphen; add info and warning patterns
diff --git a/support/texlogfilter/texlogfilter b/support/texlogfilter/texlogfilter
index 341318e576..d5086b75e8 100755
--- a/support/texlogfilter/texlogfilter
+++ b/support/texlogfilter/texlogfilter
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
################################################################################
# texlogfilter - filter latex engines output or log file
-# Julien Labbé, 2021
+# Julien Labbé, 2021-2024
#
# This work may be distributed and/or modified under the conditions of the LaTeX
# Project Public License, either version 1.3 of this license or (at your option)
@@ -16,7 +16,7 @@ use Getopt::Long;
use Term::ANSIColor;
my $name = "texlogfilter";
-my $version = "1.3";
+my $version = "1.4";
# options
my @userfilters;
@@ -188,7 +188,7 @@ while (<>) {
# assume currentfile is given in the last open parenthesis
# (works badly for packages)
if (/^[^(]*\)/) {$currentfile = ""; $lastfile = "";}
- if (/\(([^)]+($extpattern))$/) {$currentfile = $1;}
+ if (/\(([^)]+($extpattern))[^)]*$/) {$currentfile = $1;}
# try to show usefull lines following some warnings or errors (starting with
# whitespaces or package name)
@@ -209,12 +209,13 @@ while (<>) {
elsif (/^(!|.*?:\d+:)/i) { handle_error(); }
elsif (/^No pages of output/i) { handle_error(); }
- # find warning
+ # find warnings
elsif (/^(!\s+)?(Class|Package)\s+(\S+)?\s*Warning/i) { if ($3){$currentpackage=$3}; handle_warning(0, "nofilename"); }
elsif (/^(!\s+)?(LaTeX|\* LaTeX) Warning: (Citation|Reference)/i) { if ($showrefmsg) {handle_warning();} }
elsif (/^(!\s+)?(LaTeX|\* LaTeX) Font Warning/i) { $currentpackage="Font"; handle_warning(); }
elsif (/^(!\s+)?(LaTeX|\* LaTeX) Warning/i) { handle_warning(); }
- elsif (/Runaway argument\?/i) { handle_warning(1); }
+ elsif (/Runaway (definition|argument|preamble|text)\?/i) { handle_warning(1); }
+ elsif (/Missing character: There is no /i) { handle_warning(); }
elsif (/(overfull|underfull|badbox)/i) { if ($showboxmsg){handle_warning(1);} }
# find infos
@@ -336,13 +337,15 @@ distributions of LaTeX version 2005/12/01 or later.
=head2 VERSION
-1.1
+1.3.1
=head2 HISTORY
=over
-=item * 2024, February, version 1.3: better detect the current file name.
+=item * 2024, June, versions 1.4: add warning patterns.
+
+=item * 2024, February, versions 1.3 and 1.3.1: better detect the current file name.
=item * 2024, February, version 1.2: fix duplicate or missing lines; handle
package and class names with hyphen; add info and warning patterns for fonts.
diff --git a/support/texlogfilter/texlogfilter.html b/support/texlogfilter/texlogfilter.html
index 350951829e..1df9cdb065 100644
--- a/support/texlogfilter/texlogfilter.html
+++ b/support/texlogfilter/texlogfilter.html
@@ -88,13 +88,16 @@
<h2 id="VERSION">VERSION</h2>
-<p>1.1</p>
+<p>1.3.1</p>
<h2 id="HISTORY">HISTORY</h2>
<ul>
-<li><p>2024, February, version 1.3: better detect the current file name.</p>
+<li><p>2024, June, versions 1.4: add warning patterns.</p>
+
+</li>
+<li><p>2024, February, versions 1.3 and 1.3.1: better detect the current file name.</p>
</li>
<li><p>2024, February, version 1.2: fix duplicate or missing lines; handle package and class names with hyphen; add info and warning patterns for fonts.</p>
diff --git a/support/texplate/README.md b/support/texplate/README.md
index 43673ed917..ea0f023a35 100644
--- a/support/texplate/README.md
+++ b/support/texplate/README.md
@@ -4,19 +4,26 @@
![Minimum JRE: 8.0](https://img.shields.io/badge/Minimum_JRE-8.0-blue.svg?style=flat-square)
![Current version](https://img.shields.io/badge/dynamic/json.svg?color=blue&label=Latest%20release&query=%24.0.name&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F13793875%2Frepository%2Ftags&style=flat-square)
-TeXplate is a tool for creating document structures based on templates. The application name is a word play on _TeX_ and _template_, so the purpose seems quite obvious: we want to provide an easy and straightforward framework for reducing the typical code boilerplate when writing TeX documents. Also note that one can easily extrapolate the use beyond articles and theses: the application is powerful enough to generate _any_ text-based structure, given that a corresponding template exists.
+TeXplate is a tool for creating document structures based on templates. The
+application name is a word play on _TeX_ and _template_, so the purpose seems
+quite obvious: we want to provide an easy and straightforward framework for
+reducing the typical code boilerplate when writing TeX documents. Also note that
+one can easily extrapolate the use beyond articles and theses: the application
+is powerful enough to generate _any_ text-based structure, given that a
+corresponding template exists.
## Basic use
-Our tool is a typical command line application, so we need to invoke it by simply typing `texplate` in the terminal:
+Our tool is a typical command line application, so we need to invoke it by
+simply typing `texplate` in the terminal:
```bash
$ texplate
______ __ __ ___ __
-/\__ _\ /\ \ /\ \ /\_ \ /\ \__
-\/_/\ \/ __ \ `\`\/'/' _____\//\ \ __ \ \ ,_\ __
- \ \ \ /'__`\`\/ > < /\ '__`\\ \ \ /'__`\ \ \ \/ /'__`\
- \ \ \/\ __/ \/'/\`\\ \ \L\ \\_\ \_/\ \L\.\_\ \ \_/\ __/
+/\__ _\ /\ \ /\ \ /\_ \ /\ \__
+\/_/\ \/ __ \ `\`\/'/' _____\//\ \ __ \ \ ,_\ __
+ \ \ \ /'__`\`\/ > < /\ '__`\\ \ \ /'__`\ \ \ \/ /'__`\
+ \ \ \/\ __/ \/'/\`\\ \ \L\ \\_\ \_/\ \L\.\_\ \ \_/\ __/
\ \_\ \____\ /\_\\ \_\ \ ,__//\____\ \__/.\_\\ \__\ \____\
\/_/\/____/ \/_/ \/_/\ \ \/ \/____/\/__/\/_/ \/__/\/____/
\ \_\
@@ -55,23 +62,42 @@ Usage: texplate [-c=<configuration>] -o=<output> [-t=<template>]
-Provided that TeXplate is properly available in the underlying operating system, we will get a lovely, colorful output in our terminal, along with a couple of scary messages telling that some required options are missing. Our tool provides four options, described as follows. Strictly speaking, there is only one mandatory option. The remainder might be optional, depending on certain scenarios.
+Provided that TeXplate is properly available in the underlying operating system,
+we will get a lovely, colorful output in our terminal, along with a couple of
+scary messages telling that some required options are missing. Our tool provides
+four options, described as follows. Strictly speaking, there is only one
+mandatory option. The remainder might be optional, depending on certain
+scenarios.
### Output
-Referred as either`-o` (short representation) or `--output` (long representation), this option holds the output file in which the chosen template will be effectively written. The name is arbitrary, so you can use anything to your heart's desires. Keep in mind, however, that an existing file will be mercilessly overwritten. Also, make sure the path has the proper permissions for writing the output file.
+Referred as either`-o` (short representation) or `--output` (long
+representation), this option holds the output file in which the chosen template
+will be effectively written. The name is arbitrary, so you can use anything to
+your heart's desires. Keep in mind, however, that an existing file will be
+mercilessly overwritten. Also, make sure the path has the proper permissions for
+writing the output file.
### Template
-Referred as either `-t` (short representation) or `--template` (long representation), this option holds the reference to the template to be potentially merged with data and properly generated. The provided string should match the template identifier, otherwise TeXplate will raise an error complaining about the missing reference.
+Referred as either `-t` (short representation) or `--template` (long
+representation), this option holds the reference to the template to be
+potentially merged with data and properly generated. The provided string should
+match the template identifier, otherwise TeXplate will raise an error
+complaining about the missing reference.
### Map
-Referred as either `-m` (short representation) or `--map` (long representation), this option holds a map entry, defined as a `key=value` ordered pair (mind the `=` symbol used as entry separator). This option can be used multiple times. The map entry denotes a variable in the template context, where the key is the variable name and the value is set to be the initial state of such variable.
+Referred as either `-m` (short representation) or `--map` (long representation),
+this option holds a map entry, defined as a `key=value` ordered pair (mind the
+`=` symbol used as entry separator). This option can be used multiple times. The
+map entry denotes a variable in the template context, where the key is the
+variable name and the value is set to be the initial state of such variable.
## Examples
-For instance, let us generate a document named `doc1.tex`, based on the standard `article` class:
+For instance, let us generate a document named `doc1.tex`, based on the standard
+`article` class:
```bash
$ texplate -t article -o doc1.tex
@@ -103,7 +129,8 @@ Done! Enjoy your template!
Written: 112 B
```
-And that is it! We provided the template name (`-t article`) and the output (`-o doc1.tex`). Checking the contents of `doc1.tex`:
+And that is it! We provided the template name (`-t article`) and the output (`-o
+doc1.tex`). Checking the contents of `doc1.tex`:
```tex
\documentclass{article}
@@ -116,13 +143,18 @@ And that is it! We provided the template name (`-t article`) and the output (`-o
\end{document}
```
-We could enhance the template generation by providing further options to it. Let us say we want to include A4 as the paper size for our document and use XeTeX as engine. The command line is as follows (we omitted the full output for reducing verbosity):
+We could enhance the template generation by providing further options to it. Let
+us say we want to include A4 as the paper size for our document and use XeTeX as
+engine. The command line is as follows (we omitted the full output for reducing
+verbosity):
```bash
$ texplate -t article -o doc2.tex -m options=a4paper -m xetex=true
```
-For this example, we added two map entries referring to the class option and the support for newer engines (please refer to the user manual for more details on template options). The newly generated `doc2.tex` document is as follows:
+For this example, we added two map entries referring to the class option and the
+support for newer engines (please refer to the user manual for more details on
+template options). The newly generated `doc2.tex` document is as follows:
```tex
\documentclass[a4paper]{article}
@@ -159,13 +191,20 @@ Checking the contents of `doc3.tex`:
\end{document}
```
-And that is it! Make sure to take a look at the user manual to learn more about TeXplate!
+And that is it! Make sure to take a look at the user manual to learn more about
+TeXplate!
## License
-This application is licensed under the [New BSD License](https://opensource.org/licenses/BSD-3-Clause). Please note that the New BSD License has been verified as a GPL-compatible free software license by the [Free Software Foundation](http://www.fsf.org/), and has been vetted as an open source license by the [Open Source Initiative](http://www.opensource.org/).
+This application is licensed under the
+[New BSD License](https://opensource.org/licenses/BSD-3-Clause). Please note
+that the New BSD License has been verified as a GPL-compatible free software
+license by the [Free Software Foundation](http://www.fsf.org/), and has been
+vetted as an open source license by the
+[Open Source Initiative](http://www.opensource.org/).
## The team
-TeXplate is brought to you by Ben Frank and Paulo Cereda. If you want to support TeX development by a donation, the best way to do this is donating to the [TeX Users Group](https://www.tug.org/donate.html).
-
+TeXplate is brought to you by the Island of TeX. If you want to support TeX
+development by a donation, the best way to do this is donating to the
+[TeX Users Group](https://www.tug.org/donate.html).
diff --git a/support/texplate/doc/texplate-manual.pdf b/support/texplate/doc/texplate-manual.pdf
index 6f20dd4c2f..96d574ace6 100644
--- a/support/texplate/doc/texplate-manual.pdf
+++ b/support/texplate/doc/texplate-manual.pdf
Binary files differ
diff --git a/support/texplate/doc/texplate-manual.tex b/support/texplate/doc/texplate-manual.tex
index a56911ab72..1de47ab149 100644
--- a/support/texplate/doc/texplate-manual.tex
+++ b/support/texplate/doc/texplate-manual.tex
@@ -17,7 +17,7 @@
\newcommand{\shortopt}[1]{{\ttfamily-#1}}
\newcommand{\longopt}[1]{{\ttfamily{-}{-}#1}}
\newcommand{\macro}[1]{{\ttfamily\textbackslash#1}}
-\newcommand{\texplateversion}{1.0.4}
+\newcommand{\texplateversion}{1.0.6}
\title{A gentle introduction to \texplate:\\ a document structure creation tool}
\author{Island of \TeX}
@@ -624,7 +624,23 @@ Happy \TeX ing with \texplate!
\chapter*{Changelog}
-\section*{1.0.4 (current)}
+\section*{1.0.6 (current)}
+
+\subsection*{Fixed}
+
+\begin{itemize}
+\item Application version is now retrieved from the manifest (regression fix).
+\end{itemize}
+
+\section*{1.0.5 (2024-08-01)}
+
+\subsection*{Changed}
+
+\begin{itemize}
+\item Updated dependencies to close a security vulnerability.
+\end{itemize}
+
+\section*{1.0.4 (2021-07-27)}
\subsection*{Fixed}
diff --git a/support/texshop/README.txt b/support/texshop/README.txt
index 6f4fffab08..c48dab2cd5 100644
--- a/support/texshop/README.txt
+++ b/support/texshop/README.txt
@@ -7,4 +7,4 @@ The main author is Richard Koch, koch@uoregon.edu, with supporting contributions
Consult the program web site, https://pages.uoregon.edu/koch/texshop/texshop.html,
for full source code, an extensive Changes document, and other information.
-The current version, 5.33, was released on April 24, 2024. \ No newline at end of file
+The current version, 5.44, was released on September 12, 2024. \ No newline at end of file
diff --git a/support/texshop/texshop533.html b/support/texshop/texshop533.html
deleted file mode 100644
index 84a8babdd5..0000000000
--- a/support/texshop/texshop533.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>TeXShop</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <style type="text/css" media="screen">@import "v1.css";</style>
-</head>
-
-<body>
-
-There are three changes in version 5.33:
-<ul>
-<p><li> When a new source file is first typeset, the output will appear in the Preview window scrolled to the top of the first page. Previously, it might be scrolled partly down this page.
-<p><li> When a preview window is closed and later the document is typeset, the preview window will reappear scrolled to the top of the first page. Previously it might be scrolled to a position in the middle of the document.
-<p><li> John Collin's latexmk has been updated to version 4.85.
-</ul>
-<p> TeXShop was only possible because Apple provided developers with pre-built objects for crucial tasks: NSTextView for an editor, and PdfKit for a preview window. When the project started, I anxiously looked through the Pdf API's to see if Apple provided a routine to replace the old pdf file being displayed by a new version of the file; they did.
-<p> Apple cannot anticipate or fully support all possible uses of their objects. When a new pdf is displayed in a window, it is always opened at the top of the file. If the view should be scrolled to a new position, I have to do that myself. But the API's assume that scroll bars are mostly manipulated by users, and provide only a vague "scroll region to visible" command for programmers to scroll the preview window. Moreover, if the programmer tries to scroll the pdf when it is opened, that scroll produces an annoying flash. I wrote Apple complaining about the flash, and they told me that there is nothing they can do to fix it. So I have to fix it at my end.
-<p> When a LaTeX source file is opened, TeXShop reads the file and displays the text in a source window. Then it checks to see if a related pdf file is available. If so, TeXShop opens the pdf in a preview window using a routine I wrote named
-"showWithPath". Later when the user typesets, TeXShop switches from the original pdf to the new pdf using a routine I wrote named "reShowWithPath".
-<p>The "showWithPath" code is straightforward and I have no problems revising it. But "reShowWithPath" is an entirely different matter and I dread having to even look at it. This is the piece of code that determines the scroll location of the old pdf, loads the new pdf, and then scrolls the new pdf to that same location. It also contains code which hides the screen for a fraction of a second so nobody sees the flash and then uncovers the screen before the user notices a pause and complains. All that scrolling is far from trivial because Apple doesn't provide code to do it automatically. If the user has eliminated part of the text before typesetting, the old scroll location may no longer occur
-and the code has to gracefully adjust. Just writing about "reShowWithPath" gives me the shivers, and having to modify it leads to nightmares. I hope I never have to touch it again.
-<p> The bugs fixed in version 5.33 are related to these routines. If you receive the source code of a document from a friend and open it in TeXShop, there is no pdf file to display and so "showWithPath" is never called. When you typeset, TeXShop calls "reShowWithPath", but there is no previous version and thus no previous scroll position. In this special situation,
-the revised "reShowWithPath" just initializes the pdf and displays it without scrolling. That same situation occurs when you begin writing a new document in TeXShop and haven't yet typeset it.
-<p> Each source document in TeXShop corresponds to an NSDocument object in computer memory. This object contains the source text and all the windows which might be needed to process it: source window, log window, console window, preview window, etc. If you close the source window, then all of this data is removed from computer memory. But if you close one of the auxiliary windows, like the preview window, it is removed from the screen, but all the data in NSDocument still exists in memory. If you typeset again, the preview window will reappear in its old position. This is not what users expect, since they believe that closing the window made it go away entirely. The final bug fix maintains that illusion by opening the window at its beginning, as though it were being opened for the first time.
-
-</body>
-</html>
diff --git a/support/texshop/texshop544.html b/support/texshop/texshop544.html
new file mode 100644
index 0000000000..71cd7ca483
--- /dev/null
+++ b/support/texshop/texshop544.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>TeXShop</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+
+<body>
+
+
+<!-- main content -->
+<div id="main">
+
+Version 5.43 was never released. Version 5.44 has two minor changes listed below. In addition, version 5.44 supports Writing Tools, an important component of Apple Intelligence on macOS 15, Sequoia.
+<ul>
+<p><li> Holding down the option key while selecting the Typeset menu, or holding down option-command-T, erases aux files and then typesets. This behavior has been extended to the Typeset icon in the toolbar; holding down the option key and clicking this icon now erases aux files and then typesets.
+<p><li> The tab menu in the toolbar lists the beginnings of chapters, sections, subsections, and so forth; selecting an item in this menu takes you to the corresponding spot in the source file. This menu is supposed to be updated as the user edits the source file. Curiously, a bug prevented this update if the toolbar was in "Text Only" mode. This bug went unreported for perhaps twenty years. Now it is fixed.
+
+<p> TeXShop has a preference setting which creates a Tags menu in the main menu bar, duplicating the Tags menu in the toolbar. The bug also affected this menu bar item. I am unable to fix this second bug without risking performance issues for the editor. However, if both tags menus are visible and the menu bar version becomes out of date, using the toolbar version once will update both versions.
+</ul>
+
+
+<p>
+<p>
+</div>
+
+
+</body>
+</html> \ No newline at end of file