0

I'm trying to remove the left-indentation inserted automatically before the subsection's text. \noindent and parindent are not working (I guess they're made to work with paragraphs not with sections).

See in the next screenshot in red the indentation (spacing) I'm trying to get rid of:

![screenshot

The only code I'm using to style the subsections (and sections) is the following:

\documentclass{article}

% customize sections style
\usepackage{titlesec}
\titlespacing\section{0pt}{12pt plus 2pt minus 2pt}{12pt plus 4pt minus 2pt}
\titlespacing\subsection{0pt}{12pt plus 2pt minus 2pt}{12pt plus 4pt minus 2pt}

% experience and education items
\newcommand{\experienceline}[3]{
    \subsection*{
        #1 \hfill \small #2 \newline
        \normalsize #3
    }
}

\begin{document}
    % hobbies section
    \section*{Hobbies}
    \experienceline{Reading}{2011-2011}{Lorem ipsum dolor sit amet}
\end{document}
Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
Hakim
  • 333
  • Do you any code to define your (sub)sections formatting? – Bernard Dec 17 '16 at 21:49
  • @Bernard I've just added the bit of code used to style the sections' margins. – Hakim Dec 17 '16 at 21:51
  • This code alone doesn't reproduce your problem when insertes in a full compilable code. Could you post a minimal compilable code which reproduces it? – Bernard Dec 17 '16 at 22:10
  • @Bernard please see the update, it should reproduce the indentation I described in the subsection called "Reading" above. – Hakim Dec 17 '16 at 22:15
  • @h4k1m No, the code snippet doesn't reproduce the behavior. You have a wealth of unprotected end-of-lines, though. And other quirks, such as believing that \small and \normalsize take an argument: they don't. – egreg Dec 17 '16 at 22:30
  • @egreg The exactly same code above does show the indentation of the subsection for me. I'm using miktex on Windows (I'm not sure this might be because of it). – Hakim Dec 17 '16 at 22:34
  • I'm sorry, I don't reproduce it with this code – and I 'm using MiKTeX. – Bernard Dec 17 '16 at 23:04
  • @DavidCarlisle You're right, it seems that if I put the code between curly brackets in the same line as the \subsection there's no spacing. The indentation seems to be created by the <CR> character. – Hakim Dec 17 '16 at 23:28
  • the point is you are supposed to post an example of the problem. If you post code that does not have a problem and post an image generated by some different code you have not shown, how can anyone help? – David Carlisle Dec 17 '16 at 23:29
  • @DavidCarlisle please see my previous comment! – Hakim Dec 17 '16 at 23:30
  • the end of line is a space (not indentation, a normal word space as I said in my initial comment, but since the section head in your code starts a paragraph, word spaces are ignored. But you used different code, that you have not shown to generate the image. – David Carlisle Dec 17 '16 at 23:33
  • @DavidCarlisle The code as written above produces the indentation for me (There's nothing to update!). Regarding the percentage sign (%), it does solve my problem as well. Thank you. – Hakim Dec 17 '16 at 23:37
  • what makes the black horizontal line shown in your image? – David Carlisle Dec 18 '16 at 00:08
  • @DavidCarlisle Sorry I've updated the screenshot. But the indentation still persists if I omit the % sign. – Hakim Dec 18 '16 at 17:20

0 Answers0