Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ WriteMakefile(NAME => 'LaTeXML',
PREREQ_PM => {
'Archive::Zip' => 0,
'DB_File' => 0,
'Encode::Locale' => 0,
'File::Which' => 0,
'Getopt::Long' => 2.37,
'Image::Size' => 0,
Expand Down
4 changes: 4 additions & 0 deletions bin/latexml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ use LaTeXML::Util::Pathname;
use LaTeXML::Common::Error;
use Encode;

# decode @ARGV before further processing
use Encode::Locale;
Encode::Locale::decode_argv(Encode::FB_CROAK);

#**********************************************************************
# Parse command line
my ($verbosity, $strict, $comments, $noparse, $includestyles) = (0, 0, 1, 0, 0);
Expand Down
4 changes: 4 additions & 0 deletions bin/latexmlc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ use HTTP::Response;
use HTTP::Request;
use JSON::XS qw(decode_json);

# decode @ARGV before further processing
use Encode::Locale;
Encode::Locale::decode_argv(Encode::FB_CROAK);

# Determine if a socket server is installed locally and obtain its pathname:
my $latexmls;
$latexmls = catfile($RealBin_safe, 'latexmls') if (-e catfile($RealBin_safe, 'latexmls'));
Expand Down
12 changes: 8 additions & 4 deletions bin/latexmlfind
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ use LaTeXML::Common::XML;
use Text::Wrap;
use LaTeXML; # Currently, just for version information.

# decode @ARGV before further processing
use Encode::Locale;
Encode::Locale::decode_argv(Encode::FB_CROAK);

#**********************************************************************
# Parse command line
my ($verbosity) = (0);
Expand Down Expand Up @@ -125,7 +129,7 @@ sub collect_matches {
my ($description, $xpath) = @_;
my @nodes = $XPATH->findnodes($xpath, $DOC);
print "Query $description appears in " . scalar(@nodes) . " places\n" if $verbosity > -1;
print " [XPath = \"$xpath\"]\n" if $verbosity > 0;
print " [XPath = \"$xpath\"]\n" if $verbosity > 0;
foreach my $node (@nodes) {
my $object = id_object($node);
push(@{ $$object{items} }, $node); }
Expand All @@ -144,9 +148,9 @@ sub id_object {
my $parent_object = id_object($node);
my $type = $node->localname;
my $labels = $node->getAttribute('labels');
my ($refnum) = $XPATH->findnodes("child::ltx:tags/ltx:tag[\@refnum]/text()", $node);
my ($title) = $XPATH->findnodes("child::ltx:toctitle | child::ltx:title", $node);
my $desc = ($refnum ? ($title ? "$refnum. " . $title->textContent : $refnum)
my ($refnum) = $XPATH->findnodes("child::ltx:tags/ltx:tag[\@refnum]/text()", $node);
my ($title) = $XPATH->findnodes("child::ltx:toctitle | child::ltx:title", $node);
my $desc = ($refnum ? ($title ? "$refnum. " . $title->textContent : $refnum)
: ($title ? $title->textContent : ''));
$desc =~ s/\s+/ /g;
$OBJECTS{$id} = $object
Expand Down
4 changes: 4 additions & 0 deletions bin/latexmlmath
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ use LaTeXML::Post::CrossRef;
use LaTeXML::Util::ObjectDB;
use LaTeXML::Common::Error;

# decode @ARGV before further processing
use Encode::Locale;
Encode::Locale::decode_argv(Encode::FB_CROAK);

#**********************************************************************
# Parse command line

Expand Down
4 changes: 4 additions & 0 deletions bin/latexmlpost
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ use LaTeXML::Post::Scan;
use LaTeXML::Util::Pathname;
use LaTeXML::Util::ObjectDB;

# decode @ARGV before further processing
use Encode::Locale;
Encode::Locale::decode_argv(Encode::FB_CROAK);

#======================================================================
# Parse command line.
#======================================================================
Expand Down