Exemple #1
0
/******************************************************************************
 purpose: converts \i and \j to 'i' and 'j' or Unicode equivalent
 ******************************************************************************/
void CmdDotlessChar(int code)
{
    if (code == 0)
        fprintRTF("\\u305i");  /*LATIN SMALL LETTER DOTLESS I 0x0131 */
    else
        fprintRTF("\\u567j");  /*LATIN SMALL LETTER DOTLESS J 0x0237 */
}
Exemple #2
0
void
CmdHtml(int code)
/******************************************************************************
purpose: handles \htmladdnormallink{text}{link}
******************************************************************************/
{
	char * text, *ref, *s;
	
	if (code == LABEL_HTMLADDNORMALREF) {
		text = getBraceParam();
		ref = getBraceParam();

		while ((s = strstr(text,"\\~{}")) != NULL) {
			*s = '~';
			strcpy(s+1,s+4);
		}
		while ((s = strstr(ref,"\\~{}")) != NULL) {
			*s = '~';
			strcpy(s+1,s+4);
		}
			
		fprintRTF("{\\field{\\*\\fldinst{ HYPERLINK \"%s\" }{{}}}",ref);
		fprintRTF("{\\fldrslt{\\ul %s}}}", text);
		free(text);
		free(ref);
	} else if (code == LABEL_HTMLREF) {
		text = getBraceParam();
		ref = getBraceParam();
		ConvertString(text);
		free(text);
		free(ref);
	}
}
Exemple #3
0
void
CmdArray(int code)
/******************************************************************************
 purpose   : Handles \begin{array}[c]{ccc} ... \end{array}
 ******************************************************************************/
{
char * v_align, * col_align, *s;
int n=0;

	if (code & ON) {
		v_align = getBracketParam();
		col_align = getBraceParam();
		diagnostics(4, "CmdArray() ... \\begin{array}[%s]{%s}", v_align?v_align:"", col_align);
		if (v_align) free(v_align);
		
		s = col_align;
		while (*s) {
			if (*s == 'c' || *s == 'l' || *s == 'r' ) n++;
			s++;
		}
		free(col_align);
		
		fprintRTF(" \\\\a \\\\ac \\\\co%d (", n);
		g_processing_arrays++;
		
	} else {
		fprintRTF(")");
		diagnostics(4, "CmdArray() ... \\end{array}");
		g_processing_arrays--;
	}
}
Exemple #4
0
/******************************************************************************
 purpose: converts \H{o}
 ******************************************************************************/
void CmdDoubleAcuteChar(int code)
{
    int n = RtfFontNumber("STIXGeneral");
    char *cParam = getBraceParam();

    switch (cParam[0]) {
        case 'O':
            putUnicodeChar(0x01,0x50,'O');
            break;
        case 'o':
            putUnicodeChar(0x01,0x51,'o');
            break;
        case 'U':
            putUnicodeChar(0x01,0x70,'U');
            break;
        case 'u':
            putUnicodeChar(0x01,0x71,'u');
            break;
        case '\0':
            putUnicodeChar(0x02,0xDD,'"');
            break;
        default:
            fprintRTF("{\\f%d",n);
            fprintRTF("\\u779\"}");  /* unicode combining character 0x030B */
            ConvertString(cParam);
            break;  
    }
    
    free(cParam);
}
Exemple #5
0
void
CmdPrintIndex(int code)
{
	CmdEndParagraph(0);
	fprintRTF("\\page ");
	fprintRTF("{\\field{\\*\\fldinst{INDEX \\\\c 2}}{\\fldrslt{}}}");
}
Exemple #6
0
static void put_cedilla_char(char c)
{
	int down = CurrentFontSize() / 4;
	fprintRTF("{\\field{\\*\\fldinst  EQ \\\\O(%c",c);
	fprintRTF("%c\\\\S(\\dn%d\\'b8))}", g_field_separator,down);
	fprintRTF("{\\fldrslt }}");
}
Exemple #7
0
void 
CmdClosing( /* @unused@ */ int code)
/******************************************************************************
 purpose: special command in the LaTex-letter-environment will be converted to a
	  similar Rtf-style
 globals: alignment
 ******************************************************************************/
{
	char           oldalignment;
	char           *s;
	
	oldalignment = alignment;

/* print closing on the right */
	alignment = RIGHT;
	fprintRTF("\n\\par\\pard\\q%c ", alignment);	
	diagnostics(5, "Entering ConvertString() from CmdClosing");
	s = getBraceParam();
	ConvertString(s);
	free(s);
	diagnostics(5, "Exiting ConvertString() from CmdClosing");

/* print signature a couple of lines down */
	fprintRTF("\n\\par\\par\\par ");

	diagnostics(5, "Entering ConvertString() from CmdSignature");
	ConvertString(g_letterSignature);
	diagnostics(5, "Exiting ConvertString() from CmdSignature");

	g_letterOpened = FALSE;
	alignment = oldalignment;
	fprintRTF("\n\\par\\pard\\q%c ", alignment);
}
Exemple #8
0
void 
CmdLim(int code)
/******************************************************************************
 purpose: handles \lim
parameter: 0=\lim, 1=\limsup, 2=\liminf
 ******************************************************************************/
{
	char cThis, *s, *lower_limit=NULL;

	cThis = getNonBlank();
    if (cThis == '_')
        lower_limit = getBraceParam();
    else
        ungetTexChar(cThis);

	if (code == 0)
		s=strdup("lim");
	else if (code == 1)
		s=strdup("lim sup");
	else
		s=strdup("lim inf");

    if (lower_limit) 
    	fprintRTF("\\\\a\\\\ac(");

    fprintRTF("%s",s);

    if (lower_limit) {
		fprintRTF("%c",g_field_separator);
        ConvertString(lower_limit);
    	fprintRTF(")");
    }
    
    free(s);
}
Exemple #9
0
static void latin9_enc(int index)
{
char *s;
	s = latin9_2_ansi[index];
	if (s[0]!='0'){
		fprintRTF("\\'%s",s);
		return;
	}
	s = latin9_2_sym[index];
	if (s[0]!='0'){
		int sym=RtfFontNumber("Symbol");
		fprintRTF("{\\f%d\\'%s}",sym,s);
		return;
	}
	if (index + 128 == 0xA4) { /* U+8364 unknown */ 
/*		fprintRTF("TRANSLATION");*/
		return;
	}
	if (index + 128 == 0xB4) { /* U+381 LATIN CAPITAL LETTER Z WITH CARON */ 
/*		fprintRTF("TRANSLATION");*/
		return;
	}
	if (index + 128 == 0xB8) { /* U+382 LATIN SMALL LETTER Z WITH CARON */ 
/*		fprintRTF("TRANSLATION");*/
		return;
	}
}
Exemple #10
0
void
InsertBookmark(char *name, char *text)
{
	char *signet;
	if (!name) {
		fprintRTF("%s",text);
		return;
	}

	signet = strdup_nobadchars(name);

	if (ExistsBookmark(signet)) {
		diagnostics(3,"bookmark %s already exists",signet);

	} else {
		diagnostics(3,"bookmark %s being inserted around <%s>",signet,text);
		RecordBookmark(signet);
		if (g_fields_use_REF) 
			fprintRTF("{\\*\\bkmkstart BM%s}",signet);
		fprintRTF("%s",text);
		if (g_fields_use_REF) 
			fprintRTF("{\\*\\bkmkend BM%s}",signet);
	}
	
	free(signet);
}
Exemple #11
0
void
CmdLeftRight(int code)
/******************************************************************************
 purpose   : Handles \left \right
 			 to properly handle \left. or \right. would require prescanning the
 			 entire equation.  
 ******************************************************************************/
{ 
	char delim;

	delim = getTexChar();
	if (delim == '\\')			/* might be \{ or \} */
		delim = getTexChar();
	
	if (code == 0) {
		diagnostics(4, "CmdLeftRight() ... \\left <%c>", delim);

		if (delim == '.')
			diagnostics(WARNING, "\\left. not supported");
		
		fprintRTF(" \\\\b ");
		if (delim == '(' || delim == '.')
			fprintRTF("(");
		else if (delim == '{')
			fprintRTF("\\\\bc\\\\\\{ (");
		else 
			fprintRTF("\\\\bc\\\\%c (", delim);

	} else {
		fprintRTF(")");
		if (delim == '.')
			diagnostics(WARNING, "\\right. not supported");
		diagnostics(4, "CmdLeftRight() ... \\right <%c>", delim);
	}
}
Exemple #12
0
void 
CmdFraction(int code)
/******************************************************************************
 purpose: converts \frac{x}{y} (following Taupin's implementation in ltx2rtf)
******************************************************************************/
{
	char           *denominator, *numerator, *nptr, *dptr;

	numerator = getBraceParam();
	nptr = strdup_noendblanks(numerator);
	skipSpaces();
	denominator = getBraceParam();
	dptr = strdup_noendblanks(denominator);

	free(numerator);
	free(denominator);
	diagnostics(4,"CmdFraction -- numerator   = <%s>", nptr);
	diagnostics(4,"CmdFraction -- denominator = <%s>", dptr);

	fprintRTF(" \\\\F(");
	ConvertString(nptr);
	fprintRTF("%c", g_field_separator);
	ConvertString(dptr);
	fprintRTF(")");

	free(nptr);
	free(dptr);
}
Exemple #13
0
void
CmdIndex(int code)
/******************************************************************************
purpose: convert \index{classe!article@\textit{article}!section}
              to {\xe\v "classe:{\i article}:section"}
******************************************************************************/
{
	char cThis, *text, *r, *s, *t;
	
	cThis = getNonBlank();
	text = getDelimitedText('{', '}', TRUE);
	diagnostics(4, "CmdIndex \\index{%s}", text);
	fprintRTF("{\\xe{\\v ");
	
	t = text;
	while (t) {
		s = t;
		t = strchr(s,'!');
		if (t) *t = '\0';
		r = strchr(s,'@');
		if (r) s=r+1;
		ConvertString(s);
/*		while (*s && *s != '@') putRtfChar(*s++);*/
		if (t) {
			fprintRTF("\\:");
			t++;
		}
	}
			
	fprintRTF("}}");
	diagnostics(4, "leaving CmdIndex");
	free(text);
}
Exemple #14
0
static void put_dot_char(char c)
{
	int num = RtfFontNumber("MT Extra");
	fprintRTF("{\\field{\\*\\fldinst  EQ \\\\O(%c",c);
	fprintRTF("%c\\\\S(\\f%d\\'26))}", g_field_separator, num);
	fprintRTF("{\\fldrslt }}");
}
Exemple #15
0
void 
CmdThebibliography(int code)
{
	int amount = 450;
	
	if (code & ON) {
		char * s = getBraceParam();   /*throw away widest_label */
		free(s);
		
		CmdEndParagraph(0);
		CmdVspace(VSPACE_MEDIUM_SKIP);
		CmdStartParagraph(TITLE_PAR);

		fprintRTF("{\\plain\\b\\fs32 ");
		if (g_document_type == FORMAT_ARTICLE)
			ConvertBabelName("REFNAME");
		else
			ConvertBabelName("BIBNAME");
		fprintRTF("}");
		CmdEndParagraph(0);
		CmdVspace(VSPACE_SMALL_SKIP);

		PushEnvironment(GENERIC_ENV);
		//setLength("parindent", -amount);
		//g_left_margin_indent += 2*amount;
	} else {
		CmdEndParagraph(0);
		CmdVspace(VSPACE_SMALL_SKIP);
		PopEnvironment();
		g_processing_list_environment=FALSE;
	}
}
Exemple #16
0
/*****************************************************************************
 purpose: converts \U{i} ... probably specific to ot2
 ******************************************************************************/
void CmdWideBreveChar(int code)
{
    int n = RtfFontNumber("STIXGeneral");
    char *cParam = getBraceParam();
    
    switch (cParam[0]) {
        case 'U':
            CmdUnicodeChar(0x040E);
            break;
        case 'I':
            CmdUnicodeChar(0x0419);
            break;
        case 'i':
            CmdUnicodeChar(0x0439);
            break;
        case 'u':
            CmdUnicodeChar(0x0439);
            break;
        default:
            fprintRTF("{\\f%d",n);
            fprintRTF("\\u774u}");  /* unicode combining character 0x0306 */
            ConvertString(cParam);
            break;
    }
        
    free(cParam);
}
Exemple #17
0
static void put_breve_char(char c)
{
	int num = RtfFontNumber("MT Extra");	
	int upsize = CurrentFontSize()/2;
	fprintRTF("{\\field{\\*\\fldinst  EQ \\\\O(%c",c);
	fprintRTF("%c\\\\S(\\up%d\\f%d \\\\())}", g_field_separator, upsize, num);
	fprintRTF("{\\fldrslt }}");
}
Exemple #18
0
static void 
PutPictFile(char * s, double scale, double baseline, int full_path)
/******************************************************************************
     purpose : Include .pict file in RTF
 ******************************************************************************/
{
FILE *fp;
char *pict;
short buffer[5];
short top, left, bottom, right;
int width, height;

	if (full_path)
		pict = strdup(s);
	else
		pict = strdup_together(g_home_dir, s);		
	diagnostics(1, "PutPictFile <%s>", pict);

	fp = fopen(pict, "rb");
	free(pict);
	if (fp == NULL) return;
	
	if (fseek(fp, 514L, SEEK_SET) || fread(buffer, 2, 4, fp) != 4) {
		diagnostics (WARNING, "Cannot read graphics file <%s>", s);
		fclose(fp);
		return;
	}
	
	top    = buffer[0];
	left   = buffer[1];
	bottom = buffer[2];
	right  = buffer[3];

	width  = right - left;
	height = bottom - top;
	
	if (g_little_endian) {
		top    = LETONS(top);
		bottom = LETONS(bottom);
		left   = LETONS(left);
		right  = LETONS(right);
	}

	diagnostics(4,"top = %d, bottom = %d", top, bottom);
	diagnostics(4,"left = %d, right = %d", left, right);
	diagnostics(4,"width = %d, height = %d", width, height);
	fprintRTF("\n{\\pict\\macpict\\picw%d\\pich%d\n", width, height);
	if (scale != 1.0) {
		int iscale = (int) (scale * 100);
		fprintRTF("\\picscalex%d\\picscaley%d", iscale, iscale);
	}

	fseek(fp, -10L, SEEK_CUR);
	PutHexFile(fp);
	fprintRTF("}\n");
	fclose(fp);
}
Exemple #19
0
/*****************************************************************************
 purpose: converts \vec{o} from LaTeX to RTF
 ******************************************************************************/
void CmdVecChar(int code)
{
    int n = RtfFontNumber("STIXGeneral");
    char *cParam = getBraceParam();
    fprintRTF("{\\f%d ",n);
    putUnicodeChar(0x20,0xD7,'-');  /* COMBINING RIGHT ARROW ABOVE */
    fprintRTF("}");
    ConvertString(cParam);
    free(cParam);
}
Exemple #20
0
/*****************************************************************************
 purpose: emit a unicode character.  values above 2^15 are negative
          the default_char should be a simple ascii 0-127 character
 ******************************************************************************/
static void putUnicodeChar(unsigned char b1, unsigned char b2, char default_char)
{
    if (getTexMode() == MODE_VERTICAL)
        changeTexMode(MODE_HORIZONTAL);

    if (b1<128)
        fprintRTF("\\u%d%c",b1*256+b2,default_char);
    else
        fprintRTF("\\u%d%c",b1*256+b2-65536,default_char);
}
Exemple #21
0
static void cp850_enc(int index)
{
char *s;
	s = cp850_2_ansi[index];
	if (s[0]!='0'){
		fprintRTF("\\'%s",s);
		return;
	}
	s = cp850_2_sym[index];
	if (s[0]!='0'){
		int sym=RtfFontNumber("Symbol");
		fprintRTF("{\\f%d\\'%s}",sym,s);
		return;
	}
	if (index + 128 == 0xB0) { /* U+9617 LIGHT SHADE */ 
/*		fprintRTF("TRANSLATION");*/
		return;
	}
	if (index + 128 == 0xB1) { /* U+9618 MEDIUM SHADE */ 
/*		fprintRTF("TRANSLATION");*/
		return;
	}
	if (index + 128 == 0xB2) { /* U+9619 DARK SHADE */ 
/*		fprintRTF("TRANSLATION");*/
		return;
	}
	if (index + 128 == 0xD5) { /* U+305 LATIN SMALL LETTER DOTLESS I */ 
		fprintRTF("i");
		return;
	}
	if (index + 128 == 0xDB) { /* U+9608 FULL BLOCK */ 
/*		fprintRTF("TRANSLATION");*/
		return;
	}
	if (index + 128 == 0xDC) { /* U+9604 LOWER HALF BLOCK */ 
/*		fprintRTF("TRANSLATION");*/
		return;
	}
	if (index + 128 == 0xDF) { /* U+9600 UPPER HALF BLOCK */ 
/*		fprintRTF("TRANSLATION");*/
		return;
	}
	if (index + 128 == 0xF7) { /* U+731 OGONEK */ 
/*		fprintRTF("TRANSLATION");*/
		return;
	}
	if (index + 128 == 0xFA) { /* U+729 DOT ABOVE */ 
		put_dot_char(' ');
		return;
	}
	if (index + 128 == 0xFE) { /* U+9632 BLACK SQUARE */ 
/*		fprintRTF("TRANSLATION");*/
		return;
	}
}
Exemple #22
0
/*****************************************************************************
 purpose: converts \u{o} and \breve{o} 
 ******************************************************************************/
void CmdBreveChar(int code)
{
    int n = RtfFontNumber("STIXGeneral");
    char *cParam = getBraceParam();
    
    switch (cParam[0]) {
        case 'A':
            putUnicodeChar(0x01,0x02,'A');
            break;
        case 'a':
            putUnicodeChar(0x01,0x03,'a');
            break;
        case 'E':
            putUnicodeChar(0x01,0x14,'E');
            break;
        case 'e':
            putUnicodeChar(0x01,0x15,'e');
            break;
        case 'G':
            putUnicodeChar(0x01,0x1e,'G');
            break;
        case 'g':
            putUnicodeChar(0x01,0x1f,'g');
            break;
        case 'I':
            putUnicodeChar(0x01,0x2c,'I');
            break;
        case 'i':
            putUnicodeChar(0x01,0x2d,'i');
            break;
        case 'O':
            putUnicodeChar(0x01,0x4e,'O');
            break;
        case 'o':
            putUnicodeChar(0x01,0x4f,'o');
            break;
        case 'U':
            putUnicodeChar(0x01,0x6c,'U');
            break;
        case 'c':
            putUnicodeChar(0x01,0x0D,'c');
            break;
        case '\0':
            putUnicodeChar(0x02,0xD8,'u');
            break;
        default:
            fprintRTF("{\\f%d",n);
            fprintRTF("\\u774u}");  /* unicode combining character 0x0306 */
            ConvertString(cParam);
            break;  
    }

    free(cParam);
}
Exemple #23
0
static void
WriteEquationAsComment(char *pre, char *eq, char *post)
/******************************************************************************
 purpose   : Writes equation to RTF file as text of COMMENT field
 ******************************************************************************/
{
	fprintRTF("{\\field{\\*\\fldinst{ COMMENTS \"\" ");
 	while (*pre)  putRtfChar(*pre++);
	while (*eq)   putRtfChar(*eq++);
	while (*post) putRtfChar(*post++);
	fprintRTF("}{ }}{\\fldrslt }}");
}
Exemple #24
0
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);
}
Exemple #25
0
static void latin5_enc(int index)
{
char *s;
	s = latin5_2_ansi[index];
	if (s[0]!='0'){
		fprintRTF("\\'%s",s);
		return;
	}
	s = latin5_2_sym[index];
	if (s[0]!='0'){
		int sym=RtfFontNumber("Symbol");
		fprintRTF("{\\f%d\\'%s}",sym,s);
		return;
	}
	if (index + 128 == 0xD0) { /* U+286 LATIN CAPITAL LETTER G WITH BREVE */ 
		put_breve_char('G');
		return;
	}
	if (index + 128 == 0xDD) { /* U+304 LATIN CAPITAL LETTER I WITH DOT ABOVE */ 
		put_dot_char('I');
		return;
	}
	if (index + 128 == 0xDE) { /* U+350 LATIN CAPITAL LETTER S WITH CEDILLA */ 
		put_cedilla_char('S');
		return;
	}
	if (index + 128 == 0xEA) { /* U+281 LATIN SMALL LETTER E WITH OGONEK */ 
/*		fprintRTF("TRANSLATION");*/
		return;
	}
	if (index + 128 == 0xEC) { /* U+279 LATIN SMALL LETTER E WITH DOT ABOVE */ 
		put_dot_char('e');
		return;
	}
	if (index + 128 == 0xEF) { /* U+299 LATIN SMALL LETTER I WITH MACRON */ 
		put_macron_char('i');
		return;
	}
	if (index + 128 == 0xF0) { /* U+287 LATIN SMALL LETTER G WITH BREVE */ 
		put_breve_char('g');
		return;
	}
	if (index + 128 == 0xFD) { /* U+305 LATIN SMALL LETTER DOTLESS I */ 
		fprintRTF("i");
		return;
	}
	if (index + 128 == 0xFE) { /* U+351 LATIN SMALL LETTER S WITH CEDILLA */ 
		put_cedilla_char('s');
		return;
	}
}
Exemple #26
0
void CmdLabel(int code)
/******************************************************************************
purpose: handles \label \ref \pageref \cite
******************************************************************************/
{
	char *text, *signet, *s;
	char *option = NULL;
	int mode=GetTexMode();
	
	option = getBracketParam();
	text = getBraceParam();
	if (strlen(text)==0) {
		free(text);
		return;
	}
	
	switch (code) {
		case LABEL_LABEL:
			if (g_processing_figure || g_processing_table) break;
			if (mode == MODE_DISPLAYMATH) {
				g_equation_label = strdup_nobadchars(text);
				diagnostics(3,"equation label is <%s>",text);
			} else 
				InsertBookmark(text,"");
			break;
		
		case LABEL_HYPERREF:
		case LABEL_REF:
			signet = strdup_nobadchars(text);
			s = ScanAux("newlabel", text, 1);
			if (g_fields_use_REF) {
				fprintRTF("{\\field{\\*\\fldinst{\\lang1024 REF BM%s \\\\* MERGEFORMAT }}",signet);
				fprintRTF("{\\fldrslt{");
			}
			if (s)
				ConvertString(s);
			else
				fprintRTF("?");
			if (g_fields_use_REF) fprintRTF("}}}");
				
			free(signet);
			if (s) free(s);
			break;
				
		case LABEL_HYPERPAGEREF:
		case LABEL_PAGEREF:
			signet = strdup_nobadchars(text);
			if (g_fields_use_REF) {
				fprintRTF("{\\field{\\*\\fldinst{\\lang1024 PAGEREF BM%s \\\\* MERGEFORMAT }}",signet);
				fprintRTF("{\\fldrslt{");
			}
			fprintRTF("%s",signet);
			if (g_fields_use_REF) fprintRTF("}}}");
			free(signet);
			break;
	}
	
	free(text);
	if (option) free(option);
}
Exemple #27
0
void CmdLogo(int code)

/******************************************************************************
 purpose : converts the LaTeX, TeX, SLiTex, etc logos to RTF 
 ******************************************************************************/
{
    int dnsize;

    changeTexMode(MODE_HORIZONTAL);
    fprintRTF("{\\plain ");

    switch (code) {
        case CMD_TEX:
            TeXlogo();
            break;

        case CMD_LATEX:
            LaTeXlogo();
            break;

        case CMD_SLITEX:
            fprintRTF("{\\scaps Sli}");
            TeXlogo();
            break;

        case CMD_BIBTEX:
            fprintRTF("{\\scaps Bib}");
            TeXlogo();
            break;

        case CMD_LATEXE:
            LaTeXlogo();
            dnsize = (int) (0.3 * CurrentFontSize() + 0.45);
            fprintRTF("2{\\dn%d", dnsize);
            putUnicodeChar(0x03,0xF5,'e');
            fprintRTF("}");
            break;

        case CMD_AMSTEX:
            fprintRTF("{\\i AmS}-");    /* should be calligraphic */
            TeXlogo();
            break;

        case CMD_AMSLATEX:
            fprintRTF("{\\i AmS}-");    /* should be calligraphic */
            LaTeXlogo();
            break;

        case CMD_LYX:
            dnsize = (int) (0.3 * CurrentFontSize() + 0.45);
            fprintRTF("L{\\dn%d Y}X", dnsize);
            break;
    }
    fprintRTF("}");
}
Exemple #28
0
void CmdCzechAbbrev(int code)

/******************************************************************************
  purpose: only handles \uv{quote} at the moment
 ******************************************************************************/
{
    char *quote;

    quote = getBraceParam();
    fprintRTF(" \\'84");
    ConvertString(quote);
    free(quote);
    fprintRTF("\\ldblquote ");
    return;
}
Exemple #29
0
static void latin1_enc(int index)
{
char *s;
	s = latin1_2_ansi[index];
	if (s[0]!='0'){
		fprintRTF("\\'%s",s);
		return;
	}
	s = latin1_2_sym[index];
	if (s[0]!='0'){
		int sym=RtfFontNumber("Symbol");
		fprintRTF("{\\f%d\\'%s}",sym,s);
		return;
	}
}
Exemple #30
0
void 
CmdEmphasize(int code)
/****************************************************************************
 purpose: LaTeX commands \em, \emph, and \begin{em} ... \end{em}
 
 		  the \emph{string} construction is handled by \textit{string} or \textup{string}
 		  
 		  {\em string} should be properly localized by brace mechanisms
 		  
 		  \begin{em} ... \end{em} will be localized by environment mechanisms

	 F_EMPHASIZE_1        for  \em ... 
	 F_EMPHASIZE_2        for  \emph{...}
	 F_EMPHASIZE_3        for  \begin{em} ... \end{em}
 ******************************************************************************/
{
	int true_code  = code & ~ON;
	
	diagnostics(4,"CmdEmphasize (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_EMPHASIZE_3 && !(code & ON)) 
	     return;

	if (true_code == F_EMPHASIZE_2) {

		if (CurrentFontShape() == F_SHAPE_UPRIGHT) 
			CmdFontShape(F_SHAPE_ITALIC_2);
		else
			CmdFontShape(F_SHAPE_UPRIGHT_2);
	
	} else {
	
		if (CurrentFontShape() == F_SHAPE_UPRIGHT)
			fprintRTF("\\i ");
		else
			fprintRTF("\\i0 ");

	}

	diagnostics(4,"CmdEmphasize (after) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
				   FontInfoDepth, RtfFontInfo[FontInfoDepth].family, \
	               RtfFontInfo[FontInfoDepth].size, RtfFontInfo[FontInfoDepth].shape,\
	               RtfFontInfo[FontInfoDepth].series);
	               
}