To get enumerated and itemized lists that have the same amounts of left-hand and right-hand indentation, I'd recommend using the enumitem
package -- which provides many extensions to and improvements over LaTeX's list environments -- and its leftmargin
and rightmargin
options. The following MWE illustrates this.
\documentclass{article}
\usepackage[margin=3cm]{geometry} % per the example in your code
\usepackage{lipsum} % for filler text
\usepackage{enumitem}
\begin{document}
\lipsum[1] % filler text
\begin{enumerate}[leftmargin=2cm,rightmargin=2cm]
\item \lipsum[2]
\end{enumerate}
\lipsum[3]
\begin{itemize}[leftmargin=1cm,rightmargin=1cm]
\item \lipsum[4]
\end{itemize}
\end{document}
Added material after receiving a comment from the OP. I'm afraid I'm not quite sure about the meaning of the question
But how do I make the indentations of the \item the same as the
original text?
The new MWE below provides four separate option settings for shaping the itemized (or, equivalently, enumerated) list items. Hopefully, one of these settings meets your needs.
\documentclass{article}
% some short filler text, ca. 3 lines long
\newcommand{\shortfiller}{Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, obortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna.}
\usepackage{fancyvrb}
\usepackage[margin=3cm]{geometry}
\usepackage{enumitem}
\begin{document}
\DefineShortVerb{\|}
\emph{``Normal'' text paragraph.} \shortfiller
%% Option 1
\begin{enumerate}[leftmargin=2cm, rightmargin=2cm]
\item \emph{Settings:} |[leftmargin=2cm, rightmargin=2cm]|.
\shortfiller
\end{enumerate}
\emph{``Normal'' text paragraph.} \shortfiller
%% Option 2
\begin{enumerate}[resume, wide=2cm, leftmargin=2cm, rightmargin=2cm]
\item \emph{Settings:} |[wide=2cm, leftmargin=2cm, rightmargin=2cm]|.
\shortfiller
\end{enumerate}
\emph{``Normal'' text paragraph.} \shortfiller
%% Option 3
\begin{enumerate}[resume, wide=\parindent, leftmargin=\parindent, rightmargin=\parindent]
\item \emph{Settings:} |[wide=\parindent, leftmargin=\parindent, rightmargin=\parindent]|.
\shortfiller
\end{enumerate}
\emph{``Normal'' text paragraph.} \shortfiller
%% Option 4
\begin{enumerate}[resume, wide=\parindent]
\item \emph{Setting in this and the following item:} |[wide=\parindent]|.
\shortfiller
\item \shortfiller
\end{enumerate}
\emph{``Normal'' text paragraph.} \shortfiller
\end{document}
Suppose the final setting of the list items is what you're looking for. If you want this setting to apply uniformly to all enumerated and itemized lists, you should insert the command
\setlist{wide=\parindent}
in your document's preamble, immediately after the \usepackage{enumitem}
instruction.
A fix is using \fancyhfoffset
after \newgeometry
, so the widths are recalculated, such as
\newgeometry{left=1.5cm, right=1.5cm}
\fancyhfoffset[E,O]{0pt}
After I added \fancyhfoffset[E,O]{0pt}
to your code, both header and footer are adjusted to the new margin.
Best Answer
The
changepage
package provides this function. The simplest way is to use theadjustwidth
environment. You have to specify an amount by which to increase the size of the margins, which you can calculate based on the textwidth, your default margins, and the desired textwidth of the new narrow block.One problem is defining that narrower textwidth based on characters: as you can see in the test section of the example below, 34 em is actually wider than your default textwidth. 34 ex is too narrow. So in the example I used
\settowidth
and just typed thirty-four characters. A non-hard-coded solution would be better.A second problem is that most of the typewriter fonts do not allow justification (see What to do with both "underfull \hbox" and "overfull \hbox" in the same line?). With a narrow text block, many lines spill over the edge. This is not a problem with a proportional font, which I used for one of the images below (by commenting out the second line of code).
(FYI - I used a LaTeX default font command so these could be tested on any engine.)