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

Convert common TeX to unicode #11

Open
simonbyrne opened this issue Oct 23, 2020 · 13 comments · Fixed by #17
Open

Convert common TeX to unicode #11

simonbyrne opened this issue Oct 23, 2020 · 13 comments · Fixed by #17

Comments

@simonbyrne
Copy link
Collaborator

I set it up here, and noticed a few TeX artifacts.

I would suggest at least converting two dashes (--) to an en-dash () as those are very common and hard to type.

@ali-ramadhan
Copy link
Owner

ali-ramadhan commented Oct 23, 2020

PR #17 starts working on this (see below). I'll tag v0.1.1 or v0.2.0 shortly after it's merged.

@simonbyrne Do you know of a list of these kinds of replacements or should we just add to it as we go along?

I was able to find lists for math TeX to unicode (https://github.com/svenkreiss/unicodeit/blob/master/unicodeit/data.py) but not so much for text replacements.

image

@simonbyrne
Copy link
Collaborator Author

I agree we probably don't want the full unicodeit list, as it seems to include both math and text commands

@charleskawczynski
Copy link
Collaborator

Reopening this. We're still seeing issues, e.g. Jo { \~a } o Teixeira, over at the ClimateMachine.jl refs.

@simonbyrne
Copy link
Collaborator Author

This is due to spurious spaces being inserted by the BibTeX parser. Upstream issue is Humans-of-Julia/BibParser.jl#5.

@charleskawczynski
Copy link
Collaborator

Should we leave this open until the upstream is closed?

@simonbyrne
Copy link
Collaborator Author

Yes, probably a good idea.

@Azzaare
Copy link

Azzaare commented Apr 16, 2021

Hi there! Sorry for the long wait, spurious braces should not be a problem anymore.

It might only be a crude parser that I handcrafted, but BibParser.jl got updated today (v0.1.11)
(the new parser should handle any valid BibTeX entry, but do not replace LaTeX commands from a @preamble nor converts LaTeX to Unicode)

@Azzaare
Copy link

Azzaare commented Jun 5, 2021

I've created a GitHub repo to convert LaTeX ⇋ Unicode: https://github.com/Humans-of-Julia/LaTeXUniCode.jl
It is almost empty at the moment, but I will work on it during summer (as I will be in between two jobs, I can have some fun!)

Anyway, if some of you want to join, you're all welcome aboard.

@fingolfin
Copy link
Contributor

The function tex2unicode is there, but it does not seem to be applied to pages, which is where I see them most often:

pages = {1 -- 45},

Could this be done?

@LazyScholar
Copy link
Collaborator

tex2unicoe is currently only applied to title?

authors = xnames(entry)
year = xyear(entry)
link = xlink(entry)
title = xtitle(entry) |> tex2unicode
published_in = xin(entry)

Or am i misunderstanding it?

@fingolfin
Copy link
Contributor

No you are right. Hmm, I thought I'd made a PR also applying it to the output of xin... guess I forgot :/

@LazyScholar
Copy link
Collaborator

LazyScholar commented Jun 23, 2021

I converted all my .bib files to Unicode therefore i did nor realize that applying it to the authors and maybe published_in might fix it for others.

@fingolfin do you want to make the PR (you can delete line 51 as with your last change the year is not needed any more)?

@LazyScholar
Copy link
Collaborator

Reopening this. We're still seeing issues, e.g. Jo { \~a } o Teixeira, over at the ClimateMachine.jl refs.

@charleskawczynski Is { \~a } valid Tex? As far as i know in order to get ã one have to use \~{a} or even \tilde{a} (not sure if the later one is supported by bibtex).
Source: https://en.wikibooks.org/wiki/LaTeX/Special_Characters#Escaped_codes

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 a pull request may close this issue.

6 participants