<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>I discuss this here:
<a class="moz-txt-link-freetext" href="https://tex.stackexchange.com/questions/525898/combining-french-and-greek-babel-does-not-work-in-dvilualatex">https://tex.stackexchange.com/questions/525898/combining-french-and-greek-babel-does-not-work-in-dvilualatex</a></p>
    <p>For some reason, there is an error when trying to use French and
      Greek Babel support with dvilualatex.</p>
    <p>Try running the following, and it will work fine with
      dvilualatex+dvips/dvipdfmx:</p>
    <pre class="lang-tex prettyprint prettyprinted" style=""><code><span class="kwd">\documentclass</span><span class="pun">[</span><span class="lit">12pt</span><span class="pun">]{</span><span class="pln">article</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">\usepackage</span><span class="pun">[</span><span class="pln">utf8</span><span class="pun">]{</span><span class="pln">luainputenc</span><span class="pun">}</span><span class="kwd">\usepackage</span><span class="pun">[</span><span class="pln">LGR,T1</span><span class="pun">]{</span><span class="pln">fontenc</span><span class="pun">}</span><span class="kwd">\input</span><span class="pun">{</span><span class="pln">lgrenc.dfu</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">\usepackage</span><span class="pun">{</span><span class="pln">lmodern</span><span class="pun">}</span><span class="pln"> </span><span class="kwd">\usepackage</span><span class="pun">[</span><span class="pln">greek.ancient,main</span><span class="pun">=</span><span class="pln">french</span><span class="pun">]{</span><span class="pln">babel</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">\title</span><span class="pun">{</span><span class="pln">Ça marche?</span><span class="pun">}</span><span class="pln"> </span><span class="com">%\date{} \author{me}</span><span class="pln">
</span><span class="kwd">\begin</span><span class="pun">{</span><span class="pln">document</span><span class="pun">}</span><span class="pln"> </span><span class="kwd">\maketitle</span><span class="pln"> un, deux, trois </span><span class="kwd">\end</span><span class="pun">{</span><span class="pln">document</span><span class="pun">}</span></code></pre>
    <p>Or, try running with English and Greek, and again it works
      perfectly fine once you include Greek text: (Replacing English
      with any other language I tried seems to work, such as Spanish as
      well)</p>
    <pre class="lang-tex prettyprint prettyprinted" style=""><code><span class="kwd">\documentclass</span><span class="pun">[</span><span class="lit">12pt</span><span class="pun">]{</span><span class="pln">article</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">\usepackage</span><span class="pun">[</span><span class="pln">utf8</span><span class="pun">]{</span><span class="pln">luainputenc</span><span class="pun">}</span><span class="kwd">\usepackage</span><span class="pun">[</span><span class="pln">LGR,T1</span><span class="pun">]{</span><span class="pln">fontenc</span><span class="pun">}</span><span class="kwd">\input</span><span class="pun">{</span><span class="pln">lgrenc.dfu</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">\usepackage</span><span class="pun">{</span><span class="pln">lmodern</span><span class="pun">}</span><span class="pln"> </span><span class="kwd">\usepackage</span><span class="pun">[</span><span class="pln">greek.ancient,main</span><span class="pun">=</span><span class="pln">english</span><span class="pun">]{</span><span class="pln">babel</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">\title</span><span class="pun">{</span><span class="pln">Does it work?</span><span class="pun">}</span><span class="pln"> </span><span class="com">%\date{} \author{me}</span><span class="pln">
</span><span class="kwd">\begin</span><span class="pun">{</span><span class="pln">document</span><span class="pun">}</span><span class="pln"> </span><span class="kwd">\maketitle</span><span class="pln"> one, two, three </span><span class="kwd">\foreignlanguage</span><span class="pun">{</span><span class="pln">greek</span><span class="pun">}{</span><span class="pln">ἀγαγεῖν</span><span class="pun">}</span><span class="pln"> </span><span class="kwd">\end</span><span class="pun">{</span><span class="pln">document</span><span class="pun">}</span></code></pre>
    <p><em>But</em>, if you run it with Greek text in the body and
      French as one of the languages, then dvilualatex will compile a
      DVI which dvips and dvipdfmx both refuse to deal with. Compiling
      the same TeX document using latex+dvips or latex+dvipdfmx works
      fine, on the other hand.</p>
    <pre class="lang-tex prettyprint prettyprinted" style=""><code><span class="kwd">\documentclass</span><span class="pun">[</span><span class="lit">12pt</span><span class="pun">]{</span><span class="pln">article</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">\usepackage</span><span class="pun">[</span><span class="pln">utf8</span><span class="pun">]{</span><span class="pln">luainputenc</span><span class="pun">}</span><span class="kwd">\usepackage</span><span class="pun">[</span><span class="pln">LGR,T1</span><span class="pun">]{</span><span class="pln">fontenc</span><span class="pun">}</span><span class="kwd">\input</span><span class="pun">{</span><span class="pln">lgrenc.dfu</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">\usepackage</span><span class="pun">{</span><span class="pln">lmodern</span><span class="pun">}</span><span class="pln"> </span><span class="kwd">\usepackage</span><span class="pun">[</span><span class="pln">greek.ancient,main</span><span class="pun">=</span><span class="pln">french</span><span class="pun">]{</span><span class="pln">babel</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">\title</span><span class="pun">{</span><span class="pln">Ça marche?</span><span class="pun">}</span><span class="pln"> </span><span class="com">%\date{} \author{me}</span><span class="pln">
</span><span class="kwd">\begin</span><span class="pun">{</span><span class="pln">document</span><span class="pun">}</span><span class="pln"> </span><span class="kwd">\maketitle</span><span class="pln"> un, deux, trois </span><span class="kwd">\foreignlanguage</span><span class="pun">{</span><span class="pln">greek</span><span class="pun">}{</span><span class="pln">ἀγαγεῖν</span><span class="pun">}</span><span class="pln"> </span><span class="kwd">\end</span><span class="pun">{</span><span class="pln">document</span><span class="pun">}</span></code></pre>
    <p>Which, when run through dvilualatex, seems to complete fine, but
      returns with dvips:</p>
    <pre class="lang-tex prettyprint prettyprinted" style=""><code><span class="pln">dvips: ! DVI file contains unexpected command </span><span class="pun">(</span><span class="pln">131</span><span class="pun">)</span></code></pre>
    <p>and with dvipdfmx:</p>
    <pre class="lang-tex prettyprint prettyprinted" style=""><code><span class="pln">dvipdfmx:fatal: DVI opcode 254 only valid for XeTeX</span></code></pre>
    <p>
      So what gives? dviasm indicates that the DVI produced is not
      valid. Note that the same issue will arise even if French is not
      the main language, so long as it is one of the loaded languages
      and Greek is used in the text. So the English example will break
      if hte language line is changed to
      french,greek.ancient,main=english.</p>
    <p>Is this a glitch with LuaTeX? Or with Babel? Is there a possible
      workaround?<br>
    </p>
    <p>DBM<br>
    </p>
    <br>
  </body>
</html>