以最有效的方式制作一份包含大量几乎相同页面的文档

以最有效的方式制作一份包含大量几乎相同页面的文档

我想制作一个包含一页的文档,该文档必须重复 10000 次。每重复一页,页面上都会添加一个唯一的编号(我不会在 MWE 中显示它,因为这不是我的问题)。

因此,我看到有两种方法:创建一个\makepage生成页面的命令,然后执行

\foreach\AA in{1,...,10000}{
    \makepage
    \newpage
}

或者制作单页 pdf 然后

\foreach\AA in{1,...,10000}{
    \includepdf{page.pdf}
}

当然,第二个更快(451 秒 vs 279 秒),但时间并不重要。我想减少pdf 的大小(第二个较小:32356 KB vs 1905 KB -- 差别很大),另外我也不想遇到Tex capacity exceeded

问题是:我能否从规模上让这个过程更加有效?笔记:我必须使用 LuaLaTeX。

更新:第一种方法(多次复制同一个页面)生成了 50000 个页面,没有崩溃,而第二种方法在生成 15000 个页面时崩溃,Tex capcity exceeded

数学家协会

page.tex带有巨大且醒目的图片和 Debian 徽标

\documentclass{article}

\usepackage{geometry}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing}
\usepackage{mathtools}
\usetikzlibrary{shapes,calc}
\usepackage{ifpdf}

\geometry{margin=0.5cm}

\setlength{\parindent}{0pt}
    \definecolor{cd60952}{RGB}{214,9,82}
\newcommand{\makepage}{
    \includegraphics[width=\textwidth]{1200.jpg}
    \lipsum[1]

    \resizebox{\textwidth}{8cm}{
    \begin{tikzpicture}[y=0.80pt,x=0.80pt,yscale=-1, inner sep=0pt, outer sep=0pt]
    \path[fill=cd60952] (93.3195,230.9447) .. controls (59.0303,225.9343) and
      (31.1801,199.9495) .. (15.3715,170.2215) .. controls (5.5821,151.9201) and
      (1.0492,131.0592) .. (2.0713,110.3467) .. controls (2.9610,99.6354) and
      (-0.0316,88.4491) .. (3.6168,78.1309) .. controls (6.5315,67.3276) and
      (11.4331,57.5607) .. (18.0741,49.0323) .. controls (22.8424,36.3018) and
      (33.0142,26.6294) .. (43.3849,18.3207) .. controls (51.2637,15.0948) and
      (58.7196,8.4670) .. (67.3399,5.6708) .. controls (73.0270,2.1030) and
      (86.2192,-0.8740) .. (89.3376,0.7517) .. controls (87.1714,3.1299) and
      (96.8246,1.5167) .. (97.2769,4.1226) .. controls (107.4188,3.5384) and
      (115.9073,1.2904) .. (125.1827,6.6191) .. controls (130.1554,7.5866) and
      (134.4480,12.7054) .. (139.6428,10.2061) .. controls (146.0329,9.0034) and
      (150.3844,18.7601) .. (153.4049,15.9781) .. controls (167.0146,25.0067) and
      (179.0895,38.0628) .. (183.8766,53.8550) .. controls (180.8933,56.9429) and
      (186.6577,70.4714) .. (181.7816,59.7076) .. controls (180.8871,49.0368) and
      (168.0386,56.5647) .. (177.2058,61.0368) .. controls (179.2498,65.0404) and
      (182.0841,75.4132) .. (177.7802,71.7036) .. controls (180.1689,78.0221) and
      (180.9576,84.7644) .. (181.6522,89.9051) .. controls (179.1588,98.4216) and
      (176.1557,101.9826) .. (173.6042,111.8841) .. controls (170.9595,115.2866) and
      (171.0389,123.7597) .. (166.8992,120.5686) .. controls (165.2312,131.1547) and
      (155.5965,133.9765) .. (147.0796,141.2926) .. controls (132.2241,150.3707) and
      (112.9512,151.3272) .. (97.0139,144.6226) .. controls (84.6896,134.9490) and
      (70.7373,122.6945) .. (71.4998,105.4775) .. controls (70.3035,95.6431) and
      (74.2758,85.9523) .. (80.1058,78.2380) .. controls (88.0500,64.3879) and
      (106.9185,57.9312) .. (121.3004,65.4772) .. controls (125.4446,66.6683) and
      (135.3869,75.8586) .. (125.6405,70.0166) .. controls (107.1390,60.8500) and
      (82.4175,73.0004) .. (78.4654,93.3286) .. controls (76.0174,103.5799) and
      (80.0184,114.3881) .. (84.8167,123.4648) .. controls (93.9795,138.1966) and
      (113.4423,146.7081) .. (130.0863,140.0509) .. controls (139.2098,136.5960) and
      (146.4827,132.8242) .. (153.8322,125.8050) .. controls (158.6678,121.0523) and
      (159.0520,114.5674) .. (163.7343,109.5653) .. controls (167.1049,100.0360) and
      (164.7856,89.6203) .. (165.4952,79.5371) .. controls (164.0280,57.0736) and
      (149.4942,35.8534) .. (129.2629,26.0379) .. controls (115.1366,19.7678) and
      (99.0343,20.6064) .. (84.0979,22.4500) .. controls (80.5464,24.0798) and
      (67.4651,29.1244) .. (69.5458,30.0952) .. controls (72.5853,31.9093) and
      (56.7456,31.7609) .. (54.7847,36.8147) .. controls (50.3008,39.5539) and
      (57.4995,40.3709) .. (50.0780,41.5699) .. controls (38.7079,46.8575) and
      (29.9921,56.8048) .. (22.7900,66.8497) .. controls (24.2223,74.7738) and
      (14.2196,82.5255) .. (15.2267,91.6025) .. controls (14.1505,104.8645) and
      (11.1105,118.9822) .. (16.2776,131.6949) .. controls (15.8162,141.4332) and
      (19.5505,151.1444) .. (28.7610,155.2116) .. controls (30.8205,158.2024) and
      (33.8190,164.2180) .. (28.6238,161.1753) .. controls (32.7528,168.8945) and
      (34.4245,176.2610) .. (38.7270,183.6412) .. controls (45.0741,189.2992) and
      (47.5361,199.7078) .. (55.4974,202.5513) .. controls (63.5448,208.0481) and
      (63.3757,214.0812) .. (72.5802,217.5521) .. controls (79.7480,217.8771) and
      (85.3707,228.8788) .. (94.9911,228.7819) .. controls (100.7223,229.5682) and
      (108.6001,231.6152) .. (98.2271,231.1305) .. controls (96.5907,231.1102) and
      (94.9496,231.1072) .. (93.3195,230.9447) -- cycle(109.3652,153.7333) ..
      controls (96.4622,150.5469) and (82.9305,143.6407) .. (76.0433,131.9692) ..
      controls (79.5521,134.7556) and (88.1011,145.5911) .. (85.2368,139.0080) ..
      controls (93.3693,144.5154) and (101.6217,150.7951) .. (111.5236,152.3574) ..
      controls (116.2089,152.7513) and (130.2176,153.5790) .. (117.6684,154.3630) ..
      controls (114.8884,154.4545) and (112.0843,154.3802) .. (109.3652,153.7333) --
      cycle(74.3902,136.2898) .. controls (70.9933,133.9581) and (67.6115,123.2929)
      .. (72.5676,131.3425) .. controls (72.9289,132.3219) and (79.0347,140.7760) ..
      (74.3902,136.2898) -- cycle(75.3359,126.6654) .. controls (74.7471,124.0079)
      and (76.8271,128.4288) .. (75.3359,126.6654) -- cycle(113.5388,123.1048) ..
      controls (105.3566,120.3225) and (128.7758,120.8069) .. (116.9857,123.7831) --
      (115.4446,123.6429) -- (113.5388,123.1048) -- (113.5388,123.1048) --
      cycle(132.1116,115.1364) .. controls (132.2953,111.7123) and
      (137.6293,113.8487) .. (132.1116,115.1364) -- cycle(139.1412,95.2606) ..
      controls (137.7252,89.2646) and (142.7469,94.5535) .. (139.6272,96.2902) --
      (139.1412,95.2606) -- cycle(0.0872,71.0995) .. controls (-0.2143,65.5523) and
      (4.4217,66.0913) .. (0.0872,71.0995) -- cycle(5.9486,51.8358) .. controls
      (8.5268,42.0593) and (8.4517,55.9487) .. (5.9486,51.8358) --
      cycle(101.3758,1.5022) .. controls (104.1751,0.8687) and (101.0824,2.7449) ..
      (101.3758,1.5022) -- cycle;

    \end{tikzpicture}
    }
}

\begin{document}

    \makepage

\end{document}

manypages.tex使用第一种方法

\documentclass{article}

\usepackage{geometry}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing}
\usepackage{mathtools}
\usetikzlibrary{shapes,calc}
\usepackage{ifpdf}

\geometry{margin=0.5cm}

\setlength{\parindent}{0pt}
    \definecolor{cd60952}{RGB}{214,9,82}
\newcommand{\makepage}{
    \includegraphics[width=\textwidth]{1200.jpg}
    \lipsum[1]

    \resizebox{\textwidth}{8cm}{
    \begin{tikzpicture}[y=0.80pt,x=0.80pt,yscale=-1, inner sep=0pt, outer sep=0pt]
    \path[fill=cd60952] (93.3195,230.9447) .. controls (59.0303,225.9343) and
      (31.1801,199.9495) .. (15.3715,170.2215) .. controls (5.5821,151.9201) and
      (1.0492,131.0592) .. (2.0713,110.3467) .. controls (2.9610,99.6354) and
      (-0.0316,88.4491) .. (3.6168,78.1309) .. controls (6.5315,67.3276) and
      (11.4331,57.5607) .. (18.0741,49.0323) .. controls (22.8424,36.3018) and
      (33.0142,26.6294) .. (43.3849,18.3207) .. controls (51.2637,15.0948) and
      (58.7196,8.4670) .. (67.3399,5.6708) .. controls (73.0270,2.1030) and
      (86.2192,-0.8740) .. (89.3376,0.7517) .. controls (87.1714,3.1299) and
      (96.8246,1.5167) .. (97.2769,4.1226) .. controls (107.4188,3.5384) and
      (115.9073,1.2904) .. (125.1827,6.6191) .. controls (130.1554,7.5866) and
      (134.4480,12.7054) .. (139.6428,10.2061) .. controls (146.0329,9.0034) and
      (150.3844,18.7601) .. (153.4049,15.9781) .. controls (167.0146,25.0067) and
      (179.0895,38.0628) .. (183.8766,53.8550) .. controls (180.8933,56.9429) and
      (186.6577,70.4714) .. (181.7816,59.7076) .. controls (180.8871,49.0368) and
      (168.0386,56.5647) .. (177.2058,61.0368) .. controls (179.2498,65.0404) and
      (182.0841,75.4132) .. (177.7802,71.7036) .. controls (180.1689,78.0221) and
      (180.9576,84.7644) .. (181.6522,89.9051) .. controls (179.1588,98.4216) and
      (176.1557,101.9826) .. (173.6042,111.8841) .. controls (170.9595,115.2866) and
      (171.0389,123.7597) .. (166.8992,120.5686) .. controls (165.2312,131.1547) and
      (155.5965,133.9765) .. (147.0796,141.2926) .. controls (132.2241,150.3707) and
      (112.9512,151.3272) .. (97.0139,144.6226) .. controls (84.6896,134.9490) and
      (70.7373,122.6945) .. (71.4998,105.4775) .. controls (70.3035,95.6431) and
      (74.2758,85.9523) .. (80.1058,78.2380) .. controls (88.0500,64.3879) and
      (106.9185,57.9312) .. (121.3004,65.4772) .. controls (125.4446,66.6683) and
      (135.3869,75.8586) .. (125.6405,70.0166) .. controls (107.1390,60.8500) and
      (82.4175,73.0004) .. (78.4654,93.3286) .. controls (76.0174,103.5799) and
      (80.0184,114.3881) .. (84.8167,123.4648) .. controls (93.9795,138.1966) and
      (113.4423,146.7081) .. (130.0863,140.0509) .. controls (139.2098,136.5960) and
      (146.4827,132.8242) .. (153.8322,125.8050) .. controls (158.6678,121.0523) and
      (159.0520,114.5674) .. (163.7343,109.5653) .. controls (167.1049,100.0360) and
      (164.7856,89.6203) .. (165.4952,79.5371) .. controls (164.0280,57.0736) and
      (149.4942,35.8534) .. (129.2629,26.0379) .. controls (115.1366,19.7678) and
      (99.0343,20.6064) .. (84.0979,22.4500) .. controls (80.5464,24.0798) and
      (67.4651,29.1244) .. (69.5458,30.0952) .. controls (72.5853,31.9093) and
      (56.7456,31.7609) .. (54.7847,36.8147) .. controls (50.3008,39.5539) and
      (57.4995,40.3709) .. (50.0780,41.5699) .. controls (38.7079,46.8575) and
      (29.9921,56.8048) .. (22.7900,66.8497) .. controls (24.2223,74.7738) and
      (14.2196,82.5255) .. (15.2267,91.6025) .. controls (14.1505,104.8645) and
      (11.1105,118.9822) .. (16.2776,131.6949) .. controls (15.8162,141.4332) and
      (19.5505,151.1444) .. (28.7610,155.2116) .. controls (30.8205,158.2024) and
      (33.8190,164.2180) .. (28.6238,161.1753) .. controls (32.7528,168.8945) and
      (34.4245,176.2610) .. (38.7270,183.6412) .. controls (45.0741,189.2992) and
      (47.5361,199.7078) .. (55.4974,202.5513) .. controls (63.5448,208.0481) and
      (63.3757,214.0812) .. (72.5802,217.5521) .. controls (79.7480,217.8771) and
      (85.3707,228.8788) .. (94.9911,228.7819) .. controls (100.7223,229.5682) and
      (108.6001,231.6152) .. (98.2271,231.1305) .. controls (96.5907,231.1102) and
      (94.9496,231.1072) .. (93.3195,230.9447) -- cycle(109.3652,153.7333) ..
      controls (96.4622,150.5469) and (82.9305,143.6407) .. (76.0433,131.9692) ..
      controls (79.5521,134.7556) and (88.1011,145.5911) .. (85.2368,139.0080) ..
      controls (93.3693,144.5154) and (101.6217,150.7951) .. (111.5236,152.3574) ..
      controls (116.2089,152.7513) and (130.2176,153.5790) .. (117.6684,154.3630) ..
      controls (114.8884,154.4545) and (112.0843,154.3802) .. (109.3652,153.7333) --
      cycle(74.3902,136.2898) .. controls (70.9933,133.9581) and (67.6115,123.2929)
      .. (72.5676,131.3425) .. controls (72.9289,132.3219) and (79.0347,140.7760) ..
      (74.3902,136.2898) -- cycle(75.3359,126.6654) .. controls (74.7471,124.0079)
      and (76.8271,128.4288) .. (75.3359,126.6654) -- cycle(113.5388,123.1048) ..
      controls (105.3566,120.3225) and (128.7758,120.8069) .. (116.9857,123.7831) --
      (115.4446,123.6429) -- (113.5388,123.1048) -- (113.5388,123.1048) --
      cycle(132.1116,115.1364) .. controls (132.2953,111.7123) and
      (137.6293,113.8487) .. (132.1116,115.1364) -- cycle(139.1412,95.2606) ..
      controls (137.7252,89.2646) and (142.7469,94.5535) .. (139.6272,96.2902) --
      (139.1412,95.2606) -- cycle(0.0872,71.0995) .. controls (-0.2143,65.5523) and
      (4.4217,66.0913) .. (0.0872,71.0995) -- cycle(5.9486,51.8358) .. controls
      (8.5268,42.0593) and (8.4517,55.9487) .. (5.9486,51.8358) --
      cycle(101.3758,1.5022) .. controls (104.1751,0.8687) and (101.0824,2.7449) ..
      (101.3758,1.5022) -- cycle;

    \end{tikzpicture}
    }
}

\begin{document}

    \foreach\AA in{1,...,10000}{
        \makepage
        \newpage
    }

\end{document}

include.tex第二种方法

\documentclass{article}

\usepackage{tikz}
\usepackage{pdfpages}

\begin{document}

    \foreach\AA in{1,...,10000}{
        \includepdf{page.pdf}
    }

\end{document}

答案1

xsavebox包可以用来进一步减少最终的PDF大小,并大大加速因素三十

xsavebox\includepdf使用与其底层 LuaTeX 原语类似的技术,\saveimageresource以便将内容封装一次以供重复使用。然而,xsavebox允许封装任何排版内容,而不仅仅是外部图形/文档页面,以避免多次包含。此外,可以避免使用双文件方法(原始帖子中的第二种方法)。

xsavebox提供\xsavebox/ ,其用法与标准 LaTeX /命令\xusebox对非常相似。\savebox\usebox

此外,这种方法似乎没有内存问题(TeX 容量)。

\usepackage{xsavebox}
\xsbox{MyPage}{\parbox{\textwidth}{\makepage}}

...

\foreach\AA in{1,...,10000}{
  \xusebox{MyPage}
  \newpage
}

完整示例, 基于manypages.tex

  • 11 秒 / 50 000 页(pdfLaTeX)

  • 22 秒 / 50 000 页(LuaLaTeX)


\documentclass{article}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{xsavebox}
\usepackage{multido}  %\foreach crashes on large loop number
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{geometry}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing}
\usepackage{mathtools}
\usetikzlibrary{shapes,calc}
\usepackage{ifpdf}

\geometry{margin=0.5cm}

\setlength{\parindent}{0pt}
    \definecolor{cd60952}{RGB}{214,9,82}
\newcommand{\makepage}{
    \includegraphics[width=\textwidth]{1200.jpg}
    \lipsum[1]

    \resizebox{\textwidth}{8cm}{
    \begin{tikzpicture}[y=0.80pt,x=0.80pt,yscale=-1, inner sep=0pt, outer sep=0pt]
    \path[fill=cd60952] (93.3195,230.9447) .. controls (59.0303,225.9343) and
      (31.1801,199.9495) .. (15.3715,170.2215) .. controls (5.5821,151.9201) and
      (1.0492,131.0592) .. (2.0713,110.3467) .. controls (2.9610,99.6354) and
      (-0.0316,88.4491) .. (3.6168,78.1309) .. controls (6.5315,67.3276) and
      (11.4331,57.5607) .. (18.0741,49.0323) .. controls (22.8424,36.3018) and
      (33.0142,26.6294) .. (43.3849,18.3207) .. controls (51.2637,15.0948) and
      (58.7196,8.4670) .. (67.3399,5.6708) .. controls (73.0270,2.1030) and
      (86.2192,-0.8740) .. (89.3376,0.7517) .. controls (87.1714,3.1299) and
      (96.8246,1.5167) .. (97.2769,4.1226) .. controls (107.4188,3.5384) and
      (115.9073,1.2904) .. (125.1827,6.6191) .. controls (130.1554,7.5866) and
      (134.4480,12.7054) .. (139.6428,10.2061) .. controls (146.0329,9.0034) and
      (150.3844,18.7601) .. (153.4049,15.9781) .. controls (167.0146,25.0067) and
      (179.0895,38.0628) .. (183.8766,53.8550) .. controls (180.8933,56.9429) and
      (186.6577,70.4714) .. (181.7816,59.7076) .. controls (180.8871,49.0368) and
      (168.0386,56.5647) .. (177.2058,61.0368) .. controls (179.2498,65.0404) and
      (182.0841,75.4132) .. (177.7802,71.7036) .. controls (180.1689,78.0221) and
      (180.9576,84.7644) .. (181.6522,89.9051) .. controls (179.1588,98.4216) and
      (176.1557,101.9826) .. (173.6042,111.8841) .. controls (170.9595,115.2866) and
      (171.0389,123.7597) .. (166.8992,120.5686) .. controls (165.2312,131.1547) and
      (155.5965,133.9765) .. (147.0796,141.2926) .. controls (132.2241,150.3707) and
      (112.9512,151.3272) .. (97.0139,144.6226) .. controls (84.6896,134.9490) and
      (70.7373,122.6945) .. (71.4998,105.4775) .. controls (70.3035,95.6431) and
      (74.2758,85.9523) .. (80.1058,78.2380) .. controls (88.0500,64.3879) and
      (106.9185,57.9312) .. (121.3004,65.4772) .. controls (125.4446,66.6683) and
      (135.3869,75.8586) .. (125.6405,70.0166) .. controls (107.1390,60.8500) and
      (82.4175,73.0004) .. (78.4654,93.3286) .. controls (76.0174,103.5799) and
      (80.0184,114.3881) .. (84.8167,123.4648) .. controls (93.9795,138.1966) and
      (113.4423,146.7081) .. (130.0863,140.0509) .. controls (139.2098,136.5960) and
      (146.4827,132.8242) .. (153.8322,125.8050) .. controls (158.6678,121.0523) and
      (159.0520,114.5674) .. (163.7343,109.5653) .. controls (167.1049,100.0360) and
      (164.7856,89.6203) .. (165.4952,79.5371) .. controls (164.0280,57.0736) and
      (149.4942,35.8534) .. (129.2629,26.0379) .. controls (115.1366,19.7678) and
      (99.0343,20.6064) .. (84.0979,22.4500) .. controls (80.5464,24.0798) and
      (67.4651,29.1244) .. (69.5458,30.0952) .. controls (72.5853,31.9093) and
      (56.7456,31.7609) .. (54.7847,36.8147) .. controls (50.3008,39.5539) and
      (57.4995,40.3709) .. (50.0780,41.5699) .. controls (38.7079,46.8575) and
      (29.9921,56.8048) .. (22.7900,66.8497) .. controls (24.2223,74.7738) and
      (14.2196,82.5255) .. (15.2267,91.6025) .. controls (14.1505,104.8645) and
      (11.1105,118.9822) .. (16.2776,131.6949) .. controls (15.8162,141.4332) and
      (19.5505,151.1444) .. (28.7610,155.2116) .. controls (30.8205,158.2024) and
      (33.8190,164.2180) .. (28.6238,161.1753) .. controls (32.7528,168.8945) and
      (34.4245,176.2610) .. (38.7270,183.6412) .. controls (45.0741,189.2992) and
      (47.5361,199.7078) .. (55.4974,202.5513) .. controls (63.5448,208.0481) and
      (63.3757,214.0812) .. (72.5802,217.5521) .. controls (79.7480,217.8771) and
      (85.3707,228.8788) .. (94.9911,228.7819) .. controls (100.7223,229.5682) and
      (108.6001,231.6152) .. (98.2271,231.1305) .. controls (96.5907,231.1102) and
      (94.9496,231.1072) .. (93.3195,230.9447) -- cycle(109.3652,153.7333) ..
      controls (96.4622,150.5469) and (82.9305,143.6407) .. (76.0433,131.9692) ..
      controls (79.5521,134.7556) and (88.1011,145.5911) .. (85.2368,139.0080) ..
      controls (93.3693,144.5154) and (101.6217,150.7951) .. (111.5236,152.3574) ..
      controls (116.2089,152.7513) and (130.2176,153.5790) .. (117.6684,154.3630) ..
      controls (114.8884,154.4545) and (112.0843,154.3802) .. (109.3652,153.7333) --
      cycle(74.3902,136.2898) .. controls (70.9933,133.9581) and (67.6115,123.2929)
      .. (72.5676,131.3425) .. controls (72.9289,132.3219) and (79.0347,140.7760) ..
      (74.3902,136.2898) -- cycle(75.3359,126.6654) .. controls (74.7471,124.0079)
      and (76.8271,128.4288) .. (75.3359,126.6654) -- cycle(113.5388,123.1048) ..
      controls (105.3566,120.3225) and (128.7758,120.8069) .. (116.9857,123.7831) --
      (115.4446,123.6429) -- (113.5388,123.1048) -- (113.5388,123.1048) --
      cycle(132.1116,115.1364) .. controls (132.2953,111.7123) and
      (137.6293,113.8487) .. (132.1116,115.1364) -- cycle(139.1412,95.2606) ..
      controls (137.7252,89.2646) and (142.7469,94.5535) .. (139.6272,96.2902) --
      (139.1412,95.2606) -- cycle(0.0872,71.0995) .. controls (-0.2143,65.5523) and
      (4.4217,66.0913) .. (0.0872,71.0995) -- cycle(5.9486,51.8358) .. controls
      (8.5268,42.0593) and (8.4517,55.9487) .. (5.9486,51.8358) --
      cycle(101.3758,1.5022) .. controls (104.1751,0.8687) and (101.0824,2.7449) ..
      (101.3758,1.5022) -- cycle;

    \end{tikzpicture}
    }
}

\pagestyle{empty}

\xsbox{MyPage}{\parbox{\textwidth}{\makepage}}

\begin{document}

    %\foreach\AA in{1,...,50000}{ %crashes
    \multido{}{50000}{
      \xusebox{MyPage}
      \newpage
    }

\end{document}

相关内容