Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

All of my text in my table wraps except for line 13, which I have copied below. The website runs off to the side of the page. I'd like it to wrap the web address. Can anyone help?

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage{longtable}
\begin{document}
\maketitle
\begin{center}
\begin{longtable}{|l|p{13cm}|}
\caption[]{Disqus IT} \label{DisqusIT} \\
\hline \multicolumn{1}{|c|}{\textbf{ Sample }} & \multicolumn{1}{p{13cm}|}{\textbf{Text}} \\ \hline 
\endfirsthead
\multicolumn{2}{c}%
{{\bfseries \tablename\ \thetable{} -- Disqus IT continued from previous page}} \\
\hline \multicolumn{1}{|c|}{\textbf{ Sample }} &
\multicolumn{1}{c|}{\textbf{Text}} \\ \hline 
\endhead
\hline \multicolumn{2}{|r|}{{Continued on next page}} \\ \hline
\endfoot
\hline \hline
\endlastfoot
  13 I really really really really like to think about this stuff: http://www.senate.gov/legislative/LIS/roll\_call\_lists/roll\_call\_vote\_cfm.cfm?congress=113\&session=1\&vote=00032 \\ 
\end{longtable}
\end{center}
\end{document}
share|improve this question
2  
Welcome to TeX.sx! Instead of “escaping” _ and & manually you should take a look at the \url macro of the url/hyperref package. Take a look at another question that discussed this: Forcing linebreaks in \url –  Qrrbrbirlbel Apr 4 '13 at 5:24
    
In addition to encasing the URL in an \url{...} construct, as pointed out by @Qrrbrbirlbel, you should probably also place a & between 13 and I really really .... –  Mico Apr 4 '13 at 5:58
add comment

1 Answer

it makes no sense to have such a long url in a tabular column which doesn't allow a linebreak. USe package ltablex then you can use the environment tabularx which behaves like a longtable. The package is available at http://www.ctan.org/tex-archive/macros/latex/contrib/ltablex

It has no correct license statement. The reason why it is not on TeXLive and maybe MikTeX, too.

\documentclass{article}
\usepackage{ltablex}
\usepackage{url}
\begin{document}

\noindent
\begin{tabularx}{\linewidth}{|X|p{13cm}|}
\caption{Disqus IT \label{DisqusIT}} \\\hline 
\multicolumn{1}{|c|}{\textbf{ Sample }} & \multicolumn{1}{p{13cm}|}{\textbf{Text}} \\ \hline 
\endfirsthead
\multicolumn{2}{c}{{\bfseries \tablename\ \thetable{} -- Disqus IT continued from previous page}} \\\hline
\multicolumn{1}{|c|}{\textbf{ Sample }} & \multicolumn{1}{c|}{\textbf{Text}} \\ \hline 
\endhead
\hline \multicolumn{2}{|r|}{{Continued on next page}} \\ \hline
\endfoot
\hline \hline
\endlastfoot

  13 I really like to think about this stuff: \url{http://www.senate.gov/legislative/LIS/roll_call_lists/roll_call_vote_cfm.cfm?congress=113&session=1&vote=00032} & 
\end{tabularx}

\end{document}

enter image description here

share|improve this answer
    
ltablex is included in miktex. –  Harish Kumar Apr 4 '13 at 13:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.