Esempio n. 1
0
void 
CmdMusic(int code)
/******************************************************************************
  purpose: Process \begin{music} ... \end{music} environment
 ******************************************************************************/
{
	char *contents;
	char endmusic[] = "\\end{music}";

	if (!(code & ON)) {
		diagnostics(4, "exiting CmdMusic");
		return;
	}

	diagnostics(4, "entering CmdMusic");
	contents = getTexUntil(endmusic, TRUE);
	CmdEndParagraph(0);
	CmdVspace(VSPACE_SMALL_SKIP);
	CmdIndent(INDENT_NONE);
	CmdStartParagraph(FIRST_PAR);
	WriteLatexAsBitmap("\\begin{music}",contents,endmusic);
	ConvertString(endmusic);	
	CmdEndParagraph(0);
	CmdVspace(VSPACE_SMALL_SKIP);
	CmdIndent(INDENT_INHIBIT);
	free(contents);		
}
Esempio n. 2
0
static void 
FinishRtfEquation(int code, int EQ_Needed)
{	
	if (EQ_Needed && g_processing_fields==1) {
		fprintRTF("}}{\\fldrslt }}");
		g_processing_fields--;	
	}
	
	switch (code) {
	
		case EQN_MATH:
			diagnostics(4,"FinishRtfEquation -- \\end{math}");
			CmdIndent(INDENT_INHIBIT);
			SetTexMode(MODE_HORIZONTAL);
			break;
	
		case EQN_DOLLAR:
			diagnostics(4,"FinishRtfEquation -- $");
			fprintRTF("}");
			SetTexMode(MODE_HORIZONTAL);
			break;
	
		case EQN_RND_OPEN:	
			diagnostics(4,"FinishRtfEquation -- \\)");
			fprintRTF("}");
			SetTexMode(MODE_HORIZONTAL);
			break;
	
		case EQN_DOLLAR_DOLLAR:
			diagnostics(4,"FinishRtfEquation -- $$");
			CmdEndParagraph(0);
			CmdIndent(INDENT_INHIBIT);
			fprintRTF("}");
			break;
	
		case EQN_BRACKET_OPEN:
			diagnostics(4,"FinishRtfEquation -- \\[");
			SetTexMode(MODE_VERTICAL);
			fprintRTF("\\par\\par\n}");
			break;

		case EQN_DISPLAYMATH:
			diagnostics(4,"FinishRtfEquation -- displaymath");
			CmdEndParagraph(0);
			CmdIndent(INDENT_INHIBIT);
			break;

		case EQN_EQUATION_STAR:
			diagnostics(4,"FinishRtfEquation -- equation*");
			CmdEndParagraph(0);
			CmdIndent(INDENT_INHIBIT);
			break;

		case EQN_ARRAY_STAR:
			diagnostics(4,"FinishRtfEquation -- eqnarray* ");
			CmdEndParagraph(0);
			CmdIndent(INDENT_INHIBIT);
			g_processing_eqnarray = FALSE;
			g_processing_tabular = FALSE;
			break;

		case EQN_EQUATION:
		case EQN_ARRAY:
		    diagnostics(4,"FinishRtfEquation --- equation or eqnarray");
			if (g_show_equation_number && !g_suppress_equation_number) {
				char number[20];
				incrementCounter("equation");
				for (; g_equation_column < 3; g_equation_column++)
						fprintRTF("\\tab ");
				fprintRTF("\\tab{\\b0 (");
				sprintf(number,"%d",getCounter("equation"));
				InsertBookmark(g_equation_label,number);
				if (g_equation_label) {
					free(g_equation_label);
					g_equation_label = NULL;
				}
				fprintRTF(")}");
			}
			g_processing_eqnarray = FALSE;
			g_processing_tabular = FALSE;
			CmdEndParagraph(0);
			CmdIndent(INDENT_INHIBIT);
			break;
			
		default:
			diagnostics(ERROR, "calling FinishRtfEquation with OFF code");
			break;
		}
}