0

I have following code:

\documentclass{article}

\setlength{\arrayrulewidth}{0.5mm} \setlength{\tabcolsep}{18pt} \renewcommand{\arraystretch}{2.5} \usepackage{longtable} \usepackage{array} \usepackage{booktabs} \usepackage{url}

\setlength\arrayrulewidth{1pt} \setlength\tabcolsep{1pt} \renewcommand\arraystretch{1.5}

\newenvironment{mylongtable}[2]{% \begin{longtable}{@{\hspace{1em}}#1@{}} #2} { \end{longtable}% }\setlength\columnwidth{1pt} \setlength\columnsep{10pt} \newcommand\myLTleftcolumnwidth{\dimexpr\textwidth*0.1} \newcommand\myvline{\vrule width 1pt} \setlength{\parindent}{0pt}

\begin{document}

\begin{mylongtable}{@{} >{\raggedright\arraybackslash}p{0.6\columnwidth} | >{\raggedright\arraybackslash}p{0.4\columnwidth}@{}} \toprule

\begin{minipage}[b]{\linewidth}\raggedright \large Gruppenrichtlinieneinstellung \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright

\large Empfohlene Option \end{minipage} \ \endhead

\emph{Pfad:} \path{Computer Configuration\Policies\Administrative Templates\Windows Components\Microsoft Defender Application Guard} & \ Allow camera and microphone access in Microsoft Defender Application Guard & Disabled \ Allow auditing events in Microsoft Defender Application Guard & Enabled \ Allow data persistence for Microsoft Defender Application Guard & Disabled \

\end{mylongtable}

\end{document}

which makes my document look like this

enter image description here

When copying the Paths it looks like this, which is expected.

enter image description here

Now my question is if there is any easy way to put everything in one line on copy? Or something simple to do linebreaks but treat everything as one line?

Ezmo
  • 3

1 Answers1

1

PDF readers use heuristics for copy&paste and without additional info a linebreak is typically interpreted as space.

You can try the accsupp package:

\documentclass{article}
\usepackage{url}
\usepackage{accsupp}

\textwidth=5cm \raggedright \begin{document} \BeginAccSupp{ActualText= ComputerConfiguration\string\Policies\string\AdministrativeTemplates\string\WindowsComponents\string\MicrosoftDefender ApplicationGuard}% \path{Computer Configuration\Policies\Administrative Templates\Windows Components\Microsoft Defender Application Guard}% \EndAccSupp{} \end{document}

An alternative is to produce a tagged PDF, but this helps only in PDF viewers which can handle tagging (and would need manually work for the longtable, as the LaTeX code doesn't support yet tables automatically).

See e.g. https://tug.org/tug2023/files/sa-06-fischer-tagging/fischer-tagging-slides.pdf

Ulrike Fischer
  • 327,261