Class: SiSU_TeX_Pdf::FormatHead

Inherits:
Object
  • Object
show all
Defined in:
lib/sisu/texpdf_format.rb

Instance Method Summary collapse

Constructor Details

#initialize(md, t_o) ⇒ FormatHead

Returns a new instance of FormatHead.



745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
# File 'lib/sisu/texpdf_format.rb', line 745

def initialize(md,t_o)
  @md,@t_o=md,t_o
  @env=SiSU_Env::InfoEnv.new(@md.fns)
  if t_o.is_a?(Hash)
    @txt =t_o[:txt]            || nil
    @subtitle=t_o[:subtitle]   || nil
    @ps=t_o[:paper_size]       || nil
    @ocn=t_o[:ocn]             || nil
    @layout=t_o[:orientation]  || nil
  else
    p t_o.class
    p caller
  end
  @tx=SiSU_Env::GetInit.new.tex
  @tex2pdf=@@tex3pdf ||=SiSU_Env::SystemCall.new.tex2pdf_engine
  @ps=@txt if @txt=~/(?:a4|letter|legal|book|a5|b5)/i
  @lang ||=SiSU_i18n::Languages.new #.list[@md.opt.lng][:xlp]
  @author=if defined? @md.creator.author \
  and @md.creator.author=~/\S+/
    SiSU_TeX_Pdf::SpecialCharacters.new(@md,@md.creator.author).special_characters_safe
  else ''
  end
  @subject=if defined? @md.classify.subject \
  and @md.classify.subject=~/\S+/
    SiSU_TeX_Pdf::SpecialCharacters.new(@md,@md.classify.subject).special_characters_safe
  else ''
  end
  @keywords=if defined? @md.classify.keywords \
  and @md.classify.keywords=~/\S+/
    SiSU_TeX_Pdf::SpecialCharacters.new(@md,@md.classify.keywords).special_characters_safe
  else ''
  end
end

Instance Method Details

#a4genericObject



1230
1231
# File 'lib/sisu/texpdf_format.rb', line 1230

def a4generic
end

#document_head_with_orientation(codeblock_box_type) ⇒ Object



1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
# File 'lib/sisu/texpdf_format.rb', line 1148

def document_head_with_orientation(codeblock_box_type)
  endnotes=("\\usepackage{endnotes}" if @txt =~/endnotes?/) || '' #not implemented see also def endnotes
  @lang.list[@md.i18n[0]][:xlp]
  <<-WOK
#{tex_head_paper}
#{tex_head_encode}
#{tex_head_pdftex}
#{tex_head_misc}
#{tex_head_codeblock(codeblock_box_type)}
\\setcounter{secnumdepth}{2}
\\setcounter{tocdepth}{4}
\\makeatletter
#{endnotes}
\\usepackage[multiple,ragged]{footmisc}
\\setlength\\footnotemargin{12pt}
\\usepackage[para]{manyfoot}
\\DeclareNewFootnote{A}
%\\DeclareNewFootnote[para]{A}
\\newenvironment{ParagraphIndent}[1]%
{
\\begin{list}{}{%
\\setlength\\topsep{0pt}%
\\addtolength{\\leftmargin}{#1}
\\setlength\\parsep{0pt plus 1pt}%
}
\\item[]
}
{\\end{list}}

\\newenvironment{ParagraphHang}[2]%
{
\\begin{list}{}{%
\\setlength\\topsep{0pt}%
\\addtolength{\\leftmargin}{#1}
\\itemindent=#2
\\setlength\\parsep{0pt plus 1pt}%
}
\\item[]
}
{\\end{list}}

\\newenvironment{Bullet}[1]%
{
\\begin{list}{}{%
\\setlength\\topsep{0pt}%
\\addtolength{\\leftmargin}{#1}
\\itemindent=-1em
\\setlength\\parsep{0pt plus 1pt}%
}
\\item[]
}
{\\end{list}}
\\usepackage{fancyhdr}
\\lhead{}
\\renewcommand{\\part}{\\\@startsection
  {part}{1}{-2mm}%
  {-\\baselineskip}{0.5\\baselineskip}%
  {\\bfseries\\large\\upshape\\raggedright}}
\\renewcommand{\\section}{\\\@startsection
  {section}{2}{-2mm}%
  {-\\baselineskip}{0.5\\baselineskip}%
  {\\bfseries\\large\\upshape\\raggedright}}
\\renewcommand{\\subsection}{\\\@startsection
  {subsection}{3}{-2mm}%
  {-\\baselineskip}{0.5\\baselineskip}%
  {\\bfseries\\large\\upshape\\raggedright}}
\\renewcommand{\\subsubsection}{\\\@startsection
  {subsubsection}{4}{-2mm}%
  {-\\baselineskip}{0.5\\baselineskip}%
  {\\normalfont\\normalsize\\bfseries\\raggedright}}
\\renewcommand{\\paragraph}{\\\@startsection
  {paragraph}{5}{-2mm}%
  {-\\baselineskip}{0.5\\baselineskip}%
  {\\normalfont\\normalsize\\itshape\\raggedright}}
\\renewcommand{\\subparagraph}{\\\@startsection
  {subparagraph}%{6}%{-2mm}%
  {-\\baselineskip}{0.5\\baselineskip}%
  {\\normalfont\\normalsize\\itshape\\raggedright}}
% \\makeatother
\\selectlanguage{#{@lang.list[@md.i18n[0]][:xlp]}}
  WOK
end

Returns:

  • (Boolean)


1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
# File 'lib/sisu/texpdf_format.rb', line 1048

def hyperlinks_color?
  case @layout
  when :portrait  then hyperlinks_monochrome
    if @env.texpdf_hyperlinks(@md.opt.act[:pdf_hyperlink_colors]).portrait != :na
      case @env.texpdf_hyperlinks(@md.opt.act[:pdf_hyperlink_colors]).portrait
      when :color then hyperlinks_colored
      when :mono  then hyperlinks_monochrome
      else p __LINE__.to_s + ':error'
      end
    else               hyperlinks_monochrome
    end
  when :landscape
    if @env.texpdf_hyperlinks(@md.opt.act[:pdf_hyperlink_colors]).landscape != :na
      case @env.texpdf_hyperlinks(@md.opt.act[:pdf_hyperlink_colors]).landscape
      when :color then hyperlinks_colored
      when :mono  then hyperlinks_monochrome
      else p __LINE__.to_s + ':error'
      end
    else               hyperlinks_colored
    end
  end
end


1040
1041
1042
1043
1044
1045
1046
1047
# File 'lib/sisu/texpdf_format.rb', line 1040

def hyperlinks_colored
  <<-WOK
  colorlinks=true,
  urlcolor=myblue,    % \\href{...}{...}   external url
  filecolor=mygreen,  % \\href{...}        local file
  linkcolor=myred,    % \\href{...} and \\pageref{...}
  WOK
end


1032
1033
1034
1035
1036
1037
1038
1039
# File 'lib/sisu/texpdf_format.rb', line 1032

def hyperlinks_monochrome
  <<-WOK
  colorlinks=true,
  urlcolor=myblack,
  filecolor=myblack,
  linkcolor=myblack,
  WOK
end

#tex_head_codeblock(codeblock_box_type) ⇒ Object



1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
# File 'lib/sisu/texpdf_format.rb', line 1118

def tex_head_codeblock(codeblock_box_type)
  codeblock_box=if codeblock_box_type=='listings'
    <<-WOK
\\usepackage{listings}
\\usepackage{color}
\\usepackage{textcomp}
    WOK
  elsif codeblock_box_type=='boites'
    "\\usepackage{boites}"
  else
    "\\usepackage{boites}"
  end
  codeblock_box
end

#tex_head_encodeObject



797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
# File 'lib/sisu/texpdf_format.rb', line 797

def tex_head_encode
  texpdf_fontface=if defined? @md.make.texpdf_fontface.main \
  and not @md.make.texpdf_fontface.main.nil? \
  and @md.make.texpdf_fontface.main=~/\S{3,}/
    @md.make.texpdf_fontface.main
  else @env.font.texpdf.main
  end
  texpdf_fontface_sans=if defined? @md.make.texpdf_fontface.sans \
  and not @md.make.texpdf_fontface.sans.nil? \
  and @md.make.texpdf_fontface.sans=~/\S{3,}/                                  # not used
    @md.make.texpdf_fontface.sans
  else @env.font.texpdf.sans
  end
  texpdf_fontface_serif=if defined? @md.make.texpdf_fontface.serif \
  and not @md.make.texpdf_fontface.serif.nil? \
  and @md.make.texpdf_fontface.serif=~/\S{3,}/                                 # not used
    @md.make.texpdf_fontface.serif
  else @env.font.texpdf.serif
  end
  texpdf_fontface_mono=if defined? @md.make.texpdf_fontface.mono \
  and not @md.make.texpdf_fontface.mono.nil? \
  and @md.make.texpdf_fontface.mono=~/\S{3,}/
    @md.make.texpdf_fontface.mono
  else @env.font.texpdf.mono
  end
  texpdf_fontface_cjk=if @md.opt.lng =~/zh/ \
  and defined? @md.make.texpdf_fontface.cjk_zh \
  and not @md.make.texpdf_fontface.cjk_zh.nil? \
  and @md.make.texpdf_fontface.cjk_zh=~/\S{3,}/
    @md.make.texpdf_fontface.cjk_zh
  elsif @md.opt.lng =~/ja/ \
  and defined? @md.make.texpdf_fontface.cjk_ja \
  and not @md.make.texpdf_fontface.cjk_ja.nil? \
  and @md.make.texpdf_fontface.cjk_ja=~/\S{3,}/
    @md.make.texpdf_fontface.cjk_ja
  elsif @md.opt.lng =~/ko/ \
  and defined? @md.make.texpdf_fontface.cjk_ko \
  and not @md.make.texpdf_fontface.cjk_ko.nil? \
  and @md.make.texpdf_fontface.cjk_ko=~/\S{3,}/
    @md.make.texpdf_fontface.cjk_ko
  elsif @md.opt.lng =~/(?:zh|ja|ko)/ \
  and defined? @md.make.texpdf_fontface.cjk \
  and not @md.make.texpdf_fontface.cjk.nil? \
  and @md.make.texpdf_fontface.cjk=~/\S{3,}/
    @md.make.texpdf_fontface.cjk
  else
    case @md.opt.lng
    when /zh/ then @env.font.texpdf.cjk_zh
    when /ja/ then @env.font.texpdf.cjk_ja
    when /ko/ then @env.font.texpdf.cjk_ko
    else @env.font.texpdf.cjk
    end
  end
  # you may wish to check selected font against available fonts:
  # fc-list :outline -f "%{family}\n"
  # fc-list :lang=ja
  case @tex2pdf
  when /xe/
    if @md.opt.lng =~/(?:zh|ja|ko)/
      <<-WOK
\\usepackage{ucs, fontspec, xltxtra, xunicode, xeCJK}
\\setmainCJKlanguage{#{tex_head_lang[:mainlang]}}
\\setCJKmainfont{#{texpdf_fontface_cjk}}
\\XeTeXlinebreaklocale "#{tex_head_lang[:mainlang]}"
\\XeTeXlinebreakskip = 0pt plus 1pt
\\setotherlanguage{#{tex_head_lang[:otherlang]}}
\\setmainfont{#{texpdf_fontface}}
\\setmonofont[Scale=0.85]{#{texpdf_fontface_mono}}
      WOK
    else
      <<-WOK
\\usepackage{polyglossia, ucs, fontspec, xltxtra, xunicode}
\\setmainlanguage{#{tex_head_lang[:mainlang]}}
\\setotherlanguage{#{tex_head_lang[:otherlang]}}
\\setmainfont{#{texpdf_fontface}}
\\setmonofont[Scale=0.85]{#{texpdf_fontface_mono}}
% \\setsansfont{#{texpdf_fontface_sans}}
% \\setromanfont{#{texpdf_fontface_serif}}
      WOK
    end
  when /pdf/
    if @md.file_encoding =~ /iso-?8859/i                                   #% iso8859
      <<-WOK
% \\usepackage[latin1]{inputenc}
\\usepackage{fontspec}
      WOK
    else                                                                   #% utf-8 assumed
    <<-WOK
\\usepackage{babel}
\\usepackage{ucs}
\\usepackage[utf8x]{inputenc}
      WOK
    end
  end
end

#tex_head_infoObject



892
893
894
895
896
897
898
899
900
901
902
903
904
# File 'lib/sisu/texpdf_format.rb', line 892

def tex_head_info
  generator="Generated by: #{@md.project_details.project} #{@md.project_details.version} of #{@md.project_details.date_stamp} (#{@md.project_details.date})" if @md.project_details.version
  lastdone="Last Generated on: #{Time.now}"
  rubyv="Ruby version: #{@md.ruby_version}"
  <<-WOK
%% SiSU (Linux & Ruby - \"better ways\") LaTeX output
%% #{generator}
%% #{rubyv}
%% LaTeX output
%% #{lastdone}
%% SiSU http://www.jus.uio.no/sisu
  WOK
end

#tex_head_langObject

babel 18n



778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
# File 'lib/sisu/texpdf_format.rb', line 778

def tex_head_lang #babel 18n
  lang_char_arr=@md.i18n
  mainlang_char=if @md.i18n == Array \
  and @md.i18n.length > 0
    lang_char_arr.slice(0)
  else @md.opt.lng
  end
  mainlang=@lang.list[mainlang_char][:xlp]
  otherlang=if mainlang != 'english'
    [ @lang.list['en'][:xlp] ]
  else []
  end
  if lang_char_arr.length > 0
    lang_char_arr.slice(1..9).each { |ch| otherlang << @lang.list[ch][:xlp] }
    otherlang=otherlang.uniq
  end
  otherlang=otherlang.join(',')
  { mainlang: mainlang, otherlang: otherlang }
end

#tex_head_miscObject



1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
# File 'lib/sisu/texpdf_format.rb', line 1132

def tex_head_misc
  <<-WOK
\\usepackage{textcomp}
\\usepackage[parfill]{parskip}
\\usepackage[normalem]{ulem}
\\usepackage{soul}
\\usepackage{longtable}
\\usepackage[tc]{titlepic}
\\usepackage{graphicx}
\\makeatletter
\\parindent0pt
%\\usepackage{mathptmx}
\\usepackage{amssymb}
% amssymb used for backslash
  WOK
end

#tex_head_paperObject



1024
1025
1026
1027
1028
1029
1030
1031
# File 'lib/sisu/texpdf_format.rb', line 1024

def tex_head_paper
  case @layout
  when :portrait
    tex_head_paper_portrait(tex_head_paper_dimensions)
  when :landscape
    tex_head_paper_landscape(tex_head_paper_dimensions)
  end
end

#tex_head_paper_dimensionsObject



944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
# File 'lib/sisu/texpdf_format.rb', line 944

def tex_head_paper_dimensions
  d={}
  fontsize_set=if defined? @env.font.texpdf.size(@md.opt.act[:pdf_font_size]) \
  and not @env.font.texpdf.size(@md.opt.act[:pdf_font_size]).nil?
    @env.font.texpdf.size(@md.opt.act[:pdf_font_size])
  else :na
  end
  case @layout
  when :portrait
    fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt')
    d[:papertype],d[:fontsize]='a4paper',fontsize
    d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='0mm','0mm','-12pt'
    d[:headheight],d[:headsep],d[:columnsep]='12pt','35pt',''
    d[:marginparsep],d[:marginparwidth]='4mm','8mm'
    case @ps #@md.papersize
    when /a4/i           #European default, SiSU default
      fontsize=(fontsize_set==:na) ? '12pt' : (fontsize_set + 'pt')
      d[:papertype],d[:fontsize]='a4paper',fontsize
      d[:textheight],d[:textwidth]=@tx.a4.portrait.h,@tx.a4.portrait.w
    when /letter/i   #U.S. default
      fontsize=(fontsize_set==:na) ? '12pt' : (fontsize_set + 'pt')
      d[:papertype],d[:fontsize]='letterpaper',fontsize
      d[:textheight],d[:textwidth]=@tx.letter.portrait.h,@tx.letter.portrait.w
    when /legal/i     #U.S. alternative
      fontsize=(fontsize_set==:na) ? '12pt' : (fontsize_set + 'pt')
      d[:papertype],d[:fontsize]='legalpaper',fontsize
      d[:textheight],d[:textwidth]=@tx.legal.portrait.h,@tx.legal.portrait.w
    when /book|b5/i   #book default - larger
      fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt')
      d[:papertype],d[:fontsize]='b5paper',fontsize
      d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='-4mm','-4mm','-36pt'
      d[:headheight],d[:headsep],d[:columnsep]='12pt','20pt',''
      d[:textheight],d[:textwidth]=@tx.b5.portrait.h,@tx.b5.portrait.w
    when /a5/i
      fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt')
      d[:papertype],d[:fontsize]='a5paper',fontsize
      d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='-4mm','-4mm','-36pt'
      d[:headheight],d[:headsep],d[:columnsep]='11pt','12pt',''
      d[:marginparsep],d[:marginparwidth]='4mm','6mm'
      d[:textheight],d[:textwidth]=@tx.a5.portrait.h,@tx.a5.portrait.w
    else           #default currently A4
      fontsize=(fontsize_set==:na) ? '12pt' : (fontsize_set + 'pt')
      d[:papertype],d[:fontsize]='a4paper',fontsize
      d[:textheight],d[:textwidth]=@tx.a4.portrait.h,@tx.a4.portrait.w
    end
  when :landscape
    fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt')
    d[:papertype],d[:fontsize]='a4paper',fontsize
    d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='6mm','6mm','-12mm'
    d[:headheight],d[:headsep],d[:columnsep]='12pt','20pt','40pt'
    d[:marginparsep],d[:marginparwidth]='4mm','8mm'
    case @ps #@md.papersize
    when /a4/i                            #European default, SiSU default
      fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt')
      d[:papertype],d[:fontsize]='a4paper',fontsize
      d[:textheight],d[:textwidth]=@tx.a4.landscape.h,@tx.a4.landscape.w
    when /letter/i                    #U.S. default
      fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt')
      d[:papertype],d[:fontsize]='letterpaper',fontsize
      d[:textheight],d[:textwidth]=@tx.letter.landscape.h,@tx.letter.landscape.w
    when /legal/i #U.S. alternative
      fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt')
      d[:papertype],d[:fontsize],d[:columnsep]='legalpaper',fontsize,'48pt'
      d[:textheight],d[:textwidth]=@tx.legal.landscape.h,@tx.legal.landscape.w
    when /book|b5/i       #book default - larger
      fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt')
      d[:papertype],d[:fontsize],d[:columnsep]='b5paper',fontsize,'35pt'
      d[:textheight],d[:textwidth]=@tx.b5.landscape.h,@tx.b5.landscape.w
    when /a5/i
      fontsize=(fontsize_set==:na) ? '10pt' : (fontsize_set + 'pt')
      d[:papertype],d[:fontsize],d[:columnsep]='a5paper',fontsize,'32pt'
      d[:textheight],d[:textwidth]=@tx.a5.landscape.h,@tx.a5.landscape.w
    else                            #default currently A4
      fontsize=(fontsize_set==:na) ? '12pt' : (fontsize_set + 'pt')
      d[:papertype],d[:fontsize]='a4paper',fontsize
      d[:textheight],d[:textwidth]=@tx.a4.landscape.h,@tx.a4.landscape.w
    end
  end
  d
end

#tex_head_paper_landscape(d) ⇒ Object



919
920
921
922
923
924
925
926
927
928
929
930
931
# File 'lib/sisu/texpdf_format.rb', line 919

def tex_head_paper_landscape(d)
  <<-WOK
#{tex_head_info}
\\documentclass[#{d[:fontsize]},#{d[:papertype]},landscape,titlepage,twocolumn]{scrartcl}        %with titlepage
\\setlength{\\textheight}{#{d[:textheight]}mm} \\setlength{\\textwidth}{#{d[:textwidth]}mm}
\\setlength{\\oddsidemargin}{#{d[:oddsidemargin]}} \\setlength{\\evensidemargin}{#{d[:evensidemargin]}}
\\setlength{\\topmargin}{#{d[:topmargin]}} \\setlength{\\headheight}{#{d[:headheight]}}
\\setlength{\\headsep}{#{d[:headsep]}}
\\setlength{\\columnsep}{#{d[:columnsep]}}
\\setlength{\\marginparsep}{#{d[:marginparsep]}}
\\setlength{\\marginparwidth}{#{d[:marginparwidth]}}
  WOK
end

#tex_head_paper_portrait(d) ⇒ Object



905
906
907
908
909
910
911
912
913
914
915
916
917
918
# File 'lib/sisu/texpdf_format.rb', line 905

def tex_head_paper_portrait(d)
  multicol=(@md.book_idx ? '\usepackage{multicol}' : '')
  <<-WOK
#{tex_head_info}
\\documentclass[#{d[:fontsize]},#{d[:papertype]},titlepage]{scrartcl}        %with titlepage
\\setlength{\\textheight}{#{d[:textheight]}mm} \\setlength{\\textwidth}{#{d[:textwidth]}mm}
\\setlength{\\oddsidemargin}{#{d[:oddsidemargin]}} \\setlength{\\evensidemargin}{#{d[:evensidemargin]}}
\\setlength{\\topmargin}{#{d[:topmargin]}} \\setlength{\\headheight}{#{d[:headheight]}}
\\setlength{\\headsep}{#{d[:headsep]}}
\\setlength{\\marginparsep}{#{d[:marginparsep]}}
\\setlength{\\marginparwidth}{#{d[:marginparwidth]}}
#{multicol}
  WOK
end

#tex_head_paper_portrait_dvi(d) ⇒ Object



932
933
934
935
936
937
938
939
940
941
942
943
# File 'lib/sisu/texpdf_format.rb', line 932

def tex_head_paper_portrait_dvi(d)
  <<-WOK
#{tex_head_info}
\\documentclass[#{d[:fontsize]},#{d[:papertype]},titlepage]{scrartcl}      %with titlepage
\\setlength{\\textheight}{#{d[:textheight]}mm} \\setlength{\\textwidth}{#{d[:textwidth]}mm}
\\setlength{\\oddsidemargin}{#{d[:oddsidemargin]}} \\setlength{\\evensidemargin}{#{d[:evensidemargin]}}
\\setlength{\\topmargin}{#{d[:topmargin]}} \\setlength{\\headheight}{#{d[:headheight]}}
\\setlength{\\headsep}{#{d[:headsep]}}
\\setlength{\\marginparsep}{#{d[:marginparsep]}}
\\setlength{\\marginparwidth}{#{d[:marginparwidth]}}
  WOK
end

#tex_head_pdftexObject



1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
# File 'lib/sisu/texpdf_format.rb', line 1070

def tex_head_pdftex
  author=if defined? @md.creator.author \
  and @md.creator.author=~/\S+/
    SiSU_TeX_Pdf::SpecialCharacters.new(@md,@md.creator.author).special_characters_safe_no_urls
  else ''
  end
  <<-WOK
\\usepackage{alltt}
\\usepackage{thumbpdf}
\\usepackage[#{@tex2pdf},
  #{hyperlinks_color?.strip}
  pdftitle={#{@txt}},
  pdfauthor={#{author}},
  pdfsubject={#{@subject}},
  pdfkeywords={#{@keywords}},
  pageanchor=true,
  plainpages=true,
  pdfpagelabels=true,
  pagebackref,
  bookmarks=true,
  bookmarksopen=true,
  pdfmenubar=true,
  pdfpagemode=UseOutline,
  pdffitwindow=true,
  pdfwindowui=true,
  plainpages=false,
%  pdfusetitle=true,
%  pdfpagelayout=SinglePage,
%  pdfpagelayout=TwoColumnRight,
%  pdfpagelayout=TwoColumnLeft,
%  pdfstartpage=3,
  pdfstartview=FitH
]
{hyperref}
%% trace lost characters
% \\tracinglostchars = 1
% \\tracingonline = 1
\\usepackage[usenames]{color}
\\definecolor{myblack}{rgb}{0,0,0}
\\definecolor{myred}{rgb}{0.75,0,0}
\\definecolor{mygreen}{rgb}{0,0.5,0}
\\definecolor{myblue}{rgb}{0,0,0.5}
\\definecolor{mywhite}{rgb}{1,1,1}
\\usepackage{url}
\\urlstyle{sf}
%\\usepackage{breakurl}
    WOK
end