3 # $Id: xhtml2latex.pl 481 2008-01-12 23:06:15Z fletcher $
5 # Required for using MultiMarkdown
7 # Copyright (c) 2006-2008 Fletcher T. Penney
8 # <http://fletcherpenney.net/>
10 # MultiMarkdown Version 2.0.b5
13 # Combine all the steps necessary to process MultiMarkdown generated XHTML
14 # into LaTeX. Not necessary, but might be easier than stringing the commands
18 # Parse stdin (XHTML file)
24 # Find name of XSLT File if specified, else use xhtml2memoir.xslt
25 $xslt_file = _LatexXSLT($data);
26 $xslt_file = "memoir.xslt" if ($xslt_file eq "");
29 # Decide which flavor of SmartyPants to use
30 $language = _Language($data);
31 $SmartyPants = "SmartyPants.pl";
33 $SmartyPants = "SmartyPantsGerman.pl" if ($language =~ /^\s*german\s*$/i);
35 $SmartyPants = "SmartyPantsFrench.pl" if ($language =~ /^\s*french\s*$/i);
37 $SmartyPants = "SmartyPantsSwedish.pl" if ($language =~ /^\s*(swedish|norwegian|finnish|danish)\s*$/i);
39 $SmartyPants = "SmartyPantsDutch.pl" if ($language =~ /^\s*dutch\s*$/i);
42 # Create a pipe and process
43 $me = $0; # Where am I?
45 # Am I running in Windoze?
49 $me =~ s/\\([^\\]*?)$/\\/; # Get just the directory portion
51 open (MultiMarkdown, "| cd \"$me\"& .\\$SmartyPants | xsltproc -nonet -novalid ..\\XSLT\$xslt_file - | ..\\Utilities\\cleancites.pl");
54 $me =~ s/\/([^\/]*?)$/\//; # Get just the directory portion
56 open (MultiMarkdown, "| cd \"$me\"; ./$SmartyPants | xsltproc -nonet -novalid ../XSLT/$xslt_file - | ../Utilities/cleancites.pl");
60 print MultiMarkdown $data;
68 $text =~ /^\s*<meta name="latexxslt" content="(.*?)" \/>/mi;
76 $text =~ /^\s*<meta name="language" content="(.*?)" \/>/mi;