emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [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 --]


* TODO Good Books [0/33]
:PROPERTIES:
:COLUMNS:  %25ITEM %TODO %3PRIORITY %TAGS %PAGES(Pages){+} %DONEPAGES(Done){+}
:END:
** TODO [[http://www.finseth.com/craft/][Craft of Text Editing about Emacs]]
** TODO The art of Metaobject protocol [[https://en.m.wikipedia.org/wiki/The_Art_of_the_Metaobject_Protocol][Wikipedia Link]]
** TODO lesswrong.com [[https://www.lesswrong.com/][Link online]]
** TODO lesswrong.ru 
** TODO Ilya Prigogine Philosophy of complexity?
** TODO An Introduction to the Graphic Language: The Vocabulary, Grammatical Construction, Idiomatic Use, and Historical Development, with Special Reference to the Reading of Drawings -- by Gardner Chace 
** TODO Getting Things Done
** TODO Kernigan-Pike Practice of Programming
** TODO Model Calibration and Parameter Estimation
** TODO Hitchhiker's Guide to the Galaxy                               :hate:
** TODO Thomas Hunt Pragmatic Programmer
** TODO r-5.org
** TODO otoro.net machine learning research blog
** TODO Weinberg The Trouble With Quantum Mechanics
** TODO Elements of Statistical Learning
** TODO Tufte Book on graphs
** TODO sumofsquares.org book
** TODO Gabriel Wyner Fluent Forever How To Learn Any Language
** TODO https://en.wikipedia.org/wiki/Scientific_community_metaphor and subbooks
** TODO https://www.amazon.com/dp/0201433117/?tag=stackoverfl08-20
** TODO [[http://immersivemath.com/ila/index.html][Immersive Linear Algebra]]
** TODO [[http://discrete.openmathbooks.org/dmoi3.html][Discrete Mathematics Open Book]]
** TODO danijar.com
** TODO Terry Tang Yuan github.io
** TODO blog.mdda.net
** TODO brilliant.org blog
** TODO [[http://gaudisite.nl/newspage.html][Gaudi Systems Architecture]]
** TODO Farnam Street
** TODO http://www.mitchr.me/SS/books/Catigory_index.html and subbooks
** TODO [[https://www.scrumalliance.org/labs][Scrum Alliance]]
** TODO [[http://flibusta.is/b/482781][Gippenreiter-2+3]]
** TODO [[http://timmurphy.org/2018/05/22/combining-pdf-documents-using-latex/][Tim Murphy's Blog]]
** TODO [[http://flibusta.is/b/122923][Ruth Benedict Chrysanthemum and Sword]]
** TODO [[https://www.amazon.com/Mathematicians-Lament-School-Fascinating-Imaginative/dp/1934137170/ref=pd_aw_sbs_14_1/146-9551928-4683768?_encoding=UTF8&pd_rd_i=1934137170&pd_rd_r=ebc1f528-5232-11e9-a585-0fccb0784f1b&pd_rd_w=gnvYP&pd_rd_wg=V2MnV&pf_rd_p=aae79475-6dc9-4a12-80e8-27b63108fa72&pf_rd_r=GC659QJ4DRN1YBNG4HZE&psc=1&refRID=GC659QJ4DRN1YBNG4HZE][Mathematician's Lament]]
** TODO Tech books
*** TODO Lamport Latex 
    :PROPERTIES:
    :PAGES:    272
    :END:
*** TODO Spivak, JoyOfTex
    :PROPERTIES:
    :PAGES:    309
    :END:
*** TODO Knuth TeXbook
    :PROPERTIES:
    :PAGES:    477
    :END:
*** TODO FreeCAD
    :PROPERTIES:
    :PAGES:    181
    :END:
*** TODO SWIG
    :PROPERTIES:
    :PAGES:    501
    :END:
*** TODO Emacs Lisp
    :PROPERTIES:
    :PAGES:    2500
    :DONEPAGES: 400
    :END:
*** TODO Kernigan-Pike
    :PROPERTIES:
    :PAGES:    287
    :END:
*** TODO Pragmatic Programmer
    :PROPERTIES:
    :PAGES:    270
    :END:
*** TODO GDB
    :PROPERTIES:
    :PAGES:    814
    :END:
*** TODO IDA Pro
    :PROPERTIES:
    :PAGES:    645
    :END:
*** TODO Togaf
    :PROPERTIES:
    :PAGES:    504
    :END:
*** TODO Craig Scott CMAKE
    :PROPERTIES:
    :PAGES:    418
    :END:
*** TODO OpenSCAD
    :PROPERTIES:
    :PAGES:    300
    :END:
*** DONE AUCTeX
    CLOSED: [2019-08-13 Tue 00:21]
    :PROPERTIES:
    :PAGES:    262
    :DONEPAGES: 262
    :END:
*** DONE Magit
    CLOSED: [2019-07-31 Wed 12:34]
    :PROPERTIES:
    :PAGES:    231
    :DONEPAGES: 231
    :END:
** TODO Science Books
*** TODO Shen Kolmogorov Komplexity
    :PROPERTIES:
    :PAGES:    568
    :END:
*** TODO Arora-Barak
    :PROPERTIES:
    :PAGES:    570
    :END:
*** TODO Strandh
    :PROPERTIES:
    :PAGES:    209
    :END:
*** TODO Kleinberg-Tardos
    :PROPERTIES:
    :PAGES:    837
    :END:
*** TODO Sipser Introduction to theory of computation
    :PROPERTIES:
    :PAGES:    456
    :END:
*** TODO Romanyuk
    :PROPERTIES:
    :PAGES:    326
    :END:
*** TODO Papoulis
    :PROPERTIES:
    :PAGES:    419
    :END:
*** TODO Model Calibration and Parameter Estimation
    :PROPERTIES:
    :PAGES:    600
    :END:
** TODO Work
*** TODO Patents
    :PROPERTIES:
    :PAGES:    1200
    :END:
*** TODO POSA-5
    :PROPERTIES:
    :PAGES:    400
    :END:
*** TODO MBSA
    :PROPERTIES:
    :PAGES:    370
    :END:
*** TODO ASML
    :PROPERTIES:
    :PAGES:    500
    :END:
*** TODO Wymore
    :PROPERTIES:
    :PAGES:    707
    :END:
** TODO Culture
*** TODO Mao
    :PROPERTIES:
    :PAGES:    590
    :END:
*** TODO Xi
    :PROPERTIES:
    :PAGES:    510
    :END:
*** TODO Sources of Chinese Tradition
    :PROPERTIES:
    :PAGES:    1150
    :END:
** TODO Books that `If I have time'
*** TODO The LaTeX Companion by Goossens, Mittelbach
*** TODO LaTeX Web Companion
*** TODO Simmons Modern Analysis
*** TODO Sussman, A computational model of Skill Acquisition
*** TODO Julie Sussman, I can read that a traveler's introduction to Chinese
*** TODO Michael Kerrisk Linux API
*** TODO Acoff-Emery on purposeful systems
*** TODO Gabriel Wyner How to learn any language and never forget
*** TODO Structure and interpretation of classical mechanics
*** TODO Russel/Norvig Artificial Intelligence Modern Approach (STRIPS algorithm)
*** TODO Han Abelson Lower Bounds on Information Transfer in Distributed Computations
*** TODO Abelson Blown to Bits
*** TODO Shirko, Nonlinear Continual Mechanics
*** TODO Dougherty Random Processes for Image Processing
** TODO Philosophy
*** TODO Proudhon
*** TODO Das Kapital
*** TODO Wittgenstein
*** TODO Zhorzhh Durua ( George Durois?)
*** TODO Ludwig von Mises

^ 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  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

* 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  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)
  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

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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).