Scribus Forums

Scribus => General Discussion => Topic started by: renato07 on January 19, 2024, 12:54:37 PM

Title: date hereof
Post by: renato07 on January 19, 2024, 12:54:37 PM
Hi,
I'm setting up a newspaper, and I would insert the today date somewhere in the page. I didn't found any variable for that. I'm wondering if do it exist or maybe a script can work for it.

Any idea?

Thank you

Renato
Title: Re: date hereof
Post by: PatJr on January 19, 2024, 03:02:13 PM
don't think it does
it's experimental but maybe you could use the variable text so then you would only need to enter it once while you're editing
Title: Re: date hereof
Post by: renato07 on January 19, 2024, 05:30:14 PM
"variable text"?
Is it a variable? where can I find it?

Renato
Title: Re: date hereof
Post by: a.l.e on January 19, 2024, 07:12:00 PM
variable-date.gif
Title: Re: date hereof
Post by: renato07 on January 19, 2024, 11:17:55 PM
Ok, I've found it and inserted into frame text, but what can I do then to replace variable with the value (i.e. "today" with 19/01/2023). I think I must "compile"or whatever action to substitute the variable name with the real value. IS it?

Renato
Title: Re: date hereof
Post by: Nermander on January 20, 2024, 08:12:55 AM
It is shown in the animation how it is changed from "today" to "tomorrow".
Title: Re: date hereof
Post by: renato07 on January 20, 2024, 12:00:48 PM
yes, it is shown on the post, but what I'm asking is: how can I swap "today" with "20 January 2024" or something in different format.

Renato
Title: Re: date hereof
Post by: a.l.e on January 20, 2024, 01:01:07 PM
what about using your keyboard?

... or if you're a real hacker a butterfly? ...

(https://imgs.xkcd.com/comics/real_programmers.png)

but you have to hurry, otherwise "20 January 2024" will already be in the past...
Title: Re: date hereof
Post by: renato07 on January 20, 2024, 03:54:29 PM
yes! I will use emacs (is the editor that I use). I've done it and it works! And I will wait for a new version with the date variable.

Thank you

Renato
Title: Re: date hereof
Post by: a.l.e on January 20, 2024, 04:33:20 PM
well, good luck inserting a date field (that you can centrally update) in emacs...

but i know nothing about emacs, so it might have a trick also for that...
Title: Re: date hereof
Post by: Aleks100 on January 20, 2024, 08:27:11 PM
Well, Scribus can render Latex code & there is \date in Latex... just kidding, variable text is proper way to do.
Title: Re: date hereof
Post by: renato07 on January 21, 2024, 12:56:45 PM
you mean changing the date via emacs or whatever text editor, right?
Title: Re: date hereof
Post by: utnik on January 21, 2024, 09:52:42 PM
hi renato

take another look at ale's screencast. in the third text frame he replaced the entry for the mark labeled 'date' (without an external editor...)

utnik
Title: Re: date hereof
Post by: renato07 on January 22, 2024, 08:51:43 AM
still don't understand...
Can I replace the string "today" with a value?

Thank you

Renato
Title: Re: date hereof
Post by: a.l.e on January 22, 2024, 11:45:36 AM
let's try with some italian... maybe the problem is with understanding english...

renato, in italiano, caso mai il problema fosse con l'inglese (la speranza è l'ultima a morire)...

invece di tradurre "tomorrow" con "domani", prova a scrivere "23 gennaio 2024" (che oggi è domani) e vedi l'effetto che fa...

e il giorno seguente, cambia il 23 in 24.
e così via fino all'eternità. (no, non cambi ogni giorno il 23 in 24, poi vengono il 25, il 26, il 27, finché non torni all'1; ma questo ormai spero l'abbiano capito anche i sassi).

perché oggi lavori al giornale di domani, e sul giornale di domani, che impagini oggi, tu vuoi che appaia la data di domani, non la data di oggi. e domani lavorerai al giornale di dopodomani.
e questo vale anche se tu, quando hai scritto "giornale" (newspaper), pensavi piuttosto ad una rivista ("magazine")... solo che, in quel caso, invece di domani avrai qualcosa come il prossimo lunedì (no, non "prossimo lunedì": "29 gennaio 2024"!).

oufh.
Title: Re: date hereof
Post by: AdmFubar on January 22, 2024, 11:41:47 PM
Is there a list of all the variables that can be added to a document this way? It would be handy.
Title: Re: date hereof
Post by: utnik on January 23, 2024, 04:42:42 AM
hi admfubar

what do you mean by
Quote...all the variables that can be added to a document this way?
as there is no automatism to fill in some text, you are free to add variables as you like.
afaik there is just the name of the variable and the text which replaces it in the actual text frames.
...or did i miss something?

utnik
Title: Re: date hereof
Post by: AdmFubar on January 23, 2024, 07:39:28 AM
and how do you define this variable on the fly?
I was asking for a list of usable variables.. But you are saying that you define it as needed.  
Title: Re: date hereof
Post by: utnik on January 23, 2024, 12:14:09 PM
hi admfubar

Quote from: AdmFubar on January 23, 2024, 07:39:28 AMand how do you define this variable on the fly?
take a look at the first step in ale's screencast! he defined a variable as 'date' and populated it with 'today' (which he altered in a later step...)

utnik
Title: Re: date hereof
Post by: AdmFubar on January 23, 2024, 08:08:35 PM
great.. but where does "today" get its value from?
Title: Re: date hereof
Post by: Nermander on January 23, 2024, 08:21:31 PM
It is a text you write.

The text variable named "date" is first set to contain the text "today", then it is changed to "tomorrow".

So everywhere where you have inserted the variable named "date" first shows "today", and after the variable has been changed it shows "tomorrow".

So you can define the variable named "date" to be whatever you want. "today", "tomorrow", "23 January 2024", "Stardate 7643.5".
Title: Re: date hereof
Post by: AdmFubar on January 23, 2024, 09:00:27 PM
let me see if i have this straight..
One would name a variable in scribus, manually assign it a value. then went ever you type that variable in it shows up.

So how does one get the current date into that variable? I dont see this method as being useful for this use case. what am i missing?
Title: Re: date hereof
Post by: utnik on January 23, 2024, 09:57:10 PM
hi admfubar

Quote from: AdmFubar on January 23, 2024, 09:00:27 PMSo how does one get the current date into that variable?
as i wrote before, there's no automatism. (in other words: scribus doesn't know what 'date' is used for...) you need to insert the date once manually to tell scribus how to populate every instance of the variable.

QuoteI dont see this method as being useful for this use case.
you're right. if you don't know the current date, text variables are useless. but if you do, you might use them...

utnik
Title: Re: date hereof
Post by: a.l.e on January 24, 2024, 01:39:03 PM
i think that people have issues with the concept of variable (in computer science).

a variable is not something that changes by itself, it's a way to put a common value in a container and give it a name.
it's not called a "variable" because it changes its own content by itself, but because you're allowed to change its content (the opposite is a "constant", where you set the value once and you're not supposed to change it later).

my final world on this topic: i recognize that it would be "cool" to have some sort of dynamic field that shows the current date, but for layout purposes, i fear that such a field would be pretty useless since you almost never want to have the layout date (or time) in the layout itself.