0

My document compiles perfectly in LaTeX (Linux and Overleaf), but it takes an error in MacTeX.

I'm using \documentclass[review]{elsarticle} and I need to declare some operators:

\DeclareMathOperator*{\extr}{extr}
\DeclareMathOperator*{\owa}{OWA}
\DeclareMathOperator*{\orness}{orness}
\DeclareMathOperator*{\andness}{andness}

Then, when I use the operator \owa⁡(E_{e_{i}},W^p) =, just in MacTeX, I'm getting this error: Package inputenc Error: Unicode character ⁡ (U+2061) [ \owa⁡]

I've updated all packages with TeX Live Utility. The \usepackage which calls inputenc may be inside elsarticle, because I didn't call it.

In .log I could find the information above, but U+2061 is not a printable character. How can I declare it with \DeclareUnicodeCharacter? Why this is happening just in MacTeX?

Now handling font encoding TS1 ...
... processing UTF-8 mapping file for font encoding TS1

(/usr/local/texlive/2018/texmf-dist/tex/latex/base/ts1enc.dfu
File: ts1enc.dfu 2018/04/05 v1.2c UTF-8 support for inputenc

...
! Package inputenc Error: Unicode character ⁡ (U+2061)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.136   \owa⁡
              (E_{e_{i}},W^p) =
You may provide a definition with
\DeclareUnicodeCharacter 
  • 5
    Welcome to TeX.SE! Please provide an MWE You are certainly loading packages not shown above as \DeclareMathOperator comes with amsmath. On my Mac a simple document with that package and your document class works fine. – user121799 Jun 25 '18 at 2:35
  • Apparently U+2061 is the function application character. I suspect one of your parentheses may have this one automatically added before or after it. Does it help if you delete the parentheses and type them again? With \DeclareUnicodeCharacter{2061}{XXXXXX} you can at least find out where the little bugger is hiding. – moewe Jun 25 '18 at 6:33
  • 2
    Oh if your document does not use inputenc then the difference will not be mactex/linux but the mactex machine will be using a 2018 latex which defaults to utf-8. The other ones will be using older latex and not be working but giving a different message, in the log about missing characters. – David Carlisle Jun 25 '18 at 7:13
3

on line 136 of your source you have

  U+005c REVERSE SOLIDUS     &bsol; \backslash \textbackslash
  U+006f LATIN SMALL LETTER O     o
  U+0077 LATIN SMALL LETTER W     w
  U+0061 LATIN SMALL LETTER A     a
  U+2061 FUNCTION APPLICATION 
  U+0028 LEFT PARENTHESIS     &lpar; \lparen (
  U+0045 LATIN CAPITAL LETTER E     E

So if you delete everything form the ( back to \owa and then retype the \owa ( without the invisible U+2061 character before the ( then it should be fine.

Note this is unrelated to using mactex or linux etc, you may have U+2061 defined in a package in one place and not the other, it is not defined by default.

If you want to declare it rather than remove it just use

\DeclareUnicodeCharacte{2061}{}

which declares it and makes it do nothing.

  • Normaly, I use overleaf to create the templates and clone it with git to edit locally. I associated the problem to MacTeX because when I clone the repository in Linux it works and when I clone it in Mac OS X the error apears. But your solution worked perfectly. Thanks a lot! – Felipe Ramalho Jun 26 '18 at 2:55
  • @FelipeRamalho sure but the difference between overleaf and your mac and linux boxes are unrelated to the operating system, the difference is just the age of the latex system installed. Your Mac has this year's latex release, the other two have an older release. – David Carlisle Jun 26 '18 at 8:11

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.