Push to TeXShop (mac)?

Hello:

Is it possible to push citations to TeXShop on the mac?

Thanks.

Nobody replied after so long?

Hi,

Currently, it’s not possible. Integration could be possible if the program supports command line arguments or another option to insert content at the cursor’s position.

I checked the website but could not find any documentation. To implement this feature we would need some more information.

TeXShop supports Apple talk. If JabRef can push some Apple talk code (e.g. via underlying bash or any other system) you can open a channel in which you funnel references to TeXShop.

The developer of TeXShop can tell better of course.

@foice Thanks, that sounds helpful. Calling the commandline and executing command is what we bascially do for other editors as well, for example for sublime.

If you have an example command that would be very helpful

The author has emailed me some code with instructions

  1. The following shell script, run say in /usr/local/bin, asks TeXShop to insert a string
    at the current cursor location of the front document:
#!/bin/tcsh

osascript  <<EndOfScript

tell application "TeXShop"
activate
set TheString to "$1"
set content of selection of front document to TheString
end tell
EndOfScript
  1. Thus if the shell script is named jabref, you can send the string “this is new information” to TeXShop
    with the command
/usr/local/bin/jabref "this is new information"

Feel free to reach out to Richard, just look for the contact link in the TeXShop webpage.

1 Like

Ah thank you very much! I will try to integrate this.

@Samarth_Swarup Using the provided script from @foice I was now able to integrate TeXShop.
Tested it on my machine, works fine so far.

You can test the version from here:

Currently, it’s just showing a generic icon. We have to ask the author if he grants us special rights to integrate the Logo in our application, as the source code of TeXShop is GPL licensed and therefore incompatible with JabRef’s MIT license or someone has to recreate it from scratch.

This is great! It is almost working. When I try it, it is putting the word ‘null’ before and after the citationkey in TeXShop. For example, if the citation key is abc, it gets pushed to TeXShop as nullabcnull.

Hi,

Thanks for the feedback. There was an issue with correct escaping of the cite command.
A new version is available on the same link. Please also verify that the cite command in the preferences looks like this \cite{key1,key2}
We recently improved the pattern handling (e.g. to support markdown cite commands)

For me, it works that way correctly:

It’s working beautifully now. Thanks @foice and @Siedlerchr! You all made my day!

1 Like

Is there still an issue with the icon? I cannoy check right now, but wanted to understand if the icon still needs work.

@foice Yes. JabRef has a special “font” where the Logo needs to be added. I recently did that for Sublime text as well.

We would need the SVG logo under a license that is compatible with JabRef’s MIT license. TeXShop is licensed under GPL, and therefore we cannot use or modify the existing one.
However, except if someone recreates this from scratch under a free license it would be fine.

I’m happy JabRef is working on TeXShop, and will certainly give permission
to use the TeXShop Icon. Feel free to contact me through my web page,
Richard Koch Home Page
if more coordination is needed.

Richard Koch

1 Like

Thanks a lot! Then we will use the icon and adjust it to so that if fits

The latest development version now also contains an appropriate icon:

Thanks again for sending me the logo files @RichardKoch

1 Like

This feature works like a charm if the cite is command is:

\cite{key1,key2}

What I would like to have is:

~\cite{key1,key2}

Adding the tilde sign seems to break the feature, though. No citation is inserted in TeXShop.

Is there a smart workaround for this? Thanks!

@Iodine Hi thanks for bringing this to our attention, I found the issue in the code and made the escaping code more robust.

(A download link will be there, and it will then subsequently land in the latest dev version after merge)

1 Like

I have also observed that this:

\textcite[][]{key1,key2}

used to work fine for a while but is now inserted as:

\cite{\textcite[][]{key1,key2}}

Is this also due to the escaping of characters?

Are you sure you are using the latest development version and your cite command is set up correctly?
Because for me, it works fine:
e.g.
\textcite[][]{GarridoKallstromKummEtAl2016}