VSCode LaTeX nicematrix - visual-studio-code

I want to use the package "nicematrix" in VSCode, but it's not working the way I tried.
\documentclass{article}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{mathtools,halloweenmath}
\usepackage{stackengine}
\usepackage{nicematrix}
\begin{document}
\begin{vNiceMatrix}[first-row,last-row,first-col,last-col]
(I)&&x-&y+2z=1 \\
(II)-2x-5y+7z=0 & +2 \cdot (I)\\
(III)&5x+&y-3z=-11 & (-5) \cdot (I)
\end{vNiceMatrix}
\end{document}
The output should look like in this image, but it can't generate an pdf-file.
enter image description here
I get the following error:
Fatal Package nicematrix: Outside math mode. LaTeX [line 1, column 1]
(nicematrix) The environment {vNiceMatrix} can be used
(nicematrix) only in math mode (and not in \vcenter).
(nicematrix) This error is fatal.
The next big problem is, that a pdf can't be created:
Emergency stop LaTeX [line 256, column 1]
:256: ==> Fatal error occurred, no output PDF file produced!Latexmk: Getting log file 'ombplus.log' Latexmk: Examining 'ombplus.fls
Latexmk: Examining 'ombplus.log
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
If I click on the problem with line 256, I get this message:
The Editor couldn't be open due to an unexpected error: The file "..." can't be read (Unknown (FileSystemError): TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes. Received 'file(...)/\x00'). Button: Try Again
How I can use the package "nicematrix" in VSCode?
I want to use the package "nicematrix", but VSCode doesn't recognise the package "nicematrix".
I downloaded it with the MikTeX-program: "miktex-pdftex" and this opens automically a "package-installer", if I include a new package in VSCode. Then I tried it with a download of this package in CTAN. It's not working this way.

The error is caused by the missing math environment around your nicematrix, add for example \[...\] for an unnumbered equation.
I also think with NiceArray you'll get better alignment:
\documentclass{article}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{mathtools,halloweenmath}
\usepackage{stackengine}
\usepackage{nicematrix}
\begin{document}
\[
\begin{NiceArray}{l|rlll|l}
\text{(I)} &x &-y &+2z &=1 & \\
\text{(II)} &-2x &-5y &+7z &=0 & +2 \cdot \text{(I)}\\
\text{(III)} &5x &+y &-3z &=-11 & (-5) \cdot \text{(I)}
\end{NiceArray}
\]
\end{document}

Related

how to truly turn off LaTex output in Doxygen

My group is using Doxygen 1.8.5 on RHEL7 to generate HTML-only documentation for a large C++ project. We only want HTML documentation and do not desire any other output format. The project's Doxygen configuration file (Doxyfile) carries the following settings which differ from the default (among others, of course):
OUTPUT_DIRECTORY="../Docs"
GENERATE_HTML=YES
GENERATE_LATEX=NO
When we run Doxygen with this config file, towards the end of processing, errors start coming to screen from LaTeX components, and processing is held up until the user hits enter a bunch of times to get past these errors, e.g.
...
sh: epstopdf: command not found
error: Problems running epstopdf. Check your TeX installation!
Generating graph info page...
Generating directory documentation...
</home/abilich/Src/GNSS_Software/Lib/LibgpsC++/>:3: warning: Found unknown command `\reference'
</home/abilich/Src/GNSS_Software/Lib/LibgpsC++/>:2: warning: Found unknown command `\reference'
</home/abilich/Src/GNSS_Software/Lib/LibgpsC++/>:2: warning: Found unknown command `\reference'
Generating bitmaps for formulas in HTML...
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)
restricted \write18 enabled.
entering extended mode
(./_formulas.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, lo
aded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/epsfig.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/dvips.def))))
No file _formulas.aux.
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]
! Undefined control sequence.
l.53 \[ \Vert v - w \Vert \leqslant
p\,\min(\Vert v\Vert, \Vert w\Vert). \]
?
...
! Undefined control sequence.
l.533 $ \vert singular value \vert \leqslant
threshold \times \vert max sing...
?
[177] [178] (./_formulas.aux) )
Output written on _formulas.dvi (178 pages, 20576 bytes).
Transcript written on _formulas.log.
error: Problems running latex. Check your installation or look for typos in _formulas.tex and check _formulas.log!
Generating image form_0.png for formula
sh: gs: command not found
error: Problem running ghostscript gs -q -g60x50 -r384x384x -sDEVICE=ppmraw -sOutputFile=_form0.pnm -dNOPAUSE -dBATCH -- _form0.ps. Check your installation!
Generating index page...
/home/abilich/Src/GNSS_Software/Doxy/mainpage.h:15: warning: image file GNSSSoftwareTimeline.png is not found in IMAGE_PATH: assuming external image.
Generating page index...
Generating module index...
Generating namespace index...
Generating namespace member index...
I want to create a Doxyfile that runs without user intervention and does not throw LaTeX errors. Where have I gone astray?
Thanks for #albert's comment, actually the newest version of doxygen did support to turn latex generation off by setting GENERATE_LATEX=NO:
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = NO
The parameter USE_PDFLATEX in your config file should set to NO (the default value is YES)
# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as
# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX
# files. Set this option to YES, to get a higher quality PDF documentation.
#
# See also section LATEX_CMD_NAME for selecting the engine.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
USE_PDFLATEX = NO

jupyter notebook with unicode characters PDF converting problems

I was making a math class note with some unicode characters (Simplified Chinese, in my case) in it. And when I was trying to convert it into PDF file, it popped out 500 error. The error message reads:
...
*************************************************
("E:\Program Files (x86)\MiKTeX 2.9\tex\latex\fontspec\fontspec.sty"
("E:\Program Files (x86)\MiKTeX 2.9\tex\latex\fontspec\fontspec-xetex.sty"
("E:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\fontenc.sty"
("E:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\tuenc.def"))
("E:\Program Files (x86)\MiKTeX 2.9\tex\latex\fontspec\fontspec.cfg")
! Undefined control sequence.
<argument> \LaTeX3 error:
Erroneous variable \c__fontspec_shape_n_n_tl used!
l.3806 \emfontdeclare{ \emshape, \eminnershape }
?
! Emergency stop.
<argument> \LaTeX3 error:
Erroneous variable \c__fontspec_shape_n_n_tl used!
l.3806 \emfontdeclare{ \emshape, \eminnershape }
No pages of output.
Transcript written on notebook.log.
I guess the fontspec part went wrong, but I don't know how to solve it.
For your information, here is what I've done before I got the 500 error.
1.I've installed the pandoc, and I already have Miktex before;
2.I've changed the file
...\nbconvert\templates\latex\article.tplx
rewritten the article class to be ctexart;
3.I've changed the file
...\nbconvert\templates\latex\exporters\pdf.py
rewritten the latex command to be
latex_command = List([u"xelatex", u"{filename}"], config=True,
help="Shell command used to compile latex."
)
4.I've also tried this:"https://github.com/ipython/ipython/issues/7150", which tends to convert the ipynb file into latex file first, then into PDF. And this didn't work for me either. The main reason is that the config file can't be found by jupyter nbconvert command.
For your information, my OS is Win7 Ultimate x64, with Chrome for Anaconda3 jupyter notebook.
Thanks in advance for anyone who takes time to read my post. Any help would be appreciated.

Scala Process Builder

I'm trying to execute a command on Scala, but i'm getting an error
s"git --git-dir ${repository.localLocation.get.path}/.git log --format='%h %at %s' --no-decorate" !!
I'm getting an error exit status:
java.lang.RuntimeException: Nonzero exit value: 128
at scala.sys.package$.error(package.scala:27)
at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang$bang(ProcessBuilderImpl.scala:134)
But when i'm running this via terminal it works perfectly:
git --git-dir='/var/folders/mk/dc2mnd7x3db1hnqm0vfg6b800000gn/T/XXHMjm7178261334218603127.tmp/.git' log --format='%h %at %s'
If i leave only one % part, it works properly.
Can anyone help me ?
You should probably use the Seq[String] variant, because you have space characters in your args that might be used to wrongly separate the arguments. Try
Seq("git", "--git-dir", s"${repository.localLocation.get.path}/.git",
"log", "--format='%h %at %s'", "--no-decorate").!!
Also note that you will see the single ticks ' in the output. You probably want "--format=%h %at %s".

Where is the .tex file kept when compiling Rmd in Rstudio server

This may sound like a dumb question, but I'd like to know where is the .tex file saved, when I compile a pdf document from a Rmd file, using RStudio server.
I added the keep_tex option, so the header of Rmd looks like this :
---
output:
pdf_document:
keep_tex: yes
---
Then when I compiled, the output looks like this
|...................... | 33%
ordinary text without R code
|........................................... | 67%
label: plot
processing file: test.Rmd
cropping /tmp/Rtmpb1x3Q0/preview-3bfe24922427.dir/test_files/figure-latex/plot-1.pdf
PDFCROP 1.33, 2012/02/01 - Copyright (c) 2002-2012 by Heiko Oberdiek.
==> 1 page written on `/tmp/Rtmpb1x3Q0/preview-3bfe24922427.dir/test_files/figure-latex/plot-1.pdf'.
|.................................................................| 100%
ordinary text without R code
/usr/lib/rstudio-server/bin/pandoc/pandoc test.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output /tmp/Rtmpb1x3Q0/preview-3bfe24922427.dir/test.tex --template /home/myusername/R/x86_64-pc-linux-gnu-library/3.1/rmarkdown/rmd/latex/default.tex --highlight-style tango --latex-engine pdflatex --variable 'geometry:margin=1in'
output file: test.knit.md
/usr/lib/rstudio-server/bin/pandoc/pandoc test.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output /tmp/Rtmpb1x3Q0/preview-3bfe24922427.dir/test.pdf --template /home/myusername/R/x86_64-pc-linux-gnu-library/3.1/rmarkdown/rmd/latex/default.tex --highlight-style tango --latex-engine pdflatex --variable 'geometry:margin=1in'
Output created: /tmp/Rtmpb1x3Q0/preview-3bfe24922427.dir/test.pdf
I'd like to find the intermediate .tex file (or test.knit.md), and do a bit of editing. Except it is no where to be found. Not in the working directory, or /home/myusername/, or /, or /tmp/Rtmpb1x3Q0/.
I'd really appreciate it if someone has the answer.
Actually, this first line in the console
/usr/lib/rstudio-server/bin/pandoc/pandoc test.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output /tmp/Rtmpb1x3Q0/preview-3bfe24922427.dir/test.tex --template /home/myusername/R/x86_64-pc-linux-gnu-library/3.1/rmarkdown/rmd/latex/default.tex --highlight-style tango --latex-engine pdflatex --variable 'geometry:margin=1in'
told us that the output .tex file is in /tmp/Rtmpb1x3Q0/preview-3bfe24922427.dir/test.tex
Somehow I did not find the file last time, but on a recent instance, the .tex file is actually there, so that answers the question.
The initial code from the question
---
output:
pdf_document:
keep_tex: yes
---
Throws an error for me, while the following does not:
---
output:
pdf_document: default
keep_tex: T
---
However, I was still unable to find the .tex file following the console output. It appears to still not be saved. Instead what worked easily was running the following lines in the R studio console:
#install.packages(rmarkdown)
rmarkdown::render("FileName.Rmd", output_format = latex_document())
The file "FileName.Rmd" needs to be in the current working directory - which is where the .tex file will be saved.

Multiple figures in one chunk with knitr and Rstudio 0.97 or 0.98

I try to shift from Sweave to knitr but I am stucked with a problem to use multiple plots in one chunk. Here an example:
Let this .Rnw simple file (named Essai.Rnw). Of course only one plot is shown in the pdf:
\documentclass{article}
\begin{document}
\SweaveOpts{concordance=TRUE}
<<fig=TRUE>>=
plot(1:10, exp(1:10))
plot(1:10, log(1:10))
#
\end{document}
I transform it to knitr format using:
library("knitr", lib.loc="/Library/Frameworks/R.framework/Versions/3.0/Resources/library")
Sweave2knitr("Essai.Rnw")
I edit the file to get this:
\documentclass{article}
\begin{document}
\SweaveOpts{concordance=TRUE}
<<include=FALSE>>=
require(knitr)
opts_chunk$set(concordance=TRUE)
#
<<>>=
plot(1:10, exp(1:10))
plot(1:10, log(1:10))
#
\end{document}
In Rstudio global preference, I set Weave Rnw files using Knitr and when I produce pdf file using Compile pdf button in Rstudio, i get only one plot, not the 2 as I expected.
Here is my sessionInfo()
> sessionInfo()
R version 3.0.1 Patched (2013-06-10 r62935)
Platform: x86_64-apple-darwin10.8.0 (64-bit)
locale:
[1] fr_FR.UTF-8/fr_FR.UTF-8/fr_FR.UTF-8/C/fr_FR.UTF-8/fr_FR.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] knitr_1.2
loaded via a namespace (and not attached):
[1] digest_0.6.3 evaluate_0.4.3 formatR_0.7 stringr_0.6.2 tools_3.0.1
Not sure this is the cause of your problem but if you weave it with knitr, I think you have to remove the \SweaveOpts{concordance=TRUE} line.
If I compile the following, I get two plots. Note the deletions I made. Your original code did not compile on my system.
\documentclass{article}
\begin{document}
<<include=FALSE>>=
opts_chunk$set(concordance=TRUE)
#
<<>>=
plot(1:10, exp(1:10))
plot(1:10, log(1:10))
#
\end{document}
Maybe read about the knitr option fig.keep= about how your plots get integrated into the output.