Text FormattingText on same line as enumeration

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
juliusmeinl
Posts: 3
Joined: Mon Mar 04, 2013 5:00 pm

Text on same line as enumeration

Post by juliusmeinl »

Hello everybody
I am making an exercise sheet for my maths students, and I'm having a problem with the enumeration.
I made an enumeration throughout several columns (using multicol). I would now like to have some text on the same line as the enumeration, so for instance the exercise number. I would like it to look like on the attached sheet. I tried having the exercise number in a separate column, but then it is indented and the different 'a)'s of the different exercises are not below each other depending on the number per exercise. I also tried using margin note, but that did not work either.
Many thanks, all help is appreciated.
Attachments
That's what I would like it to look like.
That's what I would like it to look like.
Screen Shot 2013-03-04 at 4.02.48 PM.jpg (72.85 KiB) Viewed 6992 times
That's what I did so far.
That's what I did so far.
Screen Shot 2013-03-04 at 3.54.23 PM.jpg (21.6 KiB) Viewed 6992 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Text on same line as enumeration

Post by localghost »

Please provide the code that produced the output in form of a self-contained and minimal example to give an adequate problem description.


Best regards and welcome to the board
Thorsten
juliusmeinl
Posts: 3
Joined: Mon Mar 04, 2013 5:00 pm

Text on same line as enumeration

Post by juliusmeinl »

There you go:

Code: Select all

\documentclass[11pt,a4paper,titlepage]{article}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{multicol}
\usepackage{enumitem}
\usepackage{marginnote}
\usepackage{multienum}
\usepackage[margin=0.5in]{geometry}
\author{Alex Schindler}
\title{Terme umformen}

\begin{document}

\renewcommand{\labelenumi}{\bfseries \alph{enumi})}


\section*{Terme umformen 1}
Fasse die Terme zusammen.
\vspace*{0.5cm}
\newline {\bf 1}
\setlength{\columnsep}{2pt}
\begin{multicols}{4}
\begin{enumerate}
\item $a \cdot a + b\cdot b$
\item $2 \cdot x \cdot x + x^2$
\item $(3x)^2$
\item $(abc)^2$
\end{enumerate}
\end{multicols}

\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Text on same line as enumeration

Post by localghost »

Please always check your examples for minimal content as you have been asked for. Your example loads many packages that are superfluous in this case. And we would appreciate if you tag code as such by using the corresponding button from the list above the input field when composing a message.

You are already loading enumitem. So, why don't you use it?

Code: Select all

\documentclass[ngerman]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{selinput}
\SelectInputMappings{
  adieresis={ä},
  germandbls={ß}
}
\usepackage{babel}
\usepackage[inline]{enumitem}

\begin{document}
  \section*{Terme umformen I}
    Fasse die Terme zusammen.
    \begin{enumerate}[fullwidth]
      \item
        \begin{enumerate*}[label={\alph*)},font=\bfseries,itemjoin=\qquad]
          \item $a\cdot a+b\cdot b$
          \item $2\cdot x\cdot x+x^2$
          \item $(3x)^2$
          \item $(abc)^2$
        \end{enumerate*}
      \item
        \begin{enumerate*}[label={\alph*)},font=\bfseries,itemjoin=\qquad]
          \item $7a\cdot 3ab$
          \item $11fgh\cdot 12ghk$
          \item $4cd\cdot 3de\cdot 5ef$
          \item $a(a+b)+2\cdot b\cdot b-a^2$
        \end{enumerate*}
    \end{enumerate}
\end{document}
For details consult the package manual. On the command line you have direct access.

Code: Select all

texdoc enumitem

Remarks:
  • For documents in German you should give the appropriate language option ngerman to babel.
  • It is suggestive to use the classes from KOMA-Script (see above example).
juliusmeinl
Posts: 3
Joined: Mon Mar 04, 2013 5:00 pm

Re: Text on same line as enumeration

Post by juliusmeinl »

Thank you very much, that was very useful!
I do not have that much experience with enumitem (and with LaTeX in general), but it's getting better almost daily ...
Post Reply