parent_url
stringlengths
41
46
parent_score
stringlengths
1
4
parent_body
stringlengths
25
35.5k
parent_user
stringlengths
37
42
parent_title
stringlengths
12
150
accepted
bool
2 classes
body
stringlengths
4
36.7k
score
stringlengths
1
4
user
stringlengths
37
42
answer_id
stringlengths
1
6
__index_level_0__
int64
0
322k
https://tex.stackexchange.com/questions/682062
5
I have a relatively complicated table with a lot of manual adjustments to the column widths and spacing that I am trying to convert to a `standalone` pdf (for the purpose of ultimately inserting it into a Word Doc). The original table text is below: ``` \begin{table}[h!] \begin{center} \begin{tabularx}{0.7\textwidth}{>{\raggedright\arraybackslash}X >{\raggedleft\arraybackslash}X } \hline \hline \vspace{1mm} & Initiate conflict \\ \Xhline{2\arrayrulewidth} First = female & $-0.08$ \\ & $(0.05)$ \\ Second = prefer not to say & $-0.21$ \\ & $(0.18)$ \\ Third = non-binary/non-conforming & $-0.18$ \\ & $(0.12)$ \\ (Intercept) & $0.35^{***}$ \\ & $(0.03)$ \\ \hline R$^2$ & $0.01$ \\ Adj. R$^2$ & $0.01$ \\ Num. obs. & $404$ \\ \hline \hline \multicolumn{2}{l}{\scriptsize{$^{***}p<0.001$; $^{**}p<0.01$; $^{*}p<0.05$}} \end{tabularx} \\ \parbox{11cm}{\caption{Random caption inserted as a placeholder for what I am actually going to say, which will be a sentence or two long in the end I think.}} \label{table:coefficients} \end{center} \end{table} ``` Any guidance on how to successfully make this work in a document type `standalone` would be greatly appreciated. Alternatively, if there is an easier way to put such a table into a Word Doc, I am open to suggestions.
https://tex.stackexchange.com/users/294538
LaTeX Table to Standalone?
false
I would personally combine values with uncertainties in one line. I find it clearer to read. Also since `siunitx` parses uncertainties this way, it's possible to use an alternative format if you add `separate-uncertainty` to settings. The code below also employ `threeparttable` (inpsired by [Mico](https://tex.stackexchange.com/a/682065/31283)'s answer) in order to stack two separate tables and maintain centred alignment where uncertainties are not included. ``` \documentclass[margin=2.5mm]{standalone} \usepackage{array} \usepackage{threeparttable} \usepackage{booktabs} \usepackage{siunitx} \sisetup{ uncertainty-mode=full, uncertainty-separator=\,, table-column-width=2.4cm, } \begin{document} \begin{threeparttable} \begin{tabular}{p{6cm} S[table-format=-1.2(1)]} \toprule & {\clap{Initiate conflict}} \\ \midrule First = female & -0.08(0.05) \\ Second = prefer not to say & -0.21(0.18) \\ Third = non-binary/non-conforming & -0.18(0.12) \\ (Intercept) & 0.35(0.03)$^{***}$ \\ \end{tabular} \vspace{\dimexpr6pt-\lineskip}% \begin{tabular}{p{6cm} S[table-format=-1.2]} R$^2$ & 0.01 \\ Adj. R$^2$ & 0.01 \\ Num. obs. & {$\phantom{-}404$} \\ \midrule \multicolumn{2}{l}{\scriptsize{$^{***}p<0.001$; $^{**}p<0.01$; $^{*}p<0.05$}} \end{tabular} \end{threeparttable} \end{document} ```
5
https://tex.stackexchange.com/users/31283
682089
316,487
https://tex.stackexchange.com/questions/682092
0
I am writing assignments for university and they have to be in Latvian. I use the babel package as it gives the most appropriate formatting out of the box. It's not enough so I also use titlesec to change the formatting of the sections slightly (different font size, bold and centered). I discovered that just loading the titlesec and babel package immediately gives errors "Undefined control sequence" and "Missing number, treated as zero" with \section{} but it does not give errors with \section\*{} ``` \documentclass[12pt]{article} \usepackage[latvian]{babel} \usepackage{titlesec} \begin{document} \section*{First section} First section text \section{Second section text} \end{document} ``` Here is the full error message: ``` ! Undefined control sequence. \the@chapter ...ed \relax \else \ifnum \c@chapter >\z@ \thechapter \fi \fi l.20 \section{Second section text} ``` **Can the error be prevented at all? How could I circumvent said error while still using latvian babel?**
https://tex.stackexchange.com/users/241595
Possible babel latvian and titlesec conflict?
true
The package isn't correctly checking if the class has chapters. Simplest workaround is just to define an unused chapter counter. ``` \documentclass[12pt]{article} \usepackage[latvian]{babel} \usepackage{titlesec} \newcounter{chapter} \begin{document} \section*{First section} First section text \section{Second section text} \end{document} ```
3
https://tex.stackexchange.com/users/1090
682101
316,488
https://tex.stackexchange.com/questions/682113
0
Compiling the MWE ``` \documentclass{book} \usepackage[x-1a1]{pdfx}% also loads hyperref \usepackage{amsmath} \usepackage[amsmath,amsthm,thref,thmmarks]{ntheorem} \usepackage{cleveref} \newtheorem{theorem}{Theorem} \begin{document} \chapter{foo}\label{ch:foo} \begin{theorem}[bar's theorem]\label{thm:bar} bar. \begin{align} 1 &=1 \label{eq} \end{align} \end{theorem} \Cref{ch:foo,thm:bar,eq} are important. \end{document} ``` twice with `pdfTeX` or `LuaHBTeX` on `TeX Live 2023` leads to the the error > > ./packageClashMWE.tex:21: Argument of @fifthoffive has an extra > }. > > > <inserted text> > > > \par > > > l.21 \Cref{sec: fooSection,theo,eq} are important. > > > This was not an issue on the `hyperref` shipped in the early version of `TeX Live 2022`. The problem does not occur if either 1. `pdfx` (which relies on `hyperref`) and `hyperref`, or 2. all instances of `cleveref`, or 3. all instances of `nteorem` are removed. Of course, this is an unwanted limitation.
https://tex.stackexchange.com/users/128553
Conflict of pdfx (hyperref), ntheorem, and cleveref
true
The option `thref` of `ntheorem` is not necessary as you may use the tools provided by `cleveref` instead of `\thref`. The following simple change runs without the error. ``` \documentclass{article} \usepackage[x-1a1]{pdfx}% also loads hyperref \usepackage{amsmath} \usepackage[amsmath,amsthm,thmmarks]{ntheorem}% observe the small change \usepackage{cleveref} \newtheorem{theorem}{Theorem} \begin{document} \section{section foo}\label{sec: fooSection} \begin{theorem}[foo thoerem]\label{theo} bar. \begin{align} 1 &=1 \label{eq} \end{align} \end{theorem} \Cref{sec: fooSection,theo,eq} are important. \end{document} ```
2
https://tex.stackexchange.com/users/128553
682114
316,491
https://tex.stackexchange.com/questions/682111
2
TikZ spy and Beamer \pause, \onslide, ... do not seem to work well together. This has been observed in several previous, albeit older questions (in particular, [1](https://tex.stackexchange.com/questions/88251/tikz-spy-and-beamer-uncover) and [2](https://tex.stackexchange.com/questions/438218/beamer-uncover-magnification-using-tikz-spy-library) ), but the workarounds shown there do not work for me. M(N)WE: ``` \documentclass[tikz]{beamer} \usepackage{tikz} \usetikzlibrary{spy} % following https://tex.stackexchange.com/questions/88251/tikz-spy-and-beamer-uncover and https://tex.stackexchange.com/questions/438218/beamer-uncover-magnification-using-tikz-spy-library: \tikzset{ invisible/.style={opacity=0,text opacity=0}, visible on/.style={alt={#1{}{invisible}}}, connect on/.style={alt={#1{connect spies}{}}}, alt/.code args={<#1>#2#3}{% \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} }, } \begin{document} \begin{frame} \frametitle{test} \begin{tikzpicture}[spy using outlines={magnification=4, size=2cm, connect spies}] \node (first) {Initial text}; % simple approach fails: \onslide <2-> \spy on (first) in node at (2,-2); % this fails as well: https://tex.stackexchange.com/questions/88251/tikz-spy-and-beamer-uncover % \only<2->{ % \spy[overlay] on (first) in node at (2,-2); % } % approach inspired by https://tex.stackexchange.com/questions/438218/beamer-uncover-magnification-using-tikz-spy-library % fails as well % \spy[visible on=<2->] on (first) in node at (2,-2); % rewording as fails: % \spy[connect on=<2->] on (first) in node[visible on=<2->] at (2,-2); % spy does not seem to be overlay-aware, e.g. the following does not work % \spy<2-> on (first) in node at (2,-2); \onslide<3-> \node at (0,-4) (third) {Third text}; \onslide<4-> \node at (0,-6) (fourth) {Fourth text}; \end{tikzpicture} \end{frame} \end{document} ``` My expectation is to have the spy show up on the second slide, but it always only shows up on the last slide. MWE comprises the workarounds from the links above, but I do not see any difference in behaviour and cannot reproduce these solutions. Any hints?
https://tex.stackexchange.com/users/160165
Using spy with Beamer animations?
true
I would not use `\pause` or `\onslide` in a tikzpicture, this can have "funny" side effects like making footlines disappear. The solutions from your linked questions work fine if you refrain from using `\onslide` for the text on your 3rd and 4th overlays: ``` \documentclass[tikz]{beamer} \usepackage{tikz} \usetikzlibrary{spy} % following https://tex.stackexchange.com/questions/88251/tikz-spy-and-beamer-uncover and https://tex.stackexchange.com/questions/438218/beamer-uncover-magnification-using-tikz-spy-library: \tikzset{ connect on/.style={alt={#1{connect spies}{}}}, } \usetikzlibrary{overlay-beamer-styles} \begin{document} \begin{frame} \frametitle{test} \begin{tikzpicture}[spy using outlines={magnification=4, size=2cm, connect spies}] \node (first) {Initial text}; \spy[overlay,visible on=<2->] on (first) in node at (2,-2); \node[visible on=<3->] at (0,-4) (third) {Third text}; \node[visible on=<4->] at (0,-6) (fourth) {Fourth text}; \end{tikzpicture} \end{frame} \end{document} ```
1
https://tex.stackexchange.com/users/36296
682115
316,492
https://tex.stackexchange.com/questions/682097
1
Not sure how to describe my problem since the situation is weird . Recently I found that Overleaf would automatically "misplace" the math mode . For example " $ \lim\_{ n \to \infty} a\_n $ " will become " lim n→∞ an \lim\_{n \to infty} a\_n " , the dollar symbol is removed and the symbols are copied pasted . I'm sure this is not typo becuse it happens so frequently . Did anyone also encounter this problem ? Here is a part of my code (automatically misplaced version) ``` \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{CJKutf8} \usepackage{amsmath} \usepackage{bm} \usepackage{amssymb} \usepackage{graphicx} \usepackage{cancel} \usepackage[margin=2cm]{geometry} \title{AP exercise ch10} \date{} \begin{document} \maketitle\noindent \textbf{Exercise 10.1.4} \\ We observe that if x<12x < \frac{1}{2} , ψ(x)=2x<1\psi(x) = 2x < 1 and if 12<x<1 \frac{1}{2} < x < 1 , ψ(x)=2x−1\psi(x) = 2x - 1 . So for any [a,b]⊂[0,1)[a,b] \subset [ 0 , 1 ) , we separate ψ−1([a,b])\psi^{-1}([a,b]) into two parts i.e \begin{align*} \psi^{-1}( [ a , b ] ) \cap [0 , \frac{1}{2} ) & = \{ x \in [ 0 , 1 ) \; \rvert \; x < \frac{1}{2} \; , \; x \in [ \frac{a}{2} , \frac{b}{2}] \} = [\frac{a}{2} , \frac{b}{2}] \\ \psi^{-1}( [ a , b ] ) \cap (\frac{1}{2} , 1 ) &= \{ x \in [ 0 , 1 ) \; \rvert \; \frac{1}{2} < x < 1 \; , \; x \in [ \frac{1+a}{2} , \frac{1+b}{2}] \} = [\frac{1+a}{2} , \frac{1+b}{2}] \end{align*} Hence $\mu(\psi^{-1}([a,b])) = \mu( [\frac{a}{2} , \frac{b}{2} ]) + \mu([\frac{1+a}{2} , \frac{1+b}{2}] ) = b- a = \mu([b,a])$ . ```
https://tex.stackexchange.com/users/294569
Overleaf math mode misplacing bug?
true
My guess is that you really need to check your browser settings: Not only have lots of instances of `$` gone missing, but there are also (at least) six instances -- in just the code fragment you've posted -- of inline math expressions having been "doubled up". E.g., `ψ(x)=2x<1` is prefixed to `\psi(x) = 2x < 1`, `12<x<1` is prefixed to `\frac{1}{2} < x < 1`, etc. Not being much on Overleaf user myself, all I can suggest is that you contact their helpdesk directly and ask them for assistance in fixing your browser settings. Anyway, after supplying the missing instances of `$`, commenting out the funky code doublets, and addressing other, slightly odd aspects of your code -- e.g., by replacing `\; \rvert \;` with `\bigm\vert` -- one is left with the following code, which may be close to what you actually want. ``` \documentclass{article} %\usepackage[utf8]{inputenc} % that's the default nowadays \usepackage{CJKutf8} % are you sure you need this? \usepackage{amsmath} \usepackage{bm} \usepackage{amssymb} \usepackage{graphicx} \usepackage{cancel} \usepackage[margin=2cm]{geometry} \begin{document} \noindent \textbf{Exercise 10.1.4} \noindent We observe that if %x<12 %% huh?! #1 $x < \frac{1}{2}$, %ψ(x)=2x<1 %% huh?! #2 $\psi(x) = 2x < 1$ and if %12<x<1 %% huh?! #3 $\frac{1}{2} < x < 1$, %ψ(x)=2x−1 %% huh?! #4 $\psi(x) = 2x - 1$. So for any %[a,b]⊂[0,1) %% huh?! #5 $[a,b] \subset [ 0 , 1 )$, we separate %ψ−1([a,b]) %% huh?! #6 $\psi^{-1}([a,b])$ into two parts, i.e., \begin{align*} \psi^{-1}( [ a , b ] ) \cap \bigl[0 , \tfrac{1}{2} \bigr) &= \bigl\{ x \in [ 0 , 1 ) %\; \rvert \; \bigm\vert 0 < x < \tfrac{1}{2} %\; , \; ,\ x \in \bigl[ \tfrac{a}{2} , \tfrac{b}{2}\bigr] \bigr\} = \bigl[ \tfrac{a}{2} , \tfrac{b}{2}\bigr] \\ \psi^{-1}( [ a , b ] ) \cap \bigl(\tfrac{1}{2} , 1 \bigr) &= \bigl\{ x \in [ 0 , 1 ) %\; \rvert \; \bigm\vert \tfrac{1}{2} < x < 1 %\; , \; ,\ x \in \bigl[ \tfrac{1+a}{2} , \tfrac{1+b}{2}\bigr] \bigr\} = \bigl[ \tfrac{1+a}{2} , \tfrac{1+b}{2}\bigr] \end{align*} Hence $\mu\bigl(\psi^{-1}([a,b])\bigr) = \mu\bigl( \bigl[\frac{a}{2} , \frac{b}{2} \bigr]\bigr) + \mu\bigl(\bigl[\frac{1+a}{2} , \frac{1+b}{2}\bigr] \bigr) = b- a = \mu([b,a])$. \end{document} ```
1
https://tex.stackexchange.com/users/5001
682118
316,493
https://tex.stackexchange.com/questions/682100
2
I have created an article with a bibliography (natbib + BibDesk, using commands `\citet` and `\citep`). Since I have to submit the .tex file, and my master file.bib is very big, I need a .bib file containing just the items cited in my paper. Is there an easy way to do this on iMac?
https://tex.stackexchange.com/users/85519
Extract short .bib file from paper
true
Yes, there is an easy way to do this. When you run LaTeX on your .tex file, it generates an .aux file in the same folder. In [BibDesk](https://bibdesk.sourceforge.io/) and [Better BibTeX for Zotero](https://retorque.re/zotero-better-bibtex/) and [JabRef](https://www.jabref.org/) (and perhaps in other reference management software as well), there is a command that selects or exports all the bibliography items that are cited in an .aux file. In BibDesk, the relevant command is the menu item **Database → Select Publications from .aux File** (*or* simply drag the .aux file onto the main table of publications). In Better BibTeX for Zotero, the command is **Tools → Scan BibTeX AUX file for references**. In JabRef, the command is **Tools** → **New subdatabase based on AUX file**. Then export the selected items to a new .bib file. If you prefer to use the command line, Gerd Neugebauer's multipurpose [BibTool](https://ctan.org/pkg/bibtool) could be a good choice, as it provides a simple command-line option for the task: `bibtool -x document.aux -o document.bib`.
2
https://tex.stackexchange.com/users/121590
682119
316,494
https://tex.stackexchange.com/questions/682122
1
This is asking for a clarification on a package suggested for cross-referencing with hyperlinks using online editors in this question: [Cross-referencing between different files](https://tex.stackexchange.com/questions/14364/cross-referencing-between-different-files) . My folder structure might cause the suggested solution to fail. In my preamble, I call: ``` \usepackage{zref-xr} ``` Below that I define: ``` \makeatletter \newcommand*{\addFileDependency}[1]{% argument=file name and extension \typeout{(#1)} \@addtofilelist{#1} \IfFileExists{#1}{}{\typeout{No file #1.}} } \makeatother \newcommand*{\myexternaldocument}[1]{% \zexternaldocument{#1}% \addFileDependency{#1.tex}% \addFileDependency{#1.aux}% } ``` Now, in a folder, I have the file: ``` chapter2/main.tex ``` in which I call: ``` \myexternaldocument{Appendices/appendix_to_chapter2} ``` Obviously, there exists a folder Appendices containing a file "appendix\_to\_chapter2.tex" However when compiling this, I get the error message: ``` Package zref-xr Warning: File `Appendices/appendix_to_chapter2.aux' not found or empty, labels not imported on input line 2. ``` I am not sure how to provide a MWE replicating a specific folder structure but I suspect the error is in renaming something. Does anyone know what I can do please?
https://tex.stackexchange.com/users/294578
Cross-referencing between files on Overleaf using zref-xr
false
Ok, I found the answer to the question myself. I forgot to include appendix\_to\_chapter2.tex to the main file. Clearly, the file wasn't created before so there was no .aux file either. Now it works fine. I hope this helps anyone in the future.
1
https://tex.stackexchange.com/users/294578
682123
316,496
https://tex.stackexchange.com/questions/682096
3
> > EDIT2: Sorry for this real time updates, but I am really going crazy. > I added at the bottom the new code that is compiling correctly with > showhexapagesStepOne > > > *I edited the question trying to give more cartesian organization to the whole endeavour. Changed also the code provided with something closer to correctness (I hope).* I would like to use a standard book document and change the numbering of pages inside fancyhdr. In particular I want the pages to be printed in hex style 0xABCD. I have tried almost everything (i am not posting all the code attempts here because it would be embarassing), namely: 1. pythonTex (just after immediatepython): stuck at trying to pass a LaTex counter before the counter really could be updated into the document. I renounced after 2 days. 2. hex package (very old by Eric Domenjoud) but it is still using documentstyle and I got stuck in converting a old /usename directive 3. tried also binhex package but same problem: counter expansion. Now I am trying to make it work with fmtcount package. My preamble contain this fancyheader part before the document begins (just on top of it there are few experiments with the counters): ``` \newcounter{hexapages} \newcommand\showhexapagesStepOne{% \setcounter{hexapages}{\thepage}% \thehexapages% } \newcommand\showhexapagesStepTwo{% If I make showhexapagesStepOne work, this will work as well \setcounter{hexapages}{\thepage}% \HEXADecimal(hexapages)% or maybe thehexapages ??? } \setlength{\headheight}{15pt} \pagestyle{fancy} \renewcommand{\chaptermark}[1]{ \markboth{#1}{} } \renewcommand{\sectionmark}[1]{ \markright{#1} } \fancyhf{} %\fancyhead[LE]{{\thepage}} %obviously compiles %\fancyhead[RO]{{\thepage}} %obviously compiles \fancyhead[LE]{{\showhexapagesStepOne}} % does not compile \fancyhead[RO]{{\showhexapagesStepOne}} % does not compile \fancyhead[RE]{\textit{ \nouppercase{\leftmark}} } \fancyhead[LO]{\textit{ \nouppercase{\rightmark}} } \fancyheadoffset[LE]{14mm} ``` The current error is: (foreword.tex ! Missing number, treated as zero. i l.9 [I think Latex is trying to apply the conversion to something that is numbered in roman style...so I should differentiate between frontmatter and mainmatter....] What seems to fail is trying to pass any counter (predefined as \thepage or custom made as \thehexapages) into any placeholder of fancy header. The first attemtps with PythonTex were intended to create a macro that was doing the translation of any number into its hex conversion, but failed when the argument became counters. How should I do it? Why fancyheader takes \thepage like a charm and refuses whatever else? If a try HEXADecimalnum{459} it prints correctly "1CB". So, it is not the fmtcount package giving issues. Start of EDIT2: The new code is: ``` \newcounter{hexapages} \newcommand\showhexapagesStepOne{% \setcounter{hexapages}{\thepage}% \thehexapages% } \newcommand\showhexapagesStepTwo{% \setcounter{hexapages}{\thepage}% \HEXADecimal(hexapages)% or maybe thehexapages ??? } \setlength{\headheight}{15pt} \pagestyle{fancyplain} \fancyhf{} \fancypagestyle{plain}{ % \fancyhf{} % remove everything \renewcommand{\headrulewidth}{0pt} % remove lines as well \renewcommand{\footrulewidth}{0pt} } \pagestyle{fancy} \fancyhf{} \renewcommand{\chaptermark}[1]{ \markboth{#1}{} } \renewcommand{\sectionmark}[1]{ \markright{#1} } %\fancyhead[LE]{{\thepage}} %\fancyhead[RO]{{\thepage}} \fancyhead[LE]{{\showhexapagesStepOne}} \fancyhead[RO]{{\showhexapagesStepOne}} \fancyhead[RE]{\textit{ \nouppercase{\leftmark}} } \fancyhead[LO]{\textit{ \nouppercase{\rightmark}} } \fancyheadoffset[LE]{14mm}% slightly less than 0.25in \fancyheadoffset[RO]{14mm}% \renewcommand{\headrulewidth}{0pt} % remove lines as well \renewcommand{\footrulewidth}{0pt} % and after all the preamble definitions..... \frontmatter \pagestyle{plain} \include{dedication} \include{foreword} \include{preface} \include{acknowledgement} \tableofcontents \include{acronym} \mainmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \pagestyle{fancy} \fancyhf{} \renewcommand{\chaptermark}[1]{ \markboth{#1}{} } \renewcommand{\sectionmark}[1]{ \markright{#1} } %\fancyhead[LE]{{\thepage}} %\fancyhead[RO]{{\thepage}} \fancyhead[LE]{{\showhexapagesStepTwo}} \fancyhead[RO]{{\showhexapagesStepTwo}} \fancyhead[RE]{\textit{ \nouppercase{\leftmark}} } \fancyhead[LO]{\textit{ \nouppercase{\rightmark}} } \fancyheadoffset[LE]{14mm}% slightly less than 0.25in \fancyheadoffset[RO]{14mm}% \renewcommand{\headrulewidth}{0pt} % remove lines as well \renewcommand{\footrulewidth}{0pt} ``` This allows me to remove any heading and numbering in the frontmatter and leaves the fancy style only for the mainmatter. THe point is: now it prints arabic numbers correctly in the LE and RO angles using showhexapagesStepOne. When I switch to the StepTwo (the one containing the conversion) I get the error: ``` ! You can't use `\relax' after \the. <recently read> \c@( ``` Any clue?
https://tex.stackexchange.com/users/294568
Change page numbering in preamble - latex counter modification - hexadecimal conversion
false
The `\hex` command needs a number as its argument. When you use something like `\hex{\thepage}`, you should keep in mind that `\thepage` is sensitive to context. In `\frontmatter` it doesn't print numbers. Instead, it prints letters. To see what I mean, try this: ``` \documentclass{book} \begin{document} \frontmatter \verb|\thepage| prints \thepage. \mainmatter \verb|\thepage| prints \thepage. \end{document} ``` So something like `\hex{\thepage}` will obviously give you a `Missing number` error when `\frontmatter` is active, because, well, a number is actually missing! :) So the solution can be *much* simpler: ``` \documentclass{book} \usepackage{fancyhdr} \usepackage{lipsum} \input{binhex} \pagestyle{fancy} \begin{document} \frontmatter \pagenumbering{arabic}% \thepage will produce numbers. \cfoot{\hex{\thepage}} \lipsum[1-50] \end{document} ``` I don't know much about the hex style of numbering, but I can see `A` on page 10. So I suppose it is working.
1
https://tex.stackexchange.com/users/174620
682124
316,497
https://tex.stackexchange.com/questions/681408
1
I'm using latexdiff to produce a diff between the following two latex files. Original: ``` \documentclass{article} \begin{document} \begin{enumerate} \item{First item} \item{Second item} \item{Third item} \end{enumerate} \end{document} ``` Revised: ``` \documentclass{article} \begin{document} \begin{enumerate} \item{1st item} \item{2nd item} \item{3rd item} \end{enumerate} \end{document} ``` Unfortunately, it fails to produce a diff for the items in the diff file. From the output of `latexdiff --show-config`: ``` ITEMCMD=item LISTENV=(?:(?:itemize)|(?:description)|(?:enumerate)) ``` it seems that the tool is aware of the `enumerate` environment and the `list` command. Is diffing the `enumerate` environment a feature which latexdiff supports at all? Is this a bug? Or am I missing something here?
https://tex.stackexchange.com/users/294091
latexdiff does not diff enumerate environment
true
Indeed this is a bug as reported in: <https://github.com/ftilmann/latexdiff/issues/241> A workaround is to not use parentheses around each item. Then this works as expected.
1
https://tex.stackexchange.com/users/294091
682125
316,498
https://tex.stackexchange.com/questions/682096
3
> > EDIT2: Sorry for this real time updates, but I am really going crazy. > I added at the bottom the new code that is compiling correctly with > showhexapagesStepOne > > > *I edited the question trying to give more cartesian organization to the whole endeavour. Changed also the code provided with something closer to correctness (I hope).* I would like to use a standard book document and change the numbering of pages inside fancyhdr. In particular I want the pages to be printed in hex style 0xABCD. I have tried almost everything (i am not posting all the code attempts here because it would be embarassing), namely: 1. pythonTex (just after immediatepython): stuck at trying to pass a LaTex counter before the counter really could be updated into the document. I renounced after 2 days. 2. hex package (very old by Eric Domenjoud) but it is still using documentstyle and I got stuck in converting a old /usename directive 3. tried also binhex package but same problem: counter expansion. Now I am trying to make it work with fmtcount package. My preamble contain this fancyheader part before the document begins (just on top of it there are few experiments with the counters): ``` \newcounter{hexapages} \newcommand\showhexapagesStepOne{% \setcounter{hexapages}{\thepage}% \thehexapages% } \newcommand\showhexapagesStepTwo{% If I make showhexapagesStepOne work, this will work as well \setcounter{hexapages}{\thepage}% \HEXADecimal(hexapages)% or maybe thehexapages ??? } \setlength{\headheight}{15pt} \pagestyle{fancy} \renewcommand{\chaptermark}[1]{ \markboth{#1}{} } \renewcommand{\sectionmark}[1]{ \markright{#1} } \fancyhf{} %\fancyhead[LE]{{\thepage}} %obviously compiles %\fancyhead[RO]{{\thepage}} %obviously compiles \fancyhead[LE]{{\showhexapagesStepOne}} % does not compile \fancyhead[RO]{{\showhexapagesStepOne}} % does not compile \fancyhead[RE]{\textit{ \nouppercase{\leftmark}} } \fancyhead[LO]{\textit{ \nouppercase{\rightmark}} } \fancyheadoffset[LE]{14mm} ``` The current error is: (foreword.tex ! Missing number, treated as zero. i l.9 [I think Latex is trying to apply the conversion to something that is numbered in roman style...so I should differentiate between frontmatter and mainmatter....] What seems to fail is trying to pass any counter (predefined as \thepage or custom made as \thehexapages) into any placeholder of fancy header. The first attemtps with PythonTex were intended to create a macro that was doing the translation of any number into its hex conversion, but failed when the argument became counters. How should I do it? Why fancyheader takes \thepage like a charm and refuses whatever else? If a try HEXADecimalnum{459} it prints correctly "1CB". So, it is not the fmtcount package giving issues. Start of EDIT2: The new code is: ``` \newcounter{hexapages} \newcommand\showhexapagesStepOne{% \setcounter{hexapages}{\thepage}% \thehexapages% } \newcommand\showhexapagesStepTwo{% \setcounter{hexapages}{\thepage}% \HEXADecimal(hexapages)% or maybe thehexapages ??? } \setlength{\headheight}{15pt} \pagestyle{fancyplain} \fancyhf{} \fancypagestyle{plain}{ % \fancyhf{} % remove everything \renewcommand{\headrulewidth}{0pt} % remove lines as well \renewcommand{\footrulewidth}{0pt} } \pagestyle{fancy} \fancyhf{} \renewcommand{\chaptermark}[1]{ \markboth{#1}{} } \renewcommand{\sectionmark}[1]{ \markright{#1} } %\fancyhead[LE]{{\thepage}} %\fancyhead[RO]{{\thepage}} \fancyhead[LE]{{\showhexapagesStepOne}} \fancyhead[RO]{{\showhexapagesStepOne}} \fancyhead[RE]{\textit{ \nouppercase{\leftmark}} } \fancyhead[LO]{\textit{ \nouppercase{\rightmark}} } \fancyheadoffset[LE]{14mm}% slightly less than 0.25in \fancyheadoffset[RO]{14mm}% \renewcommand{\headrulewidth}{0pt} % remove lines as well \renewcommand{\footrulewidth}{0pt} % and after all the preamble definitions..... \frontmatter \pagestyle{plain} \include{dedication} \include{foreword} \include{preface} \include{acknowledgement} \tableofcontents \include{acronym} \mainmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \pagestyle{fancy} \fancyhf{} \renewcommand{\chaptermark}[1]{ \markboth{#1}{} } \renewcommand{\sectionmark}[1]{ \markright{#1} } %\fancyhead[LE]{{\thepage}} %\fancyhead[RO]{{\thepage}} \fancyhead[LE]{{\showhexapagesStepTwo}} \fancyhead[RO]{{\showhexapagesStepTwo}} \fancyhead[RE]{\textit{ \nouppercase{\leftmark}} } \fancyhead[LO]{\textit{ \nouppercase{\rightmark}} } \fancyheadoffset[LE]{14mm}% slightly less than 0.25in \fancyheadoffset[RO]{14mm}% \renewcommand{\headrulewidth}{0pt} % remove lines as well \renewcommand{\footrulewidth}{0pt} ``` This allows me to remove any heading and numbering in the frontmatter and leaves the fancy style only for the mainmatter. THe point is: now it prints arabic numbers correctly in the LE and RO angles using showhexapagesStepOne. When I switch to the StepTwo (the one containing the conversion) I get the error: ``` ! You can't use `\relax' after \the. <recently read> \c@( ``` Any clue?
https://tex.stackexchange.com/users/294568
Change page numbering in preamble - latex counter modification - hexadecimal conversion
false
Ganzo! I was just succeeding in posting the answer to this life draining issue while Niranjan commented. I found a solution with `fmtcount` package but he did not. Niranjan used `binhex`. How is that possible? I gave up on that! So, I tried again starting from my latest solution (the one I was writing the answer with) including his great hint on `binhex`. Actually `binhex` is fundamentally better **because it pads to the required alignment** in a matter of seconds! And in fact here below the solutionw ith both the packages. I will use `binhex` as proposed in the comment. **Really thanks!** ``` %---------------------------------------------------------------------------------------- % HEADERS & FOOTERS %---------------------------------------------------------------------------------------- % hexadecimal page numbers \newcommand\showhexapagesStepTwo{% %0x\HEXADecimal{hexapages} % this can work but it does not pad to any alignment 0x\nhex{4}{\thepage} } \setlength{\headheight}{15pt} \pagestyle{fancyplain} \fancyhf{} \fancypagestyle{plain}{ % \fancyhf{} % remove everything \renewcommand{\headrulewidth}{0pt} % remove lines as well \renewcommand{\footrulewidth}{0pt} } \pagestyle{fancy} \fancyhf{} \renewcommand{\chaptermark}[1]{ \markboth{#1}{} } \renewcommand{\sectionmark}[1]{ \markright{#1} } \fancyhead[LE]{{\showhexapagesStepTwo}} \fancyhead[RO]{{\showhexapagesStepTwo}} \fancyhead[RE]{\textit{ \nouppercase{\leftmark}} } \fancyhead[LO]{\textit{ \nouppercase{\rightmark}} } \fancyheadoffset[LE]{14mm}% slightly less than 0.25in \fancyheadoffset[RO]{14mm}% \renewcommand{\headrulewidth}{0pt} % remove lines as well \renewcommand{\footrulewidth}{0pt} ``` There is not even need for any proxy counter (`\thepage` fits perfectly once the `fancyhdr` directives are placed after document begins). I don't really know what I was doing wrong. Probably in the many many attempts I meesed up everything and lost sight on the solution. Anyway this is the only question on this aspect that I found on SO! or SE! so I am posting the solution for future use. A final note: the real issue was mainly connected to the usage of nested `thepage`before`\begin{document}`. I think special attention is necessary in such a case becaue the macro should not be expanded at definition but only when there is a real page to number underneath (so in the mainmatter usually). Regards Alex
2
https://tex.stackexchange.com/users/294568
682130
316,500
https://tex.stackexchange.com/questions/682099
0
I am using the `elsarticle` class. It defines: ``` \def\appendixname{Appendix } \renewcommand\appendix{\par \setcounter{section}{0}% \setcounter{subsection}{0}% \setcounter{equation}{0} \gdef\thefigure{\@Alph\c@section.\arabic{figure}}% \gdef\thetable{\@Alph\c@section.\arabic{table}}% \gdef\thesection{\appendixname~\@Alph\c@section}% \@addtoreset{equation}{section}% \gdef\theequation{\@Alph\c@section.\arabic{equation}}% \addtocontents{toc}{\string\let\string\numberline\string\tmptocnumberline}{}{} } ``` I use `amsmath` as following: ``` \usepackage{amsmath} \newtheorem{theorem}{Theorem}[section] ``` Therefore, the following code produces the following output: ``` \appendix \section{Test} \subsection{test} \begin{theorem} test \end{theorem} ``` I would like to keep the `Appendix A` section title, but name subsections and theorems without the `Appendix` prefix (`A.1`, `A.2`, etc.). If I use `\gdef\thesection{\@Alph\c@section}%`, then the section title will not be correct.
https://tex.stackexchange.com/users/294570
Having a different numbering for sections, subsections and theorems in appendix
false
I got it! ``` \renewcommand\thesection{\appendixname~\@Alph\c@section}% \renewcommand\thesubsection{\@Alph\c@section.\arabic{subsection}}% \renewcommand\thetheorem{\@Alph\c@section.\arabic{theorem}} ```
0
https://tex.stackexchange.com/users/294570
682131
316,501
https://tex.stackexchange.com/questions/682096
3
> > EDIT2: Sorry for this real time updates, but I am really going crazy. > I added at the bottom the new code that is compiling correctly with > showhexapagesStepOne > > > *I edited the question trying to give more cartesian organization to the whole endeavour. Changed also the code provided with something closer to correctness (I hope).* I would like to use a standard book document and change the numbering of pages inside fancyhdr. In particular I want the pages to be printed in hex style 0xABCD. I have tried almost everything (i am not posting all the code attempts here because it would be embarassing), namely: 1. pythonTex (just after immediatepython): stuck at trying to pass a LaTex counter before the counter really could be updated into the document. I renounced after 2 days. 2. hex package (very old by Eric Domenjoud) but it is still using documentstyle and I got stuck in converting a old /usename directive 3. tried also binhex package but same problem: counter expansion. Now I am trying to make it work with fmtcount package. My preamble contain this fancyheader part before the document begins (just on top of it there are few experiments with the counters): ``` \newcounter{hexapages} \newcommand\showhexapagesStepOne{% \setcounter{hexapages}{\thepage}% \thehexapages% } \newcommand\showhexapagesStepTwo{% If I make showhexapagesStepOne work, this will work as well \setcounter{hexapages}{\thepage}% \HEXADecimal(hexapages)% or maybe thehexapages ??? } \setlength{\headheight}{15pt} \pagestyle{fancy} \renewcommand{\chaptermark}[1]{ \markboth{#1}{} } \renewcommand{\sectionmark}[1]{ \markright{#1} } \fancyhf{} %\fancyhead[LE]{{\thepage}} %obviously compiles %\fancyhead[RO]{{\thepage}} %obviously compiles \fancyhead[LE]{{\showhexapagesStepOne}} % does not compile \fancyhead[RO]{{\showhexapagesStepOne}} % does not compile \fancyhead[RE]{\textit{ \nouppercase{\leftmark}} } \fancyhead[LO]{\textit{ \nouppercase{\rightmark}} } \fancyheadoffset[LE]{14mm} ``` The current error is: (foreword.tex ! Missing number, treated as zero. i l.9 [I think Latex is trying to apply the conversion to something that is numbered in roman style...so I should differentiate between frontmatter and mainmatter....] What seems to fail is trying to pass any counter (predefined as \thepage or custom made as \thehexapages) into any placeholder of fancy header. The first attemtps with PythonTex were intended to create a macro that was doing the translation of any number into its hex conversion, but failed when the argument became counters. How should I do it? Why fancyheader takes \thepage like a charm and refuses whatever else? If a try HEXADecimalnum{459} it prints correctly "1CB". So, it is not the fmtcount package giving issues. Start of EDIT2: The new code is: ``` \newcounter{hexapages} \newcommand\showhexapagesStepOne{% \setcounter{hexapages}{\thepage}% \thehexapages% } \newcommand\showhexapagesStepTwo{% \setcounter{hexapages}{\thepage}% \HEXADecimal(hexapages)% or maybe thehexapages ??? } \setlength{\headheight}{15pt} \pagestyle{fancyplain} \fancyhf{} \fancypagestyle{plain}{ % \fancyhf{} % remove everything \renewcommand{\headrulewidth}{0pt} % remove lines as well \renewcommand{\footrulewidth}{0pt} } \pagestyle{fancy} \fancyhf{} \renewcommand{\chaptermark}[1]{ \markboth{#1}{} } \renewcommand{\sectionmark}[1]{ \markright{#1} } %\fancyhead[LE]{{\thepage}} %\fancyhead[RO]{{\thepage}} \fancyhead[LE]{{\showhexapagesStepOne}} \fancyhead[RO]{{\showhexapagesStepOne}} \fancyhead[RE]{\textit{ \nouppercase{\leftmark}} } \fancyhead[LO]{\textit{ \nouppercase{\rightmark}} } \fancyheadoffset[LE]{14mm}% slightly less than 0.25in \fancyheadoffset[RO]{14mm}% \renewcommand{\headrulewidth}{0pt} % remove lines as well \renewcommand{\footrulewidth}{0pt} % and after all the preamble definitions..... \frontmatter \pagestyle{plain} \include{dedication} \include{foreword} \include{preface} \include{acknowledgement} \tableofcontents \include{acronym} \mainmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \pagestyle{fancy} \fancyhf{} \renewcommand{\chaptermark}[1]{ \markboth{#1}{} } \renewcommand{\sectionmark}[1]{ \markright{#1} } %\fancyhead[LE]{{\thepage}} %\fancyhead[RO]{{\thepage}} \fancyhead[LE]{{\showhexapagesStepTwo}} \fancyhead[RO]{{\showhexapagesStepTwo}} \fancyhead[RE]{\textit{ \nouppercase{\leftmark}} } \fancyhead[LO]{\textit{ \nouppercase{\rightmark}} } \fancyheadoffset[LE]{14mm}% slightly less than 0.25in \fancyheadoffset[RO]{14mm}% \renewcommand{\headrulewidth}{0pt} % remove lines as well \renewcommand{\footrulewidth}{0pt} ``` This allows me to remove any heading and numbering in the frontmatter and leaves the fancy style only for the mainmatter. THe point is: now it prints arabic numbers correctly in the LE and RO angles using showhexapagesStepOne. When I switch to the StepTwo (the one containing the conversion) I get the error: ``` ! You can't use `\relax' after \the. <recently read> \c@( ``` Any clue?
https://tex.stackexchange.com/users/294568
Change page numbering in preamble - latex counter modification - hexadecimal conversion
true
Here's a fairly general way to print the page number in hexadecimal format, with fully expandable commands. ``` \documentclass{article} \usepackage[a6paper]{geometry} % just to show several pages \usepackage{lipsum} % filler text \usepackage{fancyhdr} \fancyhf{} \fancyfoot[C]{\texttt{\thepage}} \renewcommand{\headrulewidth}{0pt} \pagestyle{fancy} \ExplSyntaxOn \NewExpandableDocumentCommand{\printhex}{O{4}m} {% #1 = number of digits, #2 = integer 0x \prg_replicate:nn { #1 - \tl_count:e { \int_to_Hex:n { #2 } } } { 0 } \int_to_Hex:n { #2 } } \cs_generate_variant:Nn \tl_count:n { e } \ExplSyntaxOff \renewcommand{\thepage}{\printhex{\value{page}}} \begin{document} \raggedright % don't bother with overfull boxes \lipsum \clearpage \setcounter{page}{6700} \lipsum \end{document} ``` In the picture I show the two pages before and after `\clearpage`, in order to show that page 6700 is correctly shown as `0x1A2C`.
2
https://tex.stackexchange.com/users/4427
682132
316,502
https://tex.stackexchange.com/questions/681091
0
I am trying to highlight some sections in an IEEE access template. So I added packages: ``` \usepackage[most]{tcolorbox} \newtcolorbox{highlighted}{colback=yellow,coltext=black,breakable} ``` when I have added this commands, I lost the subsection names and I get the error below. I also tried: ``` \usepackage{pagecolor} \usepackage{tikz} \usepackage{xcolor} \usepackage{soul} ``` They all collapse the template. The error for tcolorbox: > > Missing number, treated as zero. > > > --- ``` ‪/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex, 33 <to be read again> \gdef l.33 \ifnum \c@pgfmath@counta=0 A number should have been here; I inserted `0'. (If you can't figure out why I needed to see a number, look up `weird error' in the index to The TeXbook.) ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex))) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex \c@pgfmathroundto@lastzeros=\count310 )) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfint.code.tex) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex File: pgfcorepoints.code.tex 2021/05/15 v3.1.9a (3.1.9a) \pgf@picminx=\dimen267 \pgf@picmaxx=\dimen268 \pgf@picminy=\dimen269 \pgf@picmaxy=\dimen270 \pgf@pathminx=\dimen271 \pgf@pathmaxx=\dimen272 \pgf@pathminy=\dimen273 \pgf@pathmaxy=\dimen274 \pgf@xx=\dimen275 \pgf@xy=\dimen276 \pgf@yx=\dimen277 \pgf@yy=\dimen278 \pgf@zx=\dimen279 \pgf@zy=\dimen280 ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex File: pgfcorepathconstruct.code.tex 2021/05/15 v3.1.9a (3.1.9a) \pgf@path@lastx=\dimen281 \pgf@path@lasty=\dimen282 ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex File: pgfcorepathusage.code.tex 2021/05/15 v3.1.9a (3.1.9a) \pgf@shorten@end@additional=\dimen283 \pgf@shorten@start@additional=\dimen284 ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex File: pgfcorescopes.code.tex 2021/05/15 v3.1.9a (3.1.9a) \pgfpic=\box78 \pgf@hbox=\box79 \pgf@layerbox@main=\box80 \pgf@picture@serial@count=\count311 ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex File: pgfcoregraphicstate.code.tex 2021/05/15 v3.1.9a (3.1.9a) \pgflinewidth=\dimen285 ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex File: pgfcoretransformations.code.tex 2021/05/15 v3.1.9a (3.1.9a) \pgf@pt@x=\dimen286 \pgf@pt@y=\dimen287 \pgf@pt@temp=\dimen288 ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex File: pgfcorequick.code.tex 2021/05/15 v3.1.9a (3.1.9a) ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex File: pgfcoreobjects.code.tex 2021/05/15 v3.1.9a (3.1.9a) ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex File: pgfcorepathprocessing.code.tex 2021/05/15 v3.1.9a (3.1.9a) ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex File: pgfcorearrows.code.tex 2021/05/15 v3.1.9a (3.1.9a) \pgfarrowsep=\dimen289 ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex File: pgfcoreshade.code.tex 2021/05/15 v3.1.9a (3.1.9a) \pgf@max=\dimen290 \pgf@sys@shading@range@num=\count312 \pgf@shadingcount=\count313 ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex File: pgfcoreimage.code.tex 2021/05/15 v3.1.9a (3.1.9a) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex File: pgfcoreexternal.code.tex 2021/05/15 v3.1.9a (3.1.9a) \pgfexternal@startupbox=\box81 )) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex File: pgfcorelayers.code.tex 2021/05/15 v3.1.9a (3.1.9a) ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex File: pgfcoretransparency.code.tex 2021/05/15 v3.1.9a (3.1.9a) ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex File: pgfcorepatterns.code.tex 2021/05/15 v3.1.9a (3.1.9a) ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex File: pgfcorerdf.code.tex 2021/05/15 v3.1.9a (3.1.9a) ))) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex File: pgfmoduleshapes.code.tex 2021/05/15 v3.1.9a (3.1.9a) \pgfnodeparttextbox=\box82 ) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex File: pgfmoduleplot.code.tex 2021/05/15 v3.1.9a (3.1.9a) ) (/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty Package: pgfcomp-version-0-65 2021/05/15 v3.1.9a (3.1.9a) \pgf@nodesepstart=\dimen291 \pgf@nodesepend=\dimen292 ) (/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty Package: pgfcomp-version-1-18 2021/05/15 v3.1.9a (3.1.9a) )) (/usr/local/texlive/2022/texmf-dist/tex/latex/tools/verbatim.sty Package: verbatim 2020-07-07 v1.5u LaTeX2e package for verbatim enhancements \every@verbatim=\toks42 \verbatim@line=\toks43 \verbatim@in@stream=\read3 ) (/usr/local/texlive/2022/texmf-dist/tex/latex/environ/environ.sty Package: environ 2014/05/04 v0.3 A new way to define environments (/usr/local/texlive/2022/texmf-dist/tex/latex/trimspaces/trimspaces.sty Package: trimspaces 2009/09/17 v1.1 Trim spaces around a token list )) \tcb@titlebox=\box83 \tcb@upperbox=\box84 \tcb@lowerbox=\box85 \tcb@phantombox=\box86 \c@tcbbreakpart=\count314 \c@tcblayer=\count315 \c@tcolorbox@number=\count316 \tcb@temp=\box87 \tcb@temp=\box88 \tcb@temp=\box89 \tcb@temp=\box90 (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbraster.code.tex Library (tcolorbox): 'tcbraster.code.tex' version '5.1.1' \c@tcbrastercolumn=\count317 \c@tcbrasterrow=\count318 \c@tcbrasternum=\count319 \c@tcbraster=\count320 ) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex Library (tcolorbox): 'tcbskins.code.tex' version '5.1.1' (/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty (/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/utilities/pgffor.sty (/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex)) (/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/math/pgfmath.sty (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex)) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex Package: pgffor 2021/05/15 v3.1.9a (3.1.9a) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex) \pgffor@iter=\dimen293 \pgffor@skip=\dimen294 \pgffor@stack=\toks44 \pgffor@toks=\toks45 )) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex Package: tikz 2021/05/15 v3.1.9a (3.1.9a) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex File: pgflibraryplothandlers.code.tex 2021/05/15 v3.1.9a (3.1.9a) \pgf@plot@mark@count=\count321 \pgfplotmarksize=\dimen295 ) \tikz@lastx=\dimen296 \tikz@lasty=\dimen297 \tikz@lastxsaved=\dimen298 \tikz@lastysaved=\dimen299 \tikz@lastmovetox=\dimen300 \tikz@lastmovetoy=\dimen301 \tikzleveldistance=\dimen302 \tikzsiblingdistance=\dimen303 \tikz@figbox=\box91 \tikz@figbox@bg=\box92 \tikz@tempbox=\box93 \tikz@tempbox@bg=\box94 \tikztreelevel=\count322 \tikznumberofchildren=\count323 \tikznumberofcurrentchild=\count324 \tikz@fig@count=\count325 (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex File: pgfmodulematrix.code.tex 2021/05/15 v3.1.9a (3.1.9a) \pgfmatrixcurrentrow=\count326 \pgfmatrixcurrentcolumn=\count327 \pgf@matrix@numberofcolumns=\count328 ) \tikz@expandcount=\count329 (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex File: tikzlibrarytopaths.code.tex 2021/05/15 v3.1.9a (3.1.9a) ))) \tcb@waterbox=\box95 (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbskinsjigsaw.code.texLibrary (tcolorbox): 'tcbskinsjigsaw.code.tex' version '5.1.1' )) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbbreakable.code.tex Library (tcolorbox): 'tcbbreakable.code.tex' version '5.1.1' (/usr/local/texlive/2022/texmf-dist/tex/generic/oberdiek/pdfcol.sty Package: pdfcol 2019/12/29 v1.6 Handle new color stacks for pdfTeX (HO) (/usr/local/texlive/2022/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO) ) (/usr/local/texlive/2022/texmf-dist/tex/generic/infwarerr/infwarerr.sty Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO) )) Package pdfcol Info: New color stack `tcb@breakable' = 1 on input line 23. \tcb@testbox=\box96 \tcb@totalupperbox=\box97 \tcb@totallowerbox=\box98 ) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbhooks.code.tex Library (tcolorbox): 'tcbhooks.code.tex' version '5.1.1' ) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbtheorems.code.tex Library (tcolorbox): 'tcbtheorems.code.tex' version '5.1.1' ) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbfitting.code.tex Library (tcolorbox): 'tcbfitting.code.tex' version '5.1.1' \tcbfitdim=\dimen304 \tcb@lowerfitdim=\dimen305 \tcb@upperfitdim=\dimen306 \tcb@cur@hbadness=\count330 ) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcblistingsutf8.code.tex Library (tcolorbox): 'tcblistingsutf8.code.tex' version '5.1.1' (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex Library (tcolorbox): 'tcblistings.code.tex' version '5.1.1' (/usr/local/texlive/2022/texmf-dist/tex/latex/listings/listings.sty \lst@mode=\count331 \lst@gtempboxa=\box99 \lst@token=\toks46 \lst@length=\count332 \lst@currlwidth=\dimen307 \lst@column=\count333 \lst@pos=\count334 \lst@lostspace=\dimen308 \lst@width=\dimen309 \lst@newlines=\count335 \lst@lineno=\count336 \lst@maxwidth=\dimen310 (/usr/local/texlive/2022/texmf-dist/tex/latex/listings/lstmisc.sty File: lstmisc.sty 2020/03/24 1.8d (Carsten Heinz) \c@lstnumber=\count337 \lst@skipnumbers=\count338 \lst@framebox=\box100 ) (/usr/local/texlive/2022/texmf-dist/tex/latex/listings/listings.cfg File: listings.cfg 2020/03/24 1.8d listings configuration )) Package: listings 2020/03/24 1.8d (Carsten Heinz) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcblistingscore.code.tex Library (tcolorbox): 'tcblistingscore.code.tex' version '5.1.1' (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbprocessing.code.tex Library (tcolorbox): 'tcbprocessing.code.tex' version '5.1.1' (/usr/local/texlive/2022/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO) Package pdftexcmds Info: \pdf@primitive is available. Package pdftexcmds Info: \pdf@ifprimitive is available. Package pdftexcmds Info: \pdfdraftmode found. ) (/usr/local/texlive/2022/texmf-dist/tex/latex/tools/shellesc.sty Package: shellesc 2019/11/08 v1.0c unified shell escape interface for LaTeX Package shellesc Info: Unrestricted shell escape enabled on input line 75. )) \c@tcblisting=\count339 )) (/usr/local/texlive/2022/texmf-dist/tex/latex/listingsutf8/listingsutf8.sty Package: listingsutf8 2019-12-10 v1.5 Allow UTF-8 in listings input (HO) (/usr/local/texlive/2022/texmf-dist/tex/generic/stringenc/stringenc.sty Package: stringenc 2019/11/29 v1.12 Convert strings between diff. encodings (HO) (/usr/local/texlive/2022/texmf-dist/tex/generic/pdfescape/pdfescape.sty Package: pdfescape 2019/12/09 v1.15 Implements pdfTeX's escape features (HO) )))) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbexternal.code.tex Library (tcolorbox): 'tcbexternal.code.tex' version '5.1.1' ) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbmagazine.code.tex Library (tcolorbox): 'tcbmagazine.code.tex' version '5.1.1' ) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbvignette.code.tex Library (tcolorbox): 'tcbvignette.code.tex' version '5.1.1' (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex File: tikzlibraryfadings.code.tex 2021/05/15 v3.1.9a (3.1.9a) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/libraries/pgflibraryfadings.code.tex File: pgflibraryfadings.code.tex 2021/05/15 v3.1.9a (3.1.9a) ))) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbposter.code.tex Library (tcolorbox): 'tcbposter.code.tex' version '5.1.1' )) ! Extra \fi. <argument> ...op@@ }\expandafter \@firstofone \fi ```
https://tex.stackexchange.com/users/293869
IEEE access template tcolorbox problem
false
Hi i have solved problem by adding ``` \let\TeXyear\year \documentclass{ieeeaccess} \let\setyear\year \let\year\TeXyear \newcommand\hlc[1]{\colorbox{yellow}{\textcolor{black}{#1}}} \usepackage[most]{tcolorbox} \usepackage{tikz} \newtcolorbox{highlighted}{colback=yellow,coltext=black,breakable} \definecolor{accessblue}{cmyk}{1, 0.3, 0, 0.2} \definecolor{greycolor}{cmyk}{0,0,0,.8} ``` if somebody receives or faces same color problem ,when highlighting for ieee access template may use lines above.
0
https://tex.stackexchange.com/users/293869
682133
316,503
https://tex.stackexchange.com/questions/682127
1
I am using the acronym package for translations but I am facing nested parenthesis problems. The code: ``` \usepackage[printonlyused, withpage]{acronym} \acro{RTS}{Real-Time Systems} Sistemas de tempo real (\ac{RTS}) ``` PDF (the page number perfectly appears in the list of acronyms): > > > ``` > Sistemas de tempo real (Real-Time Systems (RTS)) > > ``` > > Is there a way to replace the parenthesis with "-", so that the final text is like below, and the page number is still referenced in the acronym list? > > Sistemas de tempo real (Real-Time Systems - RTS) > > > I have doubled the text and tried \acf. The final text is ok but it removes the page number from the acronym list. The code: ``` \usepackage[printonlyused, withpage]{acronym} %adiciona lista de acrônimos. \acro{RTS}{\textit{Real-Time System}} Sistemas de tempo real (\textit{Real-Time Systems} - \acf{RTS}) ``` PDF (page number does NOT appear in the list of acronyms): > > > ``` > Sistemas de tempo real (Real-Time Systems - RTS) > > ``` > > Any hints? Thanks
https://tex.stackexchange.com/users/294579
Nested parenthesis - acronym package
true
Yes, but it's not pretty, and redefines first-style for all acronyms. ``` \documentclass{article} \usepackage[printonlyused, withpage]{acronym} \makeatletter \renewcommand*{\@acf}[2][\AC@linebreakpenalty]{% \ifAC@footnote \acsfont{\AC@acs{#2}}% \footnote{\AC@placelabel{#2}\AC@acl{#2}{}}% \else \acffont{% \AC@placelabel{#2}\AC@acl{#2}% \nolinebreak[#1] --\nolinebreak[#1] % \acfsfont{\acsfont{\AC@acs{#2}}}% }% \fi \ifAC@starred\else\AC@logged{#2}\fi } \renewcommand*{\@Acf}[2][\AC@linebreakpenalty]{% \ifAC@footnote \acsfont{\AC@acs{#2}}% \footnote{\AC@placelabel{#2}\AC@Acl{#2}{}}% \else \acffont{% \AC@placelabel{#2}\AC@Acl{#2}% \nolinebreak[#1] --\nolinebreak[#1] % \acfsfont{\acsfont{\AC@acs{#2}}}% }% \fi \ifAC@starred\else\AC@logged{#2}\fi } \makeatother \begin{document} \begin{acronym} \acro{RTS}{Real-Time Systems} \end{acronym} Sistemas de tempo real (\ac{RTS}) \end{document} ``` > > Sistemas de tempo real (Real-Time Systems – RTS) > > > With [`acro`](https://ctan.org/pkg/acro) it's a lot nicer, you can define new styles at the user level and set them both locally and globally, or define new `\ac`-type commands. ``` \documentclass{article} \usepackage{acro} \DeclareAcronym{RTS}{ short = RTS, long = Real-Time Systems, first-style = long-short-dashed } \DeclareAcronym{CD}{ short = CD, long = compact disc, } \NewAcroTemplate{long-short-dashed}{% \acroiffirstTF{% \acrowrite{long}% \acspace--\acspace% \acroifT{foreign}{\acrowrite{foreign}, }% \acrowrite{short}% \acroifT{alt}{ \acrotranslate{or} \acrowrite{alt}}% \acrogroupcite }% {\acrowrite{short}}% } \NewAcroCommand{\acd}{m}{\UseAcroTemplate{long-short-dashed}{#1}} \begin{document} \printacronyms[pages={display=all}] Sistemas de tempo real (\ac*{RTS}) \ac{CD}\acreset{CD} \acd*{CD} \acsetup{first-style=long-short-dashed} \ac{CD} \end{document} ``` > > Sistemas de tempo real (Real-Time Systems) > compact disc (CD) > compact disc – CD > compact disc – CD > > > On top of that, [`acro`](https://ctan.org/pkg/acro) has built-in support for `foreign` acronyms ``` \documentclass{article} \usepackage{acro} \DeclareAcronym{RTS}{ short = RTS, long = sistemas de tempo real, foreign = Real-Time Systems, } \begin{document} \printacronyms[pages={display=all}] \Ac{RTS} \end{document} ``` > > Sistemas de tempo real (Real-Time Systems, RTS) > > > which seems to be what you're trying to do, and we can change the style to a dash with ``` \RenewAcroTemplate{long-short}{% \acroiffirstTF{% \acrowrite{long}% \acspace(% \acroifT{foreign}{\acrowrite{foreign} -- }% \acrowrite{short}% \acroifT{alt}{ \acrotranslate{or} \acrowrite{alt}}% \acrogroupcite ) }% {\acrowrite{short}}% } ``` > > Sistemas de tempo real (Real-Time Systems – RTS) > > >
0
https://tex.stackexchange.com/users/106162
682137
316,506
https://tex.stackexchange.com/questions/682120
5
How can I add different kinds of thousand separators and rounding to different kinds of numbers in the same document? I want to set up that EURO amounts are displayed always rounded to two decimal points and with `.` as thousand separator and `,` as decimal point as this: `1.234,56 €` All other numbers should use a small space `\,` as thousand separator (and still `.` as decimal point) and not round at all like: `1 234,567 89 g` or `12 345,678 9 m` I tried with `siunitx` and `numprint` but both only were able to provide one setting for all numbers... and `numprint` also did not display the units correctly or in the font I selected. ``` \documentclass{scrlttr2} \usepackage[ngerman]{babel} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \usepackage[detect-all, locale=DE, separate-uncertainty]{siunitx} \sisetup{group-separator = {.}, group-minimum-digits = 4} \begin{document} \SI{1234.5678}{€} \SI{1234.56789}{g} \SI{12345.6789}{m} \end{document} ``` P.S.: Ideally I would be able to set the thousand separator dependent on the language selected by `\usepackage[ngerman]{babel}` or `\usepackage[english]{babel}`
https://tex.stackexchange.com/users/281557
How to enable different thousand separator and differend rounding for different kinds of numbers in the same document?
false
If you're willing and able to compile your document with LuaLaTeX, the following solution should be of interest to you. (The following test document will compile under pdfLaTeX as well, but it won't perform the special formatting you want to apply to amounts of euro-denominated currency. ``` % !TEX TS-program = lualatex \documentclass{scrlttr2} \usepackage[ngerman]{babel} \usepackage{siunitx} \sisetup{detect-all, locale = DE, separate-uncertainty, group-separator = {\,}, output-decimal-marker = {,}, group-minimum-digits = 4} \usepackage{iftex} % for "\ifluatex" conditional \ifluatex \usepackage{fontspec} \setmainfont{Helvetica Neue} \else \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \fi \ifluatex \usepackage{luacode} \begin{luacode} function DoEuro ( s ) -- take care to permit whitespace in the input string (with "%s-") s = s:gsub ("\\SI%s-%{%s-([%d%.]+)%s-%}%s-%{%s-€%s-%}", "\\SI[group-separator={.}, round-precision=2, round-mode=places]{%1}{€}" ) return s end \end{luacode} %% assign the "DoEuro" function to LuaTeX's `process_input_buffer` callback: \AtBeginDocument{\directlua{luatexbase.add_to_callback ( "process_input_buffer" , DoEuro, "DoEuro" )}} \fi \begin{document} \SI{1234.5678}{€ } \SI { 123456789.012345 } { € } \medskip \SI{1234.56789}{g} \SI{12345.6789}{m} \end{document} ```
3
https://tex.stackexchange.com/users/5001
682138
316,507
https://tex.stackexchange.com/questions/169898
6
I want to make a presentation with LaTeX. My problem is that I want to have on the current slide, at anytime I'd like to positionate (e.g. "The gras \_\_ green"), some text only shown underlined without the text. Then I want to annotate at this underlinded line. After that I want on the next slide I want text and the underlining (e.g. "The gras \_\_is green" with the "is" on the underlining). Is it possible to create a command that makes it automatically possible? Thank you very much in advance for your answer!
https://tex.stackexchange.com/users/49348
How to make a fill-in-the-blank presentation
false
Depending on how you want your overlays, it might avoid some duplication to use `alt`: ``` \documentclass{beamer} \newcommand{\fib}[1]{\underline{\alt<+->{#1}{\phantom{#1}}}} \begin{document} \begin{frame}[<+->] \begin{enumerate} \item The gras \fib{is} green \end{enumerate} \end{frame} \end{document} ```
2
https://tex.stackexchange.com/users/12212
682139
316,508
https://tex.stackexchange.com/questions/682120
5
How can I add different kinds of thousand separators and rounding to different kinds of numbers in the same document? I want to set up that EURO amounts are displayed always rounded to two decimal points and with `.` as thousand separator and `,` as decimal point as this: `1.234,56 €` All other numbers should use a small space `\,` as thousand separator (and still `.` as decimal point) and not round at all like: `1 234,567 89 g` or `12 345,678 9 m` I tried with `siunitx` and `numprint` but both only were able to provide one setting for all numbers... and `numprint` also did not display the units correctly or in the font I selected. ``` \documentclass{scrlttr2} \usepackage[ngerman]{babel} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \usepackage[detect-all, locale=DE, separate-uncertainty]{siunitx} \sisetup{group-separator = {.}, group-minimum-digits = 4} \begin{document} \SI{1234.5678}{€} \SI{1234.56789}{g} \SI{12345.6789}{m} \end{document} ``` P.S.: Ideally I would be able to set the thousand separator dependent on the language selected by `\usepackage[ngerman]{babel}` or `\usepackage[english]{babel}`
https://tex.stackexchange.com/users/281557
How to enable different thousand separator and differend rounding for different kinds of numbers in the same document?
true
You can set keys locally. I'd not use `\SI` for amounts of money, but `\num` followed by the currency symbol. Also `\SI` should be `\qty`. ``` \documentclass{scrlttr2} \usepackage[ngerman]{babel} \usepackage[scaled]{sourcesanspro} \renewcommand\familydefault{\sfdefault} \usepackage{siunitx} \sisetup{ detect-all, locale=DE, separate-uncertainty, output-decimal-marker={.}, } \NewDocumentCommand{\EUR}{m}{% \num[ group-minimum-digits=3, round-mode=places, group-separator={.}, output-decimal-marker={,} ]{#1}\,€% } \begin{document} \EUR{1234.5678} \qty{1234.56789}{g} \qty{12345.6789}{m} \end{document} ``` Sorry, I don't like Helvetica.
4
https://tex.stackexchange.com/users/4427
682148
316,511
https://tex.stackexchange.com/questions/682149
1
I would like to replace a fill in the blank with the answer. My question is related to this question: [How to make a fill-in-the-blank presentation](https://tex.stackexchange.com/questions/169898/how-to-make-a-fill-in-the-blank-presentation/682139) But I have a few additional specifications on my wishlist: 1. I want to replace the underline, so really what I'm after is replace-the-blank, not fill-in-the-blank. 2. I want to put a question mark horizontally centered in the middle of the blank (so it stands out more to students exactly where it is). I will color the question mark and the blank line. 3. I do not want any jumping when transitioning from the overlays. 4. I want the command to work inside math and outside. I'll paste my naive attempt below. It has a couple of problems: I don't know how to put a question mark that is horizontally centered over the blank; and there is a jump on the last overlay, which I imagine is because the underline takes up some vertical space. ``` \documentclass{beamer} \usepackage{ulem} \newcommand{\doblankQ}[1]{\alert<.(1)>{\alt<+->{#1}{\textcolor{orange} {\uline{\phantom{#1}}}}}} \begin{document} \begin{frame}[<+->] \begin{itemize} \item One plus one is \doblankQ{two}. \item And in math: $ 1 + 1 = \doblankQ{2}$. \end{itemize} \end{frame} \end{document} ```
https://tex.stackexchange.com/users/12212
An alt fill-in-the-blank with question in the middle
true
To avoid the jumping problem you could `\smash` the underline to avoid it influencing the vertical space. To add a `?` in the middle, I suggest to measure the width of the gap and then use `\makebox[<width of the gap>]{?}` instead of `\phantom{#1}`: ``` \documentclass{beamer} \newlength{\gapwidth} \makeatletter \newcommand{\doblankQ}[1]{% \ifmmode \if@display \settowidth{\gapwidth}{$\displaystyle #1$}% \else \settowidth{\gapwidth}{$#1$}% \fi \else \settowidth{\gapwidth}{#1}% \fi \alert<.(1)>{% \alt<+->{% #1% }{% \vphantom{#1}\smash{\underline{\makebox[\gapwidth]{?}}}% }% }% } \makeatother \begin{document} \begin{frame}[<+->] \begin{itemize} \item One plus one is \doblankQ{two}. \item And in math: $ 1 + 1 = \doblankQ{2}$. \item $\doblankQ{E(X_i)=40.}$ \end{itemize} \end{frame} \end{document} ```
2
https://tex.stackexchange.com/users/36296
682151
316,512
https://tex.stackexchange.com/questions/682126
0
The following MWE shows the problem: An internet-link with a German umlaut (ä ü ö ß) gives an error message when used within `\pagenote{}`. In the main body the use of `\href{}{}` or `\url{}` does *not* result in an error when such internet-links are used. The pagenote-links with URL (href and url) including German umlauts result in an error: > > File ended while scanning use of \noteentry and will not be displayed in the pdf file as links in the pagenotes when having run pdflatex. > > > ``` \documentclass[11pt,a4paper]{report} \usepackage{ebgaramond-maths} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage{hyperref} \usepackage[continuous,page]{pagenote} \makepagenote \begin{document} \href{https://de.wikipedia.org/wiki}{A link without german Umlaute ü ö ä ß -- in the ordinary text body} \href{https://de.wikipedia.org/wiki/The_Beatles#Fr%C3%BChe_Jahre_(1956%E2%80%931960)}{A link including german Umlaute ä ö ü ß -- in the ordinary text body} A pagenote with an URL (href command) without german Umlaute ä ö ü ß:\pagenote{\href{https://de.wikipedia.org/wiki}{A link without german Umlaute ü ö ä ß -- in the pagenote}} A pagenote with an URL (href command) including german Umlaute ä ö ü ß :\pagenote{\href{https://de.wikipedia.org/wiki/The_Beatles#Fr%C3%BChe_Jahre_(1956%E2%80%931960)}{A href link including german Umlaute ä ö ü ß -- in the pagenote}} A pagenote with an URL (url command) including german Umlaute ä ö ü ß :\pagenote{\url{https://de.wikipedia.org/wiki/The_Beatles#Fr%C3%BChe_Jahre_(1956%E2%80%931960)} A url ink including german Umlaute ä ü ö ß -- in the pagenote} \printnotes \end{document} ``` Currently this MWE results in displaying only the first pagenote with the correcsponding link. The second and third pagenote-links are ignored with the above error message and will not be displayed in the pagenotes.
https://tex.stackexchange.com/users/292824
hyperref and pagenote: No web links containing umlauts shown in pagenotes
true
In the comments Ulrike Fischer gave the answer: Use `\#` and `\%` within the url address instead of leaving the `#` and `%` alone. Second I found that tex4ebook has problems with this solution, it needs a "plain" url address. So I used the `\urldef{\myurl}\url{Some-complete-and-plain-url-address}`, which is described in the `url package` and used by the `hyperref package`. Which solved the problem only partly. It turned out that a problem then arises with the `ebgaramond font package` while running tex4ebook. Which forced me to use another font package, that I integrated to my `preamble` as follows: ``` ... \ifdefined\HCode \usepackage{Somefontpackage}% which is loaded when tex4ebook is running \else \usepackage{Someotherfontpackage}% which is loaded when pdflatex is running \fi ... ```
0
https://tex.stackexchange.com/users/292824
682160
316,517
https://tex.stackexchange.com/questions/158778
5
`\documentclass[11pt]{book}` This code shows default font size. I want to change font size all \ttfamily font in document (only for \ttfamily font). Other fonts not change. How can I do? Thanks,
https://tex.stackexchange.com/users/33703
All \ttfamily font change font size
false
A quick and dirty hack for inline typewriter font: `\newcommand{\texttx}[1]{{\small \texttt{#1}}}`
1
https://tex.stackexchange.com/users/189030
682161
316,518
https://tex.stackexchange.com/questions/648456
1
I have TexLive 2021. OS and TexLive specs: OS Ubuntu Linux 20.04.4 LTS, TeXLive installed from the Internet, it is located in `/usr/local/texlive/2021`. Compilation log: <https://pastebin.com/50pVKYWB> Previously the Concrete family of fonts was working: ``` \documentclass[12pt]{article} \usepackage[a4paper]{geometry} \usepackage[english]{babel} \usepackage{ccfonts} \usepackage{fontspec} \setmainfont{CMU Concrete} \setsansfont{CMU Sans Serif} \setmonofont{CMU Typewriter Text} \begin{document} \noindent The Concrete Roman fonts were designed by Don Knuth for a book called ``Concrete Mathematics'', which he wrote with Graham and Patashnik (the Patashnik, of BibTeX fame). \end{document} ``` Now when I try to compile the document it doesn't: ``` Package fontspec Error: The font "CMU Concrete" cannot be found. ``` How to install it and make it usable?
https://tex.stackexchange.com/users/4035
CMU Concrete font not found in TeXLive 2021
false
In Ubuntu, if everything else fails, install package `texlive-fonts-extra`.
0
https://tex.stackexchange.com/users/74183
682163
316,519
https://tex.stackexchange.com/questions/682147
2
Why is it that tex does not (or cannot) produce an error when a command is used in a redefinition of itself? For example the plain file ``` \def\bf{\bf} abc {\bf text} \bye ``` just freezes, producing no error message. Similarly with LaTeX and `\renewcommand`: ``` \documentclass{article} \renewcommand{\textbf}{\textbf} \begin{document} abc \textbf{text} \end{document} ``` This came up for me recently because a large project stopped compiling due to a mistaken change in a package file that included a line like `\renewcommand\foo{ ... \foo ... }`. Because no error is produced, it took a long time to figure out what was wrong. My guess is that scanning the argument of `\def\foo` or `\renewcommand\foo` in advance for the token `\foo` is possible, but not feasible in terms of efficiency. Is this correct, or is there another reason no error is produced?
https://tex.stackexchange.com/users/208544
no helpful error if command used in its own redefinition
true
with `\def\bf{\bf} \bf` tex is in a loop, such loops are impossible to detect in General ("Turing Halting problem") The good news is that it only gives a non terminating loop as it is a tail recursive macro that uses no stack. It is quite hard to write such a thing by accident. Similar "infinite" loops all give errors `\def\bf{\bf.}\bf` gives `! TeX capacity exceeded, sorry [input stack size=10000].` `\def\bf{.\bf}\bf` gives `! TeX capacity exceeded, sorry [main memory size=5000000].` `\def\bf{{\bf}}\bf` gives `! TeX capacity exceeded, sorry [grouping levels=255].` So automatically detecting cases that loop without error would be hard (even if it were not proved impossible:-)
6
https://tex.stackexchange.com/users/1090
682165
316,521
https://tex.stackexchange.com/questions/682168
1
I created a custom bibliographystyle using `latex makebst` for a journal, and it is mostly right. Unfortunately the DOI and URL to webpages are both in a different font than the rest of the bibliography entry, and the URL will run off the page rather than wrapping to the next line. the relevant portion of my bst: ``` FUNCTION {format.url} { doi empty$ { url } { "http://dx.doi.org/" doi * } if$ duplicate$ empty$ { pop$ "" } { "\urlprefix\url{" swap$ * "}" * } if$ } ``` What do I need to change to have the output in the same font as the rest of my reference?
https://tex.stackexchange.com/users/268801
URL and DOI are in a different font within Literature Cited
true
The font face that's used when the argument of an `\url` or `\doi` instruction is typeset usually does not dependon the bst file. Assuming that the [url](https://www.ctan.org/pkg/url) package is loaded, the font face is determined by the argument of the `\urlstyle` macro, which (along with `\url` macro itself) is provided by the `url` package. (The `xurl` package also loads `url` package.) Lets review Section 3, "Style", of the [url](https://www.ctan.org/pkg/url) package -- yes, the entire section consists of a single, six-line paragraph (highlights added): Many document classes and citation management package either take the system default font face, which is `tt`, or execute something like `\urlstyle{same}`. If you don't like the monospaced font default, feel free to run `\urlstyle{same}` or `\urlstyle{rm}`. If the url package is *not* loaded, the bst file has to provide a dummy or placeholder definition of `\url`, which -- as you've observed -- is not very smart as it doesn't allow for line breaks in the typeset URL string. You also wrote: > > and the URL will run off the page rather than wrapping to the next line > > > This only happens if you don't load the [url](https://www.ctan.org/pkg/url) (or [xurl](https://www.ctan.org/pkg/xurl), or [hyperref](https://www.ctan.org/pkg/hyperref)) package. I suggest you run `\usepackage{xurl}` in your document. Finally, you asked, > > What do I need to change to have the output in the same font as the rest of my reference? > > > In addition to loading the `xurl` package, I'd recommend you run `\urlstyle{same}`.
1
https://tex.stackexchange.com/users/5001
682169
316,522
https://tex.stackexchange.com/questions/8458
241
I need to make my (BibTeX) references section appear in the table of contents of my LaTeX document (documentclass: article), with section numbering too. My approach until now has been making a new section and including the bibliography (`references.bib`) at that point: ``` \section{References} \bibliography{references} ``` However, the final document shows both the section title that I have written and the section title that BibTeX writes, which is quite redundant and I definitely dislike. How can I either remove BibTeX's section title, or make the BibTeX bibliography appear in the table of contents without making a new section? If I were to make the BibTeX bibliography appear in the table of contents without making a new section, how could I assure that the section title that BibTeX writes looks exactly like sections typeset with `\section`?
https://tex.stackexchange.com/users/2311
Making the bibliography appear in the table of contents
false
This is the only thing that worked for me after much trial and error. ``` \usepackage{afterpage} ... \addtocontents{toc}{\protect\hypertarget{toc}{}} \tableofcontents \addcontentsline{toc}{chapter}{Table of Contents} \setcounter{page}{1} ... \cleardoublepage \phantomsection \addcontentsline{toc}{chapter}{Bibliography} \printbibliography \afterpage{\phantomsection \addcontentsline{toc}{chapter}{Acronyms}} \printglossaries ```
0
https://tex.stackexchange.com/users/294606
682171
316,523
https://tex.stackexchange.com/questions/682175
0
I would like to spread the titles of the ToC with two columns, like in just calling `\talbeofcontents` alonw. I tried with `multicol` and `minipage`, but it didn't work. MWE: ``` \documentclass{beamer} \usepackage{multicol} \begin{document} \begin{frame} \frametitle{Outline} \tableofcontents \end{frame} \begin{frame} \frametitle{Outline} \begin{multicols}{2} \tableofcontents \end{multicols} \end{frame} \begin{frame} \frametitle{Outline} \begin{minipage}{\textwidth} \begin{minipage}{.4\textwidth} \tableofcontents[sections={1-4}] \end{minipage}% \hfill \begin{minipage}{.4\textwidth} \tableofcontents[sections={5-8}] \end{minipage} \end{minipage} \end{frame} \section{Section 1} \begin{frame} \end{frame} \section{Section 2} \begin{frame} \end{frame} \section{Section 3} \begin{frame} \end{frame} \section{A slightly longer Section 4 for the example} \begin{frame} \end{frame} \section{Section 5} \begin{frame} \end{frame} \section{Section 6} \begin{frame} \end{frame} \section{Section 7} \begin{frame} \end{frame} \section{Section 8} \begin{frame} \end{frame} \end{document} ```
https://tex.stackexchange.com/users/162307
Vertical spacing of \tableofcontents in Beamer
true
I found a solution based on [the answer of a previous question](https://tex.stackexchange.com/a/218455/162307): using a `minipage` inside a `columns` environment, and modifying the height of the `minipage` with the parameter `[c][0.7\textheight]`: ``` \begin{frame} \frametitle{Outline} \begin{columns} \begin{minipage}{\textwidth} \begin{minipage}[c][0.7\textheight]{.45\textwidth} \tableofcontents[sections={1-4}] \end{minipage}% \hfill \begin{minipage}[c][0.7\textheight]{.45\textwidth} \tableofcontents[sections={5-8}] \end{minipage} \end{minipage} \end{columns} \end{frame} ``` However, I *sense* it is not well horizontally aligned.
1
https://tex.stackexchange.com/users/162307
682176
316,524
https://tex.stackexchange.com/questions/682196
1
I made a macro using `xparse` for formatting the month with optional day and year. Except the appended optional argument doesn't work inside a description label for the description list---unless I enclose it in curly braces (e.g. `{\Month{4}[8]}`). This error is easily fixable via curly braces, but I would like to know WHY it occurs and perhaps also how to avoid having to fix it with curly braces. ``` \documentclass{article} \usepackage{stix2} \usepackage{etoolbox,xparse,xspace} %\numtomonth converts a number into its corresponding month. %The starred and unstarred versions display the long and short forms of the month. \makeatletter \NewDocumentCommand{\numtomonth}{ s m }{% \IfBooleanTF{#1}% {%ifstar \ifnumequal{#2}{1}{January}{% \ifnumequal{#2}{2}{February}{% \ifnumequal{#2}{3}{March}{% \ifnumequal{#2}{4}{April}{% \ifnumequal{#2}{5}{May}{% \ifnumequal{#2}{6}{June}{% \ifnumequal{#2}{7}{July}{% \ifnumequal{#2}{8}{August}{% \ifnumequal{#2}{9}{September}{% \ifnumequal{#2}{10}{October}{% \ifnumequal{#2}{11}{November}{% \ifnumequal{#2}{12}{December}{% \errmessage{The input must be an integer between 1 and 12}% }}}}}% }}}}}% }}% }% {%ifnostar %https://tex.stackexchange.com/questions/15009/macros-for-common-abbreviations \ifnumequal{#2}{1}{Jan\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{2}{Feb\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{3}{March}{% \ifnumequal{#2}{4}{April}{% \ifnumequal{#2}{5}{May}{% \ifnumequal{#2}{6}{June}{% \ifnumequal{#2}{7}{July}{% \ifnumequal{#2}{8}{Aug\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{9}{Sep\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{10}{Oct\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{11}{Nov\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{12}{Dec\@ifnextchar{.}{}{.\@\xspace}}{% \errmessage{The input must be an integer between 1 and 12}% }}}}}% }}}}}% }}% }% } \makeatother % %\Month has three arguments. %The first and third are optional. %The first is the year and the third is the day of the month. %The mandatory argument is the number corresponding to the month. %\Month displays the short form of the month and, if used, the day and the year. \NewDocumentCommand{\Month}{ O{} m O{} }{%\month already defined \numtomonth{#2}% \ifstrempty{#3}{}{~#3}% \ifstrempty{#1}{}{% \ifstrempty{#3}{ #1}{, #1}% }% } \usepackage{enumitem} \parindent=0pt \begin{document} I am trying to make a description list on \Month[2023]{4}[8].%random sentence \begin{description} \item[\Month{4}]%works; no appended optional argument Alpha \item%[\Month{4}[8]]%doesn't work with appended optional argument Beta \item[{\Month{4}[8]}]%works; same as above, but enclosed in curly braces Charlie \item%[\Month[2023]{4}[8]]%doesn't work with appended optional argument Delta \item[{\Month[2023]{4}[8]}]%works; same as above, but enclosed in curly braces Epsilon \end{description} \end{document} ```
https://tex.stackexchange.com/users/278534
Using Macro Inside Description List Label
true
With current LaTeX `\item` is a *classic* LaTeX command not defined using `\NewDocumentCommand`. So nesting of commands with optional arguments is not supported. But you can define your own `\Item` and use it instead of `\item` to fix this: ``` \documentclass{article} \usepackage{stix2} \usepackage{etoolbox,xparse,xspace} %\numtomonth converts a number into its corresponding month. %The starred and unstarred versions display the long and short forms of the month. \makeatletter \NewDocumentCommand{\numtomonth}{ s m }{% \IfBooleanTF{#1}% {%ifstar \ifnumequal{#2}{1}{January}{% \ifnumequal{#2}{2}{February}{% \ifnumequal{#2}{3}{March}{% \ifnumequal{#2}{4}{April}{% \ifnumequal{#2}{5}{May}{% \ifnumequal{#2}{6}{June}{% \ifnumequal{#2}{7}{July}{% \ifnumequal{#2}{8}{August}{% \ifnumequal{#2}{9}{September}{% \ifnumequal{#2}{10}{October}{% \ifnumequal{#2}{11}{November}{% \ifnumequal{#2}{12}{December}{% \errmessage{The input must be an integer between 1 and 12}% }}}}}% }}}}}% }}% }% {%ifnostar %https://tex.stackexchange.com/questions/15009/macros-for-common-abbreviations \ifnumequal{#2}{1}{Jan\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{2}{Feb\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{3}{March}{% \ifnumequal{#2}{4}{April}{% \ifnumequal{#2}{5}{May}{% \ifnumequal{#2}{6}{June}{% \ifnumequal{#2}{7}{July}{% \ifnumequal{#2}{8}{Aug\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{9}{Sep\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{10}{Oct\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{11}{Nov\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{12}{Dec\@ifnextchar{.}{}{.\@\xspace}}{% \errmessage{The input must be an integer between 1 and 12}% }}}}}% }}}}}% }}% }% } \makeatother % %\Month has three arguments. %The first and third are optional. %The first is the year and the third is the day of the month. %The mandatory argument is the number corresponding to the month. %\Month displays the short form of the month and, if used, the day and the year. \NewDocumentCommand{\Month}{ O{} m O{} }{%\month already defined \numtomonth{#2}% \ifstrempty{#3}{}{~#3}% \ifstrempty{#1}{}{% \ifstrempty{#3}{ #1}{, #1}% }% } \NewDocumentCommand{\Item}{o}{% \IfValueTF{#1}{\item[{#1}]}{\item}% } \usepackage{enumitem} \parindent=0pt \begin{document} I am trying to make a description list on \Month[2023]{4}[8].%random sentence \begin{description} \Item[\Month{4}]%works; no appended optional argument Alpha \Item[\Month{4}[8]]%works with appended optional argument Beta \Item[{\Month{4}[8]}]%works; same as above, but with enclosed in curly braces Charlie \Item[\Month[2023]{4}[8]]%works with appended optional argument Delta \Item[{\Month[2023]{4}[8]}]%works; same as above, but enclosed in curly braces Epsilon \end{description} \end{document} ``` I would not recommend to redefine `\item` itself, because this could fail, if a package redefines `\item` depending on environments. But if you want to ignore this, you could also do: ``` \documentclass{article} \usepackage{stix2} \usepackage{etoolbox,xparse,xspace} %\numtomonth converts a number into its corresponding month. %The starred and unstarred versions display the long and short forms of the month. \makeatletter \NewDocumentCommand{\numtomonth}{ s m }{% \IfBooleanTF{#1}% {%ifstar \ifnumequal{#2}{1}{January}{% \ifnumequal{#2}{2}{February}{% \ifnumequal{#2}{3}{March}{% \ifnumequal{#2}{4}{April}{% \ifnumequal{#2}{5}{May}{% \ifnumequal{#2}{6}{June}{% \ifnumequal{#2}{7}{July}{% \ifnumequal{#2}{8}{August}{% \ifnumequal{#2}{9}{September}{% \ifnumequal{#2}{10}{October}{% \ifnumequal{#2}{11}{November}{% \ifnumequal{#2}{12}{December}{% \errmessage{The input must be an integer between 1 and 12}% }}}}}% }}}}}% }}% }% {%ifnostar %https://tex.stackexchange.com/questions/15009/macros-for-common-abbreviations \ifnumequal{#2}{1}{Jan\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{2}{Feb\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{3}{March}{% \ifnumequal{#2}{4}{April}{% \ifnumequal{#2}{5}{May}{% \ifnumequal{#2}{6}{June}{% \ifnumequal{#2}{7}{July}{% \ifnumequal{#2}{8}{Aug\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{9}{Sep\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{10}{Oct\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{11}{Nov\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{12}{Dec\@ifnextchar{.}{}{.\@\xspace}}{% \errmessage{The input must be an integer between 1 and 12}% }}}}}% }}}}}% }}% }% } \makeatother % %\Month has three arguments. %The first and third are optional. %The first is the year and the third is the day of the month. %The mandatory argument is the number corresponding to the month. %\Month displays the short form of the month and, if used, the day and the year. \NewDocumentCommand{\Month}{ O{} m O{} }{%\month already defined \numtomonth{#2}% \ifstrempty{#3}{}{~#3}% \ifstrempty{#1}{}{% \ifstrempty{#3}{ #1}{, #1}% }% } \NewCommandCopy{\iitem}{\item} \RenewDocumentCommand{\item}{o}{% \IfValueTF{#1}{\iitem[{#1}]}{\iitem}% } \usepackage{enumitem} \parindent=0pt \begin{document} I am trying to make a description list on \Month[2023]{4}[8].%random sentence \begin{description} \item[\Month{4}]%works; no appended optional argument Alpha \item[\Month{4}[8]]%works with appended optional argument Beta \item[{\Month{4}[8]}]%works; same as above, but enclosed in curly braces Charlie \item[\Month[2023]{4}[8]]%works with appended optional argument Delta \item[{\Month[2023]{4}[8]}]%works; same as above, but enclosed in curly braces Epsilon \end{description} \end{document} ```
2
https://tex.stackexchange.com/users/277964
682197
316,531
https://tex.stackexchange.com/questions/681968
1
While running biblatex with `\nocite` commands, I got the following error message(s) when running `epubcheck` after `tex4ebook`. ``` ERROR(RSC-005): Testfile.epub/OEBPS/Testfileli3.html(19,88): Validierungsfehler: Der Wert des Attributs "id" ist ungültig; es muss ein XML-Name ohne Doppelpunkte sein Translated: validation error: The value of attribute "id" is invalid; is has to be a XML-name without colon ``` The MWE would be the following, but it only reproduced the error 1 time. In my sourcefile.tex I got 175 \nocite commands and got 173 identical error messages with epubcheck. ``` \documentclass[11pt,a4paper]{report} \usepackage{ebgaramond-maths} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage{tex4ebook} \usepackage[sortlocale=auto,bibstyle=authoryear,citestyle=authortitle-ticomp]{biblatex} \addbibresource{biblatex-examples.bib} \begin{document} \nocite{sigfridsson} \nocite{westfahl:space} \nocite{set} \nocite{stdmodel} \nocite{aksin} \nocite{bertram} \printbibliography \end{document} ``` Is there a fix for it? --> Yes, see Answer 1. It worked reducing the epubcheck error number from 123 to 20. **Update 1** I now have 20 errors left with epubcheck, which seem all related to the `\pageref{somelabel}` command. epubcheck gives `ERROR(RSC-012) Fragmentbezeichner ist nicht angegeben` and points to the following example in the html files (out of the 20): ``` (wie vorangehend, bei Andrej Sacharow<a id='dx17-18004'></a> ab Seite <a href='#x11-12001r9'>249<!-- tex4ht:ref: AndrejSacharow --></a>, gesehen und angedeutet) ``` and points to the page number "249". But this `\pageref` is located in ordinary body of text, without embedding in other command and env. Up to now it was not possible to reproduce the epubcheck error in a MWE.
https://tex.stackexchange.com/users/292824
epubcheck with error while using tex4ebook and \nocite bibtexing
true
This issue should be fixed by `make4ht` DOM filters, but I found that this particular filter is broken. I've fixed that in `make4ht` sources, bur if you don't want to update it, you can use this build file instead: ``` local domfilter = require "make4ht-domfilter" local allowed_chars = { ["-"] = true, ["."] = true } local function fix_colons(id) -- match every non alphanum character return id:gsub("[%W]", function(s) -- some characters are allowed, we don't need to replace them if allowed_chars[s] then return s end -- in other cases, replace with underscore return "_" end) end local function id_colons(obj) -- replace : characters in links and ids with unserscores obj:traverse_elements(function(el) local name = string.lower(obj:get_element_name(el)) if name == "a" then local href = el:get_attribute("href") -- don't replace colons in external links if href and not href:match("[a-z]%://") then local base, id = href:match("(.*)%#(.*)") if base and id then id = fix_colons(id) el:set_attribute("href", base .. "#" .. id) end end end local id = el:get_attribute("id") if id then el:set_attribute("id", fix_colons(id)) end end) return obj end local process = domfilter {id_colons} Make:match("html$", process) ``` Compile using: I also found another issue, and that is a wrong formatting of DOI numbers. It can be fixed using this configuration file: ``` \Preamble{xhtml} \def\nolinkurl#1{#1} \begin{document} \EndPreamble ``` Compile using: ``` $ tex4ebook -e build.lua -c config.cfg filename.tex ``` This is the result:
2
https://tex.stackexchange.com/users/2891
682198
316,532
https://tex.stackexchange.com/questions/682023
1
When running `tex4ebook' with the following MWE, there should be a` space separation` between the bibitems viewed in the epub to get a better result. ``` \documentclass[11pt,a4paper]{report} \usepackage{ebgaramond-maths} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage{tex4ebook} \usepackage[sortlocale=auto,bibstyle=authoryear,citestyle=authortitle-ticomp]{biblatex} \addbibresource{biblatex-examples.bib} \begin{document} \nocite{sigfridsson} \nocite{westfahl:space} \nocite{set} \nocite{stdmodel} \nocite{aksin} \nocite{bertram} \printbibliography \end{document} ``` Could this be done?
https://tex.stackexchange.com/users/292824
Spaces are missed in the resulting bibliography in the epub when running tex4ebook
true
Try this configuration file: ``` \Preamble{xhtml} \def\nolinkurl#1{#1} \Css{dd.thebibliography { text-indent: -2em; margin-left: 2em;}} \Css{dt.thebibliography + dd.thebibliography{margin-top: 1em;}} \Css{dd.thebibliography p:first-child{ text-indent: -2em; }} \Css{dt.thebibliography{float:left; clear:left; margin-right:1em;}} \begin{document} \EndPreamble ```
0
https://tex.stackexchange.com/users/2891
682200
316,533
https://tex.stackexchange.com/questions/682196
1
I made a macro using `xparse` for formatting the month with optional day and year. Except the appended optional argument doesn't work inside a description label for the description list---unless I enclose it in curly braces (e.g. `{\Month{4}[8]}`). This error is easily fixable via curly braces, but I would like to know WHY it occurs and perhaps also how to avoid having to fix it with curly braces. ``` \documentclass{article} \usepackage{stix2} \usepackage{etoolbox,xparse,xspace} %\numtomonth converts a number into its corresponding month. %The starred and unstarred versions display the long and short forms of the month. \makeatletter \NewDocumentCommand{\numtomonth}{ s m }{% \IfBooleanTF{#1}% {%ifstar \ifnumequal{#2}{1}{January}{% \ifnumequal{#2}{2}{February}{% \ifnumequal{#2}{3}{March}{% \ifnumequal{#2}{4}{April}{% \ifnumequal{#2}{5}{May}{% \ifnumequal{#2}{6}{June}{% \ifnumequal{#2}{7}{July}{% \ifnumequal{#2}{8}{August}{% \ifnumequal{#2}{9}{September}{% \ifnumequal{#2}{10}{October}{% \ifnumequal{#2}{11}{November}{% \ifnumequal{#2}{12}{December}{% \errmessage{The input must be an integer between 1 and 12}% }}}}}% }}}}}% }}% }% {%ifnostar %https://tex.stackexchange.com/questions/15009/macros-for-common-abbreviations \ifnumequal{#2}{1}{Jan\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{2}{Feb\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{3}{March}{% \ifnumequal{#2}{4}{April}{% \ifnumequal{#2}{5}{May}{% \ifnumequal{#2}{6}{June}{% \ifnumequal{#2}{7}{July}{% \ifnumequal{#2}{8}{Aug\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{9}{Sep\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{10}{Oct\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{11}{Nov\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{12}{Dec\@ifnextchar{.}{}{.\@\xspace}}{% \errmessage{The input must be an integer between 1 and 12}% }}}}}% }}}}}% }}% }% } \makeatother % %\Month has three arguments. %The first and third are optional. %The first is the year and the third is the day of the month. %The mandatory argument is the number corresponding to the month. %\Month displays the short form of the month and, if used, the day and the year. \NewDocumentCommand{\Month}{ O{} m O{} }{%\month already defined \numtomonth{#2}% \ifstrempty{#3}{}{~#3}% \ifstrempty{#1}{}{% \ifstrempty{#3}{ #1}{, #1}% }% } \usepackage{enumitem} \parindent=0pt \begin{document} I am trying to make a description list on \Month[2023]{4}[8].%random sentence \begin{description} \item[\Month{4}]%works; no appended optional argument Alpha \item%[\Month{4}[8]]%doesn't work with appended optional argument Beta \item[{\Month{4}[8]}]%works; same as above, but enclosed in curly braces Charlie \item%[\Month[2023]{4}[8]]%doesn't work with appended optional argument Delta \item[{\Month[2023]{4}[8]}]%works; same as above, but enclosed in curly braces Epsilon \end{description} \end{document} ```
https://tex.stackexchange.com/users/278534
Using Macro Inside Description List Label
false
I suggest a different approach without so many optional arguments. ``` \documentclass{article} \usepackage{stix2} \usepackage{enumitem} %\numtomonth converts a number into its corresponding month. %The starred and unstarred versions display the long and short forms of the month. \ExplSyntaxOn \NewDocumentCommand{\printdate}{sm} { \IfBooleanTF { #1 } { \egreg_date_print:Nn \egreg_date_longmonth:e { #2 } } { \egreg_date_print:Nn \egreg_date_shortmonth:e { #2 } } } \seq_new:N \l__egreg_date_items_seq \cs_new_protected:Nn \egreg_date_print:Nn {% #1 is either long or short month \seq_set_split:Nnn \l__egreg_date_items_seq { - } { #2 } \int_case:nnF { \seq_count:N \l__egreg_date_items_seq } { {1}{ #1 { #2 } }% just the month {2}{ \__egreg_date_year_or_day:Nee #1 { \seq_item:Nn \l__egreg_date_items_seq { 1 } } { \seq_item:Nn \l__egreg_date_items_seq { 2 } } } {3}{ #1 { \seq_item:Nn \l__egreg_date_items_seq { 2 } } % month \nobreakspace \seq_item:Nn \l__egreg_date_items_seq { 3 } % day ,~ \seq_item:Nn \l__egreg_date_items_seq { 1 } % year } } {\errmessage{Invalid~date}} } \cs_new_protected:Nn \__egreg_date_year_or_day:Nnn { \int_compare:nTF { #2>1000 } {% first item is year, second item is month #1 { #3 } % month \nobreakspace #2 % year } {% first item is month, second item is day #1 { #2 } % month \nobreakspace #3 % day } } \cs_generate_variant:Nn \__egreg_date_year_or_day:Nnn { Nee } \cs_new_protected:Nn \egreg_addperiod: { \peek_charcode:NF { . } { . } } \cs_new:Nn \egreg_date_longmonth:n { \int_case:nnF { #1 } { {1}{January} {2}{February} {3}{March} {4}{April} {5}{May} {6}{June} {7}{July} {8}{August} {9}{September} {10}{October} {11}{November} {12}{December} } {\errmessage{The~input~must~be~an~integer~between~1~and~12}} } \cs_generate_variant:Nn \egreg_date_longmonth:n { e } \cs_new:Nn \egreg_date_shortmonth:n { \int_case:nnF { #1 } { {1}{Jan\egreg_addperiod:} {2}{Feb\egreg_addperiod:} {3}{March} {4}{April} {5}{May} {6}{June} {7}{July} {8}{Aug\egreg_addperiod:} {9}{Sep\egreg_addperiod:} {10}{Oct\egreg_addperiod:} {11}{Nov\egreg_addperiod:} {12}{Dec\egreg_addperiod:} } {\errmessage{The~input~must~be~an~integer~between~1~and~12}} } \cs_generate_variant:Nn \egreg_date_shortmonth:n { e } \ExplSyntaxOff \begin{document} I am trying to make a description list on \printdate{2023-4-8} \begin{description} \item[\printdate{4}] Alpha \item[\printdate{4-8}] Beta \item[\printdate{2023-4}] Charlie \item[\printdate{2023-4-8}] Delta \item[\printdate{2023-1-8}] Delta \item[\printdate*{2023-1-8}] Delta \end{description} \end{document} ``` If you specify a date with just one item, it's taken as month. With two items, the first one is checked to be greater than 1000: in this case it's taken as a year and the second item is a month, otherwise the first item is the month and the second item is the day. With three items, we have year, month and day.
2
https://tex.stackexchange.com/users/4427
682210
316,536
https://tex.stackexchange.com/questions/682162
0
How do I tailor the following code to use pgfornament-han corner graphic #11 rather than pgfornament #42? Obviously I will need to change the bolded numbers, but no other strategy I am using seems to work. See page 24 here: <https://ctan.math.illinois.edu/macros/latex/contrib/tkz/pgfornament/doc/ornaments.pdf> ``` \usepackage{pgfornament} \usepackage{tikz} \usepackage{eso-pic} \makeatletter \AddToShipoutPicture{ \begingroup \setlength{\@tempdima}{2mm} \setlength{\@tempdimb}{\paperwidth-\@tempdima-2cm} \setlength{\@tempdimc}{\paperheight-\@tempdima} \put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdimc}){ \pgfornament[anchor=north west,width=2cm,color=darkbone,opacity=.5]**{41}**}\put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdima}){% \pgfornament[anchor=south west,width=2cm,,color=darkbone,opacity=.5,symmetry=h]**{41}**} \put(\LenToUnit{\@tempdimb},\LenToUnit{\@tempdimc}){% \pgfornament[anchor=north east,width=2cm,,color=darkbone,opacity=.5,symmetry=v]**{41}**} \put(\LenToUnit{\@tempdimb},\LenToUnit{\@tempdima}){% \pgfornament[anchor=south east,width=2cm,,color=darkbone,opacity=.5,symmetry=c]**{41}**} \endgroup } \makeatother ```
https://tex.stackexchange.com/users/294599
pgfornaments--switching to han graphics, troubleshooting
false
You need to specify `object = pgfhan` to use the Han ornaments. The `\@tempdimc` will get overwritten before the third ornament which is why I'm using simple TeX macros here. Code ---- ``` \documentclass{article} \usepackage[object=pgfhan]{pgfornament} \usepackage{eso-pic} \usepackage{blindtext} \definecolor{darkbone}{HTML}{836b56} \makeatletter \AddToShipoutPicture{% \begingroup \edef\@@tempdima{2mm}% \edef\@@tempdimb{\the\dimexpr\paperwidth-\@tempdima-2cm}% \edef\@@tempdimc{\the\dimexpr\paperheight-\@tempdima}% \put(\@@tempdima,\@@tempdimc){% \pgfornament[anchor=north west,width=2cm,color=darkbone!50]{11}}% \put(\@@tempdima,\@@tempdima){% \pgfornament[anchor=south west,width=2cm,color=darkbone!50,symmetry=h]{11}}% \put(\@@tempdimb,\@@tempdimc){% \pgfornament[anchor=north east,width=2cm,color=darkbone!50,symmetry=v]{11}}% \put(\@@tempdimb,\@@tempdima){% \pgfornament[anchor=south east,width=2cm,color=darkbone!50,symmetry=c]{11}}% \endgroup } \makeatother \begin{document} \blinddocument \end{document} ```
1
https://tex.stackexchange.com/users/16595
682225
316,542
https://tex.stackexchange.com/questions/675842
0
I have to color the first column of three rows called the Method box. I tried but still cannot get success. **How I can align two tables horizontally in the ICCV template?** **Code** ``` \begin{tabular}{l|cc} \hline\thickhline %\rowcolor{mygray} \multirow{3}{*}{\cellcolor[gray]{0.9}Method} & \multicolumn{2}{c}{CIFAR-100} \\ \cline{2-3} & \begin{tabular}[c]{@{}c@{}}\textbf{Top-1} \\ \textbf{Error(\%)} \end{tabular} & \begin{tabular}[c]{@{}c@{}}\textbf{Top-5} \\ \textbf{Error(\%)} \end{tabular} \\ \hline \hline Vanilla & 23.67 \\ \hspace{0.5em}{+CMAAug} & \textcolor{blue}{-} & \textcolor{blue}{-} \\ %\hline \thickhline \end{tabular} ```
https://tex.stackexchange.com/users/152199
Color of a multirow cell in table
false
* your question is not entirely clear, sorry ... * you not provide any information about your document, so I decide to use `standalone` document class * in your code fragment you should move multirow cell to the second row and then use negative number of spanned rows, for example as is done in the next MWE (based on your code fragment, but quite cleaned): ``` \documentclass[margin=3mm, varwidth]{standalone} \usepackage[table]{xcolor} \usepackage{boldline, makecell, multirow} % guessing ... what you should add to preamble \begin{document} \begin{table}[ht] \centering \begin{tabular}{l |cc} \hlineB{1.25} \cellcolor[gray]{0.9} & \multicolumn{2}{c}{CIFAR-100} \\ \cline{2-3} \multirow{-2}{*}{\cellcolor[gray]{0.9}{Method}} & \bfseries\makecell{Top 1\\ Error (\%)} & \bfseries\makecell{Top 2\\ Error (\%)} \\ \hline Vanilla & 0.384 & \\ \quad+CMAAug & \textcolor{blue}{--} & \textcolor{blue}{--} \\ \hlineB{1.25} \end{tabular} \end{table} \end{document} ``` * but your table can be write with much shorter (and cleaner) code ... for example with use of `tabularray` package: ``` \documentclass[margin=3mm, varwidth]{standalone} \usepackage{xcolor} \usepackage{tabularray} \UseTblrLibrary{booktabs} \NewTableCommand\SCfg[1]{\SetCell{fg=#1}} \begin{document} \begin{table}[ht] \centering \begin{tblr}{colspec={l | *{2}{Q[c]} }, cell{2}{2-Z} = {font=\bfseries}, } \toprule \SetCell[r=2]{c, bg=yellow!30} Method & \SetCell[c=2]{c} CIFAR-100 & \\ \midrule & {Top 1\\ Error (\%)} & {Top 2\\ Error (\%)} \\ \midrule Vanilla & 0.384 & \\ \quad+CMAAug & \SCfg{blue} -- & \SCfg{blue} -- \\ \bottomrule \end{tblr} \end{table} \end{document} ```
1
https://tex.stackexchange.com/users/18189
682226
316,543
https://tex.stackexchange.com/questions/682233
2
I have a sentence in my thesis that needs to call to five individual figures (Fig.s 2-6), but I cannot seem to get that to work. I have tried various options: ``` (Fig.s \ref{A},\ref{B},\ref{C},\ref{D},\ref{E},\ref{F}). (Fig.s \crefrange{A,B,C,D,E,F}). (Fig.s \cref{A},\cref{B},\cref{C},\cref{D},\cref{E},\cref{F}). (Fig.s \cref{A, B, C, D, E, F}). ``` However none of them yield the desired result. My current best result is (Fig.s 2,3,4,5,6)
https://tex.stackexchange.com/users/268801
call multiple figures in a single reference
false
You can use `cleveref` to achieve what You want ``` \documentclass[10pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{todonotes} \usepackage[colorlinks,linkcolor=blue]{hyperref} \usepackage[nameinlink,capitalise]{cleveref} \newcommand{\crefrangeconjunction}{--} \begin{document} \begin{figure}[ht!] \includegraphics[width=0.5\linewidth]{example-image-a} \caption{example figure} \label{fig1} \end{figure} \begin{figure}[ht!] \includegraphics[width=0.5\linewidth]{example-image-a} \caption{example figure} \label{fig2} \end{figure} \begin{figure}[ht!] \includegraphics[width=0.5\linewidth]{example-image-a} \caption{example figure} \label{fig3} \end{figure} The single figure ref \cref{fig1}. Two figures ref \cref{fig1,fig2} And more refs at once \crefrange{fig1}{fig3} \end{document} ```
2
https://tex.stackexchange.com/users/217087
682236
316,547
https://tex.stackexchange.com/questions/682233
2
I have a sentence in my thesis that needs to call to five individual figures (Fig.s 2-6), but I cannot seem to get that to work. I have tried various options: ``` (Fig.s \ref{A},\ref{B},\ref{C},\ref{D},\ref{E},\ref{F}). (Fig.s \crefrange{A,B,C,D,E,F}). (Fig.s \cref{A},\cref{B},\cref{C},\cref{D},\cref{E},\cref{F}). (Fig.s \cref{A, B, C, D, E, F}). ``` However none of them yield the desired result. My current best result is (Fig.s 2,3,4,5,6)
https://tex.stackexchange.com/users/268801
call multiple figures in a single reference
true
To make sure that the output of both `(\Crefrange{A}{E})` and `(\Cref{A,B,C,D,E})` is `(Fig.s 2-6)`, I suggest you insert the following instructions in the preamble -- after loading the `cleveref` package, naturally: ``` \Crefname{figure}{Fig.}{Fig.s} \newcommand{\crefrangeconjunction}{--} ``` --- ``` \documentclass{article} % or some other suitable document class \usepackage{cleveref} \Crefname{figure}{Fig.}{Fig.s} \newcommand{\crefrangeconjunction}{--} \begin{document} \stepcounter{figure} \refstepcounter{figure}\label{A} \refstepcounter{figure}\label{B} \refstepcounter{figure}\label{C} \refstepcounter{figure}\label{D} \refstepcounter{figure}\label{E} (\Crefrange{A}{E}) % or, if you prefer, '(\Cref{A,B,C,D,E})' \end{document} ```
3
https://tex.stackexchange.com/users/5001
682237
316,548
https://tex.stackexchange.com/questions/682172
1
I use texlive as packaged for suse tumbleweed. As i faced some problems with caching I tried ``` kpsewhich --expand-var '$TEXMFVAR' ``` which results in `/var/lib/texmf` which is not writable. Most probably this is the source of my caching problems. In various sites I read what TEXMFVAR is: * The (personal) tree used by texconfig, updmap-user and fmtutil-user to store (cached) runtime data such as format files and generated map files. * default: `~/.texlive/texmf-var` explanation: updmap and fmtutil (sys mode) to store (cached) runtime data Hm, I think this does not fit. I don't have a `~/.texlive` folder. What I do have is a folder `~/.cache/texmf` with sole subfolder `fonts`. My first question is, whether my distribution is ok, or plausible.
https://tex.stackexchange.com/users/60463
my TEXMFVAR folder is not readable, is my texlive installation ok?
false
Since the OP has it working now, I will promote my comment to an answer. First: Whenever you install TeXlive, or upgrade to a later year, be sure that the binaries are on your PATH. A few systems may do that automatically, if you install from the operating system rather than directly from TUG. However, the automatic PATH is probably not enable until re-boot. So, re-boot. Second, TeXlive allows you to state its internal environment variables directly, as part of the environment. Then, it will only use its own variables, if it cannot find what it needs in yours. This is the method that worked for the OP. For example, suppose TeX is looking for files in `/path/to/somehwere`, but they are in `/this/other/place`. You can do: ``` export TEXWHATEVER=/this/other/place ``` in your user `$HOME/.bashrc` file, then reboot. Now TeX expects its `TEXWHATEVER` environment in `/this/other/place`. In my own setup, the distro TeX is so different from TUG, that I manually define TEXMFROOT this way. This is especially effective if (as with the OP) TeX needs to write there, but you do not have write privileges. You can re-direct to a somewhere in your home directory, where you do have write privileges. This is not the only solution. There is also `usermode` which directs many things to a directory of your choice, in user home. The `tlmgr` program help will show you what to do. In general `usermode` is a better approach.
1
https://tex.stackexchange.com/users/287367
682243
316,551
https://tex.stackexchange.com/questions/682245
2
Why does `\newenvironment` work but the same code does not work with `\NewDocumentEnvironment`: ``` \documentclass{scrlttr2} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \RequirePackage{booktabs} \RequirePackage{tabularx} \newenvironment{invoice} %\NewDocumentEnvironment{invoice}{} {\par\noindent% \tabularx{\textwidth}{cXrr} \toprule[0.7pt]\textbf{Pos.} & \textbf{Beschreibung} & \textbf{Gesamtpreis} \\ \toprule[0.7pt]} {\midrule[0.7pt] && \textbf{Rechnungsbetrag} & \textbf{1234} \\ \cmidrule[0.7pt]{3-4} \\ \endtabularx} \NewDocumentCommand{\invoiceitem}{mmm} {#1 & #2 && #3 \\} \begin{document} \begin{invoice} \invoiceitem{1}{Eins}{23} \end{invoice} \end{document} ```
https://tex.stackexchange.com/users/281557
\NewDocumentEnvironment does not work somehow
true
The problem is in interaction between `\NewDocumentEnvironment` and `tabularx`, because the latter needs to absorb the whole contents of the environment prior to take action. In this case the surrounding environment has to do the same. This happens also with `align`, `gather` and similar `amsmath` environments. Thus the solution is to use the `b` (or `+b` if you want to allow blank lines) argument specifier. ``` \documentclass{scrlttr2} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \RequirePackage{booktabs} \RequirePackage{tabularx} \NewDocumentEnvironment {invoice} { +b } {% \noindent% \begin{tabularx}{\textwidth}{cXrr} \toprule[0.7pt] \textbf{Pos.} & \textbf{Beschreibung} & & \textbf{Gesamtpreis} \\ \toprule[0.7pt] #1 \midrule[0.7pt] & & \textbf{Rechnungsbetrag} & \textbf{1234} \\ \cmidrule[0.7pt]{3-4} \\ \end{tabularx} }{} \NewDocumentCommand {\invoiceitem} { mmm } {#1 & #2 & & #3 \\} \begin{document} \begin{invoice} \invoiceitem{1}{Eins}{23} \end{invoice} \end{document} ```
3
https://tex.stackexchange.com/users/29873
682250
316,553
https://tex.stackexchange.com/questions/682019
5
I want to draw a function defined as infinite serie using pgfplots. Is that possible and how? The function is given by ``` \[u(t,x)=\sum_{n=1}^{+\infty}\frac{\sin(2nt)\sin(nx)}{n^2}.\] ``` One can give `t` some fixed values say `t=0.1, 0.2, 1, 4`, and try to draw the function of `x` only, but still blocked with the infinite sum. In fact, what i can do is working with single function, say if n=2 or 3 or any fixed value in N. But with infinite sum i have no idea. Here is a mwe. ``` \documentclass{article} \usepackage{xcolor,pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} \addplot3 [surf,domain=0:pi,domain y=0:1] {sin(4*deg(y))*sin(2*deg(x))/4}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[ axis lines=center, enlargelimits=true,] \addplot[thick, red, domain=0:pi, smooth, samples=300] {sin(4)*sin(2*deg(x))/4}; \addplot[thick, green ,domain=0:pi, smooth, samples=300] {sin(8)*sin(2*deg(x))/4}; \addplot[thick, blue, domain=0:pi, smooth, samples=300] {sin(12)*sin(2*deg(x))/4}; \legend{$t=1$, $t=2$, $t=3$}; \end{axis} \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/232842
Plot infinite series
false
* You can not draw infinite sum but only some approximation of it. * `tikz` and `pgfšplots` packages have not defined command for calculation of sum of functions. * From given equation, considering only first four terms, a possible MWE is: ``` \documentclass[margin=3mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ trig format plots=rad, % <- ---- axis lines=center, enlargelimits, xtick = {0, pi/4, pi/2, 3*pi/4, pi}, xticklabels = {0, $\pi/4$, $\pi/2$, $3\pi/4$, $\pi$}, domain=0:pi, samples=201, no marks, % legend pos={outer north east} ] \addplot {sin(1*x)*sin((1^2)*x)/(1^2) + sin(2*x)*sin((2^2)*x)/(2^2) + sin(3*x)*sin((3^2)*x)/(3^2) + sin(4*x)*sin((4^2)*x)/(4^2) + sin(5*x)*sin((5^2)*x)/(5^2) }; \end{axis} \end{tikzpicture} \end{document} ```
3
https://tex.stackexchange.com/users/18189
682251
316,554
https://tex.stackexchange.com/questions/682259
1
Reading 'source2e.dtx' suggests that the 'l3keys' property '.default' should be available. The following MWE doesn't work as I expected though: ``` \documentclass[a4paper]{article} \usepackage{color} \newcommand*{\test}[1]{\textcolor{\mycolor}{#1}} \DeclareKeys{ ref.default = red , ref.store = \mycolor , } \begin{document} \SetKeys{ ref = blue, } \test{Blue} \SetKeys{ ref, } \test{Red} \end{document} ``` I get an error [TeXLive 2023 updated today]: "./DeclareKey.tex:9: LaTeX Error: The key property '.default' is unknown." and The "Red" text is printed in black (I expected red). What am I missing?
https://tex.stackexchange.com/users/69978
\SetKeys (ltkeys): property '.default' is unknown?
false
The key property to set a default value doesn't have a LaTeX2e equivalent (yet?), you'll have to use `.default:n` instead for now (see the documentation of the `l3keys`-module in `interface3.pdf`). ``` \documentclass[a4paper]{article} \usepackage{color} \newcommand*{\test}[1]{\textcolor{\mycolor}{#1}} \DeclareKeys{ ref.store = \mycolor , ref.default:n = red , } \begin{document} \SetKeys{ ref = blue, } \test{Blue} \SetKeys{ ref, } \test{Red} \end{document} ```
2
https://tex.stackexchange.com/users/117050
682260
316,556
https://tex.stackexchange.com/questions/682019
5
I want to draw a function defined as infinite serie using pgfplots. Is that possible and how? The function is given by ``` \[u(t,x)=\sum_{n=1}^{+\infty}\frac{\sin(2nt)\sin(nx)}{n^2}.\] ``` One can give `t` some fixed values say `t=0.1, 0.2, 1, 4`, and try to draw the function of `x` only, but still blocked with the infinite sum. In fact, what i can do is working with single function, say if n=2 or 3 or any fixed value in N. But with infinite sum i have no idea. Here is a mwe. ``` \documentclass{article} \usepackage{xcolor,pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} \addplot3 [surf,domain=0:pi,domain y=0:1] {sin(4*deg(y))*sin(2*deg(x))/4}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[ axis lines=center, enlargelimits=true,] \addplot[thick, red, domain=0:pi, smooth, samples=300] {sin(4)*sin(2*deg(x))/4}; \addplot[thick, green ,domain=0:pi, smooth, samples=300] {sin(8)*sin(2*deg(x))/4}; \addplot[thick, blue, domain=0:pi, smooth, samples=300] {sin(12)*sin(2*deg(x))/4}; \legend{$t=1$, $t=2$, $t=3$}; \end{axis} \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/232842
Plot infinite series
true
You can approximate the infinite series by truncating it at a certain number of terms. In practice, you should choose a reasonably high number of terms to get a good approximation. In this case, I will show you how to truncate the series at 10 terms. You can easily adjust the number of terms to your needs. To make your code more concise, you can use a loop to generate the terms in the sum. Here's an example using your function with t=0.1, 0.2, 1, and 4: ``` \documentclass[margin=3mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \ExplSyntaxOn \NewExpandableDocumentCommand{\RepeatFunction}{mm}{\int_step_function:nnN{#1}{#2}\RepeatFunction:n} \pgfplotsset{repeatable~function/.code=\DeclareExpandableDocumentCommand{\RepeatFunction:n}{m}{#1}} \ExplSyntaxOff \pgfplotsset{ /pgf/declare function={sinsin(\n,\t,\x)=sin(2*\n*\t)*sin(\n*\x)/(\n*\n);}, repeatable function={+sinsin(#1,\t,x)}, sinsin terms/.initial=10, sinsin terms/.code={\pgfplotsset{sinsin terms/.initial=#1}} } \begin{document} \foreach \t in {0.1, 0.2, 1, 4}{ \begin{tikzpicture} \begin{axis}[ trig format plots=rad, axis lines=center, enlargelimits, xtick = {0, pi/4, pi/2, 3*pi/4, pi}, xticklabels = {0, $\pi/4$, $\pi/2$, $3\pi/4$, $\pi$}, domain=0:pi, samples=201, no marks, title={t = $\t$}, legend pos={outer north east}, sinsin terms=10 % Set the number of terms here ] \addplot[blue] {\RepeatFunction{1}{\pgfkeysvalueof{/pgfplots/sinsin terms}}}; \end{axis} \end{tikzpicture} } \end{document} ```
2
https://tex.stackexchange.com/users/42634
682262
316,557
https://tex.stackexchange.com/questions/682263
1
The following compiles with `make4ht` but `htlatex` throws some errors. I'm trying to use make4ht to handle multiple files and link between them using `xr-hyper` and `hyperref`. In some cases I want to link to particular sections, equations etc, but in other cases I just want to link to the document. To do this I've set up a typical document that looks something like this, saved as `main.tex` ``` \usepackage{amsmath} \usepackage{xr-hyper} %hyperlinks and referencing \usepackage{hyperref} \usepackage[capitalize,nameinlink,noabbrev]{cleveref} \title{Main file} \begin{document} \maketitle \label{main file} \section{First Section} \begin{equation} \label{equation} \int f(x) dx \end{equation} \end{document} ``` The idea of the label just after the title is so that it can be linked to from other files, with out specifying a particular section, equation or theorem etc. In another file, if I have something like ``` \usepackage{amsmath} \usepackage{xr-hyper} %hyperlinks and referencing \usepackage{hyperref} \usepackage[capitalize,nameinlink,noabbrev]{cleveref} \externaldocument[main-]{main} \begin{document} \hyperref[main-main file]{the main file} \end{document} ``` Then `htlatex` gives errors of the form ``` [STATUS] make4ht: Conversion started [STATUS] make4ht: Input file: ref.tex [ERROR] htlatex: Compilation errors in the htlatex run [ERROR] htlatex: Filename Line Message [ERROR] htlatex: ./ref.tex 34 Argument of \xr:rEfLiNK has an extra }. [ERROR] htlatex: ./ref.tex 34 Paragraph ended before \xr:rEfLiNK was complete. ``` This isn't an issue with only one file, and the output produced is as expected even with the errors, but in examples with lots of files referencing each other there seems to be too many errors for make4ht to handle. The above example works well with `pdflatex`. There are no issues if the equation or section is labeled and referenced instead of the label after the title. Is there a better way to link to the whole document, rather than using a label at the top of the page? I suppose what I've written above isn't best practice as the `\label` after the title doesn't actually have anything to reference.
https://tex.stackexchange.com/users/292574
make4ht multiple files hyperref issues with labels at the top of the file
true
This is not so simple. TeX4ht needs to insert a destination link for label to the document, which it usually does in sectioning command, or other command that declares an object for cross-references. When you use `\label` at the beginning of the document, no such command had been called, so there is no destination. Other issue is that when you use Hyperref, every cross-reference needs to have assigned some special macros. I would change your main document in this way: ``` \documentclass{article} \usepackage{amsmath} \usepackage{xr-hyper} %hyperlinks and referencing \usepackage{hyperref} \usepackage[capitalize,nameinlink,noabbrev]{cleveref} \makeatletter \newcommand\currentdoc[1]{\edef\@currentlabel{#1}\label{#1}} \makeatother \title{Main file} \begin{document} \maketitle \currentdoc{main file} \section{First Section} \begin{equation} \label{equation} \int f(x) dx \end{equation} \end{document} ``` As you can see, I've changed first `\label` to `\currentdoc`. Now in a config file, you can redefine this command to have a necessary form for TeX4ht: ``` \Preamble{xhtml} \makeatletter \catcode`\:=11 \renewcommand\currentdoc[1]{% % the value of \@currentlabel is not important in our case, so we can just use the parameter \edef\@currentlabel{#1}% % these two are needed to fix hyperref errors \gdef\NR:Title{\a:newlabel{#1}}% \gdef\NR:Type{doc}% % insert link destination to the document \AnchorLabel% % and now you can call label \label{#1}% } \catcode`\:=12 \makeatother \begin{document} \EndPreamble ``` I've added some comments to the code, I hope that it makes sense. Now you can compile the main file using: ``` $ make4ht -c config.cfg main.tex ``` After that, the `main.aux` file should be safe for inclusion from other files.
1
https://tex.stackexchange.com/users/2891
682269
316,559
https://tex.stackexchange.com/questions/682019
5
I want to draw a function defined as infinite serie using pgfplots. Is that possible and how? The function is given by ``` \[u(t,x)=\sum_{n=1}^{+\infty}\frac{\sin(2nt)\sin(nx)}{n^2}.\] ``` One can give `t` some fixed values say `t=0.1, 0.2, 1, 4`, and try to draw the function of `x` only, but still blocked with the infinite sum. In fact, what i can do is working with single function, say if n=2 or 3 or any fixed value in N. But with infinite sum i have no idea. Here is a mwe. ``` \documentclass{article} \usepackage{xcolor,pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} \addplot3 [surf,domain=0:pi,domain y=0:1] {sin(4*deg(y))*sin(2*deg(x))/4}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[ axis lines=center, enlargelimits=true,] \addplot[thick, red, domain=0:pi, smooth, samples=300] {sin(4)*sin(2*deg(x))/4}; \addplot[thick, green ,domain=0:pi, smooth, samples=300] {sin(8)*sin(2*deg(x))/4}; \addplot[thick, blue, domain=0:pi, smooth, samples=300] {sin(12)*sin(2*deg(x))/4}; \legend{$t=1$, $t=2$, $t=3$}; \end{axis} \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/232842
Plot infinite series
false
As the others have said, no, you can't calculate an inifinite sum. However, you can calculate a sum up to a specific point. The macro `\RepeatFunction{*s*}{*e*}` should help you here. It simply repeats a given function for all integer values *n* between `*s*` and `*e*`. The function it should use can be specified by using `repeatable function` where `#1` stands for the value *n*. Since your function is also parametrized, I also added a `sinsin t` value-key which is used by the repeatable function. If you only want to plot this function once (for a given *t*) you will need to figure out yourself at which *n* to stop. Code ---- ``` \documentclass[tikz]{standalone} \usepackage{pgfplots}\pgfplotsset{compat=1.18} \usepgfplotslibrary{groupplots} \ExplSyntaxOn \NewExpandableDocumentCommand{\RepeatFunction}{mm}{\int_step_function:nnN{#1}{#2}\RepeatFunction:n} \pgfplotsset{repeatable~function/.code=\DeclareExpandableDocumentCommand{\RepeatFunction:n}{m}{#1}} \ExplSyntaxOff \pgfplotsset{ /pgf/declare function={sinsin(\n,\t,\x)=sin(2*\n*\t)*sin(\n*\x)/(\n*\n);}, repeatable function={+sinsin(#1,\pgfkeysvalueof{/pgfplots/sinsin t},x)}, sinsin t/.initial=1} \begin{document} \begin{tikzpicture}[ mini legend/.style={at={(rel axis cs:.5,0)}, above, node contents={$t = #1$}}] \begin{groupplot}[ group style={group size = 2 by 2}, % trig format plots=rad, axis lines=center, enlargelimits, xtick = {0, pi/4, pi/2, 3*pi/4, pi}, xticklabels = {0, $\pi/4$, $\pi/2$, $3\pi/4$, $\pi$}, domain=0:pi, samples=129, no marks, every axis legend/.append style={ at={(1,1)}, anchor=north west, path only, /tikz/column 2/.append style={anchor=west}}, style 10+/.style={path only}, style 10/.style={thick, densely dashed, black} ] \nextgroupplot \pgfplotsinvokeforeach{1,...,5,10}{ \addplot+[style #1+/.try, forget plot, very thin] {sinsin(#1,1,x)}; \addplot+[style #1/.try] {\RepeatFunction{1}{#1}}; } \node[mini legend=1]; \nextgroupplot[sinsin t=2] \pgfplotsinvokeforeach{1,...,5,10}{ \addplot+[style #1+/.try, forget plot, very thin] {sinsin(#1,2,x)}; \addplot+[style #1/.try] {\RepeatFunction{1}{#1}}; \addlegendentry{$n = #1$} } \node[mini legend=2]; \nextgroupplot[sinsin t=.2] \pgfplotsinvokeforeach{1,...,5,10}{ \addplot+[style #1+/.try, forget plot, very thin] {sinsin(#1,.2,x)}; \addplot+[style #1/.try] {\RepeatFunction{1}{#1}}; } \node[mini legend=0.2]; \nextgroupplot[sinsin t=.5] \pgfplotsinvokeforeach{1,...,5,10}{ \addplot+[style #1+/.try, forget plot, very thin] {sinsin(#1,.5,x)}; \addplot+[style #1/.try] {\RepeatFunction{1}{#1}}; } \node[mini legend=0.5]; \end{groupplot} \end{tikzpicture} \end{document} ``` Output ------
4
https://tex.stackexchange.com/users/16595
682271
316,560
https://tex.stackexchange.com/questions/682019
5
I want to draw a function defined as infinite serie using pgfplots. Is that possible and how? The function is given by ``` \[u(t,x)=\sum_{n=1}^{+\infty}\frac{\sin(2nt)\sin(nx)}{n^2}.\] ``` One can give `t` some fixed values say `t=0.1, 0.2, 1, 4`, and try to draw the function of `x` only, but still blocked with the infinite sum. In fact, what i can do is working with single function, say if n=2 or 3 or any fixed value in N. But with infinite sum i have no idea. Here is a mwe. ``` \documentclass{article} \usepackage{xcolor,pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} \addplot3 [surf,domain=0:pi,domain y=0:1] {sin(4*deg(y))*sin(2*deg(x))/4}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[ axis lines=center, enlargelimits=true,] \addplot[thick, red, domain=0:pi, smooth, samples=300] {sin(4)*sin(2*deg(x))/4}; \addplot[thick, green ,domain=0:pi, smooth, samples=300] {sin(8)*sin(2*deg(x))/4}; \addplot[thick, blue, domain=0:pi, smooth, samples=300] {sin(12)*sin(2*deg(x))/4}; \legend{$t=1$, $t=2$, $t=3$}; \end{axis} \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/232842
Plot infinite series
false
I found your question difficult to interpret so I need to explain my approach a bit more. First, your question is "I want to draw a function defined as infinite serie[s] using pgfplots. Is that possible and how?". The answer, as Zarko indicated will necessarily involve a finite number of terms. It won't be exact. So I will explain how to plot 1 infinite series, under the assumption that `t=.1`. When you are getting into more complicated mathematics, it's important to be aware that the accuracy of your calculations and plots might not be correct; `pgfplots` is not a computer algebra system (CAS), after all. I find it helpful to first determine what the answer should be using a CAS. After that, use the sagetex package to incorporate the CAS plots/calculations into your LaTeX document. You talked about fixing a value of `t` first, so I picked `t=.1` and went to a [Sage Cell Server](https://sagecell.sagemath.org/) where you can copy/paste the following code: ``` def f(t,n): return (sin(2*n*t)*sin(n*x))/(n^2) g(x)=sum(f(.1,n) for n in range(1,21)) h(x)=sum(f(.1,n) for n in range(1,201)) P1=plot(g(x),(x,0,3.14)) P2=plot(h(x),(x,0,3.14),color="red") (P1+P2).show() ``` Press the `Enter` button and you'll get the output below: From this output, I see that graphing 20 terms of the series gives me a pretty good estimate, which is what I'll use in my LaTeX document. You should experiment to find the value of `n` that you think works best. Why did I say 20 terms? Because `range(1,21)` is Python and it doesn't run that last value, so the plot I'm using sums up the first 20 terms. Notice also that I have defined f(t,n) in general. You will be able to easily change `t` to whatever you want. What we want `pgfplots` to plot now is `g(x)` but since we can't trust the numerical accuracy of this for complicated math, we will use the [sagetex](https://ctan.org/pkg/sagetex?lang=en) to link the Sage CAS calculations to our document. The code is below: ``` \documentclass{article} \usepackage{sagetex,xcolor,pgfplots} \pgfplotsset{compat=1.16} \begin{document} \begin{sagesilent} def f(t,n): return (sin(2*n*t)*sin(n*x))/(n^2) g(x)=sum(f(.1,n) for n in range(1,21)) x_coords = [x for x in srange(0,6.28,.01)] y_coords = [g(x).n(digits=4) for x in x_coords] output = r"\begin{tikzpicture}" output += r"\begin{axis}[xmin=0,xmax=6.28,ymin= -.5,ymax=.5," output += r"xlabel=$x$,ylabel=$y$,axis x line=middle,axis y line=middle," output += r"grid style=dashed]" output += r"\addplot[thin, blue] coordinates {" for i in range(0,len(x_coords)-1): output += r"(%f , %f) "%(x_coords[i],y_coords[i]) output += r"};" output += r"\end{axis}" output += r"\end{tikzpicture}" \end{sagesilent} \sagestr{output} \end{document} ``` The output, running in Cocalc, is shown below: Note, I changed the graph so that it goes about 2pi (about 6.28). The line `x_coords = [x for x in srange(0,6.28,.01)]` is going to set the x-values to be plotted as 0, .01, ...., 6.27. The line `y_coords = [g(x).n(digits=4) for x in x_coords]` says, to calculate g(x) for each x-value, but we force the answer to be a decimal (with 4 significant figures) so that pgfplots can handle it. Notice that using `Sage` along with `sagetex` lets you avoid typing out the 20 terms in sin(2(1)(.1))\*sin((1)x))/(1^2)+....+sin(2(20)(.1))\*sin((20)x))/(20^2). Finally, it may seem odd to insert the code as a raw string; that's done because processing the document is, behind the scenes, a 3 step process: first, the LaTeX code must run as is, then the Python/Sage code must run without error and then the document is processed 1 more time to put the Python/Sage output into the LaTeX document. Without strings it's more likely the code will not run under LaTex during the first pass. [Sage](https://www.sagemath.org/) is a free CAS which is not part of LaTeX. You can download it to your computer and get it to work with LaTeX but the easiest way to get started is to open a free [Cocalc](https://cocalc.com/) account, create a LaTeX document there, copy/paste the code in and press `Build`.
3
https://tex.stackexchange.com/users/6513
682273
316,562
https://tex.stackexchange.com/questions/682184
0
`dvisvgm` calling `kpathsea` cannot find the `texmf.cnf` file, but this does exist, though at a presumably nonstandard directory location. What to do to let the `texmf.cnf` file be located? --- To convert a `.dvi` file into a `.svg` file, the command ``` dvisvgm -p 1 "media/Tex/2ce87d7e7c2b7157.dvi" -n -v 0 -o "media/Tex/2ce87d7e7c2b7157.svg" ``` is called and receives the output ``` warning: kpathsea: configuration file texmf.cnf not found in these directories: /etc/texmf/web2c:/usr/local/share/texmf/web2c:/usr/share/texmf/web2c:/usr/share/texlive/texmf-dist/web2c://share/texmf/web2c. ``` However, calling `kpsewhich texmf.cnf` shows that this file exists (`/home/aria/.TinyTeX/texmf.cnf`), though at not one of the listed directories of the `dvisvgm` command. I also tried running `tlmgr conf texmf TEXMFHOME "~/.TinyTex"` which was successful: `tlmgr: setting texmf TEXMFHOME to ~/.TinyTex (in /home/aria/.TinyTeX/texmf.cnf)`, but running the first command still leads to the same error.
https://tex.stackexchange.com/users/179093
How can I make dvisvgm calling kpathsea find the texmf.cnf file in a nonstandard directory?
false
I found a workaround that makes it all work, but I am unsure if this is the intended way. I just added a symlink to the existing `texmf.cnf` file in a directory that `kpathsea` looks in, which further entailed that I actually make one of the directories, as they don't exist for me.
0
https://tex.stackexchange.com/users/179093
682274
316,563
https://tex.stackexchange.com/questions/682265
1
I am trying to get [albatross](https://ctan.org/pkg/albatross) to work with miktex on a Windows machine. Trying `albatross --version` at the command line tells me `albatross` is not a recognized command. In my miktex installation, I see `albatross.jar` and `albatross.sh` in `.../MiKTeX/scripts/albatross` so I tried adding `.../MiKTeX/scripts` to my PATH but still it's not recognized. Is MiKTeX missing an executable file in `MiKTeX/miktex/bin/x64` or is something wrong with my setup? I know albatross has some dependencies (Fontconfig, Java) but I'd like to first just get my machine to recognize the command. As a sidenote, I also tried `albatross --version` on Ubuntu with the Debian texlive (contained in texlive-font-utils) and got a similar result: `albatross: command not found`.
https://tex.stackexchange.com/users/208544
How to use albatross with miktex on Windows?
true
MiKTeX now provides an `albatross` executable which is available upon update. Previously MiKTeX only included the necessary files which could be run manually using ``` java -jar albatross.jar ``` which, with Java SDK 20 installed and an appropriate path to the `albatross.jar`, would readily substitute for the executable.
1
https://tex.stackexchange.com/users/106162
682276
316,564
https://tex.stackexchange.com/questions/682258
0
I would like to change the color of some points in a plot if its Euclidean distance to a cluster centroid coordinate is smaller or greater than to the other cluster centroid. I have made different attempts there is something missing that does not compile. I have created two tikz functions, dist1 and dist2 to each centroid, and try to use point meta in the addplot to change the color of the mark, ``` \documentclass{standalone} \usepackage{pgfplots, pgfplotstable} \usepackage{tikz} \usetikzlibrary{positioning} \usetikzlibrary{tikzmark,math} \usetikzlibrary{arrows.meta} \usepackage{calc} \usepackage{filecontents} \begin{filecontents*}{myplot.csv} x,y 0.1566,1.8781 0.3431,1.5972 0.4492,1.714 0.6587,1.3417 0.7074,0.8094 1.1474,0.4845 1.3499,1.1533 1.8312,1.2761 2.1437,0.8622 2.2518,1.7449 \end{filecontents*} \begin{document} \begin{tikzpicture} \begin{axis}[ width=10cm, height=10cm, xlabel={$x$}, ylabel={$y$}, scatter/classes={ red={mark=square*,red}, blue={mark=triangle*,blue} } ] % Declare functions to compute distances to CC1 and CC2 % Calculate distance to CC1 and CC2 \tikzmath{ coordinate \centroid1, \centroid2; \centroid1 = (3.5, 2.0); \centroid2 = (2.0, 1.0); function dist1(\x,\y) { return sqrt((\x - \centroid1.x)^2 + (\y - \centroid1.y)^2); }; function dist2(\x,\y) { return sqrt((\x - \centroid2.x)^2 + (\y - \centroid2.y)^2); }; } \addplot[ mark=*, only marks, point meta=ifthenelse(dist1(\thisrow{x}, \thisrow{y}) < dist2(\thisrow{x}, \thisrow{y}), "red", "blue") ] table {myplot.csv}; \end{axis} \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/178274
How to color a coordinate under a function condition
true
I do not know if it is easy to mix tikz math with pgfplots, and whether one can convince point meta to parse expressions and interpret the resulting string as a style. Most likely it is possible but I am unable to make this work. However, one can use the more low-level `scatter/@pre marker code` to achieve a conditional coloring. This code can be used to compare the distances of a given point from the two centroids, and set the style of the mark accordingly. ``` \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{filecontents*}[overwrite]{myplot.csv} x,y 0.1566,1.8781 0.3431,1.5972 0.4492,1.714 0.6587,1.3417 0.7074,0.8094 1.1474,0.4845 1.3499,1.1533 1.8312,1.2761 2.1437,0.8622 2.2518,1.7449 \end{filecontents*} \begin{document} \begin{tikzpicture} \begin{axis}[width=10cm,height=10cm,xlabel={$x$},ylabel={$y$}, declare function={cx1=1.5;cy1=2.0;cx2=2.0;cy2=1.0; dist(\x,\y,\u,\v)=sqrt((\x-\u)*(\x-\u)+(\y-\v)*(\y-\v)); dist1(\x,\y)=dist(\x,\y,cx1,cy1); dist2(\x,\y)=dist(\x,\y,cx2,cy2); } ] \addplot[ mark=*, only marks, scatter, visualization depends on={value \thisrow{x} \as \myx}, visualization depends on={value \thisrow{y} \as \myy}, scatter/@pre marker code/.code={% \pgfmathparse{int(dist1(\myx,\myy)<dist2(\myx,\myy)?1:0)}% \ifcase\pgfmathresult \tikzset{my mark/.style={mark=square*,red}} \or \tikzset{my mark/.style={mark=triangle*,blue}} \fi \begin{scope}[my mark] }, scatter/@post marker code/.code={\end{scope}} ] table[col sep=comma] {myplot.csv}; \end{axis} \end{tikzpicture} \end{document} ``` Notice that I removed packages that are not in use and also changed the coordinates of one centroid, with the values given in the question all marks look the same because one distance is always smaller than the other.
1
https://tex.stackexchange.com/users/nan
682278
316,565
https://tex.stackexchange.com/questions/682287
2
``` \documentclass[12pt] {article} \usepackage{amsmath} \usepackage{amssymb} \begin{document} \begin{align*} &\[\begin{vmatrix} \dfrac{p}{x^3}-\dfrac{3z}{x^4} & -\dfrac{y}{x^2} \\ \dfrac{q}{x^3} & \dfrac{1}{x} \end{vmatrix}=0 \] \\ \Longrightarrow\;&\[\begin{vmatrix} px-3z & -y \\ qx & x \\ \end{vmatrix}=0 \] \\ \Longrightarrow\; &p+qx=3z \end{align*} \end{document} ``` I want to align the lines but it's all messed up. I cannot figure out what `bad environment delimiter` is there.
https://tex.stackexchange.com/users/214287
Alignment of 'vmatrix' environments in an 'align*' environment
true
To get rid of the "bad math environment delimiter" messages, you must get rid of both instances of `\[` and `\]` that currently encase the `vmatrix` environments. I would also employ the `booktabs` package and its `\addlinespace` macro to create more vertical whitespace between the rows of the `vmatrix` environments and between rows of the `align*` environment. Optionally, you could employ `\phantom{-}` directives in the (2,2) cells to tweak the horizontal alignment of the cell contents relative to the contents of the (1,2) cells. ``` \documentclass[12pt]{article} \usepackage{amsmath,amssymb} \usepackage{booktabs} % <-- new \begin{document} \begin{align*} &\begin{vmatrix} \dfrac{p}{x^3}-\dfrac{3z}{x^4} & -\dfrac{y}{x^2} \\ \addlinespace \dfrac{q}{x^3} & \phantom{-}\dfrac{1}{x} \end{vmatrix}=0 \\ \addlinespace \Longrightarrow &\begin{vmatrix} px-3z & -y \\ \addlinespace qx & \phantom{-}x \\ \end{vmatrix}=0 \\ \Longrightarrow &\kern3pt p+qx=3z \end{align*} \end{document} ```
4
https://tex.stackexchange.com/users/5001
682289
316,569
https://tex.stackexchange.com/questions/682290
2
I am trying to create a good `\EUR` command that displays the value according to DIN5008 with `.` as thousand separator and `,` as decimal point and at least two decimal places. However, if there are more decimal places given then more should be shown. ``` \documentclass{scrlttr2} \usepackage[ngerman]{babel} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \usepackage[detect-all, separate-uncertainty]{siunitx} \sisetup{group-minimum-digits = 4, group-separator = {~}, locale=DE} \RequirePackage{xspace} \newcommand{\EUR}[1]{ \num[group-separator = {.}, round-precision = 2, round-mode = places]{#1}~\unit{€}\xspace} \begin{document} \begin{tabular}{lS[table-format=5.2]r} Description A & 123 & \EUR{1234.5678}\\ Description B & 1.2 & \EUR{12.3}\\ Description C & 12.3 & \EUR{123}\\ Description D & 12.34 & \EUR{12345.678901}\\ Description E & 12345 & \EUR{12345678.9}\\ \end{tabular} \end{document} ``` I was only able to round to fixed 2 digits but not to not round at all but just show at least 2 decimal digits (even if less are provided) and more if more are provided... Can this be done?
https://tex.stackexchange.com/users/281557
How to add at least two decimal digits with siunitx?
true
(I revised this answer after receiving additional information from the OP. I revised it further after realizing that the answer should focus just on the properties of the `\EUR` macro -- and thus also ignore the `tabular` stuff shown in the OP's code.) In the definition of the `\EUR` macro, you need to replace ``` round-precision = 2, round-mode = places ``` with ``` minimum-decimal-digits=2 ``` ``` \documentclass{scrlttr2} \usepackage[T1]{fontenc} \usepackage[ngerman]{babel} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \usepackage{siunitx} \sisetup{mode=text, %detect-all, separate-uncertainty, group-minimum-digits = 4, group-separator = {\,}, locale=DE} \newcommand{\EUR}[1]{% \num[group-separator = {.}, minimum-decimal-digits=2]{#1}\,\unit{€}} \begin{document} \EUR{123} \EUR{123.45} \EUR{12345.678912} \end{document} ```
4
https://tex.stackexchange.com/users/5001
682291
316,570
https://tex.stackexchange.com/questions/682277
2
Let's assume that we have a huge LaTeX document, out of which we produce a PostScript version via `latex`+`dvips` and a PDF version via `lualatex`. Compiling everything from scratch (without any auxiliary files from previous runs) takes long (on my current machine with its current background load, it takes over 1.5 h). Thus, whenever we wish to produce both versions, we would like to save some work and keep as much useful stuff in the auxiliary files as possible (we spend only 68% to 78% of time when reusing the old auxiliary files). However, we get an error on the standard output when we run `lualatex` *after* `latex` (we assume exactly this order in this particular question) as follows. To demonstrate the error on a small example, we prepare a file `mwe.tex` containing ``` \documentclass{article} \usepackage[french,USenglish]{babel} \begin{document} \section{Title}\label{sect:title}% even “sect:” would do \end{document} ``` Running `rm -f mwe.aux && latex mwe && lualatex mwe` results in ``` (./mwe.aux ! Undefined control sequence. <argument> r@sect: title l.10 \newlabel{sect:title}{{1}{1}} ? ``` on the standard tty output. Is there a bug / issue / unintended behavior hiding anywhere (e.g., in `babel`)? How to process `mwe.aux` (while retaining as much useful data as possible there) after the run of `latex` and before the run of `lualatex` such that the error goes away? We wish to noninteractively edit the auxiliary file, say, via `sed` or `awk`.
https://tex.stackexchange.com/users/292998
Running lualatex after latex while retaining auxiliary files in the presence of colon in labels and nonmain french language
true
using `:` in labels at the same time as activating them for French punctuation is playing with fire, but you can write a command to the aux to make it safe. ``` \documentclass{article} \usepackage[french,USenglish]{babel} \ifdefined\directlua\else \makeatletter \AtBeginDocument{% \immediate\write\@auxout{\detokenize{% \ifx:\@undefined\edef:{\string:}\fi }}} \makeatother \fi \begin{document} \section{Title}\label{sect:title}% even “sect:” would do \end{document} ``` after the latex run the aux will be ``` \relax \providecommand\babel@aux[2]{} \@nameuse{bbl@beforestart} \catcode `:\active \catcode `;\active \catcode `!\active \catcode `?\active \ifx :\@undefined \edef :{\string :}\fi \babel@aux{USenglish}{} \@writefile{toc}{\contentsline {section}{\numberline {1}Title}{1}{}\protected@file@percent } \newlabel{sect:title}{{1}{1}} \gdef \@abspage@last{1} ``` and then after lualatex ``` \relax \providecommand\babel@aux[2]{} \@nameuse{bbl@beforestart} \babel@aux{USenglish}{} \@writefile{toc}{\contentsline {section}{\numberline {1}Title}{1}{}\protected@file@percent } \newlabel{sect:title}{{1}{1}} \gdef \@abspage@last{1} ``` Is the postscript generated by lualatex; pdftops not usable?
2
https://tex.stackexchange.com/users/1090
682294
316,571
https://tex.stackexchange.com/questions/682037
0
I'm having issues making my table of contents show the location of the list of acronyms. I followed [this](https://tex.stackexchange.com/questions/220059/list-of-figures-and-tables-not-in-contents) and managed to make it work for the List of Figures and List of Tables, with the following: ``` \tableofcontents \cleardoublepage \addcontentsline{toc}{section}{\listfigurename}\listoffigures \cleardoublepage \addcontentsline{toc}{section}{\listtablename}\listoftables ``` But I don't know how do add a contents line for my list of acronyms. Currently I only have these at the end of my document, which renders the acronyms: ``` \printnoidxglossary % default: type=main \printnoidxglossary[type=acronym] \printnoidxglossary[type=symbols] ```
https://tex.stackexchange.com/users/200529
Table of contents doesn't show list of acronyms
true
I can confirm that simply adding the following, immediately before the acronyms section, works: ``` \addcontentsline{toc}{section}{List of Acronyms} ``` Thanks to @Teepeemm in the comments for this answer.
1
https://tex.stackexchange.com/users/200529
682296
316,572
https://tex.stackexchange.com/questions/682019
5
I want to draw a function defined as infinite serie using pgfplots. Is that possible and how? The function is given by ``` \[u(t,x)=\sum_{n=1}^{+\infty}\frac{\sin(2nt)\sin(nx)}{n^2}.\] ``` One can give `t` some fixed values say `t=0.1, 0.2, 1, 4`, and try to draw the function of `x` only, but still blocked with the infinite sum. In fact, what i can do is working with single function, say if n=2 or 3 or any fixed value in N. But with infinite sum i have no idea. Here is a mwe. ``` \documentclass{article} \usepackage{xcolor,pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} \addplot3 [surf,domain=0:pi,domain y=0:1] {sin(4*deg(y))*sin(2*deg(x))/4}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[ axis lines=center, enlargelimits=true,] \addplot[thick, red, domain=0:pi, smooth, samples=300] {sin(4)*sin(2*deg(x))/4}; \addplot[thick, green ,domain=0:pi, smooth, samples=300] {sin(8)*sin(2*deg(x))/4}; \addplot[thick, blue, domain=0:pi, smooth, samples=300] {sin(12)*sin(2*deg(x))/4}; \legend{$t=1$, $t=2$, $t=3$}; \end{axis} \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/232842
Plot infinite series
false
This infinite sum is very slowly convergent because you expect an absolute error of order `1/N` if using `N` terms. This means roughly that if you want one more decimal, you need ten times as many terms. For graphics assuming `1` maps to say `1cm`, you should aim at a precision of say `0.1mm`, knowing though that the final plot if continuous will apply some interpolation using Bézier curves (using straight segments will display visible slope changes). This means (I have not estimated too seriously) you will start this knowing you need about 100 terms. As implied constant matters, perhaps 20 terms will be about enough. Then, mind the numerical precision of the computations. As explained in other answers it seems you need to do some work with TikZ and there is no simple syntax of the type `add(sin(2n*t)sin(n*x)/n^2, n from 1 to N)`. I have been pointed out by some colleague from the back office department who had some degree in string theory that you can express by an exact formula the sum, in this case (apparently mathematicians are not always able to do so). First of all `u(t,x) = (v(2t-x)-v(2t+x))/2` with ``` v(y) = \sum_{n=1}^\infty \frac{\cos(n y)}{n^2} ``` [It is known](https://en.wikipedia.org/wiki/Bernoulli_polynomials#Fourier_series) that `v(2\pi u)` is up to a factor the one-periodic function which on interval `[0,1]` has value `B_2(u)` where `B_2` is the second Bernoulli polynomial, `B_2(u) = u^2 - u + 1/6`. Precisely ``` \sum_{n=1}^\infty \frac{\cos(2\pi n u)}{n^2} = \pi^2B_2(\{u\}) ``` where `\{u\}` is the fractional part. This is actually one of the well-known proofs based on Fourier series of Euler evaluation of `\sum 1/n^2 = \pi^2/6` as we see by plugging-in `u=0`. To sum up ``` \sum_{n=1}^\infty \frac{\sin(2n t)\sin(nx)}{n^2} = \frac{\pi^2}2\left(B_2(\{\frac{2t-x}{2\pi}\})- B_2(\{\frac{2t+x}{2\pi}\})\right) ``` The left hand-side is `\pi`-periodic in `t` and `2\pi`-periodic in `x` and odd. So I will assume `0<x<\pi` and `0<t<\pi`. Also let `x'=x/2\pi` so that `0<x'<1/2` and `t' = t/2\pi`. I will simplify here for comparing with the plots in other pictures and assume not only `0<t'<1/2` but `0<t'<1/4` so `0<2t'+x' < 1` and the second contribution with `B_2` is `B_2(2t'+x')`. (one can use oddness in `t` to always reduce to this case `0<t<\pi/2`). So * `0<x'<2t'<1/2`: we get `(2t'-x')^2 - (2t'-x') + 1/6 - (x'+2t')^2 + (x'+2t') - 1/6 = -8x't'+2x' = (2 - 8t') x'` and let's not forget the multiplicative factor `\pi^2/2`. Hence a linear growth reaching the value `2\pi^2(1 - 4t')t'` at `x'=2t'`. As `t'=t/2\pi`, this is `t(\pi - 2t)`. For example for `t=0.1` we get `0.294159...`. Hopefully I got those computations right, will correct and repent if not later on, but this is reaching beyond my TeX knowledge here. * `2t'<x'<1/2`: now `2t'-x'<0` so we use evenness of `B_2(\{u\})` and replace it with `x'-2t'` so that can apply the formula and we get (up to the `\pi^2/2`: `(x'-2t')^2 - (x'-2t') + 1/6 - (x'+2t')^2 + (x'+2t') - 1/6 = -8t'x' +4t' = 4t'(1 - 2x')` which is linear decrease towards value `0` at `x'= 0.5` and starts for `x'=2t'` at `4t'(1-4t')` (times `\pi^2/2`, so `t(\pi-2t)` which (at it should) is same value as found before. So we can explain the exact shape of the limit graph with infinitely many terms: it is on `(0,\pi)` (for `t<\pi/2`) composed of two straight segments joining at the point with Cartesian coordinates `(2t,(\pi - 2t)t` and being with zero ordinate at `x=0` and `x=\pi`. I tried to reconstitute from my Physics Ph.D. colleagues hastened explications, so don't use this for homework without independent counseling.
5
https://tex.stackexchange.com/users/293669
682298
316,573
https://tex.stackexchange.com/questions/682293
4
As the title suggests, I am trying to use `\hbar` in conjunction with the `mlmodern` and `amsfonts` packages. I need to use the `\hbar` provided by `mlmodern`, but when `amsfonts` is loaded, I get the original CM/LM. I have tried the following, which results in an undefined control sequence error for `$\hbar$`: ``` \documentclass{article} \usepackage{mlmodern} \let\mlmhbar\hbar \usepackage{amsfonts} \let\amshbar\hbar \begin{document} \def\hbar{\mlmhbar} $\hbar$ \end{document} ``` Any advice is appreciated.
https://tex.stackexchange.com/users/224851
Using \hbar from MLModern after loading AMSfonts
true
You need to use `\NewCommandCopy`, because `\hbar` is defined as a robust command. ``` \documentclass{article} \usepackage{mlmodern} \NewCommandCopy{\mlmhbar}{\hbar} \usepackage{amsfonts} \NewCommandCopy{\amshbar}{\hbar}% just for the comparison \RenewCommandCopy{\hbar}{\mlmhbar} \begin{document} $h\hbar$ $h\amshbar$ \end{document} ``` However, you can see that the bar with MLModern hits the serif of “h”. ``` \documentclass{article} \usepackage{mlmodern} \usepackage{amsfonts} \NewCommandCopy{\amshbar}{\hbar}% just for the comparison \makeatletter \RenewDocumentCommand{\hbar}{}{% {\mathpalette\hbar@bar\relax\mkern -9muh}% } \newcommand{\hbar@bar}[2]{\raisebox{-0.075\height}{$\m@th#1\mathchar'26$}} \makeatother \begin{document} $h\hbar$ $h\amshbar$ $\scriptstyle h\hbar$ \end{document} ```
3
https://tex.stackexchange.com/users/4427
682300
316,574
https://tex.stackexchange.com/questions/682297
1
I am using the `etoc` package to print local ToCs on the scope of parts, but there is a problem: I have a global bibliography at the end of my document, which is not supposed to belong to the last part, but it does appear in the local ToC of the part. How can I remove the bibliography from the local ToC? I found similar questions ([here](https://stackoverflow.com/q/2785260/5472354), and [here](https://tex.stackexchange.com/q/256909/182643)), but the solutions don't work in my case, because I only want to remove the bibliography entry from the local, but not the global ToC. Here is an MWE: ``` \documentclass{scrbook} \usepackage{etoc} \usepackage{biblatex} % Set the style for chapter entries \etocsetstyle{chapter}% {\begingroup \parindent 0pt \parskip 0pt}% {\leftskip 0pt}% {\makebox[.5cm]{}% \hangindent=0.5cm \etoclink{\etocthename}\nobreak\hbox{\hbox to 1.5ex {\hss\hss}}% \hfill\makebox[5mm][l]{\etocpage}\nobreak% \par}% {\endgroup}% % Set the style for section entries \etocsetstyle{section}% {\begingroup \parindent 20pt \parskip 0pt}% {\leftskip 0pt}% {\makebox[.5cm]{}% \hangindent=0.5cm \etoclink{\etocthename}\nobreak\hbox{\hbox to 1.5ex {\hss\hss}}% \hfill\makebox[5mm][l]{\etocpage}\nobreak% \par}% {\endgroup}% % Set the style for subsection entries \etocsetstyle{subsection}% {\begingroup \parindent 40pt \parskip 0pt}% {\leftskip 0pt}% {\makebox[.5cm]{}% \hangindent=0.5cm \etoclink{\etocthename}\nobreak\hbox{\hbox to 1.5ex {\hss\hss}}\hfill\nobreak% \par}% {\endgroup}% \begin{filecontents}{\jobname.bib} @misc{ABC01, author = {Author, A. and Buthor, B. and C}, year = {2001}, title = {Alpha}, } \end{filecontents} \addbibresource{\jobname.bib} \begin{document} \tableofcontents \part{First Part} \localtableofcontents \chapter{Chapter 1} \section{Section 1} \section{Section 2} \cite{ABC01} \printbibliography[heading=bibintoc] \end{document} ```
https://tex.stackexchange.com/users/182643
How to remove Bibliography from local ToC?
true
This works: ``` \etocsetlocaltop.toc{part} \printbibliography[heading=bibintoc] ``` but ideally you should instruct `\printbibliography` to use a `part` style entry in the global table of contents, as I believe this should help etoc know where the local TOC of last part before bibliography ends. As it stands the bibliography entry in the global TOC is rendered as a chapter entery and thus gives impression it is part of Part. Screenshot of global TOC:
1
https://tex.stackexchange.com/users/293669
682308
316,578
https://tex.stackexchange.com/questions/682196
1
I made a macro using `xparse` for formatting the month with optional day and year. Except the appended optional argument doesn't work inside a description label for the description list---unless I enclose it in curly braces (e.g. `{\Month{4}[8]}`). This error is easily fixable via curly braces, but I would like to know WHY it occurs and perhaps also how to avoid having to fix it with curly braces. ``` \documentclass{article} \usepackage{stix2} \usepackage{etoolbox,xparse,xspace} %\numtomonth converts a number into its corresponding month. %The starred and unstarred versions display the long and short forms of the month. \makeatletter \NewDocumentCommand{\numtomonth}{ s m }{% \IfBooleanTF{#1}% {%ifstar \ifnumequal{#2}{1}{January}{% \ifnumequal{#2}{2}{February}{% \ifnumequal{#2}{3}{March}{% \ifnumequal{#2}{4}{April}{% \ifnumequal{#2}{5}{May}{% \ifnumequal{#2}{6}{June}{% \ifnumequal{#2}{7}{July}{% \ifnumequal{#2}{8}{August}{% \ifnumequal{#2}{9}{September}{% \ifnumequal{#2}{10}{October}{% \ifnumequal{#2}{11}{November}{% \ifnumequal{#2}{12}{December}{% \errmessage{The input must be an integer between 1 and 12}% }}}}}% }}}}}% }}% }% {%ifnostar %https://tex.stackexchange.com/questions/15009/macros-for-common-abbreviations \ifnumequal{#2}{1}{Jan\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{2}{Feb\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{3}{March}{% \ifnumequal{#2}{4}{April}{% \ifnumequal{#2}{5}{May}{% \ifnumequal{#2}{6}{June}{% \ifnumequal{#2}{7}{July}{% \ifnumequal{#2}{8}{Aug\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{9}{Sep\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{10}{Oct\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{11}{Nov\@ifnextchar{.}{}{.\@\xspace}}{% \ifnumequal{#2}{12}{Dec\@ifnextchar{.}{}{.\@\xspace}}{% \errmessage{The input must be an integer between 1 and 12}% }}}}}% }}}}}% }}% }% } \makeatother % %\Month has three arguments. %The first and third are optional. %The first is the year and the third is the day of the month. %The mandatory argument is the number corresponding to the month. %\Month displays the short form of the month and, if used, the day and the year. \NewDocumentCommand{\Month}{ O{} m O{} }{%\month already defined \numtomonth{#2}% \ifstrempty{#3}{}{~#3}% \ifstrempty{#1}{}{% \ifstrempty{#3}{ #1}{, #1}% }% } \usepackage{enumitem} \parindent=0pt \begin{document} I am trying to make a description list on \Month[2023]{4}[8].%random sentence \begin{description} \item[\Month{4}]%works; no appended optional argument Alpha \item%[\Month{4}[8]]%doesn't work with appended optional argument Beta \item[{\Month{4}[8]}]%works; same as above, but enclosed in curly braces Charlie \item%[\Month[2023]{4}[8]]%doesn't work with appended optional argument Delta \item[{\Month[2023]{4}[8]}]%works; same as above, but enclosed in curly braces Epsilon \end{description} \end{document} ```
https://tex.stackexchange.com/users/278534
Using Macro Inside Description List Label
false
> > This error is easily fixable via curly braces, **but I would like to know WHY it occurs** and perhaps also how to avoid having to fix it with curly braces. > > > `\item` is a classical LaTeX command. With classical LaTeX commands optional arguments are implemented as `]`-delimited macro arguments. If with such commands you nest optional arguments, then the first `]` will be taken for the matching delimiter of the outermost optional argument although it should be taken for the delimiter of the innermost optional argument and a subsequent `]` should be taken for the matching delimiter of the outermost optional argument. Delimiter-matching with delimited macro arguments is not the same as curly-brace-matching with undelimited macro arguments. (Unlike with classical commands, with non-classical commands defined in terms of xparse-facilities like `\NewDocumentCommand` some extra effort is done for keeping track of nested `[` and doing proper `]`-matching.) As you already mentioned in the question, if with traditional LaTeX commands it comes to nesting optional arguments, then the entire(!) content of outer optional arguments should be nested in curly braces for ensuring correct delimiter-matching. Curly braces "hide" `]`-delimiters of inner optional arguments from being taken for a matching delimiter of outer optional arguments. As surrounding the entire argument, the curly braces will be removed/stripped off in the process of gathering the tokens belonging to the argument and thus do no harm at all. `\item[{\Month{4}[8]}]`: Here the curly braces `{...}` ensure that the `]` of `\Month{4}[8]` is not taken for the matching `]`-delimiter of `\item`'s optional argument. As the curly braces surround the *entire* content of `\item`'s optional/`]`-delimited argument, they are discarded in the course of gathering the tokens that form `\item`'s optional argument so that only the tokens `\Month{4}[8]`, but not the surrounding curly braces, are gathered as `\item`'s optional argument. `\item[{\Month[2023]{4}[8]}]`: Here the curly braces `{...}` ensure that neither the `]` of `\Month[2023]` nor the `]` of `[8]` is taken for the matching `]`-delimiter of `\item`'s optional argument. As the curly braces surround the *entire* content of `\item`'s optional/`]`-delimited argument, they are discarded in the course of gathering the tokens that form `\item`'s optional argument so that only the tokens `\Month[2023]{4}[8]`, but not the surrounding braces, are gathered as `\item`'s optional argument. --- In my answer to [How does TeX look for delimited arguments?](https://tex.stackexchange.com/a/438600/118714) I tried to explain the differences between TeX's gathering of delimited arguments and TeX's gathering of undelimited arguments.
1
https://tex.stackexchange.com/users/118714
682309
316,579
https://tex.stackexchange.com/questions/682120
5
How can I add different kinds of thousand separators and rounding to different kinds of numbers in the same document? I want to set up that EURO amounts are displayed always rounded to two decimal points and with `.` as thousand separator and `,` as decimal point as this: `1.234,56 €` All other numbers should use a small space `\,` as thousand separator (and still `.` as decimal point) and not round at all like: `1 234,567 89 g` or `12 345,678 9 m` I tried with `siunitx` and `numprint` but both only were able to provide one setting for all numbers... and `numprint` also did not display the units correctly or in the font I selected. ``` \documentclass{scrlttr2} \usepackage[ngerman]{babel} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \usepackage[detect-all, locale=DE, separate-uncertainty]{siunitx} \sisetup{group-separator = {.}, group-minimum-digits = 4} \begin{document} \SI{1234.5678}{€} \SI{1234.56789}{g} \SI{12345.6789}{m} \end{document} ``` P.S.: Ideally I would be able to set the thousand separator dependent on the language selected by `\usepackage[ngerman]{babel}` or `\usepackage[english]{babel}`
https://tex.stackexchange.com/users/281557
How to enable different thousand separator and differend rounding for different kinds of numbers in the same document?
false
You can use a couple of placeholders redefined with the help the mechanisms provided by `babel`: ``` \documentclass{scrlttr2} \usepackage[ngerman]{babel} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \usepackage[detect-all, locale=DE, separate-uncertainty]{siunitx} \sisetup{ group-separator = {\thegroupmark}, output-decimal-marker = {\thedecimalmark}, group-minimum-digits = 4} % The default values \newcommand\thedecimalmark{,} \newcommand\thegroupmark{\,} % Reset at every language \AddBabelHook{decimal}{afterextras}{% \renewcommand\thedecimalmark{,}% \renewcommand\thegroupmark{\,}} % Set for a specific language (here english) \AddBabelHook[english]{decimal}{afterextras}{% \renewcommand\thedecimalmark{.}% \renewcommand\thegroupmark{,}} \begin{document} \SI{1234.5678}{€} \selectlanguage{english} \SI{1234.5678}{€} \selectlanguage{ngerman} \SI{1234.5678}{€} \end{document} ```
1
https://tex.stackexchange.com/users/5735
682312
316,580
https://tex.stackexchange.com/questions/682324
1
My table is very big, so I have to put it sideways in latex. this is my code ``` \documentclass{article} \usepackage{tikz} \usepackage{rotating} \begin{document} \begin{sidewaystable}[h] \centering \caption{Asset for each operation} \label{tab:changeOverCost} \begin{tabular}{c|ccccccccccccc} & Finger Gripper 1 & Finger Gripper 2 & Finger Gripper 3 & Finger Gripper 4 & Drilling end effector 1 & Drilling end effector 2 & Drilling end effector 3 & Drilling end effector 4 & V-STARS & Leica Metrology & Metrology & Marker 1 & Marker 2 & Marker 3\\ \hline Finger Gripper 1 & ? & & & & & & & & & & & & &\\ Finger Gripper 2 & ?& & & & & & & & & & & & &\\ Finger Gripper 3 & ? & & & & & & & & & & & & &\\ Finger Gripper 4 & ? & & & & & & & & & & & & &\\ Drilling end effector 1 & & ? & & & & & & & & & & & &\\ Drilling end effector 2 & & ? & & & & & & & & & & & &\\ Drilling end effector 3 & & ? & & & & & & & & & & & &\\ Drilling end effector 4 & & ? & & & & & & & & & & & &\\ V-Star & & & ? & & & & & & & & & & &\\ Leica Metrology & & & ? & & & & & & & & & & &\\ Marker 1 & & & & ? & & & & & & & & & &\\ Marker 2 & & & & ?& & & & & & & & & &\\ Marker 3 & & & & ?& & & & & & & & & &\\ \end{tabular} \end{sidewaystable} \end{document} ``` May I ask, how to make the column in the latex pdf match the size, in my current use case, the pdf can't show all the columns. Besides, any idea about how to make the table nicer?
https://tex.stackexchange.com/users/270498
Questions about the table sideways in Latex
false
My main suggestion is to provide some grouping in the header row and to omit repetitive material as much as possible. I further suggest you employ a `tabularx` environment and assign equal widths to the 14 data columns. ``` \documentclass{article} \usepackage[a4paper,margin=2.5cm]{geometry} % set page parameters as appropriate \usepackage{rotating,tabularx,ragged2e,booktabs} \newcolumntype{C}{>{\Centering\hspace{0pt}}X} \begin{document} \begin{sidewaystable} \setlength\tabcolsep{3pt} % default: 6pt \caption{Asset for each operation} \label{tab:changeOverCost} \medskip \begin{tabularx}{1\textwidth}{@{} r @{\quad} *{14}{C} } \toprule & \multicolumn{4}{c}{Finger Gripper} & \multicolumn{4}{c}{Drilling end effector} & V-Stars & \multicolumn{2}{c}{Metrology} & \multicolumn{3}{c@{}}{Marker}\\ \cmidrule(lr){2-5} \cmidrule(lr){6-9} \cmidrule(lr){11-12} \cmidrule(l){13-15} & 1 & 2 & 3 & 4 & 1 & 2 & 3 & 4 & & Leica & Other & 1 & 2 & 3 \\ \midrule Finger Gripper 1 & ?& & & & & & & & & & & & & \\ Finger Gripper 2 & ?& & & & & & & & & & & & & \\ Finger Gripper 3 & ?& & & & & & & & & & & & & \\ Finger Gripper 4 & ?& & & & & & & & & & & & & \\ \addlinespace Drilling end effector 1 & & & & & ?& & & & & & & & & \\ Drilling end effector 2 & & & & & ?& & & & & & & & & \\ Drilling end effector 3 & & & & & ?& & & & & & & & & \\ Drilling end effector 4 & & & & & ?& & & & & & & & & \\ \addlinespace V-Stars & & & & & & & & & ?& & & & & \\ Metrology-Leica & & & & & & & & & ?& & & & & \\ Metrology-Other & & & & & & & & & ?& & & & & \\ \addlinespace Marker 1 & & & & & & & & & & & & ?& & \\ Marker 2 & & & & & & & & & & & & ?& & \\ Marker 3 & & & & & & & & & & & & ?& & \\ \bottomrule \end{tabularx} \end{sidewaystable} \end{document} ```
1
https://tex.stackexchange.com/users/5001
682329
316,584
https://tex.stackexchange.com/questions/682328
0
In order of priority: 1. Online (I use Overleaf on a daily basis, Idk if it can help) (latex2png website seemed perfect at first but many packages are missing [e.g. I can't use the \mathscr{} command]) 2. On an Android smartphone (with buttons for every symbol, typing backslashes on a phone is hell on Earth) 3. Locally on my computers (which is the option I like the less because I have to be using one of my computers) After some research I found that the standalone documentclass was promising but so far I only managed to make it produce PDFs (or html files but is that even worth mentioning)... Last note: if there really is no way to do that, I could cope with a white background.
https://tex.stackexchange.com/users/167071
A practical way to create, copy and paste LaTeX-generated equations in png format with transparent background?
false
1. Create the equation you want using `standalone` document class This is an example ``` \documentclass{standalone} \usepackage{mathtools} \begin{document} $\begin{alignedat}{2} ax + by &= c \\ px + qy &= r \end{alignedat}$ \end{document} ``` 2. Import the `pdf` file to a graphic design software (e.g., CorelDesigner 2021.5), then export it as `png` 3. Verify you set high quality settings The result is thus an image of your equation with transparent background
1
https://tex.stackexchange.com/users/136098
682333
316,586
https://tex.stackexchange.com/questions/564758
14
I want to compile a tex document using xelatex in [LaTeX Workshop](https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop) extension in visual studio code. How can I change compiler from default one to xetex? I put my current setting.json file bellow. ``` { "latex-workshop.latex.tools": [ { "name": "latexmk", "command": "latexmk", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-pdf", "-outdir=%OUTDIR%", "%DOC%" ], "env": {} }, { "name": "lualatexmk", "command": "latexmk", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-lualatex", "-outdir=%OUTDIR%", "%DOC%" ], "env": {} }, { "name": "latexmk_rconly", "command": "latexmk", "args": [ "%DOC%" ], "env": {} }, { "name": "pdflatex", "command": "pdflatex", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "%DOC%" ], "env": {} }, { "name": "bibtex", "command": "bibtex", "args": [ "%DOCFILE%" ], "env": {} }, { "name": "rnw2tex", "command": "Rscript", "args": [ "-e", "knitr::opts_knit$set(concordance = TRUE); knitr::knit('%DOCFILE_EXT%')" ], "env": {} }, { "name": "jnw2tex", "command": "julia", "args": [ "-e", "using Weave; weave(\"%DOC_EXT%\", doctype=\"tex\")" ], "env": {} }, { "name": "jnw2texmintex", "command": "julia", "args": [ "-e", "using Weave; weave(\"%DOC_EXT%\", doctype=\"texminted\")" ], "env": {} } ] } ```
https://tex.stackexchange.com/users/225691
How to use visual studio code LaTex Workshop with xelatex
false
Here's the simplified version of @wolfrevo's answer. Setting the default recipe from the LaTeX VS Code extension is enough to set `xelatex`. There's no need to define `xelatex` from VS Code settings again since all the options exist. All we have to do is select the one we want to use. ``` "latex-workshop.latex.recipe.default": "latexmk (xelatex)", ```
2
https://tex.stackexchange.com/users/294071
682335
316,588
https://tex.stackexchange.com/questions/682336
1
I'm trying to insert a first page without header/footer. It works when I insert a TOC right after the first page, but not when I do this: ``` \documentclass{article} \usepackage{Preamble} \begin{document} % \mytitle{Title}{SubTitle}{SubSubTitle} \mytitle{name}{group-number}{version} \include{Introduction.tex} ``` The version which works: ``` \documentclass{article} \usepackage{Preamble} \begin{document} % \mytitle{Title}{SubTitle}{SubSubTitle} \mytitle{name}{group-number}{version} \tableofcontents \include{Introduction.tex} ``` using this command defined in the Preamble.sty ``` \makeatletter \newcommand\mytitle[3]{ \let\ps@plain\ps@empty \begingroup \newlength\drop \setlength\drop{0.08\textheight} \centering % \vspace*{\drop} \rule{\linewidth}{0.5mm} \\ \vspace*{20pt} {\huge\bfseries subTitle - #1 %Titel }\\[\baselineskip] {\scshape \Large #2} %Undertitel \\[\baselineskip] {\scshape #3} %Undertitel \\ \vspace*{10pt}{\scshape } \rule{\linewidth}{0.5mm} \\[\baselineskip] \vspace*{0.4\drop} \begin{figure}[H] \centering \includegraphics[width=0.6\textwidth]{logo.png} \end{figure}{} % \vfill \vspace*{0.4\drop} {\begin{table}[H] \centering \begin{tabular}{l r} Name & Study number \\\hline person & studyNumber \\\hline \end{tabular} \end{table}}\par \vfill {\scshape university \\ \today %Dato og sted \\ }\par \setcounter{page}{0} \endgroup} \makeatother ``` And I have tried using `\newpage` and `\clearpage`. Please help me find a solution in where I can have the front page with no page format (header/footer/page number) and still have content before the TOC
https://tex.stackexchange.com/users/258227
Problem with header/footer on first page when content is inserted before TOC
true
I figured it out. I added `\thispagestyle{empty}` at the beginning of the `\mytitle` command
1
https://tex.stackexchange.com/users/258227
682337
316,589
https://tex.stackexchange.com/questions/682330
0
I would like to highlight the each term of the sum **only** with `\alert` command, but with TeX Live 2023 is not working. Let's look the below code. ``` \documentclass{beamer} \usepackage{diffcoeff} \begin{document} \begin{frame} \alert{ \[ \dl\alpha+\dl\beta \] } % Do not work in TeX Live 2023 or later \[ \alert{\dl\alpha}+\alert{\dl\beta} \] \end{frame} \end{document} ``` This is the end of the log file. ``` ! Incompatible glue units. \reset@color ->\beamer@lastskip =\lastskip \edef \beamer@lastskiptexta {\the... l.13 \end{frame} ? ``` * beamer 2023/02/20 v3.69 * diffcoeff 2023/01/24 v5.2 * LuaHBTeX, Version 1.16.0 (`lualatex --version`) Thanks
https://tex.stackexchange.com/users/117967
Highlight with alert in math mode and diffcoeff (incompatibility with TeX Live 2023)
true
A workaround in the meantime is to add a second pair of braces when `\alert` is used inside math delimters. The following compiles on my (MiKTeX) system: ``` \documentclass{beamer} \usepackage{diffcoeff} \begin{document} \begin{frame} \alert{ \[ \dl\alpha+\dl\beta \] } % add a second pair of braces \[ \alert{{\dl\alpha}}+\alert{{\dl\beta}} \] \end{frame} \end{document} ```
2
https://tex.stackexchange.com/users/183147
682341
316,591
https://tex.stackexchange.com/questions/682343
0
I'm still new to LaTeX and I can't wrap my head around the foreach loop. I want to draw a grid and some semi-circles on some chosen points. Here's my minimal Non working example : ``` \documentclass[10pt, a4paper]{article} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture} \draw[very thick] (0,0) grid (10,8); \foreach \i in { (1,0.5), (5,0.5)} { \tkzDrawSemiCircle(\i, \i+(0,-0.5)) }; \end{tikzpicture} \end{document} ``` As I understand it, \i+(0,-0.5)) means the point situated 0.5 units below the point defined by \i at the moment. But when I try to run it, I get "Package pgf error : No shape named '(1,0.5)+(0,-0.5' is known. I suppose my syntax must be at fault but I can't find my mistake. I read tkz-euclide documentation and I wonder if I don't have to have already defined and named the points I want to use in \tkzDrawSemiCircle. In that case, how can I do ti using \foreach ? Any idea where I went wrong ? Thanks in advance !
https://tex.stackexchange.com/users/277899
Problem using \foreach loop
true
1. Coordinate calculations like `(1, 2) + (3, 4)` only work with the `calc` library and its `$` syntax. 2. The `\tkzDrawSemiCircle` (like all of the `\tkz…` commands) expect named coordinates in its arguments. You define them beforehand with `\tkzDefPoint` or `\tkzDefPoints`. 3. But `\tkzDefPoint` won't accept coordinate calculations at all. 4. TeX is greedy and doesn't match parentheses. In this case, the easiest approach seems to be to define the coordinates with plain TikZ and use `\tkzDrawSemiCircle` with them then. Since you use `\i` with `()` you will need to use ``` \expandafter\tkzDefPoint\i{origin} % or \path \i coordinate (origin); % or \coordinate[at=\i](origin); ``` since ``` \coordinate (origin) at \i; ``` won't work. The `calc` library doesn't like it either if one of the coordinates including the `()` is in a macro so `($\i+(0,-0.5)$)` doesn't work either but the argumentative ``` \coordinate (through) at ([shift=\i]0,-0.5); ``` does. The `shift` transformation is the same as addition. Then you can draw the semi circle with ``` \tkzDrawSemiCircle(origin,through) ``` Code ---- ``` \documentclass[tikz]{standalone} %\documentclass[10pt, a4paper]{article} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture} \draw[help lines] (0,0) grid (10,8); \foreach \i in {(1,0.5), (5,0.5)}{ % \expandafter\tkzDefPoint\i{origin} % \path \i coordinate (origin); \coordinate[at=\i](origin); \coordinate (through) at ([shift=\i] 0,-0.5); \tkzDrawSemiCircle(origin,through) } \end{tikzpicture} \end{document} ``` Output ------
3
https://tex.stackexchange.com/users/16595
682344
316,592
https://tex.stackexchange.com/questions/682328
0
In order of priority: 1. Online (I use Overleaf on a daily basis, Idk if it can help) (latex2png website seemed perfect at first but many packages are missing [e.g. I can't use the \mathscr{} command]) 2. On an Android smartphone (with buttons for every symbol, typing backslashes on a phone is hell on Earth) 3. Locally on my computers (which is the option I like the less because I have to be using one of my computers) After some research I found that the standalone documentclass was promising but so far I only managed to make it produce PDFs (or html files but is that even worth mentioning)... Last note: if there really is no way to do that, I could cope with a white background.
https://tex.stackexchange.com/users/167071
A practical way to create, copy and paste LaTeX-generated equations in png format with transparent background?
false
Here is one solution for TeXstudio editor 1. Install ImageMagick [https://imagemagick.org](https://imagemagick.org/) 2. In your LaTeX editor, define custom command to execute conversion of your file. Give this command the name `convertopng` The command is ``` magick.exe -density 2400 %.pdf -quality 100 %.png ``` 3. When you compile your file, request that ImageMagick convert it to `png` with your LaTeX editor 4. To get your LaTeX editor to compile and convert to `png` with one click, add another custom command. Give this command the name `pdftopng` The command is ``` txs:///pdflatex | txs:///convertopng | txs:///view-pdf ```
0
https://tex.stackexchange.com/users/136098
682348
316,594
https://tex.stackexchange.com/questions/682223
1
I am using the `glossaries` package in order to create a glossary. I want to change the **second** column (called "description") to appear in *italic*. I searched in the web but I can't find the syntax of the command. Trying to adapt [this answer](https://tex.stackexchange.com/a/13163) as ``` \renewcommand{\glsnamefont}[2]{\textit{#2}} ``` ... doesn't work. Neither can I find the name of the command (`\glsnamefont` should be the one for the name of the first entry) and `\glsdescriptionfont` or `\glslongfont` (just two attempts \*g) doesn't work.
https://tex.stackexchange.com/users/239690
Formatting the "Description" section in a glossary (glossaries package)
false
I found the solution after a hard day with google myself: I added the line: ``` \glssetcategoryattribute{general}{glossdescfont}{emph} ``` before the \printglossary - command. So the working code is: ``` % --------------------------------------------- % - Änderung des Headers und Erzeugen des Abkürzungsverzeichnisses % - Fomatierung des Eintrages in kursiv % --------------------------------------------- \renewcommand*\entryname{Abk.} % Änderung des Namens der 1. Spalte \renewcommand*\descriptionname{Bedeutung} % Änderung des Namens der 2. Spalte \renewcommand*\pagelistname{Seite\\} % Änderung des Namens der 3. Spalte \renewcommand*{\glsnamefont}[1]{\textbf{#1}} \glssetcategoryattribute{general}{glossdescfont}{emph} % Formatierung der Spalte 'Bedeutung' in kursiv in beiden Verzeichnissen. \printglossary[style=long3colheader, type=\acronymtype,title={Abkürzungen}] % Erstellen des Abkürzungsverzeichnisses 3 Spalten und Änderung des Titels. % --------------------------------------------- \newpage % \newpage just to demonstrate that links are correct % --------------------------------------------- % --------------------------------------------- % - Änderung des Headers und Erzeugen des Glossars % --------------------------------------------- \renewcommand*\entryname{Begriff} % Änderung des Namens der 1. Spalte \renewcommand*\descriptionname{Bedeutung} % Änderung des Namens der 2. Spalte \renewcommand*\pagelistname{Seite\\} % Änderung des Namens der 3. Spalte \renewcommand{\glsnamefont}[1]{\textbf{#1}} % Einträge der ersten Spalte werden fett \printglossary[style=long3colheader, type=main, title={Glossar}] % Erstellen des Glossars mit 3 Spalten und Änderung des Titels. % --------------------------------------------- ``` Thanks to all who tried to help me.
1
https://tex.stackexchange.com/users/239690
682356
316,597
https://tex.stackexchange.com/questions/682349
4
What's the makeindex style of the book "[TeXbyTopic](https://ctan.org/tex-archive/info/texbytopic)"? I use the default style `makeindex TeXbyTopic.idx` to produce the `ind` file and there are many "Input index error"s in the log file.
https://tex.stackexchange.com/users/241621
makeindex style of the book TeXbyTopic
true
### TL;DR; Replace ``` \def\cstoidx#1\par{\index{#1@\cs{#1}@}} ``` with ``` \def\cstoidx#1\par{\index{#1@\cs{#1}}} ``` ### Long answer The problem raises because of ``` \def\cstoidx#1\par{\index{#1@\cs{#1}@}} ``` that produces invalid entries in the `.idx` file. If I change the code into ``` \def\cstoidx#1\par{\index{#1@\cs{#1}}} ``` then the index is produced without errors. Here's the start of the index I obtain Let's compare it with the index that appears in the version of the book shipped with TeX Live, where all the control sequences are missing.
5
https://tex.stackexchange.com/users/4427
682364
316,601
https://tex.stackexchange.com/questions/682357
1
The following `longtblr` table code and myself have some differences of opinion. For instance, the font size, which I would like to be 10pt, but the output just puts "10pt" above the table and then goes on to do what it wants to. ``` \documentclass[a4paper]{article} \usepackage[top=2cm, bottom=3cm, left=3.5cm, right=3.5cm]{geometry} \usepackage{tabularray} \NewTblrTheme{mytable}{ %\SetTblrStyle{head}{bg=teal7} \SetTblrStyle{contfoot-text}{normal}{font=\footnotesize\itshape} \SetTblrStyle{caption-sep}{normal}{\enskip\(|\)\enskip} } \begin{document} \begin{longtblr}[ theme = mytable, caption = A very long table, font=10pt, ]{ colspec = {X[l,2cm] m{7cm} Q[c] Q[c]}, width = \linewidth, rowhead = 1, row{1} = {teal7}, } \hline[1.5pt] column 1 & column 2 & column 3 & column 4 \\ \hline row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows centred in two \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ \end{longtblr} \end{document} } ``` Any thoughts? --- Edited to reduce the errors in the example. However, it appears I have misunderstood the package documentation. To me, it appears as though the colours and font command are loaded with the package, while the first commenter has told me to fix those. Also, it appears as though it's not really `\linewidth`.
https://tex.stackexchange.com/users/269662
How to resize the font size in a longtblr (tabularray)?
false
I slightly streamlined and definitely cleaned your code from errors. If you are going to customise `longtblr`, you should read the [documentation](https://ctan.org/pkg/tabularray), mostly the part related to `longtblr`. It's not so easy to understand at first but makes sense once you have got the idea how themes and custom styles work. I didn't understand the problem with font size because `10pt` is the default one in regular documents. However, it's possible to set a specific font size for you table, even though document is set to let's say `12pt` (see example). Make sure you put table with `\fontsize` in a group, so it affects only the table. Here's a working code you can take from. I added a few paragraphs of dummy texts to compare the table with regular content. ``` \documentclass[a4paper,12pt]{article} \usepackage[top=2cm, bottom=3cm, left=3.5cm, right=3.5cm]{geometry} \usepackage{xcolor} \usepackage{tabularray} \usepackage{kantlipsum} \NewTblrTheme{mytable}{ \SetTblrStyle{firstfoot,middlefoot}{\footnotesize\itshape} \DefTblrTemplate{caption-sep}{default}{\enskip\(|\)\enskip} } \begin{document} \kant[1-2] \begingroup \fontsize{10pt}{12pt}\selectfont \begin{longtblr}[ theme = mytable, caption = {A very long table}, ]{ colspec = {X[l] Q[7cm,m] Q[c] Q[c]}, width = \linewidth, row{1} = {teal7}, hline{1,Z} = {wd=1.5pt}, hline{2} = {}, cell{even[2-Z]}{4} = {r=2}{}, rowhead = 1, } column 1 & column 2 & column 3 & column 4 \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & less showboating, maybe even no showboating & row & \\ \end{longtblr} \endgroup \kant[2] \end{document} ```
4
https://tex.stackexchange.com/users/31283
682365
316,602
https://tex.stackexchange.com/questions/50827
126
### Progress Report Four months on, I thought it a good idea to "report back" here, and I wrote something. Then, I had better thoughts and turned it into a blog post. You can read it [on the TeX.sx blog](http://tex.blogoverflow.com/2012/08/tex-and-gnu-emacs-a-simpletons-journey/). --- Prompted by a recent conversation in the chat room, I am thinking of revisiting **emacs** as my source editor. In order to give it a good chance (I have failed with four or five previous attempts over the past ten years or so), I'd like to ask for useful tips, or pointers to larger works, to make this transition from TeXWorks as smooth as possible. Key features of my *modus operandi* are: * heavy use of `memoir`, `beamer`, and `tikz` * structured documents with `\input` and `standalone` * lualatex (with occasional ventures needed into xelatex or pdflatex), driven by latexmk * `biblatex` (using bibtex rather than biber, but only through inertia) * unicode, with no exceptions * Windows 7 * Ouside TeXWorks, general-purpose PDF viewer: PDF XChange Among the questions and uncertainties I should like to see addressed (some of which, I accept, may not be directly on-topic -- links may be more suitable in these cases) are these: * Initial setup of emacs, including (...)TeX-workflow-specific add-ons * Compilation and preview direct from the emacs environment * Synchronisation of source and preview * Auto-completion * Spelling (EN-GB, PT-BR, ES, and FR) * Any other hints, bear-traps, and so forth * A good tutorial
https://tex.stackexchange.com/users/344
A simpleton's guide to (...)TeX workflow with emacs
false
There are lots of great answers here already. One issue I've always faced is with the insertion of graphics objects on slides. I use tikz (with overlay) for this but getting the coordinates right in the first attempt is always an issue and I end up wasting too much time doing the write-compile-check iterations. I've written a new package called `cart.el` that makes this more streamlined by allowing the user to click on the frame for the insertion of appropriate coordinates. I'm hosting it on [github here](https://github.com/Nidish96/cart.el) - do check it out! Here's a slide fully created using this package on emacs within a matter of minutes, for example: I'm posting this here because this has become a major part of my workflow on preparing presentations on emacs.
1
https://tex.stackexchange.com/users/109699
682370
316,605
https://tex.stackexchange.com/questions/682357
1
The following `longtblr` table code and myself have some differences of opinion. For instance, the font size, which I would like to be 10pt, but the output just puts "10pt" above the table and then goes on to do what it wants to. ``` \documentclass[a4paper]{article} \usepackage[top=2cm, bottom=3cm, left=3.5cm, right=3.5cm]{geometry} \usepackage{tabularray} \NewTblrTheme{mytable}{ %\SetTblrStyle{head}{bg=teal7} \SetTblrStyle{contfoot-text}{normal}{font=\footnotesize\itshape} \SetTblrStyle{caption-sep}{normal}{\enskip\(|\)\enskip} } \begin{document} \begin{longtblr}[ theme = mytable, caption = A very long table, font=10pt, ]{ colspec = {X[l,2cm] m{7cm} Q[c] Q[c]}, width = \linewidth, rowhead = 1, row{1} = {teal7}, } \hline[1.5pt] column 1 & column 2 & column 3 & column 4 \\ \hline row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows centred in two \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ row & some relatively long description so that the other entries can showboat their floatiness & row & \SetCell[r=2]{c} rows \\ row & less showboating, maybe even no showboating & row & \\ \end{longtblr} \end{document} } ``` Any thoughts? --- Edited to reduce the errors in the example. However, it appears I have misunderstood the package documentation. To me, it appears as though the colours and font command are loaded with the package, while the first commenter has told me to fix those. Also, it appears as though it's not really `\linewidth`.
https://tex.stackexchange.com/users/269662
How to resize the font size in a longtblr (tabularray)?
true
Considered @Miyase an @CarLaTeX comments: ``` \documentclass[a4paper,12pt]{article} \usepackage[hmargin= 3.5cm, vmargin={2cm, 3cm}]{geometry} \usepackage{xcolor} \usepackage{tabularray} \UseTblrLibrary{booktabs} \usepackage{kantlipsum} \NewTblrTheme{mytable}{ \SetTblrStyle{firstfoot,middlefoot}{\footnotesize\itshape} \DefTblrTemplate{caption-sep}{default}{\enskip\(|\)\enskip} } \begin{document} \kant[1-3] \begin{longtblr}[ theme = mytable, caption = {A very long table}, label = {tab:long...} ]{colspec = {l X[j, m] c c}, cells = {font = \fontsize{10pt}{12pt}\selectfont}, row{1} = {teal9}, rowhead = 1, } \toprule column 1 & column 2 & column 3 & column 4 \\ \midrule row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ row & some relatively long description so that the other entries can showboat their floatiness & row & rows \\ \bottomrule \end{longtblr} \kant[4] \end{document} ```
4
https://tex.stackexchange.com/users/18189
682375
316,607
https://tex.stackexchange.com/questions/682378
2
I want to position the author of the quote on the right hand side of the quote. Why does `\raggedleft` not work? ``` \documentclass{scrlttr2} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \NewDocumentEnvironment{textquote}{ O{}+b} {\begin{samepage}\begin{addmargin}{2.5cm}\guillemotright#2\guillemotleft\end{addmargin}\end{samepage}} {\footnotesize \raggedleft \textbf{#1}} \begin{document} \begin{textquote}[René Descartes] [...] I think therefore I am. \end{textquote} \end{document} ```
https://tex.stackexchange.com/users/281557
Why does `\raggedleft` not work?
true
If you test your environment with `\end{textquote}test` you will see that the name gets typeset in the same paragraph as the text after your environment. Once this paragraph ends, you are no longer in `\raggedleft` mode. To avoid this, you should finish the paragraph at the end of your environment: ``` \documentclass{scrlttr2} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \NewDocumentEnvironment{textquote}{ O{}+b} {\begin{samepage}\begin{addmargin}{2.5cm}\guillemotright#2\guillemotleft\end{addmargin}\end{samepage}} {\footnotesize \raggedleft \textbf{#1}\par} \begin{document} \begin{textquote}[René Descartes] [...] I think therefore I am. \end{textquote} \end{document} ```
2
https://tex.stackexchange.com/users/36296
682380
316,609
https://tex.stackexchange.com/questions/682378
2
I want to position the author of the quote on the right hand side of the quote. Why does `\raggedleft` not work? ``` \documentclass{scrlttr2} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \NewDocumentEnvironment{textquote}{ O{}+b} {\begin{samepage}\begin{addmargin}{2.5cm}\guillemotright#2\guillemotleft\end{addmargin}\end{samepage}} {\footnotesize \raggedleft \textbf{#1}} \begin{document} \begin{textquote}[René Descartes] [...] I think therefore I am. \end{textquote} \end{document} ```
https://tex.stackexchange.com/users/281557
Why does `\raggedleft` not work?
false
Sorry, but there are several errors in your code. 1. The argument to `textquote` is mandatory, not optional. 2. There is no vertical space around the quote. 3. There is a feasible page break point between the quote and the attribution. 4. You miss a `\par` at the end so that `\raggedleft` can do its work (but `\raggedleft` is not the right tool). Fixed code. ``` \documentclass{scrlttr2} %\usepackage[utf8]{inputenc}% no longer needed \usepackage[T1]{fontenc} %\usepackage[scaled]{helvet} \usepackage{sourcesanspro}% not Helvetica, please \renewcommand\familydefault{\sfdefault} \usepackage{lipsum} % for filler text \NewDocumentEnvironment{textquote}{m +b}{% \par\addvspace{\topsep} \begin{samepage}\begin{addmargin}{2.5cm} \guillemotright#2\guillemotleft \end{addmargin}\par\nopagebreak {\footnotesize\hspace*{\fill}\textbf{#1}\par} \end{samepage}% \par\addvspace{\topsep} }{} \begin{document} \lipsum[1][1-4] \begin{textquote}{René Descartes} [\dots] I think therefore I am. \end{textquote} \lipsum[2][1-4] \begin{textquote}{Somebody Else} \lipsum[3][1-4] \end{textquote} \lipsum[4][1-4] \end{document} ``` The image below shows why you shouldn't use Helvetica for longer texts. Other sans serif fonts can (and should) be used.
3
https://tex.stackexchange.com/users/4427
682387
316,612
https://tex.stackexchange.com/questions/682388
0
I try to generate a `\law` command that behaves differently depending on the settings. `\setlaw` changes the behaviour differently. It seems to work for the first two cases. However, when trying to put brackets around the argument it stops working (for the min-case): ``` \documentclass[parskip=full]{scrlttr2} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \usepackage{ifthen} \newcommand{\Absatz}[1]{Absatz\,#1} \newcommand{\Satz}[1]{Satz\,#1} \newcommand{\setlaw}[1] {\ifthenelse{\equal{\detokenize{#1}}{\detokenize{long}}} {\renewcommand{\Absatz}[1]{Absatz\,\csname#1\endcsname} \renewcommand{\Satz}[1]{Satz\,\csname#1\endcsname} } {\ifthenelse{\equal{\detokenize{#1}}{\detokenize{short}}} {\renewcommand{\Absatz}[1]{Abs.\,\csname#1\endcsname} \renewcommand{\Satz}[1]{S.\,\csname#1\endcsname} } {\ifthenelse{\equal{\detokenize{#1}}{\detokenize{min}}} {\renewcommand{\Absatz}[1]{(\csname#1\endcsname)} \renewcommand{\Satz}[1]{\csname#1\endcsname} } {} } } } \newcommand{\law}[4][BGB]{\S\,#2 \Absatz{#3} \Satz{#4} #1} \begin{document} \law{123}{4}{2} \setlaw{short} \law{123}{4}{2} \setlaw{min} \law{123}{4}{2} \end{document} ``` The result should be: § 123 Absatz 4 Satz 2 BGB § 123 Abs. 4 S. 2 BGB § 123 (4) 2 BGB
https://tex.stackexchange.com/users/281557
Redefining a command with arguments inside another comand sometimes does not work
true
1. `\csname#1\endcsname` should be `\csname##1\endcsname`. 2. `\csname...\endcsname` is completely wrong, as you want to print the law numbers, not use (undefined) commands based on them. Here's a much simpler approach. ``` \documentclass[parskip=full]{scrlttr2} %\usepackage[scaled]{helvet} \usepackage{sourcesanspro} \renewcommand\familydefault{\sfdefault} \ExplSyntaxOn \str_new:N \l_mrc_law_satz_str \NewDocumentCommand{\setlaw}{m} { \str_set:Nn \l_mrc_law_satz_str { #1 } } \NewDocumentCommand{\Absatz}{} { \str_case:Vn \l_mrc_law_satz_str { {long}{Absatz} {short}{Abs.\@} {min}{} } } \NewDocumentCommand{\Satz}{} { \str_case:Vn \l_mrc_law_satz_str { {long}{Satz} {short}{S.\@} {min}{} } } \ExplSyntaxOff \newcommand{\law}[4][BGB]{\S\,#2 \Absatz\,#3 \Satz\,#4 #1} \setlaw{long} % initialize \begin{document} Long: \law{123}{4}{2} \setlaw{short} Short: \law{123}{4}{2} \setlaw{min} Min: \law{123}{4}{2} \end{document} ```
1
https://tex.stackexchange.com/users/4427
682393
316,615
https://tex.stackexchange.com/questions/682395
2
I am using `pos` to align nodes along a path. This works great, even with special segments like `-|`. But I came across an issue when using `cycle`. It seems for `cycle` `pos` does not work at all. That would be fine for me, but I do not even receive an error. So maybe I am doing something wrong or not looking at it the right way? ``` \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \draw (0,0) -| ++(2,2) -| ++(-2,-2) node[pos=0.5]{O}; \draw (3,0) -| ++(2,2) -| cycle node[pos=0.5]{X}; \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/156791
Why does pos behave different with cycle then with other path segments?
true
How to solve it --------------- There are two ways of placing a node on a line: [explicitly](https://tikz.dev/tikz-shapes#sec-17.8), as you did in your code, or [implicitly](https://tikz.dev/tikz-shapes#sec-17.9), as I do in the following code. When using the implicit approach, you can omit `pos=0.5`, as it is the default. It is still possible to set any other `pos=x` there. With the implicit approach, it works as expected. (*Note:* For horizontal/vertical line-to operations `|-` and `-|` the position `0.5` is exactly the corner point, as you can see with `\draw (3,0) -| ++(2,1) -| node{X} cycle;`) ### Code ``` \documentclass[tikz, margin=3mm]{standalone} \begin{document} \begin{tikzpicture} \draw (0,0) -| ++(2,2) -| node{O} ++(-2,-2); %\draw (3,0) -| ++(2,2) -| node[pos=0.5]{X} cycle; \draw (3,0) -| ++(2,2) -| node{X} cycle; \end{tikzpicture} \end{document} ``` ### Result Approach of the *why* --------------------- The problem does not arise when using `-- cycle node[midway]{foo}`. It seems that `cycle` is defined correctly only for the connection `--`. In the [tikz code](https://github.com/pgf-tikz/pgf/blob/master/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex#L2941) there is a comment: ``` % Syntax for cycle: % -- cycle ``` So the problem seems to be, that the combination of `pos` and `cycle` is not defined for other connections than `--`.
3
https://tex.stackexchange.com/users/123129
682398
316,618
https://tex.stackexchange.com/questions/682383
4
I have the following latex file: ``` \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{longtable} \begin{document} \begin{longtable}{|ll|} %\toprule converter & version \\ %\midrule %\midrule \endfirsthead% %\bottomrule \caption{Converters and the version this document refers to }%\label{tab:versions} \endlastfoot% \texttt{pdflatex} & \texttt{pdfTeX 3.141592653-2.6-1.40.24} \\% chktex 8 \texttt{xelatex} & \texttt{XeTeX 3.141592653-2.6-0.999994} \\% chktex 8 \texttt{lualatex} & \texttt{LuaHBTeX, Version 1.15.0} \\ \end{longtable} \end{document} ``` With the catption i gen an error on `htlatex test`: ``` ! Missing } inserted. <inserted text> } l.190 ...and the version this document refers to } %\label{tab:versions} ? ! Emergency stop. <inserted text> } l.190 ...and the version this document refers to } %\label{tab:versions} No pages of output. Transcript written on test.log. ``` If I comment out the caption, the problem disappears and the output `text.html` looks good. Maybe I shall mention that in the log also occurs: ``` (/usr/share/texmf/tex/generic/tex4ht/tex4ht.sty l.864 --- TeX4ht warning --- nonprimitive \everypar --- --- needs --- tex4ht test --- ``` This test file is extracted from a bigger one and I could bet that this worked in earler releases... I use texlive. I have the impression, that some config is wrong just. Who can help??
https://tex.stackexchange.com/users/60463
htlatex: problem with caption in longtable
true
Try this version of `longtable.4ht`: ``` % longtable.4ht (2022-04-28-13:47), generated from tex4ht-4ht.tex % Copyright 1997-2009 Eitan M. Gurari % Copyright 2009-2022 TeX Users Group % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either % version 1.3c of this license or (at your option) any % later version. The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.3c or later is part of all distributions % of LaTeX version 2005/12/01 or later. % % This work has the LPPL maintenance status "maintained". % % The Current Maintainer of this work % is the TeX4ht Project <http://tug.org/tex4ht>. % % If you modify this program, changing the % version identification would be appreciated. \immediate\write-1{version 2022-04-28-13:47} \def\:tempc[#1]#2{% \gHAdvance\float:cnt 1 \gHAssign\capt:cnt0 \hbox{\def\flt:anchor{}\get:cptg}% % \def\Clr{#2}\a:VBorder \HAssign\ar:cnt0 \let\HAlign\empty % \def\aa:longtable{% \gdef\aa:longtable{\let\HRow\lt:sv \HAdvance\HRow by 1 \global\let\:MkHalign:\lt:MkHalign:}% \global\setbox\LT:box\vbox{\a:longtable}% \global\let\lt:MkHalign:\:MkHalign:}% \def\bb:longtable{% \ifHCond \global\let\bb:longtable\empty \global\setbox\LT:ebox=\vbox{{\ht:everypar{}\leavevmode}\b:longtable}% \global\HCondfalse \fi} % \refstepcounter{table}\stepcounter{LT@tables}% \if l#1% \LTleft\z@ \LTright\fill \else\if r#1% \LTleft\fill \LTright\z@ \else\if c#1% \LTleft\fill \LTright\fill \fi\fi\fi \let\LT@mcol\multicolumn \let\LT@@tabarray\@tabarray \let\LT@@hl\hline \def\@tabarray{% \let\hline\LT@@hl \LT@@tabarray}% \let\\\LT@tabularcr\let\tabularnewline\\% \let\newpage\empty \let\pagebreak\empty \let\nopagebreak\empty % \let\hline\LT@hline \let\kill\LT@kill\let\caption\LT@caption \@tempdima\ht\strutbox \let\@endpbox\LT@endpbox \ifx\extrarowheight\@undefined \let\@acol\@tabacol \let\@classz\@tabclassz \let\@classiv\@tabclassiv \def\@startpbox{\vtop\LT@startpbox}% \let\@@startpbox\@startpbox \let\@@endpbox\@endpbox \let\LT@LL@FM@cr\@tabularcr \else \advance\@tempdima\extrarowheight \col@sep\tabcolsep \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr \fi \setbox\@arstrutbox\hbox{}% \let\@sharp##\let\protect\relax \begingroup \@mkpream{#2}% \xdef\LT@bchunk{% \global\advance\c@LT@chunks\@ne \global\LT@rows\z@\setbox\z@\vbox\bgroup \LT@setprevdepth \everycr{}\tabskip\LTleft\noexpand\MkHalign\noexpand\@sharp {\tabskip\z@ \@arstrut \@preamble \tabskip\LTright}% }% \tmp:cnt=0 \global\let\:tempa\empty \loop\ifnum \ar:cnt>\tmp:cnt \advance\tmp:cnt by 1 \expandafter\ifx \csname @testpach \the\tmp:cnt\endcsname\relax \else \xdef\:tempa{% \:tempa \def \expandafter\noexpand \csname @testpach \the\tmp:cnt\endcsname{\csname @testpach \the\tmp:cnt\endcsname}}% \expandafter\let\csname @testpach \the\tmp:cnt\endcsname\relax \fi \repeat \aftergroup\:tempa \xdef\:temp{% \def\noexpand\HAlign{\HAlign}% \def\noexpand\ar:cnt{\ar:cnt}}\aftergroup\:temp % \endgroup \LT@cols\ar:cnt % \LT@make@row \m@th\let\par\@empty \everycr{}\lineskip\z@\baselineskip\z@ \ifx \EndPicture\:UnDef \SaveMkHalignConfig \ifx \recall:ar\:UnDef \edef\recall:ar{% \noexpand\ifx \noexpand\EndPicture\noexpand\:UnDef \noexpand\else \arrayrulewidth\the\arrayrulewidth \doublerulesep\the\doublerulesep \arraycolsep\the\arraycolsep \tabcolsep\the\tabcolsep \noexpand\fi }% \fi \arrayrulewidth\z@ \doublerulesep\z@ \arraycolsep\z@ \tabcolsep\z@ \Configure{MkHalign} \aa:longtable {\bb:longtable \ProperTrTrue} {\a:putHBorder\InitHBorder \ifProperTr{\c:longtable}} {\ifProperTr{\d:longtable}\a:putHBorder\InitHBorder}% {\ifProperTr{\e:longtable}\RecallMkHalignConfig\recall:ar} {\ifProperTr{\f:longtable}} % \let\@sharp\relax \else \let\@sharp##\fi \LT@bchunk} \HLet\LT@array\:tempc \def\:tempc{% \crcr\LT@save@row\cr \ifx \EndPicture\:UnDef \EndMkHalign\else \egroup\fi % \global\setbox\@ne\lastbox \unskip \egroup} \HLet\LT@echunk\:tempc \let\:tempc\LT@startpbox \append:defI\:tempc{\everypar{\HtmlPar}\a:longtableparbox}% \HLet\LT@startpbox\:tempc \NewConfigure{longtableparbox}{1} \NewConfigure{longtable}{6} \csname newbox\endcsname\LT:box \csname newbox\endcsname\LT:ebox \def\:tempc{% \ifvoid\LT@head\else \ifvoid\LT@firsthead \global\setbox\LT@firsthead=\hbox{\box\LT@head}% \else \global\setbox\tmp:bx=\hbox{\box\LT@head}% \fi\fi% \box\LT:box% \ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi\nobreak \output{\LT@output} } \HLet\LT@start\:tempc \let\:tempc\endlongtable \append:def\:tempc{\box\LT:ebox} \pend:def\:tempc{\global\HCondtrue} \HLet\endlongtable\:tempc \let\:tempc\LT@ntabularcr \pend:def\:tempc{\global\let\lt:sv\HRow} \HLet\LT@ntabularcr\:tempc \let\:tempc\LT@end@hd@ft \pend:defI\:tempc{\global\let\lt:sv\HRow} \HLet\LT@end@hd@ft\:tempc %\def\:tempc{\global\let\lt:sv\HRow} %\HLet\LT@kill\:tempc \def\LT@rebox#1\bgroup{% #1\bgroup \unskip } \let\:tempc\LT@kill \pend:def\:tempc{\global\let\lt:sv\HRow} \HLet\LT@kill\:tempc \let\LT:argtabularcr\LT@argtabularcr \def\:tempc{\global\let\lt:sv\HRow \LT:argtabularcr} \HLet\LT@argtabularcr\:tempc \ifx \tmp:bx\:UnDef \csname newbox\endcsname \tmp:bx \fi %\def\:tempc{\LT@end@hd@ft\tmp:bx} %\HLet\endhead\:tempc % \def\:tempc{\LT@end@hd@ft\tmp:bx} % \HLet\endfoot\:tempc \pend:def\LT@output{% \ifvoid\LT@foot\else \ifvoid\LT@lastfoot \global\setbox\LT@lastfoot=\hbox{\box\LT@foot}% \else \global\setbox\tmp:bx=\hbox{\box\LT@foot}% \fi\fi } \def\:tempc{\global\HCondtrue \LT@end@hd@ft\LT@lastfoot} \HLet\endlastfoot\:tempc \def\LT@tabularcr{% \relax\iffalse{\fi\ifnum0=`}\fi \@ifstar {\LT@t@bularcr}% {\LT@t@bularcr}} \def\:tempc{% \o:noalign:{\ifnum0=`}\fi \penalty\@M \futurelet\@let@token\LT@@hline} \HLet\LT@hline\:tempc \def\:tempc{% \ifx\@let@token\hline \global\let\@gtempa\@gobble \gdef\LT@sep{\penalty-\@medpenalty\vskip\doublerulesep}% \else \global\let\@gtempa\@empty \gdef\LT@sep{\penalty-\@lowpenalty\vskip-\arrayrulewidth}% \fi \ifnum0=`{\fi}% \a:hline % \o:noalign:{\penalty\@M}% \@gtempa} \HLet\LT@@hline\:tempc \def\:tempc{% \o:noalign:\bgroup \gHAdvance\TitleCount 1 \@ifnextchar[{\egroup\LT@c@ption\@firstofone}\LT@capti@n} \HLet\LT@caption\:tempc \NewConfigure{longtablecaption}{4} \def\:tempc#1#2#3{% \a:longtablecaption #1{\cap:ref{#2}}\if\relax\detokenize{#1}\relax\else\b:longtablecaption\fi\c:longtablecaption#3\d:longtablecaption %\endgraf\vskip\baselineskip } \HLet\LT@makecaption\:tempc \def\:tempc#1[#2]#3{% \LT@makecaption#1\fnum@table{#3}% \cur:lbl{}% \def\@tempa{#2}% \ifx\@tempa\@empty\else% {\let\\\space% \protect:wrtoc% \edef\:temp{#2}% \edef\:temp{\the\:tokwrite{\string\doTocEntry% \string\toclot% {\thetable}{\string\csname\space a:TocLink\string\endcsname% {\FileNumber}{\cur:th \:currentlabel}{}{\ifx\:temp\empty\else \ignorespaces #2\fi}}% {}\relax}}\:temp% }% \fi% } \HLet\LT@c@ption\:tempc \Hinput{longtable} \endinput ``` It compiles your document without errors:
3
https://tex.stackexchange.com/users/2891
682399
316,619
https://tex.stackexchange.com/questions/682318
0
My major issue is that I can't figure out how to put a block quotation into a "thanks" footnote in amsart. Ideally, I want the effect that this source specifies: ``` \documentclass{amsart} \usepackage{hyperref} \usepackage[lite]{amsrefs} \usepackage{amsmath,amssymb,latexsym} \begin{document} \title{Lorem ipsum dolor sit amet} \author{John Doe\footnote{Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\footnote{Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \begin{quote} Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \end{quote}}}} \date{\today} \maketitle \section{Introduction} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \end{document} ``` Specifically, there is a "thanks" footnote that is a numbered footnote attached to the author's name. That footnote itself has a footnote attached to it. The sub-footnote contains a block quotation. The most important aspect of this is the block quotation within the sub-footnote. If I must, I'm willing to combine the two footnotes into one footnote, and I am also willing to have the footnote be un-numbered, in the default manner of the AMS-LaTeX \thanks macro. No variant of this that I've tried works correctly. Most of them produce one of these error messages: ``` ! Improper \spacefactor. ! Class amsart Error: \thanks should be given separately, not inside author nam ! Use of \@xfootnote doesn't match its definition. ! Use of \@xfootnotemark doesn't match its definition. ```
https://tex.stackexchange.com/users/285657
Trouble putting a block quotation into a "thanks" footnote in amsart
true
A tolerable solution is the following source. It does not solve the issues I have with "thanks" being unnumbered, or having footnotes to footnotes (at least, before the body of the document). But it does deal with the block quotation in the thanks. The core problem seems to be that the processing of the "thanks" argument is immediately followed by some sort of tweaking of the horizontal spacing which uses \spacefactor. However, \spacefactor can only be accessed in horizontal modes, and since the argument ends with a "quote" environment, TeX processing is in vertical mode at the time. Normally the argument ends in text, which ensures TeX is in horizontal mode at the time. I have no suitable text to insert at that point, but I can add "\hskip 0pt" as a no-op that gets TeX into horizontal mode. It's possible that this fix inserts an empty line, but that would not show in the examples I have tried. ``` \documentclass{amsart} \usepackage{hyperref} \usepackage[lite]{amsrefs} \usepackage{amsmath,amssymb,latexsym} \begin{document} \title{Lorem ipsum dolor sit amet} \author{John Doe} \thanks{Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \begin{quote} Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \end{quote} \hskip 0pt } \date{\today} \maketitle \section{Introduction} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \end{document} ```
0
https://tex.stackexchange.com/users/285657
682420
316,629
https://tex.stackexchange.com/questions/682416
8
I want a `U`, with the symbols `$\mathfrak{i}$` and `$\mathfrak{r}$` stacked up on each other between the parallel vertical lines. They should not protrude higher than the height of the `U`. It is for a mathematical text, to denote a universe which is *regular* and *invariant*; so there are no conditions upon `U` besides that `$\mathfrak{i}$` and `$\mathfrak{r}$` should be legible.
https://tex.stackexchange.com/users/24406
U with $\mathfrak{i}$ and $\mathfrak{r}$?
true
(edited to add a second possibility) Here are two possible solutions; one uses `\mathbf{U}`, the other `\mathsf{U}`. I've tested them with Computer Modern math fonts and Euler fraktur fonts only, and exclusively in `\textstyle`. These symbols will never occur in first- or second-level subscripts, right? ``` \documentclass{article} \usepackage[frak=euler]{mathalpha} \newcommand\Uira{\ooalign{$\mathbf{U}$\cr% \hfil\kern0.8pt\raise0.82ex\hbox{$\scriptscriptstyle\mathfrak{i}$}\hfil\cr% \hfil\kern0.8pt\raise0.18ex\hbox{$\scriptscriptstyle\mathfrak{r}$}\hfil\cr}} \newcommand\Uirb{\ooalign{$\mathsf{U}$\cr% \hfil\raise0.82ex\hbox{$\scriptscriptstyle\mathfrak{i}$}\hfil\cr% \hfil\raise0.19ex\hbox{$\scriptscriptstyle\mathfrak{r}$}\hfil\cr}} \begin{document} The symbols $\Uira$ and $\Uirb$ denote... \end{document} ```
15
https://tex.stackexchange.com/users/5001
682421
316,630
https://tex.stackexchange.com/questions/681981
0
For 3 or more authors, I want to list the first et al. in the text. If I use `\usepackage[natbibapa]{apacite}` and `\citet` in the text, all works fine, but APA gives me all 4 authors. If I use `\usepackage{apacite}` and `\shortciteA` in the text, I get ? (?) in the text and acronyms stop working. But the reference appears in the list of references. I followed this post: [How to change the apacite bibliography style to list all authors](https://tex.stackexchange.com/questions/136409/how-to-change-the-apacite-bibliography-style-to-list-all-authors) And similarly tried to change the apacite.bst file to list 1st author if 3 or more authors are listed (instead of 6 as currently is set up), but without success. Anyone knows how to do it? I also tried to use `\shortcites{key}\citet{key}` which is specified in the apacite manual (section 4.2 Using natbib for citations) but nothing changed. I don't seem to be able to use apacite for citations such as `\shortcite`. I don't even understand the errors I get when I use `\shortcite`, but Contents / Acronyms stop working. My LaTex code: ``` \documentclass[12pt, a4paper, twoside]{report} \usepackage{graphicx} \usepackage{blindtext} \usepackage[margin=2cm] {geometry} \usepackage{setspace} \setstretch{1.5} \usepackage[natbibapa]{apacite} \usepackage{hyperref} \hypersetup{colorlinks=false, pdfborder={0 0 0}} \newcommand{\doi}[1]{\textsc{} \href{https://doi.org/#1}{\nolinkurl{https://doi.org/#1}}} \renewcommand{\doiprefix}{} %\newcommand{\apamaxcitenames}{2} \AtBeginDocument{\renewcommand{\BBAA}{and}} \usepackage{acronym} \usepackage[figuresright]{rotating} \usepackage{comment} \usepackage{url} \usepackage{tikz} \usetikzlibrary{arrows} \usepackage{tcolorbox} \usepackage{ragged2e} \usepackage{enumitem} \usepackage{pdflscape} \usepackage{xltabular} \newcolumntype{L}{>{\RaggedRight\hangafter1\hangindent1em}X} \usepackage{booktabs} \newlength\mylen \setlength\mylen{\textheight} \usepackage[labelfont=bf]{caption} \setcounter{tocdepth}{4} \setcounter{secnumdepth}{5} \begin{document} I want to cite this \citep{kringosEuropeStrongPrimary2013} \bibliographystyle{apacite} \bibliography{myreferences} \end{document} ``` myreferences.bib ``` @article{kringosEuropeStrongPrimary2013, title = {Europe's {{Strong Primary Care Systems Are Linked To Better Population Health But Also To Higher Health Spending}}}, author = {Kringos, Dionne S. and Boerma, Wienke and {van der Zee}, Jouke and Groenewegen, Peter}, year = {2013}, journal = {Health Affairs}, volume = {32}, number = {4}, pages = {686--694}, issn = {0278-2715, 1544-5208}, doi = {10.1377/hlthaff.2012.1242}, urldate = {2023-03-26}, langid = {english} } ``` **Edit:** (function in apacite.bst related to this) ``` FUNCTION {tentative.cite.num.names.field} { 'field := field num.names$ 'numnames := numnames #3 < { % % 1 or 2 names: always cite all of them. numnames 'cite.num.names.full := numnames 'cite.num.names.short := } { numnames #6 < { % % 3-5 names: cite all of them the first time, % only the first name later times numnames 'cite.num.names.full := #1 'cite.num.names.short := } { % % 6 or more names: cite only the first name #1 'cite.num.names.full := #1 'cite.num.names.short := } if$ } if$ } ```
https://tex.stackexchange.com/users/224578
Changing apacite.bst to cite first author when 3 or more authors are listed
true
I replaced the function in apacite.bst highlighted in my question under **Edit:** with the below and it works: ``` FUNCTION {tentative.cite.num.names.field} { 'field := field num.names$ 'numnames := numnames #3 < { % % 1 or 2 names: always cite all of them. numnames 'cite.num.names.full := numnames 'cite.num.names.short := } { % % 3 or more names: cite only the first name #1 'cite.num.names.full := #1 'cite.num.names.short := } if$ } ```
0
https://tex.stackexchange.com/users/224578
682422
316,631
https://tex.stackexchange.com/questions/682416
8
I want a `U`, with the symbols `$\mathfrak{i}$` and `$\mathfrak{r}$` stacked up on each other between the parallel vertical lines. They should not protrude higher than the height of the `U`. It is for a mathematical text, to denote a universe which is *regular* and *invariant*; so there are no conditions upon `U` besides that `$\mathfrak{i}$` and `$\mathfrak{r}$` should be legible.
https://tex.stackexchange.com/users/24406
U with $\mathfrak{i}$ and $\mathfrak{r}$?
false
I stack “i” over ”r” and scale the stack to have the same height as “U”. The ”U” and the stack are superimposed to each other (the latter shifted a bit to the right in order to cope with the heavier left stroke). ``` \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{graphicx} \makeatletter \newcommand{\Uir}{\mathpalette\Uir@\relax} \newcommand{\Uir@}[2]{% \begingroup \sbox\z@{$\m@th#1\mathrm{U}$}% \setbox\tw@=\vbox{% \offinterlineskip \ialign{% \hfil##\hfil\cr $\m@th#1\mathfrak{i}$\cr \noalign{\vskip0.5pt} $\m@th#1\mathfrak{r}$\cr \noalign{\vskip1.5pt} }% }% \ooalign{% $\m@th#1\mathrm{U}$\cr \hidewidth$\m@th#1\mkern1mu$\resizebox{!}{\ht\z@}{\box\tw@}\hidewidth\cr }% \endgroup } \makeatother \begin{document} \[ \Uir \quad \scriptstyle \Uir \] \end{document} ```
11
https://tex.stackexchange.com/users/4427
682428
316,632
https://tex.stackexchange.com/questions/682426
0
I'm trying to issue a custom error message in the case of an unknown choice for a `l3keys` `.choice` key. In the following MCE: * I created a custom message `Unknown~key~choice`, * I defined a `key` key which has the `.choice` property, * I used the special `unknown` choice that should issue an error message based on my custom `Unknown~key~choice` message. If the supplied key is one (in fact the only one, in this MCE) of the valid values (`key=foo)`, everything works as expected. But, otherwise (e.g. `key=bar`), the issued message isn't my custom one but the `expl3` default one in such a case: > > ! LaTeX Error: Key 'mymodule/key' accepts only a fixed set of choices. > > > For immediate help type H . > ... > > > l.21 } > > > ? H > > > The key 'mymodule/key' only accepts predefined values, and 'bar' is not one of > these. > > > ? > > > ``` \documentclass{article} \begin{document} \ExplSyntaxOn \msg_new:nnn{mymodule}{Unknown~key~choice}{ The~ supplied~ value~ `#1`~ for~ `key` isn't~ one~ of~ the~ valid~ ones~ (`foo`). } \keys_define:nn { mymodule } { key .choices:nn = { foo , unknown .code:n = { \msg_error:nnx {mymodule} {Unknown~key~choice} {\exp_not:n {#1}} } }{ You~ have~ chosen~ “\l_keys_choice_tl”! } } \keys_set:nn { mymodule } { % key=foo key=bar } \ExplSyntaxOff \end{document} ``` What did I miss?
https://tex.stackexchange.com/users/18401
Why do I not get my custom error message in case of "unknown choice for a l3keys.choice"?
true
Define the unknown choice on its own: ``` \documentclass{article} \begin{document} \ExplSyntaxOn \msg_new:nnn{mymodule}{Unknown~key~choice}{ The~ supplied~ value~ `#1`~ for~ `key` isn't~ one~ of~ the~ valid~ ones~ (`foo`). } \keys_define:nn { mymodule } { key .choices:nn = { foo , } { You~ have~ chosen~ “\l_keys_choice_tl”! }, key / unknown .code:n = { \msg_error:nnx {mymodule} {Unknown~key~choice} {\exp_not:n {#1}} } } \keys_set:nn { mymodule } { % key=foo key=bar } \ExplSyntaxOff \end{document} ```
2
https://tex.stackexchange.com/users/2388
682429
316,633
https://tex.stackexchange.com/questions/338363
3
The command `\pgfmathparse` is simply great. I can do things like `\pgfmathparse{factorial(5)}\pgfmathresult` and get `120` as a result. But what about the [Double factorial](https://en.wikipedia.org/wiki/Double_factorial) or the [Gamma function](https://en.wikipedia.org/wiki/Gamma_function)? Is there any way to use them with `pgf`? Can I define them myself? If so - how?
https://tex.stackexchange.com/users/14750
compute gamma function and double factorial with pgfmath
false
For an alternative with double factorial (user defined) and Gamma (built-in) in Asymptote. ``` // http://asymptote.ualberta.ca/ // Double factorial. int doublefactorial(int n){ int b=n; while (n>2){ b=b*(n-2); n=n-2; } return b; } for (int i=1; i<8; ++i) write(string(i)+' !! = ',doublefactorial(i)); for (int i=3; i<8; ++i) write('Gamma('+string(i)+') = '+string(i-1)+'! = ',gamma(i)); ``` Output: ``` 1 !! = 1 2 !! = 2 3 !! = 3 4 !! = 8 5 !! = 15 6 !! = 48 7 !! = 105 Gamma(3) = 2! = 2 Gamma(4) = 3! = 6 Gamma(5) = 4! = 24 Gamma(6) = 5! = 120 Gamma(7) = 6! = 720 ```
1
https://tex.stackexchange.com/users/140722
682434
316,635
https://tex.stackexchange.com/questions/682408
0
On the PDF version of my file, when I click on the first entry of the TOC, it leads to the title page. How to fix that? Here is my title page: ``` \thispagestyle{empty} \begin{titlepage} \hspace{-1.5cm} \centering \vspace{1cm} {\LARGE\noindent \textbf{TITLE OF MY WORK} \par} \vspace{0.5cm} %Thesis subtitle {\Large\noindent \par} \vspace{2cm} \vspace{1cm} {\Large by} \vspace{1cm} {\LARGE\noindent MY NAME \par} \vspace{1cm} {\Large \noindent Submitted in partial fulfillment of the requirements for the degree of Master of Applied Science \par \vspace{1cm} April 2023} \vfill \hrule \vspace{0.3cm} {\Large\noindent \textcopyright Copyright by .....} \end{titlepage} \cleardoublepage ``` And here is the code for the first entry of my toc (list of tables): ``` %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %TABLE OF CONTENTS \cleardoublepage \pagenumbering{gobble} \tableofcontents \addtocontents{toc}{\textbf{\contentsname}\dotfill\thepage\par} \cleardoublepage %%%%%%%%%%%%%%%%%%%%%%%%%%% % LIST OF TABLES %%%%%%%%%%%%%%%%%%%%%%%%%%%% \cleardoublepage \thispagestyle{plain} \addcontentsline{toc}{chapter}{List of Tables}{\pagestyle{plain}} \pagenumbering{roman} \setcounter{page}{1} \setlength{\cftparskip}{1.5\baselineskip} \listoftables \cleardoublepage ```
https://tex.stackexchange.com/users/293105
Table of Contents and Title Page
true
Add `\phantomsection` before `\addcontentsline{toc}{chapter}{List of Tables}` to make the link point to the List of Tables page. Try this code: ``` \documentclass[12pt]{report} \usepackage{tocloft} \setlength{\cftparskip}{1.5\baselineskip} \usepackage{hyperref} % added <<<<<<<<<<<<< \hypersetup{% colorlinks=true, linkcolor=blue, } \begin{document} \thispagestyle{empty} \begin{titlepage} \centering \vspace{1cm} {\LARGE\noindent \textbf{TITLE OF MY WORK} \par} \vspace{0.5cm} %Thesis subtitle {\Large\noindent \par} \vspace{2cm} \vspace{1cm} {\Large by} \vspace{1cm} {\LARGE\noindent MY NAME \par} \vspace{1cm} {\Large \noindent Submitted in partial fulfillment of the requirements for the degree of Master of Applied Science \par \vspace{1cm} April 2023} \vfill \hrule \vspace{0.3cm} {\Large\noindent \textcopyright\ Copyright by .....} \end{titlepage} \cleardoublepage \pagenumbering{roman} % added <<<<<<<<<<<<< \tableofcontents \cleardoublepage \phantomsection % added <<<<<<<<<<<<< \addcontentsline{toc}{chapter}{List of Tables} \listoftables \cleardoublepage \pagenumbering{arabic} % added <<<<<<<<<<<<< \chapter{One} Some text. \begin{table}[ht!] \caption{Artic Shipping Routes.} \end{table} \begin{table}[ht!] \caption{Unique ships entering the Polar Code area 2013 and 2019. Source: adapted from PAME (2020)} \end{table} \chapter{Two} Some more text. \begin{table}[ht!] \caption{Sea Ice Extent.} \end{table} \begin{table}[ht!] \caption{Canadian Artic Classes and Ice type related to each of them. Source: Transport Canada (2017)} \end{table} \begin{table}[ht!] \caption{Shipping Safety Control Zones.} \end{table} \chapter{Three} Some text. \begin{table}[ht!] \caption{Artic Shipping Routes.} \end{table} \begin{table}[ht!] \caption{Unique ships entering the Polar Code area 2013 and 2019. Source: adapted from PAME (2020)} \end{table} \chapter{Four} Some more text. \begin{table}[ht!] \caption{Sea Ice Extent.} \end{table} \begin{table}[ht!] \caption{Canadian Artic Classes and Ice type related to each of them. Source: Transport Canada (2017)} \end{table} \begin{table}[ht!] \caption{Shipping Safety Control Zones.} \end{table} \end{document} ```
0
https://tex.stackexchange.com/users/161015
682435
316,636
https://tex.stackexchange.com/questions/534430
1
I'm having problems when I try to enclose an itemize environment within a fxnote (using the package fixme). The code is attached below, as indicated tests 1 and 2 works fine, but test 3 fails when uncommented giving a long error message reproduced below). Here is the code: ``` \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[draft]{fixme} \begin{document} \section{Introduction} Test 1 \fxnote{this is ok} \bigskip Test 2 \begin{itemize} \item This is also ok \end{itemize} \bigskip Test 3 %\fxnote{ %\begin{itemize} % \item This doesnt work when uncommented %\end{itemize}} \end{document} ``` Is this a known problem with the fixme package? Is there some way to fix this or alternatively another package that can do the same as fixme? thanks in advance, Kasper PS And here is the error message I get ``` Compile Error. Sorry, your LaTeX code couldn't compile for some reason. Please check the errors below for details, or view the raw log. main.tex, line 25 Use of \@xmpar doesn't match its definition. \@ifnextchar ... \reserved@d =#1\def \reserved@a { #2}\def \reserved@b {#3}\f... l.25 \end{itemize}} If you say, e.g., `\def\a1{...}', then you must always put `1' after `\a', since control sequence names are made up of letters only. The macro here has not been followed by the required stuff, so I'm ignoring it. main.tex, line 25 Use of \@item doesn't match its definition. \@ifnextchar ...eserved@d =#1\def \reserved@a {#2} \def \reserved@b {#3}\futu... l.25 \end{itemize}} If you say, e.g., `\def\a1{...}', then you must always put `1' after `\a', since control sequence names are made up of letters only. The macro here has not been followed by the required stuff, so I'm ignoring it. main.tex Incomplete \iffalse; all text was ignored after line 25. <inserted text> \fi <*> main.tex The file ended while I was skipping conditional text. This kind of error happens when you say `\if...' and forget the matching `\fi'. I've inserted a `\fi'; this might work. ! Emergency stop. <*> main.tex *** (job aborted, no legal \end found) Here is how much of TeX's memory you used: 987 strings out of 492164 14565 string characters out of 6125314 80945 words of memory out of 5000000 5406 multiletter control sequences out of 15000+600000 5100 words of font info for 19 fonts, out of 8000000 for 9000 1141 hyphenation exceptions out of 8191 36i,3n,62p,193b,282s stack positions out of 5000i,500n,10000p,200000b,80000s ! ==> Fatal error occurred, no output PDF file produced! main.tex, line 25 Underfull \hbox (badness 1 ```
https://tex.stackexchange.com/users/210002
itemize environment fails within fixme note
false
I've had the same issue. You can handle it using fixme annotation *environments* like anfxnote. Try writing: ``` \begin{anfxnote}{<short summary of note>} \begin{itemize} \item Now it works! \end{itemize} \end{anfxnote} ```
0
https://tex.stackexchange.com/users/4653
682438
316,637
https://tex.stackexchange.com/questions/682403
1
Is there a way in metapost to print a single label (in math notation) like this one ``` label(btex \Large{$3$} etex,(2,-1)); ``` using some specific color like red or blue? Thank you in advance.
https://tex.stackexchange.com/users/293823
Colored math expression metapost
true
It is simple, but not without a couple of possible things to keep in mind. `label` is defined in `plain.mp` to draw a <picture> variable in the right place. If you pass a plain string it is automatically turned into a <picture> with `infont`. If you pass a `btex ... etex` string it will have been turned into a <picture> before it gets passed to `label`. So if you do `label(btex $3$ etex, (2,1));` this is essentially the same as ``` picture P; P = btex $3$ etex; draw P shifted (2,1); ``` And therefore if you do `label(btex $3$ etex, (2,1)) withcolor red;` this expands to ``` picture P; P = btex $3$ etex; draw P shifted (2,1) withcolor red; ``` And your label appears in red. In plain MP, whatever is in the picture `P` will be drawn in red, only. So you might like to consider this program: ``` prologues := 3; outputtemplate := "%j%c.eps"; verbatimtex \documentclass{article} \usepackage{xcolor} \begin{document} etex beginfig(1); picture T[]; T1 = btex $e=mc^2$ etex; T2 = btex $\mathcolor{red}{e} = \mathcolor{blue}{mc}^2$ etex; T3 = image( fill fullcircle scaled 22 -- reverse fullcircle scaled 14 -- cycle withcolor blue; fill unitsquare shifted -(1/2, 1/2) xscaled 36 yscaled 4 withcolor red; ) shifted 18 right; for i = 1, 2, 3: draw T[i] shifted (0, -64i); draw T[i] shifted (60, -64i + 12) withcolor 1/2 red; draw T[i] shifted (60, -64i - 12) withcolor 1/2 green; endfor endfig; end. ``` If you compile this with `mpost -tex=latex` you should get an EPS file that looks like this: Notice that the three images get drawn "monochrome" when you add `withcolor` after the `draw` command. Even if they are multicoloured originally. Extra note for `luamplib` users ------------------------------- There appears to be a quirk -- or perhaps a bug -- with the current TeXLive version of `luamplib`. If you change the header of the program above, so that it looks like this: ``` \documentclass[border=5mm]{standalone} \usepackage{luamplib} \usepackage{xcolor} \begin{document} \begin{mplibcode} beginfig(1); picture T[]; T1 = btex $e=mc^2$ etex; T2 = btex $\mathcolor{red}{e} = \mathcolor{blue}{mc}^2$ etex; T3 = image( fill fullcircle scaled 22 -- reverse fullcircle scaled 14 -- cycle withcolor blue; fill unitsquare shifted -(1/2, 1/2) xscaled 36 yscaled 4 withcolor red; ) shifted 18 right; for i = 1, 2, 3: draw T[i] shifted (0, -64i); draw T[i] shifted (60, -64i + 12) withcolor 1/2 red; draw T[i] shifted (60, -64i - 12) withcolor 1/2 green; endfor endfig; \end{mplibcode} \end{document} ``` and recompile with `lualatex` you will get a PDF that looks like this: For some reason, `withcolor` is being ignored if the <picture> contains coloured text. Possibly this is a quirk of my own set up!
3
https://tex.stackexchange.com/users/15036
682443
316,640
https://tex.stackexchange.com/questions/682436
1
I need to write a fraction for which I can break the numerator into several (not just two) lines. I tried several solutions and none have works. On Overleaf, most just stop the document from compiling. These are my latest attempts: ``` \begin{align*} \frac{\begin{split}{2102 – 400 + \\ 1873 – 400 + \\ 1949+ \\ 1800 – 400 + \\ 1314 + 400 + \\ 1473 + \\ 1901 + 400}\end{split}}{7} \end{align*} ``` and (this was a first split; I would have used  `\splitfrac` again if that had worked) ``` \begin{align*} \frac{\splitfrac{2102 – 400 +}{1873 – 400 + \\ 1949+ \\ 1800 – 400 + \\ 1314 + 400 + \\ 1473 + \\ 1901 + 400}}{7} \end{align*} ``` Even better (but not indispensable), I'd like to annotate each line of the numerator. Is that possible? To indicate what each line represents. **NOTE**: I ended up doing this by putting matrix in the numerator. That just solved everything for me in a very easy way.
https://tex.stackexchange.com/users/2118
Splitting fraction numerator into several lines
true
I'm not sure I understood your comments fully, but `\splitfrac` instructions can certainly be nested. Each instance of `\splitfrac` creates a linebreak; three nested `\splitfrac` directives, for instance, result in four lines overall. The `\mathstrut` directives serve to insert a bit of extra vertical whitespace. ``` \documentclass{article} \usepackage{mathtools} % for \splitfrac macro \begin{document} \[ \frac{\splitfrac{2102 - 400 + 1873\mathstrut}{ \splitfrac{{} - 400 + 1949 + 1800\mathstrut}{ \splitfrac{{} - 400 + 1314 + 400\mathstrut}{ + 1473 + 1901 + 400\mathstrut}}}}{7} \] \end{document} ```
1
https://tex.stackexchange.com/users/5001
682445
316,641
https://tex.stackexchange.com/questions/83663
76
``` I've a LaTeX source. I'm ready %for submission %But first I would like to strip its comments. So I hope there are 100\% auto ways to get this done. \begin{comment} Because there are subtle ways to mess it up. \end{comment} ``` Is there a utility which will eliminate all these comments? Yes, I could do it by hand, but that seems needlessly laborious, has the potential for mistakes, and makes maintenance difficult. I could also use `sed`, but there's a potential for mistakes. Besides, it is an axiom of the whole GNU/Linux thing that if you can think of it, someone's probably already made a utility for it.
https://tex.stackexchange.com/users/7478
Utility to Strip Comments from LaTeX Source
false
You want to strip everything inside the "comment" environment in a file named `'in.tex'` that includes this content: ``` the text above the comment will not be deleted. \begin{comment} the content of the solution environment will be deleted (together with any empty line created by the deletion) \end{comment} the text below the comment will not be deleted. ``` No bells and whistles Python code based on [anubhava's answer](https://stackoverflow.com/questions/75859649/negate-findall-in-python-re-module): ``` data = open('in.tex').read() data = re.sub(r'(?m)^\n\\begin({comment})(?:.*\n)+?\\end\1\n', '', data) ``` The output will be: ``` the text above the comment will not be deleted. the text below the comment will not be deleted. ``` If you want to loop over all files in a given directory: ``` #!/usr/bin/env python3 import os import re # select directory wd = 'path/to/dir' for (dirpath, dirnames, filenames) in os.walk(wd): for filename in filenames: if filename.endswith('.tex') and '-no-comment' not in filename: basename, ext = os.path.splitext(filename) filepath0 = os.sep.join([dirpath, filename]) filepath1 = os.sep.join([dirpath, basename+'-no-comment'+ext]) regex = re.compile(r'(?m)^\n\\begin({comment})(?:.*\n)+?\\end\1\n') with open(filepath0) as f0, open(filepath1, 'w') as f1: data = f0.read() data = re.sub(regex,'', data) f1.write(data) ```
0
https://tex.stackexchange.com/users/13102
682453
316,643
https://tex.stackexchange.com/questions/682450
0
I'm writing an article with a two-column distribution. I want to display some images that need to be shown almost as wide as the page and centered, specifically in the Results section. The problem is, when I compile the document it shows the figures anywhere they "suit" as default. I'm using the following code ``` \begin{figure*}[h] \includegraphics[width=\textwidth]{imágenes/Np-Ng3000.png} \caption{XXXXXXXXXXXXX} \end{figure*} ``` This gives everything I need, wide and centered between the two columns but not in the results section necessarily. PS: I'm using [twocolumn] document option
https://tex.stackexchange.com/users/288545
How to display a figure on a determinated section
false
I can't see your document, but try using [!h] instead of [h]. This is called a "bang float" and will more strongly encourage LaTeX to put your figure at a particular place. This should be avoided when possible, as you can get bad typography when overriding LaTeX's default choices. If this doesn't work, you can try using the float package, which provides the option [H] which fixes the float in a particular spot. You can also use the placeins package for a more complicated solution. This adds the \FloatBarrier command, which prevents figures (a type of float) from going past them. Adding the package with the command: ``` \usepackage[section]{placeins} ``` will add a FloatBarrier before every section, preventing figures from floating away from their section.
0
https://tex.stackexchange.com/users/264823
682469
316,650
https://tex.stackexchange.com/questions/682466
4
I see such a paragraph in the `ctex-fontset-ubuntu.def` file which is related to zhmCJK. ``` \ctex_zhmap_case:nnn { \setCJKmainfont { :2:NotoSerifCJK-Regular.ttc } [ BoldFont = :2:NotoSerifCJK-Bold.ttc, ItalicFont = gkai00mp.ttf ] \setCJKsansfont { :2:NotoSansCJK-Regular.ttc } [ BoldFont = :2:NotoSansCJK-Bold.ttc ] \setCJKmonofont { :2:NotoSerifCJK-Regular.ttc } [ BoldFont = :2:NotoSerifCJK-Bold.ttc ] \setCJKfamilyfont { zhsong } { :2:NotoSerifCJK-Regular.ttc } [ BoldFont = :2:NotoSerifCJK-Bold.ttc ] \setCJKfamilyfont { zhhei } { :2:NotoSansCJK-Regular.ttc } [ BoldFont = :2:NotoSansCJK-Bold.ttc ] …… } ``` This may have nothing to do with my usage, but out of curiosity I would like to ask what the `:2:` here means? I guess it's the font weight, but I haven't found the relevant documentation after searching for a long time.Any help would be greatly appreciated. Thank you all.
https://tex.stackexchange.com/users/294786
What does :2:NotoSerifCJK-Regular.ttc in ctex-fontset-ubuntu.def mean?
true
`ttc` font files contain a collection of multiple fonts, so in addition to passing the file name you have to indicate which font in the file should be selected. In the case of noto-cjk, the different fonts contained in the same file are language variants. What you see here is the notation to select the font with index 2 in uptex, which is the simplified chinese version. The equivalent notation with fontspec would be `\setmainfont [FontIndex=2] { NotoSerifCJK-Regular.ttc }`
5
https://tex.stackexchange.com/users/80496
682471
316,651
https://tex.stackexchange.com/questions/682448
1
I would like to know how we can draw an horizontal line with the natural numbers highlighted as well as rays starting from one vertice in the direction towards the right hand side direction. This is what I can get as far: ``` \begin{tikzpicture} \draw (0,0) node[above] {0} -- +(1,0) node[above] {1}; \draw (1,0) -- +(1,0) node[above] {2}; \end{tikzpicture} ``` I can get the lines between two consecutive vertices, but I am unable to draw a black ball at each vertice as well as drawing rays from the vertice 1 to 2, for example.
https://tex.stackexchange.com/users/294770
How do we draw a line representing the natural numbers and rays from one vertice to another?
false
Not sure if you are asking for something like this. ``` \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \draw (0,0) foreach \x in {1,...,6} { -- ++ (1,0) node[circle,fill,inner sep=2pt,label=below:$\x$](\x){}}; \draw foreach \i in {1,...,5} {(1) to[out=\i*15,in=180-\i*15] (2) (1) to[out=-\i*15,in=180+\i*15] (2)}; \end{tikzpicture} \end{document} ```
2
https://tex.stackexchange.com/users/nan
682475
316,654
https://tex.stackexchange.com/questions/393498
4
I'm looking for a way to test whether the current orientation of my document is portrait or landscape within LaTeX. This would be similar to the following test for font size: ``` \ifthenelse{\equal{\f@size}{10}}{something if 10pt}{something else otherwise} ``` but I haven't been able to get hold of the name of a variable that contains actual orientation (portrait or landscape).
https://tex.stackexchange.com/users/3301
How do I test for page orientation in LaTeX?
false
`\ifthenelse{\paperwidth < \paperheight}{portrait}{landscape}` Only works if the whole document is rotated (which was the original question), I'm still to find a way to determine if a single page is rotated Changing the orientation with `\begin{landscape}` doesn't change any page dimensions. It just rotates the content A simple test with: ``` \begin{document} \the\pagewidth \\ \the\pageheight \begin{landscape} \the\pagewidth \\ \the\pageheight \end{landscape} \end{document} ``` Produces exactly the same on both pages 597.50787pt 845.04684pt ``` \begin{document} \ifthenelse{\paperwidth < \paperheight}{portrait}{landscape} \begin{landscape} \ifthenelse{\paperwidth < \paperheight}{portrait}{landscape} \end{landscape} \end{document} ``` Shows portrait on both pages
0
https://tex.stackexchange.com/users/294795
682479
316,656
https://tex.stackexchange.com/questions/682353
0
This is essentially the same problem as in [Paul Taylor's diagrams.sty NEVER HAPPEN error](https://tex.stackexchange.com/questions/660920/paul-taylors-diagrams-sty-never-happen-error/660929) but the solution given there isn't working for me. I previously had no problem with this on my old HP laptop running Windows 10, but I just got a new Dell with Windows 11. I installed `MiKTeX` (current version appears to be 22.10) and TeXstudio as I usually do. Now if I run the following ``` \documentclass[12pt]{article} \usepackage{diagrams} \begin{document} \begin{diagram} A & \rTo & B \end{diagram} \end{document} ``` I get an error that reads "Commutative Diagram: \* THIS (S) SHOULD NEVER HAPPEN! \* at lines 5--7 [1", although the TeXing finishes and the output pdf file seems to show the correct diagram. I tried to implement the solution from the link above, but when I insert that code, I get the following error: > > Undefined control sequence. \expandafter\foo\row@to@buffer > > > Any suggestions for fixing this would be much appreciated.
https://tex.stackexchange.com/users/43547
Paul Taylor's diagrams.sty NEVER HAPPEN error redux
true
The version on ctan (3.93) is time bombed and does not work at all, use 3.96 from <http://paultaylor.eu/diagrams> save `V3,96.tex` as `diagrams.sty` then the adjustment at [Paul Taylor's diagrams.sty NEVER HAPPEN error](https://tex.stackexchange.com/questions/660920/paul-taylors-diagrams-sty-never-happen-error/660929) should work.
0
https://tex.stackexchange.com/users/1090
682489
316,660
https://tex.stackexchange.com/questions/681822
0
I have been making a Texas lawyer .bbx and .cbx, and, in doing that, I created a citation style called courtrule. For example, Rule 4 of the Texas Rules of Civil Procedure is cited like Tex. R. Civ. P. 4. However, because there are hundreds of different rules, I want to have a general `\cite{}` where I can pass the rule number as a postnote, i.e., `\cite[4]{TRCP}` will cause this: In-text: Tex. R. Civ. P. 4 In-bibliography: Tex. R. Civ. P. 4 At the moment, when I write `\cite[4]{TRCP}`, it does the correct in-text citation, but it does not print the postnote in the bibliography. Additionally, I will cite multiple different rules, so I might have `\cite[500]{TRCP}` as well as `\cite[4]{TRCP}`. I want the bibliography to make a new entry for each different postnote. Is that possible? This is my bibliography driver code now: ``` \DeclareBibliographyDriver{courtrule}{% \usebibmacro{begentry}% \printfield{title}\addspace\printfield{postnote}\hspace{-0.7ex} \dotfill\usebibmacro{pageref}% } ``` But that just makes the bibliography print `Tex. R. Civ. P.` without the number. [EDIT: I have learned it's because the `postnote` field is not available in the bibliography] I know I'm doing it wrong, but I don't know how to do it right.
https://tex.stackexchange.com/users/292891
How do I make BibLaTeX print postnotes and print a new bibliography entry for every citation with a different postnote?
false
Index the citations. A quick, five-minute proof of concept using out-of-the-box Biblatex, the `title=` and `author=` fields for storing the authority and law report(s) respectively, and `\citetitle` and `\citeauthor` citation commands to retrieve that information. Usage, for bibentry `X`: ``` \citetitle{X}, \citeauthor{X}\index[indexname]{\citetitle{X}, \citeauthor{X}} ``` With (numeric) pinpoint: ``` \citetitle{X}, \citeauthor[45]{X}\index[indexname]{\citetitle{X}, \citeauthor[45]{X}} ``` Tricky part with indexing is getting index sort keys right, and not unintentionally adding/removing blank spaces in the index entries when using different commands to add an (i.e., the same) item. With alphanumeric pinpoints, the index sort key (and citation prefix) has to be added manually. For example, to bring `r 45(a)` into the `rules` index/table (and into the citation in the text, if there is a citation): ``` \citetitle[r 45(a)]{tcpr}\index[rules]{r 045@\citetitle[r 45(a)]{tcpr}} ``` The MWE has some more details. It is a multi-step process (see `Toolchain` in the MWE). Remember to run with shell escape on. MWE ``` %Toolchain: %(pdf/xe/lua)latex with shell escape %biber %latex %splitindex -s plainindexstyle.ist %latex %latex \begin{filecontents*}[overwrite]{\jobname.bib} @misc{tcpr, %misc: just for demo title = {TCPR}, pagination = {rule}, %bibstring to apply if postnote is digits } @misc{auth1, title = {A v B}, author = {{4 LR 456}}, } @misc{auth2c, title = {The Dog Co. v. The Cat Co.}, author = {{4 LR 458}}, } @misc{auth3c, title = {U.S. v. U.S.}, author = {{102 U.S.X.C. 123}}, } \end{filecontents*} %style file for index \begin{filecontents*}{plainindexstyle.ist} delim_0 "\\space\\dotfill\\space " delim_1 "\\space\\dotfill\\space " delim_2 "\\space\\dotfill\\space " delim_n ", " delim_r "--" delim_t "" encap_prefix "\\" encap_infix "{" encap_suffix "}" \end{filecontents*} \documentclass{article} \newcommand\rulesep{\rule{0.4\textwidth}{.4pt}} %------------------ \title{Creating a Table of Rules} \author{} \date{} \usepackage[splitindex,noautomatic,nonewpage]{imakeidx} \newcommand\abibname{authortitle} \newcommand\abibstyle{style=\abibname} \usepackage[ \abibstyle , indexing=cite, citetracker=true, ibidtracker=false, pagetracker=true, % idemtracker=true, % opcittracker=true, % loccittracker=true, % autocite=footnote, % datezeros=true, ]{biblatex} \addbibresource{\jobname.bib} \NewBibliographyString{atparagraph,rule} \DefineBibliographyStrings{english}{% atparagraph = {at para}, rule = {r}, } %================= %indexing \newcommand\pagerefindexnote{\noindent\small\mdseries $\to$ References are to page numbers.} \makeindex \makeindex[name=rulesa,title=Table of TCP Rules,columns=3,columnseprule,intoc] \makeindex[name=cases,title={\normalsize Cases},columns=1] \makeindex[name=rules,title={\normalsize Rules},columns=1] \usepackage[ final=true, bookmarks, colorlinks=true, allcolors = black, citecolor=blue, hyperindex=false, ]{hyperref} % variations instead of having \cite...\index... all the time \newcommand{\icite}[1]{\cite[#1]{tcpr}\index[rulesa]{r~#1}} \newcommand{\iicite}[2]{\cite[#1]{tcpr}\index[rulesa]{r~#2@r~#1}} \newcommand{\iiicite}[3]{\cite[#1]{tcpr}\index[rulesa]{r~#3@r~#2{#1}}} \newcommand{\ivcite}[4]{\cite[#1]{tcpr}\index[rulesa]{r~#3@r~#2{#1}|#4}} \newcommand{\vcite}[2]{\cite[#1]{tcpr}\index[rulesa]{#2}} %some wrapper commands for convenience %%\imki@wrindexentry{names}{Charles}{26} - this is an imakeidx macro \makeatletter \newcommand{\addindexitem}[3]{% \imki@wrindexentry{#1}{#2}{#3}} \makeatother \newcommand{\textformat}[1]{\textsf{\textbf{#1}}} \newcommand\yq{\begin{quotation}} \newcommand\yqq{\end{quotation}} \newcommand\yc{\begin{center}} \newcommand\ycc{\end{center}} \newcommand\yi{\begin{itemize}} \newcommand\yii{\end{itemize}} \newcommand\yis{\item[\space]} \newcommand\zzz[2]{\cite[#1]{tcpr}\index[rules]{r #2@\citetitle[#1]{tcpr}}} %1=rule2=sortkey %------------------ \begin{document} \maketitle \newpage \tableofcontents \newpage \index{p} %seems general index is expected/assumed?? %\printindex \indexprologue{\pagerefindexnote} %\addindexitem{cases}{ @\textit{Case}|textit}{Page(s)} %\addindexitem{rules}{ @\textit{Rule}|textit}{Page(s)} \printindex[rulesa] \newpage Index the citations. Use multiple indices, one for each category of authority. \yc \bfseries TABLE OF AUTHORITIES \ycc \hfill\textbf{Page(s)} \printindex[cases] \printindex[rules] \newpage \section{Text} \cite[4]{tcpr}\index[rulesa]{4} xxx \section{More Text} xxx \newpage \cite[4]{tcpr}\index[rulesa]{4} \cite[123]{tcpr}\index[rulesa]{123} \iicite{5}{006}, \iicite{15}{015}, \iicite{52}{052}, \iicite{502}{502}, \iicite{12}{012}. \cite[4556]{tcpr}\index[rulesa]{4556} \iicite{53}{053} \iiicite{14}{\textit}{014} \iiicite{16}{\textbf}{016} \iiicite{18}{}{018}{textbf} \vcite{19}{r~019@r~19|textformat} \vcite{19(a)}{r~019a@r~19!(a)} versus \vcite{r~19(a)}{r~019a@r~19!(a)} \vcite{55(b)}{r~055b@r~55(b)|see{52(a)}} \vcite{55(c)}{r~055c@r~55(c)!see{52(a)}} \vcite{52(a)}{r~052a@r~52(a)} \newpage \vcite{52(a)}{r~052a@r~52(a)} $\to$ \textbackslash index\{indexentry\} An \verb.indexentry. is formatted as: \yq \yc a@b|c \ycc where \yi \yis a = sortkey \yis b = index display key(s), up to three levels \yi \item[·] level1!level2!level3 \yii \yis c = page number format command name (without the backslash) \yi \item[·] can be \verb,see{...}, \yii \yii \yc e.g., 052@52|textbf \ycc Sort the item as 052, print 52, and make the page number bold. \textbf{References}: Do \verb.texdoc makeindex. to bring up both \verb,makeindex.pdf, and \verb,ind.pdf, manuals. \yqq \cite[457]{auth1}\index[cases]{\citetitle{auth1}, \citeauthor[457]{auth1}} \cite[45]{tcpr}\index[rules]{r 045@\citetitle[45]{tcpr}} \zzz{123}{123} \zzz{200}{200} \cite{auth2c}\index[cases]{\citetitle{auth2c}, \citeauthor{auth2c}} \newpage \cite{auth2c}\index[cases]{\citetitle{auth2c}, \citeauthor{auth2c}} \cite{auth2c}\index[cases]{\citetitle{auth2c}, \citeauthor{auth2c}} \cite{auth3c}\index[cases]{\citetitle{auth3c}, \citeauthor{auth3c}} \zzz{123}{123} \zzz{200}{200} \zzz{201}{201} \zzz{r 212(a)}{212(a)} versus \cite[r 212(a)]{tcpr}\index[rules]{r 212(a)@\citetitle [r 212(a)]{tcpr}}%note the space \newpage \cite{auth3c}\index[cases]{\citetitle{auth3c}, \citeauthor{auth3c}} \zzz{123}{123} \newpage \cite{auth3c}\index[cases]{\citetitle{auth3c}, \citeauthor{auth3c}} \zzz{85}{085} \zzz{85}{085} \newpage \cite{auth2c}\index[cases]{\citetitle{auth2c}, \citeauthor{auth2c}} \cite{auth3c}\index[cases]{\citetitle{auth3c}, \citeauthor{auth3c}} \newpage \cite{auth2c}\index[cases]{\citetitle{auth2c}, \citeauthor{auth2c}} \zzz{123}{123} \zzz{85}{085} \citetitle[r 45(a)]{tcpr}\index[rules]{r 045@\citetitle[r 45(a)]{tcpr}} \bigskip \hfill\rulesep\hfill\ %\hrule%{0.8\linewidth} \bigskip %=============================================== \end{document} ```
2
https://tex.stackexchange.com/users/182648
682490
316,661
https://tex.stackexchange.com/questions/682467
1
I am using the following code to define new custom variables, along with the existing ones, and use their values later in the document. ``` \newcommand\subtitle[1]{\newcommand\zzsubtitle{#1}} \newcommand\institute[1]{\newcommand\zzinstitute{#1}} \newcommand\fullmarks[1]{\newcommand\zzfullmarks{#1}} % \title{CC3 -- Mathematics} \author{Subhajit Paul} \institute{Salesian College, Siliguri Campus} \date{BSc Honours 2\textsuperscript{nd} Semester Examination, 2023} \subtitle{Real Analysis} \fullmarks{60} % \makeatletter \let\titlevalue\@title \let\authorvalue\@author \let\datevalue\@date \makeatother ``` What I want now is to have a provision for an optional value for the variables. For instance, I want to write ``` \title[MATHCC3]{CC3 -- Mathematics} ``` and the value `MATHCC3` will be stored in another variable, say `\shorttitle`. However, if I write ``` \title{CC3 -- Mathematics} ``` then `\shorttitle` variable will have the same value as `\titlevalue`. The same feature should also be implemented for the custom variables like `\subtitle` and `\institute`. How do I achieve this?
https://tex.stackexchange.com/users/162028
Improve custom-defined variables
true
Like this? ``` \documentclass{article} \makeatletter \renewcommand{\title}[2][\empty]{% #1 = short title (optional), #2 = title \ifx\empty#1\relax \def\zzshorttitle{#2}% \else \def\zzshorttitle{#1}% \fi \def\@title{#2}} \makeatother \title[Real Analysis]{CC3 -- Mathematics} \author{Subhajit Paul} %\institute{Salesian College, Siliguri Campus} \date{BSc Honours 2\textsuperscript{nd} Semester Examination, 2023} \begin{document} \maketitle \zzshorttitle \end{document} ```
1
https://tex.stackexchange.com/users/34505
682505
316,668
https://tex.stackexchange.com/questions/682500
0
Is there a way to use the caption style defined in the `caption` package for a `longtblr`? To format table captions, I am using the `caption` package as follows: ``` \usepackage[ hypcap=true, format=hang, font={footnotesize, sf}, labelfont={bf}, margin=0cm, aboveskip=8pt, singlelinecheck=off, ]{caption} ``` This works well for small tables (without page breaks / page continuation): ``` \begin{table}[!htbp] \captionsetup{type=table} \caption{A small table} \begin{tblr}{l X[r] X[r] X[r]} a & b & c & d \\ a & b & c & d \\ a & b & c & d \\ \end{tblr} \end{table} ``` However, the style is not used in my long table. I had a look into the [`tabularray` documentation](http://mirrors.ctan.org/macros/latex/contrib/tabularray/tabularray.pdf) (Section 4.2.1), but all I was able to find, is related to the caption contents, not its style. According to the [`caption` documentation](http://mirrors.ctan.org/macros/latex/contrib/caption/caption.pdf) (Introduction), `caption` does not deal with caption contents, but caption style only: > > Please note that the caption package is only controlling the look & feel of the captions. > > > Is there a way to combine the `longtblr` environment with the caption style defined with the `caption` package? The MWE is as follows: ``` \documentclass{article} \usepackage{tabularray} \usepackage[ hypcap=true, format=hang, font={footnotesize, sf}, labelfont={bf}, margin=0cm, aboveskip=8pt, singlelinecheck=off, ]{caption} \begin{document} \begin{table}[!htbp] \captionsetup{type=table} \caption{A small table} \begin{tblr}{l X[r] X[r] X[r]} a & b & c & d\\ a & b & c & d\\ a & b & c & d \\ \end{tblr} \end{table} \begin{longtblr}[ caption = A long table, ]{ colspec = {l X X}, rowhead = 1, rowfoot = 0, } Head & Head & Head \\ Alpha & Beta & Gamma \\ Epsilon & Zeta & Eta \\ Iota & Kappa & Lambda \\ Nu & Xi & Omicron \\ Rho & Sigma & Tau \\ Phi & Chi & Psi \\ Alpha & Beta & Gamma \\ Epsilon & Zeta & Eta \\ Iota & Kappa & Lambda \\ Nu & Xi & Omicron \\ Rho & Sigma & Tau \\ Phi & Chi & Psi \\ Alpha & Beta & Gamma \\ Epsilon & Zeta & Eta \\ Iota & Kappa & Lambda \\ Nu & Xi & Omicron \\ Rho & Sigma & Tau \\ Phi & Chi & Psi \\ Alpha & Beta & Gamma \\ Epsilon & Zeta & Eta \\ Iota & Kappa & Lambda \\ Nu & Xi & Omicron \\ Rho & Sigma & Tau \\ Phi & Chi & Psi \\ Alpha & Beta & Gamma \\ Epsilon & Zeta & Eta \\ Iota & Kappa & Lambda \\ Nu & Xi & Omicron \\ Rho & Sigma & Tau \\ Phi & Chi & Psi \\ Alpha & Beta & Gamma \\ Epsilon & Zeta & Eta \\ Iota & Kappa & Lambda \\ Nu & Xi & Omicron \\ Rho & Sigma & Tau \\ Phi & Chi & Psi \\ Alpha & Beta & Gamma \\ Epsilon & Zeta & Eta \\ Iota & Kappa & Lambda \\ Nu & Xi & Omicron \\ Rho & Sigma & Tau \\ Phi & Chi & Psi \\ Alpha & Beta & Gamma \\ Epsilon & Zeta & Eta \\ Iota & Kappa & Lambda \\ Nu & Xi & Omicron \\ Rho & Sigma & Tau \\ Phi & Chi & Psi \\ \end{longtblr} \end{document} ```
https://tex.stackexchange.com/users/61513
Use caption style defined with caption package in tabularray's longtblr
false
The solution given in the link by Zarko works well in documents without a `\listoftables`. Once you want to have that list, you will end up with two entries of every table in it. Both the short caption (that should be in the list of tables) and the long version (that should only be used in the caption itself) are entered. The `tabularray` package does not obey the options set in the `caption` package, as you (and I) noticed. But the package does have an extensive way to define *themes* that can be used to set the table caption in a desired way. I use a coloured box in which the caption is typeset. Without going to create a whole MWE I just give the code snippets of the `caption` settings and of the (almost) equivalent `tabularray theme` settings. My caption setup is defined as follows: ``` \usepackage{xcolor} \definecolor{color2}{RGB}{255,255,120} % Color of the boxes behind the abstract and headings (dark yellow) \definecolor{color5}{RGB}{139,0,139} %Color of captions (dark purple) \usepackage[labelfont={bf,sf,small,color=color5},% labelsep=endash,% box=colorbox,boxcolor=color2!10,slc=off,% textfont={color=color5},% justification=justified,%raggedright,% format=hang,indention=-15mm]{caption} \setlength{\abovecaptionskip}{0pt} \setlength{\belowcaptionskip}{0pt} ``` The tabularray theme derived from that is: ``` \usepackage{tabularray} \UseTblrLibrary{booktabs,siunitx,varwidth} \DefTblrTemplate{caption-tag}{color}{\textcolor{color5}{\textsf{\textbf{Tabel \thetable}}}} \DefTblrTemplate{caption-sep}{color}{\textcolor{color5}{\textbf{--}}} \DefTblrTemplate{caption-text}{color}{\textcolor{color5}{\InsertTblrText{caption}}} \DefTblrTemplate{caption-text}{colorcont}{\textcolor{color5}{\InsertTblrText{entry}}} \DefTblrTemplate{conthead-text}{color}{\textcolor{color5}{(Vervolg)}} \DefTblrTemplate{contfoot-text}{color}{\textcolor{color5}{\footnotesize Vervolg op volgende pagina}} \DefTblrTemplate{caption}{color}{ \UseTblrTemplate{caption-tag}{color} \UseTblrTemplate{caption-sep}{color} \UseTblrTemplate{caption-text}{color} } \DefTblrTemplate{capcont}{color}{ \UseTblrTemplate{caption-tag}{color} \UseTblrTemplate{caption-sep}{color} \UseTblrTemplate{caption-text}{colorcont} \UseTblrTemplate{conthead-text}{color} } \NewTblrTheme{colorcaps}{ \SetTblrTemplate{caption}{color} \SetTblrTemplate{capcont}{color} \SetTblrTemplate{contfoot-text}{color} \SetTblrStyle{remark}{font=\footnotesize} \SetTblrStyle{note}{font=\footnotesize} } \usepackage{floatrow} \DeclareCaptionLabelSeparator{endash}{\textcolor{color5}{\enskip -- \space}} ``` As you see, the package `floatrow` provides the caption label separator to the theme. The one thing I still have trouble with is the hanging indentation. Otherwise using the theme *colorcaps* in `tall/longtblr` environments sets the caption according to `\captionsetup` and only the short entry is placed inside the `\listoftables`.
1
https://tex.stackexchange.com/users/189383
682512
316,672
https://tex.stackexchange.com/questions/682442
1
I'm producing a document using Xetex that contains code in the APL programming language. In this language, the character `¯` is used to denote negative numbers. The problem is that when I enter the `¯` character in a verbatim, it will automatically overlap the next character because it's a diacritic. I can prevent this by entering all instances of `¯` with a space following as in `¯ 10`. This will render as `¯10` in the document, but then the problem is that if someone wants to copy and paste code from the PDF into a terminal or editor, the pasted code will have spaces: `¯ 10` . This is a syntax error. This problem appears to be associated with the specific font I'm loading via fontspec. It's called PragmataPro and it's a commercial font so if you don't have it already you may not wish to get it just to test with. I've searched and found a variety of solutions for problems like this but none work in this case. I'm using Xetex so the microtype package with `\DisableLigatures` isn't an option; I'm using Xetex for the OpenType support. I tried entering an option to disable ligatures like this: ``` \setmonofont[Scale=1,Ligatures=NoCommon]{PragmataPro Mono} ``` But that fails and I get these error messages: ``` Package fontspec Warning: OpenType feature 'Ligatures=CommonOff' (liga) not (fontspec) available for font 'PragmataPro Mono' with script (fontspec) 'CustomDefault' and language 'Default'. Package fontspec Warning: OpenType feature 'Ligatures=CommonOff' (liga) not (fontspec) available for font 'PragmataPro Mono' with script (fontspec) 'CustomDefault' and language 'Default'. Package fontspec Warning: OpenType feature 'Ligatures=CommonOff' (liga) not (fontspec) available for font 'PragmataPro Mono/B' with script (fontspec) 'CustomDefault' and language 'Default'. Package fontspec Warning: OpenType feature 'Ligatures=CommonOff' (liga) not (fontspec) available for font 'PragmataPro Mono/I' with script (fontspec) 'CustomDefault' and language 'Default'. Package fontspec Warning: OpenType feature 'Ligatures=CommonOff' (liga) not (fontspec) available for font 'PragmataPro Mono/BI' with script (fontspec) 'CustomDefault' and language 'Default'. ``` These variants are all OpenType fonts but it seems they don't support a feature to turn off the `¯` ligature. Below is a code sample to reproduce the problem -- if you happen to have the PragmataPro font. The problem may be specific to this font but it would help if there were some way to just disable all ligature behavior inside verbatim blocks. You can try both the standard article class and the acmart class with this document, the behavior is the same. Removing the PragmataPro line fixes the problem but this is the font I want to use for the document. ``` \documentclass{article} %\documentclass{acmart} \usepackage{fontspec} \setmonofont[Scale=1,Ligatures=NoCommon]{PragmataPro Mono} \begin{document} \begin{verbatim} ¯ 10 ← displays right, copy/paste is broken ¯10 ← displays wrong but can be copied OK \end{verbatim} \end{document} ```
https://tex.stackexchange.com/users/294510
How to prevent diacritic characters from overlapping the next character inside a verbatim? (Font-specific?)
true
The character U+00AF MACRON is not a diacritic: those are classified in Unicode as COMBINING or MODIFIER characters. It is possible that your font either sets zero width for U+00AF or has nonstandard ligatures. In either case you can tell XeTeX to make it appear “standalone” with a trick: ``` \usepackage{newunicodechar} \newunicodechar{¯}{\makebox[0.5em][l]{¯}} ``` The trick is that in most monospaced fonts the characters have width half an em (you may need to adjust if this is not the case for that font). So the box will both give a width to the character and break possible ligatures. Beware that this will also apply to every U+00AF character in your document (but I guess it's not really a problem).
2
https://tex.stackexchange.com/users/4427
682517
316,676
https://tex.stackexchange.com/questions/2441
874
I have some text in a table and I want to add a forced line break. I want to insert a forced line break without having to specify the column width, i.e. something like the following: ``` \begin{tabular}{|c|c|c|} \hline Foo bar & Foo <forced line break here> bar & Foo bar \\ \hline \end{tabular} ``` I know that `\\` inserts a line break in most cases, but here it starts a new table row instead. --- A similar question was asked before: [How to break a line in a table](https://tex.stackexchange.com/questions/485/how-to-break-a-line-in-a-table)
https://tex.stackexchange.com/users/375
How to add a forced line break inside a table cell
false
[This answer](https://tex.stackexchange.com/a/2442/250119) suggests using `p`-type column and `\newline` command. However, once you realize that `p`-type column is just typesetted in a `\parbox` (basically a vbox in plain TeX), a paragraph break works. So: ``` \documentclass{article} \begin{document} \begin{tabular}{p{3cm}p{3cm}} hello world&hello world \end{tabular} \end{document} ``` I'm not sure why nobody have suggested that given how [`⟨blank line⟩` is preferred over `\newline` or `\\` in normal text](https://tex.stackexchange.com/q/82664/250119). Perhaps it's because of semantic meaning -- you're unlikely to include a whole paragraph in a table cell. But if you do it may make sense. E.g. the example below includes 2 paragraphs in each table cell. ``` \documentclass{article} \usepackage{fullpage} \begin{document} \begin{tabular}{p{7cm}p{7cm}} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum. Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris. & Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum. Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris. \end{tabular} \end{document} ``` By default there's no first-line-indent, so the appearance should be identical to as if `\newline` is used. --- Another solution: [`\shortstack`](https://tex.stackexchange.com/a/38926/250119) (similar to the nested-tabular solution this does not require specifying explicit width)
2
https://tex.stackexchange.com/users/250119
682519
316,677
https://tex.stackexchange.com/questions/682174
2
I use tex4ebook with `\coverimage[someOptions]{AbsolutePath/someimage.jpg}` in the document, directly after `\begin{document}`. But the `AbsolutePath` is not respected and does not find someimage.jpg, respectively is not shown in the epub. As AbsolutePath I use something like `C:/Somepath/folder/anotherfolder/someimage.jpg`. But in the epub no image is shown. When I use `someimage.jpg` located in the current folder, where the `.tex` file is, it works and the someimage.jpg is shown in the epub. Only the absolute path is not showing the image in the epub. But of cource the someimage.jpg is located in the AbsolutePath folder. Is there anything to know that I miss? It seems as if the ``` \graphicpath{{PathA/}{PathB/}{C:/folder/anotherfolder/}} ``` does not work with tex4ebook. Though it was said, that all options with `\includegraphics[]{}` will work with `\coverimage[]{}`. Is there a fix to it?
https://tex.stackexchange.com/users/292824
tex4ebook and \coverimage[someOptions]{AbsolutePath/someimage.jpg} does not work
false
`tex4ebook` doesn't copy images, you need to do it using a build file. I've handled a similar case some time ago in [this answer](https://tex.stackexchange.com/a/656511/2891), but it doesn't work correctly with `tex4ebook`. Here is a fixed version, which also contains other DOM filter that you want to use: ``` local mkutils = require "mkutils" local domfilter = require "make4ht-domfilter" local allowed_chars = { ["-"] = true, ["."] = true } local function fix_colons(id) -- match every non alphanum character return id:gsub("[%W]", function(s) -- some characters are allowed, we don't need to replace them if allowed_chars[s] then return s end -- in other cases, replace with underscore return "_" end) end local function id_colons(obj) -- replace : characters in links and ids with unserscores obj:traverse_elements(function(el) local name = string.lower(obj:get_element_name(el)) if name == "a" then local href = el:get_attribute("href") -- don't replace colons in external links if href and not href:match("[a-z]%://") then local base, id = href:match("(.*)%#(.*)") if base and id then id = fix_colons(id) el:set_attribute("href", base .. "#" .. id) end end end local id = el:get_attribute("id") if id then el:set_attribute("id", fix_colons(id)) end end) return obj end local function fix_img_names(dom) for _, img in ipairs(dom:query_selector("img")) do local src = img:get_attribute("src") if src then -- remove path specification src = src:match("([^/]+)$") img:set_attribute("src", src) end end return dom end local process = domfilter {id_colons,fix_img_names} local function image_copy(path, parameters) -- get image basename local basename = path:match("([^/]+)$") -- if outdir is empty, keep it empty, otherwise add / separator local outdir = parameters.outdir == "" and "" or parameters.outdir .. "/" -- handle trailing // outdir = outdir:gsub("//$","/") local output_file = outdir .. basename for pos, name in pairs(Make.lgfile.files) do if name == path then Make.lgfile.files[pos] = output_file end end mkutils.cp(path, output_file) end Make:match("png$", function(path, parameters) image_copy(path, parameters) -- prevent further processing of the image return false end) Make:match("jpg$", function(path, parameters) image_copy(path, parameters) -- prevent further processing of the image return false end) if mode=="draft" then Make:htlatex {} else Make:htlatex {} Make:xindy {modules={"duden-utf8"}} Make:biber {} Make:htlatex {} Make:htlatex {} end Make:match("html$", process) ``` Details on how it works are in the link above.
1
https://tex.stackexchange.com/users/2891
682522
316,679
https://tex.stackexchange.com/questions/682504
5
I am trying to access some Russian TeX files, but when I open it in TeXstudio (or any other editor), the text is not readable. For example, this is a line from one file: > > Ќ ©¤гвбп «Ё в ЄЁҐ а §«Ёз­лҐ ўҐйҐб⢥­­лҐ зЁб«  $a$, $b$, $c$, зв® > Їап¬лҐ $y=ax+b$, $y=bx+c$, $y=cx+a$ ЇҐаҐбҐЄ овбп ў ®¤­®© в®зЄҐ? > > > In earlier topics in Stack Exchange, it has been advised to set the editor's font encoding from UTF-8 to windows-1251, but this doesn't seem to work in TeXstudio.
https://tex.stackexchange.com/users/294805
Unreadable Russian TeX files
false
The text seems to be encoded as CP866. According to [Wikipedia on this encoding](https://en.wikipedia.org/wiki/Code_page_866): > > Code page 866 (CCSID 866) (CP 866, "DOS Cyrillic Russian") is a code page used under DOS and OS/2 in Russia to write Cyrillic script. > > > You can re-encode it in for example Python: ``` mytext = "Ќ ©¤гвбп «Ё в ЄЁҐ а §«Ёз­лҐ ўҐйҐб⢥­­лҐ зЁб« $a$, $b$, $c$, зв® Їап¬лҐ $y=ax+b$, $y=bx+c$, $y=cx+a$ ЇҐаҐбҐЄ овбп ў ®¤­®© в®зЄҐ?" print(mytext.encode("cp1251").decode("cp866")) ``` The code first interprets the utf-8 sequence as single bytes (with cp1251, the 'standard' cyrillic encoding) and then maps those bytes into cp866. This prints (newline added for readability): ``` Н йдутся ли т кие р зличные вещественные числ $a$, $b$, $c$, что прямые $y=ax+b$, $y=bx+c$, $y=cx+a$ пересек ются в одной точке? ``` which translates as: ``` Are there different real numbers $a$, $b$, $c$ such that the lines $y=ax+b$, $y=bx+c$, $y=cx+a$ intersect in one point? ```
12
https://tex.stackexchange.com/users/89417
682524
316,681
https://tex.stackexchange.com/questions/438214
7
i get an error when i try to compile my document and it drives me crazy. I have a lot of citations from a bib file, and i always get the Error listed above which (how i understand it) means i have thin spaces in my bib file, but i cant figure out where they are supposed to be and the file is too large to check every space. I already corrected any present ä, ö, ü etc., so it has to be a problem with the spaces. I copied the bib-references with a citation tool directly from the articles, maybe that's the problem? But it seems idiotic to me to write the citations myself. Here's the Error again: Error: ! Package inputenc Error: Unicode char   (U+2009)(inputenc) not set up for use with LaTeX.See the inputenc package documentation for explanation.Type H for immediate help.... ...bliography[heading=bibempty,type=article] I have run it many times through biber (which gives me no errors), deleted aux, bbl and bcf files, checked the bib file many times for odd spacings to figure out where those thin spaces are, but i could not find the error. What is the best solution for this problem? I dont know how to make a proper MWE with the huge bib file of over 1000 lines, sry. Here are the packages i use: ``` \documentclass[12pt,fleqn,xcolor=dvipsnames]{book} \usepackage[top=3cm,bottom=3cm,left=3cm,right=3cm,headsep=10pt,a4paper]{geometry} % Page margins \usepackage[table]{xcolor} \usepackage{graphicx} \graphicspath{{Pictures/}} \usepackage{tikz} \usepackage[english,german]{babel} \usepackage{enumitem} \usepackage{avant} \usepackage{mathptmx} \usepackage{microtype} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[style=numeric,citestyle=numeric,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex} \usepackage{titletoc} \usepackage{fancyhdr} \usepackage{amsmath,amsfonts,amssymb,amsthm} \begin{document} \end{document} ``` I also have notations (with %) in my bib File to know which lines of the articles i cited. Could this cause the problems? For Example: ``` %[ab] In patients with NYHA class II or III CHF and LVEF of 35 percent or less, amiodarone has no favorable effect on survival, whereas single-lead, shock-only ICD therapy reduces overall mortality by 23 percent. @article{doi:10.1056/NEJMoa043399, author = {Bardy, Gust H. and Lee, Kerry L. and Mark, Daniel B. and Poole, Jeanne E. and Packer, Douglas L. and Boineau, Robin and Domanski, Michael and Troutman, Charles and Anderson, Jill and Johnson, George and McNulty, Steven E. and Clapp-Channing, Nancy and Davidson-Ray, Linda D. and Fraulo, Elizabeth S. and Fishbein, Daniel P. and Luceri, Richard M. and Ip, John H.}, title = {Amiodarone or an Implantable Cardioverter-Defibrillator for Congestive Heart Failure}, journal = {New England Journal of Medicine}, volume = {352}, number = {3}, pages = {225-237}, year = {2005}, doi = {10.1056/NEJMoa043399}, note ={PMID: 15659722}, URL = {https://doi.org/10.1056/NEJMoa043399}, eprint = {https://doi.org/10.1056/NEJMoa043399} } ```
https://tex.stackexchange.com/users/165811
! Package inputenc Error: Unicode char   (U+2009) (thin space)
false
Appreciate this is an old post but it's highly ranked on Google, so thought I'd add that as of VS Code 1.63 there is automatic highlighting of invisible unicode characters, such as `U+2009`. <https://code.visualstudio.com/updates/v1_63> Thanks to Mark on SO for pointing this out: <https://stackoverflow.com/a/70164173/12155200>
1
https://tex.stackexchange.com/users/232756
682538
316,687
https://tex.stackexchange.com/questions/682504
5
I am trying to access some Russian TeX files, but when I open it in TeXstudio (or any other editor), the text is not readable. For example, this is a line from one file: > > Ќ ©¤гвбп «Ё в ЄЁҐ а §«Ёз­лҐ ўҐйҐб⢥­­лҐ зЁб«  $a$, $b$, $c$, зв® > Їап¬лҐ $y=ax+b$, $y=bx+c$, $y=cx+a$ ЇҐаҐбҐЄ овбп ў ®¤­®© в®зЄҐ? > > > In earlier topics in Stack Exchange, it has been advised to set the editor's font encoding from UTF-8 to windows-1251, but this doesn't seem to work in TeXstudio.
https://tex.stackexchange.com/users/294805
Unreadable Russian TeX files
false
Well, I used <https://2cyr.com/decode/> to figure out what happened. In bash you can save your text as utf-8 file "t.txt" and call iconv ``` iconv -f utf-8 -t cp1251 t.txt | iconv -f cp866 -t utf-8 ``` It produces ``` Найдутся ли такие различные вещественные числ $a$, $b$, $c$, что прямые $y=ax+b$, $y=bx+c$, $y=cx+a$ пересекаются в одной точке? ``` числ should be числа, but other stuff looks good for me.
7
https://tex.stackexchange.com/users/52472
682561
316,694
https://tex.stackexchange.com/questions/682549
4
I'd like to learn basic TeX programming (as a programming language instead of a tool of typeset) systematically, but I find "the Tex Book" by Knuth spends much time on typeset matter. Is there a book that focuses on explicit Tex programming and goes deeper?
https://tex.stackexchange.com/users/270268
Is there a book explicitly about TeX programming?
false
[The TeXbook](https://www.ctan.org/pkg/texbook) is still a good source for pure TeX programming; just skip all the chapters that you don't care about. [Notes On Programming in TeX](http://mirrors.ctan.org/graphics/pgf/contrib/pgfplots/doc/TeX-programming-notes.pdf) is pretty much exactly what you describe. It's fairly short, and not really suited to a beginner, but it is very good. [TeX in a Nutshell](http://mirrors.ctan.org/info/tex-nutshell/tex-nutshell.pdf) is also a very good. It spends a lot of time describing how boxes and glue work, but I wouldn't really call this "typesetting". [@mickep mentioned](https://tex.stackexchange.com/questions/682549/is-there-a-book-explicitly-about-tex-programming#comment1693509_682549) [TeX by Topic](http://mirrors.ctan.org/info/texbytopic/TeXbyTopic.pdf). This is a good reference manual, but you really wouldn't want to use this to learn anything for the first time. The [macros category of TUGboat](https://tug.org/TUGboat/Contents/listkeyword.html#CatTAGMacros) is also a good source. These are all short articles generally on a single topic, but they often discuss material that you can't find anywhere else. Some of these are intended for beginners, while others are intended for *very* advanced users. In general though, I wouldn't recommend learning how to do pure "programming" tasks in TeX. If you ever need to do programming in TeX, you will have a much better time using either use Lua (via LuaTeX) or expl3.
6
https://tex.stackexchange.com/users/270600
682567
316,698
https://tex.stackexchange.com/questions/682504
5
I am trying to access some Russian TeX files, but when I open it in TeXstudio (or any other editor), the text is not readable. For example, this is a line from one file: > > Ќ ©¤гвбп «Ё в ЄЁҐ а §«Ёз­лҐ ўҐйҐб⢥­­лҐ зЁб«  $a$, $b$, $c$, зв® > Їап¬лҐ $y=ax+b$, $y=bx+c$, $y=cx+a$ ЇҐаҐбҐЄ овбп ў ®¤­®© в®зЄҐ? > > > In earlier topics in Stack Exchange, it has been advised to set the editor's font encoding from UTF-8 to windows-1251, but this doesn't seem to work in TeXstudio.
https://tex.stackexchange.com/users/294805
Unreadable Russian TeX files
false
A few characters may have become invalid (when trying to load it in the wrong encoding) and be removed by the system (or irreversibly replaced with another character) before you even pasted the code here. The original was apparently saved in CP866, and the unreadable code you posted was the result of an attempt to load it as Windows-1251. I found that every Cyrillic "а" (saved as CP866 but loaded as Windows-1251) becomes a no-break space character (ASCII: `0xa0`), which is then further replaced by a regular space when it is posted to some sites. If you have the original file, you can try opening the file in Notepad++ and choose Encoding > Character sets > Cyrillic > OEM 866, then you can copy/paste elsewhere with the proper encoding.
6
https://tex.stackexchange.com/users/277768
682574
316,701
https://tex.stackexchange.com/questions/3777
34
Often I'm trying to use a command in my document and it doesn't compile, because I haven't included the package I need for it. Of course, I know, that I can try to google it, but Google often finds some manuals and usage examples without package information (but this is probably because I don't know, how to google better). In all the cases I've succeeded in determining of the package name, but wasted more than 30 minutes in many of them. Which ways would you advise to search for package name? Which hints would you suggest?
https://tex.stackexchange.com/users/475
How to find a package name by a command name?
false
Since April 2023 there is TeXFindPkg, a tool that does it! On your terminal type: ``` texfindpkg query [<name>] ``` where `<name>` could be a file name, a command name, or an environment name. The tool was created to install TeX packages and their dependencies by file names, command names, or environment names. Its general usage is ``` texfindpkg <action> [<name>] ``` where `<action>` could be `install` or `query`, and `<name>` could be what is listed above. For example: ``` texfindpkg install array.sty texfindpkg install \fakeverb texfindpkg install {frame} texfindpkg query array.sty texfindpkg query \fakeverb texfindpkg query {frame} ``` TeXFindPkg supports both TeXLive and MiKTeX distributions. More info on <https://ctan.org/pkg/texfindpkg>.
4
https://tex.stackexchange.com/users/101651
682586
316,705
https://tex.stackexchange.com/questions/682539
2
My project has several tex files (a main one and one for each chapter). Each chapter has subdivisions (section, subsection). I make many cross-references using \label and \ref. So far I have been manually keeping track of which [sub]section points to which other chapter/[sub]section. Is there a program (or even a second tex file that I could compile) that reads all the tex files and provides me with a "map" (it can of course be textual rather than graphic) of these cross-references?
https://tex.stackexchange.com/users/91536
Is there a way to automatically make a "map" of cross references from tex files?
true
An idea using `todonotes` just thinking in sections, but probably can be adapated as well to check cross references to floats without many problems. ``` % need at least two runs !! \documentclass{scrartcl} \usepackage{geometry} \usepackage{lipsum} % for dummy text \usepackage[colorlinks,linkcolor=blue]{hyperref} \usepackage[colorinlistoftodos, size=tiny]{todonotes} % add "disable" to hide cross-references ! \setuptodonotes{fancyline, color=blue!30,shadow} \def\myref#1{\todo{Reference to \ref{#1} \nameref{#1} (label \texttt{#1}) in \currentname}\ref{#1}} \def\mylabel#1{\todo[color=red!30]{Label \texttt{#1} in \currentname}\label{#1}} \usepackage{nameref} \makeatletter \newcommand*{\currentname}{\@currentlabelname} \makeatother \begin{document} \tableofcontents % in real documents, better at the end: \listoftodos[Cross References and Labels] \section{Introduction} \mylabel{foo} \lipsum[1][1-3] See in \myref{bar}. \lipsum[2][1-3] See \myref{ssbar}. \lipsum[3-6] \subsection{Economic Impact} \mylabel{sfoo}\lipsum[1-5] See section \myref{foo} \subsubsection{Objectives} \mylabel{ssbar}\lipsum[1-5] \section{Discussion} \mylabel{bar}\lipsum[1-5] See section \myref{foo} \end{document} ```
3
https://tex.stackexchange.com/users/11604
682588
316,706
https://tex.stackexchange.com/questions/682583
0
I am trying to have my table fit the text width and be centered in the middle. Without minipage it works as intended but when I add a minipage to the adjustbox (since I need the caption and potential notes to also scale) the table goes outside of the right of the page. When I scale it down to not overflow it does not align in the middle. For other tables this code work fine but I can't figure out how to fix this. ``` \label{finsum} \caption{Financial Variables} \begin{adjustbox}{scale=1, max width = \textwidth , minipage=\textwidth} \centering \begin{tabular}{@{\extracolsep{5pt}}lccccccc} \\[-1.8ex]\hline \hline \\[-1.8ex] Statistic & \multicolumn{1}{c}{N} & \multicolumn{1}{c}{Mean} & \multicolumn{1}{c}{St. Dev.} & \multicolumn{1}{c}{Min} & \multicolumn{1}{c}{Pctl(25)} & \multicolumn{1}{c}{Pctl(75)} & \multicolumn{1}{c}{Max} \\ \hline \\[-1.8ex] Median earnings & 700 & 39,910.940 & 4,870.070 & 31,937 & 36,159.2 & 43,288.8 & 53,208 \\ Poverty rate & 700 & 12.995 & 2.951 & 6.590 & 10.848 & 15.145 & 22.100 \\ Households on public assistance & 700 & 2.556 & 0.935 & 1.080 & 1.890 & 3.080 & 6.860 \\ \hline \\[-1.8ex] \end{tabular} \end{adjustbox} \end{table} ```
https://tex.stackexchange.com/users/294857
Table with tabular goes outside of page and is not centered when minipage is added to adjustbox
false
Welcome to TeX.SE! Some comments: * Please provide a *full* MWE (compilable, small, reproduces (un)wanted behavior). * I simply pivoted your tabular. * Have a look at my usage of `siunitx`' `S` column type to align numbers at the decimal point. * I used `booktabs` which provide `top-/mid-/bottomrule` for professional rules with appropriate spacing. * See how to use `label` and `caption`. ``` \documentclass{article} \usepackage{siunitx,booktabs} \begin{document} \begin{table}[htbp] \centering \caption{Financial Variables} \label{finsum2} \begin{tabular}{lS[table-format=5.3]S[table-format=3.3]S[table-format=4.3]} \toprule Statistic & {Median earnings} & {Poverty rate} & {\parbox{2.7cm}{Households on\\public assistance}} \\ \midrule $N$ & 700 & 700 & 700 \\ Mean & 39910.940 & 12.995 & 2.556 \\ St. Dev. & 4870.070 & 2.951 & 0.935 \\ Min & 31937.000 & 6.590 & 1.080 \\ Pctl(25) & 36159.200 & 10.848 & 1.890 \\ Pctl(75) & 43288.800 & 15.145 & 3.080 \\ Max & 53208.000 & 22.100 & 6860.000 \\ \bottomrule \end{tabular} \end{table} Important: Put \texttt{label} \emph{after} \texttt{caption}: See \ref{finsum} which does not work and \ref{finsum2} which refers to the table. \end{document} ```
1
https://tex.stackexchange.com/users/237192
682589
316,707