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

Add argument to weave function to disable unicode escape #244

Merged
merged 4 commits into from
Oct 21, 2019

Conversation

sebastianpech
Copy link
Contributor

uc2tex isn't working very well:

  • The minority of mappings in latex_symbols actually maps to valid latex commands
  • Some of the commands are not valid in math mode

I tried to find a better solution to that (See JuliaDocs/Highlights.jl#30) but thats not very simple and one needs to add a lot of packages to LaTeX.
In my opinion the best way is to use XeLaTeX and try to find a font that is actually able of rendering the unicode chars.

So I added this switch that disables uc2tex (not the default).

@sebastianpech
Copy link
Contributor Author

This relies on JuliaDocs/Highlights.jl#30 being merged.

@sebastianpech sebastianpech force-pushed the disable-unicode-escape branch from c53c281 to da66a8f Compare October 15, 2019 12:21
@pfitzseb
Copy link
Member

What do you think about renaming escape_unicode to latex_unicode or something similar (to indicate that it's only relevant for latex-y outputs)? Probably also a good idea to mention that in the docstring.

@sebastianpech
Copy link
Contributor Author

sebastianpech commented Oct 15, 2019

Good point, will do that. Maybe latex_keep_unicode and switch true and false.

As the new Highlights.jl seems to be picked up, the escape stuff now works. However, the tests now fail with
/home/travis/.julia/packages/GR/ZI5OE/src/../deps/gr/bin/gksqt: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory. Any ideas on that?

@sebastianpech
Copy link
Contributor Author

Oh wait, maybe its unrelated to that. I didn't see the failed test at the end.

@pfitzseb
Copy link
Member

Yeah, seems like this is the only relevant error.

@sebastianpech
Copy link
Contributor Author

Oh ok. It's the new escaping I added to Highlights. Now " is placed as \"{} to allow usage of the babel package

@sebastianpech
Copy link
Contributor Author

Hmm, so I have another PR (JuliaDocs/Highlights.jl#38) pending that again changes the escaping behavior. Should I mark the test as broken or skip it and when the Highlights PR is merged, update it?

@pfitzseb
Copy link
Member

That PR doesn't seem to make any changes to the " printing, so I think it's fine to just change the expected output here.

@sebastianpech
Copy link
Contributor Author

You're right, but it changes the escaping of all whitespace chars so the code needs to be fixed anyways. But I will fix it here, so the tests work on master until the PR gets merged.

@sebastianpech
Copy link
Contributor Author

sebastianpech commented Oct 15, 2019

After renaming the kw argument its name didn't really match the implementation I had before. That's why I moved the latex unicode escaping stuff to the formatdict of latex based formats to pass the option down to the chunk format functions. I think that's a cleaner method. The key is overwritten with the value of the kw argument in run.

@sebastianpech
Copy link
Contributor Author

Bump @pfitzseb

@pfitzseb pfitzseb merged commit 3d673d0 into JunoLab:master Oct 21, 2019
@pfitzseb
Copy link
Member

Oops, sorry for the delay.

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.

2 participants