Skip to content

Instantly share code, notes, and snippets.

@takahashim
Created September 30, 2015 03:38
Show Gist options
  • Save takahashim/0f7280d66ef537ee1b52 to your computer and use it in GitHub Desktop.
Save takahashim/0f7280d66ef537ee1b52 to your computer and use it in GitHub Desktop.
\documentclass[<%= documentclassoption %>]{<%= documentclass %>}
\usepackage{luatexja-otf}
\usepackage{color}
\usepackage{graphicx}
\usepackage{framed}
\usepackage{wrapfig}
\definecolor{shadecolor}{gray}{0.9}
\definecolor{shadecolorb}{gray}{0.1}
\definecolor{reviewgreen}{rgb}{0,0.4,0}
\definecolor{reviewblue}{rgb}{0.2,0.2,0.4}
\definecolor{reviewred}{rgb}{0.7,0,0}
\definecolor{reviewdarkred}{rgb}{0.3,0,0}
\usepackage{ascmac}
%\usepackage{float}
\usepackage{alltt}
\usepackage{amsmath}
\usepackage{lltjp-xunicode}
\DeclareTextCommandDefault{\nobreakspace}{\leavevmode\nobreak\ }
%\usepackage[hiragino-pro,deluxe]{luatexja-preset}
\usepackage{tikz}
%% if you use @<u>{} (underline), use jumoline.sty
%%\usepackage{jumoline}
\newenvironment{shadedb}{%
\def\FrameCommand{\fboxsep=\FrameSep \colorbox{shadecolorb}}%
\MakeFramed {\FrameRestore}}%
{\endMakeFramed}
\usepackage[top=10\zw,bottom=12\zw,left=10\zw,right=10\zw]{geometry}
\newcommand{\parasep}{\vspace*{3\zh}}
\setlength{\footskip}{30pt}
\usepackage[bookmarks=true,bookmarksnumbered=true,colorlinks=true,%
pdftitle={<%= values["booktitle"] %>},%
pdfencoding=auto,%
pdfauthor={<%= values["aut"] %>}]{hyperref}
<% if config["highlight"] && config["highlight"]["latex"] == "listings" %>
<% if config["language"] == "ja" %>
\usepackage{listings,jlisting}
<% else %>
\usepackage{listings}
<% end %>
\renewcommand{\lstlistingname}{<%= I18n.t("list")%>}
\lstset{%
breaklines=true,%
breakautoindent=false,%
breakindent=0pt,%
fontadjust=true,%
backgroundcolor=\color{shadecolor},%
frame=single,%
framerule=0pt,%
basicstyle=\ttfamily\scriptsize,%
commentstyle=\color{reviewgreen},%
identifierstyle=\color{reviewblue},%
stringstyle=\color{reviewred},%
keywordstyle=\bfseries\color{reviewdarkred},%
}
\lstnewenvironment{reviewemlistlst}[1][]{%
\lstset{#1}}{}
\lstnewenvironment{reviewemlistnumlst}[1][]{%
\lstset{numbers=left, #1}}{}
\lstnewenvironment{reviewlistlst}[1][]{%
\lstset{#1}}{}
\lstnewenvironment{reviewlistnumlst}[1][]{%
\lstset{numbers=left, #1}}{}
\lstnewenvironment{reviewcmdlst}[1][]{%
\lstset{backgroundcolor=\color{white}, frameround=tttt, frame=trbl, #1}}{}
<% end %>
\newenvironment{reviewimage}{%
\begin{figure}[H]
\begin{center}}{%
\end{center}
\end{figure}}
\newenvironment{reviewdummyimage}{%
\begin{figure}[H]
\begin{center}\begin{alltt}}{%
\end{alltt}\end{center}
\end{figure}}
\newenvironment{reviewemlist}{%
\medskip\small\begin{shaded}\setlength{\baselineskip}{1.3\zw}\begin{alltt}}{%
\end{alltt}\end{shaded}}
\newenvironment{reviewlist}{%
\begin{shaded}\small\setlength{\baselineskip}{1.3\zw}\begin{alltt}}{%
\end{alltt}\end{shaded}\par\vspace*{0.5\zw}}
\newenvironment{reviewcmd}{%
\color{white}\medskip\small\begin{shadedb}\setlength{\baselineskip}{1.3\zw}\begin{alltt}}{%
\end{alltt}\end{shadedb}}
\newenvironment{reviewbox}{%
\medskip\small\begin{framed}\setlength{\baselineskip}{1.3\zw}\begin{alltt}}{%
\end{alltt}\end{framed}}
\newenvironment{reviewtable}[1]{%
\begin{center}\small\setlength{\baselineskip}{1.2\zw}
\begin{tabular}{#1}}{%
\end{tabular}
\end{center}}
\newenvironment{reviewcolumn}{%
\begin{framed}
}{%
\end{framed}
\vspace{2\zw}}
\newcommand{\reviewcolumnhead}[2]{%
{\noindent\large <%= I18n.t("column_head")%>: #2}}
\newcommand{\reviewtablecaption}[1]{%
\caption{#1}}
\newcommand{\reviewbackslash}[0]{%
\textbackslash{}}
\newcommand{\reviewlistcaption}[1]{%
\medskip{\small\noindent #1}\vspace*{-1.3\zw}}
\newcommand{\reviewemlistcaption}[1]{%
\medskip{\small\noindent #1}\vspace*{-1.3\zw}}
\newcommand{\reviewcmdcaption}[1]{%
\medskip{\small\noindent #1}\vspace*{-1.3\zw}}
\newcommand{\reviewindepimagecaption}[1]{%
\begin{center}#1\end{center}}
\newcommand{\reviewboxcaption}[1]{%
\medskip{\small\noindent #1}\vspace*{-1.3\zw}}
\newcommand{\reviewimageref}[2]{%
<%= I18n.t("image")%> #1}
\newcommand{\reviewtableref}[2]{%
<%= I18n.t("table")%> #1}
\newcommand{\reviewlistref}[1]{%
<%= I18n.t("list")%> #1}
\newcommand{\reviewbibref}[2]{%
#1}
\newcommand{\reviewcolumnref}[2]{%
<%= I18n.t("columnname")%> #1}
\newcommand{\reviewsecref}[2]{%
#1}
\newcommand{\reviewminicolumntitle}[1]{%
{\large <%= I18n.t("memo_head")%>: #1}\\}
<% if values["toctitle"].present? %>
\renewcommand{\contentsname}{<%= values["toctitle"]%>}
<% end %>
\newenvironment{reviewminicolumn}{%
\vspace{1.5\zw}\begin{screen}}{%
\end{screen}\vspace{2\zw}}
\newcommand{\reviewkw}[1]{%
\textbf{\textgt{#1}}}
\newcommand{\reviewami}[1]{%
\mask{#1}{A}}
\newcommand{\reviewem}[1]{%
\textbf{#1}}
\newcommand{\reviewstrong}[1]{%
\textbf{#1}}
%% @<del> is ignored in LaTeX with default style
\newcommand{\reviewstrike}[1]{#1}
%%%% for ulem.sty:
%%\renewcommand{\reviewstrike}[1]{\sout{#1}}
%%
%%%% for jumoline.sty:
%%\renewcommand{\reviewstrike}[1]{\Middleline{#1}}
\newcommand{\reviewth}[1]{%
\textgt{#1}}
\newcommand{\reviewtitlefont}[0]{%
\usefont{T1}{phv}{b}{n}\gtfamily}
\newcommand{\reviewmainfont}[0]{%
}
\newcommand{\reviewcolophon}[0]{%
\clearpage}
\newcommand{\reviewappendix}[0]{%
\appendix}
\makeatletter
%% maxwidth is the original width if it is less than linewidth
%% otherwise use linewidth (to make sure the graphics do not exceed the margin)
\def\maxwidth{%
\ifdim\Gin@nat@width>\linewidth
\linewidth
\else
\Gin@nat@width
\fi
}
\makeatother
<%= values["usepackage"] %>
%\usepackage[T1]{fontenc}
\begin{document}
\reviewmainfont
<% if values["titlepage"] %>
<% if custom_titlepage %>
<%= custom_titlepage %>
<% else %>
\begin{titlepage}
<% if values["coverimage"] %>
\begin{center}
%%%\mbox{}\vskip5\zw%
\includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{./images/<%= values["coverimage"] %>}
\end{center}
\clearpage
<% end %>
\thispagestyle{empty}
\begin{center}%
\mbox{} \vskip5\zw
\reviewtitlefont%
{\Huge <%= values["booktitle"] %> \par}%
\vskip 15em%
{\huge
\lineskip .75em
\begin{tabular}[t]{c}%
<%= authors %>
\end{tabular}\par}%
\vfill
{\large <%= values["date"] %> <%= I18n.t("edition")%>\hspace{2\zw}<%= I18n.t("published_by", values["prt"])%>\par}%
\vskip4\zw\mbox{}
\end{center}%
\end{titlepage}
<% end %>
<% end %>
\renewcommand{\chaptermark}[1]{{}}
\frontmatter
%%% originaltitle
<% if values["originaltitlefile"] %>
<%= custom_originaltitlepage %>
<% end %>
%%% credit
<% if values["creditfile"] %>
<%= custom_creditpage %>
<% end %>
%% preface
<%= values["pre_str"] %>
<% if values["toc"] %>
\setcounter{tocdepth}{<%= values["toclevel"] %>}
\tableofcontents
<% end %>
\renewcommand{\chaptermark}[1]{\markboth{\prechaptername\thechapter\postchaptername~#1}{}}
\mainmatter
<%= values["chap_str"] %>
\renewcommand{\chaptermark}[1]{\markboth{\appendixname\thechapter~#1}{}}
\reviewappendix
<%= values["appendix_str"] %>
%% backmatter begins
<% if values["post_str"] or values["colophon"] %>
\backmatter
<% end %>
<% if values["post_str"] %>
<%= values["post_str"] %>
<% end %>
%%% profile
<% if values["profile"] %>
<%= custom_profilepage %>
<% end %>
%%% advfile
<% if values["advfile"] %>
<%= custom_advfilepage %>
<% end %>
%%% colophon
<% if values["colophon"] %>
<% if custom_colophonpage %>
<%= custom_colophonpage %>
<% else %>
%% okuduke
\reviewcolophon
\thispagestyle{empty}
\vspace*{\fill}
{\noindent\reviewtitlefont\Large <%= values["booktitle"] %>} \\
\rule[8pt]{14cm}{1pt} \\
{\noindent
<%= values["pubhistory"].to_s.gsub(/\n/){"\n\n\\noindent"} %>
}
\begin{tabular}{ll}
<%= okuduke %>
\end{tabular}
 \\
\rule[0pt]{14cm}{1pt} \\
<%= values["rights"] %> \\
<% end %>
<% end %>
%%% backcover
<% if values["backcover"] %>
<%= custom_backcoverpage %>
<% end %>
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment