You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for creating this project. Over the past few days, I had a chance to go through some portion of the code and realise how much work went into it.
Recently, I am using latexmk with a .latexmkrc file, mainly to have a relatively tidy project root directory. I have noticed that TexLab has been improving support for .latexmkrc, still I came across a few issues. I am listing a couple of them here as they relate to how .latexmkrcvariables are retrieved, and their fixes might share a commonality.
When the variable $jobname is specified in the .latexmkrc file, it changes the base name of the generated files (see the manual, page 41). Then, the methods textDocument/forwardSearch and textDocument/publishDiagnostics fail as they are expecting the wrong filename. Setting texlab.build.filename to the correct PDF filename fixes the issue for textDocument/forwardSearch.
Related issue:
The method textDocument/forwardSearch and the commands texlab.cleanArtifacts and texlab.cleanAuxiliary fail when the root document is placed in a subdirectory, say src and the variable $do_cd is set to 1 in .latexmkrc, e.g.,
$do_cd = 1 instructs latexmk to change the working directory before processing (see the manual, page 36). The failure is due to TexLab expecting the root document to be in the project root directory instead of src. In this context, the method textDocument/build succeeds when called from the root document and fails if called from a non-root document, e.g. src/section.tex. Examining the logs, the server seems to fail to detect the root document in both cases due to $do_cd = 1 and falls back to the amended file, so it works only when the two coincide.
texlab does not take into account the .latexmkrc variable $out2_dir that specifies the final-output directory (see the manual, page 45).
When .latexmkrc is used, all of the variables $aux_dir, $out_dir, $out2_dir, do_cdand $jobname are relevant, if set, and can affect the detected paths of the relevant directories and files used by TexLab. .latexmkrc variables could be reported in a dry run, without the need for a dummy $\TeX$ document, using the -e option, e.g.
Note that $jobname allows substitutable placeholders that need to be resolved to get the file name. So, for $jobname, it might be better to wait for the implementation of an option that reports the file name, as discussed in this comment.
The text was updated successfully, but these errors were encountered:
Hello,
Thank you for creating this project. Over the past few days, I had a chance to go through some portion of the code and realise how much work went into it.
Recently, I am using
latexmk
with a.latexmkrc
file, mainly to have a relatively tidy project root directory. I have noticed thatTexLab
has been improving support for.latexmkrc
, still I came across a few issues. I am listing a couple of them here as they relate to how.latexmkrc
variables are retrieved, and their fixes might share a commonality.When the variable
$jobname
is specified in the.latexmkrc
file, it changes the base name of the generated files (see the manual, page 41). Then, the methodstextDocument/forwardSearch
andtextDocument/publishDiagnostics
fail as they are expecting the wrong filename. Settingtexlab.build.filename
to the correct PDF filename fixes the issue fortextDocument/forwardSearch
.Related issue:
The method
textDocument/forwardSearch
and the commandstexlab.cleanArtifacts
andtexlab.cleanAuxiliary
fail when the root document is placed in a subdirectory, saysrc
and the variable$do_cd
is set to1
in.latexmkrc
, e.g.,$do_cd = 1
instructslatexmk
to change the working directory before processing (see the manual, page 36). The failure is due toTexLab
expecting the root document to be in the project root directory instead ofsrc
. In this context, the methodtextDocument/build
succeeds when called from the root document and fails if called from a non-root document, e.g.src/section.tex
. Examining the logs, the server seems to fail to detect the root document in both cases due to$do_cd = 1
and falls back to the amended file, so it works only when the two coincide.texlab
does not take into account the.latexmkrc
variable$out2_dir
that specifies the final-output directory (see the manual, page 45).When$\TeX$ document, using the
.latexmkrc
is used, all of the variables$aux_dir
,$out_dir
,$out2_dir
,do_cd
and$jobname
are relevant, if set, and can affect the detected paths of the relevant directories and files used byTexLab
..latexmkrc
variables could be reported in a dry run, without the need for a dummy-e
option, e.g.latexmk -e 'print \"$aux_dir\0$out_dir\0$out2_dir\0$do_cd\0$jobname\"; exit 0;'
Note that
$jobname
allows substitutable placeholders that need to be resolved to get the file name. So, for$jobname
, it might be better to wait for the implementation of an option that reports the file name, as discussed in this comment.The text was updated successfully, but these errors were encountered: