Text FormattingHelp on Text Formating

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Mishy Dee
Posts: 2
Joined: Thu Jul 02, 2015 10:56 am

Help on Text Formating

Post by Mishy Dee »

Hello dear friends

I am typing a some questions for a class and want to show the mark allocations in the same line with the text without using either minipage or flush right as below. How can I do this. Please help. Please check the commands below:

Code: Select all

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\author{Misheck Diza}
\begin{document}
\begin{enumerate}
	\item{For every investment venture to be successful one needs investment vehicle called an asset, compare and contrast real and financial asset\begin{flushright}
	(10 marks)
	\end{flushright}}
	\item{State whether the following assets are either financial or real:
	\begin{enumerate}
	\item{Industrial Property\begin{flushright}
	(2 marks)
	\end{flushright}}
	\item{Commercial Paper\begin{flushright}
	(2 marks)
	\end{flushright}}
	\item{Comoran Stock\begin{flushright}
	(2 marks)
	\end{flushright}}
	\item{Treasury Bills\begin{flushright}
	(2 marks)
	\end{flushright}}
		\end{enumerate}}
\end{enumerate}

\end{document}

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Help on Text Formating

Post by Johannes_B »

You are thinking too complicated.

Code: Select all

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\begin{document}
\begin{enumerate}
	\item For every investment venture to be successful one needs investment vehicle called an asset, compare and contrast real and financial asset\hfill
		(10 marks)
	\item State whether the following assets are either financial or real:
		\begin{enumerate}
			\item Industrial Property\hfill (2 marks)
			\item Commercial Paper \hfill (2 marks)
			\item Comoran Stock    \hfill (2 marks)
			\item Treasury Bills   \hfill (2 marks)
		\end{enumerate}
\end{enumerate}

\end{document}
Please note, that \item can take an optional argument, but does not have a mandatory argument.

I recommend looking at packages like exsheets or the exam class that are made for doing this job.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Mishy Dee
Posts: 2
Joined: Thu Jul 02, 2015 10:56 am

Re: Help on Text Formating

Post by Mishy Dee »

Thanks Johannes_B. That really works well.Thanks once again.
Post Reply