I have occasionally seen lines of code that appear to catch errors and then the program alters the situation to deal with it, rather that let the error shut the code down.
Trouble is, when I search for where I saw it, I get just about every language but TikZ.
As a quick example of what I am trying ...
Search found 71 matches
- Mon Oct 02, 2023 10:12 pm
- Forum: LaTeX Beginner's Guide
- Topic: Catching error messages
- Replies: 0
- Views: 43440
- Mon Sep 18, 2023 11:43 am
- Forum: Graphics, Figures & Tables
- Topic: Is there a way to "trace" a path and define a coordinate?
- Replies: 6
- Views: 10196
Is there a way to "trace" a path and define a coordinate?
OMG! I was able to use that to not only eliminate the 14 path intersections I was taking, but I was also able to collapse some two pages of code into 10 lines. And not only is the code more efficient, it runs much much faster.
Thank you again!
-Dan
Just for the record:
\documentclass{article ...
Thank you again!
-Dan
Just for the record:
\documentclass{article ...
- Mon Sep 18, 2023 11:26 am
- Forum: Graphics, Figures & Tables
- Topic: Is there a way to "trace" a path and define a coordinate?
- Replies: 6
- Views: 10196
Is there a way to "trace" a path and define a coordinate?
Hi Dan,
I tried
\coordinate[at end] (A) (0,0) arc(0:90:2);
well, \coordinate is basically a node without a size of its own, hence the arc will be put into nothing, so to speak.
For getting points along the arc (or whatever curve you have), you can use options like `at start', `near end', etc ...
I tried
\coordinate[at end] (A) (0,0) arc(0:90:2);
well, \coordinate is basically a node without a size of its own, hence the arc will be put into nothing, so to speak.
For getting points along the arc (or whatever curve you have), you can use options like `at start', `near end', etc ...
- Sun Sep 17, 2023 8:03 pm
- Forum: Graphics, Figures & Tables
- Topic: Is there a way to "trace" a path and define a coordinate?
- Replies: 6
- Views: 10196
Is there a way to "trace" a path and define a coordinate?
Yes, you can achieve this in TikZ by using the calc library to calculate the positions of points along the specified paths without explicitly solving the equations. Here's how you can define the coordinate (B) based on your description:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary ...
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary ...
- Sun Sep 17, 2023 7:59 pm
- Forum: Graphics, Figures & Tables
- Topic: Is there a way to "trace" a path and define a coordinate?
- Replies: 6
- Views: 10196
Is there a way to "trace" a path and define a coordinate?
Hi Dan,
you could put coordinate[at end, ...] in the path, or use \pgfpointlineattime from Points Traveling along Lines and Curves .
Stefan
Thank you. I had seen the PGF/TikZ package section, but as I might be using irregular paths, this isn't going to work that well.
I tried
\coordinate[at end ...
you could put coordinate[at end, ...] in the path, or use \pgfpointlineattime from Points Traveling along Lines and Curves .
Stefan
Thank you. I had seen the PGF/TikZ package section, but as I might be using irregular paths, this isn't going to work that well.
I tried
\coordinate[at end ...
- Fri Sep 15, 2023 2:22 am
- Forum: Graphics, Figures & Tables
- Topic: Is there a way to "trace" a path and define a coordinate?
- Replies: 6
- Views: 10196
Is there a way to "trace" a path and define a coordinate?
I've been wondering this for a while, and I haven't found anything so I figured it wasn't possible.
But why not ask anyway, just to be sure?
I have a rather complicated set of equations that is bogging down even Mathematica. But, you know, if I could just start at a point, move down this path ...
But why not ask anyway, just to be sure?
I have a rather complicated set of equations that is bogging down even Mathematica. But, you know, if I could just start at a point, move down this path ...
- Fri Sep 08, 2023 2:01 am
- Forum: Graphics, Figures & Tables
- Topic: How to define the center of rotation?
- Replies: 1
- Views: 7867
How to define the center of rotation?
Okay, I found a solution. The command rotate will latch onto the point in the draw command, in this case the point (1). Not only do I need to rotate the diagram (which is already happening), I also need to rotate the point (1), which is "static" in TikZ as it is a named coordinate. To fix this, I ...
- Tue Sep 05, 2023 1:20 pm
- Forum: Graphics, Figures & Tables
- Topic: How to define the center of rotation?
- Replies: 1
- Views: 7867
How to define the center of rotation?
The code is overcomplicated for the question, but I left it to make sure that I'm getting the error "correct."
I've uploading the picture I'm trying to replicate. (It's the one at the top left.) The code I'm posting below can sketch all 7 curves, but I've limited the loop to only sketch the inner ...
I've uploading the picture I'm trying to replicate. (It's the one at the top left.) The code I'm posting below can sketch all 7 curves, but I've limited the loop to only sketch the inner ...
- Sun Sep 03, 2023 2:34 am
- Forum: Graphics, Figures & Tables
- Topic: foreach loop vs. no foreach loop
- Replies: 4
- Views: 18569
foreach loop vs. no foreach loop
I can do that simply with
\global\let\r=\r
without any iterative definition problems?
Yes. Unlike \def (or \[re]newcommand), \let creates a copy of what's on the right side of the (optional) equal sign.
Come to think of it, you might as well use
\xdef\r{\r}
which expands {\r} before it gets ...
- Sat Sep 02, 2023 8:31 pm
- Forum: Graphics, Figures & Tables
- Topic: foreach loop vs. no foreach loop
- Replies: 4
- Views: 18569
foreach loop vs. no foreach loop
Once it's explained, that makes a lot of sense, and I should have foreseen the problem.
I'm interested in the \let statement... In order to redefine a variable value I've been writing
\pgfmathsetmacro{\temp}{\r}
\gdef\r{\temp}
I can do that simply with
\global\let\r=\r
without any iterative ...
I'm interested in the \let statement... In order to redefine a variable value I've been writing
\pgfmathsetmacro{\temp}{\r}
\gdef\r{\temp}
I can do that simply with
\global\let\r=\r
without any iterative ...