MATLAB Report Generator Table Avoid Word Splitting
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Emmanouil
le 19 Avr 2019
Modifié(e) : Emmanouil
le 23 Avr 2019
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);
0 commentaires
Réponse acceptée
Paul Kinnucan
le 23 Avr 2019
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 commentaire
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur MATLAB Report Generator dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!