0

For some reason, I have been unable to wrap an href within a table using the solutions presented here: Wrapping long lines that contain no spaces And, here: Forcing linebreaks in \url

Any suggestions or guidance is much appreciated!

Here is my MWE:

\documentclass[12pt,a4paper]{article}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{longtable}
\usepackage{array}
\usepackage{booktabs}
\usepackage{libertinus}
\usepackage{silence}
\WarningsOff[everypage]
\usepackage{everypage}
\pagenumbering{gobble}
\usepackage[hidelinks]{hyperref}
\hypersetup{pdfhighlight=/N}
\usepackage[margin=1cm, top=0cm, bottom=0cm]{geometry}
\usepackage{seqsplit}
\newcommand\wrap[2]{
    \begin{minipage}{#1}
    \seqsplit{#2}
    \end{minipage}
    }
\newcommand{\myorg}{\textbf{myorg}}
\newcommand{\mypublishingcompany}{\href{https://myorg.org}{myorg.org}}
\newcommand{\mycompany}{\href{https://myorg.com}{myorg.com}}
\newcommand{\ethaddressrawlink}[1]{\href{https://etherscan.io/address/#1}{#1}}
\newcommand{\ipfsrawlink}[1]{\href{https://ipfs.io/ipfs/#1}{#1}}
\newcommand{\nftaddress}{0x47fc890be8b1070c114bdff796915e4952fcf6a7}
\newcommand{\cidaddress}{QmUduh3i1YVgWd7bbjcvnFgnbF48uD7rJ6er2ogcA6gyrj}
\begin{document}
\color{blue}
\footnotesize
\begin{longtable}[l]{@{}p{1.5cm}
    >{\raggedright\arraybackslash}p{1.5cm}
    >{\raggedright\arraybackslash}p{3.5cm}
    >{\raggedright\arraybackslash}p{3.5cm}@{}}
\toprule
\textbf{URL} & \textbf{Version} & \textbf{NFT}   & \textbf{CID} \\
\midrule
    \textit{\mycompany} & $1.0i$    & \textcolor{red}{\textsl{\ethaddressrawlink{\nftaddress}}}  & \textcolor{teal}{\textsl{\ipfsrawlink{\cidaddress}}}\\ 
                \\
     \textit{\mypublishingcompany} & $1.1o$  & \wrap{2.5cm}{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} & \wrap{3.3cm}{zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz}\\
                    \\
    \textit{\mypublishingcompany} & $1.0o$  &   
      \lipsum[1] & \lipsum[1]\\ 
                    \\
\bottomrule
\end{longtable}
\end{document}

Steven
  • 317
  • 3
    make your example shorter. There is no need to load lots of unrelated packages to demonstrate such a problem. – Ulrike Fischer Jun 17 '23 at 08:56
  • 3
    why are you using a longtable in a minipage ?? the former has the sole purpose of allowing page breaks, the latter has the sole purpose of preventing page breaks – David Carlisle Jun 17 '23 at 11:00
  • @UlrikeFischer Thanks for pointing that out. I apologize for not really working hard at minimizing towards only the necessary code. I've now done that to the best of my ability. – Steven Jun 17 '23 at 21:53
  • @DavidCarlisle Thanks for pointing out this important point. I am going to dive into that issue further to see if I can let go of the use of longtable. – Steven Jun 17 '23 at 21:55
  • @DavidCarlisle I tried swapping out the longtable for a tabularx but that did not resolve the issue unfortunately. – Steven Jun 18 '23 at 08:48
  • @DavidCarlisle I have also removed the \minipage environment, but that made no difference. – Steven Jun 24 '23 at 01:24

0 Answers0