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/690054
|
0
|
Hi there I am trying align the "2403 Y" to the top of the 4 connected rows and not in the middle of the 4 connected rows.
```
\begin{longtblr}[
caption = {Ergebnisse der Gitterschnittprüfung der bei $40^{\circ}C$ gehärteten Proben PUA 2403 X, -Y und -Z},
label = {tblr:GT 40 grad},
]
{width=\linewidth,colspec={X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]}}
\hline
\textbf{PUA Nr.} & \textbf{Substrat} & \textbf{Blech Nr.} & \textbf{GT Nr. 1} & \textbf{GT Nr. 2} & \textbf{GT Nr. 3} & \textbf{Mittelwert} & \textbf{Stabw. S}\\
\hline
\SetCell[r=4]{c} \rotatebox[origin=c]{90}{2403 X}& Oxsilan & 4 & 0 & 0 & 0 & 0 & 0\\\hline
&Fe Phosphatiert & 5 & 0 & 0 & 0 & 0 & 0 \\\hline
&Zn Phosphatiert & 1 & 0 & 0 & 0 & 0 & 0 \\\hline
&Gestrahltes Aluminium & 1 & 0 & 0 & 0 & 0 & 0 \\
\hline
\SetCell[r=4]{c} \rotatebox[origin=c]{90}{2403 Y}& Oxsilan & 3 & 0 & 0 & 0 & 0 & 0\\\hline
&Fe Phosphatiert & 4 & 0 & 0 & 0 & 0 & 0 \\\hline
&Zn Phosphatiert & 2 & 0 & 0 & 0 & 0 & 0 \\\hline
&Gestrahltes Aluminium & 1 & 0 & 0 & 0 & 0 & 0 \\
\hline
\SetCell[r=4]{c} \rotatebox[origin=c]{90}{2403 Z}& Oxsilan & 1 & 0 & 0 & 0 & 0 & 0\\\hline
&Fe Phosphatiert & 4 & 0 & 0 & 0 & 0 & 0 \\\hline
&Zn Phosphatiert & 2 & 0 & 0 & 0 & 0 & 0 \\\hline
&Gestrahltes Aluminium & 1 & 0 & 0 & 0 & 0 & 0 \\
\hline
\end{longtblr}
```
Ty for any help
|
https://tex.stackexchange.com/users/293330
|
Top alignment of SetCell command
| false |
I would write your table on the following way:
```
\documentclass{article}
\usepackage{geometry}
\usepackage{rotating}
\usepackage{makecell}
\renewcommand\theadfont{}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}
\SetTblrStyle{caption-tag}{font=\small\bfseries}
\SetTblrStyle{caption-text}{font=\small}
\begin{document}
\begin{talltblr}[
caption = {Ergebnisse der Gitterschnittprüfung der bei \qty{40}{\degreeCelsius} gehärteten Proben PUA 2403 X, -Y und -Z},
label = {tblr:GT 40 grad},
]{hlines, vlines,
colspec = {X[0.5, c,m] X[1.2, c,m] *{6}{X[c,m]} },
colsep = 3pt,
cell{2,10}{1} = {r=4}{cmd=\settowidth\rotheadsize{2403 X}\rothead},
cell{6}{1} = {r=4}{cmd=\settowidth\rotheadsize{2403 X}\rothead, h},
row{1} = {font=\small\bfseries},
}
PUA Nr. & Substrat & Blech Nr. & GT Nr. 1 & GT Nr. 2 & GT Nr. 3 & Mittelwert & Stabw. S \\
2403 X & Oxsilan & 4 & 0 & 0 & 0 & 0 & 0 \\
& Fe Phosphatiert
& 5 & 0 & 0 & 0 & 0 & 0 \\
& Zn Phosphatiert
& 1 & 0 & 0 & 0 & 0 & 0 \\
& Gestrahltes Aluminium
& 1 & 0 & 0 & 0 & 0 & 0 \\
2403 Y & Oxsilan & 3 & 0 & 0 & 0 & 0 & 0 \\
& Fe Phosphatiert
& 4 & 0 & 0 & 0 & 0 & 0 \\
& Zn Phosphatiert
& 2 & 0 & 0 & 0 & 0 & 0 \\
& Gestrahltes Aluminium
& 1 & 0 & 0 & 0 & 0 & 0 \\
2403 Z & Oxsilan & 1 & 0 & 0 & 0 & 0 & 0 \\
& Fe Phosphatiert
& 4 & 0 & 0 & 0 & 0 & 0 \\
& Zn Phosphatiert
& 2 & 0 & 0 & 0 & 0 & 0 \\
& Gestrahltes Aluminium
& 1 & 0 & 0 & 0 & 0 & 0 \\
\end{talltblr}
\end{document}
```
Main differences to your code snippet are:
* for table is used `talltblr` table (since it is not evident that this table spans more pages)
* last six columns have equal width, the first and second column width fare narrower and wider respectively
* for rotate cell content are used `rotating` and `makecell` package
Unfortunately your page layout is unknown. In the case, that your table should be narrower, for example with width of default text block width of the `article` document class, that you should change MWE and `\talltblr` preamble to:
```
\documentclass{article}
%\usepackage{geometry}
\usepackage{rotating}
\usepackage{makecell}
\renewcommand\theadfont{}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}
\SetTblrStyle{caption-tag}{font=\small\bfseries}
\SetTblrStyle{caption-text}{font=\small}
\begin{document}
\begin{talltblr}[
caption = {Ergebnisse der Gitterschnittprüfung der bei \qty{40}{\degreeCelsius} gehärteten Proben PUA 2403 X, -Y und -Z},
label = {tblr:GT 40 grad},
]{hlines, vlines,
colspec = {X[0.7, c,m] X[1.7, c,m] *{6}{X[c,m, cmd=\hspace{0pt}]} },
colsep = 3pt,
cell{2,10}{1} = {r=4}{cmd=\settowidth\rotheadsize{2403 X}\rothead},
cell{6}{1} = {r=4}{cmd=\settowidth\rotheadsize{2403 X}\rothead, h},
row{1} = {font=\small\bfseries},
}
```
and resulted table will be:
BTW, desired change of your table design make it (according to my opinion) ugly.
|
0
|
https://tex.stackexchange.com/users/18189
|
690271
| 320,206 |
https://tex.stackexchange.com/questions/517510
|
6
|
In [this](https://tex.stackexchange.com/questions/378376/two-different-page-counters-in-critical-editions) question, David Carlisle provided some code to create a second page-counter in the header to indicate pages and page-breaks for critical editions. This is pretty cool. However, as documents grow complex, I run into problems. Here is a MWE detailing two:
```
\documentclass{scrbook}
\usepackage{lipsum}
\usepackage{scrlayer-scrpage}
\ohead{\textbf{\pagemark}}
\def\lastoldpagemark{\topmarks\oldpagemark}
\ihead{\textit{\lastoldpagemark\ifnum\lastoldpagemark<\botmarks\oldpagemark--\botmarks\oldpagemark\fi
\xdef\lastoldpagemark{\botmarks\oldpagemark}}}
\ofoot{}
\pagestyle{scrheadings}
\newmarks\oldpagemark % etex marks not completely reliable in latex, but probably OK here
\newcounter{oldpage}
\setcounter{oldpage}{1}
\newcommand{\markoldpage}{
[mark]
\marks\oldpagemark{\theoldpage}\marginpar{\centering\footnotesize\theoldpage}
\stepcounter{oldpage}
}
\begin{document}
\chapter{First Chapter}
\markoldpage{} This is the first oldpage.
\markoldpage{} Now the second oldpage has begun.
\lipsum[1]
\lipsum[3] \markoldpage{}
\lipsum \markoldpage{}
\lipsum[1-10] \markoldpage{}
\lipsum[1]
\chapter{Second Chapter}
\section{First Section}
\setcounter{oldpage}{20}
\markoldpage{} This is the first oldpage. \markoldpage{} Now the second oldpage has begun.
\newpage
\lipsum[1-3] \markoldpage{} \lipsum[1-3] \markoldpage{}
\section{Second Section}
\setcounter{oldpage}{17} \markoldpage
\lipsum[1]
\end{document}
```
1. Sometimes, the oldpage counter in the page *following* a new chapter
is incorrect, as exemplified on pages two and six of the output. Can
someone help me understand what’s going on?
2. If I place a new item on the *same* page which has a *lower oldpage*
(e.g. with a `\section` instead of a `\chapter` as indicated in the
MWE), then, of course, the page-counter also doesn’t work, as the
macro only specifies this for larger oldpage-numbers. Would it be
possible in this case to use the marks to typeset it like this:
[OldpageSection1], [OldpageSection2]
|
https://tex.stackexchange.com/users/134455
|
Two different page-counters in critical editions, part 2
| true |
The new mark-system described in [ltmarks](https://www.latex-project.org/help/documentation/ltmarks-doc.pdf) (maybe to be read together with the new LaTeX-Companion, I, pp. 390–395) provides an easy mechanism to achieve the desired outcome.
```
\documentclass{scrbook}
\usepackage{lipsum}
\usepackage{scrlayer-scrpage}
\addtokomafont{pagenumber}{\bfseries}
\NewMarkClass{oldpagemark}
\newcounter{oldpage}
\setcounter{oldpage}{1}
\ohead{\pagemark}
\ihead{\IfMarksEqualTF{oldpagemark}{top}{last}{(\TopMark{oldpagemark})}{(\TopMark{oldpagemark}--\LastMark{oldpagemark})}}
\ofoot{}
\pagestyle{scrheadings}
\newcommand{\markoldpage}{¦\stepcounter{oldpage}\InsertMark{oldpagemark}{\theoldpage}\marginpar{\centering\footnotesize\theoldpage}}
\begin{document}
\chapter{First chapter}
\lipsum[1-2] \markoldpage{}
\lipsum[1-10] \markoldpage{}
\lipsum[1-2] \markoldpage{}
\lipsum[1-4] \markoldpage{}
\chapter{Second chapter with new numbering} \setcounter{oldpage}{43}
\lipsum[1-2] \markoldpage{}
\lipsum[1-4] \markoldpage{}
\lipsum[1-2] \markoldpage{}
\lipsum[1-4] \markoldpage{}
\chapter{Third chapter with new numbering} \setcounter{oldpage}{25}
\lipsum[1-2] \markoldpage{}
\lipsum[1-4] \markoldpage{}
\lipsum[1-2] \markoldpage{}
\lipsum[1-4] \markoldpage{}
\end{document}
```
Some prose descriptions: Since 2022, `\NewMarkClass` provides a mark-mechanism that doesn’t run into problems like eTeX’s marks and primitive TeX’s mark-commands like `\topmark` when compiled with LaTeX.
The new corresponding commands `\TopMark`, `\LastMark` and `\InsertMark` enable LaTeX to grab the relevant page-numbering-information without interfering.
`\markoldpage` makes use of these features in combination with a counter (`oldpage`) which is simply marked at the correct location via `\InsertMark`.
`\IfMarksEqualTF` then uses a simple conditional also defined in [ltmarks](https://www.latex-project.org/help/documentation/ltmarks-doc.pdf) to print the correct information in the header. The bold numbers represent the page-numbers of the document, and the italic numbers in brackets represent the oldpage-numbers. The character signifying a page-break (»¦«) and the numbering of the old-page in the margin are also added.
Depending on the page range of the, lets say, »phantom-oldpage-numbering«, either a single digit number is written in the header if the range is one, e.g. here on output-page 2 ...
... or a page-range if it is larger than one, e.g. output page 10.
Previously, I ran into problems as soon as I changed the counter-value between chapters, but this seems to be fine, so far!
|
1
|
https://tex.stackexchange.com/users/134455
|
690272
| 320,207 |
https://tex.stackexchange.com/questions/690242
|
3
|
Using the recording with tcolorbox (page 147 of the package documentation), I separate proofs from theorems. The proofs of the theorems are in the lower part of the tcolorbcox and appear at the end of the chapter with `tcbstartrecording`, `tcbinputrecords` and so on. I also added hyperlink between proofs and theorems. This works fine (thanks to this forum, mostly). But now, I would also like to do the same thing with exercices and hints for the exercices.
Here is a MWE:
```
\documentclass[10pt,a4paper,french]{book}
\usepackage{mathtools}
\usepackage{babel}
\usepackage[warnings-off={mathtools-colon,mathtools-overbracket},math-style=french]{unicode-math}
\usepackage[scale={0.75,0.8},footskip=1.5cm,heightrounded]{geometry}
\usepackage[most]{tcolorbox}
\usepackage{hyperref}
\hypersetup{hidelinks}
\newtcbtheorem[number within=chapter]{prop}{Proposition}{% Proposition
enhanced,breakable,
fonttitle=\bfseries,separator sign dash,
lowerbox=ignored,
sharp corners,
hypertarget=prop@\thetcbcounter,hyperlink=demop@\thetcbcounter,
label={prop@\thetcbcounter},
savelowerto=demo-\thetcbcounter.tex,
record={\string\demop{\thetcbcounter}{demo-\thetcbcounter.tex}}
}
{Proposition}
\NewTotalTColorBox{\demop}{mm}{% Démonstration d'une proposition
enhanced,breakable,fonttitle=\bfseries,
sharp corners,
title=Démonstration de la proposition~\ref{prop@#1},
hypertarget=demop@#1,hyperlink=prop@#1
}
{\input{#2}}
\newtcbtheorem[number within=chapter]{exer}{Exercice}{% Exercice avec indication
enhanced,breakable,
fonttitle=\bfseries,separator sign dash,
lowerbox=ignored,
sharp corners,
hypertarget=exer@\thetcbcounter,hyperlink=indication@\thetcbcounter,
label={exer@\thetcbcounter},
savelowerto=indic-\thetcbcounter.tex,
record={\string\indication{\thetcbcounter}{indic-\thetcbcounter.tex}}
}
{Exercice}
\NewTotalTColorBox{\indication}{mm}{% Indication pour un exercice
enhanced,breakable,fonttitle=\bfseries,
sharp corners,
title=Indication pour l'exercice~\ref{exer@#1},
hypertarget=indication@#1,hyperlink=exer@#1
}
{\input{#2}}
\begin{document}
\tcbstartrecording\relax
\chapter{Premier}
\begin{prop}{}{}
Premier théorème
\tcblower
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ligula nisl, laoreet vitae nibh id, dictum finibus est. Sed sed sem ut ligula interdum euismod vel id dolor. Morbi auctor magna nec lectus consectetur rhoncus. Ut sapien mauris, sodales ac tortor at, vestibulum venenatis augue. Nulla fringilla, ante ut feugiat interdum, lectus tellus pulvinar sem, vel gravida nulla odio vitae lacus. Morbi sed quam in sem luctus pharetra. Etiam maximus eleifend nibh, eget bibendum nulla feugiat id. Curabitur eget mauris imperdiet, vulputate lectus in, dapibus mauris. Aliquam sit amet pharetra leo. Nam vehicula vitae nisl a faucibus. Etiam elit odio, finibus facilisis purus at, aliquam luctus purus. Aenean rhoncus, dolor quis lacinia eleifend, ipsum erat commodo quam, eget molestie lacus dolor et felis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ligula nisl, laoreet vitae nibh id, dictum finibus est. Sed sed sem ut ligula interdum euismod vel id dolor. Morbi auctor magna nec lectus consectetur rhoncus. Ut sapien mauris, sodales ac tortor at, vestibulum venenatis augue. Nulla fringilla, ante ut feugiat interdum, lectus tellus pulvinar sem, vel gravida nulla odio vitae lacus. Morbi sed quam in sem luctus pharetra. Etiam maximus eleifend nibh, eget bibendum nulla feugiat id. Curabitur eget mauris imperdiet, vulputate lectus in, dapibus mauris. Aliquam sit amet pharetra leo. Nam vehicula vitae nisl a faucibus. Etiam elit odio, finibus facilisis purus at, aliquam luctus purus. Aenean rhoncus, dolor quis lacinia eleifend, ipsum erat commodo quam, eget molestie lacus dolor et felis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ligula nisl, laoreet vitae nibh id, dictum finibus est. Sed sed sem ut ligula interdum euismod vel id dolor. Morbi auctor magna nec lectus consectetur rhoncus. Ut sapien mauris, sodales ac tortor at, vestibulum venenatis augue. Nulla fringilla, ante ut feugiat interdum, lectus tellus pulvinar sem, vel gravida nulla odio vitae lacus. Morbi sed quam in sem luctus pharetra. Etiam maximus eleifend nibh, eget bibendum nulla feugiat id. Curabitur eget mauris imperdiet, vulputate lectus in, dapibus mauris. Aliquam sit amet pharetra leo. Nam vehicula vitae nisl a faucibus. Etiam elit odio, finibus facilisis purus at, aliquam luctus purus. Aenean rhoncus, dolor quis lacinia eleifend, ipsum erat commodo quam, eget molestie lacus dolor et felis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ligula nisl, laoreet vitae nibh id, dictum finibus est. Sed sed sem ut ligula interdum euismod vel id dolor. Morbi auctor magna nec lectus consectetur rhoncus. Ut sapien mauris, sodales ac tortor at, vestibulum venenatis augue. Nulla fringilla, ante ut feugiat interdum, lectus tellus pulvinar sem, vel gravida nulla odio vitae lacus. Morbi sed quam in sem luctus pharetra. Etiam maximus eleifend nibh, eget bibendum nulla feugiat id. Curabitur eget mauris imperdiet, vulputate lectus in, dapibus mauris. Aliquam sit amet pharetra leo. Nam vehicula vitae nisl a faucibus. Etiam elit odio, finibus facilisis purus at, aliquam luctus purus. Aenean rhoncus, dolor quis lacinia eleifend, ipsum erat commodo quam, eget molestie lacus dolor et felis.
\end{prop}
\begin{exer}{}{}
Un premier exercice
\tcblower
Une indication
\end{exer}
\begin{prop}{}{}
Deuxième théorème
\tcblower
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ligula nisl, laoreet vitae nibh id, dictum finibus est. Sed sed sem ut ligula interdum euismod vel id dolor. Morbi auctor magna nec lectus consectetur rhoncus. Ut sapien mauris, sodales ac tortor at, vestibulum venenatis augue. Nulla fringilla, ante ut feugiat interdum, lectus tellus pulvinar sem, vel gravida nulla odio vitae lacus. Morbi sed quam in sem luctus pharetra. Etiam maximus eleifend nibh, eget bibendum nulla feugiat id. Curabitur eget mauris imperdiet, vulputate lectus in, dapibus mauris. Aliquam sit amet pharetra leo. Nam vehicula vitae nisl a faucibus. Etiam elit odio, finibus facilisis purus at, aliquam luctus purus. Aenean rhoncus, dolor quis lacinia eleifend, ipsum erat commodo quam, eget molestie lacus dolor et felis.
\end{prop}
\begin{exer}{}{}
Un deuxième exercice
\tcblower
Une indication
\end{exer}
\tcbstoprecording
\newpage
\begin{center}
{\Huge\bfseries Démonstrations}
\end{center}
\tcbinputrecords
\newpage
\begin{center}
{\Huge\bfseries Indications pour les exercices}
\end{center}
\end{document}
```
But of course, the proofs of theorems and hints for the exercises are mixed and I don't want that. I would like the proofs to be after "Démonstrations" page, and the hints to be after " Indications pour les exercices" page.
So, I guess I need two separate recording files that I could call in the correct page.
How could I do that (I don't even know if it's possible)
|
https://tex.stackexchange.com/users/249670
|
Recording two files with tcolorbox
| false |
Rather than using another file for writing (which draws on a limited resource), you can just skip the lines of the `.records` file you don't want.
```
\let\indicationsaved\indication
\def\indication#1#2{\relax}
\tcbinputrecords
```
This saves the meaning of `\indications` and then redefines it to do nothing, so hints recorded in the `.records` file will be skipped when `\tcbinputrecords` is called, leaving just the proofs.
```
\let\indication\indicationsaved
\def\demop#1#2{\relax}
\tcbinputrecords
```
This restores the original meaning of `\indications` and redefines `\demop` to do nothing, so proofs recorded in the `.records` file will be skipped, leaving just the hints.
Full MWE:
```
\documentclass[10pt,a4paper,french]{book}
\usepackage{babel}
\usepackage[scale={0.75,0.8},footskip=1.5cm,heightrounded]{geometry}
\usepackage[most]{tcolorbox}
\usepackage{hyperref}
\hypersetup{hidelinks}
\newtcbtheorem[number within=chapter]{prop}{Proposition}{% Proposition
enhanced,breakable,
fonttitle=\bfseries,separator sign dash,
lowerbox=ignored,
sharp corners,
hypertarget=prop@\thetcbcounter,hyperlink=demop@\thetcbcounter,
label={prop@\thetcbcounter},
savelowerto=demo-\thetcbcounter.tex,
record={\string\demop{\thetcbcounter}{demo-\thetcbcounter.tex}}
}
{Proposition}
\NewTotalTColorBox{\demop}{mm}{% Démonstration d'une proposition
enhanced,breakable,fonttitle=\bfseries,
sharp corners,
title=Démonstration de la proposition~\ref{prop@#1},
hypertarget=demop@#1,hyperlink=prop@#1
}
{\input{#2}}
\newtcbtheorem[number within=chapter]{exer}{Exercice}{% Exercice avec indication
enhanced,breakable,
fonttitle=\bfseries,separator sign dash,
lowerbox=ignored,
sharp corners,
hypertarget=exer@\thetcbcounter,hyperlink=indication@\thetcbcounter,
label={exer@\thetcbcounter},
savelowerto=indic-\thetcbcounter.tex,
record={\string\indication{\thetcbcounter}{indic-\thetcbcounter.tex}}
}
{Exercice}
\NewTotalTColorBox{\indication}{mm}{% Indication pour un exercice
enhanced,breakable,fonttitle=\bfseries,
sharp corners,
title=Indication pour l'exercice~\ref{exer@#1},
hypertarget=indication@#1,hyperlink=exer@#1
}
{\input{#2}}
\begin{document}
\tcbstartrecording\relax
\chapter{Premier}
\begin{prop}{}{}
Premier théorème
\tcblower
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ligula nisl, laoreet vitae nibh id, dictum finibus est. Sed sed sem ut ligula interdum euismod vel id dolor. Morbi auctor magna nec lectus consectetur rhoncus. Ut sapien mauris, sodales ac tortor at, vestibulum venenatis augue. Nulla fringilla, ante ut feugiat interdum, lectus tellus pulvinar sem, vel gravida nulla odio vitae lacus. Morbi sed quam in sem luctus pharetra. Etiam maximus eleifend nibh, eget bibendum nulla feugiat id. Curabitur eget mauris imperdiet, vulputate lectus in, dapibus mauris. Aliquam sit amet pharetra leo. Nam vehicula vitae nisl a faucibus. Etiam elit odio, finibus facilisis purus at, aliquam luctus purus. Aenean rhoncus, dolor quis lacinia eleifend, ipsum erat commodo quam, eget molestie lacus dolor et felis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ligula nisl, laoreet vitae nibh id, dictum finibus est. Sed sed sem ut ligula interdum euismod vel id dolor. Morbi auctor magna nec lectus consectetur rhoncus. Ut sapien mauris, sodales ac tortor at, vestibulum venenatis augue. Nulla fringilla, ante ut feugiat interdum, lectus tellus pulvinar sem, vel gravida nulla odio vitae lacus. Morbi sed quam in sem luctus pharetra. Etiam maximus eleifend nibh, eget bibendum nulla feugiat id. Curabitur eget mauris imperdiet, vulputate lectus in, dapibus mauris. Aliquam sit amet pharetra leo. Nam vehicula vitae nisl a faucibus. Etiam elit odio, finibus facilisis purus at, aliquam luctus purus. Aenean rhoncus, dolor quis lacinia eleifend, ipsum erat commodo quam, eget molestie lacus dolor et felis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ligula nisl, laoreet vitae nibh id, dictum finibus est. Sed sed sem ut ligula interdum euismod vel id dolor. Morbi auctor magna nec lectus consectetur rhoncus. Ut sapien mauris, sodales ac tortor at, vestibulum venenatis augue. Nulla fringilla, ante ut feugiat interdum, lectus tellus pulvinar sem, vel gravida nulla odio vitae lacus. Morbi sed quam in sem luctus pharetra. Etiam maximus eleifend nibh, eget bibendum nulla feugiat id. Curabitur eget mauris imperdiet, vulputate lectus in, dapibus mauris. Aliquam sit amet pharetra leo. Nam vehicula vitae nisl a faucibus. Etiam elit odio, finibus facilisis purus at, aliquam luctus purus. Aenean rhoncus, dolor quis lacinia eleifend, ipsum erat commodo quam, eget molestie lacus dolor et felis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ligula nisl, laoreet vitae nibh id, dictum finibus est. Sed sed sem ut ligula interdum euismod vel id dolor. Morbi auctor magna nec lectus consectetur rhoncus. Ut sapien mauris, sodales ac tortor at, vestibulum venenatis augue. Nulla fringilla, ante ut feugiat interdum, lectus tellus pulvinar sem, vel gravida nulla odio vitae lacus. Morbi sed quam in sem luctus pharetra. Etiam maximus eleifend nibh, eget bibendum nulla feugiat id. Curabitur eget mauris imperdiet, vulputate lectus in, dapibus mauris. Aliquam sit amet pharetra leo. Nam vehicula vitae nisl a faucibus. Etiam elit odio, finibus facilisis purus at, aliquam luctus purus. Aenean rhoncus, dolor quis lacinia eleifend, ipsum erat commodo quam, eget molestie lacus dolor et felis.
\end{prop}
\begin{exer}{}{}
Un premier exercice
\tcblower
Une indication
\end{exer}
\begin{prop}{}{}
Deuxième théorème
\tcblower
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ligula nisl, laoreet vitae nibh id, dictum finibus est. Sed sed sem ut ligula interdum euismod vel id dolor. Morbi auctor magna nec lectus consectetur rhoncus. Ut sapien mauris, sodales ac tortor at, vestibulum venenatis augue. Nulla fringilla, ante ut feugiat interdum, lectus tellus pulvinar sem, vel gravida nulla odio vitae lacus. Morbi sed quam in sem luctus pharetra. Etiam maximus eleifend nibh, eget bibendum nulla feugiat id. Curabitur eget mauris imperdiet, vulputate lectus in, dapibus mauris. Aliquam sit amet pharetra leo. Nam vehicula vitae nisl a faucibus. Etiam elit odio, finibus facilisis purus at, aliquam luctus purus. Aenean rhoncus, dolor quis lacinia eleifend, ipsum erat commodo quam, eget molestie lacus dolor et felis.
\end{prop}
\begin{exer}{}{}
Un deuxième exercice
\tcblower
Une indication
\end{exer}
\tcbstoprecording
\newpage
\begin{center}
{\Huge\bfseries Démonstrations}
\end{center}
\let\indicationsaved\indication
\def\indication#1#2{\relax}
\tcbinputrecords
\newpage
\begin{center}
{\Huge\bfseries Indications pour les exercices}
\end{center}
\let\indication\indicationsaved
\def\demop#1#2{\relax}
\tcbinputrecords
\end{document}
```
|
3
|
https://tex.stackexchange.com/users/39222
|
690275
| 320,208 |
https://tex.stackexchange.com/questions/690274
|
3
|
Enumitem provides a nice syntax `\begin{enumerate}[label=\alph*]`, where `*` is replaced by the appropriate counter. I want to understand how this works (or, rather, how I can do something similar). I played around with the solution from [here](https://tex.stackexchange.com/a/377631/27717) and now have:
```
\documentclass{article}
\makeatletter
\newtoks\S
\let\ea\expandafter
\newcommand{\FormatCounter}[2]{%
\def\replaceStar##1{%
\def\@replaceStar####1*{####1{#1}}%
\ea\S\ea{\@replaceStar##1\Ignore*\relax}%
}%
\def\Ignore##1\relax{}%
\replaceStar{#2}%
\showthe\S%
\the\S%
}
\begin{document}
\textit{asdf \FormatCounter{page}{(\alph*)} asdf}
\textit{asdf \FormatCounter{page}{\textup{(\alph*)}} asdf}
\end{document}
```
The first replacement works, the second does not, because the replacement does not reach the star inside the group. How can I solve this?
Apparently, using
```
\ea\replaceStar\ea{\detokenize{#2}}%
```
runs without error and does the correct replacement, but then I have no idea how to undo the `\detokenize`
|
https://tex.stackexchange.com/users/27717
|
Replacing the star as in enumitem
| true |
Rather than replacing `*` just make it locally be the right counter.
```
\documentclass{article}
\newcommand{\FormatCounter}[2]{{%
\ExpandArgs{cc}\let{c@*}{c@#1}%
#2%
}}
\begin{document}
\textit{asdf \FormatCounter{page}{(\alph*)} asdf}
\textit{asdf \FormatCounter{page}{\textup{(\alph*)}} asdf}
\end{document}
```
|
6
|
https://tex.stackexchange.com/users/1090
|
690276
| 320,209 |
https://tex.stackexchange.com/questions/690258
|
-2
|
I'm pratically using the multicol-environment with 2 columns and trying to insert a table in-between in a one-page layout (meaning using up the full-page width) and then after start using the multicol-environment again without any page breaks. Is that possible? Would be nice if someone could create a code example :)
|
https://tex.stackexchange.com/users/300124
|
Adding graphics in-between a multicol-environment
| false |
Like this:
Code:
```
\documentclass[letter]{report}
\usepackage{multicol}
\usepackage{lipsum,graphicx}
\begin{document}
\lipsum[2]
\begin{multicols}{2}
\lipsum[3]
\end{multicols}
\begin{center}
\includegraphics[width=7cm]{example-image-a}\\
Caption figure with long text and more text for description
\end{center}
\begin{multicols}{2}
\lipsum[1-3]
You can have also a small figure in one column, whith a short caption.
\begin{center}
\includegraphics[width=4cm]{example-image-b}\\
Short caption
\end{center}
\lipsum[1][1-3]
\end{multicols}
\lipsum[5]
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/24644
|
690277
| 320,210 |
https://tex.stackexchange.com/questions/690191
|
2
|
I am writing lecture notes where the title page numbering is set to `gobble`, the toc pages are in `roman` and the lectures pages are in `arabic`.
The problem is specifically on the 1st lecture page. I have a citation on the page. But its bib item on the bibliography section is back-referencing to the title page. The other citations that are not on the 1st page are not having this issue.
Here's the MWE of my lecture notes:
```
\documentclass[a4paper]{report}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \input{setup/preamble}
% basics
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{url}
\usepackage{hyperref}
\hypersetup{
colorlinks,
linkcolor={black},
citecolor={black},
urlcolor={blue!80!black},
% backref=true,
% pagebackref=true
}
% Page Margins
\usepackage[
margin=2.8cm,
% top=2.8cm, bottom=2.8cm,
% left=1in, right=1in,
% headheight=14.5pt
]{geometry}
% \usepackage{graphicx}
% \usepackage{float}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{lipsum}
% bibliography
\usepackage[
backend=biber,
backref=true,
style=numeric,
sortcites=true,
sorting=none,
defernumbers=true
]{biblatex} % bibliography % https://www.overleaf.com/learn/latex/bibliography_management_with_biblatex
\usepackage{xurl} % handling the urls in bib file and it should be loaded after loading biblatex
%% Change formatting of back references % https://tex.stackexchange.com/a/606518/114006
\DefineBibliographyStrings{english}{
backrefpage={p.},
% backrefpage={},
backrefpages={pp.}
% backrefpages={
}
\renewcommand*{\finentrypunct}{}
\usepackage{xpatch}
% \DeclareFieldFormat{backrefparens}{\mkbibparens{#1\addperiod}}
\DeclareFieldFormat{backrefparens}{\raisebox{-4pt}{\scriptsize{\mkbibparens{#1}}}}
\xpatchbibmacro{pageref}{parens}{backrefparens}{}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{filecontents}{ref.bib}
@book{arnold2013mathematical,
title = {Mathematical {{Methods}} of {{Classical Mechanics}}},
author = {Arnold, Vladimir I},
date = {2013},
series = {Graduate {{Texts}} in {{Mathematics}}},
volume = {60},
publisher = {{Springer Science \& Business Media}}
}
@article{yang1954conservation,
title = {Conservation of {{Isotopic Spin}} and {{Isotopic Gauge Invariance}}},
author = {Yang, Chen N and Mills, Robert L},
date = {1954-10-01},
journaltitle = {Physical Review},
shortjournal = {Phys. Rev.},
volume = {96},
number = {1},
pages = {191--195},
doi = {10.1103/PhysRev.96.191}
}
\end{filecontents}
\addbibresource{ref.bib}
\title{Lecture Notes}
\author{me}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\maketitle
\pagenumbering{gobble}
% \input{preface}
\newpage
\pagenumbering{roman}
\pdfbookmark{\contentsname}{toc}
\setcounter{tocdepth}{0}
\tableofcontents
\newpage
\pagenumbering{arabic}
% start lectures
\chapter{Sat, Mar 18, 2023}
\lipsum[1] \cite{arnold2013mathematical}
\lipsum \cite{yang1954conservation}
% \intput{endpage}
% Bibliography
\printbibheading[heading=bibintoc, title={\protect\numberline{}Recommended Resources}] % https://tex.stackexchange.com/a/222961/114006
\printbibliography[type=book,heading=subbibliography,title={Books}] % https://www.overleaf.com/learn/latex/Articles/Getting_started_with_BibLaTeX
\printbibliography[nottype=book,heading=subbibliography,title={Others}]
\end{document}
```
|
https://tex.stackexchange.com/users/114006
|
Correcting the back referencing from bibliography
| true |
This is probably a hack (and Ulrike will scold me for that ) but if you remove the `\pagenumbering{gobble}` and add, before `\maketitle`:
```
\pagenumbering{roman}
\setcounter{page}{-1}\thispagestyle{empty}
\maketile
[...]
```
(and obviously remove the other `\pagenumbering{roman}` below) the backlink of the bibliography seems to work.
I didn't try your full example (this one is already on the big side for an MWE...), but probably the only trick is to find the correct negative number to start with...
The other option, as suggested by [Ulrike in a comment](https://tex.stackexchange.com/questions/690191/correcting-the-back-referencing-from-bibliography/690282?noredirect=1#comment1712951_690282), is to change the "name" of the page; something on the line of changing the title part like that:
```
% make a full copy of the current \thepage
\NewCommandCopy{\savethepage}{\thepage}
\pagenumbering{gobble}
\renewcommand{\thepage}{Title-Preface-\arabic{page}}
\maketitle
% \input{preface}
\newpage
% reset back the page name
\RenewCommandCopy{\thepage}{\savethepage}
\pagenumbering{roman}
```
...so you should have different anchor names even if there are more than one title-preface unnumbered pages.
Using the full expl3 copies is probably too much, and a `\let` should suffice in this case. But you never know if `\thepage` will change in the future...
Or even easier, as suggested again by Ulrike (thanks!)
```
\pagenumbering{gobble}
% this is reset back by \pagenumbering
\gdef\thepage{Title-Preface-\arabic{page}}
\maketitle
% \input{preface}
\newpage
% \pagestyle{plain}
\pagenumbering{roman}
```
|
2
|
https://tex.stackexchange.com/users/38080
|
690282
| 320,213 |
https://tex.stackexchange.com/questions/690280
|
1
|
After playing around with `tex4ebook`, I've noticed that italic and bold in footnotes don't work correctly if `fontspec` package is loaded. It applies the bold/italic, but the text is no longer footnote size, and is instead larger than the rest of the footnote text. If `fontspec` is not loaded, then the italic and bold text in the footnotes are sized correctly. I'm using lualatex. MWE:
```
\documentclass{scrbook}
\usepackage{fontspec}
\begin{document}
Some text here. \footnote{This footnote is \textit{italic} and \textbf{bold}}.
\end{document}
```
With a simple config file:
```
\Preamble{xhtml,svg,no-cut}
\begin{document}
\EndPreamble
```
Does anyone have any ideas to get around this? Ultimately, I want to embed a latin script font into my ebook, but the ebook has some small bits of text from other alphabets, which, for my standard tex pdf, I have used new fontspec families to print. For tex4ebook I think the recommended solution for multilingual ebooks is fontspec (<https://www.kodymirus.cz/tex4ht-doc/Configurations.html#unicode>), but I have the above fontspec problem, so I need to solve one of these problems.
As an aside, I am not sure how embedding a font that doesn't cover all unicode letters used (i.e. my book is multilingual) will work in tex4ebook in Lualatex, if anyone has any advice on that too.
Thanks very much!
|
https://tex.stackexchange.com/users/297210
|
Fontspec interfering with footnote sizing in tex4ebook
| true |
The problem here is that with Fontspec, TeX4ht produces standard HTML tags `<i>` and `<strong>` for `\textit` and `\textbf`, instead of the default markup which looks like `<span class="ec-lmr-9">`. It is OK in most cases, but not when it is surrounded by smaller fonts, which use this formatting, as in the HTML code for footnotes:
```
<div class='footnote-text'>
<!-- l. 4 --><p class='indent'>
<span class='footnote-mark'><a id='fn1x0'><a id='x2-3x'></a><sup class='textsuperscript'>1 </sup></a></span>
<span class='ec-lmr-9'>This footnote is </span><i>italic</i> <span class='ec-lmr-9'>and </span><strong>bold</strong></p></div>
```
In this case, you need to use CSS and declare `<strong>` and `<i>` tags which are inside `footnote-text` to have the same size as `<span class='ec-lmr-9'>`.
It can be done using this configuration file:
```
\Preamble{xhtml,svg,no-cut}
\Css{.footnote-text strong {font-size: 81\%}}
\Css{.footnote-text i {font-size: 81\%}}
\begin{document}
\EndPreamble
```
This is the result:
|
1
|
https://tex.stackexchange.com/users/2891
|
690285
| 320,215 |
https://tex.stackexchange.com/questions/689291
|
0
|
I haven't been able to look up an answer for this.
The idea is to use the acronym with the greek letter alpha or gamma for example, while using the regular unicode greek character in the text.
The issue with acronym is that putting the unicode character in the acronym will not make it appear in the acronym section but only in the text.
Currently my solution makes it appear as a math alpha in the text :
I'm using Quarto with pdf output, thus using latex :
```
---
title: "quarto-test-env"
format: pdf
header-includes:
- \usepackage{acronym}
- \usepackage{upgreek}
keep-tex: true
mainfont: "Times New Roman"
---
# Acronyms
\begin{acronym}
\acro{ifng}[IFN-$\mupgamma$]{interferon gamma}
\acro{tnfa}[TNF-$\mupalpha$]{tumor necrosis factor alpha}
\acro{nfkb}[NF-κB]{nuclear factor-kappa B}
\end{acronym}
# Regular text
- \ac{tnfa}
- \ac{ifng}
I want TNF-α and not \ac{tnfa} ; IFN-γ and not \ac{ifng}.
When I use unicode characters in acronym such as \ac{nfkb}, it doesn't display in the acronym but in the regular text only.
```
I want to make it appear using unicode characters like : TNF-α ; IFN-γ
I'm using Times News Roman as the font.
Is there a solution for that or do I have to scrap the idea ?
Thanks for the help.
|
https://tex.stackexchange.com/users/284278
|
How to use acronym package to use greek letterswhile using unicode greek letters in regular text
| true |
I can't reproduce your issue with characters appearing in text but not the list or vice versa (either from the supplied [gist](https://gist.github.com/Minh-AnhHuynh/4d67c2d07336399993cb639c594bb43e) or minimal code) and can't imagine why this might happen. My guess would be there's either something you're not showing or Quarto/pandoc are responsible.
As far as getting upright Greek characters to work with `acronym` (at least when supplying the optional short form argument) goes, there's nothing special about the use of `acronym`, it's the same problem as with general text (see e.g. [Upright Greek letters in text mode (not upgreek)](https://tex.stackexchange.com/q/9219/106162), [Upright Lowercase $\pi$](https://tex.stackexchange.com/q/54166/106162), [How to easily use UTF-8 with LaTeX?](https://tex.stackexchange.com/q/172421/106162), [Upright Greek font fitting to Computer Modern](https://tex.stackexchange.com/q/145926/106162))).
With `pdflatex` one example would be
```
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{acronym}
\usepackage{upgreek}
\DeclareUnicodeCharacter{03B3}{$\upgamma$}
\begin{document}
\begin{acronym}
\acro{ifng}[IFN-γ]{interféron gamma}
\acro{tnfa}[TNF-$\upalpha$]{tumor necrosis factor alpha}
\end{acronym}
\ac{tnfa}
\ac{ifng}
\end{document}
```
>
> **IFN-γ** interféron gamma
>
>
> **TNF-α** tumor necrosis factor alpha
>
>
> tumor necrosis factor alpha (TNF-α) interféron gamma (IFN-γ)
>
>
>
or with `lualatex` with a suitable font
```
\documentclass{article}
\usepackage{libertine}
\usepackage{acronym}
\begin{document}
\begin{acronym}
\acro{ifng}[IFN-γ]{interféron gamma}
\acro{tnfa}[TNF-α]{tumor necrosis factor alpha}
\end{acronym}
\ac{tnfa}
\ac{ifng}
\end{document}
```
>
> **IFN-γ** interféron gamma
>
>
> **TNF-α** tumor necrosis factor alpha
>
>
> tumor necrosis factor alpha (TNF-α) interféron gamma (IFN-γ)
>
>
>
In all these cases, the alpha and gamma characters copy over as the `U+03B1` and `U+03B3` characters.
|
0
|
https://tex.stackexchange.com/users/106162
|
690289
| 320,217 |
https://tex.stackexchange.com/questions/690204
|
0
|
In the scrbook class, my running headers are too high. I've looked at page 44 of the manual ("Calculating the Page Layout with typearea") but while this addresses two line headers, it does not explain how to drop headers that are too high. This is the class option I am using:
```
\documentclass[fontsize=11.5pt,paper=6in:9in,BCOR=7.5mm,headlines=1.25]{scrbook}
```
MWE:
```
\documentclass[fontsize=11.5pt,paper=6in:9in,BCOR=7.5mm,headlines=2]{scrbook}
\usepackage[%
left=.375mm,
right=.375mm,
top=.375mm,
bottom=.375mm,
]{geometry}
\KOMAoptions{DIV=calc}
\recalctypearea
\usepackage[automark]{scrlayer-scrpage}
\pagestyle{headings}
\automark[section]{chapter}
\usepackage{blindtext}
\begin{document}
\chapter{Chapter 1}
\blindtext[3]
\section{Section 1}
\blindtext[3]
\section{Section 2}
\blindtext[3]
\end{document}
```
|
https://tex.stackexchange.com/users/26732
|
Lower Running Headers in Koma Classes
| false |
Inserting this code drops the running headers as required:
```
\pagestyle{scrheadings}
\clearpairofpagestyles
\renewcommand*{\chaptermarkformat}{}
\ohead{\vspace*{-1.5cm}\headmark}
\cfoot*{\pagemark}
```
The key line is the `\ohead` command. If you omit the last line you lose page numbers.
|
0
|
https://tex.stackexchange.com/users/26732
|
690301
| 320,223 |
https://tex.stackexchange.com/questions/496941
|
4
|
I am writing the abstract for my master thesis and I used this code in order to get three abstracts with three different languages - french, english, and arabic - on the same page. The code works perfectly, but there is one problem: I want to write some english words in the arabic paragraph, but I can't find a way, that works with this code. I am really in a hurry and need a solution for my problem, since I am graduating very soon.
```
\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[arabic,francais,english]{babel}
\usepackage{ragged2e}
\newcommand{\ab}{\selectlanguage{arabic}}
\newcommand{\fr}{\selectlanguage{french}}
\newcommand{\en}{\selectlanguage{english}}
\usepackage{fancyhdr}
\fancypagestyle{plain}{
\fancyhead{}
\renewcommand{\headrulewidth}{0pt}
\cfoot{\thepage} }
\pagenumbering{roman}
\begin{document}
\setcounter{page}{4}
\chapter*{ABSTRACT}
\thispagestyle{empty}
\ab
\section*{ملخص}
لكتابة العربية هو نظام الكتابة المستخدم في كتابة اللغة العربية، وفي
كتابة لغات أخرى في آسيا وإفريقيا كذلك، مثل اللغات الأذرية والسندية
والبشتوية والفارسية والبنجابية والكردية واللرية والأردية والمندنكوية
وغيرها
\newline \newline
\textbf{الكلمات الرئيسية : } العربية
\fr
\en
\section*{Abstract}
Anyone who reads Old and Middle English literary texts will be familiar
with the mid-brown volumes of the EETS, with the symbol of Alfred's jewel
embossed on the front cover. Most of the works attributed to King Alfred or
to Aelfric, along with some of those by bishop Wulfstan and much
anonymous
prose and verse from the pre-Conquest period, are to be found within the
Society's three series; all of the surviving medieval drama, most of the
Middle English romances, much religious and secular prose and verse
including the English works of John Gower, Thomas Hoccleve and most of
Caxton's prints all find their place in the publications. Without EETS
editions, study of medieval English texts would hardly be possible.
\newline \newline
\textbf{\textit{Keywords} : }English, text
\section*{Résumé}
La vie en France est très différente de celle au Canada. Ici, il fait
toujours chaud. Chaque dimanche, nous allons à la magnifique plage de
Biarritz et nous achetons des glaces après avoir nagé dans la mer.
Les Français sont très sympathiques et accueillants. Nous parlons
français lorsque nous sommes dehors, à l'école ou au marché. Cependant,
nous continuons de parler canadien à la maison, car mes parents ne
veulent pas que je perde ma langue natale.
\newline \newline
\textbf{Mots clés :
}vie, France.
\thispagestyle{empty}
\end{document}
```
|
https://tex.stackexchange.com/users/135310
|
How to write in english in an arabic text?
| false |
I usually simply include the bidi package and then just use the \LR{some latin text} for short pieces of text and \begin{latin} for longer left-to-right text.
|
0
|
https://tex.stackexchange.com/users/282431
|
690306
| 320,225 |
https://tex.stackexchange.com/questions/490235
|
8
|
I have drawn a square as shown below. However, I need to draw a quarter-circle inside the square such that the radius of the quarter-circle is 1 and it the center is drawn in the bottom left. Please keep code minimal, I am a beginner.
```
\coordinate[label=below:$A$] (A) at (0,0);
\coordinate[label=:$B$] (B) at (0,1);
\coordinate[label=:$C$] (C) at (1,1);
\coordinate[label=below:$D$] (D) at (1,0);
\draw[] (0,0)--(0,1)--(1,1)--(1,0)--(0,0);
```
|
https://tex.stackexchange.com/users/178855
|
Drawing Quarter-Circle
| false |
Another solution to the problem would be adding:
```
\draw[-] (1, 0) arc (0:90:1);
```
this will draw an arc from a circle of radius 1 from (1,0) to (0,1)
|
1
|
https://tex.stackexchange.com/users/300150
|
690310
| 320,226 |
https://tex.stackexchange.com/questions/690309
|
2
|
I copied the following BibTeX from MathSciNet
```
@incollection {MR2408155,
AUTHOR = {Noohi, Behrang},
TITLE = {Lectures on derived and triangulated categories},
BOOKTITLE = {An invitation to noncommutative geometry},
PAGES = {383--418},
PUBLISHER = {World Sci. Publ., Hackensack, NJ},
YEAR = {2008},
MRCLASS = {18E30 (18E10)},
MRNUMBER = {2408155},
MRREVIEWER = {Friedrich W. Bauer},
DOI = {10.1142/9789812814333_0006},
URL = {https://doi.org/10.1142/9789812814333_0006},}
```
This is giving the following output in the pdf
Behrang Noohi. Lectures on derived and triangulated categories. **In An** invitation to noncommutative
geometry, pages 383–418. World Sci. Publ., Hackensack, NJ, 2008.
I want to get
Behrang Noohi. Lectures on derived and triangulated categories. **In : An** invitation to noncommutative
geometry, pages 383–418. World Sci. Publ., Hackensack, NJ, 2008.
I have tried to insert semicolon in "BOOKTITLE", but, it is not looking nice.
Is there a standard bibtex format to cite apart from what I copied from Mathscinet which would give "In : An" as outcome.
|
https://tex.stackexchange.com/users/165931
|
output of citing "incollection"
| true |
For entries of type `@incollection`, it is common practice -- though, presumably, not an absolute requirement -- to mention the editor(s) of the collection of papers. Unfortunately, the bib entry you obtained from MathSciNet is missing the field
```
editor = {Masoud Khalkhali and Matilde Marcolli},
```
If you backfill this piece of information, and if you employ a bibliography style such as `plainnat`, you'd get the following output:
Observe that once you provide the `editor` field, there's no real need to append a colon after the word "In".
Moral of the story? Don't blindly trust the information obtained from online sources.
```
\documentclass{article} % or some other suitable document class
% create a bib file "on the fly":
\begin{filecontents}[overwrite]{mybib.bib}
@incollection{MR2408155,
AUTHOR = {Noohi, Behrang},
TITLE = {Lectures on derived and triangulated categories},
editor = {Masoud Khalkhali and Matilde Marcolli},
BOOKTITLE = {An Invitation to Noncommutative Geometry},
PAGES = {383--418},
PUBLISHER = {World Sci.\ Publ.},
address = {Hackensack NJ},
YEAR = {2008},
MRCLASS = {18E30 (18E10)},
MRNUMBER = {2408155},
MRREVIEWER= {Friedrich W. Bauer},
xDOI = {10.1142/9789812814333_0006},
URL = {https://doi.org/10.1142/9789812814333_0006},
isbn = {978-9812706164},
}
\end{filecontents}
%% Aside: There's no real need to provide both 'url' and 'doi' fields.
%% However, providing the 'isbn' field would be a nice touch.
\usepackage[numbers,square]{natbib}
\bibliographystyle{plainnat} % or some other suitable bibliography style
\usepackage{xurl} % for handling long URL strings
\usepackage[colorlinks,allcolors=blue]{hyperref} % optional
\begin{document}
\nocite{*}
\bibliography{mybib}
\end{document}
```
---
*Addendum* to address a point raised by the OP in a follow-up comment. How to change the prefix particle from "In" to "In:" depends mainly on the bibliography style that's in use. The OP hasn't indicated which bibliography style is in use. Should it be the `plainnat` style, I suggest the OP proceed as follows:
* Locate the file `plainnat.bst` in your TeX distribution. Make a copy of this file and call the file, say, `plainnat_in_colon.bst`.
* Open the file `plainnat_in_colon.bst` in an editor. The program you use to edit your tex files will do fine.
* Replace all eight [8!] instances of `"In` with `"In:` .
* Save the bst file in the directory that contains your main tex file.
* In the main tex file, change the instruction `\bibliographystyle{plainnat}` to `\bibliographystyle{plainnat_in_colon}` and perform a full recompile cycle: LaTeX, BibTeX, and LaTeX twice more.
Happy BibTeXing.
|
3
|
https://tex.stackexchange.com/users/5001
|
690312
| 320,227 |
https://tex.stackexchange.com/questions/409796
|
10
|
When using the `todonotes` package with the IEEEtran template, I seem to reach a limit after putting 50 `\todo{}` on one page.
When compiling the document, I get the following error:
```
Output loop---100 consecutive dead cycles.
```
I could solve it by inserting `\maxdeadcycles=200` in the preamble.
However, I would like to understand where this error comes from, and if there is be a more elegant technique to solve this problem.
|
https://tex.stackexchange.com/users/152345
|
todonotes: Output loop---100 consecutive dead cycles after 50 \todo{} on a page
| false |
A simple solution is to manually add a pagebreak at the point where this error occurs. Simply adding `\newpage` solved this problem for me.
|
1
|
https://tex.stackexchange.com/users/39623
|
690323
| 320,231 |
https://tex.stackexchange.com/questions/690298
|
0
|
How can I write a conditional statement to increase the value of `\footskip` on all pages that include a footnote?
I have tried reading the answers to similar questions (*e.g.* [How to form "if ... or ... then" conditionals in TeX?](https://tex.stackexchange.com/questions/29905/how-to-form-if-or-then-conditionals-in-tex)) but I am having trouble understanding them --- they seem to presume far more prior knowledge than I have.
|
https://tex.stackexchange.com/users/277990
|
Conditional statement to increase \footskip on certain pages
| false |
You can only do this test in the output routine where `\footins` is visible with the footnotes, and where `\footskip` is used. Here I add it to `\@makecol`
note the page foot moves on pages 2 and 4 that have footnotes
```
\documentclass[a5paper]{article}
\def\qa{One two three four five \stepcounter{enumi}\roman{enumi} six seven eight. }
\def\qb{\qa\qa Red green blue yellow white black. \qa}
\def\qc{\qb\qa\qb\qb\qa\qb\qa\qb\qb\qa}
\makeatletter
\let\old@makecol\@makecol
\def\@makecol{%
\ifvoid\footins\else
\footskip=60pt % normally 30pt
\fi
\typeout{Page: \thepage, \footskip=\the\footskip}%
\old@makecol}
\def\@oddfoot{\hrulefill\thepage\hrulefill}
\makeatother
\usepackage{geometry}
\begin{document}
\qc
\qc\qa\qa\qa
!!!\footnote{here}
\qc\qc\qc\qc\qc
\qb\qb\footnote{and here}\qc\qa\qa\qa
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/1090
|
690331
| 320,233 |
https://tex.stackexchange.com/questions/690330
|
3
|
I am trying to work with `\scantokens`, but apparently, I don't really understand it. I want to detokenize some sequence into a register `\S`:
```
\let\ea\expandafter
\newtoks\S
\ea\S\ea{\detokenize{\textbf{f}}}
```
manipulate it (omitted), and retokenize. My first attempt
```
\ea\def\ea\T\ea{\ea\scantokens\ea{\the\S}}
```
yields `\T=macro: \scantokens {\textbf {f}}.`. That's not wrong, but probably we can get the `\scantokens` out of `\T`. I thought, expanding once more should do it, but apparently not. So far, also what's written [here](https://tex.stackexchange.com/questions/9826/how-to-do-scantokens-inside-edef-without-triggering-runaway-definition) about `\everyeof{\noexpand}` does not help me:
```
\documentclass{article}
\let\ea\expandafter
\newtoks\S
\ea\S\ea{\detokenize{\textbf{f}}}
\ea\def\ea\T\ea{\ea\scantokens\ea{\the\S}}%
\show\T %\T=macro: \scantokens {\textbf {f}}.
%Runaway definition?
%->\textbf {f}
% ! File ended while scanning definition of \R.
\ea\ea\ea\def\ea\ea\ea\R\ea\ea\ea{\T}
%Runaway definition?
%->\textbf {f} \noexpand
%! File ended while scanning definition of \R.
\everyeof{\noexpand}%
\ea\ea\ea\def\ea\ea\ea\R\ea\ea\ea{\T}
\show\R
\everyeof{}
\begin{document}
\R
\end{document}
```
|
https://tex.stackexchange.com/users/27717
|
Understanding scantokens
| false |
The `\noexpand` approach needs an `\edef` - `\scantokens` is 'tricky' (basically buggy). So something like:
```
\everyeof{\noexpand}%
\edef\T{\noexpand\scantokens{\noexpand\unexpanded{\detokenize{\textbf{f}}}}}
\edef\R{\T}
\show\R
\everyeof{}
\documentclass{article}
\begin{document}
\R
\end{document}
```
As you might have non-expandable content inside the rescanned tokens, I've wrapped them all in `\unexpanded`.
(I've somewhat shortened the setup to make it in my opinion clearer).
|
3
|
https://tex.stackexchange.com/users/73
|
690334
| 320,234 |
https://tex.stackexchange.com/questions/690330
|
3
|
I am trying to work with `\scantokens`, but apparently, I don't really understand it. I want to detokenize some sequence into a register `\S`:
```
\let\ea\expandafter
\newtoks\S
\ea\S\ea{\detokenize{\textbf{f}}}
```
manipulate it (omitted), and retokenize. My first attempt
```
\ea\def\ea\T\ea{\ea\scantokens\ea{\the\S}}
```
yields `\T=macro: \scantokens {\textbf {f}}.`. That's not wrong, but probably we can get the `\scantokens` out of `\T`. I thought, expanding once more should do it, but apparently not. So far, also what's written [here](https://tex.stackexchange.com/questions/9826/how-to-do-scantokens-inside-edef-without-triggering-runaway-definition) about `\everyeof{\noexpand}` does not help me:
```
\documentclass{article}
\let\ea\expandafter
\newtoks\S
\ea\S\ea{\detokenize{\textbf{f}}}
\ea\def\ea\T\ea{\ea\scantokens\ea{\the\S}}%
\show\T %\T=macro: \scantokens {\textbf {f}}.
%Runaway definition?
%->\textbf {f}
% ! File ended while scanning definition of \R.
\ea\ea\ea\def\ea\ea\ea\R\ea\ea\ea{\T}
%Runaway definition?
%->\textbf {f} \noexpand
%! File ended while scanning definition of \R.
\everyeof{\noexpand}%
\ea\ea\ea\def\ea\ea\ea\R\ea\ea\ea{\T}
\show\R
\everyeof{}
\begin{document}
\R
\end{document}
```
|
https://tex.stackexchange.com/users/27717
|
Understanding scantokens
| true |
I'd do the scantokens on the outside rather than inside the def:
```
\documentclass{article}
\let\ea\expandafter
\newtoks\S
\S\ea{\detokenize{\textbf{f}}}
\scantokens\ea{\ea\def\ea\T\ea{\the\S}}%
\show\T %\T=macro: \textbf {f}.
\begin{document}
f \T
\end{document}
```
|
4
|
https://tex.stackexchange.com/users/1090
|
690335
| 320,235 |
https://tex.stackexchange.com/questions/690329
|
3
|
With Latin modern font, the symbol \setminus is invisible (I discovered, by chance, that it had gone from all my documents).
Here is a MWE:
```
\documentclass[10pt,a4paper,french]{article}
\usepackage{mathtools}
\usepackage{babel}
\usepackage[warnings-off={mathtools-colon,mathtools-overbracket},math-style=french]{unicode-math}
\usepackage[scale={0.75,0.8},footskip=1.5cm,heightrounded]{geometry}
\newfontface{\STIXTWO}{STIX Two Math}
\RenewDocumentCommand{\setminus}{}{\mbox{\STIXTWO\symbol{"029F5}}}
\begin{document}
$A\setminus B$
\end{document}
```
So I tried `\newfontface` with StiX Two (thanks to an answer that egreg had given me for an another symbol problem) but it doesn't work.
What should I do?
|
https://tex.stackexchange.com/users/249670
|
\setminus invisible
| false |
You might do it that way, but you get a symbol whose shape is not compatible with Latin Modern. An improved version would be
```
\documentclass[10pt,a4paper,french]{article}
\usepackage{mathtools}
\usepackage{babel}
\usepackage[warnings-off={mathtools-colon,mathtools-overbracket},math-style=french]{unicode-math}
\usepackage[scale={0.75,0.8},footskip=1.5cm,heightrounded]{geometry}
\newfontface{\STIXTWO}{STIX Two Math}
\AtBeginDocument{%
\RenewDocumentCommand{\setminus}{}{\mathbin{\text{\STIXTWO\symbol{"029F5}}}}%
}
\begin{document}
$A\setminus B$
$x_{A\setminus B}$
\end{document}
```
But a better solution for Latin Modern (and other fonts that miss the character) would be as follows.
```
\documentclass[10pt,a4paper,french]{article}
\usepackage{mathtools}
\usepackage{babel}
\usepackage[warnings-off={mathtools-colon,mathtools-overbracket},math-style=french]{unicode-math}
\usepackage[scale={0.75,0.8},footskip=1.5cm,heightrounded]{geometry}
\AtBeginDocument{%
\RenewDocumentCommand{\setminus}{}{\mathbin{\backslash}}%
}
\begin{document}
$A\setminus B$
$x_{A\setminus B}$
\end{document}
```
|
3
|
https://tex.stackexchange.com/users/4427
|
690348
| 320,241 |
https://tex.stackexchange.com/questions/690349
|
0
|
I wish to use to `QTBodiniPoster font` for the `title` in my document and the rest of the document in `default LaTeX font`. I use:
```
\setmainfont{QTBodiniPoster}
```
in the preamble and then for rest of the text switch to `cmr` font using command `\fontfamily{cmr}\selectfont`. The text changes to the default computer roman font, but I am `unable to italicize` the `cmr` font now. Anyone kindly help and suggest.
```
\documentclass[10pt,a4paper]{book}
\usepackage{layout}
\usepackage{graphicx}
\usepackage{sidenotes}
\usepackage{geometry}
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\usepackage{lmodern}
\setmainfont{QTBodiniPoster}
\begin{document}
\textit{\LARGE{Feynman's Preface}}
\normalsize
\fontfamily{cmr}\selectfont
\textit{\underline{Hello}}
\end{document}
```
|
https://tex.stackexchange.com/users/299705
|
Using QTBodiniPoster font
| false |
Define a special command for the special font.
```
\documentclass[10pt,a4paper]{book}
\usepackage{fontspec}
\newfontfamily{\TITLEFONT}{Futura}%{QTBodiniPoster}
\begin{document}
\begin{center}
\TITLEFONT\itshape\LARGE
Feynman's Preface
\end{center}
This text uses Latin Modern; \textit{Hello}.
\end{document}
```
Note that `fontenc` and `lmodern` should not be used along with `fontspec`.
I used a distinctive font I have instead of the one you want (that I don't have).
|
2
|
https://tex.stackexchange.com/users/4427
|
690353
| 320,244 |
https://tex.stackexchange.com/questions/690346
|
0
|
I have to add caption below the long table and with 12pt empty space before and after the table caption. Help me in this regard.
```
\documentclass[10pt, a4paper, oneside]{article}
\usepackage[hidelinks]{hyperref}
\usepackage{jucs2e}
\usepackage{graphicx}
\usepackage{url}
\usepackage{ulem}
\usepackage{mathtools}
\usepackage{scalerel}
\usepackage{setspace}
\usepackage[strict]{changepage}
\usepackage{caption}
\usepackage[letterspace=-50]{microtype}
\usepackage{fontspec}
\usepackage{afterpage}
\usepackage{ragged2e}
\usepackage{longtable}
\setmainfont{Times New Roman}
\usepackage{titlesec}
\titleformat*{\section}{\Large\bfseries}
\titleformat*{\subsection}{\normalsize\bfseries}
\renewcommand{\baselinestretch}{0.9}
\graphicspath{{./figures/}}
\usepackage[textwidth=8cm, margin=0cm, left=4.6cm, right=4.2cm, top=3.9cm, bottom=6.8cm, a4paper, headheight=0.5cm, headsep=0.5cm]{geometry}
\usepackage{fancyhdr}
\usepackage[format=plain, labelfont=it, textfont=it, justification=centering]{caption}
\usepackage{breakcites}
\usepackage{microtype}
\apptocmd{\frame}{}{\justifying}{}
\urlstyle{same}
\pagestyle{fancy}
\newcommand\jucs{{Journal of Universal Computer Science}}
\newcommand\jucsvol{vol. 27, no. 1 (2021)}
\newcommand\jucspages{2987-2989}
\newcommand\jucssubmitted{1/1/2021}
\newcommand\jucsaccepted{2/2/2021}
\newcommand\jucsappeared{3/3/2021}
\newcommand\jucslicence{ CC BY-ND 4.0}
\newcommand\startingPage{2987}
\setcounter{page}{\startingPage}
\begin{document}
\begin{longtable}{| p{0.1\textwidth} | p{0.2\textwidth} | p{0.35\textwidth} | p{0.3\textwidth} |}
\hline
{Author} & {Purpose} & {Description} & {Relative Findings} \\
\hline
\endfirsthead
\multicolumn{4}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
{Author} & {Purpose} & {Description} & {Relative Findings} \\
\hline
\endhead
\hline \multicolumn{4}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\multicolumn{4}{c}{} \\
\captionsetup{font=small}
\caption{\fontsize{10pt}{11pt}\selectfont{\itshape{Review Summary of Dashboard Designing}}}
\label{table1}
\endlastfoot
\end{longtable}
\end{document}
```
|
https://tex.stackexchange.com/users/152498
|
caption below long table with specific spacing
| true |
I was too lazy to download jucs2e, but this should otherwise fix the problem.
In section 3 (page 4) the manual describes how `\caption` works in longtable, which I used to better control the actual caption and avoid `\noalign` errors.
`\caption@caption` is the caption package version of `\caption` and `\captionof` simply defines `\@captype`. Note that tables (position=above) reverse the use of `\abovecaptionskip` and `\belowcaptionskip`.
Finally, there is some ambiguity about the gap below the caption, so I added an `\hline` and an `\hrule` after the caption. This shows the gap between the caption and the bottom of the table and the gap below the bottom of the table (`\intextsep` IIRC). Adjust `\abovecaptionskip` as needed.
Also, I reduced `\tabcolsep` in order to fit the tabular inside the margins.
```
\documentclass[10pt, a4paper, oneside]{article}
\usepackage[hidelinks]{hyperref}
%\usepackage{jucs2e}
\usepackage{graphicx}
\usepackage{url}
\usepackage{ulem}
\usepackage{mathtools}
\usepackage{scalerel}
\usepackage{setspace}
\usepackage[strict]{changepage}
\usepackage{caption}
\usepackage[letterspace=-50]{microtype}
\usepackage{fontspec}
\usepackage{afterpage}
\usepackage{ragged2e}
\usepackage{longtable}
\setmainfont{Times New Roman}
\usepackage{titlesec}
\titleformat*{\section}{\Large\bfseries}
\titleformat*{\subsection}{\normalsize\bfseries}
\renewcommand{\baselinestretch}{0.9}
\graphicspath{{./figures/}}
\usepackage[textwidth=8cm, margin=0cm, left=4.6cm, right=4.2cm, top=3.9cm, bottom=6.8cm, a4paper, headheight=0.5cm, headsep=0.5cm]{geometry}
\usepackage{fancyhdr}
\usepackage[format=plain, labelfont=it, textfont=it, justification=centering]{caption}
\usepackage{breakcites}
\usepackage{microtype}
\apptocmd{\frame}{}{\justifying}{}
\urlstyle{same}
\pagestyle{fancy}
\newcommand\jucs{{Journal of Universal Computer Science}}
\newcommand\jucsvol{vol. 27, no. 1 (2021)}
\newcommand\jucspages{2987-2989}
\newcommand\jucssubmitted{1/1/2021}
\newcommand\jucsaccepted{2/2/2021}
\newcommand\jucsappeared{3/3/2021}
\newcommand\jucslicence{ CC BY-ND 4.0}
\newcommand\startingPage{2987}
\setcounter{page}{\startingPage}
\begin{document}
\setlength{\tabcolsep}{\dimexpr (0.05\textwidth-5\arrayrulewidth)/8}% columns totol 0.95\textwidth
\begin{longtable}{| p{0.1\textwidth} | p{0.2\textwidth} | p{0.35\textwidth} | p{0.3\textwidth} |}
\hline
{Author} & {Purpose} & {Description} & {Relative Findings} \\
\hline
\endfirsthead
\multicolumn{4}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
{Author} & {Purpose} & {Description} & {Relative Findings} \\
\hline
\endhead
\hline \multicolumn{4}{r}{\textit{Continued on next page}} \\
\endfoot
\hline \multicolumn{4}{c}{\parbox{\LTcapwidth}{%
\setlength{\belowcaptionskip}{12pt}% applied above caption
\setlength{\abovecaptionskip}{12pt}% applied below caption
\expandafter\def\csname @captype\endcsname{table}% use caption package
\csname caption@caption\endcsname{Review Summary of Dashboard Designing}
\label{table1}}}\\
\hline
\endlastfoot
some & text & added & here
\end{longtable}
\hrule% show extra space at bottom
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/34505
|
690354
| 320,245 |
https://tex.stackexchange.com/questions/690180
|
8
|
A coworker is currently writing a long document with a focus on regular expressions. We would like to be able to format the regular expressions as a listings language, with syntax highlighting and such.
The main difficulty arises from the fact that the elements to highlight in the code are "*special*" characters such as `? + { } ( ) ^ [ ]`.
I have tried the following definition:
```
\documentclass[12pt]{article}
\usepackage{listings}
\lstdefinelanguage{regex}{
commentstyle=\color{gray},
keywords={},
otherkeywords={^, \{, \}, ?, +},
alsoletter={},
basicstyle=\ttfamily,
keywordstyle=\bfseries\color{green},
breakatwhitespace=false,
breaklines=true,
captionpos=b,
showspaces=false,
showstringspaces=true,
literate=%
*{0}{{{\color{red}0}}}1
{1}{{{\color{red}1}}}1
{2}{{{\color{red}2}}}1
{3}{{{\color{red}3}}}1
{4}{{{\color{red}4}}}1
{5}{{{\color{red}5}}}1
{6}{{{\color{red}6}}}1
{7}{{{\color{red}7}}}1
{8}{{{\color{red}8}}}1
{9}{{{\color{red}9}}}1
{(}{{{\bfseries\color{blue}(}}}1
{)}{{{\bfseries\color{blue}\)}}}1
}
\begin{document}
\begin{lstlisting}[language=regex]
((a+b){4,5})*c? + [^ab{?]{3}
\end{lstlisting}
\end{document}
```
Which seems a bit hacky but close to working. I have two main questions:
1. only the opening round brackets are coloured, not the closing ones, how could I fix this? I have tried setting the brackets as keywords, no success there.
2. would it be possible to make this definition more $\LaTeX$ standard compliant/optimised?
|
https://tex.stackexchange.com/users/201123
|
Creating a `regex` language for listings
| true |
Since I could not find an answer to this issue using `listings`, I decided to give it a go with `minted`, by creating a custom lexer for regular expressions, which seems to be the best possible solution.
The lexer is not currently available on PyPi, and is not yet perfect (but all suggestions are welcome). You can clone the repo from [here](https://gitlab.inria.fr/oirwin/regex-lexer). The installation can be done with a classic `pip install .` and then the lexer is available in both `minted` and `Pygments`.
|
7
|
https://tex.stackexchange.com/users/201123
|
690369
| 320,253 |
https://tex.stackexchange.com/questions/690329
|
3
|
With Latin modern font, the symbol \setminus is invisible (I discovered, by chance, that it had gone from all my documents).
Here is a MWE:
```
\documentclass[10pt,a4paper,french]{article}
\usepackage{mathtools}
\usepackage{babel}
\usepackage[warnings-off={mathtools-colon,mathtools-overbracket},math-style=french]{unicode-math}
\usepackage[scale={0.75,0.8},footskip=1.5cm,heightrounded]{geometry}
\newfontface{\STIXTWO}{STIX Two Math}
\RenewDocumentCommand{\setminus}{}{\mbox{\STIXTWO\symbol{"029F5}}}
\begin{document}
$A\setminus B$
\end{document}
```
So I tried `\newfontface` with StiX Two (thanks to an answer that egreg had given me for an another symbol problem) but it doesn't work.
What should I do?
|
https://tex.stackexchange.com/users/249670
|
\setminus invisible
| false |
The TeX Gyre fonts are missing this symbol. This is a commonly-encountered bug, which `unicode-math` [didn’t fix back in 2011 because it was an upstream issue,](https://github.com/wspr/unicode-math/issues/181) and then never implemented a workaround for, either. It would, for example, be possible to check whether the current math font contains U+29F5, and remap if not, in a font-independent way.
You might want to set, near the top of your document,
```
\tracinglostchars=3
```
to make TeX treat missing characters as an error, instead of silently ignoring them.
Your options include:
* Load a font that has it, such as New Computer Modern (`\usepackage[default]{fontsetup}`) This actually uses the `\smallsetminus` glyph for `\setminus`, however.
* Load this one symbol from a font that has it (`\setmathfont{Asana Math}[range=\setminus, Scale=MatchUppercase]`)
* Remap to another character, such as `\smallsetminus` or backslash (`\AtBeginDocument{\renewcommand{\setminus}{\smallsetminus}}`)
|
4
|
https://tex.stackexchange.com/users/61644
|
690371
| 320,254 |
https://tex.stackexchange.com/questions/690370
|
0
|
I need to determine a nth derivate of a given function using the code below, inspired in the recursive function.
```
\documentclass[tikz,border=5mm]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{etoolbox}
\usepackage{tikz,pgfplots}
\usepackage{fp}
\usetikzlibrary{fixedpointarithmetic}
\usetikzlibrary{math}
\usetikzlibrary{calc}
\usepackage{float}
\usepackage{amsmath}
\usepackage{xfp}
\usepackage{amsmath}
\usetikzlibrary{math}
\newcommand{\ar}[1]{\fpeval{round(#1,5)}}
\newcommand{\f}{0.5\cos(2t+\pi)}%Para escrever em LaTeX o nome da função
\begin{document}
\tikzset{fixed point arithmetic}
\tikzmath{
real \xzero;
real \h;
%
\xzero = 0.4;
\h = 0.0001;
%
function f(\x) {
\y = 0.5*cos(deg(2*\x+pi));
return \y;
};
%
function derivate(\x,\h) {
\y = (f(\x+\h)-f(\x-\h))/(2*\h);
return \y;
};
%
function Nthderivate(\x,\h,\n) {
if \n == 1 then {
\d = derivate(\x,\h);}
else {
\d = (Nhderivate(\x+\h,\h,\n-1) - Nhderivate(\x-\h,\h,\n-1))/(2*\h);
};
return \d;
};
%
\n=1;
\dum = derivate(\xzero,\h);
\n=2;
\ddois = Nthderivate(\xzero,\h,\n);
}
\begin{tikzpicture}[scale=0.8]
\node[above] (2) at (0,0) {\parbox{15cm}{
Vamos determinar a derivada de $s(t)=\f$ no ponto $t_0=\xzero$ e com $h=\h$:
\\[0.5cm]
O valor da derivada primeira é:\\
$\displaystyle f'(\xzero) \approx \frac{f(x_0+h)-f(x_0-h)}{2h} = \dum$\\
O valor da segunda derivada é:\\
$\displaystyle f''(\xzero) \approx \frac{f'(x_0+h)-f'(x_0-h)}{2h} = \ddois$
}};
\end{tikzpicture}
\end{document}
```
But, don't work.
I would like to use tikzmath.
Anyone can help me please?
|
https://tex.stackexchange.com/users/205932
|
Recursive function
| false |
```
! Package PGF Math Error: Unknown function `Nhderivate'
```
If I correct the typo in the function name and remove the offending `\\` it runs with no warnings:
```
\documentclass[tikz,border=5mm]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{etoolbox}
\usepackage{tikz,pgfplots}
\usepackage{fp}
\usetikzlibrary{fixedpointarithmetic}
\usetikzlibrary{math}
\usetikzlibrary{calc}
\usepackage{float}
\usepackage{amsmath}
\usepackage{xfp}
\usepackage{amsmath}
\usetikzlibrary{math}
\newcommand{\ar}[1]{\fpeval{round(#1,5)}}
\newcommand{\f}{0.5\cos(2t+\pi)}%Para escrever em LaTeX o nome da função
\begin{document}
\tikzset{fixed point arithmetic}
\tikzmath{
real \xzero;
real \h;
%
\xzero = 0.4;
\h = 0.0001;
%
function f(\x) {
\y = 0.5*cos(deg(2*\x+pi));
return \y;
};
%
function derivate(\x,\h) {
\y = (f(\x+\h)-f(\x-\h))/(2*\h);
return \y;
};
%
function Nthderivate(\x,\h,\n) {
if \n == 1 then {
\d = derivate(\x,\h);}
else {
\d = (Nthderivate(\x+\h,\h,\n-1) - Nthderivate(\x-\h,\h,\n-1))/(2*\h);
};
return \d;
};
%
\n=1;
\dum = derivate(\xzero,\h);
\n=2;
\ddois = Nthderivate(\xzero,\h,\n);
}
\begin{tikzpicture}[scale=0.8]
\node[above] (2) at (0,0) {\parbox{15cm}{
Vamos determinar a derivada de $s(t)=\f$ no ponto $t_0=\xzero$ e com $h=\h$:
\\[0.5cm]
O valor da derivada primeira é:
$\displaystyle f'(\xzero) \approx \frac{f(x_0+h)-f(x_0-h)}{2h} = \dum$
O valor da segunda derivada é:
$\displaystyle f''(\xzero) \approx \frac{f'(x_0+h)-f'(x_0-h)}{2h} = \ddois$
}};
\end{tikzpicture}
\end{document}
```
However tex fixed point arithmetic is designed for calculating a few font sizes, it is not numerically accurate to do intensive chained numerical approximations, so any outcome is more by luck than design.
|
1
|
https://tex.stackexchange.com/users/1090
|
690375
| 320,255 |
https://tex.stackexchange.com/questions/690373
|
0
|
I am using multiple url links in my bib source file and at the same time I would like to replace them with link symbol (e.g., \faLink from fontawesome5 in my example).
I insert the character directly in a `\DeclareFieldFormat` directive, based on question [304569](https://tex.stackexchange.com/questions/304569/biblatex-replace-url-label-from-url-and-enclose-url-with-and). But this solution has an effect that all links are taken as one.
The `\renewbibmacro*{url}` to avoid the issue that biblatex converts the space separator between urls to "%20" before it reaches the code, Therefore I use the command to redefine the url bibmacro to use urlraw instead of url.
I need to somehow take link per link and replace them with own link symbols (\falink). Some bib entries have only one or link is missing. The code for handling multiple urls is taken from answer [57865](https://tex.stackexchange.com/questions/57865/how-to-use-multiple-urls-for-one-bibtex-reference).
My MNWE:
```
% How to use multiple URLs for one bibtex reference?
% https://tex.stackexchange.com/questions/57865/
\RequirePackage{filecontents}
\begin{filecontents}{test3.bib}
@Misc{oai:CiteSeerPSU:562256,
title = "Gerris: {A} Tree-Based Adaptive Solver For The
Incompressible Euler Equations In Complex Geometries",
author = "St Ephane Popinet",
year = "2002",
month = sep # "~08",
language = "en",
oai = "oai:CiteSeerPSU:562256",
rights = "unrestricted",
URL = "https://1drv.ms/b/s!Ajq2sO-eH2xUh8BQBF8PicG1fNTX_A https://en.wikisource.org/wiki/On_Faraday%27s_Lines_of_Force https://www.isvavai.cz/riv?ss=detail&h=RIV%2F00216208%3A11320%2F00%3A00001579",
}
\end{filecontents}
\documentclass{article}
\usepackage{fontawesome5}
\usepackage{url}
\usepackage[backend=biber]{biblatex}
\usepackage[
colorlinks=true, % false: boxed links; true: colored links
linkcolor=blue!80, % color of internal links (change box color with linkbordercolor)
citecolor=green, % color of links to bibliography
filecolor=magenta, % color of file links
]{hyperref}
\addbibresource{test3.bib}
\renewbibmacro*{url}{\printfield[url]{urlraw}}
\let\URL\url
\makeatletter
\def\url{\begingroup \catcode`\%=12\catcode`\#=12\relax\printurl}
\def\printurl#1{\@URL#1 \@nil\endgroup}
\def\@URL#1 #2\@nil{\URL{#1}\ifx\relax#2\relax \else; \url{#2\relax}\fi}
\makeatother
\DeclareFieldFormat{url}{\textsc{URL}: \href{#1}{\faLink}}
\begin{document}
Cite \cite{oai:CiteSeerPSU:562256}
\printbibliography
\end{document}
```
|
https://tex.stackexchange.com/users/17229
|
How to replace multiple URLs for one bibtex reference with url symbols
| true |
I would extend the datamodel and add support for more url's. Then you get a cleaner bib and can format your url independantly.
```
\begin{filecontents}{moreurl.dbx}
\DeclareDatamodelFields[type=field, datatype=uri]{urli,urlii}
\DeclareDatamodelEntryfields{urli,urlii}
\end{filecontents}
\begin{filecontents}{test3.bib}
@Misc{oai:CiteSeerPSU:562256,
title = "Gerris: {A} Tree-Based Adaptive Solver For The
Incompressible Euler Equations In Complex Geometries",
author = "St Ephane Popinet",
year = "2002",
month = sep # "~08",
language = "en",
oai = "oai:CiteSeerPSU:562256",
rights = "unrestricted",
URL = "https://1drv.ms/b/s!Ajq2sO-eH2xUh8BQBF8PicG1fNTX_A",
URLi="https://en.wikisource.org/wiki/On_Faraday%27s_Lines_of_Force",
URLii="https://www.isvavai.cz/riv?ss=detail&h=RIV%2F00216208%3A11320%2F00%3A00001579",
}
\end{filecontents}
\documentclass{article}
\usepackage{fontawesome5}
\usepackage{url}
\usepackage[backend=biber,datamodel=moreurl]{biblatex}
\usepackage[
colorlinks=true, % false: boxed links; true: colored links
linkcolor=blue!80, % color of internal links (change box color with linkbordercolor)
citecolor=green, % color of links to bibliography
filecolor=magenta, % color of file links
]{hyperref}
\addbibresource{test3.bib}
\renewbibmacro*{url}{\printfield[url]{urlraw}\printfield[url]{urli}\printfield[url]{urlii}}
\DeclareFieldFormat{url}{\textsc{URL}: \href{#1}{\faLink}}
\begin{document}
Cite \cite{oai:CiteSeerPSU:562256}
\printbibliography
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/2388
|
690376
| 320,256 |
https://tex.stackexchange.com/questions/690288
|
0
|
I have a document, formatted with luatex, beginning
```
\documentclass[b4paper]{article}
\usepackage{expl3}
\usepackage{hyperref}
\usepackage{listings} %Requires luatex engine to handle UTF-8
%Consider using minted, but ...
...
\begin{document}
\lstset{language=Rexx, extendedchars=true, frame=trbl}
\maketitle
```
that uses the listings package to display code samples of Rexx, a language that uses the ASCII apostrophe as a delimiter. The code samples include a letter e with an accent aigu ("é"), which I enter as "\’{e}", and an ASCII apostrophe ("'"), which I enter as "{\textquotesingle}". This works fine in text
```
For example, the Unicode string {\textquotesingle\}Caf\'{e}{\textquotesingle\} has 4 code points, 4
grapheme clusters and 5 octets in UTF-8 encoding while
{\textquotesingle\}Cafe\textbf{'}{\textquotesingle\} has 5 code points, 4 grapheme clusters and 6 octets
in UTF-8 encoding, yet many text processing applications need to treat
them as equivalent.
```
renders properly as
>
> For example, the Unicode string 'Café' has 4 code points, 4 grapheme
> clusters and 5 octets in UTF-8 encoding while 'Cafe’' has 5 code
> points, 4 grapheme clusters and 6 octets in UTF-8 encoding, yet many
> text processing applications need to treat them as equivalent.
>
>
>
The apostrophe should be rendered as straight.
The second piece is that
```
\begin{lstlisting}
foo = 'Ren\'{e}'
parse upper var foo bar
\end{lstlisting}
```
renders as
>
>
> ```
> foo = ’Ren\’{e}’
>
> ```
>
> \_\_\_\_parse upper var foo bar
>
>
>
where \_ is actually the visible space cup. The ' is not interpolated and the leading spaces on the second line are not rendered properly.
I was able to use \'{ } to display a bare accent aigu, and with a recent LaTeX I was able to use \textquotesingle for a straight apostrophe.
MWE for listing:
```
\documentclass[b4paper]{article}
\usepackage{enumitem}
\usepackage{expl3}
\usepackage{hyperref}
\usepackage{listings} %Requires luatex engine to handle UTF-8
%Consider using minted, but ...
\begin{document}
\lstset{language=Rexx, extendedchars=true, frame=trbl}
\begin{lstlisting}
foo = {\textquotesingle\}Ren\'{e}{\textquotesingle}
parse upper var foo bar
\end{lstlisting}
\end{document}
```
The documentation for listings claims that it is possible to escape to LaTeX, but I have not been able to make that work. The markup I used above, in plain text, renders properly as "’Café’".
So my question is, without entering characters above U+7F, what luatex compatible package and markup should I use for the sample code without affecting the rendering of apostrophe elsewhere in the document? I can give up syntax highlighting as long as the code is indented, not wrapped, and is boxed or otherwise distinguished.
|
https://tex.stackexchange.com/users/110591
|
How to mix markup for straight apostrophes and accented letters in a lstlisting environment?
| false |
I'm not sure why you want to input accents the old way.
```
\documentclass{article}
\usepackage{fontspec}
\usepackage{listings}
% choose the fonts
% \setmainfont{...}
% now a special font for listings
\defaultfontfeatures{}
\newfontfamily{\listingfont}{Latin Modern Roman}
\lstset{
language=Rexx,
extendedchars=true,
frame=trbl,
basicstyle=\listingfont
}
\begin{document}
\begin{lstlisting}
foo = 'René'
parse upper var foo bar
\end{lstlisting}
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/4427
|
690382
| 320,258 |
https://tex.stackexchange.com/questions/690379
|
1
|
I am trying to increase space in a text in a poster box but it doesn`t work (Name Middlename Lastname). Look what i tried
```
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage[a4paper,margin=0pt]{geometry}
\newcommand{\header}[1]{\fontdimen3\font=0.1em #1}
\begin{document}
\begin{tcbposter}[
poster = {columns=1, rows=1, spacing=0pt},
boxes = {sharp corners, halign=center, valign=center, boxrule=0pt}
]
\posterbox[colback=black,halign=center]
{
name=headbox,
span=1,
rowspan=0.10
}
{
\color{white}
\header{Name MiddleName LastName}
\vspace{-7px}
\begin{tikzpicture}
\draw[fill=white] (-5.0, -0.01) rectangle (5.0, 0.01);
\end{tikzpicture}
\vspace{5px}
}
\end{tcbposter}
\end{document}
```
|
https://tex.stackexchange.com/users/293677
|
Stretch spacing between words doesn`t work
| true |
In the last line of a paragraph there is infinite stretch from `\parfillskip` so finite stretch in word space is not normally used.
You could instead set fontdimen2 the natural length, but it is simpler to set `\spaceskip` which is used instead of the font dimen if it is non zero.
```
\documentclass{article}
\begin{document}
Name MiddleName LastName
{\fontdimen3\font=0.1em
Name MiddleName LastName
}
{\fontdimen2\font=0.1em
Name MiddleName LastName
}
{\fontdimen2\font=0.7em
Name MiddleName LastName
}
{\spaceskip=.7em
Name MiddleName LastName
}
\end{document}
```
So in general you could use `\fontdimen2` or `\spaceskip` but here `tcolorbox` has already set `\spaceskip` as you can check with `\showthe \spaceskip` which shows `3.33298pt` so the font dimen are not used.
|
2
|
https://tex.stackexchange.com/users/1090
|
690387
| 320,260 |
https://tex.stackexchange.com/questions/690332
|
0
|
I am trying to use a math symbol in my title but it's not working. Precisely, I wanna write
```
\section{The space $\mathbb{S}^2_{\square}$}
```
and it's not working at all. And by the way in the text: `$\mathbb{S}^2_{\square}$` shows perfectly. Also, if I remove `_{\square}` and I take only
```
\section{The space $\mathbb{S}^2$}
```
it works. So I don't understand why it's so complicated to solve this issue.
Do you have any ideas of solutions ? thanks.
NB: In overleaf for some reason this is no longer an issue, but I work with texstudio.
|
https://tex.stackexchange.com/users/296442
|
A title of the form : \section{The space $\mathbb{S}^2_{\square}$} not working
| false |
```
! Argument of \__siunitx_unit_literal_power:nn has an extra }.
<inserted text>
\par
l.5 \section{The space $\mathbb{S}^2_{\square}$}
?
```
`siunix` and `amssymb` disagreeing about `\square`, easiest is to use the alternative name `\Box`
```
\documentclass{unilim}
\begin{document}
\tableofcontents
\section{The space $\mathbb{S}^2_{\Box}$}
x
\end{document}
```
|
3
|
https://tex.stackexchange.com/users/1090
|
690388
| 320,261 |
https://tex.stackexchange.com/questions/690361
|
1
|
I want to use latex to generate a PDF file of a very large Hasse diagram.
The picture is too large to fit into a normal page, so I wanted to ask whether it is somehow possible to make latex use larger sizes of paper where one can print the picture (in German it is called Din A1 format). Or is there a way to distribute the picture into 8 or so pages so that I can print those 8 pages to fit them together after I printed them?
Thanks for any help.
Here is the Ti*k*Z pictures made with sage for the Hasse diagram (warning large text) of such an example (the actual example I'm interested in is actually about 3-5 times as large and the code is too long to post in this forum):
```
\begin{tikzpicture}[>=latex,line join=bevel,]
%%
\node (node_0) at (308.5bp,8.5bp) [draw,draw=none] {$\left\{\right\}$};
\node (node_1) at (308.5bp,61.5bp) [draw,draw=none] {$\left\{1\right\}$};
\node (node_2) at (308.5bp,114.5bp) [draw,draw=none] {$\left\{1, 3\right\}$};
\node (node_3) at (259.5bp,114.5bp) [draw,draw=none] {$\left\{1, 5\right\}$};
\node (node_4) at (357.5bp,114.5bp) [draw,draw=none] {$\left\{1, 2\right\}$};
\node (node_5) at (357.5bp,167.5bp) [draw,draw=none] {$\left\{1, 2, 3\right\}$};
\node (node_8) at (228.5bp,167.5bp) [draw,draw=none] {$\left\{1, 3, 5\right\}$};
\node (node_6) at (292.5bp,167.5bp) [draw,draw=none] {$\left\{1, 2, 5\right\}$};
\node (node_7) at (431.5bp,167.5bp) [draw,draw=none] {$\left\{1, 2, 4\right\}$};
\node (node_9) at (499.5bp,220.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4\right\}$};
\node (node_10) at (221.5bp,220.5bp) [draw,draw=none] {$\left\{1, 2, 3, 5\right\}$};
\node (node_11) at (363.5bp,220.5bp) [draw,draw=none] {$\left\{1, 2, 3, 6\right\}$};
\node (node_12) at (292.5bp,220.5bp) [draw,draw=none] {$\left\{1, 2, 10, 5\right\}$};
\node (node_13) at (431.5bp,220.5bp) [draw,draw=none] {$\left\{1, 2, 4, 5\right\}$};
\node (node_16) at (145.5bp,220.5bp) [draw,draw=none] {$\left\{1, 3, 5, 15\right\}$};
\node (node_17) at (378.5bp,273.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5\right\}$};
\node (node_27) at (538.5bp,273.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 6\right\}$};
\node (node_15) at (221.5bp,273.5bp) [draw,draw=none] {$\left\{1, 2, 3, 5, 10\right\}$};
\node (node_18) at (301.5bp,273.5bp) [draw,draw=none] {$\left\{1, 2, 3, 5, 6\right\}$};
\node (node_19) at (139.5bp,273.5bp) [draw,draw=none] {$\left\{1, 2, 3, 5, 15\right\}$};
\node (node_14) at (458.5bp,273.5bp) [draw,draw=none] {$\left\{1, 2, 4, 5, 10\right\}$};
\node (node_22) at (410.5bp,326.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 10\right\}$};
\node (node_36) at (592.5bp,326.5bp) [draw,draw=none] {$\left\{1, 2, 4, 5, 20, 10\right\}$};
\node (node_20) at (39.5bp,326.5bp) [draw,draw=none] {$\left\{1, 2, 3, 5, 10, 15\right\}$};
\node (node_21) at (226.5bp,326.5bp) [draw,draw=none] {$\left\{1, 2, 3, 5, 6, 10\right\}$};
\node (node_23) at (318.5bp,326.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 15\right\}$};
\node (node_28) at (500.5bp,326.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6\right\}$};
\node (node_24) at (134.5bp,326.5bp) [draw,draw=none] {$\left\{1, 2, 3, 5, 6, 15\right\}$};
\node (node_25) at (121.5bp,379.5bp) [draw,draw=none] {$\left\{1, 2, 3, 5, 6, 10, 15\right\}$};
\node (node_26) at (227.5bp,379.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 10, 15\right\}$};
\node (node_29) at (432.5bp,379.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 10\right\}$};
\node (node_38) at (536.5bp,379.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 20, 10\right\}$};
\node (node_32) at (331.5bp,379.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 15\right\}$};
\node (node_33) at (227.5bp,432.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 10, 15\right\}$};
\node (node_34) at (109.5bp,432.5bp) [draw,draw=none] {$\left\{1, 2, 3, 5, 6, 10, 15, 30\right\}$};
\node (node_41) at (345.5bp,432.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 10, 15, 20\right\}$};
\node (node_30) at (687.5bp,326.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 6, 12\right\}$};
\node (node_31) at (666.5bp,379.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 12\right\}$};
\node (node_39) at (693.5bp,432.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 10, 12\right\}$};
\node (node_40) at (463.5bp,432.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 10, 20\right\}$};
\node (node_37) at (578.5bp,432.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 12, 15\right\}$};
\node (node_35) at (221.5bp,485.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 10, 15, 30\right\}$};
\node (node_42) at (351.5bp,485.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 10, 15, 20\right\}$};
\node (node_43) at (495.5bp,485.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 10, 12, 15\right\}$};
\node (node_44) at (365.5bp,538.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 10, 12, 15, 30\right\}$};
\node (node_45) at (221.5bp,538.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 10, 15, 20, 30\right\}$};
\node (node_46) at (625.5bp,485.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 10, 12, 20\right\}$};
\node (node_47) at (509.5bp,538.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 10, 12, 15, 20\right\}$};
\node (node_48) at (365.5bp,591.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30\right\}$};
\node (node_49) at (365.5bp,644.5bp) [draw,draw=none] {$\left\{1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 60, 30\right\}$};
\draw [black,->] (node_0) ..controls (308.5bp,23.805bp) and (308.5bp,34.034bp) .. (node_1);
\draw [black,->] (node_1) ..controls (308.5bp,76.805bp) and (308.5bp,87.034bp) .. (node_2);
\draw [black,->] (node_1) ..controls (294.1bp,77.483bp) and (282.93bp,89.114bp) .. (node_3);
\draw [black,->] (node_1) ..controls (322.9bp,77.483bp) and (334.07bp,89.114bp) .. (node_4);
\draw [black,->] (node_2) ..controls (322.9bp,130.48bp) and (334.07bp,142.11bp) .. (node_5);
\draw [black,->] (node_2) ..controls (284.17bp,131.01bp) and (264.14bp,143.78bp) .. (node_8);
\draw [black,->] (node_3) ..controls (269.0bp,130.18bp) and (276.12bp,141.18bp) .. (node_6);
\draw [black,->] (node_3) ..controls (250.58bp,130.18bp) and (243.89bp,141.18bp) .. (node_8);
\draw [black,->] (node_4) ..controls (357.5bp,129.81bp) and (357.5bp,140.03bp) .. (node_5);
\draw [black,->] (node_4) ..controls (338.02bp,130.78bp) and (322.37bp,143.06bp) .. (node_6);
\draw [black,->] (node_4) ..controls (379.9bp,130.93bp) and (398.18bp,143.54bp) .. (node_7);
\draw [black,->] (node_5) ..controls (401.24bp,184.21bp) and (440.94bp,198.47bp) .. (node_9);
\draw [black,->] (node_5) ..controls (314.63bp,184.58bp) and (277.2bp,198.61bp) .. (node_10);
\draw [black,->] (node_5) ..controls (359.18bp,182.81bp) and (360.39bp,193.03bp) .. (node_11);
\draw [black,->] (node_6) ..controls (271.12bp,183.86bp) and (253.8bp,196.3bp) .. (node_10);
\draw [black,->] (node_6) ..controls (292.5bp,182.81bp) and (292.5bp,193.03bp) .. (node_12);
\draw [black,->] (node_6) ..controls (335.95bp,184.44bp) and (374.32bp,198.52bp) .. (node_13);
\draw [black,->] (node_7) ..controls (451.98bp,183.86bp) and (468.57bp,196.3bp) .. (node_9);
\draw [black,->] (node_7) ..controls (431.5bp,182.81bp) and (431.5bp,193.03bp) .. (node_13);
\draw [black,->] (node_8) ..controls (226.54bp,182.81bp) and (225.13bp,193.03bp) .. (node_10);
\draw [black,->] (node_8) ..controls (203.14bp,184.09bp) and (182.08bp,197.02bp) .. (node_16);
\draw [black,->] (node_9) ..controls (461.63bp,237.46bp) and (428.94bp,251.24bp) .. (node_17);
\draw [black,->] (node_9) ..controls (510.84bp,236.33bp) and (519.49bp,247.65bp) .. (node_27);
\draw [black,->] (node_10) ..controls (221.5bp,235.81bp) and (221.5bp,246.03bp) .. (node_15);
\draw [black,->] (node_10) ..controls (271.33bp,237.69bp) and (315.34bp,251.98bp) .. (node_17);
\draw [black,->] (node_10) ..controls (245.83bp,237.01bp) and (265.86bp,249.78bp) .. (node_18);
\draw [black,->] (node_10) ..controls (196.56bp,237.01bp) and (176.03bp,249.78bp) .. (node_19);
\draw [black,->] (node_11) ..controls (345.01bp,236.71bp) and (330.28bp,248.82bp) .. (node_18);
\draw [black,->] (node_11) ..controls (418.46bp,237.52bp) and (468.64bp,252.14bp) .. (node_27);
\draw [black,->] (node_12) ..controls (345.31bp,237.73bp) and (392.12bp,252.11bp) .. (node_14);
\draw [black,->] (node_12) ..controls (271.12bp,236.86bp) and (253.8bp,249.3bp) .. (node_15);
\draw [black,->] (node_13) ..controls (439.23bp,236.11bp) and (444.97bp,246.95bp) .. (node_14);
\draw [black,->] (node_13) ..controls (415.85bp,236.56bp) and (403.6bp,248.35bp) .. (node_17);
\draw [black,->] (node_14) ..controls (444.4bp,289.48bp) and (433.45bp,301.11bp) .. (node_22);
\draw [black,->] (node_14) ..controls (500.64bp,290.54bp) and (537.29bp,304.49bp) .. (node_36);
\draw [black,->] (node_15) ..controls (163.33bp,290.8bp) and (111.38bp,305.36bp) .. (node_20);
\draw [black,->] (node_15) ..controls (222.9bp,288.81bp) and (223.91bp,299.03bp) .. (node_21);
\draw [black,->] (node_15) ..controls (282.05bp,290.84bp) and (336.31bp,305.48bp) .. (node_22);
\draw [black,->] (node_16) ..controls (143.82bp,235.81bp) and (142.61bp,246.03bp) .. (node_19);
\draw [black,->] (node_17) ..controls (387.71bp,289.18bp) and (394.61bp,300.18bp) .. (node_22);
\draw [black,->] (node_17) ..controls (360.61bp,289.71bp) and (346.36bp,301.82bp) .. (node_23);
\draw [black,->] (node_17) ..controls (416.68bp,290.46bp) and (449.64bp,304.24bp) .. (node_28);
\draw [black,->] (node_18) ..controls (278.8bp,289.93bp) and (260.27bp,302.54bp) .. (node_21);
\draw [black,->] (node_18) ..controls (248.37bp,290.73bp) and (201.28bp,305.11bp) .. (node_24);
\draw [black,->] (node_18) ..controls (365.4bp,290.88bp) and (422.88bp,305.61bp) .. (node_28);
\draw [black,->] (node_19) ..controls (108.57bp,290.27bp) and (82.385bp,303.63bp) .. (node_20);
\draw [black,->] (node_19) ..controls (196.71bp,290.8bp) and (247.8bp,305.36bp) .. (node_23);
\draw [black,->] (node_19) ..controls (138.1bp,288.81bp) and (137.09bp,299.03bp) .. (node_24);
\draw [black,->] (node_20) ..controls (64.438bp,343.01bp) and (84.97bp,355.78bp) .. (node_25);
\draw [black,->] (node_20) ..controls (99.73bp,343.84bp) and (153.71bp,358.48bp) .. (node_26);
\draw [black,->] (node_21) ..controls (193.95bp,343.31bp) and (166.28bp,356.75bp) .. (node_25);
\draw [black,->] (node_21) ..controls (292.72bp,343.9bp) and (352.4bp,358.67bp) .. (node_29);
\draw [black,->] (node_22) ..controls (352.01bp,343.8bp) and (299.78bp,358.36bp) .. (node_26);
\draw [black,->] (node_22) ..controls (416.77bp,342.03bp) and (421.38bp,352.72bp) .. (node_29);
\draw [black,->] (node_22) ..controls (450.03bp,343.5bp) and (484.28bp,357.36bp) .. (node_38);
\draw [black,->] (node_23) ..controls (290.56bp,343.16bp) and (267.18bp,356.26bp) .. (node_26);
\draw [black,->] (node_23) ..controls (322.17bp,341.88bp) and (324.81bp,352.26bp) .. (node_32);
\draw [black,->] (node_24) ..controls (130.83bp,341.88bp) and (128.19bp,352.26bp) .. (node_25);
\draw [black,->] (node_24) ..controls (197.76bp,343.88bp) and (254.66bp,358.61bp) .. (node_32);
\draw [black,->] (node_25) ..controls (154.36bp,396.31bp) and (182.3bp,409.75bp) .. (node_33);
\draw [black,->] (node_25) ..controls (118.12bp,394.88bp) and (115.67bp,405.26bp) .. (node_34);
\draw [black,->] (node_26) ..controls (227.5bp,394.81bp) and (227.5bp,405.03bp) .. (node_33);
\draw [black,->] (node_26) ..controls (264.35bp,396.42bp) and (296.03bp,410.12bp) .. (node_41);
\draw [black,->] (node_27) ..controls (527.45bp,289.33bp) and (519.02bp,300.65bp) .. (node_28);
\draw [black,->] (node_27) ..controls (585.69bp,290.65bp) and (627.19bp,304.86bp) .. (node_30);
\draw [black,->] (node_28) ..controls (480.02bp,342.86bp) and (463.43bp,355.3bp) .. (node_29);
\draw [black,->] (node_28) ..controls (553.31bp,343.73bp) and (600.12bp,358.11bp) .. (node_31);
\draw [black,->] (node_28) ..controls (446.73bp,343.73bp) and (399.08bp,358.11bp) .. (node_32);
\draw [black,->] (node_29) ..controls (366.6bp,396.9bp) and (307.21bp,411.67bp) .. (node_33);
\draw [black,->] (node_29) ..controls (517.18bp,397.05bp) and (594.59bp,412.17bp) .. (node_39);
\draw [black,->] (node_29) ..controls (441.42bp,395.18bp) and (448.11bp,406.18bp) .. (node_40);
\draw [black,->] (node_30) ..controls (681.55bp,341.96bp) and (677.21bp,352.49bp) .. (node_31);
\draw [black,->] (node_31) ..controls (639.61bp,396.09bp) and (617.29bp,409.02bp) .. (node_37);
\draw [black,->] (node_31) ..controls (674.23bp,395.11bp) and (679.97bp,405.95bp) .. (node_39);
\draw [black,->] (node_32) ..controls (299.26bp,396.31bp) and (271.85bp,409.75bp) .. (node_33);
\draw [black,->] (node_32) ..controls (411.45bp,397.01bp) and (484.29bp,412.05bp) .. (node_37);
\draw [black,->] (node_33) ..controls (225.82bp,447.81bp) and (224.61bp,458.03bp) .. (node_35);
\draw [black,->] (node_33) ..controls (266.31bp,449.46bp) and (299.81bp,463.24bp) .. (node_42);
\draw [black,->] (node_33) ..controls (314.55bp,450.06bp) and (394.27bp,465.24bp) .. (node_43);
\draw [black,->] (node_34) ..controls (144.39bp,449.39bp) and (174.27bp,463.0bp) .. (node_35);
\draw [black,->] (node_35) ..controls (267.0bp,502.61bp) and (306.87bp,516.73bp) .. (node_44);
\draw [black,->] (node_35) ..controls (221.5bp,500.81bp) and (221.5bp,511.03bp) .. (node_45);
\draw [black,->] (node_36) ..controls (575.88bp,342.63bp) and (562.76bp,354.59bp) .. (node_38);
\draw [black,->] (node_37) ..controls (553.14bp,449.09bp) and (532.08bp,462.02bp) .. (node_43);
\draw [black,->] (node_38) ..controls (514.41bp,395.93bp) and (496.37bp,408.54bp) .. (node_40);
\draw [black,->] (node_38) ..controls (475.31bp,396.84bp) and (420.47bp,411.48bp) .. (node_41);
\draw [black,->] (node_39) ..controls (629.92bp,449.88bp) and (572.73bp,464.61bp) .. (node_43);
\draw [black,->] (node_39) ..controls (673.02bp,448.86bp) and (656.43bp,461.3bp) .. (node_46);
\draw [black,->] (node_40) ..controls (428.61bp,449.39bp) and (398.73bp,463.0bp) .. (node_42);
\draw [black,->] (node_40) ..controls (515.04bp,449.73bp) and (560.72bp,464.11bp) .. (node_46);
\draw [black,->] (node_41) ..controls (347.18bp,447.81bp) and (348.39bp,458.03bp) .. (node_42);
\draw [black,->] (node_42) ..controls (310.62bp,502.54bp) and (275.06bp,516.49bp) .. (node_45);
\draw [black,->] (node_42) ..controls (401.65bp,502.69bp) and (445.94bp,516.98bp) .. (node_47);
\draw [black,->] (node_43) ..controls (454.62bp,502.54bp) and (419.06bp,516.49bp) .. (node_44);
\draw [black,->] (node_43) ..controls (499.45bp,500.88bp) and (502.3bp,511.26bp) .. (node_47);
\draw [black,->] (node_44) ..controls (365.5bp,553.81bp) and (365.5bp,564.03bp) .. (node_48);
\draw [black,->] (node_45) ..controls (267.0bp,555.61bp) and (306.87bp,569.73bp) .. (node_48);
\draw [black,->] (node_46) ..controls (589.28bp,502.42bp) and (558.13bp,516.12bp) .. (node_47);
\draw [black,->] (node_47) ..controls (464.0bp,555.61bp) and (424.13bp,569.73bp) .. (node_48);
\draw [black,->] (node_48) ..controls (365.5bp,606.81bp) and (365.5bp,617.03bp) .. (node_49);
%
\end{tikzpicture}
```
|
https://tex.stackexchange.com/users/97579
|
Printing a very large picture using latex
| false |
First, create your image using standalone. This will save you much time later.
```
\documentclass{standalone}
\usepackage{graphicx}
\begin{document}
\begin{minipage}[c][594mm][c]{841mm}
\centering
\includegraphics[width=800mm, height=550mm]{example-image}
\end{minipage}
\end{document}
```
Now break it into 8 pages using clip and trim. In this case, `test5.pdf` is the standalone image. Note that the first page cannot handle a full page image, so I use `\smash` to hide its size and `\vspace*{\fill}` to push it to the bottom of the page.
```
\documentclass[a4paper]{article}
\usepackage[margin=0pt, noheadfoot]{geometry}
\usepackage{graphicx}
\pagestyle{empty}
\parindent=0pt
\newcommand{\myfile}{test5.pdf}
\begin{document}
\vspace*{\fill}% first peage is tricky
\smash{\includegraphics*[trim=0mm {\paperheight} {3\paperwidth} 0mm]{\myfile}}% upper left
\newpage
\includegraphics*[trim={\paperwidth} {\paperheight} {2\paperwidth} 0mm]{\myfile}
\includegraphics*[trim={2\paperwidth} {\paperheight} {\paperwidth} 0mm]{\myfile}
\includegraphics*[trim={3\paperwidth} {\paperheight} 0mm 0mm]{\myfile}
\includegraphics*[trim=0mm 0mm {3\paperwidth} {\paperheight}]{\myfile}
\includegraphics*[trim={\paperwidth} 0mm {2\paperwidth} {\paperheight}]{\myfile}
\includegraphics*[trim={2\paperwidth} 0mm {\paperwidth} {\paperheight}]{\myfile}
\includegraphics*[trim={3\paperwidth} 0mm 0mm {\paperheight}]{\myfile}% lower right
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/34505
|
690391
| 320,262 |
https://tex.stackexchange.com/questions/33330
|
99
|
I'm working on a CV. I'd like to highlight my name in every entry in the bibliography. I've tried simply replacing `{myname}` with `{\bf myname}` or `{{\bf myname}}`, but they fail with various errors, particularly when sorting.
[This post](https://tex.stackexchange.com/questions/18664/underline-my-name-in-the-bibliography) gives a solution that's nearly what I'm looking for.
The solution in the linked post is to use:
```
\newcommand{\myname}[1]{\textbf{#1}}
```
to wrap all instances of the name in question.
EDIT: Removed error example because it was caused by an unassociated error in a .bst file. The answer selected below now directly answers the only question posed above.
|
https://tex.stackexchange.com/users/8546
|
Make one author's name bold every time it shows up in the bibliography
| false |
the following solution worked with biblatex while I automatically imported the references from Mendeley to the overleaf:
```
\usepackage{biblatex}
\addbibresource{References.bib} % your bibliography file
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=author,
match=\regexp{LastName,\sFirstName},
replace=\regexp{\\textbf{FirstName} \\space \\textbf{LastName}}]
}
}
}
```
|
1
|
https://tex.stackexchange.com/users/300222
|
690394
| 320,265 |
https://tex.stackexchange.com/questions/129271
|
35
|
1. This is not about new macros like `\newcommand`, `\def` and others.
2. This is not about autocompletion like using `.cwl` (in TexStudio)
3. This is **also not** about using shortcuts for predefined commands that are listed in the shortcuts sections.
It is more closely related to the 3. Though. I want to define shortcuts for commands that are not listed there.
e.g. When I type `Ctrl` + `Shift` + `B`, I want
```
\begin{bmatrix} \end{bmatrix}
```
to be inserted just like `Ctrl`+ `Enter` inserts `\\`.
|
https://tex.stackexchange.com/users/35451
|
Defining new shortcuts in TexStudio
| false |
I suggest using the "trigger" option instead of shortcuts given the macros are so useful for faster typing and if we use shortcuts could be more complex to remember them.
For example, I created a macro to a *definition* environment that is triggered by the specific command. In this way, when I type **::def**, it is replaced by
```
\begin{definition}
\end{definition}
```
|
0
|
https://tex.stackexchange.com/users/257214
|
690395
| 320,266 |
https://tex.stackexchange.com/questions/351711
|
8
|
After learning about `latexmk` I really would love to use it within TexStudio. For bibliography, I'm also using `biber`.
* Is this possible?
* It would be very nice, if perhaps somebody could give
me a hint about how to configure this, please? (I am using Ubuntu 16.04 and TexLive)?
|
https://tex.stackexchange.com/users/42378
|
TexStudio with LuaLatex and latexmk - is this possible?
| false |
```
latexmk.exe -lualatex -shell-escape -silent -synctex=1 %
```
This command has been tested on Windows operative system.
|
-2
|
https://tex.stackexchange.com/users/285170
|
690397
| 320,267 |
https://tex.stackexchange.com/questions/690403
|
2
|
I created a command with 3 optional arguments.
Here is a MWE:
```
\documentclass[10pt,a4paper,french]{article}
\usepackage{mathtools}
\usepackage{babel}
\usepackage[warnings-off={mathtools-colon,mathtools-overbracket},math-style=french]{unicode-math}
\usepackage[scale={0.75,0.8},footskip=1.5cm,heightrounded]{geometry}
\NewDocumentCommand{\pliste}{O{x} O{1} O{n}}{(#1_{#2},\dotsc,#1_{#3})}
\begin{document}
$\pliste$,\quad$\pliste[y]$,\quad$\pliste[z][2]$,\quad$\pliste[a][][p]$
\end{document}
```
It works fine but in the case `$\pliste[a][][p]$`, the default value (1, here) doesn't appear for the second argument.
So maybe it is not a good idea to only have optional arguments? Am I doing anything wrong?
|
https://tex.stackexchange.com/users/249670
|
NewDocumentCommand with only optional arguments?
| false |
The default argument is inserted *only* when the optional argument is not specified. Specifying `[]` means that the optional argument will be replaced by nothing.
Optional arguments are not a problem, the bad idea is to use multiple ones when they're independent of each other.
To make an example, `\makebox` has two optional initial arguments, but the second one only makes sense if the first one is specified:
```
\makebox{x}% natural width
\makebox[2cm]{x}% 2cm wide (centered by default)
\makebox[2cm][l]{x}% 2cm wide left aligned
```
The following sort of works
```
\documentclass[10pt,a4paper]{article}
\usepackage{mathtools}
\NewDocumentCommand{\pliste}{O{x} O{1} O{n}}{%
(\IfBlankTF{#1}{x}{#1}_{\IfBlankTF{#2}{1}{#2}},\dots,\IfBlankTF{#1}{x}{#1}_{#3})%
}
\begin{document}
$\pliste$,
$\pliste[y]$,
$\pliste[z][2]$,
$\pliste[a][][p]$
\end{document}
```
but it's really awkward.
You might make the variable name mandatory and change the order of the optional arguments:
```
\documentclass[10pt,a4paper]{article}
\usepackage{mathtools}
\NewDocumentCommand{\pliste}{O{1} m O{n}}{(#2_{#1},\dots,#2_{#3})}
\begin{document}
$\pliste{x}$,
$\pliste[2]{y}$,
$\pliste{z}[p]$,
$\pliste[2]{a}[p]$
\end{document}
```
The same output can be generated with a different approach, where there's a single (optional) argument that accepts key-value syntax.
```
\documentclass[10pt,a4paper]{article}
\usepackage{mathtools}
\ExplSyntaxOn
\keys_define:nn { didier/pliste }
{
v .tl_set:N = \l_didier_pliste_variable_tl,
s .tl_set:N = \l_didier_pliste_start_tl,
e .tl_set:N = \l_didier_pliste_end_tl,
}
% defaults
\tl_new:N \l_didier_pliste_initial_tl
\keys_precompile:nnN { didier/pliste } { v=x, s=1, e=n } \l_didier_pliste_initial_tl
\NewDocumentCommand{\pliste}{O{}}
{
\group_begin:
\tl_use:N \l_didier_pliste_initial_tl
\keys_set:nn { didier/pliste } { #1 }
(
\l_didier_pliste_variable_tl\sb{\l_didier_pliste_start_tl}
,\dots,
\l_didier_pliste_variable_tl\sb{\l_didier_pliste_end_tl}
)
\group_end:
}
\ExplSyntaxOff
\begin{document}
$\pliste$,
$\pliste[v=y,s=2]$,
$\pliste[e=p,v=z]$,
$\pliste[s=2,v=a,e=p]$
\end{document}
```
The advantage here is that you don't need to recall the order of the arguments, but just the key names, here
* `v` for “variable”
* `s` for “start”
* `e` for “end”
As an aside, if `\dots` is followed by a comma, then `amsmath` automatically uses `\dotsc`. This command is mainly thought to be used when it's not possible to guess the following character, say
```
$x_{1},x_{2},\dots,x_{n},x_{n+1},\dotsc$
```
|
4
|
https://tex.stackexchange.com/users/4427
|
690408
| 320,269 |
https://tex.stackexchange.com/questions/690367
|
5
|
Problem Description
===================
I am trying to setup `latexmk` using a `.latexmkrc` configuration file for "precompiling" the preamble of my documents, and reusing that during reruns.
According to a [comment by David Carlisle](https://tex.stackexchange.com/questions/269048/help-for-using-mylatex-or-mylatexformat#comment645787_269052), using precompliation *doesn't really save enough time to be worth the bother [he] wrote `mylatex.ltx` back in 1988*.
However, I have a lot of externalized graphics in my documents, and references inside pgfplots, so the loading times grow quite fast in my case, and I want to explore how much precompilation could speed up the entire process.
Requirements
============
My current requirements are:
1. preamble and document must be able to reside inside the same document, for this question let it be `mwe.tex`.
2. All compilation must be done from one single call to `latexmk`.
Literature Review
=================
In particular, I have looked into the following questions and answers:
* <https://tex.stackexchange.com/a/37730> is a bit dated, but the general principle can be taken to more recent versions of LaTeX. The main problem with this proposed solution is, that as stated, *[y]ou'll need to run `pdflatex -ini ...` manually the first time, to create the `.fmt` file*, which contradicts my second requirement.
* <https://tex.stackexchange.com/a/269052> shows how the preamble my be dumped from one single file, which is
```
pdflatex -ini \&pdflatex mylatex.ltx mwe.tex
```
In particular, this is helpful in view of requirement 1.
* After own research, I have found that a system call
```
pdflatex -ini \&pdflatex mylatexformat.ltx mwe.tex
```
would be the more recent way to do this.
My custom minimal non-working example
=====================================
Using the previous information and shortcomings in view of my requirements, I intend so sole this problem in the following steps:
1. Modify the `$pdflatex` variable in `.latexmkrc` to require a precompiled preamble `mwe.fmt` file.
2. Use `add_cus_dep('tex', 'fmt', 1, 'precompilepreamble');` to add a dependency.
3. Define the perl subroutine `precompilepreamble` to create the `mwe.fmt` file if necessary.
I expect the program to behave in the following way:
1. Call `latexmk`, which loads my custom `.latexmkrc` configuration.
2. First run of `pdflatex` fails, and will log the missing required file `mwe.fmt`.
3. `latexmk` decides an additional run is needed, and will look up the dependencyies for `.fmt`.
4. Accordingly, `latexmk` will run the custom rule I added previously to generate `mwe.fmt`.
5. Afterwards, `latexmk` will run my modified `$pdflatex` again and continue sucessfully.
Attached you find the required files:
`mwe.tex`
---------
```
\documentclass{scrbook}
\usepackage{pgfplots}
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{lipsum}
\begin{document}
\title{Shakespeare's Externalize}
\subtitle{To externalize or not to externalize?}
\subject{Case Studies}
\date{\today}
\maketitle{}
\lipsum[1-20]
\end{document}
```
`.latexmkrc`
------------
```
# ensure_path( 'TEXINPUTS', './src/' );
# ensure_path( 'TEXINPUTS', '../src/' );
# Set the program used to generate the PDF
# 1: pdflatex
# 2: postscript conversion, don't use this
# 3: dvi conversion, don't use this
# 4: lualatex
# 5: xelatex
$pdf_mode = 1;
# Add custom dependency.
# latexmk checks whether a file with ending as given in the 2nd
# argument exists ('toextension'). If yes, check if file with
# ending as in first argument ('fromextension') exists. If yes,
# run subroutine as given in fourth argument.
# Third argument is whether file MUST exist. If 0, no action taken.
add_cus_dep('tex', 'fmt', 1, "compilepreamble");
# show custom dependencies for debugging
show_cus_dep();
# parse missing files
push @file_not_found, '^I can\'t find the format file `(.*)\'\!';
sub compilepreamble {
my ( $base) = @_;
# just output a simple debug string to console
print ("**** compilepreamble: ( $base ) ****\n");
# create the fmt file
$ret = system("pdflatex",
"-jobname", "$base",
"-ini",
"&pdflatex" ,
"mylatexformat.ltx",
$base
);
# if there were errors, return the error codes
return $ret;
}
# modify $pdflatex to use custom format
$pdflatex = 'pdflatex -fmt mwe %B %O %S';
```
Observed Behaviour
==================
Instead of `pdflatex` failing, it tries to run `mktexfmt`:
```
$ latexmk -g
Custom dependency list:
tex fmt 1 compilepreamble
Rc files read:
.latexmkrc
Latexmk: This is Latexmk, John Collins, 7 Jan. 2023. Version 4.79.
Force everything to be remade.
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': Reasons for rerun
Category 'other':
Rerun of 'pdflatex' forced or previously required
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex -fmt mwe -recorder "mwe.tex"'
------------
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=mwe)
restricted \write18 enabled.
kpathsea: Running mktexfmt mwe.fmt
mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order):
...
I can't find the format file `mwe.fmt'!
Latexmk: fls file doesn't appear to have been made.
Latexmk: Getting log file 'mwe.log'
Latexmk: Couldn't read log file 'mwe.log':
No such file or directory
```
Question
========
1. How can I prevent `latexmk`, or rather, `pdflatex` from trying to run `mktexfmt`?
2. The line `I can't find the format file `mwe.fmt'!` is only output to console and no `mwe.log` is generated, which makes reruns impossible, and does not detect my custom dependency. How can I change this behaviour?
3. I could inject a custom subroutine into `$pdflatex`, which would then check if the format file exists, and possibly create it if not. This could even be combined with a hashing process, to ensure only recompilation if needed and ... oh my, I notice I am copying the functionality of `latexmk`. So, is there a way to do this in `latexmk` in the first place?
I'm also looking forward to hearing other suggestions.
|
https://tex.stackexchange.com/users/53868
|
latexmk with precompiled preamble
| false |
>
> 1. How can I prevent latexmk, or rather, pdflatex from trying to run mktexfmt?
>
>
>
```
$ pdftex --no-mktex=fmt --fmt mwe file
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=mwe)
restricted \write18 enabled.
I can't find the format file `mwe.fmt'!
```
shows a run that does not trigger mktexfmt
>
> 2. The line I can't find the format file `mwe.fmt'! is only output to console and no mwe.log is generated, which makes reruns impossible, and does not detect my custom dependency. How can I change this behaviour?
>
>
>
I don't think that is changeable
>
> 3. I could inject a custom subroutine into $pdflatex, which would then check if the format file exists, and possibly create it if not.
>
>
>
You could, but (without the option in (1.) above) pdftex is already doing that check and calling mktexfmt in the case the file does not exist so a simpler approach is probably to configure mktexfmt so that it builds mwe.fmt when requested. (`texdoc mktexfmt` has some information on how to set up the fmtutil config)
|
3
|
https://tex.stackexchange.com/users/1090
|
690411
| 320,272 |
https://tex.stackexchange.com/questions/690415
|
1
|
I have an OCRed document that I want to typeset. However, for validation purposes I want to keep the original layout in the code, but make hyphens disappear from the compiled document. Is there a way to achieve this? I tried to insert optional hyphens (`\-`), but the line break still ads an unnecessary space.
Something like:
```
(Aus Pesth, den 11. August.) Die in einigen Zeitblättern
spärlich zerstreuten Nachrichtenüber die Israeliten in Ungarn rüh-
ren allesammt von ununterrichteten Berichterstattern her, welche
ihre Unbekanntschaft mit den bestehenden Verhältnissen fast mit
jedem Worte verrathen. Authentische Nachrichten hierüber dürf-
ten Ihnen nicht unwillkommen sein. Die erste Erwähnung ver-
dient wohl die hiesige, 1467 Familien zählende Gemeinde, nächst
Brody und Prag die größte im Kaiserstaate.
```
But still have in the document *rühren, dürften* and *verdient* without a hyphen or a space.
|
https://tex.stackexchange.com/users/135685
|
Keeping hyphenated layout in code - making it disappear from PDF
| true |
You could replace your OCR'd source `-` by `\sourcehyph` defined by
```
\let\sourcehyph\-
```
being a control name of letters it will mean the following line end is absorbed and not make a space in the document, and will ensure that point is still a legal breakpoint to be re-hyphenated.
Using
```
\-%
```
would also work but looks less clear to me, and if you accidentally re-wrap the paragraph you may find yourself commenting out text you did not intend to lose.
|
7
|
https://tex.stackexchange.com/users/1090
|
690417
| 320,274 |
https://tex.stackexchange.com/questions/690412
|
1
|
When I do my math homework, I use a theorem environment with custom theorem style via the `amsthm` package to enumerate my problems. I would like the first paragraph inside the theorem environment to be indented. The package `indentfirst` doesn't solve this issue. I know it is a stylistic decision not everyone agrees with, but that's a risk I am willing to take. This is how I have defined the theorem style, I was hoping theres some way I could just add force indent somewhere in there.
```
\usepackage{amsthm}
\newtheoremstyle{mystyle}
{\topsep}{\topsep}{\normalfont}{}{\large\bfseries}{\newline}{0em}
{\thmname{#1}\thmnumber{ #2.}\hfill}
\theoremstyle{mystyle}
\newtheorem{prob}{Problem}
```
Thank you all!
|
https://tex.stackexchange.com/users/295611
|
Force indenting at beginning of theorem environment
| true |
I vehemently disagree. What do I disagree with?
1. the `\LARGE` heading;
2. the newline;
3. the indent.
Anyway, here it is how you can do it:
```
\documentclass{article}
\usepackage{amsthm}
\usepackage{etoolbox}
\usepackage{lipsum}
\newtheoremstyle{mystyle}
{\topsep}
{\topsep}
{\normalfont}
{}
{\large\bfseries}
{\newline}
{0em}
{\thmname{#1}\thmnumber{ #2.}\hfill}
\theoremstyle{mystyle}
\newtheorem{prob}{Problem}
\makeatletter
\AtBeginEnvironment{prob}{%
\patchcmd{\@begintheorem}{\ignorespaces}{\hspace*{\parindent}\ignorespaces}{}{}%
}
\makeatother
\begin{document}
\begin{prob}
\lipsum[1][1-3]
\lipsum[2][1-3]
\end{prob}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/4427
|
690420
| 320,275 |
https://tex.stackexchange.com/questions/690400
|
1
|
I tried to label a theorem by Theorem A. When I tried to refer it, the label A was not displaying:
```
\newtheorem*{thm*}{Theorem A}
\begin{document}
\begin{thm*}\label{A}
Let H be a group.
\end{thm*}
By Theorem~\ref{A} we have
```
When I tried to do this by removing \*, the theorem got displayed as (Theorem A 1) and when referring it, it was diaplayed as (Theorem [1]).
```
\newtheorem{thm}{Theorem A}
\begin{document}
\begin{thm}\label{A}
Let H be a group.
\end{thm}
By Theorem~\ref{A} we have
```
**Q.** How can I create a theorem in such a way that it will be displayed with any numbering (like, Theorem K) and at the same time, it will be displayed as (Theorem K) when referring it.
|
https://tex.stackexchange.com/users/233372
|
Referring to a theorem without numbers
| true |
Define the reference to be what you want.
```
\documentclass{article}
\usepackage{amsthm}
\newtheorem*{thm*}{Theorem A}
\makeatletter
\AtBeginEnvironment{thm*}{\def\@currentlabel{A}}
\makeatother
\begin{document}
\begin{thm*}\label{A}
Let H be a group.
\end{thm*}
By Theorem~\ref{A} we have
\end{document}
```
But it would be a nuisance to do this if you have several “named theorems”.
```
\documentclass{article}
\usepackage{amsthm}
\newtheorem{namedthm}{Theorem}
\newenvironment{thm*}[1]{%
\renewcommand\thenamedthm{#1}%
\namedthm}{\endnamedthm}
\begin{document}
\begin{thm*}{A}\label{A}
Let H be a group.
\end{thm*}
\begin{thm*}{B}\label{B}
Let H be a group.
\end{thm*}
By Theorem~\ref{A} and Theorem~\ref{B} we have
\end{document}
```
This works nicely with `cleveref`.
```
\documentclass{article}
\usepackage{amsthm}
\usepackage{cleveref}
\newtheorem{namedthm}{Theorem}
\newenvironment{thm*}[1]{%
\renewcommand\thenamedthm{#1}%
\namedthm}{\endnamedthm}
\begin{document}
\begin{thm*}{A}\label{A}
Let H be a group.
\end{thm*}
\begin{thm*}{B}\label{B}
Let H be a group.
\end{thm*}
By \Cref{A} and \Cref{B} we have
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/4427
|
690421
| 320,276 |
https://tex.stackexchange.com/questions/648226
|
5
|
I think LaTeX packages rarely use macros as key names. And some users expect macros inside the keyval input will be expanded recursively first. But `l3keys` in `expl3` doesn't provide this functionality at this time. So it is a job of package writers. I can think of one way to do this. But it may be a little slow. Therefore I ask this question in hope of finding the best solution.
Note: only macros surrounded by commas are expanded inside keyval input.
```
\documentclass{article}
\ExplSyntaxOn
\keys_define:nn { test }
{
key1 .code:n = \tl_to_str:n {#1},
key2 .code:n = \tl_to_str:n {#1},
key3 .code:n = \tl_to_str:n {#1},
key4 .code:n = \tl_to_str:n {#1},
key5 .code:n = \tl_to_str:n {#1},
key6 .code:n = \tl_to_str:n {#1},
}
\NewDocumentCommand \mycommand {m}
{
\keys_set:nn { test } { #1 }
}
\ExplSyntaxOff
\begin{document}
\mycommand{key1=val1,key2=val2,key3=val3,key4=val4,key5=val5,key6=val6}
\def\mymacroa{key3=val3,key4=val4}
\mycommand{key1=val1,key2=val2,\mymacroa,key5=val5,key6=val6} % error
\def\mymacrob{key2=val2,\mymacroa,key5=val5}
\mycommand{key1=val1,\mymacrob,key6=val6} % error
\end{document}
```
|
https://tex.stackexchange.com/users/106776
|
What is the best way to expand macros inside keyval input in expl3
| false |
`\begin{advertisement}`
My `expkv` package has a built in grammar for key expansion, that grammar also supports expanding macros and using their replacement as additional key=value input. This is possible by prefixing the macro with `R:␣` (with `␣` being a space). In general the grammar scans for `<expansions>:␣` at the start of a key, and executes the `<expansions>`. For a complete list of defined expansion rules see the package documentation.
Caveat: Keys that contain `:␣` in their names become harder to input in `\ekvparse` (no problem in `\ekvset`), in which case you need to use `\ekvparse{<code1>}{<code2>}{: key: name: with: colons}` and the parsed key name will be `key: name: with: colons`.
To allow this mechanism in `l3keys` we wrap it by passing the key list once through `\ekvparse` to apply our expansion grammar, and the result gets forwarded to `\keys_set:nn`. We need two full expansions, the first for `\ekvparse` the second for our auxiliary macros to take effect.
```
\documentclass{article}
\usepackage{expkv}
\ExplSyntaxOn
\cs_new:Npn \ljr_set_keys_expanded:nn #1#2
{
\exp_args:Nne \keys_set:ne {#1}
{ \ekvparse \__ljr_set_keys_expanded:n \__ljr_set_keys_expanded:nn {#2} }
}
\cs_generate_variant:Nn \keys_set:nn { ne }
\cs_new:Npn \__ljr_set_keys_expanded:n #1
{ , { \exp_not:n {#1} } }
\cs_new:Npn \__ljr_set_keys_expanded:nn #1#2
{ , { \exp_not:n {#1} } = { \exp_not:n {#2} } }
\keys_define:nn { test }
{
key1 .code:n = \tl_to_str:n {#1},
key2 .code:n = \tl_to_str:n {#1},
key3 .code:n = \tl_to_str:n {#1},
key4 .code:n = \tl_to_str:n {#1},
key5 .code:n = \tl_to_str:n {#1},
key6 .code:n = \tl_to_str:n {#1},
}
\NewDocumentCommand \mycommand {m}
{ \ljr_set_keys_expanded:nn { test } {#1} }
\ExplSyntaxOff
\begin{document}
\mycommand{key1=val1,key2=val2,key3=val3,key4=val4,key5=val5,key6=val6}
\def\mymacroa{key3=val3,key4=val4}
\mycommand{key1=val1,key2=val2,R: \mymacroa,key5=val5,key6=val6} % error
\def\mymacrob{key2=val2,R: \mymacroa,key5=val5}
\mycommand{key1=val1,R: \mymacrob,key6=val6} % error
\end{document}
```
`\end{advertisement}`
|
2
|
https://tex.stackexchange.com/users/117050
|
690423
| 320,278 |
https://tex.stackexchange.com/questions/690327
|
1
|
I want to put a full stop at the end of each bib item before the subscripted page numbers directed to the citations. For example, it appears as:
```
[1] Vladimir I Arnold. Mathematical Methods of Classical Mechanics. Vol. 60. Graduate Texts in Mathematics. Springer Science & Business Media, 2013 (p. 2)
```
I like to show it as:
```
[1] Vladimir I Arnold. Mathematical Methods of Classical Mechanics. Vol. 60. Graduate Texts in Mathematics. Springer Science & Business Media, 2013. (p. 2)
```
I want to configure it such that clicking the page number in `(p. 2)` would take the pdf viewer to the specific citation point on page `2`.
Here's my MWE:
```
\documentclass[a4paper]{report}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \input{setup/preamble}
% basics
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{url}
\usepackage{hyperref}
\hypersetup{
colorlinks,
linkcolor={black},
citecolor={black},
urlcolor={blue!80!black},
% backref=true,
% pagebackref=true
}
% Page Margins
\usepackage[
margin=2.8cm,
% top=2.8cm, bottom=2.8cm,
% left=1in, right=1in,
% headheight=14.5pt
]{geometry}
% \usepackage{graphicx}
% \usepackage{float}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{lipsum}
% bibliography
\usepackage[
backend=biber,
backref=true,
style=numeric,
sortcites=true,
sorting=none,
defernumbers=true
]{biblatex} % bibliography % https://www.overleaf.com/learn/latex/bibliography_management_with_biblatex
\usepackage{xurl} % handling the urls in bib file and it should be loaded after loading biblatex
%% Change formatting of back references % https://tex.stackexchange.com/a/606518/114006
\DefineBibliographyStrings{english}{
backrefpage={p.},
% backrefpage={},
backrefpages={pp.}
% backrefpages={
}
\renewcommand*{\finentrypunct}{}
\usepackage{xpatch}
% \DeclareFieldFormat{backrefparens}{\mkbibparens{#1\addperiod}}
\DeclareFieldFormat{backrefparens}{\raisebox{-4pt}{\scriptsize{\mkbibparens{#1}}}}
\xpatchbibmacro{pageref}{parens}{backrefparens}{}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{filecontents}{ref.bib}
@book{arnold2013mathematical,
title = {Mathematical {{Methods}} of {{Classical Mechanics}}},
author = {Arnold, Vladimir I},
date = {2013},
series = {Graduate {{Texts}} in {{Mathematics}}},
volume = {60},
publisher = {{Springer Science \& Business Media}}
}
\end{filecontents}
\addbibresource{ref.bib}
\title{Lecture Notes}
\author{me}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\renewcommand\thepage{Title}
\maketitle
\newpage
\pagenumbering{roman}
\pdfbookmark{\contentsname}{toc}
\setcounter{tocdepth}{0}
\tableofcontents
\newpage
\pagenumbering{arabic}
% start lectures
\chapter{Sat, Mar 18, 2023}
\lipsum[1] \cite{arnold2013mathematical}
\lipsum \cite{arnold2013mathematical}
% \intput{endpage}
% Bibliography
\printbibheading[heading=bibintoc, title={\protect\numberline{}Recommended Resources}] % https://tex.stackexchange.com/a/222961/114006
\printbibliography[type=book,heading=subbibliography,title={Books}] % https://www.overleaf.com/learn/latex/Articles/Getting_started_with_BibLaTeX
\printbibliography[nottype=book,heading=subbibliography,title={Others}]
\end{document}
```
Initially, I wanted to attach the back referencing link with the bib label too. But I realized it doesn't make sense as there can be situations when the same bib item is cited multiple times.
|
https://tex.stackexchange.com/users/114006
|
Customizing bibliography style with back referencing
| true |
If I understood correctly, you can fix the final dot by re-inserting it after you suppressed it with `\renewcommand*{\finentrypunct}{}`.
I changed your `\DeclareFieldFormat` to:
```
\DeclareFieldFormat{backrefparens}{\unskip.~\raisebox{-4pt}{\scriptsize{\mkbibparens{#1}}}}
```
...and it *seems* to work.
About linking back the number, I think it should be possible, but probably it will link to the last citation... so I agree it's better as it is now.
**For the second question**, that seems a duplicate of [Precise back-reference target with hyperref and backref](https://tex.stackexchange.com/questions/54541/precise-back-reference-target-with-hyperref-and-backref) (but beware, that's a quite old answer, and `hyperref` changed a lot lately; so there could be a better way and/or the answer could or could not work).
|
2
|
https://tex.stackexchange.com/users/38080
|
690424
| 320,279 |
https://tex.stackexchange.com/questions/689886
|
1
|
I am struggeling with one particular problem for years now. I try to draw arrows from a part of a node in a forest tree. Due to a bug in xelatex this does not work with the `tikzmark` package and the subnode command.
The topic was discussed here:
[tikzmark and xelatex](https://tex.stackexchange.com/questions/229500/tikzmark-and-xelatex)
[fixing or replacing tikzmark/pgfmark/subnode within forest](https://tex.stackexchange.com/questions/266274/fixing-or-replacing-tikzmark-pgfmark-subnode-within-forest)
I am too dumb for understanding the solutions. Some solutions seem to be outdated. The underlying bug in xelatex seems to be not fixed and pdflatex seems to have stopped working as well.
What I want to do is to connect all the Vs after the // with double arrows. This should work in a copy and paste-safe way. I can shift the arrows left or right, but when I change the font size, this breaks. Is there any solution to this? Of course the subnode solution would be the preferred one.
```
\documentclass{article}
\usepackage{forest}
\useforestlibrary{linguistics}
\forestapplylibrarydefaults{linguistics}
\usetikzlibrary{arrows}
\tikzset{
%Define standard arrow tip
>=stealth'}
\newcommand{\sliste}[1]{%
\mbox{%
$\left\langle\mbox{\upshape\scshape #1}\right\rangle$}%
}
\begin{document}
\begin{forest}
where n children=0{tier=word}{}
[S
[{V \sliste{ S$/\!/$V }},name=vini
[V,name=vlast [liest$_j$] ] ]
[{S$/\!/$V}, name=sv
[NP [Conny] ]
[{V$'$$\!/\!/$V}, name=v1v
[NP [das Buch, roof] ]
[{V$\!/\!/$V}, name=vv [\_$_j$] ] ] ] ] ]
\path[semithick,<->,color=green] (v1v.east) edge [bend left=44] (vv.east);
\path[semithick,<->,color=green] (v1v.north east) edge [bend right=44] (sv.east);
\path[semithick,<->,color=green] (sv.north) edge [bend right=24] (vini.north);
\draw[semithick,<->,color=green] (vini.south) -- (vlast.north);
\end{forest}
\end{document}
```
With a working subnode command, it should look like this:
```
\documentclass{article}
\usepackage{tikz} \usetikzlibrary{tikzmark}
\usepackage{forest}
\useforestlibrary{linguistics}
\forestapplylibrarydefaults{linguistics}
\usetikzlibrary{arrows}
\tikzset{
%Define standard arrow tip
>=stealth'}
\newcommand{\sliste}[1]{%
\mbox{%
$\left\langle\mbox{\upshape\scshape #1}\right\rangle$}%
}
\begin{document}
\begin{forest}
where n children=0{tier=word}{}
[S
[{V \sliste{ S$/\!/$\subnode{vini}{V} }},name=vinix
[V,name=vlast [liest$_j$] ] ]
[{S$/\!/$\subnode{sv}{V}}, name=svx
[NP [Conny] ]
[{V$'$$\!/\!/$\subnode{v1v}{V}}, name=v1vx
[NP [das Buch, roof] ]
[{V$\!/\!/$\subnode{vv}{V}}, name=vvx [\_$_j$] ] ] ] ] ]
\path[semithick,<->,color=green] (v1v.east) edge [bend left=44] (vv.east);
\path[semithick,<->,color=green] (v1v.north east) edge [bend right=44] (sv.east);
\path[semithick,<->,color=green] (sv.north) edge [bend right=24] (vini.north);
\draw[semithick,<->,color=green] (vini.south) -- (vlast.north);
\end{forest}
\end{document}
```
|
https://tex.stackexchange.com/users/18561
|
Drawing lines between parts of nodes in forest trees
| false |
After asking the question in a tikz-related form, I was pointed to this solution to a similar problem:
[Draw connection between node in forest tree diagram and something outside it](https://tex.stackexchange.com/questions/339827/draw-connection-between-node-in-forest-tree-diagram-and-something-outside-it/339975#339975)
I adapted it to my `forest` problem. The point I struggled with was that the drawing has to happen outside of `forest`, since the `subnode` coordinates seem to work only outside of the tree.
```
\documentclass{article}
\usepackage[linguistics]{forest}
\forestapplylibrarydefaults{linguistics}
\usetikzlibrary{positioning, tikzmark, arrows}
\tikzset{
%Define standard arrow tip
>=stealth'}
% WORKAROUND:
% Definition copied from /usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def
% Compare https://tex.stackexchange.com/q/229500 and comments!
\makeatletter
\def\pgfsys@hboxsynced#1{%
{%
\pgfsys@beginscope%
\setbox\pgf@hbox=\hbox{%
\hskip\pgf@pt@x%
\raise\pgf@pt@y\hbox{%
\pgf@pt@x=0pt%
\pgf@pt@y=0pt%
\special{pdf: content q}%
\pgflowlevelsynccm%
\pgfsys@invoke{q -1 0 0 -1 0 0 cm}%
\special{pdf: content -1 0 0 -1 0 0 cm q}% translate to original coordinate system
\pgfsys@invoke{0 J [] 0 d}% reset line cap and dash
\wd#1=0pt%
\ht#1=0pt%
\dp#1=0pt%
\box#1%
\pgfsys@invoke{n Q Q Q}%
}%
\hss%
}%
\wd\pgf@hbox=0pt%
\ht\pgf@hbox=0pt%
\dp\pgf@hbox=0pt%
\pgfsys@hbox\pgf@hbox%
\pgfsys@endscope%
}%
}
\makeatother
\begin{document}
\begin{forest}
where n children=0{tier=word}{}
[S
[{V S$/\!/$\subnode{vini}{V} },name=vinix
% [V,name=vlast [liest$_j$] ] ] does not work, has to be subnode
[\subnode{vlast}{V} [liest$_j$] ] ]
[{S$/\!/$\subnode{sv}{V}}, name=svx
[NP [Conny] ]
[{V$'$$\!/\!/$\subnode{v1v}{V}}, name=v1vx
[NP [das Buch, roof] ]
[{V$\!/\!/$\subnode{vv}{V}}, name=vvx [\_$_j$] ] ] ] ] ]
% \path[semithick,<->,color=green] (v1v.east) edge [bend left=44] (vv.east);
% \path[semithick,<->,color=green] (v1v.north east) edge [bend right=44] (sv.east);
% \path[semithick,<->,color=green] (sv.north) edge [bend right=24] (vini.north);
% \draw[semithick,<->,color=green] (vini.south) -- (vlast.north);
\end{forest}
\begin{tikzpicture}[remember picture, overlay]
\path[semithick,<->,color=green] (vv.north) edge [bend right=44] (v1v.east);
\path[semithick,<->,color=green] (v1v.north) edge [bend right=44] (sv.east);
\path[semithick,<->,color=green] (sv.north) edge [bend right=24] (vini.north);
\draw[semithick,<->,color=green] (vini.south) -- (vlast.north);
\end{tikzpicture}
\end{document}
```
Note that this solution breaks when multiple trees are in the same document. A solution is to put a `tixmark prefix` declaration before the image. E.g. `\tikzset{tikzmark prefix=fig-German-v2}`. This seems to open a new name space.
|
1
|
https://tex.stackexchange.com/users/18561
|
690425
| 320,280 |
https://tex.stackexchange.com/questions/690389
|
2
|
For a nice little poetry book I like to use the acorn initial fonts, which work with pdflatex fine, but in the epub with tex4ebook it does not come out. Also with the follow MWE the missing situation can be simulated. Thank you for support.
```
\documentclass[a4paper]{article}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\input Acorn.fd
\newcommand*\initfamily{\usefont{U}{Acorn}{xl}{n}}
\begin{document}
\Huge
{\initfamily T}his is a sentence with Acorn Intial.
\end{document}
```
|
https://tex.stackexchange.com/users/292824
|
Acorn font initials not supported by tex4ebook up to now
| false |
There is no support for fonts provided by the `initials` package. Fortunately, it is not hard to add it. Save the following file as `Acorn.htf`:
```
Acorn 0 160
'' '' .notdef 0 % generated from Acorn.tfm, 2023-07-06-13:12
'' '' % Copyright 2023 TeX Users Group
'' '' %
'' '' % This work may be distributed and/or modified under the
'' '' % conditions of the LaTeX Project Public License, either
'' '' % version 1.3c of this license or (at your option) any
'' '' % later version. The latest version of this license is in
'' '' % http://www.latex-project.org/lppl.txt
'' '' % and version 1.3c or later is part of all distributions
'' '' % of LaTeX version 2005/12/01 or later.
'' '' %
'' '' % This work has the LPPL maintenance status "maintained".
'' '' %
'' '' % The Current Maintainer of this work
'' '' % is the TeX4ht Project <http://tug.org/tex4ht>.
'' '' %
'' '' % If you modify this program, changing the
'' '' % version identification would be appreciated.
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
' ' '' space 32
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'A' '1' A 65
'B' '1' B 66
'C' '1' C 67
'D' '1' D 68
'E' '1' E 69
'F' '1' F 70
'G' '1' G 71
'H' '1' H 72
'I' '1' I 73
'J' '1' J 74
'K' '1' K 75
'L' '1' L 76
'M' '1' M 77
'N' '1' N 78
'O' '1' O 79
'P' '1' P 80
'Q' '1' Q 81
'R' '1' R 82
'S' '1' S 83
'T' '1' T 84
'U' '1' U 85
'V' '1' V 86
'W' '1' W 87
'X' '1' X 88
'Y' '1' Y 89
'Z' '1' Z 90
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'a' '1' a 97
'b' '1' b 98
'c' '1' c 99
'd' '1' d 100
'e' '1' e 101
'f' '1' f 102
'g' '1' g 103
'h' '1' h 104
'i' '1' i 105
'j' '1' j 106
'k' '1' k 107
'l' '1' l 108
'm' '1' m 109
'n' '1' n 110
'o' '1' o 111
'p' '1' p 112
'q' '1' q 113
'r' '1' r 114
's' '1' s 115
't' '1' t 116
'u' '1' u 117
'v' '1' v 118
'w' '1' w 119
'x' '1' x 120
'y' '1' y 121
'z' '1' z 122
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
'' ''
' ' '' space 160
Acorn 0 160
htfcss: Acorn font-family: 'Acorn Initials', serif;
```
This file contains instructions on how to process characters in the DVI file. The instructions like this:
```
'A' '1' A 65
'B' '1' B 66
'C' '1' C 67
```
require that these characters will be converted to images, thanks to the '1' value in the table.
You could also simplify your file like this:
```
\documentclass[a4paper]{article}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{Acorn}
%\input Acorn.fd
%\newcommand*\initfamily{\usefont{U}{Acorn}{xl}{n}}
\begin{document}
\Huge
% {\initfamily T}his is a sentence with Acorn Intial.
\acorn{T}his is a sentence with Acorn Intial.
\end{document}
```
There is no need to include the `.fd` file or to declare the `initfamily` command. The `Acorn` package provides the `\acorn` command, which works just fine.
This is the result:
|
1
|
https://tex.stackexchange.com/users/2891
|
690426
| 320,281 |
https://tex.stackexchange.com/questions/1511
|
100
|
I'm new to LaTeX and trying to understand the reason why I'm getting the warning:
```
`h' float specifier changed to `ht'
```
I'm not attempting to change the float property of anything - the warning is showing up if I attempt to simply encapsulate some words in quotation marks:
```
``highly distributed''
```
As far as I'm aware, there's no open sections anywhere and the file seems to render properly. So realistically it doesn't matter if the issue gets solved or not; but I'd like to know the reason I'm getting the warning.
Thanks in advance.
|
https://tex.stackexchange.com/users/182
|
`h' float specifier changed to `ht' warning when not attempting to specify a float
| false |
Well, there are suggestions to replace [h] with [ht] etc. or using some packages for floats, but if you decided that none of those are really necessary and you just prefer to not see this warning message. Then you can add these two lines in your tex file. The first one is calling `silence` package that helps to stop warnings that annoys you to appear. And the second line is asking the float warning h bla bla to not appear.
```
\usepackage{silence}
\WarningFilter{latex}{`h' float specifier changed to `ht'}
```
|
0
|
https://tex.stackexchange.com/users/22458
|
690428
| 320,282 |
https://tex.stackexchange.com/questions/690429
|
1
|
I am using the `alphaurl` citation style.
When I use the `\citet` command, I get the following error (author?).
Is there any way to show the author's name using the `alphaurl` citation style?
```
\documentclass[twoside,openright,%
11pt,oldfontcommands]{memoir}
\usepackage[square,comma,numbers,sort]{natbib}
%\input{preamble}
%\definecolor{keywordcolor}{RGB}{127,0,85}
\begin{document}
Hello world \citet{Test12}
\bibliographystyle{alphaurl}
\bibliography{memoire}
\end{document}
```
and in `memoire.bib`
```
@article{Test12,
author = "John Smith",
title = "Test Article",
year = "2012",
journal = "The Test Journal"
}
```
|
https://tex.stackexchange.com/users/300259
|
Citet does not work with alphaurl bibliographystyle
| false |
You could use the `usebib` package (please note the use of `{...}` in the .bib file)
```
\documentclass[twoside,openright,%
11pt,oldfontcommands]{memoir}
\usepackage{usebib}
\newbibfield{author}
\begin{filecontents*}[overwrite]{\jobname.bib}
@article{Test12,
author = {John Smith},
title = {Test Article},
year = {2012},
journal = {The Test Journal}
}
\end{filecontents*}
\bibinput{\jobname}
\begin{document}
Hello world \usebibentry{Test12}{author} \cite{Test12}
\bibliographystyle{alphaurl}
\bibliography{\jobname}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/36296
|
690430
| 320,283 |
https://tex.stackexchange.com/questions/690367
|
5
|
Problem Description
===================
I am trying to setup `latexmk` using a `.latexmkrc` configuration file for "precompiling" the preamble of my documents, and reusing that during reruns.
According to a [comment by David Carlisle](https://tex.stackexchange.com/questions/269048/help-for-using-mylatex-or-mylatexformat#comment645787_269052), using precompliation *doesn't really save enough time to be worth the bother [he] wrote `mylatex.ltx` back in 1988*.
However, I have a lot of externalized graphics in my documents, and references inside pgfplots, so the loading times grow quite fast in my case, and I want to explore how much precompilation could speed up the entire process.
Requirements
============
My current requirements are:
1. preamble and document must be able to reside inside the same document, for this question let it be `mwe.tex`.
2. All compilation must be done from one single call to `latexmk`.
Literature Review
=================
In particular, I have looked into the following questions and answers:
* <https://tex.stackexchange.com/a/37730> is a bit dated, but the general principle can be taken to more recent versions of LaTeX. The main problem with this proposed solution is, that as stated, *[y]ou'll need to run `pdflatex -ini ...` manually the first time, to create the `.fmt` file*, which contradicts my second requirement.
* <https://tex.stackexchange.com/a/269052> shows how the preamble my be dumped from one single file, which is
```
pdflatex -ini \&pdflatex mylatex.ltx mwe.tex
```
In particular, this is helpful in view of requirement 1.
* After own research, I have found that a system call
```
pdflatex -ini \&pdflatex mylatexformat.ltx mwe.tex
```
would be the more recent way to do this.
My custom minimal non-working example
=====================================
Using the previous information and shortcomings in view of my requirements, I intend so sole this problem in the following steps:
1. Modify the `$pdflatex` variable in `.latexmkrc` to require a precompiled preamble `mwe.fmt` file.
2. Use `add_cus_dep('tex', 'fmt', 1, 'precompilepreamble');` to add a dependency.
3. Define the perl subroutine `precompilepreamble` to create the `mwe.fmt` file if necessary.
I expect the program to behave in the following way:
1. Call `latexmk`, which loads my custom `.latexmkrc` configuration.
2. First run of `pdflatex` fails, and will log the missing required file `mwe.fmt`.
3. `latexmk` decides an additional run is needed, and will look up the dependencyies for `.fmt`.
4. Accordingly, `latexmk` will run the custom rule I added previously to generate `mwe.fmt`.
5. Afterwards, `latexmk` will run my modified `$pdflatex` again and continue sucessfully.
Attached you find the required files:
`mwe.tex`
---------
```
\documentclass{scrbook}
\usepackage{pgfplots}
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{lipsum}
\begin{document}
\title{Shakespeare's Externalize}
\subtitle{To externalize or not to externalize?}
\subject{Case Studies}
\date{\today}
\maketitle{}
\lipsum[1-20]
\end{document}
```
`.latexmkrc`
------------
```
# ensure_path( 'TEXINPUTS', './src/' );
# ensure_path( 'TEXINPUTS', '../src/' );
# Set the program used to generate the PDF
# 1: pdflatex
# 2: postscript conversion, don't use this
# 3: dvi conversion, don't use this
# 4: lualatex
# 5: xelatex
$pdf_mode = 1;
# Add custom dependency.
# latexmk checks whether a file with ending as given in the 2nd
# argument exists ('toextension'). If yes, check if file with
# ending as in first argument ('fromextension') exists. If yes,
# run subroutine as given in fourth argument.
# Third argument is whether file MUST exist. If 0, no action taken.
add_cus_dep('tex', 'fmt', 1, "compilepreamble");
# show custom dependencies for debugging
show_cus_dep();
# parse missing files
push @file_not_found, '^I can\'t find the format file `(.*)\'\!';
sub compilepreamble {
my ( $base) = @_;
# just output a simple debug string to console
print ("**** compilepreamble: ( $base ) ****\n");
# create the fmt file
$ret = system("pdflatex",
"-jobname", "$base",
"-ini",
"&pdflatex" ,
"mylatexformat.ltx",
$base
);
# if there were errors, return the error codes
return $ret;
}
# modify $pdflatex to use custom format
$pdflatex = 'pdflatex -fmt mwe %B %O %S';
```
Observed Behaviour
==================
Instead of `pdflatex` failing, it tries to run `mktexfmt`:
```
$ latexmk -g
Custom dependency list:
tex fmt 1 compilepreamble
Rc files read:
.latexmkrc
Latexmk: This is Latexmk, John Collins, 7 Jan. 2023. Version 4.79.
Force everything to be remade.
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': Reasons for rerun
Category 'other':
Rerun of 'pdflatex' forced or previously required
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex -fmt mwe -recorder "mwe.tex"'
------------
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=mwe)
restricted \write18 enabled.
kpathsea: Running mktexfmt mwe.fmt
mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order):
...
I can't find the format file `mwe.fmt'!
Latexmk: fls file doesn't appear to have been made.
Latexmk: Getting log file 'mwe.log'
Latexmk: Couldn't read log file 'mwe.log':
No such file or directory
```
Question
========
1. How can I prevent `latexmk`, or rather, `pdflatex` from trying to run `mktexfmt`?
2. The line `I can't find the format file `mwe.fmt'!` is only output to console and no `mwe.log` is generated, which makes reruns impossible, and does not detect my custom dependency. How can I change this behaviour?
3. I could inject a custom subroutine into `$pdflatex`, which would then check if the format file exists, and possibly create it if not. This could even be combined with a hashing process, to ensure only recompilation if needed and ... oh my, I notice I am copying the functionality of `latexmk`. So, is there a way to do this in `latexmk` in the first place?
I'm also looking forward to hearing other suggestions.
|
https://tex.stackexchange.com/users/53868
|
latexmk with precompiled preamble
| true |
The excellent answer by David Carlisle has lead me to discovering a way how my goals can be achieved using pure `latexmk`, so I am going to share my solution and see how it might be able to be improved.
Solution
========
As noted by David Carlisle,
>
>
> ```
> $ pdftex --no-mktex=fmt --fmt mwe file
> This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=mwe)
> restricted \write18 enabled.
> I can't find the format file `mwe.fmt'!
>
> ```
>
> shows a run that does not trigger mktexfmt
>
>
>
and it seems I was not able to read the document right to put in the option `--no-mktex=fmt`.
As noted by David Carlisle as well, this run does not log to a respective log file, so no rerun for `latexmk` is triggered.
My solution revolves around chenging the output stream from stdout to a logfile, which can be entirely achieved in `.latexmkrc`:
`mwe.tex`
---------
```
\documentclass{scrbook}
\usepackage{pgfplots}
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{lipsum}
\usepackage{geometry}
\begin{document}
\title{Shakespeare's Externalize}
\subtitle{To externalize or not to externalize?}
\subject{Case Studies}
\date{\today}
\maketitle{}
\lipsum[1-30]
\end{document}
```
`.latexmkrc`
------------
```
# Set the program used to generate the PDF
# 1: pdflatex
# 2: postscript conversion, don't use this
# 3: dvi conversion, don't use this
# 4: lualatex
# 5: xelatex
$pdf_mode = 1;
# Add custom dependency.
# latexmk checks whether a file with ending as given in the 2nd
# argument exists ('toextension'). If yes, check if file with
# ending as in first argument ('fromextension') exists. If yes,
# run subroutine as given in fourth argument.
# Third argument is whether file MUST exist. If 0, no action taken.
add_cus_dep('tex', 'fmt', 1, "compilepreamble");
# show custom dependencies for debugging
show_cus_dep();
# parse missing files
push @file_not_found, '^I can\'t find the format file `(.*)\'\!';
# modify all tex engines to run with my customized instruction set
# in particular:
# - suppress mktexfmt using --no-mktexfmt=fmt
# - request use of custom format using --fmt=%B
# - call additional options provided to latexmk using %O
# - call the source file %S
set_tex_cmds("--shell-escape --interaction=batchmode --file-line-error --synctex=1 --no-mktex=fmt --fmt=%B %O %S > %B.log");
# custom sub handling the loading of the preamble and dumping it into $base.fmt
sub compilepreamble {
my ( $base) = @_;
# just output a simple debug string to console
print ("**** compilepreamble: ( $base ) ****\n");
# create the fmt file
$ret = system("pdflatex",
"-jobname", "$base",
"-ini",
"&pdflatex" ,
"mylatexformat.ltx",
$base
);
# if there were errors, return the error codes
return $ret;
}
```
Comments
========
1. My solution seems create the fmt on first run, and reuse it in subsequent runs.
2. My solution does trigger a rebuild of the `mwe.fmt` file each time one calls `latexmk` after the file `mwe.tex` has changed. It does not make a distinction, whether the change has been made in the document or the preamble. This is a bit of a shortcoming, however, in my usecase it can be neglected, as
* most content resides in their own files and is placed using `\input{}`
* the relevant savings in compilation time will occurr during reruns for externalization of graphics.
If anyone wants to suggest improvements, I'll gladly hear them.
|
2
|
https://tex.stackexchange.com/users/53868
|
690435
| 320,284 |
https://tex.stackexchange.com/questions/602755
|
2
|
I am trying to install Acrotex to use eforms.
I am running on Ubuntu.
I did
```
sudo -i tlmgr update --list
(running on Debian, switching to user mode!)
/usr/bin/tlmgr: unexpected return value from verify_checksum: -5
```
So I tried to remove everything then
```
apt-get remove 'texlive-*'
apt-get install texlive
```
Unfortunately, it seems to install texlive 2019, not the 2021 :(
```
$ tlmgr --version
tlmgr revision 53568 (2020-01-27 19:20:16 +0100)
tlmgr using installation: /usr/share/texlive
TeX Live (http://tug.org/texlive) version 2019
$ tlmgr --verify-repo=none install acrotex
(running on Debian, switching to user mode!)
tlmgr: Local TeX Live (2019) is older than remote repository (2021).
Cross release updates are only supported with
update-tlmgr-latest(.sh/.exe) --update
See https://tug.org/texlive/upgrade.html for details.
```
I even tried
```
$ wget https://mirror.ox.ac.uk/sites/ctan.org/systems/texlive/tlnet/update-tlmgr-latest.sh
$ sudo ./update-tlmgr-latest.sh
Verifying archive integrity... All good.
Uncompressing TeX Live Manager Updater 100%
./runme.sh: Cannot find TeX Live root using kpsewhich --var-value=SELFAUTOPARENT.
./runme.sh: (no tlpkg/texlive.tlpdb and/or tlpkg/tlpobj/.)
./runme.sh: Please set your PATH as needed, otherwise it's hopeless.
```
How can I install a package with TeX Live?
|
https://tex.stackexchange.com/users/85416
|
How to install a LaTeX package in Ubuntu?
| false |
This example is with the package [`acrotex`](https://ctan.org/pkg/acrotex) with TeX Live and Ubuntu.
Create the path `/usr/local/share/texmf/tex/latex/` end extract the package [`acrotex`](https://ctan.org/pkg/acrotex) to this path. Then run the following commands wtih root permissions:
```
tex eforms.ins
tex dljslib.ins
tex insdljs.ins
tex taborder.ins
tex acrotex.ins
```
And then run finally `sudo texhash`.
|
1
|
https://tex.stackexchange.com/users/112986
|
690436
| 320,285 |
https://tex.stackexchange.com/questions/690235
|
3
|
I am preparing a syllabus book containing a number of courses. For each course, I have an enumerated list of course objectives. Then I have units/modules under the course that addresses those objectives. I want to automate this referencing process. So far, I have created the followings:
1. A code unique for each course: `\def\ccode{H11}`
2. An `enumerate` list for the course objectives:
```
\newlist{obj}{enumerate}{1}
\setlist[obj,1]{itemsep=0pt,
label=\fbox{\ccode-CO\arabic*},
align=left,
labelindent=0pt,
ref=\ccode-CO\arabic*
}
```
3. A counter for `\label` purpose:
```
\newcounter{ocount}
\newcommand\objectno{\refstepcounter{ocount}\arabic{ocount}}
\preto\enumerate{\setcounter{ocount}{0}}
```
4. And finally, I call the `label`s as arguments inside the following table:
```
\newcommand{\usummary}[4]{%
\begingroup%
\def\arraystretch{1.3}%
\begin{longtable}{|P @{\hspace{0.005\linewidth}} |Q|}%
\hline%
\textbf{Unit:} #1 & \textbf{\small Objectives mapped:} \ref{#3}\\
\hline
\textbf{Credits:} #2 & \textbf{\small RBT levels achieved:} #4\\
\hline%
\end{longtable}%
\endgroup%
}
```
However, the final product fails to compile with following message: `Missing \endcsname inserted. \item \label{\ccode\objectno}`. Please help. Below is a full MWE:
```
\documentclass[a5paper, twoside]{article}
\usepackage{enumitem}
\usepackage{hyperref}
%
\usepackage{longtable, array, etoolbox}
%
\newcolumntype{P}{%
>{%
\raggedright
\let\newline\\%
\arraybackslash\hspace{0pt}%
}%
p{0.16\linewidth}%
}
\newcolumntype{Q}{%
>{%
\raggedright
\let\newline\\%
\arraybackslash\hspace{0pt}%
}%
p{0.78\linewidth}%
}
%
\newcommand{\usummary}[4]{%
\begingroup%
\def\arraystretch{1.3}%
\begin{longtable}{|P @{\hspace{0.005\linewidth}} |Q|}%
\hline%
\textbf{Unit:} #1 & \textbf{\small Objectives mapped:} \ref{#3}\\
\hline
\textbf{Credits:} #2 & \textbf{\small RBT levels achieved:} #4\\
\hline%
\end{longtable}%
\endgroup%
}
%
\def\ccode{H11}
%
\newlist{obj}{enumerate}{1}
\setlist[obj,1]{itemsep=0pt,
label=\fbox{\ccode-CO\arabic*},
align=left,
labelindent=0pt,
ref=\ccode-CO\arabic*
}
%
\newcounter{ocount}
\newcommand\objectno{\refstepcounter{ocount}\arabic{ocount}}
\preto\enumerate{\setcounter{ocount}{0}}
%
%
%
\begin{document}
%
\subsubsection{Objectives}
%
The students will be able to
\begin{obj}
\item \label{\ccode\objectno}
Remember the important inequalities.
\item \label{\ccode\objectno}
Apply the appropriate inequality for specific problems.
\item \label{\ccode\objectno}
Understand the fundamental properties of polynomials, including their degree, leading coefficient, and the relationship between roots and coefficients.
\item \label{\ccode\objectno}
Apply transformation techniques to manipulate equations, including the ability to shift and reflect graphs of polynomial functions.
\item \label{\ccode\objectno}
Solve cubic and biquadratic equations using appropriate methods, such as Cardan’s method and Ferrari’s method.
\item \label{\ccode\objectno}
Analyse and solve reciprocal and binomial equations, demonstrating proficiency in identifying and manipulating these specific equation types.
\item \label{\ccode\objectno}
Utilise knowledge of symmetric functions of roots to determine relationships and patterns among the roots of polynomial equations.
\item \label{\ccode\objectno}
Apply strategies to determine the location of roots, including the use of intermediate value theorem, Descartes' rule of signs, graphical methods and Strum's function.
\item \label{\ccode\objectno}
Understand basic structure of Argand plane and perform algebra thereat.
\item \label{\ccode\objectno}
Develop a solid understanding of geometric principles and terminology, laying the groundwork for further exploration in advanced mathematics and related fields.
\item \label{\ccode\objectno}
Examine essential geometric objects, including pairs of straight lines, circles, and conic sections. They will learn to analyse and manipulate these objects, investigating their properties, equations, and relationships.
\item \label{\ccode\objectno}
Analyse geometric objects, employ coordinate systems, derive equations, and apply geometric concepts to solve problems.
\end{obj}
%
\subsubsection{Content}
%
\usummary{1}{1}{\ref{\ccode1,\ccode2}}{Remembering, Understanding, Applying}
\end{document}
```
|
https://tex.stackexchange.com/users/162028
|
Automated labelling and references in enumerate list
| true |
The issue is that `\objectno` is not expandable. So, if you do it in another way you can get what you are looking for.
The `enumitem` list already have the counter on it. So you can take advantage of it and use `\the<ListName><level>` macro. In your case `\theobji`. If you put this in a macro, lets say
```
\newcommand\alabel{\label{\theobji}}
```
you can have more flexibility when redefining it. Due to the re-definition of the list, the label is stored with an extra pair of brackets (I don't know why). So, you need to refer to it with these extra brackets as well. That is why you see `\ref{{\ccode-CO1}}` instead. Note that the labels are tied to the definition of the reference in the list creation (`ref={\ccode-CO\arabic*}`).
Code
====
```
\documentclass[a5paper]{article}
\pagestyle{empty}
\usepackage{enumitem}
\usepackage{hyperref}
\usepackage{longtable, array}
\newcolumntype{P}{%
>{%
\raggedright
\let\newline\\%
\arraybackslash\hspace{0pt}%
}%
p{0.16\linewidth}%
}
\newcolumntype{Q}{%
>{%
\raggedright
\let\newline\\%
\arraybackslash\hspace{0pt}%
}%
p{0.78\linewidth}%
}
%
\newcommand{\usummary}[4]{%
\begingroup%
\def\arraystretch{1.3}%
\begin{longtable}{|P @{\hspace{0.005\linewidth}} |Q|}%
\hline%
\textbf{Unit:} #1 & \textbf{\small Objectives mapped:} \ref{#3}\\
\hline
\textbf{Credits:} #2 & \textbf{\small RBT levels achieved:} #4\\
\hline%
\end{longtable}%
\endgroup%
}
\def\ccode{H11}
\newlist{obj}{enumerate}{1}
\setlist[obj,1]{
itemsep=0pt,
label=\fbox{\ccode-CO\arabic*},
align=left,
labelindent=0pt,
ref={\ccode-CO\arabic*},
}
\newcommand\alabel{\label{\theobji}}
\begin{document}
\section{Objectives}
The students will be able to
\begin{obj}
\item \alabel
Remember the important inequalities.
\item \alabel
Apply the appropriate inequality for specific problems.
\item \alabel
Understand the fundamental properties of polynomials, including their degree, leading coefficient, and the relationship between roots and coefficients.
\end{obj}
\section{Content}
\usummary{1}{1}{{\ccode-CO1}}{Remembering, Understanding, Applying}
\end{document}
```
List of references (addition)
=============================
`cleveref` requires to redefine a name for the counter (I left it empty with `\crefname{obji}{}{}`), and doesn't work with the expansion from the reference in `enumitem`.
In this version you need to define the pattern using the number form of the counter `\arabic{obji}`. This also solves the issue of the double bracket. Note that you don't require to have a different pattern (`l-\ccode-CO\arabic{obji}`) w.r.t. the list, but it may help to differentiate between the examples.
The code with the example is below.
```
\documentclass[a5paper]{article}
\pagestyle{empty}
\usepackage{enumitem}
\usepackage{hyperref}
\usepackage{longtable, array}
\usepackage{cleveref}
\newcolumntype{P}{%
>{%
\raggedright
\let\newline\\%
\arraybackslash\hspace{0pt}%
}%
p{0.16\linewidth}%
}
\newcolumntype{Q}{%
>{%
\raggedright
\let\newline\\%
\arraybackslash\hspace{0pt}%
}%
p{0.78\linewidth}%
}
%
\newcommand{\usummary}[4]{%
\begingroup%
\def\arraystretch{1.3}%
\begin{longtable}{|P @{\hspace{0.005\linewidth}} |Q|}%
\hline%
\textbf{Unit:} #1 & \textbf{\small Objectives mapped:} \cref{#3}\\
\hline
\textbf{Credits:} #2 & \textbf{\small RBT levels achieved:} #4\\
\hline%
\end{longtable}%
\endgroup%
}
\def\ccode{H11}
\newlist{obj}{enumerate}{1}
\setlist[obj,1]{
itemsep=0pt,
label=\fbox{\ccode-CO\arabic*},
align=left,
labelindent=0pt,
ref={\ccode-CO\arabic*},
}
% empty names
\crefname{obji}{}{}
\newcommand\alabel{\label{l-\ccode-CO\arabic{obji}}}
\begin{document}
\section{Objectives}
The students will be able to
\begin{obj}
\item \alabel
Remember the important inequalities.
\item \alabel
Apply the appropriate inequality for specific problems.
\item \alabel
Understand the fundamental properties of polynomials, including their degree, leading coefficient, and the relationship between roots and coefficients.
\end{obj}
\section{Content}
\usummary{1}{1}{l-\ccode-CO1,l-\ccode-CO2}{Remembering, Understanding, Applying}
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/7561
|
690441
| 320,286 |
https://tex.stackexchange.com/questions/690416
|
4
|
The following code causes an error when I try to compile it.
```
\documentclass{book}
\RequirePackage{lastpage}
\RequirePackage[polutonikogreek]{babel}
\RequirePackage[babel=true]{microtype}
\begin{document}
\frontmatter
Test
\end{document}
```
The error is
>
> ./bac\_a\_sable.tex:12: Missing \endcsname inserted.
> \MT@#1@context l.12 \end{document}
>
>
>
Does the problem happen when you try? If yes, would you have a hack to solve the issue?
Thanks
|
https://tex.stackexchange.com/users/8323
|
Clash between packages: lastpage, babel and microtype
| true |
Ulrike pointed out the issue that `lastpage`has and which should be corrected by its author, so perhaps you should file a bug report with him.
The LaTeX Companion, 3rd edition, suggests the following as an alternative to lastpage:
```
\AddToHook{shipout/lastpage}{\label{LastPage}}
```
If you add this to the preamble instead of loading the package it might be all that is needed for your use case.
|
8
|
https://tex.stackexchange.com/users/10109
|
690444
| 320,288 |
https://tex.stackexchange.com/questions/690440
|
1
|
The following MWE shows the error with `tex4ebook` named in the question, when running `epubcheck`. It gives (in the MWE) 3 identical error messages:
```
\documentclass[a4paper]{report}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[rm,sc,small]{titlesec}
\renewcommand{\thesection}{\arabic{section}}
\titleformat{\section}[display]%
{}%
{\Huge\centering\textbf{\thesection}}%
{0.2\textheight}{}%
[]
\begin{document}
\clearpage
\section{}
Some first little poem.
\clearpage
\section{}
Some second little poem.
\clearpage
\section{}
Some third little poem.
\end{document}
```
First I thought it has to do with the empty sectioning text, but that is not the problem. The error remains when giving a section-title.
|
https://tex.stackexchange.com/users/292824
|
tex4ebook: invalid attribute value error
| false |
This is caused by the `sectionid` filter from `make4ht`. It creates unique ID for each section based on it's name. When the section name is empty, it sets the empty ID for the first section, and then adds numerical suffixes, because it detects duplicate name (the empty name). `epubcheck` reports these epmty and numerical IDs as errors.
I've fixed this in the development version of `make4ht`, it now adds a `_` prefix, so the ID should be valid. If you don't want to use the development version, you can disable `make4ht` filters using this command:
```
$ tex4ebook -f epub-common_domfilters filename.tex
```
This should prevent creation of IDs for sections, but it can lead to other problems, depending on your document.
|
0
|
https://tex.stackexchange.com/users/2891
|
690454
| 320,292 |
https://tex.stackexchange.com/questions/52576
|
53
|
When compiling my LaTeX file, I received this warning message.
Though I got the PDF file, I still want to know why this warning comes and how to fix it.
It occurs in this line.
```
\paragraph{Plane stress} Plane state of stress, a.k.a. plane stress, is a state of stress in which\[\sigma_{33}=\sigma_{31}=\sigma_{32}=0.\]
```
---
```
Warning: Difference (2) between bookmark levels is greater(hyperref) than one,
level fixed on input line 97. Difference (2) between bookmark levels
is greater(hyperref) than one, level fixed.
```
The question may be seemed dummy to some TeX experts, but as a newbie here, I really don't know how it comes.
I attempt to write two subsubsections, but without numbering them. So I choose the command `\paragraph`. Is there any work-arounds?
|
https://tex.stackexchange.com/users/11396
|
Difference between bookmark levels greater than one - what does this mean?
| false |
The accepted answer is very good, but to put this in less practical and more philisophical terms, this issue is common when using `\paragraph` within a `\section` or `\subsection`. The fundamental issue is that wanting a themed paragraph is not really dependent on the section structure, so it makes sense to have a `\paragraph` in a section with no subsections. In contrast, subsections are explicitly semantically dependent on sections so they are mostly not affected by this problem. Therefore, filling out the hierarchy with unnecessary subsubsections or promoting the `\paragraph` to a `\subsubsection` (or worse, to a `\subsection`) may not be good solutions. Accepting that the ToC will be inconsistently indented is a possibility, but not a solution.
@ilpssun has mentioned this in a comment to the accepted answer, but I feel this deserves more visibility:
It may be preferable to simply exclude `\paragraph`s from the ToC. For this, `\setcounter{tocdepth}{3}` somewhere before `\tableofcontents` will add only chapters, sections subsections, and subsubsections to the ToC. `\setcounter{tocdepth}{3}` will remove subsubsections, etc.
|
1
|
https://tex.stackexchange.com/users/167235
|
690460
| 320,295 |
https://tex.stackexchange.com/questions/690476
|
4
|
Google Fonts has a [table](https://fonts.google.com/specimen/Kablammo/glyphs?preview.text=Hadis%20and%20Matin&preview.text_type=custom) associated with different glyphs of the Kablammo font, but I can't find any matrix of codes according to which `\symbol{glyph code}` may be called. Can one explain how I can do this using LuaLaTeX?
|
https://tex.stackexchange.com/users/300288
|
How can I call a particular glyph of the Kablammo font in LuaLaTeX?
| true |
The glyphs are in their standard Unicode position.
```
\documentclass{article}
\usepackage{fontspec}
\newfontface{\kablammo}{Kablammo-Regular.ttf}
\begin{document}
{\kablammo aáäbcdȱ}
\end{document}
```
|
4
|
https://tex.stackexchange.com/users/4427
|
690477
| 320,302 |
https://tex.stackexchange.com/questions/690484
|
1
|
I'd like to have the "theorem name" of a theorem be populated using a variable. It isn't working as I had hoped, see below. I'm especially confused because I can successfully get the "proof name" of a proof environment be populated by a variable, and the two seem analogous. Can anyone suggest a workaround?
```
\documentclass{article}
\usepackage{amsthm}
\def\thmname{baz}
\newtheorem*{theorem}{Theorem}
\begin{document}
% Expected behavior.
% Result displays as Theorem (foo). Hello world.
\begin{theorem}[foo]
Hello world.
\end{theorem}
% Unexpected behavior.
% Result displays as Theorem (). Hello world.
\begin{theorem}[\thmname]
Hello world.
\end{theorem}
% Expected behavior.
% Result displays as Theorem. baz.
\begin{theorem}
\thmname.
\end{theorem}
% Expected behavior.
% Result displays as baz. Hello world.
\begin{proof}[\thmname]
Hello world.
\end{proof}
\end{document}
```
|
https://tex.stackexchange.com/users/300291
|
How to use a variable in a thmnote
| false |
Changing the variable name from `thmname` to `bopthmname` fixed this! Presumably, the variable name `thmname` was already taken and my use was conflicting.
It was blind luck that I ever figured this out ... hat tip to <https://stackoverflow.com/a/3188476> which had some comments on this kind of pitfall.
|
0
|
https://tex.stackexchange.com/users/300291
|
690485
| 320,306 |
https://tex.stackexchange.com/questions/690484
|
1
|
I'd like to have the "theorem name" of a theorem be populated using a variable. It isn't working as I had hoped, see below. I'm especially confused because I can successfully get the "proof name" of a proof environment be populated by a variable, and the two seem analogous. Can anyone suggest a workaround?
```
\documentclass{article}
\usepackage{amsthm}
\def\thmname{baz}
\newtheorem*{theorem}{Theorem}
\begin{document}
% Expected behavior.
% Result displays as Theorem (foo). Hello world.
\begin{theorem}[foo]
Hello world.
\end{theorem}
% Unexpected behavior.
% Result displays as Theorem (). Hello world.
\begin{theorem}[\thmname]
Hello world.
\end{theorem}
% Expected behavior.
% Result displays as Theorem. baz.
\begin{theorem}
\thmname.
\end{theorem}
% Expected behavior.
% Result displays as baz. Hello world.
\begin{proof}[\thmname]
Hello world.
\end{proof}
\end{document}
```
|
https://tex.stackexchange.com/users/300291
|
How to use a variable in a thmnote
| false |
While you've already figured out the **why**, here's a suggestion on how you can avoid it in the future.
**Don't use `\def`, use `\newcommand`.** (Unless you really, really know what you are doing.)
One of the features of `\newcommand` is that it performs a check so that you don't overwrite macros defined elsewhere already. If you had used `\newcommand\thmname{baz}` instead of `\def...`, LaTeX would've complained:
```
(/usr/share/texmf-dist/tex/latex/amscls/amsthm.sty)
! LaTeX Error: Command \thmname already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
```
|
2
|
https://tex.stackexchange.com/users/119
|
690486
| 320,307 |
https://tex.stackexchange.com/questions/690466
|
1
|
I would like to create a template that provides some kind of interface for entering content. Some of the content should be repeated in multiple places in a final document, but I don't want to write duplicates in code. In fact, I want to let the template decide how to structure the content I give it. Let me try with an example. This is how I imagine my template:
```
\begin{document}
\section*{Products}
\begin[itemize}
% for each product in the list of products
% \item product.name - product.description
\end{itemize}
\section*{Prices}
\begin{itemize}
% for each product in list of products
% \item product.name: product.price
\end{itemize}
\end{document}
```
I would like the template to provide interface for defining list of products, and use it something like this in my main tex file:
```
\begin{products}
\product{Product 1}{description for product 1}{\$10}
\product{Product 2}{description for product 2}{\$20}
\end{products}
```
The final document should look like this:
```
\begin{document}
\section*{Products}
\begin[itemize}
\item Product 1 - description for product 1
\item Product 2 - description for product 2
\end{itemize}
\section*{Prices}
\begin{itemize}
\item Product 1: \$10
\item Product 2: \$20
\end{itemize}
\end{document}
```
I might want another template that structures the products differently. Ideally, I would just change the template file. In other words, the main file that defines list of products should not care how the products will be structured, it only provides data.
I might want to have template that would present data like this:
```
\section*{Products}
\begin{itemize}
% for each product in the list of products
% \item product.name \(product.price\) - product.description
\end{itemize}
```
or
```
\begin{tabular}{lll}
% for each product in the list of products
% product.name & product.price & product.description \\
\end{tabular}
```
or
```
\section*{Products}
\begin{itemize}
% for each product in list of products
% \item.product.name - product.description
\end{itemize}
% some other sections here that have nothing to do with products
\section*{Prices}
...
```
and it should all work with the same data file. Imagine REST API how it provides data and different applications can display it in different ways. That's kind of thing that I am trying to achieve here - have a file in which I provide data that can be displayed in different ways which are defined by templates.
I've only used LaTeX for basic stuff so I don't know even if this is possible.
|
https://tex.stackexchange.com/users/300283
|
Create LaTeX template with an interface for entering content
| false |
This can be accomplished rather easily with LaTeX. Here I use pgfkeys because among other things this makes it easy to have spaces in the descriptions and it has a very convenient syntax for iterating over lists. For the convenience of those who want to play with this code I put everything in one file but in real-life applications you may want to separate the data file from the template file.
```
\documentclass{article}
\usepackage{pgffor}
% this creates a data file which you can separate this from the template file
\begin{filecontents*}{ProductData.tex}
\pgfkeys{/products/.cd,
name/.initial={},
description/.initial={},
price/.initial={},
1/.style={name=iPad,description=Medium-sized tablet,price={\$1,000}},
2/.style={name=iPhone,description=Smartphone,price=\$8000},
3/.style={name=goat cheese,description=cheese made from goat milk,price=\$10},
4/.style={name=Emmentaler,description=Swiss cheese made from cow milk,price=\$8},
product description/.code={\item \pgfkeys{/products/.cd,#1}\pgfkeysvalueof{/products/name} --- \pgfkeysvalueof{/products/description}},
descriptions/.code={\section*{Products}
\begin{itemize}
\pgfkeys{/products/product description/.list={#1}}
\end{itemize}},
product price/.code={\item \pgfkeys{/products/.cd,#1}\pgfkeysvalueof{/products/name}: \pgfkeysvalueof{/products/price}},
prices/.code={\section*{Prices}
\begin{itemize}
\pgfkeys{/products/product price/.list={#1}}
\end{itemize}}}
\end{filecontents*}
\input{ProductData.tex}
\begin{document}
\pgfkeys{/products/.cd,
descriptions={1,2},
prices={1,...,4}}
\end{document}
```
Once you have your data file, you only need a very short template file.
```
\documentclass{article}
\usepackage{pgffor}
\input{ProductData.tex}
\begin{document}
\pgfkeys{/products/.cd,
descriptions={1,2},
prices={1,...,4}}
\end{document}
```
Also, you can add keys later easily.
|
3
|
https://tex.stackexchange.com/users/nan
|
690490
| 320,309 |
https://tex.stackexchange.com/questions/690498
|
6
|
I have this nice code snippet to generate a [DI table](https://en.wikipedia.org/wiki/Integration_by_parts#Tabular_integration_by_parts) for integration by parts:
```
\documentclass{article}
\usepackage{xparse}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{pgffor}
\usepackage{mathtools}
\usepackage{nicematrix}
\usepackage{booktabs}
\usepackage{physics}
\usepackage{listofitems}
\usepackage{derivative}
\begin{document}
\[
\begin{NiceArray}{cc@{\hspace*{1.0cm}}c}[create-medium-nodes, cell-space-limits=5pt]
\toprule
& D & I \\
\cmidrule{2-3}
+ & x^2 & e^x \\
- & 2x & e^x \\
+ & 2 & e^x \\
- & 0 & e^x \\
\bottomrule
\CodeAfter
\begin{tikzpicture}[->, name suffix = -medium]
\draw[red] (2-2) -- node [above] {} (3-3);
\draw[red] (3-2) -- node [above] {} (4-3);
\draw[red] (4-2) -- node [above] {} (5-3);
\end{tikzpicture}
\end{NiceArray}
\]
\[ \int x^2 e^x \odif{x} = x^2 e^x - 2x e^x + 2e^x + C \]
\end{document}
```
I wanted to write an `xparse` command for this code so I don't have to copy-paste it every time I do integration by parts and so that I don't have to manually modify the code when the number of rows changes. The problem is I need to use some form of a for loop to generate the rows, the alternating signs, and the arrows.
I tried to use the `lisofitems` package to have the command take a list of rows for the table and the `pgffor` package for the loops and I ended up with this code:
```
\documentclass{article}
\usepackage{xparse}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{pgffor}
\usepackage{mathtools}
\usepackage{nicematrix}
\usepackage{booktabs}
\usepackage{physics}
\usepackage{listofitems}
\usepackage{derivative}
\NewDocumentCommand{\DI}{ m }{
\setsepchar{;/,}
\readlist\lines{#1}
\begin{NiceArray}{cc@{\hspace*{1.0cm}}c}[create-medium-nodes, cell-space-limits=5pt]
\toprule
& D & I \\
\cmidrule{2-3}
\foreach \i in {1,...,\lineslen}{
\ifodd\i+\else-\fi & \lines[\i, 1] & \lines[\i, 2] \\
}
\bottomrule
\CodeAfter
\begin{tikzpicture}[->, name suffix = -medium]
\foreach \i in {2,...,\lineslen}{
\pgfmathtruncatemacro{\prev}{\i-1}
\draw[red] (\prev-2) -- node [above] {} (\i-3);
}
\end{tikzpicture}
\end{NiceArray}
}
\begin{document}
\[ \DI{x^2,e^x ; 2x,e^x ; 2,e^x ; 0,e^x} \]
\[ \int x^2 e^x \odif{x} = x^2 e^x - 2x e^x + 2e^x + C \]
\end{document}
```
However, this code doesn't compile and produces errors, and I can't figure out what is wrong. I couldn't manage to figure out how to use for loops to generate the rows.
As you can see from the example, I'd like this command to have a syntax of:
`\DI{D1,I1 ; D2,I2 ; ...}`
where each pair is a row of the table. The alternating signs and the arrows should be taken care of automatically.
If someone could explain why my attempt failed and how to fix it, I'd highly appreciate it. A different solution that uses packages other than `listofitems` and `pgffor` is also acceptable as long as it produces the correct output.
|
https://tex.stackexchange.com/users/274542
|
How to use for loops in a custom command?
| false |
The following works by using the L3-programming language.
```
\documentclass{article}
\usepackage{mathtools}
\usepackage{nicematrix}
\usepackage{tikz}
\usepackage{booktabs}
\usepackage{derivative}
\ExplSyntaxOn
\seq_new:N \l_shaiavr_items_seq
\tl_new:N \g_shaiavr_sign_tl
\NewDocumentCommand{\DI}{ m }
{
\seq_set_split:Nnn \l_shaiavr_items_seq { ; } {#1}
\tl_gset:Nn \g_shaiavr_sign_tl { + }
\begin{NiceArray}{cc@{\hspace*{1.0cm}}c}[create-medium-nodes, cell-space-limits=5pt]
\toprule
& D & I \\
\cmidrule{2-3}
\seq_map_function:NN \l_shaiavr_items_seq \__shaiavr_line_formatter:n
\bottomrule
\CodeAfter
\begin{tikzpicture}[->, name~ suffix = -medium]
\int_step_inline:nnn {2} { \seq_count:N \l_shaiavr_items_seq }
{ \draw[red] (##1 - 2) -- (\int_eval:n { ##1 + 1 } -3); }
\end{tikzpicture}
\end{NiceArray}
}
\cs_new_protected:Npn \__shaiavr_line_formatter:n #1
{
\g_shaiavr_sign_tl & \clist_item:nn {#1} { 1 } & \clist_item:nn {#1} { 2 }
\tl_if_eq:NnTF \g_shaiavr_sign_tl { + }
{ \tl_gset:Nn \g_shaiavr_sign_tl { - } }
{ \tl_gset:Nn \g_shaiavr_sign_tl { + } }
\\
}
\ExplSyntaxOff
\begin{document}
\[ \DI{x^2,e^x ; 2x,e^x ; 2,e^x ; 0,e^x} \]
\[ \int x^2 e^x \odif{x} = x^2 e^x - 2x e^x + 2e^x + C \]
\end{document}
```
|
5
|
https://tex.stackexchange.com/users/117050
|
690502
| 320,314 |
https://tex.stackexchange.com/questions/690503
|
3
|
The following error appears in the console:
>
> Extra alignment tab has been changed to \cr
>
>
>
but I do not see where is missing in the code:
```
\documentclass{article}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage[a4paper, left=2cm, right=2cm, top=45mm, bottom=20mm]{geometry}
\usepackage[table]{xcolor}
\usepackage{multirow, array}
\usepackage{tabularx,booktabs}
\begin{document}
\begin{table}\centering
\begin{tabular}{@{}ccc@{}}\toprule
& \multicolumn{2}{c}{\textbf{Factors}}
& \cmidrule{2-3}
\textbf{Levels}& \textit{Solvent} & \textit{Water:Solvent mass ratio} \\ \midrule
\textit{1} & Water & 0 \\
\textit{2} & ChCl:2Gly & 0.40 \\
\textit{3} & ChCl:2Urea & 0.57 \\
\textit{4} & --- & 0.69 \\
\textit{5} & --- & 0.82 \\
\textit{6} & --- & 0.87 \\
\textit{7} & --- & 0.91 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
```
|
https://tex.stackexchange.com/users/234539
|
Extra alignment warning change table
| true |
Your first row has an `&` instead of `\\`:
```
\documentclass{article}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage[a4paper, left=2cm, right=2cm, top=45mm, bottom=20mm]{geometry}
\usepackage{multirow, array}
\usepackage{tabularx,booktabs}
\begin{document}
\begin{table}\centering
\begin{tabular}{@{}ccc@{}}\toprule
& \multicolumn{2}{c}{\textbf{Factors}}\\
\cmidrule{2-3} \textbf{Levels}& \textit{Solvent} & \textit{Water:Solvent mass ratio} \\ \midrule
\textit{1} & Water & 0 \\
\textit{2} & ChCl:2Gly & 0.40 \\
\textit{3} & ChCl:2Urea & 0.57 \\
\textit{4} & --- & 0.69 \\
\textit{5} & --- & 0.82 \\
\textit{6} & --- & 0.87 \\
\textit{7} & --- & 0.91 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
```
|
4
|
https://tex.stackexchange.com/users/36296
|
690504
| 320,315 |
https://tex.stackexchange.com/questions/690506
|
0
|
For having justified figure captions in my presentation, I'm using the `caption` package.
I would like to change the prefix of figures within a beamer presentation from "Figure" to "Supplementary Figure", I tried the following options (separately), but none of them had a success:
```
\renewcommand{\figurename}{Supplementary Figure} % no effect
\setbeamertemplate{caption}{\center\thefigure\insertcaption\par} % no effect
\captionsetup[figure]{name=S} % no effect
```
I would be greatful for any hint on whether this is possible with the `caption` package or maybe even with a pure solution in beamer (I just hadn't found a way to justify captions in beamer).
By using the following minimal working example, I could further pin down the problem: Calling `\renewcommand{\thefigure}{S\arabic{figure}}` only affects the caption on the same slide and unexpectedly not the captions on the following ones.
```
\documentclass[ignorenonframetext]{beamer}
\setbeamertemplate{caption}[numbered]
\begin{document}
\begin{frame}{Slide 1}
\begin{figure}
% \includegraphics{} here
\caption{First Test}
\end{figure}
\end{frame}
\begin{frame}{Slide 2}
\setcounter{figure}{0}
\renewcommand{\thefigure}{S\arabic{figure}} % only works on same slide
\begin{figure}
% \includegraphics{} here
\caption{Second Test}
\end{figure}
\end{frame}
\begin{frame}{Slide 3}
\begin{figure}
\caption{Third Test}
\end{figure}
\end{frame}
\end{document}
```
An obvious fix would be to call `\renewcommand{\thefigure}{S\arabic{figure}}` outside of the slide, but I'm using `\documentclass[ignorenonframetext]{beamer}`.
Is there nonetheless a more elegant way than calling `\renewcommand{\thefigure}{S\arabic{figure}}` on every slide?
|
https://tex.stackexchange.com/users/163251
|
Changing justified caption in beamer within document
| true |
Each frame is a group. If you want to make changes which affect all further frames, you should make them outside of the frame environment:
```
\documentclass{beamer}
\setbeamertemplate{caption}[numbered]
\begin{document}
\begin{frame}{Slide 1}
\begin{figure}
% \includegraphics{} here
\caption{First Test}
\end{figure}
\end{frame}
\setcounter{figure}{0}
\renewcommand{\thefigure}{S\arabic{figure}} % only works on same slide
\begin{frame}{Slide 2}
\begin{figure}
% \includegraphics{} here
\caption{Second Test}
\end{figure}
\end{frame}
\begin{frame}{Slide 3}
\begin{figure}
\caption{Third Test}
\end{figure}
\end{frame}
\end{document}
```
---
Personally, I would add such changes to the appendix
```
\documentclass[ignorenonframetext]{beamer}
\setbeamertemplate{caption}[numbered]
\apptocmd{\appendix}{
\setcounter{figure}{0}
\renewcommand{\thefigure}{S\arabic{figure}} % only works on same slide
}{}{}
\begin{document}
\begin{frame}{Slide 1}
\begin{figure}
% \includegraphics{} here
\caption{First Test}
\end{figure}
\end{frame}
\appendix
\begin{frame}{Slide 2}
\begin{figure}
% \includegraphics{} here
\caption{Second Test}
\end{figure}
\end{frame}
\begin{frame}{Slide 3}
\begin{figure}
\caption{Third Test}
\end{figure}
\end{frame}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/36296
|
690508
| 320,317 |
https://tex.stackexchange.com/questions/690503
|
3
|
The following error appears in the console:
>
> Extra alignment tab has been changed to \cr
>
>
>
but I do not see where is missing in the code:
```
\documentclass{article}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage[a4paper, left=2cm, right=2cm, top=45mm, bottom=20mm]{geometry}
\usepackage[table]{xcolor}
\usepackage{multirow, array}
\usepackage{tabularx,booktabs}
\begin{document}
\begin{table}\centering
\begin{tabular}{@{}ccc@{}}\toprule
& \multicolumn{2}{c}{\textbf{Factors}}
& \cmidrule{2-3}
\textbf{Levels}& \textit{Solvent} & \textit{Water:Solvent mass ratio} \\ \midrule
\textit{1} & Water & 0 \\
\textit{2} & ChCl:2Gly & 0.40 \\
\textit{3} & ChCl:2Urea & 0.57 \\
\textit{4} & --- & 0.69 \\
\textit{5} & --- & 0.82 \\
\textit{6} & --- & 0.87 \\
\textit{7} & --- & 0.91 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
```
|
https://tex.stackexchange.com/users/234539
|
Extra alignment warning change table
| false |
Sam Carter has shown the fix, but to give a comment on the error message, you only showed a fragment.
The error is:
```
! Extra alignment tab has been changed to \cr.
<template> \endtemplate
l.14 &
\cmidrule{2-3}
?
```
the l.14 tells you that tex was reading line 14, and the linebreak shows how far along the line it had got, so the error is issued immediately after reading the `&` on line 14 which you can then see is starting an undeclared column 4 after `& \multicolumn{2}{c}{\textbf{Factors}}`
The error message is telling you that tex will interpret that `&` as a `\cr` (`\\` ) which is actually the correct fix in this case (a pretty rare event for TeX recovery actions:-)
|
4
|
https://tex.stackexchange.com/users/1090
|
690511
| 320,319 |
https://tex.stackexchange.com/questions/12428
|
55
|
I am trying using minted to display some code in my document, but the code is long and spans over two pages, this works fine, however when I place my code inside
```
\begin{listing}
\inputminted{java}{code/JavaCode.java}
\caption{Some caption}
\label{label1}
\end{listing}
```
Then my code doesn't show up and I get the warning:
>
> LaTeX Warning: Float too large for page
>
>
>
I have tried using the option `H` in `listing`, but then the code shows in only one page and it doesn't fit so I only see a part of it.
I also tried with the code directly in the latex document ie:
```
\begin{listing}
\begin{minted}{java}
Java code
\end{minted}
\caption{Some caption}
\label{label1}
\end{listing}
```
But the same happens, any ideas?
|
https://tex.stackexchange.com/users/3912
|
Code spanning over two pages with minted, inside listing with caption
| false |
To solve this kind of problem I use two listings - split in half - in combination with `\ContinuedFloat`:
```
\begin{listing}
\ContinuedFloat*
\begin{codeblock}{}{C}
\cfile[lastline=33]{code/xxx.c}
\end{codeblock}
\caption{My caption}
\label{lst:xxx}
\end{listing}
\begin{listing}
\ContinuedFloat
\begin{codeblock}{}{C}
\cfile[firstline=35]{code/xxx.c}
\end{codeblock}
\caption{My caption (contd.)}
\end{listing}
```
Credit goes to: <https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions#Figures_in_multiple_parts>
|
0
|
https://tex.stackexchange.com/users/60134
|
690515
| 320,321 |
https://tex.stackexchange.com/questions/690516
|
0
|
This is the code,
```
% !TEX TS-program = lualatex
\documentclass[12pt]{article}
\usepackage[paperwidth=9in, paperheight=14in]{geometry}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{empheq}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{fontspec}
\usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math}
\setmainfont[%
ItalicFont=NewCM10-Italic.otf%
BoldFont=NewCM10-Bold.otf,%
BoldItalicFont=NewCM10-BoldItalic.otf,%
SmallCapsFeatures={Numbers=OldStyle}]{NewCM10-Regular.otf}
\setsansfont[%
ItalicFont=NewCMSans10-Oblique.otf,%
BoldFont=NewCMSans10-Bold.otf,%
BoldItalicFont=NewCMSans10-BoldOblique.otf,%
SmallCapsFeatures={Numbers=OldStyle}]{NewCMSans10-Regular.otf}
\setmonofont[ItalicFont=NewCMMono10-Italic.otf,%
BoldFont=NewCMMono10-Bold.otf,%
BoldItalicFont=NewCMMono10-BoldOblique.otf,%
SmallCapsFeatures={Numbers=OldStyle}]{NewCMMono10-Regular.otf}
\setmathfont{NewCMMath-Regular.otf}
\begin{document}
Stay back, I'm \textit{going} to do some \textbf{science}.
\end{document}
```
---
Error
```
~/.config/nvim/test5.tex 0:0 W Package lualatex-math Warning: I've expected \MT_cramped_internal: Nn to have the meaning macro:#1#2-->\setbox \z@ \hbox {$\m@th #1\kern} -\nulldelimiterspace \radical \z@ {#2}$}\ifx .... "some long error, it's very long to type and I can't copy it. tell me if its needed."
~/.config/nvim/test5.tex 23:0 E Use of \??? doesn't match its definition.
~/.config/nvim/test5.tex 23:0 E Use of \??? doesn't match its definition.
~/.config/nvim/test5.tex 23:0 E Use of \??? doesn't match its definition.
~/.config/nvim/test5.tex 23:0 E Use of \??? doesn't match its definition.
~/.config/nvim/test5.tex 0:0 W Latex Font Warning: Font shape 'TU/NewCM10-Regular.otf(0)/m/it' undefined using 'TU/NewCM10-Regular.otf(0)/m/n' instead on input line 40.
```
|
https://tex.stackexchange.com/users/300297
|
textit{} and textbf{} are not working and there are multiple errors which I don't know how to resolve
| false |
There is a missing `,` after `ItalicFont=NewCM10-Italic.otf`:
```
% !TeX TS-program = lualatex
\documentclass[12pt]{article}
\usepackage[paperwidth=9in, paperheight=14in]{geometry}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{empheq}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{fontspec}
\usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math}
\setmainfont[%
ItalicFont=NewCM10-Italic.otf,%
BoldFont=NewCM10-Bold.otf,%
BoldItalicFont=NewCM10-BoldItalic.otf,%
SmallCapsFeatures={Numbers=OldStyle}
]{NewCM10-Regular.otf}
%
\setsansfont[%
ItalicFont=NewCMSans10-Oblique.otf,%
BoldFont=NewCMSans10-Bold.otf,%
BoldItalicFont=NewCMSans10-BoldOblique.otf,%
SmallCapsFeatures={Numbers=OldStyle}]{NewCMSans10-Regular.otf}
\setmonofont[ItalicFont=NewCMMono10-Italic.otf,%
BoldFont=NewCMMono10-Bold.otf,%
BoldItalicFont=NewCMMono10-BoldOblique.otf,%
SmallCapsFeatures={Numbers=OldStyle}]{NewCMMono10-Regular.otf}
\setmathfont{NewCMMath-Regular.otf}
\begin{document}
Stay back, I'm \textit{going} to do some \textbf{science}.
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/36296
|
690517
| 320,322 |
https://tex.stackexchange.com/questions/690516
|
0
|
This is the code,
```
% !TEX TS-program = lualatex
\documentclass[12pt]{article}
\usepackage[paperwidth=9in, paperheight=14in]{geometry}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{empheq}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{fontspec}
\usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math}
\setmainfont[%
ItalicFont=NewCM10-Italic.otf%
BoldFont=NewCM10-Bold.otf,%
BoldItalicFont=NewCM10-BoldItalic.otf,%
SmallCapsFeatures={Numbers=OldStyle}]{NewCM10-Regular.otf}
\setsansfont[%
ItalicFont=NewCMSans10-Oblique.otf,%
BoldFont=NewCMSans10-Bold.otf,%
BoldItalicFont=NewCMSans10-BoldOblique.otf,%
SmallCapsFeatures={Numbers=OldStyle}]{NewCMSans10-Regular.otf}
\setmonofont[ItalicFont=NewCMMono10-Italic.otf,%
BoldFont=NewCMMono10-Bold.otf,%
BoldItalicFont=NewCMMono10-BoldOblique.otf,%
SmallCapsFeatures={Numbers=OldStyle}]{NewCMMono10-Regular.otf}
\setmathfont{NewCMMath-Regular.otf}
\begin{document}
Stay back, I'm \textit{going} to do some \textbf{science}.
\end{document}
```
---
Error
```
~/.config/nvim/test5.tex 0:0 W Package lualatex-math Warning: I've expected \MT_cramped_internal: Nn to have the meaning macro:#1#2-->\setbox \z@ \hbox {$\m@th #1\kern} -\nulldelimiterspace \radical \z@ {#2}$}\ifx .... "some long error, it's very long to type and I can't copy it. tell me if its needed."
~/.config/nvim/test5.tex 23:0 E Use of \??? doesn't match its definition.
~/.config/nvim/test5.tex 23:0 E Use of \??? doesn't match its definition.
~/.config/nvim/test5.tex 23:0 E Use of \??? doesn't match its definition.
~/.config/nvim/test5.tex 23:0 E Use of \??? doesn't match its definition.
~/.config/nvim/test5.tex 0:0 W Latex Font Warning: Font shape 'TU/NewCM10-Regular.otf(0)/m/it' undefined using 'TU/NewCM10-Regular.otf(0)/m/n' instead on input line 40.
```
|
https://tex.stackexchange.com/users/300297
|
textit{} and textbf{} are not working and there are multiple errors which I don't know how to resolve
| false |
Always look at the first error message, in your case
```
! Use of \??? doesn't match its definition.
<argument> \???
! LaTeX Error: Misplaced '=' in key-value input on line 31
l.31
```
which is quite clear: there's a missing comma in a line preceding line 31. And don't look at the scanty resumé presented by Vim: look in the log file.
There are a few other errors in you code. Don't load `amssymb` together with `unicode-math`, you only make TeX do useless work (or get errors if the former package is loaded after the latter).
You can save keystrokes, also gaining in clarity, if you use `fontspec` features when defining fonts.
```
\documentclass[12pt]{article}
\usepackage[paperwidth=9in, paperheight=14in]{geometry}
\usepackage{fontspec}
\usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{empheq}
%\usepackage{amssymb} % not with unicode-math
\usepackage{amsthm}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\setmainfont{NewCM10}[
Extension=.otf,
UprightFont=*-Regular,
ItalicFont=*-Italic,% <--- was missing
BoldFont=*-Bold,
BoldItalicFont=*-BoldItalic,
SmallCapsFeatures={Numbers=OldStyle},
]
\setsansfont{NewCMSans10}[
Extension=.otf,
UprightFont=*-Regular,
ItalicFont=*-Oblique,
BoldFont=*-Bold,
BoldItalicFont=*-BoldOblique,
SmallCapsFeatures={Numbers=OldStyle},
]
\setmonofont{NewCMMono10}[
Extension=.otf,
UprightFont=*-Regular,
ItalicFont=*-Italic,
BoldFont=*-Bold,
BoldItalicFont=*-BoldOblique,
SmallCapsFeatures={Numbers=OldStyle},
]
\setmathfont{NewCMMath-Regular.otf}
\begin{document}
Stay back, I'm \textit{going} to do some \textbf{science}.
\texttt{Stay back, I'm \textit{going} to do some \textbf{science}.}
\end{document}
```
Note that `%` after commas in key-value options is not needed; take the habit of always adding a trailing comma in that context.
|
2
|
https://tex.stackexchange.com/users/4427
|
690534
| 320,328 |
https://tex.stackexchange.com/questions/690469
|
0
|
Here is a thing that has been confusing me for ages:
the default `@inproceedings` entry in BibTeX (I use mostly KBibTeX to interface with it, but it probably does not matter), has the following fields:
* `title`: clear, that's the title of the talk/paper
* `booktitle`: It's a conference, not a book, but I suppose there may be historical reasons for this, like the fact that proceedings used to be published in a book that read "Proceedings of the 11th congress on..." on the cover. So I guess this should contain the title of the conference, in combination with the phrase "Proceedings of")?
* `series`: Not sure ... the conference name again? But I really don't want that printed twice!
* `number`: really important for reference, and most conferences do provide a unique number to each abstract/paper.
However, the data I usually get for conference papers looks like this (as downloaded from AIAA website):
```
title = {A Preliminary Sizing Method for Hybrid-Electric Aircraft Including Aero-Propulsive Interaction Effects},
author = {Reynard de Vries and Malcom T. Brown and Roelof Vos},
booktitle = {2018 Aviation Technology, Integration, and Operations Conference},
number = {AIAA 2018-4228},
...
```
Usually, I simply just skip the "series" bit, but then BibTeX complains:
```
Field <b>number</b> exists but <b>series</b> does not exist
```
The problem: I *want* the number included, but I don't want the name of the conference twice. I can move the conference name to the `series` field, but then BibTeX complains about the missing booktitle.
Usually, I just ignore the warning and it mostly works, but I have the feeling that I'm missing a trick. So: What's the intention behind the `series` field, and is there a cleaner way to deal with conferences that assign unique numbers to abstracts but don't have separate conference/"series" names?
Edit: Example paper
-------------------
This is some random conference paper that I have in my BibTeX collection: <https://www.doi.org/10.2514/6.2018-3976>
This is the bibtext dataset they offer for download:
```
@inbook{doi:10.2514/6.2018-3976,
author = {Justin S. Gray and Gaetan K. Kenway and Charles A. Mader and Joaquim R. R. A. Martins},
title = {Aero-propulsive Design Optimization of a Turboelectric Boundary Layer Ingestion Propulsion System},
booktitle = {2018 Aviation Technology, Integration, and Operations Conference},
chapter = {},
pages = {},
doi = {10.2514/6.2018-3976},
URL = {https://arc.aiaa.org/doi/abs/10.2514/6.2018-3976},
eprint = {https://arc.aiaa.org/doi/pdf/10.2514/6.2018-3976}
}
```
And this is the formatted reference example they provide on the reference download page:
>
> Justin S. Gray, Gaetan K. Kenway, Charles A. Mader and Joaquim R. R. A. Martins. "Aero-propulsive Design Optimization of a Turboelectric Boundary Layer Ingestion Propulsion System," AIAA 2018-3976. 2018 Aviation Technology, Integration, and Operations Conference. June 2018.
>
>
>
I would usually prefer to skip the month and year (year is already in the conference name) and put the paper number last, but this is basically the information needed to identify the source, and there is not much more that could be added.
Note how the citation contains the paper number but the BibTeX data does not, which is an obvious oversight. It uses the `@inbook` type, which also does not make a lot of sense to me because there's no ISBN, ISSN or any of those things you'd expect a book to have. So usually, I switch the type to `@inproceedings` and add the paper identifier in the `number` field, but then I get the warnings that triggered me to ask this question in the first place.
...maybe there's another type that would be better suited? This all looks as if it was made for a different scenario and then repurposed, a lot.
|
https://tex.stackexchange.com/users/153027
|
How to correctly record @inproceedings records in Bibtex entries
| true |
### Series
The `series` field (and its attached `number` field) exists due to *physical publications* of conference proceedings. Just to take one of my own papers as an example:
```
@inproceedings{ICCM7,
author = {WWY Wong},
title = {Timelike minimal submanifolds of Minkowski spaces},
booktitle = {Proceedings of the {S}eventh {I}nternational {C}ongress of
{C}hinese {M}athematicians. {V}ol. {II}},
series = {Adv. Lect. Math. (ALM)},
volume = {44},
year = {2019},
pages = {301--314},
publisher = {Int. Press, Somerville, MA},
}
```
(I am using `biblatex` with a customized `bbx` field, so I use `volume` instead of `number`; but ignore that for now.) The conference proceedings is actually published as a book by International Press. The publisher decided to include it as the 44th volume of their ["Advanced Lectures in Mathematics" series](https://www.intlpress.com/site/pub/pages/books/_home/series/00000013/index.php/) which contains some items that are conference proceedings, and some other technical works.
What should you do?
-------------------
The answer depends on why you are asking the question.
### The `bib` file as a means to generate bibliography in papers
If you are treating the `bib` file as a means to generate a bibliography, that is, if you primarily care about the output after running `bibtex`, then the easiest thing to do is to put the paper identifier into `pages`. This is especially the case because the conference is *not* getting physically bounded copies of the proceedings, and so there will never be an actual `pages` for this item.
I note that this is fairly common practice also for electronic journals, where papers are assigned an article number in the corresponding "volume" of the journal. Many bibliographic databases will export the article number into the `pages` field when generating `bibtex` output. (For example, that's what American Math. Society's MathSciNet service does.)
### The `bib` file as a bibliographic database
Of course, you may want to use the `bib` files as an actual database and wish to have the entries "recorded correctly". Unfortunately the `bibtex` format was created prior to many modern academic practices appearing, so if you stick to the fields strictly defined in the `bibtex` format you will not be able to capture these kinds of information.
Your choices then are:
* Use the `note` field, which may or may not be printed appropriately at a `bibtex` run (depends on the style).
* create your own field, which definitely will not be printed appropriately using standard bibliography styles.
For the latter, you will need to learn how to craft your own bibliography styles for bibtex, or (somewhat more easily) migrate to using `biblatex`.
|
1
|
https://tex.stackexchange.com/users/119
|
690539
| 320,331 |
https://tex.stackexchange.com/questions/690456
|
0
|
I am working with custom dependencies in `latexmk`, but I want the output files to be placed in `$aux_dir` and `$out_dir`, respectively.
I managed to do this sucessfully, but `latexmk` exits with the following console output:
```
------------
Run number 1 of rule 'cusdep texprototype tex demofile'
------------
Latexmk: In running custom-dependency rule
to make 'demofile.tex' from 'demofile.texprototype'
function 'texit' did not make the destination.
Latexmk: Some rule(s) failed, but user file(s) changed so keep trying
...
Latexmk: Moving 'tmp/mwe.pdf' to 'build/mwe.pdf'
Latexmk: Moving 'tmp/mwe.synctex.gz' to 'build/mwe.synctex.gz'
Latexmk: Getting log file 'tmp/mwe.log'
Latexmk: Examining 'tmp/mwe.fls'
Latexmk: Examining 'tmp/mwe.log'
Latexmk: Log file says output to 'tmp/mwe.pdf'
Latexmk: All targets () are up-to-date
Collected error summary (may duplicate other messages):
cusdep texprototype tex demofile: Command for 'cusdep texprototype tex demofile' gave return code -1
```
*Some lines have been stripped away, but the essential lines are these:*
```
Latexmk: In running custom-dependency rule
to make 'demofile.tex' from 'demofile.texprototype'
function 'texit' did not make the destination.
```
This output is quite irritating, even if I believe I understand what is going on:
1. `latexmk` notices the missing file in the document.
2. `latexmk` runs the corresponding custom rule. This rule generates a target file `tmp/demofiles.tex` from the source file `./demofile.texprototype`.
3. `latexmk` cannot verify, that the target for the source has been made, because it has no way of knowing where to look.
4. In subsequent runs for `pdflatex` rule, the file `./tmp/demofile.tex` is found and inputted, however since I set `add_cus_dep('texprototype', 'tex', **1**, 'texit');`, an error is logged, which is then displayed at the end.
MWE
===
`.latexmkrc`
------------
```
# Set the program used to generate the PDF
# 1: pdflatex
# 2: postscript conversion, don't use this
# 3: dvi conversion, don't use this
# 4: lualatex
# 5: xelatex
$pdf_mode = 1;
# Move all axuiliary files to a separate directory, so they do not clutter up the project directory
$emulate_aux = 1;
$aux_dir = "tmp";
# Move the compiled files (and synctex) to a separate directory
$out_dir = 'build';
# Add custom dependency.
# latexmk checks whether a file with ending as given in the 2nd
# argument exists ('toextension'). If yes, check if file with
# ending as in first argument ('fromextension') exists. If yes,
# run subroutine as given in fourth argument.
# Third argument is whether file MUST exist. If 0, no action taken.
add_cus_dep('texprototype', 'tex', 1, "texit");
# show custom dependencies for debugging
show_cus_dep();
set_tex_cmds("--shell-escape -interaction=batchmode -synctex=1 ");
# custom sub handling the loading of the preamble and dumping it into $base.fmt
sub texit {
my ( $base) = @_;
# create the missing tex file
$ret = system ("echo \"This is the demo file content.\" > $aux_dir1$base.tex");
# if there were errors, return the error codes
if ($ret) { return $ret; }
}
```
`mwe.tex`
---------
```
\documentclass{scrbook}
\begin{document}
\title{Toil and Trouble}
\subtitle{with latexmk and \textit{\$aux\_dir}}
\subject{Case Studies}
\date{\today}
\maketitle{}
\input{demofile.tex}
\end{document}
```
Question
========
Can I make my custom rules of `latexmk` recognize paths to build targets to fully make use of the `$aux_dir` and `$output_dir` variables?
Comment
=======
* This is a follow-up question to [my previous question](https://tex.stackexchange.com/q/690367/53868) and [answer](https://tex.stackexchange.com/a/690435/53868). In theory, I want to solve the dependency and path problem for the setup in this other question, but I felt it would be more suitable to split it into its own problem, which can be investigated and solved individually.
|
https://tex.stackexchange.com/users/53868
|
latexmk dependency files and $aux_dir
| true |
In the current version (and previous versions) of latexmk, it is required that the output and input files of a custom dependency are in the same directory. So what you ask for isn't supported, i.e., to put the output files of custom dependencies in the aux directory.
In principle, it would be a good idea to support this possibility. But there would be some non-trivial backward compatibility issues to sort out.
|
3
|
https://tex.stackexchange.com/users/8495
|
690540
| 320,332 |
https://tex.stackexchange.com/questions/690533
|
0
|
Text with two columns, each column with text in different languages. For example, in the right column the text is in English and in the left column the same text in Portuguese.
|
https://tex.stackexchange.com/users/163073
|
Two columns text with different languages
| false |
You didn't provide much information to go on. From what I understand, you want to pair an original text and it's translation paragraph by paragraph in two columns.
It seems you can use the package [paracol](https://ctan.org/pkg/paracol) to achieve this.
I made an example with the first chapter of a book and it's real translation.
```
\documentclass{memoir}
\usepackage{paracol}
\begin{document}
\setlength{\columnsep}{3em}
\begin{paracol}{2}
\section*{Chapter 1}
\subsection{The Authors Demise}
For some time I debated over whether I should start these memoirs at the beginning or at the end, that is, whether I should put my birth or my death in first place. Since common usage would call for beginning with birth, two considerations led me to adopt a different method: the first is that I am not exactly a writer who is dead but a dead man who is a writer, for whom the grave was a second cradle; the second is that the writing would be more distinctive and novel in that way. Moses, who also wrote about his death, didn't place it at the opening but at the close: a radical difference between this book and the Pentateuch.
\switchcolumn
\section*{Capítulo 1}
\subsection{Óbito do Autor}
Algum tempo hesitei se devia abrir estas memórias pelo princípio ou pelo fim, isto é, se poria em primeiro lugar o meu nascimento ou a minha morte. Suposto o uso vulgar seja começar pelo nascimento, duas considerações me levaram a adotar diferente método: a primeira é que eu não sou propriamente um autor defunto, mas um defunto autor, para quem a campa foi outro berço; a segunda é que o escrito ficaria assim mais galante e mais novo. Moisés, que também contou a sua morte, não a pôs no intróito, mas no cabo; diferença radical entre este livro e o Pentateuco.
\newline
\switchcolumn*
With that said, I expired at two o'clock on a Friday afternoon in the month of August, 1869, at my beautiful suburban place in Catumbi. I was sixty-four intense and prosperous years old, I was a bachelor, I had wealth of around three hundred contols, and I was accompanied to the cemetery by eleven friends. Eleven friends! The fact is, there hadn't been any cards or announcements. On top of that it was raining--drizzling--a thin, sad, constant rain, so constant and so sad that it led one of those last-minute faithful friends to insert this ingenious idea into the speech he was making at the edge of my grave: "You who knew him, gentlemen, can say with me that nature appears to be weeping over the irreparable loss of one of the finest characters humanity has been honored with. This somber air, these drops from heaven, those dark clouds that cover the blue like funeral crepe, all of it is the cruel and terrible grief that gnaws at nature and at my deepest insides; all that is sublime praise for our illustrious deceased.
\switchcolumn
Dito isto, expirei às duas horas da tarde de uma sexta-feira do mês de agosto de 1869, na minha bela chácara de Catumbi. Tinha uns sessenta e quatro anos, rijos e prósperos, era solteiro, possuía cerca de trezentos contos e fui acompanhado ao cemitério por onze amigos. Onze amigos! Verdade é que não houve cartas nem anúncios. Acresce que chovia -peneirava- uma chuvinha miúda, triste e constante, tão constante e tão triste, que levou um daqueles fiéis da última hora a intercalar esta engenhosa idéia no discurso que proferiu à beira de minha cova: -«Vós, que o conhecestes, meus senhores, vós podeis dizer comigo que a natureza parece estar chorando a perda irreparável de um dos mais belos caracteres que tem honrado a humanidade. Este ar sombrio, estas gotas do céu, aquelas nuvens escuras que cobrem o azul como um crepe funéreo, tudo isso é a dor crua e má que lhe rói à natureza as mais íntimas entranhas; tudo isso é um sublime louvor ao nosso ilustre finado.
\end{paracol}
\end{document}
```
The output looks like this:
|
2
|
https://tex.stackexchange.com/users/298544
|
690542
| 320,334 |
https://tex.stackexchange.com/questions/690532
|
1
|
**english (german version below):** I have this LaTex code from a template, I have strongly minimized the preamble, because in the original preamble about 100 different packages and functions are included or defined. Whenever I use \si{\ohm} in the text to create an Ohm character I get the error message "auto expansion is only possible with scalable fonts". However, it also depends a bit on the place where I insert the Ohm character, at the end for example it works, but it doesn't belong there.
**german:** Ich habe diesen LaTex-Code aus einer Vorlage, die Präambel habe ich stark minimiert, da in der ursprünglichen Präambel ca. 100 verschiedene Pakete und Funktionen eingebunden bzw. definiert werden. Immer wenn ich \si{\ohm} im Text verwende, um ein Ohm-Zeichen zu erzeugen bekomme ich die Fehlermeldung "auto expansion is only possible with scalable fonts". Allerdings hängt das auch ein bisschen vom Ort ab, an dem ich das Ohm-Zeichen einfüge, am Ende zum Beispiel funktioniert es, da gehört es allerdings nicht hin.
```
\documentclass[%
%enabledeprecatedfontcommands,% Kapitälchen (\sc) wird trotzdem unterstützt
paper=A4, % Papierformat
fontsize=11pt, % Zeichensatzgroesse (Koma-Script)
]
{scrartcl} % Dokumentklasse (alternativ scrartcl oder scrreprt, Koma-Script)
% deutsches Fontencoding, T1 Schriften
\usepackage[T1]{fontenc}
% deutsche Trennungsregeln, deutsche Zusatzbefehle
\usepackage[ngerman]{babel}
% Schriftfamilie ComputerModern Bright (serifenlos)
\usepackage{cmbright}
% optischer Randausgleich (verschiedene Buchstaben, Satzzeichen, Bindestriche
% etc. werden leicht in den Seitenrand verschoben); automatische Skalierung von
% Buchstaben zur Verbesserung des Blocksatzes
\usepackage[tracking=true,spacing=true,kerning=true,final]{microtype}
% \mathsf fuer cmbright richtig definieren
% (sonst wird bei \mathsf CM-SansSerif verwendet)
\renewcommand{\mathsf}[1]{\,\mathrm{#1}}
\usepackage[locale=DE]{siunitx} % Paket zum Setzen von Einheiten und zur Formatierung von Zahlen
%Dieses SI-Zechen durch beliebigen Text ersetzen und die Fehlermeldung verschwindet:
%\si{\ohm}
\begin{document}
\section{Oberflächenwiderstand}
Der spezifische Oberflächenwiderstand berechnet sich nach der Formel.
Dieses PVC wurde anschließend im Wärmeschrank langsam auf 40°C
erwärmt. Erwartbar wäre dadurch eine Verringerung des Widerstands.
Tatsächlich stieg der Widerstand aber auf einen Wert von 208 \si{\ohm} an.
Der spezifische Oberflächenwiderstand berechnet sich nach der Formel.
Der spezifische Oberflächenwiderstand berechnet sich nach der Formel.
Der spezifische Oberflächenwiderstand berechnet sich nach der Formel.
\end{document}
```
**Thank you for answers!**
|
https://tex.stackexchange.com/users/300322
|
auto expansion only possible with scalable fonts caused by siunitx
| false |
I have found a workaround for my problem, its maybe not perfect, but OK in my case. I use the package `\usepackage{textgreek}` in the preamble and the command `\textOmega` in the text.
|
0
|
https://tex.stackexchange.com/users/300322
|
690543
| 320,335 |
https://tex.stackexchange.com/questions/690512
|
0
|
I’ve got a problem renewing a command inside an enumerate environment.
I wish to make some exercises and to append the solution of each exercise to a predefined macro called “solutions”.
Adding solutions works fine as long as I do it outside the `\begin{enumerate} \end{enumerate}`, but adding solutions to this macro fails when it is done inside this environment.
Any help will be appreciated, I’ve been searching for a solutions on the internet but didn’t succeed.
Thank you very much!
Here is the minimal working example. I tried it with `\newcommand` as well as `\def`.
```
\documentclass[12pt,a4paper]{report}
\usepackage[french]{babel}
\usepackage{fontspec}
\usepackage{xunicode}
\newcommand{\solutions}{First}
\newcommand{\addsol}[1]{%
\expandafter\renewcommand\expandafter\solutions\expandafter{\solutions,#1}%
}
%\def\solutions{First}
%\def\addsol#1{%
% \expandafter\def\expandafter\solutions\expandafter{\solutions,#1}%
% }
\begin{document}
\addsol{Second}
\begin{enumerate}
\item Lorem Ipsum \addsol{Third}
\end{enumerate}
% Print the contents of solutions
\solutions
\end{document}
```
In each case I obtain the following output, meaning that the first and second appending worked, but the third failed:
1. Lorem Ipsum
First,Second
|
https://tex.stackexchange.com/users/188246
|
Problem renewing command inside an enumerate list
| false |
LaTeX's environments are groups. If you change something inside the group in a non-global way, the former value will get restored after the `\end{enumerate}`.
Your macro `\addsol{...}` assigns the new content in a non-local way,
but you want your changes done in a global way using `\gdef` instead of a simple `\def`.
|
2
|
https://tex.stackexchange.com/users/287868
|
690544
| 320,336 |
https://tex.stackexchange.com/questions/690512
|
0
|
I’ve got a problem renewing a command inside an enumerate environment.
I wish to make some exercises and to append the solution of each exercise to a predefined macro called “solutions”.
Adding solutions works fine as long as I do it outside the `\begin{enumerate} \end{enumerate}`, but adding solutions to this macro fails when it is done inside this environment.
Any help will be appreciated, I’ve been searching for a solutions on the internet but didn’t succeed.
Thank you very much!
Here is the minimal working example. I tried it with `\newcommand` as well as `\def`.
```
\documentclass[12pt,a4paper]{report}
\usepackage[french]{babel}
\usepackage{fontspec}
\usepackage{xunicode}
\newcommand{\solutions}{First}
\newcommand{\addsol}[1]{%
\expandafter\renewcommand\expandafter\solutions\expandafter{\solutions,#1}%
}
%\def\solutions{First}
%\def\addsol#1{%
% \expandafter\def\expandafter\solutions\expandafter{\solutions,#1}%
% }
\begin{document}
\addsol{Second}
\begin{enumerate}
\item Lorem Ipsum \addsol{Third}
\end{enumerate}
% Print the contents of solutions
\solutions
\end{document}
```
In each case I obtain the following output, meaning that the first and second appending worked, but the third failed:
1. Lorem Ipsum
First,Second
|
https://tex.stackexchange.com/users/188246
|
Problem renewing command inside an enumerate list
| true |
You need `\gdef`, because environments form groups.
```
\documentclass[12pt,a4paper]{report}
\usepackage[french]{babel}
\usepackage{fontspec}
%\usepackage{xunicode}% <--- not recommended
\newcommand{\addsol}[1]{%
\ifdefined\solutions
\expandafter\gdef\expandafter\solutions\expandafter{\solutions,#1}%
\else
\gdef\solutions{#1}%
\fi
}
\begin{document}
\addsol{First}
\addsol{Second}
\begin{enumerate}
\item Lorem Ipsum \addsol{Third}
\end{enumerate}
% Print the contents of solutions
\solutions
\end{document}
```
Note that `xunicode` used to be recommended a few years ago, but it isn't nowadays.
On the other hand, there's a better method with `expl3`, that allows to print solutions in a variety of ways. The `\printsolutions` command has an optional argument that tell TeX what to put in between two solutions, default “comma-space”.
```
\documentclass[12pt,a4paper]{report}
\usepackage[french]{babel}
\usepackage{fontspec}
\ExplSyntaxOn
\seq_new:N \g_ladi_solutions_seq
\NewDocumentCommand{\addsol}{m}
{
\seq_gput_right:Nn \g_ladi_solutions_seq { #1 }
}
\NewDocumentCommand{\printsolutions}{+O{,~}}
{
\seq_use:Nn \g_ladi_solutions_seq { #1 }
}
\ExplSyntaxOff
\begin{document}
\addsol{First}
\addsol{Second}
\begin{enumerate}
\item Lorem Ipsum \addsol{Third}
\end{enumerate}
% Print the contents of solutions with commas
\section*{Solutions}
\printsolutions
\section*{Solutions}
\printsolutions[\par]
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/4427
|
690545
| 320,337 |
https://tex.stackexchange.com/questions/690456
|
0
|
I am working with custom dependencies in `latexmk`, but I want the output files to be placed in `$aux_dir` and `$out_dir`, respectively.
I managed to do this sucessfully, but `latexmk` exits with the following console output:
```
------------
Run number 1 of rule 'cusdep texprototype tex demofile'
------------
Latexmk: In running custom-dependency rule
to make 'demofile.tex' from 'demofile.texprototype'
function 'texit' did not make the destination.
Latexmk: Some rule(s) failed, but user file(s) changed so keep trying
...
Latexmk: Moving 'tmp/mwe.pdf' to 'build/mwe.pdf'
Latexmk: Moving 'tmp/mwe.synctex.gz' to 'build/mwe.synctex.gz'
Latexmk: Getting log file 'tmp/mwe.log'
Latexmk: Examining 'tmp/mwe.fls'
Latexmk: Examining 'tmp/mwe.log'
Latexmk: Log file says output to 'tmp/mwe.pdf'
Latexmk: All targets () are up-to-date
Collected error summary (may duplicate other messages):
cusdep texprototype tex demofile: Command for 'cusdep texprototype tex demofile' gave return code -1
```
*Some lines have been stripped away, but the essential lines are these:*
```
Latexmk: In running custom-dependency rule
to make 'demofile.tex' from 'demofile.texprototype'
function 'texit' did not make the destination.
```
This output is quite irritating, even if I believe I understand what is going on:
1. `latexmk` notices the missing file in the document.
2. `latexmk` runs the corresponding custom rule. This rule generates a target file `tmp/demofiles.tex` from the source file `./demofile.texprototype`.
3. `latexmk` cannot verify, that the target for the source has been made, because it has no way of knowing where to look.
4. In subsequent runs for `pdflatex` rule, the file `./tmp/demofile.tex` is found and inputted, however since I set `add_cus_dep('texprototype', 'tex', **1**, 'texit');`, an error is logged, which is then displayed at the end.
MWE
===
`.latexmkrc`
------------
```
# Set the program used to generate the PDF
# 1: pdflatex
# 2: postscript conversion, don't use this
# 3: dvi conversion, don't use this
# 4: lualatex
# 5: xelatex
$pdf_mode = 1;
# Move all axuiliary files to a separate directory, so they do not clutter up the project directory
$emulate_aux = 1;
$aux_dir = "tmp";
# Move the compiled files (and synctex) to a separate directory
$out_dir = 'build';
# Add custom dependency.
# latexmk checks whether a file with ending as given in the 2nd
# argument exists ('toextension'). If yes, check if file with
# ending as in first argument ('fromextension') exists. If yes,
# run subroutine as given in fourth argument.
# Third argument is whether file MUST exist. If 0, no action taken.
add_cus_dep('texprototype', 'tex', 1, "texit");
# show custom dependencies for debugging
show_cus_dep();
set_tex_cmds("--shell-escape -interaction=batchmode -synctex=1 ");
# custom sub handling the loading of the preamble and dumping it into $base.fmt
sub texit {
my ( $base) = @_;
# create the missing tex file
$ret = system ("echo \"This is the demo file content.\" > $aux_dir1$base.tex");
# if there were errors, return the error codes
if ($ret) { return $ret; }
}
```
`mwe.tex`
---------
```
\documentclass{scrbook}
\begin{document}
\title{Toil and Trouble}
\subtitle{with latexmk and \textit{\$aux\_dir}}
\subject{Case Studies}
\date{\today}
\maketitle{}
\input{demofile.tex}
\end{document}
```
Question
========
Can I make my custom rules of `latexmk` recognize paths to build targets to fully make use of the `$aux_dir` and `$output_dir` variables?
Comment
=======
* This is a follow-up question to [my previous question](https://tex.stackexchange.com/q/690367/53868) and [answer](https://tex.stackexchange.com/a/690435/53868). In theory, I want to solve the dependency and path problem for the setup in this other question, but I felt it would be more suitable to split it into its own problem, which can be investigated and solved individually.
|
https://tex.stackexchange.com/users/53868
|
latexmk dependency files and $aux_dir
| false |
One option that I find simpler is to use `latexmk -outdir=aux` and then use a Makefile to copy the output file to a build directory. Then your temporary/auxiliary files will be in `aux/` and the PDF will be in `build/`. To run, just type `make` or `make pdf`. To reset, `make clean`.
`Makefile`
```
dirs = aux build
tex_in = $(wildcard *.tex)
tex_out = $(addprefix build/,$(tex_in:%.tex=%.pdf))
.PHONY : all clean
all : $(tex_out)
build/%.pdf : aux/%.pdf
cp -u $< $@
aux/%.pdf : %.tex | $(dirs)
latexmk -outdir=aux -pdf $<
$(dirs) :
mkdir -p $(dirs)
clean :
rm -rf $(dirs)
```
|
1
|
https://tex.stackexchange.com/users/56233
|
690547
| 320,338 |
https://tex.stackexchange.com/questions/127200
|
16
|
I have a couple of LaTeX files with the same problem. If I produce an error, fix it, and then try to compile a pdf, I get the following error.
```
)Runaway argument?
{{
! File ended while scanning use of \@newl@ablel.
<inserted text>
\par
l.90 \begin{document}
```
If I then click on the console or trash my `.aux` file, it compiles fine. Any thoughts on what is going on and how to prevent this annoying extra step?
|
https://tex.stackexchange.com/users/34798
|
TexShop will not compile without trashing aux files after every error
| false |
This is an old post, but I came across it and have what I think is useful input. My observations:
1. Most importantly for actually being able to deal with this problem (which is a constant issue every time I use TexShop): To make this go away, you don't have to trash aux files. Just enter 'q' in the console window where your error is. That causes TeX to end its run more gracefully and leave the aux files in a nicer state. If your file is now error-free, the next compile will work.
2. Also important: You can prevent this problem (if you remember, which I often don't) by entering 'q' in the console window for the *original error*, before trying to compile again.
3. The issue is not that TeXShop itself messes up the aux files. Instead, the problem is that, apparently, TeXShop starts a new compile process without gracefully ending the previous process. I can make this happen on the command line without TeXShop. If your file was giving this error in TeXShop, the same will happen on the comand line with the following steps: a. Introduce an error into the file. b. Compile. c. Fix the file. d. Kill the TeX process abruptly or just leave it hanging. e. Compile again (from a different terminal window if you left the process hanging).
4. In my experience, once my file gets big enough, this error happens always, whenever I make an error, fix it, and recompile without hitting 'q' in the TeXShop console window. The actual error that comes up varies, but it always references a line number fairly early in the file. (My experience may be very dependent on the kinds of packages I typically run, not sure.)
Would this problem go away if TeXShop automatically killed the hanging process gracefully before compiling again? Not sure.
|
2
|
https://tex.stackexchange.com/users/85200
|
690549
| 320,339 |
https://tex.stackexchange.com/questions/690553
|
1
|
I'm trying to set a frame with a background image and some text over the image in some arbitrary position.
My last attempt was something like this:
```
\documentclass{beamer}
\usepackage{tikz}
\usepackage{graphicx}
\usetikzlibrary{positioning, calc}
\begin{document}
{
\usebackgroundtemplate {
\tikz[remember picture,overlay,shift={(current page.center)}]
\node {\includegraphics[width=1.2\paperwidth]{imgs/background.jpg}};
\node [xshift=2cm, yshift=-4cm] (anchorA) at (0,0) {TEST TEXT};
}
\begin{frame}
\end{frame}
}
\end{document}
```
|
https://tex.stackexchange.com/users/164318
|
Beamer: Adding a text in arbitrary position in a frame with background image
| true |
The problem with your code is that if you use `\tikz ...` without `{...}` around the content, then it will only act on the first node. The second node is not part of it. At the very minimum you could add `{...}` around the content of the macro.
---
However if you have more than one node in an image, I usually find it easier to use a `tikzpicture` environment instead of `\tikz`.
I also suggest to use this little trick from <https://topanswers.xyz/tex?q=1989> to get coordinates relative to the page:
```
\documentclass{beamer}
\usepackage{tikz}
%\usepackage{graphicx}
\usetikzlibrary{positioning, calc}
% trick taken from https://topanswers.xyz/tex?q=1989
\tikzset{
use page relative coordinates/.style={
shift={(current page.south west)},
x={(current page.south east)},
y={(current page.north west)}
}
}
\begin{document}
{
\setbeamertemplate{background canvas}{
\begin{tikzpicture}[remember picture, overlay,use page relative coordinates]
\node at (0.5,0.5) {\includegraphics[width=1.2\paperwidth]{example-image-duck}};
\node at (0.7,0.1) {TEST TEXT};
\end{tikzpicture}
}
\begin{frame}
\end{frame}
}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/36296
|
690554
| 320,342 |
https://tex.stackexchange.com/questions/2044
|
88
|
TikZ is undergoing lots of development with new features being added, but the versions distributed with standard TeX releases are often a little old. How do I get the latest version? If I want to be sure that I get the latest stable version, how do I do that?
---
Note: I'm not asking this question for myself, but because a question like this seems to be useful for pointing to it when a new feature of TikZ is mentioned in an answer to some other question. Feel free to post answers for any operating system/TeX distribution combination.
|
https://tex.stackexchange.com/users/83
|
How to install a current version of TikZ?
| false |
For Tex Live distributions, you can use `tlmgr`:
```
tlmgr install pgf
```
Confirmed working with TinyTex.
|
0
|
https://tex.stackexchange.com/users/254753
|
690556
| 320,343 |
https://tex.stackexchange.com/questions/690560
|
1
|
I have created a newcommand to format titles in my prayer book. I want the newcommand to be centered, but with the following code, there is extra space above and below the newcommand. I tried to use `\centering` instead of `\begin{center}` `\end{center}`. but it doesn't compile centered.
```
\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{xcolor}
\newcommand{\prayerheading}[1]{%
\begin{center}
\noindent\large\bfseries\textcolor{red}{#1}\normalsize
\end{center}
}
\newcommand{\psalmheading}[1]{%
{\centering
\noindent\large\bfseries\textcolor{red}{#1}\normalsize
}
}
\title{Test}
\author{Michael}
\begin{document}
\maketitle
\prayerheading{Introductory Prayer}
In the name of the Father, and of the Son, and of the Holy Spirit. Amen.\\
Glory to Thee, our God, glory to Thee.\\
\prayerheading{Evening Troparia}
Have mercy on us, O Lord have mercy on us, for laying
aside all excuse, we sinners offer to Thee as to our
Master this supplication: have mercy on us.\\
\psalmheading{Evening Troparia}
Have mercy on us, O Lord have mercy on us, for laying
aside all excuse, we sinners offer to Thee as to our
Master this supplication: have mercy on us.\\
\end{document}
```
I'm sorry I keep having issues having all the text that's in the code edited properly. So, I am trying to keep the look of the original code: `\prayerheading` but without the extra spacing above and below.
Thanks
|
https://tex.stackexchange.com/users/283787
|
too much space with centering inside a newcommand
| true |
(added `\medskip` and `\smallskip` directives to the definition of `\psalmheading` per the OP's request)
>
> So, I am trying to keep the look of the original code [for `\psalmheading`]: `\prayerheading` but without the extra spacing above and below.
>
>
>
Something like this?
```
\documentclass[12pt]{article}
\usepackage[document]{ragged2e}
\usepackage{xcolor}
\newcommand{\prayerheading}[1]{%
\begin{center}
\large\bfseries\color{red}#1
\end{center}
}
\newcommand{\psalmheading}[1]{%
\begingroup
\par\medskip% <-- new: \medskip
\centering\large\bfseries\color{red}#1
\par\smallskip% <-- new: \smallskip
\endgroup}
\begin{document}
\prayerheading{Introductory Prayer}
In the name of the Father, and of the Son, and of the Holy Spirit. Amen.
Glory to Thee, our God, glory to Thee.
\prayerheading{Evening Troparia}
Have mercy on us, O Lord have mercy on us, for laying aside all excuse, we sinners offer to Thee as to our Master this supplication: have mercy on us.
\psalmheading{Evening Troparia}
Have mercy on us, O Lord have mercy on us, for laying aside all excuse, we sinners offer to Thee as to our Master this supplication: have mercy on us.
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/5001
|
690563
| 320,347 |
https://tex.stackexchange.com/questions/690360
|
1
|
I'm trying to reference some sheet music in a bibliography.
The work was composed by Mussorgsky in 1867, but re-written ("arranged") by Rimsky-Korsakov in 1886 and published by W. Bessel & Co. out of St. Petersburg.
The APA guidelines [here](https://apastyle.apa.org/style-grammar-guidelines/references/examples/musical-score-references) and [here](https://blog.apastyle.org/apastyle/2011/09/how-to-cite-a-musical-score.html) are clear. The reference should look like this:
>
> Mussorgsky, M. (Composer). (1886). Night on Bare Mountain (Rimsky-Korsakov, N. Arr.) [Sheet Music]. St. Petersburg: W. Bessel & Co. (Original work published 1867)
>
>
>
or more generally:
>
> author (role). (date). title (editor, editortype) [entrysubtype] location: publisher. (Original work published origdate)
>
>
>
However, the closest I can get is:
>
> Mussorgsky, M. (1886). Night on bare mountain (N. Rimsky-Korsakov, **typearranger**) [Sheet Music]. W. Bessel & Co. (Original work published 1867)
>
>
>
I got that by using the [biblatex documentation](https://ftp.snt.utwente.nl/pub/software/tex/macros/latex/contrib/biblatex/doc/biblatex.pdf) and the [biblatex-apa documentation](https://mirror.koddos.net/CTAN/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf) document to create the folowing `*.bib`:
```
@book{mussorgsky,
author = "Modest Mussorgsky",
role = "Composer",
year = "1886",
title = "Night On Bald Mountain",
entrysubtype = "Sheet Music",
editor = "Nikolay Rimsky-Korsakov",
editortype = "arranger",
location = "St. Petersburg",
publisher = "W. Bessel \& Co.",
origdate = "1867"
}
```
Then I include this in my preamble:
```
\usepackage[backend=biber,style=apa]{biblatex}
```
The differences in descending order of priority:
1. The `role = "Composer"` is not respected. Though APA guidelines describe this as a "role", I'm not surprised this didn't work because bibtex doesn't describe "role" the same way. But is there a way I can get **"(Composer)"** in there?
2. If I leave `editortype` empty, Rimsky-Kosakov is credited here as an editor ("**Ed.**"). It would be more accurate to credit him as an arranger ("**Arr.**"), but the built-in `editortype` in biblatex only support `editor`, `compiler`, `founder`, `continuator`, `redactor`, `reviser`, `collaborator`, `organizer`. Is there a way to extend this?
3. "St. Petersburg:" is missing. If I try other "style" choices, then location appears before the publisher as expected. Did I do something wrong, or should I just use `publisher = "St. Petersburg: W. Bessel \& Co."`? Maybe APA has changed since 7th edition (when the music stuff was defined) but location is pretty important when referring to these really old publishers. My current strategy is to merge the location field into the publisher field.
|
https://tex.stackexchange.com/users/205379
|
APA references with bibtex: some fields not working
| true |
1. Adding a "(Role)" was true in the 6th edition APA, but is no longer required in 7th edition APA. If you really want to add it, use:
```
author+an:role= {1="Composer"},
```
2. Add the following to the pre-amble to make `editortype` accept "arranger":
```
\NewBibliographyString{typearranger}
\DefineBibliographyStrings{english}{typearranger = {Arr.}}
```
3. Location isn't required in 7th edition APA anymore.
|
1
|
https://tex.stackexchange.com/users/205379
|
690576
| 320,352 |
https://tex.stackexchange.com/questions/253253
|
21
|
The chart produced by below code is too wide. How can I make it small enough to fit the page?
```
\documentclass[12pt]{article}
\usepackage{pgfgantt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{ganttchart}[vgrid={draw=none,draw=none},%
%today=15,%
%today offset=.5,%
%today label=Heute,%
%progress=today,%
bar incomplete/.append style={fill=red},%
progress label text= {\quad\pgfmathprintnumber[precision=0,verbatim]{#1}\%}%
]{1}{36}
\gantttitlecalendar*[compress calendar,time slot format=isodate]{2015-11-1}{2018-10-30}{year, month} \\
\gantttitlelist{1,...,36}{1}\\
\ganttgroup{Total Duration}{1}{36} \\
%%%%%%%%%%%%%%%%%Phase-1
\ganttgroup{Phase 1}{1}{12} \\
\ganttbar{Scope Reading}{1}{2} \\
\ganttlinkedbar{Literature Review}{2}{5} \ganttnewline
\ganttlinkedbar{Define Scope of Review}{5}{6} \ganttnewline
\ganttlinkedbar{Search for Relevant Literature}{6}{10} \ganttnewline
\ganttlinkedbar{Classify the Documents}{10}{12} \ganttnewline
%%%%%%%%%%%%%%%%%Phase-2
\ganttgroup{Phase 2}{12}{24} \\
\ganttlinkedbar{Solver Analysis $\&$ Formulation}{10}{15} \\
\ganttlinkedbar{Development of source code}{15}{16} \ganttnewline
\ganttlinkedbar{Purchase Equipment}{16}{18} \ganttnewline
\ganttlinkedbar{Design Experimental Procedure}{18}{20} \ganttnewline
\ganttlinkedbar{Run Experiments}{20}{21} \ganttnewline
\ganttlinkedbar{Analysis of Experimental Data}{21}{24} \ganttnewline
%%%%%%%%%%%%%%%%%Phase-3
\ganttgroup{Phase 3}{24}{36} \\
\ganttbar{Solving Validation and Conclusion}{24}{27} \\
\ganttlinkedbar{Publications $\&$ Workshops}{27}{30} \ganttnewline
\ganttlinkedbar{Defence of Study Work}{30}{33} \ganttnewline
\ganttlinkedbar{Thesis Writing}{33}{36} \ganttnewline
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{ganttchart}
\end{document}
```
|
https://tex.stackexchange.com/users/46330
|
Adjust width of a gantt chart
| false |
A better solution is to define the option `expand chart=\textwidth` when you create the Gantt chart. This will ensure that the chart width will be equal to the text width. See an example below in which I show the full code.
```
\begin{ganttchart}[
vgrid,
hgrid,
x unit=0.7cm,
y unit title=0.6cm,
y unit chart=0.6cm,
title/.append style={fill=gray!20},
title label font=\bfseries,
title height=1,
bar height=0.6,
bar/.append style={fill},
bar incomplete/.append style={fill=blue!50},
bar/.append style={fill=red!50},
progress label text={},
milestone label font=\bfseries\small,
milestone height=0.8,
milestone top shift=0.2,
milestone/.append style={fill=red},
group/.append style={draw=black, fill=green!30},
group height=.3,
group peaks height=.2,
group label font=\bfseries\small,
group left shift=0,
group right shift=0,
group top shift=.3,
group height=.2,
group peaks tip position=0,
group peaks width=0.2,
group incomplete/.append style={fill=gray!50},
link/.style={->,thick},
expand chart=\textwidth,
today=6,
progress=today,
% inline
]{1}{17}
\gantttitle{Plan for Writing a Scientific Paper}{17} \\
\gantttitle{Week}{17} \\
\gantttitlelist{1,...,17}{1} \\
\ganttgroup{Research}{1}{4} \\
\ganttbar{Literature review}{1}{4} \\
\ganttgroup{Experiment}{5}{10} \\
\ganttbar{Define methodology}{5}{5} \\
\ganttlinkedbar{Data collection}{6}{7} \\
\ganttbar{Data analysis}{8}{10} \\
\ganttgroup{Writing}{11}{16} \\
\ganttbar{Introduction}{11}{13} \\
\ganttbar{Methodology}{12}{13} \\
\ganttbar{Results and Discussion}{14}{15} \\
\ganttbar{Conclusion}{16}{16} \\
\ganttmilestone{Submission}{17} \\
\end{ganttchart}
```
|
0
|
https://tex.stackexchange.com/users/218382
|
690577
| 320,353 |
https://tex.stackexchange.com/questions/690580
|
1
|
While using the following springer journal template in Overleaf : [Link](https://www.overleaf.com/latex/templates/springer-nature-latex-template/myxmhdsbzkyd) , If I select XeLatex as compiler immediately it shows 38 errors and the bibliography disappears. But everything is ok if I use it using Pdflatex compiler. How to run this template using XeLatex compiler without any error and without vanishing bibliography. Thank you.
|
https://tex.stackexchange.com/users/185154
|
Springer journal template issue in XeLatex Compiler Overleaf
| false |
the file says
```
%% to compile with pdflatex/xelatex use pdflatex option %%
```
and if I change
```
\documentclass[sn-mathphys,Numbered]{sn-jnl}% Math and Physical Sciences Reference Style
```
to
```
\documentclass[sn-mathphys,Numbered,pdflatex]{sn-jnl}% Math and Physical Sciences Reference Style
```
it runs without error
|
1
|
https://tex.stackexchange.com/users/1090
|
690581
| 320,354 |
https://tex.stackexchange.com/questions/690572
|
0
|
I want to normalize string in python. For example, I have a LaTeX code
```
str='{{{ \\dfrac{{3}}{{4}} + \\sqrt{3} }}}'
```
I want to get the string
```
str='{\\dfrac{3}{4}+\\sqrt{3}}'
```
Remove extra spaces and curly braces (ex: `{{3}}-->{3}`,... )
Please, help me! Thanks!
|
https://tex.stackexchange.com/users/245914
|
Remove extra spaces and curly braces latex code in string Python (normalize string in python)
| true |
You can make the regexp more complicated to catch more deeply nested cases, and this will lose some significant white space such as `\mbox{ }` but....
```
import re
v=r"str='{{{ \\dfrac{{3}}{{4}} + \\sqrt{3} }}}'"
v=re.sub('([^a-zA-Z]) +', r'\1',v)
v2=re.sub('{{(([^{}]|{[^{}]*})*)}}',r'{\1}',v)
while v2 != v:
v=v2
v2=re.sub('{{(([^{}]|{[^{}]*})*)}}',r'{\1}',v)
print(v)
```
produces
```
str='{\\dfrac{3}{4}+\\sqrt{3}}'
```
|
1
|
https://tex.stackexchange.com/users/1090
|
690584
| 320,356 |
https://tex.stackexchange.com/questions/690583
|
3
|
I wanted to make one long equation over two lines, since the right hand side was very big, and tried to surround the entire right hand side with {} brackets, but failed to do so with the following code:
'''
```
\begin{align}
A &= - B \left\{ -C - D\left[ E \right. \notag \\
&\left. + F\right] \right\}
\end{align}
'''
```
Executing this LaTex code does not output the correct parentheses for the right hand side, and there is one missing } symbol.
How do I successfully display another } symbol?
|
https://tex.stackexchange.com/users/300354
|
\left. and \right. delimiter is not working
| true |
You need 2 `\right.` statements toward the end of line 1 and 2 `\left.` statements near the beginning of line 2. This is because matching `\left`-`\right` pairs are not allowed to be interrupted by line breaks.
```
\documentclass{article}
\usepackage{amsmath} % for 'align*' env.
\begin{document}
\begin{align*}
A &= B \left\{ C + D\left[ E \right.\right. \\
&\quad \left. \left. {}+ F \right]\right\}
\end{align*}
\end{document}
```
|
4
|
https://tex.stackexchange.com/users/5001
|
690585
| 320,357 |
https://tex.stackexchange.com/questions/690455
|
1
|
I would like to input the body of a lyx file into a tex file.
Currently I convert the .lyx file (say child.lyx) to child.tex in Lyx with `File > Export > Latex`, and use `\input{child.tex}` in the main .tex document, also using the standalone package to only copy the body, which works.
Somehow, if I have my main document in `LyX` and use `\input{}` in Lyx (`Insert > File > Child Document ...`), it works as well, but directly using `\input{child.lyx}` in `LaTeX` doesn't work.
Is there a way to avoid the conversion step, so that I could simply write in child.lyx and compile main.tex file, without having to convert the lyx file first each time?
|
https://tex.stackexchange.com/users/300275
|
How to input lyx file into .tex file
| false |
LyX is mainly a front-end to LaTeX format (and other formats, but this is another history) and it seems able to convert the main and child LyX files to a PDF directly, but in the background, making the PDFs is the exclusive business of LaTeX.
LaTeX is not at all a front-end of LyX, it have no idea about any other format, so simply it cannot manage `\input{child.lyx}`.
In the screen you can see `Input: child.lyx` but if you open un the menu the `Code Preview Pane` you will see that the latex version will be `\input{child.tex}`. LyX will take care of export the child files behind the scenes when needed, but for LaTeX, the LyX files are a parallel universe.
Note that in LaTeX he extension `.tex` is assumed when `\input` or `\include` have an argument without extension tha is not found (e.g.: `\input{foo}` search first for file `foo.tex` and if this file does not exist, will search only `foo`). For some unknown reason, LyX omit the extension only for `\include`, so `Include: child.lyx` will be exported as `\include{child}` instead of `\include{child.tex}` but in any case Latex will search for `child.tex`.
|
1
|
https://tex.stackexchange.com/users/11604
|
690588
| 320,359 |
https://tex.stackexchange.com/questions/112580
|
22
|
I am trying to rescale a math symbol while using the `amsbook` package. At first I was using the `relsize` package, but it creates clashes with the AMS packages: [Amsart with algorithm2e introduces extraneous text into pdf file with Texlive 2011](https://tex.stackexchange.com/questions/30986/amsart-with-algorithm2e-introduces-extraneous-text-into-pdf-file-with-texlive-20/30990#30990).
Then, I read here [Change font size relative to current font size](https://tex.stackexchange.com/questions/56676/change-font-size-relative-to-current-font-size) that the `amsbook` has a similar option. I looked it up, and there is the `\larger` command. But it doesn't work. I used:
```
\newcommand{\Alpha}{\larger{\alpha}}
```
and the `\alpha` does not change in size.
Any ideas how to rescale the `\alpha` so that it is relatively larger (I used to use `mathlarger` from `relsize` which worked fine, but created clashes with AMS packages, as I said)?
|
https://tex.stackexchange.com/users/1970
|
Rescaling a math symbol?
| false |
with this code:
```
\documentclass{article}
\usepackage{scalerel}[2016/12/29]
\newcommand{\B}[2]{\scaleobj{#2}{#1}}
\begin{document}
$\B{\alpha}{2.5}\alpha\B{\beta}{5}$
\end{document}
```
You have this result:
The code define a new command with 2 mandatory argument:
#1 the character to scale,
#2 the scale factor
|
0
|
https://tex.stackexchange.com/users/24644
|
690592
| 320,360 |
https://tex.stackexchange.com/questions/690596
|
1
|
Trying to solve this Problem i got so many Problems.
First of all, how should you deal with sources that just don't have a Year or an author, like non-Static websites... of course, you have `urldate` but at least `natbib` (witch I am currently using) doesn't seem to know how to deal with it...
Over all `natbib` just doesn't want to work.
`Bib.bib`:
```
@Article{Alonso2004,
author = {Angel Alonso and Marcos Reyes and Zoran Sodnik},
title = {Performance of satellite-to-ground communications link between {ARTEMIS} and the Optical Ground Station},
year = {2004},
month = {nov},
abstract = {...},
booktitle = {{SPIE} Proceedings},
doi = {10.1117/12.565516},
editor = {John D. Gonglewski and Karin Stein},
priority = {prio1},
publisher = {{SPIE}},
ranking = {rank5},
readstatus = {skimmed},
}
@Misc{modulationPicture,
author = {Michel Bakni},
howpublished = {CC BY-SA 4.0 <https://creativecommons.org/licenses/by-sa/4.0>, via Wikimedia Commons},
title = {Modulation Übersichts Bild},
groups = {Bilder},
url = {https://upload.wikimedia.org/wikipedia/commons/e/e7/Modulation_categorization.svg},
}
@Misc{DIN44302,
title = {DIN 44302},
}
@Website{starlink,
groups = {Websites},
timestamp = {2023-07-08},
title = {Starlink},
url = {https://www.starlink.com},
urldate = {2023-07-03},
}
```
My `.tex`:
```
\documentclass[a4paper,12pt]{scrreprt}
\usepackage[square , sort&compress]{natbib}
\begin{document}
\chapter{Exam}
Some Text\cite[p. 250]{Alonso2004}
\bibliography{bib}
\bibliographystyle{plainnat}
\end{document}
```
As you see I have many Entries that don't have a clear Year.
I get following Error `Package natbib Error: Bibliography not compatible with author-year citations.` that hinders Compiling.
One solution I could think of was switching between a Number and Author Year based Citation Style. Is ther a way to do that in LaTeX?
Thanks to all of you trying to help me!!!
Edit:*emphasized text*
1. sqare to square
|
https://tex.stackexchange.com/users/300371
|
How to use an Author Name based Citation style with unusual Sources
| false |
>
> One solution I could think of was switching between a Number and Author Year based Citation Style. Is ther[e] a way to do that in LaTeX?
>
>
>
Short answer: Yes.
Slightly longer answer: Change
```
\usepackage[square, sort&compress]{natbib}
```
to
```
\usepackage[numbers, square, sort&compress]{natbib}
```
and perform a full recompile cycle -- LaTeX, BibTeX, and LaTeX twice more.
|
0
|
https://tex.stackexchange.com/users/5001
|
690597
| 320,361 |
https://tex.stackexchange.com/questions/690606
|
1
|
I have some legacy LaTeX files that use the siunitx and units package. A minum working example is below:
```
\documentclass{article}
\usepackage{siunitx}
\usepackage{units} % Line 3
\begin{document}
$1\unit{F}$
\end{document}
```
These files work well on most platforms, like Fedora 37 and Overleaf. However, on Debian 12, I receive this error:
```
$ pdflatex a.tex
...
! Package siunitx Error: Package 'units' incompatible.
For immediate help type H <return>.
...
l.4 \begin{document}
?
```
If I comment Line 3 of my LaTeX file, it works on Debian. However, after this change the file no longer works on other platforms. The error I get (on Fedora 37) is:
```
! Undefined control sequence.
l.5 $1\unit
{F}$
?
```
Is there a way to modify my LaTeX file so it works on all platforms? Otherwise, is there anything wrong with my Debian 12 LaTeX installation? (Please let me know if I should re-post this question on Super User etc.) I am installing LaTeX on Debian 12 using:
```
apt-get install texlive-full
```
The version of the installed `texlive-science` package is 2022.20230122-4
|
https://tex.stackexchange.com/users/146057
|
How to resolve Debian incompatibility between siunitx and units packages
| true |
`siunitx` was first released in 2008, with the intention that anyone picking it up would move away from older packages. For v2, it was possible to load both `siunitx` and `units`: I adjusted this in v3 to have better command names. Presuming you are happy to use the v3 names, you could do
```
\usepackage{siunitx}
\ifdefined\unit\else
\NewDocumentCommand\unit{m}{\si{#1}}
\fi
```
to allow you to use `siunitx` to provide `\unit` whether you have v2 or v3.
|
1
|
https://tex.stackexchange.com/users/73
|
690609
| 320,367 |
https://tex.stackexchange.com/questions/588
|
136
|
Sometimes the margins need to be changed for a particular page, paragraph, or other section of text. For example, if I'm writing a letter and want the left margin to be almost at the right side of the page for the four lines of my address, or if I am combining prose with poetry and want the poems to be indented relative to the rest of the work.
What is the best way to change both left and right margins on the fly?
|
https://tex.stackexchange.com/users/32
|
How can I change the margins for only part of the text?
| false |
Expanding on [Vivi’s answer](https://tex.stackexchange.com/a/600/5161), it's possible to use the `list` environment and manually change all other list parameters to whatever values are in effect in the surrounding text:
```
\ExplSyntaxOn
\NewDocumentEnvironment{addmargin}{mm}{
\list{}{
\UseName{@beginparpenalty}=0
\UseName{@itempenalty}=0
\UseName{@endparpenalty}=0
\setlength{\leftmargin}{#1} % Use `setlength' so calc will evaluate expressions
\setlength{\rightmargin}{#2}
\labelwidth=0pt
\labelsep=0pt
\itemindent=\parindent
\listparindent=\parindent
\parsep=\parskip
\topsep=0pt
\partopsep=0pt
\itemsep=0pt
}
\item[]
}{
\endlist
}
\ExplSyntaxOff
```
|
0
|
https://tex.stackexchange.com/users/5161
|
690619
| 320,371 |
https://tex.stackexchange.com/questions/690615
|
1
|
In the `masters-doctoral-thesis` template, the language is chosen when the document class is called in the main and is applied to the whole thesis. However, I would like to mention some proverbs in Arabic in one specific page. Is this possible?
Here is my MWE:
```
\documentclass[
10=2pt, % The default document font size, options: 10pt, 11pt, 12pt
%oneside, % Two side (alternating margins) for binding by default, uncomment to switch to one side
english, % ngerman for German
singlespacing, % Single line spacing, alternatives: onehalfspacing or doublespacing
%draft, % Uncomment to enable draft mode (no pictures, no links, overfull hboxes indicated)
%nolistspacing, % If the document is onehalfspacing or doublespacing, uncomment this to set spacing in lists to single
liststotoc, % Uncomment to add the list of figures/tables/etc to the table of contents
toctotoc, % Uncomment to add the main table of contents to the table of contents
parskip, % Uncomment to add space between paragraphs
nohyperref, % Uncomment to not load the hyperref package
headsepline, % Uncomment to get a line under the header
%chapterinoneline, % Uncomment to place the chapter title next to the number on one line
%consistentlayout, % Uncomment to change the layout of the declaration, abstract and acknowledgements pages to match the default layout
]{MastersDoctoralThesis} % The class file specifying the document structure
\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters
\usepackage{ragged2e}
\usepackage{booktabs,multirow}
\usepackage{tikz}
\usetikzlibrary{arrows,arrows.meta,fit,matrix,shapes,positioning,decorations.pathreplacing,calc,calligraphy,shadows}
\usepackage{svg}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{setspace}
\usepackage{xcolor}
\usepackage{csquotes}
\usepackage{color}
\usepackage{colortbl}
\definecolor{darkgreen}{RGB}{0,100,0}
\definecolor{khrawi2}{RGB}{220,200,90}
\definecolor{khrawi}{RGB}{85,34,0}
\definecolor{yellow}{RGB}{255,255,0}
\definecolor{noir}{RGB}{0,0,0}
\definecolor{gray}{RGB}{200,51,51}
\definecolor{mapink}{RGB}{255,169,169}
\definecolor{mablue}{RGB}{33,190,208}
\definecolor{hotpink}{RGB}{255,105,180}
\colorlet{linkequation}{darkgreen}
\usepackage{enumitem}
\usepackage{nicematrix}
\usepackage{subcaption}
\captionsetup[subfigure]{labelfont=rm}
\usepackage{circuitikz}
\usepackage{lettrine}
\usepackage{geometry}
\usepackage{amssymb}
\usepackage{asymptote}
\usepackage{mathtools}
\usepackage{etoc}
\usepackage{xfrac}
\usepackage{nicefrac}
\usepackage{subcaption}
\usepackage{bigdelim}
\usepackage{datetime}
\usepackage{slashbox}
\usepackage{scalefnt}
\usepackage{float}
\usepackage{tocloft}
\usepackage{mathpazo}
\usepackage[style=ieee,backend=bibtex]{biblatex}
\usepackage[bottom]{footmisc}
\usepackage{array}
%-------------------------------------------------------------------------------------
% MARGIN SETTINGS
%-------------------------------------------------------------------------------------
\geometry{
% papersize={176mm,256mm}
paper=b5paper,left=15mm,right=15mm,top=6mm,bottom=6mm,layouthoffset=3mm,layoutvoffset=3mm
}
\begin{document}
I need a new page here where I say stuff in arabic and then switch back to english
%example of what I want to say in arabic وَيَجهَدُ الناسُ في الدُنيا مُنافَسَةً
% وَلَيسَ لِلناسِ شَيءٌ غَيرَ ما رُزِقوا
\end{document}
```
|
https://tex.stackexchange.com/users/225587
|
Change language in one page to arabic when using MasterDoctoralThesis
| false |
I’m assuming you are using the document class found in this repository: <https://github.com/jaredjstewart/Masters-Project> , and… it has a lot going on plus all the packages you are using, but there is a quick solution (I think) that may help you.
Quick solution
--------------
Use the `arabtex` package following the instructions found in [Overleaf](https://www.overleaf.com/learn/latex/Arabic)! The only patching necessary in your code is to add said package, call the `utf8` package and setup the Unicode inputs. Then you can use Arabic text inside a custom environment called “`RLtext`”. That part of your code should look like this:
```
% A lot of packages above
\usepackage{array}
\usepackage{arabtex}
\usepackage{utf8}
%-------------------------------------------------------------------------------------
% MARGIN SETTINGS
%-------------------------------------------------------------------------------------
\geometry{
% papersize={176mm,256mm}
paper=b5paper,left=15mm,right=15mm,top=6mm,bottom=6mm,layouthoffset=3mm,layoutvoffset=3mm
}
\setcode{utf8}
\begin{document}
I need a new page here where I say stuff in arabic and then switch back to english
Example of what I want to say in arabic:
\begin{RLtext}
وَيَجهَدُ الناسُ في الدُنيا مُنافَسَةً
وَلَيسَ لِلناسِ شَيءٌ غَيرَ ما رُزِقوا
\end{RLtext}
But I can do english right away now!
\end{document}
```
The `RLtext` environment should only contain Arabic characters, Latin characters will get discarded if you use them inside that environment. The output should look like this!
If you really need to combine English and Arabic in the same line, you can use the `\RL` command as follows:
```
This text is in \RL{اَلْعَرَبيَّةُ}!
```
Which yields:
A better solution
-----------------
The previous solution relies on a font style defined in the `arabtex` package, and I’m not sure how customizable that is or if you’ll be able to work around it with italicization, bold faces, etc. A better way to handle multilingual text is by using another font, which is done mostly in `XeTeX` or `LuaTeX`. Most Windows fonts have a full character map for Arabic characters for several fonts, so you can try changing them using `fontspec` as shown in [this example](https://tex.stackexchange.com/questions/593104/how-to-use-fontspec-in-details) using any font you like and simply pasting your Arabic text as-is without much modification!
Now, for extended features, you may want to patch too the babel package which is called in the `MasterDoctoralThesis` class, it is found in line 129 and that part should look like this:
```
% A lot above...
%----------------------------------------------------------------------------------------
% REQUIRED PACKAGES
%----------------------------------------------------------------------------------------
\usepackage{babel} % Required for automatically changing names of document elements to languages besides english
\RequirePackage{scrbase} % Required for handling language-dependent names of sections/document elements
\RequirePackage{scrhack} % Loads fixes for various packages
% A lot below...
```
The patch you may want to apply if you go this route is the following.
```
% A lot above...
%----------------------------------------------------------------------------------------
% REQUIRED PACKAGES
%----------------------------------------------------------------------------------------
\usepackage[utf8]{inputenc}
\usepackage[LAE,LFE]{fontenc}
\usepackage[english,farsi,arabic]{babel} % Required for automatically changing names of document elements to languages besides english
\RequirePackage{scrbase} % Required for handling language-dependent names of sections/document elements
\RequirePackage{scrhack} % Loads fixes for various packages
% A lot below...
```
This will allow you to use Arabic or any other language however and whenever you want, provided you use `\selectlanguage` each time you need to swap from English to other. The full extent of this method can be seen in [this manual](https://usermanual.wiki/Document/userguide.1814710938/view).
Hope that helps!
|
1
|
https://tex.stackexchange.com/users/300379
|
690620
| 320,372 |
https://tex.stackexchange.com/questions/690631
|
1
|
I would like to draw a table in latex, but I have a problem with the long content of a couple of cells. So, I want to make it taller instead of being wide and have all the information on one page neatly. My code is appended below.
```
\documentclass{article}
\begin{document}
\begin{table}
\begin{tabular}{|c|c|c|c|c|c|}
Size & $u$ & $v$ & $W_{u,v} $ & $W_u^v$ & $W_{v,u}$ \\
\hline
$n=3$ & $0001$ & $0002$ &
$0001, 1001, 1002, 1012, 1102, 1112, 1003, 1013$ &
$0011, 1011, 0012, 0112, 0003, 0013, 1103, 1113$ &
$0101, 0111, 1101, 1111, 0002, 0102, 0103, 0113$
\end{tabular}
\end{table}
\end{document}
```
|
https://tex.stackexchange.com/users/62948
|
Automatically adjust the table cells
| true |
As I said in my comment, a possible (nice) solution is to enable, that in the last three columns you enable to break content into several lines. This can be done by use of of columns type `p{<width>}` or `>{\centering\arraybaykslash}X` columns of package `tabularx` or `X[c]` columns of `tabularray` package. The last one enables to write simple and concise table code:
```
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{amsmath}
\begin{document}
\begin{table}
\begin{tblr}{hlines, vlines,
colspec = {Q[c, mode=math] cc *{3}{X[c]}},
colsep = 4pt,
row{1} = {mode=math}
}
\text{Size}
& u & v & W_{u,v} & W_u^v & W_{v,u} \\
n=3 & 0001
& 0002
& 0001, 1001, 1002, 1012, 1102, 1112, 1003, 1013
& 0011, 1011, 0012, 0112, 0003, 0013, 1103, 1113
& 0101, 0111, 1101, 1111, 0002, 0102, 0103, 0113
\end{tblr}
\end{table}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/18189
|
690643
| 320,382 |
https://tex.stackexchange.com/questions/690638
|
2
|
The following example:
```
Following \cite{XXX,YYY,ZZZ}, we use mean squared error...
```
Generates the text
>
> Following XXX (1974); YYY (1991); ZZZ (2021), we use mean squared error...
>
>
>
Is this the right way to cite multiple sources in a singular context? Or should I break it up and say `\cite{XXX}, \cite{YYY} and \cite{ZZZ}`?
|
https://tex.stackexchange.com/users/187661
|
Multiple citations in a singular context
| true |
Note that this query and my answer are more about English language syntax than about LaTeX, bibtex, or biblatex.
With "textual" citation call-outs, it's important to generate a citation call-out that could be read out loud "as is", i.e., without the reader having to spend time figuring out where in the sentence a pause -- or a lack thereof -- should be thrown in. The answer to the OP's question tends to come down to this:
* If XXX, YYY, and ZZZ are by 3 separate authors (or author groups), it's best to have three separate `\citet` instructions:
```
As argued by \citet{XXX}, \citet{YYY}, and \citet{ZZZ}, \dots
```
* Conversely, if XXX, YYY, and ZZZ are all by the author(s), it's natural to have a single `\citet` instruction:
```
As argued by \citet{XXX,YYY,ZZZ}, \dots
```
* Finally, if 2 of the 3 are by the same author(s), it's natural to write
```
As argued by \citet{XXX,ZZZ} and \citet{YYY}, \dots
```
Let me note once more that these "rules" are *not* set in stone. For sure, depending on the situation, it can be entirely ok to deviate from these rules.
|
3
|
https://tex.stackexchange.com/users/5001
|
690646
| 320,385 |
https://tex.stackexchange.com/questions/690639
|
1
|
Currently, I place appendix buttons in beamer using this command:
```
\newcommand{\appendixbuttons}[1]{
\begin{textblock}{16}(0,14.75)
\raggedleft
#1
\end{textblock}
}
```
However, when I hide slides using `presentation:0`, the buttons appear on the following slides.
It seems like textblock does not respect `presentation:0`.
Anyway to hide textblocks in hidden frames?
(also, other non-TikZ solutions that place buttons at the bottom-right corner without changing the slide layouts, are also appreciated)
Edit: I added a minimal working example:
If I hide the first frame (using `<presentation:0>`) the button appears on the second frame.
```
\documentclass[10pt,aspectratio=169]{beamer} %,handout,aspectratio=169,
\usepackage[absolute,overlay]{textpos} % position text boxes
\newcommand{\appendixbuttons}[1]{
\begin{textblock}{16}(0,14.75)
\raggedleft
#1
\end{textblock}
}
\title{Beamer Template}
\begin{document}
\begin{frame}[noframenumbering,plain]
\maketitle
\end{frame}
%------------------------
\begin{frame}{Frame 1}
%\begin{frame}<presentation:0>[noframenumbering]{Frame 1}
Blah Blah
\appendixbuttons{
\hyperlink{mylink}{\beamerbutton{ref}}
}
\end{frame}
%------------------------
%------------------------
\begin{frame}{Frame 2}
Blah Blah
\end{frame}
%------------------------
%------------------------
\begin{frame}[label=mylink]{Frame 3}
Blah Blah
\end{frame}
%------------------------
\end{document}
```
|
https://tex.stackexchange.com/users/300400
|
texpos's textblock and presentation:0
| true |
You can warp the whole frame in `\mode<presentation:0>{...}` to hide the frame and the button:
```
\documentclass[10pt,aspectratio=169]{beamer} %,handout,aspectratio=169,
\usepackage[absolute]{textpos} % position text boxes
\setbeamercolor{background canvas}{bg=}
\newcommand{\appendixbuttons}[1]{
\begin{textblock}{16}(0,14.75)
\raggedleft
#1
\end{textblock}
}
\title{Beamer Template}
\begin{document}
\begin{frame}[noframenumbering,plain]
\maketitle
\end{frame}
\mode<presentation:0>{
\begin{frame}[noframenumbering]{Frame 1}
Blah Blah
\appendixbuttons{
\hyperlink{mylink}{\beamerbutton{ref}}
}
\end{frame}
}
%------------------------
%------------------------
\begin{frame}{Frame 2}
Blah Blah
\end{frame}
%------------------------
%------------------------
\begin{frame}[label=mylink]{Frame 3}
Blah Blah
\end{frame}
%------------------------
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/36296
|
690650
| 320,386 |
https://tex.stackexchange.com/questions/690654
|
3
|
I want to have a matrix, where on the left side I have left brace with n written on it. But the current code I have does not produce the desired result. The left brace is not drawn due to some issue with `SubMatrix`, and moreover, submatrices `\mathbf{A}_1` and `\mathbf{A}_2` are moved one column to the right. Any idea how to do this?
```
\documentclass{article}
\usepackage{amsmath,nicematrix}
\begin{document}
\[
\begin{bNiceArray}[last-col,margin]{w{c}{5em}|w{c}{3em}}
\\
\hspace*{-3cm} n & \mathbf{A}_1 & \mathbf{A}_2 \\
\\
\CodeAfter
\OverBrace[yshift=5pt]{1-1}{2-2}{\mathbf{A}}
\UnderBrace[yshift=5pt]{1-1}{3-1}{m_2}
\UnderBrace[yshift=5pt]{2-2}{3-2}{m_1}
\SubMatrix{\{}{1-1}{3-2}{.}[left-xshift=22pt]
\end{bNiceArray}
\]
\end{document}
```
|
https://tex.stackexchange.com/users/25588
|
How to put left brace in nicematrix?
| true |
You probably wanted to use `first-col` and not `last-col`...
```
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\[
\begin{bNiceArray}[first-col,margin]{w{c}{5em}|w{c}{3em}}
\\
n\hspace*{3mm} & \mathbf{A}_1 & \mathbf{A}_2 \\
\\
\CodeAfter
\OverBrace[yshift=5pt]{1-1}{2-2}{\mathbf{A}}
\UnderBrace[yshift=5pt]{1-1}{3-1}{m_2}
\UnderBrace[yshift=5pt]{2-2}{3-2}{m_1}
\SubMatrix{\{}{1-1}{3-2}{.}[left-xshift=27pt]
\end{bNiceArray}
\]
\end{document}
```
|
5
|
https://tex.stackexchange.com/users/163000
|
690655
| 320,389 |
https://tex.stackexchange.com/questions/690658
|
2
|
I am working on my master's thesis. I have to put a specific page for the thesis to be approved by the discussion committee at the beginning.
This page is found in the University's Thesis Writing Guide and has a specific format that I cannot change, in terms of font types, font sizes, margins, etc. So I created it in Word and then inserted it into a latex document as a PDF.
Now I want to add this page to the table of contents.
I tried using the command
```
\addcontentsline{toc}{chapter}{Examination Committee Approval}
```
but I encountered two problems: First, a blank page was added before the approval page. Second, when clicking on the page in the table of contents, it goes to the beginning of the thesis, not to the Approval page itself.
I also tried this command
```
\addtocontents{toc}{\textbf{\color{blue}Examination Committee Approval}}
```
The page was added in the ToC as a text without a link to the page and without numbering as well.
Is there any way I can add this page to the ToC without problems?
The document type that I use is "extreport" with `TexStudio Editor`
**Edit:**
This is part of my work, maybe it helps finding the issue:
```
\documentclass[a4paper,14pt]{extreport}
\usepackage{graphicx}
\usepackage{hyperref}
\hypersetup{colorlinks=true,linkcolor=blue,filecolor=magenta,urlcolor=cyan,citecolor=black,linktocpage=false,hyperindex=true}
\begin{document}
\pagenumbering{Roman}
\newpage
\addcontentsline{toc}{chapter}{Examination Committee Approval}
\begin{center}
\makebox[\textwidth]{\includegraphics[width=\paperwidth]{approval page en}}
\end{center}
\newpage
\tableofcontents
\addcontentsline{toc}{chapter}{Contents}
\end{document}
```
|
https://tex.stackexchange.com/users/292454
|
How to add a specific page to the table of contents in LaTeX?
| false |
I got it working by adding `\phantomsection` right before the `\addcontentsline` command, and placing both inside `\makebox`.
```
\newpage
\begin{center}
\makebox[\textwidth]{
\phantomsection
\addcontentsline{toc}{chapter}{Examination Committee Approval}
\includegraphics[width=\paperwidth]{deutsch.jpg}
}
\end{center}
```
|
2
|
https://tex.stackexchange.com/users/286680
|
690663
| 320,390 |
https://tex.stackexchange.com/questions/690664
|
0
|
I wanted to align a table of equations all left, no numbering needed.
A similar question was asked before, but not answered in a way useful to me:
[Align equation left](https://tex.stackexchange.com/questions/145657/align-equation-left)
The page urged me to ask my own question since I do not have enough reputation. But I have figured it out, so the answer is below.
|
https://tex.stackexchange.com/users/258326
|
Align equations on the left
| false |
There you go:
```
\begin{align*}
&f(x)=x^2 &&f(x,y)=x^2+y^2\\
&f(x,y)=x^2+y^2 &&f(x,y,z)=x^2+y^2+z^2\\
&g(f(x))=f^3/\sqrt{2} &&h(\circ)=\circ^\circ.
\end{align*}
```
It gives the following output:
No need for environments other than align. Hope this helps some googlers out there to get to a quick solution.
|
0
|
https://tex.stackexchange.com/users/258326
|
690665
| 320,391 |
https://tex.stackexchange.com/questions/146019
|
2
|
I am using tikz library files from this [question](https://tex.stackexchange.com/questions/45347/vertical-and-horizontal-lines-in-pgf-tikz).
I use the code: `\usetikzlibrary{paths.ortho}`
and put files [tikzlibrarypaths.ortho.code.tex](https://github.com/Qrrbrbirlbel/pgf/blob/master/tikzlibrarypaths.ortho.code.tex) and [tikzlibrarypaths.ortho.tex](https://github.com/Qrrbrbirlbel/pgf/blob/master/tikzlibrarypaths.ortho.tex) in the root folder.
I wanted to know if it is possible to put the files into some other subfolder to utilise it? I just wanted to know it for better organization of my latex code.
Thanks !
|
https://tex.stackexchange.com/users/15030
|
Tikz library files at given path
| false |
See also this related question
[Add search path for \usetikzlibrary](https://tex.stackexchange.com/questions/685186/add-search-path-for-usetikzlibrary), basically it is possible to add symlinks, or to use
```
\makeatletter
% Adds a subfolder to the search path
\def\input@path{{subfolder}}
% Tells tikz not to use its default input mechanism, but one that can recognize
% input@path
\let\pgfutil@IfFileExists =\IfFileExists
\let\pgfutil@InputIfFileExists=\InputIfFileExists
\makeatother
```
then, use:
```
\usetikzlibrary{my.test}
```
as before (but it seems like libraries installed systemwide may have priority over `\input@path`… need to double check).
|
0
|
https://tex.stackexchange.com/users/116348
|
690669
| 320,392 |
https://tex.stackexchange.com/questions/690648
|
2
|
The following code will draw a sequence of length 2 bit-strings:
```
\documentclass[tikz]{standalone}
\usetikzlibrary{chains}
\begin{document}
\begin{tikzpicture}[
2-bin helper/.code 2 args={#1 #2},
2-bin 00/.style={fill=cyan!50!green!50},
2-bin 10/.style={fill=green!50!yellow},
2-bin 01/.style={fill=red},
2-bin 11/.style={fill=black, text=white},
start chain=going right,
node distance=.1em, inner xsep=.1em, % A is the widest character:
every on chain/.append style={text width=width("A"), align=center}]
\sffamily
\node[every on chain] at (-5mm,0) {A B};
\foreach \binary in {10,01,10,01,10,01,10,01,00,00,00,00,00,00,00,11}
\node[on chain, 2-bin \binary] {\tikzset{2-bin helper/.expand once=\binary}};
\end{tikzpicture}
\end{document}
```
How can I modify it to draw length 3 bitstrings?
|
https://tex.stackexchange.com/users/92346
|
Draw sequence of coloured rectangled fix-length bit-strings
| true |
With `shapes.multipart` Ti*k*Z library and `ifthen` package:
```
\documentclass[tikz]{standalone}
\usetikzlibrary{chains,
shapes.multipart}
\usepackage{ifthen}
\begin{document}
\begin{tikzpicture}[
node distance = 1 pt,
start chain = going right,
mpnv/.style args = {#1/#2/#3}{% multi part node vertical % <---
rectangle split, rectangle split parts=3,
minimum width=1em, inner ysep=1pt,
font = \sffamily,
node contents = {\nodepart{one} #1
\nodepart{two} #2
\nodepart{three}#3},
on chain},
E/.style = {fill=red!30},
O/.style = {fill=cyan!30}
]
\node[mpnv=A/B/C];
\foreach \i/\j/\k [count=\m] in {0/0/0, 0/0/1, 0/1/0, 0/1/1, 1/0/0, 1/0/1, 1/1/0, 1/1/1,
0/0/0, 0/0/1, 0/1/0, 0/1/1, 1/0/0 } % whatever is here
{
\ifnum\m>8
\node[fill=olive, mpnv=\i/\j/\k];
\else
\ifthenelse{\isodd{\m}}
{\node[O, mpnv=\i/\j/\k]}
{\node[E, mpnv=\i/\j/\k]};
\fi
}
\end{tikzpicture}
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/18189
|
690675
| 320,396 |
https://tex.stackexchange.com/questions/7776
|
14
|
I'm using Miktex 2.9 on windows 7 x32, texniccenter as IDE. I encounter an error for a project that worked few days ago: when I compile, I get the message:
```
! I can't write on file `../preamble1.aux'.
```
The beginning of the .tex file is:
```
\documentclass[xcolor=dvipsnames]{beamer}
\include{../preamble1}
\begin{document}
```
What should I do?
Thanks.
|
https://tex.stackexchange.com/users/852
|
LaTeX error: can't write file
| false |
This is not related to the question directly, but one can get this same error for a different reason, and since this question is ranked first on google, I thought it might help others:
Note that you can also get this error if you try to create a file in a **subfolder that does not exists**.
|
1
|
https://tex.stackexchange.com/users/116348
|
690684
| 320,401 |
https://tex.stackexchange.com/questions/671319
|
1
|
After I upgraded my Macbook to Ventura 13.1 (previously it was running on Catalina, I don't know which version though), I can't compile any new documents. It doesn't even open the console window after pressing "Typeset".
I can alternate and typeset old documents without any troubles. (I am using Texshop and writing in Latex, compiling a pdf).
Can anyone help please?
|
https://tex.stackexchange.com/users/96108
|
TexShop doesn't compile any new documents after upgrading to Ventura 13.1
| false |
Yesterday I installed TeXLive/2023 beside TeXLive/2022 and it seemed to modify (upgrade?)
TeXShop (as I guessed from the dates of the files).
But I experienced the same problem mentioned on this forum: TeXShop.app did not work.
I tried to remedy to that with "brew upgrade TeXShop".
THe process took a very long time, thereby showing some errors (access denied to remove
several aliases to fonts), and failed in the end.
Some messages said that TeXLive was missing some files, apparently contained in
Library/tex/texlive/2016 (or similar), but I checked that I have nowhere in my hierarchy
"texlive/2016".
I finally succeeded to get no errors from the installation of "texlive/2023"
by going to the TeXLive page and clicking on the "upgrade" button.
That downloaded MacTeX.pkg, and clicking on it upgraded/modified? texlive/2023.
I left texlive/2022 in its previous state as advised in the TeXLive pages.
Then TeXShop opened, but even from the Terminal I could not induce it to open any .tex file.
Today I tried first "brew upgrade TeXShop". It was refused ("no cask for texshop").
Then I did a "brew install TeXShop". Everything went smooth, and success was announced.
TeXShop.app had been left in the same state as last night...
But this time it works !
|
0
|
https://tex.stackexchange.com/users/300432
|
690688
| 320,403 |
https://tex.stackexchange.com/questions/690656
|
1
|
There was a problem to slightly change the macro described in [Expandable macro that extracts the first character of UTF-8/cyrillic string without additional packages](https://tex.stackexchange.com/questions/631869/expandable-macro-that-extracts-the-first-character-of-utf-8-cyrillic-string-with) for the argument which may contain two or more words. That is, for example, for the argument Vladimir Fedorovich it would return V.F., and for Владимир Фёдорович - В.Ф.
Here is a working example by the highly respected **David Carlisle** for a one-word argument (of course it can contain many words, but only the first letter of the first word will be extracted):
```
\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}
\makeatletter
\newcommand{\firstof}[1]{\expandafter\checkfirst#1\@nil}
\def\checkfirst#1{%
\ifx\UTFviii@two@octets#1%
\expandafter\gettwooctets
\else
\expandafter\@car\expandafter#1%
\fi
}
\def\gettwooctets#1#2#3\@nil{\UTFviii@two@octets#1#2}
\makeatother
\begin{document}
\firstof{Vladimir}
\firstof{Владимир}
\end{document}
```
I need the `\firstof{Vladimir Fedorovich}` macro call to return `V.F.` and the call `\firstof{Владимир Фёдорович}` - `В.Ф.`. But theoretically, there can be more than 2 words in the argument.
I will be grateful for help.
|
https://tex.stackexchange.com/users/73294
|
Expandable macro that extracts the first characters of many words for UTF-8/cyrillic or UTF-8/ASCII string without additional packages
| true |
The following does what you want.
I coded it in L3 instead of on the low level David used. The basic idea is still the same, if it starts with something that expands to `\UTFviii@two@octets` we collect those two octets, else we just use the first character. However, this also uses `\text_purify:n` on the input to ensure the input to the loop is only text.
Then we simply split at each space (we have to check whether we're done with `\quark_if_recursion_tail_stop:n`) and get our first character (or the two that make up the UTF8 octet pair).
The macro `\firstofwords` takes as its first argument the stuff it should put after each first letter of each word, and the second argument is the list of words separated by spaces.
```
\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[russian]{babel}
\makeatletter
\newcommand{\firstof}[1]{\expandafter\checkfirst#1\@nil}
\def\checkfirst#1{%
\ifx\UTFviii@two@octets#1%
\expandafter\gettwooctets
\else
\expandafter\@car\expandafter#1%
\fi
}
\def\gettwooctets#1#2#3\@nil{\UTFviii@two@octets#1#2}
\ExplSyntaxOn
\cs_new:Npn \crosfield_first_of_words:nn #1#2
{ \exp_not:e { \__crosfield_first_of_words:e { \text_purify:n {#2} } {#1} } }
\group_begin:
\cs_set:Npn \__crosfield_tmp:n #1
{
\cs_new:Npn \__crosfield_first_of_words:n ##1 ##2
{
\__crosfield_first_of_words_spaces:nw {##2} ##1 #1 % #1 is a space
\q_recursion_tail #1 % #1 is a space
\q_recursion_stop
}
}
\__crosfield_tmp:n { ~ }
\group_end:
\cs_generate_variant:Nn \__crosfield_first_of_words:n { e }
\makeatletter
\cs_new:Npn \__crosfield_first_of_words_spaces:nw #1 #2 ~
{
\quark_if_recursion_tail_stop:n {#2}
\tl_if_head_eq_meaning:oNTF {#2} \UTFviii@two@octets
{ \__crosfield_first_of_words_aux:nnw #2 \q_stop }
{ \tl_head:n {#2} }
\exp_not:n {#1}
\__crosfield_first_of_words_spaces:nw {#1}
}
\makeatother
\cs_generate_variant:Nn \tl_if_head_eq_meaning:nNTF { o }
% there can't be a \q_stop in the argument as that would've caused an infinite
% loop in \text_purify:n, so this is fine and faster than allowing arbitrary
% contents.
\cs_new:Npn \__crosfield_first_of_words_aux:nnw #1#2#3 \q_stop
{ \exp_not:n { #1#2 } }
% define a LaTeX2e name for the above function
\cs_new_eq:NN \firstofwords \crosfield_first_of_words:nn
\ExplSyntaxOff
\begin{document}
\firstof{Vladimir}
\firstof{Владимир}
\firstofwords{.\ }{Vladimir Владимир} example
\firstofwords{.}{foo bar baz}
\end{document}
```
---
**Edit:** If you only need the second argument and want to put a `.` inbetween the first letters every time you can use the following instead of `\cs_new_eq:NN \firstofwords \crosfield_first_of_words:nn`:
```
\newcommand* \firstofwords { \crosfield_first_of_words:nn {.} }
```
---
**Edit2:**
This variant only places the first argument to `\firstofwords` between elements, but not after the last one.
```
\documentclass[varwidth,border=3.14]{standalone}
\usepackage[T2A]{fontenc}
\usepackage[russian]{babel}
\makeatletter
\newcommand{\firstof}[1]{\expandafter\checkfirst#1\@nil}
\def\checkfirst#1{%
\ifx\UTFviii@two@octets#1%
\expandafter\gettwooctets
\else
\expandafter\@car\expandafter#1%
\fi
}
\def\gettwooctets#1#2#3\@nil{\UTFviii@two@octets#1#2}
\ExplSyntaxOn
\cs_new:Npn \crosfield_first_of_words:nn #1#2
{ \exp_not:e { \__crosfield_first_of_words:e { \text_purify:n {#2} } {#1} } }
\group_begin:
\cs_set:Npn \__crosfield_tmp:n #1
{
\cs_new:Npn \__crosfield_first_of_words:n ##1 ##2
{
\__crosfield_first_of_words_spaces:Nnw \use_none:n {##2} ##1 #1 % #1 is a space
\q_recursion_tail #1 % #1 is a space
\q_recursion_stop
}
}
\__crosfield_tmp:n { ~ }
\group_end:
\cs_generate_variant:Nn \__crosfield_first_of_words:n { e }
\makeatletter
\cs_new:Npn \__crosfield_first_of_words_spaces:Nnw #1 #2 #3 ~
{
\quark_if_recursion_tail_stop:n {#3}
#1 {#2}
\tl_if_head_eq_meaning:oNTF {#3} \UTFviii@two@octets
{ \__crosfield_first_of_words_aux:nnw #3 \q_stop }
{ \tl_head:n {#3} }
\__crosfield_first_of_words_spaces:Nnw \exp_not:n {#2}
}
\makeatother
\cs_generate_variant:Nn \tl_if_head_eq_meaning:nNTF { o }
% there can't be a \q_stop in the argument as that would've caused an infinite
% loop in \text_purify:n, so this is fine and faster than allowing arbitrary
% contents.
\cs_new:Npn \__crosfield_first_of_words_aux:nnw #1#2#3 \q_stop
{ \exp_not:n { #1#2 } }
% define a LaTeX2e name for the above function
\cs_new_eq:NN \firstofwords \crosfield_first_of_words:nn
\ExplSyntaxOff
\begin{document}
\firstof{Vladimir}
\firstof{Владимир}
:\firstofwords{.\,}{Vladimir Владимир}.:
\firstofwords{.}{foo bar baz}
\end{document}
```
If you want to always use `.\,` between elements and a `.` after the last one you can use
```
\newcommand\firstofwords[1]{ \crosfield_first_of_words:nn {.\,} {#1} . }
```
Instead of the `\cs_new_eq:NN`-line.
|
7
|
https://tex.stackexchange.com/users/117050
|
690693
| 320,405 |
https://tex.stackexchange.com/questions/690702
|
1
|
For some reasons, I need to choose one or two character to delimit placeholders in LaTeX3 strings, like:
```
I like ``NAME`OF`FRUITS``
```
in order to allow a safer replace (hence the doubling of the first and last symbol to get rid of ambiguity) + easy reading.
But finding a good character is not that easy:
* Many characters have special meanings for LaTeX and babel that redefine many characters, like `^`, `_`, `-`, `;`, `~`, `#`, `@`… I’d prefer to avoid using them to avoid espace nightmares. And I don’t know all packages, and I’m sure that some popular packages can redefine other chars.
* I’m thinking that non-ascii characters might be an issue since they might be interpreted differently on different computers. In particular, I don’t know if `°` could be a valid choice.
Is there a list of character that are basically as safe as letters to use?
**EDIT**
Here is a more concrete use case I want to consider. I basically want to be sure that no matter what is around `\robExtGetPlaceholder{__VEGETABLE__}`, the `_` should not be turned into another symbol, even after loading a popular package.
```
\documentclass{article}
\ExplSyntaxOn
\seq_clear_new:N \l_robExt_placeholders_seq
% Make sure that the placeholder is in the list \l_robExt_placeholders_seq.
% This should automatically be called by other tools
\NewDocumentCommand{\robExtAddPlaceholderToList}{m}{
\seq_put_left:Nn \l_robExt_placeholders_seq { #1 }
}
\NewDocumentCommand{\robExtPlaceholderFromContent}{mm}{
\str_gset:cn { l_robExt_placeholder_#1_str } {#2}
\message{aaaaaaaaaaaaa#1}
\robExtAddPlaceholderToList{#1}
}
\NewDocumentCommand{\robExtDebugPlaceholder}{sm}{
\message{Placeholder ~ #2 ~ contains: ~ \use:c{l_robExt_placeholder_#2_str}}
\IfBooleanTF{#1}{\cs_show:c { l_robExt_placeholder_#2_str }}{}
}
\NewDocumentCommand{\robExtGetPlaceholder}{m}{
\use:c{l_robExt_placeholder_#1_str}
}
\NewDocumentCommand{\robExtDebugPlaceholdersContents}{s}{
\message{List ~ of ~ placeholders:}
\seq_map_inline:Nn \l_robExt_placeholders_seq {\robExtDebugPlaceholder{##1}}
\IfBooleanTF{#1}{\cs_show:N \l_robExt_placeholders_seq}{}
}
%% I also have other commands, for instance to replace placeholders etc...
\ExplSyntaxOff
\begin{document}
\robExtPlaceholderFromContent{__FRUIT__}{Orange}
\robExtPlaceholderFromContent{__SENTENCE__}{I like __FRUIT__ and __VEGETABLE__}
$\robExtPlaceholderFromContent{__VEGETABLE__}{Salad}$
\robExtDebugPlaceholdersContents*
Does it mean that whatever think is put around the get placeholder here, it will still be interpreted correctly? (no escape, no weird replacement of the character with another character…)
$1 + \robExtGetPlaceholder{__FRUIT__} + \robExtGetPlaceholder{__VEGETABLE__}$
\end{document}
```
|
https://tex.stackexchange.com/users/116348
|
Safe character to use as a separator in string
| false |
Edit
----
Turns out I was wrong on the assumption that some characters accessible by the Alt key were ASCII. While this workaround "works" it may introduce a plethora of unseen problems. Thanks to David Carlise for the clarification.
Original asnwer
---------------
Out of curiosity, I tested how far ~~classic ASCII~~ characters can be pushed to be used as functions or potentially escape characters as what you need, and turns out they run! At least in this example you can see something that may be close to your needs:
```
\documentclass{article}
\newcount\newcase
\newcase=0
\def♪{%
\ifnum\newcase=0
\newcase=1
\[
\else
\newcase=0
\]
\fi
}
\begin{document}
Musical math: ♪1+1=2♪
\end{document}
```
At least, this works on LaTeX while running under UTF-8. There is a caveat though: only one “especial character” can be defined at the same time, for instance, doing something like this:
```
\def♪{A thing}
\def♫{Another thing}
```
Will cause an “Use of � doesn't match its definition” error. I'm not entirely sure of the reason, but at least this seems to work for one “odd” definition. And in that one “odd” definition you can go wild with characters like ☺☻♪♫←↓→↑§ and more!
Hope that helps!
|
1
|
https://tex.stackexchange.com/users/300379
|
690704
| 320,407 |
https://tex.stackexchange.com/questions/690680
|
0
|
I would like to color the 6 different regions of a graph, delimited by curves, with different colors. It seems like I can only color one area at a time. This works to color one region:
```
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis y line = left,
axis x line = bottom,
xtick = {5,7},
xticklabels = {$\hat{z}_1$,$\hat{z}_2$},
ytick = {4},
yticklabels = {$\hat{b}_w$},
samples = 160,
domain = 0:10,
xmin = 0, xmax = 10,
ymin = 0, ymax = 10,
]
% path of axis
\path[name path=xaxis] (\pgfkeysvalueof{/pgfplots/xmin}, 0) -- (\pgfkeysvalueof{/pgfplots/xmax},0);
% Plot 1
\addplot[name path=A, black, no markers, domain=0:5] {4};
% FILL
\addplot[blue] fill between[of=A and xaxis, soft clip={domain=0:5}];
\addplot[name path=B thick,dashed,black] coordinates {(5, 0) (5, 10)};
\addplot[name path=C thick,dashed,black] coordinates {(7, 0) (7, 10)};
\addplot[name path=D thick,black] coordinates {(5,4) (7, 5)};
\end{axis}
\end{tikzpicture}
\end{document}
```
But if I add another line for fill between, for example:
```
\addplot[red] fill between[of=D and xaxis, soft clip={domain=5:7}];
```
I get the error: illegal unit of measure and the graph won't compile.
Any solution?
|
https://tex.stackexchange.com/users/300434
|
Color different regions of graph (tikz)
| false |
Because you haven't included your preamble in your code snippet, your code isn't a true minimal working example. As a result, your error about an illegal unit of measure is *unrelated to your problem with `fillbetween`*, and it must have occurred due to something else in your document.
The following code compiles without errors and provides the effect you want: two filled regions with boundaries defined by two curves. The error in your code is that you did not include a comma after `name path=D` which meant PGFPlots thought the name of the path was `D thick` rather than just `D`.
```
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepgfplotslibrary{fillbetween}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis y line = left,
axis x line = bottom,
xtick = {5,7},
xticklabels = {$\hat{z}_1$,$\hat{z}_2$},
ytick = {4},
yticklabels = {$\hat{b}_w$},
samples = 160,
domain = 0:10,
xmin = 0, xmax = 10,
ymin = 0, ymax = 10,
]
% path of axis
\path[name path=xaxis] (\pgfkeysvalueof{/pgfplots/xmin}, 0) -- (\pgfkeysvalueof{/pgfplots/xmax},0);
% Plot 1
\addplot[name path=A, black, no markers, domain=0:5] {4};
\addplot[name path=B, thick,dashed,black] coordinates {(5, 0) (5, 10)};
\addplot[name path=C, thick,dashed,black] coordinates {(7, 0) (7, 10)};
\addplot[name path=D, thick,black] coordinates {(5,4) (7, 5)};
% FILL
\addplot[blue] fill between[of=A and xaxis, soft clip={domain=0:5}];
\addplot[red] fill between[of=D and xaxis, soft clip={domain=5:7}];
\end{axis}
\end{tikzpicture}
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/91603
|
690707
| 320,409 |
https://tex.stackexchange.com/questions/690700
|
10
|
I want to define a macro in a group in LaTeX3 so that it stays defined after the group, but without using global variables. For now I do:
```
\documentclass{article}
\ExplSyntaxOn
\NewDocumentEnvironment{test}{}{}{
\str_clear_new:N \mytest
\str_put_right:Nx \mytest {I ~ like ~}
\str_gset_eq:NN \dummyvar \mytest
\group_insert_after:N \str_set_eq:NN
\group_insert_after:N \mytest
\group_insert_after:N \dummyvar
}
\ExplSyntaxOff
\begin{document}
\def\mytest{chocolate.}
{
\begin{test}
I’d like mytest to be defined at the end of the group without using global variables.
\end{test}
\mytest
}
\mytest
\end{document}
```
It works, but it seems really dirty, like I need to introduce a global dummy var etc… I tried to do:
```
\group_insert_after:N \str_set_eq:NN
\group_insert_after:N \mytest
\expandafter \group_insert_after:N \mytest
```
But funnily, the string is written backward now!! I also tried to generate a variant of `\group_insert_after:V` but it is forbidden.
|
https://tex.stackexchange.com/users/116348
|
Latex3: elegant way to forward a variable outside of the group
| false |
I understand that `\dummyvar` cannot work if you want to keep the meaning of more than single macro after group. But you can set a control sequence derived from the name of given control sequence:
```
\def\keepaftergroup#1{%
\global \expandafter\let \csname x:\string#1\endcsname =#1
\aftergroup\let
\aftergroup#1%
\expandafter\aftergroup \csname x:\string#1\endcsname
}
\def\mytest{nazdar}
{
\def\mytest{Hello}
\def\mysecond{Hi}
\keepaftergroup\mytest
\keepaftergroup\mysecond
Text in group.%
}
After group: \mytest, \mysecond
```
|
7
|
https://tex.stackexchange.com/users/51799
|
690710
| 320,410 |
https://tex.stackexchange.com/questions/690700
|
10
|
I want to define a macro in a group in LaTeX3 so that it stays defined after the group, but without using global variables. For now I do:
```
\documentclass{article}
\ExplSyntaxOn
\NewDocumentEnvironment{test}{}{}{
\str_clear_new:N \mytest
\str_put_right:Nx \mytest {I ~ like ~}
\str_gset_eq:NN \dummyvar \mytest
\group_insert_after:N \str_set_eq:NN
\group_insert_after:N \mytest
\group_insert_after:N \dummyvar
}
\ExplSyntaxOff
\begin{document}
\def\mytest{chocolate.}
{
\begin{test}
I’d like mytest to be defined at the end of the group without using global variables.
\end{test}
\mytest
}
\mytest
\end{document}
```
It works, but it seems really dirty, like I need to introduce a global dummy var etc… I tried to do:
```
\group_insert_after:N \str_set_eq:NN
\group_insert_after:N \mytest
\expandafter \group_insert_after:N \mytest
```
But funnily, the string is written backward now!! I also tried to generate a variant of `\group_insert_after:V` but it is forbidden.
|
https://tex.stackexchange.com/users/116348
|
Latex3: elegant way to forward a variable outside of the group
| false |
We do not currently have an 'escape from arbitrary group levels' function, largely as this is an unusual requirement. On the other hand, where you want to set a variable outside a group you control, this is quite straight-forward
```
\group_begin:
% Stuff happens
\str_set:Nn \l__mypkg_str { ... }
\exp_args:NNNV \group_end:
\str_set:Nn \l__mypkg_str \l__mypkg_str
```
and so on.
|
5
|
https://tex.stackexchange.com/users/73
|
690713
| 320,413 |
https://tex.stackexchange.com/questions/690714
|
0
|
As indicated in the title, I am trying to use several styles of `bibtex` on the same document.
Specifically, I would like to differentiate how I display citations in for `online` references, from how I display citations for `book` and `article` ones.
My need is to use `footcite` so that I can write in full the site from which I have taken the reference, whereas I would like to have citations of `book` and `article` displayed with a number and to be able to put them in square brackets.
Consider that at the moment, if I use `\cite` in book and article, I find the entire reference within the text.
The following is an MWE of what is currently happening.
```
\documentclass{book}
\usepackage[backend=biber,style=verbose-ibid,hyperref,backref]{biblatex}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\addbibresource{bibliography.bib}
\begin{document}
Cite book: \cite{ian:swe}\\
Cite article: \cite{paper:jira}\\
Cite website: \footcite{site:agile-manifesto}
\cleardoublepage
\chapter{Bibliografia}
% Print book bibliography
\printbibliography[heading=subbibliography,title={Riferimenti bibliografici},type=book]
% Print articles/paper
\printbibliography[heading=subbibliography,title={Pubblicazioni scientifiche},type=article]
% Print site bibliography
\printbibliography[heading=subbibliography,title={Siti web consultati},type=online]
\end{document}
```
`bibliography.bib`
```
@book{ian:swe,
title={Ingegneria del software},
author={Ian Sommerville},
isbn={9788891902245},
url={https://www.pearson.it/opera/pearson/0-6424-ingegneria_del_software},
year={2017},
publisher={Pearson}
}
@online{site:agile-manifesto,
title = {Manifesto Agile},
url = {https://agilemanifesto.org/iso/it/manifesto.html}
}
@article{paper:jira,
author = {Diamantopoulos, Themistoklis and Saoulidis, Nikolaos and Symeonidis, Andreas},
year = {2023},
month = {05},
title = {Automated issue assignment using topic modelling on Jira issue tracking data},
volume = {17},
journal = {IET Software},
doi = {10.1049/sfw2.12129}
}
```
|
https://tex.stackexchange.com/users/229795
|
Multiple bibtex styles for each type of reference
| false |
Your current style `verbose-ibid` will display citations in full. To use the bracket you need the style `numeric`. Then to display full citations in footnotes for online sources, you need to use `\footfullcite`.
However, note this will assign numbers to the online sources, which will not come back in the text.
So your citations will look like this:
And the bibliography like this:
|
0
|
https://tex.stackexchange.com/users/171704
|
690719
| 320,416 |
https://tex.stackexchange.com/questions/690720
|
4
|
I'm writing a book with two volumes, would like to have the TOC of both volumes in Vol.I.
Vol-One.tex:
```
\documentclass[12pt,a4paper,ngerman]{scrbook}
\usepackage[german]{babel}
\usepackage{xr}
\externaldocument{Vol-Two}
\pagestyle{headings}\markright{Begriffs--Sammlung}
\begin{document}
\title{Begriffs-- und Problemsammlung\\
zur Theoretischen Physik\\
\vspace*{24pt}I. Begriffe}
\author{Ralph v. Baltz}
\maketitle
% how to show TOC of both Vol.I and II?
\tableofcontents
\chapter[Grundbegriffe]{Grundbegriffe}
\label{GBegr}
Wenn wir von der Physik als Wissenschaft sprechen, so meinen wir einen Wissens-- und Erfahrungsschatz der
\emph{reproduzierbaren Ph\"anomene} der Natur,
den der Mensch im Lauf der Geschichte angesammelt und mit gro\ss em Erfolg systematisiert hat.
\newpage
\section{Physik, Mathematik und mehr}
Theorie als mathematisches Modell der Naturvorg\"ange.
Einstein ber\"uhmte Gleichung (\ref{eq1}).
\chapter{Mechanik}
Die Klassische Mechanik beschreibt ----
\section{Newton'sche Formulierung}
\end{document}
```
Vol-Two.tex:
```
\documentclass[12pt,a4paper,ngerman]{scrbook}
\usepackage[german]{babel}
\usepackage{xr}
\externaldocument{Vol-One}
\pagestyle{headings}\markright{Begriffs--Sammlung}
\renewcommand{\thechapter}{\Alph{chapter}}
\begin{document}
\title{Begriffs-- und Problemsammlung\\
\vspace*{12pt}zur Theoretischen Physik\\
\vspace*{24pt}II. Probleme}
\author{Ralph v. Baltz}
\maketitle
% here TOC of Volume II only.
\tableofcontents
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
\chapter{Grundbegriffe}
\section{Zwillingsparadoxon}
Zwillingsparadoxon, spektakul\"ar.
Eine Gleichung
\begin{equation}
E = m c^2
\label{eq1}
\end{equation}
\section{Wellengleichung}
Text ababababababa
\end{document}
```
|
https://tex.stackexchange.com/users/300277
|
How to combine ToC of two documents, Vol.I and Vol.II, to Vol.I?
| false |
You can try something like:
```
\begingroup
\makeatletter
\InputIfFileExists{Vol-Two.toc}{% USE THE SAME BASENAME AS FOR \externaldocument!
}{}%
\endgroup
```
after `\tableofcontents`. But because you are using KOMA-Script, I would recommend to automatically do this from within the document preamble using `\AfterStartingTOC`. You could also add a prefix to the page number to make clear, that it is from volume II:
```
% Following environment is to fake file Vol-Two.toc of external document
% Vol-Two.tex. Don't use this for a real document!
\begin{filecontents}{Vol-Two.toc}
\babel@toc {german}{}\relax
\contentsline {chapter}{\numberline {A}Grundbegriffe}{5}{}%
\contentsline {section}{\numberline {A.1}Zwillingsparadoxon}{5}{}%
\contentsline {section}{\numberline {A.2}Wellengleichung}{5}{}%
\providecommand \tocbasic@end@toc@file {}\tocbasic@end@toc@file
\end{filecontents}
\documentclass[12pt,a4paper,ngerman]{scrbook}
\usepackage[german]{babel}
\usepackage{xr}
\externaldocument{Vol-Two}
\pagestyle{headings}\markright{Begriffs--Sammlung}
\newcommand\voliiprefixnumber[1]{II-#1}%
\newcommand\voliiprefixnumberbf[1]{\textbf{II-#1}}%
\makeatletter
\AfterStartingTOC[toc]{%
\minisec{Volume-II}% print an additional small heading to group the ToC
\DeclareTOCStyleEntries[pagenumberformat=\voliiprefixnumberbf,pagenumberwidth=2.5em]{tocline}{part,chapter}%
\DeclareTOCStyleEntries[pagenumberformat=\voliiprefixnumber,pagenumberwidth=2.5em]{tocline}{section,subsection,subsubsection}%
\begingroup
\makeatletter
\InputIfFileExists{Vol-Two.toc}{% USE THE SAME BASENAME AS FOR \externaldocument!
\typeout{ToC of external document read}%
}{%
\typeout{Cannot find ToC of external document}%
}%
\endgroup
}
\makeatother
\begin{document}
\title{Begriffs-- und Problemsammlung\\
zur Theoretischen Physik\\
\vspace*{24pt}I. Begriffe}
\author{Ralph v. Baltz}
\maketitle
% how to show TOC of both Vol.I and II?
\tableofcontents
\chapter[Grundbegriffe]{Grundbegriffe}
\label{GBegr}
Wenn wir von der Physik als Wissenschaft sprechen, so meinen wir einen Wissens-- und Erfahrungsschatz der
\emph{reproduzierbaren Ph\"anomene} der Natur,
den der Mensch im Lauf der Geschichte angesammelt und mit gro\ss em Erfolg systematisiert hat.
\newpage
\section{Physik, Mathematik und mehr}
Theorie als mathematisches Modell der Naturvorg\"ange.
Einstein ber\"uhmte Gleichung (\ref{eq1}).
\chapter{Mechanik}
Die Klassische Mechanik beschreibt ----
\section{Newton'sche Formulierung}
\end{document}
```
See the KOMA-Script manual for more information about `\DeclareTOCStyleEntries`.
|
5
|
https://tex.stackexchange.com/users/277964
|
690722
| 320,418 |
https://tex.stackexchange.com/questions/690700
|
10
|
I want to define a macro in a group in LaTeX3 so that it stays defined after the group, but without using global variables. For now I do:
```
\documentclass{article}
\ExplSyntaxOn
\NewDocumentEnvironment{test}{}{}{
\str_clear_new:N \mytest
\str_put_right:Nx \mytest {I ~ like ~}
\str_gset_eq:NN \dummyvar \mytest
\group_insert_after:N \str_set_eq:NN
\group_insert_after:N \mytest
\group_insert_after:N \dummyvar
}
\ExplSyntaxOff
\begin{document}
\def\mytest{chocolate.}
{
\begin{test}
I’d like mytest to be defined at the end of the group without using global variables.
\end{test}
\mytest
}
\mytest
\end{document}
```
It works, but it seems really dirty, like I need to introduce a global dummy var etc… I tried to do:
```
\group_insert_after:N \str_set_eq:NN
\group_insert_after:N \mytest
\expandafter \group_insert_after:N \mytest
```
But funnily, the string is written backward now!! I also tried to generate a variant of `\group_insert_after:V` but it is forbidden.
|
https://tex.stackexchange.com/users/116348
|
Latex3: elegant way to forward a variable outside of the group
| false |
The following defines a mechanism to smuggle things up one level with a single auxiliary global token.
It won't work for `toks` registers. I hope I didn't screw up on other points of the implementation.
```
\documentclass{article}
\ExplSyntaxOn
\tl_new:N \g__tobiasbora_smuggler_tl
\cs_new:Npn \tobiasbora_smuggle:n #1
{
\tl_gset:Nx \g__tobiasbora_smuggler_tl
{
\tl_map_function:nN {#1} \__tobiasbora_smuggle:N
\exp_not:n { \tl_gset:Nn \g__tobiasbora_smuggler_tl }
{ \exp_not:o \g__tobiasbora_smuggler_tl }
}
\group_insert_after:N \g__tobiasbora_smuggler_tl
}
\cs_new:Npn \__tobiasbora_smuggle:N #1
{
\token_if_macro:NTF #1
{
\exp_not:n { \cs_set:Npx #1 }
{ \exp_not:N \exp_not:n { \exp_not:o #1 } }
}
{
\token_if_chardef:NTF #1
{ \exp_not:n { \chardef #1 } = \exp_not:V #1 \scan_stop: }
{
\token_if_mathchardef:NTF #1
{ \exp_not:n { \mathchardef #1 } = \exp_not:V #1 \scan_stop: }
{
% assume it's a register type and the following is fine
#1 = \exp_not:V #1 \scan_stop:
}
}
}
}
\NewDocumentEnvironment{test}{}{}{
\str_set:Nn \mytest { like~ }
\tobiasbora_smuggle:n { \mytest \mycount }
}
\ExplSyntaxOff
\newcount\mycount
\mycount=0
\begin{document}
\def\mytest{chocolate.}
{
\begin{test}
I’d like mytest to be defined at the end of the group without using global variables.
\mycount=1
\end{test}%
\uppercase\expandafter{\romannumeral\mycount} % this prints "I"
\mytest
}%
\mytest
\romannumeral\mycount % this prints nothing as it's 0 again
\end{document}
```
|
4
|
https://tex.stackexchange.com/users/117050
|
690723
| 320,419 |
https://tex.stackexchange.com/questions/660370
|
0
|
I would like to show the page numbering on the footer for each page on List Of Figure.
It is just showing on the first page of the List of figures.
The LaTex code is below:
```
\renewcommand\listoffigures{%
\coppe@hasLof
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\listfigurename}%
\addcontentsline{toc}{chapter}{\listfigurename}%
\@mkboth{\MakeUppercase\listfigurename}%
{\MakeUppercase\listfigurename}%
\@starttoc{lof}%
\if@restonecol\twocolumn\fi
}
```
|
https://tex.stackexchange.com/users/282196
|
Page Numbering on List of Figures
| false |
Maybe I can expand Bruno's question, since it looks like I have the same problem.
```
\documentclass[12pt,oneside]{book}
\input{./structure.tex}
\onehalfspacing
%\usepackage{tocloft}
%\tocloftpagestyle{plain}
\begin{document}
\input{./title.tex}
\pagestyle{empty}
\input{./Chapters/thanks}
\cleardoublepage
\pagenumbering{roman}
\setcounter{page}{1}
\input{./Chapters/abstract}
\cleardoublepage
\setcounter{page}{1}
\cleardoublepage
\tableofcontents
\cleardoublepage
\protect \addcontentsline{toc}{chapter}{\listfigurename}
\listoffigures
\cleardoublepage
\protect \addcontentsline{toc}{chapter}{\listtablename}
\listoftables
\cleardoublepage
\pagenumbering{arabic}
\pagestyle{plain}
\setcounter{page}{1}
\input{./Chapters/1_intro.tex}
\renewcommand{\bibname}{\uppercase{Literatura}}
\addcontentsline{toc}{chapter}{\textbf{Literatura}}
\bibliographystyle{unsrtnat-GFRI}
%\bibliographystyle{ksfh_nat}
\bibliography{bibliography}
\bibliographystyle{vancouver}
```
"structure.tex" contains all the packages needed for compilation. I can add it if neccesary.
What happends with the code, it adds page numbering to table of contents, list of figures and list of tables. The list of figures starts with "ii" and the list of tables starts with "iv" as it should be, but there is no "iii" on the second page of list of figures.
|
1
|
https://tex.stackexchange.com/users/44173
|
690726
| 320,421 |
https://tex.stackexchange.com/questions/690648
|
2
|
The following code will draw a sequence of length 2 bit-strings:
```
\documentclass[tikz]{standalone}
\usetikzlibrary{chains}
\begin{document}
\begin{tikzpicture}[
2-bin helper/.code 2 args={#1 #2},
2-bin 00/.style={fill=cyan!50!green!50},
2-bin 10/.style={fill=green!50!yellow},
2-bin 01/.style={fill=red},
2-bin 11/.style={fill=black, text=white},
start chain=going right,
node distance=.1em, inner xsep=.1em, % A is the widest character:
every on chain/.append style={text width=width("A"), align=center}]
\sffamily
\node[every on chain] at (-5mm,0) {A B};
\foreach \binary in {10,01,10,01,10,01,10,01,00,00,00,00,00,00,00,11}
\node[on chain, 2-bin \binary] {\tikzset{2-bin helper/.expand once=\binary}};
\end{tikzpicture}
\end{document}
```
How can I modify it to draw length 3 bitstrings?
|
https://tex.stackexchange.com/users/92346
|
Draw sequence of coloured rectangled fix-length bit-strings
| false |
Another solution with a `matrix`
```
\documentclass[tikz]{standalone}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}[
red column/.style={column #1/.append style={nodes={fill=red}}},
green column/.style={column #1/.append style={nodes={fill=green}}},
black column/.style={column #1/.append style={nodes={fill=black, text=white}}},]
\matrix[matrix of nodes, column sep=2pt,
nodes={minimum height=5mm, anchor=center, font=\sffamily},
red column/.list={2,...,6}, green column/.list={9,11},
black column/.list={8}]
{A & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 1\\
B & 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 & 0\\
C & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0\\};
\end{tikzpicture}
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/1952
|
690736
| 320,423 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.