Tag Info

New answers tagged

6

This is what enlargelimits or enlarge x limits is for. If you set enlarge x limits=0.3, the axis limits will be increased by 30 % of the data range: \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \begin{filecontents}{table_1.txt} x y 1 1 2 2 \end{filecontents} \begin{filecontents}{table_2.txt} x y 1 2 2 1 ...


1

My solution based on the first answer looks like: \documentclass{article} \usepackage{pgfmath} \usepackage{progressbar} \usepackage{totcount} \newcommand{\tutprogress}{% \stepcounter{tutpageCounter} \pgfmathsetmacro{\ratio}{\value{tutpageCounter}/\totvalue{tutpageCounter}} \progressbar{\ratio} } \begin{document} \progressbarchange ...


1

Package progessbar uses packages calc's \real which accepts only a decimal number, not a ratio. Package calc provides \ratio but unfortunately it seems \real{\ratio{\lenA}{\lenB}} is not legal syntax. Hence, in despair, you may use: \makeatletter \expandafter\progressbar\expandafter {\strip@pt \dimexpr \value{y}pt/\value{total}\relax} \makeatother This ...


3

Counters (and the math that used to manipulate them) use only integers, so you could never end up with \progressbar{.7}. progressbar.sty uses TikZ, so you can do something like this: \documentclass{article} \usepackage{progressbar} \def\total{30} \newlength{\basicwidth} \setlength{\basicwidth}{5in} \newcommand{\pbar}[1]{% ...


0

Grab Value of Page Counter After being disappointed that this similar question was marked as a duplicate, I sought out and found a solution that fits my situation. My answer is more fitting to the other question, but I will leave it here, because I cannot add an answer to a question marked as "duplicate". Another route that does not involve references is ...


2

Thanks to all who commented, here is my summary of the problem evolution and solution: I was mistaken in interpreting the unexpanded \gls*{} entries as a numerical parse problem. Thanks to @ChristianHupfer I can use \glsentryname{} to grab the expanded definition. Thanks to @NicolaTalbot Now that I am using an expanded variable correctly, there isn't ...


0

The canvas ... at uses the internal \pgfpointxyz. The latter function just takes numbers not dimensions; \pgfpointxyz{a}{b}{c} gives a times the x-vector plus b times the y-vector plus c times the z-vector. In particular the units are ignored (rather than throwing an error). If you write canvas is yz plane at x=120.0 you get the same result. You ...


2

Either use the \label-\ref system if you're stepping myCounter via \refstepcounter system, or manually calculate it via \numexpr: \documentclass{article} \newcounter{myCounter} \begin{document} \setcounter{myCounter}{5} \verb|\themyCounter: | \themyCounter \verb|\arabic{myCounter}:| \arabic{myCounter} \bigskip ...


1

In ISO, as mentioned in comment, whether a week is the first or 53rd depends on its Thursday. Or equivalently, whether the week has more days on the new year or the old year. To calculate this in a mathematical manner, one considers the Round() function satisfying Round(n+0.4)=n, and Round(n+0.6)=n+1. And then do some calculation like b := Round(a/7) ...


4

Did I understand correctly? \documentclass[border=5mm,tikz]{standalone} \usetikzlibrary{calc} \usepackage{lipsum} \begin{document} \begin{tikzpicture} \foreach\j in {1,10,100}{ \node[outer sep=0] (a-\j) at (0,{-7*log10(\j)}) {\j}; \path let \p1=($(a-\j.east)-(a-\j.west)$) in node[anchor=west,text width=\textwidth-\x1] (b-\j) at (a-\j.east) ...



Top 50 recent answers are included