emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: [RFC] New "kbd" macro?
Date: Fri, 15 Sep 2017 13:52:49 +0200	[thread overview]
Message-ID: <87poasch66.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <878thg8az3.fsf@gmx.us> (rasmus@gmx.us's message of "Fri, 15 Sep 2017 13:20:16 +0200")

Rasmus <rasmus@gmx.us> 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

  \texttt{Ctrl-x-f}

@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
here.

>> 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.

Regards,

  reply	other threads:[~2017-09-15 11:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-13 13:22 [RFC] New "kbd" macro? Nicolas Goaziou
2017-09-13 14:03 ` Kaushal Modi
2017-09-13 14:05   ` Kaushal Modi
2017-09-13 19:25   ` Nicolas Goaziou
2017-09-14  4:45   ` Marcin Borkowski
2017-09-14 13:49   ` Oleh Krehel
2017-09-13 19:24 ` Eric S Fraga
2017-09-14  8:07 ` Rasmus
2017-09-14 22:02   ` Nicolas Goaziou
2017-09-15  7:36     ` Rasmus
2017-09-15 10:16       ` Nicolas Goaziou
2017-09-15 11:20         ` Rasmus
2017-09-15 11:52           ` Nicolas Goaziou [this message]
2017-09-15 12:54     ` Kaushal Modi
2017-09-15 13:08       ` Kaushal Modi
2017-09-15 15:53         ` Nicolas Goaziou
2017-09-17  7:20           ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87poasch66.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).