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