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/688867 | 4 | I have the following problem. When trying to compile the code
```
\newcommand{\system}{$\displaystyle \left\{
\begin{aligned}
&y=0\\
&y^2=0\\
\end{aligned} \right.$}
\begin{center}
\begin{tabular}{c}
\newcommand{\sameas}{\\ \rotatebox{90}{$\Leftrightarrow$} \\}
$\displaystyle y=0$
\sameas
$\displaystyle y^2=0$
\sameas
\system
\sameas
\system
\sameas
$\displaystyle y=0$
\end{tabular}
\end{center}
```
LaTeX displays the first call to `\sameas` correctly, but says it doesn't know what `\sameas` is in the following calls. Why does it suddenly forget the definition of `\sameas`?
Here's the error message:
```
l.94 \sameas
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
```
I'm using Overleaf.
| https://tex.stackexchange.com/users/299203 | Why does LaTeX forget commands when their code is between two \\ signs? | true | A table or alignment cell is a *tex group*, so
```
.... & \newcommand\foo{???} & \foo
```
is like
```
.... { \newcommand\foo{???} } \foo
```
and all non global assignments are discarded at a group end.
| 11 | https://tex.stackexchange.com/users/1090 | 688868 | 319,569 |
https://tex.stackexchange.com/questions/688812 | 2 | I made a graph using the tikz package and want to use the tikzducks package to make vertices of the graph. (In particular, I want to replace the points at vertices of an arbitrary graph with colored ducks). Is this possible?
Here is my code:
```
\begin{tikzpicture}[node distance={15mm}, thick, main/.style = {draw, circle}]
\node[main] (1) {};
\node[main] (2) [above right of=1] {} ;
\node[main] (3) [below right of=1] {} ;
\node[main] (4) [above right of=3] {} ;
\node[main] (5) [above right of=4] {} ;
\node[main] (6) [below right of=4] {} ;
\draw (1) -- (2);
\draw (1) -- (3);
\draw (1) to [out=135,in=90,looseness=1.5] (5);
\draw (1) to [out=180,in=270,looseness=5] (1);
\draw (2) -- (4);
\draw (3) -- (4);
\draw (5) -- (4);
\draw (5) to [out=315, in=315, looseness=2.5] (3);
\draw (6) -- node[midway, above right, sloped, pos=1] {} (4);
\end{tikzpicture}
```
| https://tex.stackexchange.com/users/299162 | Combining environments in two packages? | true | In addition to the normal `tikzducks` package, there is also a tikz library which allows you to use the ducks as tikz `pic`s:
```
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,ducks}
\begin{document}
\begin{tikzpicture}[
node distance={15mm},
thick, main/.style = {},
quack/.style = {scale=0.15,xshift=-0.8cm,yshift=-0.8cm}
]
\node[main] (1) {};
\node[main] (2) [above right of=1] {} ;
\node[main] (3) [below right of=1] {} ;
\node[main] (4) [above right of=3] {} ;
\node[main] (5) [above right of=4] {} ;
\node[main] (6) [below right of=4] {} ;
\pic[quack] at (1) {duck};
\pic[quack] at (2) {duck};
\pic[quack,duck/body=red] at (3) {duck};
\pic[quack] at (4) {duck};
\pic[quack,duck/body=green] at (5) {duck};
\pic[quack] at (6) {duck};
\draw (1) -- (2);
\draw (1) -- (3);
\draw (1) to [out=135,in=90,looseness=1.5] ([yshift=7pt]5);
\draw (1) to [out=180,in=270,looseness=5] (1);
\draw (2) -- (4);
\draw (3) -- (4);
\draw (5) -- (4);
\draw (5) to [out=315, in=315, looseness=2.5] (3);
\draw (6) -- node[midway, above right, sloped, pos=1] {} (4);
\end{tikzpicture}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/36296 | 688878 | 319,572 |
https://tex.stackexchange.com/questions/688874 | 1 | When I run my markdown file through Pandoc, this line...
`# First Book: The Person`
becomes...
`\section{First Book: The Person}\label{first-book-the-person}}`
What I want is...
`\part{First Book: The Person}\label{first-book-the-person}}`
...but I can't find information on how to map a sequence of hashtags onto a different LaTeX heading than the default.
| https://tex.stackexchange.com/users/64356 | How do I map markdown headings onto LaTeX headings? | true | One problem, linked in the comment, is that you do not specify the `top-level-division`, but another is that the top level in your converted document is `\section`, and therefore you are converting to the default `article` document class, or using a custom template, or a document class option to convert to some other article-like document class.
In classes where `\chapter` is not defined, you cannot rise the top level division, since including this command you will obtain a "undefined control sequence" fatal error. Therefore, the easiest solution is use a book-like document class where this command exist. With quarto markdown, a MWE could be:
```
---
format: pdf
toc: true
toc-depth: 6
top-level-division: part
documentclass: book
---
# Foo1
Text
## Foo2
Text
### Foo3
Text
#### Foo4
Text
##### Foo5
Text
###### Foo6
Text
####### Foo7
Text
```
Note 1: Although the ToC depth is 6, it will show the 7 levels because the optional part level is 0, not 1.
Note 2: If you want the 7 levels, but with the article-like layout, both `memoir` a `scrbook` classes have options for that.
| 1 | https://tex.stackexchange.com/users/11604 | 688885 | 319,575 |
https://tex.stackexchange.com/questions/688887 | 2 | How to align the equations inside the widetext
environment as given in the following code?
```
\documentclass[twocolumn,float fix, prb, aps, showpacs]{revtex4-2}
\usepackage{graphicx,amsmath,amssymb,color}
\usepackage{nicefrac}
\usepackage{multirow,array,booktabs}
\usepackage{mathtools}
\usepackage{bbm}
\usepackage{mathrsfs}
\begin{document}
Random textRandom textRandom textRandom textRandom textRandom
Random textRandom textRandom textRandom textRandom text
Random textRandom textRandom textRandom textRandom textRandom text
\begin{widetext}
\begin{align*}
&\left.
\begin{aligned}
\Big\langle\Phi_{\mathbf{K}}\Big|&=\Big(|0,X\rangle,0\Big), \quad\\
\Big\langle\Phi_{\mathbf{K}}\Big|&=\Big(|0,X\rangle,0\Big), \quad\\
\vdots \\
\Big\langle\Phi_{\mathbf{K}}\Big|&=\Big(|0,X\rangle,0\Big), \quad
\end{aligned}
\right\}
\begin{aligned}
&\text{text text text text}\\
&E_{\mathcal{N}=0}=E_{\mathcal{N}=0}= \dots=E_{\mathcal{N}=0}=0
\end{aligned}
\\
\begin{aligned}
\langle\Phi|= \frac{1}{\sqrt{2}}\big({-}|\mathcal{N},X\rangle,~|\mathcal{N}{-}J,X\rangle\big)\\
\langle\Phi|= \frac{1}{\sqrt{2}}\big({-}|\mathcal{N},X\rangle,~|\mathcal{N}{-}J,X\rangle\big)
\end{aligned}
\end{align*}
\end{widetext}
Random textRandom textRandom textRandom textRandom textRandom
Random textRandom textRandom textRandom textRandom text
Random textRandom textRandom textRandom textRandom textRandom text
\end{document}
```
| https://tex.stackexchange.com/users/299219 | How to properly align equations in widetext environment | true | You forgot to place an alignment anchor `&` before the second `aligned`. I've made some minor other updates as well.
```
\documentclass[twocolumn]{revtex4-2}
\usepackage{mathtools}
\begin{document}
Random textRandom textRandom textRandom textRandom textRandom
Random textRandom textRandom textRandom textRandom text
Random textRandom textRandom textRandom textRandom textRandom text
\begin{widetext}
\vspace{-\baselineskip}
\begin{align*}
& \left.\begin{aligned}
\bigl\langle \Phi_{\mathbf{K}} \bigm| &= \bigl( | 0, X \rangle, 0 \bigr), \quad \\
\bigl\langle \Phi_{\mathbf{K}} \bigm| &= \bigl( | 0, X \rangle, 0 \bigr), \\
&\vdotswithin{=} \\
\bigl\langle \Phi_{\mathbf{K}} \bigm| &= \bigl( | 0, X \rangle, 0 \bigr),
\end{aligned}
\right\}
\begin{aligned}
& \text{text text text text} \\
& E_{\mathcal{N} = 0} = E_{\mathcal{N} = 0} = \dots = E_{\mathcal{N} = 0} = 0
\end{aligned} \\
& \kern\nulldelimiterspace\, \begin{aligned}
\bigl\langle \Phi \bigm| = \frac{1}{\sqrt{2}} \bigl( {-}| \mathcal{N}, X \rangle, |\mathcal{N}{-}J, X \rangle \bigr) \\
\bigl\langle \Phi \bigm| = \frac{1}{\sqrt{2}} \bigl( {-}| \mathcal{N}, X \rangle, |\mathcal{N}{-}J, X \rangle \bigr)
\end{aligned}
\end{align*}
\end{widetext}
Random textRandom textRandom textRandom textRandom textRandom
Random textRandom textRandom textRandom textRandom text
Random textRandom textRandom textRandom textRandom textRandom text
\end{document}
```
| 1 | https://tex.stackexchange.com/users/5764 | 688889 | 319,576 |
https://tex.stackexchange.com/questions/688898 | 0 | I am looking for a way to simply multiply all the components in a skip expression ( the natural length plus the plus-length minus the minus-length ) by the same number. I've tried some examples in my MWE below without success. Of course, I could just create 3 different dimen expressions, then multiply each dimen expression by a number, and then input each result into the skip expression, but I'm looking for an easier, more convenient solution. In my MWE, `\skip_show:N` displays only the natural length when it doesn't produce an error.
```
\documentclass{article}
\ExplSyntaxOn
\skip_const:Nn \c_mymodule_myskipi_skip { 36pt plus 18pt minus 12pt }
\skip_const:Nn \c_mymodule_myskipii_skip
{
%\fp_eval:n { 0.8333 } \c_mymodule_myskipi_skip
%\c_mymodule_myskipi_skip * \fp_eval:n { 0.8333 }
%\skip_eval:n { \fp_eval:n { 0.8333 } \c_mymodule_myskipi_skip }
\skip_eval:n { \c_mymodule_myskipi_skip * \fp_eval:n { 0.8333 } }
}
\skip_show:N \c_mymodule_myskipii_skip
\ExplSyntaxOff
\begin{document}
text
\end{document}
```
| https://tex.stackexchange.com/users/278534 | How to multiply all the components of a skip length by the same number? | true | At the primitive level you want `\multiply` or `\glueexpr`
```
\baselineskip=20pt plus 5pt minus 2pt
\showthe\baselineskip
\multiply\baselineskip by 2
\showthe\baselineskip
\baselineskip=\glueexpr(\baselineskip * 10)\relax
\showthe\baselineskip
\bye
```
Produces
```
> 20.0pt plus 5.0pt minus 2.0pt.
l.4 \showthe\baselineskip
?
> 40.0pt plus 10.0pt minus 4.0pt.
l.8 \showthe\baselineskip
?
> 400.0pt plus 100.0pt minus 40.0pt.
l.12 \showthe\baselineskip
```
`expl3` uses `\glueexpr` so:
```
\documentclass{article}
\ExplSyntaxOn
\skip_const:Nn \c_mymodule_myskipi_skip { 36pt plus 18pt minus 12pt }
\skip_const:Nn \c_mymodule_myskipii_skip
{
\skip_eval:n { ( \c_mymodule_myskipi_skip * 25 )/30 }
}
\skip_show:N \c_mymodule_myskipii_skip
\ExplSyntaxOff
\begin{document}
text
\end{document}
```
producing
```
> \c_mymodule_myskipii_skip=30.0pt plus 15.0pt minus 10.0pt.
<recently read> }
l.8 \skip_show:N \c_mymodule_myskipii_skip
?
```
or more simply (as evaluation is implicit)
```
\documentclass{article}
\ExplSyntaxOn
\skip_const:Nn \c_mymodule_myskipi_skip { 36pt plus 18pt minus 12pt }
\skip_const:Nn \c_mymodule_myskipii_skip
{
( \c_mymodule_myskipi_skip * 25 )/30
}
\skip_show:N \c_mymodule_myskipii_skip
\ExplSyntaxOff
\begin{document}
text
\end{document}
```
| 2 | https://tex.stackexchange.com/users/1090 | 688902 | 319,580 |
https://tex.stackexchange.com/questions/688896 | 0 | I encountered a bug between `natbib`'s `sort&compress` and the `backrefalt` feature to locate the section of citation in the bib.
Here is a short template to reproduce the error:
```
\documentclass[11pt]{article}
\usepackage[square,comma,numbers,sort&compress]{natbib}
\usepackage[breaklinks=true,pagebackref]{hyperref}
\renewcommand*{\backref}[1]{}
\renewcommand*{\backrefalt}[4]{
\ifcase #1 %
(Not cited.) %
\or
{(Referenced on page #2.)}%
\else
{(Referenced on pages #2.)}%
\fi
}
\renewcommand*{\backrefsep}{, }
\renewcommand*{\backreftwosep}{ and }
\renewcommand*{\backreflastsep}{, and }
\begin{document}
\cite{cite1,cite2,cite3}
\bibliographystyle{plainnat}
\bibliography{my}
\end{document}
```
assuming three consecutive citations `cite1,cite2,cite3` in `my.bib`. The result will appear as *[1-3]*, and the citation 2 will appear as *(Not cited)*.
I switched from `sort&compress` to `sort` to avoid this bug, but is there a way to have both the compress and the correct back references?
| https://tex.stackexchange.com/users/18560 | bug with backrefalt and natbib's sort&compress | true | You could try this patch:
```
\documentclass[11pt]{article}
\usepackage[square,comma,numbers,sort&compress]{natbib}
\usepackage[breaklinks=true,pagebackref]{hyperref}
\renewcommand*{\backref}[1]{}
\renewcommand*{\backrefalt}[4]{
\ifcase #1 %
(Not cited.) %
\or
{(Referenced on page #2.)}%
\else
{(Referenced on pages #2.)}%
\fi
}
\renewcommand*{\backrefsep}{, }
\renewcommand*{\backreftwosep}{ and }
\renewcommand*{\backreflastsep}{, and }
\usepackage{etoolbox}
\makeatletter
\patchcmd\NAT@citexnum{\let\NAT@last@num\NAT@num}{\MakeLinkTarget[cite]{}\Hy@backout{\@citeb\@extra@b@citeb}\let\NAT@last@num\NAT@num}{}{\fail}
\makeatother
\begin{document}
\cite{doody,herrmann,angenendt}
\bibliographystyle{plainnat}
\bibliography{biblatex-examples}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/2388 | 688905 | 319,581 |
https://tex.stackexchange.com/questions/688904 | 0 | Today I am using \hfill to make two column in one page, when the code write like this:
```
\begin{minipage}[t]{0.25\textwidth}
\end{minipage}
\hfill
\begin{minipage}[t]{0.73\textwidth}
\end{minipage}
```
the document works fine, but when I put a new line like this:
```
\begin{minipage}[t]{0.25\textwidth}
\end{minipage}
\hfill
\begin{minipage}[t]{0.73\textwidth}
\end{minipage}
```
the two columns did not work. why the docs command \hfill could not handle the space of the docs?
| https://tex.stackexchange.com/users/69600 | why the \hfill command could not handle the newline | true | You say that the first works, but it really doesn't.
```
\documentclass{article}
\usepackage{lipsum} % to provide content
\usepackage{showframe} % to show the page margins
\begin{document}
\begin{minipage}[t]{0.25\textwidth}
\lipsum[1][1-2]
\end{minipage}
\hfill
\begin{minipage}[t]{0.73\textwidth}
\lipsum[2][1-5]
\end{minipage}
\end{document}
```
You get `Overfull \hbox (10.32074pt too wide)`, because the left minipage is preceded by the standard indent. What you get is a normal interword space between the two minipages and an overfull line. The interword space is due to the endline after the first `\end{minipage}`. Compare with
```
\documentclass{article}
\usepackage{lipsum} % to provide content
\usepackage{showframe} % to show the page margins
\begin{document}
\noindent
\begin{minipage}[t]{0.25\textwidth}
\lipsum[1][1-2]
\end{minipage}\hfill
\begin{minipage}[t]{0.73\textwidth}
\lipsum[2][1-5]
\end{minipage}
\end{document}
```
Note that the endline is no more, because `\hfill` will ignore the following endline.
What happens if you leave a blank line before `\hfill`? This ends a paragraph consisting of the indentation and the first minipage. Then a new paragraph is started, with the standard indent, the `\hfill` and the second minipage.
```
\documentclass{article}
\usepackage{lipsum} % to provide content
\usepackage{showframe} % to show the page margins
\begin{document}
\begin{minipage}[t]{0.25\textwidth}
\lipsum[1][1-2]
\end{minipage}
\hfill
\begin{minipage}[t]{0.73\textwidth}
\lipsum[2][1-5]
\end{minipage}
\end{document}
```
Never leave a blank line if you don't want to end a paragraph. And keep a careful watch on spaces and endlines.
| 4 | https://tex.stackexchange.com/users/4427 | 688909 | 319,583 |
https://tex.stackexchange.com/questions/688908 | 1 | I have created a `.pdf` image using `tikz` in a separate, `standalone` class document, then converted it independently to a `.png` file and saved it in the same folder as my `exam` class document. I can preview it separately just fine, so I know the original `.pdf` was compiled correctly. However, upon compilation of the `exam` class file, a blank image is showing. Here's a MWE:
```
\documentclass[
answers
]{exam}
\usepackage{graphicx}
\usepackage{caption}
\begin{document}
\begin{questions}
\question Hello
\ifprintanswers
\begin{minipage}[h!]{\linewidth}
\centering
\includegraphics[width=0.5\textwidth,height=0.3\textheight,natwidth=1,natheight=1]{./circuito_C.png}
\captionof{figure}{Il circuito \(C\).}
\label{fig:circuito_C}
\end{minipage}
\fi
\end{questions}
\end{document}
```
When I load `graphicx` with the `demo` option, a black square of the correct size shows in place of the image. What's wrong?
| https://tex.stackexchange.com/users/95092 | Exam class: figure not showing up? | true | This seems to work for me, options `natwidth` and `nathweight` removed and using the `graphicx` option for example image:
```
\documentclass[answers]{exam}
\usepackage{graphicx}
\usepackage{caption}
\begin{document}
\begin{questions}
\question Hello
\ifprintanswers
\begin{minipage}[h!]{\linewidth}
\centering
\includegraphics[width=0.5\textwidth,height=0.3\textheight]{example-image-a}
\captionof{figure}{Il circuito \(C\).}
\label{fig:circuito_C}
\end{minipage}
\fi
\end{questions}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/269938 | 688912 | 319,585 |
https://tex.stackexchange.com/questions/687484 | 1 | I'm using `chapterbib` for a long document and the creation of bibliographies for each chapter works fine.
Each chapter is in its own file that gets `included`.
Is there any option to split the chapter files by, e.g., section?
Using `input` does not work as it seems and nesting `includes` is forbidden.
Any known workaround? Could `cbunit` or `cbinput` solve this?
I'm not sure how they'd work here.
Thanks!
EDIT - MWE:
* `./main.txt`
```
\documentclass[a4paper,10pt,twoside,onecolumn,openright,final,titlepage]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tocbibind}
%\usepackage[rootbib]{chapterbib}
\usepackage[sectionbib]{chapterbib}
\bibliographystyle{plain}
\usepackage[english]{babel}
\usepackage[pagebackref=true]{hyperref}
\usepackage{blindtext}
\renewcommand*{\backref}[1]{} % Internally redefine backref in order to display
\renewcommand*{\backrefalt}[4]{[{\small% the pages a reference was cited
\ifcase #1 Not cited.%
\or Cited on page~#2.%
\else Cited on pages #2.%
\fi%
}]}
\begin{document}
\tableofcontents
\include{chapters/chpt_1}
\include{chapters/chpt_2}
\chapter{Bibliography}
%Don't add a section to the toc
\renewcommand{\addcontentsline}[3]{}
%Don't add a title to the bibliography
\renewcommand{\bibname}{}
\bibliography{mybib}
\end{document}
```
* `./chapters/chpt_1.tex`:
```
\chapter{Test}
\section{First}
\blindtext[10]
\cite{mathworld:AssociatedLaguerrePolynomial}
\section{Second}
\blindtext[8]
\cite{mathworld:AssociatedLegendreDifferentialEquation,mathworld:AssociatedLaguerrePolynomial}
\bibliographystyle{plain}
\bibliography{../mybib}
```
* `./chapters/chpt_2.tex`
```
\chapter{Test}
\section{First}
\blindtext[10]
\cite{Weisstein}
\section{Second}
\blindtext[8]
\cite{Weissteina}
\section{Third}
\blindtext[6]
\cite{Weissteinb}
\bibliographystyle{plain}
\bibliography{../mybib}
```
* `mybib.bib`
```
% Encoding: UTF-8
@Misc{mathworld:AssociatedLaguerrePolynomial,
Title = {{Associated Laguerre Polynomial. From MathWorld---A Wolfram Web Resource \url{http://mathworld.wolfram.com/AssociatedLaguerrePolynomial.html}}},
Author = {Weisstein, Eric W.},
Note = {Last visited on 16/03/2016}
}
@Misc{mathworld:AssociatedLegendreDifferentialEquation,
Title = {{Associated Legendre Differential Equation. From MathWorld---A Wolfram Web Resource \url{http://mathworld.wolfram.com/AssociatedLegendreDifferentialEquation.html}}},
Author = {Weisstein, Eric W.},
Note = {Last visited on 16/03/2016}
}
@Misc{Weisstein,
author = {Weisstein, Eric W.},
note = {Last visited on 16/03/2016},
title = {{Wigner 3j-Symbol. From MathWorld---A Wolfram Web Resource \url{http://mathworld.wolfram.com/Wigner3j-Symbol.html}}},
}
@Misc{Weissteina,
author = {Weisstein, Eric W.},
note = {Last visited on 16/03/2016},
title = {{Wigner 6j-Symbol. From MathWorld---A Wolfram Web Resource \url{http://mathworld.wolfram.com/Wigner6j-Symbol.html}}},
}
@Misc{Weissteinb,
author = {Weisstein, Eric W.},
note = {Last visited on 16/03/2016},
title = {{Wigner 9j-Symbol. From MathWorld---A Wolfram Web Resource \url{http://mathworld.wolfram.com/Wigner9j-Symbol.html}}},
}
```
To compile:
1. `pdflatex main.tex` generates the chapter `aux` files
2. `cd chapters; bibtex chpt_1.aux; bibtex chpt_2.aux; cd -`
3. comment out `sectionbib`; uncomment `rootbib`
4. `pdflatex main.tex; bibtex main.aux; pdflatex main.tex; pdflatex main.tex`
This get's us a two entry bibliograpgy in chapter 1, a three entry bibliograpgy in chapter 2, and a five entry bibliograpgy at the end.
For ease of writing - and versioning - I'd like to have each section of each chapter in its own tex-file - if that makes sense.
| https://tex.stackexchange.com/users/118150 | chapterbib with subfiles for sections | false | For the sake of completeness regarding [the great answer of alchemist](https://tex.stackexchange.com/a/688048/262081), here a solution with chapter bibliographies and a global bibliography which print only the references cited in the document (not all the references contained in the bib file).
It uses the `refsegment=chapter` option of `biblatex` package (no need for `\begin{refsection}...\end{refsection}` environment anymore, taken from [ebosi's answer](https://tex.stackexchange.com/a/390639/262081)) and the option `segment=\therefsegment` for the
`\printbibliography` command, in each chapter you want a chapbib, in order to print only the cited references of the current `refsegment` (which corresponds to a chapter in this case).
A MWE (shamefully inspired by [alchemist's answer](https://tex.stackexchange.com/a/688048/262081)):
```
\documentclass{book}
\usepackage{import}
\begin{filecontents}{ref.bib}
@Misc{ref1,
Title = {Ref1 title},
Author = {Ref1 text}
}
@Misc{ref2,
Title = {Ref2 title},
Author = {Ref2 text}
}
@Misc{ref3,
Title = {Ref3 title},
Author = {Ref3 text}
}
@Misc{ref4,
Title = {Ref4 title},
Author = {Ref4 text}
}
\end{filecontents}
\usepackage[refsegment=chapter, backend=biber]{biblatex}
\addbibresource{ref.bib}
\begin{filecontents}{chapters/chapter1/chapter1.tex}
\chapter{A chapter}
\cite{ref1}
\subimport{sections}{section1}
\printbibliography[heading=subbibintoc,segment=\therefsegment, title=Chapter bibliography]
\end{filecontents}
\begin{filecontents}{chapters/chapter1/sections/section1.tex}
\section{A section}
\cite{ref2}
\end{filecontents}
\begin{filecontents}{chapters/chapter2/chapter2.tex}
\chapter{A second chapter}
\subimport{sections}{section1}
\printbibliography[heading=subbibintoc,segment=\therefsegment, title=Chapter bibliography]
\end{filecontents}
\begin{filecontents}{chapters/chapter2/sections/section1.tex}
\section{A section}
\cite{ref3}
\end{filecontents}
\begin{document}
\tableofcontents
\import{chapters/chapter1}{chapter1}
\import{chapters/chapter2}{chapter2}
\printbibliography[heading=bibintoc,title={Global bibliography}]
\end{document}
```
As pointed in [comment](https://tex.stackexchange.com/questions/687484/chapterbib-with-subfiles-for-sections/688048#comment1707295_688048), if you store the sections tex files in the chapter folder then use `\subimport{./}{section1}` in place of `\subimport{sections}{section1}`.
Result in both cases (note that the reference `ref4` is not printed in the global bib because it is not cited in the document):
| 1 | https://tex.stackexchange.com/users/262081 | 688915 | 319,587 |
https://tex.stackexchange.com/questions/688893 | 0 | I have a MWE as following.I build a matrix whose first column is 1's; second column is the square of each component of x; third column is the cube of the x component, and so on. I need to use `tikzmath` for another reasons.
When `xi` is small (`x<10`), work very well; however, when `xi` is negative or large (`x>100`), the problems occurs.
I can't work with sizes bigger than about 19 feet.
Continue and I'll use the largest value I can.```
```
\documentclass[tikz,border=5mm]{article}
\usepackage{tikz,pgfplots}
\usepackage{xfp}
\usepackage{fp}
\usetikzlibrary{fixedpointarithmetic}
\usetikzlibrary{math}
\begin{document}
\tikzmath{
\p=12;%número de pontos fornecidos
\q=4;%número de parâmetros a serem ajustados
\X{1}=-100;
\X{2}=110;
\X{3}=120;
\X{4}=130;
%
function phi1(\x){%Funções da base
\y = 1;
return \y;
};
function phi2(\x){%Funções da base
\y = \x;
return \y;
};
%
function phi3(\x){%Funções da base
\y = \x*\x;
return \y;
};
%
function phi4(\x){%Funções da base
\y = \x*\x*\x;
return \y;
};
%
function G(\x) {
\u = phi1(\x);
\v = phi2(\x);
\w = phi3(\x);
\z = phi4(\x);
return {\u,\v,\w,\z};
};
real \Matriz; int \i; int \j;
for \i in {1,...,4}{
for \j in {1,...,4}{
\Matriz{\i,\j}={G(\X{\i})}[\fpeval{\j-1}];
};
};
}
A matriz $A$ é dada por: \\
$
A=\left[
\begin{array}{cccc}
\Matriz{1,1}&\Matriz{1,2} & \Matriz{1,3} & \Matriz{1,4}\\
\Matriz{2,1}&\Matriz{2,2} & \Matriz{2,3} & \Matriz{2,4}\\
\Matriz{3,1}&\Matriz{3,2} & \Matriz{3,3} & \Matriz{3,4}\\
\Matriz{4,1}&\Matriz{4,2} & \Matriz{4,3} & \Matriz{4,4}\\
\end{array}
\right]
$
\end{document}
```
I have tried the library `fixedarithmeticpoint` but not solved.
The problem is the line `\Matriz{\i,\j}={G(\X{\i})}[\fpeval{\j-1}];`, but I am not how can I solve this, and why this occurs for only large and negative numbers.
Anyone can help me please?
| https://tex.stackexchange.com/users/205932 | Problems with large numbers in Tikzmath | false | As `tikzmath` is limited in calculations due to TeX capacity. I propose using Asymptote or Python for calculations (*a piece of cake*); and then embbeded into LaTeX document (it's not *a piece of cake*, I must test more, and please comment to suggest me, since this thing is helpful for other situation).
**1. Calculation with Asymptote**
```
// Run on http://asymptote.ualberta.ca/
real[] x={-100,110,120,-130};
int n=x.length; write('n = ',x.length);
real G(int i, real t) {return t^i;};
// initialisation A as the identity
real[][] A=identity(n);
for(int i=0; i<n; ++i)
for(int j=0; j<n; ++j)
A[i][j]=G(j,x[i]);
write('Now the matrix A is given by: ');
write(A);
```
| 0 | https://tex.stackexchange.com/users/140722 | 688916 | 319,588 |
https://tex.stackexchange.com/questions/688893 | 0 | I have a MWE as following.I build a matrix whose first column is 1's; second column is the square of each component of x; third column is the cube of the x component, and so on. I need to use `tikzmath` for another reasons.
When `xi` is small (`x<10`), work very well; however, when `xi` is negative or large (`x>100`), the problems occurs.
I can't work with sizes bigger than about 19 feet.
Continue and I'll use the largest value I can.```
```
\documentclass[tikz,border=5mm]{article}
\usepackage{tikz,pgfplots}
\usepackage{xfp}
\usepackage{fp}
\usetikzlibrary{fixedpointarithmetic}
\usetikzlibrary{math}
\begin{document}
\tikzmath{
\p=12;%número de pontos fornecidos
\q=4;%número de parâmetros a serem ajustados
\X{1}=-100;
\X{2}=110;
\X{3}=120;
\X{4}=130;
%
function phi1(\x){%Funções da base
\y = 1;
return \y;
};
function phi2(\x){%Funções da base
\y = \x;
return \y;
};
%
function phi3(\x){%Funções da base
\y = \x*\x;
return \y;
};
%
function phi4(\x){%Funções da base
\y = \x*\x*\x;
return \y;
};
%
function G(\x) {
\u = phi1(\x);
\v = phi2(\x);
\w = phi3(\x);
\z = phi4(\x);
return {\u,\v,\w,\z};
};
real \Matriz; int \i; int \j;
for \i in {1,...,4}{
for \j in {1,...,4}{
\Matriz{\i,\j}={G(\X{\i})}[\fpeval{\j-1}];
};
};
}
A matriz $A$ é dada por: \\
$
A=\left[
\begin{array}{cccc}
\Matriz{1,1}&\Matriz{1,2} & \Matriz{1,3} & \Matriz{1,4}\\
\Matriz{2,1}&\Matriz{2,2} & \Matriz{2,3} & \Matriz{2,4}\\
\Matriz{3,1}&\Matriz{3,2} & \Matriz{3,3} & \Matriz{3,4}\\
\Matriz{4,1}&\Matriz{4,2} & \Matriz{4,3} & \Matriz{4,4}\\
\end{array}
\right]
$
\end{document}
```
I have tried the library `fixedarithmeticpoint` but not solved.
The problem is the line `\Matriz{\i,\j}={G(\X{\i})}[\fpeval{\j-1}];`, but I am not how can I solve this, and why this occurs for only large and negative numbers.
Anyone can help me please?
| https://tex.stackexchange.com/users/205932 | Problems with large numbers in Tikzmath | false | ### answer with a real "matrix" storage
```
\documentclass[border=5mm]{standalone}
\usepackage{xintexpr}
\begin{document}
% store once and for all data for access
\xintAssignArray{-100}{110}{120}{130}\to\X
% store all computations for doing them only once
% syntax for retreival: \Matriz{i,j} where i = line, j = column starting at 1
\makeatletter
\newcommand\Matriz[1]{\Matriz@#1;}
\def\Matriz@#1#2,#3#4;{\csname
% using \numexpr here to allow \Matriz{3,1+2} syntax
% although usefulness is somewhat doubtful, but this
% can however also be used with LaTeX \value{counter}, which
% may be more useful
Matriz\the\numexpr#1#2,\the\numexpr#3#4;\endcsname}
% line index, column index;
\xintFor#1 in {1, 2, 3, 4}\do{% #1 = line index
\xintFor#2 in {1, 2, 3, 4}\do{% #2 = column index
% use "column index minus 1" as exponent
% let us not forget parentheses in case #1 is negative
\expandafter\edef\csname Matriz#1,#2;\endcsname{\xinteval{(\X{#1})^(#2-1)}}%
}%
}
\makeatother
A matriz $A$ é dada por: \\
$
A=\left[
\begin{array}{cccc}
\Matriz{1,1}&\Matriz{1,2} & \Matriz{1,3} & \Matriz{1,4}\\
\Matriz{2,1}&\Matriz{2,2} & \Matriz{2,3} & \Matriz{2,4}\\
\Matriz{3,1}&\Matriz{3,2} & \Matriz{3,3} & \Matriz{3,4}\\
\Matriz{4,1}&\Matriz{4,2} & \Matriz{4,3} & \Matriz{4,4}
\end{array}
\right]
$
\end{document}
```
### initial answer
(see a corrigendum at bottom of answer, in particular for sign in first row due to missing parentheses in the code)
You seem to need computations beyond the TeX built-in abilities (roughly up to 16383.99999 if using TeX capabilities for fixed-point evaluations). If remaining beyond a total of 16 digits of precisions, LaTeX now incorporates out of the box the `xfp` abilities. But with powers of integers for example `1234^6` you need more than 16 digits of precision.
Some people have extended TeX with arbitrary precision calculations, I know of bigintcalc (only integers), apnum, and xint. Here is an approach via xint:
```
\documentclass[border=5mm]{standalone}
\usepackage{xintexpr}
\begin{document}
\xintAssignArray{-100}{110}{120}{130}\to\X
\makeatletter
\newcommand\Matriz[1]{\Matriz@#1;}
% this stuff with #1#2 and #3#4 is only to allow space tokens
% in reasonable places in input,
% but I don't think they would matter (one would have to ask
% an xint knowledgeable user)
\def\Matriz@#1#2,#3#4;{\xinteval{\X{#1#2}^(#3#4)}}
\makeatother
A matriz $A$ é dada por: \\
$
A=\left[
\begin{array}{cccc}
\Matriz{1,1}&\Matriz{1,2} & \Matriz{1,3} & \Matriz{1,4}\\
\Matriz{2,1}&\Matriz{2,2} & \Matriz{2,3} & \Matriz{2,4}\\
\Matriz{3,1}&\Matriz{3,2} & \Matriz{3,3} & \Matriz{3,4}\\
\Matriz{4,1}&\Matriz{4,2} & \Matriz{4,3} & \Matriz{4,4}\\
\end{array}
\right]
$
\end{document}
```
However the `\Matriz` here is a macro which reevalutes on each use. One would have to code something extra if you really want a kind of permanent structure; here only `\X` is used as a permanent 1-dim array.
Also this solution does not worry about the alignment in the columns, maybe look at siunitx for such things.
(update: I forgot in this original answer to reduce by 1 the column index, and more serious, I forgot parenthesis in case the number is negative so please simply replace `\xinteval{\X{#1#2}^(#3#4)}` by `\xinteval{(\X{#1#2})^(#3#4-1)}`)
| 1 | https://tex.stackexchange.com/users/293669 | 688918 | 319,590 |
https://tex.stackexchange.com/questions/688920 | 0 | I have been following [this answer](https://tex.stackexchange.com/a/206901), which includes a loop diagram, to incorporate momentum arrows in a Tikz Feynman diagram. I would like to know if it is possible to add a arrow indicating vector sign, e.g. {\huge$\vec{p}\_1$}, instead of just displaying $p\_1$.
| https://tex.stackexchange.com/users/149108 | How to add vector sign on momentum in Tikz Feynman | false | You can use any text for the momentum in `tikz-feynman`.
Code
----
```
% !TeX TS-program = lualatex
\documentclass[tikz]{standalone}
\usepackage{tikz-feynman}
\usetikzlibrary{quotes}
\tikzfeynmanset{momentum/arrow shorten=.3}
\begin{document}
\feynmandiagram[
vertical'=b to d,
node distance=3cm,
]{
a [particle=$\mu^-$]
--[fermion, momentum=$p_2$]
b[dot]
--[fermion, momentum=$p_4$]
c[particle=$\mu^-$],
d[dot]
--[boson, "$\gamma$"', momentum=$q$]
b,
e [particle=$e^-$]
--[fermion, momentum=$\vec p_1$]
d
--[fermion, momentum=$p_3$]
f [particle=$e^-$]
};
\end{document}
```
Output
------
| 1 | https://tex.stackexchange.com/users/16595 | 688934 | 319,597 |
https://tex.stackexchange.com/questions/688941 | 0 | I am using TeXLive on Linux. I have installed the [esstix package](https://ctan.org/pkg/esstix?lang=en). After looking at `esstixfrak.sty` and `stix2.sty`, I now know one way to use, in the same document, three different mathfrak fonts. Here is an MWE:
```
\documentclass{article}
\usepackage{newtxtext}
\usepackage{newtxmath}
% setting up mathfrak from stix2
\DeclareFontEncoding{LS1}{}{}
\DeclareFontSubstitution{LS1}{stix2}{m}{n}
\DeclareSymbolFont{STIX2symbols2} {LS1}{stix2frak} {m} {n}
\SetSymbolFont{STIX2symbols2} {bold}{LS1}{stix2frak} {b}{n}
\DeclareSymbolFontAlphabet{\STIXTwoMathfrak}{STIX2symbols2}
% setting up mathfrak from esstix
\DeclareMathAlphabet{\EsstixMathFrak}{U}{esstixfrak}{m}{n}
\begin{document}
$\mathfrak{E}\STIXTwoMathfrak{E}\EsstixMathFrak{E}$
\end{document}
```
This produces the mathfrak "E" using the fonts, in order, `txmiaX`, `STIXTwoMath`, and `ESSTIX-Fifteen`.
Note the different manners in which `\STIXTwoMathfrak` and `\EsstixMathFrak` are defined.
Questions:
1. What are some advantages and disadvantages of these two ways of defining these alternative mathfrak commands?
2. Is it possible to define `\EsstixMathFrak` in a manner that is analogous to the way `\STIXTwoMathfrak` is defined, in particular, without declaring a new math alphabet?
| https://tex.stackexchange.com/users/192504 | Various ways to set up alternative mathfrak fonts | true | classic tex only has 16 math families per math expression (luatex has more) symbol fonts have to be pre-allocated a number as a command like `\Rightarrow` ultimately is defined via
```
\mathchardef\Rightarrow="3229
```
so font family 2 (the second hex digit) has to be the font encoded with an arrow in position hex 29.
Conversely if a command such as `\mathbb` is only used as `\mathbb{Q}` and never as a symbol `\mathchardef` latex can allocate these on demand just if they are used, so you can *declare* more than 16 math alphabets, but they do not get allocated if not used. `\DeclareMathAlphabet`
Sometimes, notably `\mathrm` in the standard setup, a font that has been pre-allocated for some symbols, also has a math alphabet in the letter slot, `\DeclareSymbolFontAlphabet` sets up the math alphabet to re-use the existing allocation.
So if adding "extra" math alphabets not closely tied to your main math symbol setup, you should almost always use \DeclareMathAlphabet`rather than`\DeclareSymbolFontAlphabet`
in your example you declared two math alphabet, but the esstix one will not affect the 16 math font limit if you do not use it. As you allocate stix 2 via `\DeclareSymbolFont` it always takes up one of the 16 slots (or 2, if you load `bm` package)
| 1 | https://tex.stackexchange.com/users/1090 | 688942 | 319,603 |
https://tex.stackexchange.com/questions/688945 | 2 | I want to float a [`tcolorbox`](https://www.ctan.org/pkg/tcolorbox) to the bottom of a page of text, but it doesn't reliably work. This question is very closely related to [How to place tcolorbox at bottom of page](https://tex.stackexchange.com/questions/600230/how-to-place-tcolorbox-at-bottom-of-page), but not a complete duplicate as the solution there doesn't work in this particular case. I suspect that's exposing a lack of understanding on my part as to how floats work.
Here's a MWE, which when I process with `xelatex`, produces a two-page PDF. The main text is on the first page, and the `tcolorbox` is floating in the middle of the next.
```
\documentclass[b5paper, 11pt]{book}
\usepackage{tcolorbox}
\usepackage{lipsum}
\begin{document}
\lipsum[2]
\begin{tcolorbox}[float,floatplacement=b]
\lipsum[1]
\end{tcolorbox}
\end{document}
```
Removing the `[float,floatplacement=b]` demonstrates that there is plenty of space at the bottom of the first page for it. Interestingly, it works fine I change the contents to be as follows, despite this having far more content:
```
\lipsum[1-2]
\begin{tcolorbox}[float,floatplacement=b]
\lipsum[2]
\end{tcolorbox}
```
It looks like LaTeX has some in-built maximum size for a `[b]` float. If so, can it be disabled, either globally or for a particular `tcolorbox`?
(I know that in this MWE, I can easily achieve what I want with a non-floating `tcolorbox`, with a `\vfill` beforehand to move it to the bottom of the page. I can't readily do that in the real document.)
| https://tex.stackexchange.com/users/16883 | tcolorbox failing to float to bottom of page | true | `article` sets `\renewcommand\bottomfraction{.3}` so bottom floats can not be more than 30% of the page, you could increase that or the `!` float option says to ignore the constraints, so
```
\documentclass[b5paper, 11pt]{book}
\usepackage{tcolorbox}
\usepackage{lipsum}
\begin{document}
\lipsum[2]
\begin{tcolorbox}[float,floatplacement=!b]
\lipsum[1]
\end{tcolorbox}
\end{document}
```
| 6 | https://tex.stackexchange.com/users/1090 | 688946 | 319,604 |
https://tex.stackexchange.com/questions/687594 | 1 | I'm still working on a Latex-template for my institution. So far everything runs fine and the former questions i asked here helped me a lot.
Now, i want to adjust the different parts of the journals footer to meet the expected layout. I have a working solution using `\parbox` inside my `\lofoot`, `\cofoot` etc. commands that makes the footer contents show up as wanted. The authors should appear on the left side with a linebreak if there are several, the title should appear always right of the author section, also flushedright to the right margin of the textbody, also with a linebreak if needed (see MWE below). But i figured the fitting widths out only using trial and error. That's not how it should be (I'm kind of a perfectionist ;) )
Thus, i wanted to find out which macros inside the `scrlayer-scrpage` package define those commands and to adjust/renew them that they fit my needs. But, so far, i wasn't able to receive these informations.
When i run `latexdef -p scrlayer-scrpage lefoot` inside the terminal or use `\meaning\lefoot` inside my document, for example, i get the phrase `macro:->\sls@renewelement {even}{left}{foot}`. So far, so good, but i couldn't figure out how to find the definition of the element `foot` (Running `latexdef` on `foot` produced only that it's `undefined` since `foot` is no command, running it on `sls@renewelement` didn't help either). I also searched inside the **.sty** file directly without a result. If i run `{\tracingall\lefoot}` inside the document the compilation process never ends and i can't find any informations in the log.
Therefore, my question is not only about the mentioned adjustment of the footer, but also a **general** one on working deeper in Latex/Tex backend: How to get these kind of informations if I need to do it again – and this will be the case for sure since I'm only getting started with the template.
Here is my MWE (I intentionnaly use the `article` class and no KOMA-class). I added my workaround solution only to the odd pages, so everyone can see the layout differences:
```
\documentclass[a4paper,12pt,
twoside,%
]{article}
\usepackage[T1]{fontenc}
\usepackage{blindtext}
\usepackage{geometry}
\geometry{%
inner=20mm,
outer=60mm,
top=15mm,
bottom=20mm,
marginparwidth=45mm,
showframe % to show the margins
}
\usepackage[footwidth=textwithmarginpar,footsepline=0.4pt:text,ilines]{scrlayer-scrpage}
\clearpairofpagestyles
\ModifyLayer[addvoffset=2.5ex]{scrheadings.foot.odd}
\ModifyLayer[addvoffset=2.5ex]{scrheadings.foot.even}
\ModifyLayer[addvoffset=2.5ex]{scrheadings.foot.oneside}
\ModifyLayer[addvoffset=2.5ex]{plain.scrheadings.foot.odd}
\ModifyLayer[addvoffset=2.5ex]{plain.scrheadings.foot.even}
\ModifyLayer[addvoffset=2.5ex]{plain.scrheadings.foot.oneside}
\setkomafont{pagefoot}{\sffamily\tiny\normalshape}
\ohead*{\pagemark}
\lefoot*{Journal 2000, § 1--4}
\cefoot*{A List of different authors who have written the current article}
\refoot*{\bfseries The title of the current article which was written by the different authors mentioned on the left}
\lofoot*{\parbox[t]{.35\textwidth}{A List of different authors who have written the current article}}
\cofoot*{\hspace*{.13\textwidth}\parbox[t]{.5\textwidth}{\raggedleft\bfseries The title of the current article which was written by the different authors mentioned on the left}}
\rofoot*{Journal 2000, § 1--4}
\begin{document}
\section{Section Heading}
\blindtext[5]
\end{document}
```
I'm sure the solution can be interpreted from reading *The TeXbook* or *TeX by Topic* or something similar, but it would save me an enormous amount of time if someone has a faster answer. The KOMA-script documentation wasn't as helpful so far.
Thanks in advance for your helpful replies!
**EDIT**
The links provided in the comments are very helpful and I found a lot which I nedd and want to read to understand Latex even better.
But the particular question remains unsolved and i couldn't find a solution. I still adjust the footer layout by using `parbox` and `hspace*` commands inside the `lefoot`... commands provided by the `scrlayer-scrpage` package. Inside the package the `\lefoot` command i.e. is defined as `macro:->\sls@renewelement {even}{left}{foot}`.
*Has anyone the concrete answer where to find the definition of these three elements, so i can redefine them to fitting my needs?* Or is it generally a bad idea to change something as deep inside the package-tree/backend?
| https://tex.stackexchange.com/users/297560 | How to find macros to adjust footer (lefoot, cefoot etc.) with scrlayer-scrpage | false | for the sake of completion I post here my current solution. I used @esdd's answer for the last week. But ultimately, I needed to settle with another solution, because the required document layout changes geometry inside the document and that killed the adjustment of the footer.
I tried many different ways, but finally decided not to use the standard options provided by the `scrlayer-scrpage` package like `\lofoot{}` etc. Instead i declared some new layers which use the relation of `\linewidth` and `\textwidth` of the standard geometry. Thus, the footer doesn't changes it layout after `\newgeometry` is called.
Now I use the following code, and it works quite fine; no matter how the geometry is adjusted:
```
\documentclass[%
twoside,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{noto}
\usepackage{geometry}
\geometry{%
inner=20mm,
outer=60mm,
top=15mm,
bottom=20mm,
marginparwidth=40.5mm,
marginparsep=4.5mm,
showframe % to show the margins
}
\usepackage{multicol}
\usepackage[]{scrlayer-scrpage}
\clearpairofpagestyles
\usepackage{xcolor}
%% Footer content %%
\DeclareNewLayer[
background,
twoside,
oddpage,
foot,
width=\textwidth+\marginparsep+\marginparwidth,
voffset=1in+\topmargin+\headsep+\textheight+\footskip+.6\footnotesep,
contents={\sffamily\tiny\normalshape%
\parbox[b]{.743\linewidth}{%
\parbox[b]{.35\linewidth}{\color{red}A\rule{\linewidth}{2pt}}%
\hfill%
\parbox[b]{.5\linewidth}{\color{green}\rule{\linewidth}{2pt}\raggedleft}%
}%
\hfill%
\parbox[b]{.2\linewidth}{\color{blue}Journaltitle 1--12\raggedleft}%
}
]{oddfootercontent}
\DeclareNewLayer[
clone=oddfootercontent,
evenpage,
hoffset=\evensidemargin+1in-\marginparsep-\marginparwidth,
contents={\sffamily\tiny\normalshape%
\parbox[b]{\linewidth}{%
\parbox[b]{.2\linewidth}{\color{blue}Journaltitle 1--12}%
\hfill
\parbox[b]{.743\linewidth}{%
\parbox[b]{.35\linewidth}{\color{red}\rule{\linewidth}{2pt}}%
\hfill%
\parbox[b]{.5\linewidth}{\color{green}\rule{\linewidth}{2pt}\raggedleft}%
}
}
}
]{evenfootercontent}
%% pagenumber at bottom of outsidemargin %%
\DeclareNewLayer[
background,
oneside,
outermargin,
height=\textheight,
voffset=1in+\voffset+\topmargin+\headheight+\headsep+.8\footnotesep,
contents={%
\parbox[b][\layerheight][b]{\layerwidth}
{\raggedleft\hfill\pagemark\hspace*{15mm}}%
}
]{outermargin.pagenumber.oneside}
\DeclareNewLayer[
clone=outermargin.pagenumber.oneside,
twoside,
oddpage
]{outermargin.pagenumber.odd}
\DeclareNewLayer[
clone=outermargin.pagenumber.odd,
evenpage,
contents={%
\parbox[b][\layerheight][b]{\layerwidth}
{\hspace*{15mm}\pagemark\hfill}%
}
]{outermargin.pagenumber.even}
\AddLayersToPageStyle{scrheadings}{%
oddfootercontent,%
evenfootercontent,%
outermargin.pagenumber.oneside,%
outermargin.pagenumber.odd,%
outermargin.pagenumber.even%
}
\AddLayersToPageStyle{plain.scrheadings}{%
oddfootercontent,%
evenfootercontent,%
outermargin.pagenumber.oneside,%
outermargin.pagenumber.odd,%
outermargin.pagenumber.even%
}
\setkomafont{pagenumber}{\sffamily\bfseries}
\usepackage[%
hang,%
bottom%
]{footmisc}
\setlength{\footnotemargin}{0.5cm}
\setlength{\skip\footins}{0,5cm}
\makeatletter
\renewcommand\footnoterule{\kern-3\p@
\hrule \@width \textwidth \kern 2.6\p@}
\makeatother
\usepackage{blindtext}
\begin{document}
\section{Autoren}
\blindtext\footnote{text}
\blindtext[6]\footnote{text}
\blindtext[2]
\newgeometry{
inner=20mm,
outer=37.5mm,
top=15mm,
bottom=20mm,
marginparwidth=18mm,
marginparsep=4.5mm
}
\begin{multicols}{2}
\section{newgeometry}
\blindtext[3]\footnote{text}
\blindtext[6]
\end{multicols}
\end{document}
```
Nevertheless, @esdd's answer provided me the first solution, as well as the concept my own solution relies on. Therefore, it still is the answer which **solved** the question.
Thanks
| 0 | https://tex.stackexchange.com/users/297560 | 688948 | 319,606 |
https://tex.stackexchange.com/questions/688954 | 9 | What is the best way to upgrade my MacTeX from version 2022 to 2023?
Do I have to uninstall and delete everything from 2022 and then reinstall 2023?
On the website the instructions are not that specific for me.
Anyway, I don't want to have 2022 in parallel on the Mac, but upgrade to 2023.
Can you help me please?
| https://tex.stackexchange.com/users/299261 | MacTeX upgrade from 2022 to 2023 | true | TeXLive doesn't provide an upgrade path; it's always best to install the current year from scratch. For the Mac that simply means downloading the latest MacTeX installer and installing it.
There's no need to delete the previous year's installation before installing the new one, since multiple years can coexist peacefully on your computer. Depending on how much disk space you you can spare, keeping older years around can sometimes be helpful if you have older projects that might need recompilation.
Once you've installed the newest version you can delete older years by following the directions here:
* [Checking and removing multiple MacTex installations](https://tex.stackexchange.com/q/177010/2693)
| 17 | https://tex.stackexchange.com/users/2693 | 688956 | 319,612 |
https://tex.stackexchange.com/questions/688958 | 0 | I cannot find any documentation at all on the `samepage` environment (aside from a cryptic comment on p229 of the LaTeX book that "The `\samepage` command still works, but is now of little use", which may or may not be relevant to the environment of the same name). [This answer](https://tex.stackexchange.com/a/4472/16883) and the name of the environment suggests it should keep its contents on the same page, however it doesn't, as this MWE demonstrates:
```
\documentclass{article}
\usepackage{lipsum}
\usepackage{parskip}
\begin{document}
\lipsum[4-8]
\begin{samepage}
foo
bar
\end{samepage}
\end{document}
```
This breaks the page between the 'foo' and the 'bar'. Am I misusing the `samepage` environment? Is it documented anywhere?
This example requires `xelatex` rather than `latex`, but you can see the same in `latex` by adding a third line to the `samepage` environment.
| https://tex.stackexchange.com/users/16883 | Page breaks still occur in samepage | false | `samepage` makes it infinitely bad to break at every place it could reasonably access,so between lines of a paragraph (but not single line paragraphs) and at every place latex has control so list items, math displays etc.
Perhaps surprisingly tex has an `\interlinepenalty` primitive to control penalties at line breaks, but nothing to control the penalty for breaking at `\parskip`.
Latex's new para hooks finally give access to the start and end of a paragraph (see `texdoc ltpara-doc`) so you could add a penalty:
```
\documentclass{article}
\usepackage{lipsum}
\usepackage{parskip}
\AddToHook{env/samepage/begin}{%
\AddToHook{para/before}{\nopagebreak}%
\AddToHook{para/after}{\nopagebreak}%
}
\begin{document}
\lipsum[4-8]
\begin{samepage}
foo
bar
\end{samepage}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/1090 | 688959 | 319,613 |
https://tex.stackexchange.com/questions/134373 | 12 | When i run the following code i get my output on two pages. On first page the text line and my image on page 2. How can i get my output on the same page that is text and image on the same page. Please help.
```
\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\begin{document}
Hi...My first test image
\begin{figure}[h]
\centering
\includegraphics[width=1\textwidth]{fig10.pdf}
\caption{My first image}
\end{figure}
\end{document}
```
| https://tex.stackexchange.com/users/35103 | How to get image and text on same page? | false | THe best way to do it is using `[H]` while inserting a figure
For example
```
\begin{figure}[H]
\centerline{\includegraphics[scale=0.65]{5.1.png}}
\caption{Confusion matrix for PPMI dataset}.
\label{I1}
\end{figure}
\begin{figure}[H]
\centerline{\includegraphics[scale=0.65]{5.2.png}}
\caption{Confusion matrix for BCCD dataset}.
\label{I1}
\end{figure}
```
So the above lines will place 2 images one below the other
The `[H]` also works for a table.
| 1 | https://tex.stackexchange.com/users/299271 | 688967 | 319,618 |
https://tex.stackexchange.com/questions/688963 | 0 | I made a graph using the tkz-graph package and want to use the tikzducks package to make vertices of the graph. (In particular, I want to replace the points at vertices of an arbitrary graph with colored ducks). Is this possible?
Here is my code:
```
\begin{tikzpicture}
\renewcommand*{\VertexLineWidth}{2pt}
\GraphInit[vstyle=Welsh]
\Vertices[unit=3]{circle}{A,B,C,D,E,F,G}
\SetVertexNoLabel
\AddVertexColor{red}{B,F} \AddVertexColor{blue}{E,A}
\AddVertexColor{green}{C,G}\AddVertexColor{yellow}{D}
\Vertex[Node]{D}
\Edges(G,E,F,G,B,D,E,C,D,A,C,B,A)\Edges(B,E)
\end{tikzpicture}
```
| https://tex.stackexchange.com/users/299162 | Combining environments in 2 packages (tkz-graph and tikzducks)? | false | Sure, maybe like this:
```
\documentclass[border=10pt]{standalone}
\usepackage{tkz-graph}
\usetikzlibrary{ducks}
\newcommand*{\AddVertexDuckColor}[2]{%
\begingroup
\tikzset{VertexStyle/.append style = {duck = {duck/body=#1}}}
\foreach \v in {#2} { \Vertex[Node, NoLabel] {\v} }
\endgroup
}
\begin{document}
\begin{tikzpicture}
\GraphInit[vstyle=Welsh]
\tikzset{
duck/.style={
path picture={
\pic[scale=0.25, xshift=-1cm, yshift=-1cm, #1] {duck};
}
},
VertexStyle/.append style={
draw=none,
fill=none,
minimum size=0.6cm,
duck
}
}
\Vertices[unit=3]{circle}{A,B,C,D,E,F,G}
\SetVertexNoLabel
\AddVertexDuckColor{red}{B,F}
\AddVertexDuckColor{blue}{E,A}
\AddVertexDuckColor{green}{C,G}
\Vertex[Node]{D}
\AddVertexDuckColor{yellow}{D}
\Edges(G,E,F,G,B,D,E,C,D,A,C,B,A)
\Edges(B,E)
\end{tikzpicture}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/47927 | 688971 | 319,620 |
https://tex.stackexchange.com/questions/688957 | 0 | I'm setting a document using the `octavo` class and including the packages `tocloft` and `fancyhdr`. Here are my fancyhdr settings:
```
\fancyhead[CE]{\itshape\booktitle}
\fancyhead[CO]{\itshape\leftmark}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
```
I want the chapter numbers to appear in the chapter listing in the TOC, so I'm starting the chapters with e.g.:
```
\chapter[II. Title of Chapter Two]{Title of Chapter Two}
```
This gives me the chapter heading I want ("Title of Chapter Two") and the TOC entry I want ("II. Title of Chapter Two"), but the header on every right page is the latter, when I want it to be the former.
Is there a way I can do this?
Thank you for your help!
| https://tex.stackexchange.com/users/215301 | How do I make the chapter title in the heading different from the chapter title in the TOC? | true | The optional argument of `\chapter` is used for the ToC and `\markboth`. If you want a chapter title without a number, but a different thing in ToC, and another in the headers, you can use `\addcontentsline` for the ToC, `\chapter*` for the not numbered title and set `\markboth` to have even more title versions at the left and/or right header (even without `fancyhdr`). This can be simplified with a macro, but I set it manually in two chaptersto make more clear the approach.
Note that no one of these chapter title versions should have the number that will be wrong if you add\remove\move any other chapter. If only should be numbered in ToC, just allow a numbered ToC setting the `secnumdepth` counter, since `\chapter*` will be not cumbered anyway.
In the example, the four chapter name versions in the MWE are just repeated characters, AAAA, EEE, etc. instead of titles for humans beings (ugly, but easier to check where is ending each in the PDF):
```
\documentclass{octavo}
\usepackage{lipsum}
\setcounter{secnumdepth}{1}
\renewcommand{\thechapter}{\Roman{chapter}}
\begin{document}
\tableofcontents
\mainmatter
\chapter*{AAAA\markboth{EEEE}{OOOO}} % Title ≠ even header ≠ odd header ≠ ToC
\stepcounter{chapter}
\addcontentsline{toc}{chapter}{\numberline{\thechapter} SSSSS}
\lipsum[1-10]
\chapter*{ZZZZ\markboth{XXXX}{CCCC}} % Title ≠ even header ≠ odd header ≠ ToC
\stepcounter{chapter}
\addcontentsline{toc}{chapter}{\numberline{\thechapter} UUUUU}
\lipsum[1-10]
\end{document}
```
| 1 | https://tex.stackexchange.com/users/11604 | 688974 | 319,622 |
https://tex.stackexchange.com/questions/688973 | 4 | In the l3seq module of LaTeX3, there are similar functions such as
* `\seq_get:NN` and `\seq_get_left:NN`
They both store the left-most (top) item from the `<sequence>` into the `<token list variable>` without removing it from the `<sequence>`. So what's the difference between them?
| https://tex.stackexchange.com/users/241621 | \seq_get:NN vs \seq_get_left:NN | true | Semantics: `\seq_get:NN` would be used with a `seq` where you never 'care' about the order, only that it is ordered. `\seq_get_left:NN` would be used if you are explicitly determining which end of the `seq` to push/get from.
| 8 | https://tex.stackexchange.com/users/73 | 688975 | 319,623 |
https://tex.stackexchange.com/questions/688978 | 7 | In section 6.1 of `clsguide.pdf` (link: `https://www.ctan.org/pkg/clsguide`), under "Commands superseded for new material", the class guide lists the command `\DeclareRobustCommand` and `\DeclareRobustCommand*` as commands that "are widely used but have been superseded by more modern methods."
My question is, then, what commands are best used in place of the aforementioned commands? Unless I'm mistaken, the class guide doesn't provide this information. In `source2e.pdf`, `\DeclareRobustCommand` is used quite often.
| https://tex.stackexchange.com/users/278534 | What command should supersede \DeclareRobustCommand? | true | The engine-robust command set `\NewDocumentCommand`, etc., are now the recommended method for creating document commands. These are documented in `usrguide`.
| 8 | https://tex.stackexchange.com/users/73 | 688979 | 319,626 |
https://tex.stackexchange.com/questions/660749 | 0 | I recently found about sambook class and I like the style but there ara things with the TOC and that subsection and subsubsection are like normal text with no difference, so I want to know if there is a way to have the style but not the problems. Thanks
This is my actual code (just a small part), but I can not provide a layout because I have problems withe the compiler:
```
\documentclass[a4paper, 8pt]{book}
% fuente de letra:
\usepackage{tgcursor}
\renewcommand*\familydefault{\ttdefault} %% Only if the base font of the document is to be typewriter style
\usepackage[T1]{fontenc}
\usepackage[mathscr]{euscript}
% matemáticas:
\usepackage{amsmath, amssymb}
% idioma:
\usepackage[utf8]{inputenc}
\usepackage[spanish, es-tabla]{babel} % 'cuadro' es el título del caption de table por defecto siguiendo indicaciones de RAE; es-tabla lo cambia a 'tabla'
% gestión de párrafos (hace innecesario indicar el salto de línea con doble barra y elimina el indent de todos los párrafos):
\usepackage{parskip}
% enlaces a URLs:
\usepackage[hidelinks]{hyperref}
% gráficos:
\usepackage{graphicx, wrapfig, caption, subcaption}
% tablas:
\usepackage{array, multirow}
\newcommand{\dl}{\left(}
\newcommand{\dr}{\right)}
\newcommand{\dsin}[1]{\sin{\left(#1\right)}}
\newcommand{\dtan}[1]{\tan{\left(#1\right)}}
\newcommand{\dcos}[1]{\cos{\left(#1\right)}}
\newcommand{\dsec}[1]{\sec{\left(#1\right)}}
\newcommand{\dcsc}[1]{\csc{\left(#1\right)}}
\newcommand{\dcot}[1]{\cot{\left(#1\right)}}
\newcommand{\darcsin}[1]{\arcsin{\left(#1\right)}}
\newcommand{\darccos}[1]{\arccos{\left(#1\right)}}
\newcommand{\darctan}[1]{\arctan{\left(#1\right)}}
\newcommand{\dsinh}[1]{\sinh{\left(#1\right)}}
\newcommand{\dcosh}[1]{\cosh{\left(#1\right)}}
\newcommand{\dtanh}[1]{\tanh{\left(#1\right)}}
\newcommand{\dln}[1]{\ln{\left(#1\right)}}
\newcommand{\dexp}[1]{e^{#1}}
\newcommand{\dsum}[2]{\displaystyle\sum_{#1}^{#2}}
\newcommand{\dlim}[2]{\lim_{#1\rightarrow#2}}
\newcommand{\dint}[2]{\displaystyle\int_{#1}^{#2}}
\newcommand{\doint}[2]{\displaystyle\oint_{#1}^{#2}}
\usepackage{thmtools}
\declaretheorem[thmbox=L]{Hipótesis}
\declaretheorem[thmbox=M]{Postulado}
\declaretheorem[thmbox=S]{Teorema}
\declaretheorem[thmbox=M]{Principio}
\declaretheorem[thmbox=M]{Ley}
\NewDocumentCommand{\umathnote}{ mm }
{
\overset % ❶
{% The annotation goes above
\textcolor{black!20!white}{\hbox to 0pt{\hss % ❷
$ % return to math mode
\scriptsize\begin{array}{c} % ❸
\displaystyle#2\\ % ❹
\Big\downarrow % ❺
\end{array}
$
\hss}
}
}
{#1} %
}
\NewDocumentCommand{\dmathnote}{ mm }
{
\underset % ❶
{% The annotation goes above
\textcolor{black!20!white}{\hbox to 0pt{\hss % ❷
$ % return to math mode
\scriptsize\begin{array}{c} % ❸
\Big\uparrow\\ % ❹
\displaystyle#2 % ❺
\end{array}
$
\hss}
}
}
{#1} %
}
\renewcommand{\baselinestretch}{1.35}
\usepackage{titlesec}
\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{-2.5ex\@plus -1ex \@minus -.25ex}%
{1.25ex \@plus .25ex}%
{\normalfont\normalsize\bfseries}}
\makeatother
\setcounter{secnumdepth}{4} % how many sectioning levels to assign numbers to
\setcounter{tocdepth}{4} % how many sectioning levels to show in ToC
\usepackage[all]{xy}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepackage{tikz}
\usetikzlibrary{calc, arrows.meta, chains, positioning}
\usepackage[makeroom]{cancel}
\usepackage{pgfornament}
\NewDocumentCommand{\grand}{ m }
{\begin{center}\large\begin{tikzpicture}[every node/.style={inner sep=0pt}]
\node[text width=14cm,align=center](Text){#1} ;
\node[shift={(-1cm,1cm)},anchor=north west](CNW)
at (Text.north west) {\pgfornament[width=0cm]{88}};
\node[shift={(1cm,1cm)},anchor=north east](CNE)
at (Text.north east) {\pgfornament[width=0cm,symmetry=v]{88}};
\node[shift={(-1cm,-1cm)},anchor=south west](CSW)
at (Text.south west) {\pgfornament[width=0cm,symmetry=h]{88}};
\node[shift={(1cm,-1cm)},anchor=south east](CSE)
at (Text.south east) {\pgfornament[width=0cm,symmetry=c]{88}};
\pgfornamenthline{CNW}{CNE}{north}{88}
\pgfornamenthline{CSW}{CSE}{south}{88}
\pgfornamentvline{CNW}{CSW}{west}{88}
\pgfornamentvline{CNE}{CSE}{east}{88}
\end{tikzpicture}
\end{center}}
\usepackage[framemethod=TikZ]{mdframed}
\newcounter{dem}[chapter]\setcounter{dem}{0}
\renewcommand{\thedem}{\Roman{dem}}
\newenvironment{dem}[2][]{%
\refstepcounter{dem}%
\ifstrempty{#1}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=white]
{\strut Demostración~\thedem};}}
}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=white]
{\begin{minipage}{0.99\linewidth}Demostración~\thedem~#1\end{minipage}};}}%
}%
\mdfsetup{innertopmargin=10pt,linecolor=black,%
linewidth=0.5pt,topline=true,%
frametitleaboveskip=\dimexpr-\ht\strutbox\relax
}
\begin{mdframed}[]\relax%
\label{#2}}{\end{mdframed}}
\usepackage{nccmath}
\usepackage{tcolorbox}
\tcbuselibrary{most}
\newtcolorbox[auto counter,
number within=chapter,
list inside=ej
]{ej}[1][]{%
enhanced, breakable,
title={{\begin{minipage}{\linewidth}\textbf{Ejercicio}~\thetcbcounter.~\textit{#1}\end{minipage}}},
halign title=left,
sharp corners,
colback=white,
coltitle=black,
colbacktitle=white,
boxrule=0pt,frame hidden,
underlay unbroken and first={%
\ifnumequal{\tcbsegmentstate}{0}{
\draw[black,double] (interior.north west)--(interior.south west);
}{\ifnumequal{\tcbsegmentstate}{1}{
\draw[black,double] (interior.north west)--(segmentation.west);
\begin{tcbclipinterior}
\draw[help lines, step=2.1mm, black!10!white](segmentation.south west) grid (frame.south east);
\end{tcbclipinterior}
}{\ifnumequal{\tcbsegmentstate}{2}{
\begin{tcbclipinterior}
\draw[help lines, step=2.1mm, black!10!white](interior.north west) grid (interior.south east);
\end{tcbclipinterior}
}}}
},
underlay middle and last={%
\ifnumequal{\tcbsegmentstate}{0}{
\draw[black,double] (interior.north west)--(interior.south west);
}{\ifnumequal{\tcbsegmentstate}{1}{
\draw[black,double] (interior.north west)--(segmentation.west);
\begin{tcbclipinterior}
\draw[help lines, step=2.1mm, black!10!white](segmentation.south west) grid (frame.south east);
\end{tcbclipinterior}
}{\ifnumequal{\tcbsegmentstate}{2}{
\begin{tcbclipinterior}
\draw[help lines, step=2.1mm, black!10!white](interior.north west) grid (interior.south east);
\end{tcbclipinterior}
}}}
},
boxed title style={%
colframe=white,
boxrule=0pt,
colback=white,
left=0pt,
right=0pt},
attach boxed title to top left={xshift={-5pt}},
lower separated=false,
before lower = {\tcbsubtitle[colback=white, opacityback=0, colframe=black, opacityframe=0, boxrule=1pt, height=1cm, width=2.55cm, valign=center]{\textbf{Solución:}}}
}
\newtcolorbox[auto counter,
number within=chapter,
list inside=defi
]{defi}[1][]{%
enhanced,
title={{\begin{minipage}{0.99\linewidth}\textbf{\textit{#1}}\end{minipage}}},
,
halign title=left,
sharp corners,
colback=white,
coltitle=black,
colbacktitle=white,
boxrule=0pt,frame hidden,
overlay unbroken={%
\draw[black,double] (interior.north west)--(interior.south west);%
},
boxed title style={%
colframe=white,
boxrule=0pt,
colback=white,
left=0pt,
right=0pt},
attach boxed title to top left={xshift={-5pt}},
}
\usepackage{float}
\usepackage{fancyhdr}
\usepackage[Conny]{fncychap}
\usepackage[bottom=2cm,top=2cm,right=1.5cm,left=1cm,binding=1cm]{geometry}
\usepackage[footnote]{witharrows}
\pagestyle{fancy}
\fancyfoot[L]{Universidad Europea de Madrid}
\fancyfoot[C]{\href{mailto:alvaromendezrt@gmail.com}{Alvaromendezrt@gmail.com}}
\fancyfoot[R]{Física cuántica}
\renewcommand{\footrulewidth}{0.5pt}
\title{Física cuántica}
\author{Álvaro Méndez Rodríguez de Tembleque}
\date{\today}
\begin{document}
\maketitle
\tableofcontents
\listoftheorems
\grand{
Las demostraciones se denotan con números romanos.
Los ejercicios, no siempre tendrán solución numérica, ya que algunos tienen la función de explicar conceptos e ideas.
}
\chapter{Orígenes de la física cuántica}
A principios del siglo XIX se consideraba que se conocían los \textbf{fundamentos de la Física}, con la \textbf{Mecánica}, el \textbf{Electromagnetismo} y la \textbf{Termodinámica}; se podían explicar la mayor parte de los fenómenos experimentales. A finales de siglo se encuentran resultados que \textbf{no encajan} con ésta física clásica. Se vió que la física clásica fallaba a velocidades \textbf{$\nu\sim c$ y a escalas pequeñas}. La Teoría de la Relatividad especial y la Física cuántica tratan de explicar éstos fenónemos que la física clásica no
puede. En éste tema vamos a ver qué experimentos motivaron la creación de la Física cuántica, así como la formulación más rudimentaria de la misma.
\begin{figure}[H]
\centering
\begin{tikzpicture}[
node distance = 1mm and 25mm,
start chain = A going below,
dot/.style = {circle, draw=white, very thick, fill=gray,
minimum size=3mm},
box/.style = {rectangle, text width=150mm,
inner xsep=4mm, inner ysep=2mm,
font=\normalfont\linespread{0.84}\selectfont,
on chain},
]
\begin{scope}[every node/.append style={box}]
\node {\textbf{Espectros atómicos}\newline William Hyde Wollaston construyó un espectrómetro, mejorando el modelo de Newton, que incluía una lente para enfocar el espectro del Sol sobre una pantalla. Al usarlo, Wollaston se dio cuenta de que los colores no se distribuían uniformemente, sino que faltaban parches de colores, que aparecían como bandas oscuras en el espectro del sol. En ese momento, Wollaston creía que estas líneas eran límites naturales entre los colores, pero esta hipótesis se descartó posteriormente en 1815 por el trabajo de Fraunhofer} ;
\node {\textbf{Experimento de la doble rendija}\newline El experimento de la doble rendija es un experimento realizado a principios del siglo XIX por el físico inglés Thomas Young, con el objetivo de apoyar la teoría de que la luz era una onda y rechazar la teoría de que la luz estaba formada por partículas. Young hizo pasar un haz de luz por dos rendijas y vio que sobre una pantalla se producía un patrón de interferencias, una serie de franjas brillantes y oscuras alternadas. Este resultado es inexplicable si la luz estuviera formada por partículas porque deberían observarse sólo dos franjas de luz frente a las rendijas, pero es fácilmente interpretable asumiendo que la luz es una onda y que sufre interferencias.} ;
\node {\textbf{Radiación de cuerpo negro}\newline Balfour Stewart describió sus experimentos sobre los poderes emisivos y absorbentes de radiación térmica de las placas pulidas de diversas sustancias, en comparación con los poderes de las superficies de lámpara negra, a la misma temperatura Stewart eligió las superficies de color negro como su referencia debido a varios hallazgos experimentales anteriores, especialmente los de Pierre Prevost y John Leslie. Escribió: "Lámpara de color negro, que absorbe todos los rayos que caen sobre ella y, por lo tanto, posee el mayor poder de absorción posible, también tendrá el mayor poder de radiación posible".} ;
\node {\textbf{Efecto fotoeléctrico}\newline Las primeras observaciones del efecto fotoeléctrico fueron llevadas a cabo por Heinrich Hertz, en 1887, en sus experimentos sobre la producción y recepción de ondas electromagnéticas. Su receptor consistía en una bobina en la que se podía producir una chispa como producto de la recepción de ondas electromagnéticas. Para observar mejor la chispa Hertz encerró su receptor en una caja negra} ;
\node {\textbf{Dispersión compton}\newline El efecto Compton fue estudiado por el físico Arthur Compton, quien pudo explicarlo utilizando la noción cuántica de la radiación electromagnética como cuantos de energía y la mecánica relativista de Einstein. El efecto Compton constituyó la demostración final de la naturaleza cuántica de la luz tras los estudios de Planck sobre el cuerpo negro y la explicación de Albert Einstein del efecto fotoeléctrico} ;
\node {\textbf{Principio de De Broglie}\newline El físico francés Louis de Broglie propuso una osada analogía: si la luz, que se creía que era una onda, tenía comportamiento de partícula bajo ciertas condiciones, entonces partículas como el electrón también cumplían con esa dualidad.} ;
\node {\textbf{Átomo de hidrógeno}\newline Desde principios del siglo XX se conocía que la mecánica clásica no podía explicar ni la estructura interna del átomo, reflejada en la existencia de líneas espectrales, ni la propia existencia y estabilidad de los átomos. De acuerdo con las predicciones de la mecánica clásica y el electromagnetismo clásico un átomo de hidrógeno formado por un protón y un electrón orbitando a su alrededor no sería un sistema estable, ya que de acuerdo con la electrodinámica clásica una carga en movimiento emite radiación electromagnética.} ;
\end{scope}
\draw[very thick, gray, {Circle[length=3pt]}-{Triangle[length=4pt)]},
shorten <=-3mm, shorten >=-3mm] % <--- here is adjusted additional arrow's
(A-1.north west) -- (A-7.south west);
\foreach \i [ count=\j] in {1802, 1803 ,1858 ,1887 ,1923 ,1924 , Siglo XX}
\node[dot,label=left:\i] at (A-\j.west) {};
\end{tikzpicture}
\end{figure}
\section{Radiación de cuerpo negro}
\begin{wrapfigure}{r}{0.5\textwidth}
\centering
\vspace{-1.5cm}
\includegraphics[width=0.35 \textwidth]{radiaicon-lambda.png}
\caption{Se observaba que mayor temperatura la emisión de radiación del cuerpo negro se dispara hacia longitudes menores acercándose al visible}
\label{fig:my_label}
\end{wrapfigure}
Todos los cuerpos que están a una cierta temperatura emiten una cierta radiación. El objetivo de este experimento es estudiar las ondas electromagnéticas irradiadas por los materiales analizando los espectros de emisión a partir de la \textbf{radiancia espectral}.
\begin{DispWithArrows}[format=c]
\dint{0}{\infty}R_T(v)dv
\end{DispWithArrows}
En donde el término $R_T\dl v\dr$ es la antes mencionada radiancia espectral, la cual se mide en $\frac{W}{m^2~Hz}$
\begin{itemize}
\item[$\bullet$] Para los gases se obtenían experimentalmente \textbf{espectros discretos} con ciertas líneas de emisión (lo veremos más en detalle en los espectros atómicos).
\item[$\bullet$] Para la materia condensada los \textbf{espectros son continuos} y prácticamente iguales para todos los materiales, sólo dependientes de la temperatura $T$.
\end{itemize}
Nos centraremos aquí en los espectros de la materia condensada. Éstos espectros son totalmente independientes de la composición del material en el caso de un cuerpo negro
\begin{defi}[Definición de cuerpo negro]
Un cuerpo negro absorbe toda la radiación incidente, es por ello que se le llama negro ya que no solo no emite radiación en el espectro visible si no que no lo hace en ninguno de los espectros. Esto no implica que el objeto no pueda emitir luz propia, este concepto hace referencia a la luz reflejada de otros cuerpos, es decir, si emite radiación es propia (el Sol).
\begin{figure}[H]
\centering
\includegraphics[width=0.35 \textwidth]{cuerpo-negro.png}
\caption{Dibujo esquemático de una cavidad resonante}
\label{fig:my_label}
\end{figure}
\end{defi}
Un cuerpo negro es aquel que absorbe toda la radiación incidente. Se observan los siguientes fenómenos:
\begin{enumerate}
\item Ley de Stefan-Boltzman
\begin{DispWithArrows}[format=r]
R_T=\sigma T^4\quad\sigma=5.67\cdot10^{-8}~\frac{W}{m^2\cdot K^4} \label{eq:sboltz}
\end{DispWithArrows}
\item Ley de Wien
\begin{DispWithArrows}[format=c]
\lambda_{max}\cdot T=k\quad k=2.89\cdot10^{-3}~m\cdot K \label{eq:wien}
\end{DispWithArrows}
\end{enumerate}
Esto nos permite estudiar la radiación emitida por un objeto teniendo en cuenta que no refleje nada, por ejemplo el Sol se ajusta muy bien a este modelo
\subsection{Clásicamente}
La teoría clásica presenta ciertos problemas que hacen difícil explicar correctamente el funcionamiento físico que hay de fondo.
\subsubsection{Catástrofe ultravioleta}
Este fallo en la teoría clásica recibe el nombre de \textbf{catástrofe ultravioleta}.
Esto se puede observar con el siguiente cálculo:
\quad
Suponiendo una objeto cúbico (por hacer más simples los cálculos) metálico, que es calentado; debido a ser un metal las ondas electromagnéticas en los bordes internos deben de ser 0 (por las condiciones de contorno por ser un conductor) por lo que las ondas deben ser estacionarias (Ver imagen \ref{fig:democn}).
\begin{wrapfigure}{r}{0.5\textwidth}
\centering
\vspace{-0.15cm}
\includegraphics[width=0.35 \textwidth]{democn.png}
\caption{Imagen esquemática }
\label{fig:democn}
\end{wrapfigure}
Cada una de esas ondas posee una \textbf{energía promedio} $\dl\bar{\varepsilon}\dr$ que debido al \textbf{Principio de Equipartición} crece de froma lineal con la temperatura de la siguiente forma:
\begin{DispWithArrows}[format=c]
\bar{\varepsilon}=k_BT \label{eq:eboltz}
\end{DispWithArrows}
En cuanto aumentemos la frecuencia disminuirá la longitud de onda. Este proceso se puede hacer infinitamente hasta tener infinitas ondas todas ellas con la misma energía haciendo que la energía total se dispare al infinito.
El \textbf{modelo clásico} si era útil para el estudio de \textbf{longitudes de onda grandes}, pero en cuanto se iba reduciendo empezaba a producir incongruencias.
Lo que se necesitaba era una $\dl\bar{\varepsilon}\dr$ que cambiara de la siguiente forma:
\begin{DispWithArrows}[format=c]
\bar{\varepsilon}\left\{ \begin{array}{c}
\lambda\rightarrow0 \longrightarrow \bar{\varepsilon}\rightarrow0 \\
\lambda\rightarrow\infty \longrightarrow \bar{\varepsilon}\rightarrow K_BT
\end{array}\right.\notag
\end{DispWithArrows}
La energía promedio $\dl\bar{\varepsilon}\dr$ de cada una de las longitudes de onda se calcula a partir de la distribución de probabilidad de Boltzmann:
\begin{DispWithArrows}[format=c]
P\dl\bar{\varepsilon}\dr=\dfrac{\dexp{-\frac{\varepsilon}{k_BT}}}{k_BT} \Arrow[]{} \\
\bar{\varepsilon}=\dint{0}{\infty}\varepsilon P\dl\varepsilon\dr d\varepsilon \label{eq:promedie}
\end{DispWithArrows}
Si se calcula esa integral de forma usual (considerando $\dl\varepsilon\dr$ una variable continua), se obtiene el \textbf{Principio de Equipartición}.
Como la energía debía depender de la frecuencia, puesto que la ecuación \textbf{\ref{eq:eboltz}} era válida para longitudes de onda grandes pero no para las pequeñas, el físico \textbf{Max Planck} sugirió un idea.
\subsection{Hipótesis de Planck}
Debido al fallo de la teoría clásica el físico \textit{Max Planck} sugirió una hipótesis que iniciaría un cambio en la física.
\begin{Hipótesis}[Hipotesis de Planck]
La energía no es continua sino discreta. Mantenemos la distribución de Boltzmann pero, \newline en vez de realizar la integral continua, discretizamos la integral con $\Delta\varepsilon=h\nu$.
\end{Hipótesis}
\begin{figure}[H]
\centering
\begin{subfigure}[b]{0.22\textwidth}
\centering
\includegraphics[width=\linewidth]{casie.png}
\caption{La discretización parece continua}
\label{fig:}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.22\textwidth}
\centering
\includegraphics[width=\linewidth]{menose.png}
\caption{Empiezan a notarse los efectos discretos}
\label{fig:}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.22\textwidth}
\centering
\includegraphics[width=\linewidth]{nadae.png}
\caption{La energía ya no es equivalente con el modelo continuo}
\label{fig:}
\end{subfigure}\hfill
\caption{Discretización de $\varepsilon$}
\label{fig:}
\end{figure}
Esta idea permite que para grandes longitudes de onda la energía se comporte prácticamente de forma continua pero no para las pequeñas.
De esta idea salió una nueva definición del promedio energético diferente a la de la ecuación \textbf{\ref{eq:promedie}}, de tal forma que obtenemos:
\begin{DispWithArrows}[format=c]
\bar{\varepsilon}=\dfrac{h\nu}{\dexp{\frac{h\nu}{k_BT}}-1}
\end{DispWithArrows}
Con éste resultado se prueba la ley de Stefan-Boltzmann (\textbf{\ref{eq:sboltz}}) y la ley de desplazamiento de Wien (\textbf{\ref{eq:wien}}), confirmando la hipótesis de Planck: la energía está \textbf{cuantizada} (en sistemas periódicos).
\end{document}
```
| https://tex.stackexchange.com/users/260576 | I want amsbook style but not the problems | false | The problem about TOC can be solved by the command
```
\numberwithin{section}{chapter}
```
I put it above the command `\begin{document}`
The problem about equation numbering can be solved by the command
```
\numberwithin{equation}{chapter}
```
at the same location as the previous command.
I don't know how to solve subsection and subsubsection problems yet.
| 0 | https://tex.stackexchange.com/users/299304 | 689005 | 319,634 |
https://tex.stackexchange.com/questions/688995 | 3 | I use TeXShop infrequently (last used it over 6 months ago, probably well over).
I'm on an M1 MacBook Air with MacOS Ventura, 13.4 (22F66).
Today I ran the auto update for TeXShop that was suggested when I launched it. When I attempt to typeset my document, I get an alert "Can't find required tool. `<path>/XeLaTeX.engine` does not have the executable bit set".
Because I was on TeXLive 2022 I downloaded MaxTeX installer for 2023 and ran that. Same issue. Current version of TeXShop is 5.12.
Here's what's in `<path>`:
```
marian@Bajj ~/L/T/Engines> ls -la
total 144
drwxr-xr-x@ 11 marian staff 352 Oct 22 2022 ./
drwxr-xr-x@ 21 marian staff 672 Jun 19 05:46 ../
-rw-r--r--@ 1 marian staff 216 Dec 7 2014 ConTeXt (LuaTeX).engine
drwxr-xr-x@ 28 marian staff 896 Jun 19 05:46 Inactive/
-rw-r--r--@ 1 marian staff 100 Dec 7 2014 LuaLaTeX.engine
-rw-r--r--@ 1 marian staff 100 Dec 7 2014 XeLaTeX.engine
-rw-r--r--@ 1 marian staff 97 Dec 7 2014 XeTeX.engine
-rw-r--r--@ 1 marian staff 22009 Dec 7 2014 nv-metafun.engine
-rw-r--r--@ 1 marian staff 21460 Dec 7 2014 nv-metapost.engine
-rw-r--r--@ 1 marian staff 555 Dec 7 2014 pdflatexmk.engine
-rw-r--r--@ 1 marian staff 557 Dec 7 2014 sepdflatexmk.engine
```
2014 is kind of old!
I tried moving `XeLaTeX.engine` aside and symlinking `Inactive/XeLaTeX-dev.engine` (just for the heck of it, it has a 2019 date on it at least) but had the same issue.
I'm stuck, and I sure hope someone can help me!
| https://tex.stackexchange.com/users/243866 | Can't typeset after updating TeXShop: "XeLaTeX.engine does not have the executable bit set" | true | It's odd that the executable bit is not set. But almost all of the contents of `~/Library/TeXShop` will regenerate themselves if deleted. So a simple solution would be to quit TeXShop, move your existing `~/Library/Engines` folder to the Desktop and then restart TeXShop. That should regenerate the default engines. If you customized any of your old engines, you can copy them back from the folder you moved to the Desktop.
If for some reason the executable bit is not set on the regenerated engines, you can do the following from the terminal:
```
chmod +x ~/Library/TeXShop/Engines/*.engine
```
But I would regenerate the folder as a first choice.
| 5 | https://tex.stackexchange.com/users/2693 | 689011 | 319,638 |
https://tex.stackexchange.com/questions/688626 | 3 | I would like to draw a random curve of specified length between two points. As an example, take the points `(0,0)` and `(10,10)`. How would one be able to connect them with a random curve of length 20?
According to this [answer](https://tex.stackexchange.com/a/214448/207524), there is a way to find the length of an already drawn curve, but I do not know where to begin on specifying the length beforehand. Any help is appreciated.
| https://tex.stackexchange.com/users/207524 | Curve with specified length between two points | true |
This is a random smooth curve from (1, 0) to (10, 9) of length ~30. It is obtained through a recursive decoration, `random curve of given length`. This decoration takes four arguments: the scaling factor for the "random points", the scaling factor for the tangent vectors at the random points, the step variation for the first factor, and the desired length.
**Some explanations concerning the construction**
1. It is based on a style `for random smooth curves` introduced through a `scope`. This style takes one argument, the number of random points. It performs some computations (mainly introduce the random numbers needed in the sequel and some individual constants `\cst{\i}` that allow some control on the random tangent vectors for aesthetic reasons (see 2.).
2. The curve is constructed (if needed) using a decoration `random curve test` which takes only two arguments (the first two of the recursive decoration). See the figure below.
Assume we don't like the curve around the points 1 and 3. We change the sign of the individual constants and arrive at the next figure.
3. We construct the desired curve using the recursive decoration.
4. I'm using @Gonzalo Medina idea for the length of the curve.
5. The seed if fixed through `\pgfmathsetseed{19}`. You might want to comment that line; notice that the testing phase makes no sense then. But there is a problem then; I decided to adopt a simple solution for the sign of the third argument of `random curve of given length` when it is invoked; it is based on the test step! If needed, I can modify the code...
**The code** (It produces the last drawing.)
```
\documentclass[11pt, margin=.5cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{math, calc}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{decorations.pathreplacing} % for show control points
\usepackage{pgfplots}
\makeatletter
\tikzset{%
measureme/.style={%
decoration={%
markings,
mark=at position 1 with {%
\tikzmath{
\lrc = \pgfdecoratedpathlength*1pt/1cm;
}
\pgfextra{\xdef\lrcG{\lrc}}
}
},
postaction=decorate
},
for smooth random curve/.style={%
evaluate={%
int \N@glc, \M@glc, \i, \j;
real \lrc;
\N@glc = #1;
\M@glc = #1 +1;
for \i in {1, ..., \N@glc}{%
\rndPx{\i} = .5 +1.5*rand;
\rndPy{\i} = .5 -1.5*rand;
};
for \i in {0, ..., \M@glc}{%
\cst{\i} = 1;
\rndVm{\i} = .2 +abs(rand);
\rndVa{\i} = 180*rand;
};
}
},
random curve test/.style 2 args={ % p scale / q scale
decoration={
show path construction,
lineto code={
\path (\tikzinputsegmentfirst) coordinate (P-0);
\path (\tikzinputsegmentlast) coordinate (P-\M@glc);
\path ($($(P-0)!1/\M@glc!(P-\M@glc)$) -(P-0)$) coordinate (v);
\foreach \i in {1, ..., \N@glc}{%
\path ($(P-0)!\i/\M@glc!(P-\M@glc)$)
let
\p1 = (v)
in ++({#1*\rndPx{\i}*\x1}, {#1*\rndPy{\i}*\y1})
coordinate (P-\i);
}
\foreach \i in {0, ..., \M@glc}{%
\path ($(0, 0)!{#2*\cst{\i}*\rndVm{\i}}!\rndVa{\i}: (v)$)
coordinate (v-\i);
}
\foreach \i in {0, ..., \M@glc}{%
\draw[green!70!black] (P-\i) circle (2pt) -- ++(v-\i)
node[pos=1.03, text=red] {\i};
}
\draw[measureme] (P-0)
\foreach \i [evaluate=\i as \j using {int(\i +1)}]
in {0, ..., \N@glc}{%
.. controls ++(v-\i) and ++([scale=-1] v-\j) .. (P-\j)
};
}
},
decorate
},
random curve of given length/.style n args={4}{%
% p scale / q scale / step / length
decoration={
show path construction,
lineto code={
\path (\tikzinputsegmentfirst) coordinate (P-0);
\path (\tikzinputsegmentlast) coordinate (P-\M@glc);
\path ($($(P-0)!1/\M@glc!(P-\M@glc)$) -(P-0)$) coordinate (v);
\foreach \i in {1, ..., \N@glc}{%
\path ($(P-0)!\i/\M@glc!(P-\M@glc)$)
let
\p1 = (v)
in ++({#1*\rndPx{\i}*\x1}, {#1*\rndPy{\i}*\y1})
coordinate (P-\i);
}
\foreach \i in {0, ..., \M@glc}{%
\path ($(0, 0)!{#2*\cst{\i}*\rndVm{\i}}!\rndVa{\i}: (v)$)
coordinate (v-\i);
}
\path[measureme] (P-0) % produces \lrcG, the length
\foreach \i [evaluate=\i as \j using {int(\i +1)}]
in {0, ..., \N@glc}{%
.. controls ++(v-\i) and ++([scale=-1] v-\j) .. (P-\j)
};
\tikzmath{%
\stp = #3;
\dMain = #4 -\lrcG;
if abs(\dMain)<.05 then {%
{%
\draw[red, measureme] (P-0)
\foreach \i [evaluate=\i as \j using {int(\i +1)}]
in {0, ..., \N@glc}{%
.. controls ++(v-\i) and ++([scale=-1] v-\j) .. (P-\j)
};
};
} else {%
if \dMain*\stp<0 then { \stp = -\stp/2; };
\pScale = #1 +\stp;
{%
\path[random curve of given length={\pScale}{#2}{\stp}{#4}]
(P-0) to (P-\M@glc);
};
};
}
}
},
decorate
}
}
\makeatother
\begin{document}
\begin{tikzpicture}[line cap=round]
\pgfmathsetseed{19}
\draw[gray!40] (0, 0) grid (10, 10);
\path (1, 0) coordinate (Pini);
\path (10, 9) coordinate (Pend);
\begin{scope}[for smooth random curve={4}]
\tikzmath{%
\cst{0} = 2;
\cst{1} = -1;
\cst{3} = -1;
}
\draw[random curve test={1}{1}] (Pini) to (Pend);
\draw[random curve of given length={1}{1}{.1}{30}] (Pini) to (Pend);
\end{scope}
\path let
\p1 = ($(Pend) -(Pini)$),
\n1 = {veclen(\x1, \y1)/1cm}
in (Pini) ++(3, -1) node {curve of length \lrcG};
\end{tikzpicture}
\end{document}
```
| 5 | https://tex.stackexchange.com/users/218261 | 689020 | 319,640 |
https://tex.stackexchange.com/questions/689018 | 2 | I want to remove the footer from my document but the page number won't disappear. I tried to follow some suggestions from other questions, and it should work but it doesn't.
What am I doing wrong?
`Version: This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/Debian) (preloaded format=latex) restricted \write18 enabled.`
```
\documentclass[a4paper,12pt,oneside]{book}
\usepackage{fancyhdr}
\begin{document}
\pagestyle{fancy}
\author{Somebody}
\title{The quick brown fox}
\fancyhf{}
\fancyfoot[L]{Test}
\maketitle
\chapter{Test One}
I know you followed me. Don't look so surprised.
\end{document}
```
| https://tex.stackexchange.com/users/119593 | Why the footer page number is not being removed with `fancyhdr` | true |
With the `book` class, the chapter introduction page uses the `plain` page style so that needs redefining:
```
\documentclass[a4paper,12pt,oneside]{book}
\usepackage{fancyhdr}
\fancyhead{}
\fancyfoot{}
\fancyfoot[L]{Test}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt} % Removes head rule
\fancypagestyle{plain}{% redefining plain pagestyle
\fancyfoot{}
\fancyhead{}
\fancyfoot[L]{Test}
}
\author{Somebody}
\title{The quick brown fox}
\begin{document}
\maketitle
\chapter{Test One}
I know you followed me. Don't look so surprised.
\end{document}
```
| 0 | https://tex.stackexchange.com/users/273733 | 689021 | 319,641 |
https://tex.stackexchange.com/questions/688645 | 3 | Is there a way to write arbitary `latexmk` command line options into the `latexmkrc` file?
For example, I think that instead of calling
```
latexmk -pdf -halt-on-error file.tex
```
I can put
```
$pdf_mode = 1
$pdflatex = ’pdflatex -halt-on-error %O %S’
```
in the `latexmkrc` file.
But this only works for `pdflatex`, so if I switch to `lualatex`, I have to
add the following.
```
$lualatex = ’lualatex -halt-on-error %O %S’
```
Now to solve this problem apparently there is a way to specify options for all latex compilers:
```
set_tex_cmds( '-halt-on-error %O %S' );
```
but this still involves some thinking since I have to recognize a command line option as one that is passed through to the tex compiler.
Isn't there a way to simply write `latexmk` command line options in the config file to have the same effect?
(I'm asking since I was trying to copy command line options from vscode latex-workshop config to `latexmkrc`.)
| https://tex.stackexchange.com/users/193342 | write latexmk command line options in latexmkrc | true | Nothing of this kind is currently implemented in latexmk.
However, although that statement is true of the the latexmk code itself, there is a way of achieving what you want. The trick is to notice that Perl puts the command line arguments in an array `@ARGV` and that latexmk processes the latexmkrc files before the command line. A latexmkrc file can modify `@ARGV`.
To prepend the options `-pdf` and `-halt-on-error` to the command line, you can do
```
unshift @ARGV, '-pdf', '-halt-on-error';
```
These options are processed after the latexmkrc files are processed, but before the options on the actual command line.
If you want the extra options to be processed after the options on the command line (e.g., to override them), you replace `unshift` by `push`.
| 4 | https://tex.stackexchange.com/users/8495 | 689030 | 319,642 |
https://tex.stackexchange.com/questions/689032 | 1 | I am designing a library that needs to deal with some verbatim code. For now, I use the great xsimverb package that provides nice things, like gobble, deal with basically all kinds of characters… I need to provide some arguments to my command, but the list of argument can sometime be annoying to add, and I'd like to provide some wrappers to the package, like:
```
\NewDocumentEnvironment{wrapperCode}{}%
{\begin{robExtCode}{some arguments}}%
{\end{robExtCode}}
```
but if I try to do that it fails with some errors:
```
! File ended while scanning use of ^^M.
```
How could I solve them? It would be even better if the wrapping environment could itself use `robExt` multiple times before the wrapping, but I can live without this. Of course, I could duplicate the code but I'd prefer to avoid it as I want my final users to be able to create new wrappers easily and they will not have access to my code (that might change). Therefore, if no simple solution exists, it is fine to create a function that automatically creates a new wrapping environment with the provided arguments.
**MWE:**
```
\documentclass[]{article}
\usepackage{xsimverb}
\usepackage{verbatim}
\ExplSyntaxOn
\ior_new:N \g_robExt_read_ior
\NewDocumentEnvironment{robExtCode}{m}{
\XSIMfilewritestart*{tmp-file-you-can-remove.tmp}
}{
\XSIMfilewritestop
%% Loop on all lines of the file to put it in l_robExt_content_named
%% but I might want to do other stuff here.
\ior_open:Nn \g_robExt_read_ior {tmp-file-you-can-remove.tmp}
\str_gclear:c {l_robExt_content_named}
\ior_str_map_inline:Nn \g_robExt_read_ior {
\str_gput_right:cx {l_robExt_content_named} {\tl_to_str:N{##1}^^J}
}
I ~ am ~ the ~ argument ~ ``#1'' ~and~ why~ not~ printing~ the~ file:~ \verbatiminput{tmp-file-you-can-remove.tmp}
}
\ExplSyntaxOff
\NewDocumentEnvironment{wrapperCode}{}{\begin{robExtCode}{some arguments}}{\end{robExtCode}}
\begin{document}
\begin{robExtCode}{some arguments}
# Here is a comment
print(1 % 2)
\end{robExtCode}
%%% DO NOT WORK
\begin{wrapperCode}
# Here is a second test
print(1 % 2)
\end{wrapperCode}
\end{document}
```
| https://tex.stackexchange.com/users/116348 | Wrapping verbatim environment (xsimverb) | true | The name of the string variable is wrong: it should start with `\g` and end with `_str`. No need for `c`.
The `\tl_to_str:N` function is incorrectly used; maybe `\tl_to_str:n`, but the argument is already in string format because of `\ior_str_map_inline:Nn`.
But the most important change is to use the “internal“ version of the environment.
```
\documentclass[]{article}
\usepackage{xsimverb}
\usepackage{verbatim}
\ExplSyntaxOn
\ior_new:N \g_robExt_read_ior
\str_new:N \g_robExt_content_str
\NewDocumentEnvironment{robExtCode}{m}{
\XSIMfilewritestart*{\jobname-tmp.tmp}
}{
\XSIMfilewritestop
%% Loop on all lines of the file to put it in \g_robExt_content_str
%% but I might want to do other stuff here.
\ior_open:Nn \g_robExt_read_ior {\jobname-tmp.tmp}
\str_gclear:N \g_robExt_content_str
\ior_str_map_inline:Nn \g_robExt_read_ior
{
\str_gput_right:Nx \g_robExt_content_str {##1^^J}
}
I ~ am ~ the ~ argument ~ ``#1'' ~and~ why~ not~ printing~ the~ file:~
\verbatiminput{\jobname-tmp.tmp}
}
\ExplSyntaxOff
% see how the inner environment is called!
\NewDocumentEnvironment{wrapperCode}{}{%
\robExtCode{some arguments}%
}{\endrobExtCode}
\begin{document}
\begin{robExtCode}{some arguments}
# Here is a comment
print(1 % 2)
\end{robExtCode}
%%% DO NOT WORK
\begin{wrapperCode}
# Here is a second test
print(1 % 2)
\end{wrapperCode}
\end{document}
```
You know what to do with the string variable, I don't. In this code it's completely unused.
| 1 | https://tex.stackexchange.com/users/4427 | 689036 | 319,646 |
https://tex.stackexchange.com/questions/656803 | 1 | I looking to create a chapter in a book I'm writing using the "Novel" documentclass, with blocks of text redacted.
I tried using alt-code 219 to replace the specific redacted characters, but I only get crossed boxes.
Are there any packages that might help me with this problem?
Thank you.
| https://tex.stackexchange.com/users/279836 | Redacted text in Novel DocumentClass | false | Using `\usepackage{censor}` you should be able to include [censor](http://tug.ctan.org/tex-archive/macros/latex/contrib/censor/censor.pdf).
I've not tried it out yet, but it should work like this:
```
This is \blackout{secret text}.
```
| 1 | https://tex.stackexchange.com/users/217643 | 689037 | 319,647 |
https://tex.stackexchange.com/questions/688987 | 2 | I'm new to Emacs. I followed some intructions to use it for Asymptote but that does not work.
In *~.emacs*, I have:
```
(add-to-list 'load-path "~/.emacs.d/site-lisp")
(load "asy-mode.el")
```
And in the folder *~/.emacs.d/site-lisp*, I have the file *asy-mode.el* containing
```
(add-to-list 'load-path "C:\PortableApps\MikTeX\texmfs\install\miktex\bin\x64")
(autoload 'asy-mode "asy-mode.el" "Asymptote major mode." t)
(autoload 'lasy-mode "asy-mode.el" "hybrid Asymptote/Latex major mode." t)
(autoload 'asy-insinuate-latex "asy-mode.el" "Asymptote insinuate LaTeX." t)
(add-to-list 'auto-mode-alist '("\\.asy$" . asy-mode))
```
Now when I open an ASY file in Emacs, I see nothing special.
| https://tex.stackexchange.com/users/18595 | How to configure Emacs for Asymptote? | false | I tried on my new miktex installation on W10,
I typed in my init file (~/.emacs.d/init.el)
```
(add-to-list 'load-path ( format "%s\\AppData\\Local\\Programs\\MiKTeX\\asymptote" (getenv "USERPROFILE")))
(requires 'asy-mode)
```
After Emacs restart a file with .asy extension is opened in asy-mode
| 1 | https://tex.stackexchange.com/users/119245 | 689038 | 319,648 |
https://tex.stackexchange.com/questions/689040 | 1 | My Table includes multiple subtables along with tablenotes at the end and they spend in two pages. I'm try to do page break and I refer to [this post](https://tex.stackexchange.com/questions/399937/two-pages-threeparttable-tabularx-extension), but it was a page break for footnotes only. Here is my code:
```
\documentclass[12pt]{article}
\usepackage{array, boldline}
\newcolumntype{Q}{>{\centering\arraybackslash}X}
\usepackage{booktabs}
\usepackage{subcaption}
\usepackage{tabularx}
\usepackage{threeparttable}
\begin{document}
\begin{table}
\footnotesize
\caption{Multiple Tables with Page Break}\label{tab:LD1}
\begin{threeparttable}
\centering\addtocounter{table}{-1}%
\begin{subtable}{1\textwidth}
\caption{Table 1}\label{tab:LD1-i}
\begin{tabularx}{\textwidth}{QQQQQQQ}
\toprule
& $c=$0.15 & 0.2 & 0.3 & 0.4 & 0.5 & 0.6 \\
\cmidrule{2-7}
$d=$0.9\tnote{b} & 0 & 0 & 0 & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.8 & 0 & 0 & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.7 & 0 & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.6 & 0 & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.5 & \textbf{0.5} &\textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.4 & \textbf{0.5} &\textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.3 & \textbf{0.5} &\textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.2 & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.1 & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
\bottomrule
\end{tabularx}
\end{subtable}\qquad
\begin{subtable}{1\textwidth}
\caption{Table 2}\label{tab:LD1-ii}
\begin{tabularx}{\textwidth}{QQQQQQQ}
\toprule
& $c=$0.15 & 0.2 & 0.3 & 0.4 & 0.5 & 0.6 \\
\cmidrule{2-7}
$d=$0.9 & 0 & 0 & 0 & 0.3692 & 0.3761 & 3799 \\
0.8 & 0 & 0 & 0.3798 & 0.3866 & 0.3901 & 0.3923 \\
0.7 & 0.3732 & 0.3840 & 0.3927 & 0.3965 & 0.3986 & 0.3998 \\
0.6 & 0.3903 & 0.3957 & 0.4006 & 0.4028 & 0.4040 & 0.4048 \\
0.5 & 0.3998 & 0.4028 & \textbf{0.4056} & \textbf{0.4070} & \textbf{0.4077} &
\textbf{0.4082} \\
0.4 & \textbf{0.4056} & \textbf{0.4074 } & \textbf{0.4090 } & \textbf{0.4098} &
\textbf{0.4103} & \textbf{0.4106} \\
0.3 & \textbf{0.4093} & \textbf{0.4103} & \textbf{0.4112} & \textbf{0.4117} &
\textbf{0.4120} & \textbf{0.4121} \\
0.2 & \textbf{0.4117} & \textbf{0.4122} & \textbf{0.4127} & \textbf{0.4129} &
\textbf{0.4131} & \textbf{0.4132} \\
0.1 & \textbf{0.4132} & \textbf{0.4134} & \textbf{0.4136} & \textbf{0.4137} &
\textbf{0.4138} & \textbf{0.4138} \\
\bottomrule
\end{tabularx}
\end{subtable}\qquad
\begin{subtable}{1\textwidth}
\caption{Table 3}\label{tab:LD1-iii}
\begin{tabularx}{\textwidth}{QQQQQQQ}
\toprule
& $c=$0.15 & 0.2 & 0.3 & 0.4 \\
\cmidrule{2-5}
$d=$0.9 & 0 & 0 & 0 & 0 \\
0.8 & 0 & 0 & 0 & 0.2769 \\
0.7 & 0 & 0.2789 & 0.2937 & 0.2996 \\
0.6 & 0.2932 & 0.3017 & 0.3090 & 0.3122 \\
0.5 & 0.3098 & 0.3142 & 0.3183 & 0.3202 \\
0.4 & 0.3196 & 0.3220 & 0.3244 & \textbf{0.3255} \\
0.3 & \textbf{0.3257} & \textbf{0.3270} & \textbf{0.3283} & \textbf{0.3290} \\
0.2 & \textbf{0.3295} & \textbf{0.3302} & \textbf{0.3309} & \textbf{0.3312} \\
0.1 & \textbf{0.3318} & \textbf{0.3321} & \textbf{0.3324} & \textbf{0.3326} \\
\bottomrule
\end{tabularx}
\end{subtable}\qquad
\begin{subtable}{1\textwidth}
\caption{Table 4}\label{tab:LD1-iv}
\begin{tabularx}{\textwidth}{QQQQQQQ}
\toprule
& $c=$0.15 & 0.2 & 0.3 & 0.35 \\
\cmidrule{2-5}
$d=$0.9 & 0 & 0 & 0 & 0 \\
0.8 & 0 & 0 & 0 & 0 \\
0.7 & 0 & 0 & 0.2623 & 0.2648 \\
0.6 & 0.2637 & 0.2730 & 0.2810 & 0.2823 \\
0.5 & 0.2829 & 0.2876 & 0.2919 & 0.2927 \\
0.4 & 0.2939 & 0.2965 & 0.2989 & 0.2993 \\
0.3 & 0.3007 & 0.3021 & 0.3034 & 0.3037 \\
0.2 & 0.3049 & 0.3056 & 0.3063 & 0.3064 \\
0.1 & 0.3074 & 0.3077 & 0.3081 & 0.3081 \\
\bottomrule
\end{tabularx}
\end{subtable}
\begin{subtable}{1\textwidth}
\caption{Table 4}\label{tab:LD1-iv}
\begin{tabularx}{\textwidth}{QQQQQQQ}
\toprule
& $c=$0.15 & 0.2 & 0.3 & 0.35 \\
\cmidrule{2-5}
$d=$0.9 & 0 & 0 & 0 & 0 \\
0.8 & 0 & 0 & 0 & 0 \\
0.7 & 0 & 0 & 0.2623 & 0.2648 \\
0.6 & 0.2637 & 0.2730 & 0.2810 & 0.2823 \\
0.5 & 0.2829 & 0.2876 & 0.2919 & 0.2927 \\
0.4 & 0.2939 & 0.2965 & 0.2989 & 0.2993 \\
0.3 & 0.3007 & 0.3021 & 0.3034 & 0.3037 \\
0.2 & 0.3049 & 0.3056 & 0.3063 & 0.3064 \\
0.1 & 0.3074 & 0.3077 & 0.3081 & 0.3081 \\
\bottomrule
\end{tabularx}
\end{subtable}
\begin{tablenotes}
\footnotesize
\item[1] Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah
\item[2] Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
```
| https://tex.stackexchange.com/users/47553 | Page break in threeparttable with subtables | true | It looks like the first three tabular-like environments will fit on one page, while the final two tabular-like environments will fit on another. To address your formatting objectives, I suggest you (a) use two separate `table` environments, with a `\ContinuedFloat` directive at the start of the second `table` environment, (b) use just one `subtable` environment per `table` environment, (c) embed the `threeparttable` environments inside the `subtable` environments, and (d) provide separate `tablenotes` environments at the end of each `threeparttable` environment. Separately, as there seems to be no need for automatic line wrapping within cells, I would also (e) switch from using `tabularx` environments to using `tabular*` environments for the five (sub)tables.
```
\documentclass[12pt]{article}
\usepackage[letterpaper,vmargin=1in]{geometry} % set page parameters as needed
\usepackage{array,booktabs}
\usepackage{subcaption}
\captionsetup[table]{skip=0.5\baselineskip}
\captionsetup[subtable]{skip=0.25\baselineskip}
\usepackage[flushleft]{threeparttable}
\begin{document}
\begin{table}[p]
\setlength{\tabcolsep}{0pt} % let LaTeX figure out the intercolumn whitespace
\caption{Multiple Tables with Page Break}
\label{tab:LD1}
\begin{subtable}{1\textwidth}
\begin{threeparttable}
\caption{Table AA}\label{tab:LD1-i}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ccccccc}
\toprule
& $c=0.15$ & 0.2 & 0.3 & 0.4 & 0.5 & 0.6 \\
\cmidrule{2-7}
$d=0.9$\tnote{a} & 0 & 0 & 0 & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.8 & 0 & 0 & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.7 & 0 & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.6 & 0 & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.5 & \textbf{0.5} &\textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.4 & \textbf{0.5} &\textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.3 & \textbf{0.5} &\textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.2 & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
0.1 & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} & \textbf{0.5} \\
\bottomrule
\end{tabular*}
\bigskip
\caption{Table BB}\label{tab:LD1-ii}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ccccccc}
\toprule
& $c=0.15$ & 0.2 & 0.3 & 0.4 & 0.5 & 0.6 \\
\cmidrule{2-7}
$d=0.9$ & 0 & 0 & 0 & 0.3692 & 0.3761 & 3799 \\
0.8 & 0 & 0 & 0.3798 & 0.3866 & 0.3901 & 0.3923 \\
0.7 & 0.3732 & 0.3840 & 0.3927 & 0.3965 & 0.3986 & 0.3998 \\
0.6 & 0.3903 & 0.3957 & 0.4006 & 0.4028 & 0.4040 & 0.4048 \\
0.5 & 0.3998 & 0.4028 & \textbf{0.4056} & \textbf{0.4070} & \textbf{0.4077} &
\textbf{0.4082} \\
0.4 & \textbf{0.4056} & \textbf{0.4074 } & \textbf{0.4090 } & \textbf{0.4098} &
\textbf{0.4103} & \textbf{0.4106} \\
0.3 & \textbf{0.4093} & \textbf{0.4103} & \textbf{0.4112} & \textbf{0.4117} &
\textbf{0.4120} & \textbf{0.4121} \\
0.2 & \textbf{0.4117} & \textbf{0.4122} & \textbf{0.4127} & \textbf{0.4129} &
\textbf{0.4131} & \textbf{0.4132} \\
0.1 & \textbf{0.4132} & \textbf{0.4134} & \textbf{0.4136} & \textbf{0.4137} &
\textbf{0.4138} & \textbf{0.4138} \\
\bottomrule
\end{tabular*}
\bigskip
\caption{Table CC}\label{tab:LD1-iii}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ccccc}
\toprule
& $c=0.15$ & 0.2 & 0.3 & 0.4 \\
\cmidrule{2-5}
$d=0.9$ & 0 & 0 & 0 & 0 \\
0.8 & 0 & 0 & 0 & 0.2769 \\
0.7 & 0 & 0.2789 & 0.2937 & 0.2996 \\
0.6 & 0.2932 & 0.3017 & 0.3090 & 0.3122 \\
0.5 & 0.3098 & 0.3142 & 0.3183 & 0.3202 \\
0.4 & 0.3196 & 0.3220 & 0.3244 & \textbf{0.3255} \\
0.3 & \textbf{0.3257} & \textbf{0.3270} & \textbf{0.3283} & \textbf{0.3290} \\
0.2 & \textbf{0.3295} & \textbf{0.3302} & \textbf{0.3309} & \textbf{0.3312} \\
0.1 & \textbf{0.3318} & \textbf{0.3321} & \textbf{0.3324} & \textbf{0.3326} \\
\bottomrule
\end{tabular*}
\bigskip
\footnotesize
\begin{tablenotes}
\item[a] Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah
\end{tablenotes}
\end{threeparttable}
\end{subtable}
\end{table}
%% allow a page break to occur
\begin{table}[p]
\setlength{\tabcolsep}{0pt}
\ContinuedFloat
\caption{Multiple Tables with Page Break, continued}
\begin{subtable}{1\textwidth}
\begin{threeparttable}
\caption{Table DD}\label{tab:LD1-iv}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ccccc}
\toprule
& $c=0.15$\tnote{b} & 0.2 & 0.3 & 0.35 \\
\cmidrule{2-5}
$d=0.9$ & 0 & 0 & 0 & 0 \\
0.8 & 0 & 0 & 0 & 0 \\
0.7 & 0 & 0 & 0.2623 & 0.2648 \\
0.6 & 0.2637 & 0.2730 & 0.2810 & 0.2823 \\
0.5 & 0.2829 & 0.2876 & 0.2919 & 0.2927 \\
0.4 & 0.2939 & 0.2965 & 0.2989 & 0.2993 \\
0.3 & 0.3007 & 0.3021 & 0.3034 & 0.3037 \\
0.2 & 0.3049 & 0.3056 & 0.3063 & 0.3064 \\
0.1 & 0.3074 & 0.3077 & 0.3081 & 0.3081 \\
\bottomrule
\end{tabular*}
\bigskip
\caption{Table EE}\label{tab:LD1-v}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ccccc}
\toprule
& $c=0.15$ & 0.2 & 0.3 & 0.35 \\
\cmidrule{2-5}
$d=0.9$ & 0 & 0 & 0 & 0 \\
0.8 & 0 & 0 & 0 & 0 \\
0.7 & 0 & 0 & 0.2623 & 0.2648 \\
0.6 & 0.2637 & 0.2730 & 0.2810 & 0.2823 \\
0.5 & 0.2829 & 0.2876 & 0.2919 & 0.2927 \\
0.4 & 0.2939 & 0.2965 & 0.2989 & 0.2993 \\
0.3 & 0.3007 & 0.3021 & 0.3034 & 0.3037 \\
0.2 & 0.3049 & 0.3056 & 0.3063 & 0.3064 \\
0.1 & 0.3074 & 0.3077 & 0.3081 & 0.3081 \\
\bottomrule
\end{tabular*}
\bigskip
\footnotesize
\begin{tablenotes}
\item[b] Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah
\end{tablenotes}
\end{threeparttable}
\end{subtable}
\end{table}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/5001 | 689041 | 319,649 |
https://tex.stackexchange.com/questions/688931 | 0 | I have been using lists inside `multicols` for a "condensed" typesetting of lists of short items. However, I do not like what happens if a page break occurs inside, and I couldn't find a way to automatically force a page break before `multicols` if it cannot fit onto the current page.
So I have been thinking about using some kind of a table environment to typeset a single-row table with lists in cells.
However, I would like to make the lists in cells spread vertically so that their tops and bottoms be aligned (except when this wouldn't make sense), like columns in `multicols`.
So far I do not see how to make a table whose height is determined by the maximal natural height of its cells, and where I could make the contents of any cell spread vertically to align top and bottom baselines. Is it possible? How?
This might look like not a very natural thing to do, but I am used to the behaviour of lists in `multicols`, and I would like to avoid situations where, despite having the same number of items, the bottoms are not aligned because of accumulation of minor height differences.
| https://tex.stackexchange.com/users/37291 | Table cells with vertically spread contents | false | If I understand the problem, you have a 3-column list that is does not fit in the page:
```
\documentclass{article}
\usepackage{lipsum}
\usepackage{multicol}
\begin{document}
\lipsum[1-4]
%\begin{table}
\begin{multicols}{3}
\begin{itemize}
\item foo \item bar \item baz
\item foo \item bar \item baz
\item foo \item bar \item baz
\item foo \item bar \item baz
\item foo \item bar \item baz
\item foo \item bar \item baz
\item foo \item bar \item baz
\item foo \item bar \item baz
\item foo \item bar \item baz
\end{itemize}
\end{multicols}
%\end{table}
\lipsum[5-8]
\end{document}
```
So you want is pass to the next page. The solution is as simple as put in a `table` or `figure` float to move the whole list to the next page (Example: uncomment lines 6 and 20 of the above MWE *et voilá*. Of course, this can move more o less text after the list to before of the list, to avoid gaps due to the premature page break.
If this is a problem, then you can use the `[H`] option for the float (need the `float` package) or simpler, use any non-float box, for example `\parbox{\linewidth}{your multicols here}`.
Personally, I indeed will use the float without any option, even if the list move out far of the logical order, because numbered captions and cross references exist just for this cases while the alternative is redesign the text or allow a horrible gap much worse that allow the page break within the list.
| 1 | https://tex.stackexchange.com/users/11604 | 689044 | 319,651 |
https://tex.stackexchange.com/questions/689047 | 1 | In a paper with figures generated from simulations, I would like to specify the parameters used to run the simulations in an appendix section. How do I implement a command within each figure environment that will add a subsection to a section in the appendix which specifies these details for each figure. I imagine something like this:
```
\begin{figure}
\centering
\includegraphics[width=\linewidth]{fig1.png}
\caption{Description of figure 1...}
\label{fig:fig1}
\altcaption{Nitty-gritty details of figure \ref{fig:fig1}...}
\end{figure}
... some body text ...
\begin{figure}
\centering
\includegraphics[width=\linewidth]{fig2.png}
\caption{Description of figure 2...}
\label{fig:fig2}
\altcaption{Nitty-gritty details of figure \ref{fig:fig2}... Maybe even contains a reference to \ref{fig:fig1}}
\end{figure}
... rest of body text...
\appendix
\section{Appendix 1}
... appendix 1 text ...
\section{Figure details}
\altcaptionlist
```
which would output an appendix section titled "Figure details" whose subsections are titled "Figure 1 details" and "Figure 2 details" and whose contents would include "Nitty-gritty details of figure 1" and "Nitty-gritty details of figure 2... Maybe even contains a reference to figure 1", respectively.
An ideal implementation would have the above form, but anything that produces this sort of result without manual organization of the appendix subsections would be greatly appreciated.
Thank you!
| https://tex.stackexchange.com/users/299339 | Alternate figure captions in appendix | true | You can make `\altcaption` be synonymous to a macro that adds an item to a list, while `\altcaptionlist` processes this list of stored items. Using [`etoolbox`](//ctan.org/pkg/etoolbox)'s list processing capabilities, this is fairly straight forward.
```
\documentclass{article}
\usepackage{etoolbox}
\NewDocumentCommand{\altcaption}{}{\listgadd{\altcaplist}}% Store \altcaption in list \altcaplist
\NewDocumentCommand{\altcaptionlist}{}{%
% Process \altcaplist
\begin{itemize}
\RenewDocumentCommand{\do}{ m }{\item ##1}% Each item is an \item
\dolistloop{\altcaplist}%
\end{itemize}
}
\begin{document}
\begin{figure}
\caption{Description of first figure}
\label{fig:fig1}
\altcaption{Nitty-gritty details of Figure~\ref{fig:fig1}\ldots}
\end{figure}
\ldots some body text\ldots
\begin{figure}
\caption{Description of second figure}
\label{fig:fig2}
\altcaption{Nitty-gritty details of Figure~\ref{fig:fig2}\ldots Maybe even contains a reference to Figure~\ref{fig:fig1}}
\end{figure}
\ldots rest of body text\ldots
\appendix
\section{Appendix 1}
\ldots Appendix text\ldots
\section{Figure details}
\altcaptionlist
\end{document}
```
| 1 | https://tex.stackexchange.com/users/5764 | 689048 | 319,652 |
https://tex.stackexchange.com/questions/689046 | 1 | I'm creating a table for my thesis but when I'm compiling it, it shrinks because of the \resizebox{\columnwidth}{!} command. I would like to know if I could make the font size bigger without making the table overpass the page limits. Here's how I created my table:
```
\begin{table}[]
\caption{Sujetos de Información}
\label{tab:my-table}
\resizebox{\columnwidth}{!}{%
\begin{tabular}{|cclll|}
\hline
\multicolumn{5}{|c|}{Sujetos de Información} \\ \hline
\multicolumn{1}{|c|}{Rol} & \multicolumn{1}{c|}{Cantidad} & \multicolumn{1}{c|}{Responsabilidades} & \multicolumn{1}{c|}{Relación al Proyecto} & \multicolumn{1}{c|}{Información Brindada} \\ \hline
\multicolumn{1}{|c|}{Jefe del Área Técnica} & \multicolumn{1}{c|}{1} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}Distribuye a los mecánicos según las necesidades de cada área para que las máquinas\\ puedan ser atendidas y reparadas dentro de los tiempos esperados.\end{tabular}} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}Brindar información y ayuda para la\\ mejora y rediseño del sistema\\ mecánico del módulo de inspección\\ de la máquina\end{tabular}} & \\ \hline
\multicolumn{1}{|c|}{Técnicos Mecánicos} & \multicolumn{1}{c|}{10} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}Encargados de realizar mantenimientos correctivos y preventivos a las máquinas de cada\\ una de las áreas, los cuales deben de ejecutarse en un tiempo establecido según la máquina.\\ También pueden reportar problemas de mayor dificultad a los superiores para el arreglo de la\\ máquina.\end{tabular}} & \multicolumn{1}{c|}{Interesados Directos de la Solución.} & \\ \hline
\multicolumn{1}{|c|}{Gerente de Ingeniería Mainstream} & \multicolumn{1}{c|}{1} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}Encargado del área de ingeniería mecánica de las máquinas para conectores. Realiza la \\ administración de proyectos y tareas relacionadas a las mejores o cambios mecánicos \\ que deban ser realizados a las máquinas.\end{tabular}} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}Brindar información y ayuda para la\\ mejora y rediseño del sistema\\ mecánico del módulo de inspección\\ de la máquina\end{tabular}} & \\ \hline
\multicolumn{1}{|c|}{Gerente de Ingeniería Eléctrica} & \multicolumn{1}{c|}{1} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}Encargado de la automatización de la empresa. Analiza mejoras y actualizaciones que pueden\\ ser implementadas en las máquinas, analizando la parte lógica de la máquina y los \\ componentes y dispositivos de control y potencia.\end{tabular}} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}Brindar información y ayuda para la\\ mejora y rediseño del sistema\\ mecánico del módulo de inspección\\ de la máquina\end{tabular}} & \\ \hline
\multicolumn{1}{|c|}{Técnicos Eléctricos} & \multicolumn{1}{c|}{3} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}Encargados de la automatización en el campo como cableado y conectividad de equipos.\\ Proporcionan mantenimiento y atienden las averías en toda la empresa.\end{tabular}} & \multicolumn{1}{l|}{Interesados Directos de la Solución.} & \\ \hline
\multicolumn{1}{|c|}{Gerente de Producción} & \multicolumn{1}{c|}{1} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}Encargado de la producción de la empresa. Se encarga de comprobar que la productividad \\ se encuentre en los valores esperados y no caigan.\end{tabular}} & \multicolumn{1}{l|}{Interesados Directos de la Solución.} & \\ \hline
\multicolumn{1}{|c|}{Supervisor de Automation} & \multicolumn{1}{c|}{1} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}Encargado del área de Automation. Administra los operarios del área para que trabajen\\ según las órdenes de alta, media y baja prioridad, asignándolos a las diferentes máquinas\\ según corresponda.\end{tabular}} & \multicolumn{1}{l|}{Interesados Directos de la Solución.} & \\ \hline
\multicolumn{1}{|c|}{Operarios de Automation} & \multicolumn{1}{c|}{30} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}Operarios del área de Automation. Recargan las máquinas con los bodies plásticos para los \\ componentes, verifican medidas críticas del componente, reparan fallas leves de la máquina\\ y reportan averías mayores de la misma.\end{tabular}} & \multicolumn{1}{l|}{Interesados Directos de la Solución.} & \\ \hline
\end{tabular}%
}
```
\end{table}
Thanks for the help
| https://tex.stackexchange.com/users/299105 | Change Font Size in Table instead of the \resizebox{\columnwidth}{!} command | true | No need to change the font size. Instead, I suggest you switch from `tabular` to [tabularx](https://www.ctan.org/pkg/tabularx) to enable automatic line breaking in the cells. And, do make columns 3 and 4 wider than columns 1, 2, and 5.
```
\documentclass[10pt]{article} % or some other suitable document class
\usepackage[a4paper,margin=2.5cm]{geometry} % set page parameters appropriately
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\usepackage{tabularx} % for 'tabularx' env. and 'X' col. type
\usepackage{ragged2e} % for '\RaggedRight' and '\Centering' macros
\newcolumntype{L}[1]{>{\hsize=#1\hsize\RaggedRight\hspace{0pt}}X}
\newcolumntype{C}[1]{>{\hsize=#1\hsize\Centering\hspace{0pt}}X}
\usepackage{booktabs} % for well-spaced horizontal rules
\begin{document}
\begin{table}
\setlength{\tabcolsep}{3pt} % default: 6pt
\caption{Sujetos de Información\strut}
\label{tab:my-table}
\begin{tabularx}{\linewidth}{@{} L{0.65} C{0.4} L{2} L{1.3} L{0.65} @{}}
% Note: 0.65+0.4+2+1.3+0.65 = 5 = # of X-type columns
\toprule
%\multicolumn{5}{c}{Sujetos de Información} \\
%\addlinespace % \hline
Rol & Cantidad & Responsabilidades
& Relación al Proyecto & Información Brindada \\
\midrule
Jefe del Área Técnica & 1
& Distribuye a los mecánicos según las necesidades de cada área para que las máquinas puedan ser atendidas y reparadas dentro de los tiempos esperados.
& Brindar información y ayuda para la mejora y rediseño del sistema mecánico del módulo de inspección de la máquina
& \\ \addlinespace % \hline
Técnicos Mecánicos & 10
& Encargados de realizar mantenimientos correctivos y preventivos a las máquinas de cada una de las áreas, los cuales deben de ejecutarse en un tiempo establecido según la máquina. También pueden reportar problemas de mayor dificultad a los superiores para el arreglo de la máquina.
& Interesados Directos de la Solución.
& \\ \addlinespace % \hline
Gerente de Ingeniería Mainstream & 1
& Encargado del área de ingeniería mecánica de las máquinas para conectores. Realiza la administración de proyectos y tareas relacionadas a las mejores o cambios mecánicos que deban ser realizados a las máquinas.
& Brindar información y ayuda para la mejora y rediseño del sistema mecánico del módulo de inspección de la máquina
& \\ \addlinespace % \hline
Gerente de Ingeniería Eléctrica & 1
& Encargado de la automatización de la empresa. Analiza mejoras y actualizaciones que pueden ser implementadas en las máquinas, analizando la parte lógica de la máquina y los componentes y dispositivos de control y potencia.
& Brindar información y ayuda para la mejora y rediseño del sistema mecánico del módulo de inspección de la máquina
& \\ \addlinespace % \hline
Técnicos Eléctricos & 3
& Encargados de la automatización en el campo como cableado y conectividad de equipos. Proporcionan mantenimiento y atienden las averías en toda la empresa.
& Interesados Directos de la Solución.
& \\ \addlinespace % \hline
Gerente de Producción & 1
& Encargado de la producción de la empresa. Se encarga de comprobar que la productividad se encuentre en los valores esperados y no caigan.
& Interesados Directos de la Solución.
& \\ \addlinespace % \hline
Supervisor de Automation & 1
& Encargado del área de Automation. Administra los operarios del área para que trabajen según las órdenes de alta, media y baja prioridad, asignándolos a las diferentes máquinas según corresponda.
& Interesados Directos de la Solución.
& \\ \addlinespace % \hline
Operarios de Automation & 30
& Operarios del área de Automation. Recargan las máquinas con los bodies plásticos para los componentes, verifican medidas críticas del componente, reparan fallas leves de la máquina y reportan averías mayores de la misma.
& Interesados Directos de la Solución.
& \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/5001 | 689050 | 319,653 |
https://tex.stackexchange.com/questions/31354 | 20 | Using `amsthm`, is there a possibility to remove the dot when typing
`\begin{proof}...\end{proof}`? This would be typeset as "Proof." If you change your proofname `\begin{proof}[Proof:]...\end{proof}` you would get "Proof:"; but for typesetting without a dot or colon?
| https://tex.stackexchange.com/users/7548 | How to remove the "." in the proof environment? | false | use `\nopunct` with `\renewcommand{\proofname}{\bfseries{证:}\nopunct}` will do the trick.
| 0 | https://tex.stackexchange.com/users/285396 | 689051 | 319,654 |
https://tex.stackexchange.com/questions/689053 | 2 | I have not got any solution after a few try. In latex, how we can comment out a single word from a line. I mean for example
```
Hello %this is so on
```
it comments out *this* and the rest of the line as well. Is there any way to comment out only *this* part, not the rest of the line ?
| https://tex.stackexchange.com/users/292649 | commenting out a single word from a line | false | Basically, no.
But in LaTeX
```
Hello this is so on
```
is the same has
```
Hello this
is so on
```
So you can just do
```
Hello %this
is so on
```
You can use tricks to just remove part of a line, like
```
Hello \iffalse this\fi is so on
```
(Or several other things, [like using the `comment` package](https://ctan.org/pkg/comment?lang=en)), but that's overly complex.
| 1 | https://tex.stackexchange.com/users/38080 | 689055 | 319,656 |
https://tex.stackexchange.com/questions/680831 | 1 | Installed MacTex2023 on a new Mac and all is well except for a nagging issue with "pygmentize" that I've already installed. I cannot find how to adjust system to recognise the installed "pygmentize" that exists in my "/Users//Library/Python/3.9/bin" folder.
I have upgraded to Python 3.11 and used pip3 to confirm that Pygments 2.14.0 is installed.
I've already checked those SE pages that discuss Pygmentize issues, e.g. at [Pygmentize not working properly with minted package in TexShop on OS X](https://tex.stackexchange.com/questions/279214/pygmentize-not-working-properly-with-minted-package-in-texshop-on-os-x/281188#281188)
Additional specs via 'pip3 list':
Package Version
---
1. altgraph 0.17.2
2. future 0.18.2
3. macholib 1.15.2
4. pip 23.0.1
5. Pygments 2.14.0
6. setuptools 67.6.0
7. six 1.15.0
8. wheel 0.40.0
Note: When I run the following minimal LaTeX package, I see the same error:
```
\documentclass{article}
\usepackage{minted}
\begin{document}
\begin{minted}{c}
int main() {
printf("hello, world");
return 0;
}
\end{minted}
\end{document}
```
e.g.: 'Package minted Error: You must have `pygmentize' installed to use this package.'
Note 2: I Typeset to LaTeX using TexShop.
| https://tex.stackexchange.com/users/213365 | Package minted Error: You must have `pygmentize' installed to use this package, while Pygments is already installed? | false | The pygmentize issue can be addressed by installing pygments with pip2.
```
sudo pip2 install pygments
```
This method works on my cases.
| 0 | https://tex.stackexchange.com/users/299333 | 689056 | 319,657 |
https://tex.stackexchange.com/questions/426664 | 4 | **Problem:**
I get multiple undefined control sequences when using the package `minted` and I believe it is caused by pygmentize.
**Background**
I use the software `Texpad` and the active LaTeX distribution is set to:
* `/usr/local/texlive/2016/bin/x86_64-darwin`
I then check both `python` and `pygmentize`:
* `which python` results in `/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python`
* `which pygmentize` results in `/opt/local/bin/pygmentize`
I have MacPorts installed and I check the active version by using:
* `port select --list python` which results in `python34 (active)`
**Question 1**
This is where I get confused, shouldn't `which python` also point to `/opt/local/bin/python`?
**Paths**
I check my `paths` by doing `nano ~/.bash_profile`, which results in:
```
export PATH=/System/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH
export PATH=/usr/local/texlive/2016/bin/x86_64-darwin:$PATH
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/:$PATH
##
# Your previous /Users/Batman/.bash_profile file was backed up as /Users/Batman/.bash_profile.macports-saved_$
##
# MacPorts Installer addition on 2017-02-12_at_00:07:31: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.
```
**Question 2**
What is required given the above information in order for pygmentize to work?
**Minimal Working Example (MWE):**
```
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{minted}
\usemintedstyle[php]{autumn}
\begin{document}
\begin{minted}{php}
<?php
try {
// Connect to SQL database
$dsn = new PDO('mysql:host=servername;dbname=databasename', 'username', 'password');
}
catch (PDOException $e) {
// Prints out error message
echo 'Error: ' . $e->getMessage();
}
?>
\end{minted}
\end{document}
```
| https://tex.stackexchange.com/users/13362 | Error with pygmentize when using minted package | false | The pygmentize issue can be addressed by installing pygments with pip2.
```
sudo pip2 install pygments
```
This method works on my cases.
| -1 | https://tex.stackexchange.com/users/299333 | 689057 | 319,658 |
https://tex.stackexchange.com/questions/689043 | 2 | I'd like to remove the excess space between two columns on a Beamer slide. There's a graph in one column, and a table in the other. I'd like the graph and the table to be closer together on the slide. Thank you ahead.
```
\documentclass[aspectratio=169]{beamer} % wide frame
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{positioning}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{frame}{Corpus size}
\begin{columns}[T]
\begin{column}{0.5\textwidth}
\centering
\begin{tikzpicture}
\begin{axis}[
every axis plot post/.style={/pgf/number format/fixed},
ybar,
bar width=.1\textwidth,
height=.55\textwidth, % Adjust the height of the axis to fit within the frame
ymin=0,
enlarge x limits=.5, % this controls the blank space to the left and to the right, but needs these two lines below:
% xmin={Texts}, %
xmax={Words}, %
ymax=1500, % this is where the y axis stops and the wavy line is drawn
xtick=data,
symbolic x coords={Texts,Words},
restrict y to domain*=0:1700, % Cut values off here, has to be higher than ymax
visualization depends on=rawy\as\rawy, % Save the unclipped values
after end axis/.code={ % Draw line indicating break
\draw [ultra thick, white, decoration={snake, amplitude=2pt}, decorate] (rel axis cs:0,1) -- (rel axis cs:2,1);
},
nodes near coords={%
\pgfmathprintnumber{\rawy}% Print unclipped values
},
axis lines*=left, % this is where the wavy line is drawn, but it is hidden
clip=false
]
\addplot [fill=orange!50] coordinates {(Texts,1117) (Words,5601719)};
\end{axis}
\end{tikzpicture}
\end{column}
%
\begin{column}{0.5\textwidth}
\centering
\small
\begin{tabular}{ccc} \hline
Subcorpus & Texts & Words \\ \hline \hline
Pseudo & 117 & 1000000 \\
Science & 1000 & 4000000 \\ \hline
\end{tabular}
\end{column}
\end{columns}
\end{frame}
\end{document}
```
| https://tex.stackexchange.com/users/299328 | Excess white space between columns in beamer slide | true | The white space between your image and table is a combination of two different effects:
* by default, beamer changes the page margins for columns to create some space between them. This is easy to avoid: you'll just need to use the `onlytextwidth` option
* the second factor is that your image and your table is much smaller than the width of your columns. You also centre them, which creates space between them. To avoid this you could a) make the left column smaller and the right column bigger and b) remove the centering so that your image and table will be left aligned inside their columns.
---
```
\documentclass[aspectratio=169]{beamer} % wide frame
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{positioning}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{frame}{Corpus size}
\begin{columns}[T,onlytextwidth]
\begin{column}{0.4\textwidth}
\begin{tikzpicture}
\begin{axis}[
every axis plot post/.style={/pgf/number format/fixed},
ybar,
bar width=0.7cm,
height=.45\textheight, % Adjust the height of the axis to fit within the frame
ymin=0,
enlarge x limits=.5, % this controls the blank space to the left and to the right, but needs these two lines below:
% xmin={Texts}, %
xmax={Words}, %
ymax=1500, % this is where the y axis stops and the wavy line is drawn
xtick=data,
symbolic x coords={Texts,Words},
restrict y to domain*=0:1700, % Cut values off here, has to be higher than ymax
visualization depends on=rawy\as\rawy, % Save the unclipped values
after end axis/.code={ % Draw line indicating break
\draw [ultra thick, white, decoration={snake, amplitude=2pt}, decorate] (rel axis cs:0,1) -- (rel axis cs:2,1);
},
nodes near coords={%
\pgfmathprintnumber{\rawy}% Print unclipped values
},
axis lines*=left, % this is where the wavy line is drawn, but it is hidden
clip=false
]
\addplot [fill=orange!50] coordinates {(Texts,1117) (Words,5601719)};
\end{axis}
\end{tikzpicture}
\end{column}
%
\begin{column}{0.6\textwidth}
\small
\begin{tabular}{ccc} \hline
Subcorpus & Texts & Words \\ \hline \hline
Pseudo & 117 & 1000000 \\
Science & 1000 & 4000000 \\ \hline
\end{tabular}
\end{column}
\end{columns}
\end{frame}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/36296 | 689067 | 319,662 |
https://tex.stackexchange.com/questions/689028 | 2 | I'm working on a Gospel book for liturgical use (~500 pages) based on the memoir document class (it can be processed with `pdfLaTeX` and the minimal example below, although I'm actually using `XeLaTeX`), and I've figured out how to produce a page border via the picture environment. The minimum example uses a couple of common glyphs to demonstrate the problem: I can't control the border, once the command for it has been issued. I'd like some pages to be truly blank and borderless.
Moving `\pageborder` to a point later in the document will allow prior pages to be borderless. But after that command is issued, how to produce borderless page? It seems that something would have to be added or modified to the `\pagestyle` command (or deeper still) to introduce a really blank page. But how? Or should I use another way to produce the border and not the picture environment?
I've seen what can be done with `pgfornaments`, etc. -- but I shy away from it since it looks too complicated to me! Maybe someone will convince me otherwise, but I'm skeptical. :-)
I'm using MacTeX 2022 installed on OS10.14.6.
```
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt,draft]{memoir}
\settypeblocksize{8in}{5in}{*}
\setlrmargins{*}{*}{1}
\setulmargins{1.5in}{*}{.5}
\checkandfixthelayout
\usepackage{fancybox}
\usepackage{lipsum}
\usepackage{color}
\newcommand\pageborder{
\fancyput{%
\setlength{\unitlength}{12bp}%
\begin{picture}(0,44)%
\fontsize{12bp}{12bp}\selectfont\color{red}%
\put(-2,3){+}% upper left corner
\put(-1,3){ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo}% top row
\put(40,3){+}% upper right corner
\put(-2,-57){+}% bottom left corner
\put(-1,-57){ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo}% botom row
\put(40,-57){+} % bottom right corner
\end{picture}}{}
}
\setsecnumdepth{chapter}
\pagestyle{ruled}
\makeevenhead{ruled}{\thepage}{\MakeLowercase{\scshape The Real Story}}{}
\makeoddhead{ruled}{}{\MakeLowercase{\scshape Raw and Unfiltered}}{\thepage}
\makeevenfoot{ruled}{}{}{}
\makeoddfoot{ruled}{}{}{}
\title{The Beginning of My Troubles…}
\author{Yours Truly}
\begin{document}
\maketitle\pageborder
\lipsum[1-9]
\chapter{I tried everything}
\lipsum[10-20]
\chapter{Same old same old}
\lipsum[21-24]\pagestyle{plain}
\lipsum[41]
\newpage\thispagestyle{empty}
\lipsum[44]
\end{document}
```
| https://tex.stackexchange.com/users/299317 | Page Border problem in memoir | false |
I added the border to the `ruled` and `plain` page styles. but not to `empty` so you can enable/disable borders using `\(this)pagestyle`
```
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt,draft]{memoir}
\settypeblocksize{8in}{5in}{*}
\setlrmargins{*}{*}{1}
\setulmargins{1.5in}{*}{.5}
\checkandfixthelayout
\usepackage{fancybox}
\usepackage{lipsum}
\usepackage{color}
\newcommand\pageborder{%<<< you need this
%\fancyput{%
\setlength{\unitlength}{12bp}%
\begin{picture}(0,0)% 0,0
\fontsize{12bp}{12bp}\selectfont\color{red}%
\put(-4,3){+}% upper left corner
\put(-3,3){ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo}% top row
\put(38,3){+}% upper right corner
\put(-4,-57){+}% bottom left corner
\put(-3,-57){ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo}% botom row
\put(38,-57){+} % bottom right corner
\end{picture}%<<< you need this
}
\setsecnumdepth{chapter}
\pagestyle{ruled}
\makeevenhead{ruled}{\pageborder\thepage}{\MakeLowercase{\scshape The Real Story}}{}
\makeoddhead{ruled}{\pageborder}{\MakeLowercase{\scshape Raw and Unfiltered}}{\thepage}
\makeevenfoot{ruled}{}{}{}
\makeoddfoot{ruled}{}{}{}
\makeevenhead{plain}{\pageborder}{}{}
\makeoddhead{plain}{\pageborder}{}{}
\title{The Beginning of My Troubles…}
\author{Yours Truly}
\begin{document}
\maketitle
\lipsum[1-9]
\chapter{I tried everything}
\lipsum[10-20]
\chapter{Same old same old}
\lipsum[21-24]\pagestyle{plain}
\lipsum[41]
\newpage\thispagestyle{empty}
\lipsum[44]
\end{document}
```
| 1 | https://tex.stackexchange.com/users/1090 | 689069 | 319,663 |
https://tex.stackexchange.com/questions/689071 | 2 | When I am compiling this code:
```
\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{tcolorbox,tikz}
\usepackage{lipsum,lmodern}
\usetikzlibrary{calc}
\tcbuselibrary{skins,listings,breakable,poster}
\newtcolorbox[auto counter]{example}[2]{%
enhanced,
left skip=1cm,attach boxed title to top text left={yshift=-\tcboxedtitleheight/2,yshifttext=-2mm},
boxed title style={colframe=#1!40!white,arc=3mm},
colback=#1!10!white,colframe=#1!10!white,coltitle=black,colbacktitle=#1!10!white,
fonttitle=\bfseries,
title=Example,
underlay boxed title={
\node [circle,fill=#1!10!white,draw=#1!40!white,inner sep=1pt] (A) at ($(title.west) + (-8mm,0)$){\thetcbcounter};
\draw[#1!40!white,-{stealth}] (title.west) -- (A) -- (frame.south west-|A);},
#2
}
\newtcolorbox[auto counter]{sol}[2]
{%
enhanced,
left skip=1cm,attach boxed title to top text left={yshift=-\tcboxedtitleheight/2,yshifttext=-2mm},
boxed title style={colframe=#1!40!white,arc=3mm},
colback=#1!10!white,colframe=#1!10!white,coltitle=black,colbacktitle=#1!10!white,
fonttitle=\bfseries,
title=Solution,
underlay boxed title={
\node [circle,fill=#1!10!white,draw=#1!40!white,inner sep=1pt] (A) at ($(title.west) + (-8mm,0)$){\thetcbcounter};
\draw[#1!40!white,-{stealth}] (title.west) -- (A) -- (frame.south west-|A);},
#2
}
\begin{document}
\begin{example}{blue}
Our Example
\end{example}
\begin{sol}{red}
here is the solution
\end{sol}
\end{document}
```
Throw this error:
```
Package pgfkeys: I do not know the key '/tcb/O' and I am going to ignore it. Perhaps you misspelled it.
Package pgfkeys: I do not know the key '/tcb/h' and I am going to ignore it. Perhaps you misspelled it.
```
| https://tex.stackexchange.com/users/288837 | Package pgfkeys: I do not know the key '/tcb/O' and I am going to ignore it | true | If you want to use
```
\begin{example}{blue}
Our Example
\end{example}
```
your definition should have one mandatory argument, not two:
```
\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{tcolorbox,tikz}
\usepackage{lipsum,lmodern}
\usetikzlibrary{calc}
\tcbuselibrary{skins,listings,breakable,poster}
\newtcolorbox[auto counter]{example}[1]{%
enhanced,
left skip=1cm,attach boxed title to top text left={yshift=-\tcboxedtitleheight/2,yshifttext=-2mm},
boxed title style={colframe=#1!40!white,arc=3mm},
colback=#1!10!white,colframe=#1!10!white,coltitle=black,colbacktitle=#1!10!white,
fonttitle=\bfseries,
title=Example,
underlay boxed title={
\node [circle,fill=#1!10!white,draw=#1!40!white,inner sep=1pt] (A) at ($(title.west) + (-8mm,0)$){\thetcbcounter};
\draw[#1!40!white,-{stealth}] (title.west) -- (A) -- (frame.south west-|A);},
% #2
}
\newtcolorbox[auto counter]{sol}[1]
{%
enhanced,
left skip=1cm,attach boxed title to top text left={yshift=-\tcboxedtitleheight/2,yshifttext=-2mm},
boxed title style={colframe=#1!40!white,arc=3mm},
colback=#1!10!white,colframe=#1!10!white,coltitle=black,colbacktitle=#1!10!white,
fonttitle=\bfseries,
title=Solution,
underlay boxed title={
\node [circle,fill=#1!10!white,draw=#1!40!white,inner sep=1pt] (A) at ($(title.west) + (-8mm,0)$){\thetcbcounter};
\draw[#1!40!white,-{stealth}] (title.west) -- (A) -- (frame.south west-|A);},
% #2
}
\begin{document}
\begin{example}{blue}
Our Example
\end{example}
\begin{sol}{red}
here is the solution
\end{sol}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/36296 | 689073 | 319,666 |
https://tex.stackexchange.com/questions/689071 | 2 | When I am compiling this code:
```
\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{tcolorbox,tikz}
\usepackage{lipsum,lmodern}
\usetikzlibrary{calc}
\tcbuselibrary{skins,listings,breakable,poster}
\newtcolorbox[auto counter]{example}[2]{%
enhanced,
left skip=1cm,attach boxed title to top text left={yshift=-\tcboxedtitleheight/2,yshifttext=-2mm},
boxed title style={colframe=#1!40!white,arc=3mm},
colback=#1!10!white,colframe=#1!10!white,coltitle=black,colbacktitle=#1!10!white,
fonttitle=\bfseries,
title=Example,
underlay boxed title={
\node [circle,fill=#1!10!white,draw=#1!40!white,inner sep=1pt] (A) at ($(title.west) + (-8mm,0)$){\thetcbcounter};
\draw[#1!40!white,-{stealth}] (title.west) -- (A) -- (frame.south west-|A);},
#2
}
\newtcolorbox[auto counter]{sol}[2]
{%
enhanced,
left skip=1cm,attach boxed title to top text left={yshift=-\tcboxedtitleheight/2,yshifttext=-2mm},
boxed title style={colframe=#1!40!white,arc=3mm},
colback=#1!10!white,colframe=#1!10!white,coltitle=black,colbacktitle=#1!10!white,
fonttitle=\bfseries,
title=Solution,
underlay boxed title={
\node [circle,fill=#1!10!white,draw=#1!40!white,inner sep=1pt] (A) at ($(title.west) + (-8mm,0)$){\thetcbcounter};
\draw[#1!40!white,-{stealth}] (title.west) -- (A) -- (frame.south west-|A);},
#2
}
\begin{document}
\begin{example}{blue}
Our Example
\end{example}
\begin{sol}{red}
here is the solution
\end{sol}
\end{document}
```
Throw this error:
```
Package pgfkeys: I do not know the key '/tcb/O' and I am going to ignore it. Perhaps you misspelled it.
Package pgfkeys: I do not know the key '/tcb/h' and I am going to ignore it. Perhaps you misspelled it.
```
| https://tex.stackexchange.com/users/288837 | Package pgfkeys: I do not know the key '/tcb/O' and I am going to ignore it | false | You are defining the environments with two arguments and the second one should be a set of additional options, according to the code you wrote.
However, the call has just one argument in braces, but TeX will look for another one (ignoring spaces or endlines), so it finds `O`.
Solution:
```
\begin{example}{blue}{}
...
\end{example}
\begin{sol}{red}{}
...
\end{sol}
```
or remove the second argument altogether from the definitions.
| 2 | https://tex.stackexchange.com/users/4427 | 689074 | 319,667 |
https://tex.stackexchange.com/questions/689066 | 0 | What is the proper way to insert some vertical material inside a paragraph? Like what `quote` or display math do.
I want to have a `parbox` or a `minipage` inserted at a given point of my paragraph vertically, and then the paragraph be resumed (without indentation, in particular). I can do it by hard breaking the line with `\\`, but this does not feel like the right way, and this is not how displayed equations or `quote` environment behave.
| https://tex.stackexchange.com/users/37291 | How to insert vertical material in a paragraph | true | If you look at the definition of the `center` environment (`texdef -t latex center`) then you see it is defined as follows:
```
\begin{trivlist}\centering\item\relax
[body]
\end{trivlist}
```
So you can take that definition and remove the `\centering`:
```
\documentclass{article}
\begin{document}
This is the first line of a paragraph that has intentation. The goal is to have vertical material within the paragraph that is not indented, not centered, and does not indent the following line.
\begin{center}
The center environment does this but is centered
\end{center}
Some more text, not indented
\begin{trivlist}\item\relax
A trivlist is not centered and meets all three criteria
\end{trivlist}
End of the text, also not indented
\end{document}
```
Result:
| 2 | https://tex.stackexchange.com/users/89417 | 689076 | 319,668 |
https://tex.stackexchange.com/questions/689075 | 3 | Following [this post](https://tex.stackexchange.com/questions/2708/how-to-split-text-into-characters#2709), I was trying to use `soul` as a hack-y tokenizer and ran into unexpected behavior on certain strings. I reduced the problem to the following MWE but haven't been able to make further progress:
```
\documentclass{article}
\usepackage{soul}
% Initially empty, then should be nonempty afterward
\newcommand*{\state}{}
\makeatletter
\def\SOUL@soeverytoken{%
\ifx\state\empty% Should only happen once...
\renewcommand*{\state}{Nonempty}%
(\the\SOUL@token)%
\else%
[\the\SOUL@token]%
\fi%
}
\makeatother
\begin{document}
% For some reason, the string "unrnn" gives an unexpected result.
\so{nnrnn} \par % (n)[n][r][n][n]
\so{unrnn} \par % (u)[n](r)[n][n]
\so{unnnn} \par % (u)[n][n][n][n]
\so{unrn} \par % (u)[n][r][n]
\end{document}
```
On the string `unrnn`, it prints out `(r)` rather than `[r]` as I would expect. From printing out `\state`, it seems like it's becoming nonempty after reading the `r`, but I'm not sure why this doesn't occur in the other examples.
| https://tex.stackexchange.com/users/299355 | Using soul as tokenizer gives strange result on specific strings | true | I'm not sure why, but when the string `unrnn` is examined, TeX is at grouping level 3; however, when `r` is being processed, the grouping level decreases to 2.
```
\documentclass{article}
\usepackage{soul}
% Initially empty, then should be nonempty afterward
\newcommand*{\state}{}
\makeatletter
\def\SOUL@soeverytoken{%
\showthe\currentgrouplevel
\show\state
\showthe\SOUL@token
\ifx\state\empty% Should only happen once...
\renewcommand*{\state}{Nonempty}%
(\the\SOUL@token)%
\else
[\the\SOUL@token]%
\fi
}
\makeatother
\begin{document}
% For some reason, the string "unrnn" gives an unexpected result.
% \so{nnrnn} \par % (n)[n][r][n][n]
\so{unrnn} \par % (u)[n](r)[n][n]
% \so{unnnn} \par % (u)[n][n][n][n]
% \so{unrn} \par % (u)[n][r][n]
\end{document}
```
I added some diagnostic commands to see what happens.
```
> 3.
\SOUL@everytoken ->\showthe \currentgrouplevel
\show \state \showthe \SOUL@t...
l.24 \so{unrnn}
\par % (u)[n](r)[n][n]
?
> \state=macro:
->.
\SOUL@everytoken ...urrentgrouplevel \show \state
\showthe \SOUL@token \ifx ...
l.24 \so{unrnn}
\par % (u)[n](r)[n][n]
?
> u.
\SOUL@everytoken ...w \state \showthe \SOUL@token
\ifx \state \empty \renewc...
l.24 \so{unrnn}
\par % (u)[n](r)[n][n]
?
> 3.
\SOUL@everytoken ->\showthe \currentgrouplevel
\show \state \showthe \SOUL@t...
l.24 \so{unrnn}
\par % (u)[n](r)[n][n]
?
> \state=macro:
->Nonempty.
\SOUL@everytoken ...urrentgrouplevel \show \state
\showthe \SOUL@token \ifx ...
l.24 \so{unrnn}
\par % (u)[n](r)[n][n]
?
> n.
\SOUL@everytoken ...w \state \showthe \SOUL@token
\ifx \state \empty \renewc...
l.24 \so{unrnn}
\par % (u)[n](r)[n][n]
?
> 2.
\SOUL@everytoken ->\showthe \currentgrouplevel
\show \state \showthe \SOUL@t...
l.24 \so{unrnn}
\par % (u)[n](r)[n][n]
?
> \state=macro:
->.
\SOUL@everytoken ...urrentgrouplevel \show \state
\showthe \SOUL@token \ifx ...
l.24 \so{unrnn}
\par % (u)[n](r)[n][n]
?
> r.
\SOUL@everytoken ...w \state \showthe \SOUL@token
\ifx \state \empty \renewc...
l.24 \so{unrnn}
\par % (u)[n](r)[n][n]
?
> 2.
\SOUL@everytoken ->\showthe \currentgrouplevel
\show \state \showthe \SOUL@t...
l.24 \so{unrnn}
\par % (u)[n](r)[n][n]
?
```
If I try with `\so{nnrnn}` the grouping level starts from 2.
I'd avoid overloading `\so`.
```
\documentclass{article}
\usepackage{soul}
\makeatletter
\newcommand{\myso}[1]{%
\begingroup
\gdef\my@state{}%
\def\SOUL@soeverytoken{%
\ifx\my@state\empty% Should only happen once...
\gdef\my@state{x}%
(\the\SOUL@token)%
\else
[\the\SOUL@token]%
\fi
}%
\so{#1}
\endgroup
}
\makeatother
\begin{document}
\myso{nnrnn} \par % (n)[n][r][n][n]
\myso{unrnn} \par % (u)[n](r)[n][n]
\myso{unnnn} \par % (u)[n][n][n][n]
\myso{unrn} \par % (u)[n][r][n]
\end{document}
```
A different implementation with `expl3` and `\text_map_inline:nn`.
```
\documentclass{article}
\ExplSyntaxOn
\NewDocumentCommand{\myso}{m}
{
\airwreck_process:n { #1 }
}
\bool_new:N \l_airwreck_first_bool
\cs_new_protected:Nn \airwreck_process:n
{
\bool_set_true:N \l_airwreck_first_bool
\text_map_inline:nn { #1 }
{
\bool_if:NTF \l_airwreck_first_bool
{% first item
(##1)
\bool_set_false:N \l_airwreck_first_bool
}
{% other items
[##1]
}
}
}
\ExplSyntaxOff
\begin{document}
\myso{nnrnn} \par % (n)[n][r][n][n]
\myso{unrnn} \par % (u)[n](r)[n][n]
\myso{unnnn} \par % (u)[n][n][n][n]
\myso{unrn} \par % (u)[n][r][n]
\end{document}
```
| 5 | https://tex.stackexchange.com/users/4427 | 689078 | 319,669 |
https://tex.stackexchange.com/questions/689075 | 3 | Following [this post](https://tex.stackexchange.com/questions/2708/how-to-split-text-into-characters#2709), I was trying to use `soul` as a hack-y tokenizer and ran into unexpected behavior on certain strings. I reduced the problem to the following MWE but haven't been able to make further progress:
```
\documentclass{article}
\usepackage{soul}
% Initially empty, then should be nonempty afterward
\newcommand*{\state}{}
\makeatletter
\def\SOUL@soeverytoken{%
\ifx\state\empty% Should only happen once...
\renewcommand*{\state}{Nonempty}%
(\the\SOUL@token)%
\else%
[\the\SOUL@token]%
\fi%
}
\makeatother
\begin{document}
% For some reason, the string "unrnn" gives an unexpected result.
\so{nnrnn} \par % (n)[n][r][n][n]
\so{unrnn} \par % (u)[n](r)[n][n]
\so{unnnn} \par % (u)[n][n][n][n]
\so{unrn} \par % (u)[n][r][n]
\end{document}
```
On the string `unrnn`, it prints out `(r)` rather than `[r]` as I would expect. From printing out `\state`, it seems like it's becoming nonempty after reading the `r`, but I'm not sure why this doesn't occur in the other examples.
| https://tex.stackexchange.com/users/299355 | Using soul as tokenizer gives strange result on specific strings | false | As background: soul analyses syllables, to allow for hyphenation. So the result of parsing can depend on the language: In german `unt` is a syllable and so the parser restarts:
```
\documentclass{article}
\usepackage[ngerman,english]{babel}
\usepackage{soul}
% Initially empty, then should be nonempty afterward
\newcommand*{\state}{}
\makeatletter
\def\SOUL@soeverytoken{%
\ifx\state\empty% Should only happen once...
\renewcommand*{\state}{Nonempty}%
(\the\SOUL@token)%
\else%
[\the\SOUL@token]%
\fi%
}
\makeatother
\begin{document}
\so{untnn} \par %
\selectlanguage{ngerman}
\so{untnn}
\end{document}
```
| 5 | https://tex.stackexchange.com/users/2388 | 689081 | 319,670 |
https://tex.stackexchange.com/questions/689080 | 0 | I want to check the font installed success or not, Now I using this command:
```
ubuntu@VM-0-16-ubuntu:~/Noto_Serif_SC$ updmap-sys --listmaps |grep fonts
Map csfonts.map enabled /usr/local/texlive/2023/texmf-dist/web2c/updmap.cfg
Map kpfonts.map enabled /usr/local/texlive/2023/texmf-dist/web2c/updmap.cfg
MixedMap lxfonts.map enabled /usr/local/texlive/2023/texmf-dist/web2c/updmap.cfg
Map nanumfonts.map enabled /usr/local/texlive/2023/texmf-dist/web2c/updmap.cfg
Map pxfonts.map enabled /usr/local/texlive/2023/texmf-dist/web2c/updmap.cfg
Map sansmathfonts.map enabled /usr/local/texlive/2023/texmf-dist/web2c/updmap.cfg
Map txfonts.map enabled /usr/local/texlive/2023/texmf-dist/web2c/updmap.cfg
```
but I did not know the latex recognize the fonts or not, for example, how to know the latex recognize font `IBM Plex Mono`? is it possible to show the fonts result in terminal command? for example, I can use the command like this:
```
xelatex-avaliable-fonts list|grep 'IBM Plex Mono'
```
to see the font was successfully used by xelatex.
| https://tex.stackexchange.com/users/69600 | is it possible to list the latex support fonts in Ubuntu 22.04 | true |
```
voss>FU-Python:$ luafindfont -n "*"
No. Filename Path
1. Aboensis-Regular.otf /usr/local/texlive/2023/texmf-dist/fonts/opentype/public/aboensis/
2. academicons.ttf /usr/local/texlive/2023/texmf-dist/fonts/truetype/public/academicons/
3. Academy Engraved LET Fonts.ttf /System/Library/Fonts/Supplemental/
4. ACaslonPro-Bold.otf /Users/voss/Library/Fonts/Caslon/
```
| 5 | https://tex.stackexchange.com/users/187802 | 689083 | 319,672 |
https://tex.stackexchange.com/questions/689022 | 2 | I'm working on a text that has a long list of numbered items (some with sub-numbers). Under normal circumstances, there wouldn't be an issue, but someone (not me) wanted to have cross-references to another set of numbered items. If the items in "my" list are capital letters and the items in the other list are lower-case letters, the top level of the list looks like this:
A (a).
B (b).
C (f).
D (h and u).
E (z).
There is no double-labeling of the sub-item lists.
Is there a way to add an (optional) argument to `\enumerate` that will add a number I give it in parentheses AND eliminate the parenthetical argument if I don't give it that argument? Something like this:
```
\item First item
\item {32} Second item
\begin{enumerate}
\item Sub-item one
\item Sub-item two
\item Sub-item three
\end{enumerate}
\item {4 and 68} Third item
\item Fourth item
\end{enumerate}
```
That would, in principle, produce:
1. First item
2 (32). Second item
```
a) Sub-item one
b) Sub-item two
c) Sub-item three
```
3 (4 and 68). Third item
4. Fourth item
(Note the location of the full stop after each label and the parentheses in the second-level list.)
| https://tex.stackexchange.com/users/213262 | Complex list (double numbering) in LaTeX | true | It's difficult to do it really generally with `\item`.
```
\documentclass{article}
\usepackage{enumitem}
\newlist{bienumerate}{enumerate}{1}
\setlist[bienumerate]{%
label=\arabic*\additionallabel.,
wide,
}
\NewDocumentCommand{\additionallabel}{}{}
\NewDocumentCommand{\biitem}{o}{%
\IfNoValueTF{#1}{%
\renewcommand{\additionallabel}{}%
}{%
\renewcommand{\additionallabel}{ (#1)}%
}%
\item
}
\begin{document}
\begin{bienumerate}
\biitem First item
\biitem[32] Second item
\biitem[4 and 68] Third item
\biitem Fourth item
\end{bienumerate}
\begin{bienumerate}[label=\Alph*\additionallabel.]
\biitem First item
\biitem[32] Second item
\biitem[4 and 68] Third item
\biitem Fourth item
\end{bienumerate}
\end{document}
```
| 5 | https://tex.stackexchange.com/users/4427 | 689085 | 319,673 |
https://tex.stackexchange.com/questions/689043 | 2 | I'd like to remove the excess space between two columns on a Beamer slide. There's a graph in one column, and a table in the other. I'd like the graph and the table to be closer together on the slide. Thank you ahead.
```
\documentclass[aspectratio=169]{beamer} % wide frame
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{positioning}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{frame}{Corpus size}
\begin{columns}[T]
\begin{column}{0.5\textwidth}
\centering
\begin{tikzpicture}
\begin{axis}[
every axis plot post/.style={/pgf/number format/fixed},
ybar,
bar width=.1\textwidth,
height=.55\textwidth, % Adjust the height of the axis to fit within the frame
ymin=0,
enlarge x limits=.5, % this controls the blank space to the left and to the right, but needs these two lines below:
% xmin={Texts}, %
xmax={Words}, %
ymax=1500, % this is where the y axis stops and the wavy line is drawn
xtick=data,
symbolic x coords={Texts,Words},
restrict y to domain*=0:1700, % Cut values off here, has to be higher than ymax
visualization depends on=rawy\as\rawy, % Save the unclipped values
after end axis/.code={ % Draw line indicating break
\draw [ultra thick, white, decoration={snake, amplitude=2pt}, decorate] (rel axis cs:0,1) -- (rel axis cs:2,1);
},
nodes near coords={%
\pgfmathprintnumber{\rawy}% Print unclipped values
},
axis lines*=left, % this is where the wavy line is drawn, but it is hidden
clip=false
]
\addplot [fill=orange!50] coordinates {(Texts,1117) (Words,5601719)};
\end{axis}
\end{tikzpicture}
\end{column}
%
\begin{column}{0.5\textwidth}
\centering
\small
\begin{tabular}{ccc} \hline
Subcorpus & Texts & Words \\ \hline \hline
Pseudo & 117 & 1000000 \\
Science & 1000 & 4000000 \\ \hline
\end{tabular}
\end{column}
\end{columns}
\end{frame}
\end{document}
```
| https://tex.stackexchange.com/users/299328 | Excess white space between columns in beamer slide | false | The problem was in this line:
```
\draw [ultra thick, white, decoration={snake, amplitude=2pt}, decorate] (rel axis cs:0,1) -- (rel axis cs:2,1);
```
which caused the wavy line to extend further to the right than needed, and because the line was drawn in white, its length was not visible.
these coordinates fixed the problem:
```
\draw [ultra thick, white, decoration={snake, amplitude=2pt}, decorate] (rel axis cs:0,1) -- (rel axis cs:1,1);
```
Fixed slide:
```
\documentclass[aspectratio=169]{beamer} % wide frame
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{positioning}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{frame}{Corpus size}
\begin{columns}[T]
\begin{column}{0.5\textwidth}
\centering
\begin{tikzpicture}
\begin{axis}[
every axis plot post/.style={/pgf/number format/fixed},
ybar,
bar width=.1\textwidth,
height=.55\textwidth, % Adjust the height of the axis to fit within the frame
ymin=0,
enlarge x limits=.5, % this controls the blank space to the left and to the right, but needs these two lines below:
% xmin={Texts}, %
xmax={Words}, %
ymax=1500, % this is where the y axis stops and the wavy line is drawn
xtick=data,
symbolic x coords={Texts,Words},
restrict y to domain*=0:1700, % Cut values off here, has to be higher than ymax
visualization depends on=rawy\as\rawy, % Save the unclipped values
after end axis/.code={ % Draw line indicating break
\draw [ultra thick, white, decoration={snake, amplitude=2pt}, decorate] (rel axis cs:0,1) -- (rel axis cs:1,1);
},
nodes near coords={%
\pgfmathprintnumber{\rawy}% Print unclipped values
},
axis lines*=left, % this is where the wavy line is drawn, but it is hidden
clip=false
]
\addplot [fill=orange!50] coordinates {(Texts,1117) (Words,5601719)};
\end{axis}
\end{tikzpicture}
\end{column}
%
\begin{column}{0.5\textwidth}
\centering
\small
\begin{tabular}{ccc} \hline
Subcorpus & Texts & Words \\ \hline \hline
Pseudo & 117 & 1000000 \\
Science & 1000 & 4000000 \\ \hline
\end{tabular}
\end{column}
\end{columns}
\end{frame}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/299328 | 689087 | 319,675 |
https://tex.stackexchange.com/questions/448459 | 5 | I would like to understand if `pgfkeys` already offers a way (although undocumented, as far as I could see) to obtain a list of defined keys in a path, that is
```
\pgfkeys{
/my/path/a = 1,
/my/path/b/c = x,
}
\pgfkeysdefinedat{/my/path}{\thekeyslist} % missing macro
\thekeyslist -> {a,b/c} % also acceptable with full path
% also acceptable -> {a,b}
```
(Ideally this would be packaged into a handler `/.ls=\macro`)
If this is not supported, I would like to know what's an idiomatic way of defining an handler that explicitly accumulates key names:
```
\pgfkeys{
/my/path/a/.track={code of key a},
/my/path/b/.track={code of key b},
/my/path/.ls/.get=\thekeyslist,
}
\thekeyslist -> {a,b}
```
Where `/.track={code}` is equivalent to `/.code={code}` but with the side-effect of accumulating the key name into `/.ls`.
Otherwise, as last resort,
```
\pgfkeys{
/my/path/a/.track={\thekeyslist}{code of key a},
/my/path/b/.track={\thekeyslist}{code of key b},
}
\thekeyslist -> {/my/path/a,/my/path/b}
```
| https://tex.stackexchange.com/users/36686 | Pgfkeys: obtaining a list of defined (sub)keys | false | [MarmotGhost](https://github.com/marmotghost) has developed an [experimental package](https://github.com/marmotghost/pgf-pathology) for a question on [topanswers.xyz/tex](https://topanswers.xyz/tex?q=1483#a1724) which can track the usage of, say, the `.code` handler.
Code
----
```
\documentclass{article}
\usepackage{pgf-pathology}
\usepackage[edges]{forest}
\pgfkeys{install tracking for={.code}}
\pgfkeys{
/my/path/a/.code = #1,
/my/path/b/c/.code = #1
}
\begin{document}
\FolderForestContent{/my/path/}
\bracketset{action character=@}
\begin{forest} for tree={grow'=0,folder}
@\ForestContent
\end{forest}
\end{document}
```
Output
------
| 1 | https://tex.stackexchange.com/users/16595 | 689091 | 319,678 |
https://tex.stackexchange.com/questions/689090 | 2 | I have a similar question to ([Making a theorem into a link](https://tex.stackexchange.com/questions/115069/making-a-theorem-into-a-link)) but I was not able to adjust it accordingly.
I have some proofs in an appendix and I would like to have a theorem environment where the header links to the proof. Something like,
```
\begin{linkthm}{\ref{proof:ex_thm}} \label{ex_thm}
\end{linkthm}
```
Thank you!
| https://tex.stackexchange.com/users/299367 | Make Theorem header a link to proof environment | false | I suggest you make use of the `\hypertarget`/`\hyperlink` mechanism provided by the `hyperref` package. Both commands take two arguments; the first argument of a linked pair of such commands should be the same.
In the following example, clicking on the word "Pythagoras" in the theorem's header while in the pdf file will take the reader to the associated proof.
---
```
\documentclass{article}
\usepackage{amsthm} % or '\usepackage{ntheorem}'
\usepackage[colorlinks,allcolors=blue]{hyperref}
\usepackage[nameinlink,noabbrev]{cleveref} % optional
\newtheorem{theorem}{Theorem}
\begin{document}
\section{Main results}
\begin{theorem}[\hyperlink{proof:pyth}{Pythagoras}] \label{thm:pyth}
Let $a$, $b$, and $c$ denote the lengths of the sides
of a \emph{right triangle}, i.e., of a triangle with
one angle equal to $90^\circ$. Without loss of generality
assume that $a\le b<c$. Then $a^2+b^2=c^2$.
\end{theorem}
\clearpage
\appendix
\section{Proofs of all theorems}
\begin{proof}[\hypertarget{proof:pyth}{Proof of \Cref{thm:pyth}}]
\dots
\end{proof}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/5001 | 689097 | 319,680 |
https://tex.stackexchange.com/questions/689096 | 2 | I would like to store a list of arguments within `\newcommand`, `\def` or any other macro. Such a list would then be passed to another command. However, it turns out that the list in question is treated as a single argument by the other command. Example:
```
\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.gates.ee}
\begin{document}
\newcommand{\nodestyle}{scale=2, color=blue}
% \def\nodestyle{scale=2, color=blue}
\newcommand{\customnode}{\node[circle ee, draw, \nodestyle]}
\begin{tikzpicture}
\customnode at (1,1) (Node) {};
\end{tikzpicture}
\end{document}
```
This produces an error *I do not know the key /tikz/scale=2, color=blue*.
| https://tex.stackexchange.com/users/227733 | Early expansion of \newcommand or another macro-like statement | true | You can pre-expand the argument, `expl3` is designed for such expansion control but here just using the (e)tex primitive
```
\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.gates.ee}
\begin{document}
\newcommand{\nodestyle}{scale=2, color=blue}
% \def\nodestyle{scale=2, color=blue}
\newcommand{\customnode}{\expanded{\noexpand\node[circle ee, draw, \nodestyle]}}
\begin{tikzpicture}
\customnode at (1,1) (Node) {};
\end{tikzpicture}
\end{document}
```
| 4 | https://tex.stackexchange.com/users/1090 | 689098 | 319,681 |
https://tex.stackexchange.com/questions/689090 | 2 | I have a similar question to ([Making a theorem into a link](https://tex.stackexchange.com/questions/115069/making-a-theorem-into-a-link)) but I was not able to adjust it accordingly.
I have some proofs in an appendix and I would like to have a theorem environment where the header links to the proof. Something like,
```
\begin{linkthm}{\ref{proof:ex_thm}} \label{ex_thm}
\end{linkthm}
```
Thank you!
| https://tex.stackexchange.com/users/299367 | Make Theorem header a link to proof environment | false | You can try and fix the position of the anchor, because `raiselinks` (which should work) doesn't seem to suffice.
```
\documentclass{article}
\usepackage{amsthm} % or '\usepackage{ntheorem}'
\usepackage[raiselinks,colorlinks,allcolors=blue]{hyperref}
\usepackage[nameinlink,noabbrev]{cleveref} % optional
\usepackage{lipsum}
\newtheorem{linkthminner}{\hyperlink{\linkthmlabel}{Theorem}}
\crefname{linkthminner}{theorem}{theorems}
\Crefname{linkthminner}{Theorem}{Theorems}
\NewDocumentEnvironment{linkthm}{mo}{%
% #1 is the label, #2 the possible attribution
\renewcommand{\linkthmlabel}{#1}%
\IfNoValueTF{#2}{\linkthminner}{\linkthminner[#2]}\label{#1}%
}{\endlinkthminner}
\newcommand{\linkthmlabel}{}% initialize
\newenvironment{linkproof}[1]{%
\proof[\hypertarget{#1}{\strut\proofname\ of \cref{#1}}.]%
}{\endproof}
\begin{document}
\section{Main results}
\begin{linkthm}{thm:a}
This is a theorem statement. \lipsum[2][1-5]
\end{linkthm}
\begin{linkthm}{thm:b}[Someone]
This is a theorem statement. \lipsum[2][1-5]
\end{linkthm}
\lipsum[1-10]
\appendix
\section{Proofs of all theorems}
\begin{linkproof}{thm:a}
\lipsum[1-2]
\end{linkproof}
\begin{linkproof}{thm:b}
\lipsum[1-2]
\end{linkproof}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/4427 | 689120 | 319,692 |
https://tex.stackexchange.com/questions/689118 | 1 | When environment `table` is invoked, everything within it becomes black. Similarly, the caption of `figure` is also black. In the MWE below, capital letters and caption are both black:
```
\documentclass{article}
\usepackage{xcolor,tikz}
\begin{document}
\color{red}
\begin{tabular}{ccc}
a & b & c \\
d & e & f \\
\end{tabular}
\begin{table}
\begin{tabular}{ccc}
A & B & C \\
D & E & F \\
\end{tabular}
\end{table}
\begin{figure}
\begin{tikzpicture}
\draw (0,0) rectangle (1,1);
\end{tikzpicture}
\caption{Caption}
\end{figure}
\end{document}
```
Is there a way to prevent those environments to change the colour?
| https://tex.stackexchange.com/users/3450 | Prevent environments table and figure to change default colour | true |
Move `\color{red}` before `\begin{document}`
```
\documentclass{article}
\usepackage{xcolor,tikz}
\color{red}
\begin{document}
\begin{tabular}{ccc}
a & b & c \\
d & e & f \\
\end{tabular}
\begin{table}
\begin{tabular}{ccc}
A & B & C \\
D & E & F \\
\end{tabular}
\end{table}
\begin{figure}
\begin{tikzpicture}
\draw (0,0) rectangle (1,1);
\end{tikzpicture}
\caption{Caption}
\end{figure}
\end{document}
```
Floats don't force **black** they force the default document font and color, which for color is the color in force at `\begin{document}`
If needed you can change the default color mid document with
```
\renewcommand\normalcolor{\color{blue}}
```
| 2 | https://tex.stackexchange.com/users/1090 | 689121 | 319,693 |
https://tex.stackexchange.com/questions/689096 | 2 | I would like to store a list of arguments within `\newcommand`, `\def` or any other macro. Such a list would then be passed to another command. However, it turns out that the list in question is treated as a single argument by the other command. Example:
```
\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.gates.ee}
\begin{document}
\newcommand{\nodestyle}{scale=2, color=blue}
% \def\nodestyle{scale=2, color=blue}
\newcommand{\customnode}{\node[circle ee, draw, \nodestyle]}
\begin{tikzpicture}
\customnode at (1,1) (Node) {};
\end{tikzpicture}
\end{document}
```
This produces an error *I do not know the key /tikz/scale=2, color=blue*.
| https://tex.stackexchange.com/users/227733 | Early expansion of \newcommand or another macro-like statement | false | Use the native method.
```
\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.gates.ee}
\tikzset{
nodestyle/.style={scale=2,color=blue},
}
\newcommand{\customnode}{\node[circle ee,draw,nodestyle]}
\begin{document}
\begin{tikzpicture}
\customnode at (1,1) (Node) {};
\end{tikzpicture}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/4427 | 689125 | 319,694 |
https://tex.stackexchange.com/questions/689099 | 2 | I try to change the `xcookybooky` package in a way that I can create multiple `\preparation` sections with individual headlines.
My main problem is that the `\preparation` command is defined so that only the data of the last call is stored.
```
\newcommand{\preparation}[1]
{%
\def\xcb@preparation
{%
\xcb@name@prephead
%\\[4pt]
\xcb@fontsize@prep\color{\xcb@color@prep}#1
}
\setcounter{step}{0}
}
```
The `\xcb@preparation` is later used to print the content. Is there any way to rewrite the `\preparation` so that it does not overwrite the `\xcb@preparation` content but extend this?
| https://tex.stackexchange.com/users/299373 | Multiple preparations in xcookybooky | false | Up to three alternate preparations can be included by taking advantage of the pre-preparation (steps) hook and the post-preparation(steps) hook.
Define the heading using `\setHeadlines{prephead = <your heading>}`, for example
`\setHeadlines{prephead = Preparation method~\thepreparationnumber}`
```
% !TeX TS-program = pdflatex
\documentclass{article}
\usepackage{xcookybooky}
%***************************************************** added <<<<<<<<<<<
\makeatletter
\newcounter{preparationnumber}\setcounter{preparationnumber}{1}
\setHeadlines{prephead = Preparation method~\thepreparationnumber}% define the heading <<<<<<<<<
\renewcommand*{\prepreparation}[1]
{% Hook: entered before the preparation (steps)
\def\xcb@hook@prepreparation
{%
\xcb@name@prephead%
\xcb@fontsize@prep\color{\xcb@color@prep} #1%
\vspace*{2em}\stepcounter{preparationnumber}\setcounter{step}{0}
}
}
\renewcommand*{\postpreparation}[1]
{% Hook: entered after the preparation (steps)
\def\xcb@hook@postpreparation
{\vspace*{2em}\setcounter{step}{0}\stepcounter{preparationnumber}%
\xcb@name@prephead%
\xcb@fontsize@prep\color{\xcb@color@prep} #1%
}
}
\makeatother
% fix from https://tex.stackexchange.com/a/445886/
\renewcommand{\step}
{%
\stepcounter{step}%
\lettrine
[%
lines=2,
lhang=0, % space into margin, value between 0 and 1
loversize=0.15, % enlarges the height of the capital
slope=0em,
findent=1em, % gap between capital and intended text
nindent=0em % shifts all intended lines, begining with the second line
]{\thestep}{}%
}
%*****************************************************
\begin{document}
\begin{recipe}
[%
preparationtime = {\unit[1]{h}},
portion = {\portion{6}},
]
{Rice and Lamb}
\introduction{%
Introduction to the dish
}
\ingredients{%
\unit[2]{tbsp} & Vegetable Oil\\
3 & Onion, chopped\\
2 pound & Stewing Lamb or Beef\\
\unit[1]{tbsp} & Minced Garlic\\
\unit[2]{tsp} & Salt\\
\unit[8]{cups} & Water\\
\unit[1.5]{tbsp} & Ground Cardamom\\
}
\prepreparation{% first variant
\step Do some things 1
\step Do some other things 1
\step Finish doing things 1
}
\preparation{%second variant
\step Do some things 2
\step Do some other things 2
\step Before finish things 2
\step Finish doing things 2
}
\postpreparation{%third variant
\step Do some things 3
\step Do some other things 3
\step And more things 3
\step And more extra things 3
\step Finish doing things 3
}
\end{recipe}
\end{document}
```
With the same technique you can use
`\prepreparation{<first variant>}{<steps>}`
and
```
\setHeadlines{prephead = <second variant>}
\preparation{<steps>}
```
and
`\postpreparation{<third variant>}{<steps>}`
to define the headings using the following code
```
% !TeX TS-program = pdflatex
\documentclass{article}
\usepackage{xcookybooky}
%***************************************************** added <<<<<<<<<<<
\makeatletter
\newcounter{preparationnumber}\setcounter{preparationnumber}{1}
\renewcommand*{\prepreparation}[2]
{% Hook: entered before the preparation (steps)
\def\xcb@hook@prepreparation
{%
\textcolor{\xcb@color@prephead}{\textbf{\xcb@fontsize@prephead{#1}}}%
\xcb@fontsize@prep\color{\xcb@color@prep} #2%
\vspace*{2em}\stepcounter{preparationnumber}\setcounter{step}{0}
}
}
\renewcommand*{\postpreparation}[2]
{% Hook: entered after the preparation (steps)
\def\xcb@hook@postpreparation
{\vspace*{2em}\setcounter{step}{0}\stepcounter{preparationnumber}%
\textcolor{\xcb@color@prephead}{\textbf{\xcb@fontsize@prephead{#1}}}%
\xcb@fontsize@prep\color{\xcb@color@prep} #2%
}
}
\makeatother
% fix from https://tex.stackexchange.com/a/445886/
\renewcommand{\step}
{%
\stepcounter{step}%
\lettrine
[%
lines=2,
lhang=0, % space into margin, value between 0 and 1
loversize=0.15, % enlarges the height of the capital
slope=0em,
findent=1em, % gap between capital and intended text
nindent=0em % shifts all intended lines, begining with the second line
]{\thestep}{}%
}
%*****************************************************
\begin{document}
\begin{recipe}
[%
preparationtime = {\unit[1]{h}},
portion = {\portion{6}},
]
{Rice and Lamb}
\introduction{%
Introduction to the dish
}
\ingredients{%
\unit[2]{tbsp} & Vegetable Oil\\
3 & Onion, chopped\\
2 pound & Stewing Lamb or Beef\\
\unit[1]{tbsp} & Minced Garlic\\
\unit[2]{tsp} & Salt\\
\unit[8]{cups} & Water\\
\unit[1.5]{tbsp} & Ground Cardamom\\
}
\prepreparation{Using the fast track}{% first variant
\step Do some things 1
\step Do some other things 1
\step Finish doing things 2
}
\setHeadlines{prephead = Make an impression}
\preparation{%second variant
\step Do some things 2
\step Do some other things 2
\step Before finish things 2
\step Finish doing things 2
}
\postpreparation{Making things last}{%third variant
\step Do some things 3
\step Do some other things 3
\step And more things 3
\step And more extra things 3
\step Finish doing things 3
}
\end{recipe}
\end{document}
```
| 6 | https://tex.stackexchange.com/users/161015 | 689126 | 319,695 |
https://tex.stackexchange.com/questions/688991 | 2 | About one and a half decades ago I tried printing a panorama with LaTeX and found a version with several calls to \afterpage, that worked for me. Meanwhile, I found a much more elegant, shorter, and better understandable algorithm by Martin Scharrer working after the same principle here: [How to include a picture over two pages, left part on left side, right on right (for books)?](https://tex.stackexchange.com/questions/23860/how-to-include-a-picture-over-two-pages-left-part-on-left-side-right-on-right), but I still use my own version ("never change a running system!").
A few days ago Ulrike Fischer had a look at my code and complained about my usage of \afterpage, which would destroy my footnotes: " It doesn't need to be inside the float, you can also move it behind the figure, it only matters here that it is executed while footnotes and floats are handled" and I should never use \afterpage ([Footnotetext jumps to next page and back again](https://tex.stackexchange.com/questions/688815/footnotetext-jumps-to-next-page-and-back-again)).
So I replaced the one appearance of \afterpage Ulrike had specially hinted at and my original problem vanished. But afterward, I had a deeper look at my output, and hmm..., Ulrike is right: There are even more problems, I only got used to them over the years.
Since I wrote my algorithm, others have done so as well and I searched, whether they were able to solve the problem without \afterpage. But alas, I found \afterpage in Martin Scharrers algorithm as well as in the package hvfloat by Herbert Voß -- and both authors seem to know much more about LaTeX than me. Is it impossible to reach my aim without \afterpage?
So I tried another time, starting with Martin Scharrers code:
```
\documentclass[twoside]{book}
\usepackage{graphicx}
\usepackage{adjustbox}
\usepackage{placeins}
\usepackage{xcolor}
% For the `memoir` class remove the following two packages.
% This class already provide the functionality of both
\usepackage{caption}
\usepackage[strict]{changepage}
%%%
\setcounter{totalnumber}{1}
\setcounter{topnumber}{1}
\setcounter{bottomnumber}{1}
\renewcommand{\topfraction}{.99}
\renewcommand{\bottomfraction}{.99}
\renewcommand{\textfraction}{.01}
\makeatletter
\newcommand*{\twopagepicture}[4]{%
\checkoddpage
\ifoddpage
\expandafter\suppressfloats% <-- replaced \afterpage by suppressfloats
\else
\expandafter\@firstofone% <-- and reversed order of \suppressfloats and \@firstofone
\fi
{{% <-- deleted \afterpage here, replaced by reversed order two lines above
\begin{figure}[#1]
\if #2p%
\if #1t%
\thispagestyle{empty}% <-- moved here for moving with figure
\vspace*{-\dimexpr1in+\voffset+\topmargin+\headheight+\headsep\relax}%
\fi
\fi
\if #1b%
\caption{#4}%
\fi
\makebox[\textwidth][l]{%
\if #2p\relax
\let\mywidth\paperwidth
\hskip-\dimexpr1in+\hoffset+\evensidemargin\relax
\else
\let\mywidth\linewidth
\fi
\adjustbox{trim=0 0 {.5\width} 0,clip}{\includegraphics[width=2\mywidth]{#3}}}%
\if #1b\else
\caption{#4}%
\fi
\if #2p%
\if #1b%
\vspace*{-\dimexpr\paperheight-\textheight-1in-\voffset-\topmargin-\headheight-\headsep\relax}%
\fi
\fi
\end{figure}%
\begin{figure}[#1]
\if #2p%
\if #1t%
\thispagestyle{empty}% <-- moved here for moving with figure (replaces another \afterpage call)
\vspace*{-\dimexpr1in+\voffset+\topmargin+\headheight+\headsep\relax}%
\fi
\fi
\makebox[\textwidth][l]{%
\if #2p%
\let\mywidth\paperwidth
\hskip-\dimexpr1in+\hoffset+\oddsidemargin\relax
\else
\let\mywidth\linewidth
\fi
\adjustbox{trim={.5\width} 0 0 0,clip}{\includegraphics[width=2\mywidth]{#3}}}%
\if #2p%
\if #1b%
\vspace*{-\dimexpr\paperheight-\textheight-1in-\voffset-\topmargin-\headheight-\headsep\relax}%
\fi
\fi
\end{figure}%
}}%
}
\makeatother
\usepackage{lipsum}
\begin{document}
\lipsum
\lipsum
\twopagepicture{b}{l}{image}{Test}
\lipsum
\lipsum
\twopagepicture{t}{l}{image}{Test}
\lipsum
\lipsum
\twopagepicture{b}{p}{image}{Other test}
\lipsum
\lipsum
\twopagepicture{t}{p}{image}{Other test with
very very very very very very very very very very very
very very very very very very very very very very very
very very very very very very very very very very very
long caption
}
\lipsum
\lipsum
\end{document}
```
The biggest problem for me was the \afterpage call, which was used if \twopagepicture was called on an odd page, as then the panorama breaks. But I had the idea, in that case to push both figures one page forward not with \afterpage, but with \suppressfloats.
Now I have two questions:
1. The code of the MWE now works, if I replace "image" with the path to a quite wide image. Nevertheless, I am a bit anxious, about whether I have done a bad mistake again, as I do things, I have never done before. Are there any flaws visible again?
2. One problem remaining is: My mechanism with \suppressfloats only works, if not another float of the queue gets between it and my two figures. I thought about a \FloatBarrier just above \checkoddpage, but that would only reduce the possibility, not be foolproof. Has anybody a better idea?
| https://tex.stackexchange.com/users/202047 | Two page panorama without \afterpage -- tables as well as figures | false | My MWE:
```
\documentclass[twoside]{book}%
%\usepackage[symmbound,leftcaption]{doublepagefloats}% <-- This is the package with the new command
\usepackage[symmbound]{doublepagefloats}% <-- This is the package with the new command
%\usepackage{doublepagefloats}% <-- This is the package with the new command
% For demonstration purposes
\usepackage{tikzducks}% Delivers figures for testing purposes
\usepackage{lipsum}% Delivers blind text
% Float placement:
\renewcommand{\textfraction}{0.16} % Smallest text portion on page with floats
\renewcommand{\topfraction}{0.84} % Biggest portion for a float at page top
\renewcommand{\bottomfraction}{0.84} % Biggest portion for a float at page bottom
\renewcommand{\floatpagefraction}{0.95} %With more than this portion a float may cover a float page
\setcounter{topnumber}{2}% max. 2 floats at the top of a text page
\setcounter{bottomnumber}{2}% max. 2 floats at the bottom of a text page
\setcounter{totalnumber}{4}% max. 2 floats in total on a text page (are 2 better?)
% For testing purposes on normal pages page numbers both in head and foot
\makeatletter
\def\ps@myheadings{%
\def\@evenhead{\thepage\hfil\slshape text for testing purposes}%
\def\@oddhead{{\slshape text for testing purposes}\hfil\thepage}%
\let\@mkboth\markboth%
\let\@oddfoot\@oddhead\let\@evenfoot\@evenhead%
}%
\pagestyle{myheadings}
\makeatother
\begin{document}
% Very ugly, but double page tabular
\newcommand\mytabularhuge{%
\Huge%
\begin{tabular}{lllll}%
\textbf{Entry 1} & \textbf{Entry 2} & \textbf{Entry 3} & \textbf{Entry 4} & \textbf{Entry 5} \\%
\hline%
Salad & House & Car & Nice garden & Never known before \\%
hope & Fantasy & This is a very long entry & This is another very long entry & Later I will know \\%
Don't know, how far still & Big lake & I don't believe in that & Ladies first! & I will never know \\%
\end{tabular}}%
\newcommand\mytabularlarge{%
\large%
\begin{tabular}{lllll}%
\textbf{Entry 1} & \textbf{Entry 2} & \textbf{Entry 3} & \textbf{Entry 4} & \textbf{Entry 5} \\%
\hline%
Salad & House & Car & Nice garden & Never known before \\%
hope & Fantasy & This is a very long entry & This is another very long entry & Later I will know \\%
Don't know, how far still & Big lake & I don't believe in that & Ladies first! & I will never know \\%
\end{tabular}}%
% Wide panorama consisting of 5 ducks:
\newcommand\panoramawide{\mbox{\includegraphics[width=.4\panowidth]{example-image-duck}\includegraphics[width=.4\panowidth]{example-image-duck}\includegraphics[width=.4\panowidth]{example-image-duck}\includegraphics[width=.4\panowidth]{example-image-duck}\includegraphics[width=.4\panowidth]{example-image-duck}}}
\newcommand\panoramanarrow{\mbox{\includegraphics[width=.2\panowidth]{example-image-duck}\includegraphics[width=.2\panowidth]{example-image-duck}\includegraphics[width=.2\panowidth]{example-image-duck}\includegraphics[width=.2\panowidth]{example-image-duck}\includegraphics[width=.2\panowidth]{example-image-duck}}}
%-------- begin of text -----------
\listoftables
\vskip2\baselineskip
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{A second duck}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{A second duck}
\end{figure}
\doublepagefloat{figure}{b}{l}{\panoramawide}{Test}% height (and keepaspectratio) may help with too high graphics
\doublepagefloat{figure}{l}{l}{\panoramawide}{Other test}
\doublepagefloat{figure}{h}{l}{\panoramawide}{Other test}
\doublepagefloat{figure}{t}{l}{\panoramawide}{A figure, comparable to the table}
\doublepagefloat{figure}{b}{p}{\includegraphics[width=\dimexpr2\textwidth+\gapwidth\relax, height=0.3\textheight]{example-image-duck}}{Still another test}
\doublepagefloat{figure}{l}{p}{\includegraphics[width=\dimexpr2\textwidth+\gapwidth\relax, height=0.3\textheight]{example-image-duck}}{Still another test}
\doublepagefloat{figure}{h}{p}{\includegraphics[width=\dimexpr2\textwidth+\gapwidth\relax, height=0.3\textheight]{example-image-duck}}{Still another test}
\doublepagefloat{figure}{t}{p}{\includegraphics[width=\dimexpr2\textwidth+\gapwidth\relax, height=0.3\textheight]{example-image-duck}}{Still another test}
\doublepagefloat{figure}{b}{p}{\panoramawide}{Other test}
\doublepagefloat{figure}{l}{p}{\panoramawide}{Other test}
\doublepagefloat{figure}{h}{p}{\panoramawide}{Still other test with
very very very very very very very very very very very
very very very very very very very very very very very
very very very very very very very very very very very
long caption.
}
\doublepagefloat{figure}{t}{p}{\panoramawide}{Test}% height (and keepaspectratio) may help with too high graphics
\doublepagefloat{table}{h}{l}{\makebox[2\textwidth][c]{\mytabularlarge}}{A Table}
% Quite some lipsums following to have enpough text for everything
\lipsum
\lipsum
\lipsum
\lipsum
% And now we have a second table:
\doublepagefloat[AAA]{table}{b}{p}{\makebox[2\paperwidth][c]{\mytabularhuge}}{Another Table}
% Three small floats, but unfortunately only one per page, if you leave the command \restoreplacement commented out
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{Never tired of ducks}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{Never, really~\ldots}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{Last duck}
\end{figure}
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\end{document}
```
After quite some testing: This works for me, at least with all, I have thrown at it up to now. It works with a mixture of double-page floats and normal floats (figures and tables), it should (though not tested) work with newly defined floats as well.
It is not alone my own work, in the last two weeks I got tons of help here at StackExchange, and without I couldn't have done it.
Starting with the algorithm of Martin Scharrer (see question), I needed especially two algorithms for pushing a float to a certain page, both described at [How to let a figure appear exactly on page 16?](https://tex.stackexchange.com/questions/689529/how-to-let-a-figure-appear-exactly-on-page-16/689637#689637) .
1. One of them worked by pushing the float forward by emitting invisible floats of the same kind before the float to be pushed, till it was on the right page.
2. The other one worked by Hooks before or after shipout, in which controlled by labels in the figure, the counter totalnumber was manipulated, which controls how many floats are printed on a page: After the last other float totalnumber was set to 0, at the two pages with the panorama to 1 and after the panorama back to its original state.
Both algorithms didn't work perfect in my eyes though:
1. The invisible float algorithm was good at pushing the floats to the right place. But it might happen, that unasked-for following floats appeared already on the second page of the panorama.
2. The totalnumber algorithm was good at avoiding the unasked-for floats on the second page of the panorama. But as totalnumber could only be manipulated from page to page, either one-half of my panorama tended to land already on the page of the last float. I could have avoided that by setting totalnumber to 1 long before -- but then only one float per page would have been possible perhaps a few pages before the float, and I didn't like that thought as well.
I ended up combining both algorithms. That was made a bit easier because I needed the hook anyway: For panoramas in the foot or head of the page I needed means to erase the normal head or foot of the page ...
**How to use?**
You can use it with \doublepagefloat[#1]{#2}{#3}{#4}{#5}{#6}
with the parameters
* #1: auxiliary caption, the one for the list of figures
* #2: floattype, usually figure or table
* #3: b: (b)ottom of page, t: (t)op of page h: (h)igh, i.e. top of text, l: (l)ow, i.e. bottom of text
* #4: p: (p)aper, i.e. the content may be up to `2\paperwidth` wide, will be centered to the gap between both pages and may stretch till the paper boundaries. It may be narrower though and then will still center. If the width of the content is exactly `2\textwidth+\gapwidth`, it stretches from the left border of the left page text to the right border of the right page text. l: (l)ine, i.e. the content only uses the width of a line on both pages with a wide gap between both parts
* #5: content, i.e. the image itself
* #6: main caption, the text under the image
Already mentioned was a new length, \gapwidth. That is the width between the two text blocks on the left and the right page respectively. There are two options, you can call the package with, that change behavior for the complete document, both deal with the caption:
* [symmbound], if called, leaves white space on the non-caption page just as high as the caption -- so the text starts or ends at the same height on both pages. If not called (the default), the space not needed for a caption is used for text as well.
* [leftcaption] Per default the caption is printed on the right side. If you wish to have it on the left, call this option.
**Known problems**
* This is only intended for single column use. I never intended it for multicolumn use, I never tested it with it.
* captions may only span one paragraph. I tried to alter this, but I didn't manage.
* it sometimes needs several compilation runs, first complaining about dead cycles.
**Where do I get the package doublepagefloats?**
I will post it in another answer, as it is too long for this one.
**Edits**
I edited this answer already twice, the first one I deleted completely, the second one I altered much -- both times, because meanwhile I had found a much better solution.
| 1 | https://tex.stackexchange.com/users/202047 | 689127 | 319,696 |
https://tex.stackexchange.com/questions/689122 | 0 | I'm trying to use `\dotfill` in a `cases` environment within an equation. I've adopted the solution here: [Alignment and dotfill in cases](https://tex.stackexchange.com/questions/434647/alignment-and-dotfill-in-cases)
However, I'd like to be able to write something to the left of the bracket, without the dots going further than `textwidth`. Here is what I have
```
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{tabularx}
\usepackage{lipsum}
\makeatletter
\newcommand*\Annadotfill{%
\leavevmode
% Do you really want "\cleaders"?
\cleaders \hb@xt@ .33em{\hss .\hss }\hfill
\kern \z@
}
\@ifdefinable\@Anna@brace@width{\newdimen\@Anna@brace@width}
\settowidth\@Anna@brace@width{%
$\left\{\vbox{\vskip \@m \p@}\right.\kern -\nulldelimiterspace$%
}
\newenvironment{Annacases}{%
\left\{%
\tabcolsep \z@
\def\arraystretch{1.2}% linespread: adjust as you please
\tabularx{\dimexpr \linewidth-\@Anna@brace@width \relax}%
{>{$}r<{$}>{${}}X<{$}}%
}{%
\endtabularx
\right.%
\kern -\nulldelimiterspace
}
\makeatother
\begin{document}
$
f(x) = \begin{Annacases}
x & \Annadotfill \text{text;}\\
1-x & \Annadotfill \text{more text;}
\end{Annacases}
$
\lipsum[1]
\end{document}
```
How can I modify the code to keep everything within `textwidth`?
| https://tex.stackexchange.com/users/145508 | Dotfill in cases environment | false |
```
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{tabularx}
\usepackage{lipsum}
\begin{document}
$
f(x) =
\left\{
\begin{array}{@{}r@{}}
x\\
1-x
\end{array}
\right.
\leaders
\hbox{$%
\begin{array}{@{\,}r@{\,}}
.\\
.
\end{array}%
$}\hfill
\begin{tabular}{@{}r@{}}
text;\\
more text;
\end{tabular}
$
\lipsum[1]
\end{document}
```
| 2 | https://tex.stackexchange.com/users/1090 | 689129 | 319,697 |
https://tex.stackexchange.com/questions/687243 | 1 | The Tikz command `\draw plot file{data/filename.dat}` draws a line through the coordinates stored in filename.dat, which is contained in the subfolder data. Is there a Tikz equivalent to `\graphicspath{{./data/}}` so that I don't have to write `data/` in front of every plot command?
[This post](https://tex.stackexchange.com/questions/35863/pgfplots-from-file-search-path-looking-for-graphicspath-equivalent) shows how to it with the pgfplots package, but I'm wondering if there is a Tikz native way for the same feature. I don't really want to load the entire pgfplots package just to avoid typing `data/`.
Here is an MWE:
```
\begin{filecontents*}{data/somedata.dat}
1 2
3 4
5 6
\end{filecontents*}
\documentclass{standalone}
\usepackage{tikz, graphicx}
\graphicspath{{./data/}}
\begin{document}
\begin{tikzpicture}
\draw plot file{somedata.dat};
\end{tikzpicture}
\end{document}
```
| https://tex.stackexchange.com/users/203616 | Tikz equivalent of \graphicspath | true | It turns out `\tikzset{every plot/.style={prefix=data/}}` only applies to plots that are generated with GNUplot through the `plot function` operation. To apply the prefix to plots from data points in a file, one can add the following code to the preamble.
```
\makeatletter
\def\tikz@plot@file ile#1{\def\tikz@plot@data{\pgfplotxyfile{\tikz@plot@prefix#1}}\tikz@@@plot}
\makeatother
\tikzset{every plot/.style={prefix=data/}}
```
This really just adds the `plot/prefix` key, which is stored in `\tikz@plot@prefix`, to the file name that is passed to `plot file`. There are probably better ways to patch this because this will break if the `plot file` operation is ever reimplemented. But for now it works.
| 1 | https://tex.stackexchange.com/users/203616 | 689131 | 319,698 |
https://tex.stackexchange.com/questions/689130 | 0 | If I were to construct an MWE, I would have my answer, but I am trying to avoid all of that trial and error.
So I am using XeLaTeX and loading lots and lots of packages directly and indirectly.
If I have something like
```
% [loads of stuff above this point]
% \newcommand{\Eta}{H} % Latin H causes fewer problems than using Greek.
\begin{document}
\renewcommand{\Eta}{H} % Latin H causes fewer problems than using Greek.
\show\Eta
```
then I get that \Eta is defined to be Latin H.
But if I do
```
% [loads of stuff above this point]
\newcommand{\Eta}{H} % Latin H causes fewer problems than using Greek.
\begin{document}
% \renewcommand{\Eta}{H} % Latin H causes fewer problems than using Greek.
\show\Eta
```
Then `\show\Eta` tells me that
```
> \Eta=macro:
->\mitEta .
l.62 \show\Eta
```
and in some of the places in which I use `\Eta` in my document, I run into problems when the Greek letter is not in the fonts. For example, I get warnings like
```
Missing character: There is no (U+1D6E8) in font Fira Sans Light/OT:script=latn;language=dflt;mapping=tex-text;!
```
I could remove packages to find the culprit
-------------------------------------------
I do understand that I could identify the culprit by constructing various attempts at minimal working examples just using one package at a time. But I am hoping that there is a better way do approach this, as I have a lot of things that are loaded indirectly.
I know I could work around this
-------------------------------
I realize that I could work around this by any of
1. Using a control sequence other than `Eta`.
2. Just using "`H`" instead of "`\Eta`" in the body of what I have.
3. Wrapping my definition of `\Eta` in an `\AtBeginDocument` (or `\AfterBeginDocument`.
So I don't need an answer to get my stuff to work. But I am still curious about who might be defining `\Eta` at (or after) beginDocument.
| https://tex.stackexchange.com/users/31771 | How to identify package (re)defining \Eta At (or After) BeginDocument? | false | It appears that the answer is the [unicode-math](https://ctan.org/pkg/unicode-math?lang=en) package. §6.2 of its documentation says
>
> unicode-math defines the macros by \AtBeginDocument, namely delays the definition until \begin{document} is met. If you want to overwrite a macro defined by unicode-math, please redefine it in \AtBeginDocument after loading this package.
>
>
>
It behaves this way because it very reasonably wants fonts to be set up before defining some macros.
I did not identify the package defining \Eta in any particularly systematic way, but I did use Google to search for \mitEta (which I take to be for "Math Italic Eta"). Several references to unicode-math showed up. So I don't really have a general answer to the general form of my question.
| 0 | https://tex.stackexchange.com/users/31771 | 689141 | 319,701 |
https://tex.stackexchange.com/questions/689130 | 0 | If I were to construct an MWE, I would have my answer, but I am trying to avoid all of that trial and error.
So I am using XeLaTeX and loading lots and lots of packages directly and indirectly.
If I have something like
```
% [loads of stuff above this point]
% \newcommand{\Eta}{H} % Latin H causes fewer problems than using Greek.
\begin{document}
\renewcommand{\Eta}{H} % Latin H causes fewer problems than using Greek.
\show\Eta
```
then I get that \Eta is defined to be Latin H.
But if I do
```
% [loads of stuff above this point]
\newcommand{\Eta}{H} % Latin H causes fewer problems than using Greek.
\begin{document}
% \renewcommand{\Eta}{H} % Latin H causes fewer problems than using Greek.
\show\Eta
```
Then `\show\Eta` tells me that
```
> \Eta=macro:
->\mitEta .
l.62 \show\Eta
```
and in some of the places in which I use `\Eta` in my document, I run into problems when the Greek letter is not in the fonts. For example, I get warnings like
```
Missing character: There is no (U+1D6E8) in font Fira Sans Light/OT:script=latn;language=dflt;mapping=tex-text;!
```
I could remove packages to find the culprit
-------------------------------------------
I do understand that I could identify the culprit by constructing various attempts at minimal working examples just using one package at a time. But I am hoping that there is a better way do approach this, as I have a lot of things that are loaded indirectly.
I know I could work around this
-------------------------------
I realize that I could work around this by any of
1. Using a control sequence other than `Eta`.
2. Just using "`H`" instead of "`\Eta`" in the body of what I have.
3. Wrapping my definition of `\Eta` in an `\AtBeginDocument` (or `\AfterBeginDocument`.
So I don't need an answer to get my stuff to work. But I am still curious about who might be defining `\Eta` at (or after) beginDocument.
| https://tex.stackexchange.com/users/31771 | How to identify package (re)defining \Eta At (or After) BeginDocument? | false | If you want to know which packages are leaving code in the begin document hook you can use `\ShowHook`
```
\documentclass{article}
% lots of excellent packages
\usepackage{longtable,dcolumn,colortbl,plain,bm,indentfirst,afterpage}
\usepackage{unicode-math}
\ShowHook{begindocument}
\begin{document}
x
\end{document}
```
Produces a log of
```
-> The hook 'begindocument':
> Code chunks:
> color -> \def \KV@Gin@bbllx {\PackageError {luatex.def}{Options `bblly',
`bblly', `bburx', `bbury',\MessageBreak `natheight' and `natwidth' are not\Mess
ageBreak supported by luatex driver:\MessageBreak use `viewport' instead}\@ehc
}\let \KV@Gin@bblly \KV@Gin@bbllx \let \KV@Gin@bburx \KV@Gin@bbllx \let \KV@Gin
@bbury \KV@Gin@bbllx \let \KV@Gin@natwidth \KV@Gin@bbllx \let \KV@Gin@natheight
\KV@Gin@bbllx \def \KV@Gin@bb {\PackageInfo {luatex.def}{Option `bb' equivalen
t to `viewport' with the luatex driver}\KV@Gin@viewport }\let \Gin@iii \Gin@iii
@vp \ifnum \mag =\@m \@ifundefined {stockwidth}{\@ifundefined {paperwidth}{}{\i
fdim \paperwidth >0pt\relax \ifdim \paperheight >0pt\relax \pagewidth =\paperwi
dth \pageheight =\paperheight \fi \fi }}{\ifdim \stockwidth >0pt\relax \ifdim \
stockheight >0pt\relax \setlength {\pagewidth }{\stockwidth }\setlength {\pageh
eight }{\stockheight }\else \ifdim \paperwidth >0pt\relax \ifdim \paperheight >
0pt\relax \setlength {\pagewidth }{\paperwidth }\setlength {\pageheight }{\pape
rheight }\fi \fi \fi \else \ifdim \stockwidth =0pt\relax \ifdim \paperwidth >0p
t\relax \ifdim \paperheight >0pt\relax \setlength {\pagewidth }{\paperwidth }\s
etlength {\pageheight }{\paperheight }\fi \fi \fi \fi }\fi \GPT@LoadSuppPdf \le
t \default@color \current@color \ifx \includegraphics \@undefined \else \@ifpac
kageloaded {pst-pdf}{}{\@ifpackageloaded {pdftricks}{}{\@ifpackageloaded {graph
ics}{\ifnum \directlua {tex.sprint(status.shell_escape)}>0 \edef \Gin@extension
s {\Gin@extensions ,.eps}\RequirePackage {epstopdf-base}[2009/07/12]\fi }{} }}\
fi
> colortbl -> \expandafter \def \expandafter \@tabarray \expandafter {\expa
ndafter \CT@start \@tabarray }\def \@tempa {$\hfil \egroup \box \z@ \box \tw@ }
\ifx \@tempa \DC@endright \def \DC@endright {$\hfil \egroup \ifx \DC@rl \bgroup
\hskip \stretch {-.5}\box \z@ \box \tw@ \hskip \stretch {-.5}\else \box \z@ \b
ox \tw@ \fi }\else \def \@tempa {$\hfil \egroup \hfill \box \z@ \box \tw@ }\ifx
\@tempa \DC@endright \def \DC@endright {$\hfil \egroup \hskip \stretch {.5}\bo
x \z@ \box \tw@ \hskip \stretch {-.5}}\fi \fi \ifx \hhline \@undefined \else \d
ef \HH@box ##1##2{\vbox {{\ifx \CT@drsc@ \relax \else \global \dimen \thr@@ \tw
@ \arrayrulewidth \global \advance \dimen \thr@@ \doublerulesep {\CT@drsc@ \hru
le \@height \dimen \thr@@ \vskip -\dimen \thr@@ }\fi \CT@arc@ \hrule \@height \
arrayrulewidth \@width ##1 \vskip \doublerulesep \hrule \@height \arrayrulewidt
h \@width ##2}}} \def \HH@loop {\ifx \@tempb `\def \next ####1{\the \toks@ \cr
}\else \let \next \HH@let \ifx \@tempb |\if@tempswa \ifx \CT@drsc@ \relax \HH@a
dd {\hskip \doublerulesep }\else \HH@add {{\CT@drsc@ \vrule \@width \doublerule
sep }}\fi \fi \@tempswatrue \HH@add {{\CT@arc@ \vline }}\else \ifx \@tempb :\if
@tempswa \ifx \CT@drsc@ \relax \HH@add {\hskip \doublerulesep }\else \HH@add {{
\CT@drsc@ \vrule \@width \doublerulesep }}\fi \fi \@tempswatrue \HH@add {\@temp
c \HH@box \arrayrulewidth \arrayrulewidth \@tempc }\else \ifx \@tempb ####\if@t
empswa \HH@add {\hskip \doublerulesep }\fi \@tempswatrue \HH@add {{\CT@arc@ \vl
ine \copy \@ne \@tempc \vline }}\else \ifx \@tempb ~\@tempswafalse \if@firstamp
\@firstampfalse \else \HH@add {&\omit }\fi \ifx \CT@drsc@ \relax \HH@add {\hfi
l }\else \HH@add {{\CT@drsc@ \leaders \hrule \@height \HH@height \hfil }}\fi \e
lse \ifx \@tempb -\@tempswafalse \gdef \HH@height {\arrayrulewidth }\if@firstam
p \@firstampfalse \else \HH@add {&\omit }\fi \HH@add {{\CT@arc@ \leaders \hrule
\@height \arrayrulewidth \hfil }}\else \ifx \@tempb =\@tempswafalse \gdef \HH@
height {\dimen \thr@@ }\if@firstamp \@firstampfalse \else \HH@add {&\omit }\fi
\HH@add {\rlap {\copy \@ne }\leaders \copy \@ne \hfil \llap {\copy \@ne }}\else
\ifx \@tempb t\HH@add {\def \HH@height {\dimen \thr@@ }\HH@box \doublerulesep
\z@ }\@tempswafalse \else \ifx \@tempb b\HH@add {\def \HH@height {\dimen \thr@@
}\HH@box \z@ \doublerulesep }\@tempswafalse \else \ifx \@tempb >\def \next ###
#1####2{\HH@add {{\baselineskip \p@ \relax ####2\global \setbox \@ne \HH@box \d
oublerulesep \doublerulesep }}\HH@let !}\else \ifx \@tempb \@sptoken \let \next
\HH@spacelet \else \PackageWarning {hhline}{\meaning \@tempb \space ignored in
\noexpand \hhline argument\MessageBreak }\fi \fi \fi \fi \fi \fi \fi \fi \fi \
fi \fi \next } \lowercase {\def \HH@spacelet } {\futurelet \@tempb \HH@loop } \
fi \ifx \longtable \@undefined \else \def \LT@@hline {\ifx \LT@next \hline \gl
obal \let \LT@next \@gobble \ifx \CT@drsc@ \relax \gdef \CT@LT@sep {\noalign {\
penalty -\@medpenalty \vskip \doublerulesep }}\else \gdef \CT@LT@sep {\multispa
n \LT@cols {\CT@drsc@ \leaders \hrule \@height \doublerulesep \hfill }\cr }\fi
\else \global \let \LT@next \empty \gdef \CT@LT@sep {\noalign {\penalty -\@lowp
enalty \vskip -\arrayrulewidth }}\fi \ifnum 0=`{\fi }\multispan \LT@cols {\CT@a
rc@ \leaders \hrule \@height \arrayrulewidth \hfill }\cr \CT@LT@sep \multispan
\LT@cols {\CT@arc@ \leaders \hrule \@height \arrayrulewidth \hfill }\cr \noalig
n {\penalty \@M }\LT@next } \fi
> fontspec-luatex -> \tl_set_eq:NN \cyrillicencoding \g_fontspec_encoding_t
l \tl_set_eq:NN \latinencoding \g_fontspec_encoding_tl \RenewDocumentCommand \o
ldstylenums {m}{\__fontspec_main_oldstylenums:n {##1}}\fontspec_maybe_setup_mat
hs:
> amsmath -> \reset@strutbox@ \MakeRobust \dddot \MakeRobust \ddddot \Umath
charnumdef \std@minus \Umathcodenum `\-\relax \Umathcharnumdef \std@equal \Umat
hcodenum `\=\relax \expandafter \let \csname overleftarrow \endcsname \@undefin
ed \expandafter \let \csname overrightarrow \endcsname \@undefined \MakeRobust
\overrightarrow \MakeRobust \overleftarrow \MakeRobust \overleftrightarrow \Mak
eRobust \underrightarrow \MakeRobust \underleftarrow \MakeRobust \underleftrigh
tarrow
> unicode-math-luatex -> \__um_define_math_chars: \tl_if_eq:onT {\g__fontsp
ec_mathrm_tl }{\rmdefault }{\__fontspec_setmathrm_hook:nn {}{}}\tl_if_eq:onT {\
g__fontspec_mathsf_tl }{\sfdefault }{\__fontspec_setmathsf_hook:nn {}{}}\tl_if_
eq:onT {\g__fontspec_mathtt_tl }{\ttdefault }{\__fontspec_setmathtt_hook:nn {}{
}}\bool_if:NF \g__um_main_font_defined_bool \__um_load_lm: \__um_setup_mathtext
: \__um_define_prime_commands: \__um_define_prime_chars: \cs_new_protected:Npn
\__um_patch_url: {\tl_put_left:Nn \Url@FormatString {\__um_switch_to:n {literal
}}\tl_put_right:Nn \UrlSpecials {\do \`{\mathchar `\`}\do \'{\mathchar `\'}\do
\${\mathchar `\$}\do \&{\mathchar `\&}}}\@ifpackageloaded {url}{\__um_patch_url
: }{}\cs_new_protected:Npn \__um_patch_mathtools_B: {\cs_set_eq:NN \MToverbrack
et \overbracket \cs_set_eq:NN \MTunderbracket \underbracket \AtBeginDocument {\
msg_warning:nn {unicode-math}{mathtools-overbracket}\cs_set:Npn \downbracketfil
l ####1####2{\tl_set:Nn \l_MT_bracketheight_fdim {.27ex}\downbracketend {####1}
{####2}\leaders \vrule \@height ####1\@depth \z@ \hfill \downbracketend {####1}
{####2}}\cs_set:Npn \upbracketfill ####1####2{\tl_set:Nn \l_MT_bracketheight_fd
im {.27ex}\upbracketend {####1}{####2}\leaders \vrule \@height \z@ \@depth ####
1\hfill \upbracketend {####1}{####2}}\cs_set_eq:NN \Uoverbracket \overbracket \
cs_set_eq:NN \Uunderbracket \underbracket \cs_set_eq:NN \overbracket \MToverbra
cket \cs_set_eq:NN \underbracket \MTunderbracket }}\@ifpackageloaded {mathtools
}{\__um_patch_mathtools_B: }{}\cs_new_protected:Npn \__um_patch_mathtools_C: {\
msg_warning:nn {unicode-math}{mathtools-colon}\DeclareDocumentCommand \dblcolon
{}{\Colon }\DeclareDocumentCommand \coloneqq {}{\coloneq }\DeclareDocumentComm
and \Coloneqq {}{\Coloneq }\DeclareDocumentCommand \eqqcolon {}{\eqcolon }}\@if
packageloaded {mathtools}{\__um_patch_mathtools_C: }{}\Umathcharnumdef \std@min
us \Umathcodenum `-\Umathcharnumdef \std@equal \Umathcodenum `=\debug_suspend:
\__um_resolve_greek: \debug_resume: \@ifpackageloaded {amsmath}{}{\__um_redefin
e_radical: }\__um_setup_active_frac: \g__um_secret_hook_tl
> Document-level (top-level) code (executed last):
> ---
> Extra code for next invocation:
> ---
> Rules:
> ---
> Execution order:
> color, colortbl, fontspec-luatex, amsmath, unicode-math-luatex.
<recently read> }
l.6 \ShowHook{begindocument}
?
```
The exact code chunks left by each package may not make exciting reading but it does show that only these packages are of interest
```
> Execution order:
> color, colortbl, fontspec-luatex, amsmath, unicode-math-luatex.
```
from there it would be easy to make an example and removing half of the packages at a time narrow down to find `unicode-math` is responsible here.
| 2 | https://tex.stackexchange.com/users/1090 | 689145 | 319,703 |
https://tex.stackexchange.com/questions/657094 | 1 | Per IEEE guideline, the conferences and journal names in references should be abbreviated. The file IEEEabrv.bib contains the IEEE journal names with their corresponding abbrv. How do I abbreviate the conference names? Is there a similar file available?
| https://tex.stackexchange.com/users/247088 | How to abbreviate IEEE conference names | false | Beside the bib file 'IEEEabrv.bib' provided by IEEE for abbreviating IEEE journal names, there is also a bib file 'abbrev.bib' for ACM journals where you can download [here](https://portalparts.acm.org/hippo/latex_templates/acmart-primary.zip).
There is also a list of USEFUL ABBREVIATIONS IN REFERENCES in Section IV of this [guide](https://ieeeauthorcenter.ieee.org/wp-content/uploads/IEEE-Reference-Guide.pdf).
| 1 | https://tex.stackexchange.com/users/290545 | 689147 | 319,705 |
https://tex.stackexchange.com/questions/689163 | 2 | I have defined a \imag command to assign the value of the imaginary unit with the font \texttt. However when I call the command \imag inside a theorem environment with the plain style the font is printed with the italic font. Does anyone know of a general way to solve this problem?
The following is a minimal compilable example
```
\documentclass[a4paper, 11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
% ----------------------------
% STANDARD PACKAGES FOR MATH
% ----------------------------
\usepackage{amsmath} % AMS Math Package
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm} % theorem formatting
\usepackage{bm} % bold math
\usepackage{physics}
% Note: "dsfont" override \mathbb{} blackboard bold font provided by "amsfonts"
\theoremstyle{plain} % default
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newcommand{\imag}{\texttt{i}} % imaginary number
\begin{document}
\begin{theorem}[Duffy, Pan and Singleton (2000)]
If $\vb{X}(t)$ is in the affine form, the discounted characteristic function defined as
\begin{equation}
\phi(\vb{u},\vb{X}(t),t,T) = \mathbb{E}^{\mathbb{Q}}\left[
e^{-\int_{t}^{T} r(\vb{X}(s))\dd{s} + \imag \vb{u}^{T} \vb{X}(T)} \left|\right. \mathcal{F}_{t}
\right] ~ \forall \, \vb{u} \in \mathbb{C}^{d},
\end{equation}
with boundary condition
\begin{equation}
\phi(\vb{u},\vb{X}(T),T,T) = e^{\imag \vb{u}^{T} \vb{X}(T)},
\end{equation}
has a solution of the following form
\begin{equation}\label{eq:AD_chf}
\phi(\vb{u},\vb{X}(T),t,T) = e^{A(\vb{u},t,T) + \vb{B}(\vb{u},t,T)^{T} \vb{X}(t)}
\end{equation}
\end{theorem}
\end{document}
```
| https://tex.stackexchange.com/users/270888 | Theorem environment overrides personal commands | true | You want
```
\newcommand{\imag}{\mathtt{i}}
```
(assuming you ***really*** want such a nonstandard notation).
If you're short on math groups (you'll be informed about this by running the document), you can state `\normalfont\ttfamily`
```
\newcommand{\imag}{\text{\normalfont\ttfamily i}}
```
Just to comply with my personal “`physics` does many disputable things” and to suggest better typesetting:
```
\documentclass[a4paper, 11pt]{article}
\usepackage[T1]{fontenc}
%\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
% ----------------------------
% STANDARD PACKAGES FOR MATH
% ----------------------------
\usepackage{amsmath} % AMS Math Package
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm} % theorem formatting
\usepackage{bm} % bold math
%\usepackage{physics}
\theoremstyle{plain} % default
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newcommand{\imag}{\mathtt{i}} % imaginary number
\newcommand{\vb}[1]{\mathbf{#1}}% might also be \bm{#1}
\newcommand{\bC}{\mathbb{C}}
\newcommand{\bE}{\mathbb{E}}
\newcommand{\bQ}{\mathbb{Q}}
\newcommand{\diff}{\mathop{}\!\mathrm{d}}
\begin{document}
\begin{theorem}[Duffy, Pan and Singleton (2000)]
If $\vb{X}(t)$ is in the affine form, the discounted characteristic function defined as
\begin{equation}
\phi(\vb{u},\vb{X}(t),t,T) = \bE^{\bQ}
% \left[
\bigl[
e^{-\int_{t}^{T} r(\vb{X}(s))\diff s + \imag \vb{u}^{T} \vb{X}(T)}
% \;\middle|\;
\bigm|
\mathcal{F}_{t}
% \right]
\bigr]
\quad \forall \, \vb{u} \in \bC^{d},
\end{equation}
with boundary condition
\begin{equation}
\phi(\vb{u},\vb{X}(T),T,T) = e^{\imag \vb{u}^{T} \vb{X}(T)},
\end{equation}
has a solution of the following form
\begin{equation}\label{eq:AD_chf}
\phi(\vb{u},\vb{X}(T),t,T) = e^{A(\vb{u},t,T) + \vb{B}(\vb{u},t,T)^{T} \vb{X}(t)}
\end{equation}
\end{theorem}
\end{document}
```
I kept (commented) the `\left\middle\right` commands (better than your attempt, anyway), to show that `\big` size is really enough.
I commented out `physics` and defined `\vb` to do the same. Actually `physics` provides `\vb*{x}` to use bold italic. They should be two different commands, if it's intended to use both varieties.
Also `physics` defines `\dd` in a really strange way. I don't think it's more difficult to type in
```
\diff^{3} x \diff(\cos x)
```
instead of
```
\dd[3]{x} \dd(\cos x)
```
| 5 | https://tex.stackexchange.com/users/4427 | 689164 | 319,712 |
https://tex.stackexchange.com/questions/689175 | 1 | I have read that using `visibile<#->` option, where # is an integer number from 1, is possible to change the order in which some elements appear into the slides. However this doesn't seem to work in the example below, can you help me?
```
\documentclass{beamer}
\begin{document}
\begin{frame}
In this case it is appropriate to choose $f(x) = x$ and $G(x) = \ln x$.
\pause
\begin{tabular}{cc}
\visible<2->{$F(x) = \frac{x^2}{2}$} & \visible<1->{$f(x) = x$} \\
\visible<1->{$G(x) = \ln x$} & \visible<3->{$g(x) = \frac{1}{x}$}
\end{tabular}
\end{frame}
\end{document}
```
In other words, it must appear in the order
1. f(x) and G(x)
2. F(x), in addition to the one in the previous point
3. g(x), in addition to the one in the previous point.
| https://tex.stackexchange.com/users/113424 | Change the order in which items appear in a latex beamer table | true | If you use `\pause` before your table, you want to start your uncovering on the second overlay instead of the first overlay:
```
\documentclass{beamer}
\begin{document}
\begin{frame}
In this case it is appropriate to choose $f(x) = x$ and $G(x) = \ln x$.
\pause
\begin{tabular}{cc}
\visible<3->{$F(x) = \frac{x^2}{2}$} & \visible<2->{$f(x) = x$} \\
\visible<2->{$G(x) = \ln x$} & \visible<4->{$g(x) = \frac{1}{x}$}
\end{tabular}
\end{frame}
\end{document}
```
| 4 | https://tex.stackexchange.com/users/36296 | 689180 | 319,719 |
https://tex.stackexchange.com/questions/78098 | 9 | The following creates a figure with three images arranged appropriately. If I remove the two `\caption{}` lines, it numbers the main subfigures as I'd like, and keeping the two `\caption{}` lines puts subfigure letters in the right place for the sub-subfigures, but the letters are wrong.
How can I change the subfigure identification from a, b, c, d to a, b1, b2, b or something similar?
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{fancyref}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\begin{subfigure}{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{wu8_wedges}
\caption{With wedges.}
\label{fig:wedges}
\end{subfigure}
\begin{subfigure}{0.5\textwidth}
\begin{subfigure}{\textwidth}
\centering
\includegraphics[width=\textwidth]{wu8_flat1}
\caption{}
\label{fig:flat1}
\end{subfigure}
\begin{subfigure}{\textwidth}
\centering
\includegraphics[width=\textwidth]{wu8_flat2}
\caption{}
\label{fig:flat2}
\end{subfigure}
\caption{Without wedges}
\label{fig:flat}
\end{subfigure}
\caption{Interactions between the railcar and the man's feet.}
\label{fig:interactions}
\end{figure}
\end{document}
```
| https://tex.stackexchange.com/users/21036 | Captioning nested subfigures with subcaption | false | Based on @Gonzalo's answer, a more general method involves defining a `subsubfigure` environment:
```
\newenvironment{subsubfigure}[2][]{%
\begin{subfigure}[#1]{#2}%
\stepcounter{subsubfigure}%
\renewcommand{\thesubfigure}{\alph{subfigure}.\roman{subsubfigure}}%
}{%
\addtocounter{subfigure}{-1}%
\end{subfigure}%
}
\newcounter{subsubfigure}
```
Just make sure to reset the `subsubfigure` counter to 0 after each new `\begin{subfigure}`:
```
\begin{figure}
\begin{subfigure}{0.5\linewidth}
\setcounter{subsubfigure}{0}% IMPORTANT
\centering
\begin{subsubfigure}{0.5\linewidth}
\centering
\includegraphics[width=\linewidth]{img_1_a_i}
\caption{}
\end{subsubfigure}%
\begin{subsubfigure}{0.5\linewidth}
\centering
\includegraphics[width=\linewidth]{img_1_a_ii}
\caption{}
\end{subsubfigure}%
\caption{}
\end{subfigure}%
% ...
% more subfigures
% ...
\caption{}
\end{figure}
```
...Theoretically, one could patch the `subfigure` environment to do this for you, but I don't want to go down that rabbit hole just yet...
---
Example usage for original question:
```
\documentclass{article}
\usepackage{amsmath}
\usepackage[demo]{graphicx}
\usepackage{fancyref}
\usepackage{subcaption}
\newenvironment{subsubfigure}[2][]{%
\begin{subfigure}[#1]{#2}%
\stepcounter{subsubfigure}%
\renewcommand{\thesubfigure}{\alph{subfigure}.\roman{subsubfigure}}%
}{%
\addtocounter{subfigure}{-1}%
\end{subfigure}%
}
\newcounter{subsubfigure}
\begin{document}
\begin{figure}
\begin{subfigure}{0.5\textwidth}
\centering
\includegraphics[width=.95\textwidth]{wu8_wedges}
\caption{With wedges.}
\label{fig:wedges}
\end{subfigure}%
\begin{subfigure}{0.5\textwidth}
\setcounter{subsubfigure}{0}
\begin{subsubfigure}{\textwidth}
\centering
\includegraphics[width=.95\textwidth]{wu8_flat1}
\caption{}
\label{fig:flat1}
\end{subsubfigure}
\begin{subsubfigure}{\textwidth}
\centering
\includegraphics[width=.95\textwidth]{wu8_flat2}
\caption{}
\label{fig:flat2}
\end{subsubfigure}
\caption{Without wedges}
\label{fig:flat}
\end{subfigure}
\caption{Interactions between the railcar and the man's feet.}
\label{fig:interactions}
\end{figure}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/2930 | 689184 | 319,722 |
https://tex.stackexchange.com/questions/689179 | 0 | Im in the middle of writing a scientific report and have the issue of:
I want to use the ACS ref-style in the reference list but not in text. It would be preferably to use the format of for example
>
> (Lastname, 1990)
>
>
>
in text.
Currently the biblatex is used with the following input
```
\usepackage[
backend=biber,
style=chem-acs,
sorting=nty
]{biblatex}
```
It appears as [1] in the text but my supervisor want the other style. What I've concluded is that the style overrides other changes I've done so far. I tried the natbib but the knowledge in general of Latex is limited, but it truly gets good when it work.
| https://tex.stackexchange.com/users/299420 | Changing in text citation with ACS-style | false | To meet what you want, you can simply define the command below:
```
\newcommand{\cited}[1]{(\citeauthor{#1}, \citeyear{#1})}
```
However, when you do this, clicking on the year no longer leads to the corresponding reference in the Bibliography section. So we need to change the citeyear command. (This specific solution was given here: [Getting hyperref to work with \citeyear and \citeyearpar in biblatex](https://tex.stackexchange.com/questions/83872/getting-hyperref-to-work-with-citeyear-and-citeyearpar-in-biblatex))
More information on this is available in page 184 of this pdf:
<https://ftp.yz.yamagata-u.ac.jp/pub/CTAN/macros/latex/contrib/biblatex/doc/biblatex.pdf>
A snippet will look like this:
```
% Basic settings
\documentclass[12pt, a4paper]{article}
\usepackage[english]{babel}
% Bibliography management
\usepackage[backend=biber, style=chem-acs]{biblatex}
\usepackage[hidelinks]{hyperref}
\addbibresource{References.bib}
% Redefining citeyear
\DeclareCiteCommand{\citeyear}
{}
{\bibhyperref{\printfield{year}}}
{\multicitedelim}
{}
% The command
\newcommand{\cited}[1]{(\citeauthor{#1}, \citeyear{#1})}
\begin{document}
\section*{Introduction}
Lorem ipsum \cited{example}
\printbibliography[heading=bibintoc,title={Bibliography}]
\end{document}
```
| 0 | https://tex.stackexchange.com/users/298810 | 689192 | 319,724 |
https://tex.stackexchange.com/questions/35 | 216 | I often see output from TeX with the warning `overfull hbox, badness 10000`. What does this message mean?
| https://tex.stackexchange.com/users/60 | What does "overfull hbox" mean? (Why is there a black mark at the end of a line?) | false | If you want to know exactly where the overflow is occurring, add this line:
`\documentclass[draft]{article}`.
It will put a literal black box there and it'll make it much easier to diagnose.
Note: All images will not show while it is in draft mode.
| 0 | https://tex.stackexchange.com/users/260295 | 689200 | 319,727 |
https://tex.stackexchange.com/questions/689194 | 0 | The following example is largely shorn of its original context as part
of the process of simplification.
This LaTeX file, if compiled with `pdflatex parameternum.tex`, gives
```
! Illegal parameter number in definition of \reserved@a.
```
The structure of this file has been the same for a long time. However,
I only recently added the use of `\IfFileExists` and `\PackageError`
to `\foo`, which made it blow up. If one just uses
```
\NewDocumentCommand{\foo}{m +m}
{
#2
}
```
there is no error. Similarly, if one leaves out
```
\renewcommand{\nextnuml}[1]{\refstepcounter{tabenum}\thetabenum.\label{\theletternum:#1}}
```
from the second argument in the call to `\foo`, the error
disappears. These two changes are different, but they both involve a
parameter character.
Alternatively, leaving in that line, but doubling the parameter
character from # to ## also makes the error go away. I.e.
```
\renewcommand{\nextnuml}[1]{\refstepcounter{tabenum}\thetabenum.\label{\theletternum:##1}}
```
This seems similar to the situation where defining a macro inside the
definition of another macro requires doubling the parameter character,
and the error is similar. But as far as I can tell, this is the
(re)definition of a macro inside a macro invocation, so not the same
thing.
Doubling the parameter character takes care of the error, as already
said, but of course I'd like to know what is going on here.
Running a trace does not enlighten me, though it does produce
```
<argument> ...etabenum .\label {\theletternum :##1
}} Text
\reserved@a #1#2->#1
```
The file follows.
```
% 12pt default for scrlttr2
\documentclass{scrlttr2}
\newcommand{\nextnuml}[1]{\refstepcounter{tabenum}\thetabenum.\label{#1}}
% \NewDocumentCommand{\foo}{m +m}
% {
% #2
% }
\NewDocumentCommand{\foo}{m +m}
{
\IfFileExists{./#1}{
#2
}{\PackageError{foo}{CONFIG FILE '#1' DOES NOT EXIST - NOT CREATING FORMLETTER}{Check that the config filename (first argument) has been correctly passed to \formletter}}
}
% Parameters for document commands
\newcommand{\addressesconfigfilename}{formletterbug.addresses.yaml}
\begin{filecontents}[overwrite,noheader]{\addressesconfigfilename}
foo
\end{filecontents}
\begin{document}
\newcounter{letternum}
\foo{\addressesconfigfilename}
{
\stepcounter{letternum}
\renewcommand{\nextnuml}[1]{\refstepcounter{tabenum}\thetabenum.\label{\theletternum:#1}}
Text
}
\end{document}
```
PS. When I was posting this, ["Illegal parameter number in definition of \reserved@a" following \IfFileExists](https://tex.stackexchange.com/q/639979/3406) came up as a similar question. Since this also involves `\IfFileExists` it's probably relevant. Though I don't understand Phelype's answer there.
>
> \IfFileExists doesn't work like “usual” conditionals: it stores the true and false branches in macros, and uses them later.
>
>
>
More details, please. Does this correspond to defining a macro inside another macro? If not, why is the doubling necessary?
| https://tex.stackexchange.com/users/3406 | Illegal parameter number in definition of \reserved@a' error when redefining a macro inside a macro invocation | true | You are passing
```
\stepcounter{letternum}
\renewcommand{\nextnuml}[1]{\refstepcounter{tabenum}\thetabenum.\label{\theletternum:#1}}
Text
```
as argument into the `\IfFileExists` and as described in the other question it then chokes on the `#1`.
You can use an indirection instead:
```
\makeatletter
\NewDocumentCommand{\foo}{m +m}
{
\IfFileExists{./#1}
{\@firstoftwo}
{\@secondoftwo}
{#2}
{\PackageError{foo}{CONFIG FILE '#1' DOES NOT EXIST - NOT CREATING FORMLETTER}{Check that the config filename (first argument) has been correctly passed to \formletter}}
}
```
or use the L3 command:
```
\ExplSyntaxOn
\NewDocumentCommand{\foo}{m +m}
{
\file_if_exist:nTF
{./#1}
{#2}
{\PackageError{foo}{CONFIG~FILE~'#1'~DOES~NOT~EXIST}{}}
}
\ExplSyntaxOff
```
| 4 | https://tex.stackexchange.com/users/2388 | 689201 | 319,728 |
https://tex.stackexchange.com/questions/689191 | 0 | I would like to use the bibliographystyle alpha to get author-date references. A few of my authors (Apéry, Poénaru) have names with an accent over the third letter. Those are indicated by \'{e} in the bib file (eg Ap\'{e}ry). When Bibtex process the bib file, it incorporates the accent. Not surprisingly, I get an error message
`Runaway argument? {{Ap\}86} \par \bibitem [{Ap\}86]{K2-42} {Ap\'ery, Fran\c {c}ois}.`
when processing via Latex after running Bibtex. It doesn't have any trouble with those names unless it's the first author (as in the second bib entry in the example below).
Eg in the MWE below, the bbl file shows
```
\begin{thebibliography}{{Ap\\}86}
\bibitem[{Ap\\}86]{K2-42}
{Ap\\'ery, Fran\c{c}ois}.
\newblock {La surface de Boy}.
\newblock {\em Advances in Mathematics}, 61:185--266, 1986.
\bibitem[{Jon}87]{K2-43}
{Jones, V. and Ap\\'ery, Fran\c{c}ois}.
\newblock {A non-existent paper}.
\newblock {\em Advances in Mathematics}, 61:185--266, 1987.
\end{thebibliography}
```
(Note Ap\ in the first line and in the first \bibitem). How can I prevent this from happening? I tried a few things, eg inserting {} before the accent, enclosing the names in extra braces. This seems obscure but presumably someone has encountered this issue before.
Here is a MWE
```
\documentclass[11pt]{book}
\begin{document}
\chapter{Knot theory}
\section{Introduction}
This citation produces an error \cite{K2-42}
but this one does not produce an error \cite{K2-43}
\begin{filecontents}{backtest.bib}
@article{K2-42,
author = {{Ap\'ery, Fran\c{c}ois}},
title = {{La surface de Boy}},
journal = {Advances in Mathematics},
volume = {61},
year = {1986},
pages = {185--266},
}
@article{K2-43,
author = {{Jones, V. and Ap\'ery, Fran\c{c}ois}},
title = {{A non-existent paper}},
journal = {Advances in Mathematics},
volume = {61},
year = {1987},
pages = {185--266},
}
\end{filecontents}
\bibliographystyle{alpha}
\bibliography{backtest}
\end{document}
```
| https://tex.stackexchange.com/users/23966 | Extra backslash from accent in citations using \bibliographystyle{alpha} | true | The main problem here are excessive curly braces around names.
You don't want double brace around the contents of name fields. That will stop BibTeX processing the individual names as names and will stop parsing them into first and last name. Get rid of the double braces unless you want to reference a "corporate" (non-person) author ([Using a 'corporate author' in the "author" field of a bibliographic entry (spelling out the name in full)](https://tex.stackexchange.com/q/10808/35864)).
On the other hand, you will need to wrap the accented characters into an additional pair of curly braces to have BibTeX understand them correctly for sorting and abbreviation purposes. See [How to write “ä” and other umlauts and accented letters in bibliography?](https://tex.stackexchange.com/q/57743/35864).
In your case that means that the names should be given as
```
\documentclass[11pt]{article}
\begin{filecontents}{\jobname.bib}
@article{K2-42,
author = {Ap{\'e}ry, Fran{\c{c}}ois},
title = {La surface de Boy},
journal = {Advances in Mathematics},
volume = {61},
year = {1986},
pages = {185-266},
}
@article{K2-43,
author = {Jones, V. and Ap{\'e}ry, Fran{\c{c}}ois},
title = {A non-existent paper},
journal = {Advances in Mathematics},
volume = {61},
year = {1987},
pages = {185-266},
}
\end{filecontents}
\begin{document}
This citation produces an error \cite{K2-42}
but this one does not produce an error \cite{K2-43}
\bibliographystyle{alpha}
\bibliography{\jobname}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/35864 | 689209 | 319,734 |
https://tex.stackexchange.com/questions/689179 | 0 | Im in the middle of writing a scientific report and have the issue of:
I want to use the ACS ref-style in the reference list but not in text. It would be preferably to use the format of for example
>
> (Lastname, 1990)
>
>
>
in text.
Currently the biblatex is used with the following input
```
\usepackage[
backend=biber,
style=chem-acs,
sorting=nty
]{biblatex}
```
It appears as [1] in the text but my supervisor want the other style. What I've concluded is that the style overrides other changes I've done so far. I tried the natbib but the knowledge in general of Latex is limited, but it truly gets good when it work.
| https://tex.stackexchange.com/users/299420 | Changing in text citation with ACS-style | true | `chem-acs` is fundamentally a numeric style. Combining it with author-year citations without any changes will lead to weird results.
`biblatex` allows you to select the bibliography and citation style separately. So the naive approach of
```
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[
backend=biber,
bibstyle=chem-acs,
citestyle=authoryear,
sorting=nyt,
]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem \autocite{sigfridsson}
\printbibliography
\end{document}
```
works in principle, but creates undesirable output
The number in the bibliography has no connection to anything in the text and actually takes focus away from the name (which you need to identify the citation uniquely).
We can get rid of the number by redefining the bibliography environment.
```
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[
backend=biber,
bibstyle=chem-acs,
citestyle=authoryear,
sorting=nyt,
]{biblatex}
\defbibenvironment{bibliography}
{\list
{}
{\setlength{\leftmargin}{\bibhang}%
\setlength{\itemindent}{-\leftmargin}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}}
{\endlist}
{\item}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem \autocite{sigfridsson}
ipsum \autocite{worman}
dolo \autocite{geer}
\printbibliography
\end{document}
```
But this highlights another way in which this combination is suboptimal: A citation is identified by author and year. The year is hidden towards the end of an entry and does not immediately catch our attention when we scan the entries (unless maybe for `@article`s, where the year is bold). As such the bibliography style is a poor fit for author-year citations.
A standard `authoryear` style produces much more pleasant results.
```
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[
backend=biber,
style=authoryear,
]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem \autocite{sigfridsson}
ipsum \autocite{worman}
dolo \autocite{geer}
\printbibliography
\end{document}
```
| 0 | https://tex.stackexchange.com/users/35864 | 689210 | 319,735 |
https://tex.stackexchange.com/questions/87903 | 14 | I'm writing my PhD thesis in LaTeX and I have a lot of figures - each one is referenced within the text. So I have:
```
\begin{figure}[h]
...
...
\label{fig:stuff}
\end{figure}
```
then, later, in the text:
```
blah blah blah this is shown in \ref{fig:stuff}, which indicates blah blah
```
and I get:
```
blah blah blah this is shown in Figure 2.7, which indicates blah blah
```
I want to make "Figure 2.7" bold - I'm loading the caption package with the `labelfont=bf` option so that it's bold in the caption of the figure itself, but I'd also like it to be bold in the text. I guess I could do this with
```
blah blah blah this is shown in \textbf{\ref{fig:stuff}}, which indicates blah blah
```
but ideally I'd like not to have to change multiple references to all 71 figures...
Any ideas?
| https://tex.stackexchange.com/users/23566 | Bold cross references | false | Using Quarto, for some reason I had to do a mix of the answers above
```
header-includes:
- \usepackage[capitalise,noabbrev, nameinlink]{cleveref} # Allows \cref{} to cite latex table as "Table 3"
# Specify which cross-reference should automatically be bolded : Tables and Figures
# Use \cref{} ; For some reason this only works with this exact disposition :
# Only #1, nameinlink and each of the reference specified. namelink + #1#2#3 would give an error.
- \crefdefaultlabelformat{#2\textbf{#1}#3} # <-- Only #1 in \textbf
- \crefname{table}{\textbf{Table}}{\textbf{Tables}}
- \Crefname{table}{\textbf{Table}}{\textbf{Tables}}
- \crefname{figure}{\textbf{Figure}}{\textbf{Figures}}
- \Crefname{figure}{\textbf{Figure}}{\textbf{Figures}}
```
| 0 | https://tex.stackexchange.com/users/284278 | 689218 | 319,740 |
https://tex.stackexchange.com/questions/681418 | 44 | I'm currently reading [Sparks of Artificial General Intelligence: Early experiments with GPT-4](https://arxiv.org/pdf/2303.12712.pdf). This paper by Microsoft employees experiments with the capabilities of GPT-4, a successor of ChatGPT. One task is to draw a unicorn with tikz.ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ
They claim:
>
> GPT-4 produces impressive outputs that are [...] at least comparable (if not superior) to what a human would do.
>
>
>
Who wants to prove them wrong?
edit: Please don't include PNG / JPG / other pixel image formats. MS-SPO is the only one allowed to do that (as a grandfathering-rule) - kudos for finding the loophole in this question and for thinking outside of the box
edit: We now have 200 [fun](/questions/tagged/fun "show questions tagged 'fun'") questions!
| https://tex.stackexchange.com/users/5645 | Draw a unicorn in TikZ | false | For your entertainment I tried [phind.com](https://www.phind.com) on the unicorns. In contrast to ChatGPT it claims to access the internet and uses links, i.e. actual information, with focus on programming.
Being closer to a search engine it also displays related links ... though it's not always clear, how it obtained the solution from said links. This seems to be a feature of GPT (General Pre-Trained language models, which can't be or map knowledge models). *(GPT-3.5, long answer)*
Enjoy the results.
### draw a unicorn with tikz, to be used in latex.
Could be worse ...
### draw a detailed unicorn with tikz, to be used in latex. show the complete code, please.
qed ...
### Code
As produced, without indenting, just combined into one.
```
\documentclass[10pt,border=3mm,tikz]{standalone}% my edit
%\documentclass{article}% as proposed
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
% Body
\filldraw[color=white, fill=white] (0,0) circle (2);
% Horn
\filldraw[color=yellow, fill=yellow] (0,2) -- (-0.5,4) -- (0.5,4) -- cycle;
% Mane
\filldraw[color=pink, fill=pink] (-1,1) -- (-2,3) -- (-1,3) -- cycle;
\filldraw[color=pink, fill=pink] (1,1) -- (2,3) -- (1,3) -- cycle;
% Tail
\draw[color=blue, ultra thick] (0,-2) -- (0,-4);
% Eyes
\filldraw[color=black, fill=black] (-0.5,0.5) circle (0.1);
\filldraw[color=black, fill=black] (0.5,0.5) circle (0.1);
\end{tikzpicture}
\begin{tikzpicture}
% Body
\filldraw[gray!50] (0,0) circle (2cm);
% Legs
\draw[gray, thick] (-1.5,-1) -- (-1.5,-3);
\draw[gray, thick] (1.5,-1) -- (1.5,-3);
% Horn
\draw[gray, thick] (0,2) -- (0,4);
% Eyes
\filldraw[black] (-0.5,0.5) circle (0.1cm);
\filldraw[black] (0.5,0.5) circle (0.1cm);
% Label
\node[anchor=north] at (0,-3.5) {Unicorn};
\end{tikzpicture}
\end{document}
```
### P.S.: some "refinement"
Following some guide how to formulate prompts (input to such interfaces), I tried the following. Please judge for yourself ...
Prompt/instruction: *Draw a unicorn using tikz, so I can use it with Latex. Make it detailed. Avoid using simple shapes, i.e. avoid triangles, avoid circles, avoid simple lines, use more sophisticated elements. Output the complete code so I can copy it.*
```
% Draw a unicorn using tikz, so I can use it with Latex. Make it detailed. Avoid using simple shapes, i.e. avoid triangles, avoid circles, avoid simple lines, use more sophisticated elements. Output the complete code so I can copy it.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=0.5]
% Head
\fill[white] (0,0) circle (4);
% Eyes
\fill[black] (-1,1.5) circle (0.5);
\fill[black] (1,1.5) circle (0.5);
% Horn
\draw[gray, line width=2] (0,0) -- (0,4);
% Ears
\fill[gray] (-3,3) -- (-2,4) -- (-1,3) -- cycle;
\fill[gray] (3,3) -- (2,4) -- (1,3) -- cycle;
% Mane
\fill[blue!50] (-4,0) to[out=90,in=180] (-3,2) to[out=0,in=180] (-2,4) to[out=0,in=180] (2,4) to[out=0,in=180] (3,2) to[out=0,in=90] (4,0);
% Body
\fill[pink] (-4,0) to[out=270,in=180] (-2,-2) to[out=0,in=180] (2,-2) to[out=0,in=270] (4,0);
% Legs
\fill[gray] (-3,-4) rectangle (-1,-2);
\fill[gray] (3,-4) rectangle (1,-2);
% Hooves
\fill[black] (-2.5,-4) rectangle (-1.5,-3.5);
\fill[black] (2.5,-4) rectangle (1.5,-3.5);
\end{tikzpicture}
\end{document}
```
To make the "head" visible, I changed it to:
```
% Head
\fill[yellow!50] (0,0) circle (4);
```
One of us probably needs to study unicorn anatomy ...
| 3 | https://tex.stackexchange.com/users/245790 | 689221 | 319,742 |
https://tex.stackexchange.com/questions/689039 | 1 | I start by giving some Arch-related context, but the question remains about `vimtex` and `latexmk`.
Yesterday, I tried updating my computer on Arch. I got an error
```
installing texlive-core (2023.66587-1) breaks dependency 'texlive-core<2023' required by tllocalmgr
```
(or something quite similar). [This link](https://www.reddit.com/r/archlinux/comments/126m0er/texlivecore_breaks_dependency_required_by/) suggested I remove `tllocalmgr`, update/upgrade then reinstall `tllocalmgr`.
However, this solution didn't work. `tllocalmgr` is no longer working, and I was having a hard time using `latexmk` with `tlmgr`. Ultimately, I deleted all of my `texlive` packages from `pacman`, cleaned all `texlive`, and then reinstalled the native `texlive` in `perl` only, which seems to be the more robust approach (see [here](https://wiki.archlinux.org/title/TeX_Live#Native_TeX_Live)). This way, **latexmk works from the terminal**.
My `vimtex` integration in `neovim` remains broken though. `:checkhealth` gives a clean output, I do **not** have a "latexmk is not executable" (well, anymore). I can use everything it allows for editing (math zones, environments delimiters, toggling fractions…), but compiling fails without creating a log file. MWE:
```
\documentclass{article}
\begin{document}
Compiling fails.
\end{document}
```
From `neovim` using `vimtex`, I only get a `.aux` with
```
\relax
\gdef \@abspage@last{1}
```
and a `.fdb_latexmk` file with
```
# Fdb version 4
["pdflatex"] 1687213270 "test_random.tex" "test_random.pdf" "test_random" 1687213270 2
(generated)
"test_random.aux"
"test_random.log"
"test_random.pdf"
(rewritten before read)
```
as contents.
From the terminal with `latexmk -pdf test_random.tex`, I get the same `.aux`, but the `.fdb_latexmk` reads
```
# Fdb version 4
["pdflatex"] 1687213361 "test_random.tex" "test_random.pdf" "test_random" 1687213362 0
"/usr/local/texlive/2023/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb" 1248133631 35752 024fb6c41858982481f6968b5fc26508 ""
"/usr/local/texlive/2023/texmf-dist/tex/latex/base/article.cls" 1686341992 20144 fbcf51733730d8f1a62143512ff5b1fe ""
"/usr/local/texlive/2023/texmf-dist/tex/latex/base/size10.clo" 1686341992 8448 74078c4a887f2cdcd57c3ec111622740 ""
"/usr/local/texlive/2023/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def" 1681935207 29940 9473d58112bc8a88f5505b823a053dde ""
"/usr/local/texlive/2023/texmf-dist/web2c/texmf.cnf" 1681165822 40967 d940221f8762fd5848760382d97d1226 ""
"/usr/local/texlive/2023/texmf-var/fonts/map/pdftex/updmap/pdftex.map" 1687134019 4643411 5ced174c6d521e21dd58a10751c00482 ""
"/usr/local/texlive/2023/texmf-var/web2c/pdftex/pdflatex.fmt" 1687134040 7903677 2d412a3b911ee16f5c4df729eb70373f ""
"/usr/local/texlive/2023/texmf.cnf" 1687134016 455 5b996dcaa0eb4ef14a83b026bc0a008c ""
"test_random.aux" 1687213362 32 3985256e7290058c681f74d7a3565a19 "pdflatex"
"test_random.tex" 1687213261 76 405d82d3ea6d1935f53b22157943c78c ""
(generated)
"test_random.aux"
"test_random.log"
"test_random.pdf"
(rewritten before read)
```
and I get a `.fls` and `.log` files.
I tried reinstalling `vimtex`, but to no avail. My configuration file `vimtex.lua` using `lazyvim` is
```
return {
{
"lervag/vimtex",
ft = "tex", -- without ft, it's not working too
lazy = false,
config = function()
vim.g.vimtex_quickfix_enabled = 1
vim.g.vimtex_syntax_enabled = 1
vim.g.vimtex_quickfix_mode = 0
vim.g.tex_flavor = "latex"
vim.g.tex_conceal = "abdmg"
vim.g.vimtex_compiler_method = "latexmk"
vim.g.vimtex_view_method = "zathura"
vim.g.latex_view_general_viewer = "zathura"
vim.cmd("call vimtex#init()")
end,
},
}
```
My terminal `echo $PATH` and neovim's `echo $PATH` do not match though. My `latexmk` is located in `/usr/local/texlive/2023/bin/x86_64-linux/latexmk`, which is in my terminal PATH. My neovim PATH is `/home/nora/.local/share/nvim/mason/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/home/nora/.dotnet/tools:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl`. This doesn't seem to be the root cause of the issue, as `vimtex` sees `latexmk` as an executable (even giving a `.fdb_latexmk` file).
I do not have a `.latexmkrc` file.
`nvim --version` outputs
```
NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
```
`:VimtexInfo` gives
```
System info:
OS: Arch Linux
Vim version: NVIM v0.9.1
Has clientserver: true
Servername: /run/user/1000/nvim.651391.0
VimTeX project: test_random
base: test_random.tex
root: /home/nora/Documents/Enseignement/Prepa/2022/figures_generales
tex: /home/nora/Documents/Enseignement/Prepa/2022/figures_generales/test_random.tex
main parser: fallback current file
document class: article
compiler: latexmk
engine: -pdf
options:
-verbose
-file-line-error
-synctex=1
-interaction=nonstopmode
callback: 1
continuous: 1
executable: latexmk
job:
jobid: 19
output: /tmp/nvim.nora/CaXhwO/0
cmd: max_print_line=2000 latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -pdf -pvc -view=none -e '$compiling_cmd = ($compiling_cmd ? $compiling_cmd . " ; " : "") . "echo vimtex_compiler_callback_compiling"' -e '$success_cmd = ($success_cmd ? $success_cmd . " ; " : "") . "echo vimtex_compiler_callback_success"' -e '$failure_cmd = ($failure_cmd ? $failure_cmd . " ; " : "") . "echo vimtex_compiler_callback_failure"' 'test_random.tex'
pid: 0
viewer: Zathura
xwin id: 0
qf method: LaTeX logfile
```
Thanks for any help you might give me!
| https://tex.stackexchange.com/users/284518 | `latexmk` running in terminal but not in neovim with `vimtex` after switching to native TeXLive installer | false | I found the issue while stumbling upon another error launching a `.py` file with neovim (`kpathsea: configuration file texmf.cnf not found in these directories`), and it's unfortunately (or maybe, fortunately) a "dumb" one: I was launching my `.tex` files from the same instance of `ranger`, so it was not sourced.
Launching from a fresh terminal solved everything (although I still had to delete `tllocalmgr` etc beforehand, I had rebooted a few times during that process)… Well, now `vimtex` says `Compilation failed!` while the logs don't say it did and compilation works, but I'd rather have it this way around.
| 0 | https://tex.stackexchange.com/users/284518 | 689229 | 319,744 |
https://tex.stackexchange.com/questions/689224 | 0 | I am having trouble understanding Overleaf's seven complaints about the following code. It seems to be saying that I am using some undefined Unicode characters, but I'm not sure which ones are undefined and how I can define them (or, better, if there is a way to automatically convert the characters that are making Overleaf complain into characters that it will not complain about).
```
\documentclass{book}
\usepackage[english,greek]{babel}
\usepackage{alphabeta}
\begin{document}
Ἀμενάρτας, τοῦ βασικοῦ γένους τοῦ Αἰγυπτίου, ἡ τοῦ Καλλικράτους Ἴσιδος ἱερέως, ἣν οἱ μὲν θεοὶ τρέφουσι τὰ δὲ δαιμονια ὑποτάσσεται, ἤδη τελευτῶσα Τισισθένει τῷ παιδὶ ἐπιστέλλει τάδε· συνέφυγον γάρ ποτε ἐκ τῆς Αἰγυπτίας ἐπὶ Νεκτανέβου μετὰ τοῦ σοῦ πατρός, διὰ τὸν ἔρωτα τὸν ἐμὸν ἐπιορκήσαντος. φυγόντες δὲ πρὸς νότον διαπόντιοι καὶ κʹδʹ μῆνας κατὰ τὰ παραθαλάσσια τῆς Αιβύης τὰ πρός ἡλίου ἀνατολὰς πλανηθέντες, ἔνθαπερ πέτρα τις μελάλη, γλυπτὸν ὁμοίωμα Αἰθίοπος κεφαλῆς, εἶτα ἡμέρας δʹ ἀπὸ στόματος ποταμοῦ μεγάλου ἐκπεσόντες, οἱ μέν κατεποντίσθημεν, οἱ δὲ νόσῳ ἀπεθάνομεν· τέλος δὲ ὑπ᾽ ἀλρίων ἀνθρώπων ἐφερόμεθα διὰ ἐλέων τε καὶ τεναλέων ἔνθαπερ πτηνῶν πλῆθος ἀποκρύπτει τὸν οὐρανὸν, ἡμέρας ί, ἕως ἤλθομεν εἰς κοῖλόν τι ὄρος, ἔνθα ποτὲ μεγάλη μὲν πόλις ἦν, ἄντρα δὲ ἀπείρονα· ἤγαγον δὲ ὡς βασίλειαν τὴν τῶν ξένους χύτραις στεφανούντων, ἥτις μαλεία μὲν ἐχρῆτο ἐπιστήμη δὲ πάντων καὶ δὴ καὶ κάλλός καὶ ῥώμην ἀλήρως ἦν· ἡ δὲ Καλλικράτους τοῦ πατρὸς ἐρασθεῖδα τὸ μὲν πρῶτον συνοικεῖν ἐβούλετο ἐμὲ δὲ ἀνελεῖν· ἔπειτα, ὡς οὐκ ἀνέπειθεν, ἐμὲ γὰρ ὑπερεφίλει καὶ τὴν ξένην ἐφοβεῖτο, ἀπήγαγεν ἡμᾶς ὑπὸ μαγείας καθʹ ὁδοὺς σφαλερὰς ἔνθα τὸ βάραθρον τὸ μέγα, οὗ κατὰ στόμα ἔκειτο ὁ γέρων ὁ φιλόσοφος τεθνεώς, ἀφικομένοις δʹ ἔδειξε φῶς τοῦ βίου εὐθύ, οἷον κίονα ἑλισσόμενον φώνην ἱέντα καθάπερ βροντῆς, εἶτα διὰ πυρὸς βεβηκυῖα ἀβλαβὴς καὶ ἔτι καλλίων αὐτὴ ἑαυτῆς ἐξεφάνη. ἐκ δὲ τούτων ὤμοσε καὶ τὸν σὸν πατέρα ἀθάνατον ἀποδείξειν, εἰ συνοικεῖν οἱ βούλοιτο ἐμὲ δε ὰνελεῖν, οὐ γὰρ οὖν αὐτὴ ἀνελεῖν ἴσχυεν ὑπὸ τῶν ἡμεδαπῶν ἣν καὶ αὐτὴ ἔχω μαγείας. ὁ δʹ οὐδέν τι μᾶλλον ἤθελε, τὼ χεῖρε τῶν ὀμμάτων προίσχων ἵνα δὴ τὸ τῆς γυναικὸς κάλλος μὴ ὁρῴη· ἔπειτα ὀργισθεῖσα κατεγοήτευσε μὲν αὐτόν, ἀπολόμενον μέντοι κλάουσα καὶ ὀδυρμένη ἐκεῖθεν ἀπήνεγκεν, ἐμὲ δὲ φόβῳ ἀφῆκεν εἰς στόμα τοῦ μεγάλου ποταμοῦ τοῦ ναυσιπόρου, πόδδω δὲ ναυσίν, ἐφʹ ὧνπερ πλέουσα ἔτεκόν σε, ἀποπλεύσασα μόλις ποτὲ δεῦρο Ἀθηνάζε κατηγαγόν. σὺ δέ, ὦ Τισίσθενες, ὧν ἐπιστέλλω μὴ ὀλιγώρει· δεῖ γὰρ τῆν γυναῖκα ἀναζητεῖν ἤν πως τῦ βίου μυστήριον ἀνεύρῃς, καὶ ἀναιρεῖν, ἤν που παρασχῇ, διὰ τὸν πατέρα Καλλικράτους. εἐ δὲ φοβούμενος ἢ διὰ ἄλλο τι αὐτὸς λείπει τοῦ ἔργου, πᾶσι τοῖς ὕστερον αὐτὸ τοῦτο ἐπιστέλλω, ἕως ποτὲ ἀγαθός τις γενόμενος τῷ πυρὶ λούσασθαι τολμήσει καὶ τὰ ἀριστεῖα ἔχων βασιλεῦσαι τῶν ἀνθρώπων· ἄπιστα μὲν δὴ τὰ τοιαῦτα λέγω, ὅμως δὲ ἃ αὐτὴ ἔγνωκα οὐκ ἐψευσάμην.
\end{document}
```
| https://tex.stackexchange.com/users/277990 | Undefined Unicode characters | true | You want to replace `ʹ` (U+02B9 MODIFIER LETTER PRIME) with `ʹ` (U+0374 GREEK NUMERAL SIGN).
I found the same text at <https://bygosh.com/novels/she/the-sherd-of-amenartas/> and it has the characters I suggest.
```
\documentclass{book}
\usepackage[english,greek]{babel}
%\usepackage{alphabeta}
\begin{document}
Ἀμενάρτας, τοῦ βασικοῦ γένους τοῦ Αἰγυπτίου, ἡ τοῦ
Καλλικράτους Ἴσιδος ἱερέως, ἣν οἱ μὲν θεοὶ τρέφουσι
τὰ δὲ δαιμονια ὑποτάσσεται, ἤδη τελευτῶσα Τισισθένει
τῷ παιδὶ ἐπιστέλλει τάδε· συνέφυγον γάρ ποτε ἐκ τῆς
Αἰγυπτίας ἐπὶ Νεκτανέβου μετὰ τοῦ σοῦ πατρός, διὰ τὸν
ἔρωτα τὸν ἐμὸν ἐπιορκήσαντος. φυγόντες δὲ πρὸς νότον
διαπόντιοι καὶ κʹδʹ μῆνας κατὰ τὰ παραθαλάσσια τῆς
Αιβύης τὰ πρός ἡλίου ἀνατολὰς πλανηθέντες, ἔνθαπερ
πέτρα τις μελάλη, γλυπτὸν ὁμοίωμα Αἰθίοπος κεφαλῆς,
εἶτα ἡμέρας δʹ ἀπὸ στόματος ποταμοῦ μεγάλου ἐκπεσόντες,
οἱ μέν κατεποντίσθημεν, οἱ δὲ νόσῳ ἀπεθάνομεν· τέλος δὲ
ὑπ᾽ ἀλρίων ἀνθρώπων ἐφερόμεθα διὰ ἐλέων τε καὶ τεναλέων
ἔνθαπερ πτηνῶν πλῆθος ἀποκρύπτει τὸν οὐρανὸν, ἡμέρας ί,
ἕως ἤλθομεν εἰς κοῖλόν τι ὄρος, ἔνθα ποτὲ μεγάλη μὲν πόλις
ἦν, ἄντρα δὲ ἀπείρονα· ἤγαγον δὲ ὡς βασίλειαν τὴν τῶν ξένους
χύτραις στεφανούντων, ἥτις μαλεία μὲν ἐχρῆτο ἐπιστήμη δὲ
πάντων καὶ δὴ καὶ κάλλός καὶ ῥώμην ἀλήρως ἦν· ἡ δὲ
Καλλικράτους τοῦ πατρὸς ἐρασθεῖδα τὸ μὲν πρῶτον συνοικεῖν
ἐβούλετο ἐμὲ δὲ ἀνελεῖν· ἔπειτα, ὡς οὐκ ἀνέπειθεν, ἐμὲ γὰρ
ὑπερεφίλει καὶ τὴν ξένην ἐφοβεῖτο, ἀπήγαγεν ἡμᾶς ὑπὸ μαγείας
καθʹ ὁδοὺς σφαλερὰς ἔνθα τὸ βάραθρον τὸ μέγα, οὗ κατὰ στόμα
ἔκειτο ὁ γέρων ὁ φιλόσοφος τεθνεώς, ἀφικομένοις δʹ ἔδειξε
φῶς τοῦ βίου εὐθύ, οἷον κίονα ἑλισσόμενον φώνην ἱέντα
καθάπερ βροντῆς, εἶτα διὰ πυρὸς βεβηκυῖα ἀβλαβὴς καὶ
ἔτι καλλίων αὐτὴ ἑαυτῆς ἐξεφάνη. ἐκ δὲ τούτων ὤμοσε καὶ τὸν
σὸν πατέρα ἀθάνατον ἀποδείξειν, εἰ συνοικεῖν οἱ βούλοιτο ἐμὲ
δε ὰνελεῖν, οὐ γὰρ οὖν αὐτὴ ἀνελεῖν ἴσχυεν ὑπὸ τῶν ἡμεδαπῶν
ἣν καὶ αὐτὴ ἔχω μαγείας. ὁ δʹ οὐδέν τι μᾶλλον ἤθελε, τὼ χεῖρε
τῶν ὀμμάτων προίσχων ἵνα δὴ τὸ τῆς γυναικὸς κάλλος μὴ ὁρῴη·
ἔπειτα ὀργισθεῖσα κατεγοήτευσε μὲν αὐτόν, ἀπολόμενον μέντοι
κλάουσα καὶ ὀδυρμένη ἐκεῖθεν ἀπήνεγκεν, ἐμὲ δὲ φόβῳ ἀφῆκεν
εἰς στόμα τοῦ μεγάλου ποταμοῦ τοῦ ναυσιπόρου, πόδδω δὲ ναυσίν,
ἐφʹ ὧνπερ πλέουσα ἔτεκόν σε, ἀποπλεύσασα μόλις ποτὲ δεῦρο
Ἀθηνάζε κατηγαγόν. σὺ δέ, ὦ Τισίσθενες, ὧν ἐπιστέλλω μὴ
ὀλιγώρει· δεῖ γὰρ τῆν γυναῖκα ἀναζητεῖν ἤν πως τῦ βίου
μυστήριον ἀνεύρῃς, καὶ ἀναιρεῖν, ἤν που παρασχῇ, διὰ τὸν
πατέρα Καλλικράτους. εἐ δὲ φοβούμενος ἢ διὰ ἄλλο τι αὐτὸς
λείπει τοῦ ἔργου, πᾶσι τοῖς ὕστερον αὐτὸ τοῦτο ἐπιστέλλω,
ἕως ποτὲ ἀγαθός τις γενόμενος τῷ πυρὶ λούσασθαι τολμήσει
καὶ τὰ ἀριστεῖα ἔχων βασιλεῦσαι τῶν ἀνθρώπων· ἄπιστα μὲν
δὴ τὰ τοιαῦτα λέγω, ὅμως δὲ ἃ αὐτὴ ἔγνωκα οὐκ ἐψευσάμην.
\end{document}
```
| 4 | https://tex.stackexchange.com/users/4427 | 689231 | 319,746 |
https://tex.stackexchange.com/questions/689224 | 0 | I am having trouble understanding Overleaf's seven complaints about the following code. It seems to be saying that I am using some undefined Unicode characters, but I'm not sure which ones are undefined and how I can define them (or, better, if there is a way to automatically convert the characters that are making Overleaf complain into characters that it will not complain about).
```
\documentclass{book}
\usepackage[english,greek]{babel}
\usepackage{alphabeta}
\begin{document}
Ἀμενάρτας, τοῦ βασικοῦ γένους τοῦ Αἰγυπτίου, ἡ τοῦ Καλλικράτους Ἴσιδος ἱερέως, ἣν οἱ μὲν θεοὶ τρέφουσι τὰ δὲ δαιμονια ὑποτάσσεται, ἤδη τελευτῶσα Τισισθένει τῷ παιδὶ ἐπιστέλλει τάδε· συνέφυγον γάρ ποτε ἐκ τῆς Αἰγυπτίας ἐπὶ Νεκτανέβου μετὰ τοῦ σοῦ πατρός, διὰ τὸν ἔρωτα τὸν ἐμὸν ἐπιορκήσαντος. φυγόντες δὲ πρὸς νότον διαπόντιοι καὶ κʹδʹ μῆνας κατὰ τὰ παραθαλάσσια τῆς Αιβύης τὰ πρός ἡλίου ἀνατολὰς πλανηθέντες, ἔνθαπερ πέτρα τις μελάλη, γλυπτὸν ὁμοίωμα Αἰθίοπος κεφαλῆς, εἶτα ἡμέρας δʹ ἀπὸ στόματος ποταμοῦ μεγάλου ἐκπεσόντες, οἱ μέν κατεποντίσθημεν, οἱ δὲ νόσῳ ἀπεθάνομεν· τέλος δὲ ὑπ᾽ ἀλρίων ἀνθρώπων ἐφερόμεθα διὰ ἐλέων τε καὶ τεναλέων ἔνθαπερ πτηνῶν πλῆθος ἀποκρύπτει τὸν οὐρανὸν, ἡμέρας ί, ἕως ἤλθομεν εἰς κοῖλόν τι ὄρος, ἔνθα ποτὲ μεγάλη μὲν πόλις ἦν, ἄντρα δὲ ἀπείρονα· ἤγαγον δὲ ὡς βασίλειαν τὴν τῶν ξένους χύτραις στεφανούντων, ἥτις μαλεία μὲν ἐχρῆτο ἐπιστήμη δὲ πάντων καὶ δὴ καὶ κάλλός καὶ ῥώμην ἀλήρως ἦν· ἡ δὲ Καλλικράτους τοῦ πατρὸς ἐρασθεῖδα τὸ μὲν πρῶτον συνοικεῖν ἐβούλετο ἐμὲ δὲ ἀνελεῖν· ἔπειτα, ὡς οὐκ ἀνέπειθεν, ἐμὲ γὰρ ὑπερεφίλει καὶ τὴν ξένην ἐφοβεῖτο, ἀπήγαγεν ἡμᾶς ὑπὸ μαγείας καθʹ ὁδοὺς σφαλερὰς ἔνθα τὸ βάραθρον τὸ μέγα, οὗ κατὰ στόμα ἔκειτο ὁ γέρων ὁ φιλόσοφος τεθνεώς, ἀφικομένοις δʹ ἔδειξε φῶς τοῦ βίου εὐθύ, οἷον κίονα ἑλισσόμενον φώνην ἱέντα καθάπερ βροντῆς, εἶτα διὰ πυρὸς βεβηκυῖα ἀβλαβὴς καὶ ἔτι καλλίων αὐτὴ ἑαυτῆς ἐξεφάνη. ἐκ δὲ τούτων ὤμοσε καὶ τὸν σὸν πατέρα ἀθάνατον ἀποδείξειν, εἰ συνοικεῖν οἱ βούλοιτο ἐμὲ δε ὰνελεῖν, οὐ γὰρ οὖν αὐτὴ ἀνελεῖν ἴσχυεν ὑπὸ τῶν ἡμεδαπῶν ἣν καὶ αὐτὴ ἔχω μαγείας. ὁ δʹ οὐδέν τι μᾶλλον ἤθελε, τὼ χεῖρε τῶν ὀμμάτων προίσχων ἵνα δὴ τὸ τῆς γυναικὸς κάλλος μὴ ὁρῴη· ἔπειτα ὀργισθεῖσα κατεγοήτευσε μὲν αὐτόν, ἀπολόμενον μέντοι κλάουσα καὶ ὀδυρμένη ἐκεῖθεν ἀπήνεγκεν, ἐμὲ δὲ φόβῳ ἀφῆκεν εἰς στόμα τοῦ μεγάλου ποταμοῦ τοῦ ναυσιπόρου, πόδδω δὲ ναυσίν, ἐφʹ ὧνπερ πλέουσα ἔτεκόν σε, ἀποπλεύσασα μόλις ποτὲ δεῦρο Ἀθηνάζε κατηγαγόν. σὺ δέ, ὦ Τισίσθενες, ὧν ἐπιστέλλω μὴ ὀλιγώρει· δεῖ γὰρ τῆν γυναῖκα ἀναζητεῖν ἤν πως τῦ βίου μυστήριον ἀνεύρῃς, καὶ ἀναιρεῖν, ἤν που παρασχῇ, διὰ τὸν πατέρα Καλλικράτους. εἐ δὲ φοβούμενος ἢ διὰ ἄλλο τι αὐτὸς λείπει τοῦ ἔργου, πᾶσι τοῖς ὕστερον αὐτὸ τοῦτο ἐπιστέλλω, ἕως ποτὲ ἀγαθός τις γενόμενος τῷ πυρὶ λούσασθαι τολμήσει καὶ τὰ ἀριστεῖα ἔχων βασιλεῦσαι τῶν ἀνθρώπων· ἄπιστα μὲν δὴ τὰ τοιαῦτα λέγω, ὅμως δὲ ἃ αὐτὴ ἔγνωκα οὐκ ἐψευσάμην.
\end{document}
```
| https://tex.stackexchange.com/users/277990 | Undefined Unicode characters | false | You can also use `xelatex` or `lualatatex` engines, and instead of `alphabeta` use a font with enough glyphs, for example DejaVu, to compile the text as is.
If you select the wrong font, for example, TeX Gyre Pagella, you will receive warnings but at least will be a PDF to check where are the missing characters (luckily marked as boxes instead of empty spaces).
This not suggest in any way that is acceptable use U+02B9 in greek instead of U+0374 (no idea about), only a way to deal deal with issues to compile a document due to some odd characters.
```
\documentclass{book}
\usepackage[english,greek]{babel}
\usepackage{fontspec}
\setmainfont{DejaVu Serif}
\begin{document}
Ἀμενάρτας, τοῦ ...
\end{document}
```
...
| 1 | https://tex.stackexchange.com/users/11604 | 689233 | 319,747 |
https://tex.stackexchange.com/questions/689239 | 0 | The command `\newpage` does not begin a new page in `mcexam`. I need the `\begin{mcquestioninstruction}` to begin on the next page because it is orphaned from the questions that follow.
*Update:* `\newpage` *is now inserted **after** the `\begin{mcquestioninstruction}` line. This does put the instruction on the next page as desired.*
```
\documentclass[a4paper]{article}
\usepackage[output=exam
,numberofversions=2
,version=1
,seed=1
,randomizequestions=false
,randomizeanswers=true
,writeRfile=true
]{mcexam}
\usepackage{tikz,framed}
\usepackage{fancyhdr,lastpage}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\usepackage{chemformula}
\usepackage{chemmacros}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{array}
\graphicspath{ {./images/} }
\hyphenpenalty=2000
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{1pt}
\lfoot{\mctheversion}
\rfoot{Page \thepage\ of \pageref{LastPage}}
\usepackage{calc}
\renewenvironment{setmcquestion}{\begin{minipage}[t]{\linewidth-\labelwidth}}{\end{minipage}\par}
\begin{document}
\mcifoutput{concept,exam}
\section*{}
\begin{mcquestions}
\question Question 1
\begin{mcanswerslist}[fixlast]
\answer [correct] answer 1
\answer answer 2
\answer answer 3
\answer answer 4
\end{mcanswerslist}
\begin{mcquestioninstruction}
\newpage
My instructions that must be at the top of the next page:
\end{mcquestioninstruction}
\question Question 2
\begin{mcanswerslist}%[fixlast]
\answer answer 1
\answer answer 2
\answer answer 3
\answer answer 4
\end{mcanswerslist}
\end{mcquestions}
\end{document}
```
| https://tex.stackexchange.com/users/260299 | \newpage command not starting a new page in mcexam | false | you are inserting a `minipage` the only function of which is to prevent page breaking.
Comment out this line
```
%\renewenvironment{setmcquestion}{\begin{minipage}[t]{\linewidth-\labelwidth}}{\end{minipage}\par}
```
| 2 | https://tex.stackexchange.com/users/1090 | 689241 | 319,751 |
https://tex.stackexchange.com/questions/689252 | 2 | **Preamble**
```
\usepackage{multicols}
\usepackage[shortlabels]{enumitem}
\begin{document}
\begin{multicols}{2}
\begin{enumerate}[(a)]
\item Item 1
\item Item 2
\item Item 3
\item Item 4
\item Item 5
\item Item 6
\end{enumerate}
\end{multicols}
\end{document}
```
With the multicols package, the above gives two columns, but the way it will structure it is like so...
(a) Item 1 (d) Item 4
(b) Item 2 (e) Item 5
(c) Item 3 (f) Item 6
So it goes downwards, and then across to the next column
**Question:** Is there a way to modify this (or use an entirely different package/structure), so that the list goes across and then down instead, like so...
(a) Item 1 (b) Item 2
(c) Item 3 (d) Item 4
(e) Item 5 (f) Item 6
P.S. I am quite new to Latex so I apologise if this is a bit confusing
| https://tex.stackexchange.com/users/299460 | How can I get multicols to list across instead of down? | false | You can use `tasks` package:
```
\documentclass{article}
\usepackage{tasks}
\settasks{label = (\alph*)}
\begin{document}
\begin{tasks}(2)
\task item 1
\task item 2
\task item 3
\task item 4
\task item 5
\task item 6
\end{tasks}
\end{document}
```
| 4 | https://tex.stackexchange.com/users/241621 | 689255 | 319,755 |
https://tex.stackexchange.com/questions/689248 | 2 | I recently updated my Ubuntu environment from 18.04 to 22.04 and I noticed that the default behavior of tex4ht (or htlatex) with respect to included graphics significantly changed.
Consider the basic example `ex.tex`
```
\documentclass{article}
\usepackage{graphicx}
\begin{document}
Lorem ipsum dolor sit amet, consectetur $2+3=5$:
\[a=b+c\]
\begin{centering}
\includegraphics[width=0.5\textwidth]{myimage.eps}
\end{centering}
\end{document}
```
Now the result of the basic conversion command:
`htlatex ex.tex "xhtml, charset=utf-8, pic-m, gif", "-cunihtf -utf8"`
is the creation of two gif files: `ex0x.gif, ex1x.gif` (corresponding to formulas) and one png file:`myimage.png` which is a converted graphics.
However, in Ubuntu 18.04 the result of the same command was completely different - it produced three gifs: `ex0x.gif, ex1x.gif, ex2x.gif` with the third gif corresponding to included graphics.
This change of default behavior leads to the following problems in my working environment:
1. There is no longer a common pattern for the names, and event types (gif+png) of graphics generated by htlatex. This complicates the further post-processing of the generated files.
2. In the old behavior, the image generated form the included graphics has the correct pixel dimension (at least the width). That is the width produced by tex4ht in the `<img>` tag was the same as the pixel width of the generated file. In the current behavior this is not the case, as the png is generated with fixed density relative to the bounding box. In my case it sometimes is too small, and sometimes is too large.
So I have the following question: **is it possible to mimic the old behavior of htlatex, that is to force it to convert the included eps graphics in the same way as other pictures generated by math formulas?**
---
Some more info:
* I used to generate gif's, but it is ok for me to switch to png's, so the `gif` option is not important.
* I do see how `tex4ht` generates png files from eps graphics - its the following fragment in the source code (`tex4ht-html4.tex`)
```
\Configure{graphics*}
{eps}
{\openin15=\csname Gin@base\endcsname\PictExt\relax%
\ifeof15%
\Needs{\a:EpsConvert}%
\fi%
\closein15%
{\Configure{Needs}{File: \Gin@base\PictExt}\Needs{}}%
\Picture[\a:GraphicsAlt]{{\Gin@base\PictExt} |<graphics dim|>}}
|<graphics default extensions|>
....
\Configure{EpsConvert}{"\a:Ghostscript\space -dSAFER -dBATCH -dNOPAUSE -dEPSCrop -r\gr:density\space -sDEVICE=pngalpha -sOutputFile="\Gin@base.png" "\Gin@base.eps" "}
```
but I somehow can not find the old source code for this conversion (with old behavior).
* I am not completely sure if this is really a problem with tex4ht or with latex itself (or some of its packages, graphicx?)
* I can manage the problem with the lack of the common pattern for the generated png files, but the problem with wrong pixel dimensions (widths) of the generated files is really annoying.
| https://tex.stackexchange.com/users/299448 | tex4ht converts included eps graphics to png with wrong dimensions | true | This change happened four years ago. The images included by `\includegraphics` keep their names in general. As EPS files are not supported on the web, they are converted to PNG or SVG. This conversion happens only once thanks to this condition. It executes the conversion command only when the destination image doesn't exist. This can significantly speed up the conversion process:
```
\Configure{graphics*}
{eps}
{\openin15=\csname Gin@base\endcsname\PictExt\relax%
\ifeof15%
\Needs{\a:EpsConvert}%
\fi%
\closein15%
```
Regarding image sizes, we get the image dimensions passed from the `\includegraphics` command, so when you use `width=0.5\textwidth`, this width is used. There are several ways how to change that, see this [how-to](https://www.kodymirus.cz/tex4ht-doc/Howto.html#change-image-size-and-resolution).
If you really want to have EPS images converted to files named after the TeX file, you can use the following configuration file:
```
\Preamble{xhtml}
\makeatletter
\catcode`\:=11
\Configure{graphics*}
{eps}
{%
\gif:nm{}%
\Needs{"\a:Ghostscript\space -dSAFER -dBATCH -dNOPAUSE -dEPSCrop -r\gr:density\space -sDEVICE=pngalpha -sOutputFile="\PictureFile" "\Gin@base.eps" "}
{\Configure{Needs}{File: \PictureFile}\Needs{}}%
\Picture[\a:GraphicsAlt]{{\PictureFile} \csname a:Gin-dim\endcsname}}
\Configure{Gin-dim}{}
\Css{img {
max-width: 100\%;
height: auto;
}}
\catcode`\:=12
\makeatother
\begin{document}
\EndPreamble
```
The `\gif:nm` declares a new image name, which is then saved in the `\PictureFile` command. We can use this command in the conversion command and in declaration of the image.
We also removed image dimensions, but we need to declare maximal width of the image using CSS, otherwise the image could overflow the page.
This is the result:
```
<!-- l. 5 --><p class='noindent'>Lorem ipsum dolor sit amet, consectetur <img alt='2+ 3 = 5 ' class='math' src='sample0x.gif' />:
</p>
<div class='math-display'>
<img alt='a = b + c
' class='math-display' src='sample1x.gif' /></div>
<!-- l. 6 --><p class='nopar'> <img alt='PIC' src='sample2x.gif' />
</p>
```
| 1 | https://tex.stackexchange.com/users/2891 | 689266 | 319,759 |
https://tex.stackexchange.com/questions/689250 | 3 | I am currently creating a new LaTeX class for my university. It has commands like \printTitle for rendering the title page that the writers call from their own .tex document.
However, there are a number of internal methods within the class like \def\renderTitlePage{} that I would like to be private so they cannot be called directly by the authors. Does anyone know how to make a class method private? At present, I can see the command \renderTitlePage in texStudio and Overleaf while I am editing a chapter.
| https://tex.stackexchange.com/users/299450 | Creating a private command within a LaTeX class | true | The usual LaTeX2e convention is to use names with `@` so they can not be called from normal document markup, and use a common unique prefix so you dont clash with other packages `\Dowdeswell@renderTitlePage` , `\Dowdeswell@abc`.
If using L3 code it is similar but using `_` and a more formalised module system
`\dowdeswell_render_title_page:` with an optional possibility of registering the module prefixes so no one else uses the same prefix
<https://github.com/latex3/latex3/blob/main/l3kernel/doc/l3prefixes.csv>
| 8 | https://tex.stackexchange.com/users/1090 | 689267 | 319,760 |
https://tex.stackexchange.com/questions/688837 | 2 | I'd like to use `\citeauthor` as a way of mentioning the author when the work *per se* is not being referenced, while automatically indexing each time it's mentioned. I've experimented redefining it with `\DeclareCiteCommand` and didn't get the wanted result.
```
\documentclass{article}
\usepackage[style=verbose]{biblatex}
\ExecuteBibliographyOptions{
hyperref = true,
indexing = cite,
autocite = footnote
}
\begin{filecontents*}{test.bib}
@book{aristotle:physics,
author = {Aristotle},
title = {Physics},
publisher = {G. P. Putnam},
location = {New York},
date = 1929
}
}
\end{filecontents*}
\addbibresource{test.bib}
\usepackage{imakeidx}
\makeindex[title={Authors Index}, columns=2]
\usepackage[hidelinks]{hyperref}
\begin{document}
\noindent \citeauthor{aristotle:physics} [...]
\printbibliography
\printindex
\end{document}
```
| https://tex.stackexchange.com/users/297525 | How to make \citeauthor to not add entries to \printbibliography | true | Both answers presented were extremely useful to gain an understanding of how to work with this. Both answers have their strengths and weaknesses. For the project I'm working with, the `\AtNextCite` approach will alter the years appending them a letter, (1980a) and the `refsection` will kill *ibid.* abbreviations and slow performance, MWE:
```
\documentclass{article}
\usepackage[style=verbose-trad1]{biblatex}
\let\oldciteauthor\citeauthor
\renewcommand{\citeauthor}[1]{\begin{refsection}\oldciteauthor{#1}\end{refsection}}
\addbibresource{biblatex-examples.bib}
\ExecuteBibliographyOptions{
autocite = footnote,
abbreviate = true,
strict = false,
}
\begin{document}
Lorem \autocite[1]{worman} then \citeauthor{worman} ipsum \autocite[1]{worman}
\printbibliography
\end{document}
```
As a result, I settled with a solution where, authors of cited works can be added to the index automatically via `\citeauthor`, while authors that are in that same `.bib` file and are not explicitly cited will be manually controlled via a `\index{AuthorName}` command, providing good performance and producing the correct output:
```
\documentclass{article}
\usepackage[style=verbose-trad1]{biblatex}
\addbibresource{biblatex-examples.bib}
\ExecuteBibliographyOptions{
autocite = footnote,
abbreviate = true,
strict = false,
}
\usepackage{imakeidx}
\makeindex[title={Authors Index}, columns=2]
\usepackage[hidelinks]{hyperref}
\begin{document}
Lorem \autocite[1]{worman} then \citeauthor{worman} ipsum \autocite[1]{worman}.
Other author \index{Aristotle} Aristotle.
\printbibliography
\printindex
\end{document}
```
It requires a bit more discipline and housekeeping and keep the final output without unwanted changes.
| 0 | https://tex.stackexchange.com/users/297525 | 689269 | 319,762 |
https://tex.stackexchange.com/questions/313860 | 15 | Is there an arctan2 / atan2 function in LaTeX, which can print an aesthetic result like the other trigonometric functions `\sin` `\cos`... ?
| https://tex.stackexchange.com/users/101308 | How to have the arctan2 / atan2 function in LaTeX? | false | Another option is to use `\mathrm`. So:
```
$\mathrm{atan2}$
$\mathrm{arctan2}$
```
Which gives
| 0 | https://tex.stackexchange.com/users/175465 | 689273 | 319,764 |
https://tex.stackexchange.com/questions/682367 | 0 | **How do I customize date and time display for the compile date and time?** I see the `datetime2` package gives many predefined options, but what if I want to do something unique? The `datetime2` mentions the `\DTMnewstyle` command. But I can't understand how to use it.
**Examples:**
`10:15am | Mon Jan 02, 2023` % Time before date. Lower case "am" with no space. Separated by pipe. Three letter day. Three letter month. Two digit day. Four digit year.
`Jan/02/23` % Elements separated by "/". Three letter month, two digit day, two digit year. Not useful for anything except helping to know how to customize.
`10:15:00` , Monday, January 02, 2023 % Time with seconds separated by colons. No "am", "pm" distinctions. Comma separator. Full day of week. Full Month. Two digit day. Comma. Four digit year.
`01#02#2023` % Two digit day. Two digit month. Four digit year. "#" delimiter.
`23%01%02` & Two digit year. Two digit month. Two digit day. "%" delimiter. This adds the complexity of using the "%" character.
My actual use case is for a unique time stamp in the header of my draft documents. But I want to customize how it looks. Understanding how to customize, will also allow me and others more flexibility. The combined examples are an attempt at the date/time equivalent of *The quick brown fox jumps over the lazy dog* which I hope the community finds useful.
| https://tex.stackexchange.com/users/90601 | How to customize display of date and time of compiling | false | You've not shown, what you problem using `\DTMnewstyle` is. So here are two examples to explain, how `\DTMnewdatestyle` is used:
```
\documentclass{article}
\usepackage[yearmonthsep=\%,monthdaysep=\%]{datetime2}
\DTMnewdatestyle{Twodigits}{%
\renewcommand*{\DTMdisplaydate}[4]{%
\DTMtwodigits{##1}% use exact (last) two digits of the year
\DTMsep{yearmonth}% add the yearmonth separator given by package option yearmonthsep
\DTMtwodigits{##2}\DTMsep{monthday}% similar for month
\DTMtwodigits{##3}% similar for day
}%
}
\DTMnewdatestyle{TwodayTwomonthFouryear}{%
\renewcommand*{\DTMdisplaydate}[4]{%
\DTMtwodigits{##3}\DTMsep{monthday}% start with day
\DTMtwodigits{##2}\DTMsep{yearmonth}% similar for month
\number ##1\relax% year should always be with four digits so use it as is
}%
}
\DTMsetdatestyle{Twodigits}%
\begin{document}
\DTMtoday
\DTMsetdatestyle{TwodayTwomonthFouryear}
\setkeys{datetime2.sty}{yearmonthsep=\#,monthdaysep=\#}
\DTMtoday
\end{document}
```
If you want to use `\DTMnewstyle` instead, you not only have to redefine `\DTMdisplaydate` (in second argument), but also `\DTMdisplaytime` (in third argument), `\DTMdisplayzone` (in fourth argument), and `\DTMdisplay` (in fifth argument). The arguments all of these commands are explained in section 3 of the manual.
A command to show the current time would be, e.g., `\DTMcurrenttime`. A command to show everything would be, e.g., `\DTMnow`. These are also documented in section 3 of the manual.
For more examples see the manual. You can find the definition of all styles in the “Code” section of the manual. For the name of the day or month also `datetime2-calc` could be useful.
| 0 | https://tex.stackexchange.com/users/277964 | 689274 | 319,765 |
https://tex.stackexchange.com/questions/689165 | 2 | I hope you're having a good day. I am using LaTex (TeXstudio with MiKTeX to be precise) and want to have two distinct pages, one with acronyms and the other one with glossary entries. I have tried a lot of things but no matter what I do, I can't seem to make the acronyms appear at all in my document.
Here's what I did :
I have a main.tex, one file called acronyms.tex, a file called glossary.tex, and one called doc\_config.tex.
In glossary.tex, I wrote one entry :
```
\newglossaryentry{test}
{%
name={TEST},
description={This is a test description},
}
```
In acronyms.tex, I have one entry too :
```
\newacronym{ex}{EX}{Example}
```
In my doc\_config.tex, I wrote everything to configure the glossary and more (include packages, etc)
```
\usepackage[acronym]{glossaries}
\makeglossaries
```
Finally, in my main.tex, there are the glossary entries called in the text, the input for the pages and printglossaries :
```
\documentclass[ a4paper,
final,
12pt,
%twosides %For printing
oneside
]{report}
\input{auxfiles/doc_config}
\begin{document}
\input{auxfiles/acronyms}
\input{auxfiles/glossary}
\newpage
This is an example using acronyms (\gls{ex}) and glossary entries such as \gls{test}.
\newpage
\printglossaries
\end{document}
```
I also tried replacing `\printglossaries` by
```
\printglossary[type=\acronymtype]
\printglossary
```
It doesn't print the acronyms and glossary, only glossary is displayed.
Could you please help me ?
Edit : I get this in my log file regarding the glossaries package.
```
Package: glossary-tree 2022/11/03 v4.52 (NLCT)
\glstreeindent=\skip65
))
\glswrite=\write3
\glo@main@file=\write4
\openout4 = `main.glo'.
Package glossaries Info: Writing glossary file main.glo on input line 85.
\glo@acronym@file=\write5
\openout5 = `main.acn'.
Package glossaries Info: Writing glossary file main.acn on input line 85.
(main.glsdefs) (auxfiles/acronyms.tex
\@gls@deffile=\write6
\openout6 = `main.glsdefs'.
) (auxfiles/glossary.tex) [1
\openout3 = `main.ist'.
{'MyPath'/MiKTeX/fonts/map/pdftex/pdftex.map}] (main.gls) (
main.acr.tex)
[2
] (main.aux)
('MyPath'\MiKTeX\tex/latex/glossaries/styles\gloss
ary-hypernav.sty
Package: glossary-hypernav 2022/11/03 v4.52 (NLCT)
)
('MyPath'\MiKTeX\tex/latex/glossaries/styles\gloss
ary-list.sty
Package: glossary-list 2022/11/03 v4.52 (NLCT)
\glslistdottedwidth=\skip55
)
('MyPath'\MiKTeX\tex/latex/glossaries/styles\gloss
ary-long.sty
Package: glossary-long 2022/11/03 v4.52 (NLCT)
```
I do run the makeglossaries command.
The .alg file says :
```
This is makeindex, version 2.16 [MiKTeX 23.5].
Scanning style file ./main.ist...........................done (27 attributes redefined, 0 ignored).
Scanning input file main.acn....done (1 entries accepted, 0 rejected).
Sorting entries...done (0 comparisons).
Generating output file main.acr....done (6 lines written, 0 warnings).
Output written in main.acr.
Transcript written in main.alg.
```
This is the return of `\listfiles` in the log
```
*File List*
report.cls 2023/05/17 v1.4n Standard LaTeX document class
size12.clo 2023/05/17 v1.4n Standard LaTeX file (size option)
auxfiles/doc_config.tex
babel.sty 2023/05/11 v3.89 The Babel package
bblopts.cfg 2005/09/08 v0.1 add Arabic and Farsi to "declared" options of b
abel
french.ldf 2023/03/08 v3.5q French support from the babel system
babel-french.tex
scalefnt.sty
keyval.sty 2022/05/29 v1.15 key=value parser (DPC)
fontenc.sty 2021/04/29 v2.0v Standard LaTeX package
geometry.sty 2020/01/02 v5.9 Page Geometry
ifvtex.sty 2019/10/25 v1.7 ifvtex legacy package. Use iftex instead.
iftex.sty 2022/02/03 v1.0f TeX engine tests
geometry.cfg
csquotes.sty 2022-09-14 v5.2n context-sensitive quotations (JAW)
etoolbox.sty 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
csquotes.def 2022-09-14 v5.2n csquotes generic definitions (JAW)
csquotes.cfg
glossaries.sty 2022/11/03 v4.52 (NLCT)
ifthen.sty 2022/04/13 v1.1d Standard LaTeX ifthen package (DPC)
xkeyval.sty 2022/06/16 v2.9 package option processing (HA)
xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
mfirstuc.sty 2022/10/14 v2.08 (NLCT)
xfor.sty 2009/02/05 v1.05 (NLCT)
datatool-base.sty 2019/09/27 v2.32 (NLCT)
amsmath.sty 2023/05/13 v2.17o AMS math features
amstext.sty 2021/08/26 v2.01 AMS text
amsgen.sty 1999/11/30 v2.0 generic functions
amsbsy.sty 1999/11/29 v1.2d Bold Symbols
amsopn.sty 2022/04/08 v2.04 operator names
substr.sty 2009/10/20 v1.2 Handle substrings
datatool-fp.sty 2019/09/27 v2.32 (NLCT)
fp.sty 1995/04/02
defpattern.sty 1994/10/12
fp-basic.sty 1996/05/13
fp-addons.sty 1995/03/15
fp-snap.sty 1995/04/05
fp-exp.sty 1995/04/03
fp-trigo.sty 1995/04/14
fp-pas.sty 1994/08/29
fp-random.sty 1995/02/23
fp-eqn.sty 1995/04/03
fp-upn.sty 1996/10/21
fp-eval.sty 1995/04/03
tracklang.sty 2022/12/13 v1.6.1 (NLCT) Track Languages
tracklang.tex 2022/12/13 v1.6.1 (NLCT) Track Languages Generic Code
translator.sty 2021-05-31 v1.12d Easy translation of strings in LaTeX
glossaries-french.ldf 2016/12/12 v1.1
glossary-hypernav.sty 2022/11/03 v4.52 (NLCT)
glossary-list.sty 2022/11/03 v4.52 (NLCT)
glossary-long.sty 2022/11/03 v4.52 (NLCT)
longtable.sty 2021-09-01 v4.17 Multi-page Table package (DPC)
glossary-super.sty 2022/11/03 v4.52 (NLCT)
supertabular.sty 2020/02/02 v4.1g the supertabular environment
glossary-tree.sty 2022/11/03 v4.52 (NLCT)
l3backend-pdftex.def 2023-04-19 L3 backend support: PDF output (pdfTeX)
main.glsdefs
auxfiles/acronyms.tex
auxfiles/glossary.tex
main.acr
***********
```
| https://tex.stackexchange.com/users/299414 | How should I print acronyms and glossary entries in Latex? | true | The line
```
{'MyPath'/MiKTeX/fonts/map/pdftex/pdftex.map}] (main.gls) (
main.acr.tex)
```
in the log suggests that you have somehow ended up with a `main.acr.tex` file, which (for reasons I'm not sure of) is being read instead of the `main.acr` file generated by `makeglossaries`.
Delete the `main.acr.tex` and, as everything else looks correct, the `main.acr` will be sourced as `glossaries` expects.
| 1 | https://tex.stackexchange.com/users/106162 | 689275 | 319,766 |
https://tex.stackexchange.com/questions/689272 | 5 | I'm trying to define a command in latex that gives me a flipped integral symbol as I haven't been able to find it in any existing package.
So far this is my attempt:
```
\newcommand{\cocoendtni}{\operatorname{\vphantom{\sum}\mathchoice
{\reflectbox{$\displaystyle \int$}}
{\reflectbox{$\int$}}
{\reflectbox{$\scriptstyle \int$}}
{\reflectbox{$\scriptscriptstyle \int$}}}}
```
This has the problem that superscripts are not aligned to the integral sign itself, but its rightmost part.
The usual integral sign does not have this problem with subscripts.
How can I align the superscripts horizontally? If this symbol already exists somewhere or you see other issues with my definition I'd be glad to hear about them of course!
| https://tex.stackexchange.com/users/171282 | Superscript horizontal alignment on flipped integral symbol | true | Is this what you want?
```
\documentclass{article}
\usepackage{amsmath,graphicx}
\makeatletter
\NewDocumentCommand{\cocoendtni}{e{_^}}{%
\mathop{\mathpalette\cocoendtni@{{#1}{#2}}}%
}
\NewDocumentCommand{\cocoendtni@}{mm}{%
\cocoendtni@@#1#2%
}
\NewDocumentCommand{\cocoendtni@@}{mmm}{%
\begingroup
\sbox\z@{$\m@th#1\int$}%
\reflectbox{\usebox\z@}%
\IfValueT{#2}{% subscript
_{#2}%
}%
\IfValueT{#3}{% superscript
^{\kern-\ifx#1\displaystyle0.5\else0.4\fi\wd\z@#3}%
}%
\endgroup
}
\makeatother
\begin{document}
\[
\cocoendtni_a^b
\]
\begin{center}
$\cocoendtni_a^b$\\
$\scriptstyle\cocoendtni_a^b$\\
$\scriptscriptstyle\cocoendtni_a^b$
\end{center}
\end{document}
```
The superscript is added with some amount of backspacing, so it goes nearer the integral sign.
| 5 | https://tex.stackexchange.com/users/4427 | 689279 | 319,769 |
https://tex.stackexchange.com/questions/689284 | 1 |
```
\documentclass{exam}
\usepackage{graphicx} % Required for inserting images
\usepackage{tikz}
\begin{document}
\begin{questions}
\begin{tabular}{ c c }
\includegraphics{Questions/car.png}[scale=\factor , scale= 0.2] &
\includegraphics{Questions/car.png}[scale=\factor , scale= 0.2] \\
\includegraphics{Questions/car.png}[scale=\factor , scale= 0.2] &
\includegraphics{Questions/car.png}[scale=\factor , scale= 0.2] \\
\includegraphics{Questions/car.png}[scale=\factor , scale= 0.2] & \\
\end{tabular}
(Monday)
\end{questions}
\end{document}
```
I know could resize the image itself but I don't understand why scaling is not working, any help? Sorry I know the image will not work for people as is on my comp but the general code is there for people to advise if it's enough.
| https://tex.stackexchange.com/users/267103 | rescaling a png | false | Rather than using the `scale=...` option to set the images' widths, I'd use the `width=...` option. E.g., along the lines of
```
\documentclass{exam}
\usepackage[demo]{graphicx} % remove 'demo' option in real document
\usepackage{tabularx} % for 'tabularx' environment and 'X' column type
\begin{document}
\noindent
\begin{tabularx}{\linewidth}{@{} XX @{}}
\includegraphics[width=\hsize]{Questions/car.png} &
\includegraphics[width=\hsize]{Questions/car.png} \\[3ex] % extra vertical whitespace
\includegraphics[width=\hsize]{Questions/car.png} &
\includegraphics[width=\hsize]{Questions/car.png} \\[3ex] % extra vertical whitespace
\includegraphics[width=\hsize]{Questions/car.png} &
\end{tabularx}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/5001 | 689292 | 319,771 |
https://tex.stackexchange.com/questions/596825 | 3 | I'd like to draw a Youngtableau with entries given by a formula. The formula is not super long, but in order to fit it, I have to increase the boxsize to 6em. Then it is quite tall and has lots of unnecessary space above and below it.
Is there a way to change the height of a box without changing the width? I see `\vrule@normal@YT` in the [documentation](https://ctan.math.washington.edu/tex-archive/macros/latex/contrib/ytableau/ytableau.pdf), but I'm not sure how to use it. I have heard that one should not use variables which include an `@` in the name. But even if I should use that command, I'm not sure how to use it.
Does anyone have any suggestions?
Here is my code:
```
\documentclass{article}
\usepackage{ytableau}
\begin{document}
\ytableausetup{boxsize=6em}
\begin{ytableau}
\none & \none & \none & 1 \\
\none & \none & \none & 2 \\
\none & \none & \none & \vdots \\
\none & \none & \none & d-2i-1\\
d-2i & d-2i & \cdots & d-2i \\
d-2i+1 & d-2i+1 & \cdots & d-2i+i\\
d-2i+2 \\
\vdots\\
d-2i+m
\end{ytableau}
\end{document}
```
| https://tex.stackexchange.com/users/242007 | Wide and short ytableau | false | To provide another option, instead of the `ytableau` package, you could use `nicematrix`.
The option `hvlines` draws horizontal and vertical rules, but `corners` excludes the empty corners. `columns-width=auto` sets all column widths to the widest column. `cell-space-limits=-5pt` reduces the vertical padding for each cell. `\renewcommand{\arraystretch}{1.2}` is large enough for all rows to have the same height.
```
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\[
\renewcommand{\arraystretch}{1.2}
\begin{NiceArray}{cccc}[hvlines, corners, columns-width=auto, cell-space-limits=-5pt]
&&&1\\
&&&2\\
&&&\vdots\\
&&&d-2i-1\\
d-2i & d-2i & \cdots & d-2i\\
d-2i+1 & d-2i+1 & \cdots & d-2i+i\\
d-2i+2\\
\vdots\\
d-2i+m
\end{NiceArray}
\]
\end{document}
```
| 2 | https://tex.stackexchange.com/users/125871 | 689293 | 319,772 |
https://tex.stackexchange.com/questions/689290 | 1 | Using overleaf, I tried to output the following sentence in a pdf form: `...$c$, then the cost of adding $v$ jobs is $vc$, here $c$ and $v$ are parameters.`
while compiling the code, there are two errors
```
\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[letterpaper,top=2cm,bottom=2cm,left=3cm,right=3cm,
marginparwidth=1.75cm]{geometry}
\usepackage[margin=1in]{geometry}
% here pops up the 1st error: "LaTeX Error: Option clash for package geometry"
\usepackage{setspace}
\doublespace
...
\subsubsection{Firms}
...
$c$, then the cost of adding $v$ jobs is $νc$.
% here the 2nd error: "LaTeX Error: Unicode character ν (U+03BD)".
```
The output result only shows "... *c*, then the cost of adding *v* jobs is *c*." The last formula is supposed to be *vc* rather than *c* with the parameter *v* missing.
Any help?
Thanks in advance.
| https://tex.stackexchange.com/users/299496 | Latex error: Unicode character ν (U+03BD) | false | Using the suggestions of Mico in the comments, there are no more errors.
1. remove `\usepackage[margin=1in]{geometry}`
2. replace ν (Greek letter "nu") with v (Latin letter "vee")
If you still get errors, you should make a MWE.
### Code
```
\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[letterpaper,top=2cm,bottom=2cm,left=3cm,right=3cm,
marginparwidth=1.75cm]{geometry}
\usepackage{setspace}
\doublespace
\begin{document}
\subsubsection{Firms}
...
$c$, then the cost of adding $v$ jobs is $vc$.
\end{document}
```
| 1 | https://tex.stackexchange.com/users/123129 | 689295 | 319,773 |
https://tex.stackexchange.com/questions/689312 | -1 | I have a GitHub link and I want to use it as a reference. How can I put it in a `.bib` file and then cite it? I am using `bibtex`.
An example GitHub link I want to reference: <https://github.com/LLNL/zfp>
| https://tex.stackexchange.com/users/271106 | How to add GitHub link in bib file | false | Not sure if you are using `biblatex` or `bibtex` so will post this anyway. Here is a solution using `biblatex` that I use in my reports:
I use the `@Online` bib field and do not typically include the accessed date but it is always nice to have it just in case you do need it. The URL is hyperlinked from `hyperref`, the font of the URL has been made the same as the surrounding text by `xurl` and `\urlstyle{same}` and the leading `https://` etc has been stripped using a `\DeclareSourceMap`. If this isn't helpful to you then hopefully it helps someone in the future.
```
\begin{filecontents}[overwrite]{\jobname.bib}
@Online{duckgogit,
accessed = {2023-06-23},
author = {{DuckDuckGo}},
title = {DuckDuckGo Privacy Essentials browser extension for Firefox, Chrome},
url = {https://github.com/duckduckgo/duckduckgo-privacy-extension/},
}
\end{filecontents}
\documentclass{article}
\usepackage{lipsum} %for dummy text
% Properly formats the URLS and allows breaks, \urlstyle{same} makes the font
% the same as surrounding text
\usepackage{xurl}
\urlstyle{same}
\usepackage[backend=biber, style=numeric]{biblatex}
\usepackage[hidelinks]{hyperref}
\addbibresource{\jobname.bib}
% To get rid of https:// in urls
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=url, final=true]
\step[fieldset=verba, origfieldval, final=true]
\step[fieldsource=verba, match=\regexp{\A(ht|f)tp(s)?:\/\/}, replace={}]
}
}
}
% to modify the URL format and remove URL:
\DeclareFieldFormat{url}{%
\href{#1}{\nolinkurl{\thefield{verba}}}}
\begin{document}
\lipsum[1] \cite{duckgogit} \lipsum[1][1].
\printbibliography
\end{document}
```
| 0 | https://tex.stackexchange.com/users/273733 | 689315 | 319,781 |
https://tex.stackexchange.com/questions/13015 | 100 | Anyone who has read *The Lord of the Rings* will recognise the Elvish script at the top of this page (in the *Tengwar* alphabet). If this is meant to be an example of what is typesettable in TeX/related software, what package is used to produce it?
| https://tex.stackexchange.com/users/141 | What package allows Elvish in TeX? | false | Using XeLaTeX with a Unicode font is an approach that generalizes well to other non-Latin scripts. While *Tengwar* isn't officially a part of Unicode, the *de facto* standard is the CSUR encoding used by the [Free Tengwar Project](https://freetengwar.sourceforge.net/).
A font that uses this encoding and resembles the *One Ring* inscription script is [*Tengwar Artano*](https://github.com/shankarsivarajan/TengwarArtano). It's built (by me) using glyphs from *Tengwar Annatar Italic,* as used by the `tengwarscript` package.
EDIT: The statement "there are no Ring-like fonts yet" in one of the popular answers on this question motivated this: there is one now.
| 3 | https://tex.stackexchange.com/users/170418 | 689323 | 319,784 |
https://tex.stackexchange.com/questions/93891 | 10 | I'm trying to convert a table to png format using Imagemagick
```
\documentclass[12pt,a4paper,border=8pt,convert=true]{standalone}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{siunitx}
\sisetup{binary-units = true,
table-format=7.0}
\begin{document}
\minipage{1.08\textwidth}
\addtolength{\tabcolsep}{-1.0pt}
\begin{tabular}{lS[table-format=6.0]
S[table-format=6.0]
S[table-format=6.0]
SSS}
\toprule
Device & 2011 & 2012 & 2013 & 2014 & 2015 & 2016 \\
\midrule
Non-smarthphones & 22686 & 55813 & 108750 & 196262 & 357797 & 615679 \\
Smarthphones & 104759 & 365550 & 933373 & 1915173 & 3257030 & 5221497 \\
Laptops e Netbooks & 373831 & 612217 & 917486 & 1340062 & 1963950 & 2617770\\
Tablets & 17393 & 63181 & 141153 & 300519 & 554326 & 1083895\\
Home gateways & 55064 & 108073 & 180562 & 267545 & 376494 & 514777 \\
M2M & 23009 & 47144 & 92150 & 172719 & 302279 & 508022 \\
Altri devices & 525 & 1460 & 5429 & 22966 & 84204 & 242681\\
\bottomrule
\end{tabular}
\captionof*{table}{Traffico mobile globale al mese per dispositivo in \si{\tera\byte}}
\endminipage
\end{document}
```
Here it is the table create using `standalone` package. I read the documentation and it says to use ImageMagick. The problem is when I compile it doesn't find the exacutable `imgconvert.exe`. So I put this exacutable into folder where there is tex file. Now when I compile I got another error:
```
imgconvert.exe: `%s' (%d) "gswin32c.exe" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE
-dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2
"-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r300x300"
"-sOutputFile=C:/Users/MAZZAR~1/AppData/Local/Temp/magick-31681PKeFVHE065o"
"-fC:/Users/MAZZAR~1/AppData/Local/Temp/magick-3168A-Fab6j3iIUc"
"-fC:/Users/MAZZAR~1/AppData/Local/Temp/magick-3168QXzuvG_UAP07"
@ error/utility.c/SystemCommand/1890. imgconvert.exe: Postscript delegate failed
`table.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/678.
imgconvert.exe: no images defined `table.png' @ error/convert.c/ConvertImageCommand/3066.
```
| https://tex.stackexchange.com/users/13152 | Conversion problem using standalone and imagemagick | false | The following is a minimal example of how to compile a `.tex` file into a PNG file using TeX Live on Windows 10. First of all, save the following `tex` code in a file called `mini.tex`:
```
\documentclass[11pt, border=10pt]{standalone}
\begin{document}
Blah blah blah
\end{document}
```
`mini.tex` can be compiled into a PDF and then converted to a PNG image file with Tex Live on Windows 10 using the following `powershell` commands:
```
pdflatex mini.tex
$env:GS_LIB="C:/texlive/2022/tlpkg/tlgs/Resource/Init;C:/texlive/2022/tlpkg/tlgs/lib;C:/texlive/2022/tlpkg/tlgs/kanji"
C:/texlive/2022/tlpkg/tlgs/bin/gswin32c.exe -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 -sOutputFile="mini.png" mini.pdf
```
* The `$env:GS_LIB=...` command above only needs to be used once per terminal session, in order to set the `GS_LIB` environment variable, so that `gswin32c` knows where to find the files `gs_init.ps`, `cidfmap`, and `kfwin32.ps` respectively
* The path names in this command as well as the full path of `gswin32c.exe` may need to modified depending on the location of these files in a given installation of Tex Live
* Alternatively (IE instead of setting the `GS_LIB` environment variable) these paths can be included in the `gswin32c.exe` command (without needing to first set any environment variables) by specifying the `-I` flag individually before each path ([source](https://stackoverflow.com/a/12876349/8477566))
* The double quotes around `mini.png` appear to be necessary to prevent `gswin32c` returning the error `Error: /undefinedfilename in (.png)`
* Building `mini.tex` into `mini.pdf` and then converting this into `mini.png` with the commands shown above successfully produces the the following image:
| 0 | https://tex.stackexchange.com/users/266921 | 689328 | 319,786 |
https://tex.stackexchange.com/questions/689325 | 1 | I'm new to LaTEX and pgfplots and have been trying to draw a semi-circle but keep getting a weird parabola. How can I fix this?
```
\begin{tikzpicture}
\begin{axis}[
axis lines = center,
xlabel = \(x\),
ylabel = {\(f(x)\)},
]
%Below the red parabola is defined
\addplot [
domain=-10:10,
samples=100,
color=red,
]
{sqrt{9-x^2} };
\end{axis}
\end{tikzpicture}
```
| https://tex.stackexchange.com/users/299521 | I can't draw a semi-circle in pgfplots | false | Like this:
Code:
```
\documentclass[10pt,a4paper]{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[axis equal,
axis lines = center,
xlabel = \(x\),
ylabel = {\(f(x)\)},
xmin=-3.5,
xmax=3.5,
]
%Below the red semicircle is defined
\addplot [line width=2pt,
domain=-3:3,
samples=100,
color=red,
]
{sqrt(9-x^2) };
\end{axis}
\end{tikzpicture}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/24644 | 689331 | 319,787 |
https://tex.stackexchange.com/questions/689337 | 1 | The `MWE`:
```
% test.tex
\documentclass{format}
\begin{document}
\begin{frame}
My name is chichi.
\end{frame}
\end{document}
```
my `.cls` file:
```
% format.cls
\PassOptionsToClass{20pt,aspectratio = 1610}{ beamer }
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{format}[23/06/2023]
\LoadClass{beamer}
```
However, if I use `\PassOptionsToClass` directly in `.tex` file, it will be useful, like this:
```
\PassOptionsToClass{20pt,aspectratio = 1610}{beamer}
\documentclass{beamer}
\begin{document}
\begin{frame}
My name is chichi.
\end{frame}
\end{document}
```
Because I want to design a user interface that changes the beamer size and font size in beamer template, I use `\PassOptionsToClass` in the `.cls` file.
| https://tex.stackexchange.com/users/299532 | Can't use \PassOptionsToClass in beamer by cls document | false | Modify the `.cls` to:
```
% format.cls
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{format}
\PassOptionsToClass{20pt,aspectratio = 1610}{beamer}
\ProcessOptions\relax
\LoadClass{beamer}
```
| 2 | https://tex.stackexchange.com/users/241621 | 689339 | 319,790 |
https://tex.stackexchange.com/questions/689336 | 2 |
```
\documentclass{article}
\usepackage{tikz}
\usepackage{nicematrix}
\begin{document}
Some text
\begin{center}
\begin{NiceTabular}[width=10cm]{X[1,l]}[hlines,vlines]
\RowStyle[cell-space-top-limit=5pt, cell-space-bottom-limit=10pt]{}
Some text \\
\RowStyle[cell-space-top-limit=10pt, cell-space-bottom-limit=5pt]{}
Some text
\end{NiceTabular}
\end{center}
Some text
\begin{center}
\begin{NiceTabular}[width=10cm]{X[1,l]}[hlines,vlines]
\RowStyle[cell-space-top-limit=5pt, cell-space-bottom-limit=10pt]{}
Some text \\
\RowStyle[cell-space-top-limit=10pt, cell-space-bottom-limit=5pt]{}
Some text
\CodeAfter
\tikz \draw (1-|1) -- (2-|2);
\tikz \draw (2-|1) -- (3-|2);
\end{NiceTabular}
\end{center}
\end{document}
```
The two tables are not perfectly aligned.
How can I fix it ?
When I delete the tikz instructions, they are aligned.
| https://tex.stackexchange.com/users/297974 | Two NiceTabular are not vertically aligned | true | The horizontal shifting is caused by the newline character between two `\tikz \draw ...;` lines, which is converted to a space by TeX.
Either using a single `\tikz { \draw ...; \draw ...;}` or commenting out that newline does the work.
```
\documentclass{article}
\usepackage{tikz}
\usepackage{nicematrix}
\begin{document}
Some text
\begin{center}
\begin{NiceTabular}[width=10cm]{X[1,l]}[hlines,vlines]
\RowStyle[cell-space-top-limit=5pt, cell-space-bottom-limit=10pt]{}
\leavevmode\rlap{\color{blue}\smash{\rule[-.9\textheight]{.4pt}{\textheight}}}Some text \\
\RowStyle[cell-space-top-limit=10pt, cell-space-bottom-limit=5pt]{}
Some text
\end{NiceTabular}
\end{center}
Solution 1, single \verb|\tikz|
\begin{center}
\begin{NiceTabular}[width=10cm]{X[1,l]}[hlines,vlines]
\RowStyle[cell-space-top-limit=5pt, cell-space-bottom-limit=10pt]{}
Some text \\
\RowStyle[cell-space-top-limit=10pt, cell-space-bottom-limit=5pt]{}
Some text
\CodeAfter
\tikz{ \draw (1-|1) -- (2-|2);
\draw (2-|1) -- (3-|2); }
\end{NiceTabular}
\end{center}
Solution 2, comment out newline(s) in the middle
\begin{center}
\begin{NiceTabular}[width=10cm]{X[1,l]}[hlines,vlines]
\RowStyle[cell-space-top-limit=5pt, cell-space-bottom-limit=10pt]{}
Some text \\
\RowStyle[cell-space-top-limit=10pt, cell-space-bottom-limit=5pt]{}
Some text
\CodeAfter
\tikz \draw (1-|1) -- (2-|2);%
\tikz \draw (2-|1) -- (3-|2);
\end{NiceTabular}
\end{center}
Original, shifted output
\begin{center}
\begin{NiceTabular}[width=10cm]{X[1,l]}[hlines,vlines]
\RowStyle[cell-space-top-limit=5pt, cell-space-bottom-limit=10pt]{}
Some text \\
\RowStyle[cell-space-top-limit=10pt, cell-space-bottom-limit=5pt]{}
Some text
\CodeAfter
\tikz \draw (1-|1) -- (2-|2);
\tikz \draw (2-|1) -- (3-|2);
\end{NiceTabular}
\end{center}
\end{document}
```
| 5 | https://tex.stackexchange.com/users/79060 | 689340 | 319,791 |
https://tex.stackexchange.com/questions/689286 | 2 | I have a huge .bib file that contains all my references. Very few of them currently have a doi field. Given access to an online database that includes many of the same references, is capable of generating .bib entries, and includes dois, is there any more or less automatic way of using the database to add dois to as many of the references in the .bib file as possible? Note that the citation keys in my .bib file and those generated by the database are not identical, so matching would have to be done by e.g. title and author.
Answers using e.g. Jabref or Zotero are fine. It feels like one of those tools ought to be able to do this. I just don't know how.
| https://tex.stackexchange.com/users/142174 | Batch add dois to .bib file from online database? | false | In JabRef, you can use the Lookup functionality located in the "Lookup" menu:
Please mark all entires you want to lookup the DOI for. For sure, you can also mark all entries.
| 1 | https://tex.stackexchange.com/users/9075 | 689351 | 319,796 |
https://tex.stackexchange.com/questions/689322 | 0 | My MWE:
```
\documentclass[twoside]{book}%
\usepackage{graphicx}%
\usepackage{tikzducks}%
\usepackage{lipsum}%
\usepackage{color}%
\begin{document}
\color{red}
\begin{figure}
\includegraphics[width=\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
\let\endfigureold\endfigure%
\renewcommand\endfigure{\textbf{Trying to change color here}\global\color{green}\endfigureold}%
\begin{figure}
\includegraphics[width=\textwidth]{example-image-duck}
\caption{Another duck}
% \textbf{Trying to change color here}\global\color{green}%
\end{figure}
\lipsum
\end{document}
```
What I try to accomplish:
I have two figures on consecutive pages. I want the text to be red from the beginning till the second figure, after the second figure it should be green.
You can see two attempts of mine up to now: First I tried to write the command for changing the color inside the figure environment directly under the caption. On a second try, I patched the end of the figure environment. In both cases, the text remains completely red.
Further, I wrote `\textbf{Trying to change color here}` directly near my attempt to change the color. In both cases, this text appears just under the caption.
It seems, that I easily can transport "material" with a float. But it seems impossible to transport "information". The best, I could accomplish by further attempts with a non-minimum-file, e.g. by changing a flag, was that the change took place at the very point, where the figure appears in the source, i.e. the complete text became green, and no red remained.
It seems to me, that the complete code of the figure is evaluated at the very place in the source, where I write it, if "information" can escape the environment, it does it here, only the "material" becomes transported. Am I right?
And, in the moment more important to me, is there any chance to achieve, what I want -- that is not in the first line the color, only serving as an example here, but generally information, that starts to work at the very point of a figure, e.g. stepping up of a counter?
| https://tex.stackexchange.com/users/202047 | How to transport code, not material, with a float? | false | It is quite easy to change the color on the page where the float will appear. The only problem is that LaTeX reverts that again in the output routine by calling `\normalcolor`. If one disables that (not recommended!) you get a green page (but only one as you can't change the color stack).
```
\documentclass[twoside]{book}%
\usepackage{graphicx}%
\usepackage{lipsum,color}%
\begin{document}
\let\normalcolor\relax %avoid that it interferes
before
\begin{figure}
\includegraphics[width=\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
\begin{figure}
\includegraphics[width=\textwidth]{example-image-duck}
\caption{Another duck}
\pdfliteral {0 1 0 RG 0 1 0 rg}
\end{figure}
\lipsum
\end{document}
```
It is also possible to do other things on pages with floats. The following e.g rotates the page. With lualatex it makes use of `\latelua` and works in one compilation. pdflatex records the page to rotate in the aux-file and then rotates it on the next compilation (it could probably do it in one compilation too on a current system with the new shipout keyword, but I hadn't time yet to look).
```
\DocumentMetadata{}
\documentclass[twoside]{book}%
\usepackage{graphicx}%
\usepackage{lipsum,color}%
\begin{document}
before
\begin{figure}
\includegraphics[width=\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
\begin{figure}
\includegraphics[width=\textwidth]{example-image-duck}
\caption{Another duck}
\ExplSyntaxOn
\pdfmanagement_add:nnn{ThisPage}{Rotate}{90}
\ExplSyntaxOff
\end{figure}
\lipsum
\end{document}
```
You can also step a counter on the page of the float. But be aware that this is done in the shipout and so the counter is only reliable in the shipout too, e.g. in the footer or header. If you need it in other places uses label + ref.
```
\documentclass[twoside]{book}%
\usepackage{graphicx}%
\usepackage{lipsum,color,zref-abspage,zref-user}%
\newcounter{myfloat}
\makeatletter
\AddToHook{shipout/before}
{\ifnum \numexpr\ReadonlyShipoutCounter+2\relax =\zref@extractdefault{blub}{abspage}{-1}
\stepcounter{myfloat}\fi}
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{myfloat counter: \themyfloat}
\makeatother
\begin{document}
\lipsum
\begin{figure}
\includegraphics[width=\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
\begin{figure}
\includegraphics[width=\textwidth]{example-image-duck}
\caption{Another duck}
\zlabel{blub}
\end{figure}
\lipsum
\end{document}
```
| 2 | https://tex.stackexchange.com/users/2388 | 689354 | 319,798 |
https://tex.stackexchange.com/questions/665720 | 0 | I am trying to get a chapter number that is not an integer.
My current code looks like this:
```
\chapter*{Example\vspace{-75pt}\\\huge Chapter 0.5}\vspace{50pt}
\addcontentsline{toc}{chapter}{0.5 Example}
```
However, the code is very messy, and every section needs a similar change for it to stay consistent (Thankfully I don't have any sections in the chapter *but it is a problem*).
What I am looking for is a solution that solves the first (or both) problems noted above.
EDIT: For clarification, `0.5` is just an example. More examples:
```
\chapter*{Example\vspace{-75pt}\\\huge Chapter Q}\vspace{50pt}
\addcontentsline{toc}{chapter}{Q Example}
\chapter*{Example\vspace{-75pt}\\\huge Chapter Zero point five}\vspace{50pt}
\addcontentsline{toc}{chapter}{Zero point five Example}
\chapter*{Example\vspace{-75pt}\\\huge Chapter Chapter}\vspace{50pt}
\addcontentsline{toc}{chapter}{Chapter Example}
\chapter*{Example\vspace{-75pt}\\\huge Chapter $\frac12$}\vspace{50pt}
\addcontentsline{toc}{chapter}{$\mathbf{\frac12}$ Example}
```
| https://tex.stackexchange.com/users/284794 | Non-integer chapters | true | After realizing that @egreg's answer didn't work on my TeX editor I modified it to make this:
```
\documentclass[openany]{book}
\usepackage{amsmath} % for \text
\usepackage[a6paper]{geometry}
\newcommand{\customchapter}[2]{
\addtocounter{chapter}{-1}
\renewcommand{\thechapter}{#2}
\chapter{#1}
}
\newcommand{\achapter}[1]{ % used after chapter
\renewcommand{\thechapter}{\sthechapter}
\chapter{#1}
}
\AtBeginDocument{
\let\sthechapter\thechapter
%\let\schapter\chapter
%\newcommand{\chapter}[1]{
%\renewcommand{\thechapter}{\sthechapter}
%\schapter{#1}
%} % achapter is not needed
}
\begin{document}
\chapter{First}
\customchapter{Between}{$\mathbf{\frac32}$}
\section{Section Title}
\chapter{chapter} % chapter 3/2
\achapter{Second}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/284794 | 689361 | 319,803 |
https://tex.stackexchange.com/questions/689302 | 0 | I fount the latex template file sometimes define the fonts in sty file like this:
```
\setCJKmainfont[
BoldFont=AdobeHeitiStd-Regular.otf,
ItalicFont=AdobeKaitiStd-Regular.otf,
SmallCapsFont=AdobeHeitiStd-Regular.otf
]{AdobeSongStd-Light.otf}
```
sometimes define the main fonts like this:
```
\setCJKmainfont[
BoldFont=AdobeHeitiStd-Regular,
ItalicFont=AdobeKaitiStd-Regular,
SmallCapsFont=AdobeHeitiStd-Regular
]{AdobeSongStd-Light}
```
When should we put the font format abbr? Which one is preferred? Is there any more compatible way to define the main font?
| https://tex.stackexchange.com/users/69600 | When should I put the font abbr when set main font in latex | true | Choose whichever method is suitable.
Use `Path=` for non-installed fonts.
Use `Extension=.otf,` to save typing if all files are otf.
The asterisk (`*`) typing shortcut will be replaced by whatever is between the braces (`{}`).
On Windows, system fonts must be "Install for all users".
MWE
```
\documentclass{article}
\usepackage{xcolor}
\usepackage{fontspec}
\setmainfont[%
Path=C:/Users/.../.../fonts/x/, %masked
%Extension=.otf,
UprightFont=*,
BoldFont=FreeMonoBold.otf,
ItalicFont=Asavari.ttf,
BoldItalicFont=RobotoCondensed-BoldItalic.otf,
UprightFeatures={Scale=3,Color=brown},
BoldFeatures={Scale=2},
ItalicFeatures={Color=red},
BoldItalicFeatures={Scale=0.8},
]{bkai00m0.TTF}
\begin{document}
蟬
{\itshape italic text}
{\bfseries bold text}
{\bfseries\itshape bold italic text}
\end{document}
```
| 4 | https://tex.stackexchange.com/users/182648 | 689364 | 319,804 |
https://tex.stackexchange.com/questions/593491 | 1 | I am having a problem with footnotes. I know there are multiple packages that allow me to create an endnote, but what if I wanted a note, that is simultaneously a footnote and an endnote?
It would appear on the reference page and also at the end of the document.
I looked through the docs of pagenote and endnote and I cannot find anything like it.
| https://tex.stackexchange.com/users/240107 | Having a footnote simultaneously on the reference page and also at the end of the document | false | I am facing issues trying to replicated what you have done.
I have this at the beginning of my document :
```
\usepackage{endnotes}
\usepackage{pagenote}
\renewcommand*{\notedivision}{\chapter*{\notesname}}
\newcommand{\fn}[1]{\stepcounter{footnote}\footnotetext{#1}\endnote{#1}}
\let\footnote=\fn
\makepagenote
```
and where I want the notes to be at the end of the document as well i have written
```
\printnotes
```
But the notes are only visible at the end of the pages. Do you have any idea.
Thank you
| 0 | https://tex.stackexchange.com/users/299556 | 689370 | 319,806 |
https://tex.stackexchange.com/questions/689366 | 1 | I'd like to print the remainder of the Euclidean division by `4` of a latex counter. How do I do this?
| https://tex.stackexchange.com/users/107458 | Euclidean division of two counters | true | I take it that you are actually looking for calculating *a* mod *b*. There is probably a wide range of options how to solve this. Using Expl3 syntax, you could do:
```
\documentclass{article}
\ExplSyntaxOn
\NewDocumentCommand{\remainderofdiv}{ m m }{
\int_mod:nn { #1 } { #2 }
}
\ExplSyntaxOff
\begin{document}
\remainderofdiv{5}{2}
\remainderofdiv{12}{2}
\remainderofdiv{12}{5}
\end{document}
```
So, given that you have a counter that contains *x* and now you want to output *x* mod 4:
```
\documentclass{article}
\newcounter{mycounter}
\ExplSyntaxOn
\NewDocumentCommand{\mycountermodfour}{ }{
\int_mod:nn { \value{mycounter} } { 4 }
}
\ExplSyntaxOff
\begin{document}
\setcounter{mycounter}{7}
\mycountermodfour
\end{document}
```
| 4 | https://tex.stackexchange.com/users/47927 | 689372 | 319,807 |
https://tex.stackexchange.com/questions/689371 | 3 | I am trying to have a nested enumerate item ending with a special character; in my case ")" character. According to some answers, people were suggesting making something like:
```
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[shortlabels]{enumitem}
\begin{document}
\begin{enumerate}[label=\arabic*)]
\item first item
\begin{enumerate}[label*=.\alph*)]
\item sub item
\item another sub item
\end{enumerate}
\item another item
\item one more item
\end{enumerate}
\end{document}
```
However, what I get by using this instruction is
```
1) first item
1).a) sub item
1).b) another sub item
2) another item
3) one more item
```
but what I want is
```
1) first item
1.a) sub item
1.b) another sub item
2) another item
3) one more item
```
How can I accomplish this type of numbered list?
| https://tex.stackexchange.com/users/195628 | Nested enumerate list ending with a character | true | inputenc is no longer needed. utf8 is the default since more than four years.
```
\documentclass[10pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[shortlabels]{enumitem}
\begin{document}
\begin{enumerate}[label=\arabic*)]
\item first item
\begin{enumerate}[label=\arabic{enumi}.\alph*)]
\item sub item
\item another sub item
\end{enumerate}
\item another item
\item one more item
\end{enumerate}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/2388 | 689374 | 319,809 |
https://tex.stackexchange.com/questions/689380 | 1 | I would like to have frames structured as follows:
-- sections titles --
-- frame number fraction (at right-most end) ON a progress bar --
-- frame title --
-- frame content --
With metropolis, exploiting older questions on StackExchange, I got here:
```
\documentclass[lualatex]{beamer}
\usetheme[progressbar=head]{metropolis}
\metroset{numbering=fraction}
\makeatletter
\setlength{\metropolis@progressinheadfoot@linewidth}{1em}
\setbeamertemplate{headline}{%
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}{section in head/foot}
\vskip2pt\insertnavigation{\paperwidth}\vskip2pt
\end{beamercolorbox}%
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
\end{beamercolorbox}
}
\def\beamer@writeslidentry{\clearpage\beamer@notesactions}
\makeatother
\setbeamercolor{section in head/foot}{fg=black, bg=white}
\begin{document}
\section{section title}
\begin{frame}{frame title}
first line
second line
\end{frame}
\end{document}
```
This code manages to place sections and progress bar on top, with the latter element being covered by the former one, and use frame number fraction.
| https://tex.stackexchange.com/users/82143 | frame number on progress bar between section titles and frame title - metropolis beamer | true | The metropolis theme uses the headline template to show the progress bar. If you use `\setbeamertemplate{headline}{...}` you are not covering the progress bar up, you are removing it completely. You can instead use `\addtobeamertemplate{headline}{<before>}{<after>}` to add things to the headline without actively removing the progress bar which is already there:
```
\documentclass{beamer}
\usetheme[progressbar=head]{metropolis}
\setbeamertemplate{page number in head/foot}[totalframenumber]
\usepackage{tikz}
\makeatletter
\setlength{\metropolis@progressinheadfoot@linewidth}{1em}
\addtobeamertemplate{headline}{%
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}{section in head/foot}
\vskip2pt\insertnavigation{\paperwidth}\vskip2pt
\end{beamercolorbox}%
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
\end{beamercolorbox}
\par
}{}
\setbeamertemplate{footline}{
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north east] at ([yshift=-5.5ex]current page.north east) {\usebeamercolor[fg]{page number in head/foot}\usebeamertemplate{page number in head/foot}};
\end{tikzpicture}
}
\def\beamer@writeslidentry{\clearpage\beamer@notesactions}
\makeatother
\setbeamercolor{section in head/foot}{fg=black, bg=white}
\setbeamercolor{page number in head/foot}{fg=mLightBrown}
\begin{document}
\section{section title}
\begin{frame}
\frametitle{frame title}
first line
second line
\end{frame}
\begin{frame}
\frametitle{frame title}
first line
second line
\end{frame}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/36296 | 689381 | 319,811 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.