[TxMt] context output to html

Robert Ullrey robert_ullrey at mac.com
Tue Apr 5 17:08:53 UTC 2005


Working with Mark Smith an a context bundle I am trying to get the same 
html output as generated with the latex bundle but I am having troubles 
calling the PDF into the browser.

Here is what I have, a hack of the LaTeX bundle:

# PDF ConTeXt
# Save Current File
# Input=Entire Document
# Output=Show as HTML

# this requires pdflatex Web2C 7.5.3
# Below are the instructions for the html output of the texexec run
command

cat <<EOF
<html><head><style>
*       { color: #998; }
a       { color: #000; text-decoration: none; }
a:hover { color: #000; text-decoration: underline; }
</style></head><body><pre>
EOF

# below is the name for the temp file called by texexec
tmp=`mktemp /tmp/texexecpdf_XXXXXXXX`

# If TM_LATEX_MASTER not set use TM_FILEPATH
[ -z "$TM_LATEX_MASTER" ] &&
    export TM_LATEX_MASTER="$TM_FILEPATH"

# Here is the actual command followed by the perl script to find the
output.
cd `dirname "$TM_LATEX_MASTER"`
texexec --pdf --nonstop /tmp\ `basename ${tmp}` `basename
"$TM_LATEX_MASTER"` \
    | perl -pe '$| = 1; s/^(\/.*?):(\d+):\s*(.*)$/<a
href="txmt:\/\/open?url=file:\/\/$1&line=$2">$3<\/a>/'

# If PDF file exists and not empty, display it. This is were I loose it!
[ -s ${tmp}.pdf ] && echo '</pre><meta http-equiv="Refresh"
content="0;URL=file:///'${tmp}'.pdf">'

{ sleep 30; rm ${tmp} ${tmp}.*; } </dev/null >/dev/null 2>&1 &


The command runs fine and displays the log file as it should, but does 
not load the PDF. At the end of the context log, the output that 
texexec registers is:
Output written on c_position_authority.pdf (1 page, 7354 bytes).
This is the name I gave to the original file, not texexecpdf.xxxxxxxx. 
Should it be?
Transcript written on c_position_authority.log.

            return code : 0
               run time : 2 seconds
   sorting and checking : running texutil

  TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004

                 action : processing commands, lists and registers
                 option : sorting IJ under Y
                 option : converting high ASCII values
             input file : c_position_authority.tui
            output file : c_position_authority.tuo

I am using Web2c 7.5.4
Any suggestions?

Thanks
Robert

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2412 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20050405/732f9739/attachment.bin>


More information about the textmate mailing list