1

I'm writing a book and then using LaTeX to create a personal review version because I like to have a specific look when editing. (I'm just using article class. I'm a beginner at LaTeX .

I want the text with no indent, a single line between the paragraphs, and the paragraphs manually numbered with the number in the left margin. I can get the line break fine, but the manual numbering is causing a slight indent of each paragraph. The problem disappears when I remove my numbering, but I prefer to be able to number the paragraphs manually.

Magic idents

My poor code:

\documentclass{article}

%Page
\usepackage[a4paper, left=6cm, right=5cm, top=2.5cm, top=4cm, showframe=true]{geometry}
\setlength{\parindent}{0em} 
\setlength{\parskip}{1em}           

%Fonts
\usepackage{fontspec}
\setmainfont{Equity Text B}

%Numbering
\reversemarginpar
\newcounter{paranum}
\newcommand{\xx}{%          
\leavevmode                     
\refstepcounter{paranum}
 \marginpar{\normalsize\textbf{[\arabic{paranum}]}.}}       
2

2 Answers 2

2

You have added a space here

\leavevmode                     
\refstepcounter{paranum} %<<<<< one word space

You need a % after } if you have a newline in the source there.

0
1

As David pointed out, it is problem of this tiny space.

Let me add some information here. If you make a new line, a space is added there.

This code

\mbox{}
\mbox{}
\mbox{}
T
e
x
t

produces

   T e x t

whereas

\mbox{}%
\mbox{}%
\mbox{}%
T%
e%
x%
t%

produces

Text

The % ignores ALL characters until endOfline including eol. So it also ignores the character, that produces a space.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .