-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The placeholder %OUTDIR% on Windows #2010
Comments
I guess there is something wrong here, the line should instead read return path.normalize(out).split(path.sep).join('/') We do want output paths to always use |
With the commit, 9ca0c06, {
"latex-workshop.latex.recipes": [
{
"name": "latexmk_copy",
"tools": ["latexmk", "copyPDF"]
}
],
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {}
},
{
"name": "copyPDF",
"command": "cmd.exe",
"args": ["/C", "copy", "\"%OUTDIR%/%DOCFILE%.pdf\"", "\"%OUTDIR%/b.pdf\""],
"env": {}
}
]
} |
We can try the recipe on GitHub Actions. See |
I missed that point. This is indeed an issue. Short summary
It seems to me that LaTeX-Workshop/src/components/builder.ts Lines 514 to 529 in 933f095
So I would be tempted to do the same for |
As far as I tried, on the command prompt of Windows, the following works well with forward slashes (double quotes are necessary):
I do not know why the recipe does not work. |
An easy solution is providing placeholders with backward slashes, |
That's for sure. It might be related to nodejs/node-v0.x-archive#25895 (comment) |
I think the explanation is nodejs/node#5060 (comment) All this is related to the way arguments to where As a conclusion of all this, I would be tempted to use |
@tamuratak What do you think of this? |
My main concern is that there might be a case So, if |
One example I am considering is a recipe using a quote, |
OK to later add
|
I have a question. Do users who are already using recipes with |
The use of
No I do not think so. My understanding is that everything that already works with |
It seems that everything works well with {
"latex-workshop.latex.recipes": [
{
"name": "latexmk_copy",
"tools": ["latexmk", "copyPDF"]
}
],
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-e",
"$latex=q/pdflatex %O -synctex=1 -interaction=nonstopmode -file-line-error %S/",
"-e",
"$pdflatex=q/pdflatex %O -synctex=1 -interaction=nonstopmode -file-line-error %S/",
"-outdir=%OUTDIR%",
"-pdf",
"%DOC%"
],
"env": {}
},
{
"name": "copyPDF",
"command": "copy",
"args": ["%OUTDIR%/t.pdf", "%OUTDIR%/b.pdf"],
"env": {}
}
]
} https://github.com/jlelong/LaTeX-Workshop/actions/runs/67671244 passed If you have a look at master...jlelong:test-cmd-exe, you will see that the only meaningful changes to make all this work are
|
Also use cross-spawn for calling texdoc. Related to #2010
See https://github.com/James-Yu/LaTeX-Workshop/wiki/Compile#placeholders for the definitions of the new placeholders. |
[Edit] I have found that |
Correct, this is only used to launch the external viewer. I do not know if this feature is much used but Indeed, we still use LaTeX-Workshop/src/components/locator.ts Lines 427 to 446 in 0d64561
|
@jlelong I ask you a question on the placeholder,
%OUTDIR%
, on Windows. In the currentmaster
branch, backward slashes are used in%OUTDIR%
on Windows since path.normalize replace forward slashes with backward slashes on Windows. Is this an intended behavior?LaTeX-Workshop/src/components/manager.ts
Line 82 in bce11da
We can see the behavior of
path.normalize
on Windows by callingpath.win32.normalize
on other platforms.Related to #1897, #1904, and #1947.
The text was updated successfully, but these errors were encountered: