Quantcast

Further template questions

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Further template questions

Jan David Hauck
Hi again,

my apologies for all the emails to the list, while figuring out my own project. I hope it'll be useful for someone else too.  And many thanks to Christiaan and Jan Jakob for all the hints (now and in the past)!   I hope this will be the last inquiry for a while. 

So at the risk of exhausting everyone's patience, just to follow up on the previous discussion four last additional questions:

(1)  First of all, is there a way to use Christiaan's Capitalize script (which does essentially what I want) not for actually changing the data but to copy a modified template to the clipboard?    Jan Jakob posted a script here a while ago that does that for typographic quotation marks, and it should be possible to do that in a similar way for capitalization, but I'm a little lost how to start.

(2)
Concerning typographic quotation marks:
I realized that whenever I enter a typographic quotation mark into a field BibDesk automatically translates it into ` or ' and `` or ''.  Is there a way (via template or script or whatever) to have BibDesk translate them into typographic ones for display in the Preview window? 
(I had asked a similar question before, but I was wondering, since characters with diacritics are also stored in the file in actual Tex Format, but displayed by BibDesk in the field [and hence in the template] normally, maybe there is a specific format in which to store quotation marks so that they behave the same?) 

(3)
This is not directly BibDesk related, but maybe one of the experts here has an idea nonetheless:
Most of what I write has to be in either Chicago or AAA style, and although they are fairly similar there is one crucial difference in that Chicago encloses Article and Chapter titles in quotation marks while AAA does not.
And in Chicago quotation marks that are embedded within quotation marks are converted to ‘single’ quotation marks.
So now I have a problem if the Title of a given article already has a word or phrase in quotation marks, how to convert those quotation marks to single quotation marks without changing the entry since for my other style I need them as they were.
Author. 1995. “Here is a ‘term’ in quotation marks.” ...  <=  Chicago style
Author. 1995. Here is a “term” in quotation marks. ...  <=  AAA style
I'm probably looking for something that behaves like the \emph{}  in Tex but for quotation marks ...
Any ideas?

(4)
Speaking of \emph{}.  Is there a way to have a BibDesk template actually use Tex markers that are in the fields?  I.e., put \emph{} enclosed terms in italics and the like. 

(I know I could very easily do this by simply displaying the template using Tex, but I am creating a database for my fiancee who doesn't have Tex but wants to use BibDesk nonetheless. Hence all these question that would be easier to achieve by using Tex directly.)

Any help is greatly appreciated!

Thanks in advance!

Jan D.



------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Further template questions

Christiaan Hofman

On Jan 25, 2015, at 0:08, Jan David Hauck wrote:

Hi again,

my apologies for all the emails to the list, while figuring out my own project. I hope it'll be useful for someone else too.  And many thanks to Christiaan and Jan Jakob for all the hints (now and in the past)!   I hope this will be the last inquiry for a while. 

So at the risk of exhausting everyone's patience, just to follow up on the previous discussion four last additional questions:

(1)  First of all, is there a way to use Christiaan's Capitalize script (which does essentially what I want) not for actually changing the data but to copy a modified template to the clipboard?    Jan Jakob posted a script here a while ago that does that for typographic quotation marks, and it should be possible to do that in a similar way for capitalization, but I'm a little lost how to start.

(2)
Concerning typographic quotation marks:
I realized that whenever I enter a typographic quotation mark into a field BibDesk automatically translates it into ` or ' and `` or ''.  Is there a way (via template or script or whatever) to have BibDesk translate them into typographic ones for display in the Preview window? 
(I had asked a similar question before, but I was wondering, since characters with diacritics are also stored in the file in actual Tex Format, but displayed by BibDesk in the field [and hence in the template] normally, maybe there is a specific format in which to store quotation marks so that they behave the same?) 

(3)
This is not directly BibDesk related, but maybe one of the experts here has an idea nonetheless:
Most of what I write has to be in either Chicago or AAA style, and although they are fairly similar there is one crucial difference in that Chicago encloses Article and Chapter titles in quotation marks while AAA does not.
And in Chicago quotation marks that are embedded within quotation marks are converted to ‘single’ quotation marks.
So now I have a problem if the Title of a given article already has a word or phrase in quotation marks, how to convert those quotation marks to single quotation marks without changing the entry since for my other style I need them as they were.
Author. 1995. “Here is a ‘term’ in quotation marks.” ...  <=  Chicago style
Author. 1995. Here is a “term” in quotation marks. ...  <=  AAA style
I'm probably looking for something that behaves like the \emph{}  in Tex but for quotation marks ...
Any ideas?

(4)
Speaking of \emph{}.  Is there a way to have a BibDesk template actually use Tex markers that are in the fields?  I.e., put \emph{} enclosed terms in italics and the like. 

(I know I could very easily do this by simply displaying the template using Tex, but I am creating a database for my fiancee who doesn't have Tex but wants to use BibDesk nonetheless. Hence all these question that would be easier to achieve by using Tex directly.)

Any help is greatly appreciated!

Thanks in advance!

Jan D.


There is some very basic interpretation of some tex commands. But it is very limited, and don't count on too much. We cannot provide a full tex interpreter, which is a very complex program. IIRC you cannot convert (double) quotations (only from special to TeX compatible. This is not even well defined, as there are many different double and single quotation marks. It certainly cannot be done in a way as complex as (3). Also, (1) will never work because there is no way to know what part of some random text is a title and what is not (note that any post processing comes after the text has been generated). So I am afraid the answer to all your questions is no.

Christiaan


------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Further template questions

Jan David Hauck
Thank you for your reply Christiaan,
yeah, I imagined it's probably not going to work without Tex. Oh well.

Now two last questions on this:

Is there any way to have BibDesk retain typographic quotation marks in the fields as they are?
Or, alternatively, is there a way to modify the script Jan Jakob's script that he posted here a while ago (see below) so that it retains formatting?  It transforms the quotation marks but unfortunately loses italic formatting for Titles ...

And: except for using Tex is there any other way to have BibDesk format parts of a title as italic or non italic? 

Any help greatly appreciated,

Jan




set theTemplate to "Template"

tell document 1 of application "BibDesk"
   
    set thePublications to the selection
    set theCitation to (templated text using theTemplate for thePublications)
   
    set theCitation to my replaceString(theCitation, "`", "‘")
    set theCitation to my replaceString(theCitation, "'", "’")
    set theCitation to my replaceString(theCitation, "``", "“")
    set theCitation to my replaceString(theCitation, "''", "”")
    set theCitation to my replaceString(theCitation, "\"", "”")
    set the clipboard to theCitation
   
end tell

# http://applescript.bratis-lover.net/library/string/#replaceString

on replaceString(theText, oldString, newString)
    local ASTID, theText, oldString, newString, lst
    set ASTID to AppleScript's text item delimiters
    try
        considering case
            set AppleScript's text item delimiters to oldString
            set lst to every text item of theText
            set AppleScript's text item delimiters to newString
            set theText to lst as string
        end considering
        set AppleScript's text item delimiters to ASTID
        return theText
    on error eMsg number eNum
        set AppleScript's text item delimiters to ASTID
        error "Can't replaceString: " & eMsg number eNum
    end try
end replaceString





On Sat, Jan 24, 2015 at 3:53 PM, Christiaan Hofman <[hidden email]> wrote:

On Jan 25, 2015, at 0:08, Jan David Hauck wrote:

Hi again,

my apologies for all the emails to the list, while figuring out my own project. I hope it'll be useful for someone else too.  And many thanks to Christiaan and Jan Jakob for all the hints (now and in the past)!   I hope this will be the last inquiry for a while. 

So at the risk of exhausting everyone's patience, just to follow up on the previous discussion four last additional questions:

(1)  First of all, is there a way to use Christiaan's Capitalize script (which does essentially what I want) not for actually changing the data but to copy a modified template to the clipboard?    Jan Jakob posted a script here a while ago that does that for typographic quotation marks, and it should be possible to do that in a similar way for capitalization, but I'm a little lost how to start.

(2)
Concerning typographic quotation marks:
I realized that whenever I enter a typographic quotation mark into a field BibDesk automatically translates it into ` or ' and `` or ''.  Is there a way (via template or script or whatever) to have BibDesk translate them into typographic ones for display in the Preview window? 
(I had asked a similar question before, but I was wondering, since characters with diacritics are also stored in the file in actual Tex Format, but displayed by BibDesk in the field [and hence in the template] normally, maybe there is a specific format in which to store quotation marks so that they behave the same?) 

(3)
This is not directly BibDesk related, but maybe one of the experts here has an idea nonetheless:
Most of what I write has to be in either Chicago or AAA style, and although they are fairly similar there is one crucial difference in that Chicago encloses Article and Chapter titles in quotation marks while AAA does not.
And in Chicago quotation marks that are embedded within quotation marks are converted to ‘single’ quotation marks.
So now I have a problem if the Title of a given article already has a word or phrase in quotation marks, how to convert those quotation marks to single quotation marks without changing the entry since for my other style I need them as they were.
Author. 1995. “Here is a ‘term’ in quotation marks.” ...  <=  Chicago style
Author. 1995. Here is a “term” in quotation marks. ...  <=  AAA style
I'm probably looking for something that behaves like the \emph{}  in Tex but for quotation marks ...
Any ideas?

(4)
Speaking of \emph{}.  Is there a way to have a BibDesk template actually use Tex markers that are in the fields?  I.e., put \emph{} enclosed terms in italics and the like. 

(I know I could very easily do this by simply displaying the template using Tex, but I am creating a database for my fiancee who doesn't have Tex but wants to use BibDesk nonetheless. Hence all these question that would be easier to achieve by using Tex directly.)

Any help is greatly appreciated!

Thanks in advance!

Jan D.


There is some very basic interpretation of some tex commands. But it is very limited, and don't count on too much. We cannot provide a full tex interpreter, which is a very complex program. IIRC you cannot convert (double) quotations (only from special to TeX compatible. This is not even well defined, as there are many different double and single quotation marks. It certainly cannot be done in a way as complex as (3). Also, (1) will never work because there is no way to know what part of some random text is a title and what is not (note that any post processing comes after the text has been generated). So I am afraid the answer to all your questions is no.

Christiaan


------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Further template questions

Christiaan Hofman

On Jan 26, 2015, at 8:07, Jan David Hauck wrote:

Thank you for your reply Christiaan,
yeah, I imagined it's probably not going to work without Tex. Oh well.

Now two last questions on this:

Is there any way to have BibDesk retain typographic quotation marks in the fields as they are?

Yes, make sure you uncheck the TeX conversion option in the Files preferences.

Or, alternatively, is there a way to modify the script Jan Jakob's script that he posted here a while ago (see below) so that it retains formatting?  It transforms the quotation marks but unfortunately loses italic formatting for Titles ...


No, AppleScript can only handle unformatted text. (in any meaningful way).

And: except for using Tex is there any other way to have BibDesk format parts of a title as italic or non italic? 


No.

Christiaan

Any help greatly appreciated,

Jan




set theTemplate to "Template"

tell document 1 of application "BibDesk"
   
    set thePublications to the selection
    set theCitation to (templated text using theTemplate for thePublications)
   
    set theCitation to my replaceString(theCitation, "`", "‘")
    set theCitation to my replaceString(theCitation, "'", "’")
    set theCitation to my replaceString(theCitation, "``", "“")
    set theCitation to my replaceString(theCitation, "''", "”")
    set theCitation to my replaceString(theCitation, "\"", "”")
    set the clipboard to theCitation
   
end tell

# http://applescript.bratis-lover.net/library/string/#replaceString

on replaceString(theText, oldString, newString)
    local ASTID, theText, oldString, newString, lst
    set ASTID to AppleScript's text item delimiters
    try
        considering case
            set AppleScript's text item delimiters to oldString
            set lst to every text item of theText
            set AppleScript's text item delimiters to newString
            set theText to lst as string
        end considering
        set AppleScript's text item delimiters to ASTID
        return theText
    on error eMsg number eNum
        set AppleScript's text item delimiters to ASTID
        error "Can't replaceString: " & eMsg number eNum
    end try
end replaceString





On Sat, Jan 24, 2015 at 3:53 PM, Christiaan Hofman <[hidden email]> wrote:

On Jan 25, 2015, at 0:08, Jan David Hauck wrote:

Hi again,

my apologies for all the emails to the list, while figuring out my own project. I hope it'll be useful for someone else too.  And many thanks to Christiaan and Jan Jakob for all the hints (now and in the past)!   I hope this will be the last inquiry for a while. 

So at the risk of exhausting everyone's patience, just to follow up on the previous discussion four last additional questions:

(1)  First of all, is there a way to use Christiaan's Capitalize script (which does essentially what I want) not for actually changing the data but to copy a modified template to the clipboard?    Jan Jakob posted a script here a while ago that does that for typographic quotation marks, and it should be possible to do that in a similar way for capitalization, but I'm a little lost how to start.

(2)
Concerning typographic quotation marks:
I realized that whenever I enter a typographic quotation mark into a field BibDesk automatically translates it into ` or ' and `` or ''.  Is there a way (via template or script or whatever) to have BibDesk translate them into typographic ones for display in the Preview window? 
(I had asked a similar question before, but I was wondering, since characters with diacritics are also stored in the file in actual Tex Format, but displayed by BibDesk in the field [and hence in the template] normally, maybe there is a specific format in which to store quotation marks so that they behave the same?) 

(3)
This is not directly BibDesk related, but maybe one of the experts here has an idea nonetheless:
Most of what I write has to be in either Chicago or AAA style, and although they are fairly similar there is one crucial difference in that Chicago encloses Article and Chapter titles in quotation marks while AAA does not.
And in Chicago quotation marks that are embedded within quotation marks are converted to ‘single’ quotation marks.
So now I have a problem if the Title of a given article already has a word or phrase in quotation marks, how to convert those quotation marks to single quotation marks without changing the entry since for my other style I need them as they were.
Author. 1995. “Here is a ‘term’ in quotation marks.” ...  <=  Chicago style
Author. 1995. Here is a “term” in quotation marks. ...  <=  AAA style
I'm probably looking for something that behaves like the \emph{}  in Tex but for quotation marks ...
Any ideas?

(4)
Speaking of \emph{}.  Is there a way to have a BibDesk template actually use Tex markers that are in the fields?  I.e., put \emph{} enclosed terms in italics and the like. 

(I know I could very easily do this by simply displaying the template using Tex, but I am creating a database for my fiancee who doesn't have Tex but wants to use BibDesk nonetheless. Hence all these question that would be easier to achieve by using Tex directly.)

Any help is greatly appreciated!

Thanks in advance!

Jan D.


There is some very basic interpretation of some tex commands. But it is very limited, and don't count on too much. We cannot provide a full tex interpreter, which is a very complex program. IIRC you cannot convert (double) quotations (only from special to TeX compatible. This is not even well defined, as there are many different double and single quotation marks. It certainly cannot be done in a way as complex as (3). Also, (1) will never work because there is no way to know what part of some random text is a title and what is not (note that any post processing comes after the text has been generated). So I am afraid the answer to all your questions is no.

Christiaan


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Further template questions

Jan David Hauck
OK, I see, wonderful.

Thanks so much!



On Mon, Jan 26, 2015 at 2:10 AM, Christiaan Hofman <[hidden email]> wrote:

On Jan 26, 2015, at 8:07, Jan David Hauck wrote:

Thank you for your reply Christiaan,
yeah, I imagined it's probably not going to work without Tex. Oh well.

Now two last questions on this:

Is there any way to have BibDesk retain typographic quotation marks in the fields as they are?

Yes, make sure you uncheck the TeX conversion option in the Files preferences.

Or, alternatively, is there a way to modify the script Jan Jakob's script that he posted here a while ago (see below) so that it retains formatting?  It transforms the quotation marks but unfortunately loses italic formatting for Titles ...


No, AppleScript can only handle unformatted text. (in any meaningful way).

And: except for using Tex is there any other way to have BibDesk format parts of a title as italic or non italic? 


No.

Christiaan

Any help greatly appreciated,

Jan




set theTemplate to "Template"

tell document 1 of application "BibDesk"
   
    set thePublications to the selection
    set theCitation to (templated text using theTemplate for thePublications)
   
    set theCitation to my replaceString(theCitation, "`", "‘")
    set theCitation to my replaceString(theCitation, "'", "’")
    set theCitation to my replaceString(theCitation, "``", "“")
    set theCitation to my replaceString(theCitation, "''", "”")
    set theCitation to my replaceString(theCitation, "\"", "”")
    set the clipboard to theCitation
   
end tell

# http://applescript.bratis-lover.net/library/string/#replaceString

on replaceString(theText, oldString, newString)
    local ASTID, theText, oldString, newString, lst
    set ASTID to AppleScript's text item delimiters
    try
        considering case
            set AppleScript's text item delimiters to oldString
            set lst to every text item of theText
            set AppleScript's text item delimiters to newString
            set theText to lst as string
        end considering
        set AppleScript's text item delimiters to ASTID
        return theText
    on error eMsg number eNum
        set AppleScript's text item delimiters to ASTID
        error "Can't replaceString: " & eMsg number eNum
    end try
end replaceString





On Sat, Jan 24, 2015 at 3:53 PM, Christiaan Hofman <[hidden email]> wrote:

On Jan 25, 2015, at 0:08, Jan David Hauck wrote:

Hi again,

my apologies for all the emails to the list, while figuring out my own project. I hope it'll be useful for someone else too.  And many thanks to Christiaan and Jan Jakob for all the hints (now and in the past)!   I hope this will be the last inquiry for a while. 

So at the risk of exhausting everyone's patience, just to follow up on the previous discussion four last additional questions:

(1)  First of all, is there a way to use Christiaan's Capitalize script (which does essentially what I want) not for actually changing the data but to copy a modified template to the clipboard?    Jan Jakob posted a script here a while ago that does that for typographic quotation marks, and it should be possible to do that in a similar way for capitalization, but I'm a little lost how to start.

(2)
Concerning typographic quotation marks:
I realized that whenever I enter a typographic quotation mark into a field BibDesk automatically translates it into ` or ' and `` or ''.  Is there a way (via template or script or whatever) to have BibDesk translate them into typographic ones for display in the Preview window? 
(I had asked a similar question before, but I was wondering, since characters with diacritics are also stored in the file in actual Tex Format, but displayed by BibDesk in the field [and hence in the template] normally, maybe there is a specific format in which to store quotation marks so that they behave the same?) 

(3)
This is not directly BibDesk related, but maybe one of the experts here has an idea nonetheless:
Most of what I write has to be in either Chicago or AAA style, and although they are fairly similar there is one crucial difference in that Chicago encloses Article and Chapter titles in quotation marks while AAA does not.
And in Chicago quotation marks that are embedded within quotation marks are converted to ‘single’ quotation marks.
So now I have a problem if the Title of a given article already has a word or phrase in quotation marks, how to convert those quotation marks to single quotation marks without changing the entry since for my other style I need them as they were.
Author. 1995. “Here is a ‘term’ in quotation marks.” ...  <=  Chicago style
Author. 1995. Here is a “term” in quotation marks. ...  <=  AAA style
I'm probably looking for something that behaves like the \emph{}  in Tex but for quotation marks ...
Any ideas?

(4)
Speaking of \emph{}.  Is there a way to have a BibDesk template actually use Tex markers that are in the fields?  I.e., put \emph{} enclosed terms in italics and the like. 

(I know I could very easily do this by simply displaying the template using Tex, but I am creating a database for my fiancee who doesn't have Tex but wants to use BibDesk nonetheless. Hence all these question that would be easier to achieve by using Tex directly.)

Any help is greatly appreciated!

Thanks in advance!

Jan D.


There is some very basic interpretation of some tex commands. But it is very limited, and don't count on too much. We cannot provide a full tex interpreter, which is a very complex program. IIRC you cannot convert (double) quotations (only from special to TeX compatible. This is not even well defined, as there are many different double and single quotation marks. It certainly cannot be done in a way as complex as (3). Also, (1) will never work because there is no way to know what part of some random text is a title and what is not (note that any post processing comes after the text has been generated). So I am afraid the answer to all your questions is no.

Christiaan


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Loading...