I have found the solution after some experimentation.
If the output PDF file is prefixed by a word [solved]
and space (i.e. [solved]~<\jobname>.pdf
), the command should be
"C:\Program Files\SumatraPDF\SumatraPDF.exe" -reuse-instance
-inverse-search ""C:/Program Files (x86)/texstudio/texstudio.exe" "%%f" -line %%l" ?a"[solved]" ?m.pdf
On the other hand, if it is appended by a space and a word [solved]
(i.e. <\jobname>~[solved].pdf
), the command should be
"C:\Program Files\SumatraPDF\SumatraPDF.exe" -reuse-instance
-inverse-search ""C:/Program Files (x86)/texstudio/texstudio.exe" "%%f" -line %%l" "?am ?"[solved]".pdf"
The key note here is to understand that a space
is a terminating character, which needs to have a following ?
in order to use further selectors/pathname parts/terminating characters.
For TeXstudio v3.0, unknowingly, the syntax of the first case has to be slightly modified to be
"C:\Program Files\SumatraPDF\SumatraPDF.exe" -reuse-instance
-inverse-search ""C:/Program Files (x86)/texstudio/texstudio.exe" "%%f" -line %%l" ?a"[solved]" "?m".pdf
