我使用 GUI 制作了一个带有圆括号的矩阵,现在我想删除圆括号(或将其更改为方括号),我该怎么做?
答案1
一种非常肮脏的解决方法。
假设您有myfile.lyx
:
保存它以便myfile2.lyx
在发生错误时有备份。
关闭 LyX 并myfile.lyx
使用文本编辑器(如 Notepad++ 或类似的)打开,您将看到以下内容:
#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 508
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Standard
I want this without round brackets:
\begin_inset Formula
\[
\begin{pmatrix}a & b\\
c & d
\end{pmatrix}
\]
\end_inset
\end_layout
\begin_layout Standard
I want this with square brackets:
\begin_inset Formula
\[
\begin{pmatrix}a & b\\
c & d
\end{pmatrix}
\]
\end_inset
\end_layout
\end_body
\end_document
如果您不想要括号,则更改为;如果您想要方括号,则更改为,您将得到以下结果pmatrix
:array
pmatrix
bmatrix
#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 508
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Standard
I want this without round brackets:
\begin_inset Formula
\[
\begin{array}a & b\\% <-- changed
c & d
\end{array}% <-- changed
\]
\end_inset
\end_layout
\begin_layout Standard
I want this with square brackets:
\begin_inset Formula
\[
\begin{bmatrix}a & b\\% <-- changed
c & d
\end{bmatrix}% <-- changed
\]
\end_inset
\end_layout
\end_body
\end_document
保存并关闭文本编辑器。
使用 LyX 打开它,瞧:
.lyx
请注意:不要更改任何其他内容,除非您知道自己在做什么,并且在执行这些操作之前务必备份您的文档。
答案2
- 在 LyX GUI 中突出显示矩阵。
- 将其复制并粘贴到文本编辑器中。
- 将“pmatrix”编辑为“matrix”(无括号)或“bmatrix”(方括号),
- 粘贴回 LyX GUI。