MAJOR=4 MINOR=5 DEVNAME=tty5 K# Generated with Aspell Dicts "proc" script version 0.60.4 add en_US.multi ( #!/usr/bin/python3 r""" Calculate LaTeX paper and margin settings for arbitrary magnification (C) Silas S. Brown, 2005-2009, 2016, 2019. Version 1.63. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. When producing enlarged material in LaTeX for people with low vision, it's often not enough to simply add such things as "\Large" because that doesn't enlarge _everything_ and it can be difficult to achieve the exact desired size, especially if unusual packages are being used as well. It's more effective to change the LaTeX paper size and margin settings to simulate SMALL PAPER, and then magnify the result up to the desired physical paper size. This magnifies everything, and also adds some clarity for low-vision users because fonts like CMR have different versions at different sizes and the small-sized versions are often meant to be clearer. This is a Python script to calculate the necessary settings for arbitrary font and page sizes. Works in both Python 2 and Python 3. BASIC USAGE In the following instructions, base-size is the point size that the TeX file is based on (if the documentclass specifies 12pt then \small=11 normal=12 \large=14 \Large=17 \LARGE=20 \huge=25), and desired-size is the point size that you want to produce. The command-line parameters depend on whether you are using latex/dvips or pdflatex. FOR USE WITH LATEX AND DVIPS: To print the geometry settings: python latex-papersize.py base-size desired-size tex e.g.: python latex-papersize.py 12 26 tex (If you install latex-papersize.py as /usr/local/bin/latex-papersize, then you can say "latex-papersize" instead of "python latex-papersize.py" throughout these examples.) The output of this command should then be placed after \documentclass in your .tex file. Then run latex to make a DVI file, and then do: python latex-papersize.py base-size desired-size dvi-file e.g.: python latex-papersize.py 12 26 myfile.dvi which will print the appropriate dvips command. FOR USE WITH PDFLATEX: With pdflatex you need only one command: python latex-papersize.py base-size desired-size pdftex the output of this command should go just before \begin{document}. NB if using hyperref package, put hyperref AFTER these settings (and if also using pinyin package then put pinyin package after that again) PAGE NUMBERS: When invoking latex-papersize.py with the "tex" or "pdftex" options, you can optionally add a fourth parameter to specify how many points to leave for page numbers at the bottom of each page. Normally 15 is a good idea. Leaving this out causes no room to be left for page numbers and \pagestyle{empty} to be added. This does not affect the dvips command. PAPER SIZES AND MARGINS: It is assumed that the final physical printout will be on A4 portrait with 10mm margins. You can override this by setting the paper_width and paper_height environment variables (in millimetres) before running, e.g.: paper_width=297 paper_height=210 python latex-papersize.py ... You can also set the environment variables margin_left and margin_top (the right and bottom margins are assumed to be mirrors of these). If using with non-PDF latex, remember to set the environment variables again when asking latex-papersize.py for the dvips command. Or "export" them so they remain set. POSTER PRINTING: If you want to print on a physical paper size that is larger than your printer can handle, you can make up the larger size by sticking together smaller pieces of paper. Perhaps the best way