断开表格列中的链接

断开表格列中的链接

我正在使用此处提供的 acm latex 期刊模板:http://www.acm.org/publications/authors/submissions

这遵循单列格式。

在表格中,我有三列。第三列有 URL。但 URL 溢出了列。我该如何打破它们?

在此处输入图片描述

\documentclass[format=acmsmall, review=false, screen=true]{acmart}
\usepackage{booktabs} % For formal tables
\usepackage{subcaption}
\usepackage{array}
\usepackage{varwidth}
\usepackage{lipsum}
\begin{document}
\title[This is a Title]{This is a title}  
\maketitle

\section{Introduction}
\lipsum[2-8]

\begin{table}[!t]%
\caption{This Table}
\label{table:lexical_features}
\begin{minipage}{\columnwidth}
\begin{center}
\begin{tabular}{V{0.2\linewidth} V{0.5\linewidth} V{0.25\linewidth}}                              
\toprule
Feature Type & Description & Example\\ [0.5ex]
\midrule
Top Level Domain variant URL in blacklist & Checking whether different TLDs of the URL exist in blacklist & www.legitsite.com
www.legitsite.fr
www.legitsite.in etc.
\\
\addlinespace
IP Address Equivalence & URL with similar directory structure to a phishing URL but different domain names, pointing to same IP address & http://www.xyz.com/online.paypal.com and
http://www.abc.com/online.paypal.com both pointing to same IP address
\\
\addlinespace
Query String Substitution & Changing various parameters in URL & http://www.abc.com/online/ebay.php?abc
http://www.abc.com/online/ebay.php?xyz\\
\addlinespace
Nonmatching URLs & Link where text is URL but href attribute is different than the URL & <a href="www.paypal-login.com">https://www.paypal.com</a>\\
\bottomrule
\end{tabular}
\end{center}
\end{minipage}
\end{table}%

\lipsum[9-15]
\end{document}

另外,我还没有将表格中的所有行都放入 MWE 中。如果我有很多行,表格就会放在论文的末尾,而不是我想要的位置。

答案1

在此处输入图片描述

\documentclass{article}%[format=acmsmall, review=false, screen=true]{acmart}
\usepackage[margin=20mm]{geometry}
\usepackage{subcaption}
\usepackage{array, booktabs}

\usepackage{ragged2e}
\newcolumntype{L}[1]{>{\RaggedRight}p{#1}}
\usepackage[colorlinks=true,linkcolor={blue},citecolor={red},
            breaklinks=true
            ]{hyperref}
\usepackage{lipsum}

\begin{document}
%\title[This is a Title]{This is a title}
%\maketitle

\section{Introduction}
\lipsum[11]

\begin{table}[ht]%
\caption{This Table}
\label{table:lexical_features}
\centering
\begin{tabular}{L{\dimexpr0.2\linewidth-2\tabcolsep}
                L{\dimexpr0.5\linewidth-2\tabcolsep}
                L{\dimexpr0.3\linewidth-2\tabcolsep}
                }
\toprule
Feature Type & Description & Example\\ [0.5ex]
\midrule
Top Level Domain variant URL in blacklist
    & Checking whether different TLDs of the URL exist in blacklist
        &   \url{www.legitsite.com}
            \url{www.legitsite.fr}
            \url{ww.legitsite.in} etc.          \\
    \addlinespace
IP Address Equivalence
    & URL with similar directory structure to a phishing URL but different domain names, pointing to same IP address
        &   \url{http://www.xyz.com/online.paypal.com} and
            \url{http://www.abc.com/online.paypal.com}
            both pointing to same IP address    \\
    \addlinespace
Query String Substitution
    & Changing various parameters in URL
        &   \url{http://www.abc.com/online/ebay.php?abc}
            \url{http://www.abc.com/online/ebay.php?xyz}\\
    \addlinespace
Nonmatching URLs
    & Link where text is URL but href attribute is different than the URL
        &   \url{href="www.paypal-login.com">https://www.paypal.com}\\
    \bottomrule
\end{tabular}
\end{table}%

\lipsum
\end{document}

相关内容