Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [calc]

The tag has no usage guidance.

6
votes
2answers
105 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} \...
1
vote
0answers
13 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....
1
vote
2answers
70 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....
1
vote
1answer
18 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 ...
4
votes
2answers
53 views

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

I am trying to declare a newcommand \newcommand{\seq}[3]{#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 ...
2
votes
1answer
97 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 ...
7
votes
2answers
228 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 ...
1
vote
0answers
53 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=...
3
votes
1answer
94 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.\ }...
2
votes
1answer
45 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 ...
7
votes
1answer
114 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 ...
5
votes
2answers
443 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,...
5
votes
1answer
108 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{...
1
vote
1answer
39 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{...
2
votes
1answer
85 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} \...
8
votes
3answers
251 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 ...
5
votes
1answer
258 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 ...
2
votes
2answers
147 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 ...
0
votes
1answer
146 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 ...
8
votes
1answer
162 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}...
4
votes
2answers
192 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 ...
3
votes
1answer
56 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 ...
1
vote
1answer
45 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{...
2
votes
1answer
46 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} \...
1
vote
1answer
119 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 ...
5
votes
2answers
451 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]{...
1
vote
1answer
151 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 ]{...
2
votes
1answer
284 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 \...
1
vote
1answer
167 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{\...
1
vote
1answer
377 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} ...
5
votes
1answer
90 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{...
0
votes
0answers
73 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 ...
3
votes
3answers
281 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 ...
1
vote
0answers
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} \...
0
votes
2answers
791 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}[1]{ \...
7
votes
1answer
525 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 ...
1
vote
1answer
460 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 ...
1
vote
1answer
89 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 ...
2
votes
2answers
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 ...
4
votes
2answers
98 views

Label not typeset in specified location

I have two concentric circles centered at O drawn. I specify that the radius of the smaller circle is 1. The radius of the bigger circle is determined so that an inscribed angle LMN has measure 20 ...
3
votes
1answer
164 views

TikZ calc doesn't accept coordinates defined in a \newcommand like (x,y) (with parenteses)

I've defined a new command like \newcommand{\with}{(1,1)} because I'd like to make a tikzpicture with a "parametrical" starting point and built all the other coordinates from there. But if it this ...