help-texinfo
[Top][All Lists]
Advanced

[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
paragraph.

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
@setfilename nested-ifset-test.info
@settitle  Nested Ifset Test File
@smallbook
@comment %**end of header

@ignore
 ## 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  \
    nested-ifset-test.texi

    ## 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  \
    nested-ifset-test.texi

@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

@copying
Copyright @copyright{} 2002 Robert J. Chassell

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

@quotation
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.
@tex
\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

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

@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage

@contents

@ifclear file-mgp

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


@menu
* 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

@item
First item.

@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
@format
%%%%%%%%%%%%%%%% 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
%page

%center, bar "blue"

This is a title for an MGP file

%center, bar "blue"

%size 3
Robert J. Chassell
bob@@gnu.org

http://www.gnu.org

http://www.rattlesnake.com
http://www.teak.cc

@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.


@menu
* 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
@format
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%prefix "", leftfill
%page

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.

@smallexample
(+ 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

@bye



reply via email to

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