hallo there,
I am just woundering, whether there is a way to place an equation in a desired position, let's say, 5cm from left.
thanks for any help.
Yang
hallo there,
I am just woundering, whether there is a way to place an equation in a desired position, let's say, 5cm from left.
thanks for any help.
Yang
Hi Yang,
here's a short example that only works with the fleqn class option:
RegardsCode:\documentclass[fleqn,english]{article} \usepackage{babel,blindtext,amsmath} \begin{document} \blindtext {\mathindent=5cm \begin{align} a^2+b^2&=c^2 \qquad\text{5\,cm from left}\\ d&=e \end{align}} % \blindtext {\mathindent=0cm \begin{align} a^2+b^2&=c^2 \qquad\text{0\,cm from left}\\ d&=e \end{align}} % \blindtext \begin{align} a^2+b^2&=c^2 \qquad\text{normal flushleft}\\ d&=e \end{align} \blindtext \end{document}
Marcel
Listen to me children of the night, beyond the doors of darkness you will find
a thousand worlds for you to see here, take my hand and follow me...
hallo Marcel,
thanks soooooooooo much, that was great help.
but the problem is I just want change only some of the equations in the desired place, other remain centering. Using \mathindent changed all the equations to be placed, for example, 5cm from left.
I tried to add \centering in the front of other equations, but it didnt work.
anyone can help me?
thanks...
Hi Yang,
well, the environments shown here---except equation, that is---aren't usually taken for single lined equations, and some strange things may happen if you have some different heights or try leqno/fleqn, but as an idea...
Similarily, you could use the flalign-environment for a numbered version, should my indeq environment give you too much trouble;-)Code:\documentclass{article} \usepackage{amsmath} \newlength{\ieqind} \newenvironment{indeq}[1][2cm]{% \setlength{\ieqind}{#1} \addtolength{\ieqind}{-\multlinegap} \multline% \hspace{\ieqind} }{ \\[-\baselineskip]\endmultline% } \begin{document} \begin{equation} c^2 = a^2 + b^2 \end{equation} \noindent\rule{2cm}{1pt} \begin{indeq} c^2 = a^2 + b^2 \end{indeq} \noindent\rule{2cm}{1pt} \begin{flalign*} \hspace{2cm}c^2 &= a^2 + b^2 & \vphantom{a}&\phantom{=}\vphantom{b} \end{flalign*} \end{document}
To make the difference more apparent, I used 2 cm, instead of 5... but that is easily adapted.
Regards,
Rainer
There's nothing a good whack with a hammer won't fix!
Lesezeichen