LyXOnehalf line spacing doc with single line spacing quotations

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
runevision
Posts: 4
Joined: Thu Aug 21, 2008 1:51 pm

Onehalf line spacing doc with single line spacing quotations

Post by runevision »

I'm writing a document in LyX with onehalf line spacing, and I'd like the quotes to be single line spaced.

I have eventually found a solution but it was not easy to find (for me). It is based on these two posts (from 2002):
http://www.mail-archive.com/lyx-users@l ... 20792.html
http://www.mail-archive.com/lyx-users@l ... 20869.html

I tried out countless variations that all produced wrong results one way or the other. Part of the confusion came from this post:
http://www.mail-archive.com/lyx-users@l ... 52814.html

Anyway, eventually I ended up with simply this, which seems to work perfectly:

Code: Select all

Code, edit and compile here:
\let\oldquote=\quotation
\let\oldendquote=\endquote
\renewenvironment{quotation}
{\singlespacing\oldquote}
{\oldendquote}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This code should be put in the LaTeX Preamble, accessed in the document settings dialog.

In the same dialog, under Text Layout, the line spacing should be set to OneHalf, which then affects the rest of the document.

The TOC and bibliography can be single spaced too, by using the menu Edit > Paragraph Settings while the cursor is just before the auto-generated TOC and bibliography respectively.

Hope that may help someone out there, having the same difficulties as I just had.

Also, if the above solution is not a good one for some reason, please let me know! I don't know LaTeX, it just seems to work.

Rune

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: Onehalf line spacing doc with single line spacing quotations

Post by Juanjo »

In LaTeX, there are two environments intended for quotations: quote and quotation. They differ essentially in the indentation and the space between paragraphs (quote has no indentantion, contrarily to quotation, and bigger inter-paragraph separation). You should use one or another, but not mix both, as seen in your code: \oldquote relies on quotation, whereas \oldenquote comes from quote (through \endquote). Fortunately, \enquotation (which is the macro you should assign to \oldendquote) and \endquote have the same internal definition, so the confusion has no consequence.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
runevision
Posts: 4
Joined: Thu Aug 21, 2008 1:51 pm

Onehalf line spacing doc with single line spacing quotations

Post by runevision »

Juanjo wrote:You should use one or another, but not mix both, as seen in your code: \oldquote relies on quotation, whereas \oldenquote comes from quote (through \endquote).
Thanks. The code originally used quote, and I wanted to use it for quotation instead. It was a simple oversight that I forgot to change it for the environment ending. It's fixed below and I renamed the variables too to avoid confusion.

Code: Select all

Code, edit and compile here:
\let\oldquotation=\quotation
\let\oldendquotation=\endquotation
\renewenvironment{quotation}
{\singlespacing\oldquotation}
{\oldendquotation}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Rune
ExecutorElassus
Posts: 94
Joined: Wed Sep 07, 2011 3:14 pm

Re: Onehalf line spacing doc with single line spacing quotat

Post by ExecutorElassus »

Using your updated code causes strange behavior: the paragraph before the quotation block also gets set single-spaced. Is there something going wrong with how LyX is handling this code in recent versions?

Cheers,

EE
Post Reply