[LyX/master] use package parskip to separate paragraphs with vertical space (#4796)

Richard Kimberly Heck rikiheck at lyx.org
Sun Jun 28 16:36:14 UTC 2020


On 6/28/20 10:58 AM, Juergen Spitzmueller wrote:
> commit b0c102cfb40985f46283e4fab0870ec5e2900699
> Author: Juergen Spitzmueller <spitz at lyx.org>
> Date:   Sun Jun 28 17:20:18 2020 +0200
>
>     use package parskip to separate paragraphs with vertical space (#4796)
>     
>     File format change
> ---
> diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
> index 9f6a3fb..776c5c9 100644
> --- a/src/BufferParams.cpp
> +++ b/src/BufferParams.cpp
> @@ -2003,26 +2003,30 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
>  
>  	if (paragraph_separation) {
>  		// when skip separation
> +		string psopt;
>  		switch (getDefSkip().kind()) {
>  		case VSpace::SMALLSKIP:
> -			os << "\\setlength{\\parskip}{\\smallskipamount}\n";
> +			psopt = "[skip=\\smallskipamount]";
>  			break;
>  		case VSpace::MEDSKIP:
> -			os << "\\setlength{\\parskip}{\\medskipamount}\n";
> +			psopt = "[skip=\\medskipamount]";
>  			break;
>  		case VSpace::BIGSKIP:
> -			os << "\\setlength{\\parskip}{\\bigskipamount}\n";
> +			psopt = "[skip=\\bigskipamount]";
> +			break;
> +		case VSpace::HALFLINE:
> +			break;
> +		case VSpace::FULLLINE:
> +			psopt = "[skip=\\baselineskip]";
>  			break;
>  		case VSpace::LENGTH:
> -			os << "\\setlength{\\parskip}{"
> -			   << from_utf8(getDefSkip().length().asLatexString())
> -			   << "}\n";
> +			psopt = "[skip={" + getDefSkip().length().asLatexString() + "}]";
>  			break;
> -		default: // should never happen // Then delete it.
> -			os << "\\setlength{\\parskip}{\\medskipamount}\n";
> +		default:
>  			break;
>  		}
> -		os << "\\setlength{\\parindent}{0pt}\n";
> +		if (features.isAvailable("parskip"))
> +			os << "\\usepackage" + psopt + "{parskip}\n";
>  	} 

If I'm reading this right, it just silently fails if parskip is not
installed. Or am I missing something?

Riki




More information about the lyx-devel mailing list