我想替换以下模式(上述规则具有更高的优先级)
\right) -> remain unchanged
\right ) -> remain unchanged
\right] -> remain unchanged
\right ] -> remain unchanged
\right} -> remain unchanged
\right } -> remain unchanged
\ri) -> \right)
\ri -> \rightarrow
\right -> \rightarrow
Run Code Online (Sandbox Code Playgroud)
换句话说,如果有任何括号括号或括号,我想要\ right,如果有的话,它应该被\ rightarrow替换.简而言之,我试图将许多缺乏密码的google doc方程转换为适当的LaTeX格式.我想出的是以下内容
sed -i 's/\\ri\([^g]\)/\\right\1/g' $tempfile1 #first step substitution
sed -i 's/\\right\([^])}>|a]\)/\\rightarrow\1/g' $tempfile1
sed -i 's/\\right \([^])}>|a]\)/\\rightarrow \1/g' $tempfile1
Run Code Online (Sandbox Code Playgroud)
它工作正常,但它不会按预期更改\ right\into\rightarrow \.我的测试输入tempfile1如下
\ri\right\right \right)\right]\right }\right )\ri \right ]\righta \al \\
Run Code Online (Sandbox Code Playgroud)
它进入了
\rightarrow\right\rightarrow \right)\right]\right }\right )\rightarrow \right ]\rightarrow \alpha \\
Run Code Online (Sandbox Code Playgroud)
注意到\ right\part没有正确完成.然后我添加了以下行,认为它会明确地提取剩下的内容,但是,它没有按预期工作,现在我真的很困惑...... …
我做了一些虚拟代码来学习打开和读取文件.假设我有以下test.dat读取
1
2
3
4
5
6
7
8
9
10
Run Code Online (Sandbox Code Playgroud)
我编写了以下代码来打开并读取数据文件
subroutine readdata
implicit none
integer :: j
double precision :: test
open(unit = 100, file = 'test.dat', status = 'old', action = 'read')
do j = 1, 10
read(100,*) test
print *, 'N1=', test
end do
end subroutine
Run Code Online (Sandbox Code Playgroud)
正如预期的那样,输出如下所示
gfortran -g -I/usr/include -o main main.o subroutines.o -L/usr/lib64/liblapack -L/usr/lib64/libblas
test= 1.0000000000000000
test= 2.0000000000000000
test= 3.0000000000000000
test= 4.0000000000000000
test= 5.0000000000000000
test= 6.0000000000000000
test= 7.0000000000000000
test= 8.0000000000000000
test= 9.0000000000000000
test= 10.000000000000000 …Run Code Online (Sandbox Code Playgroud) 当vagrant up它显示“您的计算机似乎不支持NFS”时
使用apt-get更新和升级系统后,我基本上按照Mediawiki页面上的说明进行操作,因为我想安装Mathoid为Mediawiki页面本地渲染LaTeX方程。
但是,当我vagrant up回显以下内容时:
It appears your machine doesn't support NFS, or there is not an
adapter to enable NFS on this machine for Vagrant. Please verify
that `nfsd` is installed on your machine, and try again. If you're
on Windows, NFS isn't supported. If the problem persists, please
contact Vagrant support.
Run Code Online (Sandbox Code Playgroud)
我检查了nfsd在主机上是否正常工作,并说它已启用。
# /etc/init.d/nfs-kernel-server status
nfs-kernel-server.service …Run Code Online (Sandbox Code Playgroud)