September 16, 2016 Re: ddoc latex/formulas? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Thursday, 15 September 2016 at 17:32:16 UTC, Adam D. Ruppe wrote: > On Thursday, 15 September 2016 at 14:40:24 UTC, Andrei Alexandrescu wrote: >> Wait, but I just showed how with vanilla ddoc you can immediately use mathjax to do better than adrdox. No need for any pre/postprocessing or scripting, just one line of import. > > mathjax IS postprocessing via scripting. And better is extremely dubious as it is unreliable and slow for the end user... Yes. I opened the link [1] by Andrei into a new tab, saw some latex source code, wondered what was the point, closed the tab, and remained confused. Only later did I find out that it was supposed render it by javascript. It was way too slow. [1] http://erdani.com/d/DIP1000-typing-baseline.html |
September 16, 2016 Re: ddoc latex/formulas? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manu | Am Fri, 16 Sep 2016 12:30:37 +1000 schrieb Manu via Digitalmars-d <digitalmars-d@puremagic.com>: > > That strikes me as an inferior solution to what's available today, which is used at http://erdani.com/d/DIP1000-typing-baseline.html. > > I'm guessing that's mathjax? Strangely, it renders really badly on my > system. I can barely read it. > I'd still rather use latex to produce images for my own docs. I don't understand any of it, but it looks really good on Firefox. Everything is crisp and it even honors the system's subpixel hinting setting so it even surpasses the prerendered grayscale images from Wikipedia! -- Marco |
September 16, 2016 Re: ddoc latex/formulas? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marco Leise | On 9/16/16 9:17 AM, Marco Leise wrote:
> Am Fri, 16 Sep 2016 12:30:37 +1000
> schrieb Manu via Digitalmars-d <digitalmars-d@puremagic.com>:
>
>>> That strikes me as an inferior solution to what's available today, which is
>>> used at http://erdani.com/d/DIP1000-typing-baseline.html.
>>
>> I'm guessing that's mathjax? Strangely, it renders really badly on my
>> system. I can barely read it.
>> I'd still rather use latex to produce images for my own docs.
>
> I don't understand any of it, but it looks really good on
> Firefox. Everything is crisp and it even honors the system's
> subpixel hinting setting so it even surpasses the prerendered
> grayscale images from Wikipedia!
Manu, what OS/browser are you using? Could you please post a screenshot too? Thx! -- Andrei
|
September 16, 2016 Re: ddoc latex/formulas? | ||||
---|---|---|---|---|
| ||||
Posted in reply to tn | On 9/16/16 8:33 AM, tn wrote:
> On Thursday, 15 September 2016 at 17:32:16 UTC, Adam D. Ruppe wrote:
>> On Thursday, 15 September 2016 at 14:40:24 UTC, Andrei Alexandrescu
>> wrote:
>>> Wait, but I just showed how with vanilla ddoc you can immediately use
>>> mathjax to do better than adrdox. No need for any pre/postprocessing
>>> or scripting, just one line of import.
>>
>> mathjax IS postprocessing via scripting. And better is extremely
>> dubious as it is unreliable and slow for the end user...
>
> Yes. I opened the link [1] by Andrei into a new tab, saw some latex
> source code, wondered what was the point, closed the tab, and remained
> confused. Only later did I find out that it was supposed render it by
> javascript. It was way too slow.
>
> [1] http://erdani.com/d/DIP1000-typing-baseline.html
Yah, the whole page is exclusively rendered math, and difficult too. A good benchmark for the rendering engine :o). -- Andrei
|
September 16, 2016 Re: ddoc latex/formulas? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manu | On Friday, 16 September 2016 at 02:30:37 UTC, Manu wrote:
> I'm guessing that's mathjax? Strangely, it renders really badly on my
> system. I can barely read it.
> I'd still rather use latex to produce images for my own docs.
Normally this happens when you are not allowing the use of MathJax fonts. It can happen on Firefox if the box "Allow pages to choose their own fonts, instead of my selections above" is not checked.
|
September 16, 2016 Re: ddoc latex/formulas? | ||||
---|---|---|---|---|
| ||||
Posted in reply to tn | On Friday, 16 September 2016 at 12:33:59 UTC, tn wrote: > Yes. I opened the link [1] by Andrei into a new tab, saw some latex source code, wondered what was the point, closed the tab, and remained confused. Only later did I find out that it was supposed render it by javascript. It was way too slow. > > [1] http://erdani.com/d/DIP1000-typing-baseline.html That is why KaTeX should be used https://khan.github.io/KaTeX/ Server side rendering is an option. |
September 16, 2016 Re: ddoc latex/formulas? | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Colvin | On Friday, 16 September 2016 at 08:20:34 UTC, John Colvin wrote:
> Wikipedia render to svg serverside and have dropped mathjax support.
I'm not sure it's good to compare ddoc to Wikipedia. If I want to output documentation from a .d file, I don't want to go through a process like that.
|
September 16, 2016 Re: ddoc latex/formulas? | ||||
---|---|---|---|---|
| ||||
Posted in reply to bachmeier | On 09/16/2016 11:38 AM, bachmeier wrote:
> On Friday, 16 September 2016 at 12:33:59 UTC, tn wrote:
>
>> Yes. I opened the link [1] by Andrei into a new tab, saw some latex
>> source code, wondered what was the point, closed the tab, and remained
>> confused. Only later did I find out that it was supposed render it by
>> javascript. It was way too slow.
>>
>> [1] http://erdani.com/d/DIP1000-typing-baseline.html
>
> That is why KaTeX should be used
> https://khan.github.io/KaTeX/
> Server side rendering is an option.
Yah, we should consider that if we get heavily into math. The fixed costs are larger than with mathjax, what with downloading and installation etc. -- Andrei
|
September 16, 2016 Re: ddoc latex/formulas? | ||||
---|---|---|---|---|
| ||||
Posted in reply to bachmeier | On Friday, 16 September 2016 at 15:45:36 UTC, bachmeier wrote:
> I'm not sure it's good to compare ddoc to Wikipedia. If I want to output documentation from a .d file, I don't want to go through a process like that.
It is again simple with my program: `adrdox yourfile.d`. It renders the latex to an image then embeds it in the html as a data uri (and the original latex source as the alt attribute which enables any fallback you can imagine).
With my thing, yes, the latex and dvipng programs need to be installed and available for an `executeShell` call... but that's not too hard, it was preinstalled on my linux anyway (and if it fails, it falls back to outputting the source anyway soooo it could still be used my mathjax i suppose).
It isn't really a difficult process and it is only 62 lines of code in my doc gen source. I don't do as much validation as Wikipedia but even if it were to, it'd just be a larger source file, no real trouble for the end user.
This isn't really a difficult problem!
|
September 16, 2016 Re: ddoc latex/formulas? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Friday, 16 September 2016 at 16:03:44 UTC, Adam D. Ruppe wrote:
> It isn't really a difficult process and it is only 62 lines of code in my doc gen source. I don't do as much validation as Wikipedia but even if it were to, it'd just be a larger source file, no real trouble for the end user.
>
>
> This isn't really a difficult problem!
I think that's better as a third-party tool though. MathJax and KaTeX require no changes to the current workflow. You have to be able to build your documentation using DMD. If someone prefers images, they can run their .d file through your option, and be responsible for the additional setup.
|
Copyright © 1999-2021 by the D Language Foundation