How do I find latex source-code? - latex

Does anyone know where I could find the code that LaTeX uses to typeset inside the tabular environment? In the past I have looked in style files but I don't know where to find intrinsic LaTeX commands.

See the PDF file of the LaTeX sources, chapter lttab.dtx.

Related

Confusion on TikZ and PGF LaTeX packages - what they are, how they are stored by MiKTeX, and how they are interpreted by LaTeX compilers

I use VSCode to write LaTeX using the LaTeX-Workshop VSCode extension, MiKTeX, and pdflatex. The LaTeX-Workshop extension comes with the handy feature of being able to hover packages and view their documentation, but I noticed that this feature does not work on the tikz package.
Screenshot with more detail.
I started looking into why this was the case, as the ctan page linked had this long and very detailed manual for TikZ and PGF. It turns out that MiKTeX does not even list a package called TikZ, which is confusing as my .tex files seem to compile fine when including the line \usepackage{tikz}, whereas attempting to use any other 'nonexistent' package would result in a compilation error.
I've gone through half a dozen webpages trying to understand what PGF and TikZ are in more detail, but it is very confusing. The ctan PGF page says "PGF is a macro package for creating graphics... that comes with a user-friendly syntax layer called TikZ", but I'm a little confused about what that means. Why would the package and syntax have different names?
My questions can be summed up as:
What exactly is PGF and TikZ? What's the difference between the two and is there a reason why they have different names?
How does my LaTeX compiler interpret "\usepackage{tikz}" if I don't have a package by that name installed?
What are TikZ libraries and what do lines like "\usetikzlibrary{arrows}" do exactly? Are they basically the same as packages?
If I'm using MiKTeX, where are the TikZ Libraries stored on my machine (Windows 10)? I have been able to find most other packages and their documentation within subfolders of "C:\Users\{USERNAME}\AppData\Local\Programs\MiKTeX 2.9\".
Instructions on how to link the TikZ/PGF manual pdf to MiKTeX so I can easily access the documentation in VSCode would be nice, but that is not really the focus of this post.
For clarification, I am not looking for a tutorial on how to use PGF/TikZ (there are many other good resources for that), nor am I looking for an overly high-level answer like "PGF/TikZ is a LaTeX package for creating graphics" that don't provide any more detail, I know that much already.
Pre-remark:
There are two slightly different usages for the word "package" in the latex world, one is the traditional \usepackage{....} you know from your latex document, the other is the ctan/miktex/texlive package. Most of the time, a ctan/miktex/texlive package simply contains the latex package of the same name, but sometimes it can have a different name and/or contain multiple latex packages at once.
What exactly is PGF and TikZ? What's the difference between the two and is there a reason why they have different names?
pgf provides the low level commands, like strokes etc. and tikz builds on top of this and uses the low level pgf commands to draw more complicate things, like geometrical shapes or rubber ducks (shameless plug)
This division between the low level and high level code is very useful, because it allows the user to load just as much as necessary. Take for example the beamer class. It uses all kinds of low level pgf commands to draw decorations on the slides, so it loads (parts of) the pgf package. It does not need all the fancy stuff from the tikz package, so it does not load it, which safes tons of time, because loading all of tikz is relativity slow.
How does my LaTeX compiler interpret "\usepackage{tikz}" if I don't have a package by that name installed?
You do have it installed, it is contained in the ctan/miktex/texlive pgf package. \usepackage{tikz} basically translates to \input{tikz.sty}. This file in return will load the latex pgf package (and many other things)
What are TikZ libraries and what do lines like "\usetikzlibrary{arrows}" do exactly? Are they basically the same as packages?
yes, they are basically packages for tikz with which you can extend the capabilities of tikz even further.
If I'm using MiKTeX, where are the TikZ Libraries stored on my machine (Windows 10)? I have been able to find most other packages and their documentation within subfolders of "C:\Users\{USERNAME}\AppData\Local\Programs\MiKTeX 2.9\".
You can look this up yourself in your .log file. Search it for tikz.sty and this and the following lines will tell you the location of all the files.
Instructions on how to link the TikZ/PGF manual pdf to MiKTeX so I can easily access the documentation in VSCode would be nice, but that is not really the focus of this post.
If you open a new terminal in vscode (ctrl+shift+`), you can open the user guide by typing texdoc tikz or texdoc pgf (same file, just multiple ways to open it)

plantUML in latex?

Is it possible to use plantUML inside a latex document?
One workaround would be to convert plantUML into tikzpicture and integrate it in the latex document. That seems a bit too much effort to me, especially with updates.
I am using overleaf and TeXiFy, the document generation should work on both latex editors.
If a direct integration is possible, I would like to see an example.
thanks

Strikethrough in MathJax

I am new to MathJax. My software uses MathJax and takes LaTex-like input. I am used to of using Latex commands, like [latex]\frac{2}{3}\times x^2[/latex], but I cant use any of the Latex packages to get my task done. How is strikethrough text done? In Latex it requires use of packages and there is no base command for that. Any help will be appreciated.

About latex formulas in doxygen

Every time I need to copy a latex paragraph and put it in my source code as a doxygen documentation, I need to put a \f next to each $ and do other modifications.
Isn't there an easier way to tell doxygen that this whole paragraph contains only latex and thus should be fully interpreted as latex code?
Thanks in advance.
It appears not to be possible to include LaTeX format .tex files directly. Depending on the complexity of the LaTeX files, a possibility would be to write a script which makes the required modifications. Related questions that give further background and suggestions are How to include LaTeX snippets directly in Doxygen comments and Including LaTeX documentation as comments in source code. Please come back and answer if you find a good solution to this problem.

Making multiple PDFs from 1 TEX file in LaTeX?

I'd like to create multiple documents (output as PDFs after running pdflatex) whose source is from one file.
Example:
\documentclass{article}
\begin{document}
This text will appear in the first PDF.
\end{document}
\begin{document}
This text will appear in the second PDF.
\end{document}
This would be particularly useful because:
I could keep everything in 1 file, with a single, consistent preamble.
I could use ifthen or other loops to automatically generate various alternative forms of a document.
AFAIK this is not possible without some preprocessing of your file, i.e. using a scripting language to produce two separate documents then compiling them separately. Even then I don't think it's a good idea.
The first reason you think this would be useful is handled by putting your preamble in a separate document that is included in as many documents as you want using \include. The second aspect can be handled by using Makefiles and putting the conditional branching to build particular versions of a document in there.
I wrote a really simple preprocessor for LaTeX that embeds Ruby code directly into .tex files for this purpose and use the ERB template engine. Here's the source code on Google Code, if you want to take a look. There's not much to it, though I regularly use it from a Ant/latexmk-based build script and it has proved very useful for generating multiple version of my résumé. It works equally well on Linux/Mac OS X/Windows, assuming you have a working LaTex and Ruby installation.

Resources