summaryrefslogtreecommitdiff
path: root/support/latexmk/example_rcfiles/exceltex1.sty
blob: 270f94d818674027a38222d8857258e9034593f9 (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
%% THIS IS A MODIFICATION BY JOHN COLLINS 30 Apr 2013 OF V. 0.5.1 OF
%% exceltex.sty TO HELP latexmk.
%% The modification consists of changing the calls to the
%% \InputIfFileExists macro to a call to a new macro that provides a
%% warning message when the file to be read does not exist.

% get data from excel files into LaTeX
%
% (c) 2004-2006 by Hans-Peter Doerr <doerr@cip.physik.uni-freiburg.de>
% 2013 John Collins <collins@phys.psu.edu>
%
% exceltex is free software. you can redistribute or modify it under
% the terms of the GNU GENERAL PUBLIC LICENSE Version 2. See COPYING for
% details.
%
\def\exceltexVersion{0.5.1JCC}
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{exceltex1}[2013/04/30 v.\exceltexVersion]
\DeclareOption{cellrefs}{\def\cellrefs{1}}
\ProcessOptions
%
\typeout{This is exceltex  v\exceltexVersion}
% ulem needs option normalem for not breaking \em and \emph
\RequirePackage[normalem]{ulem}
\RequirePackage{color}
%\RequirePackage{eurosym}
%

%% JCC's addition:
\providecommand\InputFileOrMessage[3]{%
   \InputIfFileExists{#1}%
                     {#2}%
                     {#3\PackageWarning{exceltex1}{File `#1' not found.}}%
}
%%

\newcounter{exceltexCounterC}\setcounter{exceltexCounterC}{0}
\newcounter{exceltexCounterT}\setcounter{exceltexCounterT}{0}
%
\immediate\openout 10=\jobname.excltx
%
%
% write index header
\ifx\cellrefs\undefined
%
\else
\immediate\write 10{;cellrefs}
\fi
\immediate\write 10{;created by exceltex v. \exceltexVersion}
%
\newcommand{\inccell}[1]{%
  \stepcounter{exceltexCounterC}%
  \ifx\cellrefs\undefined%
  \immediate\write 10{c:\theexceltexCounterC:#1}%
  \InputFileOrMessage{\jobname-excltx/c-\theexceltexCounterC}{}{}%
  \else
  \immediate\write 10{c:#1}%
  \InputFileOrMessage{\jobname-excltx/c-#1}{}{}%
  \fi
}%
%
%
\newcommand{\inctab}[1]{%
  \stepcounter{exceltexCounterT}%
  \ifx\cellrefs\undefined%
  \immediate\write 10{t:\theexceltexCounterT:#1}%
  \InputFileOrMessage{\jobname-excltx/t-\theexceltexCounterT}{}{\\}%
  \else
  \immediate\write 10{t:#1}%
  \InputFileOrMessage{\jobname-excltx/t-#1}{}{\\}%
  \fi
}%
\endinput