MATLAB Report Generator Table Avoid Word Splitting

10 次查看(过去 30 天)
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);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Report Generator 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by