[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nested @ifset

From: Robert J. Chassell
Subject: nested @ifset
Date: Wed, 29 May 2002 12:02:48 -0400 (EDT)

How do I next @ifset commands?

My current Texinfo file consists of

  * a textual part written in English that produces the various
    Texinfo output formats (dvi, Info, HTML, plain text, and so on)
    when I set address@hidden mgp-file', and

  * a MagicPoint part that produces a full, working MagicPoint file.
    when I set address@hidden mgp-file'.

This arrangement means that I can more easily keep my MagicPoint file
in sync with its accompanying text.

However, a friend in Mexico is translating the text into Spanish.  I
want to put each Spanish paragraph next to its corresponding English

I would like to use address@hidden en' and address@hidden es' commands to
distinguish which paragraph is which, enabling me to print in one
language or the other or both.

At the same time, I would like to keep the MagicPoint part.  

However, as far as I can tell, using Texinfo 4.2, I cannot do this,
because I have to use address@hidden' commands around the sections that
contain the  address@hidden en' and address@hidden es' commands. 

Here is a test file that illustrates this:

\input texinfo.tex   @c -*-texinfo-*-
@comment %**start of header
@settitle  Nested Ifset Test File
@comment %**end of header

 ## Summary of shell commands to create various output formats:

    ## Info output
    makeinfo --force --fill-column=70 --no-split --paragraph-indent=0 \
    --verbose nested-ifset-test.texi

    ## DVI output
    texi2dvi nested-ifset-test.texi

    ## Plain text output
    makeinfo --fill-column=70 --no-split --paragraph-indent=0 \
    --verbose --no-headers --output=nested-ifset-test.txt  \

    ## HTML output
    makeinfo --no-split --html nested-ifset-test.texi

    ## DocBook output
    makeinfo --docbook --no-split --paragraph-indent=0 \
    --verbose nested-ifset-test.texi

    ## XML output
    makeinfo --xml --no-split --paragraph-indent=0 \
    --verbose nested-ifset-test.texi


 ## To create a MagicPoint .mgp file, change the set and clear commands below
    makeinfo --fill-column=70 --no-split --paragraph-indent=0 \
    --verbose --no-headers --output=nested-ifset-test.mgp  \

@end ignore

@c uncomment this for regular output: Info, HTML, printed
@c clear mgp
@c clear file-mgp

@c uncomment this for regular file with <<...>> in it,
@c  which mark where MagicPoint slides should be shown
@set mgp
@clear file-mgp

@c uncomment this to create file with MagicPoint slides
@c clear mgp
@c set file-mgp

Copyright @copyright{} 2002 Robert J. Chassell

This is a test document showing nexted @@ifset
@settitle  Nested Ifset Test File

Permission is granted to make and distribute verbatim
copies of this document provided the copyright notice and
this permission notice are preserved on all copies.

@c    The remainder of this paragraph applies to and should appear
@c    in the Texinfo source.
@c Permission is granted to process this file through TeX or
@c a Texinfo to HTML converter and publish the results,
@c provided the published document carries a copying permission
@c notice identical to this one except for the removal of this
@c paragraph (this paragraph not being relevant to the
@c published document).

Permission is granted to copy and distribute
translations of this document into another language,
under the above conditions for modified versions,
except that this permission notice may be stated in a
translation approved by the Free Software Foundation.
@end quotation
@end copying

@c For smallbook format, use smaller than normal amounts of
@c whitespace between chapters, sections, and paragraphs.
\global\chapheadingskip = 15pt plus 4pt minus 2pt
\global\secheadingskip = 12pt plus 3pt minus 2pt
\global\subsecheadingskip = 9pt plus 2pt minus 2pt \global\parskip 2pt plus 1pt
@end tex

@sp 6
@center @titlefont{Test document}
@sp 4
@center by Robert J. Chassell

@vskip 0pt plus 1filll
@end titlepage


@ifclear file-mgp

@node Top, Chapter One, (dir), (dir)
@top Test Top
@end ifnottex

* Chapter One::                 
* Chapter Two::                 
@end menu

@node Chapter One, Chapter Two, Top, Top
@comment node, next, prev, up
@chapter Chapter One

Contents of chapter 1.

The quick brown fox jumps over the lazy dog.

Here is an bulleted list:

@itemize @bullet

First item.

Second item.
@end itemize

@c ------------ begin ifset ------------
@ifset mgp
<<This is a title for an MGP file>>
@end ifset
@end ifclear
@ifset file-mgp
%%%%%%%%%%%%%%%% nested-ifset-test.mgp %%%%%%%%%%%%%%%%
%deffont "standard" xfont "helvetica-medium-r"
%deffont "thick" xfont "helvetica-bold-r"
%deffont "typewriter" xfont "courier-medium-r"
%default 1 leftfill, size 5, vgap 40, fore "white", back "black", font "thick"
%default 2 font "standard", vgap 40, prefix " "
%default 4 size 5, prefix " "
%tab 1 size 5, vgap 40, prefix "  ", icon box "green" 50
%tab 2 size 4, vgap 40, prefix "      ", icon arc "yellow" 50
%tab 3 size 3, vgap 40, prefix "            ", icon delta3 "white" 40
%% mgp -x vflib -g 850x900+350+30 /u/texinfo/nested-ifset-test.mgp

%center, bar "blue"

This is a title for an MGP file

%center, bar "blue"

%size 3
Robert J. Chassell

@end format
@end ifset
@ifclear file-mgp
@c ------------ end ifclear ------------

Contents of chapter 1.

The quick brown fox jumps over the lazy dog.

Here is an expression using the @code{@@math} command:

@math{(a + b)(a + b) = a^2 + 2ab + b^2}

@table @asis
@item Positive plate
PbO2 + H2SO4---> PbSO4 + H2 + O2

@item Negative plate
Pb + H2SO4---> PbSO4 + H2

@item Water
2H2 + O2 ---> 2H2O
@end table

@node Chapter Two,  , Chapter One, Top
@chapter Chapter Two

Contents of chapter 2
@cindex bar

The lazy dog opened an eye.

* Section TwoA::                
* Section TwoB::                
@end menu

@node Section TwoA, Section TwoB, Chapter Two, Chapter Two
@section SectionTwoA

Contents of Section 2A

@c ------------ begin ifset ------------
@ifset mgp
<<An empty MGP file segment>>
@end ifset
@end ifclear
@ifset file-mgp
%prefix "", leftfill

Header line

%prefix "    ", icon box "blue" 50
comment line
%prefix "    ", icon delta3 "green" 40
comment line
%prefix "    ", icon arc "yellow" 30
comment line

@end format
@end ifset
@ifclear file-mgp
@c ------------ end ifclear ------------

The quick brown fox jumps over the lazy dog.

(+ 2 2)
@end smallexample

@node Section TwoB,  , Section TwoA, Chapter Two
@section Section TwoB

Contents of Section 2B

The lazy dog jumps over the quick brown fox.

@end ifclear


reply via email to

[Prev in Thread] Current Thread [Next in Thread]