mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-16 22:42:21 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
c77b65cea0
@ -1,99 +0,0 @@
|
||||
Scoutydren is translating.
|
||||
5 arcade-style games in your Linux repository
|
||||
======
|
||||
|
||||
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/arcade_game_gaming.jpg?itok=84Rjk_32)
|
||||
|
||||
Gaming has traditionally been one of Linux's weak points. That has changed somewhat in recent years thanks to [Steam][1], [GOG][2], and other efforts to bring commercial games to multiple operating systems, but those games often are not open source. Sure, the games can be played on an open source operating system, but that is not good enough for an open source purist.
|
||||
|
||||
So, can someone who uses only free and open source software find games that are polished enough to present a solid gaming experience without compromising their open source ideals? Absolutely! While most open source games are unlikely to rival some of the AAA commercial games developed with massive budgets, there are plenty of open source games, in many genres, that are fun to play and can be installed from the repositories of most major Linux distributions.
|
||||
|
||||
I am starting this series of articles on open source games for Linux by looking at arcade-style games. In future articles, I plan to cover board & card, puzzle, racing, role-playing, and strategy & simulation games.
|
||||
|
||||
### AstroMenace
|
||||
|
||||
![](https://opensource.com/sites/default/files/u128651/astromenace.png)
|
||||
|
||||
[AstroMenace][3] is a scrolling space shooter for the modern era. It began as a closed source game, but the code and art assets have since been released under open licenses. Gameplay is fairly typical for the style of game, but it features nice, modern 3D graphics. Ship and weapon upgrades can be purchased using the points earned from shooting down enemies. The difficulty level can be tweaked by changing a wide variety of options, so the game is approachable to new players while still offering a challenge to experienced ones.
|
||||
|
||||
To install AstroMenace, run the following command:
|
||||
|
||||
* On Fedora: `dnf install astromenace`
|
||||
* On Debian/Ubuntu: `apt install astromenace`
|
||||
|
||||
|
||||
|
||||
### Battle Tanks
|
||||
|
||||
![](https://opensource.com/sites/default/files/u128651/battle_tanks.png)
|
||||
|
||||
[Battle Tanks][4] is a fast-paced tank battle game with an overhead perspective. Players maneuver one of three different vehicle types around a map, collecting power-ups and trying to blow up their opponents. It has deathmatch, team deathmatch, capture the flag, and cooperative game modes. There are nine maps for the deathmatch and capture the flag modes and four maps for cooperative mode. The game supports split-screen local multiplayer for two players and local area network multiplayer for larger matches. Gameplay is fast-paced, and the default match length of five minutes is short, which makes Battle Tanks a nice choice for gamers who want something quick to play.
|
||||
|
||||
To install Battle Tanks, run the following command:
|
||||
|
||||
* On Fedora: `dnf install btanks`
|
||||
* On Debian/Ubuntu: `apt install btanks`
|
||||
|
||||
|
||||
|
||||
### M.A.R.S.
|
||||
|
||||
![](https://opensource.com/sites/default/files/u128651/m.a.r.s.png)
|
||||
|
||||
[M.A.R.S.][5] is a top-down space shooter with physics similar to the classic Asteroids arcade game. Players control a spaceship while shooting at their opponents, maneuvering around the screen, and avoiding planets and opponents' incoming fire. The standard death match and team death match modes are available, but there are other modes, like one that requires pushing a ball into the opposing team's home planet, that provide some variety to the gameplay options. It supports local multiplayer, but unfortunately network multiplayer has not been implemented. Since development on the game appears to have stalled, network multiplayer is not likely to appear at any point in the near future, but the game is still fun and playable without it.
|
||||
|
||||
To install M.A.R.S., run the following command:
|
||||
|
||||
* On Fedora: `dnf install marsshooter`
|
||||
* On Debian/Ubuntu: `apt install marsshooter`
|
||||
|
||||
|
||||
|
||||
### Neverball
|
||||
|
||||
![](https://opensource.com/sites/default/files/u128651/neverball.png)
|
||||
|
||||
With gameplay inspired by Sega's Super Monkey Ball, [Neverball][6] challenges the player to move a ball through a 3D playing field by moving the playing field, not the ball. The objective is to collect enough coins to open a level's exit and maneuver the ball to the exit before time runs out. There are seven different sets of levels, which range in difficulty from easy to impossible. The game can be played using the keyboard, mouse, or joystick.
|
||||
|
||||
To install Neverball, run the following command:
|
||||
|
||||
* On Fedora: `dnf install neverball`
|
||||
* On Debian/Ubuntu: `apt install neverball`
|
||||
|
||||
|
||||
|
||||
### SuperTux
|
||||
|
||||
![](https://opensource.com/sites/default/files/u128651/supertux.png)
|
||||
|
||||
[SuperTux][7] is a 2D platformer modeled after Nintendo's Super Mario Bros. games. Linux's mascot, Tux the Penguin, takes the place of Mario with eggs serving as the equivalent of Super Mario Bros.'s mushroom power-ups. When Tux is powered up with an egg, he can collect flowers that grant him extra abilities. The fire flower, which lets Tux throw fireballs, is the most common in the game's levels, but ice, air, and earth flowers are included in the game's code. Collecting star power-ups makes Tux temporarily invincible, just like in the Super Mario games. The default level set, Icy Island, is 30 levels, making the game approximately the same length as the original Super Mario Bros., but SuperTux also comes with several contributed level sets, including three bonus islands, a forest island, a Halloween island, and incubator and test levels. SuperTux has a built-in level editor, so users can create their own.
|
||||
|
||||
To install SuperTux, run the following command:
|
||||
|
||||
* On Fedora: `dnf install supertux`
|
||||
* On Debian/Ubuntu: `apt install supertux`
|
||||
|
||||
|
||||
|
||||
Did I miss one of your favorite open source arcade games? Share it in the comments below.
|
||||
### About the author
|
||||
Joshua Allen Holm - Joshua Allen Holm, MLIS, MEd, is one of Opensource.com's Community Moderators. Joshua's main interests are digital humanities, open access, and open educational resources. You can find Joshua on GitHub, GitLab, LinkedIn, and Zotero. He can reached at holmja@opensource.com.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/1/arcade-games-linux
|
||||
|
||||
作者:[Joshua Allen Holm][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/holmja
|
||||
[1]:http://store.steampowered.com/
|
||||
[2]:https://www.gog.com/
|
||||
[3]:http://www.viewizard.com/
|
||||
[4]:http://btanks.sourceforge.net/blog/about-game
|
||||
[5]:http://mars-game.sourceforge.net/?page_id=10
|
||||
[6]:https://neverball.org/index.php
|
||||
[7]:http://supertux.org/
|
@ -1,138 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to create presentations with Beamer)
|
||||
[#]: via: (https://opensource.com/article/19/1/create-presentations-beamer)
|
||||
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
|
||||
|
||||
How to create presentations with Beamer
|
||||
======
|
||||
Beamer brings LaTeX's powerful typesetting features and ecosystem to creating slides.
|
||||
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus_presentation.png?itok=CQeyO61b)
|
||||
|
||||
[Beamer][1] is a LaTeX package for generating presentation slide decks. One of its nicest features is that it can take advantage of LaTeX's powerful typesetting system and all the other packages in its ecosystem. For example, I often use LaTeX's [listings][2] package in Beamer presentations that include code.
|
||||
|
||||
### Starting a presentation
|
||||
|
||||
To begin a Beamer document, enter:
|
||||
|
||||
```
|
||||
\documentclass{beamer}
|
||||
```
|
||||
|
||||
As you would with any other LaTeX document, add any packages you want to use. For example, to use the **listings** package, enter:
|
||||
|
||||
```
|
||||
\usepackage{listings}
|
||||
```
|
||||
|
||||
Place all content inside the **document** environment:
|
||||
|
||||
```
|
||||
\begin{document}
|
||||
```
|
||||
|
||||
Beamer documents are usually a sequence of **frame** environments. Frames that contain code should be marked **fragile** :
|
||||
|
||||
```
|
||||
\begin{frame}[fragile]
|
||||
```
|
||||
|
||||
Begin your frames with a title:
|
||||
|
||||
```
|
||||
\frametitle{Function to Do Stuff}
|
||||
```
|
||||
|
||||
### Testing your code before you present it
|
||||
|
||||
One of the worst feelings in the world is giving a talk and realizing, as you walk through the code, that there is a glaring bug in it—maybe a misspelled keyword or an unclosed brace.
|
||||
|
||||
The solution is to test code that is presented. In most presentation environments, this means creating a separate file, writing tests, then copying and pasting.
|
||||
|
||||
However, with Beamer, there is a better way. Imagine you have a file named **do_stuff.py** that contains code. You can write tests for the **do_stuff.py** code in a second file, which you call **test_do_stuff.py** , and can exercise it with, say, [pytest][3]. However, most of the lines in **do_stuff.py** lack pedagogic value, like defining helper functions.
|
||||
|
||||
To simplify things for your audience, you can import just the lines you want to talk about into the frame in your presentation :
|
||||
|
||||
```
|
||||
\lstinputlisting[
|
||||
language=Python,
|
||||
firstline=8,
|
||||
lastline=15
|
||||
]{do_stuff.py}
|
||||
```
|
||||
|
||||
Since you will be talking through those lines (from 8 to 15), you don't need any other content on the slide. Close the frame:
|
||||
|
||||
```
|
||||
\end{frame}
|
||||
```
|
||||
|
||||
On the next slide, you want to show a usage example for the **do_stuff()** function you just presented:
|
||||
|
||||
```
|
||||
\begin{frame}[fragile]
|
||||
\frametitle{Calling Function to Do Stuff}
|
||||
\lstinputlisting[
|
||||
language=Python,
|
||||
firstline=17,
|
||||
lastline=19
|
||||
]{do_stuff.py}
|
||||
\end{frame}
|
||||
```
|
||||
|
||||
You use the same file, but this time you show the lines that call the function. Finally, close the document:
|
||||
|
||||
```
|
||||
\end{document}
|
||||
```
|
||||
|
||||
Assuming you have an appropriate Python file in **do_stuff.py** , this will produce a short two-slide presentation.
|
||||
|
||||
Beamer also supports necessary features such as progressive revelation, showing only one bullet at a time to prevent the audience from being distracted by reading ahead.": **\pause** inside a list will divide bullets into pages:
|
||||
|
||||
```
|
||||
\begin{frame}
|
||||
Remember:
|
||||
\begin{itemize}
|
||||
\item This will show up on the first slide. \pause
|
||||
\item This will show up on the
|
||||
second slide, as well as the preceding point. \pause
|
||||
\item Finally, on the third slide,
|
||||
all three bullets will show up.
|
||||
\end{frame}
|
||||
```
|
||||
|
||||
### Creating handouts
|
||||
|
||||
My favorite feature in Beamer is that you can set it to ignore everything outside a frame with **\documentclass[ignorenonframetext]{beamer}**. When I prepare a presentation, I leave off the top (where the document class is declared) and auto-generate two versions of it: one with Beamer that ignores all text outside any frame, which I use for my presentation, and one with a header like:
|
||||
|
||||
```
|
||||
\documentclass{article}
|
||||
\usepackage{beamerarticle}
|
||||
```
|
||||
|
||||
which generates a handout—a PDF that has all the frames and all the text between them.
|
||||
|
||||
When a conference organizer asks me to publish my slides, I include the original slide deck as a reference, but the main thing I like people to have is the handout, which has all the explanatory text that I don't want to include on the slide deck itself.
|
||||
|
||||
When creating presentation slides, people often wonder whether it's better to optimize their materials for the presentation or for people who want to read them afterward. Fortunately, Beamer provides the best of both worlds.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/1/create-presentations-beamer
|
||||
|
||||
作者:[Moshe Zadka][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/moshez
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.overleaf.com/learn/latex/Beamer
|
||||
[2]: https://www.overleaf.com/learn/latex/Code_listing
|
||||
[3]: https://docs.pytest.org/en/latest/
|
@ -0,0 +1,97 @@
|
||||
# 10款Linux街机游戏
|
||||
|
||||
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/arcade_game_gaming.jpg?itok=84Rjk_32)
|
||||
|
||||
长久以来,游戏都是 Linux 的软肋。近些年,Steam,GOG等游戏发布平台上不少商业游戏都开始支持 Linux,这对于 Linux 的游戏生态来说是件好事,但是我们能在这些平台上玩到的游戏通常是不开源的商业作品。当然,这些游戏在一个开源的操作系统上运行,但对于一个开源提倡者来说这似乎还不够纯粹。
|
||||
|
||||
那么,我们能找到既免费开源又能给玩家带来完整游戏体验的优质游戏吗?当然!虽然绝大多数的开源游戏很难和3A 商业游戏大作竞争,但仍然有不少各种类型的开源游戏,不仅内容有趣而且直接可以通过几大 Linux 发行版本库中直接安装。
|
||||
|
||||
本文首先介绍 Linux 开源游戏中的街机类型游戏,在之后的文章中,我将介绍桌面和卡牌游戏,解谜游戏,竞速游戏,以及策略模拟游戏。
|
||||
|
||||
### AstroMenace 太空危机
|
||||
|
||||
![](https://opensource.com/sites/default/files/u128651/astromenace.png)
|
||||
|
||||
[AstroMenace][3] 是一个近现代太空背景下的滚动页面射击游戏。开发初期它是一个闭源游戏,但它的代码和美术而后在开源证书下被公开。游戏玩法和大多数此类游戏大同小异,但它有质量极高的 3D 画面。飞船和武器更新可以通过击杀敌人所获得的点数购买。游戏的难度可以选择,因此适合新手以及想要追求挑战的硬核玩家。
|
||||
|
||||
安装 AstroMenace,你只需要在终端下运行以下指令:
|
||||
|
||||
- Fedora 用户: `dnf install astromenace`
|
||||
- Debian/Ubuntu 用户: `apt install astromenace`
|
||||
|
||||
### Battle Tanks 坦克战役
|
||||
|
||||
![](https://opensource.com/sites/default/files/u128651/battle_tanks.png)
|
||||
|
||||
[Battle Tanks][4] 是一个俯瞰式视角的快节奏坦克战斗游戏。玩家可以选择三种不同的陆地坦克,操纵其在地图上前行,收集道具并且尝试炸飞敌军。它有四种游戏模式,死亡竞赛(又称“死斗”),团队死斗,夺旗模式和合作模式。死斗和夺旗模式下,分别有8张地图可供玩家选择,合作模式则有4张。该游戏支持分屏本地双人游戏,以及在线多人竞技。游戏节奏很快,默认一次战役仅5分钟,因此Battle Tank十分适合想要利用零碎时间快速来一局的玩家。
|
||||
|
||||
安装 Battle Tanks,你只需要在终端下运行以下指令:
|
||||
|
||||
- Fedora 用户: `dnf install btanks`
|
||||
- Debian/Ubuntu 用户: `apt install btanks`
|
||||
|
||||
|
||||
|
||||
### M.A.R.S. 火星
|
||||
|
||||
![](https://opensource.com/sites/default/files/u128651/m.a.r.s.png)
|
||||
|
||||
[M.A.R.S.][5] 是一个自上而下的太空射击游戏,游戏机制类似传统街机游戏 “爆破彗星(Asteroids)”。玩家在操控一个太空船的同时向敌方射击并躲避敌军的弹幕射击。游戏有标准的死斗和团体死斗模式,除此之外也有更新鲜的比赛形式——例如在一个模式下,玩家需要控制一个球使其进入敌方母星。该游戏支持本地多人游戏,但遗憾的是不支持多人联机。该游戏的开发更新似乎已经停止,所以该游戏之后增加联机模式的几率很小,但就算没有联机支持,这个游戏仍然值得一试。
|
||||
|
||||
安装 M.A.R.S. ,你只需要在终端下运行以下指令:
|
||||
|
||||
- Fedora 用户: `dnf install marsshooter``
|
||||
- Debian/Ubuntu 用户: ``apt install marsshooter`
|
||||
|
||||
|
||||
|
||||
### Neverball 不存在之球
|
||||
|
||||
![](https://opensource.com/sites/default/files/u128651/neverball.png)
|
||||
|
||||
[Neverball][6] 的游戏灵感来源自世嘉的 “超级猴子球(Super Monkey Ball)” ,玩家需要将一个球在3D球场上运动起来,但是玩家控制的不是球,而是球场。游戏任务是在规定的时限内,收集足够多的金币从而打开该关卡的出口并且将小球落进该洞中。游戏可以调整难度,从休闲到黑魂能适应不同的玩家需求。该游戏支持键盘/鼠标以及控制杆操作。
|
||||
|
||||
安装 Neverball, 你只需要在终端下运行以下指令:
|
||||
|
||||
- Fedora 用户:`dnf install neverball`
|
||||
- Debian/Ubuntu 用户:`apt install neverball`
|
||||
|
||||
|
||||
|
||||
### SuperTux 超级Tux
|
||||
|
||||
![](https://opensource.com/sites/default/files/u128651/supertux.png)
|
||||
|
||||
[SuperTux][7] 是继任天堂超级马里奥后的一款 2D 的平台跳跃游戏。Linux 的吉祥物,企鹅 Tux 代替了马里奥,而鸡蛋对应着马里奥系列中的蘑菇能力提升。当 Tux 获得了鸡蛋得到了能力提升,他便可以收集花朵,而花朵可以带来新的附加特殊能力。火焰花在关卡中最为常见,收集了火焰花的 Tux 可以掷出火球。除此之外,冰冻花/空气花/土地花也在游戏的程序中。收集星星的能力提升能使 Tux 暂时变得隐形,就如同马里奥系列游戏。该游戏最基础的一组关卡,冰之岛也有 30 关之多,因此游戏的内容和流程和超级马里奥系列一般长。SuperTux 还有一些附加关卡,例如三个额外奖励小岛,一个森林之岛,一个万圣节岛,一个孵化处,以及很多测试关卡。SuperTux 有一个自带的关卡编辑器,所以玩家可以创建他们的原创关卡。
|
||||
|
||||
安装 SuperTux,你只需要在终端下运行以下指令:
|
||||
|
||||
- Fedora 用户:`dnf install supertux`
|
||||
- Debian/Ubuntu 用户: `apt install supertux`
|
||||
|
||||
|
||||
|
||||
如果我没有在上文中提及你最喜欢的开源街机游戏,欢迎在评论中分享。
|
||||
|
||||
### 有关作者
|
||||
|
||||
Joshua Allen Holm - Joshua Allen Holm, MLIS, MEd, 是 Opensource.com 的社区协调者之一。他的主要兴趣有数字人文,学术开放以及公开教育资源。你可以在 GitHub,GitLab,LinkedIn 和 Zotero 上找到他。可以通过 holmja@opensource.com 联系到他。
|
||||
|
||||
------
|
||||
|
||||
via: https://opensource.com/article/18/1/arcade-games-linux
|
||||
|
||||
作者:[Joshua Allen Holm][a]
|
||||
译者:[Scoutydren](https://github.com/Scoutydren)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/holmja
|
||||
[1]: http://store.steampowered.com/
|
||||
[2]: https://www.gog.com/
|
||||
[3]: http://www.viewizard.com/
|
||||
[4]: http://btanks.sourceforge.net/blog/about-game
|
||||
[5]: http://mars-game.sourceforge.net/?page_id=10
|
||||
[6]: https://neverball.org/index.php
|
||||
[7]: http://supertux.org/
|
@ -0,0 +1,138 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to create presentations with Beamer)
|
||||
[#]: via: (https://opensource.com/article/19/1/create-presentations-beamer)
|
||||
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
|
||||
|
||||
如何使用 Beamer 创建演示文稿
|
||||
======
|
||||
Beamer 将 LaTeX 强大的排版功能和生态系统带进创建幻灯片中。
|
||||
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus_presentation.png?itok=CQeyO61b)
|
||||
|
||||
[Beamer][1] 是用于生成幻灯片的 LaTeX 包。它最棒的功能之一是它可以利用 LaTeX 强大的排版系统和其生态系统中的所有其他软件包。例如,我经常在包含代码的 Beamer 演示文稿中使用 LaTeX 的 [listings][2] 包。
|
||||
|
||||
### 创建演示文稿
|
||||
|
||||
要创建一个 Beamer 文档,输入:
|
||||
|
||||
```
|
||||
\documentclass{beamer}
|
||||
```
|
||||
|
||||
与任何其他 LaTeX 文档一样,添加你要使用的任何包。例如,要使用 **listings** 包,请输入:
|
||||
|
||||
```
|
||||
\usepackage{listings}
|
||||
```
|
||||
|
||||
将所有内容放在 **document** 环境中:
|
||||
|
||||
```
|
||||
\begin{document}
|
||||
```
|
||||
|
||||
Beamer 文档通常时是一系列的 **frame** 环境。包含代码的 frame 应该被标记为 **fragile**:
|
||||
|
||||
```
|
||||
\begin{frame}[fragile]
|
||||
```
|
||||
|
||||
使用标题开始你的 frame:
|
||||
|
||||
```
|
||||
\frametitle{Function to Do Stuff}
|
||||
```
|
||||
|
||||
### 开始演示前测试你的代码
|
||||
|
||||
世上最糟糕的感受之一你在演讲中说到代码时,突然发现了一个 bug—也许是拼错了关键词或者漏掉了括号。
|
||||
|
||||
解决方法之一就是测试演示的代码。在多数演示环境中,这意味着创建一个单独的文件、编写测试接着拷贝和粘贴。
|
||||
|
||||
然而,在 Beamer 中有一种更好的方法。想象一下,你有一个名为 **do_stuff.py** 的文件,其中包含代码。你可以在第二个文件中编写 **do_stuff.py** 代码的测试,你可以将其命名为 **test_do_stuff.py**,并且可以使用 [pytest][3] 测试。但是,**do_stuff.py**中的大多数行都缺乏教学价值,比如定义辅助函数。
|
||||
|
||||
要简化你受众看到的东西,你可在演示文稿中只导入你要讨论的行到 frame 中:
|
||||
|
||||
```
|
||||
\lstinputlisting[
|
||||
language=Python,
|
||||
firstline=8,
|
||||
lastline=15
|
||||
]{do_stuff.py}
|
||||
```
|
||||
|
||||
由于你会对这几行(从 8 到 15)进行讨论,因此幻灯片上不需要任何其他内容。结束 frame:
|
||||
|
||||
```
|
||||
\end{frame}
|
||||
```
|
||||
|
||||
在下一张幻灯片中,你想展示刚才的 **do_stuff()** 函数的用法示例:
|
||||
|
||||
```
|
||||
\begin{frame}[fragile]
|
||||
\frametitle{Calling Function to Do Stuff}
|
||||
\lstinputlisting[
|
||||
language=Python,
|
||||
firstline=17,
|
||||
lastline=19
|
||||
]{do_stuff.py}
|
||||
\end{frame}
|
||||
```
|
||||
|
||||
你使用相同的文件,但这次显示调用该函数的行。最后,结束 document:
|
||||
|
||||
```
|
||||
\end{document}
|
||||
```
|
||||
|
||||
假设你在 **do_stuff.py** 中有一个合适的 Python 文件,这将生成一个含有 2 页的幻灯片。
|
||||
|
||||
Beamer 还支持必要的功能如渐进式演示,每次给观众展示一部分以免受到前面的打扰。在行中放入 ”**\pause**“ 会将页面分成不同的部分:
|
||||
|
||||
```
|
||||
\begin{frame}
|
||||
Remember:
|
||||
\begin{itemize}
|
||||
\item This will show up on the first slide. \pause
|
||||
\item This will show up on the
|
||||
second slide, as well as the preceding point. \pause
|
||||
\item Finally, on the third slide,
|
||||
all three bullets will show up.
|
||||
\end{frame}
|
||||
```
|
||||
|
||||
### 创建讲义
|
||||
|
||||
Beamer 中我最喜欢的功能是你可以用 **\documentclass[ignorenonframetext]{beamer}** 设置忽略 frame 外的所有内容。当我准备演示文稿时,我离开顶部(声明文档类的位置)并自动生成它的两个版本:我的演示稿使用 Beamer 忽略任何 frame 之外的所有文本,另一个含有类似这样的头:
|
||||
|
||||
```
|
||||
\documentclass{article}
|
||||
\usepackage{beamerarticle}
|
||||
```
|
||||
|
||||
这会生成一份讲义—一份含有所有 frame 和它们之间文字的 PDF。
|
||||
|
||||
当会议组织者要求我发布我的幻灯片时,我会包含原始幻灯片作为参考,但我希望人们拿到的是讲义,它包含了所有我不想在幻灯片上写的解释部分。
|
||||
|
||||
在创建幻灯片时,人们经常想是要为演讲优化资料还是方便那些想要日后阅读的人。幸运的是,Beamer 提供了两全其美的办法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/1/create-presentations-beamer
|
||||
|
||||
作者:[Moshe Zadka][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/moshez
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.overleaf.com/learn/latex/Beamer
|
||||
[2]: https://www.overleaf.com/learn/latex/Code_listing
|
||||
[3]: https://docs.pytest.org/en/latest/
|
Loading…
Reference in New Issue
Block a user