フィルターのクリア

MATLAB Report Generator Table Avoid Word Splitting

8 ビュー (過去 30 日間)
Emmanouil
Emmanouil 2019 年 4 月 19 日
編集済み: Emmanouil 2019 年 4 月 23 日
Hi,
I am using MATLAB R2018b and I am constructing a Table in Report Generator that has strings as entries. When a string has many words it is possible that it breaks into more than one line. However, the breaks often force a single word to split between the lines. I want the line break to avoid splitting any words, that is to be forced only to the spaces of the string.
For example, after running the following piece of code we can see that the words "Krankenversicherungskarte" and "Lebensabschnittpartner" are split between two lines (see attachement).
Is there a neat way to avoid this?
% import package
import mlreportgen.dom.*
% create the document object
doc_obj = Document('MATLAB_test_report','pdf');
% table
tableObj = Table ( {'Some big German words','The first is Krankenversicherungskarte','The second is Lebensabschnittspartner'} ) ;
% append
append ( doc_obj , tableObj ) ;
% close document
close(doc_obj);
% display
rptview(doc_obj);

採用された回答

Paul Kinnucan
Paul Kinnucan 2019 年 4 月 23 日
The Report Generator hyphenates table entries by default to fit symbolic and numeric data into an entry. You can use the Hyphenation format to disable this behavior for natural language content.
% import package
import mlreportgen.dom.*
% create the document object
doc_obj = Document('MATLAB_test_report','pdf');
% table
tableObj = Table ( {'Some big German words','The first is Krankenversicherungskarte','The second is Lebensabschnittspartner'} ) ;
tableObj.Style = {Hyphenation(false)};
% append
append ( doc_obj , tableObj ) ;
% close document
close(doc_obj);
% display
rptview(doc_obj);
  1 件のコメント
Emmanouil
Emmanouil 2019 年 4 月 23 日
編集済み: Emmanouil 2019 年 4 月 23 日
Thanks Paul, works like a charm :)

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

その他の回答 (0 件)

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by