├── 2008 ├── 2008problem.txt └── 2008answer.tex ├── 2009 ├── 2009problem.txt └── 2009answer.tex ├── 2010 ├── 2010problem.txt └── 2010answer.tex ├── 2011 ├── 2011problem.txt └── 2011answer.tex ├── 2012 ├── 2012problem.txt └── 2012answer.tex ├── 2013 ├── 2013problem.txt └── 2013answer.tex ├── 2014 ├── 2014problem.txt └── 2014answer.tex ├── 2015 ├── 2015problem.txt └── 2015answer.tex ├── 2016 ├── 2016problem.txt ├── figure1.jpg └── 2016answer.tex ├── 2017 ├── 2017problem.txt └── 2017answer.tex ├── 2018 ├── 2018problem.txt └── 2018answer.tex ├── 2019 ├── 2019problem.txt └── 2019answer.tex ├── 2020 ├── 2020problem.txt └── 2020answer.tex ├── years.txt ├── latexrc.pl ├── compile.sh ├── .github ├── actions │ └── latex │ │ ├── Dockerfile │ │ └── entrypoint.sh └── workflows │ ├── release.yml │ └── develop.yml ├── templates └── answer.tex ├── README.md ├── .gitignore └── plistings.sty /2020/2020problem.txt: -------------------------------------------------------------------------------- 1 | https://www.i.u-tokyo.ac.jp/visitor/files/2020math_je.pdf -------------------------------------------------------------------------------- /2008/2008problem.txt: -------------------------------------------------------------------------------- 1 | https://www.i.u-tokyo.ac.jp/edu/entra/pdf/archive/08math-j.pdf -------------------------------------------------------------------------------- /2009/2009problem.txt: -------------------------------------------------------------------------------- 1 | https://www.i.u-tokyo.ac.jp/edu/entra/pdf/archive/09math-j.pdf -------------------------------------------------------------------------------- /2010/2010problem.txt: -------------------------------------------------------------------------------- 1 | https://www.i.u-tokyo.ac.jp/edu/entra/pdf/archive/10math-j.pdf -------------------------------------------------------------------------------- /2011/2011problem.txt: -------------------------------------------------------------------------------- 1 | https://www.i.u-tokyo.ac.jp/edu/entra/pdf/archive/11math-j.pdf -------------------------------------------------------------------------------- /2012/2012problem.txt: -------------------------------------------------------------------------------- 1 | https://www.i.u-tokyo.ac.jp/edu/entra/pdf/archive/12math-j.pdf -------------------------------------------------------------------------------- /2013/2013problem.txt: -------------------------------------------------------------------------------- 1 | https://www.i.u-tokyo.ac.jp/edu/entra/pdf/archive/13math-j.pdf -------------------------------------------------------------------------------- /2014/2014problem.txt: -------------------------------------------------------------------------------- 1 | https://www.i.u-tokyo.ac.jp/edu/entra/pdf/archive/14math-j.pdf -------------------------------------------------------------------------------- /2015/2015problem.txt: -------------------------------------------------------------------------------- 1 | https://www.i.u-tokyo.ac.jp/common/file/edu/entra/15math_j.pdf -------------------------------------------------------------------------------- /2016/2016problem.txt: -------------------------------------------------------------------------------- 1 | https://www.i.u-tokyo.ac.jp/common/file/edu/entra/16math_j.pdf -------------------------------------------------------------------------------- /2017/2017problem.txt: -------------------------------------------------------------------------------- 1 | https://www.i.u-tokyo.ac.jp/common/file/edu/entra/17math_j.pdf -------------------------------------------------------------------------------- /2018/2018problem.txt: -------------------------------------------------------------------------------- 1 | https://www.i.u-tokyo.ac.jp/common/file/edu/entra/18math_j.pdf -------------------------------------------------------------------------------- /2019/2019problem.txt: -------------------------------------------------------------------------------- 1 | https://www.i.u-tokyo.ac.jp/common/file/edu/entra/19math_j.pdf -------------------------------------------------------------------------------- /2016/figure1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mqcmd196/utokyo_ist_math/HEAD/2016/figure1.jpg -------------------------------------------------------------------------------- /years.txt: -------------------------------------------------------------------------------- 1 | 2008 2 | 2009 3 | 2010 4 | 2011 5 | 2012 6 | 2013 7 | 2014 8 | 2015 9 | 2016 10 | 2017 11 | 2018 12 | 2019 13 | 2020 14 | -------------------------------------------------------------------------------- /latexrc.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | $latex="uplatex %O -synctex=1 -interaction=nonstopmode -file-line-error %S"; 4 | $max_repeat = 5; 5 | $bibtex="upbibtex %O %B"; 6 | $biber="biber %O --bblencoding=utf8 -u -U --output_safechars %B"; 7 | $makeindex="upmendex %O -o %D %S"; 8 | $dvipdf="dvipdfmx %O -o %D %S"; 9 | $pdf_mode = 3; -------------------------------------------------------------------------------- /compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | FILES=(`find -name "*answer.tex"`) 4 | for file in "${FILES[@]}" ; do 5 | latexmk -pdfdvi ${file} -outdir=${file%/*} -r latexrc.pl 6 | # rm generated files without .pdf 7 | rm ${file%.*}.aux 8 | rm ${file%.*}.dvi 9 | rm ${file%.*}.fdb_latexmk 10 | rm ${file%.*}.fls 11 | # rm ${file%.*}.log 12 | rm ${file%.*}.synctex.gz 13 | done -------------------------------------------------------------------------------- /.github/actions/latex/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | RUN apt-get update \ 4 | && apt-get install -y --no-install-recommends \ 5 | curl \ 6 | python3 \ 7 | latexmk \ 8 | lmodern \ 9 | texlive \ 10 | texlive-latex-extra \ 11 | texlive-lang-japanese \ 12 | && rm -rf /var/lib/apt/lists/* 13 | 14 | RUN mktexlsr && mkdir -p /app 15 | WORKDIR /app 16 | 17 | ADD entrypoint.sh /entrypoint.sh 18 | ENTRYPOINT ["/entrypoint.sh"] -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | on: 3 | push: 4 | branches: 5 | - master 6 | jobs: 7 | build: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout master branch 11 | uses: actions/checkout@master 12 | - name: Build the TeX files and release the PDF files 13 | uses: ./.github/actions/latex 14 | env: 15 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 16 | GITHUB_WORKFLOW: $GITHUB_WORKFLOW -------------------------------------------------------------------------------- /.github/workflows/develop.yml: -------------------------------------------------------------------------------- 1 | name: develop 2 | on: 3 | pull_request: 4 | branches: 5 | - master 6 | - develop 7 | push: 8 | branches: 9 | - develop 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout develop branch 15 | uses: actions/checkout@v2 16 | with: 17 | ref: develop 18 | - name: Build the TeX files 19 | uses: ./.github/actions/latex 20 | env: 21 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 22 | GITHUB_WORKFLOW: $GITHUB_WORKFLOW -------------------------------------------------------------------------------- /2008/2008answer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[uplatex]{jsarticle} 2 | \usepackage{listings, plistings, amsfonts, bm, amsmath, amssymb} 3 | \lstset{ 4 | basicstyle={\ttfamily}, 5 | identifierstyle={\small}, 6 | commentstyle={\smallitshape}, 7 | keywordstyle={\small\bfseries}, 8 | ndkeywordstyle={\small}, 9 | stringstyle={\small\ttfamily}, 10 | frame={tb}, 11 | breaklines=true, 12 | columns=[l]{fullflexible}, 13 | numbers=left, 14 | xrightmargin=0zw, 15 | xleftmargin=3zw, 16 | numberstyle={\scriptsize}, 17 | stepnumber=1, 18 | numbersep=1zw, 19 | lineskip=-0.5ex, 20 | } 21 | 22 | \title{XXXX年 解答} 23 | \begin{document} 24 | \section*{問題n} 25 | 26 | \end{document} -------------------------------------------------------------------------------- /2009/2009answer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[uplatex]{jsarticle} 2 | \usepackage{listings, plistings, amsfonts, bm, amsmath, amssymb} 3 | \lstset{ 4 | basicstyle={\ttfamily}, 5 | identifierstyle={\small}, 6 | commentstyle={\smallitshape}, 7 | keywordstyle={\small\bfseries}, 8 | ndkeywordstyle={\small}, 9 | stringstyle={\small\ttfamily}, 10 | frame={tb}, 11 | breaklines=true, 12 | columns=[l]{fullflexible}, 13 | numbers=left, 14 | xrightmargin=0zw, 15 | xleftmargin=3zw, 16 | numberstyle={\scriptsize}, 17 | stepnumber=1, 18 | numbersep=1zw, 19 | lineskip=-0.5ex, 20 | } 21 | 22 | \title{XXXX年 解答} 23 | \begin{document} 24 | \section*{問題n} 25 | 26 | \end{document} -------------------------------------------------------------------------------- /2010/2010answer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[uplatex]{jsarticle} 2 | \usepackage{listings, plistings, amsfonts, bm, amsmath, amssymb} 3 | \lstset{ 4 | basicstyle={\ttfamily}, 5 | identifierstyle={\small}, 6 | commentstyle={\smallitshape}, 7 | keywordstyle={\small\bfseries}, 8 | ndkeywordstyle={\small}, 9 | stringstyle={\small\ttfamily}, 10 | frame={tb}, 11 | breaklines=true, 12 | columns=[l]{fullflexible}, 13 | numbers=left, 14 | xrightmargin=0zw, 15 | xleftmargin=3zw, 16 | numberstyle={\scriptsize}, 17 | stepnumber=1, 18 | numbersep=1zw, 19 | lineskip=-0.5ex, 20 | } 21 | 22 | \title{XXXX年 解答} 23 | \begin{document} 24 | \section*{問題n} 25 | 26 | \end{document} -------------------------------------------------------------------------------- /2011/2011answer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[uplatex]{jsarticle} 2 | \usepackage{listings, plistings, amsfonts, bm, amsmath, amssymb} 3 | \lstset{ 4 | basicstyle={\ttfamily}, 5 | identifierstyle={\small}, 6 | commentstyle={\smallitshape}, 7 | keywordstyle={\small\bfseries}, 8 | ndkeywordstyle={\small}, 9 | stringstyle={\small\ttfamily}, 10 | frame={tb}, 11 | breaklines=true, 12 | columns=[l]{fullflexible}, 13 | numbers=left, 14 | xrightmargin=0zw, 15 | xleftmargin=3zw, 16 | numberstyle={\scriptsize}, 17 | stepnumber=1, 18 | numbersep=1zw, 19 | lineskip=-0.5ex, 20 | } 21 | 22 | \title{XXXX年 解答} 23 | \begin{document} 24 | \section*{問題n} 25 | 26 | \end{document} -------------------------------------------------------------------------------- /2012/2012answer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[uplatex]{jsarticle} 2 | \usepackage{listings, plistings, amsfonts, bm, amsmath, amssymb} 3 | \lstset{ 4 | basicstyle={\ttfamily}, 5 | identifierstyle={\small}, 6 | commentstyle={\smallitshape}, 7 | keywordstyle={\small\bfseries}, 8 | ndkeywordstyle={\small}, 9 | stringstyle={\small\ttfamily}, 10 | frame={tb}, 11 | breaklines=true, 12 | columns=[l]{fullflexible}, 13 | numbers=left, 14 | xrightmargin=0zw, 15 | xleftmargin=3zw, 16 | numberstyle={\scriptsize}, 17 | stepnumber=1, 18 | numbersep=1zw, 19 | lineskip=-0.5ex, 20 | } 21 | 22 | \title{XXXX年 解答} 23 | \begin{document} 24 | \section*{問題n} 25 | 26 | \end{document} -------------------------------------------------------------------------------- /2013/2013answer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[uplatex]{jsarticle} 2 | \usepackage{listings, plistings, amsfonts, bm, amsmath, amssymb} 3 | \lstset{ 4 | basicstyle={\ttfamily}, 5 | identifierstyle={\small}, 6 | commentstyle={\smallitshape}, 7 | keywordstyle={\small\bfseries}, 8 | ndkeywordstyle={\small}, 9 | stringstyle={\small\ttfamily}, 10 | frame={tb}, 11 | breaklines=true, 12 | columns=[l]{fullflexible}, 13 | numbers=left, 14 | xrightmargin=0zw, 15 | xleftmargin=3zw, 16 | numberstyle={\scriptsize}, 17 | stepnumber=1, 18 | numbersep=1zw, 19 | lineskip=-0.5ex, 20 | } 21 | 22 | \title{XXXX年 解答} 23 | \begin{document} 24 | \section*{問題n} 25 | 26 | \end{document} -------------------------------------------------------------------------------- /2014/2014answer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[uplatex]{jsarticle} 2 | \usepackage{listings, plistings, amsfonts, bm, amsmath, amssymb} 3 | \lstset{ 4 | basicstyle={\ttfamily}, 5 | identifierstyle={\small}, 6 | commentstyle={\smallitshape}, 7 | keywordstyle={\small\bfseries}, 8 | ndkeywordstyle={\small}, 9 | stringstyle={\small\ttfamily}, 10 | frame={tb}, 11 | breaklines=true, 12 | columns=[l]{fullflexible}, 13 | numbers=left, 14 | xrightmargin=0zw, 15 | xleftmargin=3zw, 16 | numberstyle={\scriptsize}, 17 | stepnumber=1, 18 | numbersep=1zw, 19 | lineskip=-0.5ex, 20 | } 21 | 22 | \title{XXXX年 解答} 23 | \begin{document} 24 | \section*{問題n} 25 | 26 | \end{document} -------------------------------------------------------------------------------- /2015/2015answer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[uplatex]{jsarticle} 2 | \usepackage{listings, plistings, amsfonts, bm, amsmath, amssymb} 3 | \lstset{ 4 | basicstyle={\ttfamily}, 5 | identifierstyle={\small}, 6 | commentstyle={\smallitshape}, 7 | keywordstyle={\small\bfseries}, 8 | ndkeywordstyle={\small}, 9 | stringstyle={\small\ttfamily}, 10 | frame={tb}, 11 | breaklines=true, 12 | columns=[l]{fullflexible}, 13 | numbers=left, 14 | xrightmargin=0zw, 15 | xleftmargin=3zw, 16 | numberstyle={\scriptsize}, 17 | stepnumber=1, 18 | numbersep=1zw, 19 | lineskip=-0.5ex, 20 | } 21 | 22 | \title{XXXX年 解答} 23 | \begin{document} 24 | \section*{問題n} 25 | 26 | \end{document} -------------------------------------------------------------------------------- /2017/2017answer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[uplatex]{jsarticle} 2 | \usepackage{listings, plistings, amsfonts, bm, amsmath, amssymb} 3 | \lstset{ 4 | basicstyle={\ttfamily}, 5 | identifierstyle={\small}, 6 | commentstyle={\smallitshape}, 7 | keywordstyle={\small\bfseries}, 8 | ndkeywordstyle={\small}, 9 | stringstyle={\small\ttfamily}, 10 | frame={tb}, 11 | breaklines=true, 12 | columns=[l]{fullflexible}, 13 | numbers=left, 14 | xrightmargin=0zw, 15 | xleftmargin=3zw, 16 | numberstyle={\scriptsize}, 17 | stepnumber=1, 18 | numbersep=1zw, 19 | lineskip=-0.5ex, 20 | } 21 | 22 | \title{XXXX年 解答} 23 | \begin{document} 24 | \section*{問題n} 25 | 26 | \end{document} -------------------------------------------------------------------------------- /2018/2018answer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[uplatex]{jsarticle} 2 | \usepackage{listings, plistings, amsfonts, bm, amsmath, amssymb} 3 | \lstset{ 4 | basicstyle={\ttfamily}, 5 | identifierstyle={\small}, 6 | commentstyle={\smallitshape}, 7 | keywordstyle={\small\bfseries}, 8 | ndkeywordstyle={\small}, 9 | stringstyle={\small\ttfamily}, 10 | frame={tb}, 11 | breaklines=true, 12 | columns=[l]{fullflexible}, 13 | numbers=left, 14 | xrightmargin=0zw, 15 | xleftmargin=3zw, 16 | numberstyle={\scriptsize}, 17 | stepnumber=1, 18 | numbersep=1zw, 19 | lineskip=-0.5ex, 20 | } 21 | 22 | \title{XXXX年 解答} 23 | \begin{document} 24 | \section*{問題n} 25 | 26 | \end{document} -------------------------------------------------------------------------------- /2019/2019answer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[uplatex]{jsarticle} 2 | \usepackage{listings, plistings, amsfonts, bm, amsmath, amssymb} 3 | \lstset{ 4 | basicstyle={\ttfamily}, 5 | identifierstyle={\small}, 6 | commentstyle={\smallitshape}, 7 | keywordstyle={\small\bfseries}, 8 | ndkeywordstyle={\small}, 9 | stringstyle={\small\ttfamily}, 10 | frame={tb}, 11 | breaklines=true, 12 | columns=[l]{fullflexible}, 13 | numbers=left, 14 | xrightmargin=0zw, 15 | xleftmargin=3zw, 16 | numberstyle={\scriptsize}, 17 | stepnumber=1, 18 | numbersep=1zw, 19 | lineskip=-0.5ex, 20 | } 21 | 22 | \title{XXXX年 解答} 23 | \begin{document} 24 | \section*{問題n} 25 | 26 | \end{document} -------------------------------------------------------------------------------- /2020/2020answer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[uplatex]{jsarticle} 2 | \usepackage{listings, plistings, amsfonts, bm, amsmath, amssymb} 3 | \lstset{ 4 | basicstyle={\ttfamily}, 5 | identifierstyle={\small}, 6 | commentstyle={\smallitshape}, 7 | keywordstyle={\small\bfseries}, 8 | ndkeywordstyle={\small}, 9 | stringstyle={\small\ttfamily}, 10 | frame={tb}, 11 | breaklines=true, 12 | columns=[l]{fullflexible}, 13 | numbers=left, 14 | xrightmargin=0zw, 15 | xleftmargin=3zw, 16 | numberstyle={\scriptsize}, 17 | stepnumber=1, 18 | numbersep=1zw, 19 | lineskip=-0.5ex, 20 | } 21 | 22 | \title{XXXX年 解答} 23 | \begin{document} 24 | \section*{問題n} 25 | 26 | \end{document} -------------------------------------------------------------------------------- /templates/answer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[uplatex]{jsarticle} 2 | \usepackage{listings, plistings, amsfonts, bm, amsmath, amssymb} 3 | \lstset{ 4 | basicstyle={\ttfamily}, 5 | identifierstyle={\small}, 6 | commentstyle={\smallitshape}, 7 | keywordstyle={\small\bfseries}, 8 | ndkeywordstyle={\small}, 9 | stringstyle={\small\ttfamily}, 10 | frame={tb}, 11 | breaklines=true, 12 | columns=[l]{fullflexible}, 13 | numbers=left, 14 | xrightmargin=0zw, 15 | xleftmargin=3zw, 16 | numberstyle={\scriptsize}, 17 | stepnumber=1, 18 | numbersep=1zw, 19 | lineskip=-0.5ex, 20 | } 21 | 22 | \title{XXXX年 解答} 23 | \begin{document} 24 | \section*{問題n} 25 | 26 | \end{document} -------------------------------------------------------------------------------- /.github/actions/latex/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eux 3 | 4 | # set var 5 | USER=mqcmd196 6 | REPO=utokyo_ist_math 7 | 8 | # set year 9 | YEARS=(`cat years.txt|xargs`) 10 | 11 | # compile TeX files 12 | for year in "${YEARS[@]}" ; do 13 | latexmk -pdfdvi ${year}/${year}answer.tex -outdir=${year} -r latexrc.pl 14 | done 15 | 16 | # If the master branch is updated, the CI executes the below. 17 | if [ $GITHUB_WORKFLOW = "release" ]; then 18 | # create release 19 | res=`curl -H "Authorization: token $GITHUB_TOKEN" -X POST https://api.github.com/repos/$USER/$REPO/releases \ 20 | -d " 21 | { 22 | \"tag_name\": \"v$GITHUB_SHA\", 23 | \"target_commitish\": \"$GITHUB_SHA\", 24 | \"name\": \"v$GITHUB_SHA\", 25 | \"draft\": false, 26 | \"prerelease\": false 27 | }"` 28 | 29 | # extract release id 30 | rel_id=`echo ${res} | python3 -c 'import json,sys;print(json.load(sys.stdin)["id"])'` 31 | 32 | # upload built pdf 33 | for year in "${YEARS[@]}" ; do 34 | FILE_NAME=${year}answer.pdf 35 | curl -H "Authorization: token $GITHUB_TOKEN" -X POST https://uploads.github.com/repos/$USER/$REPO/releases/${rel_id}/assets?name=$FILE_NAME\ 36 | --header 'Content-Type: application/pdf'\ 37 | --upload-file ${year}/${FILE_NAME} 38 | done 39 | fi -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 東京大学情報理工学系研究科数学過去問議論用リポジトリ 2 | 3 | #### build status 4 | ![release](https://github.com/mqcmd196/utokyo_ist_math/workflows/release/badge.svg) 5 | ![develop](https://github.com/mqcmd196/utokyo_ist_math/workflows/develop/badge.svg) 6 | 7 | ## 概要 8 | 本リポジトリは,有志の方々によって情報理工学系研究科の数学の過去問の解答を議論することを目的としています.協力していただける方は,issueやpull requestを積極的に活用して,解答の議論をしていただけると助かります. 9 | 10 | ## PDFのリンク 11 | https://github.com/mqcmd196/utokyo_ist_math/releases/latest 12 | 13 | ## 仕組み 14 | 各年のフォルダにはその年の問題のURL`problem.txt`及び解答のTeXファイル`answer.tex`が格納されています.masterブランチのTeXファイルの変更があると,GitHubのActionが走ってTeXファイルがPDFにコンパイルされreleaseとしてアップロードされます.各自のPCでcloneして閲覧したい場合は,`compile.sh`を実行することで各年の`answer.pdf`が生成されます. 15 | 16 | ```bash 17 | cd utokyo_ist_math 18 | ./compile.sh 19 | ``` 20 | 21 | なおこれを実行するにはuplatex,latexmkなどが動作する環境が必要です.詳しくは[こちら](https://github.com/mqcmd196/utokyo_ist_math/blob/master/.github/actions/latex/Dockerfile)のDockerFileの`apt-get install`でインストールされている箇所を参照してください.個人のPCでTeX環境を構築するのが面倒な方は,OverleafやCloud LaTeXなどをお使いください. 22 | 23 | ## 貢献していただける方へ 24 | 25 | ### Issue 26 | 誤りや別解等を発見したが,GitHubの操作に慣れていないという方は,[Issuesというタブ](https://github.com/mqcmd196/utokyo_ist_math/issues)を開いていただき,そちらにNew issueとしてスレッドを作成してください. 27 | 28 | ### Pull request 29 | GitHubの操作に慣れていて,かつ誤りや別解,バグを発見された方は,本リポジトリをforkしていただき,本リポジトリのdevelopブランチへのPull requestをお願いいたします.developブランチへのPull requestが確認されると,CIがTeXファイルのビルドを行い,結果(コンパイルができたかどうかのみ)を表示します.ビルド結果及び解答の内容から,メンテナがdevelopブランチにマージします.なおdefaultのブランチはreleaseされるmasterではなくdevelopです. 30 | 31 | ## おことわり 32 | 本リポジトリに上がっている解答は,必ずしも正しいとは限りません.間違っていた場合の責任は負いかねます.また間違いを見つけた場合には,issueにてその旨を報告していただくか,pull requestにて修正をしていただけると助かります. 33 | **なお著作権の都合上,問題PDFは掲載しておりません.** 代わりに情報理工学系研究科より公開されている過去問のURLを掲載しています.このURLのリンクは予告なく切れる場合があります. 34 | CIも開発途中ですので,うまい仕組みがあればぜひ教えてください. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Core latex/pdflatex auxiliary files: 2 | *.aux 3 | *.lof 4 | *.log 5 | *.lot 6 | *.fls 7 | *.out 8 | *.toc 9 | *.fmt 10 | *.fot 11 | *.cb 12 | *.cb2 13 | .*.lb 14 | 15 | ## Intermediate documents: 16 | *.dvi 17 | *.xdv 18 | *-converted-to.* 19 | # these rules might exclude image files for figures etc. 20 | # *.ps 21 | # *.eps 22 | # *.pdf 23 | 24 | ## Generated if empty string is given at "Please type another file name for output:" 25 | .pdf 26 | 27 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 28 | *.bbl 29 | *.bcf 30 | *.blg 31 | *-blx.aux 32 | *-blx.bib 33 | *.run.xml 34 | 35 | ## Build tool auxiliary files: 36 | *.fdb_latexmk 37 | *.synctex 38 | *.synctex(busy) 39 | *.synctex.gz 40 | *.synctex.gz(busy) 41 | *.pdfsync 42 | 43 | ## Build tool directories for auxiliary files 44 | # latexrun 45 | latex.out/ 46 | 47 | ## Auxiliary and intermediate files from other packages: 48 | # algorithms 49 | *.alg 50 | *.loa 51 | 52 | # achemso 53 | acs-*.bib 54 | 55 | # amsthm 56 | *.thm 57 | 58 | # beamer 59 | *.nav 60 | *.pre 61 | *.snm 62 | *.vrb 63 | 64 | # changes 65 | *.soc 66 | 67 | # comment 68 | *.cut 69 | 70 | # cprotect 71 | *.cpt 72 | 73 | # elsarticle (documentclass of Elsevier journals) 74 | *.spl 75 | 76 | # endnotes 77 | *.ent 78 | 79 | # fixme 80 | *.lox 81 | 82 | # feynmf/feynmp 83 | *.mf 84 | *.mp 85 | *.t[1-9] 86 | *.t[1-9][0-9] 87 | *.tfm 88 | 89 | #(r)(e)ledmac/(r)(e)ledpar 90 | *.end 91 | *.?end 92 | *.[1-9] 93 | *.[1-9][0-9] 94 | *.[1-9][0-9][0-9] 95 | *.[1-9]R 96 | *.[1-9][0-9]R 97 | *.[1-9][0-9][0-9]R 98 | *.eledsec[1-9] 99 | *.eledsec[1-9]R 100 | *.eledsec[1-9][0-9] 101 | *.eledsec[1-9][0-9]R 102 | *.eledsec[1-9][0-9][0-9] 103 | *.eledsec[1-9][0-9][0-9]R 104 | 105 | # glossaries 106 | *.acn 107 | *.acr 108 | *.glg 109 | *.glo 110 | *.gls 111 | *.glsdefs 112 | *.lzo 113 | *.lzs 114 | 115 | # uncomment this for glossaries-extra (will ignore makeindex's style files!) 116 | # *.ist 117 | 118 | # gnuplottex 119 | *-gnuplottex-* 120 | 121 | # gregoriotex 122 | *.gaux 123 | *.gtex 124 | 125 | # htlatex 126 | *.4ct 127 | *.4tc 128 | *.idv 129 | *.lg 130 | *.trc 131 | *.xref 132 | 133 | # hyperref 134 | *.brf 135 | 136 | # knitr 137 | *-concordance.tex 138 | # TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files 139 | # *.tikz 140 | *-tikzDictionary 141 | 142 | # listings 143 | *.lol 144 | 145 | # luatexja-ruby 146 | *.ltjruby 147 | 148 | # makeidx 149 | *.idx 150 | *.ilg 151 | *.ind 152 | 153 | # minitoc 154 | *.maf 155 | *.mlf 156 | *.mlt 157 | *.mtc[0-9]* 158 | *.slf[0-9]* 159 | *.slt[0-9]* 160 | *.stc[0-9]* 161 | 162 | # minted 163 | _minted* 164 | *.pyg 165 | 166 | # morewrites 167 | *.mw 168 | 169 | # nomencl 170 | *.nlg 171 | *.nlo 172 | *.nls 173 | 174 | # pax 175 | *.pax 176 | 177 | # pdfpcnotes 178 | *.pdfpc 179 | 180 | # sagetex 181 | *.sagetex.sage 182 | *.sagetex.py 183 | *.sagetex.scmd 184 | 185 | # scrwfile 186 | *.wrt 187 | 188 | # sympy 189 | *.sout 190 | *.sympy 191 | sympy-plots-for-*.tex/ 192 | 193 | # pdfcomment 194 | *.upa 195 | *.upb 196 | 197 | # pythontex 198 | *.pytxcode 199 | pythontex-files-*/ 200 | 201 | # tcolorbox 202 | *.listing 203 | 204 | # thmtools 205 | *.loe 206 | 207 | # TikZ & PGF 208 | *.dpth 209 | *.md5 210 | *.auxlock 211 | 212 | # todonotes 213 | *.tdo 214 | 215 | # vhistory 216 | *.hst 217 | *.ver 218 | 219 | # easy-todo 220 | *.lod 221 | 222 | # xcolor 223 | *.xcp 224 | 225 | # xmpincl 226 | *.xmpi 227 | 228 | # xindy 229 | *.xdy 230 | 231 | # xypic precompiled matrices and outlines 232 | *.xyc 233 | *.xyd 234 | 235 | # endfloat 236 | *.ttt 237 | *.fff 238 | 239 | # Latexian 240 | TSWLatexianTemp* 241 | 242 | ## Editors: 243 | # WinEdt 244 | *.bak 245 | *.sav 246 | 247 | # Texpad 248 | .texpadtmp 249 | 250 | # LyX 251 | *.lyx~ 252 | 253 | # Kile 254 | *.backup 255 | 256 | # gummi 257 | .*.swp 258 | 259 | # KBibTeX 260 | *~[0-9]* 261 | 262 | # TeXnicCenter 263 | *.tps 264 | 265 | # auto folder when using emacs and auctex 266 | ./auto/* 267 | *.el 268 | 269 | # expex forward references with \gathertags 270 | *-tags.tex 271 | 272 | # standalone packages 273 | *.sta 274 | 275 | # Makeindex log files 276 | *.lpz 277 | 278 | # xwatermark package 279 | *.xwm 280 | 281 | # REVTeX puts footnotes in the bibliography by default, unless the nofootinbib 282 | # option is specified. Footnotes are the stored in a file with suffix Notes.bib. 283 | # Uncomment the next line to have this generated file ignored. 284 | #*Notes.bib 285 | 286 | # ignore compiled pdf 287 | *answer.pdf 288 | 289 | # dir .sty 290 | */plistings.sty -------------------------------------------------------------------------------- /2016/2016answer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[uplatex]{jsarticle} 2 | \usepackage{listings, plistings, amsfonts, bm, amsmath, amssymb} 3 | \usepackage[dvipdfmx]{graphicx} 4 | \lstset{ 5 | basicstyle={\ttfamily}, 6 | identifierstyle={\small}, 7 | commentstyle={\smallitshape}, 8 | keywordstyle={\small\bfseries}, 9 | ndkeywordstyle={\small}, 10 | stringstyle={\small\ttfamily}, 11 | frame={tb}, 12 | breaklines=true, 13 | columns=[l]{fullflexible}, 14 | numbers=left, 15 | xrightmargin=0zw, 16 | xleftmargin=3zw, 17 | numberstyle={\scriptsize}, 18 | stepnumber=1, 19 | numbersep=1zw, 20 | lineskip=-0.5ex, 21 | } 22 | \parindent = 0pt 23 | 24 | \title{2016年 解答} 25 | \begin{document} 26 | \section*{第1問} 27 | \subsection*{(1)} 28 | 29 | $ 30 | A = 31 | \begin{pmatrix} 32 | 1 & 1 & 1 \\ 33 | 1 & 0 & 0 \\ 34 | 0 & 1 & 0 \\ 35 | \end{pmatrix} $ 36 | 37 | \subsection*{(2)} 38 | 行基本変形を行うと, 39 | $ 40 | \begin{pmatrix} 41 | 1 & 1 & 1 \\ 42 | 1 & 0 & 0 \\ 43 | 0 & 1 & 0 \\ 44 | \end{pmatrix} 45 | \rightarrow\begin{pmatrix} 46 | 1 & 1 & 1 \\ 47 | 0 & -1 & -1 \\ 48 | 0 & 1 & 0 \\ 49 | \end{pmatrix} 50 | \rightarrow\begin{pmatrix} 51 | 1 & 1 & 1 \\ 52 | 0 & -1 & -1 \\ 53 | 0 & 0 & -1 \\ 54 | \end{pmatrix} 55 | $ 56 | となるので,\underline{$rank(A) = 3$}. .\\ 57 | $E$を単位行列,$\lambda$を固有値とすると$|A-\lambda E| = 0$を満たし,これを計算することにより,\underline{$\lambda^3 - \lambda^2 - \lambda - 1 = 0$}を得る. 58 | 59 | \subsection*{(3)} 60 | $A^\prime = A-\lambda E = 61 | \begin{pmatrix} 62 | 1-\lambda & 1 & 1 \\ 63 | 1 & -\lambda & 0 \\ 64 | 0 & 1 & -\lambda \\ 65 | \end{pmatrix} 66 | $ 67 | とおく.$A^\prime$において,行基本変形を行うと, 68 | $ 69 | \begin{pmatrix}, 70 | 0 & 1+\lambda(1-\lambda) & 1 \\ 71 | 1 & -\lambda & 0 \\ 72 | 0 & 1 & -\lambda \\ 73 | \end{pmatrix} 74 | \rightarrow 75 | \begin{pmatrix} 76 | 1 & -\lambda & 0 \\ 77 | 0 & 1+\lambda(1-\lambda) & 1 \\ 78 | 0 & 1 & -\lambda \\ 79 | \end{pmatrix} 80 | \rightarrow 81 | \begin{pmatrix} 82 | 1 & -\lambda & 0 \\ 83 | 0 & 1+\lambda(1-\lambda) & 1 \\ 84 | 0 & 1+\lambda+\lambda(1-\lambda) & 0 \\ 85 | \end{pmatrix} 86 | $ 87 | となる.\\ 88 | よって,固有値$\lambda_k,(k=1, 2, 3)$に対応する固有ベクトルを$\begin{pmatrix}x_k & y_k & z_k\end{pmatrix}^T$とおくと, 89 | $$ 90 | \begin{cases} 91 | x_k - \lambda y_k = 0 \\ 92 | (1 + \lambda - \lambda^2)y_k + z_k = 0 93 | \end{cases} 94 | $$ 95 | を満たすので,固有ベクトルの1つは 96 | \underline{ 97 | $ 98 | \begin{pmatrix}\lambda_k & 1 & \lambda_k^2-\lambda_k-1\end{pmatrix}^T 99 | $ 100 | } 101 | となる. 102 | 103 | \subsection*{(4)} 104 | $f(\lambda) = \lambda^3 - \lambda^2 - \lambda - 1$とおく.\\ 105 | $f^\prime(\lambda) = 3\lambda^2-2\lambda-1 = (\lambda-1)(3\lambda-1)$.\\ 106 | 以上より,増減表は以下のようになる. 107 | \begin{table}[htb] 108 | \begin{tabular}{|c|c c c c c|}\hline 109 | $\lambda$ & ... & $-\frac{1}{3}$ & ... & 1 & ... \\ \hline 110 | $f^\prime$ & + & 極大 & - & 極小 & + \\ \hline 111 | $f$ & $\nearrow$ & $-\frac{22}{27}$ & $\searrow$ & $-2$ & $\nearrow$ \\ \hline 112 | \end{tabular} 113 | \end{table} 114 | \\ 115 | よってグラフは \\ 116 | \includegraphics[width=50mm]{figure1.jpg} 117 | となり,$\lambda$軸との交点はただ1つで,かつその交点$\lambda_1$は$1<\lambda_1<2$なので,題意は示された.(証明終) 118 | 119 | \subsection*{(5)} 120 | 行列$A$は,正方行列 121 | $P= 122 | \begin{pmatrix} 123 | \lambda_1 & \lambda_2 & \lambda_3 \\ 124 | 1 & 1 & 1 \\ 125 | \lambda_1^2-\lambda_1-1 & \lambda_2^2-\lambda_2-1 & \lambda_3^2-\lambda_3-1 \\ 126 | \end{pmatrix} 127 | $ 128 | を用いて,\\ 129 | $P^{-1}AP = 130 | \begin{pmatrix} 131 | \lambda_1 & 0 & 0 \\ 132 | 0 & \lambda_2 & 0 \\ 133 | 0 & 0 & \lambda_3 \\ 134 | \end{pmatrix} 135 | $ 136 | と対角化できる. 137 | よって, 138 | $\begin{pmatrix} 139 | \lambda_1^n & 0 & 0 \\ 140 | 0 & \lambda_2^n & 0 \\ 141 | 0 & 0 & \lambda_3^n \\ 142 | \end{pmatrix} 143 | =P^{-1}A^nP$が成り立ち, 144 | $ 145 | A^n= 146 | P 147 | \begin{pmatrix} 148 | \lambda_1^n & 0 & 0 \\ 149 | 0 & \lambda_2^n & 0 \\ 150 | 0 & 0 & \lambda_3^n \\ 151 | \end{pmatrix} 152 | P^{-1} 153 | $が成り立つ.\\ 154 | また,(1.1)より, 155 | $$ 156 | \begin{pmatrix} 157 | T_{n+2} \\ 158 | T_{n+1} \\ 159 | T_{n} \\ 160 | \end{pmatrix} 161 | = A^n 162 | \begin{pmatrix} 163 | T_2 \\ 164 | T_1 \\ 165 | T_0 \\ 166 | \end{pmatrix} 167 | = 168 | \begin{pmatrix} 169 | \lambda_1 & \lambda_2 & \lambda_3 \\ 170 | 1 & 1 & 1 \\ 171 | \lambda_1^2-\lambda_1-1 & \lambda_2^2-\lambda_2-1 & \lambda_3^2-\lambda_3-1 \\ 172 | \end{pmatrix} 173 | \begin{pmatrix} 174 | \lambda_1^n & 0 & 0 \\ 175 | 0 & \lambda_2^n & 0 \\ 176 | 0 & 0 & \lambda_3^n \\ 177 | \end{pmatrix} 178 | P^{-1} 179 | \begin{pmatrix} 180 | 1 \\ 181 | 0 \\ 182 | 0 \\ 183 | \end{pmatrix} 184 | $$ 185 | と表せるので,$T_n$は$\lambda_k^n$の1次結合として表せる.(証明終) 186 | 187 | \subsection*{(6)} 188 | 189 | 190 | \end{document} -------------------------------------------------------------------------------- /plistings.sty: -------------------------------------------------------------------------------- 1 | % 2 | % plistings.sty 3 | % 4 | % lltjp-listings.sty ベース,コード未整理 5 | 6 | \NeedsTeXFormat{LaTeX2e} 7 | \ProvidesPackage{plistings}[2019/03/31 v0.12 Japanese support of listings package] 8 | 9 | %%%%%%%% Package options 10 | \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{listings}} 11 | \ProcessOptions\relax 12 | \RequirePackage{listings,etoolbox} 13 | 14 | %%%%%%%% Japanese support 15 | %% whether letter-space in a fixed mode box is doubled or not 16 | \newif\if@ltj@lst@double 17 | \lst@Key{doubleletterspace}f[t]{\lstKV@SetIf{#1}\if@ltj@lst@double} 18 | 19 | % override \lst@FillFixed@ 20 | \def\lst@FillFixed@#1{% 21 | \ifx\@empty#1\else\ltj@lst@hss#1\expandafter\lst@FillFixed@\fi} 22 | \def\ltj@lst@hss@double{\lst@hss\lst@hss} 23 | 24 | % 最下層の処理 25 | \newif\if@ltj@lst@kanji 26 | \lst@AddToHook{InitVars}{\@ltj@lst@kanjifalse} 27 | 28 | \def\lst@AppendLetter{% 29 | \ltj@lst@setletterflag\lst@Append} 30 | \def\lst@AppendOther{% 31 | \lst@ifletter\lst@Output\lst@letterfalse\fi\@ltj@lst@kanjifalse 32 | \futurelet\lst@lastother\lst@Append} 33 | 34 | \def\ltj@lst@setletterflag{% 35 | \lst@ifletter 36 | \if@ltj@lst@kanji\lst@Output\@ltj@lst@kanjifalse\fi 37 | \else 38 | \lst@lettertrue\if@ltj@lst@kanji\@ltj@lst@kanjifalse\else\lst@OutputOther\fi 39 | \fi} 40 | 41 | \def\ltj@lst@setkanjiflag{% 42 | \lst@ifletter 43 | \lst@Output 44 | \else 45 | \if@ltj@lst@kanji\else\lst@OutputOther\fi\lst@lettertrue 46 | \fi\@ltj@lst@kanjitrue} 47 | 48 | \def\ltj@lst@setopenflag{% 49 | \lst@ifletter 50 | \lst@letterfalse\lst@Output 51 | \else 52 | \if@ltj@lst@kanji\else\lst@OutputOther\fi 53 | \fi\@ltj@lst@kanjitrue} 54 | 55 | \def\ltj@lst@setcloseflag{% 56 | \lst@ifletter\else\lst@lettertrue\fi\@ltj@lst@kanjitrue} 57 | 58 | %%%% 和文文字の出力命令. 59 | %%%% 和文文字の前にこれが前置されることになる. 60 | \def\ltj@lst@ProcessJALetter#1{% 61 | \lst@whitespacefalse 62 | \ifnum`#1>255 63 | \ifnum\postbreakpenalty`#1>0 64 | \ltj@lst@setopenflag % 開き括弧類 65 | \else 66 | \ifnum\prebreakpenalty`#1>0 67 | \ltj@lst@setcloseflag % 閉じ括弧類,句読点 68 | \else 69 | \ltj@lst@setkanjiflag % 通常の和文文字 70 | \fi\fi 71 | \advance\lst@length\@ne % 和文文字は通常の2倍の幅 72 | \else 73 | \ltj@lst@setletterflag 74 | \fi 75 | \lst@Append#1} 76 | 77 | 78 | %%%% \lst@InsideConvert の処理内容変更 79 | %%%% active 文字化に加え,^^@ を和文文字の前に前置 80 | \def\ltj@lst@MakeActive#1{% 81 | \let\lst@temp\@empty \ltj@lst@MakeActive@#1\relax} 82 | \begingroup 83 | \catcode`\^^A=\active 84 | \catcode`\^^@=\active 85 | \lowercase{% 86 | \gdef\ltj@lst@MakeActive@#1{\let\lst@next\relax% 87 | \ifx#1\relax 88 | \else\let\lst@next\ltj@lst@MakeActive@ 89 | \ifnum`#1>255 90 | \lst@lAddTo\lst@temp{^^@#1}% 91 | \else 92 | \lccode`\^^A=`#1 93 | \lowercase{\lst@lAddTo\lst@temp{^^A}}% 94 | \fi\fi\lst@next}} 95 | \endgroup 96 | \begingroup \lccode`\~=`\ \relax \lowercase{% 97 | \gdef\lst@InsideConvert@#1 #2{% 98 | \ltj@lst@MakeActive{#1}% 99 | \ifx\@empty#2% 100 | \lst@lExtend\lst@arg{\lst@temp}% 101 | \else 102 | \lst@lExtend\lst@arg{\lst@temp~}% 103 | \expandafter\lst@InsideConvert@ 104 | \fi #2} 105 | }\endgroup 106 | 107 | 108 | %%%%%%%% \lstinline の再定義. 109 | %%%% 引数を全部読み込み,\lst@InsideConvert で変換 110 | \renewcommand\lstinline[1][]{% 111 | \leavevmode\bgroup % \hbox\bgroup --> \bgroup 112 | \def\lst@boxpos{b}% 113 | \lsthk@PreSet\lstset{flexiblecolumns,#1}% 114 | \lsthk@TextStyle 115 | \@ifnextchar\bgroup \ltj@lst@InlineG \ltj@lstinline@} 116 | \def\ltj@lstinline@#1{% 117 | \edef\ltj@lst@temp{\the\catcode`#1}\lst@Init\relax\catcode`#1\ltj@lst@temp 118 | \lst@Def{13}{\lst@DeInit\egroup \global\let\lst@inlinechars\@empty 119 | \PackageError{Listings}{lstinline ended by EOL}\@ehc}% 120 | \lst@InlineJ#1} 121 | \def\ltj@lst@InlineG{% 122 | \lst@Init\relax\edef\ltj@lst@temp{\the\catcode`\}}% 123 | \catcode`\}=2 \catcode`\ =12\relax 124 | \lst@Def{13}{\lst@DeInit\egroup \global\let\lst@inlinechars\@empty 125 | \PackageError{Listings}{lstinline ended by EOL}\@ehc}% 126 | \let\lst@arg\@empty\afterassignment\ltj@lst@InlineG@@\@temptokena} 127 | \def\ltj@lst@InlineG@@{% 128 | \catcode`\}=\ltj@lst@temp 129 | \expandafter\expandafter\expandafter\lst@InsideConvert% 130 | \expandafter{\the\@temptokena}\lst@arg\lst@DeInit\egroup} 131 | 132 | %%%%%%%% \lstenv@process の再定義 133 | %%%% 基本的にはインライン時と同様に全トークンを読み込み→\lst@InsideConvert で変換 134 | %%%% その後,変換した中身は \scantokens で読み込み直される 135 | \begingroup \lccode`\~=`\^^M\lowercase{% 136 | \gdef\lstenv@Process#1{% 137 | \ifx~#1% 138 | \lstenv@DroppedWarning \let\lst@next\ltj@lstenv@ProcessM 139 | \else\ifx^^J#1% 140 | \lstenv@DroppedWarning \let\lst@next\lstenv@ProcessJ 141 | \else 142 | \let\lst@dropped#1\let\lst@next\lstenv@Process 143 | \fi \fi 144 | \lst@next} 145 | }\endgroup 146 | \begingroup\lccode`\[=`\{\lccode`\]=`\}\lccode`|=`\\\lowercase{% 147 | \gdef\ltj@lstenv@ProcessM{% 148 | \let\lst@arg\@empty 149 | \edef\lst@temp{|end[\lstenv@name]}% 150 | \expandafter\expandafter\expandafter\lst@InsideConvert% 151 | \expandafter{\lst@temp}% 152 | \@temptokena{% 153 | \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter 154 | \lst@SkipToFirst\expandafter\expandafter\expandafter\scantokens\expandafter{\lst@arg}% 155 | } 156 | \expandafter\expandafter\expandafter\toks@\expandafter{\lst@arg} 157 | \expandafter\edef\expandafter\lst@temp\expandafter##\expandafter1\lst@arg 158 | {% 159 | \noexpand\let\noexpand\lst@arg\noexpand\@empty% 160 | \noexpand\lst@InsideConvert{\noexpand##1} 161 | \the\@temptokena 162 | \noexpand\ifnum\noexpand\catcode92=\noexpand\z@ 163 | \noexpand\end{\lstenv@name}% 164 | \noexpand\else\the\toks@\noexpand\fi\tracingnone 165 | }% 166 | \lst@temp} 167 | }\endgroup 168 | 169 | \def\lst@BeginDropInput#1{% 170 | \lst@EnterMode{#1}% 171 | {\lst@modetrue 172 | \let\lst@OutputBox\@gobble 173 | \let\lst@ifdropinput\iftrue 174 | \let\lst@ProcessLetter\@gobble 175 | \let\lst@ProcessDigit\@gobble 176 | \let\lst@ProcessOther\@gobble 177 | \let\lst@ProcessSpace\@empty 178 | \let\lst@ProcessTabulator\@empty 179 | \let\lst@ProcessFormFeed\@empty 180 | \let\ltj@lst@ProcessJALetter\@gobble % added 181 | }} 182 | 183 | 184 | %%%% ^^@ を active 文字化 (\ltj@lst@ProcessJALetter) 185 | \begingroup\catcode`\^^@=\active 186 | \lst@AddTo\lst@SelectStdCharTable{\def^^@{\ltj@lst@ProcessJALetter}} 187 | \endgroup 188 | \lst@AddToHook{InitVars}{% 189 | \catcode`\^^@=\active 190 | \if@ltj@lst@double 191 | \let\ltj@lst@hss=\ltj@lst@hss@double 192 | \else 193 | \let\ltj@lst@hss=\lst@hss 194 | \fi 195 | } 196 | 197 | %%%% 白線対策のため,\lineskiplimit を負の値にする 198 | \newif\ifltj@lst@frame@top 199 | \newdimen\ltj@lst@frame@lslimit 200 | \gdef\lst@frameInit{% 201 | \ltj@lst@frame@toptrue 202 | \ifx\lst@framelshape\@empty \let\lst@frameL\@empty \fi 203 | \ifx\lst@framershape\@empty \let\lst@frameR\@empty \fi 204 | \def\lst@framevrule{\vrule\@width\lst@framerulewidth\relax}% 205 | \lst@ifframeround 206 | \lst@frameCalcDimA\z@ \@getcirc\@tempdima 207 | \@tempdimb\@tempdima \divide\@tempdimb\tw@ 208 | \advance\@tempdimb -\@wholewidth 209 | \edef\lst@frametextsep{\the\@tempdimb}% 210 | \edef\lst@framerulewidth{\the\@wholewidth}% 211 | \lst@frameCalcDimA\@ne \@getcirc\@tempdima 212 | \@tempdimb\@tempdima \divide\@tempdimb\tw@ 213 | \advance\@tempdimb -\tw@\@wholewidth 214 | \advance\@tempdimb -\lst@frametextsep 215 | \edef\lst@rulesep{\the\@tempdimb}% 216 | \fi 217 | \lst@frameMakeBoxV\lst@framebox{\ht\strutbox}{\dp\strutbox}% 218 | %%%% ここから 219 | \@tempdima\z@ 220 | \ifdim\ht\strutbox<\cht\@tempdima=\dimexpr\cht-\ht\strutbox\relax\fi 221 | \ifdim\dp\strutbox<\cdp\advance\@tempdima=\dimexpr\cdp-\dp\strutbox\relax\fi 222 | \ltj@lst@frame@lslimit=-\@tempdima 223 | \def\lst@framelr{% 224 | \ifltj@lst@frame@top\ltj@lst@frame@topfalse\else\lineskiplimit\ltj@lst@frame@lslimit\fi 225 | \copy\lst@framebox}% 226 | %%%% ここまで 227 | \ifx\lst@frametshape\@empty\else 228 | \lst@frameH T\lst@frametshape 229 | \ifvoid\z@\else 230 | \par\lst@parshape 231 | \@tempdima-\baselineskip \advance\@tempdima\ht\z@ 232 | \ifdim\prevdepth<\@cclvi\p@\else 233 | \advance\@tempdima\prevdepth 234 | \fi 235 | \ifdim\@tempdima<\z@ 236 | \vskip\@tempdima\vskip\lineskip 237 | \fi 238 | \noindent\box\z@\par 239 | \lineskiplimit\maxdimen \lineskip\z@ 240 | \fi 241 | \lst@frameSpreadV\lst@framextopmargin 242 | \fi} 243 | 244 | % lstinputlisting 245 | % modified from jlisting.sty 246 | \def\lst@InputListing#1{% 247 | \begingroup 248 | \lsthk@PreSet \gdef\lst@intname{#1}% 249 | \expandafter\lstset\expandafter{\lst@set}% 250 | \lsthk@DisplayStyle 251 | \catcode\active=\active 252 | \lst@Init\relax \let\lst@gobble\z@ 253 | \lst@SkipToFirst 254 | \lst@ifprint \def\lst@next{\lst@get@filecontents{#1}}% 255 | \else \let\lst@next\@empty 256 | \fi 257 | \lst@next 258 | \lst@DeInit 259 | \endgroup} 260 | \newread\lst@inputfile 261 | \def\lst@get@filecontents#1{% 262 | \let\lst@filecontents\@empty 263 | \openin\lst@inputfile=#1\relax 264 | \let\@lst@get@filecontents@prevline\relax 265 | \lst@get@filecontents@loop 266 | \closein\lst@inputfile 267 | \lst@filecontents\empty} 268 | \def\lst@get@filecontents@loop{% 269 | \read\lst@inputfile to\lst@temp 270 | \let\lst@arg\@empty\expandafter\expandafter\expandafter\lst@InsideConvert\expandafter{\lst@temp}% 271 | \ifx\@lst@get@filecontents@prevline\relax\else 272 | \expandafter\expandafter\expandafter\def 273 | \expandafter\expandafter\expandafter\lst@filecontents 274 | \expandafter\expandafter\expandafter{% 275 | \expandafter\lst@filecontents\@lst@get@filecontents@prevline}% 276 | \fi 277 | \let\@lst@get@filecontents@prevline\lst@arg 278 | \ifeof\lst@inputfile\else 279 | \expandafter\lst@get@filecontents@loop 280 | \fi} 281 | 282 | %%%%%%%% escape to \LaTeX 283 | %%%% 一旦中身を全部取得した後で,^^@ ( = \ltj@lst@ProcessJALetter) を 284 | %%%% トークン列から削除,その後 \scantokens で再読み込み 285 | \lstloadaspects{escape} 286 | \gdef\lst@Escape#1#2#3#4{% 287 | \lst@CArgX #1\relax\lst@CDefX 288 | {}% 289 | {\lst@ifdropinput\else 290 | \lst@TrackNewLines\lst@OutputLostSpace \lst@XPrintToken 291 | \lst@InterruptModes 292 | \lst@EnterMode{\lst@TeXmode}{\lst@modetrue}% 293 | \ifx\^^M#2% 294 | \lst@CArg #2\relax\lst@ActiveCDefX 295 | {}% 296 | {\lst@escapeend #4\lst@LeaveAllModes\lst@ReenterModes}% 297 | {\ltj@lst@MProcessListing}% 298 | \else 299 | \lst@CArg #2\relax\lst@ActiveCDefX 300 | {}% 301 | {\lst@escapeend #4\lst@LeaveAllModes\lst@ReenterModes 302 | \lst@newlines\z@ \lst@whitespacefalse}% 303 | {}% 304 | \fi% 305 | \ltj@lst@escape@setup#2% 306 | #3\lst@escapebegin\expandafter\lst@next% 307 | \fi}% 308 | {}} 309 | \gdef\ltj@empty@grp{{}} 310 | \gdef\ltj@lst@escape@setup#1{% 311 | \begingroup\lccode`\~=`#1\lowercase{% 312 | \gdef\lst@next##1~{% 313 | \let\lst@arg\@empty\ltj@lst@remove@jacmd{##1}% 314 | \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter 315 | \scantokens\expandafter\expandafter\expandafter{\expandafter\ltj@empty@grp\lst@arg\empty}% 316 | ~}% 317 | }\endgroup 318 | } 319 | 320 | \begingroup 321 | \catcode`\^^@=12 % 322 | \gdef\ltj@lst@remove@jacmd#1{% 323 | \expandafter\ltj@lst@remove@jacmd@\detokenize{#1}^^@\@nil^^@} 324 | \gdef\ltj@lst@remove@jacmd@#1^^@{% 325 | \ifx#1\@nil\else 326 | \lst@lAddTo\lst@arg{#1}% 327 | \expandafter\ltj@lst@remove@jacmd@ 328 | \fi} 329 | \endgroup 330 | 331 | %%%%%%%%%%%%%%%% texcl 332 | {\lccode`\~=`\%\lccode`\|=`\^^M \catcode`\|=13\relax 333 | \lowercase{% 334 | \gdef\plst@texcl@comment#1|{}% 335 | \gdef\plst@texcl@setchar{\catcode`\%=\active \let~\plst@texcl@comment}% 336 | }% 337 | } 338 | \lst@AddToHook{AfterBeginComment}{ 339 | \ifnum\lst@mode=\lst@TeXLmode 340 | \catcode`\^^M=13\relax \catcode`\^^@=9\relax\plst@texcl@setchar 341 | \fi} 342 | 343 | 344 | %%%%%%%%%%%%%%%% \lstMakeShortInline 345 | \patchcmd\lstMakeShortInline@{\lst@shortinlinedef#1}{\lst@shortinlinedef~}{}{} 346 | 347 | \endinput 348 | --------------------------------------------------------------------------------