Skip to content

UTF-8 hardcopy support using xelatex, polyglossia, fontspec, xunicode (replaces part of PR#972)#977

Merged
taniwallach merged 1 commit into
openwebwork:WeBWorK-2.15from
taniwallach:tani_utf8_hardcopy
Aug 8, 2019
Merged

UTF-8 hardcopy support using xelatex, polyglossia, fontspec, xunicode (replaces part of PR#972)#977
taniwallach merged 1 commit into
openwebwork:WeBWorK-2.15from
taniwallach:tani_utf8_hardcopy

Conversation

@taniwallach

Copy link
Copy Markdown
Member

This replaces the hardcopy part of #972 without the Docker config modifications.

Summary of changes:

  • Includes xelatex hardcopy themes for English and English+Hebrew as samples (28 new files)
  • 3 modified files:
    • conf/localOverrides.conf.dist contains sample code to use the new themes.
    • conf/site.conf.dist reinserts the $externalPrograms{pdflatex} setting as it was removed in commit bea85e1 apparently by accident.
    • lib/WeBWorK/ContentGenerator/Hardcopy.pm - the code which displays the available hardcopyThemes options was changed to avoid the use of maketext.
      • Local installations may have local hardcopyThemes and they will not have entries in the PO translations files, and the prior code would trigger errors as a result.

Discussion of testing can be found in #972 .

@nmoller reviewed at #972 (review)

Testing with Hebrew requires using xelatex instead of pdflatex and having all of the following installed:

  • the culmus Hebrew fonts,
  • LaTeX pakages: polyglossia, fontspec, xunicode

Note: The version of xelatex and various latex packages in Ubuntu 16.04 did not manage to compile the Hebrew+English latex files I tested, but they compiled under Ubuntu 18.04 with the same packages.

As noted at #972 (comment) the change to use xelatex and to add the extra hardcopy themes can be done (by hand) in course.conf for a specific course.

….dist as it was removed in commit bea85e1 apparently by accident.

The hard copy generation code in lib/WeBWorK/ContentGenerator/Hardcopy.pm and the web service hard PDF generation code in lib/WebworkWebservice/MathTranslators.pm both expect this setting to exist.

2. Changes to support multilingual PDF generation using XeLaTeX and polyglossia.

My test case was English+Hebrew, so I have added XeLaTeX conf/snippets/hardcopyThemes directories for using polyglossia for English and English+Hebrew.

Testing requires using xelayex and having all of the following installed: the culmus Hebrew fonts, LaTeX pakages: polyglossia, fontspec, xunicode.

conf/localOverrides.conf.dist contains sample code to use the new themes.

The code in lib/WeBWorK/ContentGenerator/Hardcopy.pm which displays the available hardcopyThemes options was changed to avoid the use of maketext. Local installations may have local hardcopyThemes and they will not have entries in the PO translations files, and the prior code would trigger errors as a result.

Note: The version of xelatex and various latex packages in Ubuntu 16.04 did not manage to compile the Hebrew+English latex files I tested, but they compile under Ubuntu 18.04 with the same packages.
@taniwallach

Copy link
Copy Markdown
Member Author

@nmoller @heiderich - This is the hardcopy part of the old PR. Please check so we can merge it.

@taniwallach

Copy link
Copy Markdown
Member Author

I'm merging this in based on the prior testing in the previous multi-topic PR, as I am about to post a call for testing in the forums.

  • There is exactly one line of production code changed:
    • dropping a maketext call in lib/WeBWorK/ContentGenerator/Hardcopy.pm
    • which is required to allow local additions of new hard-copy themes not to break things.
  • There are 28 new files (4 new hard-copy themes, each a set of 7 files in a new directory under conf/snippets/hardcopyThemes/) which cannot cause trouble unless someone decides to try them out.
  • There are 2 changes to conf.dist files:
    • In conf/site.conf.dist to put back a critical line someone accidentally deleted.
    • In conf/localOverrides.conf.dist to enable the use of the new hard-copy themes, which can be added to an operational conf/localOverrides.conf or left out.

@taniwallach taniwallach merged commit dae0c50 into openwebwork:WeBWorK-2.15 Aug 8, 2019
@taniwallach taniwallach deleted the tani_utf8_hardcopy branch August 22, 2019 17:55
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

Successfully merging this pull request may close these issues.

1 participant