Re: [bug] Export to latex truncates long subsections (WE attached)

2020-11-19 Thread Eric S Fraga
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



Re: [bug] Export to latex truncates long subsections (WE attached)

2020-11-19 Thread Tim Cross


Eric S Fraga  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



Re: [bug] Export to latex truncates long subsections (WE attached)

2020-11-19 Thread Maxim Nikulin

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.





Re: [bug] Export to latex truncates long subsections (WE attached)

2020-11-19 Thread Eric S Fraga
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



Re: [bug] Export to latex truncates long subsections (WE attached)

2020-11-19 Thread Julius Dittmar

Am 19.11.20 um 05:58 schrieb Tim Cross:


Vladimir Nikishkin  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  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




Re: [bug] Export to latex truncates long subsections (WE attached)

2020-11-18 Thread Tim Cross


Vladimir Nikishkin  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  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



Re: [bug] Export to latex truncates long subsections (WE attached)

2020-11-18 Thread Vladimir Nikishkin
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  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 :
> >
> > Hello,
> >
> > Vladimir Nikishkin  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.)



Re: [O] [bug] Export to latex truncates long subsections (WE attached)

2019-08-27 Thread Tim Cross


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



Re: [O] [bug] Export to latex truncates long subsections (WE attached)

2019-08-27 Thread Julius Dittmar
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



Re: [O] [bug] Export to latex truncates long subsections (WE attached)

2019-08-26 Thread 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.

пн, 26 авг. 2019 г. в 17:47, Nicolas Goaziou :
>
> Hello,
>
> Vladimir Nikishkin  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



Re: [O] [bug] Export to latex truncates long subsections (WE attached)

2019-08-26 Thread Julius Dittmar
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.



Re: [O] [bug] Export to latex truncates long subsections (WE attached)

2019-08-26 Thread Nicolas Goaziou
Hello,

Vladimir Nikishkin  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



[O] [bug] Export to latex truncates long subsections (WE attached)

2019-08-25 Thread Vladimir Nikishkin
 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


temp-for-publish.org
Description: Binary data