Commit a8386f13b1328a84a4bb906f656c0981a764755c

Authored by Paulo Meireles
0 parents

versao inicial da instalacao do LabSEI

.gitignore 0 → 100644
  1 +++ a/.gitignore
... ... @@ -0,0 +1,18 @@
  1 +*.*~
  2 +*.swp
  3 +*.swo
  4 +*.swn
  5 +*.pdf
  6 +*.log
  7 +*.ps
  8 +*.dvi
  9 +*.aux
  10 +*.blg
  11 +*.toc
  12 +*.brf
  13 +*.ilg
  14 +*.ind
  15 +*.bbl
  16 +*.out
  17 +*.lof
  18 +*.lot
... ...
00-resumo.tex 0 → 100644
  1 +++ a/00-resumo.tex
... ... @@ -0,0 +1,4 @@
  1 +\subsection*{Resumo}
  2 +
  3 +Documento de intalação do Redmine e Gitlab integrados para compor o ambiente colaborativo para o desenvolvimento do projeto SEI (Sistema Eletrônico Informatizado) -- LabSEI.
  4 +
... ...
LabSEI.idx 0 → 100644
  1 +++ a/LabSEI.idx
... ...
LabSEI.tex 0 → 100644
  1 +++ a/LabSEI.tex
... ... @@ -0,0 +1,73 @@
  1 +\documentclass[preprint,11pt,oneside]{imsart}
  2 +\usepackage[T1]{fontenc}
  3 +\usepackage[portuguese,brazil]{babel}
  4 +\usepackage[utf8]{inputenc}
  5 +\usepackage[usenames,dvipsnames]{color}
  6 +\usepackage{url}
  7 +\usepackage{verbatim}
  8 +\usepackage{hyperref}
  9 +\usepackage{graphicx}
  10 +\usepackage{booktabs}
  11 +\usepackage{tabularx}
  12 +\usepackage[table]{xcolor}
  13 +\usepackage{enumerate}
  14 +\usepackage[section]{placeins}
  15 +\usepackage{varwidth}
  16 +\usepackage{verbatim}
  17 +
  18 +\setattribute{keyword}{tipo}{Tipo:}
  19 +
  20 +% ---------------------------------------------------------------------------- %
  21 +\topmargin -1.5cm % read Lamport p.163
  22 +\oddsidemargin -0.04cm % read Lamport p.163
  23 +\evensidemargin -0.04cm % same as oddsidemargin but for left-hand pages
  24 +\textwidth 16.59cm
  25 +\textheight 21.94cm
  26 +%\pagestyle{empty} % Uncomment if don't want page numbers
  27 +\parskip 7.2pt % sets spacing between paragraphs
  28 +\renewcommand{\baselinestretch}{1.5} % Uncomment for 1.5 spacing between lines
  29 +%\parindent 0pt % sets leading space for paragraphs
  30 +% ---------------------------------------------------------------------------- %
  31 +
  32 +\begin{document}
  33 +
  34 +\begin{frontmatter}
  35 +
  36 +\title{LabSEI}
  37 +\normalsize{\textbf{Ambiente Colaborativo para o Desenvolvimento do Projeto SEI}}
  38 +\vspace{2cm}
  39 +
  40 +\normalsize{\textbf{Documento de instalação do Redmine integrado ao Gitlab}}
  41 +\vspace{2cm}
  42 +
  43 +\begin{aug}
  44 +
  45 +\address{Universidade de Brasília}
  46 +\vspace{0.2cm}
  47 +
  48 +\address{LAPPIS\\
  49 + Laboratório Avançado de Produção, Pesquisa e Inovação em Software\\
  50 + Faculdade UnB Gama}
  51 +\vspace{0.2cm}
  52 +
  53 +\address{MídiaLab\\
  54 + Laboratório de Pesquisa em Arte Computacional\\
  55 + Instituto de Artes}
  56 +
  57 +\end{aug}
  58 +\vspace{0.5cm}
  59 +\end{frontmatter}
  60 +
  61 +% ---------------------------------------------------------------------------- %
  62 +
  63 +\newpage
  64 +\input 00-resumo
  65 +
  66 +
  67 +% ---------------------------------------------------------------------------- %
  68 +\newpage
  69 +\input installDoc/redmine-sei
  70 +\input installDoc/gitlab-sei
  71 +\input installDoc/gitlab_omnibus_issues_tracker_tutorial
  72 +
  73 +\end{document}
... ...
Makefile 0 → 100644
  1 +++ a/Makefile
... ... @@ -0,0 +1,36 @@
  1 +
  2 +BASE_NAME = LabSEI
  3 +
  4 +LATEX = latex
  5 +PDFLATEX = pdflatex
  6 +BIBTEX = bibtex
  7 +MAKEINDEX = makeindex
  8 +
  9 +SOURCES = $(BASE_NAME).tex
  10 +
  11 +all:
  12 + @make $(BASE_NAME).pdf
  13 + @make pdf
  14 +pdf: $(BASE_NAME).pdf
  15 + evince $(BASE_NAME).pdf &
  16 +ps: $(BASE_NAME).ps
  17 +
  18 +$(BASE_NAME).pdf: $(BASE_NAME).tex $(SOURCES)
  19 + $(PDFLATEX) $(BASE_NAME).tex
  20 + #$(BIBTEX) $(BASE_NAME)
  21 + $(MAKEINDEX) $(BASE_NAME)
  22 + $(PDFLATEX) $<
  23 + $(PDFLATEX) $<
  24 +
  25 +$(BASE_NAME).ps: $(BASE_NAME).tex
  26 + $(LATEX) $<
  27 + $(BIBTEX) $(BASE_NAME)
  28 + $(MAKEINDEX) $(BASE_NAME)
  29 + $(LATEX) $<
  30 + $(LATEX) $<
  31 +
  32 +clean:
  33 + rm -f $(BASE_NAME)*.ps $(BASE_NAME)*.dvi *.log \
  34 + *.aux *.blg *.toc *.brf *.ilg *.ind \
  35 + missfont.log $(BASE_NAME)*.bbl $(BASE_NAME)*.pdf $(BASE_NAME)*.out \
  36 + $(BASE_NAME)*.lof $(BASE_NAME)*.lot *.swp
... ...
README 0 → 100644
  1 +++ a/README
... ...
imsart.cls 0 → 100644
  1 +++ a/imsart.cls
... ... @@ -0,0 +1,183 @@
  1 +%% This is file `imsart.cls'
  2 +%%
  3 +%% LaTeX 2e class file for the processing of LaTeX2e files
  4 +%% of the following IMS/BS journals:
  5 +%%
  6 +%% The Annals of Probability
  7 +%% The Annals of Applied Probability
  8 +%% The Annals of Statistics
  9 +%% The Annals of Applied Statistics
  10 +%% Statistical Science
  11 +%% Probability Surveys
  12 +%% Statistics Surveys
  13 +%% Electronic Journal of Statistics
  14 +%% IMS Lecture Notes-Monograph Series
  15 +%% IMS Collections
  16 +%% Bernoulli
  17 +%% Annales de l'Institut Henri Poincar\'e - Probabilit\'es et Statistiques
  18 +%% Brazilian Journal of Probability and Statistics
  19 +%% Stochastic Systems
  20 +%%
  21 +%% Institute of Mathematical Statistics, U.S.A.
  22 +%% Bernoulli Society
  23 +%% Institut Henry Poincare
  24 +%% Brazilian Statistical Association
  25 +%%
  26 +%% Macros written by Vytas Statulevicius, VTeX, Lithuania
  27 +%% for Institute of Mathematical Statistics, U.S.A.
  28 +%% Please submit bugs or your comments to vytas@vtex.lt
  29 +%%
  30 +%% The original distribution is located at:
  31 +%% http://www.e-publications.org/ims/support
  32 +%%
  33 +%% This class file loads standart "article.cls" with appropriate
  34 +%% settings and then style file "imsart.sty" with additional macros
  35 +%%
  36 +%% You are free to use this style file as you see fit, provided
  37 +%% that you do not make changes to the file.
  38 +%% If you DO make changes, you are required to rename this file.
  39 +%%
  40 +%% It may be distributed under the terms of the LaTeX Project Public
  41 +%% License, as described in lppl.txt in the base LaTeX distribution.
  42 +%% Either version 1.0 or, at your option, any later version.
  43 +%%
  44 +%% \CharacterTable
  45 +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
  46 +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
  47 +%% Digits \0\1\2\3\4\5\6\7\8\9
  48 +%% Exclamation \! Double quote \" Hash (number) \#
  49 +%% Dollar \$ Percent \% Ampersand \&
  50 +%% Acute accent \' Left paren \( Right paren \)
  51 +%% Asterisk \* Plus \+ Comma \,
  52 +%% Minus \- Point \. Solidus \/
  53 +%% Colon \: Semicolon \; Less than \<
  54 +%% Equals \= Greater than \> Question mark \?
  55 +%% Commercial at \@ Left bracket \[ Backslash \\
  56 +%% Right bracket \] Circumflex \^ Underscore \_
  57 +%% Grave accent \` Left brace \{ Vertical bar \|
  58 +%% Right brace \} Tilde \~}
  59 +%%
  60 +%%
  61 +%% Bug fixes and changes: at end of file
  62 +
  63 +% TeX programming: Vytas Statulevicius, VTeX, Lithuania, vytas@vtex.lt
  64 +% Requires Latex2e, ver.2000.06
  65 +
  66 +
  67 +\NeedsTeXFormat{LaTeX2e}
  68 +\ProvidesClass{imsart}[2010/04/27 driver class for package imsart.sty]
  69 +
  70 +% layout options:
  71 +
  72 +\DeclareOption{imslayout}{%
  73 + \PassOptionsToClass{11pt,oneside,leqno}{article}
  74 + \PassOptionsToPackage{leqno}{amsmath}}
  75 +
  76 +\DeclareOption{stslayout}{%
  77 + \PassOptionsToClass{11pt,oneside,leqno}{article}
  78 + \PassOptionsToPackage{leqno}{amsmath}}
  79 +
  80 +
  81 +% set various options for different journals:
  82 +\DeclareOption{generic}{%
  83 + \PassOptionsToClass{10pt,oneside}{article}
  84 +}
  85 +
  86 +
  87 +\DeclareOption{ps}{%
  88 + \PassOptionsToClass{10pt,oneside}{article}
  89 +}
  90 +
  91 +\DeclareOption{ss}{%
  92 + \PassOptionsToClass{10pt,oneside}{article}
  93 +}
  94 +
  95 +\DeclareOption{ejs}{%
  96 + \PassOptionsToClass{10pt,oneside}{article}
  97 +}
  98 +
  99 +\DeclareOption{lnms}{
  100 + \PassOptionsToClass{10pt,twoside,leqno}{article}
  101 + \PassOptionsToPackage{leqno}{amsmath}
  102 +}
  103 +
  104 +\DeclareOption{coll}{
  105 + \PassOptionsToClass{10pt,twoside,leqno}{article}
  106 + \PassOptionsToPackage{leqno}{amsmath}
  107 +}
  108 +
  109 +
  110 +\DeclareOption{aap}{%
  111 + \PassOptionsToClass{11pt,oneside,leqno}{article}
  112 + \PassOptionsToPackage{leqno}{amsmath}
  113 +}
  114 +
  115 +\DeclareOption{aop}{%
  116 + \PassOptionsToClass{11pt,oneside,leqno}{article}
  117 + \PassOptionsToPackage{leqno}{amsmath}
  118 +}
  119 +
  120 +\DeclareOption{aos}{%
  121 + \PassOptionsToClass{11pt,oneside,leqno}{article}
  122 + \PassOptionsToPackage{leqno}{amsmath}
  123 +}
  124 +
  125 +\DeclareOption{aoas}{%
  126 + \PassOptionsToClass{11pt,oneside,leqno}{article}
  127 + \PassOptionsToPackage{leqno}{amsmath}
  128 +}
  129 +
  130 +
  131 +\DeclareOption{sts}{%
  132 + \PassOptionsToClass{11pt,oneside,leqno}{article}
  133 + \PassOptionsToPackage{leqno}{amsmath}
  134 +}
  135 +
  136 +\DeclareOption{bj}{%
  137 + \PassOptionsToClass{10pt,oneside}{article}
  138 +}
  139 +
  140 +\DeclareOption{aihp}{%
  141 + \PassOptionsToClass{10pt,oneside,fleqn}{article}
  142 + \PassOptionsToPackage{fleqn}{amsmath}
  143 + \PassOptionsToPackage{numbers,sort&compress}{natbib}
  144 +}
  145 +
  146 +
  147 +\DeclareOption{bjps}{
  148 + \PassOptionsToClass{11pt,twoside}{article}
  149 +}
  150 +
  151 +\DeclareOption{ssy}{%
  152 + \PassOptionsToClass{11pt,oneside,leqno}{article}
  153 + \PassOptionsToPackage{leqno}{amsmath}
  154 +}
  155 +
  156 +
  157 +\PassOptionsToPackage{psamsfonts}{amssymb}
  158 +\PassOptionsToPackage{cmex10}{amsmath}
  159 +
  160 +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
  161 +\ProcessOptions*
  162 +
  163 +\LoadClass{article}
  164 +
  165 +\IfFileExists{imsart.sty}{}{\ClassError{imsart}{The complimentary style file "imsart.sty" is required}{
  166 +The complimentary style file "imsart.sty" is required\MessageBreak
  167 +You need to install file "imsart.sty" in your system\MessageBreak
  168 +File could be downloaded from http://www.e-publications.org/ims/support
  169 +}}
  170 +
  171 +% Load additional macros and modifications for "article.cls"
  172 +\RequirePackage[generic]{imsart}
  173 +
  174 +\endinput
  175 +%%
  176 +%% History:
  177 +%% 2010.04.27 - support for the "Stochastic Systems" (ssy) added;
  178 +%% 2009.08.13 - options [numbers,sort&compress] from natbib package removed
  179 +%% 2009.05.21 - added new option "bjps"
  180 +%% 2008.01.09 - added new option "coll"
  181 +%% 2007.12.10 - added new option "aihp"
  182 +%% 2007.08.22 - aoas: default value for natbib set to authoryear
  183 +%% End of file `imsart.cls'.
... ...
imsart.sty 0 → 100644
  1 +++ a/imsart.sty
... ... @@ -0,0 +1,2936 @@
  1 +%% This is file `imsart.sty'
  2 +%%
  3 +%% LaTeX 2e style file for the processing of LaTeX2e files
  4 +%% of the following IMS/BS journals:
  5 +%%
  6 +%% The Annals of Probability
  7 +%% The Annals of Applied Probability
  8 +%% The Annals of Statistics
  9 +%% The Annals of Applied Statistics
  10 +%% Statistical Science
  11 +%% Probability Surveys
  12 +%% Statistics Surveys
  13 +%% Electronic Journal of Statistics
  14 +%% IMS Lecture Notes-Monograph Series
  15 +%% IMS Collections
  16 +%% Bernoulli
  17 +%% Annales de l'Institut Henri Poincar\'e - Probabilit\'es et Statistiques
  18 +%% Brazilian Journal of Probability and Statistics
  19 +%% Stochastic Systems
  20 +%%
  21 +%% Institute of Mathematical Statistics, U.S.A.
  22 +%% Bernoulli Society
  23 +%% Institut Henry Poincare
  24 +%% Brazilian Statistical Association
  25 +%%
  26 +%% Macros written by Vytas Statulevicius, VTeX, Lithuania
  27 +%% for Institute of Mathematical Statistics, U.S.A.
  28 +%% Please submit bugs or your comments to vytas@vtex.lt
  29 +%%
  30 +%% The original distribution is located at:
  31 +%% http://www.e-publications.org/ims/support
  32 +%%
  33 +%% This style file contains additional macros and is designed to use
  34 +%% with standart "article.cls"
  35 +%%
  36 +%% You are free to use this style file as you see fit, provided
  37 +%% that you do not make changes to the file.
  38 +%% If you DO make changes, you are required to rename this file.
  39 +%%
  40 +%% It may be distributed under the terms of the LaTeX Project Public
  41 +%% License, as described in lppl.txt in the base LaTeX distribution.
  42 +%% Either version 1.0 or, at your option, any later version.
  43 +%%
  44 +%% \CharacterTable
  45 +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
  46 +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
  47 +%% Digits \0\1\2\3\4\5\6\7\8\9
  48 +%% Exclamation \! Double quote \" Hash (number) \#
  49 +%% Dollar \$ Percent \% Ampersand \&
  50 +%% Acute accent \' Left paren \( Right paren \)
  51 +%% Asterisk \* Plus \+ Comma \,
  52 +%% Minus \- Point \. Solidus \/
  53 +%% Colon \: Semicolon \; Less than \<
  54 +%% Equals \= Greater than \> Question mark \?
  55 +%% Commercial at \@ Left bracket \[ Backslash \\
  56 +%% Right bracket \] Circumflex \^ Underscore \_
  57 +%% Grave accent \` Left brace \{ Vertical bar \|
  58 +%% Right brace \} Tilde \~}
  59 +%%
  60 +%%
  61 +%% Bug fixes and changes: at end of file
  62 +
  63 +% TeX programming: Vytas Statulevicius, VTeX, Lithuania, vytas@vtex.lt
  64 +% Requires Latex2e, ver.2000.06
  65 +
  66 +\def\imsfmt@name{imsart}
  67 +\def\imsfmt@version{2011/01/24}
  68 +
  69 +\ProvidesFile{imsart.sty}
  70 + [\imsfmt@version IMS article style (VS)]
  71 +
  72 +% hyperref must be loaded after:
  73 +\@ifpackageloaded{hyperref}{\@latex@error{Package 'hyperref' must be loaded after 'imsart'!}\@ehc}{}
  74 +
  75 +% Passoptions to hyperref:
  76 +
  77 +\PassOptionsToPackage{colorlinks,citecolor=blue,urlcolor=blue,linkcolor=blue,pagecolor=blue,linktocpage=true}{hyperref}
  78 +
  79 +% General options:
  80 +
  81 +% Put keywords as footnote
  82 +\newif\if@keywordsasfootnote
  83 +\DeclareOption{keywordsasfootnote}{\@keywordsasfootnotetrue}
  84 +
  85 +% Put history as footnote
  86 +\newif\if@historyasfootnote
  87 +\DeclareOption{historyasfootnote}{\@historyasfootnotetrue}
  88 +
  89 +% Put address as footnote
  90 +\newif\if@addressasfootnote
  91 +\DeclareOption{addressasfootnote}{\@addressasfootnotetrue}
  92 +
  93 +% Put addresses at end of document
  94 +\newif\if@addressatend
  95 +\DeclareOption{addressatend}{\@addressatendtrue}
  96 +
  97 +% Put "." after inline section headings:
  98 +\newif\if@autosecdot
  99 +\DeclareOption{autosecdot} {\@autosecdottrue}
  100 +\DeclareOption{noautosecdot}{\AtBeginDocument{\@autosecdotfalse}}
  101 +
  102 +% Load amsmath style with corerect settings:
  103 +\newif\if@load@amsmath
  104 +\DeclareOption{amsmath}{\@load@amsmathtrue}
  105 +
  106 +% Load amsthm style with corerect settings:
  107 +\newif\if@load@amsthm
  108 +\DeclareOption{amsthm}{\@load@amsthmtrue}
  109 +
  110 +% Load amsmath with leqno option
  111 +\newif\if@amsmath@leqno
  112 +
  113 +% Load natbib with correct settings:
  114 +\newif\if@load@natbib
  115 +\DeclareOption{natbib}{\@load@natbibtrue}
  116 +
  117 +% For LNMS we need to create a TOC of book, so we will
  118 +% enable writing to .aux
  119 +
  120 +\newif\if@supertoc \@supertocfalse
  121 +
  122 +% Information about journals
  123 +
  124 +\def\set@generic{\def\@tempa{-generic}\ifx\journal@id\@tempa\let\affiliation\@gobble\fi}
  125 +
  126 +\DeclareOption{generic}{%
  127 + \AtEndOfPackage{\set@generic}
  128 + \def\journal@id{-generic}}
  129 +
  130 +\DeclareOption{ps}{%
  131 + \def\journal@id{-ps}
  132 + \def\journal@name{Probability Surveys }
  133 + \def\journal@issn{ISSN: 1549-5787}
  134 + \def\journal@url{http://www.i-journals.org/ps}
  135 + \AtEndOfPackage{\let\affiliation\@gobble}}
  136 +
  137 +% Information about journals
  138 +\DeclareOption{ss}{%
  139 + \def\journal@id{-ss}
  140 + \def\journal@name{Statistics Surveys }
  141 + \def\journal@issn{ISSN: 1935-7516}
  142 + \def\journal@url{http://www.i-journals.org/ss}
  143 + \AtEndOfPackage{\let\affiliation\@gobble}}
  144 +
  145 +% Information about journals
  146 +\DeclareOption{ejs}{%
  147 + \def\journal@id{-ejs}
  148 + \def\journal@name{Electronic Journal of Statistics }
  149 + \def\journal@issn{ISSN: 1935-7524}
  150 + \def\journal@url{http://projecteuclid.org/ejs}
  151 + \AtEndOfPackage{\let\affiliation\@gobble}}
  152 +
  153 +\DeclareOption{lnms}{%
  154 + \def\journal@id{-lnms}
  155 + \def\journal@name{IMS Lecture Notes--Monograph Series }
  156 + \@twosidetrue
  157 + \def\copyrightowner@text{Institute of Mathematical Statistics}
  158 + \def\journal@issn{$\copyright$~\ims@href{http://www.imstat.org}{\copyrightowner@text}, \@copyrightyear}%
  159 + \def\journal@url{http://www.imstat.org/publications/lecnotes.htm}
  160 + \set@page@layout{30pc}{610pt}% 30pc * 51 line
  161 + \input{leqno.clo}% formula numbers at left
  162 + \@amsmath@leqnotrue
  163 + \@historyasfootnotetrue
  164 + \@keywordsasfootnotetrue
  165 + \@addressasfootnotetrue
  166 + \@supertoctrue
  167 + \AtBeginDocument{%
  168 + \setattribute{title} {skip} {28\p@}
  169 + \setattribute{keywordname}{size}{\itshape}
  170 + }
  171 +}
  172 +
  173 +\DeclareOption{coll}{%
  174 + \def\journal@id{-coll}
  175 + \def\journal@name{IMS Collections }
  176 + \@twosidetrue
  177 + \def\copyrightowner@text{Institute of Mathematical Statistics}
  178 + \def\journal@issn{$\copyright$~\ims@href{http://www.imstat.org}{\copyrightowner@text}, \@copyrightyear}%
  179 + \def\journal@url{http://www.imstat.org/publications/imscollections.htm}
  180 + \set@page@layout{30pc}{610pt}% 30pc * 51 line
  181 + \input{leqno.clo}% formula numbers at left
  182 + \@amsmath@leqnotrue
  183 + \@historyasfootnotetrue
  184 + \@keywordsasfootnotetrue
  185 + \@addressasfootnotetrue
  186 + \@supertoctrue
  187 + \AtBeginDocument{%
  188 + \setattribute{title} {skip} {28\p@}
  189 + \setattribute{keywordname}{size}{\itshape}
  190 + }
  191 +}
  192 +
  193 +
  194 +% Options for the IMS journals:
  195 +
  196 +\DeclareOption{aap}{%
  197 + \def\journal@id{-aap}
  198 + \def\journal@name{Submitted to the Annals of Applied Probability }
  199 + \def\journal@url{http://www.imstat.org/aap/}
  200 + \set@page@layout{30pc}{550pt}% 30pc * 46 line
  201 + \@twosidetrue
  202 + \input{leqno.clo}% formula numbers at left
  203 + \@amsmath@leqnotrue
  204 + \@historyasfootnotetrue
  205 + \@keywordsasfootnotetrue
  206 + \@addressatendtrue
  207 + \@imslayouttrue
  208 + \@autosecdottrue
  209 +}
  210 +
  211 +\DeclareOption{aop}{%
  212 + \def\journal@id{-aop}
  213 + \def\journal@name{Submitted to the Annals of Probability }
  214 + \def\journal@url{http://www.imstat.org/aop/}
  215 + \set@page@layout{30pc}{550pt}% 30pc * 46 line
  216 + \@twosidetrue
  217 + \input{leqno.clo}% formula numbers at left
  218 + \@amsmath@leqnotrue
  219 + \@historyasfootnotetrue
  220 + \@keywordsasfootnotetrue
  221 + \@addressatendtrue
  222 + \@imslayouttrue
  223 + \@autosecdottrue
  224 +}
  225 +
  226 +\DeclareOption{aos}{%
  227 + \def\journal@id{-aos}
  228 + \def\journal@name{Submitted to the Annals of Statistics }
  229 + \def\journal@url{http://www.imstat.org/aos/}
  230 + \set@page@layout{30pc}{550pt}% 30pc * 46 line
  231 + \@twosidetrue
  232 + \input{leqno.clo}% formula numbers at left
  233 + \@amsmath@leqnotrue
  234 + \@historyasfootnotetrue
  235 + \@keywordsasfootnotetrue
  236 + \@addressatendtrue
  237 + \@imslayouttrue
  238 + \@autosecdottrue
  239 +}
  240 +
  241 +\DeclareOption{aoas}{%
  242 + \def\journal@id{-aoas}
  243 + \def\journal@name{Submitted to the Annals of Applied Statistics }
  244 + \def\journal@url{http://www.imstat.org/aoas/}
  245 + \set@page@layout{30pc}{550pt}% 30pc * 46 line
  246 + \@twosidetrue
  247 + \input{leqno.clo}% formula numbers at left
  248 + \@amsmath@leqnotrue
  249 + \@historyasfootnotetrue
  250 + \@keywordsasfootnotetrue
  251 + \@addressatendtrue
  252 + \@imslayouttrue
  253 + \@autosecdottrue
  254 +}
  255 +
  256 +
  257 +\DeclareOption{sts}{%
  258 + \def\journal@id{-sts}
  259 + \def\journal@name{Submitted to the Statistical Science }
  260 + \def\journal@url{http://www.imstat.org/sts/}
  261 + \set@page@layout{32pc}{658pt}% 32pc * 55 line
  262 + \@twosidetrue
  263 + \input{leqno.clo}% formula numbers at left
  264 + \@amsmath@leqnotrue
  265 + \@stslayouttrue
  266 + \AtBeginDocument{\if@twocolumn\set@page@layout{42pc}{658pt}\fi}
  267 +}
  268 +
  269 +\DeclareOption{bj}{%
  270 + \def\journal@id{-bj}
  271 + \def\journal@name{Submitted to the Bernoulli}
  272 + \def\journal@url{http://isi.cbs.nl/bernoulli/}
  273 + \set@page@layout{32pc}{526pt}% 32pc * 44 line
  274 + \@twosidetrue
  275 + \@bjlayouttrue
  276 + \AtEndOfPackage{\let\affiliation\@gobble}
  277 +}
  278 +
  279 +\DeclareOption{aihp}{%
  280 + \def\journal@id{-aihp}
  281 + \def\journal@name{Submitted to the Annales de l'Institut Henri Poincar\'e - Probabilit\'es et Statistiques}
  282 + \def\journal@url{http://www.imstat.org/aihp}
  283 + \set@page@layout{39pc}{622pt}% 39pc * 52 line
  284 + \@twosidetrue
  285 + \@aihplayouttrue
  286 + \AtEndOfPackage{\let\affiliation\@gobble}
  287 +}
  288 +
  289 +\DeclareOption{bjps}{%
  290 + \def\journal@id{-bjps}
  291 + \def\journal@name{Submitted to the Brazilian Journal of Probability and Statistics}
  292 + \def\journal@url{http://www.redeabe.org.br}
  293 + \set@page@layout{30pc}{550pt}% 30pc * 46 line
  294 + \@twosidetrue
  295 + \@historyasfootnotetrue
  296 + \@keywordsasfootnotetrue
  297 + \@addressatendtrue
  298 + \@bjpslayouttrue
  299 +}
  300 +
  301 +
  302 +\DeclareOption{ssy}{%
  303 + \def\journal@id{-ssy}
  304 + \def\journal@name{Stochastic Systems }
  305 + \def\journal@url{http://www.i-journals.org/ssy/}
  306 + \def\copyrightowner@text{Institute of Mathematical Statistics}
  307 + \def\journal@issn{$\copyright$~\ims@href{http://www.imstat.org}{\copyrightowner@text}, \@copyrightyear}%
  308 + \set@page@layout{30pc}{550pt}% 30pc * 46 line
  309 + \@twosidetrue
  310 + \input{leqno.clo}% formula numbers at left
  311 + \@amsmath@leqnotrue
  312 + \@historyasfootnotetrue
  313 + \@keywordsasfootnotetrue
  314 + \@addressatendtrue
  315 + \@imslayouttrue
  316 + \@autosecdottrue
  317 + \AtEndOfPackage{%
  318 + \setattribute{copyright}{text}{%
  319 + \url@fmt{}{\itshape}{\journal@name}{\journal@url}\break%
  320 + \@ifnonempty{\@pubyear\@volume\@issue\@pagerange\break}%
  321 + \doi@text\break%
  322 + }}
  323 +}
  324 +
  325 +%% Layouts:
  326 +% IMS journals AAP, AOP, AOS has a different layout:
  327 +
  328 +\newif\if@imslayout \@imslayoutfalse
  329 +
  330 +\DeclareOption{imslayout}{
  331 + \def\journal@id{-imsgeneric}
  332 + \input{leqno.clo}% formula numbers at left
  333 + \@amsmath@leqnotrue
  334 + \@historyasfootnotetrue
  335 + \@keywordsasfootnotetrue
  336 + \@addressatendtrue
  337 + \@imslayouttrue
  338 + \@autosecdottrue}
  339 +
  340 +% IMS STS journal layout also specific
  341 +\newif\if@stslayout \@stslayoutfalse
  342 +\DeclareOption{stslayout}{
  343 + \def\journal@id{-stsgeneric}
  344 + \set@page@layout{32pc}{658pt}% 32pc * 55 line
  345 + \@twosidetrue
  346 + \input{leqno.clo}% formula numbers at left
  347 + \@amsmath@leqnotrue
  348 + \@stslayouttrue
  349 + \AtBeginDocument{\if@twocolumn\set@page@layout{42pc}{658pt}\fi}}
  350 +
  351 +% BS BJ journal layout also specific:
  352 +\newif\if@bjlayout \@bjlayoutfalse
  353 +
  354 +% AIHP journal layout also specific:
  355 +\newif\if@aihplayout \@aihplayoutfalse
  356 +
  357 +% BJPS journal layout also specific:
  358 +\newif\if@bjpslayout \@bjpslayoutfalse
  359 +
  360 +% Spacing
  361 +\DeclareOption{doublespacing}{\doublespacing}
  362 +\DeclareOption{singlespacing}{\singlespacing}
  363 +
  364 +\def\singlespacing{\renewcommand{\baselinestretch}{}\large\normalsize}
  365 +\def\doublespacing{\renewcommand{\baselinestretch}{1.6}\large\normalsize}
  366 +
  367 +% Do not print id line at bottom of the page:
  368 +\DeclareOption{noinfoline}{\AtBeginDocument{\let\info@line\@empty}}
  369 +\DeclareOption{infoline} {\AtBeginDocument{\let\info@line\infoline@text}}
  370 +
  371 +% Put lines numbers in margins
  372 +\newif\ifnumberlines@ \numberlines@false
  373 +\DeclareOption{linenumbers}{\numberlines@true}
  374 +\DeclareOption{nolinenumbers}{\numberlines@false}
  375 +
  376 +% Combined options:
  377 +
  378 +% Use this option for submission for pier review:
  379 +\DeclareOption{submission}{%
  380 + \singlespacing
  381 + \AtBeginDocument{\let\info@line\infoline@text}
  382 + \numberlines@false}
  383 +
  384 +% use this option for pre-publication (preprint):
  385 +
  386 +\DeclareOption{preprint}{%
  387 + \singlespacing
  388 + \AtBeginDocument{\let\info@line\@empty}
  389 + \numberlines@false}
  390 +
  391 +
  392 +
  393 +% Initiate some info:
  394 +\def\journal@name{}
  395 +\def\journal@url{}
  396 +\def\journal@issn{}
  397 +\def\journal@id{}
  398 +\def\paper@url{}
  399 +\def\info@line{}
  400 +\def\copyrightowner@text{}
  401 +
  402 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% set@page@layout
  403 +
  404 +% \set@page@layout{\textwidth}{\textheight}
  405 +
  406 +\def\set@page@layout#1#2{%
  407 +%
  408 + \setlength\textwidth{#1}
  409 + \@settopoint\textwidth
  410 + \setlength\textheight{#2}
  411 + \@settopoint\textheight
  412 +%
  413 +% make side margins equal:
  414 + \setlength\@tempdima {\paperwidth}
  415 + \addtolength\@tempdima {-\textwidth}
  416 + \setlength\oddsidemargin {.5\@tempdima}
  417 + \addtolength\oddsidemargin {-1in}
  418 + \setlength\evensidemargin {\oddsidemargin}
  419 + \@settopoint\oddsidemargin
  420 + \@settopoint\evensidemargin
  421 +%
  422 +% topmargin
  423 + \setlength\topmargin{\paperheight}
  424 + \addtolength\topmargin{-2in}
  425 + \addtolength\topmargin{-\headheight}
  426 + \addtolength\topmargin{-\headsep}
  427 + \addtolength\topmargin{-\textheight}
  428 + \addtolength\topmargin{-\footskip} % this might be wrong!
  429 + \addtolength\topmargin{-.5\topmargin}
  430 + \@settopoint\topmargin
  431 +}
  432 +
  433 +
  434 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Load imsart.cnf with additional options:
  435 +\@input{\imsfmt@name.cnf}
  436 +
  437 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Execute options
  438 +
  439 +\ExecuteOptions{generic,infoline}
  440 +\ProcessOptions
  441 +
  442 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dimensions
  443 +
  444 +\setlength\parindent {12\p@}
  445 +\setlength\headsep {14\p@}
  446 +\setlength\footskip {14\p@}
  447 +
  448 +\setlength\smallskipamount{6\p@ \@plus 1\p@ \@minus 1\p@}
  449 +\setlength\medskipamount {12\p@ \@plus 3\p@ \@minus 3\p@}
  450 +\setlength\bigskipamount {18\p@ \@plus 3\p@ \@minus 3\p@}
  451 +
  452 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% setattribute, getattribute, do@option@list
  453 +
  454 +\def\setattribute{\@ifnextchar[\@setattribute{\@setattribute[]}}
  455 +\def\@setattribute[#1]#2#3#4{\expandafter\gdef\csname #2@#3\endcsname{#4}}
  456 +\def\getattribute#1#2{\csname #1@#2\endcsname}
  457 +\def\sep@key@value#1=#2/?/#3{\setattribute{#3}{#1}{#2}}
  458 +\def\do@option@list#1#2{%
  459 + \@for\curr@option:={#2}\do{%
  460 + \expandafter\sep@key@value\curr@option/?/{#1}\relax
  461 + }%
  462 +}
  463 +
  464 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% newpseudoenvironment
  465 +% same as \newenvironment, but new environment do not have additional groups \bgroup \egroup
  466 +% (i.e. all definitions are not local
  467 +
  468 +\let\org@begin\begin
  469 +\let\org@end\end
  470 +\def\begin#1{%
  471 + \@ifundefined{pseudo@#1}%
  472 + {\org@begin{#1}}{\csname pseudo@#1\endcsname[0]\relax}%
  473 + }
  474 +\def\end#1{%
  475 + \@ifundefined{pseudo@#1}%
  476 + {\org@end{#1}}{\csname pseudo@#1\endcsname[1]\relax}%
  477 + }
  478 +\def\newpseudoenvironment#1#2#3{%
  479 + \expandafter\gdef\csname pseudo@#1\endcsname[##1]{%
  480 + \relax\ifcase##1\relax\def\@@next@@{#2}\or\def\@@next@@{#3}\else\let\@@next@@\relax\fi\@@next@@}%
  481 + }
  482 +
  483 +
  484 +
  485 +
  486 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% pubyear, volume, paperno
  487 +
  488 +\def\pubyear#1{\gdef\@pubyear{(#1) }\gdef\@copyrightyear{#1 }}
  489 + \def\@pubyear{}
  490 + \def\@copyrightyear{}
  491 +
  492 +\def\volumetitle#1{\gdef\volume@title{#1 }}
  493 +
  494 +\def\volume#1{\gdef\@volume{Vol. #1 }}
  495 + \gdef\@volume{}
  496 +
  497 +\def\issue#1{\gdef\@issue{No. #1 }}
  498 + \gdef\@issue{}
  499 +
  500 +\def\paperno#1{\gdef\@paperno{Paper no. #1 }}
  501 + \gdef\@paperno{00}
  502 +
  503 +
  504 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% firstpage, lastpage, pagerange
  505 +
  506 +\newcounter{firstpage}
  507 +\newcounter{lastpage}
  508 +
  509 +\def\firstpage#1{\def\@tempa{#1}\ifx\@tempa\@empty\else
  510 + \global\c@firstpage=#1
  511 + \global\c@lastpage=#1
  512 + \global\c@page=#1 \ignorespaces\fi}
  513 +
  514 +\def\lastpage#1{\def\@tempa{#1}\ifx\@tempa\@empty\else
  515 + \global\c@lastpage=#1
  516 + \ignorespaces\fi}
  517 +
  518 +\def\pagerange@sep{--}
  519 +
  520 +\def\set@pagerange{%
  521 + \ifnum\c@firstpage=0%
  522 + \else%
  523 + \ifnum\c@firstpage=\c@lastpage%
  524 + \gdef\@pagerange{\thefirstpage}%
  525 + \else%
  526 + \gdef\@pagerange{\thefirstpage\pagerange@sep\thelastpage}%
  527 + \fi%
  528 + \fi}
  529 +
  530 +\def\@pagerange{}
  531 +
  532 +\def\pagenumbering#1{%
  533 + \gdef\thefirstpage{\csname @#1\endcsname\c@firstpage}%
  534 + \gdef\thelastpage{\csname @#1\endcsname\c@lastpage}%
  535 + \gdef\thepage{\csname @#1\endcsname\c@page}%
  536 +}
  537 +
  538 +% hyperref redefines \pagenumbering, so we must override hyperref definition:
  539 +\let\ims@pagenumbering\pagenumbering
  540 +
  541 +
  542 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% startlocaldefs, endlocaldefs
  543 +
  544 +\def\startlocaldefs{\makeatletter}
  545 +\def\endlocaldefs{\makeatother}
  546 +
  547 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% thanksref, thanksmark, thankslabel, thankstext
  548 +% to be safe with hyperref we will use original LaTeX definitions:
  549 +%
  550 +
  551 +\def\saferef#1{\expandafter\safe@setref\csname r@#1\endcsname\@firstoftwo{#1}}
  552 +\let\safe@setref\@setref
  553 +
  554 +\def\safelabel#1{\@bsphack
  555 + \protected@write\@auxout{}%
  556 + {\string\thanksnewlabel{#1}{{\@currentlabel}{\thepage}}}%
  557 + \@esphack}
  558 +
  559 +\long\def\safe@footnotetext#1{\insert\footins{%
  560 + \reset@font\footnotesize
  561 + \interlinepenalty\interfootnotelinepenalty
  562 + \splittopskip\footnotesep
  563 + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
  564 + \hsize\columnwidth \@parboxrestore
  565 + \color@begingroup
  566 + \def\@thefnmark{}%
  567 + \@makefntext{%
  568 + \rule\z@\footnotesep\ignorespaces #1\@finalstrut\strutbox}%
  569 + \color@endgroup}}%
  570 +
  571 +
  572 +\long\def\orig@footnotetext#1{\insert\footins{%
  573 + \reset@font\footnotesize
  574 + \interlinepenalty\interfootnotelinepenalty
  575 + \splittopskip\footnotesep
  576 + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
  577 + \hsize\columnwidth \@parboxrestore
  578 + \protected@edef\@currentlabel{%
  579 + \csname p@footnote\endcsname\@thefnmark
  580 + }%
  581 + \color@begingroup
  582 + \@makefntext{%
  583 + \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
  584 + \color@endgroup}}%
  585 +
  586 +
  587 +
  588 +\let\thanksnewlabel\newlabel
  589 +
  590 +% we want to use various counters:
  591 +\def\usethankscounter#1{%
  592 + \@ifundefined{current@thankscounter}{\gdef\previous@thankscounter{#1}}{\xdef\previous@thankscounter{\current@thankscounter}}%
  593 + \def\current@thankscounter{#1}}
  594 +
  595 +\def\restorethankscounter{\xdef\current@thankscounter{\previous@thankscounter}}
  596 +
  597 +\newcounter{thanks}
  598 +\def\thethanks{\@fnsymbol\c@thanks}
  599 +\usethankscounter{thanks}
  600 +
  601 +% address ref:
  602 +\newcounter{addressref}
  603 +\def\theaddressref{\arabic{addressref}}
  604 +
  605 +
  606 +%\def\thanksmark@fmt#1{\hbox{$^{#1}$}}
  607 +\def\thanksmark@fmt#1{\@textsuperscript{\normalfont#1}}
  608 +\def\thanksref@sep{,}
  609 +
  610 +% hooks for the hyperref:
  611 +\def\thankref@hyperlink#1{\saferef{#1thanks}}
  612 +\def\thanks@hypertarget#1{}
  613 +
  614 +% Isvedame zymes
  615 +\def\thanksref{\@ifnextchar[{\@tempswatrue\@thanksref}{\@tempswafalse\@thanksref[]}}
  616 +
  617 +\def\@thanksref[#1]#2{%
  618 + \if@tempswa% []
  619 + \thanksmark@fmt{#1}%
  620 + \else%
  621 + \let\@tempa\@empty%
  622 + \thanksmark@fmt{\@for\@tempb:=#2\do{%
  623 + \@tempa\let\@tempa\thanksref@sep%
  624 + \edef\@tempb{\expandafter\@firstofone\@tempb\@empty}%
  625 + \thankref@hyperlink{\@tempb}}}%
  626 + \fi}
  627 +
  628 +% Suformuojame ir isvedame zyme
  629 +\def\thanksmark{\@ifnextchar[{\@tempswatrue\@thanksmark}{\@tempswafalse\@thanksmark[]}}
  630 +
  631 +\def\@thanksmark[#1]#2{%
  632 + \@thankslabel[#1]{#2}%
  633 + \safelabel{#2thanks}%
  634 + \thanksmark@fmt{\expandafter\saferef{#2thanks}\thanks@hypertarget{#2}}}
  635 +
  636 +% Suformuojame tik zyme
  637 +\def\thankslabel{\@ifnextchar[{\@tempswatrue\@thankslabel}{\@tempswafalse\@thankslabel[]}}
  638 +
  639 +\def\@thankslabel[#1]#2{%
  640 + \if@tempswa% []
  641 + \protected@edef\@currentlabel{#1}%
  642 + \else%
  643 + \refstepcounter{\current@thankscounter}%
  644 + \fi%
  645 + \safelabel{#2thanks}}%
  646 +
  647 +% Suformuojame zyme ir idedame teksta i \@thanks:
  648 +\def\thankstext{\@ifnextchar[{\@tempswatrue\@thankstext}{\@tempswafalse\@thankstext[]}}
  649 +
  650 +\def\@thankstext[#1]#2#3{%
  651 + \@thankslabel[#1]{#2}%
  652 + \protected@xdef\@thanks{\@thanks\protect\thanks@thefnmark{#2thanks}%
  653 + \protect\orig@footnotetext{\thanks@hypertarget{#2}#3}}}%
  654 +
  655 +\def\thanks@thefnmark#1{\begingroup\unrestored@protected@xdef\@thefnmark{\saferef{#1}}\endgroup}%
  656 +
  657 +
  658 +
  659 +% ST makrosas savo numeracijos sistemos sukurimui
  660 +\def\setvaluelist#1#2{\@tempcnta=0\relax
  661 + \@for\@curr@val:=#2\do{%
  662 + \advance\@tempcnta by1\relax
  663 + \expandafter\protected@xdef\csname #1@item@\the\@tempcnta\endcsname{\@curr@val}%
  664 + }%
  665 + \expandafter\protected@xdef\csname #1@item@0\endcsname{\the\@tempcnta}%
  666 +}
  667 +\xdef\getitemvalue#1#2{\noexpand\csname #1@item@#2\endcsname}
  668 +
  669 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ead, \printead
  670 +
  671 +\RequirePackage{keyval}
  672 +
  673 +\def\email@text{e-mail: }
  674 +\def\url@text{url: }
  675 +\def\fullurl@text{url: }
  676 +\def\ead@sep{;~}
  677 +\let\ead@size\relax
  678 +\def\printead@fmt#1{#1}
  679 +
  680 +% for BJ journal:
  681 +\newcounter{emailref}
  682 +\setvaluelist{emailmarks}{*,**,\textdagger,\textdaggerdbl}
  683 +\def\theemailref{\getitemvalue{emailmarks}{\the\c@emailref}}
  684 +\define@key{ead}{mark}[true]{\usethankscounter{emailref}\thankslabel{\ead@label}}
  685 +
  686 +
  687 +% naudojame keyval paketa
  688 +\define@key{ead}{email}[true]{\def\ead@type{email}}
  689 +\define@key{ead}{url}[true]{\def\@tempa{fullurl}\ifx\ead@type\@tempa\else\def\ead@type{url}\fi}
  690 +\define@key{ead}{label}{\def\ead@label{#1}}
  691 +
  692 +\define@key{ead}{text}{%
  693 + \bgroup%
  694 + \def\\{\string\break}
  695 + \def\break{\string\break}%
  696 + \protected@edef\@currentlabel{#1}%
  697 + \safelabel{\ead@label @\ead@type text}%
  698 + \egroup}
  699 +
  700 +\define@key{ead}{nopdflink}[true]{%
  701 + \protected@edef\@currentlabel{nolink}%
  702 + \safelabel{\ead@label @nopdflink}}
  703 +
  704 +
  705 +\DeclareRobustCommand\ead[2][label= ,email]{{%
  706 + \def\ead@type{email}% default
  707 + \checkead@prefix#2://\end%
  708 + \def\texttildelow{\noexpand\texttildelow}%
  709 + \setkeys{ead}{#1}%
  710 + \protected@edef\@currentlabel{#2}%
  711 + \safelabel{\ead@label @\ead@type}}}
  712 +
  713 +\def\checkead@prefix#1://#2\end{\ifx.#2.\else\def\ead@type{fullurl}\fi}
  714 +
  715 +\newif\ifnot@ead@star
  716 +\newif\if@printead@opt
  717 +
  718 +\DeclareRobustCommand{\printead}{\@ifstar{\not@ead@starfalse\@printead}{\not@ead@startrue\@printead}}
  719 +
  720 +\def\@printead{\@ifnextchar[{\@printead@opttrue\@@printead}{\@printead@optfalse\@@printead[]}}
  721 +
  722 +\def\@@printead[#1]#2{{%
  723 + \if@printead@opt%[]
  724 + \def\ims@href@text{#1}%
  725 + \not@ead@starfalse%
  726 + \fi%
  727 + \let\prev@ead@text\relax%
  728 + \let\@ead@sep\relax%
  729 + \let\ead@text\relax%
  730 + \let\ead@prefix\relax%
  731 + \def\ead@type{}%
  732 + \@tempcnta=0%
  733 + \let\sv@ims@href\ims@href%
  734 + \printead@fmt{\@for\ead@ref:=#2\do{%
  735 + \advance\@tempcnta by1%
  736 + \let\ims@href\sv@ims@href%
  737 + \@ead@sep\let\@ead@sep\ead@sep%
  738 + \@ifundefined{r@\ead@ref @nopdflink}{}{\def\ims@href##1##2{##2}}%
  739 + \@ifundefined{r@\ead@ref @email}{}{\let\ead@text\email@text\def\ead@type{email}\def\ead@prefix{mailto:}}%
  740 + \@ifundefined{r@\ead@ref @url}{}{\let\ead@text\url@text\def\ead@type{url}\def\ead@prefix{http://}}%
  741 + \@ifundefined{r@\ead@ref @fullurl}{}{\let\ead@text\fullurl@text\def\ead@type{fullurl}\def\ead@prefix{}}%
  742 + \ifx\prev@ead@text\ead@text\let\ead@text\relax\fi%
  743 + \if@printead@opt\ifnum\@tempcnta>1\@latex@error{Command \@backslashchar printead[]{e1} could have only one parameter "e1"!}\@eha\fi%
  744 + \else\@ifundefined{r@\ead@ref @\ead@type text}{\def\ims@href@text{\@ifundefined{r@\ead@ref thanks}{}{\thanksref{\ead@ref}}\saferef{\ead@ref @\ead@type}}}{\def\ims@href@text{\@ifundefined{r@\ead@ref thanks}{}{\thanksref{\ead@ref}}\saferef{\ead@ref @\ead@type text}}}\fi%
  745 + \ifnot@ead@star\ead@text\fi{\ead@size\def\null{}\ims@href{\ead@prefix\saferef{\ead@ref @\ead@type}}{\ims@href@text}}%
  746 + \@ifundefined{ead@text}{}{\let\prev@ead@text\ead@text}}}%
  747 +}}
  748 +
  749 +
  750 +
  751 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \copyrightowner, \corref
  752 +
  753 +\def\copyrightowner#1{\def\copyrightowner@text{#1}}
  754 +
  755 +
  756 +% for corresponding author
  757 +\def\corref#1{}
  758 +
  759 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% normaltext, nohyphen, today
  760 +
  761 +% normalus tekstas (justify)
  762 +\def\normaltext{\let\\=\@normalcr%
  763 + \leftskip\z@ \@rightskip\z@ \rightskip\@rightskip%
  764 + \parfillskip\@flushglue}
  765 +
  766 +% skiemenavimo isjungimas
  767 +\def\nohyphen{\pretolerance=\@M \tolerance=\@M \hyphenpenalty=\@M \exhyphenpenalty=\@M}
  768 +
  769 +
  770 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \@ifemptyhbox
  771 +
  772 +\def\@ifnonempty#1{%
  773 + \setbox\@tempboxa\hbox{\ignorespaces #1}%
  774 + \ifdim\wd\@tempboxa>1pt #1\fi}
  775 +
  776 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\pagestyle{imsheadings} \thispagestyle{copyright}
  777 +
  778 +
  779 +\if@twoside
  780 +
  781 +\def\ps@imsheadings{%
  782 + \def\@oddfoot{\hfill\info@line}%
  783 + \let\@evenfoot\@oddfoot%
  784 + \def\@evenhead{\runninghead@size\rlap{\pagenumber@size\thepage}\evenhead@fmt{\leftmark}}%
  785 + \def\@oddhead{\runninghead@size\oddhead@fmt{\rightmark}\llap{\pagenumber@size\thepage}}}
  786 +\else
  787 +\def\ps@imsheadings{%
  788 + \def\@oddfoot{\hfill\info@line}%
  789 + \let\@evenfoot\@oddfoot%
  790 + \def\@evenhead{\runninghead@size\hfill\leftmark\rightmark\hfill\llap{\pagenumber@size\thepage}}%
  791 + \def\@oddhead{\runninghead@size\hfill\leftmark\rightmark\hfill\llap{\pagenumber@size\thepage}}}
  792 +% \def\@evenhead{\runninghead@size\hfill\leftmark/\rightmark\hfill\llap{\pagenumber@size\thepage}}%
  793 +% \def\@oddhead{\runninghead@size\hfill\leftmark/\rightmark\hfill\llap{\pagenumber@size\thepage}}}
  794 +\fi
  795 +
  796 +\def\ps@copyright{\let\@mkboth\@gobbletwo%
  797 + \def\@evenhead{\parbox[t]{\textwidth}{\copyright@size\copyright@text}}%
  798 + \let\@oddhead\@evenhead%
  799 + \def\@oddfoot{\hfill\pagenumber@size\thepage\hfill\llap{\info@line}}%
  800 + \let\@evenfoot\@oddfoot}
  801 +
  802 +\def\evenhead@fmt#1{\hfill#1\hfill}
  803 +\def\oddhead@fmt#1{\hfill#1\hfill}
  804 +
  805 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% url@fmt
  806 +
  807 +
  808 +\def\journalurl#1{\def\journal@url{#1}}
  809 +\def\paperurl#1{\def\paper@url{#1}}
  810 +
  811 +% DOI
  812 +
  813 +\def\doi#1{%
  814 + \gdef\@doi{#1}%
  815 + \gdef\doi@text{\url@fmt{DOI: }{\ttfamily}{#1}{\doi@base\@doi}}%
  816 +}
  817 +
  818 +\let\@doi\relax
  819 +
  820 +\def\doi@base{http://dx.doi.org/}
  821 +
  822 +% arXiv
  823 +
  824 +
  825 +\def\arxiv#1{%
  826 + \gdef\@arxiv{#1}%
  827 + \gdef\doi@text{\url@fmt{arXiv: }{\ttfamily}{#1}{\arxiv@base\@arxiv}}%
  828 +}
  829 +
  830 +\let\@arxiv\relax
  831 +
  832 +% http://arxiv.org/abs/math.PR/0603300
  833 +
  834 +\def\arxiv@base{http://arxiv.org/abs/}
  835 +
  836 +
  837 +% {url}{text}
  838 +\def\ims@href#1#2{#2}
  839 +
  840 +% {prefix}{font}{text}{url}
  841 +
  842 +\def\url@fmt#1#2#3#4{%
  843 + \edef\@tempa{#3}%
  844 + \ifx\@tempa\@empty%
  845 + \else%
  846 + #1{#2\ims@href{#4}{#3}}%
  847 + \fi}
  848 +
  849 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LIST ENVIRONMENTS
  850 +
  851 +\parsep\z@
  852 +\topsep\smallskipamount
  853 +\partopsep\z@
  854 +\itemsep\z@
  855 +\labelsep.5em
  856 +
  857 +\def\@listI{\leftmargin\leftmargini
  858 + \parsep\z@
  859 + \topsep\smallskipamount
  860 + \itemsep\z@}
  861 +
  862 +\def\list@parindent{1pc}
  863 +
  864 +% quotation
  865 +\let\quotation@size\footnotesize
  866 +\def\quotation@itemindent{\list@parindent}
  867 +\def\quotation@parindent{\list@parindent}
  868 +\def\quotation@leftmargin{\list@parindent}
  869 +\let\quotation@rightmargin\z@
  870 +\let\quotation@topsep\smallskipamount
  871 +
  872 +\def\quotation{%
  873 + \list{}{\quotation@size%
  874 + \listparindent\quotation@parindent%
  875 + \itemindent \quotation@itemindent%
  876 + \rightmargin\quotation@rightmargin \leftmargin\quotation@leftmargin%
  877 + \partopsep\z@ \topsep\quotation@topsep \parsep\z@%
  878 + }%
  879 + \item[\Q@strut]\relax}
  880 +
  881 +\def\endquotation{\endlist}
  882 +
  883 +\def\Q@strut{\leavevmode\hbox{\vrule height9pt depth1pt width0pt}}
  884 +
  885 +% quote
  886 +\let\quote@size\footnotesize
  887 +\def\quote@indent{\z@}
  888 +\def\quote@leftmargin{2pc}
  889 +\def\quote@rightmargin{2pc}
  890 +\let\quote@topsep\smallskipamount
  891 +
  892 +\def\quote{%
  893 + \list{}{\quote@size%
  894 + \listparindent\quote@indent%
  895 + \itemindent \listparindent%
  896 + \rightmargin\quote@rightmargin \leftmargin\quote@leftmargin%
  897 + \partopsep\z@ \topsep\quote@topsep \parsep\z@%
  898 + }%
  899 + \item\relax}
  900 +
  901 +\def\endquote{\endlist}
  902 +
  903 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% table, figure
  904 +
  905 +\def\fnum@table{\tablename~\thetable}
  906 +\setlength\belowcaptionskip{4\p@}
  907 +
  908 +\renewenvironment{table}
  909 + {\let\@makecaption\@maketablecaption\@float{table}}
  910 + {\end@float}
  911 +\renewenvironment{table*}
  912 + {\let\@makecaption\@maketablecaption\@dblfloat{table}}
  913 + {\end@dblfloat}
  914 +
  915 +\long\def\@maketablecaption#1#2{%
  916 + \tablecaption@shape\tablecaption@size%
  917 + {\tablename@size #1}\tablename@skip #2\par
  918 + \vskip\belowcaptionskip}
  919 +
  920 +\setattribute{tablecaption}{shape}{\centering}
  921 +\setattribute{tablecaption}{size} {\footnotesize\itshape}
  922 +\setattribute{tablename} {size} {\scshape}
  923 +\setattribute{tablename} {skip} {\endgraf}
  924 +
  925 +
  926 +% figure : use \@makecaption:
  927 +\renewcommand\figurename{Fig}
  928 +
  929 +\long\def\@makecaption#1#2{%
  930 + \vskip\abovecaptionskip
  931 + \footnotesize
  932 + \sbox\@tempboxa{\itshape\textsc{#1}. #2}%
  933 + \ifdim \wd\@tempboxa >\hsize
  934 + \itshape\textsc{#1}. #2\par
  935 + \else
  936 + \global \@minipagefalse
  937 + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  938 + \fi
  939 + \vskip\belowcaptionskip}
  940 +
  941 +\long\def\@makecaption#1#2{%
  942 + \vskip\abovecaptionskip
  943 + \figurecaption@size
  944 + \sbox\@tempboxa{{\figurename@size #1}\figurename@skip #2}%
  945 + \ifdim \wd\@tempboxa >\hsize
  946 + {\figurename@size #1}\figurename@skip #2\par
  947 + \else
  948 + \global \@minipagefalse
  949 + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  950 + \fi
  951 + \vskip\belowcaptionskip}
  952 +
  953 +\setattribute{figurecaption}{size}{\footnotesize\itshape}
  954 +\setattribute{figurename} {size}{\scshape}
  955 +\setattribute{figurename} {skip}{.~}
  956 +
  957 +
  958 +\def\@floatboxreset{%
  959 + \reset@font
  960 + \@setminipage
  961 + \singlespacing
  962 + \footnotesize
  963 + \centering
  964 +}
  965 +
  966 +\if@aihplayout
  967 + \setattribute{tablecaption}{size} {\footnotesize}
  968 + \setattribute{figurecaption}{size}{\footnotesize}
  969 +\fi
  970 +
  971 +\if@bjpslayout
  972 + \setattribute{tablename} {size} {\bfseries\upshape}
  973 + \setattribute{tablename} {skip} {\enskip}
  974 +
  975 + \setattribute{figurename} {size}{\bfseries\upshape}
  976 + \setattribute{figurename} {skip}{\enskip}
  977 + \def\figurename{Figure}
  978 +\fi
  979 +
  980 +
  981 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FOOTNOTE
  982 +
  983 +\renewcommand\@makefntext[1]{%
  984 + \parindent12pt\@makefnmark #1}
  985 +
  986 +\def\@makefnmark{\@textsuperscript{\normalfont\@thefnmark}}%
  987 +
  988 +
  989 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION commands:
  990 +% from latex.ltx:
  991 +% Two improvements:
  992 +% 1. if section command is defined as "inline" the '.' will be inserted after heading;
  993 +% 2. section* will write to toc and will appear in pdf bookmarks
  994 +
  995 +% dirty trick...
  996 +\def\@startsection#1#2#3#4#5#6{%
  997 + \if@noskipsec \leavevmode \fi
  998 + \par
  999 + \@tempskipa #4\relax
  1000 + \@afterindenttrue
  1001 + \ifdim \@tempskipa <\z@
  1002 + \@tempskipa -\@tempskipa \@afterindentfalse
  1003 + \fi
  1004 + \if@nobreak
  1005 + \everypar{}%
  1006 + \else
  1007 + \addpenalty\@secpenalty\addvspace\@tempskipa
  1008 + \fi
  1009 + \@ifstar
  1010 + {\def\ssection@level{#2}\@ssect{#3}{#4}{#5}{#6}}%
  1011 + {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
  1012 +
  1013 +% Trick for the hyperref:
  1014 +\def\setaftersec@dot#1{\if@autosecdot\setbox0=\hbox{#1}\ifdim\wd0>0\p@\def\aftersec@dot{.}\else\def\aftersec@dot{}\fi\fi}
  1015 +\let\aftersec@dot\relax
  1016 +
  1017 +% section - will add hook for the dot after section heading
  1018 +\def\@sect#1#2#3#4#5#6[#7]#8{%
  1019 + \ifnum #2>\c@secnumdepth
  1020 + \let\@svsec\@empty
  1021 + \else
  1022 + \refstepcounter{#1}%
  1023 + \protected@edef\@svsec{\@seccntformat{#1}\relax}%
  1024 + \fi
  1025 + \@tempskipa #5\relax
  1026 + \ifdim \@tempskipa>\z@
  1027 + \begingroup
  1028 + #6{%
  1029 + \@hangfrom{\hskip #3\relax\@svsec}%
  1030 + \interlinepenalty \@M #8\@@par}%
  1031 + \endgroup
  1032 + \csname #1mark\endcsname{#7}%
  1033 + \addcontentsline{toc}{#1}{%
  1034 + \ifnum #2>\c@secnumdepth \else
  1035 + \protect\numberline{\csname the#1\endcsname}%
  1036 + \fi
  1037 + #7}%
  1038 + \else
  1039 + \setaftersec@dot{#8}%
  1040 + \def\@svsechd{%
  1041 + #6{\hskip #3\relax
  1042 + \@svsec #8\aftersec@dot}%
  1043 + \csname #1mark\endcsname{#7}%
  1044 + \addcontentsline{toc}{#1}{%
  1045 + \ifnum #2>\c@secnumdepth \else
  1046 + \protect\numberline{\csname the#1\endcsname}%
  1047 + \fi
  1048 + #7}}%
  1049 + \fi
  1050 + \@xsect{#5}}
  1051 +
  1052 +% section* - will add hook for the dot after section heading and \contentsline
  1053 +\def\@ssect#1#2#3#4#5{%
  1054 + \@tempskipa #3\relax
  1055 + \ifdim \@tempskipa>\z@
  1056 + \begingroup
  1057 + #4{%
  1058 + \@hangfrom{\hskip #1}%
  1059 + \interlinepenalty \@M #5\@@par}%
  1060 + \endgroup
  1061 + \else
  1062 + \setaftersec@dot{#5}%
  1063 + \def\@svsechd{#4{\hskip #1\relax #5\aftersec@dot}}%
  1064 + \fi
  1065 + \ifnum\ssection@level=1\phantomsection\addcontentsline{toc}{section}{#5}\fi%
  1066 + \@xsect{#3}}
  1067 +
  1068 +% Block adding to contents for the next command only:
  1069 +\def\nocontentsline{%
  1070 + \let\@@addcontentsline\addcontentsline%
  1071 + \ifx\hyper@anchor\@undefined
  1072 + \def\addcontentsline##1##2##3{\let\addcontentsline\@@addcontentsline}
  1073 + \else
  1074 + \def\addcontentsline##1##2##3##4{\let\addcontentsline\@@addcontentsline}
  1075 + \fi
  1076 +}
  1077 +
  1078 +
  1079 +% \phantomsection is defined in hyperref
  1080 +\let\phantomsection\relax
  1081 +
  1082 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FRONTMATTER SETTINGS
  1083 +
  1084 +% FRONT MATTER FORMATTING PARAMETERS
  1085 +
  1086 +\setattribute{frontmatter} {style} {\centering}
  1087 +\setattribute{title} {style} {\centering}
  1088 +\setattribute{author} {style} {\centering}
  1089 +\setattribute{address} {style} {\centering}
  1090 +\setattribute{abstract} {style} {\normaltext}
  1091 +\setattribute{keyword} {style} {\normaltext}
  1092 +\setattribute{history} {style} {\normaltext}
  1093 +
  1094 +% FRONT MATTER SKIPS
  1095 +\setattribute{title} {skip} {18\p@}
  1096 +\setattribute{atltitle} {skip} {14\p@}
  1097 +\setattribute{authors} {skip} {12pt}
  1098 +\setattribute{dedicated} {skip} {12\p@}
  1099 +\setattribute{address} {skip} {6\p@ plus 1\p@ minus 1\p@}
  1100 +\setattribute{affiliation} {skip} {6\p@ plus 1\p@ minus 1\p@}
  1101 +\setattribute{abstract} {skip} {10\p@}
  1102 +\setattribute{abstractname}{skip} {:\enskip}
  1103 +\setattribute{keyword} {skip} {10\p@}
  1104 +\setattribute{history} {skip} {10\p@}
  1105 +\setattribute{frontmatter} {cmd} {\vskip20\p@ plus 3\p@ minus 3\p@
  1106 + \@afterindentfalse\@afterheading}
  1107 +\setattribute{firstpage} {cmd} {}
  1108 +
  1109 +% FRONT MATTER DIMENSIONS
  1110 +\setattribute{abstract} {width} {.8\textwidth}
  1111 +\setattribute{abstract} {indent} {0\p@}
  1112 +\setattribute{keyword} {width} {.8\textwidth}
  1113 +\setattribute{keyword} {indent} {0\p@} %
  1114 +\setattribute{history} {width} {.8\textwidth}
  1115 +
  1116 +% FRONT MATTER FONTS
  1117 +\setattribute{dochead} {size} {\Large\bfseries}
  1118 +\setattribute{title} {size} {\LARGE\bfseries}
  1119 +\setattribute{author} {size} {\normalsize\bfseries}
  1120 +\setattribute{fnms} {size} {}
  1121 +\setattribute{snm} {size} {}
  1122 +\setattribute{address} {size} {\footnotesize\itshape\mdseries}
  1123 +\setattribute{affiliation}{size} {\footnotesize\itshape\mdseries}
  1124 +\setattribute{dedicated} {size} {\normalsize\itshape}
  1125 +\setattribute{ead} {size} {\upshape\ttfamily}
  1126 +\setattribute{abstract} {size} {\footnotesize\upshape\mdseries}
  1127 +\setattribute{abstractname}{size} {\bfseries}
  1128 +\setattribute{keyword} {size} {\footnotesize\upshape\mdseries}
  1129 +\setattribute{keywordname}{size} {\bfseries}
  1130 +\setattribute{history} {size} {\footnotesize\mdseries}
  1131 +\setattribute{copyright} {size} {\footnotesize\raggedright}
  1132 +\setattribute{runninghead}{size} {\footnotesize\itshape}
  1133 +\setattribute{pagenumber} {size} {\footnotesize\upshape}
  1134 +\setattribute{thebibliography}{size}{\normalsize}
  1135 +
  1136 +% FRONT MATTER CASE
  1137 +\setattribute{dochead} {case} {}
  1138 +\setattribute{title} {case} {}
  1139 +\setattribute{runninghead}{case} {}
  1140 +
  1141 +% TEXT, etc.
  1142 +\setattribute{doi} {text} {\url@fmt{url: }{\ttfamily}{\paper@url}{\paper@url}}
  1143 +\setattribute{copyright} {text} {\url@fmt{}{\bfseries}{\journal@name}{\journal@url}\break%
  1144 + \@ifundefined{volume@title}{}{\textbf{\volume@title}\break}%
  1145 + \@ifnonempty{\@volume\@pubyear\@pagerange\break}%
  1146 + \@ifnonempty{\journal@issn\break}%
  1147 + \doi@text}%
  1148 +
  1149 +\setattribute{infoline} {text} {\lower12pt \hbox{\footnotesize\ttfamily\imsfmt@name\journal@id\ ver. \imsfmt@version\ file: \jobname.tex\ date: \today}}
  1150 +\setattribute{copyright} {owner} {$\copyright$~\@copyrightyear \copyrightowner@text}
  1151 +\setattribute{author} {prefix} {}
  1152 +\setattribute{keyword} {postfix} {\unskip.}
  1153 +
  1154 +\def\abstractname{Abstract}
  1155 +
  1156 +% HISTORY
  1157 +\setattribute{history} {prefix} {}
  1158 +\setattribute{history} {postfix} {.}
  1159 +\setattribute{received} {prefix} {Received~}
  1160 +\setattribute{received} {postfix} {}
  1161 +\setattribute{revised} {prefix} {; revised~}
  1162 +\setattribute{revised} {postfix} {}
  1163 +\setattribute{accepted} {prefix} {; accepted~}
  1164 +\setattribute{accepted} {postfix} {}
  1165 +
  1166 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FRONTMATTER STUFF
  1167 +
  1168 +% COUNTERS, ETC
  1169 +\newcounter{author}
  1170 +\newcounter{address}
  1171 +\newdimen\sv@mathsurround
  1172 +\def\author@num{0}
  1173 +
  1174 +% RUNNING HEAD
  1175 +\def\runtitle#1{\gdef\@runtitle{\runninghead@case{#1}}} \def\@runtitle{}
  1176 +\def\runauthor#1{{\def\etal{et al.}\gdef\@runauthor{\runninghead@case{#1}}}} \def\@runauthor{}
  1177 +
  1178 +\newdimen\sv@parindent
  1179 +\sv@parindent\parindent
  1180 +
  1181 +\newbox\fm@box
  1182 +\newdimen\fm@size
  1183 +
  1184 +\let\hy@frontmatter\relax
  1185 +\let\hy@endfrontmatter\relax
  1186 +\let\tableofcontents@fmt\relax
  1187 +
  1188 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FRONTMATTER
  1189 +
  1190 +\def\frontmatter{%
  1191 + \global\c@author\z@
  1192 + \global\c@address\z@
  1193 + \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
  1194 +%
  1195 + \if@changetoc
  1196 + \let\old@tableofcontents\tableofcontents%
  1197 + \def\tableofcontents{\let\tableofcontents@fmt\old@tableofcontents}%
  1198 + \fi
  1199 +%
  1200 + \def\pdftitle##1{\write@pdfinfo{\user@hy@title}{##1}}
  1201 + \def\pdfauthor##1{\write@pdfinfo{\user@hy@author}{##1}}
  1202 + \def\pdfsubject##1{\write@pdfinfo{\user@hy@subject}{##1}}
  1203 + \def\pdfkeywords##1{\write@pdfinfo{\user@hy@keywords}{##1}}
  1204 +%
  1205 + \if@supertoc%
  1206 + \addtocontents{toc}{\protect\contentsline{begintocitem}{}{}{}}%
  1207 + \addtocontents{toc}{\protect\contentsline{jobname}{\jobname}{}{}}
  1208 + \ifx\@doi\relax \else\addtocontents{toc}{\protect\contentsline{doi}{\@doi}{}{}}\fi%
  1209 + \ifx\@arxiv\relax \else\addtocontents{toc}{\protect\contentsline{arxiv}{\@arxiv}{}{}}\fi%
  1210 + \fi
  1211 +%
  1212 + \sv@mathsurround\mathsurround \m@th
  1213 + \parindent\z@
  1214 + \hy@frontmatter
  1215 + \global\let\maketitle\relax
  1216 + \open@fm \ignorespaces}
  1217 +%
  1218 +%
  1219 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ENDFRONTMATTER
  1220 +
  1221 +\def\endfrontmatter{%
  1222 + \global\@topnum\z@
  1223 + \set@pagerange
  1224 + \markboth{\@runauthor}{\@runtitle}%
  1225 + \thispagestyle{empty}%
  1226 +% \thispagestyle{copyright}%
  1227 +%
  1228 + \put@fmt@data%
  1229 +%
  1230 + \close@fm
  1231 +%
  1232 + \firstpage@cmd
  1233 +%
  1234 + \write@pdfinfo{\hy@author}{\the\authors@list}
  1235 + \write@pdfinfo{\hy@subject}{\journal@name\@copyrightyear\@volume\@issue\@pagerange}
  1236 + \write@pdfinfo{\hy@keywords}{\the\keywords@list}
  1237 +%
  1238 + \if@supertoc%
  1239 + \addtocontents{toc}{\protect\contentsline{author}{\the\authors@list}{\thepage}{}}%
  1240 + \addtocontents{toc}{\protect\contentsline{endtocitem}{}{}{}}%
  1241 + \fi%
  1242 +%
  1243 + \write\@mainaux{\string\gdef\string\author@num{\the\c@author}}
  1244 + \hy@endfrontmatter
  1245 + \global\mathsurround\sv@mathsurround
  1246 + \global\c@footnote\z@
  1247 + \global\let\@thanks\@empty
  1248 + \let\title\relax
  1249 + \let\author\relax
  1250 + \let\address\relax
  1251 + \let\frontmatter\relax \let\endfrontmatter\relax
  1252 + \let\@maketitle\relax \let\@@maketitle\relax
  1253 + \aftergroup\frontmatter@cmd
  1254 + }
  1255 +
  1256 +
  1257 +\def\put@fmt@data{%
  1258 + \copyright@fmt%
  1259 + \@thanks%
  1260 + \abstract@fmt%
  1261 + \keyword@fmt%
  1262 + \history@fmt
  1263 + \tableofcontents@fmt}
  1264 +
  1265 +
  1266 +\newdimen\t@xtheight
  1267 +\def\init@settings{
  1268 +\splittopskip=\topskip \splitmaxdepth=\maxdepth
  1269 +\t@xtheight\textheight \advance\t@xtheight-\splittopskip}
  1270 +
  1271 +\def\no@harm{\let\thanks=\@gobble\let\thanksref=\@gobble\let~\space\def\ead[##1]##2{}\let\\=\@empty \def\protect{\noexpand\protect\noexpand}}
  1272 +
  1273 +\def\open@fm{%
  1274 + \global\setbox\fm@box=\vbox\bgroup
  1275 + \hsize=\textwidth
  1276 + \frontmatter@style}
  1277 +
  1278 +\def\close@fm{%
  1279 + \par \egroup
  1280 + \fm@size=\dp\fm@box \advance\fm@size by \ht\fm@box
  1281 + \@whiledim\fm@size>\t@xtheight \do{%
  1282 + \global\setbox\@tempboxa=\vsplit\fm@box to \t@xtheight
  1283 + \unvbox\@tempboxa
  1284 + \fm@size=\dp\fm@box \advance\fm@size by \ht\fm@box}
  1285 + \if@twocolumn
  1286 + \emergencystretch=1pc \twocolumn[\unvbox\fm@box]
  1287 + \else
  1288 + \unvbox\fm@box
  1289 + \fi}
  1290 +
  1291 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DOCHEAD
  1292 +\def\dochead#1{%
  1293 + \bgroup
  1294 + \dochead@size
  1295 + \leavevmode\vphantom{\strut}\dochead@case{#1}\par
  1296 + \egroup
  1297 + \setattribute{title}{skip}{8\p@}}
  1298 +
  1299 +
  1300 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TITLE
  1301 +\def\title#1{%
  1302 + \vglue\title@skip%
  1303 +% check if we are in {frontmatter}
  1304 + \def\reserved@a{frontmatter}
  1305 + \ifx\reserved@a\@currenvir \else \hy@frontmatter\fi
  1306 + \bgroup%
  1307 + \no@harm%
  1308 + \let\protect\relax%
  1309 + \xdef\@argi{#1}%
  1310 + \xdef\@title{#1}%
  1311 + \egroup%
  1312 + \write@pdfinfo{\hy@title}{\@argi}
  1313 + \if@supertoc%
  1314 + \addtocontents{toc}{\protect\contentsline{title}{\@argi}{\thepage}{}}%
  1315 + \fi%
  1316 + \bgroup%
  1317 + \title@style\title@size\title@case{#1}\par%
  1318 + \egroup}
  1319 +
  1320 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ATLTITLE
  1321 +
  1322 +\def\atltitle#1{%
  1323 + \vglue\atltitle@skip%
  1324 + \bgroup
  1325 + \title@size #1\par%
  1326 + \egroup}
  1327 +
  1328 +
  1329 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AUTHOR
  1330 +
  1331 +% AUG - author block
  1332 +\def\smart@par{\ifhmode\par\fi}
  1333 +\newenvironment{aug}{}{\smart@par}
  1334 +
  1335 +
  1336 +\def\and{\unskip~and~}
  1337 +
  1338 +\def\author{\@ifnextchar[{\author@fmt}{\author@fmt[]}}
  1339 +
  1340 +\def\author@fmt[#1]#2{%
  1341 + \stepcounter{author}%
  1342 + \author@fmt@init%
  1343 + \let\author@fmt@init\relax%
  1344 + \bgroup%
  1345 + \def\degs##1{##1}\def\fnms##1{##1}\def\inits##1{##1}\def\snm##1{##1}\def\roles##1{##1}%
  1346 + \@tempcnta=\author@num\relax%
  1347 + \ifnum\c@author=\@tempcnta \def\author@sep{ and }\else \def\author@sep{, }\fi%
  1348 + \ifnum\c@author=1\addto@authors@list{#2}\else\addto@authors@list{\author@sep #2}\fi%
  1349 + \def\fnms##1{{\fnms@size{##1}}}\def\snm##1{\snm@size{##1}}%
  1350 + \noindent#2\thanksref{#1}%
  1351 + \egroup}
  1352 +
  1353 +\def\author@fmt@init{%
  1354 + \vskip\authors@skip%
  1355 + \noindent\leavevmode\author@style\author@size\author@prefix }
  1356 +
  1357 +\let\author@fmt@init@def\author@fmt@init
  1358 +
  1359 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEDICATED
  1360 +\def\dedicated#1{%
  1361 + \vskip\dedicated@skip
  1362 + \bgroup
  1363 + \dedicated@size #1\par
  1364 + \egroup}
  1365 +
  1366 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ADDRESS
  1367 +\def\address{\@ifnextchar[{\address@fmt}{\address@fmt[]}}
  1368 +
  1369 +\def\address@fmt[#1]#2{%
  1370 + \smart@par%
  1371 + \let\author@fmt@init\author@fmt@init@def
  1372 + \vskip\address@skip%
  1373 + {\address@style\address@size\leavevmode\ifx.#1.\else\usethankscounter{addressref}\thanksmark{#1}\restorethankscounter\fi#2\par}}
  1374 +
  1375 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AFFILIATION
  1376 +
  1377 +\def\affiliation{\@ifnextchar[{\affiliation@fmt}{\affiliation@fmt[]}}
  1378 +
  1379 +\def\affiliation@fmt[#1]#2{%
  1380 + \smart@par%
  1381 + \let\author@fmt@init\author@fmt@init@def%
  1382 + \vskip\affiliation@skip%
  1383 + \def\affiliation@skip{\z@}%
  1384 + \bgroup
  1385 + \affiliation@size%
  1386 + \leavevmode%
  1387 + \ifx.#1.\else\usethankscounter{addressref}\thanksmark{#1}\restorethankscounter\fi%
  1388 + #2\par
  1389 + \egroup
  1390 +}
  1391 +
  1392 +
  1393 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CONTRIBUTOR
  1394 +% For LNMS we must write as index entry:
  1395 +% \contributor{Author, F.}{University}
  1396 +% \indexentry{Author, F., \textit {Some University}}{}
  1397 +
  1398 +\let\contributor\@gobbletwo
  1399 +\if@supertoc
  1400 + \def\contributor#1#2{%
  1401 + \addtocontents{idx}{\protect\indexentry{#1, \protect\textit{#2}}{}}%
  1402 + }
  1403 +\fi
  1404 +
  1405 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COPYRIGHTOWNER
  1406 +
  1407 +\def\copyright@fmt{%
  1408 + \@ifundefined{\copyrightowner@text}{}{\safe@footnotetext{\copyright@owner}}
  1409 + }
  1410 +
  1411 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ABSTRACT
  1412 +
  1413 +\newbox\abstract@box
  1414 +
  1415 +\define@key{abstract}{language}{\set@loc@hyphenation{#1}\set@loc@abstractname{#1}}
  1416 +
  1417 +\gdef\abstract{\@ifnextchar[{\@abstract}{\@abstract[]}}
  1418 +
  1419 +\def\@abstract[#1]{%
  1420 + \setkeys{abstract}{#1}%
  1421 + \global\setbox\abstract@box=\vbox\bgroup%
  1422 + \ifvoid\abstract@box\else%
  1423 + \unvbox\abstract@box%
  1424 + \vskip\abstract@skip%
  1425 + \fi%
  1426 + \@tempdima\textwidth%
  1427 + \advance\@tempdima by-\abstract@width%
  1428 + \divide\@tempdima by2%
  1429 + \abstract@style%
  1430 + \leftskip\@tempdima\rightskip\@tempdima%
  1431 + \abstract@size%
  1432 + \parindent\sv@parindent%
  1433 + \noindent\hskip\abstract@indent{\abstractname@size\abstractname\abstractname@skip}\ignorespaces}
  1434 +
  1435 +\def\endabstract{\par\egroup}
  1436 +
  1437 +\def\abstract@fmt{%
  1438 + \ifvoid\abstract@box\else
  1439 + \vskip\abstract@skip%
  1440 + \unvbox\abstract@box
  1441 + \fi}
  1442 +
  1443 +\def\set@loc@hyphenation#1{%
  1444 + \@ifundefined{l@#1}{}{\expandafter\language\csname l@#1\endcsname}}
  1445 +
  1446 +\def\set@loc@abstractname#1{%
  1447 + \def\abstractname@english{Abstract}
  1448 + \def\abstractname@german{Zusammenfassung}
  1449 + \def\abstractname@french{R\'esum\'e}
  1450 + \def\abstractname@spanish{Resumen.}
  1451 + \@ifundefined{abstractname@#1}%
  1452 + {\@latex@error{Nera kalbos '#1` palaikymo!}{}}%
  1453 + {\edef\abstractname{\csname abstractname@#1\endcsname}}%
  1454 +}
  1455 +
  1456 +
  1457 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HISTORY: received, revised, accepted
  1458 +
  1459 +\def\history@exist{0}
  1460 +
  1461 +\def\received#1{\def\@tempa{#1}\ifx\@tempa\@empty\else\gdef\@received{#1}\gdef\history@exist{1}\fi}
  1462 + \def\@received{\@nil}
  1463 +\def\revised#1{\def\@tempa{#1}\ifx\@tempa\@empty\else\gdef\@revised{#1}\gdef\history@exist{1}\fi}
  1464 + \def\@revised{\@nil}
  1465 +\def\accepted#1{\def\@tempa{#1}\ifx\@tempa\@empty\else\gdef\@accepted{#1}\gdef\history@exist{1}\fi}
  1466 + \def\@accepted{\@nil}
  1467 +
  1468 +\def\empty@data{\@nil}
  1469 +
  1470 +\def\history@fmt{%
  1471 + \ifcase\history@exist\else%
  1472 + \bgroup
  1473 + \nobreak%
  1474 + \vskip\history@skip%
  1475 + \nobreak%
  1476 + \history@style%
  1477 + \history@size%
  1478 + \@tempdima\textwidth%
  1479 + \advance\@tempdima by-\history@width%
  1480 + \divide\@tempdima by2%
  1481 + \leftskip\@tempdima
  1482 + \rightskip\@tempdima
  1483 + \leavevmode
  1484 + \history@prefix
  1485 + \ifx\@received\empty@data \else
  1486 + \received@prefix\@received \received@postfix%
  1487 + \fi
  1488 + \ifx\@revised\empty@data \else
  1489 + \revised@prefix\@revised \revised@postfix%
  1490 + \fi
  1491 + \ifx\@accepted\empty@data \else
  1492 + \accepted@prefix\@accepted \accepted@postfix%
  1493 + \fi
  1494 + \history@postfix\par%
  1495 + \egroup%
  1496 + \gdef\history@exist{0}
  1497 +\fi
  1498 +}
  1499 +
  1500 +\def\sday#1{#1}
  1501 +\def\smonth#1{\@ifundefined{month@item@#1}%
  1502 + {\@latex@error{Nera tokio menesio, kurio numeris #1!}{??}}%
  1503 + {\getitemvalue{month}{#1}}%
  1504 + }%
  1505 +\def\syear#1{#1}
  1506 +\setvaluelist{month}{January,February,March,April,May,June,July,August,September,October,November,December}
  1507 +
  1508 +
  1509 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KEYWORDS
  1510 +
  1511 +\newbox\keyword@box
  1512 +\newdimen\pre@kwd@depth
  1513 +
  1514 +\setattribute{keyword}{AMS}{AMS 2000 subject classifications:}
  1515 +\setattribute{keyword}{KWD}{Keywords and phrases:}
  1516 +% raktas=class
  1517 +\setattribute[default]{keyword}{class}{KWD}
  1518 +
  1519 +% \keyword@class-> KWD
  1520 +% \keyword@KWD -> AMS 2000...
  1521 +
  1522 +\gdef\keyword{\@ifnextchar[{\@keyword}{\@keyword[class=KWD]}}
  1523 +
  1524 +\gdef\@keyword[#1]{%
  1525 + \do@option@list{keyword}{#1}%
  1526 + \def\keyword@name{\csname keyword@\keyword@class\endcsname}%
  1527 + \let\kwd@sep\relax
  1528 +%
  1529 + \global\setbox\keyword@box=\vbox\bgroup%
  1530 + \ifvoid\keyword@box\else%
  1531 + \unvbox\keyword@box
  1532 + \vskip-\pre@kwd@depth\vtop to\pre@kwd@depth{}%
  1533 + \fi
  1534 + \@tempdima\textwidth%
  1535 + \advance\@tempdima by-\keyword@width%
  1536 + \divide\@tempdima by2%
  1537 + \keyword@style%
  1538 + \leftskip\@tempdima\rightskip\@tempdima%
  1539 + \keyword@size%
  1540 + \parindent\sv@parindent%
  1541 + \noindent\hskip\keyword@indent{\keywordname@size\keyword@name}\space\hskip.1pt}
  1542 +
  1543 +\def\endkeyword{\keyword@postfix\par\global\pre@kwd@depth\prevdepth\egroup}
  1544 +
  1545 +\def\keyword@fmt{%
  1546 + \ifvoid\keyword@box\else
  1547 + \vskip\keyword@skip%
  1548 + \unvbox\keyword@box
  1549 + \fi}
  1550 +
  1551 +
  1552 +% \kwd[; ]{foo}
  1553 + \def\sep{\unskip\string, }%
  1554 +
  1555 + \DeclareRobustCommand*\kwd{\@ifnextchar[\@kwd{\@kwd[\kwd@sep]}}%
  1556 + \def\@kwd[#1]#2{\unskip#1{#2}\addto@keywords@list{#2, }\let\kwd@sep\sep}%
  1557 +
  1558 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \maketitle
  1559 +% if \frontmatter is not used, we will redefine \maketitle
  1560 +
  1561 +\def\local@maketitle{%
  1562 + \global\@topnum\z@
  1563 + \set@pagerange
  1564 + \markboth{\@runauthor}{\@runtitle}%
  1565 + \thispagestyle{copyright}%
  1566 +%
  1567 + \put@fmt@data%
  1568 +%
  1569 +% \print@titlepage
  1570 +%
  1571 + \write@pdfinfo{\hy@author}{\the\authors@list}
  1572 + \write@pdfinfo{\hy@keywords}{\the\keywords@list}
  1573 + \hy@endfrontmatter
  1574 + \global\mathsurround\sv@mathsurround
  1575 + \global\c@footnote\z@
  1576 + \global\let\@thanks\@empty
  1577 + \let\title\relax
  1578 + \let\author\relax
  1579 + \let\address\relax
  1580 + \let\frontmatter\relax \let\endfrontmatter\relax
  1581 + \let\@maketitle\relax \let\@@maketitle\relax
  1582 + \normalfont\normaltext
  1583 + \parindent\sv@parindent
  1584 + \frontmatter@cmd
  1585 + }
  1586 +
  1587 +\AtBeginDocument{\let\maketitle\local@maketitle}
  1588 +
  1589 +
  1590 +
  1591 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PROCESS LAYOUT OPTIONS
  1592 +
  1593 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Put keywords as footnote
  1594 +\if@keywordsasfootnote
  1595 +
  1596 + \newtoks\keyword@toks
  1597 +
  1598 + \newpseudoenvironment{keyword}{\gdef\keyword@exist{1}\get@keyword@toks}{}
  1599 +
  1600 + \def\get@keyword@toks#1\end{\keyword@toks=\expandafter{\the\keyword@toks\keyword#1\endkeyword}\@gobble}
  1601 +
  1602 + \def\keyword@exist{0}
  1603 +
  1604 + \gdef\keyword#1{\@ifnextchar[{\@keyword}{\@keyword[class=KWD]}}
  1605 +
  1606 + \gdef\@keyword[#1]{%
  1607 + \do@option@list{keyword}{#1}%
  1608 + \def\keyword@name{\csname keyword@\keyword@class\endcsname}%
  1609 + \let\kwd@sep\relax%
  1610 + \keyword@style%
  1611 + \keyword@size%
  1612 + \parindent\sv@parindent%
  1613 + \pre@kwd%
  1614 + \hbox{\keywordname@size\keyword@name}\space\hskip.1pt}%
  1615 +
  1616 + \gdef\endkeyword{\gdef\pre@kwd{\par\leavevmode}}
  1617 +
  1618 + \let\pre@kwd\relax
  1619 +
  1620 + \def\keyword@fmt{\ifcase\keyword@exist\else\safe@footnotetext{\the\keyword@toks}\fi}
  1621 +
  1622 +\fi
  1623 +
  1624 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Put history as footnote
  1625 +\if@historyasfootnote
  1626 +
  1627 + \def\history@fmt{%
  1628 + \ifcase\history@exist\else%
  1629 + \safe@footnotetext{%
  1630 + \nobreak%
  1631 + \history@style%
  1632 + \history@size%
  1633 + \leavevmode
  1634 + \history@prefix
  1635 + \ifx\@received\empty@data \else
  1636 + \received@prefix\@received \received@postfix%
  1637 + \fi
  1638 + \ifx\@revised\empty@data \else
  1639 + \revised@prefix\@revised \revised@postfix%
  1640 + \fi
  1641 + \ifx\@accepted\empty@data \else
  1642 + \accepted@prefix\@accepted \accepted@postfix%
  1643 + \fi
  1644 + \history@postfix}%\par}%
  1645 + \fi}
  1646 +
  1647 +
  1648 +
  1649 +
  1650 +
  1651 +\fi
  1652 +
  1653 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Put address as footnote
  1654 +\if@addressasfootnote
  1655 + \def\address@fmt[#1]#2{%
  1656 + \ifx.#1.%
  1657 + \safe@footnotetext{#2}
  1658 + \else%
  1659 + \usethankscounter{addressref}%
  1660 + \bgroup
  1661 + \def\\{\hfill\break}
  1662 + \thankstext{#1}{#2}%
  1663 + \egroup
  1664 + \restorethankscounter%
  1665 + \fi%
  1666 + }
  1667 +\fi
  1668 +
  1669 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Put address at end
  1670 +\if@addressatend
  1671 +\def\address{\@ifnextchar[{\address@fmt}{\address@fmt[default]}}
  1672 +%
  1673 +% \def\address@ref@A=1
  1674 +% \newtoks\@address@1
  1675 +% \@address@1={#2}
  1676 +%
  1677 +\def\address@fmt[#1]#2{%
  1678 + \stepcounter{address}%
  1679 + \expandafter\protected@xdef\csname address@ref@#1\endcsname{\the\c@address}%
  1680 + \expandafter\newtoks\csname @address@\the\c@address\endcsname
  1681 + \expandafter\expandafter\expandafter\global\csname @address@\the\c@address\endcsname={#2}}
  1682 +
  1683 +\let\safe@phantomsection\@gobble
  1684 +
  1685 +% print address by number: \printaddressnum{1}
  1686 +\def\printaddressnum#1{%
  1687 +\xdef\@tmp{#1}%
  1688 +\bgroup
  1689 +\@ifundefined{@address@#1}{\@latex@error{Error: there are no address with number '#1'!}{??}}{
  1690 + \address@size
  1691 + \ifnum#1=1%
  1692 + \safe@phantomsection{\addcontentsline{toc}{section}{Author's addresses}}%
  1693 + \fi%
  1694 + \begin{tabular}[t]{@{}l@{}}
  1695 + \expandafter\expandafter\expandafter\the\csname @address@\@tmp\endcsname
  1696 + \end{tabular}}
  1697 +\egroup
  1698 +}
  1699 +
  1700 +% print all addresses:
  1701 +\def\address@par{\par\vskip3pt}
  1702 +
  1703 +\def\printaddresses{%
  1704 +\vskip\address@skip%
  1705 +%\addcontentsline{toc}{section}{Author's addresses}%
  1706 +\def\last@right@glue{\par}%
  1707 +\ifodd\c@address \def\last@right@glue{\hfill\hbox{}\address@par} \fi%
  1708 +\ifnum\c@address=1 \def\last@right@glue{\address@par}\fi%
  1709 +\@tempcnta=0%
  1710 +\bgroup\parindent\z@
  1711 +\@whilenum{\@tempcnta<\c@address}%
  1712 + \do{%
  1713 + \advance\@tempcnta\@ne
  1714 + \ifodd\@tempcnta \def\left@glue{} \def\right@glue{} % nelyginis
  1715 + \else \def\left@glue{\hfill} \def\right@glue{\address@par}\fi % lyginis
  1716 + \ifnum\@tempcnta=\c@address \let\left@glue\hfill \let\right@glue\last@right@glue\fi %paskutinis narys
  1717 + \left@glue\expandafter\printaddressnum{\the\@tempcnta}\right@glue%
  1718 + }
  1719 +\egroup
  1720 +}
  1721 +
  1722 +% invoke \printaddresses at end of document:
  1723 +\let\old@enddocument\enddocument
  1724 +\def\enddocument{\printaddresses\old@enddocument}
  1725 +
  1726 +\fi
  1727 +
  1728 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Set up parameters for the IMS journals (AOP, AAP, AOS) layout:
  1729 +\if@imslayout
  1730 +
  1731 + \setattribute{title} {skip} {12\p@}
  1732 + \setattribute{abstractname}{skip} {}
  1733 + \setattribute{frontmatter} {cmd} {\vskip20\p@ plus 3\p@ minus 3\p@}
  1734 +
  1735 + \setattribute{abstract} {width} {23pc}
  1736 + \setattribute{abstract} {indent} {16pt} %2em
  1737 +
  1738 + \setattribute{title} {size} {\normalsize\bfseries\mathversion{bold}\spaceskip.5em}
  1739 + \setattribute{author} {size} {\normalsize\scshape}
  1740 + \setattribute{affiliation}{size} {\normalsize\itshape}
  1741 + \setattribute{address} {size} {\scriptsize\scshape}
  1742 + \setattribute{ead} {size} {\upshape}
  1743 + \setattribute{abstractname}{size}{\itshape}
  1744 + \setattribute{keywordname}{size} {\itshape}
  1745 + \setattribute{runninghead}{size} {\footnotesize}
  1746 + \setattribute{pagenumber} {size} {\small}
  1747 + \setattribute{copyright} {size} {\fontsize{6}{7}\selectfont\raggedright}
  1748 + \setattribute{thebibliography}{size}{\footnotesize}
  1749 +
  1750 + \setattribute{dochead} {case} {\MakeUppercase}
  1751 + \setattribute{title} {case} {\MakeUppercase}
  1752 + \setattribute{runninghead}{case} {\MakeUppercase}
  1753 +
  1754 + \setattribute{author} {prefix} {By~}
  1755 +
  1756 + \setattribute{copyright} {text} {\url@fmt{}{\itshape}{\journal@name}{\journal@url}\break%
  1757 + \@ifnonempty{\@copyrightyear\@volume\@issue\@pagerange\break}%
  1758 + \doi@text}
  1759 +
  1760 + \setattribute{email} {text} {E-mail: }
  1761 + \setattribute{url} {text} {URL: }
  1762 + \setattribute{fullurl} {text} {URL: }
  1763 + \def\volume#1{\gdef\@volume{Vol. #1, }}
  1764 + \def\issue#1 {\gdef\@issue{No. #1, }}
  1765 + \def\pubyear#1{\gdef\@pubyear{#1,}\gdef\@copyrightyear{#1 }}
  1766 +
  1767 + \def\abstractname{}
  1768 +
  1769 + \def\put@fmt@data{%
  1770 + \copyright@fmt%
  1771 + \history@fmt
  1772 + \@thanks%
  1773 + \keyword@fmt%
  1774 + \abstract@fmt%
  1775 + }
  1776 +
  1777 + \def\contentsname@cmd{\specialsection*{\contentsname}}
  1778 +
  1779 +\fi
  1780 +
  1781 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Set up parameters for the STS journal layout:
  1782 +
  1783 +\if@stslayout
  1784 +
  1785 + \setattribute{frontmatter} {style} {\raggedright}
  1786 + \setattribute{title} {style} {\noindent\raggedright}
  1787 + \setattribute{author} {style} {\noindent\raggedright}
  1788 + \setattribute{address} {style} {\raggedright}
  1789 +
  1790 + \setattribute{title} {skip} {6\p@}
  1791 + \setattribute{authors} {skip} {10pt}
  1792 + \setattribute{address} {skip} {\z@}
  1793 + \setattribute{abstract} {skip} {36\p@}
  1794 + \setattribute{abstractname}{skip} {. }
  1795 + \setattribute{keyword} {skip} {8\p@}
  1796 +
  1797 + \setattribute{abstract} {width} {28pc}
  1798 + \setattribute{keyword} {width} {28pc}
  1799 +
  1800 + \setattribute{dochead} {size} {\sffamily\Large\fontseries{bx}\selectfont\spaceskip.5em}
  1801 + \setattribute{title} {size} {\sffamily\fontseries{bx}\fontsize{24.88}{26}\selectfont\mathversion{bold}\spaceskip.5em}
  1802 + \setattribute{author} {size} {\sffamily\large\fontseries{bx}\selectfont}
  1803 + \setattribute{address} {size} {\normalfont\normalsize\itshape}
  1804 + \setattribute{affiliation} {size} {\small\mdseries}
  1805 + \setattribute{ead} {size} {}
  1806 + \setattribute{abstract} {size} {\normalsize\mdseries\upshape}
  1807 + \setattribute{abstractname} {size} {\itshape}
  1808 + \setattribute{keyword} {size} {\normalsize\mdseries\upshape}
  1809 + \setattribute{keywordname} {size} {\itshape}
  1810 + \setattribute{thebibliography}{size} {\footnotesize}
  1811 + \setattribute{copyright} {size} {\normalfont\mdseries\fontsize{6}{7}\selectfont\raggedright}
  1812 + \setattribute{runninghead} {size} {\footnotesize}
  1813 + \setattribute{runninghead} {case} {\MakeUppercase}
  1814 + \setattribute{pagenumber} {size} {\small\bfseries}
  1815 +
  1816 + \setattribute{keyword} {KWD}{Key words and phrases:}
  1817 +
  1818 +% \printead:
  1819 + \def\printead@fmt#1{(#1)}
  1820 +
  1821 +% all addresses are combined:
  1822 + \newtoks\address@toks
  1823 +
  1824 + \def\address@exist{0}
  1825 +
  1826 + \def\address{\@ifnextchar[{\@address}{\@address[]}}
  1827 +
  1828 + \def\@address[#1]#2{
  1829 + \gdef\address@exist{1}
  1830 + \begingroup%
  1831 + \no@harm%
  1832 + \xdef\@act{\global\noexpand\address@toks{\the\address@toks#2\ }}\@act
  1833 + \endgroup}
  1834 +
  1835 + \def\address@fmt{\ifcase\address@exist\else\safe@footnotetext{\hskip-\parindent\address@style\address@size\the\address@toks}\fi}
  1836 +
  1837 + \def\put@fmt@data{%
  1838 + \copyright@fmt%
  1839 + \address@fmt%
  1840 + \@thanks%
  1841 + \abstract@fmt%
  1842 + \keyword@fmt%
  1843 + \if@twocolumn%
  1844 + \frontmatter@cmd%
  1845 + \fi}
  1846 +
  1847 + \def\firstpage@cmd{%
  1848 + \if@twocolumn
  1849 + \markboth{\@runauthor}{\@runtitle}%
  1850 + \address@fmt%
  1851 + \@thanks
  1852 + \fi}
  1853 +
  1854 +\fi
  1855 +
  1856 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Set up parameters for the BJ journal layout:
  1857 +
  1858 +\if@bjlayout
  1859 +
  1860 + \setattribute{frontmatter} {style} {\raggedright}
  1861 + \setattribute{title} {style} {\noindent\raggedright}
  1862 + \setattribute{author} {style} {\noindent\raggedright}
  1863 + \setattribute{address} {style} {\raggedright}
  1864 +
  1865 + \setattribute{title} {skip} {10\p@}
  1866 + \setattribute{abstract} {skip} {16\p@}
  1867 + \setattribute{abstractname}{skip} {}
  1868 +
  1869 + \setattribute{abstract} {width} {\textwidth}
  1870 + \setattribute{keyword} {width} {\textwidth}
  1871 + \setattribute{history} {width} {\textwidth}
  1872 +
  1873 + \setattribute{dochead} {size} {\normalsize\MakeUppercase}
  1874 + \setattribute{title} {size} {\fontsize{21}{26}\selectfont}
  1875 + \setattribute{author} {size} {\normalsize}
  1876 + \setattribute{fnms} {size} {\uppercase}
  1877 + \setattribute{snm} {size} {\uppercase}
  1878 +
  1879 + \setattribute{address} {size} {\small\itshape}
  1880 + \setattribute{abstract} {size} {\small\upshape}
  1881 + \setattribute{keyword} {size} {\small\upshape}
  1882 + \setattribute{keywordname}{size} {\itshape}
  1883 + \setattribute{history} {size} {\raggedright\small\itshape}
  1884 +
  1885 + \setattribute{runninghead}{size} {\normalsize\itshape}
  1886 + \setattribute{pagenumber} {size} {\normalsize\upshape}
  1887 + \setattribute{copyright} {size} {\normalsize}
  1888 + \setattribute{footline} {size} {\footnotesize}
  1889 +
  1890 + \setattribute{email} {text} {E-mail:~}
  1891 + \setattribute{copyright} {text} {\url@fmt{}{\itshape}{\journal@name}{\journal@url}\ \textbf{\@volume}\@issue\@pubyear\ \@pagerange\\
  1892 + \doi@text}
  1893 + \setattribute{history} {postfix} {}
  1894 + \setattribute{revised} {prefix} { and revised~}
  1895 +
  1896 + \setattribute{keyword}{KWD}{Keywords:}
  1897 +
  1898 + \def\put@fmt@data{%
  1899 + \copyright@fmt%
  1900 + \@thanks%
  1901 + \abstract@fmt%
  1902 + \keyword@fmt%
  1903 + \tableofcontents@fmt}
  1904 +
  1905 + % invoke \printhistory at end of document:
  1906 + \let\old@enddocument\enddocument
  1907 + \def\enddocument{\history@fmt\old@enddocument}
  1908 +
  1909 + \def\volume#1{\gdef\@volume{#1}}
  1910 + \def\issue#1{\gdef\@issue{(#1)}}
  1911 + \def\pubyear#1{\gdef\@pubyear{, #1, }\gdef\@copyrightyear{, #1, }}
  1912 +
  1913 + \def\abstractname{}
  1914 +
  1915 + \def\evenhead@fmt#1{\hfill#1}
  1916 + \def\oddhead@fmt#1{#1\hfill}
  1917 +
  1918 + \def\fnum@table{\tablename~\thetable.}
  1919 +
  1920 + \long\def\@maketablecaption#1#2{%
  1921 + \centering\footnotesize
  1922 + \textbf{#1}\enskip #2\par
  1923 + \vskip\belowcaptionskip}
  1924 +
  1925 + \renewcommand\figurename{Figure}
  1926 +
  1927 + \long\def\@makecaption#1#2{%
  1928 + \vskip\abovecaptionskip
  1929 + \footnotesize
  1930 + \textbf{#1}. #2\par
  1931 + \vskip\belowcaptionskip}
  1932 +
  1933 +
  1934 +\fi
  1935 +
  1936 +
  1937 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Set up parameters for the AIHP journal layout:
  1938 +
  1939 +\if@aihplayout
  1940 +
  1941 + % FRONT MATTER SKIPS
  1942 + \setattribute{title} {skip} {64\p@}
  1943 + \setattribute{authors} {skip} {14\p@}
  1944 + \setattribute{address} {skip} {12\p@}
  1945 + \setattribute{abstractname}{skip} {.\enskip}
  1946 + \setattribute{history} {skip} {4\p@}
  1947 + \setattribute{abstract} {skip} {16\p@}
  1948 +
  1949 + \setattribute{fline} {cmd} {\vskip22\p@
  1950 + \hrule}
  1951 + \setattribute{lline} {cmd} {\vskip10\p@
  1952 + \hrule}
  1953 +
  1954 + % FRONT MATTER DIMENSIONS
  1955 + \setattribute{abstract} {width} {\textwidth}
  1956 + \setattribute{abstract} {indent} {\z@}
  1957 + \setattribute{keyword} {width} {\textwidth}
  1958 + \setattribute{keyword} {indent} {\z@} %
  1959 +
  1960 + % FRONT MATTER FONTS
  1961 + \setattribute{title} {size} {\huge}
  1962 + \setattribute{author} {size} {\Large}
  1963 + \setattribute{abstract} {size} {\small\upshape}
  1964 + \setattribute{keywordname}{size} {\itshape}
  1965 + \setattribute{thebibliography}{size}{\footnotesize}
  1966 +
  1967 + \def\put@fmt@data{%
  1968 + \copyright@fmt%
  1969 + \@thanks%
  1970 + \history@fmt
  1971 + \fline@cmd%
  1972 + \abstract@fmt%
  1973 + \keyword@fmt%
  1974 + \lline@cmd%
  1975 + \tableofcontents@fmt}
  1976 +
  1977 + \setattribute{keyword}{KWD}{Keywords:}
  1978 + \setattribute{email}{text}{E-mail: }
  1979 +
  1980 + \def\theaddressref{\alph{addressref}}
  1981 +
  1982 +\fi
  1983 +
  1984 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Set up parameters for the BJPS journal layout:
  1985 +
  1986 +\if@bjpslayout
  1987 +
  1988 + \setattribute{keyword}{AMS}{AMS 2000 subject classifications.}
  1989 + \setattribute{keyword}{KWD}{Keywords and phrases.}
  1990 +
  1991 + \setattribute{abstractname}{skip} {.\enskip}
  1992 +
  1993 + \setattribute{title} {size} {\Large\bfseries\mathversion{bold}}
  1994 + \setattribute{address} {size} {\scriptsize}
  1995 + \setattribute{keywordname}{size} {\itshape}
  1996 + \setattribute{runninghead}{size} {\footnotesize}
  1997 + \setattribute{pagenumber} {size} {\small}
  1998 + \setattribute{thebibliography}{size}{\footnotesize}
  1999 +
  2000 + \setattribute{copyright} {text} {\url@fmt{}{\itshape}{\journal@name}{\journal@url}\break%
  2001 + \@ifnonempty{\@volume\@pubyear\@pagerange\break}%
  2002 + \@ifnonempty{\journal@issn\break}%
  2003 + \doi@text}%
  2004 +
  2005 + \setattribute{email} {text}{E-mail: }
  2006 + \setattribute{url} {text}{URL: }
  2007 + \setattribute{fullurl}{text}{URL: }
  2008 +
  2009 + \def\thethanks{\@arabic\c@thanks}
  2010 + \def\theaddressref{\alph{addressref}}
  2011 +
  2012 +\fi
  2013 +
  2014 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% smart \MR
  2015 +%% code suggested by Vilmos Prokaj <prokaj@cs.elte.hu>
  2016 +%% solves the problem when MR is in a format
  2017 +%% \MR{MR1037262 (91i:60148)}
  2018 +
  2019 +% without MR this macro removes the MR prefix if it
  2020 +% is present unchange the argument otherwise
  2021 +\def\woMR#1{\w@MR#1MR#1MR\relax}%
  2022 +\def\w@MR#1MR#2MR#3\relax{#2}
  2023 +
  2024 +% this splits MR... (...)
  2025 +\def\@MR#1 #2\relax#3{%
  2026 + \href{http://www.ams.org/mathscinet-getitem?mr=#1}%
  2027 + {\MRfixed{#3}}}%
  2028 +
  2029 +\def\MRfixed{MR\woMR}%
  2030 +
  2031 +\let\MR\MRfixed
  2032 +
  2033 +
  2034 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% interaction with hyperref
  2035 +
  2036 +\def\test@hyperref{\@ifundefined{Hy@SetCatcodes}{}{\imsart@hyperref@settings}}
  2037 +
  2038 +\AtBeginDocument{\test@hyperref}
  2039 +
  2040 +\def\imsart@hyperref@settings{%
  2041 +%
  2042 +% hooks for the \thanksref, \thankstext:
  2043 + \def\thankref@hyperlink##1{%
  2044 + \edef\@tempx{##1thanks}%
  2045 + \hbox{\hyperlink{##1}{\saferef{\@tempx}}}}
  2046 + \def\thanks@hypertarget##1{\smash{\raise\baselineskip\hbox{\protect\hypertarget{##1}{}}}}
  2047 +% redefine pagenumbering
  2048 + \let\pagenumbering\ims@pagenumbering
  2049 +% activate href
  2050 + \let\ims@href\href%
  2051 + \let\safe@phantomsection\phantomsection
  2052 +% put document info
  2053 + \def\write@pdfinfo##1##2{\protected@write\@auxout{\no@harm}{\string\gdef\string##1{##2}}}
  2054 + \@ifundefined{hy@title}{}{\pdfstringdef\@pdftitle{\hy@title}}
  2055 + \@ifundefined{hy@author}{}{\pdfstringdef\@pdfauthor{\hy@author}}
  2056 + \@ifundefined{hy@subject}{}{\pdfstringdef\@pdfsubject{\hy@subject}}
  2057 + \@ifundefined{hy@keywords}{}{\pdfstringdef\@pdfkeywords{\hy@keywords}}
  2058 +%
  2059 + \@ifundefined{user@hy@title}{}{\global\let\@pdftitle\user@hy@title}
  2060 + \@ifundefined{user@hy@author}{}{\global\let\@pdfauthor\user@hy@author}
  2061 + \@ifundefined{user@hy@subject}{}{\global\let\@pdfsubject\user@hy@subject}
  2062 + \@ifundefined{user@hy@keywords}{}{\global\let\@pdfkeywords\user@hy@keywords}
  2063 +%
  2064 +% MathSciNet:
  2065 +% \def\MR##1{\href{http://www.ams.org/mathscinet-getitem?mr=##1}{MR##1}}
  2066 +
  2067 + %% MR with hyperef
  2068 + \def\MR##1{\@MR##1 \relax{##1}}%
  2069 +
  2070 +
  2071 +% \@ifundefined{Hy@SetCatcodes}{\let\MR\MRfixed}{\relax}%
  2072 +
  2073 +}
  2074 +
  2075 +\def\write@pdfinfo#1#2{}
  2076 +
  2077 +\newtoks\authors@list
  2078 +\def\addto@authors@list#1{%
  2079 + \begingroup%
  2080 + \no@harm%
  2081 + \xdef\@act{\global\noexpand\authors@list{\the\authors@list#1}}\@act%
  2082 + \endgroup}
  2083 +
  2084 +\newtoks\keywords@list
  2085 +\def\addto@keywords@list#1{%
  2086 + \begingroup%
  2087 + \no@harm%
  2088 + \xdef\@act{\global\noexpand\keywords@list{\the\keywords@list#1}}\@act%
  2089 + \endgroup}
  2090 +
  2091 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION, SUBSECTION ETC.
  2092 +% we do not like article appearance:
  2093 +
  2094 +\renewcommand\section{\@startsection {section}{1}{\z@}%
  2095 + {-\bigskipamount}%
  2096 + {\medskipamount}%
  2097 + {\raggedright\bfseries\mathversion{bold}}}
  2098 +
  2099 +\renewcommand\subsection{\@startsection {subsection}{2}{\z@}%
  2100 + {-\bigskipamount}%
  2101 + {\medskipamount}%
  2102 + {\raggedright\bfseries\itshape\mathversion{bold}}}
  2103 +
  2104 +\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
  2105 + {-\bigskipamount}%
  2106 + {\medskipamount}%
  2107 + {\raggedright\itshape}}
  2108 +
  2109 +\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
  2110 + {\medskipamount}%
  2111 + {-1em}%
  2112 + {\bfseries}}
  2113 +
  2114 +\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}%
  2115 + {\medskipamount}%
  2116 + {-1em}%
  2117 + {\itshape}}
  2118 +
  2119 +
  2120 +% Format for the counter:
  2121 +\def\section@numbersep{.}
  2122 +\def\subsection@numbersep{.}
  2123 +\def\subsubsection@numbersep{.}
  2124 +\def\paragraph@numbersep{.}
  2125 +\def\subparagraph@numbersep{.}
  2126 +
  2127 +\def\@seccntformat#1{{\csname #1@prefix\endcsname\csname the#1\endcsname\csname#1@numbersep\endcsname\enspace}}
  2128 +
  2129 +
  2130 +\let\specialsection\section
  2131 +
  2132 +\@namedef{specialsection*}{\section*}
  2133 +
  2134 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sections: bjpslayout
  2135 +
  2136 +\if@bjpslayout
  2137 +
  2138 + \renewcommand\section{\@startsection {section}{1}{\z@}%
  2139 + {-\bigskipamount}%
  2140 + {\medskipamount}%
  2141 + {\large\bfseries\mathversion{bold}\raggedright}}
  2142 +
  2143 + \renewcommand\subsection{\@startsection {subsection}{2}{\z@}%
  2144 + {-\medskipamount}%
  2145 + {\smallskipamount}%
  2146 + {\bfseries\mathversion{bold}\raggedright}}
  2147 +
  2148 + \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
  2149 + {\medskipamount}%
  2150 + {-10pt}%
  2151 + {\normalsize\itshape}}
  2152 +
  2153 + \def\subsubsection@prefix{\upshape}
  2154 +
  2155 + \def\section@numbersep{}
  2156 + \def\subsection@numbersep{}
  2157 + \def\subsubsection@numbersep{}
  2158 + \def\paragraph@numbersep{}
  2159 + \def\subparagraph@numbersep{}
  2160 +\fi
  2161 +
  2162 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sections: IMS layout
  2163 +
  2164 +\if@imslayout
  2165 + \renewcommand\section{\@startsection {section}{1}{\parindent}%
  2166 + {\medskipamount}%
  2167 + {-10pt}%
  2168 + {\normalsize\upshape\bfseries\mathversion{bold}}}
  2169 +
  2170 + \renewcommand\subsection{\@startsection {subsection}{2}{\parindent}%
  2171 + {\medskipamount}%
  2172 + {-10pt}%
  2173 + {\subsection@shape}}
  2174 + \def\subsection@shape{\normalsize\itshape}
  2175 + \def\subsection@prefix{\upshape}
  2176 +
  2177 + \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\parindent}%
  2178 + {\medskipamount}%
  2179 + {-10pt}%
  2180 + {\normalsize\itshape}}
  2181 + \def\subsubsection@prefix{\upshape}
  2182 +
  2183 + \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
  2184 + {\smallskipamount}%
  2185 + {-1em}%
  2186 + {\normalsize\itshape}}
  2187 + \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}%
  2188 + {0.1pt}%
  2189 + {-1em}%
  2190 + {\normalsize\itshape}}
  2191 +
  2192 +% must be used for the appendix \section and \thebibliography
  2193 + \renewcommand\specialsection{\@startsection {section}{1}{\z@}%
  2194 + {\medskipamount}%
  2195 + {\smallskipamount}%
  2196 + {\normalsize\centering\MakeUppercase}}
  2197 +
  2198 +\fi
  2199 +
  2200 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sections: STS layout
  2201 +
  2202 +\if@stslayout
  2203 +
  2204 + \def\sec@raggedright{%
  2205 + \def\\{\hfill\break}\@rightskip\@flushglue \rightskip\@rightskip
  2206 + \leftskip\z@skip
  2207 + \parindent\z@}
  2208 +
  2209 +% last line will centered to page width
  2210 +
  2211 + \def\fl@hangfrom#1{\noindent {#1}}
  2212 + \def\TO@fl{\let\@hangfrom\fl@hangfrom}
  2213 +
  2214 +
  2215 + \renewcommand\section{\@startsection {section}{1}{\z@}%
  2216 + {\medskipamount}%
  2217 + {\smallskipamount}%
  2218 + {\centering\TO@fl\normalsize\sffamily\fontseries{bx}\selectfont\mathversion{bold}\MakeUppercase}}
  2219 +
  2220 + \renewcommand\subsection{\@startsection {subsection}{2}{\z@}%
  2221 + {\smallskipamount}%
  2222 + {\smallskipamount}%
  2223 + {\normalsize\sffamily\fontseries{bx}\selectfont\mathversion{bold}\sec@raggedright}}
  2224 +
  2225 + \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\parindent}%
  2226 + {\smallskipamount}%
  2227 + {-.5em}%
  2228 + {\normalsize\itshape}}
  2229 +
  2230 + \renewcommand\paragraph{\@startsection{paragraph}{4}{\parindent}%
  2231 + {\z@}%
  2232 + {-4pt}%
  2233 + {\normalsize\itshape}}
  2234 +
  2235 + \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}%
  2236 + {0.1pt}%
  2237 + {-1em}%
  2238 + {\normalsize\itshape}}
  2239 +
  2240 +% must be used for the \thebibliography
  2241 + \newcommand\specialsection{\@startsection {section}{1}{\z@}%
  2242 + {\bigskipamount}%
  2243 + {\smallskipamount}%
  2244 + {\normalsize\centering\MakeUppercase}}
  2245 +
  2246 +% Format for the counter:
  2247 + \def\section@numbersep{.}
  2248 + \def\subsection@numbersep{}
  2249 + \def\subsubsection@numbersep{}
  2250 + \def\paragraph@numbersep{}
  2251 + \def\subparagraph@numbersep{}
  2252 +
  2253 +\fi
  2254 +
  2255 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sections: BJ layout
  2256 +
  2257 +\if@bjlayout
  2258 +
  2259 + \renewcommand\section{\@startsection {section}{1}{\z@}%
  2260 + {-\bigskipamount}%
  2261 + {\medskipamount}%
  2262 + {\Large\bfseries\mathversion{bold}\raggedright}}
  2263 +
  2264 + \renewcommand\subsection{\@startsection {subsection}{2}{\z@}%
  2265 + {-\bigskipamount}%
  2266 + {\medskipamount}%
  2267 + {\large\bfseries\mathversion{bold}\raggedright}}
  2268 +
  2269 + \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
  2270 + {-\medskipamount}%
  2271 + {\smallskipamount}%
  2272 + {\itshape\raggedright}}
  2273 +
  2274 +\fi
  2275 +
  2276 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sections: AIHP layout
  2277 +
  2278 +\if@aihplayout
  2279 +
  2280 + \renewcommand\subsection{\@startsection {subsection}{2}{\z@}%
  2281 + {-\medskipamount}%
  2282 + {\medskipamount}%
  2283 + {\itshape\raggedright}}
  2284 +
  2285 + \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
  2286 + {-\medskipamount}%
  2287 + {.01\p@}%
  2288 + {\itshape\raggedright}}
  2289 +
  2290 + \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
  2291 + {\medskipamount}%
  2292 + {-10pt}%
  2293 + {\itshape}}
  2294 +
  2295 + \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
  2296 + {0.1pt}%
  2297 + {-1em}%
  2298 + {\itshape}}
  2299 +
  2300 +\fi
  2301 +
  2302 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% loading of amsmath
  2303 +
  2304 +\def\set@amsthm{
  2305 + \def\ims@thmshape{0}
  2306 + \if@imslayout \def\ims@thmshape{1}\fi
  2307 + \if@stslayout \def\ims@thmshape{1}\fi
  2308 + \if@bjlayout \def\ims@thmshape{2}\fi
  2309 + \if@aihplayout \def\ims@thmshape{3}\fi
  2310 + \if@bjpslayout \def\ims@thmshape{3}\fi
  2311 +
  2312 + \ifcase\ims@thmshape
  2313 + \or %1
  2314 + \thm@notefont{\upshape}
  2315 + \newtheoremstyle{plain} {\medskipamount}{\medskipamount}{\itshape}{\parindent}{\scshape}{.}{1em}{}
  2316 + \newtheoremstyle{definition}{\medskipamount}{\medskipamount}{\normalfont}{\parindent}{\scshape}{.}{1em}{}
  2317 + \newtheoremstyle{remark} {\medskipamount}{\medskipamount}{\normalfont}{\parindent}{\scshape}{.}{1em}{}
  2318 +
  2319 + \renewenvironment{proof}[1][\proofname]{\par
  2320 + \pushQED{\qed}%
  2321 + \normalfont \topsep\medskipamount%
  2322 + \trivlist
  2323 + \labelsep.5em%
  2324 + \item[\hskip\labelsep\hskip\parindent
  2325 + \scshape ##1\@addpunct{.}]\ignorespaces
  2326 + }{%
  2327 + \popQED\endtrivlist\@endpefalse
  2328 + }
  2329 + \or %2
  2330 +
  2331 + \newtheoremstyle{plain} {\medskipamount}{\medskipamount}{\itshape}{\z@}{\bfseries}{.}{1em}{}
  2332 + \newtheoremstyle{definition}{\medskipamount}{\medskipamount}{\itshape}{\z@}{\bfseries\itshape}{.}{1em}{}
  2333 + \newtheoremstyle{remark} {\medskipamount}{\medskipamount}{\normalfont}{\z@}{\bfseries\itshape}{.}{1em}{}
  2334 +
  2335 + \renewenvironment{proof}[1][\proofname]{\par
  2336 + \pushQED{\qed}%
  2337 + \normalfont \topsep\medskipamount\relax
  2338 + \trivlist
  2339 + \item[\hskip\labelsep
  2340 + \itshape\bfseries
  2341 + ##1\@addpunct{.}]\ignorespaces
  2342 + }{%
  2343 + \popQED\endtrivlist\@endpefalse
  2344 + }
  2345 +
  2346 +
  2347 + \or %3
  2348 +
  2349 + \renewenvironment{proof}[1][\proofname]{\par
  2350 + \pushQED{\qed}%
  2351 + \normalfont \topsep\medskipamount\relax
  2352 + \trivlist
  2353 + \item[\hskip\labelsep
  2354 + \bfseries
  2355 + ##1\@addpunct{.}]\ignorespaces
  2356 + }{%
  2357 + \popQED\endtrivlist\@endpefalse
  2358 + }
  2359 +
  2360 + \else
  2361 + \fi}
  2362 +
  2363 +
  2364 +\if@load@amsmath
  2365 + \if@amsmath@leqno
  2366 + \PassOptionsToPackage{leqno}{amsmath}
  2367 + \fi
  2368 + \RequirePackage[cmex10]{amsmath}
  2369 +\fi
  2370 +
  2371 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% loading of amsthm
  2372 +
  2373 +\if@load@amsthm
  2374 + \RequirePackage{amsthm}
  2375 + \set@amsthm
  2376 +\else
  2377 + \AtBeginDocument{\@ifpackageloaded{amsthm}{\set@amsthm}{}}
  2378 +\fi
  2379 +
  2380 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% thebibliography, loading natbib
  2381 +
  2382 +\def\set@natbib{%
  2383 + \let\bibfont\thebibliography@size
  2384 + \setlength\bibsep{0pt}}
  2385 +
  2386 +\if@load@natbib
  2387 + \RequirePackage{natbib}
  2388 + \set@natbib
  2389 +\else
  2390 + \let\xxx@thebibliography\thebibliography
  2391 + \def\thebibliography{\thebibliography@size\xxx@thebibliography}
  2392 + \g@addto@macro\@openbib@code{\itemsep\z@}
  2393 + \AtBeginDocument{\@ifpackageloaded{natbib}{\set@natbib}{}}
  2394 +\fi
  2395 +
  2396 +
  2397 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% thebibliography - structured
  2398 +
  2399 +%%%%%%%%% Common macros:
  2400 +
  2401 +% Setting a "style" for a command:
  2402 +% \set@bibl@cmd{bvolume} == \def\bvolume#1{{\bvolume@style #1}}
  2403 +
  2404 +\def\set@bibl@cmd#1{\expandafter\def\csname #1\endcsname##1{{\csname #1@style\endcsname##1}}}
  2405 +
  2406 +\let\endbibitem\relax
  2407 +
  2408 +%%%%%%%%% bauthor, beditor
  2409 +
  2410 +\def\bbl@bauthor#1{%
  2411 + \csname bauthor@hook\endcsname%
  2412 +{%
  2413 + \let\binits\@firstofone%
  2414 + \let\bsnm\@firstofone%
  2415 + \let\bfnm\@gobble%
  2416 + \let\bparticle\@firstofone%
  2417 + \let\bsuffix\@firstofone%
  2418 + \bauthor@style%
  2419 +#1}}
  2420 +
  2421 +\def\bbl@beditor#1{{%
  2422 + \let\binits\@firstofone%
  2423 + \let\bsnm\@firstofone%
  2424 + \let\bfnm\@gobble%
  2425 + \let\bparticle\@firstofone%
  2426 + \let\bsuffix\@firstofone%
  2427 + \beditor@style%
  2428 +#1}}
  2429 +
  2430 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bid
  2431 +% \bid{MR={},doi={},...}
  2432 +
  2433 +\define@key{bid}{mr}{\MR{#1}}
  2434 +\define@key{bid}{doi}{}
  2435 +\define@key{bid}{pubmed}{}
  2436 +\define@key{bid}{pii}{}
  2437 +
  2438 +\def\bbl@bid#1{%
  2439 + \setkeys{bid}{#1}%
  2440 +}
  2441 +
  2442 +% for compatibility with old bibtex style
  2443 +\def\bdoi#1{\ignorespaces}
  2444 +
  2445 +%%%%%%%%% common@pub@types
  2446 +
  2447 +\def\common@pub@types{%
  2448 + \def\AND{and }%
  2449 + \let\betal\@firstofone%
  2450 + \set@bibl@cmd{btitle}%
  2451 + \let\byear\@firstofone%
  2452 + \let\bpages\@firstofone%
  2453 + \let\bmisc\@firstofone%
  2454 + \let\bnote\@firstofone%
  2455 + \let\banumber\@firstofone%
  2456 + \let\bmrnumber\MR%
  2457 + \let\bid\bbl@bid%
  2458 + \set@bibl@cmd{bvolume}%
  2459 + \csname common@pub@types@hook\endcsname%
  2460 +}
  2461 +
  2462 +
  2463 +%%%%%%%%% default stiliai
  2464 +
  2465 + \setattribute{bauthor}{style}{\scshape}
  2466 + \setattribute{beditor}{style}{\scshape}
  2467 +
  2468 + \setattribute{bjournal} {style}{\itshape}
  2469 + \setattribute{bbooktitle}{style}{\itshape}
  2470 + \setattribute{bseries} {style}{\itshape}
  2471 +
  2472 + \setattribute{bvolume} {style}{\bfseries}
  2473 +
  2474 +%%%%%%%%% barticle
  2475 +
  2476 +\def\barticle{\@ifnextchar[{\@barticle}{\@barticle[]}}
  2477 +
  2478 +\def\@barticle[#1]{%
  2479 + \common@pub@types%
  2480 + \let\bauthor\bbl@bauthor%
  2481 + \set@bibl@cmd{bjournal}%
  2482 +}
  2483 +
  2484 +%%%%%%%%% bbook
  2485 +
  2486 +\def\bbook{\@ifnextchar[{\@bbook}{\@bbook[]}}
  2487 +
  2488 +\def\@bbook[#1]{%
  2489 + \common@pub@types%
  2490 + \let\bauthor\bbl@bauthor%
  2491 + \let\beditor\bbl@beditor%
  2492 + \let\bedition\@firstofone%
  2493 + \set@bibl@cmd{bseries}%
  2494 + \let\bpublisher\@firstofone%
  2495 + \let\baddress\@firstofone%
  2496 + \let\bisbn\@gobble%
  2497 +%
  2498 + \let\btitle@style\itshape%
  2499 +}
  2500 +
  2501 +
  2502 +%%%%%%%%% bincollection
  2503 +
  2504 +\def\bincollection{\@ifnextchar[{\@bincollection}{\@bincollection[]}}
  2505 +
  2506 +\def\@bincollection[#1]{%
  2507 + \common@pub@types%
  2508 + \let\bauthor\bbl@bauthor%
  2509 + \let\beditor\bbl@beditor%
  2510 + \set@bibl@cmd{bbooktitle}%
  2511 + \let\bchapter\@firstofone%
  2512 + \let\bedition\@firstofone%
  2513 + \set@bibl@cmd{bseries}%
  2514 + \let\bpublisher\@firstofone%
  2515 + \let\baddress\@firstofone%
  2516 + \let\bisbn\@gobble%
  2517 + \def\bauthor@hook{\let\beditor@style\relax}
  2518 +}
  2519 +
  2520 +%%%%%%%%% binproceedings
  2521 +
  2522 +\def\binproceedings{\@ifnextchar[{\@binproceedings}{\@binproceedings[]}}
  2523 +
  2524 +\def\@binproceedings[#1]{%
  2525 + \common@pub@types%
  2526 + \let\bauthor\bbl@bauthor%
  2527 + \let\beditor\bbl@beditor%
  2528 + \set@bibl@cmd{bbooktitle}%
  2529 + \set@bibl@cmd{bseries}%
  2530 + \let\borganization\@firstofone%
  2531 + \let\bpublisher\@firstofone%
  2532 + \let\baddress\@firstofone%
  2533 + \let\bisbn\@gobble%
  2534 +}
  2535 +
  2536 +%%%%%%%%% binbook
  2537 +
  2538 +\def\binbook{\@ifnextchar[{\@binbook}{\@binbook[]}}
  2539 +
  2540 +\def\@binbook[#1]{%
  2541 + \common@pub@types%
  2542 + \let\bauthor\bbl@bauthor%
  2543 + \let\beditor\bbl@beditor%
  2544 + \set@bibl@cmd{bbooktitle}%
  2545 + \let\bchapter\@firstofone%
  2546 + \let\bedition\@firstofone%
  2547 + \set@bibl@cmd{bseries}%
  2548 + \let\bpublisher\@firstofone%
  2549 + \let\baddress\@firstofone%
  2550 + \let\bisbn\@gobble%
  2551 +%
  2552 + \let\btitle@style\itshape
  2553 +}
  2554 +
  2555 +
  2556 +%%%%%%%%% bproceedings
  2557 +
  2558 +\def\bproceedings{\@ifnextchar[{\@bproceedings}{\@bproceedings[]}}
  2559 +
  2560 +\def\@bproceedings[#1]{%
  2561 + \common@pub@types%
  2562 + \let\bauthor\bbl@bauthor%
  2563 + \let\beditor\bbl@beditor%
  2564 + \let\bedition\@firstofone%
  2565 + \set@bibl@cmd{bseries}%
  2566 + \let\bpublisher\@firstofone%
  2567 + \let\borganization\@firstofone%
  2568 + \let\baddress\@firstofone%
  2569 + \let\bisbn\@gobble%
  2570 +%
  2571 + \let\btitle@style\itshape
  2572 +}
  2573 +
  2574 +
  2575 +%%%%%%%%% btechreport
  2576 +
  2577 +\def\btechreport{\@ifnextchar[{\@btechreport}{\@btechreport[]}}
  2578 +
  2579 +\def\@btechreport[#1]{%
  2580 + \common@pub@types%
  2581 + \let\bauthor\bbl@bauthor%
  2582 + \let\btype\@firstofone%
  2583 + \let\bnumber\@firstofone%
  2584 + \let\binstitution\@firstofone%
  2585 + \let\baddress\@firstofone%
  2586 +}
  2587 +
  2588 +%%%%%%%%% bmanual
  2589 +
  2590 +\def\bmanual{\@ifnextchar[{\@bmanual}{\@bmanual[]}}
  2591 +
  2592 +\def\@bmanual[#1]{%
  2593 + \common@pub@types%
  2594 + \let\bauthor\bbl@bauthor%
  2595 + \let\bedition\@firstofone%
  2596 + \let\borganization\@firstofone%
  2597 + \let\baddress\@firstofone%
  2598 + \let\bisbn\@gobble%
  2599 +}
  2600 +
  2601 +%%%%%%%%% mastersthesis
  2602 +
  2603 +\def\bmastersthesis{\@ifnextchar[{\@bmastersthesis}{\@bmastersthesis[]}}
  2604 +
  2605 +\def\@bmastersthesis[#1]{%
  2606 + \common@pub@types%
  2607 + \let\bauthor\bbl@bauthor%
  2608 + \let\bschool\@firstofone%
  2609 + \let\btype\@firstofone%
  2610 + \let\baddress\@firstofone%
  2611 +}
  2612 +
  2613 +%%%%%%%%% phdthesis
  2614 +
  2615 +\def\bphdthesis{\@ifnextchar[{\@bphdthesis}{\@bphdthesis[]}}
  2616 +
  2617 +\def\@bphdthesis[#1]{%
  2618 + \common@pub@types%
  2619 + \let\bauthor\bbl@bauthor%
  2620 + \let\bschool\@firstofone%
  2621 + \let\btype\@firstofone%
  2622 + \let\baddress\@firstofone%
  2623 +}
  2624 +
  2625 +%%%%%%%%% bbooklet
  2626 +
  2627 +\def\bbooklet{\@ifnextchar[{\@bbooklet}{\@bbooklet[]}}
  2628 +
  2629 +\def\@bbooklet[#1]{%
  2630 + \common@pub@types%
  2631 + \let\bauthor\bbl@bauthor%
  2632 + \let\bhowpublished\@firstofone%
  2633 + \let\baddress\@firstofone%
  2634 +}
  2635 +
  2636 +%%%%%%%%% bunpublished
  2637 +
  2638 +\def\bunpublished{\@ifnextchar[{\@bunpublished}{\@bunpublished[]}}
  2639 +
  2640 +\def\@bunpublished[#1]{%
  2641 + \common@pub@types%
  2642 + \let\bauthor\bbl@bauthor%
  2643 +}
  2644 +
  2645 +%%%%%%%%% bmisc
  2646 +
  2647 +\def\bmisc{\@ifnextchar[{\@bmisc}{\@bmisc[]}}
  2648 +
  2649 +\def\@bmisc[#1]{%
  2650 + \common@pub@types%
  2651 + \let\bauthor\bbl@bauthor%
  2652 + \let\bhowpublished\@firstofone%
  2653 +}
  2654 +
  2655 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% appendix
  2656 +
  2657 +\if@imslayout
  2658 +
  2659 +% appendix mess up everything in this layout:
  2660 +
  2661 + \renewcommand\appendix{\par
  2662 + \def\subsection@shape{\normalsize\upshape\bfseries\mathversion{bold}}
  2663 + \let\section\specialsection
  2664 + \def\section{\@ifnextchar*{\@appsectionstar}{\@appsectionnostar}}%
  2665 + \def\section@prefix{\appendixname\ }%
  2666 + \def\section@numbersep{:}%
  2667 + \setcounter{section}{0}%
  2668 + \setcounter{subsection}{0}%
  2669 + \gdef\thesection{\@Alph\c@section}}
  2670 +
  2671 +% \section*{Appendix} -> APPENDIX
  2672 + \def\@appsectionstar*#1{%
  2673 + \specialsection*{#1}%
  2674 + \setcounter{section}{1}%
  2675 +% \addcontentsline{toc}{section}{#1}
  2676 +}
  2677 +
  2678 +% \section{} -> APPENDIX A
  2679 +% \section{proof} -> APPENDIX A: PROOF
  2680 + \def\@appsectionnostar#1{%
  2681 + \ifx.#1.%
  2682 + \def\section@numbersep{}\specialsection[\appendixname\ \thesection]{}%
  2683 + \else%
  2684 + \def\section@numbersep{:}\specialsection{#1}%
  2685 + \fi}
  2686 +
  2687 +% dirty trick with \thebibliography
  2688 + \let\old@thebibliography\thebibliography
  2689 + \def\thebibliography{\let\section\specialsection\old@thebibliography}
  2690 +
  2691 +\else
  2692 +
  2693 + \renewcommand\appendix{\par
  2694 + \let\old@section\section%
  2695 + \def\section{\@ifnextchar*{\@appsectionstar}{\@appsectionnostar}}%
  2696 + \def\section@prefix{\appendixname\ }%
  2697 + \def\section@numbersep{:}%
  2698 + \setcounter{section}{0}%
  2699 + \setcounter{subsection}{0}%
  2700 + \gdef\thesection{\@Alph\c@section}}
  2701 +
  2702 + \def\@appsectionstar*#1{%
  2703 + \old@section*{#1}%
  2704 + \setcounter{section}{1}%
  2705 +% \addcontentsline{toc}{section}{#1}
  2706 +}
  2707 +
  2708 + \def\@appsectionnostar#1{%
  2709 + \ifx.#1.%
  2710 + \def\section@numbersep{}\old@section[\appendixname\ \thesection]{}%
  2711 + \else%
  2712 + \def\section@numbersep{:}\old@section{#1}%
  2713 + \fi}
  2714 +
  2715 +
  2716 +\fi
  2717 +
  2718 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% supplement
  2719 +%
  2720 +%\begin{supplement}[id=suppA]
  2721 +% \sname{Supplement A}
  2722 +% \stitle{}
  2723 +% \slink[doi]{}
  2724 +% \slink[url]{http://lib.stat.cmu.edu/aoas/???/???}
  2725 +% \sdescription{}
  2726 +%\end{supplement}
  2727 +% \thesuppdoi{suppA}
  2728 +% \ref{suppA}
  2729 +% \hyperlink{suppA}{text}
  2730 +
  2731 +\def\supplement@name{Supplementary Material}
  2732 +
  2733 +\def\sname#1{\def\@sname{#1}\def\@currentlabel{#1}}
  2734 +\def\stitle#1{\def\@stitle{#1}}
  2735 +\def\sdatatype#1{\def\@sdatatype{#1}}
  2736 +\def\slink[#1]#2{\expandafter\def\csname slink@#1\endcsname{#2}}
  2737 +\def\sdescription#1{\def\@sdescription{#1}}
  2738 +
  2739 +\def\suppsection@fmt{\specialsection*{\supplement@name}}
  2740 +
  2741 +\def\slink@doi@fmt{%
  2742 + \url@fmt{doi: }{}{\slink@doi}{\doi@base\slink@doi}%
  2743 + \@ifundefined{supp@label}{}{%
  2744 + \expandafter\xdef\csname\supp@label @doi\endcsname{\slink@doi}%
  2745 + \expandafter\xdef\csname\supp@label @url\endcsname{\doi@base\slink@doi}}%
  2746 +}
  2747 +
  2748 +\def\slink@url@fmt{%
  2749 + \url@fmt{}{}{\slink@url}{\slink@url}%
  2750 + \@ifundefined{supp@label}{}{%
  2751 + \expandafter\xdef\csname\supp@label @url\endcsname{\slink@url}}%
  2752 +}
  2753 +
  2754 +\def\thesuppdoi#1{\@ifundefined{#1@doi}%
  2755 + {\@latex@error{Undefined supplement id=#1}{??}}%
  2756 + {\def\@tempx{\csname #1@doi\endcsname}%
  2757 + \@ifundefined{#1@url}{\def\@tempy{\doi@base\csname #1@url\endcsname}}{\def\@tempy{\csname #1@url\endcsname}}%
  2758 + \url@fmt{DOI: }{}{\@tempx}{\@tempy}}%
  2759 +}
  2760 +
  2761 +\define@key{supplement}{id}{\def\supp@label{#1}}
  2762 +
  2763 +\long\def\supplement{\@ifnextchar[{\@supplement}{\@supplement[]}}
  2764 +
  2765 +\long\def\@supplement[#1]{%
  2766 + \suppsection@fmt%
  2767 + \global\let\suppsection@fmt\smallskip%
  2768 + \setkeys{supplement}{#1}%
  2769 +}
  2770 +
  2771 +\def\endsupplement{%
  2772 + \@ifundefined{@sname}{}{\@ifundefined{supp@label}{}{\hypertarget{\supp@label}{}\label{\supp@label}}\textbf{\@sname: }}%
  2773 + \@ifundefined{@stitle}{}{\textbf{\@stitle\ }}%
  2774 +%
  2775 + \\
  2776 + (%
  2777 + \@ifundefined{slink@doi}{}{\slink@doi@fmt}%
  2778 + \@ifundefined{slink@url}{}{\slink@url@fmt}%
  2779 + \@ifundefined{@sdatatype}{}{; \@sdatatype}%
  2780 + ).
  2781 + \@ifundefined{@sdescription}{}{\@sdescription}%
  2782 + \par}
  2783 +
  2784 +
  2785 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TOC in "article" class is a mess:
  2786 +
  2787 +
  2788 +% for hyperref
  2789 +\def\toclevel@title{0}
  2790 +
  2791 +\newcommand*\l@title[2]{}
  2792 +\newcommand*\l@author[2]{}
  2793 +\newcommand*\l@doi[2]{}
  2794 +\newcommand*\l@arxiv[2]{}
  2795 +\newcommand*\l@jobname[2]{}
  2796 +\newcommand*\l@begintocitem[2]{}
  2797 +\newcommand*\l@endtocitem[2]{}
  2798 +
  2799 +\newif\if@changetoc \@changetocfalse
  2800 +\@ifclassloaded{article}{\@changetoctrue}{}
  2801 +
  2802 +\if@changetoc
  2803 +
  2804 + \@ifundefined{contentsname@cmd}{\def\contentsname@cmd{\section*{\contentsname}}}{}
  2805 +
  2806 + \renewcommand\tableofcontents{%
  2807 + \nocontentsline
  2808 + \contentsname@cmd%
  2809 + \@starttoc{toc}%
  2810 + }
  2811 +
  2812 + \renewcommand*\l@section{\@dottedtocline{1}{\z@}{1.5em}}
  2813 +
  2814 +\fi
  2815 +
  2816 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% number lines
  2817 +
  2818 +\ifnumberlines@
  2819 +
  2820 + \long\def\l@addto@macro#1#2{%
  2821 + \toks@\expandafter{#1#2}%
  2822 + \edef#1{\the\toks@}}
  2823 +
  2824 + \setattribute{numberlines}{size}{\scriptsize\ttfamily}
  2825 + \setattribute{numberlines}{skip}{24\p@}
  2826 +
  2827 + \def\numberlines@hook{%
  2828 + \l@addto@macro\@evenhead\put@numberlines@box%
  2829 + \l@addto@macro\@oddhead\put@numberlines@box}
  2830 +
  2831 + \g@addto@macro\ps@imsheadings\numberlines@hook
  2832 + \g@addto@macro\ps@copyright\numberlines@hook
  2833 +
  2834 + \newbox\numberlines@box
  2835 + \newskip\numberlines@box@skip
  2836 +
  2837 + \def\set@numberlines@box{%
  2838 + \setlength\numberlines@box@skip\headsep
  2839 + \addtolength\numberlines@box@skip{5\p@}
  2840 + %
  2841 + \setbox\numberlines@box\vtop to\textheight{%
  2842 + \parindent\z@
  2843 + \vskip\z@
  2844 + \@tempcnta=0
  2845 + \@tempdima=\z@
  2846 + \loop
  2847 + \advance\@tempcnta by1
  2848 + \advance\@tempdima by\baselineskip
  2849 + \hbox to\textwidth{%
  2850 + \llap{\numberlines@size\the\@tempcnta\kern\numberlines@skip}
  2851 + \hfill
  2852 + \rlap{\numberlines@size\kern\numberlines@skip\the\@tempcnta}}
  2853 + \ifdim\@tempdima<\textheight\repeat
  2854 + \vss
  2855 + }%
  2856 + %
  2857 + \ht\numberlines@box\z@
  2858 + \dp\numberlines@box\z@
  2859 + }
  2860 +
  2861 + \def\put@numberlines@box{\lower\numberlines@box@skip\hbox to\z@{\hss\copy\numberlines@box}}
  2862 +
  2863 + \AtBeginDocument{\set@numberlines@box}
  2864 +
  2865 +\fi
  2866 +
  2867 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INICIALIZATION
  2868 +
  2869 +% Read local configuration file (if exist):
  2870 +% imsart.cnf imsart-ps.cnf imsart-lnms.cnf
  2871 +
  2872 +\@input{\imsfmt@name\journal@id.cnf}
  2873 +
  2874 +
  2875 +\@twosidetrue
  2876 +\pagenumbering{arabic}
  2877 +\frenchspacing
  2878 +\init@settings
  2879 +\pagestyle{imsheadings}
  2880 +
  2881 +\endinput
  2882 +%%
  2883 +%% History:
  2884 +2011.03.02 - SSY copyright fixed;
  2885 +2011.01.24 - \bdoi added;
  2886 +2010.09.07 - journal url changed for EJS journal;
  2887 +2010.08.03 - \tableofcontents fixed for the imslayout journals;
  2888 +2010.04.27 - support for the "Stochastic Systems" (ssy) added;
  2889 +2009.12.16 - \betal added
  2890 +2009.08.13 - support for the structured bibliography added (imsart-number.bst,imsart-nameyear.bst)
  2891 + options [numbers,sort&compress] from natbib package removed
  2892 +2009.05.21 - added new option "bjps"
  2893 +2009.02.27 - all hyperref links are set to "blue"
  2894 + - smart \MR command (code suggested by Vilmos Prokaj <prokaj@cs.elte.hu>
  2895 +2008.08.29 - supplement environment added
  2896 +2008.01.24 - for "coll" changed journal url
  2897 +2008.01.09 - added new option "coll"
  2898 +2007.12.10 - added new option "aihp"
  2899 + - abstract have an attribute language=
  2900 + - multiple abstracts
  2901 + - \atltitle{} - title in another language
  2902 +2007.09.18 - fixed small error in SS (affiliation)
  2903 +2007.04.13 - fixed small error in EJS
  2904 +2007.04.02 - ISSN numbers of EJS and SS included
  2905 +2007.02.20 - support for the "Electronic Journal of Statistics" (ejs) added;
  2906 +2007.01.24 - support for the "The Annals of Applied Statistics" (aoas) and Bernoulli (bj) added;
  2907 +2006.10.13 - small bug with "lnms, ps, ss" options fixed;
  2908 +2006.09.07 - if no options specified, imsart.sty is loaded with "generic" option;
  2909 + - new options: imslayout, stslayout
  2910 +2006.08.23 -"author's addresses" secion added to bookmarks (aap,aop,aos);
  2911 + -completely new STS layout;
  2912 + -\tableofcontents adjusted, could be used in frontmatter part;
  2913 + -support for LNMS Table of Contents;
  2914 + -support for LNMS "List of Contributors" (\contributor{Author, F.}{University});
  2915 + -command \arxiv{math.PR/0000000} introduced to provide link to article location in arXiv
  2916 + -\@journal{} changed to \journal@name
  2917 + -\ead{} correctly sets the pdf link when "http://" prefix is used;
  2918 + -\ead[...,nopdflink]{} supresses pdf link;
  2919 + -a lot of internal changes;
  2920 + - fix of a bug with newer hyperref versions (\orig@footnotetext)
  2921 + -equation numbers are at left for LNMS layout;
  2922 +
  2923 +2006.03.07 -command \volumename{} introduced + small changes for LNMS option
  2924 + (addresses will be positioned on title page)
  2925 + -pdf document properties could be changed with commands
  2926 + \pdftitle{}, \pdfsubject{}, \pdfauthor{}
  2927 +
  2928 +2006.01.04 support for the "Statistics Surveys" (ss) added;
  2929 +
  2930 +2005.10.19 fix of a bug with bibliography and ims layout
  2931 + \@footnotetext is changed due to the arXiv hyperref setup
  2932 +
  2933 +2005.05.19 New options singlespacing, doublespacing, linenumbers, nolinenumbers introduced;
  2934 + Table and figure captions changed
  2935 +
  2936 +%% End of file `imsart.sty'.
... ...
installDoc/gitlab-sei.tex 0 → 100644
  1 +++ a/installDoc/gitlab-sei.tex
... ... @@ -0,0 +1,588 @@
  1 +\section{Gitlab}\label{gitlab}
  2 +
  3 +\subsection{Instalar Postgresql}
  4 +
  5 +
  6 +\fbox{\parbox{\textwidth}{
  7 +\texttt{sudo yum localinstall http://yum.postgresql.org/9.3/\\redhat/rhel-6-x86\_64/pgdg-centos93-9.3-1.noarch.rpm -y}}}
  8 +
  9 +\fbox{\parbox{\textwidth}{
  10 +\texttt{
  11 +sudo yum install postgresql93 postgresql93-devel postgresql93-libs postgresql93-server -y
  12 +}}}
  13 +
  14 +\subsubsection{Inicializar database}
  15 +
  16 +
  17 +\fbox{\parbox{\textwidth}{
  18 +\texttt{
  19 +sudo service postgresql-9.3 initdb
  20 +}}}
  21 +
  22 +\subsubsection{Iniciar postgresql com o sistema}
  23 +
  24 +\fbox{\parbox{\textwidth}{
  25 +\texttt{
  26 +sudo chkconfig postgresql-9.3 on
  27 +}}}
  28 +
  29 +\subsubsection{Iniciar postgresql}
  30 +
  31 +\fbox{\parbox{\textwidth}{
  32 +\texttt{
  33 +sudo service postgresql-9.3 start
  34 +}}}
  35 +
  36 +\subsection{Adicionar repositório EPEL}
  37 +
  38 +\fbox{\parbox{\textwidth}{
  39 +\texttt{
  40 +sudo yum -y install wget vim
  41 +}}}
  42 +\fbox{\parbox{\textwidth}{
  43 +\texttt{
  44 +sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 \\https://www.fedoraproject.org/static/0608B895.txt
  45 +}}}
  46 +\fbox{\parbox{\textwidth}{
  47 +\texttt{
  48 +sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
  49 +}}}
  50 +
  51 +\subsection{Adicionar repositório PUIAS Computational (necessário o download de algumas dependências)}
  52 +
  53 +\fbox{\parbox{\textwidth}{
  54 +\texttt{
  55 +sudo rpm -Uvh \\https://dl.fedoraproject.org/pub/epel/6/x86\_64/epel-release-6-8.noarch.rpm
  56 +}}}
  57 +
  58 +\fbox{\parbox{\textwidth}{
  59 +\texttt{
  60 +sudo wget -O /etc/yum.repos.d/PUIAS\_6\_computational.repo \\https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/install/centos/\\PUIAS\_6\_computational.repo
  61 +}}}
  62 +
  63 +\fbox{\parbox{\textwidth}{
  64 +\texttt{
  65 +sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-puias \\http://springdale.math.ias.edu/data/puias/6/x86\_64/os/RPM-GPG-KEY-puias
  66 +}}}
  67 +
  68 +\fbox{\parbox{\textwidth}{
  69 +\texttt{
  70 +sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-puias
  71 +}}}
  72 +
  73 +\subsubsection{Ativar repositório PUIAS}
  74 +
  75 +\fbox{\parbox{\textwidth}{
  76 +\texttt{
  77 +sudo yum -y install yum-utils
  78 +}}}
  79 +
  80 +\fbox{\parbox{\textwidth}{
  81 +\texttt{
  82 +sudo yum-config-manager --enable epel --enable PUIAS\_6\_computational
  83 +}}}
  84 +
  85 +\subsection{Atualizar todos os pacotes e intalar alguns pacotes adincionais}
  86 +
  87 +\fbox{\parbox{\textwidth}{
  88 +\texttt{
  89 +sudo yum -y update
  90 +}}}
  91 +
  92 +\fbox{\parbox{\textwidth}{
  93 +\texttt{
  94 +sudo yum -y groupinstall 'Development Tools'
  95 +}}}
  96 +
  97 +\fbox{\parbox{\textwidth}{
  98 +\texttt{
  99 +sudo yum -y install readline readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel byacc sqlite-devel libyaml libyaml-devel libffi libffi-devel libxml2 libxml2-devel libxslt libxslt-devel libicu libicu-devel system-config-firewall-tui redis sudo wget crontabs logwatch logrotate perl-Time-HiRes
  100 +}}}
  101 +
  102 +\subsection{Adicionar redis para iniciar com o sistema e iniciar o sistema}
  103 +
  104 +\fbox{\parbox{\textwidth}{
  105 +\texttt{
  106 +sudo chkconfig redis on
  107 +}}}
  108 +
  109 +\fbox{\parbox{\textwidth}{
  110 +\texttt{
  111 +sudo service redis start
  112 +}}}
  113 +
  114 +\subsection{Instalar o servidor de email postfix}
  115 +
  116 +\fbox{\parbox{\textwidth}{
  117 +\texttt{
  118 +sudo yum -y install postfix
  119 +}}}
  120 +
  121 +\subsection{Remover qualquer pacote git que tenha instalado}
  122 +
  123 +\fbox{\parbox{\textwidth}{
  124 +\texttt{
  125 +sudo yum -y remove git
  126 +}}}
  127 +
  128 +\subsection{Instalar git 1.9.0 e suas dependências}
  129 +
  130 +\fbox{\parbox{\textwidth}{
  131 +\texttt{
  132 +sudo yum -y install zlib-devel perl-CPAN gettext curl-devel expat-devel gettext-devel openssl-devel
  133 +}}}
  134 +
  135 +\fbox{\parbox{\textwidth}{
  136 +\texttt{
  137 +sudo mkdir /tmp/git \&\& cd /tmp/git}}}
  138 +
  139 +\fbox{\parbox{\textwidth}{
  140 +\texttt{
  141 +sudo wget https://git-core.googlecode.com/files/git-1.9.0.tar.gz}}}
  142 +
  143 +\fbox{\parbox{\textwidth}{
  144 +\texttt{
  145 +sudo tar xzf git-1.9.0.tar.gz}}}
  146 +
  147 +\fbox{\parbox{\textwidth}{
  148 +\texttt{
  149 +cd git-1.9.0/}}}
  150 +
  151 +\fbox{\parbox{\textwidth}{
  152 +\texttt{
  153 +sudo ./configure}}}
  154 +
  155 +\fbox{\parbox{\textwidth}{
  156 +\texttt{
  157 +sudo make}}}
  158 +
  159 +\fbox{\parbox{\textwidth}{
  160 +\texttt{
  161 +sudo make prefix=/usr/local install}}}
  162 +
  163 +\subsection{Remover qualquer ruby instalado, e download do ruby-2.0.0-p451}
  164 +
  165 +\fbox{\parbox{\textwidth}{
  166 +\texttt{
  167 +sudo yum remove ruby -y}}}
  168 +
  169 +\fbox{\parbox{\textwidth}{
  170 +\texttt{
  171 +mkdir /tmp/ruby \&\& cd /tmp/ruby}}}
  172 +
  173 +\fbox{\parbox{\textwidth}{
  174 +\texttt{
  175 +sudo curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz | tar xz
  176 +}}}
  177 +
  178 +\emph{NOTA:}
  179 +
  180 +\fbox{\parbox{\textwidth}{
  181 +\texttt{
  182 +Se não for possível utilizar o host "ruby-2.0.0-p451", você pode tentar esse comando: \\sudo curl --progress http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.bz2 | tar xj
  183 +}}}
  184 +
  185 +\subsection{Install ruby 2.0.0}
  186 +
  187 +\fbox{\parbox{\textwidth}{
  188 +\texttt{
  189 +cd ruby-2.0.0-p451
  190 +\\./configure --disable-install-rdoc
  191 +\\make
  192 +\\sudo make prefix=/usr/local install
  193 +}}}
  194 +
  195 +\subsection{Instalar a bundler gem}
  196 +
  197 +\fbox{\parbox{\textwidth}{
  198 +\texttt{
  199 +sudo /usr/local/bin/gem install bundler --no-ri --no-rdoc
  200 +}}}
  201 +
  202 +\subsection{Ciar um usuário git que tenha as permissões corretas no Gitlab}
  203 +
  204 +\fbox{\parbox{\textwidth}{
  205 +\texttt{
  206 +sudo adduser --system --shell /bin/bash --comment 'GitLab' --create-home --home-dir /home/git/ git
  207 +}}}
  208 +
  209 +\subsection{Clonar o gitlab-shell no repositório}
  210 +
  211 +\fbox{\parbox{\textwidth}{
  212 +\texttt{
  213 +sudo su
  214 +\\cd /home/git
  215 +\\sudo -u git -H /usr/local/bin/git clone https://gitlab.com/gitlab-org/gitlab-shell.git
  216 +\\cd gitlab-shell/
  217 +/usr/local/bin/git reset --hard v1.9.3
  218 +}}}
  219 +
  220 +\subsection{Configurar o nome do host e instalar gitlab-shell}
  221 +
  222 +\fbox{\parbox{\textwidth}{
  223 +\texttt{
  224 +sudo -u git -H cp config.yml.example config.yml
  225 +\\sudo -u git -H vim config.yml
  226 +\\sudo -u git -H /usr/local/bin/ruby ./bin/install
  227 +restorecon -Rv /home/git/.ssh
  228 +}}}
  229 +
  230 +\subsection{Criar database gitlabhq\_production, e se for desenvolver no gitlab criar gitlabhq\_development and gitlabhq\_test}
  231 +
  232 +\fbox{\parbox{\textwidth}{
  233 +\texttt{
  234 +sudo -u postgres psql -d template1
  235 +CREATE USER git;
  236 +CREATE DATABASE gitlabhq\_production OWNER git;
  237 +CREATE DATABASE gitlabhq\_development OWNER git;
  238 +CREATE DATABASE gitlabhq\_test OWNER git;
  239 +}}}
  240 +
  241 +\subsection{Adicionar o usuário git no pg\_hba.conf para conceder permissões}
  242 +
  243 +\fbox{\parbox{\textwidth}{
  244 +\texttt{
  245 +vim /var/lib/pgsql/9.3/data/pg\_hba.conf
  246 +}}}
  247 +
  248 +O fim do arquivo deve se parecer o código abaixo:
  249 +
  250 +\fbox{\parbox{\textwidth}{
  251 +\texttt{
  252 +\# TYPE DATABASE USER ADDRESS METHOD
  253 +\\\# "local" is for Unix domain socket connections only
  254 +\\local all postgres peer
  255 +\\local all git trust
  256 +\\\# IPv4 local connections:
  257 +\\host all postgres 127.0.0.1/32 ident
  258 +\\host all git 127.0.0.1/32 trust
  259 +\\\# IPv6 local connections:
  260 +\\host all postgres ::1/128 ident
  261 +\\host all git ::1/128 trust
  262 +}}}
  263 +
  264 +\fbox{\parbox{\textwidth}{
  265 +\texttt{
  266 +[ESC]:wq!
  267 +}}}
  268 +
  269 +\subsection{Reiniciar postgresql}
  270 +
  271 +\fbox{\parbox{\textwidth}{
  272 +\texttt{
  273 +service postgresql-9.3 restart
  274 +}}}
  275 +
  276 +\subsection{Clonar and configurar o repositório do gitlab}
  277 +
  278 +\fbox{\parbox{\textwidth}{
  279 +\texttt{
  280 +cd /home/git
  281 +}}}
  282 +
  283 +\fbox{\parbox{\textwidth}{
  284 +\texttt{
  285 +\\sudo -u git -H /usr/local/bin/git clone \\https://github.com/colab-community/gitlabhq.git -b 7-0-stable gitlab}}}
  286 +
  287 +\fbox{\parbox{\textwidth}{
  288 +\texttt{
  289 +\\cd /home/git/gitlab}}}
  290 +
  291 +\fbox{\parbox{\textwidth}{
  292 +\texttt{
  293 +\\sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml}}}
  294 +
  295 +\fbox{\parbox{\textwidth}{
  296 +\texttt{
  297 +\\chown -R git {log,tmp}}}}
  298 +
  299 +\fbox{\parbox{\textwidth}{
  300 +\texttt{
  301 +\\chmod -R u+rwX {log,tmp}
  302 +}}}
  303 +
  304 +\fbox{\parbox{\textwidth}{
  305 +\texttt{
  306 +\\sudo -u git -H mkdir /home/git/gitlab-satellites}}}
  307 +
  308 +\fbox{\parbox{\textwidth}{
  309 +\texttt{
  310 +\\chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites}}}
  311 +
  312 +\fbox{\parbox{\textwidth}{
  313 +\texttt{
  314 +\\chmod -R u+rwX tmp/{pids,sockets}
  315 +}}}
  316 +
  317 +\fbox{\parbox{\textwidth}{
  318 +\texttt{
  319 +\\chmod -R u+rwX public/uploads}}}
  320 +
  321 +\fbox{\parbox{\textwidth}{
  322 +\texttt{
  323 +\\sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb}}}
  324 +
  325 +\fbox{\parbox{\textwidth}{
  326 +\texttt{
  327 +\\sudo -u git -H cp config/initializers/rack\_attack.rb.example config/initializers/rack\_attack.rb
  328 +}}}
  329 +
  330 +\subsection{Mudar a porta usada para o gitlab, nesse caso use a porta 8090}
  331 +
  332 +\fbox{\parbox{\textwidth}{
  333 +\texttt{
  334 +sudo vim /home/git/gitlab/config/unicorn.rb
  335 +}}}
  336 +
  337 +Mude:
  338 +
  339 +\fbox{\parbox{\textwidth}{
  340 +\texttt{
  341 +listen "127.0.0.1:8080", :tcp\_nopush => true
  342 +}}}
  343 +
  344 +Para:
  345 +
  346 +\fbox{\parbox{\textwidth}{
  347 +\texttt{
  348 +listen "127.0.0.1:8090", :tcp\_nopush => true
  349 +}}}
  350 +
  351 +\fbox{\parbox{\textwidth}{
  352 +\texttt{
  353 +[ESC]:wq!
  354 +}}}
  355 +
  356 +\subsection{Mudar URL defautl no gitlab-shell/config.yml}
  357 +
  358 +\fbox{\parbox{\textwidth}{
  359 +\texttt{
  360 +sudo vim /home/git/gitlab-shell/config.yml
  361 +}}}
  362 +
  363 +Altere a sequinte linha:
  364 +
  365 +\fbox{\parbox{\textwidth}{
  366 +\texttt{
  367 +gitlab\_url: "http://127.0.0.1:8090/gitlab"
  368 +}}}
  369 +
  370 +Para, usando o seu IP:
  371 +
  372 +\fbox{\parbox{\textwidth}{
  373 +\texttt{
  374 +gitlab\_url: "http://127.0.0.1:8090/"
  375 +}}}
  376 +
  377 +\subsection{Configurar git e database}
  378 +
  379 +\fbox{\parbox{\textwidth}{
  380 +\texttt{
  381 +sudo -u git -H /usr/local/bin/git config --global user.name "GitLab"
  382 +}}}
  383 +
  384 +\fbox{\parbox{\textwidth}{
  385 +\texttt{
  386 +sudo -u git -H /usr/local/bin/git config --global user.email "gitlab@localhost"}}}
  387 +
  388 +\fbox{\parbox{\textwidth}{
  389 +\texttt{
  390 +sudo -u git -H /usr/local/bin/git config --global core.autocrlf input}}}
  391 +
  392 +\fbox{\parbox{\textwidth}{
  393 +\texttt{
  394 +sudo -u git cp config/database.yml.postgresql config/database.yml}}}
  395 +
  396 +\fbox{\parbox{\textwidth}{
  397 +\texttt{
  398 +sudo -u git -H chmod o-rwx config/database.yml
  399 +}}}
  400 +
  401 +\subsection{Configurar o bundle}
  402 +
  403 +\fbox{\parbox{\textwidth}{
  404 +\texttt{
  405 +cd /home/git/gitlab
  406 +}}}
  407 +
  408 +\fbox{\parbox{\textwidth}{
  409 +\texttt{
  410 +sudo -u git -H /usr/local/bin/bundle config build.pg --with-pg-config=/usr/\\pgsql-9.3/bin/pg\_config}}}
  411 +
  412 +\fbox{\parbox{\textwidth}{
  413 +\texttt{
  414 +sudo -u git -H /usr/local/bin/bundle config build.nokogiri --use-system-libraries
  415 +}}}
  416 +
  417 +\subsection{Edite arquivos sudores para deixar que bundle, git e gem executem no modo sudo.}
  418 +
  419 +\emph{NOTA:}
  420 +
  421 +\fbox{\parbox{\textwidth}{
  422 +\texttt{
  423 +The path "/usr/bin:/usr/pgsql-9.3/bin/" will be only in this file if you installed postgresql before, if you didn't just remove it from those lines.
  424 +}}}
  425 +
  426 +\fbox{\parbox{\textwidth}{
  427 +\texttt{
  428 +sudo vim /etc/sudoers
  429 +}}}
  430 +
  431 +Altere a linha
  432 +
  433 +\fbox{\parbox{\textwidth}{
  434 +\texttt{
  435 +Defaults secure\_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/
  436 +}}}
  437 +
  438 +Para
  439 +
  440 +\fbox{\parbox{\textwidth}{
  441 +\texttt{
  442 +Defaults secure\_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/:/usr/\\local/bin/
  443 +}}}
  444 +
  445 +\fbox{\parbox{\textwidth}{
  446 +\texttt{
  447 +[ESC]:wq!
  448 +}}}
  449 +
  450 +\subsection{Pegue os pacotes de instalação necessário para instalação das gems, se for desenvolver para o gitlab, altere o env para RAILS\_ENV=development}
  451 +
  452 +\fbox{\parbox{\textwidth}{
  453 +\texttt{
  454 +sudo -u git -H /usr/local/bin/bundle install --deployment --without development test mysql aws
  455 +}}}
  456 +
  457 +\fbox{\parbox{\textwidth}{
  458 +\texttt{
  459 +sudo -u git -H /usr/local/bin/bundle exec rake gitlab:setup RAILS\_ENV=production
  460 +}}}
  461 +
  462 +Escolha yes para criar as tabelas no banco
  463 +
  464 +\emph{NOTA:}
  465 +
  466 +\fbox{\parbox{\textwidth}{
  467 +\texttt{
  468 +Admin login and password -- login: admin@local.host -- password: 5iveL!fe
  469 +}}}
  470 +
  471 +\subsection{Adicionar gitlab para iniciar com o sistema, esse passo não é requisito para o modo de desenvolvimento}
  472 +
  473 +\fbox{\parbox{\textwidth}{
  474 +\texttt{
  475 +wget -O /etc/init.d/gitlab https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/\\init/sysvinit/centos/gitlab-unicorn
  476 +}}}
  477 +
  478 +\fbox{\parbox{\textwidth}{
  479 +\texttt{
  480 +chmod +x /etc/init.d/gitlab}}}
  481 +
  482 +\fbox{\parbox{\textwidth}{
  483 +\texttt{
  484 +chkconfig --add gitlab
  485 +}}}
  486 +
  487 +\fbox{\parbox{\textwidth}{
  488 +\texttt{
  489 +chkconfig gitlab on
  490 +cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
  491 +service gitlab start
  492 +}}}
  493 +
  494 +\subsection{Compile os asstes, para desenvolvimento altere o env para RAILS\_ENV=development}
  495 +
  496 +\fbox{\parbox{\textwidth}{
  497 +\texttt{
  498 +sudo -u git -H /usr/local/bin/bundle exec rake assets:precompile RAILS\_ENV=production
  499 +}}}
  500 +
  501 +\subsection{Altere as permissões dos grupos}
  502 +
  503 +\fbox{\parbox{\textwidth}{
  504 +\texttt{
  505 +chmod g+rx /home/git/
  506 +}}}
  507 +
  508 +Altere a linha:
  509 +
  510 +\fbox{\parbox{\textwidth}{
  511 +\texttt{
  512 +env: enabled: true
  513 +}}}
  514 +
  515 +Para:
  516 +
  517 +\fbox{\parbox{\textwidth}{
  518 +\texttt{
  519 +env: enabled: false
  520 +}}}
  521 +
  522 +Altere essas linhas:
  523 +
  524 +\fbox{\parbox{\textwidth}{
  525 +\texttt{issues\_tracker: \# redmine: \# title: ``Redmine'' \#
  526 +\#\# If not nil, link `Issues' on project page will be replaced with
  527 +this \# \#\# Use placeholders: \# \#\# :project\_id - GitLab project
  528 +identifier \# \#\# :issues\_tracker\_id - Project Name or Id in external
  529 +issue tracker \# project\_url:
  530 +``http://redmine.sample/projects/:issues\_tracker\_id'' \# \# \#\# If
  531 +not nil, links from /\#\d/ entities from commit messages will replaced
  532 +with this \# \#\# Use placeholders: \# \#\# :project\_id - GitLab
  533 +project identifier \# \#\# :issues\_tracker\_id - Project Name or Id in
  534 +external issue tracker \# \#\# :id - Issue id (from commit messages) \#
  535 +issues\_url: ``http://redmine.sample/issues/:id'' \# \# \#\# If not nil,
  536 +links to creating new issues will be replaced with this \# \#\# Use
  537 +placeholders: \# \#\# :project\_id - GitLab project identifier \# \#\#
  538 +:issues\_tracker\_id - Project Name or Id in external issue tracker \#
  539 +new\_issue\_url:
  540 +``http://redmine.sample/projects/:issues\_tracker\_id/issues/new'' \# \#
  541 +jira: \# title: ``Atlassian Jira'' \# project\_url:
  542 +\\``http://jira.sample/issues/?jql=project=:issues\_tracker\_id'' \#
  543 +issues\_url: ``http://jira.sample/browse/:id'' \# new\_issue\_url:
  544 +``http://jira.sample/secure/CreateIssue.jspa''
  545 +}}}
  546 +
  547 +Para:
  548 +
  549 +\fbox{\parbox{\textwidth}{
  550 +\texttt{
  551 +issues\_tracker: redmine: title: ``Redmine'' \#\# If not nil, link
  552 +`Issues' on project page will be replaced with this \#\# Use
  553 +placeholders: \#\# :project\_id - GitLab project identifier \#\#
  554 +:issues\_tracker\_id - Project Name or Id in external issue tracker
  555 +project\_url: "http://redmine.sample/projects/:issues\_tracker\_id"
  556 +\#\# If not nil, links from /\# d/ entities from commit messages will replaced with this
  557 +\#\# Use placeholders:
  558 +\#\# :project\_id - GitLab project identifier
  559 +\#\# :issues\_tracker\_id - Project Name or Id in external issue tracker
  560 +\#\# :id - Issue id (from commit messages)
  561 +issues\_url: "http://redmine.sample/issues/:id"
  562 +\#\# If not nil, links to creating new issues will be replaced with this
  563 +\#\# Use placeholders:
  564 +\#\# :project\_id - GitLab project identifier
  565 +\#\# :issues\_tracker\_id - Project Name or Id in external issue tracker
  566 +new\_issue\_url: "http://redmine.sample/projects/:issues\_tracker\_id/issues/new"
  567 +\# jira:
  568 +\# title: "Atlassian Jira"
  569 +\# project\_url: \\"http://jira.sample/issues/?jql=project=:issues\_tracker\_id"
  570 +\# issues\_url: "http://jira.sample/browse/:id"
  571 +\# new\_issue\_url: "http://jira.sample/secure/CreateIssue.jspa"
  572 + }}}
  573 +
  574 +\emph{NOTA:} Altere todos redmine.sample para seu servidor redmine
  575 +
  576 +\subsection{Restart gitlab}
  577 +
  578 +\fbox{\parbox{\textwidth}{
  579 +\texttt{
  580 +sudo service gitlab restart
  581 +}}}
  582 +
  583 +\emph{NOTA:}
  584 +
  585 +\fbox{\parbox{\textwidth}{
  586 +\texttt{
  587 +Você pode acessar o gitlab usando essa url: `http://localhost:8090/gitlab
  588 +}}}
0 589 \ No newline at end of file
... ...
installDoc/gitlab-sei.txt 0 → 100644
  1 +++ a/installDoc/gitlab-sei.txt
... ... @@ -0,0 +1,420 @@
  1 +
  2 +Gitlab
  3 +======
  4 +
  5 +
  6 +Install postgresql
  7 +
  8 +.. code-block::
  9 +
  10 + sudo yum localinstall http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm -y
  11 + sudo yum install postgresql93 postgresql93-devel postgresql93-libs postgresql93-server -y
  12 +
  13 +Initialize database
  14 +
  15 +.. code-block::
  16 +
  17 + sudo service postgresql-9.3 initdb
  18 +
  19 +Start postgresql with the system
  20 +
  21 +.. code-block::
  22 +
  23 + sudo chkconfig postgresql-9.3 on
  24 +
  25 +Start postgresql
  26 +
  27 +.. code-block::
  28 +
  29 + sudo service postgresql-9.3 start
  30 +
  31 +
  32 +Add EPEL repository
  33 +
  34 +.. code-block::
  35 +
  36 + sudo yum -y install wget vim
  37 + sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 https://www.fedoraproject.org/static/0608B895.txt
  38 + sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
  39 +
  40 +Add PUIAS Computational repository (necessary to download some exclusive dependencies)
  41 +
  42 +.. code-block::
  43 +
  44 + sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
  45 + sudo wget -O /etc/yum.repos.d/PUIAS_6_computational.repo https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/install/centos/PUIAS_6_computational.repo
  46 + sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-puias http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias
  47 + sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-puias
  48 +
  49 +Enable PUIAS repository
  50 +
  51 +.. code-block::
  52 +
  53 + sudo yum -y install yum-utils
  54 + sudo yum-config-manager --enable epel --enable PUIAS_6_computational
  55 +
  56 +Update all packages, and install some addtional packages
  57 +
  58 +.. code-block::
  59 +
  60 + sudo yum -y update
  61 + sudo yum -y groupinstall 'Development Tools'
  62 + sudo yum -y install readline readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel byacc sqlite-devel libyaml libyaml-devel libffi libffi-devel libxml2 libxml2-devel libxslt libxslt-devel libicu libicu-devel system-config-firewall-tui redis sudo wget crontabs logwatch logrotate perl-Time-HiRes
  63 +
  64 +Add redis to start with the system, and start it
  65 +
  66 +.. code-block::
  67 +
  68 + sudo chkconfig redis on
  69 + sudo service redis start
  70 +
  71 +Install the mail server ``postfix``
  72 +
  73 +.. code-block::
  74 +
  75 + sudo yum -y install postfix
  76 +
  77 +Remove any git package that you may had install
  78 +
  79 +.. code-block::
  80 +
  81 + sudo yum -y remove git
  82 +
  83 +Install git 1.9.0 and its dependencies
  84 +
  85 +.. code-block::
  86 +
  87 + sudo yum -y install zlib-devel perl-CPAN gettext curl-devel expat-devel gettext-devel openssl-devel
  88 + sudo mkdir /tmp/git && cd /tmp/git
  89 + sudo wget https://git-core.googlecode.com/files/git-1.9.0.tar.gz
  90 + sudo tar xzf git-1.9.0.tar.gz
  91 + cd git-1.9.0/
  92 + sudo ./configure
  93 + sudo make
  94 + sudo make prefix=/usr/local install
  95 +
  96 +Remove any ruby installed before, and download ``ruby-2.0.0-p451``
  97 +
  98 +.. code-block::
  99 +
  100 + sudo yum remove ruby -y
  101 + mkdir /tmp/ruby && cd /tmp/ruby
  102 + sudo curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz | tar xz
  103 +
  104 +*NOTE:*
  105 +
  106 + If you can't reach the host from ``ruby-2.0.0-p451``, you also can try this command: sudo curl --progress http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.bz2 | tar xj
  107 +
  108 +Install ruby 2.0.0
  109 +
  110 +.. code-block::
  111 +
  112 + cd ruby-2.0.0-p451
  113 + ./configure --disable-install-rdoc
  114 + make
  115 + sudo make prefix=/usr/local install
  116 +
  117 +Install the bundler gem
  118 +
  119 +.. code-block::
  120 +
  121 + sudo /usr/local/bin/gem install bundler --no-ri --no-rdoc
  122 +
  123 +Create the user ``git`` to give the rights permissions to Gitlab application
  124 +
  125 +.. code-block::
  126 +
  127 + sudo adduser --system --shell /bin/bash --comment 'GitLab' --create-home --home-dir /home/git/ git
  128 +
  129 +Clone the gitlab-shell repository
  130 +
  131 +.. code-block::
  132 +
  133 + sudo su
  134 + cd /home/git
  135 + sudo -u git -H /usr/local/bin/git clone https://gitlab.com/gitlab-org/gitlab-shell.git
  136 + cd gitlab-shell/
  137 + /usr/local/bin/git reset --hard v1.9.3
  138 +
  139 +Configure the host name and install gitlab-shell
  140 +
  141 +.. code-block::
  142 +
  143 + sudo -u git -H cp config.yml.example config.yml
  144 + sudo -u git -H vim config.yml
  145 + sudo -u git -H /usr/local/bin/ruby ./bin/install
  146 + restorecon -Rv /home/git/.ssh
  147 +
  148 +Create database ``gitlabhq_production``, and if you're going to develop to gitlab also create ``gitlabhq_development`` and ``gitlabhq_test``
  149 +
  150 +.. code-block::
  151 +
  152 + sudo -u postgres psql -d template1
  153 + CREATE USER git;
  154 + CREATE DATABASE gitlabhq_production OWNER git;
  155 + CREATE DATABASE gitlabhq_development OWNER git;
  156 + CREATE DATABASE gitlabhq_test OWNER git;
  157 + \q
  158 +
  159 +Add the git user in pg_hba.conf to grant the permissions
  160 +
  161 +.. code-block::
  162 +
  163 + vim /var/lib/pgsql/9.3/data/pg_hba.conf
  164 +
  165 +The end of file should seems like the piece of code below, if you're following this whole tutorial you must already have the ``colab`` and ``postgres`` set up, if you are not set up ``postgres`` and ``git`` users.
  166 +
  167 +.. code-block::
  168 +
  169 + # TYPE DATABASE USER ADDRESS METHOD
  170 + # "local" is for Unix domain socket connections only
  171 + local all postgres peer
  172 + local all git trust
  173 + # IPv4 local connections:
  174 + host all postgres 127.0.0.1/32 ident
  175 + host all git 127.0.0.1/32 trust
  176 + # IPv6 local connections:
  177 + host all postgres ::1/128 ident
  178 + host all git ::1/128 trust
  179 +
  180 +.. code-block::
  181 +
  182 + [ESC]:wq!
  183 +
  184 +Restart postgresql
  185 +
  186 +.. code-block::
  187 +
  188 + service postgresql-9.3 restart
  189 +
  190 +Clone and configure the ``gitlab`` repository
  191 +
  192 +.. code-block::
  193 +
  194 + cd /home/git
  195 + sudo -u git -H /usr/local/bin/git clone https://github.com/colab-community/gitlabhq.git -b 7-0-stable gitlab
  196 + cd /home/git/gitlab
  197 + sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml
  198 + chown -R git {log,tmp}
  199 + chmod -R u+rwX {log,tmp}
  200 + sudo -u git -H mkdir /home/git/gitlab-satellites
  201 + chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites
  202 + chmod -R u+rwX tmp/{pids,sockets}
  203 + chmod -R u+rwX public/uploads
  204 + sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
  205 + sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
  206 +
  207 +Change the port you're using for gitlab, in this case we use 8090
  208 +
  209 +.. code-block::
  210 +
  211 + sudo vim /home/git/gitlab/config/unicorn.rb
  212 +
  213 +Change
  214 +
  215 +.. code-block::
  216 +
  217 + listen "127.0.0.1:8080", :tcp_nopush => true
  218 +
  219 +To
  220 +
  221 +.. code-block::
  222 +
  223 + listen "127.0.0.1:8090", :tcp_nopush => true
  224 +
  225 +.. code-block::
  226 +
  227 + [ESC]:wq!
  228 +
  229 +
  230 +Change defautl URL in gitlab-shell/config.yml
  231 +
  232 +.. code-block::
  233 +
  234 + sudo vim /home/git/gitlab-shell/config.yml
  235 +
  236 +Change the following line, From:
  237 +
  238 +.. code-block::
  239 +
  240 + gitlab_url: "http://127.0.0.1:8090/gitlab"
  241 +
  242 +To, using the your IP:
  243 +
  244 +.. code-block::
  245 +
  246 + gitlab_url: "http://127.0.0.1:8090/"
  247 +
  248 +
  249 +Configure git and database
  250 +
  251 +.. code-block::
  252 +
  253 + sudo -u git -H /usr/local/bin/git config --global user.name "GitLab"
  254 + sudo -u git -H /usr/local/bin/git config --global user.email "gitlab@localhost"
  255 + sudo -u git -H /usr/local/bin/git config --global core.autocrlf input
  256 + sudo -u git cp config/database.yml.postgresql config/database.yml
  257 + sudo -u git -H chmod o-rwx config/database.yml
  258 +
  259 +Configure the bundle
  260 +
  261 +.. code-block::
  262 +
  263 + cd /home/git/gitlab
  264 + sudo -u git -H /usr/local/bin/bundle config build.pg --with-pg-config=/usr/pgsql-9.3/bin/pg_config
  265 + sudo -u git -H /usr/local/bin/bundle config build.nokogiri --use-system-libraries
  266 +
  267 +
  268 +
  269 +Edit sudores file to let ``bundle``, ``git`` and ``gem`` execute in sudo mode.
  270 +
  271 +*NOTE:*
  272 +
  273 + The path ``/usr/bin:/usr/pgsql-9.3/bin/`` will be only in this file if you installed postgresql before, if you didn't just remove it from those lines.
  274 +
  275 +.. code-block::
  276 +
  277 + sudo vim /etc/sudoers
  278 +
  279 +Change the line
  280 +
  281 +.. code-block::
  282 +
  283 + Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/
  284 +
  285 +To
  286 +
  287 +.. code-block::
  288 +
  289 + Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/:/usr/local/bin/
  290 +
  291 +.. code-block::
  292 +
  293 + [ESC]:wq!
  294 +
  295 +Give the bundle install to install the required gems, if you are going to devel to gitlab change the env to ``RAILS_ENV=development``
  296 +
  297 +.. code-block::
  298 +
  299 + sudo -u git -H /usr/local/bin/bundle install --deployment --without development test mysql aws
  300 + sudo -u git -H /usr/local/bin/bundle exec rake gitlab:setup RAILS_ENV=production
  301 +
  302 +Type ``yes`` to create the database tables
  303 +
  304 +*NOTE:*
  305 +
  306 + Admin login and password -- login: admin@local.host -- password: 5iveL!fe
  307 +
  308 +Add gitlab to start with system, this step is not require to development mode
  309 +
  310 +.. code-block::
  311 +
  312 + wget -O /etc/init.d/gitlab https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/init/sysvinit/centos/gitlab-unicorn
  313 + chmod +x /etc/init.d/gitlab
  314 + chkconfig --add gitlab
  315 + chkconfig gitlab on
  316 + cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
  317 + service gitlab start
  318 +
  319 +Compile the asstes, to development change the env to ``RAILS_ENV=development``
  320 +
  321 +.. code-block::
  322 +
  323 + sudo -u git -H /usr/local/bin/bundle exec rake assets:precompile RAILS_ENV=production
  324 +
  325 +Change group permissions
  326 +
  327 + chmod g+rx /home/git/
  328 +
  329 +
  330 +Altering the line
  331 +
  332 +.. code-block::
  333 +
  334 + env:
  335 + enabled: true
  336 +
  337 +to
  338 +
  339 +.. code-block::
  340 +
  341 + env:
  342 + enabled: false
  343 +
  344 +Change these lines :
  345 +
  346 +.. code-block::
  347 + issues_tracker:
  348 + # redmine:
  349 + # title: "Redmine"
  350 + # ## If not nil, link 'Issues' on project page will be replaced with this
  351 + # ## Use placeholders:
  352 + # ## :project_id - GitLab project identifier
  353 + # ## :issues_tracker_id - Project Name or Id in external issue tracker
  354 + # project_url: "http://redmine.sample/projects/:issues_tracker_id"
  355 + #
  356 + # ## If not nil, links from /#\d/ entities from commit messages will replaced with this
  357 + # ## Use placeholders:
  358 + # ## :project_id - GitLab project identifier
  359 + # ## :issues_tracker_id - Project Name or Id in external issue tracker
  360 + # ## :id - Issue id (from commit messages)
  361 + # issues_url: "http://redmine.sample/issues/:id"
  362 + #
  363 + # ## If not nil, links to creating new issues will be replaced with this
  364 + # ## Use placeholders:
  365 + # ## :project_id - GitLab project identifier
  366 + # ## :issues_tracker_id - Project Name or Id in external issue tracker
  367 + # new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new"
  368 + #
  369 + # jira:
  370 + # title: "Atlassian Jira"
  371 + # project_url: "http://jira.sample/issues/?jql=project=:issues_tracker_id"
  372 + # issues_url: "http://jira.sample/browse/:id"
  373 + # new_issue_url: "http://jira.sample/secure/CreateIssue.jspa"
  374 +
  375 +to
  376 +
  377 +.. code-block::
  378 +
  379 +
  380 + issues_tracker:
  381 + redmine:
  382 + title: "Redmine"
  383 + ## If not nil, link 'Issues' on project page will be replaced with this
  384 + ## Use placeholders:
  385 + ## :project_id - GitLab project identifier
  386 + ## :issues_tracker_id - Project Name or Id in external issue tracker
  387 + project_url: "http://redmine.sample/projects/:issues_tracker_id"
  388 +
  389 + ## If not nil, links from /#\d/ entities from commit messages will replaced with this
  390 + ## Use placeholders:
  391 + ## :project_id - GitLab project identifier
  392 + ## :issues_tracker_id - Project Name or Id in external issue tracker
  393 + ## :id - Issue id (from commit messages)
  394 + issues_url: "http://redmine.sample/issues/:id"
  395 +
  396 + ## If not nil, links to creating new issues will be replaced with this
  397 + ## Use placeholders:
  398 + ## :project_id - GitLab project identifier
  399 + ## :issues_tracker_id - Project Name or Id in external issue tracker
  400 + new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new"
  401 +
  402 + # jira:
  403 + # title: "Atlassian Jira"
  404 + # project_url: "http://jira.sample/issues/?jql=project=:issues_tracker_id"
  405 + # issues_url: "http://jira.sample/browse/:id"
  406 + # new_issue_url: "http://jira.sample/secure/CreateIssue.jspa"
  407 +
  408 +*NOTE:*
  409 + Change all redmine.sample to your redmine server
  410 +
  411 +
  412 +Restart gitlab
  413 +
  414 +.. code-block::
  415 +
  416 + sudo service gitlab restart
  417 +
  418 +*NOTE:*
  419 +
  420 + You can access gitlab in this url: `http://localhost:8090/gitlab, but it won't log-in without the REMOTE_USER provided by colab
... ...
installDoc/gitlab_omnibus_issues_tracker_tutorial.tex 0 → 100644
  1 +++ a/installDoc/gitlab_omnibus_issues_tracker_tutorial.tex
... ... @@ -0,0 +1,90 @@
  1 +\section{Integração com o Redmine utilizando o Gitlab Omnibus}\label{integração com o Redmine utilizando o Gitlab Omnibus}
  2 +
  3 +\subsection{Instalar vim, wget e openssh-server}
  4 +
  5 +\fbox{\parbox{\textwidth}{
  6 +\texttt{
  7 +sudo yum install vim wget openssh-server
  8 +}}}
  9 +
  10 +\subsection{Download e instalação pacote Gitlab-7.0.0}
  11 +
  12 +\fbox{\parbox{\textwidth}{
  13 +\texttt{
  14 +\footnotesize{
  15 +wget https://downloads-packages.s3.amazonaws.com/centos-6.5/gitlab-7.0.0\_omnibus-1.el6.x86\_64.rpm
  16 +}
  17 +}}}
  18 +
  19 +\fbox{\parbox{\textwidth}{
  20 +\texttt{
  21 +sudo rpm -i gitlab-7.0.0\_omnibus-1.el6.x86\_64.rpm
  22 +}}}
  23 +
  24 +\subsection{Adicionar as configurações para url externa, portas de serviço e issues tracker}
  25 +
  26 +\fbox{\parbox{\textwidth}{
  27 +\texttt{
  28 +sudo vim /etc/gitlab/gitlab.rb
  29 +}}}
  30 +
  31 +Altere a url externa modificando a linha:
  32 +
  33 +\fbox{\parbox{\textwidth}{
  34 +\texttt{
  35 +external\_url "http://gitlab.example.com
  36 +}}}
  37 +
  38 +Para
  39 +
  40 +\fbox{\parbox{\textwidth}{
  41 +\texttt{
  42 +external\_url "http://<IP>"
  43 +}}}
  44 +
  45 +Onde tiver a url externa do Gitlab
  46 +
  47 +Adicione as seguintes linhas para modificar as portas de serviço:
  48 +
  49 +\fbox{\parbox{\textwidth}{
  50 +\texttt{redis{[}`port'{]} = 1234 postgresql{[}`port'{]} = 2345
  51 +unicorn{[}`port'{]} = 3456}}}
  52 +
  53 +\subsection{Ativar incrição, acicionar a linha:}
  54 +
  55 +\fbox{\parbox{\textwidth}{
  56 +\texttt{gitlab\_rails{[}`gitlab\_signup\_enabled'{]} = ``true''}}}
  57 +
  58 +\subsection{Adicione as seguintes definições,para definir no Redmine a issue tracker:}
  59 +
  60 +\fbox{\parbox{\textwidth}{
  61 +\texttt{
  62 +gitlab\_rails['issues\_tracker\_redmine'] = "redmine"
  63 +\\gitlab\_rails['issues\_tracker\_redmine\_title'] = "Redmine"
  64 +\\gitlab\_rails['issues\_tracker\_redmine\_project\_url'] = \\"http://<redmine-url>/projects/:issues\_tracker\_id"
  65 +\\gitlab\_rails['issues\_tracker\_redmine\_issues\_url'] = \\"http://<redmine-url>/issues/:id"
  66 +\\gitlab\_rails['issues\_tracker\_redmine\_new\_issue\_url'] = \\"http://<redmine-url>/projects/\\:issues\_tracker\_id/issues/new"
  67 +}}}
  68 +
  69 +Onde houver url do redmine.
  70 +
  71 +Sauve as alterações, rodando:
  72 +
  73 +\fbox{\parbox{\textwidth}{
  74 +\texttt{
  75 +[ESC]:wq!
  76 +}}}
  77 +
  78 +\subsection{Execute o seguinte comando para que as alterações entrem em vigor:}
  79 +
  80 +\fbox{\parbox{\textwidth}{
  81 +\texttt{
  82 +sudo gitlab-ctl reconfigure
  83 +}}}
  84 +
  85 +\subsection{Abrir firewall para serviços de http e ssh:}
  86 +
  87 +\fbox{\parbox{\textwidth}{
  88 +\texttt{
  89 +sudo lokkit -s http -s ssh
  90 +}}}
... ...
installDoc/gitlab_omnibus_issues_tracker_tutorial.txt 0 → 100644
  1 +++ a/installDoc/gitlab_omnibus_issues_tracker_tutorial.txt
... ... @@ -0,0 +1,74 @@
  1 +Install vim, wget and openssh-server
  2 +
  3 +.. code-block::
  4 +
  5 + sudo yum install vim wget openssh-server
  6 +
  7 +Download and install Gitlab-7.0.0 package
  8 +
  9 +.. code-block::
  10 +
  11 + wget https://downloads-packages.s3.amazonaws.com/centos-6.5/gitlab-7.0.0_omnibus-1.el6.x86_64.rpm
  12 + sudo rpm -i gitlab-7.0.0_omnibus-1.el6.x86_64.rpm
  13 +
  14 +Add the configurations settings for external url, services ports and issues tracker
  15 +
  16 +.. code-block::
  17 +
  18 + sudo vim /etc/gitlab/gitlab.rb
  19 +
  20 +Change external url altering the line
  21 +
  22 +.. code-block::
  23 +
  24 + external_url "http://gitlab.example.com
  25 +To
  26 +
  27 +.. code-block::
  28 +
  29 + external_url "http://<IP>"
  30 +
  31 +Where <IP> is the external url of Gitlab.
  32 +
  33 +
  34 +Add the following settings, to set the ports of services:
  35 +
  36 +.. code-block::
  37 + redis['port'] = 1234
  38 + postgresql['port'] = 2345
  39 + unicorn['port'] = 3456
  40 +
  41 +Enable signup feature, adding the line:
  42 +
  43 +.. code-block::
  44 + gitlab_rails['gitlab_signup_enabled'] = "true"
  45 +
  46 +Add the following settings, to set Redmine as issue tracker:
  47 +
  48 +.. code-block::
  49 +
  50 + gitlab_rails['issues_tracker_redmine'] = "redmine"
  51 + gitlab_rails['issues_tracker_redmine_title'] = "Redmine"
  52 + gitlab_rails['issues_tracker_redmine_project_url'] = "http://<redmine-url>/projects/:issues_tracker_id"
  53 + gitlab_rails['issues_tracker_redmine_issues_url'] = "http://<redmine-url>/issues/:id"
  54 + gitlab_rails['issues_tracker_redmine_new_issue_url'] = "http://<redmine-url>/projects/:issues_tracker_id/issues/new"
  55 +
  56 +Where <redmine-url> is the Redmine url.
  57 +
  58 +Save the changes, running:
  59 +
  60 +.. code-block::
  61 +
  62 + [ESC]:wq!
  63 +
  64 +Run the following command for the changes to take effect:
  65 +
  66 +.. code-block::
  67 +
  68 + sudo gitlab-ctl reconfigure
  69 +
  70 +Open firewall for http and ssh services:
  71 +
  72 +.. code-block::
  73 +
  74 + sudo lokkit -s http -s ssh
... ...
installDoc/redmine-sei.tex 0 → 100644
  1 +++ a/installDoc/redmine-sei.tex
... ... @@ -0,0 +1,280 @@
  1 +\section{Redmine}\label{redmine}
  2 +
  3 +\subsection{Instalação do Epel}
  4 +\fbox{
  5 +\texttt{rpm -Uvh http://fedora.uib.no/epel/6/x86\_64/epel-release-6-8.noarch.rpm}
  6 +}
  7 +
  8 +\subsection{Instalação de pacotes}
  9 +\fbox{\parbox{\textwidth}{
  10 +\texttt{sudo yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel subversion git postgresql-devel}
  11 +}}
  12 +
  13 +\subsection{Instalação Postgresql}
  14 +
  15 +\fbox{\parbox{\textwidth}{
  16 +\texttt{sudo yum localinstall
  17 +http://yum.postgresql.org/9.3/redhat/rhel-6-x86\_64/
  18 +pgdg-centos93-9.3-1.noarch.rpm
  19 +-y sudo yum install postgresql93 postgresql93-devel postgresql93-libs
  20 +postgresql93-server -y
  21 +}}}
  22 +
  23 +\subsubsection{Reiniciar Postgresql}
  24 +
  25 +\fbox{\parbox{\textwidth}{
  26 +\texttt{/etc/init.d/postgresql-9.3 initdb sudo /etc/init.d/postgresql-9.3 restart
  27 +}}}
  28 +
  29 +\subsubsection{Modificar senha do Postgres}
  30 +
  31 +\fbox{\parbox{\textwidth}{
  32 +\texttt{sudo -u postgres psql template1 \textgreater{}\textgreater{}ALTER USER
  33 +postgres with encrypted password `postgres';
  34 +}}}
  35 +
  36 +\subsubsection{Configurando o Postgres}
  37 +
  38 +\fbox{
  39 +\texttt{sudo vi /var/lib/pgsql/9.3/data/postgresql.conf}}
  40 +
  41 +\fbox{
  42 +\texttt{change: listen\_addresses = 'localhost'}
  43 +\texttt{to: listen\_addresses = 'localhost'}}
  44 +
  45 +\fbox{\parbox{\textwidth}{
  46 +\texttt{[ESC]:wq!
  47 +Edit pg\_hba.conf to grant the permissions}}}
  48 +
  49 +\fbox{
  50 +\texttt{sudo vi /var/lib/pgsql/9.3/data/pg\_hba.conf}}
  51 +
  52 +\subsubsection{Usar a permissão certa de usuário do Redmine no banco de dados do Redmine}
  53 +
  54 +\fbox{\parbox{\textwidth}{
  55 +\texttt{
  56 +\# TYPE DATABASE USER ADDRESS METHOD
  57 +\# local is for Unix domain socket connections only
  58 +local all redmine md5
  59 +\# IPv4 local connections:
  60 +host all redmine 127.0.0.1/32 md5
  61 +\# IPv6 local connections:
  62 +host all redmine ::1/128 md5
  63 +}}}
  64 +
  65 +\fbox{
  66 +\texttt{[ESC]:wq!}}
  67 +
  68 +\subsubsection{Reiniciar Postgresql}
  69 +
  70 +\fbox{
  71 +\texttt{sudo /etc/init.d/postgresql-9.3 restart}}
  72 +
  73 +\subsection{Instalar Requisitos das Gems}
  74 +
  75 +\fbox{\parbox{\textwidth}{
  76 +\texttt{
  77 +sudo yum install gcc gcc-c++.x86\_64 make automake autoconf curl-devel
  78 +openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel
  79 +sqlite-devel ruby-rdoc ruby-devel}}}
  80 +
  81 +\fbox{
  82 +\texttt{sudo yum install rubygems libxslt-devel libxml2-devel.x86\_64}}
  83 +
  84 +\subsection{Atualizar para a Gem 1.4.2}
  85 +
  86 +\fbox{\parbox{\textwidth}{
  87 +\texttt{
  88 +wget http://production.cf.rubygems.org/rubygems/rubygems-1.4.2.tgz tar
  89 +zxvf rubygems-1.4.2.tgz cd rubygems-1.4.2 ruby setup.rb gem -v
  90 +}}}
  91 +
  92 +
  93 +\subsection{Instalar ImageMagick}
  94 +
  95 +\fbox{\parbox{\textwidth}{
  96 +\texttt{
  97 +sudo yum install php-pear gcc ImageMagick ImageMagick-devel
  98 +ImageMagick-perl
  99 +}}}
  100 +
  101 +\subsection{Instalar Gem Bundle}
  102 +
  103 +\fbox{\parbox{\textwidth}{
  104 +\texttt{
  105 +sudo gem install bundle --no-ri --no-rdoc
  106 +}}}
  107 +
  108 +\subsection{Instalar NGINX}
  109 +
  110 +\fbox{\parbox{\textwidth}{
  111 +\texttt{
  112 +cd /tmp wget
  113 +http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release centos-6-0.el6.ngx.noarch.rpm
  114 +}}}
  115 +
  116 +\fbox{\parbox{\textwidth}{
  117 +\texttt{
  118 +sudo rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm sudo yum
  119 +install nginx -y sudo chkconfig nginx on
  120 +}}}
  121 +
  122 +\subsection{Instalar Redmine 2.5.1}
  123 +
  124 +\fbox{\parbox{\textwidth}{
  125 +\texttt{
  126 +cd /opt svn co http://svn.redmine.org/redmine/branches/2.5-stable
  127 +redmine sudo mkdir -p tmp/pdf public/plugin\_assets
  128 +}}}
  129 +
  130 +\subsection{Instalar requisitos da Gem}
  131 +
  132 +\fbox{
  133 +\texttt{cd /opt/redmine bundle install --without mysql sqlite}}
  134 +
  135 +
  136 +\subsection{Configurar postgresql}
  137 +
  138 +\fbox{
  139 +\texttt{
  140 +sudo -u postgres psql}}
  141 +
  142 +\fbox{\parbox{\textwidth}{
  143 +\texttt{
  144 +\begin{quote}
  145 +\begin{quote}
  146 +CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD `redmine' NOINHERIT VALID
  147 +UNTIL `infinity'; CREATE DATABASE redmine WITH ENCODING=`UTF8'
  148 +OWNER=redmine;
  149 +\end{quote}
  150 +\end{quote}
  151 +}}}
  152 +
  153 +
  154 +\subsection{Installing Gems}
  155 +
  156 +\fbox{\parbox{\textwidth}{
  157 +\texttt{
  158 +sudo gem install pg -v `0.17.1' --no-ri --no-rdoc sudo gem install
  159 +unicorn --no-ri --no-rdoc sudo gem uninstall rake -v `10.3.2'
  160 +}}}
  161 +
  162 +
  163 +\subsection{Configurar database.yml na pasta do Redmine}
  164 +
  165 +
  166 +\fbox{\parbox{\textwidth}{
  167 +\texttt{cd config/ mv database.yml.example database.yml vi database.yml
  168 +}}}
  169 +
  170 +
  171 +\subsubsection{Comentar outras linhas e descomentar essas linhas:}
  172 +
  173 +\fbox{\parbox{\textwidth}{
  174 +\texttt{
  175 +\#----------------------
  176 +production: adapter: postgresql database: redmine host: 10.18.0.10 (link
  177 +to database) username: redmine password: redmine encoding: utf8
  178 +\#----------------------
  179 +}}}
  180 +
  181 +
  182 +\subsection{Popular Redmine}
  183 +
  184 +
  185 +\fbox{\parbox{\textwidth}{
  186 +\texttt{
  187 +rake generate\_secret\_token RAILS\_ENV=production rake db:migrate
  188 +RAILS\_ENV=production rake redmine:load\_default\_data escolher pt-BR
  189 +}}}
  190 +
  191 +
  192 +\subsection{Configurar Unicorn}
  193 +
  194 +
  195 +\fbox{\parbox{\textwidth}{
  196 +\texttt{
  197 +cd /opt/redmine mkdir pids\\ vi config/unicorn.rb
  198 +}}}
  199 +
  200 +\fbox{\parbox{\textwidth}{
  201 +\texttt{
  202 +Copy this code to file:
  203 +\#------------------------------------ \# Set the working application
  204 +directory \# working\_directory ``/path/to/your/app'' working\_directory
  205 +``/opt/redmine''
  206 +\# Unicorn PID file location \# pid ``/path/to/pids/unicorn.pid'' pid
  207 +``/opt/redmine/pids/unicorn.pid''
  208 +\# Path to logs \# stderr\_path ``/path/to/log/unicorn.log'' \#
  209 +stdout\_path ``/path/to/log/unicorn.log'' stderr\_path
  210 +``/opt/redmine/log/unicorn.log'' stdout\_path
  211 +``/opt/redmine/log/unicorn.log''
  212 +\# Unicorn socket \#listen ``/tmp/unicorn.redmine.sock'' listen
  213 +``/tmp/unicorn.redmine.sock''
  214 +\# Number of processes \# worker\_processes 4 worker\_processes 2
  215 +\# Time-out timeout 30
  216 +\#-------------------------------------
  217 +}}}
  218 +
  219 +
  220 +\subsection{Reiniciar Postgresql}
  221 +
  222 +\fbox{\parbox{\textwidth}{
  223 +\texttt{
  224 +sudo /etc/init.d/postgresql-9.3 restart
  225 +}}}
  226 +
  227 +
  228 +\subsection{Rodar Redmine usando Unicorn}
  229 +
  230 +\fbox{\parbox{\textwidth}{
  231 +\texttt{
  232 +sudo unicorn\_rails -c /opt/redmine/config/unicorn.rb -E production -l
  233 +0.0.0.0:3000 -D
  234 +}}}
  235 +
  236 +\subsection{Instalar Plugin Backlogs}
  237 +
  238 +De acordo com \url{http://www.redminebacklogs.net/en/installation.html}, execute os seguintes comandos:
  239 +
  240 +\fbox{\parbox{\textwidth}{
  241 +\texttt{
  242 +cd /opt/redmine
  243 +}}}
  244 +
  245 +\fbox{\parbox{\textwidth}{
  246 +\texttt{
  247 +bundle install --without development test
  248 +}}}
  249 +
  250 +\fbox{\parbox{\textwidth}{
  251 +\texttt{
  252 +gem install holidays --version 1.0.3\\
  253 +gem install holidays
  254 +}}}
  255 +
  256 +\fbox{\parbox{\textwidth}{
  257 +\texttt{
  258 +cd /opt/redmine/plugins\\
  259 +git clone https://github.com/backlogs/redmine\_backlogs.git\\
  260 +cd redmine\_backlogs\\
  261 +git tag\\
  262 +git checkout v1.0.6
  263 +}}}
  264 +
  265 +\fbox{\parbox{\textwidth}{
  266 +\texttt{
  267 +cd /opt/redmine\\
  268 +RAILS\_ENV=production\\
  269 +export RAILS\_ENV\\
  270 +bundle exec rake db:migrate\\
  271 +bundle exec rake tmp:cache:clear\\
  272 +bundle exec rake tmp:sessions:clear\\
  273 +bundle exec rake redmine:backlogs:install (escolher sempre a opção 2)
  274 +}}}
  275 +
  276 +\fbox{\parbox{\textwidth}{
  277 +\texttt{
  278 +service httpd restart
  279 +}}}
  280 +
... ...
installDoc/redmine-sei.txt 0 → 100644
  1 +++ a/installDoc/redmine-sei.txt
... ... @@ -0,0 +1,251 @@
  1 +Redmine
  2 +=====
  3 +
  4 +Install Epel
  5 +
  6 +.. code-block::
  7 +
  8 + rpm -Uvh http://fedora.uib.no/epel/6/x86_64/epel-release-6-8.noarch.rpm
  9 +
  10 +
  11 +Install Requirements
  12 +.. code-block::
  13 +
  14 + sudo yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel
  15 + subversion git postgresql-devel
  16 +
  17 +
  18 +Install Postgresql
  19 +
  20 +.. code-block::
  21 +
  22 + sudo yum localinstall http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm -y
  23 + sudo yum install postgresql93 postgresql93-devel postgresql93-libs postgresql93-server -y
  24 +
  25 +
  26 +Restarting Postgresql
  27 +
  28 +.. code-block::
  29 +
  30 + /etc/init.d/postgresql-9.3 initdb
  31 + sudo /etc/init.d/postgresql-9.3 restart
  32 +
  33 +Change Postgres password
  34 +
  35 +.. code-block::
  36 +
  37 + sudo -u postgres psql template1
  38 + >>ALTER USER postgres with encrypted password 'postgres';
  39 +
  40 +Configuring
  41 +
  42 +.. code-block::
  43 +
  44 + sudo vi /var/lib/pgsql/9.3/data/postgresql.conf
  45 +
  46 + change:
  47 + # listen_addresses = 'localhost'
  48 + to:
  49 + listen_addresses = 'localhost'
  50 +
  51 +
  52 +.. code-block::
  53 +
  54 + [ESC]:wq!
  55 +
  56 +
  57 +Edit pg_hba.conf to grant the permissions
  58 +
  59 +.. code-block::
  60 +
  61 + sudo vi /var/lib/pgsql/9.3/data/pg_hba.conf
  62 +
  63 +Set the right permission to redmine user on redmine database
  64 +
  65 +.. code-block::
  66 +
  67 + # TYPE DATABASE USER ADDRESS METHOD
  68 + # "local" is for Unix domain socket connections only
  69 + local all redmine md5
  70 +
  71 + # IPv4 local connections:
  72 + host all redmine 127.0.0.1/32 md5
  73 +
  74 + # IPv6 local connections:
  75 + host all redmine ::1/128 md5
  76 +
  77 +.. code-block::
  78 +
  79 + [ESC]:wq!
  80 +
  81 +Restarting Postgresql
  82 +
  83 +.. code-block::
  84 +
  85 + sudo /etc/init.d/postgresql-9.3 restart
  86 +
  87 +
  88 +
  89 +Install Gems Requirements
  90 +
  91 +.. code-block::
  92 +
  93 + sudo yum install gcc gcc-c++.x86_64 make automake autoconf curl-devel openssl-devel
  94 + zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel ruby-rdoc ruby-devel
  95 +
  96 + sudo yum install rubygems libxslt-devel libxml2-devel.x86_64
  97 +
  98 +
  99 +Upgrading to Gem 1.4.2
  100 +
  101 +.. code-block::
  102 +
  103 + wget http://production.cf.rubygems.org/rubygems/rubygems-1.4.2.tgz
  104 + tar zxvf rubygems-1.4.2.tgz
  105 + cd rubygems-1.4.2
  106 + ruby setup.rb
  107 + gem -v
  108 +
  109 +
  110 +Install ImageMagick
  111 +
  112 +.. code-block::
  113 +
  114 + sudo yum install php-pear gcc ImageMagick ImageMagick-devel ImageMagick-perl
  115 +
  116 +Install Gem Bundle
  117 +
  118 +.. code-block::
  119 +
  120 + sudo gem install bundle --no-ri --no-rdoc
  121 +
  122 +Install NGINX
  123 +
  124 +.. code-block::
  125 +
  126 + cd /tmp
  127 + wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
  128 + sudo rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm
  129 + sudo yum install nginx -y
  130 + sudo chkconfig nginx on
  131 +
  132 +Install redmine 2.5.1
  133 +
  134 +.. code-block::
  135 +
  136 + cd /opt
  137 + svn co http://svn.redmine.org/redmine/branches/2.5-stable redmine
  138 + sudo mkdir -p tmp/pdf public/plugin_assets
  139 +
  140 +
  141 +Install Gem requirements
  142 +
  143 +.. code-block::
  144 +
  145 + cd /opt/redmine
  146 + bundle install --without mysql sqlite
  147 +
  148 +
  149 +Configuring postgresql
  150 +
  151 +.. code-block::
  152 +
  153 + sudo -u postgres psql
  154 +
  155 + >>CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'redmine' NOINHERIT VALID UNTIL 'infinity';
  156 + >>CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine;
  157 + >>\q
  158 +
  159 +
  160 +Installing Gems
  161 +
  162 +.. code-block::
  163 +
  164 + sudo gem install pg -v '0.17.1' --no-ri --no-rdoc
  165 + sudo gem install unicorn --no-ri --no-rdoc
  166 + sudo gem uninstall rake -v '10.3.2'
  167 +
  168 +
  169 +Configuring database.yml in Redmine Folder
  170 +
  171 +.. code-block::
  172 +
  173 + cd config/
  174 + mv database.yml.example database.yml
  175 + vi database.yml
  176 +
  177 + Comment another lines and uncomment this lines:
  178 + #----------------------
  179 +
  180 + production:
  181 + adapter: postgresql
  182 + database: redmine
  183 + host: 10.18.0.10 (link to database)
  184 + username: redmine
  185 + password: redmine
  186 + encoding: utf8
  187 +
  188 + #----------------------
  189 +
  190 +
  191 +Populating Redmine
  192 +
  193 +.. code-block::
  194 +
  195 + rake generate_secret_token
  196 + RAILS_ENV=production rake db:migrate
  197 + RAILS_ENV=production rake redmine:load_default_data
  198 + escolher pt-BR
  199 +
  200 +
  201 +Configuring Unicorn
  202 +
  203 +.. code-block::
  204 +
  205 + cd /opt/redmine
  206 + mkdir pids
  207 + vi config/unicorn.rb
  208 +
  209 + Copy this code to file:
  210 +
  211 + #------------------------------------
  212 + # Set the working application directory
  213 + # working_directory "/path/to/your/app"
  214 + working_directory "/opt/redmine"
  215 +
  216 + # Unicorn PID file location
  217 + # pid "/path/to/pids/unicorn.pid"
  218 + pid "/opt/redmine/pids/unicorn.pid"
  219 +
  220 + # Path to logs
  221 + # stderr_path "/path/to/log/unicorn.log"
  222 + # stdout_path "/path/to/log/unicorn.log"
  223 + stderr_path "/opt/redmine/log/unicorn.log"
  224 + stdout_path "/opt/redmine/log/unicorn.log"
  225 +
  226 + # Unicorn socket
  227 + #listen "/tmp/unicorn.redmine.sock"
  228 + listen "/tmp/unicorn.redmine.sock"
  229 +
  230 + # Number of processes
  231 + # worker_processes 4
  232 + worker_processes 2
  233 +
  234 + # Time-out
  235 + timeout 30
  236 +
  237 + #-------------------------------------
  238 +
  239 +
  240 +Restarting Postgresql
  241 +
  242 +.. code-block::
  243 +
  244 + sudo /etc/init.d/postgresql-9.3 restart
  245 +
  246 +Running Redmine Using unicorn
  247 +
  248 +.. code-block::
  249 +
  250 + sudo unicorn_rails -c /opt/redmine/config/unicorn.rb -E production -l 0.0.0.0:3000 -D
  251 +
... ...