I am writing a document with some odd spacing. I am copying another document, and therefore the layout must be almost exact. I have sections divided by letters below, and some paragraphs in each section. Most of these paragraphs should be indented so that they align with the text after each section and not the section number. Will try to clarify with a small code.
I do not have the ability to provide a minimal example, will do so later though
a) Some section title inserted here with some custom gibberish
How the rest of the paragraph looks with no ident, also a problem
with several lines as well.
Here is another small part that is not supposed to be indented.
Here is how I want it to look.
a) Some section title inserted here with some custom gibberish
How the rest of the paragraph looks with no ident, also a problem
with several lines as well
Here is another small part that is not supposed to be indented
So yeah, I think I can do it with \hspace*{5mm}
. But this only works for single lines. Any suggestions?
Edit: MWE
\documentclass[10pt,a4paper]{article}
\usepackage[hmargin=3cm,vmargin=3.5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[norsk]{babel}
\usepackage{enumitem}
\usepackage{titletoc}
\usepackage{booktabs}
\usepackage{relsize}
\usepackage{array}
\usepackage[hidelinks]{hyperref}
\usepackage[dvipsnames*,svgnames]{xcolor}
\usepackage{mathtools}
\usepackage{fixltx2e}
\usepackage{lmodern}
\newcommand{\oppgave}[2]{\section*{Oppgave #1 {\normalfont\normalsize (#2 poeng)}
\addcontentsline{toc}{section}{Oppgave #1}}}
\newcommand{\del}[1]{\paragraph*{#1)
\addcontentsline{toc}{subsection}{#1)}}}
\newlist{deloppg}{enumerate}{1}
\setlist[deloppg]{label=\arabic*),leftmargin=1.40cm,itemsep=5pt}
\begin{document}
\tableofcontents
\newpage
\section*{Fasitsvar til regneoppgaver}
\addcontentsline{toc}{section}{Fasitsvar til regneoppgaver}
\newpage
\noindent
\phantomsection
\addcontentsline{toc}{section}{{\color{red}\Large{Del 1}}}
\fcolorbox{black}{LightSteelBlue}{\parbox[t][1.25cm][c]{\textwidth}{\begin{center}\textbf{Del 1 \\Uten hjelpemiddler}\end{center}}}
\oppgave{1}{18}
\del{a} \label{1a}
Vis at den deriverte til funksjonen $O(x) = \dfrac{500}{x} + 8x^2 $ er
%
\begin{align*}
O'(x) = \frac{ \, -500 + 16x^3 \, }{x^2}
\end{align*}
%
\del{b} Deriver funksjonene \\
\begin{deloppg}
\item $ f(x) = 3 \ln(2x) $
\item $ g(x) = 3x \cdot e^{x^2} $ \aa
\end{deloppg}
%
\vspace{5mm}
%
\del{c} Vi har gitt polynomfunksjonen $f(x)=x^3 - 3x^2 - 13x + 15$
\begin{deloppg}
\item Vis at $f(1)=0$. Bruk polynomdivisjon til å faktorisere $f(x)$ i førstegradsfaktorer
\item Løs ulikheten $f(x)\leq 0$
\end{deloppg}
%
\vspace{5mm}
%
\del{d}
Mengden av lava som spruter ut per time ved et vulkanutbrudd kan
tilnærmet beskrives ved et funksjonsuttrykk $f(x)$. Funksjonsverdiene
er målt i tonn, og $t$ er antall timer etter begynnelsen av utbruddet. \\ \\ Du får vite at: $f(0)=300, \qquad f'(10)=0 \qquad \textnormal{og} \qquad f''(10) = -10$\\ \\ Hva kan du si om vulkanutbruddet på grunnlag av disse opplysningene?
\end{document}
I felt I had to include this much of my document to show of where the mistake happens. Was a lot of work finding the packages and such. My preamble only includes 4 packs each with a common theme. So I had to extract all the packages needed to make this page work. The problem is in the last section. Where I want the text to be aligned with the rest. Will try Werner's suggestion =)
Best Answer
I would use the
adjustwidth
environment from thechangepage
package:The entire contents of
adjustwidth
are indented from the left margin by<left margin>
and from the right margin by<right margin>
. Here's a minimal working example:The standard
article
document class indents the section title by2.5em
.Edit: After seeing your minimal working example (MWE), I would suggest using the
enumitem
package to provide the appropriate margin alignment in your "problem" set. Below is a revised version of your MWE with the correct redefinition.Looking at your code there could be some improvements made. However, since the MWE might only cover a portion of what you're after, I merely tried to make things work the way you want them to.