Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tikz extension: missing documentation #369

Open
pela9 opened this issue Sep 12, 2021 · 6 comments
Open

tikz extension: missing documentation #369

pela9 opened this issue Sep 12, 2021 · 6 comments

Comments

@pela9
Copy link

pela9 commented Sep 12, 2021

Thanks for the tikz extension, works perfectly. I took me however some time to figure out some details in the setup. Some extra documentation will save time for future users.

  1. The preamble option is excellent, but I found no documentation, I had to look in the sources to see how it worked.
  2. The extension adds a small border (2bp) to the generated pictures, which you sometimes don't want (or set differently). This can easily be changed once you understand that the LaTeX document class standalone is used: \standaloneconfig{border=0pt}. But again I had to read the ruby sources to figure this out. (Maybe this can also be a diagram option.)
  3. For some tikz extension libraries, e.g. graphdrawing, lualatex is required instead of pdflatex. I solved this simply by setting -a pdlflatex=/bin/lualatex. This also seems worthwhile to document.
@pepijnve
Copy link
Member

Thanks for providing this feedback regarding the documentation. I've been thinking about restructuring the documentation to have a short generic section followed by a section per diagram type. That would provide an excellent place to put diagram type specific details like what you're describing above. I'll make sure to keep your questions in mind when I get around to the documentation rework.

@edward-encoord
Copy link

Thanks for the tips on how to use preamble, but I cannot make it work.

I added :tikz-preamble: \input{path/to/preamble.tex}. I'm wondering if you can give more tips.

@edward-encoord
Copy link

edward-encoord commented Mar 22, 2022

I found some tips in the change log. I know how to add preamble now.

@pela9
Copy link
Author

pela9 commented Mar 22, 2022

As I have understood it, the preamble attribute is instead a Boolean flag which, if true, allows to separate LaTeX stuff for the internal preamble of the generated LaTeX file and the tikz picture using ~~~~ , for example:

[tikz, TikzTest3, pdf, preamble=true, width=30%]
....
\usetikzlibrary{shapes.multipart}
~~~~
\begin{tikzpicture}
\node [circle split,draw,double,fill=red!20]{Upper \nodepart{lower} Lower};
\end{tikzpicture}
....

@edward-encoord
Copy link

@pela9 Thanks for the quick reply. This is very helpful.

To include your example as PDF works, but if I try to include as SVG, it's like this:

image

If I convert the generated diagram PDF using pdf2svg manually, the SVG works. So I guess there is something wrong with my AsciiDoctor PDF settings.

So far, I'm using the font settings in the default AsciiDoctor PDF theme:

font:
  catalog:
    # Noto Serif supports Latin, Latin-1 Supplement, Latin Extended-A, Greek, Cyrillic, Vietnamese & an assortment of symbols
    Noto Serif:
      normal: GEM_FONTS_DIR/notoserif-regular-subset.ttf
      bold: GEM_FONTS_DIR/notoserif-bold-subset.ttf
      italic: GEM_FONTS_DIR/notoserif-italic-subset.ttf
      bold_italic: GEM_FONTS_DIR/notoserif-bold_italic-subset.ttf
    # M+ 1mn supports ASCII and the circled numbers used for conums
    M+ 1mn:
      normal: GEM_FONTS_DIR/mplus1mn-regular-subset.ttf
      bold: GEM_FONTS_DIR/mplus1mn-bold-subset.ttf
      italic: GEM_FONTS_DIR/mplus1mn-italic-subset.ttf
      bold_italic: GEM_FONTS_DIR/mplus1mn-bold_italic-subset.ttf

I don't have experience with the font settings so far, so I'm working on it.

@edward-encoord
Copy link

@pela9 I just render the same file in Linux. The text inside tikz diagrams works now :-) So I guess it's because I was using Windows.

pepijnve added a commit that referenced this issue Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants