From: Salim B <salim.brueggemann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: change line spacing in table without affecting header/footer layout (MD -> PDF)
Date: Sun, 15 Oct 2017 11:04:46 -0700 (PDT) [thread overview]
Message-ID: <0ed910b5-1e45-4ee3-804d-609495a3ec42@googlegroups.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 4657 bytes --]
Hi there,
Basically I'm trying to set different line spacings for the general
document on one hand and for tables on the other hand. The motivation is
that I want to have a general line spacing of 1.5, but that doesn't look
good in tables which have multiline cells (and makes them unncecessary
long). So I'm trying to set a different line spacing for the tables only.
Currently I'm inserting the following Latex commands before a table and
wrapping this in a Latex group to only affect the table by the commands:
\begingroup
\singlespace
\renewcommand*{\arraystretch}{1.5}
... here would come the table ...
\endgroup
Now the problem is that if the table is placed at the very end of the page
or spans over mulitple pages the headers and footers of those pages are
affected by the \singlespace and \renewcommand*{\arraystretch}{1.5}
commands above.
I have created the following Markdown document as a minimal working example
to demostrate the problem:
---
documentclass: scrreprt
linestretch: 1.5
header-includes:
- \pagestyle{headings}
- \usepackage{scrlayer-scrpage}
- \KOMAoptions{headsepline = on}
- \KOMAoptions{footsepline = on}
- \addtokomafont{pageheadfoot}{\normalfont\small}
- \addtokomafont{pagenumber}{\small}
- \ModifyLayer[addvoffset = 3pt]{scrheadings.head.below.line}
- \ModifyLayer[addvoffset = 3pt]{plain.scrheadings.head.below.line}
---
# Test Document
_Nothing more here, go to the following pages..._
\newpage
This is a page to demonstrate correct header/footer layout.
\newpage
On this page the header/footer layout is messed up because of the table
below.
\begingroup
\singlespace
\renewcommand*{\arraystretch}{1.5}
| Right | Left | Default | Center | Multi-line column |
|------:|:-----|---------|:------:| ----------------- |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a
single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a
single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a
single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a
single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a
single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a
single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a
single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a
single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a
single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a
single line because it consists of way tooooooooooo many characters |
: Test Table
\endgroup
On this page the header/footer is fine again because the page doesn't end
with a table.
A simpler header-includes key would consist of only the following which
demonstrates the problem as well, but in a less visible manner since only
the header is affected then:
header-includes:
- \pagestyle{headings}
- \KOMAoptions{headsepline = on}
I've attached the MVE Markdown and the PDF produced with pandoc
--output=test_document_2.pdf test_document_2.md to this post.
My questions now include:
1. Is there a better way to change the line spacing in tables that
doesn't affect the rest of the document layout (ideally something I could
define in the header-includes key)?
2. Or alternatively, can I add something to avoid the misplaced
headers/footers to the example above?
--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0ed910b5-1e45-4ee3-804d-609495a3ec42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 423188 bytes --]
[-- Attachment #2: test_document_2.md --]
[-- Type: text/x-markdown, Size: 2389 bytes --]
---
documentclass: scrreprt
linestretch: 1.5
header-includes:
- \pagestyle{headings}
- \usepackage{scrlayer-scrpage}
- \KOMAoptions{headsepline = on}
- \KOMAoptions{footsepline = on}
- \addtokomafont{pageheadfoot}{\normalfont\small}
- \addtokomafont{pagenumber}{\small}
- \ModifyLayer[addvoffset = 3pt]{scrheadings.head.below.line}
- \ModifyLayer[addvoffset = 3pt]{plain.scrheadings.head.below.line}
---
# Test Document
_Nothing more here, go to the following pages..._
\newpage
This is a page to demonstrate correct header/footer layout.
\newpage
On this page the header/footer layout is messed up because of the table below.
\begingroup
\singlespace
\renewcommand*{\arraystretch}{1.5}
| Right | Left | Default | Center | Multi-line column |
|------:|:-----|---------|:------:| ----------------- |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a single line because it consists of way tooooooooooo many characters |
| 123 | 123 | 123 | 123 | Some random text that doesn't fit on a single line because it consists of way tooooooooooo many characters |
: Test Table
\endgroup
On this page the header/footer is fine again because the page doesn't end with a table.
[-- Attachment #3: test_document_2.pdf --]
[-- Type: application/pdf, Size: 69133 bytes --]
reply other threads:[~2017-10-15 18:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0ed910b5-1e45-4ee3-804d-609495a3ec42@googlegroups.com \
--to=salim.brueggemann-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).