The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [calc]

The tag has no usage guidance.

45 questions
Filter by
Sorted by
Tagged with
64 views

Can tikz projections be computed in three dimensions?

According to the pgf manual, the syntax <coordinate>!<projection coordinate!<angle>:<second coordinate> can be used to project <projection coordinate> orthogonally onto ...
50 views

Tikz: Calculations with coordinates

Inspired by the question How to draw a line passing through a point and parallel to another? I'm trying to do some arithmetic with coordinates. The code below does not work, but I hope that with a ...
136 views

Climate flow chart

I am trying to draw the following "flowchart" After some fiddling I was able to come up with the following solution What I am struggling with mainly boils down to two things How can I align the ...
38 views

calculate the title height and if the title height is above some number then add some space

calculate the title height and if the title height is above some number then add some space. when I use the code get the title, but when I use code like this \settoheight{\heightoftitle}{\vbox{\...
150 views

Relationship between strut and baselineskip

Here, it is said that a strut is defined as: \rule[-.3\baselineskip]{0pt}{\baselineskip} However, if I do: \newlength{\strutheight} \settoheight{\strutheight}{\strut}\printlength{\strutheight} \...
17 views

Set an option to a custom environment to change width of a setheight

I'm tuning the code @CarLaTeX proposed in this topic to separate teacher version and student version. The goal is when the boolean is true (student version), a blank line takes the place of the stuff....
80 views

Basic TikZ “Missing number” error when using asin to calculate the end angle of arc

I am new to plotting in TikZ and has come across the "Missing number error" in the following example on the line marked by %(**), \documentclass{book} \usepackage{tikz} \usetikzlibrary{calc,shapes....
22 views

Using zref return value as input for counter

I am trying to create a new counter, which is counting the page numbers to store them and reuse them later. I always remove the 3 pages, which are not numbered at the beginning of the document and I ...
109 views

How to evaluate an expression and use the result in newcommand?

I am trying to declare a newcommand \newcommand{\seq}{#1_#2, #1_{#2 + 1} \cdots ,#1_#3} What I want is basically to print the sequence $v_0, v_1, \cdots, v_N$ by calling \seq{v}{0}{N} but it is ...
110 views

Riemann Sum approaches Area under Curve

I am trying to write a program where I can change the number of subintervals, n( using \def\n\some number), and the output show that specific number of rectangles in the Riemann Sum. An animation ...
407 views

Call for node distance as a variable in TikZ

Is it possible to use the node distance as a variable while expressing coordinates of new nodes with Calc and Positioning libraries? What I want to have is everything within a single piece of code for ...
61 views

Problems with enumitem and calc

Below is a MWE with the calc and enumitem packages: \documentclass{report} \usepackage{enumitem} \usepackage{calc} \begin{document} \chapter{Title} \section{Section} \begin{enumerate}[labelindent=...
130 views

Problem with \newdimen and \widthof

I have a problem with the following code under TexLive 2018: \documentclass{report} \usepackage{calc} \usepackage[inline]{enumitem} \usepackage{parskip} \newdimen\lblwidth\lblwidth=\widthof{8.88.\ }...
66 views

calc and xassoccnt incompatible?

I'm getting LaTeX warning: Package xassoccnt Warning: Warning: Package "calc" is loaded -- this is not (xassoccnt) recommended for xassoccnt with calc 2017/05/25 v4.3 xassoccnt ...
129 views

Why conflict between mathtools and Gonzalo's solution for auto-adjusting description environment?

Gonzalo Medina provided a nifty solution to "Automatically set description list labelwidth based on widest label?." (The goal was to define a description environment where the item text is ...
474 views

How to define a variable as another variable divided by two?

I would like to define a variable \j in a loop \foreach \i in { 2, 4, 6} and use \j to labels of the nodes. Here is my code: \documentclass{standalone} \usepackage{balance,complexity,pgfplots,tikz,...
129 views

Is there an incompatibility between the packages calc and siunitx? (\GenericError […])

The following code does not compile: \documentclass[11pt]{article} \usepackage{calc} \usepackage{siunitx} \begin{document} \begin{tabular}{p{.5cm}p{\widthof{\textbf{AAAAAAAAA}}}l} &\textbf{...
48 views

Weird behavior when mixing the tikz “let” and “plot” operation

Can anyone explain to me why the output of the following code changes when I remove +\x1 ? \documentclass[tikz]{standalone} \usepackage{tikz} \begin{document} \usetikzlibrary{calc} \begin{...
140 views

tikz - create coordinate with maximum y-value of two other coordinates

I'd like to define a coordinate (Q1) which contains the x-component of a coordinate (P1) and as y-component the maximum y-values of (P1) and (P2). Here's my MWE: \documentclass{standalone} \...
288 views

Combining calc and perpendicular coordinates in tikz

As it is described there, the following does not compile: \documentclass{report} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \node at (0, 0) (node1) {Hello}; \node ...
345 views

Tikz coordinates relative to one node

Using both calc and |- would be a convenient way to refer to "inner, relative coordinates" of a node, with (0, 0) meaning node.center, (0, 1) meaning node.east and (.3, -.5) meaning somewhere precise ...
155 views

Store result of \ratio calculation for repeated use

I am using pdflatex with the beamer package to create a presentation template that is similar to the PowerPoint template provided by my company. I want the company logo to have the same size in my ...
187 views

Error message converting from markdown to PDF, Package calc Error: \let ' invalid at this point

I am trying to convert a R markdown document to PDF. However, it fails to compile and gives me the following error message: ! Package calc Error: \let ' invalid at this point. My document consists ...
170 views

tikz/pgf and \maxof broken since 3.0.1a

The following example works well tikz up to 3.0.0 (TL 2014 and probably 2015), but breaks since tikz 3.0.1a (till now): \documentclass{report} \usepackage{calc} \usepackage{tikz} \usetikzlibrary{calc}...
218 views

Using tikz Calc package to add cordinates

I would like to draw the line shown in the right hand side of the attached figure from Node 3 to the line between Node 1 and Node 2. (Note line with should be same width as all other lines.) I ...
63 views

How align paragraph with labels before resume enumitem list

I have an enumerate list created with enumitem that I interrupt and then resume. Between the last item before the interruption and the first after the resumption, I insert a text paragraph. How can I ...
49 views

Including xifthen package breaks macro expansion in header

In the following MWE, I build a 'database' which I then query later in body text and in headers. It works fine until I load the xifthen package. This is not used in the MWE, but I do use the \isempty{...
63 views

Macro definition with argument within node position calculation does not work

I can't figure out, why the following macro definition \gcmarknode does not work: \documentclass{beamer} \usepackage{tikz} \usepackage{pifont} \newcommand{\cmark}{\ding{51}} \usetikzlibrary{calc} \...
126 views

Personal command incompatible with tikz calc library

I have written a personal command called \compo that allows you to place a figure next to a text: \compo[.4]{ text }{ figure }; When the figure is created with the tikz calc library, there is this ...
552 views

Error in tkz-euclide \tkzDefPoint with square roots

I cannot make sqrt(x) work in \tkzDefPoint; I'm getting the error ! Argument of \XC@definec@lor has an extra } in the following code: \documentclass{scrbook} \usepackage{fontenc} \usepackage[utf8]{...
183 views

Centering the center of two tikz nodes to the center of a page

Consider the following example: \documentclass[twoside, 10pt]{book} \usepackage[ paperwidth=6in, paperheight=9in, tmargin=0.75in, bmargin=0.75in, inner=0.75in, outer=0.75in ]{...
387 views

Calculate inside \setlength

I'm subdividing my page in a number of sections and I want to calculate the width of each section depending of the number. \newlength{\basewidth} \setlength{\basewidth}{\linewidth/5.5} The \...
190 views

Passing a numeric argument through \newcommand or \renewcommand to a calc package command?

Consider the following MnotWE: \documentclass[12pt,letterpaper]{article} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{graphicx} \usepackage{calc} \newcommand{\...
477 views

Multiplying command argument by factor

I am trying to use calc to perform a basic multiplication of arguments of a user-defined command, like this: \def\Verdana#1{ \normalfont \fontsize{#1}{#1 * \real{1.2}} \VerdanaFont \selectfont} ...
96 views

Make a CV auto updating

I would like to create a code to insert in my CV that make it auto update. The hypotetic sentence is this one: "Engineer with twenty experience years", where twenty is generated by, e.g., \startyear{...
77 views

Calc and mathtools : issue

I have an issue when using titlesec with mathttools : l.19 \addtocontents{toc}{\setcounter{tocdepth}{0}} ! Undefined control sequence. Here is an minimal example : Can ...
304 views

Relative coordinates & Calc library

Attached is the code to draw a simple tree. I wish to get the NEGF node to appear in a middle location between the "west" of the \node {Without Illumination}, and "east" of the {Geometric} node. I ...
32 views

Dimension too large for TikZ modulo arithmetic [duplicate]

\documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{ifthen} \usetikzlibrary{calc} \begin{document} \def\sides{50} \pgfmathsetmacro\lmu{\sides -1} \...
934 views

Measuring the height of a box

Solution in Edit 3. It works well, but seems to need an optimization. :) MWE: \documentclass{scrartcl} \usepackage{calc} \usepackage{mathptmx} \usepackage{anyfontsize} \newcommand{\Title}{ \...
627 views

What unit of measurement is \widthof using

For various purposes I need to know the width of a given text. The easiest way to do this is to use the \widthof{} command from the calc package. Issue is that I can't understand what unit of ...
563 views

Many errors given by the calc package

I know that the title is not clear at all; the issue is that I'm trying to use the calc package to compute the value of a certain counter, and I receive two different error messages, according to some ...
105 views

calc-package prevents \headheight to change

I am trying to automize setting the correct \headheight following Heiko Oberdiek's approach. It is based on the fact that the fancyhdr package usually increases the \headheight as required and saves ...
2k views

tikz Error some package has redefined the meaning of the math-mode dollar sign

I am using Tikz code from package-lineno-not-working-well-skips-line-texlive-2016 and everything have been working very well. When I added some verbatim text at the end, now I get this error from ...