Skip to content

Commit

Permalink
Version 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
minoki committed Aug 21, 2019
1 parent 25bc55f commit f2fbc3d
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 9 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Version 0.4 (2019-08-21)
-----

Changes:

* New options: `--print-output-directory`, `--package-support`, and `--engine-executable`
* Spaces and special characters in the input file name are now appropriately escaped. For example, `cluttex -e pdflatex file%1.tex` now typesets the file `file%1.tex`.
* Watch new input files in watch mode.

Version 0.3 (2019-04-30)
-----

Expand Down
2 changes: 1 addition & 1 deletion bin/cluttex
Original file line number Diff line number Diff line change
Expand Up @@ -2678,7 +2678,7 @@ end
along with ClutTeX. If not, see <http://www.gnu.org/licenses/>.
]]

CLUTTEX_VERSION = "v0.3"
CLUTTEX_VERSION = "v0.4"

-- Standard libraries
local coroutine = coroutine
Expand Down
2 changes: 1 addition & 1 deletion bin/cluttex.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2681,7 +2681,7 @@ end
along with ClutTeX. If not, see <http://www.gnu.org/licenses/>.
]]

CLUTTEX_VERSION = "v0.3"
CLUTTEX_VERSION = "v0.4"

-- Standard libraries
local coroutine = coroutine
Expand Down
Binary file modified doc/manual-ja.pdf
Binary file not shown.
36 changes: 33 additions & 3 deletions doc/manual-ja.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
\renewcommand\sectionautorefname{セクション}
\renewcommand\subsectionautorefname{サブセクション}

\title{\ClutTeX{}マニュアル\\(バージョン0.3)}
\title{\ClutTeX{}マニュアル\\(バージョン0.4)}
\author{ARATA Mizuki}
\date{2019年4月30日}
\date{2019年8月21日}

\begin{document}
\maketitle
Expand Down Expand Up @@ -82,6 +82,8 @@ \section{コマンドライン}
\texttt{\texcmd{includeonly}\{\metavar{NAMEs}\}}を挿入する。
\item[\texttt{--make-depends=\metavar{FILE}}]
Makefile用の依存関係を\metavar{FILE}に書き出す。
\item[\texttt{--engine-executable=\metavar{COMMAND}}]
実際に使う\TeX{}コマンドを指定する。
\item[\texttt{--tex-option=\metavar{OPTION}}, \texttt{--tex-options=\metavar{OPTIONs}}]
\TeX{}に追加のオプションを渡す。
\item[\texttt{--dvipdfmx-option=\metavar{OPTION}}, \texttt{--dvipdfmx-options=\metavar{OPTIONs}}]
Expand All @@ -92,6 +94,11 @@ \section{コマンドライン}
\item[\texttt{-h}, \texttt{--help}]
\item[\texttt{-v}, \texttt{--version}]
\item[\texttt{-V}, \texttt{--verbose}]
\item[\texttt{--print-output-directory}]
\texttt{--output-directory}の値を標準出力に出力して、そのまま終了する。
\item[\texttt{--package-support=PKG1[,PKG2,...,PKGn]}]
外部コマンドを実行するパッケージ用の個別の対策を有効にする。
現在のところ、\texttt{minted}と\texttt{epstopdf}に対応している。
\end{description}

補助コマンド実行用のオプション:
Expand Down Expand Up @@ -218,8 +225,16 @@ \section{出力ディレクトリについて}
\item \texttt{--makeindex}, \texttt{--bibtex}, \texttt{--biber}, \texttt{--makeglossaries}
\end{itemize}

もし何らかの事情で自動生成された出力ディレクトリの位置を知りたければ、\ClutTeX{}を\texttt{--print-output-directory}オプションを使うとよい。
例えば、Makefileの\texttt{clean}ターゲットは次のように書ける:
\begin{verbatim}
clean:
-rm -rf $(shell cluttex -e pdflatex --print-output-directory main.tex)
-rm main.pdf
\end{verbatim}

出力ディレクトリに生成された補助ファイルは、\texttt{--fresh}オプションを指定しない限り、\ClutTeX{}が消去することはない。
一方、テンポラリディレクトリを使用するということは、PCの再起動時に補助ファイルが削除されるということでもある
一方、テンポラリディレクトリを使用するということは、PCの再起動時に補助ファイルが削除される可能性があるということでもある

\section{エイリアス}
Unix用コマンドの中には、自身の名前によって挙動を変えるものがある。
Expand All @@ -235,4 +250,19 @@ \section{エイリアス}

例えば、\texttt{cllualatex}は\texttt{cluttex --engine lualatex}の別名であり、\texttt{clxelatex}は\texttt{cluttex --engine xelatex}の別名である。

\section{\texpkg{minted}と\texpkg{epstopdf}への対策}
一般に、外部コマンド実行(シェルエスケープ)を行うパッケージは\texttt{-output-directory}を指定した際に正常に動作しない。
したがって、\ClutTeX{}の下ではそういうパッケージはうまく動かない。

一方で、パッケージによっては\texttt{-output-directory}の値を指示するためのパッケージオプションを持っているものがある。
例えば、\texpkg{minted}の\texttt{outputdir}オプション、\texpkg{epstopdf}の\texttt{outdir}オプションがそれである。

\ClutTeX{}からこれらのパッケージオプションを指定することはできるが、そのためには使用するパッケージを\ClutTeX{}が事前に知っておかねばならない。
使用するパッケージを\ClutTeX{}に知らせるには、\texttt{--package-support}オプションを使う。

例えば、\texpkg{minted}を使う文書を処理する場合は次のように実行すれば良い:
\begin{verbatim}
cluttex -e pdflatex --shell-escape --package-support=minted document.tex
\end{verbatim}

\end{document}
Binary file modified doc/manual.pdf
Binary file not shown.
35 changes: 32 additions & 3 deletions doc/manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
\newcommand\texpkg[1]{\texttt{#1}}
\newcommand\metavar[1]{\textnormal{\textsf{#1}}}

\title{\ClutTeX\ manual\\(Version 0.3)}
\title{\ClutTeX\ manual\\(Version 0.4)}
\author{ARATA Mizuki}
\date{2019-04-30}
\date{2019-08-21}

\begin{document}
\maketitle
Expand Down Expand Up @@ -78,6 +78,8 @@ \section{Command-line usage}
Insert \texttt{\texcmd{includeonly}\{\metavar{NAMEs}\}}.
\item[\texttt{--make-depends=\metavar{FILE}}]
Write Makefile-style dependencies information to \metavar{FILE}.
\item[\texttt{--engine-executable=\metavar{COMMAND}}]
The actual \TeX\ command to use.
\item[\texttt{--tex-option=\metavar{OPTION}}, \texttt{--tex-options=\metavar{OPTIONs}}]
Pass extra options to \TeX.
\item[\texttt{--dvipdfmx-option=\metavar{OPTION}}, \texttt{--dvipdfmx-options=\metavar{OPTIONs}}]
Expand All @@ -88,6 +90,11 @@ \section{Command-line usage}
\item[\texttt{-h}, \texttt{--help}]
\item[\texttt{-v}, \texttt{--version}]
\item[\texttt{-V}, \texttt{--verbose}]
\item[\texttt{--print-output-directory}]
Print the output directory and exit.
\item[\texttt{--package-support=PKG1[,PKG2,...,PKGn]}]
Enable special support for shell-escaping packages.
Currently supported packages are `minted` and `epstopdf`.
\end{description}

Options for running auxiliary programs:
Expand Down Expand Up @@ -212,6 +219,13 @@ \section{Default output directory}
\item \texttt{--makeindex}, \texttt{--bibtex}, \texttt{--biber}, \texttt{--makeglossaries}
\end{itemize}

If you need to know the exact location of the automatically-generated output directory, you can invoke \ClutTeX\ with \texttt{--print-output-directory}.
For example, \texttt{clean} target of your Makefile could be written as:
\begin{verbatim}
clean:
-rm -rf $(shell cluttex -e pdflatex --print-output-directory main.tex)
\end{verbatim}

\ClutTeX\ itself doesn't erase the auxiliary files, unless \texttt{--fresh} option is set.
Note that, the use of a temporary directory means, the auxiliary files may be cleared when the computer is rebooted.

Expand All @@ -226,6 +240,21 @@ \section{Aliases}
If \ClutTeX\ is called as \texttt{cl}\(\langle\text{\metavar{ENGINE}}\rangle\), the \texttt{--engine} option is set accordingly.
For example, \texttt{cllualatex} is an alias for \texttt{cluttex --engine lualatex} and \texttt{clxelatex} for \texttt{cluttex --engine xelatex}.

%The aliases provided by \TeX\ Live are, \texttt{cllualatex} and \texttt{clxelatex}.
% The aliases provided by \TeX\ Live are, \texttt{cllualatex} and \texttt{clxelatex}.

\section{Support for \texpkg{minted} and \texpkg{epstopdf}}
In general, packages that execute external commands (shell-escape) don't work well with \texttt{-output-directory}.
Therefore, they don't work well with \ClutTeX.

However, some packages provide a package option to let them know the location of \texttt{-output-directory}.
For example, \texpkg{minted} provides \texttt{outputdir}, and \texpkg{epstopdf} provides \texttt{outdir}.

\ClutTeX\ can supply them the appropriate options, but only if it knows that the package is going to be used.
To let \ClutTeX\ what packages are going to be used, use \texttt{--package-support} option.

For example, if you want to typeset a document that uses \texpkg{minted}, run the following:
\begin{verbatim}
cluttex -e pdflatex --shell-escape --package-support=minted document.tex
\end{verbatim}

\end{document}
2 changes: 1 addition & 1 deletion src/cluttex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
along with ClutTeX. If not, see <http://www.gnu.org/licenses/>.
]]

CLUTTEX_VERSION = "v0.3"
CLUTTEX_VERSION = "v0.4"

-- Standard libraries
local table = table
Expand Down

0 comments on commit f2fbc3d

Please sign in to comment.