MATLAB Report Generator Table Avoid Word Splitting

16 visualizaciones (últimos 30 días)
Emmanouil
Emmanouil el 19 de Abr. de 2019
Editada: Emmanouil el 23 de Abr. de 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);

Respuesta aceptada

Paul Kinnucan
Paul Kinnucan el 23 de Abr. de 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 comentario
Emmanouil
Emmanouil el 23 de Abr. de 2019
Editada: Emmanouil el 23 de Abr. de 2019
Thanks Paul, works like a charm :)

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by