set fileContentList {
	{}
	{
		% This file is interpreted by tcl so each LaTeX back slash must be duplicated
		\\documentclass[brazilian,PublicacaoLivro,SemFormatacaoCapitulo,SemFolhaAprovacao]{http://urlib.net/iconet.com.br/banon/2008/03.25.01.19/tdiinpe}
		%\\documentclass[brazilian,PublicacaoLivro,SemFormatacaoCapitulo,SemFolhaAprovacaoo]{tdiinpe}
		%\\documentclass[brazilian,PublicacaoLivro,SemFormatacaoCapitulo,SemFolhaAprovacao]{../../../../../iconet.com.br/banon/2008/03.25.01.19/doc/tdiinpe}

		\\repositorio{$thisRepository} %% repositório onde está depositado o documento

		\\RequirePackage{comment}

		\\begin{comment}

		[[

			set siteList {
				marte.dpi.inpe.br:80
				mtc-m05.sid.inpe.br:80
				mtc-m16.sid.inpe.br:80
				{mtc-m15.sid.inpe.br 800}
				{mtc-m18.sid.inpe.br 800}
				{mtc-m19.sid.inpe.br 800}
				{md-m09.sid.inpe.br 800}
				mtc-m12.sid.inpe.br:80
				mtc-m17.sid.inpe.br:80
				{plutao.dpi.inpe.br 800}
				bibdigital.sid.inpe.br:80
			}

			proc CreateDataSet {args} {
				set i 0
				set data {}
				foreach input [[lindex $args 0]] {
					set line {}
					foreach list $args {
						lappend line [[lindex $list $i]]
					}
					lappend data $line
					incr i
				}
				return [[join $data \n]]
			}

# CreateSequence creates a list of bar group position along the x axis
			proc CreateSequence {numberOfItems firstSequenceItem increment} {
				set sequenceItem $firstSequenceItem
				for {set i 1} {$i <= $numberOfItems} {incr i} {
					lappend sequence $sequenceItem
					set sequenceItem [[expr $sequenceItem + $increment]]
				}
				return $sequence
			}

			proc ComputeAxisParameters {dxticks barWidth xnameList numberOfItemsList} {
				set firstSequenceItem [[expr 2 * $barWidth]]
				set xmax [[expr ([[llength $xnameList]] - 1) * $dxticks + 4 * $barWidth]]
				set maxValue [[expr round(1.1 * [[lindex [[lsort -integer $numberOfItemsList]] end]])]]	;# 58
				set factor [[expr pow(10, [[string length $maxValue]] - 1)]]	;# 10.0
				set numberOfUnits [[expr int(ceil($maxValue / $factor))]]	;# 6
				set maxTable(1) 1.2; set dticksTable(1) 0.2	;# maxValue == 1
				set maxTable(2) 3; set dticksTable(2) 0.5
				set maxTable(3) 3; set dticksTable(3) 0.5
				set maxTable(4) 4; set dticksTable(4) 1
				set maxTable(5) 5; set dticksTable(5) 1
				set maxTable(6) 6; set dticksTable(6) 1
				set maxTable(7) 8; set dticksTable(7) 2
				set maxTable(8) 8; set dticksTable(8) 2
				set maxTable(9) 10; set dticksTable(9) 2
				set maxTable(10) 12; set dticksTable(10) 2

				set ymax [[expr int($maxTable($numberOfUnits) * $factor)]]	;# 60
				set dyticks [[expr int($dticksTable($numberOfUnits) * $factor)]]	;# 10
				return [[list $firstSequenceItem $xmax $ymax $dyticks]]
			}

			set publicationYearList1 {1994 1995 1996 1997 1998 1999 2000 2001}
			set publicationYearList2 {2002 2003 2004 2005 2006 2007 2008 2009}

			set totalNumberOfSearches 0

### figureToBeUpdatedList ###
 			set figureToBeUpdatedList {year_numberOfPublications1 year_numberOfPublications2}
# 			set figureToBeUpdatedList {year_numberOfPublications2}
			set figureToBeUpdatedList {}

			set hei 0.2
# 			set dxticks 1.2 ;# 9 bars
			set dxticks 1.08	;# 10 bars
			set barWidth 0.40

			set barRed1 130; set barGreen1 130; set barBlue1 230
			set barRed2 30; set barGreen2 30; set barBlue2 130

		]]

		\\end{comment}

		\\input{./preamble} %% faça as modificações pertinentes no arquivo configuracao.tex

		\\begin{document}

		\\input{./document}

		\\vspace{-4mm}
		\\begin{flushleft}
		\\renewcommand{\\baselinestretch}{0.9}
		\\footnotesize
		\\href{http://$localSite/update/$thisRepository?languagebutton=pt-BR}{Atualize este relatório}\\\\
		(última data de atualização: [[clock format [[clock seconds]] -format "%d/%m/%Y às %H:%M"]]).
		\\end{flushleft}

		\\end{document}
	}

	[[
		set dynamicList {}

# Figure year_numberOfPublications1
		if {[[lsearch $figureToBeUpdatedList year_numberOfPublications1]] != -1} {
			lappend dynamicList {year_numberOfPublications1.dat}
			lappend dynamicList \
			[[
				set totalNumberOfSearches [[expr $totalNumberOfSearches + [[llength $publicationYearList1]] * 2]]
				set numberOfRecordsPerPublicationYear 0
				set numberOfRecordsPerPublicationYear2 0
				set numberOfRecordsPerPublicationYearList {}
				set numberOfRecordsPerPublicationYearList2 {}
				foreach publicationYear $publicationYearList1 {
					set searchExpression "ref journal and ar met and y $publicationYear"
					set number [[DisplayNumberOfEntries2 $searchExpression]]
					lappend numberOfRecordsPerPublicationYearList $number
					incr numberOfRecordsPerPublicationYear $number
					set searchExpression "ref journal and ar met and y $publicationYear and {dis websci or dis scielo}"
					set number [[DisplayNumberOfEntries2 $searchExpression]]
					lappend numberOfRecordsPerPublicationYearList2 $number
					incr numberOfRecordsPerPublicationYear2 $number
				}
				foreach {firstSequenceItem xmax ymax dyticks} [[ComputeAxisParameters $dxticks $barWidth $publicationYearList1 $numberOfRecordsPerPublicationYearList]] {break}
				set graphymove 0.3
				set graphxsize 15.4
				set graphysize 5.8
				CreateDataSet [[CreateSequence [[llength $publicationYearList1]] $firstSequenceItem $dxticks]] $numberOfRecordsPerPublicationYearList $numberOfRecordsPerPublicationYearList2
			]]
			lappend dynamicList {year_numberOfPublications1.gle}
			lappend dynamicList \
			"
				! size 15.4 6.0	! size of the paper
				size $graphxsize [[expr $graphysize * 0.92 + $graphymove]]

				set font ss lwidth 0.01
				set alabeldist .8

				barRed1 = $barRed1
				barGreen1 = $barGreen1
				barBlue1 = $barBlue1
				barRed2 = $barRed2
				barGreen2 = $barGreen2
				barBlue2 = $barBlue2

				include \"./color.gle\"
				! include \"barstyles.gle\"
				include \"./library.gle\"

				amove 0 $graphymove
				begin graph
				size $graphxsize $graphysize
				center
				data   \"year_numberOfPublications1.dat\"
				xtitle \"Anos de publica\\c{c}\\~ao\"
				ytitle \"N\\'umero de publica\\c{c}\\~oes\"
				xaxis min 0 max $xmax
				xnames $publicationYearList1
				xticks off
				! yaxis dticks $dyticks dsubticks $dyticks min 0 max $ymax
				yaxis dticks 50 dsubticks 50 min 0 max 150
				x2axis off
				y2axis off
				xlabels hei $hei
				ylabels hei $hei
				bar d1,d2 width $barWidth dist [[expr $barWidth + 0.04]] style colormap1,colormap2
				end graph

				begin key
				justify bc
				absolute (pagewidth()/2) 0
				hei $hei
				nobox
				boxcolor clear
				fill rgb255($barRed1,$barGreen1,$barBlue1) text \"Publica\\c{c}\\~ao em revista - Total: $numberOfRecordsPerPublicationYear\"
				fill rgb255($barRed2,$barGreen2,$barBlue2) text \"Publica\\c{c}\\~ao em revista indexada - Total: $numberOfRecordsPerPublicationYear2\"
				end key
			"
		}

# Figure year_numberOfPublications2
		if {[[lsearch $figureToBeUpdatedList year_numberOfPublications2]] != -1} {
			lappend dynamicList {year_numberOfPublications2.dat}
			lappend dynamicList \
			[[
				set totalNumberOfSearches [[expr $totalNumberOfSearches + [[llength $publicationYearList2]] * 2]]
				set numberOfRecordsPerPublicationYear 0
				set numberOfRecordsPerPublicationYear2 0
				set numberOfRecordsPerPublicationYearList {}
				set numberOfRecordsPerPublicationYearList2 {}
				foreach publicationYear $publicationYearList2 {
					set searchExpression "ref journal and ar met and y $publicationYear"
					set number [[DisplayNumberOfEntries2 $searchExpression]]
					lappend numberOfRecordsPerPublicationYearList $number
					incr numberOfRecordsPerPublicationYear $number
					set searchExpression "ref journal and ar met and y $publicationYear and {dis websci or dis scielo}"
					set number [[DisplayNumberOfEntries2 $searchExpression]]
					lappend numberOfRecordsPerPublicationYearList2 $number
					incr numberOfRecordsPerPublicationYear2 $number
				}
				foreach {firstSequenceItem xmax ymax dyticks} [[ComputeAxisParameters $dxticks $barWidth $publicationYearList2 $numberOfRecordsPerPublicationYearList]] {break}
				set graphymove 0.3
				set graphxsize 15.4
				set graphysize 5.8
				CreateDataSet [[CreateSequence [[llength $publicationYearList2]] $firstSequenceItem $dxticks]] $numberOfRecordsPerPublicationYearList $numberOfRecordsPerPublicationYearList2
			]]
			lappend dynamicList {year_numberOfPublications2.gle}
			lappend dynamicList \
			"
				! size 15.4 6.0	! size of the paper
				size $graphxsize [[expr $graphysize * 0.92 + $graphymove]]

				set font ss lwidth 0.01
				set alabeldist .8

				barRed1 = $barRed1
				barGreen1 = $barGreen1
				barBlue1 = $barBlue1
				barRed2 = $barRed2
				barGreen2 = $barGreen2
				barBlue2 = $barBlue2

				include \"./color.gle\"
				! include \"barstyles.gle\"
				include \"./library.gle\"

				amove 0 $graphymove
				begin graph
				size $graphxsize $graphysize
				center
				data   \"year_numberOfPublications2.dat\"
				xtitle \"Anos de publica\\c{c}\\~ao\"
				ytitle \"N\\'umero de publica\\c{c}\\~oes\"
				xaxis min 0 max $xmax
				xnames $publicationYearList2
				xticks off
				! yaxis dticks $dyticks dsubticks $dyticks min 0 max $ymax
				yaxis dticks 50 dsubticks 50 min 0 max 150
				x2axis off
				y2axis off
				xlabels hei $hei
				ylabels hei $hei
				bar d1,d2 width $barWidth dist [[expr $barWidth + 0.04]] style colormap1,colormap2
				end graph

				begin key
				justify bc
				absolute (pagewidth()/2) 0
				hei $hei
				nobox
				boxcolor clear
				fill rgb255($barRed1,$barGreen1,$barBlue1) text \"Publica\\c{c}\\~ao em revista - Total: $numberOfRecordsPerPublicationYear\"
				fill rgb255($barRed2,$barGreen2,$barBlue2) text \"Publica\\c{c}\\~ao em revista indexada - Total: $numberOfRecordsPerPublicationYear2\"
				end key
			"
		}

		set dynamicList
	]]
}
