Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a LaTeX file, which includes tons of other auto-generated LaTeX files containing TikZ figures. Suppose I want to make every \left( in the TikZ figure appear at the same, fixed size, say \Bigl(.

It's not impossible to change the auto-generator side, but I'd like to solve the problem on the side which includes the figures.

I tried

\def\includetikzfile{#1}{{\let\left\Bigl\input{#1.tikz}}}

but it quickly went to an infinite loop, exceeding the TeX capacity.

How can I do it?

share|improve this question

1 Answer 1

up vote 11 down vote accepted

It's easy to see where the loop comes from as \Bigr is defined in terms of \Big which is (by default)

\def\Big#1{{\hbox{$\left#1\vbox to11.5\p@{}\right.\n@space$}}}

so defined in terms of \left

It is probably safer just to do a replace/edit on the incoming file

If you wanted to do this in TeX you'd neeed

\let\oldleft\left
\let\oldright\right

and then redefine each of these

\def\big#1{{\hbox{$\left#1\vbox to8.5\p@{}\right.\n@space$}}}
\def\Big#1{{\hbox{$\left#1\vbox to11.5\p@{}\right.\n@space$}}}
\def\bigg#1{{\hbox{$\left#1\vbox to14.5\p@{}\right.\n@space$}}}
\def\Bigg#1{{\hbox{$\left#1\vbox to17.5\p@{}\right.\n@space$}}}

to use \oldleft and \oldright then you would be slightly safer to do

\let\left\Bigl
\let\right\Bigr

in your local redefinition, although there can still be cases that fail, notably as the \left and \right primitives do not scan for arguments the same way as macros like \Bigr so for example

$\left\delimiter"26A30C  \frac{a}{b} \right.$

is OK but if you replace \left with \Bigr you get

$\Bigl\delimiter"26A30C  \frac{a}{b} \Bigr.$

which produces

! Missing number, treated as zero.
<to be read again> 
                   \vbox 
l.11 $\Bigl\delimiter

as the argument to \Bigr is just the token \delimiter not the full delimiter specification.

share|improve this answer
    
Thanks for the ellaboration about drawbacks due to \left being primitive! –  yo' Nov 6 '12 at 21:54
    
Thanks! Is there a way to do the redefinition of \big etc automatically? I guess I should ask it as a separate question, as is customary in Stack Exchange... –  Yuji Nov 7 '12 at 8:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.