Text FormattingProblem with Line Indentation

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
latex_newbie
Posts: 7
Joined: Tue Jul 03, 2012 3:09 pm

Problem with Line Indentation

Post by latex_newbie »

This is how my code looks:

Code: Select all

\documentclass[11pt,epsfig]{article}
\usepackage{polski}
\usepackage[utf8]{inputenc}
\oddsidemargin=0in
\evensidemargin=0in
\textwidth=6.3in
\topmargin=-0.5in
\textheight=9in

\parindent=0in
\pagestyle{empty}

\begin{document}

[...]

\begin{problem}{5p}
\textbf{1.} Ustal, jaką liczbą, \emph{dodatnią}, czy \emph{ujemną} jest:
 \\ \qquad a) liczba przeciwna iloczynowi dwóch liczb przeciwnych
 \\ \hspace{12pt} b) iloraz wartości bezwględnej liczby ujemnej i liczby odwrotnej do niej
 \\ c) iloczyn sumy dwóch liczb ujemnych i ilorazu tych liczb
 \\ d) liczba przeciwna odwrotności sześcianu iloczynu wartości bezwzględnej ilorazu kwadratu dwóch liczb o przeciwnych znakach i odwrotności liczby przeciwnej w stosunku do tego ilorazu

\vfill
\end{problem}
I'm trying to make my question look something like this:

5p 1. Math problem
_____a)
_____b)
_____c)

Where in place of "____" there should be just a blank space
However, when I convert my .tex file into the .pdf file there's no indentation and it looks like this:
5p 1. Math problem
a)
b)
c)

Any suggestions on how to fix it?

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

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Problem with Line Indentation

Post by Stefan Kottwitz »

Hi,

welcome to the board!

My first recommendation is: read a LaTeX introduction or tutorial. LaTeX isn't a word processor program where you manually adjust - it's about styles and macros. Have a look at: LaTeX Resources for Beginners.

I would not count manually and I would not indent manually. Instead, I would use an {enumerate} environment, and enumitem for customizing.

Code: Select all

\documentclass[11pt]{article}
\usepackage{polski}
\usepackage[utf8]{inputenc}
\usepackage[textheight=9in,textwidth=6.3in]{geometry}
\usepackage{parskip}
\usepackage{enumitem}
\setenumerate[2]{label=\alph*)}
\pagestyle{empty}
\begin{document}
\begin{enumerate}
  \item Ustal, jaką liczbą, \emph{dodatnią}, czy \emph{ujemną} jest:
  \begin{enumerate}
    \item liczba przeciwna iloczynowi dwóch liczb przeciwnych
    \item iloraz wartości bezwględnej liczby ujemnej i liczby odwrotnej do niej
    \item iloczyn sumy dwóch liczb ujemnych i ilorazu tych liczb
    \item liczba przeciwna odwrotności sześcianu iloczynu wartości bezwzględnej
      ilorazu kwadratu dwóch liczb o przeciwnych znakach i odwrotności liczby
      przeciwnej w stosunku do tego ilorazu
  \end{enumerate}
\end{enumerate}
\end{document}
Stefan
LaTeX.org admin
latex_newbie
Posts: 7
Joined: Tue Jul 03, 2012 3:09 pm

Re: Problem with Line Indentation

Post by latex_newbie »

Thank you.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Problem with Line Indentation

Post by localghost »

Just for the record. For such kind of documents it might be preferable to use the exam class.

Code: Select all

\documentclass[11pt,polish]{exam}
\usepackage[T1]{fontenc}
\usepackage{selinput}    % semi-automatic determination
\SelectInputMappings{    % of input encoding
  oacute={ó},            % by a list of selected glyphs
  sacute={ś},            % see: http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt
  Euro={€}
}
\usepackage{babel}
\usepackage[text={6.3in,9in}]{geometry}
\usepackage{parskip}

\renewcommand*{\partlabel}{\thepartno)}
\pointpoints{punkt}{punkty}
\pointsinmargin

\begin{document}
  \begin{questions}
    \question[5] Ustal, jaką liczbą, \emph{dodatnią}, czy \emph{ujemną} jest:
    \begin{parts}
      \item liczba przeciwna iloczynowi dwóch liczb przeciwnych
      \item iloraz wartości bezwględnej liczby ujemnej i liczby odwrotnej do niej
      \item iloczyn sumy dwóch liczb ujemnych i ilorazu tych liczb
      \item liczba przeciwna odwrotności sześcianu iloczynu wartości bezwzględnej ilorazu kwadratu dwóch liczb o przeciwnych znakach i odwrotności liczby przeciwnej w stosunku do tego ilorazu
    \end{parts}
  \end{questions}
\end{document}
For more information about its capabilities take a look at the class guide.


Thorsten
Post Reply