Open stone-zeng opened 4 years ago
Hi thanks, you may also be interested in the discussion at
https://github.com/learnlatex/learnlatex.github.io/issues/72#issuecomment-665767969
on whether to translate the examples or leave them in English.
In either case support will be needed for the language-specific examples.
On your bullet points
Currently Overleaf is texlive 2019 and latexcgi.xyz is texlive 2020 (updated today) so anything that is available in those distributions should be available. latexcgi.xyz is running on Ubuntu so the fonts available in Ubuntu should be available.
Can you clarify the Copyright issue. Can latexcgi.xyz distribute whatever it is that Overleaf can not?
Currently we have been documenting to just use the two letter codes, but I guess that will cause problems if we need simplified and traditional? Currently a few parts of the javascript are assuming two letter codes but it wouldn't be hard to fix that. Can you say what you think would be the most natural designations if we had two Chinese variants?
Can you clarify the Copyright issue.
In texlive there is already an open-source chinese font (fandol), but unfortunately it lacks some rare-used characters, so in some cases one may need to use the system fonts such as simsun/microsoft yahei on windows, pingfang/songti sc on macos, etc. But for the usage of a tutorial, I think this font should be enough and it may not be a big problem.
Can you say what you think would be the most natural designations if we had two Chinese variants?
I think is zh-Hans
for simplified and zh-Hant
for traditional (I'm still not sure if I should use -Hans
or -hans
).
@stone-zeng thanks. On fonts, yes I found fandol worked for my minimal example at
https://www.learnlatex.org/en/lesson-14#the-unicode-era
but I didn't realise it was the only one. Overleaf and latexcgi.xyz are both running on linux so if there is a system font that works on Overleaf but does not work at latexcgi I should be able to install it there (although the disk is getting full) let me know, But if you can manage with fandol for these simple examples that is even easier:-)
on names yes I gather that the choices are zh-CN (for China) or zh-Hans (for Simplified Script) with the latter being preferred in this sort of context eg https://en.wikipedia.org/wiki/IETF_language_tag#ISO_3166-1_and_UN_M.49 so let's go with that (I will fix up the Javascript so the language switcher works)
The Overleaf help page
https://www.overleaf.com/learn/latex/chinese
Shows that you can use either of these in addition to fandol at Overleaf
\setCJKmainfont{BabelStone Han}
\setCJKsansfont{Noto Sans CJK SC}
Neither works at latexcgi.xyz at present but if you need one of them let me know, and I'll see what I can do,
Fandol Song and BabelStone Han both now work at the LaTeX CGI server for luatex and xetex.
Thanks for your help!
More details about the font:
ctex
and xeCJK
, they will be used to match the roman, sans-serif, italic and monospaced latin fonts, respectively.OK hopefully for the tutorial these two will be enough, although as I say I could add more. But being open source and also available on Overleaf is really a requirement as it would be good if all examples on the site worked on both systems.
Currently at latexcgi.xyz I have
$ df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/root 7.7G 7.1G 630M 92% /
so each font eats a reasonable fraction of my available disk space (actually there are a couple of archived linux kenel versions that I could delete if space gets really tight, but..)
Longer term may move the latexcgi.xyz server to a bigger machine but that is what it is just now.
Hopefully you can use Fandol for most of the examples and perhaps a BabelStone Han example to show font switching and then will not need any more fonts in actual examples.
Language switching now works for longer language codes (Jekyll/liquid string handling is weird:-)
The CONTRIBUTING.md says:
Please wrap source lines to keep them below 80 characters long.
But for chinese (maybe japanese is the same?) language, line wrap in markdown files will lead to an extra space. So I simply put everything of a paragraph in s single line.
@stone-zeng Sure, we were not thinking of Chinese requirements, sorry. Do whatever you need and we will fix up the instructions.
And for the emphasis (_xxx_
in markdown), since chinese fonts usual do not contain italic shape (actually italic is not commonly used with cjk scripts), I plan to use strong (**xxx**
) instead. I'm not sure whether it's ok, or maybe we can change the style of emph for cjk (e.g. underdot, but personally I don't like it and it's rarely seen on web).
@stone-zeng One for @jonasjacek? This must be a known issue in web development.
And for the emphasis (
_xxx_
in markdown), since chinese fonts usual do not contain italic shape (actually italic is not commonly used with cjk scripts), I plan to use strong (**xxx**
) instead. I'm not sure whether it's ok, or maybe we can change the style of emph for cjk (e.g. underdot, but personally I don't like it and it's rarely seen on web).
There are semantic differences between em
, strong
and i
and b
. Which to apply depends on the content. I am preparing different styles and also plain CSS classes. We will have to apply HTML elements correctly to achieve a maximum of web content accessibility (also see WCAG). For now you can use what you want. Be prepared, I might change it later.
Thank you for working on learnlatex.org translations. You may have seen already if watching the repository but just a note to say that we have extended lesson-06 and more-06 to add descriptions of defining commands with \newcommand and \NewDocumentCommand
https://github.com/learnlatex/learnlatex.github.io/commit/463d181301d667b10bf23c164f9d5ae15371877e
@stone-zeng - Regarding the text-level semantics, feel free to use whatever you want. Bold and italic are available. If you need more styles or adjustments, let me know.
There is this ticket for me: https://github.com/learnlatex/learnlatex.github.io/projects/1#card-53136775 - It's about using /zh-hans/
instead of just /zh/
for the directory structure.
I did change it during the design process. I had not read this thread in its entirety. So, is it more correct to use /zh-hans/
than just /zh/
? Should I change it back?
As you may have seen, the main site at learnlatex.org has been given a new design and some of the details of the language data have changed.
If you are still working on the translation, I have updated https://www.learnlatex.org/TRANSLATIONS to hopefully give correct instructions for the new layout, but if anything is not clear please ask
Hi! I have noticed the new design and I will check these updates (and pick up the translations) in recent days.
@stone-zeng in this PR to the Japanese translation
https://github.com/wtsnjp/learnlatex.github.io/pull/1
I have set up so that _
(emphasis) and **
(strong) use weight 400 and 700 respectively with Noto Sans JP.
We could of course set up similar configuration for Chinese. The Noto Sans SC font appears to be available in exactly the same weights as Noto Sans JP.
Hi!
I'm pleased to contribute a Chinese translation for learnlatex. For better community support, I would like to fork this repo into CTeX-org (see CTeX-org/learnlatex.github.io).
Something need to mention here:
ctex
,xeCJK
etc.zh
orzh-CN
orzh-hans
or some else?