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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I seem to have run into an impassable issue that I need help solving, and I am 100% aware that this is impossible just pure LaTeX but I wish it was. So onto the question at hand.

I am wanting to build a table of images, in this case they are eps's of 11,251 kanji. now from the start I looked into how to loop files in LaTex, as I did not want to manually type in all 11,251. And found out that without any help from a shell script its impossible, so I cobbled together this

for f in *.eps; do echo "\includegraphics[scale=0.25]{./Reference/kanji/eps/$f}" >> ../eps.list; done

It was just for a start and it worked amazingly, the only issue now is that LaTeX is not playing nice with that list. it throws errors such as Number too big ...=0.25]{./Reference/kanji/eps/0002e.svg.eps} and Dimension too large ...=0.25]{./Reference/kanji/eps/0002e.svg.eps} they are only 512x512 so Im assuming that means the bounding box is too big, As a note on the eps' they where converted from SVG's with the following script

for f in *.svg; do inkscape -f $f -D -E $f.eps -z; done

And it only took about 58 minutes to run so my life could be worse. The main thing that i am asking assistance with is how to generate the table. it would need be 6 columns across by N rows down and fill the slots sequentially, that I have no idea about how to go about, so if you would be so kind as to assist me in that.

Another issue that i might as well bring up is that i seem to be having mountains of trouble with the CJK package, after several hours of looking here and elsewhere I have completed the fonts and rebuilt the font DB updated everything and it still dies with Undefined control sequence 縲梧律 and a metric nut ton of Undefined control sequence 縲梧律 Errors, the Main file looks like so

\newcommand{\bookversion}{v0.0 REV 0}

As mentioned before I am at a loss on multiple ends, my apologies for the huge wall of text and I thank you for any and all help.

share|improve this question
up vote 2 down vote accepted

Well it's hard to know where to start.

You say you think the boundingbox is too big. I assume they are all the same, what is the %%BoundingBox line in the EPS (and are they all the same?)

It could (I think) be that you are just generating a line that is too long. You appear to be making a list of \includegraphics{} commands 11251 long with no commands in between. To TeX an included graphic is basically like a letter and so it is like going


with one very long non-breakable line.

Modify your shell script to write

for f in *.eps; do echo "\do\includegraphics[scale=0.25]{./Reference/kanji/eps/$f}" >> ../eps.list; done

so now you have \do in front of each.

If you say \let\do\par before including the image list each image will be in its own paragraph, which is much lighter on TeX memory. That isn't the layout you want but it is a good test to see if the errors change in that case.

To get six images in a row you can define


\advance\imgcount 1 

That would put a space between each image and start a new paragraph every 6 (vertical alignment would be automatic as they are all the same size so you don't need a table construct.

share|improve this answer

Your Answer


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.