最终的解决办法是在CSDN上找到,准确来说应该不是CSDN,而是我换了一个检索关键字,直接搜索**网卡消失,**所以这个问题的解决办法还是在interfaces中去进行更改,加上eth33选项。因为最初的症状表现为使用ifconfig 只能看到本地回环的网卡选项,而使用ifconfig -a 能看到ens33选项,但是上面的ip地址不合理。在interface中加入ens33后,再在命令行输入以下命令重新分配ip
# This is the sshd server system-wide configuration file. See # sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with # OpenSSH is to specify options with their default value where # possible, but leave them commented. Uncommented options override the # default value.
Include /etc/ssh/sshd_config.d/*.conf
Port 22 #AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress ::
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts #HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # HostbasedAuthentication #IgnoreUserKnownHosts no # Don't read the user's ~/.rhosts and ~/.shosts files #IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here! PasswordAuthentication yes #PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with # some PAM modules and threads) ChallengeResponseAuthentication no
# Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no
# GSSAPI options #GSSAPIAuthentication no #GSSAPICleanupCredentials yes #GSSAPIStrictAcceptorCheck yes #GSSAPIKeyExchange no
# Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass # the setting of "PermitRootLogin without-password". # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. UsePAM yes
#AllowAgentForwarding yes #AllowTcpForwarding yes #GatewayPorts no X11Forwarding yes #X11DisplayOffset 10 #X11UseLocalhost yes #PermitTTY yes PrintMotd no #PrintLastLog yes #TCPKeepAlive yes #PermitUserEnvironment no #Compression delayed #ClientAliveInterval 0 #ClientAliveCountMax 3 #UseDNS no #PidFile /var/run/sshd.pid #MaxStartups 10:30:100 #PermitTunnel no #ChrootDirectory none #VersionAddendum none
# no default banner path #Banner none
# Allow client to pass locale environment variables AcceptEnv LANG LC_*
# override default of no subsystems Subsystem sftp /usr/lib/openssh/sftp-server
# Example of overriding settings on a per-user basis #Match User anoncvs # X11Forwarding no # AllowTcpForwarding no # PermitTTY no # ForceCommand cvs server
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
The visual studio code cannot generate the table of contents regularly. And I have searched the solution of the problem.
OK, it’s not the perfect solution, for I have now got the hang of the principle in the compiling procedure.
the .aux and the .toc are the particular files that .aux is associated with bibliography while .toc is associated with table of contents. And we need to compile four times to successfully generate the PDF that we want
xelatex, compiling ends with the .aux and .toc
bibtex, compiling using .aux and .toc to deploy the bibliography and table of contents
Moreover, for the template of njuthesis, this template uses the biblatex to deploy the bibliography. So we must use the prompt biber but not bibtex to generate bibliography.
And the biber should make the \bibliography located in preamble and add \printbibliography in the end of a chapter.
And for visual studio code, I always employ the set of xelatex-bibtex-xelatex-xelatex , so I cannot compile successfully using the njuthesis template.
On top of that, the setting of the cleaning file also matters a lot. In the settings.json in visual studio code, the latexworkshop configuration, among all the json, the latex-workshop.latex.autoClean.run, is given two options. OnBuilt and OnFailed. When the compilation has built or successfully ended, the files generated in the procedure will be cleaned. And the imperative .aux and .toc will be cleaned as well, which may cause the major problems.
At the same time, the latexmk -xelatex can also compile successfully the njuthesis when I have downloaded and installed the strawberry perl. And I also downloaded the .vscode configuration for vscode from the gitlab of NJU and I have imported it to the vs code merging the previous version. And I also added the recipe of xelatex-biber-xelatex-xelatex which also works regularly with the template.
TexStudio
TexStudio is also a popular major Tex Editor, which has the equal position with vscode in the industry. And you can choose which to use depending on your emotion habit and preference.
In TexStudio, you are allowed to modify the configuration in the option as you please. The first thing you should do shall be modifying the default annoying engine. The default compiling engine the pdflatex, which is not so friendly to most of us normal students in China. In the most time xelatex is needed to employ rather than the pdflatex which may result in errors.
SumatraPDF
SumatraPDF is an excellent PDF reader with lightweight features, which is a better option than Adobe Acrobat if you just read the PDF not modify or do other things.
What makes me like SumatraPDF is actually that both TexStudio and vscode are able to open an executable file which is a PDF reader when you click the view the PDF. At the time, SumatraPDF stands out with its lightweight. Because of that, we can open the PDF quickly and efficiently.
About the issue that how to set the SumatraPDF be the default external PDF reader in the vscode or TexStudio, there are too many tutorials in the web. Just search and deploy.
Syntax
Space in filename
As for the bibliography, if you employ the bibtex, it is forbidden to make the filename attached space, while you employ the biblatex it is not so restricted, you can use \addbibliography which can only add one bib file once used.
change ref name
To change the ref name in the end of file, it is an available way to redefine the \refname . The code is \renewcommand\refname{the new name} in the preamble.
Using the cleveref package. \crefname{figure}{图}{图}, The last two parameters are the names used for the figure notes and references respectively.
new float
The float is always a whole box that occupy some space. And it will be a problem if the box is too long or large to completely display in a page. So it should employ the new float characteristic. In the minted package, you can use the newfloat argument to do this. And what is the most suitable solution is using the lstlistings and new an environment to do that.
\begin{document} \begin{longlisting} very very long in the vertical aspect code block... \end{longlisting} \end{document}
breaklines
The same as new float, if the inline code or code block is too long in the horizontal aspect, you can use the breaklines to avoid this. for the minted, you can use breaklines argument in the prenium. Also useful with mintiline.
Arguments
There are many optional arguments for the compiling engine to compile the destination file. And for the minted package, the --shell-escape is necessary. And why the argument comes about the answer in stackexchange. It means that the minted package is a file external which will be regarded as not secure for the major file to be compiled causing the interrupt of the compilation.
Package
minted
Package minted can be employed to make the code highlight, which can render the code block not so boring and become very cool. And here are the example of the implementation of the package.
\usepackage{minted} \usepackage{xcolor} \definecolor{LightGray}{gray}{1} \begin{document} \begin{minted} [ frame=lines, framesep=5mm, baselinestretch=1.2, bgcolor=LightGray, fontsize=\footnotesize, linenos ]{matlab} x = 100; y = 100; z = 'hello world!'; if x == y disp(z); else disp(x); end \end{minted} \end{document}
This is a code block whose the language is matlab. And you can compile the tex file and get the result that is very beautiful a pdf file.
Attention, minted package must be invoked by –shell-escaped prompt, which means if you compile it in the powershell or cmd you have to use the prompt xelatex --shell-escaped main.tex . And you should config the compile option when using the minted. However, in my vscode, I have config it in the settings.json. I am so clever a man/boy.
fontspec
This package is almost used to change the font of text.
ctex
The author not only provides a documentclass but also compress it into a package. ctexart and the ctex is the same in a term.
In its manual, there are many wonderful function we can use, such as changing the section settings like internal, font and size. And the useful one is space=true
And the most useful is the \ctexset={} , in the curly bracket, we can custom our wanted setting
biblatex
The hyperref package transforms citations into hyperlinks. See the hyperref and backref package options in § 3.1.2.1 for further details. When using the hyperref package, it is preferable to load it after biblatex.
latexmk
After the struggle with the minted package, I feel so tired and think of that I am so weak to get the hang of latex. It’s so difficult, so difficult……And now I have come to some conclusions. As for latexmk, it is an tool that very strong and powerful which can make the compilation realized by one time while other tools cannot do that when the file attached with bib, toc and so on. On top of that, there are also a file named latexmkrc or .latexmkrc. Inside the file are is the detailed configuration info about the compiling engines. And if it is in the overleaf, it is very necessary to config a latexmkrc file. Just like the minted package that needs the –shell-escape, in the local IDE we can get the arguments to be treated properly while in the overleaf we can’t, so we need to get the work done with the help of latexmkrc and .latexmkrc.
What is the most useful command prompt is as follows
1
latexmk -xelatex -shell-escape && latexmk -c
This command can detect the compiling engine that is needed and the repeat time as well as the compiling sequence automatically. Very useful! Strongly recommend!
tabularx
It can be used to specify the width of the tabular environment
\documentclass{article} \usepackage{xcolor} \usepackage{tabularray} \begin{document} \begin{tblr} { colspec={Q[c,m]Q[c,m]Q[c,m]}, hlines,vlines, row{1}={bg=gray8}, } $p$&$q$&$p\land q$\\ T & T & T \\ T & F & F \\ F & T & F \\ F & F & F \end{tblr} \end{document}
I want to use the macro to replace the complex environment with many optional parameters. But it is not easy to realize in the minted because of it’s nature.(very special and make the \newenvironment cannot work properly)
It should be that using the \newenvironment to make a new environment defined by myself.
In terms of minted, in its documentation, there is the interpretation about the alias for specific language settings. We should use the \setminted or \newminted to make it done. On top of that, to make \newenvironment into use, it should include the fancyvrb package. And in the {before}, the \VerbatimEnvironment must be placed in front of the \begin{thecode}. Here is the tex code.
\textcolor{name}{...} \textcolor[color model]{color specification}{...} or
\color{name} \color[color model]{specification}
\textcolor{name}{...} can color the content in the curly bracket while \color{name} can color the environment within. {\color{red} ....} or \begin{table}\color{blue} \end{table}
And \definecolor{name}{model}{color specification} is often used to define a new color. the general model are rgb RGB cmyk gray.
box
\mbox and \makebox can make a box
\fbox and \framebox can make a box with four lines(frame)
\colorbox{name}{...} can make a box with a background in name while \fcolorbox plus a frame on the base.