[
HTML run]
<html>
<head>
<style>
form {padding-left: 100px;}
caption {margin-bottom: 10px; font: bold 18px Calibri;}
td {width: 125px; padding: 0px; vertical-align: middle; background-color: #f3f3f3;
font: 14px Arial; height: 38px;}
input.rows, input.cols {width: 20px; color: blue;}
textarea {padding:10px; width:380px; height:150px;}
</style>
<script language="JavaScript">
<!--
function LatexMatrix(r,c,output)
{
var i,j;
if (r.value == "" || c.value == "" ) {r.value = 2; c.value = 2;}
var a = ''; if(output.value!='') a = '\n';
output.value += a + "\\begin\{pmatrix\}\n";
for (i=1; i<=r.value-1; i++)
{for (j=1; j<=c.value-1; j++) {output.value += "\ 1\ \&";} output.value += "\ 1\ \\\\\n";}
for (j=1; j<=c.value-1; j++) {output.value += "\ 1\ \&";}
output.value += "\ 1\ \n\\end\{pmatrix\}\n\n\[Замените\ 1\ нужными\ значениями\]";
}
// -->
</script>
</head>
<body>
<form name="matrix">
<table>
<caption>Введите числа строк и столбцов матрицы</caption>
<tr>
<td> Строки <b>i =</b> <input name="cols1" maxlength="1" type="text" class="rows"></td>
<td> Столбцы <b>j =</b> <input name="rows1" maxlength="1" type="text" class="cols"></td>
<td align="center">
<input value="Вставить" onclick="LatexMatrix(cols1,rows1,matrix)" name="button" type="button"
style="cursor: pointer;">
</td>
</tr>
</table>
<textarea name="matrix" placeholder="Здесь появится LaTeX-код матрицы"></textarea>
</form>
</body>
</html>