[NTG-context] Re: how can I reset section counter when recursing buffers?
Damien Thiriet via ntg-context schrieb am 01.10.2024 um 17:02: Hello, When I call a buffer with sections several times, I would like to get the same headers numbers for each buffer call. (So, in my MWE twice 1 and 2, not 1, 2, 3, 4) How can I reset the section counter within a dorecurse run? I tried \resetcounter [section] but that is not the good way. I read about \headnumber and \namedheadnumber but could'nt go further. My MWE: \startbuffer \startsection[title={foo}] \input ward \stopsection \startsection[title={bar}] \input knuth \stopsection \stopbuffer \starttext \dorecurse{2}{ % how can I reset chapter number? \setupheadnumber[section][0] Wolfgang ___ 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 ___
[NTG-context] Re: crossreferences
hanne...@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=1 \widowpenalty=1 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 ___ 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 ___
[NTG-context] Re: first line in different font
Thomas Meyer schrieb am 28.09.2024 um 11:40: Hi guys, Is it possible to set the first line of an indented paragraph in a different font? I saw it in a book. There, the first line was indented to half the line width (\setupindenting[yes, .5\textwidth]) and set in smallcaps. Yes it is possible but it stops when the indentation gets too large. There seems to be a few other problems because the spaces between the words are too wide and it gets worse with increased indentation. begin example \definefirstline [smallcaps] [alternative=line, style=\setsmallcaps] \setupbodyfont [pagella] % even with wider lines the formatting of the first line stops % \setuppapersize[A4,landscape] \starttext % \setupindenting[yes,.5tw] % \setfirstline[smallcaps] % \samplefile{lorem} \doloopoverlist{0,0.1,0.2,0.3,0.4,0.5} {\setupindenting[yes,\recursestring\textwidth] \inleft{\recursestring} \setfirstline[smallcaps] \samplefile{lorem} \blank} \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: Indexing redux
Rik Kabel schrieb am 28.09.2024 um 03:44: Hello experts, Is there a way to generate an entry without a page number in an register that has page numbers enabled? This would enabled /See also/ entries to be generated with something like \setregisterentry[TopicIndex][keys:2=zzz,entries:1=punctuation,entries:2={{\em See also} marking}]% I do see that there is an alternative key defined for the command, but no explanation of what the alternatives are and if any would help. You have to set "ownnumber=yes" but I don't think the feature is supported at the moment (or I failed to set the correct values) but you can use the following method to get rid of the pagenumber. begin example \defineregister [TopicIndex] \defineregister [SeeTopicIndex] [TopicIndex] [pagecommand=\gobbleoneargument] \starttext \samplefile{lorem} \setregisterentry[TopicIndex][entries:1=punctuation]% \samplefile{lorem} \setregisterentry[SeeTopicIndex][entries:1=punctuation,entries:2={{\em See also} marking}]% \samplefile{lorem} \placeregister[TopicIndex,SeeTopicIndex][n=1] \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: crossreferences
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 ___ 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 ___
[NTG-context] Re: index entry with sorting and processor
Marcus Vinicius Mesquita schrieb am 27.09.2024 um 06:02: Dear List, If it is possible, I would also like to know how to use a processor for the page number in the \setregisterentry command. If not, could it be implemented? Try the following example which tries to cover a few of the question asked by Hraban. When you uncomment the first part you notice a few processors are ignored when you use the same entry with and without formatting. begin example \defineprocessor [henning] [command=\Word] \defineprocessor [hraban] [color=red] \starttext % anything\setregisterentry[index][entries=anything] % % something\setregisterentry[index][entries=something] % % \page Anything\setregisterentry[index][keys=hraban->,entries=henning->anything] Something\setregisterentry[index][keys=hraban->,entries=henning->something] \page \placeindex \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: crossreferences
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 ___ 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 ___
[NTG-context] Re: Example for switching page numbering from roman to numeric in PDF outline
Florent Michel schrieb am 25.09.2024 um 00:17: Hi, After looking at it a bit more, one solution can be found in the accepted answer to this question: https://tex.stackexchange.com/questions/108676/page-numbers-roman-number-and-arabic-numerals-in-context The following example is slightly adapted from Marco's answer: ``` \usemodule[ipsum] \definesectionblock[roman][romanpages] \definestructureconversionset [roman:pagenumber] [] [romannumerals] \startsectionblockenvironment [bodypart] \setcounter [userpage] [1] \stopsectionblockenvironment \starttext \startstandardmakeup \placecontent \stopstandardmakeup \startromanpages \section{Roman numeral pages} \dorecurse{6}{\ipsum\par} \stopromanpages \startbodymatter \section{Arabic numeral pages} \dorecurse{6}{\ipsum\par} \stopbodymatter \stoptext ``` The page numbers look correct in Okular. Is there a reason why you create a new sectionblock? BTW: You can also reset userpagenumber instead of setting it back to 1 by hand. begin example \defineconversionset [frontpart:pagenumber] [] [romannumerals] \startsectionblockenvironment [bodypart] \resetuserpagenumber \stopsectionblockenvironment \starttext \startfrontmatter \completecontent \dorecurse{4} {\chapter{Chapter #1} \dorecurse{\numexpr#1*2\relax}{\samplefile{lorem}}} \stopfrontmatter \startbodymatter \dorecurse{4} {\chapter{Chapter #1} \dorecurse{\numexpr#1*2\relax}{\samplefile{lorem}}} \stopbodymatter \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: Why does text within a very simple xtable seem to not want to take up a lot of free space?
Felix schrieb am 24.09.2024 um 07:50: \setuppapersize[letter][ letter ] \setuplayout[ backspace=0.5in, topspace=0.0in, header=.5in, % No headers footer=.5in, % Space for the footer width=middle, height=middle, ] \setupbodyfont[12pt] None of the lines above are necessary to show the effect and can be removed from your example. \starttext \startxtable[frame=off,topframe=on,bottomframe=on,option=fixed,width=1tw,align=middle,] \startxrow \startxcell {\tfa\setsmallcaps \startquotation Excellence is not a skill, it's an attitude. \stopquotation - Ralph Marston } \stopxcell \stopxrow \stopxtable \stoptext inputting this code into ConTeXt LMTX 2024 will show you that text after \stopquotation will make - Ralph Marson go into a new line, but there is so much text on the sides beside the first line, that it makes me wonder why the 2nd line was even made. Did I do something wrong with my code? The quotation environment is a block elements which can contain one or more paragraphs but the environment itself can't be part of a paragraph itself with the default setup. The right command here is \quotation which just adds quotation marks around its argument. There are also a few ways to improve your table: 1. Add \setupinterlinespace after the font switch to increase the vertical space for the larger text. 2. Remove the braces before and after \tfa because each table cell is a local group where font changes won't affect another cell. 3. Move the font changes to the foregroundstyle key to keep the cell free from unnecessary markup. 4. Use an \endash (or --) because the name after the quote and don't forget "\ " after \endash to ensure there is a space after the dash. begin example \starttext \startxtable[frame=off,topframe=on,bottomframe=on,width=1tw,align=middle] \startxrow \startxcell[foregroundstyle=\tfa\setupinterlinespace\setsmallcaps] \quotation {Excellence is not a skill, it’s an attitude.} \endash\ Ralph Marston \stopxcell \stopxrow \stopxtable \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: LMTX and PDF document form German »Bundesgesetzblatt«
Ulrike Fischer schrieb am 23.09.2024 um 16:16: Am Mon, 23 Sep 2024 08:06:59 +0200 schrieb Pablo Rodriguez via ntg-context: Dear list, for some reason unknown to me, LMTX has problems with PDF documents comming form the German official gazzette. http://www.bgbl.de/xaver/bgbl/start.xav?startbk=Bundesanzeiger_BGBl&jumpTo=bgbl122s0928.pdf contains one of the documents and here is a minimal sample: \setuplayout[page] \starttext \externalfigure[bgbl_Bundesgesetzblatt Teil I_2022_Nr. 20 vom 22.06.2022_bgbl122s0928.pdf] \stoptext The source above distorts the page presentation with LMTX, but it is perfectly fine with LuaTeX. Could anyone confirm the issue? LMTX seems to clean up the included PDF and removes the tagging structure, but this is not properly done. There are still various /Artifact BMC /Span << /ActualText >> BDC without closing EMC around. (The /Span is from hyphens at the end of lines and so not part of the structure tree). The feature can be disabled with \externalfigure[...][compact=no]. Wolfgang ___ 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 ___
[NTG-context] Re: issue with "context --pages=reference"
Pablo Rodriguez via ntg-context schrieb am 21.09.2024 um 16:59: Dear list, I have the following sample (sample.tex): \setuppagenumbering[alternative=doublesided] \setuphead[chapter][reference=ch\namedheadnumber{chapter}] \starttext \dorecurse{5}{% \startchapter[title={Chapter \namedheadnumber{chapter}}] \dorecurse{\randomnumber{10}{50}} {\input zapf\par} \stopchapter} \stoptext I get no page numbers from: context --pages=ch3 sample.tex Try this (without file extension): context --pages --list=ch3 sample Wolfgang ___ 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 ___
[NTG-context] Re: Problem with context --extra=select
Am Sa., 21. Sept. 2024 um 13:31 Uhr schrieb Michael Guravage < gurav...@literatesolutions.com>: > Greetings, > > Regardless of the selection criteria, the select tool selects only the > first page. This feature works in my ConTeXt versions from 2024.05.17 and > 2024.08.13. I'm running the latest version, i.e. 2024.09.17. > > context --extra=select --selection=11:16 forexample.pdf > > I've attached the output in a log file if anyone's interested. > > Any suggestions? > You have to patch syst-aux.mkxl (or wait for a new release by Hans). 1. Add \number in front of \numexpr. 2. Change "+\plusone" at the end to "-\plusone". \def\syst_helpers_with_range_slice#1% {\splitstring#1\at:\to\m_syst_helpers_range_from\and\m_syst_helpers_range_to \ifx\m_syst_helpers_range_from\wildcardsymbol \edef\m_syst_helpers_range_from{\number\c_helpers_range_min}% \fi \ifx\m_syst_helpers_range_to\wildcardsymbol \edef\m_syst_helpers_range_to{\number\c_helpers_range_max}% \fi \ifempty\m_syst_helpers_range_to \let\m_syst_helpers_range_to\m_syst_helpers_range_from \fi \ifnum\m_syst_helpers_range_from<\zerocount \dostepwiserecurse \m_syst_helpers_range_from \m_syst_helpers_range_to {\ifnum\m_syst_helpers_range_from>\m_syst_helpers_range_to\minusone\else\plusone\fi} {%(\the\numexpr\c_helpers_range_abs_max+##1+\plusone\relax) - \m_helpers_range_action{\numexpr\c_helpers_range_abs_max+##1+\plusone\relax}}% + \m_helpers_range_action{\number\numexpr\c_helpers_range_abs_max+##1+\plusone\relax}}% \else \dostepwiserecurse \m_syst_helpers_range_from \m_syst_helpers_range_to {\ifnum\m_syst_helpers_range_from>\m_syst_helpers_range_to\minusone\else\plusone\fi} {%(\the\numexpr\c_helpers_range_abs_min+##1-\plusone\relax) - \m_helpers_range_action{\numexpr\c_helpers_range_abs_min+##1+\plusone\relax}}% + \m_helpers_range_action{\number\numexpr\c_helpers_range_abs_min+##1-\plusone\relax}}% \fi}% Wolfgang ___ 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 ___
[NTG-context] Re: How to tell a single *.tex file to produce separate PDFs?
Denis Maier via ntg-context schrieb am 20.09.2024 um 15:05: -Ursprüngliche Nachricht- Von: Wolfgang Schuster Gesendet: Freitag, 20. September 2024 12:26 An: mailing list for ConTeXt users ; Joel via ntg-context Betreff: [NTG-context] Re: How to tell a single *.tex file to produce separate PDFs? You can use the pdf script file but it's slower than mutool or pdftk. mtxrun --script pdf --split file.pdf Where will this split the pdf? At certain headers? This splits the pdf into single pages and there are no options. Wolfgang ___ 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 ___
[NTG-context] Re: How to tell a single *.tex file to produce separate PDFs?
Joel via ntg-context schrieb am 20.09.2024 um 04:57: I have a document that's quite long. It uses a recurse function, a bit like this: \starttext \dostepwiserecurse{1}{180}{1}{% \input chapter\recurselevel } \stoptext That produces 180 chapters of content. Anyway, my boss is upset she has to use a table of contents to navigate to the page she wants, and so wants me to split the file into 180 separate files, which somehow is going to be easier to look at. Honestly, she probably still won't ever actually look at it, but that's her requirement. The problem is, I've been splitting the file by using Print --> PDF and choosing a custom print range, and then saving it. If I ned to repeat that 180 times, it not only will have errors, but probably take 5-10 hours. Is there something I can put, like \breakpdf or something that will tell it to start a new PDF file? They can be named something like file1.pdf, file2.pdf, etc. \starttext \dostepwiserecurse{1}{136}{1}{% \input chapter\recurselevel \breakpdf } \stoptext The perhaps "obvious" answer is just make 180 *.tex files, but since the minimal example above is like 0.01% of the complexity of the real file, that isn't so easy... You can use the pdf script file but it's slower than mutool or pdftk. mtxrun --script pdf --split file.pdf Wolfgang ___ 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 ___
[NTG-context] Re: Table and rotation: push together 45 degree rotated cells
Gerion Entrup schrieb am 18.09.2024 um 14:44: Am Dienstag, 17. September 2024, 20:36:23 MESZ schrieb Gerion Entrup: Hi, I want to typeset a table where some of the column headings are really long, while in the columns itself consists only of numbers. Therefore, my idea was to rotate the column headings but not 90 degrees (I found some solutions for that) but 45 degree. It then would be beneficial to push together the rotated cells, so the text of one cell actually starts above the previous cell. Do you know, how to achieve that? Here is a minimal example: ``` \startsetups[table:rotated] \setupTABLE[frame=off] \setupTABLE[row][first][bottomframe=on, style=bf, align={center, low}] \setupTABLE[row][2][align=flushright] \stopsetups \starttext \define\tablerotate{\dontleavehmode\rotate[rotation=-45, location=high]} \bTABLE[setups=table:rotated] \bTR \bTD \eTD \bTD \tablerotate{Water buffalo} \eTD \bTD \tablerotate{Mexican redknee tarantula} \eTD \bTD \tablerotate{European turtle dove} \eTD \eTR \bTR \bTD Amount of legs \eTD \bTD \digits{4} \eTD \bTD \digits{8} \eTD \bTD \digits{2} \eTD \eTR \eTABLE \stoptext ``` I would like to achieve that the text "Mexican redknee tarantula" is typeset right and above of "Water buffalo" so that the single columns have a width that is similar to the width of the single digit coming in the second row. To visualize this, I patched the PDF of the above example to the desired result. See the attachment. You can use Metapost. \startuseMPgraphic{tableheader}{text,rotation} label.lft("\strut\bf\MPvar{text}",origin) rotated \MPvar{rotation} shifted (\the\strutht,0); setbounds currentpicture to unitsquare xyscaled(\the\struttotal,sin(\MPvar{rotation})*\the\widthofstring{\MPvar{text}}); \stopuseMPgraphic \starttext \bTABLE[frame=off] \bTR[align={middle,low}] \bTH \eTH \bTH[width=3em] \dontleavehmode\useMPgraphic{tableheader}{text=Water buffalo,rotation=315} \eTH \bTH[width=3em] \dontleavehmode\useMPgraphic{tableheader}{text=Mexican redknee tarantula,rotation=315} \eTH \bTH[width=3em] \dontleavehmode\useMPgraphic{tableheader}{text=European turtle dove,rotation=315} \eTH \eTR \bTR[topframe=on,align=middle] \bTD Amount of legs \eTD \bTD 4 \eTD \bTD 8 \eTD \bTD 2 \eTD \eTR \eTABLE \stoptext Wolfgang ___ 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 ___
[NTG-context] Re: (ConTeXt LMTX 2.11.05) how do I make it so that sections, descriptions, and itemizations have just a space between some of the text that they produce
Felix schrieb am 16.09.2024 um 16:24: [...] This code shows how I am getting the default spacing between the words from itemize, description, and the spacing between the roman numeral and the section title. I tried figuring out how to get the spacing for all of these to be set to a single space worth but it seems to not be possible with `distance`, because it asks for a dimension. How can I get a `\space`'s worth of spacing to be the default in descriptions, itemizations, and sections? for itemizations and descriptions the spacing seems to vary and I really don't like that. I would be thankful to know if there's a way to change the spacing. Please remove everything from your examples which isn't necessary to show the problem, in your example you can get rid of - the page layout, - the font settings, - the title page and - all settings from \setupdescription and \setuphead unrelated to the space between number/title and the text. The value you're looking for is \spaceamount which can be used with the distance-key to set the width of a space as separator. For descriptions you have to set the value of the width to fit and use the distance key to set a fixed value for the space between the title and following text, to ensure the space doesn't increase set also the shrink and stretch values to 0. begin example \definedescription [description] [alternative=serried, width=fit, distance=\spaceamount, stretch=0, shrink=0] \starttext \startdescription [title={I'm not a fan of the}] default spacing \stopdescription \stoptext end example For itemize you can use the fit keyword but be aware once you have more than 9 entries you get a bigger space between the number and content because the environment set the width of all entries to width of the widest number. begin example \starttext \startitemize[n,fit][distance=\spaceamount] \startitem I'm not a fan of the default spacing \stopitem \stopitemize \stoptext end example For section titles you just have to change the distance value. begin example \setuphead [section] [distance=\spaceamount] \starttext \startsection[title={I'm not a fan of the}] default spacing \stopsection \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: Interline spacing in tabulate paragraphs
Kirill Davidov schrieb am 15.09.2024 um 20:01: Ah, that helps. Then, one more question. I assume line=2.8ex is equivalent to single line spacing, yes? Do I therefore naively multiply that by, say, 1.5 to get 1.5 line spacing? Thanks! Yes, the default value is 2.8ex and the medium, big and numeric values (e.g. \setupinterlinespace[2]) are multiples of it but you should be aware it is depends on the font which specifies the value of ex. An alternative to the default relative setting are absolute values, e.g. \setupinterlinespace[line=16pt]. When your try to reproduce the spacing of another system like MS Word how it specifies the meaning one and half or double spacing because there is no standardized method to set the value, below are a few examples (where I tried to reproduce the MS Word settings but I can be wrong here). begin example % \definefontfamily [aptos] [rm] [Aptos Serif] % \definefontfamily [aptos] [ss] [Aptos] % % \setupbodyfont[aptos,ss] \startdocument \bold{ConTeXt 1x:} \samplefile{dijkstra} \blank \setupinterlinespace[2]% relative value \bold{ConTeXt 2x:} \samplefile{dijkstra} \blank \setupinterlinespace[line=\dimexpr\bodyfontsize+8pt\relax] \bold{Word 1x:} \samplefile{dijkstra} \blank \setupinterlinespace[line=\dimexpr1.15\bodyfontsize+8pt\relax] \bold{Word 1.15x:} \samplefile{dijkstra} \blank \setupinterlinespace[line=\dimexpr2\bodyfontsize+8pt\relax] \bold{Word 2x:} \samplefile{dijkstra} \stopdocument end example Wolfgang ___ 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 ___
[NTG-context] Re: Interline spacing in tabulate paragraphs
Florent Michel schrieb am 15.09.2024 um 17:44: Hello, It's probably not the best solution, but it seems to work on my side if I replace `big` by `2em`; see code below. When the whole document needs a larger interlinespace \setupinterlinespace[big] is the wrong method and \setupinterlinespace[line=4x] or (which is an alternative form for the one above) \setupinterlinespace[4ex] are the recommended solutions. The reason why Kirill had the problem with is that tabulate resets the interlinespace value to the global settings while "big" is just a relative value which depends on the global value. This reset is necessary because tabulate uses the global interlinespace value to split the table into slices which allows it to break cells across pages. When you need a different interlinespace for a part of the document you should use \start \setupinterlinespace[line=4ex] content which a different interlinespace setting \stop which does also work for tabulate. Wolfgang ___ 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 ___
[NTG-context] Re: Margins using 2UP imposition schema
Angel M Alganza schrieb am 14.09.2024 um 19:08: Hello: I'm composing an A5 booklet printed on an A4 paper using the 2UP imposition schema. I believe, in such case, margins should be controlled using 'backspace' and 'cutspace' options of the \setuplayout command, but I'm afraid I don't quite understand how to use those properl. I want to make the 'external' margin (right on odd pages and left on even pages) as small as possible, and the 'internal' margin larger, so that I can hole punch the booklet. I believe, in such case, margins should be controlled using 'backspace' and 'cutspace' options of the \setuplayout command, but I'm afraid I don't quite understand how to use those properly. Here's a minimal example: \setuppapersize[A5][A4] \setuparranging[2UP,rotated] \setuplayout [topspace=13pt, backspace=30pt, cutspace=-20pt, width=fit, height=fit, header=0pt, footer=0pt] \setuppagenumbering[state=stop] \setupbodyfont[small] \starttext \dorecurse{20}{\input tufte \vskip 1em} \stoptext I wonder how I could reduce the left margin and increase the left one on the even pages. Any pointers, please? Create a normal document without imposition in A5 and use afterwards the arrange extra to produce your booklet. You can get a short information block with an example when you write context --extras=arrange in the terminal. Wolfgang ___ 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 ___
[NTG-context] Re: (ConTeXt LMTX 2024, monospace font) Why does monospaced text go out of the margin for me? is this supposed to happen?
Felix schrieb am 14.09.2024 um 06:40: https://pastebin.com/2ce1xSYf The code linked above has 3 paragraphs. One in TImes New Roman, the other in Aptos and the last in Aptos Mono. The paragraph with \tt seems to go over my margin of .5 inches for the left and right side of my doc., but the serif and sans serif text doesn't. I can't seem to figure out why exactly this is. Did I set up \setuplayout incorrectly? I wanted .5in margins but I kind of 'hacked' the way I got things. Is there a better way that I could have gotten .5 inch margins and a.5in header/footer? I can't seem to understand why the output is what it is. I would greatly appreciate any help! Feel free to switch out the fonts if you'd like You're trying to justify a text with a fixed width font which fails because the often have a fixed width space. When you have a space a fixed width TeX can stretch or shrink the space between the word to align them with the right margin. The best solution is to disable justification and use ragged text on the right side. An alternative is to allow bigger spaces between words but as you can see in the following example the gaps between words can be quite large. begin example \showframe \setupbodyfont[tt] \starttext \samplefile{zapf} \blank \start \setuptolerance[space] \samplefile{zapf} \par \stop \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: ConTeXt LMTX 2024, \setupalign: Is the "Nicer justification and microtypography" list of options listed in ConTeXt Garden now obselete?
Felix schrieb am 14.09.2024 um 06:13: When I try to use a combination (example = \setupalign[normal,extremestretch,verytolerant,hangingboth,fullhz,hyphenated,] ) and just normal I seem to be getting the same result when I try to load in a big paragraph. However, there is an obvious difference between me entering (just) flushleft, normal, flushright. Have those options become obsolete? how am I supposed to know? Whether there is a difference or not depends on your text, when you have a wide text block and short words TeX can produce good results without the need for additional parameters but when you have a narrow text blocks (e.g. for text in columns) or long words you need additional settings. The example below shows how different options can result in different line breaks but not all sample text produce the same effect, sometimes you get the same result with and without verytolerant etc. Don't forget to enable expansion and protrusion before you use the hanging and hz options because they need these font features. begin example \definefontfeature [default] [default] [expansion=quality,protrusion=quality] \setuppapersize [A5] \defineframed [Example] [width=max, offset=none, framecolor=lightgray] \starttext \startprocesscommalist[normal,{normal,verytolerant},{normal,stretch},{normal,hanging},{normal,hz}] \starttitle[title=\currentcommalistitem] \startframed[Example][align=\currentcommalistitem] \samplefile{tufte} \stopframed \stoptitle \stopprocesscommalist \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: Indentation in headings
Kirill Davidov schrieb am 14.09.2024 um 08:59: Greetings, As per Russian GOST standards, numbered section headings are flush left and start with the paragraph indent. Is there a proper way to indent a section heading? The code simulates what I want visually, but it unfortunately causes the heading to poke out into the margins. That can be troublesome if the title is long enough. Example code to tinker with: [...] You have to use the narrow environment and apply it with the beforehead and afterhead command and in addition enable the aligntitle option. begin example \setupindenting [yes, 2.5em, first] \setuphead [section] [ align=flushleft, beforehead={\startnarrow[left=\parindent][left]}, afterhead=\stopnarrow, aligntitle=yes, indentnext=yes, ] \showframe \startdocument \startsection[title=Very long section title that makes you question the author's writing capabilities] \input dijkstra \stopsection \stopdocument end example Wolfgang ___ 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 ___
[NTG-context] Re: ConTeXt beginner, What should I enable within font features? And how do I see all the options possible?
Felix schrieb am 13.09.2024 um 08:02: Hello Wolfgang, so if I follow your code examp,e what if I were to edit my code to be like this: \definefontfeature[generalfeatures][default][ kern=yes, % enables kerning extrakerns=yes, % enables extra kerning trep=yes, % Enables single and double quotes to show up correctly in text, perhaps does more liga=yes, % Enables ligatures. itlc=yes, % Activates italic correction. mark=yes, % Used for positioning diacritical marks (accents, dots, etc.) relative to base characters. mkmk=yes, % positions diacritical marks relative to other marks locl=yes, ccmp=yes, % Composes multiple characters into a single glyph or breaks down ligatures. mode=node, protrusion=yes, expansion=yes, language=dflt, ] \definefontfamily [myfonts] [rm][Times New Roman] [features=generalfeatures,dlig=yes,cpsp=yes,% dlig enables times new roman ligatures, and cpsp is used by tnr, not aptos] \definefontfamily [myfonts] [ss][Aptos] [features=generalfeatures,] \definetypeface [myfonts] [mm] [math] [stixtwo] [features=generalfeatures,] \setupbodyfont[myfonts,12pt] do you think this code is flawed? Stay with the following basic setups and add only expansion or protrusion when you use the features in your document, otherwise there is no need for them. \definefontfeature [times] [default] [trep=yes,dlig=yes] \definefontfeature [aptos] [default] [trep=yes] \definefontfamily [myfonts] [rm] [Times New Roman] [features=times] \definefontfamily [myfonts] [ss] [Aptos] [features=aptos] \definefontfamily [myfonts] [tt] [Aptos Mono] [features=none] \definetypeface [myfonts] [mm] [math] [stixtwo] \setupbodyfont[myfonts,12pt] \starttext \samplefile{lorem} \stoptext Also, do you think you could explain how locl and extrakerns works? do I need to have kern=yes for it to enable? how can I test if extrakerns Is working? when I just have kern=yes enable, and then enable extra, a pdf that has a paragraph using both in code looks the same. locl is something I'm completely unsure about. 1. Many features above are part of the default set. 2. When you don't know what the effect of an opentype feature is (look at https://www.preusstype.com/techdata/features.php for a few examples) don't enable it because you can get an unexpected output in your document. It is also important to know what your font makes with the feature because like I previously mentioned Times New Roman uses dlig to produce standard ligatures which isn't what you expect here. Wolfgang ___ 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 ___
[NTG-context] Re: collector advice
jbf schrieb am 12.09.2024 um 04:21: Using the example in the ConTexT wiki for "collectors", I have as follows, to credit the person who took the photo: \setupcaption[number=no] \definecollector[example] \setcollector [example] {\leftaligned{\externalfigure[bird.jpg][width=5cm,frame=off]}} Remove \leftaligned. \setcollector [example] [corner={right,bottom},location={left,top}] {\rotate[rotation=90]{\framed[frame=off]{\tfx Taken by Kathy Luck, used with permission}}} \placefigure [] [] {} {\composedcollector{example}} \placefigure {} {\leftaligned{composedcollector{example}}} or just \leftaligned{composedcollector{example}} Wolfgang ___ 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 ___
[NTG-context] Re: how do I get the correct page numbers and do the calculations with it?
ai2472206...@yeah.net schrieb am 11.09.2024 um 04:22: Thank you for your careful and patient explanation. I'll check my code again. Because it's still very simple, and some situations haven't been taken into account. In particular, the condition judgment to split the part of the box. I run your code and already found a few example where it fails, e.g. - when you have a very short text it is spread over the while line and you get a line break at the end - when you use it in the narrower environment you don't compensate the left/right indentations Regarding the part about referencing commands, I inadvertently forgot to delete it. I have a question about the command "\warichuparameter\c!XXX" : Why can we use "\warichuparameter\c!XXX" instead of "\warichuparameter{XXX}" in most cases, but in some cases, it says that the command is not defined? For example, \warichuparameter\c!pointstyle --> Control sequence expected instead of undefined I've used "\warichuparameter\c!XXX" before, but it causes the error because there are some keys that are specifically named. For the sake of stylistic consistency, I used "\warichuparameter{XXX}" for all command. Maybe it's because I didn't define it? Should I define the following in advance? %%% \def\c!pointstyle{pointstyle} %%% Yes, these constants are predefined to have language dependent keys in the setup command, e.g. \setupitemize[width=1cm] is written as \stelleaufzaehlungein[breite=1cm] with the german interface. To ensure you use the correct name for the key you use \c!width as argument for the \xxxparameter command. While you can use \def\c!...{...} to create a new constant the proper method is to use \setinterfaceconstant. You can run the following example to get a list with a predefined constant. When you uncomment the first three lines you see the new entry also appears in the list. begin example % \startinterface all % \setinterfaceconstant {pointstyle} {pointstyle} % \stopinterface \setuplayout[tight] \starttext \startluacode context.startcolumns({n=3}) for constant, _ in table.sortedpairs(interfaces.constants) do context.mono(constant) context.par() end context.stopcolumns() \stopluacode \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: how do I get the correct page numbers and do the calculations with it?
Bruce Horrocks schrieb am 11.09.2024 um 00:35: On 10 Sep 2024, at 19:47, Wolfgang Schuster wrote: You can't use page counters in running text without problems because you're working against the way how TeX constructs pages. The only reliable way are multipass solutions like the pagestate or reference mechanism. If commands such as \pagenumber and \userpagenumber don’t work reliably then maybe the commands should be removed? Just a thought. They work without problems when you use them to show the pagenumber in the header/footer because these elements are added when the page is finished and the values don't change anymore. What doesn't works is to use them to print the number of the current page within running text because TeX collects more text than it can fit on a single page which can result in the number of the previous page when the text is moved to the next one. Wolfgang ___ 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 ___
[NTG-context] Re: how do I get the correct page numbers and do the calculations with it?
ai2472206...@yeah.net schrieb am 10.09.2024 um 06:05: 1. The usage of the command "\definepagestate " is what I searched for in previous posts and source files. I don't know exactly how he used it. (╥﹏╥) 2. I've devised a command that needs to get the current page number to determine if it's an odd or even page. This is then used to get a certain width to determine the width of the command on that line. Below I designed the command. The code related to this issue is mainly %%% code related to this issue \rest@linewidth=\dimexpr% \ifdoublesided% if singlesided restlinewidth = oddpos - xpos \ifodd\pageno% if doublesided \oddpos@warichu% and if odd restlinewidth = oddpos - xpos \else\evenpos@warichu\fi%and if even restlinewidth = evenpos - xpos \else\oddpos@warichu \fi% -\MPx\xpos@warichu\relax% %%% main code \unprotect \installnamespace {warichu} \installsimplecommandhandler \warichu {warichu} \warichu \setupwarichu[style=\ssxx, voffset=-1.5pt, distance=\hskip1pt\relax, left={},right={}, reference=,] There is no need to set empty default values \warichuparameter checks if there is value. \newcount\cnt@warichu \newdimen\rest@linewidth \newdimen\oddpos@warichu \newdimen\evenpos@warichu The current naming system for count and dimen register is - \c_xxx (e.g. \c_warichu_n) for counters and - \d_... (e.g. \d_warichu_odd) for dimensions. We also use underbar instead of @ to create internal commands names. \oddpos@warichu =\dimexpr\backspace+\textwidth\relax \evenpos@warichu=\dimexpr\paperwidth-\cutspace\relax You have to do these assignment in your \warichu command because now you use the current values for \textwidth etc. which is a problem when you create a module for your command. When you load the module the register for the odd and even values use whather was set for \textwidth etc. when you loaded the module. This means you have to always change the layout of the document before you load the module, otherwise the text width of the document can be different from the one used in your module to calculate both values. \def\get@split@box#1{% \setbox\scratchboxone\hbox{% \hsplit\scratchbox % to #1% shrinkcriterium 1% \par\allowbreak}% \box\scratchboxone} \def\warichu{\dosingleempty\warichu@indeed} \def\warichu@indeed[#1]#2{\begingroup% You can drop the two-step definition for optional parameters when you use the \tolerant for the command definition. \tolerant\def\warichu[#1]#:#2% {...} \global\advance\cnt@warichu by 1\relax% You don't need % at the end when you end the line with a command (e.g. \relax). \iffirstargument\setupwarichu[#1]\fi% Change this to \ifparameter#1\or\setupwarichu[#1]\fi when you use \tolerant or drop the check for the optional parameter and just use \setupwarichu[#1]% \warichuparameter{distance}% I would change this to \hskip\warichuparameter\c!distance\relax and set the distance value as \setupwarichu[distance=1pt] \warichuparameter{left}% Can be changed to (no need for %) \warichuparameter\c!left \pagereference[warichu:\number\cnt@warichu]% may be useful \textreference[\warichuparameter{reference}]{\warichuparameter{reference}}% Do you need both references (what even is the purpose of \textreference here)? You should also add \dontleavehmode at the start of \warichu because references (and also the following \xypos) whould be part of a paragraph. \xypos{warichu:\number\cnt@warichu}% \edef\xpos@warichu{warichu:\number\cnt@warichu}% You can change the order of both lines: \edef\xpos@warichu{warichu:\number\c_warichu_n}% \xypos\xpos@warichu \rest@linewidth=\dimexpr% \ifdoublesided% if singlesided restlinewidth = oddpos - xpos \ifodd\pageno% if doublesided \oddpos@warichu% and if odd restlinewidth = oddpos - xpos \else\evenpos@warichu\fi%and if even restlinewidth = evenpos - xpos \else\oddpos@warichu \fi% -\MPx\xpos@warichu\relax% \setbox\scratchbox\hbox{\usewarichustyleandcolor\c!style\c!color #2\relax}% \raise\warichuparameter{voffset}\relax% \vbox{\offinterlineskip% \get@split@box{\the\rest@linewidth}% \get@split@box{\the\rest@linewidth}}\allowbreak% \doloop{% \ifdim\wd\scratchbox>\dimexpr\textwidth*2\relax% \raise\warichuparameter{voffset}% \vbox{\offinterlineskip% \get@split@box{\the\textwidth}% \get@split@box{\the\textwidth}}\allowbreak% \else% \raise\warichuparameter{voffset}% \vbox{\offinterlineskip% \get@split@box{\dimexpr\wd\scratchbox/2+1pt\relax}%
[NTG-context] Re: how do I get the correct page numbers and do the calculations with it?
Bruce Horrocks schrieb am 09.09.2024 um 23:27: On 9 Sep 2024, at 08:57, ai2472206...@yeah.net wrote: As the title suggests, how do I get the correct page numbers? There does seem to be an anomaly here. Simpler MWE: \starttext \dorecurse{15}{ \input knuth %{\ssd\color[red]{\pagenumber}} % not as expected {\color[red]{\pagenumber}} % as expected } \stoptext With the \ssd the first number at the top of the second and subsequent pages is one less than it should be. Without the \ssd then the numbers are as expected. @Muyik: Are you able to use \pagenumber without using \ssd or similar to change the size? That might be a work-around for you. There is also \userpagenumber. You can't use page counters in running text without problems because you're working against the way how TeX constructs pages. The only reliable way are multipass solutions like the pagestate or reference mechanism. Wolfgang ___ 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 ___
[NTG-context] Re: how do I get the correct page numbers and do the calculations with it?
ai2472206...@yeah.net schrieb am 10.09.2024 um 06:05: 1. The usage of the command "\definepagestate " is what I searched for in previous posts and source files. I don't know exactly how he used it. (╥﹏╥) 2. I've devised a command that needs to get the current page number to determine if it's an odd or even page. This is then used to get a certain width to determine the width of the command on that line. Below I designed the command. The code related to this issue is mainly You have to differentiate between odd and even and right hand and left hand pages. When you want to check whether you have an right hand or left hand page you can use the following method. To get the correct result ensure you start a paragraph before you set the flag with \signalrightpage. begin example %\setuppagenumbering[alternative=doublesided] %\setuppagenumbering[alternative={singlesided,doublesided}] \starttext \dorecurse{20} {\dontleavehmode\signalrightpage\doifelserightpage{\bold{Right page}}{\bold{Left page}} \samplefile{lorem}} \stoptext end example To have a check which works for odd and even pages you have to use the pagestate mechanism. Even in this case it is important to start a paragraph before save the current state, afterwards you can check the stored pagenumber. begin example \definepagestate[warichu] \starttext \dorecurse{20} {\dontleavehmode\autosetpagestate{warichu}% \ifodd0\autopagestaterealpage{warichu}% \bold{Odd page} \else \bold{Even page} \fi \samplefile{lorem}} \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: What could possibly be wrong with 'P'?
jbf schrieb am 10.09.2024 um 02:36: Here is a really odd one that I have a simple workaround for, but for the life of me I cannot work out why this is happening. Is 'p' (or 'P') some sort of restricted letter in certain circumstances? Here is the issue: \startdocument [metadata:author={Author name}, metadata:title={Psalms}] 1. This is *not* a complete minimal working example. 2. The following example works (with and without \setupinteraction) here with the latest version. \setupinteraction[state=start] \startdocument [metadata:author={Author name}, metadata:title={Psalms}] Psalms. \stopdocument And I get an error. Document will not compile. Any other initial letter than 'p' (in Psalms) does not produce the error. So if I do something like: \startdocument [metadata:author={Janet Dawson}, metadata:title={~Psalms}] Then I no longer get the problem. Which just seems to confirm the fact that it is the initial letter 'p' that is the problem. I can also change the spelling of 'psalms' (anything really, asalms, xsalms) and there is no problem, but of course that would be silly. I have never had this issue before, so while it looks like 'p' is the problem (it can hardly be the Psalms!), it is possibly something else, but what, I would not know. If it helps, I am calling in that metadata:title in the header in the usual way, e.g.: \setupheadertexts [ ] [{\getmarking[chapter]\hskip1em \pagenumber}] [] [ {\pagenumber \hskip1em \documentvariable{metadata:title}}] But that should not be a problem. The \hskip is a problem because the commands is looking for additional parameters and when it encounters the "p" at the beginning of metadata:title it assumes you set the plus parameter. To prevent the error either add a \relax after the dimension (i.e. \hskip1em\relax) or use \quad which inserts a horizontal space of 1em. Wolfgang ___ 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 ___
[NTG-context] Re: how do I get the correct page numbers and do the calculations with it?
ai2472206...@yeah.net schrieb am 09.09.2024 um 09:57: Thank to all who answered my questions before. As the title suggests, how do I get the correct page numbers? For example, in the example below, the first line on the 2nd page, but the page number showed is 1, In the meantime, I tried using \definepagestate, but it didn't seem to work either. What I can think of is to use citations to get the correct page number. But it seems that what is obtained is not a pure number, and it cannot do the calculations. so ,how do I get the correct page numbers and do the calculations with it? 1. You save only 1 pagestate with index 0 but you try to access the data of the pagestates with index 1 to 10. 2. What do you try to achieve here? Wolfgang ___ 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 ___
[NTG-context] Re: Is \not still supported?
Hans Hagen schrieb am 08.09.2024 um 20:21: On 9/8/2024 5:19 PM, Wolfgang Schuster wrote: Hi, is the \not command still supported in math mode or should users replace it with the combined form, e.g. \notin instead of \not\in. begin example \starttext \im{x \in M} \im{x \notin M} \im{x \not\in M} \stoptext end example indeed, because old school \not was a symbols that got overlayed. we could of course make some clever not but i hav eto discuss that with MS .. if there are \not cases at all My main reason for the question was to get clarification about the status of the command. Using the proper commands (e.g. \notin) was always the better choice because they produce better output than \not does. Wolfgang ___ 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 ___
[NTG-context] Is \not still supported?
Hi, is the \not command still supported in math mode or should users replace it with the combined form, e.g. \notin instead of \not\in. begin example \starttext \im{x \in M} \im{x \notin M} \im{x \not\in M} \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: Steps to become a ConTeXt developer
Hans Hagen via ntg-context schrieb am 28.08.2024 um 20:18: On 8/28/2024 5:06 PM, Henning Hraban Ramm wrote: There’s also the scite module that uses SciTE’s lexers for syntax highlighting. The builtin highlighters are limited to TeX/ConTeXt, MetaPost, Lua and XML. They are actually just lpeg lexers that we made for use in scite so no scite installation is needed. Which highlighter should extended when support for additional languages is needed, the built-in one or the scite version? Wolfgang ___ 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 ___
[NTG-context] Re: ConTeXt beginner, What should I enable within font features? And how do I see all the options possible?
Felix schrieb am 05.09.2024 um 22:58: https://pastebin.com/245uwYj4 I have this setup for my fonts, called myfonts. I assume that `\definefontfeature [default] [default] [trep=yes,dlig=yes,itlc=yes]` will affect every single font that goes into my preamble (Forgive me if I seem incompetent, I am a beginner at ConTeXt) It is applied to all fonts which use the "default" feature set and which enabled after you made the changes. In the following example only pagella uses the "trep" feature because modern was loaded before the settings was added to the default feature set. begin example \starttext \setupbodyfont[modern] a'b \definefontfeature [default] [default] [trep=yes] \setupbodyfont[pagella] a'b \stoptext end example To be on the save side create custom feature set where you add additional settings and apply these to your fonts. begin example \definefontfeature [MyFeatures] [default] [trep=yes] \definefontfamily [OldTimes] [rm] [Times New Roman] \definefontfamily [NewTimes] [rm] [Times New Roman] [features=MyFeatures] \starttext \setupbodyfont[OldTimes] a'b \setupbodyfont[NewTimes] a'b \stoptext end example I have dlig and trep on so that works with single quotations like don't have a directional quote, and so that I get the Times New Roman ligatures via dlig and not just liga. itlc is enabled since I read some documentation and they sometimes mention enabling it It shouldn't be necessary to add "itlc" anymore to get italic correction for \em etc. is there some stuff like the extrafeatures option or anything that you would recommend i enable? might there be options for extrakerns that would be seen as something that one should enable? also, how can I see all the options available? dlig is something I discovered by accident that was not in the options list in the documentation. Unless you know the effect of a feature you shouldn't add or enable it. You even have to know what is supported by the fonts in your document which can differ between certain versions of a font, take Times New Roman which is included with Windows as an example. 1. For a long time ligatures weren't supported by the font at all and the first mention of the support it is from 2022. 2. The font uses the "dlig" feature to enable the f ligatures even though the normal tag for it is "liga". My guess why they made this decision is backwards compatibility with existing document to avoid them from using these ligatures. 3. You shouldn't enable "dlig" by default for all fonts because the results of the feature can vastly for the fonts which provide it, take the following two fonts as example. begin example \definefontfeature [discretionary-ligatures] [dlig=yes] \starttext \startbuffer[pagella] \starttabulate[|||] \NC \type{} \EQ \NC\NR \NC \type{--} \EQ -- \NC\NR \NC \type{!`} \EQ !` \NC\NR \NC \type{!‘} \EQ !‘ \NC\NR \NC \type{?`} \EQ ?` \NC\NR \NC \type{?‘} \EQ ?‘ \NC\NR \NC \type{,,} \EQ ,, \NC\NR \NC \type{‘‘} \EQ ‘‘ \NC\NR \NC \type{’’} \EQ ’’ \NC\NR \NC \type{---} \EQ --- \NC\NR \stoptabulate \stopbuffer \setupbodyfont[pagella] \start \nohyphencollapsing \getbuffer[pagella] \stop \start \nohyphencollapsing \feature[+][discretionary-ligatures] \getbuffer[pagella] \stop \startbuffer[dejavuserif] \starttabulate[|||] \NC \type{ſt} \EQ ſt \NC\NR \NC \type{st} \EQ st \NC\NR \stoptabulate \stopbuffer \setupbodyfont[dejavu] \start \getbuffer[dejavuserif] \stop \start \feature[+][discretionary-ligatures] \getbuffer[dejavuserif] \stop \stoptext end example The only additional features which can be added without problems are "expansion" and "protrusion" because until you enable them with \setupalign nothing changes in your document. Wolfgang ___ 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 ___
[NTG-context] Re: \ldot and \ldotp not working
Aditya Mahajan schrieb am 04.09.2024 um 05:58: Hi, With context 2024.08.16 the following gives an error: \starttext $A \ldot B$ \stoptext tex error > tex error on line 2 in file ./test.tex: Control sequence expected instead of undefined $A \ldot B$ Same error with `\ldotp`. However \starttext \show\ldot \show\ldotp \stoptext gives \ldot=permanent \Umathchar"02"00"2E \ldotp=permanent \Umathchar"06"00"2E which appears correct. So, not sure what is going on. Any ideas? I have no idea what's the cause for the error but I can narrow it down. When you replace \ldot with it's mathchar version you can reproduce the error when there is *no* space at the end, \ldots on the other hand has no problem without the space. \starttext No space at the end of \tex{Umathchar}: $\Umathchar"19"00"002026\Umathchar"19"00"002026 $ % \ldots Space at the end of \tex{Umathchar}: $\Umathchar"19"00"002026 \Umathchar"19"00"002026 $ % \ldots No space at the end of \tex{Umathchar}: % $\Umathchar"02"00"2E\Umathchar"02"00"2E $ % \ldot Space at the end of \tex{Umathchar}: $\Umathchar"02"00"2E \Umathchar"02"00"2E $ % \ldot \stoptext Wolfgang ___ 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 ___
[NTG-context] Re: Is there an alternative to \reference[]{} that won't interfere with the document design?
Jürgen Hanneder via ntg-context schrieb am 31.08.2024 um 17:27: I recently learned not to leave a space before and after \reference , but have not seen further complex problems as you describe so far. Can you give more specific examples for these, I have to check, because I am also finalising a book at the moment. References need an anchor to know on which page they end up because a page is finished you don't know the answer. The following example sets three references, one and three marks the start of each paragraph but where should two end up? begin example \usemodule[visual] \setuppapersize[A6,landscape] \setupwhitespace[line] \starttext \showmakeup[hbox] \pagereference[one]\fakelines{10}{10} \pagereference[two] \pagereference[three]\fakelines{10}{10} \page \showmakeup[reset] \starttabulate \NC one \NC \at[one] \NC\NR \NC two \NC \at[two] \NC\NR \NC three \NC \at[three] \NC\NR \stoptabulate \stoptext end example When you process the example you get page 1 as output, but why is this the case. Take a look the the tracing information and you can see a "H" at the left bottom on page 1 which is missing on page 2, this is where ConTeXt places reference two. You get this "H" mark because \pagereference starts a new paragraph to ensure the is a anchorpoint but as a side effect you can end up with unwanted empty lines in your document, to test this change the argument of the first \fakelines from 10 to 12 and now the stray "H" appears at the top left on the second page but in addition you get 2 empty lines at the top (1 for the reference and another 1 for the parskip). Wolfgang ___ 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 ___
[NTG-context] Re: Combining styles (especially bold and italic)
Gerion Entrup schrieb am 03.09.2024 um 18:28: Hi, I have the situation that I want to typeset a special formatted name within a section heading. The name contains an italic part while the heading is bold, but both styles are defined at another place. Is there a way to tell ConTeXt to combine them, so that it is bold _and_ italic? Here is a minimal example: ``` \define\somename{HX\style[italic]{print}\autoinsertnextspace} You want \italicface (or \style[italicface]) which selects either \it or \bi. \define\somename{HX{\italicface print}\autoinsertnextspace} or \define\somename{HX\style[italicface]{print}\autoinsertnextspace} Wolfgang ___ 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 ___
[NTG-context] Re: (ConTeXt LMTX) How do I fix the centering and setting up width in xtables?
Felix schrieb am 01.09.2024 um 20:54: https://pastebin.com/TQdzmxeP I am trying to make a resume in ConTeXt (to see how well my skills have gotten, I am still quite a beginner) and Iw as able to produce what is in Pastebin. Though, I am having trouble with the table that goes over the big sized text that would be my name. It has an email, a phone number, and an address but they are all aligned very weirdly. I want them to be centered. Though, the phone number has some sort of problem with alignment, and I don;t know fi the other ones are causing it or are also aligned wrong. I also wanted to make this code: \startxcell[topframe=on,bottomframe=on,align=flushright] Ability to communicate strongly and effectively, being a reliable team member, supporting a team whenever needed, and the desire to help everyone \stopxcell has it so that it doesn't take up so much horizontal space (Ideally it is taking up 1/3 of the width I am allowing for since there are three rows in total) , but when I add width={some value} into the square brackets, it will add a blank line after all the text, and this is not what I want. You have to add "option=fixed" to the cell with the width setting. begin example \starttext \startxtable[option=stretch] \startxrow \startxcell text text \stopxcell \startxcell[width=8cm] \samplefile{ward} \stopxcell \stopxrow \stopxtable \startxtable[option=stretch] \startxrow \startxcell text text \stopxcell \startxcell[option=fixed,width=8cm] \samplefile{ward} \stopxcell \stopxrow \stopxtable \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: (ConTeXt LMTX) How do I fix the centering and setting up width in xtables?
Felix schrieb am 01.09.2024 um 20:54: https://pastebin.com/TQdzmxeP I am trying to make a resume in ConTeXt (to see how well my skills have gotten, I am still quite a beginner) and Iw as able to produce what is in Pastebin. Your next lesson is to learn how to create a minimal example which contains only the necessary information needed to show the problem. Though, I am having trouble with the table that goes over the big sized text that would be my name. It has an email, a phone number, and an address but they are all aligned very weirdly. I want them to be centered. Though, the phone number has some sort of problem with alignment, and I don;t know fi the other ones are causing it or are also aligned wrong. I also wanted to make this code: \startxcell[topframe=on,bottomframe=on,align=flushright] Ability to communicate strongly and effectively, being a reliable team member, supporting a team whenever needed, and the desire to help everyone \stopxcell has it so that it doesn't take up so much horizontal space (Ideally it is taking up 1/3 of the width I am allowing for since there are three rows in total) , but when I add width={some value} into the square brackets, it will add a blank line after all the text, and this is not what I want. is there a way to fix what I am experiencing? I would also not mind if I could be told how to improve my code, whether it be by adding startxrowgroup, startxcellgroup, or head and footer sections., or other options. Thank you for reading. Your problem the usage of "option=stretch" to add filler space in the table cells. To calculate the space which is added in each cell context takes the widest text in each column to calculate the current width of the table and when table is narrower then the page it distributes the reaming spaces equally to all rows. This results in a different width for each row but another problem in your case is that context takes the long text in the first row (even though it spans three column) as value to compute the reaming space in the table. The fix for your case is to set a fixed width for all three column which ensures the text in the second column is centered. You can also simplify your setup by moving all settings at the start of the table and the only local change is needed for the merged cells. begin example \starttext % width=.33tw \startxtable[frame=off,topframe=on,bottomframe=on,width=.33tw,align=middle] \startxrow \startxcell[nx=3] contact information \stopxcell \stopxrow \startxrow \startxcell email \stopxcell \startxcell phone \stopxcell \startxcell address \stopxcell \stopxrow \stopxtable % option=stretch \startxtable[frame=off,topframe=on,bottomframe=on,option=stretch,align=middle] \startxrow \startxcell[nx=3] contact information \stopxcell \stopxrow \startxrow \startxcell email \stopxcell \startxcell phone \stopxcell \startxcell address \stopxcell \stopxrow \stopxtable \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: Is there an alternative to \reference[]{} that won't interfere with the document design?
Joel via ntg-context schrieb am 31.08.2024 um 16:37: I had to place \reference[]{} in various places in my document as I need to refer to page numbers of a lot of various items in the document. There are hundreds of these. When placing them, I hadn't realized it would impact the document design--I assumed such a command would be invisible. Though I've tried placing as many inside the section titles, where they become invisible, I've found just placing \reference[]{} anywhere on a page will create extra blank spaces, leading my document to expand from 440 lines to 448. It added up quite quickly to 8 whole pages. No matter how much I use % or try to hide it within the page, it still produces weird results. It isn't invisible, its doing things to the document, moving text around, leaving gaps. In addition, it makes the document look haphazard, creating random formatting "glitches". I'm assuming because \reference has a curly bracket {} that its causing something to be rendered, even it its not really something visible always, it often makes a carriage return on the page if placed say after a table, or before a section title. Sadly, the way the document was designed I don't have a way to integrate them inside the section titles everywhere, there are too many and some need to mark a specific page within a section. I haven't placed anything inside the {} and only use the square brackets to mark the reference name. Is there an alternative command that won't occupy space like this? Did you learn anything from the answers of your last question [1] with similar content? Hint: Minimal example! [1] https://www.mail-archive.com/ntg-context@ntg.nl/msg108092.html Wolfgang ___ 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 ___
[NTG-context] Re: BUG REPORT: Italic Correction in ConTeXt LMTX
Jim schrieb am 29.08.2024 um 21:19: Hans (et al), I'm a couple of days late to this party, but none of the above suggestions give me any italic correction. I updated my ConTeXt today, but the fact that the first one doesn't work didn't surprise me, given your last sentence. However, since the second two don't work, can anyone speculate as to what I might be doing wrong? Or, did I somehow misinterpret what "There are three ways:" means? Italic correction is fixed (for \/ and \italiccorrection) but there hasn't been a new context release since then. The \em variant didn't work because it inserts \/ (which was broken) at the end of the text. Wolfgang ___ 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 ___
[NTG-context] Re: Defining mathsymbols from unicode char
Jethro Djan schrieb am 29.08.2024 um 21:27: Dear all, 1. I am trying to define the "pitchfork" unicode character(https://unicodeplus.com/U+22D4) to use in ConTeXt as stated on page 387 of new math manual authored by Hans and Mikael: \definemathsymbol[pitchfork][relation]["22D4] It works with some unicode characters and not others (like this character). What can I do to make it work? 1. You forgot to provide a minimal example to reproduce the problem. 2. You need a math which contains the symbol because you can't expect to get each symbol with all of them. You can run the following sample to see which font contains \pitchfork. begin example \starttext \doloopoverlist {antykwa, antykwa-light, antykwa-cond, bonum, cambria, concrete, dejavu, ebgaramond, erewhon, iwona, iwona-light, koeieletters, kpfonts, kurier, kurier-light, libertinus, lucida, modern, pagella, schola, stixtwo, termes, xcharter} {\mono{\recursestring:} \begingroup \switchtobodyfont[\recursestring] \im{\pitchfork} \endgroup \par} \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: Help with Metapopst code
Shiv Shankar Dayal schrieb am 28.08.2024 um 12:23: I don't know where you found the code, but the answer to "What is (0, r) rotated (a *i) doing?" is that it takes the point (0,r) and rotates it a*i degrees. I do not understand the concept of rotating a point. It is rotated with respect to what reference? You rotate around a point with the x and y coordinates 0. The blue dot shows the point with the coordinates 0. The green dot is rotated around this point. \starttext \startMPcode drawdot (0,0) withpen pencircle scaled 5mm withcolor blue; draw fullsquare scaled (4cm) withcolor red; \stopMPcode \startMPcode drawdot (0,0) withpen pencircle scaled 5mm withcolor blue; drawdot (1.5cm,0) withpen pencircle scaled 5mm withcolor green; draw fullsquare scaled (4cm) withcolor red; \stopMPcode \startMPcode drawdot (0,0) withpen pencircle scaled 5mm withcolor blue; drawdot (1.5cm,0) rotated (30) withpen pencircle scaled 5mm withcolor green; draw fullsquare scaled (4cm) withcolor red; \stopMPcode \startMPcode drawdot (0,0) withpen pencircle scaled 5mm withcolor blue; drawdot (1.5cm,0) rotated (60) withpen pencircle scaled 5mm withcolor green; draw fullsquare scaled (4cm) withcolor red; \stopMPcode \startMPcode drawdot (0,0) withpen pencircle scaled 5mm withcolor blue; drawdot (1.5cm,0) rotated (90) withpen pencircle scaled 5mm withcolor green; draw fullsquare scaled (4cm) withcolor red; \stopMPcode \stoptext Wolfgang ___ 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 ___
[NTG-context] Re: Questions regarding fonts: obliques (fake italics), ligatures and kerning
Gerion Entrup schrieb am 27.08.2024 um 23:29: Am Dienstag, 27. August 2024, 22:30:16 MESZ schrieb Wolfgang Schuster: Gerion Entrup schrieb am 27.08.2024 um 21:28: Hi, I played around with different fonts, especially Bitstream XCharter and Overpass (http://overpassfont.org/) and wanted to combine them. However, I see some issues regarding ligatures, kerning and obliques/italics. Here is a minimal example: ``` \definefontfeature[default][mode=node, kern=yes, liga=yes] % more features % [mode=node, kern=yes, liga=yes, tlig=yes, itlg=yes, ccmp=yes, language=dflt, protrusion=quality, expansion=quality] There is no need to set default features like ligatures and kerning, the better alternative here is to use \definefontfeature [default] [default] [protrusion=quality,...] which adds additional settings to the default set. \definefontfamily [myfont][roman][xcharter] \definefontfamily [myfont][sansserif][overpass][rscale=0.93] \definefontfamily [myfont][teletype][overpass][rscale=0.93] \definefontfamily [myfont][mono][overpassmono][rscale=0.93] \definetypeface [myfont][mathematics][math] [xcharter] \setupbodyfont[myfont, 11pt] \startTEXpage \showfontkerns Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}\\ \style[sans]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}}\\ \style[mono]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}}\\ \showbodyfont[myfont] \stopTEXpage ``` It produces the PDF in the attachment. I'm struggling with several things: - xcharter seems to have no kerning applied. It is listed as font feature, though. Is it correct to have no kerning at all for that font? The font has kerning information but none for characters in the ASCII range. Good to know. Especially for the "Va" in "Vase", I expected kerning (it looks not equally spaced currently). - xcharter also have no ligatures (at least it doesn't look like that). That is listed as font feature, too, although only for italic and slanted. According to https://tug.org/FontCatalogue/xcharter/ there are ligatures in the font. There are ligatures for ff[il]. They are defined in the font, but they are not used in the PDF output, aren't they? For example in the "ffi" in "Effizient" the "f" is not connected with the "i", while the ligature glyph has a connection there. You have to change the value of the script tag because the don't set them for the dflt script. \definefontfeature[default][default][script=latn] \definefontfamily[myfont][rm][xcharter] \setupbodyfont[myfont] \showmakeup[glyph] \starttext ff fi fl ffi ffl fb fh fk \feature[-][ligatures] ff fi fl ffi ffl fb fh fk \stoptext I attached a screenshot for comparison. The ligature was generated with "\ShowCompleteFont{name:xcharter*default}{11pt}{1}" (with the fnt-10 module). It is, however, noticeable that the whole xcharter font is thicker in the output of \ShowCompleteFont. Is this part of the reason? When you load a font by name use one which is listed in the table you get with "mtxrun --script fonts --list --all --pattern=xcharter*". In this case the table is identifier familyname fontname filename subfont instances xcharterbold xcharter xcharterbold XCharter-Bold.otf xcharterbolditalic xcharter xcharterbolditalic XCharter-BoldItalic.otf xcharterboldslanted xcharter xcharterboldslanted XCharter-BoldSlanted.otf xcharteritalic xcharter xcharteritalic XCharter-Italic.otf xchartermath xchartermath xchartermath XCharter-Math.otf xchartermathbold xchartermathbold xchartermathbold XCharter-Math-Bold.otf xchartermathmedium xchartermath xchartermath XCharter-Math.otf xchartermathregular xchartermath xchartermath XCharter-Math.otf xcharternormal xcharter xcharteritalic XCharter-Italic.otf xcharterregular xcharter xcharterroman XCharter-Roman.otf xcharterroman xcharter xcharterroman XCharter-Roman.otf xcharterslanted xcharter xcharterslanted XCharter-Slanted.otf and as you can see there is no entry "xcharter". In your case context loaded the bold version of the font but when you use "xcharterroman" as name the document shows the normal upright version. - Overpass has a glyph for the ae ligature. Is it normal that it is not used as a ligature for ae? This seems to be a stupid decision to replace ae by default with a ligature, maybe dependent on the language but not for all of them. Ok, I've seen it here as (somewhat) common ligature: https://en.wikipedia.org/wiki/Ligature_(writing)#Computer_typesetting But there is also mentioned that TeX just has ff, fi
[NTG-context] Re: Questions regarding fonts: obliques (fake italics), ligatures and kerning
Gerion Entrup schrieb am 27.08.2024 um 21:28: Hi, I played around with different fonts, especially Bitstream XCharter and Overpass (http://overpassfont.org/) and wanted to combine them. However, I see some issues regarding ligatures, kerning and obliques/italics. Here is a minimal example: ``` \definefontfeature[default][mode=node, kern=yes, liga=yes] % more features % [mode=node, kern=yes, liga=yes, tlig=yes, itlg=yes, ccmp=yes, language=dflt, protrusion=quality, expansion=quality] There is no need to set default features like ligatures and kerning, the better alternative here is to use \definefontfeature [default] [default] [protrusion=quality,...] which adds additional settings to the default set. \definefontfamily [myfont][roman][xcharter] \definefontfamily [myfont][sansserif][overpass][rscale=0.93] \definefontfamily [myfont][teletype][overpass][rscale=0.93] \definefontfamily [myfont][mono][overpassmono][rscale=0.93] \definetypeface [myfont][mathematics][math] [xcharter] \setupbodyfont[myfont, 11pt] \startTEXpage \showfontkerns Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}\\ \style[sans]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}}\\ \style[mono]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}}\\ \showbodyfont[myfont] \stopTEXpage ``` It produces the PDF in the attachment. I'm struggling with several things: - xcharter seems to have no kerning applied. It is listed as font feature, though. Is it correct to have no kerning at all for that font? The font has kerning information but none for characters in the ASCII range. - xcharter also have no ligatures (at least it doesn't look like that). That is listed as font feature, too, although only for italic and slanted. According to https://tug.org/FontCatalogue/xcharter/ there are ligatures in the font. There are ligatures for ff[il]. - Overpass has a glyph for the ae ligature. Is it normal that it is not used as a ligature for ae? This seems to be a stupid decision to replace ae by default with a ligature, maybe dependent on the language but not for all of them. - Overpass Mono does not contain italic glyphs. I would have expected obliques when using \slanted then. However, it just remains normal. You can use the slanted feature for this but the default setting is to fall back to the upright alternative and you as a user has to make the choice. Example: \definefontfamily[myfont][tt][overpassmono][sl={features:slanted}] - I included the ™ in the example since its italic glyph is not slanted. For all fonts \slanted seems to switch to the extra (italic?) glyphs, while I would have expected obliques. At least overpass seems to have no dedicated slanted style, while xcharter has one. How a glyph for a certain styles appears depends on the font designer. When you use \definefontfamily you get always the same style for italic and slanted because most fonts provide only italic or oblique (but not both). In some case you do something like the following font setting but the best solution when you have a large font family have is to write a typescript. \definefontfamily[myfont][rm][xcharter][sl=style:slanted] Wolfgang ___ 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 ___
[NTG-context] Re: About the font used in the document mathincontext-paper.pdf
Fabrice Couvreur schrieb am 27.08.2024 um 15:35: In this " A small note, with source". As Mikael already wrote, the example use Antykwa Torunska for the text but when you take a look at the end of the source you find the following note: On the next few pages we show the result after compiling this small example. We added a \switchtobodyfont[antykwa], to vary the look a little. Wolfgang ___ 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 ___
[NTG-context] Re: About the font used in the document mathincontext-paper.pdf
Fabrice Couvreur schrieb am 27.08.2024 um 15:04: Hello, I read this very good document and it says that it was written with the Pagella font. I use this font with a simple \setupbodyfont[pagella,11pt] but I find that the rendering is not the same as on the document, it is less nice especially in the writing of the theorems with the text in italic. Imaginary impression or reality ? Which page/section of the manual you're referring to? Wolfgang ___ 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 ___
[NTG-context] Re: chapter counter?
Henning Hraban Ramm schrieb am 26.08.2024 um 20:14: Am 26.08.24 um 17:57 schrieb Wolfgang Schuster: Henning Hraban Ramm schrieb am 26.08.2024 um 17:41: Hi, I’d like to check the chapter number like \ifodd\rawcountervalue[chapter] What an odd chapter! \fi but apparently the counter isn’t called "chapter", or I’m doing it wrong otherwise. Could you enlighten me? \namedheadnumber{chapter} Thank you, but it doesn’t work in my setup where I’m trying to change a background image depending on the chapter number: \defineoverlay[BG][\start \ifodd\namedheadnumber{chapter}\relax \externalfigure[bgimage][height=\overlayheight] \else \mirror{\externalfigure[bgimage][height=\overlayheight]} \fi \stop] This is then used with \setlayerframed[papier][background=BG] I guess it’s expanded only once. But it was a bad idea anyway, I wanted more than two variants and now just set them as a uservariable. Without more information there is no way to provide a solution but for the archive there is below a solution to get mirrored images for even chapters. The background has also a check an image before the start of the first chapter. \setupexternalfigure[location=default] \defineoverlay [BackGround] [\ifzeronum\namedheadnumber{chapter}\relax % \orelse\ifodd\namedheadnumber{chapter}\relax \externalfigure[mill][factor=min]% \else \mirror{\externalfigure[mill][factor=min]}% \fi] \setupbackgrounds[page][background=BackGround] \starttext FooBar \chapter{Foo} \chapter{Bar} \stoptext Wolfgang ___ 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 ___
[NTG-context] Re: chapter counter?
Henning Hraban Ramm schrieb am 26.08.2024 um 17:41: Hi, I’d like to check the chapter number like \ifodd\rawcountervalue[chapter] What an odd chapter! \fi but apparently the counter isn’t called "chapter", or I’m doing it wrong otherwise. Could you enlighten me? \namedheadnumber{chapter} Wolfgang ___ 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 ___
[NTG-context] Re: digits / units setup
Henning Hraban Ramm schrieb am 24.08.2024 um 20:59: Am 24.08.24 um 20:38 schrieb Henning Hraban Ramm: According to docs, \setupunit[method=3] should change the rendering of numbers in \unit{10,123.99 mm} or \digits{10,123.99} to “10\,123,99”, but it doesn’t. \setdigitmode{3} works, though. Seems to be a problem of my environment. In a minimal example, \setupunit changes \unit, \setdigitmode changes \digits. The \digits mechanism was never extended to provide a basic setup mechanism which means you have to use the \set... commands to change the output. Wolfgang ___ 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 ___
[NTG-context] Re: [ how to remove speae before (and after) \startitemize ?
vm via ntg-context schrieb am 25.08.2024 um 14:36: Any hint as how to remove the automatic default space before and after \startitemize and have equal line spacing between all text lines? \starttext one two three \startitemize[packed] \startitemize[packed,joinedup] or \startitemize[packed][before=,after=] Wolfgang ___ 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 ___
[NTG-context] Re: understanding units / dimensions
Henning Hraban Ramm schrieb am 25.08.2024 um 13:45: At the meeting I noted a few units that I didn’t know about, while I already knew many. * general units: in, m, cm, mm (ft?) * typographical units: pt, dd, bp, pc, cc, sp * font related: em, ex, fs, fa, fd, fc, ch * layout related: pw, ph, tw, th, cw, cd, lw, hs, vh * frame related: fw, fh, fo * funits: dk, es, tv, eu Are there even more? Yes, there are more of them. Look into the lowlevel-registers document which describes how they are created and also how you can define your own identifiers with \newuserunit. Questions: How differs "1" from "2"? * em fs \startbuffer[dimensions] \starttabulate \NC em \EQ \the\dimexpr1em\relax \NC\NR % \emwidth \NC fs \EQ \the\dimexpr1fs\relax \NC\NR % \globalbodyfontsize \stoptabulate \stopbuffer \starttext \getbuffer[dimensions] \setupbodyfont[14.4pt] \getbuffer[dimensions] \stoptext * lw hs lw stands for \linewidth which is the default value for rulethickness in \framed etc. hs is just \hsize. * ph vh ph is \paperheight. vh doesn't exist. Wolfgang ___ 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 ___
[NTG-context] Re: Any way to forbid boldface for a section of text?
Wolfgang Schuster schrieb am 24.08.2024 um 17:49: Denis Maier via ntg-context schrieb am 24.08.2024 um 08:25: You could define a specific typescript for that without a definition for bold. Below is an implementation of your suggestion which gets rid of all font styles for serif, sans serif and monospace fonts. \starttypescript [serif,sans,mono] [uprightonly] \definefontsynonym [\typescriptprefix\typescriptone Italic] [\typescriptprefix\typescriptone] \definefontsynonym [\typescriptprefix\typescriptone Slanted] [\typescriptprefix\typescriptone] \definefontsynonym [\typescriptprefix\typescriptone Bold] [\typescriptprefix\typescriptone] \definefontsynonym [\typescriptprefix\typescriptone BoldItalic] [\typescriptprefix\typescriptone] \definefontsynonym [\typescriptprefix\typescriptone BoldSlanted] [\typescriptprefix\typescriptone] \stoptypescript \starttypescript [uprightonly] \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] \stoptypescript \setupbodyfont[pagella] \starttext xxx {\bf yyy} xxx {\it zzz} xxx \start \switchtobodyfont[uprightonly] xxx {\bf yyy} xxx {\it zzz} xxx \stop xxx {\bf yyy} xxx {\it zzz} xxx \stoptext In the next release you don't have to create the typescript anymore because Hans is including it with the other typescripts and in addition it will also support math input. The new complete minimal example is now: \usetypescriptfile[uprightonly] \starttext xxx {\bf yyy} xxx {\it zzz} xxx \start \switchtobodyfont[uprightonly] xxx {\bf yyy} xxx {\it zzz} xxx \stop xxx {\bf yyy} xxx {\it zzz} xxx \stoptext Wolfgang ___ 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 ___
[NTG-context] Re: Any way to forbid boldface for a section of text?
Denis Maier via ntg-context schrieb am 24.08.2024 um 08:25: You could define a specific typescript for that without a definition for bold. Below is an implementation of your suggestion which gets rid of all font styles for serif, sans serif and monospace fonts. \starttypescript [serif,sans,mono] [uprightonly] \definefontsynonym [\typescriptprefix\typescriptone Italic] [\typescriptprefix\typescriptone] \definefontsynonym [\typescriptprefix\typescriptone Slanted] [\typescriptprefix\typescriptone] \definefontsynonym [\typescriptprefix\typescriptone Bold] [\typescriptprefix\typescriptone] \definefontsynonym [\typescriptprefix\typescriptone BoldItalic] [\typescriptprefix\typescriptone] \definefontsynonym [\typescriptprefix\typescriptone BoldSlanted] [\typescriptprefix\typescriptone] \stoptypescript \starttypescript [uprightonly] \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] \stoptypescript \setupbodyfont[pagella] \starttext xxx {\bf yyy} xxx {\it zzz} xxx \start \switchtobodyfont[uprightonly] xxx {\bf yyy} xxx {\it zzz} xxx \stop xxx {\bf yyy} xxx {\it zzz} xxx \stoptext Wolfgang ___ 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 ___
[NTG-context] Re: Problem with Cambria
Henning Hraban Ramm schrieb am 16.08.2024 um 10:52: I’m not sure if "cambmath" or "cambria.ttf" relates to "cambria.ttc". When Cambria was released you had two ways to get the fonts: 1. As part of your windows (or was it office?) installation. 2. You bought a end user license from Ascender fonts. The second option is no longer available because Ascender was bought in 2010 by Monotype and it seems the fonts aren't available for purchase anymore. @Hans and Mikael: Can we remove the ascender version from the typescript or change the file check to make the microsoft version the default? Wolfgang ___ 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 ___
[NTG-context] Re: Problem with Cambria
Lutz Haseloff schrieb am 16.08.2024 um 09:47: Hi Hans, hi all, the latest ConTeXt lmtx seems to have a problem with MS Cambria. My file is: \setupbodyfont[cambria] \definefont[symbola][file:symbola*default at 10pt] \starttext \startMPpage[offset=1dk] draw textext("AC{\symbola ⚡}DC"); \stopMPpage \stoptext Which result (YES or NO) do you get with the following example? \starttext \doiffileelse{cambria.ttc}{YES}{NO} \stoptext Wolfgang ___ 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 ___
[NTG-context] Re: problem with location={right,high} in latest LMTX
Henning Hraban Ramm schrieb am 14.08.2024 um 23:11: There seems to be a regression with sidefloats: """ \useMPlibrary[dum] \starttext \startplacefigure[title={problem},location={right,high}] \externalfigure[dummy][width=.3\textwidth] \stopplacefigure \samplefile{ward} \stoptext """ Line 1154 in strc-flt.mkxl: \def\strc_floats_analyze_variables_two {... - \ifinset\v!high \floatlocation\global \plusone \fi + \ifinset\v!high \floatlocation\global\c_page_sides_skipmode \plusone \fi \ifinset\v!low \floatlocation\global\c_page_sides_skipmode \plustwo \fi \ifinset\v!fit \floatlocation\global\c_page_sides_skipmode \plusthree\fi \ifinset\v!tolerant \floatlocation\global\c_page_sides_tolerance\plusone \fi \ifinset\v!verytolerant\floatlocation\global\c_page_sides_tolerance\plustwo \fi ...} Wolfgang ___ 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 ___
[NTG-context] Re: Missing \endcsname inserted error
Jeong Dal via ntg-context schrieb am 13.08.2024 um 21:21: Hi, I draw a figure using MetaFun and insert it \startplacefigure and \stopplacefigure. (Sample file is listed below) But, I got an error as following: Missing \endcsname inserted [...] \starttext \startplacefigure[location=none,\title=] Either remove the backslash before the title key or just remove it from the argument because the values of \startplacefigure are empty by default. Wolfgang ___ 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 ___
[NTG-context] Re: Complete novice, why does it seem that LuaLaTeX (Compiled via LaTeX Workshop with MikTeX and added packages on Windows) will generate a more compact result than ConTeXt?
Hans Hagen via ntg-context schrieb am 13.08.2024 um 17:40: On 8/13/2024 4:49 PM, fm117...@students.panola.edu wrote: Hello, ConTeXt mailing list! I have a question regarding a difference in the code that I have which uses the same paper size and margin settings, and also the same indentation rules and font size and font. It seems that ConTeXt (which I compiled via Windows Terminal, this *is* the proper way to compile ConTeXt docs, right?) seems to make text that is less... compact, and I am not sure if this is due to me not adding features that I **should** have turned on in ConTeXt when using Times New Roman that is installed by default on Windows. I also was not able to get a "proper (?)" single quote like when Word or LaTeX compiles "Don't", that ' is a straight quote in the compiled text. I also heard that ConTeXT would be much better for typography since it does have a more advanced typographical engine as the base (and this is a big reason as to why I want to switch to ConTeXt, pretty much everything is built in, I just can't understand documentation that well), and this may be because my code is very basic and I do not know how do properly do ConTeXt. Is it possible that ConTeXt also has a more "correct" way of formatting? Anyways, thank you for reading and taking the time to read this post. LuaLaTeX code: https://pastebin.com/p5aWxAyK ConTeXt code: https://pastebin.com/DsMnxMvY Can you explain what you mean with less compact? The default baseline distance of LaTeX is AFAIK 1.2 times the font size, adding \setupinterlinespace [line=1.2\bodyfontsize] to the document setup should produce similar results with ConTeXt. Wolfgang ___ 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 ___
[NTG-context] Re: Complete novice, why does it seem that LuaLaTeX (Compiled via LaTeX Workshop with MikTeX and added packages on Windows) will generate a more compact result than ConTeXt?
Hans Hagen via ntg-context schrieb am 13.08.2024 um 17:40: On 8/13/2024 4:49 PM, fm117...@students.panola.edu wrote: Hello, ConTeXt mailing list! I have a question regarding a difference in the code that I have which uses the same paper size and margin settings, and also the same indentation rules and font size and font. It seems that ConTeXt (which I compiled via Windows Terminal, this *is* the proper way to compile ConTeXt docs, right?) seems to make text that is less... compact, and I am not sure if this is due to me not adding features that I **should** have turned on in ConTeXt when using Times New Roman that is installed by default on Windows. I also was not able to get a "proper (?)" single quote like when Word or LaTeX compiles "Don't", that ' is a straight quote in the compiled text. I also heard that ConTeXT would be much better for typography since it does have a more advanced typographical engine as the base (and this is a big reason as to why I want to switch to ConTeXt, pretty much everything is built in, I just can't understand documentation that well), and this may be because my code is very basic and I do not know how do properly do ConTeXt. Is it possible that ConTeXt also has a more "correct" way of formatting? Anyways, thank you for reading and taking the time to read this post. LuaLaTeX code: https://pastebin.com/p5aWxAyK ConTeXt code: https://pastebin.com/DsMnxMvY Can you explain what you mean with less compact? Can we assume that you are running the LMTX version? (luametatex engine) [...] \setupbodyfont[termes,12pt] To get Times New Roman as font replace the \setupbodyfont line from the example of Hans with the following settings. The \definefontfeature line replaces all ' in your text with a apostrophe. \definefontfeature [default] [default] [trep=yes] \definefontfamily [TimesNewRoman] [rm] [Times New Roman] \definetypeface [TimesNewRoman] [mm] [math] [termes] \setupbodyfont [TimesNewRoman,12pt] Wolfgang ___ 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 ___
[NTG-context] Re: Nāgarī for Academics
Otared Kavian schrieb am 10.08.2024 um 17:56: On 10 Aug 2024, at 11:59, Jürgen Hanneder via ntg-context wrote: Does it work if you say {\language[sa]yoga} That's it!! Hi Jürgen, You may also define a command like (or a shorter name…) \define[1]\sanskrit{\start\language[sa]#1\stop} \definestartstop [sanskrit] [style={\language[sa]}] Wolfgang ___ 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 ___
[NTG-context] Re: How to allow hyphenation, only for footnotes?
Joel via ntg-context schrieb am 10.08.2024 um 16:54: My copy editor urged me to remove all hyphens from the main text of my document. I'm using: \definefontfeature[default][default][expansion=quality,protrusion=quality] \start \setupalign[nothyphenated,tolerant,hz,hanging] (text) \stop Is there a reason why do the alignment change within a local group? The problem is that is messing with footnotes, causing things like URLS to run off the page. How can I permit the hyphenation to appear normally, but only on the footnote text? \setupalign[verytolerant,nothyphenated] \setupnotation[footnote][align={hyphenated,normal}] \starttext \samplefile{lorem}\footnote{\samplefile{lorem}} \stoptext Wolfgang ___ 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 ___
[NTG-context] Re: Nāgarī for Academics
Jürgen Hanneder via ntg-context schrieb am 10.08.2024 um 11:10: Dear Richard, Are you after a Context version of something such as Xetex Devanagari? https://github.com/wujastyk/xetex-devanagari Indeed. In my XeTeX publications settling the font was quite straightforward: \usepackage{polyglossia,fontspec,xunicode} \setmainfont{Adobe Text Pro} \newfontfamily\sanskritfont[Script=Devanagari,Mapping=RomDev,Scale=1.4]{AdishilaSan} \setdefaultlanguage{english} \setotherlanguage{sanskrit} But coming back to ConTeXt: I am grateful to Pablo and Wolfgang for their suggestions, but it does not (yet) work as it should. Perhaps this has to do with the problem in the language command. Here is my test file that works up to the point, and then shows the problem. --- \setuppapersize[A4] \setuplayout[width=14cm, height=fit] \definefontfamily [roman] [rm] [minion] You set a font here for english text but never enable it. \definefontfamily [nagari] [rm] [Adishila] [features=devanagari-one] \setupbodyfont [nagari] This is where you set the font for the whole document. \usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa,vector={iast to deva}] \startsetups [sanskrit] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups \setuplanguage [sa] [setups=sanskrit] \starttext Example: आनन्द। अपिच % this comes out as it should, but since input is in Nagari there is no transliteration involved. test % the word "test" comes out in roman, i.e. switching back to roman works. \language[sa]{yoga} % the word "yoga" is typeset in Nagari as expected, test % but the word "test" is still typeset in Nagari \language[en]{test} % still no switching back to roman, it seems stuck with Nagari. \stoptext - \definefallbackfamily [Roman] [rm] [Adishila] [range=devanagari,features=devanagari-one] \definefontfamily [Roman] [rm] [Minion Pro] \setupbodyfont [Roman] \definefontfamily [nagari] [rm] [Adishila] [features=devanagari-one] \usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa,vector={iast to deva}] \startsetups [sanskrit] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups \setuplanguage [sa] [setups=sanskrit] \starttext Example: आनन्द। अपिच Example: \language[sa]{yoga} \stoptext Wolfgang ___ 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 ___
[NTG-context] Re: Nāgarī for Academics
Jürgen Hanneder via ntg-context schrieb am 08.08.2024 um 13:07: The text below works, thanks for the help! But there is one more problem. I could not find an elegant method to set the language of the document to English without disabling Nagari. If one adds \setupbodyfont[minion] the Nagari parts disappear. The normal scenario would be a document in English with Sanskrit as a secondary language, to one switches with a command that changes font, language and activates the transliteration mechanism. You can put all settings (fonts, transliteration etc.) you need for your sanskrit texts in a setups blocks and apply the block to a language. When you use now the \language command (or environment) all settings are now applied to the content. Below is a untested example. \definefontfamily [nagari] [rm] [adishila] [features=devanagari-one] \usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa, vector={iast to deva}] \startsetups [sanskrit] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups \setuplanguage [sa] [setups=sanskrit] \starttext \subject{Some notes on Printing Sanskrit with lmtx} \language[sa]{योग} -- That is the word Yoga, input and, when you compile this document, printed in (Deva)Nagari script. \stoptext Wolfgang ___ 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 ___
[NTG-context] Re: Error after latest update
Shiv Shankar Dayal schrieb am 06.08.2024 um 21:17: LuaMetaTeX 2.11.03 20240517 + ConTeXt LMTX 2024.05.17 16:32 I had a copy of this older version and the cell handling was different back then. Still the correct way to add filler symbols in a matrix is the \HF command which has two optional commands where you can a) set the number of columns which should be filled and b) the filler alternative to be used for the symbol. Wolfgang ___ 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 ___
[NTG-context] Re: Error after latest update
Shiv Shankar Dayal schrieb am 06.08.2024 um 19:30: Hi, I still do not know why it stopped working after the latest update. Which version was your last one you used? Just because it worked without an error message before doesn't mean your input is the right way. Especially when you have to pass 9 as argument to \multispan even though you have only 5 columns should be alarming. The reason for the error here is that Context creates a template for each matrix cell which enables and disable math mode at the begin of each cell but when you use \multispan the template is ignored and you have to provide your own settings. The problem no is that no math mode is entered at the begin of your new marge cell but Context always adds a end of math mode trigger when it reaches the \NR command at the end of the row. Wolfgang ___ 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 ___
[NTG-context] Re: Error after latest update
Mikael Sundqvist schrieb am 06.08.2024 um 18:27: Hi, On Tue, Aug 6, 2024 at 5:57 PM Shiv Shankar Dayal wrote: I have defined a determinant environment like below: \definemathmatrix[determinant] [matrix:bars] [simplecommand=thedeterminant] and I create a determinant like below: \startformula \startdeterminant\NC a_{11} \NC a_{12} \NC a_{13} \NC \cdots \NC a_{1n}\NR \NC a_{21} \NC a_{22} \NC a_{23} \NC \cdots \NC a_{2n}\NR \NC a_{31} \NC a_{32} \NC a_{33} \NC \cdots \NC a_{3n}\NR \multispan{9}{\dotfill}\NR \NC a_{n1} \NC a_{n2} \NC a_{n3} \NC \cdots \NC a_{nn} \NR\stopdeterminant This was working before today but I updated ConTeXt and it has stopped working. The error it gives me now is: tex error > tex error on line 277 in file determinants.tex: You can't use '\Ustopmath' in restricted horizontal mode How can I get it working again? -- Respect, Shiv Shankar Dayal I never seen \multispan before. But this seems to work: \multispan is a plain TeX command to create cells which span multiple columns and makes only sense when you create tables with the \halign primitive because tables in context use hidden cells for padding on the left and right etc. Wolfgang ___ 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 ___
[NTG-context] Re: Alignments of margin notes
Pablo Rodriguez via ntg-context schrieb am 02.08.2024 um 18:36: On 8/2/24 16:41, Wolfgang Schuster wrote: [...] The example below shows which predefined margin blocks rely only on margindata where you can change the alignment with \etupmargindata and also the ones which require \setupmarginframed. begin example \setuppapersize[A4][A3] Sorry, Wolfgang, but I must be missing something here. Unless I add the following, inner doesn’t behave as expected (I think it is always outer without these lines): \setuppagenumbering[alternative=doublesided] \setuphead[title][page=yes] Is that right or am I missing something? When you have a singlesided document each page is a right side and it doesn't matter whether it's an even or odd page. Wolfgang ___ 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 ___
[NTG-context] Re: Alignments of margin notes
Gerion Entrup schrieb am 02.08.2024 um 14:10: Am Freitag, 2. August 2024, 07:42:29 MESZ schrieb Pablo Rodriguez via ntg- context: On 8/2/24 01:13, Gerion Entrup wrote: Ok, I think I understand that in principal. Thanks for the explanation. Can I somehow know in advance that a margin note makes use of \framed? Hi Gerion, there is an \ifinframed conditional, such as in: ... This may help to achieve what you want. Just in case it helps, Thanks for the answer, but we misunderstood. I'll try to formulate it clearer: If I get it right, to set margin notes, you need to specify \setupmargindata in any case. However, on the one hand, there might be notes that follow the style of the "style" argument within \setupmargindata. And on the other hand, there might be notes that internally uses \framed and follow the "style" argument within a separately specified \setupmarginframed. My question is, whether I have any chance to get in advance (when writing down the document styling) which style argument my future (not yet written) margin notes will follow to know if I need to specify a \setupmarginframed at all. Is it the style argument of \setupmargindata or \setupmarginframed or is it a good practice to _always_ specify \setupmarginframed with the same style argument as given to \setupmargindata? I have no idea what your question is but you should use \setupmarginframed only when the setup requires it, e.g. to change the alignment for blocks which use the framed mechanism. The example below shows which predefined margin blocks rely only on margindata where you can change the alignment with \etupmargindata and also the ones which require \setupmarginframed. begin example \setuppapersize[A4][A3] \setuplayout[location=middle] \starttext \doloopoverlist{ inleftmargin, inrightmargin, inoutermargin, ininnermargin, inleftedge, inrightedge, inouteredge, ininneredge, atleftmargin, atrightmargin, } { \setupmargindata[\recursestring][align=middle] \title{\tex{\recursestring}} \samplefile{lorem} \margindata[\recursestring]{Text in the margin!} \samplefile{lorem} } \doloopoverlist{ inleft, inright, inouter, ininner, inmargin, inother, } { %\setupmargindata[\recursestring][align=middle] \setupmarginframed[\recursestring][align=middle] \title{\tex{\recursestring}} \samplefile{lorem} \margindata[\recursestring]{Text in the margin!} \samplefile{lorem} } \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: Alignments of margin notes
Gerion Entrup schrieb am 01.08.2024 um 17:19: Am Donnerstag, 1. August 2024, 16:36:06 MESZ schrieb Wolfgang Schuster: Gerion Entrup schrieb am 01.08.2024 um 16:20: Am Donnerstag, 1. August 2024, 16:13:23 MESZ schrieb Wolfgang Schuster: Gerion Entrup schrieb am 01.08.2024 um 14:28: Hi, I want to make a two sided document with margin notes. The notes should not be hyphenated and always aligned to the inner text body. However, I did not get this to work. It hyphenates and the alignment is only correct at even pages. Do you know the correct way? Here is a MWE: ``` \setuppagenumbering[location={footer, right}, alternative=doublesided] \definealign[myalign][inner, nothyphenated] \setupmargindata[inmargin][ location=outer, style=italic, % nothing of that seems to have any effect % align=myalign, % align=inner, % align=nothyphentated, align={inner, nothyphentated}, ] Use \setupmarginframed for the alignment. \setupmarginframed [inmargin] [align={inner,nothyphenated}] Does the align parameter of \setupmargindata has any function, then? Also, using setupmarginframed leads to other problems: - The margin text is bold now(?) - All margin nodes are on the left of the page now (this should be only the case for even pages) The location of the margin block and the style are still controlled by \setupmargindata and only the alignment has to be changed with \setupmarginframed. \setupmargindata [inmargin] [location=outer, style=italic] \setupmarginframed [inmargin] [align={inner,nothyphenated}] Thanks, that works for the alignment. It does not change the hyphenation. I would have expected this line breaks in the margin note: significant incredible components Instead, ConTeXt generates: significant in credible com ponents In general: Does the "align" argument in setupmargindata has a meaning at all? The align key works and the output is correct but the problem in this case is a user error. When you compare mine and your example you should notice a difference in the spelling of nothyphenated which has an extra "t" in your case. Why is the action to setup margin notes splitted in setupmargindata and setupmarginframed? I find it kind of unintuitive. There are two different mechanism at work here: 1. The placement of the texts is controlled with the margindata mechanism has style and align options. 2. In addition to the placement mechanism some of the margin texts make use of \framed for the content. Because not all margin texts should make use \framed this is optional and controlled with an extra setup-command. The separate setup mechanism avoid also problems with keys which have a different meaning for the placement of the margin texts, e.g. location is an already existing framed-key but it is also used to set the horizontal position of the block. Wolfgang ___ 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 ___
[NTG-context] Re: Alignments of margin notes
Gerion Entrup schrieb am 01.08.2024 um 16:20: Am Donnerstag, 1. August 2024, 16:13:23 MESZ schrieb Wolfgang Schuster: Gerion Entrup schrieb am 01.08.2024 um 14:28: Hi, I want to make a two sided document with margin notes. The notes should not be hyphenated and always aligned to the inner text body. However, I did not get this to work. It hyphenates and the alignment is only correct at even pages. Do you know the correct way? Here is a MWE: ``` \setuppagenumbering[location={footer, right}, alternative=doublesided] \definealign[myalign][inner, nothyphenated] \setupmargindata[inmargin][ location=outer, style=italic, % nothing of that seems to have any effect % align=myalign, % align=inner, % align=nothyphentated, align={inner, nothyphentated}, ] Use \setupmarginframed for the alignment. \setupmarginframed [inmargin] [align={inner,nothyphenated}] Does the align parameter of \setupmargindata has any function, then? Also, using setupmarginframed leads to other problems: - The margin text is bold now(?) - All margin nodes are on the left of the page now (this should be only the case for even pages) The location of the margin block and the style are still controlled by \setupmargindata and only the alignment has to be changed with \setupmarginframed. \setupmargindata [inmargin] [location=outer, style=italic] \setupmarginframed [inmargin] [align={inner,nothyphenated}] Wolfgang ___ 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 ___
[NTG-context] Re: Alignments of margin notes
Gerion Entrup schrieb am 01.08.2024 um 14:28: Hi, I want to make a two sided document with margin notes. The notes should not be hyphenated and always aligned to the inner text body. However, I did not get this to work. It hyphenates and the alignment is only correct at even pages. Do you know the correct way? Here is a MWE: ``` \setuppagenumbering[location={footer, right}, alternative=doublesided] \definealign[myalign][inner, nothyphenated] \setupmargindata[inmargin][ location=outer, style=italic, % nothing of that seems to have any effect % align=myalign, % align=inner, % align=nothyphentated, align={inner, nothyphentated}, ] Use \setupmarginframed for the alignment. \setupmarginframed [inmargin] [align={inner,nothyphenated}] Wolfgang ___ 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 ___
[NTG-context] Re: combining float counters
Henning Hraban Ramm schrieb am 31.07.2024 um 20:43: Hi, I defined new float types for special figure/caption placement, but would like to use the general figure counter. I didn’t find a setup for that. How can I do this? pseudocode: \setupfloat[myfigure][ counter=figure, ] \useMPlibrary[dum] \definefloat[myfigure][figure] \starttext \startplacefigure[title=Figure] \externalfigure[dummy-a] \stopplacefigure \startplacemyfigure[title=Myfigure] \externalfigure[dummy-a] \stopplacemyfigure \stoptext Wolfgang ___ 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 ___
[NTG-context] Re: MetaPost background
alan.caruanam...@gmail.com schrieb am 23.07.2024 um 20:29: Hello, I need the background (lines and points) to be inside (tangent) of the frame, I don't know how to do it \startuseMPgraphic{fullheightbackground} fill unitsquare xyscaled (OverlayWidth, OverlayHeight) withcolor "gray" ; w := MakeupWidth; h := OverlayHeight; draw (0,0)--(MakeupWidth,0) withpen pencircle scaled 2pt withcolor green; draw (0,OverlayHeight)--(MakeupWidth,OverlayHeight) withpen pencircle scaled 2pt withcolor green; Add offset value to the horizontal/vertical dimensions. draw (0,1pt+OverlayLineWidth)--(MakeupWidth,1pt+OverlayLineWidth) withpen pencircle scaled 2pt withcolor green; draw (0,OverlayHeight-1pt-OverlayLineWidth)--(MakeupWidth,OverlayHeight-1pt-OverlayLineWidth) withpen pencircle scaled 2pt withcolor green; drawdot (0,0) withpen pencircle scaled 8pt withcolor red; drawdot (MakeupWidth,OverlayHeight) withpen pencircle scaled 8pt withcolor red; Set a bounding box size for the image to ensure the image isn't stretched to fill the available space. setbounds currentpicture to OverlayBox; \stopuseMPgraphic Wolfgang ___ 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 ___
[NTG-context] Re: About a pagination
Fabrice Couvreur schrieb am 23.07.2024 um 08:57: Hi, I'm trying to get the same pagination as in the attached photos. The images are missing. Wolfgang ___ 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 ___
[NTG-context] Re: spacing in columns
Hans van der Meer via ntg-context schrieb am 23.07.2024 um 11:36: The first screenshot has its items neatly stacked and is made with \startsimplecolumns[n=2] \placenotes[endnote] \stopsimplecolumns The second screenshot has its items wide apart and is made with \startcolumns[n=2,blank=1pt] \startcolumns[n=2,grid=no,blank=1pt] Wolfgang ___ 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 ___
[NTG-context] Re: Install urbanist fonts
Jean-Pierre Delange schrieb am 22.07.2024 um 12:29: As Taco suggested, the best way to install new fonts on MS Windows (and other OSes) is to tell ConTeXt where they are located. On Windows, fonts are usually found in /Fonts. But you still need to purge the font cache and regenerate it so that the system can interact with ConTeXT. A safer method is to create separate directories, as indicated by Taco: /tex/texmf-fonts/fonts/data/urbanist. You can also distinguish between True Type fonts (ttf) and Open Type fonts (otf) by separating folders as follows: /tex/texmf-fonts/fonts/otf/ and /tex/texmf-fonts/fonts/ttf/. When you use context for a single user you can create a folder texmf in the users home directory and place all files in the subfolder fonts/data, e.g. C:\Users\...\texmf\fonts\data> There is no need to make distinctions between the two file extension ttf and otf because they are meaningless because most truetype fonts are also opentype font. Wolfgang ___ 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 ___
[NTG-context] Re: documenting itemize specials
Henning Hraban Ramm schrieb am 07.07.2024 um 10:54: Hi, * can anyone give me an example where \noitem makes sense? This is why the command exists: \starttext \startitemize[repeat,n][width=0pt] \noitem \startitemize[a,broad] \item First item \item Second item \stopitemize \noitem \startitemize[a,broad] \item First item \item Second item \stopitemize \stopitemize \stoptext * is the + symbol of \sub configurable? No. Wolfgang ___ 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 ___
[NTG-context] Re: processor for index sub-entry?
Henning Hraban Ramm schrieb am 05.07.2024 um 22:36: Hi, is it possible to apply a processor to an index sub-entry? \index{Modules+\type{filter}} looks good, but "filter" is sorted under "type". \defineprocessor[type][style=mono] \index{Modules+type->filter} results in a "Modules / type->filter" entry. \index[Modules+filter]{Modules+\type{filter}} works and looks good, but the code feels bad… 1. Complete your example to test them without adding stuff. 2. Use \setregisterentry which allows you to set processors for each entry level. \defineprocessor[type][style=mono] \starttext xxx\setregisterentry[index][entries:1=Modules,entries:2=filter,processors:2=type] \placeindex[n=1] \stoptext Wolfgang ___ 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 ___
[NTG-context] Re: How to specify a default formatting for TABLE
Gerion Entrup schrieb am 01.07.2024 um 23:56: Hi, I want to format a bunch a tables with the same formatting. It seems that specifying the \setupTABLE commands as part of the preamble works. However, I need some tables that are formatted in another way. Is there a generic way to specify this? Here is a MWE: [...] The last two tables should be formatted as if the four setupTABLE commands in the header are not existent. My solution does not work, however. 1. Put your table settings in a setups-block and load the one you want at the start of your table. 2. You don't need \setupcolors[state=start] because colors are enabled by default (since a veee...eeery long time). 3. You can replace \bTD ... \eTD with \bTH ... \eTH for table headers to get bold text. begin example \startsetups[table:a] \setupTABLE [each] [frame=off,width=1cm,height=1cm,align={middle,lohi}] \setupTABLE [each] [background=color,backgroundcolor=lightgray] \stopsetups \startsetups[table:b] \setupTABLE [each] [frame=off,width=2cm,height=1.2\lineheight,align=middle] \setupTABLE [each] [topframe=on,bottomframe=on] \stopsetups \starttext \bTABLE \bTR \bTD A \eTD \bTD B \eTD \eTR \bTR \bTD C \eTD \bTD D \eTD \eTR \eTABLE \blank \bTABLE[setups=table:a] \bTR \bTD A \eTD \bTD B \eTD \eTR \bTR \bTD C \eTD \bTD D \eTD \eTR \eTABLE \blank \bTABLE[setups=table:b] \bTR \bTD A \eTD \bTD B \eTD \eTR \bTR \bTD C \eTD \bTD D \eTD \eTR \eTABLE \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: Flowcharts
Otared Kavian schrieb am 29.06.2024 um 14:36: Thanks Wolfgang ! I added the hint to the wiki: https://wiki.contextgarden.net/Flow_Charts Out of curiosity, why should one say \startFLOWcell[background=color,backgroundcolor=red] ... \stopFlowcell while \startFLOWcell[backgroundcolor=red] … \stopFLOWcell seem to work as well ? Thanks again and best regards: Otared You're right, there is no need for "background=color" because each cell already has a background color by default. Wolfgang ___ 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 ___
[NTG-context] Re: No roman numerals in frontmatter header
Henning Hraban Ramm schrieb am 29.06.2024 um 10:10: Am 29.06.24 um 06:49 schrieb jbf: But if I change to \setuppagenumbering[location= ], and choose, for example: \setupheadertexts [ ] [{\getmarking[chapter]\hskip1em \pagenumber}] [{\pagenumber \hskip1em \documentvariable{metadata:title}}] [ ] I get my header texts with page numbers in arabic numerals in frontmatter. I have tried various \setupheadertexts options, but I still get arabic numerals in frontmatter. The conversion does not work. What am I missing or doing wrong? Try \convertnumber{R}{\pagenumber} Just use \userpagenumber. Wolfgang ___ 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 ___
[NTG-context] Re: Flowcharts
Otared Kavian schrieb am 28.06.2024 um 19:23: A second try… Hi all, Is it possible to have different background colors for different cells in flow charts ? For instance in the following example, is it possible to have a particular color for each cell ? \startFLOWcell[background=color,backgroundcolor=red] ... \stopFLOWcell Wolfgang ___ 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 ___
[NTG-context] Re: Use headcommand in \definedescription together with \definehighlight (now: \definestartstop)
Gerion Entrup schrieb am 28.06.2024 um 11:40: Do you know, why the groupedcommand solution does not work? The command and the environment which are created by \definestartstop can't be interchanged when you use the before/after and left/right keys. begin example \usemodule[visual] \definestartstop [Example] [before={\par\leftaligned{\tttf [before]}\par}, after={\par\leftaligned{\tttf [after]}\par}, left={{\tttf [left]}}, right={{\tttf [right]}}] \starttext \fakewords{10}{20} \startExample \fakewords{10}{20} \stopExample \fakewords{10}{20} \blank \fakewords{3}{5} \Example{\fakewords{3}{5}} \fakewords{3}{5} \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: Use headcommand in \definedescription together with \definehighlight (now: \definestartstop)
Gerion Entrup schrieb am 25.06.2024 um 08:41: Am Dienstag, 25. Juni 2024, 00:09:09 MESZ schrieb Wolfgang Schuster: Gerion Entrup schrieb am 24.06.2024 um 23:57: Am Montag, 24. Juni 2024, 21:20:19 MESZ schrieb Aditya Mahajan: On Mon, 24 Jun 2024, Gerion Entrup wrote: Hi, I was in the process to convert an itemize part to a description and wanted to simplify the code in the same move. I discovered headcommand for that, but struggled to set the text in an highlight _and_ make a colon at the end. Not sure what exactly you want, but how about: \definehighlight[hl][style={\m{>}\,\switchtobodyfont[tt]}] % This is the wrong way to define such a command as '>' is not part of the style. I have left this definition just for comparison with the soln below. Is there a better way to define a highlight that sets a style (color, font) _and_ a prefix (symbol)? Another way, I know of, would be just a plain def, something like \def{\hl}{\groupedcommand{>\,\switchtobodyfont[tt]}{}}, but actually I want to define a highlight (just with an additional prefix). 1. ConTeXt already uses \hl as name for a existing command. 2. Use \definestartstop: \definestartstop [gerion] [style=mono,left={›\thinspace}] \starttext text \gerion{text} \stoptext \definedescription[category][ alternative=top, headstyle=bold, width=broad, ] \definedescription[desc][ width=fit, distance={\widthofstring{~}}, distance=\spaceamount, Wolfgang This seems to be much better but does not lead to the wanted result. The full example now is: ``` \definestartstop[myhl][style=mono,left={›\thinspace}] \definedescription[categorie][ alternative=top, headstyle=bold, width=broad, ] \definedescription[desc][ width=broad, distance=\spaceamount, headcommand={\groupedcommand{\startmyhl}{\stopmyhl :}}, headstyle=, before={\startpacked}, after={\stoppacked}, alternative=hanging ] \starttext This is a \myhl{highlight}. Some listings \startcategorie{Itemize} \startitemize[packed] \item \myhl{first}: one \item \myhl{second}: two \stopitemize \stopcategorie Now the same as desc: \startcategorie{Desc} \startdesc{first} one \stopdesc \startdesc{second} two \stopdesc \stopcategorie \stoptext ``` This adopts the correct style in \startdesc \stopdesc and sets the colon but omits the › (the left part). You can do the following in the next version. 1. Add "arguments=yes" to \definestartstop to enable the optional argument for the new command. 2. Use the new commands with the "headcommand" key and apply ":" as right delimiter for the content of \Highlight. \definestartstop [Highlight] [arguments=yes, style=mono, left={›\thinspace}] \definedescription [description] [ width=broad, distance=\spaceamount, headcommand=\Highlight[right=:], alternative=hanging] \starttext This is a \Highlight{highlight}. \startdescription[title={Lorem ipsum}] \samplefile{lorem} \stopdescription \stoptext Wolfgang Highlight.pdf Description: Adobe PDF document ___ 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 ___
[NTG-context] Re: Letter module broken?
Kip Warner schrieb am 26.06.2024 um 21:08: On Wed, 2024-06-26 at 08:31 +0200, Henning Hraban Ramm wrote: Hey Henning, I’ve no problems with the module in LMTX 2024.06.18 or 2024.06.21, neither with my usual letters nor with the example. Usually, there should be some log lines that tell you about the loading of the module: modules > 'letter' is loaded open source > level 2, order 3, name '/Users/hraban/context/tex/texmf- modules/tex/context/third/letter/base/s-cor-01.mkvi' Please check if the module is there and re-generate the file database. It looks like it is not. I followed these instructions for installation of ConTeXt on a 64-bit GNU/Linux system: https://wiki.contextgarden.net/Installation#GNU.2FLinux_2 I notice that the context/tex/texmf-modules directory exists, but there is nothing in it, after the installation completes. Is there an argument that needs to be passed to ./install.sh perhaps? https://wiki.contextgarden.net/Modules#Installation_by_script_.28LMTX.29 Wolfgang ___ 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 ___
[NTG-context] Re: Use headcommand in \definedescription together with \definehighlight
Gerion Entrup schrieb am 24.06.2024 um 23:57: Am Montag, 24. Juni 2024, 21:20:19 MESZ schrieb Aditya Mahajan: On Mon, 24 Jun 2024, Gerion Entrup wrote: Hi, I was in the process to convert an itemize part to a description and wanted to simplify the code in the same move. I discovered headcommand for that, but struggled to set the text in an highlight _and_ make a colon at the end. Not sure what exactly you want, but how about: \definehighlight[hl][style={\m{>}\,\switchtobodyfont[tt]}] % This is the wrong way to define such a command as '>' is not part of the style. I have left this definition just for comparison with the soln below. Is there a better way to define a highlight that sets a style (color, font) _and_ a prefix (symbol)? Another way, I know of, would be just a plain def, something like \def{\hl}{\groupedcommand{>\,\switchtobodyfont[tt]}{}}, but actually I want to define a highlight (just with an additional prefix). 1. ConTeXt already uses \hl as name for a existing command. 2. Use \definestartstop: \definestartstop [gerion] [style=mono,left={›\thinspace}] \starttext text \gerion{text} \stoptext \definedescription[category][ alternative=top, headstyle=bold, width=broad, ] \definedescription[desc][ width=fit, distance={\widthofstring{~}}, distance=\spaceamount, Wolfgang ___ 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 ___
[NTG-context] Re: Spacing within combinations
Michael Guravage schrieb am 22.06.2024 um 18:17: Greetings, The attached MWE combines 12 images in a 3 by 4 grid; with horizontal and vertical spacing set by setupcombinations. I have two questions. First, can someone please tell me why the vertical spacing is not applied between the first and second and third and fourth rows? Second, why, If I try, e.g.c 15 images, does ConTeXt complain of a missing left brace. More generally, my mwe failed with an odd number of images, but succeeded with an even number. In a combination each entry takes two parts 1. The content of the cell and 2. the caption for the cell (unless you enable auto numbering) but you're omitting the caption for all of them. While I say you omit the caption this isn't the actual truth because the \startcontent and \startcaption commands are just named alternatives for the braces which means every second figure in your example is used as caption for the previous image. To fix your example add context.startcaption() context.stopcaption() after the content for each combination cell. Wolfgang ___ 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 ___
[NTG-context] Re: (off-topic) hovering over links in Acrobat Reader
Henning Hraban Ramm schrieb am 19.06.2024 um 21:55: Am 19.06.24 um 19:16 schrieb Pablo Rodriguez via ntg-context: Would you be so kind to test the attached document (and the one you may generate from the sample source) hovering over the link frames in Acrobat (ideally DC updated to latest)? At least, I would like to be sure what is going on here. Hovering over links is basic precaution before clicking them. To explain that to others, I’d rather know how Acrobat (Reader) behaves in these cases. Build 24.2.20857.0 on MacOS 10.15.7: 1: no hover 2: https://contextgarden.net 3: https://contextgarden.net Trying to compile your code, I get: """ ... fonts > otf loading > math data wiped from 'DejaVu Sans' Fatal error: catcode push/pop mismatch. Fix this! (restore level: 0) system > don't use \end to finish a document system > invalid \starttext ... \stoptext structure close source > level 1, order 3, name './hover1.tex' (\end occurred when \ifcase on line 6 was incomplete) ... """ This should be \protected\def \protect\def\myhref#1#2% {...} Wolfgang ___ 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 ___
[NTG-context] Re: Arranging bullets within tabulate and itemize
Lukas via ntg-context schrieb am 19.06.2024 um 17:19: Hello, here is a simple code: [...] I cannot find out how to arrange the tabulate bullets straight above those of itemize, so how to supress the left indeting, to get: Foo • Aaa Aa • Bbb Bb Foo • Ttt Tt • Uuu Uu How do I achieve this? You have to set the width for the item symbol/counter to 0pt to get rid of the space before the table. begin example \showframe[text][text] \starttext \startitemize \starttabulate[|||] \NI First item \NC\NR \NI Second item \NC\NR \stoptabulate \stopitemize \startitemize[width=0pt] \starttabulate[|||] \NI First item \NC\NR \NI Second item \NC\NR \stoptabulate \stopitemize \stoptext end example Wolfgang ___ 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 ___
[NTG-context] Re: line numbering respecting original lines
Henning Hraban Ramm schrieb am 17.06.2024 um 19:30: Am 17.06.24 um 19:07 schrieb Wolfgang Schuster: Henning Hraban Ramm schrieb am 17.06.2024 um 18:46: Am 17.06.24 um 18:16 schrieb Wolfgang Schuster: Henning Hraban Ramm schrieb am 17.06.2024 um 14:03: When discussing verses or other texts that have distinct line breaking, I need line numbering to adhere to that, even if some lines are too long and need breaking. Is that possible? In my example below the 3rd line is too long and gets line numbers 3 and 4. Same problem with source code examples, i.e. \starttyping with numbering. I thought numbering=file (or \setuplinenumbering[method=file]) would address that, but apparently not. \start \setupparagraphnumbering[state=start] \startlines ... \stoplines \stop Thank you – that works for the minimal example, but the options for paragraph numbering are very limited, I can’t even use my own command. And I can’t combine it with \starttyping. \def\CodeNumber#1{\hfill\tt\bfx\color[orange]{#1}} % ok \setuplinenumbering[ command=\CodeNumber, width=3em,] % invalid \setupparagraphnumbering[ command=\CodeNumber, width=3em,] You can use the style and color keys \setupparagraphnumbering[state=start,style=\tt\bfx,color=orange] but the location of the number in the left margin is fixed. Yes, I’m just documenting line and paragraph numbering, and I wonder why the latter is so limited – is it just too old to use the usual parameters, or is it so much more complicated internally? Maybe Hans (or somebody) needed this for a single document and the current version was enough at the time. Wolfgang ___ 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 ___
[NTG-context] Re: Combine \setupdelimitedtext with an author (define custom variable?)
Gerion Entrup schrieb am 17.06.2024 um 13:04: Am Donnerstag, 6. Juni 2024, 16:34:03 MESZ schrieb Wolfgang Schuster: [...] Wolfgang I tried to combine this with the code of the mail thread: "setuphead in connection with the command argument" but had not luck. ConTeXt always stops with: ``` close source> level 1, order 2, name './mwe.tex' tex error > runaway error: end of file encountered mtx-context | fatal error: return code: 1 ``` Here is the MWE: ``` [...] \startsetups[my_chapter] \startlocalheadsetup \startframed[chapter_frame] \blank[2cm] \startfont[Serif sa 8] \color[darkgray]{\headnumbercontent} \stopfont \blank[5mm] \startfont[SerifBold sa 2] \color[m-indigo-800]{\headtextcontent} \stopfont \blank[1cm] \startfont[SerifBold sa 1.5] \color[m-indigo-800]{\structureuservariable{subtitle}} \stopfont \blank[3cm] \startextract[author={\structureuservariable{quoteauthor}}] \structureuservariable{quote} \stopextract \stopframed \stoplocalheadsetup \stopsetups The userdata environment uses the buffer mechanism of Context which has a few limitations where you can use it, e.g. putting the environment in the arguments of other commands (like the setup-environment above) fails. One way to avoid this is to replace the \startextract ... \stopextract in this case with the code for the quoted text, another way is to put all content in a buffer and just load the buffer in the setups-environment. \startbuffer[my_chapter] \startlocalheadsetup \startframed[chapter_frame] ... \stopframed \stoplocalheadsetup \stopbuffer \startsetups[my_chapter] \getbuffer[my_chapter] \stopsetups Wolfgang ___ 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 ___
[NTG-context] Re: line numbering respecting original lines
Henning Hraban Ramm schrieb am 17.06.2024 um 18:46: Am 17.06.24 um 18:16 schrieb Wolfgang Schuster: Henning Hraban Ramm schrieb am 17.06.2024 um 14:03: When discussing verses or other texts that have distinct line breaking, I need line numbering to adhere to that, even if some lines are too long and need breaking. Is that possible? In my example below the 3rd line is too long and gets line numbers 3 and 4. Same problem with source code examples, i.e. \starttyping with numbering. I thought numbering=file (or \setuplinenumbering[method=file]) would address that, but apparently not. \start \setupparagraphnumbering[state=start] \startlines ... \stoplines \stop Thank you – that works for the minimal example, but the options for paragraph numbering are very limited, I can’t even use my own command. And I can’t combine it with \starttyping. \def\CodeNumber#1{\hfill\tt\bfx\color[orange]{#1}} % ok \setuplinenumbering[ command=\CodeNumber, width=3em,] % invalid \setupparagraphnumbering[ command=\CodeNumber, width=3em,] You can use the style and color keys \setupparagraphnumbering[state=start,style=\tt\bfx,color=orange] but the location of the number in the left margin is fixed. Wolfgang ___ 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 ___
[NTG-context] Re: line numbering respecting original lines
Henning Hraban Ramm schrieb am 17.06.2024 um 14:03: When discussing verses or other texts that have distinct line breaking, I need line numbering to adhere to that, even if some lines are too long and need breaking. Is that possible? In my example below the 3rd line is too long and gets line numbers 3 and 4. Same problem with source code examples, i.e. \starttyping with numbering. I thought numbering=file (or \setuplinenumbering[method=file]) would address that, but apparently not. Hraban \mainlanguage[de] \setuppapersize[A7,landscape] \setuplayout[topspace=0mm,bottom=0mm,width=90mm,height=70mm] \setuppagenumbering[location=none,state=stop] %\setuplinenumbering[method=file] \starttext \startlinenumbering \startlines Und doch, wie viel wahnsinniger, einen Freund, weil ers in einer Kleinigkeit versah, die nur ein Mensch, mit dem gar nicht zu leben ist, ihm nicht verzeihen konnte, gleich dafür zu hassen und zu fliehen, wie den Ruso … \stoplines \stoplinenumbering % aus: C. M. Wieland, Horazens Satiren. Weimar 1786 (2. Aufl. 1804) \stoptext \start \setupparagraphnumbering[state=start] \startlines ... \stoplines \stop Wolfgang ___ 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 ___
[NTG-context] Re: expanded doif's
Hans van der Meer schrieb am 17.06.2024 um 09:01: I want to show an errormessage when the macro is undefined. It requires expansion of \xmlatt{#1}{name}. \ifdefined\xmlatt{#1}{name} didn't worked nor \expandafter\ifdefined I thought of the expanding \doif's. See the attached output of this xmlsetup attached. \startxmlsetups hvdm:system:macrocall % \doifelsedefined{\xmlatt{#1}{name}} { % %macro without argument % \ifxmlattempty{#1}{arg} \begincsname\xmlatt{#1}{name}\endcsname % %macro with argument % \else \begincsname\xmlatt{#1}{name}\endcsname{\xmlatt{#1}{arg}} \fi } { \ERROR{macro \xmlatt{#1}{name} is not defined} } \stopxmlsetups I have no idea what's wrong in your code without a proper minimal example. As the example below shows you can use \doifelsedefined in combination with \xmlatt. \startbuffer[ifdefined] \stopbuffer \startxmlsetups xml:document \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:macro \doifelsedefined{\xmlatt{#1}{name}} {\texdefinition{\xmlatt{#1}{name}}{\xmlatt{#1}{arg}}} {{\tttf macro \tex{\xmlatt{#1}{name}} not defined}} % \ifcsname\xmlatt{#1}{name}\endcsname % \lastnamedcs{\xmlatt{#1}{arg}} % \else % % % \fi \stopxmlsetups \startxmlsetups xml:hvdm \xmlsetsetup{\xmldocument}{document|macro}{xml:*} \stopxmlsetups \xmlregistersetup{xml:hvdm} \starttext \xmlprocessbuffer{hvdm}{ifdefined}{} \stoptext Wolfgang ___ 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 ___
[NTG-context] Re: expanded doif's
Hans van der Meer via ntg-context schrieb am 16.06.2024 um 22:29: I remember there was an incantation to work with expanded doif's etc. In this case I need \doifelsedefined{ARG} with ARG expanded. I lost the exact spelling of the command and dldn't find it in the garden. What was it? Can you provide a example where you have problems with \doifdefined etc. Wolfgang ___ 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 ___
[NTG-context] Re: Math manual
skyhorse--- via ntg-context schrieb am 16.06.2024 um 18:59: Mikael Sundqvist wrote: ./tex/texmf-context/doc/context/documents/general/manuals/mathincontext-screen.pdf ./tex/texmf-context/doc/context/documents/general/manuals/mathincontext-paper.pdf Sorry about my locational ignorance, but where can I view this document? I only have - math-mkiv.pdf - math-tweaks.pdf in my dir: /opt/context-lmtx/tex/texmf-context/doc/context/documents/general/manuals Can you please provide me with the URL to the directory? You need at least version 2024.06.14 to get the manuals, if they are missing on your system the installed context version is tool old. Another way to get the manuals is from the Pragma website: - https://www.pragma-ade.com/general/manuals/mathincontext-paper.pdf - https://www.pragma-ade.com/general/manuals/mathincontext-screen.pdf Wolfgang ___ 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 ___
[NTG-context] Re: Prefix the text in an enumeration.
Gerion Entrup schrieb am 14.06.2024 um 11:01: Am Donnerstag, 13. Juni 2024, 16:31:58 MESZ schrieb Wolfgang Schuster: \startsetups[question:intro] \setupparagraphintro[first][\bold{Answer:} ] \blank \stopsetups \defineenumeration[question][ alternative=top, text=Question, title=yes, titleleft=, titleright=, right={:}, headstyle=bold, inbetween=\setup{question:intro}, ] \starttext Some text: \startquestion[title={How long does a loop last?}] For a while. \stopquestion \stoptext Thank you. That works well for this case. I have a follow up question. I tried to additionally set a titledistance and reproduce that for the "Answer:"-part. ConTeXt then introduces a mysterious newline. See this example: \definehspace[dist][1em] \startsetups[question:intro] \setupparagraphintro[first][\bold{Answer:}\hspace[1em]] \blank \stopsetups You need 2 changes for \setupparagraphintro: 1. Change the argument of \hspace to "dist" because the commands accepts only keywords and everything else (even a valid length) is ignored and results in a horizontal skip of 0pt. 2. You have to add curly braces around the content when the content includes square brackets because nesting of optional arguments isn't supported yet. The correct version of the one above is: \startsetups[question:intro] \setupparagraphintro[first][{\bold{Answer:}\hspace[dist]}] \blank \stopsetups Wolfgang ___ 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 ___
[NTG-context] Re: Prefix the text in an enumeration.
Gerion Entrup schrieb am 13.06.2024 um 13:41: Hi, is there a way to automatically prefix the text body in an enumeration? Consider this example: ``` \defineenumeration[question][ alternative=top, text=Question, title=yes, titleleft=, titleright=, right={:}, headstyle=bold, ] \starttext Some text: \startquestion[title={How long does a loop last?}] \bold{Answer:} For a while. \stopquestion \stoptext ``` I'd like to have the `\bold{Answer:}` automatically. So for example something like this: ``` \defineenumeration[question][ alternative=top, text=Question, title=yes, titleleft=, titleright=, right={:}, headstyle=bold, prefix={\bold{Answer:}}, ] \starttext Some text: \startquestion[title={How long does a loop last?}] For a while. \stopquestion \stoptext ``` I tried to misuse `inbetween` for that but `alternative=top` seems to make a (not modifiable space) between the heading and the text body. Use the \setupparagraphintro command to set the text which should appear at the start of the question. begin example \startsetups[question:intro] \setupparagraphintro[first][\bold{Answer:} ] \blank \stopsetups \defineenumeration[question][ alternative=top, text=Question, title=yes, titleleft=, titleright=, right={:}, headstyle=bold, inbetween=\setup{question:intro}, ] \starttext Some text: \startquestion[title={How long does a loop last?}] For a while. \stopquestion \stoptext end example Wolfgang ___ 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 ___