Hey im looking to create a text wrap command to be used inside a table for long word wrapping. so far i have this:
\renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi}
\newcommand{\wrap}[1]{\seqinsert{\seqsplit{#1}}} % used to wrap really long words
This is working good. The problem is the seqsplit is removing the spaces. How to preserve the spaces in the text? The data coming in the table is dynamic, so gluing the words together with "~" or "/ " wont work.
Ive tried using:
\newcommand{\wrap}[1]{\seqinsert{\seqsplit{\StrSubstitute{#1}{ }{\~{}}}}} % used to wrap really long words
but this errors out. Id like to achieve this on the latex side so programmers using my template dont have to worry about formatting. any help will be great thanks
sample code:
\documentclass{report}
%%%%%%%%%%%%%%%%%%%%%%
% Package Inclusions %
%%%%%%%%%%%%%%%%%%%%%%
\usepackage{lastpage}
\usepackage{caption}
\usepackage{geometry}
\usepackage{tabularx}
\usepackage{hhline}
\usepackage[table]{xcolor}
\usepackage{placeins}
\usepackage{setspace}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{tabu}
\usepackage{longtable}
\usepackage{seqsplit}
\usepackage{xstring}
\usepackage{multicol}
\usepackage{multirow}
%%%%%%%%%%%%%%%%%%%%%%
% Configurations %
%%%%%%%%%%%%%%%%%%%%%%
\captionsetup[table]{labelformat=empty}
\definecolor{lightgray}{gray}{0.9}
\newcolumntype{Y}{>{\centering\arraybackslash}X} % Use Y to center align a column
\geometry{
top=0.75in,
inner=0.25in,
outer=0.25in,
bottom=0.75in,
headheight=3ex,
headsep=6ex,
}
\pagestyle{fancy}
\renewcommand{\baselinestretch}{1}
\renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi}
\newcommand{\wrap}[1]{\seqinsert{\seqsplit{#1}}} % used to wrap really long words
\newcommand{\wrapb}[1]{\textbf{\seqinsert{\seqsplit{#1}}}} % used to wrap really long words and bold it
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Titles, Headers and Footers %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\author{XXXXXXXXXX}
\title{XXXXXXX}
\lhead{XXXXXXXXXXXXXXX}
\chead{XXXXXXXXXXXXXX}
\rhead{XXXXXXXXXXXXXXXXXX}
\lfoot{Page \thepage\ of \pageref{LastPage}}
\cfoot{XXXXXXXXXXXXXXXXXXXXXXXX}
\rfoot{\fancyplain{}{\today}}
%%%%%%%%%%%%%%%%%%%%%%
% Report Start %
%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\maketitle
\section*{XXXXXXXXXXXXXXXXXXXX}
\begin{table}[H]
\rowcolors{1}{}{lightgray}
\begin{longtabu} to \textwidth {YYYYYYYYYYYYY}
\hline
\textbf{XXX} &
\textbf{XX} &
\textbf{XXX} &
\textbf{XXX} &
\textbf{XXX} &
\textbf{XXX} &
\textbf{XXXX} &
\textbf{XX} &
\textbf{XXX} &
\textbf{XXX} &
\textbf{XXX} &
\textbf{X} &
\textbf{XXX}
\\ \hline \hline \hline
12:28:33 & 1 & \wrap{tyry ery,CVBBBdsgsdgsdgdsgsg} & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
12:28:33 & 1 & tyryery, CVBBB & -3750.00 & 1110.00 & 1110.00 & 1 to 20 & 1109.93 &
1109.93 & 1 to 20 & 1 to 20 & 4651.59 & 4651.59 \\
\hline
\end{longtabu}
\end{table}
\end{document}
\seqsplit
?\seqinsert{\seqsplit{#1}}
doesn't make any sense.