Search found 419 matches

by rais
Tue Aug 22, 2023 11:41 pm
Forum: Page Layout
Topic: how to create a different header for all pages after the first
Replies: 1
Views: 67397

how to create a different header for all pages after the first

no, \thispagestyle only affects the page it's called on. Use \pagestyle, instead.

You don't even need the afterpage package for that, just declare

Code: Select all

\pagestyle{otherpages}
% before your call
\thispagestyle{firstpage}
KR
Rainer
by rais
Tue Aug 22, 2023 11:12 pm
Forum: LaTeX Beginner's Guide
Topic: ifthenelse
Replies: 13
Views: 178756

ifthenelse

Hi Dan,

But why does this not work if I use \pgfmathsetmacro{\q}{...}?

\ifthenelse isn't fully expandable which may throw off \pgfmathsetmacro 's parser of its second argument.
A somewhat more archaic approach (using TeX if.. constructs) works in this case, too:

\documentclass{article ...
by rais
Sun Aug 20, 2023 1:40 pm
Forum: LaTeX Beginner's Guide
Topic: Points to cm
Replies: 3
Views: 38990

Points to cm

Yes, a point is the smallest typographic unit of measure.
The ratio of 72.27 pt to 1 in is what (La)TeX uses to adhere to the American Point System, AFAIK.
Perhaps I should've asked you where your pt is coming from :roll:
A PostScript point would be 1/72 of an inch, which is 1 bp (big point) in (La ...
by rais
Sat Aug 19, 2023 10:25 pm
Forum: AUCTeX
Topic: \RenewCommandCopy raises "Undefined control sequence" error
Replies: 6
Views: 55260

\RenewCommandCopy raises "Undefined control sequence" error

You're using a pre-packaged version of TeX Live.
Either update your Linux installation or install the current TeX Live yourself, in which case you may need to convince your Linux package manager that LaTeX is installed to satisfy package dependencies, see https://tug.org/texlive/debian.html#vanilla ...
by rais
Sat Aug 19, 2023 10:00 pm
Forum: Graphics, Figures & Tables
Topic: newcommand or something else?
Replies: 5
Views: 13818

newcommand or something else?

Perhaps a scope is what you need:

\documentclass{article}
\usepackage{tikz}

\newif\ifplotfirstpoint

\tikzset{%
plotfirstpoint/.code={\plotfirstpointtrue},
dontplotfirstpoint/.code={\plotfirstpointfalse} %just in case you need the opposite as well
}

\newcommand*\drawarrow[3][->]{% note the ...
by rais
Sat Aug 19, 2023 9:57 pm
Forum: LaTeX Beginner's Guide
Topic: Points to cm
Replies: 3
Views: 38990

Points to cm

1 in = 2.54 cm = 72.27 pt

KR
Rainer
by rais
Tue Aug 15, 2023 9:00 pm
Forum: General
Topic: \newcommand with listings as parameter
Replies: 4
Views: 11742

\newcommand with listings as parameter

Have you considered using an environment instead of a command? You could put a listing into another environment, even if it has arguments of its own:

\documentclass[a4paper]{article}

\usepackage{listings} % include listings to print source code in LaTeX

\lstnewenvironment{MyCode}{% Define a new ...
by rais
Tue Aug 15, 2023 8:26 pm
Forum: Graphics, Figures & Tables
Topic: newcommand or something else?
Replies: 5
Views: 13818

newcommand or something else?

Sounds more like `basics' ;)
The first argument can be made optional like this:

\documentclass{article}
\usepackage{tikz}

\begin{document}

\newcommand\drawarrow[3][]{% note the second pair of brackets
\draw[#1] (#2) -- (#3)
}

\begin{tikzpicture}
\drawarrow{0,0}{1,1};
\drawarrow[->]{0,0}{1 ...
by rais
Mon Aug 14, 2023 8:12 pm
Forum: AUCTeX
Topic: \RenewCommandCopy raises "Undefined control sequence" error
Replies: 6
Views: 55260

\RenewCommandCopy raises "Undefined control sequence" error


This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2023.6.2) 14 AUG 2023 12:07

That explains it, then: \RenewCommandCopy and friends were introduced to the LaTeX Kernel around Oct 20, for which you'd need TeX Live 2020, at least.

(/usr/share ...
by rais
Sun Aug 13, 2023 11:24 pm
Forum: General
Topic: How to use the listings package
Replies: 1
Views: 7446

How to use the listings package

Looks more like Matlab code to me...why do you tell listings it would be Pascal?

If you wish to have others tell you what kind of colors were used, me, for one, would need a better picture of `how it should be'---did you have a closer look at `Example.png'? The colors aren't uniform within their ...