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

Use xetex for uft8 latex backend #4326

Merged
merged 4 commits into from
Dec 3, 2020

Conversation

Erotemic
Copy link
Contributor

@Erotemic Erotemic commented Nov 8, 2020

Closes #4325 This is a component of #4169

I finally settled on

latex_engine = "xelatex"
latex_use_xindy = False

Turns out xindy --- don't really know what that is --- was causing errors, and this setting allows xelatex to work (I think xindy is more a pdflatex thing?).

This PR does not have any dependencies

This PR is depended on by #4294, #4350, and #4327

@rossbar
Copy link
Contributor

rossbar commented Nov 8, 2020

+1 for xelatex. Is that not enough to solve the unicode problems? I've never heard of "xindy" either.

@Erotemic
Copy link
Contributor Author

Erotemic commented Nov 8, 2020

I don't don't have deep knowledge about latex or sphinx and I know nothing of xindy, but I only got it to work after including texlive-xetex and texlive-fonts-extra in the apt get install and using those settings. Disabling xindy didn't have anything to do with unicode. I think xetex and more fonts is enough for that. I did also having it working with lualatex, but I arbitrarily chose xelatex instead.

@rossbar
Copy link
Contributor

rossbar commented Nov 9, 2020

Looking into this a little more, it seems like the missing dependency for xindy is libffcall, so the options are either:

  • disable xindy in conf.py, which may cause errors down the road if there are ever any index terms that contain unicode characters, or
  • Add libffcall-dev to the CI scripts/configs responsible for building documentation.

It's a bit annoying that this requires another external dependency, but it's a small one and easy to install. I'd vote for the latter just because it reduces the chances of getting bit with LaTeX-unicode in the future.

Relevant sphinx docs on xindy: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-latex_use_xindy

@Erotemic
Copy link
Contributor Author

Erotemic commented Nov 9, 2020

Based on the docs, it does look like we want to use xindy over the default makeindex when utf8 characters are enabled. Looks like you also need to sudo apt install xindy to make it work.

I tried installing libffcall-dev on my local machine and setting latex_use_xindy = True. This seemed to work. I'll push up a patch in a sec.

Copy link
Contributor

@rossbar rossbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor modification to the dependencies list and a suggestion for a less-verbose sphinx conf file. Other than those two things, I think this should go in for better unicode support (in the source) for our latex docs.

I tried this via docker and it worked, but we'll see if CircleCI agrees. If so, then I'll update the travis and gh-actions configs as well.

.circleci/config.yml Outdated Show resolved Hide resolved
doc/conf.py Outdated Show resolved Hide resolved
Erotemic and others added 3 commits November 27, 2020 18:48
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Copy link
Contributor

@rossbar rossbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, looks like this worked (on CircleCI at least) so I updated the other CI configurations with the new latex dependencies. Thanks for the update @Erotemic !

@jarrodmillman jarrodmillman merged commit 2f0debe into networkx:master Dec 3, 2020
MridulS pushed a commit to MridulS/networkx that referenced this pull request Feb 4, 2023
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Use a utf8 friendly latex backend
3 participants