GeneralProblem with Indentation

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
neclepsio
Posts: 2
Joined: Mon Aug 01, 2011 10:44 am

Problem with Indentation

Post by neclepsio »

Hi everyone,
I have a problem with the indentation of the text. Can anyone please help me understanding why the line produced by the code indicated with the arrow is not aligned with the others?

Thank you very much,
Ignazio

Code: Select all

\documentclass[italian]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{color}
\usepackage{pict2e}[2009/06/01] 

\setlength{\parindent}{0pt} 

\newcommand\Response{{% 
    \setbox0\hbox{R}
    \unitlength\ht0 
    \picture(0,0)
      \linethickness{.075\unitlength} 
      \polyline(0.2,-0.3)(.7,1.2)(0.2,1.35) 
    \endpicture
    \box0
}}

\newcommand\ResponseB{% 
    \unitlength=1.5ex
    R
    \begin{picture}(0, 0)(1.9, 0)
	\linethickness{.075\unitlength} 
	\polyline(0.2,-0.3)(.7,1.2)(0.2,1.35) 
    \end{picture}
    \kern-1.7ex
} 

\begin{document}

\textbf{%
	R test\\%
	\Response{} test\\%
	\ResponseB{} test\\%
}

\textbf{R test}\\%
\textbf{\Response{} test}\\%
\textbf{\ResponseB{} test}\\%

\textcolor{red}{\textbf{R test}}\\%
\textcolor{red}{\textbf{\Response{} test}}\\%   <-----------
\textcolor{red}{\textbf{\ResponseB{} test}}\\%

\textcolor{red}{\textbf{%
	R test\\%
	\Response{} test\\%
	\ResponseB{} test\\%
}}


\end{document}

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10360
Joined: Mon Mar 10, 2008 9:44 pm

Problem with Indentation

Post by Stefan Kottwitz »

Hi Ignazio,

welcome to the board!

Just add a % at the end of this line in the definition of \Response:

Code: Select all

\setbox0\hbox{R}%
Stefan
LaTeX.org admin
neclepsio
Posts: 2
Joined: Mon Aug 01, 2011 10:44 am

Re: Problem with Indentation

Post by neclepsio »

Thank you!
Can I ask why does it happen only when using color?
Post Reply