TransWikia.com

Recommended style for (technical) listings and algorithms. When to use floating?

TeX - LaTeX Asked on March 16, 2021

For figures, you usually would use some floating environment. I think this is in general the recommended way (right?).

For algorithms, it is probably the same (via listings). E.g. I had some text like this:

The training pipeline is as follows:

  1. Setup, prepare data…
  2. Construct network, loss, optimizer
  3. Train epoch
  4. Repeat

I assume it would be better to put this into a lstlisting environment, right?
(For any type of pseudo code or algorithms, even if they just list some steps.)

Now I also have some text like this:

We provide several datasets such as:

  • Librispeech
  • HDF dataset
  • XML synthetic data
  • Episodic copy synthetic data

I wonder if I also should put this into a floating environment, in the same style as algorithms?
And what environment would be the most appropriate? Actually, this is really a listing, so I guess it makes sense to also refer to it as "listing". But I’m not sure if I should reuse/abuse the lstlisting environment for it?

I just looked at the listings documentation, and it seems the author doesn’t use floating environments for most of the documentation. So maybe a floating environment is not so universally recommended? In may case, I’m writing a Phd thesis, and otherwise usually scientific articles. Maybe it is more common in that case? (The examples above are somewhat more technical. But often, it becomes more mathematical or theoretical.)

(I’m not sure if this is subjective, or if there is some general recommended style. I’m also not sure whether Tex.SE is the right place to ask, or where would be the right place to ask.)

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP