Re: Why Lyx always adds additional columns in arrays when opening?--- A not bad solution
Dear Herbert, Thank you for your solution. Along with your solution, I obtained a solution to change massive arrays including vertical lines. Some suggestions regarding to vertical/horizontal lines in arrays are: 1. horizontal lines can be input in arrays directly with \hline at the first cell of the row, while lefting the vertical lines to be added later; 2. when the file is almost done, (or you are sure you will not modify the array any more), take the following steps to add vertical lines. Step 1: backup the lyx file and then open the *.lyx file in a common text editor; Step 2: find the arrays which vertical lines should be added; Step 3: add | into the alignment string, for example, ccc|c means vertical line lies between col. 3 and col. 4. Step 4: replace the \begin_inset Formula before the array as \latex latex; replace the \end_inset after the array as \latex default; This step can be done with search/replace function. So you will not feel too troublesome. 3. dashed lines can also be done in a similar way, but package arydshln should be used. When lyx re-open the file, the arrays will be displayed as latex code (red), when it is saved, \ is changed to \backslash. Hence, backing up the file before processing is recommended. I have also checked with multi-line equations, it works! Dekel Tsur [EMAIL PROTECTED]> told me that the math editor is currently being re-written, hope the lines will be supported soon. Best wishes, Qingchang Herbert Voss wrote: Qingchang Zhong wrote: > I cannot do so because I have many many matrices like this, some of them are 10x10! Please try to help me, I have spent too much time to solve this problem. > > Do you think this is a bug? yes and no, because lyx doesn't support this any more. so lets try to make it run. .. :-) here comes a part of your lyx-file: -- > \layout Standard > > \begin_inset Formula \( \left[ \begin{array}{c|c} > A 0\\ > \hline0 B > \end{array}\right] \) > \end_inset > > \the_end it's easy to find this formulas with any simple texteditor. search for c|c, so you find it anyway. now delete at first: \begin_inset Formula and than: \end_inset your lyx-text looks now \( \left[ \begin{array}{c|c} > A 0\\ > \hline0 B > \end{array}\right] \) so far so good. save the text and open it with lyx. the whole formula now appears as text in one line: \( \left[\begin{array}{cc|c}A 0 \\0 A \\\hline0 0 A\end{array}\right] \) mark this whole line with the mouse and hit the tex-button. now your text is okay, while the formula is real latex (in red). try it with a short file. hope this helps. Herbert -- http://www.educat.hu-berlin.de/~voss/lyx/
Re: Why Lyx always adds additional columns in arrays when opening?--- A not bad solution
On Tue, Jun 05, 2001 at 11:15:30AM +0100, Qingchang Zhong wrote: Dear Herbert, Along with your solution, I obtained a solution to change massive arrays including vertical lines. Some suggestions regarding to vertical/horizontal lines in arrays are: 1. horizontal lines can be input in arrays directly with \hline at the first cell of the row, while lefting the vertical lines to be added later; 2. when the file is almost done, (or you are sure you will not modify the array any more), take the following steps to add vertical lines. Step 1: backup the lyx file and then open the *.lyx file in a common text editor; Step 2: find the arrays which vertical lines should be added; Step 3: add | into the alignment string, for example, ccc|c means vertical line lies between col. 3 and col. 4. Step 4: replace the \begin_inset Formulabefore the array as \latex latex; replace the\end_insetafter the array as \latex default; This step can be done with search/replace function. So you will not feel too troublesome. 3. dashed lines can also be done in a similar way, but package arydshln should be used. When lyx re-open the file, the arrays will be displayed as latex code (red), when it is saved, \ is changed to \backslash. Hence, backing up the file before processing is recommended. I have a better solution: 1. Put the following lines in the preamble: \usepackage{array} \newcommand{\arraylines}[1]{{\newcolumntype{r}{c|}#1}} 2. When you insert a matrix, use r alignment instead of c|, namely if you want cc|c alignment, then write crc in the matrix dialog. 3. Put \arraylines{} around the whole math inset, or inside the math inset, around the matrix See the attached file. #LyX 1.2 created this file. For more info see http://www.lyx.org/ \lyxformat 218 \textclass article \begin_preamble \usepackage{array} \newcommand{\arraylines}[1]{% {\newcolumntype{r}{c|}#1}} \end_preamble \language american \inputencoding default \fontscheme default \graphics default \paperfontsize default \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \layout Standard \latex latex \backslash arraylines{ \latex default \begin_inset Formula \( \left[ \begin{array}{crc} 1 2 3\\ \hline 4 5 6\\ 7 8 9 \end{array}\right] \) \end_inset \latex latex } \layout Standard \begin_inset Formula \( \arraylines {\left[ \begin{array}{crc} 1 2 3\\ \hline 4 5 6\\ 7 8 9 \end{array}\right] } \) \end_inset \the_end
Re: Why Lyx always adds additional columns in arrays when opening?--- A not bad solution
Dear Herbert, Thank you for your solution. Along with your solution, I obtained a solution to change massive arrays including vertical lines. Some suggestions regarding to vertical/horizontal lines in arrays are: 1. horizontal lines can be input in arrays directly with \hline at the first cell of the row, while lefting the vertical lines to be added later; 2. when the file is almost done, (or you are sure you will not modify the array any more), take the following steps to add vertical lines. Step 1: backup the lyx file and then open the *.lyx file in a common text editor; Step 2: find the arrays which vertical lines should be added; Step 3: add | into the alignment string, for example, ccc|c means vertical line lies between col. 3 and col. 4. Step 4: replace the \begin_inset Formula before the array as \latex latex; replace the \end_inset after the array as \latex default; This step can be done with search/replace function. So you will not feel too troublesome. 3. dashed lines can also be done in a similar way, but package arydshln should be used. When lyx re-open the file, the arrays will be displayed as latex code (red), when it is saved, \ is changed to \backslash. Hence, backing up the file before processing is recommended. I have also checked with multi-line equations, it works! Dekel Tsur [EMAIL PROTECTED]> told me that the math editor is currently being re-written, hope the lines will be supported soon. Best wishes, Qingchang Herbert Voss wrote: Qingchang Zhong wrote: > I cannot do so because I have many many matrices like this, some of them are 10x10! Please try to help me, I have spent too much time to solve this problem. > > Do you think this is a bug? yes and no, because lyx doesn't support this any more. so lets try to make it run. .. :-) here comes a part of your lyx-file: -- > \layout Standard > > \begin_inset Formula \( \left[ \begin{array}{c|c} > A 0\\ > \hline0 B > \end{array}\right] \) > \end_inset > > \the_end it's easy to find this formulas with any simple texteditor. search for c|c, so you find it anyway. now delete at first: \begin_inset Formula and than: \end_inset your lyx-text looks now \( \left[ \begin{array}{c|c} > A 0\\ > \hline0 B > \end{array}\right] \) so far so good. save the text and open it with lyx. the whole formula now appears as text in one line: \( \left[\begin{array}{cc|c}A 0 \\0 A \\\hline0 0 A\end{array}\right] \) mark this whole line with the mouse and hit the tex-button. now your text is okay, while the formula is real latex (in red). try it with a short file. hope this helps. Herbert -- http://www.educat.hu-berlin.de/~voss/lyx/
Re: Why Lyx always adds additional columns in arrays when opening?--- A not bad solution
On Tue, Jun 05, 2001 at 11:15:30AM +0100, Qingchang Zhong wrote: Dear Herbert, Along with your solution, I obtained a solution to change massive arrays including vertical lines. Some suggestions regarding to vertical/horizontal lines in arrays are: 1. horizontal lines can be input in arrays directly with \hline at the first cell of the row, while lefting the vertical lines to be added later; 2. when the file is almost done, (or you are sure you will not modify the array any more), take the following steps to add vertical lines. Step 1: backup the lyx file and then open the *.lyx file in a common text editor; Step 2: find the arrays which vertical lines should be added; Step 3: add | into the alignment string, for example, ccc|c means vertical line lies between col. 3 and col. 4. Step 4: replace the \begin_inset Formulabefore the array as \latex latex; replace the\end_insetafter the array as \latex default; This step can be done with search/replace function. So you will not feel too troublesome. 3. dashed lines can also be done in a similar way, but package arydshln should be used. When lyx re-open the file, the arrays will be displayed as latex code (red), when it is saved, \ is changed to \backslash. Hence, backing up the file before processing is recommended. I have a better solution: 1. Put the following lines in the preamble: \usepackage{array} \newcommand{\arraylines}[1]{{\newcolumntype{r}{c|}#1}} 2. When you insert a matrix, use r alignment instead of c|, namely if you want cc|c alignment, then write crc in the matrix dialog. 3. Put \arraylines{} around the whole math inset, or inside the math inset, around the matrix See the attached file. #LyX 1.2 created this file. For more info see http://www.lyx.org/ \lyxformat 218 \textclass article \begin_preamble \usepackage{array} \newcommand{\arraylines}[1]{% {\newcolumntype{r}{c|}#1}} \end_preamble \language american \inputencoding default \fontscheme default \graphics default \paperfontsize default \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \layout Standard \latex latex \backslash arraylines{ \latex default \begin_inset Formula \( \left[ \begin{array}{crc} 1 2 3\\ \hline 4 5 6\\ 7 8 9 \end{array}\right] \) \end_inset \latex latex } \layout Standard \begin_inset Formula \( \arraylines {\left[ \begin{array}{crc} 1 2 3\\ \hline 4 5 6\\ 7 8 9 \end{array}\right] } \) \end_inset \the_end
Re: Why Lyx always adds additional columns in arrays when opening?---> A not bad solution
Dear Herbert, Thank you for your solution. Along with your solution, I obtained a solution to change massive arrays including vertical lines. Some suggestions regarding to vertical/horizontal lines in arrays are: 1. horizontal lines can be input in arrays directly with \hline at the first cell of the row, while lefting the vertical lines to be added later; 2. when the file is almost done, (or you are sure you will not modify the array any more), take the following steps to add vertical lines. Step 1: backup the lyx file and then open the *.lyx file in a common text editor; Step 2: find the arrays which vertical lines should be added; Step 3: add | into the alignment string, for example, ccc|c means vertical line lies between col. 3 and col. 4. Step 4: replace the \begin_inset Formula before the array as \latex latex; replace the \end_inset after the array as \latex default; This step can be done with search/replace function. So you will not feel too troublesome. 3. dashed lines can also be done in a similar way, but package arydshln should be used. When lyx re-open the file, the arrays will be displayed as latex code (red), when it is saved, \ is changed to \backslash. Hence, backing up the file before processing is recommended. I have also checked with multi-line equations, it works! Dekel Tsur <[EMAIL PROTECTED]> told me that the math editor is currently being re-written, hope the lines will be supported soon. Best wishes, Qingchang Herbert Voss wrote: Qingchang Zhong wrote: > I cannot do so because I have many many matrices like this, some of them are 10x10! Please try to help me, I have spent too much time to solve this problem. > > Do you think this is a bug? yes and no, because lyx doesn't support this any more. so lets try to make it run. .. :-) here comes a part of your lyx-file: -- > \layout Standard > > \begin_inset Formula \( \left[ \begin{array}{c|c} > A & 0\\ > \hline0 & B > \end{array}\right] \) > \end_inset > > \the_end it's easy to find this formulas with any simple texteditor. search for c|c, so you find it anyway. now delete at first: \begin_inset Formula and than: \end_inset your lyx-text looks now \( \left[ \begin{array}{c|c} > A & 0\\ > \hline0 & B > \end{array}\right] \) so far so good. save the text and open it with lyx. the whole formula now appears as text in one line: \( \left[\begin{array}{cc|c}A & 0 & \\0 & A & \\\hline0 & 0 & A\end{array}\right] \) mark this whole line with the mouse and hit the tex-button. now your text is okay, while the formula is real latex (in red). try it with a short file. hope this helps. Herbert -- http://www.educat.hu-berlin.de/~voss/lyx/
Re: Why Lyx always adds additional columns in arrays when opening?---> A not bad solution
On Tue, Jun 05, 2001 at 11:15:30AM +0100, Qingchang Zhong wrote: > Dear Herbert, > Along with your solution, I obtained a solution to change massive arrays including >vertical lines. > > Some suggestions regarding to vertical/horizontal lines in arrays are: > > 1. horizontal lines can be input in arrays directly with \hline at the first cell of >the row, while lefting the vertical lines to be added later; > 2. when the file is almost done, (or you are sure you will not modify the array any >more), take the following steps to add vertical lines. > Step 1: backup the lyx file and then open the *.lyx file in a common text >editor; > Step 2: find the arrays which vertical lines should be added; > Step 3: add | into the alignment string, for example, ccc|c means vertical >line lies between col. 3 and col. 4. > Step 4: replace the \begin_inset Formulabefore the array as \latex >latex; > replace the\end_insetafter the array >as \latex default; > This step can be done with search/replace function. So you will >not feel too troublesome. > 3. dashed lines can also be done in a similar way, but package arydshln should be >used. > > When lyx re-open the file, the arrays will be displayed as latex code (red), when it >is saved, \ is changed to \backslash. Hence, backing up the file before > processing is recommended. I have a better solution: 1. Put the following lines in the preamble: \usepackage{array} \newcommand{\arraylines}[1]{{\newcolumntype{r}{c|}#1}} 2. When you insert a matrix, use r alignment instead of c|, namely if you want cc|c alignment, then write crc in the matrix dialog. 3. Put \arraylines{} around the whole math inset, or inside the math inset, around the matrix See the attached file. #LyX 1.2 created this file. For more info see http://www.lyx.org/ \lyxformat 218 \textclass article \begin_preamble \usepackage{array} \newcommand{\arraylines}[1]{% {\newcolumntype{r}{c|}#1}} \end_preamble \language american \inputencoding default \fontscheme default \graphics default \paperfontsize default \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \layout Standard \latex latex \backslash arraylines{ \latex default \begin_inset Formula \( \left[ \begin{array}{crc} 1 & 2 & 3\\ \hline 4 & 5 & 6\\ 7 & 8 & 9 \end{array}\right] \) \end_inset \latex latex } \layout Standard \begin_inset Formula \( \arraylines {\left[ \begin{array}{crc} 1 & 2 & 3\\ \hline 4 & 5 & 6\\ 7 & 8 & 9 \end{array}\right] } \) \end_inset \the_end