3

I am using Texpad 1.7.42 (Desktop, not cloud or iOS), to edit locally TeX documents produced originally in the cloud (on Overleaf). My documents contain many Unicode characters, and use XeLaTex with fontspec loaded.

This is the document I produced in Overleaf:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\begin{document}
Résumé
\end{document}

When I download the .tex file, and open it in Texpad, Texpad transforms

Résumé

into

 Résumé

(The rest of the file is unchanged, and it compiles without issue)

Texpad's support documentation acknowledges an issue with unicode characters, and their recommendation is to insert:\usepackage[utf8]{inputenc}. However, as I am using fontspec, inputenc has no effect, and inserting it into my MWE changes nothing.

Similarly, this solution given for a similar problem in TexShop (inserting % !TEX encoding = UTF-8 Unicode) doesn't work.

Is there any way to use Unicode characters along with XeLaTeX and fontspec in Texpad?

  • 3
    Your file is correct, only texpad doesn't show it correctly. It handles the file as it if where 8bit encoded. Check if you can reopen it as utf8. – Ulrike Fischer Jun 15 '17 at 16:54
  • 1
    @UlrikeFischer Unfortunately, I don't see any way to do that. I (and I'm sorry I didn't mention this in the question) saved the .tex file in UTF8 encoding in TextEdit before opening it in TexPad, but the issue persists, even when the file is explicitly utf8 –  Jun 15 '17 at 16:58
  • What do you mean by "explicitly"? Different editors do things differently. Are you sure there is no Preference setting in TeXPad for the default encoding setting for opening files? – Herb Schulz Jun 15 '17 at 17:11
  • @HerbSchulz I simply meant that I had saved it with a UTF8 encoding. I am sure there is no setting, having gone through both the settings panel, and Texpad's support documentation (linked in my question). (If you would find it helpful, I could upload screenshots of the settings panel) –  Jun 15 '17 at 17:15
  • @suitvertices : that would be helpful. Most Mac software has a Preference setting. Does TeXPad call that Settings as carried over from iOS? It would be under TeXPad–>Preferences under normal circumstances. – Herb Schulz Jun 15 '17 at 17:19
  • the é shows that the file is saved in UTf-8 you just need to tell texpad to read it in that encoding not latin1. But I don't know that editor to tell you how to set that, – David Carlisle Jun 15 '17 at 17:20
  • @HerbSchulz Yes, the menu item is labelled preferences! I will upload the screenshots in a moment. –  Jun 15 '17 at 17:22
  • @HerbSchulz http://imgur.com/a/HtllV –  Jun 15 '17 at 17:28
  • @suitvertices : I didn't see anything there. What's in Editing Aids? You may have to ask on the TeXPad web site. Basically TeXPad should open that file in UTF-8 encoding and it isn't doing that. Hmmm... can you use an Open... dialog and specify an encoding there? – Herb Schulz Jun 15 '17 at 17:36
  • @HerbSchulz Sorry, I just added the "Editing Aids" to the imgur album! And there is no dialogue for Open (it just opens the standard Mac open interface, with no options) –  Jun 15 '17 at 17:48
  • The standard Mac Open… dialog usually has a small Options section which can be opened by clicking a triangle. By the way, be VERY careful editing any file in the wrong encoding since it can lead to a completely illegible file when saved. – Herb Schulz Jun 15 '17 at 17:58
  • No black triangle! http://imgur.com/a/auIyz –  Jun 15 '17 at 18:02
  • @suitvertices: Sorry, they've changed that, it's now a button labelled Options. If that doesn't exist you'll have to get in touch with the TeXPad folks. – Herb Schulz Jun 15 '17 at 18:10
  • 1
    @HerbSchulz There is no option button :( –  Jun 15 '17 at 18:14
  • @suitvertices : What version of TeXPad are you using? I just went to their site and they say "Added many new Encoding options" in version 1.7.29 and they are up to 1.7.42. – Herb Schulz Jun 15 '17 at 19:29
  • @suitvertices : Just looked at the online TeXPad manual and it says there is a File->File Encoding menu item. Change to UTF-8. – Herb Schulz Jun 15 '17 at 19:34
  • @HerbSchulz Thank you!! I am chagrined I never noticed or found that! If you make your comment into an answer, I will happily upvote and accept. –  Jun 15 '17 at 19:52

2 Answers2

4

I just looked at the online TeXPad manual and it says there is a File->File Encoding menu item. Change to UTF-8. If possible try doing that with no open files to make sure you don't get a conversion that will make you unhappy.

Herb Schulz
  • 3,410
0

This is not the problem the original poster had, but for those brought to this page’s title by a search engine (as I was), here’s what eventually worked for me for text mode. N.b. not math mode, which is completely broken due to “missing a few extensions required to support the unicode-math package.”

Texpad’s proprietary LaTeX compiler doesn’t handle Unicode by default; e.g. “∀z z∉z ⇒ z∈x” hides everything but “z zz zx.” Unchecking Auto-Sense in the document’s Typeset/General configuration and changing to Unicode Mode instead gives garbage characters. (A common failing, but I expected better from a commercial Mac app. The documentation sort of hints at this, but without providing a solution.)

Some combination of the following got mathematical symbols to show up properly:

  • Installing the Latin Modern Math and LMRoman fonts on my Mac.
  • Enabling the following optional bundles in TexpadTex Typesetter Preferences: Extra Fonts, Supplementary Font Files, Font Utility Packages (which crashed the app while downloading), Math and Science Packages.
  • Adding the following kludge to my preamble:
\usepackage{fontspec}
\setmainfont[Mapping=tex-text, ItalicFont={Latin Modern Roman Slanted}, BoldFont={Latin Modern Roman Demi}]{Latin Modern Math}

Those setmainfont options are obviously not comprehensive; see Best way of using the full range of full fonts/styles/faces for Latin Modern Roman?

Another gotcha was that enabling microtype silently switches away from TexpadTex. And claims of support for the paid version turn out to be mostly illusory.

Flash Sheridan
  • 269
  • 3
  • 7