Re: Alt+A 0

2017-05-26 Thread Scott Kostyshak
On Fri, May 26, 2017 at 09:14:29AM +0200, Jürgen Spitzmüller wrote:
> Am Freitag, den 26.05.2017, 15:58 +1200 schrieb Andrew Parsloe:
> > The main reason for using a post argument is to avoid confusion with 
> > other optional arguments. The only real-life example I can give is
> > from 
> > my own work, the calculyx package 
> > (http://wiki.lyx.org/Examples/Calculyx).
> 
> Furthermore, post arguments are useful for commands with two mandatory
> arguments where you want to have the first to be what is entered in the
> main work area. For instance memoir's epigraph command
> (\epigraph{}{}). It would be rather odd if the source
> would be in the main work area and you'd would have to type the text in
> an inset. Actually, all of the current usages of post in the LyX
> distribution are of this kind.

Thanks for the explanations, Jürgen and Andrew.

Scott


signature.asc
Description: PGP signature


Re: Alt+A 0

2017-05-26 Thread Andrew Parsloe

On 26/05/2017 7:40 p.m., Jürgen Spitzmüller wrote:

Am Donnerstag, den 25.05.2017, 12:51 +1200 schrieb Andrew Parsloe:

Given the arrangement of keys on a
keyboard, there seems a certain naturalness to assigning Alt+A 0 to
the
first post argument.


Done.

Jürgen


Thank you Jürgen!

Andrew

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: Alt+A 0

2017-05-26 Thread Jürgen Spitzmüller
Am Donnerstag, den 25.05.2017, 12:51 +1200 schrieb Andrew Parsloe:
> Given the arrangement of keys on a 
> keyboard, there seems a certain naturalness to assigning Alt+A 0 to
> the 
> first post argument.

Done.

Jürgen

signature.asc
Description: This is a digitally signed message part


Re: Alt+A 0

2017-05-26 Thread Jürgen Spitzmüller
Am Freitag, den 26.05.2017, 15:58 +1200 schrieb Andrew Parsloe:
> The main reason for using a post argument is to avoid confusion with 
> other optional arguments. The only real-life example I can give is
> from 
> my own work, the calculyx package 
> (http://wiki.lyx.org/Examples/Calculyx).

Furthermore, post arguments are useful for commands with two mandatory
arguments where you want to have the first to be what is entered in the
main work area. For instance memoir's epigraph command
(\epigraph{}{}). It would be rather odd if the source
would be in the main work area and you'd would have to type the text in
an inset. Actually, all of the current usages of post in the LyX
distribution are of this kind.

Jürgen

signature.asc
Description: This is a digitally signed message part


Re: Alt+A 0

2017-05-25 Thread Andrew Parsloe

On 26/05/2017 1:46 a.m., Scott Kostyshak wrote:

On Thu, May 25, 2017 at 12:51:26PM +1200, Andrew Parsloe wrote:

The shortcut keys Alt+A 1, ..., Alt+A 9 are assigned to argument-insert 1
... argument-insert 9. On all the keyboards I have used, the numbers run in
a row 1234567890 from left to right.


+1


On my system Alt+A 0 is unassigned. I
suggest assigning it to argument-insert post:1. A post argument follows the
main argument, so there is a natural sequence from the ordinary arguments to
the left of the main argument, then the main argument, then post arguments.
Given the arrangement of keys on a keyboard, there seems a certain
naturalness to assigning Alt+A 0 to the first post argument.


What is an example of where 'argument-insert post:1' is useful (e.g.  a
specific inset where I can test)? I don't actually know what post:1
means and haven't used it before.

Scott

The main reason for using a post argument is to avoid confusion with 
other optional arguments. The only real-life example I can give is from 
my own work, the calculyx package 
(http://wiki.lyx.org/Examples/Calculyx). In that I define a custom inset 
called Calculate. The main argument of the inset contains a user-entered 
formula like \sin x in a math inset. An optional argument inserts an 
argument inset in which a value can be given to x, say x=\pi/12, again 
in a math inset. If the custom inset is placed inside a preview inset 
then the value of \sin x is calculated. The calculational engine used is 
the l3fp module of the LaTeX3 project, which works to 16 significant 
figures which are almost always too many, so as a kind of afterthought, 
you might want to round to, say, 4 figures with another optional 
argument. Where to place it? If placed before the main argument, what 
happens when evaluating a formula like \sin(\pi/12) where there is no 
need for the first optional argument? It is simpler to put the two 
optional arguments on either side of the main argument. In LaTeX or the 
Code Preview pane the thing then looks like


\calculyx[$x=\pi/12$]{$\sin x$}[4]

The first optional argument is entered either from the Insert menu or 
the context menu but most simply from the keyboard with the now built-in 
Alt+A 1. For the post-argument you have only the menus, there is no 
built-in shortcut. If you want one you need to assign it yourself. Given 
the happy correspondence between the run of keys on a keyboard and the 
distribution of arguments about the main argument, I felt assigning 
Alt+A 0 to the first post-argument would be a natural thing to have 
built-in in LyX.


Andrew

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: Alt+A 0

2017-05-25 Thread Scott Kostyshak
On Thu, May 25, 2017 at 12:51:26PM +1200, Andrew Parsloe wrote:
> The shortcut keys Alt+A 1, ..., Alt+A 9 are assigned to argument-insert 1
> ... argument-insert 9. On all the keyboards I have used, the numbers run in
> a row 1234567890 from left to right.

+1

> On my system Alt+A 0 is unassigned. I
> suggest assigning it to argument-insert post:1. A post argument follows the
> main argument, so there is a natural sequence from the ordinary arguments to
> the left of the main argument, then the main argument, then post arguments.
> Given the arrangement of keys on a keyboard, there seems a certain
> naturalness to assigning Alt+A 0 to the first post argument.

What is an example of where 'argument-insert post:1' is useful (e.g.  a
specific inset where I can test)? I don't actually know what post:1
means and haven't used it before.

Scott


signature.asc
Description: PGP signature


Alt+A 0

2017-05-24 Thread Andrew Parsloe
The shortcut keys Alt+A 1, ..., Alt+A 9 are assigned to argument-insert 
1 ... argument-insert 9. On all the keyboards I have used, the numbers 
run in a row 1234567890 from left to right. On my system Alt+A 0 is 
unassigned. I suggest assigning it to argument-insert post:1. A post 
argument follows the main argument, so there is a natural sequence from 
the ordinary arguments to the left of the main argument, then the main 
argument, then post arguments. Given the arrangement of keys on a 
keyboard, there seems a certain naturalness to assigning Alt+A 0 to the 
first post argument.


Andrew

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus