ddoc latex/formulas?

Johan Engelen via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 15 08:43:39 PDT 2016


On Thursday, 15 September 2016 at 14:42:37 UTC, Andrei 
Alexandrescu wrote:
> On 09/15/2016 10:37 AM, Johan Engelen wrote:
>> On Thursday, 15 September 2016 at 11:39:13 UTC, Andrei 
>> Alexandrescu wrote:
>>>
>>> * ddoc has absolutely nada notion of rendering. To ask "how 
>>> do I
>>> render sqrt and aligned matrices with ddoc" does not compute. 
>>> Is there
>>> agreement on that?
>>
>> D has absolutely no notion of "databases", but I think it's 
>> fair to ask
>> "how do I retrieve data from a database using D".
>
> D is a language. Ddoc is a macro system. How could this simile 
> possibly convey any information?

Tool has absolutely nada notion of Thing. To ask "how do I do 
Thing with Tool", can still be an OK question (listener willing) 
to which there is a simple answer that you yourself have given 
here (thanks!!). Let's stop here? ;)
Btw, Ddoc is perhaps a little more than a macro system, and 
that's why using parameter names in equations is broken. 
Parameter names are replaced by (wait for it) a macro, so 
disabling that macro "fixes" the issue. See the stackoverflow 
example.
http://stackoverflow.com/a/39514239/3215806

>> DDoc bare does not need a notion of rendering, but the base 
>> system in
>> place (call it the DDoc std lib) does need to present a way 
>> for a user
>> to end up with a math equation "rendered" well.
>
> No, sorry Johan this is a hopeless misunderstanding. Ddoc does 
> not render absolutely anything. All it can do is output UTF 
> text! We need to clear this up before continuing.

I know that DDoc (currently) is just outputting a text file. I 
wrote "end up with...".
Please zoom out a little, read between the lines; I think most 
here write messages  without spelling out everything in exact 
mathematical detail. ;)
So indeed, the DDoc system does provide a simple way to end up 
with nice-looking equations: "import" MathJax, and just write 
\(...\). Excellent.

- Is there a way to "import" MathJax without having to redefine 
the DDOC macro?(seems a little brittle)

- Perhaps we can "standardize" the MathJax thing for Phobos docs? 
Would be nice for Manu's color lib and for Mir too. (where are 
the Mir guys anyway in this discussion? ;)

- Also, how about that parameter name problem? Any good fix for 
that?



More information about the Digitalmars-d mailing list