Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
18fd260
Add former BiBTeXML project as BiBTeX subsystem
tkw1536 Jan 16, 2020
b4f5dbf
Update MakeBibliography to use BiBTeX emulator
tkw1536 Jan 21, 2020
a4feb8d
Add bibtex daemon test
tkw1536 Jan 24, 2020
252954c
Make BiBTeX entry lookups more efficient
tkw1536 Jan 29, 2020
cb0b153
Initial support for BBL preamble
tkw1536 Jan 29, 2020
d53a8b3
Add a hook for additional <tag>s within bibitems
tkw1536 Jan 30, 2020
a45e2e3
Add 'make bibtest' target
tkw1536 Jan 30, 2020
a7ede6d
Rename 'BibTag' -> 'BibField'
tkw1536 Jan 30, 2020
2c09d4a
BibTeX Tests: Remove leftover testing code
tkw1536 Jan 30, 2020
83a4460
Cleanup codestyle for Post/BiBTeX/Bibliography
tkw1536 Jan 30, 2020
75ff533
Remove lib/LaTeXML/Post/BiBTeX/Compiler.pm
tkw1536 Jan 30, 2020
e22b618
Remove lib/LaTeXML/Post/BiBTeX/Bibliography.pm
tkw1536 Jan 30, 2020
199f855
Remove lib/LaTeXML/Post/BiBTeX/BibStyle.pm
tkw1536 Jan 31, 2020
9975c37
Cleanup codestyle for Post/BiBTeX/BibStyle
tkw1536 Jan 31, 2020
7acdb0c
Refactor: Remove unuused import
tkw1536 Jan 31, 2020
3e6f791
Cleanup codestyle for Post/BiBTeX/Cmd
tkw1536 Jan 31, 2020
f45fc8a
Cleanup codestyle for Post/BiBTeX/Common
tkw1536 Jan 31, 2020
d5ac9c0
Cleanup codestyle for Post/BiBTeX/Compiler
tkw1536 Jan 31, 2020
a618802
More codestyle
tkw1536 Jan 31, 2020
c1168c7
bibtexml: Add additional "use" command
tkw1536 Jun 15, 2021
f168fcd
BiBTeX/Runtime/Names: Handle "" better
tkw1536 Jun 15, 2021
074ead8
BiBTeX/Runtime/Strings: Handle substring edgecases
tkw1536 Jun 15, 2021
a46f635
BiBTeX/Runtime/Strings: Run latexmllint
tkw1536 Jun 15, 2021
7812a7f
BiBTeX/Runtime/Builtins: Fix typo + latexmllint
tkw1536 Jun 15, 2021
b61c42c
Silently initialize new variables
tkw1536 Jun 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,40 @@ lib/LaTeXML/Pre/BibTeX/Entry.pm
# Postprocessing Modules
#==================================================
lib/LaTeXML/Post.pm
lib/LaTeXML/Post/BiBTeX/BibStyle/Precompiled.pm
lib/LaTeXML/Post/BiBTeX/BibStyle/StyCommand.pm
lib/LaTeXML/Post/BiBTeX/BibStyle/StyParser.pm
lib/LaTeXML/Post/BiBTeX/BibStyle/StyString.pm
lib/LaTeXML/Post/BiBTeX/Bibliography/BibEntry.pm
lib/LaTeXML/Post/BiBTeX/Bibliography/BibParser.pm
lib/LaTeXML/Post/BiBTeX/Bibliography/BibString.pm
lib/LaTeXML/Post/BiBTeX/Bibliography/BibField.pm
lib/LaTeXML/Post/BiBTeX/Cmd/bibtexml.pm
lib/LaTeXML/Post/BiBTeX/Cmd/bibtexmlc.pm
lib/LaTeXML/Post/BiBTeX/Cmd/bibtexmlr.pm
lib/LaTeXML/Post/BiBTeX/Cmd/makebbl.pm
lib/LaTeXML/Post/BiBTeX/Cmd/makebibtest.pm
lib/LaTeXML/Post/BiBTeX/Cmd/runbibtest.pm
lib/LaTeXML/Post/BiBTeX/Common/Object.pm
lib/LaTeXML/Post/BiBTeX/Common/StreamReader.pm
lib/LaTeXML/Post/BiBTeX/Common/Test.pm
lib/LaTeXML/Post/BiBTeX/Common/Utils.pm
lib/LaTeXML/Post/BiBTeX/Compiler/Block.pm
lib/LaTeXML/Post/BiBTeX/Compiler/Calls.pm
lib/LaTeXML/Post/BiBTeX/Compiler/Program.pm
lib/LaTeXML/Post/BiBTeX/Compiler/Target.pm
lib/LaTeXML/Post/BiBTeX/README.md
lib/LaTeXML/Post/BiBTeX/Runner.pm
lib/LaTeXML/Post/BiBTeX/Runtime.pm
lib/LaTeXML/Post/BiBTeX/Runtime/Buffer.pm
lib/LaTeXML/Post/BiBTeX/Runtime/Builtins.pm
lib/LaTeXML/Post/BiBTeX/Runtime/Config.pm
lib/LaTeXML/Post/BiBTeX/Runtime/Context.pm
lib/LaTeXML/Post/BiBTeX/Runtime/Entry.pm
lib/LaTeXML/Post/BiBTeX/Runtime/Functions.pm
lib/LaTeXML/Post/BiBTeX/Runtime/Names.pm
lib/LaTeXML/Post/BiBTeX/Runtime/Strings.pm
lib/LaTeXML/Post/BiBTeX/Runtime/Utils.pm
lib/LaTeXML/Post/Collector.pm
lib/LaTeXML/Post/CrossRef.pm
lib/LaTeXML/Post/Graphics.pm
Expand Down Expand Up @@ -737,6 +771,7 @@ t/94_runtimes.t
t/95_complex_config.t
t/96_fatal.t
t/97_manifest.t
t/98_bibtex.t
t/170_grammar_coverage.t
t/alignment/algx.pdf
t/alignment/algx.tex
Expand Down Expand Up @@ -842,6 +877,109 @@ t/babel/numprints.xml
t/babel/page545.pdf
t/babel/page545.tex
t/babel/page545.xml
t/900_bibtex/01_StreamReader.t
t/900_bibtex/10_BibParser.t
t/900_bibtex/11_BibParser_file.t
t/900_bibtex/20_StyParser.t
t/900_bibtex/21_StyParser_file.t
t/900_bibtex/30_Compiler_Perl_blocks.t
t/900_bibtex/31_Compiler_Perl_commands.t
t/900_bibtex/32_Compiler_Perl_file.t
t/900_bibtex/40_Runtime_state.t
t/900_bibtex/41_Runtime_entries.t
t/900_bibtex/42_Runtime_strings.t
t/900_bibtex/43_Runtime_names.t
t/900_bibtex/44_Runtime_utils.t
t/900_bibtex/45_Runtime_buffer.t
t/900_bibtex/50_integration.t
t/900_bibtex/fixtures/bibfiles/README.md
t/900_bibtex/fixtures/bibfiles/complicated.bib
t/900_bibtex/fixtures/bibfiles/complicated.bib.txt
t/900_bibtex/fixtures/bibfiles/kwarc.bib
t/900_bibtex/fixtures/bibfiles/kwarc.bib.txt
t/900_bibtex/fixtures/bibparser/01_preamble.bib
t/900_bibtex/fixtures/bibparser/01_preamble.bib.txt
t/900_bibtex/fixtures/bibparser/02_string.bib
t/900_bibtex/fixtures/bibparser/02_string.bib.txt
t/900_bibtex/fixtures/bibparser/03_article.bib
t/900_bibtex/fixtures/bibparser/03_article.bib.txt
t/900_bibtex/fixtures/bstfiles/plain.bst.txt
t/900_bibtex/fixtures/buffer/01_synthetic/input.txt
t/900_bibtex/fixtures/buffer/01_synthetic/output_nowrap.txt
t/900_bibtex/fixtures/buffer/01_synthetic/output_wrap.txt
t/900_bibtex/fixtures/buffer/02_real/input.txt
t/900_bibtex/fixtures/buffer/02_real/output.txt
t/900_bibtex/fixtures/compiler/blocks/01_integer_a.txt
t/900_bibtex/fixtures/compiler/blocks/01_integer_b.txt
t/900_bibtex/fixtures/compiler/blocks/02_quote_a.txt
t/900_bibtex/fixtures/compiler/blocks/02_quote_b.txt
t/900_bibtex/fixtures/compiler/blocks/03_reference_a.txt
t/900_bibtex/fixtures/compiler/blocks/03_reference_b.txt
t/900_bibtex/fixtures/compiler/blocks/03_reference_c.txt
t/900_bibtex/fixtures/compiler/blocks/03_reference_d.txt
t/900_bibtex/fixtures/compiler/blocks/03_reference_e.txt
t/900_bibtex/fixtures/compiler/blocks/03_reference_f.txt
t/900_bibtex/fixtures/compiler/blocks/03_reference_g.txt
t/900_bibtex/fixtures/compiler/blocks/03_reference_h.txt
t/900_bibtex/fixtures/compiler/blocks/03_reference_i.txt
t/900_bibtex/fixtures/compiler/blocks/03_reference_j.txt
t/900_bibtex/fixtures/compiler/blocks/03_reference_k.txt
t/900_bibtex/fixtures/compiler/blocks/03_reference_l.txt
t/900_bibtex/fixtures/compiler/blocks/04_literal_a.txt
t/900_bibtex/fixtures/compiler/blocks/04_literal_b.txt
t/900_bibtex/fixtures/compiler/blocks/04_literal_c.txt
t/900_bibtex/fixtures/compiler/blocks/04_literal_d.txt
t/900_bibtex/fixtures/compiler/blocks/04_literal_e.txt
t/900_bibtex/fixtures/compiler/blocks/04_literal_f.txt
t/900_bibtex/fixtures/compiler/blocks/04_literal_g.txt
t/900_bibtex/fixtures/compiler/blocks/04_literal_h.txt
t/900_bibtex/fixtures/compiler/blocks/04_literal_i.txt
t/900_bibtex/fixtures/compiler/blocks/04_literal_j.txt
t/900_bibtex/fixtures/compiler/blocks/04_literal_k.txt
t/900_bibtex/fixtures/compiler/blocks/04_literal_l.txt
t/900_bibtex/fixtures/compiler/blocks/05_block_a.txt
t/900_bibtex/fixtures/compiler/blocks/05_block_b.txt
t/900_bibtex/fixtures/compiler/commands/01_entry.txt
t/900_bibtex/fixtures/compiler/commands/02_strings.txt
t/900_bibtex/fixtures/compiler/commands/03_integers.txt
t/900_bibtex/fixtures/compiler/commands/04_macro.txt
t/900_bibtex/fixtures/compiler/commands/05_function.txt
t/900_bibtex/fixtures/compiler/commands/06_execute_a.txt
t/900_bibtex/fixtures/compiler/commands/06_execute_b.txt
t/900_bibtex/fixtures/compiler/commands/07_read.txt
t/900_bibtex/fixtures/compiler/commands/08_sort.txt
t/900_bibtex/fixtures/compiler/commands/09_iterate_a.txt
t/900_bibtex/fixtures/compiler/commands/09_iterate_b.txt
t/900_bibtex/fixtures/compiler/commands/10_reverse_a.txt
t/900_bibtex/fixtures/compiler/commands/10_reverse_b.txt
t/900_bibtex/fixtures/compiler/plain.bst.txt
t/900_bibtex/fixtures/integration/01_preamble/input.bib
t/900_bibtex/fixtures/integration/01_preamble/input.bst
t/900_bibtex/fixtures/integration/01_preamble/input_citations.spec
t/900_bibtex/fixtures/integration/01_preamble/input_macro.spec
t/900_bibtex/fixtures/integration/01_preamble/output.bbl
t/900_bibtex/fixtures/integration/01_preamble/output.bbl.org
t/900_bibtex/fixtures/integration/02_formatName/input.bib
t/900_bibtex/fixtures/integration/02_formatName/input.bst
t/900_bibtex/fixtures/integration/02_formatName/input_citations.spec
t/900_bibtex/fixtures/integration/02_formatName/input_macro.spec
t/900_bibtex/fixtures/integration/02_formatName/output.bbl
t/900_bibtex/fixtures/integration/02_formatName/output.bbl.org
t/900_bibtex/fixtures/integration/03_changeCase/input.bib
t/900_bibtex/fixtures/integration/03_changeCase/input.bst
t/900_bibtex/fixtures/integration/03_changeCase/input_citations.spec
t/900_bibtex/fixtures/integration/03_changeCase/input_macro.spec
t/900_bibtex/fixtures/integration/03_changeCase/output.bbl
t/900_bibtex/fixtures/integration/03_changeCase/output.bbl.org
t/900_bibtex/fixtures/integration/10_complicated/input.bib
t/900_bibtex/fixtures/integration/10_complicated/input.bst
t/900_bibtex/fixtures/integration/10_complicated/input_citations.spec
t/900_bibtex/fixtures/integration/10_complicated/input_macro.spec
t/900_bibtex/fixtures/integration/10_complicated/output.bbl
t/900_bibtex/fixtures/integration/10_complicated/output.bbl.org
t/900_bibtex/fixtures/integration/README.md
t/900_bibtex/fixtures/streamreader/empty.txt
t/900_bibtex/fixtures/streamreader/helloworld.txt
t/complex/aastex_test.pdf
t/complex/aastex_test.tex
t/complex/aastex_test.xml
Expand Down Expand Up @@ -883,6 +1021,10 @@ t/daemon/amsarticle.tex
t/daemon/broken.tex
t/daemon/api/port.spec
t/daemon/api/port.xml

t/daemon/bibtex/statement.spec
t/daemon/bibtex/statement.status
t/daemon/bibtex/statement.xml
t/daemon/citations.tex
t/daemon/complex/exhaustive.spec
t/daemon/complex/exhaustive.xml
Expand Down Expand Up @@ -925,7 +1067,10 @@ t/daemon/profiles/math.spec
t/daemon/profiles/math.xml
t/daemon/profiles/standard.spec
t/daemon/profiles/standard.xml
t/daemon/projects.bib
t/daemon/runtimes/timeout.spec
t/daemon/runtimes/timeout.status
t/daemon/statement.tex
# t/daemon/runtimes/timeout.xml [intentionally omitted]
t/daemon/tiny.bib
t/digestion/box.pdf
Expand Down
7 changes: 6 additions & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,16 @@ sub extra_Tests {

EXTRA_TEST_FILES = t/*.tt

fulltest : test extratest
fulltest : test extratest bibtest

extratest ::
PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(EXTRA_TEST_FILES)

BIB_TEST_FILES = t/900_bibtex/*.t

bibtest ::
PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(BIB_TEST_FILES)

ExtraTests
return; }

Expand Down
25 changes: 21 additions & 4 deletions lib/LaTeXML/Package/LaTeX.pool.ltxml
Original file line number Diff line number Diff line change
Expand Up @@ -3720,6 +3720,8 @@ DefConstructor('\lx@bibliography [] Semiverbatim',
beforeConstruct => sub { adjustBackmatterElement($_[0], $_[1]); });

# NOTE: This totally needs to be made extensible (parsing *.bst!?!? OMG!)
# TODO: Now that we can parse bst's these values may no longer be needed.
# But they might be still used by 'natbib' (to be investigated)
our $BIBSTYLES = {
plain => { citestyle => 'numbers', sort => 'true' },
unsrt => { citestyle => 'numbers', sort => 'false' },
Expand Down Expand Up @@ -3753,8 +3755,8 @@ DefConstructor('\bibstyle{}', sub {
AssignValue(BIBSTYLE => $style, 'global');
if (my $parms = $$BIBSTYLES{$style}) {
AssignValue(CITE_STYLE => $$parms{citestyle}); }
else {
Info('unexpected', $style, $_[0], "Unknown bibstyle '$style', it will be ignored"); }
#else {
# Info('unexpected', $style, $_[0], "Unknown bibstyle '$style', it will be ignored"); }
return; });

DefMacro('\bibliographystyle Semiverbatim', '\bibstyle{#1}');
Expand Down Expand Up @@ -3832,7 +3834,17 @@ DefMacroI('\fnum@@bibitem', undef, '{\@biblabel{\the@bibitem}}');
# Hack for abused bibliographies; see below
DefMacro('\bibitem',
'\if@lx@inbibliography\else\expandafter\lx@mung@bibliography\expandafter{\@currenvir}\fi'
. '\lx@bibitem', locked => 1);
. '\lx@bibitem@withhook');
# Call the hook for tags iff it is defined
DefMacro('\lx@bibitem@taghook Semiverbatim', '\expandafter\ifdefined\csname lx@bibentry@taghook@#1\endcsname\csname lx@bibentry@taghook@#1\endcsname\else\fi');
# add the hooked tag content into the lx@tags
DefMacro('\lx@bibitem@withhook[] Semiverbatim',
'\let\save@lx@tags\lx@tags' .
'\def\lx@tags ##1{\save@lx@tags{##1\lx@bibitem@taghook{#2}}}' .
'\lx@bibitem #1{#2}' .
'\let\lx@tags\save@lx@tags' .
'\let\save@lx@tags\relax');

DefConstructor('\lx@bibitem[] Semiverbatim',
"<ltx:bibitem key='#key' xml:id='#id'>"
. "#tags"
Expand Down Expand Up @@ -3867,6 +3879,11 @@ DefMacro('\lx@mung@bibliography{}', sub {
# Now, try to open {thebibliography}
push(@tokens, Invocation('\begin', Tokenize('thebibliography'), Tokens()));
return Tokens(@tokens); });

# used for source refences by the BiBTeX emulator
# \lxBibitemFrom{file}{entry}{field}{content}
DefConstructor('\lxBibitemFrom Semiverbatim Semiverbatim Semiverbatim {}',
"<ltx:text class='ltx_bib_#3' locator='#1:#2:#3'>#4</ltx:text>");

DefConstructorI('\lx@bibnewblock', undef, "<ltx:bibblock>");
Let('\newblock', '\lx@bibnewblock');
Expand Down Expand Up @@ -4252,7 +4269,7 @@ DefPrimitive('\nopagebreak[]', undef);
DefPrimitiveI('\columnbreak', undef, undef); # latex? or multicol?
DefPrimitive('\enlargethispage OptionalMatch:* {}', undef);

DefMacroI('\clearpage', undef, '\LTX@newpage');
DefMacroI('\clearpage', undef, '\newpage');
DefMacroI('\cleardoublepage', undef, '\LTX@newpage');
DefPrimitiveI('\samepage', undef, undef);

Expand Down
Loading