JupyterLab: how to display line numbers in **output** - jupyter

Background
As discussed in this question, line numbers can be activated in code cells in a JupyterLab notebook. It shows line numbers in the code cells only. The output cells do not have line numbers.
Question
How to display line numbers in the output cell?

Related

Visual Studio Code - Notebook output cell line spacing

How can I control the line spacing in Visual Studio Code output cells? See example. The output cells have lines spaced with about 0.5 line spacing, but the terminal cells (and also code) have smaller line spacing.

MATLAB export Live Script as pdf with line numbers displayed?

I have a MATLAB Live Script (.mlx) that I am exporting to a pdf in order to print/share. I have the line numbers displayed in the script while working with it in the live editor, but when I export the script to a pdf, the line numbers are gone.
Is there a way to make the line numbers display in the pdf output as well?
To be clear, I have already enabled line numbers using the 'View' tab in MATLAB. It is the pdf output that I am trying to get the line numbers to display in.
Thank you!

Justify legend text in Matlab

I have the legend shown below:
On the left, the text is aligned, however, on the right the numbers are not aligned. How can I align the numbers too?
The tab command (\t) does not seem to work when providing strings to table entries. However, you can solve the problem if you work in the latex environment, define every entry as a single-row tabular and define the first column to have a specific width (e.g. 1 cm):
plot(eye(2)); % example plot
h=legend('\begin{tabular}{p{1cm}r}first:&1\end{tabular}',...
'\begin{tabular}{p{1cm}r}second:&2\end{tabular}'); % table entries in latex
set(h,'interpreter','latex'); % set interpreter

iText split PdfPCell when cell is kept together

I am using a table to create a semblance of what is depicted below. The content I'm generating isn't known before hand. The blue sections of the columns are cells that are kept together in the table and I am using ColumnText to display the table. For clarification I have outlined a sample cell layout in the top right of the image. The problem I'm running into is that when I use setSplitLate(false) with setSplitRows(true) alongside with using keepRowsTogether(int[] rows) the splitting doesn't work correctly. Most of the top right section should be able to fit into the bottom left but as shown in the image it is all moved to the top of the next column.
Is there a way to cause the cell to split as well as keep together with it's header? When I remove the keepRowsTogether(int[] rows) call the cell splitting works as expected.
Also, in my situation I only want it to split if there are two lines at the end of the column and two at the beginning of the next. In other words the cell would only split if it contained 4 lines of text. How would I go about doing this?
I modified the top right column as depicted below, blue representing the rows that are kept together.
As depicted, I have a cell for the header as before but I've split up the paragraph into many different cells. The first and last contain cells with two lines of text and the rest contain one line of text. This way I'm guaranteed that the header will stick with at least the first two lines of the bulleted paragraph. If the last two lines, or the last cell, end up not fitting in the column then because the cell contains two lines, I'm guaranteed that at least two lines will be carried over to the next column, if not more, depending on how many of the middle lines carry over as well.

How to display multilines output in a line (Horizontal view) in Matlab?

I have made an program that can display many outputs in same textbox in matlab.
The main program do looping and the GUI catch the output and display the outputs in same textbox. But the problem is that the output is displayed in new line.
Iwan to display the output just in one line..
How to do it?
Here is my Gcode to display the output in the GUI.
letterr = ProcessOutput;
set(handles.text4,'String',letterr);
you can use
set(handles.text4,'String',strjoin(letterr));
depending on the version of matlab you are using, this function is implemented or not. If not, you can get it from here:
File-exchange: strjoin