Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.