Cite push command broken

Hello everyone,

I am using the push command to push my selected source from JabRef to Texstudio.
I have configured the command to push “\autocite[nach][Seite X]{key1,key2}”.
This has worked some months ago but today he always push it wrong as: “\cite{\autocite[nach][Seite X]{Schmith2019}}.”
How to get \cite{ } around my command away?

Thanks!

@flo Which version of JabRef are you using and have you checked your settings?
Did you recently update JabRef?

Hi, these are my version information:
JabRef 5.15–2024-07-10–1eb3493
Windows 11 10.0 amd64
Java 21.0.2
JavaFX 22.0.1+7

I think I have updated it.

The settings are correct: \autocite[nach][Seite X]{key1,key2} The result not.

I can confirm that it does not work with 5.15 and TeXstudio 4.8.1 (git 4.8.1).

Which of these two tools did you update? JabRef or TeXstudio?

  • I tried with JabRef 5.14 and JabRef 5.15 with TeXstudio 4.8.1. Did not work.
  • JabRef 5.14 and TeXsutio 4.8.4 does not work.
  • JabRef 5.9 and TeXsutio 4.8.4 does not work.

I tried with the development version.

  • Setting \cite{key1,key2}: works both plain (as new \cite) and adding to an existing \cite
  • Setting \autocite{key1,key2} works plain
  • Setting \autocite[nach][Seite X]{key1,key2} does not work.

Great finding that my special way of citing is not working. Thanks! I confirm your observation.
I have updated for sure TeXstudio but I believe, JabRef, too. I do not believe it is a problem of TeXstudio because this function looks for my like a copy and paste or autotyping function. TeXstudio is not using any intelligence to process this command. But maybe it does. We might see it in the source code of JabRef how JabRef is addressing TeXstudio. Is it visible in the source code?

@flo The command is assembled here jabref/src/main/java/org/jabref/gui/push/PushToTeXstudio.java at 9d9a251b2ccb956e413ed6d9f242c48484db8554 · JabRef/jabref · GitHub

@flo What Christoph meant: It would help if you yould open a cmd.exe and execute the --insert-cite command manually and check whether it works.

It should be --insert-cite \autocite[nach][Seite X]{key1,key2}.

I tried it

"C:\Program Files\texstudio\texstudio.exe" --insert-cite "\autocite[nach][Seite X]{key1,key2}"

Result:

\cite{\autocite[nach][Seite X]{key1,key2}}

I checked

https://htmlpreview.github.io/?https://github.com/texstudio-org/texstudio/master/utilities/manual/usermanual_en.html

"C:\Program Files\texstudio\texstudio.exe" --insert-cite "\mycite{key2}"

Works

"C:\Program Files\texstudio\texstudio.exe" --insert-cite "\mycite[nach]{key2}"

Does not.

Thus, please, open an issue at issue tracker of TeXStudio (Issues · texstudio-org/texstudio · GitHub).

I searched for “–insert-cite” there - and no relevent issues popped up.

Hi, ok, CMD is the same situation. Then it might be a problem of TeXstudio?

1 Like

It might be related to the square brackets, they need to be escaped as well at least this would explain it:

[ 	\[
] 	\]

https://www.robvanderwoude.com/escapechars.php

Can you try this on the command line?
@koppor

@Siedlerchr You mean

 "C:\Program Files\texstudio\texstudio.exe" --insert-cite "\mycite\[nach\]{key2}"

Result:

\cite{\mycite\[nach\]{key2}}

Yes. Therefore I wrote