pillar latex and code listings

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

pillar latex and code listings

Nicolai Hess-3-2
How are latex output of (named) code listings supposed to work /look ?
I look at the pdf for the update PBE and the references to code example don't
work (just show ??, it works for figures). The code in the code example isn't highlight and
does't have a dark background (as it is in the html output).
The generated tex looks like this:

\begin{listing}[caption={Decomposing aPen go: 100 + 20}, label=scr:decColor2, language=smalltalk]
      aPen go: 100 + 20
(1)                 100 + 20           "binary message first"
                   -->   120
(2)  aPen go: 120                   "then keyword message"
\end{listing}

the pdf output:

Any idea what is wrong ? Is a postprocessing step necessary ? Should it be
\begin{lstlisting} instead of \begin{listing} ?

listing.PNG (16K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: pillar latex and code listings

Damien Pollet
On 7 November 2016 at 23:03, Nicolai Hess <[hidden email]> wrote:
I look at the pdf for the update PBE and the references to code example don't
work (just show ??, it works for figures).

Could be that the reference or label simply don't match…
 
The code in the code example isn't highlight and
does't have a dark background (as it is in the html output).

Don't expect PDF and HTML to look the same. Pillar does its job at a semantic level, not at form level. Both have their own independent way of styling stuff. For LaTeX it relies on a specific document class setup, including some macros to have a layer of decoupling between pillar's output and what some packages offer. The listing environment you're mentioning is an example; I haven't looked at pre-EnterprisePharo books in a while, but it should indeed just be defined as an alias to the lstlisting provided by listings.sty.

BTW I'd recommend migrating the books to the EnterprisePharo layout… but that requires being somehow versed in the dark arts of LaTeX and ready to spend a couple days checking for problems and matching format conventions…

--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet
Reply | Threaded
Open this post in threaded view
|

Re: pillar latex and code listings

Nicolai Hess-3-2


2016-11-07 23:47 GMT+01:00 Damien Pollet <[hidden email]>:
On 7 November 2016 at 23:03, Nicolai Hess <[hidden email]> wrote:
I look at the pdf for the update PBE and the references to code example don't
work (just show ??, it works for figures).

Could be that the reference or label simply don't match…

But it is the same source that works for the html output.
 
 
The code in the code example isn't highlight and
does't have a dark background (as it is in the html output).

Don't expect PDF and HTML to look the same.

Yes, but the latext template at least looks like the listing for smalltalk language at least should recognize some syntax words (self/super/...)
 
Pillar does its job at a semantic level, not at form level. Both have their own independent way of styling stuff. For LaTeX it relies on a specific document class setup, including some macros to have a layer of decoupling between pillar's output and what some packages offer. The listing environment you're mentioning is an example; I haven't looked at pre-EnterprisePharo books in a while, but it should indeed just be defined as an alias to the lstlisting provided by listings.sty.

OK, I 'll check this.
 

BTW I'd recommend migrating the books to the EnterprisePharo layout… but that requires being somehow versed in the dark arts of LaTeX and ready to spend a couple days checking for problems and matching format conventions…

--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet

Reply | Threaded
Open this post in threaded view
|

Re: pillar latex and code listings

Nicolai Hess-3-2


2016-11-08 9:32 GMT+01:00 Nicolai Hess <[hidden email]>:


2016-11-07 23:47 GMT+01:00 Damien Pollet <[hidden email]>:
On 7 November 2016 at 23:03, Nicolai Hess <[hidden email]> wrote:
I look at the pdf for the update PBE and the references to code example don't
work (just show ??, it works for figures).

Could be that the reference or label simply don't match…

But it is the same source that works for the html output.
 
 
The code in the code example isn't highlight and
does't have a dark background (as it is in the html output).

Don't expect PDF and HTML to look the same.

Yes, but the latext template at least looks like the listing for smalltalk language at least should recognize some syntax words (self/super/...)
 
Pillar does its job at a semantic level, not at form level. Both have their own independent way of styling stuff. For LaTeX it relies on a specific document class setup, including some macros to have a layer of decoupling between pillar's output and what some packages offer. The listing environment you're mentioning is an example; I haven't looked at pre-EnterprisePharo books in a while, but it should indeed just be defined as an alias to the lstlisting provided by listings.sty.

OK, I 'll check this.
 

BTW I'd recommend migrating the books to the EnterprisePharo layout… but that requires being somehow versed in the dark arts of LaTeX and ready to spend a couple days checking for problems and matching format conventions…

Hm, the Enterprise book does not use named scripts or refer to scripts in the text, I don't know, maybe it doesn't work even there.
 

--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet


Reply | Threaded
Open this post in threaded view
|

Re: pillar latex and code listings

Nicolai Hess-3-2
In reply to this post by Damien Pollet


2016-11-07 23:47 GMT+01:00 Damien Pollet <[hidden email]>:
On 7 November 2016 at 23:03, Nicolai Hess <[hidden email]> wrote:
I look at the pdf for the update PBE and the references to code example don't
work (just show ??, it works for figures).

Could be that the reference or label simply don't match…
 
The code in the code example isn't highlight and
does't have a dark background (as it is in the html output).

Don't expect PDF and HTML to look the same. Pillar does its job at a semantic level, not at form level. Both have their own independent way of styling stuff. For LaTeX it relies on a specific document class setup, including some macros to have a layer of decoupling between pillar's output and what some packages offer. The listing environment you're mentioning is an example; I haven't looked at pre-EnterprisePharo books in a while, but it should indeed just be defined as an alias to the lstlisting provided by listings.sty.

BTW I'd recommend migrating the books to the EnterprisePharo layout… but that requires being somehow versed in the dark arts of LaTeX and ready to spend a couple days checking for problems and matching format conventions…

Hi Damien, I don't see how the layout from the EnterprisePharo could do labeled listings we could ref from the text. May it be that this is just not possible ?
 

--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet

Reply | Threaded
Open this post in threaded view
|

Re: pillar latex and code listings

Damien Pollet
On 13 November 2016 at 16:23, Nicolai Hess <[hidden email]> wrote:
Hi Damien, I don't see how the layout from the EnterprisePharo could do labeled listings we could ref from the text. May it be that this is just not possible ?

I recall we discussed choices with the other Damien, and that there were constraints due to listings.sty, but I think that's possible. I'd have to have a look at the code, though, because it's very well possible that we decided on a workaround instead.

Can you catch me on Slack sometime this week, or open an issue on https://github.com/cdlm/sbabook if not?



--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet
Reply | Threaded
Open this post in threaded view
|

Re: pillar latex and code listings

Nicolai Hess-3-2


2016-11-13 22:16 GMT+01:00 Damien Pollet <[hidden email]>:
On 13 November 2016 at 16:23, Nicolai Hess <[hidden email]> wrote:
Hi Damien, I don't see how the layout from the EnterprisePharo could do labeled listings we could ref from the text. May it be that this is just not possible ?

I recall we discussed choices with the other Damien, and that there were constraints due to listings.sty, but I think that's possible. I'd have to have a look at the code, though, because it's very well possible that we decided on a workaround instead.

Can you catch me on Slack sometime this week, or open an issue on https://github.com/cdlm/sbabook if not?

Ok, thanks.

 



--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet


 

Reply | Threaded
Open this post in threaded view
|

Re: pillar latex and code listings

Damien Pollet
I finally remembered to have a quick look… there is one named and referenced script in the Pillar chapter in EnterprisePharo. Look for occurrences of "my script"

On 13 November 2016 at 22:53, Nicolai Hess <[hidden email]> wrote:


2016-11-13 22:16 GMT+01:00 Damien Pollet <[hidden email]>:
On 13 November 2016 at 16:23, Nicolai Hess <[hidden email]> wrote:
Hi Damien, I don't see how the layout from the EnterprisePharo could do labeled listings we could ref from the text. May it be that this is just not possible ?

I recall we discussed choices with the other Damien, and that there were constraints due to listings.sty, but I think that's possible. I'd have to have a look at the code, though, because it's very well possible that we decided on a workaround instead.

Can you catch me on Slack sometime this week, or open an issue on https://github.com/cdlm/sbabook if not?

Ok, thanks.

 



--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet


 




--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet
Reply | Threaded
Open this post in threaded view
|

Re: pillar latex and code listings

Nicolai Hess-3-2


2016-11-21 15:17 GMT+01:00 Damien Pollet <[hidden email]>:
I finally remembered to have a quick look… there is one named and referenced script in the Pillar chapter in EnterprisePharo. Look for occurrences of "my script"

Ok, thank you Damien.

What is the most "stable" :-) version of sbabook ?
PharoByExample uses sbabook @ b1ad4b4
EnterprisePharo uses sbabook @ bf4509f

nicolai
 

On 13 November 2016 at 22:53, Nicolai Hess <[hidden email]> wrote:


2016-11-13 22:16 GMT+01:00 Damien Pollet <[hidden email]>:
On 13 November 2016 at 16:23, Nicolai Hess <[hidden email]> wrote:
Hi Damien, I don't see how the layout from the EnterprisePharo could do labeled listings we could ref from the text. May it be that this is just not possible ?

I recall we discussed choices with the other Damien, and that there were constraints due to listings.sty, but I think that's possible. I'd have to have a look at the code, though, because it's very well possible that we decided on a workaround instead.

Can you catch me on Slack sometime this week, or open an issue on https://github.com/cdlm/sbabook if not?

Ok, thanks.

 



--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet


 




--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet

Reply | Threaded
Open this post in threaded view
|

Re: pillar latex and code listings

Damien Pollet
EnterprisePharo is on master and there have been few LaTeX-level changes recently. The parent commit of master dates from april when we migrated a few books, and the recent commit was documentation.

I think at a minimum you'll have to use a different latex exporter in the pillar.conf (check EnterprisePharo for that) to output the sbabook-specific environments and macros, but if there are problems beyond that it's a matter of how the main file and the templates are combined. At this point my recommendation would be to migrate to the makefile-centric build of EnterprisePharo. I've just tried to build PBE but the VM that ./download.sh gets crashes…




On 27 November 2016 at 12:32, Nicolai Hess <[hidden email]> wrote:


2016-11-21 15:17 GMT+01:00 Damien Pollet <[hidden email]>:
I finally remembered to have a quick look… there is one named and referenced script in the Pillar chapter in EnterprisePharo. Look for occurrences of "my script"

Ok, thank you Damien.

What is the most "stable" :-) version of sbabook ?
PharoByExample uses sbabook @ b1ad4b4
EnterprisePharo uses sbabook @ bf4509f

nicolai
 

On 13 November 2016 at 22:53, Nicolai Hess <[hidden email]> wrote:


2016-11-13 22:16 GMT+01:00 Damien Pollet <[hidden email]>:
On 13 November 2016 at 16:23, Nicolai Hess <[hidden email]> wrote:
Hi Damien, I don't see how the layout from the EnterprisePharo could do labeled listings we could ref from the text. May it be that this is just not possible ?

I recall we discussed choices with the other Damien, and that there were constraints due to listings.sty, but I think that's possible. I'd have to have a look at the code, though, because it's very well possible that we decided on a workaround instead.

Can you catch me on Slack sometime this week, or open an issue on https://github.com/cdlm/sbabook if not?

Ok, thanks.

 



--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet


 




--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet




--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet