I am using the montex package to type text in Manchu (manju). In my documents, I also use Latin script with diacritics. When I load montex, these diacritics no longer appear, and when characters with diacritics reach 100, compilation fails altogether because of too many error. The montex documentation lists several encodings for Input and Output, the former including utf-8 (pp. 19-22). As a non-programmer, I don't quite understand this, but it seems to me that none of the encodings listed in Table 4.1. "MonTeX Input Encodings" has one that can handle all the diacritics that I need. Does this mean that MonTeX is in fact incompatible with full unicode?

Working minimal example without montex:

\setmainfont{Linux Libertine O}
yǐ mǎn zhōng wèn wén\\ %Latin texts with diacritics in Roman and Italics
\emph{yǐ mǎn zhōng wèn wén}

This looks good:

enter image description here

If I also load MonTeX and write some Manchu, it does not work:

\setmainfont{Linux Libertine O}
\usepackage{mls} %Loading MonTeX
\bithe{manju gisun}\\ %Typing Manchu
yǐ mǎn zhōng wèn wén\\
\emph{yǐ mǎn zhōng wèn wén}

The result:

enter image description here

In this file, the italicization has disappeared as well.

Looking through the list of encodings in the MonTeX manual, I find---perhaps I'm wrong?---that the best encoding is english as document language, and mls as encoding. But adding these options to


doesn't change the output.

The above is compiled with XeLaTeX but I've also compiled the same file with LuaLateX with the same result

Does anyone know what I should do to resolve this?

  • Looking at mls.sty, I see that the package fontenc an inputenc are required, which, afaik, clash with fontspec. Removing \usepackage{fontspec} and \setmainfont{Linux Libertine O then compiling with xelatex or lualatex work in my machine. But I am not really that sure what is happening here. :-) – hpesoj626 Jan 29 '13 at 3:51
  • @hpesoj626 Hmm it doesn't solve it for me, the problem remains the same. Also, I do need some way to choose between fonts (in real documents, there will be CJK, italics, small caps and all sorts of stuff included...) – Mårten Jan 29 '13 at 4:00
  • Can't you use fontspec for font selection (italics etc.)? And then you can use CJK or whatever for CJK fonts, I believe. The point is that inputenc isn't suitable if you are using XeLateX and fontenc probably isn't unless you know why you need it. – cfr Mar 16 '14 at 2:17
  • Load mls before fontspec. It is still wrong but the output is better and you get more meaningful error messages. – cfr Mar 16 '14 at 2:22

Make a copy of mls.sty. Name it mls-hacked.sty. Apply the following patch.

--- mls-hacked.sty      2010-04-09 19:28:51.000000000 +0100
+++ mls-hacked.sty      2014-03-16 02:32:39.086050752 +0000
@@ -11,7 +11,7 @@
 % -------------------     identification     -------------------
-\newcommand{\VersionDate}{2010/04/01}% 2002/07/01 with modified language name
+\newcommand{\VersionDate}{2014/03/16}% 2002/07/01 with modified language name
@@ -19,7 +19,8 @@
-\ProvidesPackage{mls}[2010/04/01 IVu.04.092 Mongolian for LaTeX2e]%
+\ProvidesPackage{mls-hacked}[2014/03/16 IVu.04.092 Mongolian for LaTeX2e Hacked to remove inputenc]%
+\PackageWarning{mls-hacked}{This is NOT the official version of mls.sty. It will almost certainly break things badly. It will complain slightly less when used with XeLaTeX, however.}
 % -------------------      initial code      -------------------
@@ -337,55 +338,6 @@
-% -------- Loading of various codepage definitions -------------
-% Input encodings supplied by MonTeX
-% Initial Unicode Mongolian utf-8 support. Experimental
-% Input encodings supplied by standard installations
 % -------------------  execution of options  -------------------
@@ -415,8 +367,6 @@
 % PostScript detection; necessary for user-friendly
 % execution of vertical capsules

will produce:

Mongolian and emphasised text

\usepackage{mls-hacked}% Note that the order is crucial - this must be loaded before fontspec
\setmainfont{Linux Libertine O}
\bithe{manju gisun}\\ %Typing Manchu
yǐ mǎn zhōng wèn wén\\
\emph{yǐ mǎn zhōng wèn wén}

Note that you can get the same output with mls.sty but it will complain a great deal about loading inputenc because this should not be loaded with XeLaTeX which assumes utf8 input.

  • does applying the patch means copying and pasting that contents into the end of the .sty file? or replacing the contents of the .sty with that contents? – Mårten Mar 16 '14 at 3:17
  • @Mårten Which OS are you on? On Linux or OS X, you would just save that as a file, patch, in the same directory as mls-hacked.sty (i.e. the copy of mls.sty). Then you would just say patch <patch. I don't know how you apply patches on Windows, though. – cfr Mar 16 '14 at 3:24
  • 1
    If necessary, you can apply the changes by hand. The first two lines just give information about which file is to be modified. The lines which start with - are deleted. The lines which start with + are added. The lines which start with @ specify locations in the file to help patch identify which lines to modify. The remaining lines provide context which also help patch to figure out which lines to modify. So you can basically find the lines in the file which I've deleted and the places were I've added lines. Pretty much all I've done is remove all lines related to inputenc... – cfr Mar 16 '14 at 3:34
  • @Mårten ..., modified the name of the file (to match the filename and to avoid classes with mls) and the file information, and added a warning to the effect that this is not the official style file and is expected to break stuff. – cfr Mar 16 '14 at 3:35
  • I get this: Hunk #2 succeeded at 19 with fuzz 1. Hunk #3 FAILED at 56. Hunk #4 FAILED at 115. Hunk #5 FAILED at 147. Hunk #7 succeeded at 367 with fuzz 1. Hunk #8 FAILED at 451. Hunk #9 FAILED at 616. 5 out of 9 hunks FAILED -- saving rejects to file mls-hacked.sty.rej I don't know what I'm doing wrong. I'm on Mac OS. – Mårten Mar 16 '14 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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