My problem sounds rather simple, but I couldn't find a solution yet.
I'm trying to typeset a long, colored title (which spans over two lines), such that the second line is right-aligned.
In other words, I'm looking for something like the multline
environment, but for colored text.
Sounds easy, but neither the general solutions for right-aligned text here (nor here) work.
\documentclass[a4paper, 11pt, ngerman]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenx}
\renewcommand*\sfdefault{phv}
\parindent0mm
\usepackage[a4paper, left=12.7mm, right=12.7mm, top=12.7mm, bottom=13mm]{geometry}
\usepackage{showframe}
\usepackage{setspace}
\onehalfspacing
\usepackage{xcolor}
\title{Alignment inside Textcolor}
\author{rotton}
\date{}
\begin{document}
{\sffamily
%% Not working as expected
\textcolor{blue}{\LARGE Richard David Precht: Wer bin ich -- und wenn ja, wie viele? \\
{\raggedleft{} Eine philosophische Reise}}
%% Not working as expected
\textcolor{red}{\LARGE Richard David Precht: Wer bin ich -- und wenn ja, wie viele? \\
\hfill Eine philosophische Reise}
%% Working, but with big vertical offset
\textcolor{green}{\LARGE Richard David Precht: Wer bin ich -- und wenn ja, wie viele? \\
\begin{flushright} Eine philosophische Reise \end{flushright}}
%% Working, but not inside textcolor
{\LARGE Richard David Precht: Wer bin ich -- und wenn ja, wie viele? \par
\hfill Eine philosophische Reise}
}
Etwas mehr Text.
\end{document}
What I'm trying to achieve should look like the fourth example, but with colored text:
{\color{red}\LARGE Richard David Precht: Wer bin ich -- und wenn ja, wie viele? \par \hfill Eine philosophische Reise}
\par
work inside\color
, but gives an error inside\textcolor
?\color
is a switch.\textcolor
is a command with argument and not long. So it does not allow\par
inside the text argument.\` nor
\newline{}` work instead of\par
?