2

A while I asked multiple questions regarding the construction of a quotation environment that - among others - is automatically indenting when exceeding a certain number of lines and that is automatically including information regarding direct and indirect quotations. The result is the varquoteenvironment.

I use the code heavily in my linguistic documents. At the same time, I use the \usepackage{gb4e}.

The problem is that the output shows an italic page number when the \varquote{}environment is at the end or the beginning of a page, or when it is floating from one page to the next. If I delete the gb4eenvironment the problem does not occur.

My Question: Is there a way to avoid the problem and use the varquoteand gb4eat the same time?

MWE (if you delete gb4ethe problem is gone)

\documentclass[a4paper,12pt,oneside]{book}

\usepackage[ngerman]{babel}
\usepackage[applemac]{inputenc} 

\usepackage[babel,german=guillemets]{csquotes}

% BEGIN ---- Answer to above mentioned questions, here mainly: http://tex.stackexchange.com/questions/165206/biblatex-improving-dynamic-quotation-command
\makeatletter
\newcommand{\varquote}[1]{%
\begingroup
\booltrue{withintextquote}%
% \settowidth doesn't like paragraphs
\setbox\@tempboxa\hbox{%
    \def\par{\hspace{3\linewidth}}% If a paragraph is included force long form
    %\let\par\space  % Ignore paragraphs
    \let\footnote\@empty% make sure autocite does not do anything here; this is new
    \let\autocite\@empty
    #1}%
\ifdim\wd\@tempboxa>2\linewidth
    \begin{quote}
        \vspace{-1.4em}
        \singlespacing
        \itshape
        #1
    \end{quote}
\else
    {\blx@blxinit\iffootnote{}{}\itshape #1}%
\fi
\endgroup}
\makeatother
% END ---- Answer to above mentioned questions

\usepackage{lipsum}

 \pagestyle{plain} %Normale Seitenzahlen

\usepackage{gb4e}

\begin{document}

\varquote{\lipsum} 

\lipsum
\end{document}
Philip
  • 3,415
  • 1
    Your example doesn't compile. The bool is not defined, the box is too large (@tempboxa can't hold a complete lipsum) and now I get an error due to the singlespacing and so I give up. Why didn't you test your code before posting? – Ulrike Fischer Dec 28 '15 at 13:06
  • I compiled it using q after I copied it from http://tex.stackexchange.com/questions/165206/biblatex-improving-dynamic-quotation-command, changed the name, deleted 2x \smallerand added a \vspace. – Philip Dec 30 '15 at 20:27
  • The example in the linked question contains a \newbool{withintextquote} which is missing in your quote. Beside this it is up to you to ensure that an example compiles, so test it and check the log for errors before posting. – Ulrike Fischer Dec 30 '15 at 20:32
  • I added the \newbool{withintextquote} and it still only compiles using q (what I do not mind as long as there is the desired pdf output). – Philip Dec 30 '15 at 20:40
  • Well I do mind. If you don't make the effort to remove the errors so that I can run tests, why should I make an effort to find the cause of your problem? – Ulrike Fischer Dec 30 '15 at 20:49
  • I would not frame it as question of effort, it is more a question of habituation and (in)competence. I do not have one document that is running without q - and I even did not think about it before the discussion occurred here. – Philip Dec 30 '15 at 20:54
  • Well you shouldn't ignore errors. That's a very bad habitude. Add \makeatletter\def\new@fontshape{}\makeatother before loading gb4e. The package resets \normalfonts as it very old. – Ulrike Fischer Dec 30 '15 at 21:16
  • Thank you so much. I added it to my document and it works qerfectly. I think my problem is that I lack basic programming skills. However, I will try / make sure to provide smooth mwe in the future. Again, thanks! – Philip Dec 30 '15 at 21:31

0 Answers0