Re: Is it possible to apply document defaults

2017-11-02 Thread Scott Kostyshak
On Wed, Nov 01, 2017 at 08:17:14PM +, racoon wrote:
> On 01.11.2017 12:36, Jürgen Spitzmüller wrote:
> > Am Mittwoch, den 01.11.2017, 11:35 +0200 schrieb racoon:
> > > Thanks. Would be nice to have a little more flexibility in what it
> > > resets and what not. Also, if it does not reset all settings and
> > > since
> > > one does not do this kind of reset often, a message box informing
> > > the
> > > user as to what has been reset might be helpful.
> > 
> > Yes, we could do so much (if we had the time and manpower).
> 
> Right. I don't have the overview of what things are being done. So I never
> know what the priorities are. I just keep mentioning things that come up
> while I am working with LyX on a daily basis hoping that some of those
> things might be helpful to know.

Yes, they are very helpful. Please keep doing what you're doing!

Thank you for all of your time and help!

Scott


signature.asc
Description: PGP signature


Re: Is it possible to apply document defaults

2017-11-01 Thread racoon

On 01.11.2017 13:04, Jürgen Spitzmüller wrote:

Am Mittwoch, den 01.11.2017, 11:43 +0200 schrieb racoon:

And actually there is a bug in it: If one resets the OK and Apply
buttons don't get enabled.


Fixed.


Great, thanks!

Daniel



Jürgen



Daniel






Re: Is it possible to apply document defaults

2017-11-01 Thread racoon

On 01.11.2017 12:36, Jürgen Spitzmüller wrote:

Am Mittwoch, den 01.11.2017, 11:35 +0200 schrieb racoon:

Thanks. Would be nice to have a little more flexibility in what it
resets and what not. Also, if it does not reset all settings and
since
one does not do this kind of reset often, a message box informing
the
user as to what has been reset might be helpful.


Yes, we could do so much (if we had the time and manpower).


Right. I don't have the overview of what things are being done. So I 
never know what the priorities are. I just keep mentioning things that 
come up while I am working with LyX on a daily basis hoping that some of 
those things might be helpful to know.


Daniel



Jürgen



Daniel






Re: Is it possible to apply document defaults

2017-11-01 Thread Jürgen Spitzmüller
Am Mittwoch, den 01.11.2017, 11:43 +0200 schrieb racoon:
> And actually there is a bug in it: If one resets the OK and Apply 
> buttons don't get enabled.

Fixed.

Jürgen

> 
> Daniel
> 
> 

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


Re: Is it possible to apply document defaults

2017-11-01 Thread racoon

On 01.11.2017 12:08, Jürgen Spitzmüller wrote:

Am Montag, den 30.10.2017, 19:46 +0200 schrieb racoon:

Does that explain why it seems to do nothing at my side?


It should apply to the following settings:

* oneside/twoside
* columns
* page style
* toc level

And resets to what is defined as default (if any) in the layout file.


And actually there is a bug in it: If one resets the OK and Apply 
buttons don't get enabled.


Daniel




Re: Is it possible to apply document defaults

2017-11-01 Thread Jürgen Spitzmüller
Am Mittwoch, den 01.11.2017, 11:35 +0200 schrieb racoon:
> Thanks. Would be nice to have a little more flexibility in what it 
> resets and what not. Also, if it does not reset all settings and
> since 
> one does not do this kind of reset often, a message box informing
> the 
> user as to what has been reset might be helpful.

Yes, we could do so much (if we had the time and manpower).

Jürgen

> 
> Daniel
> 
> 

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


Re: Is it possible to apply document defaults

2017-11-01 Thread racoon

On 01.11.2017 12:08, Jürgen Spitzmüller wrote:

Am Montag, den 30.10.2017, 19:46 +0200 schrieb racoon:

Does that explain why it seems to do nothing at my side?


It should apply to the following settings:

* oneside/twoside
* columns
* page style
* toc level

And resets to what is defined as default (if any) in the layout file.


Thanks. Would be nice to have a little more flexibility in what it 
resets and what not. Also, if it does not reset all settings and since 
one does not do this kind of reset often, a message box informing the 
user as to what has been reset might be helpful.


Daniel




Re: Is it possible to apply document defaults

2017-11-01 Thread Jürgen Spitzmüller
Am Montag, den 30.10.2017, 19:46 +0200 schrieb racoon:
> Does that explain why it seems to do nothing at my side?

It should apply to the following settings:

* oneside/twoside
* columns
* page style
* toc level

And resets to what is defined as default (if any) in the layout file.

Jürgen

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


Re: Is it possible to apply document defaults

2017-11-01 Thread racoon

On 01.11.2017 04:14, Richard Heck wrote:

On 10/31/2017 03:44 PM, racoon wrote:

On 25.10.2017 22:07, Richard Heck wrote:

On 10/24/2017 09:37 AM, racoon wrote:

Hi

I know of the "Save as Document Defaults" in the document settings.
What it seems to do is create a default document with preferences that
is loaded when one creates a new document.

However, if I have created a number of documents using those defaults
and discover that I would like to have something differently, is it
possible not only to save the new settings to the defaults for new
documents but also apply those defaults withing other already existing
documents?

I guess I am missing an "Apply Document Defaults" button in settings.
But maybe there is a different way in LyX to do this.


There's no way in LyX to do this, but the fact that LyX files are just
text files makes it easy to do outside LyX. One option is to write a
really basic filter and then run it on your files. For example, if you
wanted to use refstyle, whereas you hadn't previously, you could just
do:
  perl -ibak -pe 's/\\use_refstyle 0/\\use_refstyle 1/' *.lyx
Of course, if it's just that one thing to change, that's maybe not so
helpful. But if there were several changes

Many people use similar techniques to make all kinds of changes to LyX
files. Just as an example, I'm attaching a Perl script I used a little
while ago to change all citations to a particular book to citealias-type
citations. I prefer to write these things in Perl, since it was more or
less designed for this sort of thing. But you could also do it in
Python, of course, or sed or awk, if you're really masochistic.


Thanks Richard. I will have to look into it when my changes to the
default get too many to keep track of them and do them manually for
all the older documents. But wouldn't this be a nice feature to have
in LyX right next to the Save Defaults button? Maybe your script could
be used for that?


It's a reasonable request. Note, however, that it would essentially
involve replacing all the Document settings, at least if we really want
to use the defaults.


Seems fine to me. Am I missing what is problematic about it? I would 
even go so far that exporting and importing document settings would be nice.



Actually, come to think of it, here's another way to do it: Create a new
document; cut and paste the content of the old one.


Yes, that sounds like a reasonable alternative. At the moment the big 
problem with that is, as far as I know, there is no way in LyX to copy 
and paste the content with tracked changes. Though I think that could be 
fixed:


http://www.lyx.org/trac/ticket/10770

Daniel


Re: Is it possible to apply document defaults

2017-10-31 Thread Richard Heck
On 10/31/2017 03:44 PM, racoon wrote:
> On 25.10.2017 22:07, Richard Heck wrote:
>> On 10/24/2017 09:37 AM, racoon wrote:
>>> Hi
>>>
>>> I know of the "Save as Document Defaults" in the document settings.
>>> What it seems to do is create a default document with preferences that
>>> is loaded when one creates a new document.
>>>
>>> However, if I have created a number of documents using those defaults
>>> and discover that I would like to have something differently, is it
>>> possible not only to save the new settings to the defaults for new
>>> documents but also apply those defaults withing other already existing
>>> documents?
>>>
>>> I guess I am missing an "Apply Document Defaults" button in settings.
>>> But maybe there is a different way in LyX to do this.
>>
>> There's no way in LyX to do this, but the fact that LyX files are just
>> text files makes it easy to do outside LyX. One option is to write a
>> really basic filter and then run it on your files. For example, if you
>> wanted to use refstyle, whereas you hadn't previously, you could just
>> do:
>>  perl -ibak -pe 's/\\use_refstyle 0/\\use_refstyle 1/' *.lyx
>> Of course, if it's just that one thing to change, that's maybe not so
>> helpful. But if there were several changes
>>
>> Many people use similar techniques to make all kinds of changes to LyX
>> files. Just as an example, I'm attaching a Perl script I used a little
>> while ago to change all citations to a particular book to citealias-type
>> citations. I prefer to write these things in Perl, since it was more or
>> less designed for this sort of thing. But you could also do it in
>> Python, of course, or sed or awk, if you're really masochistic.
>
> Thanks Richard. I will have to look into it when my changes to the
> default get too many to keep track of them and do them manually for
> all the older documents. But wouldn't this be a nice feature to have
> in LyX right next to the Save Defaults button? Maybe your script could
> be used for that?

It's a reasonable request. Note, however, that it would essentially
involve replacing all the Document settings, at least if we really want
to use the defaults.

Actually, come to think of it, here's another way to do it: Create a new
document; cut and paste the content of the old one.

Richard



Re: Is it possible to apply document defaults

2017-10-31 Thread racoon

On 25.10.2017 22:07, Richard Heck wrote:

On 10/24/2017 09:37 AM, racoon wrote:

Hi

I know of the "Save as Document Defaults" in the document settings.
What it seems to do is create a default document with preferences that
is loaded when one creates a new document.

However, if I have created a number of documents using those defaults
and discover that I would like to have something differently, is it
possible not only to save the new settings to the defaults for new
documents but also apply those defaults withing other already existing
documents?

I guess I am missing an "Apply Document Defaults" button in settings.
But maybe there is a different way in LyX to do this.


There's no way in LyX to do this, but the fact that LyX files are just
text files makes it easy to do outside LyX. One option is to write a
really basic filter and then run it on your files. For example, if you
wanted to use refstyle, whereas you hadn't previously, you could just do:
     perl -ibak -pe 's/\\use_refstyle 0/\\use_refstyle 1/' *.lyx
Of course, if it's just that one thing to change, that's maybe not so
helpful. But if there were several changes

Many people use similar techniques to make all kinds of changes to LyX
files. Just as an example, I'm attaching a Perl script I used a little
while ago to change all citations to a particular book to citealias-type
citations. I prefer to write these things in Perl, since it was more or
less designed for this sort of thing. But you could also do it in
Python, of course, or sed or awk, if you're really masochistic.


Thanks Richard. I will have to look into it when my changes to the 
default get too many to keep track of them and do them manually for all 
the older documents. But wouldn't this be a nice feature to have in LyX 
right next to the Save Defaults button? Maybe your script could be used 
for that?


Daniel



Richard

PS The cite*alias commands are supported by an updated citeengine I
wrote, which I've also attached, again as an example. If you search for
"alias" you'll find what I added.

(which I'd written a new citeengine file to support, also attached, also
as an example).






Re: Is it possible to apply document defaults

2017-10-30 Thread racoon



On 30.10.2017 18:43, Jürgen Spitzmüller wrote:
2017-10-30 16:40 GMT+01:00 racoon >:


On 30.10.2017 18:37, Jürgen Spitzmüller wrote:

2017-10-30 16:32 GMT+01:00 racoon:

     "Use Class Defaults" seems not to do anything. What is it
supposed
     to do?


It should reset the document settings to the defaults.


That could mean to the defaults I saved or the defaults that LyX
came with out of the box. Anyway, it does neither.


No, sorry, it resets to the document class's defaults, so it is 
unrelated to what you want.


Does that explain why it seems to do nothing at my side?



Jürgen


Daniel



Jürgen


     Daniel


         Jürgen


             Best,
             Daniel







Re: Is it possible to apply document defaults

2017-10-30 Thread Jürgen Spitzmüller
2017-10-30 16:40 GMT+01:00 racoon :

> On 30.10.2017 18:37, Jürgen Spitzmüller wrote:
>
>> 2017-10-30 16:32 GMT+01:00 racoon:
>>
>> "Use Class Defaults" seems not to do anything. What is it supposed
>> to do?
>>
>>
>> It should reset the document settings to the defaults.
>>
>
> That could mean to the defaults I saved or the defaults that LyX came with
> out of the box. Anyway, it does neither.
>

No, sorry, it resets to the document class's defaults, so it is unrelated
to what you want.

Jürgen


>
> Daniel
>
>
>
>> Jürgen
>>
>>
>> Daniel
>>
>>
>> Jürgen
>>
>>
>> Best,
>> Daniel
>>
>>
>>
>>
>>


Re: Is it possible to apply document defaults

2017-10-30 Thread racoon

On 30.10.2017 18:37, Jürgen Spitzmüller wrote:

2017-10-30 16:32 GMT+01:00 racoon:

"Use Class Defaults" seems not to do anything. What is it supposed
to do?


It should reset the document settings to the defaults.


That could mean to the defaults I saved or the defaults that LyX came 
with out of the box. Anyway, it does neither.


Daniel



Jürgen


Daniel


Jürgen


Best,
Daniel






Re: Is it possible to apply document defaults

2017-10-30 Thread Jürgen Spitzmüller
2017-10-30 16:32 GMT+01:00 racoon:

> "Use Class Defaults" seems not to do anything. What is it supposed to do?
>

It should reset the document settings to the defaults.

Jürgen


>
> Daniel
>
>
>> Jürgen
>>
>>
>>> Best,
>>> Daniel
>>>
>>
>
>


Re: Is it possible to apply document defaults

2017-10-30 Thread racoon

On 26.10.2017 13:02, Jürgen Spitzmüller wrote:

Am Dienstag, den 24.10.2017, 16:37 +0300 schrieb racoon:

Hi

I know of the "Save as Document Defaults" in the document settings.
What
it seems to do is create a default document with preferences that is
loaded when one creates a new document.

However, if I have created a number of documents using those
defaults
and discover that I would like to have something differently, is it
possible not only to save the new settings to the defaults for new
documents but also apply those defaults withing other already
existing
documents?

I guess I am missing an "Apply Document Defaults" button in
settings.
But maybe there is a different way in LyX to do this.


So "Use Class Defaults" (the button left to the one you mention) is not
what you mean?


"Use Class Defaults" seems not to do anything. What is it supposed to do?

Daniel



Jürgen



Best,
Daniel





Re: Is it possible to apply document defaults

2017-10-26 Thread Jürgen Spitzmüller
Am Dienstag, den 24.10.2017, 16:37 +0300 schrieb racoon:
> Hi
> 
> I know of the "Save as Document Defaults" in the document settings.
> What 
> it seems to do is create a default document with preferences that is 
> loaded when one creates a new document.
> 
> However, if I have created a number of documents using those
> defaults 
> and discover that I would like to have something differently, is it 
> possible not only to save the new settings to the defaults for new 
> documents but also apply those defaults withing other already
> existing 
> documents?
> 
> I guess I am missing an "Apply Document Defaults" button in
> settings. 
> But maybe there is a different way in LyX to do this.

So "Use Class Defaults" (the button left to the one you mention) is not
what you mean?

Jürgen

> 
> Best,
> Daniel
> 

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


Re: Is it possible to apply document defaults

2017-10-25 Thread Richard Heck
On 10/24/2017 09:37 AM, racoon wrote:
> Hi
>
> I know of the "Save as Document Defaults" in the document settings.
> What it seems to do is create a default document with preferences that
> is loaded when one creates a new document.
>
> However, if I have created a number of documents using those defaults
> and discover that I would like to have something differently, is it
> possible not only to save the new settings to the defaults for new
> documents but also apply those defaults withing other already existing
> documents?
>
> I guess I am missing an "Apply Document Defaults" button in settings.
> But maybe there is a different way in LyX to do this.

There's no way in LyX to do this, but the fact that LyX files are just
text files makes it easy to do outside LyX. One option is to write a
really basic filter and then run it on your files. For example, if you
wanted to use refstyle, whereas you hadn't previously, you could just do:
    perl -ibak -pe 's/\\use_refstyle 0/\\use_refstyle 1/' *.lyx
Of course, if it's just that one thing to change, that's maybe not so
helpful. But if there were several changes

Many people use similar techniques to make all kinds of changes to LyX
files. Just as an example, I'm attaching a Perl script I used a little
while ago to change all citations to a particular book to citealias-type
citations. I prefer to write these things in Perl, since it was more or
less designed for this sort of thing. But you could also do it in
Python, of course, or sed or awk, if you're really masochistic.

Richard

PS The cite*alias commands are supported by an updated citeengine I
wrote, which I've also attached, again as an example. If you search for
"alias" you'll find what I added.

(which I'd written a new citeengine file to support, also attached, also
as an example).



citealias.pl
Description: Perl program
# \DeclareLyXCiteEngine[natbib.sty]{Natbib (Modified)}
# DescriptionBegin
#   Natbib supports a range of both author-year and numerical styles mainly
#   aimed at the Humanities. It features automatic sorting and merging of
#   numerical citations, annotations, capitalization of the `van' part of
#   author names, shortened and full author lists, and more.
# DescriptionEnd

# Author: Julien Rioux 

Format 63

Requires natbib

# The framework (biblatex|bibtex)
CiteFramework bibtex

# Cite style variants (default|authoryear|natbib)
# We provide both authoryear and numerical citations
CiteEngineType authoryear|numerical

# Default style files for either engine type
DefaultBiblio  authoryear:plainnat|numerical:plainnat

# Maximum number of names before "et al." chimes in
MaxCiteNames 2


# The syntax of the cite command definitions below is:
# LyXName|alias*[][]=latexcmd
# 
# * LyXName:  The LyX name as output in the LyX file. For
# portability reasons, we try to use the same
# name for same-formatted commands in the
# different engines (thus many names stem from
# natbib).
# * Alias:A (comma-separated) list of commands that fall
# back to the given LyX name in the current engine.
# This is a bit like "ObsoletedBy" in the layouts.
# * latexcmd: The actual LaTeX command that is output.
#
# Alias and latexcmd are optional. If no latexcmd is given, the
# LyXName will be output to LaTeX.
#
# Note further:
#
# * The LyXName "keyonly" has a special meaning: only the citation key,
#   without any latex command, is output.
# * Capitalization indicates that the command also has a capitalized
#   form (\Latexcmd vs. \latexcmd). These usually enforce upcasing of
#   name prefixes (von Goethe => Von Goethe).
# * Brackets [] indicate the number of optional arguments (0, 1, 2).
# * The star * indicates there is a starred version of the command
#   (\latexcmd* vs. \latexcmd). By default, the starred version means:
#   Expand the author list even if the maxnames setting would cause
#   BibTeX/Biber to shorten it with "et al.".
#   If the star has a different meaning for a command, it can be
#   specified in angle brackets: .
#   Maximal two translatable macro keywords, marked by the prefix '!_',
#   can be given. The first points to the string that replaces the
#   "Full aut&hor list" checkbox label in the Citation dialog, the
#   second one an optional tooltip for this checkbox. Note that these
#   two macros have to be defined in the CiteFormat section (see below),
#   dropping the '!' from the prefix (see below), e.g.:
#   _stardesc Starred command label
#   _stardesctooltip Tooltip for the starred command checkbox.

#
# CITE COMMAND DEFINITIONS for either engine type
#
CiteEngine authoryear
Citet*[][]
Citep*[][]
Citealt*[][]
Citealp*[][]
Citeauthor*[]
citeyear[]
citeyearpar[][]
citetalias[][]
citepalias[][]
nocite
keyonly
End

CiteEngine numerical
Citep*[][]
Citealp*[][]
Citet*[][]
Citealt*[][]

Is it possible to apply document defaults

2017-10-25 Thread racoon

Hi

I know of the "Save as Document Defaults" in the document settings. What 
it seems to do is create a default document with preferences that is 
loaded when one creates a new document.


However, if I have created a number of documents using those defaults 
and discover that I would like to have something differently, is it 
possible not only to save the new settings to the defaults for new 
documents but also apply those defaults withing other already existing 
documents?


I guess I am missing an "Apply Document Defaults" button in settings. 
But maybe there is a different way in LyX to do this.


Best,
Daniel