<%- initialize_metachars(@config['texcommand']) -%>
\makeatletter
\def\review@reviewversion{<%= ReVIEW::VERSION %>}
\def\review@texcompiler{<%= @texcompiler %>}
\def\review@documentclass{<%= @documentclass %>}

<%- %w(booktitle subtitle).each do |item| -%>
<%-   if @config[item] -%>\def\review@<%= item %>name{<%= escape(@config.name_of(item)) %>}
<%-   end -%>
<%- end -%>

<%- %w(aut adp ann arr art asn aqt aft aui ant bkp clb cmm csl dsr edt ill lyr mdc mus nrt oth pht pbl prt red rev spn ths trc trl).each do |item| %><%-   if @config[item] -%>\def\review@<%= item %>names{<%= escape(@config.names_of(item).join(I18n.t('names_splitter'))) %>}
<%-   end -%>
<%- end -%>

\def\review@titlepageauthors{<%= @authors %>}
\def\review@date{<%= escape(@config['date'].to_s) %>}

<%- %w(bookname language urnid isbn).each do |item| -%><%-   if @config[item] -%>\def\review@<%= item %>{<%= escape(@config[item]) %>}
<%-   end -%>
<%- end -%>
<%- %w(rights description subject type format source relation coverage).each do |item| -%>
<%-   if @config[item] -%>
<%-     a = [@config[item]].flatten -%>\def\review@<%= item %>{<%= a.map{|s| escape(s)}.join('\\' + '\\') %>}
<%-   end -%>
<%- end -%>

<%- if @config['highlight'] && @config['highlight']['latex'] -%>\def\review@highlightlatex{<%= @config['highlight']['latex'] %>}
<%- end -%>

\def\review@intn@list{<%= escape(I18n.t('list')) %>}
\def\review@intn@columnhead{<%= escape(I18n.t('column_head')) %>}
\def\review@intn@image{<%= escape(I18n.t('image')) %>}
\def\review@intn@table{<%= escape(I18n.t('table')) %>}
\def\review@intn@equation{<%= escape(I18n.t('equation')) %>}
\def\review@intn@columnname{<%= escape(I18n.t('columnname')) %>}
<%- %w[note tip info warning important caution notice memo].each do |mini| -%>
\def\review@intn@<%= mini%>head{<%= escape(I18n.t("#{mini}_head")) %>}
<%- end -%>
\def\review@intn@edition{<%= escape(I18n.t('edition')) %>}
\def\review@intn@publishedby{<%= escape(I18n.t('published_by', @config.names_of('pbl').join(I18n.t('names_splitter'))))%>}
\def\review@intn@captionprefix{<%= escape(I18n.t('caption_prefix')) %>}
\def\review@toctitle{<%= escape(@config['toctitle'].present? ? @config['toctitle'] : I18n.t('toctitle')) %>}
\def\review@prepartname{<%= escape(@locale_latex['prepartname']) %>}
\def\review@postpartname{<%= escape(@locale_latex['postpartname']) %>}
\def\review@prechaptername{<%= escape(@locale_latex['prechaptername']) %>}
\def\review@postchaptername{<%= escape(@locale_latex['postchaptername']) %>}
\def\review@figurename{<%= escape(I18n.t('image')) %>}
\def\review@tablename{<%= escape(I18n.t('table')) %>}
\def\review@appendixname{<%= escape(@locale_latex['preappendixname']) %>}

<%- if @config['toc'] -%>
\def\review@toc{true}
\def\review@tocdepth{<%= @config['toclevel'] - 1 %>}
<%- end -%>
<%- if @config['makeindex'] -%>
\def\review@makeindex{true}
<%- end -%>
<%- if @config['cover'] -%>
\def\review@coverfile{<%= File.read(@config['cover']) %>}
<%- elsif @config['coverimage'] -%>
\def\review@coverimage{./<%= @config['imagedir'] %>/<%= @config['coverimage'] %>}
\def\review@coverimageoption{<%= @coverimageoption%>}
<%- end -%>
<%- if @config['pdfmaker']['use_cover_nombre'] -%>
\def\review@usecovernombre{true}
<%- end -%>
<%- if @config['titlepage'] -%>
\def\review@titlepage{true}
<%-   if @config['titlefile'] -%>
\def\review@titlefile{<%= File.read(@config['titlefile']) %>}
<%-   end -%>
<%- end -%>
<%- if @custom_originaltitlepage -%>
\def\revieworiginaltitlepagecont{<%= @custom_originaltitlepage %>}
<%- end -%>
<%- if @custom_creditpage -%>
\def\reviewcreditfilecont{<%= @custom_creditpage %>}
<%- end -%>
<%- if @custom_profilepage -%>
\def\reviewprofilepagecont{<%= @custom_profilepage %>}
<%- end -%>
<%- if @custom_advfilepage -%>
\def\reviewadvfilepagecont{<%= @custom_advfilepage %>}
<%- end -%>
<%- if @custom_backcoverpage -%>
\def\reviewbackcovercont{<%= @custom_backcoverpage %>}
<%- end -%>

<%- if @config['colophon'] -%>
\def\review@colophon{true}
<%-   if @custom_colophonpage -%>
\def\review@colophonfile{<%= @custom_colophonpage %>}
<%-   end -%>
<%- end -%>
\def\review@pubhistories{<%= @config['pubhistory'].to_s.gsub(/\n/){"\n\n\\noindent\n"} %>}
\def\review@colophonnames{<%= @okuduke %>}

\def\reviewprefacefiles{<%= @input_files['PREDEF'] %>}
\def\reviewchapterfiles{<%= @input_files['CHAPS'] %>}
\def\reviewappendixfiles{<%= @input_files['APPENDIX'] %>}
\def\reviewpostdeffiles{<%= @input_files['POSTDEF'] %>}
<%- if @config['use_part'] -%>
\def\reviewusepart{true}
<%- end -%>
<%- if @config['pdfmaker']['bbox'] -%>
\def\review@bbox{<%= @config['pdfmaker']['bbox'] %>}
<%- end -%>
<%- if @boxsetting -%>
\newcommand{\reviewboxsetting}{%
<%= @boxsetting %>%
}
<%- end -%>

\def\reviewbackcompatibilityhook{
  \ifdefined\reviewimagecaption\else% for 3.0.0 compatibility
    \newcommand{\reviewimagecaption}[1]{\caption{##1}}
  \fi
  \ifdefined\reviewincludegraphics\else% for 3.2.0 compatibility
    \DeclareRobustCommand{\reviewincludegraphics}[2][]{%
      \includegraphics[##1]{##2}}
  \fi
  \ifdefined\covermatter\else% for 4.0.0 compatibility
    \def\covermatter{}
  \fi
  \ifdefined\reviewchapref\else% for 5.1.0 compatibility
    \newcommand{\reviewchapref}[2]{\hyperref[##2]{##1}}
  \fi
  \ifdefined\reviewtcy\else% for 5.3.0 compatibility
    \DeclareRobustCommand{\reviewtcy}[1]{\rensuji{##1}}
  \fi
  \ifdefined\reviewicon\else% for 5.6.0 compatibility
    \DeclareRobustCommand{\reviewicon}[1]{\reviewincludegraphics{##1}}
  \fi
}

\makeatother
