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=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=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-27 Thread Vladimir Nikishkin
I have indeed investigated the issue, and this is the link:
https://latex.org/forum/viewtopic.php?f=47=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