Skip to content

Instantly share code, notes, and snippets.

@74th
Created August 27, 2017 09:25
Show Gist options
  • Save 74th/b7a38b03f35a8d522968a092a90380a2 to your computer and use it in GitHub Desktop.
Save 74th/b7a38b03f35a8d522968a092a90380a2 to your computer and use it in GitHub Desktop.
Re:VIEW A5
%% ここに書いたほうが、headerがきれい
%% http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=773
%% http://cns-guide.sfc.keio.ac.jp/2001/11/5/1.html
%% 用紙サイズ
\setlength{\paperheight} {210 truemm}
\setlength{\paperwidth} {148 truemm}
%% 縦レイアウト
%% ヘッダまでの幅
\setlength{\topmargin} {3 truemm}
%% ヘッダサイズ?
\setlength{\headheight} {10 truemm}
%% ヘッダとテキストまでの幅
\setlength{\headsep} {4 truemm}
%% テキスト部のサイズ
\setlength{\textheight} {177 truemm}
%% 横レイアウト
%% 奇数ページの左余白
\setlength{\oddsidemargin} {8 truemm}
%% 偶数ページの左余白
\setlength{\evensidemargin} {8 truemm}
%% テキスト部の幅
\setlength{\textwidth} {130 truemm}
%% 傍注の幅の指定
\setlength{\marginparwidth} {15 truemm}
%% 本文と傍注の間の幅の指定
\setlength{\marginparsep} {2 truemm}
\usepackage[most]{tcolorbox}
\tcbuselibrary{breakable}
\renewenvironment{shaded}{
\vspace{\baselineskip}
\begin{tcolorbox}[breakable, enhanced jigsaw, colback=black!10!white, colframe=black!30!white]}
{\end{tcolorbox}}
\renewenvironment{shadedb}{
\vspace{\baselineskip}
\begin{tcolorbox}[breakable, enhanced jigsaw, colback=black!80!white, colframe=black, colupper=white, sharp corners, rounded corners=southeast]}
{\end{tcolorbox}}
%% サンプルコードを更に小さく
\renewenvironment{reviewemlist}{%
\medskip\footnotesize\begin{shaded}\setlength{\baselineskip}{1.2zw}\begin{alltt}}{%
\end{alltt}\end{shaded}}
\renewenvironment{reviewlist}{%
\begin{shaded}\footnotesize\setlength{\baselineskip}{1.2zw}\begin{alltt}}{%
\end{alltt}\end{shaded}\par\vspace*{0.5zw}}
\renewenvironment{reviewcmd}{%
\color{white}\medskip\footnotesize\begin{shadedb}\setlength{\baselineskip}{1.2zw}\begin{alltt}}{%
\end{alltt}\end{shadedb}}
%% from review-pdfmaker
\usepackage{fancyhdr}
\usepackage{ulem}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[LE]{\gtfamily\sffamily\bfseries\upshape \leftmark}
\fancyhead[RO]{\gtfamily\sffamily\bfseries\upshape \rightmark}
\cfoot{\thepage}
\renewcommand{\sectionmark}[1]{\markright{\thesection~#1}{}}
\renewcommand{\chaptermark}[1]{%
\if@mainmatter
\markboth{\prechaptername\ \thechapter\ \postchaptername~#1}{}
\else
\markboth{#1}{#1}
\fi}
\renewcommand{\headfont}{\gtfamily\sffamily\bfseries}
\renewcommand{\reviewtitlefont}{\gtfamily\sffamily\bfseries}
\fancypagestyle{plainhead}{%
\fancyhead{}
\fancyfoot{} % clear all header and footer fields
\fancyfoot[CE,CO]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}
\hypersetup{colorlinks=false}
%%Helveticaを使う
\renewcommand{\sfdefault}{phv}
\sloppy
\cfoot{\thepage}
\def\cleardoublepage{%
\clearpage%
\if@twoside%
\ifodd \c@page \else \hbox{}\thispagestyle{plainhead}\newpage%
\if@twocolumn\hbox{}\thispagestyle{plainhead}\newpage\fi%
\fi%
\fi%
}
%% \setlength{\paperheight} {257 truemm}
%% \setlength{\paperwidth} {182 truemm}
%% \setlength{\textheight} {190 truemm}
%% \setlength{\textwidth} {130 truemm}
%% \setlength{\textwidth} {130 truemm}
%% \setlength{\marginparwidth} {15 truemm}
%% \setlength{\oddsidemargin} {26 truemm}
%% \setlength{\evensidemargin} {26 truemm}
%% \setlength{\topmargin} {10 truemm}
%% \setlength{\headsep} {15 truemm}
\setlength{\hoffset}{-1in}
\setlength{\voffset}{-1in}
\renewcommand{\baselinestretch}{0.96}
\usepackage{fancyvrb}
\VerbatimFootnotes
\usepackage{seqsplit}
\let\textttorg=\texttt
\def\texttt{\begingroup\obeyspaces\do@texttt}
\def\do@texttt#1{\textttorg{\seqsplit{#1\relax}}\endgroup}
%% \newcommand{\captionsize}{\fontsize{9}{9}\selectfont}
\let\captionsize\relax\newcommand{\captionsize}{\fontsize{9}{9}\selectfont}
\newlength{\captionnumwidth}
\setlength{\captionnumwidth}{6zw}
%% \newlength{\captionwidth}
\let\captionwidth\relax\newlength{\captionwidth}
\setlength{\captionwidth}{\textwidth}
\addtolength{\captionwidth}{-\captionnumwidth}
\def\captionhead{\sffamily{\color{black!30!white}{▲}}}
\long\def\@makecaption#1#2{%
\addvspace\abovecaptionskip
\buildcaption{!}{#1}{#2}
\vskip\belowcaptionskip
}
\long\def\buildcaption#1#2#3{%
\sbox\@tempboxa{\captionsize\sffamily #3}%
\ifdim \wd\@tempboxa <\captionwidth%
\def\capline{\captionsize\captionhead #2%
\hskip1zw\relax\usebox{\@tempboxa}\mbox{}\relax}
\ifx#1!\relax\centerline{\capline}\else\noindent\capline\fi
\else
\noindent%
\parbox[t]{\captionnumwidth}{%
{\captionsize\captionhead #2%
\hskip1zw}}%
\parbox[t]{\captionwidth}{\captionsize\sffamily #3}
\fi
}
\long\def\listcaption#1:#2\relax{\buildcaption{}{#1}{#2}}
\renewcommand{\reviewtablecaption}[1]{%
{\def\captionhead{\sffamily{\color{black!30!white}{▼}}}
\caption{#1}}}
\renewcommand{\reviewlistcaption}[1]{%
{\def\captionhead{\sffamily{\color{black!30!white}{▼}}}
\medskip{\listcaption#1\relax}\vspace*{-1.3zw}}}
\renewcommand{\reviewemlistcaption}[1]{%
{\def\captionhead{\sffamily{\color{black!30!white}{▼}}}
\medskip{\buildcaption{}{}{#1}\relax}\vspace*{-1.3zw}}}
\renewcommand{\reviewcmdcaption}[1]{%
{\def\captionhead{\sffamily{\color{black!30!white}{▼}}}
\medskip{\listcaption#1\relax}\vspace*{-1.3zw}}}
\renewcommand{\reviewindepimagecaption}[1]{%
\begin{center}#1\end{center}}
\renewcommand{\reviewboxcaption}[1]{%
{\def\captionhead{\sffamily{\color{black!30!white}{▼}}}
\medskip{\captionsize\captionhead #1}\vspace*{-1.3zw}}}
\renewenvironment{reviewcolumn}{%
\vspace{\baselineskip}
\begin{tcolorbox}[colback=white]
}{%
\end{tcolorbox}
\vspace{\baselineskip}
}
\renewcommand{\reviewcolumnhead}[2]{%
{\noindent\large\sffamily #2}
\vspace{\baselineskip}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment