syntax highlighting: pandoc uses Kate
Hi, since we recently discussed editor support and syntax highlighting: Pandoc can use definitions from Kate[1] for syntax highlighting in a code block via "--syntax-definition". There’s also ConTeXt support (MkIV/LMTX): https://kate-editor.org/syntax/data/syntax/context.xml Apparently, it can switch contexts to Lua, XML, MetaPost etc. But the list of commands is quite short. In case the author (Philipp A.) is listening: Is this intentional (“not necessary, highlight everything that starts with a backslash”)? Otherwise it probably would make sense to read in the interface files (i-*.xml). I can’t tell if it would make sense to support this syntax via a module (like scite and vim). What we have if probably enough for most of us. Hraban [1] List: https://kate-editor.org/syntax/ Specs: https://api.kde.org/frameworks/syntax-highlighting/html/
I have a larger book, where crossreferences are made with \pagereference[label] and \at[label]. The problem is that references forward are resolved correctly, references backward result in ??. My file is complicated, so I tried to produce a simplified minimal file and everything is correct. If anyone has a solution, please let me know. Finding out the element that disturbs the references may take some time. Best Jürgen --- Prof. Dr. Juergen Hanneder Philipps-Universitaet Marburg FG Indologie u. Tibetologie Deutschhausstr.12 35032 Marburg Germany Tel. 0049-6421-28-24930 hanneder@staff.uni-marburg.de
Hi,
I suggest that you divide the document and do it again and again until
the problem goes away. And then continue. It is close to impossible
for somebody else to have an idea without seeing any source at all...
/Mikael
On Thu, Sep 26, 2024 at 1:32 PM Jürgen Hanneder via ntg-context
I have a larger book, where crossreferences are made with \pagereference[label] and \at[label]. The problem is that references forward are resolved correctly, references backward result in ??. My file is complicated, so I tried to produce a simplified minimal file and everything is correct. If anyone has a solution, please let me know. Finding out the element that disturbs the references may take some time.
Best Jürgen
---
Prof. Dr. Juergen Hanneder Philipps-Universitaet Marburg FG Indologie u. Tibetologie Deutschhausstr.12 35032 Marburg Germany Tel. 0049-6421-28-24930 hanneder@staff.uni-marburg.de
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________
Jürgen Hanneder via ntg-context schrieb am 26.09.2024 um 13:27:
I have a larger book, where crossreferences are made with \pagereference[label] and \at[label]. The problem is that references forward are resolved correctly, references backward result in ??. My file is complicated, so I tried to produce a simplified minimal file and everything is correct. If anyone has a solution, please let me know. Finding out the element that disturbs the references may take some time.
There are not enough information to provide you with a useful solution but you can use debugging information for further inspection. Put everything before \starttext of the following example to your document to find clues for the missing references. %%%% begin example \setupinteraction[state=start] \enabletrackers[nodes.references.show,nodes.references] \enabletrackers[nodes.destinations.show,nodes.destinations] \enabletrackers[structures.referencing,structures.referencing.*] \starttext See \pagereference[one]reference two at \at{page}[two]. \page See \pagereference[two]reference one at \at{page}[one]. \stoptext %%%% end example Wolfgang
There are not enough information to provide you with a useful solution but you can use debugging information for further inspection.
Put everything before \starttext of the following example to your document to find clues for the missing references.
%%%% begin example \setupinteraction[state=start]
\enabletrackers[nodes.references.show,nodes.references] \enabletrackers[nodes.destinations.show,nodes.destinations]
\enabletrackers[structures.referencing,structures.referencing.*]
\starttext
See \pagereference[one]reference two at \at{page}[two].
\page
See \pagereference[two]reference one at \at{page}[one].
\stoptext %%%% end example
Wolfgang
Thanks for the hint and the code. While your example runs nicely, if I run 15 pages from my book it produces log file entries not unlike in your example, but then crashes with the errors given below. Since apart from this the book works just fine, and I can always add the references by hand in the end, there is no need to pursue this too long. I am sure I have messed up a few definitions by copying from examples I did not fully understand. Best Jürgen ... structures > bookmark: The Text and its Critics structure > sectioning > section @ level 3 : 0.1.3 -> The Text and its Critics references > identifying > type '1a', reference 'internal(0)', index 1, prefix '', special 'internal', kind 'special operation' references > internal(0)={ { ["kind"]="special operation", ["operation"]="0", ["reference"]="internal(0)", ["special"]="internal", }, ["n"]=15, ["prefix"]="", ["reference"]="internal(0)", } backend > references > resolving attribute 12 backend > references > unable to resolve annotation 12 backend > references > resolving attribute 13 backend > references > unable to resolve annotation 13 backend > destinations > resolving attribute 22 backend > destinations > resolving attribute 21 backend > destinations > resolving attribute 23 pages > flushing realpage 16, userpage 16, subpage 16 tex memory > bumping category 'input' succeeded, details: all=640000 | ini=-1 | max=100000 | mem=20000 | min=10000 | ptr=10001 | set=100000 | stp=10000 | top=10001 tex memory > bumping category 'input' succeeded, details: all=960000 | ini=-1 | max=100000 | mem=30000 | min=10000 | ptr=20001 | set=100000 | stp=10000 | top=20001 tex memory > bumping category 'input' succeeded, details: all=1280000 | ini=-1 | max=100000 | mem=40000 | min=10000 | ptr=30001 | set=100000 | stp=10000 | top=30001 tex memory > bumping category 'input' succeeded, details: all=1600000 | ini=-1 | max=100000 | mem=50000 | min=10000 | ptr=40001 | set=100000 | stp=10000 | top=40001 tex memory > bumping category 'input' succeeded, details: all=1920000 | ini=-1 | max=100000 | mem=60000 | min=10000 | ptr=50001 | set=100000 | stp=10000 | top=50001 tex memory > bumping category 'input' succeeded, details: all=2240000 | ini=-1 | max=100000 | mem=70000 | min=10000 | ptr=60001 | set=100000 | stp=10000 | top=60001 tex memory > bumping category 'input' succeeded, details: all=2560000 | ini=-1 | max=100000 | mem=80000 | min=10000 | ptr=70001 | set=100000 | stp=10000 | top=70001 tex memory > bumping category 'input' succeeded, details: all=2880000 | ini=-1 | max=100000 | mem=90000 | min=10000 | ptr=80001 | set=100000 | stp=10000 | top=80001 tex memory > bumping category 'token' succeeded, details: all=8000000 | ini=553139 | max=10000000 | mem=1000000 | min=1000000 | ptr=1272890 | set=10000000 | stp=250000 | top=1000000 tex memory > bumping category 'input' succeeded, details: all=3200000 | ini=-1 | max=100000 | mem=100000 | min=10000 | ptr=90001 | set=100000 | stp=10000 | top=90001 tex memory > bumping category 'input' failed, details: all=3200000 | ini=-1 | max=100000 | mem=100000 | min=10000 | ptr=100001 | set=100000 | stp=10000 | top=100001 tex error > tex error on line 452 in file Introduction.tex: TeX capacity exceeded, sorry [input=100000] --- Prof. Dr. Juergen Hanneder Philipps-Universitaet Marburg FG Indologie u. Tibetologie Deutschhausstr.12 35032 Marburg Germany Tel. 0049-6421-28-24930 hanneder@staff.uni-marburg.de
Jürgen Hanneder via ntg-context schrieb am 27.09.2024 um 15:10:
There are not enough information to provide you with a useful solution but you can use debugging information for further inspection.
Put everything before \starttext of the following example to your document to find clues for the missing references.
%%%% begin example \setupinteraction[state=start]
\enabletrackers[nodes.references.show,nodes.references] \enabletrackers[nodes.destinations.show,nodes.destinations]
\enabletrackers[structures.referencing,structures.referencing.*]
Comment the tracker above to get rid of the reference entries in the log file and try again.
\starttext
See \pagereference[one]reference two at \at{page}[two].
\page
See \pagereference[two]reference one at \at{page}[one].
\stoptext %%%% end example
Wolfgang
Thanks for the hint and the code. While your example runs nicely, if I run 15 pages from my book it produces log file entries not unlike in your example, but then crashes with the errors given below.
Since apart from this the book works just fine, and I can always add the references by hand in the end, there is no need to pursue this too long. I am sure I have messed up a few definitions by copying from examples I did not fully understand.
Can you show these definitions, maybe it's something obvious? Wolfgang
Can you show these definitions, maybe it's something obvious?
May well be, because I still do not understand too many details. Here is the setup of the file: \enableregime[utf] \definepapersize[IeT][width=155mm, height=220mm] \setuppapersize[IeT][IeT] \setuplayout[width=fit,height=200mm,header=14pt,marking=on,backspace=13mm,topspace=15mm,headerdistance=4mm,bottomdistance=2pt,location=doublesided,setup=strict] \setupheader[leftwidth=.8\hsize,rightwidth=.8\hsize,style=\tfx] \setuppagenumbering[alternative=doublesided,location={header,right},sectionnumber=no,strut=yes, state=start] \setupheadertexts[section][pagenumber][pagenumber][chapter] \mainlanguage[en] \setupbodyfontenvironment [default][em=italic] \definefontfeature[default][default][fakecombining=yes,compose=yes,itlc=yes,protrusion=quality,expansion=quality,onum=yes] \setupbodyfont[xcharter,10pt] \setupalign[hz,hanging,tolerant] \setupinterlinespace[line=2.72ex] \clubpenalty=10000 \widowpenalty=10000 \setuptolerance[{horizontal, tolerant},{vertical, strict}] \setupwhitespace[medium] \setupindenting[yes,1.36em] \setupnotation[footnote] [alternative=serried] \setupnote[footnote][way=bypage,paragraph=yes,rule=on] \definenote [variant] [footnote] \setupnotation[variant][number=no] \setupnote[variant][way=bypage,paragraph=yes,rule=off] \setuphead [title] [style=\tfd\ss, page=yes, placehead=yes, align=right,color=darkgray] \setuphead [chapter] [style=\tfb\bf,page=right,header=none,number=no] \setuphead [section] [style=\tfa,header=none,number=no] \setuphead [subsection] [style=\tf\it,header=none,number=no] \definestartstop[verse][before={\blank\setuplines[indenting=always]\startalignment[right]\startlines}, after={\stoplines\stopalignment\blank}] \defineblank[ZitatDistance][5pt] \definestartstop[Zitat][ before={\blank[ZitatDistance] \setupnarrower[left=2pc,right=2pc] \startnarrower[left,right] \noindent}, after={\stopnarrower \blank[ZitatDistance] \indenting[next]}] \definestartstop[SmallZitat][ before={\blank[ZitatDistance] \setupnarrower[left=2pc,right=2pc] \startnarrower[left,right] \noindent,style=\tfx\setupinterlinespace}, after={\stopnarrower \blank[ZitatDistance] \indenting[next]}] \setupitemize[packed] \definedescription[Litverz][headstyle=normal, style=normal, align=flushleft, alternative=hanging, width=broad, margin=1cm, distance=1mm] % % SANSKRIT VERSES \definelines[sloka][][indenting={always, 0em}, before=\setupnarrower[left=1cm,right=2pc]\startnarrower[left,right], after=\stopnarrower] \definelines[smallsloka][][indenting={always,0em}, before=\setupnarrower[left=1cm,right=2pc]\startnarrower[left,right], after=\stopnarrower] \definedescription[patha][headstyle=normal, text={}, style=normal, align=flushleft, margin=1.3cm, style=\tfx\setupinterlinespace,before=\blank[-3mm]] \def\lem{\kern0em{}]\enskip} \setupexternalfigures[directory={images}] \setupfloats[indentnext=no] \setupheadtext[content=Contents] \setuplist[chapter][style=\tfa\bf,pagestyle=bold,numberstyle=bold,alternative=a] \setuplist[section][style=normal, alternative=d] \setupcombinedlist[content][list={chapter,section}] \definedescription[Biblio][alternative=serried, width=broad, distance=5mm, headstyle=bold] % \setupinteraction[state=start] % \enabletrackers[nodes.references.show,nodes.references] % \enabletrackers[nodes.destinations.show,nodes.destinations] % \enabletrackers[structures.referencing,structures.referencing.*] \starttext --- Prof. Dr. Juergen Hanneder Philipps-Universitaet Marburg FG Indologie u. Tibetologie Deutschhausstr.12 35032 Marburg Germany Tel. 0049-6421-28-24930 hanneder@staff.uni-marburg.de
hanneder@staff.uni-marburg.de schrieb am 28.09.2024 um 08:39:
Can you show these definitions, maybe it's something obvious?
May well be, because I still do not understand too many details. Here is the setup of the file:
There is nothing in your setups which would lead to missing references which means the problem lies somewhere in your document itself.
\enableregime[utf]
This can removed because UTF-8 is the default input encoding.
\definepapersize[IeT][width=155mm, height=220mm] \setuppapersize[IeT][IeT] \setuplayout[width=fit,height=200mm,header=14pt,marking=on,backspace=13mm,topspace=15mm,headerdistance=4mm,bottomdistance=2pt,location=doublesided,setup=strict]
1. Don't use "width=fit" unless you know what you're doing. 2. The location setting is only used when you use different page and paper sizes. 3. There is only a setups key but no setup and the argument *strict (which a * at the beginning)- \setuplayout [backspace=13mm, width=119.3mm, topspace=15mm, header=14pt, headerdistance=4mm, height=200m, bottomdistance=2pt, setups=*strict]
\setupheader[leftwidth=.8\hsize,rightwidth=.8\hsize,style=\tfx] \setuppagenumbering[alternative=doublesided,location={header,right},sectionnumber=no,strut=yes, state=start]
1. There is no sectionnumber setting. 2. The strut and state settings have these values by default. \setuppagenumbering [alternative=doublesided, location={header,right}]
\setupheadertexts[section][pagenumber][pagenumber][chapter] \mainlanguage[en]
Not necessary because english is the default language.
\setupbodyfontenvironment [default][em=italic]
Not necessary for charter because there is only a italic style, you need this only for fonts which have an italic and slanted style at the same time.
\definefontfeature[default][default][fakecombining=yes,compose=yes,itlc=yes,protrusion=quality,expansion=quality,onum=yes]
\setupbodyfont[xcharter,10pt]
\setupalign[hz,hanging,tolerant] \setupinterlinespace[line=2.72ex] \clubpenalty=10000 \widowpenalty=10000
You can remove the \clubpenalty and \widowpenalty settings when you apply the *strict (which sets both penalties) value with \setuplayout in the correct way (see above).
\setuptolerance[{horizontal, tolerant},{vertical, strict}]
Not possible in this way, you have to set the horizontal and vertical value one by one. \setuptolerance[horizontal,tolerant] \setuptolerance[vertical,strict] The horizontal setting can be even left out because you alredy set the value with \setupalign.
\setupwhitespace[medium] \setupindenting[yes,1.36em]
\setupnotation[footnote] [alternative=serried] \setupnote[footnote][way=bypage,paragraph=yes,rule=on] \definenote [variant] [footnote] \setupnotation[variant][number=no] \setupnote[variant][way=bypage,paragraph=yes,rule=off]
\setuphead [title] [style=\tfd\ss, page=yes, placehead=yes, align=right,color=darkgray]
No need for placehead=yes because this is a default value.
\setuphead [chapter] [style=\tfb\bf,page=right,header=none,number=no] \setuphead [section] [style=\tfa,header=none,number=no] \setuphead [subsection] [style=\tf\it,header=none,number=no]
You can leave "header=none" out for section and subsection because none of them start a new page. Wolfgang
participants (4)
-
hanneder@staff.uni-marburg.de
-
Henning Hraban Ramm
-
Mikael Sundqvist
-
Wolfgang Schuster