From: martin g. <a.m...@ic...> - 2024-01-27 17:16:11
|
Thanks a lot Tony, your comments and the example are very helpful. Your comment on the ;end; got me thinking about echo. If I turn echo off at the start and on at the end of each reduce environment, then the entire input LaTeX is processed. Then I only have “off echo;” at the start of each in the generated LaTeX file and this is easy to remove with a little post-processing. I tried using “off echo $” but this is ignored running inside IN_TEX. Then I tried removing “off echo” and instead using $ to terminate all the commands, but using $ is ignored for any command I tried. I have started looking at the source for IN_TEX, but my lisp is limited to Emacs Lisp, so I have some reading to do. Martin > On 26. Jan 2024, at 20:06, Prof Tony Roberts via Reduce-algebra-developers <red...@li...> wrote: > > Hi, > > I use in_tex extensively for a couple of decades, and indeed it was > I who encouraged AN to incorporate the command into Reduce. So let > me answer two separate issues in two separate emails. > > 1. "off echo" I have never had any trouble with it, nothing like > you describe. So cannot help there without more information. > (Although something changed with "off echo" 5-10 years ago in that > it itself now appears spuriously in some of my output when before it > did not!) > > 2. Re "\begin{reduce} and \end{reduce} " First the ";end;" that > you code also has to be within a "\begin{reduce} ;end; \end{reduce} > " in order for Reduce to execute it. That it is beyond the > \end{document} is immaterial to Reduce. > > Second, I recommend using fancyvrb package to typeset the reduce > code. In your preamble put > > \usepackage{fancyvrb} > \def\reduce{}% protect against earlier defns > \renewenvironment{reduce}% > {\Verbatim[numbers=left,firstnumber=\the\inputlineno]}% > {\endVerbatim} > > The result for your amended example latex document is attached. > > Tony > > > On 26/1/2024 10:13 pm, martin gregory via Reduce-algebra-developers > wrote: >> while trying to use IN_TEX I came across the following questions >> >> 1. using OFF ECHO causes IN_TEX to ignore everything in the input file >> following the first \end{reduce}. If I use a $ terminator for the >> IN_TEX command, only the reduce output and nothing else is >> displayed. Since I would like to be able to display only the output >> and not the commands, how can I do this? >> >> 2. IN_TEX writes \begin{reduce} and \end{reduce} to the output LaTeX >> file which causes a fatal error when compiling the LaTex (TeX Live >> 2023). If I write >> >> \newenvironment{reduce}{}{}% >> >> before the \documentclass command the compilation works. I would >> expect that there is a definition of a reduce environment but >> >> find Reduce-svn6658-src -iname '*.sty' -exec grep "newenv" {} \; >> >> returns only a definition >> >> \newenvironment{describe}[1]{\par{\bf >> #1}\begin{indented}}{\end{indented}} >> >> for the three files: >> >> doc/misc/reduce.sty >> doc/primers/reduce.sty >> doc/util/reduce.sty >> >> Searching in *.tex finds many more but no 'reduce'. Does it exist? >> >> 3. Using IN_TEX always produces a 99 error, e.g. >> >> +++ error: (99 ("End-of-file read in file" "rlfi-01-src.tex")) ( >> "End-of-file read in file" "rlfi-01-src.tex") >> >> even though I have ;end; at the end of the file. Is this expected? >> >> I have compiled revision reduce 6658 (csl) from source on Slackware >> (kernel 5.15.145). >> >> Martin Gregory >> >> Test program and LaTeX file: >> >> --------------------rlfi-01.red------------------------- >> load_package rlfi ; >> out t ; % to drop rlfi preamble >> q:=(y^2+2*y)^2/(2*a); >> on latex, lasimp ; >> out "rlfi-01.tex" ; >> in_tex "rlfi-01-src.tex" ; >> shut "rlfi-01.tex" ; >> off latex ; % after shut to avoid writing \end{document} >> ;end; >> --------------------rlfi-01-src.tex--------------------- >> \documentclass[11pt,a4paper]{article} >> \usepackage[pdftex,bookmarks,colorlinks,linkcolor=blue]{hyperref} >> \title{RLFI in file read by IN\_TEX} >> \author{Martin Gregory} >> \begin{document} >> \maketitle >> We define q as follows: >> >> \begin{reduce} >> write q ; >> \end{reduce} >> \end{document} >> ;end; >> >> >> _______________________________________________ >> Reduce-algebra-developers mailing list >> Red...@li... >> https://lists.sourceforge.net/lists/listinfo/reduce-algebra-developers > > -- > --------------------------------------------------------------------- > Four books and a toolbox: > > * (2020) Linear Algebra for the 21st Century > Oxford University Press. isbn: 978-0-19-885640-5, 978-0-19-885639-9 > https://global.oup.com/academic/product/linear-algebra-for-the-21st-century-9780198856399 > > * (2015) Model emergent dynamics in complex systems > SIAM, Philadelphia. isbn: 9781611973556. > https://epubs.siam.org/doi/10.1137/1.9781611973563 > > * (2009) Elementary calculus of financial mathematics > SIAM, Philadelphia. isbn: 978-0-898716-67-2. > https://epubs.siam.org/doi/10.1137/1.9780898718225 > > * (1994) A one-dimensional introduction to continuum mechanics > World Sci. isbn: 978-981-02-1913-0. > > * (2020) with John Maclean, and J. E. Bunder; Equation-Free > function toolbox for Matlab/Octave. > http://github.com/uoa1184615/EquationFreeGit > > Emeritus Professor A.J. Roberts, FAustMS > School of Mathematical Sciences, University of Adelaide > https://profajroberts.github.io/ > mailto:Pro...@pr... > http://orcid.org/0000-0001-8930-1552 > <mg.tex><mg.pdf>_______________________________________________ > Reduce-algebra-developers mailing list > Red...@li... > https://lists.sourceforge.net/lists/listinfo/reduce-algebra-developers |