1

When I want to resize a table to textwidth, links to web pages and references are not functioning anymore (the hyperlink boxes are moved to another place) whereas I don't encounter this problem when I don't resize a table to textwidth.

However, I need to do this and both resizebox (1st example) and adjustbox (2nd example) give problems.

How can I solve this? Thank you! (I work in TeXstudio and use LuaLaTeX for compilation)

\documentclass{article}

\usepackage{booktabs}
\usepackage{adjustbox}
\usepackage{graphicx}
\usepackage{hyperref}

\begin{document}

%%% change size by resizebox
\begin{table}[]
    \centering
    \caption{Caption for the table.}
    \label{tab:table1}
    \resizebox{\textwidth}{!}{% 
    \begin{tabular}{@{}llll@{}}
        \toprule
        \textbf{A} & \textbf{B} & \textbf{C}   \\ \midrule
        Problems & Help & \href{stackoverflow.com}    {stackstacksstackstackstacktacstackstackstackstackstackstackstack} \\
        & Search & \href{google.com}{Your friend}     \\
   \bottomrule
    \end{tabular}
    }   
\end{table}

%%% change size by adjustbox
\begin{table}[]
    \centering
    \caption{Caption for the table.}
    \label{tab:table2}
     \begin{adjustbox}{max width=\textwidth}
    \begin{tabular}{@{}llll@{}}
        \toprule
        \textbf{A} & \textbf{B} & \textbf{C}   \\ \midrule
        Problems & Help & \href{stackoverflow.com}    {stackstacksstackstackstacktacstackstackstackstackstackstackstack} \\
        & Search & \href{google.com}{Your friend}     \\
        \bottomrule
    \end{tabular}
     \end{adjustbox}
\end{table}
\end{document}

closed as unclear what you're asking by Moriambar, Torbjørn T., egreg, Zarko, Henri Menke Jun 19 '17 at 21:21

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Your links are wrong it should be \href{http://stackoverflow.com} but beside this it works fine for me. I tried with texlive 2016 and 2017 (pretest). You should be aware that it is not good practice to resize a tabular like this, you will get uneven font sizes. – Ulrike Fischer Apr 21 '17 at 15:08