#include "tex2rtf.h"
#include "table.h"
+
+extern wxHashTable TexReferences;
+
+
extern void DecToHex(int, char *);
void GenerateHTMLIndexFile(char *fname);
// This is defined in the Tex2Any library.
extern char *BigBuffer;
+// DHS Two-column table dimensions.
+static int TwoColWidthA = -1;
+static int TwoColWidthB = -1;
+
+
class HyperReference: public wxObject
{
public:
{
if (*fd)
{
- fprintf(*fd, "\n</BODY></HTML>\n");
+ fprintf(*fd, "\n</FONT></BODY></HTML>\n");
fclose(*fd);
}
fileId ++;
else return NULL;
}
+void OutputFont(void)
+{
+ // Output <FONT FACE=...>
+ TexOutput("<FONT FACE=\"");
+ if (htmlFaceName)
+ TexOutput(htmlFaceName);
+ else
+ TexOutput("Times New Roman");
+ TexOutput("\">\n");
+}
+
// Output start of <BODY> block
void OutputBodyStart(void)
{
}
}
TexOutput(">\n");
+
+ OutputFont();
}
// Called on start/end of macro examination
if (inTabular)
{
// End cell, start cell
- TexOutput("</TD>");
+
+ TexOutput("</FONT></TD>");
// Start new row and cell, setting alignment for the first cell.
if (currentColumn < noColumns)
else
sprintf(buf, "\n<TD ALIGN=LEFT>");
TexOutput(buf);
+ OutputFont();
}
else
TexOutput("&");
else
sprintf(buf, "<TR>\n<TD ALIGN=LEFT>");
TexOutput(buf);
+ OutputFont();
}
else
{
// End cell and row
// Start new row and cell
- TexOutput("</TD>\n</TR>\n");
+ TexOutput("</FONT></TD>\n</TR>\n");
}
break;
}
{
if ( start )
TexOutput("\n<TABLE>\n");
- else
+ else {
TexOutput("\n</TABLE>\n");
+ // DHS
+ TwoColWidthA = -1;
+ TwoColWidthB = -1;
+ }
break;
}
case ltPAR:
{
if (helpRefText)
TraverseChildrenFromChunk(helpRefText);
- TexOutput(" (REF NOT FOUND)");
+ if (!ignoreBadRefs)
+ TexOutput(" (REF NOT FOUND)");
+ wxString errBuf;
+ errBuf.Printf("Warning: unresolved reference '%s'", refName);
+ OnInform((char *)errBuf.c_str());
}
}
else TexOutput("??");
if (imageFile)
delete[] imageFile;
imageFile = NULL;
- if (f)
+ if (!f.IsEmpty())
{
imageFile = copystring(f);
}
descriptionItemArg = GetArgChunk();
return FALSE;
}
+ return TRUE;
}
case ltTWOCOLITEM:
case ltTWOCOLITEMRULED:
*/
if (arg_no == 1)
{
- if ( start )
- TexOutput("\n<TR><TD VALIGN=TOP>\n");
- else
- TexOutput("\n</TD>\n");
+ if ( start ) {
+ // DHS
+ if (TwoColWidthA > -1) {
+ char buf[100];
+ sprintf(buf,"\n<TR><TD VALIGN=TOP WIDTH=%d>\n",TwoColWidthA);
+ TexOutput(buf);
+ } else
+ TexOutput("\n<TR><TD VALIGN=TOP>\n");
+ OutputFont();
+ } else
+ TexOutput("\n</FONT></TD>\n");
}
if (arg_no == 2)
{
- if ( start )
- TexOutput("\n<TD VALIGN=TOP>\n");
- else
- TexOutput("\n</TD></TR>\n");
+ // DHS
+ if ( start ) {
+ if (TwoColWidthB > -1) {
+ char buf[100];
+ sprintf(buf,"\n<TD VALIGN=TOP WIDTH=%d>\n",TwoColWidthB);
+ TexOutput(buf);
+ } else
+ TexOutput("\n<TD VALIGN=TOP>\n");
+ OutputFont();
+ } else
+ TexOutput("\n</FONT></TD></TR>\n");
}
return TRUE;
break;
TexOutput("<HR><P>\n");
break;
}
+ // DHS
+ case ltTWOCOLWIDTHA:
+ {
+ if (start)
+ {
+ char *val = GetArgData();
+ float points = ParseUnitArgument(val);
+ TwoColWidthA = (int)((points * 100.0) / 72.0);
+ }
+ return FALSE;
+ break;
+ }
+ // DHS
+ case ltTWOCOLWIDTHB:
+ {
+ if (start)
+ {
+ char *val = GetArgData();
+ float points = ParseUnitArgument(val);
+ TwoColWidthB = (int)((points * 100.0) / 72.0);
+ }
+ return FALSE;
+ break;
+ }
/*
* Accents
*
if (compatibilityMode)
{
TexOutput("<TR>\n<TD>");
+ OutputFont();
/*
for (int i = 0; i < noColumns; i++)
{
if (Chapters)
{
- fprintf(Chapters, "\n</BODY></HTML>\n");
+ fprintf(Chapters, "\n</FONT></BODY></HTML>\n");
fclose(Chapters);
Chapters = NULL;
}
if (Sections)
{
- fprintf(Sections, "\n</BODY></HTML>\n");
+ fprintf(Sections, "\n</FONT></BODY></HTML>\n");
fclose(Sections);
Sections = NULL;
}
if (Subsections && !combineSubSections)
{
- fprintf(Subsections, "\n</BODY></HTML>\n");
+ fprintf(Subsections, "\n</FONT></BODY></HTML>\n");
fclose(Subsections);
Subsections = NULL;
}
if (Subsubsections && !combineSubSections)
{
- fprintf(Subsubsections, "\n</BODY></HTML>\n");
+ fprintf(Subsubsections, "\n</FONT></BODY></HTML>\n");
fclose(Subsubsections);
Subsubsections = NULL;
}
fclose(fd);
}
- fprintf(tmpTitle, "\n</BODY>\n");
+ fprintf(tmpTitle, "\n</FONT></BODY>\n");
if (htmlFrameContents)
{