Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 11 15:17
    GitLab | Paulo Cereda pushed 1 commits to arara
  • Jan 11 11:48
    GitLab | Paulo Cereda pushed 1 commits to arara
  • Jan 11 10:01
    GitLab | Ben Frank pushed 1 commits to arara
  • Jan 11 10:01
    GitLab | Ben Frank pushed to arara
  • Jan 11 09:59
    GitLab | Paulo Cereda pushed 1 commits to arara
  • Jan 11 09:30
    GitLab | Paulo Cereda pushed 1 commits to arara
  • Jan 11 09:08
  • Jan 11 09:00
    GitLab | Paulo Cereda pushed to arara
  • Jan 10 17:34
    GitLab | Ben Frank pushed 100 commits to arara
  • Jan 10 15:19
    GitLab | Ben Frank pushed 1 commits to arara
  • Jan 10 15:16
    GitLab | Ben Frank pushed 130 commits to arara
  • Jan 10 11:06
    GitLab | Ben Frank pushed 14 commits to arara
  • Jan 10 10:32
    GitLab | Ben Frank pushed 1 commits to arara
  • Jan 10 10:10
    GitLab | Ben Frank pushed 2 commits to arara
  • Jan 10 09:43
    GitLab | Ben Frank pushed 2 commits to arara
  • Jan 10 09:32
    GitLab | Ben Frank pushed 1 commits to arara
  • Jan 10 09:21
    GitLab | Ben Frank pushed to arara
  • Jan 10 09:21
    GitLab | Ben Frank pushed 7 commits to arara
  • Jan 10 09:04
    GitLab | Ben Frank pushed 1 commits to arara
  • Jan 10 08:59
    GitLab | Ben Frank pushed to arara
Ben Frank
@benfrank_gitlab
You're welcome :slight_smile:
Paulo Cereda
@cereda
@roganjoshua_gitlab hi! If you have an updated TeX Live in your machine, you can type texdoc arara and the documentation should appear. :)
Martin Sarosi
@roganjoshua_gitlab
thanks Paulo
Fred Guth
@fredguth

Olá araras, I am looking for recipes (a little bit lazy of my part, I know) for using arara to generate pdf of a midsized thesis (+- 400 pgs with lots of figs) with chapters (arsclassica.sty) .

Usually, I use pdflatex and bibtex, and I need to call pdflatex several times to solve all references. My dream would be that it would compile only if a file changed and only what needs to be recompiled. Even better if I can (somehow) use several cores and compile different tex in parallel.

Any idea where I can find some arara recipes to get inspired?

Ben Frank
@benfrank_gitlab

@fredguth Welcome :slight_smile:

First of all, I don't know about existing parallelization rules but you might write your own as you can use Java's standard library within the rule scope. First-class parallelization is on our roadmap but won't make it into arara for at least another year.

For compiling a thesis you can start off with the basic % arara: pdflatex etc. directives. Conditional compilation with if changed(…) is easy and the manual very descriptive. A more complex example showing change checking for files in subdirectories may be found at https://tex.stackexchange.com/a/525606 (if you need it multiple times it would make sense to turn it into a rule).

Paulo Cereda
@cereda
@fredguth Olá Fred, welcome. :)
Paulo Cereda
@cereda
As @benfrank_gitlab mentioned, parallelization is in our roadmap, but it might take some time. The upcoming release already features significant changes: https://gitlab.com/islandoftex/arara/-/blob/development/CHANGELOG.md
I believe Ben's approach is the best way to start: a simple list of directives which makes your thesis compile nicely and correctly. Then, once we have a working "preamble", we could look for optimization opportunities with conditionals. Then, at last but not least, if we are dealing with a complex workflow, we could take a step further and write a rule for it.
Paulo Cereda
@cereda
Also, congratulations for writing your thesis! It's quite the achievement, taking effort and dedication! Take your time to write the thesis at your own pace and I am sure everything will work out great! Also, in times like this, stay safe!
Fred Guth
@fredguth
I am trying to follow Ben's suggestion of a more complex example, but I get this error: [Error: unresolvable property or identifier: com]
I am using arara 5.0.2
The error is on the line % arara: --> com.github.cereda.arara.utils.Methods.listFilesByExtensions(
Paulo Cereda
@cereda
Ah... old version woes. :)
Gimme a minute, I will sort it out.
Fred Guth
@fredguth
ok
matrixbot
@matrixbot
@benfrank:matrix.org In version 5 it moved to org.islandoftex.arara.utils.Methods.listFilesByExtensions.
Fred Guth
@fredguth
:+1:
Paulo Cereda
@cereda
Smart matrix bot. :) Let me check the preamble. :)
Fred Guth
@fredguth
I am still a little confused about where the "if" ends. It seems to end in return flag, right?
Paulo Cereda
@cereda

I am still a little confused about where the "if" ends. It seems to end in return flag, right?

Yes, it is correct. Another hint is the --> prefix, which indicates the line is a continuation of the previous one.

Although this is definitely not my favourite preamble, it tracks all .tex files and checks their statuses. :)
As time went by, people started using arara for more and more complex tasks. :)
Fred Guth
@fredguth
I understand... n thesis.tex I have now:
% arara: pdflatex: {options: ['-interaction=batchmode']} % arara: --> if % arara: --> entries = % arara: --> org.islandoftex.arara.utils.Methods.listFilesByExtensions( % arara: --> toFile('Chapters/'), ['tex'], false % arara: --> ); flag = false; % arara: --> foreach(entry : entries) { % arara: --> flag = changed(entry) || flag; % arara: --> }; % arara: --> flag = changed(currentFile()) || flag; % arara: --> flag = missing('log') || flag; % arara: --> flag = missing('aux') || flag; % arara: --> return flag
Which I understand means that thesis.tex will be recompiled if I changed any of the Chapters. But it would be nicer if I had some kind of way to includeonly the chapter needing recompilation. Does it make any sense? I guess if I compile only one chapter it may lead to problems with page numbering.
I understand... n thesis.tex I have now:
% arara: pdflatex: {options: ['-interaction=batchmode']} % arara: --> if % arara: --> entries = % arara: --> org.islandoftex.arara.utils.Methods.listFilesByExtensions( % arara: --> toFile('Chapters/'), ['tex'], false % arara: --> ); flag = false; % arara: --> foreach(entry : entries) { % arara: --> flag = changed(entry) || flag; % arara: --> }; % arara: --> flag = changed(currentFile()) || flag; % arara: --> flag = missing('log') || flag; % arara: --> flag = missing('aux') || flag; % arara: --> return flag
Which I understand means that thesis.tex will be recompiled if I changed any of the Chapters. But it would be nicer if I had some kind of way to includeonly the chapter needing recompilation. Does it make any sense? I guess if I compile only one chapter it may lead to problems with page numbering.
Paulo Cereda
@cereda

[...] Which I understand means that thesis.tex will be recompiled if I changed any of the Chapters. But it would be nicer if I had some kind of way to includeonly the chapter needing recompilation. Does it make any sense? I guess if I compile only one chapter it may lead to problems with page numbering.

I think I see what you mean, but this is not possible with TeX. It's either everything or nothing...

There are some tricks regarding TikZ externalization, but that only applies to... well, TikZ. :)
You are probably thinking along the lines of having an "object code" in the typical CS sense, so you "only" update the modified files.
Fred Guth
@fredguth
Exactly... for my paper reviews, I made a simple python script to compile in parallel. I do that because sometimes I change the bibliography and need to review all the papers at once. It is a little faster in parallel (half of the time).
Another road block here:
% arara: bibtex if changed('bibliography.bib') || missing('bbl')
is not running bibtex when I change bibliography.bib
Paulo Cereda
@cereda
That's easy to fix:
% arara: bibtex if changed(toFile('bibliography.bib')) || missing('bbl')
Fred Guth
@fredguth
my bad... thanks.
Paulo Cereda
@cereda
changed('foo') checks for changes in <basename>.foo. :)
Oh no worries! Been there, done that. :)
How many roads must a man walk down. :D
Fred Guth
@fredguth
Now, if I run bibtex, I may need to run pdflatex several times until there is no reference error.
If I just
% arara: bibtex if changed(toFile('bibliography.bib')) || missing('bbl')
%  pdflatex: {options: ['-interaction=batchmode']} until !found('log', 'No file ') && !found('log', 'undefined references') && !found('log', 'Rerun required') &&! found('log', 'Rerun to get cross-references')
Paulo Cereda
@cereda
Let me think. :)
Fred Guth
@fredguth
maybe the pdflatex until need to be with the bibtex and only run if there is a change in the bib file.
Paulo Cereda
@cereda
Yes, that might be a sensible approach. thought of using sessions, but this might work just fine. :)
Fred Guth
@fredguth

Now in my thesis.tex I have:

% arara: pdflatex: {options: ['-interaction=batchmode']}
% arara: --> if
% arara: --> entries =
% arara: --> org.islandoftex.arara.utils.Methods.listFilesByExtensions(
% arara: --> toFile('Chapters/'), ['tex'], false
% arara: --> ); flag = false;
% arara: --> foreach(entry : entries) {
% arara: -->   flag = changed(entry) || flag;
% arara: --> };
% arara: --> flag = changed(currentFile()) || flag;
% arara: --> flag = missing('log') || flag;
% arara: --> flag = missing('aux') || flag;
% arara: --> return flag
% arara: makeindex if changed('idx')
% arara: bibtex if changed(toFile('bibliography.bib')) || missing('bbl')
% arara: pdflatex: {options: ['-interaction=batchmode']} while found('log', 'undefined references') || found('log', 'Rerun required') || found('log', 'Rerun to get cross-references')

and it seems to not get out of the while loop:

✗ arara thesis
  __ _ _ __ __ _ _ __ __ _
 / _` | '__/ _` | '__/ _` |
| (_| | | | (_| | | | (_| |
 \__,_|_|  \__,_|_|  \__,_|

Processing 'thesis.tex' (size: 4.1 kB, last modified: 12/07/2020
16:44:52), please wait.

(MakeIndex) The MakeIndex software ...................... SUCCESS
(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS
(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS
(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS
(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS
(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS
(PDFLaTeX) PDFLaTeX engine .............................. ^C%

Is it possible to print the reason why the engine is running the rule? Which condition was met? Also, in case of failure, it would be good to know what failed.

Paulo Cereda
@cereda
My best guess is that you have an undefined reference/label, so at least one of the conditions will evaluate to true. The best way to find out now is probably inspect thesis.log and try to spot the culprit. I might raise with the team if we should log conditional methods as well in future releases. For now, one thing is clear: your log file has the key to understand this behaviour. :)
Ben Frank
@benfrank_gitlab
@fredguth It's currently not implemented (and neither is it easy) to find out the specific part of a condition as the whole conditional block is evaluated as one and arara only gets to see the result of the evaluation. I concur with @cereda that you probably have an undefined reference and should look into the TeX log.
Fred Guth
@fredguth
Ok.
Fred Guth
@fredguth
If I change my .tex to:
% arara: pdflatex: {options: ['-interaction=batchmode']} while found('log', 'undefined references')

It does not run, but if I change to:

% arara: pdflatex: {options: ['-interaction=batchmode']}
% arara: --> if
% arara: --> entries =
% arara: --> org.islandoftex.arara.utils.Methods.listFilesByExtensions(
% arara: --> toFile('Chapters/'), ['tex'], false
% arara: --> ); flag = false;
% arara: --> foreach(entry : entries) {
% arara: -->   flag = changed(entry) || flag;
% arara: --> };
% arara: --> flag = changed(currentFile()) || flag;
% arara: --> flag = missing('log') || flag;
% arara: --> flag = missing('aux') || flag;
% arara: --> return flag
% arara: pdflatex: {options: ['-interaction=batchmode']} while found('log', 'undefined references')

it loops indefinetly, although I can't find "undefined references in thesis.log"

cat thesis.log | grep "undefined references"
Ben Frank
@benfrank_gitlab
@fredguth We have some suspicion what might cause this behavior. Particularly, it may be some kind of trouble caused by the multi-file setup (with the files from the subdirectory). @cereda already investigates potential issues to get back to you :slight_smile:
Fred Guth
@fredguth
thanks
Paulo Cereda
@cereda
@fredguth sorry for the late reply, today has been hectic. It's challenging to spot a potential issue by only inspecting the directives and one file. Your setup is far from being trivial and there are lots of files involved. What does arara.log say? It would be good if you could reduce your setup to a MWE that reproduces the issue. Otherwise, one can only speculate...
Daniel
@dan-r95

@dan-r95 Hello Daniel! I just commited a move rule to our repository: https://gitlab.com/islandoftex/arara/-/blob/development/rules/arara-rule-move.yaml

thank you for the updated rule!

1 reply