[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [RFC] New "kbd" macro?

From: Nicolas Goaziou
Subject: Re: [O] [RFC] New "kbd" macro?
Date: Fri, 15 Sep 2017 13:52:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Rasmus <address@hidden> writes:

> You are right, for LaTeX, you would probably want two.  So
>     {{{kbd(CTRL-x-f)}}}
> would be initiated for org-latex-kdb-format string, which would default to
>     \texttt{%s}
> Whether a key is needed depends on what it exactly entrails.  If each of
> "CTRL", "x" and "f" is a key, then perhaps it makes sense to have a
> separate formating-string to e.g. denote "\fbox{%s}", allowing output
> like, if desired.
>     \texttt{\fbox{Ctrl}-\fbox{x}-\fbox{f}}

Note that, per (info "(texinfo) @key"), this should still be


@key is only applied to the modifier key in isolation.

Another idea could be to allow second argument to implement styles, e.g.

  {{{kbd(C-x-f, menukeys)}}}

We need to implement a couple of them, tho. Marcin offered some help

>> I'm not much into ODT styles, but if you have an example, I will merrily
>> add it.
> I guess the most straight forward way would be just add a new style to
> OrgOdtStyles.xml,
>     <style:style style:name="OrgKbd" style:family="text" 
> style:parent-style-name="Source_20_Text"/>
> And output it as,
>     <text:span text:style-name="OrgKbd">Ctrl-x-f</text:span>
> According to this thread,
> https://lists.freedesktop.org/archives/libreoffice/2011-November/021281.html
> LO even supports nested text:span, so it could probably even have a
> seperate style for KBD.
>     <text:span text:style-name="OrgKbd">
>     <text:span text:style-name="OrgKey">Ctrl</text:span>-
>     <text:span text:style-name="OrgKey">x</text:span>-
>     <text:span text:style-name="OrgKey">f</text:span>
>     </text:span>
> Maybe it’s unnecessary complexity, with little benefit...

I think I like it because it is closer to Texinfo syntax.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]