I would use the adjustwidth
environment from the changepage
package:
\begin{adjustwidth}{<left margin>}{<right margin>}
...
\end{adjustwidth}
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:
\documentclass{article}
\usepackage{changepage}% http://ctan.org/pkg/changepage
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\section{Some section title inserted here with some custom gibberish}
\begin{adjustwidth}{2.5em}{0pt}
\lipsum[1]
\end{adjustwidth}
\lipsum[2-5]
\end{document}
The standard article
document class indents the section title by 2.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.
\documentclass[10pt,a4paper]{article}
\usepackage[hmargin=3cm,vmargin=3.5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[norsk]{babel}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage[hidelinks]{hyperref}
\usepackage[dvipsnames*,svgnames]{xcolor}
\newcommand{\oppgave}[2]{\section*{Oppgave #1 {\normalfont\normalsize (#2 poeng)}
\addcontentsline{toc}{section}{Oppgave #1}}}
\newcommand{\del}[1]{%
\item \addcontentsline{toc}{subsection}{#1)}
}
\newlist{deloppg}{enumerate}{2}
\setlist[deloppg]{label=\arabic*),leftmargin=*,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}
\begin{enumerate}[leftmargin=*,labelsep=2em,label=\alph*)]
\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{enumerate}
\end{document}
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.
Here are three possibilities; the first two are variants based on the flalign
environment, with a different positioning of the equations w.r.t.the left margin text. The third possibility paves the texts aligned w.r.t. each other, at some distance from the equations. It's based on alignat
:
\documentclass[a4paper, 12pt, default, numbered, print, index]{article}
\usepackage{mathtools}
\usepackage{eqparbox}
\newcommand{\eqmathbox}2[M]{\eqmakebox[#1]{$\displaystyle#2$}}
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{
<5><6><7><8><9><10>
<10.95><12><14.4><17.28><20.74><24.88>
mathx10
}{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareMathAccent{\widebar}{0}{mathx}{"73}
\begin{document}
We can simplify our analysis by assuming the flow is inviscid ($\tau_{i,j}$ = 0), an ideal gas ($p = ρRT$), and calorically perfect ($c_p$, $c_v$ = constant). Thus, for a homogeneous, steady, uniform gas flow in a straight duct without heat conduction, the linearised governing equations can be written as:
\begin{subequations}
\begin{flalign}
\label{eq:linear_EOM_vector_mass}
& \rlap{Mass} & &\eqmathbox{\frac{\widebar{D}\rho'}{Dt} + \bar{ρ}∇ · \boldsymbol{u}' = \mathbf{0}} & \\[0.8ex]
\label{eq:linear_EOM_vector_mom}
& \rlap{Momentum} & &\eqmathbox{\frac{\widebar{D}\mathbf{u}'}{Dt} + \frac{1}{\bar{ρ}}
∇ p' = \mathbf{0}}
\end{flalign}
\end{subequations}
\begin{subequations}
\begin{flalign}
\label{eq:linear_EOM_vector_mass}
& \text{Mass} & & \frac{\widebar{D}\rho'}{Dt} + \bar{ρ}∇ · \boldsymbol{u}' = \mathbf{0} &\hspace{12em} \\[0.8ex]
\label{eq:linear_EOM_vector_mom}
& \text{Momentum} & & \frac{\widebar{D}\mathbf{u}'}{Dt} + \frac{1}{\bar{ρ}}
∇ p' = \mathbf{0}&&
\end{flalign}
\end{subequations}
\begin{subequations}
\begin{alignat}{2}
\label{eq:linear_EOM_vector_mass}
& \text{Mass} &\hspace{3em} &\frac{\widebar{D}\rho'}{Dt} + \bar{ρ}∇ · \boldsymbol{u}' = \mathbf{0} \\[0.8ex]
\label{eq:linear_EOM_vector_mom}
& \text{Momentum} & & \frac{\widebar{D}\mathbf{u}'}{Dt} + \frac{1}{\bar{ρ}}
∇ p' = \mathbf{0}
\end{alignat}
\end{subequations}
\end{document}
Edit: Here is how to adapt the first solution to the last version of the O.P.'s code (two variants):
\documentclass[a4paper,12pt,default,numbered,print,index]{article}
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{graphicx} % Required for the inclusion of images
\usepackage{setspace} % for use of \singlespacing and \doublespacing
\usepackage{pdfpages}
\usepackage{cite}
\usepackage[section]{placeins}
\usepackage{comment}
\usepackage{siunitx}
\usepackage{color}
\usepackage{ragged2e}
\usepackage{esvect}
\usepackage{mathtools}
\usepackage{lscape}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{array}
\usepackage{soul}
\usepackage{bm}
\usepackage{url}
\usepackage{xparse}
\usepackage{hyperref}
\newcommand{\myeqlabel}[1]{\rlap{\bfseries#1}}
\usepackage{eqparbox}
\newcommand{\eqmathbox}[2][M]{\eqmakebox[#1]{$\displaystyle#2$}}
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{
<5><6><7><8><9><10>
<10.95><12><14.4><17.28><20.74><24.88>
mathx10
}{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareMathAccent{\widebar}{0}{mathx}{"73}
\begin{document}
We can simplify our analysis by assuming the flow is inviscid ($\tau_{i,j} = 0$), an ideal gas ($p = \rho RT$), and calorically perfect ($c_p$, $c_v$ = constant). Thus, for a homogeneous, steady, uniform gas flow in a straight duct without heat conduction, the linearised governing equations can be written as:
\begin{subequations}
\begin{flalign}
& \myeqlabel{Mass} &&
\eqmathbox{\frac{\widebar{D}\rho'}{Dt} + \bar{\rho}\,\nabla\cdot\boldsymbol{u}'
= \mathbf{0}} & \label{eq:linear_EOM_vector_mass}\\
& \myeqlabel{Momentum} &&
\eqmathbox{\frac{\widebar{D}\mathbf{u}'}{Dt} + \frac{1}{\bar{\rho}} \nabla p'
= \mathbf{0}} & \label{eq:linear_EOM_vector_mom}\\
& \myeqlabel{Energy} &&
\eqmathbox{c_p\frac{\widebar{D}}{Dt}(\bar{\rho}\,T' + \rho'\widebar{T}) + \nabla \cdot (\boldsymbol{u'}\bar{p} + \bar{\boldsymbol{u}}p')
= \dot{q}'\bar{\rho} + \bar{\dot{q}}\rho' }& \label{eq:linear_EOM_vector_energy}\\
& \myeqlabel{Entropy} &&
\eqmathbox{\frac{\widebar{D}s'}{Dt}
= \frac{\dot{q}'}{\bar{\rho}\,\bar{T}}} & \label{eq:linear_EOM_vector_entropy}\\
& \myeqlabel{Vorticity} &&
\eqmathbox{\frac{\widebar{D}\boldsymbol{\xi}'}{Dt}
= \mathbf{0}} & \label{eq:linear_EOM_vector_vorticity}
\end{flalign}
\end{subequations}
\begin{subequations}
\begin{flalign}
& \myeqlabel{Mass} &&
\eqmathbox{\frac{\widebar{D}\rho'}{Dt} + \bar{\rho}\,\nabla\cdot\boldsymbol{u}'
= \mathbf{0}} & \label{eq:linear_EOM_vector_mass}\\
& \textbf{Momen\rlap{tum}} &&
\eqmathbox{\frac{\widebar{D}\mathbf{u}'}{Dt} + \frac{1}{\bar{\rho}} \nabla p'
= \mathbf{0}} & \label{eq:linear_EOM_vector_mom}\\
& \myeqlabel{Energy} &&
\eqmathbox{c_p\frac{\widebar{D}}{Dt}(\bar{\rho}\,T' + \rho'\widebar{T}) + \nabla \cdot (\boldsymbol{u'}\bar{p} + \bar{\boldsymbol{u}}p')
= \dot{q}'\bar{\rho} + \bar{\dot{q}}\rho' }& \label{eq:linear_EOM_vector_energy}\\
& \myeqlabel{Entropy} &&
\eqmathbox{\frac{\widebar{D}s'}{Dt}
= \frac{\dot{q}'}{\bar{\rho}\,\bar{T}}} & \label{eq:linear_EOM_vector_entropy}\\
& \myeqlabel{Vorticity} &&
\eqmathbox{\frac{\widebar{D}\boldsymbol{\xi}'}{Dt}
= \mathbf{0}} & \label{eq:linear_EOM_vector_vorticity}
\end{flalign}
\end{subequations}
\end{document}
Best Answer
Are you sure you want this?
flushleft
uses\raggedright
which sets\parindent
to 0 if you\setlength\parindent{2em}
after starting the environment you will get a visible indent again.