Можно ли сделать так, чтобы определенные строки переносились раньше и имели отступ за пределами обычного отступа?

Можно ли сделать так, чтобы определенные строки переносились раньше и имели отступ за пределами обычного отступа?

Я хочу изменить этот код LaTeX, чтобы создать эффект висячего отступа, когда строка переносится на следующую строку. Я хочу, чтобы он прерывался примерно на 75% текстовой области и начинал переноситься на новую строку, но с отступом за пределами начального отступа? Я также хочу, чтобы короткие строки оставались с одним отступом, но не использовали один только тег \indent, чтобы если я добавлю еще к этим строкам, они автоматически переносились так, как мне нужно, и мне не нужно было бы добавлять что-либо еще. Есть ли способ сделать это?

введите описание изображения здесь

\documentclass[a4paper,9pt]{extarticle}
\usepackage{titlesec}
\setlist{noitemsep}
\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}[\titlerule]
\titlespacing*{\section}{0pt}{\baselineskip}{\baselineskip}

% Begin document
\begin{document}

\section*{MY PROJECTS}
\noindent
\textbf{Engineering QTL's in Legume Species using CRISPR/Cas Technologies} \hfill London, Ontario, Canada\\ % Project name and location
\textit{Summer Research Assistant}
\hfill May 2019 | August 2019 \\
    \indent An example of a long line that's indented and that I want to be hanging on the subsequent lines. I want this to break at around 75\% of the textarea and start wrapping around to the new line but indented past the initial indent? Is there a way to do this?\\
    \indent An example of a short line that's indented.\\

\noindent
\textbf{Another Project} \hfill London, Ontario, Canada\\ % Project name and location
\textit{yadayada}
\hfill May 2019 | August 2019 \\
    \indent An example of a short line that's indented.\\
\end{document}

введите описание изображения здесь

Я сделал это в Word, чтобы показать, как я хочу, чтобы конечный результат выглядел в LaTeX.

введите описание изображения здесь

Это возможно?

решение1

С использованием tabularx:

\documentclass[a4paper,9pt]{extarticle}

\usepackage[margin=2cm]{geometry}
\usepackage{tabularx}

\usepackage{titlesec}
\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}[\titlerule]
\titlespacing*{\section}{0pt}{\baselineskip}{\baselineskip}



% Begin document
\begin{document}

\section*{MY PROJECTS}
   
\begin{tabularx}{\textwidth}{@{}>{\parindent=1em\hangindent=3em\hangafter=1}p{.75\textwidth}@{\extracolsep{\fill}}r@{}}
  \noindent\textbf{Engineering QTL's in Legume Species using CRISPR/Cas
  Technologies}
  & London, Ontario, Canada\\ % Project name and location
  \noindent\textit{Summer Research Assistant}
  & May 2019 | August 2019 \\
  An example of a long line that's indented and that I want to be
  hanging on the subsequent lines. I want this to break at around 75\%
  of the textarea and start wrapping around to the new line but
  indented past the initial indent? Is there a way to do this?\\ 
  An example of a short line that's indented.\\[1ex]
  \noindent\textbf{Another Project}
  & London, Ontario, Canada\\ % Project name and location 
  \noindent\textit{yadayada}
  & May 2019 | August 2019 \\
  An example of a short line that's indented.
\end{tabularx}

\end{document}

введите описание изображения здесь

решение2

Так?

МВЭ

\documentclass[a4paper,9pt]{extarticle}
\usepackage[margin=2cm]{geometry}
\begin{document}
\section*{MY PROJECTS}
\paragraph{Engineering QTL's in Legume Species using CRISPR/Cas Technologies}\hfill London, Ontario, Canada\par 
\noindent\textit{Summer Research Assistant} \hfill May 2019 | August 2019\par
{\hsize.75\linewidth\parskip1ex\hangindent4em\parindent2em 
An example of a long line that's indented and that I want to be hanging on the subsequent lines. I want this to break at around 75\% of the textarea and start wrapping around to the new line but indented past the initial indent? Is there a way to do this?\par
\hangindent5em
An example of a short line that's indented.\par}
\paragraph{Another Project} \hfill London, Ontario, Canada\par
\noindent\textit{yadayada} \hfill May 2019 | August 2019\par
An example of a short line that's indented.
\end{document}

Примечание: я использовал \parвместо пустых строк только для того, чтобы указать, где должны быть концы абзацев. Не стесняйтесь использовать пустые строки, если это сделает код более читабельным для вас. Результат не изменится.

решение3

Здесь я подход паракола. Обратите внимание, что его \hangindentнужно повторять в каждом абзаце, где он используется.

\documentclass[a4paper,9pt]{extarticle}
\usepackage{titlesec}
%\setlist{noitemsep}% ???
\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}[\titlerule]
\titlespacing*{\section}{0pt}{\baselineskip}{\baselineskip}
\usepackage{paracol}
\setcolumnwidth{0.65\textwidth}
\usepackage{showframe}% alignment tool
% Begin document
\begin{document}

\section*{MY PROJECTS}
\begin{paracol}{2}
\sloppy% sop for narrow columns
\parindent=0pt
\textbf{Engineering QTL's in Legume Species using\linebreak[3] CRISPR/Cas Technologies}
\switchcolumn
London, Ontario, Canada % Project name and location
\switchcolumn*
\textit{Summer Research Assistant}
\switchcolumn
May 2019 | August 2019
\switchcolumn*
  \parindent=2em
  \hangindent=4em
An example of a long line that's indented and that I want to be hanging on the subsequent lines. I want this to break at around 75\% of the textarea and start wrapping around to the new line but indented past the initial indent? Is there a way to do this?

An example of a short line that's indented.
\switchcolumn[0]*[\medskip]% align both columns, but stay here (column 0)
\parindent=0pt
\textbf{Another Project}
\switchcolumn
London, Ontario, Canada% Project name and location
\switchcolumn*
\textit{yadayada}
\switchcolumn
May 2019 | August 2019
\switchcolumn*
  \parindent=2em
  \hangindent=4em
An example of a short line that's indented.
\end{paracol}
\end{document}

Связанный контент