├── README.md └── 《Latex入门》配书案例 ├── 4-2-4.tex ├── 4-3-25.tex ├── 5-5-61.mp ├── 7-2-5.tex ├── 0-1.tex ├── 2-1-17.tex ├── 2-1-61.tex ├── 2-2-50.tex ├── 4-2-1.tex ├── 5-3-9.tex ├── 5-5-39.tex ├── 6-2-1.tex ├── 1-2-2.tex ├── 2-1-22.tex ├── 2-1-63.tex ├── 2-1-71.tex ├── 2-1-78.tex ├── 2-2-1.tex ├── 2-2-45.tex ├── 2-2-61.tex ├── 2-2-69.tex ├── 2-4-6.tex ├── 3-1-4.tex ├── 3-2-5.tex ├── 3-3-14.tex ├── 4-5-8.tex ├── 5-2-8.tex ├── 5-3-4.tex ├── 5-5-25.tex ├── 6-1-14.tex ├── 6-2-2.tex ├── 6-3-7.tex ├── 2-1-18.tex ├── 2-1-24.tex ├── 2-1-49.tex ├── 2-1-7.tex ├── 2-3-8.tex ├── 3-3-11.tex ├── 4-1-1.tex ├── 4-2-30.tex ├── 4-2-5.tex ├── 5-3-33.tex ├── 5-3-51.tex ├── 5-5-64.mp ├── 6-1-15.tex ├── 8-1-9.tex ├── 2-1-2.tex ├── 2-1-5.tex ├── 2-1-51.tex ├── 2-1-59.tex ├── 2-1-6.tex ├── 2-2-67.tex ├── 2-3-2.tex ├── 2-4-16.tex ├── 3-2-4.tex ├── 3-3-8.tex ├── 4-1-5.tex ├── 4-2-12.tex ├── 4-2-19.tex ├── 4-3-5.tex ├── 5-5-17.tex ├── 5-5-43.tex ├── 6-1-19.tex ├── 6-1-9.tex ├── 7-2-3.tex ├── 7-2-7.tex ├── 1-2-4.tex ├── 2-1-16.tex ├── 2-1-19.tex ├── 2-1-29.tex ├── 2-1-58.tex ├── 2-1-68.tex ├── 2-1-73.tex ├── 2-2-14.tex ├── 2-2-3.tex ├── 3-2-1.tex ├── 3-2-10.tex ├── 3-2-13.tex ├── 3-2-14.tex ├── 3-2-8.tex ├── 3-3-12.tex ├── 3-4-3.tex ├── 4-5-20.tex ├── 5-5-26.tex ├── 5-5-27.tex ├── 5-5-35.tex ├── 5-5-42.tex ├── 5-5-46.tex ├── 6-1-21.tex ├── 7-2-4.tex ├── 2-1-20.tex ├── 2-1-66.tex ├── 2-2-41.tex ├── 2-2-66.tex ├── 2-3-7.tex ├── 2-4-1.tex ├── 3-1-5.tex ├── 3-3-10.tex ├── 3-3-13.tex ├── 3-3-16.tex ├── 4-1-6.tex ├── 4-2-20.tex ├── 4-2-22.tex ├── 4-2-32.tex ├── 4-5-15.tex ├── 5-3-5.tex ├── 5-4-5.tex ├── 5-5-18.tex ├── 5-5-19.tex ├── 5-5-8.tex ├── 2-1-48.tex ├── 2-2-4.tex ├── 2-2-44.tex ├── 2-2-63.tex ├── 2-3-9.tex ├── 2-4-4.tex ├── 2-4-7.tex ├── 3-3-4.tex ├── 4-2-3.tex ├── 4-2-31.tex ├── 4-2-6.tex ├── 5-3-17.tex ├── 5-3-19.tex ├── 5-3-20.tex ├── 5-4-6.tex ├── 6-1-13.tex ├── 2-1-10.tex ├── 2-1-23.tex ├── 2-1-30.tex ├── 2-1-64.tex ├── 2-1-67.tex ├── 2-1-74.tex ├── 2-2-70.tex ├── 2-4-14.tex ├── 3-2-17.tex ├── 3-2-7.tex ├── 4-2-23.tex ├── 4-2-24.tex ├── 4-2-34.tex ├── 4-2-41.tex ├── 4-3-7.tex ├── 4-5-19.tex ├── 4-5-23.tex ├── 5-3-13.tex ├── 5-3-18.tex ├── 5-3-21.tex ├── 5-3-22.tex ├── 5-3-28.tex ├── 5-3-34.tex ├── 5-3-53.tex ├── 5-5-10.tex ├── 5-5-50.tex ├── 6-1-5.tex ├── 6-3-3.tex ├── 0-2.tex ├── 1-2-1.tex ├── 1-2-3.tex ├── 2-1-27.tex ├── 2-1-53.tex ├── 2-1-62.tex ├── 2-1-9.tex ├── 2-2-13.tex ├── 2-2-25.tex ├── 2-2-35.tex ├── 2-2-49.tex ├── 2-2-68.tex ├── 2-2-76.tex ├── 3-2-6.tex ├── 3-4-2.tex ├── 3-4-5.tex ├── 4-1-3.tex ├── 4-2-27.tex ├── 4-2-9.tex ├── 4-3-1.tex ├── 4-3-27.tex ├── 4-4-1.tex ├── 5-2-9.tex ├── 5-3-14.tex ├── 5-3-15.tex ├── 5-3-16.tex ├── 5-3-23.tex ├── 5-3-29.tex ├── 5-5-1.tex ├── 6-1-8.tex ├── 6-2-3.tex ├── 7-1-2.tex ├── 7-2-1.tex ├── 8-1-2.tex ├── 2-1-25.tex ├── 2-1-34.tex ├── 2-1-52.tex ├── 2-4-5.tex ├── 4-3-23.tex ├── 4-5-22.tex ├── 5-2-5.tex ├── 5-2-7.tex ├── 5-3-12.tex ├── 5-3-27.tex ├── 5-3-31.tex ├── 5-3-50.tex ├── 5-3-6.tex ├── 5-4-2.tex ├── 5-4-3.tex ├── 5-4-4.tex ├── 5-4-8.tex ├── 5-5-34.tex ├── 5-5-4.tex ├── 5-5-44.tex ├── 5-5-62.tex ├── 5-5-63.tex ├── 6-1-3.tex ├── 8-1-1.tex ├── 2-1-12.tex ├── 2-1-45.tex ├── 2-1-57.tex ├── 2-2-39.tex ├── 2-3-1.tex ├── 2-4-11.tex ├── 2-4-15.tex ├── 2-4-9.tex ├── 3-2-16.tex ├── 3-2-3.tex ├── 3-3-5.tex ├── 3-3-9.tex ├── 4-3-13.tex ├── 4-3-14.tex ├── 4-5-1.tex ├── 5-1-4.tex ├── 5-2-10.tex ├── 5-3-32.tex ├── 5-4-1.tex ├── 5-5-15.tex ├── 5-5-65.tex ├── 5-5-9.tex ├── 7-2-2.tex ├── 8-1-17.tex ├── 2-1-13.tex ├── 2-2-55.tex ├── 2-2-62.tex ├── 2-2-74.tex ├── 2-3-3.tex ├── 2-4-8.tex ├── 3-1-3.tex ├── 3-2-12.tex ├── 3-2-15.tex ├── 3-2-9.tex ├── 4-1-4.tex ├── 4-2-15.tex ├── 4-2-25.tex ├── 4-2-28.tex ├── 4-2-35.tex ├── 4-2-8.tex ├── 4-3-18.tex ├── 4-3-26.tex ├── 4-5-2.tex ├── 5-1-30.tex ├── 5-1-49.tex ├── 5-3-7.tex ├── 5-3-8.tex ├── 5-5-11.tex ├── 5-5-12.tex ├── 5-5-16.tex ├── 5-5-33.tex ├── 5-5-41.tex ├── 8-1-13.tex ├── 8-1-14.tex ├── 2-1-3.tex ├── 2-1-31.tex ├── 2-1-39.tex ├── 2-1-46.tex ├── 2-1-69.tex ├── 2-1-72.tex ├── 2-2-37.tex ├── 3-1-2.tex ├── 4-2-10.tex ├── 4-2-17.tex ├── 4-3-28.tex ├── 4-4-2.tex ├── 4-4-4.tex ├── 4-5-11.tex ├── 5-5-13.tex ├── 5-5-6.tex ├── 5-5-74.asy ├── 6-1-12.tex ├── 7-2-8.tex ├── 8-1-3.tex ├── 2-1-1.tex ├── 2-1-60.tex ├── 2-1-75.tex ├── 2-2-10.tex ├── 2-2-34.tex ├── 2-2-48.tex ├── 3-1-7.tex ├── 4-2-33.tex ├── 4-4-8.tex ├── 4-5-7.tex ├── 5-1-56.tex ├── 5-3-26.tex ├── 5-5-23.tex ├── 5-5-28.tex ├── 5-5-40.tex ├── 5-5-72.asy ├── 2-1-11.tex ├── 2-1-28.tex ├── 2-2-16.tex ├── 2-2-64.tex ├── 3-3-17.tex ├── 4-2-45.tex ├── 4-3-16.tex ├── 4-3-4.tex ├── 5-2-1.tex ├── 5-3-52.tex ├── 5-5-37.tex ├── 6-3-12.tex ├── 6-3-4.tex ├── 8-1-4.tex ├── gougu ├── gougu.pdf ├── logo.pdf ├── xiantu.pdf ├── gougu-slide.pdf ├── math.bib ├── logo.asy ├── xiantu.asy ├── gougu.tex └── gougu-slide.tex ├── 2-1-70.tex ├── 2-2-15.tex ├── 2-2-19.tex ├── 2-2-21.tex ├── 4-2-11.tex ├── 4-2-42.tex ├── 4-3-12.tex ├── 4-3-15.tex ├── 4-3-22.tex ├── 4-4-11.tex ├── 4-5-18.tex ├── 5-1-29.tex ├── 5-1-43.tex ├── 5-2-4.tex ├── 5-3-25.tex ├── 5-3-38.tex ├── 5-5-20.tex ├── 5-5-3.tex ├── 5-5-58.mp ├── 6-1-4.tex ├── 8-1-18.tex ├── gloss ├── testgls.pdf ├── MAKE-simplegloss.bat ├── testgls.gls ├── simplegloss.ist └── testgls.tex ├── 2-1-21.tex ├── 2-1-32.tex ├── 2-2-20.tex ├── 2-2-42.tex ├── 2-4-12.tex ├── 4-1-2.tex ├── 4-2-13.tex ├── 4-2-14.tex ├── 4-2-16.tex ├── 4-3-19.tex ├── 4-5-12.tex ├── 5-2-11.tex ├── 5-3-24.tex ├── 5-5-5.tex ├── 5-5-77.tex ├── 6-1-16.tex ├── 7-2-6.tex ├── 2-1-35.tex ├── 2-1-38.tex ├── 2-1-50.tex ├── 2-1-76.tex ├── 2-2-43.tex ├── 2-2-75.tex ├── 4-2-44.tex ├── 4-2-7.tex ├── 4-3-17.tex ├── 4-5-3.tex ├── 5-1-1.tex ├── 5-2-6.tex ├── 5-5-14.tex ├── 5-5-57.tex ├── 8-1-5.tex ├── 2-2-12.tex ├── 2-2-46.tex ├── 2-4-17.tex ├── 2-4-2.tex ├── 2-4-3.tex ├── 4-2-21.tex ├── 4-3-10.tex ├── 4-3-6.tex ├── 4-4-13.tex ├── 4-4-9.tex ├── 5-1-10.tex ├── 5-1-51.tex ├── 5-1-53.tex ├── 5-2-2.tex ├── 5-3-10.tex ├── 5-4-10.tex ├── 6-3-2.tex ├── 2-1-47.tex ├── 2-2-2.tex ├── 2-2-30.tex ├── 2-2-36.tex ├── 2-2-47.tex ├── 4-4-3.tex ├── 4-4-5.tex ├── 5-1-3.tex ├── 5-2-3.tex ├── 5-4-7.tex ├── 6-1-1.tex ├── 6-1-10.tex ├── 8-1-19.tex ├── 8-1-6.tex ├── 2-1-65.tex ├── 2-2-11.tex ├── 2-2-73.tex ├── 3-1-8.tex ├── 5-4-11.tex ├── 6-3-11.tex ├── 1-1-1.tex ├── 2-2-58.tex ├── 2-2-59.tex ├── 2-2-65.tex ├── 4-3-11.tex ├── 4-3-24.tex ├── 4-4-21.tex ├── 5-1-46.tex ├── 5-3-11.tex ├── 5-5-21.tex ├── 6-3-1.tex ├── 6-3-6.tex ├── 8-1-15.tex ├── 2-2-27.tex ├── 4-2-2.tex ├── 4-2-36.tex ├── 5-1-50.tex ├── 5-3-36.tex ├── 5-4-16.tex ├── 5-5-53.tex ├── 6-3-10.tex ├── 6-3-5.tex ├── 2-1-55.tex ├── 2-2-56.tex ├── 4-2-26.tex ├── 4-2-40.tex ├── 4-3-9.tex ├── 4-4-15.tex ├── 4-4-20.tex ├── 5-1-13.tex ├── 5-1-2.tex ├── 5-5-2.tex ├── 6-3-13.tex ├── 2-1-33.tex ├── 2-1-36.tex ├── 2-1-8.tex ├── 2-2-51.tex ├── 4-2-37.tex ├── 4-2-38.tex ├── 4-3-20.tex ├── 5-2-12.tex ├── 5-3-47.tex ├── 5-4-12.tex ├── 2-1-77.tex ├── 2-2-5.tex ├── 3-1-1.tex ├── 3-2-2.tex ├── 4-5-13.tex ├── 4-5-17.tex ├── 5-1-12.tex ├── 5-1-14.tex ├── 5-5-49.tex ├── 5-5-52.tex ├── 6-2-4.tex ├── 8-1-16.tex ├── 2-1-15.tex ├── 2-1-26.tex ├── 2-2-57.tex ├── 2-4-18.tex ├── 4-3-2.tex ├── 4-3-21.tex ├── 4-5-4.tex ├── 4-5-5.tex ├── 5-1-7.tex ├── 5-5-48.tex ├── 5-5-76.tex ├── 6-1-11.tex ├── 6-1-17.tex ├── 8-2-2.tex ├── 2-2-17.tex ├── 4-3-3.tex ├── 4-3-8.tex ├── 4-5-9.tex ├── 5-1-16.tex ├── 5-5-30.tex ├── 5-5-45.tex ├── 6-1-7.tex ├── 7-3-1.tex ├── 1-1-2.tex ├── 2-1-56.tex ├── 4-4-10.tex ├── 6-3-8.tex ├── 2-2-23.tex ├── 3-3-6.tex ├── 3-3-7.tex ├── 4-5-14.tex ├── 4-5-16.tex ├── 5-5-31.tex ├── 6-2-5.tex ├── 6-3-9.tex ├── 5-1-20.tex ├── 5-3-46.tex ├── 2-1-14.tex ├── 2-1-54.tex ├── 2-2-31.tex ├── 4-2-39.tex ├── 4-4-22.tex ├── 5-1-15.tex ├── 5-1-19.tex ├── 5-3-54.tex ├── 8-2-4.markdown ├── 2-2-33.tex ├── 2-2-38.tex ├── 2-3-6.tex ├── 3-3-3.tex ├── 4-2-18.tex ├── 4-4-19.tex ├── 5-1-39.tex ├── 5-1-5.tex ├── 5-3-35.tex ├── 5-4-9.tex ├── 7-1-1.tex ├── 7-1-3.tex ├── 7-3-2.tex ├── 5-5-24.tex ├── 2-1-37.tex ├── 2-2-53.tex ├── 5-1-22.tex ├── 5-5-36.tex ├── 2-2-6.tex ├── 2-4-13.tex ├── 5-1-11.tex ├── 5-1-17.tex ├── 5-5-7.tex ├── 5-5-70.tex ├── 2-1-40.tex ├── 4-4-14.tex ├── 5-1-25.tex ├── 6-2-6.tex ├── 4-2-43.tex ├── 4-4-18.tex ├── 4-4-24.tex ├── 5-1-21.tex ├── 5-3-2.tex ├── 5-5-22.tex ├── 2-1-41.tex ├── 4-5-10.tex ├── 5-3-49.tex ├── temperature.csv ├── 2-2-29.tex ├── 3-1-6.tex ├── 4-4-17.tex ├── 5-1-18.tex ├── 5-5-69.tex ├── 2-2-8.tex ├── 4-4-6.tex ├── 5-1-42.tex ├── 5-5-60.mp ├── 2-1-43.tex ├── 3-3-20.tex ├── 4-2-29.tex ├── 4-5-21.tex ├── 5-5-75.asy ├── 1-2-5.tex ├── 2-2-54.tex ├── 5-1-26.tex ├── 5-1-6.tex ├── 5-5-71.tex ├── 8-1-11.tex ├── 5-1-48.tex ├── 5-4-15.tex ├── 6-1-2.tex ├── 2-2-32.tex ├── 2-2-9.tex ├── 2-4-19.tex ├── 5-1-41.tex ├── 5-3-3.tex ├── 2-1-4.tex ├── 5-1-52.tex ├── 5-3-55.tex ├── 5-3-56.tex ├── 8-1-12.tex ├── 5-1-23.tex ├── 5-1-24.tex ├── 8-1-8.tex ├── 2-2-28.tex ├── 4-4-7.tex ├── 4-4-16.tex ├── 5-1-47.tex ├── 5-3-48.tex ├── 5-5-67.mp ├── 2-2-26.tex ├── 5-1-34.tex ├── 5-1-38.tex ├── 5-5-47.tex ├── 8-1-10.tex ├── 8-1-7.tex ├── 2-1-44.tex ├── 5-3-37.tex ├── 6-1-22.tex ├── 5-1-44.tex ├── 5-1-8.tex ├── 2-2-40.tex ├── 2-2-72.tex ├── 5-1-55.tex ├── 5-3-39.tex ├── 8-2-3.tex ├── 2-3-4.tex ├── 5-5-32.tex ├── 5-5-55.tex ├── 6-1-18.tex ├── 6-1-20.tex ├── 2-2-7.tex ├── 5-1-27.tex ├── 5-1-40.tex ├── 5-1-54.tex ├── 2-2-52.tex ├── 5-1-36.tex ├── 3-2-11.tex ├── 3-4-4.tex ├── 3-4-1.tex ├── 5-1-45.tex ├── 5-4-13.tex ├── 2-2-71.tex ├── 3-3-1.bib ├── 2-4-10.tex ├── 8-2-1.plt ├── 4-5-6.tex ├── 5-3-1.tex ├── 3-1-9.tex ├── 5-1-37.tex ├── 3-3-2.bib ├── 5-4-14.tex ├── 6-1-6.tex ├── 5-5-59.mp ├── 5-5-66.mp ├── 5-1-32.tex ├── 5-3-41.tex ├── 4-4-25.tex ├── 5-5-68.mp ├── 5-1-33.tex ├── 2-2-18.tex ├── 5-1-35.tex ├── 5-3-42.tex ├── 4-4-12.tex ├── 4-4-23.tex ├── 2-2-22.tex ├── 4-5-24.tex ├── 5-1-9.tex ├── 5-3-45.tex ├── 2-2-24.tex ├── 3-3-15.tex ├── 5-1-31.tex ├── 5-3-43.tex ├── 8-1-20.tex ├── 5-3-40.tex ├── 5-5-54.tex ├── 3-4-8.tex ├── 8-1.tex ├── 5-5-73.asy ├── 5-3-44.tex ├── 5-3-30.tex ├── 5-5-29.tex ├── 2-1-42.tex ├── 5-5-51.tex ├── 2-3-5.tex ├── 2-2-60.tex ├── 3-4-6.tex ├── 5-5-38.tex ├── 5-5-56.tex └── 5-1-28.tex /README.md: -------------------------------------------------------------------------------- 1 | # LaTeXinPractice -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-4.tex: -------------------------------------------------------------------------------- 1 | $A = 90^\circ$ 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-25.tex: -------------------------------------------------------------------------------- 1 | $a:b = ac:bc$ 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-61.mp: -------------------------------------------------------------------------------- 1 | prologues := 3; 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/7-2-5.tex: -------------------------------------------------------------------------------- 1 | \draftmode=1 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/0-1.tex: -------------------------------------------------------------------------------- 1 | $\Delta = b^2 - 4ac$ 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-17.tex: -------------------------------------------------------------------------------- 1 | \mbox{条目}-a 不同于条目-b 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-61.tex: -------------------------------------------------------------------------------- 1 | 1\,234\,567\,890 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-50.tex: -------------------------------------------------------------------------------- 1 | verbatim |\LaTeX| 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-1.tex: -------------------------------------------------------------------------------- 1 | $A_{ij} = 2^{i+j}$ 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-9.tex: -------------------------------------------------------------------------------- 1 | \caption{默认居中的短标题} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-39.tex: -------------------------------------------------------------------------------- 1 | \usepackage{tikz} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-2-1.tex: -------------------------------------------------------------------------------- 1 | \usetheme{PaloAlto} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/1-2-2.tex: -------------------------------------------------------------------------------- 1 | $\angle ACB = \pi / 2$ 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-22.tex: -------------------------------------------------------------------------------- 1 | ® © £ § ¶ † ‡ • ™ € ‰ 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-63.tex: -------------------------------------------------------------------------------- 1 | Space\hspace{1cm}1\,cm 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-71.tex: -------------------------------------------------------------------------------- 1 | \mbox{cannot be broken} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-78.tex: -------------------------------------------------------------------------------- 1 | \framebox[2\width]{带边框} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-1.tex: -------------------------------------------------------------------------------- 1 | \setlength{\parskip}{0pt} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-45.tex: -------------------------------------------------------------------------------- 1 | 显示空格 \verb*!1 2 3 4! 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-61.tex: -------------------------------------------------------------------------------- 1 | 例如\footnote{这是一个脚注。}。 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-69.tex: -------------------------------------------------------------------------------- 1 | 前言\parbox{2em}{不搭后语}。 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-6.tex: -------------------------------------------------------------------------------- 1 | \pagenumbering{roman} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-1-4.tex: -------------------------------------------------------------------------------- 1 | \usepackage{tocbibind} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-2-5.tex: -------------------------------------------------------------------------------- 1 | See \autoref{fig:xref}. 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-14.tex: -------------------------------------------------------------------------------- 1 | \setlength{\bibsep}{0pt} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-8.tex: -------------------------------------------------------------------------------- 1 | {\Large\[F(x) \equiv 0\]} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-2-8.tex: -------------------------------------------------------------------------------- 1 | \LARGE 汉字\reflectbox{汉字} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-4.tex: -------------------------------------------------------------------------------- 1 | \usepackage{fixltx2e} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-25.tex: -------------------------------------------------------------------------------- 1 | \uput[120](1;120){$P$} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-14.tex: -------------------------------------------------------------------------------- 1 | \newtheorem{thm}{定理} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-2-2.tex: -------------------------------------------------------------------------------- 1 | \usecolortheme{crane} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-3-7.tex: -------------------------------------------------------------------------------- 1 | \alert<2>{在第 2 步强调重要的内容} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-18.tex: -------------------------------------------------------------------------------- 1 | \CJKsetecglue{} 2 | 汉字word 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-24.tex: -------------------------------------------------------------------------------- 1 | \symbol{28450}\symbol{35486} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-49.tex: -------------------------------------------------------------------------------- 1 | \xfonttable{OT1}{lmr}{m}{n} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-7.tex: -------------------------------------------------------------------------------- 1 | ``\,`A' or `B?'\,'' he asked. 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-3-8.tex: -------------------------------------------------------------------------------- 1 | \titlelabel{\S~\thetitle\quad} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-11.tex: -------------------------------------------------------------------------------- 1 | \renewcommand\bibfont{\small} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-1-1.tex: -------------------------------------------------------------------------------- 1 | 交换律是 $a+b=b+a$,如 $1+2=2+1=3$。 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-30.tex: -------------------------------------------------------------------------------- 1 | $\sqrt 4 = \sqrt[3]{8} = 2$ 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-5.tex: -------------------------------------------------------------------------------- 1 | \newcommand\degree{^\circ} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-33.tex: -------------------------------------------------------------------------------- 1 | \captionof{figure}{空图片标题} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-51.tex: -------------------------------------------------------------------------------- 1 | \listof{flowchart}{流程图目录} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-64.mp: -------------------------------------------------------------------------------- 1 | outputtemplate := "%j-%c.mps"; 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-15.tex: -------------------------------------------------------------------------------- 1 | \renewcommand\proofname{证明} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-9.tex: -------------------------------------------------------------------------------- 1 | \ifnum 0=1\relax 0\else 1\fi 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-2.tex: -------------------------------------------------------------------------------- 1 | \usepackage[greek,english]{babel} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-5.tex: -------------------------------------------------------------------------------- 1 | differ find flight difficlut ruffle 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-51.tex: -------------------------------------------------------------------------------- 1 | This is {\em emphasized\/} text. 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-59.tex: -------------------------------------------------------------------------------- 1 | The text can be {\Large larger}. 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-6.tex: -------------------------------------------------------------------------------- 1 | shelfful shelf{}ful shelf\/ful 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-67.tex: -------------------------------------------------------------------------------- 1 | \usepackage[perpage]{footmisc} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-3-2.tex: -------------------------------------------------------------------------------- 1 | \author{张三\\九章学堂 \and 李四\\天元研究所} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-16.tex: -------------------------------------------------------------------------------- 1 | \newcommand\loves[3][喜欢]{{#2#1#3}} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-2-4.tex: -------------------------------------------------------------------------------- 1 | \newcommand\thmref[1]{定理~\ref{#1}} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-8.tex: -------------------------------------------------------------------------------- 1 | \usepackage[numbers,square]{natbib} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-1-5.tex: -------------------------------------------------------------------------------- 1 | $\text{被减数} - \text{减数} = \text{差}$ 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-12.tex: -------------------------------------------------------------------------------- 1 | $A_m{}^n$ 或 $A_m^{\phantom{m}n}$ 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-19.tex: -------------------------------------------------------------------------------- 1 | $\vec x = \overrightarrow{AB}$ 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-5.tex: -------------------------------------------------------------------------------- 1 | \[ \int f(x) \,\mathrm{d} x \] 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-17.tex: -------------------------------------------------------------------------------- 1 | \usepackage{pst-plot,pst-node} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-43.tex: -------------------------------------------------------------------------------- 1 | \tikz \fill (0,0) circle (1ex); 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-19.tex: -------------------------------------------------------------------------------- 1 | \logo{\includegraphics{logo.pdf}} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-9.tex: -------------------------------------------------------------------------------- 1 | \lecture{杂谈勾股定理}{gougu} % 讲座标题和讲座标签 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/7-2-3.tex: -------------------------------------------------------------------------------- 1 | 版面宽度是: 2 | \texttt{\the\textwidth} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/7-2-7.tex: -------------------------------------------------------------------------------- 1 | \usepackage[l2tabu, orthodox]{nag} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/1-2-4.tex: -------------------------------------------------------------------------------- 1 | \includegraphics[width=3cm]{xiantu.pdf} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-16.tex: -------------------------------------------------------------------------------- 1 | 中文和English的混排效果 2 | 并不依赖于 space 的有无。 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-19.tex: -------------------------------------------------------------------------------- 1 | 幻影\phantom{参数}速速隐形 2 | 3 | 幻影参数速速显形 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-29.tex: -------------------------------------------------------------------------------- 1 | \textit{M}M 2 | 3 | \textit{M\nocorr}M 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-58.tex: -------------------------------------------------------------------------------- 1 | \emph{汉字,强调}\\ 2 | \CTEXunderdot{汉字,加点} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-68.tex: -------------------------------------------------------------------------------- 1 | left\hrulefill middle\dotfill right 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-73.tex: -------------------------------------------------------------------------------- 1 | 语言文字\llap{word}\\ 2 | \rlap{word}语言文字 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-14.tex: -------------------------------------------------------------------------------- 1 | \CTEXoptions[abstractname={摘\quad 要}] 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-3.tex: -------------------------------------------------------------------------------- 1 | \begin{center} 2 | 居中 3 | \end{center} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-2-1.tex: -------------------------------------------------------------------------------- 1 | \section{Lanuages} 2 | \label{sec:lang} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-2-10.tex: -------------------------------------------------------------------------------- 1 | \documentclass[hyperref,UTF8]{ctexart} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-2-13.tex: -------------------------------------------------------------------------------- 1 | \href{http://bbs.ctex.org/}{CTeX 论坛} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-2-14.tex: -------------------------------------------------------------------------------- 1 | \hyperref[eq:gougu-formula]{点击查看勾股定理公式} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-2-8.tex: -------------------------------------------------------------------------------- 1 | page \thepage\ of \pageref{LastPage} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-12.tex: -------------------------------------------------------------------------------- 1 | \renewcommand\citenumfont{\itshape} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-4-3.tex: -------------------------------------------------------------------------------- 1 | \newcommand*\numsee[2]{#2(\emph{参见} #1)} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-20.tex: -------------------------------------------------------------------------------- 1 | $\ddot{h} \iff \skew{-2}{\ddot}{h}$ 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-26.tex: -------------------------------------------------------------------------------- 1 | \pnode(1;120){P} 2 | \uput[120](P){$P$} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-27.tex: -------------------------------------------------------------------------------- 1 | \pnode(1;120){P} 2 | \pnode(P|0,0){P0} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-35.tex: -------------------------------------------------------------------------------- 1 | \uput[r](*{3.5} {sin(x)}){$\sin x$} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-42.tex: -------------------------------------------------------------------------------- 1 | 圆形 2 | \tikz \draw (0,0) circle (1ex); 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-46.tex: -------------------------------------------------------------------------------- 1 | \tikz\draw (30:0.5) arc (30:150:0.5); 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-21.tex: -------------------------------------------------------------------------------- 1 | \documentclass[xcolor=table]{beamer} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/7-2-4.tex: -------------------------------------------------------------------------------- 1 | \showhyphens{information technology} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-20.tex: -------------------------------------------------------------------------------- 1 | 这是一行文字\\另一行 2 | 3 | 这是一行文字\linebreak 另一行 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-66.tex: -------------------------------------------------------------------------------- 1 | left\hspace{\fill}middle% 2 | \hfill right 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-41.tex: -------------------------------------------------------------------------------- 1 | \begin{proof} 2 | 证明是显然的。 3 | \end{proof} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-66.tex: -------------------------------------------------------------------------------- 1 | \section[节标题]{节标题\protect\footnote{标题中的脚注}} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-3-7.tex: -------------------------------------------------------------------------------- 1 | \usepackage[sf,bf,it,centering]{titlesec} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-1.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper,titlepage]{article} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-1-5.tex: -------------------------------------------------------------------------------- 1 | \addtocontents{toc}{\newpage} 2 | \part{Foo} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-10.tex: -------------------------------------------------------------------------------- 1 | \renewcommand\bibpreamble{下面给出本文参考的几篇文章。} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-13.tex: -------------------------------------------------------------------------------- 1 | \renewcommand\bibnumfmt[1]{\textbf{#1.}} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-16.tex: -------------------------------------------------------------------------------- 1 | \usepackage[numbers,sort&compress]{natbib} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-1-6.tex: -------------------------------------------------------------------------------- 1 | 已知的变量有 $a$, $b$, $c$, $d$, $S$, $R$ 和 $T$。 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-20.tex: -------------------------------------------------------------------------------- 1 | $\overbrace{a+b+c} = \underbrace{1+2+3}$ 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-22.tex: -------------------------------------------------------------------------------- 1 | \[ \underbracket{\overbracket{1+2}+3}_3 \] 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-32.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | (x^p+y^q)^{\frac{1}{1/p+1/q}} 3 | \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-15.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | f(x) \equiv 0, \qquad x > 0 3 | \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-5.tex: -------------------------------------------------------------------------------- 1 | \usepackage[font=small,labelfont=bf]{caption} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-4-5.tex: -------------------------------------------------------------------------------- 1 | \definecolor{Purple}{cmyk}{0.45,0.86,0,0} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-18.tex: -------------------------------------------------------------------------------- 1 | \usepackage{pstricks-add} % 同时载入内核与常用的功能模块 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-19.tex: -------------------------------------------------------------------------------- 1 | 直线 2 | \psline(0,0)(1,1em)(1.5,0) 3 | 直线 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-8.tex: -------------------------------------------------------------------------------- 1 | 映射 $\xymatrix@1{A\ar[r]^{f} & B}$ 2 | 是同态。 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-48.tex: -------------------------------------------------------------------------------- 1 | \renewcommand\CJKfamilydefault{\CJKsfdefault} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-4.tex: -------------------------------------------------------------------------------- 1 | \hyphenation{man-u-script com-pu-ter gym-na-sium} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-44.tex: -------------------------------------------------------------------------------- 1 | \verb"\LaTeX \& \TeX" \qquad 2 | \verb!\/}{#$%&~! 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-63.tex: -------------------------------------------------------------------------------- 1 | \renewcommand\thefootnote{\fnsymbol{footnote}} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-3-9.tex: -------------------------------------------------------------------------------- 1 | \titleformat*{\section}{\Large\itshape\centering} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-4.tex: -------------------------------------------------------------------------------- 1 | \usepackage[a4paper,left=3cm,right=3cm]{geometry} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-7.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \pagestyle{headings} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-4.tex: -------------------------------------------------------------------------------- 1 | \citet{Abrahams1990} \\ 2 | \citet*{Abrahams1990} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-3.tex: -------------------------------------------------------------------------------- 1 | $a = a'$, $b_0' = b_0''$, 2 | ${c'}^2 = (c')^2$ 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-31.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | \sqrt[n]{\frac{x^2 + \sqrt 2}{x+y}} 3 | \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-6.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | \max_n f(n) = \sum_{i=0}^n A_i 3 | \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-17.tex: -------------------------------------------------------------------------------- 1 | \captionsetup{labelsep=none} 2 | \caption{没间隔} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-19.tex: -------------------------------------------------------------------------------- 1 | \captionsetup{labelsep=period} 2 | \caption{英文句点} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-20.tex: -------------------------------------------------------------------------------- 1 | \captionsetup{labelsep=space} 2 | \caption{空格} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-4-6.tex: -------------------------------------------------------------------------------- 1 | % 将所有色彩转换为 CMYK 模型 2 | \usepackage[cmyk]{xcolor} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-13.tex: -------------------------------------------------------------------------------- 1 | % 提供简单的作者年代引用格式 2 | \bibliographystyle{apalike} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-10.tex: -------------------------------------------------------------------------------- 1 | She $\ldots$ she got it. 2 | 3 | I've no idea\ldots. 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-23.tex: -------------------------------------------------------------------------------- 1 | \usefont{T1}{t1xr}{m}{n} 2 | \symbol{"DE}\symbol{"FE} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-30.tex: -------------------------------------------------------------------------------- 1 | {\CJKfamily{hei}这是黑体} 2 | 3 | {\CJKfamily{kai}这是楷书} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-64.tex: -------------------------------------------------------------------------------- 1 | text\\ 2 | \hspace{1cm}text\\ 3 | \hspace*{1cm}text 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-67.tex: -------------------------------------------------------------------------------- 1 | left\hspace{\stretch{2}}$2/3$% 2 | \hspace{\fill}right 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-74.tex: -------------------------------------------------------------------------------- 1 | \fbox{framed} \\ 2 | \framebox[3cm][s]{framed box} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-70.tex: -------------------------------------------------------------------------------- 1 | 前言\parbox[t]{2em}{不搭后语}。 2 | 后语\parbox[b]{2em}{不搭前言}。 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-14.tex: -------------------------------------------------------------------------------- 1 | \newcommand\PRC{People's Republic of \emph{China}} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-2-17.tex: -------------------------------------------------------------------------------- 1 | \section{\texorpdfstring{$\frac{1}{\pi}$}{1/π} 的计算} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-2-7.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{nameref} 2 | 见“\nameref{fig:xref}”。 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-23.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | \frac 12 + \frac 1a = \frac{2+a}{2a} 3 | \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-24.tex: -------------------------------------------------------------------------------- 1 | \[ \frac{1}{\frac 12 (a+b)} 2 | = \frac{2}{a+b} \] 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-34.tex: -------------------------------------------------------------------------------- 1 | $\sqrt{\frac 12} < 2 | \sqrt{\vphantom{\frac12}2}$ 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-41.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | \sum_{\substack{0{只在第 3 步加粗} 3 | \end{frame} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/0-2.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} 3 | \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/1-2-1.tex: -------------------------------------------------------------------------------- 1 | \begin{equation} 2 | a(b+c) = ab + ac 3 | \end{equation} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/1-2-3.tex: -------------------------------------------------------------------------------- 1 | \begin{equation} 2 | AB^2 = BC^2 + AC^2. 3 | \end{equation} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-27.tex: -------------------------------------------------------------------------------- 1 | {\itshape M}M 2 | 3 | \textit{M}M 4 | 5 | {\itshape M\/}M 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-53.tex: -------------------------------------------------------------------------------- 1 | \underline{Emphasized} text and 2 | \underline{another}. 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-62.tex: -------------------------------------------------------------------------------- 1 | \newcommand\dbldag{\dag\!\dag} 2 | \dbldag\ versus \dag\dag 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-9.tex: -------------------------------------------------------------------------------- 1 | Good: One, two, three\ldots 2 | 3 | Bad: One, two, three... 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-13.tex: -------------------------------------------------------------------------------- 1 | \begin{abstract} 2 | 本书讲解 \LaTeX{} 的使用。 3 | \end{abstract} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-25.tex: -------------------------------------------------------------------------------- 1 | \usepackage{amsmath} 2 | \numberwithin{equation}{section} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-35.tex: -------------------------------------------------------------------------------- 1 | \begin{thm}[勾股定理] 2 | 直角三角形斜边的平方等于两腰的平方和。 3 | \end{thm} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-49.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{cprotect} 2 | \cprotect\fbox{套中 \verb|#$%^&|} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-68.tex: -------------------------------------------------------------------------------- 1 | 有边注的文字\marginpar[\hfill 左 $\rightarrow$]{$\leftarrow$ 右} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-76.tex: -------------------------------------------------------------------------------- 1 | \fbox{\begin{varwidth}{10cm} 2 | 自然\\宽度 3 | \end{varwidth}} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-2-6.tex: -------------------------------------------------------------------------------- 1 | \renewcommand\figureautorefname{图} 2 | 参见\autoref{fig:xref}。 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-4-2.tex: -------------------------------------------------------------------------------- 1 | \renewcommand\seename{参见} 2 | \renewcommand\alsoname{又见} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-4-5.tex: -------------------------------------------------------------------------------- 1 | \newcommand*\keyword[1]{\texttt{#1}\index{#1@\texttt{#1}}} 2 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-1-3.tex: -------------------------------------------------------------------------------- 1 | 交换律是 2 | \[ a+b=b+a, \] 3 | 如 4 | \[ 5 | 1+2=2+1=3. 6 | \] 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-27.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{xfrac} 2 | 区别 $\sfrac 1a + b$ 和 $1/(a+b)$ 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-9.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{mathtools} 2 | $\prescript{n}{m}{H}_i^j < L$ 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-1.tex: -------------------------------------------------------------------------------- 1 | \newcommand\mi{\mathrm{i}} 2 | \newcommand\me{\mathrm{e}} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-27.tex: -------------------------------------------------------------------------------- 1 | \[ (1,\dots,n) \qquad 1+\dots+n 2 | \qquad a=\dots=z \] 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-1.tex: -------------------------------------------------------------------------------- 1 | \begin{gather} 2 | a+b = b+a \\ 3 | ab = ba 4 | \end{gather} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-2-9.tex: -------------------------------------------------------------------------------- 1 | \resizebox{2cm}{1cm}{扁} 2 | \resizebox{!}{1cm}{\fbox{高 1cm}} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-14.tex: -------------------------------------------------------------------------------- 1 | \captionsetup{labelformat=simple} 2 | \caption{简单格式,直接输出} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-15.tex: -------------------------------------------------------------------------------- 1 | \captionsetup{labelformat=brace} 2 | \caption{数字右括号,无文字} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-16.tex: -------------------------------------------------------------------------------- 1 | \captionsetup{labelformat=parens} 2 | \caption{带括号数字,无文字} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-23.tex: -------------------------------------------------------------------------------- 1 | \captionsetup{labelsep=endash} 2 | \caption{en dash 连接符} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-29.tex: -------------------------------------------------------------------------------- 1 | \captionsetup{skip=0pt} 2 | 浮动体的内容。 3 | \caption{与前面无额外间距。} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-1.tex: -------------------------------------------------------------------------------- 1 | \xymatrix{ 2 | a & b & a+b \\ 3 | 1 & 2 & 3 \\ 4 | } 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-8.tex: -------------------------------------------------------------------------------- 1 | \part{引言} 2 | \begin{frame} 3 | \partpage 4 | \end{frame} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-2-3.tex: -------------------------------------------------------------------------------- 1 | \usebeamerfonttheme{professionalfonts} 2 | \usepackage{arev} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/7-1-2.tex: -------------------------------------------------------------------------------- 1 | % 当出现 ! No room for a new ... 的错误时使用 2 | \usepackage{etex} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/7-2-1.tex: -------------------------------------------------------------------------------- 1 | \newcommand\Emph[1]{\textbf{\textit{#1}}} 2 | \show\Emph 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-2.tex: -------------------------------------------------------------------------------- 1 | \def\exchange(#1,#2){#2 and #1} 2 | \exchange(left,right) 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-25.tex: -------------------------------------------------------------------------------- 1 | \textit{Italic font test} 2 | 3 | {\bfseries Bold font test} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-34.tex: -------------------------------------------------------------------------------- 1 | \usefont{T1}{pbk}{db}{n} 2 | PostScript Bookman Demibold Normal 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-52.tex: -------------------------------------------------------------------------------- 1 | \newcommand\Emph{\textbf} 2 | This is \Emph{emphasized} text. 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-5.tex: -------------------------------------------------------------------------------- 1 | \usepackage{geometry} 2 | \geometry{a4paper,left=3cm,right=3cm} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-23.tex: -------------------------------------------------------------------------------- 1 | $ 1 + \Bigl(2 - \bigl(3 \times 2 | (4 \div 5) \bigr) \Bigr) $ 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-22.tex: -------------------------------------------------------------------------------- 1 | \[ \underline{ 2 | \smash{\int f(x)\,\mathrm{d}x} 3 | } \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-2-5.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage[draft]{graphicx} 2 | \includegraphics{lion} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-2-7.tex: -------------------------------------------------------------------------------- 1 | \scalebox{2}{大字} 2 | \scalebox{2}[1]{扁字} 3 | \scalebox{1}[2]{长字} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-12.tex: -------------------------------------------------------------------------------- 1 | % \captionsetup{labelformat=default} 2 | \caption{默认格式,同 simple} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-27.tex: -------------------------------------------------------------------------------- 1 | \captionsetup{margin=4em} 2 | \caption{标题距离左右各 4\,em 3 | 的距离。} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-31.tex: -------------------------------------------------------------------------------- 1 | % 导言区 2 | \usepackage{caption} 3 | \captionsetup{figurename=图片} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-50.tex: -------------------------------------------------------------------------------- 1 | \floatplacement{figure}{htbp} 2 | \floatplacement{table}{htbp} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-6.tex: -------------------------------------------------------------------------------- 1 | \usepackage{caption} 2 | \captionsetup{font=small,labelfont=bf} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-4-2.tex: -------------------------------------------------------------------------------- 1 | \colorbox{yellow}{黄色盒子} \\ 2 | \fcolorbox{black}{green}{黑框绿盒子} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-4-3.tex: -------------------------------------------------------------------------------- 1 | \textcolor[gray]{0.5}{50\% 灰色} \\ 2 | \color[rgb]{0.6,0.6,0}暗黄色 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-4-4.tex: -------------------------------------------------------------------------------- 1 | % \usepackage[dvipsnames]{color} 2 | \textcolor{Purple}{紫色文字} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-4-8.tex: -------------------------------------------------------------------------------- 1 | \colorlet{darkred}{red!50!black} 2 | \textcolor{darkred}{定义暗红色} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-34.tex: -------------------------------------------------------------------------------- 1 | \pnode(!120 Pi mul 180 div 120 sin){Q} 2 | \pnode(Q|0,0){Q0} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-4.tex: -------------------------------------------------------------------------------- 1 | \xymatrix{ 2 | A\ar[rd]|\hole & B \\ 3 | C\ar[ru] & D 4 | } 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-44.tex: -------------------------------------------------------------------------------- 1 | \tikz \filldraw[thick,fill=gray] 2 | (0,0) circle (0.5cm); 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-62.tex: -------------------------------------------------------------------------------- 1 | % pdfTeX,设置插入 MetaPost 图形 2 | \DeclareGraphicsRule{*}{mps}{*}{} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-63.tex: -------------------------------------------------------------------------------- 1 | % XeTeX,设置插入 MetaPost 图形 2 | \DeclareGraphicsRule{*}{eps}{*}{} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-3.tex: -------------------------------------------------------------------------------- 1 | \begin{frame} 2 | 这是简单的一帧。 3 | 4 | 帧里的内容是垂直居中的。 5 | \end{frame} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-1.tex: -------------------------------------------------------------------------------- 1 | \def\testsentence{This is a test.} 2 | \def\Emph#1{\textbf{#1}} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-12.tex: -------------------------------------------------------------------------------- 1 | This is a short 2 | sentence. This is 3 | another. 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-45.tex: -------------------------------------------------------------------------------- 1 | \fontfamily{cmfib}\selectfont 2 | Computer Modern Fibonacci Roman 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-57.tex: -------------------------------------------------------------------------------- 1 | \begin{CJKfilltwosides}{5cm} 2 | 汉字,分散对齐 3 | \end{CJKfilltwosides} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-39.tex: -------------------------------------------------------------------------------- 1 | \begin{definition} 2 | 有一个角是直角的三角形是\emph{直角三角形}。 3 | \end{definition} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-3-1.tex: -------------------------------------------------------------------------------- 1 | \title{杂谈勾股定理\\——勾股定理的历史与现状} 2 | \author{张三\\九章学堂} 3 | \date{庚寅盛夏} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-11.tex: -------------------------------------------------------------------------------- 1 | \documentclass[twoside,fancyhdr]{ctexrep} 2 | \fancyhf{} 3 | % …… 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-15.tex: -------------------------------------------------------------------------------- 1 | \newcommand\loves[2]{#1喜欢#2} 2 | \newcommand\hatedby[2]{#2不受#1喜欢} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-9.tex: -------------------------------------------------------------------------------- 1 | \documentclass{ctexart} 2 | \pagestyle{headings} 3 | \markright{张三} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-2-16.tex: -------------------------------------------------------------------------------- 1 | \pdfbookmark[2]{勾股定理证明}{gouguproof} 2 | \begin{proof} …… \end{proof} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-2-3.tex: -------------------------------------------------------------------------------- 1 | 勾股定理公式 (\ref{eq:gougu-formula}) 2 | 出现在 \pageref{eq:gougu-formula}~页。 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-5.tex: -------------------------------------------------------------------------------- 1 | \citep[\S~4.3~节]{lamport1994} \\ 2 | \cite[又见][第~13~章]{mittelbach2004} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-9.tex: -------------------------------------------------------------------------------- 1 | \CTEXoptions[bibname={本书引用的文献}] 2 | % 或 \renewcommand\bibname{本书引用的文献} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-13.tex: -------------------------------------------------------------------------------- 1 | \newcommand\defeq{\stackrel{\text{d}}{=}} 2 | $f(x) \defeq ax^2+bx+c$ 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-14.tex: -------------------------------------------------------------------------------- 1 | \[ A \xleftarrow{0[\text{燃烧}] 2H2O} 3 | \end{equation} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-25.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | \tfrac 12 f(x) = 3 | \frac{1}{\dfrac 1a + \dfrac 1b + c} 4 | \] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-28.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | (a+b)^2 = \binom 20 a^2 3 | + \binom 21 ab + \binom 22 b^2 4 | \] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-35.tex: -------------------------------------------------------------------------------- 1 | $\sqrt b \sqrt y$ \qquad 2 | $\sqrt{\mathstrut b} \sqrt{\mathstrut y}$ 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-8.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | \iiint\limits_D \mathrm{d}f 3 | = \max\nolimits_D g 4 | \] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-18.tex: -------------------------------------------------------------------------------- 1 | \newcommand*\abs[1]{\lvert#1\rvert} 2 | $\abs{x+y} \le \abs{x} + \abs{y}$ 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-26.tex: -------------------------------------------------------------------------------- 1 | \[ \Pr(x\colon g(x)>5) = 0.25, 2 | \qquad g\colon x \mapsto x^2 \] 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-2.tex: -------------------------------------------------------------------------------- 1 | \begin{equation*} 2 | a^2 + b^2 = c^2 \tag{$\star$} 3 | \end{equation*} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-30.tex: -------------------------------------------------------------------------------- 1 | % mytable.tex 2 | \begin{longtable}{|X|X|X|} 3 | ... 4 | \end{longtable} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-49.tex: -------------------------------------------------------------------------------- 1 | \[ \left\{ \begin{matrix} 2 | 1 & 2 \\ 3 & 4 3 | \end{matrix} \right. \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-7.tex: -------------------------------------------------------------------------------- 1 | \usepackage{caption} 2 | \captionsetup[figure]{font=small,labelfont=bf} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-8.tex: -------------------------------------------------------------------------------- 1 | \usepackage{caption} 2 | \captionsetup[figure]{font=small,labelfont=bf} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-11.tex: -------------------------------------------------------------------------------- 1 | \[ \xymatrix{ 2 | A \ar@<.5ex>[r]^f & 3 | \ar@<.5ex>[l]^g B 4 | } \] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-12.tex: -------------------------------------------------------------------------------- 1 | \[ \xymatrix@=2cm{ 2 | *[F]{A} \ar[r]^*+[F=]{k} & *+[o][F]{B} 3 | } \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-16.tex: -------------------------------------------------------------------------------- 1 | \xymatrix@ru{ 2 | A \ar[r] & B \ar[d] \\ 3 | C \ar[u] & D \ar[l] 4 | } 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-33.tex: -------------------------------------------------------------------------------- 1 | \multido{\n=0+1.57,\i=0+90}{3}{ 2 | \uput*[d](\n,0){$\i^\circ$} 3 | } 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-41.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \draw (0,0) circle (1ex); 3 | \end{tikzpicture} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-13.tex: -------------------------------------------------------------------------------- 1 | \catcode`\"=\active 2 | \def"#1"{\textbf{#1}} 3 | An "important" usage. 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-14.tex: -------------------------------------------------------------------------------- 1 | \makeatletter 2 | \setlength\@fpsep{1cm}% 浮动页中不同浮动体间距 3 | \makeatother 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-3.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage[OT2,OT1]{fontenc} 2 | {\fontencoding{OT2}\selectfont ABCabc} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-31.tex: -------------------------------------------------------------------------------- 1 | {\songti 宋体} \quad {\heiti 黑体} \quad 2 | {\fangsong 仿宋} \quad {\kaishu 楷书} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-39.tex: -------------------------------------------------------------------------------- 1 | \newfontfamily\minion[Numbers=SlashedZero]{Minion Pro} 2 | \minion 100, OK. 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-46.tex: -------------------------------------------------------------------------------- 1 | % 导言区修改全文默认字体 Computer Modern Fibonacci 字体族 2 | \renewcommand\rmdefault{cmfib} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-69.tex: -------------------------------------------------------------------------------- 1 | \setlength{\parindent}{8em} 2 | Paragraph indent can be very wide in \LaTeX. 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-72.tex: -------------------------------------------------------------------------------- 1 | \makebox[1em]{\textbullet}text \\ 2 | \makebox[5cm][s]{some stretched text} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-37.tex: -------------------------------------------------------------------------------- 1 | \newtheorem{prop}[thm]{命题} 2 | \begin{prop} 3 | 直角三角形的斜边大于直角边。 4 | \end{prop} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-1-2.tex: -------------------------------------------------------------------------------- 1 | \setcounter{secnumdepth}{4} % 增加编号深度 2 | \setcounter{tocdepth}{4} % 增加目录深度 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-10.tex: -------------------------------------------------------------------------------- 1 | \[ \sideset{_a^b}{_c^d} \sum_{i=0}^n A_i 2 | = \sideset{}{'} \prod_k f_i \] 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-17.tex: -------------------------------------------------------------------------------- 1 | $ \overline{\underline{\underline a} 2 | + \overline{b}^2} - c^{\underline n} $ 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-28.tex: -------------------------------------------------------------------------------- 1 | \[ \prod_{i=1}^n a_i = a_1 \dotsm a_n 2 | \qquad \int_0^1\dotsi\int_0^1 \] 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-2.tex: -------------------------------------------------------------------------------- 1 | \begin{gather*} 2 | 3+5 = 5+3 = 8 \\ 3 | 3\times 5 = 5\times 3 4 | \end{gather*} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-4.tex: -------------------------------------------------------------------------------- 1 | \begin{align} 2 | x &= t + \cos t + 1 \\ 3 | y &= 2\sin t 4 | \end{align} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-11.tex: -------------------------------------------------------------------------------- 1 | \fbox{\parbox{17em}{% 2 | $F(x,y,z)\* G(x,y,z)$ 不同于 $F(x,y,z)\* G(x,y,z)$ 吗?}} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-13.tex: -------------------------------------------------------------------------------- 1 | \xymatrix{ 2 | *++=[o][F]\txt{猫猫} \ar@{<->}[r] & 3 | *+[F]\txt{狗\\狗} 4 | } 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-6.tex: -------------------------------------------------------------------------------- 1 | \xymatrix{ 2 | A \ar[drr]|!{[d];[r]}\hole & B & \\ 3 | C \ar[ur] & & D 4 | } 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-74.asy: -------------------------------------------------------------------------------- 1 | import binarytree; 2 | binarytree bt=searchtree(4,2,1,3,5,6); 3 | draw(bt); 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-12.tex: -------------------------------------------------------------------------------- 1 | \begin{frame}{参考文献} 2 | \nocite{Shiye} 3 | \bibliography{math} 4 | \end{frame} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/7-2-8.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{lipsum} 2 | \linespread{1}\usefont{T1}{bch}{m}{n} 3 | \lipsum[1-2] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-3.tex: -------------------------------------------------------------------------------- 1 | \def\multi#1{(#1,#1)} 2 | \edef\multi#1{[\multi{#1}, \multi{#1}]} 3 | \multi{X} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-1.tex: -------------------------------------------------------------------------------- 1 | % UTF-8 编码 2 | café\quad Gödel\quad Antonín Dvořák 3 | 4 | χαϊδεύης\qquad Крюкова 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-60.tex: -------------------------------------------------------------------------------- 1 | \setlength{\lineskiplimit}{2.625bp} % 五号字 1/4 字高 2 | \setlength{\lineskip}{2.625bp} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-75.tex: -------------------------------------------------------------------------------- 1 | \setlength{\fboxsep}{0pt} \fbox{tight} 2 | \setlength{\fboxsep}{1em} \fbox{loose} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-10.tex: -------------------------------------------------------------------------------- 1 | 前文…… 2 | \begin{quote} 3 | 学而时习之,不亦说乎? 4 | 有朋自远方来,不亦乐乎? 5 | \end{quote} 6 | 后文…… 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-34.tex: -------------------------------------------------------------------------------- 1 | \newtheorem{thm}{定理} % 一般在导言区 2 | \begin{thm} 3 | 直角三角形斜边的平方等于两腰的平方和。 4 | \end{thm} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-48.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{fancyvrb} 2 | \SaveVerb{myverb}|#$%^&| 3 | \fbox{套中 \UseVerb{myverb}} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-1-7.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{tocloft} 2 | \renewcommand\cftdot{…} 3 | \renewcommand{\cftdotsep}{0} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-33.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | \sqrt[\uproot{16}\leftroot{-2}n] 3 | {\frac{x^2 + \sqrt 2}{x+y}} 4 | \] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-8.tex: -------------------------------------------------------------------------------- 1 | \begin{flalign} 2 | x &= t & x &= 2 \\ 3 | y &= 2t & y &= 4 4 | \end{flalign} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-7.tex: -------------------------------------------------------------------------------- 1 | \documentclass{book} 2 | \usepackage{chngcntr} 3 | \counterwithout{equation}{chapter} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-56.tex: -------------------------------------------------------------------------------- 1 | \usepackage{blkarray} 2 | \makeatletter 3 | \newbox\BA@first@box 4 | \makeatother 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-26.tex: -------------------------------------------------------------------------------- 1 | \captionsetup{font=small} 2 | \captionsetup{font+=bf} 3 | \caption{小号加粗字体 Caption} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-23.tex: -------------------------------------------------------------------------------- 1 | \begin{pspicture}(-0.5,0)(1,1) 2 | \pswedge(0,0){1}{0}{120} 3 | \end{pspicture} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-28.tex: -------------------------------------------------------------------------------- 1 | \pnode(1;120){P} 2 | \pnode(P|0,0){P0} 3 | \ncline{-}{P}{P0} % 等价于 \psline(P)(P0) 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-40.tex: -------------------------------------------------------------------------------- 1 | % 使用 latex + dvipdfmx 编译时 2 | \usepackage[dvipdfmx]{graphicx} 3 | \usepackage{tikz} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-72.asy: -------------------------------------------------------------------------------- 1 | draw((0,0) .. tension 2 .. (1cm,1cm){right} .. (2cm,0){right} 2 | .. (5cm,1cm)); 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-11.tex: -------------------------------------------------------------------------------- 1 | \# \quad \$ \quad \% \quad \& \quad 2 | \{ \quad \} \quad \_ \quad 3 | \textbackslash 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-28.tex: -------------------------------------------------------------------------------- 1 | Bold `{\bfseries leaf}' 2 | 3 | Bold `{\bfseries leaf\/}' 4 | 5 | Bold `\textbf{leaf}' 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-16.tex: -------------------------------------------------------------------------------- 1 | \begin{itemize} 2 | \item 中文 3 | \item English 4 | \item Français 5 | \end{itemize} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-64.tex: -------------------------------------------------------------------------------- 1 | \usepackage{pifont} 2 | \renewcommand\thefootnote{\ding{\numexpr171+\value{footnote}}} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-17.tex: -------------------------------------------------------------------------------- 1 | % 导言 \usepackage[merge]{natbib} 2 | \citep*{knuthtex1986, *lamport1994, *mittelbach2004} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-45.tex: -------------------------------------------------------------------------------- 1 | \[ \bordermatrix{ 2 | & 1 & 2 & 3 \cr 3 | 1 & A & B & C \cr 4 | 2 & D & E & F \cr} \] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-16.tex: -------------------------------------------------------------------------------- 1 | 运算 $\heartsuit$ 的交换律: 2 | \[ a \mathbin{\heartsuit} b = 3 | b \mathbin{\heartsuit} a \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-4.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | \mathcal{F}(x) = \sum_{k=0}^\infty 3 | \oint_0^1 f_k(x,t) \,\mathrm{d}t 4 | \] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-2-1.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{graphics} 2 | % 或 \usepackage{graphicx} 3 | 狮子:\includegraphics{lion} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-52.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{afterpage} 2 | \afterpage{\begin{figure}[H] 3 | ... 4 | \end{figure}} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-37.tex: -------------------------------------------------------------------------------- 1 | % \newcommand\iangle{120} 2 | \pnode(!\iangle\space Pi mul 180 div \iangle\space sin){Q} 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-3-12.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{tdclock} 2 | \begin{frame} 3 | 当前时间:\tdtime;已经过去时间:\crono 4 | \end{frame} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-3-4.tex: -------------------------------------------------------------------------------- 1 | \begin{frame} 2 | \begin{theorem}<2-> 3 | 第 2 步以后显示的定理 4 | \end{theorem} 5 | \end{frame} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-4.tex: -------------------------------------------------------------------------------- 1 | \let\oldemph=\emph 2 | \renewcommand\emph[1]{\textbf{#1}} 3 | An \emph{important} command 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/gougu/gougu.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ljvblfz/LaTeXinPractice/HEAD/《Latex入门》配书案例/gougu/gougu.pdf -------------------------------------------------------------------------------- /《Latex入门》配书案例/gougu/logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ljvblfz/LaTeXinPractice/HEAD/《Latex入门》配书案例/gougu/logo.pdf -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-70.tex: -------------------------------------------------------------------------------- 1 | Para\par 2 | \addtolength{\parindent}{2em}Para\par 3 | \addtolength{\parindent}{2em}Para\par 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-15.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate} 2 | \item 中文 3 | \item English 4 | \item Français 5 | \end{enumerate} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-19.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate} 2 | \item 中文 3 | \item[1a.] 汉语 4 | \item English 5 | \end{enumerate} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-21.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate} 2 | \item 这是编号 \theenumi 3 | \item 这是编号 \theenumi 4 | \end{enumerate} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-11.tex: -------------------------------------------------------------------------------- 1 | $\overset{*}{X}$ \qquad 2 | $\underset{*}{X}$ \qquad 3 | $\overset{*}{\underset{\dag}{X}}$ 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-42.tex: -------------------------------------------------------------------------------- 1 | \[ \sum_{\begin{subarray}{l} 2 | i<10 \\ j<100 \\ k<1000 3 | \end{subarray}} X(i,j,k) \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-12.tex: -------------------------------------------------------------------------------- 1 | 群 $G$ 的 $(H,K)$-双陪集为 2 | $H\backslash G/K$。 3 | 4 | $S\cup T = (S\cap T)\cup (S\setminus T)$ 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-15.tex: -------------------------------------------------------------------------------- 1 | $x=y \implies x+a=y+a$ \\ 2 | $x=y \impliedby x+a=y+a$ \\ 3 | $x=y \iff x\le y \And x\ge y$ 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-22.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | \biggl( \sum_{i=1}^n A_i \biggr) \cdot 3 | \biggl( \sum_{i=1}^n B_i \biggr) > 0 4 | \] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-11.tex: -------------------------------------------------------------------------------- 1 | \begin{align*} 2 | x^2 + 2x &= -1 3 | \intertext{移项得} 4 | x^2 + 2x + 1 &= 0 5 | \end{align*} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-18.tex: -------------------------------------------------------------------------------- 1 | \setlength\jot{9pt}% 用来分开分式 2 | \begin{gather} 3 | a = \frac12 \\ b = \frac34 4 | \end{gather} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-29.tex: -------------------------------------------------------------------------------- 1 | % foo.tex 2 | % 导言区用: 3 | \usepackage{ltxtable} 4 | % 正文使用: 5 | \LTXtable{\textwidth}{mytable} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-43.tex: -------------------------------------------------------------------------------- 1 | % 解决 arydshln 与 hhline, makecell 的冲突 2 | \usepackage{array} 3 | \newcolumntype{|}{!{\vline}} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-2-4.tex: -------------------------------------------------------------------------------- 1 | 基线\rule{2cm}{0.4pt}% 2 | \includegraphics[angle=90,origin=b, 3 | totalheight=1.5cm]{lion.eps} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-25.tex: -------------------------------------------------------------------------------- 1 | \captionsetup{font={small,sf}, 2 | labelfont=bf} 3 | \caption{小号加粗无衬线体 Caption} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-38.tex: -------------------------------------------------------------------------------- 1 | \begin{figure} 2 | \centering FIGURE 3 | \bicaption{中文标题}{English Title} 4 | \end{figure} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-20.tex: -------------------------------------------------------------------------------- 1 | 直线 2 | \begin{pspicture}(1.5,1em) 3 | \psline(0,0)(1,1em)(1.5,0) 4 | \end{pspicture} 5 | 直线 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-3.tex: -------------------------------------------------------------------------------- 1 | \xymatrix{ 2 | A\ar[r]^{\alpha} & B\ar[d]_{\beta} \\ 3 | C\ar[ur]|{\Sigma} & D \\ 4 | } 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-58.mp: -------------------------------------------------------------------------------- 1 | % 主要代码片断 2 | draw (0,0) .. tension 2 .. (1cm,1cm){right} .. (2cm,0){right} 3 | .. (5cm,1cm); 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-4.tex: -------------------------------------------------------------------------------- 1 | \begin{frame} 2 | \frametitle{标题} 3 | \framesubtitle{小标题} 4 | 这是简单的一帧。 5 | \end{frame} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-18.tex: -------------------------------------------------------------------------------- 1 | \AtEndDocument{% 2 | \begin{center} 3 | \includegraphics{logo.pdf} 4 | \end{center}} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/gloss/testgls.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ljvblfz/LaTeXinPractice/HEAD/《Latex入门》配书案例/gloss/testgls.pdf -------------------------------------------------------------------------------- /《Latex入门》配书案例/gougu/xiantu.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ljvblfz/LaTeXinPractice/HEAD/《Latex入门》配书案例/gougu/xiantu.pdf -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-21.tex: -------------------------------------------------------------------------------- 1 | \begin{align*} 2 | [2 - (3+5)]\times 7 &= 42 \\{} 3 | [2 + (3-5)]\times 7 &= 0 4 | \end{align*} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-32.tex: -------------------------------------------------------------------------------- 1 | % ctex 宏包下默认相当于 \CJKfamily{rm} 2 | % \rmfamily 或 \textrm 也会同时设置此字体 3 | 中文字体的\textbf{粗体}与\textit{斜体} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-20.tex: -------------------------------------------------------------------------------- 1 | \begin{itemize} 2 | \item[\dag] 中文 3 | \item English 4 | \item Français 5 | \end{itemize} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-42.tex: -------------------------------------------------------------------------------- 1 | \usepackage{amsthm} 2 | \renewcommand\proofname{证明} 3 | \renewcommand\qedsymbol{\ensuremath{\Box}} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-12.tex: -------------------------------------------------------------------------------- 1 | \renewcommand\headrulewidth{0.6pt} % 默认为 0.4pt 2 | \renewcommand\footrulewidth{0.6pt} % 默认为 0pt 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-1-2.tex: -------------------------------------------------------------------------------- 1 | % 用于 ntheorem 宏包 2 | \renewcommand\qedsymbol{\ensuremath{\Box}} 3 | 证毕符号:\qedsymbol 或 $\qedsymbol$。 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-13.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{tensor} 2 | $M\indices{^a_b^{cd}_e}$ \qquad 3 | $\tensor[^a_b^c_d]{M}{^a_b^c_d}$ 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-14.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{mhchem} 2 | 醋中主要是 \ce{H2O},含有 \ce{CH3COO-}。 3 | 4 | \ce{^{227}_{90}Th} 元素具有强放射性。 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-16.tex: -------------------------------------------------------------------------------- 1 | $\overline{a+b} = 2 | \overline a + \overline b$ \\ 3 | $\underline a = (a_0, a_1, a_2, \dots)$ 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-19.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | \partial_x \partial_y \left[ 3 | \frac12 \left( x^2+y^2 \right)^2 + xy 4 | \right] 5 | \] 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-12.tex: -------------------------------------------------------------------------------- 1 | \[ \left\{ 2 | 0, 1, -1, 2, -2, \frac12, -\frac12, \frac13, -\frac13, \dotsc 3 | \right\} \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-2-11.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{lscape} 2 | \begin{landscape} 3 | \subsection{页面旋转} 4 | …… 5 | \end{landscape} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-24.tex: -------------------------------------------------------------------------------- 1 | \captionsetup{ 2 | justification=raggedleft, 3 | singlelinecheck=false} 4 | \caption{右对齐的标题} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-5.tex: -------------------------------------------------------------------------------- 1 | \xymatrix{ 2 | A \ar[r]^>{f} & B \\ 3 | C \ar[r]^>>{g} & D \\ 4 | E \ar[r]^(0.6){h} & F 5 | } 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-77.tex: -------------------------------------------------------------------------------- 1 | \usepackage{asymptote} 2 | \begin{asydef} 3 | import graph; 4 | unitsize(1cm); 5 | \end{asydef} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-16.tex: -------------------------------------------------------------------------------- 1 | \begin{frame}{现代叙述} 2 | \begin{thm}[勾股定理] 3 | 直角三角形斜边的平方等于两直角边的平方和。 4 | \end{thm} 5 | \end{frame} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/7-2-6.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{trace} 2 | \newcommand\test[2]{(#1-#2)} 3 | \traceon 4 | \test{a}{b} 5 | \traceoff 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-35.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage{txfonts} 3 | \begin{document} 4 | Test text 5 | \end{document} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-38.tex: -------------------------------------------------------------------------------- 1 | % 导言区使用 2 | \newfontfamily\lucidasans{Lucida Sans} 3 | % 正文使用 4 | {\lucidasans This is Lucida Sans.} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-50.tex: -------------------------------------------------------------------------------- 1 | You \emph{should} use fonts carefully. 2 | 3 | \textit{% 4 | You \emph{should} use fonts carefully.} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-76.tex: -------------------------------------------------------------------------------- 1 | \newsavebox{\mybox} % 通常在导言区定义 2 | \sbox{\mybox}{test text} 3 | \usebox{\mybox} \fbox{\usebox{\mybox}} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-43.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{amsthm} 2 | \begin{proof} 3 | 最后我们有 4 | \[ 5 | f(x) = 0. \qedhere 6 | \] 7 | \end{proof} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-75.tex: -------------------------------------------------------------------------------- 1 | % 这与实际 \TeX 的定义基本等价 2 | \mbox{T\hspace{-0.1667em}% 3 | \raisebox{-0.5ex}{E}% 4 | \hspace{-0.125em}X} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-44.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{mathtools} 2 | \[ \begin{pmatrix*}[r] 3 | 10 & -10 \\ -20 & 3 4 | \end{pmatrix*} \] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-7.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \DeclareMathOperator\dif{d\!} 2 | \[ \int_0^1 f(t) \dif t 3 | = \iint_D g(x,y) \dif x \dif y \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-17.tex: -------------------------------------------------------------------------------- 1 | \newcommand\varnotin{% 2 | \mathrel{\overline{\in}}} 3 | $\forall x$, $\forall S$, $x\varnotin S$. 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-3.tex: -------------------------------------------------------------------------------- 1 | \begin{equation*} 2 | \sum_{k=1}^n \frac1k 3 | = \ln n + \mathrm{C} \tag*{[Euler]} 4 | \end{equation*} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-1.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{lcr} 2 | left & center & right \\ 3 | 本列左对齐 & 本列居中 4 | & 本列右对齐 \\ 5 | \end{tabular} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-2-6.tex: -------------------------------------------------------------------------------- 1 | \graphicspath{{figures/}} % 本书的设置,图片在当前目录下的 figures 目录 2 | \graphicspath{{pdf/}{png/}{jpg/}} % 按图片类型管理的 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-14.tex: -------------------------------------------------------------------------------- 1 | \xymatrix{ 2 | *+[F.]{\composite{*+[o][F]{a\quad} * *+[F]{\quad b}}} \ar[r] 3 | & *+[F]{c} 4 | } 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-57.tex: -------------------------------------------------------------------------------- 1 | \setlength\unitlength{1cm} 2 | \begin{picture}(1,1) 3 | \put(0,0) {左下} \put(1,1) {右上} 4 | \end{picture} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-5.tex: -------------------------------------------------------------------------------- 1 | \let\oldemph=\emph 2 | \renewcommand\emph[1]{% 3 | \oldemph{\Large #1}} 4 | An \emph{important} command 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/gougu/gougu-slide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ljvblfz/LaTeXinPractice/HEAD/《Latex入门》配书案例/gougu/gougu-slide.pdf -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-12.tex: -------------------------------------------------------------------------------- 1 | \begin{verse} 2 | 在一段内使用 \verb=\\= 换行,\\ 3 | 分段仍用空行。 4 | 5 | 过长的长会在折行时悬挂缩进, 6 | 就像现在这一句。 7 | \end{verse} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-46.tex: -------------------------------------------------------------------------------- 1 | \begin{verbatim} 2 | #!usr/bin/env perl 3 | $name = "guy"; 4 | print "Hello, $name!\n"; 5 | \end{verbatim} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-17.tex: -------------------------------------------------------------------------------- 1 | \newcommand\Emph[1]{\emph{#1}} 2 | \newcommand\setEmph[1]{% 3 | \renewcommand\Emph[1]{% 4 | #1{##1}}} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-2.tex: -------------------------------------------------------------------------------- 1 | \documentclass{moderncv} 2 | \usepackage{ctex} 3 | \zihao{-4} 4 | \begin{document} 5 | ………… 6 | \end{document} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-3.tex: -------------------------------------------------------------------------------- 1 | \XeTeXinputencoding "GBK" 2 | \documentclass{ctexart} 3 | \begin{document} 4 | GBK 编码的中文文档。 5 | \end{document} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-21.tex: -------------------------------------------------------------------------------- 1 | \[ ( \overbrace{a_0,a_1,\dots,a_n} 2 | ^{\text{共 $n+1$ 项}} ) = 3 | ( \underbrace{0,0,\dots,0}_{n} , 1 ) \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-10.tex: -------------------------------------------------------------------------------- 1 | \[ \operatorname*{Prob}_{\{1,\ldots,n\}} 2 | (\bar X) = 3 | \operatorname{card}(\varnothing)/n = 0. \] 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-6.tex: -------------------------------------------------------------------------------- 1 | \newcommand\diff{\,\mathrm{d}} 2 | \[ \iiint\limits_{0{\columncolor{lightgray}[0pt][\tabcolsep]}c|} 2 | 表列 & 左紧右松 \\ 3 | \end{tabular} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-3-2.tex: -------------------------------------------------------------------------------- 1 | \begin{frame} 2 | 计数:\only<1>{1}\only<2>{2}\only<3>{3}\only<4->{4} 3 | 4 | \onslide<5> 数完了。 5 | \end{frame} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-47.tex: -------------------------------------------------------------------------------- 1 | % 导言区修改全文默认字体为无衬线字体族 phv(Helvetica) 2 | \renewcommand\familydefault{\sfdefault} 3 | \renewcommand\sfdefault{phv} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-2.tex: -------------------------------------------------------------------------------- 1 | \raggedright 2 | English words like `technology' stem from a 3 | Greek root beginning with the letters τεχ\dots 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-30.tex: -------------------------------------------------------------------------------- 1 | \newenvironment{mycenter} 2 | {\begin{trivlist} 3 | \centering 4 | \item[]} 5 | {\end{trivlist}} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-36.tex: -------------------------------------------------------------------------------- 1 | \newtheorem{lemma}{引理}[chapter]% 按章 2 | \begin{lemma} 偏序集可良序化。 \end{lemma} 3 | \begin{lemma} 实数集不可数。 \end{lemma} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-47.tex: -------------------------------------------------------------------------------- 1 | \begin{verbatim*} 2 | #include 3 | main() { 4 | printf("Hello, world.\n"); 5 | } 6 | \end{verbatim*} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-3.tex: -------------------------------------------------------------------------------- 1 | \begin{gather} 2 | 3^2 + 4^2 = 5^2 \notag \\ 3 | 5^2 + 12^2 = 13^2 \notag \\ 4 | a^2 + b^2 = c^2 5 | \end{gather} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-5.tex: -------------------------------------------------------------------------------- 1 | \begin{align*} 2 | x &= t & x &= \cos t & x &= t \\ 3 | y &= 2t & y &= \sin(t+1) & y &= \sin t 4 | \end{align*} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-3.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | \begin{array}{r|r} 3 | \frac12 & 0 \\ 4 | \hline 5 | 0 & -\frac12 \\ 6 | \end{array} 7 | \] 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-2-3.tex: -------------------------------------------------------------------------------- 1 | 旋转的狮子: 2 | \includegraphics[angle=90] 3 | {lion.eps} 4 | \includegraphics[angle=-45,origin=c] 5 | {lion.eps} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-4-7.tex: -------------------------------------------------------------------------------- 1 | \textcolor{purple!70}{淡紫色} 2 | 3 | {\color{blue!60!black}60\% 蓝与 40\% 黑混合的深蓝色} 4 | 5 | \colorbox{-red}{青色与红色互补} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-1.tex: -------------------------------------------------------------------------------- 1 | \documentclass{beamer} 2 | \usepackage[UTF8,noindent]{ctexcap} 3 | \begin{document} 4 | % ... 5 | \end{document} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-10.tex: -------------------------------------------------------------------------------- 1 | % 导言区 2 | \AtBeginLecture{ 3 | \begin{frame} 4 | \Large 5 | 本周论题:\insertlecture 6 | \end{frame} 7 | } 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-19.tex: -------------------------------------------------------------------------------- 1 | % 在 boldemph.sty 中,给 emph 增加加粗的功能 2 | \let\boldmath@oldemph\emph 3 | \def\emph#1{\textbf{\boldemph@oldemph{#1}}} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-6.tex: -------------------------------------------------------------------------------- 1 | \ifnum 0=1 不\fi 相等, 2 | \ifnum \value{page}>100 大页码 3 | \else 小页码\fi, 4 | \ifdim \linewidth<5cm 窄行\else 宽行\fi。 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-65.tex: -------------------------------------------------------------------------------- 1 | \newcommand\test{longggggggg% 2 | \hspace{2em plus 1em minus 0.25em}} 3 | \test\test\test\test\test\test\test\test 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-11.tex: -------------------------------------------------------------------------------- 1 | 前文…… 2 | \begin{quotation} 3 | 学而时习之,不亦说乎? 4 | 有朋自远方来,不亦乐乎? 5 | 6 | 默而识之,学而不厌,诲人不倦,何有于我哉? 7 | \end{quotation} 8 | 后文…… 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-73.tex: -------------------------------------------------------------------------------- 1 | \rule{1pt}{1em}Middle\rule{1pt}{1em} \\ 2 | Left\rule[0.5ex]{2cm}{0.6pt}Right \\ 3 | \rule[-0.1em]{1em}{1em} 也可以用作证毕符号 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-1-8.tex: -------------------------------------------------------------------------------- 1 | \settowidth{\cftchapternumwidth}{第几十几章} % 最宽的可能编号 2 | \renewcommand\cftchapteraftersnumb{\hspace{0.5em}} % 额外间距 3 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-4-11.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{|ccc|} 2 | \hline \rowcolor{lightgray} A & B & C \\ 3 | 一 & 二 & 三 \\\hline % 保持白色 4 | \end{tabular} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-3-11.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{multimedia} 2 | \begin{frame}{Music} 3 | % 自动播放,无显示内容 4 | \sound[autostart]{}{foo.au} 5 | \end{frame} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/1-1-1.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | 3 | \begin{document} 4 | This is my first document. 5 | 6 | Happy \TeX ing! 7 | \end{document} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-58.tex: -------------------------------------------------------------------------------- 1 | \begin{tabbing} 2 | 格式\hspace{3em} \= 作者 \\ 3 | Plain \TeX \> 高德纳 \\ 4 | \LaTeX \> Leslie Lamport 5 | \end{tabbing} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-59.tex: -------------------------------------------------------------------------------- 1 | \begin{tabbing} 2 | 格式\hspace{3em} \= 作者 \kill 3 | Plain \TeX \> 高德纳 \\ 4 | \LaTeX \> Leslie Lamport 5 | \end{tabbing} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-65.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{r|r} 2 | 自变量 & 因变量\footnotemark \\ \hline 3 | $x$ & $y$ 4 | \end{tabular} 5 | \footnotetext{$y=x^2$。} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-11.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \DeclareMathOperator\dif{d\!} 2 | \[ 3 | \int_0^1 \int_0^1 f(x,y) \int_0^1 \frac{\dif z}{g(x,y,z)} \dif x\dif y 4 | \] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-24.tex: -------------------------------------------------------------------------------- 1 | \[ P = \biggl< \frac12 \biggr>, \qquad 2 | M = \left< \begin{matrix} 3 | a & b \\ c & d \\ 4 | \end{matrix}\right> \] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-21.tex: -------------------------------------------------------------------------------- 1 | \[ \left. \begin{gathered} 2 | S \subseteq T \\ 3 | S \supseteq T 4 | \end{gathered} \right\} 5 | \implies S = T \] 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-46.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{array} 2 | \begin{tabular}{c!{$\Rightarrow$}c} 3 | 张三 & 85 \\ 4 | 李四 & 82 \\ 5 | 王五 & 70 \\ 6 | \end{tabular} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-11.tex: -------------------------------------------------------------------------------- 1 | \captionsetup{format=hang} 2 | \caption[hang 格式]{hang 格式的效果 3 | 是,对于很长的标题,前面的数字标签会 4 | 进行悬挂缩进,就好像 \LaTeX{} 的列表 5 | 环境一样。} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-21.tex: -------------------------------------------------------------------------------- 1 | \begin{pspicture}(-1.2,-1.2)(1.2,1.2) 2 | \psaxes(0,0)(-1.2,-1.2)(1.2,1.2) 3 | \pscircle(0,0){1} 4 | \end{pspicture} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-3-1.tex: -------------------------------------------------------------------------------- 1 | \begin{frame} 2 | \onslide<1>{只有第 1 步} 3 | 4 | \onslide<2->{第 2 步之后} 5 | 6 | \onslide<1,3>{第 1, 3 两步} 7 | \end{frame} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-3-6.tex: -------------------------------------------------------------------------------- 1 | \begin{frame} 2 | \begin{itemize}[<+->] 3 | \item 开始显示 4 | \item 其次显示 5 | \item 最后显示 6 | \end{itemize} 7 | \end{frame} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-15.tex: -------------------------------------------------------------------------------- 1 | % boldmath.sty 2 | \ProvidesPackage{boldmath}[2010/10/10 v1.0 emphasis using bold font] 3 | \newcommand\Emph[1]{\textbf{#1}} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/gloss/MAKE-simplegloss.bat: -------------------------------------------------------------------------------- 1 | xelatex testgls 2 | makeindex -s simplegloss.ist -o testgls.gls -t testgls.glg testgls.glo 3 | xelatex testgls -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-27.tex: -------------------------------------------------------------------------------- 1 | \newcounter{mylist} 2 | \begin{list}{\#\themylist}% 3 | {\usecounter{mylist}} 4 | \item 中文 5 | \item English 6 | \end{list} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-2.tex: -------------------------------------------------------------------------------- 1 | $A_i^k = B^k_i$ \qquad 2 | $K_{n_i} = K_{2^i} = 2^{n_i} 3 | = 2^{2^i}$ \qquad 4 | $3^{3^{3^{\cdot^{\cdot^{\cdot^3}}}}}$ 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-36.tex: -------------------------------------------------------------------------------- 1 | \[ A = \begin{pmatrix} 2 | a_{11} & a_{12} & a_{13} \\ 3 | 0 & a_{22} & a_{23} \\ 4 | 0 & 0 & a_{33} 5 | \end{pmatrix} \] 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-50.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{delarray} 2 | \[ 3 | \begin{array}({cc}] % 左边圆括号,右边方括号 4 | 1 & 2 \\ 5 | 3 & 4 6 | \end{array} 7 | \] 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-36.tex: -------------------------------------------------------------------------------- 1 | % 一般在导言区使用 2 | \DeclareCaptionLabelSeparator{fullcolon}{:} % 声明中文的全角冒号分隔符 3 | \captionsetup{labelsep=fullcolon} % 为中文的标题设置全角冒号分隔符 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-4-16.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{|cc|} \hline 2 | & foo \\ 3 | \rowcolor{lightgray} 4 | \multirow{-2}*{Test} & bar \\\hline 5 | \end{tabular} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-53.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \draw (0,0) -- (2,0) node[right] {右}; 3 | \draw (0,-1) -- node[above] {连线} (2,-1); 4 | \end{tikzpicture} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-3-10.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{multimedia} 2 | \begin{frame}{AVI movie} 3 | \movie[width=4cm,height=3cm]{Click to play}{foo.avi} 4 | \end{frame} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-3-5.tex: -------------------------------------------------------------------------------- 1 | \begin{frame} 2 | \begin{itemize} 3 | \item<1-> 开始显示 4 | \item<3-> 最后显示 5 | \item<2-> 然后显示 6 | \end{itemize} 7 | \end{frame} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-55.tex: -------------------------------------------------------------------------------- 1 | \uuline{urgent}\qquad \uwave{boat}\qquad 2 | \sout{wrong}\qquad \xout{removed}\qquad 3 | \dashuline{dashing}\qquad \dotuline{dotty} 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-56.tex: -------------------------------------------------------------------------------- 1 | \lstset{language=C,flexiblecolumns, 2 | escapechar=`} % 设置 ` 为逃逸字符 3 | \begin{lstlisting} 4 | int n; // `一个整数` 5 | \end{lstlisting} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-26.tex: -------------------------------------------------------------------------------- 1 | \[ \cfrac{1}{1+\cfrac{2}{% 2 | 1+\cfrac{3}{1+x}}} = 3 | \cfrac[r]{1}{1+\cfrac{2}{% 4 | 1+\cfrac[l]{3}{1+x}}} \] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-40.tex: -------------------------------------------------------------------------------- 1 | 复数 $z = (x,y)$ 也可用矩阵 \begin{math} 2 | \left( \begin{smallmatrix} 3 | x & -y \\ y & x 4 | \end{smallmatrix} \right) 5 | \end{math} 来表示。 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-9.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{amsmath} 2 | \DeclareMathOperator{\card}{card} % 集合基数 3 | \DeclareMathOperator*{\esssup}{ess\,sup} % 本性上确界 4 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-15.tex: -------------------------------------------------------------------------------- 1 | \begin{equation} \begin{split} 2 | \cos 2x &= \cos^2 x - \sin^2 x \\ 3 | &= 2\cos^2 x - 1 4 | \end{split} \end{equation} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-20.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{cases} 2 | \begin{numcases}{f(x)=} 3 | 1/q, & if $x = p/q \in \mathbb{Q}$; \\ 4 | 0, & else. 5 | \end{numcases} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-13.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{array} 2 | \begin{tabular}[b]{|c|} 3 | \firsthline 4 | 上 \\ 中间 \\ 下 \\ 5 | \lasthline 6 | \end{tabular} 7 | 与底部对齐。 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-2.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{ll} 2 | \bfseries 功能 & \bfseries 环境 \\ 3 | 表格 & \ttfamily tabular \\ 4 | 对齐 & \ttfamily tabbing \\ 5 | \end{tabular} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-2.tex: -------------------------------------------------------------------------------- 1 | \xymatrix{ 2 | a & b\ar[rd] & a+b \\ % 指向右下方 3 | 1 & 2 & 3\ar"1,1" % 指向 (1,1) 4 | \ar"1,1";"2,2" % 直接从 (1,1) 到 (2,2) 5 | } 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-3-13.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{ocgtools} 2 | \begin{frame} 3 | % 点击公式会显示定理名称 4 | \ocgminitext{$a^2+b^2=c^2$}{Pythagoras Theorem} 5 | \end{frame} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-33.tex: -------------------------------------------------------------------------------- 1 | \fontencoding{OT1}\fontfamily{pzc} 2 | \fontseries{mb}\fontshape{it} 3 | \fontsize{14}{17}\selectfont 4 | PostScript New Century Schoolbook 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-36.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage[T1]{fontenc} 3 | \usepackage{ccfonts,eulervm} 4 | \begin{document} 5 | Test text 6 | \end{document} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-8.tex: -------------------------------------------------------------------------------- 1 | An inter-word dash or, hyphen, as in X-ray. 2 | 3 | A medium dash for number ranges, like 1--2. 4 | 5 | A punctuation dash---like this. 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-51.tex: -------------------------------------------------------------------------------- 1 | \begin{lstlisting}[language=C] 2 | /* hello.c */ 3 | #include 4 | main() { 5 | printf("Hello.\n"); 6 | } 7 | \end{lstlisting} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-37.tex: -------------------------------------------------------------------------------- 1 | \[ A = \begin{bmatrix} 2 | a_{11} & \dots & a_{1n} \\ 3 | & \ddots & \vdots \\ 4 | 0 & & a_{nn} 5 | \end{bmatrix}_{n\times n} \] 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-38.tex: -------------------------------------------------------------------------------- 1 | \[ \begin{pmatrix} 2 | 1 & \frac 12 & \dots & \frac 1n \\ 3 | \hdotsfor{4} \\ 4 | m & \frac m2 & \dots & \frac mn 5 | \end{pmatrix} \] 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-20.tex: -------------------------------------------------------------------------------- 1 | \[ \left. 2 | \int_0^x f(t,\lambda) \,\mathrm{d}t 3 | \right|_{x=1}, \qquad 4 | \lambda \in 5 | \left[\frac12,\infty\right). \] 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-2-12.tex: -------------------------------------------------------------------------------- 1 | \begin{sidewaysfigure}[p] 2 | \centering 3 | \includegraphics[width=7in]{photo.jpg} 4 | \caption{贵州少数民族地区剪影} 5 | \end{sidewaysfigure} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-47.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{float} 2 | \begin{figure}[H] 3 | \centering 4 | \includegraphics[height=1cm]{lion.eps} 5 | \caption{不浮动的图表} 6 | \end{figure} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-4-12.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{cccc} 2 | No & No & \cellcolor{lightgray}Yes & No \\ 3 | \cellcolor{lightgray}Yes & No & No & No \\ 4 | \end{tabular} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-77.tex: -------------------------------------------------------------------------------- 1 | \newsavebox{\verbbox} % 通常在导言区定义 2 | \begin{lrbox}{\verbbox} 3 | \verb|#$%^&{}| 4 | \end{lrbox} 5 | \usebox{\verbbox} \fbox{\usebox{\verbbox}} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-5.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{ragged2e} 2 | \RaggedRight 3 | English words like `technology' stem from a 4 | Greek root beginning with the letters τεχ\dots 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-1-1.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \begin{document} 3 | \tableofcontents 4 | \section{Foo} 5 | \subsection{blah} 6 | \section{Bar} 7 | \end{document} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-2-2.tex: -------------------------------------------------------------------------------- 1 | \begin{align} 2 | c^2 &= a^2 + b^2 3 | \label{eq:gougu-formula} \\ 4 | 5^2 &= 3^2 + 4^2 5 | \label{eq:gougu-example} 6 | \end{align} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-13.tex: -------------------------------------------------------------------------------- 1 | \renewcommand\*{% 2 | \discretionary{\,\mbox{$\cdot$}}{}{}} 3 | \fbox{\parbox{17em}{% 4 | $F(x,y,z)\* G(x,y,z)$ 不同于 $F(x,y,z)\* G(x,y,z)$}} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-17.tex: -------------------------------------------------------------------------------- 1 | \zihao{7}% 5.5bp 2 | \setlength{\abovedisplayskip}% 3 | {2pt plus 1pt minus 3pt} 4 | 当文字非常小时也应该同时减小 5 | 显示公式与文字的间距: 6 | \[ 1+2+3+4+5 = 15 \] 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-12.tex: -------------------------------------------------------------------------------- 1 | \renewcommand\arraystretch{2} 2 | \begin{tabular}{|l|r|} 3 | \hline 4 | 这是一个 & 宽松的表格 \\ \hline 5 | loose & table \\ \hline 6 | \end{tabular} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-14.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{|r|r|} 2 | \hline 3 | \multicolumn{2}{|c|}{成绩} \\ \hline 4 | 语文 & 数学 \\ \hline 5 | 87 & 100 \\ \hline 6 | \end{tabular} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-49.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \draw (0,0) circle (1); 3 | \coordinate[label=120:$P$] (P) at (120:1); 4 | \draw (0,0) -- (P); 5 | \end{tikzpicture} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-52.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | % 从 0 度到 360 度的正弦函数曲线,rad 函数和单位 r 把度转换为弧度 3 | \draw[domain=0:rad(360)] plot (\x, {sin(\x r)}); 4 | \end{tikzpicture} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-2-4.tex: -------------------------------------------------------------------------------- 1 | % XeLaTeX 编译 2 | \usepackage[noindent,UTF8]{ctexcap} 3 | \setCJKsansfont[ItalicFont={华文新魏}]{黑体} 4 | \renewcommand\CJKfamilydefault{\CJKsfdefault} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-16.tex: -------------------------------------------------------------------------------- 1 | % myarticle.cls 2 | \ProvidesClass{myarticle}[2010/10/10 v1.0] 3 | \LoadClass[a4paper,11pt]{article} 4 | \RequirePackage{boldemph}[2010/10/10] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-15.tex: -------------------------------------------------------------------------------- 1 | A sentence. And another. 2 | 3 | U.S.A. means United States Army? 4 | 5 | Tinker et al.\ made the double play. 6 | 7 | Roman number XII\@. Yes. 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-26.tex: -------------------------------------------------------------------------------- 1 | \sffamily 2 | \textbf{This is a paragraph of bold and 3 | \textit{italic font, sometimes returning 4 | to \textnormal{normal font} is necessary.}} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-57.tex: -------------------------------------------------------------------------------- 1 | \lstset{language=C,flexiblecolumns, 2 | escapechar=`} 3 | \begin{lstlisting} 4 | double x = 1/sin(x); // `$\frac1{\sin x}$` 5 | \end{lstlisting} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-18.tex: -------------------------------------------------------------------------------- 1 | \newenvironment{myabstract}[1][摘要]% 2 | {\small 3 | \begin{center}\bfseries #1\end{center}% 4 | \begin{quotation}}% 5 | {\end{quotation}} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-2.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{accents} 2 | $\accentset{*}{A}$, $\accentset{@}{X}$, 3 | $\underaccent{\check}{a}$, 4 | $\underaccent{\hat}{b}$, 5 | $\undertilde{abc}$ 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-21.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | \Pr \left( X>\frac12 3 | \middle\vert Y=0 \right) 4 | = \left. 5 | \int_0^1 p(t)\,\mathrm{d}t 6 | \middle/ ( N^2+1 ) \right. 7 | \] 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-4.tex: -------------------------------------------------------------------------------- 1 | \newtagform{bracket}[\textit]{[}{]} 2 | \usetagform{bracket} 3 | \begin{equation} 4 | \sum_{k=1}^n \frac1k = \ln n + \mathrm{C} 5 | \end{equation} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-5.tex: -------------------------------------------------------------------------------- 1 | \renewcommand\theequation{% 2 | \thechapter.\roman{equation}} 3 | \begin{equation}\label{eq:euler} 4 | \chi = V + F - E = 2 5 | \end{equation} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-7.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{|c|r@{.}l|} 2 | \hline 3 | 收入 & 12345&6 \\ \hline 4 | 支出 & 765&43 \\ \hline 5 | 节余 & 11580&17 \\ \hline 6 | \end{tabular} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-48.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \draw (0,0) circle (1); 3 | \fill (120:1) circle (2pt); 4 | \node[above left] (P) at (120:1) {$P$}; 5 | \end{tikzpicture} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-76.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{asymptote} 2 | \begin{asy} 3 | real r = 0.8cm; 4 | for (int i = 0; i < 360; i+=10) 5 | draw(circle(dir(i)*r, r)); 6 | \end{asy} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-11.tex: -------------------------------------------------------------------------------- 1 | % 导言区 2 | \AtBeginSection[]{ % 空的可选项表示 \section* 前不加目录 3 | \begin{frame}{本节提要} 4 | \tableofcontents[currentsection] 5 | \end{frame} 6 | } 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-17.tex: -------------------------------------------------------------------------------- 1 | \begin{frame} 2 | \begin{block}{块标题} 3 | 这是一个区块 4 | \end{block} 5 | 6 | \begin{block}{}% 无标题 7 | 这是另一个区块 8 | \end{block} 9 | \end{frame} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-2-2.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{pgfplotstable} 2 | \pgfplotstabletypeset{ 3 | Input Output 4 | -1 10 5 | 0 1500 6 | 1 1235.7 7 | 2 1.53e6 8 | } 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/gloss/testgls.gls: -------------------------------------------------------------------------------- 1 | \begin{theglossary} 2 | 3 | \item \LaTeX:基于 \TeX{} 的文档处理系统。\dotfill 1 4 | \item Makeindex:索引排序程序。\dotfill 2 5 | 6 | \end{theglossary} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-17.tex: -------------------------------------------------------------------------------- 1 | \begin{description} 2 | \item[中文] 中国的语言文字 3 | \item[English] The language of England 4 | \item[Français] La langue de France 5 | \end{description} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-3.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{bm} 2 | % \hm 的效果需要实际字体支持 3 | \textbf{勾股定理 $\bm{a^2+b^2=c^2}$} 4 | \[ \bm u + \bm v = (1,0) + (0,1) \] 5 | \[ \hm\int > \bm\int > \int \] 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-3-8.tex: -------------------------------------------------------------------------------- 1 | \begin{equation} 2 | \varlimsup_{k\to\infty} A_k = \lim_{J\to\infty} \lim_{K\to\infty} 3 | \bigcap_{j=1}^J \bigcup_{k=j}^K A_k 4 | \end{equation} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-9.tex: -------------------------------------------------------------------------------- 1 | \newcommand\D{\displaystyle} 2 | \[ \mathop{\text{\Large$\D\sum_i$}} 3 | \dfrac{\D\int f_i(x)\,\mathrm{d}x} 4 | {\D\oint g_i(x)\,\mathrm{d}x} \] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-16.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{|c|r|r|} 2 | \hline 3 | & \multicolumn{2}{c|}{成绩} \\ \cline{2-3} 4 | 姓名 & 语文 & 数学 \\ \hline 5 | 张三 & 87 & 100 \\ \hline 6 | \end{tabular} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-30.tex: -------------------------------------------------------------------------------- 1 | \begin{pspicture}(-1,-1.2)(3.5,1.2) 2 | \psaxes{->}(0,0)(0,-1.2)(3.5,1.2) 3 | \psplot{0}{3.5}{x 180 Pi div mul sin} % 三角函数单位是度 4 | \end{pspicture} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-45.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \draw[->] (-1.2,0) -- (1.2,0); 3 | \draw[->] (0,-1.2) -- (0,1.2); 4 | \draw[thick] (0,0) circle (1); 5 | \end{tikzpicture} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-7.tex: -------------------------------------------------------------------------------- 1 | % beamer 导言区 2 | \title{杂谈勾股定理} 3 | \subtitle{数学史讲座之一} 4 | \institute{九章学堂} 5 | \author{张三} 6 | \date{\today} 7 | \subject{勾股定理} 8 | \keywords{勾股定理, 历史} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/7-3-1.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage{amsmath} 3 | \begin{document} 4 | \[ 5 | \cases{ a & b \cr 6 | c & d \cr} 7 | \] 8 | \end{document} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/1-1-2.tex: -------------------------------------------------------------------------------- 1 | \documentclass[UTF8]{ctexart} 2 | \begin{document} 3 | \section{文字} 4 | 特可爱排版。 5 | \section{数学} 6 | \[ 7 | a^2 + b^2 = c^2 8 | \] 9 | \end{document} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-56.tex: -------------------------------------------------------------------------------- 1 | \CJKunderdot{汉字,下加点}\\ 2 | \CJKunderline{汉字,下划线} \\ 3 | \CJKunderdblline{汉字,下划线} \\ 4 | \CJKunderwave{汉字,下划线} \\ 5 | \CJKsout{汉字,删除线}\\ 6 | \CJKxout{汉字,删除线} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-10.tex: -------------------------------------------------------------------------------- 1 | \begin{alignat*}{6} 2 | &1 & &+2 & &+3 & &+4 & &+5 & &=15 \\ 3 | &1 & & & &+3 & & & &+5 & &=9 \\ 4 | & & &+2 & & & &+4 & & & &=6 5 | \end{alignat*} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-3-8.tex: -------------------------------------------------------------------------------- 1 | \begin{itemize} 2 | \item<+-| alert@+> 3 | 公元前 6 世纪,毕达哥拉斯学派发现一个法则,可以构造直角三角形的边长; 4 | \item<+-| alert@+> 5 | 公元前 3 世纪,欧几里德《几何原本》使用面积法证明勾股定理。 6 | \end{itemize} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-23.tex: -------------------------------------------------------------------------------- 1 | \renewcommand\theenumi{\roman{enumi}} 2 | \renewcommand\labelenumi{(\theenumi)} 3 | \begin{enumerate} 4 | \item 使用中文 5 | \item Using English 6 | \end{enumerate} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-6.tex: -------------------------------------------------------------------------------- 1 | \citeauthor{Abrahams1990} \\ 2 | \citefullauthor{Abrahams1990} \\ % 或加 * 3 | \citeyear{Abrahams1990} \\ 4 | \citeyearpar{Abrahams1990} \\ 5 | \citenum{Abrahams1990} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-7.tex: -------------------------------------------------------------------------------- 1 | \citealt{Patashnik1988:btxdoc}\\ 2 | \citealp{Patashnik1988:btxdoc}\\% 有逗号 3 | \citetext{同前} \\ 4 | \citetext{参见 \citealp{Shell2007}, 5 | 以及 \citealp{Markey2009}} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-14.tex: -------------------------------------------------------------------------------- 1 | \begin{align*} 2 | & \int f(x)\,\mathrm{d}x\,\mathrm{d}y \\ 3 | & \sqrt2 \, x && \sqrt{\,\log x} \\ 4 | & x^2 \! / 2 && |\!{\gets} 5 {\to}\!| 5 | \end{align*} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-16.tex: -------------------------------------------------------------------------------- 1 | \newcommand\lowint{% 2 | \mspace{2mu}\underline{\vphantom{\int}\mspace{7mu}}\mspace{-9mu}\int} 3 | \[ 4 | \lowint_a^b f(x)\,\mathrm{d}x = \inf_P s(P). 5 | \] 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-31.tex: -------------------------------------------------------------------------------- 1 | \psset{algebraic=true} 2 | \begin{pspicture}(-1,-1.2)(3.5,1.2) 3 | \psaxes{->}(0,0)(0,-1.2)(3.5,1.2) 4 | \psplot{0}{3.5}{sin(x)} % 三角函数单位是弧度 5 | \end{pspicture} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-2-5.tex: -------------------------------------------------------------------------------- 1 | \documentclass[no-math]{beamer} 2 | \usepackage[noindent,UTF8]{ctexcap} 3 | \setCJKsansfont[ItalicFont={华文新魏}]{黑体} 4 | \renewcommand\CJKfamilydefault{\CJKsfdefault} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-3-9.tex: -------------------------------------------------------------------------------- 1 | \newdimen\xoffset 2 | \begin{frame} 3 | % 第一步是静止的,之后自动运动 4 | \animate<2-10> 5 | \animatevalue<1-10>{\xoffset}{0cm}{5cm} 6 | \hspace{\xoffset}从左到右 7 | \end{frame} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-20.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{makecell} 2 | \begin{tabular}{|r|r|} 3 | \hline 4 | \thead{处理前\\数据} & 5 | \thead{处理后\\数据} \\ \hline 6 | 4934 & 8945 \\ 7 | \hline 8 | \end{tabular} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-46.tex: -------------------------------------------------------------------------------- 1 | \usepackage{caption} 2 | \usepackage{subcaption} 3 | \captionsetup[sub]{font={small,it}} % 设置所有子标题 4 | \captionsetup[subtable]{labelformat=simple,labelsep=colon} % 设置子表格 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-14.tex: -------------------------------------------------------------------------------- 1 | Question~1 % 名称与编号间 2 | Donald~E. Knuth % 教名之间,但姓可以断行 3 | Mr.~Knuth % 称谓缩写与名字间 4 | function~$f(x)$ % 名字后的短公式 5 | 1,~2, and~3 % 序列的部分符号间 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-54.tex: -------------------------------------------------------------------------------- 1 | % 导言区用 \usepackage{ulem} 2 | \uline{Emphasized} text and \uline{another}. 3 | 4 | A \emph{very very very very very very very 5 | very very very very very} long sentence. 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-31.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{enumitem} 2 | \begin{enumerate}[itemsep=0pt,parsep=0pt, 3 | label=(\arabic*)] 4 | \item 中文 5 | \item English 6 | \item Français 7 | \end{enumerate} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-39.tex: -------------------------------------------------------------------------------- 1 | \[ \begin{pmatrix} 2 | \begin{matrix} 1&0\\0&1 \end{matrix} 3 | & \text{\Large 0} \\ 4 | \text{\Large 0} & 5 | \begin{matrix} 1&0\\0&-1 \end{matrix} 6 | \end{pmatrix} \] 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-22.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{mathtools} 2 | \[ \text{比较曲线} 3 | \left\{ \begin{lgathered} 4 | x = \sin t, y = \cos t \\ 5 | x = t + \sin t, y = \cos t 6 | \end{lgathered} \right. \] 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-15.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{|r|r|} 2 | \hline 3 | \multicolumn{1}{|c|}{输入} & 4 | \multicolumn{1}{c|}{输出} \\ \hline 5 | 1 & 1 \\ 5 & 25 \\ 15 & 225 \\ \hline 6 | \end{tabular} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-19.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{makecell} 2 | \begin{tabular}{|r|r|} 3 | \hline 4 | \makecell{处理前\\数据} & 5 | \makecell{处理后\\数据} \\ \hline 6 | 4934 & 8945 \\ 7 | \hline 8 | \end{tabular} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-54.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{picinpar} 2 | \begin{figwindow}[2,c,% 跨过段落的前两行,中间位置 3 | \includegraphics{lion.eps},Lion\label{fig:wraplion}] 4 | \lipsum*[1] % 足够长的文本段落 5 | \end{figwindow} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-2-4.markdown: -------------------------------------------------------------------------------- 1 | C 语言的循环语句 2 | ================ 3 | 4 | C 语言可以使用 `for` 循环语句,例如计算 $s = \sum_k k^2$: 5 | 6 | int s = 0; 7 | for (int k = 1; k < 10; ++k) 8 | s += k * k; 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-33.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{enumitem} 2 | \AddEnumerateCounter{\chinese}{\chinese}{} 3 | \begin{enumerate}[label={\chinese*、},labelsep=0pt] 4 | \item 内容清晰 5 | \item 格式美观 6 | \end{enumerate} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-38.tex: -------------------------------------------------------------------------------- 1 | % 导言区 2 | \usepackage{theorem} 3 | \theoremstyle{changebreak} 4 | \theoremheaderfont{\sffamily\bfseries} 5 | \theorembodyfont{\normalfont} 6 | \newtheorem{definition}{定义}[chapter] 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-3-6.tex: -------------------------------------------------------------------------------- 1 | % languages.tex 2 | % 整个文档的主文件 3 | \documentclass{ctexbook} 4 | \usepackage{syntonly} 5 | \syntaxonly % 只检查语法,不输出 DVI/PDF 文件 6 | \begin{document} 7 | …… 8 | \end{document} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-3.tex: -------------------------------------------------------------------------------- 1 | % 导言区 2 | % \usepackage{natbib} 3 | % \bibliographystyle{plainnat} 4 | % 正文 5 | 在 \citet{lamport1994} 中提到了利用 \BibTeX{} 自动处理文献的方式, 6 | 在另一本书 \citep{mittelbach2004} 中则有进一步的格式与工具的说明。 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-18.tex: -------------------------------------------------------------------------------- 1 | $\overleftarrow{a+b}$\\ 2 | $\overrightarrow{a+b}$\\ 3 | $\overleftrightarrow{a+b}$\\ 4 | $\underleftarrow{a-b}$\\ 5 | $\underrightarrow{a-b}$\\ 6 | $\underleftrightarrow{a-b}$ 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-19.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{mathtools} 2 | \[ \left\lvert x - \frac12 \right\rvert 3 | = \begin{dcases} 4 | x-\frac12, & x \geq \frac12;\\ 5 | \frac12-x, & x < \frac12. 6 | \end{dcases} \] 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-39.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{hhline} 2 | \begin{tabular}{|c||cc|} 3 | \hhline{|=:t:==|} 4 | 半径 & 周长 & 面积 \\ 5 | \hhline{|=::==|} 6 | 1.00 & 6.28 & 6.28 \\ 7 | \hhline{|=:b:==|} 8 | \end{tabular} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-5.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{|rr|} 2 | \hline 3 | 输入 & 输出 \\ \hline 4 | $-2$ & 4 \\ 5 | 0 & 0 \\ 6 | 2 & 4 \\ 7 | \hline 8 | \end{tabular} 9 | \qquad 10 | 输入与输出有关系 $y = x^2$。 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-35.tex: -------------------------------------------------------------------------------- 1 | \begin{figure} 2 | \ContinuedFloat 3 |  …… 4 | \caption{某图形} 5 | \end{figure} 6 | \begin{figure} 7 | \ContinuedFloat 8 |  …… 9 | \caption{某图形(续)} 10 | \end{figure} 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-4-9.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{colortbl} 2 | % \usepackage{xcolor} 3 | \begin{tabular}{>{\columncolor{gray}}c >{\columncolor{lightgray}}c} 4 | 深 & 浅 \\ 5 | darker & lighter \\ 6 | \end{tabular} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/7-1-1.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} % 包含错误的文档 2 | \begin{document} 3 | \secton{Start} 4 | A simple equation 5 | \begin{equation} 6 | x = \overline{a+b 7 | \end{equation} 8 | \end{document} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/7-1-3.tex: -------------------------------------------------------------------------------- 1 | % 将 txfonts 定义的重积分符号定义为 \TXFiint,保留原来 amsmath 的 \iint 2 | \usepackage{savesym} 3 | \usepackage{amsmath} 4 | \savesymbol{iint} 5 | \usepackage{txfonts} 6 | \restoresymbol{TXF}{iint} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/7-3-2.tex: -------------------------------------------------------------------------------- 1 | \documentclass{minimal} 2 | \usepackage{amsmath} 3 | \listfiles 4 | \begin{document} 5 | \[ 6 | \cases{ a & b \cr 7 | c & d \cr} 8 | \] 9 | \end{document} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-24.tex: -------------------------------------------------------------------------------- 1 | \begin{pspicture}(-0.5,0)(1.2,1.2) 2 | \psaxes[labels=none,ticks=none]{->}(1.2,1.2) 3 | \pswedge[fillstyle=solid,fillcolor=gray, 4 | opacity=0.2](0,0){1}{0}{120} 5 | \end{pspicture} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-37.tex: -------------------------------------------------------------------------------- 1 | % 在导言区设置全文字体为 Windows 提供的 2 | % Times New Roman, Verdana, Courier New 字体 3 | \usepackage{fontspec} 4 | \setmainfont{Times New Roman} 5 | \setsansfont{Verdana} 6 | \setmonofont{Courier New} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-53.tex: -------------------------------------------------------------------------------- 1 | \lstset{flexiblecolumns}% column=flexible 2 | \begin{lstlisting}[language=C] 3 | /* hello.c */ 4 | #include 5 | main() { 6 | printf("Hello.\n"); 7 | } 8 | \end{lstlisting} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-22.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{multirow,makecell} 2 | \begin{tabular}{|c|r|} 3 | \hline 4 | \multirowcell{3}{各科\\成绩} & 78 \\ 5 | \cline{2-2} & 82 \\ \cline{2-2} 6 | & 86 \\ \hline 7 | \end{tabular} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-36.tex: -------------------------------------------------------------------------------- 1 | \begin{pspicture}(-1.5,-0.5)(1.5,0.5) 2 | \pscircle*(0,0){0.5} 3 | \rput(-1,0){ 4 | \pscircle(0,0){0.5} 5 | } 6 | \rput(1,0){ 7 | \pscircle(0,0){0.5} 8 | } 9 | \end{pspicture} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-6.tex: -------------------------------------------------------------------------------- 1 | \setlength{\leftskip}{4em} 2 | \setlength{\rightskip}{1em} 3 | These parameters tell \TeX{} how much glue 4 | to place at the left and at the right end 5 | of each line of the current paragraph. 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-13.tex: -------------------------------------------------------------------------------- 1 | \fancypagestyle{plain}{% 2 | \fancyhf{} 3 | \cfoot{--\textit{\thepage}--} % 改变页码形状 4 | \renewcommand\headrulewidth{0pt} % 无页眉线 5 | \renewcommand\footrulewidth{0pt} % 无页脚线 6 | } 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-11.tex: -------------------------------------------------------------------------------- 1 | % 第 1 列前是原始间距,第 2 列前只有 1em 间距 2 | % 第 3、4 列前则是原始间距加 1em 3 | \begin{tabular}{|c|@{\extracolsep{1em}}c|c|c|} 4 | \hline 5 | 1 & 2 & 3 & 4 \\ 6 | 1 & 2 & 3 & 4 \\ 7 | \hline 8 | \end{tabular} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-17.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{|c|} 2 | \hline 3 | 1 \\ \hline 4 | \begin{tabular}{@{}c|c@{}} 1 & 2 \end{tabular} \\ \hline 5 | \begin{tabular}{@{}c|c|c@{}} 1 & 2 & 3\end{tabular} \\ \hline 6 | \end{tabular} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-7.tex: -------------------------------------------------------------------------------- 1 | \begin{equation} 2 | \begin{gathered} \xymatrix{ 3 | S\ar[r]^{f_s} \ar[d]_{\lambda} 4 | & T\ar[d]^{\bar\lambda} \\ 5 | S' \ar[r]_{f_{s'}} & T' \\ 6 | } \end{gathered} 7 | \end{equation} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-70.tex: -------------------------------------------------------------------------------- 1 | % 导言区使用 2 | \usepackage[shellescape,latex]{gmp} 3 | \usempxpackage{CJKutf8} 4 | \mpxcommands{ 5 | \AtBeginDocument{\begin{CJK*}{UTF8}{gbsn}} 6 | \AtEndDocument{\clearpage\end{CJK*}} 7 | } 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-40.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage{ccfonts}% 公式使用 Concrete 系列字体 3 | \usepackage[no-math]{fontspec}% \mathrm 等也使用 Concrete 系列字体 4 | \setmainfont{Latin Modern Mono Prop}% 正文使用 Ladin Modern Mono 字体 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-14.tex: -------------------------------------------------------------------------------- 1 | \setlength{\multlinegap}{3em} 2 | \setlength{\multlinetaggap}{3em} 3 | \begin{multline*} 4 | 1+2+3 \\ \shoveleft{+4+5+6} \\ 5 | +7+8+9 \\ 6 | \shoveright{+10+11+12} \\ +13+14+15 7 | \end{multline*} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-25.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular*}{\textwidth}{|c@{\extracolsep{\fill}}ccccc|} 2 | \hline 3 | 数字 & 1 & 2 & 3 & 4 & 5 \\ 4 | 字母 & A & B & C & D & E \\ 5 | 天干 & 甲 & 乙 & 丙 & 丁 & 戊 \\ 6 | \hline 7 | \end{tabular*} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-2-6.tex: -------------------------------------------------------------------------------- 1 | \setbeamertemplate{itemize items}[circle] 2 | \setbeamercolor{itemize item}[fg=black] 3 | \setbeamercolor{itemize/enumerate body}{fg=gray} 4 | \setbeamerfont{itemize/enumerate body}{family=\rmfamily} 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-43.tex: -------------------------------------------------------------------------------- 1 | \[ \setcounter{MaxMatrixCols}{15} 2 | \begin{Bmatrix} 3 | 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 1 & 1 & 1 & 0 & 1\\ 4 | 1 & 1 & 1 & 1 & 1 & 0 & 1 & 0 & 1 & 1 & 0 & 0 & 0 & 1 & 0 5 | \end{Bmatrix} \] 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-18.tex: -------------------------------------------------------------------------------- 1 | \begin{equation}\label{eq:dirichlet} 2 | D(x) = \begin{cases} 3 | 1, & \text{if } x \in \mathbb{Q}; \\ 4 | 0, & \text{if } x \in 5 | \mathbb{R}\setminus\mathbb{Q}. 6 | \end{cases} 7 | \end{equation} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-24.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{mathtools} 2 | \newcommand\Set[2]{% 3 | \left\{#1\ \middle\vert\ #2 \right\}} 4 | \[ \Omega = \Set{x}{\begin{multlined} 5 | x^7+x^6+x^5 \\ +x^4+x^3+x^2 \\ +x+1=0 6 | \end{multlined}} \] 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-21.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{rotating,makecell} 2 | \settowidth\rotheadsize{\theadfont 数学课} 3 | \begin{tabular}{|c|c|} 4 | \hline 5 | \thead{姓名} & \rothead{数学课\\成绩} \\\hline 6 | 张三 & 100 \\\hline 7 | \end{tabular} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-2.tex: -------------------------------------------------------------------------------- 1 | \begin{figure}[htp] 2 | \centering 3 | \includegraphics{lion.eps} 4 | \caption[小狮子]{\TeX{} 系统的吉祥物——小狮子}\label{fig-lion} 5 | % 或作 \caption[小狮子]{\label{fig-lion}\TeX{} 系统的吉祥物——小狮子} 6 | \end{figure} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-22.tex: -------------------------------------------------------------------------------- 1 | \psset{linewidth=0.4pt} 2 | \begin{pspicture}(-1.2,-1.2)(1.2,1.2) 3 | \psaxes[labels=none,ticks=none] 4 | {->}(0,0)(-1.2,-1.2)(1.2,1.2) 5 | \pscircle[linewidth=0.8pt](0,0){1} 6 | \end{pspicture} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-41.tex: -------------------------------------------------------------------------------- 1 | \documentclass[no-math]{ctexart} 2 | \usepackage[utopia]{mathdesign}% 数字字体使用 mathdesign 与 Utopia 3 | \usepackage[EU1]{fontenc}% 恢复正文字体的 Unicode 编码 4 | \setmainfont{Utopia Std}% 正文字体使用 OpenType 格式的 Adobe Utopia 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-10.tex: -------------------------------------------------------------------------------- 1 | % 单位 pt,中文五号字(10.5 bp) 2 | \DeclareMathSizes{10.54}{10.54}{6.32}{4.22} 3 | % 默认标号尺寸是正文 0.6 倍 4 | \renewcommand\defaultscriptratio{0.6} 5 | % 默认小标号尺寸是正文 0.4 倍 6 | \renewcommand\defaultscriptscriptratio{0.4} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-49.tex: -------------------------------------------------------------------------------- 1 | \floatstyle{ruled} 2 | \restylefloat{flowchart} 3 | % 正文 4 | \begin{flowchart} 5 | \fbox{A} $\longrightarrow$ \fbox{B} \\ 6 | \fbox{C} $\longrightarrow$ \fbox{D} 7 | \caption{基本流程图} 8 | \end{flowchart} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/temperature.csv: -------------------------------------------------------------------------------- 1 | 华式,摄式,开尔文 2 | 1,-17.22222222,255.9277778 3 | 20,-6.666666667,266.4833333 4 | 40,4.444444444,277.5944444 5 | 60,15.55555556,288.7055556 6 | 80,26.66666667,299.8166667 7 | 100,37.77777778,310.9277778 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-29.tex: -------------------------------------------------------------------------------- 1 | \newenvironment{myitemize}{% 2 | \begin{list}{\textbullet}{% 3 | \setlength{\topsep}{0pt} \setlength{\partopsep}{0pt} 4 | \setlength{\parsep}{0pt} \setlength{\itemsep}{0pt}}} 5 | {\end{list}} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-1-6.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{tocloft} 2 | \renewcommand\cfttoctitlefont{\hfill\Large\sffamily\bfseries} 3 | \renewcommand\cftaftertoctitle{\hfill} 4 | \setlength\cftbeforetoctitleskip{2ex} 5 | \setlength\cftaftertoctitleskip{2ex} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-17.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{breqn} 2 | \begin{dmath}\label{eq:trigonometric} 3 | \frac12 (\sin(x+y) + \sin(x-y)) = \frac12(\sin x\cos y + \cos x\sin y) 4 | + \frac12(\sin x\cos y - \cos x\sin y) = \sin x\cos y 5 | \end{dmath} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-18.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{multirow} 2 | \begin{tabular}{|c|r|r|} 3 | \hline 4 | \multirow{2}*{姓名} & 5 | \multicolumn{2}{c|}{成绩} \\ \cline{2-3} 6 | & 语文 & 数学 \\ \hline 7 | 张三 & 87 & 100 \\ \hline 8 | \end{tabular} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-69.tex: -------------------------------------------------------------------------------- 1 | % \usepackage[shellescape]{gmp} 2 | % 使用 xelatex -shell-escape 命令编译 3 | \begin{mpost} 4 | draw ((0,0) -- (0,2) -- (1,3.25) -- (2,2) -- (2,0) 5 | -- (0,2) -- (2,2) -- (0,0) -- (2,0)) scaled 1cm; 6 | \end{mpost} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-8.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{lettrine} 2 | \lettrine{T}{he} \TeX{} in \LaTeX{} refers 3 | to Donald Knuth's \TeX{} typesetting system. 4 | The \LaTeX{} program is a special version of 5 | \TeX{} that understands \LaTeX{} commands. 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-6.tex: -------------------------------------------------------------------------------- 1 | % 关系符后对齐,需要使用空的分组 2 | % 代替关系符右侧符号,保证间距 3 | \begin{align*} 4 | & (a+b)(a^2-ab+b^2) \notag \\ 5 | ={} & a^3 - a^2b + ab^2 + a^2b 6 | - ab^2 + b^2 \notag \\ 7 | ={} & a^3 + b^3 \label{eq:cubesum} 8 | \end{align*} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-42.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{arydshln} 2 | \begin{tabular}{;{8pt/2pt}cc;{2pt/2pt}cc;{8pt/2pt}} 3 | \hdashline[8pt/2pt] 4 | 上 & 上 & 上 & 上 \\ 5 | \cdashline{1-2}[2pt/2pt] 6 | 下 & 下 & 下 & 下 \\ 7 | \hdashline[8pt/2pt] 8 | \end{tabular} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-60.mp: -------------------------------------------------------------------------------- 1 | input metaobj; 2 | beginfig(1); 3 | x = new_Tree( new_Box(btex root etex) ) 4 | ( new_Circle(btex child etex), 5 | new_Circle(btex child etex)); 6 | Obj(x).c=origin; 7 | draw_Obj(x); 8 | endfig; 9 | end. 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-43.tex: -------------------------------------------------------------------------------- 1 | % XeLaTeX 编译 2 | \documentclass[UTF8]{ctexart} 3 | % 不需要 tipa 宏包,xunicode 已经实现其功能 4 | \setmainfont{CMU Serif} % Computer Modern Roman 的 Unicode 版本 5 | \begin{document} 6 | \LaTeX{} 读音为 \textipa{["lA:tEx]}。 7 | \end{document} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-20.tex: -------------------------------------------------------------------------------- 1 | \documentclass[openbib]{article} 2 | \bibliographystyle{plain} 3 | \begin{document} 4 | \TeX{} and \LaTeX{} see \cite{knuthtex1986}, \cite{Lamport1994}. 5 | \nocite{mittelbach2004} 6 | \bibliography{tex} 7 | \end{document} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-2-29.tex: -------------------------------------------------------------------------------- 1 | \newcommand\stiring[2]{\genfrac{[}{]}{0pt}{}{#1}{#2}} 2 | \newcommand\dstiring[2]{\genfrac{[}{]}{0pt}{0}{#1}{#2}} 3 | \newcommand\tstiring[2]{\genfrac{[}{]}{0pt}{1}{#1}{#2}} 4 | \[ \stiring{n}{1} = (n-1)!, \qquad n > 0. \] 5 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-21.tex: -------------------------------------------------------------------------------- 1 | \begin{equation*} 2 | \begin{split} 3 | f(x) &= \left(\vphantom{\frac1x} 4 | x+2+3+4\right. \\ 5 | & \left.\phantom{=\biggl(x+{}} 6 | 5+6+7+\frac1x \right)^2 \\ 7 | &= g(x) 8 | \end{split} 9 | \end{equation*} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-75.asy: -------------------------------------------------------------------------------- 1 | import solids; 2 | size(4cm); 3 | currentprojection = orthographic(1, 1, 1); 4 | real a = 4; 5 | real h = 2.2a; 6 | draw(scale3(a) * unitsphere, white); 7 | draw(shift((a/2,0,-h/2)) * scale(a/2,a/2,h) * unitcylinder, gray); 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/1-2-5.tex: -------------------------------------------------------------------------------- 1 | \begin{table}[H] 2 | \begin{tabular}{|rrr|} 3 | \hline 4 | 直角边 $a$ & 直角边 $b$ & 斜边 $c$\\ 5 | \hline 6 | 3 & 4 & 5 \\ 7 | 5 & 12 & 13 \\ 8 | \hline 9 | \end{tabular}% 10 | \qquad 11 | ($a^2 + b^2 = c^2$) 12 | \end{table} 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-54.tex: -------------------------------------------------------------------------------- 1 | \lstset{columns=flexible, 2 | numbers=left,numberstyle=\footnotesize} 3 | \begin{lstlisting}[language=C] 4 | /* hello.c */ 5 | #include 6 | main() { 7 | printf("Hello.\n"); 8 | } 9 | \end{lstlisting} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-26.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{tabularx} 2 | \begin{tabularx}{\textwidth}{|c|X|X|X|X|X|} 3 | \hline 4 | 数字 & 1 & 2 & 3 & 4 & 5 \\ \hline 5 | 字母 & A & B & C & D & E \\ \hline 6 | 天干 & 甲 & 乙 & 丙 & 丁 & 戊 \\ 7 | \hline 8 | \end{tabularx} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-6.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{|c|rrr|p{4em}|} 2 | \hline 3 | 姓名 & 语文 & 数学 & 外语 & 备注 \\ 4 | \hline 5 | 张三 & 87 & 100 & 93 & 优秀 \\ 6 | 李四 & 75 & 63 & \emph{52} & 补考另行通知 \\ 7 | 王小二 & 80 & 82 & 78 & \\ 8 | \hline 9 | \end{tabular} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-71.tex: -------------------------------------------------------------------------------- 1 | \begin{mpost*}[mpsettings={u:=\mpdim{0.4\linewidth};}] 2 | fill (0,0) -- (u, 1pt) -- (2u, 0) -- (u, -1pt) -- cycle; 3 | label.top(btex 示例 etex, (u, 1pt)); 4 | label.bot(btex \textit{Example} etex, (u, -1pt)); 5 | \end{mpost*} 6 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-11.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{etoolbox} 2 | \sffamily 3 | \ifnumcomp{\value{page}+1}>{10*10}{大页码}{小页码}, 4 | \ifboolexpr{not test {\ifnumodd{\value{page}}} 5 | and test {\ifdimcomp{\linewidth}>{5cm+20pt/2}}}% 6 | {是}{不是}% 7 | 偶数页宽行。 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-48.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{tabu} 2 | \begin{tabu}{ccc} 3 | \hline 4 | \rowfont{\bfseries} 5 | 姓名 & 得分 & 额外加分 \\ 6 | \hline 7 | 张三 & 85 & $+7$ \\ 8 | \rowfont{\itshape} 9 | 李四 & 82 & 0 \\ 10 | 王五 & 70 & $-2$ \\ 11 | \hline 12 | \end{tabu} 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-4-15.tex: -------------------------------------------------------------------------------- 1 | % \usepackage[table]{xcolor} % 将调入 colortbl 2 | % \usepackage{arydshln} % 在 colortbl 后面使用 3 | \rowcolors*[\hline]{1}{black!20}{black!10} 4 | \begin{tabular}{|c:r|} 5 | A & 10 \\ 6 | B & 20 \\ 7 | \hiderowcolors 8 | \end{tabular} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-2.tex: -------------------------------------------------------------------------------- 1 | \makeatletter 2 | \def\beamer@linkspace#1{% 3 | \begin{pgfpicture}{0pt}{-1.5pt}{#1}{5.5pt} 4 | \pgfsetfillopacity{0} 5 | \pgftext[x=0pt,y=-1.5pt]{.} 6 | \pgftext[x=#1,y=5.5pt]{.} 7 | \end{pgfpicture}} 8 | \makeatother 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/gloss/simplegloss.ist: -------------------------------------------------------------------------------- 1 | % simplegloss.ist 2 | % 最简单的手工词汇表 Makeindex 格式 3 | keyword "\\glossaryentry" 4 | preamble "\\begin{theglossary}\n" 5 | postamble "\n\n\\end{theglossary}\n" 6 | group_skip "" 7 | delim_0 "\\dotfill " 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-32.tex: -------------------------------------------------------------------------------- 1 | \usepackage{enumitem} 2 | % 仿照 enumerate 环境定义可二级嵌套的 mylist 3 | \newlist{mylist}{enumerate}{2} 4 | % 分别定义每级的格式 5 | \setlist[mylist,1]{itemsep=0pt,parsep=0pt,label=(\arabic*)} 6 | \setlist[mylist,2]{itemsep=0pt,parsep=0pt,label=(\alph*)} 7 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-9.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{shapepar} 2 | \heartpar{% 3 | 绿草苍苍,白雾茫茫,有位佳人,在水一方。 4 | 绿草萋萋,白雾迷离,有位佳人,靠水而居。 5 | 我愿逆流而上,依偎在她身旁。无奈前有险滩,道路又远又长。 6 | 我愿顺流而下,找寻她的方向。却见依稀仿佛,她在水的中央。 7 | 我愿逆流而上,与她轻言细语。无奈前有险滩,道路曲折无已。 8 | 我愿顺流而下,找寻她的足迹。却见仿佛依稀,她在水中伫立。} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-19.tex: -------------------------------------------------------------------------------- 1 | \newenvironment{Quotation}[1]% 2 | {\newcommand\quotesource{#1}% 3 | \begin{quotation}}% 4 | {\par\hfill ——《\textit{\quotesource}》% 5 | \end{quotation}} 6 | 7 | \begin{Quotation}{易·乾} 8 | 初九,潜龙勿用。 9 | \end{Quotation} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-41.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{arydshln} 2 | \setlength\dashlinedash{1pt} 3 | \setlength\dashlinegap{2pt} 4 | \begin{tabular}{:cc:cc:} 5 | \hdashline 6 | 上 & 上 & 上 & 上 \\ 7 | \cdashline{1-2} 8 | 下 & 下 & 下 & 下 \\ 9 | \hdashline 10 | \end{tabular} 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-3.tex: -------------------------------------------------------------------------------- 1 | % 放宽浮动体的一些参数 2 | \setcounter{topnumber}{3} 3 | \setcounter{bottomnumber}{2} 4 | \setcounter{totalnumber}{7} 5 | \renewcommand\bottomcaption{0.7} 6 | \renewcommand\textfraction{0.1} 7 | % 严格浮动页的要求 8 | \renewcommand\floatpagefraction{0.7} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-4.tex: -------------------------------------------------------------------------------- 1 | % coding: utf-8 2 | % pdflatex 命令编译 3 | \documentclass{article} 4 | \usepackage[OT2,T1]{fontenc} 5 | \usepackage[utf8]{inputenc} 6 | \begin{document} 7 | café \qquad Gödel 8 | {\fontencoding{OT2}\selectfont Крюкова} 9 | \end{document} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-52.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{blkarray} 2 | % 如果不用 &| 说明,则竖线 | 将会被看成是中间一列的内容 3 | \begin{blockarray}{|l|c&|r|} 4 | 张三 & Zhang & 80 \\ 5 | % 不用在 r 后面用 |,也不影响表格线 6 | 李四 & \BAmulticolumn{1}{r}{Li} & 78 \\ 7 | 王五 & Wang & 100 \\ 8 | \end{blockarray} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-55.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{wrapfig} 2 | \begin{wraptable}[4]{r}[1.5cm]{4.5cm} 3 | \centering 4 | \begin{tabular}{|c|c|c|c|} 5 | \hline 甲 & 乙 & 丙 & 丁 \\ \hline 6 | \end{tabular} 7 | \caption{向右伸出的绕排表格}\label{tag:wraptable} 8 | \end{wraptable} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-56.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{shapepar} 2 | % \usepackage{tikz,lipsum} 3 | \cutout{r}(-1cm,1cm)\shapepar[2cm]{\circleshape}% 4 | \begin{tikzpicture}[overlay] 5 | \filldraw[fill=lightgray] (0.5,-0.5) circle (1); 6 | \end{tikzpicture}\par 7 | \small\lipsum[1] 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-12.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{etoolbox} 2 | \begin{math} 3 | \setcounter{enumi}{1} 4 | \whileboolexpr{not test {\ifnumcomp{\value{enumi}}>{30}}}% 5 | { 6 | \mathsf{\theenumi}\rightarrow 7 | \stepcounter{enumi} 8 | } 9 | \cdots 10 | \end{math} 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-23.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{diagbox} 2 | \begin{tabular}{|c|*{4}{c}|} 3 | \hline 4 | \diagbox{天干}{地支} & 子 & 丑 & 寅 & 卯 \\ 5 | \hline 6 | 甲 & 1 && 51 & \\ 7 | 乙 && 2 && 52 \\ 8 | 丙 & 13 && 3 & \\ 9 | 丁 && 14 && 4\\ 10 | \hline 11 | \end{tabular} 12 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-24.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{diagbox} 2 | \begin{tabular}{|c|*{4}{c}|} 3 | \hline 4 | \diagbox{天干}{序号}{地支} & 子 & 丑 & 寅 & 卯 \\ 5 | \hline 6 | 甲 & 1 && 51 & \\ 7 | 乙 && 2 && 52 \\ 8 | 丙 & 13 && 3 & \\ 9 | 丁 && 14 && 4\\ 10 | \hline 11 | \end{tabular} 12 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-8.tex: -------------------------------------------------------------------------------- 1 | \def\bigchinese#1{% 2 | \ifcase\value{#1}% 3 | 零\or 壹\or 贰\or 叁\or 肆\or 伍\or 陆\or 柒\or 捌\or 玖\else 溢出 4 | \fi} 5 | \renewcommand\theenumi{\bigchinese{enumi}} 6 | \begin{enumerate}\sffamily 7 | \item 1 \item 2 \item 3 8 | \end{enumerate} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-28.tex: -------------------------------------------------------------------------------- 1 | \begin{list}{\textbullet}{% 2 | \setlength{\topsep}{0pt} \setlength{\partopsep}{0pt} 3 | \setlength{\parsep}{0pt} \setlength{\itemsep}{0pt}} 4 | \item 中文 5 | 6 | 又一段中文 7 | 8 | \item English 9 | \item Français 10 | \end{list} 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-7.tex: -------------------------------------------------------------------------------- 1 | % 缺少关系符,需要使用幻影给关系符 2 | % 占位,并利用 \mathrel 保证间距 3 | \begin{align*} 4 | &\mathrel{\phantom{=}} 5 | (a+b)(a^2-ab+b^2) \notag \\ 6 | &= a^3 - a^2b + ab^2 + a^2b 7 | - ab^2 + b^2 \notag \\ 8 | &= a^3 + b^3 \label{eq:cubesum} 9 | \end{align*} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-16.tex: -------------------------------------------------------------------------------- 1 | \begin{equation}\label{eq:trigonometric} 2 | \begin{split} 3 | \frac12 (\sin(x+y) + \sin(x-y)) 4 | &= \frac12(\sin x\cos y + \cos x\sin y) \\ 5 | &\quad + \frac12(\sin x\cos y - \cos x\sin y) \\ 6 | &= \sin x\cos y 7 | \end{split} 8 | \end{equation} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-47.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{array} 2 | \newcolumntype{M}{>{$}c<{$}} 3 | \newcolumntype{P}[1]{>{\setlength\parindent{2em}}p{#1}} 4 | \newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}} 5 | % 使用新的列格式: 6 | \begin{tabular}{|M|P{15em}|C{4em}|} 7 | ... 8 | \end{tabular} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-48.tex: -------------------------------------------------------------------------------- 1 | % 导言区 2 | % \usepackage{float} 3 | \newfloat{flowchart}{htbp}{loflow}[chapter] 4 | \floatname{flowchart}{流程图} 5 | % 正文 6 | \begin{flowchart} 7 | \centering 8 | \includegraphics{turing-reverse.pdf} 9 | \caption{求逆字符串的图灵机} 10 | \end{flowchart} 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-67.mp: -------------------------------------------------------------------------------- 1 | % 带有 LaTeX 标签的 MetaPost 文件 2 | % 需要使用 mpost 或 mptopdf 命令编译两遍 3 | input latexmp; 4 | setupLaTeXMP(packages="amssymb"); 5 | beginfig(1); 6 | draw fullcircle scaled 2cm; 7 | label.rt(textext("$\Lleftarrow$ unit circle"), (1cm,0)); 8 | endfig; 9 | end. 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-26.tex: -------------------------------------------------------------------------------- 1 | {% 使用分组让 \descriptionlabel 的修改局部化 2 | \renewcommand\descriptionlabel[1]{\normalfont\Large\itshape 3 | \textbullet\ #1} 4 | \begin{description} 5 | \item[标签] 可以修改 \verb=\descriptionlabel= 改变标签的格式。 6 | \item[其他] 其他格式的也可以参考后面的列表环境修改。 7 | \end{description} 8 | } 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-34.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{ccccc} 2 | \toprule 3 | 序号 & 性别 & 年龄 & 身高/cm & 体重/kg \\ 4 | \midrule 5 | 1 & F & 14 & 156 & 42 \\ 6 | 2 & F & 16 & 158 & 45 \\ 7 | 3 & M & 14 & 162 & 48 \\ 8 | 4 & M & 15 & 163 & 50 \\ 9 | \bottomrule 10 | \end{tabular} 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-38.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{|c||cc|} 2 | \hline\hline 3 | 自变量 & \multicolumn{2}{c|}{因变量} \\ 4 | \cline{2-3} 5 | 半径 & 周长 & 面积 \\ 6 | \hline\hline 7 | 1.00 & 6.28 & 6.28 \\ 8 | 2.00 & 12.57 & 12.57 \\ 9 | 3.00 & 18.85 & 28.27 \\ 10 | \hline\hline 11 | \end{tabular} 12 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-47.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | \draw[thick] (0,0) circle (1); 3 | \fill[fill=gray, fill opacity=0.3] 4 | (0,0) -- (0:1) arc (0:120:1) -- cycle; 5 | \filldraw[fill=gray,fill opacity=0.5] 6 | (0,0) -- (0:0.3) arc (0:120:0.3) -- cycle; 7 | \end{tikzpicture} 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-10.tex: -------------------------------------------------------------------------------- 1 | % 将参数 #2 输出 2^#1 次 2 | \def\recur#1#2{% 3 | \ifnum #1=0\relax% 4 | #2 % 5 | \else 6 | \setcounter{enumi}{#1}% 7 | \addtocounter{enumi}{-1}% 8 | \recur{\value{enumi}}{#2 #2}% 9 | \fi} 10 | \textsf{\recur0a\recur1b\recur2c\recur3d} 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-7.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{changepage} 2 | \def\outside#1{% 3 | \checkoddpage % 设置自动交叉引用 4 | \ifoddpage % 使用交叉引用并检查页码奇偶 5 | {\raggedleft #1$\rightarrow$}% 奇数页右侧 6 | \else 7 | {\raggedright $\leftarrow$#1}% 偶数页左侧 8 | \fi} 9 | \outside{\textsf{向外侧对齐}} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-44.tex: -------------------------------------------------------------------------------- 1 | % XeLaTeX 编译 2 | \documentclass[UTF8]{ctexart} 3 | \usepackage{tipa}% 宏包已经正确加载 fontenc 4 | % \mytipa 的定义参考原来的 \textipa 的旧定义,手工切换编码 5 | \newcommand\mytipa[1]{{\fontencoding{T3}\selectfont#1}} 6 | \begin{document} 7 | \LaTeX{} 读音为 \mytipa{["lA:tEx]}。 8 | \end{document} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-37.tex: -------------------------------------------------------------------------------- 1 | % 中文文档类会设定好标题的第一种语言 2 | \documentclass{ctexart} 3 | \usepackage{bicaption} 4 | % 声明 english 选项重定义第二种语言的标签名,选项没有参数 5 | \DeclareCaptionOption{english}[]{% 6 | \renewcommand\figurename{Figure}% 7 | \renewcommand\tablename{Table}} 8 | \captionsetup[bi-second]{english} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-22.tex: -------------------------------------------------------------------------------- 1 | % 颜色 craneorange 是在 crane 色彩主题中定义的 2 | \rowcolors{2}{craneorange!25}{craneorange!50} 3 | \begin{tabular}{rrr} 4 | \rowcolor{craneorange}直角边 $a$ & 直角边 $b$ & 斜边 $c$\\ 5 | 3 & 4 & 5 \\ 6 | 5 & 12 & 13 \\ 7 | 7 & 24 & 25 \\ 8 | 8 & 15 & 17 \\ 9 | \end{tabular} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-44.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{array} 或调用其他依赖 array 的宏包 2 | \begin{tabular}{>{\bfseries}c|>{\itshape}c>{$}c<{$}} 3 | \hline 4 | 姓名 & \textnormal{得分} & \multicolumn{1}{c}{额外加分} \\ 5 | \hline 6 | 张三 & 85 & +7 \\ 7 | 李四 & 82 & 0 \\ 8 | 王五 & 70 & -2 \\ 9 | \hline 10 | \end{tabular} 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-8.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | \begin{array}{|c|*{3}{r@{.}l|}} % 相当于 |c|r@{.}l|r@{.}l|r@{.}l| 3 | \hline 4 | \text{收入} & 12345&6 & 5000&0 & 1020&55 \\ \hline 5 | \text{支出} & 765&43 & 5120&5 & 98760&0 \\ \hline 6 | \text{节余} & 11580&17 & -120&5 & -97739&45 \\ \hline 7 | \end{array} 8 | \] 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-40.tex: -------------------------------------------------------------------------------- 1 | % 导言区 2 | \usepackage[thmmarks]{ntheorem} 3 | { % 利用分组,格式设置只作用于证明环境 4 | \theoremstyle{nonumberplain} 5 | \theoremheaderfont{\bfseries} 6 | \theorembodyfont{\normalfont} 7 | \theoremsymbol{\mbox{$\Box$}} % 放进盒子,或用 \ensuremath 8 | \newtheorem{proof}{证明} 9 | } 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-72.tex: -------------------------------------------------------------------------------- 1 | \newsavebox{\verbatimbox} % 通常在导言区定义 2 | \begin{lrbox}{\verbatimbox} 3 | \begin{minipage}{10em} 4 | \begin{verbatim} 5 | #!/bin/sh 6 | cat ~/${file} 7 | \end{verbatim} 8 | \end{minipage} 9 | \end{lrbox} 10 | \fbox{\usebox{\verbatimbox}}\quad\fbox{\usebox{\verbatimbox}} 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-55.tex: -------------------------------------------------------------------------------- 1 | \[ 2 | \begin{blockarray}{ccc} 3 | \begin{block}{cc\}\BAmultirow{4em}} 4 | 1 & 2 & 自然数 \\ 5 | 3 & 4 & {} \\ % 空白 {} 占位 6 | \end{block} 7 | \begin{block}{cc\}l} 8 | -1.5 & \frac12 & \BAmultirow{4em}{实数} \\ 9 | 3.5 & 40 & \\ 10 | \end{block} 11 | \end{blockarray} 12 | \] 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-39.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \caption{并排的表格} 4 | \begin{tabular}{|c|c|} 5 | \hline 图 & 表 \\ \hline 6 | \end{tabular}% 7 | \qquad 8 | \begin{tabular}{|c|c|} 9 | \hline Figure & Table \\ \hline A & B \\ \hline 10 | \end{tabular} 11 | \end{table} 12 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-2-3.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{pgfplotstable,booktabs} 2 | \pgfplotstableset{ 3 | every head row/.style={ 4 | before row=\toprule,after row=\midrule}, 5 | every last row/.style={ 6 | after row=\bottomrule}, 7 | column type=r, col sep=comma} 8 | \pgfplotstabletypeset{temperature.csv} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-3-4.tex: -------------------------------------------------------------------------------- 1 | % 手工排版的标题页 2 | \begin{titlepage} 3 | \vspace*{\fill} 4 | \begin{center} 5 | \normalfont 6 | {\Huge\bfseries 杂谈勾股定理} 7 | 8 | \bigskip 9 | {\Large\itshape 张三} 10 | 11 | \medskip 12 | \today 13 | \end{center} 14 | \vspace{\stretch{3}} 15 | \end{titlepage} 16 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-32.tex: -------------------------------------------------------------------------------- 1 | \psset{algebraic=true} 2 | \begin{pspicture}(0,-1.2)(3.5,1.2) 3 | \psaxes[labels=none,dx=1.57] 4 | {->}(0,0)(0,-1.2)(3.5,1.2) 5 | \psplot{0}{3.5}{sin(x)} 6 | \uput*[d](0,0){$0^\circ$} 7 | \uput*[d](1.57,0){$90^\circ$} 8 | \uput*[d](3.14,0){$180^\circ$} 9 | \end{pspicture} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-55.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture}[fill=lightgray] % 全局选项 2 | \begin{scope}[thick,->,fill=gray,xshift=-3cm] % 区块内整体向左平移 3 | \filldraw (0,0) circle (1); 4 | \draw (-1.2,0) -- (1.2,0); 5 | \draw (0,-1.2) -- (0,1.2); 6 | \end{scope} 7 | \filldraw (0,0) circle (1); % 原位置 8 | \end{tikzpicture} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-18.tex: -------------------------------------------------------------------------------- 1 | \begin{frame}{古中国数学}{定理证明} 2 | 有论者认为早在公元前 11 世纪商高即已证明勾股定理\cite{quanjing}。 3 | 完整的证明见于三国时(公元 3 世纪)赵爽对《周髀算经》的注释。 4 | \begin{figure} 5 | \centering 6 | \includegraphics[height=0.4\textheight]{xiantu.pdf} 7 | \caption{赵爽的弦图可给出勾股定理的一个富于对称美的证明} 8 | \end{figure} 9 | \end{frame} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-20.tex: -------------------------------------------------------------------------------- 1 | % 在 thm 环境最后: 2 | \begin{center} 3 | \begin{tikzpicture}[scale=0.5,font=\small] 4 | \draw[thick] (0,0) node[left] {$A$} 5 | -- (4,0) node[right] {$C$} 6 | -- (4,3) node[above right] {$B$} -- cycle; 7 | \draw (3.5,0) |- (4,0.5); 8 | \end{tikzpicture} 9 | \end{center} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-7.tex: -------------------------------------------------------------------------------- 1 | \hangindent=5pc \hangafter=-2 2 | These two parameters jointly specify 3 | ``hanging indentation'' for a paragraph. 4 | The hanging indentation indicates to \TeX{} 5 | that certain lines of the paragraph should 6 | be indented and the remaining lines should 7 | have their normal width. 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-27.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{tabularx} 2 | \newcolumntype{Y}{>{\centering\arraybackslash}X} 3 | \begin{tabularx}{\textwidth}{|c|Y|Y|Y|Y|Y|} 4 | \hline 5 | 数字 & 1 & 2 & 3 & 4 & 5 \\ \hline 6 | 字母 & A & B & C & D & E \\ \hline 7 | 天干 & 甲 & 乙 & 丙 & 丁 & 戊 \\ 8 | \hline 9 | \end{tabularx} 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-40.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{arydshln} 2 | \[ 3 | \left( 4 | \begin{array}{@{}ccc:c@{}} 5 | a_{11} & a_{12} & a_{13} & b_1 \\ 6 | a_{21} & a_{22} & a_{23} & b_2 \\ 7 | a_{31} & a_{32} & a_{33} & b_3 \\ 8 | \cdashline{1-3} 9 | 0 & 0 & 0 & b_4 \\ 10 | \end{array} 11 | \right) 12 | \] 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-54.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{blkarray} 2 | \[ \left[ 3 | \begin{blockarray}{*4r} 4 | \begin{block}{(rr)rr} 5 | a & -b & 0 & 0 \\ 6 | -c & d & 0 & 0 \\ 7 | \end{block} 8 | \begin{block}{rr(rr)} 9 | 0 & 0 & -a & b \\ 10 | 0 & 0 & c & -d \\ 11 | \end{block} 12 | \end{blockarray} 13 | \right] \] 14 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-52.tex: -------------------------------------------------------------------------------- 1 | \lstset{ % 整体设置 2 | basicstyle=\sffamily, 3 | keywordstyle=\bfseries, 4 | commentstyle=\rmfamily\itshape, 5 | stringstyle=\ttfamily} 6 | \begin{lstlisting}[language=C] 7 | /* hello.c */ 8 | #include 9 | main() { 10 | printf("Hello.\n"); 11 | } 12 | \end{lstlisting} 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-36.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{makecell} 2 | \begin{tabular}{c|cc} 3 | \Xhline{2pt} 4 | 自变量 & \multicolumn{2}{c}{因变量} \\ 5 | \Xcline{2-3}{0.4pt} 6 | 半径 & 周长 & 面积 \\ 7 | \Xhline{1pt} 8 | 1.00 & 6.28 & 6.28 \\ 9 | 2.00 & 12.57 & 12.57 \\ 10 | 3.00 & 18.85 & 28.27 \\ 11 | \Xhline{2pt} 12 | \end{tabular} 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-2-11.tex: -------------------------------------------------------------------------------- 1 | \documentclass[hyperref,UTF8]{ctexbook} 2 | \usepackage{geometry} 3 | \geometry{screen} 4 | \hypersetup{ 5 | colorlinks=true, 6 | bookmarks=true, 7 | bookmarksopen=false, 8 | pdfpagemode=FullScreen, 9 | pdfstartview=Fit, 10 | pdftitle={初等几何教程(电子版)}, 11 | pdfauthor={张三} 12 | } 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-4-4.tex: -------------------------------------------------------------------------------- 1 | \documentclass[UTF8]{ctexart} 2 | \usepackage{imakeidx} 3 | \makeindex[title={名词索引}] 4 | \makeindex[name=persons,title={人名索引}] 5 | 6 | \begin{document} 7 | ... \index{名词} 8 | ... \index[persons]{人名} 9 | ... 10 | \printindex % 输出名词索引 11 | \printindex[persons] % 输出人名索引 12 | \end{document} 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-4-1.tex: -------------------------------------------------------------------------------- 1 | % foo.tex 2 | \documentclass{ctexart} 3 | \usepackage{makeidx} 4 | \makeindex 5 | % ... 6 | \begin{document} 7 | \section{勾股定理} 8 | % 第 1 页 9 | 勾股定理在西方称为毕达哥拉斯定理(Pythagoras' theorem)。 10 | \index{Pythagoras} 11 | % ... 12 | % 第 2 页 13 | 在中国常称勾股定理为商高定理。\index{商高} 14 | 15 | \printindex 16 | \end{document} 17 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-45.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{array} 2 | \begin{tabular}{|>{$}r<{$}|>{\setlength\parindent{2em}}m{15em}|% 3 | >{\centering\arraybackslash}m{4em}|} 4 | \hline 5 | \pi & 希腊字母,多用于表示圆周率,也常用作变量。表示圆周率时多使用 6 | 直立体。 & 常用 \\ 7 | \hline 8 | \aleph & 希伯来字母的第一个,在数学中通常用于表示特殊集合的基数。 9 | & 不常用 \\ 10 | \hline 11 | \end{tabular} 12 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-4-13.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{xcolor, colortbl} 2 | \arrayrulecolor{gray} 3 | \doublerulesepcolor{lightgray} 4 | \begin{tabular}{|c|c|} 5 | \hline\hline 灰色表线 & 浅灰色间隙 \\ 6 | \arrayrulecolor{black}\hline 7 | 以下为原色 & 表线 \\ 8 | \doublerulesepcolor{white}\hline\hline 9 | \end{tabular} 10 | \arrayrulecolor{black} % 恢复默认值 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-71.tex: -------------------------------------------------------------------------------- 1 | \begin{minipage}[c][2.5cm][t]{2em} 两个 \end{minipage}\quad 2 | \begin{minipage}[c][2.5cm][c]{3em} 黄鹂鸣翠柳, \end{minipage}\quad 3 | \begin{minipage}[c][2.5cm][b]{3em} 一行白鹭上青天。 \end{minipage}\quad 4 | \begin{minipage}[c][2.5cm][s]{4em} 5 | \setlength{\parskip}{0pt plus 1pt}% 恢复正文默认段间距 6 | 窗含西岭千秋雪,\par 7 | 门泊东吴万里船。 8 | \end{minipage} 9 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-1.bib: -------------------------------------------------------------------------------- 1 | % tex.bib 中的一条 2 | @BOOK{mittelbach2004, 3 | title = {The {{\LaTeX}} Companion}, 4 | publisher = {Addison-Wesley}, 5 | year = {2004}, 6 | author = {Frank Mittelbach and Michel Goossens}, 7 | series = {Tools and Techniques for Computer Typesetting}, 8 | address = {Boston}, 9 | edition = {Second} 10 | } 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-4-10.tex: -------------------------------------------------------------------------------- 1 | \documentclass[twoside]{ctexrep} 2 | \usepackage{fancyhdr} 3 | \pagestyle{fancy} % 使用 fancy 风格 4 | \fancyhf{} % 清除所有页眉页脚 5 | \cfoot{\thepage} % 页脚居中页码 6 | \fancyhead[CO]{张三} % 奇数页居中页眉作者名 7 | \fancyhead[CE]{论语言} % 偶数页居中页眉文章题目 8 | \fancyfoot[RO,LE]{$\heartsuit$} 9 | % 奇数页脚右,偶数页脚左(即外侧)装饰符号 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-2-1.plt: -------------------------------------------------------------------------------- 1 | set terminal epslatex size 8cm,4cm 2 | set output 'sine-epslatex.tex' 3 | set size 1,1 4 | set xlabel '$x$' 5 | set ylabel '$y$' 6 | set xtics ('$-\pi$' -pi, '$-\frac12\pi$' -pi/2, 0, \ 7 | '$\frac12\pi$' pi/2, '$\pi$' pi) 8 | set ytics (-1, 0, 1) 9 | set format y "$%g$" 10 | plot [-pi:pi] [-1:1] sin(x) title '$\sin x$' 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-6.tex: -------------------------------------------------------------------------------- 1 | \newenvironment{mysubeqn}% 2 | {\begin{subequations} 3 | \renewcommand\theequation{\theparentequation-\roman{equation}}}% 4 | {\end{subequations}} 5 | \begin{mysubeqn} 6 | \begin{gather} 7 | \zeta(2) = \frac{\uppi^2}{6} \\ 8 | \zeta(s) = \prod_{p\text{ prime}} \frac{1}{1 - p^{-s}} 9 | \end{gather} 10 | \end{mysubeqn} 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-1.tex: -------------------------------------------------------------------------------- 1 | \begin{figure}[htbp] % 允许各个位置 2 | \centering 3 | \includegraphics{lion.eps} 4 | \end{figure} 5 | \begin{table} % 默认在页面顶部或单独一页 6 | \centering 7 | \begin{tabular}{|c|c|} 8 | \hline 9 | 图形 & \verb=figure= 环境 \\ 10 | \hline 11 | 表格 & \verb=table= 环境 \\ 12 | \hline 13 | \end{tabular} 14 | \end{table} 15 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-1-9.tex: -------------------------------------------------------------------------------- 1 | \documentclass{ctexbook} % 或 ctexrep, ctexart 2 | \usepackage{tocloft} 3 | \makeatletter 4 | \renewcommand{\numberline}[1]{% 5 | \settowidth\@tempdimb{#1\hspace{0.5em}}% 6 | \ifdim\@tempdima<\@tempdimb% 7 | \@tempdima=\@tempdimb% 8 | \fi% 9 | \hb@xt@\@tempdima{\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb} 10 | \makeatother 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-37.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{makecell} 2 | \newcolumntype{V}{!{\vrule width 2pt}} 3 | \begin{tabular}{Vc|ccV} 4 | \Xhline{2pt} 5 | 自变量 & \multicolumn{2}{cV}{因变量} \\ 6 | \Xcline{2-3}{0.4pt} 7 | 半径 & 周长 & 面积 \\ 8 | \Xhline{1pt} 9 | 1.00 & 6.28 & 6.28 \\ 10 | 2.00 & 12.57 & 12.57 \\ 11 | 3.00 & 18.85 & 28.27 \\ 12 | \Xhline{2pt} 13 | \end{tabular} 14 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-2.bib: -------------------------------------------------------------------------------- 1 | @String{ j-CJ = "The Computer Journal" } 2 | 3 | @Article{Knuth:CJ-2-27-97, 4 | author = "Donald E. Knuth", 5 | title = "Literate Programming", 6 | journal = j-CJ, 7 | year = "1984", 8 | number = "2", 9 | volume = "27", 10 | pages = "97--111", 11 | month = may, 12 | } 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-4-14.tex: -------------------------------------------------------------------------------- 1 | % \usepackage[table]{xcolor} 2 | \begin{table}[htbp] 3 | \centering 4 | \rowcolors{2}{black!20}{black!10} % 交错的表行 5 | \begin{tabular}{crrr} 6 | \rowcolor{black!30} % 第一行的表头单独设置背景色 7 | 项目 & 数值 & 数值 & 数值 \\ 8 | A & 10 & 20 & 30 \\ 9 | B & 20 & 15 & 40 \\ 10 | C & 15 & 25 & 37 11 | \end{tabular} 12 | \end{table} 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/6-1-6.tex: -------------------------------------------------------------------------------- 1 | \begin{frame}{古中国数学}{定理发现} 2 | 中国在 3000 多年前就知道勾股数的概念,比古希腊更早一些。 3 | 4 | 《周髀算经》的记载: 5 | \begin{itemize} 6 | \item 公元前 11 世纪,商高答周公问: 7 | \begin{quote} 8 | 勾广三,股修四,径隅五。 9 | \end{quote} 10 | \item 又载公元前 7--6 世纪陈子答荣方问,表述了勾股定理的一般形式: 11 | \begin{quote} 12 | 若求邪至日者,以日下为勾,日高为股,勾股各自乘,并而开方除之,得邪至日。 13 | \end{quote} 14 | \end{itemize} 15 | \end{frame} 16 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-59.mp: -------------------------------------------------------------------------------- 1 | % 主要代码片断 2 | z1 = (0,0); z2 = (2cm,0); z3 = (0,1cm); z4 = (3cm,1.5cm); 3 | dotlabel.lft(btex $z_1$ etex, z1); dotlabel.rt(btex $z_2$ etex, z2); 4 | dotlabel.lft(btex $z_3$ etex, z3); dotlabel.rt(btex $z_4$ etex, z4); 5 | draw z1 -- z4; draw z2 -- z3; 6 | z5 = whatever[z1, z4] = whatever[z2, z3]; % 计算交点 7 | dotlabel.bot(btex $z_5$ etex, z5); 8 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-66.mp: -------------------------------------------------------------------------------- 1 | % 带有 LaTeX 标签的 MetaPost 文件 2 | % 需要使用 mpost -tex=latex 或 mptopdf --latex 命令编译 3 | 4 | verbatimtex 5 | \documentclass{article} 6 | \usepackage{amssymb} 7 | \begin{document}% 后面可以省去 \end{document} 8 | etex 9 | 10 | beginfig(1); 11 | draw fullcircle scaled 2cm; 12 | label.rt(btex $\Lleftarrow$ unit circle etex, (1cm,0)); 13 | endfig; 14 | end. 15 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-32.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{tabu} 2 | % \usepackage{longtable} % 仍然需要载入 longtable 3 | \begin{longtabu}to 0.5\textwidth{|c|X|X|X|X|X|} 4 | \hline 5 | \endhead 6 | \hline 7 | \endfoot 8 | \caption{各种序号} \\ \hline 9 | \endfirsthead 10 | 数字 & 1 & 2 & 3 & 4 & 5 \\ \hline 11 | 字母 & A & B & C & D & E \\ \hline 12 | 天干 & 甲 & 乙 & 丙 & 丁 & 戊 \\ 13 | \end{longtabu} 14 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-41.tex: -------------------------------------------------------------------------------- 1 | \begin{figure} 2 | \centering 3 | \begin{varwidth}[t]{\textwidth} 4 | \vspace{0pt} 5 | \includegraphics{lion.eps} 6 | \end{varwidth}% 7 | \qquad 8 | \begin{varwidth}[t]{\textwidth} 9 | \vspace{0pt} 10 | \includegraphics[height=4cm]{texlive-lion.pdf} 11 | \end{varwidth} 12 | \caption{两幅狮子图形的按顶部对齐} 13 | \end{figure} 14 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-25.tex: -------------------------------------------------------------------------------- 1 | \begin{align*} 2 | 2^5 &= (1+1)^5 \\ 3 | &= \begin{multlined}[t] 4 | \binom50\cdot 1^5 + \binom51\cdot 1^4 \cdot 1 5 | + \binom52\cdot 1^3 \cdot 1^2 \\ 6 | + \binom53\cdot 1^2 \cdot 1^3 + \binom54\cdot 1 \cdot 1^4 7 | + \binom55\cdot 1^5 8 | \end{multlined} \\ 9 | &= \binom50 + \binom51 + \binom52 + \binom53 + \binom54 + \binom55 10 | \end{align*} 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-68.mp: -------------------------------------------------------------------------------- 1 | % 带有中文 LaTeX 标签的 MetaPost 文件 2 | % 需要使用 mpost 或 mptopdf 命令编译两遍 3 | input latexmp; 4 | setupLaTeXMP( 5 | packages="amssymb,CJK", 6 | preamble=("\AtBeginDocument{\begin{CJK}{UTF8}{gbsn}}" & 7 | "\AtEndDocument{\end{CJK}}")); 8 | beginfig(1); 9 | draw fullcircle scaled 2cm; 10 | label.rt(textext("$\Lleftarrow$ 单位圆"), (1cm,0)); 11 | endfig; 12 | end. 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-33.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{xtab} 2 | \begin{center} 3 | \tablecaption{各种序号} 4 | \tablefirsthead{\hline} 5 | \tabletail{\hline \multicolumn{6}{r}{\small 接下页}\\} 6 | \tablelasttail{\hline} 7 | \begin{xtabular}{|*{6}{c|}} 8 | 数字 & 1 & 2 & 3 & 4 & 5 \\ \hline 9 | 字母 & A & B & C & D & E \\ \hline 10 | 天干 & 甲 & 乙 & 丙 & 丁 & 戊 \\ \hline 11 | \end{xtabular} 12 | \end{center} 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-18.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate} 2 | \item 中文 3 | \begin{enumerate} 4 | \item 古代汉语 5 | \item 现代汉语 6 | \begin{enumerate} 7 | \item 口语 8 | \begin{enumerate} 9 | \item 普通话 10 | \item 方言 11 | \end{enumerate} 12 | \item 书面语 13 | \end{enumerate} 14 | \end{enumerate} 15 | \item English 16 | \item Français 17 | \end{enumerate} 18 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-35.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{multirow,booktabs} 2 | \begin{tabular}{*{6}{c}} 3 | \bottomrule 4 | \multirow{2}*{姓名} & \multicolumn{2}{c}{文科} & 5 | \multicolumn{2}{c}{理科} & \\ 6 | \cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-6} 7 | \morecmidrules\cmidrule(lr){6-6} 8 | & 历史 & 文学 & 物理 & 化学 & 总评 \\ 9 | \midrule 10 | 张三 & A & A & B & A & A \\ 11 | \bottomrule 12 | \end{tabular} 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-42.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \parbox[b]{.5\textwidth}{\centering 3 | \caption{文字表格} 4 | \begin{tabular}{|c|c|} 5 | \hline 图 & 表 \\ \hline 6 | \end{tabular}}% 7 | \parbox[b]{.5\textwidth}{\centering 8 | \caption{数学表格} 9 | $\begin{array}{|c|c|} 10 | \hline \sqrt{2} & 1.414\dots \\ \hline 11 | \sqrt{3} & 1.732\dots \\ \hline 12 | \end{array}$} 13 | \end{table} 14 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-12.tex: -------------------------------------------------------------------------------- 1 | 设 $G$ 是一个带有运算 $*$ 的集合,则 $G$ 是\emph{群},当且仅当: 2 | \begin{subequations}\label{eq:group} 3 | \begin{alignat}{2} 4 | \forall a,b,c &\in G, &\qquad (a*b)*c &= a*(b*c);\label{subeq:assoc}\\ 5 | \exists e, \forall a &\in G, & e*a &= a; \\ 6 | \forall a, \exists b &\in G, & b*a &= e. 7 | \end{alignat} 8 | \end{subequations} 9 | 式~\eqref{eq:group} 的三个条件中,\eqref{subeq:assoc}~又称为结合律。 10 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-4-23.tex: -------------------------------------------------------------------------------- 1 | \begin{equation}\label{eq:trinary} 2 | \begin{aligned} x+y &= -1 \\ x+y+z &= 2 \\ xyz &= -6 \end{aligned} 3 | \implies 4 | \begin{aligned} x+y &= -1 \\ xy &= -2 \\ z &= 3 \end{aligned} 5 | \implies 6 | \begin{alignedat}{3} 7 | x &= 1, &\quad y &= -2, &\quad z &= 3 \\ 8 | \text{或\ } x &= -2, & y &= 1, & z &= 3 9 | \end{alignedat} 10 | \end{equation} 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-22.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate} 2 | \item 编号 3 | \arabic{enumi}, \roman{enumi}, \Roman{enumi}, 4 | \alph{enumi}, \Alph{enumi}, \fnsymbol{enumi} 5 | \item 编号 6 | \arabic{enumi}, \roman{enumi}, \Roman{enumi}, 7 | \alph{enumi}, \Alph{enumi}, \fnsymbol{enumi} 8 | \item 编号 9 | \arabic{enumi}, \roman{enumi}, \Roman{enumi}, 10 | \alph{enumi}, \Alph{enumi}, \fnsymbol{enumi} 11 | \end{enumerate} 12 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/4-5-24.tex: -------------------------------------------------------------------------------- 1 | \vspace{\baselineskip}% 被忽略的高度 2 | \[ 3 | \text{实数} \begin{cases} 4 | \text{有理数}\smash[t]{\begin{cases} 5 | \text{整数}\smash{\begin{cases} 6 | \text{奇数} \\ \text{偶数} 7 | \end{cases}}\\ 8 | \text{分数} 9 | \end{cases}} \\[4ex] 10 | \text{无理数}\smash[b]{\begin{cases} 11 | \text{代数无理数} \\ \text{超越数} 12 | \end{cases}} 13 | \end{cases} 14 | \] 15 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-9.tex: -------------------------------------------------------------------------------- 1 | % 导言区 \usepackage{dcolumn} 2 | \newcolumntype{d}{D{.}{.}{2}} 3 | \begin{tabular}{|c|*{3}{d|}} % 相当于 |c|d|d|d| 4 | \hline 5 | 姓名 & \multicolumn{1}{c|}{张三} & \multicolumn{1}{c|}{李四} 6 | & \multicolumn{1}{c|}{王五} \\ \hline 7 | 收入 & 12345.6 & 5000 & 1020.55 \\ \hline 8 | 支出 & 765.43 & 5120.5 & 98760 \\ \hline 9 | 节余 & 11580.17 & -120.5 & -97739.45 \\ \hline 10 | \end{tabular} 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-45.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{caption,subcaption} 2 | \begin{table} 3 | \caption{子图表盒子} 4 | \centering 5 | \subcaptionbox{文字表格\label{subtab:test}}[6em]{% 6 | \begin{tabular}{|c|c|} \hline 图 & 表 \\ \hline \end{tabular}}\qquad 7 | \subcaptionbox{数学表格}{% 8 | $\begin{array}{|c|c|} 9 | \hline \sqrt{2} & 1.414\dots \\ \hline 10 | \sqrt{3} & 1.732\dots \\ \hline 11 | \end{array}$} 12 | \end{table} 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-24.tex: -------------------------------------------------------------------------------- 1 | % 计数器设置,通常在导言区 2 | \newcounter{mycnt} 3 | \setcounter{mycnt}{0} % 默认值就是 0 4 | \renewcommand\themycnt{\arabic{mycnt}} % 默认值就是阿拉伯数字 5 | % 计数器使用,通常做成自定义命令的一部分 6 | \stepcounter{mycnt}\themycnt 输出计数器值为 1; 7 | \stepcounter{mycnt}\themycnt 输出计数器值为 2; 8 | \addtocounter{mycnt}{1}\themycnt 输出计数器值为 3; 9 | \addtocounter{mycnt}{-1}\themycnt 输出计数器值为 2; 10 | \addtocounter{mycnt}{-1}\themycnt 输出计数器值为 1。 11 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-3-15.tex: -------------------------------------------------------------------------------- 1 | % main.tex 2 | % 主文档 3 | \documentclass{book} 4 | \usepackage{chapterbib} 5 | \usepackage[sectionbib]{natbib} 6 | \begin{document} 7 | % ... 8 | \include{chap-intro} 9 | \include{chap-research} 10 | \include{chap-conclusion} 11 | \end{document} 12 | 13 | % chap-intro.tex 14 | % 其中一章 15 | \chapter{Introduction} 16 | % ... 17 | \bibliographystyle{plainnat} 18 | \bibliography{foo} 19 | 20 | % chap-research.tex 21 | % ... 22 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-31.tex: -------------------------------------------------------------------------------- 1 | % 导言区使用 2 | % \usepackage{ltxtable} 3 | % \usepackage{fancyvrb} 4 | \begin{VerbatimOut}{\jobname.vrb} 5 | \begin{longtable}{|c|X|X|X|X|X|} 6 | \caption{各种序号} \\ \hline 7 | \endfirsthead 8 | \hline 9 | \endhead 10 | \hline 11 | \endfoot 12 | 数字 & 1 & 2 & 3 & 4 & 5 \\ \hline 13 | 字母 & A & B & C & D & E \\ \hline 14 | 天干 & 甲 & 乙 & 丙 & 丁 & 戊 \\ 15 | \end{longtable} 16 | \end{VerbatimOut} 17 | \LTXtable{0.5\textwidth}{\jobname.vrb} 18 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-43.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{caption,subcaption} 2 | \begin{table} 3 | \caption{图表的子标题} 4 | \parbox[b]{.5\textwidth}{\centering 5 | \begin{tabular}{|c|c|} 6 | \hline 图 & 表 \\ \hline 7 | \end{tabular} 8 | \subcaption{文字表格}}% 9 | \parbox[b]{.5\textwidth}{\centering 10 | $\begin{array}{|c|c|} 11 | \hline \sqrt{2} & 1.414\dots \\ \hline 12 | \sqrt{3} & 1.732\dots \\ \hline 13 | \end{array}$ 14 | \subcaption{数学表格}} 15 | \end{table} 16 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1-20.tex: -------------------------------------------------------------------------------- 1 | % 通常是在某 .sty 或 .cls 中 2 | % \RequirePackage{keyval} 3 | % 定义 text 族的 emph 选项,控制 \emph 命令的定义 4 | \let\text@emph=\emph 5 | \define@key{text}{emph}[\text@emph]{% 6 | \let\emph=#1} 7 | \newcommand\settext[1]{% 8 | \setkeys{text}{#1}} 9 | 10 | % 在 .tex 文件中使用 11 | \begin{quotation} 12 | \settext{emph=\textbf} % 粗体 13 | An \emph{important} example. 14 | 15 | \settext{emph} % 默认的格式 16 | An \emph{important} example. 17 | \end{quotation} 18 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-40.tex: -------------------------------------------------------------------------------- 1 | \begin{figure} 2 | \centering 3 | \includegraphics[width=0.4\textwidth]{texlive-lion.pdf}% 4 | \qquad 5 | \parbox[b]{0.4\textwidth}{这只狮子是由画师 Duane Bibby 专门为著名的 6 | \TeX{} 发行版 \TeXLive{} 绘制的作品。狮子是 \TeX{} 系统的吉祥物, 7 | Duane Bibby 创作了大量有关 \TeX{} 狮子的插图,如高德纳的 \textit{The 8 | \TeX{}book} 与 Lamport 的 \textit{\LaTeX: A Document Preparation 9 | System} 两书中的狮子插图,就是由 Duane Bibby 创作的。} 10 | \caption{\TeX{} 狮子}\label{fig:texlivelion} 11 | \end{figure} 12 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-54.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture} 2 | % 坐标轴 3 | \draw[->] (0,0) -- ({rad(210)}, 0); 4 | \draw[->] (0,-1.2) -- (0,1.2); 5 | % 文字标签与刻度 6 | \foreach \t in {0, 90, 180} { % 遍历三个角度 7 | \draw ({rad(\t)}, -0.05) -- ({rad(\t)}, 0.05); % 画刻度线 8 | \node[below, outer sep=2pt, fill=white, font=\small] % 标注横轴角度 9 | at ({rad(\t)}, 0) {\ang{\t}}; 10 | } 11 | \foreach \y in {-1,1} {\draw (-0.05,\y) -- (0.05,\y);} % 纵轴刻度 12 | \end{tikzpicture} 13 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-4-8.tex: -------------------------------------------------------------------------------- 1 | \documentclass[UTF8]{ctexart} 2 | \usepackage{glossaries} 3 | \makeglossaries 4 | \begin{document} 5 | 6 | \newglossaryentry{gloss}{ 7 | name=glossary, 8 | description={A vocabulary with annotations for a particular subject}, 9 | plural=glossaries} 10 | 11 | \Glspl{gloss} are important for technical documents. 12 | 13 | \newglossaryentry{sec}{ 14 | name=分节, 15 | description={把文章分成章节}} 16 | \gls{sec}对于长文档非常重要。 17 | 18 | \printglossaries 19 | \end{document} 20 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/8-1.tex: -------------------------------------------------------------------------------- 1 | \begin{codebox} 2 | \Procname{$\proc{BinSearch}(A, x, L, H)$} 3 | \li \While $L\le H$ \RComment $L$ 与$H$ 是左右分点 4 | \li \Do $M \gets \lfloor(L+H)/2\rfloor$ \RComment $M$ 是中间分点 5 | \li \If $x > A[M]$ 6 | \li \Then $H \gets M-1$ 7 | \li \ElseIf $x < A[M]$ 8 | \li \Then $H \gets M+1$ 9 | \li \ElseNoIf \RComment 找到 $x$,返回位置 10 | \li $j \gets M$ 11 | \li \Return $j$ 12 | \End 13 | \End 14 | \li $j \gets 0$ 15 | \li \Return $j$ 16 | \end{codebox} 17 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-73.asy: -------------------------------------------------------------------------------- 1 | guide star(int n = 5, real r0 = 1) 2 | { 3 | guide unitstar; 4 | if (n < 5) return nullpath; 5 | real theta = 180/n; 6 | real r = Cos(2theta) / Cos(theta); 7 | for (int k = 0; k < n; ++k) 8 | unitstar = unitstar -- dir(90+2k*theta) 9 | -- r * dir(90+(2k+1)*theta); 10 | unitstar = unitstar -- cycle; 11 | return scale(r0) * unitstar; 12 | } 13 | for (int i = 5; i <= 8; ++i) 14 | filldraw(shift(i*2cm,0) * star(i,1cm), lightgray, gray+1mm); 15 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-44.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{caption,subcaption} 2 | \begin{table} 3 | \caption{子图表环境} 4 | \begin{subtable}[b]{.5\textwidth} 5 | \centering 6 | \begin{tabular}{|c|c|} \hline 图 & 表 \\ \hline \end{tabular} 7 | \caption{文字表格} 8 | \end{subtable}% 9 | \begin{subtable}[b]{.5\textwidth} 10 | \centering 11 | $\begin{array}{|c|c|} 12 | \hline \sqrt{2} & 1.414\dots \\ \hline 13 | \sqrt{3} & 1.732\dots \\ \hline 14 | \end{array}$ 15 | \caption{数学表格} 16 | \end{subtable} 17 | \end{table} 18 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/gougu/math.bib: -------------------------------------------------------------------------------- 1 | % This file was created with JabRef 2.6. 2 | % Encoding: UTF8 3 | 4 | @BOOK{Kline, 5 | title = {古今数学思想}, 6 | publisher = {上海科学技术出版社}, 7 | year = {2002}, 8 | author = {克莱因} 9 | } 10 | 11 | @ARTICLE{quanjing, 12 | author = {曲安京}, 13 | title = {商高、赵爽与刘徽关于勾股定理的证明}, 14 | journal = {数学传播}, 15 | year = {1998}, 16 | volume = {20}, 17 | number = {3} 18 | } 19 | 20 | @BOOK{Shiye, 21 | title = {几何的有名定理}, 22 | publisher = {上海科学技术出版社}, 23 | year = {1986}, 24 | author = {矢野健太郎} 25 | } 26 | 27 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-3-30.tex: -------------------------------------------------------------------------------- 1 | \begin{figure} 2 | \begin{minipage}[b]{.5\textwidth} 3 | \centering 4 | \includegraphics[width=.4\textwidth]{texlive-lion.pdf} 5 | \caption{\TeX\ Live 吉祥物狮子} 6 | \end{minipage}% 7 | \begin{minipage}[b]{.5\textwidth} 8 | \centering 9 | \begin{tabular}{|*{5}{c|}} 10 | \hline 11 | 1996 & 1998 & 1999 & 2000 & 2001 \\ \hline 12 | 2002 & 2003 & 2004 & 2005 & 2007 \\ \hline 13 | 2008 & 2009 & 2010 & \dots & \\ 14 | \hline 15 | \end{tabular} 16 | \captionsetup{type=table} 17 | \caption{\TeX\ Live 的版本} 18 | \end{minipage} 19 | \end{figure} 20 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-29.tex: -------------------------------------------------------------------------------- 1 | \psset{linewidth=0.4pt} 2 | \begin{pspicture}(-1.2,-1.2)(1.2,1.2) 3 | \psaxes[labels=none,ticks=none]{->}(0,0)(-1.2,-1.2)(1.2,1.2) 4 | \pscircle[linewidth=0.8pt](0,0){1} 5 | \pswedge[fillstyle=solid,fillcolor=gray,opacity=0.2] 6 | (0,0){1}{0}{120} 7 | \pswedge[fillstyle=solid,fillcolor=gray,opacity=0.5] 8 | (0,0){0.3}{0}{120} 9 | \uput[60](0.3;60){$120^\circ$} % 在扇形中间标注角度 10 | \pnode(1;120){P} 11 | \pnode(P|0,0){P0} 12 | \ncline{-}{P}{P0} % 正弦线 13 | \uput[120](P){$P$} 14 | \uput[d](P0){$P_0$} 15 | \end{pspicture} 16 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-1-42.tex: -------------------------------------------------------------------------------- 1 | \documentclass[UTF8]{ctexart} 2 | % 西文正文和数学字体 3 | \let\hbar\relax % 解决 xunicode 与 fourier 的符号冲突 4 | \usepackage{fourier} 5 | % 设置默认编码为 T1,以支持 fourier 宏包 6 | \usepackage[T1]{fontenc} 7 | % 定义新的西文 Times 字体族 8 | \newfontfamily\times{Times New Roman} 9 | % 设置西文等宽字体,并重定义 \ttfamily 来切换到 EU1 编码 10 | \setmonofont{Consolas} 11 | \let\oldttfamily\ttfamily 12 | \def\ttfamily{\oldttfamily\fontencoding{EU1}\selectfont} 13 | % 设置中文字体 14 | \setCJKmainfont{Adobe Kaiti Std} 15 | \begin{document} 16 | Utopia text and $\sum math$ fonts. 17 | 18 | 汉字楷书与 {\times Times New Roman} 字体。 19 | 20 | \texttt{Consolas 0123} 21 | \end{document} 22 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-51.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{siunitx} 2 | \begin{tikzpicture} 3 | \newcommand\iangle{120} 4 | \draw[->] (-1.2,0) -- (1.2,0); 5 | \draw[->] (0,-1.2) -- (0,1.2); 6 | \draw[thick] (0,0) circle (1); 7 | \coordinate[label=\iangle:$P$] (P) at (\iangle:1); 8 | \coordinate[label=below:$P_0$] (P0) at (P |- 0,0); 9 | \draw (0,0) -- (P); 10 | \draw (P) -- (P0); 11 | \fill[fill=gray,fill opacity=0.2] 12 | (0,0) -- (0:1) arc (0:\iangle:1) -- cycle; 13 | \filldraw[fill=gray,fill opacity=0.5] 14 | (0,0) -- (0:0.3) arc (0:\iangle:0.3) -- cycle; 15 | \node[right] at (\iangle/2:0.3) {\ang{\iangle}}; 16 | \end{tikzpicture} 17 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/gloss/testgls.tex: -------------------------------------------------------------------------------- 1 | % testgls.tex 2 | % 最简单的手工词汇表测试 3 | \documentclass[UTF8]{ctexart} 4 | % 打开 \glossary 命令的写文件功能 5 | \makeglossary 6 | % 定义 theglossary 环境为 itemize 环境的别称 7 | \newenvironment{theglossary} 8 | {\begin{itemize}}{\end{itemize}} 9 | % 定义输出词汇表就是读文件 10 | \newcommand\printglossary{% 11 | \InputIfFileExists{\jobname.gls}{\section*{词汇表}}{}} 12 | 13 | \begin{document} 14 | % 第 1 页 15 | % 在正文中定义词汇表条目,前面是排序项,后面是输出格式 16 | \glossary{LaTeX@\LaTeX:基于 \TeX{} 的文档处理系统。} 17 | \LaTeX{} 的内容…… 18 | 19 | \newpage 20 | % 第 2 页 21 | \glossary{Makeindex@Makeindex:索引排序程序。} 22 | Makeindex 的内容…… 23 | 24 | % 输出词汇表 25 | \clearpage 26 | \printglossary 27 | \end{document} 28 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-3-5.tex: -------------------------------------------------------------------------------- 1 | \documentclass{book} 2 | \title{Languages}\author{someone} 3 | \begin{document} 4 | \maketitle 5 | \tableofcontents 6 | % 这里用缩进显示层次 7 | \part{Introduction} % Part I 8 | \chapter{Background} % Chapter 1 9 | \part{Classification} % Part II 10 | \chapter{Natural Language} % Chapter 2 11 | \chapter{Computer Languages} % Chapter 3 12 | \section{Machine Languages} % 3.1 13 | \section{High Level Languages} % 3.2 14 | \subsection{Compiled Language} % 3.2.1 15 | \subsection{Interpretative Language} % 3.2.2 16 | \subsubsection{Lisp} 17 | \paragraph{Common Lisp} 18 | \paragraph{Scheme} 19 | \subsubsection{Perl} 20 | \end{document} 21 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/2-2-60.tex: -------------------------------------------------------------------------------- 1 | \newcommand\kw{\textbf} % 表示描述算法的关键字 2 | \begin{tabbing} 3 | \pushtabs 4 | 算法:在序列 $A$ 中对 $x$ 做二分检索 \\ 5 | 输入:$A$, $x$ 及下标上下界 $L$, $H$ \\ 6 | \qquad\=\+\kw{integer} $L, H, M, j$ \\ 7 | \kw{while} \=\+ $L \leq H$ \kw{do} \` $L$ 与 $H$ 是左右分点 \\ 8 | $M \gets \lfloor(L+H)/2\rfloor$ \` $M$ 是中间分点 \\ 9 | \kw{case} \=\+\\ 10 | condition \= foo \+\kill 11 | $x > A[M]$:\' $H \gets M-1$ \\ 12 | $x < A[M]$:\' $H \gets M+1$ \\ 13 | \kw{else}:\' \= $j \gets M$ \` 找到 $x$,返回位置\\ 14 | \> \kw{return}$(j)$ \\ 15 | \<\< \kw{endcase} \-\-\-\\ 16 | $j \gets 0$ \\ 17 | \kw{return}$(j)$ \-\\ 18 | \poptabs 19 | 算法示例:\\ 20 | $A = \{2, 3, 5, 7, 11\}$, $x=3$\\ 21 | \qquad\=\+ $M$\qquad \= $L$\qquad \= $H$\qquad \= \\ 22 | 无 \> 1 \> 5 \> 初始值,进入循环 \\ 23 | 3 \> 1 \> 2 \> $H$ 变化 \\ 24 | 2 \> 无 \> 无 \> 找到 $x$,输出位置 2 25 | \end{tabbing} 26 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/3-4-6.tex: -------------------------------------------------------------------------------- 1 | \documentclass[UTF8]{ctexbook} 2 | \usepackage{imakeidx} 3 | \makeindex[% 4 | name=persons, % 索引文件名(默认为 \jobname,即主文件名) 5 | title={人名索引}, % 索引表标题(默认为 \indexname) 6 | intoc=true, % 加入目录(默认为 false,不加入目录) 7 | columns=2, % 分栏(默认为 1) 8 | columnsep=1cm, % 栏间距(默认为 35pt) 9 | columnseprule=true, % 分栏线(默认为 false) 10 | program=makeindex, % 调用的索引程序(或用 xindy、texindy) 11 | options={-s mkind.ist}, % 索引程序的选项(默认为空) 12 | noautomatic=false % 不自动调用索引程序(默认为 false) 13 | ] 14 | \indexsetup{% 15 | level=\section*, % 标题级别(默认 \chapter* 即不编号的章) 16 | toclevel=section, % 目录级别(不带反斜线,又如 chapter) 17 | firstpagestyle=empty, % 索引第一页的页面风格(默认为 plain) 18 | headers={人名}{人名}, % 索引的奇偶页眉 19 | othercode={ % 将在索引条目之前生效的任意代码 20 | \renewcommand{\indexspace}{\smallskip}} 21 | } 22 | \begin{document} 23 | 张三\index[persons]{张三} \newpage 24 | 李四\index[persons]{李四} \newpage 25 | 王五\index[persons]{王五} 26 | 27 | \indexprologue{这里列出本文涉及的所有人名。} 28 | \printindex[persons] 29 | \end{document} 30 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/gougu/logo.asy: -------------------------------------------------------------------------------- 1 | // logo.asy 2 | // 弦图的 logo 3 | import trembling; 4 | trembleAngle=10; 5 | trembleFrequency=0.5; 6 | trembleRandom=4; 7 | 8 | path[] tremble(path[] g, 9 | real angle=trembleAngle, 10 | real frequency=trembleFrequency, 11 | real random=trembleRandom, 12 | real fuzz=trembleFuzz()) 13 | { 14 | path[] g_trembled; 15 | for (path g0: g) { 16 | g_trembled = g_trembled ^^ tremble(g0, angle, frequency, random, fuzz); 17 | } 18 | return g_trembled; 19 | } 20 | 21 | pen operator %(pen p, real x) {return p + opacity(x/100);} 22 | 23 | settings.outformat="pdf"; 24 | size(1.5cm); 25 | 26 | pen zhu = red + 0.8; 27 | pen huang = yellow + 0.8; 28 | 29 | path huangshi = box((3,3), (4,4)); 30 | path[] zhushi = (0,3)--(4,0)--(7,4)--(3,7)--cycle ^^ reverse(huangshi); 31 | path[] inner = (0,3)--(4,3) ^^ (4,0)--(4,4) ^^ (7,4)--(3,4) ^^ (3,7)--(3,3); 32 | 33 | huangshi = tremble(huangshi); 34 | zhushi = tremble(zhushi); 35 | inner = tremble(inner); 36 | 37 | filldraw(zhushi, zhu%20, zhu); 38 | fill(huangshi, huang%70); 39 | draw(inner, zhu); 40 | 41 | 42 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-38.tex: -------------------------------------------------------------------------------- 1 | % \usepackage{pstricks-add} 2 | % \usepackage{siunitx} 3 | \begin{figure} 4 | \centering 5 | \newcommand\iangle{120} 6 | \psset{unit=1.5cm,linewidth=0.4pt,algebraic=true} 7 | \begin{pspicture}(-3.5,-1.5)(4.5,1.5) 8 | \rput(-2,0){ 9 | \psaxes[labels=none,ticks=none]{->}(0,0)(-1.2,-1.2)(1.2,1.2) 10 | \pscircle[linewidth=0.8pt](0,0){1} 11 | \pswedge[fillstyle=solid,fillcolor=gray,opacity=0.2] 12 | (0,0){1}{0}{\iangle} 13 | \pswedge[fillstyle=solid,fillcolor=gray,opacity=0.5] 14 | (0,0){0.3}{0}{\iangle} 15 | \uput[!\iangle\space 2 div] 16 | (0.3;!\iangle\space 2 div) {\ang{\iangle}} 17 | \pnode(1;\iangle){P} 18 | \pnode(P|0,0){P0} 19 | \ncline{-}{P}{P0} 20 | \uput[\iangle](P){$P$} 21 | \uput[d](P0){$P_0$} 22 | } 23 | 24 | \psaxes[labels=none,dx=1.57] 25 | {->}(0,0)(0,-1.2)(3.5,1.2) 26 | \psplot[linewidth=0.8pt]{0}{3.5}{sin(x)} 27 | \multido{\n=0+1.57,\i=0+90}{3}{ 28 | \uput*[d](\n,0){\small\ang{\i}} 29 | } 30 | \uput[r](*{3.5} {sin(x)}){$\sin x$} 31 | \pnode(!\iangle\space Pi mul 180 div \iangle\space sin){Q} 32 | \pnode(Q|0,0){Q0} 33 | \uput[u](Q){$Q$} 34 | \uput[d](Q0){$Q_0$} 35 | \ncline{-}{Q}{Q0} 36 | 37 | \psline[linestyle=dashed](P)(Q) 38 | \end{pspicture} 39 | \caption{正弦函数与单位圆(\textsf{PSTricks} 实现)} 40 | \label{fig:pstsine} 41 | \end{figure} 42 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-5-56.tex: -------------------------------------------------------------------------------- 1 | \begin{figure} 2 | \centering 3 | % \usepackage{siunitx} 4 | \begin{tikzpicture}[scale=1.5] % 整体放大坐标,但不影响字号 5 | \newcommand\iangle{120} 6 | % 左边的单位圆 7 | \begin{scope}[xshift=-2cm] 8 | \draw[->] (-1.2,0) -- (1.2,0); 9 | \draw[->] (0,-1.2) -- (0,1.2); 10 | \draw[thick] (0,0) circle (1); 11 | \coordinate[label=\iangle:$P$] (P) at (\iangle:1); 12 | \coordinate[label=below:$P_0$] (P0) at (P |- 0,0); 13 | \draw (0,0) -- (P); 14 | \draw (P) -- (P0); 15 | \fill[fill=gray,fill opacity=0.2] 16 | (0,0) -- (0:1) arc (0:\iangle:1) -- cycle; 17 | \filldraw[fill=gray,fill opacity=0.5] 18 | (0,0) -- (0:0.3) arc (0:\iangle:0.3) -- cycle; 19 | \node[right] at (\iangle/2:0.3) {\ang{\iangle}}; 20 | \end{scope} 21 | % 右边的函数图 22 | \draw[->] (0,0) -- ({rad(210)}, 0); 23 | \draw[->] (0,-1.2) -- (0,1.2); 24 | \draw[thick, domain=0:rad(210)] plot (\x, {sin(\x r)}) 25 | node[right] {$\sin x$}; 26 | \foreach \t in {0, 90, 180} { 27 | \draw ({rad(\t)}, -0.05) -- ({rad(\t)}, 0.05); 28 | \node[below, outer sep=2pt, fill=white, font=\small] 29 | at ({rad(\t)}, 0) {\ang{\t}}; 30 | } 31 | \foreach \y in {-1,1} {\draw (-0.05,\y) -- (0.05,\y);} 32 | \coordinate[label=above:$Q$] (Q) at ({rad(\iangle)}, {sin(\iangle)}); 33 | \coordinate[label=below:$Q_0$] (Q0) at (Q |- 0,0); 34 | \draw (Q) -- (Q0); 35 | \draw[dashed] (P) -- (Q); 36 | \end{tikzpicture} 37 | \caption{正弦函数与单位圆(\textsf{TikZ} 实现)} 38 | \label{fig:tikzsine} 39 | \end{figure} 40 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/gougu/xiantu.asy: -------------------------------------------------------------------------------- 1 | // xiantu.asy 2 | // 弦图 3 | 4 | pen helpline = gray + 0.4; 5 | pen zhu = black + 0.8; 6 | pen huang = black + 0.8; 7 | 8 | path[] grid(pair z1, pair z2, real xstep = 1, real ystep = xstep) 9 | { 10 | path[] g; 11 | pair lb = minbound(z1, z2); 12 | pair rt = maxbound(z1, z2); 13 | for (real x = ceil(lb.x/xstep)*xstep; x <= rt.x; x += xstep) 14 | g.push((x, lb.y) -- (x, rt.y)); 15 | for (real y = ceil(lb.y/ystep)*ystep; y <= rt.y; y += ystep) 16 | g.push((lb.x, y) -- (rt.x, y)); 17 | return g; 18 | } 19 | 20 | unitsize(1cm); 21 | settings.tex = "xelatex"; 22 | 23 | usepackage("xeCJK"); 24 | texpreamble( 25 | "\setCJKmainfont[RawFeature={script=hani:language=CHN:vertical:+valt}] 26 | {FZSongHeiTi_GB18030}"); 27 | defaultpen(fontsize(10.5)); // 五号 28 | 29 | Label vert(Label L) 30 | { 31 | return rotate(-90) * L; 32 | } 33 | 34 | path huangshi = box((3,3), (4,4)); 35 | path[] zhushi = (0,3)--(4,0)--(7,4)--(3,7)--cycle ^^ reverse(huangshi); 36 | fill(zhushi, palegray); 37 | fill(huangshi, lightgray); 38 | draw(grid((0,0), (7,7)), helpline); 39 | draw(shift(4)*rotate(degrees((3,4)))*grid((0,0), (5,5)), helpline); 40 | draw(zhushi, zhu); 41 | draw((0,3)--(4,3) ^^ (4,0)--(4,4) ^^ (7,4)--(3,4) ^^ (3,7)--(3,3), zhu); 42 | 43 | label(vert("中黃實"), (3.5,3.5)); 44 | label(vert("朱實"), (2,4), right); 45 | label(vert("弦實"), (5,4), left); 46 | label(Label("句三",MidPoint,Rotate(down)), (4,0)--(4,3), LeftSide); 47 | label(Label("股四",MidPoint,Rotate(left)), (0,3)--(4,3), RightSide); 48 | label(Label("弦五",MidPoint,Rotate((4,-3))), (0,3)--(4,0), LeftSide); 49 | 50 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/5-1-28.tex: -------------------------------------------------------------------------------- 1 | % 导言区使用 \usepackage{longtable} 2 | \newcommand\meta[1]{\emph{$\langle$#1$\rangle$}} 3 | \begin{longtable}{|l|l|} 4 | \caption{\texttt{longtable} 环境中的命令汇总} \\ 5 | \hline 6 | \endfirsthead 7 | \caption{\texttt{longtable} 环境中的命令汇总(续表)} \\ 8 | \hline 9 | \endhead 10 | \hline 11 | \multicolumn{2}{c}{\itshape 接下一页表格……} \\[2ex] 12 | \endfoot 13 | \hline 14 | \endlastfoot 15 | \multicolumn{2}{|c|}{环境的水平对齐可选项} \\ \hline 16 | 留空 & 表格居中% 17 | \footnote{实际上,留空的对齐方式是由一组命令控制的,参见宏包文档。} \\ 18 | \verb=[c]= & 表格居中 \\ 19 | \verb=[l]= & 表格左对齐 \\ 20 | \verb=[r]= & 表格右对齐 \\ 21 | \hline \multicolumn{2}{|c|}{结束表格一行的命令} \\ \hline 22 | \verb=\\= & 普通的结束一行表格 \\ 23 | \verb=\\[=\meta{距离}\verb=]= & 结束一行,并增加额外间距 \\ 24 | \verb=\\*= & 结束一行,禁止在此分页 \\ 25 | \verb=\kill= & 当前行不输出,只参与宽度计算 \\ 26 | \verb=\endhead= & 此命令以上部分是每页的表头 \\ 27 | \verb=\endfirsthead= & 此命令以上部分是表格第一页的表头 \\ 28 | \verb=\endfoot= & 此命令以上部分是每页的表尾 \\ 29 | \verb=\endlastfoot= & 此命令以上部分是表格最后一页的表尾 \\ 30 | \hline \multicolumn{2}{|c|}{标题命令} \\ \hline 31 | \verb=\caption{=\meta{标题}\verb=}= & 生成带编号的表格标题 \\ 32 | \verb=\caption*{=\meta{标题}\verb=}= & 生成不带编号的表格标题 \\ 33 | \hline \multicolumn{2}{|c|}{分页控制} \\ \hline 34 | \verb=\newpage= & 强制分页 \\ 35 | \verb=\pagebreak[=\meta{程度}\verb=]= & 允许分页的程度(0--4) \\ 36 | \verb=\nopagebreak[=\meta{程度}\verb=]= & 禁止分页的程度(0--4) \\ 37 | \hline \multicolumn{2}{|c|}{脚注控制} \\ \hline 38 | \verb=\footnote= & 使用脚注\footnote{普通表格中不能用。}, 39 | 注意不能用在表格头尾 \\ 40 | \verb=\footnotemark= & 单独产生脚注编号,不能用在表格头尾 \\ 41 | \verb=\footnotetext= & 单独产生脚注文字 \\ 42 | \hline \multicolumn{2}{|c|}{长度参数} \\ \hline 43 | \verb=\LTleft= & 对齐方式留空时,表格左边的间距,默认为 \verb=\fill= \\ 44 | \verb=\LTright= & 对齐方式留空时,表格右边的间距,默认为 \verb=\fill= \\ 45 | \verb=\LTpre= & 表格上方间距,默认为 \verb=\bigskipamount= \\ 46 | \verb=\LTpost= & 表格下方间距,默认为 \verb=\bigskipamount= \\ 47 | \verb=\LTcapwidth= & 表格标题的宽度,默认为 4\,in \\ 48 | \end{longtable} 49 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/gougu/gougu.tex: -------------------------------------------------------------------------------- 1 | %-*- coding: UTF-8 -*- 2 | % gougu.tex 3 | % 勾股定理 4 | \documentclass[UTF8]{ctexart} 5 | 6 | \title{\heiti 杂谈勾股定理} 7 | \author{\kaishu 张三} 8 | \date{\today} 9 | 10 | \usepackage{geometry} 11 | \geometry{a6paper,centering,scale=0.8} 12 | \usepackage{graphicx} 13 | \usepackage[format=hang,font=small,textfont=it]{caption} 14 | \usepackage{float} 15 | \usepackage{amsmath} 16 | \usepackage[nottoc]{tocbibind} 17 | 18 | \bibliographystyle{plain} 19 | %\usepackage{hyperref} 20 | 21 | \newtheorem{thm}{定理} 22 | \newcommand\degree{^\circ} 23 | 24 | \newenvironment{myquote} 25 | {\begin{quote}\kaishu\zihao{-5}} 26 | {\end{quote}} 27 | 28 | \begin{document} 29 | 30 | \maketitle 31 | 32 | \begin{abstract} 33 | 这是一篇关于勾股定理的小短文。 34 | \end{abstract} 35 | 36 | \tableofcontents 37 | 38 | \section{勾股定理在古代} 39 | \label{sec:ancient} 40 | 41 | 西方称勾股定理为毕达哥拉斯定理,将勾股定理的发现归功于公元前 6 世纪的毕达哥拉斯学派 \cite{Kline}。该学派得到了一个法则,可以求出可排成直角三角形三边的三元数组。毕达哥拉斯学派没有书面著作,该定理的严格表述和证明则见于欧几里德\footnote{欧几里德,约公元前 330--275 年。}《几何原本》的命题 47:“直角三角形斜边上的正方形等于两直角边上的两个正方形之和。”证明是用面积做的。 42 | 43 | 我国《周髀算经》载商高(约公元前 12 世纪)答周公问: 44 | \begin{myquote} 45 | 勾广三,股修四,径隅五。 46 | \end{myquote} 47 | 又载陈子(约公元前 7--6 世纪)答荣方问: 48 | \begin{myquote} 49 | 若求邪至日者,以日下为勾,日高为股,勾股各自乘,并而开方除之,得邪至日。 50 | \end{myquote} 51 | 都较古希腊更早。后者已经明确道出勾股定理的一般形式。图 \ref{fig:xiantu} 是我国古代对勾股定理的一种证明 \cite{quanjing}。 52 | \begin{figure}[ht] 53 | \centering 54 | \includegraphics[scale=0.6]{xiantu.pdf} 55 | \caption{宋赵爽在《周髀算经》注中作的弦图(仿制),该图给出了勾股定理的一个极具对称美的证明。} 56 | \label{fig:xiantu} 57 | \end{figure} 58 | 59 | \section{勾股定理的近代形式} 60 | 61 | 勾股定理可以用现代语言表述如下: 62 | \begin{thm}[勾股定理] 63 | 直角三角形斜边的平方等于两腰的平方和。 64 | 65 | 可以用符号语言表述为:设直角三角形 $ABC$,其中 $\angle C=90\degree$,则有 66 | \begin{equation}\label{eq:gougu} 67 | AB^2 = BC^2 + AC^2. 68 | \end{equation} 69 | \end{thm} 70 | 71 | 满足式 \eqref{eq:gougu} 的整数称为\emph{勾股数}。第 \ref{sec:ancient} 节所说毕达哥拉斯学派得到的三元数组就是勾股数。下表列出一些较小的勾股数: 72 | \begin{table}[H] 73 | \begin{tabular}{|rrr|} 74 | \hline 75 | 直角边 $a$ & 直角边 $b$ & 斜边 $c$\\ 76 | \hline 77 | 3 & 4 & 5 \\ 78 | 5 & 12 & 13 \\ 79 | \hline 80 | \end{tabular}% 81 | \qquad 82 | ($a^2 + b^2 = c^2$) 83 | \end{table} 84 | 85 | \nocite{Shiye} 86 | \bibliography{math} 87 | \end{document} 88 | -------------------------------------------------------------------------------- /《Latex入门》配书案例/gougu/gougu-slide.tex: -------------------------------------------------------------------------------- 1 | \documentclass[no-math,xcolor=table]{beamer} 2 | 3 | \usepackage[noindent,UTF8]{ctexcap} 4 | \setCJKmainfont[ItalicFont={华文新魏}]{黑体} 5 | 6 | % 修正 XeTeX 下导航按钮失效问题 7 | \usepackage{patchbeamer} 8 | 9 | \usepackage{tikz} 10 | 11 | \usetheme{PaloAlto} 12 | \usecolortheme{crane} 13 | 14 | \newtheorem{thm}{定理} 15 | 16 | \bibliographystyle{apalike} 17 | 18 | \logo{\includegraphics{logo.pdf}} 19 | 20 | \title{杂谈勾股定理} 21 | \subtitle{数学史讲座之一} 22 | \institute{九章学堂} 23 | \author{张三} 24 | \date{\today} 25 | \subject{勾股定理} 26 | \keywords{勾股定理, 历史} 27 | 28 | \begin{document} 29 | 30 | \begin{frame} 31 | \titlepage 32 | \end{frame} 33 | 34 | \begin{frame}{目录} 35 | \tableofcontents[pausesections] 36 | \end{frame} 37 | 38 | \section{勾股定理在古代} 39 | \label{sec:ancient} 40 | 41 | \begin{frame}{古希腊数学} 42 | 43 | 勾股定理在西方称为毕达哥拉斯定理,古希腊数学家在 2000 多年前就已经发现并证明了它\cite{Kline}。\pause 44 | \begin{itemize} 45 | \item<+-| alert@+> 46 | 公元前 6 世纪,毕达哥拉斯学派发现一个法则,可以构造直角三角形的边长; 47 | \item<+-| alert@+> 48 | 公元前 3 世纪,欧几里德《几何原本》使用面积法证明勾股定理。 49 | \end{itemize} 50 | \end{frame} 51 | 52 | \begin{frame}{古中国数学}{定理发现} 53 | 54 | 中国在 3000 多年前就知道勾股数的概念,比古希腊更早一些。\pause 55 | 56 | 《周髀算经》的记载:\pause 57 | \begin{itemize}[<+-| alert@+>] 58 | \item 59 | 公元前 11 世纪,商高答周公问: 60 | \begin{quote} 61 | 勾广三,股修四,径隅五。 62 | \end{quote} 63 | \item 64 | 又载公元前 7--6 世纪陈子答荣方问,表述了勾股定理的一般形式: 65 | \begin{quote} 66 | 若求邪至日者,以日下为勾,日高为股,勾股各自乘,并而开方除之,得邪至日。 67 | \end{quote} 68 | \end{itemize} 69 | \end{frame} 70 | 71 | \begin{frame}{古中国数学}{定理证明} 72 | 有论者认为早在公元前 11 世纪商高即已证明勾股定理\cite{quanjing}。完整的证明见于三国时(公元 3 世纪)赵爽对《周髀算经》的注释。 73 | \pause 74 | \begin{figure} 75 | \centering 76 | \includegraphics[height=0.4\textheight]{xiantu.pdf} 77 | \caption{赵爽的弦图可给出勾股定理的一个富于对称美的证明} 78 | \end{figure} 79 | \end{frame} 80 | 81 | \section{勾股定理在现代} 82 | 83 | \begin{frame}{现代叙述} 84 | \begin{thm}[勾股定理] 85 | 直角三角形斜边的平方等于两直角边的平方和。\pause 86 | 87 | 可以用符号语言表述为:设直角三角形 $ABC$,其中 $\angle C=90^\circ$,则有 88 | \begin{equation}\label{eq:gougu} 89 | AB^2 = BC^2 + AC^2. 90 | \end{equation} 91 | \begin{center} 92 | \begin{tikzpicture}[scale=0.5,font=\small] 93 | \draw[thick] (0,0) node[left] {$A$} 94 | -- (4,0) node[right] {$C$} 95 | -- (4,3) node[above right] {$B$} -- cycle; 96 | \draw (3.5,0) |- (4,0.5); 97 | \end{tikzpicture} 98 | \end{center} 99 | \end{thm} 100 | \end{frame} 101 | 102 | \begin{frame}{勾股数} 103 | 满足式 \eqref{eq:gougu} 的整数称为\emph{勾股数}。第 \ref{sec:ancient} 节所说毕达哥拉斯学派得到的三元数组就是勾股数。 104 | \begin{table} 105 | \centering 106 | % 颜色 craneorange 是在 crane 色彩主题中定义的 107 | \rowcolors{2}{craneorange!25}{craneorange!50} 108 | \begin{tabular}{rrr} 109 | \rowcolor{craneorange}直角边 $a$ & 直角边 $b$ & 斜边 $c$\\ 110 | 3 & 4 & 5 \\ 111 | 5 & 12 & 13 \\ 112 | 7 & 24 & 25 \\ 113 | 8 & 15 & 17 \\ 114 | \end{tabular} 115 | \caption{较小的几组勾股数} 116 | \end{table} 117 | \end{frame} 118 | 119 | \begin{frame}{参考文献} 120 | \nocite{Shiye} 121 | \bibliography{math} 122 | \end{frame} 123 | \end{document} 124 | --------------------------------------------------------------------------------