\n"));
TexOutput(buf);
- OutputFont();
+ OutputFont();
}
else
{
@@ -1649,16 +1687,22 @@ void HTMLOnMacro(int macroId, int no_args, bool start)
{
if (start)
{
+ // NB: if this is uncommented, the table of contents
+ // completely disappears. If left commented, it's in the wrong
+ // place.
+ //fflush(Titlepage);
+
FILE *fd = wxFopen(ContentsName, _T("r"));
if (fd)
{
int ch = getc(fd);
while (ch != EOF)
{
- putc(ch, Titlepage);
+ wxPutc(ch, Titlepage);
ch = getc(fd);
}
fclose(fd);
+ fflush(Titlepage);
}
else
{
@@ -1971,16 +2015,20 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start)
// If a filename is supplied, use it, otherwise try to
// use the filename associated with the reference (from this document).
if (helpRefFilename)
- {
+ {
TraverseChildrenFromChunk(helpRefFilename);
TexOutput(_T("#"));
- }
+ TexOutput(refName);
+ }
else if (refFilename)
- {
+ {
TexOutput(ConvertCase(refFilename));
- TexOutput(_T("#"));
- }
- TexOutput(refName);
+ if(!PrimaryAnchorOfTheFile(texRef->refFile, refName))
+ {
+ TexOutput(_T("#"));
+ TexOutput(refName);
+ }
+ }
TexOutput(_T("\">"));
if (helpRefText)
TraverseChildrenFromChunk(helpRefText);
@@ -2059,7 +2107,7 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start)
// If we have found the existing filename, make the inline
// image point to the original file (could be PS, for example)
if (originalFilename && (wxStrcmp(inlineFilename, originalFilename) != 0))
- {
+ {
TexOutput(_T(""));
@@ -2068,17 +2116,17 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start)
TexOutput(_T("\""));
TexOutput(alignment);
TexOutput(_T(">"));
- }
+ }
else
#endif
- {
+ {
TexOutput(_T(""));
delete[] inlineFilename;
- }
+ }
}
else
{
@@ -2195,27 +2243,36 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start)
{
if ( start ) {
// DHS
- if (TwoColWidthA > -1) {
+ if (TwoColWidthA > -1)
+ {
wxChar buf[100];
wxSnprintf(buf, sizeof(buf), _T("\n |
\n"));
- OutputFont();
+ }
+ OutputFont();
} else
TexOutput(_T("\n | \n"));
}
if (arg_no == 2)
{
// DHS
- if ( start ) {
- if (TwoColWidthB > -1) {
+ if ( start )
+ {
+ if (TwoColWidthB > -1)
+ {
wxChar buf[100];
wxSnprintf(buf, sizeof(buf), _T("\n\n"),TwoColWidthB);
TexOutput(buf);
- } else
- TexOutput(_T("\n | \n"));
- OutputFont();
+ }
+ else
+ {
+ TexOutput(_T("\n | \n"));
+ }
+ OutputFont();
} else
TexOutput(_T("\n |
\n"));
}
@@ -2701,7 +2758,7 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start)
if (compatibilityMode)
{
TexOutput(_T("