latex

recent posts related to LaTeX

Unix/Linux code to test whether “today” is a weekend day (or weekday) alvin January 27, 2018 - 7:40am

If you ever need an example of a Unix/Linux shell script where you need to determine whether today is a weekend day, I can confirm that this code works:

All fonts available with XeTex and XeLaTeX

To generate a list of all fonts available available with XeTex and XeLaTeX, use this command at your Unix command line:

fc-list : family

I found that command at this tex.stackexchange.com URL.

That command may also work with Windows, but I don’t have a Windows system to test with. Note that it took a little while to run the first time, then it returns almost instantly after that.

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

LaTeX - Simple referencing is another reason to use LaTeX for requirements specifications

I've written a lot of use case documents lately for software requirements specifications, and as use cases get more complex, I find the need for "sub use cases" or "alternate scenarios". When referring to these from the main use case (or anywhere else), it's nice to be able to use LaTeX's reference capability.

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

Get the LaTeX chapter name and section name on the document header

Wow, this was a tough LaTeX problem, and it would really help if I knew a lot more about LaTeX.

My goal for a LaTeX PDF that I created recently was to get the header of my pages to look something like this:

Section Name (Chapter Name)

where "Section Name" and "Chapter Name" are left-aligned in the header of the page, and would be dynamically replaced by the actual values of the current section and chapter names, respetively.

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

LaTeX soul - How to highlight text in a LaTeX document

Summary: Use the LaTeX soul package to highlight text in a LaTeX document.

Suppose you want to provide a highlight color or background color for text in a LaTeX document. A good example is when you want to highlight the background yellow, so it looks like it was highlighted with a marker, to catch a reader's attention. "How do you do this in LaTeX?" you ask.

Normally I like to answer "simple", but in this case there is a multi-step answer. It's still pretty easy, but you'll need to download a package named "soul".

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

LaTeX examples: How to reference a figure or table

LaTeX table/figure FAQ - How do I reference a table or figure in a LaTeX document?

Being able to automatically reference a figure within a LaTeX document is a very cool thing. This referencing capability lets you easily give readers the exact number of a figure, or tell them what page number a figure is located on with the use of a few simple commands (\label, \ref, and \pageref). The same technique works for referencing other objects within a LaTeX document, including tables and equations.

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

LaTeX line break - How to prevent line breaks in LaTeX documents

LaTeX FAQ: How can I prevent line breaks from occurring in my LaTeX documents?

Another nice thing about LaTeX is that you can prevent line breaks between words that should not be broken, things like people's names. To prevent a line break from occurring, use the tilde character (~) instead of a space, like this:

Mr.~John~Doe

This keeps "Mr. John Doe" on the same line when your document is created.

 

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

LaTeX - What kinds of dashes and hyphens are available with LaTeX?

LaTeX FAQ: What kinds of dashes and hyphens are available with LaTeX?

There are three types of dashes you can create with LaTeX:

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

LaTeX example - How to create margin notes with LaTeX

The ability to create notes in the margin (also referred to as "margin notes" or "marginal notes") is a really nice/cool feature in LaTeX. In the words of Edward Tufte, it lets you keep your notes near your content, which is a good thing.

Creating the margin notes themselves is very easy. Here's how to create a margin note with the LaTeX \marginpar command:

\marginpar{This note will appear in the margin.}

 

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.