SPECIAL NOTICE
Malicious code was found on the site, which has been removed, but would have been able to access files and the database, revealing email addresses, posts, and encoded passwords (which would need to be decoded). However, there is no direct evidence that any such activity occurred. REGARDLESS, BE SURE TO CHANGE YOUR PASSWORDS. And as is good practice, remember to never use the same password on more than one site. While performing housekeeping, we also decided to upgrade the forums.
This is a site for discussing roleplaying games. Have fun doing so, but there is one major rule: do not discuss political issues that aren't directly and uniquely related to the subject of the thread and about gaming. While this site is dedicated to free speech, the following will not be tolerated: devolving a thread into unrelated political discussion, sockpuppeting (using multiple and/or bogus accounts), disrupting topics without contributing to them, and posting images that could get someone fired in the workplace (an external link is OK, but clearly mark it as Not Safe For Work, or NSFW). If you receive a warning, please take it seriously and either move on to another topic or steer the discussion back to its original RPG-related theme.

LaTeX for tabletop

Started by Vladar, April 15, 2023, 02:20:58 PM

Previous topic - Next topic

Vladar

In the following months I will be releasing a series of blog posts regarding the usage of LaTeX in tabletop publishing. If you want to see a particular topic covered, let me know.

https://vladar.bearblog.dev/latex-for-tabletop/
Into the Dungeon: Revived — a lightweight fantasy-themed role-playing ruleset designed for a streamlined gameplay.
My blog

Zelen

Very cool, I'm very interested in this topic but when I began investigating it, it became quite a rabbit hole for me.

GeekyBugle

Neat! My boy is using LaTex for his university assignments, has insisted it's easier than using LibreOffice for my purposes, I have one immediate question tho: Which one is the OSR template?

Do you plan on covering image positioning/resizing?
Quote from: Rhedyn

Here is why this forum tends to be so stupid. Many people here think Joe Biden is "The Left", when he is actually Far Right and every US republican is just an idiot.

"During times of universal deceit, telling the truth becomes a revolutionary act."

― George Orwell

Howard

Quote from: GeekyBugle on April 28, 2023, 10:32:11 PM
Neat! My boy is using LaTex for his university assignments, has insisted it's easier than using LibreOffice for my purposes, I have one immediate question tho: Which one is the OSR template?

Do you plan on covering image positioning/resizing?

Having written a Master's Thesis (with footnotes, cross references, charts, & tables) in LaTeX as well as gaming stuff (wargaming) with LibreOffice (charts, tables, no footnotes, manually generated cross references), it is a coin toss. If you do documents that you are the primary/only editor of, then LaTeX can be a major plus as you don't end up spending time (bleep)ing around with formatting and reformatting if you add some text near the start of a section (cross references update themselves if you reorder rules...). If you have multiple document editors and they aren't LaTeX fluent, it may be the wrong tool for the job.

I guarantee that the hours I spent removing/adding column breaks and line breaks in LibreOffice as we added text to the rulebook (polishing or adding examples) would have been a lot less of a pain with various LaTeX "samepage" directives.

If you are comfortable writing HTML by hand, then LaTeX is more of a dialect than a new language. It also has the plus that it is highly portable- stuff I wrote back in the mid 90s still works (sometimes there are nudges about using obsolete stuff or having to hunt down deprecated packages) and I can write on UNIX, Linux, Windows, or MacOS. It also plays nicely for those with a software development on UNIX/Linux background as you can use many of the same tools (makefiles, cpp, version control tool of choice, etc.) to increase productivity.

Disclaimer- when I started using version control, CVS was the state of the art (but not commonly installed, so I used RCS which was) and git wouldn't be out for a decade.

Generally speaking, LaTeX does a pretty good job of putting images (including charts/tables) where they belong in the text (you can use various directives to tell it if they need to be "right here" vs. "about here"). I've never seen it do resizing, but that isn't something I've had to do in general so I could be wrong there.

Lamport's "LaTeX: A Document Preparation System" is considered the reference book for most folks, but it may not cover everything (my library has several other LaTeX books as I found Lamport's book didn't cover what I wanted to do or didn't cover it clearly).

Vladar

Quote from: GeekyBugle on April 28, 2023, 10:32:11 PM
I have one immediate question tho: Which one is the OSR template?
It would be https://www.ctan.org/pkg/rpg-module that I've linked in the post.

Quote from: GeekyBugle on April 28, 2023, 10:32:11 PM
Do you plan on covering image positioning/resizing?

Yes, my current planned topics include fonts, figures/images, tables, hyperlinking, and databases.

I'm also open to requests and suggestions regarding the topics you want to see covered.
Into the Dungeon: Revived — a lightweight fantasy-themed role-playing ruleset designed for a streamlined gameplay.
My blog

Eirikrautha

Quote from: Vladar on April 29, 2023, 07:36:28 AM
Quote from: GeekyBugle on April 28, 2023, 10:32:11 PM
I have one immediate question tho: Which one is the OSR template?
It would be https://www.ctan.org/pkg/rpg-module that I've linked in the post.

Quote from: GeekyBugle on April 28, 2023, 10:32:11 PM
Do you plan on covering image positioning/resizing?

Yes, my current planned topics include fonts, figures/images, tables, hyperlinking, and databases.

I'm also open to requests and suggestions regarding the topics you want to see covered.

Some things that would be helpful to me:

  • so you have a latex parser installed, how do you create a basic document
  • formating and creating heading groups
  • backgrounds and text over images
"Testosterone levels vary widely among women, just like other secondary sex characteristics like breast size or body hair. If you eliminate anyone with elevated testosterone, it's like eliminating athletes because their boobs aren't big enough or because they're too hairy." -- jhkim

Howard

Quote from: Eirikrautha on April 29, 2023, 10:46:00 AM

Some things that would be helpful to me:

  • so you have a latex parser installed, how do you create a basic document

This one is easy. You use your text editor of choice. TeX (several steps deeper under the hood) and LaTeX (what you are typically writing in and built on top of TeX) files use a "tex" file extension (not "txt"). The blog link provides a sample file (and its corresponding style (.sty) file). Save the file as text. Most LaTeX distros use the "latex" command to process the text file (may have to run it several times if you are doing complex things where there are page references, bibliographies, etc.). This results in a .dvi file (example.dvi in our case). [LaTeX dates back to when there were phototypesetters and PDF/postscript were either very rare or hand't been invented yet.]. You then run another command to turn the dvi file into poscript and/or PDF.

There are WYSIWGY LaTeX editors that do all the latex/pdf/ps processing under the hood for you (I'm old school, so I know of them but I don't use them).

I'd typically do something like this at a DOS prompt (Linux terminal for me, but the commands should be the same):
latex example.tex
latex example.tex
dvips -o example.ps example.dvi
dvipdf -o example.pdf example.dvi

The main problem with LaTeX, which WYSIWGY editors may solve, is if you bungle the markup the errors are... unhelpful. They basically tell you there is something around line XX of your file that you fat fingered, but nothing more (and if you use "special" characters like \, $, or % that are markup characters without escaping them properly you'll get one of those puzzling errors). On the flip side, LaTeX has been around so long that there are tons of web pages with examples of how to do things (usually 5-6 slightly different ones)- lists (including numbering vs. bullet, different bullet styles, ...), font size/type switching, incorporating tiff/eps/... files, etc. Most of the examples are in the same style as Vladar uses- the example's output and its matching source files are embedded in the web page. This means once you figure out how to read one such page, all the others are trivial to understand.

Vladar

https://vladar.bearblog.dev/latex-document-structure/

Today we will cover the basic concepts of the LaTeX document structure you'll need to know when creating a book from scratch.
Into the Dungeon: Revived — a lightweight fantasy-themed role-playing ruleset designed for a streamlined gameplay.
My blog

Vladar

Quote from: Eirikrautha on April 29, 2023, 10:46:00 AM
Some things that would be helpful to me:

  • so you have a latex parser installed, how do you create a basic document
  • formating and creating heading groups
  • backgrounds and text over images

I've covered the basics of the first one in today's post. For a beginner, I would recommend to use some user-friendly LaTeX editor (I use TeXstudio, for example). And if you want to dive deeper, Howard's post above is excellent.

Other two topics will surely be covered in the future.
Into the Dungeon: Revived — a lightweight fantasy-themed role-playing ruleset designed for a streamlined gameplay.
My blog

Eirikrautha

Quote from: Vladar on April 29, 2023, 02:13:12 PM
Quote from: Eirikrautha on April 29, 2023, 10:46:00 AM
Some things that would be helpful to me:

  • so you have a latex parser installed, how do you create a basic document
  • formating and creating heading groups
  • backgrounds and text over images

I've covered the basics of the first one in today's post. For a beginner, I would recommend to use some user-friendly LaTeX editor (I use TeXstudio, for example). And if you want to dive deeper, Howard's post above is excellent.

Other two topics will surely be covered in the future.

Thanks!  I had already installed texstudio previously, so this will help me get up and rolling...
"Testosterone levels vary widely among women, just like other secondary sex characteristics like breast size or body hair. If you eliminate anyone with elevated testosterone, it's like eliminating athletes because their boobs aren't big enough or because they're too hairy." -- jhkim

GeekyBugle

Quote from: Howard on April 29, 2023, 05:09:10 AM
Quote from: GeekyBugle on April 28, 2023, 10:32:11 PM
Neat! My boy is using LaTex for his university assignments, has insisted it's easier than using LibreOffice for my purposes, I have one immediate question tho: Which one is the OSR template?

Do you plan on covering image positioning/resizing?

Having written a Master's Thesis (with footnotes, cross references, charts, & tables) in LaTeX as well as gaming stuff (wargaming) with LibreOffice (charts, tables, no footnotes, manually generated cross references), it is a coin toss. If you do documents that you are the primary/only editor of, then LaTeX can be a major plus as you don't end up spending time (bleep)ing around with formatting and reformatting if you add some text near the start of a section (cross references update themselves if you reorder rules...). If you have multiple document editors and they aren't LaTeX fluent, it may be the wrong tool for the job.

I guarantee that the hours I spent removing/adding column breaks and line breaks in LibreOffice as we added text to the rulebook (polishing or adding examples) would have been a lot less of a pain with various LaTeX "samepage" directives.

If you are comfortable writing HTML by hand, then LaTeX is more of a dialect than a new language. It also has the plus that it is highly portable- stuff I wrote back in the mid 90s still works (sometimes there are nudges about using obsolete stuff or having to hunt down deprecated packages) and I can write on UNIX, Linux, Windows, or MacOS. It also plays nicely for those with a software development on UNIX/Linux background as you can use many of the same tools (makefiles, cpp, version control tool of choice, etc.) to increase productivity.

Disclaimer- when I started using version control, CVS was the state of the art (but not commonly installed, so I used RCS which was) and git wouldn't be out for a decade.

Generally speaking, LaTeX does a pretty good job of putting images (including charts/tables) where they belong in the text (you can use various directives to tell it if they need to be "right here" vs. "about here"). I've never seen it do resizing, but that isn't something I've had to do in general so I could be wrong there.

Lamport's "LaTeX: A Document Preparation System" is considered the reference book for most folks, but it may not cover everything (my library has several other LaTeX books as I found Lamport's book didn't cover what I wanted to do or didn't cover it clearly).

Here's the thing, I'm not fluent on HTML, I wouldn't even know where to start.

I'm semi-competent with LibreOffice (still haven't figured how to have the index pages be I, II, III, IV, etc), I know how to position resize images, how to create and modify tables and how to create an index...

I shudder to think of building a table index, monster listings by HD/CL and other stuff by hand (I don't know if LibreOffice can do it).

But LibreOffice has definite advantages, grammar checking for instance.

Now, IF I can figure out my way around LaTex fast and deep enough for my needs then it seems to be a solution, after all I can use LibreOffice at the start of the work flow and then switch to LaTex.
Quote from: Rhedyn

Here is why this forum tends to be so stupid. Many people here think Joe Biden is "The Left", when he is actually Far Right and every US republican is just an idiot.

"During times of universal deceit, telling the truth becomes a revolutionary act."

― George Orwell

GeekyBugle

Okay, I might have found A solution:

LyX, is a WYSIWYG editor, so I MIGHT (installing it from the repos as I write this) be able to do what I already know how to do as usual and then switch to LaTex to generate the other stuff... We'll see.
Quote from: Rhedyn

Here is why this forum tends to be so stupid. Many people here think Joe Biden is "The Left", when he is actually Far Right and every US republican is just an idiot.

"During times of universal deceit, telling the truth becomes a revolutionary act."

― George Orwell

Howard

Quote from: GeekyBugle on May 02, 2023, 12:56:19 AM

Here's the thing, I'm not fluent on HTML, I wouldn't even know where to start.

In theory the What You See is What You Get (WYSIWYG) LaTeX editors will solve this for you (and sidestep the unhelpful errors that I mentioned).  I can't confirm this as I don't use them.

The quote and /quote stuff you get when composing messages here (and some other features) are the tagging stuff that LaTeX and HTML use (different token to designate that you are doing formatting instead of text, but the same concept).

With LaTeX the online examples are usually close enough to what you want to do that you can copy/paste the formatting and then tweak (as in "I want green, not blue" or "I want 'large' instead of 'Large' (in some cases these are different sizes in LaTeX)).

Quote from: GeekyBugle on May 02, 2023, 12:56:19 AM

I'm semi-competent with LibreOffice (still haven't figured how to have the index pages be I, II, III, IV, etc), I know how to position resize images, how to create and modify tables and how to create an index...

I shudder to think of building a table index, monster listings by HD/CL and other stuff by hand (I don't know if LibreOffice can do it).

This is where LaTeX (or HTML) can shine- if you can find an example or style file (which is what is being developed here) that is close, you pilfer it and insert your stats into the stat block. Pilfer is perhaps too negative as most folks in the LaTeX community post their bits so that other folks can learn from their work. The CTAN library is a huge collection of TeX and LaTeX extensions (using that concept generally). For what we are doing, the CTAN stuff is probably moot (way too far into the weeds). It is helpful if one does lots of different types of documents and the default stuff with your distro doesn't include that one(s) you wish.

Quote from: GeekyBugle on May 02, 2023, 12:56:19 AM

But LibreOffice has definite advantages, grammar checking for instance.


LibreOffice is a word processing application. LaTeX does typesetting which is a subset of that functionality. However, since the underlying file is text (you can go to a DOS prompt and "type" the file and read it, unlike a .doc file), a stand alone spell checker or grammar checker can do that task (some of the editors may support this as well). In the UNIX (including Linux) world, many of the spell checkers are tex aware and silently ignore the markup tags. A quick web search turns up results for Windows spell checkers that are LaTeX aware, so you are probably covered there if the extra steps are not a deal breaker (I work in the Linux and UNIX worlds, even on my home computer, thus the lack of useful Windows advice).

At the risk of going off topic- the UNIX world (where TeX and LaTeX were born back in the 80s) strives to have single purpose tools that do their one thing really well and they often have hooks to extend them with additional functionality or ways to chain things together. I thus use a text editor (which may have a mode where it is TeX or HTML aware) to edit my LaTeX documents. The LaTeX commands do the pretty formatting. The various "dvi" commands turn the formatted file into something useful in the modern world (postscript, PDF, HTML, flat text). When some of the dvi to other format commands were deprecated (I'll skip the verbose reason), new ones could be slotted in with minimal pain. Heck, there are 3 or 4 LaTeX distributions I've used over the years (codebase forked or the like). 99.9% of the time I didn't notice (switching from "dvi2ps" to "dvitops" is the typical "change").

GeekyBugle

Quote from: Howard on May 02, 2023, 01:33:22 AM
Quote from: GeekyBugle on May 02, 2023, 12:56:19 AM

Here's the thing, I'm not fluent on HTML, I wouldn't even know where to start.

In theory the What You See is What You Get (WYSIWYG) LaTeX editors will solve this for you (and sidestep the unhelpful errors that I mentioned).  I can't confirm this as I don't use them.

The quote and /quote stuff you get when composing messages here (and some other features) are the tagging stuff that LaTeX and HTML use (different token to designate that you are doing formatting instead of text, but the same concept).

With LaTeX the online examples are usually close enough to what you want to do that you can copy/paste the formatting and then tweak (as in "I want green, not blue" or "I want 'large' instead of 'Large' (in some cases these are different sizes in LaTeX)).

Quote from: GeekyBugle on May 02, 2023, 12:56:19 AM

I'm semi-competent with LibreOffice (still haven't figured how to have the index pages be I, II, III, IV, etc), I know how to position resize images, how to create and modify tables and how to create an index...

I shudder to think of building a table index, monster listings by HD/CL and other stuff by hand (I don't know if LibreOffice can do it).

This is where LaTeX (or HTML) can shine- if you can find an example or style file (which is what is being developed here) that is close, you pilfer it and insert your stats into the stat block. Pilfer is perhaps too negative as most folks in the LaTeX community post their bits so that other folks can learn from their work. The CTAN library is a huge collection of TeX and LaTeX extensions (using that concept generally). For what we are doing, the CTAN stuff is probably moot (way too far into the weeds). It is helpful if one does lots of different types of documents and the default stuff with your distro doesn't include that one(s) you wish.

Quote from: GeekyBugle on May 02, 2023, 12:56:19 AM

But LibreOffice has definite advantages, grammar checking for instance.


LibreOffice is a word processing application. LaTeX does typesetting which is a subset of that functionality. However, since the underlying file is text (you can go to a DOS prompt and "type" the file and read it, unlike a .doc file), a stand alone spell checker or grammar checker can do that task (some of the editors may support this as well). In the UNIX (including Linux) world, many of the spell checkers are tex aware and silently ignore the markup tags. A quick web search turns up results for Windows spell checkers that are LaTeX aware, so you are probably covered there if the extra steps are not a deal breaker (I work in the Linux and UNIX worlds, even on my home computer, thus the lack of useful Windows advice).

At the risk of going off topic- the UNIX world (where TeX and LaTeX were born back in the 80s) strives to have single purpose tools that do their one thing really well and they often have hooks to extend them with additional functionality or ways to chain things together. I thus use a text editor (which may have a mode where it is TeX or HTML aware) to edit my LaTeX documents. The LaTeX commands do the pretty formatting. The various "dvi" commands turn the formatted file into something useful in the modern world (postscript, PDF, HTML, flat text). When some of the dvi to other format commands were deprecated (I'll skip the verbose reason), new ones could be slotted in with minimal pain. Heck, there are 3 or 4 LaTeX distributions I've used over the years (codebase forked or the like). 99.9% of the time I didn't notice (switching from "dvi2ps" to "dvitops" is the typical "change").

Thanks, I found LyX and installed it from the repos.

I haven't used Windows in over 20 years, so I wouldn't know what to do with Windows tips :)
Quote from: Rhedyn

Here is why this forum tends to be so stupid. Many people here think Joe Biden is "The Left", when he is actually Far Right and every US republican is just an idiot.

"During times of universal deceit, telling the truth becomes a revolutionary act."

― George Orwell

Vladar

Regarding spell checking, TeXstudio, for example, is configured to use LibreOffice spell checking dictionaries out of the box (hunspell packages, IIRC).
Into the Dungeon: Revived — a lightweight fantasy-themed role-playing ruleset designed for a streamlined gameplay.
My blog