/usr/bin/latexmlpost is in latexml 0.7.0-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 | #!/usr/bin/perl -w
eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
if 0; # not running under some shell
use strict;
use FindBin;
use lib "$FindBin::RealBin/../lib";
use File::Spec;
use Getopt::Long qw(:config no_ignore_case);
use Pod::Usage;
use LaTeXML;
use LaTeXML::Post;
use LaTeXML::Post::Writer;
use LaTeXML::Post::Scan;
use LaTeXML::Util::Pathname;
use LaTeXML::Util::ObjectDB;
#======================================================================
# Parse command line.
#======================================================================
my $identity = "latexmlpost (LaTeXML version $LaTeXML::VERSION)";
# undef => unspecified; 0 = NO, 1 = YES
my($help,$showversion,$verbosity,$validate,$omit_doctype)=(0,0,0,1,0);
my($sourcedir,$destination)=(undef,undef);
my($format,$urlstyle) = (undef,'server');
my($numbersections)=(1);
my($stylesheet,$defaultcss,@css)=(undef,1);
my($parallelmath,$mathimages,$mathimagemag)=(undef,undef,1.75);
my($linelength,$keepXMath)=(undef,undef);
my($dographics,$svg,$picimages)=(undef,undef,undef);
my($split,$splitat,$splitpath,$splitnaming)=(undef,'section',undef,'id');
my($prescan,$dbfile,$scan,$crossref,$sitedir)=(undef,undef,1,1,undef);
my($index,$permutedindex,$splitindex)=(1,undef,undef);
my($splitbibliography,@bibliographies)=(undef);
my @math_formats =();
my %removed_math_formats=();
my $splitback= "//ltx:bibliography | //ltx:appendix | //ltx:index";
my %splitpaths =
(chapter=>"//ltx:chapter | $splitback",
section=>"//ltx:chapter | //ltx:section | $splitback",
subsection=>"//ltx:chapter | //ltx:section | //ltx:subsection | $splitback",
subsubsection=>"//ltx:chapter | //ltx:section | //ltx:subsection | //ltx:subsubsection | $splitback");
# Get the command line arguments.
GetOptions("verbose+" =>\$verbosity,
"VERSION" =>\$showversion,
"help|?" =>\$help,
# Source Options
"sourcedirectory=s" =>\$sourcedir,
"validate!" =>\$validate,
# Basics
"format=s" =>\$format,
"destination=s"=>sub { $destination = $_[1];
if(!defined $format){
$format='xhtml' if $destination=~/\.xhtml$/;
$format='html' if $destination=~/\.html$/; }},
"omitdoctype!" =>\$omit_doctype,
"numbersections!" =>\$numbersections,
# Some general XSLT/CSS options.
"stylesheet=s" =>\$stylesheet,
"css=s" =>\@css,
"defaultcss!" =>\$defaultcss,
# Options for broader document set processing
"split!" =>\$split,
"splitat=s" =>sub { $splitat=$_[1]; $split=1 unless defined $split;},
"splitpath=s" =>sub { $splitpath=$_[1]; $split=1 unless defined $split;},
"splitnaming=s" =>sub { $splitnaming=$_[1]; $split=1 unless defined $split;},
"scan!" =>\$scan,
"crossref!" =>\$crossref,
"urlstyle=s" =>\$urlstyle,
# Generating indices
"index!" =>\$index,
"permutedindex!" =>\$permutedindex,
"splitindex!" =>\$splitindex,
# Generating Bibliographies
"bibliography=s" =>\@bibliographies,
"splitbibliography!" =>\$splitbibliography,
# Options for two phase processing
"prescan" =>\$prescan,
"dbfile=s" =>\$dbfile,
"sitedirectory=s" =>\$sitedir,
# Various choices for math processing.
# Note: Could want OM embedded in mml annotation, too.
# In general, could(?) want multiple math reps within <Math>
# OR, multiple math reps combined with <mml:sematics>
# or, in fact, _other_ parallel means? (om?, omdoc? ...)
# So, need to separate multiple transformations from the combination.
# However, IF combining, then will need to support a id/ref mechanism.
# "mathml|mml!" =>\$mathml,
"mathimages!" => \$mathimages,
"mathimagemagnification=f" => \$mathimagemag,
"linelength=i" =>\$linelength,
"presentationmathml|pmml" => sub { addMathFormat('pmml'); },
"contentmathml|cmml" => sub { addMathFormat('cmml'); },
"openmath|om" => sub { addMathFormat('om'); },
"nopresentationmathml|nopmml" => sub { removeMathFormat('pmml'); },
"nocontentmathml|nocmml" => sub { removeMathFormat('cmml'); },
"noopenmath|noom" => sub { removeMathFormat('om'); },
"parallelmath!" => \$parallelmath,
"keepXMath!" =>\$keepXMath,
# For graphics: vaguely similar issues, but more limited.
# includegraphics images (eg. ps) can be converted to webimages (eg.png)
# picture/pstricks images can be converted to png or possibly svg.
"graphicimages!"=>\$dographics,
"svg!" =>\$svg,
"pictureimages!"=>\$picimages,
) or pod2usage(-message => $identity, -exitval=>1, -verbose=>0, -output=>\*STDERR);
pod2usage(-message=>$identity, -exitval=>1, -verbose=>2, -output=>\*STDOUT) if $help;
if($showversion){ print STDERR "$identity\n"; exit(1); }
# Get the requested XML file
Error("Missing input xmlfile") unless @ARGV;
my $xmlfile = shift(@ARGV);
if($xmlfile ne '-'){
$xmlfile .= '.xml' unless -f $xmlfile;
Error("The input file \"$xmlfile\" was not found") unless -f $xmlfile; }
#======================================================================
# Sanity check and Completion of options.
#======================================================================
$sourcedir = $sourcedir && pathname_canonical($sourcedir);
$destination = $destination && pathname_canonical($destination);
$sitedir = $sitedir && pathname_canonical($sitedir);
# Check for appropriate combination of split, scan, prescan, dbfile, crossref
if($split && !defined $destination){
Error("Must supply --destination when using --split"); }
if($split){
$splitnaming = checkOptionValue('--splitnaming',$splitnaming,
qw(id idrelative label labelrelative));
$splitat = checkOptionValue('--splitat',$splitat,keys %splitpaths);
$splitpath = $splitpaths{$splitat} unless defined $splitpath;
}
if($prescan && !$scan){
Error("Makes no sense to --prescan with scanning disabled (--noscan)"); }
if($prescan && (!defined $dbfile)){
Error("Cannot prescan documents (--prescan) without specifying --dbfile"); }
if(!$prescan && $crossref && ! ($scan || (defined $dbfile))){
Error("Cannot cross-reference (--crossref) without --scan or --dbfile "); }
if($crossref){
$urlstyle = checkOptionValue('--urlstyle',$urlstyle,qw(server negotiated file)); }
if(($permutedindex || $splitindex) && (! defined $index)){
$index=1; }
if(!$prescan && $index && ! ($scan || defined $crossref)){
Error("Cannot generate index (--index) without --scan or --dbfile"); }
if(!$prescan && @bibliographies && ! ($scan || defined $crossref)){
Error("Cannot generate bibliography (--bibliography) without --scan or --dbfile"); }
# Check format and complete math and image options
if(!defined $format){}
elsif($format eq 'html'){
Error("Default html stylesheet only supports math images, not ".join(', ',@math_formats))
if (!defined $stylesheet) && ($parallelmath || scalar(@math_formats));
Error("Default html stylesheet does not support --svg") if $svg;
$mathimages = 1 unless defined $mathimages;
$dographics = 1 unless defined $dographics;
$picimages = 1 unless defined $picimages;
if(!defined $stylesheet){
$stylesheet = "LaTeXML-html.xsl";
unshift(@css,"core.css") if $defaultcss; }}
elsif($format eq 'xhtml'){
Error("Default xhtml stylesheet does not support --mathimages")
if (!defined $stylesheet) && $mathimages;
$parallelmath = 1 if (!defined $parallelmath) && (scalar(@math_formats)>1);
Error("Default xhtml stylesheet only supports OpenMath in parallel with MathMl")
if (!defined $stylesheet) && !$parallelmath && grep($_ eq 'om',@math_formats);
if(!@math_formats){ # No math format specified?
addMathFormat('pmml');
addMathFormat('cmml') if $parallelmath || !@math_formats; }
$svg = 1 unless defined $svg;
$dographics = 1 unless defined $dographics;
if(!defined $stylesheet){
$stylesheet = "LaTeXML-xhtml.xsl";
unshift(@css,"core.css") if $defaultcss; }}
elsif($format eq 'xml'){}
else {
Error("Unrecognized target format: $format"); }
Error("Parallel math markup needs at least two formats")
if $parallelmath && (scalar(@math_formats) < 2);
#Error("Parallel math markup can only be based on MathML")
# if $parallelmath && ($math_formats[0] !~ /^(cmml|pmml)$/);
if((!defined $destination) && ($mathimages || $dographics || $picimages)){
Error("Must supply --destination unless image generation is disabled"
."(--nomathimages --nographics --nopictureimages)"); }
#======================================================================
# Do the processing.
#======================================================================
binmode(STDERR,":utf8");
#binmode(STDOUT,":utf8");
print STDERR "$identity\n" if $verbosity > 0;
our %OPTIONS = (verbosity=>$verbosity||0,
siteDirectory=>(defined $sitedir ? $sitedir
: (defined $dbfile ? pathname_directory($dbfile)
: ".")));
if(defined $dbfile && !-f $dbfile){
if(my $dbdir = pathname_directory($dbfile)){
pathname_mkdir($dbdir); }}
my $DB = LaTeXML::Util::ObjectDB->new(dbfile=>$dbfile,%OPTIONS);
# Create the processors:
my @procs = ();
if($split){
require 'LaTeXML/Post/Split.pm';
push(@procs,LaTeXML::Post::Split->new(split_xpath=>$splitpath,splitnaming=>$splitnaming,
%OPTIONS)); }
##require 'LaTeXML/Post/Scan.pm';
our $scanner = ($scan || $DB) && LaTeXML::Post::Scan->new(db=>$DB,%OPTIONS);
if($scan){
push(@procs,$scanner); }
if(!$prescan){
if($index){
require 'LaTeXML/Post/MakeIndex.pm';
push(@procs,LaTeXML::Post::MakeIndex->new(db=>$DB, permuted=>$permutedindex,
split=>$splitindex, scanner=>$scanner,
%OPTIONS)); }
if(@bibliographies){
require 'LaTeXML/Post/MakeBibliography.pm';
push(@procs,LaTeXML::Post::MakeBibliography->new(db=>$DB, bibliographies=>[@bibliographies],
split=>$splitbibliography, scanner=>$scanner,
%OPTIONS)); }
if($crossref){
require 'LaTeXML/Post/CrossRef.pm';
push(@procs,LaTeXML::Post::CrossRef->new(db=>$DB,urlstyle=>$urlstyle,format=>$format,
($numbersections ? (number_sections=>1):()),
%OPTIONS)); }
if($mathimages){
require 'LaTeXML/Post/MathImages.pm';
push(@procs,LaTeXML::Post::MathImages->new(magnification=>$mathimagemag,%OPTIONS)); }
if($picimages){
require 'LaTeXML/Post/PictureImages.pm';
push(@procs,LaTeXML::Post::PictureImages->new(%OPTIONS)); }
if($dographics){
require 'LaTeXML/Post/Graphics.pm';
push(@procs,LaTeXML::Post::Graphics->new(%OPTIONS)); }
if($svg){
require 'LaTeXML/Post/SVG.pm';
push(@procs,LaTeXML::Post::SVG->new(%OPTIONS)); }
if(@math_formats){
$keepXMath = 0 unless defined $keepXMath;
my @mprocs=();
foreach my $fmt (@math_formats){
if($fmt eq 'pmml'){
require 'LaTeXML/Post/MathML.pm';
push(@mprocs,LaTeXML::Post::MathML::Presentation->new(
(defined $linelength ? (linelength=>$linelength):()),
%OPTIONS)); }
elsif($fmt eq 'cmml'){
require 'LaTeXML/Post/MathML.pm';
push(@mprocs,LaTeXML::Post::MathML::Content->new(%OPTIONS)); }
elsif($fmt eq 'om'){
require 'LaTeXML/Post/OpenMath.pm';
push(@mprocs,LaTeXML::Post::OpenMath->new(%OPTIONS)); }}
if($parallelmath){
# require 'LaTeXML/Post/MathML.pm';
# push(@procs,LaTeXML::Post::MathML::Parallel->new(math_processors=>[@mprocs],%OPTIONS)); }
my $main = shift(@mprocs);
$main->setParallel(@mprocs);
push(@procs,$main); }
else {
push(@procs,@mprocs); }}
else {
$keepXMath = 1 unless defined $keepXMath;
}
if(!$keepXMath){
require 'LaTeXML/Post/PurgeXMath.pm';
push(@procs,LaTeXML::Post::PurgeXMath->new(%OPTIONS)); }
if($stylesheet){
require 'LaTeXML/Post/XSLT.pm';
my @csspaths=();
if(@css){
foreach my $css (@css){
$css .= '.css' unless $css =~ /\.css$/;
# Dance, if dest is current dir, we'll find the old css before the new one!
my @csssources = map(pathname_canonical($_),
pathname_findall($css,types=>['css'],
($sourcedir ? (paths=>[$sourcedir]):()),
installation_subdir=>'style'));
my $csspath = pathname_absolute($css,pathname_directory($destination));
while(@csssources && ($csssources[0] eq $csspath)){ shift(@csssources); }
my $csssource = shift(@csssources);
pathname_copy($csssource,$csspath) if $csssource && -f $csssource;
push(@csspaths,$csspath); }}
push(@procs,LaTeXML::Post::XSLT->new(stylesheet=>$stylesheet,
css=>[@csspaths],
parameters=>{number_sections
=>($numbersections ?"true()":"false()")
},
%OPTIONS)); }
push(@procs,LaTeXML::Post::Writer->new(format=>$format,omit_doctype=>$omit_doctype,%OPTIONS));
}
# Figure how to define a Reader processor (?)
# that initialize the thing by reading several files (the rest of the command line).
LaTeXML::Post::ProcessChain(
($xmlfile eq '-'
? LaTeXML::Post::Document->newFromSTDIN(validate=>$validate,
sourceDirectory=>$sourcedir,
destination=>$destination)
: LaTeXML::Post::Document->newFromFile($xmlfile,
validate=>$validate,
sourceDirectory=>$sourcedir,
destination=>$destination)),
@procs);
$DB->finish;
#======================================================================
# helpers
#======================================================================
sub Error {
my($message)=@_;
# pod2usage(-message=>"$identity\n$message",-exitval=>1, -verbose=>0,-output=>\*STDERR);
die "ERROR: $message\nUse the --help option for complete details\n";
}
sub addMathFormat {
my($fmt)=@_;
push(@math_formats,$fmt)
unless grep($_ eq $fmt,@math_formats) || $removed_math_formats{$fmt}; }
sub removeMathFormat {
my($fmt)=@_;
@math_formats = grep($_ ne $fmt, @math_formats);
$removed_math_formats{$fmt}=1; }
sub checkOptionValue {
my($option,$value,@choices)=@_;
if($value){
foreach my $choice (@choices){
return $choice if substr($choice,0,length($value)) eq $value; }}
Error("Value for $option, $value, doesn't match ".join(', ',@choices)); }
#**********************************************************************
__END__
=head1 NAME
C<latexmlpost> - postprocesses an xml file generated by C<latexml>
to perform common tasks, such as convert math to images and processing
graphics inclusions for the web.
=head1 SYNOPSIS
latexmlpost [options] xmlfile
Options:
--verbose shows progress during processing.
--VERSION show version number.
--help shows help message.
--sourcedirectory=sourcedir specifies directory of the original
source TeX file.
--validate, --novalidate Enables (the default) or disables
validation of the source xml.
--format=html|xhtml|xml requests the output format.
--destination=file specifies output file (and directory).
--omitdoctype omits the Doctype declaration,
--noomitdoctype disables the omission (the default)
--numbersections enables (the default) the inclusion of
section numbers in titles and crossrefs.
--nonumbersections disables the above
--stylesheet=xslfile requests the XSL transform using the
given xslfile as stylesheet.
--css=cssfile adds a css stylesheet to html/xhtml
(can be repeated)
--nodefaultcss disables the default css stylesheet
--split requests splitting each document
--nosplit disables the above (default)
--splitat specifies level to split the document
--splitpath=xpath specifies xpath expression for splitting
(default is section-like, if splitting)
--splitnaming=(id|idrelative|label|labelrelative) specifies how
to name split files (def. idrelative).
--scan scans documents to extract ids, labels,
section titles, etc. (default)
--noscan disables the above
--crossref fills in crossreferences (default)
--nocrossref disables the above
--urlstyle=(server|negotiated|file) format to use for urls
(default server).
--index requests filling in the index (default)
--noindex disables the above
--splitindex Splits the index into pages per initial.
--nosplitindex disables the above (default)
--permutedindex permutes index phrases in the index
--nopermutedindex disables the above (default)
--bibliography=file specifies a bibliography file
--splitbibliography splits the bibliography into pages per
initial.
--nosplitbibliography disables the above (default)
--prescan carries out only the split (if enabled)
and scan, storing cross-referencing data
in dbfile
(default is complete processing)
--dbfile=dbfile specifies file to store crossreferences
--sitedirectory=dir specifies the base directory of the site
--mathimages converts math to images
(default for html format)
--nomathimages disables the above
--mathimagemagnification=mag specifies magnification factor
--presentationmathml converts math to Presentation MathML
(default for xhtml format)
--pmml alias for --presentationmathml
--nopresentationmathml disables the above
--linelength=n formats presentation mathml to a
linelength max of n characters
--contentmathml converts math to Content MathML
--nocontentmathml disables the above (default)
--cmml alias for --contentmathml
--openmath converts math to OpenMath
--noopenmath disables the above (default)
--om alias for --openmath
--parallelmath requests parallel math markup for MathML
(default when multiple math formats)
--noparallelmath disables the above
--keepXMath preserves the intermediate XMath
representation (default is to remove)
--graphicimages converts graphics to images (default)
--nographicimages disables the above
--pictureimages converts picture environments to
images (default)
--nopictureimages disables the above
--svg converts picture environments to SVG
--nosvg disables the above (default)
If xmlfile is '-', latexmlpost reads the XML from standard input.
=head1 OPTIONS AND ARGUMENTS
=head2 General Options
=over 4
=item C<--verbose>
Requests informative output as processing proceeds. Can be repeated
to increase the amount of information.
=item C<--VERSION>
Shows the version number of the LaTeXML package..
=item C<--help>
Shows this help message.
=back
=head2 Source Options
=over 4
=item C<--sourcedirectory>=I<source>
Specifies the directory where the original latex source is located.
Unless latexmlpost is run from that directory, or it can be determined
from the xml filename, it may be necessary to specify this option in
order to find graphics and style files.
=item C<--validate>, C<--novalidate>
Enables (or disables) the validation of the source XML document (the default).
=back
=head2 Format Options
=over 4
=item C<--format>=C<(html|xhtml|xml)>
Specifies the output format for post processing.
C<html> format converts the material to html and the mathematics to png images.
C<xhtml> format converts to xhtml and uses presentation MathML (after attempting
to parse the mathematics) for representing the math. In both cases, any
graphics will be converted to web-friendly formats and/or copied to the
destination directory. By default, C<xml>, the output is left in LaTeXML's xml,
but the math is parsed and converted to presentation MathML.
For html and xhtml, a default stylesheet is provided, but see
the C<--stylesheet> option.
=item C<--destination=>I<destination>
Specifies the destination file and directory. The directory is needed for
mathimages and graphics processing.
=item C<--omitdoctype>, C<--noomitdoctype>
Omits (or includes) the document type declaration.
The default is to include it if the document model was based on a DTD.
=item C<--numbersections>, C<--nonumbersections>
Includes (default), or disables the inclusion of section, equation, etc,
numbers in the formatted document and crossreference links.
=item C<--stylesheet>=I<xslfile>
Requests the XSL transformation of the document using the given xslfile as stylesheet.
If the stylesheet is omitted, a `standard' one appropriate for the
format (html or xhtml) will be used.
=item C<--css>=I<cssfile>
Adds I<cssfile> as a css stylesheet to be used in the transformed html/xhtml.
Multiple stylesheets can be used; they are included in the html in the
order given, following the default C<core.css>
(but see C<--nodefaultcss>). Some stylesheets included in the distribution are
--css=navbar-left Puts a navigation bar on the left.
(default omits navbar)
--css=navbar-right Puts a navigation bar on the left.
--css=theme-blue A blue coloring theme for headings.
--css=amsart A style suitable for journal articles.
=item C<--nodefaultcss>
Disables the inclusion of the default C<core.css> stylesheet.
=back
=head2 Site & Crossreferencing Options
=over 4
=item C<--split>, C<--nosplit>
Enables or disables (default) the splitting of documents into multiple `pages'.
If enabled, the the document will be split into sections, bibliography,
index and appendices (if any) by default, unless C<--splitpath> is specified.
=item C<--splitat=>I<unit>
Specifies what level of the document to split at. Should be one
of C<chapter>, C<section> (the default), C<subsection> or C<subsubsection>.
For more control, see C<--splitpath>.
=item C<--splitpath=>I<xpath>
Specifies an XPath expression to select nodes that will generate separate
pages. The default splitpath is
//ltx:section | //ltx:bibliography | //ltx:appendix | //ltx:index
Specifying
--splitpath="//ltx:section | //ltx:subsection | //ltx:bibliography
| //ltx:appendix | //ltx:index"
would split the document at subsections as well as sections.
=item C<--splitnaming>=C<(id|idrelative|label|labelrelative)>
Specifies how to name the files for subdocuments created by splitting.
The values C<id> and C<label> simply use the id or label of the subdocument's
root node for it's filename. C<idrelative> and C<labelrelative> use
the portion of the id or label that follows the parent document's
id or label. Furthermore, to impose structure and uniqueness,
if a split document has children that are also split, that document
(and it's children) will be in a separate subdirectory with the
name index.
=item C<--scan>, C<--noscan>
Enables (default) or disables the scanning of documents for ids, labels,
references, indexmarks, etc, for use in filling in refs, cites, index and
so on. It may be useful to disable when generating documents not based
on the LaTeXML doctype.
=item C<--crossref>, C<--nocrossref>
Enables (default) or disables the filling in of references, hrefs, etc
based on a previous scan (either from C<--scan>, or C<--dbfile>)
It may be useful to disable when generating documents not based
on the LaTeXML doctype.
=item C<--urlstyle>=C<(server|negotiated|file)>
This option determines the way that URLs within the documents
are formatted, depending on the way they are intended to be served.
The default, C<server>, eliminates unneccessary
trailing C<index.html>. With C<negotiated>, the trailing
file extension (typically C<html> or C<xhtml>) are eliminated.
The scheme C<file> preserves complete (but relative) urls
so that the site can be browsed as files without any server.
=item C<--index>, C<--noindex>
Enables (default) or disables the generation of an index from indexmarks
embedded within the document. Enabling this has no effect unless
there is an index element in the document (generated by \printindex).
=item C<--splitindex>, C<--nosplitindex>
Enables or disables (default) the splitting of generated indexes
into separate pages per initial letter.
=item C<--bibliography=>I<pathname>
Specifies a bibliography file generated from a BibTeX file
and used to fill in a bibliography element.
Hand-written bibliographies placed in a C<thebibliography> environment
do not need this processing. Enabling this has no effect unless
there is an bibliography element in the document (generated by \bibliography).
Note that this option provides the bibliography to be used to
fill in the bibliography element (generated by C<\bibliography>);
latexmlpost does not (currently) directly process and format such a bibliography.
=item C<--splitbibliography>, C<--nosplitbibliography>
Enables or disables (default) the splitting of generated bibliographies
into separate pages per initial letter.
=item C<--prescan>
By default C<latexmlpost> processes a single document into one
(or more; see C<--split>) destination files in a single pass.
When generating a complicated site consisting of several documents
it may be advantageous to first scan through the documents
to extract and store (in C<dbfile>) cross-referencing data
(such as ids, titles, urls, and so on).
A later pass then has complete information allowing all documents
to reference each other, and also constructs an index and bibliography
that reflects the entire document set. The same effect (though less efficient)
can be achieved by running C<latexmlpost> twice, provided a C<dbfile>
is specified.
=item C<--dbfile>I<=file>
Specifies a filename to use for the crossreferencing data when
using two-pass processing. This file may reside in the intermediate
destination directory.
=item C<--sitedirectory=>I<dir>
Specifies the base directory of the overall web site.
Pathnames in the database are stored in a form relative
to this directory to make it more portable.
=back
=head2 Math Options
These options specify how math should be converted into other formats.
Multiple formats can be requested; how they will be combined
depends on the format and other options.
=over 4
=item C<--mathimages>, C<--nomathimages>
Requests or disables the conversion of math to images.
Conversion is the default for html format.
=item C<--mathimagemagnification=>I<factor>
Specifies the magnification used for math images, if they are made.
Default is 1.75.
=item C<--presentationmathml>, C<--nopresentationmathml>
Requests or disables conversion of math to Presentation MathML.
Conversion is the default for xhtml format.
=item C<--linelength>I<=number>
(Experimental) Line-breaks the generated Presentation
MathML so that it is no longer than I<number> `characters'.
=item C<--contentmathml>, C<--nocontentmathml>
Requests or disables conversion of math to Content MathML.
Conversion is disabled by default.
B<Note> that this conversion is only partially implemented.
=item C<--openmath>
Requests or disables conversion of math to OpenMath.
Conversion is disabled by default.
B<Note> that this conversion is only partially implemented.
=item C<--parallelmath>, C<--noparallelmath>
Requests or disables parallel math markup.
Parallel markup is the default for xhtml formats when multiple math
formats are requested.
This method uses the MathML C<semantics> element with additional formats
appearing as C<annotation>'s.
The first math format requested must be either Presentation or Content MathML;
additional formats may be MathML or OpenMath.
If this option is disabled and multiple formats are requested, the
representations are simply stored as separate children of the C<Math> element.
=item C<--keepXMath>
By default, when any of the MathML or OpenMath conversions
are used, the intermediate math representation will be removed;
this option preserves it.
=back
=head2 Graphics Options
=over 4
=item C<--graphicimages>, C<--nographicimages>
Enables (default) or disables the conversion of graphics
to web-appropriate format (png).
=item C<--pictureimages>, C<--nopictureimages>
Enables (default) or disables the conversion of picture environments
and pstricks material into images.
=item C<--svg>, C<--nosvg>
Enables or disables (default) the conversion of picture environments
and pstricks material to SVG.
=back
=head1 SEE ALSO
L<latexml>, L<latexmlmath>, L<LaTeXML>
=cut
#**********************************************************************
|