Tikz at PF: \begin{tikzpicture} Help

  • Thread starter bob012345
  • Start date
  • Tags
    Work
In summary: TL;DR Summary: To make tikz work, you can use Overleaf or a LaTeX based word processor like LyX, but it may slow down rendering time for the text.
  • #1
bob012345
Gold Member
2,080
912
TL;DR Summary
I cannot see any examples of tikz working.
I have this line;

\begin{tikzpicture} \mobiusstrip{1}{0.5} \end{tikzpicture}

What do I do to make it work? Thanks.
 
Physics news on Phys.org
  • #2
bob012345 said:
TL;DR Summary: I cannot see any examples of tikz working.

I have this line;

\begin{tikzpicture} \mobiusstrip{1}{0.5} \end{tikzpicture}

What do I do to make it work? Thanks.
PF uses MathJax and not LaTeX. So not all libraries are available, and cannot be loaded either.
 
  • Like
Likes bob012345
  • #3
Was it part of the MHB site that was merged?
 
  • #4
IDK. It has been MathJax here since I joined. I have a tex editor running in parallel in case I want to write mathematical stuff that is more than a simple line. I rather copy, paste and finally adjust it than write it here. That means I have all environments that I want available and could copy tikz diagrams via screenshots.
 
  • #5
bob012345 said:
Was it part of the MHB site that was merged?
I believe they had tikz, yes, and posts using it are most likely ones from there.
 
  • #6
bob012345 said:
Was it part of the MHB site that was merged?
fresh_42 said:
IDK. It has been MathJax here since I joined.
MHB had an implementation of LaTeX that allowed tikz to be rendered in the browser:
I like Serena said:
MHB had a dedicated server that converted TikZ code to pictures on the fly.

We don't have that here in PF. You can, however, always render the tikz on your system and post a picture of the result.
 
  • #7
bob012345 said:
TL;DR Summary: I cannot see any examples of tikz working.

I have this line;

\begin{tikzpicture} \mobiusstrip{1}{0.5} \end{tikzpicture}

What do I do to make it work? Thanks.
If all you want is a compiler to make a pdf then I'd suggest looking into Overleaf. Now, I've been using a LaTeX based word processor, LyX,, that also incorporates TikZ, though to save some time I usually use it to generate pdfs as it slows down the rendering time for the text.

-Dan
 
  • Like
Likes bob012345

Related to Tikz at PF: \begin{tikzpicture} Help

1. How do I start using TikZ in LaTeX?

To start using TikZ in LaTeX, you need to include the TikZ package in the preamble of your document by adding \usepackage{tikz}. Then, you can begin a TikZ picture environment with \begin{tikzpicture} and end it with \end{tikzpicture}. Within this environment, you can use various TikZ commands to draw shapes, lines, and other graphical elements.

2. How can I draw a simple line using TikZ?

To draw a simple line in TikZ, you can use the \draw command within a \begin{tikzpicture} environment. For example, \draw (0,0) -- (2,0); will draw a horizontal line from the point (0,0) to the point (2,0).

3. How do I add labels or text to my TikZ drawings?

You can add labels or text to your TikZ drawings using the \node command. For example, \node at (1,1) {Hello}; will place the text "Hello" at the coordinates (1,1). You can also combine text with shapes by adding text within a shape command, such as \draw (1,1) circle (1) node {Circle}; to place the text "Circle" inside a circle.

4. How can I change the color of shapes and lines in TikZ?

In TikZ, you can change the color of shapes and lines using the [color] option in the \draw command. For example, \draw [red] (0,0) -- (2,0); will draw a red line. You can specify different colors by name or use RGB values with the rgb option, like \draw [color={rgb,255:red,128; green,0; blue,0}] (0,0) -- (2,0); for a custom color.

5. How do I create more complex shapes and patterns in TikZ?

For more complex shapes and patterns, you can use a combination of TikZ commands and options. For example, to draw a rectangle with a pattern, you could use \filldraw [pattern=north east lines] (0,0) rectangle (2,1);. TikZ also supports various libraries that extend its capabilities, such as the

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
Back
Top