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/681271 | 1 | How can I make a right "hanging" from last line of a paragraph?
This is useful for tables of content and indexes with long entries.
The following is an example of what I need:
```
Lorem ipsum dolor sit amet ........................... 123
Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Ut purus elit, vestibulum ut, placerat ac
adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer
id, vulputate a, magna. .............................. 456
Lorem ipsum dolor sit amet ........................... 789
```
At the moment I'm using the following. But it justifies the text and the numbers at the same right position:
`\par\noindent\raggedright very long text \dotfill 456`
| https://tex.stackexchange.com/users/255699 | How can I make a right "hanging" from last line of a paragraph? | true | Here's a way, your task is to adapt it for TOC entries.
```
\documentclass{article}
\usepackage{showframe}
\newcommand{\specialpar}[2]{%
\par
\addvspace{1ex}
\begingroup
\hangafter=0
\hangindent=-6em
\parfillskip=-6em
\noindent#1\dotfill#2\par
\endgroup
\addvspace{1ex}
}
\begin{document}
\specialpar{Lorem ipsum dolor sit amet}{123}
\specialpar{Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Ut purus elit, vestibulum ut, placerat ac
adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer
id, vulputate a, magna.}{456}
\specialpar{Lorem ipsum dolor sit amet}{789}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/4427 | 681274 | 316,095 |
https://tex.stackexchange.com/questions/681272 | 1 | I want to remove only one section circle in the toc of beamer. But I don't know how to do it. Here is a MWE.
```
\documentclass[14pt,c]{beamer}
\setbeamertemplate{sections/subsections in toc}[circle]
\begin{document}
\frame[plain,c,noframenumbering]{
\tableofcontents[hideallsubsections]}
\section{section 1}
\frame{ frame 1}
\section{section 2}
\frame{ frame 2}
\section{lastsection} %which I want to remove its prefix circle or number in toc.
\frame{frame 3}
\end{document}
```
| https://tex.stackexchange.com/users/62888 | Remove certain circles in toc of beamer | true | Removing just the number is easy: you can specify the last numbered section in the toc with `lastsection=2`
Removing the circle as well is a bit trickier, but you can redefine the `section in toc` template like this:
```
\documentclass[14pt,c]{beamer}
\makeatletter
\setbeamertemplate{section in toc}
{\leavevmode\leftskip=2ex%
\llap{%
\ifnum\beamer@tempcount>\beamer@toclastsection
\else
\usebeamerfont*{section number projected}%
\usebeamercolor{section number projected}%
\begin{pgfpicture}{-1ex}{0ex}{1ex}{2ex}
\color{bg}
\pgfpathcircle{\pgfpoint{0pt}{.75ex}}{1.2ex}
\pgfusepath{fill}
\pgftext[base]{\color{fg}\inserttocsectionnumber}
\end{pgfpicture}\kern1.25ex%
\fi
}%
\inserttocsection\par}
\makeatother
\begin{document}
\frame[plain,c,noframenumbering]{
\tableofcontents[hideallsubsections,lastsection=2]}
\section{section 1}
\frame{ frame 1}
\section{section 2}
\frame{ frame 2}
\section{lastsection} %which I want to remove its prefix circle or number in toc.
\frame{frame 3}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/36296 | 681276 | 316,096 |
https://tex.stackexchange.com/questions/681267 | 1 | I am trying to format a table using `siunitx` and LaTeX. Here is a MWE that resembles my data:
```
\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{graphicx}
\begin{document}
\begin{table}
\centering
\resizebox{\linewidth}{!}{
\begin{tabular}[t]{l
r
r
S[round-mode = places, round-precision = 3, print-zero-integer=false, table-format = <0.3, table-space-text-post = {$^{***}$}]
r
r
S[round-mode = places, round-precision = 3, print-zero-integer=false, table-format = <0.3, table-space-text-post = {$^{***}$}]
r
r
S[round-mode = places, round-precision = 3, print-zero-integer=false, table-format = <0.3, table-space-text-post = {$^{***}$}]}
\toprule
\multicolumn{1}{c}{ } & \multicolumn{3}{c}{Variable A} & \multicolumn{3}{c}{Variable B} & \multicolumn{3}{c}{Variable C} \\
\cmidrule(l{3pt}r{3pt}){2-4} \cmidrule(l{3pt}r{3pt}){5-7} \cmidrule(l{3pt}r{3pt}){8-10}
\em{} & \em{B (SE)} & \em{$\beta$ (SE)} & \em{p} & \em{B (SE)} & \em{$\beta$ (SE)} & \em{p} & \em{B (SE)} & \em{$\beta$ (SE)} & \em{p}\\
\midrule
Intercept & 4.18 (17.53) & 0.00 (0.00) & <.001{$^{***}$} & 0.05 (0.14) & 0.00 (0.00) & .706 & 4.17 (0.91) & 0.00 (0.00) & <.001{$^{***}$}\\
Predictor A & -0.01 (0.13) & -0.01 (0.07) & .914 & 0.02 (0.03) & 0.05 (0.07) & .495 & -0.13 (0.22) & -0.04 (0.07) & .564\\
Predictor B & -0.13 (0.12) & -0.07 (0.06) & .285 & 0.07 (0.03) & 0.13 (0.06) & .038{$^{*}$} & -0.21 (0.21) & -0.06 (0.06) & .315\\
\midrule
Num.Obs. & 432 & & & 845 & & & 155 & & \\
R2 & 0.20 & & & 0.11 & & & 0.54 & & \\
R2 Adj. & 0.19 & & & 0.09 & & & 0.52 & & \\
F & 5.28 & & & 4.47 & & & 8.42 & & \\
\bottomrule
\multicolumn{10}{l}{\rule{0pt}{1em}{$^{*}$} p $<$ .05, {$^{**}$} p $<$ .01, {$^{***}$} p $<$ .001}\\
\end{tabular}}
\end{table}
\end{document}
```
My goal is to align all values based on the decimal points, but I am struggling with the parentheses in the *B* and *\beta* columns. If possible, I would like to avoid splitting the values in parentheses into an additional column.
So far, I have tried `S[table-format=1.2 (1.2)]` but it did not work in the desired way (i.e., no space between parenthesis and preceding number, no decimal point).
Any help is greatly appreciated!
| https://tex.stackexchange.com/users/293998 | Parentheses in siunitx table | true | When you set `uncertainty-mode` to `full`, `siunitx` prints uncertainties as they are provided. In order to insert a gap between quantity and uncertainty, you can reformat `output-open-uncertainty`.
You should not resize tables. Rather try to decrease font size. IMO if you have to set a font lower than `\footnotesize`, it probably means your table needs to be redesigned. I also split your table into two parts in order to apply two slightly different formatting; `Num. Obs.` is an integer and should not be formatted; Hence, I enclosed all integers within two braces `{...}`.
In general, the whole table could be rearranged. The lower part seems like a separate table anyway. If you exclude it from the upper part, then you could move the groups `Variable X` to separate rows and repeated `Intercept`, `Predictor A`, ad n`Predictor B` for each group. That way, you could even fit the table horizontally. Currently, I had to use `sidewaystable` and render the table vertically to fit it in a page.
```
\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{rotating,graphicx}
\sisetup{
round-mode = places,
round-precision = 2,
table-format = -1.3(1),
uncertainty-mode = full,
output-open-uncertainty = {\,(},
retain-zero-uncertainty = false,
print-zero-integer = true,
table-column-width=1.9cm,
}
\begin{document}
\begin{sidewaystable}
\setlength{\tabcolsep}{0pt}
\footnotesize
\centering
\caption{Statistics}
\begin{tabular}[t]{
@{\;}
p{2cm} *3{SSS[table-format=<0.3, table-space-text-post={$^{***}$}, round-precision=3, table-column-width=1.4cm]}
@{\;}
}
\toprule
\multicolumn{1}{c}{ } & \multicolumn{3}{c}{Variable A} & \multicolumn{3}{c}{Variable B} & \multicolumn{3}{c}{Variable C} \\
\cmidrule(l{3pt}r{3pt}){2-4} \cmidrule(l{3pt}r{3pt}){5-7} \cmidrule(l{3pt}r{3pt}){8-10}
\em{} & \em{B (SE)} & \em{$\beta$ (SE)} & \em{p} & \em{B (SE)} & \em{$\beta$ (SE)} & \em{p} & \em{B (SE)} & \em{$\beta$ (SE)} & \em{p} \\
\midrule
Intercept & {4.18\,(17.53)} & 0.00(0.00) & <.001{$^{***}$} & 0.05(0.14) & 0.00(0.00) & .706 & 4.17(0.91) & 0.00(0.00) & <.001{$^{***}$}\\
Predictor A & -0.01(0.13) & -0.01(0.07) & .914 & 0.02(0.03) & 0.05(0.07) & .495 & -0.13(0.22) & -0.04(0.07) & .564\\
Predictor B & -0.13(0.12) & -0.07(0.06) & .285 & 0.07(0.03) & 0.13(0.06) & .038{$^{*}$} & -0.21(0.21) & -0.06(0.06) & .315\\
\midrule
\end{tabular}
\par\nointerlineskip
\begin{tabular}{
@{\;}
p{2cm} *3{S[table-format=1.2]Sp{1.4cm}}
@{\;}
}
Num.Obs. & {432} & & & {845} & & & {155} & & \\
R2 & 0.20 & & & 0.11 & & & 0.54 & & \\
R2 Adj. & 0.19 & & & 0.09 & & & 0.52 & & \\
F & 5.28 & & & 4.47 & & & 8.42 & & \\
\bottomrule
\multicolumn{10}{l}{\rule{0pt}{1em}{$^{*}$} p $<$ .05, {$^{**}$} p $<$ .01, {$^{***}$} p $<$ .001}\\
\end{tabular}
\end{sidewaystable}
\end{document}
```
---
EDIT to render table horizontally.
First, consider adding the following snippet to preamble to see a frame denoting text boundaries
```
\usepackage{showframe}
\renewcommand*\ShowFrameLinethickness{0.2pt}
\renewcommand*\ShowFrameColor{\color{blue}}
```
I added code with two versions of the table.
If you have to resize it, beware the effect is degrading and is more visible the greater is a scale factor.
I would first make sure everything is minimised including font, column widths, spaces etc.
Then, I would apply `resizebox`.
Here's the first non-scaled version of the table exceeding left and right margins
The second scaled version fits the page.
Everything has been reduced to minimum so negative effects of `resizebox` are also reduced.
In the code, I have moved `tabular`s to saved boxes in order to measure their width.
This is not required if you decide on a scaled version because you will not need to apply negative space.
Just move everything back to the `table` environment.
```
% ... preamble remains the same
% ... add showframe to see text boundaries
\begin{document}
% Saved boxes
\sbox0{%
\tiny
\setlength{\tabcolsep}{0pt}%
\begin{tabular}[t]{%
p{1.4cm} *3{SSS[table-format=<0.3, table-space-text-post={$^{***}$}, round-precision=3, table-column-width=1.2cm]}
}
\toprule
\multicolumn{1}{c}{ } & \multicolumn{3}{c}{Variable A} & \multicolumn{3}{c}{Variable B} & \multicolumn{3}{c}{Variable C} \\
\cmidrule(l{3pt}r{3pt}){2-4} \cmidrule(l{3pt}r{3pt}){5-7} \cmidrule(l{3pt}r{3pt}){8-10}
\em{} & \em{B (SE)} & \em{$\beta$ (SE)} & \em{p} & \em{B (SE)} & \em{$\beta$ (SE)} & \em{p} & \em{B (SE)} & \em{$\beta$ (SE)} & \em{p} \\
\midrule
Intercept & {4.18\,(17.53)} & 0.00(0.00) & <.001{$^{***}$} & 0.05(0.14) & 0.00(0.00) & .706 & 4.17(0.91) & 0.00(0.00) & <.001{$^{***}$}\\
Predictor A & -0.01(0.13) & -0.01(0.07) & .914 & 0.02(0.03) & 0.05(0.07) & .495 & -0.13(0.22) & -0.04(0.07) & .564\\
Predictor B & -0.13(0.12) & -0.07(0.06) & .285 & 0.07(0.03) & 0.13(0.06) & .038{$^{*}$} & -0.21(0.21) & -0.06(0.06) & .315\\
\midrule
\end{tabular}}%
\sbox2{%
\tiny
\setlength{\tabcolsep}{0pt}%
\begin{tabular}{
p{1.4cm} *3{S[table-format=1.2]Sp{1.2cm}}
}
Num.Obs. & {432} & & & {845} & & & {155} & & \\
R2 & 0.20 & & & 0.11 & & & 0.54 & & \\
R2 Adj. & 0.19 & & & 0.09 & & & 0.52 & & \\
F & 5.28 & & & 4.47 & & & 8.42 & & \\
\bottomrule
\multicolumn{10}{l}{\rule{0pt}{1em}{$^{*}$} p $<$ .05, {$^{**}$} p $<$ .01, {$^{***}$} p $<$ .001}
\end{tabular}}
\begin{table}[tbh]
\caption{Statistics}
%%% Table version exceeding margines
% \hspace{0.5\dimexpr\linewidth-\wd0}\usebox0
% \par\nointerlineskip
% \hspace{0.5\dimexpr\linewidth-\wd2}\usebox2
%%% Table version scaled to the page width
\resizebox{\linewidth}{!}{\usebox0}%
\par\nointerlineskip
\resizebox{\linewidth}{!}{\usebox2}
\end{table}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/31283 | 681278 | 316,097 |
https://tex.stackexchange.com/questions/681277 | 1 | I'm using the command `pandoc -t beamer in.md -o out.pdf` to generate slides from a markdown file. It seems the default aspect ratio is 4:3. How do I set it to 16:9?
| https://tex.stackexchange.com/users/294004 | Markdown + pandoc + beamer, how to set the aspect ratio? | false | You can specify the class option in the header of the `.md` file:
```
---
classoption: "aspectratio=169"
---
test
```
| 0 | https://tex.stackexchange.com/users/36296 | 681279 | 316,098 |
https://tex.stackexchange.com/questions/681277 | 1 | I'm using the command `pandoc -t beamer in.md -o out.pdf` to generate slides from a markdown file. It seems the default aspect ratio is 4:3. How do I set it to 16:9?
| https://tex.stackexchange.com/users/294004 | Markdown + pandoc + beamer, how to set the aspect ratio? | true | Change the `aspectratio` variable in the YAML metadata at the beginning of the file:
```
---
title: 'My presentation'
author:
- Author One
- Author Two
...
aspectratio: 169
---
```
Check the [man pages](https://pandoc.org/MANUAL.html#variables-for-beamer-slides) for more information.
| 2 | https://tex.stackexchange.com/users/294004 | 681280 | 316,099 |
https://tex.stackexchange.com/questions/681047 | 2 | I would like to include a list of symbols in my notes and am trying to do this using the nomencl package. Unfortunately, I can't get it to appear. I don't any error messages, but also no output. My compilation set-up is vimtex based with latexmk and I would like to know how to incorporate it in that. An abbreviated version of my problem is below. Main.tex provides the main document and latex.lua is my vimtex set-up in neovim, while latexmkrc are my latexmk settings. I am sure a number of improvements are possible, but browsing several tutorials and related questions have not yet led to a solution. Any thoughts?
main.tex
```
\documentclass{memoir}
\usepackage{nomencl}
\makenomenclature
\begin{document}
\renewcommand{\nomname}{List of Symbols}
\renewcommand\nomgroup[1]{%
\item[\bfseries
\ifstrequal{#1}{M}{Mathematical symbols}{%
\ifstrequal{#1}{O}{Other symbols}{}}}%
]}
\nomenclature[M]{\(\RR\)}{Real numbers}
\printnomenclature
\end{document}
```
latex.lua
```
vim.g.vimtex_compiler_latexmk = {
background = 1,
build_dir = 'build',
callback = 1,
executable = 'latexmk',
options = {
'-xelatex',
'-synctex=1',
'-interaction=nonstopmode',
'-shell-escape',
},
}
```
.latexmkrc
```
@cus_dep_list = (@cus_dep_list, "glo gls 0 makenomenclature");
sub makenomenclature {
system("makeindex $_[0].glo -s nomencl.ist -o $_[0].gls"); }
@generated_exts = (@generated_exts, 'glo');
$pdflatex = 'xelatex -synctex=1 --interaction=nonstopmode -shell-escape -file-line-error %O
```
| https://tex.stackexchange.com/users/206194 | Nomenclature not showing using vimtex / latexmk compilation set-up | true | Your `main.tex` has an error, the line
`\ifstrequal{#1}{O}{Other symbols}{}}}%`
has an extra `}` at the end and should be
`\ifstrequal{#1}{O}{Other symbols}{}}%`.
`\RR` is also not defined, so I've added `\newcommand\RR{RR}` but probably you want to load a package.
Your `.latexmkrc` appears to have a dodgy `$pdflatex` call, we also want to replace the `glo` and `gls` with `nlo` and `nls` as
```
@cus_dep_list = (@cus_dep_list, "nlo nls 0 makenomenclature");
sub makenomenclature {
system("makeindex $_[0].nlo -s nomencl.ist -o $_[0].nls"); }
@generated_exts = (@generated_exts, 'nlo');
$pdflatex = 'xelatex --synctex=1 --interaction=nonstopmode --shell-escape --file-line-error %O %S'
```
This then compiles on the command line with `latexmk -pdf main.tex` (requiring `-pdf` as otherwise `latexmk` appears to default to `latex`).
I don't think this `$pdflatex` line is the preferred way to call `xelatex` though, it overwrites `latexmk`'s `pdflatex` and hardcodes flags (fixing `--shell-escape` active is not a great idea). You can just do
```
latexmk -xelatex [flag options to xelatex] file
```
I haven't tested with neovim/vimtex, but it looks like your `latex.lua` does exactly that, in which case
main.tex
```
\documentclass{memoir}
\usepackage{nomencl}
\makenomenclature
\newcommand\RR{RR}
\begin{document}
\renewcommand{\nomname}{List of Symbols}
\renewcommand\nomgroup[1]{%
\item[\bfseries
\ifstrequal{#1}{M}{Mathematical symbols}{%
\ifstrequal{#1}{O}{Other symbols}{}}%
]}
\nomenclature[M]{\(\RR\)}{Real numbers}
\printnomenclature
\end{document}
```
.latexmkrc
```
@cus_dep_list = (@cus_dep_list, "nlo nls 0 makenomenclature");
sub makenomenclature {
system("makeindex $_[0].nlo -s nomencl.ist -o $_[0].nls"); }
@generated_exts = (@generated_exts, 'nlo');
```
should work if you trigger compilation within vimtex. If this doesn't work, try without `build_dir = 'build',` in `latex.lua` first, the `makeindex` call may need to be adapted to take account of the `build_dir`.
| 1 | https://tex.stackexchange.com/users/106162 | 681289 | 316,101 |
https://tex.stackexchange.com/questions/681287 | 0 | is there a way to make it works correctly? Seems that the use of \texttt doesn't work
```
\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}[
ymin=0, ymax=100,
ymajorgrids = true,
axis x line*=bottom,
axis y line*=left,
tickwidth=0pt,
symbolic x coords={\texttt{cv}, \texttt{pT}, $\widetilde{pT}$,, \texttt{ev}, \texttt{ev(cv)}},
ylabel={CI (\%)},
xtick={\texttt{cv}, \texttt{pT}, $\widetilde{pT}$,, \texttt{ev}, \texttt{ev(cv)}},
xticklabel style={rotate=90}]
\addplot[ybar,fill=blue] coordinates {
(\texttt{cv},26.355)
($\widetilde{pT}$,100)
(\texttt{pT},35.55114)
};
\addplot[ybar,fill=orange] coordinates {
(\texttt{ev(cv)},63.17104)
(\texttt{ev},93.775)
};
\end{axis}
\end{tikzpicture}
\end{figure}
```
| https://tex.stackexchange.com/users/292667 | \texttt in tikz plots | false | You should maybe not style symbolic coordinates (although this might work in certain cases). But you surely can style their labels:
```
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ymin=0, ymax=100,
ymajorgrids = true,
axis x line*=bottom,
axis y line*=left,
tickwidth=0pt,
symbolic x coords={cv, pT, pTn,, ev, evcv},
ylabel={CI (\%)},
xticklabels={, \texttt{cv}, \texttt{pT}, $\widetilde{pT}$,, \texttt{ev}, \texttt{ev(cv)}},
xticklabel style={rotate=90}]
\addplot[ybar,fill=blue] coordinates {
(cv,26.355)
(pTn,100)
(pT,35.55114)
};
\addplot[ybar,fill=orange] coordinates {
(evcv,63.17104)
(ev,93.775)
};
\end{axis}
\end{tikzpicture}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/47927 | 681290 | 316,102 |
https://tex.stackexchange.com/questions/681283 | 0 | This is a sequel to [this](https://tex.stackexchange.com/questions/679768/paragraphs-no-longer-indent-after-caption/679776) question, which was partially resolved and it was suggested there that I start a new question.
I've created a box with tcolorbox, which should not float and I want to attach a caption which should "stick" in the sense that it should be on the same page as the box.
The solution suggested by Zarko in my previous question does strange things to vertical spacing inside the box, as can be seen in the code below.
I came up with a small workaround in the previous question but the caption doesn't stick. Does anyone have any suggestions for a workaround or fix?
```
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage[skip=1ex]{caption}
\usepackage{tcolorbox}
\tcbuselibrary{most}
\newtcolorbox{abox}[2][]{enhanced, fonttitle=\bfseries,
attach boxed title to top center={yshift=-2mm},
title={#2},#1}
\usepackage[unicode=true,
pdfusetitle,
bookmarks=true,
bookmarksnumbered=false,
bookmarksopen=false,
breaklinks=false,
pdfborder={0 0 1},
backref=false,
colorlinks=false]{hyperref}
\begin{document}
\begin{center}
\begin{abox}{title}
{
{\begin{enumerate}
\item testttttt
\end{enumerate}
testttttt
\begin{enumerate}\setcounter{enumi}{1}
\item testttttt
\end{enumerate}
testttttt
\begin{enumerate}\setcounter{enumi}{2}
\item testttttt
\end{enumerate}}
}
\end{abox}
\captionof{figure}{caption}
\end{center}
\end{document}
```
| https://tex.stackexchange.com/users/226143 | Strange vertical spacing in tcolorbox after center | true | I am not sure about certain items in your example, so I changed some of it to be able to target the lack of vertical spacing at the first `enumerate`. This code example shows the correct vertical spacing inside and outside the `tcolorbox`:
```
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage[skip=1ex]{caption}
\usepackage[most]{tcolorbox}
\newtcolorbox{abox}[1][]{enhanced, fonttitle=\bfseries,
nofloat, % added to prevent tcolorbox becoming a float
attach boxed title to top center={yshift=-2mm},
title=#1}
\usepackage{enumitem} % added to use the resume option
\usepackage{lipsum} % just to insert some random text
\begin{document}
\lipsum[1][1-2]
\begin{abox}[title]
top text
\begin{enumerate}[leftmargin=*]
\item testttttt
\end{enumerate}
testttttt
\begin{enumerate}[resume*]%\setcounter{enumi}{1}
\item testttttt
\end{enumerate}
testttttt
\begin{enumerate}[resume*]%\setcounter{enumi}{2}
\item testttttt
\end{enumerate}
testttttt
\end{abox}
\captionof{figure}{caption}
\medskip
\lipsum[2][1-2]
\end{document}
```
I made the following changes:
1. added the `enumitem` package, so you can use the `resume*` option in subsequent `enumerate` occurrences without having to reset the counter
2. changed the number of variables in your `abox` to just one for the title. You don't need to define a variable for the content of the box
3. removed all superfluous brackets as a result of that change
4. added the option `nofloat` to your box definition as you clearly stated you don't want the box to be a floating object
5. removed the `center` environment as that is no longer required to prevent floating
6. since the caption is following the box, but not attached to it, you need to add some vertical space to increase the distance between caption and next paragraph. You can't use the option `before / after skip balanced` from `tcolorbox` (see pages 86-88 in the manual)
The result of these changes:
As to why the vertical spacing is altered at the first `enumerate` when embedded in a `center` environment, I have no clue.
*Edited to include options in comments*
```
\documentclass[english]{article}
%\usepackage[T1]{fontenc}
%\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage[skip=1ex]{caption}
\usepackage[most]{tcolorbox}
\newtcolorbox{abox}[1][]{enhanced, fonttitle=\bfseries,
nofloat, % added to prevent tcolorbox becoming a float
attach boxed title to top center={yshift=-2mm},
title=#1}
\usepackage{enumitem} % added to use the resume option
\usepackage{lipsum} % just to insert some random text
\begin{document}
\lipsum[1][1-2]
\begin{abox}[title]
caption inside a parbox
\begin{enumerate}[leftmargin=*]
\item testttttt
\end{enumerate}
testttttt
\begin{enumerate}[resume*]%\setcounter{enumi}{1}
\item testttttt
\end{enumerate}
testttttt
\begin{enumerate}[resume*]%\setcounter{enumi}{2}
\item testttttt
\end{enumerate}
testttttt
\end{abox}
\noindent \parbox{\linewidth}{\captionof{figure}{caption}}
\medskip
\lipsum[2][1-2]
\noindent \begin{minipage}{\linewidth}
\begin{abox}[title]
boxed inside a minipage
\begin{enumerate}[leftmargin=*]
\item testttttt
\end{enumerate}
testttttt
\begin{enumerate}[resume*]%\setcounter{enumi}{1}
\item testttttt
\end{enumerate}
testttttt
\begin{enumerate}[resume*]%\setcounter{enumi}{2}
\item testttttt
\end{enumerate}
testttttt
\end{abox}
\captionof{figure}{caption}
\end{minipage}
\medskip
\lipsum[4][4-8]
\end{document}
```
This code example shows the correct indention after the use of `\captionof`:
| 2 | https://tex.stackexchange.com/users/189383 | 681307 | 316,109 |
https://tex.stackexchange.com/questions/681292 | 0 | I have a problem with back referencing, first a minimal example that I use:
```
\documentclass[headings=chapterprefix,12pt,twoside,openany]{scrbook}
\usepackage{lipsum}
\usepackage{iftex}
\ifPDFTeX
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\else
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{german}
\fi
\usepackage{lmodern}
\usepackage{array}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{amssymb}
\usepackage{float}
\usepackage{fancyhdr}%für lustige Kopf- und Fußzeilen
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{lastpage}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage[singlelinecheck=false,labelformat=simple]{subcaption}
\renewcommand\thesubfigure{\,\alph{subfigure})}
\usepackage{enumitem}
\usepackage[section]{placeins}
\usepackage[version=4]{mhchem}
\usepackage{siunitx}
\usepackage{csquotes}
\usepackage{tikz}
\usepackage[total={16.5cm,23cm}, inner=2cm, outer=3cm, footskip=1cm, headsep=0.75cm, twoside, includefoot]{geometry}
\usepackage[colorlinks=true,
linkcolor=black,
urlcolor=black,
citecolor=black
]{hyperref}
\hypersetup{linktocpage}
\usepackage[
backend=biber,
natbib=true,
style=phys,
biblabel=brackets,
giveninits=true,
abbreviate=false,
doi=false, url=false, isbn=false,
block=space,
backref=true,
backrefstyle=two,
sorting=none
]{biblatex}
\addbibresource{lit.bib}
\DeclareFieldFormat[article]{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat[article]{title}{\mkbibemph{#1}}
\DeclareFieldFormat[article]{journaltitle}{#1}%Journalname nicht kursiv
\DefineBibliographyStrings{ngerman}{%
backrefpage={zitiert auf S\adddot},
backrefpages={zitiert auf den S\adddot}
}
```
In my document I use `\cite{Purdie2018}` on pages 1, 2 and 3.
At last I use:
```
\hypersetup{linkcolor=blue}
\printbibliography[title=Literaturverzeichnis]
```
This gives me in my bibliography:
>
> [1] D. G. Purdie, N. M. Pugno, T. Taniguchi, K. Watanabe, A. C. Ferrari und A. Lombardo, Cleaning interfaces in layered materials heterostructures, Nature Communications 9, 5387 (2018) (zitiert auf den S. 1–3).
>
>
>
I would like to have "zitiert auf den S. 1,2 und 3" instead of this version. I thought `backrefstyle=two` should work with this but it doesn't.
| https://tex.stackexchange.com/users/294008 | backrefstyle=two not working with bibstyle=phys and biblatex | false | According to [the `biblatex` documentation](http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf) (p. 53 "`backrefstyle`")
>
> [`backrefstyle=two,`] Compress[es] any sequence of two or more consecutive pages to a range, e.g., the [list ‘1, 2, 11, 12, 13, 21, 22, 23, 24’] is compressed to ‘1–2, 11–13, 21–24’.
>
>
>
Assuming the work was cited on pages 1, 2 and 3, `backrefstyle=two,` therefore compresses the pages to "1-3" as advertised.
There is also `backrefstyle=three,` which only compresses ranges of three or more, but even that does not help you here. The only option that comes close to you what you want in this instance is `backrefstyle=none,`.
If the only thing you need in addition is an "and" before the last page, you may want to try switching the list format for `pageref` from `list:plain` to `list:delim`.
```
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, backref=true, backrefstyle=none,]{biblatex}
\makeatletter
\DeclareListFormat{pageref}{%
\ifnumless{\abx@pagerefstyle}{0}
{\usebibmacro{list:delim}{#1}%
\ifhyperref
{\hyperlink{page.#1}{#1}}
{#1}}
{\ifnumequal{\value{listcount}}{1}
{\usebibmacro{pageref:init}}
{}%
\usebibmacro{pageref:comp}{#1}%
\ifnumequal{\value{listcount}}{\value{liststop}}
{\usebibmacro{pageref:dump}}
{}}}
\makeatother
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem \autocite{sigfridsson}
\clearpage
Lorem \autocite{sigfridsson}
\clearpage
Lorem \autocite{sigfridsson}
\printbibliography
\end{document}
```
| 1 | https://tex.stackexchange.com/users/35864 | 681313 | 316,110 |
https://tex.stackexchange.com/questions/681310 | 0 | I am writing a poetry book using the poemscol package. It has its own commands for creating a ToC. However, my poetry book isn't in English, so I want the title of my ToC not be "Contents" in english, but "Contents" in my own language
```
\putpoemcontents
\makepoemcontents
```
After compiling twice, this gives you the ToC
| https://tex.stackexchange.com/users/294014 | How to change the name of the ToC when I use poemscol | true |
```
\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{times,fancyhdr,poemscol}
\pmclcontentsname={CONTENTS in my own language}
\begin{document}
\putpoemcontents
\makepoemcontents
\end{document}
```
| 0 | https://tex.stackexchange.com/users/123653 | 681315 | 316,111 |
https://tex.stackexchange.com/questions/681309 | 1 | I want to use lower case letters as footnote markers, and have them repeat, so that after z, they start over with a. It seems like a straightforward way to do this is by calculating the modulus of the footnote counter minus 1. Having little experience in LaTeX programming, I thought I should learn the new `expl3` interface, which offers a modulus command. However, I can't figure out how to use the value of the footnote counter in an int expression. The `interface3` documentation says, "integer operands can also be: `\value{⟨LaTeX2ε counter⟩}`; …", but when I try to do this, I get this error:
```
! Missing number, treated as zero.
<to be read again>
\c@1
l.14 Some text.\footnote{
First footnote.}
```
MWE
```
\documentclass{memoir}
\ExplSyntaxOn
\RenewDocumentCommand {\thefootnote} {} {
\int_set:Nn \l_tmpa_int {
\int_mod:nn {\value{footnote} - 1} {26}
}
\alph{\int_eval:n{\l_tmpa_int + 1}}
}
\ExplSyntaxOff
\begin{document}
Some text.\footnote{First footnote.}
Some more text.\footnote{Second footnote.}
And even more text.\footnote{Third footnote.}
More text.\footnote{Fourth footnote.}
More text.\footnote{Fifth footnote.}
More text.\footnote{Sixth footnote.}
More text.\footnote{Seventh footnote.}
More text.\footnote{Eighth footnote.}
More text.\footnote{Ninth footnote.}
More text.\footnote{Tenth footnote.}
More text.\footnote{Eleventh footnote.}
More text.\footnote{Twelfth footnote.}
More text.\footnote{Thirteenth footnote.}
More text.\footnote{Fourteenth footnote.}
More text.\footnote{Fifteenth footnote.}
More text.\footnote{Sixteenth footnote.}
More text.\footnote{Seventeenth footnote.}
More text.\footnote{Eighteenth footnote.}
More text.\footnote{Nineteenth footnote.}
More text.\footnote{Twentieth footnote.}
More text.\footnote{Twenty-first footnote.}
More text.\footnote{Twenty-second footnote.}
More text.\footnote{Twenty-third footnote.}
More text.\footnote{Twenty-fourth footnote.}
More text.\footnote{Twenty-fifth footnote.}
More text.\footnote{Twenty-sixth footnote.}
More text.\footnote{Twenty-seventh footnote.}
\end{document}
```
If it matters, I actually want to do this not with the regular footnote series, but with an additional series defined with `\newfootnoteseries{T}`. So my counter name is `footnoteT`. But that didn't seem relevant to an MWE.
| https://tex.stackexchange.com/users/56514 | Repeating \alph footnote markers | true | The error is from `\alph` as you have effectively `\alph{1}` which looks for a counter of name `1`.
You could use `\@alph{...}` but the L3 way would be `\int_to_alph:n{...}`
You could use
```
\RenewDocumentCommand {\thefootnote} {} {
\int_set:Nn \l_tmpa_int {
\int_mod:nn {\value{footnote} - 1} {26}
}
\int_to_alph:n{\l_tmpa_int + 1}
}
```
but there is no need for the intermediate variable, so
```
\documentclass{memoir}
\ExplSyntaxOn
\RenewDocumentCommand {\thefootnote} {} {
\int_to_alph:n{\int_mod:nn {\value{footnote} - 1} {26} + 1}
}
\ExplSyntaxOff
\begin{document}
Some text.\footnote{First footnote.}
Some more text.\footnote{Second footnote.}
And even more text.\footnote{Third footnote.}
More text.\footnote{Fourth footnote.}
More text.\footnote{Fifth footnote.}
More text.\footnote{Sixth footnote.}
More text.\footnote{Seventh footnote.}
More text.\footnote{Eighth footnote.}
More text.\footnote{Ninth footnote.}
More text.\footnote{Tenth footnote.}
More text.\footnote{Eleventh footnote.}
More text.\footnote{Twelfth footnote.}
More text.\footnote{Thirteenth footnote.}
More text.\footnote{Fourteenth footnote.}
More text.\footnote{Fifteenth footnote.}
More text.\footnote{Sixteenth footnote.}
More text.\footnote{Seventeenth footnote.}
More text.\footnote{Eighteenth footnote.}
More text.\footnote{Nineteenth footnote.}
More text.\footnote{Twentieth footnote.}
More text.\footnote{Twenty-first footnote.}
More text.\footnote{Twenty-second footnote.}
More text.\footnote{Twenty-third footnote.}
More text.\footnote{Twenty-fourth footnote.}
More text.\footnote{Twenty-fifth footnote.}
More text.\footnote{Twenty-sixth footnote.}
More text.\footnote{Twenty-seventh footnote.}
\end{document}
```
| 4 | https://tex.stackexchange.com/users/1090 | 681317 | 316,112 |
https://tex.stackexchange.com/questions/681148 | 2 | I want to have an online article in my bibliography but cannot change the way it is displayed. My `.bib` file contains many entries but for this working example, I will only use:
```
@online{european_commission_NGEU,
title={EU Budget policy brief: The EU as an issuer : the NextGenerationEU transformation},
url={https://op.europa.eu/en/publication-detail/-/publication/accacfb6-0966-11ed-b11c-01aa75ed71a1/language-en/format-PDF},
author={{European Commission}},
publisher={Publications Office of the European Union},
year={2022},
month={Jul}}
```
With my current code:
```
\documentclass[12pt]{article}
\usepackage{hyperref}
\usepackage[backend=biber, style=authoryear,sorting=nymdt, maxbibnames=99,autolang=hyphen,alldates=long,dateabbrev=false,doi=false]{biblatex}
\addbibresource{bibliography.bib}
\DeclareFieldFormat[online]{title}{\textit{#1}} %since i want my title cursive
%to correctly sort
\DeclareSortingTemplate{nymdt}{
\sort{
\field{presort}}
\sort[final]{
\field{sortkey}}
\sort{
\field{sortname}
\field{author}
\field{editor}
\field{translator}
\field{sorttitle}
\field{title} }
\sort{
\field{sortyear}
\field{year} }
\sort{
\field[padside=left,padwidth=2,padchar=0]{month}
\literal{00} }
\sort{
\field[padside=left,padwidth=2,padchar=0]{day}
\literal{00} }
\sort{
\field{sorttitle} }
\sort{
\field[padside=left,padwidth=4,padchar=0]{volume}
\literal{0000}}
}
\begin{document}
Text \cite{european_commission_NGEU}
\printbibliography
\end{document}
```
I get the output:
>
> European Commission (July 2022). EU Budget policy brief: The EU as an issuer : the NextGenerationEU transformation. url: <https://op.europa.eu/en/publication-detail/-/publication/accacfb6-0966-11ed-b11c-01aa75ed71a1/language-en/format-PDF>.
>
>
>
What I would want:
>
> European Commission (2022). EU Budget policy brief: The EU as an issuer : the NextGenerationEU transformation. url: <https://op.europa.eu/en/publication-detail/-/publication/accacfb6-0966-11ed-b11c-01aa75ed71a1/language-en/format-PDF>. July, 2022.
>
>
>
I looked around for an easy way to achieve that but couldn't find a neat solution. I would appreciate some help.
| https://tex.stackexchange.com/users/293902 | Change ordering of fields in bibliography | true | If you don't insist on having the date come after the URL and could also accept it coming in before the URL (as is common for all other entry types), you only need to adjust the `mergedate` settings to `basic` and need to set `labeldate=year,` (which is the default, but is overridden by the `alldates=long,`). You may want to check out the other `mergedate` values as well.
```
\documentclass[12pt]{article}
\usepackage[
backend=biber,
style=authoryear,
sorting=nymdt,
maxbibnames=99,
autolang=hyphen,
mergedate=basic,
alldates=long,
labeldate=year,
dateabbrev=false,
doi=false,
]{biblatex}
\usepackage{hyperref}
\DeclareFieldFormat[online]{title}{\mkbibitalic{#1}}
%to correctly sort
\DeclareSortingTemplate{nymdt}{
\sort{
\field{presort}}
\sort[final]{
\field{sortkey}}
\sort{
\field{sortname}
\field{author}
\field{editor}
\field{translator}
\field{sorttitle}
\field{title} }
\sort{
\field{sortyear}
\field{year} }
\sort{
\field[padside=left,padwidth=2,padchar=0]{month}
\literal{00} }
\sort{
\field[padside=left,padwidth=2,padchar=0]{day}
\literal{00} }
\sort{
\field{sorttitle} }
\sort{
\field[padside=left,padwidth=4,padchar=0]{volume}
\literal{0000}}
}
\begin{filecontents}[overwrite]{\jobname.bib}
@online{european_commission_NGEU,
title={EU Budget policy brief: The EU as an issuer : the NextGenerationEU transformation},
url={https://op.europa.eu/en/publication-detail/-/publication/accacfb6-0966-11ed-b11c-01aa75ed71a1/language-en/format-PDF},
author={{European Commission}},
publisher={Publications Office of the European Union},
date={2022-07},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Text \cite{european_commission_NGEU}
\printbibliography
\end{document}
```
If you need the date after the URL, it's probably easiest to change the driver with `xpatch`. Add the following to above MWE after you've loaded `biblatex`
```
\usepackage{xpatch}
\xpatchbibdriver{online}
{\usebibmacro{date}%
\newunit\newblock
\usebibmacro{doi+eprint+url}}
{\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{date}}
{}{}
```
| 2 | https://tex.stackexchange.com/users/35864 | 681319 | 316,114 |
https://tex.stackexchange.com/questions/37640 | 26 | For a variety of reasons I am very interested in having audio versions of various texts. In some cases I can get these texts in LaTeX format (with equations). Obviously I can use "normal" text-to-speech programs for reading ascii plain text or pdf/ps OCR produced ascii. Unfortunately this renders the mathematics nearly unintelligible.
Are there are any programs or packages specifically designed for rendering either TeX code generally, or math-oriented TeX code specifically, into text-to-speech friendly forms?
| https://tex.stackexchange.com/users/7470 | Are there good resources for converting TeX type files to spoken word? | false | I have had reasonable success with pandoc, as it transcribes latex into UTF-8.
I use:
```
pandoc -f latex -t plain frugal2.tex > out.txt
espeak-ng -f out.txt -w /tmp/a.wav
```
| 0 | https://tex.stackexchange.com/users/294020 | 681321 | 316,115 |
https://tex.stackexchange.com/questions/681311 | 2 | I would like to cut my bibliography into different sections.
For example I would like something looking like this:
```
\begin{thebibliography}{00}
\section{Historical review of capacity in optical telecommunication networks},
\bibitem{Chap0-Handbook}
B. Mukherjee et al.,
\textit{Springer Handbook of Optical Networks},
Springer Cham, 10/2020,
ISBN: 978-3-030-16249-8,
\mydoi{10.1007/978-3-030-16250-4},
\bibitem{Chap0-RUNGE}
P.K. Runge,
\textit{An experimental 50 Mb/s fiber optic PCM repeater},
Trans. Comm., Vol COM-24, No. 4, 04/1976,
\mydoi{10.1109/TCOM.1976.1093308}
\section{Monitoring in optical networks},
\bibitem{Chap1-Christodoulopoulos}
K. Christodoulopoulos et. al,
\textit{Toward efficient, reliable, and autonomous optical networks:
the ORCHESTRA solution},
IEEE J. Opt. Commun. Netw., Sept. 2019, Vol 11, No. 9,
doi: \url{10.1109/JLT.2020.2984270}.
\end{thebibliography}
```
thanks in advance.
| https://tex.stackexchange.com/users/260816 | How to make sections in a bibliography | true | To create a bibliography with sections in LaTeX, you can use the `biblatex` package with custom categories for each section. Here's an example:
1. First, install the biblatex` package in your preamble:
```
\usepackage[backend=bibtex,style=numeric,sorting=none]{biblatex}
```
2. Define your categories:
```
\DeclareBibliographyCategory{historical_review}
\DeclareBibliographyCategory{monitoring}
```
3. Assign bibliography entries to their respective categories:
```
\addtocategory{historical_review}{Chap0-Handbook,Chap0-RUNGE}
\addtocategory{monitoring}{Chap1-Christodoulopoulos}
```
4. Add your bibliography file (assuming you are using a `.bib` file):
```
\addbibresource{your_bib_file.bib}
```
5. Print the bibliography with sections:
```
\printbibheading
\section*{Historical review of capacity in optical telecommunication networks}
\printbibliography[category=historical_review,heading=none]
\section*{Monitoring in optical networks}
\printbibliography[category=monitoring,heading=none]
```
Make sure you replace `your_bib_file.bib` with the name of your actual .bib file.
In your `.bib` file, your entries should look like this:
```
@book{Chap0-Handbook,
author = {B. Mukherjee et al.},
title = {Springer Handbook of Optical Networks},
publisher = {Springer Cham},
year = {2020},
month = {10},
isbn = {978-3-030-16249-8},
doi = {10.1007/978-3-030-16250-4},
}
@article{Chap0-RUNGE,
author = {P.K. Runge},
title = {An experimental 50 Mb/s fiber optic PCM repeater},
journal = {Trans. Comm.},
volume = {COM-24},
number = {4},
year = {1976},
month = {04},
doi = {10.1109/TCOM.1976.1093308},
}
@article{Chap1-Christodoulopoulos,
author = {K. Christodoulopoulos et. al},
title = {Toward efficient, reliable, and autonomous optical networks: the ORCHESTRA solution},
journal = {IEEE J. Opt. Commun. Netw.},
volume = {11},
number = {9},
year = {2019},
month = {09},
doi = {10.1109/JLT.2020.2984270},
}
```
**EDIT**: AS @louis wants an example for a way to have the bibliography items inside LaTeX-script here is a solution:
You can create a custom bibliography with sections directly within your LaTeX document using the `enumitem` and `hyperref` packages. Here's how:
1. First, add the `enumitem` and `hyperref` packages to your preamble:
```
\usepackage{enumitem}
\usepackage{hyperref}
```
2. Create a custom bibliography list:
```
\newlist{bibsection}{enumerate}{1}
\setlist[bibsection]{label={[\arabic*]},itemsep=0.5\baselineskip,leftmargin=*,align=left}
```
3. Define your bibliography items within sections:
```
\begin{bibsection}
\section*{Historical review of capacity in optical telecommunication networks}
\item B. Mukherjee et al.,
\textit{Springer Handbook of Optical Networks},
Springer Cham, 10/2020,
ISBN: 978-3-030-16249-8,
\href{https://doi.org/10.1007/978-3-030-16250-4}{doi:10.1007/978-3-030-16250-4}
\item P.K. Runge,
\textit{An experimental 50 Mb/s fiber optic PCM repeater},
Trans. Comm., Vol COM-24, No. 4, 04/1976,
\href{https://doi.org/10.1109/TCOM.1976.1093308}{doi:10.1109/TCOM.1976.1093308}
\section*{Monitoring in optical networks}
\item K. Christodoulopoulos et. al,
\textit{Toward efficient, reliable, and autonomous optical networks:
the ORCHESTRA solution},
IEEE J. Opt. Commun. Netw., Sept. 2019, Vol 11, No. 9,
\href{https://doi.org/10.1109/JLT.2020.2984270}{doi:10.1109/JLT.2020.2984270}
\end{bibsection}
```
This code snippet creates a custom enumerated list for your bibliography and separates the items by sections. The result is a bibliography that resembles the one in your original question, without the need for a `.bib` file.
Tough, I would highly recommend to outsource the `.bib` file whenever possible. This makes debugging much easier and might help to keep the original document file in a more structured way!
EDIT II : It seems their was a misunderstanding regarding the question. The following solution provides a way to add a custom Reference section, while creating custom bibitems.
To create a custom bibliography with sections in LaTeX without using a `.bib` file, you can use the `etaremune` package for reverse enumeration and the `hyperref` package for clickable DOIs. Here's how:
1. Add the `etaremune` and `hyperref` packages to your preamble:
```
\usepackage{etaremune}
\usepackage{hyperref}
```
2. Create custom commands for easy citation and reference:
```
\newcommand{\customcite}[1]{[\ref{#1}]}
\newcommand{\custombibitem}[1]{\item \label{#1}}
```
3. Define your bibliography items within sections:
```
\section*{References}
\section*{Historical review of capacity in optical telecommunication networks}
\begin{etaremune}
\custombibitem{Chap0-Handbook}
B. Mukherjee et al.,
\textit{Springer Handbook of Optical Networks},
Springer Cham, 10/2020,
ISBN: 978-3-030-16249-8,
\href{https://doi.org/10.1007/978-3-030-16250-4}{doi:10.1007/978-3-030-16250-4}
\custombibitem{Chap0-RUNGE}
P.K. Runge,
\textit{An experimental 50 Mb/s fiber optic PCM repeater},
Trans. Comm., Vol COM-24, No. 4, 04/1976,
\href{https://doi.org/10.1109/TCOM.1976.1093308}{doi:10.1109/TCOM.1976.1093308}
\end{etaremune}
\section*{Monitoring in optical networks}
\begin{etaremune}
\custombibitem{Chap1-Christodoulopoulos}
K. Christodoulopoulos et. al,
\textit{Toward efficient, reliable, and autonomous optical networks:
the ORCHESTRA solution},
IEEE J. Opt. Commun. Netw., Sept. 2019, Vol 11, No. 9,
\href{https://doi.org/10.1109/JLT.2020.2984270}{doi:10.1109/JLT.2020.2984270}
\end{etaremune}
```
4. Now, you can use `\customcite{}` to cite references in your text, like this:
```
As mentioned in \customcite{Chap0-Handbook}, optical networks have a rich history.
```
`\customcite{}` command. The `etaremune` package provides a reverse enumeration for the bibliography items, so the list will be numbered in descending order. If you prefer ascending order, simply replace `etaremune` with `enumerate`.
| 3 | https://tex.stackexchange.com/users/174649 | 681327 | 316,118 |
https://tex.stackexchange.com/questions/681326 | 3 | I want a symbol as "e", but rotated 180° around its center, so that the new symbol r(e) aligns with the other letters in the text: abgkr(e)etc.
How may this be achieved?
```
\documentclass{article}
\usepackage{rotating}
\begin{document}
e
\begin{rotate}{180}
e
\end{rotate}e
\end{document}
```
| https://tex.stackexchange.com/users/24406 | Rotation of letter which aligns with the text line? | false | With the suggestion of the user @Celdor,
```
\documentclass{article}
\usepackage{graphicx}
\begin{document}
e\rotatebox[origin=c]{180}{e}e
\end{document}
```
| 6 | https://tex.stackexchange.com/users/117876 | 681336 | 316,122 |
https://tex.stackexchange.com/questions/671321 | -1 | I need to do: three equations (via the align\* common environment) that will be aligned to the "=" sign and at least one equation within the text (so-called "inline" equations; hint: $). Include the use of indices, powers, roots, integrals, derivatives, and matrices. I tried doing this, but it doesnt work
```
\begin{equation}
\label{eq1}
\begin{split}
$f(x) & = x^3+ \sqrt{x^3}$
\begin{matrix}
& = 1 & 0
0 & 1
\end{matrix}
\end{split}
\end{equation}
```
| https://tex.stackexchange.com/users/nan | Equations in Latex | false |
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
See the definition of functions~$f$ and~$g$, as well as the matrix~$A$ below:
\begin{align*}
f(x) &= a_1 x^2 + \sqrt{b x} - \int_0^4 c \, \mathrm{d}x \\
g(x) &= \dfrac{\mathrm{d}}{\mathrm{d}x} \biggl( \dfrac{b_2^2}{x} \biggr) -
\dfrac{\partial f}{\partial c} \\
A &= \begin{pmatrix}
i_{1,1} & j_{1,2} & k_{1,3} \\
j_{2,1} & k_{2,2} & i_{2,3} \\
k_{3,1} & i_{3,2} & j_{3,3}
\end{pmatrix}
\end{align*}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/5764 | 681340 | 316,124 |
https://tex.stackexchange.com/questions/681329 | 3 | This question partly extends on [this](https://tex.stackexchange.com/questions/88913/how-to-label-or-dimension-a-circle-radius-in-tikz) post.
---
I am using the following command line to rotate a line that I use to dimension the radius of a circle, as mentioned in an answer to [the above mentioned](https://tex.stackexchange.com/questions/88913/how-to-label-or-dimension-a-circle-radius-in-tikz) post:
```
\draw[-latex, rotate around={45:(0,0)}] (0,0) -- (6,0) node [midway,fill=white] {$\text{Text}$};
```
The problem is, I am not using `(6,0)` but a point `(p)` that is calculated with polar coordinates. As soon as I replace `(6,0)` by `(p)`, the rotation doesn't work.
---
How do I workaround the fact that `rotate around` apparently doesn't work for points in polar coordinates?
---
Edit: I added the exact code I used to calculate the point with polar coordinates (it's called `last1`):
```
\documentclass{standalone}
\newcommand{\ts}[1]{\textnormal{#1}}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows,calc,math,angles,quotes,trees,mindmap,through}
%include other needed packages here
\begin{document}
\begin{tikzpicture}
\draw[-latex] (-4,0) -- (4,0) node[right]{$\ts{Re}(r)$};
\draw[-latex](0,-4) -- (0,4) node[above] {$\ts{Im}(r)$};
\def\z{0}
\def\zz{-1.5}
\def\zzz{-5}
\coordinate (last1) at (0:0);
\coordinate (last2) at (0:0);
\coordinate (last3) at (0:0);
\foreach \y in {1,2,3,4,5,6,7,8,9,10,11,12,13,14}
{
\pgfmathsetmacro{\o}{0.05*random(0,1000)};
\pgfmathsetmacro{\t}{0.005*random(0,100)};
\draw[->] (last1) -- ++ (\o*\z:\t) coordinate (last1);
\draw[->] (last2) -- ++ (\o*\zz:\t) coordinate (last2);
\draw[->] (last3) -- ++ (\o*\zzz:\t) coordinate (last3);
};
\node at (0,0) [draw,dotted, circle through={(last1)}] {};
\draw[-latex,line width=0.7mm] (0:0) -- (last3);
\draw[-latex, rotate around={45:(0,0)}] (0,0) -- (last1) node [midway,fill=white] {$\sum |b_{z_1z_2\cdots z_N}|^2 =1$};
\end{tikzpicture}
\end{document}
```
| https://tex.stackexchange.com/users/209759 | Dimensioning the radius of a circle: `rotate around` doesn't work with polar coordinates? | true | I have to admit that it took me a while to get what you mean, so I try to restate it with my own words:
The problem is that `\draw[-latex, rotate around={45:(0,0)}] (0,0) -- (4,0);` would work (the resulting line is rotated by 45 degrees). Similary, `\draw[-latex, rotate around={45:(0,0)}] (0,0) -- (0:4);` would work. But as soon as you replace one of the coordinates of your path with a previously defined coordinate, the transformation does not work anymore. So `\draw[-latex, rotate around={45:(0,0)}] (0,0) -- (last1);` would actually not result in a rotated line, although the coordinate `(last1)` is defined as `(0:<x>)`.
This problem seems to be the same as in [this other question](https://tex.stackexchange.com/q/98924/47927%5D). The reason for this is that the coordinate was defined outside the scope of the transformation (in fact it is not exactly a scoping issue but a feature that applies an inverse transformation on anchor points and which is quite sensible in most cases\*; thanks to Qrrbrbirlbel!). I can actually understand that this behaviour is quite peculiar, at least not directly obvious.
So, what you need to do is to explicitly transform the previously defined coordinate. Since the other coordinate of your path is `(0,0)`, you don't need to transform the rest of the path: You can write `\draw[-latex] (0,0) -- ([rotate=45]last1);` and will get a line rotated by 45 degrees.
```
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[-latex, red, rotate around={10:(0,0)}] (0,0) -- (4,0);
\draw[-latex, magenta, rotate around={20:(0,0)}] (0,0) -- (0:4);
% behaviour not as expected
\coordinate (last1) at (4,0);
\draw[-latex, blue, thick, rotate around={30:(0,0)}] (0,0) -- (last1);
% behaviour not as expected
\coordinate (last2) at (0:4);
\draw[-latex, cyan, rotate around={40:(0,0)}] (0,0) -- (last2);
\coordinate (last3) at (4,0);
\draw[-latex, green] (0,0) -- ([rotate=50]last3);
\coordinate (last4) at (0:4);
\draw[-latex, yellow] (0,0) -- ([rotate=60]last4);
\end{tikzpicture}
\end{document}
```
---
\* See section 106.3.1 "Referencing Anchors of Nodes in the Same Picture" in the [PGF manual](http://mirrors.ctan.org/graphics/pgf/base/doc/pgfmanual.pdf).
| 2 | https://tex.stackexchange.com/users/47927 | 681344 | 316,126 |
https://tex.stackexchange.com/questions/681326 | 3 | I want a symbol as "e", but rotated 180° around its center, so that the new symbol r(e) aligns with the other letters in the text: abgkr(e)etc.
How may this be achieved?
```
\documentclass{article}
\usepackage{rotating}
\begin{document}
e
\begin{rotate}{180}
e
\end{rotate}e
\end{document}
```
| https://tex.stackexchange.com/users/24406 | Rotation of letter which aligns with the text line? | true | An improvement to Sebastiano's fine answer.
The rotated “e” should, in my opinion be sligthly nudged up and a small kern added to the right.
If you look the “be” example, you see that the space between the two letters is larger than between the simply rotated “e” and the “e”.
The other problem is that “e” overshoots the x-height and we need to move it up a bit to compensate.
```
\documentclass{article}
\usepackage{graphicx}
\usepackage{xcolor}% for the leading rules
\DeclareRobustCommand{\schwa}{%
\mbox{%
% nudge up
\raisebox{0.015ex}{%
% rotate
\rotatebox[origin=c]{180}{e}%
}%
% nudge left
\kern0.02em
}%
}
\newcommand{\showrules}{%
\makebox[0pt][l]{\color{red}\vrule width 0.5cm height 0pt depth 0.1pt}%
\makebox[0pt][l]{\color{red}\vrule width 0.5cm height \dimexpr1ex+0.1pt depth -1ex}%
}
\begin{document}
\showrules
e\rotatebox[origin=c]{180}{e}e
\showrules
e\schwa e
\showrules
be
\end{document}
```
Different shifts might be needed with other fonts. Here the same parameters are used with `ebgaramond`.
Here we see that “e” overshoots both the x-height and the baseline; moreover the kerning doesn't seem necessary. With
```
\raisebox{-0.01ex}{...}
```
and no final kern we get
| 7 | https://tex.stackexchange.com/users/4427 | 681348 | 316,127 |
https://tex.stackexchange.com/questions/681346 | 1 | I converted a font some time ago and now there is an update to this font. As the new font files are provided by a different company, there are slight differences, especially with symbols. However I figured out all differences in the glyph positions and set them up accordingly in a modified encoding file. There is a problem however: When I try to access the symbols, e.g. through `\textuparrow` PDFtex tells me:
```
Package textcomp Info: Symbol \textuparrow not provided by
(textcomp) font family MYFONT-TLF in TS1 encoding.
(textcomp) Default family used instead on input line 525.
```
But when I put a simple
```
\DeclareTextSymbolDefault{\textuparrow}{TS1}
\DeclareTextSymbol{\textuparrow}{TS1}{94}
```
in the preamble, PDFtex does not complain anymore.
What am I doing wrong here, what sort of misconception do I have and what can I change to make this work without adding the above code to my MYFONT.sty file as manual definitions? I checked `textcomp.sty` which has this strange `\tc@check@symbol2` in front, is this maybe my issue:
```
\DeclareTextCommandDefault{\textuparrow}%
{\tc@check@symbol2\textuparrow}
```
As `ts1enc.def` just goes straight with:
```
\DeclareTextSymbol{\textuparrow}{TS1}{94}
```
| https://tex.stackexchange.com/users/156791 | Why does textcomp not load the glyph from my font but replaces it? | true | As pointed out in <https://ctan.math.washington.edu/tex-archive/macros/latex/base/ltnews36.pdf> referencing to <https://www.latex-project.org/help/documentation/fntguide.pdf> since 2021/06/01 one must declare which subset of glyphs is contained in a TS1 encoded font.
So based on the respective subset, one can select e.g. `\DeclareEncodingSubset{TS1}{MYFONT-*}{1}` or any other number as appropriate.
| 1 | https://tex.stackexchange.com/users/156791 | 681352 | 316,129 |
https://tex.stackexchange.com/questions/681353 | 1 | This is a coding question (from a low-skill coder). Using `lualatex` compiler on Linux.
TeXlive 2022. Search did not provide useful results.
MWE:
```
\documentclass{article}
\RequirePackage{fontspec}
% Uncomment to see difference:
%\RequirePackage{luatexbase}
%\RequirePackage{polyglossia}
\setmainfont{Latin Modern Roman}
\begin{document}
Hello World.
\end{document}
```
Inspect the mwe.log file. Notice that `fontspec` by itself does not load `luatexbase`.
But file `polyglossia.sty` contains this code:
```
\sys_if_engine_luatex:T{
\RequirePackage{luatexbase} % already included by fontspec, but needed here
\RequireLuaModule{polyglossia}
}
```
Apparently, "already included by fontspec" is incorrect.
Or is there something I do not grasp?
How I discovered this: I have been playing around with code from various packages,
to see what they do. I came across `priority_in_callback` which is in `luatexbase`.
Interestingly, there are other references to `luatexbase` that work, even when
`luatexbase` is not loaded! That is a mystery.
| https://tex.stackexchange.com/users/287367 | polyglossia loads luatexbase | true | That comment was true when written. But post 2015, most of luatexbase was renamed and recoded as ltluatex and included in to the format so fontspec does not need it. All the Lua parts of ltluatex are in a module still called `luatexbase` for compatibilty.
The current `luatexbase` package is re-written to mostly be `ltluatex` which is pre-loaded by the format, but defines a few extra functions for compatibility with the original version of the package.
| 2 | https://tex.stackexchange.com/users/1090 | 681357 | 316,132 |
https://tex.stackexchange.com/questions/681331 | 0 | `\hyperlink{page.#}` seems a little buggy. I tried it with roman page numbers. It worked with `ix` but not with `vii`.
Is there a way to refer to the physical page number , i.e. the one that shows in the counter at the top of the typeset PDF document?
I tried `truepage` but it did not work.
I tried negative numbers (e.g. `{page.-4}`). It did not work either...
| https://tex.stackexchange.com/users/294026 | \hyperlink{page.number} doesn't work all the time | false | You can switch to absolute page numbers, but it's all or nothing. Also, while [plainpages] will link to page ii as 2, it will not link to page 2 as 6.
```
\documentclass{book}
\usepackage[hypertexnames=false]{hyperref}
\usepackage{lipsum}
\makeatletter
\newcommand\abspagenumber{\the\Hy@pagecounter}
\makeatother
\begin{document}
\frontmatter
\hyperlink{page.2}{Go to page 2}
\hyperlink{page.6}{Go to page 6}
\lipsum[1-20]
\mainmatter
\abspagenumber
\lipsum[1-20]
\end{document}
```
---
This gives you the option of linking to `\thepage` or `\theHpage` (absolute).
```
\documentclass{book}
\usepackage{hyperref}
\usepackage{lipsum}
\newcounter{Hpage}
\AddToHook{shipout/after}{\raisebox{\dimexpr \headheight+\headsep}[0pt][0pt]{\refstepcounter{Hpage}}}
\setcounter{Hpage}{1}
\begin{document}
\frontmatter
\hyperlink{page.2}{Go to page 2}
\hyperlink{page.ii}{Go to page ii}
\hyperlink{Hpage.2}{Go to Hpage 2}
\hyperlink{Hpage.6}{Go to Hpage 6}
\lipsum[1-20]
\mainmatter
\lipsum[1-20]
\end{document}
```
| 1 | https://tex.stackexchange.com/users/34505 | 681365 | 316,135 |
https://tex.stackexchange.com/questions/681364 | 3 | I got it from [overleaf](https://www.overleaf.com/learn/latex/Multi-file_LaTeX_projects#The_subfiles_package) that the `subfiles` package is best loaded last in the preamble.
Besides, it is known that hyperref is recommended to loaded last too. In another [answer](https://tex.stackexchange.com/a/53193/292473), I got that
>
> Load `varioref` first, then `hyperref`, then `cleveref`
>
>
>
so what's the best or recommended order to load these packages mentioned above?
| https://tex.stackexchange.com/users/292473 | The best/correct order of loading hyperref, cleverref and subfiles packages | true | Recommended order for the packages you mentioned:
`Subfiles` - This package should be loaded first. It is designed to help manage multi-file LaTeX documents by allowing you to compile each file individually as well as the main document as a whole. So it's generally a good idea to load the subfiles package first so that it can properly handle any subfiles included in the document.
In addition, subfiles doesn't typically interact with the other packages you mentioned (cleveref, hyperref, and varioref), so its position in the loading order should not affect their behavior.
If you are using subfiles to manage a multi-file document, it is important to load it before any packages that modify the way files are included or referenced, such as `xr` or `import`.
`Varioref` - This package should be loaded first, as it modifies the way LaTeX handles cross-referencing.
`Hyperref` - This package should be loaded after varioref, as it also modifies cross-referencing and creates hyperlinks in the document. It is normally loaded last, but due to cleveref it is not.
`Cleveref` - This package should be loaded last, as it depends on both varioref and hyperref. It provides additional features for cross-referencing, such as automatic formatting of reference types.
If you look at the [`cleveref` guide](http://tug.ctan.org/tex-archive/macros/latex/contrib/cleveref/cleveref.pdf#page=25):
>
> The following are not bugs. They are either intentional behaviour, unavoidable
> behaviour, or are caused by LATEX misunderstandings:
> • If you are using both varioref and hyperref, make sure you are loading
> them in the correct order, otherwise cross-references will reference completely
> the wrong thing without any warning in the LATEX output or log! The packages must be loaded in the following order: varioref, hyperref, cleveref.
>
>
>
>
| 2 | https://tex.stackexchange.com/users/287391 | 681366 | 316,136 |
https://tex.stackexchange.com/questions/681374 | 1 | I'm trying to create my own beamer theme and am failing at something probably simple. Unfortunately, I can't figure it out at all and hope that someone has a solution for me.
As you can see from the title, it's about the cover image of a beamer theme that I want to create myself.
In beamerinnertheme.sty I have already specified, with the help of the community here, that a default image is taken if no title image has been chosen.
But now I would like to add to the code or have the option of selecting a title image in the presentation.tex file, which is automatically adapted to the frame and of course also to the selected aspectratio.
In other words, in the presentation.tex e.g.. For example, the command:
`\titlepicture{file}`
and it automatically appears in the right place via innertheme.
```
\documentclass[10pt,%
aspectratio=1609,%
]{beamer}
\usepackage {mwe}
\usepackage{tikz}
\usepackage{xcolor}
\title{TITLE}
\author{NAME}
\institute{INSTITUT}
\date{DATE}
%\titlegraphic{example-image-a}
%beamertheme.sty
\setbeamertemplate{navigation symbols}{}
%beamercolortheme.sty
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{structure}{fg=white}
\setbeamercolor*{section in toc}{fg=gray}
\setbeamercolor*{framtitle}{fg=white}
\setbeamercolor*{section}{fg=white}
\setbeamercolor*{normal text}{fg=gray}
\setbeamercolor*{foot}{fg=gray,bg=white}
\setbeamercolor*{title}{fg=white}
\setbeamercolor*{title page header}{fg=white}
%beamerinnertheme.sty
\defbeamertemplate*{title page}{test}[1][]
{
\begin{tikzpicture}[remember picture,overlay]
\node[fill=blue,minimum height=1cm,text width=\paperwidth] at ([yshift=2.5cm]current page.south) {\hspace{4cm}\usebeamerfont{title}\inserttitle};
\fill[color=green] (current page.south west) rectangle ++(2.95,1.9);
\node[fill=red,minimum height=1.9cm,text width=\paperwidth-6.5cm] at ([yshift=0.95cm]current page.south) {\hspace{0.9cm}\usebeamerfont{author}\insertauthor\par\vskip0.1cm \hspace{0.9cm}\usebeamerfont{author}\insertdate};
\node[anchor=south east, inner sep =0.1cm] at (current page.south east) {\includegraphics[width=2.8cm]{example-image-b}};
\ifx\inserttitlegraphic\empty%
\node[anchor=south, inner sep=0cm] at ([yshift=3cm]current page.south) {\includegraphics[width=\paperwidth]{example-image-16x9}};
\fi
\end{tikzpicture}
}
\begin{document}
\begin{frame}[plain]
\titlepage
\end{frame}
\section{Sec 1}
\begin{frame}{Title}
\blindtext
\end{frame}
\section{Sec 2}
\begin{frame}{Title 2}
\framesubtitle{Subtitle}
\blindtext
\end{frame}
\end{document}
```
| https://tex.stackexchange.com/users/293851 | Automatically adjust title image in beamer (beamerinnertheme.sty) | true | With `\ifx\inserttitlegraphic\empty` you are already testing if your user set the `\titlegraphic` macro. You can use the else branch of this test to replace your default image with the image chosen by the user.
I would not automatically adapt the aspect ratio. In almost all cases this will distort the image. Let the user decide how big they want their image to be.
```
\documentclass[10pt,%
aspectratio=1609,%
]{beamer}
\usepackage{mwe}
\usepackage{tikz}
%\usepackage{xcolor}
\title{TITLE}
\author{NAME}
\institute{INSTITUT}
\date{DATE}
\titlegraphic{\includegraphics[width=\paperwidth]{example-image-duck}}
%beamertheme.sty
\setbeamertemplate{navigation symbols}{}
%beamercolortheme.sty
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{structure}{fg=white}
\setbeamercolor*{section in toc}{fg=gray}
\setbeamercolor*{framtitle}{fg=white}
\setbeamercolor*{section}{fg=white}
\setbeamercolor*{normal text}{fg=gray}
\setbeamercolor*{foot}{fg=gray,bg=white}
\setbeamercolor*{title}{fg=white}
\setbeamercolor*{title page header}{fg=white}
%beamerinnertheme.sty
\defbeamertemplate*{title page}{test}[1][]
{
\begin{tikzpicture}[remember picture,overlay]
\node[fill=blue,minimum height=1cm,text width=\paperwidth] at ([yshift=2.5cm]current page.south) {\hspace{4cm}\usebeamerfont{title}\inserttitle};
\fill[color=green] (current page.south west) rectangle ++(2.95,1.9);
\node[fill=red,minimum height=1.9cm,text width=\paperwidth-6.5cm] at ([yshift=0.95cm]current page.south) {\hspace{0.9cm}\usebeamerfont{author}\insertauthor\par\vskip0.1cm \hspace{0.9cm}\usebeamerfont{author}\insertdate};
\node[anchor=south east, inner sep =0.1cm] at (current page.south east) {\includegraphics[width=2.8cm]{example-image-b}};
\ifx\inserttitlegraphic\empty%
\node[anchor=south, inner sep=0cm] at ([yshift=3cm]current page.south) {\includegraphics[width=\paperwidth]{example-image-16x9}};
\else
\node[anchor=south, inner sep=0cm] at ([yshift=3cm]current page.south) {\inserttitlegraphic};
\fi
\end{tikzpicture}
}
\begin{document}
\begin{frame}[plain]
\titlepage
\end{frame}
\section{Sec 1}
\begin{frame}{Title}
\blindtext
\end{frame}
\section{Sec 2}
\begin{frame}{Title 2}
\framesubtitle{Subtitle}
\blindtext
\end{frame}
\end{document}
```
Alternatively if you want to clip the image so that you see the centre of the image:
```
\documentclass[10pt,%
aspectratio=1609,%
]{beamer}
\usepackage{mwe}
\usepackage{tikz}
%\usepackage{xcolor}
\title{TITLE}
\author{NAME}
\institute{INSTITUT}
\date{DATE}
\titlegraphic{\includegraphics[width=\paperwidth]{example-image-duck}}
%beamertheme.sty
\setbeamertemplate{navigation symbols}{}
%beamercolortheme.sty
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{structure}{fg=white}
\setbeamercolor*{section in toc}{fg=gray}
\setbeamercolor*{framtitle}{fg=white}
\setbeamercolor*{section}{fg=white}
\setbeamercolor*{normal text}{fg=gray}
\setbeamercolor*{foot}{fg=gray,bg=white}
\setbeamercolor*{title}{fg=white}
\setbeamercolor*{title page header}{fg=white}
%beamerinnertheme.sty
\defbeamertemplate*{title page}{test}[1][]
{
\begin{tikzpicture}[remember picture,overlay]
\node[fill=blue,minimum height=1cm,text width=\paperwidth] at ([yshift=2.5cm]current page.south) {\hspace{4cm}\usebeamerfont{title}\inserttitle};
\fill[color=green] (current page.south west) rectangle ++(2.95,1.9);
\node[fill=red,minimum height=1.9cm,text width=\paperwidth-6.5cm] at ([yshift=0.95cm]current page.south) {\hspace{0.9cm}\usebeamerfont{author}\insertauthor\par\vskip0.1cm \hspace{0.9cm}\usebeamerfont{author}\insertdate};
\node[anchor=south east, inner sep =0.1cm] at (current page.south east) {\includegraphics[width=2.8cm]{example-image-b}};
\begin{scope}
\clip ([yshift=3cm]current page.south west) rectangle (current page.north east);
\ifx\inserttitlegraphic\empty%
\node[anchor=south, inner sep=0cm] at ([yshift=3cm]current page.south) {\includegraphics[width=\paperwidth]{example-image-16x9}};
\else
\node[inner sep=0cm] at ([yshift=1.5cm]current page.center) {\inserttitlegraphic};
\fi
\end{scope}
\end{tikzpicture}
}
\begin{document}
\begin{frame}[plain]
\titlepage
\end{frame}
\section{Sec 1}
\begin{frame}{Title}
\blindtext
\end{frame}
\section{Sec 2}
\begin{frame}{Title 2}
\framesubtitle{Subtitle}
\blindtext
\end{frame}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/36296 | 681379 | 316,142 |
https://tex.stackexchange.com/questions/681376 | 1 | The package hf-tikz is great for putting a frame around an equation. Although I am not absolutely sure there seems to be a "new" error massage when using this package: "Missing character: There is no ; in font nullfont!"
I stripped my complex beamer-file down to actually a minimal LaTeX-file which also gives the error message:
```
\documentclass{article}
\usepackage{hf-tikz}
% \font\nullfont=cmr10
\begin{document}
\begin{displaymath}
\tikzmarkin{eq}
c^2 = a^2+b^2
\tikzmarkend{eq}
\end{displaymath}
\end{document}
```
The resulting PDF-file is ok with no errors, but the error message makes me a bit nervous because the question is always what happens after the next update? My system is a MINT Linux 21.1 with an underlying Ubuntu 22.04 and a full installation of Texlive 2022.
If I uncomment the line "% \font\nullfont=cmr10" a semicolon appears at the end of the coloured box. From other postings about the "Missing character..." error message I learned that setting the nullfont to a visible font allows to find the error in the underlying LaTeX code. It seems that there is an error in the package hf-tikz or that the syntax of tikz has changed a little bit and the older package hf-tikz has not been adapted to these changes.
Any idea how to overcome the problem?
| https://tex.stackexchange.com/users/294065 | LaTeX-Package hf-tikz: Error message "Missing character: There is no ; in font nullfont!" | true | In this case the message is harmless. It was always in the log but appears now also on the terminal because `\tracinglostchars` has been set to 2 in a current LaTeX.
But it would be better if hf-tikz would avoid it by delimiting the `\tikz` arguments by braces instead of using the semicolon syntax, as with it there is always the danger to end up with one stray semicolon too much:
```
\documentclass{article}
\usepackage{hf-tikz}
\renewcommand\tikzmarkend[2][]{%
\tikz[remember picture with id=#2]{#1}} %{#1} instead of #1;
\begin{document}
\begin{displaymath}
\tikzmarkin{eq}
c^2 = a^2+b^2
\tikzmarkend{eq}
\end{displaymath}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/2388 | 681380 | 316,143 |
https://tex.stackexchange.com/questions/681384 | 5 | I am co-writing a paper in linguistics on Overleaf. When I download the tex-file and try to compile it locally on the computer (Editor Winedt), I get an error mistake that is not present in Overleaf, where everything compiles correctly. It is clearly related to an `equation` environment inside a `figure`. I do not manage to find a solution.
Here's a relatively minimal working example. The error message is :
```
! Missing $ inserted.
<inserted text>
```
---
```
\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[normalem]{ulem}
\usepackage{booktabs}
\usepackage{amsmath}
\begin{document}
Some text
\begin{figure} \centering
\caption{A feature bundle on C$^0$}
\vspace{0,5cm}
\label{lex}
\begin{equation*}
\left ( \begin{array}{lll} \textrm{C$^0$[Fin], [EPP]} & [Focus] & [Topic] \\ & [Contrastive] & [Contrastive] \\ & [Mirative] & [Shifting] \\ & [\ldots] & [\ldots]
\end{array}
\right )
\end{equation*}
\vspace{0,5cm}
\end{figure}
\end{document}
```
| https://tex.stackexchange.com/users/234365 | Problem with equation inside figure | true | As @samcarter\_is\_at\_topanswers.xyz has already noted in a comment, blank lines aren't allowed in a display math environment. The fact that your test document supposedly compiles successfully on Overleaf is almost certainly due to Overleaf doing an excellent [!] job hiding LaTeX warning and other messages from users.
I'd go further than just eliminate the blank lines, though. Specifically, I'd (a) use inline math mode instead of display math mode and (b) employ a `tabular` environment instead of an `array` environment because the words in the 4x3 array should be typeset in text mode, not math mode.
A separate issue: Is it essential that the tabular/array material be surrounded by round parentheses? Would simple vertical lines on either side of the tabular/array material do just a well? If so, you could get rid of the math-y setup entirely and replace `\begin{tabular}{lll}` with `\begin{tabular}{|lll|}`, as is demonstrated in the lower half of the following screenshot. (For that matter, does the table really need to be surrounded by either parentheses or vertical lines?)
```
\documentclass{article}
\usepackage[english]{babel}
%\usepackage[utf8]{inputenc} % that's the default nowadays
\usepackage[T1]{fontenc}
\usepackage[normalem]{ulem}
\usepackage{booktabs}
\usepackage{amsmath}
\begin{document}
Some text\dots
\begin{figure}[h]
\centering
\caption{A feature bundle on $C^0$}\label{lex}
\vspace*{5mm}
%% a 'tabular' env. flanked by tall math-mode parentheses
$\left(
\begin{tabular}{lll}
$C^0$[Fin], [EPP] & [Focus] & [Topic] \\
& [Contrastive] & [Contrastive] \\
& [Mirative] & [Shifting] \\
& [\ldots] & [\ldots] \\
\end{tabular}
\right)$
\vspace*{0.5cm}
%% just a 'tabular' env. flanked by vertical bars
\begin{tabular}{|lll|}
$C^0$[Fin], [EPP] & [Focus] & [Topic] \\
& [Contrastive] & [Contrastive] \\
& [Mirative] & [Shifting] \\
& [\ldots] & [\ldots] \\
\end{tabular}
\end{figure}
Some more text\dots
\end{document}
```
| 7 | https://tex.stackexchange.com/users/5001 | 681385 | 316,144 |
https://tex.stackexchange.com/questions/385399 | 1 | I am trying to draw a Cayley graph for Z\_8 and need some arrows.
My problems :
1. The names of nodes come exactly on the coordinators, is there a way of setting it to appear beside the coordinator not on it. Or, how can I move it manually up and down?
2. Because I fullback the nodes, the tips of arrows don't appear clearly. How can I solve it, even If I had to put the tip in the middle of the arrow.
I appreciate any help or suggestions.
MWE:
```
\documentclass[12pt,letter]{article}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,positioning,mindmap,trees,automata}
\usepackage{amsfonts,amsmath,amsthm,epsf,graphics,verbatim,amssymb,amscd,eucal,bbm}
\newcommand{\Z}{{\mathbb Z}}
\begin{document}
\begin{figure}[h]
\begin{center}
\begin{tikzpicture}[line width=2pt]
%\draw [blue](2,.5) -- (3,.5) ; \draw [blue](-2,.5) -- (-3,.5) ;
%
% \draw[style1] (0,0) -- ++( 1,0) coordinate (x);
%\draw[style2] (x) -- ++( 0,1) coordinate (x);
%\draw[style3] (x) -- ++(-1,0);
%
\draw[->,thick] (-1,1.8) -- (-2,.5);
\draw[->,thick, dashed](1,1.8) -- (2,.5){};
%\draw[bend right,->,thin] (1) to node [sloped,below] {$\mu(b)$} (3);
%\draw[bend right,->,thin] (1) to node [sloped,above] {$\mu(a)$} (4);
%
\node (A) at (-1,1.8) {\;\;0};
\node (B) at (1,1.8) {\;\;1};
\draw[bend left,->,thin] (A) to node [auto] {} (B);
% \draw[->, to path={-| (\tikztotarget)}]
(A) edge (B);% (B) edge (C) (C) edge (D);
\draw[fill=black] (-1,1.8) circle (0.1) ;
\draw[fill=black] (1,1.8) circle (0.1) ;
\draw[fill=black] (-2,.5) circle (0.1) ;
\draw[fill=black] (-2,-.8) circle (0.1) ;
\draw[fill=black] (2,.5) circle (0.1) ;
\draw[fill=black] (2,-.8) circle (0.1) ;
\draw[fill=black] (-1,-2.1) circle (0.1) ;
\draw[fill=black] (1,-2.1) circle (0.1) ;
\end{tikzpicture}
\end{center}
\caption{Cayley graphs on $\Z_8$ with generators set: $\{2,3\}$}
\label{polya Z^2}
\end{figure}
\end{document}
```
| https://tex.stackexchange.com/users/140910 | How to move nodes's names and emphasize arrow tips? | false | Using proper nodes of style `dot` you can put circles on the paper and connecting lines will automatically stop at their border – that's the point of nodes.
A `label` which is just another node can be placed in relation to that node.
```
%\documentclass[12pt, tikz]{standalone}
\documentclass[12pt, letter]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[
line width=2pt,
dot/.style={circle, inner sep=+0pt, draw, fill, minimum size=+2mm}
]
\foreach \i in {0, ..., 3}
\foreach[
count=\jj from 0,
evaluate={\n=int(2*\i+\jj);},
] \j in {25, 65}
\node[dot, label={[circle,inner sep=+.15em]\j+90*\i:$\n$}]
(n-\n) at (\j+90*\i:2) {};
\path (n-0) edge[dashed] (n-1)
(n-2) edge (n-3)
edge[->, bend left=45] (n-1)
;
\end{tikzpicture}
\end{document}
```
Output
------
| 2 | https://tex.stackexchange.com/users/16595 | 681387 | 316,146 |
https://tex.stackexchange.com/questions/74254 | 17 | I'm using `moderncv` to write my CV. I'm using the `classic` style and I want to add a second e-mail address. It doesn't work if I simply do that:
```
\mail{email1}
\mail{email2}
```
Is there a way to do it?
| https://tex.stackexchange.com/users/19218 | How to add a second e-mail address with moderncv | false | As result of merging [p4bl0's](https://tex.stackexchange.com/a/339992/225691) and [Jens Laursen's](https://tex.stackexchange.com/a/163969/225691) answers, I wrote the following code.
```
\let\myemaillink\emaillink
\let\myemailsymbol\emailsymbol
\renewcommand{\emaillink}[1]{#1}
\renewcommand{\emailsymbol}{}
\email{
\myemailsymbol \myemaillink{parsa.mohammadian@sharif.edu}
or
\myemailsymbol \myemaillink{parsa2820@gmail.com}
}
```
This fixes [Jens Laursen's](https://tex.stackexchange.com/a/163969/225691) answer problem mentioned by [Tirtha R](https://tex.stackexchange.com/users/175027/tirtha-r) in comments.
| 0 | https://tex.stackexchange.com/users/225691 | 681388 | 316,147 |
https://tex.stackexchange.com/questions/681384 | 5 | I am co-writing a paper in linguistics on Overleaf. When I download the tex-file and try to compile it locally on the computer (Editor Winedt), I get an error mistake that is not present in Overleaf, where everything compiles correctly. It is clearly related to an `equation` environment inside a `figure`. I do not manage to find a solution.
Here's a relatively minimal working example. The error message is :
```
! Missing $ inserted.
<inserted text>
```
---
```
\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[normalem]{ulem}
\usepackage{booktabs}
\usepackage{amsmath}
\begin{document}
Some text
\begin{figure} \centering
\caption{A feature bundle on C$^0$}
\vspace{0,5cm}
\label{lex}
\begin{equation*}
\left ( \begin{array}{lll} \textrm{C$^0$[Fin], [EPP]} & [Focus] & [Topic] \\ & [Contrastive] & [Contrastive] \\ & [Mirative] & [Shifting] \\ & [\ldots] & [\ldots]
\end{array}
\right )
\end{equation*}
\vspace{0,5cm}
\end{figure}
\end{document}
```
| https://tex.stackexchange.com/users/234365 | Problem with equation inside figure | false | Define your own environment.
Also, if you want the caption above the material, tell LaTeX so, rather than adding random spaces.
```
\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[normalem]{ulem}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{caption}
\captionsetup[figure]{position=top}
\newenvironment{ptabular}
{$\left(\hspace{-\tabcolsep}\tabular}{\endtabular\hspace{-\tabcolsep}\right)$}
\begin{document}
Some text
\begin{figure}[htp]
\centering
\caption{A feature bundle on C$^0$}
\label{lex}
\begin{ptabular}{lll}
C$^0$[Fin], [EPP] & [Focus] & [Topic] \\
\addlinespace
& [Contrastive] & [Contrastive] \\
\addlinespace
& [Mirative] & [Shifting] \\
\addlinespace
& [\ldots] & [\ldots]
\end{ptabular}
\end{figure}
Some other text
\end{document}
```
| 4 | https://tex.stackexchange.com/users/4427 | 681398 | 316,153 |
https://tex.stackexchange.com/questions/681400 | 1 | In a beamer presentation I am using `\footcite{}` in order to give some citations. Unfortunately, I have recognised the following problem which I am not able to solve:
I have a slide containing multiple overlays and only a single citation, i.e.
```
\begin{frame}
\frametitle{<Title>}
\visible<1->{
Some text with a citation\footcite{citekey}
}
\visible<2->{ Some more text whithout a citation
}
\visible<3>{
again some more text
}
\end{frame}
```
When I look at the slides I have the following citation in the first overlay:
>
> CITENUMBER AUTHOR “TITLE”. In: BOOK, Page..
>
>
>
The Authors and the title of the book are highlighted in blendedblue (beamer standard).
But on the next overlay (i.e. same slide) I only have
>
> CITENUMBER AUTHOR “TITLE”
>
>
>
and nothing is highlighted in blendedblue here.
So, any idea how to ensure that citations are equal on every overlay?
| https://tex.stackexchange.com/users/294085 | Beamer \foocite{} and multiple overlays leads to multiple citation styles | true | You can avoid the problem by using `\footfullcite` instead of `\footcite`. This will ensure that biblatex will always print the full citation.
```
\documentclass{beamer}
\usepackage[style=verbose]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\begin{frame}
\frametitle{Title}
\visible<1->{
Some text with a citation\footfullcite{knuth:ct}
}
\visible<2->{ Some more text whithout a citation
}
\visible<3>{
again some more text
}
\end{frame}
\end{document}
```
---
Alternatively you could switch off the `citetracker`:
```
\documentclass{beamer}
\usepackage[style=verbose,citetracker=false]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\begin{frame}
\frametitle{Title}
\visible<1->{
Some text with a citation\footcite{knuth:ct}
}
\visible<2->{ Some more text whithout a citation
}
\visible<3>{
again some more text
}
\end{frame}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/36296 | 681402 | 316,155 |
https://tex.stackexchange.com/questions/86650 | 63 | I am using `\columns` in `beamer` to show two pictures. After I added `\footnote{ExampleText}` after captions, the `ExampleTest` just appear in each column. Now I want to show all of the `ExampleText` in the bottom of the slide instead of each column, how can I do this?
MWE:
```
\documentclass{beamer}
\usepackage{graphicx}
\begin{document}
\begin{frame}
\begin{columns}
\begin{column}{.5\textwidth}
\includegraphics{img1}\footnote{f2}
\end{column}
\begin{column}{.5\textwidth}
\includegraphics{img2}\footnote{f1}
\end{column}
\end{columns}
\end{frame}
\end{document}
```
| https://tex.stackexchange.com/users/13009 | How to display the footnote in the bottom of the slide while using \columns? | false | I had the same problem, and I'm using pandoc so I wanted the solution to work by default on all footnotes with a `renewcommand` (just as asked by @jadelord in a comment below @andreas post). But it is nothing simple, because of all the layers that beamer adds to `footnote` and `renewcommand` in order to manage overlay specifications (and pandoc sends an overlay specification to `footnote`). Ideally, the pandoc code should be updated. The only solution I found is to copy/paste the `footnote` `renewcommand` from beamer source code and force the `frame` option. Here is my code for the record.
```
\makeatletter
\renewcommand<>{\footnote}[1][]{%
\let\beamer@footnotetext=\@footnotetext%
\let\beamer@mpfn=\@mpfn%
\let\beamer@thempfn=\thempfn%
\let\beamer@kvorig=\KV@errx%
\let\beamer@xkvorig=\XKV@err
\def\beamer@footarg{}%
\def\KV@errx##1{\edef\beamer@footarg{\@tempa}}%
\def\XKV@err##1{\edef\beamer@footarg{\XKV@tkey}}%
\setkeys{beamerfootnote}{frame}%
\let\KV@errx=\beamer@kvorig%
\let\XKV@errx=\beamer@xkvorig
\ifx\beamer@footarg\@empty%
\def\beamer@next{\stepcounter\beamer@mpfn
\protected@xdef\@thefnmark{\beamer@thempfn}%
\@footnotemark\beamer@footnotetext#2}%
\else%
\def\beamer@next{%
\begingroup
\csname c@\beamer@mpfn\endcsname\beamer@footarg\relax
\unrestored@protected@xdef\@thefnmark{\beamer@thempfn}%
\endgroup
\@footnotemark\beamer@footnotetext#2}%
\fi%
\beamer@next}
\makeatother
```
| 0 | https://tex.stackexchange.com/users/294086 | 681403 | 316,156 |
https://tex.stackexchange.com/questions/681399 | 1 | It's about putting the finishing touches on my own beamer theme. I have more or less halfway managed to create a design for the beameroutertheme.sty, but it has shifted in comparison to the innertheme. I would like to have the spacing of the red bar and the logo aligned as it is on the front page (in terms of length). Unfortunately, any attempts to change it always destroy the design. Unfortunately, I have very little or hardly any experience with tikz and it is only thanks to the community here that I have come this far.
```
\documentclass[10pt,%
aspectratio=169,%
]{beamer}
\usepackage {mwe}
\usepackage{tikz}
\usepackage{xcolor}
\title{TITLE}
\author{NAME}
\institute{INSTITUT}
\date{DATE}
%\titlegraphic{\includegraphics[width=\paperwidth]{example-image-duck}}
%beamertheme.sty
\usetikzlibrary{shapes}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}{
\begin{beamercolorbox}[wd=\paperwidth, ht=2em, dp = 1em]{foot}
\hspace*{1em}
{\normalsize \inserttitle}\hfill{\normalsize \insertauthor, \insertdate} \hfill{\normalsize \insertpagenumber}
\hspace*{1em}
\end{beamercolorbox}}
%beamercolortheme.sty
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{structure}{fg=white}
\setbeamercolor*{section in toc}{fg=gray}
\setbeamercolor*{framtitle}{fg=white}
\setbeamercolor*{section}{fg=white}
\setbeamercolor*{normal text}{fg=gray}
\setbeamercolor*{foot}{fg=gray,bg=white}
\setbeamercolor*{title}{fg=white}
\setbeamercolor*{title page header}{fg=white}
%beamerinnertheme.sty
\defbeamertemplate*{title page}{test}[1][]
{
\begin{tikzpicture}[remember picture,overlay]
\node[fill=blue,minimum height=1cm,text width=\paperwidth] at ([yshift=2.5cm]current page.south) {\hspace{4cm}\usebeamerfont{title}\inserttitle};
\fill[color=green] (current page.south west) rectangle ++(2.95,1.9);
\node[fill=red,minimum height=1.9cm,text width=\paperwidth-6.5cm] at ([yshift=0.95cm]current page.south) {\hspace{0.9cm}\usebeamerfont{author}\insertauthor\par\vskip0.1cm \hspace{0.9cm}\usebeamerfont{author}\insertdate};
\node[anchor=south east, inner sep =0.1cm] at (current page.south east) {\includegraphics[width=2.8cm]{example-image-b}};
\begin{scope}
\clip ([yshift=3cm]current page.south west) rectangle (current page.north east);
\ifx\inserttitlegraphic\empty%
\node[anchor=south, inner sep=0cm] at ([yshift=3cm]current page.south) {\includegraphics[width=\paperwidth]{example-image-16x9}};
\else
\node[inner sep=0cm] at ([yshift=1.5cm]current page.center) {\inserttitlegraphic};
\fi
\end{scope}
\end{tikzpicture}
}
%beameroutertheme.sty
\defbeamertemplate*{frametitle}{test}[1][]
{
\begin{beamercolorbox}[wd=\paperwidth,ht=1.2cm]{frametitle}
\begin{tikzpicture}
\useasboundingbox[fill=white](0,0) rectangle(\the\paperwidth,1.2);
\fill[color=green] (0,0) rectangle(2.95,1.1); %5.2 old
\fill[color=red] (3.05,0) rectangle(\the\paperwidth-100,1.1);
% \fill[red] (3.05,1.15) rectangle(\the\paperwidth,0.8);
\ifx\insertframesubtitle\@empty%
{\node at (\the\paperwidth-50,0.61){\includegraphics[width=2.8cm]{example-image-b}};%
\node[anchor=west, white,font=\large] at (3.2,0.55){\insertframetitle};}%
\else%
{\node at (\the\paperwidth-50,0.61){\includegraphics[width=2.8cm]{example-image-b}};%
\node[anchor= west, white,font=\large] at (3.2,0.75){\insertframetitle};%
\node[anchor= west, white,font=\small] at (3.2,0.35){\insertframesubtitle};}%
\fi
\end{tikzpicture}
\end{beamercolorbox}
}
\setbeamertemplate{headline}{%
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=5.2ex,dp=0.125ex]{palette}%
\insertsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll}
\end{beamercolorbox}%
}
}
\setbeamertemplate{section in head/foot}{%
\if\insertsectionheadnumber1
\tikz\node[draw=blue,fill=blue,shape=signal,very thick,text=white]{\insertsectionhead\hskip.3cm};
\else
\tikz\node[draw=blue,fill=blue,shape=signal,signal from=west, signal to=east,very thick,text=white] {\insertsectionhead\hskip.3cm};
\fi
}
\setbeamertemplate{section in head/foot shaded}{%
\if\insertsectionheadnumber1
\tikz\node[draw=blue,fill=white,shape=signal,very thick,text=blue]{\insertsectionhead\hskip.3cm};
\else
\tikz\node[draw=blue,fill=white,shape=signal,signal from=west, signal to=east,very thick,text=blue] {\insertsectionhead\hskip.3cm};
\fi
}
%End of beameroutertheme
\begin{document}
\begin{frame}[plain]
\titlepage
\end{frame}
\section{Sec 1}
\begin{frame}{Title}
\blindtext
\end{frame}
\section{Sec 2}
\begin{frame}{Title 2}
\framesubtitle{Subtitle}
\blindtext
\end{frame}
\end{document}
```
| https://tex.stackexchange.com/users/293851 | Adapting the beameroutertheme to the beamerinnertheme | true |
```
\documentclass[10pt,%
aspectratio=169,%
]{beamer}
\usepackage {mwe}
\usepackage{tikz}
\usepackage{xcolor}
\title{TITLE}
\author{NAME}
\institute{INSTITUT}
\date{DATE}
%\titlegraphic{\includegraphics[width=\paperwidth]{example-image-duck}}
%beamertheme.sty
\usetikzlibrary{shapes}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}{
\begin{beamercolorbox}[wd=\paperwidth, ht=2em, dp = 1em]{foot}
\hspace*{1em}
{\normalsize \inserttitle}\hfill{\normalsize \insertauthor, \insertdate} \hfill{\normalsize \insertpagenumber}
\hspace*{1em}
\end{beamercolorbox}}
%beamercolortheme.sty
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{structure}{fg=white}
\setbeamercolor*{section in toc}{fg=gray}
\setbeamercolor*{framtitle}{fg=white}
\setbeamercolor*{section}{fg=white}
\setbeamercolor*{normal text}{fg=gray}
\setbeamercolor*{foot}{fg=gray,bg=white}
\setbeamercolor*{title}{fg=white}
\setbeamercolor*{title page header}{fg=white}
\setbeamerfont{frametitle}{size=\large}
\setbeamerfont{framesubtitle}{size=\small}
%beamerinnertheme.sty
\defbeamertemplate*{title page}{test}[1][]
{
\begin{tikzpicture}[remember picture,overlay,inner sep=0pt,outer sep=0pt]
\node[fill=blue,minimum height=1cm,text width=\paperwidth] at ([yshift=2.5cm]current page.south) {\hspace{4cm}\usebeamerfont{title}\inserttitle};
\fill[color=green] (current page.south west) rectangle ++(2.95,1.9);
\node[fill=red,minimum height=1.9cm,text width=\paperwidth-6.3cm] at ([yshift=0.95cm]current page.south) {\hspace{0.9cm}\usebeamerfont{author}\insertauthor\par\vskip0.1cm \hspace{0.9cm}\usebeamerfont{author}\insertdate};
\node[anchor=south east, inner sep =0.1cm] at (current page.south east) {\includegraphics[width=2.8cm]{example-image-b}};
\begin{scope}
\clip ([yshift=3cm]current page.south west) rectangle (current page.north east);
\ifx\inserttitlegraphic\empty%
\node[anchor=south, inner sep=0cm] at ([yshift=3cm]current page.south) {\includegraphics[width=\paperwidth]{example-image-16x9}};
\else
\node[inner sep=0cm] at ([yshift=1.5cm]current page.center) {\inserttitlegraphic};
\fi
\end{scope}
\end{tikzpicture}
}
%beameroutertheme.sty
\defbeamertemplate*{frametitle}{weincampus}[1][]
{
\begin{tikzpicture}[remember picture,overlay,inner sep=0pt,outer sep=0pt]
\fill[color=green] ([yshift=-1.7cm]current page.north west) rectangle ++(2.95,1.2);
\node[fill=red,minimum height=1.2cm,text width=\paperwidth-6.3cm] at ([yshift=-1.1cm]current page.north) {\hspace{0.9cm}\usebeamerfont{frametitle}\insertframetitle\par
\hspace{0.9cm}\usebeamerfont{framesubtitle}\insertframesubtitle};
\node[anchor=north east, inner sep =0.1cm] at (current page.north east) {\includegraphics[width=2.8cm]{example-image-b}};
\end{tikzpicture}
\vskip1.2cm
}
\setbeamertemplate{headline}{%
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=5.2ex,dp=0.125ex]{palette}%
\insertsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll}
\end{beamercolorbox}%
}
}
\setbeamertemplate{section in head/foot}{%
\if\insertsectionheadnumber1
\tikz\node[draw=blue,fill=blue,shape=signal,very thick,text=white]{\insertsectionhead\hskip.3cm};
\else
\tikz\node[draw=blue,fill=blue,shape=signal,signal from=west, signal to=east,very thick,text=white] {\insertsectionhead\hskip.3cm};
\fi
}
\setbeamertemplate{section in head/foot shaded}{%
\if\insertsectionheadnumber1
\tikz\node[draw=blue,fill=white,shape=signal,very thick,text=blue]{\insertsectionhead\hskip.3cm};
\else
\tikz\node[draw=blue,fill=white,shape=signal,signal from=west, signal to=east,very thick,text=blue] {\insertsectionhead\hskip.3cm};
\fi
}
%End of beameroutertheme
\begin{document}
\begin{frame}[plain]
\titlepage
\end{frame}
\section{Sec 1}
\begin{frame}{Title}
\blindtext
\end{frame}
\section{Sec 2}
\begin{frame}{Title 2}
\framesubtitle{Subtitle}
\blindtext
\end{frame}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/36296 | 681404 | 316,157 |
https://tex.stackexchange.com/questions/71215 | 79 | Trying to get my dissertation sorted (due in a few hours) and I keep getting this error:
```
! Missing $ inserted.
<inserted text>
$
l.190 ... pp. 225--236, 10.1007/978-0-387-68772-8_
18. [Online].
?
```
Really struggling to sort it out.
I'm fairly new to LaTeX.
Edit: This is 189-204 of the bibtex
```
@inproceedings{davis,
author = {Davis, Alan and Dieste, Oscar and Hickey, Ann and Juristo, Natalia and Moreno, Ana M.},
title = {Effectiveness of Requirements Elicitation Techniques: Empirical Results Derived from a Systematic Review},
booktitle = {Proceedings of the 14th IEEE International Requirements Engineering Conference},
series = {RE '06},
year = {2006},
isbn = {0-7695-2555-5},
pages = {176--185},
numpages = {10},
url = {http://dx.doi.org/10.1109/RE.2006.17},
doi = {10.1109/RE.2006.17},
acmid = {1174006},
publisher = {IEEE Computer Society},
address = {Washington, DC, USA},
keywords = {Systematic review, software engineering, elicitation techniques, empirical studies},
}
```
Please help!
| https://tex.stackexchange.com/users/18624 | Missing $ inserted issue | false | If you are handling complex tex when using new packages might incur even more problems, I find a simple solution by replacing the underscore in the bib files' DOI link with `\textunderscore`, like this:
```
doi = {10.1007/978-3-319-45738-3\textunderscore9}
```
It should solve your issue in a second.
| 0 | https://tex.stackexchange.com/users/268086 | 681409 | 316,159 |
https://tex.stackexchange.com/questions/681168 | 1 | Is there a way to get in a `NiceTabular` the text stretched up to the column width?
```
\documentclass{beamer}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{wl{20em}}
Sunt cumque voluptatem quasi \\
quam commodi culpa quaerat sunt
\end{NiceTabular}
\end{document}
```
I know about `\makebox[\mywidth][s]{my text}` but isn't there any simpler solution with tabulars?
As I often use `tikz`, the solution should also work with `\node`. `NiceTabular` does well.
| https://tex.stackexchange.com/users/145290 | NiceTabular with stretched text | false | **EDIT**
With the latest version of `nicematrix` (v. 6.17 of 2023/03/31), you can use in `{NiceTabular}` the columns standard columns `w{s}{...}` and `W{s}{...}` (of the package `array`) with the expected output.
```
\documentclass{beamer}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{w{s}{20em}}
Sunt cumque voluptatem quasi \\
quam commodi culpa quaerat sunt
\end{NiceTabular}
\end{document}
```
The output is the same as with `{tabular}` (see below).
---
You probably want to use the column type `w{s}{...}` of `{tabular}` (as defined by the package `array`).
```
\documentclass{beamer}
\usepackage{array}
\begin{document}
\begin{tabular}{w{s}{20em}}
Sunt cumque voluptatem quasi \\
quam commodi culpa quaerat sunt
\end{tabular}
\end{document}
```
Since `{NiceTabular}` of `nicematrix` is an extension of `{tabular}` (of `array`), the same should work with `{NiceTabular}`. However, it does not. That may be considered as a bug. I will try to solve that bug (I'm the author of `nicematrix`).
| 2 | https://tex.stackexchange.com/users/163000 | 681410 | 316,160 |
https://tex.stackexchange.com/questions/646280 | 0 | How can I fit the following table on multiple pages? Landscape mode is also accepted.
```
\begin{tabular}{llllllllllll}
\toprule
{} & Money Market Euro & Bond Euro Short Term & Bond Euro Medium-Long Term & Global Bond Developed Markets & Corporate Bond High Yield & Emerging Markets Bond & Equity Europe & Equity North America & Equity Pacific & Equity Emerg Markets & Opportunities \\
\midrule
0.0 & 0.05 & 0.2 & 0.42 & 0.2 & 0.05 & 0.08 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\
1.0 & 0.0495 & 0.198 & 0.4158 & 0.198 & 0.0495 & 0.0792 & 0.001616 & 0.006453 & 0.000865 & 0.000566 & 0.0005 \\
2.0 & 0.049 & 0.196 & 0.4116 & 0.196 & 0.049 & 0.0784 & 0.003231 & 0.012906 & 0.001731 & 0.001132 & 0.001 \\
3.0 & 0.0485 & 0.194 & 0.4074 & 0.194 & 0.0485 & 0.0776 & 0.004847 & 0.019358 & 0.002596 & 0.001698 & 0.0015 \\
4.0 & 0.048 & 0.192 & 0.4032 & 0.192 & 0.048 & 0.0768 & 0.006463 & 0.025811 & 0.003462 & 0.002264 & 0.002 \\
5.0 & 0.0475 & 0.19 & 0.399 & 0.19 & 0.0475 & 0.076 & 0.008078 & 0.032264 & 0.004327 & 0.002831 & 0.0025 \\
6.0 & 0.047 & 0.188 & 0.3948 & 0.188 & 0.047 & 0.0752 & 0.009694 & 0.038717 & 0.005193 & 0.003397 & 0.003 \\
7.0 & 0.0465 & 0.186 & 0.3906 & 0.186 & 0.0465 & 0.0744 & 0.011309 & 0.045169 & 0.006058 & 0.003963 & 0.0035 \\
8.0 & 0.046 & 0.184 & 0.3864 & 0.184 & 0.046 & 0.0736 & 0.012925 & 0.051622 & 0.006924 & 0.004529 & 0.004 \\
9.0 & 0.0455 & 0.182 & 0.3822 & 0.182 & 0.0455 & 0.0728 & 0.014541 & 0.058075 & 0.007789 & 0.005095 & 0.0045 \\
10.0 & 0.045 & 0.18 & 0.378 & 0.18 & 0.045 & 0.072 & 0.016156 & 0.064528 & 0.008655 & 0.005661 & 0.005 \\
11.0 & 0.0445 & 0.178 & 0.3738 & 0.178 & 0.0445 & 0.0712 & 0.017772 & 0.07098 & 0.00952 & 0.006227 & 0.0055 \\
12.0 & 0.044 & 0.176 & 0.3696 & 0.176 & 0.044 & 0.0704 & 0.019388 & 0.077433 & 0.010386 & 0.006793 & 0.006 \\
13.0 & 0.0435 & 0.174 & 0.3654 & 0.174 & 0.0435 & 0.0696 & 0.021003 & 0.083886 & 0.011251 & 0.00736 & 0.0065 \\
14.0 & 0.043 & 0.172 & 0.3612 & 0.172 & 0.043 & 0.0688 & 0.022619 & 0.090339 & 0.012117 & 0.007926 & 0.007 \\
15.0 & 0.0425 & 0.17 & 0.357 & 0.17 & 0.0425 & 0.068 & 0.024235 & 0.096791 & 0.012982 & 0.008492 & 0.0075 \\
16.0 & 0.042 & 0.168 & 0.3528 & 0.168 & 0.042 & 0.0672 & 0.02585 & 0.103244 & 0.013848 & 0.009058 & 0.008 \\
17.0 & 0.0415 & 0.166 & 0.3486 & 0.166 & 0.0415 & 0.0664 & 0.027466 & 0.109697 & 0.014713 & 0.009624 & 0.0085 \\
18.0 & 0.041 & 0.164 & 0.3444 & 0.164 & 0.041 & 0.0656 & 0.029082 & 0.11615 & 0.015579 & 0.01019 & 0.009 \\
19.0 & 0.0405 & 0.162 & 0.3402 & 0.162 & 0.0405 & 0.0648 & 0.030697 & 0.122602 & 0.016444 & 0.010756 & 0.0095 \\
20.0 & 0.04 & 0.16 & 0.336 & 0.16 & 0.04 & 0.064 & 0.032313 & 0.129055 & 0.01731 & 0.011322 & 0.01 \\
21.0 & 0.0395 & 0.158 & 0.3318 & 0.158 & 0.0395 & 0.0632 & 0.033928 & 0.135508 & 0.018175 & 0.011888 & 0.0105 \\
22.0 & 0.039 & 0.156 & 0.3276 & 0.156 & 0.039 & 0.0624 & 0.035544 & 0.141961 & 0.019041 & 0.012455 & 0.011 \\
23.0 & 0.0385 & 0.154 & 0.3234 & 0.154 & 0.0385 & 0.0616 & 0.03716 & 0.148413 & 0.019906 & 0.013021 & 0.0115 \\
24.0 & 0.038 & 0.152 & 0.3192 & 0.152 & 0.038 & 0.0608 & 0.038775 & 0.154866 & 0.020772 & 0.013587 & 0.012 \\
25.0 & 0.0375 & 0.15 & 0.315 & 0.15 & 0.0375 & 0.06 & 0.040391 & 0.161319 & 0.021637 & 0.014153 & 0.0125 \\
26.0 & 0.037 & 0.148 & 0.3108 & 0.148 & 0.037 & 0.0592 & 0.042007 & 0.167772 & 0.022503 & 0.014719 & 0.013 \\
27.0 & 0.0365 & 0.146 & 0.3066 & 0.146 & 0.0365 & 0.0584 & 0.043622 & 0.174224 & 0.023368 & 0.015285 & 0.0135 \\
28.0 & 0.036 & 0.144 & 0.3024 & 0.144 & 0.036 & 0.0576 & 0.045238 & 0.180677 & 0.024234 & 0.015851 & 0.014 \\
29.0 & 0.0355 & 0.142 & 0.2982 & 0.142 & 0.0355 & 0.0568 & 0.046854 & 0.18713 & 0.025099 & 0.016417 & 0.0145 \\
30.0 & 0.035 & 0.14 & 0.294 & 0.14 & 0.035 & 0.056 & 0.048469 & 0.193583 & 0.025965 & 0.016983 & 0.015 \\
31.0 & 0.0345 & 0.138 & 0.2898 & 0.138 & 0.0345 & 0.0552 & 0.050085 & 0.200035 & 0.02683 & 0.01755 & 0.0155 \\
32.0 & 0.034 & 0.136 & 0.2856 & 0.136 & 0.034 & 0.0544 & 0.051701 & 0.206488 & 0.027696 & 0.018116 & 0.016 \\
33.0 & 0.0335 & 0.134 & 0.2814 & 0.134 & 0.0335 & 0.0536 & 0.053316 & 0.212941 & 0.028561 & 0.018682 & 0.0165 \\
34.0 & 0.033 & 0.132 & 0.2772 & 0.132 & 0.033 & 0.0528 & 0.054932 & 0.219394 & 0.029426 & 0.019248 & 0.017 \\
35.0 & 0.0325 & 0.13 & 0.273 & 0.13 & 0.0325 & 0.052 & 0.056547 & 0.225846 & 0.030292 & 0.019814 & 0.0175 \\
36.0 & 0.032 & 0.128 & 0.2688 & 0.128 & 0.032 & 0.0512 & 0.058163 & 0.232299 & 0.031157 & 0.02038 & 0.018 \\
37.0 & 0.0315 & 0.126 & 0.2646 & 0.126 & 0.0315 & 0.0504 & 0.059779 & 0.238752 & 0.032023 & 0.020946 & 0.0185 \\
38.0 & 0.031 & 0.124 & 0.2604 & 0.124 & 0.031 & 0.0496 & 0.061394 & 0.245205 & 0.032888 & 0.021512 & 0.019 \\
39.0 & 0.0305 & 0.122 & 0.2562 & 0.122 & 0.0305 & 0.0488 & 0.06301 & 0.251657 & 0.033754 & 0.022079 & 0.0195 \\
40.0 & 0.03 & 0.12 & 0.252 & 0.12 & 0.03 & 0.048 & 0.064626 & 0.25811 & 0.034619 & 0.022645 & 0.02 \\
41.0 & 0.0295 & 0.118 & 0.2478 & 0.118 & 0.0295 & 0.0472 & 0.066241 & 0.264563 & 0.035485 & 0.023211 & 0.0205 \\
42.0 & 0.029 & 0.116 & 0.2436 & 0.116 & 0.029 & 0.0464 & 0.067857 & 0.271016 & 0.03635 & 0.023777 & 0.021 \\
43.0 & 0.0285 & 0.114 & 0.2394 & 0.114 & 0.0285 & 0.0456 & 0.069473 & 0.277468 & 0.037216 & 0.024343 & 0.0215 \\
44.0 & 0.028 & 0.112 & 0.2352 & 0.112 & 0.028 & 0.0448 & 0.071088 & 0.283921 & 0.038081 & 0.024909 & 0.022 \\
45.0 & 0.0275 & 0.11 & 0.231 & 0.11 & 0.0275 & 0.044 & 0.072704 & 0.290374 & 0.038947 & 0.025475 & 0.0225 \\
46.0 & 0.027 & 0.108 & 0.2268 & 0.108 & 0.027 & 0.0432 & 0.07432 & 0.296827 & 0.039812 & 0.026041 & 0.023 \\
47.0 & 0.0265 & 0.106 & 0.2226 & 0.106 & 0.0265 & 0.0424 & 0.075935 & 0.30328 & 0.040678 & 0.026607 & 0.0235 \\
48.0 & 0.026 & 0.104 & 0.2184 & 0.104 & 0.026 & 0.0416 & 0.077551 & 0.309732 & 0.041543 & 0.027174 & 0.024 \\
49.0 & 0.0255 & 0.102 & 0.2142 & 0.102 & 0.0255 & 0.0408 & 0.079166 & 0.316185 & 0.042409 & 0.02774 & 0.0245 \\
50.0 & 0.025 & 0.1 & 0.21 & 0.1 & 0.025 & 0.04 & 0.080782 & 0.322638 & 0.043274 & 0.028306 & 0.025 \\
51.0 & 0.0245 & 0.098 & 0.2058 & 0.098 & 0.0245 & 0.0392 & 0.082398 & 0.329091 & 0.04414 & 0.028872 & 0.0255 \\
52.0 & 0.024 & 0.096 & 0.2016 & 0.096 & 0.024 & 0.0384 & 0.084013 & 0.335543 & 0.045005 & 0.029438 & 0.026 \\
53.0 & 0.0235 & 0.094 & 0.1974 & 0.094 & 0.0235 & 0.0376 & 0.085629 & 0.341996 & 0.045871 & 0.030004 & 0.0265 \\
54.0 & 0.023 & 0.092 & 0.1932 & 0.092 & 0.023 & 0.0368 & 0.087245 & 0.348449 & 0.046736 & 0.03057 & 0.027 \\
55.0 & 0.0225 & 0.09 & 0.189 & 0.09 & 0.0225 & 0.036 & 0.08886 & 0.354902 & 0.047602 & 0.031136 & 0.0275 \\
56.0 & 0.022 & 0.088 & 0.1848 & 0.088 & 0.022 & 0.0352 & 0.090476 & 0.361354 & 0.048467 & 0.031703 & 0.028 \\
57.0 & 0.0215 & 0.086 & 0.1806 & 0.086 & 0.0215 & 0.0344 & 0.092092 & 0.367807 & 0.049333 & 0.032269 & 0.0285 \\
58.0 & 0.021 & 0.084 & 0.1764 & 0.084 & 0.021 & 0.0336 & 0.093707 & 0.37426 & 0.050198 & 0.032835 & 0.029 \\
59.0 & 0.0205 & 0.082 & 0.1722 & 0.082 & 0.0205 & 0.0328 & 0.095323 & 0.380713 & 0.051064 & 0.033401 & 0.0295 \\
60.0 & 0.02 & 0.08 & 0.168 & 0.08 & 0.02 & 0.032 & 0.096939 & 0.387165 & 0.051929 & 0.033967 & 0.03 \\
61.0 & 0.0195 & 0.078 & 0.1638 & 0.078 & 0.0195 & 0.0312 & 0.098554 & 0.393618 & 0.052795 & 0.034533 & 0.0305 \\
62.0 & 0.019 & 0.076 & 0.1596 & 0.076 & 0.019 & 0.0304 & 0.10017 & 0.400071 & 0.05366 & 0.035099 & 0.031 \\
63.0 & 0.0185 & 0.074 & 0.1554 & 0.074 & 0.0185 & 0.0296 & 0.101785 & 0.406524 & 0.054526 & 0.035665 & 0.0315 \\
64.0 & 0.018 & 0.072 & 0.1512 & 0.072 & 0.018 & 0.0288 & 0.103401 & 0.412976 & 0.055391 & 0.036231 & 0.032 \\
65.0 & 0.0175 & 0.07 & 0.147 & 0.07 & 0.0175 & 0.028 & 0.105017 & 0.419429 & 0.056257 & 0.036798 & 0.0325 \\
66.0 & 0.017 & 0.068 & 0.1428 & 0.068 & 0.017 & 0.0272 & 0.106632 & 0.425882 & 0.057122 & 0.037364 & 0.033 \\
67.0 & 0.0165 & 0.066 & 0.1386 & 0.066 & 0.0165 & 0.0264 & 0.108248 & 0.432335 & 0.057988 & 0.03793 & 0.0335 \\
68.0 & 0.016 & 0.064 & 0.1344 & 0.064 & 0.016 & 0.0256 & 0.109864 & 0.438787 & 0.058853 & 0.038496 & 0.034 \\
69.0 & 0.0155 & 0.062 & 0.1302 & 0.062 & 0.0155 & 0.0248 & 0.111479 & 0.44524 & 0.059718 & 0.039062 & 0.0345 \\
70.0 & 0.015 & 0.06 & 0.126 & 0.06 & 0.015 & 0.024 & 0.113095 & 0.451693 & 0.060584 & 0.039628 & 0.035 \\
71.0 & 0.0145 & 0.058 & 0.1218 & 0.058 & 0.0145 & 0.0232 & 0.114711 & 0.458146 & 0.061449 & 0.040194 & 0.0355 \\
72.0 & 0.014 & 0.056 & 0.1176 & 0.056 & 0.014 & 0.0224 & 0.116326 & 0.464598 & 0.062315 & 0.04076 & 0.036 \\
73.0 & 0.0135 & 0.054 & 0.1134 & 0.054 & 0.0135 & 0.0216 & 0.117942 & 0.471051 & 0.06318 & 0.041327 & 0.0365 \\
74.0 & 0.013 & 0.052 & 0.1092 & 0.052 & 0.013 & 0.0208 & 0.119558 & 0.477504 & 0.064046 & 0.041893 & 0.037 \\
75.0 & 0.0125 & 0.05 & 0.105 & 0.05 & 0.0125 & 0.02 & 0.121173 & 0.483957 & 0.064911 & 0.042459 & 0.0375 \\
76.0 & 0.012 & 0.048 & 0.1008 & 0.048 & 0.012 & 0.0192 & 0.122789 & 0.490409 & 0.065777 & 0.043025 & 0.038 \\
77.0 & 0.0115 & 0.046 & 0.0966 & 0.046 & 0.0115 & 0.0184 & 0.124404 & 0.496862 & 0.066642 & 0.043591 & 0.0385 \\
78.0 & 0.011 & 0.044 & 0.0924 & 0.044 & 0.011 & 0.0176 & 0.12602 & 0.503315 & 0.067508 & 0.044157 & 0.039 \\
79.0 & 0.0105 & 0.042 & 0.0882 & 0.042 & 0.0105 & 0.0168 & 0.127636 & 0.509768 & 0.068373 & 0.044723 & 0.0395 \\
80.0 & 0.01 & 0.04 & 0.084 & 0.04 & 0.01 & 0.016 & 0.129251 & 0.51622 & 0.069239 & 0.045289 & 0.04 \\
81.0 & 0.0095 & 0.038 & 0.0798 & 0.038 & 0.0095 & 0.0152 & 0.130867 & 0.522673 & 0.070104 & 0.045855 & 0.0405 \\
82.0 & 0.009 & 0.036 & 0.0756 & 0.036 & 0.009 & 0.0144 & 0.132483 & 0.529126 & 0.07097 & 0.046422 & 0.041 \\
83.0 & 0.0085 & 0.034 & 0.0714 & 0.034 & 0.0085 & 0.0136 & 0.134098 & 0.535579 & 0.071835 & 0.046988 & 0.0415 \\
84.0 & 0.008 & 0.032 & 0.0672 & 0.032 & 0.008 & 0.0128 & 0.135714 & 0.542031 & 0.072701 & 0.047554 & 0.042 \\
85.0 & 0.0075 & 0.03 & 0.063 & 0.03 & 0.0075 & 0.012 & 0.13733 & 0.548484 & 0.073566 & 0.04812 & 0.0425 \\
86.0 & 0.007 & 0.028 & 0.0588 & 0.028 & 0.007 & 0.0112 & 0.138945 & 0.554937 & 0.074432 & 0.048686 & 0.043 \\
87.0 & 0.0065 & 0.026 & 0.0546 & 0.026 & 0.0065 & 0.0104 & 0.140561 & 0.56139 & 0.075297 & 0.049252 & 0.0435 \\
88.0 & 0.006 & 0.024 & 0.0504 & 0.024 & 0.006 & 0.0096 & 0.142177 & 0.567842 & 0.076163 & 0.049818 & 0.044 \\
89.0 & 0.0055 & 0.022 & 0.0462 & 0.022 & 0.0055 & 0.0088 & 0.143792 & 0.574295 & 0.077028 & 0.050384 & 0.0445 \\
90.0 & 0.005 & 0.02 & 0.042 & 0.02 & 0.005 & 0.008 & 0.145408 & 0.580748 & 0.077894 & 0.05095 & 0.045 \\
91.0 & 0.0045 & 0.018 & 0.0378 & 0.018 & 0.0045 & 0.0072 & 0.147023 & 0.587201 & 0.078759 & 0.051517 & 0.0455 \\
92.0 & 0.004 & 0.016 & 0.0336 & 0.016 & 0.004 & 0.0064 & 0.148639 & 0.593653 & 0.079625 & 0.052083 & 0.046 \\
93.0 & 0.0035 & 0.014 & 0.0294 & 0.014 & 0.0035 & 0.0056 & 0.150255 & 0.600106 & 0.08049 & 0.052649 & 0.0465 \\
94.0 & 0.003 & 0.012 & 0.0252 & 0.012 & 0.003 & 0.0048 & 0.15187 & 0.606559 & 0.081356 & 0.053215 & 0.047 \\
95.0 & 0.0025 & 0.01 & 0.021 & 0.01 & 0.0025 & 0.004 & 0.153486 & 0.613012 & 0.082221 & 0.053781 & 0.0475 \\
96.0 & 0.002 & 0.008 & 0.0168 & 0.008 & 0.002 & 0.0032 & 0.155102 & 0.619465 & 0.083087 & 0.054347 & 0.048 \\
97.0 & 0.0015 & 0.006 & 0.0126 & 0.006 & 0.0015 & 0.0024 & 0.156717 & 0.625917 & 0.083952 & 0.054913 & 0.0485 \\
98.0 & 0.001 & 0.004 & 0.0084 & 0.004 & 0.001 & 0.0016 & 0.158333 & 0.63237 & 0.084818 & 0.055479 & 0.049 \\
99.0 & 0.0005 & 0.002 & 0.0042 & 0.002 & 0.0005 & 0.0008 & 0.159949 & 0.638823 & 0.085683 & 0.056046 & 0.0495 \\
100.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.161564 & 0.645276 & 0.086549 & 0.056612 & 0.05 \\
\bottomrule
\end{tabular}
```
| https://tex.stackexchange.com/users/217272 | Multiple pages table – 100 rows x 10 columns | false | A solution using a \tikz\node to force the text width.
We can use the other \node properties to adjust the alignment.
```
\documentclass[11pt]{article}
\usepackage[margin=1cm]{geometry}
\usepackage{longtable}
\usepackage{tikz}
\begin{document}
\newcommand{\tNode}[1]{
\tikz\node[text width=2.em]{#1};
}
{\small
\begin{longtable}{llllllllllll} \hline
{} & \tNode{Money Market Euro} & \tNode{Bond Euro Short Term} & \tNode{Bond Euro Medium-Long Term} & \tNode{Global Bond Developed Markets} & \tNode{Corporate Bond High Yield } &
\tNode{Emerging Markets Bond} & \tNode{Equity Europe} & \tNode{Equity North America} & \tNode{Equity Pacific}
&\tNode{ Equity Emerg Markets }& \tNode{Opportunities } \\ \hline
0.0 & 0.05 & 0.2 & 0.42 & 0.2 & 0.05 & 0.08 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\
1.0 & 0.0495 & 0.198 & 0.4158 & 0.198 & 0.0495 & 0.0792 & 0.001616 & 0.006453 & 0.000865 & 0.000566 & 0.0005 \\
2.0 & 0.049 & 0.196 & 0.4116 & 0.196 & 0.049 & 0.0784 & 0.003231 & 0.012906 & 0.001731 & 0.001132 & 0.001 \\
3.0 & 0.0485 & 0.194 & 0.4074 & 0.194 & 0.0485 & 0.0776 & 0.004847 & 0.019358 & 0.002596 & 0.001698 & 0.0015 \\
4.0 & 0.048 & 0.192 & 0.4032 & 0.192 & 0.048 & 0.0768 & 0.006463 & 0.025811 & 0.003462 & 0.002264 & 0.002 \\
5.0 & 0.0475 & 0.19 & 0.399 & 0.19 & 0.0475 & 0.076 & 0.008078 & 0.032264 & 0.004327 & 0.002831 & 0.0025 \\
6.0 & 0.047 & 0.188 & 0.3948 & 0.188 & 0.047 & 0.0752 & 0.009694 & 0.038717 & 0.005193 & 0.003397 & 0.003 \\
7.0 & 0.0465 & 0.186 & 0.3906 & 0.186 & 0.0465 & 0.0744 & 0.011309 & 0.045169 & 0.006058 & 0.003963 & 0.0035 \\
8.0 & 0.046 & 0.184 & 0.3864 & 0.184 & 0.046 & 0.0736 & 0.012925 & 0.051622 & 0.006924 & 0.004529 & 0.004 \\
9.0 & 0.0455 & 0.182 & 0.3822 & 0.182 & 0.0455 & 0.0728 & 0.014541 & 0.058075 & 0.007789 & 0.005095 & 0.0045 \\
10.0 & 0.045 & 0.18 & 0.378 & 0.18 & 0.045 & 0.072 & 0.016156 & 0.064528 & 0.008655 & 0.005661 & 0.005 \\
11.0 & 0.0445 & 0.178 & 0.3738 & 0.178 & 0.0445 & 0.0712 & 0.017772 & 0.07098 & 0.00952 & 0.006227 & 0.0055 \\
12.0 & 0.044 & 0.176 & 0.3696 & 0.176 & 0.044 & 0.0704 & 0.019388 & 0.077433 & 0.010386 & 0.006793 & 0.006 \\
13.0 & 0.0435 & 0.174 & 0.3654 & 0.174 & 0.0435 & 0.0696 & 0.021003 & 0.083886 & 0.011251 & 0.00736 & 0.0065 \\
14.0 & 0.043 & 0.172 & 0.3612 & 0.172 & 0.043 & 0.0688 & 0.022619 & 0.090339 & 0.012117 & 0.007926 & 0.007 \\
15.0 & 0.0425 & 0.17 & 0.357 & 0.17 & 0.0425 & 0.068 & 0.024235 & 0.096791 & 0.012982 & 0.008492 & 0.0075 \\
16.0 & 0.042 & 0.168 & 0.3528 & 0.168 & 0.042 & 0.0672 & 0.02585 & 0.103244 & 0.013848 & 0.009058 & 0.008 \\
17.0 & 0.0415 & 0.166 & 0.3486 & 0.166 & 0.0415 & 0.0664 & 0.027466 & 0.109697 & 0.014713 & 0.009624 & 0.0085 \\
18.0 & 0.041 & 0.164 & 0.3444 & 0.164 & 0.041 & 0.0656 & 0.029082 & 0.11615 & 0.015579 & 0.01019 & 0.009 \\
19.0 & 0.0405 & 0.162 & 0.3402 & 0.162 & 0.0405 & 0.0648 & 0.030697 & 0.122602 & 0.016444 & 0.010756 & 0.0095 \\
20.0 & 0.04 & 0.16 & 0.336 & 0.16 & 0.04 & 0.064 & 0.032313 & 0.129055 & 0.01731 & 0.011322 & 0.01 \\
21.0 & 0.0395 & 0.158 & 0.3318 & 0.158 & 0.0395 & 0.0632 & 0.033928 & 0.135508 & 0.018175 & 0.011888 & 0.0105 \\
22.0 & 0.039 & 0.156 & 0.3276 & 0.156 & 0.039 & 0.0624 & 0.035544 & 0.141961 & 0.019041 & 0.012455 & 0.011 \\
23.0 & 0.0385 & 0.154 & 0.3234 & 0.154 & 0.0385 & 0.0616 & 0.03716 & 0.148413 & 0.019906 & 0.013021 & 0.0115 \\
24.0 & 0.038 & 0.152 & 0.3192 & 0.152 & 0.038 & 0.0608 & 0.038775 & 0.154866 & 0.020772 & 0.013587 & 0.012 \\
25.0 & 0.0375 & 0.15 & 0.315 & 0.15 & 0.0375 & 0.06 & 0.040391 & 0.161319 & 0.021637 & 0.014153 & 0.0125 \\
26.0 & 0.037 & 0.148 & 0.3108 & 0.148 & 0.037 & 0.0592 & 0.042007 & 0.167772 & 0.022503 & 0.014719 & 0.013 \\
27.0 & 0.0365 & 0.146 & 0.3066 & 0.146 & 0.0365 & 0.0584 & 0.043622 & 0.174224 & 0.023368 & 0.015285 & 0.0135 \\
28.0 & 0.036 & 0.144 & 0.3024 & 0.144 & 0.036 & 0.0576 & 0.045238 & 0.180677 & 0.024234 & 0.015851 & 0.014 \\
29.0 & 0.0355 & 0.142 & 0.2982 & 0.142 & 0.0355 & 0.0568 & 0.046854 & 0.18713 & 0.025099 & 0.016417 & 0.0145 \\
30.0 & 0.035 & 0.14 & 0.294 & 0.14 & 0.035 & 0.056 & 0.048469 & 0.193583 & 0.025965 & 0.016983 & 0.015 \\
31.0 & 0.0345 & 0.138 & 0.2898 & 0.138 & 0.0345 & 0.0552 & 0.050085 & 0.200035 & 0.02683 & 0.01755 & 0.0155 \\
32.0 & 0.034 & 0.136 & 0.2856 & 0.136 & 0.034 & 0.0544 & 0.051701 & 0.206488 & 0.027696 & 0.018116 & 0.016 \\
33.0 & 0.0335 & 0.134 & 0.2814 & 0.134 & 0.0335 & 0.0536 & 0.053316 & 0.212941 & 0.028561 & 0.018682 & 0.0165 \\
34.0 & 0.033 & 0.132 & 0.2772 & 0.132 & 0.033 & 0.0528 & 0.054932 & 0.219394 & 0.029426 & 0.019248 & 0.017 \\
35.0 & 0.0325 & 0.13 & 0.273 & 0.13 & 0.0325 & 0.052 & 0.056547 & 0.225846 & 0.030292 & 0.019814 & 0.0175 \\
36.0 & 0.032 & 0.128 & 0.2688 & 0.128 & 0.032 & 0.0512 & 0.058163 & 0.232299 & 0.031157 & 0.02038 & 0.018 \\
37.0 & 0.0315 & 0.126 & 0.2646 & 0.126 & 0.0315 & 0.0504 & 0.059779 & 0.238752 & 0.032023 & 0.020946 & 0.0185 \\
38.0 & 0.031 & 0.124 & 0.2604 & 0.124 & 0.031 & 0.0496 & 0.061394 & 0.245205 & 0.032888 & 0.021512 & 0.019 \\
39.0 & 0.0305 & 0.122 & 0.2562 & 0.122 & 0.0305 & 0.0488 & 0.06301 & 0.251657 & 0.033754 & 0.022079 & 0.0195 \\
40.0 & 0.03 & 0.12 & 0.252 & 0.12 & 0.03 & 0.048 & 0.064626 & 0.25811 & 0.034619 & 0.022645 & 0.02 \\
41.0 & 0.0295 & 0.118 & 0.2478 & 0.118 & 0.0295 & 0.0472 & 0.066241 & 0.264563 & 0.035485 & 0.023211 & 0.0205 \\
42.0 & 0.029 & 0.116 & 0.2436 & 0.116 & 0.029 & 0.0464 & 0.067857 & 0.271016 & 0.03635 & 0.023777 & 0.021 \\
43.0 & 0.0285 & 0.114 & 0.2394 & 0.114 & 0.0285 & 0.0456 & 0.069473 & 0.277468 & 0.037216 & 0.024343 & 0.0215 \\
44.0 & 0.028 & 0.112 & 0.2352 & 0.112 & 0.028 & 0.0448 & 0.071088 & 0.283921 & 0.038081 & 0.024909 & 0.022 \\
45.0 & 0.0275 & 0.11 & 0.231 & 0.11 & 0.0275 & 0.044 & 0.072704 & 0.290374 & 0.038947 & 0.025475 & 0.0225 \\
46.0 & 0.027 & 0.108 & 0.2268 & 0.108 & 0.027 & 0.0432 & 0.07432 & 0.296827 & 0.039812 & 0.026041 & 0.023 \\
47.0 & 0.0265 & 0.106 & 0.2226 & 0.106 & 0.0265 & 0.0424 & 0.075935 & 0.30328 & 0.040678 & 0.026607 & 0.0235 \\
48.0 & 0.026 & 0.104 & 0.2184 & 0.104 & 0.026 & 0.0416 & 0.077551 & 0.309732 & 0.041543 & 0.027174 & 0.024 \\
49.0 & 0.0255 & 0.102 & 0.2142 & 0.102 & 0.0255 & 0.0408 & 0.079166 & 0.316185 & 0.042409 & 0.02774 & 0.0245 \\
50.0 & 0.025 & 0.1 & 0.21 & 0.1 & 0.025 & 0.04 & 0.080782 & 0.322638 & 0.043274 & 0.028306 & 0.025 \\
51.0 & 0.0245 & 0.098 & 0.2058 & 0.098 & 0.0245 & 0.0392 & 0.082398 & 0.329091 & 0.04414 & 0.028872 & 0.0255 \\
52.0 & 0.024 & 0.096 & 0.2016 & 0.096 & 0.024 & 0.0384 & 0.084013 & 0.335543 & 0.045005 & 0.029438 & 0.026 \\
53.0 & 0.0235 & 0.094 & 0.1974 & 0.094 & 0.0235 & 0.0376 & 0.085629 & 0.341996 & 0.045871 & 0.030004 & 0.0265 \\
54.0 & 0.023 & 0.092 & 0.1932 & 0.092 & 0.023 & 0.0368 & 0.087245 & 0.348449 & 0.046736 & 0.03057 & 0.027 \\
55.0 & 0.0225 & 0.09 & 0.189 & 0.09 & 0.0225 & 0.036 & 0.08886 & 0.354902 & 0.047602 & 0.031136 & 0.0275 \\
56.0 & 0.022 & 0.088 & 0.1848 & 0.088 & 0.022 & 0.0352 & 0.090476 & 0.361354 & 0.048467 & 0.031703 & 0.028 \\
57.0 & 0.0215 & 0.086 & 0.1806 & 0.086 & 0.0215 & 0.0344 & 0.092092 & 0.367807 & 0.049333 & 0.032269 & 0.0285 \\
58.0 & 0.021 & 0.084 & 0.1764 & 0.084 & 0.021 & 0.0336 & 0.093707 & 0.37426 & 0.050198 & 0.032835 & 0.029 \\
59.0 & 0.0205 & 0.082 & 0.1722 & 0.082 & 0.0205 & 0.0328 & 0.095323 & 0.380713 & 0.051064 & 0.033401 & 0.0295 \\
60.0 & 0.02 & 0.08 & 0.168 & 0.08 & 0.02 & 0.032 & 0.096939 & 0.387165 & 0.051929 & 0.033967 & 0.03 \\
61.0 & 0.0195 & 0.078 & 0.1638 & 0.078 & 0.0195 & 0.0312 & 0.098554 & 0.393618 & 0.052795 & 0.034533 & 0.0305 \\
62.0 & 0.019 & 0.076 & 0.1596 & 0.076 & 0.019 & 0.0304 & 0.10017 & 0.400071 & 0.05366 & 0.035099 & 0.031 \\
63.0 & 0.0185 & 0.074 & 0.1554 & 0.074 & 0.0185 & 0.0296 & 0.101785 & 0.406524 & 0.054526 & 0.035665 & 0.0315 \\
64.0 & 0.018 & 0.072 & 0.1512 & 0.072 & 0.018 & 0.0288 & 0.103401 & 0.412976 & 0.055391 & 0.036231 & 0.032 \\
65.0 & 0.0175 & 0.07 & 0.147 & 0.07 & 0.0175 & 0.028 & 0.105017 & 0.419429 & 0.056257 & 0.036798 & 0.0325 \\
66.0 & 0.017 & 0.068 & 0.1428 & 0.068 & 0.017 & 0.0272 & 0.106632 & 0.425882 & 0.057122 & 0.037364 & 0.033 \\
67.0 & 0.0165 & 0.066 & 0.1386 & 0.066 & 0.0165 & 0.0264 & 0.108248 & 0.432335 & 0.057988 & 0.03793 & 0.0335 \\
68.0 & 0.016 & 0.064 & 0.1344 & 0.064 & 0.016 & 0.0256 & 0.109864 & 0.438787 & 0.058853 & 0.038496 & 0.034 \\
69.0 & 0.0155 & 0.062 & 0.1302 & 0.062 & 0.0155 & 0.0248 & 0.111479 & 0.44524 & 0.059718 & 0.039062 & 0.0345 \\
70.0 & 0.015 & 0.06 & 0.126 & 0.06 & 0.015 & 0.024 & 0.113095 & 0.451693 & 0.060584 & 0.039628 & 0.035 \\
71.0 & 0.0145 & 0.058 & 0.1218 & 0.058 & 0.0145 & 0.0232 & 0.114711 & 0.458146 & 0.061449 & 0.040194 & 0.0355 \\
72.0 & 0.014 & 0.056 & 0.1176 & 0.056 & 0.014 & 0.0224 & 0.116326 & 0.464598 & 0.062315 & 0.04076 & 0.036 \\
73.0 & 0.0135 & 0.054 & 0.1134 & 0.054 & 0.0135 & 0.0216 & 0.117942 & 0.471051 & 0.06318 & 0.041327 & 0.0365 \\
74.0 & 0.013 & 0.052 & 0.1092 & 0.052 & 0.013 & 0.0208 & 0.119558 & 0.477504 & 0.064046 & 0.041893 & 0.037 \\
75.0 & 0.0125 & 0.05 & 0.105 & 0.05 & 0.0125 & 0.02 & 0.121173 & 0.483957 & 0.064911 & 0.042459 & 0.0375 \\
76.0 & 0.012 & 0.048 & 0.1008 & 0.048 & 0.012 & 0.0192 & 0.122789 & 0.490409 & 0.065777 & 0.043025 & 0.038 \\
77.0 & 0.0115 & 0.046 & 0.0966 & 0.046 & 0.0115 & 0.0184 & 0.124404 & 0.496862 & 0.066642 & 0.043591 & 0.0385 \\
78.0 & 0.011 & 0.044 & 0.0924 & 0.044 & 0.011 & 0.0176 & 0.12602 & 0.503315 & 0.067508 & 0.044157 & 0.039 \\
79.0 & 0.0105 & 0.042 & 0.0882 & 0.042 & 0.0105 & 0.0168 & 0.127636 & 0.509768 & 0.068373 & 0.044723 & 0.0395 \\
80.0 & 0.01 & 0.04 & 0.084 & 0.04 & 0.01 & 0.016 & 0.129251 & 0.51622 & 0.069239 & 0.045289 & 0.04 \\
81.0 & 0.0095 & 0.038 & 0.0798 & 0.038 & 0.0095 & 0.0152 & 0.130867 & 0.522673 & 0.070104 & 0.045855 & 0.0405 \\
82.0 & 0.009 & 0.036 & 0.0756 & 0.036 & 0.009 & 0.0144 & 0.132483 & 0.529126 & 0.07097 & 0.046422 & 0.041 \\
83.0 & 0.0085 & 0.034 & 0.0714 & 0.034 & 0.0085 & 0.0136 & 0.134098 & 0.535579 & 0.071835 & 0.046988 & 0.0415 \\
84.0 & 0.008 & 0.032 & 0.0672 & 0.032 & 0.008 & 0.0128 & 0.135714 & 0.542031 & 0.072701 & 0.047554 & 0.042 \\
85.0 & 0.0075 & 0.03 & 0.063 & 0.03 & 0.0075 & 0.012 & 0.13733 & 0.548484 & 0.073566 & 0.04812 & 0.0425 \\
86.0 & 0.007 & 0.028 & 0.0588 & 0.028 & 0.007 & 0.0112 & 0.138945 & 0.554937 & 0.074432 & 0.048686 & 0.043 \\
87.0 & 0.0065 & 0.026 & 0.0546 & 0.026 & 0.0065 & 0.0104 & 0.140561 & 0.56139 & 0.075297 & 0.049252 & 0.0435 \\
88.0 & 0.006 & 0.024 & 0.0504 & 0.024 & 0.006 & 0.0096 & 0.142177 & 0.567842 & 0.076163 & 0.049818 & 0.044 \\
89.0 & 0.0055 & 0.022 & 0.0462 & 0.022 & 0.0055 & 0.0088 & 0.143792 & 0.574295 & 0.077028 & 0.050384 & 0.0445 \\
90.0 & 0.005 & 0.02 & 0.042 & 0.02 & 0.005 & 0.008 & 0.145408 & 0.580748 & 0.077894 & 0.05095 & 0.045 \\
91.0 & 0.0045 & 0.018 & 0.0378 & 0.018 & 0.0045 & 0.0072 & 0.147023 & 0.587201 & 0.078759 & 0.051517 & 0.0455 \\
92.0 & 0.004 & 0.016 & 0.0336 & 0.016 & 0.004 & 0.0064 & 0.148639 & 0.593653 & 0.079625 & 0.052083 & 0.046 \\
93.0 & 0.0035 & 0.014 & 0.0294 & 0.014 & 0.0035 & 0.0056 & 0.150255 & 0.600106 & 0.08049 & 0.052649 & 0.0465 \\
94.0 & 0.003 & 0.012 & 0.0252 & 0.012 & 0.003 & 0.0048 & 0.15187 & 0.606559 & 0.081356 & 0.053215 & 0.047 \\
95.0 & 0.0025 & 0.01 & 0.021 & 0.01 & 0.0025 & 0.004 & 0.153486 & 0.613012 & 0.082221 & 0.053781 & 0.0475 \\
96.0 & 0.002 & 0.008 & 0.0168 & 0.008 & 0.002 & 0.0032 & 0.155102 & 0.619465 & 0.083087 & 0.054347 & 0.048 \\
97.0 & 0.0015 & 0.006 & 0.0126 & 0.006 & 0.0015 & 0.0024 & 0.156717 & 0.625917 & 0.083952 & 0.054913 & 0.0485 \\
98.0 & 0.001 & 0.004 & 0.0084 & 0.004 & 0.001 & 0.0016 & 0.158333 & 0.63237 & 0.084818 & 0.055479 & 0.049 \\
99.0 & 0.0005 & 0.002 & 0.0042 & 0.002 & 0.0005 & 0.0008 & 0.159949 & 0.638823 & 0.085683 & 0.056046 & 0.0495 \\
100.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.161564 & 0.645276 & 0.086549 & 0.056612 & 0.05 \\
\hline
\end{longtable}
}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/5355 | 681419 | 316,162 |
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 | true |
```
\documentclass{standalone}
\usepackage{tikzducks}
\usepackage{pgf-spectra}
\pgfspectrashade[v](380,780){myShadeC}
\begin{document}
\begin{tikzpicture}[shading=myShadeC]
\duck[body=pink]
\shade[shading angle=45] \duckpathlonghair;
\duck[invisible,body=pink,unicorn=magenta!60!violet]
\end{tikzpicture}
\end{document}
```
| 48 | https://tex.stackexchange.com/users/36296 | 681420 | 316,163 |
https://tex.stackexchange.com/questions/681421 | 0 | I'm having the following error message:
>
> ! Package pgf Error: No shape named `1' is known.
>
>
> See the pgf package documentation for explanation. Type H
> for immediate help. ...
>
> l.117 \nodestate[right=of 1] {$\varnothing$}; ?
>
>
>
The same code without changing anything in it works perfectly in the entirely book code I'm working on. I just copied that section from the book code to create a minimum working example for another question and was stuck by the pgf Error. So I can't ask the real target question yet.
```
\documentclass[11pt]{book}
\usepackage[paperwidth=20cm, paperheight=29cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{amsmath, amsfonts, amsthm, amssymb}
\usepackage{multicol}
\usepackage{qtree}
\usepackage{xcolor}
\usepackage{caption}
\usepackage{parskip}
\usepackage{hyperref}
\usepackage{listings}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,arrows,chains,automata,shapes,matrix,positioning,scopes,calc,babel}
\usepackage{tikz-qtree}
\definecolor{light-gray}{gray}{0.9}
\newcommand{\code}[1]{\colorbox{light-gray}{\texttt{#1}}}
\newcommand{\phase}[1]{\par\medskip\textbf{#1}\par\nopagebreak}
\RequirePackage[framemethod=default]{mdframed} % Required for creating the theorem, definition, exercise and corollary boxes
\definecolor{ocre}{RGB}{70,50,212} % Define the orange color used for highlighting throughout the book
\newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
backgroundcolor=ocre!10,
linecolor=ocre,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=5pt,
innerbottommargin=5pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=4pt]{eBox}
\renewcommand{\qedsymbol}{$\blacksquare$}
\newtheorem{exempleT}{Exemple}[chapter]
\newenvironment{exemple}% environment name
{
\par
\begin{exempleT}
%\par\vspace{\baselineskip}\noindent
%\hfill{\tiny\ensuremath{\blacksquare}}
\par\vspace{\baselineskip}\noindent
\tiny\ensuremath{\blacksquare}
\par\vspace{\baselineskip}\noindent\ignorespaces
%\ignorespacesafterend
\end{exempleT}
}
\newtheorem{exerciceT}{Exercice}[chapter]
\newenvironment{exercice}% environment name
{
\par
\begin{eBox}\begin{exerciceT}
%\par\vspace{\baselineskip}\noindent
%\hfill{\tiny\ensuremath{\blacksquare}}
%\par\vspace{\baselineskip}\noindent
\hfill{\color{ocre}\tiny\ensuremath{\blacksquare}}
\par\vspace{\baselineskip}\noindent\ignorespaces
%\ignorespacesafterend
\end{exerciceT}\end{eBox}
}
\begin{document}
\begin{exercice}\label{exercice:deterministeVersNonDeterministe}
Transformez l'automate non déterministe \code{A = (Q,$\Sigma,\delta$,s,F)} de la figure~\ref{exemple:afnd} en un automate fini déterministe \code{A' = (Q',$\Sigma',\delta'$,s',F')}.\\
Construction de l'automate fini déterministe \code{A'}:\\
\begin{enumerate}
\item Si \code{Q} $= \{1, 2, 3\}$ est l'ensemble des états de l'automate \code{A} alors:\\
\code{Q'} est l'ensemble des sous ensembles de \code{Q}.\\
\code{Q'} $= \{\varnothing, \{1\}, \{2\}, \{3\}, \{1,2\}, \{1,3\}, \{2,3\}, \{1,2,3\} \}$.\\
\item $\Sigma$ ne change pas. Donc $\Sigma' = \Sigma$.
\item Si $\delta$ est la fonction de transition de \code{A}, alors $\delta'$ est la fonction de transition de \code{A'}. $\delta'$ est la fonction de transition suivante, et est un sous ensemble de \code{Q'} $\times \Sigma \times$ \code{Q'}:
\begin{multicols}{2}
$\delta = \{\\
\delta(\varnothing, a)=\varnothing$\\
$\delta(\{1\}, a)=\varnothing$\\
$\delta(\{2\}, a)=\varnothing$\\
$\delta(\{3\}, a)=\{1,2\}$\\
$\delta(\{1,2\}, a)=\varnothing$\\
$\delta(\{1,3\},a)=\{1,2\}$\\
$\delta(\{2,3\},a)=\{1,2\}$\\
$\delta(\{1,2,3\}, a)=\{1,2\}$
\columnbreak
\vline \hspace{1cm}
$\delta(\{\varnothing,b\})=\varnothing$\\
$\delta(\{1\},b)=\{2,3\}$\\
$\delta(\{2\},b)=\varnothing$\\
$\delta(\{3\},b)=\varnothing$\\
$\delta(\{1,2\},b)=\{2,3\}$\\
$\delta(\{1,3\},b)=\{2,3\}$\\
$\delta(\{2,3\},b)=\varnothing$\\
$\delta(\{1,2,3\},b)=\{2,3\}\}$
\end{multicols}
\item \code{s} ne change pas. \code{s} étant l'état initial de \code{A}, il demeure l'état initial de \code{A'}. Si \code{s'} est l'état initial de \code{A'}, alors \code{s' = s = 1}.
\item \code{F} étant l'ensemble des états finaux de \code{A} alors \code{F'} est l'ensemble des états finaux de \code{A'}.
Les états finaux du nouvel automate \code{A'} sont tous des sous ensembles des états contenant l'état $3$.
Donc \code{F'} $= \{\{3\},\{1,3\},\{2,3\},\{1,2,3\}\}$\\
D'où le diagramme des transitions suivant:
\begin{center}
\begin{tikzpicture}[>=Stealth, shorten >=1pt, auto, node distance=2.5cm, initial text = Début]
\node[state](2)[right=of 1]{$\varnothing$};
\node[state, accepting](3)[right=of 2]{$3$};
\node[initial, state](4)[below=of 1]{$1$};
\node[state](1)[above left=of 4]{$2$};
\node[state, accepting](5)[right=of 4]{${\{2, 3\}}$};
\node[state](6)[right of=5]{${\{1, 2\}}$};
\node[state, accepting](7)[below=of 5]{${\{1, 3\}}$};
\node[state, accepting](8)[below=of 6]{${\{1, 2, 3\}}$};
\path[->] (1) edge node {a} (2);
\path[->] (1) edge [swap] node {b} (2);
\path[->] (2) edge [loop above] node {a, b} (2);
\path[->] (3) edge node {b} (2);
\path[->] (3) edge node {a} (6);
\path[->] (4) edge node {a} (2);
\path[->] (4) edge node {b} (5);
\path[->] (5) edge node {b} (2);
\path[->] ({5}) edge node {a} (6);
\path[->] ({6}) edge node {b} (5);
\path[->] ({6}) edge node {b} (2);
\path[->] (7) edge node {b} (5);
\path[->] (7) edge node {a} (6);
\path[->] (8) edge node {a} (6);
\path[->] (8) edge node {b} (5);
\end{tikzpicture}
\end{center}
Si on supprime les états qui ne peuvent être atteints, on obtient l'AFD suivant:
\begin{tikzpicture}[>=Stealth, shorten >=1pt, auto, node distance=3cm, initial text = Début]
\node[initial, state](A){$\{1\}$};
\node[state](B)[above right=of A]{$\varnothing$};
\node[state, accepting](C)[below of=B]{$\{2, 3\}$};
\node[state](D)[right of=C]{$\{1, 2\}$};
\path[->] (A) edge node {a} (B);
\path[->] (B) edge [loop above] node {a, b} (B);
\path[->] (A) edge node {b} (C);
\path[->] (C) edge [bend right] node {a} (D);
\path[->] (C) edge node {b} (B);
\path[->] (D) edge [bend right] node {b} (C);
\path[->] (D) edge node {a} (B);
\end{tikzpicture}
Le langage que cet automate accepte est le suivant:\\
\begin{center}
$\{b(ab)^n$ : $n \in \mathbb{N} \, \}$
\end{center}
\end{enumerate}
\end{exercice}
\end{document}
```
| https://tex.stackexchange.com/users/47447 | Package pgf Error: No shape named X is known. Same code works elsewhere | true | Below is the working code according the comment @Dai Bowen:
```
\documentclass[11pt]{book}
\usepackage[paperwidth=20cm, paperheight=29cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{amsmath, amsfonts, amsthm, amssymb}
\usepackage{multicol}
\usepackage{qtree}
\usepackage{xcolor}
\usepackage{caption}
\usepackage{parskip}
\usepackage{hyperref}
\usepackage{listings}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,arrows,chains,automata,shapes,matrix,positioning,scopes,calc,babel}
\usepackage{tikz-qtree}
\definecolor{light-gray}{gray}{0.9}
\newcommand{\code}[1]{\colorbox{light-gray}{\texttt{#1}}}
\newcommand{\phase}[1]{\par\medskip\textbf{#1}\par\nopagebreak}
\RequirePackage[framemethod=default]{mdframed} % Required for creating the theorem, definition, exercise and corollary boxes
\definecolor{ocre}{RGB}{70,50,212} % Define the orange color used for highlighting throughout the book
\newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
backgroundcolor=ocre!10,
linecolor=ocre,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=5pt,
innerbottommargin=5pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=4pt]{eBox}
\renewcommand{\qedsymbol}{$\blacksquare$}
\newtheorem{exempleT}{Exemple}[chapter]
\newenvironment{exemple}% environment name
{
\par
\begin{exempleT}
%\par\vspace{\baselineskip}\noindent
%\hfill{\tiny\ensuremath{\blacksquare}}
\par\vspace{\baselineskip}\noindent
\tiny\ensuremath{\blacksquare}
\par\vspace{\baselineskip}\noindent\ignorespaces
%\ignorespacesafterend
\end{exempleT}
}
\newtheorem{exerciceT}{Exercice}[chapter]
\newenvironment{exercice}% environment name
{
\par
\begin{eBox}\begin{exerciceT}
%\par\vspace{\baselineskip}\noindent
%\hfill{\tiny\ensuremath{\blacksquare}}
%\par\vspace{\baselineskip}\noindent
\hfill{\color{ocre}\tiny\ensuremath{\blacksquare}}
\par\vspace{\baselineskip}\noindent\ignorespaces
%\ignorespacesafterend
\end{exerciceT}\end{eBox}
}
\begin{document}
\begin{exercice}\label{exercice:deterministeVersNonDeterministe}
Transformez l'automate non déterministe \code{A = (Q,$\Sigma,\delta$,s,F)} de la figure~\ref{exemple:afnd} en un automate fini déterministe \code{A' = (Q',$\Sigma',\delta'$,s',F')}.\\
Construction de l'automate fini déterministe \code{A'}:\\
\begin{enumerate}
\item Si \code{Q} $= \{1, 2, 3\}$ est l'ensemble des états de l'automate \code{A} alors:\\
\code{Q'} est l'ensemble des sous ensembles de \code{Q}.\\
\code{Q'} $= \{\varnothing, \{1\}, \{2\}, \{3\}, \{1,2\}, \{1,3\}, \{2,3\}, \{1,2,3\} \}$.\\
\item $\Sigma$ ne change pas. Donc $\Sigma' = \Sigma$.
\item Si $\delta$ est la fonction de transition de \code{A}, alors $\delta'$ est la fonction de transition de \code{A'}. $\delta'$ est la fonction de transition suivante, et est un sous ensemble de \code{Q'} $\times \Sigma \times$ \code{Q'}:
\begin{multicols}{2}
$\delta = \{\\
\delta(\varnothing, a)=\varnothing$\\
$\delta(\{1\}, a)=\varnothing$\\
$\delta(\{2\}, a)=\varnothing$\\
$\delta(\{3\}, a)=\{1,2\}$\\
$\delta(\{1,2\}, a)=\varnothing$\\
$\delta(\{1,3\},a)=\{1,2\}$\\
$\delta(\{2,3\},a)=\{1,2\}$\\
$\delta(\{1,2,3\}, a)=\{1,2\}$
\columnbreak
\vline \hspace{1cm}
$\delta(\{\varnothing,b\})=\varnothing$\\
$\delta(\{1\},b)=\{2,3\}$\\
$\delta(\{2\},b)=\varnothing$\\
$\delta(\{3\},b)=\varnothing$\\
$\delta(\{1,2\},b)=\{2,3\}$\\
$\delta(\{1,3\},b)=\{2,3\}$\\
$\delta(\{2,3\},b)=\varnothing$\\
$\delta(\{1,2,3\},b)=\{2,3\}\}$
\end{multicols}
\item \code{s} ne change pas. \code{s} étant l'état initial de \code{A}, il demeure l'état initial de \code{A'}. Si \code{s'} est l'état initial de \code{A'}, alors \code{s' = s = 1}.
\item \code{F} étant l'ensemble des états finaux de \code{A} alors \code{F'} est l'ensemble des états finaux de \code{A'}.
Les états finaux du nouvel automate \code{A'} sont tous des sous ensembles des états contenant l'état $3$.
Donc \code{F'} $= \{\{3\},\{1,3\},\{2,3\},\{1,2,3\}\}$\\
D'où le diagramme des transitions suivant:
\begin{center}
\begin{tikzpicture}[>=Stealth, shorten >=1pt, auto, node distance=2.5cm, initial text = Début]
\node[initial, state](4){$1$};
\node[state](1)[above left=of 4]{$2$};
\node[state](2)[right=of 1]{$\varnothing$};
\node[state, accepting](3)[right=of 2]{$3$};
\node[state, accepting](5)[right=of 4]{${\{2, 3\}}$};
\node[state](6)[right of=5]{${\{1, 2\}}$};
\node[state, accepting](7)[below=of 5]{${\{1, 3\}}$};
\node[state, accepting](8)[below=of 6]{${\{1, 2, 3\}}$};
\path[->] (1) edge node {a} (2);
\path[->] (1) edge [swap] node {b} (2);
\path[->] (2) edge [loop above] node {a, b} (2);
\path[->] (3) edge node {b} (2);
\path[->] (3) edge node {a} (6);
\path[->] (4) edge node {a} (2);
\path[->] (4) edge node {b} (5);
\path[->] (5) edge node {b} (2);
\path[->] ({5}) edge node {a} (6);
\path[->] ({6}) edge node {b} (5);
\path[->] ({6}) edge node {b} (2);
\path[->] (7) edge node {b} (5);
\path[->] (7) edge node {a} (6);
\path[->] (8) edge node {a} (6);
\path[->] (8) edge node {b} (5);
\end{tikzpicture}
\end{center}
Si on supprime les états qui ne peuvent être atteints, on obtient l'AFD suivant:
\begin{tikzpicture}[>=Stealth, shorten >=1pt, auto, node distance=3cm, initial text = Début]
\node[initial, state](A){$\{1\}$};
\node[state](B)[above right=of A]{$\varnothing$};
\node[state, accepting](C)[below of=B]{$\{2, 3\}$};
\node[state](D)[right of=C]{$\{1, 2\}$};
\path[->] (A) edge node {a} (B);
\path[->] (B) edge [loop above] node {a, b} (B);
\path[->] (A) edge node {b} (C);
\path[->] (C) edge [bend right] node {a} (D);
\path[->] (C) edge node {b} (B);
\path[->] (D) edge [bend right] node {b} (C);
\path[->] (D) edge node {a} (B);
\end{tikzpicture}
Le langage que cet automate accepte est le suivant:\\
\begin{center}
$\{b(ab)^n$ : $n \in \mathbb{N} \, \}$
\end{center}
\end{enumerate}
\end{exercice}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/47447 | 681426 | 316,164 |
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 | You can view the following code from two perspectives:
1. as a cheap trick
2. as an inventive solution.
---
Ad #1: That view should be obvious.
---
Ad #2: It provides the properties of an inventive solution:
* it IS TIKZ
* AND it IS NOT-TIKZ
* i.e. it's a resolution of a contradiction
* done by separation in code
* which can be perceived as the principle of "separating between part and whole" (overall it's tikz as a whole, but not-tikz in it's part(s))
Take that, AI ...
*Screenshot. Save as uniforn-f.png with or without the gray borders from my browsers background.*
```
\documentclass[10pt]{standalone}
\usepackage{tikz}% tikz
\usepackage{graphicx}% NOT-tikz
\begin{document}
\tikz{\node at (0,0) {\includegraphics{unicorn-f.png}};}% AND (tikz AND not-tikz)
\end{document}
```
| 8 | https://tex.stackexchange.com/users/245790 | 681431 | 316,166 |
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 | Clearly use of tikz is sign of mere automation.
Discerning artists use latex picture mode for
[planes](https://tex.stackexchange.com/a/114847/1090)
or
[donkeys](https://tex.stackexchange.com/a/312625/1090)
or unicorns which are horned donkeys
```
\setlength{\unitlength}{0.00083333in}
\usepackage{epic}
\begin{document}
\begin{picture}(4974,3714)(0,-10)
\drawline(2037,1362)(1962,12)(2112,1362)
\drawline(1887,2412)(4437,2412)(4437,1437)
(1887,1437)(837,2262)(462,1812)
(12,2187)(687,3012)(837,3687)
(837,3087)(1812,2412)
\drawline(1887,1437)(1512,12)(1962,1437)
\put(687,2637){\circle{150}}
\drawline(4362,1437)(4287,162)(4287,1437)
\drawline(4137,1437)(3987,162)(3987,1437)
\drawline(4437,2412)(4962,1587)
\drawline(580,2900)(-200,3300)(660,3010)
\end{picture}
\end{document}
```
| 32 | https://tex.stackexchange.com/users/1090 | 681433 | 316,167 |
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 | Approach:
* find a drawing
* digitize it, i.e. draw relevant coordinates and lines
* artistic touch: use thicker lines
Some directions for further improvements:
* modify arrow tips, e.g. triangular or curved
* use some kind of fill or texture, e.g. to mimick charcol strokes
* do some fine tuning, e.g. for the ears
```
\documentclass[10pt, border=3mm]{standalone}
\usepackage{tikz}
\begin{document}
\tikz[line width=4.5pt]{
% ~~~ head ~~~~~~~~
\draw (2.96, 4.67) to [out=88, in=95] (3.22, 4.78);
\draw (3.13, 4.63) to [out=55, in=85] (3.22, 4.43)
to [out=-45, in=105] (3.57, 3.79)
to [out=288, in=85] (3.88, 2.86);
\draw (3.77, 2.82) to [out=230, in=280] (3.32, 2.73)
to [out=90, in=300] (2.79, 3.34);
\draw (2.84, 3.28) to [out=185, in=270] (2.20, 3.92)
to [out=250, in=160] (2.67, 2.83);
% ~~~ eye ~~~~~~~~
\draw (3.30, 4.10) to [out=190, in=160] (3.04, 4.04)
to [out=300, in=190] (3.32, 3.93);
% ~~~ nose ~~~~~~~~
\draw (3.84, 2.83) -- (3.70, 3.00);
% ~~~ hair ~~~~~~~
\draw (2.89, 4.83) to [out=180, in=90] (1.78, 3.69)
to [out=270, in=160] (2.90, 2.50);
\draw (1.63, 4.24) to [out=230, in=80] (2.14, .76);
\draw (1.73, .45) to [out=70, in=270] (1.03, 3.04);
\draw (1.61, 3.65) to [out=260, in=140] (2.31, 2.29)
to [out=-40, in=105] (3.34, 1.54);
% ~~~ horn ~~~~~~
\draw (3.48, 4.19) to [out=35, in=30] (4.67, 5.22)
to [out=35, in=30](3.65, 4.82);
\draw (3.65, 4.34) to [out=90 , in=280] (3.59, 4.69);
\draw (3.85, 4.51) to [out=90 , in=290] (3.79, 4.75);
\draw (4.00, 4.64) to [out=95 , in=290] (3.96, 4.83);
\draw (4.19, 4.77) to [out=95 , in=300] (4.16, 4.89);
}
\end{document}
```
**P.S.**: Again for the artistic touch, this is how it can appear when using dashed lines everywhere:
*(Might be a zebra-corn ...)*
**P.S.2**: More artistic, which makes it look more godzillian:
```
\tikz[line width=2pt,
decoration={random steps,segment length=3pt}]{
% ~~~ head ~~~~~~~~
\draw [decorate] (2.96, 4.67) to [out=88, in=95] (3.22, 4.78);
...
```
| 18 | https://tex.stackexchange.com/users/245790 | 681437 | 316,171 |
https://tex.stackexchange.com/questions/223187 | 2 | For some strange reason `pdflatex.exe` apparently can't find the `.tex` file I'm trying to process in the Windows terminal.
I open the terminal, navigate to the appropriate folder and enter the following command:
```
\miktex\bin\pdflatex.exe test.tex
```
I get the following error message:
```
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9)
entering extended mode
! I can't find file `test.tex'.
```
I'm 100% sure that I'm in the correct directory and that the file `test.tex` is there.
Any help would be greatly appreciated!
| https://tex.stackexchange.com/users/70506 | pdflatex cannot find my .tex file | false | TEXINPUTS does create at problem if you forget to include the current directory. If you change
```
export TEXINPUTS="/path/to/local/styles"
```
to
```
export TEXINPUTS=".:/path/to/local/styles"
```
it should fix it.
| 1 | https://tex.stackexchange.com/users/75997 | 681438 | 316,172 |
https://tex.stackexchange.com/questions/681052 | 3 | My cross references are not referencing the right equation labels. This is the code I am using.
```
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\begin{eqnarray}
SNR&=&10^{\frac{SNRdB}{10}}\\
\label{eq:snr}
&=&\frac{\sigma_s^2}{\sigma_N^2}\nonumber
\end{eqnarray}
and
\begin{equation}
\sigma_N^2=\frac{\sigma_s^2}{SNR}
\label{eq:sn}
\end{equation}
Combining equations \ref{eq:snr} and \ref{eq:sn} we get
\end{document}
```
| https://tex.stackexchange.com/users/282065 | How to cross reference in eqnarray | false | Never use `eqnarray`. Ever.
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{hyperref}
\begin{document}
\begin{equation}\label{eq:snr}
\begin{split}
\mathrm{SNR} &= 10^{\mathrm{SNR\,dB}/10} \\
&= \frac{\sigma_s^2}{\sigma_N^2}
\end{split}
\end{equation}
and
\begin{equation}
\sigma_N^2=\frac{\sigma_s^2}{\mathrm{SNR}}
\label{eq:sn}
\end{equation}
Combining equations \ref{eq:snr} and \ref{eq:sn} we get
\end{document}
```
| 1 | https://tex.stackexchange.com/users/4427 | 681441 | 316,173 |
https://tex.stackexchange.com/questions/681432 | 0 | I want to make a reference to a previous example in my paper. How can i make a reference that takes you to the related example when clicked on? I am a very amateur user so I need it to be as simple as possible.
My goal is:
say that we are on example 4.4.3 . I wanna say "using the set given in example 2.2.2" and let the reader go to example 4.4.3 by clicking on it.
| https://tex.stackexchange.com/users/286390 | how to jump to a specific part of a pdf using \hyperref or something else | false |
```
\documentclass{article}
\usepackage{amsthm,hyperref}
\newtheorem{example}{Example}
\begin{document}
\begin{example}[First example]\label{ex:first}
Content.
\end{example}
\begin{example}[Second example]
Using the set given in Example~\ref{ex:first}\ldots
\end{example}
\end{document}
```
Taking a look at the `cleveref` package might be beneficial.
| 1 | https://tex.stackexchange.com/users/237192 | 681442 | 316,174 |
https://tex.stackexchange.com/questions/681440 | -1 | I would like to set it in my beamertheme.sty so that when using enumerate or itemize, the symbols are dashes (--) by default. Unfortunately, I have not found a hint in the beamer documentation (chapter 12.1). Is there an additional package I can use for this, or have I missed an option?
```
\setbeamertemplate{itemize items}[option]
\setbeamertemplate{enumerate items][option]
```
| https://tex.stackexchange.com/users/293851 | set itemize symbol in a dash (setbeamertemplate) | true | For itemize items you can set the templates like this:
```
\documentclass{beamer}
\setbeamertemplate{itemize item}{\usebeamerfont*{itemize item}-}
\setbeamertemplate{itemize subitem}{\usebeamerfont*{itemize subitem}-}
\setbeamertemplate{itemize subsubitem}{\usebeamerfont*{itemize subsubitem}-}
\begin{document}
\begin{frame}
\begin{itemize}
\item abc
\begin{itemize}
\item test
\end{itemize}
\end{itemize}
\end{frame}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/36296 | 681443 | 316,175 |
https://tex.stackexchange.com/questions/669436 | 1 | Does anybody know how to plot a non-central t distribution using `pst-fun` from pstricks or tikz. For the central t, `pst-fun` has the function `psTDist`, but I can find a way to add a $\delta$ ncp to it.
For the central t is quite straigt foward:
```
\documentclass[border=5mm]{standalone}
\usepackage{pst-plot,pst-func}
\begin{document}
\psset{xunit=1cm,yunit=7.5cm}
\begin{pspicture}(-5.25,-0.05)(5.25,0.5)
% Valor de corte z
\newcommand\z{1.3}
%Dist
\psTDist[nue=9,yunit=1]{\z}{4}
\end{pspicture}
\end{document}
```
I wonder if I need just to generate the non-central t-distribution and plot the points overlapping.
Thansk!
| https://tex.stackexchange.com/users/227936 | Ploting a non-central T distribution with pst-func or tikz? | false | So, this is how I did it... not sure it's the more parsimonious way but...
```
\documentclass[border=5mm]{standalone}
\usepackage{pst-plot,pst-func}
\begin{document}
\definecolor{fillColor}{RGB}{125, 185, 250}
\psset{xunit=1cm,yunit=7.5cm}
\begin{pspicture}[algebraic](-4,-0.05)(8,0.5)
% Valor de corte z
\newcommand\z{1.833}
\def\pdfT#1{\fpeval{1/(sqrt(2*pi))*exp(-0.5*(#1)^2)}}
%Dist
\pscustom[fillstyle=solid,fillcolor=fillColor!30,linestyle=none]{%
%\psline(-2,0)
\psTDist[nue=9,yunit=1]{\z}{4}
\psline(\z,0)}
%\psTDist[linewidth=1pt,linecolor=fillColor!120,nue=9,yunit=1]{-4}{4}
%NonCentral
\savedata{\mydata}[
-4,4.95603884931306e-07
-3.75,8.27266484115796e-07
-3.5,1.41017659064221e-06
-3.25,2.45724910327064e-06
-3,4.38081829512438e-06
-2.75,7.99628465696469e-06
-2.5,1.49489511813261e-05
-2.25,2.86209005229132e-05
-2,5.60761577907409e-05
-1.75,0.000112246283638675
-1.5,0.000228885682700408
-1.25,0.000473385461861131
-1,0.000986904571583903
-0.75,0.00205706746253531
-0.5,0.00424346475653148
-0.25,0.00856135144220627
0,0.0166768245538877
0.25,0.0309605598258274
0.5,0.0541363810101856
0.75,0.0883066522197213
1,0.133507678070106
1.25,0.186520662362244
1.5,0.240892502696099
1.75,0.288544668758476
1.833,0.3015716
2,0.32229011250974
2.25,0.337962254785326
2.5,0.335200493792012
2.75,0.316828855923198
3,0.287451252549856
3.25,0.252010187554509
3.5,0.214775358753859
3.75,0.178873351874724
4,0.146242775800368
4.25,0.117829676682817
4.5,0.0938663221305527
4.75,0.0741367598730511
5,0.058186348552428
5.25,0.0454670983318004
5.5,0.035427681827488
5.75,0.0275623914314711
6,0.0214327192008265
6.25,0.0166723370299849
6.5,0.0129830403846555
6.75,0.0101265191618662
7,0.00791484135400984
7.25,0.0062012107493628
7.5,0.00487173441525535
7.75,0.00383845547186056
8,0.00303364899963482
]
\pscustom[fillstyle=solid, fillcolor=gray!15,linestyle=none,opacity=0.1]{
\listplot[plotstyle=curve,showpoints=false,linecolor=darkgray,xEnd=1.833]{\mydata}
\psline(\z,0)
}
\listplot[plotstyle=curve,showpoints=false,linecolor=darkgray!85]{\mydata}
\psTDist[linewidth=1pt,linecolor=fillColor!120,nue=9,yunit=1]{-4}{4}
\psline[linewidth=0.75pt,linecolor=gray!75](\z,-0.015)(\z,\pdfT{0.0})
\pcline[linewidth=0.75pt,linecolor=gray!75]{*->}(\z,\pdfT{0.0})(6,\pdfT{0.0})\ncput{\colorbox{white}{\ttfamily Região de Rejeição}}
%Alfa e Beta
\psline[linearc=.90]{*->}(2.1,0.025)(2.25,0.05)(2.5,0.07)\uput[0](2.4,0.07){$\alpha$}
\psline[linearc=.90]{*->}(1.1,0.05)(0.85,0.085)(0.2,0.1)\uput[0](-0.25,0.1){$\beta$}
\uput[0](2,0.175){$1-\beta$}
\psline[linearc=.90]{->}(-1.6,0.3)(-1.3,0.3)(-1.,0.25)
\rput[0](-2.5,0.3){\ttfamily \small \shortstack[c]{Distribuição\\Amostral\\sob $H_0$}}
\psline[linearc=.90]{->}(4.7,0.2)(4.35,0.19)(4,0.16)
\rput[0](5.6,0.2){\ttfamily \small \shortstack[c]{Distribuição\\Amostral\\sob $H_1$}}
%Axes
\psaxes[Dx=1, yAxis=false,xLabels={-4,,-2,,0,,,,4,,6}]{->}(0,0)(-4,0)(8,0.5)
%\psaxes[Dy=0.1,labels=none, ticks=none, xAxis=false,linewidth=0.5pt]{->}(0,0)(-4,0)(4,0.5)
%Labels
\uput[-90](7.75,-.01){$T$}
%\uput[-150](-0.1,0.5){$f(t)$}
\uput[-90](\z,-0.01){$\, t_{0.95; (9)}$}
\uput[-10](-4.6,0.5){\ttfamily \textbf{Teste Unilateral à Direita}}
\end{pspicture}
\end{document}
```
This is the end result:
The gray line is the non-central t distribution (not exactly simmetric as the blue line which is the central t distribution).
| 1 | https://tex.stackexchange.com/users/227936 | 681446 | 316,176 |
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 | Two unicorns....
```
\documentclass[12pt]{article}
\usepackage{twemojis}
\usepackage{scalerel}
\begin{document}
$\scaleto{\mbox{\twemoji{unicorn}}}{100pt}$
\end{document}
```
```
\documentclass[12pt]{article}
\usepackage{emoji}
\usepackage{scalerel}
\begin{document}
$\scaleto{\mbox{\emoji{unicorn}}}{100pt}$
\end{document}
```
| 17 | https://tex.stackexchange.com/users/117876 | 681448 | 316,178 |
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 |
```
\documentclass{standalone}
\usepackage{tikz}
\usepackage{ducksay}
\begin{document}
\begin{tikzpicture}
\node {\ducksay[unicorn]{I'm an unicorn}};
\end{tikzpicture}
\end{document}
```
| 32 | https://tex.stackexchange.com/users/36296 | 681453 | 316,180 |
https://tex.stackexchange.com/questions/681452 | 13 | I recently noticed that a new primitive, `\deferred`, was added to luatex ([relevant texlive git changes](https://github.com/TeX-Live/texlive-source/commit/c8ef93f19a2564ae4ea8b6f2bb435329f8322f7a#diff-acfe7b8f6b0f56936b13e5e55fc424a41e171309fe34ae151ef2c5aa92e3380b)). The [luatex manual](https://tug.org/svn/texlive/trunk/Master/texmf-dist/doc/luatex/base/luatex.pdf?revision=65866&view=co) is austere in its examples and explanations for most things, and I see essentially nothing about `\deferred` other than a mention as a *prefix* on page 47 (not sure if this is the same thing) and its appearance in the big list of primitives on page 207.
What does `\deferred` do? My naïve guess based on the git changes is that it's some counterpart to [`\immediate`](https://tex.stackexchange.com/q/20444/208544), possibly related to the new "late special" feature. Beyond what it does, does anyone have an example document in which the new primitive is used to do something not previously possible?
**P.S.** If your texlive is not new enough, you can see that it is actually a proper "command" with [this example](https://texlive.net/run?%25%20!TEX%20lualatex%0A%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0Aabc%20%5Cdeferred%7B%7D%0A%5Cend%7Bdocument%7D) on texlive.net.
| https://tex.stackexchange.com/users/208544 | What does the new luatex primitive \deferred do? | false | Combine the TeX Live Guide---2023, [sec. 9.2 *Present: 2023*](https://tug.org/texlive/doc/texlive-en/texlive-en.html#x1-920009.2)
>
> Cross-engine extensions (except in original TeX and e-TeX): `\special` followed by a new keyword “`shipout`” delays expansion of the argument tokens until `\shipout` time, as with a non-`\immediate\write`.
>
>
>
and the LuaTeX Reference Manual (Feb 2023, v1.16), sec. 3.2.1 *Less primitives*
>
> [...] Here we show the options that can be passed to the extensions. The `shipout` option is a compatibility feature. Instead one can use the `deferred` prefix.
>
>
>
> ```
> \pdfextension literal
> [shipout] [ direct | page | raw ] { tokens }
> ...
>
> ```
>
>
I think it means, for example
* `\pdfextension literal shipout direct {<tokens>}` (using the new option `shipout`) and
* `\deferred\pdfextenion literal direct {<tokens>}` (using the new primitive `\deferred` acting as a prefix)
do the same thing.
Thus perhaps in LuaTeX Reference Manual it's better to use `\deferred` instead of the current `deferred`.
| 10 | https://tex.stackexchange.com/users/79060 | 681459 | 316,181 |
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 | Approach:
* prepare a (simple) pixelated drawing
* place nodes like pixels, filled with some color
Details:
* most colors predefined
* `\pix` introduced as shorthand notation
* shown: classical lines with `\node ... {};`
* later: shorthands, with `;` being absorbed: `\pix{}{}{}`
Some ideas for refinement:
* node shapes yould be circle, triangle etc. to modify the pixels appearance
* pixels of same color could be placed by `for` loops
* a row or column of colored pixels could be coded for programming and decoded for drawing by tikz
```
\documentclass[10pt, border=3mm]{standalone}
\usepackage{color}
\usepackage{tikz}
% ~~~ (most) colors ~~~~~~~~~~~~~~~~~~~~~~~
\definecolor{pnk}{RGB}{244,173,203}
\definecolor{yel}{RGB}{245,233,49}
\definecolor{bld}{RGB}{110,181,233}
\definecolor{bll}{RGB}{180,220,246}
\definecolor{blu}{RGB}{145,200,239}
% ~~~ short hand notation ~~~~~~~~~~~~~~~~
\newcommand\pix[3]{ \node [fill=#1] at (#2/4,#3/4) {};}
\begin{document}
\tikz{
% ~~~ starting somewhere ~~~~~~~~~~
\node [fill=pnk] at (0,0) {};% so it begins
\node [fill=bld] at (1/4,0) {};
\node [fill=bll] at (2/4,0) {};
\node [fill=blu] at (3/4,0) {};
\node [fill=blu] at (4/4,0) {};
\node [fill=pnk] at (5/4,0) {};
\node [fill=bll] at (6/4,0) {};
% ~~~ line(s) above ~~~~~~~~~
\pix{pnk}{1}{1}% using short hand notation
\pix{bld}{2}{1}
\pix{pnk}{4}{1}
\pix{bld}{5}{1}
\pix{blu}{6}{1}
\pix{blu}{7}{1}
\pix{blu}{8}{1}
\pix{pnk}{4}{2}
\pix{bll}{5}{2}
\pix{black}{6}{2}
\pix{bll}{7}{2}
\pix{bll}{8}{2}
\pix{pnk}{4}{3}
\pix{pnk}{5}{3}
\pix{pnk}{6}{3}
\pix{yel}{7}{3}
\pix{pnk}{5}{4}
\pix{pnk}{6}{4}
\pix{yel}{8}{4}
% ~~~ line(s) below ~~~~~~~~~~
\pix{pnk}{1}{-1}
\pix{blu}{2}{-1}
\pix{blu}{3}{-1}
\pix{blu}{4}{-1}
\pix{bll}{5}{-1}
\pix{blu}{6}{-1}
\pix{pnk}{1}{-2}
\pix{blu}{2}{-2}
\pix{bll}{3}{-2}
\pix{bld}{5}{-2}
\pix{bll}{7}{-2}
\pix{gray!40}{2}{-3}
\pix{gray!40}{5}{-3}
\pix{gray!40}{7}{-3}
}
\end{document}
```
| 12 | https://tex.stackexchange.com/users/245790 | 681460 | 316,182 |
https://tex.stackexchange.com/questions/681395 | 3 | I have been trying to use `\flushbottom` in my documents instead of the lazy `\raggedbottom` to produce documents with higher typographic quality (hopefully). I am wondering if there is a parameter similar to `\tolerance`, but for deciding page breaks.
I want LaTeX to do the following regarding page breaking (or maybe I think I do): If the page cannot be filled, then LaTeX should attempt to fill it by (1) maximally stretching/shrinking the vertical glue no more than its max stretch/shrink and (2) after doing (1), page break at that point even if it leaves extra white space at the bottom of the page.
The closest solution to this issue that I've found involves adding flexible vertical glue on the bottom of page, but that isn't quite what I would like.
[Avoid parskip overstretching](https://tex.stackexchange.com/questions/612098/avoid-parskip-overstretching)
| https://tex.stackexchange.com/users/278534 | Is there a parameter like "vertical" \tolerance? | true | Interesting puzzle, but not impossible to solve.
It is true that there is no vertical tolerance because pages are cut off the scroll one by one, but we can determine the badness of each page made this way. And what you are asking for is that the badness is not exeeding 100.
LaTeX doesn't offer hooks into that part of the output routine, but here is a little implementation that implements your rule:
```
\documentclass{article}
\usepackage{kantlipsum}
\flushbottom
\setlength\textheight{8\baselineskip}
%\showoutput
\AddToHook{cmd/@makecol/before}{%
\setbox0\vbox to\ht255{\unvcopy255}%
\typeout{==> Badness of this page body: \the\badness}%
\ifnum \badness > 100
\typeout{===> ... setting ragged}%
\setbox255\vbox{\unvbox255 \vfill}%
\else
\typeout{===> ... ok}%
\fi
}
\begin{document}
\kant[1][1-4]
\kant[2][1]
\kant[3][1]
\kant[4][1]
\kant[5][1]
\kant[6][1]
\end{document}
```
The badness is calculated as 100 times the cube of the the ratio by which the glue has to stretch or shrink, so 100 means it has stretched less or equal to the amount it is allowed to stretch.
However, you will find that this is way too conservative, you should probably allow for stretching twice or even more (2.5/3?) than that, so a value of 800 or 1600 or ... is more appropriate.
---
Actually, rereading your rule: you want to apply the stretch to the maximum and then fill, so it gets a little more complicated. In that case you would need to also measure the natural height of 255 without stretch, and then use that to figure out how much space is missing that you need to fill and the badness value to figure out how much glue you need to add at the bottom to get to a badness of 100 (instead of simply using `\vfill`as I did above). Excerise for the reader :-)
| 4 | https://tex.stackexchange.com/users/10109 | 681461 | 316,183 |
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 | Plot it.
```
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[axis equal image]
\addplot[no marks, domain={-0.95:1.85}] {-2*pow(x,5)+3.5*pow(x,4)};
\addplot[no marks, domain={-0.95:3.5}] {-0.35*pow(x-0.5,2)+6.25};
\addplot[no marks, domain={-3.5:-0.95}] {-0.15*x+5.25};
\addplot[no marks, domain={-3.5:-0.95}] {-0.5*x+4};
\addplot[no marks, domain={-180:180}] ({0.25*cos(x)-0.25}, {0.25*sin(x)+3.5});
\end{axis}
\end{tikzpicture}
\end{document}
```
| 17 | https://tex.stackexchange.com/users/47927 | 681464 | 316,185 |
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 | Merger of MS-SPO's [nice idea](https://tex.stackexchange.com/a/681460/47927) and an [older answer](https://tex.stackexchange.com/a/656691/47927) of mine:
```
\documentclass[border=10Mm]{standalone}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
% Original Image: Hszone/Wirestock Creators / stock.adobe.com
% https://stock.adobe.com/de/images/unicorn-pixel-art-vector/501392488
\begin{filecontents}{image.dat}
.2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 .2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 .2 .2 0 0 0 0 0 0 0 0 0 .5 0 0 0 0 0 0 0 0 0 0 0 0
0 0 .2 .2 .2 0 0 0 0 0 0 .5 0 .5 0 0 0 0 0 0 0 0 0 0 0
0 0 .2 .2 .2 .2 0 0 0 0 0 .5 0 .5 0 0 0 0 0 0 0 0 0 0 0
0 0 0 .2 .2 .2 .2 .8 .8 .8 .8 0 0 0 .8 .8 .8 .8 0 0 0 0 0 0 0
0 0 0 0 .2 .8 .8 .8 .8 .8 .8 0 0 .8 .8 .8 .8 .8 .8 .8 0 0 0 0 0
0 0 0 0 0 .8 .8 .8 0 0 0 0 0 .8 .8 .8 .8 .8 .8 .8 .8 0 0 0 0
0 0 .8 0 .8 .8 .8 0 0 0 0 0 0 0 .8 .8 .8 .8 .8 .8 .8 .8 0 0 0
0 0 0 .8 .8 0 0 0 0 0 0 0 0 0 0 .6 .6 .6 .8 .8 .8 .8 .8 0 0
0 0 0 0 .5 0 0 0 0 0 0 0 0 0 0 0 .6 .6 .6 .6 .8 .8 .8 0 0
0 0 0 .5 0 0 0 1 0 0 0 0 0 0 0 0 0 .4 .6 .6 .6 .8 .8 .8 0
0 0 .5 0 0 0 0 0 0 0 0 0 0 .5 0 0 0 .4 .6 .6 .6 .8 .8 .8 .8
0 .5 0 0 0 0 0 0 0 0 0 0 0 .5 0 0 0 .4 .4 .6 .6 .6 .8 .8 .8
.5 0 0 0 0 0 0 0 0 0 0 0 .5 0 0 0 0 .4 .4 .6 .6 .6 .8 .8 .8
.5 0 .5 0 0 0 0 0 .5 .5 .5 .5 0 0 0 0 0 .4 .4 .6 .6 .6 .8 .8 .8
.5 0 0 0 0 0 .5 .5 0 .5 0 0 0 0 0 0 .4 .4 .4 .6 .6 .6 .8 .8 .8
0 .5 .5 .5 .5 .5 0 0 0 0 .5 0 0 0 0 .4 .4 .4 .6 .6 .6 .6 .8 .8 .8
0 0 0 0 0 0 0 0 0 0 .5 0 0 0 .4 .4 .4 .4 .6 .6 .6 .6 .8 .8 .8
0 0 0 0 0 0 0 0 0 0 .5 0 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .8 .8 0
0 0 0 0 0 0 0 0 0 0 .5 .4 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .8 .8 0
0 0 0 0 0 0 0 0 0 .4 .4 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .8 .8 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .6 .6 .8 .8 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .6 .6 .8 .8 0 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .4 .6 .6 .6 .6 .6 .6 .6 .8 0 0 0 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .6 .6 .6 .6 .6 .6 .8 .8 0 0 0 0 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .6 .6 .6 0 0 .8 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .6 .6 0 0 0 .8 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 .4 .4 .6 .6 0 0 0 0 .8 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 .6 .6 0 0 0 0 0 0 0 0 0 0 0
\end{filecontents}
\pgfplotstableread{image.dat}{\pixeldata}
\begin{document}
\begin{tikzpicture}
\pgfplotstablegetcolsof{\pixeldata}
\pgfmathsetmacro{\datacols}{\pgfplotsretval-1}
\pgfplotstablegetrowsof{\pixeldata}
\pgfmathsetmacro{\datarows}{\pgfplotsretval-1}
\foreach \i in {0,...,\datarows} {
\foreach \j in {0,...,\datacols} {
\pgfplotstablegetelem{\i}{\j}\of{\pixeldata}
\pgfmathsetmacro{\pixelvalue}{\pgfplotsretval*100}
\fill[black!\pixelvalue] (\j,-\i) rectangle +(1,1);
}
}
\end{tikzpicture}
\end{document}
```
---
Let's add some sprinkle of [Sebastiano's answer](https://tex.stackexchange.com/a/681448/47927) to it:
```
\documentclass[border=10Mm]{standalone}
\usepackage{emoji}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
% Original Image: Hszone/Wirestock Creators / stock.adobe.com
% https://stock.adobe.com/de/images/unicorn-pixel-art-vector/501392488
\begin{filecontents}{image.dat}
.2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 .2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 .2 .2 0 0 0 0 0 0 0 0 0 .5 0 0 0 0 0 0 0 0 0 0 0 0
0 0 .2 .2 .2 0 0 0 0 0 0 .5 0 .5 0 0 0 0 0 0 0 0 0 0 0
0 0 .2 .2 .2 .2 0 0 0 0 0 .5 0 .5 0 0 0 0 0 0 0 0 0 0 0
0 0 0 .2 .2 .2 .2 .8 .8 .8 .8 0 0 0 .8 .8 .8 .8 0 0 0 0 0 0 0
0 0 0 0 .2 .8 .8 .8 .8 .8 .8 0 0 .8 .8 .8 .8 .8 .8 .8 0 0 0 0 0
0 0 0 0 0 .8 .8 .8 0 0 0 0 0 .8 .8 .8 .8 .8 .8 .8 .8 0 0 0 0
0 0 .8 0 .8 .8 .8 0 0 0 0 0 0 0 .8 .8 .8 .8 .8 .8 .8 .8 0 0 0
0 0 0 .8 .8 0 0 0 0 0 0 0 0 0 0 .6 .6 .6 .8 .8 .8 .8 .8 0 0
0 0 0 0 .5 0 0 0 0 0 0 0 0 0 0 0 .6 .6 .6 .6 .8 .8 .8 0 0
0 0 0 .5 0 0 0 1 0 0 0 0 0 0 0 0 0 .4 .6 .6 .6 .8 .8 .8 0
0 0 .5 0 0 0 0 0 0 0 0 0 0 .5 0 0 0 .4 .6 .6 .6 .8 .8 .8 .8
0 .5 0 0 0 0 0 0 0 0 0 0 0 .5 0 0 0 .4 .4 .6 .6 .6 .8 .8 .8
.5 0 0 0 0 0 0 0 0 0 0 0 .5 0 0 0 0 .4 .4 .6 .6 .6 .8 .8 .8
.5 0 .5 0 0 0 0 0 .5 .5 .5 .5 0 0 0 0 0 .4 .4 .6 .6 .6 .8 .8 .8
.5 0 0 0 0 0 .5 .5 0 .5 0 0 0 0 0 0 .4 .4 .4 .6 .6 .6 .8 .8 .8
0 .5 .5 .5 .5 .5 0 0 0 0 .5 0 0 0 0 .4 .4 .4 .6 .6 .6 .6 .8 .8 .8
0 0 0 0 0 0 0 0 0 0 .5 0 0 0 .4 .4 .4 .4 .6 .6 .6 .6 .8 .8 .8
0 0 0 0 0 0 0 0 0 0 .5 0 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .8 .8 0
0 0 0 0 0 0 0 0 0 0 .5 .4 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .8 .8 0
0 0 0 0 0 0 0 0 0 .4 .4 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .8 .8 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .6 .6 .8 .8 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .6 .6 .8 .8 0 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .4 .6 .6 .6 .6 .6 .6 .6 .8 0 0 0 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .6 .6 .6 .6 .6 .6 .8 .8 0 0 0 0 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .6 .6 .6 0 0 .8 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .6 .6 0 0 0 .8 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 .4 .4 .6 .6 0 0 0 0 .8 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 .6 .6 0 0 0 0 0 0 0 0 0 0 0
\end{filecontents}
\pgfplotstableread{image.dat}{\pixeldata}
\begin{document}
\begin{tikzpicture}[x=0.33cm, y=0.33cm]
\pgfplotstablegetcolsof{\pixeldata}
\pgfmathsetmacro{\datacols}{\pgfplotsretval-1}
\pgfplotstablegetrowsof{\pixeldata}
\pgfmathsetmacro{\datarows}{\pgfplotsretval-1}
\foreach \i in {0,...,\datarows} {
\foreach \j in {0,...,\datacols} {
\pgfplotstablegetelem{\i}{\j}\of{\pixeldata}
\pgfmathsetmacro{\pixelvalue}{\pgfplotsretval}
\ifdim\pixelvalue pt>0pt\relax
\node[scale=\pixelvalue] at (\j,-\i) {\emoji{unicorn}};
\fi
}
}
\end{tikzpicture}
\end{document}
```
Variation with mirrored "eye pixel":
```
\documentclass[border=10Mm]{standalone}
\usepackage{emoji}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
% Original Image: Hszone/Wirestock Creators / stock.adobe.com
% https://stock.adobe.com/de/images/unicorn-pixel-art-vector/501392488
\begin{filecontents}{image.dat}
.2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 .2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 .2 .2 0 0 0 0 0 0 0 0 0 .5 0 0 0 0 0 0 0 0 0 0 0 0
0 0 .2 .2 .2 0 0 0 0 0 0 .5 0 .5 0 0 0 0 0 0 0 0 0 0 0
0 0 .2 .2 .2 .2 0 0 0 0 0 .5 0 .5 0 0 0 0 0 0 0 0 0 0 0
0 0 0 .2 .2 .2 .2 .8 .8 .8 .8 0 0 0 .8 .8 .8 .8 0 0 0 0 0 0 0
0 0 0 0 .2 .8 .8 .8 .8 .8 .8 0 0 .8 .8 .8 .8 .8 .8 .8 0 0 0 0 0
0 0 0 0 0 .8 .8 .8 0 0 0 0 0 .8 .8 .8 .8 .8 .8 .8 .8 0 0 0 0
0 0 .8 0 .8 .8 .8 0 0 0 0 0 0 0 .8 .8 .8 .8 .8 .8 .8 .8 0 0 0
0 0 0 .8 .8 0 0 0 0 0 0 0 0 0 0 .6 .6 .6 .8 .8 .8 .8 .8 0 0
0 0 0 0 .5 0 0 0 0 0 0 0 0 0 0 0 .6 .6 .6 .6 .8 .8 .8 0 0
0 0 0 .5 0 0 0 1 0 0 0 0 0 0 0 0 0 .4 .6 .6 .6 .8 .8 .8 0
0 0 .5 0 0 0 0 0 0 0 0 0 0 .5 0 0 0 .4 .6 .6 .6 .8 .8 .8 .8
0 .5 0 0 0 0 0 0 0 0 0 0 0 .5 0 0 0 .4 .4 .6 .6 .6 .8 .8 .8
.5 0 0 0 0 0 0 0 0 0 0 0 .5 0 0 0 0 .4 .4 .6 .6 .6 .8 .8 .8
.5 0 .5 0 0 0 0 0 .5 .5 .5 .5 0 0 0 0 0 .4 .4 .6 .6 .6 .8 .8 .8
.5 0 0 0 0 0 .5 .5 0 .5 0 0 0 0 0 0 .4 .4 .4 .6 .6 .6 .8 .8 .8
0 .5 .5 .5 .5 .5 0 0 0 0 .5 0 0 0 0 .4 .4 .4 .6 .6 .6 .6 .8 .8 .8
0 0 0 0 0 0 0 0 0 0 .5 0 0 0 .4 .4 .4 .4 .6 .6 .6 .6 .8 .8 .8
0 0 0 0 0 0 0 0 0 0 .5 0 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .8 .8 0
0 0 0 0 0 0 0 0 0 0 .5 .4 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .8 .8 0
0 0 0 0 0 0 0 0 0 .4 .4 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .8 .8 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .6 .6 .8 .8 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .6 .6 .8 .8 0 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .4 .6 .6 .6 .6 .6 .6 .6 .8 0 0 0 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .6 .6 .6 .6 .6 .6 .8 .8 0 0 0 0 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .6 .6 .6 0 0 .8 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 .4 .4 .4 .6 .6 0 0 0 .8 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 .4 .4 .6 .6 0 0 0 0 .8 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 .6 .6 0 0 0 0 0 0 0 0 0 0 0
\end{filecontents}
\pgfplotstableread{image.dat}{\pixeldata}
\begin{document}
\begin{tikzpicture}[x=0.33cm, y=0.33cm]
\pgfplotstablegetcolsof{\pixeldata}
\pgfmathsetmacro{\datacols}{\pgfplotsretval-1}
\pgfplotstablegetrowsof{\pixeldata}
\pgfmathsetmacro{\datarows}{\pgfplotsretval-1}
\foreach \i in {0,...,\datarows} {
\foreach \j in {0,...,\datacols} {
\pgfplotstablegetelem{\i}{\j}\of{\pixeldata}
\pgfmathsetmacro{\pixelvalue}{\pgfplotsretval}
\pgfmathsetmacro{\pixelmirror}{(\i == 11 && \j == 7 ? 1 : 0)}
\ifdim\pixelvalue pt>0pt\relax
\ifnum\pixelmirror=1\relax
\node[xscale=-\pixelvalue, yscale=\pixelvalue]
at (\j,-\i) {\emoji{unicorn}};
\else
\node[scale=\pixelvalue]
at (\j,-\i) {\emoji{unicorn}};
\fi
\fi
}
}
\end{tikzpicture}
\end{document}
```
| 25 | https://tex.stackexchange.com/users/47927 | 681468 | 316,186 |
https://tex.stackexchange.com/questions/681452 | 13 | I recently noticed that a new primitive, `\deferred`, was added to luatex ([relevant texlive git changes](https://github.com/TeX-Live/texlive-source/commit/c8ef93f19a2564ae4ea8b6f2bb435329f8322f7a#diff-acfe7b8f6b0f56936b13e5e55fc424a41e171309fe34ae151ef2c5aa92e3380b)). The [luatex manual](https://tug.org/svn/texlive/trunk/Master/texmf-dist/doc/luatex/base/luatex.pdf?revision=65866&view=co) is austere in its examples and explanations for most things, and I see essentially nothing about `\deferred` other than a mention as a *prefix* on page 47 (not sure if this is the same thing) and its appearance in the big list of primitives on page 207.
What does `\deferred` do? My naïve guess based on the git changes is that it's some counterpart to [`\immediate`](https://tex.stackexchange.com/q/20444/208544), possibly related to the new "late special" feature. Beyond what it does, does anyone have an example document in which the new primitive is used to do something not previously possible?
**P.S.** If your texlive is not new enough, you can see that it is actually a proper "command" with [this example](https://texlive.net/run?%25%20!TEX%20lualatex%0A%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0Aabc%20%5Cdeferred%7B%7D%0A%5Cend%7Bdocument%7D) on texlive.net.
| https://tex.stackexchange.com/users/208544 | What does the new luatex primitive \deferred do? | true | Exactly as muzimuzhi said: `\deferred` is a LuaTeX alternative to the `shipout` keyword. That is, both should do the exact same thing.
The `shipout` keyword was implemented in pdfTeX (and ~~copy-pasted~~ ported to XeTeX, e(u)-pTeX, and Aleph) because we needed a “late expansion” for `\special`. When Hans implemented it for LuaTeX, he probably thought a `\deferred` prefix is better because it's symmetric to `\immediate`. muzimuzhi already answered your question spot-on, so here's an explanation of what `\deferred` or the `shipout` keyword are for:
When you use `\special`, it fully expands the argument (pretty much like `\expanded`), then adds the expanded token list as a whatsit node to the output list. That node is then written as-is to the output `.pdf` or whatever format the engine produces.
The problem with that, is that when TeX is reading your `\special`, it doesn't know it what page that `\special` will be placed, so using things like `\thepage` will sometimes give the wrong information.
In the example (pdfTeX) document below, we are typesetting one long paragraph across three pages: at the time TeX reads the `\special` (when it is building the horizontal list for the paragraph), it is still processing the first paragraph in page 1 (first it builds the list of nodes, then it breaks the list into lines, then those lines across pages), so `\count0` (the page number) is 1, so it colours the text red.
If you switch to `\special shipout` it will hold the token list unexpanded until the page shipout (when everything is in its final position in the page), and only then it expands the token list, and evaluates the value of `\count0`. At this point, TeX already knows it's on page , so it colours blue.
```
\input color.tex
\hsize=5cm \pdfpagewidth=10cm
\vsize=5cm \pdfpageheight=10cm
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\special{pdf:%
% \special shipout{pdf:%
\ifnum\count0=1 1 \else 0 \fi 0 \ifnum\count0=1 0 \else 1 \fi rg
\ifnum\count0=1 1 \else 0 \fi 0 \ifnum\count0=1 0 \else 1 \fi RG}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\bye
```
With `\special`:
>
>
>
With `\special shipout` (or `\deferred\special` in LuaTeX):
>
>
>
All of this was already possible without these extensions, but it required you to run TeX multiple times to make TeX write your `\special` on the page, then find out where it ended up, and then use that information (stored in a temporary file) to do the right choice later. This extension lets you do all in one go, without extra data structures and build steps.
| 11 | https://tex.stackexchange.com/users/134574 | 681471 | 316,188 |
https://tex.stackexchange.com/questions/565010 | 1 | I'm using a `Glyph` tip from `tikz-cd` to get arrows like `\looparrowright` and friends.
However I would like to change the color. `latex` compiles the following MWE correctly, but `xelatex` leaves the loop black while coloring the rest of the arrow red.
```
\documentclass{standalone}
\usepackage{amsmath,amssymb}
\usepackage{tikz-cd}
\tikzset{
loop/.tip={Glyph[glyph math command=looparrowleft, swap]},
loop'/.tip={Glyph[glyph math command=looparrowleft]}
}
\begin{document}
\begin{tikzcd}
A \ar[r, loop->, red] & B \\
% This arrow is red, but the loop part of the tip is black.
\end{tikzcd}
\end{document}
```
| https://tex.stackexchange.com/users/185446 | Set the color of a tikz-cd Glyph arrow tip with xelatex | false | This seems to be related to the [same old XeLaTeX problems](https://github.com/pgf-tikz/pgf/issues/750) PGF/TikZ has when it comes to colors.
As an alternative to fixing `\pgftext` or somehow sneaking another color `\color` command inside, here's an arrow tip `Loop` that draws something similar. This uses only arc (with radius `inset`) in a loop with diameter `length` (± linewidth fuzziness). The `\looparrowleft` glyph you use seem to use a Bézier curve instead of an arc with a fixed radius. If that is expected, a few adjustments and fiddling around with good controls values are needed.
You can fill the loop part, you can `swap` it and `reversed` with in my opinion pretty good results.
Code
----
```
\documentclass[tikz]{standalone}
\usetikzlibrary{cd}
\pgfdeclarearrow{
name = Loop,
parameters = {\the\pgfarrowlength,\the\pgfarrowinset,\ifpgfarrowopen o\fi},
setup code =
\ifdim\pgfarrowlength<\dimexpr2\pgfarrowinset+\pgflinewidth\relax
\pgfarrowlength\dimexpr2\pgfarrowinset+\pgflinewidth\relax
\fi
\pgfarrowssettipend{\pgfarrowlength}%
\pgfarrowssetlineend{.5\pgflinewidth}%
\pgfarrowssavethe\pgfarrowlength
\pgfarrowssavethe\pgfarrowinset,
defaults = {length = +3pt +.3 +0, inset = +.75pt +1 +0},
drawing code={%
\pgfsetroundcap
\pgfpathmoveto{\pgfqpoint{.5\pgflinewidth}{0pt}}%
\pgfpathlineto{\pgfqpoint{\dimexpr\pgfarrowlength-.5\pgflinewidth-\pgfarrowinset}
{0pt}}%
\pgfpatharc{+-90}{+0}{+\pgfarrowinset}%
\pgfpathlineto{\pgfqpoint{\dimexpr\pgfarrowlength-.5\pgflinewidth}
{\dimexpr\pgfarrowlength-.5\pgflinewidth-\pgfarrowinset}}%
\pgfpatharc{+0}{+90}{+\pgfarrowinset}%
\pgfpathlineto{\pgfqpoint{\dimexpr\pgfarrowinset+.5\pgflinewidth}
{\dimexpr\pgfarrowlength-.5\pgflinewidth}}%
\pgfpatharc{+90}{+180}{+\pgfarrowinset}%
\pgfpathlineto{\pgfqpoint{\dimexpr\pgfarrowinset+.5\pgflinewidth-\pgfarrowinset}
{\dimexpr-\pgfarrowlength+.5\pgflinewidth}}%
\ifpgfarrowopen\pgfusepathqstroke\else\pgfusepathqfillstroke\fi}}
\tikzset{
Math Loop/.tip = { Glyph[glyph math command=looparrowleft] },
Loop Left/.tip = {Loop[open, swap]},
Loop Right/.tip = {Loop[open]}}
\begin{document}
\begin{tikzcd}
A \ar[r, {Loop Left - Loop Right[blue]}, red] & B \\
C \ar[r, /tikz/arrows={Loop Right[fill=pgfstrokecolor!50!yellow]
- Loop Left[yellow!80!black, reversed]}, green] & D
\end{tikzcd}
\color{blue}a \begin{pgfpicture}\pgftext{a}\end{pgfpicture}
\end{document}
```
Output
------
| 1 | https://tex.stackexchange.com/users/16595 | 681474 | 316,190 |
https://tex.stackexchange.com/questions/669436 | 1 | Does anybody know how to plot a non-central t distribution using `pst-fun` from pstricks or tikz. For the central t, `pst-fun` has the function `psTDist`, but I can find a way to add a $\delta$ ncp to it.
For the central t is quite straigt foward:
```
\documentclass[border=5mm]{standalone}
\usepackage{pst-plot,pst-func}
\begin{document}
\psset{xunit=1cm,yunit=7.5cm}
\begin{pspicture}(-5.25,-0.05)(5.25,0.5)
% Valor de corte z
\newcommand\z{1.3}
%Dist
\psTDist[nue=9,yunit=1]{\z}{4}
\end{pspicture}
\end{document}
```
I wonder if I need just to generate the non-central t-distribution and plot the points overlapping.
Thansk!
| https://tex.stackexchange.com/users/227936 | Ploting a non-central T distribution with pst-func or tikz? | true | With a new version of `pst-func`. Could this be correct? The equations are not really easy ...
(nue -> n for the example)
```
\psset{xunit=1.25cm,yunit=7.5cm}
\begin{pspicture}(-6,-0.1)(6,0.7)
\psaxes[Dy=0.1]{->}(0,0)(-4.5,0)(5.5,0.5)
\psset{linewidth=1.5pt,plotpoints=100}
\psNonCentralTDist[linecolor=red,nue=4]{-4}{5}
\psNonCentralTDist[linecolor=blue,nue=4,lambda=2]{-4}{5}
\end{pspicture}
```
| 1 | https://tex.stackexchange.com/users/187802 | 681477 | 316,192 |
https://tex.stackexchange.com/questions/681475 | 0 | I've tried the following code, which didn't produce the line I expected.
```
\draw[-->] (have) [in=-90, out=-90, looseness=2.5] to (non);
```
| https://tex.stackexchange.com/users/294131 | How can I draw a dotted line with arrow using TikZ? | false | Your code can not be compiled:
* not defined MWE (Minimal working Example), a complete small document
* not defined coordinates ˛`have` and `non`
* wrong used sintax
So, just guessing, that you are after something like this:
```
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[dotted, ->] (0,0) to [in=-90, out=-90, looseness=2.5] (3,0);
\end{tikzpicture}
\end{document}
```
However, you might prefer to use `bbox`for define "smart" bounding box around your image, which eliminate white space below image:
```
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{bbox}
\begin{document}
\begin{tikzpicture}[bezier bounding box] ]
\ \draw[dotted,->] (0,0) to [in=-90, out=-90, looseness=2.5] (3,0);
\end{tikzpicture}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/18189 | 681478 | 316,193 |
https://tex.stackexchange.com/questions/681444 | 0 | I have a table, but some rows are bigger than others, because height of some has been changed due to `p{2cm}`. In these cases it would be wise to have rows centered. Suggested solution is to use `\arraystretch`, but it's not feasible because it stretches even these rows which do not need any changes, making already huge tables unnecessarily bigger.
```
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{float}
\usepackage{makecell}
\usepackage{multirow}
\begin{document}
\section{Introduction}
\begin{table}[!htbp]
\small
\begin{center}
\begin{tabular}{ |>{\centering\arraybackslash}p{2cm}||c|c|c|c|c| }
\hline
\multirow{2}{*}{} & \multicolumn{5}{c|}{Some text} \\
\cline{2-6}
& 1 & 2 & 3 & 4 & 5 \\
\hline
\hline
Row 1 & val1 & val2 & val2 & val3 & val4 \\
\hline
Row 2 but this one is very long & val1 centered & val2 centered & val2 centered & val3 centered & val4 centered \\
\hline
\end{tabular}
\end{center}
\caption{table} \label{lbl}
\end{table}
\end{document}
```
| https://tex.stackexchange.com/users/289855 | Centering vertically specific rows | false | Considering @DavidCarlisle comment:
```
\documentclass[12pt]{article}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
%\usepackage[utf8]{inputenc} % it is part of LaTeX, you not need to load anymore
%\usepackage{float} % not used
%\usepackage{makecell} % not used
\usepackage{array} % needed for define `m` column type
\usepackage{multirow}
\begin{document}
\section{Introduction}
\begin{table}[!htbp]
\small
%\begin{center} % table is nicer, if you replace it with `\centering`
\begin{tabular}{ |>{\centering\arraybackslash}m{2cm}||c|c|c|c|c| }
\hline
\multirow{2}{*}{} & \multicolumn{5}{c|}{Some text} \\
\cline{2-6}
& 1 & 2 & 3 & 4 & 5 \\
\hline
\hline
Row 1 & val1 & val2 & val2 & val3 & val4 \\
\hline
Row 2 but this one is very long & val1 centered & val2 centered & val2 centered & val3 centered & val4 centered \\
\hline
\end{tabular}
\end{center}
\caption{table} \label{lbl}
\end{table}
\end{document}
```
(red lines indicate page layout)
As you can see, your table is wider than available space for text in page. To correct this, you have two options:
* increase `\textwidth` by use of `geometry` package
* enables automatic split cells contents in all cell in table. For this you should define `m` column type or use `tabularx` table, where redefine `X` columns to
```
\renewcommand\tabularxcolumn[1]{m{#1}}
```
or use `tabularray`package.
An example for second options which use `tabularray` package:
```
\documentclass[12pt]{article}
\usepackage{tabularray}
\begin{document}
\section{Introduction}
\begin{table}[!htbp]
\small
\begin{tblr}{hlines, vlines,
colspec = {Q[c, m, wd=20mm] *{5}{X[c, m]}}
}
\SetCell[r=2]{c}
& \SetCell[c=5]{c} Some text
& & & & \\
& 1 & 2 & 3 & 4 & 5 \\
Row 1 & val1 & val2 & val2 & val3 & val4 \\
Row 2 but this one is very long
& val 1 centered & val 2 centered & val 2 centered & val 3 centered & val 4 centered \\
\end{tblr}
\caption{table} \label{lbl}
\end{table}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/18189 | 681480 | 316,194 |
https://tex.stackexchange.com/questions/681215 | 3 | In my document, I have a table, I want to use `\setlength{\tabcolsep}{18pt}` but since there is one more table, this also affects the other, which I don't want to change. Therefore I thought of creating another ".tex" file which has only 1 table and then including it in the main file, but this didn't work. What can I do? Actually, my main purpose is to expand the table to the column width without changing the font size.
```
\setlength{\tabcolsep}{18pt}
\begin{tabular}{|cc|cc|}
\hline
\multicolumn{2}{|c|}{\textbf{Orbital positions}} & \multicolumn{2}{c|}{\textbf{Total solar irradiance}} \\ \hline
\multicolumn{1}{|c|}{\textbf{Earth}} & \textbf{Moon} & \multicolumn{1}{c|}{\textbf{near side}} & \textbf{far side} \\ \hline
\multicolumn{1}{|c|}{perihelion} & perigee & \multicolumn{1}{c|}{1,401.65} & 1,415.54 \\ \hline
\multicolumn{1}{|c|}{perihelion} & apogee & \multicolumn{1}{c|}{1,400.83} & 1,416.36 \\ \hline
\multicolumn{1}{|c|}{aphelion} & perigee & \multicolumn{1}{c|}{1,311.18} & 1,323.74 \\ \hline
\multicolumn{1}{|c|}{aphelion} & apogee & \multicolumn{1}{c|}{1,310.44} & 1,324.49 \\ \hline
\end{tabular}
```
Additionally I didn't write `\begin{table}` because when I write it that the font-type was changing.
| https://tex.stackexchange.com/users/293871 | Table decleration | false | It is very easy to achieve what you want using `tabularray` package:
```
\documentclass{article}
\usepackage{tabularray}
\usepackage{caption}
\begin{document}
Some text only to show the table has the width of the text line.
It is very easy to achieve what you want using \texttt{tabularray} package:
\begin{center}
\captionof{table}{My caption}
\begin{tblr}{colspec={*4{X[c]}},
hlines, vlines,
row{1-2}={font=\bfseries},
}
\SetCell[c=2]{c}Orbital positions & &
\SetCell[c=2]{c}Total solar irradiance & \\
Earth & Moon & near side & far side \\
perihelion & perigee & 1,401.65 & 1,415.54 \\
perihelion & apogee & 1,400.83 & 1,416.36 \\
aphelion & perigee & 1,311.18 & 1,323.74 \\
aphelion & apogee & 1,310.44 & 1,324.49 \\
\end{tblr}
\end{center}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/101651 | 681484 | 316,197 |
https://tex.stackexchange.com/questions/97613 | 9 | All I am trying to do is write an integration by parts table in LaTeX. I can't seem to find an .tex code examples anywhere though I have seen pictures of such tables in PDF form (like at <http://cazelais.disted.camosun.bc.ca/187/parts.pdf> for example). Hopefully someone can let me know real quick.
| https://tex.stackexchange.com/users/25765 | Tabular integration by parts | false | With `{NiceArray}` of `nicematrix`.
```
\documentclass{article}
\usepackage{nicematrix}
\usepackage{booktabs}
\usepackage{tikz}
\begin{document}
\[
\renewcommand{\arraystretch}{1.5}
\begin{NiceArray}{c @{\hspace*{1.0cm}} c}[create-medium-nodes]
\toprule
D & I \\
\cmidrule{1-2}
x^2 & e^2x \\
2x & \frac{1}{2} e^{2x} \\
2 & \frac{1}{4} e^{2x} \\
0 & \frac{1}{8} e^{2x} \\
\bottomrule
\CodeAfter
\begin{tikzpicture} [->, name suffix = -medium]
\draw [red] (2-1) -- node [above] {$+$} (3-2) ;
\draw [brown] (3-1) -- node [above] {$-$} (4-2) ;
\draw [blue] (4-1) -- node [above] {$+$} (5-2) ;
\end{tikzpicture}
\end{NiceArray}
\]
\end{document}
```
You need several compilations (because `nicematrix` uses PGF/Tikz nodes under the hood).
| 3 | https://tex.stackexchange.com/users/163000 | 681485 | 316,198 |
https://tex.stackexchange.com/questions/680856 | 0 | My goal is to create a table, that has columns which are fixed in width and which contain centered content.
This is my table which works fine:
```
\begin{tabular}{ | c | c | c | }
\hline
col1 & col2 & col3 \\ \hline
Inhalt & Inhalt & Inhalt \\ \hline
\end{tabular}
```
Fixed width for all three columns works also fine:
```
\begin{tabular}{ | m{1cm} | m{1cm} | m{1cm} | }
```
Fixed width and centered applied to only two columns works fine as well:
```
\begin{tabular}{ | >{\centering} m{1cm} | >{\centering} m{1cm} | c | }
```
Fixed width and centered applied to all three columns makes Texmaker print out an multiple errors:
```
\begin{tabular}{ | >{\centering} m{1cm} | >{\centering} m{1cm} | >{\centering} m{1cm} | }
```
Errors are:
For line 3
```
! Misplaced \noalign.\hline ->\noalign{\ifnum 0=`}\fi \let \hskip \vskip \let \vrule \hrule \let... col1 & col2 & col3 \\ \hline
```
For line 3
```
! Misplaced \noalign.\hline ->\noalign{\ifnum 0=`}\fi \let \hskip \vskip \let \vrule \hrule \let... col1 & col2 & col3 \\ \hline
```
For line 4
```
! Misplaced \noalign.\hline ->\noalign{\ifnum 0=`}\fi \let \hskip \vskip \let \vrule \hrule \let... col1 & col2 & col3 \\ \hline
```
What am I doing wrong?
| https://tex.stackexchange.com/users/293715 | Why does my table with fixed width and centered content not work? | false | Use `tabularray` and don't worry anymore about `\centering\arraybackslash`:
```
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{
colspec={*3{Q[c,m,1cm]}},
hlines, vlines
}
col1 & col2 & col3 \\
Inhalt & Inhalt & Inhalt \\
\end{tblr}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/101651 | 681486 | 316,199 |
https://tex.stackexchange.com/questions/680856 | 0 | My goal is to create a table, that has columns which are fixed in width and which contain centered content.
This is my table which works fine:
```
\begin{tabular}{ | c | c | c | }
\hline
col1 & col2 & col3 \\ \hline
Inhalt & Inhalt & Inhalt \\ \hline
\end{tabular}
```
Fixed width for all three columns works also fine:
```
\begin{tabular}{ | m{1cm} | m{1cm} | m{1cm} | }
```
Fixed width and centered applied to only two columns works fine as well:
```
\begin{tabular}{ | >{\centering} m{1cm} | >{\centering} m{1cm} | c | }
```
Fixed width and centered applied to all three columns makes Texmaker print out an multiple errors:
```
\begin{tabular}{ | >{\centering} m{1cm} | >{\centering} m{1cm} | >{\centering} m{1cm} | }
```
Errors are:
For line 3
```
! Misplaced \noalign.\hline ->\noalign{\ifnum 0=`}\fi \let \hskip \vskip \let \vrule \hrule \let... col1 & col2 & col3 \\ \hline
```
For line 3
```
! Misplaced \noalign.\hline ->\noalign{\ifnum 0=`}\fi \let \hskip \vskip \let \vrule \hrule \let... col1 & col2 & col3 \\ \hline
```
For line 4
```
! Misplaced \noalign.\hline ->\noalign{\ifnum 0=`}\fi \let \hskip \vskip \let \vrule \hrule \let... col1 & col2 & col3 \\ \hline
```
What am I doing wrong?
| https://tex.stackexchange.com/users/293715 | Why does my table with fixed width and centered content not work? | false | The environment `{NiceTabular}` of `nicematrix` has the same syntax as the classical `{tabular}` but had extra features. In particular, the `m`, `p` and `b` columns types have an optional argument between square brackets. With the key `c`, you will have a horizontal centering.
```
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{ | m[c]{1cm} | m[c]{1cm} | m[c]{1cm} | }
\hline
col1 & col2 & col3 \\ \hline
Inhalt & Inhalt & Inhalt \\ \hline
\end{NiceTabular}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/163000 | 681488 | 316,201 |
https://tex.stackexchange.com/questions/681482 | 34 | I would like a command `\egreg` which produces “egreg”. However, there is no reason to limit yourself to one “reg”. Who knows, maybe one day you just feel like writing “egregregregreg" for some reason. So the command should also take an optional argument, specifying the number of “reg”’s you want.
I know there are easy solutions involving loops, but given that it’s April 1, the most ridiculous solution will be accepted.
```
\documentclass{article}
\NewDocumentCommand\egreg{o}{%
% something
}
\begin{document}
\egreg % should produce "egreg"
\egreg[0] % should produce "eg"
\egreg[1] % should produce "egreg"
\egreg[2] % should produce "egregreg"
\egreg[5] % should produce "egregregregregreg"
Perhaps we might also want to allow negative values:
\egreg[-1] % should produce "regeg"
\egreg[-2] % should produce "regregeg"
Maybe also complex values?
\egreg[i] % perhaps "$\text{eg} + i\text{reg}$"?
Perhaps someone can also figure out
what to do with quaternionic values?
\end{document}
```
| https://tex.stackexchange.com/users/19809 | How to make an \egreg command? | false | Out of competition, of course. The most ridiculous answers will be rewarded with bounty points.
Since you don't want expandability, as witnessed by the proposed syntax, here's my version. Note how most endlines are not masked with `%` and the abundance of unneeded spaces.
```
\documentclass{article}
\NewDocumentCommand{\egreg}{o}{%
\IfNoValueTF{#1}{\printegreg{1}}{\printegreg{#1}}%
}
\NewDocumentCommand{\printegreg}{m}{%
$
\begingroup\uccode`~ = `m \uppercase{\endgroup\def~}{\hbox{reg}}
\mathcode`m = "8000
\ifnum#1<0 \romannumeral-\number\number#1 000 \fi
\hbox{eg}
\ifnum#1>0 \romannumeral\number\number#1 000 \fi
$%
}
\newcounter{egreg}
\newcount\plainegreg
\begin{document}
\egreg \ should produce ``egreg''
\egreg[0] should produce ``eg''
\egreg[1] should produce ``egreg''
\egreg[2] should produce ``egregreg''
\egreg[5] should produce ``egregregregregreg''
\egreg[-1] should produce ``regeg''
\egreg[-2] should produce ``regregeg''
\setcounter{egreg}{4}
\egreg[\value{egreg}]
\plainegreg=-3
\egreg[\plainegreg]
\end{document}
```
| 18 | https://tex.stackexchange.com/users/4427 | 681490 | 316,202 |
https://tex.stackexchange.com/questions/681482 | 34 | I would like a command `\egreg` which produces “egreg”. However, there is no reason to limit yourself to one “reg”. Who knows, maybe one day you just feel like writing “egregregregreg" for some reason. So the command should also take an optional argument, specifying the number of “reg”’s you want.
I know there are easy solutions involving loops, but given that it’s April 1, the most ridiculous solution will be accepted.
```
\documentclass{article}
\NewDocumentCommand\egreg{o}{%
% something
}
\begin{document}
\egreg % should produce "egreg"
\egreg[0] % should produce "eg"
\egreg[1] % should produce "egreg"
\egreg[2] % should produce "egregreg"
\egreg[5] % should produce "egregregregregreg"
Perhaps we might also want to allow negative values:
\egreg[-1] % should produce "regeg"
\egreg[-2] % should produce "regregeg"
Maybe also complex values?
\egreg[i] % perhaps "$\text{eg} + i\text{reg}$"?
Perhaps someone can also figure out
what to do with quaternionic values?
\end{document}
```
| https://tex.stackexchange.com/users/19809 | How to make an \egreg command? | false | The following, LuaLaTeX-based solution probably won't qualify as being *completely ridiculous*, since it doesn't actually employ any loop-type control structures; it is left as an exercise to the motivated reader to replace Lua's `string.rep` function with a suitable `for`, `while`, or `repeat .. until` loop. Also, to keep @egreg's blood pressure from spiking up, I use `\mathrm` instead of `\text` directives...
```
% !TEX TS-program = lualatex
\documentclass{article}
\usepackage{luacode}
\begin{luacode*}
```
```
function egreg ( n )
if n=="" then
tex.sprint ("egreg")
elseif n=="i" then
tex.sprint ( "\\ensuremath{\\mathrm{eg}+i\\mathrm{reg}}" )
else
n = tonumber ( n )
if n<0 then
tex.sprint ( string.rep ( "reg",-n) .. "eg" )
else
tex.sprint ( "e" .. string.rep ( "gre", n) .. "g" )
end
end
end
```
```
\end{luacode*}
%% LaTeX-side code:
\newcommand\egreg[1][]{\directlua{egreg("#1")}}
\begin{document}
\obeylines % just for this example
\egreg
\egreg[0]
\egreg[1]
\egreg[5]
\egreg[-1]
\egreg[-2]
\egreg[i]
\end{document}
```
| 10 | https://tex.stackexchange.com/users/5001 | 681491 | 316,203 |
https://tex.stackexchange.com/questions/665352 | 2 | To avoid/detect typos in author names I would like to use the bib file as a
single source for names. Please see the following mwe:
```
\documentclass{article}
\begin{filecontents}{demo.bib}
@book{articleA,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@book{articleB,
author = {Author, A.},
year = {2002},
title = {Bravo},
}
\end{filecontents}
\usepackage[style=alphabetic]{biblatex}
\addbibresource{demo.bib}
\newcommand{\authorA}{\citeauthor{articleA}}
\newcommand{\authorAL}{\citename{articleA}{author}}
\begin{document}
The lookup seems to work fine using biblatex's \textbackslash citeauthor and/or
\textbackslash citename commands.
The only problem I have is, that a lookup always adds an entry (here:
[Aut01]) to the bibliography, eg.:
Hi, my name is \authorA.
Thus my question is:
How to lookup the author's name from bib file, without causing the lookup to
add a bibliography entry?
\printbibliography
\end{document}
```
| https://tex.stackexchange.com/users/112503 | How to lookup the author's name from bib file, without causing the lookup to add a bibliography entry? | true | A clean way to reach what you need is to create a bibliography category for the citations you don't want to print among the references and then print the bibliography without that category (see [this answer](https://tex.stackexchange.com/a/111375/101651)).
```
\documentclass{article}
\begin{filecontents}[overwrite]{demo.bib}
@book{articleA,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@book{articleB,
author = {Buthor, B.},
year = {2002},
title = {Bravo},
}
@book{articleC,
author = {Cuthor, C.},
year = {2002},
title = {Charlie},
}
\end{filecontents}
\usepackage[style=alphabetic]{biblatex}
\addbibresource{demo.bib}
% see https://tex.stackexchange.com/a/111375/101651
\DeclareBibliographyCategory{nottocite}
\newcommand{\authorA}{\citeauthor{articleA}\addtocategory{nottocite}{articleA}}
\newcommand{\nameauthor}[1]{\citeauthor{#1}\addtocategory{nottocite}{#1}}
\begin{document}
Hi, my name is \authorA.
Or, more general \nameauthor{articleB}.
Pay attention: if you want them in bibliography, use \citeauthor{articleC}, not the previous commands.
\printbibliography[notcategory=nottocite]
\end{document}
```
| 2 | https://tex.stackexchange.com/users/101651 | 681492 | 316,204 |
https://tex.stackexchange.com/questions/591145 | 5 | It gives just such an error, Google has not found an answer. Help me please.
The program code itself
```
\documentclass[11pt]{combine}
\usepackage[utf8]{inputenc}
\usepackage[english,russian]{babel}
\usepackage{indentfirst}
\usepackage{misccorr}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[export]{adjustbox}
\title{Лабораторная работа №1}
\begin{document}
\pagestyle{combine}
\maketitle
\tableofcontents
\clearpage
\begin{papers}
\coltoctitle{HelloWorld}
\label{HelloWorld}
\import{HelloWorld}
\coltoctitle{KursTitle}
\label{KursTitle}
\import{KursTitle}
\coltoctitle{kurs}
\end{papers}
\end{document}
```
and errors
```
> ! Extra \endgroup. \document ->\endgroup
> \let \mainjobname \jobname \def \c@lmainauxfile {\jobn... l.10 \begin{document}
> ?
```
| https://tex.stackexchange.com/users/238890 | "Extra \endgroup" error when using the combine document class | false | See [Simon Dispa's solution](https://tex.stackexchange.com/a/655986/255699) based on [Peter Wilson's](https://tex.stackexchange.com/a/591171/255699) answer.
It simply adds the following before `\begin{document}`
```
\makeatletter
\let\document\c@ladocument\begingroup%
\makeatother
```
| 1 | https://tex.stackexchange.com/users/255699 | 681493 | 316,205 |
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 | Let's apply some `Artistic Intelligence` on my [line-stroke-drawing](https://i.stack.imgur.com/my8iX.png). To give it a `cubistic touch` let's introduce some colored areas by:
1. just filling some strokes
2. introducing new colored shapes
Though it builds on the previous approach the concept is slightly different, using other properties `tikz` provide in two different ways.
Are the results pleasing? When to stop, where to continue? Humans decide, humans know, ...
---
**Ad #1**: Results for 1.5 pt and 4.5 pt line thickness AND filling the hair-strokes.
```
...
% ~~~ hair ~~~~~~~
\draw [fill=gray] (1.63, 4.24) to [out=230, in=80] (2.14, .76);
\draw [fill=gray] (1.73, .45) to [out=70, in=270] (1.03, 3.04);
\draw [fill=gray] (1.61, 3.65) to [out=260, in=140] (2.31, 2.29)
to [out=-40, in=105] (3.34, 1.54);
\draw [fill=gray] (2.89, 4.83) to [out=180, in=90] (1.78, 3.69)
to [out=270, in=160] (2.90, 2.50);
...
```
---
**Ad #2**: Just adding a few colored shapes before drawing the strokes.
```
\documentclass[10pt, border=3mm]{standalone}
\usepackage{tikz}
\begin{document}
\tikz[line width=4.5pt]{
% ~~~ colored shapes ~~~~
\draw [fill=yellow!60,draw=none]
(3.2,4.7) -- (4.3,5.5) -- (4.9,5.35) -- (3.3,4.3) -- cycle;
\draw [fill=blue!50,draw=none]
(.5,3) -- (1,3.5) -- (2,1) -- (1.5,.5) -- cycle;
\draw [fill=pink!60,draw=none]
(1.2,3.8) -- (1.6,4.5) -- (1.6,1.3) -- (2.,2) -- cycle;
\draw [fill=orange!50,draw=none]
(1.5,3.8) -- (2.8,.9) -- (3.8,1.6) -- cycle;
% ~~~ head ~~~~~~~~
\draw (2.96, 4.67) to [out=88, in=95] (3.22, 4.78);
\draw (3.13, 4.63) to [out=55, in=85] (3.22, 4.43)
to [out=-45, in=105] (3.57, 3.79)
to [out=288, in=85] (3.88, 2.86);
\draw (3.77, 2.82) to [out=230, in=280] (3.32, 2.73)
to [out=90, in=300] (2.79, 3.34);
\draw (2.84, 3.28) to [out=185, in=270] (2.20, 3.92)
to [out=250, in=160] (2.67, 2.83);
% ~~~ eye ~~~~~~~~
\draw (3.30, 4.10) to [out=190, in=160] (3.04, 4.04)
to [out=300, in=190] (3.32, 3.93);
% ~~~ nose ~~~~~~~~
\draw (3.84, 2.83) -- (3.70, 3.00);
% ~~~ hair ~~~~~~~
\draw (2.89, 4.83) to [out=180, in=90] (1.78, 3.69)
to [out=270, in=160] (2.90, 2.50);
\draw (1.63, 4.24) to [out=230, in=80] (2.14, .76);
\draw (1.73, .45) to [out=70, in=270] (1.03, 3.04);
\draw (1.61, 3.65) to [out=260, in=140] (2.31, 2.29)
to [out=-40, in=105] (3.34, 1.54);
% ~~~ horn ~~~~~~
\draw (3.48, 4.19) to [out=35, in=30] (4.67, 5.22)
to [out=35, in=30](3.65, 4.82);
\draw (3.65, 4.34) to [out=90 , in=280] (3.59, 4.69);
\draw (3.85, 4.51) to [out=90 , in=290] (3.79, 4.75);
\draw (4.00, 4.64) to [out=95 , in=290] (3.96, 4.83);
\draw (4.19, 4.77) to [out=95 , in=300] (4.16, 4.89);
}
\end{document}
```
| 6 | https://tex.stackexchange.com/users/245790 | 681497 | 316,206 |
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 | Let's criticise my previous [drawing with line strokes](https://tex.stackexchange.com/a/681437/245790).
From research and knowledge:
* unicorns come with color
* rainbow-like colors are an important ingredient
* unicorns are fiction, held dearly by many
How to reflect these issues? One way to do it is using `tikz` features to process pathes. Let's apply `Artistic Intelligence` again.
```
\documentclass[10pt, border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.shapes,shapes.geometric}% <<< NEW <<<
\begin{document}
\tikzset{% <<< NEW <<<
paint/.style={draw=#1!50!black, fill=#1!50},
my star/.style={decorate,decoration={shape backgrounds,shape=star},
star points=#1}
}
\tikz[line width=1pt,decoration={shape sep=8pt,shape size=8pt}]{
% ~~~ horn coloration ~~~~~~~~ <<< NEW <<<
\draw [decoration={shape sep=11pt,shape size=10pt},my star=6, paint=yellow]
(4.67, 5.22) -- (3.25,4.4);
% ~~~ head ~~~~~~~~
\draw (2.96, 4.67) to [out=88, in=95] (3.22, 4.78);
\draw (3.13, 4.63) to [out=55, in=85] (3.22, 4.43)
to [out=-45, in=105] (3.57, 3.79)
to [out=288, in=85] (3.88, 2.86);
\draw (3.77, 2.82) to [out=230, in=280] (3.32, 2.73)
to [out=90, in=300] (2.79, 3.34);
\draw (2.84, 3.28) to [out=185, in=270] (2.20, 3.92)
to [out=250, in=160] (2.67, 2.83);
% ~~~ eye ~~~~~~~~
\draw (3.30, 4.10) to [out=190, in=160] (3.04, 4.04)
to [out=300, in=190] (3.32, 3.93);
% ~~~ nose ~~~~~~~~
\draw (3.84, 2.83) -- (3.70, 3.00);
% ~~~ hair ~~~~~~~ <<< MODIFIED <<<
\draw [my star=5, paint=red] (2.89, 4.83)
to [out=180, in=90] (1.78, 3.69)
to [out=270, in=160] (2.90, 2.50);
\draw [my star=5, paint=orange] (1.63, 4.24)
to [out=230, in=80] (2.14, .76);
\draw [my star=5, paint=blue] (1.73, .45) to [out=70, in=270] (1.03, 3.04);
\draw [my star=5, paint=yellow] (1.61, 3.65)
to [out=260, in=140] (2.31, 2.29)
to [out=-40, in=105] (3.34, 1.54);
% ~~~ horn ~~~~~~
\draw (3.48, 4.19) to [out=35, in=30] (4.67, 5.22)
to [out=35, in=30](3.65, 4.82);
\draw (3.65, 4.34) to [out=90 , in=280] (3.59, 4.69);
\draw (3.85, 4.51) to [out=90 , in=290] (3.79, 4.75);
\draw (4.00, 4.64) to [out=95 , in=290] (3.96, 4.83);
\draw (4.19, 4.77) to [out=95 , in=300] (4.16, 4.89);
}
\end{document}
```
| 9 | https://tex.stackexchange.com/users/245790 | 681500 | 316,207 |
https://tex.stackexchange.com/questions/681482 | 34 | I would like a command `\egreg` which produces “egreg”. However, there is no reason to limit yourself to one “reg”. Who knows, maybe one day you just feel like writing “egregregregreg" for some reason. So the command should also take an optional argument, specifying the number of “reg”’s you want.
I know there are easy solutions involving loops, but given that it’s April 1, the most ridiculous solution will be accepted.
```
\documentclass{article}
\NewDocumentCommand\egreg{o}{%
% something
}
\begin{document}
\egreg % should produce "egreg"
\egreg[0] % should produce "eg"
\egreg[1] % should produce "egreg"
\egreg[2] % should produce "egregreg"
\egreg[5] % should produce "egregregregregreg"
Perhaps we might also want to allow negative values:
\egreg[-1] % should produce "regeg"
\egreg[-2] % should produce "regregeg"
Maybe also complex values?
\egreg[i] % perhaps "$\text{eg} + i\text{reg}$"?
Perhaps someone can also figure out
what to do with quaternionic values?
\end{document}
```
| https://tex.stackexchange.com/users/19809 | How to make an \egreg command? | false | I like recursions:
```
\documentclass{article}
\NewDocumentCommand\egreg{O{1}}{%
\ifnum #1>0 eg\reg{#1}\else\ifnum #1<0 \reg{-#1}\fi eg\fi
}
\newcommand*{\reg}[1]{%
\ifnum #1>0 \-reg\reg{\numexpr #1-1\relax}\fi
}
\begin{document}
\raggedright
\egreg{} should produce ``egreg"
\egreg[0] should produce ``eg"
\egreg[1] should produce ``egreg"
\egreg[2] should produce ``egregreg"
\egreg[5] should produce ``egregregregregreg"
\medskip
Perhaps we might also want to allow negative values:
\egreg[-1] should produce ``regeg"
\egreg[-2] should produce ``regregeg"
\medskip
And also with hyphenation: \egreg[100]
\end{document}
```
Yes, handling of complex values is missing.
| 14 | https://tex.stackexchange.com/users/277964 | 681510 | 316,211 |
https://tex.stackexchange.com/questions/681215 | 3 | In my document, I have a table, I want to use `\setlength{\tabcolsep}{18pt}` but since there is one more table, this also affects the other, which I don't want to change. Therefore I thought of creating another ".tex" file which has only 1 table and then including it in the main file, but this didn't work. What can I do? Actually, my main purpose is to expand the table to the column width without changing the font size.
```
\setlength{\tabcolsep}{18pt}
\begin{tabular}{|cc|cc|}
\hline
\multicolumn{2}{|c|}{\textbf{Orbital positions}} & \multicolumn{2}{c|}{\textbf{Total solar irradiance}} \\ \hline
\multicolumn{1}{|c|}{\textbf{Earth}} & \textbf{Moon} & \multicolumn{1}{c|}{\textbf{near side}} & \textbf{far side} \\ \hline
\multicolumn{1}{|c|}{perihelion} & perigee & \multicolumn{1}{c|}{1,401.65} & 1,415.54 \\ \hline
\multicolumn{1}{|c|}{perihelion} & apogee & \multicolumn{1}{c|}{1,400.83} & 1,416.36 \\ \hline
\multicolumn{1}{|c|}{aphelion} & perigee & \multicolumn{1}{c|}{1,311.18} & 1,323.74 \\ \hline
\multicolumn{1}{|c|}{aphelion} & apogee & \multicolumn{1}{c|}{1,310.44} & 1,324.49 \\ \hline
\end{tabular}
```
Additionally I didn't write `\begin{table}` because when I write it that the font-type was changing.
| https://tex.stackexchange.com/users/293871 | Table decleration | false | With `{NiceTabular}` of `nicematrix`.
```
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{cccc}[hvlines,columns-width=6em]
\RowStyle[nb-rows=2]{\bfseries}
\Block{1-2}{Orbital positions} & &
\Block{1-2}{Total solar irradiance} \\
Earth & Moon & near side & far side \\
perihelion & perigee & 1,401.65 & 1,415.54 \\
perihelion & apogee & 1,400.83 & 1,416.36 \\
aphelion & perigee & 1,311.18 & 1,323.74 \\
aphelion & apogee & 1,310.44 & 1,324.49 \\
\end{NiceTabular}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/163000 | 681511 | 316,212 |
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 | Well, a little late for the party but, ladies and gentlemen let me introduce you my unicorn, Clavileño, my faithful companion for all these years:
```
\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{3d,perspective}
\colorlet{brownxy}{brown!40!red}
\colorlet{brownxz}{brown!65!red}
\colorlet{brownyz}{brown!90!red}
\tikzset
{%
declare function={
rh=4*(1-cos(30)); % runner height
},
xy/.style={canvas is xy plane at z=#1},
xz/.style={canvas is xz plane at y=#1},
yz/.style={canvas is yz plane at x=#1},
pics/runner/.style={
code={%
\draw[xz=0 ,fill=brownxz] (0,4) ++ (240:4) arc (240:300:4) -- cycle;
\draw[xy=rh,fill=brownxy] (2,0) rectangle (-2,-0.2);
}},
pics/leg/.style={
code={%
\path[xz=0] (0,0) --++ (0,1.5) arc (0:135:0.15) coordinate (aux) ;
\draw[xz=-0.4,fill=brownyz] (0,0) --++ (0,1.5) arc (0:135:0.15) -- (aux) arc (135:0:0.15) --++ (0,-1.5) -- cycle;
\draw[xz=0,fill=brownxz] (0,0) --++ (0,1.5) arc (0:180:0.15) |- cycle;
\fill[fill opacity=0.5] (0,0,0) --++ (-0.3,0,0) --++ (0,0,0.2) --++ (0.3,0,0) --++ (0,-0.4,0) --++ (0,0,-0.2) -- cycle;
\draw (0,-0.2,0) --++ (0,0,0.2);
\foreach\i in {-0.1,-0.2}
\fill[xz=0,black] (\i,1.5) circle (0.2mm);
}},
pics/body/.style={
code={%
\draw[xz=0,pic actions] (-1.3,1.5) coordinate (-A) --++ (2.6,0) coordinate (-B) --++
(70:1.2) coordinate (-C) arc (160:60:0.2) coordinate (-D) --++
(-30:0.6) coordinate (-E) arc (240:390:0.3) coordinate (-F) --++
(120:1.2) coordinate (-G) arc (30:140:0.5) coordinate (-H) --++
(230:1.5) coordinate (-I) arc (-40:-90:0.2) coordinate (-J) --++
(-1.9,0) coordinate (-K) |- cycle;
% mouth
\fill[xz,black,fill opacity=0.5] (-E) ++ (60:0.3) coordinate (aux) circle (0.3);
\draw[xz] (aux) --++ (10:0.3);
% eye
\fill[xz=0,black] (2.1,3.5) circle (0.1);
}},
pics/ear/.style={
code={%
\draw[xz=0,rotate=-15,pic actions] (0,0) -- (240:0.4) arc (150:390:0.2) -- cycle;
}},
}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,isometric view,rotate around z=180]
% runners
\pic at (0,-0.8,0) {runner};
\foreach\i in {1.3,-1}
{
\draw[xy=rh,fill=brownxy] (\i,0.8) rectangle++ (-0.3,-1.6);
\draw[yz=\i,fill=brownyz] (0.8,rh) rectangle++ (-1.6,-0.2);
}
\pic at (0,1,0) {runner};
\node[xz=1,anchor=south,yshift=.5mm,xscale=-1,fill=none,text=yellow] at (0,0) {\bfseries Clavileño};
\foreach\i in {1.1,1.2,-1.1,-1.2}
\fill[xz=1,fill=black] (\i,rh-0.1) circle (0.2mm);
% legs
\pic at (1.3,-0.4,rh) {leg};
\pic at (-1 ,-0.4,rh) {leg};
% body coordinates
\pic[fill=none,draw=none] (back) at (0,-0.4,0) {body};
\pic[fill=none,draw=none] (front) at (0, 0.4,0) {body};
% tail
\path (front-K) -- (back-K) coordinate[pos=0.5] (aux);
\draw[xz,xscale=-1,shift={(aux)},fill=brownxz]
(0,-0.2) to[out=10,in=180] (0.5,0) to[out=0,in=140] (1,-2)
to[out=200,in=270] (0.3,-0.8) arc(0:90:0.3) -- cycle;
% saddle
\draw[xy=0,fill=brownxy] (back-K) ++ (2,0) -- (back-K) -- (front-K) -| cycle;
\path (front-K) ++ (0.5,0,0) coordinate (aux1) --++ (0.1,0,0) coordinate (aux2);
\path[yz=0] (aux2) arc (0:135:0.4) coordinate (aux3);
\draw[fill=gray!70!black] (aux2) {[yz=0] arc (0:180:0.4)} {[xy=0] arc (-90:90:0.8 and 0.4)};
\draw (aux2) --++ (0,-0.8,0);
\draw[yz=0,fill=gray] (aux1) arc (0:135:0.4) -- (aux3) arc (135:0:0.4) -- cycle;
% body and ears
\path[xz=0,fill=none] (front-G) arc (30:135:0.5) coordinate (aux1);
\path[xz=0,fill=none] (front-F) arc (390:315:0.3) coordinate (aux2);
\path (back-B) -- (back-C) coordinate[pos=1.1] (aux3);
\pic[fill=brown!30!orange] at (2.2,-0.4,4.4) {ear};
\draw[fill=brown] (front-B) --++ (0,-0.8,0) -- (aux3) --++ (0,0.8,0) -- cycle;
\draw[fill=brown!70!red] (aux1) --++ (0,-0.8,0) {[xz=0] arc (135:30:0.5) -- (back-F) arc (390:315:0.3) -- (aux2)} -- cycle;
\pic[fill=brownxz] at (0,0.4,0) {body};
\pic[fill=brown!30!orange] at (2.2,0.4,4.4) {ear};
\pic[draw=none,fill=black!60!brown,scale=0.6] at (2.15,0.4,4.25) {ear};
% more legs
\pic at (1.3,0.8,rh) {leg};
\pic at (-1,0.8 ,rh) {leg};
% handle
\path[xz=0.4,draw=red] (1.4,3.5) coordinate (aux1) ++ (135:0.1) coordinate (aux2) arc (135:-45:0.1) coordinate (aux3);
\path (aux3) --++ (0,0.4,0) coordinate (aux4);
\path (aux1) --++ (0,0.4,0) coordinate (aux5);
\draw[fill=gray,xz=0.4] (aux1) circle (0.15);
\draw[fill=gray!50!black,xz=0] (aux2) arc (135:-45:.1) -- (aux4) arc (-45:135:0.1) -- cycle;
\draw[xz=0,fill=gray] (aux5) circle (0.1);
% unicorn
\path (front-F) -- (back-G) coordinate[pos=0.5] (aux);
\draw[shift={(aux)},rotate around y=60,fill=yellow] (4:0.1) arc (4:190:0.1) -- (0,0,1) -- cycle;
\end{tikzpicture}
\end{document}
```
**Update:** Here you can see him galloping without fear.
| 48 | https://tex.stackexchange.com/users/231368 | 681514 | 316,213 |
https://tex.stackexchange.com/questions/681482 | 34 | I would like a command `\egreg` which produces “egreg”. However, there is no reason to limit yourself to one “reg”. Who knows, maybe one day you just feel like writing “egregregregreg" for some reason. So the command should also take an optional argument, specifying the number of “reg”’s you want.
I know there are easy solutions involving loops, but given that it’s April 1, the most ridiculous solution will be accepted.
```
\documentclass{article}
\NewDocumentCommand\egreg{o}{%
% something
}
\begin{document}
\egreg % should produce "egreg"
\egreg[0] % should produce "eg"
\egreg[1] % should produce "egreg"
\egreg[2] % should produce "egregreg"
\egreg[5] % should produce "egregregregregreg"
Perhaps we might also want to allow negative values:
\egreg[-1] % should produce "regeg"
\egreg[-2] % should produce "regregeg"
Maybe also complex values?
\egreg[i] % perhaps "$\text{eg} + i\text{reg}$"?
Perhaps someone can also figure out
what to do with quaternionic values?
\end{document}
```
| https://tex.stackexchange.com/users/19809 | How to make an \egreg command? | false | What we can do in OpTeX:
```
\optdef\wipet[1]{\if i\the\opt ${\rm wi}+i{\rm pet}$%
\else
\tmpnum=\the\opt\relax
\ifnum\tmpnum<0 \fornum 1..-\tmpnum \do{pet}\fi
wi%
\ifnum\tmpnum>0 \fornum 1..\tmpnum \do{pet}\fi
\fi
}
\wipet\ should produce ``wipet''
\wipet[0]\ should produce ``wi''
\wipet[1]\ should produce ``wipet''
\wipet[2]\ should produce ``wipetpet''
\wipet[5]\ should produce ``wipetpetpetpetpet''
\wipet[-1]\ should produce ``petwi''
\wipet[-2]\ should produce ``petpetwi''
\wipet[i]\ perhaps "${\rm wi} + i{\rm pet}$"
\bye
```
| 17 | https://tex.stackexchange.com/users/51799 | 681516 | 316,215 |
https://tex.stackexchange.com/questions/681512 | 4 | I would like to hold some text in a global variable, which i'm using as the content of a `tabular`. I'm using `expl3`, and `tikz` to place the `tabular`. The problem is that in an expl3 environment tikz is not working as expected.
Here after reading solutions to similar problems i got my code working.
```
\documentclass{beamer}
\mode<presentation>
\usepackage{tikz,tabularray}
\ExplSyntaxOn
\tl_new:N \tl_tmpa
\ExplSyntaxOff
\ExplSyntaxOn
\NewDocumentCommand{\mycontent} { m }
{
\tl_clear:N \tl_tmpa
\tl_put_right:Nn \tl_tmpa {
\begin{tblr}{|l|}
\hline
#1
\hline
\end{tblr}
}
\let\mytikznode\tl_tmpa
}
\ExplSyntaxOff
\NewDocumentCommand{\myframe} {}
{
\begin{frame}
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.north)
[shift={(0,-4)}, anchor=north]{
\mytikznode
};
\end{tikzpicture}
\end{frame}
}
\begin{document}
\mycontent{ a a a \\
b b b \\}
\myframe
\end{document}
```
If I move the two statements `\begin{tblr}{|l|}` and `\end{tblr}` in `\myframe` and leave
```
\hline
#1
\hline
```
in `\mycontent` and not touching anything else, the build fails. Also without doing `\let\mytikznode\tl_tmpa` and using `\tl_tmpa` instead of `\mytikznode` in `\myframe` the build fails. I still don't see where is coming from the problem. I'm posting it to get some clarity and if possible get the code more concise.
| https://tex.stackexchange.com/users/145290 | expl3 and tikzpicture | true | The deeper the nesting, the more cautious you need to be with expansion. In this case, you need to expand the contents of the `tblr` environment before it is being parsed. The `tabularray` package provides an `expand` option exactly for such cases (see section 3.2.3 Expand Macros First in the [`tabularray` manual](http://mirrors.ctan.org/macros/latex/contrib/tabularray/tabularray.pdf)).
More concretely, in your case you would need to replace `\begin{tblr}{|l|}` by `\begin{tblr}[expand=\mytikznode]{|l|}`:
```
\documentclass{beamer}
\mode<presentation>
\usepackage{tikz, tabularray}
\ExplSyntaxOn
\tl_new:N \tl_tmpa
\ExplSyntaxOff
\ExplSyntaxOn
\NewDocumentCommand{\mycontent} { m } {
\tl_clear:N \tl_tmpa
\tl_put_right:Nn \tl_tmpa {
\hline
#1
\hline
}
\let\mytikznode\tl_tmpa
}
\ExplSyntaxOff
\NewDocumentCommand{\myframe} {} {
\begin{frame}
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.north)
[shift={(0,-4)}, anchor=north]{
\begin{tblr}[expand=\mytikznode]{|l|}
\mytikznode
\end{tblr}
};
\end{tikzpicture}
\end{frame}
}
\begin{document}
\mycontent{ a a a \\
b b b \\ }
\myframe
\end{document}
```
---
Actually, you can simply stay in expl3 mode. There is no need to `\let\mytikznode\tl_tmpa` then (you only need to take care about spaces in Ti*k*Z options). Also, better adhere to the established naming conventions of the expl3 syntax:
```
\documentclass{beamer}
\mode<presentation>
\usepackage{tikz, tabularray}
\ExplSyntaxOn
\tl_new:N \l_userx_temp_tl
\NewDocumentCommand{\mycontent} { m } {
\tl_clear:N \l_userx_temp_tl
\tl_put_right:Nn \l_userx_temp_tl {
\hline
#1
\hline
}
}
\NewDocumentCommand{\myframe} {} {
\begin{frame}
\begin{tikzpicture}[remember~picture,overlay]
\node at (current~page.north)
[shift={(0,-4)}, anchor=north]{
\begin{tblr}[expand=\l_userx_temp_tl]{|l|}
\l_userx_temp_tl
\end{tblr}
};
\end{tikzpicture}
\end{frame}
}
\ExplSyntaxOff
\begin{document}
\mycontent{ a a a \\
b b b \\ }
\myframe
\end{document}
```
| 4 | https://tex.stackexchange.com/users/47927 | 681517 | 316,216 |
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 | Let's have a look at a new `tikz bread`, which:
* builds on the [pixeled unicorn by tikz](https://tex.stackexchange.com/a/681460/245790)
* and introduces a new bread
* which still follows this [inventive solution concept](https://tex.stackexchange.com/a/681431/245790)
* just like [this extension did](https://tex.stackexchange.com/a/681468/245790)
The parameter set for the scale determines the esthetics of the result.
*Scale as given in code*
*Scale set to 0.0125*
*Scale set to 0.0225*
```
\documentclass[10pt, border=3mm]{standalone}
\usepackage{color}
\usepackage{tikz}
% ~~~ (most) colors ~~~~~~~~~~~~~~~~~~~~~~~
\definecolor{pnk}{RGB}{244,173,203}
\definecolor{yel}{RGB}{245,233,49}
\definecolor{bld}{RGB}{110,181,233}
\definecolor{bll}{RGB}{180,220,246}
\definecolor{blu}{RGB}{145,200,239}
% ~~~ NEW: short hand notation with animal magic ~~~~~~~~~~~~~~~~
\newcommand\pix[3]{ \pic [fill=#1,scale=0.0185,transform shape] at (#2/4,#3/4) {masto};}
\begin{document}
% ~~~ a pic-ture here and a pic-ture there,
% tikz picture is that place where ...
\tikzset{% guess the bread <<< NEW
masto/.pic={
% ~~~ ele ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\draw [fill=#1,line width=.4pt, draw=black!80]%
(6,0) .. controls +(0:3.4) and +(-90:-3.4) ..%
(12,-4) -- (12,-6.6) .. controls +(90:-3) and +(0:3) ..%
(6,-9.97) .. controls +(0:-1) and +(-10:1) ..%
(3.4,-9.64) .. controls +(-80:1) and +(0:-2) ..%
(6,-12) .. controls +(0:1) and +(30:-1) ..%
(8.2,-11.3) -- (8.3,-12.4) .. controls +(30:-1) and +(0:1) ..%
(5.55,-13) .. controls +(0:-4) and +(90:-5) ..%
(0,-6.6) -- (0,-4) .. controls +(90:3.4) and +(0:-3.4) ..%
(6,0);%
% ~~~ m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\draw [fill=green!20, line join=round, cap=round,
line width=.4pt, draw=black!80]%
(2.1,-7.9) -- (2.1,-4.4) .. controls +(90:1.5) and +(0:-1) ..%
(4.15,-2.15).. controls +(0:1) and +(-60:-1) ..%
(6,-3.5) .. controls +(60:1) and +(0:-1) ..%
(7.9,-2.15) .. controls +(0:1) and +(90:1.5) ..%
(9.9,-4.4) -- (9.9,-7.9) -- (8.5,-7.9) --%
(8.5,-4.4) .. controls +(90:.5) and +(180:-.5) ..%
(7.6,-3.5) .. controls +(0:-.5) and +(90:.5) ..%
(6.7,-4.4) -- (6.7,-6.6) -- (5.3,-6.6) -- (5.3,-4.4)%
.. controls +(90:.5) and +(180:-.5) ..%
(4.4,-3.5) .. controls +(0:-.5) and +(-90:-.5) ..%
(3.53,-4.4) -- (3.53,-7.9) -- (2.1,-7.9);%
}}
% ~~~ unicorns can come in pixels ...
\tikz{% <<< rearranged
% ~~~ starting somewhere ~~~~~~~~~~
\pix{pnk}{0}{0}\pix{bld}{1}{0}\pix{bll}{2}{0}\pix{blu}{3}{0}\pix{blu}{4}{0}\pix{pnk}{5}{0}\pix{bll}{6}{0}
% ~~~ line(s) above ~~~~~~~~~
\pix{pnk}{1}{1}\pix{bld}{2}{1}\pix{pnk}{4}{1}\pix{bld}{5}{1}\pix{blu}{6}{1}\pix{blu}{7}{1}\pix{blu}{8}{1}
\pix{pnk}{4}{2}\pix{bll}{5}{2}\pix{black}{6}{2}\pix{bll}{7}{2}\pix{bll}{8}{2}
\pix{pnk}{4}{3}\pix{pnk}{5}{3}\pix{pnk}{6}{3}\pix{yel}{7}{3}
\pix{pnk}{5}{4}\pix{pnk}{6}{4}\pix{yel}{8}{4}
% ~~~ line(s) below ~~~~~~~~~~
\pix{pnk}{1}{-1}\pix{blu}{2}{-1}\pix{blu}{3}{-1}\pix{blu}{4}{-1}\pix{bll}{5}{-1}\pix{blu}{6}{-1}
\pix{pnk}{1}{-2}\pix{blu}{2}{-2}\pix{bll}{3}{-2}\pix{bld}{5}{-2}\pix{bll}{7}{-2}
\pix{gray!40}{2}{-3}\pix{gray!40}{5}{-3}\pix{gray!40}{7}{-3}
}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/245790 | 681526 | 316,219 |
https://tex.stackexchange.com/questions/681530 | 0 | I have a bibliography whose items are inside a `LaTeX`-script (as in journal templates). Here ["How to make sections in a bibliography"](https://tex.stackexchange.com/questions/681311/how-to-make-sections-in-a-bibliography/681327?noredirect=1#comment1690791_681327) someone helped me to create sections in my bibliography.
I want to keep the numbers in my bibliography to refer to the section where it was employed, but I don't want those sections to appear in the TOC. So using a star (\*) after the keyword is not what I am looking for.
| https://tex.stackexchange.com/users/260816 | How to remove section number in TOC while keeping the nummeration | false | This creates `\mysection` for sections with numbers but will not appear in the TOC. It basically duplicates `\section` except that `\l@mysection` does nothing.
Note that this depends on the document class.
```
\documentclass{article}
\makeatletter
\let\c@mysection=\c@section
\let\themysection=\thesection
\newcommand{\mysection}{\@startsection{mysection}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\Large\bfseries}}
\let\mysectionmark\sectionmark
\newcommand*\l@mysection[2]{}% do nothing
\makeatother
\begin{document}
\tableofcontents
\section{Normal section}
\mysection{A special section}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/34505 | 681536 | 316,223 |
https://tex.stackexchange.com/questions/532788 | 2 | I have a class for which I've written a custom environment. I'm trying to add this environment to the `.cwl` file, so that it would properly autocomplete.
Right now I have:
```
%.cwl
\begin{myenv}{command%text}
\end{myenv}
```
Which autocompletes as:
```
%.tex
\begin{myenv}{command}
content...
\end{myenv}
```
What I want is:
```
%.tex
\begin{myenv}{command}
\item
\end{myenv}
```
How can I achieve that?
Also, any pointers on where to find material on how to write cwl files (and how to distribute them with your class) would be appreciated. I'm finding TeXstudio documentation on them somewhat lacking.
| https://tex.stackexchange.com/users/209157 | How to define a texstudio newenvironment command with \item in cwl | false | The following cwl code seems to work.
```
\begin{myenv}{command%text}%\\item %\\end{myenv}
```
Or this one for positionning cursor just after item.
```
\begin{myenv}{command%text}%\\item %<%>%\\end{myenv}
```
| 2 | https://tex.stackexchange.com/users/56520 | 681537 | 316,224 |
https://tex.stackexchange.com/questions/681530 | 0 | I have a bibliography whose items are inside a `LaTeX`-script (as in journal templates). Here ["How to make sections in a bibliography"](https://tex.stackexchange.com/questions/681311/how-to-make-sections-in-a-bibliography/681327?noredirect=1#comment1690791_681327) someone helped me to create sections in my bibliography.
I want to keep the numbers in my bibliography to refer to the section where it was employed, but I don't want those sections to appear in the TOC. So using a star (\*) after the keyword is not what I am looking for.
| https://tex.stackexchange.com/users/260816 | How to remove section number in TOC while keeping the nummeration | false | Probably the simplest is to use
```
\addtocontents{toc}{\string\iffalse}
\section{numbered but not displayed by TOC}
...
\section{one last one}
\addtocontents{toc}{\string\fi}
```
Assuming I did understand correctly the query.
| 0 | https://tex.stackexchange.com/users/293669 | 681543 | 316,226 |
https://tex.stackexchange.com/questions/681544 | 1 | Setup
=====
This question regards the following workflow: markdown file (input) -> pandoc -> PDF (output)
Pandoc version:
```
$ pandoc --version
pandoc 2.9.2.1
Compiled with pandoc-types 1.20, texmath 0.12.0.2, skylighting 0.8.5
```
Problem description
===================
Expected behavior: Every chapter in a PDF book gets a chapter number. At the start of the first chapter I get a "Chapter 1" text before the chapter's title.
Behavior I get: No chapter numbering.
Minimum Working Example (MWE)
=============================
metadata.yaml
-------------
```
---
papersize: a4
documentclass: book
top-level-division: chapter
number-sections: true
---
```
book.md
-------
```
% Book Title
Book subtitle
%
% April 1, 2023
# Introduction
This should have been Chapter 1.
Lorem Ipsum. Hello world!
# Chapter problem
This is chapter 2. Why is there no Chapter Numbering?
## Section
There is no section numbering either.
```
Command to replicate
--------------------
I use the following command to generate the PDF:
```
pandoc --metadata-file=metadata.yaml book.md -o book.pdf
```
Question
========
What am I doing wrong? I assumed that pandoc would automatically number each chapter, but it apparently does not. Is there a way to force pandoc to number each chapter?
| https://tex.stackexchange.com/users/294170 | Missing chapter numbering in pandoc | true | You should pass the `--number-sections` option to `pandoc` like this:
```
pandoc --metadata-file=temp.yaml --number-sections temp.md -o temp.pdf
```
To experiment replace the target `temp.pdf` by `temp.tex` and use `--standalone` then inspect the tex file for `secnumdepth`.
CAVEAT: I am with pandoc `2.18`.
EDIT: actually here is how to do it with yaml file:
```
---
papersize: a4
documentclass: book
top-level-division: chapter
numbersections: true
---
```
Watch out how the variable is named and used.
So basically, you only had a typo of using `number-sections` in place of `numbersections`... the latter is the yaml variable the former is for the `-number-sections` command line toggle.
| 3 | https://tex.stackexchange.com/users/293669 | 681545 | 316,227 |
https://tex.stackexchange.com/questions/681312 | 2 | In the following code, I have a main file and a single chapter. The title of the chapter is
```
The Tale of Rabbit Reproduction: $a_{n} = a_{n-1} + a_{n-2}$
```
and I encoded it with
```
The Tale of Rabbit Reproduction: \texorpdfstring{$a_{n} = a_{n-1} + a_{n-2}$}{a[n] = a[n-1] + a[n-2]}
```
I am getting the following error message.
```
! Font U/bbold/m/n/24.88=bbold25 at 24.88pt not loadable: Metric (TFM) file not found.
```
Is there a flaw in the code?
```
\documentclass[10pt, oneside]{book}
% packages
\usepackage{amssymb, amsmath, amsthm}
%This package allows Chapter titles to be single spaced.
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\setstretch{0.25}\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titleformat{\section}
{\setstretch{0.25}\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\singlespacing\normalfont\large\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}
{\singlespacing\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{}
% these make top, right, bottom margins confirming to the requirements
\usepackage[a4paper,bindingoffset=0.0in,%
left=1.5in,right=1in,top=1in,bottom=1in,%
footskip=.25in]{geometry}
\usepackage{setspace}
\usepackage{blindtext}
% small stuff
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{mathbbol}
\usepackage{hyperref}
\urlstyle{same}
\usepackage{footnote}
\hypersetup{colorlinks,linkcolor={black},citecolor={black},urlcolor={black}}
\usepackage{microtype}
% \usepackage{showkeys}
% uncomment this when editing cross-references
\numberwithin{equation}{section}
%------------------------------------------------
% doesn't count introduction when numbering theorems, etc.
\setcounter{chapter}{0}
% makes page numbers appear
\pagestyle{plain}
\usepackage{showframe}
\renewcommand*\ShowFrameLinethickness{0.2pt}
\renewcommand*\ShowFrameColor{\color{blue}}
\begin{document}
% makes the page numbers roman numerals, doesn't count
% these pages in the table of contents
\frontmatter
\thispagestyle{empty}
\vbox to 1truein{}
\centerline{Fairy Tales throughout History}
\vskip 200pt
\centerline{BY}
\vskip 10pt
\centerline{A Storyteller}
\vskip 10pt
\centerline{BA, Bard College}
\centerline{MA, Columbia University}
\vskip 215pt
\centerline{DISSERTATION}
\vskip 10pt
\centerline{Submitted in partial fulfillment of the requirements for}
\centerline{the degree of Doctor of Philosophy in English}
\centerline{in the Graduate School of}
\centerline{Columbia University}
\newpage
\thispagestyle{empty}
\vbox to 8.5truein{}
\centerline{\copyright\ Copyright by A Storyteller 2023}
\
\centerline{All Rights Reserved}
\newpage
\chapter*{Abstract}
\begin{doublespace}
Fairy tales' rich, imaginative stories for children~---~involving fantastical creatures and exotic places~---~offer far more than entertainment and happily-ever-after endings. They furnish children with a landscape for critical thinking skills and a context in which children can evaluate their own emotions and decision making.
\end{doublespace}
\newpage
\chapter*{Dedication}
\bigskip
\centerline{Dedicated to the Grimm Brothers and Hans Christian Anderson}
\newpage
\chapter*{Acknowledgements}
I wish to thank Walt Disney for animating various fairy tales in full color.
\newpage
\tableofcontents
% Changes page numbers to regular numbers, resets the counter
\mainmatter
%This gives 10pt font with 20pt spacing, text from here should be double spaced
\fontsize{10}{20pt} \selectfont
% \include puts in the .tex file with the given name
% make sure that these files don't have any preamble material
\begin{doublespacing}
\include{March_30-Introduction}
%\include{March_30-Chapter_1}
%\include{March_29-Chapter_2}
\end{doublespacing}
% add a new chapter without a chapter # for the references
\addcontentsline{toc}{chapter}{Bibliography}
\begin{thebibliography}{9}
\bibitem[Southey 1837]{Southey}Robert Southey, \emph{The Doctor}, Longman, Rees, Orme, Brown, Green and Longman, London, England, 1837, pages 318-326
\end{thebibliography}
\end{document}
```
Here is the only chapter in the file.
```
%
%
%
% Introduction
%
%
% make introduction a chapter without a #
\chapter*{Introduction (In case I decide to have a more descriptive name for the introduction, I want it to be single spaced or maybe half-line spaced)}
% and include it on the table of contents
\addcontentsline{toc}{chapter}{Introduction}
We will look at various fairy tales and myths in civilizations throughout history!
\newcommand\mymath{\(\sin(x) + 2ab - \frac{e^{2x}+1}{e^{2x}-1}\)}
\chapter{The Tale of Rabbit Reproduction: \texorpdfstring{$a_{n} = a_{n-1} + a_{n-2}$}{a[n] = a[n-1] + a[n-2]}}
```
| https://tex.stackexchange.com/users/56838 | Error compiling code due to text in the title of a chapter that is encoded in math mode | true | From some Sherlock Holmes level enquiry in the [distant path](https://fr.comp.text.tex.narkive.com/tfyLhMeX/metric-tfm-file-not-found-comment-resoudre-ce-probleme) it looks as if in the past there was a guilty file `ubbold.fd` in `.../texmf-dist/tex/latex/jknapltx/` where I am using some kind of TeXLive base TeX installation. From what I decipher there, this might explain `bbold25` showing in error message.
On my TeXLive 2023 I don't have one in this directory. I have a `Ubbold.fd` in `texmf-dist/tex/latex/bbold`. And this one should not cause problem. The `bbold` package provides a `\mathbb` command.
I advise you add `\listfiles` to your preamble and report what is shown in log after `*File List*`. (mainly to know what kind of distribution you are using, is it up-to-date?)
Perhaps you have some such old `ubbold.fd` in some `texmf-local`? or in a `texmf` in your `$HOME`?
It may be that adding a file named `ubbold.fd` like this
```
\DeclareFontFamily{U}{bbold}{}
\DeclareFontShape{U}{bbold}{m}{n}
{ <5> <6> <7> <8> <9> gen * bbold
<10> <10.95> bbold10
<12> <14.4> bbold12
<17.28> <20.74> <24.88> bbold17
}{}
\endinput
```
in the directory of the project could fix this.
Perhaps. Maybe to be sure also save it as `Ubbold.fd`. I am on a Mac, which is not case-sensitive. Perhaps LaTeX NFSS normalizes anyhow by making things lowercased but I have not checked.
| 2 | https://tex.stackexchange.com/users/293669 | 681551 | 316,229 |
https://tex.stackexchange.com/questions/681533 | -1 | I am trying to format my document to have the Table of Contents header look like all of my section headers. The section headers are centered and a different font size that what I can get with the table of contents.
```
\documentclass[12pt]{report}
\renewcommand{\thesection}{\arabic{section}}
\usepackage{lipsum}
\title{Test Thesis}
\author{John Doe}
\begin{document}
\maketitle
\pagenumbering{Roman}
\addcontentsline{toc}{section}{Abstract}
\section*{\centering{Abstract}}
\lipsum
\renewcommand{\contentsname}{\centering Table of Contents}
\tableofcontents
\clearpage
\newpage
\pagenumbering{arabic}
\addcontentsline{toc}{section}{Background}
\section*{\centering{Background}}
\lipsum
\end{document}
```
In this example the Table of Contents is centered, but the exact same code in my actual document does not center it. It is also still too big.
\*edit: working MWE
| https://tex.stackexchange.com/users/268801 | Format table of contents header to match section headers | false | For some reason I thought that Table of Contents only worked in `\documentclass{report}`. Changing it to `\documentclass{article}` fixed my problem. Thank you all for your help.
| 0 | https://tex.stackexchange.com/users/268801 | 681554 | 316,232 |
https://tex.stackexchange.com/questions/681558 | 1 | I creat me a newcommand that use `calculator` packages. It is for a cross-multiplication, basically to pass units.
The newcommand say:
```
\newcommand{\regladetres}[6]{\MULTIPLY{#5}{#3}{\numerador}\DIVIDE{\numerador}{#1}{\resultado}\ROUND[2]{\resultado}{\resultado}\begin{align*}
\SI{#1}{#2} & \text{\line(1,0){40}}\SI{#3}{#4}\\
\SI{#5}{#6} & \text{\line(1,0){40}}x=\frac{\SI{#5}{\cancel#6}\cdot\SI{#3}{#4}}{\SI{#1}{\cancel#2}}=\SI{\resultado}{#4}
\end{align*}
}
```
work fine when the numbers are minor that 15999, but when multiply 15999x15999 fail or when the numbers (any) mayor that 15999.
How can I do to use great number? In the deep, not more great only 101325. The problem I think that not is `siunitx` package, because I use bigger numbers without problem.
Thanks a lot!
Darío
| https://tex.stackexchange.com/users/216257 | Calculator package with great number? | false | First: the `\SI` macro in `siunitx` is obsolete and should be replaced with `\qty`.
Second, for such a use case you should probably use the LuaLaTeX compiler, so that you can make the computations in Lua and have them printed in LaTeX.
```
\documentclass{article}
\usepackage{luacode}
\usepackage{siunitx}
\directlua{
a = 15999
b = 15999
c = 1e8
d = 3.4e12
}
\begin{document}
First ratio : \qty{\directlua{tex.print(a/b)}}{m}
Second ratio : \qty{\directlua{tex.print(c/d)}}{Hz}
\end{document}
```
As you can see, everything you type in the `\directlua` macro is Lua code. Then, inside the Lua code, the `tex.print` function sends the value of its argument to LaTeX.
Also, if you have several `\directlua` macros, they are treated as part of the same block of code, so you can reuse variables from one to the other.
If you want to format the numbers, you can do it in Lua using the usual string-formatting functions before sending them back to LaTeX.
| 1 | https://tex.stackexchange.com/users/267211 | 681562 | 316,236 |
https://tex.stackexchange.com/questions/321278 | 4 | I am using the Darmstadt theme in beamer and would like to remove the subsection titles in the navigation bar. Is there any easy way to do this without changing the color scheme?
| https://tex.stackexchange.com/users/19314 | remove subsection bar in Darmstadt theme, beamer | false | You can switch off the subsection bar with `\beamer@sb@subsectionfalse`:
```
\documentclass{beamer}
\usetheme{Darmstadt}
\makeatletter
\beamer@sb@subsectionfalse
\makeatother
\begin{document}
\begin{frame}
abc
\end{frame}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/36296 | 681563 | 316,237 |
https://tex.stackexchange.com/questions/681463 | 2 | Hi my table of contents aligns all the page numbers at the end, except in the last line.
The bibliography entry has its pagenumber right after it says bibliography. Does any one know what i did wrong, or what i have to change, so that it aligns like the rest?
```
\documentclass[11pt, a4paper, UKenglish]{article}
\begin{document}
\tableofcontents
\section{a}
test
\addcontentsline{toc}{chapter}{Bibliography}
\end{document}
```
| https://tex.stackexchange.com/users/290296 | page number in table of contents is right after the section name instead of at the end | true | You should use
```
\addcontentsline{section}{Bibliography}
```
as `article` class does not support `chapter` (not only as `\chapter` but also as sectioning name in the TOC).
| 1 | https://tex.stackexchange.com/users/293669 | 681565 | 316,238 |
https://tex.stackexchange.com/questions/681568 | 0 | I am a Latex novice and am trying to use a template for formatting a novel I wrote. The template uses titlesec but I never title my chapters. In fact, I want my chapter headings in this book to be 'Day 0' and 'Day 1'. But the chapters also will skip days. 'Day 2' is followed by 'Day 4'. Any tips on how to do this?
| https://tex.stackexchange.com/users/294183 | Custom Chapter Headings | false | Apparently, half an hour of googling didn't help, but the 'Related' answers did.
[How can I hide the chapter headings number on LaTeX and change the spacing?](https://tex.stackexchange.com/questions/47953/how-can-i-hide-the-chapter-headings-number-on-latex-and-change-the-spacing?rq=1)
This was exactly what I needed.
| 2 | https://tex.stackexchange.com/users/294183 | 681569 | 316,240 |
https://tex.stackexchange.com/questions/681482 | 34 | I would like a command `\egreg` which produces “egreg”. However, there is no reason to limit yourself to one “reg”. Who knows, maybe one day you just feel like writing “egregregregreg" for some reason. So the command should also take an optional argument, specifying the number of “reg”’s you want.
I know there are easy solutions involving loops, but given that it’s April 1, the most ridiculous solution will be accepted.
```
\documentclass{article}
\NewDocumentCommand\egreg{o}{%
% something
}
\begin{document}
\egreg % should produce "egreg"
\egreg[0] % should produce "eg"
\egreg[1] % should produce "egreg"
\egreg[2] % should produce "egregreg"
\egreg[5] % should produce "egregregregregreg"
Perhaps we might also want to allow negative values:
\egreg[-1] % should produce "regeg"
\egreg[-2] % should produce "regregeg"
Maybe also complex values?
\egreg[i] % perhaps "$\text{eg} + i\text{reg}$"?
Perhaps someone can also figure out
what to do with quaternionic values?
\end{document}
```
| https://tex.stackexchange.com/users/19809 | How to make an \egreg command? | true | I think the image-inary part should be drawn with TikZlings:
```
\documentclass{article}
\usepackage{xstring}
\usepackage{etoolbox}
\usepackage{tikzlings}
\newcommand{\egregnum}[1]{%
\begin{tikzpicture}[
every node/.style={inner sep=0pt},
baseline=(a0.base)
]
\node (a0) {eg};
\ifnumgreater{#1}{0}{%
\foreach \x [count=\prev from 0] in {1,...,#1}
\node[anchor=west] (a\x) at (a\prev.east){reg};
}{%
\ifnumless{#1}{0}{%
\foreach \x [evaluate=\x as \numpos using int(\x * -1),
evaluate=\x as \prev using int((\x * -1)-1)]
in {-1,...,#1}
\node[anchor=east] (a\numpos) at (a\prev.west){reg};
}{}%
}%
\end{tikzpicture}
}
\newcommand{\egregimm}{%
\raisebox{-.3cm}{\begin{tikzpicture}
\tikzling[
scale=0.5,signpost={reg}
]
\end{tikzpicture}
}}
\newcommand{\egreg}[1][1]{%
\IfDecimal{#1}{%
\egregnum{#1}%
}{%
\StrDel{#1}{ }[\complesso]%
\StrSubstitute{\complesso}{-}{+}[\contasegni]%
\StrCount{\contasegni}{+}[\numsegni]%
\StrPosition[\numsegni]{\contasegni}{+}[\signposition]%
\StrChar{\complesso}{\signposition}[\segno]%
\IfStrEq{\segno}{-}{%immaginario negativo
\StrBehind[\numsegni]{#1}{-}[\partei]%
\StrSubstitute{\partei}{ }{}[\parteimm]%
\StrSubstitute{\parteimm}{i}{}[\immaginario]%
\IfDecimal{\immaginario}{%
\foreach \cifreimm in {1,...,\immaginario}{\egregimm}
}{%
\egregimm
}%
\StrBefore[\numsegni]{\complesso}{-}[\reale]%
\IfDecimal{\reale}{%
\egregnum{\reale}
}{%
\egregnum{0}
}%
}{% immaginario positivo
\StrBefore{\complesso}{+}[\reale]%
\IfDecimal{\reale}{%
\egregnum{\reale}
}{%
\egregnum{0}
}%
\StrBehind{#1}{+}[\partei]%
\StrSubstitute{\partei}{ }{}[\parteimm]%
\StrSubstitute{\parteimm}{i}{}[\immaginario]%
\IfDecimal{\immaginario}{%
\foreach \cifreimm in {1,...,\immaginario}{\egregimm}
}{%
\egregimm
}%
}%
}
}
\begin{document}
\verb|\egreg|: \egreg % should produce "egreg"
\verb|\egreg[0]|: \egreg[0] % should produce "eg"
\verb|\egreg[1]|: \egreg[1] % should produce "egreg"
\verb|\egreg[2]|: \egreg[2] % should produce "egregreg"
\verb|\egreg[5]|: \egreg[5] % should produce "egregregregregreg"
\verb|\egreg[-1]|: \egreg[-1] % should produce "regeg"
\verb|\egreg[-2]|: \egreg[-2] % should produce "regregeg"
\verb|\egreg[i]|: \egreg[i] % perhaps "$\text{eg} + i\text{reg}$"?
\verb|\egreg[3+2i]|: \egreg[3+2i]
\verb|\egreg[2 + 3i]|: \egreg[2 + 3i]
\verb|\egreg[-2 + 4i]|: \egreg[-2 + 4i]
\verb|\egreg[1 - 2i]|: \egreg[1 - 2i]
\verb|\egreg[-2 - i]|: \egreg[-2 - i]
\verb|\egreg[-i]|: \egreg[-i]
\end{document}
```
| 27 | https://tex.stackexchange.com/users/101651 | 681570 | 316,241 |
https://tex.stackexchange.com/questions/681482 | 34 | I would like a command `\egreg` which produces “egreg”. However, there is no reason to limit yourself to one “reg”. Who knows, maybe one day you just feel like writing “egregregregreg" for some reason. So the command should also take an optional argument, specifying the number of “reg”’s you want.
I know there are easy solutions involving loops, but given that it’s April 1, the most ridiculous solution will be accepted.
```
\documentclass{article}
\NewDocumentCommand\egreg{o}{%
% something
}
\begin{document}
\egreg % should produce "egreg"
\egreg[0] % should produce "eg"
\egreg[1] % should produce "egreg"
\egreg[2] % should produce "egregreg"
\egreg[5] % should produce "egregregregregreg"
Perhaps we might also want to allow negative values:
\egreg[-1] % should produce "regeg"
\egreg[-2] % should produce "regregeg"
Maybe also complex values?
\egreg[i] % perhaps "$\text{eg} + i\text{reg}$"?
Perhaps someone can also figure out
what to do with quaternionic values?
\end{document}
```
| https://tex.stackexchange.com/users/19809 | How to make an \egreg command? | false | Just for comparison, here is a version in [Metapost](http://www.tug.org/metapost.html) (with apologies for being so far from the brief, apart from the "ridiculous" bit).
Compile with `lualatex`. (Here be dragons...)
```
\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
picture payload;
payload = textext("$\vcenter{\hbox{egreg}}\;$");
payload := payload scaled (1/abs(lrcorner payload - llcorner payload));
vardef dragon(expr level, a, b, r) =
if level = 0:
draw a--b withcolor 3/4;
draw payload zscaled (b-a) shifted a;
else:
save p; pair p;
p = 0.7071067811865476[a, b] rotatedabout(a, r);
dragon(level-1, a, p, +abs(r));
dragon(level-1, p, b, -abs(r));
fi
enddef;
beginfig(1);
dragon(11, origin, 600 right, 45);
endfig;
\end{mplibcode}
\end{document}
```
| 13 | https://tex.stackexchange.com/users/15036 | 681573 | 316,243 |
https://tex.stackexchange.com/questions/681542 | 1 | I am writing a technical report and I need to use the `palatino` package for it. However, the `minted` code font is not very legible since it doesn't use deep black but slight gray instead. Hence I want to use `lmodern` package for the bold typewriter font for `minted`. How can I use two different fonts in the same report?
```
\usepackage[utf8]{inputenc}
\usepackage{palatino} % default font for report
% \usepackage{lmodern} % Allows bold typewriter font
\usepackage[chapter]{minted} % (recommended)
% Set global Minted options
\setminted{linenos, autogobble, breaklines, frame=lines, fontsize=\normalsize, framesep=2mm}
```
| https://tex.stackexchange.com/users/294172 | Use lmodern package for minted code and palatino package for the rest of the report | false | You can substitute the font for the listings with Latin Modern Typewriter in the “light” variant.
```
\documentclass{book}
\usepackage{palatino}% sure?
\usepackage[chapter]{minted} % (recommended)
% Set global Minted options
\setminted{
linenos,
autogobble,
breaklines,
frame=lines,
fontsize=\normalsize,
framesep=2mm,
}
% monospaced font is Latin Modern Typewriter Light
\makeatletter
\let\lmtt@use@light@as@normal\@empty
\makeatother
\renewcommand{\ttdefault}{lmtt}
\begin{document}
Some text in Palatino.
\begin{minted}{c}
int main() {
printf("hello, world");
return 0;
}
\end{minted}
\end{document}
```
If you don't enable the light variant, you'd get
where boldface is not really distinguishable.
For comparison, this is the default when using `palatino`.
Another possibility is Bera Mono
```
\documentclass{book}
\usepackage{palatino}% sure?
\usepackage[scaled=0.8]{beramono}
\usepackage[chapter]{minted} % (recommended)
% Set global Minted options
\setminted{
linenos,
autogobble,
breaklines,
frame=lines,
fontsize=\fontencoding{T1}\normalsize,
framesep=2mm,
}
\begin{document}
Some text in Palatino.
\begin{minted}{c}
int main() {
printf("hello, world");
return 0;
}
\end{minted}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/4427 | 681574 | 316,244 |
https://tex.stackexchange.com/questions/681558 | 1 | I creat me a newcommand that use `calculator` packages. It is for a cross-multiplication, basically to pass units.
The newcommand say:
```
\newcommand{\regladetres}[6]{\MULTIPLY{#5}{#3}{\numerador}\DIVIDE{\numerador}{#1}{\resultado}\ROUND[2]{\resultado}{\resultado}\begin{align*}
\SI{#1}{#2} & \text{\line(1,0){40}}\SI{#3}{#4}\\
\SI{#5}{#6} & \text{\line(1,0){40}}x=\frac{\SI{#5}{\cancel#6}\cdot\SI{#3}{#4}}{\SI{#1}{\cancel#2}}=\SI{\resultado}{#4}
\end{align*}
}
```
work fine when the numbers are minor that 15999, but when multiply 15999x15999 fail or when the numbers (any) mayor that 15999.
How can I do to use great number? In the deep, not more great only 101325. The problem I think that not is `siunitx` package, because I use bigger numbers without problem.
Thanks a lot!
Darío
| https://tex.stackexchange.com/users/216257 | Calculator package with great number? | true | Well, the problem not is a problem. The `calculator` package can not operate with numbers more bigs that 2^14. The documentation, section 13.1 say thus:
```
The largest TeX number is 16383.99998 ≈ 214 ; \cctr@logmaxnum is the logarithm of this num-
ber, 9.704 ≈ log 16384.
```
Meanwhile I wait for the new Debian's upgrade for use the new packages.
Because somethings like `nicematrix` and `siunitx` are old (2020).
Thanks a lot!
| 0 | https://tex.stackexchange.com/users/216257 | 681575 | 316,245 |
https://tex.stackexchange.com/questions/680698 | 0 | I can’t make LyX work with Git.
I followed the guidelines in section 7.2.6 in the "Additional Features" LyX manual, but once the git repo is created for the document, and I try to `register` my document with LyX GUI I get the following error:
```
Some problem occurred while running the command:
'ci -q -u -i -t-"First draft " "grand_écrit.lyx"'.
```
And then a `Lyx crashed error message` saying:
```
SIGSEGV signal caught!
Sorry, you have found a bug in LyX, hope you have not lost any data.
Please read the bug-reporting instructions in 'Help->Introduction' and send us a bug report, if necessary. Thanks!
Bye
```
With the following details:
```
1) /usr/bin/lyx: /usr/bin/lyx(+0x63d1f8) [0x5603ffae41f8]
( 2) /usr/bin/lyx: /usr/bin/lyx(+0x63c652) [0x5603ffae3652]
( 3) /usr/bin/lyx: /usr/bin/lyx(+0x2feb27) [0x5603ff7a5b27]
( 4) /lib/x86_64-linux-gnu/libc.so.6: /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7fcf88442520]
( 5) /lib/x86_64-linux-gnu/libQt5Core.so.5: /lib/x86_64-linux-gnu/libQt5Core.so.5(+0x2f12a8) [0x7fcf88ef12a8]
( 6) /usr/bin/lyx: /usr/bin/lyx(+0x6cfd53) [0x5603ffb76d53]
( 7) /lib/x86_64-linux-gnu/libQt5Core.so.5: /lib/x86_64-linux-gnu/libQt5Core.so.5(+0x2f17c8) [0x7fcf88ef17c8]
( 8) /lib/x86_64-linux-gnu/libQt5Widgets.so.5: QAction::triggered(bool)
( 9) /lib/x86_64-linux-gnu/libQt5Widgets.so.5: QAction::activate(QAction::ActionEvent)
( 10) /lib/x86_64-linux-gnu/libQt5Core.so.5: QObject::event(QEvent*)
( 11) /lib/x86_64-linux-gnu/libQt5Widgets.so.5: QApplicationPrivate::notify_helper(QObject*, QEvent*)
( 12) /usr/bin/lyx: /usr/bin/lyx(+0x64edb0) [0x5603ffaf5db0]
( 13) /lib/x86_64-linux-gnu/libQt5Core.so.5: QCoreApplication::notifyInternal2(QObject*, QEvent*)
( 14) /lib/x86_64-linux-gnu/libQt5Core.so.5: QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
( 15) /lib/x86_64-linux-gnu/libQt5Core.so.5: /lib/x86_64-linux-gnu/libQt5Core.so.5(+0x313a67) [0x7fcf88f13a67]
( 16) /lib/x86_64-linux-gnu/libglib-2.0.so.0: /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x26b) [0x7fcf88b1bd3b]
( 17) /lib/x86_64-linux-gnu/libglib-2.0.so.0: /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0xaa6c8) [0x7fcf88b706c8]
( 18) /lib/x86_64-linux-gnu/libglib-2.0.so.0: /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x33) [0x7fcf88b193e3]
( 19) /lib/x86_64-linux-gnu/libQt5Core.so.5: QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
( 20) /lib/x86_64-linux-gnu/libQt5Core.so.5: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
( 21) /lib/x86_64-linux-gnu/libQt5Core.so.5: QCoreApplication::exec()
( 22) /usr/bin/lyx: /usr/bin/lyx(+0x307c0d) [0x5603ff7aec0d]
( 23) /usr/bin/lyx: /usr/bin/lyx(+0x1a3939) [0x5603ff64a939]
( 24) /lib/x86_64-linux-gnu/libc.so.6: /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7fcf88429d90]
( 25) /lib/x86_64-linux-gnu/libc.so.6: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7fcf88429e40]
( 26) /usr/bin/lyx: /usr/bin/lyx(+0x1af63e) [0x5603ff65663e]
```
It seems like LyX doesn’t detect the git repo as it is supposed to based on the documentation. I don’t know how to fix this.
I’m running Ubuntu 22.04, and downloaded LyX through the official Ubuntu repo. Here is the details of LyX:
```
LyX 2.3.6 (2020-11-27)
Configuration
Host type: x86_64-pc-linux-gnu
Special build flags: build=release std-regex warnings use-enchant
Bundled libraries: (none)
C++ Compiler: g++ (10.2.0)
C++ Compiler flags: -Wall -Wextra -fPIC -O2 -std=c++14 -Wno-deprecated-copy
C++ Compiler user flags: -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++14 -g -O2 -fdebug-prefix-map=/build/lyx-ufkcxK/lyx-2.3.6=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC
Linker flags:
Linker user flags: -Wl,-z,defs -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now
Qt Frontend:
Qt version: 5.15.2
Packaging: posix
LyX binary dir: /usr/bin
LyX files dir: /usr/share/lyx
```
| https://tex.stackexchange.com/users/252672 | LyX and Git for version control | true | Temporary solution
------------------
From the lyx-users@lists.lyx.org mailing list I got the following answer, which is a work around:
>
> Indeed I see your problem and we need to either update the code or guidelines.
>
>
> Essentially the problem is that "git init" is not enough for LyX to recognize that the directory is under git control.
>
>
> Once the first file is added via "git add" the recognition (of not just the file but the whole dir) works and register command will proceed. I'll try to look on that once I have some free time.
>
>
> At the moment your workaround is to start new git repo via init + add file on the commandline (or via some git frontend).
>
>
>
What works best for now, I figured, is to simply use the git command line and not fiddle with the LyX GUI.
| 1 | https://tex.stackexchange.com/users/252672 | 681585 | 316,249 |
https://tex.stackexchange.com/questions/84983 | 8 | With the simple `equation` environment;
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
a \foo b
\end{equation}
\end{document}
```
you can see a helpful error message, which editors like Kile understands;
```
! Undefined control sequence.
l.5 a \foo
b
```
Making it report `5: Undefined control sequence a \foo`
But if you do the same in an amsmath environment, such as the popular `align`
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
a \foo b
\end{align}
\end{document}
```
you get the unhelpful error (and it comes up twice);
```
! Undefined control sequence.
<argument> a \foo
b
l.6 \end{align}
```
which makes Kile report; `6: Undefined control sequence \end{align}`.
Checking the log is tedious and ultimately unrewarding, because not even in there can I find the actual line which contained the undefined control sequence.
**Can this awful behavior be helped in any way?**
| https://tex.stackexchange.com/users/2199 | Unhelpful, misleading errors in amsmath environments | false | The reason of the error, as explained in other answers, is that `align` is not a "real" environment, rather
it takes the environment body as an ⟨argument⟩ and thus lose the line number information
as explained in
"Line number of macro is not shown" section in [my answer to "What does \errorcontextlines do?" question](https://tex.stackexchange.com/a/627520/250119).
If it's only for debugging purpose, you can use a little hack to reimplement `align` environments etc. in a way that does not measure its content:
```
%! TEX program = lualatex
\documentclass{article}
\usepackage{amsmath}
%\usepackage{lua-visual-debug}
\begin{document}
\ExplSyntaxOn
%\iffalse
\cs_if_exist:NF \RenewEnvironmentCopy { % https://tex.stackexchange.com/a/680717/250119 and https://tex.stackexchange.com/a/680721/250119
\NewDocumentCommand \RenewEnvironmentCopy {mm} {
\expandafter \RenewCommandCopy \csname#1\expandafter\endcsname \csname#2\endcsname
\expandafter \RenewCommandCopy \csname end#1\expandafter\endcsname \csname end#2\endcsname
}
}
% this can also be implemented with tabular and https://tex.stackexchange.com/q/112576/250119
\RenewDocumentEnvironment{split}{}{
\let \\ \cr
\vbox\bgroup
\halign\bgroup
& \hfill $\displaystyle ##$ & $\displaystyle {}##$ \hfill \cr
}{
\crcr
\egroup
\egroup
}
\RenewDocumentEnvironment{multline}{}{
\par
\lineskip=3pt
\leftskip=0pt
\rightskip=0pt plus 1fil
\parindent=0pt
\parfillskip=0pt
\def \\ {
$ \par
\leftskip=0pt plus 1fil
$\displaystyle {}
}
$\displaystyle {}
}{
$ \rightskip=0pt \par
\endcenter
}
\RenewDocumentEnvironment{gather*}{}{
\par
\lineskip=3pt
\leftskip=0pt plus 1fil
\rightskip=0pt plus 1fil
\parindent=0pt
\parfillskip=0pt
\def \\ { $ \par $\displaystyle }
$\displaystyle
}{
$ \par
}
\RenewEnvironmentCopy{gather}{gather*}
\RenewDocumentEnvironment{align*}{}{
\lineskip=3pt
$$
\vbox\bgroup
\let \\ \cr
\tabskip=0pt plus 1fil
\halign to \linewidth\bgroup
&
\tabskip=0pt
\hfil $\displaystyle ##$
&
$\displaystyle {}##$ \hfil
\tabskip=0pt plus 1fil
\cr
}{
\crcr
\egroup
\egroup$$
}
\RenewEnvironmentCopy{align}{align*}
\RenewDocumentEnvironment{flalign*}{}{
$$
\vbox\bgroup
\let \\ \cr
\tabskip=0pt
\halign to \linewidth\bgroup
&
\tabskip=0pt
\hfil $\displaystyle ##$
&
$\displaystyle {}##$ \hfil
\tabskip=0pt plus 1fil
\cr
}{
\crcr
\egroup
\egroup$$
}
\RenewEnvironmentCopy{flalign}{flalign*}
\use_none:n \fi
\ExplSyntaxOff
\begin{equation*}
a=b
\end{equation*}
\begin{equation}
a=b
\end{equation}
\begin{equation}\label{xx}
\begin{split}
a& =b+c-d\\
& \quad +e-f\\
& =g+h\\
& =i
\end{split}
\end{equation}
\begin{multline}
a+b+c+d+e+f\\
+i+j+k+l+m+n
\end{multline}
\begin{multline}
a+b+c+d+e+f\\
a+b+c+d+e+f\\
+a+b+c+d+e+f\\
+i+j+k+l+m+n
\end{multline}
\begin{gather}
a_1=b_1+c_1\\
a_2=b_2+c_2-d_2+e_2
\end{gather}
\begin{align}
a_1& =\frac{1}{2} b_1+c_1\\
a_2& =b_2+c_2-d_2+e_2
\end{align}
\begin{itemize}
\item The formula is
\begin{align}
a_1& =\frac{1}{2} b_1+c_1\\
a_2& =b_2+c_2-d_2+e_2
\end{align}
some more text.
\end{itemize}
\begin{align}
a_{11}& =b_{11}&
a_{12}& =b_{12}\\
a_{21}& =b_{21}&
a_{22}& =b_{22}+c_{22}
\end{align}
\begin{flalign*}
a_{11} + b_{11}& = c_{11}&
a_{12}& =b_{12}\\
b_{21}& = c_{21}&
a_{22}& =b_{22}+c_{22}
\end{flalign*}
\end{document}
```
Of course, this implementation output quality is nowhere comparable to, but it preserves line number in error messages and also synctex information. For draft compilations/debugging, I think it may be useful.
Note: this is not very well-tested. It may create other errors that the original environment does not.
For a comparison of output quality (it's **supposed to be bad**! Do not use in final document):
Left is normal output, right is output with the hack. (you can also notice tag numbers are missing)
---
Given the complicated things that amsmath do with its content, I think doing multiple passes for measurement is **required**.
Detail of what amsmath do:
However I can think of 2 workarounds:
* use the technique I described in [How can I capture and rescan TeX source code while preserving synctex data?](https://tex.stackexchange.com/q/631887/250119) to preserve line number of error message/synctex information.
* use multiple compilation passes and aux file to store information etc.
---
Using that idea, at the moment *another* hack is possible with my `cprotectinside` package:
```
%! TEX program = lualatex
\documentclass{article}
\usepackage{amsmath}
\usepackage{cprotectinside}
\cprotectinsideEnableSyncInner
\begin{document}
\errorcontextlines=10
\cprotectinside{|}{
\begin{align}
|%
a_{11}& =b_{11}&
a_{12}& =b_{12}\\
a_{21}& =b_{21}&
a_{22}& =b_{22}+c_{22}
|
\end{align}
}
\end{document}
```
(it also preserves synctex if lualatex is used, and error messages at least point to the correct *lines*, although filename may be a bit confusing. Note that it requires a new version on GitHub that is not published on CTAN)
| 0 | https://tex.stackexchange.com/users/250119 | 681588 | 316,251 |
https://tex.stackexchange.com/questions/681579 | 1 | I am seeking some help with formatting a math problem set in LaTeX. The document contains eight problems with sub-problems for each problem, including detailed instructions for solving each problem. The problems involve topics such as linear algebra, trigonometry, chemistry, and electric circuits.
I am having trouble with spacing between each row, margins, and other formatting issues. It doesn't look aesthetically pleasing for me. Could someone please take a look at the code and suggest ways to make it look neater? Your input would be greatly appreciated.
```
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\title{Krysstal 1}
\author{Namn}
\date{April 2023}
\begin{document}
\maketitle
\section*{Uppgifter}
\subsection*{Uppgift 1}
1. Visa att linjen
$$
x-2=\frac{y+3}{2}=\frac{z-1}{4}
$$
är parallell med planet $2 y-z=1$. Vilket är avståndet mellan linjen och planet?
\subsubsection*{Lösning}
…
\subsection*{Uppgift 2}
2. Punkterna $A=(1,2,3), B=(-2,1,0)$ och $C=(2,0,1)$ bildar en triangel.
(a) Beräkna triangelns area.
(b) Beräkna vinkeln vid punkten $A$.
\subsubsection*{Lösning}
…
\subsection*{Uppgift 3}
3. Vilka av följande utökade systemmatriser är skrivna på trappstegsform och vilka beskriver ett homogent linjärt system? Radreducera de fyra utökade matriserna och markera pivotpositionena. Vilka utökade matriser beskriver ett konsistent system?
$$
A=\left[\begin{array}{llll}
1 & 5 & 4 & 4 \\
3 & 4 & 1 & 6 \\
0 & 0 & 1 & 5
\end{array}\right], \quad B=\left[\begin{array}{ccc}
5 & -5 & 0 \\
0 & 1 & 0
\end{array}\right], \quad C=\left[\begin{array}{lll}
1 & 0 & 3 \\
0 & 1 & 2
\end{array}\right], \quad D=\left[\begin{array}{lll}
1 & 3 & 2 \\
3 & 9 & 5
\end{array}\right]
$$
\subsubsection*{Lösning}
…
\subsection*{Uppgift 4}
4. Finn lösningsmängden till ekvationen $A \mathbf{x}=$ b. Finns det noll, en, eller oändligt många lösningar till ekvationen, när
$$
A=\left[\begin{array}{ccc}
1 & 0 & -2 \\
2 & 2 & -3 \\
1 & 4 & 0
\end{array}\right] \quad \text { och } \quad \mathbf{b}=\left[\begin{array}{l}
0 \\
1 \\
2
\end{array}\right] ?
$$
\subsubsection*{Lösning}
…
\subsection*{Uppgift 5}
5. Förbränning av etanol med väteperoxid ger koldioxid och vatten. Den kemiska formeln kan skrivas
$$
x_{4} \mathrm{C}_{2} \mathrm{H}_{5} \mathrm{OH}+x_{3} \mathrm{H}_{2} \mathrm{O}_{2} \rightarrow x_{2} \mathrm{H}_{2} \mathrm{O}+x_{1} \mathrm{CO}_{2}
$$
Här används koefficienterna $x_{1}, x_{2}, x_{3}$ och $x_{4}$ för att beskriva antalet molekyler som behövs för att balansera ekvationen, så att det är lika många kol-, väte- och syreatomer i högerledet som i vänsterledet.
Sätt upp ett ekvationssystem bestående av ekvationerna för antalet kol-, väte- och syreatomer i systemet, och lös systemet. Använd de fria variablerna i lösningen till att hitta lägsta möjliga heltal för $x_{1}, x_{2}, x_{3}$ och $x_{4}$.
\subsubsection*{Lösning}
…
\subsection*{Uppgift 6}
6. Schemat visar ett resistivt nät med tre resistanser. Ansätt maskströmmar (Lay: loop currents") och ställ upp ekvationssystemet för strömmarna. Lös systemet för fallet $R_{1}=1 \Omega, R_{2}=1 \Omega, R_{3}=2 \Omega, E_{1}=6 \mathrm{~V}$ och $E_{2}=4 \mathrm{~V}$. Beräkna även spänningen över $R_{3}$. Notera att i symbolen för spänningskälla betecknar det längre och smalare strecket pluspolen.
\begin{center}
\includegraphics{imagee.png}
\end{center}
\subsubsection*{Lösning}
…
\subsection*{Uppgift 7}
7. För vilka värden h är vektorerna $\mathbf{u}=\left[\begin{array}{l}3 \\ 4 \\ 2\end{array}\right] \mathbf{v}=\left[\begin{array}{l}1 \\ 1 \\ 4\end{array}\right]$ och $\mathbf{w}=\left[\begin{array}{l}h \\ 2 \\ 1\end{array}\right]$ linjärt beroende?
\subsubsection*{Lösning}
…
\subsection*{Uppgift 8}
8. En linjär avbildning kan representeras av en matris. Här ska följande matriser användas för att generera avbildningar
$$
A=\left[\begin{array}{ll}
1 & 0 \\
1 & 1
\end{array}\right], \quad B=\left[\begin{array}{cc}
0 & 1 \\
-1 & 0
\end{array}\right]
$$
(a) Rita en figur som visar hur de två basvektorerna $\mathbf{e}_{x}=\left[\begin{array}{l}1 \\ 0\end{array}\right]$ och $\mathbf{e}_{y}=\left[\begin{array}{l}0 \\ 1\end{array}\right]$ avbildas av matrisen $A$.
(b) Rita en figur som visar hur $\mathbf{e}_{x}$ och $\mathbf{e}_{y}$ avbildas av matrisen $B$.
(c) En sammansatt avbildning kan skapas genom att kombinera två avbildningar. Här ska vi studera den sammansatta avbildning vi får om vi först skapar avbildningen $\mathbf{u} \rightarrow A \mathbf{u} \equiv \mathbf{v}$, och därefter skapar avbildningen $\mathbf{v} \rightarrow B \mathbf{v}=B(A \mathbf{u})$. Rita en figur som visar bilden av den sammansatta avbildningen för $\mathbf{u}=\mathbf{e}_{x}$, samt för $\mathbf{u}=\mathbf{e}_{y}$.
(d) Vad händer om vi byter ordning på avbildningarna så att $\mathbf{u} \rightarrow A(B \mathbf{u})$ ? Rita en bild för denna sammansatta avbildning när $\mathbf{u}=\mathbf{e}_{x}$, samt när $\mathbf{u}=\mathbf{e}_{y}$.
(e) Är de två sammansatta avbildningarna $A(B \mathbf{u})$ och $B(A \mathbf{x})$ samma avbildning?
\end{document}
```
| https://tex.stackexchange.com/users/294191 | Formatting Help Needed for Math Problem Set in LaTeX | false | I think user Teepeemm gave you the answer already. I could use an itemize environment at the end of your file to get a better math display, or vertically align your matrices in subsection 3, and so on. But if you REALLY WANT to format things manually, you could look at the commands provided by TeX back in the day. For example, `\!` and `\;` gives you predefined white space:
`x-2\!=\!\frac{y+3}{2}\;=\;\frac{z-1}{4}`
`\mkern` gives you a blank space of a given width:
```
2\mkern 30mu y-z=1
```
`\scriptstyle` changes the default font style
```
$${\scriptstyle
A=\left[\begin{array}{llll}
1 & 5 & 4 & 4 \\
3 & 4 & 1 & 6 \\
0 & 0 & 1 & 5
\end{array}\right], \quad B=\left[\begin{array}{ccc}
5 & -5 & 0 \\
0 & 1 & 0
\end{array}\right], \quad C=\left[\begin{array}{lll}
1 & 0 & 3 \\
0 & 1 & 2
\end{array}\right], \quad D=\left[\begin{array}{lll}
1 & 3 & 2 \\
3 & 9 & 5
\end{array}\right]}
$$
```
And many more, so you can check them out in your favourite texbook if you're interested. But then again, that comes with a price that LaTeX might not like that too much.
| 0 | https://tex.stackexchange.com/users/293305 | 681590 | 316,252 |
https://tex.stackexchange.com/questions/681591 | 2 | The code below produces a graph that is difficult to interpret because the nodes and edges are overlapping. I referred to another [Stackexchange post](https://tex.stackexchange.com/questions/309317/tikz-nodes-overlapping-with-edges-on-graph) for a solution but it seems not to work in this case. Can anyone explain how to prevent the edges overlapping with either each other or with nodes to make the graph more readable?
```
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
positioning,
quotes}
\begin{document}
\begin{tikzpicture}[
node distance = 7mm and 12mm,
V/.style = {circle, draw, font=\sffamily, minimum size=2em, inner sep =2pt},
every edge/.style = {draw, -{Straight Barb[scale=0.8]}, shorten > = 1mm},
every edge quotes/.style = {auto, font=\small\sffamily, sloped}
]
\node[V] (s) {s};
\node[V, right=of s] (j4) {j4};
\node[V, above =of j4] (j3) {j3};
\node[V, above =of j3] (j2) {j2};
\node[V, above =of j2] (j1) {j1};
\node[V, below =of j4] (j5) {j5};
\node[V, below =of j5] (j6) {j6};
\node[V, below =of j6] (j7) {j7};
\node[V, right=of j4] (t) {t};
\path (s) edge [red, "30"] (j1)
(s) edge [red, "40"] (j3)
(s) edge [red, "5"] (j7)
(s) edge [blue, "13"] (j4)
(s) edge [blue, "3"] (j5)
(s) edge [blue, "18"] (j6)
(s) edge [green, "14"] (j5)
(s) edge [black, "18"] (j2)
(s) edge [black, "15"] (j7)
(j3) edge [red, "1"] (j1)
(j7) edge [red, "1"] (j4)
(j6) edge [blue, "2"] (j3)
(j5) edge [green, "2"] (j3)
(j2) edge [black, "1"] (j1)
;
\end{tikzpicture}
\end{document}
```
| https://tex.stackexchange.com/users/262938 | Tikz: edges overlapping with other edges and nodes on graph | true | I guess (again) that you are probably looking for:
```
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
positioning,
quotes}
\begin{document}
\begin{tikzpicture}[
node distance = 7mm and 12mm,
V/.style = {circle, draw, font=\sffamily, minimum size=2em, inner sep =2pt},
every edge/.style = {draw, -{Straight Barb[scale=0.8]}, shorten > = 1mm},
every edge quotes/.style = {auto, inner sep = 1pt, font=\footnotesize\sffamily, sloped}
]
\node[V] (s) {s};
\node[V, right=of s] (j4) {j4};
\node[V, above =of j4] (j3) {j3};
\node[V, above =of j3] (j2) {j2};
\node[V, above =of j2] (j1) {j1};
\node[V, below =of j4] (j5) {j5};
\node[V, below =of j5] (j6) {j6};
\node[V, below =of j6] (j7) {j7};
\node[V, right=of j4] (t) {t};
\foreach \i/\j [count=\k] in {30/red, 18/black, 40/red,
13/blue, 14/green, 18/blue,
15/black}
\path (s) edge [\j, "\i"] (j\k);
\begin{scope}[bend right=45]
\path (j3) edge [red, "1"] (j1)
(j7) edge [red, "1"] (j4)
(j6) edge [blue, "2"] (j3)
(j5) edge [green, "2"] (j3)
(j2) edge [black, "1"] (j1);
\end{scope}
\end{tikzpicture}
\end{document}
```
**Addendum:**
* for shorter code are arrows from node `s` to nodes `j...` drawn in the `foreach` loop
* further shortening code can be done by using `chgains` library:
```
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
chains,
positioning,
quotes}
\begin{document}
\begin{tikzpicture}[
node distance = 7mm and 12mm,
start chain = going below,
V/.style = {circle, draw, font=\sffamily, minimum size=2em, inner sep =2pt},
every edge/.style = {draw, -{Straight Barb[scale=0.8]}, shorten > = 1mm},
every edge quotes/.style = {auto, inner sep = 1pt,
font=\footnotesize\sffamily, sloped}
]
\foreach \i in {1,2,...,7}
\node[V, on chain] (j\i) {j4};
\node[V, left=of j4] (s) {s};
\node[V, right=of j4] (t) {t};
\foreach \i/\j [count=\k] in {30/red, 18/black, 40/red,
13/blue, 14/green, 18/blue,
15/black}
\path (s) edge [\j, "\i"] (j\k);
\begin{scope}[bend right=45]
\path (j3) edge [red, "1"] (j1)
(j7) edge [red, "1"] (j4)
(j6) edge [blue, "2"] (j3)
(j5) edge [green, "2"] (j3)
(j2) edge [black, "1"] (j1);
\end{scope}
\end{tikzpicture}
\end{document}
```
Compilation result is the same as before.
| 3 | https://tex.stackexchange.com/users/18189 | 681592 | 316,253 |
https://tex.stackexchange.com/questions/681579 | 1 | I am seeking some help with formatting a math problem set in LaTeX. The document contains eight problems with sub-problems for each problem, including detailed instructions for solving each problem. The problems involve topics such as linear algebra, trigonometry, chemistry, and electric circuits.
I am having trouble with spacing between each row, margins, and other formatting issues. It doesn't look aesthetically pleasing for me. Could someone please take a look at the code and suggest ways to make it look neater? Your input would be greatly appreciated.
```
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\title{Krysstal 1}
\author{Namn}
\date{April 2023}
\begin{document}
\maketitle
\section*{Uppgifter}
\subsection*{Uppgift 1}
1. Visa att linjen
$$
x-2=\frac{y+3}{2}=\frac{z-1}{4}
$$
är parallell med planet $2 y-z=1$. Vilket är avståndet mellan linjen och planet?
\subsubsection*{Lösning}
…
\subsection*{Uppgift 2}
2. Punkterna $A=(1,2,3), B=(-2,1,0)$ och $C=(2,0,1)$ bildar en triangel.
(a) Beräkna triangelns area.
(b) Beräkna vinkeln vid punkten $A$.
\subsubsection*{Lösning}
…
\subsection*{Uppgift 3}
3. Vilka av följande utökade systemmatriser är skrivna på trappstegsform och vilka beskriver ett homogent linjärt system? Radreducera de fyra utökade matriserna och markera pivotpositionena. Vilka utökade matriser beskriver ett konsistent system?
$$
A=\left[\begin{array}{llll}
1 & 5 & 4 & 4 \\
3 & 4 & 1 & 6 \\
0 & 0 & 1 & 5
\end{array}\right], \quad B=\left[\begin{array}{ccc}
5 & -5 & 0 \\
0 & 1 & 0
\end{array}\right], \quad C=\left[\begin{array}{lll}
1 & 0 & 3 \\
0 & 1 & 2
\end{array}\right], \quad D=\left[\begin{array}{lll}
1 & 3 & 2 \\
3 & 9 & 5
\end{array}\right]
$$
\subsubsection*{Lösning}
…
\subsection*{Uppgift 4}
4. Finn lösningsmängden till ekvationen $A \mathbf{x}=$ b. Finns det noll, en, eller oändligt många lösningar till ekvationen, när
$$
A=\left[\begin{array}{ccc}
1 & 0 & -2 \\
2 & 2 & -3 \\
1 & 4 & 0
\end{array}\right] \quad \text { och } \quad \mathbf{b}=\left[\begin{array}{l}
0 \\
1 \\
2
\end{array}\right] ?
$$
\subsubsection*{Lösning}
…
\subsection*{Uppgift 5}
5. Förbränning av etanol med väteperoxid ger koldioxid och vatten. Den kemiska formeln kan skrivas
$$
x_{4} \mathrm{C}_{2} \mathrm{H}_{5} \mathrm{OH}+x_{3} \mathrm{H}_{2} \mathrm{O}_{2} \rightarrow x_{2} \mathrm{H}_{2} \mathrm{O}+x_{1} \mathrm{CO}_{2}
$$
Här används koefficienterna $x_{1}, x_{2}, x_{3}$ och $x_{4}$ för att beskriva antalet molekyler som behövs för att balansera ekvationen, så att det är lika många kol-, väte- och syreatomer i högerledet som i vänsterledet.
Sätt upp ett ekvationssystem bestående av ekvationerna för antalet kol-, väte- och syreatomer i systemet, och lös systemet. Använd de fria variablerna i lösningen till att hitta lägsta möjliga heltal för $x_{1}, x_{2}, x_{3}$ och $x_{4}$.
\subsubsection*{Lösning}
…
\subsection*{Uppgift 6}
6. Schemat visar ett resistivt nät med tre resistanser. Ansätt maskströmmar (Lay: loop currents") och ställ upp ekvationssystemet för strömmarna. Lös systemet för fallet $R_{1}=1 \Omega, R_{2}=1 \Omega, R_{3}=2 \Omega, E_{1}=6 \mathrm{~V}$ och $E_{2}=4 \mathrm{~V}$. Beräkna även spänningen över $R_{3}$. Notera att i symbolen för spänningskälla betecknar det längre och smalare strecket pluspolen.
\begin{center}
\includegraphics{imagee.png}
\end{center}
\subsubsection*{Lösning}
…
\subsection*{Uppgift 7}
7. För vilka värden h är vektorerna $\mathbf{u}=\left[\begin{array}{l}3 \\ 4 \\ 2\end{array}\right] \mathbf{v}=\left[\begin{array}{l}1 \\ 1 \\ 4\end{array}\right]$ och $\mathbf{w}=\left[\begin{array}{l}h \\ 2 \\ 1\end{array}\right]$ linjärt beroende?
\subsubsection*{Lösning}
…
\subsection*{Uppgift 8}
8. En linjär avbildning kan representeras av en matris. Här ska följande matriser användas för att generera avbildningar
$$
A=\left[\begin{array}{ll}
1 & 0 \\
1 & 1
\end{array}\right], \quad B=\left[\begin{array}{cc}
0 & 1 \\
-1 & 0
\end{array}\right]
$$
(a) Rita en figur som visar hur de två basvektorerna $\mathbf{e}_{x}=\left[\begin{array}{l}1 \\ 0\end{array}\right]$ och $\mathbf{e}_{y}=\left[\begin{array}{l}0 \\ 1\end{array}\right]$ avbildas av matrisen $A$.
(b) Rita en figur som visar hur $\mathbf{e}_{x}$ och $\mathbf{e}_{y}$ avbildas av matrisen $B$.
(c) En sammansatt avbildning kan skapas genom att kombinera två avbildningar. Här ska vi studera den sammansatta avbildning vi får om vi först skapar avbildningen $\mathbf{u} \rightarrow A \mathbf{u} \equiv \mathbf{v}$, och därefter skapar avbildningen $\mathbf{v} \rightarrow B \mathbf{v}=B(A \mathbf{u})$. Rita en figur som visar bilden av den sammansatta avbildningen för $\mathbf{u}=\mathbf{e}_{x}$, samt för $\mathbf{u}=\mathbf{e}_{y}$.
(d) Vad händer om vi byter ordning på avbildningarna så att $\mathbf{u} \rightarrow A(B \mathbf{u})$ ? Rita en bild för denna sammansatta avbildning när $\mathbf{u}=\mathbf{e}_{x}$, samt när $\mathbf{u}=\mathbf{e}_{y}$.
(e) Är de två sammansatta avbildningarna $A(B \mathbf{u})$ och $B(A \mathbf{x})$ samma avbildning?
\end{document}
```
| https://tex.stackexchange.com/users/294191 | Formatting Help Needed for Math Problem Set in LaTeX | false | * Your question is very opinion based ...
* Off-topic:
+ `$$` is TeX math delimiter, in LaTeX should be used `\[ ... \]` or `\begin{equation*} ... \end{equation*}`
+ you load `amsmath`, why you not use `bmatrix` for all matrices?
+ chem terms is far more simple to write by employing of `mhchem` package
* for matrices in in-line math you may/should consider to use `bsmallmatrix` or those matrices wrote as display math
* for lists I suggest to use `enumitem` package
```
\documentclass[draft]{article}
\usepackage{mathtools} % for bsmallmatrix
\usepackage[version=4]{mhchem}
\usepackage[shortlabels]{enumitem}
\usepackage{siunitx}
\usepackage{graphicx}
\title{Krysstal 1}
\author{Namn}
\date{April 2023}
\begin{document}
\maketitle
\section*{Uppgifter}
\subsection*{Uppgift 1}
1. Visa att linjen
\[
x-2=\frac{y+3}{2}=\frac{z-1}{4}
\]
är parallell med planet $2 y-z=1$. Vilket är avståndet mellan linjen och planet?
\subsubsection*{Lösning}
…
\subsection*{Uppgift 2}
2. Punkterna $A=(1,2,3), B=(-2,1,0)$ och $C=(2,0,1)$ bildar en triangel.
\begin{enumerate}[(a)]
\item Beräkna triangelns area.
\item Beräkna vinkeln vid punkten $A$.
\end{enumerate}
\subsubsection*{Lösning}
…
\subsection*{Uppgift 3}
3. Vilka av följande utökade systemmatriser är skrivna på trappstegsform och vilka beskriver ett homogent linjärt system? Radreducera de fyra utökade matriserna och markera pivotpositionena. Vilka utökade matriser beskriver ett konsistent system?
\[
A = \begin{bmatrix}
1 & 5 & 4 & 4 \\
3 & 4 & 1 & 6 \\
0 & 0 & 1 & 5
\end{bmatrix}, \quad
B = \begin{bmatrix}
5 & -5 & 0 \\
0 & 1 & 0
\end{bmatrix}, \quad
C = \begin{bmatrix}
1 & 0 & 3 \\
0 & 1 & 2
\end{bmatrix}, \quad
D = \begin{bmatrix}
1 & 3 & 2 \\
3 & 9 & 5
\end{bmatrix}
\]
\subsubsection*{Lösning}
…
\subsection*{Uppgift 4}
4. Finn lösningsmängden till ekvationen $A \mathbf{x}=$ b. Finns det noll, en, eller oändligt många lösningar till ekvationen, när
\[
A = \begin{bmatrix}
1 & 0 & -2 \\
2 & 2 & -3 \\
1 & 4 & 0
\end{bmatrix}
\quad \text{ och }\quad
\mathbf{b} = \begin{bmatrix}
0 \\
1 \\
2
\end{bmatrix}
\]
\subsubsection*{Lösning}
…
\subsection*{Uppgift 5}
5. Förbränning av etanol med väteperoxid ger koldioxid och vatten. Den kemiska formeln kan skrivas
\[
x_{4} \ce{C2H5OH}+x_{3} \ce{H2O2} \rightarrow x_{2} \ce{H2O}+x_{1} \ce{CO2}
\]
Här används koefficienterna $x_{1}, x_{2}, x_{3}$ och $x_{4}$ för att beskriva antalet molekyler som behövs för att balansera ekvationen, så att det är lika många kol-, väte- och syreatomer i högerledet som i vänsterledet.
Sätt upp ett ekvationssystem bestående av ekvationerna för antalet kol-, väte- och syreatomer i systemet, och lös systemet. Använd de fria variablerna i lösningen till att hitta lägsta möjliga heltal för $x_{1}, x_{2}, x_{3}$ och $x_{4}$.
\subsubsection*{Lösning}
…
\subsection*{Uppgift 6}
6. Schemat visar ett resistivt nät med tre resistanser. Ansätt maskströmmar (Lay: loop currents") och ställ upp ekvationssystemet för strömmarna. Lös systemet för fallet $R_{1}=\qty{1}{\ohm}$, $R_{2}=\qty{1}{\ohm}$, $R_{3}=\qty{2}{\ohm}$, $E_{1}=\qty{6}{\volt}$ och $E_{2}=\qty{4}{\volt}$. Beräkna även spänningen över $R_{3}$. Notera att i symbolen för spänningskälla betecknar det längre och smalare strecket pluspolen.
\begin{center}
\includegraphics{imagee.png}
\end{center}
\subsubsection*{Lösning}
…
\subsection*{Uppgift 7}
7. För vilka värden h är vektorerna $\mathbf{u}=\begin{bsmallmatrix}3 \\ 4 \\ 2 \end{bsmallmatrix} \mathbf{v}=\begin{bsmallmatrix}1 \\ 1 \\ 4\end{bsmallmatrix}$ och $\mathbf{w}=\begin{\end{bsmallmatrix}}h \\ 2 \\ 1\end{\end{bsmallmatrix}$ linjärt beroende?
\subsubsection*{Lösning}
…
\subsection*{Uppgift 8}
8. En linjär avbildning kan representeras av en matris. Här ska följande matriser användas för att generera avbildningar
\[
A = \begin{bmatrix}
1 & 0 \\
1 & 1
\end{bmatrix}, \quad
B = \begin{bmatrix}
0 & 1 \\
-1 & 0
\end{bmatrix}
\begin{enumerate}[(a)]
\item Rita en figur som visar hur de två basvektorerna $\mathbf{e}_{x} = \begin{bsmallmatrix} 1 \\ 0 \end{bsmallmatrix}$ och $\mathbf{e}_{y}=\begin{bsmallmatrix} 0 \\ 1 \end{bsmallmatrix}$ avbildas av matrisen $A$.
\item Rita en figur som visar hur $\mathbf{e}_{x}$ och $\mathbf{e}_{y}$ avbildas av matrisen $B$.
\item En sammansatt avbildning kan skapas genom att kombinera två avbildningar. Här ska vi studera den sammansatta avbildning vi får om vi först skapar avbildningen $\mathbf{u} \rightarrow A \mathbf{u} \equiv \mathbf{v}$, och därefter skapar avbildningen $\mathbf{v} \rightarrow B \mathbf{v}=B(A \mathbf{u})$. Rita en figur som visar bilden av den sammansatta avbildningen för $\mathbf{u}=\mathbf{e}_{x}$, samt för $\mathbf{u}=\mathbf{e}_{y}$.
\item Vad händer om vi byter ordning på avbildningarna så att $\mathbf{u} \rightarrow A(B \mathbf{u})$ ? Rita en bild för denna sammansatta avbildning när $\mathbf{u}=\mathbf{e}_{x}$, samt när $\mathbf{u}=\mathbf{e}_{y}$.
\item Är de två sammansatta avbildningarna $A(B \mathbf{u})$ och $B(A \mathbf{x})$ samma avbildning?
\end{enumerate}
\end{document}
```
Compilation above mWE gives three page long document- Last page looks as follows:
| 0 | https://tex.stackexchange.com/users/18189 | 681594 | 316,254 |
https://tex.stackexchange.com/questions/681589 | 2 | I'm trying to issue TeX warnings from within `\directlua` with accurate line numbers (pointing to the offending line in the `.tex` document).
When I compile the MWE below with lualatex, `\TestTex` issues a warning that correctly points to line 40. However, `\TestLua` and `\TestLuaIndirect` both issue warnings pointomg to line 1.
Any help would be much appreciated. Thank you!
```
\documentclass{article}
\ExplSyntaxOn
\msg_new:nnn { test } { test-warning } { #1 ~ \msg_line_context: }
\NewDocumentCommand { \TestTex } { }
{
\ExplSyntaxOn
\msg_warning:nnn { test } { test-warning } { tex ~ warning }
\ExplSyntaxOff
}
\NewDocumentCommand { \TestLua } { }
{
\directlua
{
tex.sprint('\\ExplSyntaxOn'
.. '\\msg_warning:nnn { test } { test-warning }'
.. '{ lua ~ warning }'
.. '\\ExplSyntaxOff')
}
}
\NewDocumentCommand { \TestLuaIndirect } { }
{
\directlua
{
tex.sprint('\\TestTex')
}
}
\ExplSyntaxOff
\begin{document}
Test.
\TestTex
\TestLua
\TestLuaIndirect
\end{document}
```
| https://tex.stackexchange.com/users/170958 | Throwing warnings inside \directlua | true | Basicaislly `sprint` creates a new "file-like layer" in the input stack (imagine that a `\input{tmpfile}` is executed, and the warning itself is on line 1 of the temporary file). You want to unroll it "as if it's executed from a macro".
Speaking of which, `\ExplSyntaxOn` inside any `{...}` is almost-always wrong: [macros - Why doesn't \makeatletter work inside \newcommand? - TeX - LaTeX Stack Exchange](https://tex.stackexchange.com/questions/201348/why-doesnt-makeatletter-work-inside-newcommand)
One possible workaround follows, use `\futurelet` to force unroll the input stack, similar to the case in my question/answer [luatex - How can I make macros called from tex.print tail-recursive? - TeX - LaTeX Stack Exchange](https://tex.stackexchange.com/questions/640922/how-can-i-make-macros-called-from-tex-print-tail-recursive). Note that the `sprint` must be the **last** one in the `\directlua` block for this to work.
```
\documentclass{article}
\ExplSyntaxOn
\msg_new:nnn { test } { test-warning } { #1 ~ \msg_line_context: }
\NewDocumentCommand { \TestTex } { }
{
\msg_warning:nnn { test } { test-warning } { tex ~ warning }
}
\NewDocumentCommand { \TestLua } { }
{
\directlua
{
tex.sprint('\\ExplSyntaxOn\\def\\tmp{'
.. '\\msg_warning:nnn { test } { test-warning }'
.. '{ lua ~ warning }'
.. '}\\ExplSyntaxOff\\futurelet\\tmpa\\tmp')
}
}
\NewDocumentCommand { \TestLuaIndirect } { }
{
\directlua
{
tex.sprint('\\futurelet\\tmpa\\TestTex')
}
}
\ExplSyntaxOff
\begin{document}
Test.
\TestTex
\TestLua
\TestLuaIndirect
\end{document}
```
Of course the disadvantage is that the catcode is fixed.
An alternative is to print a token directly:
```
\documentclass{article}
\ExplSyntaxOn
\msg_new:nnn { test } { test-warning } { #1 ~ \msg_line_context: }
\NewDocumentCommand { \TestTex } { }
{
\msg_warning:nnn { test } { test-warning } { tex ~ warning }
}
\NewDocumentCommand { \TestLuaIndirect } { }
{
\directlua
{
token.put_next(token.create('TestTex'))
}
}
\ExplSyntaxOff
\begin{document}
Test.
\TestTex
\TestLuaIndirect
\end{document}
```
Refer to [Can the Lua part of LuaTeX know about tokens?](https://tex.stackexchange.com/questions/45293/can-the-lua-part-of-luatex-know-about-tokens?noredirect=1&lq=1) and `texdoc luatex` for some documentation.
| 2 | https://tex.stackexchange.com/users/250119 | 681595 | 316,255 |
https://tex.stackexchange.com/questions/84983 | 8 | With the simple `equation` environment;
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
a \foo b
\end{equation}
\end{document}
```
you can see a helpful error message, which editors like Kile understands;
```
! Undefined control sequence.
l.5 a \foo
b
```
Making it report `5: Undefined control sequence a \foo`
But if you do the same in an amsmath environment, such as the popular `align`
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
a \foo b
\end{align}
\end{document}
```
you get the unhelpful error (and it comes up twice);
```
! Undefined control sequence.
<argument> a \foo
b
l.6 \end{align}
```
which makes Kile report; `6: Undefined control sequence \end{align}`.
Checking the log is tedious and ultimately unrewarding, because not even in there can I find the actual line which contained the undefined control sequence.
**Can this awful behavior be helped in any way?**
| https://tex.stackexchange.com/users/2199 | Unhelpful, misleading errors in amsmath environments | false | TeX is unable to report more information about undefined control sequence. Suppose the following example:
```
\def\process#1{{\preprocess #1}}
\def\preprocess{\def\foo{Hello}}
\process{
There is
a text
with \foo.
More
lines.
}
\let\preprocess=\relax
\process{
There is
a text
with \foo.
More
lines.
}
\bye
```
The first usage of `\process` runs without errors, the second usage will cause the error:
```
! Undefined control sequence.
<argument> There is a text with \foo
. More lines.
\process #1->{\preprocess #1
}
l.20 }
```
You can see, that TeX cannot check, if all control sequences in scanned argument is defined during scanning it and before the argument is used. The meaning of control sequences can be changed before the usage of the argument somewhere in the depths of macros.
Of course, the error message "undefined control sequence" could contain the problematic control sequence printed itself, but such a message format goes against other error message formats reported by TeX. TeX adheres to the principle: All error messages keeps uniform style.
Everything else is a problem of log scanners if they are used.
| 2 | https://tex.stackexchange.com/users/51799 | 681597 | 316,257 |
https://tex.stackexchange.com/questions/681312 | 2 | In the following code, I have a main file and a single chapter. The title of the chapter is
```
The Tale of Rabbit Reproduction: $a_{n} = a_{n-1} + a_{n-2}$
```
and I encoded it with
```
The Tale of Rabbit Reproduction: \texorpdfstring{$a_{n} = a_{n-1} + a_{n-2}$}{a[n] = a[n-1] + a[n-2]}
```
I am getting the following error message.
```
! Font U/bbold/m/n/24.88=bbold25 at 24.88pt not loadable: Metric (TFM) file not found.
```
Is there a flaw in the code?
```
\documentclass[10pt, oneside]{book}
% packages
\usepackage{amssymb, amsmath, amsthm}
%This package allows Chapter titles to be single spaced.
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\setstretch{0.25}\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titleformat{\section}
{\setstretch{0.25}\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\singlespacing\normalfont\large\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}
{\singlespacing\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{}
% these make top, right, bottom margins confirming to the requirements
\usepackage[a4paper,bindingoffset=0.0in,%
left=1.5in,right=1in,top=1in,bottom=1in,%
footskip=.25in]{geometry}
\usepackage{setspace}
\usepackage{blindtext}
% small stuff
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{mathbbol}
\usepackage{hyperref}
\urlstyle{same}
\usepackage{footnote}
\hypersetup{colorlinks,linkcolor={black},citecolor={black},urlcolor={black}}
\usepackage{microtype}
% \usepackage{showkeys}
% uncomment this when editing cross-references
\numberwithin{equation}{section}
%------------------------------------------------
% doesn't count introduction when numbering theorems, etc.
\setcounter{chapter}{0}
% makes page numbers appear
\pagestyle{plain}
\usepackage{showframe}
\renewcommand*\ShowFrameLinethickness{0.2pt}
\renewcommand*\ShowFrameColor{\color{blue}}
\begin{document}
% makes the page numbers roman numerals, doesn't count
% these pages in the table of contents
\frontmatter
\thispagestyle{empty}
\vbox to 1truein{}
\centerline{Fairy Tales throughout History}
\vskip 200pt
\centerline{BY}
\vskip 10pt
\centerline{A Storyteller}
\vskip 10pt
\centerline{BA, Bard College}
\centerline{MA, Columbia University}
\vskip 215pt
\centerline{DISSERTATION}
\vskip 10pt
\centerline{Submitted in partial fulfillment of the requirements for}
\centerline{the degree of Doctor of Philosophy in English}
\centerline{in the Graduate School of}
\centerline{Columbia University}
\newpage
\thispagestyle{empty}
\vbox to 8.5truein{}
\centerline{\copyright\ Copyright by A Storyteller 2023}
\
\centerline{All Rights Reserved}
\newpage
\chapter*{Abstract}
\begin{doublespace}
Fairy tales' rich, imaginative stories for children~---~involving fantastical creatures and exotic places~---~offer far more than entertainment and happily-ever-after endings. They furnish children with a landscape for critical thinking skills and a context in which children can evaluate their own emotions and decision making.
\end{doublespace}
\newpage
\chapter*{Dedication}
\bigskip
\centerline{Dedicated to the Grimm Brothers and Hans Christian Anderson}
\newpage
\chapter*{Acknowledgements}
I wish to thank Walt Disney for animating various fairy tales in full color.
\newpage
\tableofcontents
% Changes page numbers to regular numbers, resets the counter
\mainmatter
%This gives 10pt font with 20pt spacing, text from here should be double spaced
\fontsize{10}{20pt} \selectfont
% \include puts in the .tex file with the given name
% make sure that these files don't have any preamble material
\begin{doublespacing}
\include{March_30-Introduction}
%\include{March_30-Chapter_1}
%\include{March_29-Chapter_2}
\end{doublespacing}
% add a new chapter without a chapter # for the references
\addcontentsline{toc}{chapter}{Bibliography}
\begin{thebibliography}{9}
\bibitem[Southey 1837]{Southey}Robert Southey, \emph{The Doctor}, Longman, Rees, Orme, Brown, Green and Longman, London, England, 1837, pages 318-326
\end{thebibliography}
\end{document}
```
Here is the only chapter in the file.
```
%
%
%
% Introduction
%
%
% make introduction a chapter without a #
\chapter*{Introduction (In case I decide to have a more descriptive name for the introduction, I want it to be single spaced or maybe half-line spaced)}
% and include it on the table of contents
\addcontentsline{toc}{chapter}{Introduction}
We will look at various fairy tales and myths in civilizations throughout history!
\newcommand\mymath{\(\sin(x) + 2ab - \frac{e^{2x}+1}{e^{2x}-1}\)}
\chapter{The Tale of Rabbit Reproduction: \texorpdfstring{$a_{n} = a_{n-1} + a_{n-2}$}{a[n] = a[n-1] + a[n-2]}}
```
| https://tex.stackexchange.com/users/56838 | Error compiling code due to text in the title of a chapter that is encoded in math mode | false | The error message you are getting is related to the `mathbbol` package you are using, which provides a font for extra math symbols. It seems that the font files required by the package are missing or not installed properly.
Make sure TeX Live or MiKTeX is up to date. Alternatively, you can try to use package `bbm` instead.
| 1 | https://tex.stackexchange.com/users/262813 | 681599 | 316,259 |
https://tex.stackexchange.com/questions/681530 | 0 | I have a bibliography whose items are inside a `LaTeX`-script (as in journal templates). Here ["How to make sections in a bibliography"](https://tex.stackexchange.com/questions/681311/how-to-make-sections-in-a-bibliography/681327?noredirect=1#comment1690791_681327) someone helped me to create sections in my bibliography.
I want to keep the numbers in my bibliography to refer to the section where it was employed, but I don't want those sections to appear in the TOC. So using a star (\*) after the keyword is not what I am looking for.
| https://tex.stackexchange.com/users/260816 | How to remove section number in TOC while keeping the nummeration | false | I found something that seem to work (but I don't have the reference anymore):
```
\newcommand*{\BeginNoToc}{%
\addtocontents{toc}{%
\edef\protect\SavedTocDepth{\protect\the\protect\value{tocdepth}}%
}%
\addtocontents{toc}{%
\protect\setcounter{tocdepth}{-10}%
}%
}
\newcommand*{\EndNoToc}{%
\addtocontents{toc}{%
\protect\setcounter{tocdepth}{\protect\SavedTocDepth}%
}%
}
```
Thanks a ton everybody :)
| 0 | https://tex.stackexchange.com/users/260816 | 681603 | 316,262 |
https://tex.stackexchange.com/questions/681576 | 0 | What I'm trying to do is have elements of a bulleted list appear in order, but then before the list is complete, make a table appear, then the rest of the list. My attempt to do this is here:
```
\begin{columns}
\begin{column}{.7\textwidth}
\begin{itemize}[(I)]
\item<1-> Some Text
\item<2-> Some text
\item<3-> More text
\item<4-> Text I want to display after displaying the table below
\end{itemize}
\end{column}
\begin{column}{.3\textwidth}
\begin{table}<3->
%I want this to display before the end of the list
\centering
\begin{tabular}{ c || c c c }
{} & A & B & C \\
\hline \hline
A & $\varepsilon$ & -1 & 1 \\
B & 1 & $\varepsilon$ & -1 \\
C & -1 & 1 & $\varepsilon$
\end{tabular}
\end{table}
\end{column}
\end{columns}
\end{frame}
```
| https://tex.stackexchange.com/users/293949 | How do I animate a beamer slide using elements from outside a list? | false | Beamer columns are overlay aware, so you can make the whole column containing the table appear on the 3rd overlay.
Please also note that you don't need `\centering`, beamer will automatically centre the content of a `table` environment.
```
\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{columns}
\begin{column}{.7\textwidth}
\begin{itemize}[(I)]
\item<1-> Some Text
\item<2-> Some text
\item<3-> More text
\item<4-> Text I want to display after displaying the table below
\end{itemize}
\end{column}
\begin{column}<3->{.3\textwidth}
\begin{table}
%I want this to display before the end of the list
%\centering
\begin{tabular}{ c || c c c }
{} & A & B & C \\
\hline \hline
A & $\varepsilon$ & -1 & 1 \\
B & 1 & $\varepsilon$ & -1 \\
C & -1 & 1 & $\varepsilon$
\end{tabular}
\end{table}
\end{column}
\end{columns}
\end{frame}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/36296 | 681604 | 316,263 |
https://tex.stackexchange.com/questions/681095 | 1 | I am using the compiled version of `Kile` since a while (version 2.9.94). As my projects I am working on are large and take a longer time to compile, I am using `subfile{}` to speed up the compilation (which works quite nicely). However, in the `structure` tree of Kile, these files are not displayed and I have to manually open the files into Kile in order to edit them. Is there any possible way to get the files which are included via the `subfile` keyword are shown up in the `structure` tree as well? I read something that I can activate the inclusion of such files in `Kile -> Settings -> Build` somewhere but I could not find anything there.
Note: When I change the `subfile` to `include` it directly gets visible in the `structure` tree of Kile.
| https://tex.stackexchange.com/users/116084 | Allow Kile to show subfiles in the structure tree | true | It seems that, due to the fact that `subfile` mimics separate latex documents itself, that Kile cannot recognize them. However, I found an easy workaround by simply creating a `Project` in Kile and add all the files manually. That's good enough and resolves my issue.
| 0 | https://tex.stackexchange.com/users/116084 | 681605 | 316,264 |
https://tex.stackexchange.com/questions/681607 | 1 | I use this to create a custom display of my references in my document:
```
\DeclareCiteCommand{\citehyperref}
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\ifhyperref
{\hyperlink{\thefield{entrykey}}{\usebibmacro{title}\printtext[parens]{\printfield{year}}}}
{\usebibmacro{title}\printtext[parens]{\printfield{year}}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareFieldFormat[article,book,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{\printnames{author}\addcolon\space\textit{#1}\isdot}
```
I have want I want: an hyperlink with "Last name, first name: title (date)". The only problem is that the hyperlink sens to the top of the document instead of the corresponding reference in the bibliography at the end of the document.
How can I solve this?
Thanks in advance.
EDIT:
.tex file:
```
\documentclass[twoside,openright,12pt]{report}
\usepackage[a4paper,left=2cm,right=2cm,top=2cm,bottom=3cm]{geometry}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
% BIBLIOGRAPHY
%\usepackage{natbib} % première bibliographie
\usepackage{csquotes}
\usepackage[style=authoryear-icomp,autolang=hyphen]{biblatex}
\addbibresource{essai.bib}
\DeclareCiteCommand{\citehyperref}
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\ifhyperref
{\hyperlink{\thefield{entrykey}}{\usebibmacro{title}\printtext[parens]{\printfield{year}}}}
{\usebibmacro{title}\printtext[parens]{\printfield{year}}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareFieldFormat[article,book,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{\printnames{author}\addcolon\space\textit{#1}\isdot}
\usepackage{setspace}
\usepackage[french]{babel}
\usepackage[pdftex]{graphicx}
\usepackage{float}
\usepackage{epigraph}
\begin{document}
This is a citation
\citehyperref{MY_REF}
\newpage
\newpage
\newpage
\addcontentsline{toc}{chapter}{Bibliographie}
\chaptermark{Bibliographie}
\printbibheading
\printbibliography
\end{document}
```
And this is my .bib file:
```
@book{MY_REF,
title = {TITLE},
isbn = {2-7578-2258-6},
pagetotal = {312},
publisher = {Points documents},
author = {XXX, YYY},
urldate = {2023-03-11},
date = {2011-04-21},
}
```
| https://tex.stackexchange.com/users/181342 | Custom hyperlink to the bibliography sends to the top of document | true | biblatex offers `\bibhyperref` to handle links. It will also work if hyperref is not used:
```
\documentclass{report}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[style=authoryear-icomp,autolang=hyphen]{biblatex}
\addbibresource{test.bib}
\DeclareCiteCommand{\citehyperref}
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\bibhyperref{\usebibmacro{title}\printtext[parens]{\printfield{year}}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareFieldFormat[article,book,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{\printnames{author}\addcolon\space\textit{#1}\isdot}
\usepackage{hyperref}
\begin{document}
This is a citation
\citehyperref{shepard_absolument_2011}
\newpage
\printbibliography[heading=bibintoc]
\end{document}
```
| 1 | https://tex.stackexchange.com/users/2388 | 681620 | 316,272 |
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 | Let's show 2 unicorns, inspired by what we know from gables or blazons, like here:
The code below basically does two things:
* combine two [previous](https://tex.stackexchange.com/a/681500/245790) drawings I [posted](https://tex.stackexchange.com/a/681437/245790) here as `tikz pics`
* shift the two `\pic`s against each other via the "constant" `\newcommand\shft[0]{1}`
Relevant code section:
```
\tikz{
\pic at (-\shft,0) {beauty};
\pic [xscale=-1] at (+\shft,0) {uni};
}
```
For `shft=1`, this is the result:
But it's also fun to see what happens for 0, 2, 2.5, 3, 3.5, 4 and 5. Wrt. `AI` they can be generated easily, but not all will be appreciated as nice, esthtic or beautiful. Some may appear disturbing, or like taken from a test from psychology. The last one even qualifies for "telling a story by one picture". Or in techno-speak: `shft` introduces a lot of `noise` for us humans.
```
\documentclass[10pt, border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.shapes,shapes.geometric}
\newcommand\shft[0]{1}% shift amount for the \pic's
\begin{document}
\tikzset{% needed for beauty-corn
paint/.style={draw=#1!50!black, fill=#1!50},
my star/.style={decorate,decoration={shape backgrounds,shape=star},
star points=#1}
}
\tikzset{% beaty-corn, as one-liners
beauty/.style={line width=1pt,decoration={shape sep=8pt,shape size=8pt}},
beauty/.pic={
% ~~~ horn coloration ~~~~~~~~
\draw [decoration={shape sep=11pt,shape size=10pt},my star=6, paint=yellow]
(4.67, 5.22) -- (3.25,4.4);
% ~~~ head ~~~~~~~~
\draw (2.96, 4.67) to [out=88, in=95] (3.22, 4.78);\draw (3.13, 4.63) to [out=55, in=85] (3.22, 4.43) to [out=-45, in=105] (3.57, 3.79) to [out=288, in=85] (3.88, 2.86);\draw (3.77, 2.82) to [out=230, in=280] (3.32, 2.73) to [out=90, in=300] (2.79, 3.34);\draw (2.84, 3.28) to [out=185, in=270] (2.20, 3.92) to [out=250, in=160] (2.67, 2.83);
% ~~~ eye ~~~~~~~~
\draw (3.30, 4.10) to [out=190, in=160] (3.04, 4.04) to [out=300, in=190] (3.32, 3.93);
% ~~~ nose ~~~~~~~~
\draw (3.84, 2.83) -- (3.70, 3.00);
% ~~~ hair ~~~~~~~
\draw [my star=5, paint=red] (2.89, 4.83) to [out=180, in=90] (1.78, 3.69) to [out=270, in=160] (2.90, 2.50);\draw [my star=5, paint=orange] (1.63, 4.24) to [out=230, in=80] (2.14, .76);\draw [my star=5, paint=blue] (1.73, .45) to [out=70, in=270] (1.03, 3.04);\draw [my star=5, paint=yellow] (1.61, 3.65) to [out=260, in=140] (2.31, 2.29) to [out=-40, in=105] (3.34, 1.54);
% ~~~ horn ~~~~~~
\draw (3.48, 4.19) to [out=35, in=30] (4.67, 5.22) to [out=35, in=30](3.65, 4.82);\draw (3.65, 4.34) to [out=90 , in=280] (3.59, 4.69);\draw (3.85, 4.51) to [out=90 , in=290] (3.79, 4.75);\draw (4.00, 4.64) to [out=95 , in=290] (3.96, 4.83);\draw (4.19, 4.77) to [out=95 , in=300] (4.16, 4.89);
}}
\tikzset{% uni-corn, as one-liners
uni/.style={line width=4.5pt,decorate,decoration={mirror=true}},
uni/.pic={
% ~~~ head ~~~~~~~~
\draw (2.96, 4.67) to [out=88, in=95] (3.22, 4.78);\draw (3.13, 4.63) to [out=55, in=85] (3.22, 4.43) to [out=-45, in=105] (3.57, 3.79) to [out=288, in=85] (3.88, 2.86);\draw (3.77, 2.82) to [out=230, in=280] (3.32, 2.73) to [out=90, in=300] (2.79, 3.34);\draw (2.84, 3.28) to [out=185, in=270] (2.20, 3.92) to [out=250, in=160] (2.67, 2.83);
% ~~~ eye ~~~~~~~~
\draw (3.30, 4.10) to [out=190, in=160] (3.04, 4.04) to [out=300, in=190] (3.32, 3.93);
% ~~~ nose ~~~~~~~~
\draw (3.84, 2.83) -- (3.70, 3.00);
% ~~~ hair ~~~~~~~
\draw (2.89, 4.83) to [out=180, in=90] (1.78, 3.69) to [out=270, in=160] (2.90, 2.50);\draw (1.63, 4.24) to [out=230, in=80] (2.14, .76);\draw (1.73, .45) to [out=70, in=270] (1.03, 3.04);\draw (1.61, 3.65) to [out=260, in=140] (2.31, 2.29) to [out=-40, in=105] (3.34, 1.54);
% ~~~ horn ~~~~~~
\draw (3.48, 4.19) to [out=35, in=30] (4.67, 5.22) to [out=35, in=30](3.65, 4.82);\draw (3.65, 4.34) to [out=90 , in=280] (3.59, 4.69);\draw (3.85, 4.51) to [out=90 , in=290] (3.79, 4.75);\draw (4.00, 4.64) to [out=95 , in=290] (3.96, 4.83);\draw (4.19, 4.77) to [out=95 , in=300] (4.16, 4.89);
}}
\tikz{
\pic at (-\shft,0) {beauty};
\pic [xscale=-1] at (+\shft,0) {uni};
}
\end{document}
```
| 4 | https://tex.stackexchange.com/users/245790 | 681622 | 316,273 |
https://tex.stackexchange.com/questions/445954 | 8 | I'm using a Latin American Spanish keyboard layout, and the slash key is only reachable as SHIFT+7. In Overleaf v1 I used the Edit menu and the Toggle comment operation. How can this be done in Overleaf v2?
| https://tex.stackexchange.com/users/63631 | Overleaf v2 shortcuts for non english keyboard | false | On swedish keyboard: select text and then `control + shift + 3`
| 1 | https://tex.stackexchange.com/users/269587 | 681628 | 316,276 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.