物理壬踩坑记录including_vscode_latex
问题描述:
在vscode里切换了解释器后,该环境下的某个包无法被import, Run Code之后发现输出窗口显示no module named xxx
. 但是切换到console后(此时会自动进入你当前的conda环境),cd进该路径,python .\xxx.py
, 可以运行。
解决办法
把原来的
‘’’
“python.defaultInterpreterPath”: “D:\Anaconda3\envs\quantum\python.exe”
‘’’
一句注释掉,输入code-runner.executorMap
: 这一句后会出现一大串提示点了后就会导入这个部分的语句。如下:
‘’’
“code-runner.executorMap”: {
“javascript”: “node”,
“java”: “cd $dir && javac $fileName && java $fileNameWithoutExt”,
“c”: “cd $dir && gcc $fileName -o $fileNameWithoutExt && fileNameWithoutExt”,
“cpp”: “cd $dir && g++ $fileName -o $fileNameWithoutExt && fileNameWithoutExt”,
“objective-c”: “cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && fileNameWithoutExt”,
“php”: “php”,
“python”: “F:\Anaconda\envs\pytorch\python.exe”,
“perl”: “perl”,
“perl6”: “perl6”,
“ruby”: “ruby”,
“go”: “go run”,
“lua”: “lua”,
“groovy”: “groovy”,
“powershell”: “powershell -ExecutionPolicy ByPass -File”,
“bat”: “cmd /c”,
“shellscript”: “bash”,
“fsharp”: “fsi”,
“csharp”: “scriptcs”,
“vbscript”: “cscript //Nologo”,
“typescript”: “ts-node”,
“coffeescript”: “coffee”,
“scala”: “scala”,
“swift”: “swift”,
“julia”: “julia”,
“crystal”: “crystal”,
“ocaml”: “ocaml”,
“r”: “Rscript”,
“applescript”: “osascript”,
“clojure”: “lein exec”,
“haxe”: “haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt”,
“rust”: “cd $dir && rustc $fileName && fileNameWithoutExt”,
“racket”: “racket”,
“scheme”: “csi -script”,
“ahk”: “autohotkey”,
“autoit”: “autoit3”,
“dart”: “dart”,
“pascal”: “cd $dir && fpc $fileName && fileNameWithoutExt”,
“d”: “cd $dir && dmd $fileName && fileNameWithoutExt”,
“haskell”: “runhaskell”,
“nim”: “nim compile --verbosity:0 --hints:off --run”,
“lisp”: “sbcl --script”,
“kit”: “kitc --run”,
“v”: “v run”,
“sass”: “sass --style expanded”,
“scss”: “scss --style expanded”
},
“code-runner.runInTerminal”: false
‘’’
再把其中的
‘’’
“python”: “python -u”
‘’’
改成自己的python.exe路径:
‘’’
“python.defaultInterpreterPath”: “D:\Anaconda3\envs\quantum\python.exe”
‘’’
如此我们直接run code就不会报错了,但是此时任然不会显示在输出窗口,会直接显示在终端。
我们最后还需加上一句,
‘’’
“code-runner.runInTerminal”: false
‘’’
总的代码如下
“code-runner.executorMap”: {
“javascript”: “node”,
“java”: “cd $dir && javac $fileName && java $fileNameWithoutExt”,
“c”: “cd $dir && gcc $fileName -o $fileNameWithoutExt && fileNameWithoutExt”,
“cpp”: “cd $dir && g++ $fileName -o $fileNameWithoutExt && fileNameWithoutExt”,
“objective-c”: “cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && fileNameWithoutExt”,
“php”: “php”,
“python”: “D:\Anaconda3\envs\quantum\python.exe”,
“perl”: “perl”,
“perl6”: “perl6”,
“ruby”: “ruby”,
“go”: “go run”,
“lua”: “lua”,
“groovy”: “groovy”,
“powershell”: “powershell -ExecutionPolicy ByPass -File”,
“bat”: “cmd /c”,
“shellscript”: “bash”,
“fsharp”: “fsi”,
“csharp”: “scriptcs”,
“vbscript”: “cscript //Nologo”,
“typescript”: “ts-node”,
“coffeescript”: “coffee”,
“scala”: “scala”,
“swift”: “swift”,
“julia”: “julia”,
“crystal”: “crystal”,
“ocaml”: “ocaml”,
“r”: “Rscript”,
“applescript”: “osascript”,
“clojure”: “lein exec”,
“haxe”: “haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt”,
“rust”: “cd $dir && rustc $fileName && fileNameWithoutExt”,
“racket”: “racket”,
“scheme”: “csi -script”,
“ahk”: “autohotkey”,
“autoit”: “autoit3”,
“dart”: “dart”,
“pascal”: “cd $dir && fpc $fileName && fileNameWithoutExt”,
“d”: “cd $dir && dmd $fileName && fileNameWithoutExt”,
“haskell”: “runhaskell”,
“nim”: “nim compile --verbosity:0 --hints:off --run”,
“lisp”: “sbcl --script”,
“kit”: “kitc --run”,
“v”: “v run”,
“sass”: “sass --style expanded”,
“scss”: “scss --style expanded”
},
“code-runner.runInTerminal”: false
问题描述
写latex文档时,.bib文件加载不进去,导致的本应是[2]变成了[?],并且结尾处的bibliography(plain)加载不出来,同时文章中的\ref
也无法\cite
,尝试把编译器由
1 | { |
换成
1 | "latex-workshop.latex.recipes": [ |
后无果,虽然文章内引用方程式可显示\cite了,但参考文献的[1]还是[?],想到应该用bibtex
,但是不应该用xelatexmk
,于是:
1 | #编译链设置 |
问题描述
当我尝试在两个环境之间插入空行时,如
1 | \begin{block}{角动量守恒} |
or
1 | $$J=\frac{\partial L}{\partial \dot{q}}\epsilon_{ijk}q_j a_k$$ \vspace{2em} $$J=\frac{\partial L}{\partial \dot{q}}\epsilon_{ijk}q_j a_k$$ #parameter needed by is vspace(2em) |
1 | \[Some stuff\] |
报错:
1 | You can't use `\unskip' in vertical mode. |
解决方案
math $$ is obsolete for a long long time, use \[ math \] instead. You also might be interested in the environments provided by amsmath, for example gather and gather*
using consecutive math displays, which is wrong for other reasons: you should use gather*. Note that $$...$$ should never be used in LaTeX.
1
2
3
4
5
6
7
8
9
10
11\begin{gather*}
eq1 \\
eq2 \\[3ex]% some vertical space
eq3
\end{gather*}
text above
\bigskip
text below1
2_config.yml
post_asset_folder: true