# Is there a way to insert arbitrary RTF in latex2rtf output?

I want to insert the Han ideograph 命 in my LaTeX PDF and my RTF output. I can't figure an easy way to this. So for the PDF I am going to be inserting a PDF file that includes the 命. For the RTF file I can include this font specification at the top in the font table:

\f2\fnil\fcharset128 HiraMinProN-W3;


I can then isert the ideograph with this:

\f2 \'96\'bd \f0


Is there any way to do this with latex2rtf?

-

The best solution for this special case is to use UTF8 encoding for the input file and enter the chinese character directly (no need to modify the latex2rtf .cfg files) - the following code produces the desired character also when run through pdfLaTeX, so it needs no workaround as e.g. embedding a pdf graphic:

\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage{CJK}
\newif\iflatextortf
\begin{document}
\iflatextortf
\else
\begin{CJK}[]{UTF8}{gbsn}
\fi
Test for a Chinese symbol inserted 命 before this.
\iflatextortf
\else
\end{CJK}
\fi
\end{document}


However this doesn't solve the more general question of inserting arbitrary code in the rtf output. This could be done as follows: Add the font to the file fonts.cfg by adding the line

Dummy1,HiraMinProN-W3.


Add the following line to direct.cfg

\myhan,{\f*Dummy1*\u26947**}


or the following may work, too:

\myhan,{\f*Dummy1*\'96\'bd}


As I don't have your font, I successfully tested this with

Dummy1,Arial Unicode MS.

\myhan,{\f*Dummy1*\u21629**}


Now the \myhan{} command should be recognized by latex2rtf and converted into the defined string, but this isn't compatible with LaTeX, so you should use conditional processing

\documentclass...
...
\newif\iflatextortf
\begin{document}
...
\iflatextortf
... \myhan{} ...
\else
... <your pdf graphic here> ...
\fi

-