Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How do I left-align selective equation blocks, i.e. not centered ?

I know how to do it for ALL equation blocks in the document setting

\usepackage[fleqn]{amsmath}
\setlength{\mathindent}{0pt}

in the preamble, but I only want to do this for some equation blocks.

\documentclass[pdftex,12pt,a4paper,english,dutch,leqno]{article}
\usepackage[top=1cm,right=1cm,bottom=1cm,left=1.5cm,noheadfoot]{geometry}
\usepackage{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[dvipsnames,table]{xcolor}
\usepackage{color}
\definecolor{vanillegeel}{RGB}{255,240,216}
\usepackage{empheq}

\begin{document}

De raaklijn aan $(x_{0},f(x_{0}))$ wordt algemeen bepaald met :
\begin{empheq}[box={\fboxsep=3pt\colorbox{vanillegeel}}]{align*}
\textnormal{$\begin{cases}z=f(x)\text{ is continu in }x_{0}\text{.}\\
f'(x_{0})=0\text{ : }z=f(x_{0})\text{ is de horizontale raaklijn.}\\
\lim_{x\to x_{0}} f'(x)=\pm\infty\text{ : }x=x_{0}\text{ is de verticale raaklijn.}\\
f'(x_{0})\in\mathbb{R}_{0}\text{ : }z-f(x_{0})=f'(x_{0})\cdot(x-x_{0})\text{ is de raaklijn.\hspace{-12pt}}\end{cases}$}\end{empheq}

\end{document}
share|improve this question
1  
+1 for the background color! Really nice for the eyes. –  morbusg Oct 5 '12 at 13:30

1 Answer 1

up vote 5 down vote accepted

Don't use align*.

De raaklijn aan $(x_{0},f(x_{0}))$ wordt algemeen bepaald met:
\begin{flushleft}
\colorbox{vanillegeel}{%
$\displaystyle
\begin{cases}
z=f(x) \text{ is continu in } x_{0}.
\\
f'(x_{0})=0 \text{ : } z=f(x_{0}) \text{ is de horizontale raaklijn.}
\\
\lim_{x\to x_{0}} f'(x)=\pm\infty \text{ : } x=x_{0} \text{ is de verticale raaklijn.}
\\
f'(x_{0})\in\mathbb{R}_{0} \text{ : } z-f(x_{0})=f'(x_{0})\cdot(x-x_{0})
  \text{ is de raaklijn.}
\end{cases}
$\kern-\nulldelimiterspace\kern-2\arraycolsep}
\end{flushleft}

enter image description here

share|improve this answer
    
What does \kern-\nulldelimiterspace\kern-2\arraycolsep} do in this ? –  Petoetje59 Oct 5 '12 at 14:28
    
@Petoetje59 It's a substitute of your \hspace{-12pt} based on document parameters, rather than "calculation by eye". –  egreg Oct 5 '12 at 14:45
    
Not allowing you to get the unsung hero badge! ;) +1. –  Harish Kumar Oct 5 '12 at 14:48
    
@HarishKumar Darn! –  egreg Oct 5 '12 at 14:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.