Skip to content

Instantly share code, notes, and snippets.

@Nymphium
Last active October 29, 2018 05:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nymphium/cf2385fc322c1c4c31d602bfa89a00cb to your computer and use it in GitHub Desktop.
Save Nymphium/cf2385fc322c1c4c31d602bfa89a00cb to your computer and use it in GitHub Desktop.
`latexmk -lualatex main.tex`
@misc{myblog,
title={lilyum ensemble},
author={nymphium},
howpublished={\url{http://nymphium.github.io/}},
url={\url{http://nymphium.github.io/}},
note={accessed: 2018-03-04}
}
\documentclass[unicode,compress,20pt,CJK,final,mathserif,t]{beamer}
%%% [[[
%%% beamerposter basics [[[
\usepackage[orientation=portrait,size=a0,scale=1.4]{beamerposter}
\usepackage{xcolor}
\usepackage{xhfill}
\usepackage{luacode}
\usepackage[normalem,normalbf]{ulem}
\geometry{
left=5pt,
right=5pt,
bottom=0pt
}
\begin{luacode*}
subauthors = setmetatable({}, {
__tostring = function(self)
return table.concat(self, " ")
end})
\end{luacode*}
\newcommand{\belonging}[1]{\def\insertbelonging{#1}}
\newcommand{\addauthor}[1]{%
\directlua{table.insert(subauthors, \asluastring{#1})}}
\definecolor{borderblue}{HTML}{5596DB}
\definecolor{bordergreen}{HTML}{2E8755}
\makeatletter
\renewcommand{\author}{\@dblarg\beamer@author}
\long\def\beamer@author[#1]#2{%
\def\@firstauthor{#1}}
\renewcommand{\title}{\@dblarg\beamer@title}%
\long\def\beamer@title[#1]#2{%
\def\thetitle{#1}
\def\inserttitle{#2}%
\def\beamer@shorttitle{#1}}%
\setbeamertemplate{headline}{%
\setlength{\parskip}{.4\zh}
\begin{beamercolorbox}[ht=4.5\zh,rightskip=5pt,leftskip=5pt]{headline}
\xhrulefill{bordergreen!70}{.21\zh}\newline
\xhrulefill{bordergreen!50}{.14\zh}\newline
\xhrulefill{borderblue}{.42\zh}\newline
\end{beamercolorbox}
}
\defbeamertemplate*{title page}{customized}[1][]{
\def\insertauthor{\@firstauthor,\directlua{tex.print(subauthors)}}
\begin{center}
\vskip-2\zh
\huge{}\textbf{\inserttitle}
\vskip-1\zh
\end{center}
\setlength{\parskip}{.1\zh}
{\Large\hfill \uline{\@firstauthor} \directlua{tex.print(subauthors)} (\insertbelonging\relax)}\rule{.8\zw}{0pt}\newline
\xhrulefill{borderblue}{.21\zh}\\[-.5\zh]
\xhrulefill{bordergreen!50}{.14\zh}
\vskip.3\baselineskip
}
\makeatother
\setbeamertemplate{footline}{%
\begin{beamercolorbox}[ht=0pt,dp=0pt,rightskip=5pt,leftskip=5pt]{footline}
\setlength{\parskip}{.4\zh}
\xhrulefill{borderblue}{.42\zh}\newline
\xhrulefill{bordergreen!50}{.14\zh}\newline
\xhrulefill{bordergreen!70}{.21\zh}\newline
\end{beamercolorbox}}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{bibliography item}{\color{black}\insertbiblabel}
\setbeamertemplate{bibliography entry title}{}
\setbeamertemplate{bibliography entry location}{}
\setbeamertemplate{bibliography entry note}{}
\setbeamercolor*{bibliography entry title}{fg=black}
\setbeamercolor*{bibliography entry item}{fg=black}
\setbeamercolor*{bibliography entry author}{fg=black}
\setbeamercolor*{bibliography entry location}{fg=black}
\setbeamercolor*{bibliography entry note}{fg=black}
%%% ]]]
%%% font settings [[[
\usepackage[no-math]{luatexja-fontspec}
\setsansfont[Script=Default,Kerning=On,BoldFont=GenShinGothic-Bold,ItalicFont=NotoSansDisplay-LightItalic]{GenShinGothic-Light}
\setmainjfont[%
Script=Default,%
Kerning=On,%
CharacterWidth=AlternateProportional,%
BoldFont=GenShinGothic-P-Bold,%
YokoFeatures={JFM=prop}]{GenShinGothic-P-Light}
\setmonofont[Kerning=Reset]{Inconsolata}
\newfontfamily\Symbola{Symbola}
%%% ]]]
\usepackage{url}
\usepackage[most]{tcolorbox}
\newtcolorbox{somecolorbox}[2]{
title=#2,
enhanced,
colback=white,
colframe=#1,
boxrule=0.06\zw,
right skip=0pt,
left skip=0pt,
boxsep=0.2\zw,
top=0pt,
bottom=0pt,
enlarge bottom by = .3\baselineskip,
sharp corners}
\newenvironment{bluebox}[1]{\begin{somecolorbox}{blue}{#1}}{\end{somecolorbox}}
\newenvironment{greenbox}[1]{\begin{somecolorbox}{green!50}{#1}}{\end{somecolorbox}}
\newenvironment{redbox}[1]{\begin{somecolorbox}{red!50!}{#1}}{\end{somecolorbox}}
\usepackage{fontawesome}
\definecolor{theyellow}{HTML}{FFDF62}
\newcommand{\cautionmark}{{\large\textcolor{theyellow}{$\blacktriangle$}}\hspace{-.55\zw}{\scriptsize\faicon{exclamation}}\kern.6\zw}
\usepackage{tikz}
\usepackage{listings}
\lstset{
basicstyle=\ttfamily
}
\title{ぼくのかんがえたさいきょうの研究}
\author{最強太郎}
\addauthor{教員太郎丸}
\addauthor{教員次郎丸}
\belonging{激ヤバ大学}
%%% ]]]
\begin{document}
\begin{frame}[allowframebreaks,fragile]{}
\maketitle
\begin{somecolorbox}{gray}{ポスター感を出す}
なんかよく分からんけど洒落っ気を出すために\verb|xhfill|で色の着いた線をタイトル下およびページの上下に引いた。
main author、その他でmain authorに下線を引きたいので色々ハックした。
\verb|\author|コマンドにはmain author、\verb|\addauthor|コマンドにはその他を渡す。後者は追加したい人間の数だけ書く。
残念なことにhyperrefのauthorにパラメーターをうまく渡せていない。
なんとかしたい。
\verb|\belonging|で所属を書け。
あと\verb|\maketitle|は\verb|frame|環境の中に書かなければならない。
これは罠感があるがどうすればええんや…。
\begin{lstlisting}[title=main.tex,xleftmargin=22\zw,xrightmargin=22\zw,frame=lrtb]
......
\author{最強太郎} % main author
\addauthor{教員太郎丸} % sub author 1
\addauthor{教員次郎丸} % sub author 2
\belonging{激ヤバ大学}
\begin{document}
\begin{frame}[fragile]{}
\maketitle
......
\end{lstlisting}
\verb|\geometry|でギリギリまで空白を減らしている。
\verb|beamer|クラスは\verb|geometry|パッケージを最初からrequireしているので\verb|\usepackage|では新たに呼ぶ必要はない。
\end{somecolorbox}
\begin{minipage}[t]{.49\textwidth}
\begin{somecolorbox}{green!30!blue!70}{エッ!?}
\cautionmark ヤバい
このオシャカワcolorboxは\verb|tcolorbox|パッケージをもちいている。
\end{somecolorbox}
\end{minipage}
\begin{minipage}[t]{.01\textwidth}\hfill\end{minipage}
\begin{minipage}[t]{.49\textwidth}
\begin{somecolorbox}{purple!50}{あとはやっていき}
\verb|minipage|環境を使いまくるしかない
\end{somecolorbox}
\end{minipage}
\begin{greenbox}{\textcolor{blue!80}{絵文字は結構直感的でウケがよい}}
伝えたいことを1つの記号で表したり好意的な話\faicon{hand-o-right} かそうでないかをハンドサインや顔文字\faicon{smile-o}で表せる {\color{red}\huge\Symbola 👺 }
\begin{center}
\begin{minipage}[t]{.4\textwidth}
\begin{somecolorbox}{blue!50!red!30}{方法1}
\begin{enumerate}
\item まず\textrm{Lua\LaTeX} を用意します
\item \verb|luatexja-fontspec|パッケージを使う
\item Symbolaを使う: \verb|\newfontfamily\Symbola{Symbola}|
\item \url{http://getemoji.com/}からコピペして
\item \verb|{\Symbola (コピペした絵文字)}|
\end{enumerate}
\end{somecolorbox}
\end{minipage}
\hspace{.01\textwidth}
\begin{minipage}[t]{.4\textwidth}
\begin{somecolorbox}{red!50!blue!30}{方法2}
\begin{enumerate}
\item \verb|fontawesome|パッケージを使う
\verb|fontawesome|には企業アイコンとか入ってるので\faicon{amazon}\faicon{google}\faicon{twitter}\faicon{github-square}そういうのを使いたいときに便利
\end{enumerate}
\end{somecolorbox}
\end{minipage}
\end{center}
方法1、2はそれぞれ独立しているので、両方使うことはもちろん可能。
ただしカラー絵文字は非対応のため、今回は\verb|xcolor|パッケージで色を一色着けている。
Slackなどで絵文字を駆使した遊びが役立ってよかった{\color{red}\Symbola 💮}
\end{greenbox}
\begin{somecolorbox}{blue!50}{\textrm{\LaTeX} で書くことの意義}
はっきりとはわからん、けど人はつい書いてしまう
\end{somecolorbox}
もちろん\verb|frame|環境の下にダイレクトに書いても問題ない。
\begin{somecolorbox}{blue!40!green!90!}{空白}
\rule{0pt}{20\zh}
\end{somecolorbox}
\vfill
参考文献も適当な枠で囲むとそれっぽさが出る。
\begin{somecolorbox}{red!30}{参考文献}
\nocite{*}
\bibliographystyle{jplain}
\bibliography{main.bib}
\end{somecolorbox}
\end{frame}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment