Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I tried to make my own "quote"-Environment and I wanted the first Letter to be bold and a little bit bigger than the rest. As \lettrine doesn't work the way i wanted, i tried to code it on my own.

Everything works as intended, except one thing: I get a white space between the L and the orem Ipsum and i don't know where it comes from

\documentclass[12pt,a4paper,listof=totoc,oneside]{scrreprt}
\usepackage[ngerman]{babel}

\usepackage{xcolor}
\definecolor{citecolor}{HTML}{6495ED} 

% Weil ich parameter im end-teil haben will
\usepackage{xparse}

% Eigene Quotes
\usepackage{csquotes}
\NewDocumentEnvironment{myquote}{m o}{%
    \begin{samepage}%
        \list{}{%
            \setlength{\leftmargin}{1.5em}%
            \setlength{\rightmargin}{1.5em}%
            \setlength{\topsep}{0em}%
            \setlength{\parsep}{0pt}%
            \setlength{\partopsep}{0pt}%
            \setlength{\parskip}{0pt}%
        }%
        \item\relax%
        \begin{itshape}%
            % Anführungszeichen
            \begin{large}\textbf{\textcolor{citecolor}{\flqq}}\end{large}
            % Großer Buchstabe (wenn angegeben)
            \IfNoValueTF{#2}{}{{\Large{\textbf#2}}}%
}{%
            \begin{large}\textbf{\textcolor{citecolor}{\frqq}}\end{large}
        \end{itshape}%
        \endlist%
        % Quelle
        \hspace*{\fill}\mbox{\footnotesize\textcolor{citecolor}{\cite{#1}}}%
        \vspace{1.5em}%
    \end{samepage}%
}%



\begin{document}

% Calling the Environment
\begin{myquote}{WIKI1}[L]
orem Ipsum...
\end{myquote}

\end{document}
share|improve this question
    
You are missing the % required to end lines: as you've not used \ExplSyntaxOn the 'standard' requires of TeX programming apply. –  Joseph Wright Mar 18 '13 at 7:58
    
Welcome to TeX.sx! –  texenthusiast Mar 18 '13 at 7:59
    
Ty for the quick Response, but even if I end each line with a %, the blank between the L and the orem Ipsum stays. –  Arno Nym Mar 18 '13 at 8:06
    
While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. –  Peter Grill Mar 18 '13 at 8:28
    
ty for the hint, i posted a executeable version –  Arno Nym Mar 18 '13 at 8:36

2 Answers 2

up vote 5 down vote accepted

The space is the end of line after \begin{myquote}{WIKI1}[L], because your "begin part" starts a paragraph and this space is not ignored. The solution is to add \ignorespaces.

I've made some other changes to your definition; avoid \begin{itshape} or \begin{large}: \itshape and \large are declarations that don't take an argument.

\documentclass[12pt,a4paper,listof=totoc,oneside]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\usepackage{xcolor}
\definecolor{citecolor}{HTML}{6495ED} 

% Weil ich parameter im end-teil haben will
\usepackage{xparse}

% Eigene Quotes
\usepackage{csquotes}
\NewDocumentEnvironment{myquote}{m o}
 {%
  \par
  \begin{samepage}%
  \list{}{%
    \setlength{\leftmargin}{1.5em}%
    \setlength{\rightmargin}{1.5em}%
    \setlength{\topsep}{0em}%
    \setlength{\parsep}{0pt}%
    \setlength{\partopsep}{0pt}%
    \setlength{\parskip}{0pt}%
  }%
  \item\relax
  \itshape
  % Anführungszeichen
  {\large\bfseries\textcolor{citecolor}{\flqq}}%
  % Großer Buchstabe (wenn angegeben)
  \IfNoValueTF{#2}{}{{\Large\bfseries#2}}%
  \ignorespaces
 }
 {%
  {\large\bfseries\textcolor{citecolor}{\frqq}}%
  \endlist
  % Quelle
  \hspace*{\fill}\mbox{\footnotesize\textcolor{citecolor}{\cite{#1}}}%
  \vspace{1.5em}%
  \end{samepage}%
 }

\begin{document}

% Calling the Environment
\begin{myquote}{WIKI1}[L]
orem Ipsum...
\end{myquote}

\end{document}

enter image description here

share|improve this answer
    
thank you for the additional input! I will apply your improvements to my code! :-) –  Arno Nym Mar 18 '13 at 11:35

The space after the L is from the newline after [L] in your document. You can ignore white space there by adding \ignorespaces to your definition. There are also some missing % which cause extra space after your grey <<

            \begin{large}\textbf{\textcolor{citecolor}{\flqq}}\end{large}%<<
            % Großer Buchstabe (wenn angegeben)
            \IfNoValueTF{#2}{}{{\Large{\textbf#2}}}%
\ignorespaces}{%
 %%%%%%%%%%
            \begin{large}\textbf{\textcolor{citecolor}{\frqq}}\end{large}%<<
share|improve this answer
    
ty very much, now i get it, it wasnt in the definition but in the call –  Arno Nym Mar 18 '13 at 11:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.