This is minimal (not) working example that comes from much bigger document:
\documentclass{article}
\usepackage{adjustbox}
\usepackage{hyperref}
\begin{document}
\newcommand\hreftt[2]{%
\href{#1}{\texttt{#2}}%
}
\newcommand{\rubylink}{\href{https://en.wikipedia.org/wiki/Ruby_(programming_language)}{Ruby}}
\newcommand{\erlanglink}{\href{https://en.wikipedia.org/wiki/Erlang_(programming_language)}{Erlang}}
\newcommand{\pythonlink}{\href{https://en.wikipedia.org/wiki/Python_(programming_language)}{Python}}
\newcommand{\powershelllink}{\href{https://en.wikipedia.org/wiki/PowerShell}{PowerShell}}
\begin{table}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{l|l|l|l|l}
Programming language & \rubylink & \rubylink, \erlanglink & \pythonlink, \powershelllink & \pythonlink \\\hline
Something & aaaaaaaaaaaaaaaaa & bbbbbbbbbbbbb & ccccccccccccc & dddddddddddddddddddd
\end{tabular}
\end{adjustbox}
\caption{This is test}
\end{table}
\end{document}
When I compile it with the command latexmk -pdf it produces correct PDF:
But when I compile with XeLaTeX, like that: latexmk -pdf -pdflatex=xelatex it produces:
Unfortunately I need to use XeLaTeX and the above example needs to produce correct PDF. How can I fix misplaced hyperlinks?



\textwidth. On the one hand too wide table looks ugly, but on the other hand, as @Ulrike Fischer mentioned, scaling a tabular is bad typesetting. – patryk.beza May 06 '17 at 08:24tabular? It should always be possible to use\smallor reduce\tabcolsepor some other way of adjusting the table. – David Carlisle May 06 '17 at 08:44\footnotesizeand it looks much better now. Thank you! – patryk.beza May 06 '17 at 08:53