LaTeX forum ⇒ Text FormattingAlignment

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Super
Posts: 5
Joined: Wed Jun 11, 2014 11:07 pm

Alignment

Postby Super » Mon Jun 16, 2014 7:25 pm

How do you do these kinds of things, where you have something in the left and then something in the center:

(1) (insert space here) 1/2=0.5

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Jun 16, 2014 8:13 pm

Wow, your question is very very unspecific. If you want to align parts of an equation, use the align-environment provided by amsmath.

But somehow i sense you just want to number your equation. You can have the equation number on the left using the option leqno.
  1. \documentclass[leqno]{article}
  2. \usepackage{mathtools}%loads amsmath and provides some patches
  3. \usepackage{blindtext}
  4. \begin{document}
  5. \blindtext
  6. \begin{equation}
  7. \frac{1}{2} = 0.5
  8. \end{equation}
  9.  
  10. \blindtext
  11. \begin{gather}
  12. \frac{1}{2} = 6 \\
  13. \frac{1}{3} = 4 \label{eq:thirdb12}\\
  14. \frac{1}{4} = 3 \\
  15. \frac{1}{6} = 2
  16. \end{gather}
  17.  
  18. See \eqref{eq:thirdb12}
  19.  
  20. \end{document}

Hint: you can click on »Open in writelatex« just above the code to see the output.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Super
Posts: 5
Joined: Wed Jun 11, 2014 11:07 pm

Postby Super » Tue Jun 17, 2014 6:09 am

Thanks!

Also, how do you make it so that there's lower case roman numeral letters on the left, and then regular text on the right, and also it indents so that the text won't go under the roman numeral?

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Jun 17, 2014 8:12 am

Again, i can only guess. I suppose you are looking for an enumerated list, tweaked to count with roman numerals.
  1. \documentclass{article}
  2. \usepackage{enumitem}
  3. \usepackage{blindtext}
  4. \begin{document}
  5. \begin{enumerate}[label=\roman*]
  6. \item i am an item
  7. \item i am another one
  8. \item i am a very long one \blindtext
  9. \end{enumerate}
  10. \end{document}



Please, please, read some introductory material. For example LaTeX for complete novices by Nicola Talbot.

This gives you a good starting point.


For further questions, please be more specific and try to run a basic google search.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Super
Posts: 5
Joined: Wed Jun 11, 2014 11:07 pm

Postby Super » Tue Jun 17, 2014 5:54 pm

How do you put a parentheses around the roman numeral?

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Jun 17, 2014 7:47 pm

Be a bit creative ;-)

  1. \begin{enumerate}[label=(\roman*)]
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Super
Posts: 5
Joined: Wed Jun 11, 2014 11:07 pm

Postby Super » Mon Jun 23, 2014 9:34 pm

Is there a way so that the roman numeral does not indent, but the text does?

Thanks!

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Jun 23, 2014 10:50 pm

Ok, this time i give up. Can you be more specific? Maybe provide a minimal working example just as i did above. I really don't know what you mean.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Jun 24, 2014 8:49 am

?
  1. \documentclass{article}
  2. \usepackage{enumitem}
  3. \usepackage{blindtext}
  4. \begin{document}
  5. \begin{enumerate}[label=(\roman*),align=left]
  6. \item i am an item
  7. \item i am another one
  8. \item i am a very long one \blindtext
  9. \end{enumerate}
  10. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

akhadzhiev
Posts: 3
Joined: Wed Sep 24, 2014 9:15 am

Postby akhadzhiev » Wed Sep 24, 2014 10:55 am

Using \hfill won't necessarily result in the middle text being centered, as the example below demonstrates. If you want to place the text in such a way that the middle text is really centered, I would suggest using \parboxes, as the example shows
  1. \documentclass{article}
  2. \usepackage{lipsum}
  3.  
  4. \newcommand\textbox[1]{%
  5. \parbox{.333\textwidth}{#1}%
  6. }
  7.  
  8. \begin{document}
  9.  
  10. \noindent Left longer sample simple text\hfill Center?\hfill Right
  11.  
  12. \noindent\textbox{Left longer sample text\hfill}\textbox{\hfil Center\hfil}\textbox{\hfill Right}
  13.  
  14. \noindent\lipsum[2]
  15.  
  16. \end{document}


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 3 guests