Re: Finding common mistakes

2016-05-16 Thread Joel Kulesza
On the command line it appears to have two output formats: the standard one
which gives some location information and a more complete JSON format
 that gives complete location and severity
location (which could used to style markup in the LyX interface).

Can someone comment on how LyX uses spellchecker diagnostics to perform
continuous markup?  A similar approach could be useful with proselint (to
parse the JSON output and style the LyX squiggles, perhaps instead of red
using blue ala MS Word).  Similarly, it would be instructive to know how
the spellchecker operates on-demand for running proselint on-demand.

On Mon, May 16, 2016 at 7:18 PM, Richard Heck  wrote:

> On 05/16/2016 09:00 PM, Paul A. Rubin wrote:
> > Joel,
> >
> > If you decide proselint is useful, it would be worth mentioning in the
> > user list. Maybe someone could hack a converter script to facilitate
> > running it against a LyX document.
>
> It looks to be text only, so you could export a LyX file to plaintext
> and run it against that. But it's hard to know how it would deal with
> footnotes, etc.
>
> Richard
>
>


Re: Finding common mistakes

2016-05-16 Thread Richard Heck
On 05/16/2016 09:00 PM, Paul A. Rubin wrote:
> Joel,
>
> If you decide proselint is useful, it would be worth mentioning in the
> user list. Maybe someone could hack a converter script to facilitate
> running it against a LyX document.

It looks to be text only, so you could export a LyX file to plaintext
and run it against that. But it's hard to know how it would deal with
footnotes, etc.

Richard



Re: Finding common mistakes

2016-05-16 Thread Paul A. Rubin
Joel,

If you decide proselint is useful, it would be worth mentioning in the user 
list. Maybe someone could hack a converter script to facilitate running it 
against a LyX document.

Paul
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Re: Finding common mistakes

2016-05-16 Thread Joel Kulesza
Paul,

Thanks for posting that.  I was thinking just the other day that something
that applies basic grammar rules within LyX would be a valuable addition.
In the meantime, I'll check out proselint (perhaps more accurately, its
plugin for VIM).

Thanks,
Joel

On Mon, May 16, 2016 at 5:31 PM, Paul A. Rubin  wrote:

> Bob Alvarez  hotmail.com> writes:
>
> > Is there any software tool that finds common mistakes in writing beyond
> spelling errors? I mean things like repeated words, homonym substitutions
> such as their/there, lose/loose, which/that confusion, etc?
>
> I have not tried it myself, but perhaps proselint (http://proselint.com/)
> might be of interest?
>
> Paul
>
>


Re: Finding common mistakes

2016-05-16 Thread Paul A . Rubin
Bob Alvarez  hotmail.com> writes:

> Is there any software tool that finds common mistakes in writing beyond
spelling errors? I mean things like repeated words, homonym substitutions
such as their/there, lose/loose, which/that confusion, etc?

I have not tried it myself, but perhaps proselint (http://proselint.com/)
might be of interest?

Paul



Re: Help with creation of module

2016-05-16 Thread Guillaume Munch

Le 16/05/2016 22:42, Richard Heck a écrit :

On 05/16/2016 05:18 PM, racoon wrote:


A couple more things that would be nice:

- the footnotetext was added to the list of footnotes.


This would definitely take some work.



It's in the works (http://www.lyx.org/trac/ticket/7790).

Guillaume



Re: Help with creation of module

2016-05-16 Thread racoon

On 16.05.2016 23:42, Richard Heck wrote:

On 05/16/2016 05:18 PM, racoon wrote:

On 16.05.2016 22:52, racoon wrote:

On 16.05.2016 22:22, Richard Heck wrote:

On 05/15/2016 05:20 AM, racoon wrote:

On 15.05.2016 03:41, Richard Heck wrote:

On 05/14/2016 05:46 PM, racoon wrote:

On 14.05.2016 08:29, racoon wrote:

On 14.05.2016 06:21, Richard Heck wrote:

On 05/13/2016 03:38 PM, racoon wrote:

Hi!

The LyX manual on customization has not much explanation. I
want to
create a simple module that inserts a label with
"footnotemark" and
the command \footnotemark in the source.

The LyxType sounds like the right thing to use. But
unfortunately, I
have no idea where I can find this kind of inset. The
documentation
states "Among other things, [LyXType] determines on which menu
this
inset will appear." (46, LyX 2.2) But it does not state where the
inset will appear.


This does sound like a job for a Flex inset. Can you explain in
detail
what you want to accomplish, in terms of LaTeX? Is there preamble
code?
What do you want to appear where this new inset would appear?

I'd suggest you look at endnotes.module for an example you
should be
able to adapt.

As for LyXType, the only genuine options here are CharStyle and
Custom.
The former is intended, as it says, for character styles, such as
noun
and small caps. They appear under Edit> TextStyle. The latter is
intended for custom insets such as endnote. They appear under
Insert>
Custom Insets.


Ah, I see. Then charstyle is seems not to be the right thing.

I want to implement http://www.lyx.org/trac/ticket/9998 via a
module.

I have the current code inserted below. Problems at the moment:

For the Footnotemark:

- It should contain no arguments.
- It should also be possible to insert it in math mode.
- Can it count up the standard footnote counter that is shown on
the
footnote in the editor?



#\DeclareLyXModule{Footnote}
#DescriptionBegin
#Adds the footnotemark and footnotetext command
#DescriptionEnd

Format 59

InsetLayout Flex:Footnotetext
  LyXType custom
  LatexName   footnotetext
  LatexType   command
  Decoration  classic
  Font
Size Small
  EndFont
  MultiPartrue
  LabelString fntext
End

InsetLayout Flex:Footnotemark
  LyXTypecustom
  LatexNamefootnotemark
  LatexTypecommand
  Decorationclassic
  Font
Size Small
  EndFont
  LabelString fnmark
End




Okay, maybe I found my answer: it is not possible for now.

http://lyx-devel.lyx.narkive.com/i8i3itVw/lyx-construct-for-latex-commands-having-no-arguments






Yes, the part about "no arguments" means we're dealing with a
command-type inset, not a collapsable inset, and there are no custom
versions of the former.



Thanks. Well, I tried to make a virtue out of it and looked up the
\footnotemark command and it can actually has an optional argument.

There are two more obstacles:

1. \footnotetext actually also takes an optional argument. So far I
have implemented it with only with the required argument. Is it
possible to add an optional argument to it?


Yes. See the discussion of the Argument tag in section 5.3.6 of the
Customization manual. You only need to declare the optional argument, I
believe. Have a look at some of the InsetLayout definitions is
beamer.layout. Most of these have optional arguments.


2. a minor one: \footnotemark receives only an optional argument. Is
it possible to give only an optional argument to a command, i.e. to
give it directly to [] rather than {} in the latex command? Right now
I just make a new command that gives it's required argument to
footnotemark as an optional argument. It's a bit indirect.


Yes, I see. I don't think we have the ability to output the "main"
argument with customized delimiters. You can ADD delimiters with the
LeftDelim and RightDelim tags, but these just seem to appear inside the
usual brackets. I suspect this is a bug, actually. With other arguments
you can specify the delimitersl, and they override the default.

Richard




Thanks. The hint at the beamer.layout was useful. (Somehow I thought
that Argument 1 must be the argument that is always present but it is
actually the first "additional" argument it seems.)

Actually, the \footnotemark command works in math mode as well. But I
guess there is no chance of using my module inset in math mode, right?


A couple more things that would be nice:

- the footnotetext was added to the list of footnotes.


This would definitely take some work.


- one could refer to the standard names of other insets, like the
LabelString of the standard footnotes. For example, I have renamed the
standard "foot x" to "fn x". So I would like to have a reference to
that name ("foot" or "fn") so that others can have whatever they like
and it will automatically be used.


You want something like:
LabelString [[LabelString:Foot]]
where the thing in brackets picks up the other one's name?


Yes, I think so. However, if it is not already implemented I 

Re: How to use \Bigl( and \Bigr(, and \mleft( and \mright(

2016-05-16 Thread Daniel

On 16.05.2016 23:38, Richard Heck wrote:

On 05/16/2016 04:47 PM, Daniel wrote:
> On 16.05.2016 22:32, Richard Heck wrote:
>> On 05/16/2016 08:49 AM, racoon wrote:
>>> Hi,
>>>
>>> How do I use \Bigl( and \Bigr(, and \mleft( and \mright( in LyX? (The
>>> latter need the mleftright package.)
>>
>> Just type them, exactly like that. In the former case, LyX has support,
>> so you'll just see big parens. In the latter case, there is no support,
>> so they work like ERT.
>>
>> You can get "matched" delimiters, too, from the toolbar. Click on the
>> "insert delimiters" button.
>>
>> Richard
>>
>>
> Thanks. Bummer, I tried to type the command before but just forgot the
> brackets.
>
> I am wondering about the "matched" delimiters though. I could see
> neither the "Big" nor the "big" there. Is there some option to use
> user defined "matched" brackets that I miss?

In the dialog there is a "Size" dropdown that controls the size of the
brackets.


Thanks. I should sleep a bit so I don't overlook the obvious...


Re: Help with creation of module

2016-05-16 Thread Richard Heck
On 05/16/2016 05:18 PM, racoon wrote:
> On 16.05.2016 22:52, racoon wrote:
>> On 16.05.2016 22:22, Richard Heck wrote:
>>> On 05/15/2016 05:20 AM, racoon wrote:
 On 15.05.2016 03:41, Richard Heck wrote:
> On 05/14/2016 05:46 PM, racoon wrote:
>> On 14.05.2016 08:29, racoon wrote:
>>> On 14.05.2016 06:21, Richard Heck wrote:
 On 05/13/2016 03:38 PM, racoon wrote:
> Hi!
>
> The LyX manual on customization has not much explanation. I
> want to
> create a simple module that inserts a label with
> "footnotemark" and
> the command \footnotemark in the source.
>
> The LyxType sounds like the right thing to use. But
> unfortunately, I
> have no idea where I can find this kind of inset. The
> documentation
> states "Among other things, [LyXType] determines on which menu
> this
> inset will appear." (46, LyX 2.2) But it does not state where the
> inset will appear.

 This does sound like a job for a Flex inset. Can you explain in
 detail
 what you want to accomplish, in terms of LaTeX? Is there preamble
 code?
 What do you want to appear where this new inset would appear?

 I'd suggest you look at endnotes.module for an example you
 should be
 able to adapt.

 As for LyXType, the only genuine options here are CharStyle and
 Custom.
 The former is intended, as it says, for character styles, such as
 noun
 and small caps. They appear under Edit> TextStyle. The latter is
 intended for custom insets such as endnote. They appear under
 Insert>
 Custom Insets.
>>>
>>> Ah, I see. Then charstyle is seems not to be the right thing.
>>>
>>> I want to implement http://www.lyx.org/trac/ticket/9998 via a
>>> module.
>>>
>>> I have the current code inserted below. Problems at the moment:
>>>
>>> For the Footnotemark:
>>>
>>> - It should contain no arguments.
>>> - It should also be possible to insert it in math mode.
>>> - Can it count up the standard footnote counter that is shown on
>>> the
>>> footnote in the editor?
>>>
>>>
>>>
>>> #\DeclareLyXModule{Footnote}
>>> #DescriptionBegin
>>> #Adds the footnotemark and footnotetext command
>>> #DescriptionEnd
>>>
>>> Format 59
>>>
>>> InsetLayout Flex:Footnotetext
>>>   LyXType custom
>>>   LatexName   footnotetext
>>>   LatexType   command
>>>   Decoration  classic
>>>   Font
>>> Size Small
>>>   EndFont
>>>   MultiPartrue
>>>   LabelString fntext
>>> End
>>>
>>> InsetLayout Flex:Footnotemark
>>>   LyXTypecustom
>>>   LatexNamefootnotemark
>>>   LatexTypecommand
>>>   Decorationclassic
>>>   Font
>>> Size Small
>>>   EndFont
>>>   LabelString fnmark
>>> End
>>>
>>>
>>
>> Okay, maybe I found my answer: it is not possible for now.
>>
>> http://lyx-devel.lyx.narkive.com/i8i3itVw/lyx-construct-for-latex-commands-having-no-arguments
>>
>>
>>
>>
>
> Yes, the part about "no arguments" means we're dealing with a
> command-type inset, not a collapsable inset, and there are no custom
> versions of the former.
>

 Thanks. Well, I tried to make a virtue out of it and looked up the
 \footnotemark command and it can actually has an optional argument.

 There are two more obstacles:

 1. \footnotetext actually also takes an optional argument. So far I
 have implemented it with only with the required argument. Is it
 possible to add an optional argument to it?
>>>
>>> Yes. See the discussion of the Argument tag in section 5.3.6 of the
>>> Customization manual. You only need to declare the optional argument, I
>>> believe. Have a look at some of the InsetLayout definitions is
>>> beamer.layout. Most of these have optional arguments.
>>>
 2. a minor one: \footnotemark receives only an optional argument. Is
 it possible to give only an optional argument to a command, i.e. to
 give it directly to [] rather than {} in the latex command? Right now
 I just make a new command that gives it's required argument to
 footnotemark as an optional argument. It's a bit indirect.
>>>
>>> Yes, I see. I don't think we have the ability to output the "main"
>>> argument with customized delimiters. You can ADD delimiters with the
>>> LeftDelim and RightDelim tags, but these just seem to appear inside the
>>> usual brackets. I suspect this is a bug, actually. With other arguments
>>> you can specify the delimitersl, and they override the default.
>>>
>>> Richard
>>>
>>>
>>
>> Thanks. The hint at the beamer.layout was useful. (Somehow I thought
>> that 

Re: Help with creation of module

2016-05-16 Thread Richard Heck
On 05/16/2016 04:52 PM, racoon wrote:
> On 16.05.2016 22:22, Richard Heck wrote:
>> On 05/15/2016 05:20 AM, racoon wrote:
>>> On 15.05.2016 03:41, Richard Heck wrote:
 On 05/14/2016 05:46 PM, racoon wrote:
> On 14.05.2016 08:29, racoon wrote:
>> On 14.05.2016 06:21, Richard Heck wrote:
>>> On 05/13/2016 03:38 PM, racoon wrote:
 Hi!

 The LyX manual on customization has not much explanation. I
 want to
 create a simple module that inserts a label with "footnotemark"
 and
 the command \footnotemark in the source.

 The LyxType sounds like the right thing to use. But
 unfortunately, I
 have no idea where I can find this kind of inset. The
 documentation
 states "Among other things, [LyXType] determines on which menu
 this
 inset will appear." (46, LyX 2.2) But it does not state where the
 inset will appear.
>>>
>>> This does sound like a job for a Flex inset. Can you explain in
>>> detail
>>> what you want to accomplish, in terms of LaTeX? Is there preamble
>>> code?
>>> What do you want to appear where this new inset would appear?
>>>
>>> I'd suggest you look at endnotes.module for an example you
>>> should be
>>> able to adapt.
>>>
>>> As for LyXType, the only genuine options here are CharStyle and
>>> Custom.
>>> The former is intended, as it says, for character styles, such as
>>> noun
>>> and small caps. They appear under Edit> TextStyle. The latter is
>>> intended for custom insets such as endnote. They appear under
>>> Insert>
>>> Custom Insets.
>>
>> Ah, I see. Then charstyle is seems not to be the right thing.
>>
>> I want to implement http://www.lyx.org/trac/ticket/9998 via a
>> module.
>>
>> I have the current code inserted below. Problems at the moment:
>>
>> For the Footnotemark:
>>
>> - It should contain no arguments.
>> - It should also be possible to insert it in math mode.
>> - Can it count up the standard footnote counter that is shown on the
>> footnote in the editor?
>>
>>
>>
>> #\DeclareLyXModule{Footnote}
>> #DescriptionBegin
>> #Adds the footnotemark and footnotetext command
>> #DescriptionEnd
>>
>> Format 59
>>
>> InsetLayout Flex:Footnotetext
>>   LyXType custom
>>   LatexName   footnotetext
>>   LatexType   command
>>   Decoration  classic
>>   Font
>> Size Small
>>   EndFont
>>   MultiPartrue
>>   LabelString fntext
>> End
>>
>> InsetLayout Flex:Footnotemark
>>   LyXTypecustom
>>   LatexNamefootnotemark
>>   LatexTypecommand
>>   Decorationclassic
>>   Font
>> Size Small
>>   EndFont
>>   LabelString fnmark
>> End
>>
>>
>
> Okay, maybe I found my answer: it is not possible for now.
>
> http://lyx-devel.lyx.narkive.com/i8i3itVw/lyx-construct-for-latex-commands-having-no-arguments
>
>
>

 Yes, the part about "no arguments" means we're dealing with a
 command-type inset, not a collapsable inset, and there are no custom
 versions of the former.

>>>
>>> Thanks. Well, I tried to make a virtue out of it and looked up the
>>> \footnotemark command and it can actually has an optional argument.
>>>
>>> There are two more obstacles:
>>>
>>> 1. \footnotetext actually also takes an optional argument. So far I
>>> have implemented it with only with the required argument. Is it
>>> possible to add an optional argument to it?
>>
>> Yes. See the discussion of the Argument tag in section 5.3.6 of the
>> Customization manual. You only need to declare the optional argument, I
>> believe. Have a look at some of the InsetLayout definitions is
>> beamer.layout. Most of these have optional arguments.
>>
>>> 2. a minor one: \footnotemark receives only an optional argument. Is
>>> it possible to give only an optional argument to a command, i.e. to
>>> give it directly to [] rather than {} in the latex command? Right now
>>> I just make a new command that gives it's required argument to
>>> footnotemark as an optional argument. It's a bit indirect.
>>
>> Yes, I see. I don't think we have the ability to output the "main"
>> argument with customized delimiters. You can ADD delimiters with the
>> LeftDelim and RightDelim tags, but these just seem to appear inside the
>> usual brackets. I suspect this is a bug, actually. With other arguments
>> you can specify the delimitersl, and they override the default.
>>
>> Richard
>>
>>
>
> Thanks. The hint at the beamer.layout was useful. (Somehow I thought
> that Argument 1 must be the argument that is always present but it is
> actually the first "additional" argument it seems.)
>
> Actually, the \footnotemark command works in math mode as well. 

Re: How to use \Bigl( and \Bigr(, and \mleft( and \mright(

2016-05-16 Thread Richard Heck
On 05/16/2016 04:47 PM, Daniel wrote:
> On 16.05.2016 22:32, Richard Heck wrote:
>> On 05/16/2016 08:49 AM, racoon wrote:
>> > Hi,
>> >
>> > How do I use \Bigl( and \Bigr(, and \mleft( and \mright( in LyX? (The
>> > latter need the mleftright package.)
>>
>> Just type them, exactly like that. In the former case, LyX has support,
>> so you'll just see big parens. In the latter case, there is no support,
>> so they work like ERT.
>>
>> You can get "matched" delimiters, too, from the toolbar. Click on the
>> "insert delimiters" button.
>>
>> Richard
>>
>>
> Thanks. Bummer, I tried to type the command before but just forgot the
> brackets.
>
> I am wondering about the "matched" delimiters though. I could see
> neither the "Big" nor the "big" there. Is there some option to use
> user defined "matched" brackets that I miss?

In the dialog there is a "Size" dropdown that controls the size of the
brackets.

Richard




Re: Help with creation of module

2016-05-16 Thread racoon

On 16.05.2016 22:52, racoon wrote:

On 16.05.2016 22:22, Richard Heck wrote:

On 05/15/2016 05:20 AM, racoon wrote:

On 15.05.2016 03:41, Richard Heck wrote:

On 05/14/2016 05:46 PM, racoon wrote:

On 14.05.2016 08:29, racoon wrote:

On 14.05.2016 06:21, Richard Heck wrote:

On 05/13/2016 03:38 PM, racoon wrote:

Hi!

The LyX manual on customization has not much explanation. I want to
create a simple module that inserts a label with "footnotemark" and
the command \footnotemark in the source.

The LyxType sounds like the right thing to use. But
unfortunately, I
have no idea where I can find this kind of inset. The documentation
states "Among other things, [LyXType] determines on which menu this
inset will appear." (46, LyX 2.2) But it does not state where the
inset will appear.


This does sound like a job for a Flex inset. Can you explain in
detail
what you want to accomplish, in terms of LaTeX? Is there preamble
code?
What do you want to appear where this new inset would appear?

I'd suggest you look at endnotes.module for an example you should be
able to adapt.

As for LyXType, the only genuine options here are CharStyle and
Custom.
The former is intended, as it says, for character styles, such as
noun
and small caps. They appear under Edit> TextStyle. The latter is
intended for custom insets such as endnote. They appear under
Insert>
Custom Insets.


Ah, I see. Then charstyle is seems not to be the right thing.

I want to implement http://www.lyx.org/trac/ticket/9998 via a module.

I have the current code inserted below. Problems at the moment:

For the Footnotemark:

- It should contain no arguments.
- It should also be possible to insert it in math mode.
- Can it count up the standard footnote counter that is shown on the
footnote in the editor?



#\DeclareLyXModule{Footnote}
#DescriptionBegin
#Adds the footnotemark and footnotetext command
#DescriptionEnd

Format 59

InsetLayout Flex:Footnotetext
  LyXType custom
  LatexName   footnotetext
  LatexType   command
  Decoration  classic
  Font
Size Small
  EndFont
  MultiPartrue
  LabelString fntext
End

InsetLayout Flex:Footnotemark
  LyXTypecustom
  LatexNamefootnotemark
  LatexTypecommand
  Decorationclassic
  Font
Size Small
  EndFont
  LabelString fnmark
End




Okay, maybe I found my answer: it is not possible for now.

http://lyx-devel.lyx.narkive.com/i8i3itVw/lyx-construct-for-latex-commands-having-no-arguments





Yes, the part about "no arguments" means we're dealing with a
command-type inset, not a collapsable inset, and there are no custom
versions of the former.



Thanks. Well, I tried to make a virtue out of it and looked up the
\footnotemark command and it can actually has an optional argument.

There are two more obstacles:

1. \footnotetext actually also takes an optional argument. So far I
have implemented it with only with the required argument. Is it
possible to add an optional argument to it?


Yes. See the discussion of the Argument tag in section 5.3.6 of the
Customization manual. You only need to declare the optional argument, I
believe. Have a look at some of the InsetLayout definitions is
beamer.layout. Most of these have optional arguments.


2. a minor one: \footnotemark receives only an optional argument. Is
it possible to give only an optional argument to a command, i.e. to
give it directly to [] rather than {} in the latex command? Right now
I just make a new command that gives it's required argument to
footnotemark as an optional argument. It's a bit indirect.


Yes, I see. I don't think we have the ability to output the "main"
argument with customized delimiters. You can ADD delimiters with the
LeftDelim and RightDelim tags, but these just seem to appear inside the
usual brackets. I suspect this is a bug, actually. With other arguments
you can specify the delimitersl, and they override the default.

Richard




Thanks. The hint at the beamer.layout was useful. (Somehow I thought
that Argument 1 must be the argument that is always present but it is
actually the first "additional" argument it seems.)

Actually, the \footnotemark command works in math mode as well. But I
guess there is no chance of using my module inset in math mode, right?


A couple more things that would be nice:

- the footnotetext was added to the list of footnotes.
- one could refer to the standard names of other insets, like the 
LabelString of the standard footnotes. For example, I have renamed the 
standard "foot x" to "fn x". So I would like to have a reference to that 
name ("foot" or "fn") so that others can have whatever they like and it 
will automatically be used.


Daniel



Re: Help with creation of module

2016-05-16 Thread racoon

On 16.05.2016 22:22, Richard Heck wrote:

On 05/15/2016 05:20 AM, racoon wrote:

On 15.05.2016 03:41, Richard Heck wrote:

On 05/14/2016 05:46 PM, racoon wrote:

On 14.05.2016 08:29, racoon wrote:

On 14.05.2016 06:21, Richard Heck wrote:

On 05/13/2016 03:38 PM, racoon wrote:

Hi!

The LyX manual on customization has not much explanation. I want to
create a simple module that inserts a label with "footnotemark" and
the command \footnotemark in the source.

The LyxType sounds like the right thing to use. But unfortunately, I
have no idea where I can find this kind of inset. The documentation
states "Among other things, [LyXType] determines on which menu this
inset will appear." (46, LyX 2.2) But it does not state where the
inset will appear.


This does sound like a job for a Flex inset. Can you explain in
detail
what you want to accomplish, in terms of LaTeX? Is there preamble
code?
What do you want to appear where this new inset would appear?

I'd suggest you look at endnotes.module for an example you should be
able to adapt.

As for LyXType, the only genuine options here are CharStyle and
Custom.
The former is intended, as it says, for character styles, such as
noun
and small caps. They appear under Edit> TextStyle. The latter is
intended for custom insets such as endnote. They appear under Insert>
Custom Insets.


Ah, I see. Then charstyle is seems not to be the right thing.

I want to implement http://www.lyx.org/trac/ticket/9998 via a module.

I have the current code inserted below. Problems at the moment:

For the Footnotemark:

- It should contain no arguments.
- It should also be possible to insert it in math mode.
- Can it count up the standard footnote counter that is shown on the
footnote in the editor?



#\DeclareLyXModule{Footnote}
#DescriptionBegin
#Adds the footnotemark and footnotetext command
#DescriptionEnd

Format 59

InsetLayout Flex:Footnotetext
  LyXType custom
  LatexName   footnotetext
  LatexType   command
  Decoration  classic
  Font
Size Small
  EndFont
  MultiPartrue
  LabelString fntext
End

InsetLayout Flex:Footnotemark
  LyXTypecustom
  LatexNamefootnotemark
  LatexTypecommand
  Decorationclassic
  Font
Size Small
  EndFont
  LabelString fnmark
End




Okay, maybe I found my answer: it is not possible for now.

http://lyx-devel.lyx.narkive.com/i8i3itVw/lyx-construct-for-latex-commands-having-no-arguments




Yes, the part about "no arguments" means we're dealing with a
command-type inset, not a collapsable inset, and there are no custom
versions of the former.



Thanks. Well, I tried to make a virtue out of it and looked up the
\footnotemark command and it can actually has an optional argument.

There are two more obstacles:

1. \footnotetext actually also takes an optional argument. So far I
have implemented it with only with the required argument. Is it
possible to add an optional argument to it?


Yes. See the discussion of the Argument tag in section 5.3.6 of the
Customization manual. You only need to declare the optional argument, I
believe. Have a look at some of the InsetLayout definitions is
beamer.layout. Most of these have optional arguments.


2. a minor one: \footnotemark receives only an optional argument. Is
it possible to give only an optional argument to a command, i.e. to
give it directly to [] rather than {} in the latex command? Right now
I just make a new command that gives it's required argument to
footnotemark as an optional argument. It's a bit indirect.


Yes, I see. I don't think we have the ability to output the "main"
argument with customized delimiters. You can ADD delimiters with the
LeftDelim and RightDelim tags, but these just seem to appear inside the
usual brackets. I suspect this is a bug, actually. With other arguments
you can specify the delimitersl, and they override the default.

Richard




Thanks. The hint at the beamer.layout was useful. (Somehow I thought 
that Argument 1 must be the argument that is always present but it is 
actually the first "additional" argument it seems.)


Actually, the \footnotemark command works in math mode as well. But I 
guess there is no chance of using my module inset in math mode, right?


Daniel



Re: How to use \Bigl( and \Bigr(, and \mleft( and \mright(

2016-05-16 Thread Daniel

On 16.05.2016 22:32, Richard Heck wrote:

On 05/16/2016 08:49 AM, racoon wrote:
> Hi,
>
> How do I use \Bigl( and \Bigr(, and \mleft( and \mright( in LyX? (The
> latter need the mleftright package.)

Just type them, exactly like that. In the former case, LyX has support,
so you'll just see big parens. In the latter case, there is no support,
so they work like ERT.

You can get "matched" delimiters, too, from the toolbar. Click on the
"insert delimiters" button.

Richard



Thanks. Bummer, I tried to type the command before but just forgot the brackets.

I am wondering about the "matched" delimiters though. I could see neither the "Big" nor the 
"big" there. Is there some option to use user defined "matched" brackets that I miss?

Daniel


Re: How to use \Bigl( and \Bigr(, and \mleft( and \mright(

2016-05-16 Thread Richard Heck
On 05/16/2016 08:49 AM, racoon wrote:
> Hi,
>
> How do I use \Bigl( and \Bigr(, and \mleft( and \mright( in LyX? (The
> latter need the mleftright package.)

Just type them, exactly like that. In the former case, LyX has support,
so you'll just see big parens. In the latter case, there is no support,
so they work like ERT.

You can get "matched" delimiters, too, from the toolbar. Click on the
"insert delimiters" button.

Richard



Re: Help with creation of module

2016-05-16 Thread Richard Heck
On 05/15/2016 05:20 AM, racoon wrote:
> On 15.05.2016 03:41, Richard Heck wrote:
>> On 05/14/2016 05:46 PM, racoon wrote:
>>> On 14.05.2016 08:29, racoon wrote:
 On 14.05.2016 06:21, Richard Heck wrote:
> On 05/13/2016 03:38 PM, racoon wrote:
>> Hi!
>>
>> The LyX manual on customization has not much explanation. I want to
>> create a simple module that inserts a label with "footnotemark" and
>> the command \footnotemark in the source.
>>
>> The LyxType sounds like the right thing to use. But unfortunately, I
>> have no idea where I can find this kind of inset. The documentation
>> states "Among other things, [LyXType] determines on which menu this
>> inset will appear." (46, LyX 2.2) But it does not state where the
>> inset will appear.
>
> This does sound like a job for a Flex inset. Can you explain in
> detail
> what you want to accomplish, in terms of LaTeX? Is there preamble
> code?
> What do you want to appear where this new inset would appear?
>
> I'd suggest you look at endnotes.module for an example you should be
> able to adapt.
>
> As for LyXType, the only genuine options here are CharStyle and
> Custom.
> The former is intended, as it says, for character styles, such as
> noun
> and small caps. They appear under Edit> TextStyle. The latter is
> intended for custom insets such as endnote. They appear under Insert>
> Custom Insets.

 Ah, I see. Then charstyle is seems not to be the right thing.

 I want to implement http://www.lyx.org/trac/ticket/9998 via a module.

 I have the current code inserted below. Problems at the moment:

 For the Footnotemark:

 - It should contain no arguments.
 - It should also be possible to insert it in math mode.
 - Can it count up the standard footnote counter that is shown on the
 footnote in the editor?



 #\DeclareLyXModule{Footnote}
 #DescriptionBegin
 #Adds the footnotemark and footnotetext command
 #DescriptionEnd

 Format 59

 InsetLayout Flex:Footnotetext
   LyXType custom
   LatexName   footnotetext
   LatexType   command
   Decoration  classic
   Font
 Size Small
   EndFont
   MultiPartrue
   LabelString fntext
 End

 InsetLayout Flex:Footnotemark
   LyXTypecustom
   LatexNamefootnotemark
   LatexTypecommand
   Decorationclassic
   Font
 Size Small
   EndFont
   LabelString fnmark
 End


>>>
>>> Okay, maybe I found my answer: it is not possible for now.
>>>
>>> http://lyx-devel.lyx.narkive.com/i8i3itVw/lyx-construct-for-latex-commands-having-no-arguments
>>>
>>>
>>
>> Yes, the part about "no arguments" means we're dealing with a
>> command-type inset, not a collapsable inset, and there are no custom
>> versions of the former.
>>
>
> Thanks. Well, I tried to make a virtue out of it and looked up the
> \footnotemark command and it can actually has an optional argument.
>
> There are two more obstacles:
>
> 1. \footnotetext actually also takes an optional argument. So far I
> have implemented it with only with the required argument. Is it
> possible to add an optional argument to it?

Yes. See the discussion of the Argument tag in section 5.3.6 of the
Customization manual. You only need to declare the optional argument, I
believe. Have a look at some of the InsetLayout definitions is
beamer.layout. Most of these have optional arguments.

> 2. a minor one: \footnotemark receives only an optional argument. Is
> it possible to give only an optional argument to a command, i.e. to
> give it directly to [] rather than {} in the latex command? Right now
> I just make a new command that gives it's required argument to
> footnotemark as an optional argument. It's a bit indirect.

Yes, I see. I don't think we have the ability to output the "main"
argument with customized delimiters. You can ADD delimiters with the
LeftDelim and RightDelim tags, but these just seem to appear inside the
usual brackets. I suspect this is a bug, actually. With other arguments
you can specify the delimitersl, and they override the default.

Richard



Finding common mistakes

2016-05-16 Thread Bob Alvarez
Is there any software tool that finds common mistakes in writing beyond 
spelling errors? I mean things like repeated words, homonym substitutions such 
as their/there, lose/loose, which/that confusion, etc?


I also paste my text into Microsoft Word and use their grammar checker. It 
spots some of these problems but goes overboard with pointing out passive voice 
verbs.


There is a tool called Papyrus Autor which implements the rules of Andreas 
Eschbach but alas so far it is only for German. Here are some of the rules 
(this is from a post on writers stackexchange but I will not post a link 
because it might get this post rejected). These are very sophisticated but it 
would be great to have even simple stuff.


The 10 marking steps by Andreas Eschbach:


First print out your text (yes, you need it on paper). Pick a small text 
passage you can easily overview and go through all of the following 10 points 
with this passage. Then pick the next one. Use different colors for marking 
your text and for editing it.

  1.  Strike through the first paragraph of a scene from upper left to lower 
right.
Think: Do you really need it? Often the first paragraph is used to "warming up" 
while writing. Could you put the info into later sections?
  2.  Strike through all adjectives and adverbs
Think: Can you use a more precise noun/verb instead using the 
adjectives/adverbs?
  3.  Mark all dialog decorators (like he said, he replied, ...) with wavy 
lines.
Think: Can you delete them without puzzling the user? Can you replace them with 
actions (instead of: "Are you sure?" asked Peter => use: "Are you sure?" Peter 
scratched his head. He couldn't believe what he was hearing.)?
  4.  Mark filler words and imprecise words (some, quite, rather, several, few, 
...) by drawing a box around them.
Think: Normally you can just delete them or make them more precise (Only a few 
people ... => Only ten people ...)
  5.  Cross out concurrency indicators (during, while, ...)
Think: Often it could be better to write things that happen simultaneously in 
two different sentences: "She cried while he beat her." => "He beat her. She 
cried."
  6.  Mark passive sentences with a small "P" above them.
Think: Often the active form is better (more action): New Orleans was 
devastated by a hurricane. => The hurricane devastated New Orleans.
  7.  Mark long sentences with an "L" above the sentence.
Think: Make them shorter! No-one likes to read long sentences (except your 
English teacher in school maybe).
  8.  Mark long dialogs with an "LD".
Think: Can you shorten them or divide them into several parts?
  9.  Mark indirect perception with a jagged line, like "watched" and "asked" 
in these examples:
"He watched, how the woman crossed the street joining the spectators there. He 
asked himself, what was going on there."
Think: Do you really need it? Why? Does this sound better: "He watched the 
spectators on the other side. Another woman crossed the street to join them. 
What was going on there?"
  10. Search paragraphs where you wrote the same thing with different wording. 
Mark it with wavy lines at the sheet margin:
"She hit him a second time. Another time she stroke the club on his head."
Think: This looks like you were searching for the right expression while 
writing. Nothing wrong with that, but only keep one of them.






How to use \Bigl( and \Bigr(, and \mleft( and \mright(

2016-05-16 Thread racoon

Hi,

How do I use \Bigl( and \Bigr(, and \mleft( and \mright( in LyX? (The 
latter need the mleftright package.)


Best,
Daniel