Estou usando ummodelopara fazer meu currículo, mas me deparei com um problema. Tentei remover todos os códigos essenciais do MWE abaixo. Faz duas mesas. Na primeira tabela, o marcador não está alinhado com o texto da primeira coluna, mas na segunda tabela, sem o marcador, o texto está alinhado corretamente. Alguém pode ajudar a corrigir esse problema de alinhamento?
MWE:
\documentclass[12pt,letterpaper,twoside]{article}
\usepackage{array}% required for defining newcolumntype with custom vrule
\usepackage{longtable}% normal \tabular environment does not allow page breaks
\setlength{\LTpre}{0pt}% glue before longtable
\addtolength{\LTpost}{0pt}% glue after longtable
\newcommand{\datewidth}{0.21}
\newcommand{\bodywidth}{0.75}
\newcolumntype{L}{>{\raggedright}p{\datewidth\textwidth}}
\newcolumntype{R}{p{\bodywidth\textwidth}}
\newenvironment{cvsection}{%
\setlength{\extrarowheight}{0.40ex}
\begin{longtable}[l]{@{} L R @{}}
% Comment line above and uncomment line below to add gray vrule between date and body.
% \begin{longtable}{@{} L !{\myvrule} R @{}}
}{%
\end{longtable}
}
\begin{document}
\begin{cvsection}
abc1 & \parbox[t]{\bodywidth\textwidth}{%
\begin {itemize} \item {\footnotesize TEST TEXT TEST TEXT TEST TEXT TEST TEXT TEST TEXTTEST TEXTTEST TEXT.}
\end {itemize} }\\
\end{cvsection}
\begin{cvsection}
abc2 & \parbox[t]{\bodywidth\textwidth}{%
{\footnotesize TEST TEXT TEST TEXT TEST TEXT TEST TEXT TEST TEXTTEST
TEXTTEST TEXT.} }\\
\end{cvsection}
\end{document}
Responder1
Isso se deve ao fato de o ambiente de listas adicionar um espaçamento vertical ao texto antes e depois da lista. Você pode enganar o LaTeX fazendo-o acreditar que está no início de uma minipágina: neste caso, não há espaço acima, por razões óbvias. É isso que a \compress
macro faz.
Além disso, alinhei o marcador com o início do texto da outra tabela, pois não há necessidade de recuar o marcador, na minha opinião, com a ajuda do enumitem
pacote.
\documentclass[12pt,letterpaper,twoside]{article}
\usepackage{array}% required for defining newcolumntype with custom vrule
\usepackage{longtable}% normal \tabular environment does not allow page breaks
\makeatletter
\newcommand*{\compress}{\@minipagetrue}
\makeatother
\usepackage{enumitem}
\setlength{\LTpre}{0pt}% glue before longtable
\addtolength{\LTpost}{0pt}% glue after longtable
\newcommand{\datewidth}{0.21}
\newcommand{\bodywidth}{0.75}
\newcolumntype{L}{>{\raggedright}p{\datewidth\textwidth}}
\newcolumntype{R}{p{\bodywidth\textwidth}}
\newenvironment{cvsection}{%
\setlength{\extrarowheight}{0.40ex}
\begin{longtable}[l]{@{} L >{\compress}R @{}}
% Comment line above and uncomment line below to add gray vrule between date and body.
% \begin{longtable}{@{} L !{\myvrule} R @{}}
}{%
\end{longtable}
}
\begin{document}
\begin{cvsection}
abc1 & \parbox[t]{\bodywidth\textwidth}{%
\begin {itemize}[wide, leftmargin=*] \item {\footnotesize TEST TEXT TEST TEXT TEST TEXT TEST TEXT TEST TEXTTEST TEXTTEST TEXT.}
\end {itemize} }\\
\end{cvsection}
\begin{cvsection}
abc2 & \parbox[t]{\bodywidth\textwidth}{%
{\footnotesize TEST TEXT TEST TEXT TEST TEXT TEST TEXT TEST TEXTTEST
TEXTTEST TEXT.} }\\
\end{cvsection}
\end{document}