+
+\end{pmatrix}
+\end{pmatrix}
$$\begin{pmatrix}
\begin{array}{c c | c c}
@@ -1010,7 +1033,7 @@ Kronecker productsas.double() is used to evaluate the result numerically.
-
+
Bmat <- latexMatrix('\\mathbf{B}', ncol=1, nrow=1)
KABmat <- kronecker(A, Bmat)
KAB <- kronecker(A, B)
@@ -1054,7 +1077,7 @@
function can also generate symbolic
equations from numeric or character matrices. For numeric matrices, it
can round the values or show results as fractions.
-
+
A <- matrix(1:12, nrow=3, ncol=4, byrow = TRUE) / 6
matrix2latex(A, fractions = TRUE, brackets = "b") |> Eqn()
.
Create these as a character matrix and vector:
-
+
## [,1] [,2] [,3]
## [1,] "a_1" "a_2" "a_3"
## [2,] "a_4" "a_5" "a_6"
## [3,] "a_7" "a_8" "a_9"
-
+
## [1] "\\beta_1" "\\beta_2" "\\beta_3"
Then use matrix2latex()
on cbind(A,b)
and
pipe the result of matrix2latex()
to
Eqn()
:
-
+
-
+
## [,1] [,2] [,3]
## [1,] "a_{11}" "a_{12}" "a_{13}"
## [2,] "a_{21}" "a_{22}" "a_{23}"
## [3,] "a_{31}" "a_{32}" "a_{33}"
-
+
showEqn(..., latex = TRUE)
produces the three equations
in a single \begin{array} ... \begin{array}
environment.
-
+
showEqn(A, b, vars = x, latex=TRUE)
If this line was run in an R console, it would produce:
\begin{array}{lllllll}
@@ -1134,7 +1157,7 @@
Evaluating the above code in an unnumbered LaTeX math environment via
Eqn()
gives the desired result:
-
+
-
-
+
+
Three inconsistent equations
diff --git a/docs/authors.html b/docs/authors.html
index c30aea70..44c0b517 100644
--- a/docs/authors.html
+++ b/docs/authors.html
@@ -1,5 +1,5 @@
-Authors and Citation • matlib
+Authors and Citation • matlib
Skip to contents
@@ -7,7 +7,7 @@
matlib
- 0.9.91
+ 0.9.95
diff --git a/docs/index.html b/docs/index.html
index fbd43cd0..d593c30f 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -23,6 +23,8 @@
+
+
Skip to contents
@@ -32,7 +34,7 @@
matlib
- 0.9.91
+ 0.9.95
@@ -140,11 +167,12 @@
Arguments...
-comma separated LaTeX expressions that are either a) a character vector,
+
comma separated LaTeX expressions that are either a) a character
vector,
which will be automatically wrapped the
expression inside a call to cat
, b) a matrix
object
containing character or numeric information, which will be passed latexMatrix
,
- or c) an object that was explicitly created via latexMatrix
, which
+ along with the information in mat_args
, or
+ c) an object that was explicitly created via latexMatrix
, which
provides greater specificity.
Note that user defined functions that use cat
within
their body should return an empty character vector to avoid printing the
@@ -152,8 +180,13 @@
Argumentslabel
-the equation label used within Eqn
or
-defined explicitly in the document
+character vector specifying the label to use (e.g., eq:myeqn
), which
+ for LaTeX can be reference via \ref{eq:myeqn}
or via the inline function
+ ref
. Including a label will also include an equation number automatically.
+For compiled documents if an HTML output is detected (see html_output
)
+ then the equations will be labelled via (\#eq:myeqn)
and references via \@ref(eq:myeqn)
,
+ or again via ref
for convenience. For Quarto documents the label must be of the
+ form eq-LABEL
align
@@ -161,16 +194,28 @@ Argumentspreview
+logical; render an HTML version of the equation and display? This is intended for
+testing purposes and is only applicable to interactive R sessions. Disabled
+whenever quarto
or html_output
are TRUE
+
+
html_output
-logical; use references for HTML outputs instead
-of the LaTeX? Automatically changed for compiled documents
-that support knitr
+logical; use labels for HTML outputs instead of the LaTeX? Automatically
+changed for compiled documents that support knitr
. Generally not
+required or recommended for the user to modify, except to view the generated syntax
+
+
+quarto
+logical; use Quarto referencing syntax? When TRUE
+the html_output
will be irrelevant. Generally not recommended for the
+user to modify, except to view the generated syntax
mat_args
list of arguments to be passed to latexMatrix
to change the
-properties of the matrix
input objects. Note that these inputs are used globally, and apply to
-each matrix
objects supplied. If further specificity is required create
+properties of the matrix
input object(s). Note that these inputs are used globally, and apply to
+each matrix
object supplied. If further specificity is required create
latexMatrix
objects directly.
@@ -181,8 +226,9 @@ Argumentslhs
spacing size. Can be a number between -1 and 6. -1 provides negative
spaces and 0 gives no spacing. Input can also be a character vector, which will be
-passed to \hspace{}
(e.g., '1cm'
).
-Default is 5, resulting in a \quad
space
+passed to \hspace{}
(e.g., '1cm'
; see space
argument
+for supported metrics).
+Default is 5, resulting in a \quad
space.
mid
@@ -199,10 +245,15 @@ Argumentsspace
+includes extra vertical space. Metric of the vertical space
+must be 'ex', 'pt', 'mm', 'cm', 'em', 'bp', 'dd', 'pc', or 'in'
+
+
string
a string that should have its text size modified. If missing
-the size modifier is returned, which applied the size modifier
-for the remainder of the text until reset with Eqn_size()
+the size modifier is returned, which applies the size modifier
+to the remainder of the text until reset with Eqn_size()
size
@@ -212,8 +263,7 @@ Argumentsparentheses
-logical; include parentheses around the referenced equation?
-Only changes the behaviour for referencing in LaTeX/PDF documents.
+logical; include parentheses around the referenced equation?
@@ -234,6 +284,12 @@
Examples#> \begin{equation*}
#> e=mc^2\end{equation*}
+# show only the LaTeX code
+Eqn('e=mc^2', preview=FALSE)
+#>
+#> \begin{equation*}
+#> e=mc^2\end{equation*}
+
# Equation numbers & labels
Eqn('e=mc^2', label = 'eq:einstein')
#>
@@ -246,13 +302,21 @@ Examples#> \label{eq:svd}
#> X=U \lambda V\end{equation}
-# html output (auto detected in compiled documents)
+# html_output and quarto outputs only show code
+# (both auto detected in compiled documents)
Eqn('e=mc^2', label = 'eq:einstein', html_output = TRUE)
#>
#> \begin{equation}
#> (\#eq:einstein)
#> e=mc^2\end{equation}
+# Quarto output
+Eqn('e=mc^2', label = 'eq-einstein', quarto = TRUE)
+#>
+#> \begin{equation}
+#> \label{eq-einstein}
+#> e=mc^2\end{equation}
+
# Multiple expressions
Eqn("e=mc^2",
Eqn_newline(),
@@ -368,6 +432,10 @@ Examples#> \end{array}\end{equation*}
+Eqn_newline()
+#> [1] " \\\\ \n"
+
+
Eqn_hspace()
#> [1] "\\quad"
Eqn_hspace(3) # smaller
@@ -384,6 +452,13 @@ Examples#> [1] "\\quad\\quad=\\quad\\quad"
+Eqn_vspace('1.5ex')
+#> [1] " \\vspace{1.5ex} \n"
+Eqn_vspace('1cm')
+#> [1] " \\vspace{1cm} \n"
+
+
+
# set size globally
Eqn_size(size=3)
#> [1] "\\LARGE"
@@ -412,6 +487,17 @@ Examplesref('eq:einstein', html_output=TRUE)
#> [1] "\\@ref(eq:einstein)"
+# With Quarto
+Eqn('e = mc^2', label='eq-einstein', quarto=TRUE)
+#>
+#> \begin{equation}
+#> \label{eq-einstein}
+#> e = mc^2\end{equation}
+ref('eq:einstein', quarto=TRUE)
+#> [1] "(\\ref{eq:einstein})"
+ref('eq:einstein', quarto=TRUE, parentheses=FALSE)
+#> [1] "\\ref{eq:einstein}"
+
+3D plot
+
+
diff --git a/docs/reference/arrows3d.html b/docs/reference/arrows3d.html
index 96b055a2..e879fb5a 100644
--- a/docs/reference/arrows3d.html
+++ b/docs/reference/arrows3d.html
@@ -1,5 +1,5 @@
-Draw 3D arrows — arrows3d • matlib
+Draw 3D arrows — arrows3d • matlib
Skip to contents
@@ -7,7 +7,7 @@
matlib
- 0.9.91
+ 0.9.95
diff --git a/docs/reference/as.double.latexMatrix.html b/docs/reference/as.double.latexMatrix.html
new file mode 100644
index 00000000..6e6f239e
--- /dev/null
+++ b/docs/reference/as.double.latexMatrix.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/docs/reference/buildTmat.html b/docs/reference/buildTmat.html
index 8989db4d..7aed65b9 100644
--- a/docs/reference/buildTmat.html
+++ b/docs/reference/buildTmat.html
@@ -5,7 +5,7 @@
been performed.">
+been performed.">
Skip to contents
@@ -13,7 +13,7 @@
matlib
- 0.9.91
+ 0.9.95
diff --git a/docs/reference/cbind.latexMatrix.html b/docs/reference/cbind.latexMatrix.html
new file mode 100644
index 00000000..6e6f239e
--- /dev/null
+++ b/docs/reference/cbind.latexMatrix.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/docs/reference/cholesky.html b/docs/reference/cholesky.html
index 368924a8..03abd9d9 100644
--- a/docs/reference/cholesky.html
+++ b/docs/reference/cholesky.html
@@ -1,7 +1,7 @@
Cholesky Square Root of a Matrix — cholesky • matlib
+The purpose is mainly to demonstrate the algorithm used by Kennedy & Gentle (1980).">
Skip to contents
@@ -9,7 +9,7 @@
matlib
- 0.9.91
+ 0.9.95
diff --git a/docs/reference/circle.html b/docs/reference/circle.html
index 8d955f69..be3e40d5 100644
--- a/docs/reference/circle.html
+++ b/docs/reference/circle.html
@@ -1,5 +1,5 @@
-Draw circles on an existing plot. — circle • matlib
+Draw circles on an existing plot. — circle • matlib
Skip to contents
@@ -7,7 +7,7 @@
matlib
- 0.9.91
+ 0.9.95
diff --git a/docs/reference/circle3d.html b/docs/reference/circle3d.html
index 40df73a8..79834a03 100644
--- a/docs/reference/circle3d.html
+++ b/docs/reference/circle3d.html
@@ -1,5 +1,5 @@
-Draw a horizontal circle — circle3d • matlib
+Draw a horizontal circle — circle3d • matlib
Skip to contents
@@ -7,7 +7,7 @@
matlib
- 0.9.91
+ 0.9.95
@@ -100,9 +100,9 @@ Examplescircle3d(ctr, 3, fill = TRUE)
circle3d(ctr - c(-1,-1,0), 3, col="blue")
circle3d(ctr + c(1,1,0), 3, col="red")
-3D plot
-
-
+3D plot
+
+
diff --git a/docs/reference/class.html b/docs/reference/class.html
index 48f1eac2..955d341e 100644
--- a/docs/reference/class.html
+++ b/docs/reference/class.html
@@ -1,5 +1,5 @@
-Class Data Set — class • matlib
+Class Data Set — class • matlib
Skip to contents
@@ -7,7 +7,7 @@
matlib
- 0.9.91
+ 0.9.95
diff --git a/docs/reference/cofactor.html b/docs/reference/cofactor.html
index aa3e9bd8..1ad63b6e 100644
--- a/docs/reference/cofactor.html
+++ b/docs/reference/cofactor.html
@@ -1,7 +1,7 @@
Cofactor of A[i,j] — cofactor • matlib
+sub-matrix that results when row i and column j are deleted.">
Skip to contents
@@ -9,7 +9,7 @@
matlib
- 0.9.91
+ 0.9.95
diff --git a/docs/reference/cone3d.html b/docs/reference/cone3d.html
index 1e8416f1..a3a46058 100644
--- a/docs/reference/cone3d.html
+++ b/docs/reference/cone3d.html
@@ -1,7 +1,7 @@
Draw a 3D cone — cone3d • matlib
+This is used to draw nice arrow heads in arrows3d.">
Skip to contents
@@ -9,7 +9,7 @@
matlib
- 0.9.91
+ 0.9.95
diff --git a/docs/reference/corner.html b/docs/reference/corner.html
index bc33b05d..ba5f72c8 100644
--- a/docs/reference/corner.html
+++ b/docs/reference/corner.html
@@ -1,7 +1,7 @@
Draw a corner showing the angle between two vectors — corner • matlib
+typically used for indicating orthogonal vectors are at right angles in 2D and 3D diagrams.">
Skip to contents
@@ -9,7 +9,7 @@
matlib
- 0.9.91
+ 0.9.95
diff --git a/docs/reference/determinant.latexMatrix.html b/docs/reference/determinant.latexMatrix.html
new file mode 100644
index 00000000..d7f85190
--- /dev/null
+++ b/docs/reference/determinant.latexMatrix.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/docs/reference/echelon.html b/docs/reference/echelon.html
index 11c860f3..125d016f 100644
--- a/docs/reference/echelon.html
+++ b/docs/reference/echelon.html
@@ -1,5 +1,5 @@
-Echelon Form of a Matrix — echelon • matlib
+Echelon Form of a Matrix — echelon • matlib
Skip to contents
@@ -7,7 +7,7 @@
matlib
- 0.9.91
+ 0.9.95
diff --git a/docs/reference/gaussianElimination.html b/docs/reference/gaussianElimination.html
index 796ebe1a..dd1d5ea3 100644
--- a/docs/reference/gaussianElimination.html
+++ b/docs/reference/gaussianElimination.html
@@ -3,7 +3,7 @@
systems of linear equations of the form \(A x = B\). Optional arguments verbose
and fractions may be used to see how the algorithm works.">
+and fractions may be used to see how the algorithm works.">
Skip to contents
@@ -11,7 +11,7 @@
matlib
- 0.9.91
+ 0.9.95
diff --git a/docs/reference/getBody.html b/docs/reference/getBody.html
new file mode 100644
index 00000000..6e6f239e
--- /dev/null
+++ b/docs/reference/getBody.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/docs/reference/getBody.latexMatrix.html b/docs/reference/getBody.latexMatrix.html
new file mode 100644
index 00000000..6e6f239e
--- /dev/null
+++ b/docs/reference/getBody.latexMatrix.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/docs/reference/getLatex.html b/docs/reference/getLatex.html
new file mode 100644
index 00000000..6e6f239e
--- /dev/null
+++ b/docs/reference/getLatex.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/docs/reference/getLatex.latexMatrix.html b/docs/reference/getLatex.latexMatrix.html
new file mode 100644
index 00000000..6e6f239e
--- /dev/null
+++ b/docs/reference/getLatex.latexMatrix.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/docs/reference/getWrapper.html b/docs/reference/getWrapper.html
new file mode 100644
index 00000000..6e6f239e
--- /dev/null
+++ b/docs/reference/getWrapper.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/docs/reference/getWrapper.latexMatrix.html b/docs/reference/getWrapper.latexMatrix.html
new file mode 100644
index 00000000..6e6f239e
--- /dev/null
+++ b/docs/reference/getWrapper.latexMatrix.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/docs/reference/getYmult.html b/docs/reference/getYmult.html
index 740de126..1fab6078 100644
--- a/docs/reference/getYmult.html
+++ b/docs/reference/getYmult.html
@@ -1,7 +1,7 @@
Correct for aspect and coordinate ratio — getYmult • matlib
+coordinate ratios on the current graphics device.">
Skip to contents
@@ -9,7 +9,7 @@
matlib
- 0.9.91
+ 0.9.95
diff --git a/docs/reference/gsorth.html b/docs/reference/gsorth.html
index d5fdcd71..ae5a8515 100644
--- a/docs/reference/gsorth.html
+++ b/docs/reference/gsorth.html
@@ -1,5 +1,5 @@
-Gram-Schmidt Orthogonalization of a Matrix — gsorth • matlib
+Gram-Schmidt Orthogonalization of a Matrix — gsorth • matlib
Skip to contents
@@ -7,7 +7,7 @@
matlib
- 0.9.91
+ 0.9.95
diff --git a/docs/reference/index.html b/docs/reference/index.html
index 203ad16d..9ef6e535 100644
--- a/docs/reference/index.html
+++ b/docs/reference/index.html
@@ -1,5 +1,5 @@
-Package index • matlib
+Package index • matlib
Skip to contents
@@ -7,7 +7,7 @@
matlib
- 0.9.91
+ 0.9.95
@@ -275,10 +275,10 @@ LaTeX matrices(Deprecated) Convert matrix to LaTeX equation
-
-
latexMatrix()
getLatex()
getBody()
getWrapper()
Dim()
Nrow()
Ncol()
print(<latexMatrix>)
is.numeric(<latexMatrix>)
as.double(<latexMatrix>)
`[`(<latexMatrix>)
cbind(<latexMatrix>)
rbind(<latexMatrix>)
+ latexMatrix()
partition()
getLatex()
getBody()
getWrapper()
Dim()
Nrow()
Ncol()
print(<latexMatrix>)
is.numeric(<latexMatrix>)
as.double(<latexMatrix>)
`[`(<latexMatrix>)
cbind(<latexMatrix>)
rbind(<latexMatrix>)
- - Create and Manipulate LaTeX Repesentations of Matrices
+ - Create and Manipulate LaTeX Representations of Matrices
-
matsum()
`+`(<latexMatrix>)
matdiff()
`-`(<latexMatrix>)
`*`(<latexMatrix>)
Dot()
matmult()
`%*%`(<latexMatrix>)
matpower()
`^`(<latexMatrix>)
inverse()
t(<latexMatrix>)
determinant(<latexMatrix>)
solve(<latexMatrix>)
kronecker(<latexMatrix>,<latexMatrix>)
`%X%`
@@ -287,7 +287,7 @@ LaTeX matricesVarious Functions and Operators for "latexMatrix"
Objects
-
-
Eqn()
Eqn_newline()
Eqn_text()
Eqn_hspace()
Eqn_size()
ref()
+ Eqn()
Eqn_newline()
Eqn_text()
Eqn_hspace()
Eqn_vspace()
Eqn_size()
ref()
- Create a LaTeX Equation Wrapper
diff --git a/docs/reference/inverse.latexMatrix.html b/docs/reference/inverse.latexMatrix.html
new file mode 100644
index 00000000..d7f85190
--- /dev/null
+++ b/docs/reference/inverse.latexMatrix.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/docs/reference/is.numeric.latexMatrix.html b/docs/reference/is.numeric.latexMatrix.html
new file mode 100644
index 00000000..6e6f239e
--- /dev/null
+++ b/docs/reference/is.numeric.latexMatrix.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/docs/reference/is_square.html b/docs/reference/is_square.html
index a4412de2..72480a24 100644
--- a/docs/reference/is_square.html
+++ b/docs/reference/is_square.html
@@ -3,7 +3,7 @@
Test for square, symmetric matrix
Test for orthogonal matrix">
+Test for orthogonal matrix">
Skip to contents
@@ -11,7 +11,7 @@
matlib
- 0.9.91
+ 0.9.95
diff --git a/docs/reference/kronecker,latexMatrix,latexMatrix-method.html b/docs/reference/kronecker,latexMatrix,latexMatrix-method.html
new file mode 100644
index 00000000..d7f85190
--- /dev/null
+++ b/docs/reference/kronecker,latexMatrix,latexMatrix-method.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/docs/reference/latexMatrix.html b/docs/reference/latexMatrix.html
index 0d60d784..381b246e 100644
--- a/docs/reference/latexMatrix.html
+++ b/docs/reference/latexMatrix.html
@@ -1,5 +1,5 @@
-Create and Manipulate LaTeX Repesentations of Matrices — latexMatrix • matlib
+ $$'>
Skip to contents
@@ -97,7 +97,7 @@
matlib
- 0.9.91
+ 0.9.95
@@ -132,7 +132,7 @@
@@ -192,7 +192,7 @@ Usage
symbol = "x",
nrow = "n",
ncol = "m",
- matrix = "pmatrix",
+ matrix = getOption("latexMatrixEnv"),
diag = FALSE,
sparse = FALSE,
zero.based = c(FALSE, FALSE),
@@ -209,6 +209,11 @@ Usage
prefix.col = ""
)
+partition(x, ...)
+
+# S3 method for class 'latexMatrix'
+partition(x, rows, columns, ...)
+
getLatex(x, ...)
# S3 method for class 'latexMatrix'
@@ -255,7 +260,7 @@ Usage
cbind(..., deparse.level)
# S3 method for class 'latexMatrix'
-rbind(..., deparse.level = 1)
+
rbind(..., deparse.level)