f



setting TeX text variable depending on keyval-generated param? (low-level TeX question)

I am using keyval to set a "scaled" parameter and am having trouble
getting the right behavior, which is:

If I \usepackage{package} with no [scaled] option, I want to set a
variable to a compile-time-specified default, say "s*[a.b]".

If I \usepackage[scaled]{package}, same thing.

And if I \usepackage[scaled=x.y], I want to set the variable to
"s*[x.y]".

(This is for font scaling, and I've used as my model the Helvetica
scaled parameter.)

The variable name (for the purposes of this conversation) is
pnm@scaled. What I have that's not working correctly is:

\expandafter\ifx\csname pmn@scaled\endcsname\relax
  \let\pmn@scaled\@empty
\else
  \edef\pmn@scaled{s*[1.2]}%
\fi

I think what this says is "if pnm@scaled is not defined (case 1), leave
it empty, otherwise set it to "s[1.2]". But  the else clause is not
working correctly, and I don't know how to differentiate between
"defined by keyval but with no value" and "defined by keyval but with a
value". Also I'm pretty sure I don't really know the difference between
\let and \edef. 

Any help gratefully appreciated. Thanks.

JDO

0
john_owens (39)
4/10/2006 10:02:08 PM
comp.text.tex 39029 articles. 3 followers. Post Follow

1 Replies
3623 Views

Similar Articles

[PageSpeed] 47

john_owens@yahoo.com  schrieb:

> I am using keyval to set a "scaled" parameter and am having trouble
> getting the right behavior, which is:
> 
> If I \usepackage{package} with no [scaled] option, I want to set a
> variable to a compile-time-specified default, say "s*[a.b]".
> 
> If I \usepackage[scaled]{package}, same thing.
> 
> And if I \usepackage[scaled=x.y], I want to set the variable to
> "s*[x.y]".
> 
> (This is for font scaling, and I've used as my model the Helvetica
> scaled parameter.)
> 
> The variable name (for the purposes of this conversation) is
> pnm@scaled. What I have that's not working correctly is:
> 
> \expandafter\ifx\csname pmn@scaled\endcsname\relax
>   \let\pmn@scaled\@empty
> \else
>   \edef\pmn@scaled{s*[1.2]}%
> \fi
> 
> I think what this says is "if pnm@scaled is not defined (case 1), leave
> it empty, otherwise set it to "s[1.2]". But  the else clause is not
> working correctly, and I don't know how to differentiate between
> "defined by keyval but with no value" and "defined by keyval but with a
> value". Also I'm pretty sure I don't really know the difference between
> \let and \edef. 

I'm not sure I have understand the problem, but to get the option 
[scaled] be equivalent to the option [scaled=1.2] you can use the 
optional argument that sets a default
\define@key{prefix}{scaled}[1.2]{...}

To get the \if-\else-\fi correct, I guess it would be enough if you 
define \pnm@scaled to be s*[1.2] at the start of your package, and then 
evaluate the package options. Either they will overwrite the predefined 
value or not. 

I would also suggest that you take a look at the xkeyval package. With 
it you can give keys preset values. 


-- 
Ulrike Fischer
e-mail: zus�tzlich meinen Vornamen vor dem @ einf�gen.
e-mail: add my first name between the news and the @.
0
news9686 (1969)
4/11/2006 7:44:48 AM
Reply:

Similar Artilces:

How to generate tex file that includes other tex files?
I have a LaTeX document that I organized by separating sections into independent tex files and grouping them all with calls to \include and \input, but now I need to generate a version of this document that is contained in a single tex file. I've gave some text macro languages a try (the C preprocessor, and M4), but it appears that they require some sort of text mangling and introduce comments on the output file. Does anyone know of a better, or effective, way of generating a single tex document where all calls to \input and \include are replaced with the contents of those files? ...

Table.TeX in Plain TeX
Dear all Normally we use the "Table.TeX" for aligning and formatting Tables in Plain TeX. Unfortunately I don't have the "Table.TeX". Can any one supply this or give any ideas of where it can be found. Thanks and Regards Saravanan,M. India Saravanan_Typesetter@yahoo.co.in (Saravanan,M.) writes: >Normally we use the "Table.TeX" for aligning and formatting Tables in >Plain TeX. Unfortunately I don't have the "Table.TeX". i suspect you may be thinking of tables.tex (plural tables). that is available on ctan, together with some documenta...

TeX programming for XML TeX
Dear TeX programmers, Kindly guide me how to develop the XML TeX work flow. Regards, Ganesh On 04/07/11 06:20, Ganesh Loganathan wrote: > Dear TeX programmers, > > Kindly guide me how to develop the XML TeX work flow. You have asked this several times. Have you done any work on finding out what to do? Do you mean XMLTeX (the program) or "XML and TeX" as a generic platform? Transforming XML to LaTeX requires learning a transformation scripting language such as XSLT. This should be your first task. The workflow looks something like this: 1. Author's text (usually in Word OOXML or OpenOffice ODT. but maybe in TEI or DocBook or a house XML schema): a. parse and validate b. (OOXML and ODT only) apply named styles to every object that requires formatting. c. add missing markup where required (editorial task). 2. Write XSLT (or equivalent) for first transformation to your required style in LaTeX (in a production environment, this would mean modifying your internal standard template, not writing it anew). 3. First proof formatted in LaTeX sent to editor and author for correction. 4. Repeat 1-3 as needed. 5. Penultimate proof to designer for corrections to styling. 6. Apply corrections, produce final proof; repeat 5-6 until correct. 7. Add PDF/x metadata and colourspacing if needed. If colour is used, colour correction and scoping will be needed at some stage, but this is a non-XML, non-LaTeX task, so it&#...

TeX
Hi, I am attempting to get emTeX running. Does anyone have recent experience with this software? In particular, will installation of the emx dll included with the package conflict with more recent emx releases? Also, is support for recent printers available anywhere? TIA RWM On 2004-06-16, Robert Murr <rwmurr@pcmagic.net> wrote: > I am attempting to get emTeX running. If you don't have a special reason to install emTeX I would start with VTex. There is a OS/2-Version that's free for personal use. Works very well. http://www.micropress-inc.com > Does anyone have recent experience with this software? > > In particular, will installation of the emx dll included with the > package conflict with more recent emx releases? Allways make shure that you use _only_ the latest emx-runtime (0.9d) > Also, is support for recent printers available anywhere? For recent printers you might use ghostcript via 'uniprint' Franz Franz Bakan wrote: >On 2004-06-16, Robert Murr <rwmurr@pcmagic.net> wrote: > > > >>I am attempting to get emTeX running. >> >> > >If you don't have a special reason to install emTeX >I would start with VTex. There is a OS/2-Version >that's free for personal use. Works very well. > >http://www.micropress-inc.com > > > >>Does anyone have recent experience with this software? >&g...

TeX
Check it out: www.BrandonsMansion.com ...

newb: help understanding "TeX capacity exceeded ... text input levels ..."
Good day folks. I'm sorry but the title is a little misleading. I have actually found a work around for my "TeX capacity exceeded" error but the workaround doesn't make sense to me so I'm hoping someone can explain it. Here's the scenario: I've amassed a large number of (La)TeX files consisting of TeX examples for doing various things. I wanted to build all of them and trash those that are no longer of any use to me. I did this with (terminal, bash, & make on a mac): $ for f in *tex; do make ${f%.*}.pdf; done Most of the files build but a small number (10%) don't build and generate the error: > (/usr/local/texlive/2010/texmf-dist/tex/generic/pstricks/pstricks.tex) > (./multido.tex > ! TeX capacity exceeded, sorry [text input levels=15]. > l.2 \input pstricks > > If you really absolutely need more capacity, > you can ask a wizard to enlarge me. > > No pages of output. Yes, all the failed builds use pstricks, specifically multido, and they all fail on multido calls. Here's the strange part: when I build the same file in a directory containing only the tex file being processed, the file builds successfully, ie, no "capacity exceeded" error! What's stranger is if I attempt to build the file with 'make file.pdf' in a directory with other .tex files, the capacity exceeded error happens. The file will only build if the build is being done in a directory containing only the target ...

Docx to TeX and TeX to Doc conversion
Dear TeX Experts, Really I proud of all the Experts. Kindly suggest me in Mik TeX itself any options to convert TeX to Doc conversion with high quality of equations also. I expecting the positive answers from the Great Team. Thanks and Regards, Ganesh Ganesh Loganathan wrote: > Dear TeX Experts, > > Really I proud of all the Experts. > > Kindly suggest me in Mik TeX itself any options to convert TeX to Doc > conversion with high quality of equations also. > > I expecting the positive answers from the Great Team. http://www.tex.ac.uk/cgi-bin/texfaq2html?label=fmtconv Hello, Tom Micevski <none@au-e29b6ec0.invalid> wrote: > Ganesh Loganathan wrote: > > Dear TeX Experts, > > > > Really I proud of all the Experts. > > > > Kindly suggest me in Mik TeX itself any options to convert TeX to Doc > > conversion with high quality of equations also. > > > > I expecting the positive answers from the Great Team. > > http://www.tex.ac.uk/cgi-bin/texfaq2html?label=fmtconv Thanks for this reply, but there is a more up to date list at http://tug.org/utilities/texconv/index.html But regarding what the original poster asked for -- "in Mik TeX itself..." -- there is only one solution, i.e.: use MikTeX installer to add the TeX4ht package, then call oolatex to convert LaTeX (not PlainTeX!) to an OpenOffice .sxw file . Open this file in OpenOffice or LibreOffice and save-as Microsoft Word d...

TeX / e-TeX disc groups ???
Hello, I found in eTeX manual that there exists disc groups (type number 10). I really don't see what they are... ;-( Any help ? On 10/21/2010 03:02 AM, GL wrote: > Hello, > > I found in eTeX manual that there exists disc groups (type number 10). These are active for a very short time while scanning the arguments of \discretionary. Best wishes, Taco ...

Converting pain text to TeX
Hi, I am trying to convert a plain text file to TeX format. For this I wrote a awk script to convert double quotes to the correct type in TeX, as in #!/usr/bin/awk -f # DQ2TQ : Converts double qoutes in plaint text file to TeX format # USAGE # dq2tq filename > newfilename BEGIN { count = 0 } /"/ { for (i=1; i<=NF; i++) {if (count % 2 == 0) {sub(/"/,"``",$i);count++} else {sub(/"/,"''",$i);count++}} } { print } However this does not seem to work right. Given the following input : " " " " &...

Type-written text to TeX?
Slightly OT, but I have several hundred pages of typewritten material already scanned in. (I just have a PDF file with one image per page.) There is a small amount of maths in it, but not much. Can anyone advise me of a good OCR program to use? I'd prefer a Linux program, but am not religious. I tried gocr, which was useless, and am presently trying clara, which looks as though it might work, although it seems to require several degrees in Computer Science to understand and use. Also, is there a program to abstract the images from the PDF file? I've written a little Java program to ...

Using border.tex on an existing tex document
Hi I'm trying to use border.tex from the TeX archive to apply a border around = a page (http://texcatalogue.sarovar.org/entries/border.html). At the moment, as soon as I switch on borders using \borderson, the border = appears but all of my content disappears. Without \borderson the page conte= nt renders as expected (though of course, no border!). I've tried fiddling = with the page dimensions etc but I'm not entirely convinced thats whats cau= sing it. The border.tex macro looks like it should do exactly what I want, = apart from the missing content ;( The original tex content was generated using OpenJade ("openjade" version "= 1.3.2", "OpenSP" version "1.5") to convert from DocBook (v4.5) SGML/DSSSL i= f that makes any difference. The problem we have is DocBook/OpenJade/SGML/D= SSSL doesn't provide a way to wrap an entire page with a border (the best I= can do is wrap the page content in a border meaning headers and footers ge= t their own disjointed borders). I'm processing the tex file using pdfjadetex (pdfTeX (Web2C 7.4.5) 3.14159-= 1.10b, kpathsea version 3.4.5) Thanks in advance :) Ian ikent@companieshouse.gov.uk wrote: > I'm trying to use border.tex from the TeX archive to apply a border around a page (http://texcatalogue.sarovar.org/entries/border.html). > > At the moment, as soon as I switch on borders using \borderson, the border appears Except that border.tex % border.tex: Macros...

TeX to PDF to Acrobat (for review) and back to TeX
Hi TeXperts, my current pipeline is: - TeTeX compiler - write documentation with TeX (either with TeXshop or iTeXmac) - get as an output PDF files - with Acrobat professional share those PDF to multiple reviewers (either by mail or www) - every reviewer adds comments or text notes on the PDF using acrobat professional, then sends back review - Acrobat imports all comments form all reviewers automatically into the original PDF What I would like to do is to at this point is to convert back my PDF to TeX without loosing this extra blocks containing comments from reviewers OR alternatively reviewers could directly write into textboxes of acrobat text in TeX syntax, the tool ofcourse must preserve this code when PDF to TeX. Are you aware of any solution, trick, magic, 3rd part tool? regards, p pberto@gmail.com (paolo berto) writes: >[...] >What I would like to do is to at this point is to convert back my PDF >to TeX without loosing this extra blocks containing comments from >reviewers OR alternatively reviewers could directly write into >textboxes of acrobat text in TeX syntax, the tool ofcourse must >preserve this code when PDF to TeX. > >Are you aware of any solution, trick, magic, 3rd part tool? there are various products that claim to convert pdf to word. they seem absolutely pathetic with input from tex. i don't know anything that even pretends to do the same, generating tex output. your best bet is probably to generate plain text and ed...

Old version of plain.tex and hyphen.tex
Hello All, I am trying to recreate an old version of our software that assumes an old version of Knuth's plain.tex (together with the version of hyphen.tex that accompanied it). I have searched the Internet for plain.tex Version 3.1415926 (together with hyphen.tex) with no success. Does anyone have a copy of these two files that they could email back to me? With great appreciation in advance! Brian O'Toole On Jul 2, 5:01 pm, "Brian O'Toole" <boto...@mathworks.com> wrote: > Hello All, > > I am trying to recreate an old version of our software that assumes an old > version of Knuth's plain.tex (together with the version of hyphen.tex that > accompanied it). I have searched the Internet for plain.tex Version > 3.1415926 (together with hyphen.tex) with no success. Does anyone have a > copy of these two files that they could email back to me? > > With great appreciation in advance! > Brian O'Toole TeXLive 7 (2002) has that version. If you can't get a copy of that CD, email me and I can send you the necessary files. Dan ...

text-text
Wondering how what I input to my UTF-8 terminal gets passed along through my patched [1] trn ... Cyrillic: А Б В Г Д Е Ж З И Й К Л М Н О П а б в г д е ж з и й к л м н о п IPA: ᴀ ᴁ ᴂ ᴃ ᴄ ᴅ ᴆ ᴇ ᴈ ᴉ ᴊ ᴋ ᴌ ᴍ ᴎ ᴏ ɀ Ɂ ɂ Ƀ Ʉ Ʌ Ɇ ɇ Ɉ ɉ Ɋ ɋ Ɍ ɍ Ɏ ɏ [1] https://groups.google.com/d/msg/comp.sys.raspberry-pi/7Z37Hdrm0DM/6aqD-reXFzAJ ...

TeX-Interpreter for static text(GUI)!
Hello everybody! I've got the problem that when I type LaTeX-orders like V_{DS} or $V_{DS} $ a.s.o. as strings in static text, this orders are not converted. How can I manage, that my LaTeX-orders are interpreted! Thank you very much! Thomas ...

Tex?
From a mail Aaron Conners sent to the people over at UnofficialTexMurphy.com "Here's a little tidbit of hope you can pass along (I just found this out today): Microsoft no longer owns the rights to Tex Murphy! (This is a good thing.) Also, you can let the faithful know that I'm back in the game design business...officially. I can't yet reveal who I'm working for or what I'm working on, but I've taken a position as a "producer" on a project and am in charge of all the story, art, dialogue, etc. It's not the type of game we'd all p...

change text color with TeX support?
All Consider the string involving greek letters to appear in a plot title made with the command: SetaEL='\fontsize{14}{\eta}\fontsize{10}EL\fontsize{10}=' when used in a title argument, the string SetaEL plots like: etaEL= except that eta will be the actual greek letter of course. This works! BUT THE COLOR ID DEFAULT IS BLACK. THE QUESTION: How to change my SetaEL command useing TeX syntax, so it is say red? Thanks in advance....tony Could you be a little more specific? If you want the whole title to be in red (or any other color), I don't think you need to...

TeX live format generation question
I would like to add some custom formats to my MacTeX 2008 (TeX Live) installation[1]. What is the approved method for doing so? I would like to add my formats to `the setup' so that when I ask for all formats to be generated using tlmgr -gui, I get mine as well as all the standard formats. I have failed to find out what it is tlmgr does when you press the `Re-create all formats' button. Thank you, Rowland. [1] My current method is awkward, and I have got the impression that TeX Live supplies a more convenient method but I can't find out about it. E.g., I perform the following incantation (as instructed by someone on the TeX on MacOS X mailing list, IIRC): sudo -H fmtutil-sys --all --cnffile /Users/Shared/texmf.rjmm/web2c/fmtutilviii.cnf having added this to fmtutilviii.cnf (being a copy of the stock fmtutil.cnf file): ----------------------------------------------------------------- pdfrmlatex pdftex language.dat -translate-file=cp227.tcx *pdfrmlatexviii.ini ----------------------------------------------------------------- Then put this file pdfrmlatexviii.ini on the search path: ====================================================================== % Thomas Esser, 1998. public domain. % RJMM mods 2009-07-21 % \ifx\pdfoutput\undefined \else \ifx\pdfoutput\relax \else % % We're building the latex format with the pdfetex engine (started 2004). \input pdftexconfig \pdfoutput=0 % % pdfTeX related primitives are no lon...

text + text
What is "text + text" supposed to do right now? It doesn't seem very useful to me. What about making "text + text" as an equivalent for "text || text"? Most strongly-typed programming languages do this. And MS SQL Server too, I think (CMIIW). -- dave ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org Am Freitag, 8. Oktober 2004 12:57 schrieb David Garamond: > What is "text + text" supposed to do right now? Nothing. > What about making "text + text" as an equivalent for "text > || text"? Most strongly-typed programming languages do this. And MS SQL > Server too, I think (CMIIW). What would this gain except for bloat? It's not like SQL is utterly compatible with any programming language; users will still have to learn all the operators anyway. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match Peter Eisentraut wrote: >>What is "text + text" supposed to do right now? > > Nothing. Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly, the current behaviour is quite strange to me. ------------------ =...

TeX++ ??
Has anything new happened to Kaspar Peeters' C++ implementation of TeX? The page http://www.damtp.cam.ac.uk/user/kp229/tex++/#new apparently has not been updated since 2002. -- Juergen -- Juergen Koslowski If I don't see you no more on this world ITI, TU Braunschweig I'll meet you on the next one koslowj@iti.cs.tu-bs.de and don't be late! http://www.iti.cs.tu-bs.de/~koslowj Jimi Hendrix (Voodoo Child, SR) "J�rgen Koslowski" <koslowj@iti.cs.tu-bs.de> wrote in message news:cl2thc$489$1@rzcomm2.rz.tu-bs.de... > Has anything new happened to Kaspar Peeters' C++ implementation of TeX? > The page http://www.damtp.cam.ac.uk/user/kp229/tex++/#new apparently has > not been updated since 2002. I met Kaspar once or twice, when we were both in Cambridge. He wrote about his work that it (see above): > has a number of interesting new features which make it possible to > use TeX as a typesetting engine for a web browser. This can be done with TeX as it is (at least on *nix), by running TeX as a daemon. For more details, see my TeX daemon project: http://sourceforge.net/projects/texd Hope this helps. Jonathan -- Jonathan Fine The Open University, Milton Keynes, England ...

free TeX-aware text editor for Windows
Syn http://syn.sourceforge.net/ Hadn't seen this noted here previously and it's not listed at http://home.nexgo.de/itsfd/texwin.htm (just sent them a note on that). Doesn't support handwriting recognition on my pen slate (still using WinTeXShell for that), but otherwise very serviceable. William -- William Adams http://members.aol.com/willadams Sphinx of black quartz, judge my vow. willadams@aol.com (William F. Adams) wrote in message news:<20040214144824.18962.00002250@mb-m28.aol.com>... > Syn > > http://syn.sourceforge.net/ > > Hadn't seen this n...

Convert TeX to normal text (stripping macros)
Hi all, Does anyone know a good way to strip a TeX file from its macros in order to run grammar checking from LangauageTool on it? Please also see this bug report for Language Tool: https://sourceforge.net/tracker/index.php?func=detail&aid=2880449&group_id=110216&atid=655717 A Java implementation would be preferred since Language Tool is in Java so it runs platform independently. Thanks, Pander On Mon, 26 Sep 2011 03:39:01 -0700 (PDT), Pander wrote: > Does anyone know a good way to strip a TeX file from its macros I suggest you use one of the tools that convert from dvi/postscript/pdf to text: dvi2tty pstotext pdftotext That is, analyze the output, not the input to (La)TeX. Bob T. ...

using TeX characters in a GUI text box
I am trying to use a TeX character such as the Greek letter mu in a GUI textbox, but I cannot get this to work. If I try to set the 'string' property for the GUI object using '\mu' this just displays '\mu'. Is there a way I can use the 'text' command as you would for a figure to put Greek letters into GUI objects? "Sean Larkin" <slarkin71278@sbcglobal.net> wrote in message <gk37he$t7$1@fred.mathworks.com>... > Is there a way I can put Greek letters into GUI objects? I don't know for sure, but you might be able to do this using ...

HELP: Need text output for a .tex document
I have a simple document here (actually a Resume) for which I need to get a TEXT equivalent of the output (rather than the normal dvi -> Postscript). It is of type article and doesnt do anything exciting, just uses things like center and the list environment. Im sure that this is possible, its just been SO long since I had to do anything like this. Please, someone, how do I do this. -- Reg.Clemens reg@dwf.com Reg Clemens wrote: > I have a simple document here (actually a Resume) for which I need to > get a TEXT equivalent of the output (rather than the normal dvi -> Postscript). > > It is of type article and doesnt do anything exciting, just uses things like > center and the list environment. > > Im sure that this is possible, its just been SO long since I had to > do anything like this. > > Please, someone, how do I do this. > convert to ps/pdf and extract the text using gsview/acrobat. note, you'll probably need to do some manual corrections. On Fri, 8 Oct 2004, Reg Clemens wrote: > I have a simple document here (actually a Resume) for which I need to > get a TEXT equivalent of the output (rather than the normal dvi -> > Postscript). > > It is of type article and doesnt do anything exciting, just uses things > like center and the list environment. > > Im sure that this is possible, its just b...

Web resources about - setting TeX text variable depending on keyval-generated param? (low-level TeX question) - comp.text.tex

Resources last updated: 3/11/2016 12:27:26 PM