Pedro Andres Aranda Gutierrez <[email protected]> writes:

> New commit.

Thanks!

>> I think it is ok to leave LaTeX name in the main text in the manual but
>> put a footnote that alternative name (tt / mono, etc) can be used
>> interchangeably. WDYT?
>
> Isn't this not clear enough?
> From the manual:
> -----
> 2. ~:variant~ : a string for the font variant (e.g. ~"main"~ or ~"rm"~
>    for the Serif font family, ~"sans"~ or ~"sf"~ for Sans Serif, and
>    ~"mono"~ or ~"tt"~ for Monospace).  The four-letter version for the
>    variant corresponds to the family used above for ~fontspec~.  It
>    will be translated to
>    [[https://en.wikibooks.org/wiki/LaTeX/Fonts][the two-letter codes
>    used in LaTeX for the different font families]][fn::Reference
>    sources in the Internet always use the two-letter code].  When no
>    variant is indicated, it is assumed that the serif font family
>    (variant ~"main"~ or ~"rm"~) is implied.  It is recommended that
>    you always add the variant *explicitly*.
> -----

It is clear for me. I was mostly referring to your concern that some
people may be confused to see both "main" and "rm" in the manual while
they find different examples on the internet. If you are ok with the
above, I have no concerns.

>> > + (setq font-family (alist-get font-family org-latex--long2short-family
>> font-family nil #'string=))
>
>> This implies that *only* main/sans/mono/math will be allowed, but not
>> tt/sf/rm. Looks like an omission.
>>
> If you try out the following in the scratch buffer:
> ```
> (let ((font-family-alist '(("mono" . "tt")
>                            ("sans" . "sf")
>                            ("main" . "rm"))))
>   (dolist (font-family '("mono" "sans" "main" "tt" "sf" "rm"))
>     (message "%s -> %s" font-family (alist-get font-family
> font-family-alist font-family nil #'string=))))
> ```
> AND you read the docstring for alist-get (describe-function), you will
> notice that I'm using font-family as the key (first parameter) and as the
> default value (third parameter).
> This means that when the key is not in the list, you get the key back.

Yup. I missed the default value. You are right.

>> > +          ;; Sort the list by FONT
>> > +          (sort font-script #'(lambda (s1 s2)
>> > +                                (string< (car s1) (car s2))))
>> > +          ;; Remove duplicates
>> > +          (delete-dups font-script)
>>
>> You should use (setq (sort ...))
>
>
> Sorry. I'm using something that has been there since Emacs25 in the form it
> was originally defined...
> Interestingly enough, when you add :in-place t explicitly, the compiler
> warns about unused result.
> Using the original form doesn't trigger any warnings in the byte-compiler,
> so it can't be too wrong.
>
> and (setq (delete-dups ..)).
>>
>
> No, describe-function delete-dups explicitly says that this is a
> destructive delete and that the result
> internally stored back to the list passed to the procedure. And here we are
> talking about a procedure
> introduced in Emacs 22 (please).

You are right for delete-dups in particular.
In defense of myself, I'd like to point to 5.7 Using Lists as Sets
section of Elisp manual. That section is full of examples where
destructive list operations require (setq l (<destructive-op> l ...))
So, it is a common pattern to follow.
You do not need to make changes here.

>> Also, if we know the problematic characters, I am wondering if we can
>> extract the logic from `describe-char-display' and suggest specific font
>> to be used. (This is optional, but sounds fairly easy).
>
> Let's leave this FFS. I don't think it is that easy and I doubt the gain is
> worth the effort. You get much more from examples in the documentation.

Ok.

>> And further comments on earlier commits:
>>
>> About :features / :props alias.
>> Same comment about the manual as for the font familiar.
>>
> ???

I meant "font family" and was referring to which one of :feature/:props
to talk about in the examples in the manual. I think no further action
needed since you are ok to mention both main/rm, mono/tt, sans/sf.

>> Additionally, ox-latex code added :features as an alias to :props but
>> not :props as an alias to :features. I think we should have both, so
>> that people can use them interchangeably.
>
> That was not what I have understood from your messages.
> It will increase confusion, but anyhow...

I believe that it will decrease confusion... I think we need some
feedback from others (later) to resolve our disagreement here.

> About :fallback.
>> One possible common need could be setting a fallback without changing
>> the default font. Maybe we can give an example of that in the manual.
>>
> When you have to resort to a fallback, you must indicate the font family
> you apply it to and that implies indicating the font used for that family.
> The font is a mandatory parameter to the LaTeX command.
>
> Or, alternatively, may we make :font option in
>> `org-latex-polyglossia-font-config' optional and use the default font if
>> it is not specified?
>>
> Again. this is NOT POSSIBLE, full stop.

I think I need to elaborate what I had in mind.
The default LaTeX fonts are
Computer Modern Roman/Sans Serif/Typewriter (pdflatex)
Latin Modern Roman/Sans/Mono (lualatex and xelatex)

If not specified, they might be used as defaults.
Or do I miss something?

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to