Menu

Examples

ColdThunder
Attachments
testtemptable.png (44591 bytes)
testtypetable.png (12343 bytes)

Example 1:

Source code: testtemp.f90

include 'latextable.f90'

program testtemp
use latextable
implicit none

integer(4)::array1(3,2)
real(4)::array2(3,2)
character(10)::array3(3,2)
complex(4)::array4(3,2)

integer(4)::i,j

do i=1,3
  do j=1,2
    array1(i,j)=i*j
    array2(i,j)=float(i*j)
    write(array3(i,j),'(i8.8)') i*j
    array4(i,j)=cmplx(float(i*j),0.)
  enddo
enddo

call latextabhead(6,'{ccc}')

call latextabhhline(6)
call latextabintblock(6,array1,'i4')
call latextabhline(6)
call latextabintrow(6,array1(:,1),'i4')

call latextabhhline(6)
call latextabrealblock(6,array2,'f6.3')
call latextabhline(6)
call latextabrealrow(6,array2(:,1),'f6.3')

call latextabhhline(6)
call latextabcharblock(6,array3,'a10')
call latextabhline(6)
call latextabcharrow(6,array3(:,1),'a10')

call latextabhhline(6)
call latextabcmplxblock(6,array4,'2f6.3')
call latextabhline(6)
call latextabcmplxrow(6,array4(:,1),'2f6.3')

call latextabhhline(6)
call latextabend(6)

endprogram testtemp

Screen Output:

\begin{table}
\begin{tabular}{ccc}
\hline\hline
   1 &   2 &   3 \\
   2 &   4 &   6 \\
\hline
   1 &   2 &   3 \\
\hline\hline
 1.000 & 2.000 & 3.000 \\
 2.000 & 4.000 & 6.000 \\
\hline
 1.000 & 2.000 & 3.000 \\
\hline\hline
00000001   & 00000002   & 00000003   \\
00000002   & 00000004   & 00000006   \\
\hline
00000001   & 00000002   & 00000003   \\
\hline\hline
 1.000 0.000 & 2.000 0.000 & 3.000 0.000 \\
 2.000 0.000 & 4.000 0.000 & 6.000 0.000 \\
\hline
 1.000 0.000 & 2.000 0.000 & 3.000 0.000 \\
\hline\hline
\end{tabular}
\caption{ }
\label{ }
\end{table}

In Latex:
testtemptable.png


Example 2:

Source code: testtype.f90

include 'latextable.f90'

program testtype
use latextable
implicit none

real(4)::array(3,2)
character(5)::titlearray(3)

type(latextabdata)::struct(3)
character(5)::typeform(3)
integer(4)::i,j

do i=1,3
  write(struct(i).data1,"('line',i1)") i
  typeform(1)='a10'
  struct(i).data2=i
  typeform(2)='i3'
  struct(i).data3=float(i)
  typeform(3)='f6.3'
enddo
titlearray(1)='char'
titlearray(2)=' int'
titlearray(3)='real'

call latextabhead(6,'{|c|c|c|}',1)
call latextabhline(6)
call latextabcharrow(6,titlearray,'a5')
call latextabhline(6)
call latextabtypeblock(6,struct,typeform)
call latextabhline(6)
call latextabtyperow(6,struct(1),typeform)
call latextabhline(6)
call latextabend(6,1)

endprogram testtype

Screen Output:

\begin{table*}
\begin{tabular}{|c|c|c|}
\hline
char  &  int  & real  \\
\hline
line1      &   1 &  1.000 \\
line2      &   2 &  2.000 \\
line3      &   3 &  3.000 \\
\hline
line1      &   1 &  1.000 \\
\hline
\end{tabular}
\caption{ }
\label{ }
\end{table*}

In Latex:
testtypetable.png


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.