Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"I will make no bargains with terrorist hardware." -- Peter da Silva


computers / comp.text.tex / Doing things depending on the name of the LaTeX document

SubjectAuthor
* Doing things depending on the name of the LaTeX documentCecil Westerhof
`* Re: Doing things depending on the name of the LaTeX documenthymie!
 `* Re: Doing things depending on the name of the LaTeX documentCecil Westerhof
  +- Re: Doing things depending on the name of the LaTeX documentUwe Siart
  +- Re: Doing things depending on the name of the LaTeX documentUlrike Fischer
  `* Re: Doing things depending on the name of the LaTeX documentPeter Flynn
   `- Re: Doing things depending on the name of the LaTeX documentHolger Schieferdecker

1
Doing things depending on the name of the LaTeX document

<874jwixgni.fsf@munus.decebal.nl>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5426&group=comp.text.tex#5426

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Cecil@decebal.nl (Cecil Westerhof)
Newsgroups: comp.text.tex
Subject: Doing things depending on the name of the LaTeX document
Date: Wed, 05 Oct 2022 20:35:29 +0200
Organization: Decebal Computing
Lines: 10
Message-ID: <874jwixgni.fsf@munus.decebal.nl>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="e25ebccdf2b9eac2e7f3584360fb3375";
logging-data="3207882"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Gz/85NFRIKaHZhDbtN1eBPNsjgCcSqzM="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:pCM6/gjTiFS4PvR2V2vge/RSsZw=
sha1:q6rBzqHaRERcxpQTwUCb7gM87oI=
 by: Cecil Westerhof - Wed, 5 Oct 2022 18:35 UTC

In scripting languages what I do is depending on the name of the
script. So I link files. In reality there is only one file, but it can
be called with for example five different names.
Is something like this possible with LaTex? Partly doing thing based
on the name of the document name?

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Re: Doing things depending on the name of the LaTeX document

<slrntjsfbh.14f.hymie@nasalinux.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5429&group=comp.text.tex#5429

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx16.iad.POSTED!not-for-mail
Newsgroups: comp.text.tex
From: hymie@nasalinux.net (hymie!)
Subject: Re: Doing things depending on the name of the LaTeX document
References: <874jwixgni.fsf@munus.decebal.nl>
Organization: Eric Conspiracy Secret Labs
User-Agent: slrn/pre1.0.4-6 (Linux)
Message-ID: <slrntjsfbh.14f.hymie@nasalinux.net>
Lines: 26
X-Complaints-To: abuse@usenet-news.net
NNTP-Posting-Date: Thu, 06 Oct 2022 02:29:05 UTC
Date: Thu, 06 Oct 2022 02:29:05 GMT
X-Received-Bytes: 1159
 by: hymie! - Thu, 6 Oct 2022 02:29 UTC

In our last episode, the evil Dr. Lacto had captured our hero,
Cecil Westerhof <Cecil@decebal.nl>, who said:
> Is something like this possible with LaTex? Partly doing thing based
> on the name of the document name?

I don't know / remember where I got this from...

\def\StripPrefix#1>{}
\def\jobis#1{FF\fi
\def\predicate{#1}%
\edef\predicate{\expandafter\StripPrefix\meaning\predicate}%
\edef\job{\jobname}%
\ifx\job\predicate
}

\if\jobis{labels3}
\LabelCols=3%
\numberoflabels=30%
\else
\LabelCols=2%
\numberoflabels=20%
\fi

--hymie! http://nasalinux.net/~hymie hymie@nasalinux.net

Re: Doing things depending on the name of the LaTeX document

<87zge9wmpq.fsf@munus.decebal.nl>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5430&group=comp.text.tex#5430

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Cecil@decebal.nl (Cecil Westerhof)
Newsgroups: comp.text.tex
Subject: Re: Doing things depending on the name of the LaTeX document
Date: Thu, 06 Oct 2022 07:22:09 +0200
Organization: Decebal Computing
Lines: 33
Message-ID: <87zge9wmpq.fsf@munus.decebal.nl>
References: <874jwixgni.fsf@munus.decebal.nl>
<slrntjsfbh.14f.hymie@nasalinux.net>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="3e0175a8ab9a5725db6723be238035a6";
logging-data="3402416"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18es2+CW2yCNmn/buhRqoLjtysTjE7cbq4="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:xraEJTVNdMAMctOMP6niijrfgqw=
sha1:xCJdDqS9t/eFCPnoaMoSJT5PKO8=
 by: Cecil Westerhof - Thu, 6 Oct 2022 05:22 UTC

hymie! <hymie@nasalinux.net> writes:

> In our last episode, the evil Dr. Lacto had captured our hero,
> Cecil Westerhof <Cecil@decebal.nl>, who said:
>> Is something like this possible with LaTex? Partly doing thing based
>> on the name of the document name?
>
> I don't know / remember where I got this from...
>
>
> \def\StripPrefix#1>{}
> \def\jobis#1{FF\fi
> \def\predicate{#1}%
> \edef\predicate{\expandafter\StripPrefix\meaning\predicate}%
> \edef\job{\jobname}%
> \ifx\job\predicate
> }
>
> \if\jobis{labels3}
> \LabelCols=3%
> \numberoflabels=30%
> \else
> \LabelCols=2%
> \numberoflabels=20%
> \fi

That looks good.
I should have started much sooner with LaTeX.

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Re: Doing things depending on the name of the LaTeX document

<86pmf5csbv.fsf@siart.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5431&group=comp.text.tex#5431

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news-peer.in.tum.de!.POSTED!not-for-mail
From: usenet@siart.de (Uwe Siart)
Newsgroups: comp.text.tex
Subject: Re: Doing things depending on the name of the LaTeX document
Date: Thu, 06 Oct 2022 09:41:08 +0200
Organization: Technical University of Munich
Lines: 9
Message-ID: <86pmf5csbv.fsf@siart.de>
References: <874jwixgni.fsf@munus.decebal.nl>
<slrntjsfbh.14f.hymie@nasalinux.net> <87zge9wmpq.fsf@munus.decebal.nl>
NNTP-Posting-Host: siebenstern.net.hft.e-technik.tu-muenchen.de
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: news.informatik.tu-muenchen.de 1665042067 24975 129.187.140.76 (6 Oct 2022 07:41:07 GMT)
X-Complaints-To: usenet@in.tum.de
NNTP-Posting-Date: Thu, 6 Oct 2022 07:41:07 +0000 (UTC)
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt)
Cancel-Lock: sha1:flWpbnqVUmZyQr/zmUbF8M7ef6I=
 by: Uwe Siart - Thu, 6 Oct 2022 07:41 UTC

Cecil Westerhof <Cecil@decebal.nl> writes:

> I should have started much sooner with LaTeX.

That's a very good insight. Have fun with it! It's never too late for
that. ;-)

--
Uwe

Re: Doing things depending on the name of the LaTeX document

<k0imlg3nia3p$.dlg@nililand.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5432&group=comp.text.tex#5432

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: news3@nililand.de (Ulrike Fischer)
Newsgroups: comp.text.tex
Subject: Re: Doing things depending on the name of the LaTeX document
Date: Thu, 6 Oct 2022 09:57:48 +0200
Lines: 51
Message-ID: <k0imlg3nia3p$.dlg@nililand.de>
References: <874jwixgni.fsf@munus.decebal.nl> <slrntjsfbh.14f.hymie@nasalinux.net> <87zge9wmpq.fsf@munus.decebal.nl>
Reply-To: news3@nililand.de
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: individual.net NN2lRare9J/xfL6+h54LXwwl9L76ZL2Uh7pN3It4yvnU3ACILZ
Cancel-Lock: sha1:/5W/EaK0A2A92OmYHSJUZTVy5bE=
User-Agent: 40tude_Dialog/2.0.15.41de
 by: Ulrike Fischer - Thu, 6 Oct 2022 07:57 UTC

Am Thu, 06 Oct 2022 07:22:09 +0200 schrieb Cecil Westerhof:

>> \def\StripPrefix#1>{}
>> \def\jobis#1{FF\fi
>> \def\predicate{#1}%
>> \edef\predicate{\expandafter\StripPrefix\meaning\predicate}%
>> \edef\job{\jobname}%
>> \ifx\job\predicate
>> }
>>
>> \if\jobis{labels3}
>> \LabelCols=3%
>> \numberoflabels=30%
>> \else
>> \LabelCols=2%
>> \numberoflabels=20%
>> \fi
>
> That looks good.
> I should have started much sooner with LaTeX.

A bit more latex like would be to use e.g. the L3 Layer:

\documentclass{article}

\ExplSyntaxOn
\NewDocumentCommand\IfJobnameIsTF {m}
{ \str_if_eq:eeTF{\c_sys_jobname_str}{#1} }
\ExplSyntaxOff

\begin{document}
\IfJobnameIsTF{test-utf8}{true}{false}
\end{document}

or etoolbox

\documentclass{article}
\usepackage{etoolbox}

\NewDocumentCommand\IfJobnameIsTF{m}
{\ExpandArgs{ee}\ifstrequal{\jobname}{#1}}

\begin{document}
\IfJobnameIsTF{test-utf8}{true}{false}
\end{document}

(\ExpandArgs requires a current LaTeX)

--
Ulrike Fischer
http://www.troubleshooting-tex.de/

Re: Doing things depending on the name of the LaTeX document

<jq800nFo5khU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5436&group=comp.text.tex#5436

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: peter@silmaril.ie (Peter Flynn)
Newsgroups: comp.text.tex
Subject: Re: Doing things depending on the name of the LaTeX document
Date: Thu, 6 Oct 2022 13:29:10 +0100
Lines: 15
Message-ID: <jq800nFo5khU1@mid.individual.net>
References: <874jwixgni.fsf@munus.decebal.nl>
<slrntjsfbh.14f.hymie@nasalinux.net> <87zge9wmpq.fsf@munus.decebal.nl>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net x8uQYP3vWwkPEorwG1X+Mg1gvjXCkkxGlwPqZ61LF7UXRKPmvw
Cancel-Lock: sha1:yO+AAqaLzejlpftQDghPJgkXnIw=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Content-Language: en-US
In-Reply-To: <87zge9wmpq.fsf@munus.decebal.nl>
 by: Peter Flynn - Thu, 6 Oct 2022 12:29 UTC

On 06/10/2022 06:22, Cecil Westerhof wrote:
> hymie! <hymie@nasalinux.net> writes:
>
>> In our last episode, the evil Dr. Lacto had captured our hero,
>> Cecil Westerhof <Cecil@decebal.nl>, who said:
>>> Is something like this possible with LaTex? Partly doing thing based
>>> on the name of the document name?
[snip]
> That looks good.
> I should have started much sooner with LaTeX.

Also look at plain TeX's \newif which lets you create new conditionals,
and the ifthen package, which provides an if...then...else structure.

Peter

Re: Doing things depending on the name of the LaTeX document

<thp1dkU5lqsL1@news.in-ulm.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5446&group=comp.text.tex#5446

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news1.tnib.de!feed.news.tnib.de!news.tnib.de!newsfeed.in-ulm.de!not-for-mail
From: spamless@gmx.de (Holger Schieferdecker)
Newsgroups: comp.text.tex
Subject: Re: Doing things depending on the name of the LaTeX document
Date: Fri, 7 Oct 2022 13:09:44 +0200
Organization: [ posted via ] IN-Ulm
Lines: 20
Message-ID: <thp1dkU5lqsL1@news.in-ulm.de>
References: <874jwixgni.fsf@munus.decebal.nl>
<slrntjsfbh.14f.hymie@nasalinux.net> <87zge9wmpq.fsf@munus.decebal.nl>
<jq800nFo5khU1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.in-ulm.de FD661D4193B5E5AE3D0BD8527EC1527D
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
Thunderbird/52.9.1
In-Reply-To: <jq800nFo5khU1@mid.individual.net>
 by: Holger Schieferdecke - Fri, 7 Oct 2022 11:09 UTC

Am 06.10.2022 um 14:29 schrieb Peter Flynn:
> On 06/10/2022 06:22, Cecil Westerhof wrote:
>> hymie! <hymie@nasalinux.net> writes:
>>
>>> In our last episode, the evil Dr. Lacto had captured our hero,
>>>    Cecil Westerhof <Cecil@decebal.nl>, who said:
>>>> Is something like this possible with LaTex? Partly doing thing based
>>>> on the name of the document name?
> [snip]
>> That looks good.
>> I should have started much sooner with LaTeX.
>
> Also look at plain TeX's \newif which lets you create new conditionals,
> and the ifthen package, which provides an if...then...else structure.

The etoolbox package also provides macros to work with TeX conditionals.
Besides that it introduces so-called toggles which work quite similar.
The toggles use a different namespace to avoid clashes with common names.

Holger

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor