问题描述:

在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 && dirdirfileNameWithoutExt”,
“cpp”: “cd $dir && g++ $fileName -o $fileNameWithoutExt && dirdirfileNameWithoutExt”,
“objective-c”: “cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && dirdirfileNameWithoutExt”,
“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 && dirdirfileNameWithoutExt”,
“racket”: “racket”,
“scheme”: “csi -script”,
“ahk”: “autohotkey”,
“autoit”: “autoit3”,
“dart”: “dart”,
“pascal”: “cd $dir && fpc $fileName && dirdirfileNameWithoutExt”,
“d”: “cd $dir && dmd $fileName && dirdirfileNameWithoutExt”,
“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 && dirdirfileNameWithoutExt”,
“cpp”: “cd $dir && g++ $fileName -o $fileNameWithoutExt && dirdirfileNameWithoutExt”,
“objective-c”: “cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && dirdirfileNameWithoutExt”,
“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 && dirdirfileNameWithoutExt”,
“racket”: “racket”,
“scheme”: “csi -script”,
“ahk”: “autohotkey”,
“autoit”: “autoit3”,
“dart”: “dart”,
“pascal”: “cd $dir && fpc $fileName && dirdirfileNameWithoutExt”,
“d”: “cd $dir && dmd $fileName && dirdirfileNameWithoutExt”,
“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
2
3
4
5
6
7
8
9
{
"name": "xelatex->biber->xelatex*2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
}

换成

1
2
3
4
5
6
7
8
9
10
11
"latex-workshop.latex.recipes": [

{
"name": "xelatex->bibtex->xelatex->xelatex MikTex",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex MikTex"
]
}]

后无果,虽然文章内引用方程式可显示\cite了,但参考文献的[1]还是[?],想到应该用bibtex,但是不应该用xelatexmk,于是:

1
2
3
4
5
6
7
8
9
10
11
12
13
#编译链设置   
"latex-workshop.latex.recipes": [

{
"name": "xelatex->bibtex->xelatex*2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
}]
#Done!

问题描述

当我尝试在两个环境之间插入空行时,如

1
2
3
4
5
6
7
\begin{block}{角动量守恒}
空间旋转不变 \quad $q_i \rightarrow q_i+\epsilon_{ijk} q_j a_k \quad G=0$
\end{block}

\begin{equation*}
J=\frac{\partial L}{\partial \dot{q}}\epsilon_{ijk}q_j a_k
\end{equation*}

or

1
2
$$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)
or
1
2
3
4
5
6
\[Some stuff\]

~

\[Some more stuff\]

报错:

1
2
3
4
You can't use `\unskip' in vertical mode.
\beamer@smuggle ...@zeropt \else \ifvmode \unskip

Font “Fangdolsong-Regular” doesn‘t contain requested (fontspec) script “CJK“ #此报错本可以忽略,然而若与上述错误相遇则什么也生成不了

解决方案

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 below
4. # 问题描述 当我用hexo框架搭建博客的时候,遇到了相对路径的图片总是显示不出来的问题,在`vscode MPE`上看是可以看得到的,但是在`hexo serve` or `hexo g d`后显示不出来。 # 解决办法 `hexo`的[资源文件夹](https://hexo.io/zh-cn/docs/asset-folders.html)一切资源都是存储在source里的,当你generate后source中文件除了_[文件名]被生成成HTML资源外,其余的被拷贝到\public文件夹中,被生成的资源也会在\public文件夹中,然后被deploy展示出来 资源(Asset)代表 source 文件夹中除了文章以外的所有文件,例如图片、CSS、JS 文件等。比方说,如果你的Hexo项目中只有少量图片,那最简单的方法就是将它们放在 source/images 文件夹中。然后通过类似于 ![](/images/image.jpg) 的方法访问它们。 对于那些想要更有规律地提供图片和其他资源以及想要将他们的资源分布在各个文章上的人来说,Hexo也提供了更组织化的方式来管理资源。这个稍微有些复杂但是管理资源非常方便的功能可以通过将 config.yml 文件中的 post_asset_folder 选项设为 true 来打开。
1
2
_config.yml
post_asset_folder: true
当资源文件管理功能打开后,Hexo将会在你每一次通过 hexo new [layout] <title> 命令创建新文章时自动创建一个文件夹。这个资源文件夹将会有与这个文章文件一样的名字。将所有与你的文章有关的资源放在这个关联文件夹中之后,你可以通过相对路径来引用它们,这样你就得到了一个更简单而且方便得多的工作流。