summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/gentombow/bounddvi-en.tex
blob: df981f44d4d272b23cac0d615847056e4ee004fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
%# -*- ascii characters only -*-

% Package v1.0--v6.0: Koichi INOUE
% Package v7.0--    : Hironobu Yamashita
%   The package documentation (this file) was
%   written by Hironobu Yamashita.

\documentclass[a4paper,dvipdfmx]{article}
\usepackage{doc}
\usepackage{bounddvi}
\GetFileInfo{bounddvi.sty}
\title{Package \textsf{bounddvi} \fileversion}
\author{Koichi Inoue \& Hironobu Yamashita}
\date{\filedate}
\begin{document}

\maketitle

Package \textsf{bounddvi} sets papersize special into DVI file.
This package can be used in both tate (vertical) and yoko (horizontal)
writing directions of Japanese p\LaTeX/up\LaTeX, and both
\texttt{dvipdfmx} and \texttt{dvips} drivers are supported.
The \texttt{tombow} option defined in Japanese p\LaTeX\ kernel is
also supported. Of course, this package can be used also with the
original \LaTeX\ in DVI output mode.

This package (since v7.0) is part of \textsf{gentombow} bundle:
\begin{verbatim}
  https://github.com/aminophen/gentombow
\end{verbatim}
Originally it was part of \textsf{platex-tools} bundle,
but it has been moved since March 2018.

\section*{Usage}

Load this package in preamble.
\begin{verbatim}
  \documentclass[a5paper]{article}
  \usepackage{bounddvi}
  ...
\end{verbatim}
Process the \texttt{.tex} file using \texttt{latex} +
\texttt{dvips} chain or \texttt{latex} + \texttt{dvipdfmx} chain.

\section*{Known limitations}

\begin{enumerate}
\item The compatibility with \textsf{geometry} package may not be
perfect, as both \textsf{geometry} and \textsf{bounddvi} embeds
papersize special into a DVI file. The loading order of these
two packages may affect the actual size of output.
\item This package supports ``\textsf{jsclasses}-like employment''
of \verb+\mag+, because it's more widely used in Japan. This may
be incompatible with some classes or packages which employ
\verb+\mag+ in other ways.
\end{enumerate}
The details are described in the sections below.

\subsection*{The behavior of multiple papersize specials}

Sometimes multiple papersize specials may be embedded into a DVI
file. Among these specials, the specification which appears
\emph{at last} in DVI takes effect when \texttt{dvipdfmx} or
\texttt{dvips} (\TeX\ Live 2017 or later) is used\footnote{%
When \texttt{dvips} in \TeX\ Live 2016 or earlier is used,
the specification which appears \emph{first} in DVI took effect,
but the default behavior was changed in \TeX\ Live r42420 to
be compatible with \texttt{dvipdfmx}. The new option \texttt{-L0}
can be used to recover the old behavior.}. For example, when the
following source is processed with \texttt{dvipdfmx},
\begin{verbatim}
  % latex + dvipdfmx
  \documentclass{...}
  \usepackage{bounddvi}
  \usepackage[dvipdfm]{geometry}
\end{verbatim}
the specification by \textsf{geometry} wins.

\section*{Note about \texttt{\char92mag} handling}

Among the packages in CTAN, there are two types of implementation
in terms of \verb+\mag+ employment. It seems that there is no
(official or practical) ``standard'' in \verb+\mag+ treatment.

When the output is going to the physical size of A4
($210\,\mathrm{mm} \times 297\,\mathrm{mm}$) with the setting of
\verb+\mag=2000+, there are two ways: some classes/packages can set
\begin{quote}
  \texttt{\char92mag=2000}\\
  \texttt{\char92paperwidth=210mm} ($= 420\,\mathrm{truemm}$)\\
  \texttt{\char92paperheight=297mm} ($= 594\,\mathrm{truemm}$)
\end{quote}
and others can set
\begin{quote}
  \texttt{\char92mag=2000}\\
  \texttt{\char92paperwidth=105mm} ($= 210\,\mathrm{truemm}$)\\
  \texttt{\char92paperheight=148.5mm} ($= 297\,\mathrm{truemm}$)
\end{quote}
The first way is adopted by \textsf{geometry} package etc, and it's
(probably) based on the behavior of the \verb+papersize+ special of
\texttt{dvips}. It does not handle true units properly, and accepts
only non-true units and evaluates them as if they were true units.
The second way is adopted by \textsf{jsclasses} document class etc,
and is also suppoted by \verb+pdf:pagesize+ special of
\texttt{dvipdfm(x)}. This can be more consistent with \LaTeX, since
all other layout parameters (e.g. \verb+\textwidth+) are set
according to the unit truemm.

The \textsf{bounddvi} supports the latter, so some classes/packages
which are based on the former may or may not work properly when
using \textsf{bounddvi} package.

\section*{References}

\begin{itemize}
\item Setting paper size using \texttt{dvips} \& \texttt{dvipdfm}
  (description in Japanese)\\
  \texttt{https://www.ma.ns.tcu.ac.jp/Pages/TeX/bounddvi.sty.html}
\end{itemize}

\section*{ChangeLog}

\begin{itemize}
  \item 2002/03/10 v1.0 (KI) First version
  \item 2002/10/30 v2.0 (KI) Add \texttt{dvipdfm} \texttt{pdf:pagesize} special
  \item 2003/03/22 v3.2 (KI) Compatibility with \textsf{hyperref}
  \item 2004/05/08 v4.0 (KI) Support for $\mathtt{\char92mag} \ne 1000$
  \item 2004/12/08 v5.2 (KI) Compatibility with \textsf{geometry}
  \item 2004/12/15 v6.0 (KI) Not to use \texttt{dvipdfm(x)} \texttt{pdf:pagesize special}
  \item 2016/10/25 v7.1 (HY) Support for p\LaTeXe\ tombow option,
                             compatibility with \textsf{graphics}/\textsf{color} packages
  \item 2016/12/28 v7.2 (HY) Documentation for the new \texttt{dvips} behavior
  \item 2020/09/25 v8.0 (HY) Support for \LaTeXe/p\LaTeXe~2020-10-01
\end{itemize}

\end{document}