summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/mathspic/grabtexdata.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-06-10 14:51:31 +0000
committerKarl Berry <karl@freefriends.org>2010-06-10 14:51:31 +0000
commitb6d1ce2a105a839a1cf75d4b4ccb8f5827d22b4c (patch)
treec40c4afa4ac09c7e3d1f7f47fe66afd7513d1523 /Master/texmf-dist/doc/latex/mathspic/grabtexdata.tex
parentda353234f401986deb76831d76effffd0d0e2257 (diff)
mathspic script
git-svn-id: svn://tug.org/texlive/trunk@18868 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/mathspic/grabtexdata.tex')
-rw-r--r--Master/texmf-dist/doc/latex/mathspic/grabtexdata.tex39
1 files changed, 39 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/mathspic/grabtexdata.tex b/Master/texmf-dist/doc/latex/mathspic/grabtexdata.tex
new file mode 100644
index 00000000000..d69d318b7ca
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/mathspic/grabtexdata.tex
@@ -0,0 +1,39 @@
+%% grabtexdata.tex (from oxford.tex)
+%% RWD Nickalls (c) Jan 2005
+%% for extracting data into mathspic var commands
+%%========================================
+\scrollmode % prevent LaTeX stopping if there are errors
+%---------------------
+% make a print command macro
+\newcommand{\print}[1]{\immediate\write\outfile{#1}}
+%---------------------
+% make a comment % command macro
+% first need to define percentchar for the write statement
+% (From "TeX for the Impatient" (1990), p 292)
+{\catcode`\%=12 \global\def\percentchar{%}}%
+\newcommand{\comment}{\percentchar\space}
+%
+% make a \macro command --> %def<space>
+\newcommand{\mydef}{def}
+\newcommand{\macro}{\percentchar\mydef\space}
+%----------------------
+% create and open a new file with filename = textfiledata.dat
+\newwrite\outfile
+\immediate\openout\outfile=texfiledata.dat
+%----------------------
+%% write file header & general info
+\print{\percentchar\percentchar\space file: texdata.dat}
+\print{\percentchar\percentchar\space accessing TeX parameter values}
+%---------------------
+%% now get \textwidth and \textheight values from the tex file
+\print{\comment ============}
+\print{var w555 = \number\textwidth\comment\textwidth=scaled points}
+\print{var w556 = \number\textwidth\comment\textwidth=\the\textwidth}
+\print{var w557 = \number\textwidth/1864679.8\comment (\textwidth in cms)}
+\print{\macro textwidthcms()\number\textwidth/1864679.8\comment}
+\print{\macro textheightcms()\number\textheight/1864679.8\comment}
+\print{\comment ============}
+%--------------------
+% close the file
+\immediate\closeout\outfile
+%%=========end=========================