void CmdTextNormal(int code) /**************************************************************************** purpose: handle \textnormal{text} {\normalfont ...} commands F_TEXT_NORMAL for \normalfont ... F_TEXT_NORMAL_1 F_TEXT_NORMAL_2 for \textnormal{...} F_TEXT_NORMAL_3 for \begin{normalfont} ... \end{normalfont} ******************************************************************************/ { int true_code = code & ~ON; diagnostics(5, "CmdTextNormal (before) depth=%d, family=%d, size=%d, shape=%d, series=%d", FontInfoDepth, RtfFontInfo[FontInfoDepth].family, RtfFontInfo[FontInfoDepth].size, RtfFontInfo[FontInfoDepth].shape, RtfFontInfo[FontInfoDepth].series); if (true_code == F_TEXT_NORMAL_3 && !(code & ON)) return; if (getTexMode() == MODE_VERTICAL) changeTexMode(MODE_HORIZONTAL); if (code == F_TEXT_NORMAL_2) fprintRTF("{"); if (CurrentFontShape() != DefaultFontShape()) CmdFontShape(DefaultFontShape()); if (CurrentFontSeries() != DefaultFontSeries()) CmdFontSeries(DefaultFontSeries()); if (CurrentFontSize() != DefaultFontSize()) CmdFontSize(DefaultFontSize()); if (CurrentFontFamily() != DefaultFontFamily()) CmdFontFamily(DefaultFontFamily()); if (code == F_TEXT_NORMAL_2) { char *s; s = getBraceParam(); ConvertString(s); free(s); fprintRTF("}"); } diagnostics(5, "CmdTextNormal (after) depth=%d, family=%d, size=%d, shape=%d, series=%d", FontInfoDepth, RtfFontInfo[FontInfoDepth].family, RtfFontInfo[FontInfoDepth].size, RtfFontInfo[FontInfoDepth].shape, RtfFontInfo[FontInfoDepth].series); }
void CmdFootNote(int code) /****************************************************************************** purpose: converts footnotes from LaTeX to Rtf params : code specifies whether it is a footnote or a thanks-mark ******************************************************************************/ { char *number, *text; static int thankno = 1; int text_ref_upsize, foot_ref_upsize; int DefFont = DefaultFontFamily(); diagnostics(4,"Entering ConvertFootNote"); number = getBracketParam(); /* ignored by automatic footnumber generation */ text = getBraceParam(); if (number) free(number); text_ref_upsize = (int) (0.8 * CurrentFontSize()); foot_ref_upsize = (int) (0.8 * CurrentFontSize()); switch (code) { case FOOTNOTE_THANKS: thankno++; fprintRTF("{\\up%d %d}\n", text_ref_upsize, thankno); fprintRTF("{\\*\\footnote \\pard\\plain\\s246\\f%d",DefFont); fprintRTF("\\fs%d {\\up%d %d}", CurrentFontSize(), foot_ref_upsize, thankno); break; case FOOTNOTE: fprintRTF("{\\up%d\\chftn}\n", text_ref_upsize); fprintRTF("{\\*\\footnote \\pard\\plain\\s246\\f%d",DefFont); fprintRTF("\\fs%d {\\up%d\\chftn}", CurrentFontSize(), foot_ref_upsize); break; case FOOTNOTE_TEXT: fprintRTF("{\\*\\footnote \\pard\\plain\\s246\\f%d",DefFont); fprintRTF("\\fs%d ", CurrentFontSize()); break; } ConvertString(text); fprintRTF("}\n "); diagnostics(4,"Exiting CmdFootNote"); free(text); }