Expand row height in Latex table in textbox annotation

6 ビュー (過去 30 日間)
Brian Scannell
Brian Scannell 2018 年 8 月 8 日
コメント済み: Rémy Bretin 2021 年 1 月 14 日
Further to the very helpful answer to the question "How do I create a LaTeX table In a MATLAB text box?", is there a way to increase the row height?
I tried amending the previous example with the addition of \renewcommand{\arraystretch}{2} as follows:
cs = '\begin{tabular}{lll} \renewcommand{\arraystretch}{2} Chicago&U.S.A.&1893\\ Z\"{u}rich&Switzerland&1897\\ Paris&France&1900\\ Heidelberg&Germany&1904\\ Rome&Italy&1908 \end{tabular}';
figure;
ha = annotation('textbox',[0.5 0.5 0.4 0.2], 'Interpreter', 'latex', 'EdgeColor','none');
set(ha, 'String', cs);
but this made no difference.
Any suggestions?
  3 件のコメント
Brian Scannell
Brian Scannell 2021 年 1 月 13 日
Hi Rémy - a workaround that was ok from my persepective was to add in dummy rows, so at the start of each row I included
\rule{0pt}{14pt} \\[-1.25em]
followed by the content of the table row. I kept the row spacing identical, but I guess one could vary it by changing the value in the square brackets.
It is quite a while ago that I did this, so I had to go back to my code to find what I did. It is quite complicated as I basically construct a cell array that reflects the table and then extract the array contents into a very long string as the annotation text. However, for the row spacing I think this is the key element.
I hope that helps.
Rémy Bretin
Rémy Bretin 2021 年 1 月 14 日
Well, not exactly, but that gives me an idea for possible solution.
I would like to reduce the columns width.
I tried by changing "\begin{tabular}{lll}" by "\begin{tabular}{l{1cm}l{1cm}l{1cm}}" but this is not a "valid interpreter syntax".
Anyway, thank you for your amswer.
Have a gread day.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

製品


リリース

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by