Text FormattingGlobal "list" settings

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
schmag
Posts: 6
Joined: Fri Mar 06, 2009 9:08 pm

Global "list" settings

Post by schmag »

Hi.

I am making a document that is essentially list after list, often with one list embedded in another.

For each list I am wanting 1) the first line of each item to have a specific indent 2) the second line to have the same indent as the first, and 3), for 1) and 2) to hold for any embedded lists.

Now I am having limited success with 1-3, but even assuming I could format 1-3 perfectly, it is a mess of commands for each list I create. How do I create global settings so that each list I create uses the same pre-specified formatting.

The following is what I have so far. As you can see (from my understanding) \listparindent isn't working. It certainly doesn't change any of the formatting if I change it's length to -1000 or +1000:

Code: Select all

\documentclass[10pt,letterpaper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[centering,margin=0.1cm]{geometry}
\usepackage{lmodern}
\usepackage{multicol}			% enables vertical column division of page
\usepackage{titlesec}
\usepackage{blindtext}		% \blindtext[integer] fills the space with a bunch of text
\usepackage{amsmath}
\usepackage{amsfonts}			
\usepackage{amssymb}			% These are necessary to use the \therefore command
\usepackage{soul}         % Enable underlining with line break
\usepackage{enumitem}     % Enhancing the list environments

\setlength{\columnseprule}{1pt}
\titleformat{\section}{\titlerule\vspace{0.8ex}\bfseries\sffamily\small}{}{0.5em}{}

\begin{document}
\scriptsize
\begin{multicols}{3}
    
	\section{The Central Dogma}
  \setlength{\parskip}{-3pt}


  \begin{list}{$\bullet$}{}
		\setlength{\itemsep}{1pt} 
		\setlength{\parskip}{0pt} 
		\setlength{\parsep}{0pt} 
		\setlength{\itemindent}{-20pt}
		\setlength{\listparindent}{-15pt}
		\setlength{\labelsep}{0pt}
			
		\item I am wanting this text to be a main point and proceed without indentation on the first line nor with indentation on the following lines, unlike is happening here.
		\item I am wanting this text to be a main point and proceed without indentation on the first line nor with indentation on the following lines, unlike is happening here.
			\begin{list}{$\rightarrow$}{}
			\setlength{\itemsep}{1pt} 
			\setlength{\parskip}{0pt} 
			\setlength{\parsep}{0pt} 
			\setlength{\itemindent}{-20pt}
			\setlength{\listparindent}{-15pt}
			\setlength{\labelsep}{0pt}
			
			\item I am wanting this text to be a secondary point and proceed indentented a small amount from the first list. But I want to aspecify the ammount. I would like the second line of this item to be indented a specified amount (the amount of indentation of the first line of this item, plus the length of the $\rightarrow$.
			\item I am wanting this text to be a secondary point and proceed indentented a small amount from the first list. But I want to aspecify the ammount. I would like the second line of this item to be indented a specified amount (the amount of indentation of the first line of this item, plus the length of the $\rightarrow$.
			\end{list}
		
		\item I am wanting this text to be a main point and proceed without indentation on the first line nor with indentation on the following lines, unlike is happening here.
		
		
	\end{list}
			
	\blindtext[11]


\end{multicols}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Global "list" settings

Post by localghost »

As already suggested in another topic, you should really take a closer and more careful look at the enumitem manual. I don't understand why you load it but don't use it.

Code: Select all

\documentclass[10pt,letterpaper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[centering,margin=5mm]{geometry}
\usepackage{lmodern}
\usepackage{multicol}           % enable vertical column division of page
\usepackage[compact]{titlesec}
\usepackage{blindtext}          % generate longer text passages
\usepackage{amsmath}
\usepackage{amsfonts}         
\usepackage{amssymb}            % Symbols from AMS-LaTeX
\usepackage{soul}               % Enable underlining with line break
\usepackage{enumitem}           % Enhancing the list environments

\setlength{\columnseprule}{1pt}
\titleformat{\section}{\titlerule\vspace{0.8ex}\bfseries\sffamily\small}{}{0.5em}{}

% Setup for list environments (enumitem)
\setitemize[1]{leftmargin=*}
\setitemize[2]{itemindent=-1em,label=$\rightarrow$,labelindent=1em}

\begin{document}
  \scriptsize
  \begin{multicols}{3}
    \section{The Central Dogma}
%    \setlength{\parskip}{-3pt}
    \begin{itemize}
      \item I am wanting this text to be a main point and proceed without indentation on the first line nor with indentation on the following lines, unlike is happening here.
      \item I am wanting this text to be a main point and proceed without indentation on the first line nor with indentation on the following lines, unlike is happening here.
      \begin{itemize}
        \item I am wanting this text to be a secondary point and proceed indentented a small amount from the first list. But I want to aspecify the ammount. I would like the second line of this item to be indented a specified amount (the amount of indentation of the first line of this item, plus the length of the $\rightarrow$.
        \item I am wanting this text to be a secondary point and proceed indentented a small amount from the first list. But I want to aspecify the ammount. I would like the second line of this item to be indented a specified amount (the amount of indentation of the first line of this item, plus the length of the $\rightarrow$.
      \end{itemize}
      \item I am wanting this text to be a main point and proceed without indentation on the first line nor with indentation on the following lines, unlike is happening here.     
    \end{itemize}
         
    \blindtext[21]
  \end{multicols}
\end{document}

Best regards
Thorsten¹
Post Reply