下圖所示的文字如何左對齊?

下圖所示的文字如何左對齊?

我被困在中間,我需要將文字左對齊蘇拉吉·普拉卡什·夏爾馬,電子郵件,GitHub,領英

如下圖,可以看到我用紅框標註的空間。我想刪除該空格,以便文檔中的文字左對齊。

文件影像

下面是產生上述文件的 Latex 程式碼:

\documentclass[a4paper,10pt]{article}
\usepackage{anysize}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=0.75in, right=0.75in, top=0.5in, bottom=0.75in, includefoot, headheight=13.6pt]{geometry}
\usepackage{color,graphicx}
\usepackage{verbatim}
\usepackage{hyperref}
\usepackage{multirow}
\usepackage{latexsym}
\usepackage{mdwlist}
\usepackage{tabularx}

\renewcommand{\labelitemii}{$\circ$}

\hypersetup{
    % bookmarks=true,         % show bookmarks bar?
    unicode=true,          % non-Latin characters in Acrobat's bookmarks
    pdftoolbar=true,        % show Acrobat's toolbar?
    pdfmenubar=true,        % show Acrobat's menu?
    pdffitwindow=true,      % page fit to window when opened
    pdftitle={CV - Suraj Prakash Sharma},    % title
    pdfauthor={Suraj},     % author
    pdfsubject={Resume},   % subject of the document
    colorlinks=true,       % false: boxed links; true: colored links
    linkcolor=magenta,        % color of internal links
    citecolor=blue,        % color of links to bibliography
    filecolor=magenta,      % color of file links
    urlcolor=blue           % color of external links
}

% Margines

\addtolength{\oddsidemargin}{-0.215in}
\addtolength{\textwidth}{0.2in}

\definecolor{titleColor}{rgb}{0.85, 0.85, 0.85}

\begin{document}

%%%%%%%%% vertical space %%%%%%%%%%%%%%%%%

\begin{table}[h!]
     \begin{center}
     \begin{tabular}{l  p{8cm}  p{8cm}}
     &
     \begin{itemize}
     \setlength\itemsep{.01em}
        \item[] \textbf{\Large Suraj Prakash Sharma}
        % \item[] \textbf{Bachelor of Technology in Computer Science Engineering}
        % \item[] \textbf{NIIT University Rajasthan, India}
        \item[] \textbf{Email: }
        \item [] \textbf{GitHub: }
        % \item[] \textbf{Skype ID: }
        \item[] \textbf{LinkedIn: }
    \end{itemize}
     &
     \begin{itemize}
        \setlength\itemsep{.01em}
        \item[] \textbf{\large NIIT University, Rajasthan}
        \item[] \textbf{Bachelor of Technology}
        \item[] \textbf{Computer Science \& Engineering}
        \item[] \textbf{Phone: }
    \end{itemize}
    \end{tabular}
    \end{center}
  \end{table}
  \vspace{-.8cm}

\begin{tabularx}{.98\textwidth}{llp{2cm}lll}
    \hline
    \textbf{Examination} & \textbf{Specialization} & & \textbf{University / Board} & \textbf{Year} & \textbf{CPI}\\
   \hline
\end{tabularx}
  \end{document}

誰能幫我解決這個問題嗎?

答案1

您指出的具體問題可以使用以下方法解決

\noindent
\begin{tabular}{@{}p{5.8cm}  p{10cm}}
\begin{itemize}[leftmargin=0pt]

在此輸入影像描述

但是,您最好像tabular下面的第二個 MWE 一樣使用,結果是:

在此輸入影像描述

\arraystretch如果您想要更多的行間距,可以增加行間距。

代碼:

\documentclass{article}
\usepackage{showframe}
\usepackage{enumitem}

\begin{document}
\noindent
\begin{tabular}{@{}p{5.8cm}  p{10cm}}
 \begin{itemize}[leftmargin=0pt]
 \setlength\itemsep{.01em}
    \item[] \textbf{\Large Suraj Prakash Sharma}
    \item[] \textbf{Email: }
    \item[] \textbf{GitHub: }
    \item[] \textbf{LinkedIn: }
\end{itemize}
 &
 \begin{itemize}[leftmargin=0pt]
    \setlength\itemsep{.01em}
    \item[] \textbf{\large NIIT University, Rajasthan}
    \item[] \textbf{Bachelor of Technology}
    \item[] \textbf{Computer Science \& Engineering}
    \item[] \textbf{Phone: }
\end{itemize}
\end{tabular}
\end{document}

代碼:tabular

\documentclass{article}
\usepackage{showframe}

\begin{document}
\noindent
{%
\renewcommand{\arraystretch}{1.1}%
\begin{tabular}{@{}l@{}}
    \textbf{\Large Suraj Prakash Sharma} \\
    \textbf{Email: }  \\
    \textbf{GitHub: } \\
    \textbf{LinkedIn: } \\
\end{tabular}%
\hfill%
\begin{tabular}{@{}l@{}}
    \textbf{\large NIIT University, Rajasthan} \\
    \textbf{Bachelor of Technology} \\
    \textbf{Computer Science \& Engineering} \\
    \textbf{Phone: } \\
\end{tabular}%
}%
\end{document}

相關內容