JelteF / PyLaTeX

A Python library for creating LaTeX files
https://jeltef.github.io/PyLaTeX/
MIT License
2.26k stars 287 forks source link

Improve whitespace handling in ContainerCommand #288

Closed clarksmr closed 4 years ago

clarksmr commented 4 years ago

ContainerCommand added an extra space character to its output, and it added newline characters without prefacing them with a LaTeX percent sign (%) comment character. These caused extra whitespace in the output generated by LaTeX. For many usages that's okay, but when placing two containers next to one another in a LaTeX document that can cause extra whitespace in the generated PDF document, which is not necessarily desirable. Issue #116 addressed a similar problem.

This commit squashes the space character and adds two LaTeX comment characters (%) to eliminate the undesirable whitespace.

codecov-commenter commented 4 years ago

Codecov Report

Merging #288 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #288   +/-   ##
=======================================
  Coverage   90.52%   90.52%           
=======================================
  Files          60       60           
  Lines        4286     4286           
=======================================
  Hits         3880     3880           
  Misses        406      406           
Impacted Files Coverage Δ
pylatex/base_classes/containers.py 97.10% <100.00%> (ø)