-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Improvements to the tex rendering pipeline #362
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
630ac46
Reapply improvements to the tex rendering pipeline
JonasIsensee 5c85315
fix math escapes in code and output
JonasIsensee 1135c5d
Remove "tex" format
JonasIsensee 972869d
Merge branch 'master' into pr-362/JonasIsensee/texpipeline
aviatesk b569740
rm tests with "tex" format
aviatesk 12e148a
move unicode2tex escape characters to struct
JonasIsensee 3dfe817
fix bug
JonasIsensee 5ae1fd5
Merge branch 'master' into texpipeline
aviatesk 872f7c7
construct UNICODE2LATEX at precompile time
aviatesk 092adb6
update test
aviatesk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@testset "unicode to latex conversion" begin | ||
unicode2latex(args...) = Weave.unicode2latex(get_format("md2tex"), args...) | ||
|
||
# unit test | ||
let | ||
s = unicode2latex("α = 10") | ||
@test !occursin("α", s) | ||
@test occursin("alpha", s) | ||
end | ||
|
||
# end2end | ||
let | ||
str = """ | ||
```julia | ||
α = 10 | ||
``` | ||
""" | ||
doc = mock_run(str; doctype = "md2tex") | ||
Weave.set_rendering_options!(doc.format) | ||
rendered = Weave.render_doc(doc) | ||
@test occursin("alpha", rendered) | ||
@test !occursin("α", rendered) | ||
|
||
doc = mock_run(str; doctype = "md2tex") | ||
Weave.set_rendering_options!(doc.format; keep_unicode = true) | ||
rendered = Weave.render_doc(doc) | ||
@test !occursin("alpha", rendered) | ||
@test occursin("α", rendered) | ||
end | ||
end # @testset "rendering tex formats" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will produce "invalid" output
texminted
format, right ?Hightlights.jl will include its own characters around some special characters e.g.
_
, so that it will result in weird output for minted output.How about defining new
format_output
forTexMinted
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted. I hadn't figured this out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it.
However it did make my code have more duplicate lines again.