编辑

编辑

我想对齐一些网址:

\documentclass[12pt,a4paper,oneside]{book}
\usepackage{url}

\begin{document}

 Figure 1:\; \url{my first url}
             \url{my second url}

\end{document}

我能怎么做?

编辑:我用过:

\documentclass[12pt,a4paper,oneside]{book}
\usepackage{url}

\begin{document}
\noindent
\begin{tabular}{@{}r@{\hspace{.5em}}l}

Figure 1: & \url{firsturl}
%
Figure 10: & \url{tenthurl}

\end{tabular}

\end{document} 

如何根据左边距对齐?

答案1

您可以使用tabulartabbing

\documentclass[12pt,a4paper,oneside]{book}
\usepackage{url}
%
\begin{document}
\noindent
\begin{tabular}{@{}r@{\hspace{.5em}}l}
  Figure 1: & \url{my first url} \\
            & \url{my second url} 
\end{tabular}

\noindent
\begin{tabbing}
  Figure 1: \= \url{my first url} \\
                     % \> for next tab, \\ for new line...
            \> \url{my second url} 
\end{tabbing}    
%
\end{document}

在此处输入图片描述

编辑

这是为了解决已编辑的问题:要Figure与左边距对齐,请将第一列类型从 更改rl

\documentclass[12pt,a4paper,oneside]{book} 
\usepackage{url}
\usepackage{showframe} %% just for showing the left margin as a line
\begin{document}
\noindent
\begin{tabular}{@{}l@{\hspace{.5em}}l}
Figure 1:  & \url{firsturl}\\
%
Figure 10: & \url{tenthurl}
\end{tabular}

\bigskip
\noindent
\begin{tabular}{@{}l@{}c@{\hspace{.5em}}l}
Figure 1  & : & \url{firsturl}\\
%
Figure 10 & : & \url{tenthurl}
\end{tabular}
%
\end{document}

在此处输入图片描述

相关内容