Jump to content

Recommended Posts

Andrew, 

 

Oh, I see what you mean. I'll think about whether using BibDesk is worth the time savings at this point.

 

Thanks for you help and advice!

 

Katie  :)

Share this post


Link to post

Katie I looked at implementing your requests, and unfortunately it is not an easy change.  I'm using an existing API to grab formatted references, and it actually doesn't return HTML tags for italicizing.  The searching part of the script does, but that data is not in APA format.  Once you request the data in APA format it just returns plain text.  The en-dash issue is an encoding issue, and it seems to also be a problem with the API.  

 

To do what you are hoping for in this request (and in the second request) would require incorporating a reference converter within the Alfred workflow.  That's something I might think about down the road.  But for now, I verified that if you first import into BibTeX it will properly italicize the journal name, display the en-dash correctly, and will work with any of the methods and not just "ref".

Share this post


Link to post

Thanks for checking, Andrew!

 

It sounds like a lot of work and, given that the benefits are so minimal, I can see that it's not worthwhile. But I appreciate you looking into it!

 

I tried importing a reference into BibDesk with your workflow and it was incredibly easy. Haven't been able to set up the APA export though. I've installed tex, set the preview to apalike, tried setting it to copy as RTF. To get the reference to copy in the way you describe, did you have to use a custom template? For those out there who are new to BibDesk and want to take advantage of this workflow, this is how to get APA styled ref's from BibDesk:

 

1. Create an rtf file from one of the styles templates found at http://sourceforge.net/apps/mediawiki/bibdesk/index.php?title=Templates

2. To get the italicized text, etc. You have to italicize the corresponding fields in the rtf file you just made. 

3. Add it as a template, then choose to "copy" as your template in the pref's. 

 

It took me a while to figure it out but it's really not that bad. I think I'm going to love BibDesk.

 

Katie

 

Edit: Maybe it's no so straightforward as I thought. I'm trying to import this ref (http://bit.ly/1i4syOB) to BibDesk using the book keyword. But nothing is copied to the clipboard or added to BibDesk.

Edited by katie

Share this post


Link to post

First, the problem you had with the specific book you were looking for---you uncovered a bug.  These encoding issues are a pain sometimes.  Anyway, it's fixed and on GitHub.

 

For the rich text copying, I'm glad you found something that worked for you.  I realized after your comment, that it wasn't working for me either.  I was only looking at the TeX preview, which renders correctly, and calling it done.  Because I write all my documents in LaTeX, I've never actually tried doing a rich text copy and paste.  I tested some things out, and came across the template solution you mentioned.  However, I found that didn't work very well for some references, for example if the reference contained non-ascii characters, or escaped an ampersand LaTeX style, etc.  Instead, I came across this thread and noticed others were having the same problem, and found an alternative solution.  You first need to into Preferences > TeX Preview > TeX Template and add these two lines:

 

\usepackage{lmodern}  
\usepackage[T1]{fontenc}
 
The first changes the font so that the rich text will be preserved on copy paste (you also need to install the Latin Modern fonts if you don't already have them on your system.  Go into the opentype folder after downloading and drag them all into Font Book).  The second line allows you to properly copy/paste accented characters.  After all that, copy rich text now works.  Of course the font will be in Latin Modern, but you can now change it to whatever font, and the formatting will be preserved.

Share this post


Link to post

After your comment, I checked the template I had set up and you're absolutely right - all accented characters (and perhaps other characters) are not rendered properly. Thanks to your clear instructions, I set up your alternative method, and I can now copy and paste from the preview. The idea that the rtf template method doesn't work as expected, however, is just the kind of thing that will niggle at me until I figure out how to fix it  :) This type of issue is why I've avoided latex - the "brief" start I made had me spending hours trying to work out the smallest of details. This is my method of procrastination. 

 

Thanks for your help setting up BibDesk!!

Share this post


Link to post

Might be a good idea to add in some sort of error reporting for when the crossref API goes down, which seems to happen fairly often (e.g. today). :) Otherwise the workflow just does nothing.

Share this post


Link to post

walton, if you could provide me an error log for when this happens that would be helpful.  It's never happened to me so it's hard for me to catch the error (I guess I don't use it often enough).

Share this post


Link to post

I am not seeing any errors. It just sort of hangs and never does anything. I tried turning on debugging in the Alfred Workflows panel and nothing shows up.

Share this post


Link to post

Wow. This is fucking incredible. Words cannot express how thankful I am to you for making this workflow.

 

There's just one thing though… is there any way I can set the import reference file action to use scholar (gsref) rather than crossref? This might have to do with my field of study (computational linguistics), but scholar is much faster and more reliable for me.

 

Thanks again!

Share this post


Link to post

Two options:

1) the file action doesn't actually execute the crossref command, so you can always hit the HOME button and add a 'gs' before hitting enter.  It purposely doesn't try to automatically execute the command so that you can change the search type, and because the file action uses some heuristics and may not necessarily grab all the right keywords that you want.

2) Open up pdf2doi.py in the workflow and in line 54 replace 'ref' with 'gsref'.  Of course this will get overwritten with app updates.  If this becomes an issue I could add an option where the default search for the file action would be loaded from a config file or something.

Share this post


Link to post

I was doing 1, but…unnecessary keystrokes, you know how it is.

 

I actually just changed the keywords ref→cref and gsref→ref, since I use the scholar search more often any way.

Share this post


Link to post

Yeah, I know what you mean.  The extra keystrokes would drive me crazy also.  

 

Changing keywords is another good option.  If this is something folks are interested in, perhaps I'll just add a config file so you can set your preference.

Share this post


Link to post

I've reported it on the developer's GitHub repo for the workflow & he is going to give it a few days to see if it's a temporary outage, then start looking at alternatives.

 

FWIW the book command is still working.  

Share this post


Link to post

Thank you; I will try that! Just spent a good chunk of time doing this manually. 

 

Edit: And it works! I must have missed an update. This is literally the best day ever. 

Edited by katie

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...