Re: Pacchetto Macchine di Turing Vs Hyperref

#64340
Up
0
Down
::


Di seguito riporto la e-mail che, come suggerito saggiamente da Egreg,ho scritto all’autore del pacchetto. Sarò felice di riportare anche la sua eventuale risposta. (Spero che il mio inglese non faccia troppa pena).

Hello, I downloaded your turing.sty package for LaTeX.
I had need to use it in a document with hyperref and listings packages included and I noticed that there was some problems:
1-with hyperref package your package didn’t work;
2-with listings there was an added blank line at the beginning of the printed code and, from the second, all the others were indented at right
3-the squared code (using listings-frame) was fragmented at every (vertical) line.

I wrote on the forum of GuIT (http://www.guitex.org/home/), the italian group of LaTeX users, searching a solution and Egreg solve all the problems!

The changes consist in this:
-Added prefix `tm@` at macros "private"
-removed blank lines where there should be;
-putted % where it could be added a spurious space;
– changed the routine of press: the end of the paragraph not before but after.

in this manner, with the code I report under, it work at all.

I searched for a package like this and in my (and Egreg too) opinion your package is very useful package, and we suggest you to make it public (a correct version) on CTAN.

In any case I thank you very much.

With regards.

Corrado Lanera.

In attachment your (corrected) turing.sty

Part of my code:

`%***************
\newtm(1,0,1,1,0,1,0,1,\#,1,0,1,1,0,1)
\turingrules{%
(next,0,next,0,R),%
(next,1,next,1,R),%
(next,0',next,0',R),%
(next,1',next,1',R),%
(next,\#,next,\#,R),%
(next,-,check,-,L),%
%
(check,0,prepadd0,-,L),%
(check,1,prepadd1,-,L),%
(check,\#,cleanup,-,L),%
%
(prepadd0,0,prepadd0,0,L),%
(prepadd0,1,prepadd0,1,L),%
(prepadd0,\#,add0,\#,L),%
(add0,0',add0,0',L),%
(add0,1',add0,1',L),%
(add0,-,next,0',R),%
(add0,0,next,0',R),%
(add0,1,next,1',R),%
%
(prepadd1,0,prepadd1,0,L),%
(prepadd1,1,prepadd1,1,L),%
(prepadd1,\#,add1,\#,L),%
(add1,0',add1,0',L),%
(add1,1',add1,1',L),%
(add1,0,next,1',R),%
(add1,1,propadd1,0',L),%
(add1,-,next,1',R),%
(propadd1,0,next,1,R),%
(propadd1,1,propadd1,0,L),%
(propadd1,-,next,1,R),%
%
(cleanup,0,cleanup,0,L),%
(cleanup,1,cleanup,1,L),%
(cleanup,0',cleanup,0,L),%
(cleanup,1',cleanup,1,L),%
(cleanup,-,stop,-,H)%
}

\begingroup\setlength{\parindent}{0pt}
\begin{lstlisting}[basicstyle=\footnotesize\linespread{1.4}\ttfamily,
frame=trBL,linewidth=\linewidth,caption={MdT somma},label={MdT:som}]
&!\showtm
\runtm!&
\end{lstlisting}
\endgroup
%****************`

Go to top