* [bug] Export to latex truncates long subsections (WE attached) @ 2019-08-26 3:46 Vladimir Nikishkin 2019-08-26 9:47 ` Nicolas Goaziou 2019-08-26 10:12 ` Julius Dittmar 0 siblings, 2 replies; 13+ messages in thread From: Vladimir Nikishkin @ 2019-08-26 3:46 UTC (permalink / raw) To: emacs-orgmode [-- Attachment #1.1: Type: text/plain, Size: 331 bytes --] Hello, friends! I have a problem in that when I try to export an .org file into latex/pdf, long sections are not wrapped to the next page, but are truncated instead. The result is on the picture (points 10.34 to 10.37 missing), and the (not)working example is attached to this email. -- Yours sincerely, Vladimir Nikishkin [-- Attachment #1.2: Type: text/html, Size: 543 bytes --] [-- Attachment #2: temp-for-publish.org --] [-- Type: application/octet-stream, Size: 5712 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [bug] Export to latex truncates long subsections (WE attached) 2019-08-26 3:46 [bug] Export to latex truncates long subsections (WE attached) Vladimir Nikishkin @ 2019-08-26 9:47 ` Nicolas Goaziou 2019-08-27 6:57 ` Vladimir Nikishkin 2019-08-26 10:12 ` Julius Dittmar 1 sibling, 1 reply; 13+ messages in thread From: Nicolas Goaziou @ 2019-08-26 9:47 UTC (permalink / raw) To: Vladimir Nikishkin; +Cc: emacs-orgmode Hello, Vladimir Nikishkin <lockywolf@gmail.com> writes: > I have a problem in that when I try to export an .org file into latex/pdf, > long sections are not wrapped to the next page, but are truncated instead. > > The result is on the picture (points 10.34 to 10.37 missing), and the > (not)working example is attached to this email. The LaTeX code generated by Org looks correct. I tried to remove all \label{...}, all \href{...} from the ".tex" file, but the problem is still the same. It may be a LaTeX issue, not an Org one. You may want to investigate in this direction. HTH, Regards, -- Nicolas Goaziou ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [bug] Export to latex truncates long subsections (WE attached) 2019-08-26 9:47 ` Nicolas Goaziou @ 2019-08-27 6:57 ` Vladimir Nikishkin 2019-08-27 7:42 ` Julius Dittmar 2020-11-19 3:41 ` Vladimir Nikishkin 0 siblings, 2 replies; 13+ messages in thread From: Vladimir Nikishkin @ 2019-08-27 6:57 UTC (permalink / raw) To: Vladimir Nikishkin, emacs-orgmode I have indeed investigated the issue, and this is the link: https://latex.org/forum/viewtopic.php?f=47&t=32788 To make the long story short, the folowing trick is needed to allow page breaks after headings (which is a completely standard case in -org). #+begin_src latex \usepackage{xpatch} \makeatletter % This is not recommended, because it can break several things \xpatchcmd{\@afterheading}{\@nobreaktrue}{\@nobreakfalse}{% \typeout{WARNING: \string\@afterheading\space broken}% }{% \@latexerr{ERROR: Cannot patch \string\@afterheading}\@ehd% } \makeatother #+end_src Shall this trick be considered for inclusion in 'org' officially? I mean, having lists of empty headings is a perfectly standard use case for org. пн, 26 авг. 2019 г. в 17:47, Nicolas Goaziou <mail@nicolasgoaziou.fr>: > > Hello, > > Vladimir Nikishkin <lockywolf@gmail.com> writes: > > > I have a problem in that when I try to export an .org file into latex/pdf, > > long sections are not wrapped to the next page, but are truncated instead. > > > > The result is on the picture (points 10.34 to 10.37 missing), and the > > (not)working example is attached to this email. > > The LaTeX code generated by Org looks correct. > > I tried to remove all \label{...}, all \href{...} from the ".tex" file, > but the problem is still the same. > > It may be a LaTeX issue, not an Org one. You may want to investigate in > this direction. > > HTH, > > Regards, > > -- > Nicolas Goaziou -- Yours sincerely, Vladimir Nikishkin ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [bug] Export to latex truncates long subsections (WE attached) 2019-08-27 6:57 ` Vladimir Nikishkin @ 2019-08-27 7:42 ` Julius Dittmar 2019-08-27 8:10 ` Tim Cross 2020-11-19 3:41 ` Vladimir Nikishkin 1 sibling, 1 reply; 13+ messages in thread From: Julius Dittmar @ 2019-08-27 7:42 UTC (permalink / raw) To: emacs-orgmode Hi folks, Am 27.08.19 um 08:57 schrieb Vladimir Nikishkin: > I have indeed investigated the issue, and this is the link: > https://latex.org/forum/viewtopic.php?f=47&t=32788 > > To make the long story short, the folowing trick is needed to allow > page breaks after headings (which is a completely standard case in > -org). > > #+begin_src latex > \usepackage{xpatch} > \makeatletter > % This is not recommended, because it can break several things > \xpatchcmd{\@afterheading}{\@nobreaktrue}{\@nobreakfalse}{% > \typeout{WARNING: \string\@afterheading\space broken}% > }{% > \@latexerr{ERROR: Cannot patch \string\@afterheading}\@ehd% > } > \makeatother > #+end_src > > Shall this trick be considered for inclusion in 'org' officially? > I mean, having lists of empty headings is a perfectly standard use case for org. I would not want that as the default. Yes, it is one standard use case. It would break other standard use cases, like creating ordinary documents, though. Perhaps variant adding such a patch could be added to org-latex-classes, or at least mentioned in the docs to org-latex-classes? That way you can use this "class" version for such cases without adding unnecessary uglyness to other org-created documents. Another possible approach would be a change in the export functions. What really is needed here, from my point of view, is that the export adds a superficial paragraph to a heading in the case that there's no content at all. Nothing should be added if the heading has sub-headings, I count that as content. In case there is no content at all, then some form of breakable vertical space should be added. I don't know enough LaTeX to find the least intrusive way, though I'd try \vspace{0pt}. I did never dig into the export functions, so I don't know how difficult that would be. Just my thoughts, Julius Dittmar ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [bug] Export to latex truncates long subsections (WE attached) 2019-08-27 7:42 ` Julius Dittmar @ 2019-08-27 8:10 ` Tim Cross 0 siblings, 0 replies; 13+ messages in thread From: Tim Cross @ 2019-08-27 8:10 UTC (permalink / raw) To: emacs-orgmode I think I agree with Julius. While it may be a legitimate use case, the risk that it will break other use cases seems a bit high (I've never run into this issue in many years of org use). Perhaps add another document 'type' into 'org-latex-classes which adds the xpatch and associated change to the default. I have a number of such 'templates' (e.g. to generate work documents with the 'approved' colours and logo etc). It works quite well. Tim Julius Dittmar <Julius.Dittmar@gmx.de> writes: > Hi folks, > > Am 27.08.19 um 08:57 schrieb Vladimir Nikishkin: >> I have indeed investigated the issue, and this is the link: >> https://latex.org/forum/viewtopic.php?f=47&t=32788 >> >> To make the long story short, the folowing trick is needed to allow >> page breaks after headings (which is a completely standard case in >> -org). >> >> #+begin_src latex >> \usepackage{xpatch} >> \makeatletter >> % This is not recommended, because it can break several things >> \xpatchcmd{\@afterheading}{\@nobreaktrue}{\@nobreakfalse}{% >> \typeout{WARNING: \string\@afterheading\space broken}% >> }{% >> \@latexerr{ERROR: Cannot patch \string\@afterheading}\@ehd% >> } >> \makeatother >> #+end_src >> >> Shall this trick be considered for inclusion in 'org' officially? >> I mean, having lists of empty headings is a perfectly standard use case for org. > > I would not want that as the default. Yes, it is one standard use case. > It would break other standard use cases, like creating ordinary > documents, though. > > Perhaps variant adding such a patch could be added to org-latex-classes, > or at least mentioned in the docs to org-latex-classes? That way you can > use this "class" version for such cases without adding unnecessary > uglyness to other org-created documents. > > Another possible approach would be a change in the export functions. > What really is needed here, from my point of view, is that the export > adds a superficial paragraph to a heading in the case that there's no > content at all. Nothing should be added if the heading has sub-headings, > I count that as content. In case there is no content at all, then some > form of breakable vertical space should be added. I don't know enough > LaTeX to find the least intrusive way, though I'd try \vspace{0pt}. > > I did never dig into the export functions, so I don't know how difficult > that would be. > > Just my thoughts, > Julius Dittmar -- Tim Cross ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [bug] Export to latex truncates long subsections (WE attached) 2019-08-27 6:57 ` Vladimir Nikishkin 2019-08-27 7:42 ` Julius Dittmar @ 2020-11-19 3:41 ` Vladimir Nikishkin 2020-11-19 4:58 ` Tim Cross ` (2 more replies) 1 sibling, 3 replies; 13+ messages in thread From: Vladimir Nikishkin @ 2020-11-19 3:41 UTC (permalink / raw) To: Vladimir Nikishkin, emacs-orgmode So what is the status of this story? I believe that if one exports an org file with sufficiently many empty TODO headings (to me, it seems a perfectly valid use case of org, printing lists of TODOs), they won't fit on a single page, and latex will drop them. Would the latex snippet in this thread be a good candidate for inclusion into org as a canned trick? On Tue, 27 Aug 2019 at 14:57, Vladimir Nikishkin <lockywolf@gmail.com> wrote: > > I have indeed investigated the issue, and this is the link: > https://latex.org/forum/viewtopic.php?f=47&t=32788 > > To make the long story short, the folowing trick is needed to allow > page breaks after headings (which is a completely standard case in > -org). > > #+begin_src latex > \usepackage{xpatch} > \makeatletter > % This is not recommended, because it can break several things > \xpatchcmd{\@afterheading}{\@nobreaktrue}{\@nobreakfalse}{% > \typeout{WARNING: \string\@afterheading\space broken}% > }{% > \@latexerr{ERROR: Cannot patch \string\@afterheading}\@ehd% > } > \makeatother > #+end_src > > Shall this trick be considered for inclusion in 'org' officially? > I mean, having lists of empty headings is a perfectly standard use case for org. > > пн, 26 авг. 2019 г. в 17:47, Nicolas Goaziou <mail@nicolasgoaziou.fr>: > > > > Hello, > > > > Vladimir Nikishkin <lockywolf@gmail.com> writes: > > > > > I have a problem in that when I try to export an .org file into latex/pdf, > > > long sections are not wrapped to the next page, but are truncated instead. > > > > > > The result is on the picture (points 10.34 to 10.37 missing), and the > > > (not)working example is attached to this email. > > > > The LaTeX code generated by Org looks correct. > > > > I tried to remove all \label{...}, all \href{...} from the ".tex" file, > > but the problem is still the same. > > > > It may be a LaTeX issue, not an Org one. You may want to investigate in > > this direction. > > > > HTH, > > > > Regards, > > > > -- > > Nicolas Goaziou > > > > -- > Yours sincerely, Vladimir Nikishkin -- Yours sincerely, Vladimir Nikishkin (Sent from GMail web interface.) ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [bug] Export to latex truncates long subsections (WE attached) 2020-11-19 3:41 ` Vladimir Nikishkin @ 2020-11-19 4:58 ` Tim Cross 2020-11-19 9:42 ` Julius Dittmar 2020-11-19 10:13 ` Eric S Fraga 2020-11-19 11:09 ` Maxim Nikulin 2 siblings, 1 reply; 13+ messages in thread From: Tim Cross @ 2020-11-19 4:58 UTC (permalink / raw) To: emacs-orgmode Vladimir Nikishkin <lockywolf@gmail.com> writes: > So what is the status of this story? > > I believe that if one exports an org file with sufficiently many empty > TODO headings (to me, it seems a perfectly valid use case of org, > printing lists of TODOs), they won't fit on a single page, and latex > will drop them. Would the latex snippet in this thread be a good > candidate for inclusion into org as a canned trick? > > On Tue, 27 Aug 2019 at 14:57, Vladimir Nikishkin <lockywolf@gmail.com> wrote: >> >> I have indeed investigated the issue, and this is the link: >> https://latex.org/forum/viewtopic.php?f=47&t=32788 >> >> To make the long story short, the folowing trick is needed to allow >> page breaks after headings (which is a completely standard case in >> -org). >> >> #+begin_src latex >> \usepackage{xpatch} >> \makeatletter >> % This is not recommended, because it can break several things >> \xpatchcmd{\@afterheading}{\@nobreaktrue}{\@nobreakfalse}{% >> \typeout{WARNING: \string\@afterheading\space broken}% >> }{% >> \@latexerr{ERROR: Cannot patch \string\@afterheading}\@ehd% >> } >> \makeatother >> #+end_src >> >> Shall this trick be considered for inclusion in 'org' officially? >> I mean, having lists of empty headings is a perfectly standard use case for org. >> What are the implications of doing this? In particular, the comment >> % This is not recommended, because it can break several things Many people have quite complex environments for generating Latex and we would need to be certain that adding this package doesn't 'break several things'. At the very least, something should probably be put on worg so that anyone who is running into the page breaking issue can add the snippet using file header lines. -- Tim Cross ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [bug] Export to latex truncates long subsections (WE attached) 2020-11-19 4:58 ` Tim Cross @ 2020-11-19 9:42 ` Julius Dittmar 0 siblings, 0 replies; 13+ messages in thread From: Julius Dittmar @ 2020-11-19 9:42 UTC (permalink / raw) To: emacs-orgmode Am 19.11.20 um 05:58 schrieb Tim Cross: > > Vladimir Nikishkin <lockywolf@gmail.com> writes: > >> So what is the status of this story? >> >> I believe that if one exports an org file with sufficiently many empty >> TODO headings (to me, it seems a perfectly valid use case of org, >> printing lists of TODOs), they won't fit on a single page, and latex >> will drop them. Would the latex snippet in this thread be a good >> candidate for inclusion into org as a canned trick? >> >> On Tue, 27 Aug 2019 at 14:57, Vladimir Nikishkin <lockywolf@gmail.com> wrote: >>> >>> I have indeed investigated the issue, and this is the link: >>> https://latex.org/forum/viewtopic.php?f=47&t=32788 >>> >>> To make the long story short, the folowing trick is needed to allow >>> page breaks after headings (which is a completely standard case in >>> -org). >>> >>> #+begin_src latex >>> \usepackage{xpatch} >>> \makeatletter >>> % This is not recommended, because it can break several things >>> \xpatchcmd{\@afterheading}{\@nobreaktrue}{\@nobreakfalse}{% >>> \typeout{WARNING: \string\@afterheading\space broken}% >>> }{% >>> \@latexerr{ERROR: Cannot patch \string\@afterheading}\@ehd% >>> } >>> \makeatother >>> #+end_src >>> >>> Shall this trick be considered for inclusion in 'org' officially? >>> I mean, having lists of empty headings is a perfectly standard use case for org. >>> > > What are the implications of doing this? In particular, the comment > >>> % This is not recommended, because it can break several things > > Many people have quite complex environments for generating Latex and we > would need to be certain that adding this package doesn't 'break several > things'. For one thing, it allows something (La)TeX tries to circumvent: page breaks immediately after a section heading. In normal documents, that's something you want to avoid as much as possible. Perhaps another approach would be more fitting, but it needs changing the LaTeX output routine: Have org add something invisible after a heading in case that heading's body is empty. That makes page breaks possible (after that invisible something) without changing the behaviour for non-empty sections. Just my thoughts, Julius Dittmar ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [bug] Export to latex truncates long subsections (WE attached) 2020-11-19 3:41 ` Vladimir Nikishkin 2020-11-19 4:58 ` Tim Cross @ 2020-11-19 10:13 ` Eric S Fraga 2020-11-19 11:28 ` Tim Cross 2020-11-19 11:09 ` Maxim Nikulin 2 siblings, 1 reply; 13+ messages in thread From: Eric S Fraga @ 2020-11-19 10:13 UTC (permalink / raw) To: Vladimir Nikishkin; +Cc: emacs-orgmode On Thursday, 19 Nov 2020 at 11:41, Vladimir Nikishkin wrote: > Would the latex snippet in this thread be a good candidate for > inclusion into org as a canned trick? No, please do not have this as default behaviour. It would break normal documents. In the most innocuous case, it would allow documents to have headings as the last part of a page with the text on the next page, a typesetting faux pas (looking rather ugly). LaTeX documents look inherently nicer than the typical word processed document because LaTeX actually adjusts spacing of not only within lines but also between lines and paragraphs to have the page look good. As Tim has suggested, adding this snippet to Worg would be useful and maybe an item in the FAQ. As well, it might be useful to suggest checkbox lists for people that want to export a long TODO list (which might not be appropriate for all, of course). thank you, eric -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4-118-g2a4578.dirty ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [bug] Export to latex truncates long subsections (WE attached) 2020-11-19 10:13 ` Eric S Fraga @ 2020-11-19 11:28 ` Tim Cross 2020-11-19 12:09 ` Eric S Fraga 0 siblings, 1 reply; 13+ messages in thread From: Tim Cross @ 2020-11-19 11:28 UTC (permalink / raw) To: emacs-orgmode Eric S Fraga <e.fraga@ucl.ac.uk> writes: > On Thursday, 19 Nov 2020 at 11:41, Vladimir Nikishkin wrote: >> Would the latex snippet in this thread be a good candidate for >> inclusion into org as a canned trick? > > No, please do not have this as default behaviour. It would break normal > documents. In the most innocuous case, it would allow documents to have > headings as the last part of a page with the text on the next page, a > typesetting faux pas (looking rather ugly). LaTeX documents look > inherently nicer than the typical word processed document because LaTeX > actually adjusts spacing of not only within lines but also between lines > and paragraphs to have the page look good. > > As Tim has suggested, adding this snippet to Worg would be useful and > maybe an item in the FAQ. As well, it might be useful to suggest > checkbox lists for people that want to export a long TODO list (which > might not be appropriate for all, of course). > I realised after posting that when this first came up some time back, the other suggestion I made, which might still be valid, would be to add another document 'class' to org-latex-classes which includes the snippet by default. Then those who want or need this change could just add a #+LATEX_CLASS line to their org file. Tim -- Tim Cross ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [bug] Export to latex truncates long subsections (WE attached) 2020-11-19 11:28 ` Tim Cross @ 2020-11-19 12:09 ` Eric S Fraga 0 siblings, 0 replies; 13+ messages in thread From: Eric S Fraga @ 2020-11-19 12:09 UTC (permalink / raw) To: Tim Cross; +Cc: emacs-orgmode On Thursday, 19 Nov 2020 at 22:28, Tim Cross wrote: > I realised after posting that when this first came up some time back, > the other suggestion I made, which might still be valid, would be to add > another document 'class' to org-latex-classes which includes the snippet > by default. Then those who want or need this change could just add a > #+LATEX_CLASS line to their org file. That would be a good solution, say having a todo document class. -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4-118-g2a4578.dirty ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [bug] Export to latex truncates long subsections (WE attached) 2020-11-19 3:41 ` Vladimir Nikishkin 2020-11-19 4:58 ` Tim Cross 2020-11-19 10:13 ` Eric S Fraga @ 2020-11-19 11:09 ` Maxim Nikulin 2 siblings, 0 replies; 13+ messages in thread From: Maxim Nikulin @ 2020-11-19 11:09 UTC (permalink / raw) To: emacs-orgmode 2020-11-19 Vladimir Nikishkin wrote: >> >> #+begin_src latex >> \usepackage{xpatch} >> \makeatletter >> % This is not recommended, because it can break several things >> \xpatchcmd{\@afterheading}{\@nobreaktrue}{\@nobreakfalse}{% >> \typeout{WARNING: \string\@afterheading\space broken}% >> }{% >> \@latexerr{ERROR: Cannot patch \string\@afterheading}\@ehd% >> } >> \makeatother >> #+end_src Maybe introducing negative penalty *before* subsections would allow page breaks without undesired splitting between usual headers and immediately following paragraphs. I have not checked it, it is just an idea. I agree that such tricks should not be enabled by default. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [bug] Export to latex truncates long subsections (WE attached) 2019-08-26 3:46 [bug] Export to latex truncates long subsections (WE attached) Vladimir Nikishkin 2019-08-26 9:47 ` Nicolas Goaziou @ 2019-08-26 10:12 ` Julius Dittmar 1 sibling, 0 replies; 13+ messages in thread From: Julius Dittmar @ 2019-08-26 10:12 UTC (permalink / raw) To: emacs-orgmode Hi Vladimir, I see two problems in the generated LaTeX-file you'd need to address. First, LaTeX has problems handling URLs in section (or subsection) headers. That's one of the reasons LaTeX chokes on the second run of that file -- it's only partially generated, not completely. The second is the fact that there's no content in all those subsections. I guess that's why LaTeX's page break algorithm fails: It does not want to make a page break immediately after a section heading. Thus there's no viable place for LaTeX to break that page. As there's no contents in all those subsections, how about changing it to a list with checkboxes? Then the problem with the URLs is solved too. HTH, Julius Am 26.08.19 um 05:46 schrieb Vladimir Nikishkin: > I have a problem in that when I try to export an .org file into > latex/pdf, long sections are not wrapped to the next page, but are > truncated instead. ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2020-11-19 12:10 UTC | newest] Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-08-26 3:46 [bug] Export to latex truncates long subsections (WE attached) Vladimir Nikishkin 2019-08-26 9:47 ` Nicolas Goaziou 2019-08-27 6:57 ` Vladimir Nikishkin 2019-08-27 7:42 ` Julius Dittmar 2019-08-27 8:10 ` Tim Cross 2020-11-19 3:41 ` Vladimir Nikishkin 2020-11-19 4:58 ` Tim Cross 2020-11-19 9:42 ` Julius Dittmar 2020-11-19 10:13 ` Eric S Fraga 2020-11-19 11:28 ` Tim Cross 2020-11-19 12:09 ` Eric S Fraga 2020-11-19 11:09 ` Maxim Nikulin 2019-08-26 10:12 ` Julius Dittmar
Org-mode mailing list This inbox may be cloned and mirrored by anyone: git clone --mirror https://orgmode.org/list/0 list/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 list list/ https://orgmode.org/list \ emacs-orgmode@gnu.org public-inbox-index list Example config snippet for mirrors. Newsgroups are available over NNTP: nntp://news.yhetil.org/yhetil.emacs.orgmode nntp://news.gmane.io/gmane.emacs.orgmode AGPL code for this site: git clone https://public-inbox.org/public-inbox.git