Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User feedback when trying to use Unicode without necessary fonts #173

Closed
photm5 opened this issue Apr 26, 2018 · 7 comments
Closed

User feedback when trying to use Unicode without necessary fonts #173

photm5 opened this issue Apr 26, 2018 · 7 comments
Assignees

Comments

@photm5
Copy link

photm5 commented Apr 26, 2018

With these contents in a file test.tex:

\documentclass{article}

\usepackage[utf8]{inputenc}

\begin{document}
Störende Heißluft
\end{document}

When I run tectonic test.tex, the output pdf says "Strende Heiluft". To make sure, I also tried latex test.tex; xdvipdfmx test.dvi, and that result says "Störende Heißluft", as expected.

The output of tectonic --version is Tectonic 0.1.7. Any other output I should paste?

@pkgw
Copy link
Collaborator

pkgw commented Apr 26, 2018

Thanks for reporting. What happens if you remove the \usepackage line? Tectonic is essentially XeTeX under the hood, so it is UTF8-aware out of the box; the inputenc package should be unnecessary.

@photm5
Copy link
Author

photm5 commented Apr 26, 2018

Without the \usepackage line, it still only says "Strende Heiluft".

@pkgw pkgw self-assigned this Apr 26, 2018
@pkgw
Copy link
Collaborator

pkgw commented Apr 26, 2018

How about if you add \usepackage{fontspec}? That fixes the problem for me.

Assuming that's correct, I didn't realize that fontspec was strictly necessary for Unicode to work. Tectonic should print out a warning in this case if possible. I think the problem is that without loading fontspec, only the classic non-Unicode fonts are loaded, and I guess then it just silently drops unsupported characters.

@photm5
Copy link
Author

photm5 commented Apr 26, 2018

(I composed this before you wrote that last comment:)

If I run xelatex test.tex, with or without the \usepackage line, it works: "Störende Heißluft". But the version of xelatex I used to try this seems to be different from what tectonic uses. Output of xelatex test.tex:

This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2017-04-15>
Babel <3.15> and hyphenation patterns for 22 language(s) loaded.
(/opt/texlive/2017/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/opt/texlive/2017/texmf-dist/tex/latex/base/size10.clo)) (./test.aux) [1]
(./test.aux) )
Output written on test.pdf (1 page).
Transcript written on test.log.

Output of tectonic test.tex -p:

note: this is a BETA release; ask questions and report bugs at https://tectonic.newton.cx/
Running TeX ...
(test.tex
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(size10.clo)) (test.aux) [1] (test.aux) )
(see the transcript file for additional information)
Output written on test.xdv (1 page, 236 bytes).
Transcript written on test.log.
note: warnings were issued by the TeX engine; use --print and/or --keep-logs for details.
Running xdvipdfmx ...
[1]
Writing test.pdf (2539 bytes)
Skipped writing 1 intermediate files (use --keep-intermediates to keep them)

@photm5
Copy link
Author

photm5 commented Apr 26, 2018

Yes! Adding \usepackage{fontspec} fixes the issue for me. For reference, here's the full example now:

\documentclass{article}

\usepackage{fontspec}

\begin{document}
Störende Heißluft
\end{document}

Thanks!

@pkgw pkgw changed the title Umlauts in input are ignored User feedback when trying to use Unicode without necessary fonts Apr 26, 2018
@pkgw
Copy link
Collaborator

pkgw commented Apr 26, 2018

OK. I'm going to repurpose this issue to be about the user experience: if someone is doing what you initially tried, there should be some feedback suggesting that fontspec be loaded.

@pkgw
Copy link
Collaborator

pkgw commented May 13, 2018

Note to self: the right place to do this might be the char_warning function. If you set \tracinglostchars=2, this function will log warnings about missing characters that get triggered appropriately for the example document at the top of this issue.

@pkgw pkgw closed this as completed in 52b5f55 May 14, 2018
Mrmaxmeier pushed a commit to Mrmaxmeier/tectonic that referenced this issue Sep 17, 2018
…encountered

I've recently gotten a few bug reports from people exploring Tectonic's
Unicode capabilities that are not aware of the need to use the `fontspec`
package and to choose an appropriate font. Here we add a Tectonic warning
message that will hopefully point them in the right direction. In plain XeTeX,
the warning is only printed if \tracelostchars is activated, but this seems
like a big enough issue (and one that I don't think will happen spuriously?)
that I think it is reasonable to always print a message. I can revisit if
there are cases where the message gets annoying.

I hope that the help message is actually helpful for non-experts. If not,
perhaps we should create a dedicated forum thread and point people to it.

Closes tectonic-typesetting#173.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants