Ask Your Question

rob's profile - activity

2021-01-17 13:48:19 +0200 received badge  Editor (source)
2021-01-17 13:46:20 +0200 answered a question How show vector or matrix in legend label of plot in latex?

The following code won't work:

plot(x^2, legend_label=r'$v=\left[\begin{array}{r}1\\0\end{array}\right]$')

But if the type of parentheses doesn't matter (and for me it doesn't, I just care about the vertical vector) then the simple workaround, without having to install additional packages, is to use \binom:

plot(x^2, legend_label=r'$v=\binom{1}{1}$')

Thank you again @dsejas for inspiration to find such a solution.

2021-01-17 13:24:56 +0200 commented answer How show vector or matrix in legend label of plot in latex?

As for suggestions. Unfortunately, I don't know how to upload a graphic file that visualizes my needs. The legend is to describe the coordinates of the transformed vectors presented on the plot, regardless of their showing outside the plot. Comparing horizontally written vectors is not as clear as vertical ones. And it wasn't so much about the matrix notation as it was about writing the vertical vectors. In text mode, representing the vertical vector itself was fine. But adding the vector name before it corrupts the printout.

Regarding the use of environments other than array. The horizontal separator \hline is the same as for the array environment. But how do I insert in bmatrix a (vertical) column separator used for example to represent block matrices?

2021-01-17 13:20:06 +0200 commented answer How show vector or matrix in legend label of plot in latex?

Thanks for your reply and suggestions. In CoCalc it works. Unfortunately, as you wrote in my local installation, it doesn't work (neither in jupyter nor in console). I am getting an error:

/opt/sagemath-9.2/local/lib/python3.7/site-packages/sage/repl/rich_output/display_manager.py:593: RichReprWarning: Exception in _rich_repr_ while displaying object: Failed to process string with tex because latex could not be found RichReprWarning,

But I found a very simple satisfactory workaround that requires no additional installations. (answer below)

2021-01-16 14:32:42 +0200 asked a question How show vector or matrix in legend label of plot in latex?

We can insert latex in legend labels by surrounding the text with '$'. But it doesn't work for a vector (matrix, array), e.g.

\left[\begin{array}{r} 1 \\ 0 \end{array}\right]

Is there any way to display vector in latex in legend label?

2020-12-18 13:15:59 +0200 received badge  Supporter (source)
2020-11-23 18:22:55 +0200 commented answer How change latex background text color in jupyter?

Thank you very much. This is it:

Math(r"\require{color}\colorbox{green}{a}")
2020-11-23 18:13:35 +0200 received badge  Scholar (source)
2020-11-22 21:10:22 +0200 received badge  Student (source)
2020-11-22 17:23:43 +0200 asked a question How change latex background text color in jupyter?

Expression Math( r"\color{green}{sample}") displays green text in latex in jupyter workbook. What is the directive to change the background color of the text? The directives \textcolor, \colorbox do not work.

2020-11-22 17:23:43 +0200 asked a question How change latex text background color in jupyter?

Expression Math( r"\color{green}{sample}") displays green text in latex in jupyter workbook. What is the directive to change the background color of the text? The directives \textcolor, \colorbox do not work.