Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Troubles with non-ASCII (UTF-8 encoded) #1

Open
simatic opened this Issue · 0 comments

1 participant

simatic
simatic

Under Windows, msctexen does not handle correctly MSCs containing non-ASCII (UTF-8 encoded) characters: éèîà... (see example at the end of this post). More precisely, when you have such characters in your MSC, they do not come out correctly (they are omitted or replaced by strange characters.

The problem comes from the fact that mscgen handles correctly UTF-8 encoded characters when doing a PNG output, but not an EPS output which is used by msctexen (see mscgen issue: http://code.google.com/p/mscgen/issues/detail?id=7).

A bypass msctexen is to replace the 3 last lines of msctexen.sty (which generate an EPS file)

\immediate\write18{mscgen -T eps -i \mscfname.mscg -o \mscfname.eps >\mscfname.out 2> \mscfname.err}
\immediate\write18{epstopdf --gsopt=-dEPSCrop \mscfname.eps}

{\includegraphics[width=\msc@width]{\mscfname}}}

by the following lines (which generate a PNG file)

\immediate\write18{mscgen -T png -i \mscfname.mscg -o \mscfname.png >\mscfname.out 2> \mscfname.err}

{\includegraphics[width=\msc@width]{\mscfname.png}}}

Drawback of this bypass: the latex document should be able to handle PNG files.

Final word: thank you very much for msctexen: it helps a lot!

Michel

Extract of a Latex file not correctly generated by msctexen:

\begin{figure}[htbp]
\begin{center}
\caption{test with UTF-8 characters}
\renewcommand{\mscwidth}{14cm}
\begin{msc}
msc {
hscale = "1", arcgradient = "8";

# The entities
A, B;

A->B [label="ç LATIN SMALL LETTER C WITH CEDILLA"];
A->B [label="è LATIN SMALL LETTER E WITH GRAVE"];
A->B [label="é LATIN SMALL LETTER E WITH ACUTE"];
A->B [label="ê LATIN SMALL LETTER E WITH CIRCUMFLEX"];
A->B [label="ë LATIN SMALL LETTER E WITH DIAERESIS"];
A->B [label="ì LATIN SMALL LETTER I WITH GRAVE"];
A->B [label="í LATIN SMALL LETTER I WITH ACUTE"];
A->B [label="î LATIN SMALL LETTER I WITH CIRCUMFLEX"];
A->B [label="ï LATIN SMALL LETTER I WITH DIAERESIS"];
|||; }
\end{msc}
\end{center}
\end{figure}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.