From a8386f13b1328a84a4bb906f656c0981a764755c Mon Sep 17 00:00:00 2001 From: Paulo Meirelles Date: Wed, 2 Jul 2014 15:33:33 -0300 Subject: [PATCH] versao inicial da instalacao do LabSEI --- .gitignore | 18 ++++++++++++++++++ 00-resumo.tex | 4 ++++ LabSEI.idx | 0 LabSEI.tex | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 36 ++++++++++++++++++++++++++++++++++++ README | 0 imsart.cls | 183 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ imsart.sty | 2936 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ installDoc/gitlab-sei.tex | 588 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ installDoc/gitlab-sei.txt | 420 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ installDoc/gitlab_omnibus_issues_tracker_tutorial.tex | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ installDoc/gitlab_omnibus_issues_tracker_tutorial.txt | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ installDoc/redmine-sei.tex | 280 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ installDoc/redmine-sei.txt | 251 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 14 files changed, 4953 insertions(+), 0 deletions(-) create mode 100644 .gitignore create mode 100644 00-resumo.tex create mode 100644 LabSEI.idx create mode 100644 LabSEI.tex create mode 100644 Makefile create mode 100644 README create mode 100644 imsart.cls create mode 100644 imsart.sty create mode 100644 installDoc/gitlab-sei.tex create mode 100644 installDoc/gitlab-sei.txt create mode 100644 installDoc/gitlab_omnibus_issues_tracker_tutorial.tex create mode 100644 installDoc/gitlab_omnibus_issues_tracker_tutorial.txt create mode 100644 installDoc/redmine-sei.tex create mode 100644 installDoc/redmine-sei.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2a06876 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +*.*~ +*.swp +*.swo +*.swn +*.pdf +*.log +*.ps +*.dvi +*.aux +*.blg +*.toc +*.brf +*.ilg +*.ind +*.bbl +*.out +*.lof +*.lot diff --git a/00-resumo.tex b/00-resumo.tex new file mode 100644 index 0000000..aa5455e --- /dev/null +++ b/00-resumo.tex @@ -0,0 +1,4 @@ +\subsection*{Resumo} + +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. + diff --git a/LabSEI.idx b/LabSEI.idx new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/LabSEI.idx diff --git a/LabSEI.tex b/LabSEI.tex new file mode 100644 index 0000000..b16dc15 --- /dev/null +++ b/LabSEI.tex @@ -0,0 +1,73 @@ +\documentclass[preprint,11pt,oneside]{imsart} +\usepackage[T1]{fontenc} +\usepackage[portuguese,brazil]{babel} +\usepackage[utf8]{inputenc} +\usepackage[usenames,dvipsnames]{color} +\usepackage{url} +\usepackage{verbatim} +\usepackage{hyperref} +\usepackage{graphicx} +\usepackage{booktabs} +\usepackage{tabularx} +\usepackage[table]{xcolor} +\usepackage{enumerate} +\usepackage[section]{placeins} +\usepackage{varwidth} +\usepackage{verbatim} + +\setattribute{keyword}{tipo}{Tipo:} + +% ---------------------------------------------------------------------------- % +\topmargin -1.5cm % read Lamport p.163 +\oddsidemargin -0.04cm % read Lamport p.163 +\evensidemargin -0.04cm % same as oddsidemargin but for left-hand pages +\textwidth 16.59cm +\textheight 21.94cm +%\pagestyle{empty} % Uncomment if don't want page numbers +\parskip 7.2pt % sets spacing between paragraphs +\renewcommand{\baselinestretch}{1.5} % Uncomment for 1.5 spacing between lines +%\parindent 0pt % sets leading space for paragraphs +% ---------------------------------------------------------------------------- % + +\begin{document} + +\begin{frontmatter} + +\title{LabSEI} +\normalsize{\textbf{Ambiente Colaborativo para o Desenvolvimento do Projeto SEI}} +\vspace{2cm} + +\normalsize{\textbf{Documento de instalação do Redmine integrado ao Gitlab}} +\vspace{2cm} + +\begin{aug} + +\address{Universidade de Brasília} +\vspace{0.2cm} + +\address{LAPPIS\\ + Laboratório Avançado de Produção, Pesquisa e Inovação em Software\\ + Faculdade UnB Gama} +\vspace{0.2cm} + +\address{MídiaLab\\ + Laboratório de Pesquisa em Arte Computacional\\ + Instituto de Artes} + +\end{aug} +\vspace{0.5cm} +\end{frontmatter} + +% ---------------------------------------------------------------------------- % + +\newpage +\input 00-resumo + + +% ---------------------------------------------------------------------------- % +\newpage +\input installDoc/redmine-sei +\input installDoc/gitlab-sei +\input installDoc/gitlab_omnibus_issues_tracker_tutorial + +\end{document} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b870c6f --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ + +BASE_NAME = LabSEI + +LATEX = latex +PDFLATEX = pdflatex +BIBTEX = bibtex +MAKEINDEX = makeindex + +SOURCES = $(BASE_NAME).tex + +all: + @make $(BASE_NAME).pdf + @make pdf +pdf: $(BASE_NAME).pdf + evince $(BASE_NAME).pdf & +ps: $(BASE_NAME).ps + +$(BASE_NAME).pdf: $(BASE_NAME).tex $(SOURCES) + $(PDFLATEX) $(BASE_NAME).tex + #$(BIBTEX) $(BASE_NAME) + $(MAKEINDEX) $(BASE_NAME) + $(PDFLATEX) $< + $(PDFLATEX) $< + +$(BASE_NAME).ps: $(BASE_NAME).tex + $(LATEX) $< + $(BIBTEX) $(BASE_NAME) + $(MAKEINDEX) $(BASE_NAME) + $(LATEX) $< + $(LATEX) $< + +clean: + rm -f $(BASE_NAME)*.ps $(BASE_NAME)*.dvi *.log \ + *.aux *.blg *.toc *.brf *.ilg *.ind \ + missfont.log $(BASE_NAME)*.bbl $(BASE_NAME)*.pdf $(BASE_NAME)*.out \ + $(BASE_NAME)*.lof $(BASE_NAME)*.lot *.swp diff --git a/README b/README new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/README diff --git a/imsart.cls b/imsart.cls new file mode 100644 index 0000000..7367655 --- /dev/null +++ b/imsart.cls @@ -0,0 +1,183 @@ +%% This is file `imsart.cls' +%% +%% LaTeX 2e class file for the processing of LaTeX2e files +%% of the following IMS/BS journals: +%% +%% The Annals of Probability +%% The Annals of Applied Probability +%% The Annals of Statistics +%% The Annals of Applied Statistics +%% Statistical Science +%% Probability Surveys +%% Statistics Surveys +%% Electronic Journal of Statistics +%% IMS Lecture Notes-Monograph Series +%% IMS Collections +%% Bernoulli +%% Annales de l'Institut Henri Poincar\'e - Probabilit\'es et Statistiques +%% Brazilian Journal of Probability and Statistics +%% Stochastic Systems +%% +%% Institute of Mathematical Statistics, U.S.A. +%% Bernoulli Society +%% Institut Henry Poincare +%% Brazilian Statistical Association +%% +%% Macros written by Vytas Statulevicius, VTeX, Lithuania +%% for Institute of Mathematical Statistics, U.S.A. +%% Please submit bugs or your comments to vytas@vtex.lt +%% +%% The original distribution is located at: +%% http://www.e-publications.org/ims/support +%% +%% This class file loads standart "article.cls" with appropriate +%% settings and then style file "imsart.sty" with additional macros +%% +%% You are free to use this style file as you see fit, provided +%% that you do not make changes to the file. +%% If you DO make changes, you are required to rename this file. +%% +%% It may be distributed under the terms of the LaTeX Project Public +%% License, as described in lppl.txt in the base LaTeX distribution. +%% Either version 1.0 or, at your option, any later version. +%% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +%% +%% Bug fixes and changes: at end of file + +% TeX programming: Vytas Statulevicius, VTeX, Lithuania, vytas@vtex.lt +% Requires Latex2e, ver.2000.06 + + +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{imsart}[2010/04/27 driver class for package imsart.sty] + +% layout options: + +\DeclareOption{imslayout}{% + \PassOptionsToClass{11pt,oneside,leqno}{article} + \PassOptionsToPackage{leqno}{amsmath}} + +\DeclareOption{stslayout}{% + \PassOptionsToClass{11pt,oneside,leqno}{article} + \PassOptionsToPackage{leqno}{amsmath}} + + +% set various options for different journals: +\DeclareOption{generic}{% + \PassOptionsToClass{10pt,oneside}{article} +} + + +\DeclareOption{ps}{% + \PassOptionsToClass{10pt,oneside}{article} +} + +\DeclareOption{ss}{% + \PassOptionsToClass{10pt,oneside}{article} +} + +\DeclareOption{ejs}{% + \PassOptionsToClass{10pt,oneside}{article} +} + +\DeclareOption{lnms}{ + \PassOptionsToClass{10pt,twoside,leqno}{article} + \PassOptionsToPackage{leqno}{amsmath} +} + +\DeclareOption{coll}{ + \PassOptionsToClass{10pt,twoside,leqno}{article} + \PassOptionsToPackage{leqno}{amsmath} +} + + +\DeclareOption{aap}{% + \PassOptionsToClass{11pt,oneside,leqno}{article} + \PassOptionsToPackage{leqno}{amsmath} +} + +\DeclareOption{aop}{% + \PassOptionsToClass{11pt,oneside,leqno}{article} + \PassOptionsToPackage{leqno}{amsmath} +} + +\DeclareOption{aos}{% + \PassOptionsToClass{11pt,oneside,leqno}{article} + \PassOptionsToPackage{leqno}{amsmath} +} + +\DeclareOption{aoas}{% + \PassOptionsToClass{11pt,oneside,leqno}{article} + \PassOptionsToPackage{leqno}{amsmath} +} + + +\DeclareOption{sts}{% + \PassOptionsToClass{11pt,oneside,leqno}{article} + \PassOptionsToPackage{leqno}{amsmath} +} + +\DeclareOption{bj}{% + \PassOptionsToClass{10pt,oneside}{article} +} + +\DeclareOption{aihp}{% + \PassOptionsToClass{10pt,oneside,fleqn}{article} + \PassOptionsToPackage{fleqn}{amsmath} + \PassOptionsToPackage{numbers,sort&compress}{natbib} +} + + +\DeclareOption{bjps}{ + \PassOptionsToClass{11pt,twoside}{article} +} + +\DeclareOption{ssy}{% + \PassOptionsToClass{11pt,oneside,leqno}{article} + \PassOptionsToPackage{leqno}{amsmath} +} + + +\PassOptionsToPackage{psamsfonts}{amssymb} +\PassOptionsToPackage{cmex10}{amsmath} + +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} +\ProcessOptions* + +\LoadClass{article} + +\IfFileExists{imsart.sty}{}{\ClassError{imsart}{The complimentary style file "imsart.sty" is required}{ +The complimentary style file "imsart.sty" is required\MessageBreak +You need to install file "imsart.sty" in your system\MessageBreak +File could be downloaded from http://www.e-publications.org/ims/support +}} + +% Load additional macros and modifications for "article.cls" +\RequirePackage[generic]{imsart} + +\endinput +%% +%% History: +%% 2010.04.27 - support for the "Stochastic Systems" (ssy) added; +%% 2009.08.13 - options [numbers,sort&compress] from natbib package removed +%% 2009.05.21 - added new option "bjps" +%% 2008.01.09 - added new option "coll" +%% 2007.12.10 - added new option "aihp" +%% 2007.08.22 - aoas: default value for natbib set to authoryear +%% End of file `imsart.cls'. diff --git a/imsart.sty b/imsart.sty new file mode 100644 index 0000000..dd6086f --- /dev/null +++ b/imsart.sty @@ -0,0 +1,2936 @@ +%% This is file `imsart.sty' +%% +%% LaTeX 2e style file for the processing of LaTeX2e files +%% of the following IMS/BS journals: +%% +%% The Annals of Probability +%% The Annals of Applied Probability +%% The Annals of Statistics +%% The Annals of Applied Statistics +%% Statistical Science +%% Probability Surveys +%% Statistics Surveys +%% Electronic Journal of Statistics +%% IMS Lecture Notes-Monograph Series +%% IMS Collections +%% Bernoulli +%% Annales de l'Institut Henri Poincar\'e - Probabilit\'es et Statistiques +%% Brazilian Journal of Probability and Statistics +%% Stochastic Systems +%% +%% Institute of Mathematical Statistics, U.S.A. +%% Bernoulli Society +%% Institut Henry Poincare +%% Brazilian Statistical Association +%% +%% Macros written by Vytas Statulevicius, VTeX, Lithuania +%% for Institute of Mathematical Statistics, U.S.A. +%% Please submit bugs or your comments to vytas@vtex.lt +%% +%% The original distribution is located at: +%% http://www.e-publications.org/ims/support +%% +%% This style file contains additional macros and is designed to use +%% with standart "article.cls" +%% +%% You are free to use this style file as you see fit, provided +%% that you do not make changes to the file. +%% If you DO make changes, you are required to rename this file. +%% +%% It may be distributed under the terms of the LaTeX Project Public +%% License, as described in lppl.txt in the base LaTeX distribution. +%% Either version 1.0 or, at your option, any later version. +%% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +%% +%% Bug fixes and changes: at end of file + +% TeX programming: Vytas Statulevicius, VTeX, Lithuania, vytas@vtex.lt +% Requires Latex2e, ver.2000.06 + +\def\imsfmt@name{imsart} +\def\imsfmt@version{2011/01/24} + +\ProvidesFile{imsart.sty} + [\imsfmt@version IMS article style (VS)] + +% hyperref must be loaded after: +\@ifpackageloaded{hyperref}{\@latex@error{Package 'hyperref' must be loaded after 'imsart'!}\@ehc}{} + +% Passoptions to hyperref: + +\PassOptionsToPackage{colorlinks,citecolor=blue,urlcolor=blue,linkcolor=blue,pagecolor=blue,linktocpage=true}{hyperref} + +% General options: + +% Put keywords as footnote +\newif\if@keywordsasfootnote +\DeclareOption{keywordsasfootnote}{\@keywordsasfootnotetrue} + +% Put history as footnote +\newif\if@historyasfootnote +\DeclareOption{historyasfootnote}{\@historyasfootnotetrue} + +% Put address as footnote +\newif\if@addressasfootnote +\DeclareOption{addressasfootnote}{\@addressasfootnotetrue} + +% Put addresses at end of document +\newif\if@addressatend +\DeclareOption{addressatend}{\@addressatendtrue} + +% Put "." after inline section headings: +\newif\if@autosecdot +\DeclareOption{autosecdot} {\@autosecdottrue} +\DeclareOption{noautosecdot}{\AtBeginDocument{\@autosecdotfalse}} + +% Load amsmath style with corerect settings: +\newif\if@load@amsmath +\DeclareOption{amsmath}{\@load@amsmathtrue} + +% Load amsthm style with corerect settings: +\newif\if@load@amsthm +\DeclareOption{amsthm}{\@load@amsthmtrue} + +% Load amsmath with leqno option +\newif\if@amsmath@leqno + +% Load natbib with correct settings: +\newif\if@load@natbib +\DeclareOption{natbib}{\@load@natbibtrue} + +% For LNMS we need to create a TOC of book, so we will +% enable writing to .aux + +\newif\if@supertoc \@supertocfalse + +% Information about journals + +\def\set@generic{\def\@tempa{-generic}\ifx\journal@id\@tempa\let\affiliation\@gobble\fi} + +\DeclareOption{generic}{% + \AtEndOfPackage{\set@generic} + \def\journal@id{-generic}} + +\DeclareOption{ps}{% + \def\journal@id{-ps} + \def\journal@name{Probability Surveys } + \def\journal@issn{ISSN: 1549-5787} + \def\journal@url{http://www.i-journals.org/ps} + \AtEndOfPackage{\let\affiliation\@gobble}} + +% Information about journals +\DeclareOption{ss}{% + \def\journal@id{-ss} + \def\journal@name{Statistics Surveys } + \def\journal@issn{ISSN: 1935-7516} + \def\journal@url{http://www.i-journals.org/ss} + \AtEndOfPackage{\let\affiliation\@gobble}} + +% Information about journals +\DeclareOption{ejs}{% + \def\journal@id{-ejs} + \def\journal@name{Electronic Journal of Statistics } + \def\journal@issn{ISSN: 1935-7524} + \def\journal@url{http://projecteuclid.org/ejs} + \AtEndOfPackage{\let\affiliation\@gobble}} + +\DeclareOption{lnms}{% + \def\journal@id{-lnms} + \def\journal@name{IMS Lecture Notes--Monograph Series } + \@twosidetrue + \def\copyrightowner@text{Institute of Mathematical Statistics} + \def\journal@issn{$\copyright$~\ims@href{http://www.imstat.org}{\copyrightowner@text}, \@copyrightyear}% + \def\journal@url{http://www.imstat.org/publications/lecnotes.htm} + \set@page@layout{30pc}{610pt}% 30pc * 51 line + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@historyasfootnotetrue + \@keywordsasfootnotetrue + \@addressasfootnotetrue + \@supertoctrue + \AtBeginDocument{% + \setattribute{title} {skip} {28\p@} + \setattribute{keywordname}{size}{\itshape} + } +} + +\DeclareOption{coll}{% + \def\journal@id{-coll} + \def\journal@name{IMS Collections } + \@twosidetrue + \def\copyrightowner@text{Institute of Mathematical Statistics} + \def\journal@issn{$\copyright$~\ims@href{http://www.imstat.org}{\copyrightowner@text}, \@copyrightyear}% + \def\journal@url{http://www.imstat.org/publications/imscollections.htm} + \set@page@layout{30pc}{610pt}% 30pc * 51 line + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@historyasfootnotetrue + \@keywordsasfootnotetrue + \@addressasfootnotetrue + \@supertoctrue + \AtBeginDocument{% + \setattribute{title} {skip} {28\p@} + \setattribute{keywordname}{size}{\itshape} + } +} + + +% Options for the IMS journals: + +\DeclareOption{aap}{% + \def\journal@id{-aap} + \def\journal@name{Submitted to the Annals of Applied Probability } + \def\journal@url{http://www.imstat.org/aap/} + \set@page@layout{30pc}{550pt}% 30pc * 46 line + \@twosidetrue + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@historyasfootnotetrue + \@keywordsasfootnotetrue + \@addressatendtrue + \@imslayouttrue + \@autosecdottrue +} + +\DeclareOption{aop}{% + \def\journal@id{-aop} + \def\journal@name{Submitted to the Annals of Probability } + \def\journal@url{http://www.imstat.org/aop/} + \set@page@layout{30pc}{550pt}% 30pc * 46 line + \@twosidetrue + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@historyasfootnotetrue + \@keywordsasfootnotetrue + \@addressatendtrue + \@imslayouttrue + \@autosecdottrue +} + +\DeclareOption{aos}{% + \def\journal@id{-aos} + \def\journal@name{Submitted to the Annals of Statistics } + \def\journal@url{http://www.imstat.org/aos/} + \set@page@layout{30pc}{550pt}% 30pc * 46 line + \@twosidetrue + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@historyasfootnotetrue + \@keywordsasfootnotetrue + \@addressatendtrue + \@imslayouttrue + \@autosecdottrue +} + +\DeclareOption{aoas}{% + \def\journal@id{-aoas} + \def\journal@name{Submitted to the Annals of Applied Statistics } + \def\journal@url{http://www.imstat.org/aoas/} + \set@page@layout{30pc}{550pt}% 30pc * 46 line + \@twosidetrue + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@historyasfootnotetrue + \@keywordsasfootnotetrue + \@addressatendtrue + \@imslayouttrue + \@autosecdottrue +} + + +\DeclareOption{sts}{% + \def\journal@id{-sts} + \def\journal@name{Submitted to the Statistical Science } + \def\journal@url{http://www.imstat.org/sts/} + \set@page@layout{32pc}{658pt}% 32pc * 55 line + \@twosidetrue + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@stslayouttrue + \AtBeginDocument{\if@twocolumn\set@page@layout{42pc}{658pt}\fi} +} + +\DeclareOption{bj}{% + \def\journal@id{-bj} + \def\journal@name{Submitted to the Bernoulli} + \def\journal@url{http://isi.cbs.nl/bernoulli/} + \set@page@layout{32pc}{526pt}% 32pc * 44 line + \@twosidetrue + \@bjlayouttrue + \AtEndOfPackage{\let\affiliation\@gobble} +} + +\DeclareOption{aihp}{% + \def\journal@id{-aihp} + \def\journal@name{Submitted to the Annales de l'Institut Henri Poincar\'e - Probabilit\'es et Statistiques} + \def\journal@url{http://www.imstat.org/aihp} + \set@page@layout{39pc}{622pt}% 39pc * 52 line + \@twosidetrue + \@aihplayouttrue + \AtEndOfPackage{\let\affiliation\@gobble} +} + +\DeclareOption{bjps}{% + \def\journal@id{-bjps} + \def\journal@name{Submitted to the Brazilian Journal of Probability and Statistics} + \def\journal@url{http://www.redeabe.org.br} + \set@page@layout{30pc}{550pt}% 30pc * 46 line + \@twosidetrue + \@historyasfootnotetrue + \@keywordsasfootnotetrue + \@addressatendtrue + \@bjpslayouttrue +} + + +\DeclareOption{ssy}{% + \def\journal@id{-ssy} + \def\journal@name{Stochastic Systems } + \def\journal@url{http://www.i-journals.org/ssy/} + \def\copyrightowner@text{Institute of Mathematical Statistics} + \def\journal@issn{$\copyright$~\ims@href{http://www.imstat.org}{\copyrightowner@text}, \@copyrightyear}% + \set@page@layout{30pc}{550pt}% 30pc * 46 line + \@twosidetrue + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@historyasfootnotetrue + \@keywordsasfootnotetrue + \@addressatendtrue + \@imslayouttrue + \@autosecdottrue + \AtEndOfPackage{% + \setattribute{copyright}{text}{% + \url@fmt{}{\itshape}{\journal@name}{\journal@url}\break% + \@ifnonempty{\@pubyear\@volume\@issue\@pagerange\break}% + \doi@text\break% + }} +} + +%% Layouts: +% IMS journals AAP, AOP, AOS has a different layout: + +\newif\if@imslayout \@imslayoutfalse + +\DeclareOption{imslayout}{ + \def\journal@id{-imsgeneric} + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@historyasfootnotetrue + \@keywordsasfootnotetrue + \@addressatendtrue + \@imslayouttrue + \@autosecdottrue} + +% IMS STS journal layout also specific +\newif\if@stslayout \@stslayoutfalse +\DeclareOption{stslayout}{ + \def\journal@id{-stsgeneric} + \set@page@layout{32pc}{658pt}% 32pc * 55 line + \@twosidetrue + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@stslayouttrue + \AtBeginDocument{\if@twocolumn\set@page@layout{42pc}{658pt}\fi}} + +% BS BJ journal layout also specific: +\newif\if@bjlayout \@bjlayoutfalse + +% AIHP journal layout also specific: +\newif\if@aihplayout \@aihplayoutfalse + +% BJPS journal layout also specific: +\newif\if@bjpslayout \@bjpslayoutfalse + +% Spacing +\DeclareOption{doublespacing}{\doublespacing} +\DeclareOption{singlespacing}{\singlespacing} + +\def\singlespacing{\renewcommand{\baselinestretch}{}\large\normalsize} +\def\doublespacing{\renewcommand{\baselinestretch}{1.6}\large\normalsize} + +% Do not print id line at bottom of the page: +\DeclareOption{noinfoline}{\AtBeginDocument{\let\info@line\@empty}} +\DeclareOption{infoline} {\AtBeginDocument{\let\info@line\infoline@text}} + +% Put lines numbers in margins +\newif\ifnumberlines@ \numberlines@false +\DeclareOption{linenumbers}{\numberlines@true} +\DeclareOption{nolinenumbers}{\numberlines@false} + +% Combined options: + +% Use this option for submission for pier review: +\DeclareOption{submission}{% + \singlespacing + \AtBeginDocument{\let\info@line\infoline@text} + \numberlines@false} + +% use this option for pre-publication (preprint): + +\DeclareOption{preprint}{% + \singlespacing + \AtBeginDocument{\let\info@line\@empty} + \numberlines@false} + + + +% Initiate some info: +\def\journal@name{} +\def\journal@url{} +\def\journal@issn{} +\def\journal@id{} +\def\paper@url{} +\def\info@line{} +\def\copyrightowner@text{} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% set@page@layout + +% \set@page@layout{\textwidth}{\textheight} + +\def\set@page@layout#1#2{% +% + \setlength\textwidth{#1} + \@settopoint\textwidth + \setlength\textheight{#2} + \@settopoint\textheight +% +% make side margins equal: + \setlength\@tempdima {\paperwidth} + \addtolength\@tempdima {-\textwidth} + \setlength\oddsidemargin {.5\@tempdima} + \addtolength\oddsidemargin {-1in} + \setlength\evensidemargin {\oddsidemargin} + \@settopoint\oddsidemargin + \@settopoint\evensidemargin +% +% topmargin + \setlength\topmargin{\paperheight} + \addtolength\topmargin{-2in} + \addtolength\topmargin{-\headheight} + \addtolength\topmargin{-\headsep} + \addtolength\topmargin{-\textheight} + \addtolength\topmargin{-\footskip} % this might be wrong! + \addtolength\topmargin{-.5\topmargin} + \@settopoint\topmargin +} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Load imsart.cnf with additional options: +\@input{\imsfmt@name.cnf} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Execute options + +\ExecuteOptions{generic,infoline} +\ProcessOptions + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dimensions + +\setlength\parindent {12\p@} +\setlength\headsep {14\p@} +\setlength\footskip {14\p@} + +\setlength\smallskipamount{6\p@ \@plus 1\p@ \@minus 1\p@} +\setlength\medskipamount {12\p@ \@plus 3\p@ \@minus 3\p@} +\setlength\bigskipamount {18\p@ \@plus 3\p@ \@minus 3\p@} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% setattribute, getattribute, do@option@list + +\def\setattribute{\@ifnextchar[\@setattribute{\@setattribute[]}} +\def\@setattribute[#1]#2#3#4{\expandafter\gdef\csname #2@#3\endcsname{#4}} +\def\getattribute#1#2{\csname #1@#2\endcsname} +\def\sep@key@value#1=#2/?/#3{\setattribute{#3}{#1}{#2}} +\def\do@option@list#1#2{% + \@for\curr@option:={#2}\do{% + \expandafter\sep@key@value\curr@option/?/{#1}\relax + }% +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% newpseudoenvironment +% same as \newenvironment, but new environment do not have additional groups \bgroup \egroup +% (i.e. all definitions are not local + +\let\org@begin\begin +\let\org@end\end +\def\begin#1{% + \@ifundefined{pseudo@#1}% + {\org@begin{#1}}{\csname pseudo@#1\endcsname[0]\relax}% + } +\def\end#1{% + \@ifundefined{pseudo@#1}% + {\org@end{#1}}{\csname pseudo@#1\endcsname[1]\relax}% + } +\def\newpseudoenvironment#1#2#3{% + \expandafter\gdef\csname pseudo@#1\endcsname[##1]{% + \relax\ifcase##1\relax\def\@@next@@{#2}\or\def\@@next@@{#3}\else\let\@@next@@\relax\fi\@@next@@}% + } + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% pubyear, volume, paperno + +\def\pubyear#1{\gdef\@pubyear{(#1) }\gdef\@copyrightyear{#1 }} + \def\@pubyear{} + \def\@copyrightyear{} + +\def\volumetitle#1{\gdef\volume@title{#1 }} + +\def\volume#1{\gdef\@volume{Vol. #1 }} + \gdef\@volume{} + +\def\issue#1{\gdef\@issue{No. #1 }} + \gdef\@issue{} + +\def\paperno#1{\gdef\@paperno{Paper no. #1 }} + \gdef\@paperno{00} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% firstpage, lastpage, pagerange + +\newcounter{firstpage} +\newcounter{lastpage} + +\def\firstpage#1{\def\@tempa{#1}\ifx\@tempa\@empty\else + \global\c@firstpage=#1 + \global\c@lastpage=#1 + \global\c@page=#1 \ignorespaces\fi} + +\def\lastpage#1{\def\@tempa{#1}\ifx\@tempa\@empty\else + \global\c@lastpage=#1 + \ignorespaces\fi} + +\def\pagerange@sep{--} + +\def\set@pagerange{% + \ifnum\c@firstpage=0% + \else% + \ifnum\c@firstpage=\c@lastpage% + \gdef\@pagerange{\thefirstpage}% + \else% + \gdef\@pagerange{\thefirstpage\pagerange@sep\thelastpage}% + \fi% + \fi} + +\def\@pagerange{} + +\def\pagenumbering#1{% + \gdef\thefirstpage{\csname @#1\endcsname\c@firstpage}% + \gdef\thelastpage{\csname @#1\endcsname\c@lastpage}% + \gdef\thepage{\csname @#1\endcsname\c@page}% +} + +% hyperref redefines \pagenumbering, so we must override hyperref definition: +\let\ims@pagenumbering\pagenumbering + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% startlocaldefs, endlocaldefs + +\def\startlocaldefs{\makeatletter} +\def\endlocaldefs{\makeatother} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% thanksref, thanksmark, thankslabel, thankstext +% to be safe with hyperref we will use original LaTeX definitions: +% + +\def\saferef#1{\expandafter\safe@setref\csname r@#1\endcsname\@firstoftwo{#1}} +\let\safe@setref\@setref + +\def\safelabel#1{\@bsphack + \protected@write\@auxout{}% + {\string\thanksnewlabel{#1}{{\@currentlabel}{\thepage}}}% + \@esphack} + +\long\def\safe@footnotetext#1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \color@begingroup + \def\@thefnmark{}% + \@makefntext{% + \rule\z@\footnotesep\ignorespaces #1\@finalstrut\strutbox}% + \color@endgroup}}% + + +\long\def\orig@footnotetext#1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% + \color@endgroup}}% + + + +\let\thanksnewlabel\newlabel + +% we want to use various counters: +\def\usethankscounter#1{% + \@ifundefined{current@thankscounter}{\gdef\previous@thankscounter{#1}}{\xdef\previous@thankscounter{\current@thankscounter}}% + \def\current@thankscounter{#1}} + +\def\restorethankscounter{\xdef\current@thankscounter{\previous@thankscounter}} + +\newcounter{thanks} +\def\thethanks{\@fnsymbol\c@thanks} +\usethankscounter{thanks} + +% address ref: +\newcounter{addressref} +\def\theaddressref{\arabic{addressref}} + + +%\def\thanksmark@fmt#1{\hbox{$^{#1}$}} +\def\thanksmark@fmt#1{\@textsuperscript{\normalfont#1}} +\def\thanksref@sep{,} + +% hooks for the hyperref: +\def\thankref@hyperlink#1{\saferef{#1thanks}} +\def\thanks@hypertarget#1{} + +% Isvedame zymes +\def\thanksref{\@ifnextchar[{\@tempswatrue\@thanksref}{\@tempswafalse\@thanksref[]}} + +\def\@thanksref[#1]#2{% + \if@tempswa% [] + \thanksmark@fmt{#1}% + \else% + \let\@tempa\@empty% + \thanksmark@fmt{\@for\@tempb:=#2\do{% + \@tempa\let\@tempa\thanksref@sep% + \edef\@tempb{\expandafter\@firstofone\@tempb\@empty}% + \thankref@hyperlink{\@tempb}}}% + \fi} + +% Suformuojame ir isvedame zyme +\def\thanksmark{\@ifnextchar[{\@tempswatrue\@thanksmark}{\@tempswafalse\@thanksmark[]}} + +\def\@thanksmark[#1]#2{% + \@thankslabel[#1]{#2}% + \safelabel{#2thanks}% + \thanksmark@fmt{\expandafter\saferef{#2thanks}\thanks@hypertarget{#2}}} + +% Suformuojame tik zyme +\def\thankslabel{\@ifnextchar[{\@tempswatrue\@thankslabel}{\@tempswafalse\@thankslabel[]}} + +\def\@thankslabel[#1]#2{% + \if@tempswa% [] + \protected@edef\@currentlabel{#1}% + \else% + \refstepcounter{\current@thankscounter}% + \fi% + \safelabel{#2thanks}}% + +% Suformuojame zyme ir idedame teksta i \@thanks: +\def\thankstext{\@ifnextchar[{\@tempswatrue\@thankstext}{\@tempswafalse\@thankstext[]}} + +\def\@thankstext[#1]#2#3{% + \@thankslabel[#1]{#2}% + \protected@xdef\@thanks{\@thanks\protect\thanks@thefnmark{#2thanks}% + \protect\orig@footnotetext{\thanks@hypertarget{#2}#3}}}% + +\def\thanks@thefnmark#1{\begingroup\unrestored@protected@xdef\@thefnmark{\saferef{#1}}\endgroup}% + + + +% ST makrosas savo numeracijos sistemos sukurimui +\def\setvaluelist#1#2{\@tempcnta=0\relax + \@for\@curr@val:=#2\do{% + \advance\@tempcnta by1\relax + \expandafter\protected@xdef\csname #1@item@\the\@tempcnta\endcsname{\@curr@val}% + }% + \expandafter\protected@xdef\csname #1@item@0\endcsname{\the\@tempcnta}% +} +\xdef\getitemvalue#1#2{\noexpand\csname #1@item@#2\endcsname} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ead, \printead + +\RequirePackage{keyval} + +\def\email@text{e-mail: } +\def\url@text{url: } +\def\fullurl@text{url: } +\def\ead@sep{;~} +\let\ead@size\relax +\def\printead@fmt#1{#1} + +% for BJ journal: +\newcounter{emailref} +\setvaluelist{emailmarks}{*,**,\textdagger,\textdaggerdbl} +\def\theemailref{\getitemvalue{emailmarks}{\the\c@emailref}} +\define@key{ead}{mark}[true]{\usethankscounter{emailref}\thankslabel{\ead@label}} + + +% naudojame keyval paketa +\define@key{ead}{email}[true]{\def\ead@type{email}} +\define@key{ead}{url}[true]{\def\@tempa{fullurl}\ifx\ead@type\@tempa\else\def\ead@type{url}\fi} +\define@key{ead}{label}{\def\ead@label{#1}} + +\define@key{ead}{text}{% + \bgroup% + \def\\{\string\break} + \def\break{\string\break}% + \protected@edef\@currentlabel{#1}% + \safelabel{\ead@label @\ead@type text}% + \egroup} + +\define@key{ead}{nopdflink}[true]{% + \protected@edef\@currentlabel{nolink}% + \safelabel{\ead@label @nopdflink}} + + +\DeclareRobustCommand\ead[2][label= ,email]{{% + \def\ead@type{email}% default + \checkead@prefix#2://\end% + \def\texttildelow{\noexpand\texttildelow}% + \setkeys{ead}{#1}% + \protected@edef\@currentlabel{#2}% + \safelabel{\ead@label @\ead@type}}} + +\def\checkead@prefix#1://#2\end{\ifx.#2.\else\def\ead@type{fullurl}\fi} + +\newif\ifnot@ead@star +\newif\if@printead@opt + +\DeclareRobustCommand{\printead}{\@ifstar{\not@ead@starfalse\@printead}{\not@ead@startrue\@printead}} + +\def\@printead{\@ifnextchar[{\@printead@opttrue\@@printead}{\@printead@optfalse\@@printead[]}} + +\def\@@printead[#1]#2{{% + \if@printead@opt%[] + \def\ims@href@text{#1}% + \not@ead@starfalse% + \fi% + \let\prev@ead@text\relax% + \let\@ead@sep\relax% + \let\ead@text\relax% + \let\ead@prefix\relax% + \def\ead@type{}% + \@tempcnta=0% + \let\sv@ims@href\ims@href% + \printead@fmt{\@for\ead@ref:=#2\do{% + \advance\@tempcnta by1% + \let\ims@href\sv@ims@href% + \@ead@sep\let\@ead@sep\ead@sep% + \@ifundefined{r@\ead@ref @nopdflink}{}{\def\ims@href##1##2{##2}}% + \@ifundefined{r@\ead@ref @email}{}{\let\ead@text\email@text\def\ead@type{email}\def\ead@prefix{mailto:}}% + \@ifundefined{r@\ead@ref @url}{}{\let\ead@text\url@text\def\ead@type{url}\def\ead@prefix{http://}}% + \@ifundefined{r@\ead@ref @fullurl}{}{\let\ead@text\fullurl@text\def\ead@type{fullurl}\def\ead@prefix{}}% + \ifx\prev@ead@text\ead@text\let\ead@text\relax\fi% + \if@printead@opt\ifnum\@tempcnta>1\@latex@error{Command \@backslashchar printead[]{e1} could have only one parameter "e1"!}\@eha\fi% + \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% + \ifnot@ead@star\ead@text\fi{\ead@size\def\null{}\ims@href{\ead@prefix\saferef{\ead@ref @\ead@type}}{\ims@href@text}}% + \@ifundefined{ead@text}{}{\let\prev@ead@text\ead@text}}}% +}} + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \copyrightowner, \corref + +\def\copyrightowner#1{\def\copyrightowner@text{#1}} + + +% for corresponding author +\def\corref#1{} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% normaltext, nohyphen, today + +% normalus tekstas (justify) +\def\normaltext{\let\\=\@normalcr% + \leftskip\z@ \@rightskip\z@ \rightskip\@rightskip% + \parfillskip\@flushglue} + +% skiemenavimo isjungimas +\def\nohyphen{\pretolerance=\@M \tolerance=\@M \hyphenpenalty=\@M \exhyphenpenalty=\@M} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \@ifemptyhbox + +\def\@ifnonempty#1{% + \setbox\@tempboxa\hbox{\ignorespaces #1}% + \ifdim\wd\@tempboxa>1pt #1\fi} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\pagestyle{imsheadings} \thispagestyle{copyright} + + +\if@twoside + +\def\ps@imsheadings{% + \def\@oddfoot{\hfill\info@line}% + \let\@evenfoot\@oddfoot% + \def\@evenhead{\runninghead@size\rlap{\pagenumber@size\thepage}\evenhead@fmt{\leftmark}}% + \def\@oddhead{\runninghead@size\oddhead@fmt{\rightmark}\llap{\pagenumber@size\thepage}}} +\else +\def\ps@imsheadings{% + \def\@oddfoot{\hfill\info@line}% + \let\@evenfoot\@oddfoot% + \def\@evenhead{\runninghead@size\hfill\leftmark\rightmark\hfill\llap{\pagenumber@size\thepage}}% + \def\@oddhead{\runninghead@size\hfill\leftmark\rightmark\hfill\llap{\pagenumber@size\thepage}}} +% \def\@evenhead{\runninghead@size\hfill\leftmark/\rightmark\hfill\llap{\pagenumber@size\thepage}}% +% \def\@oddhead{\runninghead@size\hfill\leftmark/\rightmark\hfill\llap{\pagenumber@size\thepage}}} +\fi + +\def\ps@copyright{\let\@mkboth\@gobbletwo% + \def\@evenhead{\parbox[t]{\textwidth}{\copyright@size\copyright@text}}% + \let\@oddhead\@evenhead% + \def\@oddfoot{\hfill\pagenumber@size\thepage\hfill\llap{\info@line}}% + \let\@evenfoot\@oddfoot} + +\def\evenhead@fmt#1{\hfill#1\hfill} +\def\oddhead@fmt#1{\hfill#1\hfill} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% url@fmt + + +\def\journalurl#1{\def\journal@url{#1}} +\def\paperurl#1{\def\paper@url{#1}} + +% DOI + +\def\doi#1{% + \gdef\@doi{#1}% + \gdef\doi@text{\url@fmt{DOI: }{\ttfamily}{#1}{\doi@base\@doi}}% +} + +\let\@doi\relax + +\def\doi@base{http://dx.doi.org/} + +% arXiv + + +\def\arxiv#1{% + \gdef\@arxiv{#1}% + \gdef\doi@text{\url@fmt{arXiv: }{\ttfamily}{#1}{\arxiv@base\@arxiv}}% +} + +\let\@arxiv\relax + +% http://arxiv.org/abs/math.PR/0603300 + +\def\arxiv@base{http://arxiv.org/abs/} + + +% {url}{text} +\def\ims@href#1#2{#2} + +% {prefix}{font}{text}{url} + +\def\url@fmt#1#2#3#4{% + \edef\@tempa{#3}% + \ifx\@tempa\@empty% + \else% + #1{#2\ims@href{#4}{#3}}% + \fi} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LIST ENVIRONMENTS + +\parsep\z@ +\topsep\smallskipamount +\partopsep\z@ +\itemsep\z@ +\labelsep.5em + +\def\@listI{\leftmargin\leftmargini + \parsep\z@ + \topsep\smallskipamount + \itemsep\z@} + +\def\list@parindent{1pc} + +% quotation +\let\quotation@size\footnotesize +\def\quotation@itemindent{\list@parindent} +\def\quotation@parindent{\list@parindent} +\def\quotation@leftmargin{\list@parindent} +\let\quotation@rightmargin\z@ +\let\quotation@topsep\smallskipamount + +\def\quotation{% + \list{}{\quotation@size% + \listparindent\quotation@parindent% + \itemindent \quotation@itemindent% + \rightmargin\quotation@rightmargin \leftmargin\quotation@leftmargin% + \partopsep\z@ \topsep\quotation@topsep \parsep\z@% + }% + \item[\Q@strut]\relax} + +\def\endquotation{\endlist} + +\def\Q@strut{\leavevmode\hbox{\vrule height9pt depth1pt width0pt}} + +% quote +\let\quote@size\footnotesize +\def\quote@indent{\z@} +\def\quote@leftmargin{2pc} +\def\quote@rightmargin{2pc} +\let\quote@topsep\smallskipamount + +\def\quote{% + \list{}{\quote@size% + \listparindent\quote@indent% + \itemindent \listparindent% + \rightmargin\quote@rightmargin \leftmargin\quote@leftmargin% + \partopsep\z@ \topsep\quote@topsep \parsep\z@% + }% + \item\relax} + +\def\endquote{\endlist} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% table, figure + +\def\fnum@table{\tablename~\thetable} +\setlength\belowcaptionskip{4\p@} + +\renewenvironment{table} + {\let\@makecaption\@maketablecaption\@float{table}} + {\end@float} +\renewenvironment{table*} + {\let\@makecaption\@maketablecaption\@dblfloat{table}} + {\end@dblfloat} + +\long\def\@maketablecaption#1#2{% + \tablecaption@shape\tablecaption@size% + {\tablename@size #1}\tablename@skip #2\par + \vskip\belowcaptionskip} + +\setattribute{tablecaption}{shape}{\centering} +\setattribute{tablecaption}{size} {\footnotesize\itshape} +\setattribute{tablename} {size} {\scshape} +\setattribute{tablename} {skip} {\endgraf} + + +% figure : use \@makecaption: +\renewcommand\figurename{Fig} + +\long\def\@makecaption#1#2{% + \vskip\abovecaptionskip + \footnotesize + \sbox\@tempboxa{\itshape\textsc{#1}. #2}% + \ifdim \wd\@tempboxa >\hsize + \itshape\textsc{#1}. #2\par + \else + \global \@minipagefalse + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% + \fi + \vskip\belowcaptionskip} + +\long\def\@makecaption#1#2{% + \vskip\abovecaptionskip + \figurecaption@size + \sbox\@tempboxa{{\figurename@size #1}\figurename@skip #2}% + \ifdim \wd\@tempboxa >\hsize + {\figurename@size #1}\figurename@skip #2\par + \else + \global \@minipagefalse + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% + \fi + \vskip\belowcaptionskip} + +\setattribute{figurecaption}{size}{\footnotesize\itshape} +\setattribute{figurename} {size}{\scshape} +\setattribute{figurename} {skip}{.~} + + +\def\@floatboxreset{% + \reset@font + \@setminipage + \singlespacing + \footnotesize + \centering +} + +\if@aihplayout + \setattribute{tablecaption}{size} {\footnotesize} + \setattribute{figurecaption}{size}{\footnotesize} +\fi + +\if@bjpslayout + \setattribute{tablename} {size} {\bfseries\upshape} + \setattribute{tablename} {skip} {\enskip} + + \setattribute{figurename} {size}{\bfseries\upshape} + \setattribute{figurename} {skip}{\enskip} + \def\figurename{Figure} +\fi + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FOOTNOTE + +\renewcommand\@makefntext[1]{% + \parindent12pt\@makefnmark #1} + +\def\@makefnmark{\@textsuperscript{\normalfont\@thefnmark}}% + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION commands: +% from latex.ltx: +% Two improvements: +% 1. if section command is defined as "inline" the '.' will be inserted after heading; +% 2. section* will write to toc and will appear in pdf bookmarks + +% dirty trick... +\def\@startsection#1#2#3#4#5#6{% + \if@noskipsec \leavevmode \fi + \par + \@tempskipa #4\relax + \@afterindenttrue + \ifdim \@tempskipa <\z@ + \@tempskipa -\@tempskipa \@afterindentfalse + \fi + \if@nobreak + \everypar{}% + \else + \addpenalty\@secpenalty\addvspace\@tempskipa + \fi + \@ifstar + {\def\ssection@level{#2}\@ssect{#3}{#4}{#5}{#6}}% + {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}} + +% Trick for the hyperref: +\def\setaftersec@dot#1{\if@autosecdot\setbox0=\hbox{#1}\ifdim\wd0>0\p@\def\aftersec@dot{.}\else\def\aftersec@dot{}\fi\fi} +\let\aftersec@dot\relax + +% section - will add hook for the dot after section heading +\def\@sect#1#2#3#4#5#6[#7]#8{% + \ifnum #2>\c@secnumdepth + \let\@svsec\@empty + \else + \refstepcounter{#1}% + \protected@edef\@svsec{\@seccntformat{#1}\relax}% + \fi + \@tempskipa #5\relax + \ifdim \@tempskipa>\z@ + \begingroup + #6{% + \@hangfrom{\hskip #3\relax\@svsec}% + \interlinepenalty \@M #8\@@par}% + \endgroup + \csname #1mark\endcsname{#7}% + \addcontentsline{toc}{#1}{% + \ifnum #2>\c@secnumdepth \else + \protect\numberline{\csname the#1\endcsname}% + \fi + #7}% + \else + \setaftersec@dot{#8}% + \def\@svsechd{% + #6{\hskip #3\relax + \@svsec #8\aftersec@dot}% + \csname #1mark\endcsname{#7}% + \addcontentsline{toc}{#1}{% + \ifnum #2>\c@secnumdepth \else + \protect\numberline{\csname the#1\endcsname}% + \fi + #7}}% + \fi + \@xsect{#5}} + +% section* - will add hook for the dot after section heading and \contentsline +\def\@ssect#1#2#3#4#5{% + \@tempskipa #3\relax + \ifdim \@tempskipa>\z@ + \begingroup + #4{% + \@hangfrom{\hskip #1}% + \interlinepenalty \@M #5\@@par}% + \endgroup + \else + \setaftersec@dot{#5}% + \def\@svsechd{#4{\hskip #1\relax #5\aftersec@dot}}% + \fi + \ifnum\ssection@level=1\phantomsection\addcontentsline{toc}{section}{#5}\fi% + \@xsect{#3}} + +% Block adding to contents for the next command only: +\def\nocontentsline{% + \let\@@addcontentsline\addcontentsline% + \ifx\hyper@anchor\@undefined + \def\addcontentsline##1##2##3{\let\addcontentsline\@@addcontentsline} + \else + \def\addcontentsline##1##2##3##4{\let\addcontentsline\@@addcontentsline} + \fi +} + + +% \phantomsection is defined in hyperref +\let\phantomsection\relax + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FRONTMATTER SETTINGS + +% FRONT MATTER FORMATTING PARAMETERS + +\setattribute{frontmatter} {style} {\centering} +\setattribute{title} {style} {\centering} +\setattribute{author} {style} {\centering} +\setattribute{address} {style} {\centering} +\setattribute{abstract} {style} {\normaltext} +\setattribute{keyword} {style} {\normaltext} +\setattribute{history} {style} {\normaltext} + +% FRONT MATTER SKIPS +\setattribute{title} {skip} {18\p@} +\setattribute{atltitle} {skip} {14\p@} +\setattribute{authors} {skip} {12pt} +\setattribute{dedicated} {skip} {12\p@} +\setattribute{address} {skip} {6\p@ plus 1\p@ minus 1\p@} +\setattribute{affiliation} {skip} {6\p@ plus 1\p@ minus 1\p@} +\setattribute{abstract} {skip} {10\p@} +\setattribute{abstractname}{skip} {:\enskip} +\setattribute{keyword} {skip} {10\p@} +\setattribute{history} {skip} {10\p@} +\setattribute{frontmatter} {cmd} {\vskip20\p@ plus 3\p@ minus 3\p@ + \@afterindentfalse\@afterheading} +\setattribute{firstpage} {cmd} {} + +% FRONT MATTER DIMENSIONS +\setattribute{abstract} {width} {.8\textwidth} +\setattribute{abstract} {indent} {0\p@} +\setattribute{keyword} {width} {.8\textwidth} +\setattribute{keyword} {indent} {0\p@} % +\setattribute{history} {width} {.8\textwidth} + +% FRONT MATTER FONTS +\setattribute{dochead} {size} {\Large\bfseries} +\setattribute{title} {size} {\LARGE\bfseries} +\setattribute{author} {size} {\normalsize\bfseries} +\setattribute{fnms} {size} {} +\setattribute{snm} {size} {} +\setattribute{address} {size} {\footnotesize\itshape\mdseries} +\setattribute{affiliation}{size} {\footnotesize\itshape\mdseries} +\setattribute{dedicated} {size} {\normalsize\itshape} +\setattribute{ead} {size} {\upshape\ttfamily} +\setattribute{abstract} {size} {\footnotesize\upshape\mdseries} +\setattribute{abstractname}{size} {\bfseries} +\setattribute{keyword} {size} {\footnotesize\upshape\mdseries} +\setattribute{keywordname}{size} {\bfseries} +\setattribute{history} {size} {\footnotesize\mdseries} +\setattribute{copyright} {size} {\footnotesize\raggedright} +\setattribute{runninghead}{size} {\footnotesize\itshape} +\setattribute{pagenumber} {size} {\footnotesize\upshape} +\setattribute{thebibliography}{size}{\normalsize} + +% FRONT MATTER CASE +\setattribute{dochead} {case} {} +\setattribute{title} {case} {} +\setattribute{runninghead}{case} {} + +% TEXT, etc. +\setattribute{doi} {text} {\url@fmt{url: }{\ttfamily}{\paper@url}{\paper@url}} +\setattribute{copyright} {text} {\url@fmt{}{\bfseries}{\journal@name}{\journal@url}\break% + \@ifundefined{volume@title}{}{\textbf{\volume@title}\break}% + \@ifnonempty{\@volume\@pubyear\@pagerange\break}% + \@ifnonempty{\journal@issn\break}% + \doi@text}% + +\setattribute{infoline} {text} {\lower12pt \hbox{\footnotesize\ttfamily\imsfmt@name\journal@id\ ver. \imsfmt@version\ file: \jobname.tex\ date: \today}} +\setattribute{copyright} {owner} {$\copyright$~\@copyrightyear \copyrightowner@text} +\setattribute{author} {prefix} {} +\setattribute{keyword} {postfix} {\unskip.} + +\def\abstractname{Abstract} + +% HISTORY +\setattribute{history} {prefix} {} +\setattribute{history} {postfix} {.} +\setattribute{received} {prefix} {Received~} +\setattribute{received} {postfix} {} +\setattribute{revised} {prefix} {; revised~} +\setattribute{revised} {postfix} {} +\setattribute{accepted} {prefix} {; accepted~} +\setattribute{accepted} {postfix} {} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FRONTMATTER STUFF + +% COUNTERS, ETC +\newcounter{author} +\newcounter{address} +\newdimen\sv@mathsurround +\def\author@num{0} + +% RUNNING HEAD +\def\runtitle#1{\gdef\@runtitle{\runninghead@case{#1}}} \def\@runtitle{} +\def\runauthor#1{{\def\etal{et al.}\gdef\@runauthor{\runninghead@case{#1}}}} \def\@runauthor{} + +\newdimen\sv@parindent +\sv@parindent\parindent + +\newbox\fm@box +\newdimen\fm@size + +\let\hy@frontmatter\relax +\let\hy@endfrontmatter\relax +\let\tableofcontents@fmt\relax + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FRONTMATTER + +\def\frontmatter{% + \global\c@author\z@ + \global\c@address\z@ + \renewcommand\thefootnote{\@fnsymbol\c@footnote}% +% + \if@changetoc + \let\old@tableofcontents\tableofcontents% + \def\tableofcontents{\let\tableofcontents@fmt\old@tableofcontents}% + \fi +% + \def\pdftitle##1{\write@pdfinfo{\user@hy@title}{##1}} + \def\pdfauthor##1{\write@pdfinfo{\user@hy@author}{##1}} + \def\pdfsubject##1{\write@pdfinfo{\user@hy@subject}{##1}} + \def\pdfkeywords##1{\write@pdfinfo{\user@hy@keywords}{##1}} +% + \if@supertoc% + \addtocontents{toc}{\protect\contentsline{begintocitem}{}{}{}}% + \addtocontents{toc}{\protect\contentsline{jobname}{\jobname}{}{}} + \ifx\@doi\relax \else\addtocontents{toc}{\protect\contentsline{doi}{\@doi}{}{}}\fi% + \ifx\@arxiv\relax \else\addtocontents{toc}{\protect\contentsline{arxiv}{\@arxiv}{}{}}\fi% + \fi +% + \sv@mathsurround\mathsurround \m@th + \parindent\z@ + \hy@frontmatter + \global\let\maketitle\relax + \open@fm \ignorespaces} +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ENDFRONTMATTER + +\def\endfrontmatter{% + \global\@topnum\z@ + \set@pagerange + \markboth{\@runauthor}{\@runtitle}% + \thispagestyle{empty}% +% \thispagestyle{copyright}% +% + \put@fmt@data% +% + \close@fm +% + \firstpage@cmd +% + \write@pdfinfo{\hy@author}{\the\authors@list} + \write@pdfinfo{\hy@subject}{\journal@name\@copyrightyear\@volume\@issue\@pagerange} + \write@pdfinfo{\hy@keywords}{\the\keywords@list} +% + \if@supertoc% + \addtocontents{toc}{\protect\contentsline{author}{\the\authors@list}{\thepage}{}}% + \addtocontents{toc}{\protect\contentsline{endtocitem}{}{}{}}% + \fi% +% + \write\@mainaux{\string\gdef\string\author@num{\the\c@author}} + \hy@endfrontmatter + \global\mathsurround\sv@mathsurround + \global\c@footnote\z@ + \global\let\@thanks\@empty + \let\title\relax + \let\author\relax + \let\address\relax + \let\frontmatter\relax \let\endfrontmatter\relax + \let\@maketitle\relax \let\@@maketitle\relax + \aftergroup\frontmatter@cmd + } + + +\def\put@fmt@data{% + \copyright@fmt% + \@thanks% + \abstract@fmt% + \keyword@fmt% + \history@fmt + \tableofcontents@fmt} + + +\newdimen\t@xtheight +\def\init@settings{ +\splittopskip=\topskip \splitmaxdepth=\maxdepth +\t@xtheight\textheight \advance\t@xtheight-\splittopskip} + +\def\no@harm{\let\thanks=\@gobble\let\thanksref=\@gobble\let~\space\def\ead[##1]##2{}\let\\=\@empty \def\protect{\noexpand\protect\noexpand}} + +\def\open@fm{% + \global\setbox\fm@box=\vbox\bgroup + \hsize=\textwidth + \frontmatter@style} + +\def\close@fm{% + \par \egroup + \fm@size=\dp\fm@box \advance\fm@size by \ht\fm@box + \@whiledim\fm@size>\t@xtheight \do{% + \global\setbox\@tempboxa=\vsplit\fm@box to \t@xtheight + \unvbox\@tempboxa + \fm@size=\dp\fm@box \advance\fm@size by \ht\fm@box} + \if@twocolumn + \emergencystretch=1pc \twocolumn[\unvbox\fm@box] + \else + \unvbox\fm@box + \fi} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DOCHEAD +\def\dochead#1{% + \bgroup + \dochead@size + \leavevmode\vphantom{\strut}\dochead@case{#1}\par + \egroup + \setattribute{title}{skip}{8\p@}} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TITLE +\def\title#1{% + \vglue\title@skip% +% check if we are in {frontmatter} + \def\reserved@a{frontmatter} + \ifx\reserved@a\@currenvir \else \hy@frontmatter\fi + \bgroup% + \no@harm% + \let\protect\relax% + \xdef\@argi{#1}% + \xdef\@title{#1}% + \egroup% + \write@pdfinfo{\hy@title}{\@argi} + \if@supertoc% + \addtocontents{toc}{\protect\contentsline{title}{\@argi}{\thepage}{}}% + \fi% + \bgroup% + \title@style\title@size\title@case{#1}\par% + \egroup} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ATLTITLE + +\def\atltitle#1{% + \vglue\atltitle@skip% + \bgroup + \title@size #1\par% + \egroup} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AUTHOR + +% AUG - author block +\def\smart@par{\ifhmode\par\fi} +\newenvironment{aug}{}{\smart@par} + + +\def\and{\unskip~and~} + +\def\author{\@ifnextchar[{\author@fmt}{\author@fmt[]}} + +\def\author@fmt[#1]#2{% + \stepcounter{author}% + \author@fmt@init% + \let\author@fmt@init\relax% + \bgroup% + \def\degs##1{##1}\def\fnms##1{##1}\def\inits##1{##1}\def\snm##1{##1}\def\roles##1{##1}% + \@tempcnta=\author@num\relax% + \ifnum\c@author=\@tempcnta \def\author@sep{ and }\else \def\author@sep{, }\fi% + \ifnum\c@author=1\addto@authors@list{#2}\else\addto@authors@list{\author@sep #2}\fi% + \def\fnms##1{{\fnms@size{##1}}}\def\snm##1{\snm@size{##1}}% + \noindent#2\thanksref{#1}% + \egroup} + +\def\author@fmt@init{% + \vskip\authors@skip% + \noindent\leavevmode\author@style\author@size\author@prefix } + +\let\author@fmt@init@def\author@fmt@init + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEDICATED +\def\dedicated#1{% + \vskip\dedicated@skip + \bgroup + \dedicated@size #1\par + \egroup} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ADDRESS +\def\address{\@ifnextchar[{\address@fmt}{\address@fmt[]}} + +\def\address@fmt[#1]#2{% + \smart@par% + \let\author@fmt@init\author@fmt@init@def + \vskip\address@skip% + {\address@style\address@size\leavevmode\ifx.#1.\else\usethankscounter{addressref}\thanksmark{#1}\restorethankscounter\fi#2\par}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AFFILIATION + +\def\affiliation{\@ifnextchar[{\affiliation@fmt}{\affiliation@fmt[]}} + +\def\affiliation@fmt[#1]#2{% + \smart@par% + \let\author@fmt@init\author@fmt@init@def% + \vskip\affiliation@skip% + \def\affiliation@skip{\z@}% + \bgroup + \affiliation@size% + \leavevmode% + \ifx.#1.\else\usethankscounter{addressref}\thanksmark{#1}\restorethankscounter\fi% + #2\par + \egroup +} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CONTRIBUTOR +% For LNMS we must write as index entry: +% \contributor{Author, F.}{University} +% \indexentry{Author, F., \textit {Some University}}{} + +\let\contributor\@gobbletwo +\if@supertoc + \def\contributor#1#2{% + \addtocontents{idx}{\protect\indexentry{#1, \protect\textit{#2}}{}}% + } +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COPYRIGHTOWNER + +\def\copyright@fmt{% + \@ifundefined{\copyrightowner@text}{}{\safe@footnotetext{\copyright@owner}} + } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ABSTRACT + +\newbox\abstract@box + +\define@key{abstract}{language}{\set@loc@hyphenation{#1}\set@loc@abstractname{#1}} + +\gdef\abstract{\@ifnextchar[{\@abstract}{\@abstract[]}} + +\def\@abstract[#1]{% + \setkeys{abstract}{#1}% + \global\setbox\abstract@box=\vbox\bgroup% + \ifvoid\abstract@box\else% + \unvbox\abstract@box% + \vskip\abstract@skip% + \fi% + \@tempdima\textwidth% + \advance\@tempdima by-\abstract@width% + \divide\@tempdima by2% + \abstract@style% + \leftskip\@tempdima\rightskip\@tempdima% + \abstract@size% + \parindent\sv@parindent% + \noindent\hskip\abstract@indent{\abstractname@size\abstractname\abstractname@skip}\ignorespaces} + +\def\endabstract{\par\egroup} + +\def\abstract@fmt{% + \ifvoid\abstract@box\else + \vskip\abstract@skip% + \unvbox\abstract@box + \fi} + +\def\set@loc@hyphenation#1{% + \@ifundefined{l@#1}{}{\expandafter\language\csname l@#1\endcsname}} + +\def\set@loc@abstractname#1{% + \def\abstractname@english{Abstract} + \def\abstractname@german{Zusammenfassung} + \def\abstractname@french{R\'esum\'e} + \def\abstractname@spanish{Resumen.} + \@ifundefined{abstractname@#1}% + {\@latex@error{Nera kalbos '#1` palaikymo!}{}}% + {\edef\abstractname{\csname abstractname@#1\endcsname}}% +} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HISTORY: received, revised, accepted + +\def\history@exist{0} + +\def\received#1{\def\@tempa{#1}\ifx\@tempa\@empty\else\gdef\@received{#1}\gdef\history@exist{1}\fi} + \def\@received{\@nil} +\def\revised#1{\def\@tempa{#1}\ifx\@tempa\@empty\else\gdef\@revised{#1}\gdef\history@exist{1}\fi} + \def\@revised{\@nil} +\def\accepted#1{\def\@tempa{#1}\ifx\@tempa\@empty\else\gdef\@accepted{#1}\gdef\history@exist{1}\fi} + \def\@accepted{\@nil} + +\def\empty@data{\@nil} + +\def\history@fmt{% + \ifcase\history@exist\else% + \bgroup + \nobreak% + \vskip\history@skip% + \nobreak% + \history@style% + \history@size% + \@tempdima\textwidth% + \advance\@tempdima by-\history@width% + \divide\@tempdima by2% + \leftskip\@tempdima + \rightskip\@tempdima + \leavevmode + \history@prefix + \ifx\@received\empty@data \else + \received@prefix\@received \received@postfix% + \fi + \ifx\@revised\empty@data \else + \revised@prefix\@revised \revised@postfix% + \fi + \ifx\@accepted\empty@data \else + \accepted@prefix\@accepted \accepted@postfix% + \fi + \history@postfix\par% + \egroup% + \gdef\history@exist{0} +\fi +} + +\def\sday#1{#1} +\def\smonth#1{\@ifundefined{month@item@#1}% + {\@latex@error{Nera tokio menesio, kurio numeris #1!}{??}}% + {\getitemvalue{month}{#1}}% + }% +\def\syear#1{#1} +\setvaluelist{month}{January,February,March,April,May,June,July,August,September,October,November,December} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KEYWORDS + +\newbox\keyword@box +\newdimen\pre@kwd@depth + +\setattribute{keyword}{AMS}{AMS 2000 subject classifications:} +\setattribute{keyword}{KWD}{Keywords and phrases:} +% raktas=class +\setattribute[default]{keyword}{class}{KWD} + +% \keyword@class-> KWD +% \keyword@KWD -> AMS 2000... + +\gdef\keyword{\@ifnextchar[{\@keyword}{\@keyword[class=KWD]}} + +\gdef\@keyword[#1]{% + \do@option@list{keyword}{#1}% + \def\keyword@name{\csname keyword@\keyword@class\endcsname}% + \let\kwd@sep\relax +% + \global\setbox\keyword@box=\vbox\bgroup% + \ifvoid\keyword@box\else% + \unvbox\keyword@box + \vskip-\pre@kwd@depth\vtop to\pre@kwd@depth{}% + \fi + \@tempdima\textwidth% + \advance\@tempdima by-\keyword@width% + \divide\@tempdima by2% + \keyword@style% + \leftskip\@tempdima\rightskip\@tempdima% + \keyword@size% + \parindent\sv@parindent% + \noindent\hskip\keyword@indent{\keywordname@size\keyword@name}\space\hskip.1pt} + +\def\endkeyword{\keyword@postfix\par\global\pre@kwd@depth\prevdepth\egroup} + +\def\keyword@fmt{% + \ifvoid\keyword@box\else + \vskip\keyword@skip% + \unvbox\keyword@box + \fi} + + +% \kwd[; ]{foo} + \def\sep{\unskip\string, }% + + \DeclareRobustCommand*\kwd{\@ifnextchar[\@kwd{\@kwd[\kwd@sep]}}% + \def\@kwd[#1]#2{\unskip#1{#2}\addto@keywords@list{#2, }\let\kwd@sep\sep}% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \maketitle +% if \frontmatter is not used, we will redefine \maketitle + +\def\local@maketitle{% + \global\@topnum\z@ + \set@pagerange + \markboth{\@runauthor}{\@runtitle}% + \thispagestyle{copyright}% +% + \put@fmt@data% +% +% \print@titlepage +% + \write@pdfinfo{\hy@author}{\the\authors@list} + \write@pdfinfo{\hy@keywords}{\the\keywords@list} + \hy@endfrontmatter + \global\mathsurround\sv@mathsurround + \global\c@footnote\z@ + \global\let\@thanks\@empty + \let\title\relax + \let\author\relax + \let\address\relax + \let\frontmatter\relax \let\endfrontmatter\relax + \let\@maketitle\relax \let\@@maketitle\relax + \normalfont\normaltext + \parindent\sv@parindent + \frontmatter@cmd + } + +\AtBeginDocument{\let\maketitle\local@maketitle} + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PROCESS LAYOUT OPTIONS + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Put keywords as footnote +\if@keywordsasfootnote + + \newtoks\keyword@toks + + \newpseudoenvironment{keyword}{\gdef\keyword@exist{1}\get@keyword@toks}{} + + \def\get@keyword@toks#1\end{\keyword@toks=\expandafter{\the\keyword@toks\keyword#1\endkeyword}\@gobble} + + \def\keyword@exist{0} + + \gdef\keyword#1{\@ifnextchar[{\@keyword}{\@keyword[class=KWD]}} + + \gdef\@keyword[#1]{% + \do@option@list{keyword}{#1}% + \def\keyword@name{\csname keyword@\keyword@class\endcsname}% + \let\kwd@sep\relax% + \keyword@style% + \keyword@size% + \parindent\sv@parindent% + \pre@kwd% + \hbox{\keywordname@size\keyword@name}\space\hskip.1pt}% + + \gdef\endkeyword{\gdef\pre@kwd{\par\leavevmode}} + + \let\pre@kwd\relax + + \def\keyword@fmt{\ifcase\keyword@exist\else\safe@footnotetext{\the\keyword@toks}\fi} + +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Put history as footnote +\if@historyasfootnote + + \def\history@fmt{% + \ifcase\history@exist\else% + \safe@footnotetext{% + \nobreak% + \history@style% + \history@size% + \leavevmode + \history@prefix + \ifx\@received\empty@data \else + \received@prefix\@received \received@postfix% + \fi + \ifx\@revised\empty@data \else + \revised@prefix\@revised \revised@postfix% + \fi + \ifx\@accepted\empty@data \else + \accepted@prefix\@accepted \accepted@postfix% + \fi + \history@postfix}%\par}% + \fi} + + + + + +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Put address as footnote +\if@addressasfootnote + \def\address@fmt[#1]#2{% + \ifx.#1.% + \safe@footnotetext{#2} + \else% + \usethankscounter{addressref}% + \bgroup + \def\\{\hfill\break} + \thankstext{#1}{#2}% + \egroup + \restorethankscounter% + \fi% + } +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Put address at end +\if@addressatend +\def\address{\@ifnextchar[{\address@fmt}{\address@fmt[default]}} +% +% \def\address@ref@A=1 +% \newtoks\@address@1 +% \@address@1={#2} +% +\def\address@fmt[#1]#2{% + \stepcounter{address}% + \expandafter\protected@xdef\csname address@ref@#1\endcsname{\the\c@address}% + \expandafter\newtoks\csname @address@\the\c@address\endcsname + \expandafter\expandafter\expandafter\global\csname @address@\the\c@address\endcsname={#2}} + +\let\safe@phantomsection\@gobble + +% print address by number: \printaddressnum{1} +\def\printaddressnum#1{% +\xdef\@tmp{#1}% +\bgroup +\@ifundefined{@address@#1}{\@latex@error{Error: there are no address with number '#1'!}{??}}{ + \address@size + \ifnum#1=1% + \safe@phantomsection{\addcontentsline{toc}{section}{Author's addresses}}% + \fi% + \begin{tabular}[t]{@{}l@{}} + \expandafter\expandafter\expandafter\the\csname @address@\@tmp\endcsname + \end{tabular}} +\egroup +} + +% print all addresses: +\def\address@par{\par\vskip3pt} + +\def\printaddresses{% +\vskip\address@skip% +%\addcontentsline{toc}{section}{Author's addresses}% +\def\last@right@glue{\par}% +\ifodd\c@address \def\last@right@glue{\hfill\hbox{}\address@par} \fi% +\ifnum\c@address=1 \def\last@right@glue{\address@par}\fi% +\@tempcnta=0% +\bgroup\parindent\z@ +\@whilenum{\@tempcnta<\c@address}% + \do{% + \advance\@tempcnta\@ne + \ifodd\@tempcnta \def\left@glue{} \def\right@glue{} % nelyginis + \else \def\left@glue{\hfill} \def\right@glue{\address@par}\fi % lyginis + \ifnum\@tempcnta=\c@address \let\left@glue\hfill \let\right@glue\last@right@glue\fi %paskutinis narys + \left@glue\expandafter\printaddressnum{\the\@tempcnta}\right@glue% + } +\egroup +} + +% invoke \printaddresses at end of document: +\let\old@enddocument\enddocument +\def\enddocument{\printaddresses\old@enddocument} + +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Set up parameters for the IMS journals (AOP, AAP, AOS) layout: +\if@imslayout + + \setattribute{title} {skip} {12\p@} + \setattribute{abstractname}{skip} {} + \setattribute{frontmatter} {cmd} {\vskip20\p@ plus 3\p@ minus 3\p@} + + \setattribute{abstract} {width} {23pc} + \setattribute{abstract} {indent} {16pt} %2em + + \setattribute{title} {size} {\normalsize\bfseries\mathversion{bold}\spaceskip.5em} + \setattribute{author} {size} {\normalsize\scshape} + \setattribute{affiliation}{size} {\normalsize\itshape} + \setattribute{address} {size} {\scriptsize\scshape} + \setattribute{ead} {size} {\upshape} + \setattribute{abstractname}{size}{\itshape} + \setattribute{keywordname}{size} {\itshape} + \setattribute{runninghead}{size} {\footnotesize} + \setattribute{pagenumber} {size} {\small} + \setattribute{copyright} {size} {\fontsize{6}{7}\selectfont\raggedright} + \setattribute{thebibliography}{size}{\footnotesize} + + \setattribute{dochead} {case} {\MakeUppercase} + \setattribute{title} {case} {\MakeUppercase} + \setattribute{runninghead}{case} {\MakeUppercase} + + \setattribute{author} {prefix} {By~} + + \setattribute{copyright} {text} {\url@fmt{}{\itshape}{\journal@name}{\journal@url}\break% + \@ifnonempty{\@copyrightyear\@volume\@issue\@pagerange\break}% + \doi@text} + + \setattribute{email} {text} {E-mail: } + \setattribute{url} {text} {URL: } + \setattribute{fullurl} {text} {URL: } + \def\volume#1{\gdef\@volume{Vol. #1, }} + \def\issue#1 {\gdef\@issue{No. #1, }} + \def\pubyear#1{\gdef\@pubyear{#1,}\gdef\@copyrightyear{#1 }} + + \def\abstractname{} + + \def\put@fmt@data{% + \copyright@fmt% + \history@fmt + \@thanks% + \keyword@fmt% + \abstract@fmt% + } + + \def\contentsname@cmd{\specialsection*{\contentsname}} + +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Set up parameters for the STS journal layout: + +\if@stslayout + + \setattribute{frontmatter} {style} {\raggedright} + \setattribute{title} {style} {\noindent\raggedright} + \setattribute{author} {style} {\noindent\raggedright} + \setattribute{address} {style} {\raggedright} + + \setattribute{title} {skip} {6\p@} + \setattribute{authors} {skip} {10pt} + \setattribute{address} {skip} {\z@} + \setattribute{abstract} {skip} {36\p@} + \setattribute{abstractname}{skip} {. } + \setattribute{keyword} {skip} {8\p@} + + \setattribute{abstract} {width} {28pc} + \setattribute{keyword} {width} {28pc} + + \setattribute{dochead} {size} {\sffamily\Large\fontseries{bx}\selectfont\spaceskip.5em} + \setattribute{title} {size} {\sffamily\fontseries{bx}\fontsize{24.88}{26}\selectfont\mathversion{bold}\spaceskip.5em} + \setattribute{author} {size} {\sffamily\large\fontseries{bx}\selectfont} + \setattribute{address} {size} {\normalfont\normalsize\itshape} + \setattribute{affiliation} {size} {\small\mdseries} + \setattribute{ead} {size} {} + \setattribute{abstract} {size} {\normalsize\mdseries\upshape} + \setattribute{abstractname} {size} {\itshape} + \setattribute{keyword} {size} {\normalsize\mdseries\upshape} + \setattribute{keywordname} {size} {\itshape} + \setattribute{thebibliography}{size} {\footnotesize} + \setattribute{copyright} {size} {\normalfont\mdseries\fontsize{6}{7}\selectfont\raggedright} + \setattribute{runninghead} {size} {\footnotesize} + \setattribute{runninghead} {case} {\MakeUppercase} + \setattribute{pagenumber} {size} {\small\bfseries} + + \setattribute{keyword} {KWD}{Key words and phrases:} + +% \printead: + \def\printead@fmt#1{(#1)} + +% all addresses are combined: + \newtoks\address@toks + + \def\address@exist{0} + + \def\address{\@ifnextchar[{\@address}{\@address[]}} + + \def\@address[#1]#2{ + \gdef\address@exist{1} + \begingroup% + \no@harm% + \xdef\@act{\global\noexpand\address@toks{\the\address@toks#2\ }}\@act + \endgroup} + + \def\address@fmt{\ifcase\address@exist\else\safe@footnotetext{\hskip-\parindent\address@style\address@size\the\address@toks}\fi} + + \def\put@fmt@data{% + \copyright@fmt% + \address@fmt% + \@thanks% + \abstract@fmt% + \keyword@fmt% + \if@twocolumn% + \frontmatter@cmd% + \fi} + + \def\firstpage@cmd{% + \if@twocolumn + \markboth{\@runauthor}{\@runtitle}% + \address@fmt% + \@thanks + \fi} + +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Set up parameters for the BJ journal layout: + +\if@bjlayout + + \setattribute{frontmatter} {style} {\raggedright} + \setattribute{title} {style} {\noindent\raggedright} + \setattribute{author} {style} {\noindent\raggedright} + \setattribute{address} {style} {\raggedright} + + \setattribute{title} {skip} {10\p@} + \setattribute{abstract} {skip} {16\p@} + \setattribute{abstractname}{skip} {} + + \setattribute{abstract} {width} {\textwidth} + \setattribute{keyword} {width} {\textwidth} + \setattribute{history} {width} {\textwidth} + + \setattribute{dochead} {size} {\normalsize\MakeUppercase} + \setattribute{title} {size} {\fontsize{21}{26}\selectfont} + \setattribute{author} {size} {\normalsize} + \setattribute{fnms} {size} {\uppercase} + \setattribute{snm} {size} {\uppercase} + + \setattribute{address} {size} {\small\itshape} + \setattribute{abstract} {size} {\small\upshape} + \setattribute{keyword} {size} {\small\upshape} + \setattribute{keywordname}{size} {\itshape} + \setattribute{history} {size} {\raggedright\small\itshape} + + \setattribute{runninghead}{size} {\normalsize\itshape} + \setattribute{pagenumber} {size} {\normalsize\upshape} + \setattribute{copyright} {size} {\normalsize} + \setattribute{footline} {size} {\footnotesize} + + \setattribute{email} {text} {E-mail:~} + \setattribute{copyright} {text} {\url@fmt{}{\itshape}{\journal@name}{\journal@url}\ \textbf{\@volume}\@issue\@pubyear\ \@pagerange\\ + \doi@text} + \setattribute{history} {postfix} {} + \setattribute{revised} {prefix} { and revised~} + + \setattribute{keyword}{KWD}{Keywords:} + + \def\put@fmt@data{% + \copyright@fmt% + \@thanks% + \abstract@fmt% + \keyword@fmt% + \tableofcontents@fmt} + + % invoke \printhistory at end of document: + \let\old@enddocument\enddocument + \def\enddocument{\history@fmt\old@enddocument} + + \def\volume#1{\gdef\@volume{#1}} + \def\issue#1{\gdef\@issue{(#1)}} + \def\pubyear#1{\gdef\@pubyear{, #1, }\gdef\@copyrightyear{, #1, }} + + \def\abstractname{} + + \def\evenhead@fmt#1{\hfill#1} + \def\oddhead@fmt#1{#1\hfill} + + \def\fnum@table{\tablename~\thetable.} + + \long\def\@maketablecaption#1#2{% + \centering\footnotesize + \textbf{#1}\enskip #2\par + \vskip\belowcaptionskip} + + \renewcommand\figurename{Figure} + + \long\def\@makecaption#1#2{% + \vskip\abovecaptionskip + \footnotesize + \textbf{#1}. #2\par + \vskip\belowcaptionskip} + + +\fi + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Set up parameters for the AIHP journal layout: + +\if@aihplayout + + % FRONT MATTER SKIPS + \setattribute{title} {skip} {64\p@} + \setattribute{authors} {skip} {14\p@} + \setattribute{address} {skip} {12\p@} + \setattribute{abstractname}{skip} {.\enskip} + \setattribute{history} {skip} {4\p@} + \setattribute{abstract} {skip} {16\p@} + + \setattribute{fline} {cmd} {\vskip22\p@ + \hrule} + \setattribute{lline} {cmd} {\vskip10\p@ + \hrule} + + % FRONT MATTER DIMENSIONS + \setattribute{abstract} {width} {\textwidth} + \setattribute{abstract} {indent} {\z@} + \setattribute{keyword} {width} {\textwidth} + \setattribute{keyword} {indent} {\z@} % + + % FRONT MATTER FONTS + \setattribute{title} {size} {\huge} + \setattribute{author} {size} {\Large} + \setattribute{abstract} {size} {\small\upshape} + \setattribute{keywordname}{size} {\itshape} + \setattribute{thebibliography}{size}{\footnotesize} + + \def\put@fmt@data{% + \copyright@fmt% + \@thanks% + \history@fmt + \fline@cmd% + \abstract@fmt% + \keyword@fmt% + \lline@cmd% + \tableofcontents@fmt} + + \setattribute{keyword}{KWD}{Keywords:} + \setattribute{email}{text}{E-mail: } + + \def\theaddressref{\alph{addressref}} + +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Set up parameters for the BJPS journal layout: + +\if@bjpslayout + + \setattribute{keyword}{AMS}{AMS 2000 subject classifications.} + \setattribute{keyword}{KWD}{Keywords and phrases.} + + \setattribute{abstractname}{skip} {.\enskip} + + \setattribute{title} {size} {\Large\bfseries\mathversion{bold}} + \setattribute{address} {size} {\scriptsize} + \setattribute{keywordname}{size} {\itshape} + \setattribute{runninghead}{size} {\footnotesize} + \setattribute{pagenumber} {size} {\small} + \setattribute{thebibliography}{size}{\footnotesize} + + \setattribute{copyright} {text} {\url@fmt{}{\itshape}{\journal@name}{\journal@url}\break% + \@ifnonempty{\@volume\@pubyear\@pagerange\break}% + \@ifnonempty{\journal@issn\break}% + \doi@text}% + + \setattribute{email} {text}{E-mail: } + \setattribute{url} {text}{URL: } + \setattribute{fullurl}{text}{URL: } + + \def\thethanks{\@arabic\c@thanks} + \def\theaddressref{\alph{addressref}} + +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% smart \MR +%% code suggested by Vilmos Prokaj +%% solves the problem when MR is in a format +%% \MR{MR1037262 (91i:60148)} + +% without MR this macro removes the MR prefix if it +% is present unchange the argument otherwise +\def\woMR#1{\w@MR#1MR#1MR\relax}% +\def\w@MR#1MR#2MR#3\relax{#2} + +% this splits MR... (...) +\def\@MR#1 #2\relax#3{% + \href{http://www.ams.org/mathscinet-getitem?mr=#1}% + {\MRfixed{#3}}}% + +\def\MRfixed{MR\woMR}% + +\let\MR\MRfixed + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% interaction with hyperref + +\def\test@hyperref{\@ifundefined{Hy@SetCatcodes}{}{\imsart@hyperref@settings}} + +\AtBeginDocument{\test@hyperref} + +\def\imsart@hyperref@settings{% +% +% hooks for the \thanksref, \thankstext: + \def\thankref@hyperlink##1{% + \edef\@tempx{##1thanks}% + \hbox{\hyperlink{##1}{\saferef{\@tempx}}}} + \def\thanks@hypertarget##1{\smash{\raise\baselineskip\hbox{\protect\hypertarget{##1}{}}}} +% redefine pagenumbering + \let\pagenumbering\ims@pagenumbering +% activate href + \let\ims@href\href% + \let\safe@phantomsection\phantomsection +% put document info + \def\write@pdfinfo##1##2{\protected@write\@auxout{\no@harm}{\string\gdef\string##1{##2}}} + \@ifundefined{hy@title}{}{\pdfstringdef\@pdftitle{\hy@title}} + \@ifundefined{hy@author}{}{\pdfstringdef\@pdfauthor{\hy@author}} + \@ifundefined{hy@subject}{}{\pdfstringdef\@pdfsubject{\hy@subject}} + \@ifundefined{hy@keywords}{}{\pdfstringdef\@pdfkeywords{\hy@keywords}} +% + \@ifundefined{user@hy@title}{}{\global\let\@pdftitle\user@hy@title} + \@ifundefined{user@hy@author}{}{\global\let\@pdfauthor\user@hy@author} + \@ifundefined{user@hy@subject}{}{\global\let\@pdfsubject\user@hy@subject} + \@ifundefined{user@hy@keywords}{}{\global\let\@pdfkeywords\user@hy@keywords} +% +% MathSciNet: +% \def\MR##1{\href{http://www.ams.org/mathscinet-getitem?mr=##1}{MR##1}} + + %% MR with hyperef + \def\MR##1{\@MR##1 \relax{##1}}% + + +% \@ifundefined{Hy@SetCatcodes}{\let\MR\MRfixed}{\relax}% + +} + +\def\write@pdfinfo#1#2{} + +\newtoks\authors@list +\def\addto@authors@list#1{% + \begingroup% + \no@harm% + \xdef\@act{\global\noexpand\authors@list{\the\authors@list#1}}\@act% + \endgroup} + +\newtoks\keywords@list +\def\addto@keywords@list#1{% + \begingroup% + \no@harm% + \xdef\@act{\global\noexpand\keywords@list{\the\keywords@list#1}}\@act% + \endgroup} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION, SUBSECTION ETC. +% we do not like article appearance: + +\renewcommand\section{\@startsection {section}{1}{\z@}% + {-\bigskipamount}% + {\medskipamount}% + {\raggedright\bfseries\mathversion{bold}}} + +\renewcommand\subsection{\@startsection {subsection}{2}{\z@}% + {-\bigskipamount}% + {\medskipamount}% + {\raggedright\bfseries\itshape\mathversion{bold}}} + +\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% + {-\bigskipamount}% + {\medskipamount}% + {\raggedright\itshape}} + +\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% + {\medskipamount}% + {-1em}% + {\bfseries}} + +\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}% + {\medskipamount}% + {-1em}% + {\itshape}} + + +% Format for the counter: +\def\section@numbersep{.} +\def\subsection@numbersep{.} +\def\subsubsection@numbersep{.} +\def\paragraph@numbersep{.} +\def\subparagraph@numbersep{.} + +\def\@seccntformat#1{{\csname #1@prefix\endcsname\csname the#1\endcsname\csname#1@numbersep\endcsname\enspace}} + + +\let\specialsection\section + +\@namedef{specialsection*}{\section*} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sections: bjpslayout + +\if@bjpslayout + + \renewcommand\section{\@startsection {section}{1}{\z@}% + {-\bigskipamount}% + {\medskipamount}% + {\large\bfseries\mathversion{bold}\raggedright}} + + \renewcommand\subsection{\@startsection {subsection}{2}{\z@}% + {-\medskipamount}% + {\smallskipamount}% + {\bfseries\mathversion{bold}\raggedright}} + + \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% + {\medskipamount}% + {-10pt}% + {\normalsize\itshape}} + + \def\subsubsection@prefix{\upshape} + + \def\section@numbersep{} + \def\subsection@numbersep{} + \def\subsubsection@numbersep{} + \def\paragraph@numbersep{} + \def\subparagraph@numbersep{} +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sections: IMS layout + +\if@imslayout + \renewcommand\section{\@startsection {section}{1}{\parindent}% + {\medskipamount}% + {-10pt}% + {\normalsize\upshape\bfseries\mathversion{bold}}} + + \renewcommand\subsection{\@startsection {subsection}{2}{\parindent}% + {\medskipamount}% + {-10pt}% + {\subsection@shape}} + \def\subsection@shape{\normalsize\itshape} + \def\subsection@prefix{\upshape} + + \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\parindent}% + {\medskipamount}% + {-10pt}% + {\normalsize\itshape}} + \def\subsubsection@prefix{\upshape} + + \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% + {\smallskipamount}% + {-1em}% + {\normalsize\itshape}} + \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}% + {0.1pt}% + {-1em}% + {\normalsize\itshape}} + +% must be used for the appendix \section and \thebibliography + \renewcommand\specialsection{\@startsection {section}{1}{\z@}% + {\medskipamount}% + {\smallskipamount}% + {\normalsize\centering\MakeUppercase}} + +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sections: STS layout + +\if@stslayout + + \def\sec@raggedright{% + \def\\{\hfill\break}\@rightskip\@flushglue \rightskip\@rightskip + \leftskip\z@skip + \parindent\z@} + +% last line will centered to page width + + \def\fl@hangfrom#1{\noindent {#1}} + \def\TO@fl{\let\@hangfrom\fl@hangfrom} + + + \renewcommand\section{\@startsection {section}{1}{\z@}% + {\medskipamount}% + {\smallskipamount}% + {\centering\TO@fl\normalsize\sffamily\fontseries{bx}\selectfont\mathversion{bold}\MakeUppercase}} + + \renewcommand\subsection{\@startsection {subsection}{2}{\z@}% + {\smallskipamount}% + {\smallskipamount}% + {\normalsize\sffamily\fontseries{bx}\selectfont\mathversion{bold}\sec@raggedright}} + + \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\parindent}% + {\smallskipamount}% + {-.5em}% + {\normalsize\itshape}} + + \renewcommand\paragraph{\@startsection{paragraph}{4}{\parindent}% + {\z@}% + {-4pt}% + {\normalsize\itshape}} + + \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}% + {0.1pt}% + {-1em}% + {\normalsize\itshape}} + +% must be used for the \thebibliography + \newcommand\specialsection{\@startsection {section}{1}{\z@}% + {\bigskipamount}% + {\smallskipamount}% + {\normalsize\centering\MakeUppercase}} + +% Format for the counter: + \def\section@numbersep{.} + \def\subsection@numbersep{} + \def\subsubsection@numbersep{} + \def\paragraph@numbersep{} + \def\subparagraph@numbersep{} + +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sections: BJ layout + +\if@bjlayout + + \renewcommand\section{\@startsection {section}{1}{\z@}% + {-\bigskipamount}% + {\medskipamount}% + {\Large\bfseries\mathversion{bold}\raggedright}} + + \renewcommand\subsection{\@startsection {subsection}{2}{\z@}% + {-\bigskipamount}% + {\medskipamount}% + {\large\bfseries\mathversion{bold}\raggedright}} + + \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% + {-\medskipamount}% + {\smallskipamount}% + {\itshape\raggedright}} + +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sections: AIHP layout + +\if@aihplayout + + \renewcommand\subsection{\@startsection {subsection}{2}{\z@}% + {-\medskipamount}% + {\medskipamount}% + {\itshape\raggedright}} + + \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% + {-\medskipamount}% + {.01\p@}% + {\itshape\raggedright}} + + \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% + {\medskipamount}% + {-10pt}% + {\itshape}} + + \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}% + {0.1pt}% + {-1em}% + {\itshape}} + +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% loading of amsmath + +\def\set@amsthm{ + \def\ims@thmshape{0} + \if@imslayout \def\ims@thmshape{1}\fi + \if@stslayout \def\ims@thmshape{1}\fi + \if@bjlayout \def\ims@thmshape{2}\fi + \if@aihplayout \def\ims@thmshape{3}\fi + \if@bjpslayout \def\ims@thmshape{3}\fi + + \ifcase\ims@thmshape + \or %1 + \thm@notefont{\upshape} + \newtheoremstyle{plain} {\medskipamount}{\medskipamount}{\itshape}{\parindent}{\scshape}{.}{1em}{} + \newtheoremstyle{definition}{\medskipamount}{\medskipamount}{\normalfont}{\parindent}{\scshape}{.}{1em}{} + \newtheoremstyle{remark} {\medskipamount}{\medskipamount}{\normalfont}{\parindent}{\scshape}{.}{1em}{} + + \renewenvironment{proof}[1][\proofname]{\par + \pushQED{\qed}% + \normalfont \topsep\medskipamount% + \trivlist + \labelsep.5em% + \item[\hskip\labelsep\hskip\parindent + \scshape ##1\@addpunct{.}]\ignorespaces + }{% + \popQED\endtrivlist\@endpefalse + } + \or %2 + + \newtheoremstyle{plain} {\medskipamount}{\medskipamount}{\itshape}{\z@}{\bfseries}{.}{1em}{} + \newtheoremstyle{definition}{\medskipamount}{\medskipamount}{\itshape}{\z@}{\bfseries\itshape}{.}{1em}{} + \newtheoremstyle{remark} {\medskipamount}{\medskipamount}{\normalfont}{\z@}{\bfseries\itshape}{.}{1em}{} + + \renewenvironment{proof}[1][\proofname]{\par + \pushQED{\qed}% + \normalfont \topsep\medskipamount\relax + \trivlist + \item[\hskip\labelsep + \itshape\bfseries + ##1\@addpunct{.}]\ignorespaces + }{% + \popQED\endtrivlist\@endpefalse + } + + + \or %3 + + \renewenvironment{proof}[1][\proofname]{\par + \pushQED{\qed}% + \normalfont \topsep\medskipamount\relax + \trivlist + \item[\hskip\labelsep + \bfseries + ##1\@addpunct{.}]\ignorespaces + }{% + \popQED\endtrivlist\@endpefalse + } + + \else + \fi} + + +\if@load@amsmath + \if@amsmath@leqno + \PassOptionsToPackage{leqno}{amsmath} + \fi + \RequirePackage[cmex10]{amsmath} +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% loading of amsthm + +\if@load@amsthm + \RequirePackage{amsthm} + \set@amsthm +\else + \AtBeginDocument{\@ifpackageloaded{amsthm}{\set@amsthm}{}} +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% thebibliography, loading natbib + +\def\set@natbib{% + \let\bibfont\thebibliography@size + \setlength\bibsep{0pt}} + +\if@load@natbib + \RequirePackage{natbib} + \set@natbib +\else + \let\xxx@thebibliography\thebibliography + \def\thebibliography{\thebibliography@size\xxx@thebibliography} + \g@addto@macro\@openbib@code{\itemsep\z@} + \AtBeginDocument{\@ifpackageloaded{natbib}{\set@natbib}{}} +\fi + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% thebibliography - structured + +%%%%%%%%% Common macros: + +% Setting a "style" for a command: +% \set@bibl@cmd{bvolume} == \def\bvolume#1{{\bvolume@style #1}} + +\def\set@bibl@cmd#1{\expandafter\def\csname #1\endcsname##1{{\csname #1@style\endcsname##1}}} + +\let\endbibitem\relax + +%%%%%%%%% bauthor, beditor + +\def\bbl@bauthor#1{% + \csname bauthor@hook\endcsname% +{% + \let\binits\@firstofone% + \let\bsnm\@firstofone% + \let\bfnm\@gobble% + \let\bparticle\@firstofone% + \let\bsuffix\@firstofone% + \bauthor@style% +#1}} + +\def\bbl@beditor#1{{% + \let\binits\@firstofone% + \let\bsnm\@firstofone% + \let\bfnm\@gobble% + \let\bparticle\@firstofone% + \let\bsuffix\@firstofone% + \beditor@style% +#1}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bid +% \bid{MR={},doi={},...} + +\define@key{bid}{mr}{\MR{#1}} +\define@key{bid}{doi}{} +\define@key{bid}{pubmed}{} +\define@key{bid}{pii}{} + +\def\bbl@bid#1{% + \setkeys{bid}{#1}% +} + +% for compatibility with old bibtex style +\def\bdoi#1{\ignorespaces} + +%%%%%%%%% common@pub@types + +\def\common@pub@types{% + \def\AND{and }% + \let\betal\@firstofone% + \set@bibl@cmd{btitle}% + \let\byear\@firstofone% + \let\bpages\@firstofone% + \let\bmisc\@firstofone% + \let\bnote\@firstofone% + \let\banumber\@firstofone% + \let\bmrnumber\MR% + \let\bid\bbl@bid% + \set@bibl@cmd{bvolume}% + \csname common@pub@types@hook\endcsname% +} + + +%%%%%%%%% default stiliai + + \setattribute{bauthor}{style}{\scshape} + \setattribute{beditor}{style}{\scshape} + + \setattribute{bjournal} {style}{\itshape} + \setattribute{bbooktitle}{style}{\itshape} + \setattribute{bseries} {style}{\itshape} + + \setattribute{bvolume} {style}{\bfseries} + +%%%%%%%%% barticle + +\def\barticle{\@ifnextchar[{\@barticle}{\@barticle[]}} + +\def\@barticle[#1]{% + \common@pub@types% + \let\bauthor\bbl@bauthor% + \set@bibl@cmd{bjournal}% +} + +%%%%%%%%% bbook + +\def\bbook{\@ifnextchar[{\@bbook}{\@bbook[]}} + +\def\@bbook[#1]{% + \common@pub@types% + \let\bauthor\bbl@bauthor% + \let\beditor\bbl@beditor% + \let\bedition\@firstofone% + \set@bibl@cmd{bseries}% + \let\bpublisher\@firstofone% + \let\baddress\@firstofone% + \let\bisbn\@gobble% +% + \let\btitle@style\itshape% +} + + +%%%%%%%%% bincollection + +\def\bincollection{\@ifnextchar[{\@bincollection}{\@bincollection[]}} + +\def\@bincollection[#1]{% + \common@pub@types% + \let\bauthor\bbl@bauthor% + \let\beditor\bbl@beditor% + \set@bibl@cmd{bbooktitle}% + \let\bchapter\@firstofone% + \let\bedition\@firstofone% + \set@bibl@cmd{bseries}% + \let\bpublisher\@firstofone% + \let\baddress\@firstofone% + \let\bisbn\@gobble% + \def\bauthor@hook{\let\beditor@style\relax} +} + +%%%%%%%%% binproceedings + +\def\binproceedings{\@ifnextchar[{\@binproceedings}{\@binproceedings[]}} + +\def\@binproceedings[#1]{% + \common@pub@types% + \let\bauthor\bbl@bauthor% + \let\beditor\bbl@beditor% + \set@bibl@cmd{bbooktitle}% + \set@bibl@cmd{bseries}% + \let\borganization\@firstofone% + \let\bpublisher\@firstofone% + \let\baddress\@firstofone% + \let\bisbn\@gobble% +} + +%%%%%%%%% binbook + +\def\binbook{\@ifnextchar[{\@binbook}{\@binbook[]}} + +\def\@binbook[#1]{% + \common@pub@types% + \let\bauthor\bbl@bauthor% + \let\beditor\bbl@beditor% + \set@bibl@cmd{bbooktitle}% + \let\bchapter\@firstofone% + \let\bedition\@firstofone% + \set@bibl@cmd{bseries}% + \let\bpublisher\@firstofone% + \let\baddress\@firstofone% + \let\bisbn\@gobble% +% + \let\btitle@style\itshape +} + + +%%%%%%%%% bproceedings + +\def\bproceedings{\@ifnextchar[{\@bproceedings}{\@bproceedings[]}} + +\def\@bproceedings[#1]{% + \common@pub@types% + \let\bauthor\bbl@bauthor% + \let\beditor\bbl@beditor% + \let\bedition\@firstofone% + \set@bibl@cmd{bseries}% + \let\bpublisher\@firstofone% + \let\borganization\@firstofone% + \let\baddress\@firstofone% + \let\bisbn\@gobble% +% + \let\btitle@style\itshape +} + + +%%%%%%%%% btechreport + +\def\btechreport{\@ifnextchar[{\@btechreport}{\@btechreport[]}} + +\def\@btechreport[#1]{% + \common@pub@types% + \let\bauthor\bbl@bauthor% + \let\btype\@firstofone% + \let\bnumber\@firstofone% + \let\binstitution\@firstofone% + \let\baddress\@firstofone% +} + +%%%%%%%%% bmanual + +\def\bmanual{\@ifnextchar[{\@bmanual}{\@bmanual[]}} + +\def\@bmanual[#1]{% + \common@pub@types% + \let\bauthor\bbl@bauthor% + \let\bedition\@firstofone% + \let\borganization\@firstofone% + \let\baddress\@firstofone% + \let\bisbn\@gobble% +} + +%%%%%%%%% mastersthesis + +\def\bmastersthesis{\@ifnextchar[{\@bmastersthesis}{\@bmastersthesis[]}} + +\def\@bmastersthesis[#1]{% + \common@pub@types% + \let\bauthor\bbl@bauthor% + \let\bschool\@firstofone% + \let\btype\@firstofone% + \let\baddress\@firstofone% +} + +%%%%%%%%% phdthesis + +\def\bphdthesis{\@ifnextchar[{\@bphdthesis}{\@bphdthesis[]}} + +\def\@bphdthesis[#1]{% + \common@pub@types% + \let\bauthor\bbl@bauthor% + \let\bschool\@firstofone% + \let\btype\@firstofone% + \let\baddress\@firstofone% +} + +%%%%%%%%% bbooklet + +\def\bbooklet{\@ifnextchar[{\@bbooklet}{\@bbooklet[]}} + +\def\@bbooklet[#1]{% + \common@pub@types% + \let\bauthor\bbl@bauthor% + \let\bhowpublished\@firstofone% + \let\baddress\@firstofone% +} + +%%%%%%%%% bunpublished + +\def\bunpublished{\@ifnextchar[{\@bunpublished}{\@bunpublished[]}} + +\def\@bunpublished[#1]{% + \common@pub@types% + \let\bauthor\bbl@bauthor% +} + +%%%%%%%%% bmisc + +\def\bmisc{\@ifnextchar[{\@bmisc}{\@bmisc[]}} + +\def\@bmisc[#1]{% + \common@pub@types% + \let\bauthor\bbl@bauthor% + \let\bhowpublished\@firstofone% +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% appendix + +\if@imslayout + +% appendix mess up everything in this layout: + + \renewcommand\appendix{\par + \def\subsection@shape{\normalsize\upshape\bfseries\mathversion{bold}} + \let\section\specialsection + \def\section{\@ifnextchar*{\@appsectionstar}{\@appsectionnostar}}% + \def\section@prefix{\appendixname\ }% + \def\section@numbersep{:}% + \setcounter{section}{0}% + \setcounter{subsection}{0}% + \gdef\thesection{\@Alph\c@section}} + +% \section*{Appendix} -> APPENDIX + \def\@appsectionstar*#1{% + \specialsection*{#1}% + \setcounter{section}{1}% +% \addcontentsline{toc}{section}{#1} +} + +% \section{} -> APPENDIX A +% \section{proof} -> APPENDIX A: PROOF + \def\@appsectionnostar#1{% + \ifx.#1.% + \def\section@numbersep{}\specialsection[\appendixname\ \thesection]{}% + \else% + \def\section@numbersep{:}\specialsection{#1}% + \fi} + +% dirty trick with \thebibliography + \let\old@thebibliography\thebibliography + \def\thebibliography{\let\section\specialsection\old@thebibliography} + +\else + + \renewcommand\appendix{\par + \let\old@section\section% + \def\section{\@ifnextchar*{\@appsectionstar}{\@appsectionnostar}}% + \def\section@prefix{\appendixname\ }% + \def\section@numbersep{:}% + \setcounter{section}{0}% + \setcounter{subsection}{0}% + \gdef\thesection{\@Alph\c@section}} + + \def\@appsectionstar*#1{% + \old@section*{#1}% + \setcounter{section}{1}% +% \addcontentsline{toc}{section}{#1} +} + + \def\@appsectionnostar#1{% + \ifx.#1.% + \def\section@numbersep{}\old@section[\appendixname\ \thesection]{}% + \else% + \def\section@numbersep{:}\old@section{#1}% + \fi} + + +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% supplement +% +%\begin{supplement}[id=suppA] +% \sname{Supplement A} +% \stitle{} +% \slink[doi]{} +% \slink[url]{http://lib.stat.cmu.edu/aoas/???/???} +% \sdescription{} +%\end{supplement} +% \thesuppdoi{suppA} +% \ref{suppA} +% \hyperlink{suppA}{text} + +\def\supplement@name{Supplementary Material} + +\def\sname#1{\def\@sname{#1}\def\@currentlabel{#1}} +\def\stitle#1{\def\@stitle{#1}} +\def\sdatatype#1{\def\@sdatatype{#1}} +\def\slink[#1]#2{\expandafter\def\csname slink@#1\endcsname{#2}} +\def\sdescription#1{\def\@sdescription{#1}} + +\def\suppsection@fmt{\specialsection*{\supplement@name}} + +\def\slink@doi@fmt{% + \url@fmt{doi: }{}{\slink@doi}{\doi@base\slink@doi}% + \@ifundefined{supp@label}{}{% + \expandafter\xdef\csname\supp@label @doi\endcsname{\slink@doi}% + \expandafter\xdef\csname\supp@label @url\endcsname{\doi@base\slink@doi}}% +} + +\def\slink@url@fmt{% + \url@fmt{}{}{\slink@url}{\slink@url}% + \@ifundefined{supp@label}{}{% + \expandafter\xdef\csname\supp@label @url\endcsname{\slink@url}}% +} + +\def\thesuppdoi#1{\@ifundefined{#1@doi}% + {\@latex@error{Undefined supplement id=#1}{??}}% + {\def\@tempx{\csname #1@doi\endcsname}% + \@ifundefined{#1@url}{\def\@tempy{\doi@base\csname #1@url\endcsname}}{\def\@tempy{\csname #1@url\endcsname}}% + \url@fmt{DOI: }{}{\@tempx}{\@tempy}}% +} + +\define@key{supplement}{id}{\def\supp@label{#1}} + +\long\def\supplement{\@ifnextchar[{\@supplement}{\@supplement[]}} + +\long\def\@supplement[#1]{% + \suppsection@fmt% + \global\let\suppsection@fmt\smallskip% + \setkeys{supplement}{#1}% +} + +\def\endsupplement{% + \@ifundefined{@sname}{}{\@ifundefined{supp@label}{}{\hypertarget{\supp@label}{}\label{\supp@label}}\textbf{\@sname: }}% + \@ifundefined{@stitle}{}{\textbf{\@stitle\ }}% +% + \\ + (% + \@ifundefined{slink@doi}{}{\slink@doi@fmt}% + \@ifundefined{slink@url}{}{\slink@url@fmt}% + \@ifundefined{@sdatatype}{}{; \@sdatatype}% + ). + \@ifundefined{@sdescription}{}{\@sdescription}% + \par} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TOC in "article" class is a mess: + + +% for hyperref +\def\toclevel@title{0} + +\newcommand*\l@title[2]{} +\newcommand*\l@author[2]{} +\newcommand*\l@doi[2]{} +\newcommand*\l@arxiv[2]{} +\newcommand*\l@jobname[2]{} +\newcommand*\l@begintocitem[2]{} +\newcommand*\l@endtocitem[2]{} + +\newif\if@changetoc \@changetocfalse +\@ifclassloaded{article}{\@changetoctrue}{} + +\if@changetoc + + \@ifundefined{contentsname@cmd}{\def\contentsname@cmd{\section*{\contentsname}}}{} + + \renewcommand\tableofcontents{% + \nocontentsline + \contentsname@cmd% + \@starttoc{toc}% + } + + \renewcommand*\l@section{\@dottedtocline{1}{\z@}{1.5em}} + +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% number lines + +\ifnumberlines@ + + \long\def\l@addto@macro#1#2{% + \toks@\expandafter{#1#2}% + \edef#1{\the\toks@}} + + \setattribute{numberlines}{size}{\scriptsize\ttfamily} + \setattribute{numberlines}{skip}{24\p@} + + \def\numberlines@hook{% + \l@addto@macro\@evenhead\put@numberlines@box% + \l@addto@macro\@oddhead\put@numberlines@box} + + \g@addto@macro\ps@imsheadings\numberlines@hook + \g@addto@macro\ps@copyright\numberlines@hook + + \newbox\numberlines@box + \newskip\numberlines@box@skip + + \def\set@numberlines@box{% + \setlength\numberlines@box@skip\headsep + \addtolength\numberlines@box@skip{5\p@} + % + \setbox\numberlines@box\vtop to\textheight{% + \parindent\z@ + \vskip\z@ + \@tempcnta=0 + \@tempdima=\z@ + \loop + \advance\@tempcnta by1 + \advance\@tempdima by\baselineskip + \hbox to\textwidth{% + \llap{\numberlines@size\the\@tempcnta\kern\numberlines@skip} + \hfill + \rlap{\numberlines@size\kern\numberlines@skip\the\@tempcnta}} + \ifdim\@tempdima<\textheight\repeat + \vss + }% + % + \ht\numberlines@box\z@ + \dp\numberlines@box\z@ + } + + \def\put@numberlines@box{\lower\numberlines@box@skip\hbox to\z@{\hss\copy\numberlines@box}} + + \AtBeginDocument{\set@numberlines@box} + +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INICIALIZATION + +% Read local configuration file (if exist): +% imsart.cnf imsart-ps.cnf imsart-lnms.cnf + +\@input{\imsfmt@name\journal@id.cnf} + + +\@twosidetrue +\pagenumbering{arabic} +\frenchspacing +\init@settings +\pagestyle{imsheadings} + +\endinput +%% +%% History: +2011.03.02 - SSY copyright fixed; +2011.01.24 - \bdoi added; +2010.09.07 - journal url changed for EJS journal; +2010.08.03 - \tableofcontents fixed for the imslayout journals; +2010.04.27 - support for the "Stochastic Systems" (ssy) added; +2009.12.16 - \betal added +2009.08.13 - support for the structured bibliography added (imsart-number.bst,imsart-nameyear.bst) + options [numbers,sort&compress] from natbib package removed +2009.05.21 - added new option "bjps" +2009.02.27 - all hyperref links are set to "blue" + - smart \MR command (code suggested by Vilmos Prokaj +2008.08.29 - supplement environment added +2008.01.24 - for "coll" changed journal url +2008.01.09 - added new option "coll" +2007.12.10 - added new option "aihp" + - abstract have an attribute language= + - multiple abstracts + - \atltitle{} - title in another language +2007.09.18 - fixed small error in SS (affiliation) +2007.04.13 - fixed small error in EJS +2007.04.02 - ISSN numbers of EJS and SS included +2007.02.20 - support for the "Electronic Journal of Statistics" (ejs) added; +2007.01.24 - support for the "The Annals of Applied Statistics" (aoas) and Bernoulli (bj) added; +2006.10.13 - small bug with "lnms, ps, ss" options fixed; +2006.09.07 - if no options specified, imsart.sty is loaded with "generic" option; + - new options: imslayout, stslayout +2006.08.23 -"author's addresses" secion added to bookmarks (aap,aop,aos); + -completely new STS layout; + -\tableofcontents adjusted, could be used in frontmatter part; + -support for LNMS Table of Contents; + -support for LNMS "List of Contributors" (\contributor{Author, F.}{University}); + -command \arxiv{math.PR/0000000} introduced to provide link to article location in arXiv + -\@journal{} changed to \journal@name + -\ead{} correctly sets the pdf link when "http://" prefix is used; + -\ead[...,nopdflink]{} supresses pdf link; + -a lot of internal changes; + - fix of a bug with newer hyperref versions (\orig@footnotetext) + -equation numbers are at left for LNMS layout; + +2006.03.07 -command \volumename{} introduced + small changes for LNMS option + (addresses will be positioned on title page) + -pdf document properties could be changed with commands + \pdftitle{}, \pdfsubject{}, \pdfauthor{} + +2006.01.04 support for the "Statistics Surveys" (ss) added; + +2005.10.19 fix of a bug with bibliography and ims layout + \@footnotetext is changed due to the arXiv hyperref setup + +2005.05.19 New options singlespacing, doublespacing, linenumbers, nolinenumbers introduced; + Table and figure captions changed + +%% End of file `imsart.sty'. diff --git a/installDoc/gitlab-sei.tex b/installDoc/gitlab-sei.tex new file mode 100644 index 0000000..66ed394 --- /dev/null +++ b/installDoc/gitlab-sei.tex @@ -0,0 +1,588 @@ +\section{Gitlab}\label{gitlab} + +\subsection{Instalar Postgresql} + + +\fbox{\parbox{\textwidth}{ +\texttt{sudo yum localinstall http://yum.postgresql.org/9.3/\\redhat/rhel-6-x86\_64/pgdg-centos93-9.3-1.noarch.rpm -y}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo yum install postgresql93 postgresql93-devel postgresql93-libs postgresql93-server -y +}}} + +\subsubsection{Inicializar database} + + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo service postgresql-9.3 initdb +}}} + +\subsubsection{Iniciar postgresql com o sistema} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo chkconfig postgresql-9.3 on +}}} + +\subsubsection{Iniciar postgresql} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo service postgresql-9.3 start +}}} + +\subsection{Adicionar repositório EPEL} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo yum -y install wget vim +}}} +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 \\https://www.fedoraproject.org/static/0608B895.txt +}}} +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 +}}} + +\subsection{Adicionar repositório PUIAS Computational (necessário o download de algumas dependências)} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo rpm -Uvh \\https://dl.fedoraproject.org/pub/epel/6/x86\_64/epel-release-6-8.noarch.rpm +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +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 +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +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 +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-puias +}}} + +\subsubsection{Ativar repositório PUIAS} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo yum -y install yum-utils +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo yum-config-manager --enable epel --enable PUIAS\_6\_computational +}}} + +\subsection{Atualizar todos os pacotes e intalar alguns pacotes adincionais} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo yum -y update +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo yum -y groupinstall 'Development Tools' +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +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 +}}} + +\subsection{Adicionar redis para iniciar com o sistema e iniciar o sistema} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo chkconfig redis on +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo service redis start +}}} + +\subsection{Instalar o servidor de email postfix} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo yum -y install postfix +}}} + +\subsection{Remover qualquer pacote git que tenha instalado} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo yum -y remove git +}}} + +\subsection{Instalar git 1.9.0 e suas dependências} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo yum -y install zlib-devel perl-CPAN gettext curl-devel expat-devel gettext-devel openssl-devel +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo mkdir /tmp/git \&\& cd /tmp/git}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo wget https://git-core.googlecode.com/files/git-1.9.0.tar.gz}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo tar xzf git-1.9.0.tar.gz}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +cd git-1.9.0/}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo ./configure}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo make}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo make prefix=/usr/local install}}} + +\subsection{Remover qualquer ruby instalado, e download do ruby-2.0.0-p451} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo yum remove ruby -y}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +mkdir /tmp/ruby \&\& cd /tmp/ruby}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz | tar xz +}}} + +\emph{NOTA:} + +\fbox{\parbox{\textwidth}{ +\texttt{ +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 +}}} + +\subsection{Install ruby 2.0.0} + +\fbox{\parbox{\textwidth}{ +\texttt{ +cd ruby-2.0.0-p451 +\\./configure --disable-install-rdoc +\\make +\\sudo make prefix=/usr/local install +}}} + +\subsection{Instalar a bundler gem} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo /usr/local/bin/gem install bundler --no-ri --no-rdoc +}}} + +\subsection{Ciar um usuário git que tenha as permissões corretas no Gitlab} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo adduser --system --shell /bin/bash --comment 'GitLab' --create-home --home-dir /home/git/ git +}}} + +\subsection{Clonar o gitlab-shell no repositório} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo su +\\cd /home/git +\\sudo -u git -H /usr/local/bin/git clone https://gitlab.com/gitlab-org/gitlab-shell.git +\\cd gitlab-shell/ +/usr/local/bin/git reset --hard v1.9.3 +}}} + +\subsection{Configurar o nome do host e instalar gitlab-shell} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo -u git -H cp config.yml.example config.yml +\\sudo -u git -H vim config.yml +\\sudo -u git -H /usr/local/bin/ruby ./bin/install +restorecon -Rv /home/git/.ssh +}}} + +\subsection{Criar database gitlabhq\_production, e se for desenvolver no gitlab criar gitlabhq\_development and gitlabhq\_test} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo -u postgres psql -d template1 +CREATE USER git; +CREATE DATABASE gitlabhq\_production OWNER git; +CREATE DATABASE gitlabhq\_development OWNER git; +CREATE DATABASE gitlabhq\_test OWNER git; +}}} + +\subsection{Adicionar o usuário git no pg\_hba.conf para conceder permissões} + +\fbox{\parbox{\textwidth}{ +\texttt{ +vim /var/lib/pgsql/9.3/data/pg\_hba.conf +}}} + +O fim do arquivo deve se parecer o código abaixo: + +\fbox{\parbox{\textwidth}{ +\texttt{ +\# TYPE DATABASE USER ADDRESS METHOD +\\\# "local" is for Unix domain socket connections only +\\local all postgres peer +\\local all git trust +\\\# IPv4 local connections: +\\host all postgres 127.0.0.1/32 ident +\\host all git 127.0.0.1/32 trust +\\\# IPv6 local connections: +\\host all postgres ::1/128 ident +\\host all git ::1/128 trust +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +[ESC]:wq! +}}} + +\subsection{Reiniciar postgresql} + +\fbox{\parbox{\textwidth}{ +\texttt{ +service postgresql-9.3 restart +}}} + +\subsection{Clonar and configurar o repositório do gitlab} + +\fbox{\parbox{\textwidth}{ +\texttt{ +cd /home/git +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\\sudo -u git -H /usr/local/bin/git clone \\https://github.com/colab-community/gitlabhq.git -b 7-0-stable gitlab}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\\cd /home/git/gitlab}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\\sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\\chown -R git {log,tmp}}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\\chmod -R u+rwX {log,tmp} +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\\sudo -u git -H mkdir /home/git/gitlab-satellites}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\\chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\\chmod -R u+rwX tmp/{pids,sockets} +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\\chmod -R u+rwX public/uploads}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\\sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\\sudo -u git -H cp config/initializers/rack\_attack.rb.example config/initializers/rack\_attack.rb +}}} + +\subsection{Mudar a porta usada para o gitlab, nesse caso use a porta 8090} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo vim /home/git/gitlab/config/unicorn.rb +}}} + +Mude: + +\fbox{\parbox{\textwidth}{ +\texttt{ +listen "127.0.0.1:8080", :tcp\_nopush => true +}}} + +Para: + +\fbox{\parbox{\textwidth}{ +\texttt{ +listen "127.0.0.1:8090", :tcp\_nopush => true +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +[ESC]:wq! +}}} + +\subsection{Mudar URL defautl no gitlab-shell/config.yml} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo vim /home/git/gitlab-shell/config.yml +}}} + +Altere a sequinte linha: + +\fbox{\parbox{\textwidth}{ +\texttt{ +gitlab\_url: "http://127.0.0.1:8090/gitlab" +}}} + +Para, usando o seu IP: + +\fbox{\parbox{\textwidth}{ +\texttt{ +gitlab\_url: "http://127.0.0.1:8090/" +}}} + +\subsection{Configurar git e database} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo -u git -H /usr/local/bin/git config --global user.name "GitLab" +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo -u git -H /usr/local/bin/git config --global user.email "gitlab@localhost"}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo -u git -H /usr/local/bin/git config --global core.autocrlf input}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo -u git cp config/database.yml.postgresql config/database.yml}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo -u git -H chmod o-rwx config/database.yml +}}} + +\subsection{Configurar o bundle} + +\fbox{\parbox{\textwidth}{ +\texttt{ +cd /home/git/gitlab +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo -u git -H /usr/local/bin/bundle config build.pg --with-pg-config=/usr/\\pgsql-9.3/bin/pg\_config}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo -u git -H /usr/local/bin/bundle config build.nokogiri --use-system-libraries +}}} + +\subsection{Edite arquivos sudores para deixar que bundle, git e gem executem no modo sudo.} + +\emph{NOTA:} + +\fbox{\parbox{\textwidth}{ +\texttt{ +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. +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo vim /etc/sudoers +}}} + +Altere a linha + +\fbox{\parbox{\textwidth}{ +\texttt{ +Defaults secure\_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/ +}}} + +Para + +\fbox{\parbox{\textwidth}{ +\texttt{ +Defaults secure\_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/:/usr/\\local/bin/ +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +[ESC]:wq! +}}} + +\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} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo -u git -H /usr/local/bin/bundle install --deployment --without development test mysql aws +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo -u git -H /usr/local/bin/bundle exec rake gitlab:setup RAILS\_ENV=production +}}} + +Escolha yes para criar as tabelas no banco + +\emph{NOTA:} + +\fbox{\parbox{\textwidth}{ +\texttt{ +Admin login and password -- login: admin@local.host -- password: 5iveL!fe +}}} + +\subsection{Adicionar gitlab para iniciar com o sistema, esse passo não é requisito para o modo de desenvolvimento} + +\fbox{\parbox{\textwidth}{ +\texttt{ +wget -O /etc/init.d/gitlab https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/\\init/sysvinit/centos/gitlab-unicorn +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +chmod +x /etc/init.d/gitlab}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +chkconfig --add gitlab +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +chkconfig gitlab on +cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab +service gitlab start +}}} + +\subsection{Compile os asstes, para desenvolvimento altere o env para RAILS\_ENV=development} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo -u git -H /usr/local/bin/bundle exec rake assets:precompile RAILS\_ENV=production +}}} + +\subsection{Altere as permissões dos grupos} + +\fbox{\parbox{\textwidth}{ +\texttt{ +chmod g+rx /home/git/ +}}} + +Altere a linha: + +\fbox{\parbox{\textwidth}{ +\texttt{ +env: enabled: true +}}} + +Para: + +\fbox{\parbox{\textwidth}{ +\texttt{ +env: enabled: false +}}} + +Altere essas linhas: + +\fbox{\parbox{\textwidth}{ +\texttt{issues\_tracker: \# redmine: \# title: ``Redmine'' \# +\#\# If not nil, link `Issues' on project page will be replaced with +this \# \#\# Use placeholders: \# \#\# :project\_id - GitLab project +identifier \# \#\# :issues\_tracker\_id - Project Name or Id in external +issue tracker \# project\_url: +``http://redmine.sample/projects/:issues\_tracker\_id'' \# \# \#\# If +not nil, links from /\#\d/ entities from commit messages will replaced +with this \# \#\# Use placeholders: \# \#\# :project\_id - GitLab +project identifier \# \#\# :issues\_tracker\_id - Project Name or Id in +external issue tracker \# \#\# :id - Issue id (from commit messages) \# +issues\_url: ``http://redmine.sample/issues/:id'' \# \# \#\# If not nil, +links to creating new issues will be replaced with this \# \#\# Use +placeholders: \# \#\# :project\_id - GitLab project identifier \# \#\# +:issues\_tracker\_id - Project Name or Id in external issue tracker \# +new\_issue\_url: +``http://redmine.sample/projects/:issues\_tracker\_id/issues/new'' \# \# +jira: \# title: ``Atlassian Jira'' \# project\_url: +\\``http://jira.sample/issues/?jql=project=:issues\_tracker\_id'' \# +issues\_url: ``http://jira.sample/browse/:id'' \# new\_issue\_url: +``http://jira.sample/secure/CreateIssue.jspa'' +}}} + +Para: + +\fbox{\parbox{\textwidth}{ +\texttt{ +issues\_tracker: redmine: title: ``Redmine'' \#\# If not nil, link +`Issues' on project page will be replaced with this \#\# Use +placeholders: \#\# :project\_id - GitLab project identifier \#\# +:issues\_tracker\_id - Project Name or Id in external issue tracker +project\_url: "http://redmine.sample/projects/:issues\_tracker\_id" +\#\# If not nil, links from /\# d/ entities from commit messages will replaced with this +\#\# Use placeholders: +\#\# :project\_id - GitLab project identifier +\#\# :issues\_tracker\_id - Project Name or Id in external issue tracker +\#\# :id - Issue id (from commit messages) +issues\_url: "http://redmine.sample/issues/:id" +\#\# If not nil, links to creating new issues will be replaced with this +\#\# Use placeholders: +\#\# :project\_id - GitLab project identifier +\#\# :issues\_tracker\_id - Project Name or Id in external issue tracker +new\_issue\_url: "http://redmine.sample/projects/:issues\_tracker\_id/issues/new" +\# jira: +\# title: "Atlassian Jira" +\# project\_url: \\"http://jira.sample/issues/?jql=project=:issues\_tracker\_id" +\# issues\_url: "http://jira.sample/browse/:id" +\# new\_issue\_url: "http://jira.sample/secure/CreateIssue.jspa" + }}} + +\emph{NOTA:} Altere todos redmine.sample para seu servidor redmine + +\subsection{Restart gitlab} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo service gitlab restart +}}} + +\emph{NOTA:} + +\fbox{\parbox{\textwidth}{ +\texttt{ +Você pode acessar o gitlab usando essa url: `http://localhost:8090/gitlab +}}} \ No newline at end of file diff --git a/installDoc/gitlab-sei.txt b/installDoc/gitlab-sei.txt new file mode 100644 index 0000000..4fb2369 --- /dev/null +++ b/installDoc/gitlab-sei.txt @@ -0,0 +1,420 @@ + +Gitlab +====== + + +Install postgresql + +.. code-block:: + + sudo yum localinstall http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm -y + sudo yum install postgresql93 postgresql93-devel postgresql93-libs postgresql93-server -y + +Initialize database + +.. code-block:: + + sudo service postgresql-9.3 initdb + +Start postgresql with the system + +.. code-block:: + + sudo chkconfig postgresql-9.3 on + +Start postgresql + +.. code-block:: + + sudo service postgresql-9.3 start + + +Add EPEL repository + +.. code-block:: + + sudo yum -y install wget vim + sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 https://www.fedoraproject.org/static/0608B895.txt + sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 + +Add PUIAS Computational repository (necessary to download some exclusive dependencies) + +.. code-block:: + + sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm + 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 + 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 + sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-puias + +Enable PUIAS repository + +.. code-block:: + + sudo yum -y install yum-utils + sudo yum-config-manager --enable epel --enable PUIAS_6_computational + +Update all packages, and install some addtional packages + +.. code-block:: + + sudo yum -y update + sudo yum -y groupinstall 'Development Tools' + 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 + +Add redis to start with the system, and start it + +.. code-block:: + + sudo chkconfig redis on + sudo service redis start + +Install the mail server ``postfix`` + +.. code-block:: + + sudo yum -y install postfix + +Remove any git package that you may had install + +.. code-block:: + + sudo yum -y remove git + +Install git 1.9.0 and its dependencies + +.. code-block:: + + sudo yum -y install zlib-devel perl-CPAN gettext curl-devel expat-devel gettext-devel openssl-devel + sudo mkdir /tmp/git && cd /tmp/git + sudo wget https://git-core.googlecode.com/files/git-1.9.0.tar.gz + sudo tar xzf git-1.9.0.tar.gz + cd git-1.9.0/ + sudo ./configure + sudo make + sudo make prefix=/usr/local install + +Remove any ruby installed before, and download ``ruby-2.0.0-p451`` + +.. code-block:: + + sudo yum remove ruby -y + mkdir /tmp/ruby && cd /tmp/ruby + sudo curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz | tar xz + +*NOTE:* + + 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 + +Install ruby 2.0.0 + +.. code-block:: + + cd ruby-2.0.0-p451 + ./configure --disable-install-rdoc + make + sudo make prefix=/usr/local install + +Install the bundler gem + +.. code-block:: + + sudo /usr/local/bin/gem install bundler --no-ri --no-rdoc + +Create the user ``git`` to give the rights permissions to Gitlab application + +.. code-block:: + + sudo adduser --system --shell /bin/bash --comment 'GitLab' --create-home --home-dir /home/git/ git + +Clone the gitlab-shell repository + +.. code-block:: + + sudo su + cd /home/git + sudo -u git -H /usr/local/bin/git clone https://gitlab.com/gitlab-org/gitlab-shell.git + cd gitlab-shell/ + /usr/local/bin/git reset --hard v1.9.3 + +Configure the host name and install gitlab-shell + +.. code-block:: + + sudo -u git -H cp config.yml.example config.yml + sudo -u git -H vim config.yml + sudo -u git -H /usr/local/bin/ruby ./bin/install + restorecon -Rv /home/git/.ssh + +Create database ``gitlabhq_production``, and if you're going to develop to gitlab also create ``gitlabhq_development`` and ``gitlabhq_test`` + +.. code-block:: + + sudo -u postgres psql -d template1 + CREATE USER git; + CREATE DATABASE gitlabhq_production OWNER git; + CREATE DATABASE gitlabhq_development OWNER git; + CREATE DATABASE gitlabhq_test OWNER git; + \q + +Add the git user in pg_hba.conf to grant the permissions + +.. code-block:: + + vim /var/lib/pgsql/9.3/data/pg_hba.conf + +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. + +.. code-block:: + + # TYPE DATABASE USER ADDRESS METHOD + # "local" is for Unix domain socket connections only + local all postgres peer + local all git trust + # IPv4 local connections: + host all postgres 127.0.0.1/32 ident + host all git 127.0.0.1/32 trust + # IPv6 local connections: + host all postgres ::1/128 ident + host all git ::1/128 trust + +.. code-block:: + + [ESC]:wq! + +Restart postgresql + +.. code-block:: + + service postgresql-9.3 restart + +Clone and configure the ``gitlab`` repository + +.. code-block:: + + cd /home/git + sudo -u git -H /usr/local/bin/git clone https://github.com/colab-community/gitlabhq.git -b 7-0-stable gitlab + cd /home/git/gitlab + sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml + chown -R git {log,tmp} + chmod -R u+rwX {log,tmp} + sudo -u git -H mkdir /home/git/gitlab-satellites + chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites + chmod -R u+rwX tmp/{pids,sockets} + chmod -R u+rwX public/uploads + sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb + sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb + +Change the port you're using for gitlab, in this case we use 8090 + +.. code-block:: + + sudo vim /home/git/gitlab/config/unicorn.rb + +Change + +.. code-block:: + + listen "127.0.0.1:8080", :tcp_nopush => true + +To + +.. code-block:: + + listen "127.0.0.1:8090", :tcp_nopush => true + +.. code-block:: + + [ESC]:wq! + + +Change defautl URL in gitlab-shell/config.yml + +.. code-block:: + + sudo vim /home/git/gitlab-shell/config.yml + +Change the following line, From: + +.. code-block:: + + gitlab_url: "http://127.0.0.1:8090/gitlab" + +To, using the your IP: + +.. code-block:: + + gitlab_url: "http://127.0.0.1:8090/" + + +Configure git and database + +.. code-block:: + + sudo -u git -H /usr/local/bin/git config --global user.name "GitLab" + sudo -u git -H /usr/local/bin/git config --global user.email "gitlab@localhost" + sudo -u git -H /usr/local/bin/git config --global core.autocrlf input + sudo -u git cp config/database.yml.postgresql config/database.yml + sudo -u git -H chmod o-rwx config/database.yml + +Configure the bundle + +.. code-block:: + + cd /home/git/gitlab + sudo -u git -H /usr/local/bin/bundle config build.pg --with-pg-config=/usr/pgsql-9.3/bin/pg_config + sudo -u git -H /usr/local/bin/bundle config build.nokogiri --use-system-libraries + + + +Edit sudores file to let ``bundle``, ``git`` and ``gem`` execute in sudo mode. + +*NOTE:* + + 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. + +.. code-block:: + + sudo vim /etc/sudoers + +Change the line + +.. code-block:: + + Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/ + +To + +.. code-block:: + + Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/:/usr/local/bin/ + +.. code-block:: + + [ESC]:wq! + +Give the bundle install to install the required gems, if you are going to devel to gitlab change the env to ``RAILS_ENV=development`` + +.. code-block:: + + sudo -u git -H /usr/local/bin/bundle install --deployment --without development test mysql aws + sudo -u git -H /usr/local/bin/bundle exec rake gitlab:setup RAILS_ENV=production + +Type ``yes`` to create the database tables + +*NOTE:* + + Admin login and password -- login: admin@local.host -- password: 5iveL!fe + +Add gitlab to start with system, this step is not require to development mode + +.. code-block:: + + wget -O /etc/init.d/gitlab https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/init/sysvinit/centos/gitlab-unicorn + chmod +x /etc/init.d/gitlab + chkconfig --add gitlab + chkconfig gitlab on + cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab + service gitlab start + +Compile the asstes, to development change the env to ``RAILS_ENV=development`` + +.. code-block:: + + sudo -u git -H /usr/local/bin/bundle exec rake assets:precompile RAILS_ENV=production + +Change group permissions + + chmod g+rx /home/git/ + + +Altering the line + +.. code-block:: + + env: + enabled: true + +to + +.. code-block:: + + env: + enabled: false + +Change these lines : + +.. code-block:: + issues_tracker: + # redmine: + # title: "Redmine" + # ## If not nil, link 'Issues' on project page will be replaced with this + # ## Use placeholders: + # ## :project_id - GitLab project identifier + # ## :issues_tracker_id - Project Name or Id in external issue tracker + # project_url: "http://redmine.sample/projects/:issues_tracker_id" + # + # ## If not nil, links from /#\d/ entities from commit messages will replaced with this + # ## Use placeholders: + # ## :project_id - GitLab project identifier + # ## :issues_tracker_id - Project Name or Id in external issue tracker + # ## :id - Issue id (from commit messages) + # issues_url: "http://redmine.sample/issues/:id" + # + # ## If not nil, links to creating new issues will be replaced with this + # ## Use placeholders: + # ## :project_id - GitLab project identifier + # ## :issues_tracker_id - Project Name or Id in external issue tracker + # new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new" + # + # jira: + # title: "Atlassian Jira" + # project_url: "http://jira.sample/issues/?jql=project=:issues_tracker_id" + # issues_url: "http://jira.sample/browse/:id" + # new_issue_url: "http://jira.sample/secure/CreateIssue.jspa" + +to + +.. code-block:: + + + issues_tracker: + redmine: + title: "Redmine" + ## If not nil, link 'Issues' on project page will be replaced with this + ## Use placeholders: + ## :project_id - GitLab project identifier + ## :issues_tracker_id - Project Name or Id in external issue tracker + project_url: "http://redmine.sample/projects/:issues_tracker_id" + + ## If not nil, links from /#\d/ entities from commit messages will replaced with this + ## Use placeholders: + ## :project_id - GitLab project identifier + ## :issues_tracker_id - Project Name or Id in external issue tracker + ## :id - Issue id (from commit messages) + issues_url: "http://redmine.sample/issues/:id" + + ## If not nil, links to creating new issues will be replaced with this + ## Use placeholders: + ## :project_id - GitLab project identifier + ## :issues_tracker_id - Project Name or Id in external issue tracker + new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new" + + # jira: + # title: "Atlassian Jira" + # project_url: "http://jira.sample/issues/?jql=project=:issues_tracker_id" + # issues_url: "http://jira.sample/browse/:id" + # new_issue_url: "http://jira.sample/secure/CreateIssue.jspa" + +*NOTE:* + Change all redmine.sample to your redmine server + + +Restart gitlab + +.. code-block:: + + sudo service gitlab restart + +*NOTE:* + + You can access gitlab in this url: `http://localhost:8090/gitlab, but it won't log-in without the REMOTE_USER provided by colab diff --git a/installDoc/gitlab_omnibus_issues_tracker_tutorial.tex b/installDoc/gitlab_omnibus_issues_tracker_tutorial.tex new file mode 100644 index 0000000..125f72c --- /dev/null +++ b/installDoc/gitlab_omnibus_issues_tracker_tutorial.tex @@ -0,0 +1,90 @@ +\section{Integração com o Redmine utilizando o Gitlab Omnibus}\label{integração com o Redmine utilizando o Gitlab Omnibus} + +\subsection{Instalar vim, wget e openssh-server} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo yum install vim wget openssh-server +}}} + +\subsection{Download e instalação pacote Gitlab-7.0.0} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\footnotesize{ +wget https://downloads-packages.s3.amazonaws.com/centos-6.5/gitlab-7.0.0\_omnibus-1.el6.x86\_64.rpm +} +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo rpm -i gitlab-7.0.0\_omnibus-1.el6.x86\_64.rpm +}}} + +\subsection{Adicionar as configurações para url externa, portas de serviço e issues tracker} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo vim /etc/gitlab/gitlab.rb +}}} + +Altere a url externa modificando a linha: + +\fbox{\parbox{\textwidth}{ +\texttt{ +external\_url "http://gitlab.example.com +}}} + +Para + +\fbox{\parbox{\textwidth}{ +\texttt{ +external\_url "http://" +}}} + +Onde tiver a url externa do Gitlab + +Adicione as seguintes linhas para modificar as portas de serviço: + +\fbox{\parbox{\textwidth}{ +\texttt{redis{[}`port'{]} = 1234 postgresql{[}`port'{]} = 2345 +unicorn{[}`port'{]} = 3456}}} + +\subsection{Ativar incrição, acicionar a linha:} + +\fbox{\parbox{\textwidth}{ +\texttt{gitlab\_rails{[}`gitlab\_signup\_enabled'{]} = ``true''}}} + +\subsection{Adicione as seguintes definições,para definir no Redmine a issue tracker:} + +\fbox{\parbox{\textwidth}{ +\texttt{ +gitlab\_rails['issues\_tracker\_redmine'] = "redmine" +\\gitlab\_rails['issues\_tracker\_redmine\_title'] = "Redmine" +\\gitlab\_rails['issues\_tracker\_redmine\_project\_url'] = \\"http:///projects/:issues\_tracker\_id" +\\gitlab\_rails['issues\_tracker\_redmine\_issues\_url'] = \\"http:///issues/:id" +\\gitlab\_rails['issues\_tracker\_redmine\_new\_issue\_url'] = \\"http:///projects/\\:issues\_tracker\_id/issues/new" +}}} + +Onde houver url do redmine. + +Sauve as alterações, rodando: + +\fbox{\parbox{\textwidth}{ +\texttt{ +[ESC]:wq! +}}} + +\subsection{Execute o seguinte comando para que as alterações entrem em vigor:} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo gitlab-ctl reconfigure +}}} + +\subsection{Abrir firewall para serviços de http e ssh:} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo lokkit -s http -s ssh +}}} diff --git a/installDoc/gitlab_omnibus_issues_tracker_tutorial.txt b/installDoc/gitlab_omnibus_issues_tracker_tutorial.txt new file mode 100644 index 0000000..15b3bd3 --- /dev/null +++ b/installDoc/gitlab_omnibus_issues_tracker_tutorial.txt @@ -0,0 +1,74 @@ +Install vim, wget and openssh-server + +.. code-block:: + + sudo yum install vim wget openssh-server + +Download and install Gitlab-7.0.0 package + +.. code-block:: + + wget https://downloads-packages.s3.amazonaws.com/centos-6.5/gitlab-7.0.0_omnibus-1.el6.x86_64.rpm + sudo rpm -i gitlab-7.0.0_omnibus-1.el6.x86_64.rpm + +Add the configurations settings for external url, services ports and issues tracker + +.. code-block:: + + sudo vim /etc/gitlab/gitlab.rb + +Change external url altering the line + +.. code-block:: + + external_url "http://gitlab.example.com +To + +.. code-block:: + + external_url "http://" + +Where is the external url of Gitlab. + + +Add the following settings, to set the ports of services: + +.. code-block:: + redis['port'] = 1234 + postgresql['port'] = 2345 + unicorn['port'] = 3456 + +Enable signup feature, adding the line: + +.. code-block:: + gitlab_rails['gitlab_signup_enabled'] = "true" + +Add the following settings, to set Redmine as issue tracker: + +.. code-block:: + + gitlab_rails['issues_tracker_redmine'] = "redmine" + gitlab_rails['issues_tracker_redmine_title'] = "Redmine" + gitlab_rails['issues_tracker_redmine_project_url'] = "http:///projects/:issues_tracker_id" + gitlab_rails['issues_tracker_redmine_issues_url'] = "http:///issues/:id" + gitlab_rails['issues_tracker_redmine_new_issue_url'] = "http:///projects/:issues_tracker_id/issues/new" + +Where is the Redmine url. + +Save the changes, running: + +.. code-block:: + + [ESC]:wq! + +Run the following command for the changes to take effect: + +.. code-block:: + + sudo gitlab-ctl reconfigure + +Open firewall for http and ssh services: + +.. code-block:: + + sudo lokkit -s http -s ssh diff --git a/installDoc/redmine-sei.tex b/installDoc/redmine-sei.tex new file mode 100644 index 0000000..3e6376a --- /dev/null +++ b/installDoc/redmine-sei.tex @@ -0,0 +1,280 @@ +\section{Redmine}\label{redmine} + +\subsection{Instalação do Epel} +\fbox{ +\texttt{rpm -Uvh http://fedora.uib.no/epel/6/x86\_64/epel-release-6-8.noarch.rpm} +} + +\subsection{Instalação de pacotes} +\fbox{\parbox{\textwidth}{ +\texttt{sudo yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel subversion git postgresql-devel} +}} + +\subsection{Instalação Postgresql} + +\fbox{\parbox{\textwidth}{ +\texttt{sudo yum localinstall +http://yum.postgresql.org/9.3/redhat/rhel-6-x86\_64/ +pgdg-centos93-9.3-1.noarch.rpm +-y sudo yum install postgresql93 postgresql93-devel postgresql93-libs +postgresql93-server -y +}}} + +\subsubsection{Reiniciar Postgresql} + +\fbox{\parbox{\textwidth}{ +\texttt{/etc/init.d/postgresql-9.3 initdb sudo /etc/init.d/postgresql-9.3 restart +}}} + +\subsubsection{Modificar senha do Postgres} + +\fbox{\parbox{\textwidth}{ +\texttt{sudo -u postgres psql template1 \textgreater{}\textgreater{}ALTER USER +postgres with encrypted password `postgres'; +}}} + +\subsubsection{Configurando o Postgres} + +\fbox{ +\texttt{sudo vi /var/lib/pgsql/9.3/data/postgresql.conf}} + +\fbox{ +\texttt{change: listen\_addresses = 'localhost'} +\texttt{to: listen\_addresses = 'localhost'}} + +\fbox{\parbox{\textwidth}{ +\texttt{[ESC]:wq! +Edit pg\_hba.conf to grant the permissions}}} + +\fbox{ +\texttt{sudo vi /var/lib/pgsql/9.3/data/pg\_hba.conf}} + +\subsubsection{Usar a permissão certa de usuário do Redmine no banco de dados do Redmine} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\# TYPE DATABASE USER ADDRESS METHOD +\# local is for Unix domain socket connections only +local all redmine md5 +\# IPv4 local connections: +host all redmine 127.0.0.1/32 md5 +\# IPv6 local connections: +host all redmine ::1/128 md5 +}}} + +\fbox{ +\texttt{[ESC]:wq!}} + +\subsubsection{Reiniciar Postgresql} + +\fbox{ +\texttt{sudo /etc/init.d/postgresql-9.3 restart}} + +\subsection{Instalar Requisitos das Gems} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo yum install gcc gcc-c++.x86\_64 make automake autoconf curl-devel +openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel +sqlite-devel ruby-rdoc ruby-devel}}} + +\fbox{ +\texttt{sudo yum install rubygems libxslt-devel libxml2-devel.x86\_64}} + +\subsection{Atualizar para a Gem 1.4.2} + +\fbox{\parbox{\textwidth}{ +\texttt{ +wget http://production.cf.rubygems.org/rubygems/rubygems-1.4.2.tgz tar +zxvf rubygems-1.4.2.tgz cd rubygems-1.4.2 ruby setup.rb gem -v +}}} + + +\subsection{Instalar ImageMagick} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo yum install php-pear gcc ImageMagick ImageMagick-devel +ImageMagick-perl +}}} + +\subsection{Instalar Gem Bundle} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo gem install bundle --no-ri --no-rdoc +}}} + +\subsection{Instalar NGINX} + +\fbox{\parbox{\textwidth}{ +\texttt{ +cd /tmp wget +http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release centos-6-0.el6.ngx.noarch.rpm +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm sudo yum +install nginx -y sudo chkconfig nginx on +}}} + +\subsection{Instalar Redmine 2.5.1} + +\fbox{\parbox{\textwidth}{ +\texttt{ +cd /opt svn co http://svn.redmine.org/redmine/branches/2.5-stable +redmine sudo mkdir -p tmp/pdf public/plugin\_assets +}}} + +\subsection{Instalar requisitos da Gem} + +\fbox{ +\texttt{cd /opt/redmine bundle install --without mysql sqlite}} + + +\subsection{Configurar postgresql} + +\fbox{ +\texttt{ +sudo -u postgres psql}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\begin{quote} +\begin{quote} +CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD `redmine' NOINHERIT VALID +UNTIL `infinity'; CREATE DATABASE redmine WITH ENCODING=`UTF8' +OWNER=redmine; +\end{quote} +\end{quote} +}}} + + +\subsection{Installing Gems} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo gem install pg -v `0.17.1' --no-ri --no-rdoc sudo gem install +unicorn --no-ri --no-rdoc sudo gem uninstall rake -v `10.3.2' +}}} + + +\subsection{Configurar database.yml na pasta do Redmine} + + +\fbox{\parbox{\textwidth}{ +\texttt{cd config/ mv database.yml.example database.yml vi database.yml +}}} + + +\subsubsection{Comentar outras linhas e descomentar essas linhas:} + +\fbox{\parbox{\textwidth}{ +\texttt{ +\#---------------------- +production: adapter: postgresql database: redmine host: 10.18.0.10 (link +to database) username: redmine password: redmine encoding: utf8 +\#---------------------- +}}} + + +\subsection{Popular Redmine} + + +\fbox{\parbox{\textwidth}{ +\texttt{ +rake generate\_secret\_token RAILS\_ENV=production rake db:migrate +RAILS\_ENV=production rake redmine:load\_default\_data escolher pt-BR +}}} + + +\subsection{Configurar Unicorn} + + +\fbox{\parbox{\textwidth}{ +\texttt{ +cd /opt/redmine mkdir pids\\ vi config/unicorn.rb +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +Copy this code to file: +\#------------------------------------ \# Set the working application +directory \# working\_directory ``/path/to/your/app'' working\_directory +``/opt/redmine'' +\# Unicorn PID file location \# pid ``/path/to/pids/unicorn.pid'' pid +``/opt/redmine/pids/unicorn.pid'' +\# Path to logs \# stderr\_path ``/path/to/log/unicorn.log'' \# +stdout\_path ``/path/to/log/unicorn.log'' stderr\_path +``/opt/redmine/log/unicorn.log'' stdout\_path +``/opt/redmine/log/unicorn.log'' +\# Unicorn socket \#listen ``/tmp/unicorn.redmine.sock'' listen +``/tmp/unicorn.redmine.sock'' +\# Number of processes \# worker\_processes 4 worker\_processes 2 +\# Time-out timeout 30 +\#------------------------------------- +}}} + + +\subsection{Reiniciar Postgresql} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo /etc/init.d/postgresql-9.3 restart +}}} + + +\subsection{Rodar Redmine usando Unicorn} + +\fbox{\parbox{\textwidth}{ +\texttt{ +sudo unicorn\_rails -c /opt/redmine/config/unicorn.rb -E production -l +0.0.0.0:3000 -D +}}} + +\subsection{Instalar Plugin Backlogs} + +De acordo com \url{http://www.redminebacklogs.net/en/installation.html}, execute os seguintes comandos: + +\fbox{\parbox{\textwidth}{ +\texttt{ +cd /opt/redmine +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +bundle install --without development test +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +gem install holidays --version 1.0.3\\ +gem install holidays +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +cd /opt/redmine/plugins\\ +git clone https://github.com/backlogs/redmine\_backlogs.git\\ +cd redmine\_backlogs\\ +git tag\\ +git checkout v1.0.6 +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +cd /opt/redmine\\ +RAILS\_ENV=production\\ +export RAILS\_ENV\\ +bundle exec rake db:migrate\\ +bundle exec rake tmp:cache:clear\\ +bundle exec rake tmp:sessions:clear\\ +bundle exec rake redmine:backlogs:install (escolher sempre a opção 2) +}}} + +\fbox{\parbox{\textwidth}{ +\texttt{ +service httpd restart +}}} + diff --git a/installDoc/redmine-sei.txt b/installDoc/redmine-sei.txt new file mode 100644 index 0000000..cb50c6a --- /dev/null +++ b/installDoc/redmine-sei.txt @@ -0,0 +1,251 @@ +Redmine +===== + +Install Epel + +.. code-block:: + + rpm -Uvh http://fedora.uib.no/epel/6/x86_64/epel-release-6-8.noarch.rpm + + +Install Requirements +.. code-block:: + + sudo yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel + subversion git postgresql-devel + + +Install Postgresql + +.. code-block:: + + sudo yum localinstall http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm -y + sudo yum install postgresql93 postgresql93-devel postgresql93-libs postgresql93-server -y + + +Restarting Postgresql + +.. code-block:: + + /etc/init.d/postgresql-9.3 initdb + sudo /etc/init.d/postgresql-9.3 restart + +Change Postgres password + +.. code-block:: + + sudo -u postgres psql template1 + >>ALTER USER postgres with encrypted password 'postgres'; + +Configuring + +.. code-block:: + + sudo vi /var/lib/pgsql/9.3/data/postgresql.conf + + change: + # listen_addresses = 'localhost' + to: + listen_addresses = 'localhost' + + +.. code-block:: + + [ESC]:wq! + + +Edit pg_hba.conf to grant the permissions + +.. code-block:: + + sudo vi /var/lib/pgsql/9.3/data/pg_hba.conf + +Set the right permission to redmine user on redmine database + +.. code-block:: + + # TYPE DATABASE USER ADDRESS METHOD + # "local" is for Unix domain socket connections only + local all redmine md5 + + # IPv4 local connections: + host all redmine 127.0.0.1/32 md5 + + # IPv6 local connections: + host all redmine ::1/128 md5 + +.. code-block:: + + [ESC]:wq! + +Restarting Postgresql + +.. code-block:: + + sudo /etc/init.d/postgresql-9.3 restart + + + +Install Gems Requirements + +.. code-block:: + + sudo yum install gcc gcc-c++.x86_64 make automake autoconf curl-devel openssl-devel + zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel ruby-rdoc ruby-devel + + sudo yum install rubygems libxslt-devel libxml2-devel.x86_64 + + +Upgrading to Gem 1.4.2 + +.. code-block:: + + wget http://production.cf.rubygems.org/rubygems/rubygems-1.4.2.tgz + tar zxvf rubygems-1.4.2.tgz + cd rubygems-1.4.2 + ruby setup.rb + gem -v + + +Install ImageMagick + +.. code-block:: + + sudo yum install php-pear gcc ImageMagick ImageMagick-devel ImageMagick-perl + +Install Gem Bundle + +.. code-block:: + + sudo gem install bundle --no-ri --no-rdoc + +Install NGINX + +.. code-block:: + + cd /tmp + wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm + sudo rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm + sudo yum install nginx -y + sudo chkconfig nginx on + +Install redmine 2.5.1 + +.. code-block:: + + cd /opt + svn co http://svn.redmine.org/redmine/branches/2.5-stable redmine + sudo mkdir -p tmp/pdf public/plugin_assets + + +Install Gem requirements + +.. code-block:: + + cd /opt/redmine + bundle install --without mysql sqlite + + +Configuring postgresql + +.. code-block:: + + sudo -u postgres psql + + >>CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'redmine' NOINHERIT VALID UNTIL 'infinity'; + >>CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine; + >>\q + + +Installing Gems + +.. code-block:: + + sudo gem install pg -v '0.17.1' --no-ri --no-rdoc + sudo gem install unicorn --no-ri --no-rdoc + sudo gem uninstall rake -v '10.3.2' + + +Configuring database.yml in Redmine Folder + +.. code-block:: + + cd config/ + mv database.yml.example database.yml + vi database.yml + + Comment another lines and uncomment this lines: + #---------------------- + + production: + adapter: postgresql + database: redmine + host: 10.18.0.10 (link to database) + username: redmine + password: redmine + encoding: utf8 + + #---------------------- + + +Populating Redmine + +.. code-block:: + + rake generate_secret_token + RAILS_ENV=production rake db:migrate + RAILS_ENV=production rake redmine:load_default_data + escolher pt-BR + + +Configuring Unicorn + +.. code-block:: + + cd /opt/redmine + mkdir pids + vi config/unicorn.rb + + Copy this code to file: + + #------------------------------------ + # Set the working application directory + # working_directory "/path/to/your/app" + working_directory "/opt/redmine" + + # Unicorn PID file location + # pid "/path/to/pids/unicorn.pid" + pid "/opt/redmine/pids/unicorn.pid" + + # Path to logs + # stderr_path "/path/to/log/unicorn.log" + # stdout_path "/path/to/log/unicorn.log" + stderr_path "/opt/redmine/log/unicorn.log" + stdout_path "/opt/redmine/log/unicorn.log" + + # Unicorn socket + #listen "/tmp/unicorn.redmine.sock" + listen "/tmp/unicorn.redmine.sock" + + # Number of processes + # worker_processes 4 + worker_processes 2 + + # Time-out + timeout 30 + + #------------------------------------- + + +Restarting Postgresql + +.. code-block:: + + sudo /etc/init.d/postgresql-9.3 restart + +Running Redmine Using unicorn + +.. code-block:: + + sudo unicorn_rails -c /opt/redmine/config/unicorn.rb -E production -l 0.0.0.0:3000 -D + -- libgit2 0.21.2