1

For my own use (consisting in putting a box before the first item !), I want to change the indentation of the first item, something like this file: enter image description here

I obtained this result, by the ugly method in the .tex file what I add here, just to watch up the result I want to obtain:

\documentclass[12pt]{article}
\newcounter{ItemsCounter}
\begin{document}
\pagestyle{empty}
\noindent
\textbf{Hello world}
\begin{list}
{\bfseries{}\arabic{ItemsCounter}.~}
{
\usecounter{ItemsCounter}
\addtolength\leftmargin{14mm}
}
\item A\\ multilined\\ text

\end{list}

\begin{list}
{\bfseries{}\arabic{ItemsCounter}.~}
{
\usecounter{ItemsCounter}
\setcounter{ItemsCounter}{1}}
\item Item two
\item Item three

\end{list}
\end{document}

I want to change only the first item by something like the command \addtolength\leftmargin{14mm}, but it's accepted only in global option and not locally for one item. I used this acrobaty, using two successive list environments, and iterating the items, to obtain the suitable result, but I obviously want to use a more elegant method, for enumerate and itemize environments. How can I obtain the compilation here, so change the indentation only for the first item, with a useful method ? Thank you.

1 Answers1

1

Perhaps something like this?

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=\bfseries{\arabic{enumi}}.,leftmargin=1em]
\item[]\stepcounter{enumi}
\begin{enumerate}[label=\bfseries{\arabic{enumi}}.,leftmargin=3em]
\item A\\ multilined\\ text
\end{enumerate}
\item Item two
\item Item three
\end{enumerate}
\end{document}

enter image description here

You can adjust the identitation by playing with the leftmargin parameters.

  • Thanks for your answer, which is useful, but it's an "acrobaty" like mine.. I made two successive enumerate, and you made two imbricated ones ! Your idea is more beautiful, and I'll wait some time before accepting it. Thanks – Faouzi Bellalouna Jan 15 '18 at 14:35
  • @FaouziBellalouna I agree with you that it is not too beautiful, but I was able to simplify the snippet slightly. –  Jan 15 '18 at 14:43
  • There is another problem. There will be some objects, some small boxes in the empty space, and I think that there will be some problem with superposing with \color{white} – Faouzi Bellalouna Jan 15 '18 at 14:45
  • @FaouziBellalouna Yes, that's precisely what the simplification was about. –  Jan 15 '18 at 14:46
  • 1
    @marmot, is it indeed an impossibility to change the leftmargin of an individual item without recurring to an additional list (nested or sequential)? – gusbrs Jan 15 '18 at 14:56
  • @gusbrs I don't know, but I just thought it would make sense to go this route because some global changes in the document will then not require additional adjustments. –  Jan 15 '18 at 15:02
  • @marmot, I agree that in this setting nesting makes sense. But I was really hoping for an answer to the question as posed. In fact, I sort of asked the same thing recently in a different guise (https://tex.stackexchange.com/q/409844/105447). Anyway, thanks for your response. I'll hope that some of the oracles stop by. ;-) – gusbrs Jan 15 '18 at 15:08
  • I was searching in my files and I use in my style files the command \setenumerate[0]{font=\textcolor{Green}, align=left, labelwidth=-6pt, itemsep=10pt,leftmargin=*} and as I Thank, with this global command, the command \color{white}has no effect. The first item is in green and is under the box ! – Faouzi Bellalouna Jan 15 '18 at 15:59
  • @FaouziBellalouna Sorry, did you realize that there has not been any \color{white} command for more than an hour? –  Jan 15 '18 at 16:01
  • @marmot I have not seen your edit. Thank you – Faouzi Bellalouna Jan 15 '18 at 16:05
  • @marmot. I really think that your idea is ingenious, and It will be so beautiful if you can create an environment, call it Indentedenumerate, using commands such \begin{list} ... \end{list}... Any idea ? – Faouzi Bellalouna Jan 15 '18 at 16:49
  • @FaouziBellalouna Be my guest ;-) Personally I think that the above does what it should, and writing an environment will have the challenge of making things user-proof, i.e. you'll have a hard time to make it robust enough. –  Jan 15 '18 at 16:52
  • @marmot you are right. It is better not to be too greedy – Faouzi Bellalouna Jan 15 '18 at 17:00
  • @marmot After several tests with my macros and your solution, the compilation is well, and so I accept your answer, with my great thanks – Faouzi Bellalouna Jan 15 '18 at 20:07