Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Paperist/texlive-ja
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: wsuzume/docker-alpine-texlive
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
Loading
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.zip
*.dvi
*.pdf
*.log
*.out
*.aux
*.toc

*.DS_Store
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (c) 2016 Kaito Udagawa
# Copyright (c) 2016-2020 3846masa
# Copyright (c) 2021 wsuzume
# Released under the MIT license
# https://opensource.org/licenses/MIT

@@ -27,6 +28,35 @@ RUN apk add --no-cache curl perl fontconfig-dev freetype-dev && \
rm -fr /tmp/install-tl-unx && \
apk del .fetch-deps

# for additional modules
ARG TEXMFLOCAL=/usr/local/texlive/texmf-local/tex/latex
WORKDIR /workspace

## pseudo code modules
RUN wget http://captain.kanpaku.jp/LaTeX/jlisting.zip \
&& unzip jlisting.zip \
&& mkdir -p ${TEXMFLOCAL}/listings \
&& cp jlisting/jlisting.sty ${TEXMFLOCAL}/listings

RUN wget http://mirrors.ctan.org/macros/latex/contrib/algorithms.zip \
&& unzip algorithms.zip \
&& cd algorithms \
&& latex algorithms.ins \
&& mkdir -p ${TEXMFLOCAL}/algorithms \
&& cp *.sty ${TEXMFLOCAL}/algorithms

RUN wget http://mirrors.ctan.org/macros/latex/contrib/algorithmicx.zip \
&& unzip algorithmicx.zip \
&& mkdir -p ${TEXMFLOCAL}/algorithmicx \
&& cp algorithmicx/*.sty ${TEXMFLOCAL}/algorithmicx

RUN chmod -R 777 /usr/local/texlive

# relax exported file permission
ARG UID=1000
RUN adduser -D -u ${UID} latex
USER ${UID}

WORKDIR /workdir

CMD ["sh"]
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)
Copyright (c) 2016 Kaito Udagawa
Copyright (c) 2016-2018 3846masa
Copyright (c) 2021 wsuzume

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
48 changes: 48 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
USERNAME=wsuzume
SOURCE=Dockerfile
IMAGE=${USERNAME}/alpine-texlive:latest
CONTAINER=alpine-texlive

ifeq ($(OS),Windows_NT)
PWD=$(CURDIR)
endif

# build container image
.PHONY: build
build: Dockerfile
docker image build -f ${SOURCE} -t ${IMAGE} .

# pull image
.PHONY: pull
pull:
docker pull wsuzume/alpine-texlive:latest

# create new container and login to the shell
.PHONY: shell
shell:
docker container run -it --rm -v ${PWD}/workdir:/workdir ${IMAGE}

# clean up all stopped containers
.PHONY: clean
clean:
docker container prune

# delete all image
.PHONY: doomsday
doomsday:
docker image rm -f `docker image ls -q`



# sample
## target file is workdir/${XXDIR}/${XXMAIN}.tex
SAMPLEDIR=sample
SAMPLEMAIN=main
# uncomment if you want to compile with platex
#SAMPLEARG=-latex=platex
sample: workdir/sample/${SAMPLEMAIN}.tex
docker container run -it --rm \
-v ${PWD}/workdir:/workdir \
-w /workdir/${SAMPLEDIR} \
${IMAGE} \
sh -c "mktexlsr && latexmk -C ${SAMPLEMAIN}.tex && latexmk ${SAMPLEARG} ${SAMPLEMAIN}.tex && dvipdfmx ${SAMPLEMAIN}.dvi && latexmk -c ${SAMPLEMAIN}.tex"
71 changes: 60 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# paperist/alpine-texlive-ja
# wsuzume/docker-alpine-texlive

[![Docker Automated build](https://img.shields.io/docker/automated/paperist/alpine-texlive-ja.svg)](https://hub.docker.com/r/paperist/alpine-texlive-ja/)
[![Docker Image Size](https://images.microbadger.com/badges/image/paperist/alpine-texlive-ja.svg)](https://microbadger.com/images/paperist/alpine-texlive-ja "Get your own image badge on microbadger.com")
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg)](https://github.com/RichardLitt/standard-readme)

> Minimal TeX Live image for Japanese based on alpine
> TeX Live image based on alpine
Forked from [umireon/docker-texci] \(under the MIT License\).
Forked from [Paperist/docker-alpine-texlive-ja](https://github.com/Paperist/docker-alpine-texlive-ja
) \(under the MIT License\).

[umireon/docker-texci]: https://github.com/umireon/docker-texci
Template:

* sample: George Kour's [Style and Template for Preprints (arXiv, bio-arXiv)](https://ja.overleaf.com/latex/templates/style-and-template-for-preprints-arxiv-bio-arxiv/fxsnsrzpnvwc) \(under the Creative Commons CC BY 4.0\)
* preprint\_en\_single\_column: George Kour's [Style and Template for Preprints (arXiv, bio-arXiv)](https://ja.overleaf.com/latex/templates/style-and-template-for-preprints-arxiv-bio-arxiv/fxsnsrzpnvwc) \(under the Creative Commons CC BY 4.0\)

## Table of Contents

@@ -20,23 +22,70 @@ Forked from [umireon/docker-texci] \(under the MIT License\).
## Install

```bash
docker pull paperist/alpine-texlive-ja
$ git clone https://github.com/wsuzume/docker-alpine-texlive
$ cd docker-alpine-texlive

$ make pull
# or
$ make build
```

Building an image sometimes fails if choosed mirror sever was weak.

## Usage
### Entering docker container

Just run

```bash
$ make shell
```

and you can use `platex`, `dvipdfmx`, etc. in the docker container.


### Compiling from the outside of docker container
Choose template from `templates`, and copy to `workdir`.

```bash
$ docker run --rm -it -v $PWD:/workdir paperist/alpine-texlive-ja
$ latexmk -C main.tex && latexmk main.tex && latexmk -c main.tex
$ cp -r templates/preprint_en_single_column workdir/mypaper
```

Then, edit `Makefile`. Copy and paste `sample` command and edit like following.

```Makefile
## target file is workdir/${XXDIR}/${XXMAIN}.tex
MYPAPERDIR=mypaper
MYPAPERMAIN=main
# uncomment if you want to compile with platex
#MYPAPERARG=-latex=platex
mypaper: workdir/sample/${MYPAPERMAIN}.tex
docker container run -it --rm \
-v ${PWD}/workdir:/workdir \
-w /workdir/${MYPAPERDIR} \
${IMAGE} \
sh -c "mktexlsr && latexmk -C ${MYPAPERMAIN}.tex && latexmk ${MYPAPERARG} ${MYPAPERMAIN}.tex && dvipdfmx ${MYPAPERMAIN}.dvi && latexmk -c ${MYPAPERMAIN}.tex"

```

Finally, you can compile LaTeX file by following command.

```bash
$ make mypaper
```

### Adding modules
Edit `Dockerfile` and add `[modulename].sty` file to `${TEXMFLOCAL}/[modulename]`.

## Contribute

PRs accepted.

## License

MIT © 3846masa

MIT © wsuzume

## Contact
使い方わからない,とかでも声かけて大丈夫です.

Twitter: [@wsuzume](https://twitter.com/wsuzume)
49 changes: 49 additions & 0 deletions templates/preprint_en_single_column/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

## Description:

The project hosts an aesthetic an simple LaTeX style suitable for "preprint" publications such as arXiv and bio-arXiv, etc.
It is based on the [**nips_2018.sty**](https://media.nips.cc/Conferences/NIPS2018/Styles/nips_2018.sty) style.

This styling maintains the esthetic of NIPS but adding and changing features to make it (IMO) even better and nore suitable for preprints.
The result looks fairly different from NIPS style so that readers won't get confused to think that the preprint was published in NIPS.

### Why NIPS?
Because the NIPS styling is a comfortable single column format that is very esthetic and convenient for reading.

## Usage:
1. Use Document class **article**.
2. Copy **arxiv.sty** to the folder containing your tex file.
3. add `\usepackage{arxiv}` after `\documentclass{article}`.
4. The only packages used in the style file are **geometry** and **fancyheader**. Do not reimport them.

See **template.tex**

## Project files:
1. **arxiv.sty** - the style file.
2. **template.tex** - a sample template that uses the **arxiv style**.
3. **references.bib** - the bibliography source file for template.tex.
4. **template.pdf** - a sample output of the template file that demonstrated the design provided by the arxiv style.


## Handling References when submitting to arXiv.org
The most convenient way to manage references is using an external BibTeX file and pointing to it from the main file.
However, this requires running the [bibtex](http://www.bibtex.org/) tool to "compile" the `.bib` file and create `.bbl` file containing "bibitems" that can be directly inserted in the main tex file.
However, unfortunately the arXiv Tex environment ([Tex Live](https://www.tug.org/texlive/)) do not do that.
So easiest way when submitting to arXiv is to create a single self-contained .tex file that contains the references.
This can be done by running the BibTeX command on your machine and insert the content of the generated `.bbl` file into the `.tex` file and commenting out the `\bibliography{references}` that point to the external references file.

Below are the commands that should be run in the project folder:
1. Run `$ latex template`
2. Run `$ bibtex template`
3. A `template.bbl` file will be generated (make sure it is there)
4. Copy the `template.bbl` file content to `template.tex` into the `\begin{thebibliography}` command.
5. Comment out the `\bibliography{references}` command in `template.tex`.
6. You ready to submit to arXiv.org.


## General Notes:
1. For help, comments, praises, bug reporting or change requests, you can contact the author at: kourgeorge/at/gmail.com.
2. You can use, redistribute and do whatever with this project, however, the author takes no responsibility on whatever usage of this project.
3. If you start another project based on this project, it would be nice to mention/link to this project.
4. You are very welcome to contribute to this project.
5. A good looking 2 column template can be found in https://github.com/brenhinkeller/preprint-template.tex.
Loading