Pandoc fails to render markdown with image: "! Missing endcsname inserted." - macos

I am having trouble rendering a .md-file with since I inserted an image. Before everything worked quite well.
My configuration
MacBook Air / MacOS 12.5
multiple markdown files for each chapter: 1_einleitung.md / 2_theorie.md / ...
there is a short yaml-block that references the bibliography file within the same folder: bib.bib.
I use a special LUA filter (pangb4e) for numbered examples and interlinear glossing
a metadata.yml ➞ find the yaml code below.
a Make-file ➞ find the makefile code below
the image is stored in images/danes1.png (I even tried to use the entire path instead of the relative one)
2_theorie.md
---
bibliography: [bib.bib]
---
[...]
![Die einfache lineare Progression](images/danes1.png){width=300px #fig:danes1}
metadata.yml
---
author: ...
affiliation: ...
title: ...
date: \today
# number-sections: true
# abstract: This is the abstract.
# Formatting
bibliography: [bib.bib]
cls: linguistics-and-education.csl
lang: de-DE
link-citations: true
linkReferences: true
nameInLink: true
fontsize: 12pt
papersize: a4
indent: true
fontfamily: sourcesanspro
fontfamilyoptions: default
geometry: margin=2.5cm
linestretch: 1.5
header-includes:
- \usepackage{gb4e}
- \usepackage[nottoc]{tocbibind}
figureTitle: "Abbildung"
tableTitle: "Tabelle"
figPrefix:
- "Fig."
- "Figs."
tblPrefix:
- "Tab."
secPrefix:
- Kapitel
loftitle: "# Abbildungsverzeichnis"
lottitle: "# Tabellenverzeichnis"
...
makefile
1_einleitung:
pandoc 1_einleitung.md -o 1_einleitung.pdf \
--metadata-file=metadata.yml \
--number-sections \
--strip-comments \
--filter pandoc-crossref \
--citeproc \
--lua-filter addons/pangb4e.lua \
2_theorie:
pandoc 2_theorie.md -o 2_theorie.pdf \
--metadata-file=metadata.yml \
--number-sections \
--strip-comments \
--filter pandoc-crossref \
--citeproc \
--lua-filter addons/pangb4e.lua \
The error output
Currently, I do my writing within the 2_theorie.md and run the command make 2_theorie to produce a pdf. I just inserted an image in 2_theorie.md and a get the following error:
san#MacBook-Air Doktorarbeit % make 2_theorie
pandoc 2_theorie.md -o 2_theorie.pdf \
--metadata-file=metadata.yml \
--number-sections \
--strip-comments \
--filter pandoc-crossref \
--citeproc \
--lua-filter addons/pangb4e.lua \
Error producing PDF.
! Missing endcsname inserted.
<to be read again>
let
l.591 }
When I delete the image, the code runs as usual but I need to be able to use images in my work.
If you need more information, please let me know!
Thank you!

I found a solution to my problem myself here: https://tex.stackexchange.com/questions/448314/not-able-to-use-images-if-i-call-gb4e-sty
The problem was the package gb4e. I disabled the a feature of the package right after loading it and panda worked just fine
Edits in the metadata.yml
[...]
header-includes:
- \usepackage{gb4e}
- \noautomath # <-- I added this line the to metadata.yml
[...]

Related

For loop values in a Makefile not being used as arguments to a shell command

I'm trying to use a Makefile to iterate over several date values and execute a python script for each one, here's the Makefile I'm using (Makefile.study.s1):
include Makefile
# Dates to test
SNAP_TST := 2019-10-12 2020-02-08 2020-10-10 2021-01-02 2021-07-24 2021-12-31 2022-05-27
buildDataset:
for date in $(SNAP_TST) ; do \
python src/_buildDataset.py --table $(TABLE) \
--nan-values $(NAN_CONFIG) \
--patterns-rmv $(PATTERNS_RMV) \
--target-bin $(TARGET_CLASS) \
--target-surv $(TARGET_SURV) \
--target-init $(TARGET_INIT) \
--train-file $(DATA_TRN) \
--test-file $(DIR_DATA)/main/churnvol_test_$$date.csv \
--train-date $(SNAP_TRN) \
--test-date $$date \
--config-input $(CONFIG_INPUT) \
--feats $(FEATS) ; \
done
.PHONY: buildDataset
When I run make -f Makefile.study.s1 buildDataset it replaces the value date with the string "$date" instead of one of the dates in SNAP_TST. Can you guys help me figure out what I did wrong here, and how I can fix this makefile so that $$date is replaced with one of the dates in SNAP_TST? Thank you in advance.

Make missing separator issue

Getting this error makefile:4: *** missing separator. Stop. on this file
PROC=findcrypt
O1=consts
O2=sparse
!include ..\plugin.mak
# MAKEDEP dependency list ------------------
$(F)consts$(O) : $(I)llong.hpp $(I)pro.h consts.cpp findcrypt.hpp
$(F)findcrypt$(O): $(I)area.hpp $(I)bytes.hpp $(I)fpro.h $(I)funcs.hpp \
$(I)help.h $(I)ida.hpp $(I)idp.hpp $(I)kernwin.hpp \
$(I)lines.hpp $(I)llong.hpp $(I)loader.hpp $(I)moves.hpp \
$(I)nalt.hpp $(I)name.hpp $(I)netnode.hpp $(I)pro.h \
$(I)segment.hpp $(I)sistack.hpp $(I)ua.hpp $(I)xref.hpp \
findcrypt.cpp findcrypt.hpp
$(F)sparse$(O) : $(I)llong.hpp $(I)pro.h findcrypt.hpp sparse.cpp
I've tried using cat -e -t -v makefile to identify bad tabs but it all looks ok from what i can tell.

AC_CONFIG_FILES not generating Makefiles

I'm writing an app in Vala with support to plugins. The app has the following directory structure:
data/
[data files]
m4/
my_project.m4
plugins/
example/
example.plugin.in
example-plugin.vala
Makefile.am
po/
src/
[source files]
The file "my_project.m4" dinamically adds plugin dirs with a simple defined function called MYPROJ_ADD_PLUGIN, and it works fine as I tested it with some other projects. Basically, it calls:
AC_CONFIG_FILES([plugins/example/Makefile])
[...]
AC_CONFIG_FILES([plugins/example/example.plugin])
The problem is, when I try to configure it, it gives back:
"error: cannot find input file: `plugins/example/Makefile.in'"
The example makefile (plugins/example/Makefile.am) is the following:
include $(top_srcdir)/common.am
plugin_LTLIBRARIES = example-plugin.la
plugin_DATA = example.plugin
example_plugin_la_SOURCES = \
example-plugin.vala
example_plugin_la_VALAFLAGS = \
$(MYPROJ_COMMON_VALAFLAGS) \
--target-glib=2.38
example_plugin_la_CFLAGS = \
$(MYPROJ_COMMON_CFLAGS) \
-I$(srcdir) \
-DG_LOG_DOMAIN='"Example"'
example_plugin_la_LIBADD = \
$(MYPROJ_COMMON_LIBS)
example_plugin_la_LDFLAGS = \
$(MYPROJ_PLUGIN_LINKER_FLAGS) \
-lm
EXTRA_DIST = example.plugin.in
Every var is correctly generated (in common.am and configure.ac).
I appreciate any advice on this issue.
Thanks in advance
Looks like I found the answer to my own question. Apparently, everything I had to do was add a "lib" prefix to my plugin output file. The plugins/example/Makefile.am now looks like:
include $(top_srcdir)/common.am
plugin_LTLIBRARIES = **lib**example.la
plugin_DATA = example.plugin
**lib**example_la_SOURCES = \
example-plugin.vala
**lib**example_la_VALAFLAGS = \
$(MYPROJ_COMMON_VALAFLAGS) \
--target-glib=2.38
**lib**example_la_CFLAGS = \
$(MYPROJ_COMMON_CFLAGS) \
-I$(srcdir) \
-DG_LOG_DOMAIN='"Example"'
**lib**example_la_LIBADD = \
$(MYPROJ_COMMON_LIBS)
**lib**example_la_LDFLAGS = \
$(MYPROJ_PLUGIN_LINKER_FLAGS) \
-lm
EXTRA_DIST = example.plugin.in
This was the only modification I did, and it works as expected now. Seems like autoconf/autotools is very rigid about the syntax of plugins and shared libs, as they MUST start with lib prefix.

Custom garmin map have no name

I created a Garmin map from my own OSM files (using JOSM and my own GPS records, no input from Openstreetmap).
The whole process run well, but I have just a little problem : when I load the final map to Basecamp, the name of this map is empty (blank).
Any idea ?
Here is the code. Before, some variables :
PREFIX=640000
ORIGINALNAME=$(echo ${PREFIX}00)
NAME=$(echo ${PREFIX}01)
ID_PUBLIC=64
DIR="/home/Carto"
GMAPIBUILDER="/Applications/Carto/gmapi-builder.py"
MKGMAP="/Applications/Carto/mkgmap/mkgmap.jar"
First, create img files from different layers
for f in $DIR/src/public/*.osm ; do
g=$(basename $f .osm) ;
d=$(dirname $f)
java -Xmx2G -jar $MKGMAP \
--transparent --add-pois-to-areas \
--keep-going --draw-priority=$drawpriority \
--description="[iero] "$g \
--family-name="iero Congo" \
--series-name="iero Congo" \
--mapname=$NAME --family-id=$ID --product-id=$ID \
--country-name=Congo --country-abbr=CG \
--style-file=$DIR/styles --style=iero \
--copyright-message="[iero.org] Congo $DATE" \
--product-version=$VERSION \
--latin1 --output-dir=$DIR/output/imgs/public $f 1> /dev/null;
cp $DIR/output/imgs/public/${NAME}.img $DIR/output/imgs/public/${NAME}.img
let NAME++ ;
let nbfiles++ ;
let drawpriority++ ;
done
Next, concatenate those files in unique img file
java -jar $MKGMAP --tdbfile --gmapsupp $DIR/output/imgs/public/*.img \
--keep-going \
--style-file=$DIR/styles --style=iero \
--family-name="iero Congo" \
--series-name="iero Congo" \
--description="[iero] Congo map" \
--mapname=$ORIGINALNAME --family-id=${ID_PUBLIC} --product-id=${ID_PUBLIC} \
--copyright-message="[iero.org] Congo $DATE" \
--product-version=$VERSION \
--output-dir=$DIR/output/gps/public 1> /dev/null;
Then, create gmapi files, ready for Basecamp :
python $GMAPIBUILDER -t $DIR/output/gps/public/osmmap.tdb -b $DIR/output/gps/public/osmmap.img -o $DIR/output/basecamp/mac/public $DIR/output/imgs/public/*.img
If you want to see the problem, final files can be downloaded in my website : http://www.iero.org/blog/2014/06/carte-du-congo/
Thanks !
Greg
I have done testing and only get the blank names with versions of mkgmap after they introduced the overview map feature. I built a map with r2585 and the name showed correctly.

Disable all but few warnings in gcc

In gcc -w is used to disable all warnings. However in this case I can't enable specific ones (e.g. -Wreturn-type).
Is it possible to disable all warnings, but enable few specific ones?
As a workaround, is there a way to generate list of all -Wno-xxx at once? And will it help? I wouldn't want to do this manually just to find out that it is not equal to -w.
You can use the following command to get an WARN_OPTS variable suitable for injecting directly into your Makefile:
gcc --help=warnings | awk '
BEGIN { print "WARN_OPTS = \\" }
/-W[^ ]/ { print $1" \\"}
' | sed 's/^-W/ -Wno-/' >makefile.inject
This gives you output (in makefile.inject) like:
WARN_OPTS = \
-Wno- \
-Wno-abi \
-Wno-address \
-Wno-aggregate-return \
-Wno-aliasing \
-Wno-align-commons \
-Wno-all \
-Wno-ampersand \
-Wno-array-bounds \
-Wno-array-temporaries \
: : :
-Wno-variadic-macros \
-Wno-vector-operation-performance \
-Wno-vla \
-Wno-volatile-register-var \
-Wno-write-strings \
-Wno-zero-as-null-pointer-constant \
Once that's put in your actual Makefile, simply use $(WARN_OPTS) as part of your gcc command.
It may need a small amount of touch up to:
get rid of invalid options such as -Wno-;
fix certain -Wno-<key>=<value> types; and
remove the final \ character.
but that's minimal effort compared to the generation of the long list, something you can now do rather simply.
When you establish that you want one of those warnings, simply switch from the -Wno-<something> back to -W<something>.

Resources