{"action":"closed","issue":{"url":"https://api.github.com/repos/yihui/tikzDevice/issues/119","labels_url":"https://api.github.com/repos/yihui/tikzDevice/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/yihui/tikzDevice/issues/119/comments","events_url":"https://api.github.com/repos/yihui/tikzDevice/issues/119/events","html_url":"https://github.com/yihui/tikzDevice/issues/119","id":98953926,"number":119,"title":"Error with fontspec and option no-math","user":{"login":"tpellard","id":13641980,"avatar_url":"https://avatars.githubusercontent.com/u/13641980?v=3","gravatar_id":"","url":"https://api.github.com/users/tpellard","html_url":"https://github.com/tpellard","followers_url":"https://api.github.com/users/tpellard/followers","following_url":"https://api.github.com/users/tpellard/following{/other_user}","gists_url":"https://api.github.com/users/tpellard/gists{/gist_id}","starred_url":"https://api.github.com/users/tpellard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpellard/subscriptions","organizations_url":"https://api.github.com/users/tpellard/orgs","repos_url":"https://api.github.com/users/tpellard/repos","events_url":"https://api.github.com/users/tpellard/events{/privacy}","received_events_url":"https://api.github.com/users/tpellard/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-04T12:14:34Z","updated_at":"2015-10-31T00:13:36Z","closed_at":"2015-10-31T00:13:36Z","body":"Trying to load the LaTeX package` fontspec` with the option `no-math` in an .Rnw file that uses tikzDevice produces an error `Error in getMetricsFromLatex(TeXMetrics)`. The same error also occurs when the package `mathspec` is loaded.\r\n\r\nHere is a minimal example:\r\n```LaTex\r\n\\documentclass{minimal}\r\n\\usepackage[no-math]{fontspec}\r\n\\begin{document}\r\n```\r\n```R\r\n<<include=FALSE>>=\r\noptions(tikzDefaultEngine='xetex')\r\n@ \r\n<<echo=FALSE, dev=\"tikz\">>=\r\nplot(1:100)\r\n@\r\n```\r\n```LaTex\r\n\\end{document}\r\n```\r\nCommenting out either the `no-math` option in the package declaration or `dev=\"tikz\"` resolves the problem.\r\n\r\nThis is the same issue as described here by someone else: http://stackoverflow.com/q/29023304/405151\r\n\r\nThis is a real issue since loading `fontspec` with the `no-math` option is the only way in XeLaTeX to harmonize the math font with the main text font."}}