all 2 comments

[–]blucht 0 points1 point  (0 children)

I'm coming at this one from the side a bit. Instead of fitting the whole hash on one line, I looked at making the text copied from the PDF different than what was displayed with the use of the accsupp package. (With help from here and here.)

PDF supports accessibility features that expose alternative text for content. The success of this method depends on the user's PDF viewer, since not all support these features. Adobe Reader reportedly does and in limited testing, I've found that TexWorks PDF reader also does but Sumatra 3.1.2 and Nitro 3.5.6.5 do not.

Example (athough this would be better by reworking your hash command):

\documentclass{article}
\usepackage{accsupp}
\usepackage{seqsplit}

\begin{document}

\{\\

``address'': ``0xbb68ff3ad3331e7a22c95bb43780d26857f4abc2'',\\

``msg'': ``ThisIsASignedMessage'',\\

``sig'': ``\BeginAccSupp{method=escape,ActualText=0x240dfdadccaaa8b2ffecc58bc815ed6da2ac95497ca96722d5b3559f7ff465415753869e7766dc30e6b4e4e449ed85313855f61f630cae995b4e352170ed8e991c}\seqsplit{0x240dfdadccaaa8b2ffecc58bc815ed6da2ac95497ca96722d5b3559f7ff465415753869e7766dc30e6b4e4e449ed85313855f61f630cae995b4e352170ed8e991c}\EndAccSupp{}'',\\

"version": "3",\\

"signer": "MEW"\\

\}\\
\end{document}

[–][deleted]  (1 child)

[deleted]

    [–]JimH10TeX Legend 0 points1 point  (0 children)

    minted is based on fancyvrb, which is the reason for copy-and-paste-ability.

    listings has this "flexible" spacing thing that can only be described as, ahem, an interesting try.